@zoraxylia/dsh-codex-adapter 0.1.0 → 0.1.2

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.
Files changed (66) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/.mcp.json +1 -1
  4. package/README.de.md +32 -32
  5. package/README.es.md +32 -32
  6. package/README.fr.md +32 -32
  7. package/README.hi.md +32 -32
  8. package/README.id.md +32 -32
  9. package/README.ja.md +32 -32
  10. package/README.ko.md +32 -32
  11. package/README.md +33 -33
  12. package/README.pt.md +32 -32
  13. package/README.ru.md +32 -32
  14. package/README.th.md +32 -32
  15. package/README.tr.md +32 -32
  16. package/README.vi.md +32 -32
  17. package/README.zh-TW.md +32 -32
  18. package/README.zh.md +33 -33
  19. package/agy/agents/ds-flash.md +1 -1
  20. package/agy/agents/ds-pro.md +1 -1
  21. package/agy/skills/dsh-playbook/SKILL.md +1 -1
  22. package/codex/agents/ds-flash.toml +2 -2
  23. package/codex/agents/ds-pro.toml +2 -2
  24. package/codex/prompts/dsh-playbook.md +1 -1
  25. package/commands/off.md +1 -1
  26. package/commands/playbook.md +1 -1
  27. package/cordis.patch.yml +2 -2
  28. package/grok/agents/ds-flash.md +1 -1
  29. package/grok/agents/ds-pro.md +1 -1
  30. package/grok/commands/dsh-config.md +1 -1
  31. package/grok/commands/dsh-playbook.md +2 -2
  32. package/grok/commands/dsh-status.md +1 -1
  33. package/lib/client.js +37 -27
  34. package/lib/server.mjs +22 -22
  35. package/package.json +6 -5
  36. package/scripts/bump-version.mjs +79 -0
  37. package/scripts/fake-agy.sh +3 -3
  38. package/scripts/release-local.mjs +2 -2
  39. package/scripts/smoke-bundle.mjs +2 -2
  40. package/scripts/smoke-pack.mjs +4 -4
  41. package/scripts/smoke.mjs +3 -3
  42. package/scripts/verify-wpc10-client.mjs +2 -2
  43. package/scripts/verify-wpc14-proc-endpoints.mjs +6 -6
  44. package/scripts/verify-wpc9-guardrails.mjs +10 -10
  45. package/src/cli-workers.mjs +1 -1
  46. package/src/client/index.tsx +34 -32
  47. package/src/cwd-lock.mjs +1 -1
  48. package/src/hub/index.mjs +31 -10
  49. package/src/hub-client.mjs +4 -4
  50. package/src/install/install.mjs +35 -32
  51. package/src/jobs.mjs +2 -2
  52. package/src/multimodal.mjs +18 -18
  53. package/src/origin-guard.mjs +8 -8
  54. package/src/plugin-env.mjs +2 -2
  55. package/src/proc-kill.mjs +5 -5
  56. package/src/provider-probe.mjs +3 -3
  57. package/src/server.mjs +4 -4
  58. package/src/status-shard.mjs +2 -2
  59. package/src/vision-route.mjs +3 -3
  60. package/statusline/statusline.sh +1 -1
  61. package/statusline/worker-segment.sh +3 -3
  62. package/worker.cordis.yml +1 -1
  63. /package/docs/images/{dsh-crew-host.png → dsh-adapter-host.png} +0 -0
  64. /package/docs/images/{dsh-crew-jobs.png → dsh-adapter-jobs.png} +0 -0
  65. /package/docs/images/{dsh-crew-logo.png → dsh-adapter-logo.png} +0 -0
  66. /package/docs/images/{dsh-crew-overview.png → dsh-adapter-overview.png} +0 -0
@@ -3,7 +3,7 @@
3
3
  // subscription CLIs (claude -p, codex exec, agy).
4
4
  //
5
5
  // Vision ladder (WPC11): native DeepSeek VL model deepseek-v4-flash-vision-exp
6
- // (direct API call, key from DEEPSEEK_API_KEY or ~/.config/dsh-crew/.env — the
6
+ // (direct API call, key from DEEPSEEK_API_KEY or ~/.config/dsh-adapter/.env — the
7
7
  // same source the standalone dispatch uses) is preferred whenever a key is
8
8
  // available; every failure degrades to the pre-existing CLI provider chain,
9
9
  // which is kept byte-for-byte as the fallback. Image generation is untouched:
@@ -20,7 +20,7 @@ import { join, isAbsolute, dirname } from 'node:path';
20
20
  import { homedir } from 'node:os';
21
21
  import { tr, setLang } from './i18n.mjs';
22
22
 
23
- const CONFIG_DIR = join(homedir(), '.config', 'dsh-crew');
23
+ const CONFIG_DIR = join(homedir(), '.config', 'dsh-adapter');
24
24
  const CACHE_FILE = join(CONFIG_DIR, 'vision-cache.json');
25
25
  const CACHE_CAP = 200;
26
26
 
@@ -52,7 +52,7 @@ function loadDotEnv() {
52
52
  return dotEnv;
53
53
  }
54
54
 
55
- /** Key for the native call: env wins, then ~/.config/dsh-crew/.env (same
55
+ /** Key for the native call: env wins, then ~/.config/dsh-adapter/.env (same
56
56
  * precedence the standalone dispatch applies). */
57
57
  function deepseekApiKey() {
58
58
  return String(process.env.DEEPSEEK_API_KEY ?? '').trim() || String(loadDotEnv().DEEPSEEK_API_KEY ?? '').trim();
@@ -250,8 +250,8 @@ async function generateViaApi(entry, prompt, outputPath, size) {
250
250
  // fail late (or bill for nothing). Image generation is opt-in per provider.
251
251
  const m = String(entry.imagegen_model ?? '').trim();
252
252
  if (!m) throw new Error(tr(
253
- `自定义 provider "${entry.name ?? entry.id}" 未配置生图模型(在设置 → DSH Crew → 自定义 Provider 的"生图模型"里填写)`,
254
- `Custom provider "${entry.name ?? entry.id}" has no image-gen model (fill in "Image-gen model" under Settings → DSH Crew → Custom providers)`));
253
+ `自定义 provider "${entry.name ?? entry.id}" 未配置生图模型(在设置 → DSH Adapter → 自定义 Provider 的"生图模型"里填写)`,
254
+ `Custom provider "${entry.name ?? entry.id}" has no image-gen model (fill in "Image-gen model" under Settings → DSH Adapter → Custom providers)`));
255
255
  const body = { model: m, prompt, n: 1 };
256
256
  if (size && /^\d+x\d+$/.test(size)) body.size = size;
257
257
  const data = await fetchJson(`${base}/images/generations`, { apiKey: entry.api_key, timeoutMs: 480_000, body });
@@ -547,8 +547,8 @@ export async function listVisionModels(provider, force = false, getConfig = null
547
547
  function envelope(tool, text) { return { ok: true, tool, text }; }
548
548
 
549
549
  const VISION_PROVIDER_HINT = tr(
550
- `未知视觉 provider: PROVIDER(内置: ${BUILTIN_VISION.join(' / ')} / native,或在设置 → DSH Crew → 自定义 Provider 里添加)`,
551
- `Unknown vision provider: PROVIDER (built-in: ${BUILTIN_VISION.join(' / ')} / native, or add one under Settings → DSH Crew → Custom providers)`);
550
+ `未知视觉 provider: PROVIDER(内置: ${BUILTIN_VISION.join(' / ')} / native,或在设置 → DSH Adapter → 自定义 Provider 里添加)`,
551
+ `Unknown vision provider: PROVIDER (built-in: ${BUILTIN_VISION.join(' / ')} / native, or add one under Settings → DSH Adapter → Custom providers)`);
552
552
 
553
553
  /**
554
554
  * Cache key for one vision answer. The leading 'v3' version tag plus the
@@ -592,7 +592,7 @@ async function describeViaCli(provider, model, custom, imagePath, question) {
592
592
  */
593
593
  export async function describeFileWithProvenance(getConfig, imagePath, question) {
594
594
  const config = getConfig();
595
- const configured = config.vision_provider ?? 'claude-code';
595
+ const configured = config.vision_provider ?? 'codex';
596
596
  if (configured === 'off') throw new Error('vision bridge is disabled');
597
597
  const model = config.vision_model ?? 'haiku';
598
598
  const stat = statSync(imagePath);
@@ -604,7 +604,7 @@ export async function describeFileWithProvenance(getConfig, imagePath, question)
604
604
  }
605
605
  // For an explicit 'native' id the CLI degradation target is the default
606
606
  // chain entry; for built-in CLI providers it is that provider itself.
607
- const cliProvider = isNativeId ? 'claude-code' : configured;
607
+ const cliProvider = isNativeId ? 'codex' : configured;
608
608
  const useNativeLadder = BUILTIN_VISION.includes(configured) || isNativeId;
609
609
  const cache = readCache();
610
610
 
@@ -613,8 +613,8 @@ export async function describeFileWithProvenance(getConfig, imagePath, question)
613
613
  const apiKey = deepseekApiKey();
614
614
  if (!apiKey) {
615
615
  nativeIssue = { skipped: true, reason: tr(
616
- '缺少 DEEPSEEK_API_KEY(环境变量或 ~/.config/dsh-crew/.env)',
617
- 'no DEEPSEEK_API_KEY (env or ~/.config/dsh-crew/.env)') };
616
+ '缺少 DEEPSEEK_API_KEY(环境变量或 ~/.config/dsh-adapter/.env)',
617
+ 'no DEEPSEEK_API_KEY (env or ~/.config/dsh-adapter/.env)') };
618
618
  } else {
619
619
  const key = visionCacheKey({ backend: 'native', provider: 'deepseek', model: NATIVE_VISION_MODEL, imagePath, stat, question, baseUrl: deepseekBaseUrl() });
620
620
  if (cache[key]) {
@@ -626,11 +626,11 @@ export async function describeFileWithProvenance(getConfig, imagePath, question)
626
626
  if (text === '') throw new Error('native returned an empty answer');
627
627
  cache[key] = text;
628
628
  writeCache(cache);
629
- console.warn(`dsh-crew: vision answered by native ${NATIVE_VISION_MODEL} in ${Date.now() - started}ms`);
629
+ console.warn(`dsh-adapter: vision answered by native ${NATIVE_VISION_MODEL} in ${Date.now() - started}ms`);
630
630
  return { text, provider: `native · ${NATIVE_VISION_MODEL}`, model: NATIVE_VISION_MODEL, cached: false };
631
631
  } catch (err) {
632
632
  nativeIssue = { skipped: false, reason: String(err?.message ?? err) };
633
- console.warn(`dsh-crew: native vision failed, falling back to "${cliProvider}": ${nativeIssue.reason}`);
633
+ console.warn(`dsh-adapter: native vision failed, falling back to "${cliProvider}": ${nativeIssue.reason}`);
634
634
  }
635
635
  }
636
636
  }
@@ -679,8 +679,8 @@ export function createMultimodalTools(getConfig) {
679
679
  },
680
680
  async execute(args) {
681
681
  const config = getConfig();
682
- const provider = config.vision_provider ?? 'claude-code';
683
- if (provider === 'off') throw new Error(tr('视觉桥已关闭(设置 → DSH Crew → 视觉 provider)', 'the vision bridge is disabled (Settings → DSH Crew → Vision provider)'));
682
+ const provider = config.vision_provider ?? 'codex';
683
+ if (provider === 'off') throw new Error(tr('视觉桥已关闭(设置 → DSH Adapter → 视觉 provider)', 'the vision bridge is disabled (Settings → DSH Adapter → Vision provider)'));
684
684
  const imagePath = String(args.image_path ?? '');
685
685
  if (!isAbsolute(imagePath) || !existsSync(imagePath)) throw new Error(`image_path must be an existing absolute path, got: ${imagePath}`);
686
686
  const question = typeof args.question === 'string' && args.question !== ''
@@ -715,7 +715,7 @@ export function createMultimodalTools(getConfig) {
715
715
  async execute(args) {
716
716
  const config = getConfig();
717
717
  const provider = args.provider ?? config.imagegen_provider ?? 'codex';
718
- if (provider === 'off') throw new Error(tr('生图已关闭(设置 → DSH Crew → 生图 provider)', 'image generation is disabled (Settings → DSH Crew → Image-gen provider)'));
718
+ if (provider === 'off') throw new Error(tr('生图已关闭(设置 → DSH Adapter → 生图 provider)', 'image generation is disabled (Settings → DSH Adapter → Image-gen provider)'));
719
719
  const outputPath = String(args.output_path ?? '');
720
720
  if (!isAbsolute(outputPath)) throw new Error(`output_path must be absolute, got: ${outputPath}`);
721
721
  const prompt = String(args.prompt ?? '').trim();
@@ -723,8 +723,8 @@ export function createMultimodalTools(getConfig) {
723
723
  const custom = BUILTIN_IMAGEGEN.includes(provider) ? null : findCustomProvider(config, provider);
724
724
  if (!BUILTIN_IMAGEGEN.includes(provider) && !custom) {
725
725
  throw new Error(tr(
726
- `未知生图 provider: ${provider}(内置: ${BUILTIN_IMAGEGEN.join(' / ')},或在设置 → DSH Crew → 自定义 Provider 里添加)`,
727
- `Unknown image-gen provider: ${provider} (built-in: ${BUILTIN_IMAGEGEN.join(' / ')}, or add one under Settings → DSH Crew → Custom providers)`));
726
+ `未知生图 provider: ${provider}(内置: ${BUILTIN_IMAGEGEN.join(' / ')},或在设置 → DSH Adapter → 自定义 Provider 里添加)`,
727
+ `Unknown image-gen provider: ${provider} (built-in: ${BUILTIN_IMAGEGEN.join(' / ')}, or add one under Settings → DSH Adapter → Custom providers)`));
728
728
  }
729
729
  const saved = custom
730
730
  ? (entryType(custom) === 'cli'
@@ -1,8 +1,8 @@
1
1
  // Origin-chain guard against recursive worker self-amplification (WPC9 guardrail 1).
2
2
  //
3
3
  // Every dispatch carries an origin chain: the ordered list of (backend, cwd)
4
- // hops the task has already travelled. A crew-enabled host can itself be
5
- // someone else's worker — CC dispatches to codex, codex (crew installed)
4
+ // hops the task has already travelled. A adapter-enabled host can itself be
5
+ // someone else's worker — CC dispatches to codex, codex (adapter installed)
6
6
  // dispatches back — and without a guard the host×backend matrix lets one
7
7
  // worker spawn another forever: quota burns through in minutes while every
8
8
  // single vantage point along the chain looks innocent.
@@ -13,16 +13,16 @@
13
13
  // source: orchestrator id of the dispatching host ('claude-code', 'codex', ...) }
14
14
  //
15
15
  // Cross-process transport:
16
- // - This MCP server reads DSH_CREW_ORIGIN_CHAIN (JSON array of hops) at
17
- // startup and inherits it as INHERITED_ORIGIN; crew instances spawned
16
+ // - This MCP server reads DSH_ADAPTER_ORIGIN_CHAIN (JSON array of hops) at
17
+ // startup and inherits it as INHERITED_ORIGIN; adapter instances spawned
18
18
  // down-chain do the same, so the chain survives process boundaries.
19
19
  // - Every dispatch appends its own hop and passes the extended chain to the
20
- // worker: env vars DSH_CREW_ORIGIN_CHAIN / DSH_CREW_DEPTH for CLI and
20
+ // worker: env vars DSH_ADAPTER_ORIGIN_CHAIN / DSH_ADAPTER_DEPTH for CLI and
21
21
  // standalone children (jobs.mjs / cli-workers.mjs spawn env), and
22
22
  // origin_chain / origin_depth spec fields for hub spawns (hub-client is
23
23
  // unchanged; the current hub ignores unknown spec fields and this
24
24
  // client-side session re-attaches them to every hub view it returns).
25
- // - DSH_CREW_DEPTH is written alongside as an integer for observability but
25
+ // - DSH_ADAPTER_DEPTH is written alongside as an integer for observability but
26
26
  // is never trusted on read: the chain is authoritative and depth is
27
27
  // derived from its length (env can be hostile).
28
28
  //
@@ -33,8 +33,8 @@
33
33
 
34
34
  import { normalizeCwd } from './cwd-lock.mjs';
35
35
 
36
- export const ORIGIN_CHAIN_ENV = 'DSH_CREW_ORIGIN_CHAIN';
37
- export const ORIGIN_DEPTH_ENV = 'DSH_CREW_DEPTH';
36
+ export const ORIGIN_CHAIN_ENV = 'DSH_ADAPTER_ORIGIN_CHAIN';
37
+ export const ORIGIN_DEPTH_ENV = 'DSH_ADAPTER_DEPTH';
38
38
 
39
39
  // Why 3: depth = number of dispatch hops. 1 is a direct worker, 2 a worker
40
40
  // delegating once, 3 one more legitimate re-delegation — real fan-out graphs
@@ -17,7 +17,7 @@
17
17
  export const PLUGIN_ENV_PREFIX = 'DSHPLUGIN_';
18
18
  export const LEGACY_ENV_PREFIX = 'DSH_';
19
19
 
20
- const PLUGIN_LABEL = 'dsh-crew';
20
+ const PLUGIN_LABEL = 'dsh-adapter';
21
21
 
22
22
  /** One warning per legacy variable per process, not one per lookup. */
23
23
  const warned = new Set();
@@ -38,7 +38,7 @@ export function legacyEnvName(suffix) {
38
38
  }
39
39
 
40
40
  /**
41
- * Read one plugin variable by its suffix (e.g. 'CREW_HUB').
41
+ * Read one plugin variable by its suffix (e.g. 'ADAPTER_HUB').
42
42
  *
43
43
  * Resolution is by PRESENCE, not truthiness: a new variable set to the empty
44
44
  * string is a deliberate "no override" and must not silently resurrect a stale
package/src/proc-kill.mjs CHANGED
@@ -4,7 +4,7 @@
4
4
  // OS process a job ran in. Standalone runtimes and agy/grok CLI workers are
5
5
  // independent processes: when their dispatching host dies, the process can
6
6
  // survive as a true orphan. This module backs the hub endpoints
7
- // (/_dsh/dsh-crew/proc-alive and /_dsh/dsh-crew/proc-kill):
7
+ // (/_dsh/dsh-adapter/proc-alive and /_dsh/dsh-adapter/proc-kill):
8
8
  //
9
9
  // 1. Is pid alive? process.kill(pid, 0) - the same probe the status shard
10
10
  // uses for writer liveness (status-shard.mjs writerProcessAlive).
@@ -114,13 +114,13 @@ export function isWorkerCommand(command) {
114
114
  }
115
115
 
116
116
  const NOT_A_WORKER_ZH = (pid, command) =>
117
- '拒绝杀死 pid ' + pid + ':其命令行不匹配任何 dsh-crew 工作进程特征(该 pid 可能已被系统回收复用)。\n' +
117
+ '拒绝杀死 pid ' + pid + ':其命令行不匹配任何 dsh-adapter 工作进程特征(该 pid 可能已被系统回收复用)。\n' +
118
118
  '命令行:' + command + '\n' +
119
119
  '可杀特征:standalone DSH 运行时(…dsh-sdk-jsonrpc-demo… worker.cordis.yml)、' +
120
120
  'agy(…--output-format stream-json…)、grok(…streaming-messages-json…)。';
121
121
 
122
122
  const NOT_A_WORKER_EN = (pid, command) =>
123
- 'Refusing to kill pid ' + pid + ': its command line matches no process shape dsh-crew spawns (the pid may have been recycled).\n' +
123
+ 'Refusing to kill pid ' + pid + ': its command line matches no process shape dsh-adapter spawns (the pid may have been recycled).\n' +
124
124
  'command: ' + command + '\n' +
125
125
  'Accepted shapes: standalone DSH runtime (…dsh-sdk-jsonrpc-demo… worker.cordis.yml), ' +
126
126
  'agy (…--output-format stream-json…), grok (…streaming-messages-json…).';
@@ -143,8 +143,8 @@ export async function killWorkerProcess({ pid, pgid, graceMs = PROC_KILL_GRACE_M
143
143
  if (groupKill && (parsePid(pgid) === null || pgid !== pid)) {
144
144
  throw new ProcKillRefused(
145
145
  'pgid-mismatch',
146
- 'pgid ' + pgid + ' 与 pid ' + pid + ' 不一致 — 拒绝整组杀死(dsh-crew 只会记录 pgid === pid 的进程组)',
147
- 'pgid ' + pgid + ' does not match pid ' + pid + ' — refusing the group kill (dsh-crew only ever records pgid === pid)',
146
+ 'pgid ' + pgid + ' 与 pid ' + pid + ' 不一致 — 拒绝整组杀死(dsh-adapter 只会记录 pgid === pid 的进程组)',
147
+ 'pgid ' + pgid + ' does not match pid ' + pid + ' — refusing the group kill (dsh-adapter only ever records pgid === pid)',
148
148
  { pid, pgid },
149
149
  );
150
150
  }
@@ -9,12 +9,12 @@ export async function probeProvider(llm, binding, { timeoutMs = 20000 } = {}) {
9
9
  const collect = async () => {
10
10
  let finish, matched = false;
11
11
  for await (const chunk of llm.stream({ ...binding, maxTokens: 256, signal: controller.signal,
12
- messages: [{ role: 'user', content: [{ type: 'text', text: `Call dsh_crew_probe_noop exactly once with nonce ${nonce}. This tool has no side effects. Do not answer with prose.` }] }],
13
- tools: [{ name: 'dsh_crew_probe_noop', description: 'A capability check with no filesystem or network effects.', parameters: {
12
+ messages: [{ role: 'user', content: [{ type: 'text', text: `Call dsh_adapter_probe_noop exactly once with nonce ${nonce}. This tool has no side effects. Do not answer with prose.` }] }],
13
+ tools: [{ name: 'dsh_adapter_probe_noop', description: 'A capability check with no filesystem or network effects.', parameters: {
14
14
  type: 'object', properties: { nonce: { type: 'string' } }, required: ['nonce'], additionalProperties: false,
15
15
  } }],
16
16
  })) {
17
- if (chunk.type === 'block-end' && chunk.block?.type === 'tool-call' && chunk.block.name === 'dsh_crew_probe_noop') {
17
+ if (chunk.type === 'block-end' && chunk.block?.type === 'tool-call' && chunk.block.name === 'dsh_adapter_probe_noop') {
18
18
  try { const args = JSON.parse(chunk.block.arguments); if (args?.nonce === nonce && Object.keys(args).length === 1) matched = true; } catch {}
19
19
  }
20
20
  if (chunk.type === 'finish') finish = chunk.reason?.kind;
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-crew', version: '0.1.0' });
15
+ const server = new McpServer({ name: 'dsh-adapter', version: '0.1.2' });
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).');
@@ -21,7 +21,7 @@ const allowConcurrentCwdSchema = z.boolean().optional().describe('Allow this dis
21
21
 
22
22
  // Session-level configuration. This MCP server process lives exactly as long
23
23
  // as one Claude Code / Codex session, so plain memory IS session scope.
24
- // Initial values come from the global config (~/.config/dsh-crew/config.json,
24
+ // Initial values come from the global config (~/.config/dsh-adapter/config.json,
25
25
  // edited on the DSH settings page); dsh_worker_config overrides per session.
26
26
  import { readGlobalConfig } from './install/install.mjs';
27
27
  import { describeBindings, resolveTierBinding } from './tier-binding.mjs';
@@ -73,8 +73,8 @@ const ORCHESTRATOR = detectOrchestrator();
73
73
 
74
74
  // ---------- WPC9 guardrails ----------
75
75
 
76
- // Origin chain this crew instance inherited from whoever spawned it (read at
77
- // startup from the env written by the dispatching crew — origin-guard.mjs).
76
+ // Origin chain this adapter instance inherited from whoever spawned it (read at
77
+ // startup from the env written by the dispatching adapter — origin-guard.mjs).
78
78
  // Every dispatch appends its own hop and refuses loops / over-deep chains
79
79
  // BEFORE anything is spawned, so recursion can never start burning quota.
80
80
  const INHERITED_ORIGIN = readInheritedOrigin(process.env);
@@ -1,5 +1,5 @@
1
1
  // Sharded worker-status publishing: every writer (hub process, per-session
2
- // standalone MCP server) owns one file under ~/.config/dsh-crew/status.d/
2
+ // standalone MCP server) owns one file under ~/.config/dsh-adapter/status.d/
3
3
  // and readers merge all fresh shards. Kills the last-writer-wins race that a
4
4
  // single shared status.json had with multiple concurrent writers.
5
5
 
@@ -7,7 +7,7 @@ import { writeFileSync, mkdirSync, rmSync, readdirSync, readFileSync } from 'nod
7
7
  import { join } from 'node:path';
8
8
  import { homedir } from 'node:os';
9
9
 
10
- const CONFIG_DIR = join(homedir(), '.config', 'dsh-crew');
10
+ const CONFIG_DIR = join(homedir(), '.config', 'dsh-adapter');
11
11
  const SHARD_DIR = join(CONFIG_DIR, 'status.d');
12
12
  export const SHARD_FRESH_MS = 30 * 60 * 1000;
13
13
 
@@ -22,7 +22,7 @@ import { tr } from './i18n.mjs';
22
22
 
23
23
  const VISION_PROVIDER = 'deepseek-vision';
24
24
  const DELEGATE = 'deepseek-official';
25
- const ATTACH_DIR = join(homedir(), '.config', 'dsh-crew', 'attachments');
25
+ const ATTACH_DIR = join(homedir(), '.config', 'dsh-adapter', 'attachments');
26
26
 
27
27
  const EXT = { 'image/png': 'png', 'image/jpeg': 'jpg', 'image/webp': 'webp', 'image/gif': 'gif' };
28
28
 
@@ -112,7 +112,7 @@ export function installVisionRoute(ctx, getConfig) {
112
112
  const { text: desc, provider } = await describeFileWithProvenance(getConfig, path, tr(
113
113
  '详细描述这张图片:整体内容、布局结构、可见文字(逐字)、颜色与显著元素。',
114
114
  'Describe this image in detail: overall content, layout, any visible text (verbatim), colours and notable elements.'));
115
- ctx.logger?.info?.(`dsh-crew: vision transcript for ${path} via ${provider}`);
115
+ ctx.logger?.info?.(`dsh-adapter: vision transcript for ${path} via ${provider}`);
116
116
  content.push({
117
117
  type: 'text',
118
118
  text: `${TRANSCRIPT_PREFIX(name)}\n${desc}\n${tr(
@@ -134,6 +134,6 @@ export function installVisionRoute(ctx, getConfig) {
134
134
  return changed ? { kind: 'enter', messages: rewritten } : decision;
135
135
  }));
136
136
 
137
- ctx.logger?.info?.('dsh-crew: vision route registered (provider "deepseek-vision" + pre-step transcription)');
137
+ ctx.logger?.info?.('dsh-adapter: vision route registered (provider "deepseek-vision" + pre-step transcription)');
138
138
  return () => { for (const d of disposers.reverse()) { try { d(); } catch {} } };
139
139
  }
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- # dsh-crew statusline: prepends the live worker-pool segment (merged from
2
+ # dsh-adapter statusline: prepends the live worker-pool segment (merged from
3
3
  # all status shards) to a basic statusline. For claude-hud users prefer
4
4
  # wiring worker-segment.sh via --extra-cmd instead (cli.mjs hud does this).
5
5
 
@@ -1,12 +1,12 @@
1
1
  #!/bin/bash
2
2
  # Compact DSH worker segment for claude-hud --extra-cmd (or any statusline).
3
- # Merges all fresh status shards (~/.config/dsh-crew/status.d/*.json plus
3
+ # Merges all fresh status shards (~/.config/dsh-adapter/status.d/*.json plus
4
4
  # the legacy status.json during transition) so workers dispatched by ANY
5
5
  # orchestrator on this machine are visible. Running jobs show tier, elapsed,
6
6
  # and tokens; idle with history shows "⚙dsh ✓N"; no jobs prints nothing.
7
- # Override the shard dir with $DSH_CREW_STATUS_DIR (mainly for tests).
7
+ # Override the shard dir with $DSH_ADAPTER_STATUS_DIR (mainly for tests).
8
8
 
9
- dir="${DSH_CREW_STATUS_DIR:-$HOME/.config/dsh-crew}"
9
+ dir="${DSH_ADAPTER_STATUS_DIR:-$HOME/.config/dsh-adapter}"
10
10
  files=()
11
11
  for f in "$dir"/status.d/*.json "$dir"/status.json; do
12
12
  [ -f "$f" ] && files+=("$f")
package/worker.cordis.yml CHANGED
@@ -1,4 +1,4 @@
1
- # dsh-crew: unattended coding-worker composition for dsh-jsonrpc-agent.
1
+ # dsh-adapter: unattended coding-worker composition for dsh-jsonrpc-agent.
2
2
  # stdout is reserved for JSON-RPC frames; never add a console logger here.
3
3
  # Model/provider arrive per process via the SDK initialize handshake.
4
4