@ran-sh/dsh-crew 0.3.6 → 0.3.8

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 (85) hide show
  1. package/.claude-plugin/plugin.json +8 -8
  2. package/.mcp.json +8 -8
  3. package/LICENSE +21 -21
  4. package/README.de.md +359 -359
  5. package/README.es.md +359 -359
  6. package/README.fr.md +359 -359
  7. package/README.hi.md +359 -359
  8. package/README.id.md +359 -359
  9. package/README.ja.md +359 -359
  10. package/README.ko.md +359 -359
  11. package/README.md +94 -180
  12. package/README.pt.md +359 -359
  13. package/README.ru.md +359 -359
  14. package/README.th.md +359 -359
  15. package/README.tr.md +359 -359
  16. package/README.vi.md +359 -359
  17. package/README.zh-TW.md +359 -359
  18. package/README.zh.md +94 -180
  19. package/agents/ds-flash.md +26 -26
  20. package/agents/ds-pro.md +32 -32
  21. package/agents/ds-reviewer.md +23 -23
  22. package/agents/ds-worker.md +22 -22
  23. package/codex/agents/ds-flash.toml +30 -30
  24. package/codex/agents/ds-pro.toml +31 -31
  25. package/codex/agents/ds-reviewer.toml +28 -28
  26. package/codex/agents/ds-worker.toml +28 -28
  27. package/codex/prompts/dsh-config.md +3 -3
  28. package/codex/prompts/dsh-status.md +1 -1
  29. package/commands/config.md +11 -11
  30. package/commands/off.md +5 -5
  31. package/commands/on.md +5 -5
  32. package/commands/status.md +5 -5
  33. package/cordis.patch.yml +4 -4
  34. package/lib/client.js +1655 -974
  35. package/official-web-bridge/cordis.patch.yml +4 -0
  36. package/official-web-bridge/entry.mjs +1 -0
  37. package/official-web-bridge/lib/client.js +3446 -0
  38. package/official-web-bridge/package.json +26 -0
  39. package/package.json +133 -131
  40. package/scripts/build-client.mjs +32 -28
  41. package/scripts/live-crew-smoke.mjs +39 -39
  42. package/scripts/live-policy-matrix.mjs +177 -177
  43. package/scripts/policy-probe.mjs +101 -101
  44. package/scripts/setup.mjs +284 -284
  45. package/scripts/smoke-real.mjs +110 -110
  46. package/scripts/smoke.mjs +78 -78
  47. package/scripts/verify-installer-fix.mjs +26 -26
  48. package/scripts/verify-official-bridge-e2e.mjs +159 -0
  49. package/src/adaptive-routing.mjs +260 -260
  50. package/src/client/activation-summary.tsx +64 -64
  51. package/src/client/collapsible-sections.mjs +55 -0
  52. package/src/client/entry.tsx +236 -236
  53. package/src/client/index.tsx +1213 -1120
  54. package/src/config-readiness.mjs +59 -59
  55. package/src/delivery.mjs +205 -205
  56. package/src/dsh-cli-runtime.mjs +458 -447
  57. package/src/failure-classification.mjs +172 -172
  58. package/src/hub/entry.mjs +98 -98
  59. package/src/hub-client.mjs +132 -132
  60. package/src/hub-compatibility.mjs +49 -49
  61. package/src/i18n.mjs +19 -19
  62. package/src/install/cli.mjs +28 -28
  63. package/src/install/install-legacy.mjs +462 -462
  64. package/src/install/install.mjs +451 -451
  65. package/src/install/npx-lifecycle.mjs +1119 -1055
  66. package/src/install/official-web.mjs +132 -0
  67. package/src/mcp-runtime.mjs +257 -257
  68. package/src/model-catalog.mjs +173 -173
  69. package/src/model-routing.mjs +391 -391
  70. package/src/official-web-bridge.mjs +196 -0
  71. package/src/policy.mjs +197 -197
  72. package/src/readiness-matrix.mjs +169 -169
  73. package/src/runtime-controls.mjs +90 -90
  74. package/src/runtime-identity.mjs +108 -108
  75. package/src/server.mjs +477 -477
  76. package/src/status-shard.mjs +52 -52
  77. package/src/structured-error-code.mjs +38 -38
  78. package/src/vision-route.mjs +138 -138
  79. package/src/workflow-runtime.mjs +573 -573
  80. package/src/workflow.mjs +160 -160
  81. package/src/workspace-audit.mjs +231 -231
  82. package/src/workspace-isolation.mjs +365 -365
  83. package/statusline/statusline.sh +14 -14
  84. package/statusline/worker-segment.sh +35 -35
  85. package/worker.cordis.yml +77 -77
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@ran-sh/dsh-crew-web-bridge",
3
+ "version": "0.3.8",
4
+ "private": true,
5
+ "type": "module",
6
+ "main": "./entry.mjs",
7
+ "exports": {
8
+ ".": "./entry.mjs",
9
+ "./client": "./lib/client.js",
10
+ "./package.json": "./package.json"
11
+ },
12
+ "dsh": {
13
+ "bundle": {
14
+ "patch": "./cordis.patch.yml"
15
+ },
16
+ "client": {
17
+ "inject": [
18
+ "@deepseek-ai/dsh-client-runtime",
19
+ "@deepseek-ai/dsh-client-locale",
20
+ "@deepseek-ai/dsh-client-ui-slots",
21
+ "@deepseek-ai/dsh-client-ui-settings"
22
+ ],
23
+ "platform": "web"
24
+ }
25
+ }
26
+ }
package/package.json CHANGED
@@ -1,131 +1,133 @@
1
- {
2
- "name": "@ran-sh/dsh-crew",
3
- "version": "0.3.6",
4
- "type": "module",
5
- "main": "./src/hub/entry.mjs",
6
- "bin": {
7
- "dsh-crew": "./bin/dsh-crew.mjs"
8
- },
9
- "description": "DeepSeek Harness plugin: dispatch work to DSH agents from Claude Code / Codex, as native subagents with live progress",
10
- "dsh": {
11
- "bundle": {
12
- "patch": "./cordis.patch.yml"
13
- },
14
- "client": {
15
- "inject": [
16
- "@deepseek-ai/dsh-client-runtime",
17
- "@deepseek-ai/dsh-client-locale",
18
- "@deepseek-ai/dsh-client-ui-slots",
19
- "@deepseek-ai/dsh-client-ui-settings"
20
- ],
21
- "platform": "web"
22
- }
23
- },
24
- "scripts": {
25
- "mcp": "node src/server.mjs",
26
- "build:client": "tsdown src/client/entry.tsx --format cjs --platform browser --target es2022 --tsconfig tsconfig.client.json --deps.never-bundle react --deps.never-bundle react/jsx-runtime --deps.never-bundle react-dom --deps.never-bundle react-dom/client --out-dir .client-build --clean --logLevel warn && node scripts/build-client.mjs",
27
- "verify:npm-install": "node scripts/verify-npm-install.mjs",
28
- "verify:npm-install:official": "node scripts/verify-npm-install.mjs --with-official-dsh"
29
- },
30
- "dependencies": {
31
- "@modelcontextprotocol/sdk": "^1.17.5",
32
- "zod": "^3.24.0"
33
- },
34
- "exports": {
35
- ".": "./src/hub/entry.mjs",
36
- "./client": "./lib/client.js",
37
- "./package.json": "./package.json"
38
- },
39
- "peerDependencies": {
40
- "react": "^18.0.0",
41
- "react-dom": "^18.0.0",
42
- "@deepseek-ai/dsh-agent": "0.1.1-rc.2",
43
- "@deepseek-ai/dsh-agent-presets": "0.1.1-rc.2",
44
- "@deepseek-ai/dsh-agent-spine-demo": "0.1.1-rc.2",
45
- "@deepseek-ai/dsh-bash-local": "0.1.1-rc.2",
46
- "@deepseek-ai/dsh-compaction-basic": "0.1.1-rc.2",
47
- "@deepseek-ai/dsh-fs-local": "0.1.1-rc.2",
48
- "@deepseek-ai/dsh-fs-observation-policy": "0.1.1-rc.2",
49
- "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
50
- "@deepseek-ai/dsh-llm-deepseek": "0.1.1-rc.2",
51
- "@deepseek-ai/dsh-sandbox-local": "0.1.1-rc.2",
52
- "@deepseek-ai/dsh-sandbox-policy": "0.1.1-rc.2",
53
- "@deepseek-ai/dsh-sdk-client": "0.1.1-rc.2",
54
- "@deepseek-ai/dsh-sdk-jsonrpc-demo": "0.1.1-rc.2",
55
- "@deepseek-ai/dsh-sdk-jsonrpc-server": "0.1.1-rc.2",
56
- "@deepseek-ai/dsh-session": "0.1.1-rc.2",
57
- "@deepseek-ai/dsh-session-persistence-jsonl": "0.1.1-rc.2",
58
- "@deepseek-ai/dsh-subprocess-local": "0.1.1-rc.2",
59
- "@deepseek-ai/dsh-token-meter": "0.1.1-rc.2",
60
- "@deepseek-ai/dsh-tool-fs": "0.1.1-rc.2",
61
- "@deepseek-ai/dsh-tool-todo": "0.1.1-rc.2"
62
- },
63
- "devDependencies": {
64
- "react": "^18.3.1",
65
- "react-dom": "^18.3.1",
66
- "tsdown": "^0.12.0",
67
- "typescript": "^5.6.0",
68
- "@types/react": "^18.3.0",
69
- "@deepseek-ai/dsh-agent": "0.1.1-rc.2",
70
- "@deepseek-ai/dsh-agent-presets": "0.1.1-rc.2",
71
- "@deepseek-ai/dsh-agent-spine-demo": "0.1.1-rc.2",
72
- "@deepseek-ai/dsh-bash-local": "0.1.1-rc.2",
73
- "@deepseek-ai/dsh-compaction-basic": "0.1.1-rc.2",
74
- "@deepseek-ai/dsh-fs-local": "0.1.1-rc.2",
75
- "@deepseek-ai/dsh-fs-observation-policy": "0.1.1-rc.2",
76
- "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
77
- "@deepseek-ai/dsh-llm-deepseek": "0.1.1-rc.2",
78
- "@deepseek-ai/dsh-sandbox-local": "0.1.1-rc.2",
79
- "@deepseek-ai/dsh-sandbox-policy": "0.1.1-rc.2",
80
- "@deepseek-ai/dsh-sdk-client": "0.1.1-rc.2",
81
- "@deepseek-ai/dsh-sdk-jsonrpc-demo": "0.1.1-rc.2",
82
- "@deepseek-ai/dsh-sdk-jsonrpc-server": "0.1.1-rc.2",
83
- "@deepseek-ai/dsh-session": "0.1.1-rc.2",
84
- "@deepseek-ai/dsh-session-persistence-jsonl": "0.1.1-rc.2",
85
- "@deepseek-ai/dsh-subprocess-local": "0.1.1-rc.2",
86
- "@deepseek-ai/dsh-token-meter": "0.1.1-rc.2",
87
- "@deepseek-ai/dsh-tool-fs": "0.1.1-rc.2",
88
- "@deepseek-ai/dsh-tool-todo": "0.1.1-rc.2"
89
- },
90
- "license": "MIT",
91
- "repository": {
92
- "type": "git",
93
- "url": "git+https://github.com/Ran-sh/dsh-crew.git"
94
- },
95
- "homepage": "https://github.com/Ran-sh/dsh-crew",
96
- "bugs": {
97
- "url": "https://github.com/Ran-sh/dsh-crew/issues"
98
- },
99
- "keywords": [
100
- "dsh",
101
- "deepseek",
102
- "claude-code",
103
- "codex",
104
- "subagent",
105
- "worker",
106
- "multimodal",
107
- "plugin",
108
- "agent"
109
- ],
110
- "files": [
111
- "bin",
112
- "lib",
113
- "src",
114
- "scripts",
115
- "agents",
116
- "commands",
117
- "codex",
118
- "statusline",
119
- "cordis.patch.yml",
120
- "worker.cordis.yml",
121
- ".claude-plugin",
122
- ".mcp.json",
123
- "README.md",
124
- "README.*.md",
125
- "docs/images/dsh-crew-logo.png",
126
- "docs/images/dsh-crew-overview.png",
127
- "docs/images/dsh-crew-host.png",
128
- "docs/images/dsh-crew-jobs.png",
129
- "LICENSE"
130
- ]
131
- }
1
+ {
2
+ "name": "@ran-sh/dsh-crew",
3
+ "version": "0.3.8",
4
+ "type": "module",
5
+ "main": "./src/hub/entry.mjs",
6
+ "bin": {
7
+ "dsh-crew": "bin/dsh-crew.mjs"
8
+ },
9
+ "description": "DeepSeek Harness plugin: dispatch work to DSH agents from Claude Code / Codex, as native subagents with live progress",
10
+ "dsh": {
11
+ "bundle": {
12
+ "patch": "./cordis.patch.yml"
13
+ },
14
+ "client": {
15
+ "inject": [
16
+ "@deepseek-ai/dsh-client-runtime",
17
+ "@deepseek-ai/dsh-client-locale",
18
+ "@deepseek-ai/dsh-client-ui-slots",
19
+ "@deepseek-ai/dsh-client-ui-settings"
20
+ ],
21
+ "platform": "web"
22
+ }
23
+ },
24
+ "scripts": {
25
+ "mcp": "node src/server.mjs",
26
+ "build:client": "tsdown src/client/entry.tsx --format cjs --platform browser --target es2022 --tsconfig tsconfig.client.json --deps.never-bundle react --deps.never-bundle react/jsx-runtime --deps.never-bundle react-dom --deps.never-bundle react-dom/client --out-dir .client-build --clean --logLevel warn && node scripts/build-client.mjs",
27
+ "verify:npm-install": "node scripts/verify-npm-install.mjs",
28
+ "verify:npm-install:official": "node scripts/verify-npm-install.mjs --with-official-dsh",
29
+ "verify:official-bridge": "node scripts/verify-official-bridge-e2e.mjs"
30
+ },
31
+ "dependencies": {
32
+ "@modelcontextprotocol/sdk": "^1.25.4",
33
+ "zod": "^3.24.0"
34
+ },
35
+ "exports": {
36
+ ".": "./src/hub/entry.mjs",
37
+ "./client": "./lib/client.js",
38
+ "./package.json": "./package.json"
39
+ },
40
+ "peerDependencies": {
41
+ "react": "^18.0.0",
42
+ "react-dom": "^18.0.0",
43
+ "@deepseek-ai/dsh-agent": "0.1.1-rc.2",
44
+ "@deepseek-ai/dsh-agent-presets": "0.1.1-rc.2",
45
+ "@deepseek-ai/dsh-agent-spine-demo": "0.1.1-rc.2",
46
+ "@deepseek-ai/dsh-bash-local": "0.1.1-rc.2",
47
+ "@deepseek-ai/dsh-compaction-basic": "0.1.1-rc.2",
48
+ "@deepseek-ai/dsh-fs-local": "0.1.1-rc.2",
49
+ "@deepseek-ai/dsh-fs-observation-policy": "0.1.1-rc.2",
50
+ "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
51
+ "@deepseek-ai/dsh-llm-deepseek": "0.1.1-rc.2",
52
+ "@deepseek-ai/dsh-sandbox-local": "0.1.1-rc.2",
53
+ "@deepseek-ai/dsh-sandbox-policy": "0.1.1-rc.2",
54
+ "@deepseek-ai/dsh-sdk-client": "0.1.1-rc.2",
55
+ "@deepseek-ai/dsh-sdk-jsonrpc-demo": "0.1.1-rc.2",
56
+ "@deepseek-ai/dsh-sdk-jsonrpc-server": "0.1.1-rc.2",
57
+ "@deepseek-ai/dsh-session": "0.1.1-rc.2",
58
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.1.1-rc.2",
59
+ "@deepseek-ai/dsh-subprocess-local": "0.1.1-rc.2",
60
+ "@deepseek-ai/dsh-token-meter": "0.1.1-rc.2",
61
+ "@deepseek-ai/dsh-tool-fs": "0.1.1-rc.2",
62
+ "@deepseek-ai/dsh-tool-todo": "0.1.1-rc.2"
63
+ },
64
+ "devDependencies": {
65
+ "react": "^18.3.1",
66
+ "react-dom": "^18.3.1",
67
+ "tsdown": "^0.12.0",
68
+ "typescript": "^5.6.0",
69
+ "@types/react": "^18.3.0",
70
+ "@deepseek-ai/dsh-agent": "0.1.1-rc.2",
71
+ "@deepseek-ai/dsh-agent-presets": "0.1.1-rc.2",
72
+ "@deepseek-ai/dsh-agent-spine-demo": "0.1.1-rc.2",
73
+ "@deepseek-ai/dsh-bash-local": "0.1.1-rc.2",
74
+ "@deepseek-ai/dsh-compaction-basic": "0.1.1-rc.2",
75
+ "@deepseek-ai/dsh-fs-local": "0.1.1-rc.2",
76
+ "@deepseek-ai/dsh-fs-observation-policy": "0.1.1-rc.2",
77
+ "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
78
+ "@deepseek-ai/dsh-llm-deepseek": "0.1.1-rc.2",
79
+ "@deepseek-ai/dsh-sandbox-local": "0.1.1-rc.2",
80
+ "@deepseek-ai/dsh-sandbox-policy": "0.1.1-rc.2",
81
+ "@deepseek-ai/dsh-sdk-client": "0.1.1-rc.2",
82
+ "@deepseek-ai/dsh-sdk-jsonrpc-demo": "0.1.1-rc.2",
83
+ "@deepseek-ai/dsh-sdk-jsonrpc-server": "0.1.1-rc.2",
84
+ "@deepseek-ai/dsh-session": "0.1.1-rc.2",
85
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.1.1-rc.2",
86
+ "@deepseek-ai/dsh-subprocess-local": "0.1.1-rc.2",
87
+ "@deepseek-ai/dsh-token-meter": "0.1.1-rc.2",
88
+ "@deepseek-ai/dsh-tool-fs": "0.1.1-rc.2",
89
+ "@deepseek-ai/dsh-tool-todo": "0.1.1-rc.2"
90
+ },
91
+ "license": "MIT",
92
+ "repository": {
93
+ "type": "git",
94
+ "url": "git+https://github.com/Ran-sh/dsh-crew.git"
95
+ },
96
+ "homepage": "https://github.com/Ran-sh/dsh-crew",
97
+ "bugs": {
98
+ "url": "https://github.com/Ran-sh/dsh-crew/issues"
99
+ },
100
+ "keywords": [
101
+ "dsh",
102
+ "deepseek",
103
+ "claude-code",
104
+ "codex",
105
+ "subagent",
106
+ "worker",
107
+ "multimodal",
108
+ "plugin",
109
+ "agent"
110
+ ],
111
+ "files": [
112
+ "bin",
113
+ "lib",
114
+ "src",
115
+ "scripts",
116
+ "agents",
117
+ "commands",
118
+ "codex",
119
+ "statusline",
120
+ "official-web-bridge",
121
+ "cordis.patch.yml",
122
+ "worker.cordis.yml",
123
+ ".claude-plugin",
124
+ ".mcp.json",
125
+ "README.md",
126
+ "README.*.md",
127
+ "docs/images/dsh-crew-logo.png",
128
+ "docs/images/dsh-crew-overview.png",
129
+ "docs/images/dsh-crew-host.png",
130
+ "docs/images/dsh-crew-jobs.png",
131
+ "LICENSE"
132
+ ]
133
+ }
@@ -1,28 +1,32 @@
1
- // Wrap the compiled client bundle into the dsh-web module-loader artifact:
2
- // `window.__ModuleLoader__.load({ id, factory })`. The id must equal the
3
- // package name (= the cordis entry name). Pattern from dsh-noema.
4
-
5
- import { readFile, writeFile, rm, mkdir, readdir } from 'node:fs/promises';
6
- import { dirname, join } from 'node:path';
7
- import { fileURLToPath } from 'node:url';
8
-
9
- const root = dirname(dirname(fileURLToPath(import.meta.url)));
10
- const manifest = JSON.parse(await readFile(join(root, 'package.json'), 'utf8'));
11
- const pluginId = manifest.name;
12
- const buildDir = join(root, '.client-build');
13
- const compiledEntries = (await readdir(buildDir)).filter((name) => name.endsWith('.cjs'));
14
- if (compiledEntries.length !== 1) {
15
- throw new Error(`expected exactly one compiled client entry in .client-build, found ${compiledEntries.length}: ${compiledEntries.join(', ')}`);
16
- }
17
- const source = await readFile(join(buildDir, compiledEntries[0]), 'utf8');
18
- const wrapped = [
19
- `window.__ModuleLoader__.load({ id: ${JSON.stringify(pluginId)}, factory: (require) => {`,
20
- 'var module = { exports: {} }; var exports = module.exports;',
21
- source.replace(/\n?\/\/# sourceMappingURL=.*$/u, ''),
22
- 'return module.exports; } });',
23
- '',
24
- ].join('\n');
25
- await mkdir(join(root, 'lib'), { recursive: true });
26
- await writeFile(join(root, 'lib', 'client.js'), wrapped);
27
- await rm(buildDir, { recursive: true, force: true });
28
- console.log(`built lib/client.js (${wrapped.length} bytes) as module "${pluginId}" from ${compiledEntries[0]}`);
1
+ // Wrap the compiled client bundle into the dsh-web module-loader artifact:
2
+ // `window.__ModuleLoader__.load({ id, factory })`. The id must equal the
3
+ // package name (= the cordis entry name). Pattern from dsh-noema.
4
+
5
+ import { readFile, writeFile, rm, mkdir, readdir } from 'node:fs/promises';
6
+ import { dirname, join } from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+
9
+ const root = dirname(dirname(fileURLToPath(import.meta.url)));
10
+ const manifest = JSON.parse(await readFile(join(root, 'package.json'), 'utf8'));
11
+ const pluginId = manifest.name;
12
+ const buildDir = join(root, '.client-build');
13
+ const compiledEntries = (await readdir(buildDir)).filter((name) => name.endsWith('.cjs'));
14
+ if (compiledEntries.length !== 1) {
15
+ throw new Error(`expected exactly one compiled client entry in .client-build, found ${compiledEntries.length}: ${compiledEntries.join(', ')}`);
16
+ }
17
+ const source = await readFile(join(buildDir, compiledEntries[0]), 'utf8');
18
+ const wrapped = [
19
+ `window.__ModuleLoader__.load({ id: ${JSON.stringify(pluginId)}, factory: (require) => {`,
20
+ 'var module = { exports: {} }; var exports = module.exports;',
21
+ source.replace(/\n?\/\/# sourceMappingURL=.*$/u, ''),
22
+ 'return module.exports; } });',
23
+ '',
24
+ ].join('\n');
25
+ await mkdir(join(root, 'lib'), { recursive: true });
26
+ await writeFile(join(root, 'lib', 'client.js'), wrapped);
27
+ const bridgeManifest = JSON.parse(await readFile(join(root, 'official-web-bridge', 'package.json'), 'utf8'));
28
+ const bridgeWrapped = wrapped.replace(JSON.stringify(pluginId), JSON.stringify(bridgeManifest.name));
29
+ await mkdir(join(root, 'official-web-bridge', 'lib'), { recursive: true });
30
+ await writeFile(join(root, 'official-web-bridge', 'lib', 'client.js'), bridgeWrapped);
31
+ await rm(buildDir, { recursive: true, force: true });
32
+ console.log(`built lib/client.js and official-web-bridge/lib/client.js (${wrapped.length} bytes) from ${compiledEntries[0]}`);
@@ -1,39 +1,39 @@
1
- // Live Crew worker smoke against a Crew-owned dsh-crew Hub (Stage 4 provider
2
- // routing). Targets the dedicated Crew Hub (DSH_CREW_HUB env or default
3
- // http://127.0.0.1:3210); it never targets or mutates the official web profile.
4
- // Creates a temp fixture as cwd, spawns flash, polls, prints job metadata.
5
- import os from 'node:os';
6
- import fs from 'node:fs';
7
- import path from 'node:path';
8
- const BASE = (process.env.DSH_CREW_HUB ?? 'http://127.0.0.1:3210').replace(/\/$/, '') + '/_dsh/dsh-crew';
9
-
10
- (async () => {
11
- const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'dsh4-fixture-'));
12
- fs.writeFileSync(path.join(fixture, 'note.txt'), 'hello');
13
- const cwd = fixture.replace(/\\/g, '/');
14
- console.log('fixture:', cwd);
15
- console.log('provider route:', JSON.stringify(await (await fetch(`${BASE}/provider`)).json()));
16
-
17
- const tier = process.argv[2] ?? 'flash';
18
- const res = await fetch(`${BASE}/jobs`, {
19
- method: 'POST', headers: { 'content-type': 'application/json' },
20
- body: JSON.stringify({ task: 'Reply with exactly: CREW_OPENCODE_GO_OK', tier, effort: 'off', cwd }),
21
- });
22
- const spawned = await res.json();
23
- console.log('spawn:', JSON.stringify(spawned).slice(0, 260));
24
- if (!spawned.ok && !spawned.job) { process.exit(1); }
25
- const id = (spawned.job ?? spawned).id;
26
-
27
- // Poll for up to 120s.
28
- for (let i = 0; i < 40; i++) {
29
- await new Promise((r) => setTimeout(r, 3000));
30
- const r = await (await fetch(`${BASE}/jobs/${id}?wait=0`)).json();
31
- const j = r.job ?? r;
32
- if (!['running', 'pending'].includes(j.status)) {
33
- console.log('final:', JSON.stringify({ id: j.id, tier: j.tier, model: j.model, status: j.status, result: (j.result || '').slice(0, 120), error: (j.error || '').slice(0, 200), tokens: j.tokens }, null, 2));
34
- process.exit(j.status === 'done' ? 0 : 2);
35
- }
36
- }
37
- console.log('TIMEOUT waiting for job', id);
38
- process.exit(3);
39
- })();
1
+ // Live Crew worker smoke against a Crew-owned dsh-crew Hub (Stage 4 provider
2
+ // routing). Targets the dedicated Crew Hub (DSH_CREW_HUB env or default
3
+ // http://127.0.0.1:3210); it never targets or mutates the official web profile.
4
+ // Creates a temp fixture as cwd, spawns flash, polls, prints job metadata.
5
+ import os from 'node:os';
6
+ import fs from 'node:fs';
7
+ import path from 'node:path';
8
+ const BASE = (process.env.DSH_CREW_HUB ?? 'http://127.0.0.1:3210').replace(/\/$/, '') + '/_dsh/dsh-crew';
9
+
10
+ (async () => {
11
+ const fixture = fs.mkdtempSync(path.join(os.tmpdir(), 'dsh4-fixture-'));
12
+ fs.writeFileSync(path.join(fixture, 'note.txt'), 'hello');
13
+ const cwd = fixture.replace(/\\/g, '/');
14
+ console.log('fixture:', cwd);
15
+ console.log('provider route:', JSON.stringify(await (await fetch(`${BASE}/provider`)).json()));
16
+
17
+ const tier = process.argv[2] ?? 'flash';
18
+ const res = await fetch(`${BASE}/jobs`, {
19
+ method: 'POST', headers: { 'content-type': 'application/json' },
20
+ body: JSON.stringify({ task: 'Reply with exactly: CREW_OPENCODE_GO_OK', tier, effort: 'off', cwd }),
21
+ });
22
+ const spawned = await res.json();
23
+ console.log('spawn:', JSON.stringify(spawned).slice(0, 260));
24
+ if (!spawned.ok && !spawned.job) { process.exit(1); }
25
+ const id = (spawned.job ?? spawned).id;
26
+
27
+ // Poll for up to 120s.
28
+ for (let i = 0; i < 40; i++) {
29
+ await new Promise((r) => setTimeout(r, 3000));
30
+ const r = await (await fetch(`${BASE}/jobs/${id}?wait=0`)).json();
31
+ const j = r.job ?? r;
32
+ if (!['running', 'pending'].includes(j.status)) {
33
+ console.log('final:', JSON.stringify({ id: j.id, tier: j.tier, model: j.model, status: j.status, result: (j.result || '').slice(0, 120), error: (j.error || '').slice(0, 200), tokens: j.tokens }, null, 2));
34
+ process.exit(j.status === 'done' ? 0 : 2);
35
+ }
36
+ }
37
+ console.log('TIMEOUT waiting for job', id);
38
+ process.exit(3);
39
+ })();