@ran-sh/dsh-crew 0.3.6 → 0.3.7

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 (78) 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 +125 -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 +125 -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 +3446 -2765
  35. package/package.json +131 -131
  36. package/scripts/build-client.mjs +28 -28
  37. package/scripts/live-crew-smoke.mjs +39 -39
  38. package/scripts/live-policy-matrix.mjs +177 -177
  39. package/scripts/policy-probe.mjs +101 -101
  40. package/scripts/setup.mjs +284 -284
  41. package/scripts/smoke-real.mjs +110 -110
  42. package/scripts/smoke.mjs +78 -78
  43. package/scripts/verify-installer-fix.mjs +26 -26
  44. package/src/adaptive-routing.mjs +260 -260
  45. package/src/client/activation-summary.tsx +64 -64
  46. package/src/client/collapsible-sections.mjs +55 -0
  47. package/src/client/entry.tsx +236 -236
  48. package/src/client/index.tsx +1213 -1120
  49. package/src/config-readiness.mjs +59 -59
  50. package/src/delivery.mjs +205 -205
  51. package/src/dsh-cli-runtime.mjs +239 -239
  52. package/src/failure-classification.mjs +172 -172
  53. package/src/hub/entry.mjs +98 -98
  54. package/src/hub-client.mjs +132 -132
  55. package/src/hub-compatibility.mjs +49 -49
  56. package/src/i18n.mjs +19 -19
  57. package/src/install/cli.mjs +28 -28
  58. package/src/install/install-legacy.mjs +462 -462
  59. package/src/install/install.mjs +451 -451
  60. package/src/install/npx-lifecycle.mjs +1055 -1055
  61. package/src/mcp-runtime.mjs +257 -257
  62. package/src/model-catalog.mjs +173 -173
  63. package/src/model-routing.mjs +391 -391
  64. package/src/policy.mjs +197 -197
  65. package/src/readiness-matrix.mjs +169 -169
  66. package/src/runtime-controls.mjs +90 -90
  67. package/src/runtime-identity.mjs +108 -108
  68. package/src/server.mjs +477 -477
  69. package/src/status-shard.mjs +52 -52
  70. package/src/structured-error-code.mjs +38 -38
  71. package/src/vision-route.mjs +138 -138
  72. package/src/workflow-runtime.mjs +573 -573
  73. package/src/workflow.mjs +160 -160
  74. package/src/workspace-audit.mjs +231 -231
  75. package/src/workspace-isolation.mjs +365 -365
  76. package/statusline/statusline.sh +14 -14
  77. package/statusline/worker-segment.sh +35 -35
  78. package/worker.cordis.yml +77 -77
@@ -1,108 +1,108 @@
1
- // Shared runtime identity and Hub compatibility contract.
2
- //
3
- // Package/release semver and the wire protocol are intentionally separate:
4
- // - RUNTIME_VERSION identifies the source/runtime generation for diagnostics.
5
- // - HUB_PROTOCOL_VERSION changes only when Hub <-> MCP wire semantics become
6
- // incompatible.
7
- //
8
- // Keep this module pure and dependency-free so Hub, MCP and tests all use the
9
- // exact same compatibility rules.
10
-
11
- export const RUNTIME_VERSION = '0.3.6';
12
- export const HUB_PROTOCOL_VERSION = 1;
13
-
14
- export const HUB_CAPABILITIES = Object.freeze([
15
- 'jobs',
16
- 'jobs-wait',
17
- 'jobs-cancel',
18
- 'roles',
19
- 'attempt-index',
20
- 'model-policy',
21
- 'model-catalog',
22
- 'presets',
23
- 'config',
24
- ]);
25
-
26
- // Capabilities the current MCP workflow depends on for full Hub execution.
27
- // Additional capabilities may be advertised without breaking compatibility.
28
- export const REQUIRED_HUB_CAPABILITIES = Object.freeze([
29
- 'jobs',
30
- 'jobs-wait',
31
- 'jobs-cancel',
32
- 'roles',
33
- 'attempt-index',
34
- 'model-policy',
35
- ]);
36
-
37
- export const HUB_COMPATIBILITY_CODES = Object.freeze({
38
- UNREACHABLE: 'HUB_UNREACHABLE',
39
- HTTP_ERROR: 'HUB_HTTP_ERROR',
40
- SERVICE_MISMATCH: 'HUB_SERVICE_MISMATCH',
41
- PROTOCOL_MISSING: 'HUB_PROTOCOL_MISSING',
42
- PROTOCOL_MISMATCH: 'HUB_PROTOCOL_MISMATCH',
43
- CAPABILITY_MISSING: 'HUB_CAPABILITY_MISSING',
44
- });
45
-
46
- function normalizedCapabilities(value) {
47
- if (!Array.isArray(value)) return [];
48
- return [...new Set(value.filter((item) => typeof item === 'string' && item.trim()).map((item) => item.trim()))];
49
- }
50
-
51
- export function getHubRuntimeIdentity() {
52
- return {
53
- service: 'dsh-crew-hub',
54
- runtime_version: RUNTIME_VERSION,
55
- protocol_version: HUB_PROTOCOL_VERSION,
56
- capabilities: [...HUB_CAPABILITIES],
57
- };
58
- }
59
-
60
- /**
61
- * Evaluate an already-received Hub ping body.
62
- *
63
- * This function does no I/O. `reachable` means an HTTP response was received;
64
- * `compatible` means the response is from dsh-crew and satisfies the current
65
- * protocol + required capability contract.
66
- */
67
- export function evaluateHubHandshake(body, { requiredCapabilities = REQUIRED_HUB_CAPABILITIES } = {}) {
68
- const capabilities = normalizedCapabilities(body?.capabilities);
69
- const base = {
70
- reachable: true,
71
- compatible: false,
72
- service: typeof body?.service === 'string' ? body.service : null,
73
- runtime_version: typeof body?.runtime_version === 'string' ? body.runtime_version : null,
74
- protocol_version: Number.isInteger(body?.protocol_version) ? body.protocol_version : null,
75
- capabilities,
76
- missing_capabilities: [],
77
- code: null,
78
- };
79
-
80
- if (body?.service !== 'dsh-crew-hub') {
81
- return { ...base, code: HUB_COMPATIBILITY_CODES.SERVICE_MISMATCH };
82
- }
83
-
84
- if (!Number.isInteger(body?.protocol_version)) {
85
- return { ...base, code: HUB_COMPATIBILITY_CODES.PROTOCOL_MISSING };
86
- }
87
-
88
- if (body.protocol_version !== HUB_PROTOCOL_VERSION) {
89
- return { ...base, code: HUB_COMPATIBILITY_CODES.PROTOCOL_MISMATCH };
90
- }
91
-
92
- const required = normalizedCapabilities(requiredCapabilities);
93
- const advertised = new Set(capabilities);
94
- const missing = required.filter((capability) => !advertised.has(capability));
95
- if (missing.length > 0) {
96
- return {
97
- ...base,
98
- missing_capabilities: missing,
99
- code: HUB_COMPATIBILITY_CODES.CAPABILITY_MISSING,
100
- };
101
- }
102
-
103
- return {
104
- ...base,
105
- compatible: true,
106
- code: null,
107
- };
108
- }
1
+ // Shared runtime identity and Hub compatibility contract.
2
+ //
3
+ // Package/release semver and the wire protocol are intentionally separate:
4
+ // - RUNTIME_VERSION identifies the source/runtime generation for diagnostics.
5
+ // - HUB_PROTOCOL_VERSION changes only when Hub <-> MCP wire semantics become
6
+ // incompatible.
7
+ //
8
+ // Keep this module pure and dependency-free so Hub, MCP and tests all use the
9
+ // exact same compatibility rules.
10
+
11
+ export const RUNTIME_VERSION = '0.3.7';
12
+ export const HUB_PROTOCOL_VERSION = 1;
13
+
14
+ export const HUB_CAPABILITIES = Object.freeze([
15
+ 'jobs',
16
+ 'jobs-wait',
17
+ 'jobs-cancel',
18
+ 'roles',
19
+ 'attempt-index',
20
+ 'model-policy',
21
+ 'model-catalog',
22
+ 'presets',
23
+ 'config',
24
+ ]);
25
+
26
+ // Capabilities the current MCP workflow depends on for full Hub execution.
27
+ // Additional capabilities may be advertised without breaking compatibility.
28
+ export const REQUIRED_HUB_CAPABILITIES = Object.freeze([
29
+ 'jobs',
30
+ 'jobs-wait',
31
+ 'jobs-cancel',
32
+ 'roles',
33
+ 'attempt-index',
34
+ 'model-policy',
35
+ ]);
36
+
37
+ export const HUB_COMPATIBILITY_CODES = Object.freeze({
38
+ UNREACHABLE: 'HUB_UNREACHABLE',
39
+ HTTP_ERROR: 'HUB_HTTP_ERROR',
40
+ SERVICE_MISMATCH: 'HUB_SERVICE_MISMATCH',
41
+ PROTOCOL_MISSING: 'HUB_PROTOCOL_MISSING',
42
+ PROTOCOL_MISMATCH: 'HUB_PROTOCOL_MISMATCH',
43
+ CAPABILITY_MISSING: 'HUB_CAPABILITY_MISSING',
44
+ });
45
+
46
+ function normalizedCapabilities(value) {
47
+ if (!Array.isArray(value)) return [];
48
+ return [...new Set(value.filter((item) => typeof item === 'string' && item.trim()).map((item) => item.trim()))];
49
+ }
50
+
51
+ export function getHubRuntimeIdentity() {
52
+ return {
53
+ service: 'dsh-crew-hub',
54
+ runtime_version: RUNTIME_VERSION,
55
+ protocol_version: HUB_PROTOCOL_VERSION,
56
+ capabilities: [...HUB_CAPABILITIES],
57
+ };
58
+ }
59
+
60
+ /**
61
+ * Evaluate an already-received Hub ping body.
62
+ *
63
+ * This function does no I/O. `reachable` means an HTTP response was received;
64
+ * `compatible` means the response is from dsh-crew and satisfies the current
65
+ * protocol + required capability contract.
66
+ */
67
+ export function evaluateHubHandshake(body, { requiredCapabilities = REQUIRED_HUB_CAPABILITIES } = {}) {
68
+ const capabilities = normalizedCapabilities(body?.capabilities);
69
+ const base = {
70
+ reachable: true,
71
+ compatible: false,
72
+ service: typeof body?.service === 'string' ? body.service : null,
73
+ runtime_version: typeof body?.runtime_version === 'string' ? body.runtime_version : null,
74
+ protocol_version: Number.isInteger(body?.protocol_version) ? body.protocol_version : null,
75
+ capabilities,
76
+ missing_capabilities: [],
77
+ code: null,
78
+ };
79
+
80
+ if (body?.service !== 'dsh-crew-hub') {
81
+ return { ...base, code: HUB_COMPATIBILITY_CODES.SERVICE_MISMATCH };
82
+ }
83
+
84
+ if (!Number.isInteger(body?.protocol_version)) {
85
+ return { ...base, code: HUB_COMPATIBILITY_CODES.PROTOCOL_MISSING };
86
+ }
87
+
88
+ if (body.protocol_version !== HUB_PROTOCOL_VERSION) {
89
+ return { ...base, code: HUB_COMPATIBILITY_CODES.PROTOCOL_MISMATCH };
90
+ }
91
+
92
+ const required = normalizedCapabilities(requiredCapabilities);
93
+ const advertised = new Set(capabilities);
94
+ const missing = required.filter((capability) => !advertised.has(capability));
95
+ if (missing.length > 0) {
96
+ return {
97
+ ...base,
98
+ missing_capabilities: missing,
99
+ code: HUB_COMPATIBILITY_CODES.CAPABILITY_MISSING,
100
+ };
101
+ }
102
+
103
+ return {
104
+ ...base,
105
+ compatible: true,
106
+ code: null,
107
+ };
108
+ }