@sema-agent/core 7.59.0 → 7.60.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 +564 -0
- package/dist/agents/agent-definition.d.ts +7 -0
- package/dist/agents/agent-definition.js +12 -0
- package/dist/agents/agent-transcript-tool.d.ts +2 -1
- package/dist/agents/agent-transcript-tool.js +3 -1
- package/dist/agents/child-model-seat.js +6 -3
- package/dist/agents/cumulative-stats.js +0 -1
- package/dist/agents/inherited-tool-pool.d.ts +26 -1
- package/dist/agents/inherited-tool-pool.js +22 -0
- package/dist/agents/retain-ledger.d.ts +11 -1
- package/dist/agents/retain-ledger.js +13 -2
- package/dist/agents/roster-store.d.ts +1 -1
- package/dist/agents/roster-store.js +3 -1
- package/dist/agents/send-message-tool.d.ts +8 -19
- package/dist/agents/send-message-tool.js +11 -38
- package/dist/agents/subagent.d.ts +51 -17
- package/dist/agents/subagent.js +117 -78
- package/dist/agents/tool-filter.d.ts +1 -3
- package/dist/agents/tool-filter.js +4 -12
- package/dist/bench/metrics.d.ts +3 -5
- package/dist/bench/metrics.js +0 -1
- package/dist/brain/degrading.js +3 -1
- package/dist/brain/route-adjudicator.js +3 -1
- package/dist/brain/status-sink.d.ts +7 -1
- package/dist/brain/status-sink.js +6 -0
- package/dist/brain/timeout.d.ts +3 -1
- package/dist/brain/timeout.js +18 -5
- package/dist/core/a2a.d.ts +15 -5
- package/dist/core/a2a.js +34 -19
- package/dist/core/agent-definition.d.ts +20 -0
- package/dist/core/allow-entry.d.ts +2 -0
- package/dist/core/allow-entry.js +3 -1
- package/dist/core/artifact-host.d.ts +0 -2
- package/dist/core/artifact-host.js +0 -1
- package/dist/core/auto-mode-defaults.d.ts +8 -0
- package/dist/core/auto-mode-defaults.js +1 -0
- package/dist/core/auto-mode-rebuild.d.ts +2 -1
- package/dist/core/auto-mode.d.ts +39 -4
- package/dist/core/auto-mode.js +63 -12
- package/dist/core/background-agent-store.d.ts +10 -1
- package/dist/core/background-agent-store.js +3 -2
- package/dist/core/background-shell.d.ts +12 -1
- package/dist/core/background-shell.js +12 -0
- package/dist/core/checkpoint-store.d.ts +8 -13
- package/dist/core/checkpoint-store.js +4 -3
- package/dist/core/compliance.d.ts +1 -1
- package/dist/core/credential-echo.d.ts +52 -0
- package/dist/core/credential-echo.js +65 -0
- package/dist/core/credential-vocabulary.d.ts +13 -3
- package/dist/core/credential-vocabulary.js +12 -4
- package/dist/core/cross-boundary-taint.d.ts +4 -5
- package/dist/core/engine-notice.d.ts +58 -15
- package/dist/core/frame-settlement.d.ts +5 -0
- package/dist/core/frame-settlement.js +4 -0
- package/dist/core/gate-fold.js +7 -5
- package/dist/core/gate-lanes.js +39 -8
- package/dist/core/governance-codes.d.ts +9 -1
- package/dist/core/governance-codes.js +12 -0
- package/dist/core/hands-band-screen.js +0 -1
- package/dist/core/hands-band.d.ts +0 -3
- package/dist/core/hooks.d.ts +39 -56
- package/dist/core/hooks.js +123 -77
- package/dist/core/image-admission.d.ts +104 -51
- package/dist/core/image-admission.js +170 -46
- package/dist/core/image-downsample.d.ts +36 -69
- package/dist/core/image-downsample.js +111 -73
- package/dist/core/integer-option.d.ts +21 -0
- package/dist/core/integer-option.js +13 -0
- package/dist/core/locked-config.d.ts +54 -3
- package/dist/core/locked-config.js +81 -50
- package/dist/core/mcp-call-meta.d.ts +2 -2
- package/dist/core/mcp-call-meta.js +9 -10
- package/dist/core/mcp-failure.d.ts +9 -3
- package/dist/core/mcp-failure.js +10 -0
- package/dist/core/mcp-host-seat.d.ts +92 -0
- package/dist/core/mcp-host-seat.js +131 -0
- package/dist/core/mcp-probe.d.ts +7 -2
- package/dist/core/mcp-probe.js +7 -2
- package/dist/core/mcp-server-spec.d.ts +38 -9
- package/dist/core/mcp-server-spec.js +55 -21
- package/dist/core/mcp.d.ts +17 -6
- package/dist/core/mcp.js +67 -55
- package/dist/core/memory-admission.d.ts +23 -6
- package/dist/core/memory-admission.js +19 -9
- package/dist/core/memory-engine/content-origin.d.ts +13 -0
- package/dist/core/memory-engine/content-origin.js +21 -3
- package/dist/core/memory-engine/index.d.ts +2 -1
- package/dist/core/memory-engine/index.js +2 -1
- package/dist/core/memory-engine/scope-contract.d.ts +13 -3
- package/dist/core/memory-engine/scope-contract.js +2 -2
- package/dist/core/memory-engine/sync-client.d.ts +45 -11
- package/dist/core/memory-engine/sync-client.js +82 -11
- package/dist/core/memory-engine/sync-report.d.ts +103 -0
- package/dist/core/memory-engine/sync-report.js +119 -0
- package/dist/core/memory-engine/sync.d.ts +4 -2
- package/dist/core/mode-policy.d.ts +9 -1
- package/dist/core/mode-policy.js +11 -1
- package/dist/core/model-receipt.d.ts +39 -0
- package/dist/core/model-receipt.js +139 -0
- package/dist/core/mods/agent-stations.d.ts +65 -0
- package/dist/core/mods/agent-stations.js +105 -0
- package/dist/core/mods/kernel/dispatch.d.ts +5 -1
- package/dist/core/mods/kernel/dispatch.js +4 -4
- package/dist/core/mods/kernel/events.d.ts +10 -4
- package/dist/core/mods/kernel/events.js +10 -6
- package/dist/core/mods/kernel/receive.d.ts +5 -0
- package/dist/core/mods/kernel/receive.js +10 -0
- package/dist/core/mods/lifecycle-stations.d.ts +41 -0
- package/dist/core/mods/lifecycle-stations.js +35 -0
- package/dist/core/mods/stations.d.ts +51 -59
- package/dist/core/mods/stations.js +32 -42
- package/dist/core/mods/tool-call.d.ts +10 -4
- package/dist/core/mods/tool-call.js +28 -12
- package/dist/core/mounted-mcp.d.ts +5 -0
- package/dist/core/mounted-mcp.js +2 -2
- package/dist/core/namespaced-rule-name.d.ts +7 -1
- package/dist/core/namespaced-rule-name.js +13 -2
- package/dist/core/oracle-isolation.js +1 -1
- package/dist/core/own-property-receipt.d.ts +3 -0
- package/dist/core/own-property-receipt.js +3 -0
- package/dist/core/park-selfcheck.js +8 -8
- package/dist/core/peer-seat.d.ts +63 -8
- package/dist/core/peer-seat.js +179 -34
- package/dist/core/permission-rule-consent.d.ts +0 -21
- package/dist/core/permission-rule-consent.js +1 -2
- package/dist/core/permission-rule-model.d.ts +4 -2
- package/dist/core/permission-rule-model.js +7 -6
- package/dist/core/protocol-http-auth.d.ts +14 -2
- package/dist/core/protocol-http-auth.js +16 -7
- package/dist/core/read-face-seats.d.ts +7 -5
- package/dist/core/read-face-seats.js +4 -1
- package/dist/core/redaction-marks.d.ts +4 -3
- package/dist/core/redaction-marks.js +2 -2
- package/dist/core/remote-env.d.ts +146 -98
- package/dist/core/remote-env.js +113 -14
- package/dist/core/retention.js +37 -12
- package/dist/core/retired-keys.d.ts +6 -1
- package/dist/core/retired-keys.js +4 -1
- package/dist/core/rewrite-rejudge.d.ts +12 -5
- package/dist/core/rewrite-rejudge.js +9 -5
- package/dist/core/roles.d.ts +37 -3
- package/dist/core/roles.js +126 -78
- package/dist/core/rule-owner.d.ts +3 -0
- package/dist/core/runner/assemble-result.d.ts +0 -5
- package/dist/core/runner/assemble-result.js +0 -1
- package/dist/core/runner/call-hook-stations.d.ts +17 -10
- package/dist/core/runner/call-hook-stations.js +21 -10
- package/dist/core/runner/child-tree.d.ts +7 -8
- package/dist/core/runner/child-tree.js +6 -6
- package/dist/core/runner/classifier-ladder.d.ts +10 -2
- package/dist/core/runner/classifier-ladder.js +39 -8
- package/dist/core/runner/construction-doors.js +5 -0
- package/dist/core/runner/contracts.d.ts +62 -41
- package/dist/core/runner/cross-boundary-lane.d.ts +3 -5
- package/dist/core/runner/cross-boundary-lane.js +11 -2
- package/dist/core/runner/env-capability-census.d.ts +15 -20
- package/dist/core/runner/env-capability-census.js +25 -34
- package/dist/core/runner/file-history-request.d.ts +2 -2
- package/dist/core/runner/file-history-request.js +0 -8
- package/dist/core/runner/gate-exit.d.ts +75 -7
- package/dist/core/runner/gate-exit.js +20 -1
- package/dist/core/runner/git-status-frame.d.ts +5 -2
- package/dist/core/runner/git-status-frame.js +3 -4
- package/dist/core/runner/image.d.ts +7 -2
- package/dist/core/runner/image.js +14 -8
- package/dist/core/runner/inline-image.d.ts +10 -8
- package/dist/core/runner/inline-image.js +11 -9
- package/dist/core/runner/memory-consolidation-driver.js +4 -4
- package/dist/core/runner/permission-rule-lanes.js +1 -1
- package/dist/core/runner/prepare-boundary-parks.d.ts +2 -2
- package/dist/core/runner/prepare-boundary-parks.js +3 -3
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -0
- package/dist/core/runner/prepare-caps-and-workflow.js +4 -3
- package/dist/core/runner/prepare-config-doors.d.ts +6 -1
- package/dist/core/runner/prepare-config-doors.js +14 -9
- package/dist/core/runner/prepare-delegation-surface.d.ts +5 -3
- package/dist/core/runner/prepare-delegation-surface.js +4 -4
- package/dist/core/runner/prepare-file-history.d.ts +10 -12
- package/dist/core/runner/prepare-file-history.js +3 -12
- package/dist/core/runner/prepare-gate-stations.d.ts +4 -3
- package/dist/core/runner/prepare-gate-stations.js +4 -3
- package/dist/core/runner/prepare-hands-readface.d.ts +3 -1
- package/dist/core/runner/prepare-hands-readface.js +15 -7
- package/dist/core/runner/prepare-inherited-gate.d.ts +5 -4
- package/dist/core/runner/prepare-inherited-gate.js +9 -5
- package/dist/core/runner/prepare-memory-engine-session.js +1 -1
- package/dist/core/runner/prepare-memory.d.ts +2 -2
- package/dist/core/runner/prepare-memory.js +2 -2
- package/dist/core/runner/prepare-park-ask.d.ts +3 -5
- package/dist/core/runner/prepare-park-ask.js +3 -8
- package/dist/core/runner/prepare-policy-chain.d.ts +5 -4
- package/dist/core/runner/prepare-policy-chain.js +120 -108
- package/dist/core/runner/prepare-project-context.js +8 -5
- package/dist/core/runner/prepare-prompt-inputs.d.ts +4 -1
- package/dist/core/runner/prepare-prompt-inputs.js +3 -2
- package/dist/core/runner/prepare-protocol-tools.d.ts +5 -3
- package/dist/core/runner/prepare-protocol-tools.js +9 -2
- package/dist/core/runner/prepare-suspend-saga.d.ts +0 -2
- package/dist/core/runner/prepare-suspend-saga.js +5 -7
- package/dist/core/runner/prepare-task.js +41 -27
- package/dist/core/runner/prepare-turn-wiring.d.ts +2 -0
- package/dist/core/runner/prepare-turn-wiring.js +7 -2
- package/dist/core/runner/prepare-wiring-manifest.d.ts +4 -3
- package/dist/core/runner/prepare-wiring-manifest.js +32 -18
- package/dist/core/runner/prepare-workspace-restore.js +3 -3
- package/dist/core/runner/resume-checkpoint-screen.js +4 -4
- package/dist/core/runner/retired-runner-deps.js +4 -1
- package/dist/core/runner/run-attachment-seats.js +3 -3
- package/dist/core/runner/run-brain-sinks.js +1 -0
- package/dist/core/runner/run-git-lane.d.ts +3 -1
- package/dist/core/runner/run-git-lane.js +1 -1
- package/dist/core/runner/run-harness-handlers.d.ts +3 -1
- package/dist/core/runner/run-harness-handlers.js +3 -1
- package/dist/core/runner/run-identity-wiring.js +1 -1
- package/dist/core/runner/run-leg.js +26 -28
- package/dist/core/runner/run-notification-lane.d.ts +3 -1
- package/dist/core/runner/run-notification-lane.js +16 -10
- package/dist/core/runner/run-settle-and-teardown.js +5 -1
- package/dist/core/runner/run-stop-and-final-verify.d.ts +4 -0
- package/dist/core/runner/run-stop-and-final-verify.js +12 -4
- package/dist/core/runner/run-turn-boundary.js +12 -7
- package/dist/core/runner/runtask.d.ts +7 -4
- package/dist/core/runner/runtask.js +19 -11
- package/dist/core/runner/skills-seat.js +2 -2
- package/dist/core/runner/sub-agent-deny-lists.js +10 -7
- package/dist/core/runner/synthetic-tools.js +2 -2
- package/dist/core/runner/tool-disclosure.js +0 -2
- package/dist/core/runner/tool-face-overlay.d.ts +1 -1
- package/dist/core/runner/tool-face-overlay.js +26 -19
- package/dist/core/runner/tool-result-media-seat.d.ts +9 -1
- package/dist/core/runner/tool-result-media-seat.js +17 -1
- package/dist/core/runner/turn-attachments.d.ts +3 -5
- package/dist/core/runner/turn-attachments.js +3 -16
- package/dist/core/runner-deps.d.ts +31 -18
- package/dist/core/secret-env.d.ts +3 -2
- package/dist/core/session-policy-store.d.ts +9 -2
- package/dist/core/session-policy-store.js +16 -1
- package/dist/core/session-store.d.ts +3 -2
- package/dist/core/session-store.js +50 -11
- package/dist/core/skill-grant.d.ts +9 -0
- package/dist/core/skill-grant.js +18 -0
- package/dist/core/store-contracts/tool-result-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/tool-result-store-contract.js +37 -0
- package/dist/core/stub-env.d.ts +5 -5
- package/dist/core/stub-env.js +11 -1
- package/dist/core/swappable-deps.d.ts +17 -43
- package/dist/core/swappable-deps.js +15 -5
- package/dist/core/synthetic-read-verdict.d.ts +1 -1
- package/dist/core/task-event.d.ts +18 -2
- package/dist/core/task-notification.d.ts +88 -5
- package/dist/core/task-notification.js +130 -7
- package/dist/core/task-registry-agent.d.ts +18 -12
- package/dist/core/task-registry-agent.js +18 -6
- package/dist/core/task-registry-monitor.d.ts +7 -0
- package/dist/core/task-registry-monitor.js +28 -1
- package/dist/core/task-registry-shared.d.ts +38 -3
- package/dist/core/task-registry-shared.js +21 -7
- package/dist/core/task-registry-workflow.js +1 -1
- package/dist/core/task-registry.d.ts +50 -35
- package/dist/core/task-registry.js +64 -23
- package/dist/core/task-result.d.ts +3 -12
- package/dist/core/task-spec.d.ts +3 -6
- package/dist/core/task-stream.d.ts +1 -1
- package/dist/core/tool-catalog-entries.js +1 -1
- package/dist/core/tool-face-reader.d.ts +7 -6
- package/dist/core/tool-face-reader.js +4 -3
- package/dist/core/tool-name-aliases.d.ts +19 -0
- package/dist/core/tool-name-aliases.js +54 -2
- package/dist/core/tool-policy.d.ts +5 -4
- package/dist/core/tool-policy.js +1 -1
- package/dist/core/tool-registry.d.ts +5 -5
- package/dist/core/tool-registry.js +2 -2
- package/dist/core/tool-result-store.d.ts +88 -5
- package/dist/core/tool-result-store.js +51 -12
- package/dist/core/tool-spec.d.ts +20 -4
- package/dist/core/trace.d.ts +0 -1
- package/dist/core/types.d.ts +3 -3
- package/dist/core/types.js +1 -1
- package/dist/core/untrusted-text.js +1 -1
- package/dist/core/user-attachment.d.ts +10 -5
- package/dist/core/user-attachment.js +14 -6
- package/dist/engine/execution-env/node-execution-env.d.ts +7 -2
- package/dist/engine/execution-env/node-execution-env.js +12 -1
- package/dist/engine/harness/agent-harness.d.ts +1 -1
- package/dist/engine/harness/agent-harness.js +8 -4
- package/dist/engine/harness/types.d.ts +112 -29
- package/dist/engine/loop/agent-loop.d.ts +12 -12
- package/dist/engine/loop/agent-loop.js +153 -21
- package/dist/engine/loop/types.d.ts +9 -2
- package/dist/engine/lsp/node-lsp-manager.d.ts +3 -3
- package/dist/engine/lsp/node-lsp-manager.js +32 -13
- package/dist/index.d.ts +22 -14
- package/dist/index.js +15 -10
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts +9 -3
- package/dist/orchestration/run-workflow-tool.js +59 -29
- package/dist/orchestration/workflow-governance.d.ts +1 -1
- package/dist/orchestration/workflow-governance.js +2 -1
- package/dist/orchestration/workflow.d.ts +4 -0
- package/dist/orchestration/workflow.js +25 -4
- package/dist/prompts/default.d.ts +1 -10
- package/dist/prompts/default.js +0 -2
- package/dist/stores/file/background-agent-store.d.ts +1 -1
- package/dist/stores/file/background-agent-store.js +3 -1
- package/dist/stores/file/checkpoint-store.d.ts +127 -2
- package/dist/stores/file/checkpoint-store.js +19 -14
- package/dist/stores/file/file-history-store.d.ts +1 -1
- package/dist/stores/file/file-history-store.js +3 -1
- package/dist/stores/file/index.d.ts +4 -3
- package/dist/stores/file/index.js +17 -8
- package/dist/stores/file/mailbox-store.d.ts +1 -1
- package/dist/stores/file/mailbox-store.js +3 -1
- package/dist/stores/file/memory-store.d.ts +1 -1
- package/dist/stores/file/memory-store.js +3 -1
- package/dist/stores/file/session-policy-store.d.ts +1 -1
- package/dist/stores/file/session-policy-store.js +3 -1
- package/dist/stores/file/session-store.d.ts +1 -1
- package/dist/stores/file/session-store.js +3 -1
- package/dist/stores/file/shared-ledger.d.ts +26 -0
- package/dist/stores/file/shared-ledger.js +38 -9
- package/dist/stores/file/tool-result-store.d.ts +20 -2
- package/dist/stores/file/tool-result-store.js +74 -6
- package/dist/stores/file/usage-window-store.d.ts +1 -1
- package/dist/stores/file/usage-window-store.js +3 -1
- package/dist/stores/file/workflow-journal-store.d.ts +1 -11
- package/dist/stores/file/workflow-journal-store.js +3 -2
- package/dist/tools/fs/containment-face.d.ts +5 -0
- package/dist/tools/fs/encoding.d.ts +13 -4
- package/dist/tools/fs/encoding.js +17 -2
- package/dist/tools/fs/fs-bash-background-text.d.ts +7 -0
- package/dist/tools/fs/fs-bash-background-text.js +1 -0
- package/dist/tools/fs/fs-bash.d.ts +8 -4
- package/dist/tools/fs/fs-bash.js +26 -35
- package/dist/tools/fs/fs-pdf.d.ts +2 -2
- package/dist/tools/fs/fs-pdf.js +26 -21
- package/dist/tools/fs/fs-read.d.ts +5 -4
- package/dist/tools/fs/fs-read.js +35 -18
- package/dist/tools/fs/fs-search-tools.js +4 -1
- package/dist/tools/fs/fs-shared.d.ts +11 -13
- package/dist/tools/fs/fs-shared.js +11 -7
- package/dist/tools/fs/fs-write.js +5 -5
- package/dist/tools/fs/index.d.ts +14 -8
- package/dist/tools/fs/index.js +8 -4
- package/dist/tools/fs/read-floor.d.ts +44 -1
- package/dist/tools/fs/read-floor.js +35 -0
- package/dist/tools/fs/removal-targets.d.ts +9 -4
- package/dist/tools/fs/removal-targets.js +17 -9
- package/dist/tools/fs/search.d.ts +3 -3
- package/dist/tools/fs/search.js +4 -4
- package/dist/tools/monitor.d.ts +5 -4
- package/dist/tools/monitor.js +15 -8
- package/dist/tools/scheduler-tools.js +42 -4
- package/dist/tools/web.d.ts +0 -10
- package/dist/tools/web.js +1 -4
- package/package.json +4 -2
- package/test/export-surface.snapshot.json +75 -21
- package/wire-changes/core-stores-sql@7.60.0.json +30 -0
- package/wire-changes/core@7.60.0.json +3274 -0
- package/wire-changes/mods-kernel@7.60.0.json +62 -0
- package/wire-changes/primitives@7.60.0.json +30 -0
|
@@ -84,8 +84,8 @@ export interface PrepareBoundaryParksInput {
|
|
|
84
84
|
resourceSuspendEligible: boolean;
|
|
85
85
|
/** borrowed-readonly — the wiring-manifest phase's durable-infra predicate: exposes `suspendForPlatformLimit`. */
|
|
86
86
|
durableSuspendInfraReady: boolean;
|
|
87
|
-
/** borrowed-readonly — the
|
|
88
|
-
|
|
87
|
+
/** borrowed-readonly — why the per-task remote env is in neither suspend target, or undefined (the review lane refuses loudly). */
|
|
88
|
+
suspendTargetGap: string | undefined;
|
|
89
89
|
}
|
|
90
90
|
export interface PrepareBoundaryParksResult {
|
|
91
91
|
/** owned — the task-axis resource lane (`Prepared.suspendForResource`), or undefined (no opt-in / no infra / inactive). */
|
|
@@ -4,7 +4,7 @@ import { defaultTaskRegistry } from "../task-registry.js";
|
|
|
4
4
|
import { DEFAULT_RESOURCE_TTL_MS, publishCommittedSuspend, sanitizedTtlMs, USAGE_WINDOW_REAP_MARGIN_MS } from "./park-commit.js";
|
|
5
5
|
import { remoteEnvFailureNote } from "./remote-env-retry.js";
|
|
6
6
|
export function prepareBoundaryParks(input) {
|
|
7
|
-
const { saga, spec, checkpointStore, checkpointScope, abortController, harness, session, sessions, sessionId, deps, priorLedger, maxSlices, maxSuspends, resourceTotal, priorSuspendCount, suspendChainBase, humanReviewRef, liveSpendRef, now, pausedRef, remoteEnvFailures, resourceSuspendEligible, durableSuspendInfraReady,
|
|
7
|
+
const { saga, spec, checkpointStore, checkpointScope, abortController, harness, session, sessions, sessionId, deps, priorLedger, maxSlices, maxSuspends, resourceTotal, priorSuspendCount, suspendChainBase, humanReviewRef, liveSpendRef, now, pausedRef, remoteEnvFailures, resourceSuspendEligible, durableSuspendInfraReady, suspendTargetGap } = input;
|
|
8
8
|
if (saga === undefined)
|
|
9
9
|
return { suspendForResource: undefined, suspendForPlatformLimit: undefined, suspendForReview: undefined };
|
|
10
10
|
const { inFlightSpendMicroUsd, serializeCheckpointState, commitSuspendSaga, suspendLoopCapHit, suspendableEnv, parkOnlyRemoteEnv, parkOnlyHandle } = saga;
|
|
@@ -83,9 +83,9 @@ export function prepareBoundaryParks(input) {
|
|
|
83
83
|
return false;
|
|
84
84
|
if (abortController.signal.aborted)
|
|
85
85
|
return false;
|
|
86
|
-
if (
|
|
86
|
+
if (suspendTargetGap !== undefined) {
|
|
87
87
|
try {
|
|
88
|
-
deps.onError?.(new Error(`plan_review park skipped: the per-task execution env
|
|
88
|
+
deps.onError?.(new Error(`plan_review park skipped: the per-task execution env ${suspendTargetGap}, so its workspace could not be restored on resume (the plan-review request was dropped; the run continues without pausing)`), { phase: "config", sessionId });
|
|
89
89
|
}
|
|
90
90
|
catch {
|
|
91
91
|
}
|
|
@@ -105,6 +105,8 @@ export interface PrepareCapsAndWorkflowInput {
|
|
|
105
105
|
offload?: boolean;
|
|
106
106
|
offloadThresholdChars?: number;
|
|
107
107
|
}) => AgentTool;
|
|
108
|
+
/** borrowed-readonly — where a workflow run's full record is stored when its completion carries less (the driver's one mint). */
|
|
109
|
+
taskArtifacts: import("../tool-result-store.js").TaskArtifactSeat | undefined;
|
|
108
110
|
/** borrowed-readonly — the plan-review primitive the ExitPlanMode tool calls. */
|
|
109
111
|
requestReview: (opts?: import("../present-plan-tool.js").ReviewRequest) => void;
|
|
110
112
|
/** borrowed-readonly — the declared session plan file as ExitPlanMode's FILE arm reads it (absent ⇒ the parameter arm). */ planFileSource?: PlanFileSource;
|
|
@@ -144,6 +146,8 @@ export interface PrepareCapsAndWorkflowInput {
|
|
|
144
146
|
artifact: PromptArtifact;
|
|
145
147
|
sourceRevision?: string;
|
|
146
148
|
} | undefined;
|
|
149
|
+
/** borrowed-readonly — LATE-BOUND: the leg's agent stations; the Workflow mount's getter reads them at ITS call time. */
|
|
150
|
+
agentStations: () => import("../mods/agent-stations.js").AgentStations | undefined;
|
|
147
151
|
}
|
|
148
152
|
export interface PrepareCapsAndWorkflowResult {
|
|
149
153
|
/** owned — THE run's roster BUILDER (the mount array is private to it; `Prepared.tools` is its read face,
|
|
@@ -117,7 +117,7 @@ function autoModeArmReasonOf(intent, facePresent, caps, capsFaulted) {
|
|
|
117
117
|
return { armed: true, reason: "armed" };
|
|
118
118
|
}
|
|
119
119
|
export async function prepareCapsAndWorkflow(input) {
|
|
120
|
-
const { spec, deps, parentSpecSeat, checkpointSeat, internals, session, sessionId, runId, hostTaskId, taskScope, taskRootFinal, model, thinking, lockedPreflight, toolEffects, toolFaceSnapshot, promptLean, resolvedInteractionPosture, harnessRef, askSeat, runClampSource, forwardEvent, inheritedGateForChildren, enrichSpecToolCtx, maybeOffload, requestReview, enterPlanMode, permissionMode, readDenyEntries, peerLaneActive, peerSendMessageBuiltIn, runnerSelf, delegated, sideCallBookRef } = input;
|
|
120
|
+
const { spec, deps, parentSpecSeat, checkpointSeat, internals, session, sessionId, runId, hostTaskId, taskScope, taskRootFinal, model, thinking, lockedPreflight, toolEffects, toolFaceSnapshot, promptLean, resolvedInteractionPosture, harnessRef, askSeat, runClampSource, forwardEvent, inheritedGateForChildren, enrichSpecToolCtx, maybeOffload, taskArtifacts, requestReview, enterPlanMode, permissionMode, readDenyEntries, peerLaneActive, peerSendMessageBuiltIn, runnerSelf, delegated, sideCallBookRef } = input;
|
|
121
121
|
const roster = new RosterBuilder(toolEffects);
|
|
122
122
|
for (const t of spec.tools ?? []) {
|
|
123
123
|
const mounted = mountCallerTool(t);
|
|
@@ -238,7 +238,7 @@ export async function prepareCapsAndWorkflow(input) {
|
|
|
238
238
|
const classifierRungs = classifierLadderRungs(am.classifierFallback, classifierModel, model);
|
|
239
239
|
const denialTracking = createAutoModeDenialTracker(am.denialLimit);
|
|
240
240
|
const decider = createAutoModeDecider({
|
|
241
|
-
...(am.timeoutMs !== undefined ? { timeoutMs: am.timeoutMs } : {}),
|
|
241
|
+
...(am.timeoutMs !== undefined ? { timeoutMs: am.timeoutMs } : {}), ...(am.rateLimitBreakAfter !== undefined ? { rateLimitBreakAfter: am.rateLimitBreakAfter } : {}),
|
|
242
242
|
candidates: classifierRungs.map((m) => m.id),
|
|
243
243
|
onClassified: classifierRoundObserver({ tracer: deps.tracer, onNotice: deps.onNotice, taskId: hostTaskId, seatModelId: classifierModel.id, ...(sessionId !== undefined ? { sessionId } : {}), ...(runId !== undefined ? { runId } : {}) }),
|
|
244
244
|
assemble: async (input) => {
|
|
@@ -333,7 +333,7 @@ export async function prepareCapsAndWorkflow(input) {
|
|
|
333
333
|
originatingSessionId: sessionId,
|
|
334
334
|
rootSessionId: internals?.rootSessionId ?? sessionId, ...(internals?.placementRoot !== undefined ? { placementRoot: internals.placementRoot } : {}), crossBoundaryTree: input.crossBoundaryTree,
|
|
335
335
|
taskRegistry: defaultTaskRegistry,
|
|
336
|
-
taskNotification: internals?.onTaskNotification,
|
|
336
|
+
taskNotification: internals?.onTaskNotification, ...(taskArtifacts !== undefined ? { taskArtifacts } : {}),
|
|
337
337
|
taskOwner: hostTaskId,
|
|
338
338
|
limits: deps.workflowLimits,
|
|
339
339
|
sourceTaskId: hostTaskId,
|
|
@@ -364,6 +364,7 @@ export async function prepareCapsAndWorkflow(input) {
|
|
|
364
364
|
return assembleParentCaptureState(co?.optedOut() ?? false, co?.indeterminate() ?? false, ctl, [...(internals?.memoryCaptureAncestors ?? []), { sessionId, ...(ctl !== undefined ? { controlDir: ctl } : {}) }]);
|
|
365
365
|
},
|
|
366
366
|
autoModeReview: () => (autoModeDeciderRef.current !== undefined ? { decider: autoModeDeciderRef.current } : undefined),
|
|
367
|
+
agentStations: input.agentStations,
|
|
367
368
|
workflowDepth: internals?.workflowDepth,
|
|
368
369
|
parentCwd: taskRootFinal,
|
|
369
370
|
parentThinking: () => childThinkingSeat(undefined, deploymentSubagentThinking(runnerSelf.agentCatalog?.roles), harnessRef.current?.getThinkingLevel() ?? thinking).thinking,
|
|
@@ -26,7 +26,7 @@ import { type CrossBoundaryPosture } from "../cross-boundary-taint.js";
|
|
|
26
26
|
import { type HostFloor } from "../host-floor.js";
|
|
27
27
|
import { type CheckpointState } from "../checkpoint-store.js";
|
|
28
28
|
import { runOriginOfLeg, type RunOrigin } from "../run-origin.js";
|
|
29
|
-
import { type ConfigDoorEntry, type LockedPreflight } from "../locked-config.js";
|
|
29
|
+
import { type ConfigDoorEntry, type LockedPreflight, type ReceivedPeerDeclarations } from "../locked-config.js";
|
|
30
30
|
import { type ResolvedRole } from "../roles.js";
|
|
31
31
|
import { type ResolvedSkillListingBudget } from "../skill-listing-budget.js";
|
|
32
32
|
import type { SessionStore } from "../session.js";
|
|
@@ -133,6 +133,8 @@ export interface PrepareConfigDoorsResult {
|
|
|
133
133
|
* `spec.agents` was set, in which case it is a shallow copy whose `tools` is the
|
|
134
134
|
* withAgents-rebuilt roster. Every later phase (the safety scan above all — T21) must read THIS, never the original input. */
|
|
135
135
|
spec: RosterSpec;
|
|
136
|
+
/** The deps the leg reads from here on: the caller's, with the deployment role map's one receipt in place of the live map. */
|
|
137
|
+
deps: RunnerDeps;
|
|
136
138
|
/** owned — the frozen task-start copies of the caller's tool-face control arrays; the driver compiles the leg's selector
|
|
137
139
|
* from them, and the selector (with the disclosure lists) is the ONLY thing later face reads consult. Frozen-immutable. */
|
|
138
140
|
toolFaceLists: ToolFaceLists;
|
|
@@ -243,6 +245,8 @@ type ConfigValueDoorsResult = Pick<PrepareConfigDoorsResult, "toolFaceLists" | "
|
|
|
243
245
|
};
|
|
244
246
|
skills: TaskSpec["skills"];
|
|
245
247
|
projectMemory: TaskSpec["projectMemory"];
|
|
248
|
+
deploymentRoles: RunnerDeps["roles"];
|
|
249
|
+
taskRoles: TaskSpec["roles"];
|
|
246
250
|
};
|
|
247
251
|
/**
|
|
248
252
|
* The phase's VALUE doors as ONE function with two callers — each judges a declared value against its own vocabulary, reading only the
|
|
@@ -259,6 +263,7 @@ export declare function configValueDoors(input: {
|
|
|
259
263
|
sessions: SessionStore;
|
|
260
264
|
holder?: string | undefined;
|
|
261
265
|
resumedRow?: Parameters<typeof runOriginOfLeg>[1];
|
|
266
|
+
receivedPeers?: ReceivedPeerDeclarations;
|
|
262
267
|
}, enter?: ConfigDoorEntry): ConfigValueDoorsResult;
|
|
263
268
|
/**
|
|
264
269
|
* The doors a RESUMED leg's prepare refuses at, run as one screen BEFORE the claim — prepare's own functions, so a refusal carries
|
|
@@ -29,7 +29,7 @@ import { effectiveTraitsOf, readModelPromptTraits, resolveHost, resolvePromptLea
|
|
|
29
29
|
import { assertNoRetiredKeys, RETIRED_MODEL_KEYS } from "../retired-keys.js";
|
|
30
30
|
import { resolvePromptBinding } from "../../prompt-assembly/overlay.js";
|
|
31
31
|
import { assertPeerPresenceValue } from "../../agents/peer-directory.js";
|
|
32
|
-
import { snapshotDefinitionLists } from "../../agents/
|
|
32
|
+
import { snapshotDefinitionLists } from "../../agents/agent-definition.js";
|
|
33
33
|
import { mcpUnavailableOn, TOTAL_TOKENS_REMINDER_MODES } from "./turn-attachments.js";
|
|
34
34
|
import { refuseRetiredMember, rosterFaceOf } from "./caller-roster.js";
|
|
35
35
|
import { assertToolBoundaryLegs } from "../tool-roster.js";
|
|
@@ -183,7 +183,8 @@ export function assertResumeConfigRecord(config) {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
export function configValueDoors(input, enter = ENTER_AS_IS) {
|
|
186
|
-
const { spec,
|
|
186
|
+
const { spec, resumeLeg, sessions, holder } = input;
|
|
187
|
+
let deps = input.deps;
|
|
187
188
|
enter("deps", () => assertNoRetiredRunnerDeps(deps));
|
|
188
189
|
enter("taskConfig", () => assertPrincipalValue(spec.principal));
|
|
189
190
|
const runOrigin = enter("taskConfig", () => runOriginOfLeg(spec.runOrigin, input.resumedRow));
|
|
@@ -225,8 +226,10 @@ export function configValueDoors(input, enter = ENTER_AS_IS) {
|
|
|
225
226
|
: undefined,
|
|
226
227
|
};
|
|
227
228
|
const promptHost = enter("taskConfig", () => resolveHost(spec));
|
|
228
|
-
enter("deps", () => screenRoleMap(deps.roles, "RunnerDeps.roles"));
|
|
229
|
-
|
|
229
|
+
const deploymentRoles = enter("deps", () => screenRoleMap(deps.roles, "RunnerDeps.roles"));
|
|
230
|
+
if (deploymentRoles !== undefined)
|
|
231
|
+
deps = { ...deps, roles: deploymentRoles };
|
|
232
|
+
const taskRoles = enter("taskConfig", () => screenRoleMap(spec.roles, "TaskSpec.roles"));
|
|
230
233
|
const promptBinding = enter("taskConfig", () => resolvePromptBinding(spec));
|
|
231
234
|
const promptLean = enter("taskConfig", () => resolvePromptLean(spec));
|
|
232
235
|
if (spec.resumeAt !== undefined)
|
|
@@ -297,7 +300,7 @@ export function configValueDoors(input, enter = ENTER_AS_IS) {
|
|
|
297
300
|
e.code = "config.empty_objective";
|
|
298
301
|
throw e;
|
|
299
302
|
}
|
|
300
|
-
const lockedPreflight = preflightLockedConfig(spec, deps, enter);
|
|
303
|
+
const lockedPreflight = preflightLockedConfig(spec, deps, enter, input.receivedPeers);
|
|
301
304
|
const declaredSkills = spec.skills;
|
|
302
305
|
const skills = declaredSkills === undefined ? undefined : enter("taskConfig", () => readSkillsSeat(declaredSkills));
|
|
303
306
|
enter("deps", () => screenHandsBandOptions(deps.hands));
|
|
@@ -342,7 +345,7 @@ export function configValueDoors(input, enter = ENTER_AS_IS) {
|
|
|
342
345
|
}));
|
|
343
346
|
if (taskStore !== undefined)
|
|
344
347
|
enter("taskConfig", () => assertRetentionWords({ ...retention, stores: [{ name: "checkpointStore", store: taskStore }] }));
|
|
345
|
-
return { toolFaceLists, promptHost, promptBinding, promptLean, lockedPreflight, skillListingSeats, skills, projectMemory, microCompactKnob, memoryDelegationEvidence, memoryProvenance, memoryCapturePolicy, usageWindows, brainCallGuardrailMs, crossBoundaryPosture, advisorTool, hostFloor, runOrigin };
|
|
348
|
+
return { toolFaceLists, promptHost, promptBinding, promptLean, lockedPreflight, skillListingSeats, skills, projectMemory, microCompactKnob, memoryDelegationEvidence, memoryProvenance, memoryCapturePolicy, usageWindows, brainCallGuardrailMs, crossBoundaryPosture, advisorTool, hostFloor, runOrigin, deploymentRoles, taskRoles };
|
|
346
349
|
}
|
|
347
350
|
export function refuseResumeDoors(config, recorded, deps, sessions, holder) {
|
|
348
351
|
asResumeConfigRefusal("taskConfig", () => {
|
|
@@ -359,13 +362,14 @@ export function refuseResumeDoors(config, recorded, deps, sessions, holder) {
|
|
|
359
362
|
return { ...config, ...(config.mcp !== undefined ? { mcp: lockedPreflight.mcp ?? [] } : {}), ...(config.a2a !== undefined ? { a2a: lockedPreflight.a2a ?? [] } : {}), skills };
|
|
360
363
|
}
|
|
361
364
|
export function prepareConfigDoors(input) {
|
|
362
|
-
const {
|
|
365
|
+
const { sessions, resume, internals } = input;
|
|
363
366
|
assertToolBoundaryLegs(input.spec.tools);
|
|
364
367
|
assertToolCardDeclarations(input.spec.tools);
|
|
365
368
|
let spec = input.spec;
|
|
366
|
-
const { toolFaceLists, promptHost, promptBinding, promptLean, lockedPreflight, skillListingSeats, skills, projectMemory, microCompactKnob, memoryDelegationEvidence, memoryProvenance, memoryCapturePolicy, usageWindows, brainCallGuardrailMs, crossBoundaryPosture, advisorTool, hostFloor, runOrigin } = configValueDoors({ spec, deps, resumeLeg: resume !== undefined, sessions, holder: internals?.holder, ...(resume !== undefined ? { resumedRow: { recorded: screenRecordedRunOrigin(resume.seed.runOrigin), ...(resume.opening !== undefined ? { opening: resume.opening } : {}) } } : {}) });
|
|
369
|
+
const { toolFaceLists, promptHost, promptBinding, promptLean, lockedPreflight, skillListingSeats, skills, projectMemory, microCompactKnob, memoryDelegationEvidence, memoryProvenance, memoryCapturePolicy, usageWindows, brainCallGuardrailMs, crossBoundaryPosture, advisorTool, hostFloor, runOrigin, deploymentRoles, taskRoles } = configValueDoors({ spec, deps: input.deps, resumeLeg: resume !== undefined, sessions, holder: internals?.holder, ...(internals?.receivedPeers !== undefined ? { receivedPeers: internals.receivedPeers } : {}), ...(resume !== undefined ? { resumedRow: { recorded: screenRecordedRunOrigin(resume.seed.runOrigin), ...(resume.opening !== undefined ? { opening: resume.opening } : {}) } } : {}) });
|
|
367
370
|
const doorRead = (value) => ({ value, enumerable: value !== undefined, writable: false, configurable: false });
|
|
368
|
-
|
|
371
|
+
const deps = deploymentRoles !== undefined ? { ...input.deps, roles: deploymentRoles } : input.deps;
|
|
372
|
+
spec = Object.create(Object.getPrototypeOf(spec), { ...Object.getOwnPropertyDescriptors(spec), skills: doorRead(skills), projectMemory: doorRead(projectMemory), runOrigin: doorRead(runOrigin), ...(taskRoles !== undefined ? { roles: doorRead(taskRoles) } : {}) });
|
|
369
373
|
const resolvedInteractionPosture = spec.interactionPosture ?? internals?.parentInteractionPosture ?? deps.interactionPosture;
|
|
370
374
|
const askSeat = resolveAskSeat(spec, deps);
|
|
371
375
|
{
|
|
@@ -492,6 +496,7 @@ export function prepareConfigDoors(input) {
|
|
|
492
496
|
const compModel = resolveCompactionModel(spec, deps, "TaskSpec.compactionModel");
|
|
493
497
|
return {
|
|
494
498
|
spec,
|
|
499
|
+
deps,
|
|
495
500
|
toolFaceLists,
|
|
496
501
|
promptLean,
|
|
497
502
|
promptTraits,
|
|
@@ -29,9 +29,9 @@ import type { PrepareResume, RunInternals, RunnerSelfSeat, ToolFaceSnapshot } fr
|
|
|
29
29
|
import { RosterBuilder } from "../tool-roster.js";
|
|
30
30
|
export interface PrepareDelegationSurfaceInput {
|
|
31
31
|
/** borrowed-readonly — the REBOUND spec. Read: `tools` (the shadow checks and the revival spawner's delegation-tool
|
|
32
|
-
* lookup), `
|
|
33
|
-
*
|
|
34
|
-
spec: Pick<TaskSpec, "tools" | "
|
|
32
|
+
* lookup), `retainBackgroundProcesses` (the Monitor receipt), `handsReadOnly` is NOT read here (the hands mount
|
|
33
|
+
* decided the surface). Never mutated. */
|
|
34
|
+
spec: Pick<TaskSpec, "tools" | "retainBackgroundProcesses" | "excludeAllTools">;
|
|
35
35
|
/** borrowed-readonly — the deployment seats the mounts read: `workflowRunStore` / `backgroundAgentStore` / `mailboxStore` (the
|
|
36
36
|
* read/kill faces and the tier-3 revival seams), `rosterStore`, `peerLane`, `peerDirectory`, `peerChannel`, `onNotice`,
|
|
37
37
|
* `onBackgroundChildEvent`, `tracer`. */
|
|
@@ -99,6 +99,8 @@ export interface PrepareDelegationSurfaceInput {
|
|
|
99
99
|
/** borrowed-readonly — the run's offload store, or undefined when offload is disabled (then no reader mounts and the
|
|
100
100
|
* read/kill faces spill nowhere). */
|
|
101
101
|
offloadStore: ToolResultStore | undefined;
|
|
102
|
+
/** borrowed-readonly — where a cut completion's full result is stored (the driver's one mint over `offloadStore`). */
|
|
103
|
+
taskArtifacts: import("../tool-result-store.js").TaskArtifactSeat | undefined;
|
|
102
104
|
/** borrowed-readonly — the retain ledger the SendMessage mount continues children through (absent ⇒ honest not-retained). */
|
|
103
105
|
subagentRetain: SubagentRetainLedger | undefined;
|
|
104
106
|
/** borrowed-readonly — the caller-tool ctx enrichment: the revival spawner re-enters the delegation tool through it, and
|
|
@@ -13,7 +13,7 @@ import { deliverEngineNotice } from "../types.js";
|
|
|
13
13
|
import { RosterBuilder } from "../tool-roster.js";
|
|
14
14
|
import { sendMessageContinuationSeats } from "./send-message-continuation.js";
|
|
15
15
|
export function prepareDelegationSurface(input) {
|
|
16
|
-
const { spec, deps, internals, resume, sessionId, hostTaskId, taskScope, taskRootFinal, taskRootCanonical, executionEnv, runnerSelf, backgroundTaskToolsActive, workflowToolsActive, peerLaneActive, peerSendMessageBuiltIn, peerLaneRefs, sessionBox, roster, axisExplicitNegatives, envHandToolNames, toolFaceSnapshot, firstPartyOffload, offloadStore, subagentRetain, enrichSpecToolCtx, checkpointSeat, handsCwdRef, wsSnapshot, rebaseWsPath, rebaseRestoredPath, workspaceStateSettle, worktreeSeat } = input;
|
|
16
|
+
const { spec, deps, internals, resume, sessionId, hostTaskId, taskScope, taskRootFinal, taskRootCanonical, executionEnv, runnerSelf, backgroundTaskToolsActive, workflowToolsActive, peerLaneActive, peerSendMessageBuiltIn, peerLaneRefs, sessionBox, roster, axisExplicitNegatives, envHandToolNames, toolFaceSnapshot, firstPartyOffload, offloadStore, taskArtifacts, subagentRetain, enrichSpecToolCtx, checkpointSeat, handsCwdRef, wsSnapshot, rebaseWsPath, rebaseRestoredPath, workspaceStateSettle, worktreeSeat } = input;
|
|
17
17
|
let worktreeSessionRef;
|
|
18
18
|
const delegationSurfaceActive = backgroundTaskToolsActive || workflowToolsActive;
|
|
19
19
|
const leaves = valveLeaves(spec, toolFaceSnapshot.selector);
|
|
@@ -21,7 +21,7 @@ export function prepareDelegationSurface(input) {
|
|
|
21
21
|
if (delegationSurfaceActive || internals?.parentNotify !== undefined || peerLaneActive) {
|
|
22
22
|
if (delegationSurfaceActive) {
|
|
23
23
|
roster.mountAll([
|
|
24
|
-
firstPartyOffload(createTaskOutputTool({ registry: defaultTaskRegistry, owner: hostTaskId, scope: taskScope, sessionId, workflowStore: deps.workflowRunStore, agentStore: deps.backgroundAgentStore, notificationWired: internals?.onTaskNotification !== undefined,
|
|
24
|
+
firstPartyOffload(createTaskOutputTool({ registry: defaultTaskRegistry, owner: hostTaskId, scope: taskScope, sessionId, workflowStore: deps.workflowRunStore, agentStore: deps.backgroundAgentStore, notificationWired: internals?.onTaskNotification !== undefined, toolResultStore: offloadStore, ...(checkpointSeat !== undefined ? { checkpointSeat } : {}) })),
|
|
25
25
|
firstPartyOffload(createTaskStopTool({ registry: defaultTaskRegistry, owner: hostTaskId, scope: taskScope, sessionId, workflowStore: deps.workflowRunStore, agentStore: deps.backgroundAgentStore })),
|
|
26
26
|
], { source: "builtin", mountedBy: "delegation" });
|
|
27
27
|
}
|
|
@@ -36,7 +36,7 @@ export function prepareDelegationSurface(input) {
|
|
|
36
36
|
owner: hostTaskId,
|
|
37
37
|
scope: taskScope,
|
|
38
38
|
...(sessionId !== undefined ? { sessionId } : {}),
|
|
39
|
-
...(internals?.onTaskNotification !== undefined ? { notify: internals.onTaskNotification } : {}), ...(
|
|
39
|
+
...(internals?.onTaskNotification !== undefined ? { notify: internals.onTaskNotification } : {}), ...(taskArtifacts !== undefined ? { taskArtifacts } : {}),
|
|
40
40
|
...(internals?.onSubagentSpawn !== undefined ? { sink: internals.onSubagentSpawn } : {}),
|
|
41
41
|
...(internals?.parentNotify !== undefined
|
|
42
42
|
? { uplink: internals.parentNotify, ...(internals.parentPeerRef !== undefined ? { uplinkRecipient: internals.parentPeerRef } : {}) }
|
|
@@ -126,6 +126,6 @@ export function prepareDelegationSurface(input) {
|
|
|
126
126
|
roster.mountAll(createWorktreeTools(executionEnv, { repoRoot: taskRootFinal, cwdRef: handsCwdRef, session: worktreeSessionRef }).map((t) => (envHandToolNames.add(t.name), firstPartyOffload(t))), { source: "builtin", mountedBy: "hands" });
|
|
127
127
|
}
|
|
128
128
|
if (offloadStore)
|
|
129
|
-
roster.mount(createReadToolResultTool(offloadStore), { source: "builtin", mountedBy: "optional" });
|
|
129
|
+
roster.mount(createReadToolResultTool(offloadStore, (ref, tree) => defaultTaskRegistry.artifactBoundaryLegs(ref, { owner: hostTaskId, scope: taskScope, sessionId }, tree)), { source: "builtin", mountedBy: "optional" });
|
|
130
130
|
return { delegationSurfaceActive, worktreeSessionRef };
|
|
131
131
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PrepareTask's file-history phase, verbatim from the driver: the DV-14 first-touch
|
|
3
|
-
* policy door, the `RunnerDeps.fileHistoryStore` / `fileHistoryCapture` and `TaskSpec.fileHistory` bad-value doors, the
|
|
4
|
-
* split, the restoreFiles / resumeAt / rewindFilesTo combination gates, the run's history coordinates
|
|
3
|
+
* policy door, the `RunnerDeps.fileHistoryStore` / `fileHistoryCapture` and `TaskSpec.fileHistory` bad-value doors, the restoreFiles / resumeAt / rewindFilesTo combination gates, the run's history coordinates
|
|
5
4
|
* (canonical root, recording scope, filesystem identity), the fork carry, the child-scope refusal, the
|
|
6
5
|
* rewind RESTORE itself (anchor translation in "before" mode, the per-file ledger, partial-restore
|
|
7
6
|
* policy), the `trackFileEdit` hook the hands band calls before every mutation lane, and the turn-start
|
|
@@ -32,8 +31,7 @@ export interface PrepareFileHistoryInput {
|
|
|
32
31
|
/** borrowed-readonly — the deployment seats this phase reads: the first-touch failure policy, the history
|
|
33
32
|
* store and its capture switch (all validated HERE, once), the incident sink, and the retired-epoch diagnostic probe. */
|
|
34
33
|
deps: Pick<RunnerDeps, "onError">;
|
|
35
|
-
/** borrowed-readonly — the REBOUND spec's rewind request fields and off-switch word
|
|
36
|
-
* spelling is read off the same object as an unknown key) and the caller's cancel signal for the restore. */
|
|
34
|
+
/** borrowed-readonly — the REBOUND spec's rewind request fields and off-switch word and the caller's cancel signal for the restore. */
|
|
37
35
|
spec: Pick<TaskSpec, "resumeAt" | "restoreFiles" | "acceptPartialRestore" | "signal">;
|
|
38
36
|
/** borrowed-readonly — the request door's resolution ({@link resolveFileHistoryRequest}), judged before the session was
|
|
39
37
|
* acquired: every refusal the request and the deployment's seats decide on their own has already thrown. */
|
|
@@ -125,14 +123,14 @@ export declare function resolveFileHistoryScope(lineage: RunInternals["fileHisto
|
|
|
125
123
|
/**
|
|
126
124
|
* WHICH filesystem an env is a view of — the second coordinate of tree identity for the file-history
|
|
127
125
|
* lineage, read from what the env's MINTER states rather than inferred from a path:
|
|
128
|
-
* ·
|
|
129
|
-
*
|
|
130
|
-
* ·
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
126
|
+
* · an env that DECLARES its paths host-local (`pathsAreHostLocal` — `NodeExecutionEnv`, a host lane) is the
|
|
127
|
+
* control-plane host's filesystem — every such env is one tree, whatever interface it drives it through;
|
|
128
|
+
* · otherwise a remote workspace names itself through its {@link WorkspaceHandle} (provider + sandbox, and
|
|
129
|
+
* the device lane's id when stamped) — two runs on one sandbox share a tree, two sandboxes never do;
|
|
130
|
+
* · anything else — an env declaring `hostLocalPaths: false` with no handle, or one whose declaration is
|
|
131
|
+
* missing or malformed (read as not host-local) — is attested to nothing, so it is its OWN tree: a
|
|
132
|
+
* per-instance token, which still matches when the child literally holds the parent's env object and
|
|
133
|
+
* never matches a fresh per-task mint.
|
|
136
134
|
* A remote handle that cannot be read (an env not yet connected) falls to the per-instance arm for
|
|
137
135
|
* the same reason: unattested is not shared.
|
|
138
136
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isRemoteExecutionEnv } from "../remote-env.js";
|
|
1
|
+
import { isRemoteExecutionEnv, pathsAreHostLocal } from "../remote-env.js";
|
|
3
2
|
import { FILE_HISTORY_ERROR_CODES, FileHistoryStoreError } from "../file-history-store.js";
|
|
4
3
|
import { readMember, thrownText } from "../thrown-value.js";
|
|
5
4
|
import { isGovernanceRetryClass } from "../governance-codes.js";
|
|
@@ -8,13 +7,6 @@ export async function prepareFileHistory(input) {
|
|
|
8
7
|
const { deps, spec, request, internals, executionEnv, taskRootFinal, handsEnabled, sessionId, session, abortController } = input;
|
|
9
8
|
const rewindNotes = [];
|
|
10
9
|
const { onTrackFailure, captureOff, declaredOff, fileHistoryStore, captureStore, rewindTarget, rewindBefore } = request;
|
|
11
|
-
if (spec.rewindFiles === true) {
|
|
12
|
-
try {
|
|
13
|
-
deps.onError?.(new Error(`TaskSpec.rewindFiles (capture sense) is retired and was ignored: per-edited-file first-touch tracking is on whenever RunnerDeps.fileHistoryStore is wired and neither RunnerDeps.fileHistoryCapture nor TaskSpec.fileHistory turns it off, so a per-turn capture request has nothing left to ask for. Drop the field; the restore sense moved to TaskSpec.restoreFiles.`), { phase: "config", sessionId });
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
10
|
if (spec.resumeAt !== undefined && spec.restoreFiles !== true) {
|
|
19
11
|
rewindNotes.push({
|
|
20
12
|
code: "conversation_only",
|
|
@@ -226,6 +218,8 @@ export function resolveFileHistoryScope(lineage, historyRoot, historyFs, session
|
|
|
226
218
|
const envFilesystemTokens = new WeakMap();
|
|
227
219
|
let envFilesystemSeq = 0;
|
|
228
220
|
export function fileHistoryFilesystemIdentity(env) {
|
|
221
|
+
if (pathsAreHostLocal(env))
|
|
222
|
+
return "host";
|
|
229
223
|
if (isRemoteExecutionEnv(env)) {
|
|
230
224
|
try {
|
|
231
225
|
const h = env.workspaceHandle();
|
|
@@ -234,9 +228,6 @@ export function fileHistoryFilesystemIdentity(env) {
|
|
|
234
228
|
catch {
|
|
235
229
|
}
|
|
236
230
|
}
|
|
237
|
-
else if (env.hostLocalPaths === true || (env.hostLocalPaths === undefined && env instanceof NodeExecutionEnv)) {
|
|
238
|
-
return "host";
|
|
239
|
-
}
|
|
240
231
|
let token = envFilesystemTokens.get(env);
|
|
241
232
|
if (token === undefined) {
|
|
242
233
|
token = `instance:${++envFilesystemSeq}`;
|
|
@@ -30,7 +30,7 @@ import type { Arbitration, ToolMarkSource } from "../ask-origin.js";
|
|
|
30
30
|
import { type PermissionModeController } from "../mode-policy.js";
|
|
31
31
|
import type { AutoModeDecider, AutoModeDenialTracker } from "../auto-mode.js";
|
|
32
32
|
import { type ComplianceCapability } from "../compliance.js";
|
|
33
|
-
import type {
|
|
33
|
+
import type { InheritedInstallation, LegModBus } from "../mods/stations.js";
|
|
34
34
|
import { type HookEnvCapabilities, type HookInvocationIdentity } from "../hooks.js";
|
|
35
35
|
import type { ToolPolicy } from "../tool-policy.js";
|
|
36
36
|
import { type GateOutcome } from "../gate-outcome.js";
|
|
@@ -96,8 +96,9 @@ export interface PrepareGateStationsInput {
|
|
|
96
96
|
/** borrowed-readonly — the leg's mods bus: `classic.PreToolUse` presence arms the gate; the screenings and the post-call
|
|
97
97
|
* events are raised on it. */
|
|
98
98
|
modBus: LegModBus;
|
|
99
|
-
/** borrowed-readonly — the inherited installations the gate
|
|
100
|
-
|
|
99
|
+
/** borrowed-readonly — the inherited installations the gate judges its calls on after `modBus` (`classic.PreToolUse` at phase 1,
|
|
100
|
+
* `tool.check` at the verdict read; the policy-chain phase's). */
|
|
101
|
+
inheritedInstallations: readonly InheritedInstallation[];
|
|
101
102
|
/** borrowed-readonly — the egress vocabulary: arming, and the per-call `egress` flag handed to the gate. */
|
|
102
103
|
egressTools: ReadonlySet<string>;
|
|
103
104
|
/** borrowed-readonly — the irreversible vocabulary: arming only. */
|
|
@@ -48,7 +48,7 @@ export function maybeHumanRejectionHalt(input) {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
export function prepareGateStations(input) {
|
|
51
|
-
const { askLane, parkAsk, tools, toolRosterDeltas, deps, toolCallGateArmedRef, effectivePolicy, egressTools, irreversibleTools, spec, complianceDenies, harness, blockedToolCalls, inheritedAskGrants, inheritedUnavailableAsks, foldAskClasses, ancestorSandboxAdmissions, preToolContexts, toolOccurrences, batchHaltRef, blockedTracked, hookIdentity, reminderMark, hostTaskId, sessionId, handsCwdRef, stampCallTarget, hookEnvFace, writeProtectionCheck, shellReadCheck, crossBoundaryCheck, readFace, irreversibilityTier, reversibilityProbes, abortController, shellGatedTools, autoModeDecider, autoModeDenialTracking, askRoute, permissionMode, toolMarkSources, a2aIsolatePeers, ancestorArbitrations, runId, stopForDenialLimit, permissionRuleLane, permissionRuleOrgLane, questionToolMounted, sandboxAdmissionArmed, sandboxBoundaryCapable, emitSandboxAdmitted, delegation, frameSettlement, seatInputsFor, modBus,
|
|
51
|
+
const { askLane, parkAsk, tools, toolRosterDeltas, deps, toolCallGateArmedRef, effectivePolicy, egressTools, irreversibleTools, spec, complianceDenies, harness, blockedToolCalls, inheritedAskGrants, inheritedUnavailableAsks, foldAskClasses, ancestorSandboxAdmissions, preToolContexts, toolOccurrences, batchHaltRef, blockedTracked, hookIdentity, reminderMark, hostTaskId, sessionId, handsCwdRef, stampCallTarget, hookEnvFace, writeProtectionCheck, shellReadCheck, crossBoundaryCheck, readFace, irreversibilityTier, reversibilityProbes, abortController, shellGatedTools, autoModeDecider, autoModeDenialTracking, askRoute, permissionMode, toolMarkSources, a2aIsolatePeers, ancestorArbitrations, runId, stopForDenialLimit, permissionRuleLane, permissionRuleOrgLane, questionToolMounted, sandboxAdmissionArmed, sandboxBoundaryCapable, emitSandboxAdmitted, delegation, frameSettlement, seatInputsFor, modBus, inheritedInstallations } = input;
|
|
52
52
|
const releasesAnnounced = new Map();
|
|
53
53
|
const onModeReleased = (info) => {
|
|
54
54
|
const table = info.readUnestablished === true ? input.readDenyInForce(info.toolCallId) : undefined;
|
|
@@ -78,6 +78,7 @@ export function prepareGateStations(input) {
|
|
|
78
78
|
toolCallGateArmedRef.armed =
|
|
79
79
|
effectivePolicy !== undefined ||
|
|
80
80
|
modBus.hasHandlers("classic.PreToolUse") ||
|
|
81
|
+
inheritedInstallations.length > 0 ||
|
|
81
82
|
egressTools.size > 0 ||
|
|
82
83
|
irreversibleTools.size > 0 ||
|
|
83
84
|
spec.enablePlanMode === true ||
|
|
@@ -117,7 +118,7 @@ export function prepareGateStations(input) {
|
|
|
117
118
|
identity: hookIdentity,
|
|
118
119
|
reminderMark,
|
|
119
120
|
modBus,
|
|
120
|
-
...(
|
|
121
|
+
...(inheritedInstallations.length > 0 ? { inheritedInstallations } : {}),
|
|
121
122
|
observedPermissionMode: () => permissionMode.observed,
|
|
122
123
|
...(handsCwdRef !== undefined ? { trackedCwd: () => handsCwdRef.current } : {}),
|
|
123
124
|
...(stampCallTarget !== undefined ? { stampCallTarget } : {}),
|
|
@@ -251,7 +252,7 @@ export function prepareGateStations(input) {
|
|
|
251
252
|
});
|
|
252
253
|
}
|
|
253
254
|
}
|
|
254
|
-
const toolResultStation = createToolResultStation({ modBus, blockedToolCalls, toolRosterDeltas, preToolContexts, abortController, spec, handsCwdRef, hookEnvFace, hookIdentity, permissionMode, reminderMark, frameSettlement });
|
|
255
|
+
const toolResultStation = createToolResultStation({ modBus, blockedToolCalls, toolRosterDeltas, preToolContexts, inheritedScreens: inheritedInstallations.length > 0, abortController, spec, handsCwdRef, hookEnvFace, hookIdentity, permissionMode, reminderMark, frameSettlement });
|
|
255
256
|
if (toolResultStation !== undefined)
|
|
256
257
|
harness.on("tool_result", toolResultStation);
|
|
257
258
|
const approvedCallScreen = createApprovedCallScreen({ modBus, permissionMode, abortController, handsCwdRef, hookEnvFace, hookIdentity, preToolContexts });
|
|
@@ -56,6 +56,8 @@ export interface PrepareHandsReadFaceInput {
|
|
|
56
56
|
/** borrowed-readonly — the acquired session's id, for error/notice tags and the band's session
|
|
57
57
|
* registration. */
|
|
58
58
|
sessionId: string;
|
|
59
|
+
/** borrowed-readonly — this run's id, carried on the byte-floor notice (once per run). */
|
|
60
|
+
runId: string;
|
|
59
61
|
/** borrowed-readonly — the host task id: trace frames + the band's task-registry owner. */
|
|
60
62
|
hostTaskId: string;
|
|
61
63
|
/** borrowed-readonly — the registry scope (`internals?.registryScope ?? spec.principal ??
|
|
@@ -98,7 +100,7 @@ export interface PrepareHandsReadFaceInput {
|
|
|
98
100
|
* object (R-4: `deps.onError?.()` keeps its receiver; a new deps read must widen this Pick).
|
|
99
101
|
* `readDenyBuiltinTiers`/`readDenyBuiltinExclude` are SNAPSHOTTED before the first await that
|
|
100
102
|
* precedes the toolkit compile (the caller retains these arrays by reference). */
|
|
101
|
-
deps: Pick<RunnerDeps, "onError" | "onNotice" | "tracer" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "agentConfigDir" | "readFace" | "writeFace" | "permissionRuleStore" | "hands">;
|
|
103
|
+
deps: Pick<RunnerDeps, "onError" | "onNotice" | "tracer" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "readDenyFloorRequired" | "agentConfigDir" | "readFace" | "writeFace" | "permissionRuleStore" | "hands" | "imageProcessor">;
|
|
102
104
|
/** borrowed-readonly — the trusted spawn-side seats the band forwards: the finished-command
|
|
103
105
|
* notification lane, the mid-flight detach hub, and the Runner's per-session
|
|
104
106
|
* read-state seats and their restore channel (absent on a standalone prepare ⇒ the transcript-replay rung
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { emitTrace } from "../trace.js";
|
|
2
|
-
import {
|
|
2
|
+
import { performsIo } from "../remote-env.js";
|
|
3
3
|
import { hasBackgroundShell } from "../background-shell.js";
|
|
4
4
|
import { defaultTaskRegistry } from "../task-registry.js";
|
|
5
5
|
import { bashReversibilityProbe, activeReadDenyBuiltinTiers, readDenyBuiltinConfigOf, compileReadDeny, createHandsToolkit, deploymentFaceClampNotice, pdfModelCapabilitiesOf, inheritSessionReadFileState, backgroundOutputReadExemption, resolveContainmentFace, seedReadFileStateFromContext, seedReadFileStateFromTranscript, } from "../../tools/fs/index.js";
|
|
@@ -9,7 +9,7 @@ import { carryReadFace } from "../../tools/fs/read-deny-home.js";
|
|
|
9
9
|
import { EMPTY_READ_ROOTS, afterCallTables, denySeatsOf, onPinnedRead, pathTablesCompile, readRootsOver } from "./person-path-rows.js";
|
|
10
10
|
import { createShellOverflowSpoolFence } from "../../tools/fs/fs-shared.js";
|
|
11
11
|
import { createShellReadStation } from "../../tools/fs/shell-read-check.js";
|
|
12
|
-
import { readFloorSeat } from "../../tools/fs/read-floor.js";
|
|
12
|
+
import { judgeReadFloorKept, readFloorSeat } from "../../tools/fs/read-floor.js";
|
|
13
13
|
import { createFileReadStation } from "../../tools/fs/file-read-check.js";
|
|
14
14
|
import { isShellFaceToolName, predictMountedToolNames, readTargetToolNames } from "../tool-registry.js";
|
|
15
15
|
import { normalizeFileText } from "../../tools/fs/encoding.js";
|
|
@@ -20,7 +20,7 @@ import { sessionSeatAnchorHolds } from "./session-read-file-states.js";
|
|
|
20
20
|
import { rebaseWorkspacePath } from "./workspace-path.js";
|
|
21
21
|
import { RosterBuilder } from "../tool-roster.js";
|
|
22
22
|
import { unionAddOnly } from "../child-clamp-seats.js";
|
|
23
|
-
import { assertStringArraySeat } from "../read-face-seats.js";
|
|
23
|
+
import { assertStringArraySeat, screenReadDenySeat } from "../read-face-seats.js";
|
|
24
24
|
import { modePolicyOf } from "../mode-policy.js";
|
|
25
25
|
import { valveLeaves } from "../../agents/tool-filter.js";
|
|
26
26
|
const faceClampAnnouncedSinks = { read: new WeakSet(), write: new WeakSet() };
|
|
@@ -191,7 +191,7 @@ export async function prepareHandsMount(input) {
|
|
|
191
191
|
seedReadFileStateFromContext(readFileState, rk.key, f.content);
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
|
-
const handsIncludeShell =
|
|
194
|
+
const handsIncludeShell = performsIo(executionEnv) === true;
|
|
195
195
|
const handsReadOnly = spec.handsReadOnly === true;
|
|
196
196
|
backgroundTaskToolsActive = handsIncludeShell && !handsReadOnly && hasBackgroundShell(executionEnv);
|
|
197
197
|
const shellFaceHere = [...predictMountedToolNames(new Set(backgroundTaskToolsActive ? ["hands", "backgroundTasks"] : ["hands"]))].filter(isShellFaceToolName);
|
|
@@ -214,7 +214,15 @@ export async function prepareHandsMount(input) {
|
|
|
214
214
|
const readDenyBuiltinCfg = readDenyBuiltinConfigOf({ tiers: deps.readDenyBuiltinTiers, exclude: deps.readDenyBuiltinExclude });
|
|
215
215
|
const canonicalize = async (dirs) => { const out = []; for (const d of dirs)
|
|
216
216
|
await canonicalizeExtraDirs([d], "persistedReadRule", out).catch((err) => deps.onError?.(new Error(`persistedReadRule entry skipped (its lookup threw): ${d}: ${thrownText(err)}`), { phase: "config", sessionId })); return out; };
|
|
217
|
-
const
|
|
217
|
+
const floorRequired = screenReadDenySeat("readDenyFloorRequired", deps.readDenyFloorRequired) === true;
|
|
218
|
+
const floorSaid = { done: false };
|
|
219
|
+
const compileRunTables = pathTablesCompile({ env: executionEnv, additions: readDenyAdditions, builtin: readDenyBuiltinCfg, legRows: input.denyRuleRows, leads: input.headLeads, configRoot: deps.agentConfigDir, canonicalize });
|
|
220
|
+
const judgedRunTables = async (person) => {
|
|
221
|
+
const compiled = await compileRunTables(person);
|
|
222
|
+
judgeReadFloorKept({ env: executionEnv, table: compiled.readDeny, floor: readFloorSeat(compiled.readDeny)?.(undefined), required: floorRequired, onNotice: deps.onNotice, attribution: { sessionId, runId: input.runId }, said: floorSaid });
|
|
223
|
+
return compiled;
|
|
224
|
+
};
|
|
225
|
+
const tables = (pathTables = await input.personRows.attachTables(judgedRunTables));
|
|
218
226
|
readDenyMatcher = tables.readDeny;
|
|
219
227
|
readRoots = readRootsOver({ own: () => [...additionalRootsCanonical, ...additionalReadRootsCanonical], tables, ready: input.personRows.tablesReady, store: () => artifactStoreRef.current,
|
|
220
228
|
onHeld: (entry, store) => emitTrace(deps.tracer, () => ({ kind: "config.additional_directory_skipped", version: 1, taskId: hostTaskId, entry, field: "persistedReadRule", reason: `admits_artifact_store: the local artifact store ${store} lies inside it or it inside the store — the Artifact tool's ledger and stored files stay outside every root the file tools reach`, ts: Date.now() })) });
|
|
@@ -368,7 +376,7 @@ export async function prepareHandsMount(input) {
|
|
|
368
376
|
pdfModelCapabilities: pdfModelCapabilitiesOf(model),
|
|
369
377
|
...(deps.hands?.bashReadonlyAllow !== undefined ? { bashReadonlyAllow: deps.hands.bashReadonlyAllow } : {}),
|
|
370
378
|
...(deps.hands?.commitCoAuthor !== undefined ? { commitCoAuthor: deps.hands.commitCoAuthor } : {}),
|
|
371
|
-
...(deps.
|
|
379
|
+
...(deps.imageProcessor !== undefined ? { imageProcessor: deps.imageProcessor } : {}),
|
|
372
380
|
...(deps.hands?.autoBackgroundOnTimeout !== undefined ? { autoBackgroundOnTimeout: deps.hands.autoBackgroundOnTimeout } : {}),
|
|
373
381
|
beforeWrite: async (w) => {
|
|
374
382
|
const deploymentGate = deps.hands?.beforeWrite;
|
|
@@ -392,7 +400,7 @@ export async function prepareHandsMount(input) {
|
|
|
392
400
|
}
|
|
393
401
|
roster.mountAll(band.map((t) => (envHandToolNames.add(t.name), firstPartyOffload(afterCallTables(input.personRows, t)))), { source: "builtin", mountedBy: "hands" });
|
|
394
402
|
const shellFloor = effectiveShellGate;
|
|
395
|
-
if (
|
|
403
|
+
if (handsIncludeShell && spec.handsReadOnly !== true) {
|
|
396
404
|
const installShellSeat = (name) => {
|
|
397
405
|
const tierBefore = irreversibilityTier.get(name);
|
|
398
406
|
const seatOwned = !egressTools.has(name) && tierBefore !== "always" && tierBefore !== "maybe";
|
|
@@ -37,7 +37,6 @@ import type { AutoModeArmingRecipe } from "../auto-mode-arming.js";
|
|
|
37
37
|
import type { AutoModeDecider, AutoModeDenialTracker } from "../auto-mode.js";
|
|
38
38
|
import { type OnQuestion } from "../ask-question.js";
|
|
39
39
|
import { type ParentSpecSeat } from "../parent-spec-seat.js";
|
|
40
|
-
import { type HookEnvCapabilities } from "../hooks.js";
|
|
41
40
|
import { type LegModBus, type ModChainLink } from "../mods/stations.js";
|
|
42
41
|
import { type ChildClampSource } from "../child-clamp-seats.js";
|
|
43
42
|
import type { LockedPreflight } from "../locked-config.js";
|
|
@@ -134,6 +133,8 @@ export interface PrepareInheritedGateInput {
|
|
|
134
133
|
forwardEvent: ((e: TaskEvent) => void) | undefined;
|
|
135
134
|
/** borrowed-readonly — the retain ledger (ctx seat; absent ⇒ no key). */
|
|
136
135
|
subagentRetain: SubagentRetainLedger | undefined;
|
|
136
|
+
/** borrowed-readonly — where a background task's cut result is stored (ctx seat `taskArtifacts`; absent ⇒ no key). */
|
|
137
|
+
taskArtifacts: import("../tool-result-store.js").TaskArtifactSeat | undefined;
|
|
137
138
|
/** borrowed-readonly — the worktree-isolation helper (ctx seat; absent ⇒ no key). */
|
|
138
139
|
worktreeIsolation: SubagentWorktreeIsolation | undefined;
|
|
139
140
|
/** borrowed-readonly — the three run-ref primitives the ctx exposes (plan mode only under `enablePlanMode`). */
|
|
@@ -161,12 +162,10 @@ export interface PrepareInheritedGateInput {
|
|
|
161
162
|
* `inheritedGateForChildren` (the two mandate tests), at spawn time. */
|
|
162
163
|
runtimeCaps: () => RuntimeCaps | undefined;
|
|
163
164
|
/** borrowed-readonly — what the leg hands its descendants of its mods bus (`LegMods.handedDown`: without the skills' own
|
|
164
|
-
* registrations): the chain assembly
|
|
165
|
+
* registrations): the chain assembly hands it down as this leg's screening installation. */
|
|
165
166
|
modBus: LegModBus;
|
|
166
167
|
/** borrowed-readonly — this leg's chain identity as its admission recorded it (`chainOfBus`) — the installation identity's chain term. */
|
|
167
168
|
ownModChain: readonly ModChainLink[];
|
|
168
|
-
/** borrowed-readonly — LATE-BOUND: the hook-env capability face the screening-face entry's policy resolves paths in. */
|
|
169
|
-
hookEnvFace: () => HookEnvCapabilities | undefined;
|
|
170
169
|
/** borrowed-readonly — LATE-BOUND: the armed classifier (undefined = not armed), read where the chain freezes it onto both
|
|
171
170
|
* entries and where the ctx exposes the spawn-review seat. */
|
|
172
171
|
autoModeDecider: () => AutoModeDecider | undefined;
|
|
@@ -176,6 +175,8 @@ export interface PrepareInheritedGateInput {
|
|
|
176
175
|
autoModeArming: () => AutoModeArmingRecipe | undefined;
|
|
177
176
|
/** borrowed-readonly — LATE-BOUND: the fork-governance verdict (ctx `forkAccess`, present only when denied). */
|
|
178
177
|
agentForkDenial: () => ReturnType<typeof forkGovernanceDenial>;
|
|
178
|
+
/** borrowed-readonly — LATE-BOUND: the leg's agent stations (ctx `agentStations`; bound once the leg's identity is known). */
|
|
179
|
+
agentStations: () => import("../mods/agent-stations.js").AgentStations | undefined;
|
|
179
180
|
/** borrowed-readonly — LATE-BOUND: the observers grant (ctx `observersAllowed`, present only when explicitly granted). */
|
|
180
181
|
observersActive: () => boolean;
|
|
181
182
|
/** borrowed-readonly — LATE-BOUND: the hands mount's resolved read face (undefined until/unless hands mount). */
|