From e91a77a899a59987e43ec490b0746b7d98ce2aa4 Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Tue, 6 Oct 2026 02:31:01 +0800 Subject: [PATCH] test(plugin): align native bundle fixtures and publication manifests --- apps/cli/tests/web-agent-presets.e2e.ts | 23 ++++++++----------- .../subagent-claude-code/package.json | 6 ++--- packages/subagent/subagent-codex/package.json | 6 ++--- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/apps/cli/tests/web-agent-presets.e2e.ts b/apps/cli/tests/web-agent-presets.e2e.ts index 14d49d2a2b..a9d0e6c839 100644 --- a/apps/cli/tests/web-agent-presets.e2e.ts +++ b/apps/cli/tests/web-agent-presets.e2e.ts @@ -192,16 +192,6 @@ function toolParameterNames(ctx: Context, agent: Agent, toolName: string): strin return Object.keys(properties).sort() } -function enablePresetTool(composition: string, id: string): string { - const rows = load(composition, { schema: entryListSchema }) as import('@deepseek-ai/cordis-plugin-loader').EntryOptions[] - const visit = (entries: typeof rows): boolean => entries.some((row) => { - if (row.id === id) { row.disabled = false; return true } - return row.group === true && visit(row.config as typeof rows) - }) - if (!visit(rows)) throw new Error(`missing preset row ${id}`) - return dump(rows, { schema: entryListSchema }) -} - let ctx: Context beforeAll(async () => { ctx = await bootWeb(await mkdtemp(join(tmpdir(), 'dsh-web-presets-'))) @@ -547,14 +537,19 @@ describe('product Bundle and user-preset intersection', () => { const standardConfig = composeEntries([webPatches('test')]).find(row => row.id === 'preset-standard')!.config as import('@deepseek-ai/dsh-agent-preset-registry').PresetDefinition const standard = dump(standardConfig.plugins, { schema: entryListSchema }) for (const id of presetIds) { - let composition = standard + const plugins = load(standard, { schema: entryListSchema }) as import('@deepseek-ai/cordis-plugin-loader').EntryOptions[] + // User presets declare their own delegation rows; provider bundles target only the three full shipped presets. if (id === 'products-codex' || id === 'products-both') { - composition = enablePresetTool(composition, 'tool-subagent-codex') + plugins.push({ id: 'custom-tool-subagent-codex', name: '@deepseek-ai/dsh-tool-subagent', config: { + provider: 'codex', toolName: 'subagent_codex', backgroundMode: 'one-shot', maxDepth: 'provider-managed', + } }) } if (id === 'products-claude' || id === 'products-both') { - composition = enablePresetTool(composition, 'tool-subagent-claude-code') + plugins.push({ id: 'custom-tool-subagent-claude-code', name: '@deepseek-ai/dsh-tool-subagent', config: { + provider: 'claude-code', toolName: 'subagent_claude_code', backgroundMode: 'one-shot', maxDepth: 'provider-managed', + } }) } - definitions.push({ id: `preset-${id}`, name: '@deepseek-ai/dsh-agent-preset', config: { id, plugins: load(composition, { schema: entryListSchema }) } }) + definitions.push({ id: `preset-${id}`, name: '@deepseek-ai/dsh-agent-preset', config: { id, plugins } }) } const packageDir = (product: Product): string => ( product === 'codex' ? CODEX_PACKAGE_DIR : CLAUDE_CODE_PACKAGE_DIR diff --git a/packages/subagent/subagent-claude-code/package.json b/packages/subagent/subagent-claude-code/package.json index d529f2c8f5..13c252c227 100644 --- a/packages/subagent/subagent-claude-code/package.json +++ b/packages/subagent/subagent-claude-code/package.json @@ -24,11 +24,11 @@ "./cordis.patch.yml": "./cordis.patch.yml" }, "files": [ + "icon.svg", + "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts", - "icon.svg", - "locale/*.json" + "lib/types/**/*.d.ts" ], "license": "MIT", "dsh": { diff --git a/packages/subagent/subagent-codex/package.json b/packages/subagent/subagent-codex/package.json index 96300f97d2..1d3daa2d58 100644 --- a/packages/subagent/subagent-codex/package.json +++ b/packages/subagent/subagent-codex/package.json @@ -24,11 +24,11 @@ "./cordis.patch.yml": "./cordis.patch.yml" }, "files": [ + "icon.svg", + "locale/*.json", "lib/index.js", "cordis.patch.yml", - "lib/types/**/*.d.ts", - "icon.svg", - "locale/*.json" + "lib/types/**/*.d.ts" ], "license": "MIT", "dsh": {