@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,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AssertAllKeysHandled } from "./ask-origin.js";
|
|
2
2
|
import type { DecisionMember, PermissionResult } from "./tool-policy.js";
|
|
3
3
|
export declare const refusedOutOfContract: (message: string) => PermissionResult;
|
|
4
4
|
/** Is `d` a refusal the engine itself minted (by object identity — a look-alike `deny` a caller built is not one)? The receipt's
|
|
@@ -47,14 +47,48 @@ export declare const DECISION_MEMBER_ARMS: Readonly<{
|
|
|
47
47
|
readonly origin: readonly ["ask"];
|
|
48
48
|
readonly askClass: readonly ["ask"];
|
|
49
49
|
readonly classes: readonly ["ask"];
|
|
50
|
-
readonly guards: readonly ["ask"];
|
|
51
50
|
readonly ruleUnreadable: readonly ["ask"];
|
|
52
51
|
readonly authoredBy: readonly ["ask"];
|
|
53
|
-
readonly
|
|
52
|
+
readonly editRewritten: readonly ["ask"];
|
|
54
53
|
}>;
|
|
55
54
|
export type DecisionMemberArmsCoverTheUnion = AssertAllKeysHandled<{
|
|
56
55
|
[M in DecisionMember]: Exclude<ArmOf<M>, (typeof DECISION_MEMBER_ARMS)[M][number]>;
|
|
57
56
|
}[DecisionMember]>;
|
|
57
|
+
/**
|
|
58
|
+
* WHO writes each member of the decision union — one writer per fact, one table (fenced to the union like
|
|
59
|
+
* {@link DECISION_MEMBER_ARMS}: a member the union gains without a row is a type error):
|
|
60
|
+
* · `composer` — the policy's or hook's own statement about its question: received, and read as an input of the class derivation;
|
|
61
|
+
* · `record` — the engine's attestation record (`attestation`): taken by reference after its brand check, read for its call;
|
|
62
|
+
* · `stamp` — written by the gate after the receipt (the disclosed words of the classes the engine derives, the allow layer's
|
|
63
|
+
* and the rule lane's accounts): no composer writes one, so a decision that states one is refused by name.
|
|
64
|
+
*/
|
|
65
|
+
export declare const DECISION_MEMBER_WRITERS: Readonly<{
|
|
66
|
+
readonly action: "composer";
|
|
67
|
+
readonly updatedInput: "composer";
|
|
68
|
+
readonly message: "composer";
|
|
69
|
+
readonly decisionReason: "composer";
|
|
70
|
+
readonly attestation: "record";
|
|
71
|
+
readonly requiresRealApproval: "composer";
|
|
72
|
+
readonly denialLimitFallback: "composer";
|
|
73
|
+
readonly classifierNoRuling: "composer";
|
|
74
|
+
readonly allowRuleShadowed: "stamp";
|
|
75
|
+
readonly probeReason: "composer";
|
|
76
|
+
readonly probeCause: "composer";
|
|
77
|
+
readonly probeMandated: "composer";
|
|
78
|
+
readonly crossBoundaryMandated: "composer";
|
|
79
|
+
readonly mandated: "composer";
|
|
80
|
+
readonly mandate: "stamp";
|
|
81
|
+
readonly probeReadRootCandidate: "composer";
|
|
82
|
+
readonly matchedAskRule: "composer";
|
|
83
|
+
readonly ruleEvidence: "stamp";
|
|
84
|
+
readonly segmentCoverage: "stamp";
|
|
85
|
+
readonly origin: "stamp";
|
|
86
|
+
readonly askClass: "stamp";
|
|
87
|
+
readonly classes: "stamp";
|
|
88
|
+
readonly ruleUnreadable: "composer";
|
|
89
|
+
readonly authoredBy: "composer";
|
|
90
|
+
readonly editRewritten: "composer";
|
|
91
|
+
}>;
|
|
58
92
|
export declare const RETIRED_WINDOW_MEMBER_DENY_MESSAGE: string;
|
|
59
93
|
export declare const carriesRetiredWindow: (fallback: unknown) => boolean;
|
|
60
94
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { types } from "node:util";
|
|
2
|
-
import { ASK_CLASSES, ASK_ORIGINS, isAskClass, isAskOrigin, isPersistedRuleMandate, PERSISTED_RULE_MANDATES } from "./ask-origin.js";
|
|
3
2
|
import { AUTO_MODE_FALLBACK_CAUSES, isAutoModeFallbackCause, isDenialLimitBound } from "./auto-mode.js";
|
|
4
3
|
import { thrownText } from "./thrown-value.js";
|
|
5
4
|
const ENGINE_REFUSALS = new WeakSet();
|
|
@@ -11,7 +10,6 @@ export const refusedOutOfContract = (message) => {
|
|
|
11
10
|
export const isEngineRefusal = (d) => typeof d === "object" && d !== null && ENGINE_REFUSALS.has(d);
|
|
12
11
|
const DECISION_REASONS = Object.freeze(["rule", "mode", "hook", "safety", "classifier", "persisted_rule", "sandbox", "org_rule", "org_unavailable", "read_only", "skill", "deployment_rule", "request_rule"]);
|
|
13
12
|
const DECISION_ACTIONS = Object.keys({ allow: 0, deny: 0, ask: 0 });
|
|
14
|
-
const GUARDS = Object.keys({ dangerous_delete: 0, unverifiable_delete: 0, unverifiable_shell_text: 0, transcript_write: 0, artifact_shared_read: 0 });
|
|
15
13
|
const RULE_UNREADABLE_WORDS = Object.keys({ content_deny: 0, content_ask: 0, persisted_call: 0, persisted_rows: 0 });
|
|
16
14
|
const AUTHORED_BY_WORDS = Object.keys({ deployment: 0 });
|
|
17
15
|
const memberOf = (words) => {
|
|
@@ -21,12 +19,6 @@ const memberOf = (words) => {
|
|
|
21
19
|
const CLOSED_MEMBERS = [
|
|
22
20
|
{ member: "action", words: DECISION_ACTIONS, has: memberOf(DECISION_ACTIONS), required: true },
|
|
23
21
|
{ member: "decisionReason", words: DECISION_REASONS, has: memberOf(DECISION_REASONS) },
|
|
24
|
-
{ member: "origin", words: ASK_ORIGINS, has: isAskOrigin },
|
|
25
|
-
{ member: "askClass", words: ASK_CLASSES, has: isAskClass },
|
|
26
|
-
{ member: "classes", words: ASK_CLASSES, has: isAskClass, list: true },
|
|
27
|
-
{ member: "foldedAskClasses", words: ASK_CLASSES, has: isAskClass, list: true },
|
|
28
|
-
{ member: "mandate", words: PERSISTED_RULE_MANDATES, has: isPersistedRuleMandate },
|
|
29
|
-
{ member: "guards", words: GUARDS, has: memberOf(GUARDS), list: true },
|
|
30
22
|
{ member: "ruleUnreadable", words: RULE_UNREADABLE_WORDS, has: memberOf(RULE_UNREADABLE_WORDS) },
|
|
31
23
|
{ member: "authoredBy", words: AUTHORED_BY_WORDS, has: memberOf(AUTHORED_BY_WORDS) },
|
|
32
24
|
{ member: "classifierNoRuling", words: AUTO_MODE_FALLBACK_CAUSES, has: isAutoModeFallbackCause },
|
|
@@ -41,8 +33,17 @@ export const DECISION_MEMBER_ARMS = Object.freeze({
|
|
|
41
33
|
action: EVERY_ARM, updatedInput: EVERY_ARM, message: EVERY_ARM, decisionReason: EVERY_ARM, attestation: EVERY_ARM,
|
|
42
34
|
requiresRealApproval: ASK, denialLimitFallback: ASK, classifierNoRuling: ASK, allowRuleShadowed: ASK, probeReason: ASK, probeCause: ASK,
|
|
43
35
|
probeMandated: ASK, crossBoundaryMandated: ASK, mandated: ASK, mandate: ASK, probeReadRootCandidate: ASK, matchedAskRule: ASK, ruleEvidence: ASK,
|
|
44
|
-
segmentCoverage: ASK, origin: ASK, askClass: ASK, classes: ASK,
|
|
36
|
+
segmentCoverage: ASK, origin: ASK, askClass: ASK, classes: ASK, ruleUnreadable: ASK, authoredBy: ASK,
|
|
37
|
+
editRewritten: ASK,
|
|
45
38
|
});
|
|
39
|
+
export const DECISION_MEMBER_WRITERS = Object.freeze({
|
|
40
|
+
action: "composer", updatedInput: "composer", message: "composer", decisionReason: "composer", attestation: "record",
|
|
41
|
+
requiresRealApproval: "composer", denialLimitFallback: "composer", classifierNoRuling: "composer", allowRuleShadowed: "stamp", probeReason: "composer",
|
|
42
|
+
probeCause: "composer", probeMandated: "composer", crossBoundaryMandated: "composer", mandated: "composer", mandate: "stamp",
|
|
43
|
+
probeReadRootCandidate: "composer", matchedAskRule: "composer", ruleEvidence: "stamp", segmentCoverage: "stamp", origin: "stamp", askClass: "stamp",
|
|
44
|
+
classes: "stamp", ruleUnreadable: "composer", authoredBy: "composer", editRewritten: "composer",
|
|
45
|
+
});
|
|
46
|
+
const STAMP_MEMBERS = Object.keys(DECISION_MEMBER_WRITERS).filter((m) => DECISION_MEMBER_WRITERS[m] === "stamp");
|
|
46
47
|
const RETIRED_WINDOW_MEMBER = "autoDenyAfterMs";
|
|
47
48
|
export const RETIRED_WINDOW_MEMBER_DENY_MESSAGE = `a permission decision's "denialLimitFallback" carries "${RETIRED_WINDOW_MEMBER}" — the decision names the counts only; ` +
|
|
48
49
|
`the auto-deny window is decided by the ask's route (a live approver arms it, every other route runs none) and cannot be ` +
|
|
@@ -59,6 +60,7 @@ const NESTED_CONTRACTS = [
|
|
|
59
60
|
{ holder: "", member: "probeCause", members: Object.keys({ code: 0, roots: 0, further: 0 }), required: Object.keys({ code: 0, roots: 0 }) },
|
|
60
61
|
{ holder: "probeCause.", member: "roots", members: OPERAND_MEMBERS, required: OPERAND_MEMBERS },
|
|
61
62
|
{ holder: "probeCause.", member: "further", members: OPERAND_MEMBERS, required: OPERAND_MEMBERS },
|
|
63
|
+
{ holder: "", member: "editRewritten", members: Object.keys({ acceptableForm: 0 }), required: Object.keys({ acceptableForm: 0 }) },
|
|
62
64
|
];
|
|
63
65
|
const nonNegativeInteger = (v) => typeof v === "number" && Number.isInteger(v) && v >= 0;
|
|
64
66
|
const NESTED_VALUE_FENCES = {
|
|
@@ -80,7 +82,12 @@ function renderForeignValue(v) {
|
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
export function screenContractValues(contract, opts) {
|
|
83
|
-
|
|
85
|
+
const stamped = STAMP_MEMBERS.find((m) => contract[m] !== undefined);
|
|
86
|
+
if (stamped !== undefined) {
|
|
87
|
+
return refusedOutOfContract(`a permission decision carries "${stamped}" — the member is written by the gate after a policy answers (the disclosed account of what the engine's own layers found); ` +
|
|
88
|
+
`a policy states its question through its own members (requiresRealApproval, authoredBy, matchedAskRule, …); denied fail-closed rather than carrying a value the gate replaces`);
|
|
89
|
+
}
|
|
90
|
+
for (const { member, words, has, required } of CLOSED_MEMBERS) {
|
|
84
91
|
if (opts?.skip?.has(member) === true)
|
|
85
92
|
continue;
|
|
86
93
|
const v = contract[member];
|
|
@@ -89,13 +96,6 @@ export function screenContractValues(contract, opts) {
|
|
|
89
96
|
return refusedOutOfContract(`a permission decision's "${member}" is absent — the closed set is ${words.join("/")}; denied fail-closed rather than reading a word outside it as an allow`);
|
|
90
97
|
continue;
|
|
91
98
|
}
|
|
92
|
-
if (list === true) {
|
|
93
|
-
const received = receiveList(v, member, words, has);
|
|
94
|
-
if (received.kind === "refused")
|
|
95
|
-
return received.refused;
|
|
96
|
-
contract[member] = received.held;
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
99
|
if (has(v))
|
|
100
100
|
continue;
|
|
101
101
|
return unrecognized(member, v, words);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The delegation factory's mint: `result`'s `details` object is a refusal before any child ran. Returns `result` as it is. */
|
|
2
|
+
export declare function notStartedResult<T extends object>(result: T): T;
|
|
3
|
+
/** An engine copy's carry: the engine's `copy` of a receipted object holds the receipt too. Anything else carries nothing. */
|
|
4
|
+
export declare function carryNotStartedReceipt(original: unknown, copy: unknown): void;
|
|
5
|
+
/** Is `result` one of the delegation tool's refusals before any child ran — by the receipt on its `details` object alone? */
|
|
6
|
+
export declare function isNotStartedDelegationResult(result: unknown): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const NOT_STARTED_RECEIPTS = new WeakSet();
|
|
2
|
+
export function notStartedResult(result) {
|
|
3
|
+
const details = result.details;
|
|
4
|
+
if (typeof details === "object" && details !== null)
|
|
5
|
+
NOT_STARTED_RECEIPTS.add(details);
|
|
6
|
+
return result;
|
|
7
|
+
}
|
|
8
|
+
export function carryNotStartedReceipt(original, copy) {
|
|
9
|
+
if (typeof original === "object" && original !== null && typeof copy === "object" && copy !== null && NOT_STARTED_RECEIPTS.has(original))
|
|
10
|
+
NOT_STARTED_RECEIPTS.add(copy);
|
|
11
|
+
}
|
|
12
|
+
export function isNotStartedDelegationResult(result) {
|
|
13
|
+
if (typeof result !== "object" || result === null)
|
|
14
|
+
return false;
|
|
15
|
+
const details = result.details;
|
|
16
|
+
return typeof details === "object" && details !== null && NOT_STARTED_RECEIPTS.has(details);
|
|
17
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The engine's ATTESTATION record — the one carrier of what an engine station knows about a decision and a policy cannot
|
|
3
|
+
* state: WHO settled the call's wait and WHICH question that answered (the settlement, the ask's origin word and class set,
|
|
4
|
+
* the digest of the arguments the answer licenses), and the facts the classifier stations, the in-fold unresolvable arms,
|
|
5
|
+
* the integrity guards and the policy fold record. It rides the decision as its `attestation` member and is read through
|
|
6
|
+
* {@link attestationOf} alone; the decision object's identity carries nothing.
|
|
7
|
+
*
|
|
8
|
+
* Minted only by {@link mintAttestation} and combined only by {@link mergeAttestation}: both freeze the record and enter it
|
|
9
|
+
* in a module-private brand set, so a value a caller composed — a literal, a copy, a structured clone — is not a record, and
|
|
10
|
+
* the decision receipt refuses a decision carrying one. A record is bound to the call it was minted for (`toolCallId` +
|
|
11
|
+
* `toolName`): handed back for another call it reads as absent. A spread of a decision keeps its record, and the record still
|
|
12
|
+
* says only what the engine minted — a refusal record on an allow is a contradiction the gate's exit refuses, and a
|
|
13
|
+
* resolution's answer binds the arguments it licensed (`inputDigest`).
|
|
14
|
+
*
|
|
15
|
+
* A leaf (type-only imports): the decision module that receives a record and the class derivation that reads one for its call
|
|
16
|
+
* both depend on it, and neither depends on the other through it.
|
|
17
|
+
*/
|
|
18
|
+
import type { AskClass, AskOrigin } from "./ask-origin.js";
|
|
19
|
+
import type { ClassifierDenyCause, Settlement } from "./gate-outcome.js";
|
|
20
|
+
import type { AutoModeClassifierRound } from "./auto-mode.js";
|
|
21
|
+
import type { AskUnresolvableCause } from "./ask-unresolvable-notice.js";
|
|
22
|
+
import type { PathDenialEvidence } from "../tools/fs/safety.js";
|
|
23
|
+
import type { AskGuard } from "./tool-policy.js";
|
|
24
|
+
export interface EngineAttestation {
|
|
25
|
+
readonly toolCallId: string;
|
|
26
|
+
readonly toolName: string;
|
|
27
|
+
/** What ended the call's wait. The answer group — `settlement`, `origin`, `classes`, `inputDigest` — travels as one. */
|
|
28
|
+
readonly settlement?: Settlement;
|
|
29
|
+
/** The settled ask's origin word. */
|
|
30
|
+
readonly origin?: AskOrigin;
|
|
31
|
+
/** The settled ask's class set (`ASK_CLASSES` order), when the minting station held one. */
|
|
32
|
+
readonly classes?: readonly AskClass[];
|
|
33
|
+
/** `exactBoundInputHashOf` of the arguments the settlement licenses (an approver's edit, the snapshot shown, or the asked
|
|
34
|
+
* args); absent when they have none (outside the bindable domain) — such a record licenses no bytes. */
|
|
35
|
+
readonly inputDigest?: string;
|
|
36
|
+
/** The FORM of a classifier round that did not rule (a classifier deny's cause). */
|
|
37
|
+
readonly classifierCause?: ClassifierDenyCause;
|
|
38
|
+
/** WHICH model answered a classification, on either arm. */
|
|
39
|
+
readonly classifierRound?: AutoModeClassifierRound;
|
|
40
|
+
/** Why an in-fold deny refused an ask nobody could resolve. */
|
|
41
|
+
readonly unresolvableCause?: AskUnresolvableCause;
|
|
42
|
+
/** The classes of the OTHER asks a policy fold collapsed into this one (each contributor's classes, unioned) — so a fact the
|
|
43
|
+
* fold does not copy (a guard, an unreadable-rule fact, a bare real-approval bit) is not lost behind the ask that won the
|
|
44
|
+
* slot. Written by the policy fold and by the gate's own writers of a standing ask's carried classes; the one carrier of
|
|
45
|
+
* those classes. */
|
|
46
|
+
readonly foldedClasses?: readonly AskClass[];
|
|
47
|
+
/** WHICH integrity guards stand behind this ask — a removal of a protected location, an unverifiable recursive delete, shell
|
|
48
|
+
* text the engine cannot read (or an environment that did not answer the read station), the session-transcript write,
|
|
49
|
+
* another person's shared artifact. Engine findings (the guard policies, the read station's silence, the artifact tool's
|
|
50
|
+
* consent): the class derivation reads them as classes and as explainers of the real-approval bit, so only a record carries
|
|
51
|
+
* them. Never copied onto the approval request or the park row. */
|
|
52
|
+
readonly guards?: readonly AskGuard[];
|
|
53
|
+
/** 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
|
|
54
|
+
* exit mints the refusal's card from it; the judge that found the row is its only writer. */
|
|
55
|
+
readonly pathDenial?: PathDenialEvidence;
|
|
56
|
+
/** A seat refused the call's arguments because no approval can be bound to them: the refusal's sentence, carried by the
|
|
57
|
+
* refusal itself — the gate's deny exit reads it (the remedy it gives) instead of judging again. */
|
|
58
|
+
readonly bindingRefusal?: string;
|
|
59
|
+
}
|
|
60
|
+
/** The members a station attests — everything but the call binding. */
|
|
61
|
+
export type AttestationMembers = Omit<EngineAttestation, "toolCallId" | "toolName">;
|
|
62
|
+
/** Mint a record for `call`. Engine stations only: not re-exported from `src/index.ts`. The values are DETACHED snapshots, so a
|
|
63
|
+
* caller that later mutates the settlement object it was handed cannot rewrite what the engine attests. */
|
|
64
|
+
export declare function mintAttestation(call: {
|
|
65
|
+
toolCallId: string;
|
|
66
|
+
toolName: string;
|
|
67
|
+
}, members: AttestationMembers): EngineAttestation;
|
|
68
|
+
/** Is `v` a record the engine minted (the brand alone — no binding)? The receipt's test. */
|
|
69
|
+
export declare function isEngineAttestation(v: unknown): v is EngineAttestation;
|
|
70
|
+
/** THE read: the record `d` carries FOR `call` — a branded record bound to that call, else `undefined` (a record bound to
|
|
71
|
+
* another call is a replayed one and reads as absent). Read off the own data member, never through an accessor. */
|
|
72
|
+
export declare function attestationOf(d: unknown, call: {
|
|
73
|
+
toolCallId: string;
|
|
74
|
+
toolName: string;
|
|
75
|
+
}): EngineAttestation | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Combine two records for `call`, member GROUP by group: the later record's group stands where it has one, the earlier's
|
|
78
|
+
* fills a group the later lacks. A record not bound to `call` contributes nothing. `answer` scope is the veto's merge: the
|
|
79
|
+
* earlier record contributes ONLY its answer, and only when the later carries none — a person's yes rides a later layer's
|
|
80
|
+
* deny (invariant I3) while the refusing station's own facts stay its own.
|
|
81
|
+
*/
|
|
82
|
+
export declare function mergeAttestation(call: {
|
|
83
|
+
toolCallId: string;
|
|
84
|
+
toolName: string;
|
|
85
|
+
}, earlier: EngineAttestation | undefined, later: EngineAttestation | undefined, scope?: "all" | "answer"): EngineAttestation | undefined;
|
|
86
|
+
/** `d` with `members` attested for `call`, merged over the record it already carries for that call (the new members' groups
|
|
87
|
+
* win). Always a fresh object — the receipt hands out frozen ones. */
|
|
88
|
+
export declare function attest<T extends object>(d: T, call: {
|
|
89
|
+
toolCallId: string;
|
|
90
|
+
toolName: string;
|
|
91
|
+
}, members: AttestationMembers): T;
|
|
92
|
+
/** `d` carrying `record` (a fresh object), or `d` itself when there is no record to put on it. */
|
|
93
|
+
export declare function withAttestation<T extends object>(d: T, record: EngineAttestation | undefined): T;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const ATTESTATION_GROUP_OF = {
|
|
2
|
+
settlement: "answer",
|
|
3
|
+
origin: "answer",
|
|
4
|
+
classes: "answer",
|
|
5
|
+
inputDigest: "answer",
|
|
6
|
+
classifierCause: "classifierCause",
|
|
7
|
+
classifierRound: "classifierRound",
|
|
8
|
+
unresolvableCause: "unresolvableCause",
|
|
9
|
+
foldedClasses: "foldedClasses",
|
|
10
|
+
guards: "guards",
|
|
11
|
+
pathDenial: "pathDenial",
|
|
12
|
+
bindingRefusal: "bindingRefusal",
|
|
13
|
+
};
|
|
14
|
+
const ATTESTATION_MEMBERS = Object.keys(ATTESTATION_GROUP_OF);
|
|
15
|
+
const groupLead = (g) => ATTESTATION_MEMBERS.find((k) => ATTESTATION_GROUP_OF[k] === g);
|
|
16
|
+
const ENGINE_ATTESTATIONS = new WeakSet();
|
|
17
|
+
function detachedMember(v) {
|
|
18
|
+
if (Array.isArray(v))
|
|
19
|
+
return Object.freeze([...v]);
|
|
20
|
+
if (typeof v !== "object" || v === null)
|
|
21
|
+
return v;
|
|
22
|
+
return Object.freeze(Object.fromEntries(Object.entries(v).map(([k, x]) => [k, typeof x === "object" && x !== null ? Object.freeze(Array.isArray(x) ? [...x] : { ...x }) : x])));
|
|
23
|
+
}
|
|
24
|
+
export function mintAttestation(call, members) {
|
|
25
|
+
const record = { toolCallId: call.toolCallId, toolName: call.toolName };
|
|
26
|
+
for (const k of ATTESTATION_MEMBERS)
|
|
27
|
+
if (members[k] !== undefined)
|
|
28
|
+
record[k] = detachedMember(members[k]);
|
|
29
|
+
const minted = Object.freeze(record);
|
|
30
|
+
ENGINE_ATTESTATIONS.add(minted);
|
|
31
|
+
return minted;
|
|
32
|
+
}
|
|
33
|
+
export function isEngineAttestation(v) {
|
|
34
|
+
return typeof v === "object" && v !== null && ENGINE_ATTESTATIONS.has(v);
|
|
35
|
+
}
|
|
36
|
+
const boundTo = (r, call) => isEngineAttestation(r) && r.toolCallId === call.toolCallId && r.toolName === call.toolName ? r : undefined;
|
|
37
|
+
export function attestationOf(d, call) {
|
|
38
|
+
if (typeof d !== "object" || d === null)
|
|
39
|
+
return undefined;
|
|
40
|
+
return boundTo(Object.getOwnPropertyDescriptor(d, "attestation")?.value, call);
|
|
41
|
+
}
|
|
42
|
+
export function mergeAttestation(call, earlier, later, scope = "all") {
|
|
43
|
+
const a = boundTo(earlier, call);
|
|
44
|
+
const b = boundTo(later, call);
|
|
45
|
+
if (a === undefined)
|
|
46
|
+
return b;
|
|
47
|
+
const members = {};
|
|
48
|
+
if (b !== undefined)
|
|
49
|
+
for (const k of ATTESTATION_MEMBERS)
|
|
50
|
+
if (b[k] !== undefined)
|
|
51
|
+
members[k] = b[k];
|
|
52
|
+
let filled = false;
|
|
53
|
+
for (const g of new Set(Object.values(ATTESTATION_GROUP_OF))) {
|
|
54
|
+
if ((scope === "answer" && g !== "answer") || members[groupLead(g)] !== undefined || a[groupLead(g)] === undefined)
|
|
55
|
+
continue;
|
|
56
|
+
for (const k of ATTESTATION_MEMBERS)
|
|
57
|
+
if (ATTESTATION_GROUP_OF[k] === g && a[k] !== undefined)
|
|
58
|
+
members[k] = a[k];
|
|
59
|
+
filled = true;
|
|
60
|
+
}
|
|
61
|
+
if (!filled)
|
|
62
|
+
return b;
|
|
63
|
+
return mintAttestation(call, members);
|
|
64
|
+
}
|
|
65
|
+
export function attest(d, call, members) {
|
|
66
|
+
return withAttestation(d, mergeAttestation(call, attestationOf(d, call), mintAttestation(call, members)));
|
|
67
|
+
}
|
|
68
|
+
export function withAttestation(d, record) {
|
|
69
|
+
return record === undefined ? d : { ...d, attestation: record };
|
|
70
|
+
}
|
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
* memory distiller's chat seat key), and `inheritedHostEnv` subtracts every entry whose value is one,
|
|
17
17
|
* compared whole, under every policy. A credential resolved per request (a per-model auth hook's answer) is not in
|
|
18
18
|
* it: the host that resolves it declares it. The same inheritance-only reading as the word above.
|
|
19
|
+
* - `mods.skill_seat` — a skill carries its own hooks: `SkillSpec.mods` registrations are admitted on every leg that loads
|
|
20
|
+
* the skill and take part only while the skill is active there (from its activation to the run's end, a park and its
|
|
21
|
+
* resume included); they are the leg's own (no delegated child dispatches them or is screened by them).
|
|
19
22
|
*/
|
|
20
|
-
export declare const ENGINE_CAPABILITIES: readonly ["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld"];
|
|
23
|
+
export declare const ENGINE_CAPABILITIES: readonly ["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat"];
|
|
21
24
|
/** One word of {@link ENGINE_CAPABILITIES}. */
|
|
22
25
|
export type EngineCapability = (typeof ENGINE_CAPABILITIES)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ENGINE_CAPABILITIES = Object.freeze(["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld"]);
|
|
1
|
+
export const ENGINE_CAPABILITIES = Object.freeze(["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat"]);
|
|
@@ -324,6 +324,14 @@ export interface EngineNotice {
|
|
|
324
324
|
* runs. ONCE PER LEG PER (api, key set) — a deployment fact, not a request fact. Audience `operator`;
|
|
325
325
|
* `detail: { keys, api, modelId, sessionId, runId }` — `keys` the key NAMES in `extraBody`'s order (never a
|
|
326
326
|
* value), `api` the wire the adapter speaks, `modelId` the catalog id the request was sent as.
|
|
327
|
+
* - `"model.capability_downgraded"` (#1830) — a capability the session's requests used was withheld from the model
|
|
328
|
+
* they were sent to: today, images replaced by a one-line placeholder because the model's entry declares no image
|
|
329
|
+
* input (`Model.input` without `"image"`; `capabilityOf` in `brain/model-capability.ts` is the one reading, and an
|
|
330
|
+
* entry that does not declare `input` keeps its images). The message names the model and the way out (declare the
|
|
331
|
+
* image input, or switch models). Never minted for reasoning a model declares off — the reasoning resolution's
|
|
332
|
+
* drop arm (`TaskResult.effectiveReasoning.dropped`) is that fact's face. ONCE PER SESSION PER (model, capability)
|
|
333
|
+
* (the session's announced record); one report per request also becomes the operator trace `vision.placeholder`.
|
|
334
|
+
* Audience `user`; `detail: { model, capability: "image", status: "declared_off", sessionId, runId }`.
|
|
327
335
|
* - `"context.tool_turn_repaired"` (#1224) — a provider request was built from a transcript that breaks the
|
|
328
336
|
* tool-turn law, and the request view restored it (`engine/llm/tool-turns.ts`; the transcript is never
|
|
329
337
|
* rewritten): a block after an assistant's tool calls moved ahead of them (`trailing_text`), a result recorded
|
|
@@ -392,16 +400,27 @@ export interface EngineNotice {
|
|
|
392
400
|
* is silent; a broken one must not look the same). Once per prepared leg;
|
|
393
401
|
* `detail: { problem, sessionId, runId }`.
|
|
394
402
|
* - `"config.execution_env_capability_invalid"` — a remote env DECLARES a boolean capability key
|
|
395
|
-
* (`isolation`, `suspendable`, `canonicalPathAuthoritative`) with a non-boolean value; ABSENCE is a
|
|
396
|
-
* supported reading of
|
|
403
|
+
* (`isolation`, `suspendable`, `canonicalPathAuthoritative`, `sharesProcessTable`) with a non-boolean value; ABSENCE is a
|
|
404
|
+
* supported reading of the first three and stays silent, and is announced for `sharesProcessTable`, which has no
|
|
405
|
+
* absent reading (`valueType: "undefined"`). Once per key per run; `detail: { key, valueType }`. Also minted for
|
|
406
|
+
* `withheldEnv` (key `"withheldEnv"`) when it is neither a list of findings nor `"unknown"`, read at a shell call of
|
|
407
|
+
* a root leg (once per run).
|
|
397
408
|
* - `"config.secret_env_scrubbed"` (#1081) — the D1 fail-closed `scrub` policy, or the deployment's
|
|
398
409
|
* own credentials (`declareWithheldEnv`: a declared name, or a value equal to a declared or engine-held
|
|
399
410
|
* credential value), withheld one or more keys from a spawned child's environment (a tool's shell, an
|
|
400
411
|
* oracle gate, or a language server).
|
|
401
412
|
* Once per PROCESS, shared by every scrub site ({@link import("./secret-env.js").announceSecretEnvScrub});
|
|
402
413
|
* `detail: { names, ownCredentials? }` — every withheld key's name, never a value; `ownCredentials`, present
|
|
403
|
-
* only when one was withheld, the subset
|
|
404
|
-
* `"all"` included).
|
|
414
|
+
* only when one was withheld, the subset that is the deployment's own credential, by name or by value, whichever
|
|
415
|
+
* rule withheld it (withheld under any policy, `"all"` included).
|
|
416
|
+
* - `"inherit_env.names_withheld"` (#1963) — the same fact for the person whose run drives a tool shell: the variables
|
|
417
|
+
* of the engine's environment that shell does not receive (`ExecutionEnv.withheldEnv`), the scrub's half (the run's
|
|
418
|
+
* `inheritEnv` hands them on) and the deployment's own credentials (no policy does). Audience `user`. Read as each
|
|
419
|
+
* call to the engine's own shell tool starts on a root leg (the answer can grow during a run: a credential the engine
|
|
420
|
+
* takes in when it first routes a model is withheld from the next child); once per SESSION per name set (the
|
|
421
|
+
* session's announced record). `detail: { state, names?, ownCredentials?, sessionId, runId? }` — `state` `"withheld"`
|
|
422
|
+
* carries the operator row's split (names only, never a value); `"unknown"` (the environment answered `"unknown"`)
|
|
423
|
+
* carries no names and says the engine could not determine them.
|
|
405
424
|
* - `"config.credential_not_withheld"` (#1816) — a credential value the engine was handed (a brain's key or credential
|
|
406
425
|
* header, a model entry's or a peer's credential header, a consolidation seat's key) is no credential (a placeholder
|
|
407
426
|
* such as `EMPTY`, fewer than eight characters, one character repeated): it is used as given, but a variable holding
|
|
@@ -416,10 +435,9 @@ export interface EngineNotice {
|
|
|
416
435
|
* {@link import("./cross-boundary-taint.js").crossBoundaryPostureUndeclaredNotice}. Audience `operator`.
|
|
417
436
|
* - `"config.cross_boundary_record_unwritten"` — a session's cross-boundary record the engine owed could not be written (the
|
|
418
437
|
* store threw, or answered with no entry id) and refused nothing: on a tree that is not governed no judgment reads the record;
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
* (KNOWN-LIMITS KL-469-c; the terminal shape is fail-closed), which the sentence says. Once per state a leg could not write;
|
|
438
|
+
* on a governed tree it stays owed — a prepare's by the leg's next write — and once none lands (a settle's failure is the leg's
|
|
439
|
+
* last write; a parked leg's suspend record landed before it) the next leg reads the content after the newest record as off-target,
|
|
440
|
+
* which the sentence says for the phase that failed. Once per state a leg could not write;
|
|
423
441
|
* `detail: { sessionId, runId, phase, governed, cause }` (`phase`: `prepare` / `exit` / `suspend` / `settle`, where that state
|
|
424
442
|
* first failed). Minted by
|
|
425
443
|
* {@link import("./cross-boundary-taint.js").crossBoundaryRecordUnwrittenNotice}. Audience `operator`.
|
|
@@ -466,14 +484,16 @@ export interface EngineNotice {
|
|
|
466
484
|
* the first eight `{ rule, scopeRoot }`, `count` all of them; `rule` is the rule text as the store served it, through the same reading
|
|
467
485
|
* as `permission.allowed_tool_not_granted`'s `entries[].entry` (the original, not a spelling of it, when it is at most 1 024 code points;
|
|
468
486
|
* a longer one is cut to 1 024 plus the truncation mark, 1 025 in all), `scopeRoot` neutralized and bounded. Audience `user`.
|
|
469
|
-
* - `"config.session_rules_earlier_grammar"` — a session's stored permission rules (`RunnerDeps.sessionPolicyStore`)
|
|
470
|
-
*
|
|
471
|
-
* this engine's grammar reads as no rule makes those rules
|
|
487
|
+
* - `"config.session_rules_earlier_grammar"` — a session's stored permission rules (`RunnerDeps.sessionPolicyStore`) were
|
|
488
|
+
* written in an earlier rule grammar and hold entries it reads otherwise than this engine's would: an entry that grammar
|
|
489
|
+
* reads as nothing (an allow admits nothing; a `toolDeny` entry this engine's grammar reads as no rule makes those rules
|
|
490
|
+
* refuse every call until they are rewritten), or one whose meaning a later grammar revised — the entry keeps its writer's
|
|
491
|
+
* meaning, or takes this grammar's when its writer's could not read it, and the message says which, with both. The message names
|
|
472
492
|
* the session, the bucket, the entries (the first five, the rest counted), the reader's word and the way out. Audience
|
|
473
493
|
* `user`. Once per distinct entry set per bucket per rule layer (the run's own rules, each ancestor's inherited ones).
|
|
474
494
|
* `detail: { bucket, storedGrammar, entries: [{ entry, reader }], rewrite: { by, stampsGrammar }, rulesSessionId,
|
|
475
495
|
* sessionId }` — `entries` every one, `entry` through the same reading as `permission.allowed_tool_not_granted`'s;
|
|
476
|
-
* `reader` ∈ `no_rule` / `named_no_tool`; `rewrite.by` = `operator_write_without_rev`; `rulesSessionId` the session
|
|
496
|
+
* `reader` ∈ `no_rule` / `named_no_tool` / `grammar_revised`; `rewrite.by` = `operator_write_without_rev`; `rulesSessionId` the session
|
|
477
497
|
* whose rules they are (an ancestor's on a delegated child), `sessionId` the run that read them.
|
|
478
498
|
* - `"config.durable_gate_unavailable"` — a durable-approval MANDATE is in force on a leg with NO
|
|
479
499
|
* checkpoint store: the per-principal `forceDurableGate` entitlement, or the task's own
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { egressAccount, egressText } from "./untrusted-egress.js";
|
|
1
2
|
let malformedNoticeSeatAnnounced = false;
|
|
2
3
|
export function __resetMalformedNoticeSeatAnnouncement() {
|
|
3
4
|
malformedNoticeSeatAnnounced = false;
|
|
4
5
|
}
|
|
5
6
|
export function deliverEngineNotice(onNotice, notice) {
|
|
7
|
+
notice = {
|
|
8
|
+
...notice,
|
|
9
|
+
message: typeof notice.message === "string" ? egressText("same-principal", notice.message) : notice.message,
|
|
10
|
+
...(notice.detail !== undefined ? { detail: egressAccount("same-principal", notice.detail) } : {}),
|
|
11
|
+
};
|
|
6
12
|
if (notice.sessionId === undefined && typeof notice.detail?.["sessionId"] === "string") {
|
|
7
13
|
notice = { ...notice, sessionId: notice.detail["sessionId"] };
|
|
8
14
|
}
|