diff --git a/plugins/quicker-dsh/cordis.patch.yml b/plugins/quicker-dsh/cordis.patch.yml index ae54bf7..7b3fe95 100644 --- a/plugins/quicker-dsh/cordis.patch.yml +++ b/plugins/quicker-dsh/cordis.patch.yml @@ -1,5 +1,6 @@ # Insert the Quicker bundle. index.js resolves the stdio relay path and -# loads @deepseek-ai/dsh-mcp-client so the token never enters this file. +# registers @deepseek-ai/dsh-mcp-client through ctx.loader.create so the +# token never enters this file. - insert: - id: quicker name: dsh-plugin-quicker diff --git a/plugins/quicker-dsh/index.js b/plugins/quicker-dsh/index.js index 380ec65..a06b190 100644 --- a/plugins/quicker-dsh/index.js +++ b/plugins/quicker-dsh/index.js @@ -7,7 +7,7 @@ const RELAY_SCRIPT = 'quicker-mcp.ps1' const SKILL_FILE = join(PACKAGE_ROOT, 'skills', 'write-action', 'SKILL.md') export const name = 'quicker' -export const inject = ['tools'] +export const inject = ['tools', 'loader'] export function resolvePackageRoot() { return PACKAGE_ROOT @@ -68,8 +68,26 @@ function injectAuthoringGuide(agent) { } } -export function apply(ctx) { - ctx.plugin('@deepseek-ai/dsh-mcp-client', mcpClientConfig()) +export async function apply(ctx) { + // Cordis ctx.plugin() only accepts a function or { apply }. Package names + // must go through the DSH loader, which resolves host packages such as + // @deepseek-ai/dsh-mcp-client from the desktop/CLI install. + const loader = ctx.loader + if (loader == null || typeof loader.create !== 'function') { + throw new Error('dsh-plugin-quicker requires the DSH loader to register @deepseek-ai/dsh-mcp-client') + } + + await ctx.effect(async () => { + const id = await loader.create({ + name: '@deepseek-ai/dsh-mcp-client', + config: mcpClientConfig(), + }) + return async () => { + if (loader.store?.[id] === undefined) return + await loader.remove(id) + } + }, 'dsh-plugin-quicker: mcp-client') + ctx.on('agent/session-start', ({ agent }) => { injectAuthoringGuide(agent) }) diff --git a/tests/test_install_clients.py b/tests/test_install_clients.py index 7fa23f8..4c2f88c 100644 --- a/tests/test_install_clients.py +++ b/tests/test_install_clients.py @@ -30,6 +30,9 @@ def test_shared_sources_and_manifests(self): self.assertIn("@deepseek-ai/dsh-mcp-client", index) self.assertIn("'dsh'", index) self.assertIn('agent/session-start', index) + self.assertIn('loader.create', index) + self.assertIn("'loader'", index) + self.assertNotIn("ctx.plugin('@deepseek-ai/dsh-mcp-client'", index) @unittest.skipUnless(POWERSHELL, 'Windows PowerShell required')