wicked-crew 0.18.19 → 0.18.21
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/README.md +9 -6
- package/dist/api/ask-paths.d.ts +2 -0
- package/dist/api/ask-paths.d.ts.map +1 -1
- package/dist/api/ask-paths.js +6 -0
- package/dist/api/ask-paths.js.map +1 -1
- package/dist/api/auth.d.ts +7 -5
- package/dist/api/auth.d.ts.map +1 -1
- package/dist/api/auth.js +23 -9
- package/dist/api/auth.js.map +1 -1
- package/dist/api/capture.d.ts +5 -2
- package/dist/api/capture.d.ts.map +1 -1
- package/dist/api/capture.js +13 -10
- package/dist/api/capture.js.map +1 -1
- package/dist/api/chat-attachments.d.ts.map +1 -1
- package/dist/api/chat-attachments.js +69 -19
- package/dist/api/chat-attachments.js.map +1 -1
- package/dist/api/chat-citations.d.ts.map +1 -1
- package/dist/api/chat-citations.js +22 -0
- package/dist/api/chat-citations.js.map +1 -1
- package/dist/api/chat-context.d.ts +16 -1
- package/dist/api/chat-context.d.ts.map +1 -1
- package/dist/api/chat-context.js +75 -14
- package/dist/api/chat-context.js.map +1 -1
- package/dist/api/chat-freshness.js +2 -2
- package/dist/api/chat-freshness.js.map +1 -1
- package/dist/api/chat-history.d.ts +13 -0
- package/dist/api/chat-history.d.ts.map +1 -1
- package/dist/api/chat-history.js +25 -0
- package/dist/api/chat-history.js.map +1 -1
- package/dist/api/chat-jobs.d.ts +67 -6
- package/dist/api/chat-jobs.d.ts.map +1 -1
- package/dist/api/chat-jobs.js +243 -22
- package/dist/api/chat-jobs.js.map +1 -1
- package/dist/api/chat-proposals.d.ts +69 -6
- package/dist/api/chat-proposals.d.ts.map +1 -1
- package/dist/api/chat-proposals.js +310 -49
- package/dist/api/chat-proposals.js.map +1 -1
- package/dist/api/chat-requirements.d.ts.map +1 -1
- package/dist/api/chat-requirements.js +4 -1
- package/dist/api/chat-requirements.js.map +1 -1
- package/dist/api/chat-scope.d.ts +17 -9
- package/dist/api/chat-scope.d.ts.map +1 -1
- package/dist/api/chat-scope.js +55 -21
- package/dist/api/chat-scope.js.map +1 -1
- package/dist/api/cluster-status.d.ts +24 -12
- package/dist/api/cluster-status.d.ts.map +1 -1
- package/dist/api/cluster-status.js +82 -4
- package/dist/api/cluster-status.js.map +1 -1
- package/dist/api/codebase-archive.d.ts +4 -3
- package/dist/api/codebase-archive.d.ts.map +1 -1
- package/dist/api/codebase-archive.js +6 -5
- package/dist/api/codebase-archive.js.map +1 -1
- package/dist/api/delivery-cache.d.ts +2 -0
- package/dist/api/delivery-cache.d.ts.map +1 -1
- package/dist/api/delivery-cache.js +1 -2
- package/dist/api/delivery-cache.js.map +1 -1
- package/dist/api/delivery-index.d.ts +2 -2
- package/dist/api/delivery-index.d.ts.map +1 -1
- package/dist/api/delivery-index.js +1 -2
- package/dist/api/delivery-index.js.map +1 -1
- package/dist/api/eval-compare.d.ts +1 -1
- package/dist/api/eval-compare.js +1 -1
- package/dist/api/eval-sample.d.ts +7 -0
- package/dist/api/eval-sample.d.ts.map +1 -1
- package/dist/api/eval-sample.js +20 -0
- package/dist/api/eval-sample.js.map +1 -1
- package/dist/api/gate-cache.d.ts +1 -0
- package/dist/api/gate-cache.d.ts.map +1 -1
- package/dist/api/gate-cache.js +19 -6
- package/dist/api/gate-cache.js.map +1 -1
- package/dist/api/governance-steering.d.ts +17 -4
- package/dist/api/governance-steering.d.ts.map +1 -1
- package/dist/api/governance-steering.js +56 -7
- package/dist/api/governance-steering.js.map +1 -1
- package/dist/api/mcp.d.ts +12 -2
- package/dist/api/mcp.d.ts.map +1 -1
- package/dist/api/mcp.js +56 -12
- package/dist/api/mcp.js.map +1 -1
- package/dist/api/needs.d.ts +20 -0
- package/dist/api/needs.d.ts.map +1 -1
- package/dist/api/needs.js +120 -19
- package/dist/api/needs.js.map +1 -1
- package/dist/api/onboarding-capture.d.ts +21 -1
- package/dist/api/onboarding-capture.d.ts.map +1 -1
- package/dist/api/onboarding-capture.js +112 -8
- package/dist/api/onboarding-capture.js.map +1 -1
- package/dist/api/policy-landing.d.ts +36 -0
- package/dist/api/policy-landing.d.ts.map +1 -1
- package/dist/api/policy-landing.js +123 -4
- package/dist/api/policy-landing.js.map +1 -1
- package/dist/api/post-hoc-deliver.d.ts.map +1 -1
- package/dist/api/post-hoc-deliver.js +2 -1
- package/dist/api/post-hoc-deliver.js.map +1 -1
- package/dist/api/product.d.ts +1 -1
- package/dist/api/proposal-decisions.d.ts +44 -0
- package/dist/api/proposal-decisions.d.ts.map +1 -0
- package/dist/api/proposal-decisions.js +85 -0
- package/dist/api/proposal-decisions.js.map +1 -0
- package/dist/api/proposal-onboard.d.ts +38 -1
- package/dist/api/proposal-onboard.d.ts.map +1 -1
- package/dist/api/proposal-onboard.js +203 -14
- package/dist/api/proposal-onboard.js.map +1 -1
- package/dist/api/recording.d.ts +1 -1
- package/dist/api/recording.d.ts.map +1 -1
- package/dist/api/recording.js +4 -5
- package/dist/api/recording.js.map +1 -1
- package/dist/api/redeliver.d.ts.map +1 -1
- package/dist/api/redeliver.js +11 -7
- package/dist/api/redeliver.js.map +1 -1
- package/dist/api/repo-input.d.ts.map +1 -1
- package/dist/api/repo-input.js +5 -2
- package/dist/api/repo-input.js.map +1 -1
- package/dist/api/repo-origins.d.ts +24 -0
- package/dist/api/repo-origins.d.ts.map +1 -0
- package/dist/api/repo-origins.js +71 -0
- package/dist/api/repo-origins.js.map +1 -0
- package/dist/api/requirements.d.ts +37 -16
- package/dist/api/requirements.d.ts.map +1 -1
- package/dist/api/requirements.js +73 -2
- package/dist/api/requirements.js.map +1 -1
- package/dist/api/retry-index.d.ts +2 -0
- package/dist/api/retry-index.d.ts.map +1 -1
- package/dist/api/retry-index.js +16 -8
- package/dist/api/retry-index.js.map +1 -1
- package/dist/api/review-change.d.ts +5 -6
- package/dist/api/review-change.d.ts.map +1 -1
- package/dist/api/review-change.js +45 -8
- package/dist/api/review-change.js.map +1 -1
- package/dist/api/roster-standing.d.ts +2 -0
- package/dist/api/roster-standing.d.ts.map +1 -1
- package/dist/api/roster-standing.js +8 -1
- package/dist/api/roster-standing.js.map +1 -1
- package/dist/api/routes.d.ts +55 -12
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +961 -277
- package/dist/api/routes.js.map +1 -1
- package/dist/api/run-documents.d.ts +9 -1
- package/dist/api/run-documents.d.ts.map +1 -1
- package/dist/api/run-documents.js +63 -5
- package/dist/api/run-documents.js.map +1 -1
- package/dist/api/run-sources.d.ts +11 -1
- package/dist/api/run-sources.d.ts.map +1 -1
- package/dist/api/run-sources.js +26 -3
- package/dist/api/run-sources.js.map +1 -1
- package/dist/api/run-timing-index.d.ts +47 -0
- package/dist/api/run-timing-index.d.ts.map +1 -1
- package/dist/api/run-timing-index.js +196 -86
- package/dist/api/run-timing-index.js.map +1 -1
- package/dist/api/runtime-state.d.ts +6 -0
- package/dist/api/runtime-state.d.ts.map +1 -1
- package/dist/api/runtime-state.js +14 -3
- package/dist/api/runtime-state.js.map +1 -1
- package/dist/api/seat-agents.d.ts.map +1 -1
- package/dist/api/seat-agents.js +3 -3
- package/dist/api/seat-agents.js.map +1 -1
- package/dist/api/seat-container-login.d.ts +6 -2
- package/dist/api/seat-container-login.d.ts.map +1 -1
- package/dist/api/seat-container-login.js +17 -9
- package/dist/api/seat-container-login.js.map +1 -1
- package/dist/api/seat-governance.d.ts +3 -2
- package/dist/api/seat-governance.d.ts.map +1 -1
- package/dist/api/seat-governance.js +31 -9
- package/dist/api/seat-governance.js.map +1 -1
- package/dist/api/seat-standing.d.ts +8 -0
- package/dist/api/seat-standing.d.ts.map +1 -1
- package/dist/api/seat-standing.js +26 -1
- package/dist/api/seat-standing.js.map +1 -1
- package/dist/api/server.d.ts +7 -0
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +172 -59
- package/dist/api/server.js.map +1 -1
- package/dist/api/stall-watchdog.d.ts +6 -0
- package/dist/api/stall-watchdog.d.ts.map +1 -1
- package/dist/api/stall-watchdog.js +28 -0
- package/dist/api/stall-watchdog.js.map +1 -1
- package/dist/api/start-on-login.d.ts +4 -0
- package/dist/api/start-on-login.d.ts.map +1 -0
- package/dist/api/start-on-login.js +35 -0
- package/dist/api/start-on-login.js.map +1 -0
- package/dist/api/steering-landing.d.ts +33 -8
- package/dist/api/steering-landing.d.ts.map +1 -1
- package/dist/api/steering-landing.js +235 -51
- package/dist/api/steering-landing.js.map +1 -1
- package/dist/api/system-snapshot.d.ts +5 -0
- package/dist/api/system-snapshot.d.ts.map +1 -1
- package/dist/api/system-snapshot.js +22 -10
- package/dist/api/system-snapshot.js.map +1 -1
- package/dist/api/testing.d.ts +2 -2
- package/dist/api/ui-text.js +2 -2
- package/dist/api/ui-text.js.map +1 -1
- package/dist/api/worktree-sweep.d.ts +7 -3
- package/dist/api/worktree-sweep.d.ts.map +1 -1
- package/dist/api/worktree-sweep.js +10 -6
- package/dist/api/worktree-sweep.js.map +1 -1
- package/dist/apps/actions/api-action.js +5 -2
- package/dist/apps/actions/api-action.js.map +1 -1
- package/dist/apps/actions/write-path.d.ts +9 -0
- package/dist/apps/actions/write-path.d.ts.map +1 -1
- package/dist/apps/actions/write-path.js +17 -9
- package/dist/apps/actions/write-path.js.map +1 -1
- package/dist/apps/exec/executor.d.ts +8 -15
- package/dist/apps/exec/executor.d.ts.map +1 -1
- package/dist/apps/exec/executor.js +10 -3
- package/dist/apps/exec/executor.js.map +1 -1
- package/dist/apps/exec/recall.d.ts.map +1 -1
- package/dist/apps/exec/recall.js +4 -4
- package/dist/apps/exec/recall.js.map +1 -1
- package/dist/apps/exec/redescribe.d.ts +37 -0
- package/dist/apps/exec/redescribe.d.ts.map +1 -0
- package/dist/apps/exec/redescribe.js +86 -0
- package/dist/apps/exec/redescribe.js.map +1 -0
- package/dist/apps/exec/source-stage.d.ts +3 -1
- package/dist/apps/exec/source-stage.d.ts.map +1 -1
- package/dist/apps/exec/source-stage.js +13 -3
- package/dist/apps/exec/source-stage.js.map +1 -1
- package/dist/apps/exec/sources.d.ts +6 -0
- package/dist/apps/exec/sources.d.ts.map +1 -1
- package/dist/apps/exec/sources.js +8 -0
- package/dist/apps/exec/sources.js.map +1 -1
- package/dist/apps/git.js +2 -2
- package/dist/apps/git.js.map +1 -1
- package/dist/apps/publish/manifest.d.ts +8 -1
- package/dist/apps/publish/manifest.d.ts.map +1 -1
- package/dist/apps/publish/manifest.js +14 -3
- package/dist/apps/publish/manifest.js.map +1 -1
- package/dist/apps/publish/run.d.ts +15 -2
- package/dist/apps/publish/run.d.ts.map +1 -1
- package/dist/apps/publish/run.js +100 -17
- package/dist/apps/publish/run.js.map +1 -1
- package/dist/apps/routes.d.ts +3 -0
- package/dist/apps/routes.d.ts.map +1 -1
- package/dist/apps/routes.js +58 -2
- package/dist/apps/routes.js.map +1 -1
- package/dist/apps/store.d.ts +24 -3
- package/dist/apps/store.d.ts.map +1 -1
- package/dist/apps/store.js +26 -9
- package/dist/apps/store.js.map +1 -1
- package/dist/apps/turns.d.ts +25 -2
- package/dist/apps/turns.d.ts.map +1 -1
- package/dist/apps/turns.js +276 -11
- package/dist/apps/turns.js.map +1 -1
- package/dist/apps-server/Dockerfile +2 -2
- package/dist/apps-server/runners/sqlite-runner.mjs +67 -12
- package/dist/apps-server/server/lib/bundle/server.mjs +353 -159
- package/dist/cli/governance.d.ts +5 -2
- package/dist/cli/governance.d.ts.map +1 -1
- package/dist/cli/governance.js +8 -5
- package/dist/cli/governance.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +6 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/service.d.ts +10 -6
- package/dist/cli/service.d.ts.map +1 -1
- package/dist/cli/service.js +39 -23
- package/dist/cli/service.js.map +1 -1
- package/dist/core/adapter.d.ts +61 -29
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +214 -83
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/ado-deliver-helper.d.ts +2 -1
- package/dist/core/ado-deliver-helper.d.ts.map +1 -1
- package/dist/core/ado-deliver-helper.js +26 -1
- package/dist/core/ado-deliver-helper.js.map +1 -1
- package/dist/core/assurance.d.ts +45 -42
- package/dist/core/assurance.d.ts.map +1 -1
- package/dist/core/assurance.js +74 -67
- package/dist/core/assurance.js.map +1 -1
- package/dist/core/deliver-text.d.ts +14 -0
- package/dist/core/deliver-text.d.ts.map +1 -1
- package/dist/core/deliver-text.js +41 -2
- package/dist/core/deliver-text.js.map +1 -1
- package/dist/core/deliver.d.ts +66 -1
- package/dist/core/deliver.d.ts.map +1 -1
- package/dist/core/deliver.js +183 -10
- package/dist/core/deliver.js.map +1 -1
- package/dist/core/engine-roster.d.ts +2 -0
- package/dist/core/engine-roster.d.ts.map +1 -1
- package/dist/core/engine-roster.js +13 -0
- package/dist/core/engine-roster.js.map +1 -1
- package/dist/core/estate-mcp-client.d.ts +13 -14
- package/dist/core/estate-mcp-client.d.ts.map +1 -1
- package/dist/core/estate-mcp-client.js +49 -68
- package/dist/core/estate-mcp-client.js.map +1 -1
- package/dist/core/exec.d.ts +24 -0
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +45 -2
- package/dist/core/exec.js.map +1 -1
- package/dist/core/linked-issues.d.ts +13 -2
- package/dist/core/linked-issues.d.ts.map +1 -1
- package/dist/core/linked-issues.js +135 -4
- package/dist/core/linked-issues.js.map +1 -1
- package/dist/core/pr-checks-helper.d.ts +8 -4
- package/dist/core/pr-checks-helper.d.ts.map +1 -1
- package/dist/core/pr-checks-helper.js +39 -17
- package/dist/core/pr-checks-helper.js.map +1 -1
- package/dist/core/redeliver.js +2 -2
- package/dist/core/redeliver.js.map +1 -1
- package/dist/core/repo-clone.d.ts +64 -0
- package/dist/core/repo-clone.d.ts.map +1 -0
- package/dist/core/repo-clone.js +306 -0
- package/dist/core/repo-clone.js.map +1 -0
- package/dist/core/repoPaths.d.ts +2 -4
- package/dist/core/repoPaths.d.ts.map +1 -1
- package/dist/core/repoPaths.js +4 -6
- package/dist/core/repoPaths.js.map +1 -1
- package/dist/core/run-identity.d.ts.map +1 -1
- package/dist/core/run-identity.js +3 -0
- package/dist/core/run-identity.js.map +1 -1
- package/dist/core/run-read-lane.d.ts +30 -0
- package/dist/core/run-read-lane.d.ts.map +1 -0
- package/dist/core/run-read-lane.js +103 -0
- package/dist/core/run-read-lane.js.map +1 -0
- package/dist/core/types.d.ts +10 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -1
- package/dist/core/walkthrough-root.d.ts.map +1 -1
- package/dist/core/walkthrough-root.js +3 -5
- package/dist/core/walkthrough-root.js.map +1 -1
- package/dist/core/wicked-home.d.ts +9 -0
- package/dist/core/wicked-home.d.ts.map +1 -0
- package/dist/core/wicked-home.js +25 -0
- package/dist/core/wicked-home.js.map +1 -0
- package/dist/decisions/consider.d.ts +2 -1
- package/dist/decisions/consider.d.ts.map +1 -1
- package/dist/decisions/consider.js +2 -2
- package/dist/decisions/consider.js.map +1 -1
- package/dist/decisions/land.d.ts +2 -0
- package/dist/decisions/land.d.ts.map +1 -1
- package/dist/decisions/land.js +16 -3
- package/dist/decisions/land.js.map +1 -1
- package/dist/decisions/rules-brief.d.ts +4 -1
- package/dist/decisions/rules-brief.d.ts.map +1 -1
- package/dist/decisions/rules-brief.js +3 -2
- package/dist/decisions/rules-brief.js.map +1 -1
- package/dist/editors/conformance-runtime.d.ts +0 -2
- package/dist/editors/conformance-runtime.d.ts.map +1 -1
- package/dist/editors/conformance-runtime.js +0 -4
- package/dist/editors/conformance-runtime.js.map +1 -1
- package/dist/editors/csp.d.ts +6 -0
- package/dist/editors/csp.d.ts.map +1 -1
- package/dist/editors/csp.js +10 -0
- package/dist/editors/csp.js.map +1 -1
- package/dist/editors/pack-install.d.ts +11 -15
- package/dist/editors/pack-install.d.ts.map +1 -1
- package/dist/editors/pack-install.js +52 -65
- package/dist/editors/pack-install.js.map +1 -1
- package/dist/editors/registry.d.ts +31 -13
- package/dist/editors/registry.d.ts.map +1 -1
- package/dist/editors/registry.js +51 -18
- package/dist/editors/registry.js.map +1 -1
- package/dist/editors/routes.d.ts +4 -2
- package/dist/editors/routes.d.ts.map +1 -1
- package/dist/editors/routes.js +23 -6
- package/dist/editors/routes.js.map +1 -1
- package/dist/editors/visuals.d.ts +4 -3
- package/dist/editors/visuals.d.ts.map +1 -1
- package/dist/editors/visuals.js +17 -7
- package/dist/editors/visuals.js.map +1 -1
- package/dist/evals/runner.js +1 -1
- package/dist/evals/runner.js.map +1 -1
- package/dist/evals/shape-corrections.js +1 -1
- package/dist/evals/shape-corrections.js.map +1 -1
- package/dist/evals/shape.d.ts +7 -1
- package/dist/evals/shape.d.ts.map +1 -1
- package/dist/evals/shape.js +26 -6
- package/dist/evals/shape.js.map +1 -1
- package/dist/evals/workflow.d.ts +16 -3
- package/dist/evals/workflow.d.ts.map +1 -1
- package/dist/evals/workflow.js +32 -6
- package/dist/evals/workflow.js.map +1 -1
- package/dist/governance/rule-revision.d.ts +7 -0
- package/dist/governance/rule-revision.d.ts.map +1 -0
- package/dist/governance/rule-revision.js +23 -0
- package/dist/governance/rule-revision.js.map +1 -0
- package/dist/insights/review-service.d.ts +26 -3
- package/dist/insights/review-service.d.ts.map +1 -1
- package/dist/insights/review-service.js +101 -11
- package/dist/insights/review-service.js.map +1 -1
- package/dist/insights/routes.d.ts +2 -1
- package/dist/insights/routes.d.ts.map +1 -1
- package/dist/insights/routes.js +19 -4
- package/dist/insights/routes.js.map +1 -1
- package/dist/insights/run-facts.d.ts +5 -0
- package/dist/insights/run-facts.d.ts.map +1 -1
- package/dist/insights/run-facts.js +15 -0
- package/dist/insights/run-facts.js.map +1 -1
- package/dist/insights/workflow.d.ts +2 -1
- package/dist/insights/workflow.d.ts.map +1 -1
- package/dist/insights/workflow.js +4 -4
- package/dist/insights/workflow.js.map +1 -1
- package/dist/inspect/service.d.ts +3 -2
- package/dist/inspect/service.d.ts.map +1 -1
- package/dist/inspect/service.js +4 -4
- package/dist/inspect/service.js.map +1 -1
- package/dist/interactive/bridge-pool.d.ts +2 -0
- package/dist/interactive/bridge-pool.d.ts.map +1 -1
- package/dist/interactive/bridge-pool.js +18 -8
- package/dist/interactive/bridge-pool.js.map +1 -1
- package/dist/interactive/chat-events.d.ts +3 -0
- package/dist/interactive/chat-events.d.ts.map +1 -1
- package/dist/interactive/chat-events.js +20 -5
- package/dist/interactive/chat-events.js.map +1 -1
- package/dist/interactive/doc-delete-routes.d.ts +1 -0
- package/dist/interactive/doc-delete-routes.d.ts.map +1 -1
- package/dist/interactive/doc-delete-routes.js +126 -123
- package/dist/interactive/doc-delete-routes.js.map +1 -1
- package/dist/interactive/draft-events.d.ts +11 -7
- package/dist/interactive/draft-events.d.ts.map +1 -1
- package/dist/interactive/draft-events.js +29 -22
- package/dist/interactive/draft-events.js.map +1 -1
- package/dist/interactive/draft-skill.d.ts +56 -3
- package/dist/interactive/draft-skill.d.ts.map +1 -1
- package/dist/interactive/draft-skill.js +129 -20
- package/dist/interactive/draft-skill.js.map +1 -1
- package/dist/interactive/landing-guard.d.ts +30 -5
- package/dist/interactive/landing-guard.d.ts.map +1 -1
- package/dist/interactive/landing-guard.js +121 -5
- package/dist/interactive/landing-guard.js.map +1 -1
- package/dist/interactive/proposal-create.d.ts +9 -11
- package/dist/interactive/proposal-create.d.ts.map +1 -1
- package/dist/interactive/proposal-create.js +28 -21
- package/dist/interactive/proposal-create.js.map +1 -1
- package/dist/interactive/proposal-refine.d.ts +4 -4
- package/dist/interactive/proposal-refine.d.ts.map +1 -1
- package/dist/interactive/proposal-refine.js +40 -7
- package/dist/interactive/proposal-refine.js.map +1 -1
- package/dist/interactive/proxy-routes.d.ts +10 -5
- package/dist/interactive/proxy-routes.d.ts.map +1 -1
- package/dist/interactive/proxy-routes.js +108 -11
- package/dist/interactive/proxy-routes.js.map +1 -1
- package/dist/interactive/review-events.js +1 -1
- package/dist/interactive/review-events.js.map +1 -1
- package/dist/interactive/run-units.d.ts.map +1 -1
- package/dist/interactive/run-units.js +3 -2
- package/dist/interactive/run-units.js.map +1 -1
- package/dist/interactive/source-packet.d.ts +13 -1
- package/dist/interactive/source-packet.d.ts.map +1 -1
- package/dist/interactive/source-packet.js +108 -34
- package/dist/interactive/source-packet.js.map +1 -1
- package/dist/knowledge/adapters/toolbox/memory.d.ts +2 -0
- package/dist/knowledge/adapters/toolbox/memory.d.ts.map +1 -0
- package/dist/knowledge/adapters/toolbox/memory.js +43 -0
- package/dist/knowledge/adapters/toolbox/memory.js.map +1 -0
- package/dist/knowledge/adapters/toolbox/supervisor.d.ts +30 -4
- package/dist/knowledge/adapters/toolbox/supervisor.d.ts.map +1 -1
- package/dist/knowledge/adapters/toolbox/supervisor.js +112 -28
- package/dist/knowledge/adapters/toolbox/supervisor.js.map +1 -1
- package/dist/knowledge/estate-write.d.ts +5 -0
- package/dist/knowledge/estate-write.d.ts.map +1 -1
- package/dist/knowledge/estate-write.js +7 -0
- package/dist/knowledge/estate-write.js.map +1 -1
- package/dist/knowledge/gate/gate.d.ts.map +1 -1
- package/dist/knowledge/gate/gate.js +4 -1
- package/dist/knowledge/gate/gate.js.map +1 -1
- package/dist/knowledge/gate/record.d.ts +15 -2
- package/dist/knowledge/gate/record.d.ts.map +1 -1
- package/dist/knowledge/gate/record.js +108 -29
- package/dist/knowledge/gate/record.js.map +1 -1
- package/dist/knowledge/projector.d.ts +60 -5
- package/dist/knowledge/projector.d.ts.map +1 -1
- package/dist/knowledge/projector.js +264 -21
- package/dist/knowledge/projector.js.map +1 -1
- package/dist/knowledge/registry/entry.d.ts +7 -0
- package/dist/knowledge/registry/entry.d.ts.map +1 -1
- package/dist/knowledge/registry/entry.js +4 -0
- package/dist/knowledge/registry/entry.js.map +1 -1
- package/dist/knowledge/shapes/map.d.ts.map +1 -1
- package/dist/knowledge/shapes/map.js +12 -2
- package/dist/knowledge/shapes/map.js.map +1 -1
- package/dist/knowledge/shapes/routes.d.ts +1 -1
- package/dist/knowledge/shapes/routes.d.ts.map +1 -1
- package/dist/knowledge/shapes/routes.js +42 -16
- package/dist/knowledge/shapes/routes.js.map +1 -1
- package/dist/knowledge/shapes/shapes.d.ts +60 -13
- package/dist/knowledge/shapes/shapes.d.ts.map +1 -1
- package/dist/knowledge/shapes/shapes.js +199 -31
- package/dist/knowledge/shapes/shapes.js.map +1 -1
- package/dist/knowledge/shapes/verified.d.ts.map +1 -1
- package/dist/knowledge/shapes/verified.js +3 -2
- package/dist/knowledge/shapes/verified.js.map +1 -1
- package/dist/knowledge/trackers/addresses.d.ts +27 -3
- package/dist/knowledge/trackers/addresses.d.ts.map +1 -1
- package/dist/knowledge/trackers/addresses.js +33 -5
- package/dist/knowledge/trackers/addresses.js.map +1 -1
- package/dist/knowledge/trackers/gate-pm.d.ts.map +1 -1
- package/dist/knowledge/trackers/gate-pm.js +4 -2
- package/dist/knowledge/trackers/gate-pm.js.map +1 -1
- package/dist/knowledge/trackers/projector.d.ts +3 -1
- package/dist/knowledge/trackers/projector.d.ts.map +1 -1
- package/dist/knowledge/trackers/projector.js +59 -8
- package/dist/knowledge/trackers/projector.js.map +1 -1
- package/dist/learn/scheduler.d.ts.map +1 -1
- package/dist/learn/scheduler.js +13 -3
- package/dist/learn/scheduler.js.map +1 -1
- package/dist/learnings/estate.d.ts.map +1 -1
- package/dist/learnings/estate.js +3 -14
- package/dist/learnings/estate.js.map +1 -1
- package/dist/learnings/extract.d.ts +9 -3
- package/dist/learnings/extract.d.ts.map +1 -1
- package/dist/learnings/extract.js +62 -4
- package/dist/learnings/extract.js.map +1 -1
- package/dist/learnings/replacement-lineage.d.ts +3 -2
- package/dist/learnings/replacement-lineage.d.ts.map +1 -1
- package/dist/learnings/replacement-lineage.js +7 -6
- package/dist/learnings/replacement-lineage.js.map +1 -1
- package/dist/learnings/service.d.ts +12 -2
- package/dist/learnings/service.d.ts.map +1 -1
- package/dist/learnings/service.js +30 -5
- package/dist/learnings/service.js.map +1 -1
- package/dist/mcp/broker.d.ts.map +1 -1
- package/dist/mcp/broker.js +19 -5
- package/dist/mcp/broker.js.map +1 -1
- package/dist/mcp/env.d.ts +12 -4
- package/dist/mcp/env.d.ts.map +1 -1
- package/dist/mcp/env.js +24 -4
- package/dist/mcp/env.js.map +1 -1
- package/dist/mcp/estate-relay.d.ts +3 -0
- package/dist/mcp/estate-relay.d.ts.map +1 -1
- package/dist/mcp/estate-relay.js +7 -6
- package/dist/mcp/estate-relay.js.map +1 -1
- package/dist/mcp/invoke.d.ts.map +1 -1
- package/dist/mcp/invoke.js +6 -5
- package/dist/mcp/invoke.js.map +1 -1
- package/dist/mcp/probe.d.ts +14 -1
- package/dist/mcp/probe.d.ts.map +1 -1
- package/dist/mcp/probe.js +55 -10
- package/dist/mcp/probe.js.map +1 -1
- package/dist/mcp/redact.d.ts +1 -1
- package/dist/mcp/redact.d.ts.map +1 -1
- package/dist/mcp/redact.js +61 -4
- package/dist/mcp/redact.js.map +1 -1
- package/dist/mcp/registry-store.d.ts +37 -0
- package/dist/mcp/registry-store.d.ts.map +1 -1
- package/dist/mcp/registry-store.js +43 -0
- package/dist/mcp/registry-store.js.map +1 -1
- package/dist/mcp/registry.d.ts +38 -6
- package/dist/mcp/registry.d.ts.map +1 -1
- package/dist/mcp/registry.js +145 -14
- package/dist/mcp/registry.js.map +1 -1
- package/dist/mcp/rest.js +4 -4
- package/dist/mcp/rest.js.map +1 -1
- package/dist/mcp/run-fence.d.ts +2 -0
- package/dist/mcp/run-fence.d.ts.map +1 -1
- package/dist/mcp/run-fence.js +9 -0
- package/dist/mcp/run-fence.js.map +1 -1
- package/dist/mcp/secrets.d.ts +1 -1
- package/dist/mcp/secrets.d.ts.map +1 -1
- package/dist/mcp/secrets.js +10 -11
- package/dist/mcp/secrets.js.map +1 -1
- package/dist/mcp/upstream-error.d.ts +6 -2
- package/dist/mcp/upstream-error.d.ts.map +1 -1
- package/dist/mcp/upstream-error.js +5 -1
- package/dist/mcp/upstream-error.js.map +1 -1
- package/dist/projects/graph.d.ts +15 -5
- package/dist/projects/graph.d.ts.map +1 -1
- package/dist/projects/graph.js +354 -26
- package/dist/projects/graph.js.map +1 -1
- package/dist/projects/repo-watch.d.ts +2 -2
- package/dist/projects/repo-watch.d.ts.map +1 -1
- package/dist/projects/repo-watch.js +26 -9
- package/dist/projects/repo-watch.js.map +1 -1
- package/dist/projects/routes.d.ts +9 -1
- package/dist/projects/routes.d.ts.map +1 -1
- package/dist/projects/routes.js +63 -6
- package/dist/projects/routes.js.map +1 -1
- package/dist/projects/state-home-preflight.d.ts +5 -0
- package/dist/projects/state-home-preflight.d.ts.map +1 -1
- package/dist/projects/state-home-preflight.js +48 -8
- package/dist/projects/state-home-preflight.js.map +1 -1
- package/dist/projects/state-home-registry.d.ts.map +1 -1
- package/dist/projects/state-home-registry.js +9 -0
- package/dist/projects/state-home-registry.js.map +1 -1
- package/dist/projects/state-home.d.ts +11 -0
- package/dist/projects/state-home.d.ts.map +1 -1
- package/dist/projects/state-home.js +14 -0
- package/dist/projects/state-home.js.map +1 -1
- package/dist/qe/author-workflow.d.ts +4 -0
- package/dist/qe/author-workflow.d.ts.map +1 -1
- package/dist/qe/author-workflow.js +4 -0
- package/dist/qe/author-workflow.js.map +1 -1
- package/dist/qe/test-sets.d.ts +5 -6
- package/dist/qe/test-sets.d.ts.map +1 -1
- package/dist/qe/test-sets.js +4 -3
- package/dist/qe/test-sets.js.map +1 -1
- package/dist/schedules/routes.d.ts +5 -0
- package/dist/schedules/routes.d.ts.map +1 -1
- package/dist/schedules/routes.js +32 -5
- package/dist/schedules/routes.js.map +1 -1
- package/dist/schedules/scheduler.d.ts +8 -1
- package/dist/schedules/scheduler.d.ts.map +1 -1
- package/dist/schedules/scheduler.js +10 -1
- package/dist/schedules/scheduler.js.map +1 -1
- package/dist/schedules/store.d.ts +7 -0
- package/dist/schedules/store.d.ts.map +1 -1
- package/dist/schedules/store.js +19 -4
- package/dist/schedules/store.js.map +1 -1
- package/dist/skills/plugin-source.js +4 -4
- package/dist/skills/plugin-source.js.map +1 -1
- package/dist/sources/ask.d.ts.map +1 -1
- package/dist/sources/ask.js +12 -12
- package/dist/sources/ask.js.map +1 -1
- package/dist/sources/dialer.d.ts +6 -1
- package/dist/sources/dialer.d.ts.map +1 -1
- package/dist/sources/dialer.js +53 -31
- package/dist/sources/dialer.js.map +1 -1
- package/dist/sources/drivers/mysql.d.ts +2 -0
- package/dist/sources/drivers/mysql.d.ts.map +1 -1
- package/dist/sources/drivers/mysql.js +18 -2
- package/dist/sources/drivers/mysql.js.map +1 -1
- package/dist/sources/drivers/postgres.d.ts +2 -0
- package/dist/sources/drivers/postgres.d.ts.map +1 -1
- package/dist/sources/drivers/postgres.js +10 -3
- package/dist/sources/drivers/postgres.js.map +1 -1
- package/dist/sources/drivers/sqlite.d.ts +33 -3
- package/dist/sources/drivers/sqlite.d.ts.map +1 -1
- package/dist/sources/drivers/sqlite.js +18 -6
- package/dist/sources/drivers/sqlite.js.map +1 -1
- package/dist/sources/drivers/types.d.ts +3 -1
- package/dist/sources/drivers/types.d.ts.map +1 -1
- package/dist/sources/drivers/types.js +3 -1
- package/dist/sources/drivers/types.js.map +1 -1
- package/dist/sources/routes.d.ts.map +1 -1
- package/dist/sources/routes.js +1 -0
- package/dist/sources/routes.js.map +1 -1
- package/dist/sources/uploads.d.ts +22 -15
- package/dist/sources/uploads.d.ts.map +1 -1
- package/dist/sources/uploads.js +124 -436
- package/dist/sources/uploads.js.map +1 -1
- package/dist/standing-orders/history.d.ts +5 -3
- package/dist/standing-orders/history.d.ts.map +1 -1
- package/dist/standing-orders/history.js +6 -2
- package/dist/standing-orders/history.js.map +1 -1
- package/dist/standing-orders/parse.d.ts +8 -0
- package/dist/standing-orders/parse.d.ts.map +1 -1
- package/dist/standing-orders/parse.js +52 -5
- package/dist/standing-orders/parse.js.map +1 -1
- package/dist/studio/apps-standalone/fixture.js +3 -3
- package/dist/studio/apps-standalone/runtime.js +1 -1
- package/dist/studio/assets/{KnowledgeGraph-DWw0I8RJ.js → KnowledgeGraph-yP4WsnST.js} +1 -1
- package/dist/studio/assets/index-DNaLjJ7M.css +32 -0
- package/dist/studio/assets/index-DW53FKuT.js +1114 -0
- package/dist/studio/editors/wicked-apps/editor.json +1 -1
- package/dist/studio/editors/wicked-apps/index.html +2 -2
- package/dist/studio/editors/wicked-deck/editor.json +1 -1
- package/dist/studio/editors/wicked-deck/index.html +2 -2
- package/dist/studio/editors/wicked-doc/editor.json +1 -1
- package/dist/studio/editors/wicked-doc/index.html +1 -1
- package/dist/studio/editors/wicked-insights/editor.json +1 -1
- package/dist/studio/editors/wicked-insights/index.html +1 -1
- package/dist/studio/editors/wicked-page/editor.json +1 -1
- package/dist/studio/editors/wicked-page/index.html +1 -1
- package/dist/studio/editors/wicked-video/editor.json +1 -1
- package/dist/studio/editors/wicked-video/index.html +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +1589 -281
- package/dist/team/routes.d.ts +11 -1
- package/dist/team/routes.d.ts.map +1 -1
- package/dist/team/routes.js +8 -4
- package/dist/team/routes.js.map +1 -1
- package/dist/voice/tts.d.ts +12 -0
- package/dist/voice/tts.d.ts.map +1 -1
- package/dist/voice/tts.js +118 -28
- package/dist/voice/tts.js.map +1 -1
- package/dist/workflow-catalog/build-v2.d.ts +34 -0
- package/dist/workflow-catalog/build-v2.d.ts.map +1 -1
- package/dist/workflow-catalog/build-v2.js +131 -10
- package/dist/workflow-catalog/build-v2.js.map +1 -1
- package/dist/workflow-catalog/catalog-data-v2.d.ts +6 -2
- package/dist/workflow-catalog/catalog-data-v2.d.ts.map +1 -1
- package/dist/workflow-catalog/catalog-data-v2.js.map +1 -1
- package/dist/workflow-catalog/catalog-data.d.ts.map +1 -1
- package/dist/workflow-catalog/catalog-data.js +0 -2
- package/dist/workflow-catalog/catalog-data.js.map +1 -1
- package/dist/workflow-catalog/detect.d.ts +18 -3
- package/dist/workflow-catalog/detect.d.ts.map +1 -1
- package/dist/workflow-catalog/detect.js +43 -8
- package/dist/workflow-catalog/detect.js.map +1 -1
- package/dist/workflow-catalog/shape.d.ts +1 -1
- package/dist/working-doc/event-lines.d.ts +12 -2
- package/dist/working-doc/event-lines.d.ts.map +1 -1
- package/dist/working-doc/event-lines.js +62 -10
- package/dist/working-doc/event-lines.js.map +1 -1
- package/dist/working-doc/sections.d.ts +3 -0
- package/dist/working-doc/sections.d.ts.map +1 -1
- package/dist/working-doc/sections.js +5 -0
- package/dist/working-doc/sections.js.map +1 -1
- package/dist/working-doc/service.d.ts +23 -3
- package/dist/working-doc/service.d.ts.map +1 -1
- package/dist/working-doc/service.js +93 -54
- package/dist/working-doc/service.js.map +1 -1
- package/endpoint-manifest.json +148 -8
- package/evals/corpora/shape-v1.json +25 -1
- package/evals/corpora/shape-v1.seat-fixture.json +25 -1
- package/package.json +4 -4
- package/runners/sqlite-runner.mjs +67 -12
- package/runners/upload-parse.d.mts +13 -0
- package/runners/upload-parse.mjs +364 -0
- package/dist/studio/assets/index-C4Xj-zxa.css +0 -32
- package/dist/studio/assets/index-CrNY3d06.js +0 -1109
package/dist/core/adapter.js
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
|
+
import { RuleChangedError, ruleRevision } from '../governance/rule-revision.js';
|
|
1
2
|
import { builtinDefs as deriveBuiltinDefs, engineDefOf } from './builtin-catalog.js';
|
|
2
3
|
import { createRequire } from 'node:module';
|
|
3
4
|
import { attachEngineBus, detachEngineBus } from './bus.js';
|
|
4
5
|
import { mkdir, access, readFile, writeFile, chmod, rm, link, rename, realpath, stat, lstat } from 'node:fs/promises';
|
|
5
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
6
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
6
7
|
import { join, dirname, resolve, isAbsolute, relative, sep } from 'node:path';
|
|
7
8
|
import { isPlainRunId, WALKTHROUGH_AUTHOR_SUBDIR, walkthroughRootDir } from './walkthrough-root.js';
|
|
8
|
-
import {
|
|
9
|
+
import { mcpStateDir } from '../mcp/registry-store.js';
|
|
10
|
+
import { resolveMemoryDbPath } from './estate-mcp-client.js';
|
|
11
|
+
import { crewStateHome, isDefaultStateHome, wickedWorkRoot } from '../projects/state-home.js';
|
|
9
12
|
import { fileURLToPath } from 'node:url';
|
|
10
13
|
import { homedir } from 'node:os';
|
|
11
14
|
import { randomUUID } from 'node:crypto';
|
|
15
|
+
import { RunReadLane } from './run-read-lane.js';
|
|
12
16
|
import { AskError, AskUnsupportedError } from './types.js';
|
|
13
17
|
import { DEFAULT_SETTINGS } from './types.js';
|
|
14
18
|
import { BASE_SKILL_REF_SHAPE } from '../skills/base-skill.js';
|
|
15
|
-
import {
|
|
19
|
+
import { cloneRepository } from './repo-clone.js';
|
|
20
|
+
import { gitCommitIdents, usableGitIdent } from '../setup/known.js';
|
|
16
21
|
import { composeDeliverWorkflow, DELIVER_PHASE_ID, deliverPresetStep, deliverIdentityFor, deliverRepoFor, isGitHubLogin, pushIdentityOf, readDeliverOriginUrl } from './deliver.js';
|
|
17
22
|
import { engineCampaignDef, engineRosterJson } from './engine-roster.js';
|
|
18
23
|
import { composeDeliverableFloor } from './deliverable-floor.js';
|
|
19
24
|
import { deliverCredentialsProbe } from './deliver-credentials.js';
|
|
20
25
|
import { isSyntheticWorkflowId, resolveRunIdentity, verifiedEvidenceCatalog, wireIdentity, withPresetSystemFlag, withSystemFlag, } from './run-identity.js';
|
|
21
|
-
const TERMINAL_RUN_STATUSES = new Set(['completed', 'cancelled', 'failed']);
|
|
26
|
+
export const TERMINAL_RUN_STATUSES = new Set(['completed', 'cancelled', 'failed']);
|
|
27
|
+
const ACTIVE_RUN_STATUSES = new Set(['planning', 'distributing', 'executing']);
|
|
22
28
|
import { resolveProjectGraphBinding } from '../projects/graph.js';
|
|
23
29
|
import { applyGovernanceStoreEnv, isStoreSpec } from './governance-store.js';
|
|
24
30
|
import { isCouncilSize, isCouncilStaggerMs } from './council-settings.js';
|
|
@@ -27,11 +33,6 @@ import { QE_OFF_REASON, launchRequiresQe, qeAcceptanceMode, qeSettingSkipReason
|
|
|
27
33
|
import { applyVaultBinEnv, BOOT_VAULT_BIN, resolveShippedVaultBin } from './vault-bin.js';
|
|
28
34
|
import { withFolderFindings } from './repoPaths.js';
|
|
29
35
|
import { NEW_WORK_SEATS_FIX, NewWorkSeatsRefusal, isSeatKeyList } from './job-seats.js';
|
|
30
|
-
/** Resolved path under the user's home directory. */
|
|
31
|
-
export function wickedDir(...parts) {
|
|
32
|
-
const home = process.env.HOME ?? process.env.USERPROFILE ?? '/tmp';
|
|
33
|
-
return join(home, '.wicked', ...parts);
|
|
34
|
-
}
|
|
35
36
|
/**
|
|
36
37
|
* Parse a JSON string a napi binding returned. The bindings type their return loosely (`unknown`
|
|
37
38
|
* until a `ts_return_type` regen), so guard BOTH a non-string return and invalid JSON with an error
|
|
@@ -113,6 +114,8 @@ export async function readNewWorkSeats() {
|
|
|
113
114
|
// Absent only when no entry is there at all: a settings link whose target is gone is a file that can't be read.
|
|
114
115
|
if (err.code === 'ENOENT' && !(await lstat(path).then(() => true, () => false)))
|
|
115
116
|
return null;
|
|
117
|
+
if (err instanceof NewWorkSeatsRefusal)
|
|
118
|
+
throw err;
|
|
116
119
|
const why = err.code ?? (err instanceof Error ? err.message : String(err));
|
|
117
120
|
throw new NewWorkSeatsRefusal('settings_unavailable', `crew can't read its settings file (${why}), so it can't tell which seats new work may use (newWorkSeats); it won't start new work on every seat instead. Fix ${path}, or ${NEW_WORK_SEATS_FIX}`);
|
|
118
121
|
}
|
|
@@ -140,25 +143,31 @@ export async function readNewWorkSeats() {
|
|
|
140
143
|
* crew#756 migration, once: a non-default state home with no settings file of its own starts from a
|
|
141
144
|
* COPY of the shared file, so a daemon upgraded onto this rule keeps its configuration while every
|
|
142
145
|
* later write stays in its own state home. Exclusive copy (never overwrites); a missing shared file
|
|
143
|
-
*
|
|
146
|
+
* seeds an empty object. An unreadable or invalid shared file leaves the home unseeded for a retry.
|
|
147
|
+
* A daemon with an explicit `WICKED_CREW_SYSTEM_SETTINGS` or on the default home skips it.
|
|
144
148
|
*/
|
|
145
149
|
async function seedStateHomeSettings(path) {
|
|
146
150
|
const override = process.env['WICKED_CREW_SYSTEM_SETTINGS'];
|
|
147
151
|
if ((override !== undefined && override !== '') || isDefaultStateHome() || existsSync(path))
|
|
148
152
|
return;
|
|
149
|
-
//
|
|
150
|
-
|
|
151
|
-
// never retried (Copilot on #760). Published with `link`, which is atomic and never replaces an
|
|
152
|
-
// existing file: a racing first read either publishes or finds a complete file.
|
|
153
|
+
// Published with `link`, so a racing first read either publishes or finds a complete file.
|
|
154
|
+
const shared = sharedSettingsFilePath();
|
|
153
155
|
let body = '{}';
|
|
154
156
|
try {
|
|
155
|
-
|
|
156
|
-
const parsed = JSON.parse(raw);
|
|
157
|
-
if (parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed))
|
|
158
|
-
body = raw;
|
|
157
|
+
body = await readFile(shared, 'utf8');
|
|
159
158
|
}
|
|
160
|
-
catch {
|
|
161
|
-
|
|
159
|
+
catch (err) {
|
|
160
|
+
if (err.code !== 'ENOENT') {
|
|
161
|
+
throw new NewWorkSeatsRefusal('settings_unavailable', `Cannot read ${shared}: ${err instanceof Error ? err.message : String(err)}. Fix this file to start new work.`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
try {
|
|
165
|
+
const parsed = JSON.parse(body);
|
|
166
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
167
|
+
throw new Error('expected a JSON object');
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
throw new NewWorkSeatsRefusal('settings_unavailable', `Cannot use ${shared}: ${err instanceof Error ? err.message : String(err)}. Fix this file to start new work.`);
|
|
162
171
|
}
|
|
163
172
|
await publishSettingsFile(path, body, false);
|
|
164
173
|
}
|
|
@@ -360,6 +369,7 @@ const VIEW_NEUTRAL_CALLS = new Set([
|
|
|
360
369
|
'campaignDetail',
|
|
361
370
|
'sessions',
|
|
362
371
|
'sessionsDetail',
|
|
372
|
+
'sessionDetail',
|
|
363
373
|
'workOutput',
|
|
364
374
|
'unitTranscript',
|
|
365
375
|
'runEvents',
|
|
@@ -566,6 +576,22 @@ function addonAtLeast(maj, min, pat) {
|
|
|
566
576
|
// ── Built-in workflows (X-MIG M11) ───────────────────────────────────────────
|
|
567
577
|
// No mirrors: the built-ins are the engine's built-in presets, read once at boot and laid over the
|
|
568
578
|
// phase catalog (`core/builtin-catalog.ts`, `loadBuiltinCatalog`). One source; nothing to drift.
|
|
579
|
+
/** Refusing new work while this daemon drains; restarting clears the in-memory state. */
|
|
580
|
+
export class MaintenanceDrainError extends Error {
|
|
581
|
+
code = 'maintenance_drain';
|
|
582
|
+
hint = 'Wait for maintenance to finish, or POST /api/v1/maintenance with {"drain":false} to admit work again.';
|
|
583
|
+
constructor() {
|
|
584
|
+
super('This daemon is draining for maintenance and is refusing new work.');
|
|
585
|
+
this.name = 'MaintenanceDrainError';
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
/** The linked engine predates repository removal (wicked-core `unregisterRepo`). */
|
|
589
|
+
export class RepoUnregisterUnsupportedError extends Error {
|
|
590
|
+
constructor() {
|
|
591
|
+
super('Removing a repository requires an engine with unregisterRepo; upgrade wicked-core-ts.');
|
|
592
|
+
this.name = 'RepoUnregisterUnsupportedError';
|
|
593
|
+
}
|
|
594
|
+
}
|
|
569
595
|
/**
|
|
570
596
|
* Chat is not available in this deployment at all — a capability gap, never a bad request.
|
|
571
597
|
*
|
|
@@ -770,10 +796,13 @@ export class CoreAdapter {
|
|
|
770
796
|
listeners = new Set();
|
|
771
797
|
/** F35: the views version, moved by every engine frame (bar the live streams) and every engine call that may write. */
|
|
772
798
|
viewsEpoch = 0;
|
|
799
|
+
/** crew#1779: one-run reads a frame's listeners start wait in this lane, behind every request's read. */
|
|
800
|
+
runReads = new RunReadLane((runId) => this.runViewRead(runId), (view) => (view === undefined ? undefined : structuredClone(view)));
|
|
773
801
|
launchListeners = new Set();
|
|
774
802
|
/** crew#1145: what each engine launch awaits first (`setLaunchGate`); `null` = nothing. */
|
|
775
803
|
launchGate = null;
|
|
776
804
|
closed = false;
|
|
805
|
+
drainSince = null;
|
|
777
806
|
/**
|
|
778
807
|
* The estate db the Core actor was spawned over (`CoreAdapterOptions.dbPath` — the `--db`
|
|
779
808
|
* flag / `~/.wicked-crew/core.db` default). Kept because some engine bindings take the db
|
|
@@ -991,14 +1020,17 @@ export class CoreAdapter {
|
|
|
991
1020
|
// any listener runs, so a read a listener starts sees the change).
|
|
992
1021
|
if (!VIEW_NEUTRAL_EVENTS.has(event.type))
|
|
993
1022
|
this.viewsEpoch++;
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1023
|
+
// crew#1779: a one-run read any listener starts from here takes the frame lane (`runView`).
|
|
1024
|
+
this.runReads.inFrame(() => {
|
|
1025
|
+
for (const listener of this.listeners) {
|
|
1026
|
+
try {
|
|
1027
|
+
listener(event);
|
|
1028
|
+
}
|
|
1029
|
+
catch {
|
|
1030
|
+
/* isolate a faulty listener */
|
|
1031
|
+
}
|
|
1000
1032
|
}
|
|
1001
|
-
}
|
|
1033
|
+
});
|
|
1002
1034
|
}
|
|
1003
1035
|
/**
|
|
1004
1036
|
* The engine's EVENT-node counter over an estate store (`Core.eventStoreCount`, crew#495's
|
|
@@ -1175,6 +1207,17 @@ export class CoreAdapter {
|
|
|
1175
1207
|
if (failure !== null)
|
|
1176
1208
|
throw failure.err instanceof Error ? failure.err : new Error(String(failure.err));
|
|
1177
1209
|
}
|
|
1210
|
+
/** Toggle admission without persisting a setting; repeated enable keeps the original time. */
|
|
1211
|
+
setDraining(drain) {
|
|
1212
|
+
this.drainSince = drain ? (this.drainSince ?? Date.now()) : null;
|
|
1213
|
+
}
|
|
1214
|
+
/** Parked and human-held runs are idle for maintenance, but still hold their repository. */
|
|
1215
|
+
async maintenanceState() {
|
|
1216
|
+
const active = (await this.sessionsDetail())
|
|
1217
|
+
.filter((v) => ACTIVE_RUN_STATUSES.has(v.session.status))
|
|
1218
|
+
.map((v) => ({ runId: v.session.id, status: v.session.status }));
|
|
1219
|
+
return { draining: this.drainSince !== null, since: this.drainSince, idle: active.length === 0, active };
|
|
1220
|
+
}
|
|
1178
1221
|
/**
|
|
1179
1222
|
* Hand a launch to the engine with its notices: `handed` BEFORE the call (the pin is open before
|
|
1180
1223
|
* any spawn can read the env), `rejected` when the call throws (nothing will spawn — the pin is
|
|
@@ -1186,10 +1229,12 @@ export class CoreAdapter {
|
|
|
1186
1229
|
* never swallowed (codex round 6). A listener failing on `rejected` cannot un-launch anything;
|
|
1187
1230
|
* the primary error keeps precedence and the secondary one is logged, not lost.
|
|
1188
1231
|
*/
|
|
1189
|
-
async handedToEngine(kind, id, call, workflow) {
|
|
1232
|
+
async handedToEngine(kind, id, call, workflow, resumesWork = true) {
|
|
1190
1233
|
// No gate, no extra turn: a launch without one is handed exactly as before.
|
|
1191
1234
|
if (this.launchGate !== null)
|
|
1192
1235
|
await this.launchGate();
|
|
1236
|
+
if (resumesWork && this.drainSince !== null)
|
|
1237
|
+
throw new MaintenanceDrainError();
|
|
1193
1238
|
try {
|
|
1194
1239
|
this.notifyLaunch({ kind, id, status: 'handed', ...(workflow !== undefined ? { workflow } : {}) });
|
|
1195
1240
|
}
|
|
@@ -1243,6 +1288,10 @@ export class CoreAdapter {
|
|
|
1243
1288
|
static roster() {
|
|
1244
1289
|
return JSON.parse(Core.registryRoster());
|
|
1245
1290
|
}
|
|
1291
|
+
/** The engine's judge coverage, absent on an addon that predates the static. */
|
|
1292
|
+
static judgeCoverage(clisJson, bound) {
|
|
1293
|
+
return typeof Core.judgeCoverage === 'function' ? Core.judgeCoverage(clisJson, bound) : null;
|
|
1294
|
+
}
|
|
1246
1295
|
/**
|
|
1247
1296
|
* core#920: the seats the engine benches on a run bound to one repository, keyed by seat with the
|
|
1248
1297
|
* engine's reason — or `null` when the linked addon predates the predicate. `seats` must be
|
|
@@ -1324,16 +1373,19 @@ export class CoreAdapter {
|
|
|
1324
1373
|
*/
|
|
1325
1374
|
async resolveDeliverIdentity(repoRef) {
|
|
1326
1375
|
let login = '';
|
|
1376
|
+
let authorNoreply = false;
|
|
1327
1377
|
let source = 'setting';
|
|
1328
1378
|
try {
|
|
1329
|
-
|
|
1379
|
+
const settings = await this.getSettings();
|
|
1380
|
+
({ login, source } = deliverIdentityFor(settings, repoRef));
|
|
1381
|
+
authorNoreply = settings.deliverAuthorNoreply === true;
|
|
1330
1382
|
}
|
|
1331
1383
|
catch {
|
|
1332
1384
|
// A settings file that cannot be read leaves the identity unconfigured rather than
|
|
1333
1385
|
// failing the launch — the deliver script still cross-checks gh against git's credential.
|
|
1334
1386
|
login = '';
|
|
1335
1387
|
}
|
|
1336
|
-
return { login, source };
|
|
1388
|
+
return { login, source, authorNoreply };
|
|
1337
1389
|
}
|
|
1338
1390
|
/**
|
|
1339
1391
|
* The origin the deliver push will actually go to (F2) so the deliver GATE CARD says what will
|
|
@@ -1369,6 +1421,24 @@ export class CoreAdapter {
|
|
|
1369
1421
|
return null;
|
|
1370
1422
|
}
|
|
1371
1423
|
}
|
|
1424
|
+
/** (crew#1667) Read once at compose from the registered root, as for the F2 origin read.
|
|
1425
|
+
* The future run worktree shares this config. No repo means no author sentence. */
|
|
1426
|
+
async resolveDeliverCommitIdents(repoRef) {
|
|
1427
|
+
if (repoRef === null || repoRef === undefined || repoRef === '')
|
|
1428
|
+
return undefined;
|
|
1429
|
+
try {
|
|
1430
|
+
const hit = deliverRepoFor(await this.listRepos(), repoRef);
|
|
1431
|
+
if (hit === undefined || hit.root_path === '')
|
|
1432
|
+
return undefined;
|
|
1433
|
+
const idents = await gitCommitIdents({ cwd: hit.root_path });
|
|
1434
|
+
return idents !== null && usableGitIdent(idents.author) && usableGitIdent(idents.committer)
|
|
1435
|
+
? { author: idents.author, committer: idents.committer }
|
|
1436
|
+
: null;
|
|
1437
|
+
}
|
|
1438
|
+
catch {
|
|
1439
|
+
return null;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1372
1442
|
/** The launcher's `deliver` step for a plan (`name` null) or a preset launch (DES-TEAMING-002
|
|
1373
1443
|
* §8.5): the engine appends it to the plan and puts it in the floor. */
|
|
1374
1444
|
deliverStep(name, phases, input,
|
|
@@ -1377,17 +1447,20 @@ export class CoreAdapter {
|
|
|
1377
1447
|
/** (crew#737) The identity this launch resolved — launch-local, never adapter state. */
|
|
1378
1448
|
identity,
|
|
1379
1449
|
/** (crew#720) The provider credential preflight this launch read. */
|
|
1380
|
-
credentials) {
|
|
1450
|
+
credentials, commitIdents) {
|
|
1381
1451
|
return deliverPresetStep(name, phases, input.sessionId, input.problem, {
|
|
1382
1452
|
repoRef: input.repoRef ?? null,
|
|
1453
|
+
...(input.trackerRefs !== undefined ? { trackerRefs: input.trackerRefs } : {}),
|
|
1383
1454
|
apiOrigin: this.deliverApiOrigin?.() ?? null,
|
|
1384
1455
|
revisesPr: input.revisesPr ?? null,
|
|
1385
1456
|
ghAccount: process.env['GH_ACCOUNT'] ?? null,
|
|
1386
1457
|
ghTokenPinned: typeof process.env['GH_TOKEN'] === 'string' && process.env['GH_TOKEN'] !== '',
|
|
1387
1458
|
originUrl,
|
|
1388
1459
|
deliverIdentity: identity.login,
|
|
1460
|
+
deliverAuthorNoreply: identity.authorNoreply,
|
|
1389
1461
|
deliverIdentitySource: identity.source,
|
|
1390
1462
|
credentials,
|
|
1463
|
+
...(commitIdents !== undefined ? { commitIdents } : {}),
|
|
1391
1464
|
});
|
|
1392
1465
|
}
|
|
1393
1466
|
/** Launch an interactive, resumable run → the run id. */
|
|
@@ -1398,6 +1471,7 @@ export class CoreAdapter {
|
|
|
1398
1471
|
// (F2) And the origin the push would go to — read once, for the gate card's target sentence.
|
|
1399
1472
|
// Only a delivering launch composes a deliver phase, so only a delivering launch pays for it.
|
|
1400
1473
|
const deliverOriginUrl = input.deliver === 'pr' ? await this.resolveDeliverOrigin(input.repoRef) : null;
|
|
1474
|
+
const deliverCommitIdents = input.deliver === 'pr' ? await this.resolveDeliverCommitIdents(input.repoRef) : undefined;
|
|
1401
1475
|
// (crew#720) And whether the provider credential is there — presence only, read once.
|
|
1402
1476
|
const deliverCredentials = input.deliver === 'pr' ? await deliverCredentialsProbe(deliverOriginUrl, process.env, undefined, pushIdentityOf(deliverIdentity.login)) : null;
|
|
1403
1477
|
const opts = {
|
|
@@ -1577,7 +1651,7 @@ export class CoreAdapter {
|
|
|
1577
1651
|
this.passLaunchDeliverables(opts, input.requireDeliverables ?? [], 'a plan');
|
|
1578
1652
|
// T8: a delivering plan hands the engine its deliver step, exactly as a preset launch does.
|
|
1579
1653
|
if (input.deliver === 'pr') {
|
|
1580
|
-
opts.deliverStepJson = JSON.stringify(this.deliverStep(null, [], input, deliverOriginUrl, deliverIdentity, deliverCredentials));
|
|
1654
|
+
opts.deliverStepJson = JSON.stringify(this.deliverStep(null, [], input, deliverOriginUrl, deliverIdentity, deliverCredentials, deliverCommitIdents));
|
|
1581
1655
|
}
|
|
1582
1656
|
}
|
|
1583
1657
|
// DES-TEAMING-002 T3: a workflow that names a PRESET is a plan the engine floor-fills and gates.
|
|
@@ -1598,7 +1672,7 @@ export class CoreAdapter {
|
|
|
1598
1672
|
// Only a DELIVERING preset gets the deliver step: a preset launched for its deliverables alone
|
|
1599
1673
|
// pushes nothing (codex r1 on #930).
|
|
1600
1674
|
if (input.deliver === 'pr') {
|
|
1601
|
-
const step = this.deliverStep(input.workflow, this.getWorkflow(input.workflow)?.phases ?? [], input, deliverOriginUrl, deliverIdentity, deliverCredentials);
|
|
1675
|
+
const step = this.deliverStep(input.workflow, this.getWorkflow(input.workflow)?.phases ?? [], input, deliverOriginUrl, deliverIdentity, deliverCredentials, deliverCommitIdents);
|
|
1602
1676
|
opts.deliverStepJson = JSON.stringify(step);
|
|
1603
1677
|
}
|
|
1604
1678
|
opts.workflow = input.workflow;
|
|
@@ -1659,6 +1733,8 @@ export class CoreAdapter {
|
|
|
1659
1733
|
// def and one registration below, never two armed ids.
|
|
1660
1734
|
composed = composeDeliverWorkflow(composed, input.sessionId, input.problem, {
|
|
1661
1735
|
repoRef: input.repoRef ?? null,
|
|
1736
|
+
// crew#1352: the tracker issues the launch resolved, so the embedded fallback links them back.
|
|
1737
|
+
...(input.trackerRefs !== undefined ? { trackerRefs: input.trackerRefs } : {}),
|
|
1662
1738
|
apiOrigin: this.deliverApiOrigin?.() ?? null,
|
|
1663
1739
|
// DES-L9: the revised PR (push target) and the push identity for the gate card —
|
|
1664
1740
|
// GH_ACCOUNT's value and whether GH_TOKEN is exported (presence only, never the value).
|
|
@@ -1668,10 +1744,12 @@ export class CoreAdapter {
|
|
|
1668
1744
|
// F2 — the origin the push will actually go to, so the gate card cannot promise a
|
|
1669
1745
|
// pull request on a remote that can never carry one.
|
|
1670
1746
|
originUrl: deliverOriginUrl,
|
|
1747
|
+
...(deliverCommitIdents !== undefined ? { commitIdents: deliverCommitIdents } : {}),
|
|
1671
1748
|
// crew#549 — the configured deliver identity, baked into the script so the refusal
|
|
1672
1749
|
// holds on a daemon started without GH_ACCOUNT exported; crew#737 — the repository's
|
|
1673
1750
|
// own pin wins, and the card says when it is not signed in here.
|
|
1674
1751
|
deliverIdentity: deliverIdentity.login,
|
|
1752
|
+
deliverAuthorNoreply: deliverIdentity.authorNoreply,
|
|
1675
1753
|
deliverIdentitySource: deliverIdentity.source,
|
|
1676
1754
|
// crew#720 — the provider credential preflight, said on the card before approval.
|
|
1677
1755
|
credentials: deliverCredentials,
|
|
@@ -1780,6 +1858,7 @@ export class CoreAdapter {
|
|
|
1780
1858
|
// (operator ruling 2026-10-11) WHO answered — recorded by the gate route just before this call
|
|
1781
1859
|
// (`recordGateActor`), consumed once. The engine records it when the answer is an operator
|
|
1782
1860
|
// judgment ("judged by operator", core-ts ≥ 0.9.7); an older addon ignores the trailing argument.
|
|
1861
|
+
const resumesWork = plan !== undefined || approve || (action !== undefined && action !== 'reject');
|
|
1783
1862
|
const actorLabel = this.gateActors.get(runId);
|
|
1784
1863
|
this.gateActors.delete(runId);
|
|
1785
1864
|
if (expect !== undefined) {
|
|
@@ -1798,7 +1877,7 @@ export class CoreAdapter {
|
|
|
1798
1877
|
return plan !== undefined
|
|
1799
1878
|
? core.confirmGate(runId, true, note ?? null, 'edit_plan', null, JSON.stringify(plan), actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null)
|
|
1800
1879
|
: core.confirmGate(runId, approve, amend ?? null, action ?? null, amendScope ?? null, null, actorLabel ?? null, expect.ord ?? null, expect.planRev ?? null);
|
|
1801
|
-
});
|
|
1880
|
+
}, undefined, resumesWork);
|
|
1802
1881
|
}
|
|
1803
1882
|
return this.handedToEngine('run', runId, () => {
|
|
1804
1883
|
if (actorLabel !== undefined && plan === undefined) {
|
|
@@ -1836,7 +1915,7 @@ export class CoreAdapter {
|
|
|
1836
1915
|
// The 0.7.27 binding takes the two trailing optionals; typed here until the pin moves.
|
|
1837
1916
|
const core = this.core;
|
|
1838
1917
|
return core.confirmGate(runId, approve, amend, action, amendScope);
|
|
1839
|
-
});
|
|
1918
|
+
}, undefined, resumesWork);
|
|
1840
1919
|
}
|
|
1841
1920
|
/** Cancel a run → the status token. */
|
|
1842
1921
|
cancelRun(runId) {
|
|
@@ -1995,6 +2074,8 @@ export class CoreAdapter {
|
|
|
1995
2074
|
}
|
|
1996
2075
|
/** (program DES-POWER-MODE) Answer a power run's checkpoint pause; resolves to its `PowerState`. */
|
|
1997
2076
|
async answerPowerPause(runId, decision, note, actor) {
|
|
2077
|
+
if (decision !== 'stop' && this.drainSince !== null)
|
|
2078
|
+
throw new MaintenanceDrainError();
|
|
1998
2079
|
if (typeof this.core.answerPowerPause !== 'function')
|
|
1999
2080
|
throw new Error('refused: this wicked-core build has no power mode');
|
|
2000
2081
|
return JSON.parse(await this.core.answerPowerPause(runId, decision, note, actor));
|
|
@@ -2118,16 +2199,24 @@ export class CoreAdapter {
|
|
|
2118
2199
|
}
|
|
2119
2200
|
/**
|
|
2120
2201
|
* One run's view (as `sessionsDetail` serves it), or `undefined` for an unknown id: the caller's own
|
|
2121
|
-
* copy
|
|
2122
|
-
*
|
|
2123
|
-
*
|
|
2124
|
-
*
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
return
|
|
2202
|
+
* copy. crew#1775: read through the engine's per-run read (`sessionDetail`, core#1346), off the actor,
|
|
2203
|
+
* so a request about one run never folds the store. The whole-store snapshot was invalidated by every
|
|
2204
|
+
* engine frame, so while runs were active each gate read paid for a fresh fold of every run (and its
|
|
2205
|
+
* parse on the event loop), and studio's per-page gate reads queued behind those folds. The read
|
|
2206
|
+
* starts now, so it is never older than a change this adapter made or a frame it delivered.
|
|
2207
|
+
* crew#1779: a read a frame listener starts takes the frame lane ({@link RunReadLane}): it waits
|
|
2208
|
+
* behind no request's read, and the listeners of one frame share one read of the run.
|
|
2209
|
+
*/
|
|
2210
|
+
async runView(runId) {
|
|
2211
|
+
return this.runReads.get(runId);
|
|
2212
|
+
}
|
|
2213
|
+
/** One run's read and its identity, as one operation: the frame lane shares and bounds all of it (crew#1779). */
|
|
2214
|
+
async runViewRead(runId) {
|
|
2215
|
+
const view = JSON.parse(await this.core.sessionDetail(runId));
|
|
2216
|
+
if (view === null)
|
|
2217
|
+
return undefined;
|
|
2218
|
+
await this.resolveIdentities([view]);
|
|
2219
|
+
return view;
|
|
2131
2220
|
}
|
|
2132
2221
|
/**
|
|
2133
2222
|
* The shared, deep-frozen views snapshot itself — the same object for every caller until the store
|
|
@@ -2182,7 +2271,7 @@ export class CoreAdapter {
|
|
|
2182
2271
|
const views = JSON.parse(await this.core.sessionsDetail());
|
|
2183
2272
|
await this.resolveIdentities(views);
|
|
2184
2273
|
deepFreeze(views);
|
|
2185
|
-
const done = { epoch, at, snapshot: Object.freeze({ views })
|
|
2274
|
+
const done = { epoch, at, snapshot: Object.freeze({ views }) };
|
|
2186
2275
|
this.viewsLatest = done;
|
|
2187
2276
|
return done;
|
|
2188
2277
|
})();
|
|
@@ -2330,6 +2419,7 @@ export class CoreAdapter {
|
|
|
2330
2419
|
// (F2) The preview shows the deliver step's gate-card text, so it reads the same origin the
|
|
2331
2420
|
// launch would. Local to this call, like the launch's.
|
|
2332
2421
|
const previewOriginUrl = opts.deliver === true ? await this.resolveDeliverOrigin(opts.repoRef) : null;
|
|
2422
|
+
const previewCommitIdents = opts.deliver === true ? await this.resolveDeliverCommitIdents(opts.repoRef) : undefined;
|
|
2333
2423
|
const previewIdentity = await this.resolveDeliverIdentity(opts.repoRef);
|
|
2334
2424
|
const previewCredentials = opts.deliver === true ? await deliverCredentialsProbe(previewOriginUrl, process.env, undefined, pushIdentityOf(previewIdentity.login)) : null;
|
|
2335
2425
|
const deliverStep = opts.deliver === true
|
|
@@ -2341,7 +2431,7 @@ export class CoreAdapter {
|
|
|
2341
2431
|
problem: '',
|
|
2342
2432
|
clisJson: '[]',
|
|
2343
2433
|
...(opts.repoRef !== undefined ? { repoRef: opts.repoRef } : {}),
|
|
2344
|
-
}, previewOriginUrl, previewIdentity, previewCredentials))
|
|
2434
|
+
}, previewOriginUrl, previewIdentity, previewCredentials, previewCommitIdents))
|
|
2345
2435
|
: null;
|
|
2346
2436
|
return JSON.parse(await fn.call(this.core, JSON.stringify(plan), opts.projectId ?? null, opts.humanConfirm ?? null, opts.repoRef ?? null, deliverStep));
|
|
2347
2437
|
}
|
|
@@ -2572,12 +2662,18 @@ export class CoreAdapter {
|
|
|
2572
2662
|
const real = await realpath(rootPath).catch(() => rootPath);
|
|
2573
2663
|
return JSON.parse(await this.core.registerRepo(name, real));
|
|
2574
2664
|
}
|
|
2665
|
+
/** Remove only the engine registration; the checkout and graph stay on disk. */
|
|
2666
|
+
async unregisterRepo(id) {
|
|
2667
|
+
if (typeof this.core.unregisterRepo !== 'function')
|
|
2668
|
+
throw new RepoUnregisterUnsupportedError();
|
|
2669
|
+
return parseEngineJson(await this.core.unregisterRepo(id), 'unregisterRepo');
|
|
2670
|
+
}
|
|
2575
2671
|
/**
|
|
2576
2672
|
* Clone a remote git URL and return the persisted `RepoEntry` from registration.
|
|
2577
|
-
* `checkoutPath` overrides the
|
|
2673
|
+
* `checkoutPath` overrides the state-home-derived repos destination.
|
|
2578
2674
|
*/
|
|
2579
2675
|
async cloneAndRegister(name, gitUrl, checkoutPath, opts = {}) {
|
|
2580
|
-
const reposRoot =
|
|
2676
|
+
const reposRoot = wickedWorkRoot('repos');
|
|
2581
2677
|
let cloneDir;
|
|
2582
2678
|
if (checkoutPath) {
|
|
2583
2679
|
// Expand leading ~/ so callers can use home-relative paths.
|
|
@@ -2626,12 +2722,8 @@ export class CoreAdapter {
|
|
|
2626
2722
|
catch { /* not yet cloned */ }
|
|
2627
2723
|
if (needsClone) {
|
|
2628
2724
|
try {
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
// crew-0182: a repository that needs a sign-in fails in seconds with git's own reason, instead of waiting on a
|
|
2632
|
-
// credential prompt no one can answer until the 5-minute timeout.
|
|
2633
|
-
env: { ...process.env, GIT_TERMINAL_PROMPT: '0', ...(opts.allowProtocols !== undefined ? { GIT_ALLOW_PROTOCOL: opts.allowProtocols } : {}) },
|
|
2634
|
-
});
|
|
2725
|
+
// crew#1839: an Azure DevOps URL clones with the daemon's Azure DevOps credential when it holds one.
|
|
2726
|
+
await cloneRepository(gitUrl, cloneDir, opts);
|
|
2635
2727
|
}
|
|
2636
2728
|
catch (err) {
|
|
2637
2729
|
// Cleanup is best-effort: swallow any cleanup error so the original
|
|
@@ -2842,9 +2934,30 @@ export class CoreAdapter {
|
|
|
2842
2934
|
async upsertPolicy(policy) {
|
|
2843
2935
|
await this.core.upsertPolicy(JSON.stringify(policy));
|
|
2844
2936
|
}
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2937
|
+
ruleWriteTails = new Map();
|
|
2938
|
+
ruleExclusively(id, write) {
|
|
2939
|
+
const result = (this.ruleWriteTails.get(id) ?? Promise.resolve()).then(write);
|
|
2940
|
+
const tail = result.catch(() => undefined);
|
|
2941
|
+
this.ruleWriteTails.set(id, tail);
|
|
2942
|
+
void tail.then(() => {
|
|
2943
|
+
if (this.ruleWriteTails.get(id) === tail)
|
|
2944
|
+
this.ruleWriteTails.delete(id);
|
|
2945
|
+
});
|
|
2946
|
+
return result;
|
|
2947
|
+
}
|
|
2948
|
+
/** Compare and write under the same lock as every crew writer of this rule. */
|
|
2949
|
+
async upsertConformanceRule(rule, expectedRevision) {
|
|
2950
|
+
return this.ruleExclusively(rule.id, async () => {
|
|
2951
|
+
if (expectedRevision !== undefined) {
|
|
2952
|
+
const current = (await this.listConformanceRules()).find((r) => r.id === rule.id);
|
|
2953
|
+
const revision = current === undefined ? null : ruleRevision(current);
|
|
2954
|
+
if (revision !== expectedRevision)
|
|
2955
|
+
throw new RuleChangedError(revision);
|
|
2956
|
+
}
|
|
2957
|
+
const stored = { ...rule };
|
|
2958
|
+
delete stored.revision;
|
|
2959
|
+
await this.core.upsertConformanceRule(JSON.stringify(stored));
|
|
2960
|
+
});
|
|
2848
2961
|
}
|
|
2849
2962
|
/**
|
|
2850
2963
|
* Withdraw a policy from enforcement. Resolves `true` if a policy with that id existed.
|
|
@@ -2862,11 +2975,13 @@ export class CoreAdapter {
|
|
|
2862
2975
|
}
|
|
2863
2976
|
/** Withdraw a conformance rule from recall. Same contract as {@link retirePolicy}. */
|
|
2864
2977
|
async retireConformanceRule(id) {
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2978
|
+
return this.ruleExclusively(id, async () => {
|
|
2979
|
+
const retire = this.core.retireConformanceRule;
|
|
2980
|
+
if (typeof retire !== 'function') {
|
|
2981
|
+
throw new Error('Retiring a conformance rule is not yet supported by this wicked-core build');
|
|
2982
|
+
}
|
|
2983
|
+
return JSON.parse(await retire.call(this.core, id));
|
|
2984
|
+
});
|
|
2870
2985
|
}
|
|
2871
2986
|
/** Recall conformance rules matching a facet query (read-only, does not block actor). */
|
|
2872
2987
|
async recallRulesPreview(query) {
|
|
@@ -3019,19 +3134,32 @@ export class CoreAdapter {
|
|
|
3019
3134
|
return typeof this.core.governanceEvals === 'function';
|
|
3020
3135
|
}
|
|
3021
3136
|
/**
|
|
3022
|
-
*
|
|
3023
|
-
*
|
|
3024
|
-
*
|
|
3025
|
-
*
|
|
3026
|
-
* derived), NOT a dbPath-derived sidecar. That home default is exactly why the test harness
|
|
3027
|
-
* arms this seam (tests/setup/hermetic-home.ts): an un-armed corpus-import test writes
|
|
3028
|
-
* `evals:` junk into the OPERATOR's real estate knowledge store — the store the mem/search
|
|
3029
|
-
* domains answer from (crew#396). Read at call time, not construction time, so a test may
|
|
3030
|
-
* re-aim it per fixture.
|
|
3137
|
+
* Explicit WICKED_CREW_KNOWLEDGE_DB wins; isolated homes use <state home>/mcp/evals-knowledge.db,
|
|
3138
|
+
* a file of its own because the engine's vendored store must not share the estate binary's knowledge.db.
|
|
3139
|
+
* The default home omits it so the engine keeps its HOME-derived ~/.wicked-estate/knowledge.db
|
|
3140
|
+
* (evals.rs default_knowledge_db); this is why tests/setup/hermetic-home.ts arms the env seam (crew#396).
|
|
3031
3141
|
*/
|
|
3032
|
-
static
|
|
3142
|
+
static governanceKnowledgeDb() {
|
|
3033
3143
|
const override = process.env['WICKED_CREW_KNOWLEDGE_DB'];
|
|
3034
|
-
|
|
3144
|
+
if (override !== undefined && override !== '')
|
|
3145
|
+
return override;
|
|
3146
|
+
return isDefaultStateHome() ? undefined : join(mcpStateDir(), 'evals-knowledge.db');
|
|
3147
|
+
}
|
|
3148
|
+
/**
|
|
3149
|
+
* (crew#1128) The memory store the evals' memory axis recalls from (core#397): the store this daemon's workers recall
|
|
3150
|
+
* from ({@link resolveMemoryDbPath}: `WICKED_MEMORY_DB`, else `<state home>/mcp/memory.db`, else the operator's
|
|
3151
|
+
* global store), opened read-only by the engine. `undefined` while that file does not exist: the engine refuses a
|
|
3152
|
+
* run whose `memoryDb` is missing, so a daemon with no memories yet keeps the rules-only report (`memory: null`), and
|
|
3153
|
+
* a sample that declares memories gets the engine's own "no memory store" refusal.
|
|
3154
|
+
*/
|
|
3155
|
+
static governanceMemoryDb() {
|
|
3156
|
+
const path = resolveMemoryDbPath();
|
|
3157
|
+
try {
|
|
3158
|
+
return statSync(path).isFile() ? path : undefined;
|
|
3159
|
+
}
|
|
3160
|
+
catch {
|
|
3161
|
+
return undefined;
|
|
3162
|
+
}
|
|
3035
3163
|
}
|
|
3036
3164
|
/**
|
|
3037
3165
|
* Run the governance evals: every sample of the corpus (`corpus` = an `evals:<name>` estate
|
|
@@ -3042,8 +3170,8 @@ export class CoreAdapter {
|
|
|
3042
3170
|
*
|
|
3043
3171
|
* `dbPath` rides the args because the eval run opens its own read-only connection to the
|
|
3044
3172
|
* steering store — the SAME store this adapter's actor writes (`this.dbPath`, the one spelling
|
|
3045
|
-
* of where it lives).
|
|
3046
|
-
* (`~/.wicked-estate/knowledge.db`)
|
|
3173
|
+
* of where it lives). {@link governanceKnowledgeDb} pins isolated homes; the default home keeps
|
|
3174
|
+
* the engine default (`~/.wicked-estate/knowledge.db`) unless explicitly overridden.
|
|
3047
3175
|
*
|
|
3048
3176
|
* Presence-gated (the campaigns doctrine): throws {@link GovernanceEvalsUnsupportedError} on
|
|
3049
3177
|
* an addon that predates the binding, which the route maps to 501 ("upgrade the engine").
|
|
@@ -3053,11 +3181,13 @@ export class CoreAdapter {
|
|
|
3053
3181
|
if (typeof fn !== 'function') {
|
|
3054
3182
|
throw new GovernanceEvalsUnsupportedError('Running governance evals');
|
|
3055
3183
|
}
|
|
3056
|
-
const knowledgeDb = CoreAdapter.
|
|
3184
|
+
const knowledgeDb = CoreAdapter.governanceKnowledgeDb();
|
|
3185
|
+
const memoryDb = CoreAdapter.governanceMemoryDb();
|
|
3057
3186
|
const payload = {
|
|
3058
3187
|
...(args.type !== undefined ? { type: args.type } : {}),
|
|
3059
3188
|
...(args.corpus !== undefined ? { corpus: args.corpus } : {}),
|
|
3060
3189
|
...(knowledgeDb !== undefined ? { knowledgeDb } : {}),
|
|
3190
|
+
...(memoryDb !== undefined ? { memoryDb } : {}),
|
|
3061
3191
|
dbPath: this.dbPath,
|
|
3062
3192
|
};
|
|
3063
3193
|
return parseEngineJson(await fn.call(this.core, JSON.stringify(payload)), 'governanceEvals');
|
|
@@ -3065,8 +3195,7 @@ export class CoreAdapter {
|
|
|
3065
3195
|
/**
|
|
3066
3196
|
* Import a named eval corpus into the knowledge store under the `evals:<name>` scope (the
|
|
3067
3197
|
* string a later {@link runGovernanceEvals} names as `corpus`). `knowledgeDb` resolves the
|
|
3068
|
-
* same way as in {@link runGovernanceEvals}
|
|
3069
|
-
* `~/.wicked-estate/knowledge.db`), {@link knowledgeDbOverride} wins when set.
|
|
3198
|
+
* same way as in {@link runGovernanceEvals}, through {@link governanceKnowledgeDb}.
|
|
3070
3199
|
*
|
|
3071
3200
|
* Gated on the `governanceEvals` sentinel as well as the binding itself: the two ship
|
|
3072
3201
|
* together, and importing a corpus no engine on this host can ever run would be a trap, not
|
|
@@ -3077,7 +3206,7 @@ export class CoreAdapter {
|
|
|
3077
3206
|
if (typeof this.core.governanceEvals !== 'function' || typeof importFn !== 'function') {
|
|
3078
3207
|
throw new GovernanceEvalsUnsupportedError('Importing an eval corpus');
|
|
3079
3208
|
}
|
|
3080
|
-
const knowledgeDb = CoreAdapter.
|
|
3209
|
+
const knowledgeDb = CoreAdapter.governanceKnowledgeDb();
|
|
3081
3210
|
return parseEngineJson(await importFn.call(this.core, JSON.stringify({ name, samples, ...(knowledgeDb !== undefined ? { knowledgeDb } : {}) })), 'governanceCorpusImport');
|
|
3082
3211
|
}
|
|
3083
3212
|
// ── Workflow viewer + builder (crew#44) ────────────────────────────────────
|
|
@@ -3195,12 +3324,12 @@ export class CoreAdapter {
|
|
|
3195
3324
|
return def.id;
|
|
3196
3325
|
}
|
|
3197
3326
|
/**
|
|
3198
|
-
* Save an inline script
|
|
3327
|
+
* Save an inline script under the state-home-derived scripts root, make it executable,
|
|
3199
3328
|
* and return the absolute path. Tool-executor phases use this path as their command.
|
|
3200
3329
|
*/
|
|
3201
3330
|
async saveScript(name, content, lang) {
|
|
3202
3331
|
const ext = lang === 'python' ? 'py' : 'sh';
|
|
3203
|
-
const dir =
|
|
3332
|
+
const dir = wickedWorkRoot('scripts');
|
|
3204
3333
|
await mkdir(dir, { recursive: true });
|
|
3205
3334
|
const filename = `${name.replace(/[^a-z0-9_-]/gi, '_')}.${ext}`;
|
|
3206
3335
|
const path = join(dir, filename);
|
|
@@ -3282,8 +3411,8 @@ export class CoreAdapter {
|
|
|
3282
3411
|
/** The settings as read, and whether the read succeeded: a file that could not be read, parsed or
|
|
3283
3412
|
* validated serves the defaults (`ok: false`), which the engine's QE mirror reads as a failure. */
|
|
3284
3413
|
async readSettings() {
|
|
3285
|
-
await seedStateHomeSettings(settingsFilePath());
|
|
3286
3414
|
try {
|
|
3415
|
+
await seedStateHomeSettings(settingsFilePath());
|
|
3287
3416
|
const raw = await readFile(settingsFilePath(), 'utf8');
|
|
3288
3417
|
const parsed = JSON.parse(raw);
|
|
3289
3418
|
// Validate numeric fields; drop anything out-of-range rather than propagate bad values.
|
|
@@ -3292,6 +3421,8 @@ export class CoreAdapter {
|
|
|
3292
3421
|
if (typeof v !== 'number' || !Number.isInteger(v) || v < 1 || v > 10000)
|
|
3293
3422
|
delete parsed.graphNodeLimit;
|
|
3294
3423
|
}
|
|
3424
|
+
if ('deliverAuthorNoreply' in parsed && typeof parsed.deliverAuthorNoreply !== 'boolean')
|
|
3425
|
+
delete parsed.deliverAuthorNoreply;
|
|
3295
3426
|
// deliverIdentityLogin (crew#549): a LOGIN, and the same charset PUT /settings enforces —
|
|
3296
3427
|
// a hand-edited settings.json must not enable a value the API rejects (and must never be
|
|
3297
3428
|
// able to put anything but a login into the deliver script's shell literal). Anything else
|