@sema-agent/core 7.55.0 → 7.57.0
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 +1054 -0
- package/LICENSE +1 -1
- package/dist/agents/cascade.js +1 -1
- package/dist/agents/cc-peer-directory.js +1 -0
- package/dist/agents/child-model-seat.d.ts +0 -11
- package/dist/agents/child-model-seat.js +0 -3
- package/dist/agents/list-agents-tool.d.ts +3 -1
- package/dist/agents/list-agents-tool.js +7 -7
- package/dist/agents/org-delivery-gate.js +3 -4
- package/dist/agents/peer-directory.d.ts +22 -4
- package/dist/agents/peer-directory.js +24 -2
- package/dist/agents/peer-held-queue.d.ts +69 -49
- package/dist/agents/peer-held-queue.js +255 -106
- package/dist/agents/peer-session-drain.js +65 -45
- package/dist/agents/repair-loop.js +2 -2
- package/dist/agents/send-message-tool.js +7 -6
- package/dist/agents/subagent.d.ts +6 -4
- package/dist/agents/subagent.js +72 -68
- package/dist/agents/tool-filter.d.ts +7 -5
- package/dist/agents/tool-filter.js +12 -9
- package/dist/agents/verify.d.ts +3 -2
- package/dist/agents/verify.js +3 -3
- package/dist/brain/anthropic.js +45 -80
- package/dist/brain/media-degrade.d.ts +18 -7
- package/dist/brain/media-degrade.js +13 -2
- package/dist/brain/model-capability.d.ts +37 -0
- package/dist/brain/model-capability.js +34 -0
- package/dist/brain/model-presets.d.ts +2 -8
- package/dist/brain/model-presets.js +1 -6
- package/dist/brain/open-responses.js +23 -34
- package/dist/brain/openai.js +25 -96
- package/dist/brain/provider-dialect.d.ts +3 -2
- package/dist/brain/provider-dialect.js +2 -2
- package/dist/brain/reasoning-request.d.ts +96 -0
- package/dist/brain/reasoning-request.js +174 -0
- package/dist/brain/reasoning.d.ts +11 -11
- package/dist/brain/reasoning.js +4 -3
- package/dist/brain/request-params.d.ts +13 -4
- package/dist/brain/request-params.js +21 -5
- package/dist/brain/status-sink.d.ts +20 -0
- package/dist/brain/status-sink.js +7 -0
- package/dist/brain/stream-engine.d.ts +9 -0
- package/dist/brain/stream-engine.js +24 -10
- package/dist/brain/stream-shared.d.ts +5 -4
- package/dist/brain/stream-shared.js +4 -4
- package/dist/core/a2a.d.ts +2 -1
- package/dist/core/a2a.js +19 -13
- package/dist/core/agent-definition.d.ts +10 -0
- package/dist/core/allow-entry.d.ts +23 -23
- package/dist/core/allow-entry.js +42 -46
- package/dist/core/allow-rule-shadow.d.ts +3 -3
- package/dist/core/approval-object.d.ts +21 -5
- package/dist/core/approval-object.js +44 -17
- package/dist/core/ask-origin.d.ts +66 -20
- package/dist/core/ask-origin.js +63 -23
- package/dist/core/ask-question.d.ts +51 -8
- package/dist/core/ask-question.js +3 -4
- package/dist/core/ask-unresolvable-notice.d.ts +8 -3
- package/dist/core/ask-unresolvable-notice.js +16 -2
- package/dist/core/auto-compaction.d.ts +71 -6
- package/dist/core/auto-compaction.js +42 -26
- package/dist/core/background-agent-store.d.ts +6 -2
- package/dist/core/background-agent-store.js +1 -1
- package/dist/core/checkpoint-generation.d.ts +53 -0
- package/dist/core/checkpoint-generation.js +35 -0
- package/dist/core/checkpoint-queries.d.ts +180 -0
- package/dist/core/checkpoint-queries.js +272 -0
- package/dist/core/checkpoint-requirements.d.ts +19 -1
- package/dist/core/checkpoint-requirements.js +6 -0
- package/dist/core/checkpoint-store.d.ts +105 -53
- package/dist/core/checkpoint-store.js +43 -20
- package/dist/core/cross-boundary-taint.d.ts +6 -5
- package/dist/core/cross-boundary-taint.js +5 -5
- package/dist/core/decision-receipt.d.ts +37 -3
- package/dist/core/decision-receipt.js +17 -17
- package/dist/core/delegation-not-started.d.ts +6 -0
- package/dist/core/delegation-not-started.js +17 -0
- package/dist/core/engine-attestation.d.ts +93 -0
- package/dist/core/engine-attestation.js +70 -0
- package/dist/core/engine-capabilities.d.ts +4 -1
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-notice.d.ts +32 -12
- package/dist/core/engine-notice.js +6 -0
- package/dist/core/file-history-store.d.ts +104 -22
- package/dist/core/file-history-store.js +37 -19
- package/dist/core/gate-fold.d.ts +1 -1
- package/dist/core/gate-fold.js +22 -10
- package/dist/core/gate-lanes.js +73 -65
- package/dist/core/gate-outcome.d.ts +26 -5
- package/dist/core/gate-outcome.js +26 -0
- package/dist/core/governance-codes.d.ts +5 -1
- package/dist/core/governance-codes.js +6 -0
- package/dist/core/hooks.d.ts +19 -18
- package/dist/core/hooks.js +3 -1
- package/dist/core/host-floor.d.ts +128 -0
- package/dist/core/host-floor.js +206 -0
- package/dist/core/host-target.d.ts +38 -3
- package/dist/core/host-target.js +38 -5
- package/dist/core/mailbox-store.d.ts +62 -1
- package/dist/core/mailbox-store.js +59 -0
- package/dist/core/mcp-name-judge.d.ts +46 -0
- package/dist/core/mcp-name-judge.js +61 -0
- package/dist/core/mcp-probe.d.ts +1 -1
- package/dist/core/mcp-probe.js +2 -5
- package/dist/core/mcp.d.ts +5 -1
- package/dist/core/mcp.js +70 -64
- package/dist/core/memory-engine/consolidation-driver.js +4 -3
- package/dist/core/memory-engine/delegation-settlement.js +15 -24
- package/dist/core/memory-engine/distiller.js +26 -17
- package/dist/core/memory-engine/engine.js +4 -4
- package/dist/core/memory-engine/layout.d.ts +60 -8
- package/dist/core/memory-engine/layout.js +70 -8
- package/dist/core/model-seat.d.ts +10 -3
- package/dist/core/mods/classic-events.d.ts +67 -0
- package/dist/core/mods/classic-events.js +1 -0
- package/dist/core/mods/dollar.d.ts +13 -0
- package/dist/core/mods/extension-call.d.ts +31 -0
- package/dist/core/mods/extension-call.js +43 -0
- package/dist/core/mods/kernel/dispatch.d.ts +20 -3
- package/dist/core/mods/kernel/dispatch.js +140 -69
- package/dist/core/mods/kernel/events.d.ts +47 -11
- package/dist/core/mods/kernel/events.js +66 -42
- package/dist/core/mods/kernel/index.d.ts +4 -4
- package/dist/core/mods/kernel/index.js +2 -2
- package/dist/core/mods/kernel/receive.d.ts +39 -5
- package/dist/core/mods/kernel/receive.js +290 -17
- package/dist/core/mods/kernel/registration.d.ts +33 -2
- package/dist/core/mods/kernel/registration.js +6 -7
- package/dist/core/mods/kernel/site-rules.d.ts +44 -16
- package/dist/core/mods/kernel/site-rules.js +24 -42
- package/dist/core/mods/spec-seats.d.ts +69 -0
- package/dist/core/mods/spec-seats.js +114 -0
- package/dist/core/mods/stations.d.ts +28 -8
- package/dist/core/mods/stations.js +29 -13
- package/dist/core/mods/tool-call.d.ts +79 -0
- package/dist/core/mods/tool-call.js +152 -0
- package/dist/core/namespaced-rule-name.d.ts +32 -38
- package/dist/core/namespaced-rule-name.js +29 -36
- package/dist/core/parent-spec-seat.d.ts +6 -1
- package/dist/core/parent-spec-seat.js +2 -0
- package/dist/core/park-selfcheck.js +3 -0
- package/dist/core/permission-rule-consent.d.ts +24 -3
- package/dist/core/permission-rule-consent.js +136 -41
- package/dist/core/permission-rule-model.d.ts +57 -5
- package/dist/core/permission-rule-model.js +90 -31
- package/dist/core/permission-rule-org.d.ts +6 -2
- package/dist/core/permission-rule-org.js +8 -4
- package/dist/core/permission-rule-provider.d.ts +5 -2
- package/dist/core/permission-rule-provider.js +41 -11
- package/dist/core/permission-rule-store.d.ts +3 -2
- package/dist/core/permission-rule-store.js +11 -2
- package/dist/core/permission-rule-sync.js +3 -2
- package/dist/core/permission-rule-syntax.d.ts +5 -4
- package/dist/core/permission-rule-syntax.js +2 -2
- package/dist/core/permission-rules.d.ts +4 -4
- package/dist/core/permission-rules.js +11 -20
- package/dist/core/persisted-rule-arms.d.ts +2 -2
- package/dist/core/persisted-rule-arms.js +10 -12
- package/dist/core/principal-name.d.ts +20 -0
- package/dist/core/principal-name.js +22 -0
- package/dist/core/prompt-section-seat.js +4 -6
- package/dist/core/protocol-http-auth.d.ts +40 -5
- package/dist/core/protocol-http-auth.js +168 -4
- package/dist/core/protocol-naming.d.ts +20 -0
- package/dist/core/protocol-naming.js +20 -3
- package/dist/core/read-only-shell.d.ts +20 -5
- package/dist/core/read-only-shell.js +29 -14
- package/dist/core/remote-env.d.ts +37 -1
- package/dist/core/remote-env.js +11 -0
- package/dist/core/resume-startup-cause.d.ts +24 -2
- package/dist/core/resume-startup-cause.js +20 -1
- package/dist/core/retired-keys.d.ts +16 -0
- package/dist/core/retired-keys.js +16 -4
- package/dist/core/rewrite-rejudge.d.ts +60 -0
- package/dist/core/rewrite-rejudge.js +36 -0
- package/dist/core/roles.d.ts +28 -1
- package/dist/core/roles.js +81 -26
- package/dist/core/rule-lane-reads.d.ts +20 -15
- package/dist/core/rule-lane-reads.js +45 -17
- package/dist/core/rule-owner.d.ts +3 -3
- package/dist/core/rule-owner.js +3 -2
- package/dist/core/runner/announce-once-ledger.d.ts +14 -0
- package/dist/core/runner/announce-once-ledger.js +5 -0
- package/dist/core/runner/assemble-result.d.ts +1 -0
- package/dist/core/runner/assemble-result.js +1 -1
- package/dist/core/runner/call-hook-stations.d.ts +3 -2
- package/dist/core/runner/caller-roster.d.ts +16 -4
- package/dist/core/runner/caller-roster.js +33 -6
- package/dist/core/runner/capability-withheld-seat.d.ts +5 -0
- package/dist/core/runner/capability-withheld-seat.js +24 -0
- package/dist/core/runner/classifier-ladder.d.ts +7 -9
- package/dist/core/runner/classifier-ladder.js +3 -3
- package/dist/core/runner/compact-session.d.ts +10 -0
- package/dist/core/runner/compact-session.js +202 -0
- package/dist/core/runner/compaction-call-options.d.ts +2 -2
- package/dist/core/runner/compaction-seams.d.ts +21 -1
- package/dist/core/runner/compaction-seams.js +11 -8
- package/dist/core/runner/construction-doors.js +3 -0
- package/dist/core/runner/contracts.d.ts +50 -40
- package/dist/core/runner/cross-boundary-lane.d.ts +17 -13
- package/dist/core/runner/cross-boundary-lane.js +40 -27
- package/dist/core/runner/denial-limit-arms.d.ts +2 -2
- package/dist/core/runner/denial-limit-arms.js +1 -1
- package/dist/core/runner/derived-route-fallback.d.ts +13 -0
- package/dist/core/runner/derived-route-fallback.js +6 -0
- package/dist/core/runner/env-capability-census.d.ts +3 -2
- package/dist/core/runner/env-capability-census.js +9 -3
- package/dist/core/runner/file-history-request.d.ts +18 -0
- package/dist/core/runner/file-history-request.js +21 -13
- package/dist/core/runner/file-history-restore.d.ts +45 -0
- package/dist/core/runner/file-history-restore.js +46 -0
- package/dist/core/runner/gate-exit.d.ts +3 -3
- package/dist/core/runner/gate-exit.js +4 -3
- package/dist/core/runner/image.d.ts +7 -17
- package/dist/core/runner/image.js +9 -60
- package/dist/core/runner/permission-rule-lanes.d.ts +11 -11
- package/dist/core/runner/permission-rule-lanes.js +39 -17
- package/dist/core/runner/person-path-rows.d.ts +12 -9
- package/dist/core/runner/person-path-rows.js +18 -7
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +3 -0
- package/dist/core/runner/prepare-acquire-reconcile.js +2 -1
- package/dist/core/runner/prepare-ask-lane.d.ts +2 -2
- package/dist/core/runner/prepare-ask-lane.js +5 -2
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -6
- package/dist/core/runner/prepare-caps-and-workflow.js +4 -3
- package/dist/core/runner/prepare-config-doors.d.ts +35 -38
- package/dist/core/runner/prepare-config-doors.js +46 -28
- package/dist/core/runner/prepare-defer-classify.d.ts +4 -3
- package/dist/core/runner/prepare-defer-classify.js +7 -8
- package/dist/core/runner/prepare-file-history.d.ts +48 -8
- package/dist/core/runner/prepare-file-history.js +7 -39
- package/dist/core/runner/prepare-gate-stations.d.ts +1 -1
- package/dist/core/runner/prepare-gate-stations.js +10 -1
- package/dist/core/runner/prepare-hands-readface.d.ts +5 -9
- package/dist/core/runner/prepare-hands-readface.js +17 -14
- package/dist/core/runner/prepare-inherited-gate.d.ts +6 -3
- package/dist/core/runner/prepare-inherited-gate.js +5 -3
- package/dist/core/runner/prepare-memory-engine-session.js +1 -1
- package/dist/core/runner/prepare-park-ask.d.ts +2 -0
- package/dist/core/runner/prepare-park-ask.js +7 -7
- package/dist/core/runner/prepare-policy-chain.d.ts +6 -3
- package/dist/core/runner/prepare-policy-chain.js +67 -76
- package/dist/core/runner/prepare-prompt-assembly.d.ts +5 -7
- package/dist/core/runner/prepare-prompt-assembly.js +10 -8
- package/dist/core/runner/prepare-prompt-inputs.d.ts +11 -9
- package/dist/core/runner/prepare-prompt-inputs.js +3 -5
- package/dist/core/runner/prepare-protocol-tools.d.ts +2 -0
- package/dist/core/runner/prepare-protocol-tools.js +3 -3
- package/dist/core/runner/prepare-safety-scan.d.ts +1 -1
- package/dist/core/runner/prepare-safety-scan.js +0 -17
- package/dist/core/runner/prepare-suspend-saga.d.ts +2 -0
- package/dist/core/runner/prepare-suspend-saga.js +5 -6
- package/dist/core/runner/prepare-task.d.ts +5 -2
- package/dist/core/runner/prepare-task.js +48 -43
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +20 -4
- package/dist/core/runner/prepare-tool-disclosure-mount.js +33 -23
- package/dist/core/runner/prepare-turn-wiring.d.ts +0 -4
- package/dist/core/runner/prepare-turn-wiring.js +2 -7
- package/dist/core/runner/prepare-wiring-manifest.d.ts +6 -2
- package/dist/core/runner/prepare-wiring-manifest.js +3 -3
- package/dist/core/runner/resume-admission.js +1 -1
- package/dist/core/runner/resume-apply.js +11 -12
- package/dist/core/runner/resume-checkpoint-screen.js +3 -0
- package/dist/core/runner/resume-claim.d.ts +4 -2
- package/dist/core/runner/resume-claim.js +15 -8
- package/dist/core/runner/retired-runner-deps.js +1 -0
- package/dist/core/runner/rewind-files.d.ts +12 -0
- package/dist/core/runner/rewind-files.js +90 -0
- package/dist/core/runner/run-attachment-seats.js +2 -1
- package/dist/core/runner/run-brain-sinks.d.ts +4 -1
- package/dist/core/runner/run-brain-sinks.js +4 -2
- package/dist/core/runner/run-harness-handlers.js +12 -4
- package/dist/core/runner/run-leg.d.ts +1 -1
- package/dist/core/runner/run-leg.js +40 -39
- package/dist/core/runner/run-notification-lane.d.ts +2 -0
- package/dist/core/runner/run-notification-lane.js +2 -2
- package/dist/core/runner/run-recovery-lanes.js +3 -4
- package/dist/core/runner/run-settle-and-teardown.js +7 -12
- package/dist/core/runner/run-terminal-adoption.js +3 -4
- package/dist/core/runner/run-turn-boundary.js +4 -15
- package/dist/core/runner/runtask.d.ts +10 -0
- package/dist/core/runner/runtask.js +35 -42
- package/dist/core/runner/send-message-continuation.js +1 -1
- package/dist/core/runner/session-read-file-states.d.ts +15 -0
- package/dist/core/runner/session-read-file-states.js +28 -0
- package/dist/core/runner/session-rule-policy.js +4 -3
- package/dist/core/runner/session-verb-doors.d.ts +28 -0
- package/dist/core/runner/session-verb-doors.js +48 -0
- package/dist/core/runner/session-write-ledger.d.ts +30 -0
- package/dist/core/runner/session-write-ledger.js +101 -0
- package/dist/core/runner/shell-env-withheld.d.ts +33 -0
- package/dist/core/runner/shell-env-withheld.js +51 -0
- package/dist/core/runner/skills-seat.js +6 -2
- package/dist/core/runner/stream-settle-backstop.js +12 -15
- package/dist/core/runner/sub-agent-deny-lists.d.ts +25 -3
- package/dist/core/runner/sub-agent-deny-lists.js +25 -17
- package/dist/core/runner/synthetic-tools.d.ts +6 -0
- package/dist/core/runner/synthetic-tools.js +4 -1
- package/dist/core/runner/teardown-bounded.d.ts +1 -0
- package/dist/core/runner/teardown-bounded.js +1 -0
- package/dist/core/runner/tool-disclosure.d.ts +10 -12
- package/dist/core/runner/tool-disclosure.js +1 -3
- package/dist/core/runner/tool-end-body.d.ts +1 -1
- package/dist/core/runner/tool-end-body.js +10 -9
- package/dist/core/runner/tool-not-executed.d.ts +5 -0
- package/dist/core/runner/tool-not-executed.js +11 -0
- package/dist/core/runner/tool-occurrence.d.ts +8 -0
- package/dist/core/runner/tool-occurrence.js +7 -0
- package/dist/core/runner/turn-attachments.d.ts +33 -15
- package/dist/core/runner/turn-attachments.js +62 -37
- package/dist/core/runner-deps.d.ts +7 -7
- package/dist/core/safety-axis-vocab.d.ts +6 -4
- package/dist/core/safety-axis-vocab.js +6 -5
- package/dist/core/safety-merge-corpus.js +11 -3
- package/dist/core/secret-env.d.ts +30 -3
- package/dist/core/secret-env.js +47 -8
- package/dist/core/select-model.js +3 -3
- package/dist/core/session-policy-store.d.ts +32 -15
- package/dist/core/session-policy-store.js +156 -36
- package/dist/core/session-store.d.ts +29 -10
- package/dist/core/session-store.js +51 -19
- package/dist/core/session.d.ts +82 -16
- package/dist/core/session.js +53 -0
- package/dist/core/shell-read-silence.d.ts +11 -12
- package/dist/core/shell-read-silence.js +9 -5
- package/dist/core/shell-run-candidates.js +3 -1
- package/dist/core/shell-wrapper-projection.d.ts +1 -1
- package/dist/core/shell-wrapper-projection.js +1 -1
- package/dist/core/shell-wrapper-table.d.ts +14 -7
- package/dist/core/shell-wrapper-table.js +5 -4
- package/dist/core/side-query.js +10 -1
- package/dist/core/skill-grant.d.ts +7 -2
- package/dist/core/skill-grant.js +5 -0
- package/dist/core/skills-directory.js +6 -2
- package/dist/core/store-contracts/background-agent-store-contract.js +1 -0
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +11 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +141 -2
- package/dist/core/store-contracts/file-history-store-contract.js +40 -1
- package/dist/core/store-contracts/mailbox-store-contract.js +49 -1
- package/dist/core/store-contracts/peer-directory-contract.d.ts +7 -2
- package/dist/core/store-contracts/peer-directory-contract.js +14 -2
- package/dist/core/store-contracts/session-repo-contract.js +51 -0
- package/dist/core/store-contracts/session-store-contract.d.ts +2 -1
- package/dist/core/store-contracts/session-store-contract.js +150 -14
- package/dist/core/stub-env.d.ts +2 -0
- package/dist/core/stub-env.js +1 -0
- package/dist/core/synthetic-read-verdict.js +3 -3
- package/dist/core/task-event.d.ts +32 -4
- package/dist/core/task-notification.d.ts +16 -12
- package/dist/core/task-registry-agent.d.ts +8 -4
- package/dist/core/task-registry-agent.js +14 -8
- package/dist/core/task-registry-shared.d.ts +35 -6
- package/dist/core/task-registry-shared.js +11 -0
- package/dist/core/task-registry.d.ts +10 -1
- package/dist/core/task-registry.js +12 -2
- package/dist/core/task-result.d.ts +18 -0
- package/dist/core/task-spec.d.ts +18 -13
- package/dist/core/tighten-task-spec.js +2 -1
- package/dist/core/tool-catalog-entries.d.ts +23 -0
- package/dist/core/tool-catalog-entries.js +14 -2
- package/dist/core/tool-check-reading.d.ts +11 -0
- package/dist/core/tool-check-reading.js +11 -6
- package/dist/core/tool-model-gate.d.ts +2 -2
- package/dist/core/tool-name-aliases.d.ts +48 -18
- package/dist/core/tool-name-aliases.js +36 -19
- package/dist/core/tool-name-readings.d.ts +6 -32
- package/dist/core/tool-name-readings.js +2 -9
- package/dist/core/tool-policy.d.ts +78 -204
- package/dist/core/tool-policy.js +152 -204
- package/dist/core/tool-result-store.js +3 -0
- package/dist/core/tool-roster.d.ts +14 -19
- package/dist/core/tool-roster.js +11 -44
- package/dist/core/tool-spec-members.js +7 -2
- package/dist/core/tool-spec.d.ts +19 -11
- package/dist/core/tools.js +49 -9
- package/dist/core/trace.d.ts +6 -3
- package/dist/core/trace.js +2 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/untrusted-egress.d.ts +20 -0
- package/dist/core/untrusted-egress.js +77 -3
- package/dist/core/user-attachment.d.ts +8 -1
- package/dist/core/user-attachment.js +64 -4
- package/dist/core/wiring-manifest.d.ts +9 -0
- package/dist/core/wiring-manifest.js +1 -0
- package/dist/core/workflow-journal-store.js +1 -1
- package/dist/engine/compaction/compaction.js +3 -2
- package/dist/engine/execution-env/node-execution-env.d.ts +7 -3
- package/dist/engine/execution-env/node-execution-env.js +11 -2
- package/dist/engine/harness/agent-harness.d.ts +32 -6
- package/dist/engine/harness/agent-harness.js +65 -9
- package/dist/engine/harness/types.d.ts +29 -2
- package/dist/engine/llm/types.d.ts +28 -11
- package/dist/engine/loop/agent-loop.d.ts +23 -4
- package/dist/engine/loop/agent-loop.js +42 -30
- package/dist/engine/loop/types.d.ts +16 -6
- package/dist/engine/session/memory-repo.d.ts +9 -2
- package/dist/engine/session/memory-repo.js +11 -1
- package/dist/engine/session/repo-utils.d.ts +6 -5
- package/dist/engine/session/repo-utils.js +14 -6
- package/dist/index.d.ts +34 -17
- package/dist/index.js +22 -11
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/internal/harness.d.ts +2 -1
- package/dist/internal/harness.js +1 -0
- package/dist/internal/llm.d.ts +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts +6 -4
- package/dist/orchestration/run-workflow-tool.js +5 -3
- package/dist/orchestration/workflow.d.ts +3 -0
- package/dist/orchestration/workflow.js +36 -18
- package/dist/primitives/credential-ref.d.ts +89 -0
- package/dist/primitives/credential-ref.js +125 -0
- package/dist/primitives/index.d.ts +2 -0
- package/dist/primitives/index.js +1 -0
- package/dist/prompt-assembly/artifact.d.ts +2 -2
- package/dist/prompt-assembly/artifact.js +5 -3
- package/dist/prompt-assembly/assemble.d.ts +3 -2
- package/dist/prompt-assembly/assemble.js +1 -1
- package/dist/prompt-assembly/catalog/schema.d.ts +43 -12
- package/dist/prompt-assembly/catalog/schema.js +34 -2
- package/dist/prompt-assembly/catalog/sections.js +0 -1
- package/dist/prompt-assembly/composer.d.ts +3 -1
- package/dist/prompt-assembly/composer.js +1 -1
- package/dist/prompt-assembly/event-registry.js +1 -0
- package/dist/prompt-assembly/overlay.js +3 -3
- package/dist/prompt-assembly/renderers.d.ts +1 -1
- package/dist/prompt-assembly/renderers.js +0 -3
- package/dist/prompt-assembly/role-base.d.ts +15 -0
- package/dist/prompt-assembly/role-base.js +9 -0
- package/dist/prompt-assembly/select.d.ts +39 -14
- package/dist/prompt-assembly/select.js +47 -16
- package/dist/prompt-assembly/sugar.d.ts +17 -11
- package/dist/prompt-assembly/sugar.js +8 -3
- package/dist/prompt-assembly/tool-catalog.d.ts +37 -3
- package/dist/prompt-assembly/tool-catalog.js +114 -4
- package/dist/prompt-assembly/turn-snapshot.d.ts +4 -10
- package/dist/prompt-assembly/turn-snapshot.js +0 -3
- package/dist/prompt-assembly/types.d.ts +0 -7
- package/dist/scenarios/full-body.d.ts +11 -11
- package/dist/scenarios/full-body.js +4 -3
- package/dist/shell/lex.js +10 -1
- package/dist/stores/file/adoption/adopt.js +4 -3
- package/dist/stores/file/adoption/marker.js +3 -2
- package/dist/stores/file/checkpoint-store.d.ts +21 -4
- package/dist/stores/file/checkpoint-store.js +38 -7
- package/dist/stores/file/file-history-store.js +18 -11
- package/dist/stores/file/index.js +2 -1
- package/dist/stores/file/mailbox-store.d.ts +2 -1
- package/dist/stores/file/mailbox-store.js +26 -1
- package/dist/stores/file/permission-rule-adopt.js +4 -3
- package/dist/stores/file/permission-rule-store.js +11 -5
- package/dist/stores/file/session-store.d.ts +29 -6
- package/dist/stores/file/session-store.js +42 -50
- package/dist/tools/artifact/artifact-tool.js +3 -2
- package/dist/tools/fs/bash-program-position.d.ts +19 -2
- package/dist/tools/fs/bash-program-position.js +56 -9
- package/dist/tools/fs/bash-readonly-classifier.d.ts +15 -19
- package/dist/tools/fs/bash-readonly-classifier.js +5 -10
- package/dist/tools/fs/fs-bash.js +15 -8
- package/dist/tools/fs/fs-glob.d.ts +86 -0
- package/dist/tools/fs/fs-glob.js +226 -0
- package/dist/tools/fs/fs-read.js +14 -14
- package/dist/tools/fs/fs-search-tools.js +7 -7
- package/dist/tools/fs/pattern-kill-guard.d.ts +23 -0
- package/dist/tools/fs/pattern-kill-guard.js +429 -0
- package/dist/tools/fs/pdf.d.ts +9 -6
- package/dist/tools/fs/pdf.js +3 -3
- package/dist/tools/fs/program-read-model.d.ts +57 -7
- package/dist/tools/fs/program-read-model.js +11 -1
- package/dist/tools/fs/program-read-model.rows.js +78 -21
- package/dist/tools/fs/read-deny-home.js +3 -2
- package/dist/tools/fs/removal-targets.d.ts +17 -7
- package/dist/tools/fs/removal-targets.js +47 -20
- package/dist/tools/fs/search.d.ts +10 -0
- package/dist/tools/fs/search.js +20 -26
- package/dist/tools/fs/shell-read-argv.js +89 -12
- package/dist/tools/fs/shell-read-bindings.d.ts +31 -0
- package/dist/tools/fs/shell-read-bindings.js +41 -0
- package/dist/tools/fs/shell-read-check.d.ts +10 -0
- package/dist/tools/fs/shell-read-check.js +13 -20
- package/dist/tools/fs/shell-read-environment.d.ts +5 -1
- package/dist/tools/fs/shell-read-environment.js +3 -2
- package/dist/tools/fs/shell-read-establish.d.ts +15 -0
- package/dist/tools/fs/shell-read-establish.js +19 -20
- package/dist/tools/fs/shell-read-identity.d.ts +12 -9
- package/dist/tools/fs/shell-read-identity.js +9 -4
- package/dist/tools/fs/shell-read-plan.js +24 -16
- package/dist/tools/fs/shell-read-start.d.ts +6 -1
- package/dist/tools/fs/shell-read-write-targets.d.ts +5 -1
- package/dist/tools/fs/shell-read-write-targets.js +2 -3
- package/dist/tools/fs/shell-reentry-text.d.ts +9 -0
- package/dist/tools/fs/shell-reentry-text.js +40 -2
- package/dist/tools/todo.js +63 -63
- package/dist/tools/web.d.ts +19 -14
- package/dist/tools/web.js +46 -61
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +221 -7
- package/wire-changes/core-stores-sql@7.57.0.json +29 -0
- package/wire-changes/core@7.56.0.json +3891 -0
- package/wire-changes/core@7.57.0.json +1487 -0
- package/wire-changes/mods-kernel@7.56.0.json +303 -0
- package/wire-changes/mods-kernel@7.57.0.json +29 -0
- package/wire-changes/primitives@7.57.0.json +245 -0
|
@@ -17,7 +17,7 @@ import type { HumanReviewGateRow } from "../task-result.js";
|
|
|
17
17
|
import type { RepairBundle } from "../../agents/repair-loop.js";
|
|
18
18
|
import type { SubagentRetainLedger } from "../../agents/retain-ledger.js";
|
|
19
19
|
import type { BrainCallGuardrailRef } from "../../brain/timeout.js";
|
|
20
|
-
import type { ActiveWorktreeSession, AgentHarness, AgentMessage, AgentTool, AnnouncedListingSnapshotInput, ExecutionEnv, ThinkingLevel } from "../../internal/harness.js";
|
|
20
|
+
import type { ActiveWorktreeSession, AgentHarness, AgentMessage, AgentTool, AnnouncedListingSnapshotInput, AnnouncedMcpFailure, ExecutionEnv, ThinkingLevel } from "../../internal/harness.js";
|
|
21
21
|
import type { Model } from "../../internal/llm.js";
|
|
22
22
|
import type { WorkflowSizeGuideline } from "../../orchestration/workflow-size-guideline.js";
|
|
23
23
|
import type { ToolManifestRow } from "../../prompt-assembly/tool-catalog.js";
|
|
@@ -234,7 +234,7 @@ export interface FrameReceipt {
|
|
|
234
234
|
text: string;
|
|
235
235
|
/** Which frame this receipt settles. No collector renders a frame whose receipt is still pending (the frame is on
|
|
236
236
|
* its way, not yet in the transcript) — the one reading is `frameCarried` (compaction-restate.ts). */
|
|
237
|
-
source: "git_status" | "agent_listing" | "skills_listing" | "date_change" | "output_style" | "
|
|
237
|
+
source: "git_status" | "agent_listing" | "skills_listing" | "date_change" | "output_style" | "mcp_unavailable" | "posture" | "advisor_tool";
|
|
238
238
|
/** Runs inside the `message_end` walk (synchronous, never awaited): advances the run-local record
|
|
239
239
|
* and parks any session write for the next serialization point. */
|
|
240
240
|
commit: (entryId: string) => void;
|
|
@@ -291,6 +291,8 @@ export interface Prepared {
|
|
|
291
291
|
* prepare emits run-scoped disclosures of its own and each must have a terminal that names it.
|
|
292
292
|
*/
|
|
293
293
|
runId: string;
|
|
294
|
+
/** The deployment's host floor as the config doors compiled it (absent ⇒ none declared) — the task images' guard reads it. */
|
|
295
|
+
hostFloor?: import("../host-floor.js").HostFloor;
|
|
294
296
|
/** The (owner, scope) key this run's registry-facing tools register rows under — (host task id, mount domain), minted once at prepare; the teardown sweeps read it and never re-derive it. */
|
|
295
297
|
registryAccess: {
|
|
296
298
|
readonly owner: string;
|
|
@@ -472,13 +474,16 @@ export interface Prepared {
|
|
|
472
474
|
readonly args: unknown;
|
|
473
475
|
readonly admit: () => void;
|
|
474
476
|
}>;
|
|
477
|
+
/** The leg's `tool.call` station (`mods/tool-call.ts`) — every execution of a call passes it; absent when no handler hangs on the event. */
|
|
478
|
+
toolCallStation?: import("../mods/tool-call.js").ToolCallStation;
|
|
475
479
|
/** The leg's shell READ STATION, re-run on a durable RESUME before an approved shell call executes: the parked leg's
|
|
476
480
|
* admission died with that leg, so the resumed bytes are judged (and admitted for their pre-spawn re-establishment)
|
|
477
481
|
* on THIS leg — a deny row found now vetoes, an operator's edit is judged on the `rejudge` seat. */
|
|
478
482
|
shellReadCheck?: import("../../tools/fs/shell-read-check.js").ShellReadCheck;
|
|
483
|
+
shellReadLandings?: import("../../tools/fs/shell-read-check.js").ShellReadLandings;
|
|
479
484
|
crossBoundary?: {
|
|
480
485
|
readonly check: import("../cross-boundary-taint.js").CrossBoundaryCheck | undefined;
|
|
481
|
-
settle(): Promise<void>;
|
|
486
|
+
settle(owed: import("../cross-boundary-taint.js").OwedDeliveries): Promise<void>;
|
|
482
487
|
storeWaits(): number;
|
|
483
488
|
};
|
|
484
489
|
/** The ORG adjudication face, re-resolved on a durable RESUME before an approved
|
|
@@ -764,8 +769,8 @@ export interface Prepared {
|
|
|
764
769
|
current?: CommittedPause;
|
|
765
770
|
};
|
|
766
771
|
/** A resumed leg's continuation content that has NOT reached the transcript yet: EVERY input frame the
|
|
767
|
-
* prompt carries (parked steers, the
|
|
768
|
-
*
|
|
772
|
+
* prompt carries (parked steers, the wake message, the approver's words) and the orphans whose obituary rides it. Set
|
|
773
|
+
* before the prompt, emptied at the prompt's own receipt (never its hand-off); a re-park carries it forward (the saga folds the
|
|
769
774
|
* orphans in, the adoption re-parks the frames), and what no re-park carries the undrained account announces. */
|
|
770
775
|
undeliveredContinuationRef: {
|
|
771
776
|
current: UndeliveredContinuation;
|
|
@@ -1140,27 +1145,25 @@ export interface Prepared {
|
|
|
1140
1145
|
* turn boundary. Appended by the rematerialize diff (newly-activated names only — the announced set
|
|
1141
1146
|
* is seeded with prepare-time actives INCLUDING resume-reseeded ones, so a resume never replays);
|
|
1142
1147
|
* DRAINED by the run loop only when the `tools_delta` attachment actually survived the byte cap.
|
|
1143
|
-
* Present when the task has deferred tools at all
|
|
1144
|
-
* to connect, so the failure is announceable even on a task whose every MCP tool went missing with it.
|
|
1148
|
+
* Present when the task has deferred tools at all.
|
|
1145
1149
|
*
|
|
1146
|
-
* The same frame's MCP arms, filled by the SAME rematerialize seam
|
|
1147
|
-
* projection and drained by the same intact-survival predicate:
|
|
1150
|
+
* The same frame's MCP arms, filled by the SAME rematerialize seam and drained by the same intact-survival predicate:
|
|
1148
1151
|
* - `pendingRemoved`: previously-ANNOUNCED tool names that left the live roster (a RefreshMcpTools
|
|
1149
1152
|
* re-splice whose server withdrew them). CC `removedNames`.
|
|
1150
1153
|
* - `pendingReadded`: names in `pendingRemoved`'s history that came back on a later refresh. CC
|
|
1151
|
-
* `readdedNames`.
|
|
1152
|
-
* - `pendingFailed`: declared servers whose connect failed at materialize (`statuses`), name/error
|
|
1153
|
-
* neutralized + bounded at intake, MINUS the pairs this session's record already announced (CC
|
|
1154
|
-
* `failedMcpServers` compared against the previous attachment — a serving layer runs prepare once
|
|
1155
|
-
* per user message, so the per-run set alone re-announced every message). */
|
|
1154
|
+
* `readdedNames`. */
|
|
1156
1155
|
toolsDeltaRef?: {
|
|
1157
1156
|
pending: string[];
|
|
1158
1157
|
pendingRemoved: string[];
|
|
1159
1158
|
pendingReadded: string[];
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1159
|
+
};
|
|
1160
|
+
/** The `mcp_unavailable` frame's pending servers: declared servers whose dial failed at materialize (`statuses`), name/error
|
|
1161
|
+
* neutralized + bounded at intake, MINUS the pairs this session's record already announced (a serving layer runs prepare once
|
|
1162
|
+
* per user message, so the per-run set alone would re-announce every message). Present when at least one is pending — a
|
|
1163
|
+
* task whose every MCP tool went missing with its server is exactly the one that must say so. Carried by the leg's first
|
|
1164
|
+
* request (a fresh leg's first message, a resumed leg's continuation) and drained by that message's receipt (`settleMcpUnavailable`). */
|
|
1165
|
+
mcpUnavailable?: {
|
|
1166
|
+
pending: AnnouncedMcpFailure[];
|
|
1164
1167
|
};
|
|
1165
1168
|
/** G1 通告层续批 (CC `agent_listing_delta` parity) — the mounted delegation tool's agent-type roster
|
|
1166
1169
|
* (read off `ToolSpec.agentListing`, filled by createSubagentTool), plus the tool's mounted name for
|
|
@@ -1200,7 +1203,7 @@ export interface Prepared {
|
|
|
1200
1203
|
* catalog change across a suspend is re-announced as a "Models available…" drift line.
|
|
1201
1204
|
* `mcpFailed` / `advisories` are the once-per-SESSION arms of the same snapshot (see
|
|
1202
1205
|
* announce-once-ledger.ts): seeded at prepare from the branch's record, advanced by the run loop
|
|
1203
|
-
* on
|
|
1206
|
+
* on delivery of the mcp_unavailable frame / intact delivery of the mcp_dropped_tools frame. */
|
|
1204
1207
|
announcedListingsRef: AnnouncedListingSnapshotInput;
|
|
1205
1208
|
/** The frame-receipt ledger — the ONE commit point of every engine frame that rides a user message
|
|
1206
1209
|
* (the git-status frame, the agent and skills listing frames). Always present; per leg. */
|
|
@@ -1213,10 +1216,11 @@ export interface Prepared {
|
|
|
1213
1216
|
gitStatusRef: GitStatusLaneRef;
|
|
1214
1217
|
/** The posture composition's run-local half (the newest carrier's protection slot; the row last composed for). */
|
|
1215
1218
|
postureFrameRef: import("../auto-mode-directive.js").PostureFrameRef;
|
|
1216
|
-
/** G1 通告层 — narrow
|
|
1217
|
-
* pending/running
|
|
1218
|
-
* use), as a
|
|
1219
|
-
*
|
|
1219
|
+
/** G1 通告层 — narrow getter over the process task registry: THIS run's visible live background tasks
|
|
1220
|
+
* (pending / running / parked under the same owner/scope/session identity the TaskOutput/TaskStop tools
|
|
1221
|
+
* use), EVERY one (`TaskRegistry.liveTasks`), as a projection (id/description/status — never
|
|
1222
|
+
* handles/env/abort). Read by the post-compact listing (which caps what it renders), the resume's orphan
|
|
1223
|
+
* diff and the stop hook's `backgroundTasks` view. */
|
|
1220
1224
|
listBackgroundTasks: () => Array<{
|
|
1221
1225
|
id: string;
|
|
1222
1226
|
description?: string;
|
|
@@ -1586,8 +1590,6 @@ export interface PromptFeatureFlags {
|
|
|
1586
1590
|
writeFaceOpen: boolean;
|
|
1587
1591
|
orchestrationEnabled: boolean;
|
|
1588
1592
|
orchestrationDeferred: boolean;
|
|
1589
|
-
promptProfile: "simple" | "classic";
|
|
1590
|
-
fableMitigations: boolean;
|
|
1591
1593
|
goalEnabled: boolean;
|
|
1592
1594
|
awarenessEnabled: boolean;
|
|
1593
1595
|
worktreeIsolated: boolean;
|
|
@@ -1795,6 +1797,10 @@ export interface RunInternals {
|
|
|
1795
1797
|
outcome?: ResumeOutcome;
|
|
1796
1798
|
inheritedGate?: InheritedGate;
|
|
1797
1799
|
}>;
|
|
1800
|
+
/** The deployment's credential for the claim this run acts under (an opaque grant id; a TRUSTED channel like the decisions above).
|
|
1801
|
+
* A resume handed one carries it into its CAS as `expect.holder` (the store judges it; a superseded grant is
|
|
1802
|
+
* `resume.holder_superseded`, nothing applied), and so does every Workflow drive this run makes. Never inherited by children. */
|
|
1803
|
+
holder?: string;
|
|
1798
1804
|
/**
|
|
1799
1805
|
* Set ONLY by the Agent tool's fork route (`Agent(subagent_type:"fork")`, a core caller) on the
|
|
1800
1806
|
* child it spawns: this run IS a forked child. `prepareTask` threads it to tool ctx as `insideFork` so the
|
|
@@ -2049,8 +2055,6 @@ export interface RunInternals {
|
|
|
2049
2055
|
parentCenterArtifactDigest?: string;
|
|
2050
2056
|
/** Publish provenance companion of {@link parentCenterArtifactDigest} (audit only). */
|
|
2051
2057
|
parentCenterSourceRevision?: string;
|
|
2052
|
-
/** R2 双形轴 — parent's resolved prompt profile, inherited unless the child spec overrides. */
|
|
2053
|
-
promptProfile?: "simple" | "classic";
|
|
2054
2058
|
/**
|
|
2055
2059
|
* An OPT-IN, DISPLAY-ONLY event sink a deployment sets on the TOP run to
|
|
2056
2060
|
* receive a subagent's live `task_progress` ticks (which otherwise stay in the child's ISOLATED stream). Threaded
|
|
@@ -2645,17 +2649,17 @@ export interface ResumeRun {
|
|
|
2645
2649
|
wakeMessageHookContext?: string;
|
|
2646
2650
|
/** The resumed leg's bus when the wake-message screen admitted it before the claim — prepare adopts it. */
|
|
2647
2651
|
legMods?: LegMods;
|
|
2648
|
-
/**
|
|
2649
|
-
*
|
|
2650
|
-
* the
|
|
2651
|
-
*
|
|
2652
|
-
*
|
|
2653
|
-
*
|
|
2654
|
-
*
|
|
2655
|
-
*
|
|
2656
|
-
|
|
2652
|
+
/** The claim's reversal, bound to THIS resume's token and scope by `resumeStream` — REQUIRED, as the store's
|
|
2653
|
+
* `reopen` is: called when the claimed leg ends before its approved action started (a failed restore, a
|
|
2654
|
+
* refusal at the leg's prepare, an abort, a leg that returned failed), it returns the row `resolved → pending`
|
|
2655
|
+
* under the failure's reason (`reopenReasonOf`), recorded on the row so the next re-resume validates per
|
|
2656
|
+
* reason — an `env_failed` reopen replays the persisted winner, the fresh-redecision reasons take a new
|
|
2657
|
+
* decision. Answers the store's own answer — `"reopened"` (it flipped the row) or `"declined"` (`reopen`
|
|
2658
|
+
* answered `false`) — and rejects only with what the store threw (the row's state is then unprovable);
|
|
2659
|
+
* every exit reads it through `compensateUnstarted` (resume-startup-cause.ts), the one reading. */
|
|
2660
|
+
reopenUnstarted: (reason: ReopenReason) => Promise<"reopened" | "declined">;
|
|
2657
2661
|
/** The row's execution-record verb, bound to THIS resume's token and scope by `resumeStream` (the
|
|
2658
|
-
* same closure form as {@link
|
|
2662
|
+
* same closure form as {@link reopenUnstarted}, and REQUIRED for the same reason: the store contract requires the
|
|
2659
2663
|
* verb, so there is no store this seat could be absent for). The pending-call resolver calls it
|
|
2660
2664
|
* exactly once per resolution, right after it emits the resolved call's `tool_end` frame, with the
|
|
2661
2665
|
* {@link import("../gate-outcome.js").GateOutcome} that frame carried — every disposition, the
|
|
@@ -2663,8 +2667,8 @@ export interface ResumeRun {
|
|
|
2663
2667
|
* allowed). The word it answers is read through `EXECUTION_RECORD_LEAVES_ROW_UNRECORDED`; a
|
|
2664
2668
|
* conflict throw propagates (an engine defect, not a store condition). */
|
|
2665
2669
|
recordExecutionOutcome: (gate: import("../gate-outcome.js").GateOutcome) => Promise<ExecutionOutcomeRecordWord>;
|
|
2666
|
-
/** Set
|
|
2667
|
-
* decision twin of `pendingActionStarted`. A reject/deny consumes its gate BY BEING DELIVERED, and
|
|
2670
|
+
/** Set right after `applyResumeDecision` completes (`policy_ask`), and at the continuation's own receipt for `plan_review` / `dry_run_review`
|
|
2671
|
+
* (its decision rides only that message): the negative-decision twin of `pendingActionStarted`. A reject/deny consumes its gate BY BEING DELIVERED, and
|
|
2668
2672
|
* this bit is the delivery fact — every throw-arm cause (prepare failure, `session_not_found`, a
|
|
2669
2673
|
* pre-delivery abort) and the walltime-exhausted settle fire BEFORE it is set, so an undelivered
|
|
2670
2674
|
* negative decision still reopens as `env_failed` (the retry replays the persisted decision; it
|
|
@@ -2866,7 +2870,13 @@ export interface RunnerSelfSeat {
|
|
|
2866
2870
|
*/
|
|
2867
2871
|
export type PrepareTaskFn = (spec: TaskSpec, deps: RunnerDeps, sessions: SessionStore, resume?: PrepareResume, internals?: RunInternals, runnerSelf?: RunnerSelfSeat, runIdSink?: {
|
|
2868
2872
|
runId?: string;
|
|
2869
|
-
}, holdSessionLock?: (sessionId: string) => Promise<void
|
|
2873
|
+
}, holdSessionLock?: (sessionId: string) => Promise<void>, legWrites?: LegWrites) => Promise<Prepared>;
|
|
2874
|
+
/** One leg's view of the Runner's session write ledger (`session-write-ledger.ts`): `issue` starts a write of the leg (`what` = the
|
|
2875
|
+
* entry type, for a report) or refuses it once `close` ran — the leg's hold ended; a write still in flight is reported when it settles. */
|
|
2876
|
+
export interface LegWrites {
|
|
2877
|
+
issue<T>(sessionId: string, what: string, start: () => Promise<T>): Promise<T>;
|
|
2878
|
+
close(): void;
|
|
2879
|
+
}
|
|
2870
2880
|
/**
|
|
2871
2881
|
* The Result of an INSTALLING phase: a lane whose every product is installed on a seat it borrowed
|
|
2872
2882
|
* (the harness's stop gate and recovery chain, the run state's counter groups, the stream's result setter, the claimed
|
|
@@ -6,12 +6,15 @@
|
|
|
6
6
|
* `ToolExecuteContext.crossBoundaryTreeForChildren`) through this module alone; each leg joins into it what it knows at prepare (its
|
|
7
7
|
* environment's declaration, its session's newest record, its posture) and every bit an exit sets lands there before the call
|
|
8
8
|
* runs — after the record that carries it, so a call the exit refuses sets nothing. Each leg's session holds a record
|
|
9
|
-
* (`CROSS_BOUNDARY_RECORD_TYPE`) of the state its content
|
|
9
|
+
* (`CROSS_BOUNDARY_RECORD_TYPE`) of the state its content is read under — written only for an armed tree: at prepare and at an
|
|
10
10
|
* exit (before the call runs) when the state grew past what the session already says, and at a leg's end (before a suspend's row is
|
|
11
11
|
* put, when the leg settles) also when conversation content follows the newest record. A write that fails refuses its call (or its
|
|
12
12
|
* row) on a governed tree; a prepare's or a settle's, and any write on a tree that is not governed, mints
|
|
13
|
-
* `config.cross_boundary_record_unwritten`, once per state. A record
|
|
14
|
-
*
|
|
13
|
+
* `config.cross_boundary_record_unwritten`, once per state. A record says how the content before it is READ: a leg's end record also
|
|
14
|
+
* carries what the session is still owed — each unfinished background task the leg's TaskOutput reaches, judged as the poll the
|
|
15
|
+
* session's next leg (another tree) would make of it, so its delivery is read under the bit it brings. A leg that takes over a
|
|
16
|
+
* session whose content no record covers (none on the branch, or after the newest), on an armed tree, reads that content as
|
|
17
|
+
* off-target.
|
|
15
18
|
*
|
|
16
19
|
* THE OBLIGATION of a call is read off three things at the moment it is asked ({@link crossBoundaryObligation}): the legs the
|
|
17
20
|
* call travels (its roster row's declaration, or what the dispatching code gives per call), whether the environment the `env`
|
|
@@ -19,7 +22,7 @@
|
|
|
19
22
|
*/
|
|
20
23
|
import type { AgentTool } from "../../internal/harness.js";
|
|
21
24
|
import type { SessionTreeEntry } from "../../internal/harness-types.js";
|
|
22
|
-
import { type CrossBoundaryCheck, type CrossBoundaryPosture, type CrossBoundaryTreeToken } from "../cross-boundary-taint.js";
|
|
25
|
+
import { type CrossBoundaryCheck, type CrossBoundaryPosture, type CrossBoundaryTreeToken, type OwedDeliveries } from "../cross-boundary-taint.js";
|
|
23
26
|
import { type ToolRoster } from "../tool-roster.js";
|
|
24
27
|
import type { RunnerDeps } from "../types.js";
|
|
25
28
|
/** A new tree with no bit set, and the token that names it — the one mint of a token. */
|
|
@@ -39,23 +42,24 @@ export interface CrossBoundaryLane {
|
|
|
39
42
|
seat(view: CrossBoundaryLegView): CrossBoundaryCheck | undefined;
|
|
40
43
|
/** The seat minted by {@link seat}, for the resumed call's exit. */
|
|
41
44
|
readonly check: CrossBoundaryCheck | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* that is not governed, the write failed and was reported); throws when it cannot be written on a governed tree.
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
owe(atLeaf
|
|
45
|
+
/** A suspend (a leg's end) writes the record its row's leaf owes: the new entry's id, or undefined when nothing was owed (or, on a
|
|
46
|
+
* tree that is not governed, the write failed and was reported); throws when it cannot be written on a governed tree. The record
|
|
47
|
+
* covers the content after the newest one and what the session is still `owed`, and is written only as the child of `atLeaf` (the
|
|
48
|
+
* row then points at it). */
|
|
49
|
+
owe(atLeaf: string, owed: OwedDeliveries): Promise<string | undefined>;
|
|
47
50
|
/** The tree is armed, so the session OWES the tree's record and a parked row says a reader must read it — on a tree that is not
|
|
48
51
|
* governed a failed write leaves the record missing (the notice says so), and the reader then reads the content after the newest
|
|
49
52
|
* record as off-target. */
|
|
50
53
|
recorded(): boolean;
|
|
51
|
-
/** The leg settles: the record that covers what it added
|
|
52
|
-
* content after the newest record as off-target). */
|
|
53
|
-
settle(): Promise<void>;
|
|
54
|
+
/** The leg settles: the record that covers what it added and what the session is still `owed` is written, a failure reported
|
|
55
|
+
* loudly (the next leg then reads the content after the newest record as off-target). */
|
|
56
|
+
settle(owed: OwedDeliveries): Promise<void>;
|
|
54
57
|
/** How many times this leg's record writes have waited on the session store — a station that judged before an exit reads again
|
|
55
58
|
* when the count moved across it (the exit's own form: judged again after a wait). */
|
|
56
59
|
storeWaits(): number;
|
|
57
60
|
}
|
|
58
|
-
/** What the seat reads per call: the live roster (the legs a row declares) and the mounted instances (a `"per_call"` resolver
|
|
61
|
+
/** What the seat reads per call: the live roster (the legs a row declares) and the mounted instances (a `"per_call"` row's resolver,
|
|
62
|
+
* read off the later mount under the row's name — the instance the row was minted from, but in a redial window: KL-2284-c). */
|
|
59
63
|
export interface CrossBoundaryLegView {
|
|
60
64
|
readonly tools: readonly AgentTool[];
|
|
61
65
|
readonly roster: {
|
|
@@ -2,7 +2,7 @@ import { BOUNDARY_LEGS, CROSS_BOUNDARY_RECORD_TYPE, CROSS_BOUNDARY_TAINT_BITS, S
|
|
|
2
2
|
import { deliverEngineNotice } from "../engine-notice.js";
|
|
3
3
|
import { policyCannotAnswer } from "../real-approval.js";
|
|
4
4
|
import { thrownText } from "../thrown-value.js";
|
|
5
|
-
import { rosterEntryNamed } from "../tool-roster.js";
|
|
5
|
+
import { rosterEntryNamed, survivorsByName } from "../tool-roster.js";
|
|
6
6
|
import { emitTrace } from "../trace.js";
|
|
7
7
|
const TREE_STATE = new WeakMap();
|
|
8
8
|
export function mintCrossBoundaryTree() {
|
|
@@ -21,6 +21,7 @@ export function joinedCrossBoundaryTree(handed, report) {
|
|
|
21
21
|
return token;
|
|
22
22
|
}
|
|
23
23
|
const EVERY_LEG = Object.freeze([...BOUNDARY_LEGS]);
|
|
24
|
+
const ONE_OUTSIDE_READ = Object.freeze([Object.freeze({ legs: Object.freeze(["outside_read"]) })]);
|
|
24
25
|
const bitsOf = (t) => CROSS_BOUNDARY_TAINT_BITS.filter((b) => t[b] === true);
|
|
25
26
|
function legsOfCall(view, legEnv, token, call, report) {
|
|
26
27
|
const roster = view.roster.current;
|
|
@@ -30,7 +31,7 @@ function legsOfCall(view, legEnv, token, call, report) {
|
|
|
30
31
|
if (row.boundaryLegs !== "per_call")
|
|
31
32
|
return { legs: row.boundaryLegs, env: legEnv };
|
|
32
33
|
const strictest = (why) => (report(`tool "${row.name}" declares its boundary legs per call, and its boundaryLegsFor ${why} — the call reads as every leg, off the target (the strictest reading)`), { legs: EVERY_LEG, env: undefined });
|
|
33
|
-
const resolve = view.tools.
|
|
34
|
+
const resolve = survivorsByName(view.tools).get(row.name)?.boundaryLegsFor;
|
|
34
35
|
if (typeof resolve !== "function")
|
|
35
36
|
return strictest("is missing");
|
|
36
37
|
let given;
|
|
@@ -47,7 +48,13 @@ function legsOfCall(view, legEnv, token, call, report) {
|
|
|
47
48
|
}
|
|
48
49
|
export async function prepareCrossBoundaryLane(input) {
|
|
49
50
|
const { posture, externalContentTargetActive, env, session, resumeLeg, sessionId, runId, hostTaskId, deps } = input;
|
|
50
|
-
const report = (message) =>
|
|
51
|
+
const report = (message) => {
|
|
52
|
+
try {
|
|
53
|
+
deps.onError?.(new Error(message), { phase: "config", sessionId });
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
}
|
|
57
|
+
};
|
|
51
58
|
const token = input.token ?? mintCrossBoundaryTree();
|
|
52
59
|
const ref = TREE_STATE.get(token);
|
|
53
60
|
if (ref === undefined)
|
|
@@ -71,57 +78,53 @@ export async function prepareCrossBoundaryLane(input) {
|
|
|
71
78
|
ref.current = tree;
|
|
72
79
|
const stationEngaged = posture !== undefined || externalContentTargetActive || crossBoundaryTreeGoverned(tree);
|
|
73
80
|
let reported;
|
|
74
|
-
const unwritten = (phase, state,
|
|
81
|
+
const unwritten = (phase, state, err) => {
|
|
75
82
|
if (reported !== undefined && crossBoundaryTreeCovers(reported, state))
|
|
76
83
|
return;
|
|
77
84
|
reported = state;
|
|
78
|
-
deliverEngineNotice(deps.onNotice, crossBoundaryRecordUnwrittenNotice({ sessionId, runId, phase, governed: crossBoundaryTreeGoverned(ref.current),
|
|
85
|
+
deliverEngineNotice(deps.onNotice, crossBoundaryRecordUnwrittenNotice({ sessionId, runId, phase, governed: crossBoundaryTreeGoverned(ref.current), cause: thrownText(err) }));
|
|
79
86
|
};
|
|
80
87
|
let writing = Promise.resolve();
|
|
81
88
|
let storeWaits = 0;
|
|
82
|
-
const write = (phase, atLeaf,
|
|
89
|
+
const write = (phase, atLeaf, joins = () => undefined) => {
|
|
83
90
|
const next = writing.then(async () => {
|
|
84
|
-
|
|
85
|
-
let cover = phase === "suspend" || phase === "settle";
|
|
91
|
+
const legEnd = phase === "suspend" || phase === "settle";
|
|
86
92
|
let written;
|
|
87
93
|
for (;;) {
|
|
88
|
-
|
|
89
|
-
if (state.targetExecutionArmed !== true)
|
|
94
|
+
if (ref.current.targetExecutionArmed !== true)
|
|
90
95
|
return written;
|
|
96
|
+
const state = joinCrossBoundaryTree(ref.current, joins() ?? {});
|
|
91
97
|
const grown = !crossBoundaryTreeCovers(recorded, state);
|
|
92
|
-
if (!grown && !
|
|
98
|
+
if (!grown && !legEnd)
|
|
93
99
|
return written;
|
|
94
100
|
try {
|
|
95
101
|
if (!grown) {
|
|
96
102
|
storeWaits++;
|
|
97
103
|
const now = readCrossBoundaryRecord((await session.getBranch()));
|
|
98
|
-
if (now.kind !== "malformed" && !now.uncoveredContent)
|
|
99
|
-
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
104
|
+
if (now.kind !== "malformed" && !now.uncoveredContent)
|
|
105
|
+
return written;
|
|
102
106
|
}
|
|
103
|
-
if (
|
|
107
|
+
if (atLeaf !== undefined) {
|
|
104
108
|
storeWaits++;
|
|
105
|
-
if ((await session.getLeafId()) !==
|
|
109
|
+
if ((await session.getLeafId()) !== atLeaf)
|
|
106
110
|
throw new Error("the session moved past the row's leaf before its record could be written");
|
|
107
111
|
}
|
|
108
112
|
storeWaits++;
|
|
109
113
|
const entryId = await session.appendCustomEntry(CROSS_BOUNDARY_RECORD_TYPE, crossBoundaryRecordData(state));
|
|
110
114
|
if (typeof entryId !== "string" || entryId.length === 0)
|
|
111
115
|
throw new Error(`the session store answered the record's append with no entry id (${typeof entryId})`);
|
|
112
|
-
if (
|
|
116
|
+
if (atLeaf !== undefined && (storeWaits++, await session.getLeafId()) !== entryId)
|
|
113
117
|
throw new Error("the record the session store appended is not the session's new leaf");
|
|
114
118
|
recorded = state;
|
|
115
119
|
written = entryId;
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
cover = false;
|
|
120
|
+
if (legEnd)
|
|
121
|
+
return written;
|
|
119
122
|
}
|
|
120
123
|
catch (err) {
|
|
121
124
|
const governed = crossBoundaryTreeGoverned(ref.current);
|
|
122
125
|
if (governed && (phase === "exit" || phase === "suspend"))
|
|
123
126
|
throw err;
|
|
124
|
-
unwritten(phase, state,
|
|
127
|
+
unwritten(phase, state, err);
|
|
125
128
|
if (!governed)
|
|
126
129
|
recorded = state;
|
|
127
130
|
return written;
|
|
@@ -131,8 +134,18 @@ export async function prepareCrossBoundaryLane(input) {
|
|
|
131
134
|
writing = next.catch(() => undefined);
|
|
132
135
|
return next;
|
|
133
136
|
};
|
|
134
|
-
const owe = (atLeaf) => write(atLeaf !== undefined ? "suspend" : "exit", atLeaf);
|
|
135
137
|
const OBSERVED = Object.freeze({ offTargetReadObserved: true });
|
|
138
|
+
const addedBy = (record) => (record && ref.current.offTargetReadObserved !== true ? OBSERVED : undefined);
|
|
139
|
+
const owedBit = (owed) => {
|
|
140
|
+
const records = (given) => given.some((d) => crossBoundaryObligation(d.legs, d.env?.externalContentTarget === true, ref.current).record);
|
|
141
|
+
try {
|
|
142
|
+
return addedBy(records(owed()));
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
report(`the deliveries this leg's session is still owed could not be read (${thrownText(err)}) — read as content from beyond the device`);
|
|
146
|
+
return addedBy(records(ONE_OUTSIDE_READ));
|
|
147
|
+
}
|
|
148
|
+
};
|
|
136
149
|
const trace = (phase, call) => emitTrace(deps.tracer, () => ({ kind: "permission.cross_boundary_taint", version: 1, taskId: hostTaskId, runId, phase, taint: bitsOf(ref.current), governed: ref.current.governed === true, ...(call !== undefined ? { toolName: call.toolName, ...(call.toolCallId !== undefined ? { toolCallId: call.toolCallId } : {}) } : {}), ts: Date.now() }));
|
|
137
150
|
if (tree.targetExecutionArmed === true) {
|
|
138
151
|
trace(resumeLeg ? "resume" : "prepare");
|
|
@@ -172,10 +185,10 @@ export async function prepareCrossBoundaryLane(input) {
|
|
|
172
185
|
message: `tool "${call.toolName}" needs a person's confirmation: this run executes on a target device${ref.current.offTargetReadObserved === true ? " and has since let content from beyond it in, so a call that reaches beyond the device or back into it" : ", so a call that writes beyond the device"} is put to a person — this call was allowed by a configuration, not a person, and was not executed`,
|
|
173
186
|
};
|
|
174
187
|
}
|
|
175
|
-
const adds = now.record
|
|
188
|
+
const adds = addedBy(now.record);
|
|
176
189
|
const judged = ref.current;
|
|
177
190
|
try {
|
|
178
|
-
await write("exit", undefined, adds);
|
|
191
|
+
await write("exit", undefined, () => adds);
|
|
179
192
|
}
|
|
180
193
|
catch (err) {
|
|
181
194
|
return { kind: "unrecorded", message: `tool "${call.toolName}" was not executed: the session's cross-boundary record could not be written before it ran (${thrownText(err)}) — on a governed tree a call that owes its record does not run without it; refused fail-closed` };
|
|
@@ -192,10 +205,10 @@ export async function prepareCrossBoundaryLane(input) {
|
|
|
192
205
|
};
|
|
193
206
|
return check;
|
|
194
207
|
},
|
|
195
|
-
owe,
|
|
208
|
+
owe: (atLeaf, owed) => write("suspend", atLeaf, () => owedBit(owed)),
|
|
196
209
|
storeWaits: () => storeWaits,
|
|
197
210
|
recorded: () => ref.current.targetExecutionArmed === true,
|
|
198
|
-
settle: () => write("settle").then(() => undefined),
|
|
211
|
+
settle: (owed) => write("settle", undefined, () => owedBit(owed)).then(() => undefined),
|
|
199
212
|
};
|
|
200
213
|
return lane;
|
|
201
214
|
}
|
|
@@ -103,9 +103,9 @@ export type InheritedAsk = Extract<PermissionResult, {
|
|
|
103
103
|
* {@link judgeInheritedClassifier} and threaded to every reader ({@link inheritedAskCarry}).
|
|
104
104
|
* The MANDATE marks here are empty (the base names no seat): the policy-chain phase builds each call's facts over this
|
|
105
105
|
* base with THIS task's tool seat — the seat the request's risk axes are read from — so a marked tool's ask is
|
|
106
|
-
* classified by the seat at the station as at the gate. What the ancestor's ask carries on ITSELF still answers.
|
|
106
|
+
* classified by the seat at the station as at the gate. What the ancestor's ask carries on ITSELF still answers. No call either (each station's own).
|
|
107
107
|
*/
|
|
108
|
-
export declare const INHERITED_STATION_FACTS: AskOriginFacts
|
|
108
|
+
export declare const INHERITED_STATION_FACTS: Omit<AskOriginFacts, "call">;
|
|
109
109
|
/** The members of a surviving ask that ride onto the approval request with a COMPUTED value — what the
|
|
110
110
|
* four request mint stations (the gate's own and the three inherited-lane ones) spread after the seats
|
|
111
111
|
* they spell themselves: the ask's origin word, its class (the word and the set, carried together) and its
|
|
@@ -86,7 +86,7 @@ export function inheritedAskCarry(judged, liveApprover, tracker) {
|
|
|
86
86
|
export const inheritedAskFallbackMessage = (toolName) => `approval required for "${toolName}" (inherited parent policy)`;
|
|
87
87
|
export async function judgeInheritedClassifier(opts) {
|
|
88
88
|
const { autoMode, req } = opts;
|
|
89
|
-
const facts = opts.facts ?? INHERITED_STATION_FACTS, m = facts.mandateMarks;
|
|
89
|
+
const facts = opts.facts ?? { ...INHERITED_STATION_FACTS, call: req }, m = facts.mandateMarks;
|
|
90
90
|
const frames = [...(m.egress === true ? [markTightenMessage(req.toolName, "egress")] : []), ...(m.irreversibility === "always" ? [markTightenMessage(req.toolName, "irreversible")] : [])];
|
|
91
91
|
const ask = (frames.length > 0 ? { ...opts.ask, message: [opts.ask.message ?? inheritedAskFallbackMessage(req.toolName), ...frames].join(" — ") } : opts.ask);
|
|
92
92
|
const origin = askOriginOf(ask, facts);
|
|
@@ -14,6 +14,19 @@ export type DerivedSeatOutcome = {
|
|
|
14
14
|
readonly action: "fall_back" | "detach";
|
|
15
15
|
readonly cause: RouteRefusalCode;
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Whether the compaction-summary model is ROLE-derived — the only one whose route is pre-flighted (an EXPLICIT
|
|
19
|
+
* compaction model is a named leg and keeps the request gate's loud refusal). Synchronous: a caller awaits the
|
|
20
|
+
* pre-flight only when this holds, so a run with nothing to judge takes no suspension point at the seat.
|
|
21
|
+
*/
|
|
22
|
+
export declare function compactionSummaryIsDerived(explicit: boolean, compModel: Model | undefined): compModel is Model;
|
|
23
|
+
/**
|
|
24
|
+
* The compaction-summary seat after its route pre-flight: a derived summary model whose key↔URL pairing is broken must
|
|
25
|
+
* not sink the pass at the brain's request gate — it falls back to the primary (`undefined`: the pass then summarizes
|
|
26
|
+
* on the main model, the documented absent-model behavior) and the fallback is announced. The one reading for a run's
|
|
27
|
+
* prepare and the out-of-run compaction.
|
|
28
|
+
*/
|
|
29
|
+
export declare function compactionSummaryFallback(args: Omit<Parameters<typeof derivedRouteFallsBack>[0], "seat" | "onBrokenPairing">): Promise<Model | undefined>;
|
|
17
30
|
/**
|
|
18
31
|
* Judge the derived model where its route differs from the primary's, announce what a broken pairing means for THIS seat
|
|
19
32
|
* (`onBrokenPairing`), and ABSTAIN (keep) on ANY throw. The pre-flight is advisory — the brain's request gate re-runs the
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { adjudicateDerivedRoute, fallbackToPrimaryNotice, sameRouteIdentity, seatDetachedNotice, unroutableSeatNotice } from "../../brain/route-adjudicator.js";
|
|
2
2
|
import { deliverEngineNotice } from "../types.js";
|
|
3
|
+
export function compactionSummaryIsDerived(explicit, compModel) {
|
|
4
|
+
return !explicit && compModel !== undefined;
|
|
5
|
+
}
|
|
6
|
+
export async function compactionSummaryFallback(args) {
|
|
7
|
+
return (await derivedRouteFallsBack({ ...args, seat: "compaction-summary" })).action === "fall_back" ? undefined : args.derived;
|
|
8
|
+
}
|
|
3
9
|
export async function derivedRouteFallsBack(args) {
|
|
4
10
|
try {
|
|
5
11
|
if (sameRouteIdentity(args.derived, args.primary))
|
|
@@ -13,8 +13,9 @@ export interface MalformedCapabilityDeclaration {
|
|
|
13
13
|
* The probe is the VALUE, not membership, because the value is what the readers get: a `capabilities`
|
|
14
14
|
* that answers `has` and `get` differently (a Proxy) would otherwise hide from the census exactly the
|
|
15
15
|
* value a reader goes on to act on. `undefined` is where absence lands — an absent key and an explicit
|
|
16
|
-
* `undefined` are the same word to every reader, and both are the documented silent reading
|
|
17
|
-
*
|
|
16
|
+
* `undefined` are the same word to every reader, and both are the documented silent reading of every key
|
|
17
|
+
* outside {@link NO_ABSENT_READING} (and announced, alike, for a key inside it) — so one test covers both and
|
|
18
|
+
* the census needs no membership rule at all.
|
|
18
19
|
*
|
|
19
20
|
* TOTAL by construction: a diagnostic may not be the thing that fails a run. Every read of the adapter
|
|
20
21
|
* can throw on a getter or a Proxy trap — the structural probe, the block acquisition and each key —
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { isRemoteExecutionEnv } from "../remote-env.js";
|
|
2
2
|
import { deliverEngineNotice } from "../engine-notice.js";
|
|
3
|
-
const BOOLEAN_CAPABILITY_KEYS = ["isolation", "suspendable", "canonicalPathAuthoritative"];
|
|
3
|
+
const BOOLEAN_CAPABILITY_KEYS = ["isolation", "suspendable", "canonicalPathAuthoritative", "sharesProcessTable"];
|
|
4
|
+
const NO_ABSENT_READING = {
|
|
5
|
+
sharesProcessTable: "whether the commands it runs are processes on this engine's own process table has no default, so the Bash tool refuses every pattern kill that needs the question (`pkill`, `killall`, a `kill` fed by `pgrep`; `pkill -P $$`, the shell's own children, runs) on this environment until the adapter declares it — `true` when its commands run on a table that holds the engine (a host lane, or a PID namespace that contains the engine's), `false` only when they run where the engine is not (another machine, a PID namespace that does not contain it)",
|
|
6
|
+
};
|
|
4
7
|
const OPTIONAL_METHOD_KEYS = ["writeFileExclusive", "writeFileGuarded", "setFileMode", "readLink", "canonicalChain", "fileIdentity", "openBound"];
|
|
5
8
|
export function malformedCapabilityDeclarations(env) {
|
|
6
9
|
const out = [];
|
|
@@ -36,7 +39,7 @@ export function malformedCapabilityDeclarations(env) {
|
|
|
36
39
|
out.push({ key, valueType: "unreadable", expected: "boolean" });
|
|
37
40
|
continue;
|
|
38
41
|
}
|
|
39
|
-
if (value ===
|
|
42
|
+
if (typeof value === "boolean" || (value === undefined && NO_ABSENT_READING[key] === undefined))
|
|
40
43
|
continue;
|
|
41
44
|
out.push({ key, valueType: value === null ? "null" : typeof value, expected: "boolean" });
|
|
42
45
|
}
|
|
@@ -44,11 +47,14 @@ export function malformedCapabilityDeclarations(env) {
|
|
|
44
47
|
}
|
|
45
48
|
export function announceMalformedCapabilities(env, onNotice) {
|
|
46
49
|
for (const { key, valueType, expected } of malformedCapabilityDeclarations(env)) {
|
|
50
|
+
const noAbsentReading = NO_ABSENT_READING[key];
|
|
47
51
|
deliverEngineNotice(onNotice, {
|
|
48
52
|
code: "config.execution_env_capability_invalid",
|
|
49
53
|
message: expected === "function"
|
|
50
54
|
? `The execution environment declares ${key} as a ${valueType}, not a function. This seat is declared by being present as a callable method and undeclared by being absent, so every reader takes the absent reading — the reach the adapter meant to declare is silently the old one. Fix the adapter — this is a wiring fault, not a supported way to leave the seat unset.`
|
|
51
|
-
:
|
|
55
|
+
: noAbsentReading !== undefined
|
|
56
|
+
? `The execution environment ${valueType === "undefined" ? `does not declare capabilities.${key}` : `declares capabilities.${key} as a ${valueType}, not a boolean`}: ${noAbsentReading}. Fix the adapter — this is a wiring fault, not a supported way to leave the capability unset.`
|
|
57
|
+
: `The execution environment declares capabilities.${key} as a ${valueType}, not a boolean. What a reader makes of that is the reader's own business and differs between them — the containment readers take only the boolean, so this reads as undeclared, while the suspend reader takes any truthy value, so a non-empty string reads as TRUE. That is why a declaration of the wrong shape cannot pass quietly: the engine may act on something other than what the adapter meant. Fix the adapter — this is a wiring fault, not a supported way to leave the capability unset.`,
|
|
52
58
|
detail: { key, valueType },
|
|
53
59
|
});
|
|
54
60
|
}
|
|
@@ -11,6 +11,24 @@ import type { RunnerDeps, TaskSpec } from "../types.js";
|
|
|
11
11
|
* exactly as it was. What it resolves rides into the file-history phase (`prepareFileHistory`) unchanged.
|
|
12
12
|
*/
|
|
13
13
|
export declare function resolveFileHistoryRequest(spec: Pick<TaskSpec, "resumeAt" | "resumeAtMode" | "restoreFiles" | "rewindFilesTo" | "fileHistory">, deps: Pick<RunnerDeps, "onTrackFailure" | "fileHistoryStore" | "fileHistoryCapture">): FileHistoryRequest;
|
|
14
|
+
/**
|
|
15
|
+
* The DEPLOYMENT's file-history door — the three seats a deployment sets once (`RunnerDeps.onTrackFailure`,
|
|
16
|
+
* `RunnerDeps.fileHistoryStore`, `RunnerDeps.fileHistoryCapture`), each refused by name on a bad value. Read by
|
|
17
|
+
* every seat that touches file history: the run's request door above and the out-of-run `Runner.rewindFiles`, so a
|
|
18
|
+
* misconfigured deployment is refused the same way at both. `fileHistoryStore` is the store after the declared
|
|
19
|
+
* `"disabled"` word; `captureStore` additionally drops it when capture is `"off"` (recording stops, restore stays).
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolveDeploymentFileHistory(deps: Pick<RunnerDeps, "onTrackFailure" | "fileHistoryStore" | "fileHistoryCapture">): {
|
|
22
|
+
onTrackFailure: "refuse" | "proceed-unprotected";
|
|
23
|
+
wiredSeat: FileHistoryStore | "disabled" | undefined;
|
|
24
|
+
captureOff: boolean;
|
|
25
|
+
fileHistoryStore: FileHistoryStore | undefined;
|
|
26
|
+
captureStore: FileHistoryStore | undefined;
|
|
27
|
+
};
|
|
28
|
+
/** A restore asked of a deployment that holds no history backend (none wired, or declared `"disabled"`). */
|
|
29
|
+
export declare function storeUnconfiguredRefusal(wiredSeat: FileHistoryStore | "disabled" | undefined, target: string): Error & {
|
|
30
|
+
code?: string;
|
|
31
|
+
};
|
|
14
32
|
/** What {@link resolveFileHistoryRequest} resolved: the validated seats and words, the run's store (after every off
|
|
15
33
|
* switch) and its capture store, and the restore target (`undefined` = no restore asked). */
|
|
16
34
|
export interface FileHistoryRequest {
|