@zoraxylia/dsh-codex-adapter 0.1.14 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-adapter",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Dispatch subtasks to DeepSeek Harness (DSH) agents as native subagents with live progress",
5
5
  "author": {
6
6
  "name": "zx-yk"
package/lib/client.js CHANGED
@@ -404,6 +404,8 @@ const COPY = {
404
404
  title: "DSH Adapter",
405
405
  intro: "Claude Code / Codex 可以给 DSH agent 分派任务,在宿主里显示为原生子代理、进度可见。配置派发默认值、执行方式,以及接入视觉与生图能力,一键装进宿主。",
406
406
  integrations: "集成",
407
+ globalMcp: "Codex 全局 MCP(CLI 与桌面端都可直接调用)",
408
+ globalMcpHint: "关闭后只安装 ds-flash / ds-pro 子代理角色,不注册全局 MCP;桌面端将无法直接调用。",
407
409
  collapse: "折叠",
408
410
  expand: "展开",
409
411
  doneAt: (t) => `已更新 · ${t}`,
@@ -574,6 +576,8 @@ const COPY = {
574
576
  title: "DSH Adapter",
575
577
  intro: "Claude Code / Codex can dispatch tasks to DSH agents and see them as native subagents in the host with live progress. Configure dispatch defaults, execution mode, and vision / image-generation access, then install into the host in one click.",
576
578
  integrations: "Integrations",
579
+ globalMcp: "Codex global MCP (callable from both CLI and the desktop client)",
580
+ globalMcpHint: "When off, only the ds-flash / ds-pro agent roles are installed; the desktop client cannot call the worker tools directly.",
577
581
  collapse: "Collapse",
578
582
  expand: "Expand",
579
583
  doneAt: (t) => `Updated · ${t}`,
@@ -1799,7 +1803,34 @@ function WorkersPanel({ ctx }) {
1799
1803
  }) : null, "claude", "claude-uninstall", copy.tips.claude),
1800
1804
  integrationRow("Codex", !!status?.codex?.installed, null, "codex", "codex-uninstall", copy.tips.codex),
1801
1805
  integrationRow("Antigravity", !!status?.agy?.installed, null, "agy", "agy-uninstall", copy.tips.agy),
1802
- integrationRow("Grok", !!status?.grok?.installed, null, "grok", "grok-uninstall", copy.tips.grok)
1806
+ integrationRow("Grok", !!status?.grok?.installed, null, "grok", "grok-uninstall", copy.tips.grok),
1807
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1808
+ style: {
1809
+ display: "flex",
1810
+ alignItems: "center",
1811
+ gap: 6,
1812
+ fontSize: 12,
1813
+ paddingLeft: 2,
1814
+ opacity: config ? 1 : .5
1815
+ },
1816
+ title: copy.globalMcpHint,
1817
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1818
+ type: "checkbox",
1819
+ checked: config?.codex_global_mcp !== false,
1820
+ disabled: busy || !config,
1821
+ onChange: (e) => {
1822
+ const on = e.target.checked;
1823
+ setConfig((c) => ({
1824
+ ...c,
1825
+ codex_global_mcp: on
1826
+ }));
1827
+ post("/config", { codex_global_mcp: on }).then((r) => {
1828
+ if (r.ok) setConfig(r.config);
1829
+ if (status?.codex?.installed) act("codex");
1830
+ });
1831
+ }
1832
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: copy.globalMcp })]
1833
+ })
1803
1834
  ]
1804
1835
  }),
1805
1836
  sectionHeader(copy.globalConfig, globalConfigCollapsed, toggleGlobalConfig),
package/lib/server.mjs CHANGED
@@ -14402,6 +14402,9 @@ var GLOBAL_CONFIG_DEFAULTS = {
14402
14402
  // auto = orchestrator picks the tier; flash-only / pro-only clamp every
14403
14403
  // dispatch to one tier at the tool layer regardless of what was requested.
14404
14404
  tier_policy: "auto",
14405
+ // Register the MCP server globally in ~/.codex/config.toml so the Codex
14406
+ // desktop client (which has no subagent spawn UI) can call the worker tools.
14407
+ codex_global_mcp: true,
14405
14408
  // When a blocking flash run fails, retry the same task once on pro.
14406
14409
  escalate_on_failure: false,
14407
14410
  // Multimodal bridge: which subscription CLI lends the text-only DS model
@@ -15069,7 +15072,7 @@ function describeBindings(config = {}) {
15069
15072
  }
15070
15073
 
15071
15074
  // src/server.mjs
15072
- var server = new McpServer({ name: "dsh-adapter", version: "0.1.14" });
15075
+ var server = new McpServer({ name: "dsh-adapter", version: "0.1.15" });
15073
15076
  var tierSchema = external_exports.enum(["flash", "pro"]).optional().describe("Worker model tier. flash = mechanical, well-scoped work (single-file edits, lookups, formatting); pro = multi-file changes, debugging, design judgment. Omit to use the session default. Ignored when worker= is set.");
15074
15077
  var effortSchema = external_exports.enum(["off", "high", "max"]).optional().describe("Reasoning effort for the worker. Omit to use the session default. With worker= it only applies when passed explicitly and the profile supports it (agy maps to low/medium/high).");
15075
15078
  var workerSchema = external_exports.string().optional().describe('Named CLI worker profile (e.g. "agy" or "grok"). Explicit opt-in only: set it when the user explicitly asks for that external coding CLI, never as a default. When set, dispatch bypasses tier/mode and runs the task through that CLI; the profile pins backend\xD7model\xD7effort. See dsh_worker_config output, worker_profiles field, for the available profiles.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zoraxylia/dsh-codex-adapter",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "type": "module",
5
5
  "main": "./src/hub/index.mjs",
6
6
  "description": "Dispatch tasks from Claude Code / Codex to DSH agents as native subagents with live progress; configure dispatch defaults, execution mode, and vision / image-generation access, installed into the host in one click.",
@@ -88,6 +88,8 @@ const COPY = {
88
88
  title: 'DSH Adapter',
89
89
  intro: 'Claude Code / Codex 可以给 DSH agent 分派任务,在宿主里显示为原生子代理、进度可见。配置派发默认值、执行方式,以及接入视觉与生图能力,一键装进宿主。',
90
90
  integrations: '集成',
91
+ globalMcp: 'Codex 全局 MCP(CLI 与桌面端都可直接调用)',
92
+ globalMcpHint: '关闭后只安装 ds-flash / ds-pro 子代理角色,不注册全局 MCP;桌面端将无法直接调用。',
91
93
  collapse: '折叠', expand: '展开',
92
94
  doneAt: (t: string) => `已更新 · ${t}`,
93
95
  installed: '已安装', notInstalled: '未安装', hud: 'HUD 段',
@@ -182,6 +184,8 @@ const COPY = {
182
184
  title: 'DSH Adapter',
183
185
  intro: 'Claude Code / Codex can dispatch tasks to DSH agents and see them as native subagents in the host with live progress. Configure dispatch defaults, execution mode, and vision / image-generation access, then install into the host in one click.',
184
186
  integrations: 'Integrations',
187
+ globalMcp: 'Codex global MCP (callable from both CLI and the desktop client)',
188
+ globalMcpHint: 'When off, only the ds-flash / ds-pro agent roles are installed; the desktop client cannot call the worker tools directly.',
185
189
  collapse: 'Collapse', expand: 'Expand',
186
190
  doneAt: (t: string) => `Updated · ${t}`,
187
191
  installed: 'installed', notInstalled: 'not installed', hud: 'HUD segment',
@@ -813,6 +817,19 @@ function WorkersPanel({ ctx }: { ctx: any }) {
813
817
  {integrationRow('Codex', !!status?.codex?.installed, null, 'codex', 'codex-uninstall', (copy as any).tips.codex)}
814
818
  {integrationRow('Antigravity', !!status?.agy?.installed, null, 'agy', 'agy-uninstall', (copy as any).tips.agy)}
815
819
  {integrationRow('Grok', !!status?.grok?.installed, null, 'grok', 'grok-uninstall', (copy as any).tips.grok)}
820
+ <label style={{ display: 'flex', alignItems: 'center', gap: 6, fontSize: 12, paddingLeft: 2, opacity: config ? 1 : 0.5 }}
821
+ title={copy.globalMcpHint}>
822
+ <input type="checkbox" checked={config?.codex_global_mcp !== false} disabled={busy || !config}
823
+ onChange={(e) => {
824
+ const on = e.target.checked;
825
+ setConfig((c: any) => ({ ...c, codex_global_mcp: on }));
826
+ void post('/config', { codex_global_mcp: on }).then((r) => {
827
+ if (r.ok) setConfig(r.config);
828
+ if (status?.codex?.installed) void act('codex');
829
+ });
830
+ }} />
831
+ <span>{copy.globalMcp}</span>
832
+ </label>
816
833
  </div>
817
834
  )}
818
835
 
package/src/hub/index.mjs CHANGED
@@ -890,7 +890,7 @@ export async function apply(ctx) {
890
890
  actions: [...base.actions, ...hud.actions.map((a) => `hud: ${a}`)],
891
891
  });
892
892
  }
893
- if (target === 'codex') return sendJson(res, 200, installCodex({}));
893
+ if (target === 'codex') return sendJson(res, 200, installCodex({ globalMcp: hub.getConfig().codex_global_mcp !== false }));
894
894
  if (target === 'agy') return sendJson(res, 200, installAgy({}));
895
895
  if (target === 'grok') return sendJson(res, 200, installGrok({}));
896
896
  if (target === 'claude-uninstall') return sendJson(res, 200, await uninstallClaudeCode({}));
@@ -83,6 +83,9 @@ export const GLOBAL_CONFIG_DEFAULTS = {
83
83
  // auto = orchestrator picks the tier; flash-only / pro-only clamp every
84
84
  // dispatch to one tier at the tool layer regardless of what was requested.
85
85
  tier_policy: 'auto',
86
+ // Register the MCP server globally in ~/.codex/config.toml so the Codex
87
+ // desktop client (which has no subagent spawn UI) can call the worker tools.
88
+ codex_global_mcp: true,
86
89
  // When a blocking flash run fails, retry the same task once on pro.
87
90
  escalate_on_failure: false,
88
91
  // Multimodal bridge: which subscription CLI lends the text-only DS model
@@ -390,7 +393,7 @@ function removeCodexMcp(text) {
390
393
  return [...lines.slice(0, start), ...lines.slice(end)].join('\n');
391
394
  }
392
395
 
393
- export function installCodex({ home = homedir(), scope } = {}) {
396
+ export function installCodex({ home = homedir(), scope, globalMcp = true } = {}) {
394
397
  const actions = [];
395
398
  const agentsDir = scope === 'project' ? join(process.cwd(), '.codex', 'agents') : join(home, '.codex', 'agents');
396
399
  mkdirSync(agentsDir, { recursive: true });
@@ -417,6 +420,17 @@ export function installCodex({ home = homedir(), scope } = {}) {
417
420
  const configFile = join(process.env.CODEX_HOME || join(home, '.codex'), 'config.toml');
418
421
  mkdirSync(dirname(configFile), { recursive: true });
419
422
  const before = existsSync(configFile) ? readFileSync(configFile, 'utf8') : '';
423
+ if (!globalMcp) {
424
+ if (before.includes('[mcp_servers.dsh-adapter]')) {
425
+ const bak = backup(configFile);
426
+ if (bak) actions.push(`backup: ${bak}`);
427
+ writeFileSync(configFile, removeCodexMcp(before));
428
+ actions.push('mcp: global registration disabled — entry removed');
429
+ } else {
430
+ actions.push('mcp: global registration disabled');
431
+ }
432
+ return { ok: true, actions };
433
+ }
420
434
  const bak = backup(configFile);
421
435
  if (bak) actions.push(`backup: ${bak}`);
422
436
  const launcher = resolveNodeLauncher();
package/src/server.mjs CHANGED
@@ -12,7 +12,7 @@ import { acquireCwdLock, releaseCwdLockByJobId, updateCwdLockHolder, getCwdLocks
12
12
  import { resolveWorkerCwd } from './paths.mjs';
13
13
  import { detectOrchestrator } from './process-info.mjs';
14
14
 
15
- const server = new McpServer({ name: 'dsh-adapter', version: '0.1.14' });
15
+ const server = new McpServer({ name: 'dsh-adapter', version: '0.1.15' });
16
16
 
17
17
  const tierSchema = z.enum(['flash', 'pro']).optional().describe('Worker model tier. flash = mechanical, well-scoped work (single-file edits, lookups, formatting); pro = multi-file changes, debugging, design judgment. Omit to use the session default. Ignored when worker= is set.');
18
18
  const effortSchema = z.enum(['off', 'high', 'max']).optional().describe('Reasoning effort for the worker. Omit to use the session default. With worker= it only applies when passed explicitly and the profile supports it (agy maps to low/medium/high).');