@sema-agent/core 7.54.1 → 7.56.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 +950 -0
- package/dist/agents/agent-transcript-tool.js +2 -1
- package/dist/agents/builtin-agents.d.ts +12 -14
- package/dist/agents/cascade.js +1 -1
- package/dist/agents/cc-peer-directory.d.ts +36 -0
- package/dist/agents/cc-peer-directory.js +139 -0
- package/dist/agents/cc-peer-wire.d.ts +105 -0
- package/dist/agents/cc-peer-wire.js +98 -0
- package/dist/agents/cc-uds-peer-channel.d.ts +40 -0
- package/dist/agents/cc-uds-peer-channel.js +457 -0
- package/dist/agents/child-model-seat.d.ts +0 -11
- package/dist/agents/child-model-seat.js +0 -3
- package/dist/agents/cross-session-envelope.d.ts +4 -1
- package/dist/agents/cross-session-envelope.js +8 -1
- package/dist/agents/cross-session-judge.d.ts +2 -2
- package/dist/agents/list-agents-tool.d.ts +3 -1
- package/dist/agents/list-agents-tool.js +9 -8
- package/dist/agents/observer.d.ts +4 -5
- package/dist/agents/observer.js +2 -1
- package/dist/agents/peer-admission.d.ts +6 -0
- package/dist/agents/peer-admission.js +4 -1
- package/dist/agents/peer-directory.d.ts +65 -13
- package/dist/agents/peer-directory.js +90 -25
- package/dist/agents/peer-notices.d.ts +1 -1
- package/dist/agents/peer-session-drain.d.ts +3 -1
- package/dist/agents/peer-session-drain.js +3 -2
- package/dist/agents/read-inbox-tool.js +2 -1
- package/dist/agents/repair-loop.js +2 -2
- package/dist/agents/retain-ledger.d.ts +1 -1
- package/dist/agents/roster-store.d.ts +1 -1
- package/dist/agents/send-message-tool.d.ts +10 -0
- package/dist/agents/send-message-tool.js +37 -8
- package/dist/agents/subagent.d.ts +39 -82
- package/dist/agents/subagent.js +109 -106
- package/dist/agents/tool-filter.d.ts +31 -46
- package/dist/agents/tool-filter.js +13 -33
- package/dist/agents/verify.d.ts +6 -5
- package/dist/agents/verify.js +3 -3
- package/dist/brain/anthropic.js +43 -81
- package/dist/brain/errors.d.ts +15 -0
- package/dist/brain/errors.js +10 -0
- 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 +6 -12
- package/dist/brain/model-presets.js +1 -6
- package/dist/brain/open-responses.js +27 -35
- package/dist/brain/openai.js +30 -98
- package/dist/brain/provider-dialect.d.ts +39 -3
- package/dist/brain/provider-dialect.js +28 -0
- package/dist/brain/reasoning-request.d.ts +96 -0
- package/dist/brain/reasoning-request.js +174 -0
- package/dist/brain/reasoning.d.ts +12 -12
- package/dist/brain/reasoning.js +4 -3
- package/dist/brain/request-params.d.ts +62 -9
- package/dist/brain/request-params.js +42 -7
- package/dist/brain/retry.d.ts +1 -1
- package/dist/brain/route-adjudicator.d.ts +15 -0
- package/dist/brain/route-adjudicator.js +15 -0
- package/dist/brain/status-sink.d.ts +20 -0
- package/dist/brain/status-sink.js +7 -0
- package/dist/brain/stream-engine.js +6 -5
- package/dist/brain/stream-shared.d.ts +1 -1
- package/dist/core/a2a.d.ts +2 -1
- package/dist/core/a2a.js +19 -13
- package/dist/core/advisor-verdict.d.ts +120 -0
- package/dist/core/advisor-verdict.js +92 -0
- package/dist/core/agent-definition.d.ts +17 -8
- package/dist/core/allow-entry.d.ts +69 -36
- package/dist/core/allow-entry.js +81 -52
- package/dist/core/allow-rule-shadow.d.ts +10 -3
- package/dist/core/approval-object.d.ts +2 -1
- package/dist/core/approval-object.js +6 -6
- package/dist/core/ask-origin.d.ts +127 -29
- package/dist/core/ask-origin.js +87 -25
- package/dist/core/ask-question.d.ts +51 -8
- package/dist/core/ask-question.js +12 -7
- 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 +11 -8
- package/dist/core/auto-compaction.js +4 -2
- package/dist/core/auto-mode-arming.d.ts +2 -2
- package/dist/core/auto-mode-defaults.d.ts +8 -8
- package/dist/core/auto-mode-prompt-assets.d.ts +3 -3
- package/dist/core/auto-mode-prompt.d.ts +1 -1
- package/dist/core/auto-mode.d.ts +17 -9
- package/dist/core/auto-mode.js +9 -6
- package/dist/core/background-agent-store.d.ts +3 -3
- package/dist/core/canonical-json.d.ts +1 -1
- package/dist/core/canonical-json.js +2 -2
- 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 -4
- package/dist/core/checkpoint-requirements.js +8 -14
- package/dist/core/checkpoint-store.d.ts +165 -72
- package/dist/core/checkpoint-store.js +79 -82
- package/dist/core/child-clamp-seats.d.ts +6 -0
- package/dist/core/child-clamp-seats.js +3 -16
- package/dist/core/compliance.d.ts +2 -2
- package/dist/core/context-edit.d.ts +6 -7
- package/dist/core/cross-boundary-taint.d.ts +11 -4
- package/dist/core/cross-boundary-taint.js +3 -3
- package/dist/core/decision-receipt.d.ts +37 -3
- package/dist/core/decision-receipt.js +19 -19
- package/dist/core/delegation-not-started.d.ts +6 -0
- package/dist/core/delegation-not-started.js +17 -0
- package/dist/core/effective-path-target.d.ts +1 -1
- 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 +45 -12
- package/dist/core/exec-output-tail.d.ts +1 -1
- package/dist/core/file-history-retention.d.ts +1 -1
- package/dist/core/file-history-store.d.ts +147 -21
- package/dist/core/file-history-store.js +58 -32
- package/dist/core/gate-fold.d.ts +1 -1
- package/dist/core/gate-fold.js +24 -11
- package/dist/core/gate-lanes.js +81 -68
- package/dist/core/gate-outcome.d.ts +40 -6
- package/dist/core/gate-outcome.js +56 -0
- package/dist/core/governance-codes.d.ts +17 -3
- package/dist/core/governance-codes.js +16 -0
- package/dist/core/hands-band.d.ts +1 -1
- package/dist/core/hooks.d.ts +21 -20
- 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 +84 -0
- package/dist/core/host-target.js +92 -0
- package/dist/core/image-downsample.d.ts +1 -1
- package/dist/core/lsp-diagnostics.d.ts +4 -4
- package/dist/core/lsp.d.ts +3 -3
- package/dist/core/mailbox-store.d.ts +4 -0
- package/dist/core/mcp-connection-pool.d.ts +18 -2
- package/dist/core/mcp-connection-pool.js +53 -6
- package/dist/core/mcp-failure.d.ts +23 -4
- package/dist/core/mcp-failure.js +26 -11
- package/dist/core/mcp-listing-drift.d.ts +10 -0
- package/dist/core/mcp-listing-drift.js +6 -0
- package/dist/core/mcp-server-link.d.ts +173 -0
- package/dist/core/mcp-server-link.js +127 -0
- package/dist/core/mcp-server-spec.d.ts +4 -2
- package/dist/core/mcp-session-end.d.ts +26 -0
- package/dist/core/mcp-session-end.js +29 -0
- package/dist/core/mcp-startup-request.d.ts +17 -0
- package/dist/core/mcp-startup-request.js +17 -0
- package/dist/core/mcp.d.ts +17 -13
- package/dist/core/mcp.js +240 -189
- package/dist/core/media-byte-cap.d.ts +1 -1
- package/dist/core/memory-engine/delegation-settlement.js +15 -24
- package/dist/core/memory-engine/engine.d.ts +9 -9
- 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 +65 -6
- package/dist/core/memory-engine/provenance-wording.d.ts +1 -1
- package/dist/core/memory-engine/tools.js +4 -1
- package/dist/core/mode-policy.d.ts +1 -1
- 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 +44 -24
- package/dist/core/namespaced-rule-name.js +50 -43
- package/dist/core/output-style.d.ts +1 -1
- package/dist/core/param-rule-reach.d.ts +15 -0
- package/dist/core/param-rule-reach.js +30 -0
- package/dist/core/parent-spec-seat.d.ts +13 -1
- package/dist/core/parent-spec-seat.js +6 -0
- package/dist/core/park-selfcheck.js +1 -0
- package/dist/core/pause-registry.d.ts +16 -5
- package/dist/core/pause-registry.js +6 -2
- package/dist/core/peer-channel.d.ts +70 -0
- package/dist/core/peer-channel.js +1 -0
- package/dist/core/permission-rule-consent.d.ts +30 -5
- package/dist/core/permission-rule-consent.js +147 -50
- package/dist/core/permission-rule-model.d.ts +245 -65
- package/dist/core/permission-rule-model.js +421 -107
- package/dist/core/permission-rule-org.d.ts +6 -2
- package/dist/core/permission-rule-org.js +7 -3
- package/dist/core/permission-rule-provider.d.ts +6 -2
- package/dist/core/permission-rule-provider.js +41 -11
- package/dist/core/permission-rule-store.d.ts +22 -26
- package/dist/core/permission-rule-store.js +12 -6
- package/dist/core/permission-rule-sync.d.ts +11 -2
- package/dist/core/permission-rule-sync.js +11 -3
- 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 +53 -15
- package/dist/core/permission-rules.js +125 -100
- package/dist/core/persisted-rule-arms.d.ts +6 -4
- package/dist/core/persisted-rule-arms.js +10 -12
- package/dist/core/present-plan-tool.js +3 -1
- 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 +26 -5
- package/dist/core/protocol-http-auth.js +137 -4
- package/dist/core/protocol-naming.d.ts +2 -2
- package/dist/core/read-only-shell-table.d.ts +1 -1
- package/dist/core/read-only-shell.d.ts +1 -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 +34 -3
- package/dist/core/roles.js +66 -53
- package/dist/core/rule-lane-reads.d.ts +20 -15
- package/dist/core/rule-lane-reads.js +45 -17
- package/dist/core/rule-offer-read.d.ts +53 -0
- package/dist/core/rule-offer-read.js +146 -0
- package/dist/core/rule-owner.d.ts +46 -0
- package/dist/core/rule-owner.js +29 -0
- package/dist/core/runner/advisor-instructions.d.ts +70 -0
- package/dist/core/runner/advisor-instructions.js +61 -0
- package/dist/core/runner/advisor-tool.d.ts +33 -0
- package/dist/core/runner/advisor-tool.js +112 -0
- package/dist/core/runner/announce-once-ledger.d.ts +18 -26
- package/dist/core/runner/announce-once-ledger.js +19 -46
- package/dist/core/runner/approval-feedback.js +6 -3
- package/dist/core/runner/assemble-result.d.ts +2 -1
- 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 +21 -2
- package/dist/core/runner/caller-roster.js +38 -0
- 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 +33 -13
- package/dist/core/runner/classifier-ladder.js +15 -14
- package/dist/core/runner/compaction-restate.d.ts +10 -6
- package/dist/core/runner/compaction-restate.js +9 -3
- package/dist/core/runner/construction-doors.js +3 -0
- package/dist/core/runner/contracts.d.ts +40 -33
- package/dist/core/runner/conversation-segment.d.ts +28 -0
- package/dist/core/runner/conversation-segment.js +42 -0
- package/dist/core/runner/cross-boundary-lane.d.ts +21 -16
- package/dist/core/runner/cross-boundary-lane.js +58 -34
- package/dist/core/runner/decide-continuation.d.ts +7 -4
- package/dist/core/runner/decide-continuation.js +2 -2
- package/dist/core/runner/denial-limit-arms.d.ts +4 -4
- package/dist/core/runner/denial-limit-arms.js +1 -1
- package/dist/core/runner/derived-route-fallback.d.ts +24 -24
- package/dist/core/runner/derived-route-fallback.js +9 -7
- 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 +9 -3
- package/dist/core/runner/gate-exit.js +11 -5
- package/dist/core/runner/image.d.ts +7 -17
- package/dist/core/runner/image.js +9 -60
- package/dist/core/runner/initial-run-state.js +1 -1
- package/dist/core/runner/permission-rule-lanes.d.ts +6 -6
- package/dist/core/runner/permission-rule-lanes.js +38 -15
- package/dist/core/runner/person-path-rows.d.ts +12 -9
- package/dist/core/runner/person-path-rows.js +19 -8
- package/dist/core/runner/prepare-advisor.d.ts +63 -0
- package/dist/core/runner/prepare-advisor.js +77 -0
- 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 +5 -4
- package/dist/core/runner/prepare-config-doors.d.ts +31 -38
- package/dist/core/runner/prepare-config-doors.js +57 -34
- 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-delegation-surface.d.ts +2 -2
- package/dist/core/runner/prepare-delegation-surface.js +1 -1
- package/dist/core/runner/prepare-file-history.d.ts +48 -8
- package/dist/core/runner/prepare-file-history.js +41 -73
- package/dist/core/runner/prepare-gate-stations.d.ts +2 -5
- package/dist/core/runner/prepare-gate-stations.js +12 -8
- package/dist/core/runner/prepare-hands-readface.d.ts +2 -8
- package/dist/core/runner/prepare-hands-readface.js +15 -14
- package/dist/core/runner/prepare-inherited-gate.d.ts +11 -7
- package/dist/core/runner/prepare-inherited-gate.js +8 -6
- package/dist/core/runner/prepare-memory-engine-session.js +1 -1
- package/dist/core/runner/prepare-park-ask.js +12 -12
- package/dist/core/runner/prepare-policy-chain.d.ts +7 -4
- package/dist/core/runner/prepare-policy-chain.js +68 -81
- package/dist/core/runner/prepare-project-context.d.ts +5 -2
- package/dist/core/runner/prepare-project-context.js +6 -3
- 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 +4 -6
- package/dist/core/runner/prepare-protocol-tools.d.ts +4 -2
- package/dist/core/runner/prepare-protocol-tools.js +5 -4
- package/dist/core/runner/prepare-safety-scan.d.ts +9 -12
- package/dist/core/runner/prepare-safety-scan.js +8 -23
- 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 +1 -1
- package/dist/core/runner/prepare-task.js +41 -35
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +7 -4
- package/dist/core/runner/prepare-tool-disclosure-mount.js +24 -18
- 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 +11 -4
- 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/resume-policy-outcome.js +1 -1
- package/dist/core/runner/retired-runner-deps.js +2 -1
- package/dist/core/runner/rewind-files.d.ts +15 -0
- package/dist/core/runner/rewind-files.js +132 -0
- package/dist/core/runner/run-attachment-seats.js +2 -2
- 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-compaction-machinery.d.ts +1 -1
- package/dist/core/runner/run-compaction-machinery.js +2 -12
- package/dist/core/runner/run-git-lane.d.ts +1 -0
- package/dist/core/runner/run-harness-handlers.js +14 -7
- package/dist/core/runner/run-leg.d.ts +1 -1
- package/dist/core/runner/run-leg.js +43 -18
- package/dist/core/runner/run-settle-and-teardown.js +3 -2
- package/dist/core/runner/run-telemetry-and-budget-seats.js +1 -1
- package/dist/core/runner/run-turn-boundary.d.ts +1 -0
- package/dist/core/runner/run-turn-boundary.js +15 -22
- package/dist/core/runner/runtask.d.ts +3 -0
- package/dist/core/runner/runtask.js +8 -9
- 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.d.ts +22 -21
- package/dist/core/runner/session-rule-policy.js +17 -31
- 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/side-call-account.d.ts +32 -8
- package/dist/core/runner/side-call-account.js +23 -1
- package/dist/core/runner/skills-seat.js +6 -2
- package/dist/core/runner/stream-settle-backstop.js +1 -1
- package/dist/core/runner/strict-output-schema.d.ts +1 -1
- package/dist/core/runner/sub-agent-deny-lists.js +4 -6
- package/dist/core/runner/synthetic-tools.d.ts +16 -13
- package/dist/core/runner/synthetic-tools.js +8 -3
- package/dist/core/runner/tool-disclosure.d.ts +10 -12
- package/dist/core/runner/tool-disclosure.js +3 -4
- 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-face-overlay.d.ts +2 -1
- package/dist/core/runner/tool-face-overlay.js +17 -1
- 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/tool-progress-lane.d.ts +2 -2
- package/dist/core/runner/tool-turn-repair-seat.d.ts +3 -2
- package/dist/core/runner/turn-attachments.d.ts +91 -80
- package/dist/core/runner/turn-attachments.js +62 -37
- package/dist/core/runner-deps.d.ts +42 -42
- package/dist/core/runtime-caps.d.ts +4 -4
- 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 +26 -2
- package/dist/core/same-plain-value.d.ts +40 -0
- package/dist/core/same-plain-value.js +49 -0
- package/dist/core/scheduler.d.ts +1 -1
- package/dist/core/secret-env.d.ts +26 -3
- package/dist/core/secret-env.js +44 -8
- package/dist/core/select-model.js +3 -3
- package/dist/core/sensitive-path-policy.d.ts +1 -1
- package/dist/core/sensitive-path-policy.js +1 -1
- package/dist/core/session-policy-store.d.ts +102 -35
- package/dist/core/session-policy-store.js +210 -48
- package/dist/core/session-reconcile.d.ts +2 -2
- package/dist/core/session-store.d.ts +106 -37
- package/dist/core/session-store.js +165 -91
- package/dist/core/session.d.ts +101 -57
- package/dist/core/session.js +53 -0
- package/dist/core/shared-memory/tools.js +3 -1
- package/dist/core/shared-memory/types.d.ts +1 -1
- 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.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.d.ts +10 -0
- package/dist/core/side-query.js +15 -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/checkpoint-store-contract.d.ts +11 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +168 -3
- package/dist/core/store-contracts/file-history-store-contract.js +74 -4
- 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-policy-store-contract.d.ts +7 -0
- package/dist/core/store-contracts/session-policy-store-contract.js +130 -0
- package/dist/core/store-contracts/session-repo-contract.js +176 -0
- package/dist/core/store-contracts/session-store-contract.d.ts +6 -8
- package/dist/core/store-contracts/session-store-contract.js +361 -51
- package/dist/core/store-contracts/workflow-journal-store-contract.js +26 -1
- package/dist/core/stub-env.d.ts +2 -0
- package/dist/core/stub-env.js +1 -0
- package/dist/core/surrogate-safe-slice.d.ts +3 -3
- package/dist/core/synthetic-read-verdict.js +3 -3
- package/dist/core/task-event.d.ts +42 -8
- package/dist/core/task-notification.d.ts +19 -15
- package/dist/core/task-registry-agent.d.ts +4 -4
- package/dist/core/task-registry-shared.d.ts +4 -4
- package/dist/core/task-registry-shared.js +1 -0
- package/dist/core/task-registry.d.ts +13 -4
- package/dist/core/task-registry.js +14 -2
- package/dist/core/task-result.d.ts +21 -3
- package/dist/core/task-spec.d.ts +69 -64
- package/dist/core/task-stream.d.ts +6 -6
- package/dist/core/task-tool-shape.d.ts +4 -4
- package/dist/core/tighten-task-spec.d.ts +1 -1
- package/dist/core/tighten-task-spec.js +2 -1
- package/dist/core/tool-catalog-entries.d.ts +36 -2
- package/dist/core/tool-catalog-entries.js +69 -43
- package/dist/core/tool-check-reading.d.ts +11 -0
- package/dist/core/tool-check-reading.js +11 -6
- package/dist/core/tool-conformance.js +1 -0
- package/dist/core/tool-errors.d.ts +2 -2
- package/dist/core/tool-face-reader.js +5 -3
- package/dist/core/tool-face.d.ts +21 -2
- package/dist/core/tool-face.js +1 -1
- package/dist/core/tool-model-gate.d.ts +5 -5
- package/dist/core/tool-name-aliases.d.ts +29 -8
- package/dist/core/tool-name-aliases.js +22 -4
- package/dist/core/tool-name-readings.d.ts +10 -43
- package/dist/core/tool-name-readings.js +2 -11
- package/dist/core/tool-policy.d.ts +85 -196
- package/dist/core/tool-policy.js +150 -175
- package/dist/core/tool-registry.d.ts +14 -7
- package/dist/core/tool-registry.js +17 -7
- package/dist/core/tool-result-store.js +5 -1
- package/dist/core/tool-roster.d.ts +57 -33
- package/dist/core/tool-roster.js +56 -68
- package/dist/core/tool-spec-members.js +8 -3
- package/dist/core/tool-spec.d.ts +53 -31
- package/dist/core/tools.js +51 -10
- package/dist/core/trace.d.ts +6 -2
- package/dist/core/types.d.ts +1 -1
- package/dist/core/untrusted-egress.d.ts +1 -1
- package/dist/core/untrusted-text.d.ts +1 -1
- package/dist/core/user-attachment.d.ts +8 -1
- package/dist/core/user-attachment.js +64 -4
- package/dist/core/warm-resume.d.ts +1 -1
- package/dist/core/wiring-manifest.d.ts +58 -0
- package/dist/core/wiring-manifest.js +14 -5
- package/dist/core/workflow-journal-store.d.ts +62 -0
- package/dist/core/workflow-journal-store.js +78 -2
- package/dist/core/workflow-run-store.d.ts +6 -0
- package/dist/core/workflow-run-store.js +2 -0
- package/dist/engine/compaction/compaction.d.ts +9 -9
- package/dist/engine/compaction/compaction.js +3 -2
- package/dist/engine/execution-env/node-execution-env.d.ts +26 -8
- package/dist/engine/execution-env/node-execution-env.js +54 -24
- package/dist/engine/harness/agent-harness.d.ts +39 -9
- package/dist/engine/harness/agent-harness.js +87 -33
- package/dist/engine/harness/types.d.ts +58 -9
- package/dist/engine/harness/types.js +12 -1
- package/dist/engine/llm/types.d.ts +36 -19
- package/dist/engine/llm/validation.d.ts +4 -1
- package/dist/engine/llm/validation.js +13 -1
- package/dist/engine/loop/agent-loop.d.ts +23 -1
- package/dist/engine/loop/agent-loop.js +26 -34
- package/dist/engine/loop/types.d.ts +31 -19
- package/dist/engine/lsp/node-lsp-manager.d.ts +2 -2
- package/dist/engine/session/memory-repo.d.ts +18 -12
- package/dist/engine/session/memory-repo.js +24 -9
- package/dist/engine/session/parent-chain-guard.d.ts +3 -2
- package/dist/engine/session/parent-chain-guard.js +1 -1
- package/dist/engine/session/repo-utils.d.ts +32 -3
- package/dist/engine/session/repo-utils.js +50 -5
- package/dist/index.d.ts +47 -23
- package/dist/index.js +35 -17
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/internal/harness.d.ts +3 -3
- package/dist/internal/harness.js +2 -2
- package/dist/internal/llm.d.ts +2 -2
- package/dist/internal/llm.js +1 -1
- package/dist/orchestration/goal.js +2 -2
- package/dist/orchestration/run-workflow-tool.d.ts +8 -6
- package/dist/orchestration/run-workflow-tool.js +10 -6
- package/dist/orchestration/workflow-size-guideline.d.ts +4 -4
- package/dist/orchestration/workflow-types.d.ts +18 -0
- package/dist/orchestration/workflow-types.js +6 -0
- package/dist/orchestration/workflow.d.ts +5 -13
- package/dist/orchestration/workflow.js +57 -49
- 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 +2 -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 +39 -2
- package/dist/prompt-assembly/tool-catalog.js +117 -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/prompts/default.d.ts +14 -14
- package/dist/scenarios/full-body.d.ts +15 -15
- package/dist/scenarios/full-body.js +4 -3
- package/dist/shell/lex.js +10 -1
- package/dist/stores/file/adoption/adopt.d.ts +4 -3
- package/dist/stores/file/adoption/adopt.js +27 -33
- package/dist/stores/file/adoption/marker.d.ts +6 -13
- package/dist/stores/file/adoption/marker.js +9 -17
- package/dist/stores/file/checkpoint-store.d.ts +24 -0
- package/dist/stores/file/checkpoint-store.js +45 -7
- package/dist/stores/file/file-history-store.d.ts +20 -19
- package/dist/stores/file/file-history-store.js +157 -141
- package/dist/stores/file/fs-atomic.d.ts +15 -0
- package/dist/stores/file/fs-atomic.js +89 -14
- package/dist/stores/file/index.d.ts +1 -1
- package/dist/stores/file/index.js +2 -1
- package/dist/stores/file/mailbox-store.d.ts +3 -0
- package/dist/stores/file/mailbox-store.js +3 -1
- package/dist/stores/file/permission-rule-adopt.d.ts +1 -1
- package/dist/stores/file/permission-rule-adopt.js +18 -18
- package/dist/stores/file/permission-rule-store.d.ts +18 -2
- package/dist/stores/file/permission-rule-store.js +31 -18
- package/dist/stores/file/session-policy-store.d.ts +3 -3
- package/dist/stores/file/session-store.d.ts +54 -16
- package/dist/stores/file/session-store.js +114 -85
- package/dist/stores/file/workflow-journal-store.d.ts +10 -4
- package/dist/stores/file/workflow-journal-store.js +28 -13
- package/dist/tools/artifact/artifact-text.d.ts +1 -1
- package/dist/tools/artifact/artifact-tool.js +5 -3
- 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 +3 -3
- package/dist/tools/fs/fs-bash.d.ts +2 -2
- package/dist/tools/fs/fs-bash.js +8 -6
- 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/fs-shared.d.ts +8 -8
- package/dist/tools/fs/gh-rate-limit.d.ts +1 -1
- package/dist/tools/fs/notebook.d.ts +2 -2
- package/dist/tools/fs/pattern-kill-guard.d.ts +22 -0
- package/dist/tools/fs/pattern-kill-guard.js +397 -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/read-deny.d.ts +29 -7
- package/dist/tools/fs/read-deny.js +63 -22
- package/dist/tools/fs/removal-targets.d.ts +18 -8
- package/dist/tools/fs/removal-targets.js +47 -20
- package/dist/tools/fs/safety.d.ts +9 -9
- package/dist/tools/fs/search.d.ts +16 -6
- 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.js +12 -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-judge.d.ts +4 -0
- package/dist/tools/fs/shell-read-judge.js +5 -2
- 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/loop-tick.d.ts +2 -2
- package/dist/tools/scheduler-tools.js +5 -1
- package/dist/tools/task-list.d.ts +7 -7
- package/dist/tools/task-list.js +5 -1
- package/dist/tools/todo.js +65 -64
- package/dist/tools/web.d.ts +20 -15
- package/dist/tools/web.js +55 -69
- package/dist/tools/worktree.d.ts +3 -3
- package/dist/tools/worktree.js +3 -1
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +5894 -5638
- package/wire-changes/core@7.55.0.json +3318 -0
- package/wire-changes/core@7.56.0.json +3891 -0
- package/wire-changes/mods-kernel@7.56.0.json +303 -0
- package/dist/core/store-contracts/session-store-incarnation-contract.d.ts +0 -39
- package/dist/core/store-contracts/session-store-incarnation-contract.js +0 -95
|
@@ -4,8 +4,9 @@ import { uuidv7 } from "../engine/session/uuid.js";
|
|
|
4
4
|
import { defineTool, errorResult } from "./tools.js";
|
|
5
5
|
import { deliverEngineNotice } from "./types.js";
|
|
6
6
|
import { TOOL_SEARCH_NAME } from "./runner/tool-disclosure.js";
|
|
7
|
-
import { toolFace } from "./tool-catalog-entries.js";
|
|
7
|
+
import { mountRuleFace, toolFace } from "./tool-catalog-entries.js";
|
|
8
8
|
import { thrownText } from "./thrown-value.js";
|
|
9
|
+
import { carryNotStartedReceipt } from "./delegation-not-started.js";
|
|
9
10
|
export const TOOL_RESULT_REF_CONFLICT_CODE = "tool_result.ref_conflict";
|
|
10
11
|
export class ToolResultRefConflictError extends Error {
|
|
11
12
|
ref;
|
|
@@ -239,6 +240,8 @@ export function withToolResultOffload(tool, store, thresholdChars, sessionId, re
|
|
|
239
240
|
const wrappedExecute = async (toolCallId, params, signal, onUpdate) => {
|
|
240
241
|
const res = await tool.execute(toolCallId, params, signal, onUpdate);
|
|
241
242
|
const offloadedDetails = res.details === undefined ? undefined : await offloadOversizedDetailStrings(res.details, store, thresholdChars, sessionId, toolCallId, provenance);
|
|
243
|
+
if (offloadedDetails !== undefined)
|
|
244
|
+
carryNotStartedReceipt(res.details, offloadedDetails.value);
|
|
242
245
|
const withDetails = (r) => offloadedDetails === undefined || offloadedDetails.value === res.details ? r : { ...r, details: offloadedDetails.value };
|
|
243
246
|
if (totalTextChars(res.content) <= thresholdChars)
|
|
244
247
|
return withDetails(res);
|
|
@@ -385,6 +388,7 @@ export function createReadToolResultTool(store) {
|
|
|
385
388
|
return defineTool({
|
|
386
389
|
name: OFFLOAD_TOOL_NAME,
|
|
387
390
|
...toolFace("read-tool-result"),
|
|
391
|
+
ruleFace: mountRuleFace("read-tool-result"),
|
|
388
392
|
description: `Read the full content of a tool result that was too large and persisted (you saw it as ` +
|
|
389
393
|
`<persisted-output ref="..."> with a preview). Pass the ref; use offset/limit to page through it.`,
|
|
390
394
|
parameters: Type.Object({
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Type, type Static, type TSchema } from "typebox";
|
|
2
2
|
import type { AgentTool } from "../internal/harness-types.js";
|
|
3
|
-
import { type ReservedApprovalCard, type ToolApprovalCard, type ToolFamily, type ToolRosterPathTarget, type ToolMountTag, type ToolPathTarget, type ToolRenderHints, type ToolRuleFace } from "./tool-face.js";
|
|
3
|
+
import { type ReservedApprovalCard, type ToolApprovalCard, type ToolFamily, type ToolHostTarget, type ToolRosterPathTarget, type ToolMountTag, type ToolPathTarget, type ToolRenderHints, type ToolRuleFace } from "./tool-face.js";
|
|
4
4
|
import type { ToolContentOrigin, ToolEffect } from "./tool-spec.js";
|
|
5
|
-
import type { ToolMarkSource } from "./ask-origin.js";
|
|
6
5
|
export declare const ROSTER_SOURCES: readonly ["builtin", "caller", "host", "mcp", "a2a", "external", "synthetic"];
|
|
7
6
|
export type RosterSource = (typeof ROSTER_SOURCES)[number];
|
|
8
7
|
export declare const ToolRosterRenderHints: Type.TObject<{
|
|
@@ -10,7 +9,7 @@ export declare const ToolRosterRenderHints: Type.TObject<{
|
|
|
10
9
|
activity: Type.TOptional<Type.TString>;
|
|
11
10
|
summaryParams: Type.TOptional<Type.TArray<Type.TString>>;
|
|
12
11
|
resultCards: Type.TOptional<Type.TArray<Type.TString>>;
|
|
13
|
-
approvalCard: Type.TOptional<Type.TUnion<[Type.TLiteral<"file-edit">, Type.TLiteral<"file-write">, Type.TLiteral<"notebook-edit">, Type.TLiteral<"shell">, Type.TLiteral<"fetch">, Type.TLiteral<"plan">, Type.TLiteral<"question">, Type.TLiteral<"generic">]>>;
|
|
12
|
+
approvalCard: Type.TOptional<Type.TUnion<[Type.TLiteral<"file-edit">, Type.TLiteral<"file-write">, Type.TLiteral<"notebook-edit">, Type.TLiteral<"shell">, Type.TLiteral<"fetch">, Type.TLiteral<"skill">, Type.TLiteral<"workflow">, Type.TLiteral<"plan">, Type.TLiteral<"question">, Type.TLiteral<"generic">]>>;
|
|
14
13
|
}>;
|
|
15
14
|
export declare const ToolRosterEntry: Type.TObject<{
|
|
16
15
|
name: Type.TString;
|
|
@@ -63,9 +62,17 @@ export declare const ToolRosterEntry: Type.TObject<{
|
|
|
63
62
|
absent: Type.TOptional<Type.TUnion<[Type.TLiteral<"none">, Type.TLiteral<"base">]>>;
|
|
64
63
|
patternParam: Type.TOptional<Type.TString>;
|
|
65
64
|
}>>;
|
|
65
|
+
/** The URL slot a host rule of the row's name is read on, as the definition declared it ({@link ToolHostTarget}); absent when
|
|
66
|
+
* it declares none. Exclusive with `pathTarget`. */
|
|
67
|
+
hostTarget: Type.TOptional<Type.TObject<{
|
|
68
|
+
param: Type.TString;
|
|
69
|
+
}>>;
|
|
70
|
+
/** `nameValues`: the values the mounted tool takes for the argument its name rules are read against (`ToolRuleFace.nameValues`,
|
|
71
|
+
* the delegation tool's offered agent types) — present exactly when the definition declares them, copied as declared. */
|
|
66
72
|
ruleFace: Type.TObject<{
|
|
67
73
|
primaryParams: Type.TArray<Type.TString>;
|
|
68
74
|
params: Type.TArray<Type.TString>;
|
|
75
|
+
nameValues: Type.TOptional<Type.TArray<Type.TString>>;
|
|
69
76
|
}>;
|
|
70
77
|
approvalPreview: Type.TBoolean;
|
|
71
78
|
validateInput: Type.TBoolean;
|
|
@@ -78,7 +85,7 @@ export declare const ToolRosterEntry: Type.TObject<{
|
|
|
78
85
|
activity: Type.TOptional<Type.TString>;
|
|
79
86
|
summaryParams: Type.TOptional<Type.TArray<Type.TString>>;
|
|
80
87
|
resultCards: Type.TOptional<Type.TArray<Type.TString>>;
|
|
81
|
-
approvalCard: Type.TOptional<Type.TUnion<[Type.TLiteral<"file-edit">, Type.TLiteral<"file-write">, Type.TLiteral<"notebook-edit">, Type.TLiteral<"shell">, Type.TLiteral<"fetch">, Type.TLiteral<"plan">, Type.TLiteral<"question">, Type.TLiteral<"generic">]>>;
|
|
88
|
+
approvalCard: Type.TOptional<Type.TUnion<[Type.TLiteral<"file-edit">, Type.TLiteral<"file-write">, Type.TLiteral<"notebook-edit">, Type.TLiteral<"shell">, Type.TLiteral<"fetch">, Type.TLiteral<"skill">, Type.TLiteral<"workflow">, Type.TLiteral<"plan">, Type.TLiteral<"question">, Type.TLiteral<"generic">]>>;
|
|
82
89
|
}>>;
|
|
83
90
|
/** The ONE mount condition that fired for this instance. */
|
|
84
91
|
mountedBy: Type.TUnion<[Type.TLiteral<"hands">, Type.TLiteral<"backgroundTasks">, Type.TLiteral<"workflow">, Type.TLiteral<"delegation">, Type.TLiteral<"hostInternals">, Type.TLiteral<"peerLane">, Type.TLiteral<"scheduler">, Type.TLiteral<"memory">, Type.TLiteral<"scenario">, Type.TLiteral<"always">, Type.TLiteral<"optional">]>;
|
|
@@ -140,9 +147,17 @@ export declare const ToolRoster: Type.TObject<{
|
|
|
140
147
|
absent: Type.TOptional<Type.TUnion<[Type.TLiteral<"none">, Type.TLiteral<"base">]>>;
|
|
141
148
|
patternParam: Type.TOptional<Type.TString>;
|
|
142
149
|
}>>;
|
|
150
|
+
/** The URL slot a host rule of the row's name is read on, as the definition declared it ({@link ToolHostTarget}); absent when
|
|
151
|
+
* it declares none. Exclusive with `pathTarget`. */
|
|
152
|
+
hostTarget: Type.TOptional<Type.TObject<{
|
|
153
|
+
param: Type.TString;
|
|
154
|
+
}>>;
|
|
155
|
+
/** `nameValues`: the values the mounted tool takes for the argument its name rules are read against (`ToolRuleFace.nameValues`,
|
|
156
|
+
* the delegation tool's offered agent types) — present exactly when the definition declares them, copied as declared. */
|
|
143
157
|
ruleFace: Type.TObject<{
|
|
144
158
|
primaryParams: Type.TArray<Type.TString>;
|
|
145
159
|
params: Type.TArray<Type.TString>;
|
|
160
|
+
nameValues: Type.TOptional<Type.TArray<Type.TString>>;
|
|
146
161
|
}>;
|
|
147
162
|
approvalPreview: Type.TBoolean;
|
|
148
163
|
validateInput: Type.TBoolean;
|
|
@@ -155,7 +170,7 @@ export declare const ToolRoster: Type.TObject<{
|
|
|
155
170
|
activity: Type.TOptional<Type.TString>;
|
|
156
171
|
summaryParams: Type.TOptional<Type.TArray<Type.TString>>;
|
|
157
172
|
resultCards: Type.TOptional<Type.TArray<Type.TString>>;
|
|
158
|
-
approvalCard: Type.TOptional<Type.TUnion<[Type.TLiteral<"file-edit">, Type.TLiteral<"file-write">, Type.TLiteral<"notebook-edit">, Type.TLiteral<"shell">, Type.TLiteral<"fetch">, Type.TLiteral<"plan">, Type.TLiteral<"question">, Type.TLiteral<"generic">]>>;
|
|
173
|
+
approvalCard: Type.TOptional<Type.TUnion<[Type.TLiteral<"file-edit">, Type.TLiteral<"file-write">, Type.TLiteral<"notebook-edit">, Type.TLiteral<"shell">, Type.TLiteral<"fetch">, Type.TLiteral<"skill">, Type.TLiteral<"workflow">, Type.TLiteral<"plan">, Type.TLiteral<"question">, Type.TLiteral<"generic">]>>;
|
|
159
174
|
}>>;
|
|
160
175
|
/** The ONE mount condition that fired for this instance. */
|
|
161
176
|
mountedBy: Type.TUnion<[Type.TLiteral<"hands">, Type.TLiteral<"backgroundTasks">, Type.TLiteral<"workflow">, Type.TLiteral<"delegation">, Type.TLiteral<"hostInternals">, Type.TLiteral<"peerLane">, Type.TLiteral<"scheduler">, Type.TLiteral<"memory">, Type.TLiteral<"scenario">, Type.TLiteral<"always">, Type.TLiteral<"optional">]>;
|
|
@@ -225,9 +240,17 @@ export declare const ToolRosterDelta: Type.TObject<{
|
|
|
225
240
|
absent: Type.TOptional<Type.TUnion<[Type.TLiteral<"none">, Type.TLiteral<"base">]>>;
|
|
226
241
|
patternParam: Type.TOptional<Type.TString>;
|
|
227
242
|
}>>;
|
|
243
|
+
/** The URL slot a host rule of the row's name is read on, as the definition declared it ({@link ToolHostTarget}); absent when
|
|
244
|
+
* it declares none. Exclusive with `pathTarget`. */
|
|
245
|
+
hostTarget: Type.TOptional<Type.TObject<{
|
|
246
|
+
param: Type.TString;
|
|
247
|
+
}>>;
|
|
248
|
+
/** `nameValues`: the values the mounted tool takes for the argument its name rules are read against (`ToolRuleFace.nameValues`,
|
|
249
|
+
* the delegation tool's offered agent types) — present exactly when the definition declares them, copied as declared. */
|
|
228
250
|
ruleFace: Type.TObject<{
|
|
229
251
|
primaryParams: Type.TArray<Type.TString>;
|
|
230
252
|
params: Type.TArray<Type.TString>;
|
|
253
|
+
nameValues: Type.TOptional<Type.TArray<Type.TString>>;
|
|
231
254
|
}>;
|
|
232
255
|
approvalPreview: Type.TBoolean;
|
|
233
256
|
validateInput: Type.TBoolean;
|
|
@@ -240,7 +263,7 @@ export declare const ToolRosterDelta: Type.TObject<{
|
|
|
240
263
|
activity: Type.TOptional<Type.TString>;
|
|
241
264
|
summaryParams: Type.TOptional<Type.TArray<Type.TString>>;
|
|
242
265
|
resultCards: Type.TOptional<Type.TArray<Type.TString>>;
|
|
243
|
-
approvalCard: Type.TOptional<Type.TUnion<[Type.TLiteral<"file-edit">, Type.TLiteral<"file-write">, Type.TLiteral<"notebook-edit">, Type.TLiteral<"shell">, Type.TLiteral<"fetch">, Type.TLiteral<"plan">, Type.TLiteral<"question">, Type.TLiteral<"generic">]>>;
|
|
266
|
+
approvalCard: Type.TOptional<Type.TUnion<[Type.TLiteral<"file-edit">, Type.TLiteral<"file-write">, Type.TLiteral<"notebook-edit">, Type.TLiteral<"shell">, Type.TLiteral<"fetch">, Type.TLiteral<"skill">, Type.TLiteral<"workflow">, Type.TLiteral<"plan">, Type.TLiteral<"question">, Type.TLiteral<"generic">]>>;
|
|
244
267
|
}>>;
|
|
245
268
|
/** The ONE mount condition that fired for this instance. */
|
|
246
269
|
mountedBy: Type.TUnion<[Type.TLiteral<"hands">, Type.TLiteral<"backgroundTasks">, Type.TLiteral<"workflow">, Type.TLiteral<"delegation">, Type.TLiteral<"hostInternals">, Type.TLiteral<"peerLane">, Type.TLiteral<"scheduler">, Type.TLiteral<"memory">, Type.TLiteral<"scenario">, Type.TLiteral<"always">, Type.TLiteral<"optional">]>;
|
|
@@ -296,11 +319,13 @@ export declare function toolCallFaceOf(roster: ToolRoster | undefined, toolName:
|
|
|
296
319
|
* (the row then reads pre-identity and the resume binds the name alone). */
|
|
297
320
|
export declare function parkedToolIdentity(roster: ToolRoster | undefined, toolName: string): Partial<ToolIdentity>;
|
|
298
321
|
/** design/388 B6 × B18 — the FACE members a park row carries beside its identity: the display family, the declared
|
|
299
|
-
* path target and the names the parked call was judged under. `names` is copied from the face the gate stamped on the
|
|
322
|
+
* path target or URL slot, and the names the parked call was judged under. `names` is copied from the face the gate stamped on the
|
|
300
323
|
* request (the model's spelling first — the row carries the judged fact, it is not re-derived); a request with no face
|
|
301
|
-
* takes the roster's names for its row.
|
|
302
|
-
*
|
|
303
|
-
*
|
|
324
|
+
* takes the roster's names for its row. The mount site (`engineMounted`) is the roster entry's, as the identity and face members
|
|
325
|
+
* beside it are: a fact of the tool, not of the call, and never read off the request's face, which the policy that judges the call
|
|
326
|
+
* can write. A recheck that runs before the leg's roster exists (the pre-CAS resume-edit
|
|
327
|
+
* re-adjudication) rebuilds the call face from the row through {@link parkedCallFaceOf}, so it judges the members the row
|
|
328
|
+
* recorded (identity, family, targets, names, mount site) — not the live face's rule name values or approval card. An empty object when the name is not on the snapshot (the row then reads pre-face and the
|
|
304
329
|
* recheck falls to the catalog for the name). */
|
|
305
330
|
export declare function parkedToolFace(roster: ToolRoster | undefined, req: {
|
|
306
331
|
readonly toolName: string;
|
|
@@ -310,7 +335,9 @@ export declare function parkedToolFace(roster: ToolRoster | undefined, req: {
|
|
|
310
335
|
}): {
|
|
311
336
|
family?: ToolFamily;
|
|
312
337
|
pathTarget?: ToolRosterEntry["pathTarget"];
|
|
338
|
+
hostTarget?: ToolHostTarget;
|
|
313
339
|
names?: readonly string[];
|
|
340
|
+
engineMounted?: true;
|
|
314
341
|
};
|
|
315
342
|
/** The live face a resumed park row is re-judged under: minted under the row's recorded spelling (`names[0]`) when that
|
|
316
343
|
* spelling still resolves to the row's own tool on this roster, else under the row's wire name — a spelling that no
|
|
@@ -325,11 +352,13 @@ export declare function parkedRowLiveFace(roster: ToolRoster | undefined, row: {
|
|
|
325
352
|
export declare function parkedCallFaceOf(pending: {
|
|
326
353
|
family?: ToolFamily;
|
|
327
354
|
pathTarget?: ToolRosterPathTarget;
|
|
355
|
+
hostTarget?: ToolHostTarget;
|
|
328
356
|
names?: readonly string[];
|
|
329
357
|
capabilityId?: string;
|
|
330
358
|
contractId?: string;
|
|
331
359
|
shapeDigest?: string;
|
|
332
360
|
implementationRevision?: string;
|
|
361
|
+
engineMounted?: true;
|
|
333
362
|
}): import("./tool-policy.js").ToolCallFace | undefined;
|
|
334
363
|
/** The optional `face` seat of a ToolCallRequest: present iff a face was read (a bare request carries no key). */
|
|
335
364
|
export declare function callFaceSeat(face: import("./tool-policy.js").ToolCallFace | undefined): {
|
|
@@ -387,6 +416,10 @@ export declare function rosterMemberBoundProblem(m: RosterBoundMembers): {
|
|
|
387
416
|
code: RosterBoundCode;
|
|
388
417
|
message: string;
|
|
389
418
|
} | undefined;
|
|
419
|
+
/** Did one of the ENGINE's own mount sites mount this row — a built-in or synthetic tool the engine minted for the leg — rather than a
|
|
420
|
+
* caller's `TaskSpec.tools` entry (`scenario`) or a protocol peer's tool? The one identity a caller cannot declare: a name, a contract
|
|
421
|
+
* id and a source word all can be worn, the mount site cannot. Read onto the call's face ({@link toolCallFaceOf}, `engineMounted`). */
|
|
422
|
+
export declare function engineMountedRow(e: Pick<ToolRosterEntry, "source" | "mountedBy">): boolean;
|
|
390
423
|
/**
|
|
391
424
|
* The rule vocabulary of ONE mounted instance (design/388 §2.2 ③ / D-3): DERIVED = the scalar top-level
|
|
392
425
|
* keys ∪ the path target's `param` + aliases; a declared `params` list can only NARROW it (a declared
|
|
@@ -397,6 +430,8 @@ export declare function ruleFaceOfInstance(schema: TSchema | undefined, declared
|
|
|
397
430
|
primaryParams: string[];
|
|
398
431
|
params: string[];
|
|
399
432
|
};
|
|
433
|
+
/** The instance `row` describes: what runs when a call is judged by that row. A row no snapshot minted has none. */
|
|
434
|
+
export declare function rowMember(row: ToolRosterEntry): AgentTool | undefined;
|
|
400
435
|
/** The instance each NAME dispatches to when several are mounted under it: the LATER mount (the harness keeps the
|
|
401
436
|
* later one). The one selection — the roster's snapshot and every table keyed by a caller tool's name read it here. */
|
|
402
437
|
export declare function survivorsByName<T extends {
|
|
@@ -427,6 +462,7 @@ export interface MountedToolFace {
|
|
|
427
462
|
mcpAlwaysLoad?: boolean;
|
|
428
463
|
family?: ToolFamily;
|
|
429
464
|
pathTarget?: ToolPathTarget;
|
|
465
|
+
hostTarget?: ToolHostTarget;
|
|
430
466
|
ruleFace?: ToolRuleFace;
|
|
431
467
|
renderHints?: ToolRenderHints;
|
|
432
468
|
compactable?: true;
|
|
@@ -437,7 +473,7 @@ export interface MountedToolFace {
|
|
|
437
473
|
export declare const faceOf: (t: AgentTool) => MountedToolFace;
|
|
438
474
|
/** The leg facts the snapshot reads beside the instances — the safety scan's folds and the per-task knobs. */
|
|
439
475
|
export interface RosterSnapshotFacts {
|
|
440
|
-
/** The leg's by-name effect map (the builder
|
|
476
|
+
/** The leg's by-name effect map (the builder writes it at every mount and unmount; the protocol folds write a protocol member's). */
|
|
441
477
|
effects: ReadonlyMap<string, ToolEffect>;
|
|
442
478
|
egress: ReadonlySet<string>;
|
|
443
479
|
irreversibilityTier: ReadonlyMap<string, "never" | "maybe" | "always">;
|
|
@@ -447,32 +483,18 @@ export interface RosterSnapshotFacts {
|
|
|
447
483
|
/** `TaskSpec.memory.trustedTools` — the exemption channel for an undeclared content class. */
|
|
448
484
|
trustedTools: ReadonlySet<string>;
|
|
449
485
|
}
|
|
450
|
-
/** The leg's per-name safety-axis tables the builder keeps aligned with its mounts beside the effect map (the safety scan mints
|
|
451
|
-
* them; the protocol folds and the shell seat also write them). */
|
|
452
|
-
export interface RosterAxisTables {
|
|
453
|
-
irreversibilityTier: Map<string, "never" | "maybe" | "always">;
|
|
454
|
-
irreversibleTools: Set<string>;
|
|
455
|
-
reversibilityProbes: Map<string, unknown>;
|
|
456
|
-
egressTools: Set<string>;
|
|
457
|
-
toolMarkSources: Map<string, Set<ToolMarkSource>>;
|
|
458
|
-
}
|
|
459
486
|
export declare class RosterBuilder {
|
|
460
487
|
#private;
|
|
461
|
-
/** `
|
|
462
|
-
|
|
488
|
+
/** `effects` — the leg's by-name effect map, which the builder keeps equal to the mounted set's answering members. The leg's
|
|
489
|
+
* safety-axis tables are not the builder's: their marks live under the names they were laid on, and a call reads them under
|
|
490
|
+
* the names it answers to. */
|
|
491
|
+
constructor(effects: Map<string, ToolEffect>);
|
|
463
492
|
/** The mount array as a READ face. The order is the wire order. */
|
|
464
493
|
get tools(): readonly AgentTool[];
|
|
465
494
|
get length(): number;
|
|
466
495
|
metaOf(tool: AgentTool): RosterMountMeta | undefined;
|
|
467
|
-
/** Mount one instance at the tail
|
|
468
|
-
*
|
|
469
|
-
* declaration is the map's truth for that name — an engine tool's effect reaches the map from its own declaration, here at its
|
|
470
|
-
* mount (nothing writes it by name beforehand; a protocol axis fills a name no mounted instance declares, and the gate's
|
|
471
|
-
* post-assembly sync a kept instance the map still lacks). The `scenario` lane never writes the map: its
|
|
472
|
-
* declarations were latched by the safety scan BEFORE any mount (on the kept instance of each name, on the
|
|
473
|
-
* synchronous doors+scan stretch — a microtask cannot flip them), so a scenario mount, kept or dropped, leaves
|
|
474
|
-
* the map as the scan made it; an engine lane's mount under that name still displaces it, and the aliases the displaced
|
|
475
|
-
* instance answered to move to the member they now resolve to (`#resettleAliases`). */
|
|
496
|
+
/** Mount one instance at the tail; the leg's effect map then follows the mounted set (`#settleEffects`). The later mount under
|
|
497
|
+
* a name is the one the harness dispatches to (`snapshot`'s yield rule). */
|
|
476
498
|
mount(tool: AgentTool, meta: RosterMountMeta): void;
|
|
477
499
|
/** An ENGINE-INJECTED instance the harness list carries outside the mount array (the ToolSearch lane): a roster
|
|
478
500
|
* row — the model can call it — never a mount-array element (the disclosure lane owns that list and appends the
|
|
@@ -555,13 +577,15 @@ export declare class ToolRosterDeltaSeat {
|
|
|
555
577
|
/**
|
|
556
578
|
* design/388 B15 — the rule-face resolver a leg hands the rule compiler: every roster row answers with its
|
|
557
579
|
* derived vocabulary, the carried-but-non-scalar keys (so `Edit(edits:x)` reads `param_non_scalar`, not
|
|
558
|
-
* `param_unknown`) and
|
|
580
|
+
* `param_unknown`) and the values a name rule of it is resolved against when the definition declares them (`nameValues`);
|
|
581
|
+
* a name off the roster answers undefined. Which lane a rule takes is the rule name's grammar, not the row's: the resolver
|
|
582
|
+
* says which parameters the mounted tool carries and which name values it declares.
|
|
559
583
|
*/
|
|
560
584
|
export declare function ruleFacesFromRoster(roster: ToolRoster): (toolName: string) => {
|
|
561
585
|
primaryParams: readonly string[];
|
|
562
586
|
params: readonly string[];
|
|
563
587
|
nonScalar: readonly string[];
|
|
564
|
-
|
|
588
|
+
nameValues?: readonly string[];
|
|
565
589
|
} | undefined;
|
|
566
590
|
/** The delta between two snapshots (design/388 §2.5): the whole `next` roster plus the name summary. */
|
|
567
591
|
export declare function diffToolRoster(prev: ToolRoster, next: ToolRoster): ToolRosterDelta;
|
package/dist/core/tool-roster.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { types } from "node:util";
|
|
3
3
|
import { Type } from "typebox";
|
|
4
|
-
import {
|
|
4
|
+
import { toolNameIndex } from "../internal/llm.js";
|
|
5
5
|
import { getToolContract } from "../prompt-assembly/tool-catalog.js";
|
|
6
6
|
import { protocolOf } from "./protocol-table.js";
|
|
7
7
|
import { describeToolCatalog } from "./tool-registry.js";
|
|
@@ -60,7 +60,8 @@ export const ToolRosterEntry = Type.Object({
|
|
|
60
60
|
absent: Type.Optional(lit(TOOL_PATH_ABSENCES)),
|
|
61
61
|
patternParam: Type.Optional(Key),
|
|
62
62
|
}, { additionalProperties: false })),
|
|
63
|
-
|
|
63
|
+
hostTarget: Type.Optional(Type.Object({ param: Key }, { additionalProperties: false })),
|
|
64
|
+
ruleFace: Type.Object({ primaryParams: Type.Array(Key), params: Type.Array(Key), nameValues: Type.Optional(Type.Array(Type.String())) }, { additionalProperties: false }),
|
|
64
65
|
approvalPreview: Type.Boolean(),
|
|
65
66
|
validateInput: Type.Boolean(),
|
|
66
67
|
deferred: Type.Boolean(),
|
|
@@ -116,11 +117,14 @@ export function toolCallFaceOf(roster, toolName) {
|
|
|
116
117
|
names: resolving.includes(toolName) ? [toolName, ...resolving.filter((n) => n !== toolName)] : resolving,
|
|
117
118
|
family: e.family,
|
|
118
119
|
...(e.pathTarget !== undefined ? { pathTarget: e.pathTarget } : {}),
|
|
120
|
+
...(e.hostTarget !== undefined ? { hostTarget: e.hostTarget } : {}),
|
|
121
|
+
...(e.ruleFace?.nameValues !== undefined ? { nameValues: Object.freeze([...e.ruleFace.nameValues]) } : {}),
|
|
119
122
|
capabilityId: e.capabilityId,
|
|
120
123
|
contractId: e.contract.contractId,
|
|
121
124
|
shapeDigest: e.shapeDigest,
|
|
122
125
|
implementationRevision: e.contract.implementationRevision,
|
|
123
126
|
approvalCard: approvalCardOf({ toolName: e.name }, e.renderHints?.approvalCard),
|
|
127
|
+
...(engineMountedRow(e) ? { engineMounted: true } : {}),
|
|
124
128
|
};
|
|
125
129
|
}
|
|
126
130
|
export function parkedToolIdentity(roster, toolName) {
|
|
@@ -136,7 +140,7 @@ export function parkedToolFace(roster, req) {
|
|
|
136
140
|
if (e === undefined)
|
|
137
141
|
return {};
|
|
138
142
|
const judged = req.face?.names;
|
|
139
|
-
return { family: e.family, ...(e.pathTarget !== undefined ? { pathTarget: e.pathTarget } : {}), names: judged !== undefined && judged.includes(req.toolName) ? [...judged] : namesResolvingTo(roster, e) };
|
|
143
|
+
return { family: e.family, ...(e.pathTarget !== undefined ? { pathTarget: e.pathTarget } : {}), ...(e.hostTarget !== undefined ? { hostTarget: e.hostTarget } : {}), names: judged !== undefined && judged.includes(req.toolName) ? [...judged] : namesResolvingTo(roster, e), ...(engineMountedRow(e) ? { engineMounted: true } : {}) };
|
|
140
144
|
}
|
|
141
145
|
export function parkedRowLiveFace(roster, row) {
|
|
142
146
|
const spelled = row.names?.[0];
|
|
@@ -150,10 +154,12 @@ export function parkedCallFaceOf(pending) {
|
|
|
150
154
|
...(pending.names !== undefined ? { names: pending.names } : {}),
|
|
151
155
|
family: pending.family,
|
|
152
156
|
...(pending.pathTarget !== undefined ? { pathTarget: pending.pathTarget } : {}),
|
|
157
|
+
...(pending.hostTarget !== undefined ? { hostTarget: pending.hostTarget } : {}),
|
|
153
158
|
capabilityId: pending.capabilityId,
|
|
154
159
|
contractId: pending.contractId,
|
|
155
160
|
shapeDigest: pending.shapeDigest,
|
|
156
161
|
implementationRevision: pending.implementationRevision,
|
|
162
|
+
...(pending.engineMounted === true ? { engineMounted: true } : {}),
|
|
157
163
|
};
|
|
158
164
|
}
|
|
159
165
|
export function callFaceSeat(face) {
|
|
@@ -268,6 +274,9 @@ export function rosterMemberBoundProblem(m) {
|
|
|
268
274
|
return { code: "config.tool_roster_bound", message: of(over("cardId", m.cardId, TOOL_CARD_ID_MAX_CHARS)) };
|
|
269
275
|
return undefined;
|
|
270
276
|
}
|
|
277
|
+
export function engineMountedRow(e) {
|
|
278
|
+
return e.mountedBy !== "scenario" && (e.source === "builtin" || e.source === "synthetic");
|
|
279
|
+
}
|
|
271
280
|
export function ruleFaceOfInstance(schema, declared, pathTarget) {
|
|
272
281
|
const { scalar } = inputKeysOf(schema);
|
|
273
282
|
const derived = new Set(scalar);
|
|
@@ -297,6 +306,10 @@ function capRenderHints(h) {
|
|
|
297
306
|
out.approvalCard = h.approvalCard;
|
|
298
307
|
return Object.keys(out).length > 0 ? out : undefined;
|
|
299
308
|
}
|
|
309
|
+
const ROW_MEMBERS = new WeakMap();
|
|
310
|
+
export function rowMember(row) {
|
|
311
|
+
return ROW_MEMBERS.get(row);
|
|
312
|
+
}
|
|
300
313
|
export function survivorsByName(mounted) {
|
|
301
314
|
const winner = new Map();
|
|
302
315
|
for (const t of mounted)
|
|
@@ -304,18 +317,7 @@ export function survivorsByName(mounted) {
|
|
|
304
317
|
return winner;
|
|
305
318
|
}
|
|
306
319
|
export const faceOf = (t) => t;
|
|
307
|
-
const
|
|
308
|
-
if (value === undefined)
|
|
309
|
-
m.delete(key);
|
|
310
|
-
else
|
|
311
|
-
m.set(key, value);
|
|
312
|
-
};
|
|
313
|
-
const memberIf = (s, key, member) => {
|
|
314
|
-
if (member)
|
|
315
|
-
s.add(key);
|
|
316
|
-
else
|
|
317
|
-
s.delete(key);
|
|
318
|
-
};
|
|
320
|
+
const protocolFolded = (source) => source === "mcp" || source === "a2a";
|
|
319
321
|
function configError(code, message) {
|
|
320
322
|
const e = new Error(message);
|
|
321
323
|
e.code = code;
|
|
@@ -326,10 +328,8 @@ export class RosterBuilder {
|
|
|
326
328
|
#engineLane = [];
|
|
327
329
|
#meta = new WeakMap();
|
|
328
330
|
#effects;
|
|
329
|
-
|
|
330
|
-
constructor(effects, axes) {
|
|
331
|
+
constructor(effects) {
|
|
331
332
|
this.#effects = effects;
|
|
332
|
-
this.#axes = axes;
|
|
333
333
|
}
|
|
334
334
|
get tools() {
|
|
335
335
|
return this.#tools;
|
|
@@ -341,18 +341,16 @@ export class RosterBuilder {
|
|
|
341
341
|
return this.#meta.get(tool);
|
|
342
342
|
}
|
|
343
343
|
mount(tool, meta) {
|
|
344
|
+
this.#settleEffects(this.#mountOne(tool, meta, this.#tools));
|
|
345
|
+
}
|
|
346
|
+
#mountOne(tool, meta, lane) {
|
|
344
347
|
const displaced = this.#survivorNamed(tool.name);
|
|
345
348
|
this.#admit(tool, meta);
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
this.#resettleAliases([...(displaced?.aliases ?? []), ...(tool.aliases ?? [])]);
|
|
349
|
+
lane.push(tool);
|
|
350
|
+
return [tool.name, ...(displaced?.aliases ?? []), ...(tool.aliases ?? [])];
|
|
349
351
|
}
|
|
350
352
|
mountEngineLane(tool, meta) {
|
|
351
|
-
|
|
352
|
-
this.#admit(tool, meta);
|
|
353
|
-
this.#engineLane.push(tool);
|
|
354
|
-
if (meta.mountedBy !== "scenario")
|
|
355
|
-
this.#resettleAliases([...(displaced?.aliases ?? []), ...(tool.aliases ?? [])]);
|
|
353
|
+
this.#settleEffects(this.#mountOne(tool, meta, this.#engineLane));
|
|
356
354
|
}
|
|
357
355
|
#admit(tool, meta) {
|
|
358
356
|
if ((meta.source === "mcp" || meta.source === "a2a" || meta.source === "external") !== (meta.origin !== undefined)) {
|
|
@@ -361,39 +359,26 @@ export class RosterBuilder {
|
|
|
361
359
|
if (!TOOL_MOUNT_TAGS.includes(meta.mountedBy))
|
|
362
360
|
throw configError("config.tool_roster_mount_tag", `tool ${JSON.stringify(tool.name)}: mount tag ${JSON.stringify(meta.mountedBy)} is outside the closed set`);
|
|
363
361
|
this.#meta.set(tool, meta);
|
|
364
|
-
const eff = faceOf(tool).effect;
|
|
365
|
-
if (eff !== undefined && meta.mountedBy !== "scenario")
|
|
366
|
-
this.#effects.set(tool.name, eff);
|
|
367
|
-
}
|
|
368
|
-
#survivorNamed(name) {
|
|
369
|
-
return survivorsByName([...this.#tools, ...this.#engineLane]).get(name);
|
|
370
362
|
}
|
|
371
|
-
#
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
363
|
+
#settleEffects(names) {
|
|
364
|
+
const answering = toolNameIndex([...survivorsByName([...this.#tools, ...this.#engineLane]).values()]);
|
|
365
|
+
for (const name of new Set(names)) {
|
|
366
|
+
const owner = answering(name);
|
|
367
|
+
const declared = owner === undefined ? undefined : faceOf(owner).effect;
|
|
368
|
+
if (declared !== undefined)
|
|
369
|
+
this.#effects.set(name, declared);
|
|
370
|
+
else if (owner === undefined || !protocolFolded(this.#meta.get(owner)?.source))
|
|
371
|
+
this.#effects.delete(name);
|
|
380
372
|
}
|
|
381
373
|
}
|
|
382
|
-
#
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
return;
|
|
388
|
-
setOrClear(this.#axes.irreversibilityTier, key, pick(this.#axes.irreversibilityTier));
|
|
389
|
-
setOrClear(this.#axes.reversibilityProbes, key, pick(this.#axes.reversibilityProbes));
|
|
390
|
-
setOrClear(this.#axes.toolMarkSources, key, marks === undefined ? undefined : new Set(marks));
|
|
391
|
-
memberIf(this.#axes.irreversibleTools, key, from !== undefined && this.#axes.irreversibleTools.has(from));
|
|
392
|
-
memberIf(this.#axes.egressTools, key, from !== undefined && this.#axes.egressTools.has(from));
|
|
374
|
+
#namesAfterRemoval(removed) {
|
|
375
|
+
return [...this.#tools, ...this.#engineLane, ...removed].flatMap((t) => [t.name, ...(t.aliases ?? [])]);
|
|
376
|
+
}
|
|
377
|
+
#survivorNamed(name) {
|
|
378
|
+
return survivorsByName([...this.#tools, ...this.#engineLane]).get(name);
|
|
393
379
|
}
|
|
394
380
|
mountAll(tools, meta) {
|
|
395
|
-
|
|
396
|
-
this.mount(t, meta);
|
|
381
|
+
this.#settleEffects(tools.flatMap((t) => this.#mountOne(t, meta, this.#tools)));
|
|
397
382
|
}
|
|
398
383
|
unmountWhere(pred) {
|
|
399
384
|
const removed = [];
|
|
@@ -404,10 +389,7 @@ export class RosterBuilder {
|
|
|
404
389
|
removed.unshift(t);
|
|
405
390
|
}
|
|
406
391
|
}
|
|
407
|
-
|
|
408
|
-
if (this.#survivorNamed(t.name) === undefined)
|
|
409
|
-
this.#effects.delete(t.name);
|
|
410
|
-
this.#resettleAliases(removed.flatMap((t) => t.aliases ?? []));
|
|
392
|
+
this.#settleEffects(this.#namesAfterRemoval(removed));
|
|
411
393
|
return removed;
|
|
412
394
|
}
|
|
413
395
|
replaceAt(index, tool) {
|
|
@@ -421,22 +403,20 @@ export class RosterBuilder {
|
|
|
421
403
|
}
|
|
422
404
|
replaceDomain(prefix, fresh, meta) {
|
|
423
405
|
let anchor = -1;
|
|
406
|
+
const removed = [];
|
|
424
407
|
for (let i = this.#tools.length - 1; i >= 0; i--) {
|
|
425
408
|
if (this.#tools[i].name.startsWith(prefix)) {
|
|
426
409
|
anchor = i;
|
|
427
|
-
this.#tools.splice(i, 1);
|
|
410
|
+
removed.push(...this.#tools.splice(i, 1));
|
|
428
411
|
}
|
|
429
412
|
}
|
|
430
|
-
for (const t of fresh)
|
|
413
|
+
for (const t of fresh)
|
|
431
414
|
this.#meta.set(t, meta);
|
|
432
|
-
const eff = faceOf(t).effect;
|
|
433
|
-
if (eff !== undefined)
|
|
434
|
-
this.#effects.set(t.name, eff);
|
|
435
|
-
}
|
|
436
415
|
if (anchor >= 0)
|
|
437
416
|
this.#tools.splice(anchor, 0, ...fresh);
|
|
438
417
|
else
|
|
439
418
|
this.#tools.push(...fresh);
|
|
419
|
+
this.#settleEffects(this.#namesAfterRemoval(removed));
|
|
440
420
|
return { anchor };
|
|
441
421
|
}
|
|
442
422
|
snapshot(facts) {
|
|
@@ -450,7 +430,9 @@ export class RosterBuilder {
|
|
|
450
430
|
emitted.add(t.name);
|
|
451
431
|
const survivor = winner.get(t.name);
|
|
452
432
|
const meta = this.#meta.get(survivor) ?? { source: "caller", mountedBy: "scenario" };
|
|
453
|
-
|
|
433
|
+
const row = mintRosterEntry(survivor, meta, facts);
|
|
434
|
+
ROW_MEMBERS.set(row, survivor);
|
|
435
|
+
entries.push(row);
|
|
454
436
|
}
|
|
455
437
|
const roster = { schemaVersion: 1, count: entries.length, entries, digest: rosterDigestOf(entries) };
|
|
456
438
|
const worn = rosterEngineNamesProblem(roster);
|
|
@@ -542,7 +524,7 @@ export function mintRosterEntry(tool, meta, facts) {
|
|
|
542
524
|
const declaredEffect = face.effect;
|
|
543
525
|
const foldedEffect = facts.effects.get(tool.name);
|
|
544
526
|
const effect = declaredEffect ?? foldedEffect ?? "write";
|
|
545
|
-
const effectProvenance = declaredEffect !== undefined ? (meta.source === "synthetic" ? "synthetic" : "declared") : foldedEffect !== undefined && (meta.source
|
|
527
|
+
const effectProvenance = declaredEffect !== undefined ? (meta.source === "synthetic" ? "synthetic" : "declared") : foldedEffect !== undefined && protocolFolded(meta.source) ? "caller" : "default";
|
|
546
528
|
const boundaryLegs = rosterBoundaryLegs(meta.source, face.boundaryLegs, effect);
|
|
547
529
|
if (boundaryLegs === undefined)
|
|
548
530
|
throw boundaryLegsRefusal(tool.name);
|
|
@@ -554,6 +536,11 @@ export function mintRosterEntry(tool, meta, facts) {
|
|
|
554
536
|
const contentOriginProvenance = face.contentOrigin !== undefined ? (meta.source === "mcp" || meta.source === "a2a" ? "server" : "declared") : facts.trustedTools.has(tool.name) ? "exempted" : "default";
|
|
555
537
|
const pathTarget = face.pathTarget;
|
|
556
538
|
const rf = ruleFaceOfInstance(tool.parameters, face.ruleFace, pathTarget);
|
|
539
|
+
const declaredValues = face.ruleFace?.nameValues;
|
|
540
|
+
const isStringList = (v) => Array.isArray(v) && Array.from(v).every((s) => typeof s === "string");
|
|
541
|
+
if (declaredValues !== undefined && !isStringList(declaredValues))
|
|
542
|
+
throw configError("config.tool_roster_bound", `tool ${JSON.stringify(tool.name)}: ruleFace.nameValues must be a list of strings`);
|
|
543
|
+
const nameValues = declaredValues;
|
|
557
544
|
const hints = face.renderHints !== undefined ? capRenderHints(face.renderHints) : undefined;
|
|
558
545
|
const bound = rosterMemberBoundProblem({
|
|
559
546
|
name: tool.name,
|
|
@@ -604,7 +591,8 @@ export function mintRosterEntry(tool, meta, facts) {
|
|
|
604
591
|
},
|
|
605
592
|
}
|
|
606
593
|
: {}),
|
|
607
|
-
|
|
594
|
+
...(face.hostTarget !== undefined ? { hostTarget: { param: face.hostTarget.param } } : {}),
|
|
595
|
+
ruleFace: { ...rf, ...(nameValues !== undefined ? { nameValues: [...nameValues] } : {}) },
|
|
608
596
|
approvalPreview: typeof tool.approvalPreview === "function",
|
|
609
597
|
validateInput: typeof tool.validateInput === "function",
|
|
610
598
|
deferred: facts.deferred.has(tool.name),
|
|
@@ -672,7 +660,7 @@ export function ruleFacesFromRoster(roster) {
|
|
|
672
660
|
primaryParams: e.ruleFace.primaryParams,
|
|
673
661
|
params: e.ruleFace.params,
|
|
674
662
|
nonScalar: e.inputKeys.filter((k) => !params.has(k.name) && (k.type === "object" || k.type === "array")).map((k) => k.name),
|
|
675
|
-
|
|
663
|
+
...(e.ruleFace.nameValues !== undefined ? { nameValues: Object.freeze([...e.ruleFace.nameValues]) } : {}),
|
|
676
664
|
};
|
|
677
665
|
};
|
|
678
666
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { assertNoRetiredKeys, RETIRED_TOOL_SPEC_KEYS } from "./retired-keys.js";
|
|
1
2
|
import { UNREADABLE_LIST, snapshotToolNameList } from "./tool-name-list.js";
|
|
3
|
+
import { isCatalogContract } from "./tool-catalog-entries.js";
|
|
4
|
+
import { isEngineDescriptor } from "../prompt-assembly/tool-catalog.js";
|
|
2
5
|
export const TOOL_SPEC_MEMBERS = Object.keys({
|
|
3
|
-
name: true, aliases: true, description: true,
|
|
6
|
+
name: true, aliases: true, description: true, descriptionVariants: true, label: true, parameters: true, execute: true, effect: true,
|
|
4
7
|
egress: true, irreversibility: true, reversibilityProbe: true, permissionSeat: true, isConcurrencySafe: true, executionMode: true,
|
|
5
8
|
contentOrigin: true, offload: true, offloadThresholdChars: true, defer: true, alwaysLoad: true, prepareArguments: true,
|
|
6
|
-
validateInput: true, approvalPreview: true, family: true, pathTarget: true, ruleFace: true, renderHints: true, compactable: true,
|
|
9
|
+
validateInput: true, approvalPreview: true, family: true, pathTarget: true, hostTarget: true, ruleFace: true, renderHints: true, compactable: true,
|
|
7
10
|
budgetExempt: true, modelGate: true, contract: true, agentListing: true, agentModels: true, agentToolFaces: true,
|
|
8
11
|
agentToolLevelAllowTools: true, agentToolLevelDenyTools: true, agentToolPool: true, agentToolInheritsMcp: true, withAgents: true, boundaryLegs: true, boundaryLegsFor: true,
|
|
9
12
|
});
|
|
@@ -14,6 +17,7 @@ const FACE_PLACES = { elementKeys: FACE_LIST_KEYS };
|
|
|
14
17
|
const MAX_NODES = 20_000;
|
|
15
18
|
const MAX_DEPTH = 64;
|
|
16
19
|
const COPIED = new WeakSet();
|
|
20
|
+
const isEngineMint = (value) => isCatalogContract(value) || isEngineDescriptor(value);
|
|
17
21
|
class DeclarationRefused extends Error {
|
|
18
22
|
}
|
|
19
23
|
function refuse(path, why) {
|
|
@@ -46,7 +50,7 @@ function copyNode(value, path, depth, state, lenient, places) {
|
|
|
46
50
|
return value;
|
|
47
51
|
if (typeof value === "function")
|
|
48
52
|
return lenient ? inertFunction() : refuse(path, "a function inside declaration data");
|
|
49
|
-
if (COPIED.has(value))
|
|
53
|
+
if (COPIED.has(value) || isEngineMint(value))
|
|
50
54
|
return value;
|
|
51
55
|
const seen = lenient ? state.seenLenient : state.seen;
|
|
52
56
|
const shared = seen.get(value);
|
|
@@ -158,6 +162,7 @@ export function frozenExtra(key, value, state) {
|
|
|
158
162
|
}
|
|
159
163
|
}
|
|
160
164
|
export function frozenToolSpec(spec) {
|
|
165
|
+
assertNoRetiredKeys(spec, RETIRED_TOOL_SPEC_KEYS, "ToolSpec");
|
|
161
166
|
const copy = {};
|
|
162
167
|
const state = newCopyState();
|
|
163
168
|
for (const name of TOOL_SPEC_MEMBERS) {
|