@ran-sh/dsh-crew 1.9.0 → 1.10.0
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/marketplace.json +16 -16
- package/.claude-plugin/plugin.json +14 -14
- 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 +126 -126
- 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 +116 -116
- package/agents/ds-flash.md +24 -24
- package/agents/ds-pro.md +24 -24
- package/agents/ds-reviewer.md +23 -23
- package/agents/ds-worker.md +23 -23
- package/bin/dsh-crew.mjs +16 -16
- package/codex/agents/ds-flash.toml +34 -34
- package/codex/agents/ds-pro.toml +34 -34
- package/codex/agents/ds-reviewer.toml +32 -32
- package/codex/agents/ds-worker.toml +32 -32
- package/codex/prompts/dsh-config.md +19 -19
- package/codex/prompts/dsh-status.md +5 -5
- package/commands/config.md +23 -23
- package/commands/off.md +5 -5
- package/commands/on.md +5 -5
- package/commands/status.md +9 -9
- package/cordis.patch.yml +4 -4
- package/docs/gpt-relay-extension.md +103 -103
- package/docs/installation.md +138 -138
- package/docs/job-contracts.md +103 -103
- package/docs/readiness-matrix.md +85 -85
- package/docs/ui-surfaces.md +107 -107
- package/official-web-bridge/cordis.patch.yml +4 -4
- package/official-web-bridge/entry.mjs +1 -1
- package/official-web-bridge/overlay-entry.mjs +59 -59
- package/official-web-bridge/package.json +25 -25
- package/package.json +3 -2
- package/scripts/build-client.mjs +49 -49
- 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/remove-legacy-official-bridge.ps1 +89 -89
- package/scripts/setup.mjs +393 -393
- package/scripts/smoke-real.mjs +110 -110
- package/scripts/smoke.mjs +78 -78
- package/scripts/verify-crew-ui-polish.mjs +145 -145
- package/scripts/verify-history-ui.mjs +97 -97
- package/scripts/verify-installer-fix.mjs +26 -26
- package/scripts/verify-npm-install.mjs +311 -311
- package/scripts/verify-official-bridge-e2e.mjs +192 -192
- package/src/adaptive-routing.mjs +260 -260
- package/src/client/activation-summary.tsx +64 -64
- package/src/client/collapsible-sections.mjs +55 -55
- package/src/client/history-panel.tsx +108 -108
- package/src/client/host-readiness.mjs +71 -71
- package/src/client/index.tsx +1711 -1711
- package/src/client/model-callability-view.mjs +17 -17
- package/src/client/panel-chrome.tsx +40 -40
- package/src/client/quick-entry.tsx +10 -10
- package/src/client/quick-panel.tsx +275 -275
- package/src/client/readiness-envelope.mjs +34 -34
- package/src/client/surface-detection.mjs +43 -43
- package/src/config-readiness.mjs +226 -226
- package/src/credential-reference.mjs +38 -38
- package/src/delivery.mjs +205 -205
- package/src/dsh-cli-runtime.mjs +1021 -1021
- package/src/dsh-cohort.mjs +20 -20
- package/src/extension-contract.mjs +104 -104
- package/src/failure-classification.mjs +201 -201
- package/src/history/admission-gate.mjs +67 -67
- package/src/history/archive-store.mjs +272 -272
- package/src/history/cleanup-plan.mjs +89 -89
- package/src/history/http.mjs +32 -32
- package/src/history/operation.mjs +86 -86
- package/src/history/runner-detach.mjs +34 -34
- package/src/history/runner.mjs +52 -52
- package/src/history/runtime.mjs +36 -36
- package/src/history/service.mjs +177 -177
- package/src/history/state.mjs +27 -27
- package/src/hub/entry.mjs +104 -104
- package/src/hub/index.mjs +2694 -2694
- package/src/hub-client.mjs +154 -154
- package/src/hub-compatibility.mjs +42 -42
- package/src/i18n.mjs +19 -19
- package/src/information-flow.mjs +67 -67
- package/src/install/cli.mjs +28 -28
- package/src/install/install-legacy.mjs +711 -711
- package/src/install/install.mjs +483 -483
- package/src/install/npx-lifecycle.mjs +3456 -3456
- package/src/install/official-frontend-assets.mjs +78 -78
- package/src/install/official-web.mjs +95 -95
- package/src/install/payload-content.mjs +88 -88
- package/src/install/windows-startup.mjs +236 -236
- package/src/install/windows-supervisor-adapter.mjs +443 -443
- package/src/install/windows-supervisor-lifecycle.mjs +782 -782
- package/src/install/zcode.mjs +397 -397
- package/src/job-contracts.mjs +255 -255
- package/src/local-request-guard.mjs +60 -60
- package/src/mcp-runtime.mjs +340 -340
- package/src/model-callability-contract.mjs +79 -79
- package/src/model-catalog.mjs +180 -180
- package/src/model-routing.mjs +586 -586
- package/src/model-schedule.mjs +207 -207
- package/src/official-web-bridge.mjs +447 -447
- package/src/policy.mjs +235 -235
- package/src/provider-delete-adapters.mjs +1934 -1934
- package/src/provider-health.mjs +130 -130
- package/src/provider-inventory.mjs +182 -182
- package/src/provider-layer-migration-adapters.mjs +759 -759
- package/src/provider-layer-migration.mjs +198 -198
- package/src/provider-lifecycle-state.mjs +103 -103
- package/src/provider-lifecycle.mjs +252 -252
- package/src/provider-profile-store.mjs +390 -390
- package/src/provider-settings-store.mjs +633 -633
- package/src/provider-store-lock.mjs +67 -67
- package/src/readiness-matrix.mjs +181 -181
- package/src/removable-waiter.mjs +29 -29
- package/src/role-profiles.mjs +107 -107
- package/src/runtime-controls.mjs +84 -84
- package/src/runtime-identity-contract.mjs +34 -34
- package/src/runtime-identity.mjs +235 -235
- package/src/runtime-readiness-snapshot.mjs +285 -285
- package/src/server.mjs +581 -581
- package/src/session-origins.mjs +60 -60
- package/src/standalone-sdk.mjs +23 -23
- package/src/status-shard.mjs +63 -63
- package/src/structured-error-code.mjs +38 -38
- package/src/supervisor/restart-request.mjs +256 -256
- package/src/workflow-runtime.mjs +739 -739
- package/src/workflow.mjs +155 -155
- package/src/workspace-audit.mjs +231 -231
- package/src/workspace-context.mjs +146 -146
- package/src/workspace-isolation.mjs +463 -455
- package/src/workspace-readiness.mjs +32 -32
- package/statusline/statusline.sh +14 -14
- package/statusline/worker-segment.sh +35 -35
- package/windows/start-dsh-crew.cmd +57 -57
- package/windows/start-dsh-crew.ps1 +1302 -1302
- package/windows/supervisor-control.ps1 +467 -467
- package/worker.cordis.yml +67 -67
- package/zcode/agents/ds-reviewer.md +31 -31
- package/zcode/agents/ds-worker.md +31 -31
- package/zcode/commands/dsh-config.md +17 -17
- package/zcode/commands/dsh-status.md +5 -5
package/src/dsh-cohort.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
// Single source of truth for the pinned DeepSeek Harness cohort.
|
|
2
|
-
//
|
|
3
|
-
// The Crew runtime, the SDK client, and the worker composition must all
|
|
4
|
-
// resolve to this exact version. All other modules re-export from here so a
|
|
5
|
-
// cohort bump touches exactly one file (plus package.json's 48 DSH pins).
|
|
6
|
-
export const DSH_CLI_PACKAGE = '@deepseek-ai/dsh';
|
|
7
|
-
export const TARGET_DSH_VERSION = '0.1.5-rc.2';
|
|
8
|
-
export const TARGET_DSH_SPEC = `${DSH_CLI_PACKAGE}@${TARGET_DSH_VERSION}`;
|
|
9
|
-
|
|
10
|
-
// Retained-cohort support: when a release's manifest pins an older DSH
|
|
11
|
-
// cohort than the current TARGET, the old runtime is retained on disk so a
|
|
12
|
-
// rollback can restore it offline (no registry round-trip).
|
|
13
|
-
export const RETAINED_RUNTIMES_DIRNAME = 'retained-runtimes';
|
|
14
|
-
|
|
15
|
-
// Lifecycle-owned cohort metadata for a managed release. Historical releases
|
|
16
|
-
// (pre-1.0.4) did not pin @deepseek-ai/dsh in their manifest; this sidecar
|
|
17
|
-
// records the runtime cohort fact the lifecycle observed for them WITHOUT
|
|
18
|
-
// mutating the immutable release manifest. Resolution priority:
|
|
19
|
-
// manifest exact pin -> sidecar -> (legacy discovery) -> fail closed.
|
|
20
|
-
export const RELEASE_COHORT_FILENAME = 'release-cohort.json';
|
|
1
|
+
// Single source of truth for the pinned DeepSeek Harness cohort.
|
|
2
|
+
//
|
|
3
|
+
// The Crew runtime, the SDK client, and the worker composition must all
|
|
4
|
+
// resolve to this exact version. All other modules re-export from here so a
|
|
5
|
+
// cohort bump touches exactly one file (plus package.json's 48 DSH pins).
|
|
6
|
+
export const DSH_CLI_PACKAGE = '@deepseek-ai/dsh';
|
|
7
|
+
export const TARGET_DSH_VERSION = '0.1.5-rc.2';
|
|
8
|
+
export const TARGET_DSH_SPEC = `${DSH_CLI_PACKAGE}@${TARGET_DSH_VERSION}`;
|
|
9
|
+
|
|
10
|
+
// Retained-cohort support: when a release's manifest pins an older DSH
|
|
11
|
+
// cohort than the current TARGET, the old runtime is retained on disk so a
|
|
12
|
+
// rollback can restore it offline (no registry round-trip).
|
|
13
|
+
export const RETAINED_RUNTIMES_DIRNAME = 'retained-runtimes';
|
|
14
|
+
|
|
15
|
+
// Lifecycle-owned cohort metadata for a managed release. Historical releases
|
|
16
|
+
// (pre-1.0.4) did not pin @deepseek-ai/dsh in their manifest; this sidecar
|
|
17
|
+
// records the runtime cohort fact the lifecycle observed for them WITHOUT
|
|
18
|
+
// mutating the immutable release manifest. Resolution priority:
|
|
19
|
+
// manifest exact pin -> sidecar -> (legacy discovery) -> fail closed.
|
|
20
|
+
export const RELEASE_COHORT_FILENAME = 'release-cohort.json';
|
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
// Stable extension-capability projection for GPT-first orchestrators. It
|
|
2
|
-
// describes only DSH Crew and deliberately never advertises itself as a top-
|
|
3
|
-
// level Executor or control plane.
|
|
4
|
-
|
|
5
|
-
import { validateModelCallabilityV2 } from './model-callability-contract.mjs';
|
|
6
|
-
|
|
7
|
-
export const EXTENSION_CONTRACT_SCHEMA_VERSION = 1;
|
|
8
|
-
|
|
9
|
-
function row(matrix, id) {
|
|
10
|
-
return Array.isArray(matrix?.rows) ? matrix.rows.find((entry) => entry?.id === id) : undefined;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function component(status, reasonCode, evidence = null) {
|
|
14
|
-
return { status, reason_code: reasonCode, ...(evidence ? { evidence } : {}) };
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function workspaceComponent(workspace) {
|
|
18
|
-
if (workspace?.status === 'CONFLICT' || workspace?.status === 'READ_ONLY') {
|
|
19
|
-
return { ...component('DEGRADED', workspace.reason_code ?? `WORKSPACE_${workspace.status}`), state: workspace.status };
|
|
20
|
-
}
|
|
21
|
-
if (workspace?.status === 'UNAVAILABLE') {
|
|
22
|
-
return { ...component('UNAVAILABLE', workspace.reason_code ?? 'WORKSPACE_UNAVAILABLE'), state: 'UNAVAILABLE' };
|
|
23
|
-
}
|
|
24
|
-
if (workspace?.status === 'READY') {
|
|
25
|
-
return { ...component('READY', workspace.reason_code ?? 'WORKSPACE_READY'), state: 'READY' };
|
|
26
|
-
}
|
|
27
|
-
return workspace?.ok === true
|
|
28
|
-
? { ...component('READY', workspace.context ? 'WORKSPACE_CONTEXT_RESOLVED' : 'WORKSPACE_CONTEXT_NOT_REQUESTED'), state: 'READY' }
|
|
29
|
-
: { ...component('UNAVAILABLE', workspace?.code ?? 'WORKSPACE_NOT_CHECKED'), state: 'UNAVAILABLE' };
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function readinessFromRow(entry, { pass = 'READY', notRun = 'DEGRADED' } = {}) {
|
|
33
|
-
if (!entry) return component('UNAVAILABLE', 'NO_EVIDENCE');
|
|
34
|
-
if (entry.status === 'PASS') return component(pass, entry.reason_code ?? 'CHECK_PASSED');
|
|
35
|
-
if (entry.status === 'NOT_RUN' || entry.status === 'SKIP') return component(notRun, entry.reason_code ?? 'CHECK_NOT_RUN');
|
|
36
|
-
return component('UNAVAILABLE', entry.reason_code ?? 'CHECK_FAILED');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function modelReadinessFromSnapshot(readinessSnapshot, matrix, runtime, expectedEnabledRoles, now = Date.now()) {
|
|
40
|
-
const callability = readinessSnapshot?.model_callability;
|
|
41
|
-
const providerHealthEvidence = row(matrix, 'provider_health');
|
|
42
|
-
const catalogEvidence = row(matrix, 'provider_catalog');
|
|
43
|
-
if (callability && typeof callability === 'object') {
|
|
44
|
-
const validation = validateModelCallabilityV2({
|
|
45
|
-
projection: callability,
|
|
46
|
-
runtime,
|
|
47
|
-
expectedEnabledRoles,
|
|
48
|
-
expectedSelections: { worker: readinessSnapshot?.worker?.selected ?? null, reviewer: readinessSnapshot?.reviewer?.selected ?? null },
|
|
49
|
-
now,
|
|
50
|
-
});
|
|
51
|
-
if (validation.ok && validation.state === 'CALLABLE') return component('READY', 'CURRENT_MODEL_CALLABLE', { captured_at: callability.captured_at, expires_at: callability.expires_at, runtime_id: callability.current_runtime_id });
|
|
52
|
-
if (validation.ok && validation.state === 'NOT_CALLABLE') return component('UNAVAILABLE', callability.roles.worker?.state === 'NOT_CALLABLE' ? callability.roles.worker.reason_code : callability.roles.reviewer.reason_code ?? 'CURRENT_MODEL_NOT_CALLABLE');
|
|
53
|
-
if (validation.ok && validation.state === 'STALE') return component('DEGRADED', 'MODEL_EVIDENCE_STALE');
|
|
54
|
-
return component('DEGRADED', validation.reason_code ?? 'MODEL_CALLABILITY_UNKNOWN');
|
|
55
|
-
}
|
|
56
|
-
if (providerHealthEvidence?.status === 'FAIL') return readinessFromRow(providerHealthEvidence);
|
|
57
|
-
if (catalogEvidence?.status === 'FAIL') return readinessFromRow(catalogEvidence);
|
|
58
|
-
if (providerHealthEvidence || catalogEvidence) return component('DEGRADED', 'MODEL_CALLABILITY_NOT_PROJECTED');
|
|
59
|
-
return component('UNAVAILABLE', 'MODEL_CALLABILITY_NOT_PROJECTED');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function buildExtensionContract({ config = {}, readinessMatrix = {}, readinessSnapshot = null, workspace = null, profiles = null, runtime = null } = {}) {
|
|
63
|
-
const matrix = readinessSnapshot?.readiness_matrix ?? readinessMatrix;
|
|
64
|
-
const workerEnabled = config.subagents_enabled !== false && config.worker_state !== 'disabled';
|
|
65
|
-
const reviewerEnabled = config.subagents_enabled !== false && config.review_state !== 'disabled';
|
|
66
|
-
const reviewerHealthEvidence = row(matrix, 'reviewer_health');
|
|
67
|
-
const lifecycleEvidence = row(matrix, 'provider_lifecycle_consistent');
|
|
68
|
-
const modelReadiness = modelReadinessFromSnapshot(readinessSnapshot, matrix, runtime, { worker: workerEnabled, reviewer: reviewerEnabled });
|
|
69
|
-
const components = {
|
|
70
|
-
harness: readinessFromRow(row(matrix, 'hub_compatibility')),
|
|
71
|
-
provider_lifecycle: lifecycleEvidence
|
|
72
|
-
? readinessFromRow(lifecycleEvidence, { notRun: 'DEGRADED' })
|
|
73
|
-
: component('DEGRADED', 'PROVIDER_LIFECYCLE_NOT_CHECKED'),
|
|
74
|
-
model: modelReadiness,
|
|
75
|
-
workspace: workspaceComponent(workspace),
|
|
76
|
-
reviewer: reviewerEnabled
|
|
77
|
-
? reviewerHealthEvidence?.status === 'FAIL'
|
|
78
|
-
? readinessFromRow(reviewerHealthEvidence)
|
|
79
|
-
: readinessFromRow(row(matrix, 'reviewer_pipeline'))
|
|
80
|
-
: component('NOT_APPLICABLE', 'REVIEWER_DISABLED'),
|
|
81
|
-
};
|
|
82
|
-
const states = Object.entries(components).filter(([key]) => key !== 'reviewer' || reviewerEnabled).map(([, entry]) => entry.status);
|
|
83
|
-
const readiness = states.includes('UNAVAILABLE') ? 'UNAVAILABLE' : states.includes('DEGRADED') ? 'DEGRADED' : 'READY';
|
|
84
|
-
return {
|
|
85
|
-
schema_version: EXTENSION_CONTRACT_SCHEMA_VERSION,
|
|
86
|
-
kind: 'dsh-crew-extension',
|
|
87
|
-
runtime: runtime ?? null,
|
|
88
|
-
...(readinessSnapshot ? { readiness_snapshot: readinessSnapshot } : {}),
|
|
89
|
-
capabilities: {
|
|
90
|
-
'deepseek.worker': workerEnabled,
|
|
91
|
-
'deepseek.reviewer': reviewerEnabled,
|
|
92
|
-
'worktree.isolation': true,
|
|
93
|
-
'model.fallback': config.escalate_on_failure === true,
|
|
94
|
-
'job.cancel': true,
|
|
95
|
-
'job.watch': true,
|
|
96
|
-
'job.resume': false,
|
|
97
|
-
'result.evidence': true,
|
|
98
|
-
'events.canonical': true,
|
|
99
|
-
'profiles.roles': profiles?.ok === true,
|
|
100
|
-
'workspace.context': true,
|
|
101
|
-
},
|
|
102
|
-
readiness: { status: readiness, components },
|
|
103
|
-
};
|
|
104
|
-
}
|
|
1
|
+
// Stable extension-capability projection for GPT-first orchestrators. It
|
|
2
|
+
// describes only DSH Crew and deliberately never advertises itself as a top-
|
|
3
|
+
// level Executor or control plane.
|
|
4
|
+
|
|
5
|
+
import { validateModelCallabilityV2 } from './model-callability-contract.mjs';
|
|
6
|
+
|
|
7
|
+
export const EXTENSION_CONTRACT_SCHEMA_VERSION = 1;
|
|
8
|
+
|
|
9
|
+
function row(matrix, id) {
|
|
10
|
+
return Array.isArray(matrix?.rows) ? matrix.rows.find((entry) => entry?.id === id) : undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function component(status, reasonCode, evidence = null) {
|
|
14
|
+
return { status, reason_code: reasonCode, ...(evidence ? { evidence } : {}) };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function workspaceComponent(workspace) {
|
|
18
|
+
if (workspace?.status === 'CONFLICT' || workspace?.status === 'READ_ONLY') {
|
|
19
|
+
return { ...component('DEGRADED', workspace.reason_code ?? `WORKSPACE_${workspace.status}`), state: workspace.status };
|
|
20
|
+
}
|
|
21
|
+
if (workspace?.status === 'UNAVAILABLE') {
|
|
22
|
+
return { ...component('UNAVAILABLE', workspace.reason_code ?? 'WORKSPACE_UNAVAILABLE'), state: 'UNAVAILABLE' };
|
|
23
|
+
}
|
|
24
|
+
if (workspace?.status === 'READY') {
|
|
25
|
+
return { ...component('READY', workspace.reason_code ?? 'WORKSPACE_READY'), state: 'READY' };
|
|
26
|
+
}
|
|
27
|
+
return workspace?.ok === true
|
|
28
|
+
? { ...component('READY', workspace.context ? 'WORKSPACE_CONTEXT_RESOLVED' : 'WORKSPACE_CONTEXT_NOT_REQUESTED'), state: 'READY' }
|
|
29
|
+
: { ...component('UNAVAILABLE', workspace?.code ?? 'WORKSPACE_NOT_CHECKED'), state: 'UNAVAILABLE' };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function readinessFromRow(entry, { pass = 'READY', notRun = 'DEGRADED' } = {}) {
|
|
33
|
+
if (!entry) return component('UNAVAILABLE', 'NO_EVIDENCE');
|
|
34
|
+
if (entry.status === 'PASS') return component(pass, entry.reason_code ?? 'CHECK_PASSED');
|
|
35
|
+
if (entry.status === 'NOT_RUN' || entry.status === 'SKIP') return component(notRun, entry.reason_code ?? 'CHECK_NOT_RUN');
|
|
36
|
+
return component('UNAVAILABLE', entry.reason_code ?? 'CHECK_FAILED');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function modelReadinessFromSnapshot(readinessSnapshot, matrix, runtime, expectedEnabledRoles, now = Date.now()) {
|
|
40
|
+
const callability = readinessSnapshot?.model_callability;
|
|
41
|
+
const providerHealthEvidence = row(matrix, 'provider_health');
|
|
42
|
+
const catalogEvidence = row(matrix, 'provider_catalog');
|
|
43
|
+
if (callability && typeof callability === 'object') {
|
|
44
|
+
const validation = validateModelCallabilityV2({
|
|
45
|
+
projection: callability,
|
|
46
|
+
runtime,
|
|
47
|
+
expectedEnabledRoles,
|
|
48
|
+
expectedSelections: { worker: readinessSnapshot?.worker?.selected ?? null, reviewer: readinessSnapshot?.reviewer?.selected ?? null },
|
|
49
|
+
now,
|
|
50
|
+
});
|
|
51
|
+
if (validation.ok && validation.state === 'CALLABLE') return component('READY', 'CURRENT_MODEL_CALLABLE', { captured_at: callability.captured_at, expires_at: callability.expires_at, runtime_id: callability.current_runtime_id });
|
|
52
|
+
if (validation.ok && validation.state === 'NOT_CALLABLE') return component('UNAVAILABLE', callability.roles.worker?.state === 'NOT_CALLABLE' ? callability.roles.worker.reason_code : callability.roles.reviewer.reason_code ?? 'CURRENT_MODEL_NOT_CALLABLE');
|
|
53
|
+
if (validation.ok && validation.state === 'STALE') return component('DEGRADED', 'MODEL_EVIDENCE_STALE');
|
|
54
|
+
return component('DEGRADED', validation.reason_code ?? 'MODEL_CALLABILITY_UNKNOWN');
|
|
55
|
+
}
|
|
56
|
+
if (providerHealthEvidence?.status === 'FAIL') return readinessFromRow(providerHealthEvidence);
|
|
57
|
+
if (catalogEvidence?.status === 'FAIL') return readinessFromRow(catalogEvidence);
|
|
58
|
+
if (providerHealthEvidence || catalogEvidence) return component('DEGRADED', 'MODEL_CALLABILITY_NOT_PROJECTED');
|
|
59
|
+
return component('UNAVAILABLE', 'MODEL_CALLABILITY_NOT_PROJECTED');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function buildExtensionContract({ config = {}, readinessMatrix = {}, readinessSnapshot = null, workspace = null, profiles = null, runtime = null } = {}) {
|
|
63
|
+
const matrix = readinessSnapshot?.readiness_matrix ?? readinessMatrix;
|
|
64
|
+
const workerEnabled = config.subagents_enabled !== false && config.worker_state !== 'disabled';
|
|
65
|
+
const reviewerEnabled = config.subagents_enabled !== false && config.review_state !== 'disabled';
|
|
66
|
+
const reviewerHealthEvidence = row(matrix, 'reviewer_health');
|
|
67
|
+
const lifecycleEvidence = row(matrix, 'provider_lifecycle_consistent');
|
|
68
|
+
const modelReadiness = modelReadinessFromSnapshot(readinessSnapshot, matrix, runtime, { worker: workerEnabled, reviewer: reviewerEnabled });
|
|
69
|
+
const components = {
|
|
70
|
+
harness: readinessFromRow(row(matrix, 'hub_compatibility')),
|
|
71
|
+
provider_lifecycle: lifecycleEvidence
|
|
72
|
+
? readinessFromRow(lifecycleEvidence, { notRun: 'DEGRADED' })
|
|
73
|
+
: component('DEGRADED', 'PROVIDER_LIFECYCLE_NOT_CHECKED'),
|
|
74
|
+
model: modelReadiness,
|
|
75
|
+
workspace: workspaceComponent(workspace),
|
|
76
|
+
reviewer: reviewerEnabled
|
|
77
|
+
? reviewerHealthEvidence?.status === 'FAIL'
|
|
78
|
+
? readinessFromRow(reviewerHealthEvidence)
|
|
79
|
+
: readinessFromRow(row(matrix, 'reviewer_pipeline'))
|
|
80
|
+
: component('NOT_APPLICABLE', 'REVIEWER_DISABLED'),
|
|
81
|
+
};
|
|
82
|
+
const states = Object.entries(components).filter(([key]) => key !== 'reviewer' || reviewerEnabled).map(([, entry]) => entry.status);
|
|
83
|
+
const readiness = states.includes('UNAVAILABLE') ? 'UNAVAILABLE' : states.includes('DEGRADED') ? 'DEGRADED' : 'READY';
|
|
84
|
+
return {
|
|
85
|
+
schema_version: EXTENSION_CONTRACT_SCHEMA_VERSION,
|
|
86
|
+
kind: 'dsh-crew-extension',
|
|
87
|
+
runtime: runtime ?? null,
|
|
88
|
+
...(readinessSnapshot ? { readiness_snapshot: readinessSnapshot } : {}),
|
|
89
|
+
capabilities: {
|
|
90
|
+
'deepseek.worker': workerEnabled,
|
|
91
|
+
'deepseek.reviewer': reviewerEnabled,
|
|
92
|
+
'worktree.isolation': true,
|
|
93
|
+
'model.fallback': config.escalate_on_failure === true,
|
|
94
|
+
'job.cancel': true,
|
|
95
|
+
'job.watch': true,
|
|
96
|
+
'job.resume': false,
|
|
97
|
+
'result.evidence': true,
|
|
98
|
+
'events.canonical': true,
|
|
99
|
+
'profiles.roles': profiles?.ok === true,
|
|
100
|
+
'workspace.context': true,
|
|
101
|
+
},
|
|
102
|
+
readiness: { status: readiness, components },
|
|
103
|
+
};
|
|
104
|
+
}
|