@sema-agent/core 7.60.0 → 7.61.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 +605 -0
- package/README.md +2 -2
- package/dist/agents/agent-transcript-tool.d.ts +2 -2
- package/dist/agents/agent-transcript-tool.js +1 -1
- package/dist/agents/cascade.d.ts +61 -10
- package/dist/agents/cascade.js +60 -20
- package/dist/agents/composition-allowance.d.ts +53 -0
- package/dist/agents/composition-allowance.js +49 -0
- package/dist/agents/composition-placement.d.ts +29 -0
- package/dist/agents/composition-placement.js +24 -0
- package/dist/agents/cumulative-stats.d.ts +4 -0
- package/dist/agents/cumulative-stats.js +3 -0
- package/dist/agents/inherited-tool-pool.d.ts +5 -3
- package/dist/agents/inherited-tool-pool.js +2 -2
- package/dist/agents/list-agents-tool.d.ts +1 -1
- package/dist/agents/peer-notice-route.d.ts +1 -1
- package/dist/agents/peer-notice-route.js +4 -3
- package/dist/agents/peer-notices.d.ts +4 -4
- package/dist/agents/peer-notices.js +8 -4
- package/dist/agents/peer-session-drain.d.ts +8 -1
- package/dist/agents/peer-session-drain.js +36 -7
- package/dist/agents/repair-loop.js +16 -6
- package/dist/agents/retain-ledger.js +3 -1
- package/dist/agents/roster-store.d.ts +1 -1
- package/dist/agents/roster-store.js +7 -4
- package/dist/agents/send-message-tool.d.ts +8 -10
- package/dist/agents/send-message-tool.js +43 -23
- package/dist/agents/subagent-completion-gate.d.ts +35 -0
- package/dist/agents/subagent-completion-gate.js +62 -0
- package/dist/agents/subagent-steps.d.ts +7 -6
- package/dist/agents/subagent.d.ts +30 -40
- package/dist/agents/subagent.js +187 -196
- package/dist/agents/suspend-guard.d.ts +9 -0
- package/dist/agents/suspend-guard.js +4 -0
- package/dist/agents/verify.d.ts +41 -14
- package/dist/agents/verify.js +37 -27
- package/dist/brain/anthropic.js +1 -0
- package/dist/brain/errors.d.ts +7 -1
- package/dist/brain/errors.js +6 -0
- package/dist/brain/failover.js +2 -1
- package/dist/brain/open-responses.js +1 -0
- package/dist/brain/openai.js +1 -0
- package/dist/brain/provider-dialect.d.ts +10 -0
- package/dist/brain/provider-dialect.js +13 -2
- package/dist/brain/stream-engine.d.ts +3 -0
- package/dist/brain/stream-engine.js +4 -0
- package/dist/core/agent-state.d.ts +1 -1
- package/dist/core/allow-entry.d.ts +59 -23
- package/dist/core/allow-entry.js +131 -38
- package/dist/core/ask-origin.d.ts +79 -0
- package/dist/core/ask-origin.js +76 -0
- package/dist/core/ask-question.d.ts +19 -13
- package/dist/core/ask-question.js +8 -2
- package/dist/core/auto-compaction.d.ts +2 -0
- package/dist/core/auto-compaction.js +2 -1
- package/dist/core/auto-mode.js +3 -5
- package/dist/core/background-agent-store.d.ts +7 -5
- package/dist/core/background-agent-store.js +12 -11
- package/dist/core/checkpoint-requirements.d.ts +24 -3
- package/dist/core/checkpoint-requirements.js +9 -1
- package/dist/core/checkpoint-store.d.ts +78 -19
- package/dist/core/checkpoint-store.js +8 -4
- package/dist/core/child-clamp-seats.d.ts +3 -2
- package/dist/core/child-clamp-seats.js +4 -3
- package/dist/core/closest-name.d.ts +13 -0
- package/dist/core/closest-name.js +35 -0
- package/dist/core/context-settings.js +3 -5
- package/dist/core/cross-boundary-taint.d.ts +1 -1
- package/dist/core/decision-receipt.d.ts +14 -1
- package/dist/core/decision-receipt.js +6 -3
- package/dist/core/delegation-frames.d.ts +13 -9
- package/dist/core/effective-path-target.js +2 -3
- package/dist/core/engine-attestation.d.ts +11 -1
- package/dist/core/engine-attestation.js +2 -0
- package/dist/core/engine-notice.d.ts +49 -18
- package/dist/core/file-history-retention.d.ts +8 -0
- package/dist/core/file-history-retention.js +14 -11
- package/dist/core/file-history-store.d.ts +31 -1
- package/dist/core/file-history-store.js +31 -2
- package/dist/core/frame-settlement.d.ts +10 -0
- package/dist/core/frame-settlement.js +6 -1
- package/dist/core/fs-write-gate-policy.d.ts +3 -3
- package/dist/core/fs-write-gate-policy.js +8 -7
- package/dist/core/gate-fold.js +2 -1
- package/dist/core/gate-lanes.js +7 -4
- package/dist/core/gate-outcome.d.ts +40 -1
- package/dist/core/gate-outcome.js +10 -0
- package/dist/core/git-worktree-env.d.ts +7 -3
- package/dist/core/git-worktree-env.js +16 -13
- package/dist/core/governance-codes.d.ts +12 -4
- package/dist/core/governance-codes.js +16 -4
- package/dist/core/hooks.d.ts +12 -4
- package/dist/core/hooks.js +11 -4
- package/dist/core/host-floor.js +3 -5
- package/dist/core/image-admission.d.ts +48 -8
- package/dist/core/image-admission.js +35 -4
- package/dist/core/input-author.d.ts +36 -0
- package/dist/core/input-author.js +39 -0
- package/dist/core/leg-identity.d.ts +62 -0
- package/dist/core/leg-identity.js +18 -0
- package/dist/core/locked-config.d.ts +2 -1
- package/dist/core/locked-config.js +5 -3
- package/dist/core/lsp.d.ts +5 -3
- package/dist/core/lsp.js +3 -2
- package/dist/core/mailbox-store.d.ts +85 -10
- package/dist/core/mailbox-store.js +31 -10
- package/dist/core/mcp-connection-pool.d.ts +6 -20
- package/dist/core/mcp-connection-pool.js +10 -28
- package/dist/core/mcp-failure.d.ts +76 -15
- package/dist/core/mcp-failure.js +60 -33
- package/dist/core/mcp-host-seat.d.ts +92 -53
- package/dist/core/mcp-host-seat.js +220 -46
- package/dist/core/mcp-probe.js +2 -2
- package/dist/core/mcp-server-link.d.ts +18 -6
- package/dist/core/mcp-server-link.js +19 -4
- package/dist/core/mcp-server-spec.d.ts +2 -1
- package/dist/core/mcp-session-end.d.ts +1 -2
- package/dist/core/mcp-session-end.js +1 -1
- package/dist/core/mcp.d.ts +6 -49
- package/dist/core/mcp.js +115 -111
- package/dist/core/media-byte-cap.d.ts +21 -46
- package/dist/core/media-byte-cap.js +55 -55
- package/dist/core/member-group.d.ts +7 -0
- package/dist/core/member-group.js +35 -0
- package/dist/core/memory-engine/consolidation.d.ts +1 -1
- package/dist/core/memory-engine/consolidation.js +7 -1
- package/dist/core/memory-engine/dual-root.d.ts +31 -0
- package/dist/core/memory-engine/dual-root.js +59 -11
- package/dist/core/memory-engine/engine.js +27 -24
- package/dist/core/memory-engine/file-backend.d.ts +13 -0
- package/dist/core/memory-engine/file-backend.js +35 -15
- package/dist/core/memory-engine/layout.d.ts +3 -0
- package/dist/core/memory-engine/layout.js +13 -3
- package/dist/core/memory-engine/memory-deployment.d.ts +110 -0
- package/dist/core/memory-engine/memory-deployment.js +182 -0
- package/dist/core/memory-engine/sync-client.d.ts +39 -18
- package/dist/core/memory-engine/sync-client.js +72 -14
- package/dist/core/memory-engine/sync-report.d.ts +7 -4
- package/dist/core/memory-engine/sync.d.ts +9 -1
- package/dist/core/mode-policy.d.ts +8 -8
- package/dist/core/mode-policy.js +7 -5
- package/dist/core/mods/agent-stations.d.ts +39 -4
- package/dist/core/mods/agent-stations.js +59 -10
- package/dist/core/mods/dollar.d.ts +62 -0
- package/dist/core/mods/extension-call.d.ts +15 -1
- package/dist/core/mods/extension-call.js +7 -2
- package/dist/core/mods/kernel/dispatch.d.ts +4 -3
- package/dist/core/mods/kernel/dispatch.js +4 -4
- package/dist/core/mods/kernel/events.d.ts +4 -1
- package/dist/core/mods/kernel/events.js +6 -6
- package/dist/core/mods/kernel/registration.d.ts +3 -0
- package/dist/core/mods/kernel/registration.js +5 -0
- package/dist/core/mods/kernel/site-rules.d.ts +6 -3
- package/dist/core/mods/kernel/site-rules.js +10 -2
- package/dist/core/mods/session-append.d.ts +115 -0
- package/dist/core/mods/session-append.js +311 -0
- package/dist/core/mods/session-compact.d.ts +48 -0
- package/dist/core/mods/session-compact.js +194 -0
- package/dist/core/mods/session-receive.d.ts +93 -0
- package/dist/core/mods/session-receive.js +141 -0
- package/dist/core/mods/session-send.d.ts +72 -0
- package/dist/core/mods/session-send.js +88 -0
- package/dist/core/mods/stations.d.ts +38 -16
- package/dist/core/mods/stations.js +25 -11
- package/dist/core/mods/tool-call.d.ts +2 -0
- package/dist/core/mods/tool-call.js +4 -4
- package/dist/core/output-style.js +3 -4
- package/dist/core/own-property-receipt.d.ts +61 -2
- package/dist/core/own-property-receipt.js +42 -2
- package/dist/core/park-selfcheck.js +4 -2
- package/dist/core/path-identity.d.ts +11 -0
- package/dist/core/path-identity.js +4 -0
- package/dist/core/path-rule-binding.d.ts +3 -1
- package/dist/core/path-rule-binding.js +3 -1
- package/dist/core/peer-seat.d.ts +3 -3
- package/dist/core/peer-seat.js +20 -8
- package/dist/core/permission-rule-consent.d.ts +21 -5
- package/dist/core/permission-rule-consent.js +21 -1
- package/dist/core/permission-rule-model.d.ts +34 -11
- package/dist/core/permission-rule-model.js +47 -10
- package/dist/core/permission-rule-org.d.ts +1 -1
- package/dist/core/permission-rule-provider.js +4 -1
- package/dist/core/permission-rules.d.ts +4 -0
- package/dist/core/permission-rules.js +11 -16
- package/dist/core/remote-env.d.ts +74 -26
- package/dist/core/remote-env.js +20 -0
- package/dist/core/retention-policy.d.ts +24 -23
- package/dist/core/retention-policy.js +36 -2
- package/dist/core/retention.d.ts +4 -1
- package/dist/core/retired-keys.d.ts +4 -4
- package/dist/core/row-admission.d.ts +10 -0
- package/dist/core/row-admission.js +5 -0
- package/dist/core/runner/advisor-instructions.d.ts +2 -1
- package/dist/core/runner/advisor-instructions.js +2 -1
- package/dist/core/runner/announce-once-ledger.d.ts +4 -4
- package/dist/core/runner/assemble-result.d.ts +13 -3
- package/dist/core/runner/assemble-result.js +12 -7
- package/dist/core/runner/caller-roster.d.ts +12 -9
- package/dist/core/runner/caller-roster.js +5 -2
- package/dist/core/runner/checkpoint-scope.d.ts +16 -1
- package/dist/core/runner/checkpoint-scope.js +21 -0
- package/dist/core/runner/compact-session.js +14 -2
- package/dist/core/runner/compaction-call-options.d.ts +1 -1
- package/dist/core/runner/compaction-restate.d.ts +2 -2
- package/dist/core/runner/compaction-restate.js +4 -3
- package/dist/core/runner/construction-doors.d.ts +2 -2
- package/dist/core/runner/construction-doors.js +2 -2
- package/dist/core/runner/contracts.d.ts +98 -26
- package/dist/core/runner/cross-boundary-lane.d.ts +1 -1
- package/dist/core/runner/decide-continuation.d.ts +4 -2
- package/dist/core/runner/decide-continuation.js +7 -4
- package/dist/core/runner/denial-limit-arms.d.ts +15 -21
- package/dist/core/runner/denial-limit-arms.js +17 -10
- package/dist/core/runner/expire-settle.d.ts +44 -0
- package/dist/core/runner/expire-settle.js +55 -0
- package/dist/core/runner/git-status-frame.d.ts +3 -3
- package/dist/core/runner/git-status-frame.js +2 -1
- package/dist/core/runner/halt-attribution.d.ts +2 -1
- package/dist/core/runner/halt-attribution.js +2 -1
- package/dist/core/runner/local-claims.d.ts +17 -0
- package/dist/core/runner/local-claims.js +18 -0
- package/dist/core/runner/media-removed-seat.d.ts +46 -0
- package/dist/core/runner/media-removed-seat.js +88 -0
- package/dist/core/runner/park-commit.d.ts +2 -2
- package/dist/core/runner/permission-rule-lanes.d.ts +5 -1
- package/dist/core/runner/permission-rule-lanes.js +28 -9
- package/dist/core/runner/person-path-rows.js +1 -1
- package/dist/core/runner/placement-fence.d.ts +26 -0
- package/dist/core/runner/placement-fence.js +38 -0
- package/dist/core/runner/prepare-ask-lane.d.ts +6 -12
- package/dist/core/runner/prepare-ask-lane.js +4 -4
- package/dist/core/runner/prepare-boundary-parks.d.ts +4 -1
- package/dist/core/runner/prepare-boundary-parks.js +2 -2
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +2 -0
- package/dist/core/runner/prepare-caps-and-workflow.js +1 -0
- package/dist/core/runner/prepare-config-doors.js +16 -17
- package/dist/core/runner/prepare-context-lane.d.ts +6 -2
- package/dist/core/runner/prepare-context-lane.js +13 -13
- package/dist/core/runner/prepare-delegation-surface.d.ts +9 -9
- package/dist/core/runner/prepare-delegation-surface.js +4 -5
- package/dist/core/runner/prepare-execution-env.d.ts +5 -2
- package/dist/core/runner/prepare-execution-env.js +7 -4
- package/dist/core/runner/prepare-gate-stations.d.ts +19 -14
- package/dist/core/runner/prepare-gate-stations.js +6 -4
- package/dist/core/runner/prepare-hands-readface.d.ts +5 -5
- package/dist/core/runner/prepare-hands-readface.js +4 -4
- package/dist/core/runner/prepare-inherited-gate.d.ts +6 -0
- package/dist/core/runner/prepare-inherited-gate.js +3 -0
- package/dist/core/runner/prepare-lsp.d.ts +3 -0
- package/dist/core/runner/prepare-lsp.js +2 -2
- package/dist/core/runner/prepare-park-ask.d.ts +5 -2
- package/dist/core/runner/prepare-park-ask.js +4 -5
- package/dist/core/runner/prepare-policy-chain.d.ts +10 -21
- package/dist/core/runner/prepare-policy-chain.js +16 -25
- package/dist/core/runner/prepare-project-context.d.ts +2 -2
- package/dist/core/runner/prepare-prompt-inputs.d.ts +5 -4
- package/dist/core/runner/prepare-prompt-inputs.js +3 -2
- package/dist/core/runner/prepare-question-face.d.ts +6 -4
- package/dist/core/runner/prepare-question-face.js +2 -2
- package/dist/core/runner/prepare-run-refs.d.ts +3 -0
- package/dist/core/runner/prepare-run-refs.js +2 -2
- package/dist/core/runner/prepare-suspend-saga.d.ts +11 -7
- package/dist/core/runner/prepare-suspend-saga.js +17 -7
- package/dist/core/runner/prepare-task.d.ts +1 -1
- package/dist/core/runner/prepare-task.js +56 -28
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +6 -0
- package/dist/core/runner/prepare-tool-disclosure-mount.js +3 -1
- package/dist/core/runner/prepare-wiring-manifest.d.ts +3 -0
- package/dist/core/runner/prepare-wiring-manifest.js +2 -1
- package/dist/core/runner/prepare-workspace-restore.d.ts +5 -0
- package/dist/core/runner/prepare-workspace-restore.js +10 -6
- package/dist/core/runner/read-root-grant.d.ts +1 -1
- package/dist/core/runner/read-root-grant.js +2 -1
- package/dist/core/runner/resume-admission.d.ts +5 -3
- package/dist/core/runner/resume-admission.js +17 -3
- package/dist/core/runner/resume-apply.js +3 -1
- package/dist/core/runner/resume-claim.d.ts +8 -3
- package/dist/core/runner/resume-claim.js +28 -12
- package/dist/core/runner/resume-internals-and-config.d.ts +2 -2
- package/dist/core/runner/resume-internals-and-config.js +10 -1
- package/dist/core/runner/resume-preflight.d.ts +3 -2
- package/dist/core/runner/resume-preflight.js +13 -26
- package/dist/core/runner/retired-runner-deps.js +2 -0
- package/dist/core/runner/run-git-lane.js +2 -1
- package/dist/core/runner/run-harness-handlers.js +2 -2
- package/dist/core/runner/run-identity-wiring.d.ts +2 -2
- package/dist/core/runner/run-identity-wiring.js +14 -5
- package/dist/core/runner/run-leg.d.ts +3 -3
- package/dist/core/runner/run-leg.js +40 -29
- package/dist/core/runner/run-notification-lane.js +20 -2
- package/dist/core/runner/run-recovery-lanes.js +3 -2
- package/dist/core/runner/run-settle-and-teardown.js +9 -7
- package/dist/core/runner/run-telemetry-and-budget-seats.d.ts +1 -1
- package/dist/core/runner/run-terminal-adoption.d.ts +1 -1
- package/dist/core/runner/run-terminal-adoption.js +26 -17
- package/dist/core/runner/run-turn-boundary.js +27 -14
- package/dist/core/runner/runtask.d.ts +18 -3
- package/dist/core/runner/runtask.js +27 -11
- package/dist/core/runner/session-rule-policy.d.ts +1 -1
- package/dist/core/runner/session-rule-policy.js +6 -1
- package/dist/core/runner/shell-env-withheld.d.ts +1 -1
- package/dist/core/runner/stream-halt-verbs.d.ts +1 -14
- package/dist/core/runner/stream-halt-verbs.js +4 -3
- package/dist/core/runner/stream-reap.d.ts +7 -6
- package/dist/core/runner/stream-reap.js +13 -16
- package/dist/core/runner/stream-settle-backstop.d.ts +3 -2
- package/dist/core/runner/stream-settle-backstop.js +5 -3
- package/dist/core/runner/stream-steer-verb.d.ts +5 -2
- package/dist/core/runner/stream-steer-verb.js +8 -7
- package/dist/core/runner/terminal-account.d.ts +11 -1
- package/dist/core/runner/terminal-account.js +20 -0
- package/dist/core/runner/terminal-projection.d.ts +8 -2
- package/dist/core/runner/terminal-projection.js +2 -2
- package/dist/core/runner/tool-disclosure.d.ts +3 -0
- package/dist/core/runner/tool-disclosure.js +5 -2
- package/dist/core/runner/tool-end-body.d.ts +3 -3
- package/dist/core/runner/tool-end-body.js +1 -1
- package/dist/core/runner/tool-output-projection.d.ts +3 -3
- package/dist/core/runner/tool-output-projection.js +7 -6
- package/dist/core/runner/tool-table-view.d.ts +56 -0
- package/dist/core/runner/tool-table-view.js +51 -0
- package/dist/core/runner/turn-attachments.d.ts +3 -2
- package/dist/core/runner/turn-attachments.js +1 -1
- package/dist/core/runner/void-verifier-pause.d.ts +33 -0
- package/dist/core/runner/void-verifier-pause.js +41 -0
- package/dist/core/runner-deps.d.ts +24 -25
- package/dist/core/secret-env.d.ts +11 -11
- package/dist/core/secret-env.js +8 -9
- package/dist/core/session-log-transfer.js +9 -10
- package/dist/core/session-policy-store.d.ts +1 -1
- package/dist/core/session-policy-store.js +5 -2
- package/dist/core/session-reconcile.d.ts +3 -2
- package/dist/core/session-reconcile.js +7 -4
- package/dist/core/session-store.d.ts +2 -0
- package/dist/core/session-store.js +5 -7
- package/dist/core/session.d.ts +2 -1
- package/dist/core/shell-confinement.d.ts +37 -0
- package/dist/core/shell-confinement.js +56 -0
- package/dist/core/skill-grant.js +1 -1
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +2 -2
- package/dist/core/store-contracts/checkpoint-store-contract.js +15 -2
- package/dist/core/store-contracts/file-history-store-contract.d.ts +5 -2
- package/dist/core/store-contracts/file-history-store-contract.js +25 -1
- package/dist/core/store-contracts/mailbox-store-contract.d.ts +12 -5
- package/dist/core/store-contracts/mailbox-store-contract.js +156 -9
- package/dist/core/store-contracts/tool-result-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/tool-result-store-contract.js +30 -0
- package/dist/core/task-event.d.ts +17 -8
- package/dist/core/task-limits.d.ts +5 -0
- package/dist/core/task-notification.d.ts +89 -12
- package/dist/core/task-notification.js +87 -13
- package/dist/core/task-registry-agent.d.ts +5 -43
- package/dist/core/task-registry-agent.js +24 -51
- package/dist/core/task-registry-monitor.d.ts +1 -1
- package/dist/core/task-registry-monitor.js +15 -60
- package/dist/core/task-registry-shared.d.ts +15 -112
- package/dist/core/task-registry-shared.js +3 -41
- package/dist/core/task-registry-workflow.js +4 -21
- package/dist/core/task-registry.d.ts +19 -60
- package/dist/core/task-registry.js +19 -106
- package/dist/core/task-result.d.ts +24 -7
- package/dist/core/task-spec-members.d.ts +39 -0
- package/dist/core/task-spec-members.js +92 -0
- package/dist/core/task-spec.d.ts +10 -10
- package/dist/core/task-tool-shape.d.ts +7 -57
- package/dist/core/task-tool-shape.js +7 -66
- package/dist/core/terminal-cause.d.ts +30 -0
- package/dist/core/terminal-cause.js +1 -0
- package/dist/core/tool-catalog-entries.js +2 -5
- package/dist/core/tool-check-reading.js +16 -10
- package/dist/core/tool-conformance.js +1 -2
- package/dist/core/tool-errors.d.ts +6 -3
- package/dist/core/tool-errors.js +2 -0
- package/dist/core/tool-face-reader.js +3 -2
- package/dist/core/tool-face.d.ts +2 -3
- package/dist/core/tool-name-aliases.d.ts +5 -29
- package/dist/core/tool-name-aliases.js +9 -5
- package/dist/core/tool-name-readings.d.ts +14 -3
- package/dist/core/tool-name-readings.js +2 -0
- package/dist/core/tool-policy.d.ts +108 -18
- package/dist/core/tool-policy.js +84 -14
- package/dist/core/tool-result-store.d.ts +23 -0
- package/dist/core/tool-result-store.js +3 -2
- package/dist/core/tool-spec.d.ts +19 -6
- package/dist/core/trace.d.ts +18 -1
- package/dist/core/user-attachment.js +26 -21
- package/dist/core/workflow-journal-store.d.ts +1 -1
- package/dist/core/workflow-run-store.d.ts +2 -0
- package/dist/core/workflow-run-store.js +6 -5
- package/dist/core/workflow-settled-run.d.ts +5 -0
- package/dist/core/workflow-settled-run.js +7 -0
- package/dist/engine/execution-env/node-execution-env.d.ts +34 -9
- package/dist/engine/execution-env/node-execution-env.js +213 -21
- package/dist/engine/harness/agent-harness.d.ts +65 -18
- package/dist/engine/harness/agent-harness.js +90 -23
- package/dist/engine/harness/messages.d.ts +4 -3
- package/dist/engine/harness/messages.js +2 -2
- package/dist/engine/harness/types.d.ts +41 -7
- package/dist/engine/llm/media-removed.d.ts +14 -0
- package/dist/engine/llm/media-removed.js +9 -0
- package/dist/engine/llm/rejected-images.d.ts +35 -25
- package/dist/engine/llm/rejected-images.js +59 -10
- package/dist/engine/llm/types.d.ts +24 -3
- package/dist/engine/llm/types.js +7 -3
- package/dist/engine/loop/agent-loop.d.ts +6 -1
- package/dist/engine/loop/agent-loop.js +20 -11
- package/dist/engine/loop/types.d.ts +12 -3
- package/dist/engine/session/import-validate.js +7 -0
- package/dist/fixtures/index.d.ts +7 -5
- package/dist/fixtures/index.js +5 -3
- package/dist/index.d.ts +21 -11
- package/dist/index.js +15 -7
- package/dist/internal/harness-types.d.ts +2 -0
- package/dist/internal/llm.d.ts +2 -1
- package/dist/internal/llm.js +1 -0
- package/dist/orchestration/goal.d.ts +6 -2
- package/dist/orchestration/goal.js +6 -3
- package/dist/orchestration/run-workflow-tool.d.ts +11 -17
- package/dist/orchestration/run-workflow-tool.js +19 -42
- package/dist/orchestration/workflow-governance.d.ts +1 -1
- package/dist/orchestration/workflow-types.d.ts +2 -2
- package/dist/orchestration/workflow.d.ts +4 -0
- package/dist/orchestration/workflow.js +8 -5
- package/dist/stores/file/background-agent-store.js +18 -15
- package/dist/stores/file/checkpoint-store.js +7 -4
- package/dist/stores/file/file-history-store.js +3 -2
- package/dist/stores/file/index.d.ts +5 -3
- package/dist/stores/file/index.js +23 -8
- package/dist/stores/file/ledger-tuning.d.ts +23 -0
- package/dist/stores/file/ledger-tuning.js +21 -0
- package/dist/stores/file/mailbox-store.js +42 -22
- package/dist/stores/file/memory-store.js +3 -2
- package/dist/stores/file/permission-rule-adopt.js +24 -21
- package/dist/stores/file/permission-rule-store.js +6 -3
- package/dist/stores/file/session-policy-store.js +3 -2
- package/dist/stores/file/session-store.d.ts +16 -3
- package/dist/stores/file/session-store.js +21 -20
- package/dist/stores/file/tool-result-store.d.ts +11 -0
- package/dist/stores/file/tool-result-store.js +57 -3
- package/dist/stores/file/usage-window-store.js +3 -2
- package/dist/stores/file/workflow-journal-store.d.ts +0 -2
- package/dist/stores/file/workflow-journal-store.js +3 -18
- package/dist/stores/file/workflow-run-store.d.ts +1 -1
- package/dist/stores/file/workflow-run-store.js +15 -10
- package/dist/tools/fs/dead-cwd.d.ts +5 -5
- package/dist/tools/fs/dead-cwd.js +4 -11
- package/dist/tools/fs/fs-bash-background-text.d.ts +6 -0
- package/dist/tools/fs/fs-bash-background-text.js +6 -0
- package/dist/tools/fs/fs-bash.d.ts +3 -18
- package/dist/tools/fs/fs-bash.js +37 -124
- package/dist/tools/fs/fs-pdf.js +8 -6
- package/dist/tools/fs/fs-read.js +2 -2
- package/dist/tools/fs/fs-shared.d.ts +28 -3
- package/dist/tools/fs/fs-shared.js +15 -0
- package/dist/tools/fs/index.d.ts +1 -1
- package/dist/tools/fs/index.js +4 -14
- package/dist/tools/fs/pdf.d.ts +4 -4
- package/dist/tools/fs/pdf.js +6 -6
- package/dist/tools/fs/read-deny-home.js +8 -1
- package/dist/tools/fs/read-deny.d.ts +26 -2
- package/dist/tools/fs/read-deny.js +9 -2
- package/dist/tools/fs/read-floor.d.ts +13 -5
- package/dist/tools/fs/read-floor.js +206 -2
- package/dist/tools/fs/search.d.ts +3 -2
- package/dist/tools/fs/search.js +6 -6
- package/dist/tools/fs/shell-read-establish.js +3 -1
- package/dist/tools/fs/shell-read-identity.d.ts +3 -1
- package/dist/tools/fs/shell-read-identity.js +4 -2
- package/dist/tools/fs/shell-read-judge.d.ts +7 -1
- package/dist/tools/fs/shell-read-judge.js +1 -1
- package/dist/tools/monitor.d.ts +8 -7
- package/dist/tools/monitor.js +12 -10
- package/dist/tools/worktree.d.ts +5 -1
- package/dist/tools/worktree.js +20 -17
- package/package.json +6 -3
- package/test/export-surface.snapshot.json +92 -10
- package/wire-changes/core-stores-sql@7.61.0.json +480 -0
- package/wire-changes/core@7.61.0.json +4405 -0
- package/wire-changes/mods-kernel@7.61.0.json +65 -0
- package/wire-changes/primitives@7.61.0.json +30 -0
- package/dist/core/runner/image-removed-seat.d.ts +0 -12
- package/dist/core/runner/image-removed-seat.js +0 -19
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The caller roster's ONE snapshot (#1167). A run's tool roster is the
|
|
3
|
-
*
|
|
4
|
-
* rebinds onto a private copy of the spec whose `tools` is an own, fixed
|
|
5
|
-
* FACES, each member read once (an omitted roster stays omitted, a value that is
|
|
6
|
-
*
|
|
2
|
+
* The caller roster's ONE snapshot (#1167). A run's tool roster is the array the run's one read of the caller's spec took for
|
|
3
|
+
* `tools` (`readCallerSpec`, at the run's entrance), its entries as they stand when prepare starts — before its first await — and
|
|
4
|
+
* nothing later, down to each entry's members: the driver rebinds onto a private copy of the spec whose `tools` is an own, fixed
|
|
5
|
+
* data property — a frozen array of frozen entry FACES, each member read once (an omitted roster stays omitted, a value that is
|
|
6
|
+
* no array stays as read). The safety scan, the mount, the listings and every other phase read those faces,
|
|
7
7
|
* so no phase can read the caller's objects a second time after a caller microtask had the chance to change them —
|
|
8
8
|
* not the array (a push, a reassignment of `spec.tools`) and not an entry (a name, an effect or egress mark, a schema,
|
|
9
9
|
* the `execute` function swapped in place, a getter or a Proxy answering differently on a later read).
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
*/
|
|
33
33
|
import type { AgentTool } from "../../internal/harness.js";
|
|
34
34
|
import type { TaskSpec } from "../types.js";
|
|
35
|
+
import { type CallerSpecRead } from "../task-spec-members.js";
|
|
35
36
|
import type { ToolSpec } from "../tool-spec.js";
|
|
36
37
|
import type { ToolDeclarationCode } from "../governance-codes.js";
|
|
37
38
|
import { type ToolCtxEnricher } from "../tools.js";
|
|
@@ -85,12 +86,14 @@ export declare function rosterFaceOf(t: unknown, index: number): RosterFace;
|
|
|
85
86
|
* run mounts is built from the face around the rebound `execute` ({@link mountedProduct}). `undefined` when the entry is
|
|
86
87
|
* not a product's face (the mount's ToolSpec arm takes it). */
|
|
87
88
|
export declare function rebindProductEntry(entry: object, enrich: ToolCtxEnricher): AgentTool | undefined;
|
|
88
|
-
/** Take the snapshot and rebind onto a private spec copy carrying it. The
|
|
89
|
-
*
|
|
90
|
-
* `tools`
|
|
91
|
-
|
|
89
|
+
/** Take the snapshot and rebind onto a private spec copy carrying it. The spec is taken through its one read
|
|
90
|
+
* (`readCallerSpec` — the read the run took at its entrance, answered again for its snapshot): the read's snapshot is plain
|
|
91
|
+
* own data, so the copy is that snapshot with `tools` replaced by its own frozen array of faces when the request carried one.
|
|
92
|
+
* The caller's own object is kept for {@link refuseLateRosterChanges} only; the read's refusal is handed back for prepare's door. */
|
|
93
|
+
export declare function snapshotCallerRoster(handedSpec: TaskSpec): {
|
|
92
94
|
spec: RosterSpec;
|
|
93
95
|
roster: CallerRosterSnapshot;
|
|
96
|
+
refusal: CallerSpecRead["refusal"];
|
|
94
97
|
};
|
|
95
98
|
/** Refuse the run when the caller's `spec.tools` no longer holds exactly the objects the snapshot read, in order. */
|
|
96
99
|
export declare function refuseLateRosterChanges(roster: CallerRosterSnapshot): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readCallerSpec } from "../task-spec-members.js";
|
|
1
2
|
import { TOOL_SPEC_MEMBERS, frozenExtra, frozenMember, newCopyState } from "../tool-spec-members.js";
|
|
2
3
|
import { RETIRED_TOOL_SPEC_KEYS, retiredKeyOf, retiredKeyRefusal } from "../retired-keys.js";
|
|
3
4
|
import { isDefineToolProduct, rebindDefineToolCtx } from "../tools.js";
|
|
@@ -223,14 +224,16 @@ export function rebindProductEntry(entry, enrich) {
|
|
|
223
224
|
refuseProductDrift(entry, rebound);
|
|
224
225
|
return mountedProduct(entry, rebound);
|
|
225
226
|
}
|
|
226
|
-
export function snapshotCallerRoster(
|
|
227
|
+
export function snapshotCallerRoster(handedSpec) {
|
|
228
|
+
const read = readCallerSpec(handedSpec);
|
|
229
|
+
const { spec } = read;
|
|
227
230
|
const tools = spec.tools;
|
|
228
231
|
const descriptors = Object.getOwnPropertyDescriptors(spec);
|
|
229
232
|
const handed = Array.isArray(tools) ? Object.freeze([...tools]) : undefined;
|
|
230
233
|
const slot = handed !== undefined ? Object.freeze(handed.map((t, i) => rosterFaceOf(t, i))) : tools;
|
|
231
234
|
descriptors.tools = { value: slot, enumerable: slot !== undefined, writable: false, configurable: false };
|
|
232
235
|
const copy = Object.create(Object.getPrototypeOf(spec), descriptors);
|
|
233
|
-
return { spec: copy, roster: { caller:
|
|
236
|
+
return { spec: copy, roster: { caller: read.caller, handed: tools === undefined ? Object.freeze([]) : handed }, refusal: read.refusal };
|
|
234
237
|
}
|
|
235
238
|
export function refuseLateRosterChanges(roster) {
|
|
236
239
|
const { handed } = roster;
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* The durable-suspend checkpoint ROW-IDENTITY vocabulary — the default isolation scope, the ONE derivation of a row's
|
|
3
3
|
* scope, and the ONE reading of the placement fields' empty string — moved whole out of the orchestrator so the
|
|
4
4
|
* park-lane phases (the suspend stamp), the driver (the leg's scope, derived once and handed to every mint lane; the
|
|
5
|
-
* restore fold) and runtask (the resume rung) reach DOWN for the same names. Pure: a constant
|
|
5
|
+
* restore fold) and runtask (the resume rung) reach DOWN for the same names. Pure: a constant, two string functions, the
|
|
6
|
+
* composition-leg record's reading (with its entry's closed set) and comparison, and the row id's restore.
|
|
6
7
|
*/
|
|
8
|
+
import type { CompositionLeg, RunInternals } from "./contracts.js";
|
|
7
9
|
/** The multi-tenant scope used when a durable suspend fires for an IRREVERSIBLE tool in an
|
|
8
10
|
* unattended deployment that did NOT opt into `durableApproval` (so there is no caller-supplied scope). The
|
|
9
11
|
* checkpoint carries this scope; resume reads it back from the checkpoint (`cp.scope`), so it is
|
|
@@ -42,3 +44,16 @@ export declare function checkpointScopeOf(spec: {
|
|
|
42
44
|
* loudly on the factory path, and normalizing it away would silently repair what should be loud.
|
|
43
45
|
*/
|
|
44
46
|
export declare function placementValueOrAbsent(value: string | undefined): string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* The ONE reading of a composition leg's identity ({@link CompositionLeg}) — the record its three readers share: the driver
|
|
49
|
+
* resolves the leg's value once at prepare through it (the live member, else the row's), the suspend stamp writes what it
|
|
50
|
+
* resolved, and the resume rung compares a live value with the row's through {@link sameCompositionLeg}. A plain copy of the
|
|
51
|
+
* three members, so what the row records is data the leg's caller cannot rewrite afterwards; absent stays absent. An `entry`
|
|
52
|
+
* outside the closed set is refused here (`config.invalid_argument`, `detail.field`), so no reader takes it and no card records it.
|
|
53
|
+
*/
|
|
54
|
+
export declare function compositionLegRecord(leg: CompositionLeg | undefined): CompositionLeg | undefined;
|
|
55
|
+
/** Whether two composition-leg records name the same leg of the same composition for the same host session. */
|
|
56
|
+
export declare function sameCompositionLeg(a: CompositionLeg, b: CompositionLeg): boolean;
|
|
57
|
+
/** The row a resumed leg runs as ({@link RunInternals.rowTaskId}): the live seat when handed, else the parked row's record —
|
|
58
|
+
* folded into internals so the mint at prepare, the resume screen and the throw backstop read one value. */
|
|
59
|
+
export declare function restoreRowTaskId(internals: RunInternals | undefined, recorded: string | undefined): RunInternals | undefined;
|
|
@@ -5,3 +5,24 @@ export function checkpointScopeOf(spec, seat) {
|
|
|
5
5
|
export function placementValueOrAbsent(value) {
|
|
6
6
|
return value || undefined;
|
|
7
7
|
}
|
|
8
|
+
const COMPOSITION_ENTRIES = { cascade: true, verify: true };
|
|
9
|
+
export function compositionLegRecord(leg) {
|
|
10
|
+
if (leg === undefined)
|
|
11
|
+
return undefined;
|
|
12
|
+
const entry = leg.entry;
|
|
13
|
+
if (typeof entry !== "string" || !Object.hasOwn(COMPOSITION_ENTRIES, entry)) {
|
|
14
|
+
const e = new Error(`compositionLeg.entry must name a composition entry (${Object.keys(COMPOSITION_ENTRIES).join(" / ")}; got ${typeof entry === "string" ? "another word" : typeof entry}) — an identity no entry minted is refused, never recorded on a card.`);
|
|
15
|
+
e.code = "config.invalid_argument";
|
|
16
|
+
e.detail = { field: "compositionLeg.entry" };
|
|
17
|
+
throw e;
|
|
18
|
+
}
|
|
19
|
+
return { entry: entry, leg: leg.leg, hostSessionId: leg.hostSessionId };
|
|
20
|
+
}
|
|
21
|
+
export function sameCompositionLeg(a, b) {
|
|
22
|
+
return a.entry === b.entry && a.leg === b.leg && a.hostSessionId === b.hostSessionId;
|
|
23
|
+
}
|
|
24
|
+
export function restoreRowTaskId(internals, recorded) {
|
|
25
|
+
if (internals?.rowTaskId !== undefined || recorded === undefined)
|
|
26
|
+
return internals;
|
|
27
|
+
return { ...(internals ?? {}), rowTaskId: recorded };
|
|
28
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { convertToLlm, uuidv7 } from "../../internal/harness.js";
|
|
2
2
|
import { compactionFailureReason, compactionPassReport, DEFAULT_COMPACTION_INSTRUCTIONS, isCompactionManualCancel, manualCompactOutcomeOf, maybeCompact, mintCompactedEvent } from "../auto-compaction.js";
|
|
3
3
|
import { contextOverlayFor } from "../context-settings.js";
|
|
4
|
+
import { createRowSeat } from "../mods/session-append.js";
|
|
5
|
+
import { createCompactStation } from "../mods/session-compact.js";
|
|
4
6
|
import { admitLegMods, legFacadeSeats } from "../mods/stations.js";
|
|
5
7
|
import { malformedPricingField } from "../pricing.js";
|
|
6
8
|
import { resolveTaskModel } from "../roles.js";
|
|
@@ -72,11 +74,16 @@ async function compactOnSession(req, deps, session, resolved, named, legMods) {
|
|
|
72
74
|
const branch = await session.getBranch();
|
|
73
75
|
const contextMessages = convertToLlm((await session.buildContext()).messages);
|
|
74
76
|
bindSessionFacade(legMods, { deps, req, model: resolved.model, messages: contextMessages, book });
|
|
77
|
+
const rowSeat = createRowSeat();
|
|
78
|
+
rowSeat.bind({ bus: legMods.bus, identity: undefined, report: legMods.report });
|
|
79
|
+
const compactStation = createCompactStation();
|
|
80
|
+
compactStation.bind({ bus: legMods.bus, identity: undefined, report: legMods.report });
|
|
75
81
|
const overlay = contextOverlayFor(deps.contextSettings, resolved.modelRef, deps);
|
|
76
82
|
const activeTools = compactionActivationSnapshot(branch);
|
|
77
83
|
const thinking = resolved.thinking ?? resolved.model.defaultThinking;
|
|
78
|
-
const comp = await
|
|
84
|
+
const comp = await compactStation.compact({
|
|
79
85
|
session,
|
|
86
|
+
admitRows: rowSeat.admitRows,
|
|
80
87
|
model: resolved.model,
|
|
81
88
|
...(overlay !== undefined ? { contextOverlay: overlay } : {}),
|
|
82
89
|
...(compactionModel !== undefined ? { compactionModel } : {}),
|
|
@@ -93,7 +100,7 @@ async function compactOnSession(req, deps, session, resolved, named, legMods) {
|
|
|
93
100
|
...summaryProviderOptions({ deps }, 0),
|
|
94
101
|
...compactionHookOptions({ deps }, { modBus: legMods.bus, hookIdentity: undefined, sessionId }, "manual", req.signal),
|
|
95
102
|
onStarted: passReport.onStarted,
|
|
96
|
-
});
|
|
103
|
+
}, maybeCompact, req.instructions !== undefined ? { instructions: req.instructions } : undefined);
|
|
97
104
|
const outcome = manualCompactOutcomeOf(comp);
|
|
98
105
|
if (comp.compacted) {
|
|
99
106
|
events.push(mintCompactedEvent(comp, "manual", ident()));
|
|
@@ -131,6 +138,7 @@ function bindSessionFacade(legMods, input) {
|
|
|
131
138
|
sessionId: input.req.sessionId,
|
|
132
139
|
model: input.model,
|
|
133
140
|
executionEnv: { exec: () => unavailable("process.run") },
|
|
141
|
+
readFloor: () => undefined,
|
|
134
142
|
taskRoot: "",
|
|
135
143
|
cwdRef: undefined,
|
|
136
144
|
lastBrainContext: () => ({ messages: input.messages }),
|
|
@@ -138,6 +146,10 @@ function bindSessionFacade(legMods, input) {
|
|
|
138
146
|
agentListing: undefined,
|
|
139
147
|
book: (answeredBy, reply) => input.book("mod", answeredBy, reply),
|
|
140
148
|
toolCall: () => unavailable("tool.call"),
|
|
149
|
+
agentSpawn: () => unavailable("agent.spawn"),
|
|
150
|
+
sessionAppend: () => unavailable("session.append"),
|
|
151
|
+
sessionSend: () => unavailable("session.send"),
|
|
152
|
+
sessionCompact: () => unavailable("session.compact"),
|
|
141
153
|
});
|
|
142
154
|
legMods.bindFacade({
|
|
143
155
|
...seats,
|
|
@@ -140,7 +140,7 @@ writtenRefs: Set<string>): Promise<Context>;
|
|
|
140
140
|
/**
|
|
141
141
|
* MF-18 修② — fidelity disclosure: the summary INPUT was clipped to the compaction model's
|
|
142
142
|
* window. Fires pre-call, so the disclosure survives a failed attempt. All three lanes emit the SAME
|
|
143
|
-
* frame; the end-of-task lane passes `spec.tracer ?? deps.tracer` /
|
|
143
|
+
* frame; the end-of-task lane passes `spec.tracer ?? deps.tracer` / the leg's minted task id
|
|
144
144
|
* explicitly because `RunState.telemetry` (which holds exactly those two resolved values) is not in
|
|
145
145
|
* scope inside `finish()`.
|
|
146
146
|
*/
|
|
@@ -35,7 +35,7 @@ export declare function postureRestateOption(prepared: Prepared): Pick<MaybeComp
|
|
|
35
35
|
* of every engine frame written at a boundary, the git frame's re-assert and the compaction itself: the run continues
|
|
36
36
|
* and the failure is reported, `onError` phase `degraded`). Never throws.
|
|
37
37
|
*/
|
|
38
|
-
export declare function appendOwedPosture(prepared: Pick<Prepared, "approvalPosture" | "toolRoster" | "hookIdentity" | "advertisedWritableDirs" | "session" | "reminderMark" | "postureFrameRef" | "batchHaltRef" | "frameReceipts">, ask: "always" | "on_change"): Promise<void>;
|
|
38
|
+
export declare function appendOwedPosture(prepared: Pick<Prepared, "approvalPosture" | "toolRoster" | "hookIdentity" | "advertisedWritableDirs" | "session" | "admitRows" | "reminderMark" | "postureFrameRef" | "batchHaltRef" | "frameReceipts">, ask: "always" | "on_change"): Promise<void>;
|
|
39
39
|
/** The declared output style's frame as one engine-marked reminder — the one spelling every site that states it directly
|
|
40
40
|
* (a resumed leg's continuation, a boundary a queued input continues) mints. */
|
|
41
41
|
export declare function mintOutputStyleReminder(prepared: Pick<Prepared, "outputStyleFrame" | "reminderMark">): string | undefined;
|
|
@@ -49,7 +49,7 @@ export declare function frameCarried(ledger: Prepared["frameReceipts"], source:
|
|
|
49
49
|
* carries it ({@link frameCarried}). Both frames keep the posture's halt rule. The guarantee is read synchronously, at
|
|
50
50
|
* the call, before any await — a boundary with nothing queued returns the posture's own promise.
|
|
51
51
|
*/
|
|
52
|
-
export declare function appendBoundaryFrames(prepared: Pick<Prepared, "approvalPosture" | "toolRoster" | "hookIdentity" | "advertisedWritableDirs" | "session" | "reminderMark" | "postureFrameRef" | "batchHaltRef" | "outputStyleFrame" | "harness" | "frameReceipts">, turnOwesRequest: boolean): Promise<void>;
|
|
52
|
+
export declare function appendBoundaryFrames(prepared: Pick<Prepared, "approvalPosture" | "toolRoster" | "hookIdentity" | "advertisedWritableDirs" | "session" | "admitRows" | "reminderMark" | "postureFrameRef" | "batchHaltRef" | "outputStyleFrame" | "harness" | "frameReceipts">, turnOwesRequest: boolean): Promise<void>;
|
|
53
53
|
/**
|
|
54
54
|
* The session plan file's post-compaction reference (the reference's `plan_file_reference`, CC 2.1.309 `Tmr` (cli309.js:265943)): a compaction
|
|
55
55
|
* summarizes away the turns that wrote the plan, so a leg whose run admitted a plan file that holds a plan is told where
|
|
@@ -6,6 +6,7 @@ import { thrownText } from "../thrown-value.js";
|
|
|
6
6
|
import { rosterEntryNamed } from "../tool-roster.js";
|
|
7
7
|
import { delimitUntrusted, sanitizeUntrustedText } from "../untrusted-text.js";
|
|
8
8
|
import { appendAdvisorRestate } from "./advisor-instructions.js";
|
|
9
|
+
import { appendAdmittedRow } from "../row-admission.js";
|
|
9
10
|
import { gitRestateOption } from "./git-leg-delivery.js";
|
|
10
11
|
import { attachmentEnvelopeTags } from "./turn-attachments.js";
|
|
11
12
|
export function postureFactsOf(prepared) {
|
|
@@ -63,7 +64,7 @@ export async function appendOwedPosture(prepared, ask) {
|
|
|
63
64
|
if (prepared.batchHaltRef.current !== undefined)
|
|
64
65
|
return unwritten();
|
|
65
66
|
try {
|
|
66
|
-
await prepared.session
|
|
67
|
+
await appendAdmittedRow(prepared.admitRows, prepared.session, { role: "user", content: [{ type: "text", text }], timestamp: Date.now(), engineMinted: true });
|
|
67
68
|
ref.unwritten = undefined;
|
|
68
69
|
}
|
|
69
70
|
catch (err) {
|
|
@@ -83,7 +84,7 @@ async function appendOutputStyleRestate(prepared) {
|
|
|
83
84
|
if (text === undefined)
|
|
84
85
|
return;
|
|
85
86
|
try {
|
|
86
|
-
await prepared.session
|
|
87
|
+
await appendAdmittedRow(prepared.admitRows, prepared.session, { role: "user", content: [{ type: "text", text }], timestamp: Date.now(), engineMinted: true });
|
|
87
88
|
}
|
|
88
89
|
catch (err) {
|
|
89
90
|
try {
|
|
@@ -113,7 +114,7 @@ export function planFileRestateOption(prepared) {
|
|
|
113
114
|
return;
|
|
114
115
|
const body = `A plan file exists from plan mode at: ${planFileShown(planFile.spelled)}\n\nPlan contents:\n\n${delimitUntrusted("plan", read.text)}\n\nIf this plan is relevant to the current work and not already complete, continue working on it.`;
|
|
115
116
|
try {
|
|
116
|
-
await prepared.session
|
|
117
|
+
await appendAdmittedRow(prepared.admitRows, prepared.session, { role: "user", content: [{ type: "text", text: mintSystemReminder(body, prepared.reminderMark) }], timestamp: Date.now(), engineMinted: true });
|
|
117
118
|
}
|
|
118
119
|
catch (err) {
|
|
119
120
|
try {
|
|
@@ -6,6 +6,6 @@ import type { RunnerDeps } from "../types.js";
|
|
|
6
6
|
* would supply is never read, so an object with another prototype is refused rather than wired without that seat. The seats
|
|
7
7
|
* whose VALUE is screened at construction and never again are judged on the copy: the declared configuration root must be the
|
|
8
8
|
* absolute path of an existing directory — a root that names no directory guards nothing, so it is refused rather than read as
|
|
9
|
-
* absent; the media budget must be
|
|
10
|
-
* the request
|
|
9
|
+
* absent; the request media budget must be one the trim can keep media under — a bad value is refused rather than read as a
|
|
10
|
+
* default or as "no budget" by the request trim and the `tool_end.output` projection. */
|
|
11
11
|
export declare function retainRunnerDeps(deps: RunnerDeps): RunnerDeps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { checkedAgentConfigDir } from "../agent-config-dir.js";
|
|
2
|
-
import {
|
|
2
|
+
import { checkedRequestMediaBudget } from "../image-admission.js";
|
|
3
3
|
import { checkedImageProcessorSeat } from "../image-downsample.js";
|
|
4
4
|
import { receiptRefusal, receiveOwnProperties, refuseProxy } from "../own-property-receipt.js";
|
|
5
5
|
import { assertNoRetiredRunnerDeps } from "./retired-runner-deps.js";
|
|
@@ -13,7 +13,7 @@ export function retainRunnerDeps(deps) {
|
|
|
13
13
|
assertNoRetiredRunnerDeps(deps);
|
|
14
14
|
const retained = receiveOwnProperties(deps, words);
|
|
15
15
|
checkedAgentConfigDir(retained.agentConfigDir, "RunnerDeps.agentConfigDir");
|
|
16
|
-
|
|
16
|
+
checkedRequestMediaBudget(retained.mediaBudgetBase64Chars, "RunnerDeps.mediaBudgetBase64Chars");
|
|
17
17
|
checkedImageProcessorSeat(retained.imageProcessor, "RunnerDeps.imageProcessor");
|
|
18
18
|
for (const seat of READ_DENY_DEPLOYMENT_SEATS) {
|
|
19
19
|
if (Object.hasOwn(retained, seat))
|
|
@@ -17,7 +17,7 @@ import type { HumanReviewGateRow } from "../task-result.js";
|
|
|
17
17
|
import type { RepairBundle } from "../../agents/repair-loop.js";
|
|
18
18
|
import type { SubagentRetainLedger } from "../../agents/retain-ledger.js";
|
|
19
19
|
import type { BrainCallGuardrailRef } from "../../brain/timeout.js";
|
|
20
|
-
import type { ActiveWorktreeSession, AgentHarness, AgentMessage, AgentTool, AnnouncedListingSnapshotInput, ExecutionEnv, ThinkingLevel } from "../../internal/harness.js";
|
|
20
|
+
import type { ActiveWorktreeSession, AgentHarness, AgentMessage, AgentTool, AnnouncedListingSnapshotInput, ExecutionEnv, LoopTerminalReason, RowAdmission, ThinkingLevel } from "../../internal/harness.js";
|
|
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";
|
|
@@ -52,7 +52,7 @@ import type { ModelPricing } from "../pricing.js";
|
|
|
52
52
|
import type { PushQueue } from "../push-queue.js";
|
|
53
53
|
import type { SystemInjectionPriority, TaskNotificationPayload } from "../task-notification.js";
|
|
54
54
|
import type { OnAsk, PermissionResult, ResolvedAsk, ToolCallRequest, ToolPolicy } from "../tool-policy.js";
|
|
55
|
-
import type { RemoteExecutionEnv, SnapshotId, WorkspaceHandle } from "../remote-env.js";
|
|
55
|
+
import type { PlacementTarget, RemoteExecutionEnv, SnapshotId, WorkspaceHandle } from "../remote-env.js";
|
|
56
56
|
import type { ToolDisclosureManifest } from "../trace.js";
|
|
57
57
|
import type { AgentDefinition, Brain, CompactOutcome, ModelRef, ModelRoles, NestedUsageAccum, PermissionMode, RunnerDeps, ShellGateDoctrine, TaskEvent, TaskEventIdentity, TaskResult, TaskSpec, TaskStream, ToolActivity, ToolEffect } from "../types.js";
|
|
58
58
|
import type { InheritedAutoModeFace, PermissionModeController } from "../mode-policy.js";
|
|
@@ -271,6 +271,9 @@ export interface Prepared {
|
|
|
271
271
|
* the `Session` contract instead. */
|
|
272
272
|
session: StoredSession;
|
|
273
273
|
sessionId: string;
|
|
274
|
+
/** This leg's task id, minted ONCE at prepare ({@link import("../leg-identity.js").legTaskIdOf}): its identity, frames, events'
|
|
275
|
+
* `sourceTaskId`, trace frames and `TaskResult.taskId` read it here; none re-spells it. */
|
|
276
|
+
taskId: string;
|
|
274
277
|
/**
|
|
275
278
|
* THIS INVOCATION's own identity, minted once at the top of {@link prepareTask} and never
|
|
276
279
|
* rewritten. The third id of the trio, and the only one the engine owns outright:
|
|
@@ -278,7 +281,7 @@ export interface Prepared {
|
|
|
278
281
|
* - `sessionId` — the CONVERSATION's identity (shared by every run that continues it);
|
|
279
282
|
* - `runId` — THIS call of the engine.
|
|
280
283
|
*
|
|
281
|
-
* The gap it closes: the
|
|
284
|
+
* The gap it closes: the leg's task id ({@link taskId}) answers the same value for
|
|
282
285
|
* two runs of one session whenever the host supplies no task id, so every per-run account keyed on
|
|
283
286
|
* it FOLDED two runs into one row (two runs each losing one steer read as one run losing one).
|
|
284
287
|
* A per-run account must key on this; a per-TASK fact (trace `taskId`, the host's own correlation
|
|
@@ -293,7 +296,7 @@ export interface Prepared {
|
|
|
293
296
|
runId: string;
|
|
294
297
|
/** The deployment's host floor as the config doors compiled it (absent ⇒ none declared) — the task images' guard reads it. */
|
|
295
298
|
hostFloor?: import("../host-floor.js").HostFloor;
|
|
296
|
-
/** The (owner, scope) key this run's registry-facing tools register rows under — (
|
|
299
|
+
/** The (owner, scope) key this run's registry-facing tools register rows under — ({@link taskId}, mount domain), minted once at prepare; the teardown sweeps read it and never re-derive it. */
|
|
297
300
|
registryAccess: {
|
|
298
301
|
readonly owner: string;
|
|
299
302
|
readonly scope: string;
|
|
@@ -363,8 +366,10 @@ export interface Prepared {
|
|
|
363
366
|
*/
|
|
364
367
|
toolOccurrences: import("./tool-occurrence.js").ToolOccurrenceTable;
|
|
365
368
|
/**
|
|
366
|
-
* The parent-thread human-rejection halt fact (see `
|
|
367
|
-
* moment a bare human rejection halts the turn's batch
|
|
369
|
+
* The parent-thread human-rejection halt fact (see `isBareHumanRefusal`): present from the
|
|
370
|
+
* moment a bare human rejection halts the turn's batch — or a resumed leg records one (a parked call's, a plan
|
|
371
|
+
* pause's; `rejectedToolCallId` then names the gated call, or the call that asked for the plan pause when the row
|
|
372
|
+
* recorded one) — until the run ends or the NEXT provider
|
|
368
373
|
* request begins (user input continuing the run clears it). Consumers: the runner's stop gate
|
|
369
374
|
* (suppress natural-end pushback / final-verify injection — engine continuations must not restart
|
|
370
375
|
* a run a person just stopped), the turn-boundary engine steers (same reason), and the result
|
|
@@ -373,7 +378,7 @@ export interface Prepared {
|
|
|
373
378
|
*/
|
|
374
379
|
batchHaltRef: {
|
|
375
380
|
current?: {
|
|
376
|
-
rejectedToolCallId
|
|
381
|
+
rejectedToolCallId?: string;
|
|
377
382
|
};
|
|
378
383
|
};
|
|
379
384
|
/** Summed usage of nested sub-runs (sub-agents) spawned by this task's tools. */
|
|
@@ -406,6 +411,9 @@ export interface Prepared {
|
|
|
406
411
|
* states are their own values); the seat is optional only so a Prepared shape without the phase
|
|
407
412
|
* cannot fabricate one. */
|
|
408
413
|
effectiveMemoryScopes?: import("../types.js").EffectiveMemoryScopes;
|
|
414
|
+
/** The leg's placement fixed point as prepare resolved it ONCE — the value the env-factory ctx was minted with and the suspend
|
|
415
|
+
* stamp records — echoed on `TaskResult.placementRoot`. Absent when the resolution came out empty (`""` is absence). */
|
|
416
|
+
placementRoot?: string;
|
|
409
417
|
/** The per-task logical cwd ref when a real shell is mounted (else undefined); the workspace frame reads it. */
|
|
410
418
|
cwdRef?: CwdRef;
|
|
411
419
|
/** The leg's `workspace_changed` seat (its one snapshot projection): the run binds the sink after `wiring_manifest` (the leg-start frame) and observes after each tool. */
|
|
@@ -547,6 +555,19 @@ export interface Prepared {
|
|
|
547
555
|
hookIdentity: HookInvocationIdentity;
|
|
548
556
|
/** 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[]`. */
|
|
549
557
|
modBus: ModBus;
|
|
558
|
+
/** The leg's one admission seat (`session-append.ts`): a direct writer passes each row through it first (`appendAdmittedRow`). */
|
|
559
|
+
admitRows: RowAdmission;
|
|
560
|
+
/** The leg's one receiving station (`session-receive.ts`): the live lane, the turn-open redelivery and the box drain's pull
|
|
561
|
+
* hand every frame to it before the model reads it. */
|
|
562
|
+
receiveSeat: import("../task-notification.js").FrameReceiver;
|
|
563
|
+
/** The turn-open redelivery's hand-over while the receiving station judges it (set only when a handler listens and frames
|
|
564
|
+
* were parked): the leg's prompt waits on it, so what the station hands over is in the first model call. */
|
|
565
|
+
turnOpenRedelivery: {
|
|
566
|
+
current?: Promise<void>;
|
|
567
|
+
};
|
|
568
|
+
/** The leg's `session.compact` station and its `$.session.compact` window (`session-compact.ts`): every compaction lane runs
|
|
569
|
+
* its pass through it. */
|
|
570
|
+
compactStation: import("../mods/session-compact.js").CompactStation;
|
|
550
571
|
/**
|
|
551
572
|
* This session's DURABLE box, present iff this leg mounted the session-box drain (a top-level leg
|
|
552
573
|
* over a cross-process-safe mailbox with a grammatical session id). The notification lane binds it
|
|
@@ -863,6 +884,11 @@ export interface Prepared {
|
|
|
863
884
|
continuation: boolean;
|
|
864
885
|
abortedBeforeTurnEnd: boolean;
|
|
865
886
|
};
|
|
887
|
+
/** The word the loop's exit named (its terminal trace step; absent until it exits), read by the terminal arbitration
|
|
888
|
+
* (`ResultFlags.loopTerminal`) for the exits the final message cannot state. Always present. */
|
|
889
|
+
loopTerminalRef: {
|
|
890
|
+
reason?: LoopTerminalReason;
|
|
891
|
+
};
|
|
866
892
|
/** Records the FIRST brain call this run's outer guardrail gave up on (see
|
|
867
893
|
* {@link import("../../brain/timeout.js").withBrainCallGuardrail}). Always present; `timedOut`
|
|
868
894
|
* stays absent unless the guardrail fired. The run loop reads it AFTER the loop settles and gives
|
|
@@ -959,7 +985,7 @@ export interface Prepared {
|
|
|
959
985
|
* · protocol-tools — pushes the MCP tools (through the remote wrapper), RefreshMcpTools (servers declared),
|
|
960
986
|
* the A2A tools; at RUN time its refresh closure splices a server's name-prefix domain out and back in;
|
|
961
987
|
* · hands mount — pushes the hands band (env wired);
|
|
962
|
-
* · delegation-surface — pushes
|
|
988
|
+
* · delegation-surface — pushes TaskStop (background ∨ workflow door), SendMessage (door ∨
|
|
963
989
|
* parentNotify ∨ peer lane, ∧ runner self ∧ no shadow), AgentTranscript (door ∧ runner self ∧ no shadow),
|
|
964
990
|
* ListAgents (peer lane ∧ built-in SendMessage ∧ mountable), Monitor (background), EnterWorktree +
|
|
965
991
|
* ExitWorktree (tracked cwd), ReadToolResult (offload store);
|
|
@@ -1314,6 +1340,9 @@ export interface PrepareResume {
|
|
|
1314
1340
|
/** The session leaf to rewind to (the suspension point) BEFORE reconcile — discards the abort's
|
|
1315
1341
|
* off-branch "Operation aborted" writes so the resume engine resolves the pending batch cleanly. */
|
|
1316
1342
|
leafId: string;
|
|
1343
|
+
/** The session rows the parked leg's port held past that leaf (`Checkpoint.heldRows`): the resumed harness's queue starts with
|
|
1344
|
+
* them and writes them at the transcript's first legal point. Absent ⇒ the park held none. */
|
|
1345
|
+
heldRows?: readonly AgentMessage[];
|
|
1317
1346
|
/** Batch tool-call ids of the suspended turn — wake-reconcile SKIPS these (they are resumed, not
|
|
1318
1347
|
* crash-interrupted; closing them with `[INTERRUPTED]` would DESTROY the suspended batch, §15.2 #7). */
|
|
1319
1348
|
suspendedBatch: ReadonlySet<string>;
|
|
@@ -1642,8 +1671,8 @@ export interface RunInternals {
|
|
|
1642
1671
|
* releases the lease when its materialization is disposed — see `mcp-connection-pool.ts`. Trusted, never a TaskSpec field.
|
|
1643
1672
|
*/
|
|
1644
1673
|
mcpPool?: import("../mcp-connection-pool.js").McpConnectionPool;
|
|
1645
|
-
/** This leg's host seats by declaration name: a `{ kind: "host" }` server of `TaskSpec.mcp` / `ResumeTaskConfig.mcp` dials through
|
|
1646
|
-
* seat (mcp-host-seat.ts); a declaration with no seat fails its dial (`config.mcp_host_seat_missing`), a seat with no declaration is
|
|
1674
|
+
/** This leg's host seats by declaration name: a `{ kind: "host" }` server of `TaskSpec.mcp` / `ResumeTaskConfig.mcp` dials through the
|
|
1675
|
+
* pipe its seat opens for each dial (mcp-host-seat.ts; a request-level seat rides `hostSeatOfRequests`); a declaration with no seat fails its dial (`config.mcp_host_seat_missing`), a seat with no declaration is
|
|
1647
1676
|
* announced once (`config.mcp_host_seat_undeclared`). The leg's own: a delegated child is handed the seats of the host servers it
|
|
1648
1677
|
* is declared (inherited or its definition's own), a retained child's snapshot keeps none (its waker's seats ride each wake). Trusted, never a TaskSpec field. */
|
|
1649
1678
|
mcpHostSeats?: ReadonlyMap<string, import("../mcp-host-seat.js").McpHostSeat>;
|
|
@@ -1852,10 +1881,10 @@ export interface RunInternals {
|
|
|
1852
1881
|
* mirroring `insideFork`.
|
|
1853
1882
|
*/
|
|
1854
1883
|
isDelegatedChild?: boolean;
|
|
1855
|
-
/**
|
|
1856
|
-
*
|
|
1857
|
-
*
|
|
1858
|
-
|
|
1884
|
+
/** Who wrote this leg's objective ({@link import("../input-author.js").InputAuthor}), stated by the seat that mints it; absent = the public
|
|
1885
|
+
* entry's caller, `operator`. Only the operator's objective passes `classic.UserPromptSubmit`; a non-member reads `unknown`, is screened and
|
|
1886
|
+
* reported once (`onError`, `"config"`). Never inherited — each seat says its own. TRUSTED run-scoped channel (NOT a {@link TaskSpec} field). */
|
|
1887
|
+
objectiveAuthor?: import("../input-author.js").InputAuthor;
|
|
1859
1888
|
/**
|
|
1860
1889
|
* Subagent transcript persistence — the child transcript session's PLACEMENT declaration, minted
|
|
1861
1890
|
* by the background delegation lane (the trusted spawner: it knows the a* handle, scope and root)
|
|
@@ -1913,7 +1942,7 @@ export interface RunInternals {
|
|
|
1913
1942
|
*/
|
|
1914
1943
|
inheritedSkillGrants?: readonly SkillGrantRecord[];
|
|
1915
1944
|
/** The parent's request allow entries at the spawn (`ctx.activeRequestAllowedTools()`), seeded as this child's own request rows until it ends — the channel of {@link inheritedSkillGrants}. */
|
|
1916
|
-
inheritedAllowedTools?: readonly
|
|
1945
|
+
inheritedAllowedTools?: readonly import("../allow-entry.js").AllowListEntry[];
|
|
1917
1946
|
/**
|
|
1918
1947
|
* When this task runs as a SUB-AGENT spawned under a parent task's
|
|
1919
1948
|
* tool call, the spawning tool's `ToolExecuteContext.toolCallId`. The Runner stamps it onto this task's
|
|
@@ -1961,6 +1990,10 @@ export interface RunInternals {
|
|
|
1961
1990
|
/** The spawning run's sessionId (paired with parentTaskId; see
|
|
1962
1991
|
* ToolExecuteContext.parentSessionId). */
|
|
1963
1992
|
parentSessionId?: string;
|
|
1993
|
+
/** The registry row this leg runs as (a background child's `a…` handle, the id `TaskStop` / `SendMessage` take), which the leg's
|
|
1994
|
+
* one task-id mint reads first. Set by the background lanes (plain, fork, retained snapshot); absent on a top-level run, a
|
|
1995
|
+
* synchronous child and a workflow agent. Stamped as `CheckpointState.rowTaskId`. Trusted seat, NOT a {@link TaskSpec} field. */
|
|
1996
|
+
rowTaskId?: string;
|
|
1964
1997
|
/**
|
|
1965
1998
|
* The memory-capture opt-out FLOOR: TRUE ⇔ the spawning session was under an
|
|
1966
1999
|
* opt-out when this child spawned. The child then runs opted-out itself (its prepare mints its
|
|
@@ -2045,9 +2078,27 @@ export interface RunInternals {
|
|
|
2045
2078
|
* `resume.placement_mismatch`). TRUSTED run-scoped channel (never a {@link TaskSpec} field).
|
|
2046
2079
|
*/
|
|
2047
2080
|
placementRoot?: string;
|
|
2081
|
+
/** The placement FENCE this leg is minted under: the target of the leg that hands it work (a spawner, a waker, a composition's
|
|
2082
|
+
* first leg), folded at the mint into {@link import("../remote-env.js").ExecutionEnvFactoryContext.placementTarget} — whose
|
|
2083
|
+
* contract lists every producer; one hop, re-read at every leg (unlike the tree's fixed point {@link placementRoot}). An
|
|
2084
|
+
* unreadable value is refused at the mint (`config.placement_not_honored`). TRUSTED run-scoped channel (never a {@link TaskSpec} field). */
|
|
2085
|
+
placementTarget?: PlacementTarget;
|
|
2086
|
+
/**
|
|
2087
|
+
* Which composition this leg is a leg of, and whose run it belongs to ({@link CompositionLeg}): minted ONLY by a composition
|
|
2088
|
+
* entry when it hands the leg out (`runCascade` / `resumeCascade` for each rung, the verification gate for each verifier leg),
|
|
2089
|
+
* never by the engine. The suspend mint stamps it on the row as `CheckpointState.compositionLeg`, so a card a leg parks says
|
|
2090
|
+
* itself which leg of which composition it is and which host session it belongs to; one value, read ONCE at prepare (the live
|
|
2091
|
+
* member, else the row's; an `entry` outside the closed set is refused there, `config.invalid_argument`). On a resume the same rule as the
|
|
2092
|
+
* placement fixed point: a live value wins, a live value that CONTRADICTS the row's is refused pre-CAS
|
|
2093
|
+
* (`resume.composition_mismatch`, the row stays pending), an absent one is restored from the row — and a live value over a row
|
|
2094
|
+
* that records none (a card minted before the member, or by a leg nobody labelled) is that row's first record, never refused.
|
|
2095
|
+
* Not threaded to the leg's children: a child is not a rung, its card is filed by its own lane. TRUSTED run-scoped channel
|
|
2096
|
+
* (never a {@link TaskSpec} field).
|
|
2097
|
+
*/
|
|
2098
|
+
compositionLeg?: CompositionLeg;
|
|
2048
2099
|
/**
|
|
2049
2100
|
* The REGISTRY SCOPE this run's own background row lives in: the domain its registry-facing
|
|
2050
|
-
* tools (
|
|
2101
|
+
* tools (TaskStop / SendMessage / AgentTranscript / Monitor, and the announce listing)
|
|
2051
2102
|
* must mount in to see it. Filled by the delegation tool at spawn, which is the party that CHOSE the
|
|
2052
2103
|
* domain when it registered the row — `ctx.principal` when the spawning run has one, else the
|
|
2053
2104
|
* delegation mount's declared `background.scope`, and on a revival the claimed row's own scope.
|
|
@@ -2265,7 +2316,7 @@ export interface RunInternals {
|
|
|
2265
2316
|
* the tool ctx as {@link ToolExecuteContext.onSubagentSpawn} and recursively down the delegation
|
|
2266
2317
|
* tree. Absent ⇒ children run non-steerable (prior behavior, zero overhead).
|
|
2267
2318
|
* SCOPE: only SYNC delegations emit a handle — a
|
|
2268
|
-
* `run_in_background` child does not (
|
|
2319
|
+
* `run_in_background` child does not (its completion notification carries the result; TaskStop stops it); wiring the background
|
|
2269
2320
|
* lane is a recorded follow-up, not an oversight a deployment should discover at runtime.
|
|
2270
2321
|
*/
|
|
2271
2322
|
onSubagentSpawn?: (handle: import("../../agents/subagent.js").SubagentSteerHandle) => void;
|
|
@@ -2374,6 +2425,8 @@ export interface ResolvedWorkspace {
|
|
|
2374
2425
|
/** Where a delegated child's environment placed it against where its caller asked; absent on a leg no delegation
|
|
2375
2426
|
* caller placed. */
|
|
2376
2427
|
placement?: ChildPlacement;
|
|
2428
|
+
/** The target this leg's env reported as it settled — the fence of every leg it hands work to; absent when it reported none. */
|
|
2429
|
+
target?: PlacementTarget;
|
|
2377
2430
|
}
|
|
2378
2431
|
/**
|
|
2379
2432
|
* The resolver's answer, with the WITHHELD cause beside the value.
|
|
@@ -2634,6 +2687,29 @@ export interface RunState {
|
|
|
2634
2687
|
* objective's attachments nor the objective's run origin (a config that carries `userAttachments` or `runOrigin` anyway is
|
|
2635
2688
|
* refused before the claim; a wake states its leg's word on the input it hands over). */
|
|
2636
2689
|
export type ResumeTaskConfig = Omit<TaskSpec, "objective" | "sessionId" | "userAttachments" | "runOrigin">;
|
|
2690
|
+
/**
|
|
2691
|
+
* A composition leg's identity ({@link RunInternals.compositionLeg}, `CheckpointState.compositionLeg`): which entry handed the
|
|
2692
|
+
* leg out, which leg of it this is, and the host session the composition runs for. One member per entry; `entry` is a closed
|
|
2693
|
+
* set, and a word outside it is refused wherever the identity is read (`config.invalid_argument`), never stamped on a card.
|
|
2694
|
+
* · `entry: "cascade"` — `leg` is the ladder rung's index (0-based); `hostSessionId` is the caller's `TaskSpec.sessionId`,
|
|
2695
|
+
* the session a host files the composition's run under. A rung runs in its OWN session (the card's `sessionId`), so a host
|
|
2696
|
+
* links a rung's card back to its run by `hostSessionId`, never by the card's session. A cascade whose caller named no
|
|
2697
|
+
* session mints none: that rung's card cannot be linked by composition.
|
|
2698
|
+
* · `entry: "verify"` — the verification gate's VERIFIER leg (`verifyCompleted` and every entry built on it): `leg` is the
|
|
2699
|
+
* verification iteration (1-based, the number `onRound` reports); `hostSessionId` is the implementation's session (the result
|
|
2700
|
+
* the gate verifies, which every fix leg continues). Only the verifier leg is handed one — a fix leg continues the
|
|
2701
|
+
* implementation session itself, so its card already sits in the host's session. A verifier runs in a session the gate
|
|
2702
|
+
* minted, so its card is one no resume of the host's own run reaches: a host reads this entry to tell it from a card it
|
|
2703
|
+
* can decide, and settles it by its token — `runner.resume`, or `Runner.voidVerifierPause` to void it and unpin the
|
|
2704
|
+
* verifier session. An implementation result with no session id mints none.
|
|
2705
|
+
* Three identities beside each other on one card, never merged: the card's `sessionId` (what a resume continues),
|
|
2706
|
+
* `placementRootSessionId` (where the work is placed), and this (whose run it is, and which leg).
|
|
2707
|
+
*/
|
|
2708
|
+
export type CompositionLeg = {
|
|
2709
|
+
readonly entry: "cascade" | "verify";
|
|
2710
|
+
readonly leg: number;
|
|
2711
|
+
readonly hostSessionId: string;
|
|
2712
|
+
};
|
|
2637
2713
|
/** Resume plan threaded from {@link Runner.resume} into the shared run loop. */
|
|
2638
2714
|
export interface ResumeRun {
|
|
2639
2715
|
cp: Checkpoint;
|
|
@@ -2734,14 +2810,7 @@ export interface TurnBoundaryDeps {
|
|
|
2734
2810
|
readonly userHalted: boolean;
|
|
2735
2811
|
readonly callerStop: import("./caller-stop-gate.js").CallerStopGate;
|
|
2736
2812
|
};
|
|
2737
|
-
manualCompactRef:
|
|
2738
|
-
requested: boolean;
|
|
2739
|
-
waiters: Array<{
|
|
2740
|
-
resolve: (outcome: CompactOutcome) => void;
|
|
2741
|
-
signal?: AbortSignal;
|
|
2742
|
-
instructions?: string;
|
|
2743
|
-
}>;
|
|
2744
|
-
};
|
|
2813
|
+
manualCompactRef: Pick<ManualCompactRef, "requested" | "waiters">;
|
|
2745
2814
|
todoToolMounted: boolean;
|
|
2746
2815
|
taskToolsMounted: boolean;
|
|
2747
2816
|
walltimeMonotonicDeadline: number | undefined;
|
|
@@ -2823,7 +2892,7 @@ export interface HarnessHandlersDeps {
|
|
|
2823
2892
|
onError: RunnerDeps["onError"];
|
|
2824
2893
|
onNotice: RunnerDeps["onNotice"];
|
|
2825
2894
|
};
|
|
2826
|
-
|
|
2895
|
+
mediaBudgetBase64Chars: RunnerDeps["mediaBudgetBase64Chars"];
|
|
2827
2896
|
/** The run's ONE isolation scope for the {@link RunInternals} observation sinks, minted by the
|
|
2828
2897
|
* identity-wiring lane (which calls the first of them) and shared with these handlers, so the
|
|
2829
2898
|
* "first failure per site" disclosure is one account for the whole run rather than one per lane. */
|
|
@@ -2962,10 +3031,13 @@ export interface TaskIdRef {
|
|
|
2962
3031
|
* gate the run-end backstop closes before its final drain. */
|
|
2963
3032
|
export interface ManualCompactRef {
|
|
2964
3033
|
requested: boolean;
|
|
3034
|
+
/** `requestedBy`: the extension a `$.session.compact` request came from (absent on a host `compact()` request) — the
|
|
3035
|
+
* pass that claims it carries it on the frame that ends it. */
|
|
2965
3036
|
waiters: Array<{
|
|
2966
3037
|
resolve: (outcome: CompactOutcome) => void;
|
|
2967
3038
|
signal?: AbortSignal;
|
|
2968
3039
|
instructions?: string;
|
|
3040
|
+
requestedBy?: import("../task-event.js").ExtensionRequester;
|
|
2969
3041
|
}>;
|
|
2970
3042
|
emitMooted?: (reason: string) => void;
|
|
2971
3043
|
closed?: boolean;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* put, when the leg settles) also when conversation content follows the newest record. A write that fails refuses its call (or its
|
|
12
12
|
* row) on a governed tree; a prepare's or a settle's, and any write on a tree that is not governed, mints
|
|
13
13
|
* `config.cross_boundary_record_unwritten`, once per state. A record says how the content before it is READ: a leg's end record also
|
|
14
|
-
* carries what the session is still owed — each unfinished background task the leg's
|
|
14
|
+
* carries what the session is still owed — each unfinished background task the leg's task access reaches, judged as the poll the
|
|
15
15
|
* session's next leg (another tree) would make of it, so its delivery is read under the bit it brings. A leg that takes over a
|
|
16
16
|
* session whose content no record covers (none on the branch, or after the newest), on an armed tree, reads that content as
|
|
17
17
|
* off-target.
|
|
@@ -94,7 +94,7 @@ export interface DecideVerdict {
|
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* Read and judge the host's decision facts — the ONE validation for every durable decide. `raw` is the caller's
|
|
97
|
-
* `hostDecision`, read ONCE by the lane (this function reads `decidedBy` and `
|
|
97
|
+
* `hostDecision`, read ONCE by the lane (this function reads `decidedBy`, `approver` and `decidedVia` once each, off it).
|
|
98
98
|
* - the facts are REQUIRED: absence (or a non-object) is refused — absence is not a fact about the wait, and core
|
|
99
99
|
* does not guess one;
|
|
100
100
|
* - `decidedBy` is a member of the closed set ({@link isHostDecider}); the sweep's word is the host's SLA sweep and
|
|
@@ -102,7 +102,9 @@ export interface DecideVerdict {
|
|
|
102
102
|
* the word would file a record of an event that row's contract says cannot happen;
|
|
103
103
|
* - WHO MAY ALLOW the row: not the sweep's word (a wait nobody answered), and not the policy on a row that demands a
|
|
104
104
|
* person (`policyCannotAnswer`, the synchronous seat's rule);
|
|
105
|
-
* - the attribution passes the shared screen (a bounded plain string) — refused rather than dropped
|
|
105
|
+
* - the attribution passes the shared screen (a bounded plain string) — refused rather than dropped;
|
|
106
|
+
* - `decidedVia`, when present, is a member of its closed set beside `decidedBy: "policy"` ({@link screenDecidedVia}, the
|
|
107
|
+
* synchronous seam's screen); a plan pause takes it under the same screen and its reminder reads `decidedBy` alone.
|
|
106
108
|
*/
|
|
107
109
|
export declare function captureHostDecision(cp: Checkpoint, raw: unknown, lane: DecideLane, verdict: DecideVerdict): HostDecisionFacts;
|
|
108
110
|
/** The origin word of the ask a pending row holds: a tool approval's was stamped on the park by the gate; a plan
|