create-principles-disciple 1.154.5 → 1.155.1
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/_release/product-identity.json +2 -2
- package/codex-adapter/dist/codec/input-decoder.d.ts +17 -0
- package/codex-adapter/dist/codec/input-decoder.js +39 -0
- package/codex-adapter/dist/ingestion/explicit-owner-statement.js +125 -1
- package/codex-adapter/dist/ingestion/pain-receipt-fallback.d.ts +46 -0
- package/codex-adapter/dist/ingestion/pain-receipt-fallback.js +193 -0
- package/codex-adapter/dist/ingestion/turn-context.d.ts +10 -15
- package/codex-adapter/dist/ingestion/turn-context.js +35 -9
- package/codex-adapter/dist/pd-hook.js +57 -1
- package/codex-adapter/dist/worker/workspace-worker.d.ts +15 -0
- package/codex-adapter/dist/worker/workspace-worker.js +91 -12
- package/codex-adapter/package.json +1 -1
- package/console/dist/server/index.js +10 -0
- package/console/dist/server/models/EvidenceChainConsoleModel.js +31 -0
- package/console/dist/server/routes/service-host.d.ts +19 -0
- package/console/dist/server/routes/service-host.js +129 -0
- package/console/dist/web/assets/app.js +37 -37
- package/core/dist/runtime/context-payload.d.ts +48 -0
- package/core/dist/runtime/context-payload.d.ts.map +1 -1
- package/core/dist/runtime/context-payload.js +12 -0
- package/core/dist/runtime/context-payload.js.map +1 -1
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.js +18 -0
- package/core/dist/runtime/diagnostician/rootcause-prompt-builder.js.map +1 -1
- package/core/dist/runtime/diagnostician-candidate.d.ts.map +1 -1
- package/core/dist/runtime/diagnostician-candidate.js +18 -2
- package/core/dist/runtime/diagnostician-candidate.js.map +1 -1
- package/core/dist/runtime/evidence-guards.d.ts +7 -3
- package/core/dist/runtime/evidence-guards.d.ts.map +1 -1
- package/core/dist/runtime/evidence-guards.js +9 -7
- package/core/dist/runtime/evidence-guards.js.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-contract.d.ts.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-contract.js +14 -0
- package/core/dist/runtime/feature-flags/feature-flag-contract.js.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.d.ts.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js +8 -0
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js.map +1 -1
- package/core/dist/runtime/host-submission-context.d.ts +83 -0
- package/core/dist/runtime/host-submission-context.d.ts.map +1 -0
- package/core/dist/runtime/host-submission-context.js +183 -0
- package/core/dist/runtime/host-submission-context.js.map +1 -0
- package/core/dist/runtime/index.d.ts +9 -2
- package/core/dist/runtime/index.d.ts.map +1 -1
- package/core/dist/runtime/index.js +29 -2
- package/core/dist/runtime/index.js.map +1 -1
- package/core/dist/runtime/intent/intent-doc.d.ts.map +1 -1
- package/core/dist/runtime/intent/intent-doc.js +29 -5
- package/core/dist/runtime/intent/intent-doc.js.map +1 -1
- package/core/dist/runtime/internalization/diag-distiller-runner.d.ts +9 -0
- package/core/dist/runtime/internalization/diag-distiller-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-distiller-runner.js +13 -0
- package/core/dist/runtime/internalization/diag-distiller-runner.js.map +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts +11 -0
- package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-rootcause-runner.js +10 -0
- package/core/dist/runtime/internalization/diag-rootcause-runner.js.map +1 -1
- package/core/dist/runtime/internalization/diag-router-runner.d.ts +9 -0
- package/core/dist/runtime/internalization/diag-router-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/diag-router-runner.js +13 -0
- package/core/dist/runtime/internalization/diag-router-runner.js.map +1 -1
- package/core/dist/runtime/internalization/index.d.ts +1 -1
- package/core/dist/runtime/internalization/index.d.ts.map +1 -1
- package/core/dist/runtime/internalization/index.js +1 -1
- package/core/dist/runtime/internalization/index.js.map +1 -1
- package/core/dist/runtime/internalization/intake-to-internalization-bridge.d.ts +19 -0
- package/core/dist/runtime/internalization/intake-to-internalization-bridge.d.ts.map +1 -1
- package/core/dist/runtime/internalization/intake-to-internalization-bridge.js +24 -0
- package/core/dist/runtime/internalization/intake-to-internalization-bridge.js.map +1 -1
- package/core/dist/runtime/internalization/internalization-orchestrator.d.ts +8 -0
- package/core/dist/runtime/internalization/internalization-orchestrator.d.ts.map +1 -1
- package/core/dist/runtime/internalization/internalization-orchestrator.js +36 -4
- package/core/dist/runtime/internalization/internalization-orchestrator.js.map +1 -1
- package/core/dist/runtime/internalization/source-authorization-boundary.d.ts +39 -0
- package/core/dist/runtime/internalization/source-authorization-boundary.d.ts.map +1 -0
- package/core/dist/runtime/internalization/source-authorization-boundary.js +57 -0
- package/core/dist/runtime/internalization/source-authorization-boundary.js.map +1 -0
- package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts.map +1 -1
- package/core/dist/runtime/internalization/split-diagnostician-runner.js +72 -5
- package/core/dist/runtime/internalization/split-diagnostician-runner.js.map +1 -1
- package/core/dist/runtime/pain-admission-disposition.d.ts +60 -0
- package/core/dist/runtime/pain-admission-disposition.d.ts.map +1 -0
- package/core/dist/runtime/pain-admission-disposition.js +37 -0
- package/core/dist/runtime/pain-admission-disposition.js.map +1 -0
- package/core/dist/runtime/pain-ingress-payload.d.ts +36 -2
- package/core/dist/runtime/pain-ingress-payload.d.ts.map +1 -1
- package/core/dist/runtime/pain-ingress-payload.js +63 -6
- package/core/dist/runtime/pain-ingress-payload.js.map +1 -1
- package/core/dist/runtime/pain-ingress.d.ts.map +1 -1
- package/core/dist/runtime/pain-ingress.js +28 -0
- package/core/dist/runtime/pain-ingress.js.map +1 -1
- package/core/dist/runtime/pain-recall-read-model.d.ts +13 -1
- package/core/dist/runtime/pain-recall-read-model.d.ts.map +1 -1
- package/core/dist/runtime/pain-recall-read-model.js +50 -7
- package/core/dist/runtime/pain-recall-read-model.js.map +1 -1
- package/core/dist/runtime/pain-receipt-recovery.d.ts +147 -0
- package/core/dist/runtime/pain-receipt-recovery.d.ts.map +1 -0
- package/core/dist/runtime/pain-receipt-recovery.js +475 -0
- package/core/dist/runtime/pain-receipt-recovery.js.map +1 -0
- package/core/dist/runtime/pain-signal-bridge.d.ts +13 -1
- package/core/dist/runtime/pain-signal-bridge.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.js +174 -0
- package/core/dist/runtime/pain-signal-bridge.js.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.d.ts +9 -0
- package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.js +8 -3
- package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime/pain-submit-capability.d.ts +11 -0
- package/core/dist/runtime/pain-submit-capability.d.ts.map +1 -1
- package/core/dist/runtime/pain-submit-capability.js +77 -3
- package/core/dist/runtime/pain-submit-capability.js.map +1 -1
- package/core/dist/runtime/pain-target-evidence-reconcile.d.ts +55 -0
- package/core/dist/runtime/pain-target-evidence-reconcile.d.ts.map +1 -0
- package/core/dist/runtime/pain-target-evidence-reconcile.js +164 -0
- package/core/dist/runtime/pain-target-evidence-reconcile.js.map +1 -0
- package/core/dist/runtime/pain-to-principle-service.d.ts +8 -0
- package/core/dist/runtime/pain-to-principle-service.d.ts.map +1 -1
- package/core/dist/runtime/pain-to-principle-service.js +1 -0
- package/core/dist/runtime/pain-to-principle-service.js.map +1 -1
- package/core/dist/runtime/source-material-authorization.d.ts +166 -0
- package/core/dist/runtime/source-material-authorization.d.ts.map +1 -0
- package/core/dist/runtime/source-material-authorization.js +250 -0
- package/core/dist/runtime/source-material-authorization.js.map +1 -0
- package/core/dist/runtime/store/context/index.d.ts +1 -0
- package/core/dist/runtime/store/context/index.d.ts.map +1 -1
- package/core/dist/runtime/store/context/index.js +1 -0
- package/core/dist/runtime/store/context/index.js.map +1 -1
- package/core/dist/runtime/store/context/promoted-evidence-reader.d.ts +8 -0
- package/core/dist/runtime/store/context/promoted-evidence-reader.d.ts.map +1 -1
- package/core/dist/runtime/store/context/promoted-evidence-reader.js +15 -1
- package/core/dist/runtime/store/context/promoted-evidence-reader.js.map +1 -1
- package/core/dist/runtime/store/context/sqlite-context-assembler.d.ts +22 -0
- package/core/dist/runtime/store/context/sqlite-context-assembler.d.ts.map +1 -1
- package/core/dist/runtime/store/context/sqlite-context-assembler.js +153 -3
- package/core/dist/runtime/store/context/sqlite-context-assembler.js.map +1 -1
- package/core/dist/runtime/store/context/trajectory-turn-reader.d.ts +13 -0
- package/core/dist/runtime/store/context/trajectory-turn-reader.d.ts.map +1 -1
- package/core/dist/runtime/store/lifecycle/lease-manager.d.ts +15 -0
- package/core/dist/runtime/store/lifecycle/lease-manager.d.ts.map +1 -1
- package/core/dist/runtime/store/lifecycle/lease-manager.js +16 -1
- package/core/dist/runtime/store/lifecycle/lease-manager.js.map +1 -1
- package/core/dist/runtime/store/runtime-state-manager.d.ts +2 -0
- package/core/dist/runtime/store/runtime-state-manager.d.ts.map +1 -1
- package/core/dist/runtime/store/runtime-state-manager.js.map +1 -1
- package/core/dist/runtime/store/task/memory-task-store.d.ts +1 -0
- package/core/dist/runtime/store/task/memory-task-store.d.ts.map +1 -1
- package/core/dist/runtime/store/task/memory-task-store.js +37 -0
- package/core/dist/runtime/store/task/memory-task-store.js.map +1 -1
- package/core/dist/runtime/store/task/sqlite-task-store.d.ts +10 -0
- package/core/dist/runtime/store/task/sqlite-task-store.d.ts.map +1 -1
- package/core/dist/runtime/store/task/sqlite-task-store.js +20 -0
- package/core/dist/runtime/store/task/sqlite-task-store.js.map +1 -1
- package/core/dist/runtime/store/task/task-store.d.ts +16 -0
- package/core/dist/runtime/store/task/task-store.d.ts.map +1 -1
- package/core/dist/runtime/task-status.d.ts +13 -0
- package/core/dist/runtime/task-status.d.ts.map +1 -1
- package/core/dist/runtime/task-status.js +9 -0
- package/core/dist/runtime/task-status.js.map +1 -1
- package/core/dist/runtime/types/evidence-chain-contract.d.ts +10 -0
- package/core/dist/runtime/types/evidence-chain-contract.d.ts.map +1 -1
- package/core/dist/runtime/types/evidence-chain-contract.js +7 -0
- package/core/dist/runtime/types/evidence-chain-contract.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +77 -30
- package/dist/installer.js.map +1 -1
- package/dist/installers/mcp-registration-conflict.d.ts +8 -0
- package/dist/installers/mcp-registration-conflict.d.ts.map +1 -1
- package/dist/installers/mcp-registration-conflict.js +34 -1
- package/dist/installers/mcp-registration-conflict.js.map +1 -1
- package/dist/installers/workbuddy-host-installer.d.ts +45 -13
- package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
- package/dist/installers/workbuddy-host-installer.js +284 -21
- package/dist/installers/workbuddy-host-installer.js.map +1 -1
- package/dist/prompts.d.ts +11 -0
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +4 -0
- package/dist/prompts.js.map +1 -1
- package/dist/service-host-bridge.d.ts +67 -0
- package/dist/service-host-bridge.d.ts.map +1 -0
- package/dist/service-host-bridge.js +292 -0
- package/dist/service-host-bridge.js.map +1 -0
- package/dist/uninstaller.d.ts.map +1 -1
- package/dist/uninstaller.js +26 -0
- package/dist/uninstaller.js.map +1 -1
- package/dist/update/install-layout.d.ts +0 -12
- package/dist/update/install-layout.d.ts.map +1 -1
- package/dist/update/install-layout.js +42 -15
- package/dist/update/install-layout.js.map +1 -1
- package/host-runtime/dist/diagnostician-auto-run.js +4 -1
- package/host-runtime/dist/governance-observation-store.d.ts +7 -0
- package/host-runtime/dist/governance-observation-store.js +15 -4
- package/host-runtime/dist/governance-signal-admission.d.ts +49 -0
- package/host-runtime/dist/governance-signal-admission.js +355 -94
- package/host-runtime/dist/governance-trajectory-turn-reader.d.ts +20 -4
- package/host-runtime/dist/governance-trajectory-turn-reader.js +77 -5
- package/host-runtime/dist/index.d.ts +2 -0
- package/host-runtime/dist/index.js +5 -0
- package/host-runtime/dist/internalization-consumer-cycle.js +4 -1
- package/host-runtime/dist/pd-config.d.ts +10 -0
- package/host-runtime/dist/pd-config.js +37 -0
- package/host-runtime/dist/signal-stage2-cycle.js +28 -1
- package/host-runtime/dist/source-material-authorization.d.ts +53 -0
- package/host-runtime/dist/source-material-authorization.js +67 -0
- package/host-runtime/dist/source-revocation-sweep.d.ts +172 -0
- package/host-runtime/dist/source-revocation-sweep.js +928 -0
- package/host-runtime/package.json +5 -1
- package/install-layout/dist/background-execution-transition.d.ts +258 -0
- package/install-layout/dist/background-execution-transition.js +836 -0
- package/install-layout/dist/index.d.ts +8 -0
- package/install-layout/dist/index.js +8 -0
- package/install-layout/package.json +6 -2
- package/package.json +4 -4
- package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
- package/pd-cli/dist/commands/candidate.js +16 -5
- package/pd-cli/dist/commands/candidate.js.map +1 -1
- package/pd-cli/dist/commands/codex-setup.d.ts.map +1 -1
- package/pd-cli/dist/commands/codex-setup.js +17 -1
- package/pd-cli/dist/commands/codex-setup.js.map +1 -1
- package/pd-cli/dist/commands/codex-worker.d.ts.map +1 -1
- package/pd-cli/dist/commands/codex-worker.js +8 -4
- package/pd-cli/dist/commands/codex-worker.js.map +1 -1
- package/pd-cli/dist/commands/consent-sweep-revoked.d.ts +20 -0
- package/pd-cli/dist/commands/consent-sweep-revoked.d.ts.map +1 -0
- package/pd-cli/dist/commands/consent-sweep-revoked.js +85 -0
- package/pd-cli/dist/commands/consent-sweep-revoked.js.map +1 -0
- package/pd-cli/dist/commands/context.d.ts.map +1 -1
- package/pd-cli/dist/commands/context.js +9 -1
- package/pd-cli/dist/commands/context.js.map +1 -1
- package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
- package/pd-cli/dist/commands/diagnose.js +12 -6
- package/pd-cli/dist/commands/diagnose.js.map +1 -1
- package/pd-cli/dist/commands/openclaw-worker.d.ts +11 -0
- package/pd-cli/dist/commands/openclaw-worker.d.ts.map +1 -0
- package/pd-cli/dist/commands/openclaw-worker.js +199 -0
- package/pd-cli/dist/commands/openclaw-worker.js.map +1 -0
- package/pd-cli/dist/commands/pain-explicit.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-explicit.js +1 -0
- package/pd-cli/dist/commands/pain-explicit.js.map +1 -1
- package/pd-cli/dist/commands/pain-recall.d.ts +2 -2
- package/pd-cli/dist/commands/pain-recall.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-recall.js +7 -1
- package/pd-cli/dist/commands/pain-recall.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-retry.js +12 -6
- package/pd-cli/dist/commands/pain-retry.js.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js +2 -1
- package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts +1 -0
- package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.js +32 -8
- package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-wake-once.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-wake-once.js +2 -1
- package/pd-cli/dist/commands/runtime-internalization-wake-once.js.map +1 -1
- package/pd-cli/dist/commands/service-handover.d.ts +12 -0
- package/pd-cli/dist/commands/service-handover.d.ts.map +1 -0
- package/pd-cli/dist/commands/service-handover.js +117 -0
- package/pd-cli/dist/commands/service-handover.js.map +1 -0
- package/pd-cli/dist/commands/service-lifecycle.d.ts +31 -0
- package/pd-cli/dist/commands/service-lifecycle.d.ts.map +1 -0
- package/pd-cli/dist/commands/service-lifecycle.js +207 -0
- package/pd-cli/dist/commands/service-lifecycle.js.map +1 -0
- package/pd-cli/dist/commands/service-run-once.d.ts +96 -0
- package/pd-cli/dist/commands/service-run-once.d.ts.map +1 -1
- package/pd-cli/dist/commands/service-run-once.js +432 -13
- package/pd-cli/dist/commands/service-run-once.js.map +1 -1
- package/pd-cli/dist/commands/workbuddy-setup.d.ts.map +1 -1
- package/pd-cli/dist/commands/workbuddy-setup.js +22 -2
- package/pd-cli/dist/commands/workbuddy-setup.js.map +1 -1
- package/pd-cli/dist/program.d.ts.map +1 -1
- package/pd-cli/dist/program.js +167 -9
- package/pd-cli/dist/program.js.map +1 -1
- package/pd-cli/dist/services/admission-write-gate.d.ts +3 -1
- package/pd-cli/dist/services/admission-write-gate.d.ts.map +1 -1
- package/pd-cli/dist/services/admission-write-gate.js +1 -0
- package/pd-cli/dist/services/admission-write-gate.js.map +1 -1
- package/pd-cli/dist/services/service-host/coordinator-common.d.ts +49 -0
- package/pd-cli/dist/services/service-host/coordinator-common.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/coordinator-common.js +158 -0
- package/pd-cli/dist/services/service-host/coordinator-common.js.map +1 -0
- package/pd-cli/dist/services/service-host/handover-claims.d.ts +14 -0
- package/pd-cli/dist/services/service-host/handover-claims.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/handover-claims.js +50 -0
- package/pd-cli/dist/services/service-host/handover-claims.js.map +1 -0
- package/pd-cli/dist/services/service-host/index.d.ts +19 -3
- package/pd-cli/dist/services/service-host/index.d.ts.map +1 -1
- package/pd-cli/dist/services/service-host/index.js +21 -3
- package/pd-cli/dist/services/service-host/index.js.map +1 -1
- package/pd-cli/dist/services/service-host/install-identity.d.ts +23 -3
- package/pd-cli/dist/services/service-host/install-identity.d.ts.map +1 -1
- package/pd-cli/dist/services/service-host/install-identity.js +15 -5
- package/pd-cli/dist/services/service-host/install-identity.js.map +1 -1
- package/pd-cli/dist/services/service-host/locking/service-run-lock.d.ts +130 -9
- package/pd-cli/dist/services/service-host/locking/service-run-lock.d.ts.map +1 -1
- package/pd-cli/dist/services/service-host/locking/service-run-lock.js +99 -19
- package/pd-cli/dist/services/service-host/locking/service-run-lock.js.map +1 -1
- package/pd-cli/dist/services/service-host/managed-run.d.ts +75 -0
- package/pd-cli/dist/services/service-host/managed-run.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/managed-run.js +550 -0
- package/pd-cli/dist/services/service-host/managed-run.js.map +1 -0
- package/pd-cli/dist/services/service-host/progress-evidence.d.ts +38 -0
- package/pd-cli/dist/services/service-host/progress-evidence.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/progress-evidence.js +155 -0
- package/pd-cli/dist/services/service-host/progress-evidence.js.map +1 -0
- package/pd-cli/dist/services/service-host/run-once.d.ts.map +1 -1
- package/pd-cli/dist/services/service-host/run-once.js +4 -136
- package/pd-cli/dist/services/service-host/run-once.js.map +1 -1
- package/pd-cli/dist/services/service-host/scheduler/contract.d.ts +184 -0
- package/pd-cli/dist/services/service-host/scheduler/contract.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/contract.js +86 -0
- package/pd-cli/dist/services/service-host/scheduler/contract.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/index.d.ts +76 -0
- package/pd-cli/dist/services/service-host/scheduler/index.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/index.js +128 -0
- package/pd-cli/dist/services/service-host/scheduler/index.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/linux.d.ts +27 -0
- package/pd-cli/dist/services/service-host/scheduler/linux.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/linux.js +1010 -0
- package/pd-cli/dist/services/service-host/scheduler/linux.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/macos.d.ts +13 -0
- package/pd-cli/dist/services/service-host/scheduler/macos.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/macos.js +819 -0
- package/pd-cli/dist/services/service-host/scheduler/macos.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/runtime-io.d.ts +13 -0
- package/pd-cli/dist/services/service-host/scheduler/runtime-io.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/runtime-io.js +141 -0
- package/pd-cli/dist/services/service-host/scheduler/runtime-io.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/service-status.d.ts +99 -0
- package/pd-cli/dist/services/service-host/scheduler/service-status.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/service-status.js +202 -0
- package/pd-cli/dist/services/service-host/scheduler/service-status.js.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/windows.d.ts +40 -0
- package/pd-cli/dist/services/service-host/scheduler/windows.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/scheduler/windows.js +688 -0
- package/pd-cli/dist/services/service-host/scheduler/windows.js.map +1 -0
- package/pd-cli/dist/services/service-host/shadow-progress-store.d.ts +43 -0
- package/pd-cli/dist/services/service-host/shadow-progress-store.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/shadow-progress-store.js +156 -0
- package/pd-cli/dist/services/service-host/shadow-progress-store.js.map +1 -0
- package/pd-cli/dist/services/service-host/shadow-run.d.ts +87 -0
- package/pd-cli/dist/services/service-host/shadow-run.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/shadow-run.js +549 -0
- package/pd-cli/dist/services/service-host/shadow-run.js.map +1 -0
- package/pd-cli/dist/services/service-host/status/service-run-status.d.ts +114 -4
- package/pd-cli/dist/services/service-host/status/service-run-status.d.ts.map +1 -1
- package/pd-cli/dist/services/service-host/status/service-run-status.js +37 -0
- package/pd-cli/dist/services/service-host/status/service-run-status.js.map +1 -1
- package/pd-cli/dist/services/service-host/worker-adapter-codex.d.ts +2 -0
- package/pd-cli/dist/services/service-host/worker-adapter-codex.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter-codex.js +76 -0
- package/pd-cli/dist/services/service-host/worker-adapter-codex.js.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter-openclaw.d.ts +2 -0
- package/pd-cli/dist/services/service-host/worker-adapter-openclaw.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter-openclaw.js +49 -0
- package/pd-cli/dist/services/service-host/worker-adapter-openclaw.js.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.d.ts +2 -0
- package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.js +36 -0
- package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.js.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter.d.ts +187 -0
- package/pd-cli/dist/services/service-host/worker-adapter.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-adapter.js +609 -0
- package/pd-cli/dist/services/service-host/worker-adapter.js.map +1 -0
- package/pd-cli/dist/services/service-host/worker-env.d.ts +84 -0
- package/pd-cli/dist/services/service-host/worker-env.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-env.js +195 -0
- package/pd-cli/dist/services/service-host/worker-env.js.map +1 -0
- package/pd-cli/dist/services/service-host/worker-process.d.ts +75 -0
- package/pd-cli/dist/services/service-host/worker-process.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/worker-process.js +225 -0
- package/pd-cli/dist/services/service-host/worker-process.js.map +1 -0
- package/pd-cli/dist/services/service-host/workspace-dispatch.d.ts +61 -0
- package/pd-cli/dist/services/service-host/workspace-dispatch.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/workspace-dispatch.js +105 -0
- package/pd-cli/dist/services/service-host/workspace-dispatch.js.map +1 -0
- package/pd-cli/dist/services/service-host/workspace-handover.d.ts +190 -0
- package/pd-cli/dist/services/service-host/workspace-handover.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/workspace-handover.js +1393 -0
- package/pd-cli/dist/services/service-host/workspace-handover.js.map +1 -0
- package/pd-cli/package.json +6 -5
- package/pd-mcp-server/dist/submit-assembly.js +159 -42
- package/pd-mcp-server/dist/version.d.ts +1 -1
- package/pd-mcp-server/dist/version.js +1 -1
- package/pd-mcp-server/package.json +1 -1
- package/plugin/dist/bundle.js +586 -568
- package/plugin/dist/openclaw-worker.d.ts +92 -0
- package/plugin/dist/openclaw-worker.js +2439 -0
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/service/gateway-consumer-lease.d.ts +142 -0
- package/plugin/dist/service/gateway-quiesce-ack.d.ts +40 -0
- package/plugin/dist/service/internalization-auto-consumer-service.d.ts +68 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +5 -1
- package/release-manager/dist/installer.js +77 -30
- package/release-manager/dist/installers/mcp-registration-conflict.js +34 -1
- package/release-manager/dist/installers/workbuddy-host-installer.js +284 -21
- package/release-manager/dist/service-host-bridge.js +292 -0
- package/release-manager/dist/update/install-layout.js +42 -15
- package/release-manager/package.json +2 -2
- package/workbuddy-adapter/dist/index.d.ts +1 -1
- package/workbuddy-adapter/dist/index.js +1 -1
- package/workbuddy-adapter/dist/worker/workspace-worker.d.ts +7 -0
- package/workbuddy-adapter/dist/worker/workspace-worker.js +179 -10
- package/workbuddy-adapter/package.json +1 -1
- package/workbuddy-adapter/plugin/.codebuddy-plugin/plugin.json +2 -2
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { InstallIdentity } from '../install-identity.js';
|
|
2
2
|
import type { WorkspaceDiscoveryResult } from '../workspace-discovery.js';
|
|
3
|
+
import type { AdapterCycleResult, ShadowHostKind, WorkerHostKind } from '../worker-adapter.js';
|
|
3
4
|
export declare const SERVICE_RUN_STATUS_SCHEMA_VERSION = "pd.service-run-status.v1";
|
|
4
|
-
/**
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* How this run was triggered (task §4): `manual` = a human at the CLI;
|
|
7
|
+
* `scheduler` = the OS-level registration invoked the managed entry. The
|
|
8
|
+
* two OS trigger flavours (login vs periodic) are deliberately NOT
|
|
9
|
+
* distinguished — no platform reports that reliably, so PD never fabricates
|
|
10
|
+
* a finer source than it can prove.
|
|
11
|
+
*/
|
|
12
|
+
export type ServiceRunTriggerSource = 'manual' | 'scheduler';
|
|
6
13
|
/** Top-level run outcome (distinct from per-workspace verdicts). */
|
|
7
|
-
export type ServiceRunOutcome = 'completed' | 'already_running' | 'refused';
|
|
14
|
+
export type ServiceRunOutcome = 'completed' | 'already_running' | 'refused' | 'failed';
|
|
8
15
|
/**
|
|
9
16
|
* The five task-required read verdicts (missing / read_failed / unparsable /
|
|
10
17
|
* not_an_object / invalid) plus `ok`. Only `ok` marks a conforming record —
|
|
@@ -59,8 +66,14 @@ export interface ServiceRunStatus {
|
|
|
59
66
|
readonly pdExperimentRootStripped: boolean;
|
|
60
67
|
/** HOME/USERPROFILE present in the inherited env but ignored for identity. */
|
|
61
68
|
readonly ignoredIdentityEnvVars: readonly string[];
|
|
62
|
-
/** Host-root overrides
|
|
69
|
+
/** Host-root overrides present in the inherited env (steered discovery when honored). */
|
|
63
70
|
readonly inheritedHostRootEnvVars: readonly string[];
|
|
71
|
+
/**
|
|
72
|
+
* Host-root overrides present in the inherited env but NOT honored
|
|
73
|
+
* (shadow runs resolve host roots from the trusted home only — F1
|
|
74
|
+
* review fix). Empty in dry-run mode, where overrides are honored.
|
|
75
|
+
*/
|
|
76
|
+
readonly ignoredHostRootEnvVars?: readonly string[];
|
|
64
77
|
};
|
|
65
78
|
readonly manifest: {
|
|
66
79
|
/** ok | missing | read_failed | unparsable | invalid | version_mismatch */
|
|
@@ -84,9 +97,106 @@ export interface ServiceRunStatus {
|
|
|
84
97
|
readonly incomplete: boolean;
|
|
85
98
|
};
|
|
86
99
|
readonly workspaces: WorkspaceDiscoveryResult['workspaces'];
|
|
100
|
+
/**
|
|
101
|
+
* Phase 2 shadow section (optional, additive — v1 schema evolution):
|
|
102
|
+
* present only for shadow runs. `dryRun: false` on the same status
|
|
103
|
+
* document distinguishes the two modes. Carries per-workspace execution
|
|
104
|
+
* records ONLY — never Pain content, task payloads, or environment
|
|
105
|
+
* values (security contract above; worker environment reports carry
|
|
106
|
+
* variable NAMES, not values).
|
|
107
|
+
*/
|
|
108
|
+
readonly shadow?: ShadowRunStatusSection;
|
|
109
|
+
/**
|
|
110
|
+
* Phase 3 managed section (optional, additive — v1 schema evolution):
|
|
111
|
+
* present only for managed runs (`pd service run-once --json`, the
|
|
112
|
+
* scheduler entry). Carries per-workspace admission/executions for
|
|
113
|
+
* `effectiveOwner=service_host` workspaces ONLY — the same security
|
|
114
|
+
* contract as the shadow section applies (no payloads, no env values).
|
|
115
|
+
*/
|
|
116
|
+
readonly managed?: ManagedRunStatusSection;
|
|
87
117
|
readonly nextAction: string;
|
|
88
118
|
}
|
|
119
|
+
/** Persisted per-execution record inside the shadow section (task §10). */
|
|
120
|
+
export interface ShadowExecutionRecord {
|
|
121
|
+
/** The operator's requested --workspace argument (evidence, lexical form). */
|
|
122
|
+
readonly requestedDir: string;
|
|
123
|
+
/** Matched canonical discovery dir, or null when no authorized entry matched. */
|
|
124
|
+
readonly canonicalDir: string | null;
|
|
125
|
+
readonly hostKind: ShadowHostKind | null;
|
|
126
|
+
readonly admission: 'admitted' | 'refused';
|
|
127
|
+
readonly refusalReason?: string;
|
|
128
|
+
readonly refusalNextAction?: string;
|
|
129
|
+
/** §8.3/§10 workspace state — `process_started`/`cycle_completed`/business_progress stay strictly distinct in `execution`. */
|
|
130
|
+
readonly workspaceState: 'completed' | 'paused' | 'degraded' | 'failed' | 'unavailable';
|
|
131
|
+
/** Final carried-forward progress timestamp (this cycle or previous run; task §6). */
|
|
132
|
+
readonly lastProgressAt: string | null;
|
|
133
|
+
readonly lastProgressSource: 'task_state_change' | 'cycle_evidence' | 'previous_run' | null;
|
|
134
|
+
/** Full adapter contract result (subset-persisted fields only, no env values). */
|
|
135
|
+
readonly execution?: AdapterCycleResult;
|
|
136
|
+
}
|
|
137
|
+
export interface ShadowRunStatusSection {
|
|
138
|
+
readonly requestedWorkspaces: readonly string[];
|
|
139
|
+
readonly hostFilter?: ShadowHostKind;
|
|
140
|
+
readonly perWorkspaceTimeoutMs: number;
|
|
141
|
+
/**
|
|
142
|
+
* Health of the cross-run progress projection read at run start (F6):
|
|
143
|
+
* `missing` = no store yet; `corrupt`/`unreadable` degrade to "no previous
|
|
144
|
+
* progress" observably instead of silently.
|
|
145
|
+
*/
|
|
146
|
+
readonly progressCarryVerdict: 'ok' | 'missing' | 'corrupt' | 'unreadable';
|
|
147
|
+
readonly executions: readonly ShadowExecutionRecord[];
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Phase 3 managed-run per-workspace record (task §4 admission matrix). A
|
|
151
|
+
* workspace is either executed (service_host_owned + authorized + bound
|
|
152
|
+
* adapter) or skipped with a structured reason — legacy workspaces keep
|
|
153
|
+
* their legacy owner, transition states are never consumed.
|
|
154
|
+
*
|
|
155
|
+
* PRI-1282 Phase 4 (additive, still v1): `hostKind` widens to include
|
|
156
|
+
* `openclaw` — a managed execution may now be driven by the OpenClaw worker
|
|
157
|
+
* adapter after the workspace's §8.4 handover. Shadow records stay on the
|
|
158
|
+
* narrow codex|workbuddy set.
|
|
159
|
+
*/
|
|
160
|
+
export interface ManagedExecutionRecord {
|
|
161
|
+
readonly canonicalDir: string;
|
|
162
|
+
readonly hostKind: WorkerHostKind | null;
|
|
163
|
+
/** `executed` = a real Worker cycle ran for this workspace. */
|
|
164
|
+
readonly admission: 'executed' | 'skipped';
|
|
165
|
+
/** Structured skip reason (skipped records only): owner state, authorization, adapter or budget. */
|
|
166
|
+
readonly skipReason?: string;
|
|
167
|
+
readonly skipNextAction?: string;
|
|
168
|
+
readonly workspaceState: 'completed' | 'paused' | 'degraded' | 'failed' | 'unavailable';
|
|
169
|
+
readonly lastProgressAt: string | null;
|
|
170
|
+
readonly lastProgressSource: 'task_state_change' | 'cycle_evidence' | 'previous_run' | null;
|
|
171
|
+
readonly execution?: AdapterCycleResult;
|
|
172
|
+
}
|
|
173
|
+
export interface ManagedRunStatusSection {
|
|
174
|
+
readonly triggerSource: ServiceRunTriggerSource;
|
|
175
|
+
readonly perWorkspaceTimeoutMs: number;
|
|
176
|
+
readonly progressCarryVerdict: 'ok' | 'missing' | 'corrupt' | 'unreadable';
|
|
177
|
+
/**
|
|
178
|
+
* Set when NO workspace was in the service_host_owned state this run —
|
|
179
|
+
* the legal empty execution (task §4): no Worker started, nothing failed.
|
|
180
|
+
*/
|
|
181
|
+
readonly emptyReason?: 'no_service_host_owned_workspaces';
|
|
182
|
+
readonly executions: readonly ManagedExecutionRecord[];
|
|
183
|
+
}
|
|
89
184
|
export declare function serviceRunStatusPath(pdHome: string): string;
|
|
185
|
+
export type ServiceRunStatusRead = {
|
|
186
|
+
readonly ok: true;
|
|
187
|
+
readonly status: ServiceRunStatus;
|
|
188
|
+
} | {
|
|
189
|
+
readonly ok: false;
|
|
190
|
+
readonly verdict: 'missing' | 'unreadable' | 'corrupt';
|
|
191
|
+
readonly detail?: string;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Read the latest persisted run-once status (Phase 3 `pd service status`).
|
|
195
|
+
* The file is UNTRUSTED runtime data (rc-1): missing / unreadable /
|
|
196
|
+
* unparsable / non-conforming stay distinct (rc-3) — a corrupt status file
|
|
197
|
+
* is `corrupt`, never "no run ever happened".
|
|
198
|
+
*/
|
|
199
|
+
export declare function readServiceRunStatus(pdHome: string): ServiceRunStatusRead;
|
|
90
200
|
/**
|
|
91
201
|
* Read the active release record (`<pdHome>/active.json`) against the ONE
|
|
92
202
|
* authoritative schema in `@principles/install-layout` (P1-3): a record is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-run-status.d.ts","sourceRoot":"","sources":["../../../../src/services/service-host/status/service-run-status.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":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hF"}
|
|
@@ -31,6 +31,43 @@ const STATUS_FILE_NAME = 'run-once-status.json';
|
|
|
31
31
|
export function serviceRunStatusPath(pdHome) {
|
|
32
32
|
return path.join(pdHome, STATUS_DIR_NAME, STATUS_FILE_NAME);
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Read the latest persisted run-once status (Phase 3 `pd service status`).
|
|
36
|
+
* The file is UNTRUSTED runtime data (rc-1): missing / unreadable /
|
|
37
|
+
* unparsable / non-conforming stay distinct (rc-3) — a corrupt status file
|
|
38
|
+
* is `corrupt`, never "no run ever happened".
|
|
39
|
+
*/
|
|
40
|
+
export function readServiceRunStatus(pdHome) {
|
|
41
|
+
const file = serviceRunStatusPath(pdHome);
|
|
42
|
+
let raw;
|
|
43
|
+
try {
|
|
44
|
+
raw = fs.readFileSync(file, 'utf8');
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const { code } = error;
|
|
48
|
+
if (code === 'ENOENT')
|
|
49
|
+
return { ok: false, verdict: 'missing' };
|
|
50
|
+
return { ok: false, verdict: 'unreadable', detail: code ?? 'read_failed' };
|
|
51
|
+
}
|
|
52
|
+
let parsed;
|
|
53
|
+
try {
|
|
54
|
+
parsed = JSON.parse(raw);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
return { ok: false, verdict: 'corrupt', detail: error instanceof Error ? error.message.slice(0, 120) : 'unparsable' };
|
|
58
|
+
}
|
|
59
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
60
|
+
return { ok: false, verdict: 'corrupt', detail: 'not_an_object' };
|
|
61
|
+
}
|
|
62
|
+
const doc = parsed;
|
|
63
|
+
if (!Object.hasOwn(doc, 'schemaVersion') || doc.schemaVersion !== SERVICE_RUN_STATUS_SCHEMA_VERSION
|
|
64
|
+
|| !Object.hasOwn(doc, 'runId') || typeof doc.runId !== 'string'
|
|
65
|
+
|| !Object.hasOwn(doc, 'outcome') || (doc.outcome !== 'completed' && doc.outcome !== 'already_running' && doc.outcome !== 'refused' && doc.outcome !== 'failed')
|
|
66
|
+
|| !Object.hasOwn(doc, 'triggerSource') || (doc.triggerSource !== 'manual' && doc.triggerSource !== 'scheduler')) {
|
|
67
|
+
return { ok: false, verdict: 'corrupt', detail: 'schema_mismatch' };
|
|
68
|
+
}
|
|
69
|
+
return { ok: true, status: parsed };
|
|
70
|
+
}
|
|
34
71
|
/** Maximum persisted length of any reason string (rc-8 bounded output). */
|
|
35
72
|
const MAX_REASON = 300;
|
|
36
73
|
/** Re-bound an already-discovery-bounded reason defensively before persisting. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-run-status.js","sourceRoot":"","sources":["../../../../src/services/service-host/status/service-run-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAmC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"service-run-status.js","sourceRoot":"","sources":["../../../../src/services/service-host/status/service-run-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAmC,MAAM,4BAA4B,CAAC;AAKtG,MAAM,CAAC,MAAM,iCAAiC,GAAG,0BAA0B,CAAC;AAyM5E,MAAM,eAAe,GAAG,SAAS,CAAC;AAClC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEhD,MAAM,UAAU,oBAAoB,CAAC,MAAc;IACjD,OAAO,IAAI,CAAC,IAAI,C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EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC5B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC;YACH,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACnC,CAAC;QAAC,MAAM,CAAC;YACP,2CAA2C;QAC7C,CAAC;QACD,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,+BAA+B,iBAAiB,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE;YAChF,UAAU,EAAE,6FAA6F;SAC1G,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-adapter-codex.d.ts","sourceRoot":"","sources":["../../../src/services/service-host/worker-adapter-codex.ts"],"names":[],"mappings":"AAoDA,wBAAgB,wBAAwB,gDAuBvC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex Worker Adapter (SPEC §11 Phase 2, task §4).
|
|
3
|
+
*
|
|
4
|
+
* Wraps the EXISTING bounded Codex cycle — `pd codex worker --once --json
|
|
5
|
+
* --workspace <dir>` — behind the unified Worker Adapter contract. The
|
|
6
|
+
* adapter only invokes and normalizes; every business behavior (catch-up,
|
|
7
|
+
* reconciliation, Diagnostician lease/runner, post-processing continuation,
|
|
8
|
+
* downstream consumer cycle, Stage-2, retention) stays in the Codex worker
|
|
9
|
+
* and the shared execution layer. Liveness facts come from the existing
|
|
10
|
+
* `.state/codex-worker-liveness.json` (written by the worker cycle itself),
|
|
11
|
+
* preserving the Companion's stall attribution contract untouched.
|
|
12
|
+
*/
|
|
13
|
+
import { readCodexWorkerLiveness } from '@principles/codex-adapter';
|
|
14
|
+
import { createOnceCliWorkerAdapter, readReportCount, readReportEvidence, readReportSection, } from './worker-adapter.js';
|
|
15
|
+
function isPlainRecordLoose(value) {
|
|
16
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Sum the persisted-row counts of a parsed Codex catch-up report (F5):
|
|
20
|
+
* `report.catchUp.rollouts[] → outcome{status:'ok', inserted, enriched}`.
|
|
21
|
+
* R4 review fix: BOTH counters are persisted progress — `enriched` is a
|
|
22
|
+
* successful replay that completed an EXISTING trajectory with no new row
|
|
23
|
+
* (a session whose live trail only needed transcript catch-up evidence).
|
|
24
|
+
* `duplicates` stays excluded: re-ingesting already-persisted rows is no
|
|
25
|
+
* progress. Non-'ok' outcomes (degraded/skipped) and absent/malformed
|
|
26
|
+
* fields count 0.
|
|
27
|
+
*/
|
|
28
|
+
function countCodexCatchUpPersisted(parsed) {
|
|
29
|
+
const catchUp = readReportSection(parsed, 'catchUp');
|
|
30
|
+
if (catchUp === null)
|
|
31
|
+
return 0;
|
|
32
|
+
const { rollouts } = catchUp;
|
|
33
|
+
if (!Array.isArray(rollouts))
|
|
34
|
+
return 0;
|
|
35
|
+
let persisted = 0;
|
|
36
|
+
for (const rollout of rollouts) {
|
|
37
|
+
if (!isPlainRecordLoose(rollout))
|
|
38
|
+
continue;
|
|
39
|
+
const { outcome } = rollout;
|
|
40
|
+
if (!isPlainRecordLoose(outcome))
|
|
41
|
+
continue;
|
|
42
|
+
if (outcome.status !== 'ok')
|
|
43
|
+
continue;
|
|
44
|
+
const { inserted, enriched } = outcome;
|
|
45
|
+
if (typeof inserted === 'number' && Number.isFinite(inserted) && inserted > 0)
|
|
46
|
+
persisted += inserted;
|
|
47
|
+
if (typeof enriched === 'number' && Number.isFinite(enriched) && enriched > 0)
|
|
48
|
+
persisted += enriched;
|
|
49
|
+
}
|
|
50
|
+
return persisted;
|
|
51
|
+
}
|
|
52
|
+
export function createCodexWorkerAdapter() {
|
|
53
|
+
return createOnceCliWorkerAdapter({
|
|
54
|
+
hostKind: 'codex',
|
|
55
|
+
livenessFileName: 'codex-worker-liveness.json',
|
|
56
|
+
readLiveness: readCodexWorkerLiveness,
|
|
57
|
+
extractCycleEvidence(parsed) {
|
|
58
|
+
const base = readReportEvidence(parsed);
|
|
59
|
+
return {
|
|
60
|
+
...base,
|
|
61
|
+
// Codex post-processing continuation: resumed task ids are actual
|
|
62
|
+
// resumed work (guarded array-length read).
|
|
63
|
+
postProcessingResumed: readReportCount(parsed, 'postProcessing', 'resumedTaskIds'),
|
|
64
|
+
// F5 review fix: a Codex catch-up rollout entry records a CHECKED
|
|
65
|
+
// session, not a write — re-examining an already-synced session
|
|
66
|
+
// still yields an entry (replay outcome `{status:'ok', inserted:0}`).
|
|
67
|
+
// R4 review fix: `enriched` (existing trajectory completed from the
|
|
68
|
+
// transcript) is real persisted progress alongside `inserted`;
|
|
69
|
+
// duplicate-only results stay excluded. Everything else is guarded
|
|
70
|
+
// as zero (rc-4: element-level validation on the parsed array).
|
|
71
|
+
catchUpProcessed: countCodexCatchUpPersisted(parsed),
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=worker-adapter-codex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-adapter-codex.js","sourceRoot":"","sources":["../../../src/services/service-host/worker-adapter-codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,kBAAkB,EA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OAAO,0BAA0B,CAAC;QAChC,QAAQ,EAAE,OAAO;QACjB,gBAAgB,EAAE,4BAA4B;QAC9C,YAAY,EAAE,uBAAuB;QACrC,oBAAoB,CAAC,MAAM;YACzB,MAAM,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;YACxC,OAAO;gBACL,GAAG,IAAI;gBACP,kEAAkE;gBAClE,4CAA4C;gBAC5C,qBAAqB,EAAE,eAAe,CAAC,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,CAAC;gBAClF,kEAAkE;gBAClE,gEAAgE;gBAChE,sEAAsE;gBACtE,oEAAoE;gBACpE,+DAA+D;gBAC/D,mEAAmE;gBACnE,gEAAgE;gBAChE,gBAAgB,EAAE,0BAA0B,CAAC,MAAM,CAAC;aACrD,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-adapter-openclaw.d.ts","sourceRoot":"","sources":["../../../src/services/service-host/worker-adapter-openclaw.ts"],"names":[],"mappings":"AAiCA,wBAAgB,2BAA2B,gDAmB1C"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenClaw Worker Adapter (SPEC-PD-SERVICE-HOST-001 §11 Phase 4, PRI-1282).
|
|
3
|
+
*
|
|
4
|
+
* Wraps the bounded OpenClaw worker cycle — `pd openclaw worker --once --json
|
|
5
|
+
* --workspace <dir>` — behind the unified Worker Adapter contract. The
|
|
6
|
+
* adapter only invokes and normalizes; every business behavior (ownership
|
|
7
|
+
* gate, declaration refresh, diagnostician, downstream consumer cycle,
|
|
8
|
+
* liveness) stays in the OpenClaw worker (the `principles-disciple` package
|
|
9
|
+
* that also ships the Gateway plugin). MANAGED dispatch only — Phase 2
|
|
10
|
+
* shadow keeps the codex|workbuddy host set (instruction §8.5: adding
|
|
11
|
+
* openclaw to the global list would let shadow-run execute OpenClaw).
|
|
12
|
+
*/
|
|
13
|
+
import * as fs from 'node:fs';
|
|
14
|
+
import * as path from 'node:path';
|
|
15
|
+
import { createOnceCliWorkerAdapter, readReportEvidence, } from './worker-adapter.js';
|
|
16
|
+
function isJsonObject(value) {
|
|
17
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
18
|
+
}
|
|
19
|
+
function readOpenClawLivenessFile(workspaceDir) {
|
|
20
|
+
try {
|
|
21
|
+
const file = path.join(path.resolve(workspaceDir), '.state', 'openclaw-worker-liveness.json');
|
|
22
|
+
const parsed = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
23
|
+
return isJsonObject(parsed) ? parsed : null;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function createOpenClawWorkerAdapter() {
|
|
30
|
+
return createOnceCliWorkerAdapter({
|
|
31
|
+
hostKind: 'openclaw',
|
|
32
|
+
livenessFileName: 'openclaw-worker-liveness.json',
|
|
33
|
+
// The OpenClaw worker (plugin package) owns the writer; the adapter reads
|
|
34
|
+
// the same per-workspace liveness file the codex / workbuddy adapters do.
|
|
35
|
+
readLiveness: readOpenClawLivenessFile,
|
|
36
|
+
extractCycleEvidence(parsed) {
|
|
37
|
+
const base = readReportEvidence(parsed);
|
|
38
|
+
// The OpenClaw report has no catch-up / post-processing continuations —
|
|
39
|
+
// evidence is diagnostician + downstream only, exactly what the shared
|
|
40
|
+
// reader extracts.
|
|
41
|
+
return {
|
|
42
|
+
...base,
|
|
43
|
+
postProcessingResumed: 0,
|
|
44
|
+
catchUpProcessed: 0,
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=worker-adapter-openclaw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-adapter-openclaw.js","sourceRoot":"","sources":["../../../src/services/service-host/worker-adapter-openclaw.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;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{"version":3,"file":"worker-adapter-workbuddy.d.ts","sourceRoot":"","sources":["../../../src/services/service-host/worker-adapter-workbuddy.ts"],"names":[],"mappings":"AAyBA,wBAAgB,4BAA4B,gDAc3C"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkBuddy Worker Adapter (SPEC §11 Phase 2, task §5).
|
|
3
|
+
*
|
|
4
|
+
* Wraps the EXISTING bounded WorkBuddy cycle — `pd workbuddy worker --once
|
|
5
|
+
* --json --workspace <dir>` — behind the unified Worker Adapter contract.
|
|
6
|
+
* The adapter only invokes and normalizes; catch-up, reconciliation, the
|
|
7
|
+
* local candidate pick, the downstream consumer cycle and Stage-2 stay in
|
|
8
|
+
* the WorkBuddy worker. Cycle-level liveness now exists as
|
|
9
|
+
* `.state/workbuddy-worker-liveness.json` (shipped with this change — before
|
|
10
|
+
* it, WorkBuddy had NO liveness record and FR-10 was undecidable).
|
|
11
|
+
*
|
|
12
|
+
* Known, RECORDED parity gap (task §5 / TD §2.3, not fixed here): the
|
|
13
|
+
* WorkBuddy worker picks candidates with a local pending-first selector —
|
|
14
|
+
* retry_wait tasks can starve under sustained pending pressure. This does
|
|
15
|
+
* not block the Phase 2 minimal hookup, but Codex/WorkBuddy parity is NOT
|
|
16
|
+
* complete until the fair-share selector is adopted (follow-up recorded on
|
|
17
|
+
* PRI-1280).
|
|
18
|
+
*/
|
|
19
|
+
import { readWorkbuddyWorkerLiveness } from '@principles/workbuddy-adapter';
|
|
20
|
+
import { createOnceCliWorkerAdapter, readReportCount, readReportEvidence, } from './worker-adapter.js';
|
|
21
|
+
export function createWorkbuddyWorkerAdapter() {
|
|
22
|
+
return createOnceCliWorkerAdapter({
|
|
23
|
+
hostKind: 'workbuddy',
|
|
24
|
+
livenessFileName: 'workbuddy-worker-liveness.json',
|
|
25
|
+
readLiveness: readWorkbuddyWorkerLiveness,
|
|
26
|
+
extractCycleEvidence(parsed) {
|
|
27
|
+
const base = readReportEvidence(parsed);
|
|
28
|
+
return {
|
|
29
|
+
...base,
|
|
30
|
+
postProcessingResumed: 0, // WorkBuddy has no post-processing continuation step (asymmetry §3.1)
|
|
31
|
+
catchUpProcessed: readReportCount(parsed, 'catchUp', 'ingested'),
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=worker-adapter-workbuddy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-adapter-workbuddy.js","sourceRoot":"","sources":["../../../src/services/service-host/worker-adapter-workbuddy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,UAAU,4BAA4B;IAC1C,OAAO,0BAA0B,CAAC;QAChC,QAAQ,EAAE,WAAW;QACrB,gBAAgB,EAAE,gCAAgC;QAClD,YAAY,EAAE,2BAA2B;QACzC,oBAAoB,CAAC,MAAM;YACzB,MAAM,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;YACxC,OAAO;gBACL,GAAG,IAAI;gBACP,qBAAqB,EAAE,CAAC,EAAE,sEAAsE;gBAChG,gBAAgB,EAAE,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC;aACjE,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import type { InstallIdentity } from './install-identity.js';
|
|
2
|
+
import type { ActiveReleaseFacts } from './status/service-run-status.js';
|
|
3
|
+
import type { WorkspaceDiscoveryVerdict } from './workspace-discovery.js';
|
|
4
|
+
import { type WorkerEnvironmentReport } from './worker-env.js';
|
|
5
|
+
import { type WorkerProcessOptions, type WorkerProcessResult } from './worker-process.js';
|
|
6
|
+
import { readTaskProgressSnapshot } from './progress-evidence.js';
|
|
7
|
+
export declare const WORKER_ADAPTER_CONTRACT_VERSION = "pd.worker-adapter.v1";
|
|
8
|
+
export type WorkerHostKind = 'codex' | 'workbuddy' | 'openclaw';
|
|
9
|
+
/**
|
|
10
|
+
* The Phase 2 SHADOW host set — deliberately WITHOUT openclaw (instruction
|
|
11
|
+
* §8.5): shadow-run drives real cycles, and OpenClaw workspaces must only be
|
|
12
|
+
* driven by the managed path after their §8.4 handover. Extending shadow to
|
|
13
|
+
* OpenClaw would let `--shadow --host openclaw` consume a legacy-owned
|
|
14
|
+
* workspace next to the Gateway AutoConsumer.
|
|
15
|
+
*/
|
|
16
|
+
export declare const WORKER_HOST_KINDS: readonly WorkerHostKind[];
|
|
17
|
+
/** Shadow-mode surfaces (host filter, execution records) use this narrow set. */
|
|
18
|
+
export type ShadowHostKind = (typeof WORKER_HOST_KINDS)[number];
|
|
19
|
+
/**
|
|
20
|
+
* The MANAGED host set (PRI-1282 Phase 4): every host whose worker the
|
|
21
|
+
* coordinator may drive for a `service_host_owned` workspace — OpenClaw
|
|
22
|
+
* joins here, where the ownership admission gate is the only entry.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MANAGED_WORKER_HOST_KINDS: readonly WorkerHostKind[];
|
|
25
|
+
export interface WorkspaceDescriptor {
|
|
26
|
+
/** Canonical (realpath-preferred) absolute workspace dir. */
|
|
27
|
+
readonly canonicalDir: string;
|
|
28
|
+
readonly discoveryVerdict: WorkspaceDiscoveryVerdict;
|
|
29
|
+
/** Hosts whose VALIDATED claims (source B) name this workspace. */
|
|
30
|
+
readonly claimingHosts: readonly string[];
|
|
31
|
+
/** Hosts with a persisted host-tool declaration (`.pd/host-tool-semantics/<host>.json`). */
|
|
32
|
+
readonly declaredHostKinds: readonly WorkerHostKind[];
|
|
33
|
+
}
|
|
34
|
+
export type AdapterSupport = {
|
|
35
|
+
readonly supported: true;
|
|
36
|
+
} | {
|
|
37
|
+
readonly supported: false;
|
|
38
|
+
readonly reason: string;
|
|
39
|
+
readonly nextAction: string;
|
|
40
|
+
};
|
|
41
|
+
export type AdapterCycleOutcome = 'cycle_completed' | 'cycle_completed_without_business_progress' | 'paused' | 'degraded' | 'failed' | 'timeout' | 'cancelled' | 'unavailable';
|
|
42
|
+
export interface BusinessProgressEvidence {
|
|
43
|
+
/** A task was created or transitioned status in the workspace state store. */
|
|
44
|
+
readonly taskStateChanged: boolean;
|
|
45
|
+
readonly changedTaskCount: number;
|
|
46
|
+
readonly diagnosticianSucceeded: boolean;
|
|
47
|
+
readonly downstreamRan: boolean;
|
|
48
|
+
readonly postProcessingResumed: number;
|
|
49
|
+
readonly catchUpProcessed: number;
|
|
50
|
+
/** False when the pre/post task snapshots could not be read (rc-9). */
|
|
51
|
+
readonly evidenceReadable: boolean;
|
|
52
|
+
readonly evidenceReason?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface AdapterCycleHealth {
|
|
55
|
+
readonly livenessFile: string;
|
|
56
|
+
readonly livenessRecorded: boolean;
|
|
57
|
+
readonly lastCycleDriver: string | null;
|
|
58
|
+
readonly lastCycleCompletedAt: string | null;
|
|
59
|
+
readonly lastCycleMode: string | null;
|
|
60
|
+
readonly runningStage: string | null;
|
|
61
|
+
/**
|
|
62
|
+
* The invocation id the worker recorded in its liveness file (F13, TD §5.2
|
|
63
|
+
* 显式传入 invocationId): when the worker ran under this adapter the value
|
|
64
|
+
* equals `invocationId`, closing the correlation loop between the
|
|
65
|
+
* coordinator-side id and the shared liveness record.
|
|
66
|
+
*/
|
|
67
|
+
readonly lastInvocationId: string | null;
|
|
68
|
+
}
|
|
69
|
+
export interface AdapterCycleResult {
|
|
70
|
+
readonly hostKind: WorkerHostKind;
|
|
71
|
+
readonly adapterVersion: typeof WORKER_ADAPTER_CONTRACT_VERSION;
|
|
72
|
+
readonly workspaceDir: string;
|
|
73
|
+
readonly invocationId: string;
|
|
74
|
+
readonly cycleOutcome: AdapterCycleOutcome;
|
|
75
|
+
readonly reason?: string;
|
|
76
|
+
readonly nextAction?: string;
|
|
77
|
+
/** THIS cycle's evidenced progress timestamp; null = none this cycle (task §6). */
|
|
78
|
+
readonly lastProgressAt: string | null;
|
|
79
|
+
readonly businessProgress: BusinessProgressEvidence;
|
|
80
|
+
readonly health: AdapterCycleHealth;
|
|
81
|
+
readonly startedAt: string;
|
|
82
|
+
readonly completedAt: string;
|
|
83
|
+
readonly durationMs: number;
|
|
84
|
+
readonly worker: {
|
|
85
|
+
readonly cliEntry: string;
|
|
86
|
+
readonly cliEntrySource: 'canonical' | 'legacy';
|
|
87
|
+
readonly exitCode: number | null;
|
|
88
|
+
readonly termSignal: string | null;
|
|
89
|
+
readonly timedOut: boolean;
|
|
90
|
+
readonly cancelled: boolean;
|
|
91
|
+
readonly stdoutTruncated: boolean;
|
|
92
|
+
readonly stderrTail?: string;
|
|
93
|
+
/** Settled before the child's stdio fully drained (leaked descendant pipes). */
|
|
94
|
+
readonly closePending?: boolean;
|
|
95
|
+
readonly environmentReport: WorkerEnvironmentReport;
|
|
96
|
+
};
|
|
97
|
+
/** Worker mode when the CLI result parsed ('ready' | 'paused' | 'degraded'). */
|
|
98
|
+
readonly workerMode?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface WorkerAdapterExecuteInput {
|
|
101
|
+
readonly workspaceDir: string;
|
|
102
|
+
readonly activeRelease: ActiveReleaseFacts;
|
|
103
|
+
readonly invocationId: string;
|
|
104
|
+
readonly timeoutMs: number;
|
|
105
|
+
/**
|
|
106
|
+
* Absolute MONOTONIC deadline (a `performance.now()` timestamp, ms) shared
|
|
107
|
+
* by every adapter bound to this workspace (P1-01 final-remediation
|
|
108
|
+
* review): the whole adapter path — entry resolution, config/env build,
|
|
109
|
+
* pre/post snapshots and the subprocess run — lives inside this one
|
|
110
|
+
* budget, not just the child's run time. When omitted the adapter derives
|
|
111
|
+
* one from `timeoutMs`. It is never persisted or used as wall clock.
|
|
112
|
+
*/
|
|
113
|
+
readonly deadlineAtMs?: number;
|
|
114
|
+
readonly signal?: AbortSignal;
|
|
115
|
+
readonly identity: InstallIdentity;
|
|
116
|
+
/** Environment the allowlist is applied to (default: process.env). */
|
|
117
|
+
readonly inheritedEnv?: Readonly<Record<string, string | undefined>>;
|
|
118
|
+
readonly probes?: WorkerAdapterProbes;
|
|
119
|
+
}
|
|
120
|
+
export interface WorkerAdapterProbes {
|
|
121
|
+
/** Subprocess boundary injection (unit tests). */
|
|
122
|
+
readonly spawnWorkerProcess?: (options: WorkerProcessOptions) => Promise<WorkerProcessResult>;
|
|
123
|
+
/**
|
|
124
|
+
* CLI-entry resolution injection (integration tests point at a built dev
|
|
125
|
+
* tree; production ALWAYS uses the active-release install, task §7.4).
|
|
126
|
+
*/
|
|
127
|
+
readonly resolveCliEntry?: typeof resolveActiveReleaseCliEntry;
|
|
128
|
+
readonly now?: () => Date;
|
|
129
|
+
/**
|
|
130
|
+
* Task-progress snapshot read injection (P1-02 deadline/I-O boundary
|
|
131
|
+
* tests). Production ALWAYS uses the real store reader.
|
|
132
|
+
*/
|
|
133
|
+
readonly readTaskProgressSnapshot?: typeof readTaskProgressSnapshot;
|
|
134
|
+
}
|
|
135
|
+
export interface WorkerAdapter {
|
|
136
|
+
readonly hostKind: WorkerHostKind;
|
|
137
|
+
readonly adapterVersion: typeof WORKER_ADAPTER_CONTRACT_VERSION;
|
|
138
|
+
supports(descriptor: WorkspaceDescriptor): AdapterSupport;
|
|
139
|
+
executeOnce(input: WorkerAdapterExecuteInput): Promise<AdapterCycleResult>;
|
|
140
|
+
}
|
|
141
|
+
/** Per-host differences inside the shared once-CLI adapter implementation. */
|
|
142
|
+
export interface CliWorkerHostConfig {
|
|
143
|
+
readonly hostKind: WorkerHostKind;
|
|
144
|
+
readonly livenessFileName: string;
|
|
145
|
+
/** Existing per-host liveness reader (Codex today; WorkBuddy ships with this change). */
|
|
146
|
+
readLiveness(workspaceDir: string): Record<string, unknown> | null;
|
|
147
|
+
/** Extract corroborating evidence from the parsed cycle report (guarded per field). */
|
|
148
|
+
extractCycleEvidence(parsed: Record<string, unknown>): Omit<BusinessProgressEvidence, 'taskStateChanged' | 'changedTaskCount' | 'evidenceReadable' | 'evidenceReason'>;
|
|
149
|
+
}
|
|
150
|
+
/** Resolution of the active-release CLI entry (discriminated by `kind`). */
|
|
151
|
+
export type ActiveReleaseCliEntry = {
|
|
152
|
+
readonly kind: 'entry';
|
|
153
|
+
readonly entry: string;
|
|
154
|
+
readonly source: 'canonical' | 'legacy';
|
|
155
|
+
} | {
|
|
156
|
+
readonly kind: 'missing';
|
|
157
|
+
readonly reason: string;
|
|
158
|
+
readonly nextAction: string;
|
|
159
|
+
};
|
|
160
|
+
/** Resolve the ACTIVE RELEASE CLI entry — canonical runtime first, legacy extension fallback. */
|
|
161
|
+
export declare function resolveActiveReleaseCliEntry(identity: InstallIdentity): ActiveReleaseCliEntry;
|
|
162
|
+
export declare function sanitizeWorkerText(value: string, max?: number): string;
|
|
163
|
+
/**
|
|
164
|
+
* Extract the credential variable NAMES the workspace's effective runtime
|
|
165
|
+
* config actually uses (`apiKeyEnv` on each runtime profile — F4 review
|
|
166
|
+
* fix). Read-only: an invalid/unreadable config yields an empty list (the
|
|
167
|
+
* worker will report the config problem itself); a valid config yields the
|
|
168
|
+
* exact names `resolveProviderApiKey` will read from the child env. Names
|
|
169
|
+
* are defensively validated and pointer names can never be re-admitted.
|
|
170
|
+
*/
|
|
171
|
+
export declare function readConfigCredentialEnvNames(workspaceDir: string): readonly string[];
|
|
172
|
+
/**
|
|
173
|
+
* The shared once-CLI adapter implementation: build the allowlist env, run
|
|
174
|
+
* the bounded child, diff task progress, read liveness, normalize. Both
|
|
175
|
+
* host adapters are thin configurations of this one implementation — the
|
|
176
|
+
* Worker invocation protocol is shared, only evidence shapes differ.
|
|
177
|
+
*/
|
|
178
|
+
export declare function createOnceCliWorkerAdapter(config: CliWorkerHostConfig): WorkerAdapter;
|
|
179
|
+
/** Guarded report-evidence readers shared by the host adapter configs. */
|
|
180
|
+
export declare function readReportSection(parsed: Record<string, unknown>, section: string): Record<string, unknown> | null;
|
|
181
|
+
export declare function readReportEvidence(parsed: Record<string, unknown>): {
|
|
182
|
+
diagnosticianSucceeded: boolean;
|
|
183
|
+
downstreamRan: boolean;
|
|
184
|
+
};
|
|
185
|
+
/** Array-field length (e.g. postProcessing.resumedTaskIds, catchUp.rollouts) or numeric count (catchUp.ingested). */
|
|
186
|
+
export declare function readReportCount(parsed: Record<string, unknown>, section: string, key: string): number;
|
|
187
|
+
//# sourceMappingURL=worker-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-adapter.d.ts","sourceRoot":"","sources":["../../../src/services/service-host/worker-adapter.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAmD,KAAK,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAChH,OAAO,EAAoB,KAAK,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,EAEL,wBAAwB,EAEzB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,+BAA+B,yBAAyB,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,CAAC;AAChE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAA2B,CAAC;AACnF,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,cAAc,EAAuC,CAAC;AAEvG,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,QAAQ,CAA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