@sema-agent/core 7.55.0 → 7.57.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 +1054 -0
- package/LICENSE +1 -1
- package/dist/agents/cascade.js +1 -1
- package/dist/agents/cc-peer-directory.js +1 -0
- package/dist/agents/child-model-seat.d.ts +0 -11
- package/dist/agents/child-model-seat.js +0 -3
- package/dist/agents/list-agents-tool.d.ts +3 -1
- package/dist/agents/list-agents-tool.js +7 -7
- package/dist/agents/org-delivery-gate.js +3 -4
- package/dist/agents/peer-directory.d.ts +22 -4
- package/dist/agents/peer-directory.js +24 -2
- package/dist/agents/peer-held-queue.d.ts +69 -49
- package/dist/agents/peer-held-queue.js +255 -106
- package/dist/agents/peer-session-drain.js +65 -45
- package/dist/agents/repair-loop.js +2 -2
- package/dist/agents/send-message-tool.js +7 -6
- package/dist/agents/subagent.d.ts +6 -4
- package/dist/agents/subagent.js +72 -68
- package/dist/agents/tool-filter.d.ts +7 -5
- package/dist/agents/tool-filter.js +12 -9
- package/dist/agents/verify.d.ts +3 -2
- package/dist/agents/verify.js +3 -3
- package/dist/brain/anthropic.js +45 -80
- package/dist/brain/media-degrade.d.ts +18 -7
- package/dist/brain/media-degrade.js +13 -2
- package/dist/brain/model-capability.d.ts +37 -0
- package/dist/brain/model-capability.js +34 -0
- package/dist/brain/model-presets.d.ts +2 -8
- package/dist/brain/model-presets.js +1 -6
- package/dist/brain/open-responses.js +23 -34
- package/dist/brain/openai.js +25 -96
- package/dist/brain/provider-dialect.d.ts +3 -2
- package/dist/brain/provider-dialect.js +2 -2
- package/dist/brain/reasoning-request.d.ts +96 -0
- package/dist/brain/reasoning-request.js +174 -0
- package/dist/brain/reasoning.d.ts +11 -11
- package/dist/brain/reasoning.js +4 -3
- package/dist/brain/request-params.d.ts +13 -4
- package/dist/brain/request-params.js +21 -5
- package/dist/brain/status-sink.d.ts +20 -0
- package/dist/brain/status-sink.js +7 -0
- package/dist/brain/stream-engine.d.ts +9 -0
- package/dist/brain/stream-engine.js +24 -10
- package/dist/brain/stream-shared.d.ts +5 -4
- package/dist/brain/stream-shared.js +4 -4
- package/dist/core/a2a.d.ts +2 -1
- package/dist/core/a2a.js +19 -13
- package/dist/core/agent-definition.d.ts +10 -0
- package/dist/core/allow-entry.d.ts +23 -23
- package/dist/core/allow-entry.js +42 -46
- package/dist/core/allow-rule-shadow.d.ts +3 -3
- package/dist/core/approval-object.d.ts +21 -5
- package/dist/core/approval-object.js +44 -17
- package/dist/core/ask-origin.d.ts +66 -20
- package/dist/core/ask-origin.js +63 -23
- package/dist/core/ask-question.d.ts +51 -8
- package/dist/core/ask-question.js +3 -4
- package/dist/core/ask-unresolvable-notice.d.ts +8 -3
- package/dist/core/ask-unresolvable-notice.js +16 -2
- package/dist/core/auto-compaction.d.ts +71 -6
- package/dist/core/auto-compaction.js +42 -26
- package/dist/core/background-agent-store.d.ts +6 -2
- package/dist/core/background-agent-store.js +1 -1
- package/dist/core/checkpoint-generation.d.ts +53 -0
- package/dist/core/checkpoint-generation.js +35 -0
- package/dist/core/checkpoint-queries.d.ts +180 -0
- package/dist/core/checkpoint-queries.js +272 -0
- package/dist/core/checkpoint-requirements.d.ts +19 -1
- package/dist/core/checkpoint-requirements.js +6 -0
- package/dist/core/checkpoint-store.d.ts +105 -53
- package/dist/core/checkpoint-store.js +43 -20
- package/dist/core/cross-boundary-taint.d.ts +6 -5
- package/dist/core/cross-boundary-taint.js +5 -5
- package/dist/core/decision-receipt.d.ts +37 -3
- package/dist/core/decision-receipt.js +17 -17
- package/dist/core/delegation-not-started.d.ts +6 -0
- package/dist/core/delegation-not-started.js +17 -0
- package/dist/core/engine-attestation.d.ts +93 -0
- package/dist/core/engine-attestation.js +70 -0
- package/dist/core/engine-capabilities.d.ts +4 -1
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-notice.d.ts +32 -12
- package/dist/core/engine-notice.js +6 -0
- package/dist/core/file-history-store.d.ts +104 -22
- package/dist/core/file-history-store.js +37 -19
- package/dist/core/gate-fold.d.ts +1 -1
- package/dist/core/gate-fold.js +22 -10
- package/dist/core/gate-lanes.js +73 -65
- package/dist/core/gate-outcome.d.ts +26 -5
- package/dist/core/gate-outcome.js +26 -0
- package/dist/core/governance-codes.d.ts +5 -1
- package/dist/core/governance-codes.js +6 -0
- package/dist/core/hooks.d.ts +19 -18
- package/dist/core/hooks.js +3 -1
- package/dist/core/host-floor.d.ts +128 -0
- package/dist/core/host-floor.js +206 -0
- package/dist/core/host-target.d.ts +38 -3
- package/dist/core/host-target.js +38 -5
- package/dist/core/mailbox-store.d.ts +62 -1
- package/dist/core/mailbox-store.js +59 -0
- package/dist/core/mcp-name-judge.d.ts +46 -0
- package/dist/core/mcp-name-judge.js +61 -0
- package/dist/core/mcp-probe.d.ts +1 -1
- package/dist/core/mcp-probe.js +2 -5
- package/dist/core/mcp.d.ts +5 -1
- package/dist/core/mcp.js +70 -64
- package/dist/core/memory-engine/consolidation-driver.js +4 -3
- package/dist/core/memory-engine/delegation-settlement.js +15 -24
- package/dist/core/memory-engine/distiller.js +26 -17
- package/dist/core/memory-engine/engine.js +4 -4
- package/dist/core/memory-engine/layout.d.ts +60 -8
- package/dist/core/memory-engine/layout.js +70 -8
- package/dist/core/model-seat.d.ts +10 -3
- package/dist/core/mods/classic-events.d.ts +67 -0
- package/dist/core/mods/classic-events.js +1 -0
- package/dist/core/mods/dollar.d.ts +13 -0
- package/dist/core/mods/extension-call.d.ts +31 -0
- package/dist/core/mods/extension-call.js +43 -0
- package/dist/core/mods/kernel/dispatch.d.ts +20 -3
- package/dist/core/mods/kernel/dispatch.js +140 -69
- package/dist/core/mods/kernel/events.d.ts +47 -11
- package/dist/core/mods/kernel/events.js +66 -42
- package/dist/core/mods/kernel/index.d.ts +4 -4
- package/dist/core/mods/kernel/index.js +2 -2
- package/dist/core/mods/kernel/receive.d.ts +39 -5
- package/dist/core/mods/kernel/receive.js +290 -17
- package/dist/core/mods/kernel/registration.d.ts +33 -2
- package/dist/core/mods/kernel/registration.js +6 -7
- package/dist/core/mods/kernel/site-rules.d.ts +44 -16
- package/dist/core/mods/kernel/site-rules.js +24 -42
- package/dist/core/mods/spec-seats.d.ts +69 -0
- package/dist/core/mods/spec-seats.js +114 -0
- package/dist/core/mods/stations.d.ts +28 -8
- package/dist/core/mods/stations.js +29 -13
- package/dist/core/mods/tool-call.d.ts +79 -0
- package/dist/core/mods/tool-call.js +152 -0
- package/dist/core/namespaced-rule-name.d.ts +32 -38
- package/dist/core/namespaced-rule-name.js +29 -36
- package/dist/core/parent-spec-seat.d.ts +6 -1
- package/dist/core/parent-spec-seat.js +2 -0
- package/dist/core/park-selfcheck.js +3 -0
- package/dist/core/permission-rule-consent.d.ts +24 -3
- package/dist/core/permission-rule-consent.js +136 -41
- package/dist/core/permission-rule-model.d.ts +57 -5
- package/dist/core/permission-rule-model.js +90 -31
- package/dist/core/permission-rule-org.d.ts +6 -2
- package/dist/core/permission-rule-org.js +8 -4
- package/dist/core/permission-rule-provider.d.ts +5 -2
- package/dist/core/permission-rule-provider.js +41 -11
- package/dist/core/permission-rule-store.d.ts +3 -2
- package/dist/core/permission-rule-store.js +11 -2
- package/dist/core/permission-rule-sync.js +3 -2
- package/dist/core/permission-rule-syntax.d.ts +5 -4
- package/dist/core/permission-rule-syntax.js +2 -2
- package/dist/core/permission-rules.d.ts +4 -4
- package/dist/core/permission-rules.js +11 -20
- package/dist/core/persisted-rule-arms.d.ts +2 -2
- package/dist/core/persisted-rule-arms.js +10 -12
- package/dist/core/principal-name.d.ts +20 -0
- package/dist/core/principal-name.js +22 -0
- package/dist/core/prompt-section-seat.js +4 -6
- package/dist/core/protocol-http-auth.d.ts +40 -5
- package/dist/core/protocol-http-auth.js +168 -4
- package/dist/core/protocol-naming.d.ts +20 -0
- package/dist/core/protocol-naming.js +20 -3
- package/dist/core/read-only-shell.d.ts +20 -5
- package/dist/core/read-only-shell.js +29 -14
- package/dist/core/remote-env.d.ts +37 -1
- package/dist/core/remote-env.js +11 -0
- package/dist/core/resume-startup-cause.d.ts +24 -2
- package/dist/core/resume-startup-cause.js +20 -1
- package/dist/core/retired-keys.d.ts +16 -0
- package/dist/core/retired-keys.js +16 -4
- package/dist/core/rewrite-rejudge.d.ts +60 -0
- package/dist/core/rewrite-rejudge.js +36 -0
- package/dist/core/roles.d.ts +28 -1
- package/dist/core/roles.js +81 -26
- package/dist/core/rule-lane-reads.d.ts +20 -15
- package/dist/core/rule-lane-reads.js +45 -17
- package/dist/core/rule-owner.d.ts +3 -3
- package/dist/core/rule-owner.js +3 -2
- package/dist/core/runner/announce-once-ledger.d.ts +14 -0
- package/dist/core/runner/announce-once-ledger.js +5 -0
- package/dist/core/runner/assemble-result.d.ts +1 -0
- package/dist/core/runner/assemble-result.js +1 -1
- package/dist/core/runner/call-hook-stations.d.ts +3 -2
- package/dist/core/runner/caller-roster.d.ts +16 -4
- package/dist/core/runner/caller-roster.js +33 -6
- package/dist/core/runner/capability-withheld-seat.d.ts +5 -0
- package/dist/core/runner/capability-withheld-seat.js +24 -0
- package/dist/core/runner/classifier-ladder.d.ts +7 -9
- package/dist/core/runner/classifier-ladder.js +3 -3
- package/dist/core/runner/compact-session.d.ts +10 -0
- package/dist/core/runner/compact-session.js +202 -0
- package/dist/core/runner/compaction-call-options.d.ts +2 -2
- package/dist/core/runner/compaction-seams.d.ts +21 -1
- package/dist/core/runner/compaction-seams.js +11 -8
- package/dist/core/runner/construction-doors.js +3 -0
- package/dist/core/runner/contracts.d.ts +50 -40
- package/dist/core/runner/cross-boundary-lane.d.ts +17 -13
- package/dist/core/runner/cross-boundary-lane.js +40 -27
- package/dist/core/runner/denial-limit-arms.d.ts +2 -2
- package/dist/core/runner/denial-limit-arms.js +1 -1
- package/dist/core/runner/derived-route-fallback.d.ts +13 -0
- package/dist/core/runner/derived-route-fallback.js +6 -0
- package/dist/core/runner/env-capability-census.d.ts +3 -2
- package/dist/core/runner/env-capability-census.js +9 -3
- package/dist/core/runner/file-history-request.d.ts +18 -0
- package/dist/core/runner/file-history-request.js +21 -13
- package/dist/core/runner/file-history-restore.d.ts +45 -0
- package/dist/core/runner/file-history-restore.js +46 -0
- package/dist/core/runner/gate-exit.d.ts +3 -3
- package/dist/core/runner/gate-exit.js +4 -3
- package/dist/core/runner/image.d.ts +7 -17
- package/dist/core/runner/image.js +9 -60
- package/dist/core/runner/permission-rule-lanes.d.ts +11 -11
- package/dist/core/runner/permission-rule-lanes.js +39 -17
- package/dist/core/runner/person-path-rows.d.ts +12 -9
- package/dist/core/runner/person-path-rows.js +18 -7
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +3 -0
- package/dist/core/runner/prepare-acquire-reconcile.js +2 -1
- package/dist/core/runner/prepare-ask-lane.d.ts +2 -2
- package/dist/core/runner/prepare-ask-lane.js +5 -2
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -6
- package/dist/core/runner/prepare-caps-and-workflow.js +4 -3
- package/dist/core/runner/prepare-config-doors.d.ts +35 -38
- package/dist/core/runner/prepare-config-doors.js +46 -28
- package/dist/core/runner/prepare-defer-classify.d.ts +4 -3
- package/dist/core/runner/prepare-defer-classify.js +7 -8
- package/dist/core/runner/prepare-file-history.d.ts +48 -8
- package/dist/core/runner/prepare-file-history.js +7 -39
- package/dist/core/runner/prepare-gate-stations.d.ts +1 -1
- package/dist/core/runner/prepare-gate-stations.js +10 -1
- package/dist/core/runner/prepare-hands-readface.d.ts +5 -9
- package/dist/core/runner/prepare-hands-readface.js +17 -14
- package/dist/core/runner/prepare-inherited-gate.d.ts +6 -3
- package/dist/core/runner/prepare-inherited-gate.js +5 -3
- package/dist/core/runner/prepare-memory-engine-session.js +1 -1
- package/dist/core/runner/prepare-park-ask.d.ts +2 -0
- package/dist/core/runner/prepare-park-ask.js +7 -7
- package/dist/core/runner/prepare-policy-chain.d.ts +6 -3
- package/dist/core/runner/prepare-policy-chain.js +67 -76
- package/dist/core/runner/prepare-prompt-assembly.d.ts +5 -7
- package/dist/core/runner/prepare-prompt-assembly.js +10 -8
- package/dist/core/runner/prepare-prompt-inputs.d.ts +11 -9
- package/dist/core/runner/prepare-prompt-inputs.js +3 -5
- package/dist/core/runner/prepare-protocol-tools.d.ts +2 -0
- package/dist/core/runner/prepare-protocol-tools.js +3 -3
- package/dist/core/runner/prepare-safety-scan.d.ts +1 -1
- package/dist/core/runner/prepare-safety-scan.js +0 -17
- package/dist/core/runner/prepare-suspend-saga.d.ts +2 -0
- package/dist/core/runner/prepare-suspend-saga.js +5 -6
- package/dist/core/runner/prepare-task.d.ts +5 -2
- package/dist/core/runner/prepare-task.js +48 -43
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +20 -4
- package/dist/core/runner/prepare-tool-disclosure-mount.js +33 -23
- package/dist/core/runner/prepare-turn-wiring.d.ts +0 -4
- package/dist/core/runner/prepare-turn-wiring.js +2 -7
- package/dist/core/runner/prepare-wiring-manifest.d.ts +6 -2
- package/dist/core/runner/prepare-wiring-manifest.js +3 -3
- package/dist/core/runner/resume-admission.js +1 -1
- package/dist/core/runner/resume-apply.js +11 -12
- package/dist/core/runner/resume-checkpoint-screen.js +3 -0
- package/dist/core/runner/resume-claim.d.ts +4 -2
- package/dist/core/runner/resume-claim.js +15 -8
- package/dist/core/runner/retired-runner-deps.js +1 -0
- package/dist/core/runner/rewind-files.d.ts +12 -0
- package/dist/core/runner/rewind-files.js +90 -0
- package/dist/core/runner/run-attachment-seats.js +2 -1
- package/dist/core/runner/run-brain-sinks.d.ts +4 -1
- package/dist/core/runner/run-brain-sinks.js +4 -2
- package/dist/core/runner/run-harness-handlers.js +12 -4
- package/dist/core/runner/run-leg.d.ts +1 -1
- package/dist/core/runner/run-leg.js +40 -39
- package/dist/core/runner/run-notification-lane.d.ts +2 -0
- package/dist/core/runner/run-notification-lane.js +2 -2
- package/dist/core/runner/run-recovery-lanes.js +3 -4
- package/dist/core/runner/run-settle-and-teardown.js +7 -12
- package/dist/core/runner/run-terminal-adoption.js +3 -4
- package/dist/core/runner/run-turn-boundary.js +4 -15
- package/dist/core/runner/runtask.d.ts +10 -0
- package/dist/core/runner/runtask.js +35 -42
- package/dist/core/runner/send-message-continuation.js +1 -1
- package/dist/core/runner/session-read-file-states.d.ts +15 -0
- package/dist/core/runner/session-read-file-states.js +28 -0
- package/dist/core/runner/session-rule-policy.js +4 -3
- package/dist/core/runner/session-verb-doors.d.ts +28 -0
- package/dist/core/runner/session-verb-doors.js +48 -0
- package/dist/core/runner/session-write-ledger.d.ts +30 -0
- package/dist/core/runner/session-write-ledger.js +101 -0
- package/dist/core/runner/shell-env-withheld.d.ts +33 -0
- package/dist/core/runner/shell-env-withheld.js +51 -0
- package/dist/core/runner/skills-seat.js +6 -2
- package/dist/core/runner/stream-settle-backstop.js +12 -15
- package/dist/core/runner/sub-agent-deny-lists.d.ts +25 -3
- package/dist/core/runner/sub-agent-deny-lists.js +25 -17
- package/dist/core/runner/synthetic-tools.d.ts +6 -0
- package/dist/core/runner/synthetic-tools.js +4 -1
- package/dist/core/runner/teardown-bounded.d.ts +1 -0
- package/dist/core/runner/teardown-bounded.js +1 -0
- package/dist/core/runner/tool-disclosure.d.ts +10 -12
- package/dist/core/runner/tool-disclosure.js +1 -3
- package/dist/core/runner/tool-end-body.d.ts +1 -1
- package/dist/core/runner/tool-end-body.js +10 -9
- package/dist/core/runner/tool-not-executed.d.ts +5 -0
- package/dist/core/runner/tool-not-executed.js +11 -0
- package/dist/core/runner/tool-occurrence.d.ts +8 -0
- package/dist/core/runner/tool-occurrence.js +7 -0
- package/dist/core/runner/turn-attachments.d.ts +33 -15
- package/dist/core/runner/turn-attachments.js +62 -37
- package/dist/core/runner-deps.d.ts +7 -7
- package/dist/core/safety-axis-vocab.d.ts +6 -4
- package/dist/core/safety-axis-vocab.js +6 -5
- package/dist/core/safety-merge-corpus.js +11 -3
- package/dist/core/secret-env.d.ts +30 -3
- package/dist/core/secret-env.js +47 -8
- package/dist/core/select-model.js +3 -3
- package/dist/core/session-policy-store.d.ts +32 -15
- package/dist/core/session-policy-store.js +156 -36
- package/dist/core/session-store.d.ts +29 -10
- package/dist/core/session-store.js +51 -19
- package/dist/core/session.d.ts +82 -16
- package/dist/core/session.js +53 -0
- package/dist/core/shell-read-silence.d.ts +11 -12
- package/dist/core/shell-read-silence.js +9 -5
- package/dist/core/shell-run-candidates.js +3 -1
- package/dist/core/shell-wrapper-projection.d.ts +1 -1
- package/dist/core/shell-wrapper-projection.js +1 -1
- package/dist/core/shell-wrapper-table.d.ts +14 -7
- package/dist/core/shell-wrapper-table.js +5 -4
- package/dist/core/side-query.js +10 -1
- package/dist/core/skill-grant.d.ts +7 -2
- package/dist/core/skill-grant.js +5 -0
- package/dist/core/skills-directory.js +6 -2
- package/dist/core/store-contracts/background-agent-store-contract.js +1 -0
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +11 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +141 -2
- package/dist/core/store-contracts/file-history-store-contract.js +40 -1
- package/dist/core/store-contracts/mailbox-store-contract.js +49 -1
- package/dist/core/store-contracts/peer-directory-contract.d.ts +7 -2
- package/dist/core/store-contracts/peer-directory-contract.js +14 -2
- package/dist/core/store-contracts/session-repo-contract.js +51 -0
- package/dist/core/store-contracts/session-store-contract.d.ts +2 -1
- package/dist/core/store-contracts/session-store-contract.js +150 -14
- package/dist/core/stub-env.d.ts +2 -0
- package/dist/core/stub-env.js +1 -0
- package/dist/core/synthetic-read-verdict.js +3 -3
- package/dist/core/task-event.d.ts +32 -4
- package/dist/core/task-notification.d.ts +16 -12
- package/dist/core/task-registry-agent.d.ts +8 -4
- package/dist/core/task-registry-agent.js +14 -8
- package/dist/core/task-registry-shared.d.ts +35 -6
- package/dist/core/task-registry-shared.js +11 -0
- package/dist/core/task-registry.d.ts +10 -1
- package/dist/core/task-registry.js +12 -2
- package/dist/core/task-result.d.ts +18 -0
- package/dist/core/task-spec.d.ts +18 -13
- package/dist/core/tighten-task-spec.js +2 -1
- package/dist/core/tool-catalog-entries.d.ts +23 -0
- package/dist/core/tool-catalog-entries.js +14 -2
- package/dist/core/tool-check-reading.d.ts +11 -0
- package/dist/core/tool-check-reading.js +11 -6
- package/dist/core/tool-model-gate.d.ts +2 -2
- package/dist/core/tool-name-aliases.d.ts +48 -18
- package/dist/core/tool-name-aliases.js +36 -19
- package/dist/core/tool-name-readings.d.ts +6 -32
- package/dist/core/tool-name-readings.js +2 -9
- package/dist/core/tool-policy.d.ts +78 -204
- package/dist/core/tool-policy.js +152 -204
- package/dist/core/tool-result-store.js +3 -0
- package/dist/core/tool-roster.d.ts +14 -19
- package/dist/core/tool-roster.js +11 -44
- package/dist/core/tool-spec-members.js +7 -2
- package/dist/core/tool-spec.d.ts +19 -11
- package/dist/core/tools.js +49 -9
- package/dist/core/trace.d.ts +6 -3
- package/dist/core/trace.js +2 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/untrusted-egress.d.ts +20 -0
- package/dist/core/untrusted-egress.js +77 -3
- package/dist/core/user-attachment.d.ts +8 -1
- package/dist/core/user-attachment.js +64 -4
- package/dist/core/wiring-manifest.d.ts +9 -0
- package/dist/core/wiring-manifest.js +1 -0
- package/dist/core/workflow-journal-store.js +1 -1
- package/dist/engine/compaction/compaction.js +3 -2
- package/dist/engine/execution-env/node-execution-env.d.ts +7 -3
- package/dist/engine/execution-env/node-execution-env.js +11 -2
- package/dist/engine/harness/agent-harness.d.ts +32 -6
- package/dist/engine/harness/agent-harness.js +65 -9
- package/dist/engine/harness/types.d.ts +29 -2
- package/dist/engine/llm/types.d.ts +28 -11
- package/dist/engine/loop/agent-loop.d.ts +23 -4
- package/dist/engine/loop/agent-loop.js +42 -30
- package/dist/engine/loop/types.d.ts +16 -6
- package/dist/engine/session/memory-repo.d.ts +9 -2
- package/dist/engine/session/memory-repo.js +11 -1
- package/dist/engine/session/repo-utils.d.ts +6 -5
- package/dist/engine/session/repo-utils.js +14 -6
- package/dist/index.d.ts +34 -17
- package/dist/index.js +22 -11
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/internal/harness.d.ts +2 -1
- package/dist/internal/harness.js +1 -0
- package/dist/internal/llm.d.ts +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts +6 -4
- package/dist/orchestration/run-workflow-tool.js +5 -3
- package/dist/orchestration/workflow.d.ts +3 -0
- package/dist/orchestration/workflow.js +36 -18
- package/dist/primitives/credential-ref.d.ts +89 -0
- package/dist/primitives/credential-ref.js +125 -0
- package/dist/primitives/index.d.ts +2 -0
- package/dist/primitives/index.js +1 -0
- package/dist/prompt-assembly/artifact.d.ts +2 -2
- package/dist/prompt-assembly/artifact.js +5 -3
- package/dist/prompt-assembly/assemble.d.ts +3 -2
- package/dist/prompt-assembly/assemble.js +1 -1
- package/dist/prompt-assembly/catalog/schema.d.ts +43 -12
- package/dist/prompt-assembly/catalog/schema.js +34 -2
- package/dist/prompt-assembly/catalog/sections.js +0 -1
- package/dist/prompt-assembly/composer.d.ts +3 -1
- package/dist/prompt-assembly/composer.js +1 -1
- package/dist/prompt-assembly/event-registry.js +1 -0
- package/dist/prompt-assembly/overlay.js +3 -3
- package/dist/prompt-assembly/renderers.d.ts +1 -1
- package/dist/prompt-assembly/renderers.js +0 -3
- package/dist/prompt-assembly/role-base.d.ts +15 -0
- package/dist/prompt-assembly/role-base.js +9 -0
- package/dist/prompt-assembly/select.d.ts +39 -14
- package/dist/prompt-assembly/select.js +47 -16
- package/dist/prompt-assembly/sugar.d.ts +17 -11
- package/dist/prompt-assembly/sugar.js +8 -3
- package/dist/prompt-assembly/tool-catalog.d.ts +37 -3
- package/dist/prompt-assembly/tool-catalog.js +114 -4
- package/dist/prompt-assembly/turn-snapshot.d.ts +4 -10
- package/dist/prompt-assembly/turn-snapshot.js +0 -3
- package/dist/prompt-assembly/types.d.ts +0 -7
- package/dist/scenarios/full-body.d.ts +11 -11
- package/dist/scenarios/full-body.js +4 -3
- package/dist/shell/lex.js +10 -1
- package/dist/stores/file/adoption/adopt.js +4 -3
- package/dist/stores/file/adoption/marker.js +3 -2
- package/dist/stores/file/checkpoint-store.d.ts +21 -4
- package/dist/stores/file/checkpoint-store.js +38 -7
- package/dist/stores/file/file-history-store.js +18 -11
- package/dist/stores/file/index.js +2 -1
- package/dist/stores/file/mailbox-store.d.ts +2 -1
- package/dist/stores/file/mailbox-store.js +26 -1
- package/dist/stores/file/permission-rule-adopt.js +4 -3
- package/dist/stores/file/permission-rule-store.js +11 -5
- package/dist/stores/file/session-store.d.ts +29 -6
- package/dist/stores/file/session-store.js +42 -50
- package/dist/tools/artifact/artifact-tool.js +3 -2
- package/dist/tools/fs/bash-program-position.d.ts +19 -2
- package/dist/tools/fs/bash-program-position.js +56 -9
- package/dist/tools/fs/bash-readonly-classifier.d.ts +15 -19
- package/dist/tools/fs/bash-readonly-classifier.js +5 -10
- package/dist/tools/fs/fs-bash.js +15 -8
- package/dist/tools/fs/fs-glob.d.ts +86 -0
- package/dist/tools/fs/fs-glob.js +226 -0
- package/dist/tools/fs/fs-read.js +14 -14
- package/dist/tools/fs/fs-search-tools.js +7 -7
- package/dist/tools/fs/pattern-kill-guard.d.ts +23 -0
- package/dist/tools/fs/pattern-kill-guard.js +429 -0
- package/dist/tools/fs/pdf.d.ts +9 -6
- package/dist/tools/fs/pdf.js +3 -3
- package/dist/tools/fs/program-read-model.d.ts +57 -7
- package/dist/tools/fs/program-read-model.js +11 -1
- package/dist/tools/fs/program-read-model.rows.js +78 -21
- package/dist/tools/fs/read-deny-home.js +3 -2
- package/dist/tools/fs/removal-targets.d.ts +17 -7
- package/dist/tools/fs/removal-targets.js +47 -20
- package/dist/tools/fs/search.d.ts +10 -0
- package/dist/tools/fs/search.js +20 -26
- package/dist/tools/fs/shell-read-argv.js +89 -12
- package/dist/tools/fs/shell-read-bindings.d.ts +31 -0
- package/dist/tools/fs/shell-read-bindings.js +41 -0
- package/dist/tools/fs/shell-read-check.d.ts +10 -0
- package/dist/tools/fs/shell-read-check.js +13 -20
- package/dist/tools/fs/shell-read-environment.d.ts +5 -1
- package/dist/tools/fs/shell-read-environment.js +3 -2
- package/dist/tools/fs/shell-read-establish.d.ts +15 -0
- package/dist/tools/fs/shell-read-establish.js +19 -20
- package/dist/tools/fs/shell-read-identity.d.ts +12 -9
- package/dist/tools/fs/shell-read-identity.js +9 -4
- package/dist/tools/fs/shell-read-plan.js +24 -16
- package/dist/tools/fs/shell-read-start.d.ts +6 -1
- package/dist/tools/fs/shell-read-write-targets.d.ts +5 -1
- package/dist/tools/fs/shell-read-write-targets.js +2 -3
- package/dist/tools/fs/shell-reentry-text.d.ts +9 -0
- package/dist/tools/fs/shell-reentry-text.js +40 -2
- package/dist/tools/todo.js +63 -63
- package/dist/tools/web.d.ts +19 -14
- package/dist/tools/web.js +46 -61
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +221 -7
- package/wire-changes/core-stores-sql@7.57.0.json +29 -0
- package/wire-changes/core@7.56.0.json +3891 -0
- package/wire-changes/core@7.57.0.json +1487 -0
- package/wire-changes/mods-kernel@7.56.0.json +303 -0
- package/wire-changes/mods-kernel@7.57.0.json +29 -0
- package/wire-changes/primitives@7.57.0.json +245 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { reopenReasonOf, resumeStartupCauseOf } from "../resume-startup-cause.js";
|
|
1
|
+
import { thrownFailureOf } from "./terminal-account.js";
|
|
2
|
+
import { compensateUnstarted, reopenReasonOf, resumeStartupCauseOf, unstartedRowSentence } from "../resume-startup-cause.js";
|
|
3
3
|
import { resumeDecisionWasNegative } from "./decide-continuation.js";
|
|
4
4
|
import { drainForwardedFramesBeforeDone, forwardsSubagentEvents } from "./prepare-run-refs.js";
|
|
5
5
|
import { hasDestroy } from "../remote-env.js";
|
|
@@ -13,23 +13,20 @@ export function streamSettleBackstop(input) {
|
|
|
13
13
|
const onRunRejected = async (err) => {
|
|
14
14
|
let { code, message, detail } = thrownFailureOf(err, thrownText(err));
|
|
15
15
|
const reopenReason = reopenReasonOf(resumeStartupCauseOf(code));
|
|
16
|
-
const reopenable = resume !== undefined &&
|
|
16
|
+
const reopenable = resume !== undefined && live.resultValue === undefined && resume.pendingActionStarted !== true && !(resumeDecisionWasNegative(resume) && resume.decisionDelivered === true);
|
|
17
17
|
let reopenCommitted = false;
|
|
18
18
|
let reopenStateUnknown = false;
|
|
19
|
-
if (reopenable && resume
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
if (reopenable && resume !== undefined) {
|
|
20
|
+
const row = await compensateUnstarted(resume.reopenUnstarted, reopenReason);
|
|
21
|
+
if (row.kind === "reopened") {
|
|
22
22
|
reopenCommitted = true;
|
|
23
|
+
message = `${message} — ${unstartedRowSentence(row)}`;
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
else {
|
|
25
26
|
parentConstraintRegistry.delete(resume.cp.token);
|
|
26
27
|
const original = asThrownError(err);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
reopenStateUnknown = !definitive;
|
|
30
|
-
err = Object.assign(new Error(definitive
|
|
31
|
-
? `${reopenMsg} (original resume failure: ${original.message})`
|
|
32
|
-
: `checkpoint reopen threw mid-flight — state UNKNOWN, confirm via the checkpoint store before retrying: ${reopenMsg} (original resume failure: ${original.message})`, { cause: original }), { code: "checkpoint.reopen_failed" });
|
|
28
|
+
reopenStateUnknown = row.kind === "unknown";
|
|
29
|
+
err = Object.assign(new Error(`${original.message} — ${unstartedRowSentence(row)}`, { cause: original }), { code: "checkpoint.reopen_failed" });
|
|
33
30
|
const replacement = thrownFailureOf(err, thrownText(err));
|
|
34
31
|
code = replacement.code;
|
|
35
32
|
message = replacement.message;
|
|
@@ -38,7 +35,7 @@ export function streamSettleBackstop(input) {
|
|
|
38
35
|
}
|
|
39
36
|
if (resume)
|
|
40
37
|
locallyClaimedTokens.delete(resume.cp.token);
|
|
41
|
-
if (resume && !reopenCommitted) {
|
|
38
|
+
if (resume && !reopenCommitted && live.resultValue === undefined) {
|
|
42
39
|
parentConstraintRegistry.delete(resume.cp.token);
|
|
43
40
|
await settleTeardownLeg(() => sessions.unpin?.(resume.cp.sessionId), "sessions.unpin (resume-failure leg)", (e) => runner.deps.onError?.(e, { phase: "config", sessionId: resume.cp.sessionId }));
|
|
44
41
|
if (!reopenStateUnknown) {
|
|
@@ -74,7 +71,7 @@ export function streamSettleBackstop(input) {
|
|
|
74
71
|
sessionId: taskIdRef.sessionId ?? "unknown",
|
|
75
72
|
...(taskIdRef.runId !== undefined ? { runId: taskIdRef.runId } : {}),
|
|
76
73
|
terminal: { kind: "failed", ...(code !== undefined ? { code } : {}), message, ...(detail !== undefined ? { detail } : {}) },
|
|
77
|
-
result: "",
|
|
74
|
+
result: "", resultEntryIds: [],
|
|
78
75
|
...(remoteEnvFailure !== undefined ? { remoteEnvFailures: remoteEnvFailure } : {}),
|
|
79
76
|
...(taskIdRef.effectiveMemoryScopes !== undefined ? { effectiveMemoryScopes: taskIdRef.effectiveMemoryScopes } : {}),
|
|
80
77
|
...(taskIdRef.effectiveReasoning !== undefined ? { effectiveReasoning: taskIdRef.effectiveReasoning } : {}),
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
import type { AgentTool } from "../../internal/harness.js";
|
|
37
37
|
import { valveLeaves } from "../../agents/tool-filter.js";
|
|
38
38
|
import { type ProtocolId } from "../protocol-table.js";
|
|
39
|
-
import type { ToolLegKind, ToolSelectorLayer } from "../tool-face.js";
|
|
39
|
+
import type { ToolLegKind, ToolSelector, ToolSelectorLayer } from "../tool-face.js";
|
|
40
40
|
import { type ConstraintChainEntry } from "../tool-policy.js";
|
|
41
41
|
import type { TaskSpec } from "../types.js";
|
|
42
42
|
import type { CheckpointErrorReason } from "../checkpoint-store.js";
|
|
@@ -87,6 +87,27 @@ export type PersistedToolFaceReason = Extract<CheckpointErrorReason, "not_a_list
|
|
|
87
87
|
* leg's roster and a sink; the leg's own policy-name audit is what reads them.
|
|
88
88
|
*/
|
|
89
89
|
export declare function deniedToolNamesOf(where: string, value: unknown): string[];
|
|
90
|
+
/**
|
|
91
|
+
* Whose lists a run's own layer are, in the words every sentence about them uses: the delegation tool (and agent definition) that wrote
|
|
92
|
+
* them when the run records one (`RunInternals.ownToolLists`), else `undefined` — the run's own `TaskSpec` seats.
|
|
93
|
+
*/
|
|
94
|
+
export declare function ownListsWhereOf(ownBy: RunInternals["ownToolLists"]): string | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* THE build of a leg's tool selector: `layers` are the ceiling it was spawned under, then its own lists (the last is its own), and
|
|
97
|
+
* `legs` the kinds of leg it is. Every layer is read by the one layer reader ({@link readSelectorLayer}), once, whoever judged it and
|
|
98
|
+
* whatever evidence the run carries — a live ceiling and the run's own lists were judged by the engine that wrote them, which may have
|
|
99
|
+
* read what this one cannot (a list that is not one, a member that is not a string, an entry no rule syntax reads), so the leg does not
|
|
100
|
+
* start without a layer that says something. The selector is compiled from what was read, never from the layers again: a getter that
|
|
101
|
+
* answers differently the second time is not asked a second time, and the selector's layers (handed to the leg's children as their
|
|
102
|
+
* ceiling) are the frozen product. Built before anything reads it, and before the session is acquired, so a refusal needs nothing given
|
|
103
|
+
* back. `where` is whose lists the own layer is ({@link ownListsWhereOf}). (A ceiling a resumed row restored was read by the same reader
|
|
104
|
+
* before the claim — `persistedToolNamesRefusal`.)
|
|
105
|
+
*/
|
|
106
|
+
export declare function readToolSelector(input: {
|
|
107
|
+
readonly layers: readonly unknown[];
|
|
108
|
+
readonly where: string | undefined;
|
|
109
|
+
readonly legs: readonly ToolLegKind[];
|
|
110
|
+
}): ToolSelector;
|
|
90
111
|
/**
|
|
91
112
|
* THE read-back of the tool names a checkpoint row carries, before the claim: the ceiling the resumed leg will run under when it is
|
|
92
113
|
* the row's (`ceiling`: absent when a live seat hands one) — each layer read by {@link readSelectorLayer} as a recorded layer — and
|
|
@@ -141,8 +162,9 @@ export interface RunToolListsInput {
|
|
|
141
162
|
readonly allow: readonly string[] | undefined;
|
|
142
163
|
readonly exclude: readonly string[] | undefined;
|
|
143
164
|
};
|
|
144
|
-
/** borrowed-readonly —
|
|
145
|
-
|
|
165
|
+
/** borrowed-readonly — the run's selector, as {@link readToolSelector} built it: every layer of it (the ceiling, then its own) already read, and judged here as read. */
|
|
166
|
+
selector: ToolSelector;
|
|
167
|
+
/** The kinds of leg the run is (the ones the selector was built for). */
|
|
146
168
|
legs: readonly ToolLegKind[];
|
|
147
169
|
/** True ⇔ the spawning run's prepare judged exactly these own lists where they were mounted, against a pool it could list (as the
|
|
148
170
|
* child-facing lists of the delegation tool or definition that wrote them) — the evidence digest it handed down (live, or recorded
|
|
@@ -6,7 +6,7 @@ import { ENGINE_TOOLS } from "../tool-catalog-entries.js";
|
|
|
6
6
|
import { callerToolNameProblem } from "../caller-tool-name.js";
|
|
7
7
|
import { mintNamespacePrefix } from "../protocol-naming.js";
|
|
8
8
|
import { PROTOCOL_TABLE, protocolOf } from "../protocol-table.js";
|
|
9
|
-
import { mountedToolNames, splitNamespacedName
|
|
9
|
+
import { grantWildcardRefusalOf, mountedToolNames, splitNamespacedName } from "../tool-name-aliases.js";
|
|
10
10
|
import { projectionToolNames } from "../tool-policy.js";
|
|
11
11
|
import { declaredDelegationNameOf } from "../delegation-name.js";
|
|
12
12
|
export function renamedDelegationMountSentence(...rosters) {
|
|
@@ -97,9 +97,6 @@ function readableToolNameList(where, side, value, code) {
|
|
|
97
97
|
throw refused(notAStringSentence(where, side, index, read.type), code, "not_a_string");
|
|
98
98
|
if (read.kind === "unreadable")
|
|
99
99
|
throw grammarRefusal(where, side, { entry: read.entry, reason: "grammar" }, code);
|
|
100
|
-
if (side === "denied" && read.name === "*") {
|
|
101
|
-
throw refused(`${where} declares ${renderListEntry(entry)} in its ${LIST_WORD[side]}: a denied list has no wildcard — the entry would hide nothing. To give the agent no tools, write an empty allowed list.`, code, "unsupported_pattern");
|
|
102
|
-
}
|
|
103
100
|
return { entry: entry, name: read.name, content: read.content };
|
|
104
101
|
});
|
|
105
102
|
}
|
|
@@ -117,11 +114,11 @@ function judgeToolNameList(where, side, value, universe, advise, code) {
|
|
|
117
114
|
const content = side === "denied" && written;
|
|
118
115
|
const reach = side === "denied" ? readDeniedToolList([entry]) : (readAllowedToolList([entry]) ?? readDeniedToolList([]));
|
|
119
116
|
const split = splitNamespacedName(name);
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
117
|
+
const toolSplit = splitNamespacedName(toolName);
|
|
118
|
+
if (toolName.includes("*") && (toolSplit === undefined || toolSplit.peer.includes("*"))) {
|
|
122
119
|
if (side === "denied")
|
|
123
120
|
continue;
|
|
124
|
-
throw refused(`${where} declares ${renderListEntry(entry)} in its ${LIST_WORD[side]}:
|
|
121
|
+
throw refused(`${where} declares ${renderListEntry(entry)} in its ${LIST_WORD[side]}: ${grantWildcardRefusalOf(name)}.`, code, "unsupported_pattern");
|
|
125
122
|
}
|
|
126
123
|
const { inert } = compileAllowList([toolName], "deny", universe.known);
|
|
127
124
|
const flaw = inert[0] === undefined ? undefined : { ...inert[0], entry, ...(inert[0].reason === "near_miss" && inert[0].currentName !== undefined ? { carriedBy: universe.carrierOf(inert[0].currentName) } : {}) };
|
|
@@ -153,14 +150,31 @@ function readSelectorLayer(layer, layerWhere, listWhere, recorded) {
|
|
|
153
150
|
if (!isToolSelectorLayer(layer)) {
|
|
154
151
|
throw refused(`${layerWhere} are a value that is ${valueTypeLabel(layer)}, not a pair of tool-name lists (an allowed and a denied list) — the leg does not start. Fix the layer.`, "config.tool_face_control", "not_a_list");
|
|
155
152
|
}
|
|
153
|
+
const lists = {};
|
|
156
154
|
for (const side of ["allowed", "denied"]) {
|
|
157
155
|
const where = listWhere(side);
|
|
158
|
-
const
|
|
156
|
+
const value = side === "allowed" ? layer.allow : layer.deny;
|
|
157
|
+
const entries = readableToolNameList(where, side, value, "config.tool_face_control");
|
|
159
158
|
const written = recorded ? entries.find((read) => !isCanonicalToolName(read.entry)) : undefined;
|
|
160
159
|
if (written !== undefined) {
|
|
161
160
|
throw refused(`${where} declares ${renderListEntry(written.entry)} in its ${LIST_WORD[side]}: a row records each tool name in its bare spelling (\`Read\`, never \`Read()\`, \`Read(*)\` or \`Read(…)\`), and this entry was recorded by an engine that read the list otherwise — it is read here neither as that engine read it nor as this one would`, "config.tool_face_control", "unsupported_pattern");
|
|
162
161
|
}
|
|
162
|
+
if (value !== undefined && value !== null)
|
|
163
|
+
lists[side] = Object.freeze(entries.map((read) => read.entry));
|
|
163
164
|
}
|
|
165
|
+
return Object.freeze({ ...(lists.allowed !== undefined ? { allow: lists.allowed } : {}), deny: lists.denied ?? Object.freeze([]) });
|
|
166
|
+
}
|
|
167
|
+
export function ownListsWhereOf(ownBy) {
|
|
168
|
+
return ownBy !== undefined ? delegationListWhere(ownBy.toolName, ownBy.definition) : undefined;
|
|
169
|
+
}
|
|
170
|
+
export function readToolSelector(input) {
|
|
171
|
+
const layers = [...input.layers];
|
|
172
|
+
const ceilings = layers.length - 1;
|
|
173
|
+
const read = layers.map((layer, i) => {
|
|
174
|
+
const inherited = i === ceilings ? undefined : inheritedListsWhere(ceilings, i);
|
|
175
|
+
return readSelectorLayer(layer, inherited ?? "this run's own tool lists", (side) => inherited ?? input.where ?? (side === "allowed" ? "TaskSpec.allowTools" : "TaskSpec.excludeTools"), false);
|
|
176
|
+
});
|
|
177
|
+
return compileToolSelector(read, input.legs);
|
|
164
178
|
}
|
|
165
179
|
function ownToolListsFlaw(value) {
|
|
166
180
|
try {
|
|
@@ -258,14 +272,9 @@ export function judgeRunToolLists(input) {
|
|
|
258
272
|
catch {
|
|
259
273
|
}
|
|
260
274
|
};
|
|
261
|
-
const ownWhere =
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
const own = i === ceilings;
|
|
265
|
-
const inherited = own ? undefined : inheritedListsWhere(ceilings, i);
|
|
266
|
-
readSelectorLayer(layer, inherited ?? "this run's own tool lists", (side) => inherited ?? ownWhere ?? (side === "allowed" ? "TaskSpec.allowTools" : "TaskSpec.excludeTools"), false);
|
|
267
|
-
});
|
|
268
|
-
const denied = deniedProtocolTools(input.layers, input.legs);
|
|
275
|
+
const ownWhere = ownListsWhereOf(input.ownBy);
|
|
276
|
+
const selector = input.selector;
|
|
277
|
+
const denied = deniedProtocolTools(selector.layers, input.legs);
|
|
269
278
|
if (denied.length > 0) {
|
|
270
279
|
const names = [...new Set(denied.map((h) => `"${h.name}"`))];
|
|
271
280
|
const one = names.length === 1;
|
|
@@ -276,7 +285,6 @@ export function judgeRunToolLists(input) {
|
|
|
276
285
|
const by = [...deniedBy(true, ownWhere ?? "this run's own excludeTools"), ...deniedBy(false, "an inherited list (the spawning run's excludeTools, or one it inherits)")];
|
|
277
286
|
throw refused(`This kind of leg (${input.legs.join(", ")}) relies on ${names.join(", ")}, but ${by.join(" and ")} — the leg cannot work without ${one ? "it" : "them"}. Remove the entry from the list that names it.`, "config.tool_face_control", "protocol_denied");
|
|
278
287
|
}
|
|
279
|
-
const selector = compileToolSelector(input.layers, input.legs);
|
|
280
288
|
const pool = delegationPoolReading(spec.tools ?? [], valveLeaves(spec, selector));
|
|
281
289
|
const mounted = mountedToolNames([...tools, ...(spec.tools ?? [])]);
|
|
282
290
|
if (!input.judgedUpstream) {
|
|
@@ -58,6 +58,12 @@ export declare const SKILL_TOOL_NAME = "Skill";
|
|
|
58
58
|
* an oversized skill is excluded from the disclosure block and the tool, with an operator-visible config error. The compaction-time retention caps are a
|
|
59
59
|
* different door, deliberately. */
|
|
60
60
|
export declare const SKILL_CONTENT_MAX_CHARS: number;
|
|
61
|
+
/** The skills a leg LOADS — those the load gate above passes ({@link skillLoadReading}, the one predicate): the skills whose
|
|
62
|
+
* hooks the leg's mods admission takes, as the roster's filter (which also reports each one it excludes) takes the same. */
|
|
63
|
+
export declare function skillsThatLoad<T extends {
|
|
64
|
+
readonly content: string;
|
|
65
|
+
readonly baseDir?: unknown;
|
|
66
|
+
}>(skills: readonly T[] | undefined): T[];
|
|
61
67
|
/** Total per-invoke cap for a skill's inlined attachments (`SkillSpec.files`) — an ATTACHMENT-face budget, distinct from the (gone) body truncation door:
|
|
62
68
|
* the body is delivered untruncated at invoke time (CC parity), while attachments ride along bounded and truncation-disclosed. */
|
|
63
69
|
export declare const SKILL_ATTACHMENTS_MAX_CHARS = 50000;
|
|
@@ -4,7 +4,7 @@ import { sanitizeUntrustedText, SHELLED_BODY_ENVELOPE_TAGS } from "../untrusted-
|
|
|
4
4
|
import { SKILL_LISTING_DEFAULT_BUDGET, SKILL_LISTING_DESC_MAX_CHARS_DEFAULT } from "../skill-listing-budget.js";
|
|
5
5
|
import { readSkillTable, skillNamedBy } from "../skill-grant.js";
|
|
6
6
|
import { OUTPUT_TOOL_NAME, mountRuleFace, toolFace } from "../tool-catalog-entries.js";
|
|
7
|
-
import { substituteSkillRoot, substituteSkillRootBounded } from "./skill-base-dir.js";
|
|
7
|
+
import { skillLoadReading, substituteSkillRoot, substituteSkillRootBounded } from "./skill-base-dir.js";
|
|
8
8
|
import { readSkillsSeat } from "./skills-seat.js";
|
|
9
9
|
import { foldListingWithin } from "./listing-fold.js";
|
|
10
10
|
export const REPORT_BLOCKED_TOOL_NAME = "ReportBlocked";
|
|
@@ -90,6 +90,9 @@ export function createReportFindingsTool() {
|
|
|
90
90
|
}
|
|
91
91
|
export const SKILL_TOOL_NAME = "Skill";
|
|
92
92
|
export const SKILL_CONTENT_MAX_CHARS = 1024 * 1024;
|
|
93
|
+
export function skillsThatLoad(skills) {
|
|
94
|
+
return (skills ?? []).filter((s) => skillLoadReading(s, SKILL_CONTENT_MAX_CHARS).loads);
|
|
95
|
+
}
|
|
93
96
|
export const SKILL_ATTACHMENTS_MAX_CHARS = 50_000;
|
|
94
97
|
export const SKILL_ATTACHMENT_PATH_MAX_CHARS = 512;
|
|
95
98
|
const SKILL_FILES_LIST_MAX_CHARS = 200;
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
export declare const TEARDOWN_LEG_MAX_MS = 15000;
|
|
28
28
|
/** Test hook (fs-atomic TxnLockTimings precedent): shrink the budget so wedge pins need no real 15s. */
|
|
29
29
|
export declare function setTeardownLegBudgetForTests(ms: number | undefined): void;
|
|
30
|
+
export declare const teardownLegBudget: () => number;
|
|
30
31
|
/** The typed timeout incident — `leg` names the site so a leak is attributable from the report alone. */
|
|
31
32
|
export declare class TeardownLegTimeoutError extends Error {
|
|
32
33
|
readonly leg: string;
|
|
@@ -4,6 +4,7 @@ let teardownLegBudgetMs = TEARDOWN_LEG_MAX_MS;
|
|
|
4
4
|
export function setTeardownLegBudgetForTests(ms) {
|
|
5
5
|
teardownLegBudgetMs = ms ?? TEARDOWN_LEG_MAX_MS;
|
|
6
6
|
}
|
|
7
|
+
export const teardownLegBudget = () => teardownLegBudgetMs;
|
|
7
8
|
export class TeardownLegTimeoutError extends Error {
|
|
8
9
|
leg;
|
|
9
10
|
constructor(leg, budgetMs) {
|
|
@@ -64,20 +64,18 @@ export declare function buildDeferredRegistry(deferred: ReadonlySet<string>, too
|
|
|
64
64
|
* validation, not activation state: a call whose arguments validate against the REAL tool's
|
|
65
65
|
* declared schema runs the real tool directly (activation is only about whether the model has
|
|
66
66
|
* been SHOWN the schema, never an execution gate). Governance cannot be laundered through this
|
|
67
|
-
* lane:
|
|
68
|
-
*
|
|
69
|
-
*
|
|
67
|
+
* lane: the gate judges the call before any execute, and the call runs the one mounted instance its
|
|
68
|
+
* placeholder stands for — the harness resolves a call to its placeholder before the gate, as it
|
|
69
|
+
* resolves any call to its tool, so what runs is fixed before anything is judged.
|
|
70
70
|
*/
|
|
71
71
|
export interface PlaceholderDirectCall {
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* roster moved on. Returns `undefined` when the name no longer resolves — a withdrawn name has no
|
|
78
|
-
* direct lane, and the caller falls back to the teaching rejection.
|
|
73
|
+
* The mounted instance this placeholder stands for, bound when the placeholder is minted for it (one
|
|
74
|
+
* placeholder per instance; a refresh that replaces the instance mints a new placeholder for the new
|
|
75
|
+
* one). Never re-resolved by name: a call the gate judged while a refresh landed runs the instance it
|
|
76
|
+
* was resolved to, whose own checks answer a declaration that changed meanwhile.
|
|
79
77
|
*/
|
|
80
|
-
|
|
78
|
+
real: PlaceholderDirectTarget;
|
|
81
79
|
/**
|
|
82
80
|
* The scheduling declaration this placeholder carries while it stands in for the real
|
|
83
81
|
* tool. Mirrors the REAL tool's own `executionMode` (see the mirror rationale in
|
|
@@ -91,7 +89,7 @@ export interface PlaceholderDirectCall {
|
|
|
91
89
|
* schema it hands back actually lives (this result only, versus this result AND every later
|
|
92
90
|
* request's tools block). Absent ⇒ the swap posture.
|
|
93
91
|
*
|
|
94
|
-
* A FUNCTION, evaluated per call
|
|
92
|
+
* A FUNCTION, evaluated per call: the answer is not
|
|
95
93
|
* a prepare-time constant. The run-wide strategy is, but the per-tool exemption on top of it reads
|
|
96
94
|
* the LIVE roster — an MCP refresh can replace a tool with a declaration that no longer fits the
|
|
97
95
|
* result-text carrier (or one that now does), and a boolean captured when the placeholder was built
|
|
@@ -113,7 +111,7 @@ export interface PlaceholderDirectCall {
|
|
|
113
111
|
*/
|
|
114
112
|
activate: () => Promise<string | undefined>;
|
|
115
113
|
}
|
|
116
|
-
/** The
|
|
114
|
+
/** The real tool behind a placeholder (see {@link PlaceholderDirectCall.real}). */
|
|
117
115
|
export interface PlaceholderDirectTarget {
|
|
118
116
|
/** The REAL tool's declared parameter schema — the shape gate for a direct call. */
|
|
119
117
|
parameters: TSchema;
|
|
@@ -93,9 +93,7 @@ export function createPlaceholderTool(info, direct) {
|
|
|
93
93
|
parameters: EMPTY_PARAMS,
|
|
94
94
|
...(direct.executionMode !== undefined ? { executionMode: direct.executionMode } : {}),
|
|
95
95
|
execute: async (toolCallId, params, signal, onUpdate) => {
|
|
96
|
-
const real = direct
|
|
97
|
-
if (real === undefined)
|
|
98
|
-
return teachingRejection();
|
|
96
|
+
const { real } = direct;
|
|
99
97
|
if (Value.Check(real.parameters, params)) {
|
|
100
98
|
lastFailureShape = undefined;
|
|
101
99
|
repeats = 0;
|
|
@@ -95,7 +95,7 @@ export interface SettledOccurrence extends Pick<OccurrenceEnd, "notExecuted"> {
|
|
|
95
95
|
* The END projection — the ONE mint of `tool_end`, for every station that closes a call: the live loop's
|
|
96
96
|
* `tool_execution_end`, the resumed leg's resolution, an interrupted run's reconcile and the reconcile replayed at
|
|
97
97
|
* the next process start. It reads the occurrence and nothing else: `gate` is its latest gate record, `isError` is
|
|
98
|
-
* the tool's bit or the refusal that record names, and `notExecuted` rides on positive evidence only: the station's own or `
|
|
98
|
+
* the tool's bit or the refusal that record names, and `notExecuted` rides on positive evidence only: the station's own or `neverExecuted` (returned for the rows).
|
|
99
99
|
*
|
|
100
100
|
* A call whose start never went out on this stream (a call the loop never reached, a call announced by a dead
|
|
101
101
|
* process) gets its start minted here first, marked `recovered` and carrying the input the closing station holds —
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {} from "../../internal/harness.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { isPlainRecord } from "../mods/kernel/receive.js";
|
|
3
|
+
import { neverExecuted } from "./tool-not-executed.js";
|
|
4
4
|
import { MCP_DELIVERY_VERDICTS } from "../mcp-failure.js";
|
|
5
5
|
import { closeNeverExecuted } from "../session-reconcile.js";
|
|
6
6
|
import { TOOL_SEARCH_NAME } from "./tool-disclosure.js";
|
|
@@ -38,11 +38,12 @@ export function batchResponseDigest(result) {
|
|
|
38
38
|
export function toolEndBodyFrom(result, isError, leg, gate, gatedCallIdOfRun) {
|
|
39
39
|
const o = toolOutputFrom(result, leg.mediaByteCapBytes);
|
|
40
40
|
const st = leg.structured(result);
|
|
41
|
-
const det = isError ?
|
|
42
|
-
const
|
|
43
|
-
const
|
|
41
|
+
const det = isError ? result?.details : undefined;
|
|
42
|
+
const card = isPlainRecord(det) ? det : undefined;
|
|
43
|
+
const codeRaw = card?.code;
|
|
44
|
+
const kindRaw = card?.errorKind;
|
|
44
45
|
const code = typeof codeRaw === "string" ? codeRaw : typeof kindRaw === "string" ? kindRaw : undefined;
|
|
45
|
-
const deliveredRaw =
|
|
46
|
+
const deliveredRaw = card?.delivered;
|
|
46
47
|
const delivered = typeof deliveredRaw === "string" && MCP_DELIVERY_VERDICTS.includes(deliveredRaw) ? deliveredRaw : undefined;
|
|
47
48
|
const gatedCallId = code === "gate.parked" ? gatedCallIdOfRun : undefined;
|
|
48
49
|
return {
|
|
@@ -54,7 +55,7 @@ export function toolEndBodyFrom(result, isError, leg, gate, gatedCallIdOfRun) {
|
|
|
54
55
|
...(gate !== undefined ? { gate } : {}),
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
|
-
const startFrameOf = (o, recovered) => ({ type: "tool_start", toolCallId: o.toolCallId, toolName: o.spelledName, ...(o.label !== undefined ? { label: o.label } : {}), args: o.args, ...(recovered ? { recovered: true } : {}) });
|
|
58
|
+
const startFrameOf = (o, recovered) => ({ type: "tool_start", toolCallId: o.toolCallId, toolName: o.spelledName, ...(o.label !== undefined ? { label: o.label } : {}), args: o.args, ...(recovered ? { recovered: true } : {}), ...(o.requestedBy !== undefined ? { requestedBy: o.requestedBy } : {}) });
|
|
58
59
|
export function announceToolCall(table, start, frames) {
|
|
59
60
|
table.open(start);
|
|
60
61
|
frames.push(startFrameOf(start, false));
|
|
@@ -65,7 +66,7 @@ export function emitSettled(table, start, end, frames) {
|
|
|
65
66
|
if (!occ.startEmitted)
|
|
66
67
|
frames.push(startFrameOf(occ, true));
|
|
67
68
|
const gate = occ.gateRounds.at(-1);
|
|
68
|
-
const isError = end.isError || gate?.disposition.kind === "denied", notExecuted = end.notExecuted === true ||
|
|
69
|
+
const isError = end.isError || gate?.disposition.kind === "denied", notExecuted = end.notExecuted === true || neverExecuted(occ);
|
|
69
70
|
table.close(occ.toolCallId, end.interrupted === true ? "interrupted" : "settled");
|
|
70
71
|
frames.push({
|
|
71
72
|
type: "tool_end",
|
|
@@ -75,7 +76,7 @@ export function emitSettled(table, start, end, frames) {
|
|
|
75
76
|
isError,
|
|
76
77
|
...toolEndBodyFrom(end.result, isError, frames, gate, end.gatedCallIdOfRun),
|
|
77
78
|
...(gate?.disposition.kind === "denied" && occ.wireName !== undefined ? { wireName: occ.wireName } : {}),
|
|
78
|
-
...(notExecuted ? { notExecuted: true } : {}),
|
|
79
|
+
...(notExecuted ? { notExecuted: true } : {}), ...(occ.answeredInPlaceBy !== undefined ? { answeredBy: occ.answeredInPlaceBy } : {}), ...(occ.requestedBy !== undefined ? { requestedBy: occ.requestedBy } : {}),
|
|
79
80
|
});
|
|
80
81
|
return { ...(gate !== undefined ? { gate } : {}), isError, ...(notExecuted ? { notExecuted: true } : {}) };
|
|
81
82
|
}
|
|
@@ -4,9 +4,14 @@ import type { ToolOccurrence } from "./tool-occurrence.js";
|
|
|
4
4
|
* release, by a station inside the execution, is not). A call whose start this stream never carried (a recovered
|
|
5
5
|
* one, closed by a station that knows only its own class) is not read here. */
|
|
6
6
|
export declare function refusedBeforeRelease(occ: Pick<ToolOccurrence, "life" | "gateRounds" | "startEmitted">): boolean;
|
|
7
|
+
/** The one reading of the engine's positive evidence that a call never ran: refused before it was let go
|
|
8
|
+
* ({@link refusedBeforeRelease}), or answered in place of its body by an extension at `tool.call` (the body was never called). */
|
|
9
|
+
export declare function neverExecuted(occ: Pick<ToolOccurrence, "life" | "gateRounds" | "startEmitted" | "answeredInPlaceBy">): boolean;
|
|
7
10
|
/** `details` as a persisted `toolResult` row carries it: `notExecuted` is the ENGINE's key — the settlement's fact when it holds,
|
|
8
11
|
* absent otherwise, whatever a tool wrote under that name. Returns `details` itself unless the key has to move; never mutates it. */
|
|
9
12
|
export declare function rowDetailsOf(details: unknown, notExecuted: boolean): unknown;
|
|
13
|
+
/** The persisted row's mark: the call this `toolResult` row closes never ran (the key {@link rowDetailsOf} writes). */
|
|
14
|
+
export declare function rowNotExecuted(details: unknown): boolean;
|
|
10
15
|
/** A row the resumed leg mints (`toolResultMsg`) with the settlement's fact on it. */
|
|
11
16
|
export declare function withRowNotExecuted<T extends object>(row: T, notExecuted: boolean): T;
|
|
12
17
|
/** Write the end projection's one `notExecuted` onto the result the live loop persists as the call's row: the loop builds that message
|
|
@@ -2,6 +2,9 @@ import { readOwnMembers } from "../thrown-value.js";
|
|
|
2
2
|
export function refusedBeforeRelease(occ) {
|
|
3
3
|
return occ.life === "announced" && occ.startEmitted && occ.gateRounds.at(-1)?.disposition.kind === "denied";
|
|
4
4
|
}
|
|
5
|
+
export function neverExecuted(occ) {
|
|
6
|
+
return refusedBeforeRelease(occ) || occ.answeredInPlaceBy !== undefined;
|
|
7
|
+
}
|
|
5
8
|
export function rowDetailsOf(details, notExecuted) {
|
|
6
9
|
const carries = (() => { try {
|
|
7
10
|
return details !== null && typeof details === "object" && !Array.isArray(details) && Object.keys(details).includes("notExecuted");
|
|
@@ -18,6 +21,14 @@ export function rowDetailsOf(details, notExecuted) {
|
|
|
18
21
|
delete bag["notExecuted"];
|
|
19
22
|
return bag;
|
|
20
23
|
}
|
|
24
|
+
export function rowNotExecuted(details) {
|
|
25
|
+
try {
|
|
26
|
+
return details !== null && typeof details === "object" && details.notExecuted === true;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
21
32
|
export function withRowNotExecuted(row, notExecuted) {
|
|
22
33
|
return notExecuted ? { ...row, details: rowDetailsOf(undefined, true) } : row;
|
|
23
34
|
}
|
|
@@ -42,6 +42,8 @@ export interface OccurrenceStart {
|
|
|
42
42
|
readonly label?: string;
|
|
43
43
|
/** The arguments the start frame carries (for a recovered start: the call's own input as the transcript holds it). */
|
|
44
44
|
readonly args: unknown;
|
|
45
|
+
/** An extension's own call (`$.tool.call`): who asked for it — the frames carry it. Absent for a call a model message carried. */
|
|
46
|
+
readonly requestedBy?: import("../task-event.js").ExtensionRequester;
|
|
45
47
|
}
|
|
46
48
|
/** The record, as its readers see it. Written only through {@link ToolOccurrenceTable}. */
|
|
47
49
|
export interface ToolOccurrence extends OccurrenceStart {
|
|
@@ -63,6 +65,9 @@ export interface ToolOccurrence extends OccurrenceStart {
|
|
|
63
65
|
/** The heartbeat covers it. Cleared when the loop leaves the call behind at a turn end with no end of its own:
|
|
64
66
|
* the record stays (a later settlement must still know its start frame went out) but no beat describes it. */
|
|
65
67
|
readonly beating: boolean;
|
|
68
|
+
/** An extension at `tool.call` answered for the call in place of its body — its result, or its refusal — and named here:
|
|
69
|
+
* the body was never called (positive evidence the call did not run). Absent: no station answered in its place. */
|
|
70
|
+
readonly answeredInPlaceBy?: string;
|
|
66
71
|
}
|
|
67
72
|
/** The table of one leg's occurrences — the record's only writer. */
|
|
68
73
|
export interface ToolOccurrenceTable {
|
|
@@ -86,6 +91,9 @@ export interface ToolOccurrenceTable {
|
|
|
86
91
|
/** A station after the gate refused the call: one more gate record, minted as a veto of whatever the latest one
|
|
87
92
|
* settled (a person's yes stays on the settlement; the refusing layer is the disposition). Returns the record. */
|
|
88
93
|
refuse(toolCallId: string, layer: DeniedBy): GateOutcome;
|
|
94
|
+
/** An extension at `tool.call` answered for the call before its body was called (the kernel's record says the body had
|
|
95
|
+
* not started): the body is never called for this attempt. Once per attempt; a second is an engine defect. */
|
|
96
|
+
answeredInPlace(toolCallId: string, by: string): void;
|
|
89
97
|
/** An ask for this call is put to the person: the count rises, and the returned `resumeFromUser` lowers it once
|
|
90
98
|
* (a second call is a no-op). The pair is bound to THIS attempt — a return after the call ended, or after a
|
|
91
99
|
* reused id re-opened, touches nothing — and an ask for a call this leg does not hold counts nothing: the wait
|
|
@@ -21,6 +21,7 @@ export function createToolOccurrenceTable() {
|
|
|
21
21
|
...(start.wireName !== undefined ? { wireName: start.wireName } : {}),
|
|
22
22
|
...(start.label !== undefined ? { label: start.label } : {}),
|
|
23
23
|
args: start.args,
|
|
24
|
+
...(start.requestedBy !== undefined ? { requestedBy: start.requestedBy } : {}),
|
|
24
25
|
attempt,
|
|
25
26
|
life: "announced",
|
|
26
27
|
awaitingUser: 0,
|
|
@@ -96,6 +97,12 @@ export function createToolOccurrenceTable() {
|
|
|
96
97
|
occ.gateRounds.push(round);
|
|
97
98
|
return round;
|
|
98
99
|
},
|
|
100
|
+
answeredInPlace(toolCallId, by) {
|
|
101
|
+
const occ = held(toolCallId, "an answer in place of the body");
|
|
102
|
+
if (occ.answeredInPlaceBy !== undefined)
|
|
103
|
+
throw new Error(`tool occurrence: call "${toolCallId}" (attempt ${occ.attempt}) was already answered in place`);
|
|
104
|
+
occ.answeredInPlaceBy = by;
|
|
105
|
+
},
|
|
99
106
|
heard(toolCallId) {
|
|
100
107
|
const occ = byId.get(toolCallId);
|
|
101
108
|
if (occ !== undefined)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { McpDroppedTool } from "../mcp.js";
|
|
2
|
+
import type { AnnouncedMcpFailure } from "../../internal/harness.js";
|
|
2
3
|
import type { McpInstructionsEntry } from "../prompt-section-seat.js";
|
|
3
4
|
import type { TaskSpec } from "../types.js";
|
|
4
5
|
import { type SkillListingEntry, type SkillsBlockRender } from "./synthetic-tools.js";
|
|
@@ -75,7 +76,7 @@ export declare const CHANGED_FILES_MTIME_EPS_MS = 2000;
|
|
|
75
76
|
/** Per-boundary byte cap over the bundle's CLIPPABLE frames (weak-model context economics). Intact-class
|
|
76
77
|
* frames ride outside it — see {@link ATTACHMENT_DELIVERY_CLASS}. */
|
|
77
78
|
export declare const ATTACHMENT_BYTE_CAP: number;
|
|
78
|
-
export type AttachmentSource = "todo_reminder" | "task_reminder" | "tool_search_usage_reminder" | "changed_files" | "output_style" | "date_change" | "instructions_change" | "workflow_size_guideline_change" | "budget_usd" | "total_tokens_reminder" | "background_tasks" | "tools_delta" | "agent_listing" | "skills_listing" | "mcp_instructions" | "mcp_dropped_tools";
|
|
79
|
+
export type AttachmentSource = "todo_reminder" | "task_reminder" | "tool_search_usage_reminder" | "changed_files" | "output_style" | "date_change" | "instructions_change" | "workflow_size_guideline_change" | "budget_usd" | "total_tokens_reminder" | "background_tasks" | "tools_delta" | "mcp_unavailable" | "agent_listing" | "skills_listing" | "mcp_instructions" | "mcp_dropped_tools";
|
|
79
80
|
/** How the bundle cap treats a source — see {@link ATTACHMENT_DELIVERY_CLASS}. */
|
|
80
81
|
export type AttachmentDeliveryClass = {
|
|
81
82
|
readonly class: "clippable";
|
|
@@ -125,6 +126,10 @@ export declare const ATTACHMENT_DELIVERY_CLASS: {
|
|
|
125
126
|
readonly class: "intact";
|
|
126
127
|
readonly bound: (inp: AttachmentInputs) => number;
|
|
127
128
|
};
|
|
129
|
+
readonly mcp_unavailable: {
|
|
130
|
+
readonly class: "intact";
|
|
131
|
+
readonly bound: () => number;
|
|
132
|
+
};
|
|
128
133
|
readonly agent_listing: {
|
|
129
134
|
readonly class: "intact";
|
|
130
135
|
readonly bound: (inp: AttachmentInputs) => number;
|
|
@@ -548,7 +553,7 @@ export interface AttachmentInputs {
|
|
|
548
553
|
path: string;
|
|
549
554
|
mtimeMs: number;
|
|
550
555
|
}>;
|
|
551
|
-
/** G1 backgroundTasks:
|
|
556
|
+
/** G1 backgroundTasks: the leg's live background tasks, every one (`Prepared.listBackgroundTasks`); the renderer caps the list.
|
|
552
557
|
* Only fetched when opted in AND `state.postCompactPending` — OFF means zero registry reads. */
|
|
553
558
|
backgroundTasks?: ReadonlyArray<BackgroundTaskSnapshot>;
|
|
554
559
|
/** G1 toolsDelta: deferred tools MATERIALIZED since the last announcement (prepare-task's
|
|
@@ -565,7 +570,7 @@ export interface AttachmentInputs {
|
|
|
565
570
|
newToolsSwappedUnderStatic?: readonly string[];
|
|
566
571
|
/** The same fact for the READDED arm. See {@link renderToolsDelta}. */
|
|
567
572
|
readdedToolsSwappedUnderStatic?: readonly string[];
|
|
568
|
-
/** The MCP-driven arms of the SAME tools_delta frame (removed / readded
|
|
573
|
+
/** The MCP-driven arms of the SAME tools_delta frame (removed / readded).
|
|
569
574
|
* Same pre-diffed input + CALLER-owned intact-survival consumption discipline as `newTools`; only
|
|
570
575
|
* passed when `config.toolsDelta` is opted in. See {@link McpToolsDeltaFacts} for reachability. */
|
|
571
576
|
mcpToolsDelta?: McpToolsDeltaFacts;
|
|
@@ -740,14 +745,30 @@ export interface McpToolsDeltaFacts {
|
|
|
740
745
|
removed?: readonly string[];
|
|
741
746
|
/** Previously-announced-then-withdrawn deferred tools that came BACK. */
|
|
742
747
|
readded?: readonly string[];
|
|
743
|
-
/** Declared MCP servers that failed to connect at materialize (`MaterializedMcp.statuses`, status
|
|
744
|
-
* `"failed"`). `error` is REMOTE/transport text — the producer neutralizes + bounds it at intake.
|
|
745
|
-
* */
|
|
746
|
-
failedServers?: ReadonlyArray<{
|
|
747
|
-
name: string;
|
|
748
|
-
error?: string;
|
|
749
|
-
}>;
|
|
750
748
|
}
|
|
749
|
+
/**
|
|
750
|
+
* The `mcp_unavailable` frame — the declared MCP servers that did not connect for this message, each the once-per-session ledger's
|
|
751
|
+
* pair (`name` and the REMOTE `error` text, neutralized and bounded at intake). The reference's failed-servers arm
|
|
752
|
+
* (cli296.js:250575) "configured but failed to connect", with its duration clause made true of this engine: a server that stays declared is tried again by the
|
|
753
|
+
* next run that prepares, so it is unavailable "for now", not "for this session", and whether it connects then depends on the error.
|
|
754
|
+
*/
|
|
755
|
+
export declare function renderMcpUnavailable(failed: ReadonlyArray<AnnouncedMcpFailure>): string | undefined;
|
|
756
|
+
/** Whether the `mcp_unavailable` lane is on for a task's attachments config — the one reading, asked by the config door (so a switch
|
|
757
|
+
* nobody can read refuses the task before any resource is acquired) and by the leg's first request: absent is the registry's
|
|
758
|
+
* default, a boolean is itself (an explicit `true` is not vetoed by a registry flip), anything else is refused by name
|
|
759
|
+
* (`config.invalid_argument`, `detail.field`), never read as either state. */
|
|
760
|
+
export declare function mcpUnavailableOn(cfg: TaskSpec["attachments"] | null): boolean;
|
|
761
|
+
/** The `mcp_unavailable` frame a leg's first request owes — a fresh leg's first message or a resumed leg's continuation, the one
|
|
762
|
+
* request every leg makes — or undefined (the lane is off, or nothing is pending). `entries` is what the frame names; the
|
|
763
|
+
* carrying message's receipt settles exactly those. */
|
|
764
|
+
export declare function owedMcpUnavailable(prepared: {
|
|
765
|
+
readonly mcpUnavailable?: {
|
|
766
|
+
pending: AnnouncedMcpFailure[];
|
|
767
|
+
};
|
|
768
|
+
}, cfg: TaskSpec["attachments"] | null): {
|
|
769
|
+
body: string;
|
|
770
|
+
entries: AnnouncedMcpFailure[];
|
|
771
|
+
} | undefined;
|
|
751
772
|
/**
|
|
752
773
|
* G1 — deferred-tool materialization announce (boundary notice). The reference's template (cli296.js:128211): "The following deferred tools are now available via", in full:
|
|
753
774
|
* "The following deferred
|
|
@@ -766,15 +787,12 @@ export interface McpToolsDeltaFacts {
|
|
|
766
787
|
* listing back, so a withdrawn tool genuinely leaves (and a re-advertised one genuinely returns)
|
|
767
788
|
* the roster mid-task. CC's trailing "Load via ToolSearch as before" / "Do not search for them —
|
|
768
789
|
* ToolSearch will return no match" clauses are kept, because sema mounts the SAME ToolSearch name.
|
|
769
|
-
*
|
|
770
|
-
* connect skip). CC additionally splits a MANAGED-POLICY sub-arm off this list (`jlr`/`Oy_` error
|
|
771
|
-
* codes @626575) — sema has no managed-policy error taxonomy, so only the connection-failure form
|
|
772
|
-
* is rendered.
|
|
790
|
+
* The reference's `failed` arm is its own frame here ({@link renderMcpUnavailable}): it must reach the leg's first request.
|
|
773
791
|
* DELIBERATELY ABSENT (state unreachable — announcing them would be a §25 honesty breach):
|
|
774
792
|
* - `needs-auth` (@626543): sema's MCP auth surface is STATIC deployment-supplied headers
|
|
775
793
|
* (`McpServerSpec.transport.headers` / `principalHeader`) with no OAuth flow and no
|
|
776
794
|
* authorization-required status — an auth rejection surfaces as an ordinary connect failure and is
|
|
777
|
-
* covered by the `
|
|
795
|
+
* covered by the `mcp_unavailable` frame.
|
|
778
796
|
* - `pending`: `materializeMcpTools` is fully AWAITED inside prepareTask (one
|
|
779
797
|
* `Promise.allSettled` over every server) before the run loop's first turn, so "still connecting"
|
|
780
798
|
* does not exist at any turn boundary — `McpServerStatus.status` is `connected | failed` only.
|