@sema-agent/core 7.66.1 → 7.67.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 +3483 -0
- package/LICENSE +2 -1
- package/dist/agents/agent-definition.js +2 -1
- package/dist/agents/agent-transcript-tool.d.ts +1 -1
- package/dist/agents/agent-transcript-tool.js +4 -3
- package/dist/agents/builtin-agents.d.ts +10 -7
- package/dist/agents/builtin-agents.js +1 -0
- package/dist/agents/cascade.d.ts +24 -11
- package/dist/agents/cascade.js +21 -9
- package/dist/agents/child-failure.d.ts +30 -0
- package/dist/agents/child-failure.js +25 -1
- package/dist/agents/composition-placement.d.ts +6 -2
- package/dist/agents/composition-placement.js +7 -3
- package/dist/agents/cross-session-envelope.d.ts +10 -1
- package/dist/agents/cross-session-envelope.js +6 -2
- package/dist/agents/cross-session-judge.d.ts +7 -1
- package/dist/agents/cross-session-judge.js +1 -0
- package/dist/agents/cumulative-stats.d.ts +36 -2
- package/dist/agents/cumulative-stats.js +44 -9
- package/dist/agents/delegation-registry-seat.js +2 -3
- package/dist/agents/inherited-tool-pool.d.ts +9 -4
- package/dist/agents/inherited-tool-pool.js +7 -1
- package/dist/agents/leg-label.d.ts +28 -0
- package/dist/agents/leg-label.js +9 -0
- package/dist/agents/list-agents-tool.d.ts +1 -1
- package/dist/agents/list-agents-tool.js +4 -4
- package/dist/agents/org-delivery-gate.d.ts +129 -23
- package/dist/agents/org-delivery-gate.js +41 -20
- package/dist/agents/peer-held-queue.d.ts +15 -10
- package/dist/agents/peer-held-queue.js +47 -19
- package/dist/agents/peer-notice-route.js +2 -2
- package/dist/agents/peer-notices.d.ts +13 -2
- package/dist/agents/peer-notices.js +12 -2
- package/dist/agents/peer-session-drain.d.ts +65 -15
- package/dist/agents/peer-session-drain.js +198 -41
- package/dist/agents/read-inbox-tool.d.ts +3 -2
- package/dist/agents/read-inbox-tool.js +7 -5
- package/dist/agents/repair-loop.js +20 -16
- package/dist/agents/retain-ledger.d.ts +1 -1
- package/dist/agents/retain-ledger.js +2 -4
- package/dist/agents/root-session-lane.d.ts +27 -0
- package/dist/agents/root-session-lane.js +57 -0
- package/dist/agents/roster-store.js +1 -2
- package/dist/agents/send-message-tool.js +6 -4
- package/dist/agents/subagent.d.ts +20 -4
- package/dist/agents/subagent.js +218 -183
- package/dist/agents/tool-filter.d.ts +3 -10
- package/dist/agents/tool-filter.js +0 -13
- package/dist/agents/verifier-independence.d.ts +31 -0
- package/dist/agents/verifier-independence.js +23 -0
- package/dist/agents/verify.d.ts +23 -11
- package/dist/agents/verify.js +28 -12
- package/dist/agents/yield-adoption.d.ts +24 -0
- package/dist/agents/yield-adoption.js +84 -0
- package/dist/bench/metrics.d.ts +2 -2
- package/dist/brain/anthropic.d.ts +4 -2
- package/dist/brain/anthropic.js +49 -35
- package/dist/brain/brain-faces.d.ts +11 -0
- package/dist/brain/brain-faces.js +6 -0
- package/dist/brain/cache-retention.d.ts +2 -0
- package/dist/brain/cache-retention.js +9 -0
- package/dist/brain/circuit-breaker.js +51 -26
- package/dist/brain/errors.d.ts +15 -1
- package/dist/brain/errors.js +8 -0
- package/dist/brain/failover.d.ts +6 -0
- package/dist/brain/failover.js +52 -37
- package/dist/brain/media-degrade.d.ts +5 -0
- package/dist/brain/media-degrade.js +4 -0
- package/dist/brain/model-capability.d.ts +2 -1
- package/dist/brain/model-lane.d.ts +145 -0
- package/dist/brain/model-lane.js +444 -0
- package/dist/brain/open-responses.js +19 -22
- package/dist/brain/openai.js +23 -22
- package/dist/brain/provider-message.d.ts +9 -0
- package/dist/brain/provider-message.js +18 -0
- package/dist/brain/reasoning-request.d.ts +9 -7
- package/dist/brain/reasoning-request.js +9 -10
- package/dist/brain/reasoning.d.ts +47 -13
- package/dist/brain/reasoning.js +20 -10
- package/dist/brain/route-adjudicator.d.ts +8 -2
- package/dist/brain/route-adjudicator.js +35 -1
- package/dist/brain/route-conformance.js +17 -0
- package/dist/brain/routing.d.ts +2 -0
- package/dist/brain/routing.js +19 -8
- package/dist/brain/status-sink.d.ts +5 -4
- package/dist/brain/status-sink.js +2 -2
- package/dist/brain/stream-engine.js +8 -2
- package/dist/brain/stream-shared.d.ts +12 -0
- package/dist/brain/stream-shared.js +18 -0
- package/dist/brain/timeout.d.ts +28 -0
- package/dist/brain/timeout.js +13 -4
- package/dist/brain/tool-schema-projection.d.ts +2 -0
- package/dist/brain/tool-schema-projection.js +108 -0
- package/dist/brain/usage-reading.d.ts +49 -0
- package/dist/brain/usage-reading.js +44 -0
- package/dist/brain/usage-reasoning.d.ts +38 -0
- package/dist/brain/usage-reasoning.js +9 -0
- package/dist/config/catalog.d.ts +3 -0
- package/dist/config/catalog.js +18 -9
- package/dist/core/a2a.d.ts +22 -4
- package/dist/core/a2a.js +191 -50
- package/dist/core/agent-definition.d.ts +3 -1
- package/dist/core/agent-state.d.ts +29 -16
- package/dist/core/agent-state.js +36 -9
- package/dist/core/allow-entry.d.ts +12 -3
- package/dist/core/allow-entry.js +10 -3
- package/dist/core/approval-display.d.ts +18 -0
- package/dist/core/approval-display.js +26 -0
- package/dist/core/approval-object.js +2 -2
- package/dist/core/approval-route.d.ts +16 -0
- package/dist/core/approval-route.js +5 -0
- package/dist/core/approval-words.d.ts +43 -0
- package/dist/core/approval-words.js +37 -0
- package/dist/core/ask-origin.d.ts +37 -10
- package/dist/core/ask-origin.js +19 -7
- package/dist/core/ask-question.d.ts +36 -8
- package/dist/core/ask-question.js +24 -9
- package/dist/core/ask-unresolvable-notice.d.ts +3 -2
- package/dist/core/ask-unresolvable-notice.js +3 -2
- package/dist/core/attachment-source.d.ts +50 -0
- package/dist/core/attachment-source.js +46 -0
- package/dist/core/auto-compaction.d.ts +151 -40
- package/dist/core/auto-compaction.js +115 -50
- package/dist/core/auto-mode.d.ts +5 -0
- package/dist/core/auto-mode.js +11 -4
- package/dist/core/background-agent-store.d.ts +151 -23
- package/dist/core/background-agent-store.js +201 -61
- package/dist/core/background-shell.d.ts +4 -1
- package/dist/core/background-shell.js +1 -0
- package/dist/core/cache-break-detector.d.ts +49 -25
- package/dist/core/cache-break-detector.js +99 -44
- package/dist/core/caller-text.d.ts +28 -0
- package/dist/core/caller-text.js +12 -0
- package/dist/core/canonical-json.d.ts +5 -0
- package/dist/core/canonical-json.js +7 -0
- package/dist/core/checkpoint-features.d.ts +80 -9
- package/dist/core/checkpoint-features.js +1 -1
- package/dist/core/checkpoint-generation.d.ts +8 -1
- package/dist/core/checkpoint-generation.js +3 -0
- package/dist/core/checkpoint-queries.d.ts +47 -14
- package/dist/core/checkpoint-queries.js +63 -30
- package/dist/core/checkpoint-requirements.d.ts +36 -3
- package/dist/core/checkpoint-requirements.js +11 -1
- package/dist/core/checkpoint-row-verdict.d.ts +0 -2
- package/dist/core/checkpoint-row-verdict.js +5 -8
- package/dist/core/checkpoint-store.d.ts +166 -41
- package/dist/core/checkpoint-store.js +96 -15
- package/dist/core/child-clamp-seats.d.ts +10 -2
- package/dist/core/child-clamp-seats.js +2 -2
- package/dist/core/classifier-unavailable-arm.d.ts +11 -9
- package/dist/core/classifier-unavailable-arm.js +4 -2
- package/dist/core/command-sandbox-dispatch.d.ts +13 -0
- package/dist/core/command-sandbox-dispatch.js +8 -0
- package/dist/core/command-sandbox.d.ts +231 -0
- package/dist/core/command-sandbox.js +344 -0
- package/dist/core/completion-id.d.ts +21 -0
- package/dist/core/completion-id.js +14 -0
- package/dist/core/config-refusal-codes.d.ts +22 -0
- package/dist/core/config-refusal-codes.js +196 -0
- package/dist/core/context-edit.d.ts +26 -0
- package/dist/core/context-edit.js +4 -2
- package/dist/core/context-guard.d.ts +80 -7
- package/dist/core/context-guard.js +126 -25
- package/dist/core/context-settings.d.ts +32 -0
- package/dist/core/context-settings.js +41 -3
- package/dist/core/contract-faces.d.ts +22 -0
- package/dist/core/contract-faces.js +1 -0
- package/dist/core/credential-echo.d.ts +2 -2
- package/dist/core/credential-echo.js +2 -2
- package/dist/core/cross-boundary-taint.d.ts +10 -8
- package/dist/core/decision-receipt.d.ts +3 -2
- package/dist/core/decision-receipt.js +1 -1
- package/dist/core/definition-entry-grammar.d.ts +42 -0
- package/dist/core/definition-entry-grammar.js +15 -0
- package/dist/core/engine-attestation.d.ts +19 -4
- package/dist/core/engine-attestation.js +4 -0
- package/dist/core/engine-capabilities.d.ts +8 -1
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-contracts/open-face-contract.d.ts +39 -0
- package/dist/core/engine-contracts/open-face-contract.js +57 -0
- package/dist/core/engine-notice.d.ts +161 -33
- package/dist/core/exclusive-temp.d.ts +25 -0
- package/dist/core/exclusive-temp.js +19 -0
- package/dist/core/existing-target.d.ts +112 -0
- package/dist/core/existing-target.js +88 -0
- package/dist/core/file-history-store.d.ts +14 -6
- package/dist/core/gate-lanes.js +8 -3
- package/dist/core/gate-outcome.d.ts +2 -1
- package/dist/core/git-worktree-env.d.ts +92 -1
- package/dist/core/git-worktree-env.js +87 -6
- package/dist/core/governance-codes.d.ts +49 -8
- package/dist/core/governance-codes.js +59 -8
- package/dist/core/hands-band.d.ts +10 -6
- package/dist/core/hooks.d.ts +60 -6
- package/dist/core/hooks.js +10 -2
- package/dist/core/host-floor.d.ts +24 -8
- package/dist/core/host-floor.js +45 -16
- package/dist/core/human-input-projection.d.ts +7 -0
- package/dist/core/human-input-projection.js +11 -3
- package/dist/core/image-admission.d.ts +16 -4
- package/dist/core/image-admission.js +29 -17
- package/dist/core/input-author.d.ts +43 -1
- package/dist/core/input-author.js +19 -0
- package/dist/core/isolation-scope.d.ts +41 -0
- package/dist/core/isolation-scope.js +10 -0
- package/dist/core/json-schema-seats.d.ts +11 -0
- package/dist/core/json-schema-seats.js +5 -0
- package/dist/core/leg-identity.d.ts +53 -5
- package/dist/core/leg-identity.js +32 -1
- package/dist/core/locked-config.d.ts +33 -38
- package/dist/core/locked-config.js +21 -3
- package/dist/core/lsp.js +2 -1
- package/dist/core/mailbox-store.d.ts +111 -18
- package/dist/core/mailbox-store.js +101 -13
- package/dist/core/mcp-call-meta.js +1 -1
- package/dist/core/mcp-connection-pool.d.ts +8 -2
- package/dist/core/mcp-connection-pool.js +3 -1
- package/dist/core/mcp-failure.d.ts +6 -1
- package/dist/core/mcp-failure.js +10 -0
- package/dist/core/mcp-host-read.d.ts +293 -0
- package/dist/core/mcp-host-read.js +428 -0
- package/dist/core/mcp-server-link.d.ts +28 -6
- package/dist/core/mcp-server-link.js +35 -7
- package/dist/core/mcp-server-spec.d.ts +22 -29
- package/dist/core/mcp-server-spec.js +7 -14
- package/dist/core/mcp-server-unavailable-notice.d.ts +32 -0
- package/dist/core/mcp-server-unavailable-notice.js +15 -0
- package/dist/core/mcp-session-end.d.ts +5 -2
- package/dist/core/mcp-session-end.js +7 -2
- package/dist/core/mcp-tool-meta.d.ts +6 -0
- package/dist/core/mcp-tool-meta.js +1 -0
- package/dist/core/mcp.d.ts +54 -19
- package/dist/core/mcp.js +194 -241
- package/dist/core/memory-engine/committed-shadow-read.d.ts +16 -0
- package/dist/core/memory-engine/committed-shadow-read.js +21 -0
- package/dist/core/memory-engine/consolidation-driver.js +2 -1
- package/dist/core/memory-engine/consolidation.d.ts +3 -3
- package/dist/core/memory-engine/control-objects.d.ts +4 -3
- package/dist/core/memory-engine/control-objects.js +6 -4
- package/dist/core/memory-engine/delegation-settlement.d.ts +127 -25
- package/dist/core/memory-engine/delegation-settlement.js +145 -18
- package/dist/core/memory-engine/distiller.d.ts +2 -1
- package/dist/core/memory-engine/distiller.js +10 -5
- package/dist/core/memory-engine/dual-root.js +2 -2
- package/dist/core/memory-engine/engine.d.ts +127 -33
- package/dist/core/memory-engine/engine.js +774 -323
- package/dist/core/memory-engine/entry-scan.d.ts +3 -0
- package/dist/core/memory-engine/entry-scan.js +8 -0
- package/dist/core/memory-engine/export-bundle.d.ts +4 -0
- package/dist/core/memory-engine/export-bundle.js +2 -0
- package/dist/core/memory-engine/file-backend.d.ts +62 -17
- package/dist/core/memory-engine/file-backend.js +155 -99
- package/dist/core/memory-engine/index.d.ts +1 -1
- package/dist/core/memory-engine/index.js +1 -1
- package/dist/core/memory-engine/layer-observations.d.ts +7 -1
- package/dist/core/memory-engine/layer-observations.js +6 -0
- package/dist/core/memory-engine/layout.d.ts +88 -26
- package/dist/core/memory-engine/layout.js +105 -29
- package/dist/core/memory-engine/memory-deployment.js +4 -4
- package/dist/core/memory-engine/mount-failed-notice.d.ts +24 -0
- package/dist/core/memory-engine/mount-failed-notice.js +22 -0
- package/dist/core/memory-engine/origin-clearance.d.ts +15 -1
- package/dist/core/memory-engine/origin-clearance.js +30 -10
- package/dist/core/memory-engine/scan.js +1 -1
- package/dist/core/memory-engine/scope-contract.js +4 -3
- package/dist/core/memory-engine/session-write-home.js +13 -1
- package/dist/core/memory-engine/sync-client.d.ts +1 -1
- package/dist/core/memory-engine/sync-client.js +3 -1
- package/dist/core/memory-engine/tools.d.ts +5 -4
- package/dist/core/memory-engine/tools.js +1 -1
- package/dist/core/memory-engine/types.d.ts +18 -1
- package/dist/core/memory-engine/types.js +1 -0
- package/dist/core/memory.d.ts +1 -1
- package/dist/core/memory.js +2 -6
- package/dist/core/mode-policy.d.ts +8 -1
- package/dist/core/mode-policy.js +6 -2
- package/dist/core/model-fallbacks.d.ts +103 -0
- package/dist/core/model-fallbacks.js +79 -0
- package/dist/core/model-receipt.d.ts +15 -3
- package/dist/core/model-receipt.js +22 -1
- package/dist/core/model-seat.d.ts +1 -1
- package/dist/core/mods/classic-events.d.ts +5 -1
- package/dist/core/mods/dollar.d.ts +47 -2
- package/dist/core/mods/dollar.js +28 -5
- package/dist/core/mods/kernel/budget.d.ts +6 -0
- package/dist/core/mods/kernel/budget.js +6 -0
- package/dist/core/mods/kernel/dispatch.d.ts +23 -2
- package/dist/core/mods/kernel/dispatch.js +104 -15
- package/dist/core/mods/kernel/events.d.ts +18 -1
- package/dist/core/mods/kernel/events.js +7 -6
- package/dist/core/mods/kernel/index.d.ts +2 -2
- package/dist/core/mods/kernel/index.js +1 -1
- package/dist/core/mods/kernel/receive.d.ts +2 -1
- package/dist/core/mods/lifecycle-stations.d.ts +13 -4
- package/dist/core/mods/lifecycle-stations.js +8 -3
- package/dist/core/mods/message-display.d.ts +81 -0
- package/dist/core/mods/message-display.js +369 -0
- package/dist/core/mods/prompt-submit.d.ts +1 -1
- package/dist/core/mods/prompt-submit.js +5 -2
- package/dist/core/mods/session-append.d.ts +2 -2
- package/dist/core/mods/session-append.js +2 -1
- package/dist/core/mods/session-compact.js +2 -2
- package/dist/core/mods/stations.d.ts +48 -18
- package/dist/core/mods/stations.js +100 -19
- package/dist/core/mods/stop-answers.d.ts +23 -0
- package/dist/core/mods/stop-answers.js +20 -0
- package/dist/core/mounted-mcp.d.ts +48 -8
- package/dist/core/mounted-mcp.js +82 -16
- package/dist/core/namespaced-rule-name.js +2 -1
- package/dist/core/own-property-receipt.js +3 -5
- package/dist/core/parent-spec-seat.d.ts +20 -1
- package/dist/core/parent-spec-seat.js +13 -3
- package/dist/core/park-selfcheck.js +1 -0
- package/dist/core/path-identity.js +2 -1
- package/dist/core/peer-seat.d.ts +21 -7
- package/dist/core/peer-seat.js +25 -16
- package/dist/core/permission-rule-consent.js +15 -5
- package/dist/core/permission-rule-model.d.ts +4 -2
- package/dist/core/permission-rule-model.js +43 -23
- package/dist/core/permission-rule-store.d.ts +31 -16
- package/dist/core/permission-rule-store.js +27 -18
- package/dist/core/present-plan-tool.d.ts +6 -1
- package/dist/core/present-plan-tool.js +11 -3
- package/dist/core/pricing.d.ts +8 -6
- package/dist/core/pricing.js +1 -1
- package/dist/core/principal-name.d.ts +13 -0
- package/dist/core/principal-name.js +9 -2
- package/dist/core/process-identity.d.ts +140 -0
- package/dist/core/process-identity.js +215 -0
- package/dist/core/protocol-http-auth.d.ts +28 -6
- package/dist/core/protocol-http-auth.js +22 -5
- package/dist/core/protocol-naming.d.ts +7 -0
- package/dist/core/protocol-naming.js +12 -2
- package/dist/core/protocol-revocation.d.ts +72 -0
- package/dist/core/protocol-revocation.js +98 -0
- package/dist/core/protocol-table.d.ts +4 -4
- package/dist/core/protocol-table.js +3 -2
- package/dist/core/push-queue.d.ts +35 -2
- package/dist/core/push-queue.js +60 -4
- package/dist/core/read-only-shell.d.ts +19 -0
- package/dist/core/read-only-shell.js +38 -11
- package/dist/core/real-approval.d.ts +26 -0
- package/dist/core/real-approval.js +15 -0
- package/dist/core/redaction-marks.d.ts +6 -2
- package/dist/core/redaction-marks.js +3 -0
- package/dist/core/reminder-mint.d.ts +6 -0
- package/dist/core/reminder-mint.js +9 -8
- package/dist/core/remote-env.d.ts +31 -15
- package/dist/core/remote-env.js +29 -0
- package/dist/core/request-copy-projection.d.ts +51 -0
- package/dist/core/request-copy-projection.js +410 -0
- package/dist/core/resume-config-judge.d.ts +69 -0
- package/dist/core/resume-config-judge.js +78 -0
- package/dist/core/resume-startup-cause.d.ts +14 -4
- package/dist/core/resume-startup-cause.js +12 -2
- package/dist/core/retention-policy.js +2 -1
- package/dist/core/retention.d.ts +119 -24
- package/dist/core/retention.js +60 -16
- package/dist/core/retired-keys.d.ts +0 -10
- package/dist/core/retired-keys.js +2 -3
- package/dist/core/roles.d.ts +6 -0
- package/dist/core/roles.js +65 -4
- package/dist/core/row-shape.d.ts +149 -0
- package/dist/core/row-shape.js +184 -0
- package/dist/core/runner/advertised-writable-dirs.js +10 -9
- package/dist/core/runner/advisor-instructions.d.ts +11 -27
- package/dist/core/runner/advisor-instructions.js +18 -20
- package/dist/core/runner/advisor-tool.js +1 -0
- package/dist/core/runner/announce-once-ledger.js +4 -1
- package/dist/core/runner/approval-feedback.d.ts +17 -8
- package/dist/core/runner/approval-feedback.js +18 -13
- package/dist/core/runner/approver-defect-announcer.d.ts +17 -0
- package/dist/core/runner/approver-defect-announcer.js +22 -0
- package/dist/core/runner/assemble-result.d.ts +29 -14
- package/dist/core/runner/assemble-result.js +16 -25
- package/dist/core/runner/cache-hit-account.d.ts +77 -0
- package/dist/core/runner/cache-hit-account.js +46 -0
- package/dist/core/runner/call-hook-stations.d.ts +3 -2
- package/dist/core/runner/call-hook-stations.js +5 -4
- package/dist/core/runner/changed-files-scan.d.ts +43 -0
- package/dist/core/runner/changed-files-scan.js +34 -0
- package/dist/core/runner/checkpoint-scope.d.ts +33 -9
- package/dist/core/runner/checkpoint-scope.js +27 -1
- package/dist/core/runner/classifier-ladder.d.ts +2 -2
- package/dist/core/runner/classifier-ladder.js +18 -9
- package/dist/core/runner/clock-and-limits.d.ts +15 -4
- package/dist/core/runner/clock-and-limits.js +19 -1
- package/dist/core/runner/compact-session.js +84 -14
- package/dist/core/runner/compaction-call-options.d.ts +2 -29
- package/dist/core/runner/compaction-call-options.js +2 -9
- package/dist/core/runner/compaction-restate.d.ts +18 -2
- package/dist/core/runner/compaction-restate.js +36 -2
- package/dist/core/runner/construction-doors.js +8 -0
- package/dist/core/runner/context-room.d.ts +55 -0
- package/dist/core/runner/context-room.js +71 -0
- package/dist/core/runner/contracts.d.ts +313 -205
- package/dist/core/runner/conversation-segment.d.ts +49 -14
- package/dist/core/runner/conversation-segment.js +92 -19
- package/dist/core/runner/cross-boundary-lane.d.ts +4 -0
- package/dist/core/runner/cross-boundary-lane.js +9 -6
- package/dist/core/runner/decide-continuation.js +1 -1
- package/dist/core/runner/deferred-ask.d.ts +62 -0
- package/dist/core/runner/deferred-ask.js +44 -0
- package/dist/core/runner/delegation-owner.d.ts +19 -0
- package/dist/core/runner/delegation-owner.js +27 -1
- package/dist/core/runner/denial-limit-arms.d.ts +10 -6
- package/dist/core/runner/denial-limit-arms.js +13 -7
- package/dist/core/runner/env-capability-census.d.ts +1 -1
- package/dist/core/runner/file-history-request.js +2 -1
- package/dist/core/runner/file-history-restore.d.ts +16 -2
- package/dist/core/runner/file-history-restore.js +9 -1
- package/dist/core/runner/gate-exit.d.ts +18 -5
- package/dist/core/runner/gate-exit.js +26 -15
- package/dist/core/runner/git-status-frame.d.ts +26 -8
- package/dist/core/runner/git-status-frame.js +14 -9
- package/dist/core/runner/halt-attribution.d.ts +29 -12
- package/dist/core/runner/halt-attribution.js +38 -11
- package/dist/core/runner/image.js +3 -2
- package/dist/core/runner/initial-run-state.d.ts +1 -1
- package/dist/core/runner/initial-run-state.js +4 -4
- package/dist/core/runner/language-frame.d.ts +66 -0
- package/dist/core/runner/language-frame.js +76 -0
- package/dist/core/runner/leg-frame.d.ts +81 -0
- package/dist/core/runner/leg-frame.js +68 -0
- package/dist/core/runner/main-call-account.d.ts +34 -0
- package/dist/core/runner/main-call-account.js +50 -0
- package/dist/core/runner/mcp-redial.d.ts +9 -7
- package/dist/core/runner/mcp-redial.js +20 -21
- package/dist/core/runner/memory-consolidation-driver.d.ts +2 -0
- package/dist/core/runner/memory-consolidation-driver.js +5 -3
- package/dist/core/runner/messages-omitted-seat.d.ts +2 -0
- package/dist/core/runner/messages-omitted-seat.js +21 -0
- package/dist/core/runner/model-fallback-seat.d.ts +20 -0
- package/dist/core/runner/model-fallback-seat.js +43 -0
- package/dist/core/runner/model-lane-seat.d.ts +12 -0
- package/dist/core/runner/model-lane-seat.js +35 -0
- package/dist/core/runner/nested-memory-content.d.ts +33 -0
- package/dist/core/runner/nested-memory-content.js +171 -0
- package/dist/core/runner/nested-memory-lane.d.ts +181 -0
- package/dist/core/runner/nested-memory-lane.js +673 -0
- package/dist/core/runner/park-commit.d.ts +7 -0
- package/dist/core/runner/park-commit.js +3 -0
- package/dist/core/runner/prepare-advisor.d.ts +7 -9
- package/dist/core/runner/prepare-advisor.js +11 -5
- package/dist/core/runner/prepare-artifact.d.ts +1 -1
- package/dist/core/runner/prepare-artifact.js +8 -3
- package/dist/core/runner/prepare-ask-lane.d.ts +21 -3
- package/dist/core/runner/prepare-ask-lane.js +32 -28
- package/dist/core/runner/prepare-boundary-parks.d.ts +2 -2
- package/dist/core/runner/prepare-boundary-parks.js +21 -17
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +10 -2
- package/dist/core/runner/prepare-caps-and-workflow.js +24 -18
- package/dist/core/runner/prepare-config-doors.d.ts +51 -5
- package/dist/core/runner/prepare-config-doors.js +73 -73
- package/dist/core/runner/prepare-context-lane.d.ts +68 -3
- package/dist/core/runner/prepare-context-lane.js +137 -27
- package/dist/core/runner/prepare-defer-classify.d.ts +0 -4
- package/dist/core/runner/prepare-defer-classify.js +9 -13
- package/dist/core/runner/prepare-delegation-surface.d.ts +8 -8
- package/dist/core/runner/prepare-delegation-surface.js +72 -64
- package/dist/core/runner/prepare-execution-env.js +1 -9
- package/dist/core/runner/prepare-file-history.d.ts +3 -2
- package/dist/core/runner/prepare-file-history.js +11 -4
- package/dist/core/runner/prepare-gate-stations.d.ts +21 -11
- package/dist/core/runner/prepare-gate-stations.js +13 -13
- package/dist/core/runner/prepare-hands-readface.d.ts +23 -6
- package/dist/core/runner/prepare-hands-readface.js +18 -12
- package/dist/core/runner/prepare-inherited-gate.d.ts +12 -5
- package/dist/core/runner/prepare-inherited-gate.js +14 -10
- package/dist/core/runner/prepare-lsp.js +2 -1
- package/dist/core/runner/prepare-memory-engine-session.js +30 -10
- package/dist/core/runner/prepare-memory.d.ts +4 -0
- package/dist/core/runner/prepare-memory.js +38 -16
- package/dist/core/runner/prepare-offload-wrappers.d.ts +3 -16
- package/dist/core/runner/prepare-offload-wrappers.js +6 -5
- package/dist/core/runner/prepare-park-ask.d.ts +11 -3
- package/dist/core/runner/prepare-park-ask.js +23 -19
- package/dist/core/runner/prepare-policy-chain.d.ts +17 -3
- package/dist/core/runner/prepare-policy-chain.js +144 -120
- package/dist/core/runner/prepare-project-context.d.ts +15 -53
- package/dist/core/runner/prepare-project-context.js +20 -83
- package/dist/core/runner/prepare-prompt-assembly.d.ts +7 -1
- package/dist/core/runner/prepare-prompt-assembly.js +9 -7
- package/dist/core/runner/prepare-prompt-inputs.d.ts +9 -3
- package/dist/core/runner/prepare-prompt-inputs.js +5 -3
- package/dist/core/runner/prepare-protocol-tools.d.ts +9 -4
- package/dist/core/runner/prepare-protocol-tools.js +46 -27
- package/dist/core/runner/prepare-question-face.d.ts +6 -5
- package/dist/core/runner/prepare-question-face.js +7 -6
- package/dist/core/runner/prepare-suspend-saga.d.ts +3 -0
- package/dist/core/runner/prepare-suspend-saga.js +1 -1
- package/dist/core/runner/prepare-task.d.ts +3 -3
- package/dist/core/runner/prepare-task.js +113 -61
- package/dist/core/runner/prepare-tool-disclosure-mount.js +6 -5
- package/dist/core/runner/prepare-turn-wiring.d.ts +33 -7
- package/dist/core/runner/prepare-turn-wiring.js +53 -17
- package/dist/core/runner/prepare-wiring-manifest.d.ts +42 -5
- package/dist/core/runner/prepare-wiring-manifest.js +81 -42
- package/dist/core/runner/prepare-workspace-restore.js +3 -2
- package/dist/core/runner/read-root-grant.js +2 -1
- package/dist/core/runner/reply-pricing.d.ts +31 -18
- package/dist/core/runner/reply-pricing.js +10 -15
- package/dist/core/runner/resume-admission.js +10 -15
- package/dist/core/runner/resume-apply.js +20 -9
- package/dist/core/runner/resume-checkpoint-screen.js +2 -4
- package/dist/core/runner/resume-internals-and-config.d.ts +12 -9
- package/dist/core/runner/resume-internals-and-config.js +37 -9
- package/dist/core/runner/resume-preflight.js +3 -3
- package/dist/core/runner/retired-runner-deps.js +3 -0
- package/dist/core/runner/rewind-files.js +6 -6
- package/dist/core/runner/run-attachment-seats.d.ts +1 -3
- package/dist/core/runner/run-attachment-seats.js +1 -6
- package/dist/core/runner/run-brain-sinks.d.ts +4 -7
- package/dist/core/runner/run-brain-sinks.js +7 -10
- package/dist/core/runner/run-clock-and-content.d.ts +8 -5
- package/dist/core/runner/run-clock-and-content.js +18 -3
- package/dist/core/runner/run-compaction-machinery.d.ts +8 -4
- package/dist/core/runner/run-compaction-machinery.js +4 -19
- package/dist/core/runner/run-git-lane.d.ts +8 -3
- package/dist/core/runner/run-git-lane.js +5 -3
- package/dist/core/runner/run-harness-handlers.d.ts +4 -1
- package/dist/core/runner/run-harness-handlers.js +70 -45
- package/dist/core/runner/run-identity-wiring.d.ts +6 -0
- package/dist/core/runner/run-identity-wiring.js +17 -8
- package/dist/core/runner/run-leg.d.ts +5 -2
- package/dist/core/runner/run-leg.js +156 -71
- package/dist/core/runner/run-notification-lane.d.ts +1 -1
- package/dist/core/runner/run-notification-lane.js +22 -10
- package/dist/core/runner/run-recovery-lanes.js +8 -6
- package/dist/core/runner/run-settle-and-teardown.d.ts +4 -0
- package/dist/core/runner/run-settle-and-teardown.js +77 -26
- package/dist/core/runner/run-stop-and-final-verify.js +46 -12
- package/dist/core/runner/run-telemetry-and-budget-seats.js +13 -28
- package/dist/core/runner/run-terminal-adoption.d.ts +2 -2
- package/dist/core/runner/run-terminal-adoption.js +14 -9
- package/dist/core/runner/run-tool-mount-facts.js +5 -9
- package/dist/core/runner/run-turn-boundary.d.ts +3 -2
- package/dist/core/runner/run-turn-boundary.js +112 -106
- package/dist/core/runner/runtask.d.ts +28 -8
- package/dist/core/runner/runtask.js +132 -41
- package/dist/core/runner/session-file-state-replay.d.ts +5 -3
- package/dist/core/runner/session-file-state-replay.js +10 -3
- package/dist/core/runner/session-rule-policy.d.ts +3 -3
- package/dist/core/runner/session-verb-doors.d.ts +18 -3
- package/dist/core/runner/session-verb-doors.js +38 -6
- package/dist/core/runner/shell-env-withheld.d.ts +8 -5
- package/dist/core/runner/shell-env-withheld.js +4 -4
- package/dist/core/runner/side-call-account.d.ts +12 -8
- package/dist/core/runner/side-call-account.js +24 -15
- package/dist/core/runner/stream-halt-verbs.js +1 -0
- package/dist/core/runner/stream-mode-verb.js +2 -1
- package/dist/core/runner/stream-settle-backstop.js +4 -1
- package/dist/core/runner/stream-steer-verb.js +35 -19
- package/dist/core/runner/sub-agent-deny-lists.d.ts +47 -11
- package/dist/core/runner/sub-agent-deny-lists.js +140 -39
- package/dist/core/runner/teardown-bounded.d.ts +6 -0
- package/dist/core/runner/teardown-bounded.js +12 -7
- package/dist/core/runner/terminal-account.d.ts +2 -0
- package/dist/core/runner/terminal-account.js +6 -1
- package/dist/core/runner/tool-disclosure.js +2 -1
- package/dist/core/runner/tool-end-body.js +3 -1
- package/dist/core/runner/tool-face-overlay.d.ts +1 -1
- package/dist/core/runner/tool-face-overlay.js +1 -1
- package/dist/core/runner/tool-occurrence.d.ts +34 -9
- package/dist/core/runner/tool-occurrence.js +32 -21
- package/dist/core/runner/tool-progress-lane.d.ts +20 -5
- package/dist/core/runner/tool-progress-lane.js +27 -5
- package/dist/core/runner/tool-result-media-seat.d.ts +15 -4
- package/dist/core/runner/tool-result-media-seat.js +17 -1
- package/dist/core/runner/tool-table-view.js +1 -1
- package/dist/core/runner/turn-attachments.d.ts +44 -71
- package/dist/core/runner/turn-attachments.js +52 -104
- package/dist/core/runner/usage-accounting.d.ts +3 -2
- package/dist/core/runner/usage-accounting.js +3 -2
- package/dist/core/runner/void-verifier-pause.js +1 -1
- package/dist/core/runner-deps.d.ts +42 -158
- package/dist/core/runtime-caps.d.ts +16 -4
- package/dist/core/secret-env.d.ts +20 -3
- package/dist/core/secret-env.js +46 -23
- package/dist/core/sensitive-path-policy.d.ts +8 -0
- package/dist/core/sensitive-path-policy.js +10 -2
- package/dist/core/session-checkout.d.ts +32 -27
- package/dist/core/session-checkout.js +109 -61
- package/dist/core/session-log-transfer.js +2 -1
- package/dist/core/session-policy-store.d.ts +24 -11
- package/dist/core/session-policy-store.js +11 -2
- package/dist/core/session-store.d.ts +16 -2
- package/dist/core/session-store.js +43 -17
- package/dist/core/session.d.ts +31 -3
- package/dist/core/session.js +33 -2
- package/dist/core/shell-run-candidates.d.ts +20 -8
- package/dist/core/shell-run-candidates.js +44 -21
- package/dist/core/side-query.d.ts +17 -5
- package/dist/core/side-query.js +17 -14
- package/dist/core/skill-grant.js +2 -3
- package/dist/core/skills-directory.js +3 -66
- package/dist/core/snapshot-frame-seat.d.ts +8 -0
- package/dist/core/snapshot-frame-seat.js +24 -0
- package/dist/core/steer-replay.d.ts +19 -3
- package/dist/core/steer-replay.js +8 -1
- package/dist/core/store-contracts/background-agent-store-contract.d.ts +17 -2
- package/dist/core/store-contracts/background-agent-store-contract.js +131 -2
- package/dist/core/store-contracts/checkpoint-store-contract.js +63 -1
- package/dist/core/store-contracts/mailbox-store-contract.d.ts +15 -2
- package/dist/core/store-contracts/mailbox-store-contract.js +213 -3
- package/dist/core/store-contracts/permission-rule-write-contract.js +24 -0
- package/dist/core/store-contracts/session-deletion-cascade-contract.d.ts +15 -0
- package/dist/core/store-contracts/session-deletion-cascade-contract.js +288 -0
- package/dist/core/store-contracts/session-policy-store-contract.js +57 -36
- package/dist/core/store-contracts/session-repo-contract.js +130 -5
- package/dist/core/store-contracts/session-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/session-store-contract.js +17 -0
- package/dist/core/store-contracts/task-list-store-contract.d.ts +32 -0
- package/dist/core/store-contracts/task-list-store-contract.js +240 -0
- package/dist/core/store-contracts/tool-result-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/tool-result-store-contract.js +41 -0
- package/dist/core/stub-env.d.ts +2 -2
- package/dist/core/stub-env.js +1 -0
- package/dist/core/synthetic-read-verdict.d.ts +38 -28
- package/dist/core/synthetic-read-verdict.js +19 -28
- package/dist/core/task-event.d.ts +171 -19
- package/dist/core/task-intake.d.ts +26 -0
- package/dist/core/task-intake.js +31 -0
- package/dist/core/task-limits.d.ts +8 -6
- package/dist/core/task-notification.d.ts +88 -8
- package/dist/core/task-notification.js +45 -5
- package/dist/core/task-registry-agent.d.ts +24 -7
- package/dist/core/task-registry-agent.js +51 -28
- package/dist/core/task-registry-monitor.js +16 -14
- package/dist/core/task-registry-shared.d.ts +177 -35
- package/dist/core/task-registry-shared.js +44 -17
- package/dist/core/task-registry-workflow.js +8 -5
- package/dist/core/task-registry-yield.d.ts +32 -0
- package/dist/core/task-registry-yield.js +85 -0
- package/dist/core/task-registry.d.ts +88 -10
- package/dist/core/task-registry.js +124 -33
- package/dist/core/task-result.d.ts +115 -31
- package/dist/core/task-spec-members.d.ts +140 -1
- package/dist/core/task-spec-members.js +23 -8
- package/dist/core/task-spec.d.ts +181 -51
- package/dist/core/task-spec.js +1 -1
- package/dist/core/task-stream.d.ts +12 -2
- package/dist/core/terminal-cause.d.ts +12 -4
- package/dist/core/thrown-value.d.ts +49 -7
- package/dist/core/thrown-value.js +38 -2
- package/dist/core/tool-catalog-entries.js +13 -3
- package/dist/core/tool-data-door.d.ts +7 -0
- package/dist/core/tool-data-door.js +13 -0
- package/dist/core/tool-face-lists.d.ts +25 -0
- package/dist/core/tool-face-lists.js +38 -0
- package/dist/core/tool-face-reader.d.ts +0 -10
- package/dist/core/tool-face-reader.js +5 -3
- package/dist/core/tool-list-grammar.d.ts +103 -0
- package/dist/core/tool-list-grammar.js +130 -0
- package/dist/core/tool-mount-facts.d.ts +47 -0
- package/dist/core/tool-mount-facts.js +50 -0
- package/dist/core/tool-mount-plan.d.ts +196 -0
- package/dist/core/tool-mount-plan.js +404 -0
- package/dist/core/tool-mount-static.d.ts +12 -0
- package/dist/core/tool-mount-static.js +174 -0
- package/dist/core/tool-name-aliases.d.ts +60 -2
- package/dist/core/tool-name-aliases.js +22 -2
- package/dist/core/tool-name-list.d.ts +3 -0
- package/dist/core/tool-name-readings.d.ts +4 -0
- package/dist/core/tool-name-readings.js +1 -0
- package/dist/core/tool-policy.d.ts +246 -51
- package/dist/core/tool-policy.js +165 -71
- package/dist/core/tool-registry.d.ts +4 -11
- package/dist/core/tool-registry.js +0 -3
- package/dist/core/tool-result-bytes.d.ts +94 -0
- package/dist/core/tool-result-bytes.js +34 -0
- package/dist/core/tool-result-store.d.ts +97 -13
- package/dist/core/tool-result-store.js +52 -4
- package/dist/core/tool-roster.d.ts +71 -10
- package/dist/core/tool-roster.js +71 -21
- package/dist/core/tool-search-setting.d.ts +7 -9
- package/dist/core/tool-search-setting.js +23 -7
- package/dist/core/tool-spec.d.ts +32 -2
- package/dist/core/tools.js +6 -20
- package/dist/core/trace.d.ts +63 -11
- package/dist/core/trace.js +19 -0
- package/dist/core/types.d.ts +8 -6
- package/dist/core/types.js +3 -1
- package/dist/core/unmatched-tool-names.d.ts +37 -0
- package/dist/core/unmatched-tool-names.js +18 -0
- package/dist/core/untrusted-egress.d.ts +16 -5
- package/dist/core/untrusted-egress.js +202 -32
- package/dist/core/untrusted-text.d.ts +29 -8
- package/dist/core/untrusted-text.js +6 -3
- package/dist/core/user-attachment.d.ts +129 -35
- package/dist/core/user-attachment.js +124 -57
- package/dist/core/user-row-origin.d.ts +63 -0
- package/dist/core/user-row-origin.js +61 -0
- package/dist/core/wiring-manifest.d.ts +161 -39
- package/dist/core/wiring-manifest.js +42 -6
- package/dist/core/workflow-run-store-contract.d.ts +11 -1
- package/dist/core/workflow-run-store-contract.js +60 -7
- package/dist/core/workflow-run-store.d.ts +61 -12
- package/dist/core/workflow-run-store.js +100 -15
- package/dist/core/workspace-snapshot.d.ts +10 -14
- package/dist/core/workspace-snapshot.js +3 -22
- package/dist/core/write-protect.d.ts +3 -5
- package/dist/core/write-protect.js +2 -4
- package/dist/engine/compaction/compaction.d.ts +3 -0
- package/dist/engine/compaction/compaction.js +4 -3
- package/dist/engine/execution-env/node-execution-env.d.ts +15 -4
- package/dist/engine/execution-env/node-execution-env.js +80 -27
- package/dist/engine/harness/agent-harness.d.ts +143 -27
- package/dist/engine/harness/agent-harness.js +162 -74
- package/dist/engine/harness/types.d.ts +84 -13
- package/dist/engine/harness/types.js +21 -1
- package/dist/engine/llm/tool-turns.d.ts +4 -0
- package/dist/engine/llm/tool-turns.js +7 -2
- package/dist/engine/llm/types.d.ts +111 -24
- package/dist/engine/llm/types.js +69 -5
- package/dist/engine/llm/validation.js +2 -1
- package/dist/engine/loop/agent-loop.d.ts +39 -6
- package/dist/engine/loop/agent-loop.js +172 -82
- package/dist/engine/loop/types.d.ts +43 -4
- package/dist/engine/lsp/node-lsp-manager.d.ts +5 -3
- package/dist/engine/lsp/node-lsp-manager.js +14 -10
- package/dist/engine/session/import-validate.js +9 -0
- package/dist/engine/session/memory-repo.d.ts +8 -1
- package/dist/engine/session/memory-repo.js +20 -12
- package/dist/engine/session/repo-utils.d.ts +10 -0
- package/dist/engine/session/repo-utils.js +11 -5
- package/dist/engine/session/row-cells.d.ts +32 -0
- package/dist/engine/session/row-cells.js +25 -0
- package/dist/index.d.ts +63 -34
- package/dist/index.js +44 -21
- package/dist/internal/harness.d.ts +8 -6
- package/dist/internal/harness.js +6 -4
- package/dist/internal/llm.d.ts +2 -2
- package/dist/internal/llm.js +1 -1
- package/dist/orchestration/governance-baseline-validity.d.ts +7 -0
- package/dist/orchestration/governance-baseline-validity.js +33 -9
- package/dist/orchestration/run-workflow-tool.d.ts +2 -0
- package/dist/orchestration/run-workflow-tool.js +25 -12
- package/dist/orchestration/workflow-governance.d.ts +19 -4
- package/dist/orchestration/workflow-governance.js +30 -9
- package/dist/orchestration/workflow-primitives.d.ts +4 -1
- package/dist/orchestration/workflow-primitives.js +2 -2
- package/dist/orchestration/workflow-script-runner.d.ts +1 -1
- package/dist/orchestration/workflow-size-guideline.d.ts +1 -1
- package/dist/orchestration/workflow-types.d.ts +21 -12
- package/dist/orchestration/workflow-types.js +15 -4
- package/dist/orchestration/workflow.d.ts +37 -7
- package/dist/orchestration/workflow.js +81 -35
- package/dist/prompt-assembly/artifact-store.js +6 -9
- package/dist/prompt-assembly/assemble.d.ts +4 -10
- package/dist/prompt-assembly/assemble.js +1 -3
- package/dist/prompt-assembly/catalog/constitution.d.ts +0 -20
- package/dist/prompt-assembly/catalog/constitution.js +2 -0
- package/dist/prompt-assembly/catalog/core-behavior.js +5 -3
- package/dist/prompt-assembly/catalog/engine.d.ts +108 -0
- package/dist/prompt-assembly/catalog/engine.js +19 -0
- package/dist/prompt-assembly/catalog/environment.d.ts +276 -0
- package/dist/prompt-assembly/catalog/environment.js +61 -0
- package/dist/prompt-assembly/catalog/index.d.ts +9 -2
- package/dist/prompt-assembly/catalog/index.js +73 -2
- package/dist/prompt-assembly/catalog/locales/index.d.ts +16 -0
- package/dist/prompt-assembly/catalog/locales/index.js +22 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/constitution.d.ts +7 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/constitution.js +124 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/core-behavior.d.ts +6 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/core-behavior.js +120 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/cowork.d.ts +8 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/cowork.js +442 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.d.ts +7 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.js +15 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/environment.d.ts +7 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/environment.js +50 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/modes.d.ts +7 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/modes.js +163 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/role.d.ts +7 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/role.js +148 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/team.d.ts +6 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/team.js +246 -0
- package/dist/prompt-assembly/catalog/role.js +3 -6
- package/dist/prompt-assembly/catalog/schema.d.ts +23 -1
- package/dist/prompt-assembly/catalog/schema.js +2 -0
- package/dist/prompt-assembly/composer.d.ts +6 -11
- package/dist/prompt-assembly/composer.js +7 -7
- package/dist/prompt-assembly/engine-text.d.ts +9 -0
- package/dist/prompt-assembly/engine-text.js +33 -0
- package/dist/prompt-assembly/event-registry.js +3 -3
- package/dist/prompt-assembly/explain.d.ts +1 -0
- package/dist/prompt-assembly/explain.js +1 -1
- package/dist/prompt-assembly/locale-review.d.ts +13 -0
- package/dist/prompt-assembly/locale-review.js +19 -0
- package/dist/prompt-assembly/overlay.d.ts +7 -3
- package/dist/prompt-assembly/overlay.js +27 -5
- package/dist/prompt-assembly/renderers.d.ts +4 -4
- package/dist/prompt-assembly/renderers.js +26 -17
- package/dist/prompt-assembly/role-base.d.ts +1 -1
- package/dist/prompt-assembly/select.d.ts +26 -5
- package/dist/prompt-assembly/select.js +25 -2
- package/dist/prompt-assembly/slots.d.ts +19 -0
- package/dist/prompt-assembly/slots.js +16 -0
- package/dist/prompt-assembly/sugar.d.ts +4 -7
- package/dist/prompt-assembly/sugar.js +1 -2
- package/dist/prompt-assembly/tool-catalog.d.ts +5 -1
- package/dist/prompt-assembly/tool-catalog.js +5 -1
- package/dist/prompt-assembly/turn-snapshot.d.ts +38 -10
- package/dist/prompt-assembly/turn-snapshot.js +43 -13
- package/dist/prompt-assembly/types.d.ts +3 -0
- package/dist/prompts/cowork.d.ts +6 -25
- package/dist/prompts/cowork.js +10 -12
- package/dist/prompts/default.d.ts +10 -32
- package/dist/prompts/default.js +37 -63
- package/dist/shell/lex.d.ts +39 -13
- package/dist/shell/lex.js +70 -30
- package/dist/stores/file/background-agent-store.d.ts +5 -0
- package/dist/stores/file/background-agent-store.js +35 -61
- package/dist/stores/file/checkpoint-store.d.ts +5 -3
- package/dist/stores/file/checkpoint-store.js +8 -10
- package/dist/stores/file/fs-atomic.d.ts +27 -70
- package/dist/stores/file/fs-atomic.js +52 -148
- package/dist/stores/file/index.d.ts +12 -0
- package/dist/stores/file/index.js +27 -2
- package/dist/stores/file/mailbox-store.d.ts +10 -1
- package/dist/stores/file/mailbox-store.js +40 -12
- package/dist/stores/file/permission-rule-adopt.js +5 -2
- package/dist/stores/file/permission-rule-store.d.ts +81 -20
- package/dist/stores/file/permission-rule-store.js +126 -33
- package/dist/stores/file/session-policy-store.d.ts +2 -2
- package/dist/stores/file/session-store.d.ts +21 -2
- package/dist/stores/file/session-store.js +27 -14
- package/dist/stores/file/task-list-store.js +23 -25
- package/dist/stores/file/tool-result-store.d.ts +45 -7
- package/dist/stores/file/tool-result-store.js +99 -36
- package/dist/stores/file/workflow-run-store.d.ts +1 -0
- package/dist/stores/file/workflow-run-store.js +14 -11
- package/dist/tools/artifact/artifact-tool.js +2 -0
- package/dist/tools/artifact/local-stub.js +6 -6
- package/dist/tools/fs/bash-program-position.d.ts +1 -2
- package/dist/tools/fs/bash-readonly-classifier.d.ts +35 -0
- package/dist/tools/fs/bash-readonly-classifier.js +50 -12
- package/dist/tools/fs/env-error-detail.d.ts +1 -0
- package/dist/tools/fs/env-error-detail.js +7 -0
- package/dist/tools/fs/fs-bash.d.ts +24 -6
- package/dist/tools/fs/fs-bash.js +73 -25
- package/dist/tools/fs/fs-pdf.js +6 -4
- package/dist/tools/fs/fs-read.d.ts +76 -31
- package/dist/tools/fs/fs-read.js +159 -79
- package/dist/tools/fs/fs-search-tools.d.ts +1 -1
- package/dist/tools/fs/fs-search-tools.js +3 -1
- package/dist/tools/fs/fs-shared.d.ts +59 -63
- package/dist/tools/fs/fs-shared.js +31 -18
- package/dist/tools/fs/fs-write.d.ts +13 -0
- package/dist/tools/fs/fs-write.js +69 -13
- package/dist/tools/fs/index.d.ts +19 -1
- package/dist/tools/fs/index.js +10 -2
- package/dist/tools/fs/pdf.js +10 -9
- package/dist/tools/fs/read-deny.js +4 -10
- package/dist/tools/fs/read-floor.d.ts +5 -4
- package/dist/tools/fs/removal-targets.d.ts +11 -5
- package/dist/tools/fs/removal-targets.js +62 -32
- package/dist/tools/fs/safety.d.ts +26 -19
- package/dist/tools/fs/safety.js +13 -8
- package/dist/tools/fs/search.d.ts +1 -1
- package/dist/tools/fs/shell-read-argv.js +1 -0
- package/dist/tools/fs/shell-read-bindings.d.ts +128 -26
- package/dist/tools/fs/shell-read-bindings.js +667 -139
- package/dist/tools/fs/shell-read-check.js +1 -1
- package/dist/tools/fs/shell-read-judge.d.ts +4 -1
- package/dist/tools/fs/shell-read-judge.js +5 -1
- package/dist/tools/fs/shell-read-plan.d.ts +4 -0
- package/dist/tools/fs/shell-read-plan.js +21 -19
- package/dist/tools/fs/shell-read-sourced.d.ts +4 -3
- package/dist/tools/fs/shell-read-sourced.js +18 -1
- package/dist/tools/fs/shell-read-start.d.ts +6 -6
- package/dist/tools/fs/shell-read-start.js +1 -6
- package/dist/tools/fs/shell-read-word.d.ts +4 -2
- package/dist/tools/fs/shell-read-word.js +7 -6
- package/dist/tools/fs/shell-read-workdir.d.ts +1 -1
- package/dist/tools/fs/shell-reentry-text.d.ts +24 -9
- package/dist/tools/fs/shell-reentry-text.js +50 -20
- package/dist/tools/monitor.d.ts +4 -0
- package/dist/tools/monitor.js +14 -4
- package/dist/tools/scheduler-tools.d.ts +5 -2
- package/dist/tools/scheduler-tools.js +8 -6
- package/dist/tools/task-list.d.ts +49 -20
- package/dist/tools/task-list.js +115 -35
- package/dist/tools/web.d.ts +13 -3
- package/dist/tools/web.js +17 -6
- package/dist/tools/worktree.d.ts +3 -2
- package/dist/tools/worktree.js +24 -25
- package/package.json +10 -3
- package/test/export-surface.snapshot.json +330 -32
- package/wire-changes/core-stores-sql@7.67.0.json +39 -0
- package/wire-changes/core@7.67.0.json +12578 -0
- package/wire-changes/mods-kernel@7.67.0.json +167 -0
- package/wire-changes/primitives@7.67.0.json +325 -0
- package/wire-changes/wiki-gate@7.67.0.json +1636 -0
- package/dist/brain/degrading.d.ts +0 -93
- package/dist/brain/degrading.js +0 -189
- package/dist/core/tool-conformance.d.ts +0 -20
- package/dist/core/tool-conformance.js +0 -37
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
2
|
+
import { types } from "node:util";
|
|
2
3
|
import { uuidv7 } from "../internal/harness.js";
|
|
3
4
|
import { PROBE_REASON_MAX, inlineUntrusted, sanitizeUntrustedText } from "./untrusted-text.js";
|
|
4
5
|
import { CheckpointError, checkpointVersionOf, isPlainRecord, normalizeProbeCause, safeDataValue } from "./checkpoint-features.js";
|
|
5
|
-
import {
|
|
6
|
+
import { judgeCheckpointRow, retiredSteerSeatRefusal, UNREADABLE_ROW_VERDICT } from "./checkpoint-row-verdict.js";
|
|
7
|
+
import { boundedThrownName } from "./thrown-value.js";
|
|
6
8
|
import { carriesBidiControls } from "./tool-policy.js";
|
|
7
9
|
import { agentIdOf, legTaskIdOf } from "./leg-identity.js";
|
|
8
10
|
import { isAutoModeFallbackCause, readDenialLimitFallback } from "./auto-mode.js";
|
|
9
|
-
import { isAskOrigin, isPersistedRuleMandate } from "./ask-origin.js";
|
|
11
|
+
import { isAskOrigin, isPersistedRuleMandate, receiveAskReasons } from "./ask-origin.js";
|
|
12
|
+
import { approvalMessageOf } from "./approval-display.js";
|
|
10
13
|
import { isRunOrigin, RUN_ORIGINS } from "./run-origin.js";
|
|
11
14
|
import { describeRejectedValue } from "./tool-search-setting.js";
|
|
12
15
|
import { readBoundBinding } from "./skill-grant-binding.js";
|
|
13
16
|
import { checkpointExecutionRecorded, executionRecordDisposition, ExecutionOutcomeConflictError, } from "./checkpoint-execution-record.js";
|
|
14
17
|
import { checkpointHolderMatches, checkpointOccMatches, checkpointRevOf } from "./checkpoint-generation.js";
|
|
15
18
|
import { isGateKind, parkedApprovalCardOf } from "./pause-registry.js";
|
|
16
|
-
import { checkpointDeadlinePassed, deleteSessionRowsAtStart, readCheckpointOverdueQuery, readCheckpointSessionQuery, rowMemberProblem, selectOverduePage, selectSessionPage } from "./checkpoint-queries.js";
|
|
19
|
+
import { checkpointDeadlinePassed, deleteSessionRowsAtStart, ownerSessionRowsDelete, unreadableSessionRowsDelete, readCheckpointOverdueQuery, readCheckpointSessionQuery, rowMemberProblem, selectOverduePage, selectSessionPage } from "./checkpoint-queries.js";
|
|
17
20
|
import { renderUntrustedCommandText, stripFormatCharacters } from "./permission-rule-model.js";
|
|
18
21
|
import { egressText } from "./untrusted-egress.js";
|
|
19
22
|
import { steerReplayRefusal } from "./steer-replay.js";
|
|
20
23
|
import { readRetentionDeclaration } from "./retention.js";
|
|
21
|
-
import { memberPresent, optionKeys, receiveOptions } from "./own-property-receipt.js";
|
|
24
|
+
import { memberPresent, optionKeys, receiptRefusal, receiveOptions, strayMembersOf } from "./own-property-receipt.js";
|
|
25
|
+
import { describeFault, receive } from "./mods/kernel/receive.js";
|
|
26
|
+
import { isBlankInput, MAX_PENDING_STEER_CHARS, STEERING_CONTROL_CHARS_RE, steeringTextDefect } from "./input-author.js";
|
|
27
|
+
export { MAX_PENDING_STEER_CHARS };
|
|
22
28
|
export { BINDING_CHECKPOINT_VERSION, CHECKPOINT_CONFIG_REFUSAL_CODES, CHECKPOINT_FEATURES, CheckpointError, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, encodeAtFidelity, F012_CHECKPOINT_VERSION, FACE_CHECKPOINT_VERSION, isCheckpointConfigRefusalCode, isPlainRecord, MAX_SUPPORTED_CHECKPOINT_VERSION, normalizeProbeCause, ORG_ADMISSION_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, safeDataValue, TOKEN_CHECKPOINT_VERSION, } from "./checkpoint-features.js";
|
|
23
29
|
export function mintCheckpointToken() {
|
|
24
30
|
return randomBytes(16).toString("hex");
|
|
@@ -52,10 +58,11 @@ const MAX_DIGEST_SCAN_KEYS = 256;
|
|
|
52
58
|
export const MAX_TOOL_INPUT_PREVIEW_CHARS = 512;
|
|
53
59
|
const BIDI_BACKFILL_MAX_CHARS = 32_000;
|
|
54
60
|
const BIDI_BACKFILL_MAX_NODES = 512;
|
|
55
|
-
export const MAX_PENDING_STEER_CHARS = 16_000;
|
|
56
61
|
export const PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES = 48_000;
|
|
57
62
|
export const MAX_PENDING_STEER_ENTRIES = Math.floor(PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES / MAX_PENDING_STEER_CHARS);
|
|
58
|
-
export const PENDING_STEER_FROZEN_FIELDS = Object.freeze(["text", "trusted", "actor", "seq", "inputId", "priority", "runOrigin"]);
|
|
63
|
+
export const PENDING_STEER_FROZEN_FIELDS = Object.freeze(["text", "trusted", "actor", "seq", "inputId", "priority", "runOrigin", "reply", "source"]);
|
|
64
|
+
const PENDING_STEER_REPLY_FROZEN_FIELDS = Object.freeze(["text", "by", "entered"]);
|
|
65
|
+
const PENDING_STEER_REPLY_WORDS = Object.freeze({ subject: "steering reply", unit: "field", moment: "when the entry is persisted" });
|
|
59
66
|
function safeKeys(obj) {
|
|
60
67
|
try {
|
|
61
68
|
return Object.keys(obj);
|
|
@@ -185,10 +192,36 @@ export function remainingTokens(ledger) {
|
|
|
185
192
|
return Math.max(0, total - (spent ?? 0));
|
|
186
193
|
}
|
|
187
194
|
export { REOPEN_REASONS } from "./resume-startup-cause.js";
|
|
195
|
+
const INDEX_TREE_DATA = Object.freeze({ accessors: "refuse", depth: 1, others: "as-is", isProxy: (v) => types.isProxy(v) });
|
|
196
|
+
function indexTreeRefusal(member, value) {
|
|
197
|
+
let why;
|
|
198
|
+
if (value === undefined)
|
|
199
|
+
why = "absent";
|
|
200
|
+
else if (value === null)
|
|
201
|
+
why = "null";
|
|
202
|
+
else if (typeof value !== "object")
|
|
203
|
+
why = `a ${typeof value}`;
|
|
204
|
+
else {
|
|
205
|
+
const received = receive(value, INDEX_TREE_DATA);
|
|
206
|
+
if (!received.ok)
|
|
207
|
+
why = describeFault(received.fault);
|
|
208
|
+
else if (Array.isArray(value))
|
|
209
|
+
why = "a list";
|
|
210
|
+
else if (!isPlainRecord(value))
|
|
211
|
+
why = "an object of another prototype";
|
|
212
|
+
}
|
|
213
|
+
if (why === undefined)
|
|
214
|
+
return undefined;
|
|
215
|
+
return receiptRefusal(`checkpointIndexFacts: the row's ${member} is ${why} — it must be an object of plain data (a record read off its own members: no accessor, no Proxy, no other prototype). The index facts are derived from the gate and the pending action alone, so a row without them is refused before any column is derived.`);
|
|
216
|
+
}
|
|
188
217
|
export function checkpointIndexFacts(cp) {
|
|
189
218
|
const gate = cp.gate;
|
|
219
|
+
const pending = cp.pendingAction;
|
|
220
|
+
const refused = indexTreeRefusal("gate", gate) ?? indexTreeRefusal("pendingAction", pending);
|
|
221
|
+
if (refused !== undefined)
|
|
222
|
+
throw refused;
|
|
190
223
|
const card = parkedApprovalCardOf(gate);
|
|
191
|
-
const tool =
|
|
224
|
+
const tool = pending.kind === "tool_approval" ? pending : undefined;
|
|
192
225
|
return {
|
|
193
226
|
token: cp.token,
|
|
194
227
|
scope: cp.scope,
|
|
@@ -297,6 +330,10 @@ function projectCheckpoint(cp, rowVerdict, disclose) {
|
|
|
297
330
|
token: facts.token,
|
|
298
331
|
rowVerdict,
|
|
299
332
|
...(cp.checkpointId !== undefined ? { checkpointId: cp.checkpointId } : {}),
|
|
333
|
+
...(cp.parentSessionId !== undefined ? { parentSessionId: cp.parentSessionId } : {}),
|
|
334
|
+
...(cp.parentTaskId !== undefined ? { parentTaskId: cp.parentTaskId } : {}),
|
|
335
|
+
...(cp.rootSessionId !== undefined ? { rootSessionId: cp.rootSessionId } : {}),
|
|
336
|
+
...(cp.rootSessionIncarnation !== undefined ? { rootSessionIncarnation: cp.rootSessionIncarnation } : {}),
|
|
300
337
|
sessionId: facts.sessionId,
|
|
301
338
|
scope: facts.scope,
|
|
302
339
|
gateKind: facts.gateKind,
|
|
@@ -331,6 +368,8 @@ function projectCheckpoint(cp, rowVerdict, disclose) {
|
|
|
331
368
|
const why = tool?.classifierNoRuling;
|
|
332
369
|
return { ...(isAskOrigin(origin) ? { origin } : {}), ...(isPersistedRuleMandate(mandate) ? { mandate } : {}), ...(isAutoModeFallbackCause(why) ? { classifierNoRuling: why } : {}) };
|
|
333
370
|
})(),
|
|
371
|
+
...((askReasons) => (askReasons !== undefined ? { askReasons } : {}))(receiveAskReasons(tool?.askReasons)),
|
|
372
|
+
...((cardMessage) => (cardMessage !== undefined ? { cardMessage } : {}))(approvalMessageOf(tool?.cardMessage)),
|
|
334
373
|
...(tool !== undefined ? readBoundBinding(tool) : {}),
|
|
335
374
|
...(hasBidi ? { hasBidiControls: true } : {}),
|
|
336
375
|
};
|
|
@@ -418,7 +457,6 @@ export function winnerFromOutcome(outcome) {
|
|
|
418
457
|
...(outcome.feedback === undefined ? {} : { feedback: outcome.feedback }),
|
|
419
458
|
};
|
|
420
459
|
}
|
|
421
|
-
const CHECKPOINT_CONTROL_CHARS_RE = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/;
|
|
422
460
|
export function validatePendingSteer(steer) {
|
|
423
461
|
if (steer === null || typeof steer !== "object") {
|
|
424
462
|
throw new CheckpointError("steering.invalid_content", `steering entry must be an object carrying text/trusted (got ${steer === null ? "null" : typeof steer})`);
|
|
@@ -436,6 +474,8 @@ export function validatePendingSteer(steer) {
|
|
|
436
474
|
const inputId = steer.inputId;
|
|
437
475
|
const priority = steer.priority;
|
|
438
476
|
const runOrigin = steer.runOrigin;
|
|
477
|
+
const reply = steer.reply;
|
|
478
|
+
const source = steer.source;
|
|
439
479
|
if (typeof text !== "string") {
|
|
440
480
|
throw new CheckpointError("steering.invalid_content", "steering text must be a string");
|
|
441
481
|
}
|
|
@@ -451,17 +491,25 @@ export function validatePendingSteer(steer) {
|
|
|
451
491
|
if (runOrigin !== undefined && !isRunOrigin(runOrigin)) {
|
|
452
492
|
throw new CheckpointError("steering.invalid_content", `steering runOrigin ${describeRejectedValue(runOrigin)} is not a run origin (${RUN_ORIGINS.map((w) => JSON.stringify(w)).join(" | ")}) — omit it when the deployment's scheduler did not hand this input`);
|
|
453
493
|
}
|
|
494
|
+
if (source !== undefined && source !== "steer" && source !== "system") {
|
|
495
|
+
throw new CheckpointError("steering.invalid_content", `steering source ${describeRejectedValue(source)} is not "steer" or "system"`);
|
|
496
|
+
}
|
|
454
497
|
const actorTwin = actor === undefined ? undefined : captureActorAssertion(actor);
|
|
498
|
+
const replyTwin = reply === undefined ? undefined : capturePendingSteerReply(reply);
|
|
499
|
+
if (replyTwin !== undefined && priority !== "later") {
|
|
500
|
+
throw new CheckpointError("steering.invalid_content", 'a steering reply rides only an entry whose priority is "later"');
|
|
501
|
+
}
|
|
455
502
|
if (inputId !== undefined && (inputId === "" || inputId.length > MAX_STEER_INPUT_ID_CHARS)) {
|
|
456
503
|
throw new CheckpointError("steering.invalid_content", `steering inputId must be a non-empty string of at most ${MAX_STEER_INPUT_ID_CHARS} characters`);
|
|
457
504
|
}
|
|
458
|
-
|
|
505
|
+
const defect = steeringTextDefect(text);
|
|
506
|
+
if (defect === "break_out_tag") {
|
|
459
507
|
throw new CheckpointError("steering.invalid_content", "steering text must not contain a system-reminder break-out tag");
|
|
460
508
|
}
|
|
461
|
-
if (
|
|
509
|
+
if (defect === "control_chars") {
|
|
462
510
|
throw new CheckpointError("steering.invalid_content", "steering text must not contain control characters");
|
|
463
511
|
}
|
|
464
|
-
if (
|
|
512
|
+
if (defect === "too_long") {
|
|
465
513
|
throw new CheckpointError("steering.invalid_content", `steering text must be at most ${MAX_PENDING_STEER_CHARS} characters (got ${text.length})`);
|
|
466
514
|
}
|
|
467
515
|
return {
|
|
@@ -471,8 +519,39 @@ export function validatePendingSteer(steer) {
|
|
|
471
519
|
inputId: inputId ?? uuidv7(),
|
|
472
520
|
...(priority !== undefined ? { priority: priority } : {}),
|
|
473
521
|
...(runOrigin !== undefined ? { runOrigin } : {}),
|
|
522
|
+
...(replyTwin !== undefined ? { reply: replyTwin } : {}),
|
|
523
|
+
...(source !== undefined ? { source } : {}),
|
|
474
524
|
};
|
|
475
525
|
}
|
|
526
|
+
function capturePendingSteerReply(reply) {
|
|
527
|
+
if (reply === null || typeof reply !== "object") {
|
|
528
|
+
throw new CheckpointError("steering.invalid_content", `steering reply must be an object carrying text/by (got ${reply === null ? "null" : typeof reply})`);
|
|
529
|
+
}
|
|
530
|
+
const stray = strayMembersOf(reply, PENDING_STEER_REPLY_WORDS, PENDING_STEER_REPLY_FROZEN_FIELDS);
|
|
531
|
+
if (stray !== undefined)
|
|
532
|
+
throw new CheckpointError("steering.invalid_content", stray.sentence);
|
|
533
|
+
const supplied = reply;
|
|
534
|
+
const text = supplied.text;
|
|
535
|
+
const by = supplied.by;
|
|
536
|
+
const entered = supplied.entered;
|
|
537
|
+
for (const [field, value] of [
|
|
538
|
+
["text", text],
|
|
539
|
+
["entered", entered],
|
|
540
|
+
]) {
|
|
541
|
+
if (field === "entered" && value === undefined)
|
|
542
|
+
continue;
|
|
543
|
+
if (typeof value !== "string" || isBlankInput(value)) {
|
|
544
|
+
throw new CheckpointError("steering.invalid_content", `steering reply.${field} must be a non-empty string`);
|
|
545
|
+
}
|
|
546
|
+
if (steeringTextDefect(value) !== undefined) {
|
|
547
|
+
throw new CheckpointError("steering.invalid_content", `steering reply.${field} must not contain control characters or a system-reminder break-out tag, and must be at most ${MAX_PENDING_STEER_CHARS} characters`);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
if (typeof by !== "string" || by === "" || by.length > MAX_ACTOR_FIELD_CHARS || STEERING_CONTROL_CHARS_RE.test(by)) {
|
|
551
|
+
throw new CheckpointError("steering.invalid_content", `steering reply.by must name the registration that answered (a non-empty string of at most ${MAX_ACTOR_FIELD_CHARS} characters, no control characters)`);
|
|
552
|
+
}
|
|
553
|
+
return { text: text, by, ...(entered !== undefined ? { entered: entered } : {}) };
|
|
554
|
+
}
|
|
476
555
|
export const MAX_ACTOR_FIELD_CHARS = 256;
|
|
477
556
|
export const MAX_STEER_INPUT_ID_CHARS = 128;
|
|
478
557
|
export const ACTOR_ASSERTION_FROZEN_FIELDS = Object.freeze(["id", "hostAsserted", "issuer"]);
|
|
@@ -505,7 +584,7 @@ function captureActorAssertion(actor) {
|
|
|
505
584
|
]) {
|
|
506
585
|
if (value === undefined)
|
|
507
586
|
continue;
|
|
508
|
-
if (sanitizeUntrustedText(value) !== value ||
|
|
587
|
+
if (sanitizeUntrustedText(value) !== value || STEERING_CONTROL_CHARS_RE.test(value)) {
|
|
509
588
|
throw new CheckpointError("steering.invalid_content", `actor.${field} must not contain control characters or a system-reminder break-out tag`);
|
|
510
589
|
}
|
|
511
590
|
}
|
|
@@ -567,7 +646,9 @@ export class InMemoryCheckpointStore {
|
|
|
567
646
|
this.fence = Object.freeze({ holder: true });
|
|
568
647
|
const headOf = opts.sessionHeadOf;
|
|
569
648
|
if (headOf !== undefined) {
|
|
570
|
-
|
|
649
|
+
const remove = (token, row) => this.cps.get(token) === row && this.cps.delete(token);
|
|
650
|
+
this.deleteSessionCheckpoints = async (sessionId, guard) => deleteSessionRowsAtStart(this.cps, ownerSessionRowsDelete(sessionId, guard, headOf), remove);
|
|
651
|
+
this.deleteUnreadableSessionCheckpoints = async (sessionId) => deleteSessionRowsAtStart(this.cps, unreadableSessionRowsDelete(sessionId, headOf), remove);
|
|
571
652
|
}
|
|
572
653
|
}
|
|
573
654
|
async put(token, cp) {
|
|
@@ -661,9 +742,9 @@ export class InMemoryCheckpointStore {
|
|
|
661
742
|
cp.executionAtMs = Date.now();
|
|
662
743
|
return "recorded";
|
|
663
744
|
}
|
|
664
|
-
async reopen(token, scope, reason) {
|
|
745
|
+
async reopen(token, scope, reason, expect) {
|
|
665
746
|
const cp = this.cps.get(token);
|
|
666
|
-
if (!checkpointRowMatches(cp, scope, "resolved") || checkpointExecutionRecorded(cp)) {
|
|
747
|
+
if (!checkpointRowMatches(cp, scope, "resolved") || !checkpointOccMatches(cp, expect) || checkpointExecutionRecorded(cp)) {
|
|
667
748
|
return false;
|
|
668
749
|
}
|
|
669
750
|
cp.status = "pending";
|
|
@@ -322,12 +322,20 @@ export declare function clampsReachNoPerson(clamps: {
|
|
|
322
322
|
* (`approvalReach: "none"`) cannot keep that promise — the clamp is the tightening value, so the posture becomes
|
|
323
323
|
* `"headless"` (stated, so the leg's own resolution does not fall through to a deployment default of `"interactive"`);
|
|
324
324
|
* every other posture is returned as it is. Read where an inherited posture meets inherited clamps: the workflow lane
|
|
325
|
-
* (a baseline's posture beside the host's clamps) and the revival fold (the spawn's posture beside the
|
|
325
|
+
* (a baseline's posture beside the host's clamps), the in-process wake and the revival fold (the spawn's posture beside the
|
|
326
|
+
* waker's clamps).
|
|
327
|
+
*
|
|
328
|
+
* `fallsTo` is what a leg that states NO posture of its own resolves to at its door (the spawner's posture, then the
|
|
329
|
+
* deployment's default): when that is `"interactive"` the leg holds the promise just the same, so the clamp states
|
|
330
|
+
* `"headless"` for it — and only then, so a leg whose fall-through is not interactive keeps its key absent (a workflow
|
|
331
|
+
* call's journal identity hashes the whole spec, and only a call the door would have refused changes). A caller that cannot
|
|
332
|
+
* see the fall-through passes `"interactive"`: a stated `"headless"` beside clamps that leave nobody to ask is true whatever
|
|
333
|
+
* the default is. Omitted ⇒ no fall-through is read, and an absent posture stays absent.
|
|
326
334
|
*/
|
|
327
335
|
export declare function postureUnderClamps(posture: "interactive" | "headless" | undefined, clamps: {
|
|
328
336
|
readonly interactiveTools: boolean | undefined;
|
|
329
337
|
readonly approvalReach: TaskSpec["approvalReach"] | undefined;
|
|
330
|
-
}): "interactive" | "headless" | undefined;
|
|
338
|
+
}, fallsTo?: "interactive" | "headless"): "interactive" | "headless" | undefined;
|
|
331
339
|
/**
|
|
332
340
|
* The OWN seats of an engine-built leg that never asks the person (the observer sidecar, the verifier) — ONE declaration
|
|
333
341
|
* the leg's own resolutions read: no human-facing tool is mounted, the leg is headless, and nobody on it can be asked to
|
|
@@ -319,8 +319,8 @@ export const ENGINE_CHILD_SPEC_CONSTRUCTORS = Object.freeze([
|
|
|
319
319
|
export function clampsReachNoPerson(clamps) {
|
|
320
320
|
return clamps.interactiveTools === false || clamps.approvalReach === "none";
|
|
321
321
|
}
|
|
322
|
-
export function postureUnderClamps(posture, clamps) {
|
|
323
|
-
return posture === "interactive" && clampsReachNoPerson(clamps) ? "headless" : posture;
|
|
322
|
+
export function postureUnderClamps(posture, clamps, fallsTo) {
|
|
323
|
+
return (posture ?? fallsTo) === "interactive" && clampsReachNoPerson(clamps) ? "headless" : posture;
|
|
324
324
|
}
|
|
325
325
|
export function engineHeadlessLegSeats() {
|
|
326
326
|
return { interactiveTools: false, approvalReach: "none", interactionPosture: "headless" };
|
|
@@ -4,25 +4,26 @@
|
|
|
4
4
|
* stations, the leg's gate and an ancestor's frozen classifier in the policy fold, so the rule is written once.
|
|
5
5
|
*
|
|
6
6
|
* ONE fork, on the APPROVAL ROUTE the station states (`ApprovalRoute`, the one seat decision — `live_approver`,
|
|
7
|
-
* `durable_park` or `none`): with a
|
|
8
|
-
*
|
|
7
|
+
* `policy_seat`, `durable_park` or `none`): with a decider on the route, the ask goes on carrying why (`classifierNoRuling`, its
|
|
8
|
+
* text saying it too), and that seat settles it — a person's refusal counts nothing (it is a person's), a deployment policy's
|
|
9
|
+
* refusal counts on the denial limit ({@link settleNoRulingAsk}); without one, an unavailable classification is refused with CC's `x1t`
|
|
9
10
|
* sentence (its FORM, `unavailable`, attested on the deny) and is never counted, while a reply with no verdict goes back to
|
|
10
11
|
* the station's ruling path (`counted`): refused with its own sentence and counted on the denial limit, so the bound falls
|
|
11
12
|
* back to a person (CC: `Cr` excludes unavailable; failureMode is counted). The handed-on ask carries `requiresRealApproval`:
|
|
12
|
-
* no automatic lane may answer it in the classifier's stead — not a blanket `onAsk:"allow"`, not
|
|
13
|
-
* budget resolver over its park. Asking where a person can be asked is a declared departure (CC refuses).
|
|
13
|
+
* no automatic lane may answer it in the classifier's stead — not a blanket `onAsk:"allow"`, not an allow from an approver the
|
|
14
|
+
* deployment declared a policy, not the sandbox admission, not a budget resolver over its park. Asking where a person can be asked is a declared departure (CC refuses).
|
|
14
15
|
*
|
|
15
16
|
* The observer hears every such classification with where the call went, except while the call is being aborted — a halt,
|
|
16
17
|
* or the run's end. It is observe-only: a throw never changes the arm.
|
|
17
18
|
*/
|
|
18
19
|
import { type AutoModeClassifierRound, type AutoModeDenialTracker, type AutoModeFallbackCause, type UnarmedDenialLimitFallback } from "./auto-mode.js";
|
|
19
20
|
import { type PermissionResult, type ResolvedAsk, type ToolCallRequest } from "./tool-policy.js";
|
|
20
|
-
import type
|
|
21
|
-
import type
|
|
21
|
+
import { type Settlement } from "./gate-outcome.js";
|
|
22
|
+
import { type ApprovalRoute } from "./approval-route.js";
|
|
22
23
|
/** Where a classification that did not rule sent the call: `asked` = on to the approval seat, `denied` = refused — the
|
|
23
24
|
* projection of the route ({@link classifierUnavailableDispositionOf}), never a second reading of it. */
|
|
24
25
|
export type ClassifierUnavailableDisposition = "asked" | "denied";
|
|
25
|
-
/** The disposition a route projects: a route with a
|
|
26
|
+
/** The disposition a route projects: a route with a decider on it is `asked`, `none` is `denied`. */
|
|
26
27
|
export declare function classifierUnavailableDispositionOf(route: ApprovalRoute): ClassifierUnavailableDisposition;
|
|
27
28
|
/** What the stations' observer receives — the facts the `classifier.unavailable` notice is composed from. `cause` is why
|
|
28
29
|
* the classification did not rule ({@link AutoModeFallbackCause}: `error` / `timeout`, or `parse_error` for a reply with no
|
|
@@ -67,8 +68,9 @@ export declare function classifierNoRulingArm<A extends Extract<PermissionResult
|
|
|
67
68
|
/**
|
|
68
69
|
* The no-ruling card's settlement (both stations): a card THIS station's no-ruling arm handed on for this call (`mintedHere` —
|
|
69
70
|
* a policy's own `classifierNoRuling`, or a card another station minted, is not this station's classification and counts
|
|
70
|
-
* nothing here)
|
|
71
|
-
*
|
|
71
|
+
* nothing here) refused with nobody judging it ({@link SETTLEMENT_NOBODY_JUDGED}: the deployment's policy refused it, a policy's
|
|
72
|
+
* allow was refused on the card's real-approval bit, or nobody could be asked) counts on the denial limit like a ruling refusal,
|
|
73
|
+
* because "handed to a person" means a person settled it. Returns the fallback the count minted when it reached the
|
|
72
74
|
* bound — the station then puts the same call to the same seat as the denial-limit fallback, and a deny nobody judged there
|
|
73
75
|
* stops the run through the existing headless arm. A person's answer (allow or refusal), a fallback card, and every other
|
|
74
76
|
* settlement count nothing.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { classifierNoRulingAskMessage, classifierUnavailableDenyMessage } from "./auto-mode.js";
|
|
2
2
|
import { attest } from "./tool-policy.js";
|
|
3
|
+
import { SETTLEMENT_NOBODY_JUDGED } from "./gate-outcome.js";
|
|
4
|
+
import { isApprovalRoute } from "./approval-route.js";
|
|
3
5
|
export function classifierUnavailableDispositionOf(route) {
|
|
4
6
|
return route === "none" ? "denied" : "asked";
|
|
5
7
|
}
|
|
6
|
-
const routeOfSeat = (seat) => (seat?.route
|
|
8
|
+
const routeOfSeat = (seat) => (isApprovalRoute(seat?.route) ? seat.route : "none");
|
|
7
9
|
export function classifierNoRulingArm(args) {
|
|
8
10
|
const { ask, req, cause } = args;
|
|
9
11
|
const route = routeOfSeat(args.seat);
|
|
@@ -26,7 +28,7 @@ export function settleNoRulingAsk(opts) {
|
|
|
26
28
|
const { ask, resolved } = opts;
|
|
27
29
|
if (!opts.mintedHere || ask.action !== "ask" || ask.classifierNoRuling === undefined || ask.denialLimitFallback !== undefined)
|
|
28
30
|
return undefined;
|
|
29
|
-
if (resolved.action !== "deny" || resolved.settlement
|
|
31
|
+
if (resolved.action !== "deny" || resolved.settlement === undefined || !SETTLEMENT_NOBODY_JUDGED[resolved.settlement.kind])
|
|
30
32
|
return undefined;
|
|
31
33
|
const tracked = opts.tracker?.recordBlock();
|
|
32
34
|
return tracked?.limitReached === true ? tracked.fallback : undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CommandSandboxInstruction } from "./command-sandbox.js";
|
|
2
|
+
/** One call's command sandbox plan, minted where the gate lets the call go: `command` carries the instruction every start of
|
|
3
|
+
* the call hands its environment; `none` — no start of the call is sandboxed. */
|
|
4
|
+
export type CommandSandboxPlan = {
|
|
5
|
+
readonly kind: "none";
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: "command";
|
|
8
|
+
readonly instruction: CommandSandboxInstruction;
|
|
9
|
+
};
|
|
10
|
+
/** Run one call's execution under its plan. An execution handed no plan runs under none, never under an enclosing call's. */
|
|
11
|
+
export declare function runWithCommandSandboxPlan<T>(plan: CommandSandboxPlan | undefined, execute: () => T): T;
|
|
12
|
+
/** The plan of the call whose execution is running here, or `undefined` when no dispatch put one there. */
|
|
13
|
+
export declare function commandSandboxPlanInForce(): CommandSandboxPlan | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
const dispatch = new AsyncLocalStorage();
|
|
3
|
+
export function runWithCommandSandboxPlan(plan, execute) {
|
|
4
|
+
return dispatch.run(plan, execute);
|
|
5
|
+
}
|
|
6
|
+
export function commandSandboxPlanInForce() {
|
|
7
|
+
return dispatch.getStore();
|
|
8
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { type CommandSandboxPlan } from "./command-sandbox-dispatch.js";
|
|
2
|
+
export type { CommandSandboxPlan } from "./command-sandbox-dispatch.js";
|
|
3
|
+
import { type EngineNotice } from "./engine-notice.js";
|
|
4
|
+
import type { ExecutionEnv } from "../internal/harness-types.js";
|
|
5
|
+
/** A credential file the sandbox denies or masks (the reference's `credentials.files[]` entry). */
|
|
6
|
+
export interface TaskSandboxCredentialFile {
|
|
7
|
+
readonly path: string;
|
|
8
|
+
readonly mode: "deny" | "mask";
|
|
9
|
+
readonly extract?: string;
|
|
10
|
+
readonly onExtractNoMatch?: "warn" | "deny" | "error";
|
|
11
|
+
readonly decode?: "jwt";
|
|
12
|
+
readonly maskClaims?: readonly string[];
|
|
13
|
+
readonly maskDuplicates?: boolean;
|
|
14
|
+
readonly injectHosts?: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
/** A credential environment variable the sandbox denies or masks (the reference's `credentials.envVars[]` entry). */
|
|
17
|
+
export interface TaskSandboxCredentialEnvVar {
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly mode: "deny" | "mask";
|
|
20
|
+
readonly extract?: string;
|
|
21
|
+
readonly onExtractNoMatch?: "warn" | "deny" | "error";
|
|
22
|
+
readonly decode?: "jwt";
|
|
23
|
+
readonly maskClaims?: readonly string[];
|
|
24
|
+
readonly injectHosts?: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
/** The reference's `credentials` block, member for member. */
|
|
27
|
+
export interface TaskSandboxCredentials {
|
|
28
|
+
readonly files?: readonly TaskSandboxCredentialFile[];
|
|
29
|
+
readonly envVars?: readonly TaskSandboxCredentialEnvVar[];
|
|
30
|
+
readonly allowPlaintextInject?: boolean;
|
|
31
|
+
readonly awsPairs?: readonly {
|
|
32
|
+
readonly accessKeyIdVar: string;
|
|
33
|
+
readonly secretAccessKeyVar: string;
|
|
34
|
+
readonly sessionTokenVar?: string;
|
|
35
|
+
}[];
|
|
36
|
+
readonly sigv4?: {
|
|
37
|
+
readonly streaming?: "deny" | "passthrough";
|
|
38
|
+
readonly presigned?: "deny" | "passthrough";
|
|
39
|
+
readonly sigv4a?: "deny" | "passthrough";
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** The reference's `network` block, but its merge-time key (`allowManagedDomainsOnly`, the host's to apply when it merges settings). */
|
|
43
|
+
export interface TaskSandboxNetwork {
|
|
44
|
+
readonly allowedDomains?: readonly string[];
|
|
45
|
+
readonly deniedDomains?: readonly string[];
|
|
46
|
+
readonly strictAllowlist?: boolean;
|
|
47
|
+
readonly allowUnixSockets?: readonly string[];
|
|
48
|
+
readonly allowAllUnixSockets?: boolean;
|
|
49
|
+
readonly allowLocalBinding?: boolean;
|
|
50
|
+
readonly allowMachLookup?: readonly string[];
|
|
51
|
+
readonly httpProxyPort?: number;
|
|
52
|
+
readonly socksProxyPort?: number;
|
|
53
|
+
readonly tlsTerminate?: {
|
|
54
|
+
readonly caCertPath?: string;
|
|
55
|
+
readonly caKeyPath?: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/** The reference's `filesystem` block, but its merge-time key (`allowManagedReadPathsOnly`). Paths are absolute or `~/`. */
|
|
59
|
+
export interface TaskSandboxFilesystem {
|
|
60
|
+
readonly allowWrite?: readonly string[];
|
|
61
|
+
readonly denyWrite?: readonly string[];
|
|
62
|
+
readonly denyRead?: readonly string[];
|
|
63
|
+
readonly allowRead?: readonly string[];
|
|
64
|
+
readonly disabled?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A task's command sandbox requirement — the reference's `sandbox` settings, key for key (`M_r` cli316.js:260966), without the
|
|
68
|
+
* two merge-time keys a host applies when it merges settings sources. Every path is ABSOLUTE or starts with `~/` (read
|
|
69
|
+
* against the home directory of the environment the command runs in): the reference reads a relative path against the
|
|
70
|
+
* settings file it came from, which only the host knows, so a host resolves one before it sends it.
|
|
71
|
+
*/
|
|
72
|
+
export interface TaskSandboxSettings {
|
|
73
|
+
/** `true` ⇒ the requirement is in force. Absent or `false` ⇒ nothing below takes effect (each member is still judged). */
|
|
74
|
+
readonly enabled?: boolean;
|
|
75
|
+
/** The requirement cannot be met ⇒ the run is refused. Absent ⇒ `true` when `enabled` is (the reference's SDK form, `failIfUnavailable` cli316.js:288039). */
|
|
76
|
+
readonly failIfUnavailable?: boolean;
|
|
77
|
+
readonly autoAllowBashIfSandboxed?: boolean;
|
|
78
|
+
readonly allowUnsandboxedCommands?: boolean;
|
|
79
|
+
readonly excludedCommands?: readonly string[];
|
|
80
|
+
readonly ignoreViolations?: Readonly<Record<string, readonly string[]>>;
|
|
81
|
+
readonly filesystem?: TaskSandboxFilesystem;
|
|
82
|
+
readonly network?: TaskSandboxNetwork;
|
|
83
|
+
readonly credentials?: TaskSandboxCredentials;
|
|
84
|
+
readonly enableWeakerNestedSandbox?: boolean;
|
|
85
|
+
readonly allowNestedUserNamespaces?: boolean;
|
|
86
|
+
readonly enableWeakerNetworkIsolation?: boolean;
|
|
87
|
+
readonly allowAppleEvents?: boolean;
|
|
88
|
+
readonly ripgrep?: {
|
|
89
|
+
readonly command: string;
|
|
90
|
+
readonly args?: readonly string[];
|
|
91
|
+
};
|
|
92
|
+
readonly bwrapPath?: string;
|
|
93
|
+
readonly socatPath?: string;
|
|
94
|
+
}
|
|
95
|
+
/** What one command start may touch. Every path is absolute. `allowRead` re-opens reading only under `denyRead`, never under a
|
|
96
|
+
* row of the start's byte floor (`readFloor`). The environment may add the private directory its own mechanism needs for the
|
|
97
|
+
* start, and nothing else. */
|
|
98
|
+
export interface CommandSandboxBoundary {
|
|
99
|
+
readonly filesystem: {
|
|
100
|
+
readonly allowWrite: readonly string[];
|
|
101
|
+
readonly denyWrite: readonly string[];
|
|
102
|
+
readonly denyRead: readonly string[];
|
|
103
|
+
readonly allowRead: readonly string[];
|
|
104
|
+
};
|
|
105
|
+
readonly network: {
|
|
106
|
+
readonly allowedDomains: readonly string[];
|
|
107
|
+
readonly deniedDomains: readonly string[];
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/** The requirement's members the environment's own mechanism interprets, as the task stated them (paths resolved). */
|
|
111
|
+
export interface CommandSandboxMechanism {
|
|
112
|
+
readonly filesystem?: {
|
|
113
|
+
readonly disabled?: boolean;
|
|
114
|
+
};
|
|
115
|
+
readonly network?: Omit<TaskSandboxNetwork, "allowedDomains" | "deniedDomains" | "strictAllowlist">;
|
|
116
|
+
readonly credentials?: TaskSandboxCredentials;
|
|
117
|
+
readonly enableWeakerNestedSandbox?: boolean;
|
|
118
|
+
readonly allowNestedUserNamespaces?: boolean;
|
|
119
|
+
readonly enableWeakerNetworkIsolation?: boolean;
|
|
120
|
+
readonly allowAppleEvents?: boolean;
|
|
121
|
+
readonly ripgrep?: {
|
|
122
|
+
readonly command: string;
|
|
123
|
+
readonly args?: readonly string[];
|
|
124
|
+
};
|
|
125
|
+
readonly bwrapPath?: string;
|
|
126
|
+
readonly socatPath?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The instruction one command start carries (`ExecutionEnvExecOptions.sandbox`): the start runs with every entry of the
|
|
130
|
+
* boundary kept, under the mechanism as stated, or it does not start — refused `sandbox_unavailable`, saying which way
|
|
131
|
+
* (`refusedBy`: `"this_call"` = an entry of this boundary cannot be kept, another boundary may still start; `"environment"` =
|
|
132
|
+
* the sandbox itself cannot start, so no boundary can; a refusal that cannot tell reads `"environment"`). Never kept in part,
|
|
133
|
+
* never started without it.
|
|
134
|
+
*/
|
|
135
|
+
export interface CommandSandboxInstruction {
|
|
136
|
+
readonly boundary: CommandSandboxBoundary;
|
|
137
|
+
readonly mechanism: CommandSandboxMechanism;
|
|
138
|
+
}
|
|
139
|
+
/** Which way a start was refused because its confinement could not be had (`ExecutionError.refusedBy`). */
|
|
140
|
+
export type ConfinementRefusal = "this_call" | "environment";
|
|
141
|
+
/** The code a requirement that cannot be read refuses the run with. */
|
|
142
|
+
export declare const SANDBOX_SETTINGS_INVALID = "config.sandbox_settings_invalid";
|
|
143
|
+
/** The code of a requirement the environment cannot meet: the run's notice when `failIfUnavailable` is `false`, the prepare
|
|
144
|
+
* refusal otherwise — one fact, one word, two loudness dialects. */
|
|
145
|
+
export declare const COMMAND_SANDBOX_UNAVAILABLE = "config.command_sandbox_unavailable";
|
|
146
|
+
/**
|
|
147
|
+
* The requirement as the task stated it, judged and owned: a frozen plain copy of `value` whose every member is one the
|
|
148
|
+
* reference's settings carry, of its type, every path absolute or `~/`. `undefined` for an absent requirement. Throws
|
|
149
|
+
* {@link SANDBOX_SETTINGS_INVALID} naming the key. Paths are not resolved here — a child resolves the copy it inherits
|
|
150
|
+
* against its own environment's home.
|
|
151
|
+
*/
|
|
152
|
+
export declare function receiveTaskSandbox(value: unknown): TaskSandboxSettings | undefined;
|
|
153
|
+
/** A run's command sandbox, decided once at prepare. Armed ⇒ `requirement`: the instruction the requirement alone makes (its
|
|
154
|
+
* paths read against the leg's home); every call's plan adds the leg's write roots to it ({@link commandSandboxPlan}). */
|
|
155
|
+
export type CommandSandboxRun = {
|
|
156
|
+
readonly state: "off";
|
|
157
|
+
} | {
|
|
158
|
+
readonly state: "unavailable";
|
|
159
|
+
readonly reason: string;
|
|
160
|
+
} | {
|
|
161
|
+
readonly state: "armed";
|
|
162
|
+
readonly requirement: CommandSandboxInstruction;
|
|
163
|
+
};
|
|
164
|
+
/** What {@link judgeCommandSandbox} reads. */
|
|
165
|
+
export interface CommandSandboxJudgment {
|
|
166
|
+
/** The task's requirement (`TaskSpec.sandbox`), as the caller handed it. */
|
|
167
|
+
readonly requirement: unknown;
|
|
168
|
+
readonly env: Pick<ExecutionEnv, "capabilities">;
|
|
169
|
+
/** The home directory a `~/` path is read against (the leg's), absent when the environment states none. */
|
|
170
|
+
readonly home: string | undefined;
|
|
171
|
+
readonly onNotice: ((notice: EngineNotice) => void) | undefined;
|
|
172
|
+
readonly attribution?: {
|
|
173
|
+
readonly sessionId?: string;
|
|
174
|
+
readonly runId?: string;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* The run's command sandbox: the requirement judged ({@link receiveTaskSandbox}), then — when it is in force — the capability
|
|
179
|
+
* read once. Armed ⇒ the requirement's own instruction (its paths, `~/` read against `home`). Unavailable ⇒ announced once
|
|
180
|
+
* ({@link COMMAND_SANDBOX_UNAVAILABLE}, the session user's) and the run proceeds unsandboxed; under `failIfUnavailable` the
|
|
181
|
+
* same word refuses the run. Throws the coded refusals.
|
|
182
|
+
*/
|
|
183
|
+
export declare function judgeCommandSandbox(j: CommandSandboxJudgment): CommandSandboxRun;
|
|
184
|
+
/**
|
|
185
|
+
* The plan of one call, by the call's wire name: a call the environment's own shell face runs (the wire name is in
|
|
186
|
+
* `envHandToolNames` — the call dispatches to an engine hand the environment executes, never a caller's tool under the name),
|
|
187
|
+
* in an armed run, carries the run's requirement with the leg's write roots, read now, added to what it may write; every other
|
|
188
|
+
* call carries none.
|
|
189
|
+
*/
|
|
190
|
+
export declare function commandSandboxPlan(run: CommandSandboxRun, call: {
|
|
191
|
+
readonly toolName: string;
|
|
192
|
+
}, envHandToolNames: ReadonlySet<string>, writeRoots: () => readonly string[]): CommandSandboxPlan;
|
|
193
|
+
/** What a shell face hands one start: the instruction (`sandbox`) the environment must keep, none — or `ok: false`, the start is
|
|
194
|
+
* refused: its call carries no command plan in a run that requires the sandbox ({@link sandboxRefusalText} `{ by: "gate" }`). */
|
|
195
|
+
export type CommandSandboxStart = {
|
|
196
|
+
readonly ok: true;
|
|
197
|
+
readonly sandbox?: CommandSandboxInstruction;
|
|
198
|
+
} | {
|
|
199
|
+
readonly ok: false;
|
|
200
|
+
};
|
|
201
|
+
/** A shell face's seat: asked at each start it makes. */
|
|
202
|
+
export type CommandSandboxSeat = () => CommandSandboxStart;
|
|
203
|
+
/** The seat of a run: off or unavailable ⇒ no seat (the starts carry nothing, as before the seat existed); armed ⇒ the plan of the
|
|
204
|
+
* call being executed, and a start whose call carries no command plan is refused. */
|
|
205
|
+
export declare function commandSandboxSeat(run: CommandSandboxRun): CommandSandboxSeat | undefined;
|
|
206
|
+
/** Why a shell start did not happen for its sandbox: the seat refused it (`gate` — its call carries no plan), or the environment
|
|
207
|
+
* did (`sandbox_unavailable`, with the environment's own reason, already read through the engine's one reading of a target's
|
|
208
|
+
* failure message, and which way). */
|
|
209
|
+
export type SandboxRefusal = {
|
|
210
|
+
readonly by: "gate";
|
|
211
|
+
} | {
|
|
212
|
+
readonly by: "environment";
|
|
213
|
+
readonly detail: string;
|
|
214
|
+
readonly refusedBy: ConfinementRefusal | undefined;
|
|
215
|
+
};
|
|
216
|
+
/** The model-facing sentence of a start that did not happen for its sandbox: nothing ran. Bounded by construction — the tool name
|
|
217
|
+
* to 64 characters, the environment's reason to 600, everything else fixed. */
|
|
218
|
+
export declare function sandboxRefusalText(toolName: string, refusal: SandboxRefusal): string;
|
|
219
|
+
/**
|
|
220
|
+
* The requirement a child runs under, given its parent's (already judged) and the one the child states. The parent's is a
|
|
221
|
+
* floor: no parent ⇒ the child's as it is; no child ⇒ the parent's. Otherwise each member the child does not state is the
|
|
222
|
+
* parent's, and each it states is combined with the parent's toward the stricter side: a tightening switch (`enabled`,
|
|
223
|
+
* `failIfUnavailable`, `strictAllowlist`) is on when either is; a loosening one (`autoAllowBashIfSandboxed`,
|
|
224
|
+
* `allowUnsandboxedCommands`, the weakening switches) only when both are; the lists of what is denied join; the lists of
|
|
225
|
+
* what is allowed keep only the entries both write, as written; `ignoreViolations` keeps the patterns both write, each with the
|
|
226
|
+
* paths both write; a credential both name keeps the stricter mode (`deny` over `mask`) and the stricter no-match word
|
|
227
|
+
* (`error` over `deny` over `warn`); the mechanism's settings (`httpProxyPort`, `socksProxyPort`, `tlsTerminate`, `ripgrep`,
|
|
228
|
+
* `bwrapPath`, `socatPath`, `awsPairs`, `sigv4`) are the parent's, whatever the child states. The child's requirement is judged
|
|
229
|
+
* first ({@link receiveTaskSandbox}): one that cannot be read refuses the spawn, never merges in part.
|
|
230
|
+
*/
|
|
231
|
+
export declare function mergeChildSandbox(parent: TaskSandboxSettings | undefined, childValue: unknown): TaskSandboxSettings | undefined;
|