@sema-agent/core 7.66.0 → 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 +3498 -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 +13 -3
- package/dist/core/runner/prepare-park-ask.js +25 -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 +7 -6
- 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.66.1.json +30 -0
- package/wire-changes/core-stores-sql@7.67.0.json +39 -0
- package/wire-changes/core@7.66.1.json +46 -0
- package/wire-changes/core@7.67.0.json +12578 -0
- package/wire-changes/mods-kernel@7.66.1.json +30 -0
- package/wire-changes/mods-kernel@7.67.0.json +167 -0
- package/wire-changes/primitives@7.66.1.json +30 -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
package/dist/core/task-spec.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type { ModelRef, ModelRole, ModelRoles } from "./model-seat.js";
|
|
|
14
14
|
import type { TaskLimits } from "./task-limits.js";
|
|
15
15
|
import type { ToolSpec } from "./tool-spec.js";
|
|
16
16
|
import type { WorkspaceDeclaration } from "./session-checkout.js";
|
|
17
|
+
import type { TaskSandboxSettings } from "./command-sandbox.js";
|
|
17
18
|
/** design/169-F — knobs for the opt-in stale tool-result offload (see
|
|
18
19
|
* `TaskSpec.compaction.staleToolResultOffload`, where the semantics are documented). */
|
|
19
20
|
export interface StaleToolResultOffloadOptions {
|
|
@@ -65,6 +66,42 @@ export type UserAttachment = {
|
|
|
65
66
|
readonly mimeType: string;
|
|
66
67
|
};
|
|
67
68
|
};
|
|
69
|
+
/**
|
|
70
|
+
* The instruction-file family of a directory ({@link TaskSpec.instructionFamily}) — what the engine loads for each
|
|
71
|
+
* directory between the task root and a file the run accessed. Names only: the engine joins each to the directory, reads
|
|
72
|
+
* it through the hands under the Read tool's admission (a file the model could not Read is not loaded, and the user is
|
|
73
|
+
* told), and holds no list of names of its own. The deployment's own naming convention fills it.
|
|
74
|
+
*
|
|
75
|
+
* - `files` — the file names each level is read for, relative and `/`-separated (`CLAUDE.md`, `.claude/CLAUDE.md`, …).
|
|
76
|
+
* - `rulesDir` — a directory each level is listed under (recursively, `.md` files): a rule whose frontmatter names
|
|
77
|
+
* `paths:` is loaded when the accessed path matches one (relative to that level), a rule without is loaded with its
|
|
78
|
+
* level. At the task root itself only the matching rules load.
|
|
79
|
+
* - `alternate` — a second family: `when: "absent"` reads it only where the task root holds no member of `files`
|
|
80
|
+
* (judged once per leg), `"also"` reads it beside `files`.
|
|
81
|
+
* - `includes` — follow a file's `@path` includes (within the task root, to a depth of {@link NESTED_MEMORY_LANE}'s limit).
|
|
82
|
+
* - `hostRules` — rule texts the deployment holds outside the workspace (a user's or an organization's rules, a rule of a
|
|
83
|
+
* directory above the task root): each is delivered when an accessed path, relative to the task root, matches one of
|
|
84
|
+
* its `paths`. `name` is the label the frame shows.
|
|
85
|
+
*
|
|
86
|
+
* A file is loaded once and again only when it changed or left the model's view (a compaction, a trim). Every value is
|
|
87
|
+
* judged at the door: a bad one refuses the task (`config.invalid_argument`), never folds to a default.
|
|
88
|
+
*/
|
|
89
|
+
export interface InstructionFamilyDeclaration {
|
|
90
|
+
readonly files?: readonly string[];
|
|
91
|
+
readonly rulesDir?: string;
|
|
92
|
+
readonly alternate?: {
|
|
93
|
+
readonly files: readonly string[];
|
|
94
|
+
readonly rulesDir?: string;
|
|
95
|
+
readonly when: "absent" | "also";
|
|
96
|
+
};
|
|
97
|
+
readonly includes?: boolean;
|
|
98
|
+
readonly hostRules?: ReadonlyArray<{
|
|
99
|
+
readonly level: "user" | "managed" | "project";
|
|
100
|
+
readonly name: string;
|
|
101
|
+
readonly paths: readonly string[];
|
|
102
|
+
readonly text: string;
|
|
103
|
+
}>;
|
|
104
|
+
}
|
|
68
105
|
/** A single self-contained task with its full configuration. */
|
|
69
106
|
/** The shell-gate FLOOR vocabulary — {@link TaskSpec.shellGate}'s value set, the word the engine persists on a
|
|
70
107
|
* shell-gated ask (`RiskDescriptor.shellGateDoctrine`) and carries down a delegation chain. One value: `"always"`
|
|
@@ -72,10 +109,26 @@ export type UserAttachment = {
|
|
|
72
109
|
* is installed on every full shell regardless; what a permission mode does with the resulting ask is the gate's
|
|
73
110
|
* arbitration, never a doctrine word. */
|
|
74
111
|
export type ShellGateDoctrine = "always";
|
|
112
|
+
/** {@link TaskSpec.wake}'s value set: what a wake leg opens on. One value: `"parked_notifications"` — the task notifications
|
|
113
|
+
* parked for this session's occupant while it sat idle (the durable box's included). */
|
|
114
|
+
export declare const TASK_WAKE_SOURCES: readonly ["parked_notifications"];
|
|
115
|
+
export type TaskWakeSource = (typeof TASK_WAKE_SOURCES)[number];
|
|
75
116
|
export interface TaskSpec {
|
|
76
117
|
taskId?: string;
|
|
77
118
|
/** The instruction / latest user message for this turn. */
|
|
78
119
|
objective: string;
|
|
120
|
+
/**
|
|
121
|
+
* A **wake leg**: the leg brings no input of its own and opens on what the session already holds for it —
|
|
122
|
+
* `"parked_notifications"`, the task notifications parked for this session's occupant while it sat idle (the durable box's
|
|
123
|
+
* included), each handed to the model once, as the frame it is (one `<task-notification>` block per frame; the host writes no
|
|
124
|
+
* copy of it). A leg opens on exactly one input: an instruction ({@link objective}), a resumed row (a checkpoint resume), or
|
|
125
|
+
* this. So a wake leg carries no instruction (`objective` blank), no `images` and no `userAttachments`, and is never a resume;
|
|
126
|
+
* a blank objective is never read as a wake — the leg names it. When nothing is handed over at turn open (nothing was parked,
|
|
127
|
+
* or the session's receiving station consumed it all) the run ends `config.nothing_to_wake` before any model request.
|
|
128
|
+
*
|
|
129
|
+
* Lives and dies with the session ({@link sessionId}): a run handed a new session of its own has nothing parked.
|
|
130
|
+
*/
|
|
131
|
+
wake?: TaskWakeSource;
|
|
79
132
|
/**
|
|
80
133
|
* Authenticated **end-user principal** this task runs on behalf of (design/62) — an opaque identity string
|
|
81
134
|
* (user id, email, tenant-scoped subject) the **trusted caller** sets at task creation. The Runner holds it
|
|
@@ -99,6 +152,30 @@ export interface TaskSpec {
|
|
|
99
152
|
* this value by contract; getting it wrong is a privilege-escalation hole, not a core bug.
|
|
100
153
|
*/
|
|
101
154
|
principal?: string;
|
|
155
|
+
/**
|
|
156
|
+
* The ISOLATION SCOPE this task's working state is keyed under, when it is not the {@link principal} — an opaque name the
|
|
157
|
+
* **trusted caller** sets beside the principal (the same trust contract: a control-plane value, never model / worker input). One
|
|
158
|
+
* person working in several separated scopes is ONE principal and several isolation scopes.
|
|
159
|
+
*
|
|
160
|
+
* The principal stays the person: governance windows, outbound identity (MCP principal header, A2A identity), entitlements
|
|
161
|
+
* (`runtimeCapsResolver`, compliance posture), rule ownership, memory admission and attribution read it. The isolation scope keys
|
|
162
|
+
* the state that belongs to one scope of that person's work: the task registry domain this run's registry-facing tools mount in,
|
|
163
|
+
* the offloaded tool-result namespace, the durable-suspend checkpoint scope (its last rung), the scheduler's session-leg fallback
|
|
164
|
+
* and durable key, the delegation tree's domain, and the MCP connection a run tree shares. Every one of those reads it through ONE
|
|
165
|
+
* accessor: this member, else the principal — so a task that leaves it unset (or sets the empty string, absence wearing clothes,
|
|
166
|
+
* the principal's own discipline) keys every one of them exactly as before.
|
|
167
|
+
*
|
|
168
|
+
* Judged by the principal's own name rule (absent, or a name — at most 256 UTF-16 units; a provided value that names nothing is refused
|
|
169
|
+
* `config.invalid_argument`). Delegated children inherit it like the principal. When it is set, `durableApproval.scope` and
|
|
170
|
+
* `resourceSuspend.scope` must equal it (a different value would file one scope's parked rows under another) — refused
|
|
171
|
+
* `config.invalid_argument` otherwise. A parked row whose isolation scope differs from its principal records it
|
|
172
|
+
* ({@link import("./checkpoint-store.js").Checkpoint.isolationScope}); a resume that names a different one is refused
|
|
173
|
+
* (`resume.isolation_scope_mismatch`), one that names none inherits the recorded one.
|
|
174
|
+
*
|
|
175
|
+
* The engine never parses either value: a host that receives a person and a scope on separate inputs splits them into these two
|
|
176
|
+
* members once, at its own entrance.
|
|
177
|
+
*/
|
|
178
|
+
isolationScope?: string;
|
|
102
179
|
/**
|
|
103
180
|
* design/171 §6.4 — WHO opened this turn (the thread's first-post author in a shared session):
|
|
104
181
|
* the CANONICAL attribution seat for the objective. Rendered as the speaker envelope on the first
|
|
@@ -133,7 +210,8 @@ export interface TaskSpec {
|
|
|
133
210
|
* asserts a live human is reachable and makes prepare REFUSE the leg (fail-loud
|
|
134
211
|
* `config.interaction_posture`) when the assembly cannot deliver on it: it requires the resolved
|
|
135
212
|
* permission-ask seat to be a live approver callback (`ask.effective === "human_reachable"` — a
|
|
136
|
-
* blanket allow/deny
|
|
213
|
+
* blanket allow/deny, an approver the deployment declared a policy (`asPolicyApprover`) or an absent
|
|
214
|
+
* seat fails the door) AND a content-question channel (a resolved
|
|
137
215
|
* `onQuestion` face, OR the engine's own `stripped_bg_lane` legs — core's deliberate strip of a
|
|
138
216
|
* long-lived child's per-request face is correct design, not a configuration lie, so those legs
|
|
139
217
|
* are exempt). The park lane is deliberately NOT required (interactive-without-park is a
|
|
@@ -161,10 +239,11 @@ export interface TaskSpec {
|
|
|
161
239
|
interactionPosture?: "interactive" | "headless";
|
|
162
240
|
/**
|
|
163
241
|
* The run's declaration that NOBODY on it can be asked to approve a call — read by the approval seat's one resolution
|
|
164
|
-
* ({@link import("./wiring-manifest.js").resolveAskSeat}). `"none"`:
|
|
165
|
-
* is not this run's approver (never called; the manifest reports `ask.form: "declared_none"`); with the deployment's park
|
|
242
|
+
* ({@link import("./wiring-manifest.js").resolveAskSeat}). `"none"`: a person's approver callback the spec or the deployment
|
|
243
|
+
* wires is not this run's approver (never called; the manifest reports `ask.form: "declared_none"`); with the deployment's park
|
|
166
244
|
* facility armed an ask parks for a person to answer later (`park_only`), without one it is refused as nobody's. It
|
|
167
|
-
* approves and releases nothing; a blanket `"allow"` / `"deny"` seat stays a policy
|
|
245
|
+
* approves and releases nothing; a blanket `"allow"` / `"deny"` seat stays a policy, and so does an approver the deployment
|
|
246
|
+
* declared a policy (`asPolicyApprover`: kept and asked, `ask.form: "policy_callback"`); under `dontAsk` the mode refuses
|
|
168
247
|
* first. Absent = today's reading. Not checkpointed (a resumed leg holds it only when its taskConfig supplies it again);
|
|
169
248
|
* children inherit it (the clamp seats). `interactionPosture: "interactive"` beside it is refused
|
|
170
249
|
* (`config.interaction_posture`); a value outside the closed set too (`config.approval_reach_invalid`). Independent of
|
|
@@ -204,8 +283,11 @@ export interface TaskSpec {
|
|
|
204
283
|
*/
|
|
205
284
|
projectId?: string;
|
|
206
285
|
/**
|
|
207
|
-
* The session's workspace
|
|
208
|
-
*
|
|
286
|
+
* The session's workspace. The session's first leg turns it into the session's checkout, an immutable record every later leg
|
|
287
|
+
* is judged against. A later leg (a resumed leg's config included) may OMIT it — the session's own declaration stands, the
|
|
288
|
+
* leg runs in the session's tree as if it had sent it — or send the SAME declaration; `null` is a leg that wants NO tree (it
|
|
289
|
+
* runs at the task root the host gave it, reports no checkout, and leaves the record as it is). A declaration that differs is
|
|
290
|
+
* refused.
|
|
209
291
|
* - `isolation: "worktree"`: the session works in its OWN managed tree of the task root's repository, minted on the first
|
|
210
292
|
* leg at `<repository root>/.sema/worktrees/<name>` on branch `sema/<name>` (`name` absent ⇒ derived from the session id;
|
|
211
293
|
* `baseRef`: `"fresh"` default, or `"head"`). Every leg's task root is the task root's place in that tree; the base
|
|
@@ -214,14 +296,14 @@ export interface TaskSpec {
|
|
|
214
296
|
* leg (the checkout at that root must be at `sha`; with isolation the task root's tree is minted at it).
|
|
215
297
|
* Refusals, each before the leg starts: a malformed declaration ⇒ `config.session_workspace_invalid` (also: a writable
|
|
216
298
|
* `additionalDirectories` entry that reaches into the isolated base checkout, a remote carrying a credential); a declaration
|
|
217
|
-
* that differs from the first leg's, appears on a session that already ran without one
|
|
299
|
+
* that differs from the first leg's, or appears on a session that already ran without one ⇒
|
|
218
300
|
* `config.session_workspace_changed`; the tree cannot be made ⇒ `workspace.isolation_unavailable` (the reason named,
|
|
219
301
|
* `probeWorktreeCapability` judges the same); a checkout not at the declared commit ⇒ `workspace.source_mismatch`; the
|
|
220
|
-
* record cannot be read ⇒ `workspace.checkout_unavailable`; the tree is gone ⇒ `workspace.checkout_missing` (
|
|
221
|
-
*
|
|
222
|
-
* (`session`).
|
|
302
|
+
* record cannot be read ⇒ `workspace.checkout_unavailable`; the tree is gone ⇒ `workspace.checkout_missing` (a leg that
|
|
303
|
+
* wants the tree is never run in the base checkout instead). A fork does not inherit the checkout. Every leg's
|
|
304
|
+
* `workspace_changed` frame carries it (`session`), except a `null` leg's.
|
|
223
305
|
*/
|
|
224
|
-
workspace?: WorkspaceDeclaration;
|
|
306
|
+
workspace?: WorkspaceDeclaration | null;
|
|
225
307
|
/**
|
|
226
308
|
* design/114 Phase3 — with `sessionId` set, REQUIRE that session to already exist: if it is gone (e.g. a
|
|
227
309
|
* non-durable store lost it across a restart, or a typo'd id), the run FAILS LOUD (`resume.session_not_found`)
|
|
@@ -307,9 +389,9 @@ export interface TaskSpec {
|
|
|
307
389
|
* that could support this without a second root is a recorded design candidate, not built.)
|
|
308
390
|
*
|
|
309
391
|
* File-history interaction (design/381): with {@link restoreFiles}, the `"before"` file anchor is the
|
|
310
|
-
* target's OWN entry id — history boundaries are keyed by
|
|
311
|
-
* when that turn began", so B(target) IS the before-state. A target with no boundary of its own (a
|
|
312
|
-
*
|
|
392
|
+
* target's OWN entry id — history boundaries are keyed by the entry of the person's input that opened a turn and mean
|
|
393
|
+
* "file state when that turn began", so B(target) IS the before-state. A target with no boundary of its own (a steer /
|
|
394
|
+
* follow-up entry, an engine entry such as a task notification, a turn that recorded no history, a mixed-epoch session) refuses at prepare
|
|
313
395
|
* (`rewind_snapshot.unresolvable`) with the files untouched: an earlier boundary would also revert edits
|
|
314
396
|
* the conversation keeps, so the anchor never falls back to an ancestor and never crosses into an earlier turn.
|
|
315
397
|
* Fail-loud: setting this without {@link resumeAt}, or an unknown mode value, rejects at prepare.
|
|
@@ -342,7 +424,8 @@ export interface TaskSpec {
|
|
|
342
424
|
systemPrompt?: string;
|
|
343
425
|
/** The role base `core/role.base` selects — `"general"`, `"code"`, `"coordinator"`, `"cowork"` (rendered from the mounted tools and the
|
|
344
426
|
* working directory) — and the run's host role; `systemPrompt` replaces it. A task naming neither takes its role's preset (`RoleSpec.promptRole` /
|
|
345
|
-
* `systemPrompt`) whole; an explicit `"general"`
|
|
427
|
+
* `systemPrompt`) whole; an explicit `"general"` ends that chain (a delegated non-fork child reads it as the `subagent` variant). Not inherited.
|
|
428
|
+
* Outside the closed set (`HOST_ROLES`, `isHostRole`) ⇒ refused at prepare. */
|
|
346
429
|
promptRole?: import("../prompt-assembly/catalog/schema.js").HostRole;
|
|
347
430
|
/** `"minimal"` leaves the core-behavior band out; the locked sections (mode sections in play among them) and
|
|
348
431
|
* `appendSystemPrompt` stay. Absent ⇒ standard. Rides the parent spec seat to every engine-built child (a clamp-table
|
|
@@ -350,6 +433,10 @@ export interface TaskSpec {
|
|
|
350
433
|
promptForm?: "minimal";
|
|
351
434
|
/** The deployment's binding (a scenario name): a prompt selector value, read by every overlay's `when.binding` (center, deploy and task alike); rides the parent spec seat; out of grammar (non-blank, ≤ 128 Unicode code points — `PROMPT_BINDING_MAX_CHARS`, counted `[...s].length`, not UTF-16 units) ⇒ `config.prompt_selector_invalid`. */
|
|
352
435
|
promptBinding?: string;
|
|
436
|
+
/** The catalog rendering this run reads: `"zh-Hans"` ⇒ every catalog message it receives (prompt sections, the environment
|
|
437
|
+
* block, the engine's own texts) in Simplified Chinese; absent ⇒ the catalog's text, byte for byte. Chooses no variant, sets no
|
|
438
|
+
* reply language; `selectors.locale`; rides the parent spec seat; any other value ⇒ `config.prompt_selector_invalid`. */
|
|
439
|
+
promptLocale?: "zh-Hans";
|
|
353
440
|
/**
|
|
354
441
|
* APPEND a caller block to the assembled system prompt, keeping the engine's base + harness/safety blocks
|
|
355
442
|
* (unlike `systemPrompt`, which REPLACES the role base).
|
|
@@ -382,6 +469,12 @@ export interface TaskSpec {
|
|
|
382
469
|
name: string;
|
|
383
470
|
turnReminder?: string;
|
|
384
471
|
};
|
|
472
|
+
/** The person's REPLY language (a free name or code, e.g. `"Japanese"`, `"ja"`), stated to the model in the reference's `# Language`
|
|
473
|
+
* reminder on the leg's first request whenever it differs from what the model was told since the latest compaction; dropping it
|
|
474
|
+
* states the cleared sentence; a compaction inside the leg restates it. Never in the system prompt; sets no `promptLocale` (that
|
|
475
|
+
* seat renders the engine's own texts) and neither is read from the other. Rides the parent spec seat; stated on a root leg and
|
|
476
|
+
* a named teammate, never on an ordinary delegated child. Not a string, blank, or over 256 characters ⇒ `config.language_invalid`. */
|
|
477
|
+
language?: string;
|
|
385
478
|
/**
|
|
386
479
|
* Enable long-term memory for this task. **design/138 S4 (BREAKING): requires `RunnerDeps.memoryBackend`**
|
|
387
480
|
* (the injection-first memory engine — materialize → file ops → harvest). With a backend configured the
|
|
@@ -436,14 +529,23 @@ export interface TaskSpec {
|
|
|
436
529
|
* such a run, for that cycle); no word turns it back on below. Any other value refuses (`rewind.invalid_spec`).
|
|
437
530
|
*/
|
|
438
531
|
fileHistory?: "disabled";
|
|
439
|
-
/** The per-run OFF SWITCH for the
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*
|
|
443
|
-
*
|
|
444
|
-
* (parent spec seat, a revived cycle included); no word turns it back on below. Any other value refuses prepare, and a resume's screen before its
|
|
532
|
+
/** The per-run OFF SWITCH for the project's instruction files (`"disabled"`, the only word; {@link fileHistory}'s spelling): it
|
|
533
|
+
* silences {@link instructionFamily} — the declaration is still screened (a bad value refuses), then nothing is stat'ed or read at
|
|
534
|
+
* any level. Omitted ⇒ a declared family is read. Unaffected: the engine's own git-status lane and the memory engine (its index
|
|
535
|
+
* seed included). The manifest reports `"disabled"` (`"absent"`: no family declared). Children inherit it (parent spec seat, a
|
|
536
|
+
* revived cycle included); no word turns it back on below. Any other value refuses prepare, and a resume's screen before its
|
|
445
537
|
* claim, `config.invalid_argument`. */
|
|
446
538
|
projectMemory?: "disabled";
|
|
539
|
+
/**
|
|
540
|
+
* The instruction-file family ({@link InstructionFamilyDeclaration}): the engine reads it at every level of the task root,
|
|
541
|
+
* through the hands, under the Read tool's own admission — the root's own level on every leg (the session's instructions,
|
|
542
|
+
* frames of origin `project_instructions`, the leg's first request first), and when the model reads or writes a file below the
|
|
543
|
+
* root, the family of each directory between the root and that file and the rules whose paths match it (frames of origin
|
|
544
|
+
* `nested_memory`, on the next request). A delivered file edited since is sent whole again; removed or emptied, it is withdrawn
|
|
545
|
+
* once. Absent, or under {@link projectMemory} `"disabled"` (screened, then silent) ⇒ nothing is stat'ed or read. Children inherit
|
|
546
|
+
* it (the parent spec seat): omitted ⇒ the parent's; `projectMemory: "disabled"` silences it; the child's own declaration stands.
|
|
547
|
+
*/
|
|
548
|
+
instructionFamily?: InstructionFamilyDeclaration;
|
|
447
549
|
/**
|
|
448
550
|
* design/381 (DV-9) — the RESTORE half of file rewind: when this task uses {@link resumeAt} to branch at
|
|
449
551
|
* a prior entry, ALSO converge the working tree's **agent-edited files** (the tracked set — files this
|
|
@@ -577,8 +679,8 @@ export interface TaskSpec {
|
|
|
577
679
|
*
|
|
578
680
|
* DEFAULT `"swap"` (rolled back 2026-08-06 after a brief default-`"static"` window). `"static"` is
|
|
579
681
|
* a STRICT EXPLICIT OPT-IN, and the condition to opt in is a property of the whole serving route,
|
|
580
|
-
* not of one model: every model the run can reach — the prepare-time model, every
|
|
581
|
-
*
|
|
682
|
+
* not of one model: every model the run can reach — the prepare-time model, every model on its
|
|
683
|
+
* catalog `fallbacks` chain, and any near-budget model hand-off — must be able to
|
|
582
684
|
* emit arguments it read from RESULT TEXT while the advertised wire schema stays empty. A model
|
|
583
685
|
* served with CONSTRAINED DECODING cannot: its sampler is bound by the advertised
|
|
584
686
|
* `{"type":"object","properties":{}}`. On the mainstream implementations — the ones that compile a
|
|
@@ -656,8 +758,8 @@ export interface TaskSpec {
|
|
|
656
758
|
* the boot one. Validation contract (the reference's shape — an agent's tool list filters by name,
|
|
657
759
|
* and a name nothing answers never fails the run): both lists are judged once, here and for the
|
|
658
760
|
* delegation tool's own lists alike; a `denyTools` entry is read as the reference reads it
|
|
659
|
-
* (`Tool(content)` hides the whole `Tool`, with a host notice); an entry
|
|
660
|
-
*
|
|
761
|
+
* (`Tool(content)` hides the whole `Tool`, with a host notice); an entry that is another spelling of a tool the child is handed (a tool of the pool the delegation tool declares, or the engine's catalog: a case twin, a retired name with a successor: `"near_miss"`, while that pool can be listed) is REJECTED at task start (`config.agent.unknown_tool`);
|
|
762
|
+
* an entry whose spelling no tool name can have (`"Bash("`) is told once (`onError` and a `user` notice) and a delegation to that definition is refused (same code, `detail.reason: "grammar"`); an entry naming a tool that does
|
|
661
763
|
* not exist (a server this deployment does not declare, a misspelt name) is kept as written
|
|
662
764
|
* — it denies, or admits, a tool of that name if one is mounted later — and told to the host once
|
|
663
765
|
* via `RunnerDeps.onError` phase `"config"` (zero model-facing warning); and
|
|
@@ -727,13 +829,15 @@ export interface TaskSpec {
|
|
|
727
829
|
* in-stream — same turn, no checkpoint, the gate recorded in `humanReview.gates` — and this option acts
|
|
728
830
|
* as the no-approver fallback. The durable park keeps priority only when: (a) there is no function seat
|
|
729
831
|
* (absent, or a blanket `"allow"`/`"deny"` string mode — a policy setting is not a reachable human);
|
|
730
|
-
* (b) a control-plane `forceDurableGate` entitlement is in force; (c) the live face already answered
|
|
832
|
+
* (b) a control-plane `forceDurableGate` entitlement is in force (on a delegated leg only where its parent forwarded an opt-in — elsewhere the leg parks no ask and refuses every one, `config.durable_gate_unavailable`); (c) the live face already answered
|
|
731
833
|
* `"unavailable"` for this ask; or (d) the call is marked inherited-unavailable by an ancestor.
|
|
732
834
|
*/
|
|
733
835
|
durableApproval?: {
|
|
734
836
|
/** Multi-tenant isolation key, forced into the checkpoint + `resolve`/`reap` WHERE. Required. */
|
|
735
837
|
scope: string;
|
|
736
|
-
/** Optional awaiting-human TTL (ms). Past it a reaper CAS-expires the checkpoint (≈ deny).
|
|
838
|
+
/** Optional awaiting-human TTL (ms). Past it a reaper CAS-expires the checkpoint (≈ deny). Absent, or a finite number >= 0 — any other
|
|
839
|
+
* value (NaN, Infinity, a negative, a string) is refused at the task door (`config.invalid_argument`, `detail.field` `durableApproval.ttlMs`),
|
|
840
|
+
* the judge `resourceSuspend`'s numbers are judged by. */
|
|
737
841
|
ttlMs?: number;
|
|
738
842
|
};
|
|
739
843
|
/**
|
|
@@ -743,6 +847,11 @@ export interface TaskSpec {
|
|
|
743
847
|
* continues the run with the next slice's allowance. `scope` is the multi-tenant isolation key (like
|
|
744
848
|
* `durableApproval.scope`). Absent ⇒ a limit hit still FAILS (backward compatible). Independent of
|
|
745
849
|
* `durableApproval` (a run can have one, both, or neither).
|
|
850
|
+
*
|
|
851
|
+
* It answers ONE question — when the task's OWN axes (budget / turns / walltime) run out, suspend or fail? —
|
|
852
|
+
* and nothing else: the external causes (a scheduler's yield {@link preemptSignal}, a usage window, an env
|
|
853
|
+
* lifetime) suspend on the infrastructure alone, with or without this opt-in. When it is set, its `scope`,
|
|
854
|
+
* `ttlMs` and `maxSlices` still shape every resource-limit row this task mints, external ones included.
|
|
746
855
|
*/
|
|
747
856
|
resourceSuspend?: {
|
|
748
857
|
/** Multi-tenant isolation key, forced into the checkpoint + `resolve`/`reap` WHERE. Required. */
|
|
@@ -794,12 +903,16 @@ export interface TaskSpec {
|
|
|
794
903
|
* suspend — only the trigger differs), and is resumed later via `runner.resume(token, {gate:"resource_limit",
|
|
795
904
|
* decision:"continue"}, …)` exactly like any resource-limit resume (continue the work, no decision).
|
|
796
905
|
*
|
|
797
|
-
* **Eligibility
|
|
798
|
-
*
|
|
799
|
-
*
|
|
800
|
-
*
|
|
801
|
-
*
|
|
802
|
-
*
|
|
906
|
+
* **Eligibility = the infrastructure, nothing else** (the same family as an env lifetime or a usage window —
|
|
907
|
+
* a yield is an external cause, not an allowance the task chose): a `checkpointStore` is wired, tool results
|
|
908
|
+
* are durable, and the per-task env (if any) is in a suspend target. No `resourceSuspend` opt-in is needed
|
|
909
|
+
* (when one is set, its `scope` / `ttlMs` / `maxSlices` shape the row). The leg's readiness is reported up
|
|
910
|
+
* front on the effective wiring manifest (`suspendLane`). If the yield cannot be honoured — the
|
|
911
|
+
* infrastructure is not ready, or the suspend was refused without writing anything — the run CONTINUES (a
|
|
912
|
+
* yield is a request, not a stop; `signal` / TaskStop are the stop) and says so once on `RunnerDeps.onError`
|
|
913
|
+
* (`phase: "config"`) plus the `preempt.ignored` trace frame. The request is answered once per leg. The
|
|
914
|
+
* three refusals that stop the run themselves (the slice cap, a paused VM that could not be restored, a
|
|
915
|
+
* write whose outcome is unknown) still stop it.
|
|
803
916
|
*
|
|
804
917
|
* **Re-supply on resume:** like `resourceSuspend`/`durableApproval`, this is part of the resume task config —
|
|
805
918
|
* a long task that is resumed may need re-preemption, so supply a FRESH `preemptSignal` (a new
|
|
@@ -810,13 +923,15 @@ export interface TaskSpec {
|
|
|
810
923
|
* design/131 — per-task resilience overrides, INTENT-ONLY (no decorator
|
|
811
924
|
* topology on the spec; the deployment's brain stack stays the single owner). For bench/eval or
|
|
812
925
|
* critical tasks that need the provider's TRUE failure shape instead of a silent fallback:
|
|
813
|
-
* - `allowDegrade:false` —
|
|
926
|
+
* - `allowDegrade:false` — the model lane does not walk the requested model's `fallbacks` chain for
|
|
927
|
+
* this task (failure passes through).
|
|
814
928
|
* - `allowFailover:false` — cross-gateway failover is off (only the primary brain is tried).
|
|
815
929
|
* - `bypassBreaker:true` — an open circuit breaker's fast-fail is waived for THIS task; outcomes
|
|
816
930
|
* are still recorded (shared observation undiminished). Operator-facing — deployments SHOULD
|
|
817
931
|
* NOT expose this to wire users directly (it defeats provider protection).
|
|
818
932
|
* All absent ⇒ exactly today's behavior. Threaded per-call as `StreamOptions.resilience`; the
|
|
819
|
-
* first-party
|
|
933
|
+
* engine's model lane and the first-party failover/breaker decorators honor it, custom brains may
|
|
934
|
+
* ignore it.
|
|
820
935
|
*/
|
|
821
936
|
resilience?: ResilienceOptions;
|
|
822
937
|
/**
|
|
@@ -870,8 +985,8 @@ export interface TaskSpec {
|
|
|
870
985
|
* second set of rules to keep in sync with the first.
|
|
871
986
|
*
|
|
872
987
|
* Consequence worth stating, because this field used to answer only "WHICH store": on a store-null
|
|
873
|
-
* run {@link
|
|
874
|
-
*
|
|
988
|
+
* run a scheduler's yield ({@link preemptSignal}) cannot be honoured — there is no suspend to yield
|
|
989
|
+
* into, so the run keeps going and says so once (`onError`, the `preempt.ignored` trace frame).
|
|
875
990
|
*
|
|
876
991
|
* Delegated children inherit it: the sync / background / fork spawn lanes copy the `"disabled"` word
|
|
877
992
|
* into every child spec (same discipline as `principal`), so a store-less run's whole tree stays store-less.
|
|
@@ -913,12 +1028,11 @@ export interface TaskSpec {
|
|
|
913
1028
|
* child runs its own inference over its own roster. A retained child woken by a DIFFERENT run
|
|
914
1029
|
* additionally folds the waker's declared `false` on top of the spawn snapshot (tighten-only,
|
|
915
1030
|
* like the other resume clamps).
|
|
916
|
-
* KNOWN
|
|
917
|
-
*
|
|
1031
|
+
* KNOWN GAP (registered, a whole-clamp-family shape — `handsReadOnly`/`interactiveTools` share
|
|
1032
|
+
* it): a TIER-3 durable revival rebuilds the child from the REVIVER's context (the durable row
|
|
918
1033
|
* records lookup keys, never a serialized spec), so the spawn-time declaration does not survive
|
|
919
|
-
* that lane — the reviver's own declaration governs
|
|
920
|
-
*
|
|
921
|
-
* workflow agent type does carry).
|
|
1034
|
+
* that lane — the reviver's own declaration governs. The workflow lane forwards it like the Task
|
|
1035
|
+
* lane does (`applyParentSpecSeat` at the `agent()` launch site).
|
|
922
1036
|
*/
|
|
923
1037
|
memoryPersistenceCapable?: boolean;
|
|
924
1038
|
/**
|
|
@@ -1030,7 +1144,7 @@ export interface TaskSpec {
|
|
|
1030
1144
|
* criterion (this knob unset): a human-facing tool mounts only when the deployment has SOME face that
|
|
1031
1145
|
* can deliver it to a person —
|
|
1032
1146
|
* · `AskUserQuestion`: a live `onQuestion` (spec ?? deps), OR a durable park consumer = a wired
|
|
1033
|
-
* `checkpointStore` AND (`durableApproval` opted in OR a `forceDurableGate` entitlement) — the
|
|
1147
|
+
* `checkpointStore` AND (`durableApproval` opted in OR a `forceDurableGate` entitlement on a root leg) — the
|
|
1034
1148
|
* approval-center posture (≅ CC's SDK permission-prompt-tool exception).
|
|
1035
1149
|
* · `present_plan` (within `enablePlanMode`): a wired `checkpointStore` — the `plan_review` park's
|
|
1036
1150
|
* only consumer (without one the pause is a silent no-op the model mistakes for a delivered plan).
|
|
@@ -1183,13 +1297,29 @@ export interface TaskSpec {
|
|
|
1183
1297
|
* design/129 — lifetime scope for BACKGROUND children (Agent/Fork `run_in_background`). Default `"task"`:
|
|
1184
1298
|
* the parent runTask's terminal reaps them (design/115 — no orphans burning tokens; turn-end killed
|
|
1185
1299
|
* frame). `"session"`: children OUTLIVE the turn (CC Backgrounded semantics) — registered under the
|
|
1186
|
-
* SESSION owner (a later turn's TaskStop and the host poll reach it), skipped by the parent-teardown reap,
|
|
1187
|
-
* a
|
|
1188
|
-
* `TaskRegistry.reapSessionBackground(sessionId, scope)`
|
|
1300
|
+
* SESSION owner (a later turn's TaskStop and the host poll reach it), skipped by the parent-teardown reap, and given NO engine
|
|
1301
|
+
* default wall-clock ceiling (design/164: a task-level ceiling is stated by the caller or absent). It is collected by the host
|
|
1302
|
+
* calling `TaskRegistry.reapSessionBackground(sessionId, scope)` from its session release/sweep, and — for a child gone SILENT —
|
|
1303
|
+
* `TaskRegistry.reapStaleSessionBackgroundAgents(staleMs)`, which collects by stall, not by age, at a threshold the caller
|
|
1304
|
+
* chooses (the engine ships no default). `TaskRegistry.countRunningSessionBackgroundAgents()` reads how many are in flight.
|
|
1189
1305
|
* CALLER-trusted (systemPrompt tier): never a model-facing parameter, never on the governed workflow
|
|
1190
1306
|
* whitelist — a child's lifetime crossing the turn boundary is an isolation-contract surface.
|
|
1191
1307
|
*/
|
|
1192
1308
|
backgroundScope?: "task" | "session";
|
|
1309
|
+
/**
|
|
1310
|
+
* The command sandbox this task requires: the reference's `sandbox` settings under their own key names
|
|
1311
|
+
* ({@link TaskSandboxSettings}; `enabled: true` puts it in force). In force, every command the model's shell tools
|
|
1312
|
+
* start runs inside the OS sandbox of the environment it runs on — the boundary is these settings' filesystem and
|
|
1313
|
+
* network lists plus the task's write roots, the run's read-deny table beside them — or is not started. An environment
|
|
1314
|
+
* that keeps no command sandbox (`capabilities.commandSandbox`) refuses the run at prepare
|
|
1315
|
+
* (`config.command_sandbox_unavailable`), unless `failIfUnavailable` is `false`, which announces it under the same code
|
|
1316
|
+
* and runs the commands unsandboxed. A value that is not the settings' shape, a key they do not carry (the two merge-time
|
|
1317
|
+
* keys included), or a path that is neither absolute nor `~/` refuses the run (`config.sandbox_settings_invalid`, naming
|
|
1318
|
+
* the key). A delegated child runs under its parent's requirement as a floor (`mergeChildSandbox`).
|
|
1319
|
+
* DEPLOYMENT-trusted: the members that would loosen it are the host's to admit from its settings sources; never a
|
|
1320
|
+
* model-facing parameter.
|
|
1321
|
+
*/
|
|
1322
|
+
sandbox?: TaskSandboxSettings;
|
|
1193
1323
|
/**
|
|
1194
1324
|
* A1 — structured SANDBOX facts for the `# Environment` block, so the agent knows what
|
|
1195
1325
|
* toolchains the environment already carries (no blind reinstall), which package source installs go
|
|
@@ -1348,7 +1478,7 @@ export interface TaskSpec {
|
|
|
1348
1478
|
* Override auto-compaction thresholds for this task's session. Compaction (LLM summary, persisted
|
|
1349
1479
|
* to the session) runs in two places sharing these settings: at every within-task turn boundary
|
|
1350
1480
|
* (design/64 §25 (A) — the long-single-task case) and once at task end (the between-task case).
|
|
1351
|
-
* Defaults: both seats on (`autoCompact` / `manualCompact` below), reserveTokens 16384, keepRecentTokens 0 (design/169-C; 20000 was the
|
|
1481
|
+
* Defaults: both seats on (`autoCompact` / `manualCompact` below), reserveTokens 16384 (else `contextSettings[word].reserveTokens`; a value stated here is the author), keepRecentTokens 0 (design/169-C; 20000 was the
|
|
1352
1482
|
* pre-169 default). A zero budget is NOT "no verbatim tail": the cut-point search has a
|
|
1353
1483
|
* structural floor under the budget, so the default already leaves the last exchange verbatim
|
|
1354
1484
|
* after the summary (a trailing tool-result batch keeps its emitting assistant with it) — the
|
|
@@ -1449,10 +1579,10 @@ export interface TaskSpec {
|
|
|
1449
1579
|
* task family wins, CC isTodoV2) hasn't been used for 10 assistant turns, re-surface the list
|
|
1450
1580
|
* (thin projection; an all-completed list is cleared, never regurgitated). No tools mounted ⇒
|
|
1451
1581
|
* permanently silent.
|
|
1452
|
-
* - `changedFiles`:
|
|
1453
|
-
* whose mtime moved past the recorded read time
|
|
1454
|
-
* blindly revert — re-read"). OFF ⇒ zero stat calls.
|
|
1455
|
-
* refreshes the read stamp); mtime skew on exotic fs remains a documented false-positive source.
|
|
1582
|
+
* - `changedFiles`: stat of ≤20 (or `maxFiles`) most-recently-READ files at a turn boundary and a
|
|
1583
|
+
* leg's first request (fresh run, resumed leg); a file whose mtime moved past the recorded read time
|
|
1584
|
+
* (+2s epsilon) is listed (path-only v1, "do not blindly revert — re-read"). OFF ⇒ zero stat calls.
|
|
1585
|
+
* Self-edits are immune (write-back refreshes the read stamp); mtime skew on exotic fs remains a documented false-positive source.
|
|
1456
1586
|
* - `backgroundTasks` (G1 通告层 — CC /compact parity): after a compaction LANDS, the
|
|
1457
1587
|
* next boundary announces this run's still pending/running background tasks (task registry
|
|
1458
1588
|
* snapshot: id/description/status, CC three-state copy). ONE-SHOT per compaction — never
|
package/dist/core/task-spec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const TASK_WAKE_SOURCES = Object.freeze(["parked_notifications"]);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Layer 0 vocabulary; `types.ts` re-exports the name, so no consumer's import changes.
|
|
6
6
|
*/
|
|
7
7
|
import type { ActorAssertion } from "../internal/llm.js";
|
|
8
|
-
import type { CompactOutcome, TaskEvent } from "./task-event.js";
|
|
8
|
+
import type { CompactOutcome, HumanInputSource, TaskEvent } from "./task-event.js";
|
|
9
9
|
import type { TaskResult } from "./task-result.js";
|
|
10
10
|
/** A running task you can iterate for live events and await for the final result. */
|
|
11
11
|
export interface TaskStream extends AsyncIterable<TaskEvent> {
|
|
@@ -53,7 +53,7 @@ export interface TaskStream extends AsyncIterable<TaskEvent> {
|
|
|
53
53
|
* evidence of a replay, and two callers colliding on one id must not silently lose the second
|
|
54
54
|
* (the parked leg's `appendPendingSteer` judges and refuses it identically). The error carries
|
|
55
55
|
* `detail.differs` — the facets that differ (closed `STEER_REPLAY_FACETS`: `text`, `trusted`,
|
|
56
|
-
* `priority`, `actor`, `runOrigin` — this verb takes no run origin, so a repeat here never differs in it),
|
|
56
|
+
* `priority`, `actor`, `runOrigin`, `source` — this verb takes no run origin, so a repeat here never differs in it),
|
|
57
57
|
* compared on what the caller SENT, never on the framed bytes. With `text`
|
|
58
58
|
* among them it is another instruction: re-issue it under a fresh id. Without, it is the accepted one
|
|
59
59
|
* re-sent at another tier / trust / attribution, which acceptance does not change: a fresh id would
|
|
@@ -133,12 +133,22 @@ export interface TaskStream extends AsyncIterable<TaskEvent> {
|
|
|
133
133
|
* replay identity is over the CALLER's bytes — hook output never enters it. Engine-authored
|
|
134
134
|
* frames (task notifications, diagnostics) and external `notify()` text are OUT of the screen's
|
|
135
135
|
* domain (notifications are sanitized DATA, not prompts — the notify contract's ruling).
|
|
136
|
+
*
|
|
137
|
+
* @contract steer.source — WHO the sender says wrote the text: `"steer"` (a person's words; the default when omitted) or
|
|
138
|
+
* `"system"` (text the sender produced itself — a shell's own plan outcome or wake notice). Read ONCE, refused typed outside
|
|
139
|
+
* the two (`steering.invalid_content`), and the one value is read on every face that names a source: the model gets a
|
|
140
|
+
* `"system"` text as its sender wrote it — no speaker label, no person's mid-turn frame (`trusted` still decides whether it
|
|
141
|
+
* rides the reminder, a separate question); the `human_input` frames report `source: "system"`; and the screen above STILL
|
|
142
|
+
* runs, seeing `ctx.source: "system"` — a deployment that exempts its shell's own injections branches on that value (the
|
|
143
|
+
* reference engine screens its own synthesized prompts too). The value rides a durable park and keeps all three readings on
|
|
144
|
+
* the resume (the redelivery screen sees `"system"` too); it is a replay facet (`detail.differs: ["source"]`).
|
|
136
145
|
*/
|
|
137
146
|
steer(text: string, options?: {
|
|
138
147
|
trusted?: boolean;
|
|
139
148
|
actor?: ActorAssertion;
|
|
140
149
|
inputId?: string;
|
|
141
150
|
priority?: import("./task-notification.js").SystemInjectionPriority;
|
|
151
|
+
source?: Extract<HumanInputSource, "steer" | "system">;
|
|
142
152
|
}): Promise<void>;
|
|
143
153
|
/**
|
|
144
154
|
* design/144 §2 — inject an EXTERNAL structured event into this run's task-notification lane, as a
|
|
@@ -75,8 +75,8 @@ export type TerminalCause = {
|
|
|
75
75
|
* - `"usage_window.store_cost_unanswered"` — the wired ledger does not carry the money arm.
|
|
76
76
|
* Two codes name a model whose output the loop could not use after its bounded retries — the run did not
|
|
77
77
|
* finish its work, though its last turn reads like an ordinary one:
|
|
78
|
-
* - `"model.malformed_tool_use_exhausted"` — every tool call of the model's turns kept arriving unparseable
|
|
79
|
-
* and the retry budget is spent (nothing ran for them).
|
|
78
|
+
* - `"model.malformed_tool_use_exhausted"` — every tool call of the model's turns kept arriving unparseable, or
|
|
79
|
+
* kept naming the same tool the run does not mount, and the retry budget is spent (nothing ran for them).
|
|
80
80
|
* - `"model.truncated_output_exhausted"` — the model's answer kept ending on the output cap and the
|
|
81
81
|
* continue budget is spent (`result` holds the text it reached).
|
|
82
82
|
* `"unexpected.suspended"` / `"unexpected.needs_review"` — a nested orchestrator stopped at a durable pause and
|
|
@@ -108,8 +108,9 @@ export type TerminalCause = {
|
|
|
108
108
|
nestedPause?: PausedCause;
|
|
109
109
|
/**
|
|
110
110
|
* What a RESUMED leg that ended before its approved action started did to its checkpoint row — the store's own
|
|
111
|
-
* outcome, stated by the exit that compensated it: `reopened` (pending again: the same token resumes it
|
|
112
|
-
* `declined` (the store refused to reopen it — read the row),
|
|
111
|
+
* outcome, stated by the exit that compensated it: `reopened` (pending again: the same token resumes it — also when the
|
|
112
|
+
* reopen threw and the row read afterwards shows it landed), `declined` (the store refused to reopen it — read the row),
|
|
113
|
+
* `unknown` (the reopen threw and the row does not show it landed: its state is unprovable).
|
|
113
114
|
* Beside `code`, never folded into it: the code still names what ended the leg. PRESENCE: only on such a leg; a
|
|
114
115
|
* fresh run, a leg that started its approved action and a delivered negative decision carry none.
|
|
115
116
|
*/
|
|
@@ -221,6 +222,13 @@ export type TerminalFailureDetail = {
|
|
|
221
222
|
providerConditionSource?: ProviderConditionSource;
|
|
222
223
|
/** The terminal message's `providerResetAtMs`, carried beside a `quota_exhausted` condition. */
|
|
223
224
|
providerResetAtMs?: number;
|
|
225
|
+
/**
|
|
226
|
+
* The provider's own sentence for the refusal — its error envelope's `error.message`, after the one pass over a remote's words: the
|
|
227
|
+
* request's declared values and credential shapes masked, a URL or a multi-segment path withheld, one line, at most 240 code points. The
|
|
228
|
+
* retry frames of the same call carry the same member. Present when the refusal's body ended and parsed as a provider envelope that states a
|
|
229
|
+
* sentence; absent for a plain-text, torn, unended or empty body — the account says the provider stated no trusted sentence, never an empty one.
|
|
230
|
+
*/
|
|
231
|
+
providerMessage?: string;
|
|
224
232
|
/**
|
|
225
233
|
* The route the refused request took (`AssistantMessage.apiErrorRoute`): where its credential came from, how it
|
|
226
234
|
* rode, which knob named its root — the knob words of `ROUTE_CREDENTIAL_PAIRING`, never a key value or a URL.
|
|
@@ -24,6 +24,9 @@ export declare function thrownIs<T>(value: unknown, ctor: abstract new (...args:
|
|
|
24
24
|
* precisely because the value crossed a seam, so binding the test to this realm's `Error.prototype`
|
|
25
25
|
* defeats it. Whether an EMPTY name folds to `undefined` is policy and stays at the call site. */
|
|
26
26
|
export declare function thrownName(err: unknown): string | undefined;
|
|
27
|
+
/** What a refusal says was thrown at it: the name of the thrown value, bounded (never its message — a message can quote a stored
|
|
28
|
+
* value or a host's own text); the value's `typeof` when it carries no name. */
|
|
29
|
+
export declare function boundedThrownName(e: unknown): string;
|
|
27
30
|
/**
|
|
28
31
|
* Turning a value that was THROWN at us into text — the ONE rule, for the whole engine.
|
|
29
32
|
*
|
|
@@ -103,18 +106,57 @@ export declare function asThrownError(err: unknown): Error;
|
|
|
103
106
|
* passes it only when it IS an own key (a data property shadows the accessor; both readings agree).
|
|
104
107
|
*/
|
|
105
108
|
export declare function readMember(value: unknown, key: string): unknown;
|
|
109
|
+
/** What {@link readMemberOrUnreadable} answers for a member that threw when read (a throwing accessor, a revoked proxy). */
|
|
110
|
+
export declare const UNREADABLE: unique symbol;
|
|
111
|
+
/** {@link readMember} for the caller that must tell a member that is absent from one that would not answer: the same one guarded
|
|
112
|
+
* read, with the failure kept as {@link UNREADABLE} instead of folded into `undefined`. A flag that cannot be read is not a flag
|
|
113
|
+
* that is off. */
|
|
114
|
+
export declare function readMemberOrUnreadable(value: unknown, key: string): unknown;
|
|
106
115
|
/** The PLURAL of {@link readMember}: read a value's own enumerable members, once each, into an inert
|
|
107
|
-
* snapshot — for sites that want a COPY of a whole bag an untrusted value handed over (a
|
|
108
|
-
*
|
|
116
|
+
* snapshot — for sites that want a one-level COPY of a whole bag an untrusted value handed over (a
|
|
117
|
+
* seat's record of names, a persisted row's `details`, a model message's members; a thrown value's
|
|
118
|
+
* marks are the tool door's, {@link thrownMarksOf}). The idiom it replaces is `{ ...value }`,
|
|
109
119
|
* a second way of running the value's code: the spread asks for its own keys and evaluates every
|
|
110
120
|
* getter behind them, so one hostile member took the copy down with it, and a revoked proxy traps the
|
|
111
121
|
* enumeration itself (even `Array.isArray` on one throws). Non-objects, arrays (spreading one yields
|
|
112
122
|
* index keys) and anything whose keys cannot be enumerated answer `undefined` — "there is no bag
|
|
113
123
|
* here"; a member that refuses to be read comes back `undefined` in a PRESENT key. */
|
|
114
124
|
export declare function readOwnMembers(value: unknown): Record<string, unknown> | undefined;
|
|
115
|
-
/** The
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
125
|
+
/** The elements of an untrusted LIST, each read once into an inert snapshot — {@link readMember}'s plural for an array, where
|
|
126
|
+
* {@link readOwnMembers} answers `undefined` for one. An element that refuses to be read comes back `undefined` in its place: the
|
|
127
|
+
* readable ones are kept, and the count is still the list's. Every own index is an element, enumerable or not; a hole is no element
|
|
128
|
+
* and a property that is not an index is none. A value that is not a list, or whose keys cannot be enumerated (a revoked proxy traps
|
|
129
|
+
* the array test itself), answers `undefined` — "there is no list here". */
|
|
130
|
+
export declare function readElements(value: unknown): unknown[] | undefined;
|
|
131
|
+
/** The MACHINE-READABLE marks a thrown value carries — THE extractor, for every reader that lifts them: the tool layer's
|
|
132
|
+
* rewrap of a `defineTool` body's throw, the loop's error result, the resume leg's. `details` is received through the tool
|
|
133
|
+
* door ({@link receivedToolData}: what a returned `details` passes, so a body's thrown and returned marks are one reading)
|
|
134
|
+
* and is a bag only when it is a record; a string `errorKind` is folded in over it. A value the door refuses (a Proxy, an
|
|
135
|
+
* object with its own `toJSON`) and a `details` that is not a record carry nothing; a member the door leaves out (a getter
|
|
136
|
+
* that throws, a bigint, a function, a cycle) costs that member. A bare `.code` is never read: a platform error's own code
|
|
137
|
+
* (`ENOENT`) is the platform's word. `undefined` = nothing to carry; a caller that must always present a bag folds that
|
|
138
|
+
* itself. */
|
|
120
139
|
export declare function thrownMarksOf(err: unknown): Record<string, unknown> | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Is `code` spelled as a code of this engine's family — the engine's own words and a host adapter's lowercase ones — rather than
|
|
142
|
+
* a platform's, a driver's or a library's (`ENOENT`, `ERR_INVALID_URL`, `UND_ERR_SOCKET`, `ER_NET_READ_ERROR`, the SQLSTATE
|
|
143
|
+
* `42P01`, a class name, a hyphenated word)? THE one test of that question: a reader that must keep a platform's word off a
|
|
144
|
+
* face that carries only the engine's vocabulary asks it here. It judges the spelling, not the provenance — a third party's
|
|
145
|
+
* lowercase word (`rate_limit_exceeded`) passes, a host's own upper-case one fails, and the engine's own platform-family
|
|
146
|
+
* spellings (`PROXY_TUNNEL_REFUSED`, the mark a dispatcher puts on a proxy's refusal, read beside `ECONNREFUSED`) are
|
|
147
|
+
* platform words by intent. A non-string answers `false`.
|
|
148
|
+
*/
|
|
149
|
+
export declare function isEngineCodeShape(code: string): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* THE mint of an engine refusal that a tool body can throw and a caller keys on by code. The code rides both spellings of the one
|
|
152
|
+
* fact from one argument, so they cannot disagree: `.code` (what a direct caller of the throwing function reads) and
|
|
153
|
+
* `details.code` (the mark {@link thrownMarksOf} lifts onto the tool result, which `tool_end.errorCode` then carries).
|
|
154
|
+
* The extractor never reads a bare `.code` — a platform error's own code (`ENOENT`) is the platform's word, not the engine's —
|
|
155
|
+
* so a refusal that is thrown out of a tool body is minted here or its frame carries no code.
|
|
156
|
+
*/
|
|
157
|
+
export declare function codedRefusal<C extends string>(code: C, message: string): Error & {
|
|
158
|
+
code: C;
|
|
159
|
+
details: {
|
|
160
|
+
readonly code: C;
|
|
161
|
+
};
|
|
162
|
+
};
|