refactor(channels): make built-in channels self-contained (#4908)

* refactor(channels): own setup and instance contracts

* refactor(channels): isolate management contracts

* refactor(channels): normalize activation contracts

* fix(channels): enforce management contracts

* refactor(channels): finish setup ownership migration

* fix(channels): harden management contracts

* fix(channels): enforce lazy loading and runtime ownership

* fix(feishu): make multi-instance startup idempotent

* fix(webui): render channel setup contracts cleanly

* fix(feishu): stop websocket clients cleanly

* fix(channels): enforce persistence and activation gates

* fix(channels): preserve global feature action scope

* fix(channels): apply defaults for single plugins

* fix(channels): enforce management contract boundaries

* refactor(feishu): remove identity helper indirection

* fix(channels): preserve management setup contracts

* refactor(channels): generalize instance settings UI

* refactor(channels): package channel plugins with web UI metadata

* refactor(channels): make built-ins self-contained packages

* test(channels): colocate tests with channel packages

* fix(dingtalk): use official brand icon

* feat(channels): colocate webui translations

* docs(channels): clarify plugin ownership

* test(exec): remove output wait race

* refactor(channels): unify plugin descriptors

* fix(channels): enforce descriptor-owned contracts

* refactor(channels): finish package-owned plugin setup

* refactor(channels): use repository-owned packages only

* fix(channels): self-describe dependencies and runtime state

* fix(channels): warn about legacy entry points
This commit is contained in:
chengyongru
2026-07-19 23:30:49 +08:00
committed by GitHub
parent 7aaac37bca
commit 462a0dfb0f
388 changed files with 17093 additions and 5110 deletions
+47 -1
View File
@@ -136,6 +136,48 @@ const LOCALIZED_WORKSPACE_COPY_KEYS = [
"workspace.dialog.usePath",
"workspace.dialog.absolutePathRequired",
];
const LOCALIZED_CHANNEL_SHELL_KEYS = [
"settings.channels.advanced",
"settings.channels.checkAndEnable",
"settings.channels.checkConnection",
"settings.channels.checkedAndEnabled",
"settings.channels.checking",
"settings.channels.checkOnly",
"settings.channels.commandCopied",
"settings.channels.commandCopyFailed",
"settings.channels.configuredInstances",
"settings.channels.connectPreview",
"settings.channels.copyCommand",
"settings.channels.filterAll",
"settings.channels.filterOff",
"settings.channels.filterOn",
"settings.channels.helperCopied",
"settings.channels.helperCopyFailed",
"settings.channels.hideSecret",
"settings.channels.instanceConfigured",
"settings.channels.instanceNeedsSetup",
"settings.channels.managedByWebui",
"settings.channels.officialGuide",
"settings.channels.optional",
"settings.channels.providerPreset",
"settings.channels.requiredSetup",
"settings.channels.savedSecret",
"settings.channels.savedSecretPlaceholder",
"settings.channels.savedSettings",
"settings.channels.saveSettings",
"settings.channels.selectChannel",
"settings.channels.setupSteps",
"settings.channels.showSecret",
"settings.channels.toggleChannel",
"settings.channels.toggleInstance",
"settings.channels.tryIt",
"settings.channels.validation.connected",
"settings.channels.validation.configured",
"settings.channels.validation.invalid",
"settings.channels.validation.needs_setup",
"settings.channels.validation.unsupported",
"settings.channels.validationFailed",
];
const INDEX_HTML = readFileSync(resolve(process.cwd(), "index.html"), "utf8");
const PREBOOT_SCRIPT = INDEX_HTML.match(
/<script>\s*(\(function \(\) \{\s*var localeKey = "nanobot\.locale";[\s\S]*?\}\)\(\);)\s*<\/script>/,
@@ -375,7 +417,11 @@ describe("webui i18n", () => {
for (const [locale, resource] of Object.entries(resources)) {
if (locale === "en") continue;
const current = flattenResource(resource.common);
const leaked = [...LOCALIZED_SETTINGS_COPY_KEYS, ...LOCALIZED_WORKSPACE_COPY_KEYS].filter(
const leaked = [
...LOCALIZED_SETTINGS_COPY_KEYS,
...LOCALIZED_WORKSPACE_COPY_KEYS,
...LOCALIZED_CHANNEL_SHELL_KEYS,
].filter(
(key) => current.get(key) === english.get(key),
);