@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
|
@@ -21,6 +21,7 @@ import type { ActiveWorktreeSession, AgentHarness, AgentMessage, AgentTool, Anno
|
|
|
21
21
|
import type { Model } from "../../internal/llm.js";
|
|
22
22
|
import type { WorkflowSizeGuideline } from "../../orchestration/workflow-size-guideline.js";
|
|
23
23
|
import type { ToolManifestRow } from "../../prompt-assembly/tool-catalog.js";
|
|
24
|
+
import type { EngineText } from "../../prompt-assembly/engine-text.js";
|
|
24
25
|
import type { CwdRef, ContainmentFace } from "../../tools/fs/index.js";
|
|
25
26
|
/** A leg's WRITE face: the face in force (read per call, following the mode's face) and whether a seat or a clamp DECLARED the fence (a checkpoint row records it; a resume keeps it). */
|
|
26
27
|
export interface WriteFaceSeat {
|
|
@@ -28,10 +29,11 @@ export interface WriteFaceSeat {
|
|
|
28
29
|
readonly fenced: boolean;
|
|
29
30
|
}
|
|
30
31
|
import type { MaterializedA2a } from "../a2a.js";
|
|
31
|
-
import type {
|
|
32
|
+
import type { CompactedFrameSource, CompactionForkContext, MaybeCompactOptions, RapidRefillState } from "../auto-compaction.js";
|
|
32
33
|
import type { AutoModeArmingRecipe } from "../auto-mode-arming.js";
|
|
33
34
|
import type { AutoModeDecider, AutoModeDenialTracker, DenialLimitFallbackFace } from "../auto-mode.js";
|
|
34
|
-
import type {
|
|
35
|
+
import type { SettlementKind } from "../gate-outcome.js";
|
|
36
|
+
import type { AskClass } from "../ask-origin.js";
|
|
35
37
|
import type { CacheBreakDetector, ToolFingerprintInput } from "../cache-break-detector.js";
|
|
36
38
|
import type { Checkpoint, CheckpointState, CheckpointStore, CheckpointToken, PendingSteerEntry, PlatformLimitReason, ReopenReason, ResourceLedger, ResourceLimitReason, ResumeOutcome, SerializedCheckpointState } from "../checkpoint-store.js";
|
|
37
39
|
import type { ExecutionOutcomeRecordWord } from "../checkpoint-execution-record.js";
|
|
@@ -39,6 +41,7 @@ import type { ClearedProjectionLedger, MicroCompactMachine, OccurrenceIndex } fr
|
|
|
39
41
|
import type { ModBus } from "../mods/kernel/index.js";
|
|
40
42
|
import type { LegModBus, LegMods } from "../mods/stations.js";
|
|
41
43
|
import type { HookInvocationIdentity, OrgGateVerdict, PermissionDeniedPayload, PostToolBatchCall, ToolGateInput } from "../hooks.js";
|
|
44
|
+
import type { LegNotice } from "../leg-identity.js";
|
|
42
45
|
import type { MaterializedMcp } from "../mcp.js";
|
|
43
46
|
import type { MemoryEngine } from "../memory-engine/engine.js";
|
|
44
47
|
import type { ResolvedSkillListingBudget } from "../skill-listing-budget.js";
|
|
@@ -48,9 +51,10 @@ import type { SafeNotifier } from "../safe-notify.js";
|
|
|
48
51
|
import type { RecoveredOrphan } from "../session-reconcile.js";
|
|
49
52
|
import type { SessionStore, StoredSession } from "../session.js";
|
|
50
53
|
import type { TaskOutcome } from "../task-outcome.js";
|
|
54
|
+
import type { SessionBoundSpecMember } from "../task-spec-members.js";
|
|
51
55
|
import type { ModelPricing } from "../pricing.js";
|
|
52
56
|
import type { PushQueue } from "../push-queue.js";
|
|
53
|
-
import type { SystemInjectionPriority, TaskNotificationPayload } from "../task-notification.js";
|
|
57
|
+
import type { SessionAddress, SessionCompletionLane, SystemInjectionPriority, TaskNotificationPayload, TaskNotificationSink } from "../task-notification.js";
|
|
54
58
|
import type { OnAsk, PermissionResult, ResolvedAsk, ToolCallRequest, ToolPolicy } from "../tool-policy.js";
|
|
55
59
|
import type { PlacementTarget, RemoteExecutionEnv, SnapshotId, WorkspaceHandle } from "../remote-env.js";
|
|
56
60
|
import type { ToolDisclosureManifest } from "../trace.js";
|
|
@@ -63,21 +67,15 @@ import type { GitStatusLaneRef } from "./git-status-frame.js";
|
|
|
63
67
|
import type { SessionReadFileStates } from "./session-read-file-states.js";
|
|
64
68
|
import type { LegModeCeiling, SessionModeSeats } from "./session-mode-seats.js";
|
|
65
69
|
import type { BlockedRef, OutputRef, SkillListingEntry } from "./synthetic-tools.js";
|
|
66
|
-
import type { AttachmentSource
|
|
70
|
+
import type { AttachmentSource } from "../attachment-source.js";
|
|
71
|
+
import type { createAttachmentState, WriteFamily } from "./turn-attachments.js";
|
|
67
72
|
import type { SideCallBook } from "./side-call-account.js";
|
|
73
|
+
import type { ModelFallbackSeat } from "./model-fallback-seat.js";
|
|
74
|
+
import type { DrainedLegFrame, LegAt } from "./leg-frame.js";
|
|
68
75
|
import type { cacheFamilyOf } from "./usage-accounting.js";
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
* selector from them once the leg's delegation facts are known ({@link ToolFaceSnapshot}).
|
|
73
|
-
*/
|
|
74
|
-
export interface ToolFaceLists {
|
|
75
|
-
allow: readonly string[] | undefined;
|
|
76
|
-
exclude: readonly string[] | undefined;
|
|
77
|
-
defer: readonly string[] | undefined;
|
|
78
|
-
alwaysLoad: readonly string[] | undefined;
|
|
79
|
-
restoreGated: readonly string[] | true | undefined;
|
|
80
|
-
}
|
|
76
|
+
/** The frozen task-start copies of the caller's tool-face control arrays (the config-doors phase reads them through
|
|
77
|
+
* `readToolFaceLists`, synchronously, before the first await); the driver compiles the selector from them ({@link ToolFaceSnapshot}). */
|
|
78
|
+
export type { ToolFaceLists } from "../tool-face-lists.js";
|
|
81
79
|
/**
|
|
82
80
|
* The leg's tool face: its compiled tool selector (the ONE answer to "may this run use this tool" — the roster valve, every
|
|
83
81
|
* "is X available" mount decision, the MCP refresh and re-dial, the deferred-search lane, and the ceiling every child inherits)
|
|
@@ -171,14 +169,14 @@ export interface UsageGovernance {
|
|
|
171
169
|
commit(cumulativeTokens: number, cumulativeCostMicroUsd: number | undefined, now: number): Promise<void>;
|
|
172
170
|
}
|
|
173
171
|
/**
|
|
174
|
-
* The run's turn-start file-history BOUNDARY seat. `begin(entryId)` starts the capture
|
|
175
|
-
*
|
|
176
|
-
* `settle()` awaits the in-flight capture's settle and is the caller's LEASE CLOSE (awaited before
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
172
|
+
* The run's turn-start file-history BOUNDARY seat. `begin(entryId)` starts the capture for the turn's own entry — the run's
|
|
173
|
+
* first committed row of a person's input (origin `human_input`; first-wins: at most one boundary per turn incarnation, DV-4);
|
|
174
|
+
* `settle()` awaits the in-flight capture's settle and is the caller's LEASE CLOSE (awaited before the next tool executes) as
|
|
175
|
+
* well as the finish-tail durability await. The capture is bounded by a 30s timeout whose abort FENCES the attempt (the
|
|
176
|
+
* store's `boundaryPublishVerdict` guarantees a timed-out capture never publishes); failure is disclosed via
|
|
177
|
+
* onError(phase:"rewind") and, to the person, `rewind.boundary_unrecorded`, and NEVER blocks the turn — a turn whose capture
|
|
178
|
+
* failed simply has no boundary (the reference behaves the same), and there is no mid-turn re-capture (the store's spent
|
|
179
|
+
* lease refuses it with zero reads).
|
|
182
180
|
*/
|
|
183
181
|
export interface FileHistoryBoundarySeat {
|
|
184
182
|
begin(entryId: string): void;
|
|
@@ -216,12 +214,21 @@ export interface DateAnchorRead {
|
|
|
216
214
|
} | undefined;
|
|
217
215
|
/** The current segment: the nearest compaction entry's id, null before the first compaction. */
|
|
218
216
|
segment: string | null;
|
|
217
|
+
/** The request head the anchor for the current segment recorded (the head of the epoch the session last
|
|
218
|
+
* opened); undefined ⇒ none recorded — the leg compares nothing and anchors its own. */
|
|
219
|
+
head?: PrefixHeadDigests;
|
|
220
|
+
}
|
|
221
|
+
/** A leg's request head as the session's epoch anchor keeps it: one short unsalted digest per prompt block (by block
|
|
222
|
+
* id) and the tool table's wire digest — what a later leg compares its own head with to name the segments that moved. */
|
|
223
|
+
export interface PrefixHeadDigests {
|
|
224
|
+
blocks: Readonly<Record<string, string>>;
|
|
225
|
+
tools: string;
|
|
219
226
|
}
|
|
220
227
|
/**
|
|
221
228
|
* One engine frame whose commit waits for the receipt of the message carrying it.
|
|
222
229
|
*
|
|
223
230
|
* @contract frames.commit_on_receipt — an engine-minted frame that rides a user message (the git-status
|
|
224
|
-
* frame, a leg's first-request frames, every turn-boundary attachment
|
|
231
|
+
* frame, a leg's first-request frames, every turn-boundary attachment) is recorded —
|
|
225
232
|
* an announced set or value, a drained pending entry, a once digest, a window's stamp, a latch, its echo and count
|
|
226
233
|
* — ONLY when the run loop's `message_end` walk sees a persisted user entry whose text equals the carrying text it
|
|
227
234
|
* was registered with; every receipt with that text settles on that one entry. Collection records nothing: a
|
|
@@ -234,10 +241,26 @@ export interface FrameReceipt {
|
|
|
234
241
|
text: string;
|
|
235
242
|
/** Which frame this receipt settles. No collector renders a frame whose receipt is still pending (the frame is on
|
|
236
243
|
* its way, not yet in the transcript) — the one reading is `frameCarried` (compaction-restate.ts). */
|
|
237
|
-
source: "git_status" | "posture" | "advisor_tool" | "
|
|
238
|
-
/** Runs inside the `message_end` walk
|
|
239
|
-
*
|
|
240
|
-
|
|
244
|
+
source: "git_status" | "posture" | "advisor_tool" | "language" | AttachmentSource;
|
|
245
|
+
/** Runs inside the `message_end` walk: advances the run-local record and parks any session write for the next
|
|
246
|
+
* serialization point. Synchronous, except a step that must read the session first (a changed-files notice's
|
|
247
|
+
* announcement, {@link announceWhenCarried}): it returns a promise the walk's handler hands back, so the
|
|
248
|
+
* announcement lands before the next listener reads the event. */
|
|
249
|
+
commit: (entryId: string) => void | Promise<void>;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* The limit-approach notice's leg seat. The turn boundary measures the axes and records the HIGHEST threshold the tightest
|
|
253
|
+
* one has crossed, with the sentence that crossing froze; the request-build handler appends that one sentence to the end of
|
|
254
|
+
* every request built after it — never steered, never written to the transcript, one sentence per request (a higher crossing
|
|
255
|
+
* replaces the lower one, it is not added to it). `announce` is the crossing's echo and count, run by the first request that
|
|
256
|
+
* carries it and then cleared, so each threshold is counted once however many requests carry it.
|
|
257
|
+
*/
|
|
258
|
+
export interface LimitApproachSeat {
|
|
259
|
+
crossed?: {
|
|
260
|
+
index: 0 | 1;
|
|
261
|
+
text: string;
|
|
262
|
+
announce?: () => void;
|
|
263
|
+
};
|
|
241
264
|
}
|
|
242
265
|
/** The leg's frame-receipt ledger — see {@link FrameReceipt}. `listingSnapshotOwed` is the parked
|
|
243
266
|
* announced-listing snapshot write (a session append from inside the walk would race the loop's own
|
|
@@ -400,7 +423,7 @@ export interface Prepared {
|
|
|
400
423
|
* assembly would. Always present on Prepared; independent of whether a fileHistoryStore is wired. */
|
|
401
424
|
editedFilesSnapshot: () => TaskResult["editedFiles"];
|
|
402
425
|
/** The run's turn-start boundary seat (present iff the run records file history into a wired store and
|
|
403
|
-
* the run mounts a real fs env). runtask calls begin() at the first committed
|
|
426
|
+
* the run mounts a real fs env). runtask calls begin() at the first committed row of a person's input and
|
|
404
427
|
* awaits settle() at the lease close + the finish tail. */
|
|
405
428
|
fileHistoryBoundary?: FileHistoryBoundarySeat;
|
|
406
429
|
/** The run's RESOLVED read face for the result observation seat
|
|
@@ -437,6 +460,10 @@ export interface Prepared {
|
|
|
437
460
|
toolProgressRef: {
|
|
438
461
|
current?: ToolProgressLane;
|
|
439
462
|
};
|
|
463
|
+
/** The leg's `$.turn.abort` seat, late-bound like `toolProgressRef`: the mods facade is bound during prepare,
|
|
464
|
+
* the turn counter and the notice sink exist only in the run body, which fills `seat`. Unfilled means no run
|
|
465
|
+
* body owns the leg yet, and the method answers "no model request is running". */
|
|
466
|
+
turnAbortRef: import("../mods/dollar.js").TurnAbortRef;
|
|
440
467
|
/** The run's advertised-writable-directory seat (present with hands): `roots` is what the prompt advertised as writable and the fence admitted. Read live wherever a policy is adjudicated off a resumed leg, so the write gate's exemption domain is that same list. `planFile` is the session plan file it admitted (`TaskSpec.planFile`) — the posture frames name it. */
|
|
441
468
|
advertisedWritableDirs?: Pick<import("./advertised-writable-dirs.js").AdvertisedWritableDirs, "roots" | "planFile" | "readPlanFile">;
|
|
442
469
|
/** The leg's ONE exempt root (its single resolution of `RunnerDeps.memoryEngineDir`), stamped wherever a policy is adjudicated off a resumed leg (`ToolCallRequest.exemptRoots`) — the same list the live gate stamps. */
|
|
@@ -485,7 +512,7 @@ export interface Prepared {
|
|
|
485
512
|
toolCallId: string;
|
|
486
513
|
toolName: string;
|
|
487
514
|
args: unknown;
|
|
488
|
-
|
|
515
|
+
answered: readonly AskClass[] | undefined;
|
|
489
516
|
}) => Promise<{
|
|
490
517
|
readonly refused: string;
|
|
491
518
|
readonly extension?: string;
|
|
@@ -494,6 +521,11 @@ export interface Prepared {
|
|
|
494
521
|
}>;
|
|
495
522
|
/** The leg's `tool.call` station (`mods/tool-call.ts`) — every execution of a call passes it; absent when no handler hangs on the event. */
|
|
496
523
|
toolCallStation?: import("../mods/tool-call.js").ToolCallStation;
|
|
524
|
+
/** One call's command sandbox plan by its wire name (`command-sandbox.ts`) — the gate's mint, for an approved call a durable
|
|
525
|
+
* RESUME executes outside the loop: that execution runs under it as a live call runs under the gate's. */
|
|
526
|
+
commandSandboxPlanOf: (call: {
|
|
527
|
+
readonly toolName: string;
|
|
528
|
+
}) => import("../command-sandbox.js").CommandSandboxPlan;
|
|
497
529
|
/** The leg's shell READ STATION, re-run on a durable RESUME before an approved shell call executes: the parked leg's
|
|
498
530
|
* admission died with that leg, so the resumed bytes are judged (and admitted for their pre-spawn re-establishment)
|
|
499
531
|
* on THIS leg — a deny row found now vetoes, an operator's edit is judged on the `rejudge` seat. */
|
|
@@ -561,8 +593,15 @@ export interface Prepared {
|
|
|
561
593
|
* leg always knows its identity.
|
|
562
594
|
*/
|
|
563
595
|
hookIdentity: HookInvocationIdentity;
|
|
596
|
+
/** Where this leg's user-face notices go and the admission every one is delivered under, minted ONCE in prepare beside the ask
|
|
597
|
+
* source ({@link mintLegNotice}): the leg's own session on a top-level leg, the delegation tree's root naming this leg on a
|
|
598
|
+
* delegated one. The gate's stations and the shell's withheld-variables line read it; no seat derives an address of its own. */
|
|
599
|
+
legNotice: LegNotice;
|
|
564
600
|
/** The leg's mods bus: one per leg, admitted at this leg's prepare (both seats, `plugin.register` run once for this leg). Every classic station raises its event on it; its `records` are the manifest's `mods[]`. */
|
|
565
601
|
modBus: ModBus;
|
|
602
|
+
/** End that bus's lifetime (`LegMods.end`): the leg's terminal does, before `session.end` (`raiseSessionEnd`); the lane
|
|
603
|
+
* that ran the leg does again on its way out, so no exit keeps a timer running. A second call does nothing. */
|
|
604
|
+
endModLife: () => void;
|
|
566
605
|
/** The leg's one admission seat (`session-append.ts`): a direct writer passes each row through it first (`appendAdmittedRow`). */
|
|
567
606
|
admitRows: RowAdmission;
|
|
568
607
|
/** The leg's one receiving station (`session-receive.ts`): the live lane, the turn-open redelivery and the box drain's pull
|
|
@@ -757,8 +796,11 @@ export interface Prepared {
|
|
|
757
796
|
/** `cause` is the structured mechanical fact the mark records (and the
|
|
758
797
|
* origin marker minted off it carries): `"observed"` for a witnessed external event,
|
|
759
798
|
* `"static"` for the capability over-approximation, `"derived"` for recall-taint. Absent
|
|
760
|
-
* folds to `"observed"` at mint time (the honest floor).
|
|
761
|
-
|
|
799
|
+
* folds to `"observed"` at mint time (the honest floor). The in-process half lands before it
|
|
800
|
+
* returns; the promise answers the DURABLE marker's outcome and never rejects — every caller
|
|
801
|
+
* delivers the external content only after it answered, and withholds it on `"unpersisted"`
|
|
802
|
+
* (the marker is what another engine reads when it attributes writes made beside this session). */
|
|
803
|
+
markPolluted: (reason: string, cause?: import("../memory-engine/types.js").MemoryOriginCause) => Promise<import("../memory-engine/layout.js").SessionPollutionMarkOutcome>;
|
|
762
804
|
};
|
|
763
805
|
/** The task's content-safety config (normalized memory spec): the allowlist for
|
|
764
806
|
* UNDECLARED tools and the strict execution-class upgrade. Consumed by the tool wrap only. */
|
|
@@ -788,7 +830,10 @@ export interface Prepared {
|
|
|
788
830
|
* relative paths and unreadable files answer false (named residuals beside the Bash channel).
|
|
789
831
|
*/
|
|
790
832
|
recallTaint?: {
|
|
791
|
-
|
|
833
|
+
/** The exposure verdict of the committed entry whose seat the delivered path is (`"clean"` when it
|
|
834
|
+
* is none): `"marked"` ⇒ the Read marks the session derived; `"challenged"` ⇒ derived too, and the
|
|
835
|
+
* delivery carries a note that the memory tools withhold the entry until the host resolves its challenge. */
|
|
836
|
+
judgeDeliveredPath: (absPath: string) => Promise<"clean" | "marked" | "challenged">;
|
|
792
837
|
};
|
|
793
838
|
};
|
|
794
839
|
/** A per-task env minted by `RunnerDeps.executionEnvFactory` (the remote seam) that THIS task owns
|
|
@@ -836,23 +881,25 @@ export interface Prepared {
|
|
|
836
881
|
* (`spec.resourceSuspend`) AND it is eligible to suspend durably (a checkpoint store, durable tool
|
|
837
882
|
* results, and a remote — or static caller-owned, never per-task-stub — env). The run loop calls it at a
|
|
838
883
|
* CLEAN turn boundary when a resource limit (turns/budget/walltime) was hit: it mints a `resource_limit`
|
|
839
|
-
* checkpoint + pauses the workspace + stops the loop cleanly (NOT abort).
|
|
840
|
-
*
|
|
841
|
-
* `sliceSpend` (Slice 4) is THIS slice's cost/tokens/turns, debited onto the cross-slice ledger.
|
|
842
|
-
|
|
884
|
+
* checkpoint + pauses the workspace + stops the loop cleanly (NOT abort). Answers what the request came to
|
|
885
|
+
* ({@link BoundarySuspendOutcome}); anything but `committed` ⇒ the caller falls through to the normal limit stop.
|
|
886
|
+
* `sliceSpend` (Slice 4) is THIS slice's cost/tokens/turns, debited onto the cross-slice ledger. Only a TASK-axis
|
|
887
|
+
* reason reaches it — the external causes have their own lane below. */
|
|
888
|
+
suspendForResource?: (reason: Exclude<ResourceLimitReason, PlatformLimitReason>, sliceSpend: {
|
|
843
889
|
costMicroUsd: number;
|
|
844
890
|
tokens: number;
|
|
845
891
|
turns: number;
|
|
846
892
|
walltimeMs: number;
|
|
847
|
-
}) => Promise<
|
|
893
|
+
}) => Promise<BoundarySuspendOutcome>;
|
|
848
894
|
/** The PLATFORM-cause suspend — the same commit saga as {@link suspendForResource},
|
|
849
895
|
* exposed on the INFRASTRUCTURE alone (checkpoint store + durable tool results + remote/no owned env),
|
|
850
|
-
* WITHOUT the `spec.resourceSuspend` opt-in. The run loop calls it at a clean turn boundary
|
|
851
|
-
*
|
|
852
|
-
*
|
|
853
|
-
* deployment that CAN keep the work has no reason to be
|
|
854
|
-
* (usage windows only) rides the gate and extends the
|
|
855
|
-
*
|
|
896
|
+
* WITHOUT the `spec.resourceSuspend` opt-in. The run loop calls it at a clean turn boundary for the
|
|
897
|
+
* external causes — a scheduler's yield (`preempt`), an exhausted deployment usage window
|
|
898
|
+
* (`usage_window`), an execution environment about to be reclaimed (`env_lifetime`) — causes the task did
|
|
899
|
+
* not choose and cannot ask differently for, so a deployment that CAN keep the work has no reason to be
|
|
900
|
+
* asked whether it wants to. `hint.resumeAfterMs` (usage windows only) rides the gate and extends the
|
|
901
|
+
* checkpoint deadline. Answers what the request came to ({@link BoundarySuspendOutcome}); the caller reads
|
|
902
|
+
* the cause's fallback off the boundary's one table (a preempt continues, the other two stop loudly). */
|
|
856
903
|
suspendForPlatformLimit?: (reason: PlatformLimitReason, sliceSpend: {
|
|
857
904
|
costMicroUsd: number;
|
|
858
905
|
tokens: number;
|
|
@@ -860,7 +907,11 @@ export interface Prepared {
|
|
|
860
907
|
walltimeMs: number;
|
|
861
908
|
}, hint?: {
|
|
862
909
|
resumeAfterMs: number;
|
|
863
|
-
}) => Promise<
|
|
910
|
+
}) => Promise<BoundarySuspendOutcome>;
|
|
911
|
+
/** Why this leg cannot suspend durably — the clauses of every missing infrastructure piece, the one sentence the
|
|
912
|
+
* `resourceSuspend` INACTIVE line and an unhonourable yield both name (the manifest's `suspendLane.reasons` are its
|
|
913
|
+
* codes). Absent ⇔ the infrastructure is ready. */
|
|
914
|
+
suspendLaneGap?: string;
|
|
864
915
|
/** Epoch ms at which this run must stop and checkpoint because the EXECUTION
|
|
865
916
|
* ENVIRONMENT's declared lifetime is about to expire (`ExecutionEnv.lifetimeMs` minus
|
|
866
917
|
* {@link ENV_LIFETIME_SUSPEND_MARGIN_MS}). Undefined ⇒ the env declared no lifetime (every local env,
|
|
@@ -966,8 +1017,8 @@ export interface Prepared {
|
|
|
966
1017
|
};
|
|
967
1018
|
/** The per-task human-review accumulator (synchronous `resolveAsk` waits this leg + the carried
|
|
968
1019
|
* prior-leg burden seeded from the resumed checkpoint). The run loop ADDS the durable-resume latency
|
|
969
|
-
* (`now() − cp.suspendedAt`) on a resume, then surfaces it as `stats.humanReview` at
|
|
970
|
-
*
|
|
1020
|
+
* (`now() − cp.suspendedAt`) on a resume, then surfaces it as `stats.humanReview` at settle (always, `count: 0`
|
|
1021
|
+
* included). **Budget-EXCLUDED** — never folded into cost/the budget gate. */
|
|
971
1022
|
/** borrowed-mutable — the hands' read-state map (the SAME `Map` object the toolkit and the context
|
|
972
1023
|
* lane hold; absent without hands). Read by the provider-rejection recovery arm so its stale-result
|
|
973
1024
|
* clears retire the entries those transmissions fed, through the same landing the frontier pass uses. */
|
|
@@ -1058,15 +1109,18 @@ export interface Prepared {
|
|
|
1058
1109
|
lastSentRequest: () => CompactionForkContext | undefined;
|
|
1059
1110
|
/** The leg's advisor-instructions seat (advisor-instructions.ts); absent when the leg neither mounts the advisor nor has told the model of it. */
|
|
1060
1111
|
advisorInstruction?: import("./advisor-instructions.js").AdvisorInstructionSeat;
|
|
1112
|
+
/** The leg's language seat (language-frame.ts); absent when the leg states no language, or has nothing to tell and nothing told. */
|
|
1113
|
+
languageSeat?: import("./language-frame.js").LanguageSeat;
|
|
1061
1114
|
/** #1123 — the memory notices this prepare drained (whole engine reminders, model lane only, no echo): the leg's first
|
|
1062
1115
|
* request carries them once, ahead of the user's message — a fresh leg's first user message, a resumed leg's
|
|
1063
1116
|
* continuation. Never the system prompt (an event there breaks the cached prefix twice). Absent when nothing drained. */
|
|
1064
1117
|
memoryNoticesFrame?: string;
|
|
1065
1118
|
/** The post-compaction restore (`MaybeCompactOptions.workingFileAttachments.restore`): re-reads the candidates through
|
|
1066
1119
|
* the leg's one file reader under the run's synthetic-Read judge — the user attachment's own path read — deduplicated
|
|
1067
|
-
* against the read state the summary leaves, and mints their attachment frames (`readCompactionRestore`);
|
|
1068
|
-
*
|
|
1069
|
-
*
|
|
1120
|
+
* against the read state the summary leaves, and mints their attachment frames (`readCompactionRestore`); what became of
|
|
1121
|
+
* each is its record on the `compacted` frame (`restoreOutcomes`). A fault that kept a file from the transcript — the
|
|
1122
|
+
* restore threw, the transcript would not take a frame — is reported (`onError` phase `degraded`, classification
|
|
1123
|
+
* `attachment-read`). Present only with hands. */
|
|
1070
1124
|
compactionRestore?: Required<Pick<NonNullable<import("../auto-compaction.js").MaybeCompactOptions["workingFileAttachments"]>, "restore" | "undelivered">>;
|
|
1071
1125
|
/** CC post-compact restore parity (2026-07-03): the task's READ files, most recent
|
|
1072
1126
|
* first (from the hands' readFileState `lastReadAt` stamps). The restore prefers this over the modified set — CC
|
|
@@ -1080,11 +1134,6 @@ export interface Prepared {
|
|
|
1080
1134
|
* fires for the common relative-vs-canonical case. Present only with hands; absent there is no
|
|
1081
1135
|
* containment root to resolve against, and every path source is already in the same raw coordinate anyway. */
|
|
1082
1136
|
normalizeAttachmentPath?: (raw: string) => Promise<string>;
|
|
1083
|
-
/** Recognizes the hands Read tool's own dedup-stub markers
|
|
1084
|
-
* ({@link isReadDedupStubResult}), so `maybeCompact`'s kept-tail scan can tell a SUBSTANTIVE Read
|
|
1085
|
-
* result from a stub hit whose original full transmission may already be summarized away. Present
|
|
1086
|
-
* only with hands. */
|
|
1087
|
-
isDedupStubResult?: (resultText: string) => boolean;
|
|
1088
1137
|
/** Wired to `MaybeCompactOptions.onApplied` by every compaction lane (the reference clears readFileState at its
|
|
1089
1138
|
* compaction landing site, @388663). Drops every read-state entry the summary took out of view
|
|
1090
1139
|
* (`readFileStateAfterSummary`); the restored files then re-register through their frames' own commits. Present
|
|
@@ -1135,31 +1184,14 @@ export interface Prepared {
|
|
|
1135
1184
|
today: () => string;
|
|
1136
1185
|
anchor: DateAnchorRead | undefined;
|
|
1137
1186
|
};
|
|
1138
|
-
/**
|
|
1139
|
-
* (`
|
|
1140
|
-
*
|
|
1141
|
-
*
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
}>;
|
|
1147
|
-
/** The RAW instruction-file text this leg's `loadProjectMemory` returned
|
|
1148
|
-
* (`ProjectMemoryLoad.content`), for the compaction lanes' `contextInstructionFiles` seat.
|
|
1149
|
-
*
|
|
1150
|
-
* Which bytes, exactly: the string prepare-task hands `composeMemoryBlock(projectMem, "project")`
|
|
1151
|
-
* — pre-compose, unfenced, straight from the host seam. The two neighbours are deliberately NOT
|
|
1152
|
-
* candidates: the assembled `memoryBlock` carries the memory ENGINE's layers (bytes the model
|
|
1153
|
-
* itself authored in-band this session through the memory tools) and the seat's contract is
|
|
1154
|
-
* host/systemPrompt tier; the COMPOSED project block would arrive at a mint that neutralizes the
|
|
1155
|
-
* whole authority family, `user_memory`/`scope` included, so the engine would rewrite the tags of
|
|
1156
|
-
* its own composition. Raw text in, one fence at the mint.
|
|
1157
|
-
*
|
|
1158
|
-
* Present only when the deployment wired the loader AND it answered non-blank — the same
|
|
1159
|
-
* predicate that composes the project layer, so the summarizer's copy and the main prompt's copy
|
|
1160
|
-
* can never disagree about whether this deployment HAS instruction files. Absent ⇒ every
|
|
1161
|
-
* compaction lane omits the key entirely. */
|
|
1162
|
-
projectInstructionContent?: string;
|
|
1187
|
+
/** The leg's epoch-anchor seat: the anchor prepare read (undefined ⇒ the branch was unreadable, nothing is written) and
|
|
1188
|
+
* the leg's request head as it stands when read (`tools` is the table as mounted, after the leg's activations and
|
|
1189
|
+
* roster refreshes, before any request's view). The settle lane
|
|
1190
|
+
* writes the anchor when the head is not the recorded one (`owedDateAnchor`). */
|
|
1191
|
+
prefixAnchor?: {
|
|
1192
|
+
read: DateAnchorRead | undefined;
|
|
1193
|
+
head: () => PrefixHeadDigests;
|
|
1194
|
+
};
|
|
1163
1195
|
/** The `workflow_size_guideline_change` lane's seam, the {@link dateChange} shape one lane over:
|
|
1164
1196
|
* `legGuideline` = the RESOLVED guideline this leg's Workflow tool card was built with (the card is
|
|
1165
1197
|
* a per-mount snapshot, so it never re-renders mid-leg — the model learns a retune from the tail
|
|
@@ -1172,20 +1204,23 @@ export interface Prepared {
|
|
|
1172
1204
|
legGuideline: WorkflowSizeGuideline;
|
|
1173
1205
|
current: () => WorkflowSizeGuideline;
|
|
1174
1206
|
};
|
|
1175
|
-
/**
|
|
1207
|
+
/** External-change scan (a turn boundary's, and a leg's first request's — `scanChangedFiles`) over the ≤`maxFiles` most-recently-READ
|
|
1176
1208
|
* files. Stats each via `env.fileInfo` and reports paths whose `mtimeMs` moved past the recorded
|
|
1177
1209
|
* `lastReadAt` + 2s epsilon (CC getChangedFiles shape: readFileState needs NO new field; the agent's
|
|
1178
1210
|
* own write-backs refresh `lastReadAt`, so self-edits are immune). ENOENT evicts the readFileState
|
|
1179
|
-
* entry (CC evict-only-on-ENOENT — transient stat failures skip, never evict)
|
|
1180
|
-
*
|
|
1181
|
-
* hands; the run loop calls it ONLY when `spec.attachments.changedFiles` opted in (OFF ⇒ zero stat). */
|
|
1211
|
+
* entry (CC evict-only-on-ENOENT — transient stat failures skip, never evict). Present only with
|
|
1212
|
+
* hands; its callers ask it ONLY when `spec.attachments.changedFiles` opted in (OFF ⇒ zero stat). */
|
|
1182
1213
|
detectExternalChanges?: (maxFiles: number) => Promise<{
|
|
1183
1214
|
changed: Array<{
|
|
1184
1215
|
path: string;
|
|
1185
1216
|
mtimeMs: number;
|
|
1186
1217
|
}>;
|
|
1187
|
-
evicted: string[];
|
|
1188
1218
|
}>;
|
|
1219
|
+
/** The instruction files of the task root's level and of the directories the run accesses (the family
|
|
1220
|
+
* `NESTED_MEMORY_LANE.declaration` names): primed at the end of prepare (the manifest's `instructions`), then the leg's first
|
|
1221
|
+
* request, each continuing boundary and a landed compaction ask it what the read state owes. Present only with hands and the
|
|
1222
|
+
* declaration. */
|
|
1223
|
+
nestedMemory?: import("./nested-memory-lane.js").NestedMemoryLane;
|
|
1189
1224
|
/** G1 通告层 — deferred tools MATERIALIZED (rematerialized) but not yet announced at a
|
|
1190
1225
|
* turn boundary. Appended by the rematerialize diff (newly-activated names only — the announced set
|
|
1191
1226
|
* is seeded with prepare-time actives INCLUDING resume-reseeded ones, so a resume never replays);
|
|
@@ -1253,6 +1288,9 @@ export interface Prepared {
|
|
|
1253
1288
|
/** The frame-receipt ledger — the ONE commit point of every engine frame that rides a user message
|
|
1254
1289
|
* (the git-status frame, the agent and skills listing frames). Always present; per leg. */
|
|
1255
1290
|
frameReceipts: FrameReceiptLedger;
|
|
1291
|
+
/** The run's engine text reading, bound to its locale (`TaskSpec.promptLocale`) once at prepare: every engine-minted
|
|
1292
|
+
* text the runner's own lanes send (the MCP frame on both lanes) reads through it. */
|
|
1293
|
+
engineText: EngineText;
|
|
1256
1294
|
/** env-tail migration — the git-status frame lane's run-local state: this leg's
|
|
1257
1295
|
* resolved frame (probe outcome rendered + hashed at prepare), the announced `(kind, hash)`
|
|
1258
1296
|
* mirror the checkpoint serializer reads, the trim-protection slot the request-build context
|
|
@@ -1261,6 +1299,11 @@ export interface Prepared {
|
|
|
1261
1299
|
gitStatusRef: GitStatusLaneRef;
|
|
1262
1300
|
/** The posture composition's run-local half (the newest carrier's protection slot; the row last composed for). */
|
|
1263
1301
|
postureFrameRef: import("../auto-mode-directive.js").PostureFrameRef;
|
|
1302
|
+
/** The request's irreducible core for this leg: the objective input the guard trim never drops (written by the objective
|
|
1303
|
+
* lane before the first request) and the typed terminal a request-build guard parks when a core cannot fit. */
|
|
1304
|
+
requestCoreRef: import("../context-guard.js").RequestCoreRef;
|
|
1305
|
+
/** The limit-approach notice's seat: the turn boundary writes the crossing, the request-build handler carries it ({@link LimitApproachSeat}). */
|
|
1306
|
+
limitApproachRef: LimitApproachSeat;
|
|
1264
1307
|
/** G1 通告层 — narrow getter over the process task registry: THIS run's visible live background tasks
|
|
1265
1308
|
* (pending / running / parked under the same owner/scope/session identity the TaskStop tool
|
|
1266
1309
|
* uses), EVERY one (`TaskRegistry.liveTasks`), as a projection (id/description/status and the row's read handle,
|
|
@@ -1362,6 +1405,11 @@ export interface PrepareResume {
|
|
|
1362
1405
|
/** Batch tool-call ids of the suspended turn — wake-reconcile SKIPS these (they are resumed, not
|
|
1363
1406
|
* crash-interrupted; closing them with `[INTERRUPTED]` would DESTROY the suspended batch, §15.2 #7). */
|
|
1364
1407
|
suspendedBatch: ReadonlySet<string>;
|
|
1408
|
+
/** The parked row's own synchronous-child block (`Checkpoint.parentSessionId` / `parentTaskId` / `rootSessionId` / `rootSessionIncarnation`),
|
|
1409
|
+
* for a synchronous child's resumed leg that is handed no spawner internals: the next row it parks records the same block. It is read
|
|
1410
|
+
* into the park mint only — never folded into the leg's internals, whose root and parent members steer notice routing and placement.
|
|
1411
|
+
* Absent ⇒ the row recorded none. */
|
|
1412
|
+
syncChildBlockOfRow?: import("../leg-identity.js").SyncChildBlock;
|
|
1365
1413
|
/** The §4.bis correctness-state snapshot to re-seed (activeTools / outputRef / nestedStats /
|
|
1366
1414
|
* readFileState). */
|
|
1367
1415
|
seed: CheckpointState;
|
|
@@ -1655,6 +1703,8 @@ export interface PromptFeatureFlags {
|
|
|
1655
1703
|
worktreeIsolated: boolean;
|
|
1656
1704
|
withinTaskCompactionEnabled: boolean;
|
|
1657
1705
|
isSubagent: boolean;
|
|
1706
|
+
/** No store to persist through, on the run that holds the user's conversation (the memory phase's verdict). */
|
|
1707
|
+
memoryStoreAbsent: boolean;
|
|
1658
1708
|
}
|
|
1659
1709
|
/**
|
|
1660
1710
|
* A TRUSTED, run-scoped internal channel into {@link prepareTask}, set
|
|
@@ -1715,6 +1765,15 @@ export interface RunInternals {
|
|
|
1715
1765
|
readonly definition?: string;
|
|
1716
1766
|
readonly lists: string;
|
|
1717
1767
|
};
|
|
1768
|
+
/** Set by the workflow lane when it launches an agent as an agent type whose definition writes tool lists: the definition's name and its
|
|
1769
|
+
* two lists as one selector layer. The leg's selector reads it between the ceiling it was spawned under and its own lists (the
|
|
1770
|
+
* definition bounds which tools the leg is handed, as a delegated child's does; the leg's own lists stay the deployment's), its prepare
|
|
1771
|
+
* judges it once as a definition's lists are judged (`config.agent.unknown_tool`, told to the operator), and its rows record it with
|
|
1772
|
+
* the ceiling. Trusted, never a TaskSpec field. */
|
|
1773
|
+
definitionToolLists?: {
|
|
1774
|
+
readonly agentType: string;
|
|
1775
|
+
readonly layer: import("../tool-face.js").ToolSelectorLayer;
|
|
1776
|
+
};
|
|
1718
1777
|
/** Set only on an observer sidecar's legs: the leg kind whose protocol is the observer's report tool. */
|
|
1719
1778
|
observerLeg?: true;
|
|
1720
1779
|
/** The live repair bundle from a `runRepairLoop` attempt in flight (attemptCount>0). Serialized onto a
|
|
@@ -1912,18 +1971,6 @@ export interface RunInternals {
|
|
|
1912
1971
|
* carries no placement — byte-identical to before.
|
|
1913
1972
|
*/
|
|
1914
1973
|
sessionPlacement?: import("../session.js").SessionPlacement;
|
|
1915
|
-
/**
|
|
1916
|
-
* The DEFAULT role-base persona for a DELEGATED child, threaded by
|
|
1917
|
-
* `createSubagentTool`'s execute (a core caller) when neither an agent-definition `systemPrompt` nor the
|
|
1918
|
-
* delegation tool's `opts.systemPrompt` names one. It sits at the BOTTOM of the role-base chain —
|
|
1919
|
-
* `spec.systemPrompt ?? resolvedRole.systemPrompt ?? internals.defaultSystemPrompt` — so a deployment's
|
|
1920
|
-
* `roles.subagent.systemPrompt` / `roles.default.systemPrompt` preset still wins (pre-G1 semantics: an
|
|
1921
|
-
* unset child systemPrompt let the role preset apply; G1's first cut put SUBAGENT_PROMPT at spec level
|
|
1922
|
-
* and silently shadowed the preset). Only when NO preset resolves does the lean SUBAGENT_PROMPT (general-purpose
|
|
1923
|
-
* persona) replace the full DEFAULT_SYSTEM_PROMPT constitution base.
|
|
1924
|
-
* TRUSTED run-scoped channel (NOT a {@link TaskSpec} field), mirroring `insideFork`.
|
|
1925
|
-
*/
|
|
1926
|
-
defaultSystemPrompt?: string;
|
|
1927
1974
|
/**
|
|
1928
1975
|
* The catalog WORD that chose the model this engine-spawned child was handed on its spec.
|
|
1929
1976
|
*
|
|
@@ -2055,17 +2102,17 @@ export interface RunInternals {
|
|
|
2055
2102
|
*
|
|
2056
2103
|
* Set by the BACKGROUND delegation lanes (plain + fork), whose runs own a registry `a*` row, and by
|
|
2057
2104
|
* both of the workflow orchestrator's spawn legs. A SYNCHRONOUS delegated child declares nothing —
|
|
2058
|
-
* it has no
|
|
2059
|
-
*
|
|
2105
|
+
* it has no registry identity (INTEGRATION-CORE §1.6a), so absence is a fact, not a stamping gap — save on a delegated
|
|
2106
|
+
* child's checkpoint a host redeems without the lane's internals (KL-3824-a). TRUSTED run-scoped channel (never a {@link TaskSpec} field).
|
|
2060
2107
|
*/
|
|
2061
2108
|
delegationTaskType?: import("../types.js").DelegationTaskType;
|
|
2062
2109
|
/**
|
|
2063
|
-
* The
|
|
2064
|
-
*
|
|
2065
|
-
*
|
|
2066
|
-
* `TaskNotificationPayload.seq` / `BackgroundChildEvent.seq`). Absent
|
|
2067
|
-
*
|
|
2068
|
-
*
|
|
2110
|
+
* The stop-cycle generation this run executes as (fresh spawn = 1, a wake's bumped counter), threaded by the
|
|
2111
|
+
* BACKGROUND delegation lanes from the registry's own `cycleSeq` and by a retained child's wake from the retain
|
|
2112
|
+
* ledger's (a synchronously born child's wake too: a cycle count, not a row), so every `task_progress` tick the
|
|
2113
|
+
* run mints carries it as `seq` (same axis as `TaskNotificationPayload.seq` / `BackgroundChildEvent.seq`). Absent
|
|
2114
|
+
* on a first synchronous cycle, on workflow agents and top-level runs (INTEGRATION-CORE §1.6a), and on a delegated
|
|
2115
|
+
* child's checkpoint a host redeems without the lane's internals (KL-3824-a). TRUSTED run-scoped channel (never a TaskSpec field).
|
|
2069
2116
|
*/
|
|
2070
2117
|
cycleSeq?: number;
|
|
2071
2118
|
/** The ROOT host session of the whole delegation tree (fixed point: the
|
|
@@ -2081,6 +2128,11 @@ export interface RunInternals {
|
|
|
2081
2128
|
* occupants were minted; a frame the notification lane escalates to the root anchor is then addressed
|
|
2082
2129
|
* to an unknown occupant, which a root holding a token is not. TRUSTED run-scoped channel (never a TaskSpec field). */
|
|
2083
2130
|
rootSessionIncarnation?: string;
|
|
2131
|
+
/** The scope {@link rootSessionId}'s legs mount its durable box in, as the tree's root leg mounted it (its registry scope) — the
|
|
2132
|
+
* third member of the root anchor's address, carried beside the other two by the same fixed point and persisted on a background
|
|
2133
|
+
* spawn's row (`BackgroundAgentRecord.rootSessionScope`). A Runner on which no leg of the root runs judges the root's box at it.
|
|
2134
|
+
* Absent = a tree whose root recorded none (a row written before rows recorded it): no box is judged for the root. TRUSTED. */
|
|
2135
|
+
rootSessionScope?: string;
|
|
2084
2136
|
/** The delegation tree's owner seat ({@link import("./delegation-owner.js").DelegationOwnerSeat}): a fixed point like
|
|
2085
2137
|
* {@link rootSessionId} — the spawning run hands its own seat down by reference (the delegation and workflow lanes), so the tree
|
|
2086
2138
|
* reads its root row's owner once. Absent ⇒ this run is nobody's child here (a top-level run, a revival, a resumed park) and its
|
|
@@ -2128,12 +2180,13 @@ export interface RunInternals {
|
|
|
2128
2180
|
* The REGISTRY SCOPE this run's own background row lives in: the domain its registry-facing
|
|
2129
2181
|
* tools (TaskStop / SendMessage / AgentTranscript / Monitor, and the announce listing)
|
|
2130
2182
|
* must mount in to see it. Filled by the delegation tool at spawn, which is the party that CHOSE the
|
|
2131
|
-
* domain when it registered the row —
|
|
2132
|
-
* delegation mount's declared `background.scope`, and on a revival the
|
|
2183
|
+
* domain when it registered the row — the spawning run's isolation scope (its `isolationScope`, else its
|
|
2184
|
+
* principal) when it has one, else the delegation mount's declared `background.scope`, and on a revival the
|
|
2185
|
+
* claimed row's own scope.
|
|
2133
2186
|
*
|
|
2134
|
-
* Why this is not just
|
|
2135
|
-
* tasks
|
|
2136
|
-
* with no
|
|
2187
|
+
* Why this is not just the isolation scope: a deployment may declare its domain at MOUNT time and run its
|
|
2188
|
+
* tasks with neither `TaskSpec.isolationScope` nor `TaskSpec.principal`. The row then lands in the declared domain while the child runs
|
|
2189
|
+
* with no scope at all, and isolation scope ?? `"default"` sends every one of its registry-facing tools
|
|
2137
2190
|
* to a domain the row is not in — scope is fail-closed on both access predicates, so such a child
|
|
2138
2191
|
* cannot see its own row, its siblings, or the children it spawns. Carrying the domain as its own
|
|
2139
2192
|
* trusted axis keeps `principal` the IDENTITY it is: the identity also keys the durable
|
|
@@ -2174,18 +2227,44 @@ export interface RunInternals {
|
|
|
2174
2227
|
*/
|
|
2175
2228
|
onForwardEvent?: (event: TaskEvent) => void;
|
|
2176
2229
|
/**
|
|
2177
|
-
* The run
|
|
2178
|
-
*
|
|
2179
|
-
*
|
|
2180
|
-
*
|
|
2181
|
-
*
|
|
2182
|
-
*
|
|
2183
|
-
*
|
|
2184
|
-
*
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2230
|
+
* The subtree-activity seat: "this run — or something running under it — just did work." Not {@link onActivity} (that one hands a
|
|
2231
|
+
* run's OWN tool starts and ends, with their identity, to whoever observes that run; a descendant's calls never reach it). This one
|
|
2232
|
+
* carries no identity, only the beat: the engine tells it at each of the run's tool calls' start and end (in the one place a run
|
|
2233
|
+
* pushes its content; not at a `tool_progress` heartbeat, which says only that a silent call is still in flight) and at each MCP progress
|
|
2234
|
+
* notification of its tool calls; a delegation hands it to every foreground child
|
|
2235
|
+
* (`ToolExecuteContext.onSubtreeActivity`), so a grandchild's tool work reaches the same seat at any depth — beyond what the display
|
|
2236
|
+
* channel forwards, which is filtered. A background lane that owns a registry row sets it to that row's beat
|
|
2237
|
+
* (`TaskRegistry.noteBackgroundAgentActivity`) and so replaces, not extends, the one it inherited: a background child's work is its
|
|
2238
|
+
* own row's, not its spawner's. TRUSTED spawn-side channel, never a {@link TaskSpec} field; the call is a timestamp write and must not
|
|
2239
|
+
* throw or wait.
|
|
2240
|
+
*/
|
|
2241
|
+
onSubtreeActivity?: () => void;
|
|
2242
|
+
/**
|
|
2243
|
+
* The DRAINED-LEG FRAME SEAT: a leg the engine drains itself — entered through `Runner.runTask` or `Runner.resume`, as
|
|
2244
|
+
* every leg a composition entry (the verify gate, the cascade) dispatches is — hands its own frames of the closed set
|
|
2245
|
+
* `DRAINED_LEG_FRAME_TYPES` (`status`, `wiring_manifest`, `message_committed`,
|
|
2246
|
+
* `workspace_changed`) to this seat, because the caller holds no stream for that leg. Branch on `frame.type`.
|
|
2247
|
+
*
|
|
2248
|
+
* ONE FRAME, TWO DELIVERIES, ONE ORDER: `frame` is the very object the leg's queue received, shallow-frozen before the
|
|
2249
|
+
* push (its own members cannot be reassigned; nested objects such as `manifest`, `entered`, `session` are the same objects
|
|
2250
|
+
* the stream frame carries and are not frozen by this rule — read them, do not write them), offered at the push and only
|
|
2251
|
+
* when the queue accepted it, so this seat sees the leg's frames in the order the stream holds them. `at` is
|
|
2252
|
+
* {@link LegAt}: the leg's `taskId` and `sessionId` (engine facts, on every frame) and `leg`,
|
|
2253
|
+
* the composition's label for the leg when the dispatcher bound one — absent means nobody labelled the leg, never
|
|
2254
|
+
* "implementation" (a plain `runTask` and a workflow agent call carry none; the verify gate labels `impl` / `verifier` /
|
|
2255
|
+
* `fix`, the cascade labels each rung `rung` with its place on the ladder).
|
|
2256
|
+
*
|
|
2257
|
+
* DRAINED LEGS ONLY: `Runner.runTaskStream` / `Runner.resumeStream` hand the caller the stream, where these frames ride,
|
|
2258
|
+
* and REFUSE this seat (`config.invalid_argument`) before anything is read — on a resume, before the checkpoint is read
|
|
2259
|
+
* or claimed (it stays pending; resume again without the seat). The draining entries mark the object they hand on; a
|
|
2260
|
+
* copy of it is not marked. A child the leg delegates to, and a workflow agent leg, run on a bag the engine builds, which
|
|
2261
|
+
* never carries this seat: their frames reach the parent through {@link onForwardEvent}, not here.
|
|
2262
|
+
*
|
|
2263
|
+
* Observe-only and failure-isolated through the run's ONE notifier (a throw, or an `async` seat's rejection, is
|
|
2264
|
+
* contained, disclosed once per run, counted after, and never faults the leg). A TRUSTED run-scoped channel, never a
|
|
2265
|
+
* {@link TaskSpec} field.
|
|
2266
|
+
*/
|
|
2267
|
+
onLegFrame?: (frame: DrainedLegFrame, at: LegAt) => void;
|
|
2189
2268
|
/** The run-local per-tool-call detach hub. runtask creates it and exposes
|
|
2190
2269
|
* `TaskStream.detach(toolCallId)`; the hands Bash tool threads `signalFor(toolCallId)` into env.exec. */
|
|
2191
2270
|
detachHub?: import("../tool-detach.js").ToolDetachHub;
|
|
@@ -2228,6 +2307,9 @@ export interface RunInternals {
|
|
|
2228
2307
|
opts?: {
|
|
2229
2308
|
priority?: import("../task-notification.js").SystemInjectionPriority;
|
|
2230
2309
|
}) => void;
|
|
2310
|
+
/** The ASSISTANT SEAT (the type's own doc is the contract): host-handed on every leg the host starts for the scope's assistant, a
|
|
2311
|
+
* resumed one included; the engine hands no child this member and a checkpoint does not carry it. */
|
|
2312
|
+
principalInboxAssistant?: import("../../agents/org-delivery-gate.js").PrincipalInboxAssistantSeat;
|
|
2231
2313
|
/**
|
|
2232
2314
|
* The PARENT run's notification injector (its runtask-wrapped
|
|
2233
2315
|
* `injectTaskNotification`), threaded into a CHILD's internals at spawn time so the child's
|
|
@@ -2388,47 +2470,14 @@ export interface RunInternals {
|
|
|
2388
2470
|
*/
|
|
2389
2471
|
onWorkspaceResolved?: (workspace: ResolvedWorkspace) => void;
|
|
2390
2472
|
/**
|
|
2391
|
-
*
|
|
2392
|
-
*
|
|
2393
|
-
*
|
|
2394
|
-
*
|
|
2395
|
-
*
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
* cascade) drains its inner legs' queues ITSELF, so the host holds no TaskStream for any of them
|
|
2400
|
-
* and an inner leg's manifest dies inside the gate — the hole {@link onStatusEvent} was opened
|
|
2401
|
-
* for, one frame family over. A direct `runTask` caller needs neither seat: its own stream
|
|
2402
|
-
* carries both frames.
|
|
2403
|
-
*
|
|
2404
|
-
* `leg` is the LEG IDENTITY, and the engine mints NONE of it. It is present only where a
|
|
2405
|
-
* composition labelled the leg it dispatched: the verify entries hand each leg a per-dispatch
|
|
2406
|
-
* copy of this object whose sink closes over that leg's identity, so a consumer can tell the
|
|
2407
|
-
* implementation leg from pass 2's verifier without inferring it from arrival order (the
|
|
2408
|
-
* ordering is all the sibling sinks have — see the attribution paragraph on `verifyCompleted`).
|
|
2409
|
-
* ABSENT therefore means "nobody labelled this leg", never "implementation": a plain `runTask`,
|
|
2410
|
-
* a workflow agent call and a cascade rung all reach this sink with no identity, and reading one
|
|
2411
|
-
* in would be the engine fabricating a fact it does not hold. NOT the same axis as the manifest's
|
|
2412
|
-
* OWN `leg` field ({@link WiringManifest.leg}, `root` / `child` / `resume`), which is a fact about
|
|
2413
|
-
* how the ENGINE reached this run; this one is a fact about the composition that dispatched it, and
|
|
2414
|
-
* a resumed fix leg carries both at once — `manifest.leg.kind === "resume"` and `leg.kind === "fix"`
|
|
2415
|
-
* are both true of it. `pass` is 1-based over the gate's verification rounds: a `verifier` leg
|
|
2416
|
-
* carries the one it verifies, a `fix` leg the one whose findings it answers, and the entry
|
|
2417
|
-
* implementation leg carries 0 — before the first. The axis is relative to the gate INVOCATION,
|
|
2418
|
-
* not to the session's history: a resume entry's work leg is THAT invocation's implementation leg
|
|
2419
|
-
* (`impl`, pass 0) even when the checkpoint it resumes was minted inside a previous invocation's
|
|
2420
|
-
* fix pass, because the invocation's own pass counter (`VerificationResult.rounds`) restarts with
|
|
2421
|
-
* it — one axis for both fields, rather than a leg that reads "fix pass 1" inside a result whose
|
|
2422
|
-
* rounds begin at 1 again.
|
|
2423
|
-
*
|
|
2424
|
-
* Observe-only and failure-isolated through the SAME per-run notifier as {@link onActivity} (one
|
|
2425
|
-
* isolation scope for every sink on this object, so a broken sink is counted and disclosed once,
|
|
2426
|
-
* not once per site family): a throw — or an `async` sink returning a rejecting promise — is
|
|
2427
|
-
* contained and never faults the leg whose manifest it was handed.
|
|
2428
|
-
*/
|
|
2429
|
-
onWiringManifest?: (manifest: WiringManifest, leg?: {
|
|
2430
|
-
readonly kind: "impl" | "verifier" | "fix";
|
|
2431
|
-
readonly round: number;
|
|
2473
|
+
* Set by a delegation lane that can hold this leg's park: the leg's prepare reports, once, whether it can suspend
|
|
2474
|
+
* durably (`ready` — the same readiness its manifest's `suspendLane` reports), so the spawner's yield seat knows what a
|
|
2475
|
+
* yield of this leg will come to. The leg's `TaskSpec.preemptSignal` is the spawner's fresh per-leg yield signal; the
|
|
2476
|
+
* report is the moment that signal is handed over (after the resume entry's strip of an already-raised one). Fresh and
|
|
2477
|
+
* resumed legs alike. A throwing seat is swallowed — an observation must not fault prepare.
|
|
2478
|
+
*/
|
|
2479
|
+
reportSuspendLane?: (lane: {
|
|
2480
|
+
readonly ready: boolean;
|
|
2432
2481
|
}) => void;
|
|
2433
2482
|
}
|
|
2434
2483
|
/**
|
|
@@ -2501,6 +2550,26 @@ export interface AskLane {
|
|
|
2501
2550
|
/** The deployment-facing half of a crashing PreToolUse hook (swallow-guarded). */
|
|
2502
2551
|
notifyHookError: (err: unknown) => void;
|
|
2503
2552
|
}
|
|
2553
|
+
/**
|
|
2554
|
+
* What one boundary-family suspend request (`suspendForResource` / `suspendForPlatformLimit`) came to — the
|
|
2555
|
+
* mint's own answer, so the turn boundary reads the cause's fallback off ONE fact instead of guessing from a
|
|
2556
|
+
* boolean:
|
|
2557
|
+
* · `committed` — a resumable checkpoint exists; the pause is published and the loop stops cleanly;
|
|
2558
|
+
* · `not_written` — no row exists and the world is as it was (no store, a cancelling run, no committed leaf,
|
|
2559
|
+
* a refused `suspendVM`, a store that refused the write with the paused VM restored):
|
|
2560
|
+
* continuing is safe, and `reason` says why in one clause;
|
|
2561
|
+
* · `fatal` — the mint stopped the run itself (the slice cap, a paused VM that could not be restored,
|
|
2562
|
+
* a write whose outcome is unknown): the boundary never continues past it.
|
|
2563
|
+
*/
|
|
2564
|
+
export type BoundarySuspendOutcome = {
|
|
2565
|
+
readonly tag: "committed";
|
|
2566
|
+
} | {
|
|
2567
|
+
readonly tag: "not_written";
|
|
2568
|
+
readonly reason: string;
|
|
2569
|
+
} | {
|
|
2570
|
+
readonly tag: "fatal";
|
|
2571
|
+
readonly reason: string;
|
|
2572
|
+
};
|
|
2504
2573
|
/** How the put-commit + put-failure saga ended (see `commitSuspendSaga` inside the phase for each arm's meaning). */
|
|
2505
2574
|
export type SuspendSagaOutcome = {
|
|
2506
2575
|
tag: "committed";
|
|
@@ -2540,6 +2609,11 @@ export interface SuspendSaga {
|
|
|
2540
2609
|
parkOnlyRemoteEnv: RemoteExecutionEnv | undefined;
|
|
2541
2610
|
/** The park-only identity capture (snapshotId stripped, `restoreMode: "park_only"`). */
|
|
2542
2611
|
parkOnlyHandle: (env: RemoteExecutionEnv) => WorkspaceHandle;
|
|
2612
|
+
/** The synchronous-child block every row this leg parks records beside its identity ({@link import("../leg-identity.js").syncChildBlockOf}):
|
|
2613
|
+
* the spawning run's session and task, the tree's root session and its occupant — present only on a synchronous child's leg, empty on a
|
|
2614
|
+
* root run's, a background child's and a workflow agent's. Read once at prepare, so the approval, `resource_limit` and `plan_review` mints stamp the one
|
|
2615
|
+
* value (`Checkpoint.parentSessionId` / `parentTaskId` / `rootSessionId` / `rootSessionIncarnation`). */
|
|
2616
|
+
syncChildBlock: import("../leg-identity.js").SyncChildBlock;
|
|
2543
2617
|
}
|
|
2544
2618
|
/** The park closure and the content-ask routing closure the gate station hands to `runToolGate`. Built as ONE value so
|
|
2545
2619
|
* "the park lane's closures exist" is one fact; `suspendAsk` stays optional INSIDE it because the park predicate (a store,
|
|
@@ -2570,9 +2644,13 @@ export interface ParkAsk {
|
|
|
2570
2644
|
*/
|
|
2571
2645
|
export interface RunState {
|
|
2572
2646
|
telemetry: {
|
|
2647
|
+
/** The model the main loop requests — the task's, then the near-budget target once the switch fires. `cacheFamily`,
|
|
2648
|
+
* `pricing` and `pricingConfigured` are ITS price facts; an answer the model lane served from a fallback hop, and every
|
|
2649
|
+
* hop left behind, is priced at its own model ({@link RunState.degrade.priceOf}). Set at the telemetry lane. */
|
|
2650
|
+
requestedModel: Model | undefined;
|
|
2573
2651
|
cacheFamily: ReturnType<typeof cacheFamilyOf>;
|
|
2574
2652
|
pricing: ModelPricing;
|
|
2575
|
-
/** Whether the
|
|
2653
|
+
/** Whether the requested model has a configured price table (a
|
|
2576
2654
|
* `RunnerDeps.pricing` entry or a `Model.cost` declaration). When neither exists,
|
|
2577
2655
|
* `modelCostToPricing(undefined)` yields an all-zero table and every computed cost is a
|
|
2578
2656
|
* fabricated 0 — indistinguishable from "declared free". This flag keeps the two apart so
|
|
@@ -2594,10 +2672,24 @@ export interface RunState {
|
|
|
2594
2672
|
};
|
|
2595
2673
|
degrade: {
|
|
2596
2674
|
degradeToModel: Model | undefined;
|
|
2675
|
+
/** The run's FIRST switch away from the requested model (a main-loop fallback walk, or the near-budget switch) — an audit
|
|
2676
|
+
* record only (`TaskResult.degraded`); no pricing reads it. */
|
|
2597
2677
|
degraded: TaskResult["degraded"];
|
|
2678
|
+
/** The near-budget switch fired — its own bit, so a fallback walk earlier in the run does not latch it. */
|
|
2679
|
+
budgetSwitched: boolean;
|
|
2598
2680
|
outputErrorStreak: number;
|
|
2599
2681
|
outputInvalid: boolean;
|
|
2600
|
-
|
|
2682
|
+
/** Record the run's first switch (audit: `degraded`, the `task.degraded` trace, the operational `onError`); once. */
|
|
2683
|
+
recordDegraded: (info: NonNullable<TaskResult["degraded"]>) => void;
|
|
2684
|
+
/** The price facts of a model a call was billed at: the requested model's are the telemetry's; any other's are read
|
|
2685
|
+
* from the deployment's table (or the model's `cost`) at the call, through the price-table door. */
|
|
2686
|
+
priceOf: (model: Model) => {
|
|
2687
|
+
pricing: ModelPricing;
|
|
2688
|
+
pricingConfigured: boolean;
|
|
2689
|
+
cacheFamily: ReturnType<typeof cacheFamilyOf>;
|
|
2690
|
+
};
|
|
2691
|
+
/** The leg's `model.fallback` announcement (the main loop's and the side-call book's one seat). */
|
|
2692
|
+
fallbackSeat: ModelFallbackSeat;
|
|
2601
2693
|
};
|
|
2602
2694
|
limits: {
|
|
2603
2695
|
turnsExceeded: boolean;
|
|
@@ -2648,6 +2740,12 @@ export interface RunState {
|
|
|
2648
2740
|
costMicroUsd: number;
|
|
2649
2741
|
} | undefined;
|
|
2650
2742
|
turnUsageMissing: boolean;
|
|
2743
|
+
/** The turn's cache marks as `turn_end` carries them (some call of the turn did not report its cache reads / writes;
|
|
2744
|
+
* `cache-hit-account.ts` decides them), reset with the rest of the per-turn bookkeeping. */
|
|
2745
|
+
turnCacheMarks: {
|
|
2746
|
+
cacheReadUnreported?: true;
|
|
2747
|
+
cacheWriteUnreported?: true;
|
|
2748
|
+
};
|
|
2651
2749
|
turnStopReason: string | undefined;
|
|
2652
2750
|
/** The PROVIDER-REPORTED model name of this turn's LAST assistant message, when it differed from the
|
|
2653
2751
|
* requested id — surfaced on `turn_end.responseModel`, reset with the rest of the per-turn
|
|
@@ -2658,8 +2756,8 @@ export interface RunState {
|
|
|
2658
2756
|
completed?: readonly import("../mods/lifecycle-stations.js").CompletedTurn[];
|
|
2659
2757
|
};
|
|
2660
2758
|
counters: {
|
|
2661
|
-
/** How many LIMIT-APPROACH
|
|
2662
|
-
*
|
|
2759
|
+
/** How many distinct LIMIT-APPROACH sentences a request has carried this run (0..2): one per threshold, counted by the
|
|
2760
|
+
* first request that carries it (a crossing straight past the second threshold counts 1). */
|
|
2663
2761
|
approachNoticesSent: number;
|
|
2664
2762
|
/** B15 三期使能:R9 引用的 R3/压缩区 latch(walltime 收尾 latch — preemptIgnoredReported 同族)。 */
|
|
2665
2763
|
walltimeSyncBackstopFired: boolean;
|
|
@@ -2695,13 +2793,9 @@ export interface RunState {
|
|
|
2695
2793
|
dateState: {
|
|
2696
2794
|
announcedDate: string;
|
|
2697
2795
|
} | undefined;
|
|
2698
|
-
instrProbe: RunnerDeps["probeInstructionSources"];
|
|
2699
|
-
instrState: {
|
|
2700
|
-
lastAnnouncedHash: Map<string, string | null>;
|
|
2701
|
-
} | undefined;
|
|
2702
2796
|
/** The Workflow tool card's advisory size guideline as last ANNOUNCED to the model,
|
|
2703
2797
|
* plus the live boundary-time read (Prepared.workflowSizeGuideline). Same deliberate posture as
|
|
2704
|
-
* `dateState
|
|
2798
|
+
* `dateState`: NOT an AttachmentState member, one field, zero reducers. */
|
|
2705
2799
|
sizeGuidelineState: {
|
|
2706
2800
|
announcedGuideline: WorkflowSizeGuideline;
|
|
2707
2801
|
current: () => WorkflowSizeGuideline;
|
|
@@ -2711,8 +2805,10 @@ export interface RunState {
|
|
|
2711
2805
|
};
|
|
2712
2806
|
}
|
|
2713
2807
|
/**
|
|
2714
|
-
* Config handed to {@link Runner.resume}: the {@link TaskSpec} members the resumed leg runs with.
|
|
2715
|
-
*
|
|
2808
|
+
* Config handed to {@link Runner.resume}: the {@link TaskSpec} members the resumed leg runs with. The session comes from the checkpoint,
|
|
2809
|
+
* so the config names none of the members that live and die with a session (`SessionBoundSpecMember`, the member table's one column:
|
|
2810
|
+
* `sessionId`, `requireExistingSession`, `resumeAt`, `resumeAtMode`, `restoreFiles`, `acceptPartialRestore`, `rewindFilesTo`); a
|
|
2811
|
+
* resume sends no new human message, so it takes no objective, `userAttachments` or `runOrigin` (either present is refused before the
|
|
2716
2812
|
* claim; a wake states its leg's word on the input it hands over). The row records no tool, hand band or server list: `tools`, `mcp`,
|
|
2717
2813
|
* `a2a` and the `skills` specs are the deployment's CURRENT ones as this resume hands them (the leg dials these lists as the config doors
|
|
2718
2814
|
* judge them; absent declares none) — a host replaying the parked run's lists re-dials a server its user removed. The parked call is
|
|
@@ -2720,7 +2816,7 @@ export interface RunState {
|
|
|
2720
2816
|
* reopened `pending`); a replacement ⇒ `resume.tool_contract_mismatch`; a moved face or declaration ⇒ `resume.target_moved`. Identity is
|
|
2721
2817
|
* kept instead: a contradicting `principal` is refused (`resume.principal_mismatch`), an absent one inherits the row's.
|
|
2722
2818
|
*/
|
|
2723
|
-
export type ResumeTaskConfig = Omit<TaskSpec, "objective" | "
|
|
2819
|
+
export type ResumeTaskConfig = Omit<TaskSpec, "objective" | "userAttachments" | "runOrigin" | SessionBoundSpecMember>;
|
|
2724
2820
|
/**
|
|
2725
2821
|
* A composition leg's identity ({@link RunInternals.compositionLeg}, `CheckpointState.compositionLeg`): which entry handed the
|
|
2726
2822
|
* leg out, which leg of it this is, and the host session the composition runs for. One member per entry; `entry` is a closed
|
|
@@ -2798,9 +2894,14 @@ export interface ResumeRun {
|
|
|
2798
2894
|
* under the failure's reason (`reopenReasonOf`), recorded on the row so the next re-resume validates per
|
|
2799
2895
|
* reason — an `env_failed` reopen replays the persisted winner, the fresh-redecision reasons take a new
|
|
2800
2896
|
* decision. Answers the store's own answer — `"reopened"` (it flipped the row) or `"declined"` (`reopen`
|
|
2801
|
-
* answered `false`) — and rejects only with what the store threw (the row's state is then
|
|
2897
|
+
* answered `false`) — and rejects only with what the store threw (the row's state is then unproven unless
|
|
2898
|
+
* {@link claimedRowPending} shows the reopen landed);
|
|
2802
2899
|
* every exit reads it through `compensateUnstarted` (resume-startup-cause.ts), the one reading. */
|
|
2803
2900
|
reopenUnstarted: (reason: ReopenReason) => Promise<"reopened" | "declined">;
|
|
2901
|
+
/** The row read that can show a reopen landed, bound to THIS resume's token like {@link reopenUnstarted} and REQUIRED beside it:
|
|
2902
|
+
* `true` when the row reads `pending` at a generation past the one the claim won at. `compensateUnstarted` asks it only after a
|
|
2903
|
+
* `reopen` that threw — a write that may have landed — and any other reading, or a read that throws, leaves the state unproven. */
|
|
2904
|
+
claimedRowPending: () => Promise<boolean>;
|
|
2804
2905
|
/** The row's execution-record verb, bound to THIS resume's token and scope by `resumeStream` (the
|
|
2805
2906
|
* same closure form as {@link reopenUnstarted}, and REQUIRED for the same reason: the store contract requires the
|
|
2806
2907
|
* verb, so there is no store this seat could be absent for). The pending-call resolver calls it
|
|
@@ -2872,6 +2973,8 @@ export interface TurnBoundaryDeps {
|
|
|
2872
2973
|
windowSafetyOptions: (mainModel: Model) => Pick<MaybeCompactOptions, "fallbackBudget" | "onWindowSafety">;
|
|
2873
2974
|
rapidRefill: RapidRefillState;
|
|
2874
2975
|
drainManualCompact: (outcome: CompactOutcome) => void;
|
|
2976
|
+
/** The leg's display (a top-level leg's), waited on at each boundary before its work. */
|
|
2977
|
+
display: import("../mods/message-display.js").MessageDisplay | undefined;
|
|
2875
2978
|
runnerHooks: {
|
|
2876
2979
|
onError: RunnerDeps["onError"];
|
|
2877
2980
|
};
|
|
@@ -2884,26 +2987,31 @@ export interface TurnBoundaryDeps {
|
|
|
2884
2987
|
* 工厂调用点的 const 稳定引用 + 三个 runLocked 形参;this 面(deps.onError)经 runnerHooks 打包
|
|
2885
2988
|
* (B13 #coreView / R9 TurnBoundaryDeps 同款)。*/
|
|
2886
2989
|
/** What a PRODUCER of a `tool_progress` frame knows: the FACTS it observed. The frame minus everything only
|
|
2887
|
-
* the run supplies — its discriminator, its {@link TaskEventIdentity} stamp,
|
|
2888
|
-
* lane computes from its own per-call origin
|
|
2990
|
+
* the run supplies — its discriminator, its {@link TaskEventIdentity} stamp, the elapsed time, which the
|
|
2991
|
+
* lane computes from its own per-call origin, and the gate phase, which it reads off the call's occurrence. Derived from
|
|
2992
|
+
* the union member, so seat and frame cannot drift. */
|
|
2889
2993
|
export type ToolProgressBody = Omit<Extract<TaskEvent, {
|
|
2890
2994
|
type: "tool_progress";
|
|
2891
|
-
}>, "type" | "elapsedTimeSeconds" | keyof TaskEventIdentity>;
|
|
2995
|
+
}>, "type" | "elapsedTimeSeconds" | "gate" | keyof TaskEventIdentity>;
|
|
2892
2996
|
/** The run's TOOL-PROGRESS lane: the ONE mint of `tool_progress` plus the heartbeat over the calls in flight —
|
|
2893
2997
|
* the leg's occurrences (`Prepared.toolOccurrences`), read, never a set of its own. Declared on the FLOOR because
|
|
2894
2998
|
* both registry-side readers sit above its implementation (the driver builds it, the harness-handler lane drives
|
|
2895
2999
|
* it) and the Prepared seat that carries it to the tool band is here too. `createToolProgressLane`
|
|
2896
3000
|
* (tool-progress-lane.ts, layer 1) is its one implementation. */
|
|
2897
3001
|
export interface ToolProgressLane {
|
|
2898
|
-
/** Offer ONE frame — from a tool that observes its own progress (the shell's per-second tick) or from
|
|
2899
|
-
*
|
|
2900
|
-
* the
|
|
3002
|
+
/** Offer ONE frame — from a tool that observes its own progress (the shell's per-second tick) or from the lane's own heartbeat.
|
|
3003
|
+
* The lane stamps the elapsed time, DROPS an offer inside the cadence floor, resets that call's beat clock when it keeps one, and
|
|
3004
|
+
* beats the leg's activity seat when a producer's `totalBytes` advanced (never for the heartbeat). NEVER THROWS: a tool calls this
|
|
2901
3005
|
* from inside an environment output callback, where a throw kills the command it is describing. */
|
|
2902
3006
|
emit(body: ToolProgressBody): void;
|
|
2903
3007
|
/** The heartbeat stops covering every call in flight and disarms (turn end / teardown): no beating into the next
|
|
2904
3008
|
* turn. The occurrences stay — a later end must still know its start went out. */
|
|
2905
3009
|
clear(): void;
|
|
2906
3010
|
}
|
|
3011
|
+
/** The run's one `message_committed` mint ({@link runClockAndContent}): a tool result names its `toolCallId` (the join key to the
|
|
3012
|
+
* call already rendered); a user row names its source (`userRow`, {@link UserRowSource} — what the row is and, for a person's input,
|
|
3013
|
+
* which `human_input` key it carries); an assistant message names neither. Naming one where it does not belong is refused. */
|
|
3014
|
+
export type EmitCommitted = (entryId: string, role: "user" | "assistant" | "toolResult", toolCallId?: string, userRow?: import("../user-row-origin.js").UserRowSource) => void;
|
|
2907
3015
|
export interface HarnessHandlersDeps {
|
|
2908
3016
|
spec: TaskSpec;
|
|
2909
3017
|
queue: PushQueue<TaskEvent>;
|
|
@@ -2914,7 +3022,10 @@ export interface HarnessHandlersDeps {
|
|
|
2914
3022
|
sourceTaskId?: string;
|
|
2915
3023
|
};
|
|
2916
3024
|
pushContent: (e: TaskEvent) => void;
|
|
2917
|
-
|
|
3025
|
+
/** The leg's display (a top-level leg's): an assistant message's text deltas and block closes are written into it instead of
|
|
3026
|
+
* pushed (it pushes them, or what its handlers show of them). */
|
|
3027
|
+
display: import("../mods/message-display.js").MessageDisplay | undefined;
|
|
3028
|
+
emitCommitted: EmitCommitted;
|
|
2918
3029
|
startedToolCallIds: Set<string>;
|
|
2919
3030
|
toolStartAt: Map<string, number>;
|
|
2920
3031
|
/** The run's tool-progress lane: the handlers tell it when a call enters and leaves execution, and
|
|
@@ -2986,8 +3097,18 @@ export interface RunnerSelfSeat {
|
|
|
2986
3097
|
* true only when its deps carry an `executionEnvFactory` (live read — `swapDeps` replaces the deps). The delegation tool asks
|
|
2987
3098
|
* the runner that will run the child, not the one that ran the parent leg. Absent on a hand-built seat ⇒ read as "cannot say" ⇒ no; a hand-built seat answers for the runner its `runTask` forwards to. */
|
|
2988
3099
|
canRerootChild?(): boolean;
|
|
3100
|
+
/** A completion addressed to a delegation tree's root, through THIS runner's notification route: the route's sink when the
|
|
3101
|
+
* deployment judges the root a durable box at `root.scope` that takes engine frames (the sink then reaches the root's live run
|
|
3102
|
+
* here, else its seat here, else that box), or why not. Asked by a drive that carries no run lane and whose task registry holds
|
|
3103
|
+
* no park of the cycle. `unkept` = where a frame goes when the box of a root seated nowhere here failed it twice. The route
|
|
3104
|
+
* judges again at each delivery. Absent on a hand-built seat ⇒ read as "no route" (the drive keeps the mount's sink). */
|
|
3105
|
+
sessionCompletionLane?(root: SessionAddress, unkept?: TaskNotificationSink): SessionCompletionLane;
|
|
2989
3106
|
/** Fire `RunnerDeps.onTaskOutcome` through the swallow-guarded chokepoint (thin compositions emit at their terminal state). */
|
|
2990
3107
|
emitTaskOutcome(outcome: TaskOutcome): void;
|
|
3108
|
+
/** Announce a fact of a composition's own (the verification gate's `verify.verifier_is_implementer`) on `RunnerDeps.onNotice`, live-read,
|
|
3109
|
+
* through the one delivery form every notice leaves by (`deliverEngineNotice`: the same-principal text pass, the session lift, a
|
|
3110
|
+
* throwing sink contained). Absent on a hand-built seat ⇒ the composition cannot say it, and says nothing; the Runner always has it. */
|
|
3111
|
+
emitNotice?(notice: import("../engine-notice.js").EngineNotice): void;
|
|
2991
3112
|
/** A hold, on the peer seat THIS runner's legs ask, of the references `declared` names — taken by a keeper of declarations
|
|
2992
3113
|
* outside a leg (a retained child's ledger entry), released by it once (peer-seat.ts `holdPeerDeclarations`). */
|
|
2993
3114
|
holdDeclarations(declared: import("../peer-seat.js").PeerDeclarations): import("../peer-seat.js").PeerDeclarationHold;
|
|
@@ -3062,6 +3183,9 @@ export interface TaskIdRef {
|
|
|
3062
3183
|
effectiveReasoning?: TaskResult["effectiveReasoning"];
|
|
3063
3184
|
delegationTerminalOwed?: HookInvocationIdentity;
|
|
3064
3185
|
editedFiles?: () => TaskResult["editedFiles"];
|
|
3186
|
+
/** Whether the leg's prompt message was committed: `{ committed: false }` from the carrier's creation, replaced at the prompt
|
|
3187
|
+
* receipt by the commit's reading (`intakeOfCommit`; `undefined` when the store handed back no usable entry id). */
|
|
3188
|
+
intake?: TaskResult["intake"];
|
|
3065
3189
|
}
|
|
3066
3190
|
/** The manual `/compact` request seat: the `requested` flag, the parked waiters (each with its
|
|
3067
3191
|
* caller's cancel signal and per-call instructions), the run body's mooted-frame channel and the registration
|
|
@@ -3081,29 +3205,13 @@ export interface ManualCompactRef {
|
|
|
3081
3205
|
}
|
|
3082
3206
|
/**
|
|
3083
3207
|
* The end-of-task compaction pass's outcome (`Runner.finish`'s return): what the terminal-adoption lane
|
|
3084
|
-
* hands the settle lane, which reads it for the `compacted` frame, the phase-timings frame and the detector reset
|
|
3085
|
-
*
|
|
3208
|
+
* hands the settle lane, which reads it for the `compacted` frame, the phase-timings frame and the detector reset: what
|
|
3209
|
+
* the `compacted` frame's mint reads ({@link CompactedFrameSource}), plus whether the pass landed. Named once here so the
|
|
3210
|
+
* two lanes and the method spell one type.
|
|
3086
3211
|
*/
|
|
3087
|
-
export type EndOfTaskCompaction = {
|
|
3212
|
+
export type EndOfTaskCompaction = ({
|
|
3088
3213
|
compacted: boolean;
|
|
3089
|
-
|
|
3090
|
-
tokensBefore?: number;
|
|
3091
|
-
freedTokens?: number;
|
|
3092
|
-
triggerTokens?: number;
|
|
3093
|
-
postTriggerTokens?: number;
|
|
3094
|
-
durationMs?: number;
|
|
3095
|
-
phaseDurations?: CompactionPhaseDurations;
|
|
3096
|
-
firstKeptEntryId?: string;
|
|
3097
|
-
attachedFiles?: Array<{
|
|
3098
|
-
path: string;
|
|
3099
|
-
chars: number;
|
|
3100
|
-
truncated: boolean;
|
|
3101
|
-
}>;
|
|
3102
|
-
modelFallback?: true;
|
|
3103
|
-
fallbackReason?: "window";
|
|
3104
|
-
clampedRatio?: number;
|
|
3105
|
-
clampReason?: "budget" | "tolerance";
|
|
3106
|
-
} | undefined;
|
|
3214
|
+
} & CompactedFrameSource) | undefined;
|
|
3107
3215
|
/**
|
|
3108
3216
|
* The notification lane's BINDINGS: the run-notification-lane's own four `let`s as ONE seat (getters
|
|
3109
3217
|
* and setters over the lane's variables, never a copy). The identity-wiring lane binds `harness` / `sessionId` /
|