@ran-sh/dsh-crew 0.3.1 → 0.3.3

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 (80) hide show
  1. package/.claude-plugin/marketplace.json +17 -17
  2. package/.claude-plugin/plugin.json +8 -8
  3. package/.mcp.json +8 -8
  4. package/LICENSE +21 -21
  5. package/README.de.md +359 -359
  6. package/README.es.md +359 -359
  7. package/README.fr.md +359 -359
  8. package/README.hi.md +359 -359
  9. package/README.id.md +359 -359
  10. package/README.ja.md +359 -359
  11. package/README.ko.md +359 -359
  12. package/README.md +168 -140
  13. package/README.pt.md +359 -359
  14. package/README.ru.md +359 -359
  15. package/README.th.md +359 -359
  16. package/README.tr.md +359 -359
  17. package/README.vi.md +359 -359
  18. package/README.zh-TW.md +359 -359
  19. package/README.zh.md +168 -140
  20. package/agents/ds-flash.md +26 -26
  21. package/agents/ds-pro.md +32 -32
  22. package/agents/ds-reviewer.md +23 -23
  23. package/agents/ds-worker.md +22 -22
  24. package/bin/dsh-crew.mjs +12 -0
  25. package/codex/agents/ds-flash.toml +30 -30
  26. package/codex/agents/ds-pro.toml +31 -31
  27. package/codex/agents/ds-reviewer.toml +28 -28
  28. package/codex/agents/ds-worker.toml +28 -28
  29. package/codex/prompts/dsh-config.md +3 -3
  30. package/codex/prompts/dsh-status.md +1 -1
  31. package/commands/config.md +11 -11
  32. package/commands/off.md +5 -5
  33. package/commands/on.md +5 -5
  34. package/commands/status.md +5 -5
  35. package/cordis.patch.yml +4 -4
  36. package/lib/client.js +2765 -2765
  37. package/package.json +131 -127
  38. package/scripts/build-client.mjs +28 -28
  39. package/scripts/live-crew-smoke.mjs +39 -39
  40. package/scripts/live-policy-matrix.mjs +177 -177
  41. package/scripts/policy-probe.mjs +101 -101
  42. package/scripts/setup.mjs +295 -294
  43. package/scripts/smoke-real.mjs +110 -110
  44. package/scripts/smoke.mjs +78 -78
  45. package/scripts/verify-installer-fix.mjs +26 -26
  46. package/scripts/verify-npm-install.mjs +297 -276
  47. package/src/adaptive-routing.mjs +260 -260
  48. package/src/client/activation-summary.tsx +64 -64
  49. package/src/client/entry.tsx +236 -236
  50. package/src/client/index.tsx +1120 -1120
  51. package/src/config-readiness.mjs +59 -59
  52. package/src/delivery.mjs +205 -205
  53. package/src/dsh-cli-runtime.mjs +447 -251
  54. package/src/failure-classification.mjs +172 -172
  55. package/src/hub/entry.mjs +98 -98
  56. package/src/hub-client.mjs +132 -132
  57. package/src/hub-compatibility.mjs +49 -49
  58. package/src/i18n.mjs +19 -19
  59. package/src/install/cli.mjs +28 -28
  60. package/src/install/install-legacy.mjs +462 -460
  61. package/src/install/install.mjs +451 -451
  62. package/src/install/npx-lifecycle.mjs +797 -0
  63. package/src/mcp-runtime.mjs +257 -257
  64. package/src/model-catalog.mjs +173 -173
  65. package/src/model-routing.mjs +391 -391
  66. package/src/policy.mjs +197 -197
  67. package/src/readiness-matrix.mjs +169 -169
  68. package/src/runtime-controls.mjs +90 -90
  69. package/src/runtime-identity.mjs +108 -108
  70. package/src/server.mjs +477 -477
  71. package/src/status-shard.mjs +52 -52
  72. package/src/structured-error-code.mjs +38 -38
  73. package/src/vision-route.mjs +138 -138
  74. package/src/workflow-runtime.mjs +573 -567
  75. package/src/workflow.mjs +160 -160
  76. package/src/workspace-audit.mjs +231 -231
  77. package/src/workspace-isolation.mjs +365 -306
  78. package/statusline/statusline.sh +14 -14
  79. package/statusline/worker-segment.sh +35 -35
  80. 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.1';
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.3';
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
+ }