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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.3.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
export declare const GATEWAY_CONSUMER_LEASE_SCHEMA_VERSION = "pd.gateway-consumer-lease.v1";
|
|
2
|
+
export declare const GATEWAY_CONSUMER_LEASE_FILE = "gateway-consumer-lease.json";
|
|
3
|
+
export interface GatewayConsumerLeaseWriter {
|
|
4
|
+
token: string;
|
|
5
|
+
instanceId: string;
|
|
6
|
+
pid: number;
|
|
7
|
+
host: string;
|
|
8
|
+
state: 'consuming' | 'quiesced';
|
|
9
|
+
startedAt: string;
|
|
10
|
+
updatedAt: string;
|
|
11
|
+
}
|
|
12
|
+
export interface GatewayConsumerLease {
|
|
13
|
+
schemaVersion: string;
|
|
14
|
+
/** Identity of THIS consumer instance — one per process lifetime. */
|
|
15
|
+
token: string;
|
|
16
|
+
/**
|
|
17
|
+
* PRI-1282 review r4: per-INSTANCE identity. A Gateway restart (or a
|
|
18
|
+
* stop()/start() inside one process) mints a new instanceId — PID alone
|
|
19
|
+
* cannot distinguish two lifecycles of the same process, and a new
|
|
20
|
+
* instance must never be mistaken for (or allowed to clear) the old one.
|
|
21
|
+
*/
|
|
22
|
+
instanceId: string;
|
|
23
|
+
pid: number;
|
|
24
|
+
host: string;
|
|
25
|
+
workspaceDir: string;
|
|
26
|
+
/** 'consuming' while cycles may be scheduled; 'quiesced' after a clean drain. */
|
|
27
|
+
state: 'consuming' | 'quiesced';
|
|
28
|
+
startedAt: string;
|
|
29
|
+
updatedAt: string;
|
|
30
|
+
/**
|
|
31
|
+
* PRI-1282 review r5: EVERY writer that has published to this lease,
|
|
32
|
+
* keyed by instanceId (upserted per publish). A single top-level record
|
|
33
|
+
* can only name the last writer — a quiesce confirmation that only
|
|
34
|
+
* consults it is blind to an earlier writer still running a cycle.
|
|
35
|
+
* Liveness is judged per writer.
|
|
36
|
+
*/
|
|
37
|
+
writers?: GatewayConsumerLeaseWriter[];
|
|
38
|
+
}
|
|
39
|
+
/** Fresh identity for ONE consumer instance — minted per start(). */
|
|
40
|
+
export declare function gatewayConsumerLeaseToken(): string;
|
|
41
|
+
/** Fresh per-instance identity (PRI-1282 r4: PID is not an instance id). */
|
|
42
|
+
export declare function gatewayConsumerInstanceId(): string;
|
|
43
|
+
/**
|
|
44
|
+
* PID liveness with the same contract as service-run-lock: EPERM means the
|
|
45
|
+
* process exists (we just cannot signal it) → alive; ESRCH → dead; anything
|
|
46
|
+
* else is a platform answer we cannot classify → 'unknown' (fail-closed).
|
|
47
|
+
*/
|
|
48
|
+
export declare function processAliveProbe(pid: number): 'alive' | 'dead' | 'unknown';
|
|
49
|
+
export declare function parseGatewayConsumerLease(raw: unknown): GatewayConsumerLease | null;
|
|
50
|
+
/**
|
|
51
|
+
* Every writer recorded on the lease — the writers[] entries, or the
|
|
52
|
+
* top-level record for pre-r5 single-writer leases.
|
|
53
|
+
*/
|
|
54
|
+
export declare function leaseWriters(lease: GatewayConsumerLease): GatewayConsumerLeaseWriter[];
|
|
55
|
+
/** Read the lease; null on missing or unreadable/malformed content. */
|
|
56
|
+
export declare function readGatewayConsumerLease(workspaceDir: string): GatewayConsumerLease | null;
|
|
57
|
+
export declare function clearGatewayConsumerLease(workspaceDir: string, token: string, instanceId?: string): {
|
|
58
|
+
ok: true;
|
|
59
|
+
} | {
|
|
60
|
+
ok: false;
|
|
61
|
+
reason: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Cross-process arbitration gate for lease mutations: a SQLite
|
|
65
|
+
* `BEGIN IMMEDIATE` transaction on `<lease>.gate.db` (better-sqlite3 —
|
|
66
|
+
* same mechanism as the install-manifest CAS lock, dependency already
|
|
67
|
+
* shipped with the plugin). Every check-and-register / mark-and-observe
|
|
68
|
+
* decision runs inside the serialized section, so two Gateways can never
|
|
69
|
+
* interleave "I checked no other consumer" with "I registered myself".
|
|
70
|
+
*/
|
|
71
|
+
export interface ConsumerLeaseGateLike {
|
|
72
|
+
exec(sql: string): void;
|
|
73
|
+
close(): void;
|
|
74
|
+
}
|
|
75
|
+
export declare function withConsumerLeaseGate<T>(workspaceDir: string, fn: () => T, openGate?: (path: string) => ConsumerLeaseGateLike): {
|
|
76
|
+
ok: true;
|
|
77
|
+
value: T;
|
|
78
|
+
} | {
|
|
79
|
+
ok: false;
|
|
80
|
+
reason: string;
|
|
81
|
+
};
|
|
82
|
+
/** Every public lease mutation takes the workspace's cross-process gate. */
|
|
83
|
+
export declare function writeGatewayConsumerLease(input: {
|
|
84
|
+
workspaceDir: string;
|
|
85
|
+
token: string;
|
|
86
|
+
instanceId: string;
|
|
87
|
+
state: 'consuming' | 'quiesced';
|
|
88
|
+
now?: () => Date;
|
|
89
|
+
openGate?: (path: string) => ConsumerLeaseGateLike;
|
|
90
|
+
}): {
|
|
91
|
+
ok: true;
|
|
92
|
+
} | {
|
|
93
|
+
ok: false;
|
|
94
|
+
reason: string;
|
|
95
|
+
};
|
|
96
|
+
export type ConsumerLeaseRegistration = {
|
|
97
|
+
ok: true;
|
|
98
|
+
status: 'registered';
|
|
99
|
+
} | {
|
|
100
|
+
ok: true;
|
|
101
|
+
status: 'refused_foreign_alive' | 'refused_foreign_unknown';
|
|
102
|
+
} | {
|
|
103
|
+
ok: false;
|
|
104
|
+
reason: string;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Serialized "check foreign consumer → register ourselves" for consumer
|
|
108
|
+
* start (PRI-1282 review r6): without the gate, two Gateways can each pass
|
|
109
|
+
* the foreign check before either writes, land two 'consuming' records,
|
|
110
|
+
* and then wait on each other at quiesce forever.
|
|
111
|
+
*/
|
|
112
|
+
export declare function registerGatewayConsumerLease(input: {
|
|
113
|
+
workspaceDir: string;
|
|
114
|
+
token: string;
|
|
115
|
+
instanceId: string;
|
|
116
|
+
processAlive?: (pid: number) => 'alive' | 'dead' | 'unknown';
|
|
117
|
+
openGate?: (path: string) => ConsumerLeaseGateLike;
|
|
118
|
+
}): ConsumerLeaseRegistration;
|
|
119
|
+
export type ForeignConsumerLeaseStatus = 'alive' | 'none' | 'unknown';
|
|
120
|
+
/**
|
|
121
|
+
* Whether a DIFFERENT live process holds a consumer lease for this
|
|
122
|
+
* workspace — the arbitration input for quiesce-ACK honesty and restart
|
|
123
|
+
* resume (PRI-1282 P1-3):
|
|
124
|
+
* - 'alive': a lease exists, its owner is on this host, and its PID is
|
|
125
|
+
* provably alive — a foreign consumer may still be running;
|
|
126
|
+
* a fresh process MUST NOT claim the consumer stopped.
|
|
127
|
+
* - 'none': no lease, or its holder's PID is provably dead — the foreign
|
|
128
|
+
* consumer cannot be running.
|
|
129
|
+
* - 'unknown': lease unreadable/malformed, foreign host, or PID liveness
|
|
130
|
+
* undecidable — fail-closed: never ack "quiesced" on it.
|
|
131
|
+
*
|
|
132
|
+
* Process liveness and INSTANCE identity are judged separately (PRI-1282
|
|
133
|
+
* r4): a lease carrying THIS process's PID but a different instanceId/token
|
|
134
|
+
* is a DIFFERENT consumer (an older lifecycle of this process that may still
|
|
135
|
+
* have in-flight work) — it is 'alive', never 'none'. Only our own
|
|
136
|
+
* token/instanceId yields 'none' on a same-PID lease.
|
|
137
|
+
*/
|
|
138
|
+
export declare function foreignConsumerLeaseStatus(workspaceDir: string, opts?: {
|
|
139
|
+
processAlive?: (pid: number) => 'alive' | 'dead' | 'unknown';
|
|
140
|
+
selfToken?: string;
|
|
141
|
+
selfInstanceId?: string;
|
|
142
|
+
}): ForeignConsumerLeaseStatus;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const GATEWAY_QUIESCE_ACK_SCHEMA_VERSION = "pd.gateway-quiesce.v1";
|
|
2
|
+
export declare const GATEWAY_QUIESCE_ACK_FILE = "gateway-quiesce-ack.json";
|
|
3
|
+
export type GatewayQuiesceOutcome = 'quiesced' | 'in_flight_timeout';
|
|
4
|
+
export interface GatewayQuiesceAck {
|
|
5
|
+
schemaVersion: typeof GATEWAY_QUIESCE_ACK_SCHEMA_VERSION;
|
|
6
|
+
workspaceDir: string;
|
|
7
|
+
/** The blocking marker state the Gateway observed. */
|
|
8
|
+
state: 'handover_preparing' | 'service_host_owned' | 'rollback_pending';
|
|
9
|
+
/** Bound to the marker record — a stale ack is detectable, never trusted. */
|
|
10
|
+
operationId: string | null;
|
|
11
|
+
generation: number;
|
|
12
|
+
/** Must be 0 for a `quiesced` outcome. */
|
|
13
|
+
inFlightCycles: number;
|
|
14
|
+
outcome: GatewayQuiesceOutcome;
|
|
15
|
+
completedAt: string;
|
|
16
|
+
writer: {
|
|
17
|
+
hostKind: 'openclaw';
|
|
18
|
+
pid: number;
|
|
19
|
+
startedVia: 'timer_tick' | 'service_start';
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface WriteGatewayQuiesceAckInput {
|
|
23
|
+
workspaceDir: string;
|
|
24
|
+
state: GatewayQuiesceAck['state'];
|
|
25
|
+
operationId: string | null;
|
|
26
|
+
generation: number;
|
|
27
|
+
inFlightCycles: number;
|
|
28
|
+
outcome: GatewayQuiesceOutcome;
|
|
29
|
+
startedVia: GatewayQuiesceAck['writer']['startedVia'];
|
|
30
|
+
}
|
|
31
|
+
/** Write the ack atomically (O_EXCL temp + rename). Containment-checked. */
|
|
32
|
+
export declare function writeGatewayQuiesceAck(input: WriteGatewayQuiesceAckInput): {
|
|
33
|
+
ok: boolean;
|
|
34
|
+
reason?: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Read + validate the ack (rc-1/rc-2/rc-3: untrusted JSON until proven).
|
|
38
|
+
* `null` when absent/malformed — the handover treats null as "no evidence".
|
|
39
|
+
*/
|
|
40
|
+
export declare function readGatewayQuiesceAck(workspaceDir: string): GatewayQuiesceAck | null;
|
|
@@ -8,14 +8,80 @@
|
|
|
8
8
|
* implementation. This module keeps only what is genuinely OpenClaw-specific:
|
|
9
9
|
* the service lifecycle (timer chain per workspace), the OpenClaw tool
|
|
10
10
|
* catalog, the plugin logger, and SystemLogger event emission.
|
|
11
|
+
*
|
|
12
|
+
* PRI-1282 (Phase 4) — §8.4 ownership gate: the install manifest's
|
|
13
|
+
* `backgroundExecutions` record is the ONLY consumption authority for this
|
|
14
|
+
* service. The marker is read (a) before the service arms a workspace's
|
|
15
|
+
* timer chain, and (b) before EVERY tick; any state other than
|
|
16
|
+
* `legacy_owned` — including an UNREADABLE manifest — fails closed: no new
|
|
17
|
+
* consumption cycle starts. When a blocking state is observed the workspace
|
|
18
|
+
* quiesces: in-flight cycles are awaited (bounded), a persisted
|
|
19
|
+
* `pd.gateway-quiesce.v1` acknowledgment is written (the auditable "the old
|
|
20
|
+
* consumer stopped" evidence the handover command waits for), and the timer
|
|
21
|
+
* slot degrades into a slow ownership watch that re-arms normal consumption
|
|
22
|
+
* only when the marker returns to `legacy_owned` (rollback) — one timer
|
|
23
|
+
* chain per workspace at all times, never a second resident loop.
|
|
11
24
|
*/
|
|
12
25
|
import type { OpenClawPluginServiceContext, PluginLogger } from '../openclaw-sdk.js';
|
|
13
|
-
import { type InternalizationConsumerCycleOutcome } from '@principles/host-runtime';
|
|
26
|
+
import { type AdaptiveConsumerScheduleDecision, type InternalizationConsumerCycleOutcome } from '@principles/host-runtime';
|
|
27
|
+
/**
|
|
28
|
+
* PRI-1282 P1-3 + r4: identity of ONE consumer INSTANCE — minted fresh on
|
|
29
|
+
* every start(), not per process. The lease
|
|
30
|
+
* (<workspace>/.pd/gateway-consumer-lease.json) is the workspace-scoped
|
|
31
|
+
* liveness record that makes "a foreign Gateway consumer is alive"
|
|
32
|
+
* decidable across a Gateway restart: PID liveness alone cannot distinguish
|
|
33
|
+
* two lifecycles of the same process, so process liveness and instance
|
|
34
|
+
* identity are judged separately and a new instance never clears or claims
|
|
35
|
+
* the old instance's lease. Anything unverifiable fails closed.
|
|
36
|
+
*/
|
|
37
|
+
interface ConsumerIdentity {
|
|
38
|
+
readonly token: string;
|
|
39
|
+
readonly instanceId: string;
|
|
40
|
+
}
|
|
14
41
|
export interface InternalizationAutoConsumerServiceShape {
|
|
15
42
|
id: string;
|
|
16
43
|
start: (ctx: OpenClawPluginServiceContext) => void;
|
|
17
44
|
stop?: (ctx: OpenClawPluginServiceContext) => void;
|
|
18
45
|
}
|
|
46
|
+
interface WorkspaceConsumerState {
|
|
47
|
+
/** Immutable per-lifecycle identity of THIS workspace's consumer (r5). */
|
|
48
|
+
readonly identity: ConsumerIdentity;
|
|
49
|
+
stopped: boolean;
|
|
50
|
+
quiescing: boolean;
|
|
51
|
+
timeoutId: ReturnType<typeof setTimeout> | null;
|
|
52
|
+
/** The in-flight runCycle promise — quiesce waits for this (bounded). */
|
|
53
|
+
inFlight: Promise<void> | null;
|
|
54
|
+
/** Identity of the operation last acked (avoids duplicate acks while watching). */
|
|
55
|
+
ackedOperation: {
|
|
56
|
+
state: string;
|
|
57
|
+
operationId: string | null;
|
|
58
|
+
generation: number;
|
|
59
|
+
} | null;
|
|
60
|
+
/** Adaptive-scheduler inputs, owned by this workspace's timer chain only. */
|
|
61
|
+
consecutiveEmptyCycles: number;
|
|
62
|
+
consecutiveFailures: number;
|
|
63
|
+
lastCycleDurationMs: number | null;
|
|
64
|
+
lastDecision: AdaptiveConsumerScheduleDecision | null;
|
|
65
|
+
}
|
|
66
|
+
interface RetiredWorkspaceConsumerState {
|
|
67
|
+
readonly identity: ConsumerIdentity;
|
|
68
|
+
settled: boolean;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Deterministic test seams (PRI-1282 r4 §3.4): let lifecycle tests inject an
|
|
72
|
+
* in-flight cycle, shorten the drain bound, and read the live identity
|
|
73
|
+
* without monkey-patching node modules. Production never touches them.
|
|
74
|
+
*/
|
|
75
|
+
export declare const __autoConsumerTestSeams: {
|
|
76
|
+
workspaceStates: Map<string, WorkspaceConsumerState>;
|
|
77
|
+
drainingWorkspaceStates: Map<string, Map<string, RetiredWorkspaceConsumerState>>;
|
|
78
|
+
identity: (workspaceDir: string) => ConsumerIdentity;
|
|
79
|
+
getWorkspaceState: typeof getWorkspaceState;
|
|
80
|
+
injectInFlight(workspaceDir: string, inFlight: Promise<void> | null): void;
|
|
81
|
+
setStopDrainWaitMs(ms: number): void;
|
|
82
|
+
watchOwnership(workspaceDir: string, state: WorkspaceConsumerState, logger: PluginLogger): Promise<void>;
|
|
83
|
+
};
|
|
84
|
+
declare function getWorkspaceState(workspaceDir: string): WorkspaceConsumerState;
|
|
19
85
|
/**
|
|
20
86
|
* PRI-741 (review round): persist the OpenClaw tool declaration as workspace
|
|
21
87
|
* provenance — host-neutral consumers (pd-cli activation / run-once) load it
|
|
@@ -31,3 +97,4 @@ export declare function persistOpenClawToolDeclaration(workspaceDir: string, log
|
|
|
31
97
|
}): void;
|
|
32
98
|
export declare function runConsumerCycle(workspaceDir: string, logger: PluginLogger, onOutcome?: (outcome: InternalizationConsumerCycleOutcome) => void): Promise<void>;
|
|
33
99
|
export declare const InternalizationAutoConsumerService: InternalizationAutoConsumerServiceShape;
|
|
100
|
+
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.3.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true,
|
|
8
8
|
"onCapabilities": [
|
package/plugin/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "principles-disciple",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
"./governance-audit": {
|
|
18
18
|
"types": "./dist/governance-audit.d.ts",
|
|
19
19
|
"default": "./dist/governance-audit.js"
|
|
20
|
+
},
|
|
21
|
+
"./openclaw-worker": {
|
|
22
|
+
"types": "./dist/openclaw-worker.d.ts",
|
|
23
|
+
"default": "./dist/openclaw-worker.js"
|
|
20
24
|
}
|
|
21
25
|
},
|
|
22
26
|
"repository": {
|
|
@@ -13,13 +13,17 @@ import { checkOpenClawGateway, detectWorkspace, stopOpenClawGateway, restartOpen
|
|
|
13
13
|
import { t } from './i18n.js';
|
|
14
14
|
import { generateConfigYamlContent, ExistingConfigVerifyInfraError, validateExistingConfigYamlForPreserve, getConfigYamlPath, readEnabledChannelsFromConfigYaml, getCodexHomeDir, getOpenClawDir, getPdDir, getPdRuntimeDir, getInstallManifestPath, getPdRuntimeBackupsDir, getPluginExtDir, getInstalledPluginDir, getInstalledLayoutPackageDir, getPdBackupsDir, getInstalledPdCliDir, getInstalledBinDir, getInstalledConsoleDir, getHomeDir, isWindows, } from './mvp-config.js';
|
|
15
15
|
import { detectInstalledHosts, evaluateRecordedHostPresence, getHostInstallers, isRecordedHost } from './installers/index.js';
|
|
16
|
-
import { errnoCode } from './utils/config-file-io.js';
|
|
16
|
+
import { atomicReplaceTextFile, errnoCode } from './utils/config-file-io.js';
|
|
17
17
|
import { readCanonicalRuntimeCohort, readInstalledRuntimeCohort, resolvePluginDataRoot } from './installers/codex-host-installer.js';
|
|
18
18
|
import { runWorkbuddyEarlyPreflight } from './installers/workbuddy-host-installer.js';
|
|
19
19
|
import { findForeignWorkspaceOwner } from './utils/host-workspace-ownership.js';
|
|
20
20
|
import { INSTALL_LAYOUT_VERSION, getInstallLayoutPaths, getWorkbuddyWorkspaceDir, installManifestHostsForPersist, mergeInstallManifestWorkspaces, parseInstallManifest, resolvePdHome } from '@principles/install-layout';
|
|
21
|
+
// Namespace import keeps the shared lock capability check explicit at the
|
|
22
|
+
// write boundary; an incompatible older dependency cohort fails closed.
|
|
23
|
+
import * as installLayoutModule from '@principles/install-layout';
|
|
21
24
|
import { resolveMcpServerDir } from './mcp-server-layout-compat.js';
|
|
22
25
|
import { detectOpenClawMainWorkspaceDivergence } from './utils/workspace-divergence.js';
|
|
26
|
+
import { reconcileServiceHostScheduler } from './service-host-bridge.js';
|
|
23
27
|
import { applySkillLanguageSelection } from './skill-language.js';
|
|
24
28
|
import { parseReleaseAssetIdentity, parseReleaseAssetManifest, ReleaseAssetManifestError, verifyReleaseAssetManifestAsync, verifyReleaseAssetTarget, } from './update/release-asset-manifest.js';
|
|
25
29
|
import { parseEmbeddedProductIdentity, ProductIdentityError } from './update/product-identity.js';
|
|
@@ -254,42 +258,58 @@ export function planUpgradeHosts(requested, persistedHosts, detected) {
|
|
|
254
258
|
* the OD-07 governance workspace (~/.workbuddy/pd-workspace) is registered the
|
|
255
259
|
* same way — derived from install-layout, never hand-joined, never reused from
|
|
256
260
|
* another host's state.
|
|
261
|
+
*
|
|
262
|
+
* Merge the install's workspace registrations into a manifest read INSIDE
|
|
263
|
+
* the manifest write lock (PRI-1282 review, ERR-168 follow-up): computing
|
|
264
|
+
* the merge from a pre-lock read let an interleaved §8.4 ownership write be
|
|
265
|
+
* silently dropped — a handover that registered a workspace + its record
|
|
266
|
+
* between the read and the locked write lost the workspaces[] entry, making
|
|
267
|
+
* the manifest fail validation (ownership key not in the declared list).
|
|
257
268
|
*/
|
|
258
|
-
function
|
|
259
|
-
let current;
|
|
260
|
-
try {
|
|
261
|
-
current = JSON.parse(readFileSync(getInstallManifestPath(), 'utf8'));
|
|
262
|
-
}
|
|
263
|
-
catch (error) {
|
|
264
|
-
if (existsSync(getInstallManifestPath()))
|
|
265
|
-
throw error;
|
|
266
|
-
}
|
|
267
|
-
const parsed = parseInstallManifest(current);
|
|
268
|
-
if (current !== undefined && !parsed.manifest) {
|
|
269
|
-
throw new Error(parsed.error ?? 'install_manifest_malformed');
|
|
270
|
-
}
|
|
271
|
-
let workspaces = mergeInstallManifestWorkspaces(parsed.manifest, path.resolve(workspaceDir));
|
|
269
|
+
function mergeInstallManifestWorkspacesFor(current, workspaceDir, host) {
|
|
270
|
+
let workspaces = mergeInstallManifestWorkspaces(current, path.resolve(workspaceDir));
|
|
272
271
|
if (host === 'workbuddy') {
|
|
273
272
|
// Set-union via the same authority helper — order of existing entries is
|
|
274
273
|
// preserved, the governance dir is appended when absent (idempotent).
|
|
275
|
-
workspaces = mergeInstallManifestWorkspaces({ layoutVersion:
|
|
274
|
+
workspaces = mergeInstallManifestWorkspaces({ layoutVersion: current?.layoutVersion ?? INSTALL_LAYOUT_VERSION, mode: current?.mode ?? 'canonical', hosts: current?.hosts ?? [], workspaces }, getWorkbuddyWorkspaceDir(getHomeDir(), process.env.WORKBUDDY_CONFIG_DIR));
|
|
276
275
|
}
|
|
277
276
|
return workspaces;
|
|
278
277
|
}
|
|
279
|
-
function writeInstallManifest(
|
|
278
|
+
function writeInstallManifest(write) {
|
|
279
|
+
const manifestPath = getInstallManifestPath();
|
|
280
280
|
mkdirSync(getPdDir(), { recursive: true });
|
|
281
|
-
//
|
|
282
|
-
// writer
|
|
283
|
-
//
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
281
|
+
// install.json is shared with the update executor and the ownership CAS
|
|
282
|
+
// writer. A missing lock export is an incompatible runtime cohort, never
|
|
283
|
+
// permission to fall back to an unlocked read-modify-write.
|
|
284
|
+
const lock = installLayoutModule.withInstallManifestWriteLock;
|
|
285
|
+
if (typeof lock !== 'function') {
|
|
286
|
+
throw new Error('install_manifest_lock_unavailable: the installed @principles/install-layout does not expose the shared manifest lock; no write was performed. Update the installer/runtime cohort and retry.');
|
|
287
|
+
}
|
|
288
|
+
const writeRecord = () => {
|
|
289
|
+
const existing = readInstallJsonRecord(manifestPath);
|
|
290
|
+
const parsedCurrent = parseInstallManifest(existing);
|
|
291
|
+
if (existing !== undefined && !parsedCurrent.manifest) {
|
|
292
|
+
throw new Error(parsedCurrent.error ?? 'install_manifest_malformed');
|
|
293
|
+
}
|
|
294
|
+
const payload = {
|
|
295
|
+
...(existing ?? {}),
|
|
296
|
+
layoutVersion: 1,
|
|
297
|
+
mode: 'canonical',
|
|
298
|
+
hosts: [...(typeof write.hosts === 'function' ? write.hosts(parsedCurrent.manifest) : write.hosts)],
|
|
299
|
+
workspaces: [...write.workspaces(parsedCurrent.manifest)],
|
|
300
|
+
};
|
|
301
|
+
const revalidated = parseInstallManifest(payload);
|
|
302
|
+
if (!revalidated.manifest) {
|
|
303
|
+
throw new Error(`install_manifest_write_refused: ${revalidated.error ?? 'post-merge validation failed'}`);
|
|
304
|
+
}
|
|
305
|
+
// Same-directory flushed temp + atomic replace: readers see old or new JSON,
|
|
306
|
+
// never a truncated manifest if the installer is interrupted.
|
|
307
|
+
atomicReplaceTextFile(manifestPath, JSON.stringify(payload, null, 2) + '\n');
|
|
291
308
|
};
|
|
292
|
-
|
|
309
|
+
const locked = lock({ manifestPath, operation: 'installer.writeInstallManifest', context: getPdDir() }, writeRecord);
|
|
310
|
+
if (!locked.ok) {
|
|
311
|
+
throw new Error(`could not acquire the install manifest write lock (installer.writeInstallManifest): ${locked.message}`);
|
|
312
|
+
}
|
|
293
313
|
}
|
|
294
314
|
export function commitInstallerActiveRecord(journal) {
|
|
295
315
|
const paths = resolvePdHomePaths(getPdDir());
|
|
@@ -693,7 +713,13 @@ export function repairInstallManifestHosts(options = {}) {
|
|
|
693
713
|
const backupPath = path.join(getPdRuntimeBackupsDir(), `install-manifest.backup.${Date.now()}.json`);
|
|
694
714
|
mkdirSync(getPdRuntimeBackupsDir(), { recursive: true });
|
|
695
715
|
writeFileSync(backupPath, readFileSync(manifestPath));
|
|
696
|
-
|
|
716
|
+
// Hosts too are re-derived INSIDE the lock from the freshly-read manifest
|
|
717
|
+
// (persisted set minus the provably-absent entries), and workspaces are
|
|
718
|
+
// carried verbatim from the same locked read.
|
|
719
|
+
writeInstallManifest({
|
|
720
|
+
hosts: (current) => installManifestHostsForPersist(current).filter((host) => !removed.includes(host)),
|
|
721
|
+
workspaces: (current) => [...(current?.workspaces ?? [])],
|
|
722
|
+
});
|
|
697
723
|
return {
|
|
698
724
|
success: true,
|
|
699
725
|
applied: true,
|
|
@@ -5405,7 +5431,10 @@ transaction) {
|
|
|
5405
5431
|
// host's registration still points at it — the exact A3 hazard class
|
|
5406
5432
|
// this fix exists to close. Real install state remains file-based truth
|
|
5407
5433
|
// (checkInstallStatus / host detect()).
|
|
5408
|
-
writeInstallManifest(
|
|
5434
|
+
writeInstallManifest({
|
|
5435
|
+
hosts: installManifestHosts,
|
|
5436
|
+
workspaces: (current) => mergeInstallManifestWorkspacesFor(current, options.workspaceDir, options.host),
|
|
5437
|
+
});
|
|
5409
5438
|
// PRI-709 P0-1: persist the metadata source after the manifest write, so
|
|
5410
5439
|
// the durable tier cannot be clobbered by the same install.
|
|
5411
5440
|
persistReleaseMetadataSource();
|
|
@@ -5503,6 +5532,24 @@ transaction) {
|
|
|
5503
5532
|
logger.warn(`Could not record recovery resolution for ${pendingId} (alarm stays): ${resolutionError instanceof Error ? resolutionError.message : String(resolutionError)}`);
|
|
5504
5533
|
}
|
|
5505
5534
|
}
|
|
5535
|
+
// PRI-1281 Phase 3 (task §6): user-level OS scheduler reconciliation.
|
|
5536
|
+
// POST-COMMIT by design — the runtime transaction is already confirmed,
|
|
5537
|
+
// so every bridge failure is a WARNING, never a reported install failure
|
|
5538
|
+
// (ERR-197). Consent-gated registration; upgrades only refresh an
|
|
5539
|
+
// EXISTING registration (enabled state preserved) and never create one
|
|
5540
|
+
// silently. Identity comes from the installer's own authoritative pdHome.
|
|
5541
|
+
try {
|
|
5542
|
+
await reconcileServiceHostScheduler({
|
|
5543
|
+
pdHome: getPdDir(),
|
|
5544
|
+
registerServiceHost: options.enableServiceHost === true || options.registerServiceHost === true,
|
|
5545
|
+
enableServiceHost: options.enableServiceHost === true,
|
|
5546
|
+
warn: (message) => logger.warn(message),
|
|
5547
|
+
info: (message) => logger.info(message),
|
|
5548
|
+
});
|
|
5549
|
+
}
|
|
5550
|
+
catch (bridgeError) {
|
|
5551
|
+
logger.warn(`Service Host scheduler reconciliation threw (${bridgeError instanceof Error ? bridgeError.message : String(bridgeError)}) — the install itself is unaffected; run pd service status manually.`);
|
|
5552
|
+
}
|
|
5506
5553
|
if (spinner) {
|
|
5507
5554
|
// rc-9: the runtime transaction IS committed here, but a pending host
|
|
5508
5555
|
// manual action (e.g. the Codex Marketplace install) makes the run a
|
|
@@ -268,6 +268,37 @@ function readJsonObject(configPath) {
|
|
|
268
268
|
return { ok: false, reason: `not valid JSON: ${error instanceof Error ? error.message : String(error)}` };
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Classify an ALREADY-PARSED WorkBuddy `mcp.json` object — the exact mirror of
|
|
273
|
+
* `classifyOpenClawConfigObject`. The legacy-entry migration needs the verdict
|
|
274
|
+
* computed from the SAME bytes it parses, backs up and commits against; a
|
|
275
|
+
* second `checkMcpRegistrationConflict` read would judge ownership on a
|
|
276
|
+
* different snapshot than the write (concurrent-edit race, review 2026-11-22).
|
|
277
|
+
*/
|
|
278
|
+
export function classifyWorkbuddyMcpJsonObject(config, configPath, options = {}) {
|
|
279
|
+
const servers = config.mcpServers;
|
|
280
|
+
if (servers === undefined)
|
|
281
|
+
return { ok: true, host: 'workbuddy', configPath, state: 'absent' };
|
|
282
|
+
if (!isRecord(servers)) {
|
|
283
|
+
return {
|
|
284
|
+
ok: false,
|
|
285
|
+
host: 'workbuddy',
|
|
286
|
+
configPath,
|
|
287
|
+
kind: 'unverifiable',
|
|
288
|
+
reason: `mcp_registration_unverifiable: ${configPath} mcpServers is not an object. No PD write was performed.`,
|
|
289
|
+
nextAction: `Repair ${configPath} manually, then re-run the installer.`,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
if (Object.hasOwn(servers, PD_MCP_SERVER_NAME)) {
|
|
293
|
+
return classifyEntryPresence({ present: true, entry: servers[PD_MCP_SERVER_NAME], host: 'workbuddy', configPath, ownershipOptions: options });
|
|
294
|
+
}
|
|
295
|
+
return {
|
|
296
|
+
ok: true,
|
|
297
|
+
host: 'workbuddy',
|
|
298
|
+
configPath,
|
|
299
|
+
state: Object.keys(servers).length === 0 ? 'absent' : 'other_servers_only',
|
|
300
|
+
};
|
|
301
|
+
}
|
|
271
302
|
function classifyJsonHost(host, configPath, options = {}) {
|
|
272
303
|
const file = readJsonObject(configPath);
|
|
273
304
|
if (!file.ok) {
|
|
@@ -295,7 +326,9 @@ function classifyJsonHost(host, configPath, options = {}) {
|
|
|
295
326
|
nextAction: `Repair ${configPath} manually, then re-run the installer.`,
|
|
296
327
|
};
|
|
297
328
|
}
|
|
298
|
-
|
|
329
|
+
if (host === 'workbuddy')
|
|
330
|
+
return classifyWorkbuddyMcpJsonObject(root, configPath, options);
|
|
331
|
+
const { servers } = root;
|
|
299
332
|
if (servers === undefined)
|
|
300
333
|
return { ok: true, host, configPath, state: 'absent' };
|
|
301
334
|
if (!isRecord(servers)) {
|