@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AskOrigin, type AssertAllKeysHandled } from "./ask-origin.js";
|
|
2
|
+
import { type EngineAttestation } from "./engine-attestation.js";
|
|
2
3
|
import { type ReadRootGrantScreen } from "./read-root-grant-screen.js";
|
|
3
4
|
import { type Settlement } from "./gate-outcome.js";
|
|
4
5
|
export { policyCannotAnswer, rowDemandsAPerson } from "./real-approval.js";
|
|
@@ -36,7 +37,8 @@ export interface ToolCallFace {
|
|
|
36
37
|
approvalCard?: import("./tool-face.js").ToolApprovalCard;
|
|
37
38
|
/** Present (`true`) iff one of the ENGINE's own mount sites mounted the tool the call dispatches to — a built-in or synthetic tool
|
|
38
39
|
* the engine minted for the leg, never a caller's `TaskSpec.tools` entry or a protocol peer's tool (`engineMountedRow`). The one
|
|
39
|
-
* identity a caller cannot wear: a name and a contract id can be declared.
|
|
40
|
+
* identity a caller cannot wear: a name and a contract id can be declared. A face rebuilt from a park row carries it when the row does
|
|
41
|
+
* (the member the park wrote off the roster entry); absent on a row minted before the member. */
|
|
40
42
|
engineMounted?: true;
|
|
41
43
|
}
|
|
42
44
|
export interface ToolCallRequest {
|
|
@@ -227,81 +229,7 @@ export declare function exemptRootsSeat(exemptRoots: readonly string[]): {
|
|
|
227
229
|
/** Declared beside the receipt's list (decision-receipt.ts) — a new member added to either side is a compile error rather
|
|
228
230
|
* than a silent drift between the type and the screen; re-exported here, the module every consumer of the decision reads. */
|
|
229
231
|
export type { DecisionReason };
|
|
230
|
-
|
|
231
|
-
* The engine's ATTESTATION record — the one carrier of what an engine station knows about a decision and a policy cannot
|
|
232
|
-
* state: WHO settled the call's wait and WHICH question that answered (the settlement, the ask's origin word and class set,
|
|
233
|
-
* the digest of the arguments the answer licenses), and the facts the classifier stations, the in-fold unresolvable arms
|
|
234
|
-
* and the policy fold record. It rides the decision as its `attestation` member and is read through {@link attestationOf}
|
|
235
|
-
* alone; the decision object's identity carries nothing.
|
|
236
|
-
*
|
|
237
|
-
* Minted only by {@link mintAttestation} and combined only by {@link mergeAttestation}: both freeze the record and enter it
|
|
238
|
-
* in a module-private brand set, so a value a caller composed — a literal, a copy, a structured clone — is not a record, and
|
|
239
|
-
* the receipt refuses a decision carrying one. A record is bound to the call it was minted for (`toolCallId` + `toolName`):
|
|
240
|
-
* handed back for another call it reads as absent. A spread of a decision keeps its record, and the record still says only
|
|
241
|
-
* what the engine minted — a refusal record on an allow is a contradiction the gate's exit refuses, and a resolution's
|
|
242
|
-
* answer binds the arguments it licensed (`inputDigest`).
|
|
243
|
-
*/
|
|
244
|
-
export interface EngineAttestation {
|
|
245
|
-
readonly toolCallId: string;
|
|
246
|
-
readonly toolName: string;
|
|
247
|
-
/** What ended the call's wait. The answer group — `settlement`, `origin`, `classes`, `inputDigest` — travels as one. */
|
|
248
|
-
readonly settlement?: Settlement;
|
|
249
|
-
/** The settled ask's origin word. */
|
|
250
|
-
readonly origin?: AskOrigin;
|
|
251
|
-
/** The settled ask's class set (`ASK_CLASSES` order), when the minting station held one. */
|
|
252
|
-
readonly classes?: readonly import("./ask-origin.js").AskClass[];
|
|
253
|
-
/** `exactBoundInputHashOf` of the arguments the settlement licenses (an approver's edit, the snapshot shown, or the asked
|
|
254
|
-
* args); absent when they have none (outside the bindable domain) — such a record licenses no bytes. */
|
|
255
|
-
readonly inputDigest?: string;
|
|
256
|
-
/** The FORM of a classifier round that did not rule (a classifier deny's cause). */
|
|
257
|
-
readonly classifierCause?: import("./gate-outcome.js").ClassifierDenyCause;
|
|
258
|
-
/** WHICH model answered a classification, on either arm. */
|
|
259
|
-
readonly classifierRound?: import("./auto-mode.js").AutoModeClassifierRound;
|
|
260
|
-
/** Why an in-fold deny refused an ask nobody could resolve. */
|
|
261
|
-
readonly unresolvableCause?: import("./ask-unresolvable-notice.js").AskUnresolvableCause;
|
|
262
|
-
/** The classes of the asks a policy fold collapsed — the proof behind a decision's `foldedAskClasses`. */
|
|
263
|
-
readonly foldedClasses?: readonly import("./ask-origin.js").AskClass[];
|
|
264
|
-
/** Where a path deny row refused the call — the row, the view of the target it met, the face the call is on. The gate's
|
|
265
|
-
* exit mints the refusal's card from it; the judge that found the row is its only writer. */
|
|
266
|
-
readonly pathDenial?: import("../tools/fs/safety.js").PathDenialEvidence;
|
|
267
|
-
/** A seat refused the call's arguments because no approval can be bound to them ({@link bindableArgsOf}): the refusal's
|
|
268
|
-
* sentence, carried by the refusal itself — the gate's deny exit reads it (the remedy it gives) instead of judging again. */
|
|
269
|
-
readonly bindingRefusal?: string;
|
|
270
|
-
}
|
|
271
|
-
/** The members a station attests — everything but the call binding. */
|
|
272
|
-
export type AttestationMembers = Omit<EngineAttestation, "toolCallId" | "toolName">;
|
|
273
|
-
/** Mint a record for `call`. Engine stations only: not re-exported from `src/index.ts`. The values are DETACHED snapshots, so a
|
|
274
|
-
* caller that later mutates the settlement object it was handed cannot rewrite what the engine attests. */
|
|
275
|
-
export declare function mintAttestation(call: {
|
|
276
|
-
toolCallId: string;
|
|
277
|
-
toolName: string;
|
|
278
|
-
}, members: AttestationMembers): EngineAttestation;
|
|
279
|
-
/** Is `v` a record the engine minted (the brand alone — no binding)? The receipt's test. */
|
|
280
|
-
export declare function isEngineAttestation(v: unknown): v is EngineAttestation;
|
|
281
|
-
/** THE read: the record `d` carries FOR `call` — a branded record bound to that call, else `undefined` (a record bound to
|
|
282
|
-
* another call is a replayed one and reads as absent). Read off the own data member, never through an accessor. */
|
|
283
|
-
export declare function attestationOf(d: unknown, call: {
|
|
284
|
-
toolCallId: string;
|
|
285
|
-
toolName: string;
|
|
286
|
-
}): EngineAttestation | undefined;
|
|
287
|
-
/**
|
|
288
|
-
* Combine two records for `call`, member GROUP by group: the later record's group stands where it has one, the earlier's
|
|
289
|
-
* fills a group the later lacks. A record not bound to `call` contributes nothing. `answer` scope is the veto's merge: the
|
|
290
|
-
* earlier record contributes ONLY its answer, and only when the later carries none — a person's yes rides a later layer's
|
|
291
|
-
* deny (invariant I3) while the refusing station's own facts stay its own.
|
|
292
|
-
*/
|
|
293
|
-
export declare function mergeAttestation(call: {
|
|
294
|
-
toolCallId: string;
|
|
295
|
-
toolName: string;
|
|
296
|
-
}, earlier: EngineAttestation | undefined, later: EngineAttestation | undefined, scope?: "all" | "answer"): EngineAttestation | undefined;
|
|
297
|
-
/** `d` with `members` attested for `call`, merged over the record it already carries for that call (the new members' groups
|
|
298
|
-
* win). Always a fresh object — the receipt hands out frozen ones. */
|
|
299
|
-
export declare function attest<T extends object>(d: T, call: {
|
|
300
|
-
toolCallId: string;
|
|
301
|
-
toolName: string;
|
|
302
|
-
}, members: AttestationMembers): T;
|
|
303
|
-
/** `d` carrying `record` (a fresh object), or `d` itself when there is no record to put on it. */
|
|
304
|
-
export declare function withAttestation<T extends object>(d: T, record: EngineAttestation | undefined): T;
|
|
232
|
+
export { attest, attestationOf, isEngineAttestation, mergeAttestation, mintAttestation, withAttestation, type AttestationMembers, type EngineAttestation } from "./engine-attestation.js";
|
|
305
233
|
/** The `no_approver`-attested deny an engine policy answers on a request that states nobody can be asked about it
|
|
306
234
|
* ({@link ToolCallRequest.approvalReach}) instead of reaching a seat — read by a probe as "would ask an approver". */
|
|
307
235
|
export declare function noApproverSeatDeny(req: {
|
|
@@ -349,7 +277,7 @@ export declare function screenApproverAttribution(v: unknown): {
|
|
|
349
277
|
approver?: string;
|
|
350
278
|
defect?: string;
|
|
351
279
|
};
|
|
352
|
-
/** An integrity guard an ask stands on ({@link
|
|
280
|
+
/** An integrity guard an ask stands on — an engine finding, carried on the ask's record ({@link EngineAttestation.guards}). */
|
|
353
281
|
export type AskGuard = "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "artifact_shared_read";
|
|
354
282
|
/**
|
|
355
283
|
* A three-state permission decision for a tool call (design/37). Upgrades the old two-state
|
|
@@ -416,9 +344,9 @@ export type PermissionResult = {
|
|
|
416
344
|
classifierNoRuling?: import("./auto-mode.js").AutoModeFallbackCause;
|
|
417
345
|
/** The allow layer's DISCLOSURE: the members that MATCHED this call and could not clear the ask (it is a class
|
|
418
346
|
* no allow rule clears — a mandated, governance, hook, ask-rule or mode question — or the call reached the layer
|
|
419
|
-
* marked), one record per member ({@link AllowRuleShadow}).
|
|
420
|
-
*
|
|
421
|
-
* decide, and the classifier never sees it (it is not part of `message`). Absent ⇒ no member matched. */
|
|
347
|
+
* marked), one record per member ({@link AllowRuleShadow}). Written by the allow layer alone (a STAMP member: a
|
|
348
|
+
* decision that states it is refused at the receipt); a DISPLAY member: the approval card and the park row render it,
|
|
349
|
+
* nothing reads it to decide, and the classifier never sees it (it is not part of `message`). Absent ⇒ no member matched. */
|
|
422
350
|
allowRuleShadowed?: readonly import("./allow-rule-shadow.js").AllowRuleShadow[];
|
|
423
351
|
/** backlog #239 disclosure (additive): WHY the reversibility probe did not clear this call, in the
|
|
424
352
|
* probe's own words. ENGINE-STAMPED at the irreversibility tighten (which constructs this decision
|
|
@@ -429,6 +357,11 @@ export type PermissionResult = {
|
|
|
429
357
|
* {@link allowRuleShadowed}: a policy that self-declares it can only put its own prose on its
|
|
430
358
|
* own card — nothing reads this member to decide anything, so it is not an authority channel. */
|
|
431
359
|
probeReason?: string;
|
|
360
|
+
/** This ask puts a person's edit back to the person: the restriction chain would not run it as written and accepts it
|
|
361
|
+
* only as {@link import("./rewrite-rejudge.js").EditRewritten.acceptableForm}, the bytes this ask presents. ENGINE-MINTED by
|
|
362
|
+
* the approved-edit pass (a policy's self-declared value is a display claim about its own card); carried onto the
|
|
363
|
+
* approval request as {@link AskRequest.editRewritten}. */
|
|
364
|
+
editRewritten?: import("./rewrite-rejudge.js").EditRewritten;
|
|
432
365
|
/** backlog #239 disclosure (additive): the STRUCTURED cause, for a probe whose verdict this engine
|
|
433
366
|
* understands (see {@link import("./checkpoint-store.js").ProbeCause}). Engine-stamped and
|
|
434
367
|
* validated at the irreversibility tighten; same display-only posture as the prose sibling. */
|
|
@@ -457,8 +390,8 @@ export type PermissionResult = {
|
|
|
457
390
|
* set, and a policy self-declaring it only opts its own ask OUT of automatic answering. Carried
|
|
458
391
|
* onto the approval request as {@link AskRequest.mandated}. */
|
|
459
392
|
mandated?: true;
|
|
460
|
-
/** The TABLE WORD the {@link mandated} bit stands on — see {@link AskRequest.mandate}.
|
|
461
|
-
*
|
|
393
|
+
/** The TABLE WORD the {@link mandated} bit stands on — see {@link AskRequest.mandate}. A STAMP member, written at the
|
|
394
|
+
* same origin stamp as the bit. */
|
|
462
395
|
mandate?: import("./ask-origin.js").PersistedRuleMandate;
|
|
463
396
|
/** The probe named a directory that would clear this ask
|
|
464
397
|
* ({@link import("./types.js").ReversibilityVerdict.readRootCandidate}). Display metadata like the two
|
|
@@ -479,47 +412,33 @@ export type PermissionResult = {
|
|
|
479
412
|
* list) that leaves it unset gets `policy` there, indistinguishable from hesitation. */
|
|
480
413
|
matchedAskRule?: string;
|
|
481
414
|
/** design/252 G-2 (additive): the RULE-PROVENANCE evidence behind this ask — see
|
|
482
|
-
* {@link AskRuleEvidence}.
|
|
483
|
-
* persisted-rule lane have both spoken
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
* site. Display/reconciliation metadata, never adjudication input. */
|
|
415
|
+
* {@link AskRuleEvidence}. A STAMP member, written inside the gate once, after the org layer and the
|
|
416
|
+
* persisted-rule lane have both spoken (the member is a record of what the ENGINE's own governance layers
|
|
417
|
+
* did, so a layer's claim about itself is not evidence). Carried onto the approval request by the gate's own
|
|
418
|
+
* ask mint site. Display/reconciliation metadata, never adjudication input. */
|
|
487
419
|
ruleEvidence?: AskRuleEvidence;
|
|
488
420
|
/** design/375 §5.2②: the per-segment coverage table behind this surviving ask — which segments
|
|
489
421
|
* of a compound an eligible persisted rule already admits, read off the SAME store read that
|
|
490
|
-
* adjudicated the call (snapshot = adjudication snapshot).
|
|
491
|
-
* stamp point
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
* Same display-only posture as {@link allowRuleShadowed}: never adjudication input, and a
|
|
495
|
-
* value nobody stamps over can only shrink or annotate the card's ADVISORY offers — every
|
|
496
|
-
* offered rule still passes the validator at redemption. */
|
|
422
|
+
* adjudicated the call (snapshot = adjudication snapshot). A STAMP member, written at the gate's one
|
|
423
|
+
* stamp point when the persisted-rule lane reported one; consumed only by the offer factory, which puts on
|
|
424
|
+
* the batch offer exactly the segments this table calls uncovered. Absent ⇒ all segments read as uncovered
|
|
425
|
+
* (over-offer, the safe way). */
|
|
497
426
|
segmentCoverage?: readonly import("./permission-rule-model.js").SegmentCoverage[];
|
|
498
427
|
/** WHICH AUTHORITY raised this ask — one word from the closed {@link import("./ask-origin.js").AskOrigin}
|
|
499
428
|
* set (org rule / org unavailable / hook / explicit ask rule / the classifier's denial-limit
|
|
500
|
-
* fallback / the reserved question tool / a marked call / plain policy).
|
|
429
|
+
* fallback / the reserved question tool / a marked call / plain policy). A STAMP member, written inside the
|
|
501
430
|
* gate at the same single stamp point as `ruleEvidence`, derived from what the gate's own layers
|
|
502
|
-
* did ({@link import("./ask-origin.js").askOriginOf})
|
|
503
|
-
*
|
|
504
|
-
*
|
|
505
|
-
* render the card by it. Optional on the TYPE only because a decision is caller-composable; every ask
|
|
506
|
-
* the gate hands to its resolver carries it. */
|
|
431
|
+
* did ({@link import("./ask-origin.js").askOriginOf}). A DISCLOSURE word: the lanes read the ask's class set
|
|
432
|
+
* ({@link import("./ask-origin.js").classifyAsk}), an approval surface may render the card by it. Optional on the
|
|
433
|
+
* TYPE only because the gate writes it after a policy answers; every ask the gate hands to its resolver carries it. */
|
|
507
434
|
origin?: import("./ask-origin.js").AskOrigin;
|
|
508
|
-
/** The ask's CLASS — the first member of {@link classes} (see {@link AskRequest.askClass}).
|
|
509
|
-
* same single stamp as {@link origin}, from the class set the gate's lanes read;
|
|
510
|
-
*
|
|
435
|
+
/** The ask's CLASS — the first member of {@link classes} (see {@link AskRequest.askClass}). A STAMP member, written at
|
|
436
|
+
* the same single stamp as {@link origin}, from the class set the gate's lanes read; no lane reads it back (they read
|
|
437
|
+
* the classification itself). */
|
|
511
438
|
askClass?: import("./ask-origin.js").AskClass;
|
|
512
439
|
/** The ask's whole class set, in {@link import("./ask-origin.js").ASK_CLASSES} order (see
|
|
513
440
|
* {@link AskRequest.classes}). Stamped beside {@link askClass}, under the same rule. */
|
|
514
441
|
classes?: readonly import("./ask-origin.js").AskClass[];
|
|
515
|
-
/** WHICH integrity guards stand behind this ask — a removal of a protected location, an unverifiable recursive delete,
|
|
516
|
-
* shell text the engine cannot read (or an environment that did not answer the read station), the session-transcript
|
|
517
|
-
* write. A set: one ask may stand on several, and each keeps its class. ENGINE-STAMPED by the guard policies and the
|
|
518
|
-
* gate fold; a fold-internal fact the class derivation reads ({@link import("./ask-origin.js").classifyAsk}) so the
|
|
519
|
-
* guards, which mint the same `requiresRealApproval` ask, are told apart by a fact and not by their prose. Never
|
|
520
|
-
* copied onto the approval request or the park row. Replaces the one-word `guard`, which a decision no longer carries:
|
|
521
|
-
* a decision that still does is refused by name ({@link RETIRED_DECISION_MEMBERS}). */
|
|
522
|
-
guards?: readonly AskGuard[];
|
|
523
442
|
/** The call could not be READ against a rule that may reach it — a content-form deny row, a content-form
|
|
524
443
|
* ask row, a persisted-rule row (the lexer's word), or rows the shell read station's boundary stands on that
|
|
525
444
|
* could not be read (`persisted_rows`). ENGINE-STAMPED at the four unreadable mint sites;
|
|
@@ -533,13 +452,6 @@ export type PermissionResult = {
|
|
|
533
452
|
* every ask). Public: a host composing such a policy sets it; {@link combinePolicies} carries it onto the
|
|
534
453
|
* surviving ask (tighten-only). Not on the approval request — the card shows `origin` / `mandate`. */
|
|
535
454
|
authoredBy?: "deployment";
|
|
536
|
-
/** The classes of the OTHER asks a policy fold collapsed into this one
|
|
537
|
-
* ({@link import("./ask-origin.js").decisionAskClassesOf} per contributing ask, unioned), so a member the
|
|
538
|
-
* fold does not copy — a guard mark, an unreadable-rule fact, a bare real-approval bit — is not lost behind
|
|
539
|
-
* the ask that won the slot. ENGINE-WRITTEN by {@link combinePolicies}, which attests the list it wrote
|
|
540
|
-
* ({@link EngineAttestation.foldedClasses}); the receipt refuses the member unless the decision's record carries that very
|
|
541
|
-
* list (a policy's own, an edited list are refused). Fold-internal, never on the request. */
|
|
542
|
-
foldedAskClasses?: readonly import("./ask-origin.js").AskClass[];
|
|
543
455
|
attestation?: EngineAttestation;
|
|
544
456
|
} | {
|
|
545
457
|
action: "deny";
|
|
@@ -781,40 +693,24 @@ export interface ToolPolicyProjection {
|
|
|
781
693
|
readonly requiresLiveRemainder: boolean;
|
|
782
694
|
}
|
|
783
695
|
/**
|
|
784
|
-
* The entries of a tool-NAME list whose reach is a set of names rather than one name — the covering
|
|
785
|
-
*
|
|
786
|
-
*
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
* exact set too costs nothing and keeps the projection/audit faces reporting
|
|
790
|
-
*
|
|
791
|
-
*
|
|
792
|
-
*
|
|
793
|
-
*
|
|
794
|
-
*
|
|
795
|
-
*
|
|
796
|
-
* The list is usually empty, which is why every call site tests it before scanning.
|
|
797
|
-
*
|
|
798
|
-
* `behavior` = what the list does with a call it reaches: `deny` / `ask` (restricting) lists also read the whole-protocol
|
|
799
|
-
* spelling (`mcp__*`, `mcp__*__*`) as a covering entry — every tool of the namespace — and an `allow` list does not (the
|
|
800
|
-
* spelling names no peer there; the constructors and the prepare-time audit refuse it, and a stored allowlist reads it as nothing).
|
|
801
|
-
*
|
|
802
|
-
* Exported for the OTHER name-keyed lane in this engine — the persisted session/ancestor rules in
|
|
803
|
-
* `session-rule-policy.ts`. Not part of the public API (`src/index.ts` re-exports by name and does not
|
|
804
|
-
* list these two): every publisher of {@link ToolPolicyNameSets} must resolve a covering entry the same
|
|
805
|
-
* way, because the prepare-time audit's exemption for these spellings speaks for ALL published name sets
|
|
806
|
-
* at once — the four in-engine lanes do so by sharing this module's matcher. That premise is NOT
|
|
807
|
-
* structural for an OUT-OF-ENGINE publisher (a host compiling its own settings into an exact-match ask
|
|
808
|
-
* closure is fail-open on these spellings while the audit stays silent) — which is why the underlying
|
|
809
|
-
* judgment predicates (`isNamespacedCoveringRuleName` / `namespacedRuleNameCovers`) ARE exported from
|
|
810
|
-
* the package index: an external lane either compiles through `createPermissionRulePolicy` or
|
|
811
|
-
* self-checks with those.
|
|
696
|
+
* The entries of a tool-NAME list whose reach is a set of names rather than one name — the covering spellings
|
|
697
|
+
* ({@link isCoveringRuleName}): a `*` anywhere in the name on a list that restricts (`Re*d`, `mcp__*`, the lone `*` — every tool),
|
|
698
|
+
* only in the tool segment after a literal `<ns>__<peer>__` on one that grants, and a protocol peer (`<ns>__<peer>`) on either —
|
|
699
|
+
* which CC's rule matcher resolves and an exact-membership test silently cannot. Every name-keyed lane in this file consults these
|
|
700
|
+
* ALONGSIDE its exact set: a covering spelling can never equal a mounted tool name (no mounted name holds a `*`, and a minted name
|
|
701
|
+
* always carries a tool segment), so leaving it in the exact set too costs nothing and keeps the projection/audit faces reporting
|
|
702
|
+
* the operator's own spelling. The list is usually empty, which is why every call site tests it before scanning.
|
|
703
|
+
*
|
|
704
|
+
* `behavior` = what the list does with a call it reaches. Exported for the in-engine name-keyed lanes; an OUT-OF-ENGINE publisher
|
|
705
|
+
* of {@link ToolPolicyNameSets} compiles through `createPermissionRulePolicy` or self-checks with the root-exported predicates
|
|
706
|
+
* (`isCoveringRuleName` / `ruleNameCovers`) — the prepare-time audit's exemption for these spellings speaks for every published
|
|
707
|
+
* name set at once, so a lane keying them exactly is fail-open in the "tool runs unasked" direction while the audit stays silent.
|
|
812
708
|
*/
|
|
813
|
-
export declare function
|
|
709
|
+
export declare function coveringRuleEntries(entries: readonly string[] | undefined, behavior: RuleBehavior): readonly string[];
|
|
814
710
|
/** Does any covering entry reach the call — under ANY name it answers to, the same reading the exact lists take through
|
|
815
711
|
* `nameListHolds` (a covering entry and an exact entry in one list are one rule: it reaches the call iff its name is on the
|
|
816
|
-
* list)? See {@link
|
|
817
|
-
export declare function
|
|
712
|
+
* list)? See {@link coveringRuleEntries}. */
|
|
713
|
+
export declare function coveringRuleHit(covering: readonly string[], call: Pick<ToolCallRequest, "toolName" | "face">): boolean;
|
|
818
714
|
/**
|
|
819
715
|
* The tool names a projection component is keyed on, and the member that holds them: a `tool_deny` / `tool_allowlist`'s
|
|
820
716
|
* `names`, a `shell_command`'s `tools` (its `deny` / `allow` are command names, not tool names). A frozen chain holds them only
|
|
@@ -944,53 +840,12 @@ export declare function constraintChainDigest(chain: readonly ConstraintChainEnt
|
|
|
944
840
|
* present one must sit on an arm its row holds. Not re-exported from `src/index.ts`. */
|
|
945
841
|
export type DecisionMember = PermissionResult extends infer U ? (U extends unknown ? keyof U : never) : never;
|
|
946
842
|
export declare const DECISION_MEMBERS: readonly DecisionMember[];
|
|
947
|
-
/**
|
|
948
|
-
* The RECEIPT of a permission decision — the one point at which the engine takes a decision in from whoever composed it,
|
|
949
|
-
* on every lane: each layer of {@link combinePolicies}' fold, the gate's adjudication entry and its approved-edit re-check,
|
|
950
|
-
* the inherited lane's receipts of an ancestor policy's decision, the final-form re-check, the direct `check()` rechecks
|
|
951
|
-
* (the resume edit, the park re-projection, the changed-files probe), and the PreToolUse hook's result seam (its own
|
|
952
|
-
* reach, below). NOT re-exported from `src/index.ts`: an internal screen on inputs the engine receives.
|
|
953
|
-
*
|
|
954
|
-
* WHAT COMES BACK is the engine's own frozen copy, never the caller's object. A decision is caller-supplied data: a
|
|
955
|
-
* stateful accessor, a Proxy, or a policy that keeps and mutates an object it returned could otherwise answer two
|
|
956
|
-
* consumers with two values, and which consumer read which value would decide the call. So the caller's object is read
|
|
957
|
-
* ONCE, here, and every station after the receipt (the fold's ranking, the origin stamp, the classifier's eligibility, the
|
|
958
|
-
* mode arbitration, the approval request, the rewrite that executes) reads the copy; a copy handed to the screen again
|
|
959
|
-
* comes back as it is, unread (so does the engine's own refusal, {@link isEngineRefusal}). In order: (1) the CARRIER's type — a decision that is not an object (a string, a function
|
|
960
|
-
* holding the members) has no `action`; (2) the ONE READ — ONE function ({@link receiveContract}) for the decision and for the
|
|
961
|
-
* records it nests (`receiveNestedRecords`, decision-receipt.ts), on an ORDINARY object (a Proxy, as the carrier or anywhere on its prototype
|
|
962
|
-
* chain, is refused before a trap of its could run): each contract member absent or an own enumerable DATA property, its value
|
|
963
|
-
* taken off the carrier's own descriptor (a member outside the contract is neither read nor carried — a policy's self-declared
|
|
964
|
-
* record on another name finds no reader); any other spelling refused by name — an accessor (never invoked), a member the
|
|
965
|
-
* prototype or a non-enumerable property supplies unless that descriptor spells absence (an `undefined` data value) — judged by
|
|
966
|
-
* descriptor, never read; (3) a retired member ({@link RETIRED_DECISION_MEMBERS}: `reason`, `guard`) carried by the same presence law as a contract
|
|
967
|
-
* member — own, held by an accessor, or supplied by the prototype — judged without a read (ignoring it silently dropped the policy's text or the ask's guard); (4) the VALUES, off the engine's
|
|
968
|
-
* one-read record, never a second read of the caller's object — the retired window absent, `action` in
|
|
969
|
-
* its closed set (`screenContractValues`, decision-receipt.ts — every closed-set member is held to its set there; a consumer ranks a decision by testing two of its words, so any other value used to rank as an
|
|
970
|
-
* allow; a `canUseTool` result outside its set is a failure in CC) and `decisionReason` in {@link DECISION_REASONS} when
|
|
971
|
-
* present (absence stays legal); (5) the DETACH —
|
|
972
|
-
* the contract members' values structured-cloned ({@link tryCloneArgs}; one that cannot be, a function inside a rewrite,
|
|
973
|
-
* is refused), the engine's `attestation` record re-attached by reference after its brand check, the copy frozen and
|
|
974
|
-
* marked as this module's. A refusal is a deny in the screen's words, one code for every arm (`decisionReason: "rule"`),
|
|
975
|
-
* carrying no `updatedInput` from the refused object (a rewrite from an EARLIER, contract-shaped layer still rides out of
|
|
976
|
-
* {@link combinePolicies}' deny path). `null` / `undefined` carry nothing and take the carrier's refusal (the caller's own
|
|
977
|
-
* read of `.action` would throw instead, and that throw was being reported as an aborted check).
|
|
978
|
-
*
|
|
979
|
-
* SCOPE: the receipt runs NONE of the carrier's code — a Proxy (its traps are the caller's code) is refused unread, and on an
|
|
980
|
-
* ordinary object descriptor looks and `Object.getPrototypeOf` invoke nothing. What the receipt does not reach: code inside a
|
|
981
|
-
* member's VALUE, run by the detach itself (an accessor inside a rewrite is invoked by the structured clone, and what it answers
|
|
982
|
-
* there is what is cloned and what runs — one read, consistent) and by a refusal's rendering of a foreign word (`String(v)` on an
|
|
983
|
-
* out-of-set `action`, after the deny is decided). Same-process JavaScript has no trust boundary a function can enforce.
|
|
984
|
-
*
|
|
985
|
-
* `reasonIsNonInput` (the HOOK seam): the same receipt, with the two differences the seam's consumers imply — a hook's
|
|
986
|
-
* `decisionReason` is DISCARDED there (every mint point downstream re-stamps `"hook"`) and so is not held to its set, and a
|
|
987
|
-
* hook result may leave `action` out (no opinion; the policy still adjudicates). `undefined`, `null` and `false` are no
|
|
988
|
-
* opinion (what a hook body yields when it has nothing to say). A refusal the receipt mints at this seam is the ENGINE's
|
|
989
|
-
* decision ({@link isEngineRefusal}) and exits through the engine's fail-closed arm (the deny observer), never as the hook's
|
|
990
|
-
* own deny.
|
|
991
|
-
*/
|
|
992
843
|
export declare function refuseOutOfContractDecision(d: PermissionResult, opts?: {
|
|
993
844
|
reasonIsNonInput?: boolean;
|
|
845
|
+
call?: {
|
|
846
|
+
readonly toolCallId: string;
|
|
847
|
+
readonly toolName: string;
|
|
848
|
+
};
|
|
994
849
|
}): PermissionResult;
|
|
995
850
|
/** The raw tool-name lists a name-keyed policy was built from (audit feed, see block note above). */
|
|
996
851
|
export interface ToolPolicyNameSets {
|
|
@@ -1015,9 +870,9 @@ export declare function toolPolicyNameSets(p: ToolPolicy | undefined): readonly
|
|
|
1015
870
|
* mode's unstated question; consent is an allow entry (`RunnerDeps.allowedTools` / `TaskSpec.allowedTools`). Without
|
|
1016
871
|
* `allow`, everything not in `deny` gets no objection. Each entry is read by the rule
|
|
1017
872
|
* syntax (`ruleSpellingOf`): a name, or `Tool()` / `Tool(*)` — the bare `Tool`, as every list reader reads them, once however
|
|
1018
|
-
* many spellings write it; any other spelling is not a tool name (`onInvalidName`)
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
873
|
+
* many spellings write it; any other spelling is not a tool name (`onInvalidName`). A `*` in a name is a glob over the whole
|
|
874
|
+
* name in `deny` (`Re*d`, `mcp__*`; the lone `*` denies every tool), and in `allow` only in the tool segment after a literal
|
|
875
|
+
* `<ns>__<peer>__` (`mcp__srv__get_*`) — any other `*` in `allow` names no scope it widens and is not a tool name either.
|
|
1021
876
|
* Carries {@link NamedToolPolicy.nameSets} (the names as read) so the host can audit the lists against the mounted
|
|
1022
877
|
* pool ([c209-E] advisory); enforcement semantics are unchanged.
|
|
1023
878
|
*/
|
|
@@ -1026,7 +881,7 @@ export declare function createAllowDenyPolicy(opts: {
|
|
|
1026
881
|
deny?: string[];
|
|
1027
882
|
/**
|
|
1028
883
|
* What to do with an entry that is not a tool NAME: a rule CONTENT form (`Bash(ps:*)`, `Edit(src/**)`), a spelling
|
|
1029
|
-
* the rule syntax reads no tool name in (`" Bash"`, `Bash\t(*)`, `-deploy`), or the
|
|
884
|
+
* the rule syntax reads no tool name in (`" Bash"`, `Bash\t(*)`, `-deploy`), or a `*` the allow list does not read (`*`, `Re*d`, `mcp__*`).
|
|
1030
885
|
* `"throw"` (default, matching {@link createPermissionRulePolicy}'s posture toward a rule it cannot
|
|
1031
886
|
* compile) refuses at construction; `"skip"` drops the entry and reports it. Under BOTH, the entry never
|
|
1032
887
|
* silently narrows the allowlist.
|
|
@@ -1113,6 +968,13 @@ export declare function createApprovalPolicy(opts: {
|
|
|
1113
968
|
* no longer covers what runs. For a tool whose permission seat is `passthrough` the gate puts the mode's question to a
|
|
1114
969
|
* combined allow unless an answer covers the bytes that run ({@link answeredFor}) — the allow layer answers it there.
|
|
1115
970
|
*
|
|
971
|
+
* **A rewrite is judged by every layer that judged earlier bytes.** A layer's `updatedInput` cascades into the layers after
|
|
972
|
+
* it; the layers BEFORE the latest rewrite judged other bytes, so each is asked once more about the bytes that run, and that
|
|
973
|
+
* answer is its verdict (a deny there refuses the call; a different form handed back there refuses it too — a rewrite is
|
|
974
|
+
* judged once, never chased). The latest rewriter is not asked again: its verdict is bound to its own output. An `updatedInput`
|
|
975
|
+
* that reads as the bytes it was handed is no rewrite; and a layer's rewrite that is a person's edit (its own approver's,
|
|
976
|
+
* licensed by that person's yes) is not replaced by a later layer — that layer's rewrite refuses the call.
|
|
977
|
+
*
|
|
1116
978
|
* **Idempotency requirement:** because the fold continues past an `ask` to look for a later `deny`, a
|
|
1117
979
|
* policy's `check()` can be invoked even after an earlier policy returned `ask`. `check()` MUST be
|
|
1118
980
|
* idempotent — repeated calls with the same {@link ToolCallRequest} return the same decision and
|
|
@@ -1263,7 +1125,8 @@ export declare function createUnverifiableDeletePolicy(opts?: {
|
|
|
1263
1125
|
export declare function createTranscriptIntegrityPolicy(opts?: {
|
|
1264
1126
|
/** Transcript directories to protect. Default: `($AGENT_DATA_DIR ?? ~/.ai-agent)/sessions`. */
|
|
1265
1127
|
sessionsDirs?: readonly string[];
|
|
1266
|
-
/**
|
|
1128
|
+
/** The programs a read-only command over the transcript dir may run (default {@link BASH_READONLY_DEFAULT_ALLOW}); it only
|
|
1129
|
+
* narrows the read-only reader — a listed program whose call writes still asks. */
|
|
1267
1130
|
readAllow?: readonly string[];
|
|
1268
1131
|
/** Override the shell tool names this gate parses (default {@link COARSE_SHELL_TOOLS}, the shell face). */
|
|
1269
1132
|
tools?: string[];
|
|
@@ -1312,6 +1175,10 @@ export interface AskRequest {
|
|
|
1312
1175
|
* `RiskDescriptor.probeReason`. Neutralized + length-capped by the gate. UNTRUSTED-for-display,
|
|
1313
1176
|
* never adjudication input. */
|
|
1314
1177
|
readonly probeReason?: string;
|
|
1178
|
+
/** Present ⇔ this card puts a person's edit back to them: the restriction chain would not run the edit as written and
|
|
1179
|
+
* accepts it only as `acceptableForm` — the `args` this card presents. Approving as it stands runs exactly those bytes;
|
|
1180
|
+
* editing again starts a new pass; a no refuses. Engine-minted; display and outlet only, never adjudication input. */
|
|
1181
|
+
readonly editRewritten?: import("./rewrite-rejudge.js").EditRewritten;
|
|
1315
1182
|
/** The STRUCTURED cause behind the tighten — a machine-readable code plus the operand
|
|
1316
1183
|
* families as arrays with honest totals, so this surface renders its OWN sentence rather than one the
|
|
1317
1184
|
* engine had to write before the check's edge cases were known. See
|
|
@@ -1338,6 +1205,10 @@ export interface AskRequest {
|
|
|
1338
1205
|
* RECONCILIATION metadata, never adjudication input. */
|
|
1339
1206
|
readonly ruleEvidence?: AskRuleEvidence;
|
|
1340
1207
|
toolCallId: string;
|
|
1208
|
+
/** An extension's own call (`$.tool.call`): who asked for it, for the card's line of origin ("extension X wants to run …").
|
|
1209
|
+
* A display fact — the ask is the run's, put to the run's approver and judged exactly as a model's call is; absent for a
|
|
1210
|
+
* call a model message carried. Minted by the engine at the ask's mint; never adjudication input. */
|
|
1211
|
+
readonly requestedBy?: import("./task-event.js").ExtensionRequester;
|
|
1341
1212
|
/** The (post-rewrite) args the tool would run with. */
|
|
1342
1213
|
args: unknown;
|
|
1343
1214
|
/** the tool's approval display projection of {@link args} (AgentTool.approvalPreview),
|
|
@@ -1458,13 +1329,16 @@ export interface AskRequest {
|
|
|
1458
1329
|
* command whose exact form the validator refuses offers nothing rather than promoting a lone
|
|
1459
1330
|
* prefix to index 0 — see `suggestRulesForCommand`). The seat says "this card has no rule to
|
|
1460
1331
|
* offer you", which is true of both; it does not claim the grammar is empty, and a surface must
|
|
1461
|
-
* not word it as though no rule could ever be written for the command.
|
|
1332
|
+
* not word it as though no rule could ever be written for the command. It is also the word of a
|
|
1333
|
+
* card whose tool's form mints no offer: a path tool's, a shell-face sibling's, and a tool that
|
|
1334
|
+
* answers to one of those under an alias.
|
|
1462
1335
|
*
|
|
1463
1336
|
* ABSENT is not a claim, exactly as {@link previewWithheld}'s absence is not: it also covers the
|
|
1464
|
-
* ordinary "there are offers" case and the
|
|
1465
|
-
*
|
|
1466
|
-
*
|
|
1467
|
-
* a lane that does not exist. Read
|
|
1337
|
+
* ordinary "there are offers" case and the STRUCTURAL door that answers with silence on purpose — no
|
|
1338
|
+
* rule speaks for this call: no rule lane wired, a task that cannot hold a rule at all, or a call the
|
|
1339
|
+
* lane does not judge (a content-routing tool the engine mounts) — a reason line on every ask of a
|
|
1340
|
+
* deployment that never had the feature would be noise about a lane that does not exist. Read
|
|
1341
|
+
* presence, never absence.
|
|
1468
1342
|
*
|
|
1469
1343
|
* ADVISORY disclosure metadata, never adjudication input: it changes nothing about what is allowed,
|
|
1470
1344
|
* and a surface that ignores it renders exactly the card it rendered before. The durable park row
|