@sema-agent/core 7.68.4 → 7.69.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 +1625 -0
- package/dist/agents/agent-definition.d.ts +32 -3
- package/dist/agents/agent-definition.js +39 -1
- package/dist/agents/agent-transcript-tool.js +16 -5
- package/dist/agents/cascade.js +9 -6
- package/dist/agents/cc-uds-peer-channel.js +2 -1
- package/dist/agents/cumulative-stats.d.ts +3 -1
- package/dist/agents/cumulative-stats.js +4 -1
- package/dist/agents/delegation-review-faces.d.ts +35 -0
- package/dist/agents/delegation-review-faces.js +26 -0
- package/dist/agents/inherited-tool-pool.d.ts +4 -2
- package/dist/agents/list-agents-tool.d.ts +8 -19
- package/dist/agents/list-agents-tool.js +19 -34
- package/dist/agents/peer-directory.js +3 -2
- package/dist/agents/peer-held-queue.d.ts +6 -1
- package/dist/agents/peer-held-queue.js +10 -1
- package/dist/agents/peer-idle.d.ts +3 -1
- package/dist/agents/peer-idle.js +4 -4
- package/dist/agents/peer-session-drain.d.ts +9 -1
- package/dist/agents/peer-session-drain.js +185 -116
- package/dist/agents/repair-loop.js +12 -8
- package/dist/agents/retain-ledger.d.ts +122 -58
- package/dist/agents/retain-ledger.js +48 -21
- package/dist/agents/root-session-lane.d.ts +17 -0
- package/dist/agents/root-session-lane.js +9 -0
- package/dist/agents/send-message-tool.js +44 -31
- package/dist/agents/subagent-steps.d.ts +0 -11
- package/dist/agents/subagent-steps.js +1 -14
- package/dist/agents/subagent-transcript-placement.d.ts +4 -3
- package/dist/agents/subagent.d.ts +19 -8
- package/dist/agents/subagent.js +250 -207
- package/dist/agents/tool-filter.d.ts +31 -1
- package/dist/agents/tool-filter.js +28 -4
- package/dist/agents/verifier-independence.js +3 -2
- package/dist/agents/verify.d.ts +5 -1
- package/dist/agents/verify.js +10 -6
- package/dist/agents/yield-adoption.d.ts +17 -0
- package/dist/agents/yield-adoption.js +22 -2
- package/dist/brain/anthropic.js +42 -14
- package/dist/brain/claude-model-id.d.ts +36 -0
- package/dist/brain/claude-model-id.js +44 -0
- package/dist/brain/failover.js +14 -3
- package/dist/brain/fast-mode.d.ts +272 -0
- package/dist/brain/fast-mode.js +130 -0
- package/dist/brain/media-degrade.d.ts +5 -0
- package/dist/brain/media-degrade.js +1 -0
- package/dist/brain/model-capability.d.ts +122 -18
- package/dist/brain/model-capability.js +84 -7
- package/dist/brain/model-lane.d.ts +40 -16
- package/dist/brain/model-lane.js +97 -39
- package/dist/brain/model-presets.d.ts +4 -1
- package/dist/brain/model-presets.js +10 -1
- package/dist/brain/open-responses.js +37 -14
- package/dist/brain/openai.js +27 -15
- package/dist/brain/provider-dialect.d.ts +9 -0
- package/dist/brain/provider-dialect.js +4 -0
- package/dist/brain/provider-message.d.ts +2 -2
- package/dist/brain/provider-message.js +8 -8
- package/dist/brain/reasoning-request.d.ts +19 -0
- package/dist/brain/reasoning-request.js +8 -4
- package/dist/brain/reasoning-stamp.d.ts +3 -2
- package/dist/brain/reasoning.d.ts +8 -4
- package/dist/brain/reasoning.js +4 -3
- package/dist/brain/reference-model-traits.d.ts +59 -0
- package/dist/brain/reference-model-traits.js +46 -0
- package/dist/brain/request-params.js +1 -0
- package/dist/brain/route-adjudicator.d.ts +107 -106
- package/dist/brain/route-adjudicator.js +217 -51
- package/dist/brain/route-conformance.d.ts +6 -4
- package/dist/brain/routing.d.ts +2 -1
- package/dist/brain/routing.js +21 -5
- package/dist/brain/status-sink.d.ts +52 -10
- package/dist/brain/stream-engine.d.ts +68 -11
- package/dist/brain/stream-engine.js +512 -93
- package/dist/brain/stream-shared.d.ts +34 -8
- package/dist/brain/stream-shared.js +20 -7
- package/dist/brain/usage-reading.d.ts +15 -0
- package/dist/brain/usage-reading.js +18 -5
- package/dist/core/a2a.js +28 -21
- package/dist/core/advisor-verdict.d.ts +5 -4
- package/dist/core/advisor-verdict.js +2 -2
- package/dist/core/agent-definition.d.ts +4 -1
- package/dist/core/agent-state.d.ts +25 -2
- package/dist/core/agent-state.js +50 -3
- package/dist/core/allow-entry.d.ts +6 -6
- package/dist/core/allow-entry.js +27 -25
- package/dist/core/ask-headline.d.ts +28 -16
- package/dist/core/ask-headline.js +18 -8
- package/dist/core/ask-origin.d.ts +105 -30
- package/dist/core/ask-origin.js +40 -11
- package/dist/core/ask-question.d.ts +9 -1
- package/dist/core/ask-question.js +3 -0
- package/dist/core/ask-unresolvable-notice.d.ts +10 -2
- package/dist/core/ask-unresolvable-notice.js +5 -2
- package/dist/core/attachment-source.d.ts +1 -1
- package/dist/core/attachment-source.js +1 -0
- package/dist/core/auto-compaction.d.ts +4 -4
- package/dist/core/auto-compaction.js +4 -3
- package/dist/core/auto-mode-directive.d.ts +30 -60
- package/dist/core/auto-mode-directive.js +36 -38
- package/dist/core/auto-mode.d.ts +40 -9
- package/dist/core/auto-mode.js +20 -5
- package/dist/core/background-agent-store.d.ts +87 -1
- package/dist/core/background-agent-store.js +72 -1
- package/dist/core/background-shell.d.ts +3 -0
- package/dist/core/background-shell.js +1 -0
- package/dist/core/cache-break-detector.js +1 -1
- package/dist/core/caller-text.d.ts +27 -8
- package/dist/core/caller-text.js +47 -1
- package/dist/core/checkpoint-features.d.ts +17 -9
- package/dist/core/checkpoint-identity.d.ts +53 -0
- package/dist/core/checkpoint-identity.js +29 -0
- package/dist/core/checkpoint-queries.d.ts +4 -3
- package/dist/core/checkpoint-queries.js +5 -3
- package/dist/core/checkpoint-rekey.d.ts +70 -0
- package/dist/core/checkpoint-rekey.js +107 -0
- package/dist/core/checkpoint-requirements.d.ts +65 -10
- package/dist/core/checkpoint-requirements.js +47 -13
- package/dist/core/checkpoint-row-verdict.d.ts +5 -3
- package/dist/core/checkpoint-row-verdict.js +37 -4
- package/dist/core/checkpoint-store.d.ts +71 -5
- package/dist/core/checkpoint-store.js +38 -7
- package/dist/core/child-clamp-seats.js +2 -1
- package/dist/core/classifier-category.d.ts +25 -0
- package/dist/core/classifier-category.js +93 -0
- package/dist/core/classifier-unavailable-arm.d.ts +62 -8
- package/dist/core/classifier-unavailable-arm.js +19 -2
- package/dist/core/command-sandbox-dispatch.d.ts +14 -2
- package/dist/core/command-sandbox.d.ts +209 -28
- package/dist/core/command-sandbox.js +195 -20
- package/dist/core/config-refusal-codes.d.ts +41 -1
- package/dist/core/config-refusal-codes.js +16 -0
- package/dist/core/context-edit.d.ts +2 -1
- package/dist/core/context-edit.js +2 -1
- package/dist/core/context-settings.js +5 -4
- package/dist/core/cross-boundary-taint.d.ts +15 -1
- package/dist/core/cross-boundary-taint.js +6 -0
- package/dist/core/delegation-frames.d.ts +36 -6
- package/dist/core/delegation-frames.js +3 -0
- package/dist/core/delegation-name.d.ts +10 -4
- package/dist/core/delegation-name.js +53 -23
- package/dist/core/engine-attestation.d.ts +10 -2
- package/dist/core/engine-attestation.js +2 -0
- package/dist/core/engine-capabilities.d.ts +40 -3
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-notice.d.ts +197 -90
- package/dist/core/engine-notice.js +29 -1
- package/dist/core/engine-version.d.ts +1 -0
- package/dist/core/engine-version.js +1 -0
- package/dist/core/extension-call-id.d.ts +4 -0
- package/dist/core/extension-call-id.js +8 -0
- package/dist/core/fast-tier-door.d.ts +36 -0
- package/dist/core/fast-tier-door.js +65 -0
- package/dist/core/file-history-store.d.ts +343 -67
- package/dist/core/file-history-store.js +320 -93
- package/dist/core/frame-settlement.d.ts +4 -0
- package/dist/core/frame-settlement.js +5 -0
- package/dist/core/gate-fold.js +13 -4
- package/dist/core/gate-lanes.js +27 -20
- package/dist/core/gate-outcome.d.ts +87 -11
- package/dist/core/gate-outcome.js +94 -4
- package/dist/core/git-worktree-env.d.ts +29 -10
- package/dist/core/git-worktree-env.js +31 -12
- package/dist/core/governance-codes.d.ts +232 -7
- package/dist/core/governance-codes.js +195 -6
- package/dist/core/hooks.d.ts +27 -16
- package/dist/core/hooks.js +84 -82
- package/dist/core/host-floor.d.ts +2 -8
- package/dist/core/host-floor.js +6 -42
- package/dist/core/identity-rekey.d.ts +275 -0
- package/dist/core/identity-rekey.js +198 -0
- package/dist/core/image-admission.d.ts +7 -4
- package/dist/core/image-admission.js +24 -11
- package/dist/core/isolation-scope.d.ts +12 -0
- package/dist/core/isolation-scope.js +4 -0
- package/dist/core/leg-identity.d.ts +32 -2
- package/dist/core/leg-identity.js +16 -2
- package/dist/core/locked-config.d.ts +26 -6
- package/dist/core/locked-config.js +31 -14
- package/dist/core/loopback-host.d.ts +18 -0
- package/dist/core/loopback-host.js +40 -0
- package/dist/core/mcp-connection-pool.d.ts +57 -33
- package/dist/core/mcp-connection-pool.js +47 -23
- package/dist/core/mcp-failure.d.ts +41 -19
- package/dist/core/mcp-failure.js +14 -8
- package/dist/core/mcp-host-read.js +5 -4
- package/dist/core/mcp-host-seat.js +3 -2
- package/dist/core/mcp-name-judge.js +2 -1
- package/dist/core/mcp-server-link.js +2 -1
- package/dist/core/mcp-server-spec.js +2 -2
- package/dist/core/mcp-server-unavailable-notice.d.ts +26 -16
- package/dist/core/mcp-server-unavailable-notice.js +25 -4
- package/dist/core/mcp.d.ts +15 -9
- package/dist/core/mcp.js +46 -34
- package/dist/core/memory-engine/consolidation-driver.js +8 -8
- package/dist/core/memory-engine/consolidation-write-gate.js +3 -2
- package/dist/core/memory-engine/engine.js +9 -9
- package/dist/core/memory-engine/layout.d.ts +6 -5
- package/dist/core/memory-engine/layout.js +1 -1
- package/dist/core/memory.d.ts +5 -0
- package/dist/core/memory.js +3 -0
- package/dist/core/model-fallbacks.d.ts +13 -7
- package/dist/core/model-fallbacks.js +5 -3
- package/dist/core/model-receipt.d.ts +15 -0
- package/dist/core/model-receipt.js +54 -1
- package/dist/core/model-seat.d.ts +17 -15
- package/dist/core/mods/agent-stations.js +5 -4
- package/dist/core/mods/extension-call.d.ts +0 -4
- package/dist/core/mods/extension-call.js +0 -8
- package/dist/core/mods/host.d.ts +18 -0
- package/dist/core/mods/host.js +7 -0
- package/dist/core/mods/kernel/events.d.ts +12 -0
- package/dist/core/mods/kernel/events.js +18 -9
- package/dist/core/mods/kernel/registration.d.ts +13 -0
- package/dist/core/mods/kernel/registration.js +34 -1
- package/dist/core/mods/message-display.js +1 -1
- package/dist/core/mods/package.js +3 -3
- package/dist/core/mods/prompt-submit.js +2 -2
- package/dist/core/mods/session-append.js +3 -3
- package/dist/core/mods/session-compact.js +5 -5
- package/dist/core/mods/session-receive.js +3 -3
- package/dist/core/mods/session-send.js +3 -3
- package/dist/core/mods/stations.d.ts +8 -5
- package/dist/core/mods/stations.js +13 -12
- package/dist/core/mods/tool-call.js +12 -12
- package/dist/core/mounted-mcp.d.ts +10 -1
- package/dist/core/mounted-mcp.js +4 -0
- package/dist/core/output-style.d.ts +14 -8
- package/dist/core/output-style.js +6 -6
- package/dist/core/own-property-receipt.js +3 -5
- package/dist/core/owner-identity.d.ts +68 -0
- package/dist/core/owner-identity.js +39 -0
- package/dist/core/parent-spec-seat.d.ts +5 -1
- package/dist/core/parent-spec-seat.js +2 -0
- package/dist/core/park-resumability.js +2 -2
- package/dist/core/park-selfcheck.js +15 -4
- package/dist/core/peer-seat.d.ts +37 -11
- package/dist/core/peer-seat.js +35 -9
- package/dist/core/permission-rule-model.d.ts +5 -0
- package/dist/core/permission-rule-model.js +27 -6
- package/dist/core/permission-rules.d.ts +42 -5
- package/dist/core/permission-rules.js +74 -10
- package/dist/core/persisted-rule-arms.d.ts +8 -6
- package/dist/core/persisted-rule-arms.js +13 -20
- package/dist/core/physical-path.d.ts +12 -8
- package/dist/core/physical-path.js +24 -14
- package/dist/core/present-plan-tool.js +2 -1
- package/dist/core/pricing.d.ts +65 -8
- package/dist/core/pricing.js +51 -0
- package/dist/core/prompt-section-seat.js +6 -5
- package/dist/core/protocol-http-auth.d.ts +87 -10
- package/dist/core/protocol-http-auth.js +155 -23
- package/dist/core/reminder-mint.d.ts +4 -0
- package/dist/core/reminder-mint.js +1 -0
- package/dist/core/remote-env.d.ts +46 -1
- package/dist/core/remote-env.js +2 -0
- package/dist/core/resume-at-refusal.d.ts +47 -0
- package/dist/core/resume-at-refusal.js +9 -0
- package/dist/core/resume-startup-cause.d.ts +8 -3
- package/dist/core/resume-startup-cause.js +3 -1
- package/dist/core/retired-keys.d.ts +4 -0
- package/dist/core/retired-keys.js +4 -0
- package/dist/core/roles.d.ts +11 -5
- package/dist/core/roles.js +14 -3
- package/dist/core/rule-store-fault.d.ts +8 -1
- package/dist/core/rule-store-fault.js +5 -0
- package/dist/core/runner/advisor-instructions.d.ts +12 -12
- package/dist/core/runner/advisor-instructions.js +7 -24
- package/dist/core/runner/announce-once-ledger.d.ts +23 -8
- package/dist/core/runner/announce-once-ledger.js +69 -18
- package/dist/core/runner/assemble-result.d.ts +9 -0
- package/dist/core/runner/assemble-result.js +3 -2
- package/dist/core/runner/auto-strip-notice.js +1 -1
- package/dist/core/runner/branch-window.js +5 -3
- package/dist/core/runner/call-hook-stations.d.ts +3 -0
- package/dist/core/runner/call-hook-stations.js +4 -3
- package/dist/core/runner/caller-roster.js +2 -1
- package/dist/core/runner/capability-withheld-seat.js +47 -5
- package/dist/core/runner/classifier-ladder.d.ts +48 -8
- package/dist/core/runner/classifier-ladder.js +88 -38
- package/dist/core/runner/clock-and-limits.d.ts +13 -2
- package/dist/core/runner/clock-and-limits.js +11 -8
- package/dist/core/runner/command-sandbox-frame.d.ts +56 -0
- package/dist/core/runner/command-sandbox-frame.js +107 -0
- package/dist/core/runner/compact-session.d.ts +3 -1
- package/dist/core/runner/compact-session.js +16 -10
- package/dist/core/runner/compaction-call-options.d.ts +2 -2
- package/dist/core/runner/compaction-restate.d.ts +4 -4
- package/dist/core/runner/compaction-restate.js +3 -1
- package/dist/core/runner/construction-doors.js +9 -0
- package/dist/core/runner/continuation-gate.d.ts +39 -0
- package/dist/core/runner/continuation-gate.js +42 -0
- package/dist/core/runner/continues-from.d.ts +57 -0
- package/dist/core/runner/continues-from.js +76 -0
- package/dist/core/runner/contracts.d.ts +133 -55
- package/dist/core/runner/credential-refusal-seat.js +31 -12
- package/dist/core/runner/cross-boundary-lane.d.ts +2 -2
- package/dist/core/runner/cross-boundary-lane.js +26 -13
- package/dist/core/runner/delegation-owner.d.ts +99 -9
- package/dist/core/runner/delegation-owner.js +107 -4
- package/dist/core/runner/denial-limit-arms.js +13 -12
- package/dist/core/runner/derived-route-fallback.d.ts +15 -19
- package/dist/core/runner/derived-route-fallback.js +4 -4
- package/dist/core/runner/earlier-grammar-notice.d.ts +6 -0
- package/dist/core/runner/earlier-grammar-notice.js +9 -0
- package/dist/core/runner/end-of-run.d.ts +26 -13
- package/dist/core/runner/end-of-run.js +43 -12
- package/dist/core/runner/env-capability-census.js +2 -1
- package/dist/core/runner/execution-record.d.ts +4 -2
- package/dist/core/runner/execution-record.js +1 -1
- package/dist/core/runner/fast-mode-seat.d.ts +89 -0
- package/dist/core/runner/fast-mode-seat.js +215 -0
- package/dist/core/runner/file-history-restore.d.ts +52 -14
- package/dist/core/runner/file-history-restore.js +50 -8
- package/dist/core/runner/forward-sink.js +2 -2
- package/dist/core/runner/gate-exit.d.ts +41 -3
- package/dist/core/runner/gate-exit.js +55 -10
- package/dist/core/runner/git-leg-delivery.js +6 -3
- package/dist/core/runner/git-status-frame.d.ts +33 -25
- package/dist/core/runner/git-status-frame.js +54 -36
- package/dist/core/runner/halt-attribution.js +2 -2
- package/dist/core/runner/hook-progress-lane.d.ts +26 -0
- package/dist/core/runner/hook-progress-lane.js +72 -0
- package/dist/core/runner/initial-run-state.js +2 -2
- package/dist/core/runner/language-frame.d.ts +10 -8
- package/dist/core/runner/language-frame.js +7 -11
- package/dist/core/runner/left-as-is-seat.d.ts +20 -0
- package/dist/core/runner/left-as-is-seat.js +11 -0
- package/dist/core/runner/leg-receipt.d.ts +38 -0
- package/dist/core/runner/leg-receipt.js +22 -0
- package/dist/core/runner/listing-fold.d.ts +4 -3
- package/dist/core/runner/listing-fold.js +5 -5
- package/dist/core/runner/listing-replay.d.ts +41 -0
- package/dist/core/runner/listing-replay.js +75 -0
- package/dist/core/runner/main-call-account.d.ts +2 -1
- package/dist/core/runner/main-call-account.js +18 -5
- package/dist/core/runner/mcp-redial.d.ts +4 -2
- package/dist/core/runner/mcp-redial.js +3 -0
- package/dist/core/runner/memory-consolidation-driver.js +3 -2
- package/dist/core/runner/model-fallback-seat.d.ts +12 -9
- package/dist/core/runner/model-fallback-seat.js +24 -20
- package/dist/core/runner/nested-memory-lane.d.ts +16 -8
- package/dist/core/runner/nested-memory-lane.js +64 -53
- package/dist/core/runner/permission-rule-lanes.d.ts +4 -3
- package/dist/core/runner/permission-rule-lanes.js +2 -0
- package/dist/core/runner/person-path-rows.js +1 -1
- package/dist/core/runner/placement-fence.js +2 -2
- package/dist/core/runner/policy-throw.d.ts +3 -3
- package/dist/core/runner/policy-throw.js +7 -5
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +7 -1
- package/dist/core/runner/prepare-acquire-reconcile.js +9 -5
- package/dist/core/runner/prepare-advisor.d.ts +3 -0
- package/dist/core/runner/prepare-advisor.js +2 -2
- package/dist/core/runner/prepare-artifact.d.ts +7 -2
- package/dist/core/runner/prepare-artifact.js +18 -7
- package/dist/core/runner/prepare-ask-lane.d.ts +7 -0
- package/dist/core/runner/prepare-ask-lane.js +4 -3
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +9 -5
- package/dist/core/runner/prepare-caps-and-workflow.js +28 -20
- package/dist/core/runner/prepare-config-doors.d.ts +13 -3
- package/dist/core/runner/prepare-config-doors.js +35 -24
- package/dist/core/runner/prepare-context-lane.d.ts +3 -4
- package/dist/core/runner/prepare-context-lane.js +12 -15
- package/dist/core/runner/prepare-defer-classify.d.ts +12 -0
- package/dist/core/runner/prepare-defer-classify.js +5 -2
- package/dist/core/runner/prepare-delegation-surface.d.ts +10 -8
- package/dist/core/runner/prepare-delegation-surface.js +6 -7
- package/dist/core/runner/prepare-execution-env.d.ts +46 -4
- package/dist/core/runner/prepare-execution-env.js +47 -18
- package/dist/core/runner/prepare-file-history.d.ts +4 -1
- package/dist/core/runner/prepare-file-history.js +8 -9
- package/dist/core/runner/prepare-gate-stations.d.ts +17 -9
- package/dist/core/runner/prepare-gate-stations.js +22 -38
- package/dist/core/runner/prepare-hands-readface.d.ts +13 -9
- package/dist/core/runner/prepare-hands-readface.js +26 -35
- package/dist/core/runner/prepare-inherited-gate.d.ts +9 -2
- package/dist/core/runner/prepare-inherited-gate.js +10 -9
- package/dist/core/runner/prepare-leg-adoption.d.ts +36 -0
- package/dist/core/runner/prepare-leg-adoption.js +24 -0
- package/dist/core/runner/prepare-listings.d.ts +3 -0
- package/dist/core/runner/prepare-listings.js +2 -2
- package/dist/core/runner/prepare-lsp.d.ts +0 -3
- package/dist/core/runner/prepare-lsp.js +1 -2
- package/dist/core/runner/prepare-memory-engine-session.js +1 -1
- package/dist/core/runner/prepare-memory.js +2 -2
- package/dist/core/runner/prepare-offload-wrappers.d.ts +5 -5
- package/dist/core/runner/prepare-offload-wrappers.js +5 -5
- package/dist/core/runner/prepare-park-ask.d.ts +9 -2
- package/dist/core/runner/prepare-park-ask.js +5 -3
- package/dist/core/runner/prepare-policy-chain.d.ts +20 -5
- package/dist/core/runner/prepare-policy-chain.js +32 -26
- package/dist/core/runner/prepare-prompt-assembly.d.ts +11 -2
- package/dist/core/runner/prepare-prompt-assembly.js +6 -3
- package/dist/core/runner/prepare-prompt-inputs.d.ts +3 -3
- package/dist/core/runner/prepare-prompt-inputs.js +1 -1
- package/dist/core/runner/prepare-protocol-tools.d.ts +9 -4
- package/dist/core/runner/prepare-protocol-tools.js +11 -11
- package/dist/core/runner/prepare-run-refs.d.ts +7 -0
- package/dist/core/runner/prepare-run-refs.js +6 -2
- package/dist/core/runner/prepare-suspend-saga.d.ts +4 -1
- package/dist/core/runner/prepare-suspend-saga.js +5 -2
- package/dist/core/runner/prepare-task.d.ts +1 -30
- package/dist/core/runner/prepare-task.js +111 -147
- package/dist/core/runner/prepare-turn-wiring.d.ts +10 -3
- package/dist/core/runner/prepare-turn-wiring.js +7 -4
- package/dist/core/runner/prepare-wiring-manifest.d.ts +12 -3
- package/dist/core/runner/prepare-wiring-manifest.js +21 -17
- package/dist/core/runner/prompt-block.js +2 -2
- package/dist/core/runner/prompt-suggestions.d.ts +3 -8
- package/dist/core/runner/prompt-suggestions.js +4 -1
- package/dist/core/runner/reply-pricing.d.ts +8 -4
- package/dist/core/runner/reply-pricing.js +6 -5
- package/dist/core/runner/resume-admission.js +2 -0
- package/dist/core/runner/resume-apply.js +4 -4
- package/dist/core/runner/resume-checkpoint-screen.d.ts +23 -2
- package/dist/core/runner/resume-checkpoint-screen.js +34 -27
- package/dist/core/runner/resume-preflight.js +3 -3
- package/dist/core/runner/rewind-files.js +21 -14
- package/dist/core/runner/role-resolution-table.d.ts +10 -7
- package/dist/core/runner/role-resolution-table.js +8 -7
- package/dist/core/runner/role-seat-defaulted.js +2 -2
- package/dist/core/runner/rule-store-unreadable-notice.d.ts +4 -2
- package/dist/core/runner/rule-store-unreadable-notice.js +21 -7
- package/dist/core/runner/run-attachment-seats.js +8 -15
- package/dist/core/runner/run-brain-sinks.js +1 -0
- package/dist/core/runner/run-compaction-machinery.d.ts +1 -1
- package/dist/core/runner/run-compaction-machinery.js +2 -3
- package/dist/core/runner/run-harness-handlers.d.ts +2 -2
- package/dist/core/runner/run-harness-handlers.js +18 -5
- package/dist/core/runner/run-identity-wiring.js +11 -9
- package/dist/core/runner/run-leg.js +33 -12
- package/dist/core/runner/run-notification-lane.d.ts +4 -1
- package/dist/core/runner/run-notification-lane.js +21 -8
- package/dist/core/runner/run-recovery-lanes.js +1 -1
- package/dist/core/runner/run-settle-and-teardown.d.ts +6 -1
- package/dist/core/runner/run-settle-and-teardown.js +30 -32
- package/dist/core/runner/run-stop-and-final-verify.d.ts +4 -1
- package/dist/core/runner/run-stop-and-final-verify.js +12 -49
- package/dist/core/runner/run-telemetry-and-budget-seats.js +29 -10
- package/dist/core/runner/run-terminal-adoption.js +5 -2
- package/dist/core/runner/run-turn-boundary.js +13 -11
- package/dist/core/runner/runtask.d.ts +16 -7
- package/dist/core/runner/runtask.js +51 -30
- package/dist/core/runner/sandbox-network-seat.d.ts +52 -0
- package/dist/core/runner/sandbox-network-seat.js +40 -0
- package/dist/core/runner/seat-model-doors.d.ts +16 -0
- package/dist/core/runner/seat-model-doors.js +13 -0
- package/dist/core/runner/session-file-state-replay.d.ts +20 -0
- package/dist/core/runner/session-file-state-replay.js +17 -5
- package/dist/core/runner/session-read-file-states.d.ts +37 -0
- package/dist/core/runner/session-read-file-states.js +19 -0
- package/dist/core/runner/session-rule-policy.d.ts +2 -1
- package/dist/core/runner/session-rule-policy.js +3 -2
- package/dist/core/runner/session-verb-doors.js +2 -1
- package/dist/core/runner/session-write-ledger.d.ts +5 -1
- package/dist/core/runner/session-write-ledger.js +19 -5
- package/dist/core/runner/shared-read-classifier.d.ts +48 -0
- package/dist/core/runner/shared-read-classifier.js +33 -0
- package/dist/core/runner/shell-env-withheld.d.ts +6 -3
- package/dist/core/runner/shell-env-withheld.js +25 -0
- package/dist/core/runner/side-call-account.d.ts +30 -2
- package/dist/core/runner/side-call-account.js +38 -5
- package/dist/core/runner/skipped-rules-notice.d.ts +43 -0
- package/dist/core/runner/skipped-rules-notice.js +49 -0
- package/dist/core/runner/steering-preview.js +1 -1
- package/dist/core/runner/stop-tail-notice.d.ts +40 -0
- package/dist/core/runner/stop-tail-notice.js +35 -0
- package/dist/core/runner/stream-halt-verbs.js +1 -1
- package/dist/core/runner/stream-mode-verb.d.ts +11 -4
- package/dist/core/runner/stream-mode-verb.js +19 -7
- package/dist/core/runner/stream-settle-backstop.js +3 -1
- package/dist/core/runner/stream-steer-verb.js +4 -3
- package/dist/core/runner/synthetic-tools.d.ts +11 -11
- package/dist/core/runner/synthetic-tools.js +17 -20
- package/dist/core/runner/task-start-doors.d.ts +86 -0
- package/dist/core/runner/task-start-doors.js +108 -0
- package/dist/core/runner/teardown-bounded.d.ts +5 -5
- package/dist/core/runner/teardown-bounded.js +6 -6
- package/dist/core/runner/terminal-account.d.ts +3 -2
- package/dist/core/runner/terminal-account.js +5 -3
- package/dist/core/runner/tool-disclosure.js +8 -9
- package/dist/core/runner/tool-end-body.d.ts +2 -0
- package/dist/core/runner/tool-end-body.js +1 -0
- package/dist/core/runner/tool-face-overlay.js +1 -0
- package/dist/core/runner/tool-occurrence.d.ts +22 -24
- package/dist/core/runner/tool-occurrence.js +9 -15
- package/dist/core/runner/tool-progress-lane.js +1 -1
- package/dist/core/runner/tool-result-media-seat.d.ts +7 -4
- package/dist/core/runner/tool-result-media-seat.js +16 -4
- package/dist/core/runner/tool-table-view.d.ts +7 -1
- package/dist/core/runner/tool-table-view.js +1 -1
- package/dist/core/runner/tool-turn-repair-seat.d.ts +22 -2
- package/dist/core/runner/tool-turn-repair-seat.js +23 -5
- package/dist/core/runner/turn-attachments.d.ts +74 -148
- package/dist/core/runner/turn-attachments.js +153 -223
- package/dist/core/runner/usage-accounting.d.ts +15 -0
- package/dist/core/runner/usage-accounting.js +12 -4
- package/dist/core/runner/verdict-refusal.d.ts +45 -0
- package/dist/core/runner/verdict-refusal.js +39 -0
- package/dist/core/runner/write-protection-station.d.ts +5 -0
- package/dist/core/runner/write-protection-station.js +6 -6
- package/dist/core/runner-deps.d.ts +15 -5
- package/dist/core/runtime-caps.d.ts +5 -3
- package/dist/core/secret-env.d.ts +19 -14
- package/dist/core/secret-env.js +19 -12
- package/dist/core/session-checkout.d.ts +18 -1
- package/dist/core/session-checkout.js +23 -8
- package/dist/core/session-log-transfer.js +2 -2
- package/dist/core/session-policy-store.d.ts +220 -31
- package/dist/core/session-policy-store.js +333 -47
- package/dist/core/session-reconcile.d.ts +12 -0
- package/dist/core/session-reconcile.js +1 -1
- package/dist/core/session-store.d.ts +5 -3
- package/dist/core/session-store.js +11 -11
- package/dist/core/session.d.ts +31 -22
- package/dist/core/session.js +3 -2
- package/dist/core/shared-memory/normalize.js +2 -1
- package/dist/core/side-query.d.ts +4 -0
- package/dist/core/side-query.js +7 -4
- package/dist/core/spec-contract.d.ts +4 -2
- package/dist/core/store-contracts/background-agent-store-contract.js +149 -0
- package/dist/core/store-contracts/checkpoint-store-contract.js +55 -0
- package/dist/core/store-contracts/contract-kit-version.d.ts +4 -4
- package/dist/core/store-contracts/file-history-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/file-history-store-contract.js +282 -22
- package/dist/core/store-contracts/session-policy-store-contract.js +202 -0
- package/dist/core/store-contracts/session-store-contract.js +48 -14
- package/dist/core/store-contracts/tool-result-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/tool-result-store-contract.js +128 -0
- package/dist/core/store-contracts/workflow-journal-store-contract.js +90 -1
- package/dist/core/swappable-deps.d.ts +16 -0
- package/dist/core/swappable-deps.js +61 -1
- package/dist/core/synthetic-read-verdict.d.ts +23 -0
- package/dist/core/synthetic-read-verdict.js +43 -18
- package/dist/core/task-event.d.ts +123 -50
- package/dist/core/task-intake.d.ts +21 -5
- package/dist/core/task-intake.js +29 -3
- package/dist/core/task-limits.d.ts +3 -1
- package/dist/core/task-notification.d.ts +171 -59
- package/dist/core/task-notification.js +162 -104
- package/dist/core/task-registry-agent.d.ts +12 -0
- package/dist/core/task-registry-agent.js +23 -9
- package/dist/core/task-registry-shared.d.ts +4 -2
- package/dist/core/task-registry-shared.js +1 -1
- package/dist/core/task-registry-workflow.js +8 -5
- package/dist/core/task-registry.d.ts +16 -1
- package/dist/core/task-registry.js +35 -23
- package/dist/core/task-result.d.ts +127 -10
- package/dist/core/task-spec-members.d.ts +5 -2
- package/dist/core/task-spec-members.js +9 -5
- package/dist/core/task-spec.d.ts +31 -12
- package/dist/core/task-start-judge.d.ts +41 -0
- package/dist/core/task-start-judge.js +26 -0
- package/dist/core/task-stream.d.ts +12 -1
- package/dist/core/terminal-cause.d.ts +23 -9
- package/dist/core/tool-catalog-entries.js +6 -5
- package/dist/core/tool-face-lists.d.ts +3 -2
- package/dist/core/tool-face-lists.js +6 -0
- package/dist/core/tool-face-reader.d.ts +3 -2
- package/dist/core/tool-face-reader.js +2 -2
- package/dist/core/tool-face.d.ts +27 -3
- package/dist/core/tool-face.js +2 -2
- package/dist/core/tool-model-gate.js +14 -13
- package/dist/core/tool-mount-facts.d.ts +16 -3
- package/dist/core/tool-mount-facts.js +10 -0
- package/dist/core/tool-mount-plan.d.ts +79 -10
- package/dist/core/tool-mount-plan.js +79 -24
- package/dist/core/tool-mount-static.d.ts +52 -6
- package/dist/core/tool-mount-static.js +82 -28
- package/dist/core/tool-name-aliases.js +1 -1
- package/dist/core/tool-policy.d.ts +25 -5
- package/dist/core/tool-policy.js +8 -6
- package/dist/core/tool-registry.d.ts +12 -2
- package/dist/core/tool-registry.js +9 -2
- package/dist/core/tool-result-budget.d.ts +2 -2
- package/dist/core/tool-result-bytes.d.ts +28 -9
- package/dist/core/tool-result-bytes.js +7 -5
- package/dist/core/tool-result-store.d.ts +310 -38
- package/dist/core/tool-result-store.js +325 -30
- package/dist/core/tool-roster.d.ts +20 -8
- package/dist/core/tool-roster.js +16 -6
- package/dist/core/tool-search-setting.js +2 -2
- package/dist/core/tool-spec.d.ts +10 -10
- package/dist/core/types.d.ts +5 -5
- package/dist/core/types.js +2 -2
- package/dist/core/unc-spelling.d.ts +114 -3
- package/dist/core/unc-spelling.js +110 -0
- package/dist/core/untrusted-egress.d.ts +82 -10
- package/dist/core/untrusted-egress.js +102 -9
- package/dist/core/untrusted-text.d.ts +28 -0
- package/dist/core/untrusted-text.js +67 -3
- package/dist/core/user-attachment.d.ts +18 -3
- package/dist/core/user-attachment.js +37 -31
- package/dist/core/user-row-origin.d.ts +22 -0
- package/dist/core/user-row-origin.js +15 -0
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +2 -12
- package/dist/core/wiring-manifest.d.ts +124 -30
- package/dist/core/wiring-manifest.js +59 -17
- package/dist/core/workflow-journal-store.d.ts +186 -16
- package/dist/core/workflow-journal-store.js +156 -1
- package/dist/core/workflow-run-store-contract.js +82 -1
- package/dist/core/workflow-run-store.d.ts +40 -4
- package/dist/core/workflow-run-store.js +9 -2
- package/dist/core/workspace-snapshot.d.ts +4 -1
- package/dist/core/workspace-snapshot.js +1 -1
- package/dist/engine/compaction/compaction.d.ts +3 -3
- package/dist/engine/compaction/compaction.js +16 -18
- package/dist/engine/execution-env/node-execution-env.d.ts +14 -6
- package/dist/engine/execution-env/node-execution-env.js +49 -14
- package/dist/engine/harness/agent-harness.d.ts +17 -7
- package/dist/engine/harness/agent-harness.js +66 -16
- package/dist/engine/harness/types.d.ts +31 -2
- package/dist/engine/harness/types.js +14 -1
- package/dist/engine/llm/tool-turns.d.ts +19 -2
- package/dist/engine/llm/tool-turns.js +29 -2
- package/dist/engine/llm/types.d.ts +103 -22
- package/dist/engine/llm/types.js +1 -1
- package/dist/engine/loop/agent-loop.d.ts +18 -9
- package/dist/engine/loop/agent-loop.js +115 -24
- package/dist/engine/loop/types.d.ts +14 -6
- package/dist/engine/lsp/node-lsp-manager.d.ts +6 -4
- package/dist/engine/lsp/node-lsp-manager.js +22 -21
- package/dist/engine/session/import-validate.js +2 -0
- package/dist/engine/session/repo-utils.d.ts +13 -7
- package/dist/engine/session/repo-utils.js +9 -4
- package/dist/index.d.ts +48 -27
- package/dist/index.js +38 -20
- package/dist/internal/harness.d.ts +1 -1
- package/dist/internal/llm.d.ts +2 -2
- package/dist/internal/llm.js +1 -1
- package/dist/orchestration/goal.js +1 -1
- package/dist/orchestration/governance-baseline-validity.d.ts +20 -5
- package/dist/orchestration/governance-baseline-validity.js +87 -16
- package/dist/orchestration/run-workflow-tool.d.ts +15 -12
- package/dist/orchestration/run-workflow-tool.js +757 -331
- package/dist/orchestration/workflow-governance.d.ts +1 -1
- package/dist/orchestration/workflow-observe.d.ts +22 -2
- package/dist/orchestration/workflow-observe.js +20 -9
- package/dist/orchestration/workflow-park-adoption.d.ts +380 -0
- package/dist/orchestration/workflow-park-adoption.js +617 -0
- package/dist/orchestration/workflow-size-guideline.d.ts +6 -8
- package/dist/orchestration/workflow-size-guideline.js +12 -14
- package/dist/orchestration/workflow-types.d.ts +97 -17
- package/dist/orchestration/workflow-types.js +39 -8
- package/dist/orchestration/workflow.d.ts +70 -26
- package/dist/orchestration/workflow.js +495 -199
- package/dist/prompt-assembly/artifact.js +4 -3
- package/dist/prompt-assembly/assemble.d.ts +2 -0
- package/dist/prompt-assembly/assemble.js +4 -1
- package/dist/prompt-assembly/bands.d.ts +3 -0
- package/dist/prompt-assembly/bands.js +6 -0
- package/dist/prompt-assembly/catalog/constitution.d.ts +1 -1
- package/dist/prompt-assembly/catalog/constitution.js +74 -9
- package/dist/prompt-assembly/catalog/core-behavior.d.ts +5 -4
- package/dist/prompt-assembly/catalog/core-behavior.js +46 -9
- package/dist/prompt-assembly/catalog/engine.d.ts +110 -5
- package/dist/prompt-assembly/catalog/engine.js +13 -0
- package/dist/prompt-assembly/catalog/events.d.ts +852 -0
- package/dist/prompt-assembly/catalog/events.js +62 -0
- package/dist/prompt-assembly/catalog/index.js +2 -1
- package/dist/prompt-assembly/catalog/locales/index.d.ts +2 -2
- package/dist/prompt-assembly/catalog/locales/index.js +4 -2
- package/dist/prompt-assembly/catalog/locales/zh-Hans/constitution.js +53 -1
- package/dist/prompt-assembly/catalog/locales/zh-Hans/core-behavior.js +45 -9
- package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.js +12 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/events.d.ts +7 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/events.js +57 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/mechanism.d.ts +8 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/mechanism.js +56 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/modes.js +8 -2
- package/dist/prompt-assembly/catalog/locales/zh-Hans/role.js +37 -9
- package/dist/prompt-assembly/catalog/mechanism.d.ts +427 -0
- package/dist/prompt-assembly/catalog/mechanism.js +62 -0
- package/dist/prompt-assembly/catalog/memory.d.ts +3 -3
- package/dist/prompt-assembly/catalog/memory.js +12 -3
- package/dist/prompt-assembly/catalog/modes.d.ts +2 -2
- package/dist/prompt-assembly/catalog/modes.js +7 -1
- package/dist/prompt-assembly/catalog/role.d.ts +1 -1
- package/dist/prompt-assembly/catalog/role.js +43 -14
- package/dist/prompt-assembly/catalog/schema.d.ts +43 -20
- package/dist/prompt-assembly/catalog/schema.js +17 -6
- package/dist/prompt-assembly/catalog/sections.d.ts +1 -1
- package/dist/prompt-assembly/catalog/sections.js +20 -12
- package/dist/prompt-assembly/composer.d.ts +3 -0
- package/dist/prompt-assembly/composer.js +11 -5
- package/dist/prompt-assembly/engine-text.d.ts +14 -4
- package/dist/prompt-assembly/engine-text.js +18 -9
- package/dist/prompt-assembly/event-registry.d.ts +38 -31
- package/dist/prompt-assembly/event-registry.js +185 -25
- package/dist/prompt-assembly/explain.d.ts +24 -0
- package/dist/prompt-assembly/explain.js +11 -0
- package/dist/prompt-assembly/locale-review.js +3 -2
- package/dist/prompt-assembly/overlay.d.ts +25 -7
- package/dist/prompt-assembly/overlay.js +68 -14
- package/dist/prompt-assembly/select.d.ts +4 -3
- package/dist/prompt-assembly/select.js +10 -2
- package/dist/prompt-assembly/sugar.d.ts +3 -2
- package/dist/prompt-assembly/sugar.js +2 -2
- package/dist/prompt-assembly/tool-catalog.js +3 -2
- package/dist/prompt-assembly/turn-snapshot.d.ts +1 -0
- package/dist/prompt-assembly/turn-snapshot.js +1 -0
- package/dist/prompt-assembly/types.d.ts +3 -4
- package/dist/prompts/default.d.ts +6 -45
- package/dist/prompts/default.js +3 -21
- package/dist/stores/file/adoption/adopt.d.ts +13 -3
- package/dist/stores/file/adoption/adopt.js +90 -95
- package/dist/stores/file/adoption/marker.d.ts +2 -1
- package/dist/stores/file/background-agent-store.d.ts +61 -0
- package/dist/stores/file/background-agent-store.js +64 -15
- package/dist/stores/file/checkpoint-store.d.ts +30 -2
- package/dist/stores/file/checkpoint-store.js +72 -23
- package/dist/stores/file/file-history-store.d.ts +13 -7
- package/dist/stores/file/file-history-store.js +170 -46
- package/dist/stores/file/fs-atomic.d.ts +57 -2
- package/dist/stores/file/fs-atomic.js +116 -48
- package/dist/stores/file/index.d.ts +2 -0
- package/dist/stores/file/index.js +2 -0
- package/dist/stores/file/ledger-damage.d.ts +87 -0
- package/dist/stores/file/ledger-damage.js +103 -0
- package/dist/stores/file/session-policy-store.d.ts +36 -4
- package/dist/stores/file/session-policy-store.js +177 -6
- package/dist/stores/file/shared-ledger.d.ts +123 -11
- package/dist/stores/file/shared-ledger.js +113 -18
- package/dist/stores/file/tool-result-store.d.ts +30 -1
- package/dist/stores/file/tool-result-store.js +60 -6
- package/dist/stores/file/workflow-journal-store.d.ts +73 -26
- package/dist/stores/file/workflow-journal-store.js +195 -32
- package/dist/stores/file/workflow-run-store.d.ts +47 -2
- package/dist/stores/file/workflow-run-store.js +17 -14
- package/dist/tools/artifact/artifact-tool.d.ts +9 -6
- package/dist/tools/artifact/artifact-tool.js +76 -40
- package/dist/tools/fs/env-error-detail.d.ts +11 -0
- package/dist/tools/fs/env-error-detail.js +13 -2
- package/dist/tools/fs/fs-bash.js +30 -21
- package/dist/tools/fs/fs-pdf.d.ts +1 -1
- package/dist/tools/fs/fs-pdf.js +2 -2
- package/dist/tools/fs/fs-read.js +4 -4
- package/dist/tools/fs/fs-shared.d.ts +26 -9
- package/dist/tools/fs/fs-shared.js +12 -6
- package/dist/tools/fs/fs-write.d.ts +6 -4
- package/dist/tools/fs/fs-write.js +24 -18
- package/dist/tools/fs/pattern-kill-guard.js +2 -1
- package/dist/tools/fs/pdf.d.ts +8 -0
- package/dist/tools/fs/pdf.js +10 -0
- package/dist/tools/fs/program-read-model.d.ts +4 -0
- package/dist/tools/fs/program-read-model.rows.js +3 -3
- package/dist/tools/fs/read-floor.d.ts +11 -9
- package/dist/tools/fs/read-floor.js +7 -10
- package/dist/tools/fs/removal-targets.d.ts +4 -3
- package/dist/tools/fs/removal-targets.js +27 -9
- package/dist/tools/fs/safety.d.ts +29 -107
- package/dist/tools/fs/safety.js +16 -118
- package/dist/tools/fs/shell-read-check.d.ts +4 -2
- package/dist/tools/fs/shell-read-check.js +6 -2
- package/dist/tools/fs/shell-read-environment.d.ts +10 -2
- package/dist/tools/fs/shell-read-environment.js +20 -11
- package/dist/tools/fs/shell-read-judge.d.ts +19 -7
- package/dist/tools/fs/shell-read-judge.js +9 -3
- package/dist/tools/fs/shell-reentry-text.d.ts +8 -0
- package/dist/tools/fs/shell-reentry-text.js +56 -0
- package/dist/tools/monitor.js +7 -5
- package/dist/tools/scheduler-tools.d.ts +39 -1
- package/dist/tools/scheduler-tools.js +84 -35
- package/dist/tools/task-list.d.ts +12 -4
- package/dist/tools/task-list.js +10 -7
- package/dist/tools/web.d.ts +2 -8
- package/dist/tools/web.js +5 -5
- package/dist/tools/worktree.js +18 -15
- package/package.json +6 -3
- package/test/export-surface.snapshot.json +344 -14
- package/wire-changes/core-stores-sql@7.68.5.json +39 -0
- package/wire-changes/core-stores-sql@7.69.0.json +39 -0
- package/wire-changes/core@7.68.5.json +141 -0
- package/wire-changes/core@7.69.0.json +9561 -0
- package/wire-changes/mods-kernel@7.68.5.json +39 -0
- package/wire-changes/mods-kernel@7.69.0.json +80 -0
- package/wire-changes/primitives@7.68.5.json +39 -0
- package/wire-changes/primitives@7.69.0.json +79 -0
- package/wire-changes/wiki-gate@7.68.5.json +39 -0
- package/wire-changes/wiki-gate@7.69.0.json +39 -0
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* judge is `withinAnyRoot` over the roots the boundary declares — a WRITE target's over the write roots, at the
|
|
13
13
|
* seat it is written, under the write face in force ({@link judgeWrite}).
|
|
14
14
|
* · `foldShellReadFindings` folds a command's findings — every segment, every nested plan — to ONE word by
|
|
15
|
-
* the priority `identity_changed > deny_hit > unanswered > outside_roots > unestablishable > declined > none`.
|
|
15
|
+
* the priority `identity_changed > deny_hit > target_unavailable > unanswered > outside_roots > unestablishable > declined > none`.
|
|
16
16
|
* · `SHELL_READ_DECISION` is the total table (finding × seat → disposition) that is the ONLY source of
|
|
17
17
|
* "refuse / mandated ask / ordinary ask / vouch" for a shell read. A seat is a FACE word, not a tool name
|
|
18
18
|
* and not a permission mode: which shell face the call runs on (the full shell, the read-only shell) or
|
|
@@ -28,7 +28,7 @@ import type { WriteSeat } from "./shell-read-write-targets.js";
|
|
|
28
28
|
import { type ContainmentFace } from "./containment-face.js";
|
|
29
29
|
import type { AssertAllKeysHandled } from "../../core/ask-origin.js";
|
|
30
30
|
/** WHAT the judge found about a command — a closed set, registered in `docs/CLOSED-SETS.md`. */
|
|
31
|
-
export declare const SHELL_READ_FINDINGS: readonly ["deny_hit", "outside_roots", "unestablishable", "declined", "identity_changed", "unanswered", "none"];
|
|
31
|
+
export declare const SHELL_READ_FINDINGS: readonly ["deny_hit", "outside_roots", "unestablishable", "declined", "identity_changed", "unanswered", "target_unavailable", "none"];
|
|
32
32
|
export type ShellReadFinding = (typeof SHELL_READ_FINDINGS)[number];
|
|
33
33
|
/** WHERE a read is judged — the seats the decision table is keyed on, one per FACE: `full_shell` the
|
|
34
34
|
* writable shell (`Bash`, `Monitor`) under every permission mode and every shell-gate floor; `readonly`
|
|
@@ -38,8 +38,9 @@ export declare const SHELL_READ_SEATS: readonly ["full_shell", "readonly", "reju
|
|
|
38
38
|
export type ShellReadSeat = (typeof SHELL_READ_SEATS)[number];
|
|
39
39
|
/** The fold priority: a command's finding is the highest-ranked finding of any candidate in it. */
|
|
40
40
|
export declare const SHELL_READ_FINDING_RANK: {
|
|
41
|
-
readonly identity_changed:
|
|
42
|
-
readonly deny_hit:
|
|
41
|
+
readonly identity_changed: 7;
|
|
42
|
+
readonly deny_hit: 6;
|
|
43
|
+
readonly target_unavailable: 5;
|
|
43
44
|
readonly unanswered: 4;
|
|
44
45
|
readonly outside_roots: 3;
|
|
45
46
|
readonly unestablishable: 2;
|
|
@@ -105,6 +106,11 @@ export declare function dispositionOfCell(cell: ShellReadCell, context?: ShellRe
|
|
|
105
106
|
* directory, a pattern its matcher does not model). Absence is not
|
|
106
107
|
* "nothing there": the full shell asks it MANDATED on every read face — a standing allow was given on the premise that the
|
|
107
108
|
* judge works, and a broken judge is not cleared by it — and the read-only face refuses.
|
|
109
|
+
* · `target_unavailable` — the target refused a lookup before it started (the door's {@link import("./shell-read-environment.js").Incomplete.refusal}:
|
|
110
|
+
* offline, busy, not bound — nothing started, nothing can run there now, a retry is safe once it is back). Not the silence: the
|
|
111
|
+
* environment answered, for the whole command. Refused on every seat with the environment's own sentence — the refusal the Bash
|
|
112
|
+
* tool gives the same word at its start — and asked of nobody: a person's yes would let through a command no station judged,
|
|
113
|
+
* to run if the target opened in between.
|
|
108
114
|
* · `none` — vouched: the station has no question (the full shell's shape tier may still ask).
|
|
109
115
|
*/
|
|
110
116
|
export declare const SHELL_READ_DECISION: {
|
|
@@ -145,6 +151,11 @@ export declare const SHELL_READ_DECISION: {
|
|
|
145
151
|
readonly readonly: "refuse";
|
|
146
152
|
readonly rejudge: "refuse";
|
|
147
153
|
};
|
|
154
|
+
readonly target_unavailable: {
|
|
155
|
+
readonly full_shell: "refuse";
|
|
156
|
+
readonly readonly: "refuse";
|
|
157
|
+
readonly rejudge: "refuse";
|
|
158
|
+
};
|
|
148
159
|
readonly none: {
|
|
149
160
|
readonly full_shell: "vouch";
|
|
150
161
|
readonly readonly: "vouch";
|
|
@@ -396,7 +407,8 @@ export interface ShellReadFold {
|
|
|
396
407
|
* account of this question names each program, not the first. Present only with an `unestablished` fold. */
|
|
397
408
|
readonly reentered?: readonly ShellReadSegment[];
|
|
398
409
|
/** What could not be settled, in words, for a finding that has no witness read or declined segment to say it: for `unanswered`
|
|
399
|
-
* the first thing the establishment recorded ({@link Incomplete.detail}); for
|
|
410
|
+
* the first thing the establishment recorded ({@link Incomplete.detail}); for `target_unavailable` the environment's own sentence
|
|
411
|
+
* for its refusal ({@link Incomplete.refusal}, as the door read it); for an `unestablishable` text the plan refused
|
|
400
412
|
* ({@link ShellReadPlan.unreadable}) the sentence the plan itself carries — a construct the lexer cannot close, a word whose
|
|
401
413
|
* value the text does not hold, a value a parameter expansion re-reads at run time. */
|
|
402
414
|
readonly cause?: string;
|
|
@@ -409,8 +421,8 @@ export interface ShellReadFold {
|
|
|
409
421
|
}
|
|
410
422
|
/**
|
|
411
423
|
* Fold a judged plan to ONE finding by {@link SHELL_READ_FINDING_RANK}, over every segment and every nested
|
|
412
|
-
* plan. Where the station guards nothing an `unestablishable`, `unanswered` or `declined` finding is no finding:
|
|
413
|
-
* confirm it against. Which guard is asked is the face the finding is about — a read candidate's by the read face's
|
|
424
|
+
* plan. Where the station guards nothing an `unestablishable`, `unanswered`, `target_unavailable` or `declined` finding is no finding:
|
|
425
|
+
* there is nothing to confirm it against (a call the target refused then meets the refusal at its start, in the same sentence). Which guard is asked is the face the finding is about — a read candidate's by the read face's
|
|
414
426
|
* ({@link JudgedPlan.guards}), a write target's by the write face's ({@link JudgedPlan.writeGuards}), and a finding about
|
|
415
427
|
* the text's own structure (no candidate stands in for it) by either ({@link anyFaceGuards}). Two structural rules ride the fold:
|
|
416
428
|
* · a plan the lexer refused (`unreadable`) is `unestablishable`, unconditionally — a quote-blind re-read
|
|
@@ -3,11 +3,12 @@ import { globInWord } from "./bash-readonly-classifier.js";
|
|
|
3
3
|
import { readOfText } from "./shell-read-word.js";
|
|
4
4
|
import { passesUnasked } from "./shell-read-device.js";
|
|
5
5
|
import { skipsRootsContainment } from "./containment-face.js";
|
|
6
|
-
export const SHELL_READ_FINDINGS = Object.freeze(["deny_hit", "outside_roots", "unestablishable", "declined", "identity_changed", "unanswered", "none"]);
|
|
6
|
+
export const SHELL_READ_FINDINGS = Object.freeze(["deny_hit", "outside_roots", "unestablishable", "declined", "identity_changed", "unanswered", "target_unavailable", "none"]);
|
|
7
7
|
export const SHELL_READ_SEATS = Object.freeze(["full_shell", "readonly", "rejudge"]);
|
|
8
8
|
export const SHELL_READ_FINDING_RANK = {
|
|
9
|
-
identity_changed:
|
|
10
|
-
deny_hit:
|
|
9
|
+
identity_changed: 7,
|
|
10
|
+
deny_hit: 6,
|
|
11
|
+
target_unavailable: 5,
|
|
11
12
|
unanswered: 4,
|
|
12
13
|
outside_roots: 3,
|
|
13
14
|
unestablishable: 2,
|
|
@@ -28,6 +29,7 @@ export const SHELL_READ_DECISION = {
|
|
|
28
29
|
declined: { full_shell: "ordinary", readonly: "refuse", rejudge: "refuse" },
|
|
29
30
|
identity_changed: { full_shell: "refuse", readonly: "refuse", rejudge: "refuse" },
|
|
30
31
|
unanswered: { full_shell: "mandated", readonly: "refuse", rejudge: "refuse" },
|
|
32
|
+
target_unavailable: { full_shell: "refuse", readonly: "refuse", rejudge: "refuse" },
|
|
31
33
|
none: { full_shell: "vouch", readonly: "vouch", rejudge: "vouch" },
|
|
32
34
|
};
|
|
33
35
|
export function decideShellRead(finding, seat, context = {}) {
|
|
@@ -181,6 +183,10 @@ export function foldShellReadFindings(judged) {
|
|
|
181
183
|
}
|
|
182
184
|
};
|
|
183
185
|
walk(judged, "full");
|
|
186
|
+
const refused = judged.incomplete?.find((r) => r.refusal !== undefined);
|
|
187
|
+
if (refused?.refusal !== undefined && (judged.guards || judged.writeGuards) && SHELL_READ_FINDING_RANK.target_unavailable > SHELL_READ_FINDING_RANK[best.finding]) {
|
|
188
|
+
return { finding: "target_unavailable", cause: refused.refusal };
|
|
189
|
+
}
|
|
184
190
|
const unfinished = judged.incomplete?.[0];
|
|
185
191
|
if (unfinished !== undefined && (judged.guards || judged.writeGuards) && SHELL_READ_FINDING_RANK.unanswered > SHELL_READ_FINDING_RANK[best.finding]) {
|
|
186
192
|
unestablished = true;
|
|
@@ -8,6 +8,14 @@ import { type LexedSegment, type LexedWord } from "../../shell/lex.js";
|
|
|
8
8
|
import { type ProgramPosition } from "./bash-program-position.js";
|
|
9
9
|
import { type TargetUser } from "./program-read-model.js";
|
|
10
10
|
import type { BoundValue } from "./shell-read-bindings.js";
|
|
11
|
+
/** B1: a stream may fill positional *data* in a literal script, never any part of its text.
|
|
12
|
+
* Only the plain xargs launcher and plain sh/bash -c are read here. Replacement mode uses exactly
|
|
13
|
+
* `{}` and cannot touch the shell, options, script or argv[0]. Other launcher dialects stay unread.
|
|
14
|
+
* The inner command's positive forms live on its program-model row; the existing role walk must
|
|
15
|
+
* also put every expansion in an operand, past `--`. No redirects, groups, substitutions or builtins.
|
|
16
|
+
* This establishes code only: unknown paths still go through the read station and person's rules.
|
|
17
|
+
*/
|
|
18
|
+
export declare function streamSuppliesOnlyData(argv: readonly LexedWord[]): boolean;
|
|
11
19
|
/**
|
|
12
20
|
* The code bodies a builtin keeps among its operands, one per body; empty for every other program. The program read
|
|
13
21
|
* model's row says where the body is: the action of a `trap` (its first operand after the options), the value of an
|
|
@@ -2,6 +2,62 @@ import { heredocBodyPieces, lexShell, literalHeredocBody, literalTextOf } from "
|
|
|
2
2
|
import { programBasename, readProgramPosition } from "./bash-program-position.js";
|
|
3
3
|
import { implementationRejects, implementationsOf, printedText, programRow, readArgRoles, selectedOptions, selectedSpellings, targetUserOf } from "./program-read-model.js";
|
|
4
4
|
import { namesStandardInput } from "./safety.js";
|
|
5
|
+
export function streamSuppliesOnlyData(argv) {
|
|
6
|
+
const pos = readProgramPosition(argv);
|
|
7
|
+
const p = pos.program;
|
|
8
|
+
if (!pos.argvFromStdin || pos.refusal !== undefined || p === undefined || pos.controlWords.length !== 0 || pos.assignments.length !== 0 || pos.launchers.length !== 1 || pos.launchers[0].index !== 0 || pos.launchers[0].name !== "xargs")
|
|
9
|
+
return false;
|
|
10
|
+
const literal = argv.map((w) => literalTextOf(w.pieces));
|
|
11
|
+
if (literal.some((w) => w === undefined) || literal[0] !== "xargs" || (literal[p.index] !== "sh" && literal[p.index] !== "bash"))
|
|
12
|
+
return false;
|
|
13
|
+
const prefix = literal.slice(1, p.index);
|
|
14
|
+
if (prefix[0] === "-0")
|
|
15
|
+
prefix.shift();
|
|
16
|
+
const replacing = (prefix.length === 1 && prefix[0] === "-I{}") || (prefix.length === 2 && prefix[0] === "-I" && prefix[1] === "{}");
|
|
17
|
+
if (prefix.length !== 0 && !replacing && !(prefix.length === 2 && prefix[0] === "-n" && prefix[1] === "1"))
|
|
18
|
+
return false;
|
|
19
|
+
if (literal[p.index + 1] !== "-c" || literal[p.index + 3] !== "_")
|
|
20
|
+
return false;
|
|
21
|
+
const script = literal[p.index + 2];
|
|
22
|
+
if (script === undefined || (replacing && literal.slice(p.index, p.index + 4).some((w) => w.includes("{}"))))
|
|
23
|
+
return false;
|
|
24
|
+
const lexed = lexShell(script);
|
|
25
|
+
if ("parseFailure" in lexed || lexed.segments.length !== 1)
|
|
26
|
+
return false;
|
|
27
|
+
const segment = lexed.segments[0];
|
|
28
|
+
if (segment.connector !== "start" || segment.tokens.some((t) => t.kind !== "word"))
|
|
29
|
+
return false;
|
|
30
|
+
const words = segment.tokens.filter((t) => t.kind === "word");
|
|
31
|
+
const inner = readProgramPosition(words);
|
|
32
|
+
if (inner.refusal !== undefined || inner.program?.index !== 0 || inner.launchers.length !== 0 || inner.controlWords.length !== 0 || inner.assignments.length !== 0)
|
|
33
|
+
return false;
|
|
34
|
+
const name = literalTextOf(words[0].pieces);
|
|
35
|
+
const row = name === undefined ? undefined : programRow(name);
|
|
36
|
+
if (row?.dataOnlyPrefixes === undefined)
|
|
37
|
+
return false;
|
|
38
|
+
const args = words.slice(1);
|
|
39
|
+
const values = args.map((w) => literalTextOf(w.pieces));
|
|
40
|
+
const dataPrefix = row.dataOnlyPrefixes.find((pre) => pre.every((v, i) => values[i] === v));
|
|
41
|
+
if (dataPrefix === undefined || dataPrefix.at(-1) !== "--")
|
|
42
|
+
return false;
|
|
43
|
+
const roles = readArgRoles(row, args.map((w) => w.folded));
|
|
44
|
+
let parameters = 0;
|
|
45
|
+
for (let at = 0; at < args.length; at++) {
|
|
46
|
+
if (values[at] !== undefined)
|
|
47
|
+
continue;
|
|
48
|
+
const word = args[at];
|
|
49
|
+
if (at < dataPrefix.length || !/^"\$(?:[0-9]|\{[0-9]+\})"$/.test(word.raw) || word.pieces.length !== 1 || word.pieces[0].quotedBy !== '"' || word.pieces[0].expansion?.kind !== "parameter")
|
|
50
|
+
return false;
|
|
51
|
+
const readings = roles.filter((e) => e.at === at);
|
|
52
|
+
if (readings.length !== 1 || readings[0].kind !== "operand")
|
|
53
|
+
return false;
|
|
54
|
+
const event = readings[0];
|
|
55
|
+
if (event.kind !== "operand" || event.slot !== undefined || (event.role !== undefined && event.role.kind !== "path" && event.role.kind !== "datum"))
|
|
56
|
+
return false;
|
|
57
|
+
parameters++;
|
|
58
|
+
}
|
|
59
|
+
return parameters > 0;
|
|
60
|
+
}
|
|
5
61
|
export function codeBodies(basename, args) {
|
|
6
62
|
const row = programRow(basename);
|
|
7
63
|
switch (row?.body) {
|
package/dist/tools/monitor.js
CHANGED
|
@@ -5,7 +5,7 @@ import { MONITOR_DEFAULT_TIMEOUT_MS, MONITOR_MAX_TIMEOUT_MS, } from "../core/tas
|
|
|
5
5
|
import { admitsBackgroundLaunch, resolveCompletionSink } from "../core/task-notification.js";
|
|
6
6
|
import { toolFace } from "../core/tool-catalog-entries.js";
|
|
7
7
|
import { ONE_SHOT_BACKGROUND_COMMAND_NOTE } from "./fs/fs-bash-background-text.js";
|
|
8
|
-
import { sandboxRefusalText } from "../core/command-sandbox.js";
|
|
8
|
+
import { lapsedBy, sandboxRefusalText } from "../core/command-sandbox.js";
|
|
9
9
|
import { isDeadCwd, diagnoseDeadCwd } from "./fs/dead-cwd.js";
|
|
10
10
|
import { envErrorDetail } from "./fs/env-error-detail.js";
|
|
11
11
|
import { thrownText } from "../core/thrown-value.js";
|
|
@@ -89,9 +89,9 @@ export function createMonitorTool(env, opts) {
|
|
|
89
89
|
if (ctx.signal?.aborted === true)
|
|
90
90
|
return errorResult("Error (Monitor): the call was cancelled before the watch started.");
|
|
91
91
|
const readFloor = opts.readFloor?.(ctx.toolCallId);
|
|
92
|
-
const sandbox = opts.commandSandbox?.();
|
|
92
|
+
const sandbox = opts.commandSandbox?.start();
|
|
93
93
|
if (sandbox !== undefined && !sandbox.ok)
|
|
94
|
-
return errorResult(sandboxRefusalText("Monitor", { by: "
|
|
94
|
+
return errorResult(sandboxRefusalText("Monitor", { by: "plan", reason: sandbox.reason }), { type: "monitor-start", sandboxUnavailable: true });
|
|
95
95
|
const spawn = await env.spawnBackground(command, {
|
|
96
96
|
...(opts.cwdRef !== undefined ? { cwd: opts.cwdRef.current } : {}),
|
|
97
97
|
...(spawnTimeoutSec !== undefined ? { timeout: spawnTimeoutSec } : {}),
|
|
@@ -99,8 +99,10 @@ export function createMonitorTool(env, opts) {
|
|
|
99
99
|
...(sandbox?.sandbox !== undefined ? { sandbox: sandbox.sandbox } : {}),
|
|
100
100
|
});
|
|
101
101
|
if (!spawn.ok) {
|
|
102
|
-
if (spawn.error.code === "sandbox_unavailable")
|
|
103
|
-
|
|
102
|
+
if (spawn.error.code === "sandbox_unavailable") {
|
|
103
|
+
const detail = envErrorDetail(spawn.error.message);
|
|
104
|
+
return errorResult(sandboxRefusalText("Monitor", { by: "environment", detail, refusedBy: spawn.error.refusedBy, ...lapsedBy(opts.commandSandbox, spawn.error.refusedBy, detail) }), { type: "monitor-start", sandboxUnavailable: true, refusedBy: spawn.error.refusedBy ?? "environment" });
|
|
105
|
+
}
|
|
104
106
|
return errorResult(`Error (Monitor): ${envErrorDetail(spawn.error.message)}`);
|
|
105
107
|
}
|
|
106
108
|
const sessionScoped = isPersistent && opts.sessionId !== undefined;
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
* 挂载:prepare-task 在 `hasScheduler(executionEnv)` 时调 {@link createSchedulerTools}(需 Runner-held 上下文,故不在
|
|
19
19
|
* `createHandsToolkit` —— 与 present_plan/AskUserQuestion 同:这些工具都在 prepare-task 单独挂,那里有 spec.principal)。
|
|
20
20
|
*/
|
|
21
|
-
import type { AgentTool, ExecutionEnv } from "../internal/harness-types.js";
|
|
21
|
+
import type { AgentTool, ExecutionEnv, Result } from "../internal/harness-types.js";
|
|
22
|
+
import { SchedulerError, type SchedulerContext, type ScheduledTaskId, type ScheduledTaskSummary } from "../core/scheduler.js";
|
|
23
|
+
import { type IsolationScopeHolder } from "../core/isolation-scope.js";
|
|
22
24
|
export declare const SCHEDULE_WAKEUP_TOOL_NAME = "ScheduleWakeup";
|
|
23
25
|
/** CronCreate-based autonomous-loop 哨兵(CC `Ldt`)。loop runtime(部署侧)在 fire 时解析回 autonomous-loop 指令。 */
|
|
24
26
|
export declare const AUTONOMOUS_LOOP_SENTINEL = "<<autonomous-loop>>";
|
|
@@ -41,6 +43,42 @@ export interface SchedulerToolContext {
|
|
|
41
43
|
* 保留(human-suspend saga 等共用同一 runner 原语;prepare-task 仍注入)——当前 scheduler 三件不消费。 */
|
|
42
44
|
requestStopAfterTurn?: () => void;
|
|
43
45
|
}
|
|
46
|
+
/** The key of the SESSION lane: the session's id; else the run's isolation scope (its member when it sets one, else its principal); else
|
|
47
|
+
* the task's id; else `"default"`. The one place this chain is written — the Runner mounts the scheduler tools with it, and a host that
|
|
48
|
+
* derives the lanes of a session it holds calls it with that session's facts. `sessionId` and `taskId` read as `??` (an empty string is a
|
|
49
|
+
* value), the isolation scope as {@link isolationScopeOf} reads it. A key that comes out as anything but a non-empty string (an empty
|
|
50
|
+
* session id, a principal of `""`) is refused, not handed on. */
|
|
51
|
+
export declare function sessionLaneScopeOf(c: IsolationScopeHolder & {
|
|
52
|
+
readonly sessionId?: string | undefined;
|
|
53
|
+
readonly taskId?: string | undefined;
|
|
54
|
+
}): string;
|
|
55
|
+
/** The two lanes of one run, each as the context the scheduler backend isolates by. */
|
|
56
|
+
export interface SchedulerLanes {
|
|
57
|
+
/** Jobs bound to this session (`lifetime: "session"`, and every pending wakeup). Keyed by {@link SchedulerToolContext.scope}. */
|
|
58
|
+
readonly session: SchedulerContext;
|
|
59
|
+
/** Jobs filed under the run's isolation scope (`lifetime: "durable"`): visible from every session of that scope. */
|
|
60
|
+
readonly durable: SchedulerContext;
|
|
61
|
+
}
|
|
62
|
+
/** The lanes of the run whose factory context is `ctx`: the session lane keyed by `ctx.scope` as handed (a caller's explicit scope stands),
|
|
63
|
+
* the durable lane by the isolation scope (else `"default"`). Derive `ctx` from a verified session / run — see the note above. A lane whose
|
|
64
|
+
* key is not a non-empty string is refused. */
|
|
65
|
+
export declare function schedulerLanesOf(ctx: SchedulerToolContext): SchedulerLanes;
|
|
66
|
+
/**
|
|
67
|
+
* Every entry of both lanes: the session lane's rows, then the durable lane's rows the first did not already list (a backend that does
|
|
68
|
+
* not filter by scope answers both lanes with the same rows; one id prints once). A lane that fails fails the whole read with that lane's
|
|
69
|
+
* own error — a half table would let a reader take "none" for a fact. An environment with no scheduler seam answers `unsupported`, which an
|
|
70
|
+
* empty list (`ok` with `[]`) is not. A lane without a key is refused (`config.invalid_argument`) before the backend is asked.
|
|
71
|
+
*/
|
|
72
|
+
export declare function listScheduled(env: ExecutionEnv, lanes: SchedulerLanes): Promise<Result<ScheduledTaskSummary[], SchedulerError>>;
|
|
73
|
+
/**
|
|
74
|
+
* Cancel one entry by id, on the lane that holds it. A bare id no longer names its lane, so the holder is found by listing both lanes
|
|
75
|
+
* (both belong to this run, so reading both widens nothing): a backend whose `cancel` answers ok for an id it does not hold would let a
|
|
76
|
+
* first-lane try swallow the call while the real job on the other lane stays live under a receipt that says it is gone. Only when the
|
|
77
|
+
* listing is unavailable, or the id is not in the snapshot, does it fall back to trying each lane in turn — and then only a `not_found`
|
|
78
|
+
* is a reason to ask the next lane. The result is the backend's own: `not_found` for an id neither lane holds, `unsupported` for an
|
|
79
|
+
* environment with no scheduler seam. A lane without a key is refused (`config.invalid_argument`) before the backend is asked.
|
|
80
|
+
*/
|
|
81
|
+
export declare function cancelScheduled(env: ExecutionEnv, lanes: SchedulerLanes, id: ScheduledTaskId): Promise<Result<void, SchedulerError>>;
|
|
44
82
|
/**
|
|
45
83
|
* cron 深校验(CC CronCreateTool.validateInput parity):arity(RB-438 D4)+ 数值域(如 `61 * * * *` 分钟越域)
|
|
46
84
|
* + 永不触发(如 `31 2 30 2 *` 二月 30 日)。返回给模型自纠的错误句;合法返回 null。
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
import { defineTool, errorResult } from "../core/tools.js";
|
|
3
|
-
import { hasScheduler, isValidCronExpr, } from "../core/scheduler.js";
|
|
3
|
+
import { hasScheduler, isValidCronExpr, SchedulerError, } from "../core/scheduler.js";
|
|
4
4
|
import { mountRuleFace, toolFace } from "../core/tool-catalog-entries.js";
|
|
5
5
|
import { isolationScopeOf } from "../core/isolation-scope.js";
|
|
6
6
|
import { envErrorDetail } from "./fs/env-error-detail.js";
|
|
7
|
+
import { codedRefusal } from "../core/thrown-value.js";
|
|
8
|
+
import { describeRejectedValue } from "../core/tool-search-setting.js";
|
|
7
9
|
export const SCHEDULE_WAKEUP_TOOL_NAME = "ScheduleWakeup";
|
|
8
10
|
export const AUTONOMOUS_LOOP_SENTINEL = "<<autonomous-loop>>";
|
|
9
11
|
export const AUTONOMOUS_LOOP_DYNAMIC_SENTINEL = "<<autonomous-loop-dynamic>>";
|
|
@@ -43,6 +45,79 @@ function toSchedulerContext(c, scope) {
|
|
|
43
45
|
...(c.taskConfig !== undefined ? { taskConfig: c.taskConfig } : {}),
|
|
44
46
|
};
|
|
45
47
|
}
|
|
48
|
+
function laneKeyRefusal(member, value) {
|
|
49
|
+
return codedRefusal("config.invalid_argument", `${member} is ${describeRejectedValue(value)}, not a non-empty string — a scheduler lane needs a key that names whose entries it reads. Derive the lanes from the session or run the host has verified (schedulerLanesOf over a context whose scope comes from sessionLaneScopeOf), and give a run that carries a principal a principal that is not the empty string.`);
|
|
50
|
+
}
|
|
51
|
+
function checkedLanes(lanes) {
|
|
52
|
+
for (const member of ["session", "durable"]) {
|
|
53
|
+
const scope = lanes?.[member]?.scope;
|
|
54
|
+
if (typeof scope !== "string" || scope === "")
|
|
55
|
+
throw laneKeyRefusal(`the ${member} lane's scope`, scope);
|
|
56
|
+
}
|
|
57
|
+
return lanes;
|
|
58
|
+
}
|
|
59
|
+
export function sessionLaneScopeOf(c) {
|
|
60
|
+
const scope = c.sessionId ?? isolationScopeOf(c) ?? c.taskId ?? "default";
|
|
61
|
+
if (typeof scope !== "string" || scope === "")
|
|
62
|
+
throw laneKeyRefusal("the session lane's key", scope);
|
|
63
|
+
return scope;
|
|
64
|
+
}
|
|
65
|
+
export function schedulerLanesOf(ctx) {
|
|
66
|
+
return checkedLanes({ session: toSchedulerContext(ctx, ctx.scope), durable: toSchedulerContext(ctx, durableScopeOf(ctx)) });
|
|
67
|
+
}
|
|
68
|
+
function distinctLanesOf(lanes) {
|
|
69
|
+
return lanes.session.scope !== lanes.durable.scope ? [lanes.session, lanes.durable] : [lanes.session];
|
|
70
|
+
}
|
|
71
|
+
const UNSUPPORTED = () => ({ ok: false, error: new SchedulerError("unsupported", "this execution environment carries no scheduler seam") });
|
|
72
|
+
function schedulerSeamOf(env) {
|
|
73
|
+
const e = env;
|
|
74
|
+
return typeof e.list === "function" && typeof e.cancel === "function" ? env : undefined;
|
|
75
|
+
}
|
|
76
|
+
export async function listScheduled(env, lanes) {
|
|
77
|
+
checkedLanes(lanes);
|
|
78
|
+
const seam = schedulerSeamOf(env);
|
|
79
|
+
if (seam === undefined)
|
|
80
|
+
return UNSUPPORTED();
|
|
81
|
+
const rows = [];
|
|
82
|
+
const seen = new Set();
|
|
83
|
+
for (const lane of distinctLanesOf(lanes)) {
|
|
84
|
+
const listed = await seam.list(lane);
|
|
85
|
+
if (!listed.ok)
|
|
86
|
+
return { ok: false, error: listed.error };
|
|
87
|
+
for (const s of listed.value) {
|
|
88
|
+
if (seen.has(s.id))
|
|
89
|
+
continue;
|
|
90
|
+
seen.add(s.id);
|
|
91
|
+
rows.push(s);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return { ok: true, value: rows };
|
|
95
|
+
}
|
|
96
|
+
export async function cancelScheduled(env, lanes, id) {
|
|
97
|
+
checkedLanes(lanes);
|
|
98
|
+
const seam = schedulerSeamOf(env);
|
|
99
|
+
if (seam === undefined)
|
|
100
|
+
return UNSUPPORTED();
|
|
101
|
+
const [first, ...others] = await cancelLanesFor(seam, lanes, id);
|
|
102
|
+
let r = await seam.cancel(id, first);
|
|
103
|
+
for (const lane of others) {
|
|
104
|
+
if (r.ok || r.error.code !== "not_found")
|
|
105
|
+
break;
|
|
106
|
+
r = await seam.cancel(id, lane);
|
|
107
|
+
}
|
|
108
|
+
return r;
|
|
109
|
+
}
|
|
110
|
+
async function cancelLanesFor(env, lanes, id) {
|
|
111
|
+
const distinct = distinctLanesOf(lanes);
|
|
112
|
+
if (distinct.length === 1)
|
|
113
|
+
return distinct;
|
|
114
|
+
for (const lane of distinct) {
|
|
115
|
+
const listed = await env.list(lane);
|
|
116
|
+
if (listed.ok && listed.value.some((s) => s.id === id))
|
|
117
|
+
return [lane];
|
|
118
|
+
}
|
|
119
|
+
return distinct;
|
|
120
|
+
}
|
|
46
121
|
const CRON_FIELD_RANGES = [
|
|
47
122
|
{ min: 0, max: 59 },
|
|
48
123
|
{ min: 0, max: 23 },
|
|
@@ -193,9 +268,9 @@ export function createSchedulerTools(env, ctx) {
|
|
|
193
268
|
if (!hasScheduler(env))
|
|
194
269
|
return [];
|
|
195
270
|
const sched = env;
|
|
196
|
-
const
|
|
197
|
-
const
|
|
198
|
-
const
|
|
271
|
+
const lanes = schedulerLanesOf(ctx);
|
|
272
|
+
const sessionCtx = lanes.session;
|
|
273
|
+
const durableCtx = lanes.durable;
|
|
199
274
|
let cronCreateChain = Promise.resolve();
|
|
200
275
|
const serializedCronCreateOp = (fn) => {
|
|
201
276
|
const next = cronCreateChain.then(fn, fn);
|
|
@@ -329,16 +404,6 @@ Only use minute 0 or 30 when the user names that exact time and clearly means it
|
|
|
329
404
|
};
|
|
330
405
|
}),
|
|
331
406
|
});
|
|
332
|
-
const cancelLanesFor = async (id) => {
|
|
333
|
-
if (!lanesDiffer)
|
|
334
|
-
return [sessionCtx];
|
|
335
|
-
for (const lane of [sessionCtx, durableCtx]) {
|
|
336
|
-
const listed = await sched.list(lane);
|
|
337
|
-
if (listed.ok && listed.value.some((s) => s.id === id))
|
|
338
|
-
return [lane];
|
|
339
|
-
}
|
|
340
|
-
return [sessionCtx, durableCtx];
|
|
341
|
-
};
|
|
342
407
|
const cronCancel = defineTool({
|
|
343
408
|
name: "CronDelete",
|
|
344
409
|
...toolFace("cron-delete"),
|
|
@@ -347,14 +412,7 @@ Only use minute 0 or 30 when the user names that exact time and clearly means it
|
|
|
347
412
|
parameters: Type.Object({ id: Type.String({ description: "Job ID returned by CronCreate." }) }),
|
|
348
413
|
execute: async (args) => {
|
|
349
414
|
const { id } = args;
|
|
350
|
-
const
|
|
351
|
-
const [firstLane, ...otherLanes] = await cancelLanesFor(taskId);
|
|
352
|
-
let r = await sched.cancel(taskId, firstLane);
|
|
353
|
-
for (const lane of otherLanes) {
|
|
354
|
-
if (r.ok || r.error.code !== "not_found")
|
|
355
|
-
break;
|
|
356
|
-
r = await sched.cancel(taskId, lane);
|
|
357
|
-
}
|
|
415
|
+
const r = await cancelScheduled(sched, lanes, id);
|
|
358
416
|
if (!r.ok) {
|
|
359
417
|
if (r.error.code === "not_found")
|
|
360
418
|
return `CronDelete: no scheduled task "${id}" (already gone or not yours).`;
|
|
@@ -370,19 +428,10 @@ Only use minute 0 or 30 when the user names that exact time and clearly means it
|
|
|
370
428
|
description: "List all cron jobs scheduled via CronCreate (id, when, label).",
|
|
371
429
|
parameters: Type.Object({}),
|
|
372
430
|
execute: async () => {
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
if (!listed.ok)
|
|
378
|
-
return errorResult(`Error (CronList): ${envErrorDetail(listed.error.message)}`);
|
|
379
|
-
for (const s of listed.value) {
|
|
380
|
-
if (seen.has(s.id))
|
|
381
|
-
continue;
|
|
382
|
-
seen.add(s.id);
|
|
383
|
-
rows.push(s);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
431
|
+
const listed = await listScheduled(sched, lanes);
|
|
432
|
+
if (!listed.ok)
|
|
433
|
+
return errorResult(`Error (CronList): ${envErrorDetail(listed.error.message)}`);
|
|
434
|
+
const rows = listed.value;
|
|
386
435
|
if (rows.length === 0) {
|
|
387
436
|
return { content: "No scheduled tasks.", details: { type: "cron-list", jobs: [] } };
|
|
388
437
|
}
|
|
@@ -94,7 +94,7 @@ export declare function admitTaskListItem(item: TaskListItem, id: string): TaskL
|
|
|
94
94
|
* ({@link TASK_LIST_ROW_MALFORMED_CODE}) before anything is written. A stored entry that does not read (another writer's, an
|
|
95
95
|
* earlier release's) is `list`ed as a {@link DamagedTaskListItem} — its id and verdict — in its place, and `get` of it refuses in
|
|
96
96
|
* the same code; `delete` removes it by its id. The tools count such an entry as open, so it keeps blocking what depends on it.
|
|
97
|
-
* - RB-274: `list` is ordered by ID — {@link compareTaskIds}: numeric ids ascending, any other id after them,
|
|
97
|
+
* - RB-274: `list` is ordered by ID — {@link compareTaskIds}: numeric ids ascending by value, any other id after them, in UTF-16 code unit order —
|
|
98
98
|
* not by write order. The tool lane always allocates before it sets, so the two coincide there — but a store shared with an
|
|
99
99
|
* OUTSIDE writer (a real CC instance on the same directory) can set an id out of order, and then the backends disagreed.
|
|
100
100
|
* Ordering is part of the contract, not each backend's incidental iteration order: every bundled backend sorts with
|
|
@@ -135,9 +135,17 @@ export declare function jsonMetadataProblem(value: unknown, path?: string): stri
|
|
|
135
135
|
/** {@link jsonMetadataProblem} as the write-time refusal (a store twin calls it before persisting). */
|
|
136
136
|
export declare function assertJsonMetadata(value: unknown, path?: string): void;
|
|
137
137
|
/**
|
|
138
|
-
* RB-274 — the contract's `list` order:
|
|
139
|
-
*
|
|
140
|
-
*
|
|
138
|
+
* RB-274 / #4411 — the contract's `list` order: a TOTAL order over every string (it answers 0 only for the same string, and
|
|
139
|
+
* it is antisymmetric and transitive), the same in every locale and runtime, so the listing is stable across repeated calls
|
|
140
|
+
* and across hosts. In the order of the rules:
|
|
141
|
+
* 1. an id of ASCII digits only ("numeric") comes before any other id (CC's own task order puts its numbered tasks first);
|
|
142
|
+
* 2. numeric ids ascend by DECIMAL VALUE, read from the digits, not through a number — leading zeros dropped, the shorter
|
|
143
|
+
* digit string first, equal lengths by UTF-16 code unit — so it is exact for an id of any length;
|
|
144
|
+
* 3. numeric ids of one value (`7`, `007`, `0007`) are told apart by their whole text in UTF-16 code unit order (the one
|
|
145
|
+
* with more leading zeros first);
|
|
146
|
+
* 4. every other id comes after the numeric ones, by UTF-16 code unit order of the whole string — never by the locale's
|
|
147
|
+
* collation, which differs between hosts and answers 0 for two different strings that are canonically equivalent
|
|
148
|
+
* (NFC / NFD) or differ only by an ignorable character.
|
|
141
149
|
*/
|
|
142
150
|
export declare function compareTaskIds(a: string, b: string): number;
|
|
143
151
|
/** The bundled in-memory {@link TaskListStore} — detached copies both ways (see interface contract). */
|
package/dist/tools/task-list.js
CHANGED
|
@@ -120,16 +120,19 @@ export function assertJsonMetadata(value, path = "metadata") {
|
|
|
120
120
|
if (problem !== undefined)
|
|
121
121
|
throw new Error(problem);
|
|
122
122
|
}
|
|
123
|
+
const compareCodeUnits = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
123
124
|
export function compareTaskIds(a, b) {
|
|
124
|
-
const
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
const numericA = /^\d+$/.test(a);
|
|
126
|
+
const numericB = /^\d+$/.test(b);
|
|
127
|
+
if (numericA && numericB) {
|
|
128
|
+
const [valueA, valueB] = [a.replace(/^0+/, ""), b.replace(/^0+/, "")];
|
|
129
|
+
return Math.sign(valueA.length - valueB.length) || compareCodeUnits(valueA, valueB) || compareCodeUnits(a, b);
|
|
130
|
+
}
|
|
131
|
+
if (numericA)
|
|
129
132
|
return -1;
|
|
130
|
-
if (
|
|
133
|
+
if (numericB)
|
|
131
134
|
return 1;
|
|
132
|
-
return a
|
|
135
|
+
return compareCodeUnits(a, b);
|
|
133
136
|
}
|
|
134
137
|
export function createMemoryTaskListStore() {
|
|
135
138
|
const tasks = new Map();
|
package/dist/tools/web.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RunnerDeps, ToolSpec } from "../core/types.js";
|
|
2
2
|
import { type HostFloor } from "../core/host-floor.js";
|
|
3
|
-
import type { Model } from "../internal/llm.js";
|
|
3
|
+
import type { Model, PerModelAuth } from "../internal/llm.js";
|
|
4
4
|
/** WebFetch's factory options. Which hosts it may reach is not one of them: that is the deployment's host floor (`RunnerDeps.hostFloor`),
|
|
5
5
|
* which the Runner hands every call through its context — a product used outside a Runner holds the private-network floor alone. */
|
|
6
6
|
export interface WebFetchConfig {
|
|
@@ -153,13 +153,7 @@ export interface WebFetchSummarizerOptions {
|
|
|
153
153
|
* key↔URL pairing gate refuses off the deployment root. Absent ⇒ the options object is
|
|
154
154
|
* byte-identical to the pre-seat shape (no keys added).
|
|
155
155
|
*/
|
|
156
|
-
getApiKeyAndHeaders?: (model: Model) => Promise<
|
|
157
|
-
apiKey?: string;
|
|
158
|
-
headers?: Record<string, string>;
|
|
159
|
-
} | undefined> | {
|
|
160
|
-
apiKey?: string;
|
|
161
|
-
headers?: Record<string, string>;
|
|
162
|
-
} | undefined;
|
|
156
|
+
getApiKeyAndHeaders?: (model: Model) => Promise<PerModelAuth | undefined> | PerModelAuth | undefined;
|
|
163
157
|
}
|
|
164
158
|
/**
|
|
165
159
|
* The seat a summarizer is built over: `RunnerDeps`' own two members for the model lane — the deployment's `brain` and the
|
package/dist/tools/web.js
CHANGED
|
@@ -3,11 +3,12 @@ import { errorResult } from "../core/tools.js";
|
|
|
3
3
|
import { delimitUntrusted, inlineUntrusted } from "../core/untrusted-text.js";
|
|
4
4
|
import { discloseReminderShaped, observeReminderMarkEcho } from "../core/reminder-disclosure.js";
|
|
5
5
|
import { egressThrownText } from "../core/untrusted-egress.js";
|
|
6
|
-
import { remoteWords } from "../core/protocol-http-auth.js";
|
|
6
|
+
import { foreignLine, remoteWords } from "../core/protocol-http-auth.js";
|
|
7
7
|
import { fetchFollowing, hopRefusal, HOST_FLOOR_REFUSED_CODE } from "../core/host-floor.js";
|
|
8
8
|
import { hostOfUrl } from "../core/host-target.js";
|
|
9
9
|
import { assertNoRetiredKeys } from "../core/retired-keys.js";
|
|
10
10
|
import { DEFAULT_CHARS_PER_TOKEN } from "../internal/harness.js";
|
|
11
|
+
import { askPerModelAuth } from "../brain/route-adjudicator.js";
|
|
11
12
|
import { binaryMagicFormat } from "./fs/safety.js";
|
|
12
13
|
import { pdfMagicMatches } from "../core/image-admission.js";
|
|
13
14
|
import { mountRuleFace, toolFace } from "../core/tool-catalog-entries.js";
|
|
@@ -578,7 +579,7 @@ export function webFetchToolSpec(config = {}) {
|
|
|
578
579
|
catch (e) {
|
|
579
580
|
out = text;
|
|
580
581
|
note =
|
|
581
|
-
`[note: summarization failed (${
|
|
582
|
+
`[note: summarization failed (${foreignLine(thrownText(e), 160)}) — ` +
|
|
582
583
|
`raw page content follows; the requested analysis ("${inlineUntrusted(prompt, 120)}") was NOT applied]`;
|
|
583
584
|
}
|
|
584
585
|
}
|
|
@@ -717,12 +718,11 @@ export function createWebFetchSummarizer(seat, model, options = {}) {
|
|
|
717
718
|
const truncated = inputTruncated ? content.slice(0, budget) + "\n\n[Content truncated due to length...]" : content;
|
|
718
719
|
const userPrompt = `\nWeb page content:\n---\n${truncated}\n---\n\n${prompt}\n\n` + WEBFETCH_SUMMARY_GROUNDING_CLAUSE + "\n" + WEBFETCH_SUMMARY_GUIDELINES;
|
|
719
720
|
const context = { messages: [{ role: "user", content: userPrompt, timestamp: Date.now() }] };
|
|
720
|
-
const auth = await options.getApiKeyAndHeaders
|
|
721
|
+
const auth = await askPerModelAuth(options.getApiKeyAndHeaders, asked, options);
|
|
721
722
|
const callOptions = {
|
|
722
723
|
signal,
|
|
723
724
|
...(summaryTier !== undefined ? { reasoning: summaryTier } : {}),
|
|
724
|
-
...
|
|
725
|
-
...(auth?.headers !== undefined ? { headers: auth.headers } : {}),
|
|
725
|
+
...auth,
|
|
726
726
|
};
|
|
727
727
|
const msg = await complete(asked, context, callOptions);
|
|
728
728
|
if (msg.stopReason === "error" || msg.stopReason === "aborted") {
|