@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
package/dist/core/gate-lanes.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { argsAsTheToolReads, withArgsReading } from "./effective-path-target.js";
|
|
2
|
-
import { attest, attestationOf, bindableArgsOf, decisionText, foldHookAsk,
|
|
2
|
+
import { attest, attestationOf, bindableArgsOf, decisionText, foldHookAsk, refusalOf, refuseOutOfContractDecision } from "./tool-policy.js";
|
|
3
|
+
import { outletAsk, readRejudge, rewriteChasedSentence, screenRewrite } from "./rewrite-rejudge.js";
|
|
3
4
|
import { arbitrateByMode, classifyAsk, decisionAskClassesOf, dontAskRefusalMessage, fileCommandOptionsSentence, persistedRuleMandateOf, safetyAxisOf, stampAskOrigin } from "./ask-origin.js";
|
|
4
5
|
import { classifierParseFailureDenyMessage, denialLimitFallbackMessage, rungDidNotRule, unarmedWindow } from "./auto-mode.js";
|
|
5
6
|
import { classifierNoRulingArm, settleNoRulingAsk } from "./classifier-unavailable-arm.js";
|
|
6
7
|
import { SETTLEMENT_NOBODY_JUDGED } from "./gate-outcome.js";
|
|
7
8
|
import { inlineUntrusted } from "./untrusted-text.js";
|
|
8
|
-
import { ASK_USER_QUESTION_TOOL_NAME } from "./ask-question.js";
|
|
9
|
-
import {
|
|
9
|
+
import { ASK_USER_QUESTION_TOOL_NAME, isEngineQuestionFace } from "./ask-question.js";
|
|
10
|
+
import { routesContent } from "./tool-catalog-entries.js";
|
|
10
11
|
import { applyPersistedTightening, disclosedRuleSet } from "./persisted-rule-arms.js";
|
|
11
12
|
import { skillAllowDecision, skillRowRefusal } from "./skill-grant.js";
|
|
12
|
-
import { allowRuleShadowOf } from "./allow-entry.js";
|
|
13
|
+
import { allowRuleShadowOf, withAllowRuleShadow } from "./allow-entry.js";
|
|
13
14
|
import { CD_GIT_COMPOUND_SENTENCE, changesDirectoryBeforeGit, readOnlyShellVerdict } from "./read-only-shell.js";
|
|
14
15
|
import { readShellCommand } from "./shell-run-candidates.js";
|
|
15
16
|
import { COMMAND_RULE_TOOL, ruleShapeOf } from "./permission-rule-model.js";
|
|
16
17
|
import { catalogRuleFaceOf, isProtectedWrite } from "./tool-registry.js";
|
|
17
18
|
import { callFaceSeat } from "./tool-roster.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
19
|
+
import { wireOf } from "./tool-name-readings.js";
|
|
20
|
+
import { modeAcceptsFileCommand } from "./mode-policy.js";
|
|
20
21
|
import { ORG_RULE_DECISION_REASON, ORG_UNAVAILABLE_DECISION_REASON, orgUnreadableClause } from "./permission-rule-org.js";
|
|
21
22
|
import { exitGate, passAskFace, untakenValueExit } from "./runner/gate-exit.js";
|
|
22
23
|
import { readOrgRuleLane, readPersistedRuleLane } from "./rule-lane-reads.js";
|
|
@@ -24,11 +25,8 @@ import { traceHookCrash } from "./gate-crash-trace.js";
|
|
|
24
25
|
import { createGateDeadline, awaitWriteProtectionJudgment, withGateTimeout } from "./gate-bounded-await.js";
|
|
25
26
|
import { readStationAnswer } from "./shell-read-silence.js";
|
|
26
27
|
import { agentIdOf, judgedInputOf, raiseToolCheck } from "./mods/stations.js";
|
|
27
|
-
import { readToolChecks } from "./tool-check-reading.js";
|
|
28
|
+
import { extensionAllowOf, readToolChecks } from "./tool-check-reading.js";
|
|
28
29
|
import { policyThrowLine, reportPolicyThrow } from "./runner/policy-throw.js";
|
|
29
|
-
const QUESTION_TOOL_NAMES = new Set([ASK_USER_QUESTION_TOOL_NAME]);
|
|
30
|
-
const CONTENT_ROUTING_CONTRACTS = new Set(["ask-user-question", "structured-output", "report-blocked"].map((id) => toolFace(id).contract.contractId));
|
|
31
|
-
const routesContent = (f) => f?.engineMounted === true && CONTENT_ROUTING_CONTRACTS.has(f.contractId);
|
|
32
30
|
function parkWith(suspendAsk, parkArgs, carry) {
|
|
33
31
|
return suspendAsk(...parkArgs, carry);
|
|
34
32
|
}
|
|
@@ -83,7 +81,8 @@ export async function runGateLanes(pass) {
|
|
|
83
81
|
});
|
|
84
82
|
const readFaceNow = input.readFace?.();
|
|
85
83
|
const askOriginFacts = (org, lane) => ({
|
|
86
|
-
|
|
84
|
+
call: { toolCallId: pass.req.toolCallId, toolName: pass.req.toolName },
|
|
85
|
+
contentQuestion: isEngineQuestionFace(pass.req.face),
|
|
87
86
|
markedUnresolvable: markedUnresolvable(),
|
|
88
87
|
org,
|
|
89
88
|
...(ruleCallUnreadableOf(lane) ? { ruleCallUnreadable: true } : {}),
|
|
@@ -232,7 +231,7 @@ export async function runGateLanes(pass) {
|
|
|
232
231
|
if (laneAnswer?.unreadable === true)
|
|
233
232
|
personalEvidence = { dotsAbsent: "unavailable" };
|
|
234
233
|
let laneCoverage;
|
|
235
|
-
const questionTool =
|
|
234
|
+
const questionTool = originFacts.contentQuestion;
|
|
236
235
|
const laneIsProvenance = orgAnswer.org === undefined &&
|
|
237
236
|
pass.decision.action === "ask" &&
|
|
238
237
|
pass.decision.requiresRealApproval !== true &&
|
|
@@ -272,7 +271,7 @@ export async function runGateLanes(pass) {
|
|
|
272
271
|
});
|
|
273
272
|
const storedAllows = laneAnswer?.hit?.behavior === "allow" ? laneAnswer.hit.rules : undefined;
|
|
274
273
|
const members = [
|
|
275
|
-
["hook", () => (pass.hookAllowedBy !== undefined
|
|
274
|
+
["hook", () => (pass.hookAllowedBy !== undefined ? { entries: pass.hookAllowedBy, clear: () => extensionAllowOf(pass.hookAllowedBy ?? [], pass.policyRewrite), afterClear: async () => undefined } : undefined)],
|
|
276
275
|
["deployment", () => {
|
|
277
276
|
const hit = input.deploymentAllows?.allowing(pass.req, mode);
|
|
278
277
|
return hit && { entries: hit.entries, ...(hit.positions !== undefined ? { positions: hit.positions } : {}), clear: () => listAllow("deployment_rule", "the deployment's", hit.entries), afterClear: () => notifier.notifyAsync(() => input.deploymentAllows?.onAllowed?.({ toolName: pass.req.toolName, toolCallId, entries: hit.entries }), "toolGate.allowedToolsResolved") };
|
|
@@ -292,7 +291,15 @@ export async function runGateLanes(pass) {
|
|
|
292
291
|
return hit && { entries: hit.entries, ...(hit.positions !== undefined ? { positions: hit.positions } : {}), clear: () => listAllow("request_rule", "this run's", hit.entries), afterClear: () => notifier.notifyAsync(() => input.requestAllows?.onAllowed?.({ toolName: pass.req.toolName, toolCallId, entries: hit.entries }), "toolGate.allowedToolsResolved") };
|
|
293
292
|
}],
|
|
294
293
|
];
|
|
295
|
-
const
|
|
294
|
+
const clearAs = async (member, hit) => {
|
|
295
|
+
const cleared = hit.clear();
|
|
296
|
+
pass.clearedBy = { ...allowRuleShadowOf(member, hit.entries), ...(hit.positions !== undefined ? { positions: hit.positions } : {}) };
|
|
297
|
+
await hit.afterClear();
|
|
298
|
+
if (member !== "hook")
|
|
299
|
+
afterRuleClear();
|
|
300
|
+
return cleared;
|
|
301
|
+
};
|
|
302
|
+
let shadows = [];
|
|
296
303
|
if (!questionTool) {
|
|
297
304
|
for (const [member, match] of members) {
|
|
298
305
|
if (pass.decision.action !== "ask")
|
|
@@ -301,14 +308,10 @@ export async function runGateLanes(pass) {
|
|
|
301
308
|
if (hit === undefined)
|
|
302
309
|
continue;
|
|
303
310
|
if (allowMayClear()) {
|
|
304
|
-
pass.decision = hit
|
|
305
|
-
pass.clearedBy = { ...allowRuleShadowOf(member, hit.entries), ...(hit.positions !== undefined ? { positions: hit.positions } : {}) };
|
|
306
|
-
await hit.afterClear();
|
|
307
|
-
if (member !== "hook")
|
|
308
|
-
afterRuleClear();
|
|
311
|
+
pass.decision = await clearAs(member, hit);
|
|
309
312
|
break;
|
|
310
313
|
}
|
|
311
|
-
shadows
|
|
314
|
+
shadows = withAllowRuleShadow(shadows, allowRuleShadowOf(member, hit.entries));
|
|
312
315
|
hit.shadowed?.();
|
|
313
316
|
}
|
|
314
317
|
}
|
|
@@ -332,7 +335,7 @@ export async function runGateLanes(pass) {
|
|
|
332
335
|
const command = typeof args === "object" && args !== null && !Array.isArray(args) ? args[commandParam] : undefined;
|
|
333
336
|
const backgrounded = typeof args === "object" && args !== null && args.run_in_background === true;
|
|
334
337
|
const shape = typeof command === "string" ? readShellCommand(command) : undefined;
|
|
335
|
-
if (typeof command === "string" && shape !== undefined && !backgrounded && readOnlyShellVerdict(command, shape, input.trackedCwd?.()).readOnly) {
|
|
338
|
+
if (typeof command === "string" && shape !== undefined && !backgrounded && readOnlyShellVerdict(command, { shape, cwd: input.trackedCwd?.() }).readOnly) {
|
|
336
339
|
pass.decision = {
|
|
337
340
|
action: "allow",
|
|
338
341
|
message: "the command is read-only (upstream's read-only command tables) — allowed without asking",
|
|
@@ -351,7 +354,7 @@ export async function runGateLanes(pass) {
|
|
|
351
354
|
if (read?.kind === "denied")
|
|
352
355
|
refuseByExtension(read.deny);
|
|
353
356
|
else if (read?.kind === "cleared")
|
|
354
|
-
pass.decision = read.allow;
|
|
357
|
+
pass.decision = await clearAs("hook", { entries: read.entries, clear: () => read.allow, afterClear: async () => undefined });
|
|
355
358
|
else if (read?.kind === "asked") {
|
|
356
359
|
const asked = read.minted ? { ...read.ask, ruleEvidence: mintRuleEvidence(personalEvidence) } : read.ask;
|
|
357
360
|
if (read.marked === true)
|
|
@@ -360,7 +363,7 @@ export async function runGateLanes(pass) {
|
|
|
360
363
|
pass.decision = stampAskOrigin(asked, facts, classifyStanding(asked, facts));
|
|
361
364
|
}
|
|
362
365
|
else if (read?.kind === "shadowed" && pass.decision.action === "ask")
|
|
363
|
-
pass.decision = { ...pass.decision, allowRuleShadowed: [...(pass.decision.allowRuleShadowed ?? [])
|
|
366
|
+
pass.decision = { ...pass.decision, allowRuleShadowed: read.shadows.reduce(withAllowRuleShadow, [...(pass.decision.allowRuleShadowed ?? [])]) };
|
|
364
367
|
else if (read?.kind === "approved")
|
|
365
368
|
takeApprovedEdit(read);
|
|
366
369
|
}
|
|
@@ -417,7 +420,6 @@ export async function runGateLanes(pass) {
|
|
|
417
420
|
}
|
|
418
421
|
if (input.sandboxAdmission !== undefined &&
|
|
419
422
|
pass.decision.action === "ask" &&
|
|
420
|
-
wireOf("lanes.sandboxQuestionSkip", pass.req) !== ASK_USER_QUESTION_TOOL_NAME &&
|
|
421
423
|
input.isMarkedUnresolvable?.(input.event.toolCallId) !== true &&
|
|
422
424
|
pass.decision.requiresRealApproval !== true &&
|
|
423
425
|
pass.decision.decisionReason !== "hook" &&
|
|
@@ -484,7 +486,7 @@ export async function runGateLanes(pass) {
|
|
|
484
486
|
if (parked)
|
|
485
487
|
return parked;
|
|
486
488
|
}
|
|
487
|
-
if (pass.decision.action === "ask" &&
|
|
489
|
+
if (pass.decision.action === "ask" && originFacts.contentQuestion) {
|
|
488
490
|
const outcome = input.resolveContentAsk !== undefined ? await (callSignal !== undefined ? input.resolveContentAsk(pass.req, callSignal) : input.resolveContentAsk(pass.req)) : { kind: "unavailable", parkDeclined: false };
|
|
489
491
|
if (outcome.kind === "answered") {
|
|
490
492
|
pass.decision = { action: "allow" };
|
|
@@ -552,7 +554,6 @@ export async function runGateLanes(pass) {
|
|
|
552
554
|
if (approvedWithArgs && pass.decision.action === "allow" && pass.decision.updatedInput !== undefined) {
|
|
553
555
|
let editArgs = pass.decision.updatedInput;
|
|
554
556
|
let editDenied;
|
|
555
|
-
let editRewrittenSinceHuman = false;
|
|
556
557
|
let editAnswer = pass.decision;
|
|
557
558
|
let unanswered;
|
|
558
559
|
const refusedAtResolution = (d) => { editDenied = d; pass.deniedBy = "ask_resolution"; };
|
|
@@ -575,6 +576,7 @@ export async function runGateLanes(pass) {
|
|
|
575
576
|
break;
|
|
576
577
|
}
|
|
577
578
|
let editHookAsk;
|
|
579
|
+
let rewrittenEdit = false;
|
|
578
580
|
if (screening !== undefined) {
|
|
579
581
|
const screened = await screening.screen(editArgs, `the approved edit for "${toolName}"`);
|
|
580
582
|
if (screened.kind === "refused") {
|
|
@@ -595,9 +597,10 @@ export async function runGateLanes(pass) {
|
|
|
595
597
|
const { updatedInput: _adopted, ...ask } = hr;
|
|
596
598
|
editHookAsk = ask;
|
|
597
599
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
600
|
+
const hookRead = readRejudge(pass.req, editArgs, hr);
|
|
601
|
+
if (hookRead.kind === "rewritten") {
|
|
602
|
+
editArgs = hookRead.form;
|
|
603
|
+
rewrittenEdit = true;
|
|
601
604
|
}
|
|
602
605
|
}
|
|
603
606
|
}
|
|
@@ -605,7 +608,7 @@ export async function runGateLanes(pass) {
|
|
|
605
608
|
if (adjudicate) {
|
|
606
609
|
try {
|
|
607
610
|
const editReq = Object.freeze({ toolName, args: editArgs, toolCallId, ...(pass.req.face !== undefined ? { face: pass.req.face } : {}) });
|
|
608
|
-
recheck = refuseOutOfContractDecision(await (callSignal !== undefined ? adjudicate(editReq, callSignal) : adjudicate(editReq)));
|
|
611
|
+
recheck = refuseOutOfContractDecision(await (callSignal !== undefined ? adjudicate(editReq, callSignal) : adjudicate(editReq)), { call: editReq });
|
|
609
612
|
}
|
|
610
613
|
catch (err) {
|
|
611
614
|
reportPolicyThrow((e) => traceHookCrash(input, e, notifier), "the tool policy's re-check of the approved edit", { toolName, toolCallId }, err, callSignal ?? input.abortSignal);
|
|
@@ -628,9 +631,30 @@ export async function runGateLanes(pass) {
|
|
|
628
631
|
break;
|
|
629
632
|
}
|
|
630
633
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
+
const policyRead = recheck.action !== "deny" ? readRejudge(pass.req, editArgs, recheck) : undefined;
|
|
635
|
+
if (recheck.action !== "deny" && recheck.updatedInput !== undefined) {
|
|
636
|
+
const { updatedInput: _form, ...verdict } = recheck;
|
|
637
|
+
recheck = verdict;
|
|
638
|
+
}
|
|
639
|
+
if (policyRead?.kind === "rewritten") {
|
|
640
|
+
if (rewrittenEdit) {
|
|
641
|
+
editDenied = { action: "deny", message: rewriteChasedSentence(toolName) };
|
|
642
|
+
pass.deniedBy = "policy";
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
editArgs = policyRead.form;
|
|
646
|
+
rewrittenEdit = true;
|
|
647
|
+
const second = screening !== undefined ? await screenRewrite(screening, pass.req, editArgs, `the rewritten edit for "${toolName}"`) : undefined;
|
|
648
|
+
if (second?.kind === "refused") {
|
|
649
|
+
editDenied = { action: "deny", message: second.reason };
|
|
650
|
+
pass.deniedBy = "hook";
|
|
651
|
+
break;
|
|
652
|
+
}
|
|
653
|
+
if (second?.kind === "stands") {
|
|
654
|
+
if (second.answer?.additionalContext)
|
|
655
|
+
pass.preToolContext.push(second.answer.additionalContext);
|
|
656
|
+
editHookAsk = second.answer?.action === "ask" ? second.answer : undefined;
|
|
657
|
+
}
|
|
634
658
|
}
|
|
635
659
|
const editOrg = await applyOrgLayer(recheck, editArgs);
|
|
636
660
|
recheck = editOrg.decision;
|
|
@@ -657,21 +681,17 @@ export async function runGateLanes(pass) {
|
|
|
657
681
|
pass.deniedBy = "policy";
|
|
658
682
|
break;
|
|
659
683
|
}
|
|
660
|
-
if (
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
recheck = { action: "ask", message: permissionSeatAt(input, editArgs)?.question ?? unstatedAskMessage(toolName) };
|
|
668
|
-
pass.tightenedBy = "unstated";
|
|
684
|
+
if (rewrittenEdit && input.writeProtectionCheck !== undefined) {
|
|
685
|
+
const check = input.writeProtectionCheck;
|
|
686
|
+
const verdict = await awaitWriteProtectionJudgment((deadline) => check(toolName, editArgs, pass.req.face, input.trackedCwd?.(), deadline), boundedAwaitDeadlineMs, callSignal ?? input.abortSignal);
|
|
687
|
+
if (verdict !== undefined && verdict.kind !== "clear") {
|
|
688
|
+
editDenied = { action: "deny", message: verdict.kind === "hit" ? `the approved edit for "${toolName}" was rewritten by the restriction chain onto a write-protected path (table entry "${verdict.hit.name}") that no approval covers — denied fail-closed; re-submit the edited action directly` : `the approved edit for "${toolName}" was rewritten by the restriction chain onto a target whose destination could not be determined (target_unresolved: ${verdict.cause}) — denied fail-closed; re-submit the edited action directly` };
|
|
689
|
+
pass.deniedBy = "write_protection";
|
|
690
|
+
break;
|
|
669
691
|
}
|
|
670
692
|
}
|
|
671
|
-
if (
|
|
672
|
-
|
|
673
|
-
editRewrittenSinceHuman = true;
|
|
674
|
-
}
|
|
693
|
+
if (rewrittenEdit)
|
|
694
|
+
recheck = outletAsk(recheck, toolName, editArgs);
|
|
675
695
|
let editFacts;
|
|
676
696
|
const stampEditAsk = (ask) => {
|
|
677
697
|
const editAskSnapshot = { ...ask, ruleEvidence: mintRuleEvidence({ dotsAbsent: "not_adjudicated" }) };
|
|
@@ -687,7 +707,9 @@ export async function runGateLanes(pass) {
|
|
|
687
707
|
if (carriedOwnAsk !== undefined) {
|
|
688
708
|
const { updatedInput: _theOriginalBytes, ...carried } = carriedOwnAsk;
|
|
689
709
|
const rra = carried.requiresRealApproval === true ? { requiresRealApproval: true } : {};
|
|
690
|
-
|
|
710
|
+
const call = { toolCallId, toolName };
|
|
711
|
+
const folded = new Set([...(editDecision.action === "ask" ? (attestationOf(editDecision, call)?.foldedClasses ?? []) : []), ...decisionAskClassesOf(carried, call), ...(carried.classes ?? [])]);
|
|
712
|
+
editDecision = stampEditAsk(editDecision.action === "ask" ? attest({ ...editDecision, ...rra }, call, { foldedClasses: [...folded] }) : carried);
|
|
691
713
|
carriedOwnAsk = undefined;
|
|
692
714
|
}
|
|
693
715
|
const editRead = await checkTool(editDecision, editArgs, editOrg.org, undefined);
|
|
@@ -700,7 +722,6 @@ export async function runGateLanes(pass) {
|
|
|
700
722
|
carriedOwnAsk = editRead.outstanding ?? (editDecision.action === "ask" ? editDecision : undefined);
|
|
701
723
|
editArgs = editRead.allow.updatedInput;
|
|
702
724
|
editAnswer = editRead.allow;
|
|
703
|
-
editRewrittenSinceHuman = false;
|
|
704
725
|
continue;
|
|
705
726
|
}
|
|
706
727
|
if (editRead?.kind === "asked" && editRead.marked === true)
|
|
@@ -708,13 +729,13 @@ export async function runGateLanes(pass) {
|
|
|
708
729
|
if (editRead?.kind === "asked")
|
|
709
730
|
editDecision = stampEditAsk(editRead.ask);
|
|
710
731
|
else if (editRead?.kind === "shadowed" && editDecision.action === "ask")
|
|
711
|
-
editDecision = { ...editDecision, allowRuleShadowed: [...(editDecision.allowRuleShadowed ?? [])
|
|
732
|
+
editDecision = { ...editDecision, allowRuleShadowed: editRead.shadows.reduce(withAllowRuleShadow, [...(editDecision.allowRuleShadowed ?? [])]) };
|
|
712
733
|
if (editDecision.action !== "ask")
|
|
713
734
|
break;
|
|
714
735
|
const editAskDecision = editDecision;
|
|
715
736
|
if (input.permissionMode !== undefined && pass.askClassification !== undefined) {
|
|
716
737
|
const editVerdict = arbitrateByMode(input.permissionMode(), pass.askClassification, { ...(editAskDecision.origin !== undefined ? { origin: editAskDecision.origin } : {}), ...(editAskDecision.mandate !== undefined ? { mandate: editAskDecision.mandate } : {}) });
|
|
717
|
-
if (editVerdict.kind === "released") {
|
|
738
|
+
if (editVerdict.kind === "released" && !rewrittenEdit) {
|
|
718
739
|
ledger.supersede();
|
|
719
740
|
pass.arbitration = editVerdict;
|
|
720
741
|
await notifier.notifyAsync(() => input.onModeReleased?.({ toolName, toolCallId, release: { mode: editVerdict.mode, askClass: editVerdict.askClass, classes: editVerdict.classes, ...(editVerdict.origin !== undefined ? { origin: editVerdict.origin } : {}), ...(editVerdict.mandate !== undefined ? { mandate: editVerdict.mandate } : {}), ...(editVerdict.reason !== undefined ? { reason: editVerdict.reason } : {}) }, ...(pass.shellReadUnestablished === true ? { readUnestablished: true } : {}) }), "toolGate.onModeReleased");
|
|
@@ -736,34 +757,21 @@ export async function runGateLanes(pass) {
|
|
|
736
757
|
const rr = ledger.fromResolved(await (callSignal !== undefined ? resolveAsk(editAskDecision, editAskReq, callSignal) : resolveAsk(editAskDecision, editAskReq)), editAskDecision, editAskReq);
|
|
737
758
|
if (rr.action !== "allow") {
|
|
738
759
|
refusedAtResolution(rr);
|
|
760
|
+
if (rewrittenEdit)
|
|
761
|
+
pass.denyDetails = { editRewritten: { acceptableForm: editArgs } };
|
|
739
762
|
if (rr.approverUnavailable === true)
|
|
740
763
|
unanswered = { ask: editAskDecision, req: editAskReq, org: editOrg.org, deny: rr };
|
|
741
764
|
break;
|
|
742
765
|
}
|
|
743
766
|
if (rr.updatedInput === undefined) {
|
|
744
|
-
editRewrittenSinceHuman = false;
|
|
745
767
|
break;
|
|
746
768
|
}
|
|
747
769
|
editArgs = rr.updatedInput;
|
|
748
770
|
editAnswer = rr;
|
|
749
771
|
if (editAskDecision.action === "ask")
|
|
750
772
|
editAskedOrigin = editAskDecision.origin;
|
|
751
|
-
editRewrittenSinceHuman = false;
|
|
752
773
|
}
|
|
753
774
|
const rejudged = () => editDenied === undefined || editDenied === unanswered?.deny;
|
|
754
|
-
if (rejudged() && editRewrittenSinceHuman && input.writeProtectionCheck !== undefined) {
|
|
755
|
-
const check = input.writeProtectionCheck;
|
|
756
|
-
const verdict = await awaitWriteProtectionJudgment((deadline) => check(toolName, editArgs, pass.req.face, input.trackedCwd?.(), deadline), boundedAwaitDeadlineMs, callSignal ?? input.abortSignal);
|
|
757
|
-
if (verdict !== undefined && verdict.kind !== "clear") {
|
|
758
|
-
editDenied = {
|
|
759
|
-
action: "deny",
|
|
760
|
-
message: verdict.kind === "hit"
|
|
761
|
-
? `the approved edit for "${toolName}" was rewritten by the restriction chain onto a write-protected path (table entry "${verdict.hit.name}") that no approval covers — denied fail-closed; re-submit the edited action directly`
|
|
762
|
-
: `the approved edit for "${toolName}" was rewritten by the restriction chain onto a target whose destination could not be determined (target_unresolved: ${verdict.cause}) — denied fail-closed; re-submit the edited action directly`,
|
|
763
|
-
};
|
|
764
|
-
pass.deniedBy = "write_protection";
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
775
|
if (rejudged() && input.shellReadCheck !== undefined) {
|
|
768
776
|
const station = input.shellReadCheck;
|
|
769
777
|
const judged = station.judge(pass.req, editArgs, input.trackedCwd?.(), callSignal ?? input.abortSignal, { seat: "rejudge", toolCallId });
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { type AskClass, type AskOrigin, type AssertAllKeysHandled, type ModeReleaseReason, type PermissionMode, type PersistedRuleMandate } from "./ask-origin.js";
|
|
11
11
|
import { type AutoModeClassifierRound, type AutoModeFallbackCause } from "./auto-mode.js";
|
|
12
12
|
import { type AllowRuleClearance } from "./allow-rule-shadow.js";
|
|
13
|
+
import type { ResolvedOutcome } from "./checkpoint-store.js";
|
|
13
14
|
/**
|
|
14
15
|
* How the wait an ask was in ENDED — the closed set. One word per way a wait can end; the `who` on the
|
|
15
16
|
* record says which party ended it and is fixed BY the word (see {@link Settlement}).
|
|
@@ -244,6 +245,18 @@ export declare const SETTLEMENT_NOBODY_JUDGED: {
|
|
|
244
245
|
};
|
|
245
246
|
/** Compile-time fence: `never` while every settlement kind has a nobody-judged row. */
|
|
246
247
|
export type NobodyJudgedTableCoversEveryKind = AssertAllKeysHandled<Exclude<SettlementKind, keyof typeof SETTLEMENT_NOBODY_JUDGED>>;
|
|
248
|
+
/** Which words of a durable row's winner ({@link ResolvedOutcome.decision}) are the ALLOW direction: a tool approval's `allow`, a plan
|
|
249
|
+
* pause's `approve` / `edit`; the others refuse. Total over the winner's words — the fence below refuses a word without a row — so
|
|
250
|
+
* invariant I11 compares directions by table lookup. */
|
|
251
|
+
declare const WINNER_DECISION_ALLOWS: {
|
|
252
|
+
readonly allow: true;
|
|
253
|
+
readonly approve: true;
|
|
254
|
+
readonly edit: true;
|
|
255
|
+
readonly deny: false;
|
|
256
|
+
readonly reject: false;
|
|
257
|
+
};
|
|
258
|
+
/** Compile-time fence: `never` while every word a winner can hold has a direction row. */
|
|
259
|
+
export type WinnerDecisionTableCoversEveryDecision = AssertAllKeysHandled<Exclude<ResolvedOutcome["decision"], keyof typeof WINNER_DECISION_ALLOWS>>;
|
|
247
260
|
/**
|
|
248
261
|
* WHO REFUSED a call — the layer whose verdict is the deny. The other question a deny raises, "who ASKED",
|
|
249
262
|
* is answered by {@link GateOutcome.origin} (an {@link import("./ask-origin.js").AskOrigin}); the two used
|
|
@@ -353,8 +366,8 @@ export type CauseTableCoversEveryDeniedBy = AssertAllKeysHandled<Exclude<DeniedB
|
|
|
353
366
|
* handed the question to the approval seat, whose settlement then names the resolution that ask reached.
|
|
354
367
|
* Additive. Invariant I6 ({@link screenGateOutcome}) screens its shape.
|
|
355
368
|
*
|
|
356
|
-
* `clearedBy` — the allow layer's account of a call it let run without asking: which member
|
|
357
|
-
*
|
|
369
|
+
* `clearedBy` — the allow layer's account of a call it let run without asking: which member cleared the ask (`hook`, an
|
|
370
|
+
* extension's `classic.PreToolUse` or `tool.check` allow, / `deployment` / `persisted` / `skill` / `request`) and the entries it stood on, sanitized and capped as a shadow
|
|
358
371
|
* record is, with `positions` for a list member (the indices of those entries in the list the run received — a host maps them
|
|
359
372
|
* onto the declaration it sent for this run). Present exactly when an allow member cleared a standing ask and nobody answered
|
|
360
373
|
* it: absent on a call nothing asked about, a mode's release or acceptance, the read-only arm's, the classifier's or the
|
|
@@ -404,7 +417,7 @@ export interface ModeRefusal {
|
|
|
404
417
|
* payload, the call's `tool_end` frame, and the durable row's resolved outcome. The three faces are the
|
|
405
418
|
* same object graph, so they cannot tell different stories.
|
|
406
419
|
*
|
|
407
|
-
* The three members are orthogonal but bound by
|
|
420
|
+
* The three members are orthogonal but bound by the invariants ({@link screenGateOutcome}):
|
|
408
421
|
* I1 `settlement` present ⇔ `origin` present (they describe the same ask);
|
|
409
422
|
* I2 `disposition.deniedBy === "ask_resolution"` ⇒ `settlement` present and a refusal kind;
|
|
410
423
|
* I3 `settlement` an approval (a kind {@link SETTLEMENT_IS_REFUSAL} says is not a refusal) ∧
|
|
@@ -428,7 +441,11 @@ export interface ModeRefusal {
|
|
|
428
441
|
* I9 `disposition.clearedBy` present ⇒ `kind === "allowed"`, no settlement and no release (an allow member cleared the ask
|
|
429
442
|
* before anyone answered it), `member` one of the allow layer's members, `entries` a list of strings, `omitted` a positive
|
|
430
443
|
* whole number when present, and `positions` — only on a list member (`request`, `deployment`) — a list of non-negative
|
|
431
|
-
* whole numbers
|
|
444
|
+
* whole numbers;
|
|
445
|
+
* I10 `settlement.when` present ⇒ a finite number (epoch ms — the moment the wait ended is a value a reader can order);
|
|
446
|
+
* I11 a winner's `decision` stated beside the record (the caller reads a durable row: `winnerDecision`) ⇒ a word a winner holds,
|
|
447
|
+
* and its direction (allow: `allow` / `approve` / `edit`; refusal: `deny` / `reject`) is the direction of the record's
|
|
448
|
+
* settlement ({@link SETTLEMENT_IS_REFUSAL}) and of its disposition (`allowed` / `denied`) — one decision, one direction.
|
|
432
449
|
* Nothing here is read out of an ABSENCE: an ordinary allow with no ask is `{ disposition: { kind: "allowed" } }`,
|
|
433
450
|
* a direct policy deny is `{ disposition: { kind: "denied", deniedBy: "policy" } }`, and neither carries a
|
|
434
451
|
* settlement because neither settled one.
|
|
@@ -506,7 +523,7 @@ type DenyOnlyMember = Exclude<keyof Extract<GateDisposition, {
|
|
|
506
523
|
/** Compile-time fence: `never` while the list is exactly the denied arm's own members. */
|
|
507
524
|
export type DenyOnlyMembersAreListed = AssertAllKeysHandled<Exclude<DenyOnlyMember, (typeof DENY_ONLY_MEMBERS)[number]> | Exclude<(typeof DENY_ONLY_MEMBERS)[number], DenyOnlyMember>>;
|
|
508
525
|
/**
|
|
509
|
-
* The one invariant screen for a {@link GateOutcome} (I1–
|
|
526
|
+
* The one invariant screen for a {@link GateOutcome} (I1–I11 above, plus the closed-set word each member carries). Two readings:
|
|
510
527
|
* - `"archive"` (the default) — a record read back from where it was kept (a replay, a ledger, a durable row): its shape, with
|
|
511
528
|
* every closed set read as its live members plus {@link RETIRED_MEMBERS}. A record lawful when minted is not a defect later.
|
|
512
529
|
* - `"producer"` — a record THIS engine is composing or publishing now: the live sets alone, and the engine's release law
|
|
@@ -514,10 +531,14 @@ export type DenyOnlyMembersAreListed = AssertAllKeysHandled<Exclude<DenyOnlyMemb
|
|
|
514
531
|
* The record is read as whatever it holds (`unknown`): a member that is not the shape the type names — `null`, an array, a
|
|
515
532
|
* primitive where a record belongs, an object where a word belongs — is a defect naming its position, never an exception, and
|
|
516
533
|
* every class, reason, origin and mandate word is read wherever the record carries it.
|
|
534
|
+
* A caller reading a durable row's winner ({@link ResolvedOutcome}) states the winner's `decision` beside the record it carries
|
|
535
|
+
* (`winnerDecision`, the key present whatever it holds, read as `reading` is read): invariant I11 then reads that word, so the decision and the record it filed
|
|
536
|
+
* cannot be read as two directions. Without the key there is no winner beside the record and I11 reads nothing.
|
|
517
537
|
* Returns the defects as sentences (an empty list is a clean record); the caller decides the fail-loud form (report + withhold,
|
|
518
538
|
* or refuse), never silently repairs the record. An options value that is not an object, or a reading outside the two, throws.
|
|
519
539
|
*/
|
|
520
540
|
export declare function screenGateOutcome(g: unknown, opts?: {
|
|
521
541
|
readonly reading?: "archive" | "producer";
|
|
542
|
+
readonly winnerDecision?: unknown;
|
|
522
543
|
}): string[];
|
|
523
544
|
export {};
|
|
@@ -75,6 +75,16 @@ export const SETTLEMENT_NOBODY_JUDGED = {
|
|
|
75
75
|
policy_refused: true,
|
|
76
76
|
task_aborted: false,
|
|
77
77
|
};
|
|
78
|
+
const WINNER_DECISION_ALLOWS = {
|
|
79
|
+
allow: true,
|
|
80
|
+
approve: true,
|
|
81
|
+
edit: true,
|
|
82
|
+
deny: false,
|
|
83
|
+
reject: false,
|
|
84
|
+
};
|
|
85
|
+
function isWinnerDecision(v) {
|
|
86
|
+
return typeof v === "string" && Object.hasOwn(WINNER_DECISION_ALLOWS, v);
|
|
87
|
+
}
|
|
78
88
|
export const DENIED_BY_VALUES = Object.freeze(["policy", "hook", "org", "persisted_rule", "classifier", "compliance", "write_protection", "ask_resolution", "read_boundary", "mode"]);
|
|
79
89
|
const DENIED_BY_SET = new Set(DENIED_BY_VALUES);
|
|
80
90
|
export function isDeniedBy(v) {
|
|
@@ -231,6 +241,8 @@ export function screenGateOutcome(g, opts) {
|
|
|
231
241
|
const party = objectOf(s?.who)?.party;
|
|
232
242
|
if (s !== undefined && !member("settlementParty", party))
|
|
233
243
|
defects.push(outside("settlement.who.party", "settlementParty", party));
|
|
244
|
+
if (s !== undefined && !(typeof s.when === "number" && Number.isFinite(s.when)))
|
|
245
|
+
defects.push(`I10: settlement.when ${spelled(s.when)} is not a finite number (epoch ms)`);
|
|
234
246
|
if (record.origin !== undefined && !member("askOrigin", record.origin))
|
|
235
247
|
defects.push(outside("origin", "askOrigin", record.origin));
|
|
236
248
|
if (settled !== (record.origin !== undefined))
|
|
@@ -317,6 +329,20 @@ export function screenGateOutcome(g, opts) {
|
|
|
317
329
|
}
|
|
318
330
|
}
|
|
319
331
|
}
|
|
332
|
+
if (opts !== undefined && "winnerDecision" in opts) {
|
|
333
|
+
const decision = opts.winnerDecision;
|
|
334
|
+
if (!isWinnerDecision(decision))
|
|
335
|
+
defects.push(`I11: winnerDecision ${spelled(decision)} is none of the words a winner holds (${Object.keys(WINNER_DECISION_ALLOWS).join(", ")})`);
|
|
336
|
+
else {
|
|
337
|
+
const allows = WINNER_DECISION_ALLOWS[decision];
|
|
338
|
+
const says = allows ? "allow" : "refusal";
|
|
339
|
+
if (kind !== undefined && SETTLEMENT_IS_REFUSAL[kind] === allows)
|
|
340
|
+
defects.push(`I11: the winner's decision "${decision}" is the ${says} direction but the settlement kind ${kind} ended the wait as ${allows ? "a refusal" : "an approval"}`);
|
|
341
|
+
const recordAllows = allowed !== undefined ? true : denied !== undefined ? false : undefined;
|
|
342
|
+
if (recordAllows !== undefined && recordAllows !== allows)
|
|
343
|
+
defects.push(`I11: the winner's decision "${decision}" is the ${says} direction but the disposition reads ${recordAllows ? "allowed" : "denied"}`);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
320
346
|
if (producer)
|
|
321
347
|
defects.push(...releasePolicyDefects(g));
|
|
322
348
|
return defects;
|
|
@@ -145,7 +145,7 @@ export type NoticeAudience = "user" | "operator";
|
|
|
145
145
|
* the union's catalog ({@link EngineNotice.code}). The groups below say only which family a row joins,
|
|
146
146
|
* so the catalog is not written a second time here and the two cannot drift.
|
|
147
147
|
*/
|
|
148
|
-
export declare const ENGINE_NOTICE_CODES: readonly ["config.autocompact_window_clamped", "config.env_timeout_discarded", "config.materialize_env_discarded", "config.models_swapped", "config.context_settings_swapped", "config.read_face_swapped", "config.read_face_deployment_clamped", "config.write_face_swapped", "config.write_face_deployment_clamped", "config.read_deny_swapped", "config.tool_model_gate_removed", "config.tool_model_gate_unknown_class", "config.tool_model_gate_env_invalid", "config.artifact_host_invalid", "config.task_root_not_canonical", "config.write_protection_target_view_absent", "config.path_view_unresolved", "config.execution_env_capability_invalid", "config.tool_card_undeclared", "config.tool_face_undeclared", "config.tool_face_invalid", "config.forward_sink_failed", "config.durable_gate_unavailable", "config.peer_admission_out_of_range", "config.peer_lane_unmounted", "config.secret_env_scrubbed", "config.credential_not_withheld", "config.cross_boundary_posture_undeclared", "config.cross_boundary_record_unwritten", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "config.session_rules_earlier_grammar", "permission.allowed_tool_not_granted", "mods.registration_refused", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "classifier.fallback", "classifier.role_defaulted", "classifier.contract_broken", "classifier.unavailable", "checkpoint.execution_outcome_unrecorded", "delegation.transcript_integrity", "delegation.ask_unresolvable", "mcp.injection_dropped", "mcp.revocation_probe_failed", "mcp.server_redialed", "workflow.governance_key_stripped", "workflow.agent_option_ignored", "memory.session_polluted", "memory.harvest_quarantined", "memory.delegation_static_mark_waived", "memory.content_class_declared", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "memory.consolidation_recommended", "memory.consolidation_committed", "memory.consolidation_conflict", "memory.consolidation_incomplete", "memory.consolidation_refused", "memory.consolidation_withheld", "memory.restore_withheld", "memory.project_scope_absent", "route.fallback_to_primary", "route.classifier_unroutable", "route.seat_detached", "advisor.not_attached", "route.credential_origin_mismatch", "route.response_model_mismatch", "route.tool_call_id_folded", "route.finish_reason_unknown", "route.stream_end_ignored", "route.extra_body_reserved_dropped", "context.tool_turn_repaired", "task.user_steer_undrained", "task.user_followup_undrained", "steering.parked_input_blocked", "task.turn_interrupted", "task.halt_unconsumed", "task.late_approval", "task.interrupt_unconsumed", "task.tool_turn_incomplete", "approval.read_root_granted", "approval.read_root_grant_rejected", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "skills.listing_truncated", "agents.listing_truncated", "tool_result.offload_put_failed", "tool_result.media_refused", "instructions.source_changed", "session.records_skipped", "memory.layer_locked_legacy", "server.model_unreachable", "permission.entry_mode_clamped"];
|
|
148
|
+
export declare const ENGINE_NOTICE_CODES: readonly ["config.autocompact_window_clamped", "config.env_timeout_discarded", "config.materialize_env_discarded", "config.models_swapped", "config.context_settings_swapped", "config.read_face_swapped", "config.read_face_deployment_clamped", "config.write_face_swapped", "config.write_face_deployment_clamped", "config.read_deny_swapped", "config.tool_model_gate_removed", "config.tool_model_gate_unknown_class", "config.tool_model_gate_env_invalid", "config.artifact_host_invalid", "config.task_root_not_canonical", "config.write_protection_target_view_absent", "config.path_view_unresolved", "config.execution_env_capability_invalid", "config.tool_card_undeclared", "config.tool_face_undeclared", "config.tool_face_invalid", "config.forward_sink_failed", "config.durable_gate_unavailable", "config.peer_admission_out_of_range", "config.peer_lane_unmounted", "config.secret_env_scrubbed", "inherit_env.names_withheld", "config.credential_not_withheld", "config.cross_boundary_posture_undeclared", "config.cross_boundary_record_unwritten", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "config.session_rules_earlier_grammar", "permission.allowed_tool_not_granted", "mods.registration_refused", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "classifier.fallback", "classifier.role_defaulted", "classifier.contract_broken", "classifier.unavailable", "checkpoint.execution_outcome_unrecorded", "delegation.transcript_integrity", "delegation.ask_unresolvable", "mcp.injection_dropped", "mcp.revocation_probe_failed", "mcp.server_redialed", "workflow.governance_key_stripped", "workflow.agent_option_ignored", "memory.session_polluted", "memory.harvest_quarantined", "memory.delegation_static_mark_waived", "memory.content_class_declared", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "memory.consolidation_recommended", "memory.consolidation_committed", "memory.consolidation_conflict", "memory.consolidation_incomplete", "memory.consolidation_refused", "memory.consolidation_withheld", "memory.restore_withheld", "memory.project_scope_absent", "route.fallback_to_primary", "route.classifier_unroutable", "route.seat_detached", "advisor.not_attached", "route.credential_origin_mismatch", "route.response_model_mismatch", "route.tool_call_id_folded", "route.finish_reason_unknown", "route.stream_end_ignored", "route.extra_body_reserved_dropped", "model.capability_downgraded", "context.tool_turn_repaired", "task.user_steer_undrained", "task.user_followup_undrained", "steering.parked_input_blocked", "task.turn_interrupted", "task.halt_unconsumed", "task.late_approval", "task.interrupt_unconsumed", "task.tool_turn_incomplete", "approval.read_root_granted", "approval.read_root_grant_rejected", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "skills.listing_truncated", "agents.listing_truncated", "tool_result.offload_put_failed", "tool_result.media_refused", "instructions.source_changed", "session.records_skipped", "memory.layer_locked_legacy", "server.model_unreachable", "permission.entry_mode_clamped"];
|
|
149
149
|
/** A catalogued code (see {@link ENGINE_NOTICE_CODES}); {@link NOTICE_MINTER} says who mints it. NOT the type of
|
|
150
150
|
* `EngineNotice.code`, which stays `string` — a host forwarding its own notices through the same
|
|
151
151
|
* sink is a supported shape, and narrowing that field would break it. */
|
|
@@ -201,6 +201,7 @@ declare const NOTICE_AUDIENCE_TABLE: {
|
|
|
201
201
|
readonly "memory.capture_optout_unpersisted": "user";
|
|
202
202
|
readonly "memory.consolidation_withheld": "operator";
|
|
203
203
|
readonly "delegation.ask_unresolvable": "user";
|
|
204
|
+
readonly "inherit_env.names_withheld": "user";
|
|
204
205
|
readonly "config.autocompact_window_clamped": "operator";
|
|
205
206
|
readonly "config.env_timeout_discarded": "operator";
|
|
206
207
|
readonly "config.materialize_env_discarded": "operator";
|
|
@@ -253,6 +254,7 @@ declare const NOTICE_AUDIENCE_TABLE: {
|
|
|
253
254
|
readonly "route.response_model_mismatch": "operator";
|
|
254
255
|
readonly "route.tool_call_id_folded": "operator";
|
|
255
256
|
readonly "route.extra_body_reserved_dropped": "operator";
|
|
257
|
+
readonly "model.capability_downgraded": "user";
|
|
256
258
|
readonly "context.tool_turn_repaired": "operator";
|
|
257
259
|
readonly "skills.listing_truncated": "operator";
|
|
258
260
|
readonly "agents.listing_truncated": "operator";
|
|
@@ -315,6 +317,7 @@ declare const NOTICE_MINTER_TABLE: {
|
|
|
315
317
|
readonly "config.peer_admission_out_of_range": "engine";
|
|
316
318
|
readonly "config.peer_lane_unmounted": "engine";
|
|
317
319
|
readonly "config.secret_env_scrubbed": "engine";
|
|
320
|
+
readonly "inherit_env.names_withheld": "engine";
|
|
318
321
|
readonly "config.credential_not_withheld": "engine";
|
|
319
322
|
readonly "config.cross_boundary_posture_undeclared": "engine";
|
|
320
323
|
readonly "config.cross_boundary_record_unwritten": "engine";
|
|
@@ -367,6 +370,7 @@ declare const NOTICE_MINTER_TABLE: {
|
|
|
367
370
|
readonly "route.finish_reason_unknown": "engine";
|
|
368
371
|
readonly "route.stream_end_ignored": "engine";
|
|
369
372
|
readonly "route.extra_body_reserved_dropped": "engine";
|
|
373
|
+
readonly "model.capability_downgraded": "engine";
|
|
370
374
|
readonly "context.tool_turn_repaired": "engine";
|
|
371
375
|
readonly "task.user_steer_undrained": "engine";
|
|
372
376
|
readonly "task.user_followup_undrained": "engine";
|
|
@@ -149,6 +149,7 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
149
149
|
"config.peer_admission_out_of_range",
|
|
150
150
|
"config.peer_lane_unmounted",
|
|
151
151
|
"config.secret_env_scrubbed",
|
|
152
|
+
"inherit_env.names_withheld",
|
|
152
153
|
"config.credential_not_withheld",
|
|
153
154
|
"config.cross_boundary_posture_undeclared",
|
|
154
155
|
"config.cross_boundary_record_unwritten",
|
|
@@ -201,6 +202,7 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
201
202
|
"route.finish_reason_unknown",
|
|
202
203
|
"route.stream_end_ignored",
|
|
203
204
|
"route.extra_body_reserved_dropped",
|
|
205
|
+
"model.capability_downgraded",
|
|
204
206
|
"context.tool_turn_repaired",
|
|
205
207
|
"task.user_steer_undrained",
|
|
206
208
|
"task.user_followup_undrained",
|
|
@@ -262,6 +264,7 @@ const NOTICE_AUDIENCE_TABLE = {
|
|
|
262
264
|
"memory.capture_optout_unpersisted": "user",
|
|
263
265
|
"memory.consolidation_withheld": "operator",
|
|
264
266
|
"delegation.ask_unresolvable": "user",
|
|
267
|
+
"inherit_env.names_withheld": "user",
|
|
265
268
|
"config.autocompact_window_clamped": "operator",
|
|
266
269
|
"config.env_timeout_discarded": "operator",
|
|
267
270
|
"config.materialize_env_discarded": "operator",
|
|
@@ -314,6 +317,7 @@ const NOTICE_AUDIENCE_TABLE = {
|
|
|
314
317
|
"route.response_model_mismatch": "operator",
|
|
315
318
|
"route.tool_call_id_folded": "operator",
|
|
316
319
|
"route.extra_body_reserved_dropped": "operator",
|
|
320
|
+
"model.capability_downgraded": "user",
|
|
317
321
|
"context.tool_turn_repaired": "operator",
|
|
318
322
|
"skills.listing_truncated": "operator",
|
|
319
323
|
"agents.listing_truncated": "operator",
|
|
@@ -357,6 +361,7 @@ const NOTICE_MINTER_TABLE = {
|
|
|
357
361
|
"config.peer_admission_out_of_range": "engine",
|
|
358
362
|
"config.peer_lane_unmounted": "engine",
|
|
359
363
|
"config.secret_env_scrubbed": "engine",
|
|
364
|
+
"inherit_env.names_withheld": "engine",
|
|
360
365
|
"config.credential_not_withheld": "engine",
|
|
361
366
|
"config.cross_boundary_posture_undeclared": "engine",
|
|
362
367
|
"config.cross_boundary_record_unwritten": "engine",
|
|
@@ -409,6 +414,7 @@ const NOTICE_MINTER_TABLE = {
|
|
|
409
414
|
"route.finish_reason_unknown": "engine",
|
|
410
415
|
"route.stream_end_ignored": "engine",
|
|
411
416
|
"route.extra_body_reserved_dropped": "engine",
|
|
417
|
+
"model.capability_downgraded": "engine",
|
|
412
418
|
"context.tool_turn_repaired": "engine",
|
|
413
419
|
"task.user_steer_undrained": "engine",
|
|
414
420
|
"task.user_followup_undrained": "engine",
|