@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.
- package/.claude-plugin/plugin.json +8 -8
- package/.mcp.json +8 -8
- package/LICENSE +21 -21
- package/README.de.md +359 -359
- package/README.es.md +359 -359
- package/README.fr.md +359 -359
- package/README.hi.md +359 -359
- package/README.id.md +359 -359
- package/README.ja.md +359 -359
- package/README.ko.md +359 -359
- package/README.md +125 -180
- package/README.pt.md +359 -359
- package/README.ru.md +359 -359
- package/README.th.md +359 -359
- package/README.tr.md +359 -359
- package/README.vi.md +359 -359
- package/README.zh-TW.md +359 -359
- package/README.zh.md +125 -180
- package/agents/ds-flash.md +26 -26
- package/agents/ds-pro.md +32 -32
- package/agents/ds-reviewer.md +23 -23
- package/agents/ds-worker.md +22 -22
- package/codex/agents/ds-flash.toml +30 -30
- package/codex/agents/ds-pro.toml +31 -31
- package/codex/agents/ds-reviewer.toml +28 -28
- package/codex/agents/ds-worker.toml +28 -28
- package/codex/prompts/dsh-config.md +3 -3
- package/codex/prompts/dsh-status.md +1 -1
- package/commands/config.md +11 -11
- package/commands/off.md +5 -5
- package/commands/on.md +5 -5
- package/commands/status.md +5 -5
- package/cordis.patch.yml +4 -4
- package/lib/client.js +3446 -2765
- package/package.json +131 -131
- package/scripts/build-client.mjs +28 -28
- package/scripts/live-crew-smoke.mjs +39 -39
- package/scripts/live-policy-matrix.mjs +177 -177
- package/scripts/policy-probe.mjs +101 -101
- package/scripts/setup.mjs +284 -284
- package/scripts/smoke-real.mjs +110 -110
- package/scripts/smoke.mjs +78 -78
- package/scripts/verify-installer-fix.mjs +26 -26
- package/src/adaptive-routing.mjs +260 -260
- package/src/client/activation-summary.tsx +64 -64
- package/src/client/collapsible-sections.mjs +55 -0
- package/src/client/entry.tsx +236 -236
- package/src/client/index.tsx +1213 -1120
- package/src/config-readiness.mjs +59 -59
- package/src/delivery.mjs +205 -205
- package/src/dsh-cli-runtime.mjs +239 -239
- package/src/failure-classification.mjs +172 -172
- package/src/hub/entry.mjs +98 -98
- package/src/hub-client.mjs +132 -132
- package/src/hub-compatibility.mjs +49 -49
- package/src/i18n.mjs +19 -19
- package/src/install/cli.mjs +28 -28
- package/src/install/install-legacy.mjs +462 -462
- package/src/install/install.mjs +451 -451
- package/src/install/npx-lifecycle.mjs +1055 -1055
- package/src/mcp-runtime.mjs +257 -257
- package/src/model-catalog.mjs +173 -173
- package/src/model-routing.mjs +391 -391
- package/src/policy.mjs +197 -197
- package/src/readiness-matrix.mjs +169 -169
- package/src/runtime-controls.mjs +90 -90
- package/src/runtime-identity.mjs +108 -108
- package/src/server.mjs +477 -477
- package/src/status-shard.mjs +52 -52
- package/src/structured-error-code.mjs +38 -38
- package/src/vision-route.mjs +138 -138
- package/src/workflow-runtime.mjs +573 -573
- package/src/workflow.mjs +160 -160
- package/src/workspace-audit.mjs +231 -231
- package/src/workspace-isolation.mjs +365 -365
- package/statusline/statusline.sh +14 -14
- package/statusline/worker-segment.sh +35 -35
- package/worker.cordis.yml +77 -77
package/src/runtime-identity.mjs
CHANGED
|
@@ -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.
|
|
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
|
+
}
|