@sema-agent/core 7.57.0 → 7.59.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 +1161 -0
- package/README.md +6 -4
- package/dist/agents/cc-peer-directory.js +8 -8
- package/dist/agents/child-model-seat.d.ts +4 -2
- package/dist/agents/child-model-seat.js +5 -3
- package/dist/agents/peer-directory.d.ts +9 -0
- package/dist/agents/peer-directory.js +6 -2
- package/dist/agents/send-message-tool.js +21 -12
- package/dist/agents/subagent-steps.js +2 -4
- package/dist/agents/subagent.js +33 -34
- package/dist/brain/anthropic.js +161 -45
- package/dist/brain/errors.d.ts +9 -3
- package/dist/brain/errors.js +7 -1
- package/dist/brain/failover.js +2 -1
- package/dist/brain/open-responses.js +3 -3
- package/dist/brain/openai.js +103 -53
- package/dist/brain/provider-dialect.d.ts +11 -0
- package/dist/brain/provider-dialect.js +5 -2
- package/dist/brain/reasoning-request.js +5 -4
- package/dist/brain/reasoning.d.ts +19 -0
- package/dist/brain/reasoning.js +17 -2
- package/dist/brain/request-route.d.ts +4 -1
- package/dist/brain/request-route.js +4 -1
- package/dist/brain/route-adjudicator.d.ts +84 -18
- package/dist/brain/route-adjudicator.js +89 -22
- package/dist/brain/route-conformance.js +1 -1
- package/dist/brain/stream-engine.js +84 -49
- package/dist/brain/stream-shared.d.ts +30 -0
- package/dist/brain/stream-shared.js +34 -1
- package/dist/brain/timeout.d.ts +62 -5
- package/dist/brain/timeout.js +93 -6
- package/dist/core/a2a.d.ts +2 -1
- package/dist/core/a2a.js +23 -10
- package/dist/core/account-row.d.ts +61 -0
- package/dist/core/account-row.js +51 -0
- package/dist/core/advisor-verdict.d.ts +2 -1
- package/dist/core/advisor-verdict.js +1 -1
- package/dist/core/allow-entry.d.ts +20 -7
- package/dist/core/allow-entry.js +18 -9
- package/dist/core/approval-object.d.ts +29 -15
- package/dist/core/approval-object.js +47 -19
- package/dist/core/ask-origin.d.ts +21 -2
- package/dist/core/ask-origin.js +5 -1
- package/dist/core/auto-compaction.d.ts +4 -0
- package/dist/core/auto-compaction.js +2 -2
- package/dist/core/auto-mode-directive.d.ts +29 -5
- package/dist/core/auto-mode-directive.js +38 -8
- package/dist/core/background-agent-store.d.ts +16 -3
- package/dist/core/checkpoint-requirements.d.ts +19 -1
- package/dist/core/checkpoint-requirements.js +5 -1
- package/dist/core/checkpoint-store.d.ts +85 -23
- package/dist/core/checkpoint-store.js +31 -9
- package/dist/core/child-clamp-seats.d.ts +29 -0
- package/dist/core/child-clamp-seats.js +56 -1
- package/dist/core/compliance.d.ts +2 -2
- package/dist/core/compliance.js +1 -1
- package/dist/core/effective-path-target.d.ts +8 -2
- package/dist/core/effective-path-target.js +8 -3
- package/dist/core/engine-notice.d.ts +99 -9
- package/dist/core/engine-notice.js +19 -5
- package/dist/core/fs-write-gate-policy.d.ts +4 -2
- package/dist/core/fs-write-gate-policy.js +7 -3
- package/dist/core/gate-fold.js +7 -4
- package/dist/core/gate-lanes.js +19 -6
- package/dist/core/gate-outcome.d.ts +32 -3
- package/dist/core/gate-outcome.js +19 -1
- package/dist/core/git-worktree-env.d.ts +53 -11
- package/dist/core/git-worktree-env.js +96 -12
- package/dist/core/governance-codes.d.ts +9 -1
- package/dist/core/governance-codes.js +13 -0
- package/dist/core/hooks.d.ts +35 -4
- package/dist/core/hooks.js +17 -11
- package/dist/core/human-input-projection.d.ts +1 -0
- package/dist/core/human-input-projection.js +3 -0
- package/dist/core/image-admission.d.ts +6 -5
- package/dist/core/image-admission.js +18 -14
- package/dist/core/locked-config.d.ts +20 -3
- package/dist/core/locked-config.js +40 -3
- package/dist/core/mailbox-store.d.ts +45 -1
- package/dist/core/mailbox-store.js +53 -9
- package/dist/core/mcp-call-meta.d.ts +66 -0
- package/dist/core/mcp-call-meta.js +103 -0
- package/dist/core/mcp-connection-pool.d.ts +3 -1
- package/dist/core/mcp-connection-pool.js +3 -1
- package/dist/core/mcp-failure.d.ts +117 -15
- package/dist/core/mcp-failure.js +71 -3
- package/dist/core/mcp-probe.d.ts +4 -0
- package/dist/core/mcp-probe.js +1 -1
- package/dist/core/mcp-server-link.d.ts +27 -3
- package/dist/core/mcp-server-link.js +25 -1
- package/dist/core/mcp-server-spec.d.ts +46 -18
- package/dist/core/mcp-server-spec.js +1 -18
- package/dist/core/mcp.d.ts +16 -20
- package/dist/core/mcp.js +112 -55
- package/dist/core/memory-engine/consolidation-driver.d.ts +2 -4
- package/dist/core/memory-engine/consolidation-driver.js +3 -3
- package/dist/core/memory-engine/consolidation.d.ts +4 -0
- package/dist/core/memory-engine/consolidation.js +1 -0
- package/dist/core/memory-engine/delegation-settlement.js +5 -12
- package/dist/core/memory-engine/distiller.js +2 -2
- package/dist/core/memory-engine/dual-root.d.ts +50 -1
- package/dist/core/memory-engine/dual-root.js +44 -1
- package/dist/core/memory-engine/engine.d.ts +67 -14
- package/dist/core/memory-engine/engine.js +384 -212
- package/dist/core/memory-engine/export-bundle.d.ts +23 -0
- package/dist/core/memory-engine/export-bundle.js +23 -4
- package/dist/core/memory-engine/file-backend.d.ts +128 -55
- package/dist/core/memory-engine/file-backend.js +290 -117
- package/dist/core/memory-engine/index.d.ts +1 -1
- package/dist/core/memory-engine/layout.d.ts +59 -11
- package/dist/core/memory-engine/layout.js +190 -40
- package/dist/core/memory-engine/memory-backend-contract.d.ts +1 -1
- package/dist/core/memory-engine/memory-backend-contract.js +39 -2
- package/dist/core/memory-engine/scope-contract.d.ts +45 -4
- package/dist/core/memory-engine/scope-contract.js +80 -11
- package/dist/core/memory-engine/sync-client.d.ts +9 -1
- package/dist/core/memory-engine/sync-client.js +31 -8
- package/dist/core/memory-engine/sync.d.ts +5 -0
- package/dist/core/memory-engine/types.d.ts +6 -0
- package/dist/core/mode-policy.d.ts +8 -5
- package/dist/core/mode-policy.js +5 -4
- package/dist/core/mods/classic-events.d.ts +5 -1
- package/dist/core/mods/host.js +1 -1
- package/dist/core/mods/kernel/dispatch.d.ts +3 -0
- package/dist/core/mods/kernel/dispatch.js +12 -9
- package/dist/core/mods/kernel/events.d.ts +6 -1
- package/dist/core/mods/kernel/events.js +2 -2
- package/dist/core/mods/kernel/registration.d.ts +9 -1
- package/dist/core/mods/kernel/registration.js +3 -0
- package/dist/core/mods/kernel/site-rules.d.ts +3 -0
- package/dist/core/mods/kernel/site-rules.js +10 -0
- package/dist/core/mods/package.d.ts +23 -0
- package/dist/core/mods/package.js +118 -0
- package/dist/core/mods/stations.d.ts +33 -12
- package/dist/core/mods/stations.js +45 -11
- package/dist/core/mods/tool-call.d.ts +5 -1
- package/dist/core/mods/tool-call.js +13 -4
- package/dist/core/parent-spec-seat.d.ts +8 -3
- package/dist/core/parent-spec-seat.js +2 -0
- package/dist/core/park-selfcheck.js +6 -0
- package/dist/core/path-guard-rows.d.ts +20 -0
- package/dist/core/path-guard-rows.js +11 -0
- package/dist/core/peer-seat.d.ts +248 -0
- package/dist/core/peer-seat.js +439 -0
- package/dist/core/permission-rule-consent.js +10 -4
- package/dist/core/permission-rule-model.d.ts +16 -0
- package/dist/core/permission-rule-model.js +1 -1
- package/dist/core/present-plan-tool.d.ts +20 -3
- package/dist/core/present-plan-tool.js +48 -4
- package/dist/core/protocol-http-auth.d.ts +40 -29
- package/dist/core/protocol-http-auth.js +30 -32
- package/dist/core/redaction-marks.d.ts +16 -0
- package/dist/core/redaction-marks.js +16 -0
- package/dist/core/redaction-passes.js +8 -9
- package/dist/core/resume-startup-cause.js +1 -0
- package/dist/core/retention.d.ts +41 -15
- package/dist/core/retention.js +59 -12
- package/dist/core/rewrite-rejudge.d.ts +38 -0
- package/dist/core/rewrite-rejudge.js +42 -2
- package/dist/core/roles.d.ts +34 -2
- package/dist/core/roles.js +43 -4
- package/dist/core/run-origin.d.ts +40 -0
- package/dist/core/run-origin.js +37 -0
- package/dist/core/runner/advertised-writable-dirs.d.ts +57 -38
- package/dist/core/runner/advertised-writable-dirs.js +126 -0
- package/dist/core/runner/announce-once-ledger.d.ts +5 -4
- package/dist/core/runner/announce-once-ledger.js +4 -2
- package/dist/core/runner/call-hook-stations.js +2 -2
- package/dist/core/runner/compaction-restate.d.ts +15 -6
- package/dist/core/runner/compaction-restate.js +28 -2
- package/dist/core/runner/contracts.d.ts +33 -21
- package/dist/core/runner/credential-origin-seat.js +4 -3
- package/dist/core/runner/cwd-alignment-probe.d.ts +20 -0
- package/dist/core/runner/cwd-alignment-probe.js +21 -0
- package/dist/core/runner/decide-continuation.d.ts +2 -2
- package/dist/core/runner/gate-exit.d.ts +30 -8
- package/dist/core/runner/gate-exit.js +15 -8
- package/dist/core/runner/image-removed-seat.d.ts +12 -0
- package/dist/core/runner/image-removed-seat.js +19 -0
- package/dist/core/runner/inline-image.js +1 -1
- package/dist/core/runner/memory-consolidation-driver.js +3 -3
- package/dist/core/runner/park-commit.d.ts +1 -1
- package/dist/core/runner/park-commit.js +3 -0
- package/dist/core/runner/prepare-ask-lane.d.ts +1 -1
- package/dist/core/runner/prepare-ask-lane.js +2 -1
- package/dist/core/runner/prepare-boundary-parks.js +2 -2
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +5 -5
- package/dist/core/runner/prepare-caps-and-workflow.js +3 -1
- package/dist/core/runner/prepare-config-doors.d.ts +8 -5
- package/dist/core/runner/prepare-config-doors.js +14 -10
- package/dist/core/runner/prepare-context-lane.js +2 -0
- package/dist/core/runner/prepare-delegation-surface.d.ts +8 -0
- package/dist/core/runner/prepare-delegation-surface.js +16 -18
- package/dist/core/runner/prepare-gate-stations.js +1 -1
- package/dist/core/runner/prepare-hands-readface.d.ts +11 -3
- package/dist/core/runner/prepare-hands-readface.js +9 -1
- package/dist/core/runner/prepare-inherited-gate.d.ts +1 -3
- package/dist/core/runner/prepare-inherited-gate.js +14 -27
- package/dist/core/runner/prepare-memory.d.ts +3 -0
- package/dist/core/runner/prepare-memory.js +26 -37
- package/dist/core/runner/prepare-park-ask.d.ts +1 -1
- package/dist/core/runner/prepare-park-ask.js +2 -1
- package/dist/core/runner/prepare-policy-chain.d.ts +7 -7
- package/dist/core/runner/prepare-policy-chain.js +18 -15
- package/dist/core/runner/prepare-project-context.d.ts +2 -2
- package/dist/core/runner/prepare-project-context.js +2 -2
- package/dist/core/runner/prepare-prompt-inputs.d.ts +1 -1
- package/dist/core/runner/prepare-prompt-inputs.js +8 -19
- package/dist/core/runner/prepare-protocol-tools.d.ts +4 -2
- package/dist/core/runner/prepare-protocol-tools.js +11 -3
- package/dist/core/runner/prepare-run-refs.d.ts +2 -3
- package/dist/core/runner/prepare-run-refs.js +4 -1
- package/dist/core/runner/prepare-suspend-saga.d.ts +2 -0
- package/dist/core/runner/prepare-suspend-saga.js +2 -1
- package/dist/core/runner/prepare-task.js +28 -13
- package/dist/core/runner/prepare-wiring-manifest.d.ts +2 -1
- package/dist/core/runner/prepare-wiring-manifest.js +4 -3
- package/dist/core/runner/prepare-workspace-restore.d.ts +3 -0
- package/dist/core/runner/prepare-workspace-restore.js +4 -4
- package/dist/core/runner/reply-pricing.d.ts +30 -0
- package/dist/core/runner/reply-pricing.js +19 -0
- package/dist/core/runner/resume-admission.js +5 -3
- package/dist/core/runner/resume-apply.js +6 -1
- package/dist/core/runner/resume-checkpoint-screen.js +2 -0
- package/dist/core/runner/resume-policy-outcome.js +5 -5
- package/dist/core/runner/role-seat-defaulted.d.ts +44 -0
- package/dist/core/runner/role-seat-defaulted.js +40 -0
- package/dist/core/runner/run-brain-sinks.js +2 -0
- package/dist/core/runner/run-harness-handlers.d.ts +3 -4
- package/dist/core/runner/run-harness-handlers.js +1 -8
- package/dist/core/runner/run-identity-wiring.d.ts +2 -5
- package/dist/core/runner/run-identity-wiring.js +6 -4
- package/dist/core/runner/run-leg.d.ts +2 -0
- package/dist/core/runner/run-leg.js +42 -29
- package/dist/core/runner/run-notification-lane.js +3 -0
- package/dist/core/runner/run-stop-and-final-verify.js +2 -2
- package/dist/core/runner/run-terminal-adoption.d.ts +2 -5
- package/dist/core/runner/run-terminal-adoption.js +9 -3
- package/dist/core/runner/run-turn-boundary.js +77 -70
- package/dist/core/runner/runtask.d.ts +1 -1
- package/dist/core/runner/runtask.js +2 -2
- package/dist/core/runner/side-call-account.d.ts +1 -1
- package/dist/core/runner/side-call-account.js +3 -18
- package/dist/core/runner/sub-agent-deny-lists.d.ts +24 -0
- package/dist/core/runner/sub-agent-deny-lists.js +10 -0
- package/dist/core/runner/terminal-account.js +3 -3
- package/dist/core/runner/tool-end-body.js +2 -1
- package/dist/core/runner/tool-occurrence.d.ts +5 -2
- package/dist/core/runner/tool-occurrence.js +4 -3
- package/dist/core/runner/turn-attachments.d.ts +26 -22
- package/dist/core/runner/turn-attachments.js +24 -26
- package/dist/core/runner/write-protection-station.d.ts +8 -2
- package/dist/core/runner/write-protection-station.js +2 -0
- package/dist/core/runner-deps.d.ts +3 -3
- package/dist/core/secret-env.d.ts +32 -2
- package/dist/core/secret-env.js +65 -3
- package/dist/core/sensitive-path-policy.js +9 -10
- package/dist/core/session-log-transfer.d.ts +24 -0
- package/dist/core/session-log-transfer.js +166 -0
- package/dist/core/session-policy-store.d.ts +3 -1
- package/dist/core/session-policy-store.js +13 -9
- package/dist/core/session-store.d.ts +86 -24
- package/dist/core/session-store.js +162 -24
- package/dist/core/session.d.ts +92 -1
- package/dist/core/shell-read-silence.js +1 -0
- package/dist/core/side-query.d.ts +11 -1
- package/dist/core/side-query.js +9 -0
- package/dist/core/skill-grant-binding.d.ts +31 -2
- package/dist/core/skill-grant-binding.js +31 -1
- package/dist/core/skill-grant.d.ts +8 -5
- package/dist/core/skill-grant.js +6 -6
- package/dist/core/steer-replay.d.ts +4 -2
- package/dist/core/steer-replay.js +2 -1
- package/dist/core/store-contracts/background-agent-store-contract.js +27 -0
- package/dist/core/store-contracts/checkpoint-store-contract.js +20 -2
- package/dist/core/store-contracts/mailbox-store-contract.js +31 -1
- package/dist/core/store-contracts/session-repo-contract.js +112 -5
- package/dist/core/store-contracts/session-store-contract.d.ts +4 -1
- package/dist/core/store-contracts/session-store-contract.js +236 -2
- package/dist/core/synthetic-read-verdict.js +2 -1
- package/dist/core/task-event.d.ts +92 -8
- package/dist/core/task-notification.js +16 -10
- package/dist/core/task-registry-agent.js +1 -0
- package/dist/core/task-registry-shared.d.ts +7 -1
- package/dist/core/task-spec.d.ts +49 -1
- package/dist/core/task-stream.d.ts +2 -1
- package/dist/core/terminal-cause.d.ts +11 -1
- package/dist/core/tool-catalog-entries.js +1 -0
- package/dist/core/tool-check-reading.d.ts +1 -0
- package/dist/core/tool-check-reading.js +3 -3
- package/dist/core/tool-policy.d.ts +16 -0
- package/dist/core/tool-result-store.d.ts +17 -10
- package/dist/core/tool-result-store.js +3 -1
- package/dist/core/tool-roster.d.ts +112 -5
- package/dist/core/tool-roster.js +42 -1
- package/dist/core/tool-spec.d.ts +3 -1
- package/dist/core/types.d.ts +3 -3
- package/dist/core/types.js +1 -1
- package/dist/core/untrusted-egress.d.ts +0 -2
- package/dist/core/untrusted-egress.js +10 -14
- package/dist/core/user-attachment.js +1 -1
- package/dist/core/wiring-manifest.d.ts +18 -6
- package/dist/core/wiring-manifest.js +4 -3
- package/dist/core/workspace-snapshot.d.ts +44 -0
- package/dist/core/workspace-snapshot.js +34 -0
- package/dist/core/write-protect.d.ts +43 -3
- package/dist/core/write-protect.js +43 -16
- package/dist/engine/compaction/compaction.js +29 -3
- package/dist/engine/execution-env/node-execution-env.d.ts +4 -3
- package/dist/engine/execution-env/node-execution-env.js +24 -23
- package/dist/engine/execution-env/symlink-chain.d.ts +7 -5
- package/dist/engine/harness/agent-harness.d.ts +30 -2
- package/dist/engine/harness/agent-harness.js +43 -12
- package/dist/engine/harness/messages.d.ts +3 -1
- package/dist/engine/harness/messages.js +3 -2
- package/dist/engine/harness/types.d.ts +56 -7
- package/dist/engine/harness/types.js +5 -1
- package/dist/engine/llm/rejected-images.d.ts +46 -0
- package/dist/engine/llm/rejected-images.js +54 -0
- package/dist/engine/llm/tool-turns.d.ts +2 -1
- package/dist/engine/llm/types.d.ts +30 -10
- package/dist/engine/llm/types.js +1 -1
- package/dist/engine/loop/agent-loop.d.ts +8 -0
- package/dist/engine/loop/agent-loop.js +52 -15
- package/dist/engine/loop/types.d.ts +3 -1
- package/dist/engine/session/import-validate.js +3 -0
- package/dist/engine/session/memory-repo.d.ts +17 -9
- package/dist/engine/session/memory-repo.js +44 -34
- package/dist/engine/session/path-to-root.d.ts +38 -0
- package/dist/engine/session/path-to-root.js +39 -0
- package/dist/engine/session/repo-utils.d.ts +22 -4
- package/dist/engine/session/repo-utils.js +49 -1
- package/dist/engine/session/storage-base.d.ts +10 -1
- package/dist/engine/session/storage-base.js +11 -22
- package/dist/index.d.ts +29 -16
- package/dist/index.js +21 -11
- package/dist/internal/harness-types.d.ts +2 -2
- package/dist/internal/harness.d.ts +3 -2
- package/dist/internal/harness.js +2 -2
- package/dist/internal/llm.d.ts +1 -0
- package/dist/orchestration/workflow-observe.d.ts +17 -1
- package/dist/orchestration/workflow-observe.js +20 -0
- package/dist/orchestration/workflow-types.d.ts +32 -7
- package/dist/orchestration/workflow.js +739 -489
- package/dist/shell/counting-pass.d.ts +50 -0
- package/dist/shell/counting-pass.js +502 -0
- package/dist/shell/lex.d.ts +4 -2
- package/dist/shell/lex.js +93 -34
- package/dist/shell/shell-words.d.ts +1 -1
- package/dist/shell/shell-words.js +7 -6
- package/dist/stores/file/index.d.ts +4 -1
- package/dist/stores/file/index.js +4 -1
- package/dist/stores/file/mailbox-store.js +6 -10
- package/dist/stores/file/session-store.d.ts +15 -8
- package/dist/stores/file/session-store.js +28 -13
- package/dist/tools/fs/fs-bash.d.ts +6 -0
- package/dist/tools/fs/fs-bash.js +6 -3
- package/dist/tools/fs/fs-write.d.ts +6 -3
- package/dist/tools/fs/fs-write.js +8 -7
- package/dist/tools/fs/index.d.ts +3 -0
- package/dist/tools/fs/index.js +7 -3
- package/dist/tools/fs/program-read-model.d.ts +13 -0
- package/dist/tools/fs/program-read-model.js +15 -0
- package/dist/tools/fs/program-read-model.rows.js +1 -1
- package/dist/tools/fs/read-deny.d.ts +13 -10
- package/dist/tools/fs/read-deny.js +25 -5
- package/dist/tools/fs/read-floor.d.ts +19 -0
- package/dist/tools/fs/read-floor.js +23 -0
- package/dist/tools/fs/safety.js +40 -8
- package/dist/tools/fs/search.js +6 -24
- package/dist/tools/fs/shell-read-check.d.ts +9 -2
- package/dist/tools/fs/shell-read-check.js +61 -16
- package/dist/tools/fs/shell-read-establish.js +2 -1
- package/dist/tools/fs/shell-read-identity.js +1 -1
- package/dist/tools/fs/shell-read-judge.d.ts +26 -9
- package/dist/tools/fs/shell-read-judge.js +10 -6
- package/dist/tools/fs/shell-read-plan.d.ts +6 -1
- package/dist/tools/fs/shell-read-plan.js +22 -15
- package/dist/tools/fs/shell-read-start.js +1 -0
- package/dist/tools/fs/shell-reentry-text.d.ts +15 -1
- package/dist/tools/fs/shell-reentry-text.js +25 -3
- package/dist/tools/monitor.d.ts +4 -0
- package/dist/tools/monitor.js +2 -0
- package/dist/tools/worktree.d.ts +42 -15
- package/dist/tools/worktree.js +60 -32
- package/package.json +5 -2
- package/test/export-surface.snapshot.json +149 -1
- package/wire-changes/core-stores-sql@7.58.0.json +29 -0
- package/wire-changes/core-stores-sql@7.59.0.json +29 -0
- package/wire-changes/core@7.58.0.json +2188 -0
- package/wire-changes/core@7.59.0.json +2459 -0
- package/wire-changes/mods-kernel@7.58.0.json +81 -0
- package/wire-changes/mods-kernel@7.59.0.json +29 -0
- package/wire-changes/primitives@7.58.0.json +29 -0
- package/wire-changes/primitives@7.59.0.json +29 -0
- package/dist/primitives/credential-ref.d.ts +0 -89
- package/dist/primitives/credential-ref.js +0 -125
- package/dist/primitives/index.d.ts +0 -2
- package/dist/primitives/index.js +0 -1
|
@@ -141,6 +141,16 @@ export type TerminalCause = {
|
|
|
141
141
|
* Absent on pre-identity checkpoints.
|
|
142
142
|
*/
|
|
143
143
|
checkpointId?: string;
|
|
144
|
+
/**
|
|
145
|
+
* The id of the tool call that asked for this plan_review pause — the call that PRESENTED the plan (the
|
|
146
|
+
* `ExitPlanMode` call for the first-party plan tool), so a card can join the pause to that call by id instead of
|
|
147
|
+
* by adjacency. PRESENT only on a `plan_review` pause whose requester carried a call id; ABSENT on every other
|
|
148
|
+
* pause and on a plan_review pause whose requester had none (a row a deployment minted itself, a revive context). It
|
|
149
|
+
* is provenance, not a binding: the pause gates no call, so no `tool_approval` field rides beside it, and the
|
|
150
|
+
* resume never reads it. Echo of the committed row's {@link import("./checkpoint-store.js").PendingAction}
|
|
151
|
+
* `plan_review.requestedByCallId` — one write, at the park mint.
|
|
152
|
+
*/
|
|
153
|
+
requestedByCallId?: string;
|
|
144
154
|
/**
|
|
145
155
|
* HOW the paused task's remote workspace will come back, present whenever the pause captured a
|
|
146
156
|
* remote workspace. The two modes bill and behave very differently:
|
|
@@ -210,7 +220,7 @@ export type TerminalFailureDetail = {
|
|
|
210
220
|
* The thrown error's own `detail`, as its throw site stated it — a snapshot of its JSON-plain members (strings,
|
|
211
221
|
* finite numbers, booleans, null, and arrays / plain objects of those, bounded; a member of any other kind is left
|
|
212
222
|
* out; bytes — an `ArrayBuffer` view, an index-keyed object — are never a record). A member under a credential
|
|
213
|
-
* name (the env-credential judge's names: `password`, `apiKey`, `token` …) stands as `
|
|
223
|
+
* name (the env-credential judge's names: `password`, `apiKey`, `token` …) stands as the redaction mark (`REDACTION_MARK`), unread; every
|
|
214
224
|
* other string leaf passes the secret-tier redaction (credential shapes masked; a path is kept — it rides this
|
|
215
225
|
* structured seat, never `message`); a member whose key is not JSON-safe (visible ASCII 1–128, nothing the
|
|
216
226
|
* redaction would mask) is left out. Read off the same link of the error's `cause` chain whose `code` became
|
|
@@ -139,6 +139,7 @@ export const TOOL_CATALOG_ENTRIES = [
|
|
|
139
139
|
{ id: "advisor", name: "advisor", source: "builtin", definedIn: "src/core/runner/advisor-tool.ts", mountedBy: ["optional"], cards: ["advisor"], face: { family: "scaffold", boundaryLegs: [], effect: "read", contentOrigin: "local", contract: c("core.advisor@1"), offload: false, budgetExempt: true, ruleFace: { params: [] } } },
|
|
140
140
|
{ id: "ask-user-question", name: "AskUserQuestion", source: "builtin", definedIn: "src/core/ask-question.ts", mountedBy: ["optional"], cards: ["ask-question"], face: { family: "other", boundaryLegs: [], effect: "read", contract: c("core.ask_user_question@1"), renderHints: { approvalCard: "question" }, ruleFace: { params: [] } } },
|
|
141
141
|
{ id: "exit-plan-mode", name: "ExitPlanMode", source: "builtin", definedIn: "src/core/present-plan-tool.ts", mountedBy: ["optional"], cards: ["exit-plan-mode"], face: { family: "plan", boundaryLegs: [], effect: "read", contract: c("core.exit_plan_mode@1"), renderHints: { userFacingName: "", approvalCard: "plan" }, ruleFace: { params: ["plan"] } } },
|
|
142
|
+
{ id: "exit-plan-mode-file", name: "ExitPlanMode", source: "builtin", definedIn: "src/core/present-plan-tool.ts", mountedBy: ["optional"], cards: ["exit-plan-mode"], face: { family: "plan", boundaryLegs: [], effect: "read", contract: c("core.exit_plan_mode_file@1"), renderHints: { userFacingName: "", approvalCard: "plan" }, ruleFace: { params: [] } } },
|
|
142
143
|
{ id: "enter-plan-mode", name: "EnterPlanMode", source: "builtin", definedIn: "src/core/present-plan-tool.ts", mountedBy: ["optional"], cards: ["enter-plan-mode"], face: { family: "plan", boundaryLegs: [], effect: "read", contract: c("core.enter_plan_mode@1"), ruleFace: { params: [] } } },
|
|
143
144
|
{ id: "refresh-mcp-tools", name: REFRESH_MCP_TOOLS_TOOL_NAME, source: "builtin", definedIn: "src/core/runner/prepare-protocol-tools.ts", mountedBy: ["optional"], cards: [], face: { family: "protocol", boundaryLegs: ["outside_read"], effect: "read", ruleFace: { params: ["server"] } } },
|
|
144
145
|
{ id: "memory-search", name: "memory_search", source: "builtin", definedIn: "src/core/memory-engine/tools.ts", mountedBy: ["memory"], cards: [], face: { family: "memory", boundaryLegs: [], effect: "read", contentOrigin: "local", contract: c("core.memory_search@1", "7"), offload: false, ruleFace: { params: ["query", "limit", "includeSuperseded", "includeShadowed"] } } },
|
|
@@ -5,17 +5,17 @@ import { failedHandlerClause } from "./mods/stations.js";
|
|
|
5
5
|
const STANDS = Object.freeze({ kind: "stands" });
|
|
6
6
|
function readToolCheck(heard, standing, call, mayClear) {
|
|
7
7
|
const { toolName } = call;
|
|
8
|
-
const refused = (message) => ({ kind: "denied", deny: refusalOf({ action: "deny", message, decisionReason: "hook" }, call.judged) });
|
|
8
|
+
const refused = (message, by) => ({ kind: "denied", deny: refusalOf({ action: "deny", message, decisionReason: "hook" }, call.judged), ...(by !== undefined ? { by } : {}) });
|
|
9
9
|
if (heard.kind === "aborted")
|
|
10
10
|
return refused(`the task was cancelled while a tool.check handler was still checking this call to "${toolName}"; the call was NOT executed (fail-closed)`);
|
|
11
11
|
if (heard.kind === "failed")
|
|
12
|
-
return refused(`a tool.check handler ${failedHandlerClause(heard)} while checking this call to "${toolName}"; the call was NOT executed (fail-closed)
|
|
12
|
+
return refused(`a tool.check handler ${failedHandlerClause(heard)} while checking this call to "${toolName}"; the call was NOT executed (fail-closed)`, heard.registration);
|
|
13
13
|
if (heard.by === undefined && heard.decision === standing.action)
|
|
14
14
|
return STANDS;
|
|
15
15
|
const { who, why } = speakerOf(heard);
|
|
16
16
|
const rewritten = call.rewrite !== undefined ? { updatedInput: call.rewrite } : {};
|
|
17
17
|
if (heard.decision === "deny")
|
|
18
|
-
return refused(`tool "${toolName}" denied by ${who}${why}
|
|
18
|
+
return refused(`tool "${toolName}" denied by ${who}${why}`, heard.by);
|
|
19
19
|
if (heard.decision === "ask") {
|
|
20
20
|
return standing.action === "ask"
|
|
21
21
|
? { kind: "asked", ask: { ...standing, decisionReason: "hook", ...(heard.reason !== undefined ? { message: heard.reason } : {}) }, minted: false }
|
|
@@ -158,6 +158,22 @@ export interface ToolCallRequest {
|
|
|
158
158
|
* Read-only.
|
|
159
159
|
*/
|
|
160
160
|
approvalReach?: import("./wiring-manifest.js").ApprovalReach;
|
|
161
|
+
/**
|
|
162
|
+
* What answering this call grants beyond the call — the binding words every card of the call carries ({@link AskRequest.boundGrantDigest} /
|
|
163
|
+
* {@link AskRequest.boundGrants} / {@link AskRequest.boundGrantAbsence}), minted by the same factory over THIS request's `args`: a call to the
|
|
164
|
+
* engine's `Skill` tool on a leg that loads skills carries the digest and the value it hashes, every other call `not_bindable`. Exactly one
|
|
165
|
+
* arm on every request a Runner hands a policy (the gate's adjudication, the resume belt, the park's stored-shape re-check, the pre-claim
|
|
166
|
+
* edit re-check, the synthetic probes, and every copy a policy fold makes over moved args — the copy carries the answer for ITS args);
|
|
167
|
+
* absent on a bare request (a host driving a policy outside a Runner), which a reader takes as a binding it cannot read. `unreadable` on a
|
|
168
|
+
* request = it binds a grant and what it binds over these args cannot be read here (a copy over moved args whose digest the engine did
|
|
169
|
+
* not mint for this call — `withArgsBinding`). A policy that keeps an answer by tool name reads these words, never the tool name.
|
|
170
|
+
* Read-only metadata: no engine judgment reads them (a parked approval is judged by its row's digest).
|
|
171
|
+
*/
|
|
172
|
+
boundGrantDigest?: string;
|
|
173
|
+
/** The value {@link boundGrantDigest} hashes; same presence (see there). Deployment text — render with contextual escaping. */
|
|
174
|
+
boundGrants?: import("./skill-grant-binding.js").BoundSkillGrants;
|
|
175
|
+
/** Why this request carries no {@link boundGrantDigest} — the closed set `BOUND_GRANT_ABSENCES` (see there). */
|
|
176
|
+
boundGrantAbsence?: import("./skill-grant-binding.js").BoundGrantAbsence;
|
|
161
177
|
/**
|
|
162
178
|
* design/80 D-E-core: read-only per-run budget snapshot so a STATELESS policy can self-limit against
|
|
163
179
|
* state that survives suspend/resume (a fresh in-memory counter would reset every leg — the supervisor
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentTool } from "../internal/harness-types.js";
|
|
2
|
+
import { type RetentionDeclaration } from "./retention.js";
|
|
2
3
|
/**
|
|
3
4
|
* Pluggable backing store for **offloaded large tool results** (design/30). When a tool returns more
|
|
4
5
|
* text than the threshold, the full content is moved here and the conversation keeps only a preview +
|
|
@@ -12,13 +13,14 @@ import type { AgentTool } from "../internal/harness-types.js";
|
|
|
12
13
|
*/
|
|
13
14
|
export interface ToolResultStore {
|
|
14
15
|
/**
|
|
15
|
-
* Managed-retention declaration (
|
|
16
|
-
* `ManagedRetentionCapability`
|
|
17
|
-
* ABSENT — read fail-closed as `"none"`)
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* Managed-retention declaration (retention.ts): `"managed"` says this store's rows are deleted on
|
|
17
|
+
* schedule by the deployment (a `ManagedRetentionCapability` executor — scheduled, tenant-scoped,
|
|
18
|
+
* audited deletion — runs over them); `"none"` (or ABSENT — read fail-closed as `"none"`) says
|
|
19
|
+
* nothing deletes them on schedule. The party that runs the sweep states it when it constructs the
|
|
20
|
+
* store. A deployment with a LOCKED retention policy refuses to start over a `"none"` store.
|
|
21
|
+
* Declaration, never duck-typing.
|
|
20
22
|
*/
|
|
21
|
-
readonly retention?:
|
|
23
|
+
readonly retention?: RetentionDeclaration;
|
|
22
24
|
/**
|
|
23
25
|
* Persist full content under a stable `ref`. **Write-once and idempotent**: if `ref` already exists,
|
|
24
26
|
* keep the existing content and do nothing (the aggregate budget re-runs every query with the same
|
|
@@ -110,8 +112,9 @@ export interface ToolResultStore {
|
|
|
110
112
|
* callback (a checkable fact, not a failure). Present ⇒ the store can complete a session
|
|
111
113
|
* deletion; absent ⇒ the deployment owns that gap.
|
|
112
114
|
*
|
|
113
|
-
* Implementing it does NOT make a store `retention: "managed"` — that declaration
|
|
114
|
-
*
|
|
115
|
+
* Implementing it does NOT make a store `retention: "managed"` — that declaration says the
|
|
116
|
+
* deployment deletes this store's rows on schedule through a whole
|
|
117
|
+
* {@link import("./retention.js").ManagedRetentionCapability} executor (domain enumeration, tombstones,
|
|
115
118
|
* audit receipts, scheduled execution), of which this is one caller-driven erase.
|
|
116
119
|
*/
|
|
117
120
|
deleteBySession?(sessionId: string): Promise<ToolResultDeletionReport> | ToolResultDeletionReport;
|
|
@@ -318,14 +321,18 @@ export interface ToolResultSlice {
|
|
|
318
321
|
* store (e.g. FileToolResultStore) via `RunnerDeps.toolResultStore`. */
|
|
319
322
|
export declare class InMemoryToolResultStore implements ToolResultStore {
|
|
320
323
|
private readonly opts?;
|
|
321
|
-
/**
|
|
322
|
-
|
|
324
|
+
/** Managed-retention declaration (retention.ts): whether this store's rows are deleted on schedule by the deployment — given by
|
|
325
|
+
* the party that runs the sweep (the `retention` option), `"none"` when none is given; the store itself is put/get only. */
|
|
326
|
+
readonly retention: RetentionDeclaration;
|
|
323
327
|
/** The entry is content AND owner as ONE value — the write-once election that decides the
|
|
324
328
|
* content decides the owner in the same step (no window where an entry exists ownerless). */
|
|
325
329
|
private readonly map;
|
|
326
330
|
private totalChars;
|
|
331
|
+
/** @param opts.retention the store's managed-retention declaration, default `"none"`; a word other than the two is refused
|
|
332
|
+
* (`config.retention_capability`). */
|
|
327
333
|
constructor(opts?: {
|
|
328
334
|
maxTotalChars?: number;
|
|
335
|
+
retention?: RetentionDeclaration;
|
|
329
336
|
} | undefined);
|
|
330
337
|
put(ref: string, content: string, provenance?: ToolResultProvenance): void;
|
|
331
338
|
/** The owner recorded at the winning write; `undefined` for unknown AND for unowned entries,
|
|
@@ -6,6 +6,7 @@ import { deliverEngineNotice } from "./types.js";
|
|
|
6
6
|
import { TOOL_SEARCH_NAME } from "./runner/tool-disclosure.js";
|
|
7
7
|
import { mountRuleFace, toolFace } from "./tool-catalog-entries.js";
|
|
8
8
|
import { thrownText } from "./thrown-value.js";
|
|
9
|
+
import { readRetentionDeclaration } from "./retention.js";
|
|
9
10
|
import { carryNotStartedReceipt } from "./delegation-not-started.js";
|
|
10
11
|
export const TOOL_RESULT_REF_CONFLICT_CODE = "tool_result.ref_conflict";
|
|
11
12
|
export class ToolResultRefConflictError extends Error {
|
|
@@ -67,11 +68,12 @@ function digestOfString(s) {
|
|
|
67
68
|
}
|
|
68
69
|
export class InMemoryToolResultStore {
|
|
69
70
|
opts;
|
|
70
|
-
retention
|
|
71
|
+
retention;
|
|
71
72
|
map = new Map();
|
|
72
73
|
totalChars = 0;
|
|
73
74
|
constructor(opts) {
|
|
74
75
|
this.opts = opts;
|
|
76
|
+
this.retention = readRetentionDeclaration("InMemoryToolResultStore.retention", opts?.retention);
|
|
75
77
|
const cap = opts?.maxTotalChars;
|
|
76
78
|
if (cap !== undefined && Number.isNaN(cap)) {
|
|
77
79
|
throw new Error("InMemoryToolResultStore: maxTotalChars must be a number (got NaN) — omit it for an unbounded store");
|
|
@@ -316,7 +316,7 @@ export declare function approvalCardMemberOf(call: {
|
|
|
316
316
|
export declare function toolCallFaceOf(roster: ToolRoster | undefined, toolName: string): import("./tool-policy.js").ToolCallFace | undefined;
|
|
317
317
|
/** design/388 B18 — the identity members a park row carries (the tool member of its approval object,
|
|
318
318
|
* `approval-object.ts`), read off a roster snapshot by name; an empty object when the name is not on the snapshot
|
|
319
|
-
* (the row then
|
|
319
|
+
* (the row then carries no tool member, and the claim refuses its approval: no tool is bound by a name alone). */
|
|
320
320
|
export declare function parkedToolIdentity(roster: ToolRoster | undefined, toolName: string): Partial<ToolIdentity>;
|
|
321
321
|
/** design/388 B6 × B18 — the FACE members a park row carries beside its identity: the display family, the declared
|
|
322
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
|
|
@@ -325,8 +325,8 @@ export declare function parkedToolIdentity(roster: ToolRoster | undefined, toolN
|
|
|
325
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
326
|
* can write. A recheck that runs before the leg's roster exists (the pre-CAS resume-edit
|
|
327
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
|
|
329
|
-
*
|
|
328
|
+
* recorded (identity, family, targets, names, mount site) — not the live face's rule name values or approval card. An empty object
|
|
329
|
+
* when the name is not on the snapshot (no tool member: the claim refuses the row's approval before any recheck). */
|
|
330
330
|
export declare function parkedToolFace(roster: ToolRoster | undefined, req: {
|
|
331
331
|
readonly toolName: string;
|
|
332
332
|
readonly face?: {
|
|
@@ -337,6 +337,7 @@ export declare function parkedToolFace(roster: ToolRoster | undefined, req: {
|
|
|
337
337
|
pathTarget?: ToolRosterEntry["pathTarget"];
|
|
338
338
|
hostTarget?: ToolHostTarget;
|
|
339
339
|
names?: readonly string[];
|
|
340
|
+
declarationDigest?: string;
|
|
340
341
|
engineMounted?: true;
|
|
341
342
|
};
|
|
342
343
|
/** The live face a resumed park row is re-judged under: minted under the row's recorded spelling (`names[0]`) when that
|
|
@@ -347,8 +348,8 @@ export declare function parkedRowLiveFace(roster: ToolRoster | undefined, row: {
|
|
|
347
348
|
readonly names?: readonly string[];
|
|
348
349
|
}): import("./tool-policy.js").ToolCallFace | undefined;
|
|
349
350
|
/** The call face a park row carries — present iff the row was minted with BOTH its face members and its four
|
|
350
|
-
* identity members (one mint writes all of them; a row missing any
|
|
351
|
-
*
|
|
351
|
+
* identity members (one mint writes all of them; a row missing any yields undefined, never a partial face, and its
|
|
352
|
+
* approval is refused at the claim before any recheck reads it). This is the face every recheck of the row judges under, roster or no roster. */
|
|
352
353
|
export declare function parkedCallFaceOf(pending: {
|
|
353
354
|
family?: ToolFamily;
|
|
354
355
|
pathTarget?: ToolRosterPathTarget;
|
|
@@ -372,6 +373,112 @@ export interface ToolIdentity {
|
|
|
372
373
|
implementationRevision: string;
|
|
373
374
|
}
|
|
374
375
|
export declare function toolIdentityOf(entry: ToolRosterEntry): ToolIdentity;
|
|
376
|
+
/** How a parked approval binds one member of the roster row it was asked under: `identity` (the row member that carries it —
|
|
377
|
+
* a live row that differs is another tool, the row reopens), `face` (carried by value — a face that differs vetoes the call),
|
|
378
|
+
* `declaration` (hashed into the row's `declarationDigest` — a declaration that differs vetoes the call), or `unbound` (why the
|
|
379
|
+
* approval does not cover it). */
|
|
380
|
+
export type RosterApprovalBinding = {
|
|
381
|
+
readonly identity: readonly (keyof ToolIdentity | "engineMounted")[];
|
|
382
|
+
} | "face" | "declaration" | {
|
|
383
|
+
readonly unbound: string;
|
|
384
|
+
};
|
|
385
|
+
/** THE classification of every roster member for the approval of a parked call (#639 / #2345): typed over every key of the row,
|
|
386
|
+
* so a member added to the row is a compile error here until it is classified, and two fences hold the approval object's judge
|
|
387
|
+
* to it (`approval-object.ts`: the identity carriers and the face members it compares are exactly the table's). */
|
|
388
|
+
export declare const ROSTER_APPROVAL_BINDING: Readonly<{
|
|
389
|
+
readonly name: {
|
|
390
|
+
readonly identity: readonly ["capabilityId"];
|
|
391
|
+
};
|
|
392
|
+
readonly aliases: {
|
|
393
|
+
readonly unbound: "the names a call answers to are the call's own (the row's `names`); a resumed belt judges under the live names";
|
|
394
|
+
};
|
|
395
|
+
readonly source: {
|
|
396
|
+
readonly identity: readonly ["capabilityId"];
|
|
397
|
+
};
|
|
398
|
+
readonly origin: {
|
|
399
|
+
readonly unbound: "the peer is the identity's (capabilityId); who declared the server is provenance no decision reads";
|
|
400
|
+
};
|
|
401
|
+
readonly contract: {
|
|
402
|
+
readonly identity: readonly ["contractId", "implementationRevision"];
|
|
403
|
+
};
|
|
404
|
+
readonly shapeDigest: {
|
|
405
|
+
readonly identity: readonly ["shapeDigest"];
|
|
406
|
+
};
|
|
407
|
+
readonly wireSchemaDigest: {
|
|
408
|
+
readonly unbound: "the schema with its description prose for the model; the shape a call is validated against is the identity's (shapeDigest)";
|
|
409
|
+
};
|
|
410
|
+
readonly cardId: {
|
|
411
|
+
readonly unbound: "derived from the source, peer, name and contract, all identity";
|
|
412
|
+
};
|
|
413
|
+
readonly capabilityId: {
|
|
414
|
+
readonly identity: readonly ["capabilityId"];
|
|
415
|
+
};
|
|
416
|
+
readonly inputKeys: {
|
|
417
|
+
readonly unbound: "derived from the schema, whose shape is the identity's (shapeDigest)";
|
|
418
|
+
};
|
|
419
|
+
readonly effect: "declaration";
|
|
420
|
+
readonly effectProvenance: "declaration";
|
|
421
|
+
readonly offload: {
|
|
422
|
+
readonly unbound: "where the engine keeps the call's result (the deployment's own store), not what the call does or reaches";
|
|
423
|
+
};
|
|
424
|
+
readonly offloadThresholdChars: {
|
|
425
|
+
readonly unbound: "where the engine keeps the call's result (the deployment's own store), not what the call does or reaches";
|
|
426
|
+
};
|
|
427
|
+
readonly compactable: {
|
|
428
|
+
readonly unbound: "how the transcript keeps the result, not what the call does";
|
|
429
|
+
};
|
|
430
|
+
readonly budgetExempt: {
|
|
431
|
+
readonly unbound: "how the result counts against the context budget, not what the call does";
|
|
432
|
+
};
|
|
433
|
+
readonly egress: "declaration";
|
|
434
|
+
readonly egressProvenance: {
|
|
435
|
+
readonly unbound: "where the egress value came from; the value is the declaration's (egress), no decision reads its provenance";
|
|
436
|
+
};
|
|
437
|
+
readonly irreversibility: "declaration";
|
|
438
|
+
readonly reversibilityProbe: "declaration";
|
|
439
|
+
readonly contentOrigin: "declaration";
|
|
440
|
+
readonly contentOriginProvenance: {
|
|
441
|
+
readonly unbound: "where the content-origin value came from; the value is the declaration's, no decision reads its provenance";
|
|
442
|
+
};
|
|
443
|
+
readonly family: "face";
|
|
444
|
+
readonly boundaryLegs: "declaration";
|
|
445
|
+
readonly pathTarget: "face";
|
|
446
|
+
readonly hostTarget: "face";
|
|
447
|
+
readonly ruleFace: "declaration";
|
|
448
|
+
readonly approvalPreview: {
|
|
449
|
+
readonly unbound: "whether the card had a preview, shown when it was asked";
|
|
450
|
+
};
|
|
451
|
+
readonly validateInput: {
|
|
452
|
+
readonly unbound: "the live tool validates the bytes it runs, whatever the row says";
|
|
453
|
+
};
|
|
454
|
+
readonly deferred: {
|
|
455
|
+
readonly unbound: "when the schema is loaded into the model's context, not what the call does";
|
|
456
|
+
};
|
|
457
|
+
readonly alwaysLoad: {
|
|
458
|
+
readonly unbound: "when the schema is loaded into the model's context, not what the call does";
|
|
459
|
+
};
|
|
460
|
+
readonly modelGate: "declaration";
|
|
461
|
+
readonly renderHints: {
|
|
462
|
+
readonly unbound: "display, shown when the card was asked";
|
|
463
|
+
};
|
|
464
|
+
readonly mountedBy: {
|
|
465
|
+
readonly identity: readonly ["engineMounted"];
|
|
466
|
+
};
|
|
467
|
+
}>;
|
|
468
|
+
type ApprovalTable = typeof ROSTER_APPROVAL_BINDING;
|
|
469
|
+
/** The roster members the table binds as the tool's FACE. */
|
|
470
|
+
export type RosterFaceMember = {
|
|
471
|
+
[K in keyof ApprovalTable]: ApprovalTable[K] extends "face" ? K : never;
|
|
472
|
+
}[keyof ApprovalTable];
|
|
473
|
+
/** The row members that carry the roster's IDENTITY members. */
|
|
474
|
+
export type RosterIdentityCarrier = {
|
|
475
|
+
[K in keyof ApprovalTable]: ApprovalTable[K] extends {
|
|
476
|
+
readonly identity: readonly (infer I)[];
|
|
477
|
+
} ? I : never;
|
|
478
|
+
}[keyof ApprovalTable];
|
|
479
|
+
/** The declaration a parked approval binds: the digest of the row's `declaration` members ({@link ROSTER_APPROVAL_BINDING}), each as
|
|
480
|
+
* the row carries it — one mint for the park row and for the live row it is compared with. */
|
|
481
|
+
export declare function toolDeclarationDigestOf(entry: ToolRosterEntry): string;
|
|
375
482
|
/** The engine-minted capability identity: a STRUCTURED tuple (never a joined string — `a:b`+`c` and `a`+`b:c`
|
|
376
483
|
* must not collide). Stable across legs for the same source/peer/name/contract. */
|
|
377
484
|
export declare function mintCapabilityId(t: {
|
package/dist/core/tool-roster.js
CHANGED
|
@@ -11,6 +11,7 @@ import { PRESENT_PLAN_TOOL_NAME } from "./present-plan-tool.js";
|
|
|
11
11
|
import { wireOf } from "./tool-name-readings.js";
|
|
12
12
|
import { BOUNDARY_LEGS, rosterBoundaryLegs } from "./cross-boundary-taint.js";
|
|
13
13
|
import { isPlainRecord, receive } from "./mods/kernel/receive.js";
|
|
14
|
+
import { boundInputHashOf } from "./canonical-json.js";
|
|
14
15
|
function lit(values) {
|
|
15
16
|
return Type.Union(values.map((v) => Type.Literal(v)));
|
|
16
17
|
}
|
|
@@ -140,7 +141,7 @@ export function parkedToolFace(roster, req) {
|
|
|
140
141
|
if (e === undefined)
|
|
141
142
|
return {};
|
|
142
143
|
const judged = req.face?.names;
|
|
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 } : {}) };
|
|
144
|
+
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), declarationDigest: toolDeclarationDigestOf(e), ...(engineMountedRow(e) ? { engineMounted: true } : {}) };
|
|
144
145
|
}
|
|
145
146
|
export function parkedRowLiveFace(roster, row) {
|
|
146
147
|
const spelled = row.names?.[0];
|
|
@@ -168,6 +169,46 @@ export function callFaceSeat(face) {
|
|
|
168
169
|
export function toolIdentityOf(entry) {
|
|
169
170
|
return { capabilityId: entry.capabilityId, contractId: entry.contract.contractId, shapeDigest: entry.shapeDigest, implementationRevision: entry.contract.implementationRevision };
|
|
170
171
|
}
|
|
172
|
+
export const ROSTER_APPROVAL_BINDING = Object.freeze({
|
|
173
|
+
name: { identity: ["capabilityId"] },
|
|
174
|
+
aliases: { unbound: "the names a call answers to are the call's own (the row's `names`); a resumed belt judges under the live names" },
|
|
175
|
+
source: { identity: ["capabilityId"] },
|
|
176
|
+
origin: { unbound: "the peer is the identity's (capabilityId); who declared the server is provenance no decision reads" },
|
|
177
|
+
contract: { identity: ["contractId", "implementationRevision"] },
|
|
178
|
+
shapeDigest: { identity: ["shapeDigest"] },
|
|
179
|
+
wireSchemaDigest: { unbound: "the schema with its description prose for the model; the shape a call is validated against is the identity's (shapeDigest)" },
|
|
180
|
+
cardId: { unbound: "derived from the source, peer, name and contract, all identity" },
|
|
181
|
+
capabilityId: { identity: ["capabilityId"] },
|
|
182
|
+
inputKeys: { unbound: "derived from the schema, whose shape is the identity's (shapeDigest)" },
|
|
183
|
+
effect: "declaration",
|
|
184
|
+
effectProvenance: "declaration",
|
|
185
|
+
offload: { unbound: "where the engine keeps the call's result (the deployment's own store), not what the call does or reaches" },
|
|
186
|
+
offloadThresholdChars: { unbound: "where the engine keeps the call's result (the deployment's own store), not what the call does or reaches" },
|
|
187
|
+
compactable: { unbound: "how the transcript keeps the result, not what the call does" },
|
|
188
|
+
budgetExempt: { unbound: "how the result counts against the context budget, not what the call does" },
|
|
189
|
+
egress: "declaration",
|
|
190
|
+
egressProvenance: { unbound: "where the egress value came from; the value is the declaration's (egress), no decision reads its provenance" },
|
|
191
|
+
irreversibility: "declaration",
|
|
192
|
+
reversibilityProbe: "declaration",
|
|
193
|
+
contentOrigin: "declaration",
|
|
194
|
+
contentOriginProvenance: { unbound: "where the content-origin value came from; the value is the declaration's, no decision reads its provenance" },
|
|
195
|
+
family: "face",
|
|
196
|
+
boundaryLegs: "declaration",
|
|
197
|
+
pathTarget: "face",
|
|
198
|
+
hostTarget: "face",
|
|
199
|
+
ruleFace: "declaration",
|
|
200
|
+
approvalPreview: { unbound: "whether the card had a preview, shown when it was asked" },
|
|
201
|
+
validateInput: { unbound: "the live tool validates the bytes it runs, whatever the row says" },
|
|
202
|
+
deferred: { unbound: "when the schema is loaded into the model's context, not what the call does" },
|
|
203
|
+
alwaysLoad: { unbound: "when the schema is loaded into the model's context, not what the call does" },
|
|
204
|
+
modelGate: "declaration",
|
|
205
|
+
renderHints: { unbound: "display, shown when the card was asked" },
|
|
206
|
+
mountedBy: { identity: ["engineMounted"] },
|
|
207
|
+
});
|
|
208
|
+
const DECLARATION_MEMBERS = Object.keys(ROSTER_APPROVAL_BINDING).filter((k) => ROSTER_APPROVAL_BINDING[k] === "declaration");
|
|
209
|
+
export function toolDeclarationDigestOf(entry) {
|
|
210
|
+
return boundInputHashOf(Object.fromEntries(DECLARATION_MEMBERS.flatMap((k) => (entry[k] === undefined ? [] : [[k, entry[k]]]))));
|
|
211
|
+
}
|
|
171
212
|
function canonical(node) {
|
|
172
213
|
if (Array.isArray(node))
|
|
173
214
|
return `[${node.map(canonical).join(",")}]`;
|
package/dist/core/tool-spec.d.ts
CHANGED
|
@@ -1392,7 +1392,9 @@ export interface ToolExecuteContext {
|
|
|
1392
1392
|
* only when the deployment can actually pause (a `checkpointStore` is wired); otherwise the request is a silent
|
|
1393
1393
|
* no-op (read-only/headless degrade). The first-party `present_plan` tool (CC `ExitPlanMode` parity) is a thin
|
|
1394
1394
|
* caller of this; any tool may use it to gate a high-blast step on human review. Idempotent within a batch (the
|
|
1395
|
-
* first request wins; the suspend fires once at the boundary). The Runner fills it; not a tool arg.
|
|
1395
|
+
* first request wins; the suspend fires once at the boundary). The Runner fills it; not a tool arg. The Runner
|
|
1396
|
+
* binds the id of the calling tool call to the request (a tool cannot name another call): the parked `plan_review`
|
|
1397
|
+
* row and the paused cause carry it as `requestedByCallId` — which call asked for the pause.
|
|
1396
1398
|
*/
|
|
1397
1399
|
requestReview?: (opts?: {
|
|
1398
1400
|
reason?: string;
|
package/dist/core/types.d.ts
CHANGED
|
@@ -23,13 +23,13 @@ export { DECLARATION_PATH_RULES, NO_DECLARATION_PATH_RULES, dataKind, declaratio
|
|
|
23
23
|
export type { TaskLimits } from "./task-limits.js";
|
|
24
24
|
export type { TaskStatus, RemoteEnvFailureNote, EffectiveMemoryScopes, TaskResult, HumanReviewGateRow } from "./task-result.js";
|
|
25
25
|
export type { TerminalCause, PausedCause } from "./terminal-cause.js";
|
|
26
|
-
export type { TaskEventIdentity, BrainStatusPhase, BrainRetryErrClass, BrainStatus, ToolActivity, HumanInputSource, HumanInputDelivery, DelegationTaskType, TaskEvent, HumanInputEvent, HumanInputAttachment, CompactOutcome, ExtensionRequester } from "./task-event.js";
|
|
26
|
+
export type { TaskEventIdentity, BrainStatusPhase, BrainRetryErrClass, BrainStatus, ToolActivity, HumanInputSource, HumanInputDelivery, DelegationTaskType, TaskEvent, HumanInputEvent, HumanInputAttachment, CompactOutcome, ExtensionRequester, RewriteAuthor, ToolInputRewrite } from "./task-event.js";
|
|
27
27
|
export type { TaskStream } from "./task-stream.js";
|
|
28
28
|
export type { WorkflowGovernanceBaseline, RuntimeCaps, AutoModeDenySource } from "./runtime-caps.js";
|
|
29
29
|
export { AUTO_MODE_DENY_SOURCES, isAutoModeDenySource } from "./runtime-caps.js";
|
|
30
30
|
export type { BackgroundChildEvent, BackgroundChildRow, DelegationLifecycleEvent } from "./delegation-frames.js";
|
|
31
31
|
export { __resetMalformedDelegationSeatAnnouncement, backgroundChildTerminal, deliverDelegationLifecycle, emitsChildRowFrames, taskStartedFrame } from "./delegation-frames.js";
|
|
32
32
|
export type { ProjectMemoryLoad, ResumePreflightInfo, ResumePreflightVerdict, RunnerDeps } from "./runner-deps.js";
|
|
33
|
-
export type { ApprovalCarryRefusal, EngineNotice, OwedUserInputAccount, UserInputUndrainedCause } from "./engine-notice.js";
|
|
34
|
-
export { __resetMalformedNoticeSeatAnnouncement, deliverEngineNotice, owedUserInputCounts, parentLegIds, settleOwedUserInput, undrainedUserInputNotices, USER_INPUT_UNDRAINED_CAUSES, USER_INPUT_UNDRAINED_FAMILIES } from "./engine-notice.js";
|
|
33
|
+
export type { ApprovalCarryRefusal, EngineNotice, HeldUserInputs, OwedInputIds, OwedUserInputAccount, UserInputUndrainedCause } from "./engine-notice.js";
|
|
34
|
+
export { __resetMalformedNoticeSeatAnnouncement, deliverEngineNotice, owedUserInputCounts, owedUserInputIds, parentLegIds, parkedInputIdsOf, settleOwedUserInput, undrainedUserInputNotices, USER_INPUT_UNDRAINED_CAUSES, USER_INPUT_UNDRAINED_FAMILIES } from "./engine-notice.js";
|
|
35
35
|
export type { AgentTool, Model, StreamFn, ThinkingLevel, ToolInputValidationContext, ToolInputVerdict };
|
package/dist/core/types.js
CHANGED
|
@@ -2,4 +2,4 @@ export { MODEL_ROLES } from "./model-seat.js";
|
|
|
2
2
|
export { DECLARATION_PATH_RULES, NO_DECLARATION_PATH_RULES, dataKind, declarationFaultOf, declarerWord, perToolEmptyName, perToolEntryRefusal, quotedName, readMcpToolAxes, readToolAxes, receiveDeclaration, receivePerToolDeclaration, toolAxesRefusal } from "./mcp-server-spec.js";
|
|
3
3
|
export { AUTO_MODE_DENY_SOURCES, isAutoModeDenySource } from "./runtime-caps.js";
|
|
4
4
|
export { __resetMalformedDelegationSeatAnnouncement, backgroundChildTerminal, deliverDelegationLifecycle, emitsChildRowFrames, taskStartedFrame } from "./delegation-frames.js";
|
|
5
|
-
export { __resetMalformedNoticeSeatAnnouncement, deliverEngineNotice, owedUserInputCounts, parentLegIds, settleOwedUserInput, undrainedUserInputNotices, USER_INPUT_UNDRAINED_CAUSES, USER_INPUT_UNDRAINED_FAMILIES } from "./engine-notice.js";
|
|
5
|
+
export { __resetMalformedNoticeSeatAnnouncement, deliverEngineNotice, owedUserInputCounts, owedUserInputIds, parentLegIds, parkedInputIdsOf, settleOwedUserInput, undrainedUserInputNotices, USER_INPUT_UNDRAINED_CAUSES, USER_INPUT_UNDRAINED_FAMILIES } from "./engine-notice.js";
|
|
@@ -78,8 +78,6 @@ export declare function egressValue<T extends EgressTier, V>(tier: T, value: V):
|
|
|
78
78
|
* Every pass it runs is a fixed point, so an account value minted twice reads the same.
|
|
79
79
|
*/
|
|
80
80
|
export declare function egressAccount<T extends EgressTier, V>(tier: T, value: V): V;
|
|
81
|
-
/** Where the markers sit in `s`, as [start, end) spans, leftmost first. */
|
|
82
|
-
export declare function redactionMarkerSpans(s: string): Array<[number, number]>;
|
|
83
81
|
/** The `same-principal` tier's pass + size-bound (NO injection fence): workflow outputs/results/errors riding back to
|
|
84
82
|
* the launching model/script, run rows behind scope-gated observe. Paths/URLs survive (the assertion pattern depends on
|
|
85
83
|
* them); secrets never do. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { types } from "node:util";
|
|
2
2
|
import { delimitUntrusted, inlineUntrusted, neutralizeForFence } from "./untrusted-text.js";
|
|
3
3
|
import { egressPasses, runRedactionPasses } from "./redaction-passes.js";
|
|
4
|
+
import { REDACTION_MARK, REDACTION_MARKS, redactionMarkerSpans } from "./redaction-marks.js";
|
|
4
5
|
import { CREDENTIAL_VOCABULARY, egressPassGroups, isSensitiveRecordKey, URI_SCHEME_SOURCE } from "./credential-vocabulary.js";
|
|
5
6
|
import { isErrorLike, readMember, thrownText } from "./thrown-value.js";
|
|
6
7
|
import { sliceHeadSafe } from "./surrogate-safe-slice.js";
|
|
@@ -10,20 +11,20 @@ const BARE_USERNAME_MAX_LEN = 20;
|
|
|
10
11
|
function redactUserinfo(scheme, userinfoWithAt) {
|
|
11
12
|
const userinfo = userinfoWithAt.slice(0, -1);
|
|
12
13
|
if (CREDENTIAL_VOCABULARY.policy.urlUserinfo === "whole" || userinfo.includes("@"))
|
|
13
|
-
return `${scheme}
|
|
14
|
+
return `${scheme}${REDACTION_MARKS.credentials}@`;
|
|
14
15
|
const colonIdx = userinfo.indexOf(":");
|
|
15
16
|
if (colonIdx === -1) {
|
|
16
|
-
return userinfo.length >= BARE_USERNAME_MAX_LEN ? `${scheme}
|
|
17
|
+
return userinfo.length >= BARE_USERNAME_MAX_LEN ? `${scheme}${REDACTION_MARKS.credentials}@` : `${scheme}${userinfo}@`;
|
|
17
18
|
}
|
|
18
|
-
return `${scheme}${userinfo.slice(0, colonIdx)}
|
|
19
|
+
return `${scheme}${userinfo.slice(0, colonIdx)}:${REDACTION_MARKS.credentials}@`;
|
|
19
20
|
}
|
|
20
21
|
const SECRET_TIER_PASSES = egressPasses(egressPassGroups(CREDENTIAL_VOCABULARY), {
|
|
21
22
|
"url-credentials": (_m, scheme, userinfo) => redactUserinfo(scheme, userinfo),
|
|
22
23
|
});
|
|
23
24
|
const HOST_LEAK_PASSES = [
|
|
24
25
|
...SECRET_TIER_PASSES,
|
|
25
|
-
{ kind: "url", confidence: "medium", marker:
|
|
26
|
-
{ kind: "fs-path", confidence: "low", marker:
|
|
26
|
+
{ kind: "url", confidence: "medium", marker: REDACTION_MARKS.url, source: "untrusted-egress", re: URL_OF_ANY_PROTOCOL, replace: REDACTION_MARKS.url },
|
|
27
|
+
{ kind: "fs-path", confidence: "low", marker: REDACTION_MARKS.path, source: "untrusted-egress", re: /(?:\/[A-Za-z0-9_.-]+){2,}/g, replace: REDACTION_MARKS.path },
|
|
27
28
|
];
|
|
28
29
|
const TIER_PASSES = { "same-principal": SECRET_TIER_PASSES, human: HOST_LEAK_PASSES };
|
|
29
30
|
export function egressText(tier, text, report) {
|
|
@@ -43,7 +44,6 @@ export function redactHostLeaks(s, report) {
|
|
|
43
44
|
}
|
|
44
45
|
const VALUE_DEPTH_MAX = 32;
|
|
45
46
|
const VALUE_MEMBERS_MAX = 2_000;
|
|
46
|
-
const WHOLE = "[redacted]";
|
|
47
47
|
export function egressValue(tier, value) {
|
|
48
48
|
return foreignValue(tier, value, new Map());
|
|
49
49
|
}
|
|
@@ -78,7 +78,7 @@ function foreignValue(tier, value, snapshots) {
|
|
|
78
78
|
};
|
|
79
79
|
const member = (read, depth, name) => {
|
|
80
80
|
const out = pass(read, depth + 1, name);
|
|
81
|
-
return typeof out === "string" && isSensitiveRecordKey(name) ?
|
|
81
|
+
return typeof out === "string" && isSensitiveRecordKey(name) ? REDACTION_MARK : out;
|
|
82
82
|
};
|
|
83
83
|
const fill = (o, depth, keys, snapshot) => {
|
|
84
84
|
snapshots.set(o, snapshot);
|
|
@@ -116,7 +116,7 @@ function foreignValue(tier, value, snapshots) {
|
|
|
116
116
|
if (known !== undefined)
|
|
117
117
|
return known;
|
|
118
118
|
if (depth >= VALUE_DEPTH_MAX)
|
|
119
|
-
return
|
|
119
|
+
return REDACTION_MARK;
|
|
120
120
|
if (isErrorLike(v))
|
|
121
121
|
return errorSnapshot(v, depth);
|
|
122
122
|
const toJSON = readMember(v, "toJSON");
|
|
@@ -126,7 +126,7 @@ function foreignValue(tier, value, snapshots) {
|
|
|
126
126
|
reading = toJSON.call(v, key);
|
|
127
127
|
}
|
|
128
128
|
catch {
|
|
129
|
-
return
|
|
129
|
+
return REDACTION_MARK;
|
|
130
130
|
}
|
|
131
131
|
if (reading !== v) {
|
|
132
132
|
const out = pass(reading, depth + 1, key);
|
|
@@ -172,7 +172,7 @@ export function egressAccount(tier, value) {
|
|
|
172
172
|
if (known !== undefined)
|
|
173
173
|
return known;
|
|
174
174
|
if (depth >= VALUE_DEPTH_MAX)
|
|
175
|
-
return
|
|
175
|
+
return REDACTION_MARK;
|
|
176
176
|
const shape = plainShape(v);
|
|
177
177
|
if (shape === undefined)
|
|
178
178
|
return foreignValue(tier, v, snapshots);
|
|
@@ -214,10 +214,6 @@ export function egressAccount(tier, value) {
|
|
|
214
214
|
};
|
|
215
215
|
return pass(value, 0);
|
|
216
216
|
}
|
|
217
|
-
const REDACTION_MARKER_RE = /\[redacted(?:-(?:credentials|url|path))?\]/g;
|
|
218
|
-
export function redactionMarkerSpans(s) {
|
|
219
|
-
return [...s.matchAll(REDACTION_MARKER_RE)].map((m) => [m.index, m.index + m[0].length]);
|
|
220
|
-
}
|
|
221
217
|
function countRedactionMarkers(s) {
|
|
222
218
|
return redactionMarkerSpans(s).length;
|
|
223
219
|
}
|
|
@@ -166,7 +166,7 @@ export async function admitUserAttachmentImages(screened) {
|
|
|
166
166
|
case "mime_unsupported":
|
|
167
167
|
throw userAttachmentRefusal(memberRef(imageAt, "mimeType"), `must be one of ${ADMITTED_IMAGE_MIME_TYPES.join(", ")}.`);
|
|
168
168
|
case "magic_mismatch":
|
|
169
|
-
throw userAttachmentRefusal(memberRef(imageAt, "data"), `does not
|
|
169
|
+
throw userAttachmentRefusal(memberRef(imageAt, "data"), `does not open with a valid ${a.mimeType} header (empty, truncated, mis-declared, not base64, or a variant such as an Apple-optimized PNG that model APIs cannot read) — refused rather than sent.`);
|
|
170
170
|
case "raw_too_large":
|
|
171
171
|
throw userAttachmentRefusal(memberRef(imageAt, "data"), `${admitted.rawBytes} bytes, over the ${admitted.cap}-byte cap.`);
|
|
172
172
|
case "base64_too_large":
|
|
@@ -24,9 +24,10 @@ import { type PermissionMode } from "./ask-origin.js";
|
|
|
24
24
|
import type { RunnerDeps, TaskSpec } from "./types.js";
|
|
25
25
|
import { type StoreDurability } from "./checkpoint-store.js";
|
|
26
26
|
import type { ModAdmissionRecord } from "./mods/kernel/index.js";
|
|
27
|
-
import type { McpDelivered, McpFailureKind, McpServerLiveness } from "./mcp-failure.js";
|
|
27
|
+
import type { McpAuthorization, McpDelivered, McpFailureKind, McpServerLiveness } from "./mcp-failure.js";
|
|
28
28
|
import type { WriteProtectionTargetView } from "./write-protect.js";
|
|
29
29
|
import type { OnAsk } from "./tool-policy.js";
|
|
30
|
+
import { type RunOrigin } from "./run-origin.js";
|
|
30
31
|
export type { StoreDurability };
|
|
31
32
|
/** The manifest-face projection of {@link StoreDurability}: `"declared_durable"` (the name says it —
|
|
32
33
|
* a DECLARATION relayed, not a verification) vs `"process_local"` (declared so, or fail-closed
|
|
@@ -113,8 +114,8 @@ export interface AutoModeArmFact {
|
|
|
113
114
|
* One declared MCP server's materialization result for THIS leg — the per-server connection-state
|
|
114
115
|
* read face on {@link WiringManifest.mcp}. `status` is the connect-time verdict of this leg's
|
|
115
116
|
* materialize (a snapshot, never a heartbeat — the same semantics as `MaterializedMcp.statuses`,
|
|
116
|
-
* which it is projected from): `connected` (tools listed; `toolCount` = see the field), `failed` (the connect or the tool listing threw — `errorCode`/`delivered`/`httpStatus` are the
|
|
117
|
-
* failure record spread flat (see the MCP failure vocabulary's `McpFailure`), `error` the
|
|
117
|
+
* which it is projected from): `connected` (tools listed; `toolCount` = see the field), `failed` (the connect or the tool listing threw — `errorCode`/`delivered`/`httpStatus`/`authorization` are the
|
|
118
|
+
* failure record spread flat (see the MCP failure vocabulary's `McpFailure` and `failureFields`), `error` the
|
|
118
119
|
* neutralized, length-bounded remote text), `skipped` (declared on the spec but this leg produced no
|
|
119
120
|
* status for it — the materialization did not reach it). `source` is the DECLARING side's own label
|
|
120
121
|
* (`McpServerSpec.source`: plugin / user / project / local, or anything the deployment writes),
|
|
@@ -128,6 +129,9 @@ export interface WiringManifestMcpEntry {
|
|
|
128
129
|
errorCode?: McpFailureKind;
|
|
129
130
|
delivered?: McpDelivered;
|
|
130
131
|
httpStatus?: number;
|
|
132
|
+
/** The `unauthorized` failure's authorization fact (`McpAuthorization`): present iff `errorCode === "unauthorized"`, copied whole
|
|
133
|
+
* from the status record (`authorizeUrl` the deployment seat's, `resourceMetadataUrl` the endpoint's own UNTRUSTED claim). */
|
|
134
|
+
authorization?: McpAuthorization;
|
|
131
135
|
error?: string;
|
|
132
136
|
/** How many of the server's tools the roster the row is read against holds: a run's roster (the valve and the deployment's
|
|
133
137
|
* `toolFaces` overlay applied — a tool either one leaves off is not counted), or, for `probeMcpServers` (no run, so no lists),
|
|
@@ -184,9 +188,13 @@ export declare function deriveLspSeam(mounted: boolean, diagnosticsLive: boolean
|
|
|
184
188
|
*/
|
|
185
189
|
export interface WiringManifest {
|
|
186
190
|
schemaVersion: 1;
|
|
187
|
-
/** Present on EFFECTIVE (per-leg) manifests only; the static half has no leg.
|
|
191
|
+
/** Present on EFFECTIVE (per-leg) manifests only; the static half has no leg. `runOrigin`: the word of the input that
|
|
192
|
+
* opened this leg, when its host said so (the objective's `TaskSpec.runOrigin`, or the newest input a wake hands over; read
|
|
193
|
+
* once at the config doors), and on a leg a decision resumed, the checkpoint row's — absent when the host said nothing, and
|
|
194
|
+
* on a delegated child (a child is its parent's model's work). */
|
|
188
195
|
leg?: {
|
|
189
196
|
kind: WiringLegKind;
|
|
197
|
+
runOrigin?: RunOrigin;
|
|
190
198
|
};
|
|
191
199
|
/** Effective half only — the leg's team role ({@link import("../agents/team-role.js").teamRoleOf}):
|
|
192
200
|
* `lead` for a top-level leg, `teammate` for a named delegation, `none` for an unnamed one. Leg-local
|
|
@@ -358,9 +366,11 @@ export interface WiringManifest {
|
|
|
358
366
|
tools?: import("./tool-roster.js").ToolRoster;
|
|
359
367
|
/**
|
|
360
368
|
* EFFECTIVE half only: the leg's mods admission — one record per registration of the two seats, in run order: a
|
|
361
|
-
* mounted one with the patterns it actually hung (`events`), the ones it
|
|
369
|
+
* mounted one with the patterns it actually hung (`events`), the ones among them it only watches (`observe`: every
|
|
370
|
+
* handler it hung on the pattern is a watcher — a registration that only watches has `observe` equal to `events`) and the
|
|
362
371
|
* judges skipped while it was judged (`skipped`), or a refused one with who refused it and why (`refusedBy`,
|
|
363
|
-
* `reason`)
|
|
372
|
+
* `reason`); either carries the registration's `provenance` label as the host gave it (absent when none was given — no
|
|
373
|
+
* default is minted). PRESENT IFF the leg has a registration — a deployment that wires none reports nothing here and its
|
|
364
374
|
* manifest (and {@link configFingerprint}) is byte-for-byte what it was. Absence reads as "this leg carries no
|
|
365
375
|
* registration", NOT as "no extension judges this leg's calls": a delegated child can still be screened by an
|
|
366
376
|
* ancestor's chain through the gate's constraint fold. EXCLUDED from {@link configFingerprint}: the task seat is a
|
|
@@ -526,6 +536,8 @@ export interface WiringFacts {
|
|
|
526
536
|
half: "static" | "effective";
|
|
527
537
|
/** Required on the effective half; must be absent on the static half. */
|
|
528
538
|
leg?: WiringLegKind;
|
|
539
|
+
/** Effective half only, reported inside `leg` — see {@link WiringManifest.leg}. */
|
|
540
|
+
runOrigin?: RunOrigin;
|
|
529
541
|
/** Effective half only — see {@link WiringManifest.teamRole}. */
|
|
530
542
|
teamRole?: import("../agents/team-role.js").TeamRole;
|
|
531
543
|
/** Effective half only — see {@link WiringManifest.peerPresence}; copied, never aliased. */
|