pi-daddy 0.28.0 → 0.32.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/CHANGELOG.md +108 -124
- package/README.md +18 -896
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/contracts/ledger-record/v1/README.md +44 -0
- package/contracts/ledger-record/v1/fixtures/child-lifecycle.json +45 -0
- package/contracts/ledger-record/v1/fixtures/ledger-record.jsonl +3 -0
- package/contracts/ledger-record/v1/governance-event.schema.json +747 -0
- package/contracts/ledger-record/v1/record.schema.json +91 -0
- package/dist/cli.d.ts +10 -4
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +120 -106
- package/dist/cli.js.map +1 -1
- package/dist/executors/activity-session.d.ts +12 -0
- package/dist/executors/activity-session.d.ts.map +1 -0
- package/dist/executors/activity-session.js +43 -0
- package/dist/executors/activity-session.js.map +1 -0
- package/dist/executors/executor.d.ts +39 -0
- package/dist/executors/executor.d.ts.map +1 -0
- package/dist/executors/executor.js +95 -0
- package/dist/executors/executor.js.map +1 -0
- package/dist/executors/herdr-cli.d.ts +78 -0
- package/dist/executors/herdr-cli.d.ts.map +1 -0
- package/dist/executors/herdr-cli.js +114 -0
- package/dist/executors/herdr-cli.js.map +1 -0
- package/dist/executors/herdr-name.d.ts.map +1 -0
- package/dist/executors/herdr-name.js.map +1 -0
- package/dist/executors/herdr-pi-lifecycle.d.ts.map +1 -0
- package/dist/executors/herdr-pi-lifecycle.js +22 -0
- package/dist/executors/herdr-pi-lifecycle.js.map +1 -0
- package/dist/executors/herdr-poll.d.ts +140 -0
- package/dist/executors/herdr-poll.d.ts.map +1 -0
- package/dist/executors/herdr-poll.js +252 -0
- package/dist/executors/herdr-poll.js.map +1 -0
- package/dist/executors/herdr-stage.d.ts +40 -0
- package/dist/executors/herdr-stage.d.ts.map +1 -0
- package/dist/executors/herdr-stage.js +54 -0
- package/dist/executors/herdr-stage.js.map +1 -0
- package/dist/executors/herdr-start.d.ts.map +1 -0
- package/dist/executors/herdr-start.js.map +1 -0
- package/dist/executors/native-session-target.d.ts +9 -0
- package/dist/executors/native-session-target.d.ts.map +1 -0
- package/dist/executors/native-session-target.js +30 -0
- package/dist/executors/native-session-target.js.map +1 -0
- package/dist/executors/pane-reaper.d.ts +111 -0
- package/dist/executors/pane-reaper.d.ts.map +1 -0
- package/dist/executors/pane-reaper.js +242 -0
- package/dist/executors/pane-reaper.js.map +1 -0
- package/dist/executors/process-activity.d.ts +3 -0
- package/dist/executors/process-activity.d.ts.map +1 -0
- package/dist/executors/process-activity.js +59 -0
- package/dist/executors/process-activity.js.map +1 -0
- package/dist/executors/run-herdr.d.ts +122 -0
- package/dist/executors/run-herdr.d.ts.map +1 -0
- package/dist/executors/run-herdr.js +341 -0
- package/dist/executors/run-herdr.js.map +1 -0
- package/dist/executors/vendor/herdr-pi-lifecycle.d.ts.map +1 -0
- package/dist/executors/vendor/herdr-pi-lifecycle.js.map +1 -0
- package/dist/governance/approval-prompt.d.ts +119 -0
- package/dist/governance/approval-prompt.d.ts.map +1 -0
- package/dist/governance/approval-prompt.js +133 -0
- package/dist/governance/approval-prompt.js.map +1 -0
- package/dist/governance/approval-store.d.ts +149 -0
- package/dist/governance/approval-store.d.ts.map +1 -0
- package/dist/governance/approval-store.js +309 -0
- package/dist/governance/approval-store.js.map +1 -0
- package/dist/governance/execution-retention.d.ts +90 -0
- package/dist/governance/execution-retention.d.ts.map +1 -0
- package/dist/governance/execution-retention.js +317 -0
- package/dist/governance/execution-retention.js.map +1 -0
- package/dist/governance/file-lock.d.ts.map +1 -0
- package/dist/governance/file-lock.js +205 -0
- package/dist/governance/file-lock.js.map +1 -0
- package/dist/governance/finalization.d.ts.map +1 -0
- package/dist/governance/finalization.js.map +1 -0
- package/dist/governance/grant-store.d.ts +96 -0
- package/dist/governance/grant-store.d.ts.map +1 -0
- package/dist/governance/grant-store.js +186 -0
- package/dist/governance/grant-store.js.map +1 -0
- package/dist/governance/init.d.ts +129 -0
- package/dist/governance/init.d.ts.map +1 -0
- package/dist/governance/init.js +360 -0
- package/dist/governance/init.js.map +1 -0
- package/dist/governance/lease-helper.d.ts.map +1 -0
- package/dist/governance/lease-helper.js +121 -0
- package/dist/governance/lease-helper.js.map +1 -0
- package/dist/governance/lease-record.d.ts +90 -0
- package/dist/governance/lease-record.d.ts.map +1 -0
- package/dist/governance/lease-record.js.map +1 -0
- package/dist/governance/ledger-events.d.ts +111 -0
- package/dist/governance/ledger-events.d.ts.map +1 -0
- package/dist/governance/ledger-events.js +129 -0
- package/dist/governance/ledger-events.js.map +1 -0
- package/dist/governance/ledger-report.d.ts +134 -0
- package/dist/governance/ledger-report.d.ts.map +1 -0
- package/dist/governance/ledger-report.js +294 -0
- package/dist/governance/ledger-report.js.map +1 -0
- package/dist/governance/ledger-v3-validation.d.ts +21 -0
- package/dist/governance/ledger-v3-validation.d.ts.map +1 -0
- package/dist/governance/ledger-v3-validation.js +353 -0
- package/dist/governance/ledger-v3-validation.js.map +1 -0
- package/dist/governance/ledger.d.ts +258 -0
- package/dist/governance/ledger.d.ts.map +1 -0
- package/dist/governance/ledger.js +201 -0
- package/dist/governance/ledger.js.map +1 -0
- package/dist/governance/native-session.d.ts +59 -0
- package/dist/governance/native-session.d.ts.map +1 -0
- package/dist/governance/native-session.js +208 -0
- package/dist/governance/native-session.js.map +1 -0
- package/dist/governance/record.d.ts +65 -0
- package/dist/governance/record.d.ts.map +1 -0
- package/dist/governance/record.js +259 -0
- package/dist/governance/record.js.map +1 -0
- package/dist/governance/retention-contract.d.ts.map +1 -0
- package/dist/governance/retention-contract.js +187 -0
- package/dist/governance/retention-contract.js.map +1 -0
- package/dist/governance/retention-json.d.ts.map +1 -0
- package/dist/governance/retention-json.js.map +1 -0
- package/dist/governance/workspace-lease.d.ts +40 -0
- package/dist/governance/workspace-lease.d.ts.map +1 -0
- package/dist/governance/workspace-lease.js +357 -0
- package/dist/governance/workspace-lease.js.map +1 -0
- package/dist/index.d.ts +59 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -42
- package/dist/index.js.map +1 -1
- package/dist/kernel/approval.d.ts +241 -0
- package/dist/kernel/approval.d.ts.map +1 -0
- package/dist/kernel/approval.js +270 -0
- package/dist/kernel/approval.js.map +1 -0
- package/dist/kernel/capabilities.d.ts +136 -0
- package/dist/kernel/capabilities.d.ts.map +1 -0
- package/dist/kernel/capabilities.js +199 -0
- package/dist/kernel/capabilities.js.map +1 -0
- package/dist/kernel/catalog.d.ts +125 -0
- package/dist/kernel/catalog.d.ts.map +1 -0
- package/dist/kernel/catalog.js +338 -0
- package/dist/kernel/catalog.js.map +1 -0
- package/dist/kernel/chain.d.ts.map +1 -0
- package/dist/kernel/chain.js.map +1 -0
- package/dist/kernel/correlation.d.ts.map +1 -0
- package/dist/kernel/correlation.js +267 -0
- package/dist/kernel/correlation.js.map +1 -0
- package/dist/kernel/definitions.d.ts.map +1 -0
- package/dist/kernel/definitions.js +164 -0
- package/dist/kernel/definitions.js.map +1 -0
- package/dist/kernel/delegate-types.d.ts +160 -0
- package/dist/kernel/delegate-types.d.ts.map +1 -0
- package/dist/kernel/delegate-types.js +9 -0
- package/dist/kernel/delegate-types.js.map +1 -0
- package/dist/kernel/delegate.d.ts.map +1 -0
- package/dist/kernel/delegate.js +320 -0
- package/dist/kernel/delegate.js.map +1 -0
- package/dist/kernel/delegation-approval.d.ts.map +1 -0
- package/dist/kernel/delegation-approval.js +93 -0
- package/dist/kernel/delegation-approval.js.map +1 -0
- package/dist/kernel/env-names.d.ts +51 -0
- package/dist/kernel/env-names.d.ts.map +1 -0
- package/dist/kernel/env-names.js +112 -0
- package/dist/kernel/env-names.js.map +1 -0
- package/dist/kernel/execution-id.d.ts.map +1 -0
- package/dist/kernel/execution-id.js.map +1 -0
- package/dist/kernel/fanout.d.ts.map +1 -0
- package/dist/kernel/fanout.js +93 -0
- package/dist/kernel/fanout.js.map +1 -0
- package/dist/kernel/grant-env.d.ts +118 -0
- package/dist/kernel/grant-env.d.ts.map +1 -0
- package/dist/kernel/grant-env.js +104 -0
- package/dist/kernel/grant-env.js.map +1 -0
- package/dist/kernel/ledger-identifiers.d.ts.map +1 -0
- package/dist/kernel/ledger-identifiers.js.map +1 -0
- package/dist/kernel/model-preflight.d.ts +13 -0
- package/dist/kernel/model-preflight.d.ts.map +1 -0
- package/dist/kernel/model-preflight.js +30 -0
- package/dist/kernel/model-preflight.js.map +1 -0
- package/dist/kernel/pi-tools.d.ts.map +1 -0
- package/dist/kernel/pi-tools.js +29 -0
- package/dist/kernel/pi-tools.js.map +1 -0
- package/dist/kernel/progress.d.ts.map +1 -0
- package/dist/kernel/progress.js.map +1 -0
- package/dist/kernel/project-paths.d.ts +43 -0
- package/dist/kernel/project-paths.d.ts.map +1 -0
- package/dist/kernel/project-paths.js +81 -0
- package/dist/kernel/project-paths.js.map +1 -0
- package/dist/kernel/propagation.d.ts +195 -0
- package/dist/kernel/propagation.d.ts.map +1 -0
- package/dist/kernel/propagation.js +275 -0
- package/dist/kernel/propagation.js.map +1 -0
- package/dist/kernel/refusals.d.ts +16 -0
- package/dist/kernel/refusals.d.ts.map +1 -0
- package/dist/kernel/refusals.js +53 -0
- package/dist/kernel/refusals.js.map +1 -0
- package/dist/kernel/resolve.d.ts +120 -0
- package/dist/kernel/resolve.d.ts.map +1 -0
- package/dist/kernel/resolve.js +201 -0
- package/dist/kernel/resolve.js.map +1 -0
- package/dist/kernel/routing-authority.d.ts +71 -0
- package/dist/kernel/routing-authority.d.ts.map +1 -0
- package/dist/kernel/routing-authority.js +100 -0
- package/dist/kernel/routing-authority.js.map +1 -0
- package/dist/kernel/run-child.d.ts +111 -0
- package/dist/kernel/run-child.d.ts.map +1 -0
- package/dist/kernel/run-child.js +324 -0
- package/dist/kernel/run-child.js.map +1 -0
- package/dist/kernel/skill-packages.d.ts +116 -0
- package/dist/kernel/skill-packages.d.ts.map +1 -0
- package/dist/kernel/skill-packages.js +300 -0
- package/dist/kernel/skill-packages.js.map +1 -0
- package/dist/kernel/skill-resources.d.ts.map +1 -0
- package/dist/kernel/skill-resources.js +56 -0
- package/dist/kernel/skill-resources.js.map +1 -0
- package/dist/kernel/spawn.d.ts +60 -0
- package/dist/kernel/spawn.d.ts.map +1 -0
- package/dist/kernel/spawn.js +116 -0
- package/dist/kernel/spawn.js.map +1 -0
- package/dist/kernel/workspace.d.ts +51 -0
- package/dist/kernel/workspace.d.ts.map +1 -0
- package/dist/kernel/workspace.js +223 -0
- package/dist/kernel/workspace.js.map +1 -0
- package/dist/products/activity-timeline.d.ts +126 -0
- package/dist/products/activity-timeline.d.ts.map +1 -0
- package/dist/products/activity-timeline.js +542 -0
- package/dist/products/activity-timeline.js.map +1 -0
- package/dist/products/dashboard-cli.d.ts +26 -0
- package/dist/products/dashboard-cli.d.ts.map +1 -0
- package/dist/products/dashboard-cli.js +224 -0
- package/dist/products/dashboard-cli.js.map +1 -0
- package/dist/products/dashboard-display-controls.d.ts +17 -0
- package/dist/products/dashboard-display-controls.d.ts.map +1 -0
- package/dist/products/dashboard-display-controls.js +38 -0
- package/dist/products/dashboard-display-controls.js.map +1 -0
- package/dist/products/dashboard-handshake.d.ts +42 -0
- package/dist/products/dashboard-handshake.d.ts.map +1 -0
- package/dist/products/dashboard-handshake.js +158 -0
- package/dist/products/dashboard-handshake.js.map +1 -0
- package/dist/products/dashboard-herdr.d.ts +55 -0
- package/dist/products/dashboard-herdr.d.ts.map +1 -0
- package/dist/products/dashboard-herdr.js +324 -0
- package/dist/products/dashboard-herdr.js.map +1 -0
- package/dist/products/dashboard-projection.d.ts +62 -0
- package/dist/products/dashboard-projection.d.ts.map +1 -0
- package/dist/products/dashboard-projection.js +305 -0
- package/dist/products/dashboard-projection.js.map +1 -0
- package/dist/products/dashboard-render.d.ts.map +1 -0
- package/dist/products/dashboard-render.js +208 -0
- package/dist/products/dashboard-render.js.map +1 -0
- package/extensions/activity-timeline.ts +134 -28
- package/extensions/approval-banking.ts +3 -3
- package/extensions/approvals.ts +18 -12
- package/extensions/chain-approval-facts.ts +9 -6
- package/extensions/chain-ledger.ts +4 -4
- package/extensions/chain-plan.ts +6 -6
- package/extensions/correlation-shape.ts +42 -33
- package/extensions/delegate-chain.ts +93 -45
- package/extensions/delegation-authority.ts +7 -3
- package/extensions/delegation-ledger.ts +2 -2
- package/extensions/delegation-native.ts +24 -7
- package/extensions/delegation.ts +91 -80
- package/extensions/execute-child.ts +440 -293
- package/extensions/execution-occurrence.ts +2 -2
- package/extensions/executor-session.ts +5 -5
- package/extensions/fanout-outcome.ts +8 -6
- package/extensions/grant-store-refusal.ts +24 -12
- package/extensions/grants-command.ts +42 -34
- package/extensions/grants-connected-command.ts +29 -15
- package/extensions/grants.ts +73 -73
- package/extensions/init-command.ts +18 -12
- package/extensions/reload-environment.ts +12 -5
- package/extensions/run-delegation.ts +29 -19
- package/extensions/session-environment.ts +25 -11
- package/extensions/session-report.ts +61 -12
- package/extensions/session.ts +58 -34
- package/extensions/spawn-summary.ts +5 -5
- package/extensions/stored-grant-session.ts +5 -5
- package/extensions/tripwire.ts +1 -1
- package/extensions/workspace-runtime.ts +26 -24
- package/herdr-plugin/herdr-plugin.toml +1 -1
- package/package.json +4 -211
- package/src/cli.ts +149 -92
- package/src/executors/activity-session.ts +54 -0
- package/src/executors/executor.ts +123 -0
- package/src/executors/herdr-cli.ts +132 -0
- package/src/executors/herdr-pi-lifecycle.ts +21 -0
- package/src/executors/herdr-poll.ts +305 -0
- package/src/executors/herdr-stage.ts +55 -0
- package/src/executors/native-session-target.ts +31 -0
- package/src/executors/pane-reaper.ts +270 -0
- package/src/executors/process-activity.ts +54 -0
- package/src/executors/run-herdr.ts +426 -0
- package/src/governance/approval-prompt.ts +225 -0
- package/src/governance/approval-store.ts +385 -0
- package/src/governance/execution-retention.ts +372 -0
- package/src/governance/file-lock.ts +210 -0
- package/src/governance/finalization.ts +82 -0
- package/src/governance/grant-store.ts +235 -0
- package/src/governance/init.ts +447 -0
- package/src/governance/lease-helper.ts +124 -0
- package/src/governance/lease-record.ts +131 -0
- package/src/governance/ledger-events.ts +222 -0
- package/src/governance/ledger-report.ts +396 -0
- package/src/governance/ledger-v3-validation.ts +384 -0
- package/src/governance/ledger.ts +419 -0
- package/src/governance/native-session.ts +264 -0
- package/src/governance/record.ts +294 -0
- package/src/governance/retention-contract.ts +201 -0
- package/src/governance/retention-json.ts +24 -0
- package/src/governance/workspace-lease.ts +429 -0
- package/src/index.ts +82 -92
- package/src/kernel/approval.ts +406 -0
- package/src/kernel/capabilities.ts +216 -0
- package/src/kernel/catalog.ts +373 -0
- package/src/kernel/correlation.ts +351 -0
- package/src/kernel/definitions.ts +215 -0
- package/src/kernel/delegate-types.ts +162 -0
- package/src/kernel/delegate.ts +375 -0
- package/src/kernel/delegation-approval.ts +126 -0
- package/src/kernel/env-names.ts +119 -0
- package/src/kernel/fanout.ts +106 -0
- package/src/kernel/grant-env.ts +174 -0
- package/src/kernel/model-preflight.ts +44 -0
- package/src/kernel/pi-tools.ts +32 -0
- package/src/kernel/project-paths.ts +97 -0
- package/src/kernel/propagation.ts +341 -0
- package/src/kernel/refusals.ts +64 -0
- package/src/kernel/resolve.ts +258 -0
- package/src/kernel/routing-authority.ts +121 -0
- package/src/kernel/run-child.ts +418 -0
- package/src/kernel/skill-packages.ts +329 -0
- package/src/kernel/skill-resources.ts +64 -0
- package/src/kernel/spawn.ts +156 -0
- package/src/kernel/workspace.ts +336 -0
- package/src/products/activity-timeline.ts +679 -0
- package/src/products/dashboard-cli.ts +250 -0
- package/src/products/dashboard-display-controls.ts +44 -0
- package/src/products/dashboard-handshake.ts +222 -0
- package/src/products/dashboard-herdr.ts +427 -0
- package/src/products/dashboard-projection.ts +389 -0
- package/src/products/dashboard-render.ts +260 -0
- package/PRODUCT-GUIDE.md +0 -155
- package/REQUIREMENTS.md +0 -41
- package/contracts/daily-view/v1/README.md +0 -114
- package/contracts/daily-view/v1/fixtures/view.json +0 -525
- package/contracts/daily-view/v1/fixtures/view.txt +0 -75
- package/contracts/daily-view/v1/fixtures/work.jsonl +0 -17
- package/contracts/daily-view/v1/p03/README.md +0 -26
- package/contracts/daily-view/v1/p03/fixtures/retained-executions.json +0 -241
- package/contracts/daily-view/v1/p03/projection.schema.json +0 -194
- package/contracts/daily-view/v1/p03/provenance.json +0 -21
- package/contracts/dashboard-host/v1/README.md +0 -176
- package/contracts/debrief/v1/README.md +0 -146
- package/contracts/debrief/v1/intervention/README.md +0 -32
- package/contracts/debrief/v1/intervention/fixtures/artifact-3ee11136beb864f518252e5024dae9197421fbf97b6e981d3243c782b5c44bd0.txt +0 -1
- package/contracts/debrief/v1/intervention/fixtures/artifact-58905d872dd3c54a9705f67b05fa82edbad7af6476ae8993faf1a7b9fadfb905.txt +0 -1
- package/contracts/debrief/v1/intervention/fixtures/assessment.json +0 -29
- package/contracts/debrief/v1/intervention/fixtures/blind-view.json +0 -20
- package/contracts/debrief/v1/intervention/fixtures/choice.json +0 -7
- package/contracts/debrief/v1/intervention/fixtures/manifest.json +0 -57
- package/contracts/debrief/v1/intervention/fixtures/reveal.json +0 -39
- package/contracts/debrief/v1/provenance.json +0 -89
- package/contracts/debrief/v1/work-capture/README.md +0 -38
- package/contracts/debrief/v1/work-capture/fixtures/batch.json +0 -17
- package/contracts/debrief/v1/work-capture/fixtures/cases.json +0 -184
- package/contracts/debrief/v1/work-capture/fixtures/review.json +0 -184
- package/contracts/debrief/v1/work-capture/review-request.schema.json +0 -41
- package/contracts/debrief/v1/work-capture/work-case.schema.json +0 -190
- package/contracts/debrief/v2/README.md +0 -71
- package/contracts/debrief/v2/input-pin.json +0 -66
- package/contracts/debrief/v2/intervention-upstream.md +0 -40
- package/contracts/debrief/v2/work-signals-upstream.md +0 -22
- package/contracts/dispatch-control/v1/README.md +0 -109
- package/contracts/dispatch-control/v1/request.schema.json +0 -19
- package/contracts/effect-profile/v1/README.md +0 -124
- package/contracts/execution-retention/v1/README.md +0 -109
- package/contracts/execution-retention/v2/README.md +0 -148
- package/contracts/execution-retention/v2/fixtures/interrupted-native-bytes.json +0 -91
- package/contracts/execution-retention/v2/fixtures/missing-native-session.json +0 -91
- package/contracts/execution-retention/v2/fixtures/native-file-unknown-branch.json +0 -91
- package/contracts/execution-retention/v2/fixtures/native-id-without-bytes.json +0 -91
- package/contracts/execution-retention/v2/fixtures/native-live-branch.json +0 -90
- package/contracts/execution-retention/v2/fixtures/replaced-native-session.json +0 -92
- package/contracts/execution-retention/v2/fixtures/result-82c620cdfeb8ca6b858cf653d7f5e2eedca5315d6244216d60e8b36f03223d6a.bin +0 -1
- package/contracts/execution-retention/v2/fixtures/session-2ec1f134bc739984434f7fca689e1c3d1c39fce2dcadae709e9b6faedfcc4ac7.bin +0 -3
- package/contracts/execution-retention/v2/fixtures/session-9bdb4bd16a901da31580acf056bda525225259e15ec409e0410480109011772f.bin +0 -3
- package/contracts/execution-retention/v2/manifest.schema.json +0 -858
- package/contracts/experiment/v1/README.md +0 -164
- package/contracts/factory-order/v1/README.md +0 -151
- package/contracts/factory-order/v1/adoption-pin.json +0 -8
- package/contracts/intent-control/v1/README.md +0 -135
- package/contracts/intent-control/v1/request.schema.json +0 -1096
- package/contracts/intent-control/v2/README.md +0 -34
- package/contracts/intent-control/v2/request.schema.json +0 -1070
- package/contracts/ledger/v2/README.md +0 -59
- package/contracts/ledger/v2/fixtures/capability-decision.json +0 -95
- package/contracts/ledger/v2/fixtures/check-receipt.json +0 -40
- package/contracts/ledger/v2/fixtures/child-lifecycle.json +0 -42
- package/contracts/ledger/v2/fixtures/workspace-lease.json +0 -41
- package/contracts/ledger/v2/ledger-event.schema.json +0 -633
- package/contracts/ledger/v3/README.md +0 -36
- package/contracts/ledger/v3/fixtures/check-receipt.json +0 -41
- package/contracts/ledger/v3/fixtures/child-lifecycle.json +0 -44
- package/contracts/ledger/v3/fixtures/workflow-fact.json +0 -40
- package/contracts/ledger/v3/ledger-event.schema.json +0 -955
- package/contracts/ledger/v4/README.md +0 -241
- package/contracts/ledger/v4/fixtures/layout-options.json +0 -428
- package/contracts/ledger/v4/fixtures/work-acceptance.json +0 -57
- package/contracts/ledger/v4/fixtures/work-occurrence.json +0 -44
- package/contracts/ledger/v4/fixtures/work-revision.json +0 -26
- package/contracts/ledger/v4/fixtures/work-snapshot.json +0 -73
- package/contracts/ledger/v4/ledger-event.schema.json +0 -162
- package/contracts/ordinary-control/v1/README.md +0 -59
- package/contracts/producer-ipc/v1/README.md +0 -137
- package/dist/activity-timeline.d.ts +0 -109
- package/dist/activity-timeline.d.ts.map +0 -1
- package/dist/activity-timeline.js +0 -208
- package/dist/activity-timeline.js.map +0 -1
- package/dist/approval-prompt.d.ts +0 -119
- package/dist/approval-prompt.d.ts.map +0 -1
- package/dist/approval-prompt.js +0 -133
- package/dist/approval-prompt.js.map +0 -1
- package/dist/approval-store.d.ts +0 -149
- package/dist/approval-store.d.ts.map +0 -1
- package/dist/approval-store.js +0 -314
- package/dist/approval-store.js.map +0 -1
- package/dist/approval.d.ts +0 -241
- package/dist/approval.d.ts.map +0 -1
- package/dist/approval.js +0 -268
- package/dist/approval.js.map +0 -1
- package/dist/capabilities.d.ts +0 -136
- package/dist/capabilities.d.ts.map +0 -1
- package/dist/capabilities.js +0 -203
- package/dist/capabilities.js.map +0 -1
- package/dist/catalog.d.ts +0 -98
- package/dist/catalog.d.ts.map +0 -1
- package/dist/catalog.js +0 -273
- package/dist/catalog.js.map +0 -1
- package/dist/chain.d.ts.map +0 -1
- package/dist/chain.js.map +0 -1
- package/dist/check-runner.d.ts +0 -66
- package/dist/check-runner.d.ts.map +0 -1
- package/dist/check-runner.js +0 -275
- package/dist/check-runner.js.map +0 -1
- package/dist/control-journal.d.ts +0 -20
- package/dist/control-journal.d.ts.map +0 -1
- package/dist/control-journal.js +0 -73
- package/dist/control-journal.js.map +0 -1
- package/dist/correlation.d.ts.map +0 -1
- package/dist/correlation.js +0 -231
- package/dist/correlation.js.map +0 -1
- package/dist/daily-dashboard-host.d.ts +0 -136
- package/dist/daily-dashboard-host.d.ts.map +0 -1
- package/dist/daily-dashboard-host.js +0 -164
- package/dist/daily-dashboard-host.js.map +0 -1
- package/dist/daily-panel.d.ts +0 -36
- package/dist/daily-panel.d.ts.map +0 -1
- package/dist/daily-panel.js +0 -84
- package/dist/daily-panel.js.map +0 -1
- package/dist/daily-view-input.d.ts +0 -44
- package/dist/daily-view-input.d.ts.map +0 -1
- package/dist/daily-view-input.js +0 -68
- package/dist/daily-view-input.js.map +0 -1
- package/dist/daily-view-render.d.ts +0 -5
- package/dist/daily-view-render.d.ts.map +0 -1
- package/dist/daily-view-render.js +0 -42
- package/dist/daily-view-render.js.map +0 -1
- package/dist/daily-view.d.ts +0 -77
- package/dist/daily-view.d.ts.map +0 -1
- package/dist/daily-view.js +0 -176
- package/dist/daily-view.js.map +0 -1
- package/dist/dashboard-cli.d.ts +0 -54
- package/dist/dashboard-cli.d.ts.map +0 -1
- package/dist/dashboard-cli.js +0 -367
- package/dist/dashboard-cli.js.map +0 -1
- package/dist/dashboard-display-controls.d.ts +0 -15
- package/dist/dashboard-display-controls.d.ts.map +0 -1
- package/dist/dashboard-display-controls.js +0 -34
- package/dist/dashboard-display-controls.js.map +0 -1
- package/dist/dashboard-handshake.d.ts +0 -42
- package/dist/dashboard-handshake.d.ts.map +0 -1
- package/dist/dashboard-handshake.js +0 -147
- package/dist/dashboard-handshake.js.map +0 -1
- package/dist/dashboard-harness.d.ts +0 -22
- package/dist/dashboard-harness.d.ts.map +0 -1
- package/dist/dashboard-harness.js +0 -89
- package/dist/dashboard-harness.js.map +0 -1
- package/dist/dashboard-herdr.d.ts +0 -55
- package/dist/dashboard-herdr.d.ts.map +0 -1
- package/dist/dashboard-herdr.js +0 -293
- package/dist/dashboard-herdr.js.map +0 -1
- package/dist/dashboard-host-contract.d.ts +0 -127
- package/dist/dashboard-host-contract.d.ts.map +0 -1
- package/dist/dashboard-host-contract.js +0 -14
- package/dist/dashboard-host-contract.js.map +0 -1
- package/dist/dashboard-host-transport.d.ts +0 -16
- package/dist/dashboard-host-transport.d.ts.map +0 -1
- package/dist/dashboard-host-transport.js +0 -127
- package/dist/dashboard-host-transport.js.map +0 -1
- package/dist/dashboard-host.d.ts +0 -239
- package/dist/dashboard-host.d.ts.map +0 -1
- package/dist/dashboard-host.js +0 -474
- package/dist/dashboard-host.js.map +0 -1
- package/dist/dashboard-menu.d.ts +0 -16
- package/dist/dashboard-menu.d.ts.map +0 -1
- package/dist/dashboard-menu.js +0 -33
- package/dist/dashboard-menu.js.map +0 -1
- package/dist/dashboard-observation.d.ts +0 -28
- package/dist/dashboard-observation.d.ts.map +0 -1
- package/dist/dashboard-observation.js +0 -87
- package/dist/dashboard-observation.js.map +0 -1
- package/dist/dashboard-projection.d.ts +0 -73
- package/dist/dashboard-projection.d.ts.map +0 -1
- package/dist/dashboard-projection.js +0 -294
- package/dist/dashboard-projection.js.map +0 -1
- package/dist/dashboard-render.d.ts.map +0 -1
- package/dist/dashboard-render.js +0 -212
- package/dist/dashboard-render.js.map +0 -1
- package/dist/debrief-contract.d.ts +0 -65
- package/dist/debrief-contract.d.ts.map +0 -1
- package/dist/debrief-contract.js +0 -151
- package/dist/debrief-contract.js.map +0 -1
- package/dist/debrief-fixture.d.ts +0 -16
- package/dist/debrief-fixture.d.ts.map +0 -1
- package/dist/debrief-fixture.js +0 -41
- package/dist/debrief-fixture.js.map +0 -1
- package/dist/debrief-host.d.ts +0 -59
- package/dist/debrief-host.d.ts.map +0 -1
- package/dist/debrief-host.js +0 -49
- package/dist/debrief-host.js.map +0 -1
- package/dist/debrief-render.d.ts +0 -5
- package/dist/debrief-render.d.ts.map +0 -1
- package/dist/debrief-render.js +0 -65
- package/dist/debrief-render.js.map +0 -1
- package/dist/debrief.d.ts +0 -90
- package/dist/debrief.d.ts.map +0 -1
- package/dist/debrief.js +0 -263
- package/dist/debrief.js.map +0 -1
- package/dist/definitions.d.ts.map +0 -1
- package/dist/definitions.js +0 -164
- package/dist/definitions.js.map +0 -1
- package/dist/delegate-types.d.ts +0 -154
- package/dist/delegate-types.d.ts.map +0 -1
- package/dist/delegate-types.js +0 -8
- package/dist/delegate-types.js.map +0 -1
- package/dist/delegate.d.ts.map +0 -1
- package/dist/delegate.js +0 -313
- package/dist/delegate.js.map +0 -1
- package/dist/delegation-approval.d.ts.map +0 -1
- package/dist/delegation-approval.js +0 -94
- package/dist/delegation-approval.js.map +0 -1
- package/dist/dispatch-control.d.ts +0 -45
- package/dist/dispatch-control.d.ts.map +0 -1
- package/dist/dispatch-control.js +0 -76
- package/dist/dispatch-control.js.map +0 -1
- package/dist/effect-profile-runtime.d.ts +0 -40
- package/dist/effect-profile-runtime.d.ts.map +0 -1
- package/dist/effect-profile-runtime.js +0 -51
- package/dist/effect-profile-runtime.js.map +0 -1
- package/dist/effect-profile.d.ts +0 -40
- package/dist/effect-profile.d.ts.map +0 -1
- package/dist/effect-profile.js +0 -152
- package/dist/effect-profile.js.map +0 -1
- package/dist/execution-id.d.ts.map +0 -1
- package/dist/execution-id.js.map +0 -1
- package/dist/execution-retention.d.ts +0 -90
- package/dist/execution-retention.d.ts.map +0 -1
- package/dist/execution-retention.js +0 -247
- package/dist/execution-retention.js.map +0 -1
- package/dist/executor.d.ts +0 -39
- package/dist/executor.d.ts.map +0 -1
- package/dist/executor.js +0 -94
- package/dist/executor.js.map +0 -1
- package/dist/experiment-contract.d.ts +0 -56
- package/dist/experiment-contract.d.ts.map +0 -1
- package/dist/experiment-contract.js +0 -80
- package/dist/experiment-contract.js.map +0 -1
- package/dist/experiment-state.d.ts +0 -22
- package/dist/experiment-state.d.ts.map +0 -1
- package/dist/experiment-state.js +0 -79
- package/dist/experiment-state.js.map +0 -1
- package/dist/experiment-store.d.ts +0 -30
- package/dist/experiment-store.d.ts.map +0 -1
- package/dist/experiment-store.js +0 -147
- package/dist/experiment-store.js.map +0 -1
- package/dist/experiment.d.ts +0 -65
- package/dist/experiment.d.ts.map +0 -1
- package/dist/experiment.js +0 -362
- package/dist/experiment.js.map +0 -1
- package/dist/factory-contract.d.ts +0 -79
- package/dist/factory-contract.d.ts.map +0 -1
- package/dist/factory-contract.js +0 -89
- package/dist/factory-contract.js.map +0 -1
- package/dist/factory-migration.d.ts +0 -20
- package/dist/factory-migration.d.ts.map +0 -1
- package/dist/factory-migration.js +0 -55
- package/dist/factory-migration.js.map +0 -1
- package/dist/factory-order.d.ts +0 -848
- package/dist/factory-order.d.ts.map +0 -1
- package/dist/factory-order.js +0 -83
- package/dist/factory-order.js.map +0 -1
- package/dist/factory-registry.d.ts +0 -121
- package/dist/factory-registry.d.ts.map +0 -1
- package/dist/factory-registry.js +0 -133
- package/dist/factory-registry.js.map +0 -1
- package/dist/fanout.d.ts.map +0 -1
- package/dist/fanout.js +0 -93
- package/dist/fanout.js.map +0 -1
- package/dist/file-lock.d.ts.map +0 -1
- package/dist/file-lock.js +0 -201
- package/dist/file-lock.js.map +0 -1
- package/dist/finalization.d.ts.map +0 -1
- package/dist/finalization.js.map +0 -1
- package/dist/git-identity.d.ts +0 -13
- package/dist/git-identity.d.ts.map +0 -1
- package/dist/git-identity.js +0 -47
- package/dist/git-identity.js.map +0 -1
- package/dist/grant-env.d.ts +0 -75
- package/dist/grant-env.d.ts.map +0 -1
- package/dist/grant-env.js +0 -154
- package/dist/grant-env.js.map +0 -1
- package/dist/grant-store.d.ts +0 -96
- package/dist/grant-store.d.ts.map +0 -1
- package/dist/grant-store.js +0 -188
- package/dist/grant-store.js.map +0 -1
- package/dist/herdr-cli.d.ts +0 -78
- package/dist/herdr-cli.d.ts.map +0 -1
- package/dist/herdr-cli.js +0 -113
- package/dist/herdr-cli.js.map +0 -1
- package/dist/herdr-name.d.ts.map +0 -1
- package/dist/herdr-name.js.map +0 -1
- package/dist/herdr-pi-lifecycle.d.ts.map +0 -1
- package/dist/herdr-pi-lifecycle.js +0 -22
- package/dist/herdr-pi-lifecycle.js.map +0 -1
- package/dist/herdr-poll.d.ts +0 -133
- package/dist/herdr-poll.d.ts.map +0 -1
- package/dist/herdr-poll.js +0 -222
- package/dist/herdr-poll.js.map +0 -1
- package/dist/herdr-stage.d.ts +0 -40
- package/dist/herdr-stage.d.ts.map +0 -1
- package/dist/herdr-stage.js +0 -54
- package/dist/herdr-stage.js.map +0 -1
- package/dist/herdr-start.d.ts.map +0 -1
- package/dist/herdr-start.js.map +0 -1
- package/dist/init.d.ts +0 -117
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -323
- package/dist/init.js.map +0 -1
- package/dist/intent-application.d.ts +0 -17
- package/dist/intent-application.d.ts.map +0 -1
- package/dist/intent-application.js +0 -114
- package/dist/intent-application.js.map +0 -1
- package/dist/intent-control.d.ts +0 -201
- package/dist/intent-control.d.ts.map +0 -1
- package/dist/intent-control.js +0 -110
- package/dist/intent-control.js.map +0 -1
- package/dist/intent-scheduling.d.ts +0 -9
- package/dist/intent-scheduling.d.ts.map +0 -1
- package/dist/intent-scheduling.js +0 -15
- package/dist/intent-scheduling.js.map +0 -1
- package/dist/learning-connection.d.ts +0 -127
- package/dist/learning-connection.d.ts.map +0 -1
- package/dist/learning-connection.js +0 -54
- package/dist/learning-connection.js.map +0 -1
- package/dist/lease-helper.d.ts.map +0 -1
- package/dist/lease-helper.js +0 -94
- package/dist/lease-helper.js.map +0 -1
- package/dist/lease-record.d.ts +0 -90
- package/dist/lease-record.d.ts.map +0 -1
- package/dist/lease-record.js.map +0 -1
- package/dist/ledger-append.d.ts +0 -15
- package/dist/ledger-append.d.ts.map +0 -1
- package/dist/ledger-append.js +0 -94
- package/dist/ledger-append.js.map +0 -1
- package/dist/ledger-events.d.ts +0 -131
- package/dist/ledger-events.d.ts.map +0 -1
- package/dist/ledger-events.js +0 -107
- package/dist/ledger-events.js.map +0 -1
- package/dist/ledger-identifiers.d.ts.map +0 -1
- package/dist/ledger-identifiers.js.map +0 -1
- package/dist/ledger-report.d.ts +0 -134
- package/dist/ledger-report.d.ts.map +0 -1
- package/dist/ledger-report.js +0 -271
- package/dist/ledger-report.js.map +0 -1
- package/dist/ledger-v3-validation.d.ts +0 -11
- package/dist/ledger-v3-validation.d.ts.map +0 -1
- package/dist/ledger-v3-validation.js +0 -265
- package/dist/ledger-v3-validation.js.map +0 -1
- package/dist/ledger.d.ts +0 -242
- package/dist/ledger.d.ts.map +0 -1
- package/dist/ledger.js +0 -142
- package/dist/ledger.js.map +0 -1
- package/dist/measured-order.d.ts +0 -249
- package/dist/measured-order.d.ts.map +0 -1
- package/dist/measured-order.js +0 -309
- package/dist/measured-order.js.map +0 -1
- package/dist/measured-session.d.ts +0 -97
- package/dist/measured-session.d.ts.map +0 -1
- package/dist/measured-session.js +0 -134
- package/dist/measured-session.js.map +0 -1
- package/dist/model-preflight.d.ts +0 -13
- package/dist/model-preflight.d.ts.map +0 -1
- package/dist/model-preflight.js +0 -29
- package/dist/model-preflight.js.map +0 -1
- package/dist/native-session-target.d.ts +0 -9
- package/dist/native-session-target.d.ts.map +0 -1
- package/dist/native-session-target.js +0 -29
- package/dist/native-session-target.js.map +0 -1
- package/dist/native-session.d.ts +0 -59
- package/dist/native-session.d.ts.map +0 -1
- package/dist/native-session.js +0 -154
- package/dist/native-session.js.map +0 -1
- package/dist/order-schedule.d.ts +0 -37
- package/dist/order-schedule.d.ts.map +0 -1
- package/dist/order-schedule.js +0 -81
- package/dist/order-schedule.js.map +0 -1
- package/dist/ordinary-children.d.ts +0 -52
- package/dist/ordinary-children.d.ts.map +0 -1
- package/dist/ordinary-children.js +0 -93
- package/dist/ordinary-children.js.map +0 -1
- package/dist/pane-reaper.d.ts +0 -111
- package/dist/pane-reaper.d.ts.map +0 -1
- package/dist/pane-reaper.js +0 -242
- package/dist/pane-reaper.js.map +0 -1
- package/dist/pi-tools.d.ts.map +0 -1
- package/dist/pi-tools.js +0 -21
- package/dist/pi-tools.js.map +0 -1
- package/dist/producer-ipc-contract.d.ts +0 -29
- package/dist/producer-ipc-contract.d.ts.map +0 -1
- package/dist/producer-ipc-contract.js +0 -29
- package/dist/producer-ipc-contract.js.map +0 -1
- package/dist/producer-ipc.d.ts +0 -55
- package/dist/producer-ipc.d.ts.map +0 -1
- package/dist/producer-ipc.js +0 -143
- package/dist/producer-ipc.js.map +0 -1
- package/dist/product-files.d.ts +0 -6
- package/dist/product-files.d.ts.map +0 -1
- package/dist/product-files.js +0 -55
- package/dist/product-files.js.map +0 -1
- package/dist/progress.d.ts.map +0 -1
- package/dist/progress.js.map +0 -1
- package/dist/propagation.d.ts +0 -203
- package/dist/propagation.d.ts.map +0 -1
- package/dist/propagation.js +0 -279
- package/dist/propagation.js.map +0 -1
- package/dist/refusals.d.ts +0 -16
- package/dist/refusals.d.ts.map +0 -1
- package/dist/refusals.js +0 -55
- package/dist/refusals.js.map +0 -1
- package/dist/resolve.d.ts +0 -120
- package/dist/resolve.d.ts.map +0 -1
- package/dist/resolve.js +0 -211
- package/dist/resolve.js.map +0 -1
- package/dist/resource-budget.d.ts +0 -334
- package/dist/resource-budget.d.ts.map +0 -1
- package/dist/resource-budget.js +0 -415
- package/dist/resource-budget.js.map +0 -1
- package/dist/retention-contract.d.ts.map +0 -1
- package/dist/retention-contract.js +0 -104
- package/dist/retention-contract.js.map +0 -1
- package/dist/retention-json.d.ts.map +0 -1
- package/dist/retention-json.js.map +0 -1
- package/dist/routing-authority.d.ts +0 -71
- package/dist/routing-authority.d.ts.map +0 -1
- package/dist/routing-authority.js +0 -100
- package/dist/routing-authority.js.map +0 -1
- package/dist/run-child.d.ts +0 -87
- package/dist/run-child.d.ts.map +0 -1
- package/dist/run-child.js +0 -248
- package/dist/run-child.js.map +0 -1
- package/dist/run-herdr.d.ts +0 -119
- package/dist/run-herdr.d.ts.map +0 -1
- package/dist/run-herdr.js +0 -335
- package/dist/run-herdr.js.map +0 -1
- package/dist/skill-packages.d.ts +0 -116
- package/dist/skill-packages.d.ts.map +0 -1
- package/dist/skill-packages.js +0 -295
- package/dist/skill-packages.js.map +0 -1
- package/dist/skill-resources.d.ts.map +0 -1
- package/dist/skill-resources.js +0 -52
- package/dist/skill-resources.js.map +0 -1
- package/dist/spawn.d.ts +0 -60
- package/dist/spawn.d.ts.map +0 -1
- package/dist/spawn.js +0 -116
- package/dist/spawn.js.map +0 -1
- package/dist/vendor/adoption.d.ts +0 -129
- package/dist/vendor/adoption.d.ts.map +0 -1
- package/dist/vendor/adoption.js +0 -102
- package/dist/vendor/adoption.js.map +0 -1
- package/dist/vendor/herdr-pi-lifecycle.d.ts.map +0 -1
- package/dist/vendor/herdr-pi-lifecycle.js.map +0 -1
- package/dist/work-command.d.ts +0 -32
- package/dist/work-command.d.ts.map +0 -1
- package/dist/work-command.js +0 -179
- package/dist/work-command.js.map +0 -1
- package/dist/work-ledger-destination.d.ts +0 -20
- package/dist/work-ledger-destination.d.ts.map +0 -1
- package/dist/work-ledger-destination.js +0 -131
- package/dist/work-ledger-destination.js.map +0 -1
- package/dist/work-ledger-json.d.ts +0 -25
- package/dist/work-ledger-json.d.ts.map +0 -1
- package/dist/work-ledger-json.js +0 -267
- package/dist/work-ledger-json.js.map +0 -1
- package/dist/work-ledger-occurrences.d.ts +0 -227
- package/dist/work-ledger-occurrences.d.ts.map +0 -1
- package/dist/work-ledger-occurrences.js +0 -115
- package/dist/work-ledger-occurrences.js.map +0 -1
- package/dist/work-ledger-projection.d.ts +0 -295
- package/dist/work-ledger-projection.d.ts.map +0 -1
- package/dist/work-ledger-projection.js +0 -237
- package/dist/work-ledger-projection.js.map +0 -1
- package/dist/work-ledger-snapshot.d.ts +0 -29
- package/dist/work-ledger-snapshot.d.ts.map +0 -1
- package/dist/work-ledger-snapshot.js +0 -267
- package/dist/work-ledger-snapshot.js.map +0 -1
- package/dist/work-ledger-types.d.ts +0 -261
- package/dist/work-ledger-types.d.ts.map +0 -1
- package/dist/work-ledger-types.js +0 -13
- package/dist/work-ledger-types.js.map +0 -1
- package/dist/work-ledger-validation.d.ts +0 -14
- package/dist/work-ledger-validation.d.ts.map +0 -1
- package/dist/work-ledger-validation.js +0 -226
- package/dist/work-ledger-validation.js.map +0 -1
- package/dist/work-ledger.d.ts +0 -43
- package/dist/work-ledger.d.ts.map +0 -1
- package/dist/work-ledger.js +0 -225
- package/dist/work-ledger.js.map +0 -1
- package/dist/work-policy-registry.d.ts +0 -133
- package/dist/work-policy-registry.d.ts.map +0 -1
- package/dist/work-policy-registry.js +0 -128
- package/dist/work-policy-registry.js.map +0 -1
- package/dist/work-run.d.ts +0 -56
- package/dist/work-run.d.ts.map +0 -1
- package/dist/work-run.js +0 -102
- package/dist/work-run.js.map +0 -1
- package/dist/work-setup.d.ts +0 -40
- package/dist/work-setup.d.ts.map +0 -1
- package/dist/work-setup.js +0 -174
- package/dist/work-setup.js.map +0 -1
- package/dist/workflow-fact-id.d.ts +0 -4
- package/dist/workflow-fact-id.d.ts.map +0 -1
- package/dist/workflow-fact-id.js +0 -14
- package/dist/workflow-fact-id.js.map +0 -1
- package/dist/workflow-facts.d.ts +0 -34
- package/dist/workflow-facts.d.ts.map +0 -1
- package/dist/workflow-facts.js +0 -43
- package/dist/workflow-facts.js.map +0 -1
- package/dist/workspace-lease.d.ts +0 -40
- package/dist/workspace-lease.d.ts.map +0 -1
- package/dist/workspace-lease.js +0 -333
- package/dist/workspace-lease.js.map +0 -1
- package/dist/workspace.d.ts +0 -57
- package/dist/workspace.d.ts.map +0 -1
- package/dist/workspace.js +0 -216
- package/dist/workspace.js.map +0 -1
- package/extensions/daily-dashboard-session.ts +0 -48
- package/extensions/daily-work-session.ts +0 -20
- package/extensions/learning-outcome-session.ts +0 -38
- package/extensions/learning-session.ts +0 -59
- package/extensions/ordinary-runtime.ts +0 -14
- package/extensions/primary-shadow.ts +0 -11
- package/extensions/work-policy-session.ts +0 -139
- package/extensions/work-run-session.ts +0 -75
- package/extensions/work-runtime.ts +0 -44
- package/extensions/work-session.ts +0 -132
- package/src/activity-timeline.ts +0 -133
- package/src/approval-prompt.ts +0 -225
- package/src/approval-store.ts +0 -386
- package/src/approval.ts +0 -399
- package/src/capabilities.ts +0 -220
- package/src/catalog.ts +0 -306
- package/src/check-runner.ts +0 -387
- package/src/control-journal.ts +0 -26
- package/src/correlation.ts +0 -320
- package/src/daily-dashboard-host.ts +0 -105
- package/src/daily-panel.ts +0 -80
- package/src/daily-view-input.ts +0 -59
- package/src/daily-view-render.ts +0 -45
- package/src/daily-view.ts +0 -160
- package/src/dashboard-cli.ts +0 -340
- package/src/dashboard-display-controls.ts +0 -21
- package/src/dashboard-handshake.ts +0 -199
- package/src/dashboard-harness.ts +0 -37
- package/src/dashboard-herdr.ts +0 -363
- package/src/dashboard-host-contract.ts +0 -50
- package/src/dashboard-host-transport.ts +0 -43
- package/src/dashboard-host.ts +0 -244
- package/src/dashboard-menu.ts +0 -28
- package/src/dashboard-observation.ts +0 -46
- package/src/dashboard-projection.ts +0 -390
- package/src/dashboard-render.ts +0 -259
- package/src/debrief-contract.ts +0 -127
- package/src/debrief-fixture.ts +0 -29
- package/src/debrief-host.ts +0 -53
- package/src/debrief-render.ts +0 -49
- package/src/debrief.ts +0 -198
- package/src/definitions.ts +0 -211
- package/src/delegate-types.ts +0 -154
- package/src/delegate.ts +0 -348
- package/src/delegation-approval.ts +0 -126
- package/src/dispatch-control.ts +0 -81
- package/src/effect-profile-runtime.ts +0 -46
- package/src/effect-profile.ts +0 -129
- package/src/execution-retention.ts +0 -230
- package/src/executor.ts +0 -123
- package/src/experiment-contract.ts +0 -66
- package/src/experiment-state.ts +0 -44
- package/src/experiment-store.ts +0 -98
- package/src/experiment.ts +0 -236
- package/src/factory-contract.ts +0 -47
- package/src/factory-migration.ts +0 -29
- package/src/factory-order.ts +0 -56
- package/src/factory-registry.ts +0 -60
- package/src/fanout.ts +0 -106
- package/src/file-lock.ts +0 -178
- package/src/finalization.ts +0 -79
- package/src/git-identity.ts +0 -56
- package/src/grant-env.ts +0 -221
- package/src/grant-store.ts +0 -235
- package/src/herdr-cli.ts +0 -125
- package/src/herdr-pi-lifecycle.ts +0 -21
- package/src/herdr-poll.ts +0 -253
- package/src/herdr-stage.ts +0 -55
- package/src/init.ts +0 -389
- package/src/intent-application.ts +0 -91
- package/src/intent-control.ts +0 -107
- package/src/intent-scheduling.ts +0 -14
- package/src/learning-connection.ts +0 -70
- package/src/lease-helper.ts +0 -97
- package/src/lease-record.ts +0 -131
- package/src/ledger-append.ts +0 -72
- package/src/ledger-events.ts +0 -226
- package/src/ledger-report.ts +0 -357
- package/src/ledger-v3-validation.ts +0 -266
- package/src/ledger.ts +0 -369
- package/src/measured-order.ts +0 -72
- package/src/measured-session.ts +0 -70
- package/src/model-preflight.ts +0 -41
- package/src/native-session-target.ts +0 -23
- package/src/native-session.ts +0 -139
- package/src/order-schedule.ts +0 -42
- package/src/ordinary-children.ts +0 -59
- package/src/pane-reaper.ts +0 -270
- package/src/pi-tools.ts +0 -25
- package/src/producer-ipc-contract.ts +0 -26
- package/src/producer-ipc.ts +0 -107
- package/src/product-files.ts +0 -34
- package/src/propagation.ts +0 -333
- package/src/refusals.ts +0 -70
- package/src/resolve.ts +0 -267
- package/src/resource-budget.ts +0 -349
- package/src/retention-contract.ts +0 -84
- package/src/retention-json.ts +0 -20
- package/src/routing-authority.ts +0 -121
- package/src/run-child.ts +0 -303
- package/src/run-herdr.ts +0 -386
- package/src/skill-packages.ts +0 -314
- package/src/skill-resources.ts +0 -48
- package/src/spawn.ts +0 -156
- package/src/vendor/adoption.ts +0 -109
- package/src/work-command.ts +0 -197
- package/src/work-ledger-destination.ts +0 -113
- package/src/work-ledger-json.ts +0 -228
- package/src/work-ledger-occurrences.ts +0 -99
- package/src/work-ledger-projection.ts +0 -262
- package/src/work-ledger-snapshot.ts +0 -246
- package/src/work-ledger-types.ts +0 -229
- package/src/work-ledger-validation.ts +0 -174
- package/src/work-ledger.ts +0 -186
- package/src/work-policy-registry.ts +0 -81
- package/src/work-run.ts +0 -79
- package/src/work-setup.ts +0 -141
- package/src/workflow-fact-id.ts +0 -16
- package/src/workflow-facts.ts +0 -65
- package/src/workspace-lease.ts +0 -363
- package/src/workspace.ts +0 -308
- /package/contracts/{ledger/v3 → ledger-record/v1}/fixtures/capability-decision.json +0 -0
- /package/contracts/{ledger/v3 → ledger-record/v1}/fixtures/workspace-lease.json +0 -0
- /package/dist/{herdr-name.d.ts → executors/herdr-name.d.ts} +0 -0
- /package/dist/{herdr-name.js → executors/herdr-name.js} +0 -0
- /package/dist/{herdr-pi-lifecycle.d.ts → executors/herdr-pi-lifecycle.d.ts} +0 -0
- /package/dist/{herdr-start.d.ts → executors/herdr-start.d.ts} +0 -0
- /package/dist/{herdr-start.js → executors/herdr-start.js} +0 -0
- /package/dist/{vendor → executors/vendor}/herdr-pi-lifecycle.d.ts +0 -0
- /package/dist/{vendor → executors/vendor}/herdr-pi-lifecycle.js +0 -0
- /package/dist/{file-lock.d.ts → governance/file-lock.d.ts} +0 -0
- /package/dist/{finalization.d.ts → governance/finalization.d.ts} +0 -0
- /package/dist/{finalization.js → governance/finalization.js} +0 -0
- /package/dist/{lease-helper.d.ts → governance/lease-helper.d.ts} +0 -0
- /package/dist/{lease-record.js → governance/lease-record.js} +0 -0
- /package/dist/{retention-contract.d.ts → governance/retention-contract.d.ts} +0 -0
- /package/dist/{retention-json.d.ts → governance/retention-json.d.ts} +0 -0
- /package/dist/{retention-json.js → governance/retention-json.js} +0 -0
- /package/dist/{chain.d.ts → kernel/chain.d.ts} +0 -0
- /package/dist/{chain.js → kernel/chain.js} +0 -0
- /package/dist/{correlation.d.ts → kernel/correlation.d.ts} +0 -0
- /package/dist/{definitions.d.ts → kernel/definitions.d.ts} +0 -0
- /package/dist/{delegate.d.ts → kernel/delegate.d.ts} +0 -0
- /package/dist/{delegation-approval.d.ts → kernel/delegation-approval.d.ts} +0 -0
- /package/dist/{execution-id.d.ts → kernel/execution-id.d.ts} +0 -0
- /package/dist/{execution-id.js → kernel/execution-id.js} +0 -0
- /package/dist/{fanout.d.ts → kernel/fanout.d.ts} +0 -0
- /package/dist/{ledger-identifiers.d.ts → kernel/ledger-identifiers.d.ts} +0 -0
- /package/dist/{ledger-identifiers.js → kernel/ledger-identifiers.js} +0 -0
- /package/dist/{pi-tools.d.ts → kernel/pi-tools.d.ts} +0 -0
- /package/dist/{progress.d.ts → kernel/progress.d.ts} +0 -0
- /package/dist/{progress.js → kernel/progress.js} +0 -0
- /package/dist/{skill-resources.d.ts → kernel/skill-resources.d.ts} +0 -0
- /package/dist/{dashboard-render.d.ts → products/dashboard-render.d.ts} +0 -0
- /package/src/{herdr-name.ts → executors/herdr-name.ts} +0 -0
- /package/src/{herdr-start.ts → executors/herdr-start.ts} +0 -0
- /package/src/{vendor → executors/vendor}/herdr-pi-lifecycle.ts +0 -0
- /package/src/{chain.ts → kernel/chain.ts} +0 -0
- /package/src/{execution-id.ts → kernel/execution-id.ts} +0 -0
- /package/src/{ledger-identifiers.ts → kernel/ledger-identifiers.ts} +0 -0
- /package/src/{progress.ts → kernel/progress.ts} +0 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup discovers enabled Pi resources in place through its package resolver. Configured packages
|
|
3
|
+
* are never copied into another autoload root. For legacy npm installs unregistered with Pi only,
|
|
4
|
+
* the explicit package.json pi.skills declaration remains a scaffold source (ADR-0074).
|
|
5
|
+
* Names, ceilings and bytes are checked before they can enter the generated shell grant.
|
|
6
|
+
*/
|
|
7
|
+
import { readdir, readFile, realpath } from "node:fs/promises";
|
|
8
|
+
import { homedir } from "node:os";
|
|
9
|
+
import { join, resolve, sep } from "node:path";
|
|
10
|
+
import { ceilingForDefinition, parseSkillDefinition } from "./definitions.js";
|
|
11
|
+
import { resolveSkillResources, skillResourceName } from "./skill-resources.js";
|
|
12
|
+
import { WILDCARD } from "./pi-tools.js";
|
|
13
|
+
import { AGENT_WILDCARD, WORKSPACE_WILDCARD } from "./resolve.js";
|
|
14
|
+
import { isSafeCapability } from "./capabilities.js";
|
|
15
|
+
import { agentDir as resolveAgentDir } from "./project-paths.js";
|
|
16
|
+
/**
|
|
17
|
+
* May this definition's name be written into a capability id, a shell file and a path?
|
|
18
|
+
*
|
|
19
|
+
* **Measured before it was written, and it was a defect in this module's first version (R-77).** A
|
|
20
|
+
* definition's identity is its directory name, and `init` interpolates that name into three places at once:
|
|
21
|
+
* `agent:<name>` inside a **comma-separated** `PI_DADDY_GRANT`, a `.pi/grants.env` an operator **sources**,
|
|
22
|
+
* and the path it writes the copy to. An installed package with a directory called `a,tool:bash` produced
|
|
23
|
+
*
|
|
24
|
+
* ```
|
|
25
|
+
* export PI_DADDY_GRANT="agent:a,tool:bash,tool:delegate,tool:read"
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* — `tool:bash` in an operator's grant, declared by nobody. A quote character reaches a file that gets
|
|
29
|
+
* `source`d, and a name of `..` writes outside `.pi/skills/`. One rule closes all three, and it is
|
|
30
|
+
* deliberately a **whitelist**: the safe set here is small and the unsafe set is the rest of Unicode.
|
|
31
|
+
*
|
|
32
|
+
* The first character must be alphanumeric, so `..` and dotfiles are refused along with everything else.
|
|
33
|
+
*/
|
|
34
|
+
export function isSafeName(name) {
|
|
35
|
+
return /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(name);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* May this DECLARED capability id be written into the generated grant? — R-78.
|
|
39
|
+
*
|
|
40
|
+
* **R-77's other half, and the reason a whitelist beats a blocklist twice.** R-77 was closed on the name
|
|
41
|
+
* channel; the `allowed-tools` *value* travels to the identical interpolation site and was unchecked, so a
|
|
42
|
+
* package declaring
|
|
43
|
+
*
|
|
44
|
+
* ```yaml
|
|
45
|
+
* allowed-tools: Read,ext:x";touch /tmp/pwned;PI_DADDY_GRANT="
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* produced a `.pi/grants.env` that executed arbitrary code the moment the operator ran the `source` line
|
|
49
|
+
* `init` itself prints. Reproduced end to end before this existed. `ceilingForDefinition` passes `ext:`,
|
|
50
|
+
* `skill:` and `agent:` entries through **as written** by design (a translation table would invent or drop
|
|
51
|
+
* grants), which is right for the enforcement path — the catalog refuses what it does not know — and is
|
|
52
|
+
* exactly why the check has to be here, at the boundary that *generates* rather than the one that enforces.
|
|
53
|
+
*
|
|
54
|
+
* The grammar is the one the README documents: `tool:<name>`, `skill:<name>`, `agent:<name>`,
|
|
55
|
+
* `workspace:<id>`, and `ext:<pkg>/<tool>` where `<pkg>` may be npm-scoped. No wildcards — those are refused
|
|
56
|
+
* separately and loudly, because "you tried to grant yourself everything" is a different fact from "that is
|
|
57
|
+
* not a name".
|
|
58
|
+
*
|
|
59
|
+
* `workspace:` was absent until 2026-08-21, so the boundary that GENERATES grants could not emit the one
|
|
60
|
+
* capability ADR-0035's breaking change made mandatory: a package needing to route was reported as declaring
|
|
61
|
+
* something that "is not a name". A namespace has to be added here as well as to the enforcing path, and
|
|
62
|
+
* that is the whole lesson of the review this came out of.
|
|
63
|
+
*/
|
|
64
|
+
// Imported as well as re-exported: a bare `export … from` does not bind the name in this module's scope, and
|
|
65
|
+
// `refusalFor` below calls it. Re-exported because this has been the import site since 0.13.0.
|
|
66
|
+
export { isSafeCapability };
|
|
67
|
+
/**
|
|
68
|
+
* The ids that confer authority over a whole namespace. A package declaring one is claiming it, not
|
|
69
|
+
* describing a need — so it is reported as a *wildcard claim* rather than as a malformed name, which is a
|
|
70
|
+
* different sentence to show an operator. `workspace:*` belongs here for the same reason `agent:*` does.
|
|
71
|
+
*/
|
|
72
|
+
function wildcardsIn(capabilities) {
|
|
73
|
+
return capabilities.filter((c) => c === WILDCARD || c === AGENT_WILDCARD || c === WORKSPACE_WILDCARD);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Everything about one declared skill that would make it unsafe to scaffold. `null` when it is fine.
|
|
77
|
+
*
|
|
78
|
+
* Ordered so the operator is told the most actionable thing: a wildcard is a deliberate claim, an unsafe id
|
|
79
|
+
* is probably a typo or an attack, and a bad name is neither.
|
|
80
|
+
*/
|
|
81
|
+
function refusalFor(skill) {
|
|
82
|
+
const name = skill.definition.name;
|
|
83
|
+
if (!isSafeName(name))
|
|
84
|
+
return { subject: name, reason: "unsafe-name", detail: [name] };
|
|
85
|
+
const ceiling = ceilingForDefinition(skill.definition);
|
|
86
|
+
const wildcards = wildcardsIn(ceiling.capabilities);
|
|
87
|
+
if (wildcards.length > 0)
|
|
88
|
+
return { subject: name, reason: "wildcard", detail: wildcards };
|
|
89
|
+
const unsafe = ceiling.capabilities.filter((c) => !isSafeCapability(c));
|
|
90
|
+
if (unsafe.length > 0)
|
|
91
|
+
return { subject: name, reason: "unsafe-capability", detail: unsafe };
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
/** One `pi.skills` entry: a directory holding `SKILL.md`, or a `.md` file — the same two shapes pi allows. */
|
|
95
|
+
async function readSkill(packageDir, entry) {
|
|
96
|
+
const target = resolve(packageDir, entry);
|
|
97
|
+
// A manifest is data from another package, so an entry escaping its own directory is refused rather than
|
|
98
|
+
// followed. **`realpath`, not a lexical prefix test** (R-80): `resolve()` normalises `..` and knows
|
|
99
|
+
// nothing about symlinks, so a packaged symlink walked straight past the first version of this check and
|
|
100
|
+
// a definition from outside the package was copied in, with its `allowed-tools` landing in the operator's
|
|
101
|
+
// grant. Measured. This is the same lesson as the `realpathSync` fix in `cli.ts`, which was found by the
|
|
102
|
+
// smoke test one day earlier and not applied here.
|
|
103
|
+
const realPackageDir = await realpath(packageDir).catch(() => packageDir);
|
|
104
|
+
for (const path of [join(target, "SKILL.md"), ...(target.endsWith(".md") ? [target] : [])]) {
|
|
105
|
+
let bytes;
|
|
106
|
+
try {
|
|
107
|
+
bytes = await readFile(path);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const realPath = await realpath(path).catch(() => path);
|
|
113
|
+
if (!realPath.startsWith(realPackageDir + sep))
|
|
114
|
+
return null;
|
|
115
|
+
// "The file verbatim … nothing is lost in a round trip" is a claim this module makes, so bytes that
|
|
116
|
+
// cannot survive the round trip are refused rather than silently replaced. A latin-1 `0xE9` used to come
|
|
117
|
+
// back as U+FFFD, changing the file's length and its digest, with no warning.
|
|
118
|
+
const text = bytes.toString("utf8");
|
|
119
|
+
if (!Buffer.from(text, "utf8").equals(bytes))
|
|
120
|
+
return "not-utf8";
|
|
121
|
+
const definition = parseSkillDefinition(path, text);
|
|
122
|
+
return definition ? { definition, text, path } : null;
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
/** Read one installed package, if it declares skills. `null` means "not a skill package", not an error. */
|
|
127
|
+
export async function readSkillPackage(packageDir) {
|
|
128
|
+
let manifest;
|
|
129
|
+
try {
|
|
130
|
+
manifest = JSON.parse(await readFile(join(packageDir, "package.json"), "utf8"));
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
const declared = manifest.pi?.skills;
|
|
136
|
+
if (!Array.isArray(declared) || declared.length === 0)
|
|
137
|
+
return null;
|
|
138
|
+
const skills = [];
|
|
139
|
+
const unreadable = [];
|
|
140
|
+
const refused = [];
|
|
141
|
+
for (const entry of declared) {
|
|
142
|
+
if (typeof entry !== "string")
|
|
143
|
+
continue;
|
|
144
|
+
const skill = await readSkill(packageDir, entry);
|
|
145
|
+
if (skill === null) {
|
|
146
|
+
unreadable.push(entry);
|
|
147
|
+
}
|
|
148
|
+
else if (skill === "not-utf8") {
|
|
149
|
+
refused.push({ subject: entry, reason: "not-utf8", detail: [] });
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
const refusal = refusalFor(skill);
|
|
153
|
+
if (refusal)
|
|
154
|
+
refused.push(refusal);
|
|
155
|
+
else
|
|
156
|
+
skills.push(skill);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
name: manifest.name ?? packageDir.split(sep).pop() ?? "(unnamed)",
|
|
161
|
+
version: manifest.version ?? "(no version)",
|
|
162
|
+
unreadable,
|
|
163
|
+
refused,
|
|
164
|
+
skills,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Every installed package under `<cwd>/node_modules` that declares `pi.skills`, sorted by name.
|
|
169
|
+
*
|
|
170
|
+
* Top level and one scope deep, which is what npm's layout has. Nothing recurses into a dependency's own
|
|
171
|
+
* `node_modules`: a transitive skill package is not something an operator asked to install definitions
|
|
172
|
+
* from, and scaffolding one into their project would be a surprise wearing a helpful face.
|
|
173
|
+
*/
|
|
174
|
+
/**
|
|
175
|
+
* Every place a pi package can be installed, most specific first (R-75).
|
|
176
|
+
*
|
|
177
|
+
* **Two roots, because pi has two install paths and only one of them is `npm install`.** `pi install
|
|
178
|
+
* npm:principal-pi-skills` — the documented, pi-native way, and the only one that registers the package so
|
|
179
|
+
* pi will auto-load its extension — puts it in `$PI_CODING_AGENT_DIR/npm/node_modules`, and leaves the
|
|
180
|
+
* project without a `node_modules` at all. Searching only `<cwd>/node_modules` therefore found **nothing**
|
|
181
|
+
* for an operator who followed pi's own instructions, and said "install principal-pi-skills" to somebody
|
|
182
|
+
* who just had.
|
|
183
|
+
*
|
|
184
|
+
* Measured, in a fresh `PI_CODING_AGENT_DIR` with an empty project: `pi install` populates the agent root
|
|
185
|
+
* and creates no project root.
|
|
186
|
+
*
|
|
187
|
+
* Project first when both exist, because a package pinned in the repository is the one the team agreed on.
|
|
188
|
+
*/
|
|
189
|
+
export function skillPackageRoots(cwd) {
|
|
190
|
+
const agentDir = resolveAgentDir();
|
|
191
|
+
return [join(cwd, "node_modules"), join(agentDir, "npm", "node_modules")];
|
|
192
|
+
}
|
|
193
|
+
export async function discoverSkillPackages(cwd) {
|
|
194
|
+
const resolved = await resolveSkillResources(cwd);
|
|
195
|
+
const packages = [];
|
|
196
|
+
const seenSkills = new Set();
|
|
197
|
+
const runtimeNames = new Set(resolved.skills.map((s) => skillResourceName(s.path)));
|
|
198
|
+
const configuredRoots = new Set(resolved.configured.flatMap((p) => (p.installedPath ? [resolve(p.installedPath)] : [])));
|
|
199
|
+
const configuredNames = new Set(resolved.configured.flatMap((p) => {
|
|
200
|
+
if (!p.source.startsWith("npm:"))
|
|
201
|
+
return [];
|
|
202
|
+
const spec = p.source.slice(4);
|
|
203
|
+
const versionAt = spec.indexOf("@", 1);
|
|
204
|
+
return [versionAt < 0 ? spec : spec.slice(0, versionAt)];
|
|
205
|
+
}));
|
|
206
|
+
for (const root of configuredRoots) {
|
|
207
|
+
try {
|
|
208
|
+
configuredNames.add(JSON.parse(await readFile(join(root, "package.json"), "utf8")).name);
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
/* absent */
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
for (const resource of resolved.skills) {
|
|
215
|
+
const bytes = await readFile(resource.path).catch(() => null);
|
|
216
|
+
if (bytes === null)
|
|
217
|
+
continue;
|
|
218
|
+
const text = bytes.toString("utf8");
|
|
219
|
+
const resourceName = skillResourceName(resource.path);
|
|
220
|
+
if (seenSkills.has(resourceName))
|
|
221
|
+
continue;
|
|
222
|
+
seenSkills.add(resourceName);
|
|
223
|
+
let name = resource.metadata.source;
|
|
224
|
+
let version = "local";
|
|
225
|
+
if (resource.metadata.origin === "package" && resource.metadata.baseDir) {
|
|
226
|
+
try {
|
|
227
|
+
const manifest = JSON.parse(await readFile(join(resource.metadata.baseDir, "package.json"), "utf8"));
|
|
228
|
+
name = manifest.name ?? name;
|
|
229
|
+
version = manifest.version ?? version;
|
|
230
|
+
}
|
|
231
|
+
catch {
|
|
232
|
+
/* the resource can be used without optional display metadata */
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
else
|
|
236
|
+
name = `${resource.metadata.scope} skills`;
|
|
237
|
+
let pkg = packages.find((p) => p.name === name && p.version === version);
|
|
238
|
+
if (!pkg) {
|
|
239
|
+
pkg = { name, version, skills: [], refused: [], unreadable: [] };
|
|
240
|
+
packages.push(pkg);
|
|
241
|
+
}
|
|
242
|
+
if (!Buffer.from(text, "utf8").equals(bytes)) {
|
|
243
|
+
pkg.refused.push({ subject: resourceName, reason: "not-utf8", detail: [] });
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
const definition = parseSkillDefinition(resource.path, text);
|
|
247
|
+
if (!definition)
|
|
248
|
+
continue;
|
|
249
|
+
const skill = { definition, text, path: resource.path, referenced: true };
|
|
250
|
+
const refusal = refusalFor(skill);
|
|
251
|
+
if (refusal)
|
|
252
|
+
pkg.refused.push(refusal);
|
|
253
|
+
else
|
|
254
|
+
pkg.skills.push(skill);
|
|
255
|
+
}
|
|
256
|
+
// Compatibility for npm installs that were never registered with Pi. Runtime discovery never scans
|
|
257
|
+
// node_modules. A configured package (including one disabled by a filter) must not re-enter here.
|
|
258
|
+
const dirs = [];
|
|
259
|
+
for (const root of skillPackageRoots(cwd))
|
|
260
|
+
await collectFrom(root, dirs);
|
|
261
|
+
const seenNames = new Set(packages.map((p) => p.name));
|
|
262
|
+
for (const dir of dirs) {
|
|
263
|
+
if (configuredRoots.has(resolve(dir)))
|
|
264
|
+
continue;
|
|
265
|
+
const found = await readSkillPackage(dir);
|
|
266
|
+
if (!found || configuredNames.has(found.name) || seenNames.has(found.name))
|
|
267
|
+
continue;
|
|
268
|
+
seenNames.add(found.name);
|
|
269
|
+
found.skills = found.skills.filter((skill) => !runtimeNames.has(skill.definition.name));
|
|
270
|
+
packages.push(found);
|
|
271
|
+
}
|
|
272
|
+
return packages;
|
|
273
|
+
}
|
|
274
|
+
/** Append every package directory under one `node_modules`, scoped packages included. */
|
|
275
|
+
async function collectFrom(root, dirs) {
|
|
276
|
+
let entries;
|
|
277
|
+
try {
|
|
278
|
+
entries = await readdir(root);
|
|
279
|
+
}
|
|
280
|
+
catch {
|
|
281
|
+
return; // a root that does not exist is a normal state, not a failure
|
|
282
|
+
}
|
|
283
|
+
for (const entry of entries.sort()) {
|
|
284
|
+
if (entry.startsWith("."))
|
|
285
|
+
continue; // .bin, .package-lock.json
|
|
286
|
+
if (entry.startsWith("@")) {
|
|
287
|
+
try {
|
|
288
|
+
for (const scoped of (await readdir(join(root, entry))).sort())
|
|
289
|
+
dirs.push(join(root, entry, scoped));
|
|
290
|
+
}
|
|
291
|
+
catch {
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
dirs.push(join(root, entry));
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=skill-packages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-packages.js","sourceRoot":"","sources":["../../src/kernel/skill-packages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAwB,MAAM,kBAAkB,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAmB,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAwCjE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,8BAA8B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,6GAA6G;AAC7G,+FAA+F;AAC/F,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B;;;;GAIG;AACH,SAAS,WAAW,CAAC,YAA0B;IAC7C,OAAO,YAAY,CAAC,M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M,CAAA;SAAE,CAAC;KAC/E,EAAE,CAAC;IACJ,UAAU,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACzE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAItD;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CA0ChF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** Read Pi's configured resource surface without locks, installs, extension execution or model calls. */
|
|
2
|
+
import { readFileSync, statSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { DefaultPackageManager, getAgentDir, SettingsManager } from "@earendil-works/pi-coding-agent";
|
|
5
|
+
import { piProjectDir } from "./project-paths.js";
|
|
6
|
+
export function skillResourceName(path) {
|
|
7
|
+
const parts = path.split(/[\\/]/);
|
|
8
|
+
const file = parts.at(-1) ?? "";
|
|
9
|
+
return file.toLowerCase() === "skill.md" ? (parts.at(-2) ?? "") : file.replace(/\.md$/i, "");
|
|
10
|
+
}
|
|
11
|
+
export async function resolveSkillResources(cwd) {
|
|
12
|
+
const agentDir = getAgentDir();
|
|
13
|
+
const settingsManager = SettingsManager.fromStorage({
|
|
14
|
+
withLock(scope, read) {
|
|
15
|
+
const path = scope === "global" ? join(agentDir, "settings.json") : join(piProjectDir(cwd), "settings.json");
|
|
16
|
+
let text;
|
|
17
|
+
try {
|
|
18
|
+
text = readFileSync(path, "utf8");
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
if (error.code !== "ENOENT")
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
// This storage is intentionally read-only: no lock files or migrated settings are persisted.
|
|
25
|
+
read(text);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const errors = settingsManager.drainErrors();
|
|
29
|
+
if (errors.length)
|
|
30
|
+
throw new Error(`Cannot discover skills: ${errors.map((e) => `${e.scope} settings: ${e.error.message}`).join("; ")}`);
|
|
31
|
+
const manager = new DefaultPackageManager({ cwd, agentDir, settingsManager });
|
|
32
|
+
const resolved = await manager.resolve(async () => "skip");
|
|
33
|
+
// Pi has already applied package identity, scope, manifest and settings filters and precedence.
|
|
34
|
+
const seen = new Set();
|
|
35
|
+
const skills = resolved.skills
|
|
36
|
+
.filter((resource) => resource.enabled)
|
|
37
|
+
.flatMap((resource) => {
|
|
38
|
+
try {
|
|
39
|
+
const path = statSync(resource.path).isDirectory() ? join(resource.path, "SKILL.md") : resource.path;
|
|
40
|
+
return statSync(path).isFile() ? [{ ...resource, path }] : [];
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
.filter((resource) => {
|
|
47
|
+
// Reserve identity before parsing: a malformed local override cannot reveal a wider package ceiling.
|
|
48
|
+
const name = skillResourceName(resource.path);
|
|
49
|
+
if (seen.has(name))
|
|
50
|
+
return false;
|
|
51
|
+
seen.add(name);
|
|
52
|
+
return true;
|
|
53
|
+
});
|
|
54
|
+
return { skills, configured: manager.listConfiguredPackages() };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=skill-resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-resources.js","sourceRoot":"","sources":["../../src/kernel/skill-resources.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACtG,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD,MAAM,UAAU,iBAAiB,CAAC,IAAY;IA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C;IACd,CAAC,CAAC,CAAC;IACL,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the argv for a governed descendant pi process.
|
|
3
|
+
*
|
|
4
|
+
* The enforcement point is pi core, not this package: `--tools` and `--no-tools` hard-block extension
|
|
5
|
+
* tools, and an explicitly `-e`-loaded extension cannot re-add its tool past them (verified,
|
|
6
|
+
* probe `pi-fabric-eval` probes 9–11). So governance reduces to "compute the allowlist correctly
|
|
7
|
+
* and hand it to pi", with no runtime inside the descendant.
|
|
8
|
+
*/
|
|
9
|
+
import { type Capability } from "./resolve.ts";
|
|
10
|
+
export interface SpawnPlanInput {
|
|
11
|
+
effective: Capability[];
|
|
12
|
+
prompt: string;
|
|
13
|
+
model?: string;
|
|
14
|
+
provider?: string;
|
|
15
|
+
thinking?: string;
|
|
16
|
+
/** Session file path, or omit for an ephemeral child. */
|
|
17
|
+
sessionFile?: string;
|
|
18
|
+
/** Non-interactive by default: a governed child should not prompt a human. */
|
|
19
|
+
print?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Absolute path per skill NAME (`review` -> `/…/review`), as the catalog discovered them.
|
|
22
|
+
*
|
|
23
|
+
* R-32. Only skills named by a `skill:` capability in `effective` are passed, and a granted skill
|
|
24
|
+
* absent from this map is reported in `unresolvedSkills` rather than dropped.
|
|
25
|
+
*/
|
|
26
|
+
skillPaths?: Record<string, string>;
|
|
27
|
+
/**
|
|
28
|
+
* Let the child load `AGENTS.md` / `CLAUDE.md`. **Default false** — see the `--no-context-files`
|
|
29
|
+
* note in `planSpawn`.
|
|
30
|
+
*/
|
|
31
|
+
contextFiles?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Instructions appended to the child's system prompt — a definition's `SKILL.md` body (ADR-0016).
|
|
34
|
+
*
|
|
35
|
+
* Appended rather than replacing, so pi's own coding-assistant prompt survives underneath and a
|
|
36
|
+
* definition only has to describe its own job.
|
|
37
|
+
*/
|
|
38
|
+
systemPrompt?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SpawnPlan {
|
|
41
|
+
args: string[];
|
|
42
|
+
/** The tool names pi will allow, for the ledger. `null` means no tools at all. */
|
|
43
|
+
allowlist: string[] | null;
|
|
44
|
+
/** Skill paths handed to the child, for the ledger. */
|
|
45
|
+
skills: string[];
|
|
46
|
+
/**
|
|
47
|
+
* Granted `skill:` capabilities with no known path. **Non-empty means the caller should refuse**:
|
|
48
|
+
* the child would silently lack a capability its grant says it holds.
|
|
49
|
+
*/
|
|
50
|
+
unresolvedSkills: Capability[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Produce `pi` arguments enforcing `effective`.
|
|
54
|
+
*
|
|
55
|
+
* Note the `--no-tools` branch: pi rejects an empty `--tools` list, and passing no flag at all would
|
|
56
|
+
* silently fall back to pi's defaults — which is the opposite of a zero grant. An empty grant must be
|
|
57
|
+
* expressed explicitly.
|
|
58
|
+
*/
|
|
59
|
+
export declare function planSpawn(input: SpawnPlanInput): SpawnPlan;
|
|
60
|
+
//# sourceMappingURL=spawn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../src/kernel/spawn.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,kFAAkF;IAClF,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC3B,uDAAuD;IACvD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;OAGG;IACH,gBAAgB,EAAE,UAAU,EAAE,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CA8D1D"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the argv for a governed descendant pi process.
|
|
3
|
+
*
|
|
4
|
+
* The enforcement point is pi core, not this package: `--tools` and `--no-tools` hard-block extension
|
|
5
|
+
* tools, and an explicitly `-e`-loaded extension cannot re-add its tool past them (verified,
|
|
6
|
+
* probe `pi-fabric-eval` probes 9–11). So governance reduces to "compute the allowlist correctly
|
|
7
|
+
* and hand it to pi", with no runtime inside the descendant.
|
|
8
|
+
*/
|
|
9
|
+
import { toPiToolsAllowlist } from "./resolve.js";
|
|
10
|
+
/**
|
|
11
|
+
* Produce `pi` arguments enforcing `effective`.
|
|
12
|
+
*
|
|
13
|
+
* Note the `--no-tools` branch: pi rejects an empty `--tools` list, and passing no flag at all would
|
|
14
|
+
* silently fall back to pi's defaults — which is the opposite of a zero grant. An empty grant must be
|
|
15
|
+
* expressed explicitly.
|
|
16
|
+
*/
|
|
17
|
+
export function planSpawn(input) {
|
|
18
|
+
const allowlist = toPiToolsAllowlist(input.effective);
|
|
19
|
+
const args = [];
|
|
20
|
+
if (input.print !== false)
|
|
21
|
+
args.push("--print");
|
|
22
|
+
if (input.provider)
|
|
23
|
+
args.push("--provider", input.provider);
|
|
24
|
+
if (input.model)
|
|
25
|
+
args.push("--model", input.model);
|
|
26
|
+
if (input.thinking)
|
|
27
|
+
args.push("--thinking", input.thinking);
|
|
28
|
+
if (input.sessionFile)
|
|
29
|
+
args.push("--session", input.sessionFile);
|
|
30
|
+
else
|
|
31
|
+
args.push("--no-session");
|
|
32
|
+
// Disable discovery so ambient user extensions cannot widen a governed child's surface. Explicit
|
|
33
|
+
// `-e` paths would still load, so this package never passes one.
|
|
34
|
+
args.push("--no-extensions");
|
|
35
|
+
// R-32. `--no-extensions` governs EXTENSIONS ONLY — measured, not assumed: a child spawned with
|
|
36
|
+
// `--tools read` still loaded all eight of the operator's skills and `CLAUDE.md`
|
|
37
|
+
// (probe `g16-herdr` §4-5). Skills are injected into the system prompt rather than passed as
|
|
38
|
+
// tools, so `--tools` cannot reach them and the `skill:` namespace enforced nothing at all.
|
|
39
|
+
//
|
|
40
|
+
// `--no-skills` is unconditional and `--skill` is added on top, because that is exactly how pi
|
|
41
|
+
// resolves them (`dist/core/resource-loader.js:329`): with `noSkills` set, discovered skills are
|
|
42
|
+
// dropped and explicitly-passed paths are kept. Passing `--skill` WITHOUT `--no-skills` would add to
|
|
43
|
+
// the discovered set instead of replacing it — an allowlist that widens, which is the failure
|
|
44
|
+
// direction this package exists to prevent.
|
|
45
|
+
const skills = [];
|
|
46
|
+
const unresolvedSkills = [];
|
|
47
|
+
for (const capability of input.effective) {
|
|
48
|
+
if (!capability.startsWith("skill:"))
|
|
49
|
+
continue;
|
|
50
|
+
const path = input.skillPaths?.[capability.slice(6)];
|
|
51
|
+
if (path)
|
|
52
|
+
skills.push(path);
|
|
53
|
+
else
|
|
54
|
+
unresolvedSkills.push(capability);
|
|
55
|
+
}
|
|
56
|
+
args.push("--no-skills");
|
|
57
|
+
for (const path of skills)
|
|
58
|
+
args.push("--skill", path);
|
|
59
|
+
// Context files are model-directing text that NO capability describes and no ledger line records, so
|
|
60
|
+
// a child inheriting them holds influence its grant does not express. Under ADR-0012's threat model
|
|
61
|
+
// — prompt injection explicitly in scope — an untrusted repository's `CLAUDE.md` reaching a governed
|
|
62
|
+
// child is the injection vector. Off by default therefore, but deliberately still expressible:
|
|
63
|
+
// inheriting a project's conventions is often exactly what an operator wants, and that should be a
|
|
64
|
+
// decision they make rather than one this package makes silently in either direction.
|
|
65
|
+
if (!input.contextFiles)
|
|
66
|
+
args.push("--no-context-files");
|
|
67
|
+
// Prompt templates are the third resource class that `--no-extensions` does not cover — found in the
|
|
68
|
+
// banner of the very run that verified the two above. Lower risk than skills (a template is expanded
|
|
69
|
+
// when a human invokes `/name`, not injected into the system prompt) but withheld for consistency:
|
|
70
|
+
// under a herdr backend a governed child runs in an attachable pane WITH a human, so "only what the
|
|
71
|
+
// grant names" must not depend on which executor ran it.
|
|
72
|
+
args.push("--no-prompt-templates");
|
|
73
|
+
// A definition's body, so the child IS the reviewer rather than merely holding a reviewer's tools.
|
|
74
|
+
// Note this is operator-authored text from a file on disk, not a model-chosen string — the model
|
|
75
|
+
// picks WHICH definition, never its contents. That is what keeps it out of `neutralisePrompt`'s
|
|
76
|
+
// remit: the G1 hazard is a model-controlled string reaching a parser, and this is not one.
|
|
77
|
+
if (input.systemPrompt)
|
|
78
|
+
args.push("--append-system-prompt", input.systemPrompt);
|
|
79
|
+
if (allowlist)
|
|
80
|
+
args.push("--tools", allowlist.join(","));
|
|
81
|
+
else
|
|
82
|
+
args.push("--no-tools");
|
|
83
|
+
args.push(neutralisePrompt(input.prompt));
|
|
84
|
+
return { args, allowlist, skills, unresolvedSkills };
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Make a model-controlled task unparseable by pi's CLI.
|
|
88
|
+
*
|
|
89
|
+
* pi's usage is `pi [options] [@files...] [messages...]`, and both of the non-message forms are reached
|
|
90
|
+
* by the FIRST CHARACTER of an argv element:
|
|
91
|
+
*
|
|
92
|
+
* - `@…` is resolved as a file and its contents injected into the child's prompt — absolute paths, `~`
|
|
93
|
+
* expansion, no sandbox. This happens in `main.js` before any tool is constructed, so `--tools` and
|
|
94
|
+
* `--no-tools` never apply to it. A child granted nothing at all still reads the file. Verified
|
|
95
|
+
* against pi 0.83.0 (review finding A-C1 / B-C7, and probe `g1-argv`).
|
|
96
|
+
* - `-…` is parsed as a flag, and pi ships `--approve` ("trust project-local files for this run").
|
|
97
|
+
*
|
|
98
|
+
* The task comes from the model, so this is the one place in the package where a model-authored string
|
|
99
|
+
* would otherwise reach a parser that outranks the enforcement point. A single leading space removes it
|
|
100
|
+
* from both branches: pi does not trim before dispatching on the prefix (measured), and a leading space
|
|
101
|
+
* is semantically nil inside a prompt.
|
|
102
|
+
*
|
|
103
|
+
* **It is applied unconditionally, and that is the point.** Rewriting only arguments that start with
|
|
104
|
+
* `@` or `-` would encode pi 0.83.0's current parser into this package and silently re-open the hole
|
|
105
|
+
* the moment pi — or an extension registering its own flags — adds a third prefix. The guarantee here is
|
|
106
|
+
* positional rather than pattern-based: the first character of that argv element is never the task's.
|
|
107
|
+
*
|
|
108
|
+
* Deliberately NOT a refusal. The review also suggested rejecting `@`/`-` tasks in `planDelegation` so
|
|
109
|
+
* they land in the ledger. Neutralising costs no false refusals and needs no judgement about which
|
|
110
|
+
* prompts are legitimate, so it is the whole fix; recording an attempt is an audit question (G6), not a
|
|
111
|
+
* security one, and is left to that group.
|
|
112
|
+
*/
|
|
113
|
+
function neutralisePrompt(prompt) {
|
|
114
|
+
return ` ${prompt}`;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=spawn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../src/kernel/spawn.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAmB,MAAM,cAAc,CAAC;AA8CnE;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,SAAS,GAAG,kBAAkB,C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| "write";
|
|
3
|
+
export interface WorkspaceRegistryFile {
|
|
4
|
+
version: 1;
|
|
5
|
+
workspaces: Record<string, {
|
|
6
|
+
path: string;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* Where this was loaded from, carried so a refusal can NAME it.
|
|
10
|
+
*
|
|
11
|
+
* The README claimed an unregistered id is refused "with `WORKSPACE_NOT_REGISTERED`, which names the
|
|
12
|
+
* file", and `catalog.ts` justified exempting the whole namespace from the unknown check on the strength of
|
|
13
|
+
* that — *"a second, weaker check here can only turn that precise refusal into a misleading one"*. The
|
|
14
|
+
* refusal named no file: the registry object had no idea where it came from. Carried on the object rather
|
|
15
|
+
* than passed per call so a caller cannot forget it. Optional because a hand-built literal (tests,
|
|
16
|
+
* `workspaceEntries` fixtures) has no source.
|
|
17
|
+
*/
|
|
18
|
+
source?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ValidatedWorkspace {
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
/** Canonical Git worktree root and the child's validated initial CWD. Not a sandbox. */
|
|
23
|
+
root: string;
|
|
24
|
+
gitCommonDir: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function loadWorkspaceRegistry(path: string): Promise<WorkspaceRegistryFile>;
|
|
27
|
+
/**
|
|
28
|
+
* The registered workspace ids, for `planInit` to scaffold and `/grants` to list. `[]` when there is no registry or it is broken.
|
|
29
|
+
*
|
|
30
|
+
* Fails SOFT, and only because nothing here is an authority: this decides which ids appear as COMMENTS in a
|
|
31
|
+
* generated file. `loadWorkspaceRegistry` throws a GovernanceRefusal naming the file, and that refusal is
|
|
32
|
+
* the operator's signal at the point of use, where routing genuinely depends on it. Swallowing it there
|
|
33
|
+
* would be unsafe; swallowing it here costs a suggestion. Same argument as `buildCatalog`'s.
|
|
34
|
+
*
|
|
35
|
+
* Lives here rather than in `init.ts` because it reads the filesystem, and `planInit` — the centrepiece of
|
|
36
|
+
* that module — documents itself as "Pure: no filesystem". It is a registry concern; this is where the
|
|
37
|
+
* registry lives. Moved when `init.ts` crossed the 400-line ceiling, which this project splits for rather
|
|
38
|
+
* than raising (`delegate.ts` at 413, `grants.ts` at 398).
|
|
39
|
+
*/
|
|
40
|
+
export declare function registeredWorkspaceIds(registryPath?: string | undefined): Promise<string[]>;
|
|
41
|
+
export declare function resolveWorkspace(registry: WorkspaceRegistryFile, workspaceId: string): Promise<ValidatedWorkspace>;
|
|
42
|
+
/**
|
|
43
|
+
* Canonicalize and validate the initial workspace against Git's registered worktree list.
|
|
44
|
+
* This prevents accidental misrouting. It does not constrain any path a child accesses after spawn.
|
|
45
|
+
*/
|
|
46
|
+
export declare function validateRegisteredWorkspace(input: {
|
|
47
|
+
workspaceId: string;
|
|
48
|
+
registeredRoot: string;
|
|
49
|
+
suppliedRoot?: string;
|
|
50
|
+
}): Promise<ValidatedWorkspace>;
|
|
51
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/kernel/workspace.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAIxD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/C,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAsBD,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAoKxF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAAC,YAAY,qBAAsC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAOlH;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,qBAAqB,EAC/B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,kBAAkB,CAAC,CAe7B;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAAC,KAAK,EAAE;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA0D9B"}
|