@sema-agent/core 7.60.0 → 7.62.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 +917 -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 +71 -12
- package/dist/agents/cascade.js +61 -21
- 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-held-queue.d.ts +27 -4
- package/dist/agents/peer-held-queue.js +81 -36
- 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 +49 -10
- 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 +36 -41
- package/dist/agents/subagent.js +245 -200
- package/dist/agents/suspend-guard.d.ts +47 -16
- package/dist/agents/suspend-guard.js +13 -4
- package/dist/agents/verify.d.ts +41 -14
- package/dist/agents/verify.js +41 -30
- 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-features.d.ts +722 -0
- package/dist/core/checkpoint-features.js +98 -0
- package/dist/core/checkpoint-requirements.d.ts +33 -5
- package/dist/core/checkpoint-requirements.js +18 -5
- package/dist/core/checkpoint-row-verdict.d.ts +99 -0
- package/dist/core/checkpoint-row-verdict.js +225 -0
- package/dist/core/checkpoint-store.d.ts +107 -738
- package/dist/core/checkpoint-store.js +45 -143
- 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 +68 -21
- package/dist/core/engine-notice.js +9 -2
- 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 +4 -3
- 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 +14 -4
- package/dist/core/governance-codes.js +19 -4
- package/dist/core/hooks.d.ts +25 -4
- package/dist/core/hooks.js +11 -4
- package/dist/core/host-floor.js +3 -5
- package/dist/core/human-input-projection.d.ts +1 -0
- package/dist/core/human-input-projection.js +3 -0
- package/dist/core/image-admission.d.ts +47 -7
- 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 +4 -3
- 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 +225 -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-driver.d.ts +1 -1
- 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/memory-vector.d.ts +1 -1
- package/dist/core/memory.d.ts +10 -10
- package/dist/core/mode-policy.d.ts +8 -8
- package/dist/core/mode-policy.js +8 -6
- package/dist/core/mods/agent-stations.d.ts +39 -4
- package/dist/core/mods/agent-stations.js +59 -10
- package/dist/core/mods/classic-events.d.ts +9 -1
- package/dist/core/mods/dollar.d.ts +94 -1
- package/dist/core/mods/dollar.js +13 -1
- 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 +14 -3
- package/dist/core/mods/kernel/events.js +18 -15
- 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/lifecycle-stations.d.ts +36 -4
- package/dist/core/mods/lifecycle-stations.js +44 -9
- package/dist/core/mods/session-append.d.ts +118 -0
- package/dist/core/mods/session-append.js +318 -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 +138 -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 +88 -21
- package/dist/core/mods/stations.js +149 -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 +68 -2
- package/dist/core/own-property-receipt.js +45 -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/read-root-candidate.js +1 -1
- package/dist/core/remote-env.d.ts +74 -26
- package/dist/core/remote-env.js +20 -0
- package/dist/core/resume-startup-cause.d.ts +5 -4
- 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 +18 -3
- 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 +116 -34
- 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/delegation-owner.d.ts +43 -0
- package/dist/core/runner/delegation-owner.js +59 -0
- 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/lineage-reroot-view.d.ts +56 -0
- package/dist/core/runner/lineage-reroot-view.js +108 -0
- 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 +7 -2
- package/dist/core/runner/permission-rule-lanes.js +28 -9
- package/dist/core/runner/person-path-rows.d.ts +15 -0
- package/dist/core/runner/person-path-rows.js +27 -4
- package/dist/core/runner/placement-fence.d.ts +26 -0
- package/dist/core/runner/placement-fence.js +38 -0
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +4 -1
- package/dist/core/runner/prepare-acquire-reconcile.js +7 -2
- 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 +3 -0
- package/dist/core/runner/prepare-caps-and-workflow.js +2 -1
- package/dist/core/runner/prepare-config-doors.d.ts +6 -6
- package/dist/core/runner/prepare-config-doors.js +19 -21
- 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 +6 -6
- package/dist/core/runner/prepare-hands-readface.js +32 -11
- package/dist/core/runner/prepare-inherited-gate.d.ts +8 -0
- package/dist/core/runner/prepare-inherited-gate.js +10 -3
- 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 +61 -30
- 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 +8 -6
- package/dist/core/runner/resume-admission.js +23 -6
- package/dist/core/runner/resume-apply.d.ts +4 -0
- package/dist/core/runner/resume-apply.js +14 -5
- package/dist/core/runner/resume-checkpoint-screen.d.ts +9 -0
- package/dist/core/runner/resume-checkpoint-screen.js +4 -84
- 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.d.ts +2 -0
- package/dist/core/runner/run-git-lane.js +6 -2
- package/dist/core/runner/run-harness-handlers.d.ts +2 -0
- package/dist/core/runner/run-harness-handlers.js +5 -4
- 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 +64 -36
- 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 +12 -9
- package/dist/core/runner/run-stop-and-final-verify.js +2 -1
- 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 +34 -18
- package/dist/core/runner/runtask.d.ts +18 -3
- package/dist/core/runner/runtask.js +33 -17
- 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/steering-preview.d.ts +9 -0
- package/dist/core/runner/steering-preview.js +5 -0
- 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 +16 -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-face-overlay.js +2 -0
- 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 +8 -2
- package/dist/core/runner/turn-attachments.js +2 -2
- 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 +26 -27
- package/dist/core/secret-env.d.ts +19 -16
- package/dist/core/secret-env.js +45 -27
- 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 +3 -1
- package/dist/core/session-store.js +10 -8
- package/dist/core/session.d.ts +16 -5
- 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 +8 -2
- package/dist/core/store-contracts/checkpoint-store-contract.js +83 -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/session-store-contract.js +22 -8
- 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 +24 -9
- package/dist/core/task-limits.d.ts +5 -0
- package/dist/core/task-notification.d.ts +89 -12
- package/dist/core/task-notification.js +89 -14
- package/dist/core/task-registry-agent.d.ts +32 -50
- package/dist/core/task-registry-agent.js +36 -56
- 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 +22 -112
- package/dist/core/task-registry-shared.js +3 -41
- package/dist/core/task-registry-workflow.js +5 -21
- package/dist/core/task-registry.d.ts +32 -62
- package/dist/core/task-registry.js +30 -110
- package/dist/core/task-result.d.ts +29 -12
- 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 +11 -11
- 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 +36 -6
- 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 +8 -5
- package/dist/core/tool-face.js +1 -1
- 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 +109 -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-roster.d.ts +4 -4
- package/dist/core/tool-spec.d.ts +23 -6
- package/dist/core/trace.d.ts +18 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.js +1 -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 +37 -9
- package/dist/engine/execution-env/node-execution-env.js +221 -22
- 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 +52 -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/engine/session/parent-chain-guard.d.ts +3 -3
- package/dist/engine/session/parent-chain-guard.js +1 -1
- package/dist/engine/session/path-to-root.d.ts +18 -3
- package/dist/engine/session/path-to-root.js +15 -1
- package/dist/engine/session/repo-utils.d.ts +12 -1
- package/dist/engine/session/repo-utils.js +41 -0
- package/dist/engine/session/session.js +1 -1
- package/dist/engine/session/storage-base.d.ts +20 -0
- package/dist/engine/session/storage-base.js +28 -9
- package/dist/fixtures/index.d.ts +7 -5
- package/dist/fixtures/index.js +5 -3
- package/dist/index.d.ts +29 -18
- package/dist/index.js +19 -11
- package/dist/internal/harness-types.d.ts +2 -0
- package/dist/internal/harness.d.ts +4 -3
- package/dist/internal/harness.js +3 -2
- 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 +14 -17
- package/dist/orchestration/run-workflow-tool.js +43 -50
- package/dist/orchestration/workflow-types.d.ts +2 -2
- package/dist/orchestration/workflow.d.ts +7 -0
- package/dist/orchestration/workflow.js +10 -12
- package/dist/stores/file/background-agent-store.js +18 -15
- package/dist/stores/file/checkpoint-store.d.ts +2 -0
- package/dist/stores/file/checkpoint-store.js +13 -9
- package/dist/stores/file/file-history-store.js +3 -2
- package/dist/stores/file/fs-atomic.d.ts +0 -22
- package/dist/stores/file/fs-atomic.js +0 -17
- package/dist/stores/file/index.d.ts +7 -12
- package/dist/stores/file/index.js +25 -12
- 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 +26 -7
- package/dist/stores/file/session-store.js +59 -35
- 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/bash-program-position.d.ts +3 -2
- package/dist/tools/fs/bash-program-position.js +7 -7
- 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/removal-targets.js +2 -2
- package/dist/tools/fs/search.d.ts +3 -2
- package/dist/tools/fs/search.js +6 -6
- package/dist/tools/fs/shell-read-argv.d.ts +4 -2
- package/dist/tools/fs/shell-read-argv.js +14 -3
- package/dist/tools/fs/shell-read-bindings.d.ts +18 -2
- package/dist/tools/fs/shell-read-bindings.js +148 -68
- package/dist/tools/fs/shell-read-check.js +20 -4
- package/dist/tools/fs/shell-read-establish.js +25 -9
- package/dist/tools/fs/shell-read-functions.js +2 -2
- 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/fs/shell-read-object-path.d.ts +59 -0
- package/dist/tools/fs/shell-read-object-path.js +119 -0
- package/dist/tools/fs/shell-read-plan.d.ts +8 -0
- package/dist/tools/fs/shell-read-plan.js +47 -30
- package/dist/tools/fs/shell-read-start.d.ts +66 -13
- package/dist/tools/fs/shell-read-start.js +89 -17
- package/dist/tools/fs/shell-read-workdir.d.ts +29 -8
- package/dist/tools/fs/shell-read-workdir.js +31 -8
- 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 +112 -42
- package/wire-changes/core-stores-sql@7.61.0.json +480 -0
- package/wire-changes/core-stores-sql@7.62.0.json +30 -0
- package/wire-changes/core@7.61.0.json +4405 -0
- package/wire-changes/core@7.62.0.json +2181 -0
- package/wire-changes/mods-kernel@7.61.0.json +65 -0
- package/wire-changes/mods-kernel@7.62.0.json +42 -0
- package/wire-changes/primitives@7.61.0.json +30 -0
- package/wire-changes/primitives@7.62.0.json +30 -0
- package/dist/core/consolidate-scope.d.ts +0 -93
- package/dist/core/consolidate-scope.js +0 -98
- package/dist/core/runner/image-removed-seat.d.ts +0 -12
- package/dist/core/runner/image-removed-seat.js +0 -19
- package/dist/core/runner/memory-consolidation.d.ts +0 -109
- package/dist/core/runner/memory-consolidation.js +0 -251
|
@@ -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, promptCountOf } 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";
|
|
@@ -71,12 +73,17 @@ async function compactOnSession(req, deps, session, resolved, named, legMods) {
|
|
|
71
73
|
const compactionModel = compactionSummaryIsDerived(req.compactionModel !== undefined, named) ? await compactionSummaryFallback({ derived: named, primary: resolved.model, brain: deps.brain, getApiKeyAndHeaders: req.getApiKeyAndHeaders, onNotice: deps.onNotice, sessionId }) : named;
|
|
72
74
|
const branch = await session.getBranch();
|
|
73
75
|
const contextMessages = convertToLlm((await session.buildContext()).messages);
|
|
74
|
-
bindSessionFacade(legMods, { deps, req, model: resolved.model, messages: contextMessages, book });
|
|
76
|
+
bindSessionFacade(legMods, { deps, req, model: resolved.model, messages: contextMessages, book, turns: async () => promptCountOf(await session.getBranch()) });
|
|
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,13 +138,21 @@ 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 }),
|
|
145
|
+
agentSessions: undefined,
|
|
146
|
+
turns: input.turns,
|
|
147
|
+
measure: {},
|
|
137
148
|
activeTools: new Set(),
|
|
138
149
|
agentListing: undefined,
|
|
139
150
|
book: (answeredBy, reply) => input.book("mod", answeredBy, reply),
|
|
140
151
|
toolCall: () => unavailable("tool.call"),
|
|
152
|
+
agentSpawn: () => unavailable("agent.spawn"),
|
|
153
|
+
sessionAppend: () => unavailable("session.append"),
|
|
154
|
+
sessionSend: () => unavailable("session.send"),
|
|
155
|
+
sessionCompact: () => unavailable("session.compact"),
|
|
141
156
|
});
|
|
142
157
|
legMods.bindFacade({
|
|
143
158
|
...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,21 @@ 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;
|
|
571
|
+
/** The leg's latest context measurement (`lifecycle-stations.ts`): each turn boundary writes it, `$.session.usage` reads it. */
|
|
572
|
+
sessionMeasure: import("../mods/lifecycle-stations.js").SessionMeasureSeat;
|
|
550
573
|
/**
|
|
551
574
|
* This session's DURABLE box, present iff this leg mounted the session-box drain (a top-level leg
|
|
552
575
|
* over a cross-process-safe mailbox with a grammatical session id). The notification lane binds it
|
|
@@ -863,6 +886,11 @@ export interface Prepared {
|
|
|
863
886
|
continuation: boolean;
|
|
864
887
|
abortedBeforeTurnEnd: boolean;
|
|
865
888
|
};
|
|
889
|
+
/** The word the loop's exit named (its terminal trace step; absent until it exits), read by the terminal arbitration
|
|
890
|
+
* (`ResultFlags.loopTerminal`) for the exits the final message cannot state. Always present. */
|
|
891
|
+
loopTerminalRef: {
|
|
892
|
+
reason?: LoopTerminalReason;
|
|
893
|
+
};
|
|
866
894
|
/** Records the FIRST brain call this run's outer guardrail gave up on (see
|
|
867
895
|
* {@link import("../../brain/timeout.js").withBrainCallGuardrail}). Always present; `timedOut`
|
|
868
896
|
* stays absent unless the guardrail fired. The run loop reads it AFTER the loop settles and gives
|
|
@@ -959,7 +987,7 @@ export interface Prepared {
|
|
|
959
987
|
* · protocol-tools — pushes the MCP tools (through the remote wrapper), RefreshMcpTools (servers declared),
|
|
960
988
|
* the A2A tools; at RUN time its refresh closure splices a server's name-prefix domain out and back in;
|
|
961
989
|
* · hands mount — pushes the hands band (env wired);
|
|
962
|
-
* · delegation-surface — pushes
|
|
990
|
+
* · delegation-surface — pushes TaskStop (background ∨ workflow door), SendMessage (door ∨
|
|
963
991
|
* parentNotify ∨ peer lane, ∧ runner self ∧ no shadow), AgentTranscript (door ∧ runner self ∧ no shadow),
|
|
964
992
|
* ListAgents (peer lane ∧ built-in SendMessage ∧ mountable), Monitor (background), EnterWorktree +
|
|
965
993
|
* ExitWorktree (tracked cwd), ReadToolResult (offload store);
|
|
@@ -1314,6 +1342,9 @@ export interface PrepareResume {
|
|
|
1314
1342
|
/** The session leaf to rewind to (the suspension point) BEFORE reconcile — discards the abort's
|
|
1315
1343
|
* off-branch "Operation aborted" writes so the resume engine resolves the pending batch cleanly. */
|
|
1316
1344
|
leafId: string;
|
|
1345
|
+
/** The session rows the parked leg's port held past that leaf (`Checkpoint.heldRows`): the resumed harness's queue starts with
|
|
1346
|
+
* them and writes them at the transcript's first legal point. Absent ⇒ the park held none. */
|
|
1347
|
+
heldRows?: readonly AgentMessage[];
|
|
1317
1348
|
/** Batch tool-call ids of the suspended turn — wake-reconcile SKIPS these (they are resumed, not
|
|
1318
1349
|
* crash-interrupted; closing them with `[INTERRUPTED]` would DESTROY the suspended batch, §15.2 #7). */
|
|
1319
1350
|
suspendedBatch: ReadonlySet<string>;
|
|
@@ -1642,8 +1673,8 @@ export interface RunInternals {
|
|
|
1642
1673
|
* releases the lease when its materialization is disposed — see `mcp-connection-pool.ts`. Trusted, never a TaskSpec field.
|
|
1643
1674
|
*/
|
|
1644
1675
|
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
|
|
1676
|
+
/** This leg's host seats by declaration name: a `{ kind: "host" }` server of `TaskSpec.mcp` / `ResumeTaskConfig.mcp` dials through the
|
|
1677
|
+
* 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
1678
|
* announced once (`config.mcp_host_seat_undeclared`). The leg's own: a delegated child is handed the seats of the host servers it
|
|
1648
1679
|
* 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
1680
|
mcpHostSeats?: ReadonlyMap<string, import("../mcp-host-seat.js").McpHostSeat>;
|
|
@@ -1852,10 +1883,10 @@ export interface RunInternals {
|
|
|
1852
1883
|
* mirroring `insideFork`.
|
|
1853
1884
|
*/
|
|
1854
1885
|
isDelegatedChild?: boolean;
|
|
1855
|
-
/**
|
|
1856
|
-
*
|
|
1857
|
-
*
|
|
1858
|
-
|
|
1886
|
+
/** Who wrote this leg's objective ({@link import("../input-author.js").InputAuthor}), stated by the seat that mints it; absent = the public
|
|
1887
|
+
* entry's caller, `operator`. Only the operator's objective passes `classic.UserPromptSubmit`; a non-member reads `unknown`, is screened and
|
|
1888
|
+
* reported once (`onError`, `"config"`). Never inherited — each seat says its own. TRUSTED run-scoped channel (NOT a {@link TaskSpec} field). */
|
|
1889
|
+
objectiveAuthor?: import("../input-author.js").InputAuthor;
|
|
1859
1890
|
/**
|
|
1860
1891
|
* Subagent transcript persistence — the child transcript session's PLACEMENT declaration, minted
|
|
1861
1892
|
* by the background delegation lane (the trusted spawner: it knows the a* handle, scope and root)
|
|
@@ -1913,7 +1944,7 @@ export interface RunInternals {
|
|
|
1913
1944
|
*/
|
|
1914
1945
|
inheritedSkillGrants?: readonly SkillGrantRecord[];
|
|
1915
1946
|
/** 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
|
|
1947
|
+
inheritedAllowedTools?: readonly import("../allow-entry.js").AllowListEntry[];
|
|
1917
1948
|
/**
|
|
1918
1949
|
* When this task runs as a SUB-AGENT spawned under a parent task's
|
|
1919
1950
|
* tool call, the spawning tool's `ToolExecuteContext.toolCallId`. The Runner stamps it onto this task's
|
|
@@ -1961,6 +1992,10 @@ export interface RunInternals {
|
|
|
1961
1992
|
/** The spawning run's sessionId (paired with parentTaskId; see
|
|
1962
1993
|
* ToolExecuteContext.parentSessionId). */
|
|
1963
1994
|
parentSessionId?: string;
|
|
1995
|
+
/** The registry row this leg runs as (a background child's `a…` handle, the id `TaskStop` / `SendMessage` take), which the leg's
|
|
1996
|
+
* one task-id mint reads first. Set by the background lanes (plain, fork, retained snapshot); absent on a top-level run, a
|
|
1997
|
+
* synchronous child and a workflow agent. Stamped as `CheckpointState.rowTaskId`. Trusted seat, NOT a {@link TaskSpec} field. */
|
|
1998
|
+
rowTaskId?: string;
|
|
1964
1999
|
/**
|
|
1965
2000
|
* The memory-capture opt-out FLOOR: TRUE ⇔ the spawning session was under an
|
|
1966
2001
|
* opt-out when this child spawned. The child then runs opted-out itself (its prepare mints its
|
|
@@ -2025,6 +2060,11 @@ export interface RunInternals {
|
|
|
2025
2060
|
* after a restart those intermediate sessions are dead ends, and a recovery face enumerating
|
|
2026
2061
|
* "everything under this host session" needs the root anchor, not an alias walk. */
|
|
2027
2062
|
rootSessionId?: string;
|
|
2063
|
+
/** The delegation tree's owner seat ({@link import("./delegation-owner.js").DelegationOwnerSeat}): a fixed point like
|
|
2064
|
+
* {@link rootSessionId} — the spawning run hands its own seat down by reference (the delegation and workflow lanes), so the tree
|
|
2065
|
+
* 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
|
|
2066
|
+
* prepare mints a seat over the row it acquired. TRUSTED run-scoped channel (never a {@link TaskSpec} field). */
|
|
2067
|
+
delegationOwner?: import("./delegation-owner.js").DelegationOwnerSeat;
|
|
2028
2068
|
/**
|
|
2029
2069
|
* The run tree's PLACEMENT root: the fixed point a target-bound env factory keys
|
|
2030
2070
|
* its placement lookup on ({@link import("../remote-env.js").ExecutionEnvFactoryContext.placementRootSessionId}).
|
|
@@ -2045,9 +2085,27 @@ export interface RunInternals {
|
|
|
2045
2085
|
* `resume.placement_mismatch`). TRUSTED run-scoped channel (never a {@link TaskSpec} field).
|
|
2046
2086
|
*/
|
|
2047
2087
|
placementRoot?: string;
|
|
2088
|
+
/** The placement FENCE this leg is minted under: the target of the leg that hands it work (a spawner, a waker, a composition's
|
|
2089
|
+
* first leg), folded at the mint into {@link import("../remote-env.js").ExecutionEnvFactoryContext.placementTarget} — whose
|
|
2090
|
+
* contract lists every producer; one hop, re-read at every leg (unlike the tree's fixed point {@link placementRoot}). An
|
|
2091
|
+
* unreadable value is refused at the mint (`config.placement_not_honored`). TRUSTED run-scoped channel (never a {@link TaskSpec} field). */
|
|
2092
|
+
placementTarget?: PlacementTarget;
|
|
2093
|
+
/**
|
|
2094
|
+
* Which composition this leg is a leg of, and whose run it belongs to ({@link CompositionLeg}): minted ONLY by a composition
|
|
2095
|
+
* entry when it hands the leg out (`runCascade` / `resumeCascade` for each rung, the verification gate for each verifier leg),
|
|
2096
|
+
* never by the engine. The suspend mint stamps it on the row as `CheckpointState.compositionLeg`, so a card a leg parks says
|
|
2097
|
+
* itself which leg of which composition it is and which host session it belongs to; one value, read ONCE at prepare (the live
|
|
2098
|
+
* 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
|
|
2099
|
+
* placement fixed point: a live value wins, a live value that CONTRADICTS the row's is refused pre-CAS
|
|
2100
|
+
* (`resume.composition_mismatch`, the row stays pending), an absent one is restored from the row — and a live value over a row
|
|
2101
|
+
* that records none (a card minted before the member, or by a leg nobody labelled) is that row's first record, never refused.
|
|
2102
|
+
* 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
|
|
2103
|
+
* (never a {@link TaskSpec} field).
|
|
2104
|
+
*/
|
|
2105
|
+
compositionLeg?: CompositionLeg;
|
|
2048
2106
|
/**
|
|
2049
2107
|
* The REGISTRY SCOPE this run's own background row lives in: the domain its registry-facing
|
|
2050
|
-
* tools (
|
|
2108
|
+
* tools (TaskStop / SendMessage / AgentTranscript / Monitor, and the announce listing)
|
|
2051
2109
|
* must mount in to see it. Filled by the delegation tool at spawn, which is the party that CHOSE the
|
|
2052
2110
|
* domain when it registered the row — `ctx.principal` when the spawning run has one, else the
|
|
2053
2111
|
* delegation mount's declared `background.scope`, and on a revival the claimed row's own scope.
|
|
@@ -2265,7 +2323,7 @@ export interface RunInternals {
|
|
|
2265
2323
|
* the tool ctx as {@link ToolExecuteContext.onSubagentSpawn} and recursively down the delegation
|
|
2266
2324
|
* tree. Absent ⇒ children run non-steerable (prior behavior, zero overhead).
|
|
2267
2325
|
* SCOPE: only SYNC delegations emit a handle — a
|
|
2268
|
-
* `run_in_background` child does not (
|
|
2326
|
+
* `run_in_background` child does not (its completion notification carries the result; TaskStop stops it); wiring the background
|
|
2269
2327
|
* lane is a recorded follow-up, not an oversight a deployment should discover at runtime.
|
|
2270
2328
|
*/
|
|
2271
2329
|
onSubagentSpawn?: (handle: import("../../agents/subagent.js").SubagentSteerHandle) => void;
|
|
@@ -2374,6 +2432,8 @@ export interface ResolvedWorkspace {
|
|
|
2374
2432
|
/** Where a delegated child's environment placed it against where its caller asked; absent on a leg no delegation
|
|
2375
2433
|
* caller placed. */
|
|
2376
2434
|
placement?: ChildPlacement;
|
|
2435
|
+
/** The target this leg's env reported as it settled — the fence of every leg it hands work to; absent when it reported none. */
|
|
2436
|
+
target?: PlacementTarget;
|
|
2377
2437
|
}
|
|
2378
2438
|
/**
|
|
2379
2439
|
* The resolver's answer, with the WITHHELD cause beside the value.
|
|
@@ -2624,16 +2684,39 @@ export interface RunState {
|
|
|
2624
2684
|
};
|
|
2625
2685
|
}
|
|
2626
2686
|
/**
|
|
2627
|
-
* Config
|
|
2628
|
-
*
|
|
2629
|
-
*
|
|
2630
|
-
*
|
|
2631
|
-
*
|
|
2687
|
+
* Config handed to {@link Runner.resume}: the {@link TaskSpec} members the resumed leg runs with. `sessionId` comes from the checkpoint;
|
|
2688
|
+
* a resume sends no new human message, so it takes no objective, `userAttachments` or `runOrigin` (either present is refused before the
|
|
2689
|
+
* 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`,
|
|
2690
|
+
* `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
|
|
2691
|
+
* judge them; absent declares none) — a host replaying the parked run's lists re-dials a server its user removed. The parked call is
|
|
2692
|
+
* judged against what this resume mounts: its server no longer declared ⇒ `resume.tool_unavailable` (never dialed, not run, the row
|
|
2693
|
+
* reopened `pending`); a replacement ⇒ `resume.tool_contract_mismatch`; a moved face or declaration ⇒ `resume.target_moved`. Identity is
|
|
2694
|
+
* kept instead: a contradicting `principal` is refused (`resume.principal_mismatch`), an absent one inherits the row's.
|
|
2632
2695
|
*/
|
|
2633
|
-
/** A resume continues the suspended leg: it sends no new human message, so it takes neither an objective nor the
|
|
2634
|
-
* objective's attachments nor the objective's run origin (a config that carries `userAttachments` or `runOrigin` anyway is
|
|
2635
|
-
* refused before the claim; a wake states its leg's word on the input it hands over). */
|
|
2636
2696
|
export type ResumeTaskConfig = Omit<TaskSpec, "objective" | "sessionId" | "userAttachments" | "runOrigin">;
|
|
2697
|
+
/**
|
|
2698
|
+
* A composition leg's identity ({@link RunInternals.compositionLeg}, `CheckpointState.compositionLeg`): which entry handed the
|
|
2699
|
+
* leg out, which leg of it this is, and the host session the composition runs for. One member per entry; `entry` is a closed
|
|
2700
|
+
* set, and a word outside it is refused wherever the identity is read (`config.invalid_argument`), never stamped on a card.
|
|
2701
|
+
* · `entry: "cascade"` — `leg` is the ladder rung's index (0-based); `hostSessionId` is the caller's `TaskSpec.sessionId`,
|
|
2702
|
+
* the session a host files the composition's run under. A rung runs in its OWN session (the card's `sessionId`), so a host
|
|
2703
|
+
* links a rung's card back to its run by `hostSessionId`, never by the card's session. A cascade whose caller named no
|
|
2704
|
+
* session mints none: that rung's card cannot be linked by composition.
|
|
2705
|
+
* · `entry: "verify"` — the verification gate's VERIFIER leg (`verifyCompleted` and every entry built on it): `leg` is the
|
|
2706
|
+
* verification iteration (1-based, the number `onRound` reports); `hostSessionId` is the implementation's session (the result
|
|
2707
|
+
* the gate verifies, which every fix leg continues). Only the verifier leg is handed one — a fix leg continues the
|
|
2708
|
+
* implementation session itself, so its card already sits in the host's session. A verifier runs in a session the gate
|
|
2709
|
+
* 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
|
|
2710
|
+
* can decide, and settles it by its token — `runner.resume`, or `Runner.voidVerifierPause` to void it and unpin the
|
|
2711
|
+
* verifier session. An implementation result with no session id mints none.
|
|
2712
|
+
* Three identities beside each other on one card, never merged: the card's `sessionId` (what a resume continues),
|
|
2713
|
+
* `placementRootSessionId` (where the work is placed), and this (whose run it is, and which leg).
|
|
2714
|
+
*/
|
|
2715
|
+
export type CompositionLeg = {
|
|
2716
|
+
readonly entry: "cascade" | "verify";
|
|
2717
|
+
readonly leg: number;
|
|
2718
|
+
readonly hostSessionId: string;
|
|
2719
|
+
};
|
|
2637
2720
|
/** Resume plan threaded from {@link Runner.resume} into the shared run loop. */
|
|
2638
2721
|
export interface ResumeRun {
|
|
2639
2722
|
cp: Checkpoint;
|
|
@@ -2677,6 +2760,9 @@ export interface ResumeRun {
|
|
|
2677
2760
|
* §4.3-3 reserves for the cross-process parked leg). Present only when a wake message passed a
|
|
2678
2761
|
* screen that supplied context. */
|
|
2679
2762
|
wakeMessageHookContext?: string;
|
|
2763
|
+
/** Who rewrote {@link wakeMessage}'s text at that screen (`prompt.submit`), in the order they did — its applied
|
|
2764
|
+
* `human_input` account names them. Absent ⇒ nobody rewrote it. */
|
|
2765
|
+
wakeMessageRewrittenBy?: readonly string[];
|
|
2680
2766
|
/** The resumed leg's bus when the wake-message screen admitted it before the claim — prepare adopts it. */
|
|
2681
2767
|
legMods?: LegMods;
|
|
2682
2768
|
/** The claim's reversal, bound to THIS resume's token and scope by `resumeStream` — REQUIRED, as the store's
|
|
@@ -2734,14 +2820,7 @@ export interface TurnBoundaryDeps {
|
|
|
2734
2820
|
readonly userHalted: boolean;
|
|
2735
2821
|
readonly callerStop: import("./caller-stop-gate.js").CallerStopGate;
|
|
2736
2822
|
};
|
|
2737
|
-
manualCompactRef:
|
|
2738
|
-
requested: boolean;
|
|
2739
|
-
waiters: Array<{
|
|
2740
|
-
resolve: (outcome: CompactOutcome) => void;
|
|
2741
|
-
signal?: AbortSignal;
|
|
2742
|
-
instructions?: string;
|
|
2743
|
-
}>;
|
|
2744
|
-
};
|
|
2823
|
+
manualCompactRef: Pick<ManualCompactRef, "requested" | "waiters">;
|
|
2745
2824
|
todoToolMounted: boolean;
|
|
2746
2825
|
taskToolsMounted: boolean;
|
|
2747
2826
|
walltimeMonotonicDeadline: number | undefined;
|
|
@@ -2823,7 +2902,7 @@ export interface HarnessHandlersDeps {
|
|
|
2823
2902
|
onError: RunnerDeps["onError"];
|
|
2824
2903
|
onNotice: RunnerDeps["onNotice"];
|
|
2825
2904
|
};
|
|
2826
|
-
|
|
2905
|
+
mediaBudgetBase64Chars: RunnerDeps["mediaBudgetBase64Chars"];
|
|
2827
2906
|
/** The run's ONE isolation scope for the {@link RunInternals} observation sinks, minted by the
|
|
2828
2907
|
* identity-wiring lane (which calls the first of them) and shared with these handlers, so the
|
|
2829
2908
|
* "first failure per site" disclosure is one account for the whole run rather than one per lane. */
|
|
@@ -2962,10 +3041,13 @@ export interface TaskIdRef {
|
|
|
2962
3041
|
* gate the run-end backstop closes before its final drain. */
|
|
2963
3042
|
export interface ManualCompactRef {
|
|
2964
3043
|
requested: boolean;
|
|
3044
|
+
/** `requestedBy`: the extension a `$.session.compact` request came from (absent on a host `compact()` request) — the
|
|
3045
|
+
* pass that claims it carries it on the frame that ends it. */
|
|
2965
3046
|
waiters: Array<{
|
|
2966
3047
|
resolve: (outcome: CompactOutcome) => void;
|
|
2967
3048
|
signal?: AbortSignal;
|
|
2968
3049
|
instructions?: string;
|
|
3050
|
+
requestedBy?: import("../task-event.js").ExtensionRequester;
|
|
2969
3051
|
}>;
|
|
2970
3052
|
emitMooted?: (reason: string) => void;
|
|
2971
3053
|
closed?: boolean;
|