@sema-agent/core 7.72.0 → 7.74.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 +565 -0
- package/dist/agents/inherited-tool-pool.d.ts +26 -1
- package/dist/agents/inherited-tool-pool.js +46 -2
- package/dist/agents/list-agents-tool.js +1 -1
- package/dist/agents/parked-resume-drive.d.ts +10 -0
- package/dist/agents/parked-resume-drive.js +9 -0
- package/dist/agents/retain-ledger.d.ts +3 -0
- package/dist/agents/retain-ledger.js +3 -3
- package/dist/agents/send-message-tool.js +5 -4
- package/dist/agents/send-user-message-tool.d.ts +12 -0
- package/dist/agents/send-user-message-tool.js +67 -0
- package/dist/agents/subagent-steps.d.ts +9 -0
- package/dist/agents/subagent-steps.js +38 -0
- package/dist/agents/subagent.d.ts +2 -0
- package/dist/agents/subagent.js +43 -12
- package/dist/agents/verify.js +23 -8
- package/dist/agents/yield-adoption.js +3 -1
- package/dist/brain/anthropic.d.ts +42 -1
- package/dist/brain/anthropic.js +68 -13
- package/dist/brain/failover.d.ts +5 -0
- package/dist/brain/failover.js +51 -22
- package/dist/brain/model-lane.d.ts +12 -3
- package/dist/brain/model-lane.js +5 -5
- package/dist/brain/open-responses.js +7 -8
- package/dist/brain/openai.js +31 -24
- package/dist/brain/route-adjudicator.d.ts +33 -4
- package/dist/brain/route-adjudicator.js +49 -12
- package/dist/brain/stream-engine.js +166 -156
- package/dist/brain/stream-shared.d.ts +4 -3
- package/dist/brain/stream-shared.js +2 -2
- package/dist/core/actions-digest.d.ts +43 -0
- package/dist/core/actions-digest.js +22 -0
- package/dist/core/allow-entry.js +4 -4
- package/dist/core/ask-class.d.ts +2 -2
- package/dist/core/ask-headline.d.ts +1 -1
- package/dist/core/ask-origin.d.ts +44 -4
- package/dist/core/ask-origin.js +29 -10
- package/dist/core/auto-mode.d.ts +7 -9
- package/dist/core/auto-mode.js +114 -8
- package/dist/core/background-agent-store.d.ts +1 -0
- package/dist/core/background-agent-store.js +49 -8
- package/dist/core/checkpoint-features.d.ts +3 -2
- package/dist/core/checkpoint-features.js +1 -1
- package/dist/core/checkpoint-rekey.d.ts +1 -1
- package/dist/core/checkpoint-rekey.js +6 -1
- package/dist/core/checkpoint-requirements.d.ts +23 -3
- package/dist/core/checkpoint-requirements.js +5 -1
- package/dist/core/checkpoint-row-verdict.d.ts +1 -1
- package/dist/core/checkpoint-row-verdict.js +9 -3
- package/dist/core/checkpoint-store.d.ts +26 -2
- package/dist/core/checkpoint-store.js +9 -2
- package/dist/core/child-clamp-seats.d.ts +15 -0
- package/dist/core/child-clamp-seats.js +15 -0
- package/dist/core/config-refusal-codes.d.ts +1 -1
- package/dist/core/config-refusal-codes.js +1 -0
- package/dist/core/cron.js +9 -1
- package/dist/core/delegation-frames.d.ts +1 -0
- package/dist/core/delegation-frames.js +1 -1
- package/dist/core/deployment-shape.d.ts +7 -0
- package/dist/core/deployment-shape.js +19 -0
- package/dist/core/engine-capabilities.d.ts +13 -1
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-notice.d.ts +41 -28
- package/dist/core/engine-version.js +1 -1
- package/dist/core/entries-not-applied.d.ts +19 -7
- package/dist/core/entries-not-applied.js +33 -1
- package/dist/core/gate-fold.js +5 -4
- package/dist/core/gate-lanes.js +8 -12
- package/dist/core/gate-outcome.d.ts +8 -2
- package/dist/core/gate-outcome.js +10 -3
- package/dist/core/governance-codes.d.ts +14 -2
- package/dist/core/governance-codes.js +22 -6
- package/dist/core/hook-condition.d.ts +37 -0
- package/dist/core/hook-condition.js +567 -0
- package/dist/core/hooks.d.ts +5 -0
- package/dist/core/hooks.js +1 -0
- package/dist/core/host-instance.d.ts +23 -0
- package/dist/core/host-instance.js +69 -0
- package/dist/core/instruction-preview.d.ts +63 -0
- package/dist/core/instruction-preview.js +406 -0
- package/dist/core/leg-budget.d.ts +26 -0
- package/dist/core/leg-budget.js +9 -0
- package/dist/core/leg-identity.d.ts +51 -1
- package/dist/core/leg-identity.js +45 -2
- package/dist/core/manager-launch-check.d.ts +48 -0
- package/dist/core/manager-launch-check.js +64 -0
- package/dist/core/mcp-call-meta.d.ts +2 -2
- package/dist/core/mcp-injection-drop.d.ts +20 -10
- package/dist/core/mcp-injection-drop.js +9 -3
- package/dist/core/mcp-server-spec.d.ts +2 -1
- package/dist/core/member-outcome.d.ts +3 -2
- package/dist/core/member-outcome.js +1 -1
- package/dist/core/memory-engine/deletion-record.d.ts +46 -0
- package/dist/core/memory-engine/deletion-record.js +96 -0
- package/dist/core/memory-engine/engine.js +24 -16
- package/dist/core/memory-engine/file-backend.js +7 -5
- package/dist/core/memory-engine/projection-ledger.d.ts +1 -1
- package/dist/core/memory-engine/projection-ledger.js +1 -1
- package/dist/core/memory-engine/scope-contract.d.ts +18 -13
- package/dist/core/memory-engine/scope-contract.js +18 -18
- package/dist/core/memory-engine/sync-client.js +26 -6
- package/dist/core/memory-engine/sync.d.ts +20 -2
- package/dist/core/memory-engine/sync.js +18 -17
- package/dist/core/mode-policy.d.ts +25 -6
- package/dist/core/mode-policy.js +33 -8
- package/dist/core/model-seat.d.ts +8 -5
- package/dist/core/model-shell.d.ts +129 -0
- package/dist/core/model-shell.js +249 -0
- package/dist/core/mods/kernel/digest.d.ts +4 -0
- package/dist/core/mods/kernel/digest.js +5 -0
- package/dist/core/mods/kernel/dispatch.d.ts +3 -0
- package/dist/core/mods/kernel/dispatch.js +15 -6
- package/dist/core/mods/kernel/events.d.ts +21 -5
- package/dist/core/mods/kernel/events.js +19 -10
- package/dist/core/mods/kernel/hash-mirror.d.ts +1 -0
- package/dist/core/mods/kernel/hash-mirror.js +55 -0
- package/dist/core/mods/kernel/index.d.ts +1 -0
- package/dist/core/mods/kernel/index.js +1 -0
- package/dist/core/mods/kernel/package-reader.d.ts +48 -0
- package/dist/core/mods/kernel/package-reader.js +149 -0
- package/dist/core/mods/kernel/site-rules.d.ts +4 -0
- package/dist/core/mods/kernel/site-rules.js +13 -0
- package/dist/core/mods/package.d.ts +7 -3
- package/dist/core/mods/package.js +47 -80
- package/dist/core/own-property-receipt.js +11 -4
- package/dist/core/parent-spec-seat.d.ts +13 -11
- package/dist/core/parent-spec-seat.js +13 -9
- package/dist/core/peer-seat.js +3 -3
- package/dist/core/peer-task-store.d.ts +365 -0
- package/dist/core/peer-task-store.js +682 -0
- package/dist/core/permission-rule-consent.js +6 -11
- package/dist/core/permission-rule-model.d.ts +27 -0
- package/dist/core/permission-rule-model.js +33 -5
- package/dist/core/permission-rule-org.js +13 -3
- package/dist/core/permission-rule-provider.d.ts +35 -33
- package/dist/core/permission-rule-provider.js +38 -295
- package/dist/core/permission-rule-store.d.ts +181 -8
- package/dist/core/permission-rule-store.js +420 -17
- package/dist/core/permission-rule-sync.js +15 -1
- package/dist/core/permission-rules.js +4 -1
- package/dist/core/project-seat.d.ts +55 -0
- package/dist/core/project-seat.js +96 -0
- package/dist/core/protocol-http-auth.d.ts +3 -2
- package/dist/core/protocol-http-auth.js +26 -18
- package/dist/core/remote-env.d.ts +4 -4
- package/dist/core/retain-seat.d.ts +42 -0
- package/dist/core/retain-seat.js +76 -0
- package/dist/core/retired-keys.js +1 -0
- package/dist/core/rewind-refusal-codes.d.ts +8 -0
- package/dist/core/rewind-refusal-codes.js +12 -0
- package/dist/core/roles.d.ts +2 -2
- package/dist/core/roles.js +15 -1
- package/dist/core/rule-offer-read.d.ts +1 -1
- package/dist/core/rule-offer-read.js +32 -4
- package/dist/core/rule-store-fault.d.ts +9 -7
- package/dist/core/rule-store-fault.js +8 -3
- package/dist/core/run-ledger-seat.d.ts +66 -0
- package/dist/core/run-ledger-seat.js +70 -0
- package/dist/core/run-ledger.d.ts +332 -0
- package/dist/core/run-ledger.js +550 -0
- package/dist/core/runner/checkpoint-scope.d.ts +14 -3
- package/dist/core/runner/checkpoint-scope.js +16 -6
- package/dist/core/runner/compact-session.js +1 -1
- package/dist/core/runner/construction-doors.js +8 -0
- package/dist/core/runner/contracts.d.ts +21 -5
- package/dist/core/runner/cross-boundary-lane.d.ts +8 -1
- package/dist/core/runner/cross-boundary-lane.js +4 -0
- package/dist/core/runner/delegation-owner.d.ts +30 -0
- package/dist/core/runner/delegation-owner.js +20 -4
- package/dist/core/runner/finish-reason-seat.js +4 -2
- package/dist/core/runner/gate-exit.d.ts +7 -0
- package/dist/core/runner/gate-exit.js +2 -1
- package/dist/core/runner/leg-frame.js +3 -0
- package/dist/core/runner/model-lane-seat.d.ts +3 -0
- package/dist/core/runner/model-lane-seat.js +4 -0
- package/dist/core/runner/nested-memory-lane.d.ts +22 -5
- package/dist/core/runner/nested-memory-lane.js +91 -30
- package/dist/core/runner/person-path-rows.d.ts +27 -16
- package/dist/core/runner/person-path-rows.js +93 -15
- package/dist/core/runner/prepare-caps-and-workflow.js +98 -88
- package/dist/core/runner/prepare-config-doors.d.ts +1 -0
- package/dist/core/runner/prepare-config-doors.js +13 -7
- package/dist/core/runner/prepare-context-lane.js +1 -0
- package/dist/core/runner/prepare-delegation-surface.d.ts +3 -0
- package/dist/core/runner/prepare-delegation-surface.js +6 -0
- package/dist/core/runner/prepare-execution-env.d.ts +3 -3
- package/dist/core/runner/prepare-gate-stations.d.ts +6 -0
- package/dist/core/runner/prepare-gate-stations.js +3 -1
- package/dist/core/runner/prepare-hands-readface.d.ts +5 -2
- package/dist/core/runner/prepare-hands-readface.js +15 -3
- package/dist/core/runner/prepare-inherited-gate.d.ts +6 -3
- package/dist/core/runner/prepare-inherited-gate.js +13 -5
- package/dist/core/runner/prepare-offload-wrappers.js +1 -1
- package/dist/core/runner/prepare-run-refs.d.ts +1 -1
- package/dist/core/runner/prepare-run-refs.js +3 -2
- package/dist/core/runner/prepare-suspend-saga.d.ts +6 -2
- package/dist/core/runner/prepare-suspend-saga.js +4 -2
- package/dist/core/runner/prepare-task.js +42 -30
- package/dist/core/runner/prepare-turn-wiring.d.ts +4 -3
- package/dist/core/runner/prepare-turn-wiring.js +2 -1
- package/dist/core/runner/prepare-wiring-manifest.d.ts +3 -1
- package/dist/core/runner/prepare-wiring-manifest.js +8 -6
- package/dist/core/runner/resume-apply.js +11 -5
- package/dist/core/runner/resume-policy-outcome.js +5 -2
- package/dist/core/runner/resume-review-outcome.d.ts +3 -0
- package/dist/core/runner/resume-review-outcome.js +24 -1
- package/dist/core/runner/role-seat-defaulted.d.ts +3 -3
- package/dist/core/runner/role-seat-defaulted.js +1 -1
- package/dist/core/runner/rule-store-unreadable-notice.d.ts +1 -1
- package/dist/core/runner/rule-store-unreadable-notice.js +3 -3
- package/dist/core/runner/run-harness-handlers.js +4 -1
- package/dist/core/runner/run-identity-wiring.js +3 -2
- package/dist/core/runner/run-leg.js +5 -2
- package/dist/core/runner/run-notification-lane.js +20 -1
- package/dist/core/runner/run-settle-and-teardown.js +21 -12
- package/dist/core/runner/run-stop-and-final-verify.js +6 -0
- package/dist/core/runner/run-telemetry-and-budget-seats.js +1 -1
- package/dist/core/runner/runtask.d.ts +6 -2
- package/dist/core/runner/runtask.js +21 -9
- package/dist/core/runner/shell-env-withheld.d.ts +6 -4
- package/dist/core/runner/shell-env-withheld.js +25 -3
- package/dist/core/runner/stop-tail-notice.d.ts +10 -2
- package/dist/core/runner/stop-tail-notice.js +9 -2
- package/dist/core/runner/stream-settle-backstop.d.ts +1 -0
- package/dist/core/runner/stream-settle-backstop.js +1 -0
- package/dist/core/runner/sub-agent-deny-lists.js +9 -5
- package/dist/core/runner/task-start-doors.js +6 -3
- package/dist/core/runner/terminal-account.d.ts +6 -1
- package/dist/core/runner/terminal-account.js +16 -1
- package/dist/core/runner/tool-end-body.d.ts +1 -1
- package/dist/core/runner/tool-not-executed.d.ts +27 -8
- package/dist/core/runner/tool-not-executed.js +22 -11
- package/dist/core/runner/unreadable-person-rows.d.ts +2 -1
- package/dist/core/runner/write-protection-station.d.ts +1 -1
- package/dist/core/runner/write-protection-station.js +1 -1
- package/dist/core/runner-deps.d.ts +17 -10
- package/dist/core/secret-env.d.ts +61 -37
- package/dist/core/secret-env.js +49 -49
- package/dist/core/session-checkout.d.ts +3 -0
- package/dist/core/session-checkout.js +1 -0
- package/dist/core/session-store.d.ts +12 -6
- package/dist/core/session-store.js +26 -6
- package/dist/core/session.d.ts +31 -8
- package/dist/core/shell-read-silence.d.ts +40 -2
- package/dist/core/shell-read-silence.js +23 -4
- package/dist/core/store-contracts/checkpoint-store-contract.js +10 -0
- package/dist/core/store-contracts/peer-task-store-contract.d.ts +21 -0
- package/dist/core/store-contracts/peer-task-store-contract.js +516 -0
- package/dist/core/store-contracts/session-store-contract.d.ts +15 -2
- package/dist/core/store-contracts/session-store-contract.js +87 -3
- package/dist/core/store-contracts/workflow-journal-store-contract.d.ts +19 -1
- package/dist/core/store-contracts/workflow-journal-store-contract.js +89 -1
- package/dist/core/task-event.d.ts +14 -7
- package/dist/core/task-notification.d.ts +96 -10
- package/dist/core/task-notification.js +135 -6
- package/dist/core/task-registry-agent.d.ts +1 -0
- package/dist/core/task-registry-agent.js +1 -1
- package/dist/core/task-registry-shared.d.ts +12 -1
- package/dist/core/task-registry-shared.js +3 -1
- package/dist/core/task-registry-workflow.d.ts +1 -1
- package/dist/core/task-registry-workflow.js +9 -1
- package/dist/core/task-registry.d.ts +40 -2
- package/dist/core/task-registry.js +80 -15
- package/dist/core/task-result.d.ts +18 -3
- package/dist/core/task-spec-members.d.ts +3 -1
- package/dist/core/task-spec-members.js +19 -3
- package/dist/core/task-spec.d.ts +48 -22
- package/dist/core/tool-catalog-entries.js +2 -0
- package/dist/core/tool-gate-phase.d.ts +6 -3
- package/dist/core/tool-gate-phase.js +1 -0
- package/dist/core/tool-mount-facts.d.ts +8 -4
- package/dist/core/tool-mount-facts.js +7 -2
- package/dist/core/tool-mount-plan.d.ts +3 -1
- package/dist/core/tool-mount-plan.js +10 -3
- package/dist/core/tool-mount-static.d.ts +1 -1
- package/dist/core/tool-mount-static.js +4 -2
- package/dist/core/tool-result-store.d.ts +56 -3
- package/dist/core/tool-result-store.js +219 -25
- package/dist/core/tool-spec.d.ts +9 -2
- package/dist/core/trace.d.ts +3 -3
- package/dist/core/user-attachment.d.ts +5 -1
- package/dist/core/user-attachment.js +14 -7
- package/dist/core/wiring-manifest.d.ts +26 -20
- package/dist/core/wiring-manifest.js +7 -3
- package/dist/core/workflow-journal-store.d.ts +53 -10
- package/dist/core/workflow-journal-store.js +27 -4
- package/dist/core/workflow-run-store-contract.js +16 -0
- package/dist/core/workflow-run-store.d.ts +9 -7
- package/dist/core/workflow-run-store.js +4 -1
- package/dist/engine/execution-env/node-execution-env.d.ts +75 -1
- package/dist/engine/execution-env/node-execution-env.js +227 -13
- package/dist/engine/harness/types.d.ts +49 -1
- package/dist/engine/harness/types.js +10 -0
- package/dist/engine/llm/types.d.ts +13 -7
- package/dist/engine/llm/validation.d.ts +8 -1
- package/dist/engine/llm/validation.js +31 -2
- package/dist/engine/lsp/node-lsp-manager.js +2 -1
- package/dist/engine/session/import-validate.js +6 -1
- package/dist/engine/session/session.d.ts +15 -2
- package/dist/engine/session/session.js +34 -4
- package/dist/host-env.d.ts +10 -0
- package/dist/host-env.js +1 -0
- package/dist/index.d.ts +28 -9
- package/dist/index.js +22 -6
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/orchestration/goal.js +1 -1
- package/dist/orchestration/run-workflow-tool.js +40 -32
- package/dist/orchestration/workflow-park-adoption.d.ts +51 -12
- package/dist/orchestration/workflow-park-adoption.js +47 -12
- package/dist/orchestration/workflow-primitives.js +10 -1
- package/dist/orchestration/workflow-script-runner.d.ts +2 -2
- package/dist/orchestration/workflow-stop.d.ts +128 -0
- package/dist/orchestration/workflow-stop.js +156 -0
- package/dist/orchestration/workflow.d.ts +31 -7
- package/dist/orchestration/workflow.js +119 -57
- package/dist/prompts/manager-recipe.d.ts +18 -0
- package/dist/prompts/manager-recipe.js +24 -0
- package/dist/shell/lex.d.ts +2 -2
- package/dist/shell/lex.js +1 -1
- package/dist/stores/file/permission-rule-store.d.ts +3 -1
- package/dist/stores/file/permission-rule-store.js +0 -1
- package/dist/stores/file/workflow-journal-store.d.ts +16 -3
- package/dist/stores/file/workflow-journal-store.js +93 -5
- package/dist/stores/file/workflow-run-store.d.ts +1 -1
- package/dist/tools/fs/bash-model-shell.d.ts +23 -0
- package/dist/tools/fs/bash-model-shell.js +25 -0
- package/dist/tools/fs/bash-readonly-classifier.d.ts +6 -0
- package/dist/tools/fs/bash-readonly-classifier.js +3 -0
- package/dist/tools/fs/file-write-check.js +9 -3
- package/dist/tools/fs/fs-bash.js +13 -11
- package/dist/tools/fs/index.d.ts +8 -7
- package/dist/tools/fs/index.js +4 -4
- package/dist/tools/fs/read-deny-home.d.ts +1 -1
- package/dist/tools/fs/read-deny-home.js +5 -5
- package/dist/tools/fs/read-deny.d.ts +33 -8
- package/dist/tools/fs/read-deny.js +114 -25
- package/dist/tools/fs/safety.d.ts +4 -1
- package/dist/tools/fs/safety.js +4 -2
- package/dist/tools/fs/shell-read-argv.js +1 -0
- package/dist/tools/fs/shell-read-check.d.ts +9 -2
- package/dist/tools/fs/shell-read-check.js +134 -22
- package/dist/tools/fs/shell-read-establish.d.ts +9 -0
- package/dist/tools/fs/shell-read-establish.js +21 -11
- package/dist/tools/fs/shell-read-judge.d.ts +13 -1
- package/dist/tools/fs/shell-read-judge.js +26 -7
- package/dist/tools/fs/shell-read-plan.d.ts +7 -3
- package/dist/tools/fs/shell-read-plan.js +8 -5
- package/dist/tools/fs/shell-read-word.d.ts +8 -0
- package/dist/tools/fs/shell-read-word.js +13 -4
- package/dist/tools/fs/shell-read-write-targets.js +17 -9
- package/dist/tools/monitor.js +12 -8
- package/dist/tools/scheduler-tools.d.ts +1 -0
- package/dist/tools/scheduler-tools.js +5 -2
- package/package.json +3 -2
- package/test/export-surface.snapshot.json +192 -3
- package/wire-changes/answers/core-stores-sql@7.73.0.json +28 -0
- package/wire-changes/answers/core-stores-sql@7.74.0.json +7 -0
- package/wire-changes/answers/core@7.73.0.json +216 -0
- package/wire-changes/answers/core@7.74.0.json +68 -0
- package/wire-changes/answers/mods-kernel@7.73.0.json +7 -0
- package/wire-changes/answers/mods-kernel@7.74.0.json +21 -0
- package/wire-changes/answers/primitives@7.73.0.json +12 -0
- package/wire-changes/answers/primitives@7.74.0.json +7 -0
- package/wire-changes/answers/wiki-gate@7.73.0.json +7 -0
- package/wire-changes/answers/wiki-gate@7.74.0.json +8 -0
- package/wire-changes/core-stores-sql@7.73.0.json +326 -0
- package/wire-changes/core-stores-sql@7.74.0.json +143 -0
- package/wire-changes/core@7.73.0.json +6480 -0
- package/wire-changes/core@7.74.0.json +2210 -0
- package/wire-changes/mods-kernel@7.73.0.json +147 -0
- package/wire-changes/mods-kernel@7.74.0.json +421 -0
- package/wire-changes/primitives@7.73.0.json +227 -0
- package/wire-changes/primitives@7.74.0.json +174 -0
- package/wire-changes/wiki-gate@7.73.0.json +145 -0
- package/wire-changes/wiki-gate@7.74.0.json +145 -0
|
@@ -284,7 +284,32 @@ export interface ResumeClaimAnswer {
|
|
|
284
284
|
* not read (0 or less: refused while expired is a contradiction; not a safe integer; over the bound) names no instant and
|
|
285
285
|
* says the store's answer does not read. */
|
|
286
286
|
remainingMs?: number;
|
|
287
|
+
/** On a refusal because the key carries a permanent stop tombstone ({@link WorkflowJournalStore.stopResumeClaim}): who stopped
|
|
288
|
+
* the workflow tree. Reported explicitly by the store, never guessed by a caller from a prefix on `holder`. */
|
|
289
|
+
stopped?: {
|
|
290
|
+
readonly by: string;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
/** Input to {@link WorkflowJournalStore.stopResumeClaim} (#5156 R1). */
|
|
294
|
+
export interface StopResumeClaimArgs {
|
|
295
|
+
/** The claim key (the workflow tree's root or tree id — opaque to the store, keyed verbatim as in {@link ResumeClaimArgs}). */
|
|
296
|
+
sourceRunId: string;
|
|
297
|
+
scope: string;
|
|
298
|
+
/** Non-empty identifier of who stopped the workflow tree (e.g. `"user"`, `"parent"`, `"system"`), echoed on
|
|
299
|
+
* {@link ResumeClaimAnswer.stopped}. */
|
|
300
|
+
stoppedBy: string;
|
|
301
|
+
/** When given, a binding claim currently held by THIS holder (arm (c): the caller's own in-process run, or a terminal run
|
|
302
|
+
* whose release failed) is rewritten into a tombstone in place; any other binding holder refuses without writing. */
|
|
303
|
+
holder?: string;
|
|
287
304
|
}
|
|
305
|
+
/** What {@link WorkflowJournalStore.stopResumeClaim} answers: `{ stopped: true }` once a tombstone stands on `(sourceRunId, scope)`,
|
|
306
|
+
* or `{ stopped: false, holder? }` when another binding holder owns the claim (nothing written). */
|
|
307
|
+
export type StopResumeClaimAnswer = {
|
|
308
|
+
readonly stopped: true;
|
|
309
|
+
} | {
|
|
310
|
+
readonly stopped: false;
|
|
311
|
+
readonly holder?: string;
|
|
312
|
+
};
|
|
288
313
|
/**
|
|
289
314
|
* The seam a resume reads/writes its journal through. Core ships {@link InMemoryWorkflowJournalStore}; a durable
|
|
290
315
|
* deployment provides a Postgres-backed one (service SVC-2) so a workflow survives a replica crash. The owner of
|
|
@@ -446,6 +471,21 @@ export interface WorkflowJournalStore {
|
|
|
446
471
|
* rely on the engine waiting indefinitely for cleanup.
|
|
447
472
|
*/
|
|
448
473
|
releaseResumeClaim?(input: ResumeClaimArgs): Promise<void>;
|
|
474
|
+
/**
|
|
475
|
+
* Write a permanent stop tombstone on `(sourceRunId, scope)` in one compare-and-write (#5156 R1):
|
|
476
|
+
* - (a) row absent ⇒ write tombstone, answer `{ stopped: true }`;
|
|
477
|
+
* - (b) row no longer binds (expired, or holder process proven gone on a store that checks it) ⇒ replace with tombstone,
|
|
478
|
+
* answer `{ stopped: true }`;
|
|
479
|
+
* - (c) `holder` given and matches the current holder ⇒ rewrite in place into a tombstone (dropping any holder process),
|
|
480
|
+
* answer `{ stopped: true }`;
|
|
481
|
+
* - (d) already a tombstone ⇒ idempotent, preserve the existing tombstone as stored, answer `{ stopped: true }`;
|
|
482
|
+
* - held by another and still binding ⇒ write nothing, answer `{ stopped: false, holder }`.
|
|
483
|
+
*
|
|
484
|
+
* A tombstone never expires, is never taken over, is never deleted by {@link releaseResumeClaim} (for any holder string),
|
|
485
|
+
* sweep or {@link deleteRun}, and makes {@link resumeClaim} answer `{ granted: false, stopped: { by } }`.
|
|
486
|
+
* OPTIONAL: a store without this verb is legal.
|
|
487
|
+
*/
|
|
488
|
+
stopResumeClaim?(input: StopResumeClaimArgs): Promise<StopResumeClaimAnswer>;
|
|
449
489
|
}
|
|
450
490
|
export declare const MAX_JOURNAL_RESULT_BYTES: number;
|
|
451
491
|
/** True when a serialized journal result is too large to store (UTF-8 byte length over {@link MAX_JOURNAL_RESULT_BYTES}). */
|
|
@@ -524,21 +564,24 @@ export declare const IN_MEMORY_RESUME_CLAIM_TTL_MS: number;
|
|
|
524
564
|
* this one process. */
|
|
525
565
|
export declare class InMemoryWorkflowJournalStore implements WorkflowJournalStore {
|
|
526
566
|
private readonly runs;
|
|
527
|
-
/** RB-367 resume claims, nested by scope then sourceRunId (rather than a single
|
|
528
|
-
* untrusted-length `scope`/`sourceRunId` text (`sourceRunId` is `resumeFromRunId` — LLM-controlled)
|
|
529
|
-
* collide across the boundary between the two fields.
|
|
567
|
+
/** RB-367 resume claims and #5156 R1 native tombstones, nested by scope then sourceRunId (rather than a single
|
|
568
|
+
* string-concatenated key) so untrusted-length `scope`/`sourceRunId` text (`sourceRunId` is `resumeFromRunId` — LLM-controlled)
|
|
569
|
+
* can never collide across the boundary between the two fields. Tombstones are a distinct variant — never a sentinel holder
|
|
570
|
+
* string — so `releaseResumeClaim` for any string can never delete one. */
|
|
530
571
|
private readonly resumeClaims;
|
|
531
572
|
private claimsForScope;
|
|
532
|
-
/** Contract parity with the file store: keyed by `(sourceRunId, scope)`;
|
|
533
|
-
* SAME holder; an unexpired claim held by someone else refuses (naming the holder); an expired or
|
|
534
|
-
* claim is free to take. Acquisition is a single synchronous Map read-then-write with no `await` between
|
|
535
|
-
* the
|
|
536
|
-
*
|
|
537
|
-
*
|
|
573
|
+
/** Contract parity with the file store: keyed by `(sourceRunId, scope)`; a tombstone always refuses with `stopped: { by }`;
|
|
574
|
+
* idempotent re-grant to the SAME holder; an unexpired claim held by someone else refuses (naming the holder); an expired or
|
|
575
|
+
* absent claim is free to take. Acquisition is a single synchronous Map read-then-write with no `await` between the check and
|
|
576
|
+
* the publish — there is no window (matching the atomicity RB-354 requires of a durable implementation) in which a concurrent
|
|
577
|
+
* caller could observe the key as free mid-acquire. Both answers say how long the claim has left by this process's clock (a
|
|
578
|
+
* re-claim by its holder starts the lease again). */
|
|
538
579
|
resumeClaim(input: ResumeClaimArgs): Promise<ResumeClaimAnswer>;
|
|
539
|
-
/** Release ONLY a claim `newRunId` still holds (a missing/foreign/already-taken-over claim is a
|
|
580
|
+
/** Release ONLY a claim `newRunId` still holds (a missing/foreign/already-taken-over claim or a tombstone is a
|
|
540
581
|
* no-op, never an error — matches the file store's contract). */
|
|
541
582
|
releaseResumeClaim(input: ResumeClaimArgs): Promise<void>;
|
|
583
|
+
/** #5156 R1 — compare-and-write a native tombstone on `(sourceRunId, scope)` (single synchronous Map step). */
|
|
584
|
+
stopResumeClaim(input: StopResumeClaimArgs): Promise<StopResumeClaimAnswer>;
|
|
542
585
|
deleteRun(runId: string, scope: string): Promise<boolean>;
|
|
543
586
|
/** Launch records by run id, each with the scope it was kept under. */
|
|
544
587
|
private readonly launches;
|
|
@@ -312,11 +312,16 @@ export class InMemoryWorkflowJournalStore {
|
|
|
312
312
|
const table = this.claimsForScope(input.scope);
|
|
313
313
|
const now = Date.now();
|
|
314
314
|
const existing = table.get(input.sourceRunId);
|
|
315
|
-
if (existing !== undefined
|
|
316
|
-
|
|
315
|
+
if (existing !== undefined) {
|
|
316
|
+
if (existing.kind === "tombstone") {
|
|
317
|
+
return { granted: false, stopped: { by: existing.stoppedBy } };
|
|
318
|
+
}
|
|
319
|
+
if (existing.expiresAt > now && existing.holder !== input.newRunId) {
|
|
320
|
+
return { granted: false, holder: existing.holder, ...resumeClaimRemainingMember(existing.expiresAt, now) };
|
|
321
|
+
}
|
|
317
322
|
}
|
|
318
323
|
const expiresAt = now + IN_MEMORY_RESUME_CLAIM_TTL_MS;
|
|
319
|
-
table.set(input.sourceRunId, { holder: input.newRunId, expiresAt });
|
|
324
|
+
table.set(input.sourceRunId, { kind: "claim", holder: input.newRunId, expiresAt });
|
|
320
325
|
return { granted: true, ...resumeClaimRemainingMember(expiresAt, now) };
|
|
321
326
|
}
|
|
322
327
|
async releaseResumeClaim(input) {
|
|
@@ -324,9 +329,27 @@ export class InMemoryWorkflowJournalStore {
|
|
|
324
329
|
if (table === undefined)
|
|
325
330
|
return;
|
|
326
331
|
const existing = table.get(input.sourceRunId);
|
|
327
|
-
if (existing !== undefined && existing.holder === input.newRunId)
|
|
332
|
+
if (existing !== undefined && existing.kind === "claim" && existing.holder === input.newRunId)
|
|
328
333
|
table.delete(input.sourceRunId);
|
|
329
334
|
}
|
|
335
|
+
async stopResumeClaim(input) {
|
|
336
|
+
if (typeof input.stoppedBy !== "string" || input.stoppedBy === "") {
|
|
337
|
+
throw new TypeError("workflow journal: stopResumeClaim requires a non-empty stoppedBy string");
|
|
338
|
+
}
|
|
339
|
+
const table = this.claimsForScope(input.scope);
|
|
340
|
+
const now = Date.now();
|
|
341
|
+
const existing = table.get(input.sourceRunId);
|
|
342
|
+
if (existing !== undefined) {
|
|
343
|
+
if (existing.kind === "tombstone")
|
|
344
|
+
return { stopped: true };
|
|
345
|
+
const binds = existing.expiresAt > now;
|
|
346
|
+
if (binds && (input.holder === undefined || existing.holder !== input.holder)) {
|
|
347
|
+
return { stopped: false, holder: existing.holder };
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
table.set(input.sourceRunId, { kind: "tombstone", stoppedBy: input.stoppedBy, stoppedAt: now });
|
|
351
|
+
return { stopped: true };
|
|
352
|
+
}
|
|
330
353
|
async deleteRun(runId, scope) {
|
|
331
354
|
const launch = this.launches.get(runId);
|
|
332
355
|
if (launch !== undefined && launch.scope === scope)
|
|
@@ -155,6 +155,22 @@ export async function workflowRunStoreContract(make, runAssertion = defaultSeque
|
|
|
155
155
|
assert.equal(await store.update("fin", "tenant-a", { ...passed, parks: [{ ...entry, passedTo: "fin-other" }] }, { rev: got.rev ?? 0 }), false, "the same expectation loses once the row moved");
|
|
156
156
|
assert.deepEqual((await store.get("fin")).parks, [{ ...entry, passedTo: "fin-next" }], "a lost write changes nothing");
|
|
157
157
|
});
|
|
158
|
+
run("update never moves a terminal run (completed or failed) back to running: the write loses and changes nothing", async () => {
|
|
159
|
+
const store = make();
|
|
160
|
+
for (const status of ["completed", "failed"]) {
|
|
161
|
+
const id = `term-${status}`;
|
|
162
|
+
await store.put(id, createWorkflowRun({ id, status, creationId: `c-${status}` }));
|
|
163
|
+
const before = (await store.get(id));
|
|
164
|
+
const backToRunning = { ...before, status: "running", endedAt: undefined };
|
|
165
|
+
assert.equal(await store.update(id, "tenant-a", backToRunning, { rev: before.rev ?? 0 }), false, `${status} -> running loses with matching rev`);
|
|
166
|
+
assert.equal(await store.update(id, "tenant-a", backToRunning, { rev: before.rev ?? 0, creationId: `c-${status}` }), false, `${status} -> running loses with matching rev and creationId`);
|
|
167
|
+
assert.equal(await store.update(id, "tenant-a", backToRunning), false, `${status} -> running loses without expect`);
|
|
168
|
+
for (const cause of WORKFLOW_RUN_UPDATE_CAUSES) {
|
|
169
|
+
assert.equal(await store.update(id, "tenant-a", backToRunning, { rev: before.rev ?? 0, creationId: `c-${status}` }, { cause }), false, `${status} -> running loses with cause ${cause}`);
|
|
170
|
+
}
|
|
171
|
+
assert.deepEqual(await store.get(id), before, `${status} row is untouched after refused writes`);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
158
174
|
run("an update stating a cause persists the same row as one stating none, and wins and loses on rev, scope and a missing row the same way", async () => {
|
|
159
175
|
const store = make();
|
|
160
176
|
for (const cause of WORKFLOW_RUN_UPDATE_CAUSES) {
|
|
@@ -267,9 +267,11 @@ export interface WorkflowRunStore {
|
|
|
267
267
|
* Atomic CAS update of an EXISTING run (`UPDATE … SET … WHERE id=? AND scope=?` [`AND rev=?`] [`AND` the creation id]). Returns
|
|
268
268
|
* `true` for the winner, `false` when the row is missing, the `scope` does not match (multi-tenant
|
|
269
269
|
* isolation — a wrong-scope update must not win), `expect.rev` does not match the live row's `rev`
|
|
270
|
-
* (an intervening update bumped it),
|
|
270
|
+
* (an intervening update bumped it), `expect.creationId` is given and the live row is another creation of the id
|
|
271
271
|
* ({@link WorkflowRunUpdateExpect}: a string must equal the row's member, `null` matches only a row whose member is not a string —
|
|
272
|
-
* a SQL twin compares "is the extracted value a string", never "IS NULL", since a stored JSON null reads differently per dialect)
|
|
272
|
+
* a SQL twin compares "is the extracted value a string", never "IS NULL", since a stored JSON null reads differently per dialect),
|
|
273
|
+
* or the live row is terminal (`completed` / `failed`) and the candidate would move it back to `running` (a finished run never moves
|
|
274
|
+
* back to running; updates that keep a terminal row terminal — `park_pass`, `park_decision_settled`, `tree_id_stamp` — still apply).
|
|
273
275
|
* A write that loses changes nothing. On success the store bumps the row's `rev` (monotonic) and persists
|
|
274
276
|
* the new `run`. The workflow owner writes its record while it runs (best-effort progress recording — design/97 §F);
|
|
275
277
|
* once the run has finished, a later continuation of its chain may write it again to take over a park it holds
|
|
@@ -337,8 +339,8 @@ export interface WorkflowRunStore {
|
|
|
337
339
|
/**
|
|
338
340
|
* REF-A5 — THE optimistic-concurrency guard for {@link WorkflowRunStore.update}, shared by every backend:
|
|
339
341
|
* scope in the WHERE (multi-tenant isolation — a wrong-scope update never wins), row must exist, an
|
|
340
|
-
* `expect.rev` that no longer matches the LIVE row loses (an intervening update bumped it),
|
|
341
|
-
* not loses ({@link WorkflowRunUpdateExpect}). Returns the
|
|
342
|
+
* `expect.rev` that no longer matches the LIVE row loses (an intervening update bumped it), an `expect.creationId` the live row is
|
|
343
|
+
* not loses ({@link WorkflowRunUpdateExpect}), and a terminal row never moves back to a non-terminal state. Returns the
|
|
342
344
|
* row to persist, or `null` when the CAS lost; PURE — it neither reads nor writes any store state, so
|
|
343
345
|
* each backend keeps its own persistence mechanism (in-memory `Map.set` vs ledger commit) around it.
|
|
344
346
|
* RB-59 (a cross-instance CAS both instances won) landed on this predicate.
|
|
@@ -400,9 +402,9 @@ export interface WorkflowRunReapFault {
|
|
|
400
402
|
* erases its runs ({@link import("./retention.js").RETENTION_CASCADE}): its journal, then its persisted script, then its row
|
|
401
403
|
* ({@link WorkflowRunStore.deleteRun}) — so nothing a run id keys outlives the row it is found through. Before a run's first leg its
|
|
402
404
|
* record is read again and the selection re-judged on it (gone, no longer a terminal run of the scope, or — doomed by age — ended
|
|
403
|
-
* since: skipped, nothing of it erased). A run's three parts are all there or its row is gone
|
|
404
|
-
* terminal row back to running
|
|
405
|
-
*
|
|
405
|
+
* since: skipped, nothing of it erased). A run's three parts are all there or its row is gone (a conforming store refuses moving a
|
|
406
|
+
* terminal row back to running; only an id deleted and recreated as running between that re-judgment and the row step leaves the
|
|
407
|
+
* new running row in `kept`). Once its first leg has run, every
|
|
406
408
|
* leg runs, the row's last, whatever the ones before it answered — a row left beside an erased journal is a run a resume would run
|
|
407
409
|
* again from its start. A leg that throws is one entry of `kept` (its part stays in that store; a run whose row's own leg threw keeps
|
|
408
410
|
* its row, and the next sweep finds it again); a row that is no longer a terminal run when its own turn comes is reported the same
|
|
@@ -124,7 +124,10 @@ export function nextWorkflowRunOnUpdate(cur, id, scope, run, expect, disclose) {
|
|
|
124
124
|
next.id = id;
|
|
125
125
|
next.scope = scope;
|
|
126
126
|
next.rev = (live.rev ?? 0) + 1;
|
|
127
|
-
|
|
127
|
+
const admitted = admitWorkflowRun(next, id);
|
|
128
|
+
if (isTerminalWorkflowStatus(live.status) && !isTerminalWorkflowStatus(admitted.status))
|
|
129
|
+
return null;
|
|
130
|
+
return admitted;
|
|
128
131
|
}
|
|
129
132
|
function orderKey(value) {
|
|
130
133
|
return typeof value === "number" && Number.isFinite(value) ? value : -Infinity;
|
|
@@ -2,7 +2,8 @@ import { type FileHandle } from "node:fs/promises";
|
|
|
2
2
|
import { type BoundFileObject, type ExecResult, type ExecutionEnv, ExecutionError, type ExecutionEnvExecOptions, FileError, type FileInfo, type Result } from "../harness/types.js";
|
|
3
3
|
import { type SecretEnvFinding } from "../../core/secret-env.js";
|
|
4
4
|
import { type EngineNotice } from "../../core/engine-notice.js";
|
|
5
|
-
import type { ExecutionEnvCapabilities, SymlinkChain } from "../harness/types.js";
|
|
5
|
+
import type { ExecutionEnvModelShell, ExecutionEnvCapabilities, SymlinkChain } from "../harness/types.js";
|
|
6
|
+
import { type ShellKindAnswer, type DroppedShellState } from "../../core/model-shell.js";
|
|
6
7
|
import type { BackgroundHardKillOutcome, BackgroundShellCapability, BackgroundShellId, BackgroundPoll, BackgroundSpawnOptions } from "../../core/background-shell.js";
|
|
7
8
|
import { BackgroundShellError } from "../../core/background-shell.js";
|
|
8
9
|
import type { SchedulerCapability, ScheduledIntent, SchedulerContext, ScheduledTaskId, ScheduledTaskSummary } from "../../core/scheduler.js";
|
|
@@ -22,6 +23,37 @@ export declare function getShellConfig(customShellPath?: string): Promise<Result
|
|
|
22
23
|
shell: string;
|
|
23
24
|
args: string[];
|
|
24
25
|
}, ExecutionError>>;
|
|
26
|
+
/** What {@link resolveModelShell} looks at: the platform, whether a path exists, whether it is an executable file, the Program Files roots. */
|
|
27
|
+
export interface ModelShellCandidateProbe {
|
|
28
|
+
readonly platform: NodeJS.Platform;
|
|
29
|
+
readonly exists: (path: string) => Promise<boolean>;
|
|
30
|
+
readonly executable: (path: string) => Promise<boolean>;
|
|
31
|
+
readonly programFiles: readonly (string | undefined)[];
|
|
32
|
+
}
|
|
33
|
+
/** Where a start runs: the environment's working directory and the PATH its child receives. */
|
|
34
|
+
export interface ModelShellPlace {
|
|
35
|
+
readonly cwd: string;
|
|
36
|
+
readonly searchPath: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
/** The entries of the PATH a composed child environment holds, as `platform` reads it: the name compared as the platform compares
|
|
39
|
+
* names (win32 case-blind: `Path`), the list split on the platform's separator (`;` on win32, `:` elsewhere); `[]` when there is none. */
|
|
40
|
+
export declare function modelShellSearchPath(env: NodeJS.ProcessEnv, platform?: NodeJS.Platform): readonly string[];
|
|
41
|
+
/** One candidate asked what it is ({@link SHELL_KIND_QUESTION}), once per environment: the absolute program (what makes the asked
|
|
42
|
+
* and the started one the same), in the environment's own cwd (not a call's — the question is asked before any call), in the fixed
|
|
43
|
+
* least environment {@link shellKindQuestionEnv} reads out of this process's own as the scrub hands it on when the question is asked
|
|
44
|
+
* (no `shellEnv`, no earlier snapshot), stdin closed, five seconds. Only a run that ends with status 0 and answers as
|
|
45
|
+
* {@link readShellKindAnswer} reads is an answer. The answer is the program's own report of what it is. */
|
|
46
|
+
export declare function askShellKind(path: string, cwd: string): Promise<ShellKindAnswer>;
|
|
47
|
+
/** The absolute program a start for model text runs on, the one that was asked, with the version it reported: the host's `shellPath`
|
|
48
|
+
* alone, fixed as one absolute program ({@link programOf}; nothing there keeps {@link getShellConfig}'s sentence); else on win32 Git
|
|
49
|
+
* Bash under each Program Files root, else `/bin/bash` — each asked when it exists — and only after those `bash` found by the same
|
|
50
|
+
* {@link programOf} on the child's PATH (one lookup for both); never `sh`, never zsh (this version starts only a bash), never a
|
|
51
|
+
* candidate that is not fully qualified (a relative `ProgramFiles`). The first that answers bash 3.2 or later is taken; a candidate
|
|
52
|
+
* that answers zsh is not; otherwise `shell_unavailable` names each candidate and why. */
|
|
53
|
+
export declare function resolveModelShell(shellPath: string | undefined, place: ModelShellPlace, probe?: ModelShellCandidateProbe, ask?: (path: string, cwd: string) => Promise<ShellKindAnswer>): Promise<Result<{
|
|
54
|
+
readonly path: string;
|
|
55
|
+
readonly version: string;
|
|
56
|
+
}, ExecutionError>>;
|
|
25
57
|
/** test seam (mirrors the notice-seat announce reset): the once-per-process fallback latches. */
|
|
26
58
|
export declare function __resetSecretScrubAnnouncement(): void;
|
|
27
59
|
/** RB-235: the spool-reclaim decision, extracted PURE so every rule is unit-pinnable.
|
|
@@ -80,6 +112,11 @@ export declare function openSpoolPair(base: string): {
|
|
|
80
112
|
errPath: string;
|
|
81
113
|
fds: [number, number];
|
|
82
114
|
};
|
|
115
|
+
/** How many dropped variables an environment's {@link NodeExecutionEnv.modelShellDropped} record keeps. */
|
|
116
|
+
export declare const MODEL_SHELL_DROPPED_KEPT = 32;
|
|
117
|
+
/** The keys of the two shared start routines: module symbols, so no ordinary subclass method takes their place (reflection can still reach them). */
|
|
118
|
+
declare const RUN_SHELL: unique symbol;
|
|
119
|
+
declare const START_BACKGROUND: unique symbol;
|
|
83
120
|
export declare class NodeExecutionEnv implements ExecutionEnv, BackgroundShellCapability, SchedulerCapability {
|
|
84
121
|
cwd: string;
|
|
85
122
|
/** `ExecutionEnv.capabilities`: the engine's own host — commands are this process's children on its own disk, not
|
|
@@ -207,6 +244,39 @@ export declare class NodeExecutionEnv implements ExecutionEnv, BackgroundShellCa
|
|
|
207
244
|
* host does not apply, is the reason the start is refused (the command never runs, confined or not). */
|
|
208
245
|
private startOf;
|
|
209
246
|
exec(command: string, options?: ExecutionEnvExecOptions): Promise<Result<ExecResult, ExecutionError>>;
|
|
247
|
+
/** `ExecutionEnv.modelShell`: the start for model-written shell text, on the one absolute program {@link resolveModelShell} asked for this
|
|
248
|
+
* environment (asked once, in the environment's cwd; `ready` reports its answer, `{ shell: "bash", version }`), with the child
|
|
249
|
+
* environment of {@link modelShellSpawnEnv}. Each start ends in `this.exec` / `this.spawnBackground`, so a subclass's override of either
|
|
250
|
+
* sees every start for model text; the start rides on the call's options under a module symbol, and the base's method reached with
|
|
251
|
+
* those options (an override's `super` call that hands them on, spread or not) starts the asked bash with that environment. Each start
|
|
252
|
+
* reads `shellEnv` once; the PATH the program is found on comes from this process's inheritance as it stands at the lookup, the
|
|
253
|
+
* question is asked in its own least environment ({@link askShellKind}), and the child's is composed when the child is started — a
|
|
254
|
+
* declaration made in between is judged by the child's. A composition that refuses is that start's failure (`spawn_error` /
|
|
255
|
+
* `spawn_failed`), and the next start composes again. A start an override hands on to ANOTHER environment's method is started by
|
|
256
|
+
* that environment's own start (its asked bash, its composition), never by this one's. */
|
|
257
|
+
get modelShell(): Required<ExecutionEnvModelShell>;
|
|
258
|
+
/** The bash this environment starts model text on, resolved once per environment object, on the PATH of the first question's composition
|
|
259
|
+
* ({@link modelShellSearchPath}) — kept while it holds: a resolution that found no bash while a candidate gave no answer at all (it
|
|
260
|
+
* could not be started, timed out or was ended by a signal: `askShellKindOnce`'s `ran: false`) is not kept, and the next reading or
|
|
261
|
+
* start asks again; a candidate that answered (not a bash, a bash below 3.2, a zsh) or a path that is not there is kept. */
|
|
262
|
+
private modelShellResolved?;
|
|
263
|
+
private modelShellPath;
|
|
264
|
+
/** `ExecutionEnv.modelShellDropped`: what the starts of this environment did not pass ({@link DroppedShellState}), each variable once
|
|
265
|
+
* (by where it came from), up to {@link MODEL_SHELL_DROPPED_KEPT} variables; past that, `more` says there were others and nothing else
|
|
266
|
+
* is kept. One record object for the environment's life, which the run tells as each tool call ends; an environment made from this one
|
|
267
|
+
* by `Object.create` shares it. */
|
|
268
|
+
get modelShellDropped(): {
|
|
269
|
+
readonly entries: readonly DroppedShellState[];
|
|
270
|
+
readonly more: boolean;
|
|
271
|
+
};
|
|
272
|
+
private readonly modelShellDroppedRecord;
|
|
273
|
+
/** A bash start's child environment: the start's one composition with the call's `env` laid over it (a copy without any variable a
|
|
274
|
+
* row of `SHELL_STATE_ENV` holds, `configuredShellLayer`), then the host process's own variables by each row's rule
|
|
275
|
+
* (`inheritedShellState`); what was left out is recorded in {@link modelShellDropped}. */
|
|
276
|
+
private modelShellSpawnEnv;
|
|
277
|
+
/** The one foreground start: `exec` on the shell {@link getShellConfig} finds, a bash start on its bash. Keyed by a module symbol and
|
|
278
|
+
* read off this prototype, so no ordinary subclass method takes its place (reflection can reach the symbol). */
|
|
279
|
+
private [RUN_SHELL];
|
|
210
280
|
readTextFile(path: string, abortSignal?: AbortSignal): Promise<Result<string, FileError>>;
|
|
211
281
|
readTextLines(path: string, options?: {
|
|
212
282
|
maxLines?: number;
|
|
@@ -307,6 +377,9 @@ export declare class NodeExecutionEnv implements ExecutionEnv, BackgroundShellCa
|
|
|
307
377
|
spawnBackground(command: string, options?: BackgroundSpawnOptions): Promise<Result<{
|
|
308
378
|
shellId: BackgroundShellId;
|
|
309
379
|
}, BackgroundShellError>>;
|
|
380
|
+
/** The one background start: `spawnBackground` on the shell {@link getShellConfig} finds, a bash start on its bash. Keyed by a module
|
|
381
|
+
* symbol and read off this prototype, so no ordinary subclass method takes its place (reflection can reach the symbol). */
|
|
382
|
+
private [START_BACKGROUND];
|
|
310
383
|
pollBackground(shellId: BackgroundShellId): Promise<Result<BackgroundPoll, BackgroundShellError>>;
|
|
311
384
|
killBackground(shellId: BackgroundShellId): Promise<Result<void, BackgroundShellError>>;
|
|
312
385
|
/** The synchronous hard kill seat ({@link BackgroundShellCapability.killBackgroundNow}). Reads process truth,
|
|
@@ -346,3 +419,4 @@ export declare class NodeExecutionEnv implements ExecutionEnv, BackgroundShellCa
|
|
|
346
419
|
}): Promise<void>;
|
|
347
420
|
cleanup(): Promise<void>;
|
|
348
421
|
}
|
|
422
|
+
export {};
|