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
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service Host scheduler bridge (PRI-1281 Phase 3, task ยง6).
|
|
3
|
+
*
|
|
4
|
+
* The installer NEVER re-implements scheduler lifecycle logic โ it invokes
|
|
5
|
+
* the JUST-INSTALLED pd CLI (`<pdHome>/runtime/pd-cli/dist/index.js service
|
|
6
|
+
* โฆ --json --pd-home <pdHome>`), so `pd service install|enable|status|
|
|
7
|
+
* uninstall` stays the single implementation (one source of truth).
|
|
8
|
+
*
|
|
9
|
+
* Contract:
|
|
10
|
+
* - the spawned CLI receives a CLEANED environment: PD_EXPERIMENT_ROOT and
|
|
11
|
+
* PD_WORKSPACE_DIR never reach it โ the trusted pdHome is passed
|
|
12
|
+
* explicitly (task ยง6.3, never inferred from an untrusted HOME);
|
|
13
|
+
* - every failure is a structured warning for the caller to surface โ the
|
|
14
|
+
* install/update transaction is ALREADY committed at this point, so a
|
|
15
|
+
* bridge failure must never turn a committed install into a reported
|
|
16
|
+
* failure (ERR-197);
|
|
17
|
+
* - no credentials are ever passed โ arguments are paths and subcommand
|
|
18
|
+
* names only.
|
|
19
|
+
*/
|
|
20
|
+
import { spawn } from 'node:child_process';
|
|
21
|
+
import * as fs from 'node:fs';
|
|
22
|
+
import * as path from 'node:path';
|
|
23
|
+
/** Env vars that must never steer the spawned CLI's install identity. */
|
|
24
|
+
const STRIPPED_ENV_KEYS = ['PD_EXPERIMENT_ROOT', 'PD_WORKSPACE_DIR'];
|
|
25
|
+
const BRIDGE_TIMEOUT_MS = 120_000;
|
|
26
|
+
const MAX_STDOUT_BYTES = 64 * 1024;
|
|
27
|
+
const MAX_STDERR_BYTES = 16 * 1024;
|
|
28
|
+
function cleanedEnv() {
|
|
29
|
+
const env = { ...process.env };
|
|
30
|
+
for (const key of STRIPPED_ENV_KEYS) {
|
|
31
|
+
delete env[key];
|
|
32
|
+
}
|
|
33
|
+
return env;
|
|
34
|
+
}
|
|
35
|
+
function spawnCli(entry, args, spawnFn = spawn) {
|
|
36
|
+
return new Promise((resolve) => {
|
|
37
|
+
let stdout = '';
|
|
38
|
+
let stderr = '';
|
|
39
|
+
let stdoutBytes = 0;
|
|
40
|
+
let stderrBytes = 0;
|
|
41
|
+
let settled = false;
|
|
42
|
+
let timedOut = false;
|
|
43
|
+
let child;
|
|
44
|
+
const timer = setTimeout(() => {
|
|
45
|
+
timedOut = true;
|
|
46
|
+
try {
|
|
47
|
+
child.kill();
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// exit handler settles
|
|
51
|
+
}
|
|
52
|
+
}, BRIDGE_TIMEOUT_MS);
|
|
53
|
+
const settle = (outcome) => {
|
|
54
|
+
if (settled)
|
|
55
|
+
return;
|
|
56
|
+
settled = true;
|
|
57
|
+
clearTimeout(timer);
|
|
58
|
+
resolve(outcome);
|
|
59
|
+
};
|
|
60
|
+
try {
|
|
61
|
+
child = spawnFn(process.execPath, [entry, ...args], {
|
|
62
|
+
env: cleanedEnv(),
|
|
63
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
64
|
+
windowsHide: true,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
69
|
+
settle({ code: null, stdout: '', stderr: '', spawnError: message });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
child.on('error', (error) => {
|
|
73
|
+
settle({ code: null, stdout: '', stderr: '', spawnError: error.code ?? error.message });
|
|
74
|
+
});
|
|
75
|
+
child.stdout?.on('data', (chunk) => {
|
|
76
|
+
if (stdoutBytes < MAX_STDOUT_BYTES) {
|
|
77
|
+
stdout += chunk.toString('utf8');
|
|
78
|
+
stdoutBytes += chunk.length;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
child.stderr?.on('data', (chunk) => {
|
|
82
|
+
if (stderrBytes < MAX_STDERR_BYTES) {
|
|
83
|
+
stderr += chunk.toString('utf8');
|
|
84
|
+
stderrBytes += chunk.length;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
child.on('close', (code) => {
|
|
88
|
+
settle({ code, stdout, stderr, ...(timedOut ? { timedOut: true } : {}) });
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** Run one `pd service <subcommand>` lifecycle call against the installed CLI. */
|
|
93
|
+
export async function runServiceHostCli(pdHome, args, probes = {}) {
|
|
94
|
+
// args = ['service', '<op>', ...] โ the operation is the second token.
|
|
95
|
+
const op = args[1] ?? '';
|
|
96
|
+
const entry = path.join(pdHome, 'runtime', 'pd-cli', 'dist', 'index.js');
|
|
97
|
+
if (!fs.existsSync(entry)) {
|
|
98
|
+
return {
|
|
99
|
+
ok: false,
|
|
100
|
+
detail: `service_host_cli_entry_missing:${entry}`,
|
|
101
|
+
nextAction: 'The pd CLI is not present in the runtime โ nothing was registered; run `pd service install` manually after repairing the install.',
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
// `--pd-home` carries the HOME ROOT โ the CLI derives <home>/.pd itself,
|
|
105
|
+
// so passing pdHome would resolve to <home>/.pd/.pd. For the canonical
|
|
106
|
+
// layout getPdDir() IS <home>/.pd, hence dirname.
|
|
107
|
+
const outcome = await spawnCli(entry, [...args, '--json', '--pd-home', path.dirname(pdHome)], probes.spawnFn);
|
|
108
|
+
if (outcome.timedOut === true) {
|
|
109
|
+
return {
|
|
110
|
+
ok: false,
|
|
111
|
+
detail: 'service_host_cli_timeout',
|
|
112
|
+
nextAction: `pd service ${op} call did not finish in ${BRIDGE_TIMEOUT_MS / 1000}s; retry it manually โ every operation is idempotent.`,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (outcome.spawnError !== undefined) {
|
|
116
|
+
return {
|
|
117
|
+
ok: false,
|
|
118
|
+
detail: `service_host_cli_spawn_failed:${outcome.spawnError}`,
|
|
119
|
+
nextAction: 'The installed pd CLI could not be started; run the pd service command manually later (operations are idempotent).',
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
// cli-1 (task ยง1 review): stdout must be EXACTLY ONE JSON document โ
|
|
123
|
+
// the whole trimmed stdout is parsed; a log line before/after the JSON,
|
|
124
|
+
// a truncated document, or an empty stdout all fail closed and are never
|
|
125
|
+
// interpreted as "scheduler not registered". Failure classes stay
|
|
126
|
+
// distinct: process failure (exit/timeout/spawn) vs JSON-parse failure
|
|
127
|
+
// vs schema violation.
|
|
128
|
+
const stdoutDoc = outcome.stdout.trim();
|
|
129
|
+
if (stdoutDoc === '') {
|
|
130
|
+
return {
|
|
131
|
+
ok: false,
|
|
132
|
+
detail: `service_host_cli_no_json:exit_${outcome.code ?? 'null'}`,
|
|
133
|
+
nextAction: `pd service ${op} produced no machine-readable output (exit ${outcome.code ?? 'n/a'}${outcome.stderr.trim() !== '' ? `; ${outcome.stderr.trim().slice(0, 160)}` : ''}); inspect it manually.`,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
let parsed;
|
|
137
|
+
try {
|
|
138
|
+
parsed = JSON.parse(stdoutDoc);
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return {
|
|
142
|
+
ok: false,
|
|
143
|
+
detail: `service_host_cli_unparsable_json:exit_${outcome.code ?? 'null'}`,
|
|
144
|
+
nextAction: `pd service ${op} stdout was not a single JSON document (log-mixed or truncated output is refused, exit ${outcome.code ?? 'n/a'}); run it manually to see the full output.`,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
148
|
+
return {
|
|
149
|
+
ok: false,
|
|
150
|
+
detail: 'service_host_cli_schema_violation:top_level',
|
|
151
|
+
nextAction: `pd service ${op} emitted JSON that is not an object; run it manually to see the full output.`,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
const doc = parsed;
|
|
155
|
+
if (op === 'status') {
|
|
156
|
+
const { scheduler } = doc;
|
|
157
|
+
const registered = typeof scheduler === 'object' && scheduler !== null && Object.hasOwn(scheduler, 'registered') &&
|
|
158
|
+
(typeof scheduler.registered === 'boolean' || scheduler.registered === null)
|
|
159
|
+
? scheduler.registered
|
|
160
|
+
: null;
|
|
161
|
+
const intervalMs = typeof scheduler === 'object' && scheduler !== null &&
|
|
162
|
+
typeof scheduler.triggerConfiguration === 'object' &&
|
|
163
|
+
scheduler.triggerConfiguration !== null
|
|
164
|
+
? (scheduler.triggerConfiguration.intervalMs ?? null)
|
|
165
|
+
: null;
|
|
166
|
+
if (outcome.code === 0 && doc.schemaVersion === 'pd.service-status.v1') {
|
|
167
|
+
return { ok: true, detail: 'ok', registered, triggerIntervalMs: typeof intervalMs === 'number' ? intervalMs : null };
|
|
168
|
+
}
|
|
169
|
+
const reason = typeof doc.reason === 'string' ? doc.reason : `exit_${outcome.code ?? 'null'}`;
|
|
170
|
+
if (outcome.code === 0 && doc.schemaVersion !== 'pd.service-status.v1') {
|
|
171
|
+
return {
|
|
172
|
+
ok: false,
|
|
173
|
+
detail: `service_host_cli_schema_violation:schema_version`,
|
|
174
|
+
nextAction: `pd service status emitted a document with an unknown schemaVersion (${typeof doc.schemaVersion === 'string' ? doc.schemaVersion : 'missing'}); the scheduler state is unknown โ nothing was changed. Inspect it manually.`,
|
|
175
|
+
registered,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
ok: false,
|
|
180
|
+
detail: `service_host_status_failed:${reason}`,
|
|
181
|
+
nextAction: 'pd service status did not succeed; the scheduler registration state is unknown โ nothing was changed. Inspect it manually.',
|
|
182
|
+
registered,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
if (typeof doc.ok !== 'boolean') {
|
|
186
|
+
return {
|
|
187
|
+
ok: false,
|
|
188
|
+
detail: 'service_host_cli_schema_violation:ok_field',
|
|
189
|
+
nextAction: `pd service ${op} emitted a document without a boolean \`ok\` field; the operation state is unknown โ inspect it manually.`,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
if (outcome.code === 0 && doc.ok === true) {
|
|
193
|
+
return { ok: true, detail: 'ok' };
|
|
194
|
+
}
|
|
195
|
+
const reason = typeof doc.reason === 'string' ? doc.reason : `exit_${outcome.code ?? 'null'}`;
|
|
196
|
+
return {
|
|
197
|
+
ok: false,
|
|
198
|
+
detail: `service_host_cli_refused:${reason}`,
|
|
199
|
+
nextAction: `pd service ${op} did not succeed (${reason}); nothing was silently skipped โ retry it manually after fixing the cause.`,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Cheap platform file probe: could a PD scheduler registration exist at all?
|
|
204
|
+
* Used to SKIP the CLI status probe entirely on machines where nothing was
|
|
205
|
+
* ever registered โ a full CLI boot per install() otherwise accumulates into
|
|
206
|
+
* minutes across install-heavy flows (CI observed at the 15m job timeout).
|
|
207
|
+
* Name prefixes only (no install-key duplication โ the key stays owned by
|
|
208
|
+
* pd-cli's schedulerIdentityFor).
|
|
209
|
+
*/
|
|
210
|
+
export function maybeSchedulerRegistrationExists(homeDir) {
|
|
211
|
+
try {
|
|
212
|
+
if (process.platform === 'win32') {
|
|
213
|
+
// existsSync: a missing dir/file is a clean false โ nothing was ever registered.
|
|
214
|
+
return fs.existsSync(path.join(homeDir, '.pd', 'service', 'scheduler-registration-win.xml'));
|
|
215
|
+
}
|
|
216
|
+
if (process.platform === 'darwin') {
|
|
217
|
+
const agents = path.join(homeDir, 'Library', 'LaunchAgents');
|
|
218
|
+
return fs.readdirSync(agents).some((name) => name.startsWith('com.principles-disciple.service-host.') && name.endsWith('.plist'));
|
|
219
|
+
}
|
|
220
|
+
if (process.platform === 'linux') {
|
|
221
|
+
const units = path.join(homeDir, '.config', 'systemd', 'user');
|
|
222
|
+
return fs.readdirSync(units).some((name) => name.startsWith('pd-service-host-') && name.endsWith('.timer'));
|
|
223
|
+
}
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
// A MISSING directory proves "never registered" cleanly (the common
|
|
228
|
+
// fresh-install case); anything else (permissions) keeps the honest
|
|
229
|
+
// (slower) path: ask the CLI.
|
|
230
|
+
const { code } = error;
|
|
231
|
+
if (code === 'ENOENT')
|
|
232
|
+
return false;
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Post-install scheduler reconciliation (task ยง6). Runs AFTER the install
|
|
238
|
+
* transaction committed, so every failure is a WARNING โ a bridge failure
|
|
239
|
+
* must never turn a committed install into a reported failure (ERR-197).
|
|
240
|
+
*
|
|
241
|
+
* - consent given: register (default disabled), then optionally enable;
|
|
242
|
+
* - no consent: REFRESH-IF-REGISTERED only โ an existing registration is
|
|
243
|
+
* re-installed idempotently (entry refresh, enabled state PRESERVED), and
|
|
244
|
+
* a machine with no registration gets NOTHING silently created.
|
|
245
|
+
*/
|
|
246
|
+
export async function reconcileServiceHostScheduler(input) {
|
|
247
|
+
if (input.registerServiceHost) {
|
|
248
|
+
const install = await runServiceHostCli(input.pdHome, ['service', 'install'], input.probes ?? {});
|
|
249
|
+
if (!install.ok) {
|
|
250
|
+
input.warn(`Service Host scheduler registration failed (${install.detail}). ${install.nextAction ?? ''}`.trim());
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
input.info?.('Service Host scheduler registered (disabled by default โ enable with `pd service enable`).');
|
|
254
|
+
if (input.enableServiceHost) {
|
|
255
|
+
const enable = await runServiceHostCli(input.pdHome, ['service', 'enable'], input.probes ?? {});
|
|
256
|
+
if (!enable.ok) {
|
|
257
|
+
input.warn(`Service Host scheduler ENABLE failed (${enable.detail}) โ the registration exists but stays DISABLED. ${enable.nextAction ?? ''}`.trim());
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
input.info?.('Service Host scheduler enabled โ automatic managed runs are armed.');
|
|
261
|
+
}
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
// Upgrade path: refresh only when a registration plausibly exists. The
|
|
265
|
+
// file probe avoids a full CLI boot per install on machines where nothing
|
|
266
|
+
// was ever registered (CI/fresh installs); an unreadable dir falls back to
|
|
267
|
+
// asking the CLI.
|
|
268
|
+
if (!maybeSchedulerRegistrationExists(path.dirname(input.pdHome))) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const status = await runServiceHostCli(input.pdHome, ['service', 'status'], input.probes ?? {});
|
|
272
|
+
if (!status.ok) {
|
|
273
|
+
input.warn(`Service Host scheduler state could not be verified after install (${status.detail}) โ nothing was changed. ${status.nextAction ?? ''}`.trim());
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (status.registered === true) {
|
|
277
|
+
// Refresh preserves the existing registration config (task ยง15): the
|
|
278
|
+
// interval comes from the live status document โ an UNREADABLE interval
|
|
279
|
+
// fails closed (a silent default would quietly reset a custom cadence).
|
|
280
|
+
if (status.triggerIntervalMs === undefined || status.triggerIntervalMs === null) {
|
|
281
|
+
input.warn('Service Host scheduler refresh refused: the registered trigger interval could not be read from pd service status โ the existing registration was KEPT unchanged. Re-run pd service status and repair the registration first.');
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
const refresh = await runServiceHostCli(input.pdHome, ['service', 'install', '--interval-ms', String(status.triggerIntervalMs)], input.probes ?? {});
|
|
285
|
+
if (!refresh.ok) {
|
|
286
|
+
input.warn(`Service Host scheduler refresh failed (${refresh.detail}) โ the last valid registration was KEPT. ${refresh.nextAction ?? ''}`.trim());
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
input.info?.(`Service Host scheduler registration refreshed to the active release (interval ${status.triggerIntervalMs}ms and enabled state preserved).`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=service-host-bridge.js.map
|
|
@@ -20,8 +20,10 @@
|
|
|
20
20
|
import * as fs from 'node:fs';
|
|
21
21
|
import * as path from 'node:path';
|
|
22
22
|
import * as crypto from 'node:crypto';
|
|
23
|
+
import { atomicReplaceTextFile } from '../utils/config-file-io.js';
|
|
23
24
|
import { parseProductVersion, ProductIdentityError, isReleaseChannelName } from './product-identity.js';
|
|
24
25
|
import { normalizeReleaseMetadataUrl } from './release-metadata-source.js';
|
|
26
|
+
import * as installLayoutModule from '@principles/install-layout';
|
|
25
27
|
export function resolvePdHomePaths(pdHome) {
|
|
26
28
|
const home = path.resolve(pdHome);
|
|
27
29
|
return {
|
|
@@ -206,24 +208,49 @@ export function readInstallJsonRecord(filePath) {
|
|
|
206
208
|
* disk; only an explicit value overwrites it. There is no programmatic way to
|
|
207
209
|
* clear the field โ clearing is an installer-level decision.
|
|
208
210
|
*/
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
211
|
+
/**
|
|
212
|
+
* Shared lock discipline for install.json writers: LOUD failure, never a
|
|
213
|
+
* silent unlocked fallback โ an unlocked write is exactly the ERR-168
|
|
214
|
+
* clobber the lock exists to prevent.
|
|
215
|
+
*
|
|
216
|
+
* A missing lock export is an incompatible runtime cohort and fails closed;
|
|
217
|
+
* no caller may downgrade to an unlocked write of the shared ownership manifest.
|
|
218
|
+
*/
|
|
219
|
+
function runUnderManifestWriteLock(options, fn) {
|
|
220
|
+
const lock = installLayoutModule.withInstallManifestWriteLock;
|
|
221
|
+
if (typeof lock !== 'function') {
|
|
222
|
+
throw new InstallLayoutError('install.json', `install_manifest_lock_unavailable (${options.operation}): the installed @principles/install-layout does not expose the shared manifest lock; no write was performed. Update the installer/runtime cohort and retry.`);
|
|
218
223
|
}
|
|
219
|
-
|
|
220
|
-
|
|
224
|
+
const result = lock(options, fn);
|
|
225
|
+
if (!result.ok) {
|
|
226
|
+
throw new InstallLayoutError('install.json', `could not acquire the install manifest write lock (${options.operation}): ${result.message}`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
export function writeInstallConfig(paths, config) {
|
|
230
|
+
// ERR-168 / PRI-1282: this file also carries the per-Workspace ownership
|
|
231
|
+
// records written under the ยง8.4 CAS lock โ take the same physical lock so
|
|
232
|
+
// a config write can never interleave with (and clobber) a transition.
|
|
233
|
+
runUnderManifestWriteLock({ manifestPath: paths.installConfigPath, operation: 'update.writeInstallConfig', context: paths.home }, () => {
|
|
234
|
+
const existing = readInstallJsonRecord(paths.installConfigPath);
|
|
235
|
+
const payload = {
|
|
236
|
+
...(existing ?? {}),
|
|
237
|
+
channel: config.channel,
|
|
238
|
+
autoCheck: config.autoCheck,
|
|
239
|
+
};
|
|
240
|
+
if (config.releaseMetadataUrl !== undefined) {
|
|
241
|
+
payload.releaseMetadataUrl = config.releaseMetadataUrl;
|
|
242
|
+
}
|
|
243
|
+
fs.mkdirSync(paths.home, { recursive: true });
|
|
244
|
+
atomicReplaceTextFile(paths.installConfigPath, `${JSON.stringify(payload, null, 2)}\n`);
|
|
245
|
+
});
|
|
221
246
|
}
|
|
222
247
|
/** Field-level merge for writers that do not own the whole record. */
|
|
223
248
|
export function mergeIntoInstallJson(filePath, patch) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
249
|
+
runUnderManifestWriteLock({ manifestPath: filePath, operation: 'update.mergeIntoInstallJson', context: path.dirname(filePath) }, () => {
|
|
250
|
+
const existing = readInstallJsonRecord(filePath);
|
|
251
|
+
const payload = { ...(existing ?? {}), ...patch };
|
|
252
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
253
|
+
atomicReplaceTextFile(filePath, `${JSON.stringify(payload, null, 2)}\n`);
|
|
254
|
+
});
|
|
228
255
|
}
|
|
229
256
|
//# sourceMappingURL=install-layout.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-principles-disciple",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.155.1",
|
|
4
4
|
"description": "Interactive CLI installer for Principles Disciple OpenClaw plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -100,6 +100,6 @@
|
|
|
100
100
|
"directory": "packages/create-principles-disciple"
|
|
101
101
|
},
|
|
102
102
|
"pd": {
|
|
103
|
-
"bundledPluginVersion": "4.1
|
|
103
|
+
"bundledPluginVersion": "4.2.1"
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -13,5 +13,5 @@ export { resolveWorkbuddyWorkspace, type WorkbuddyWorkspaceResolution, } from '.
|
|
|
13
13
|
export { WORKBUDDY_TOOL_SEMANTICS, WORKBUDDY_TOOL_SEMANTIC_MAPPINGS, } from './tool-semantics.js';
|
|
14
14
|
export { recordWorkbuddyPromptDeliveryEvidence, recordWorkbuddyDenyEvidence, workbuddyCapabilityDeclarations, WORKBUDDY_EVIDENCE_ADAPTER_VERSION, } from './workbuddy-evidence-recorder.js';
|
|
15
15
|
export { processWorkbuddyHookInvocation, annotateContextWarnings, type WorkBuddyPdHookResult, } from './pd-hook.js';
|
|
16
|
-
export { runWorkbuddyWorkspaceWorkerCycle, type WorkbuddyWorkerCycleResult, type WorkbuddyWorkerCycleOptions, type WorkbuddyWorkerCycleStepReport, type WorkbuddyWorkerMode, } from './worker/workspace-worker.js';
|
|
16
|
+
export { runWorkbuddyWorkspaceWorkerCycle, readWorkbuddyWorkerLiveness, workbuddyWorkerCycleDriver, type WorkbuddyWorkerCycleResult, type WorkbuddyWorkerCycleOptions, type WorkbuddyWorkerCycleStepReport, type WorkbuddyWorkerMode, } from './worker/workspace-worker.js';
|
|
17
17
|
export { encodeWorkbuddyCwd, deriveWorkbuddyTranscriptPath, validateWorkbuddyTranscriptPath, workbuddyProjectsRoot, resolveWorkbuddyProjectsRoot, decodeWorkbuddyTranscriptWindow, createWorkbuddyTranscriptSource, WORKBUDDY_SINGLE_SESSION_ALERT_BYTES, type WorkbuddyTranscriptFileIdentity, type WorkbuddyTranscriptPathValidation, type DecodedWorkbuddyDelta, type DecodeWorkbuddyWindowInput, type WorkbuddyTranscriptSourceContext, ingestWorkbuddyConversation, workbuddyIngestionHints, catchUpWorkbuddyIngestion, locateWorkbuddyTranscriptBySessionIdentity, type WorkbuddyIngestionOptions, type WorkbuddyIngestionOutcome, type WorkbuddyCatchUpOptions, type WorkbuddyCatchUpResult, } from './ingestion/index.js';
|
|
@@ -13,5 +13,5 @@ export { resolveWorkbuddyWorkspace, } from './workspace-resolution.js';
|
|
|
13
13
|
export { WORKBUDDY_TOOL_SEMANTICS, WORKBUDDY_TOOL_SEMANTIC_MAPPINGS, } from './tool-semantics.js';
|
|
14
14
|
export { recordWorkbuddyPromptDeliveryEvidence, recordWorkbuddyDenyEvidence, workbuddyCapabilityDeclarations, WORKBUDDY_EVIDENCE_ADAPTER_VERSION, } from './workbuddy-evidence-recorder.js';
|
|
15
15
|
export { processWorkbuddyHookInvocation, annotateContextWarnings, } from './pd-hook.js';
|
|
16
|
-
export { runWorkbuddyWorkspaceWorkerCycle, } from './worker/workspace-worker.js';
|
|
16
|
+
export { runWorkbuddyWorkspaceWorkerCycle, readWorkbuddyWorkerLiveness, workbuddyWorkerCycleDriver, } from './worker/workspace-worker.js';
|
|
17
17
|
export { encodeWorkbuddyCwd, deriveWorkbuddyTranscriptPath, validateWorkbuddyTranscriptPath, workbuddyProjectsRoot, resolveWorkbuddyProjectsRoot, decodeWorkbuddyTranscriptWindow, createWorkbuddyTranscriptSource, WORKBUDDY_SINGLE_SESSION_ALERT_BYTES, ingestWorkbuddyConversation, workbuddyIngestionHints, catchUpWorkbuddyIngestion, locateWorkbuddyTranscriptBySessionIdentity, } from './ingestion/index.js';
|
|
@@ -41,6 +41,13 @@ export interface WorkbuddyWorkerCycleOptions {
|
|
|
41
41
|
readonly stage2Classifier?: SignalLlmClassifier | null;
|
|
42
42
|
readonly stage2AggregateBudgetMs?: number;
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* WHO drove this cycle โ same attribution contract as the Codex worker
|
|
46
|
+
* (PRI-1264 + Phase 2 `service_host` driver identity, TD ยง5.2).
|
|
47
|
+
*/
|
|
48
|
+
export declare function workbuddyWorkerCycleDriver(): 'companion' | 'service_host' | 'manual';
|
|
49
|
+
/** Read the persisted liveness record, or null when absent/unreadable. */
|
|
50
|
+
export declare function readWorkbuddyWorkerLiveness(workspaceDir: string): Record<string, unknown> | null;
|
|
44
51
|
/**
|
|
45
52
|
* Run ONE bounded worker cycle for a canonical governance workspace. Never
|
|
46
53
|
* throws: every failure becomes a structured degraded result with a
|