@sema-agent/core 7.58.0 → 7.60.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 +1340 -0
- package/README.md +6 -4
- package/dist/agents/agent-definition.d.ts +7 -0
- package/dist/agents/agent-definition.js +12 -0
- package/dist/agents/agent-transcript-tool.d.ts +2 -1
- package/dist/agents/agent-transcript-tool.js +3 -1
- 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 +9 -4
- package/dist/agents/cumulative-stats.js +0 -1
- package/dist/agents/inherited-tool-pool.d.ts +26 -1
- package/dist/agents/inherited-tool-pool.js +22 -0
- package/dist/agents/peer-directory.d.ts +9 -0
- package/dist/agents/peer-directory.js +6 -2
- package/dist/agents/retain-ledger.d.ts +11 -1
- package/dist/agents/retain-ledger.js +13 -2
- package/dist/agents/roster-store.d.ts +1 -1
- package/dist/agents/roster-store.js +3 -1
- package/dist/agents/send-message-tool.d.ts +8 -19
- package/dist/agents/send-message-tool.js +32 -50
- package/dist/agents/subagent.d.ts +51 -17
- package/dist/agents/subagent.js +150 -112
- package/dist/agents/tool-filter.d.ts +1 -3
- package/dist/agents/tool-filter.js +4 -12
- package/dist/bench/metrics.d.ts +3 -5
- package/dist/bench/metrics.js +0 -1
- package/dist/brain/anthropic.js +161 -45
- package/dist/brain/degrading.js +3 -1
- 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 +90 -22
- package/dist/brain/route-conformance.js +1 -1
- package/dist/brain/status-sink.d.ts +7 -1
- package/dist/brain/status-sink.js +6 -0
- 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 +65 -6
- package/dist/brain/timeout.js +111 -11
- package/dist/core/a2a.d.ts +15 -5
- package/dist/core/a2a.js +34 -19
- 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/agent-definition.d.ts +20 -0
- package/dist/core/allow-entry.d.ts +20 -6
- package/dist/core/allow-entry.js +17 -7
- package/dist/core/approval-object.d.ts +29 -15
- package/dist/core/approval-object.js +47 -19
- package/dist/core/artifact-host.d.ts +0 -2
- package/dist/core/artifact-host.js +0 -1
- package/dist/core/auto-compaction.js +1 -1
- package/dist/core/auto-mode-defaults.d.ts +8 -0
- package/dist/core/auto-mode-defaults.js +1 -0
- package/dist/core/auto-mode-rebuild.d.ts +2 -1
- package/dist/core/auto-mode.d.ts +39 -4
- package/dist/core/auto-mode.js +63 -12
- package/dist/core/background-agent-store.d.ts +26 -4
- package/dist/core/background-agent-store.js +3 -2
- package/dist/core/background-shell.d.ts +12 -1
- package/dist/core/background-shell.js +12 -0
- package/dist/core/checkpoint-requirements.d.ts +13 -1
- package/dist/core/checkpoint-requirements.js +3 -1
- package/dist/core/checkpoint-store.d.ts +66 -25
- package/dist/core/checkpoint-store.js +22 -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 +3 -3
- package/dist/core/compliance.js +1 -1
- package/dist/core/credential-echo.d.ts +52 -0
- package/dist/core/credential-echo.js +65 -0
- package/dist/core/credential-vocabulary.d.ts +13 -3
- package/dist/core/credential-vocabulary.js +12 -4
- package/dist/core/cross-boundary-taint.d.ts +4 -5
- 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 +156 -23
- package/dist/core/engine-notice.js +19 -5
- package/dist/core/frame-settlement.d.ts +5 -0
- package/dist/core/frame-settlement.js +4 -0
- package/dist/core/gate-fold.js +8 -6
- package/dist/core/gate-lanes.js +47 -12
- package/dist/core/gate-outcome.d.ts +32 -3
- package/dist/core/gate-outcome.js +19 -1
- package/dist/core/governance-codes.d.ts +17 -1
- package/dist/core/governance-codes.js +25 -0
- package/dist/core/hands-band-screen.js +0 -1
- package/dist/core/hands-band.d.ts +0 -3
- package/dist/core/hooks.d.ts +70 -59
- package/dist/core/hooks.js +125 -80
- package/dist/core/image-admission.d.ts +106 -52
- package/dist/core/image-admission.js +184 -56
- package/dist/core/image-downsample.d.ts +36 -69
- package/dist/core/image-downsample.js +111 -73
- package/dist/core/integer-option.d.ts +21 -0
- package/dist/core/integer-option.js +13 -0
- package/dist/core/locked-config.d.ts +59 -5
- package/dist/core/locked-config.js +82 -50
- 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 +2 -2
- package/dist/core/mcp-call-meta.js +9 -10
- package/dist/core/mcp-failure.d.ts +122 -20
- package/dist/core/mcp-failure.js +73 -5
- package/dist/core/mcp-host-seat.d.ts +92 -0
- package/dist/core/mcp-host-seat.js +131 -0
- package/dist/core/mcp-probe.d.ts +7 -2
- package/dist/core/mcp-probe.js +7 -2
- package/dist/core/mcp-server-link.d.ts +22 -1
- package/dist/core/mcp-server-link.js +25 -1
- package/dist/core/mcp-server-spec.d.ts +38 -9
- package/dist/core/mcp-server-spec.js +55 -21
- package/dist/core/mcp.d.ts +27 -12
- package/dist/core/mcp.js +105 -76
- package/dist/core/memory-admission.d.ts +23 -6
- package/dist/core/memory-admission.js +19 -9
- 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/content-origin.d.ts +13 -0
- package/dist/core/memory-engine/content-origin.js +21 -3
- 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 +3 -2
- package/dist/core/memory-engine/index.js +2 -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 +13 -3
- package/dist/core/memory-engine/scope-contract.js +2 -2
- package/dist/core/memory-engine/sync-client.d.ts +51 -9
- package/dist/core/memory-engine/sync-client.js +107 -13
- package/dist/core/memory-engine/sync-report.d.ts +103 -0
- package/dist/core/memory-engine/sync-report.js +119 -0
- package/dist/core/memory-engine/sync.d.ts +8 -1
- package/dist/core/memory-engine/types.d.ts +6 -0
- package/dist/core/mode-policy.d.ts +9 -1
- package/dist/core/mode-policy.js +11 -1
- package/dist/core/model-receipt.d.ts +39 -0
- package/dist/core/model-receipt.js +139 -0
- package/dist/core/mods/agent-stations.d.ts +65 -0
- package/dist/core/mods/agent-stations.js +105 -0
- package/dist/core/mods/classic-events.d.ts +5 -1
- package/dist/core/mods/kernel/dispatch.d.ts +5 -1
- package/dist/core/mods/kernel/dispatch.js +6 -5
- package/dist/core/mods/kernel/events.d.ts +11 -4
- package/dist/core/mods/kernel/events.js +11 -7
- package/dist/core/mods/kernel/receive.d.ts +5 -0
- package/dist/core/mods/kernel/receive.js +10 -0
- package/dist/core/mods/kernel/registration.d.ts +4 -0
- package/dist/core/mods/kernel/registration.js +3 -0
- package/dist/core/mods/lifecycle-stations.d.ts +41 -0
- package/dist/core/mods/lifecycle-stations.js +35 -0
- package/dist/core/mods/stations.d.ts +73 -60
- package/dist/core/mods/stations.js +64 -40
- package/dist/core/mods/tool-call.d.ts +10 -4
- package/dist/core/mods/tool-call.js +28 -12
- package/dist/core/mounted-mcp.d.ts +5 -0
- package/dist/core/mounted-mcp.js +2 -2
- package/dist/core/namespaced-rule-name.d.ts +7 -1
- package/dist/core/namespaced-rule-name.js +13 -2
- package/dist/core/oracle-isolation.js +1 -1
- package/dist/core/own-property-receipt.d.ts +3 -0
- package/dist/core/own-property-receipt.js +3 -0
- 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 +14 -8
- package/dist/core/peer-seat.d.ts +133 -16
- package/dist/core/peer-seat.js +319 -42
- package/dist/core/permission-rule-consent.d.ts +0 -21
- package/dist/core/permission-rule-consent.js +11 -6
- package/dist/core/permission-rule-model.d.ts +20 -2
- package/dist/core/permission-rule-model.js +8 -7
- package/dist/core/present-plan-tool.d.ts +11 -3
- package/dist/core/present-plan-tool.js +2 -2
- package/dist/core/protocol-http-auth.d.ts +14 -2
- package/dist/core/protocol-http-auth.js +16 -7
- package/dist/core/read-face-seats.d.ts +7 -5
- package/dist/core/read-face-seats.js +4 -1
- package/dist/core/redaction-marks.d.ts +4 -3
- package/dist/core/redaction-marks.js +2 -2
- package/dist/core/remote-env.d.ts +146 -98
- package/dist/core/remote-env.js +113 -14
- package/dist/core/resume-startup-cause.js +1 -0
- package/dist/core/retention.js +37 -12
- package/dist/core/retired-keys.d.ts +6 -1
- package/dist/core/retired-keys.js +4 -1
- package/dist/core/rewrite-rejudge.d.ts +13 -5
- package/dist/core/rewrite-rejudge.js +9 -5
- package/dist/core/roles.d.ts +69 -3
- package/dist/core/roles.js +167 -80
- package/dist/core/rule-owner.d.ts +3 -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/assemble-result.d.ts +0 -5
- package/dist/core/runner/assemble-result.js +0 -1
- package/dist/core/runner/call-hook-stations.d.ts +17 -10
- package/dist/core/runner/call-hook-stations.js +23 -12
- package/dist/core/runner/child-tree.d.ts +7 -8
- package/dist/core/runner/child-tree.js +6 -6
- package/dist/core/runner/classifier-ladder.d.ts +10 -2
- package/dist/core/runner/classifier-ladder.js +39 -8
- package/dist/core/runner/construction-doors.js +5 -0
- package/dist/core/runner/contracts.d.ts +82 -57
- package/dist/core/runner/credential-origin-seat.js +4 -3
- package/dist/core/runner/cross-boundary-lane.d.ts +3 -5
- package/dist/core/runner/cross-boundary-lane.js +11 -2
- 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/env-capability-census.d.ts +15 -20
- package/dist/core/runner/env-capability-census.js +25 -34
- package/dist/core/runner/file-history-request.d.ts +2 -2
- package/dist/core/runner/file-history-request.js +0 -8
- package/dist/core/runner/gate-exit.d.ts +87 -11
- package/dist/core/runner/gate-exit.js +30 -8
- package/dist/core/runner/git-status-frame.d.ts +5 -2
- package/dist/core/runner/git-status-frame.js +3 -4
- 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/image.d.ts +7 -2
- package/dist/core/runner/image.js +14 -8
- package/dist/core/runner/inline-image.d.ts +10 -8
- package/dist/core/runner/inline-image.js +11 -9
- package/dist/core/runner/memory-consolidation-driver.js +5 -5
- package/dist/core/runner/park-commit.d.ts +1 -1
- package/dist/core/runner/park-commit.js +3 -0
- package/dist/core/runner/permission-rule-lanes.js +1 -1
- 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.d.ts +2 -2
- package/dist/core/runner/prepare-boundary-parks.js +5 -5
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +7 -5
- package/dist/core/runner/prepare-caps-and-workflow.js +6 -3
- package/dist/core/runner/prepare-config-doors.d.ts +6 -1
- package/dist/core/runner/prepare-config-doors.js +16 -9
- package/dist/core/runner/prepare-context-lane.js +2 -0
- package/dist/core/runner/prepare-delegation-surface.d.ts +9 -3
- package/dist/core/runner/prepare-delegation-surface.js +5 -4
- package/dist/core/runner/prepare-file-history.d.ts +10 -12
- package/dist/core/runner/prepare-file-history.js +3 -12
- package/dist/core/runner/prepare-gate-stations.d.ts +4 -3
- package/dist/core/runner/prepare-gate-stations.js +4 -3
- package/dist/core/runner/prepare-hands-readface.d.ts +7 -1
- package/dist/core/runner/prepare-hands-readface.js +19 -6
- package/dist/core/runner/prepare-inherited-gate.d.ts +6 -7
- package/dist/core/runner/prepare-inherited-gate.js +22 -31
- package/dist/core/runner/prepare-memory-engine-session.js +1 -1
- package/dist/core/runner/prepare-memory.d.ts +2 -2
- package/dist/core/runner/prepare-memory.js +12 -19
- package/dist/core/runner/prepare-park-ask.d.ts +4 -6
- package/dist/core/runner/prepare-park-ask.js +5 -9
- package/dist/core/runner/prepare-policy-chain.d.ts +8 -7
- package/dist/core/runner/prepare-policy-chain.js +136 -121
- package/dist/core/runner/prepare-project-context.d.ts +2 -2
- package/dist/core/runner/prepare-project-context.js +10 -7
- package/dist/core/runner/prepare-prompt-inputs.d.ts +5 -2
- package/dist/core/runner/prepare-prompt-inputs.js +10 -20
- package/dist/core/runner/prepare-protocol-tools.d.ts +5 -3
- package/dist/core/runner/prepare-protocol-tools.js +17 -2
- 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 +0 -2
- package/dist/core/runner/prepare-suspend-saga.js +5 -7
- package/dist/core/runner/prepare-task.js +44 -28
- package/dist/core/runner/prepare-turn-wiring.d.ts +2 -0
- package/dist/core/runner/prepare-turn-wiring.js +7 -2
- package/dist/core/runner/prepare-wiring-manifest.d.ts +5 -4
- package/dist/core/runner/prepare-wiring-manifest.js +34 -19
- package/dist/core/runner/prepare-workspace-restore.js +3 -3
- 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 +4 -2
- package/dist/core/runner/resume-apply.js +6 -1
- package/dist/core/runner/resume-checkpoint-screen.js +4 -4
- package/dist/core/runner/resume-policy-outcome.js +5 -5
- package/dist/core/runner/retired-runner-deps.js +4 -1
- 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-attachment-seats.js +3 -3
- package/dist/core/runner/run-brain-sinks.js +3 -0
- package/dist/core/runner/run-git-lane.d.ts +3 -1
- package/dist/core/runner/run-git-lane.js +1 -1
- package/dist/core/runner/run-harness-handlers.d.ts +3 -1
- package/dist/core/runner/run-harness-handlers.js +3 -1
- package/dist/core/runner/run-identity-wiring.d.ts +2 -5
- package/dist/core/runner/run-identity-wiring.js +6 -5
- package/dist/core/runner/run-leg.d.ts +2 -0
- package/dist/core/runner/run-leg.js +63 -56
- package/dist/core/runner/run-notification-lane.d.ts +3 -1
- package/dist/core/runner/run-notification-lane.js +16 -10
- package/dist/core/runner/run-settle-and-teardown.js +5 -1
- package/dist/core/runner/run-stop-and-final-verify.d.ts +4 -0
- package/dist/core/runner/run-stop-and-final-verify.js +14 -6
- 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 +89 -77
- package/dist/core/runner/runtask.d.ts +8 -5
- package/dist/core/runner/runtask.js +21 -13
- 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/skills-seat.js +2 -2
- package/dist/core/runner/sub-agent-deny-lists.d.ts +24 -0
- package/dist/core/runner/sub-agent-deny-lists.js +20 -7
- package/dist/core/runner/synthetic-tools.js +2 -2
- package/dist/core/runner/tool-disclosure.js +0 -2
- package/dist/core/runner/tool-end-body.js +2 -2
- package/dist/core/runner/tool-face-overlay.d.ts +1 -1
- package/dist/core/runner/tool-face-overlay.js +26 -19
- package/dist/core/runner/tool-occurrence.d.ts +1 -1
- package/dist/core/runner/tool-occurrence.js +2 -2
- package/dist/core/runner/tool-result-media-seat.d.ts +9 -1
- package/dist/core/runner/tool-result-media-seat.js +17 -1
- package/dist/core/runner/turn-attachments.d.ts +29 -27
- package/dist/core/runner/turn-attachments.js +27 -42
- package/dist/core/runner-deps.d.ts +32 -19
- package/dist/core/secret-env.d.ts +35 -4
- package/dist/core/secret-env.js +65 -3
- package/dist/core/sensitive-path-policy.js +3 -3
- package/dist/core/session-policy-store.d.ts +12 -3
- package/dist/core/session-policy-store.js +29 -10
- package/dist/core/session-store.d.ts +5 -7
- package/dist/core/session-store.js +50 -11
- 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 +17 -5
- package/dist/core/skill-grant.js +24 -6
- package/dist/core/store-contracts/background-agent-store-contract.js +27 -0
- package/dist/core/store-contracts/checkpoint-store-contract.js +3 -2
- package/dist/core/store-contracts/mailbox-store-contract.js +31 -1
- package/dist/core/store-contracts/tool-result-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/tool-result-store-contract.js +37 -0
- package/dist/core/stub-env.d.ts +5 -5
- package/dist/core/stub-env.js +11 -1
- package/dist/core/swappable-deps.d.ts +17 -43
- package/dist/core/swappable-deps.js +15 -5
- package/dist/core/synthetic-read-verdict.d.ts +1 -1
- package/dist/core/synthetic-read-verdict.js +2 -1
- package/dist/core/task-event.d.ts +50 -10
- package/dist/core/task-notification.d.ts +88 -5
- package/dist/core/task-notification.js +146 -17
- package/dist/core/task-registry-agent.d.ts +18 -12
- package/dist/core/task-registry-agent.js +19 -6
- package/dist/core/task-registry-monitor.d.ts +7 -0
- package/dist/core/task-registry-monitor.js +28 -1
- package/dist/core/task-registry-shared.d.ts +43 -3
- package/dist/core/task-registry-shared.js +21 -7
- package/dist/core/task-registry-workflow.js +1 -1
- package/dist/core/task-registry.d.ts +50 -35
- package/dist/core/task-registry.js +64 -23
- package/dist/core/task-result.d.ts +3 -12
- package/dist/core/task-spec.d.ts +15 -7
- package/dist/core/task-stream.d.ts +1 -1
- package/dist/core/terminal-cause.d.ts +10 -0
- package/dist/core/tool-catalog-entries.js +1 -1
- package/dist/core/tool-check-reading.d.ts +1 -0
- package/dist/core/tool-check-reading.js +3 -3
- package/dist/core/tool-face-reader.d.ts +7 -6
- package/dist/core/tool-face-reader.js +4 -3
- package/dist/core/tool-name-aliases.d.ts +19 -0
- package/dist/core/tool-name-aliases.js +54 -2
- package/dist/core/tool-policy.d.ts +21 -4
- package/dist/core/tool-policy.js +1 -1
- package/dist/core/tool-registry.d.ts +5 -5
- package/dist/core/tool-registry.js +2 -2
- package/dist/core/tool-result-store.d.ts +88 -5
- package/dist/core/tool-result-store.js +51 -12
- package/dist/core/tool-roster.d.ts +112 -5
- package/dist/core/tool-roster.js +42 -1
- package/dist/core/tool-spec.d.ts +23 -5
- package/dist/core/trace.d.ts +0 -1
- package/dist/core/types.d.ts +5 -5
- package/dist/core/types.js +2 -2
- package/dist/core/untrusted-text.js +1 -1
- package/dist/core/user-attachment.d.ts +10 -5
- package/dist/core/user-attachment.js +15 -7
- package/dist/core/wiring-manifest.d.ts +6 -3
- package/dist/engine/compaction/compaction.js +29 -3
- package/dist/engine/execution-env/node-execution-env.d.ts +11 -5
- package/dist/engine/execution-env/node-execution-env.js +21 -13
- package/dist/engine/harness/agent-harness.d.ts +26 -3
- package/dist/engine/harness/agent-harness.js +49 -16
- package/dist/engine/harness/messages.d.ts +3 -1
- package/dist/engine/harness/messages.js +3 -2
- package/dist/engine/harness/types.d.ts +119 -28
- 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 +18 -7
- package/dist/engine/loop/agent-loop.d.ts +20 -12
- package/dist/engine/loop/agent-loop.js +205 -36
- package/dist/engine/loop/types.d.ts +12 -3
- package/dist/engine/lsp/node-lsp-manager.d.ts +3 -3
- package/dist/engine/lsp/node-lsp-manager.js +32 -13
- 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/storage-base.js +4 -21
- package/dist/index.d.ts +35 -21
- package/dist/index.js +26 -17
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/internal/harness.d.ts +1 -0
- package/dist/internal/llm.d.ts +1 -0
- package/dist/orchestration/run-workflow-tool.d.ts +9 -3
- package/dist/orchestration/run-workflow-tool.js +59 -29
- package/dist/orchestration/workflow-governance.d.ts +1 -1
- package/dist/orchestration/workflow-governance.js +2 -1
- 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.d.ts +4 -0
- package/dist/orchestration/workflow.js +762 -491
- package/dist/prompts/default.d.ts +1 -10
- package/dist/prompts/default.js +0 -2
- 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/background-agent-store.d.ts +1 -1
- package/dist/stores/file/background-agent-store.js +3 -1
- package/dist/stores/file/checkpoint-store.d.ts +127 -2
- package/dist/stores/file/checkpoint-store.js +19 -14
- package/dist/stores/file/file-history-store.d.ts +1 -1
- package/dist/stores/file/file-history-store.js +3 -1
- package/dist/stores/file/index.d.ts +4 -3
- package/dist/stores/file/index.js +17 -8
- package/dist/stores/file/mailbox-store.d.ts +1 -1
- package/dist/stores/file/mailbox-store.js +9 -11
- package/dist/stores/file/memory-store.d.ts +1 -1
- package/dist/stores/file/memory-store.js +3 -1
- package/dist/stores/file/session-policy-store.d.ts +1 -1
- package/dist/stores/file/session-policy-store.js +3 -1
- package/dist/stores/file/session-store.d.ts +1 -1
- package/dist/stores/file/session-store.js +3 -1
- package/dist/stores/file/shared-ledger.d.ts +26 -0
- package/dist/stores/file/shared-ledger.js +38 -9
- package/dist/stores/file/tool-result-store.d.ts +20 -2
- package/dist/stores/file/tool-result-store.js +74 -6
- package/dist/stores/file/usage-window-store.d.ts +1 -1
- package/dist/stores/file/usage-window-store.js +3 -1
- package/dist/stores/file/workflow-journal-store.d.ts +1 -11
- package/dist/stores/file/workflow-journal-store.js +3 -2
- package/dist/tools/fs/containment-face.d.ts +5 -0
- package/dist/tools/fs/encoding.d.ts +13 -4
- package/dist/tools/fs/encoding.js +17 -2
- package/dist/tools/fs/fs-bash-background-text.d.ts +7 -0
- package/dist/tools/fs/fs-bash-background-text.js +1 -0
- package/dist/tools/fs/fs-bash.d.ts +14 -4
- package/dist/tools/fs/fs-bash.js +29 -35
- package/dist/tools/fs/fs-pdf.d.ts +2 -2
- package/dist/tools/fs/fs-pdf.js +26 -21
- package/dist/tools/fs/fs-read.d.ts +5 -4
- package/dist/tools/fs/fs-read.js +35 -18
- package/dist/tools/fs/fs-search-tools.js +4 -1
- package/dist/tools/fs/fs-shared.d.ts +11 -13
- package/dist/tools/fs/fs-shared.js +11 -7
- package/dist/tools/fs/fs-write.js +5 -5
- package/dist/tools/fs/index.d.ts +14 -8
- package/dist/tools/fs/index.js +13 -5
- 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 +62 -0
- package/dist/tools/fs/read-floor.js +58 -0
- package/dist/tools/fs/removal-targets.d.ts +9 -4
- package/dist/tools/fs/removal-targets.js +17 -9
- package/dist/tools/fs/search.d.ts +3 -3
- package/dist/tools/fs/search.js +4 -4
- package/dist/tools/fs/shell-read-check.d.ts +1 -1
- package/dist/tools/fs/shell-read-check.js +2 -1
- package/dist/tools/fs/shell-read-judge.d.ts +16 -8
- 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 +9 -4
- package/dist/tools/monitor.js +17 -8
- package/dist/tools/scheduler-tools.js +42 -4
- package/dist/tools/web.d.ts +0 -10
- package/dist/tools/web.js +1 -4
- package/package.json +5 -2
- package/test/export-surface.snapshot.json +161 -21
- package/wire-changes/core-stores-sql@7.59.0.json +29 -0
- package/wire-changes/core-stores-sql@7.60.0.json +30 -0
- package/wire-changes/core@7.59.0.json +2459 -0
- package/wire-changes/core@7.60.0.json +3274 -0
- package/wire-changes/mods-kernel@7.59.0.json +29 -0
- package/wire-changes/mods-kernel@7.60.0.json +62 -0
- package/wire-changes/primitives@7.59.0.json +29 -0
- package/wire-changes/primitives@7.60.0.json +30 -0
|
@@ -716,7 +716,8 @@ export type ResumeOutcome = {
|
|
|
716
716
|
* trusted/untrusted delivery framing as {@link CheckpointState.pendingSteerQueue}). It rides the resume
|
|
717
717
|
* continuation's steer tail as its OWN segment, appended AFTER any already-parked queue entry
|
|
718
718
|
* (X5: both are delivered — the wake message never displaces a parked, undelivered supervisor steer;
|
|
719
|
-
* each segment is framed under its own `trusted` semantics, never one merged trust domain).
|
|
719
|
+
* each segment is framed under its own `trusted` semantics, never one merged trust domain). Under a held
|
|
720
|
+
* `inputId` it is judged by {@link judgeParkedSteerRepeat}: identical ⇒ that entry, once. WITHOUT a
|
|
720
721
|
* `message`, the checkpoint must already carry a parked steer — a wake with nothing to
|
|
721
722
|
* deliver is rejected (`wake.nothing_to_deliver`, anti spin-wake). Idempotency rides the existing
|
|
722
723
|
* resolve CAS: a second wake of the same token loses the CAS (`checkpoint.already_resolved`). */
|
|
@@ -877,9 +878,9 @@ export type PendingAction = {
|
|
|
877
878
|
* this action against, read off the leg's tool roster at the suspend station — `capabilityId`
|
|
878
879
|
* (engine-minted over {source, peer, name, contractId}), `contractId`, `shapeDigest`,
|
|
879
880
|
* `implementationRevision`. With the face below they are the TOOL member of the row's approval object
|
|
880
|
-
* (`judgeApprovalObject`): an identity member that differs from the same-name row on the resuming leg
|
|
881
|
-
*
|
|
882
|
-
*
|
|
881
|
+
* (`judgeApprovalObject`): an identity member that differs from the same-name row on the resuming leg is a replacement
|
|
882
|
+
* wearing the name (`resume.tool_contract_mismatch`, a reopen); a face or declaration that differs vetoes the call
|
|
883
|
+
* (`resume.target_moved`). Any of them ABSENT (or the family, or the declaration digest) ⇒ the row binds no tool.
|
|
883
884
|
*/
|
|
884
885
|
capabilityId?: string;
|
|
885
886
|
contractId?: string;
|
|
@@ -890,7 +891,7 @@ export type PendingAction = {
|
|
|
890
891
|
* display `family` + declared `pathTarget` — off the same roster row at the same mint. The pre-CAS resume-edit
|
|
891
892
|
* recheck has no roster yet; it rebuilds the call face from these (`parkedCallFaceOf`) and judges the edit as
|
|
892
893
|
* the live gate judged the original (merge-seam H1: without them a caller slot fell to the catalog's slot for
|
|
893
|
-
* the NAME).
|
|
894
|
+
* the NAME). Read only on a whole tool member: an absent `pathTarget` (or resolution member) is then the declaration's own silence.
|
|
894
895
|
*/
|
|
895
896
|
family?: import("./tool-face.js").ToolFamily;
|
|
896
897
|
pathTarget?: import("./tool-face.js").ToolRosterPathTarget;
|
|
@@ -909,6 +910,8 @@ export type PendingAction = {
|
|
|
909
910
|
* carries): what the identity members above cannot say (a host-mounted engine definition has the same ones). The pre-CAS
|
|
910
911
|
* recheck rebuilds the face from the row (`parkedCallFaceOf`); absent ⇒ judged as an ordinary tool. Word `mount_site`. */
|
|
911
912
|
engineMounted?: true;
|
|
913
|
+
/** The digest of the roster row's DECLARATION members (`toolDeclarationDigestOf`): a live row whose declaration differs vetoes the call (`resume.target_moved`). Word `tool_declaration`. */
|
|
914
|
+
declarationDigest?: string;
|
|
912
915
|
/** The approval object's TARGETS (`approvalTargetsOf`): per reading of the path slot, where it resolved when the card
|
|
913
916
|
* was asked; absent ⇒ not judged. A role resolving elsewhere at the execution vetoes the call (`resume.target_moved`). */
|
|
914
917
|
targets?: import("./approval-object.js").ApprovalTargets;
|
|
@@ -964,9 +967,18 @@ export type PendingAction = {
|
|
|
964
967
|
* reviews the PLAN, not a tool call — so this arm has no tool fields. Every consumer that reads the
|
|
965
968
|
* `tool_approval` fields above MUST branch on `kind` FIRST: a `plan_review` checkpoint must never flow into
|
|
966
969
|
* a `resource_limit`- or `tool_approval`-shaped continuation (a contract test pins this). The plan artifact
|
|
967
|
-
* is a PROFILE concern (a REF — design/76 §9); core stores no plan here.
|
|
970
|
+
* is a PROFILE concern (a REF — design/76 §9); core stores no plan here.
|
|
971
|
+
*
|
|
972
|
+
* `requestedByCallId` is the id of the tool call that ASKED for this pause (the `ExitPlanMode` call for the
|
|
973
|
+
* first-party plan tool): which transcript call carries the plan awaiting a decision, so a card can join the pause to
|
|
974
|
+
* the call that presented it instead of guessing by adjacency. It is PROVENANCE, not a binding — the pause
|
|
975
|
+
* still gates no call, `toolCallId` stays absent on this arm, and nothing on the resume path reads the id. Written
|
|
976
|
+
* once, at the park mint, from the engine-bound call id (a tool cannot name another call's id); the paused
|
|
977
|
+
* cause and the inbox summary echo it. ABSENT for a pause whose requester carried no call id (a revive context,
|
|
978
|
+
* a row a deployment minted itself, a row from an engine before this member). */
|
|
968
979
|
| {
|
|
969
980
|
kind: "plan_review";
|
|
981
|
+
requestedByCallId?: string;
|
|
970
982
|
}
|
|
971
983
|
/** design/144 §3 (X2) — the NON-GATE arm: nothing pends a decision. The shape of a deployment-minted
|
|
972
984
|
* PARK checkpoint (approval-timeout park / pure suspend; paired with `gate.kind === "task_done"`, the
|
|
@@ -1355,7 +1367,7 @@ export interface CheckpointState {
|
|
|
1355
1367
|
placementRootSessionId?: string;
|
|
1356
1368
|
/**
|
|
1357
1369
|
* design/380 O9a — MONOTONIC presence bit: this run's hand-tool content fold was EXTERNAL-TARGET
|
|
1358
|
-
* armed (the env declared `
|
|
1370
|
+
* armed (the env declared `capabilities.externalContentTarget`, or an earlier leg of this suspend
|
|
1359
1371
|
* chain did). Stamped at the suspend mint from the run's RESOLVED fold state — never from first
|
|
1360
1372
|
* tool use, so a park landing BEFORE the first hand call is covered too. Presence-coded like
|
|
1361
1373
|
* {@link isDelegatedChild} (absent = never armed; never `false`). The resume side folds
|
|
@@ -1962,6 +1974,13 @@ export interface CheckpointIndexFacts {
|
|
|
1962
1974
|
/** Derive a row's {@link CheckpointIndexFacts}. Pure: reads no clock, writes nothing; the approval card is read
|
|
1963
1975
|
* through {@link parkedApprovalCardOf} (the one card reading), the tool fields only off a `tool_approval` action. */
|
|
1964
1976
|
export declare function checkpointIndexFacts(cp: Checkpoint): CheckpointIndexFacts;
|
|
1977
|
+
/**
|
|
1978
|
+
* The ONE reading of {@link PendingAction} `plan_review.requestedByCallId` — the id of the call that asked for a plan
|
|
1979
|
+
* pause. A non-empty string on a `plan_review` pending action; every other kind, an absent member and a damaged value
|
|
1980
|
+
* (a non-string, an empty string) read as `undefined`, so no consumer echoes a value the mint never wrote. The paused
|
|
1981
|
+
* cause and the inbox summary both read it here.
|
|
1982
|
+
*/
|
|
1983
|
+
export declare function planReviewRequesterOf(pendingAction: PendingAction): string | undefined;
|
|
1965
1984
|
/**
|
|
1966
1985
|
* design/80 assistant-scheduler seam #1: a LIGHTWEIGHT projection of one PENDING
|
|
1967
1986
|
* checkpoint, returned in bulk by {@link CheckpointStore.listByScope} so a supervisor scheduler can list a
|
|
@@ -2014,6 +2033,11 @@ export interface CheckpointSummary {
|
|
|
2014
2033
|
* face) must not materialize the keys as `null` on the way out. Pinned in
|
|
2015
2034
|
* `test/checkpoint-store.test.ts` ("tool-less park …"). */
|
|
2016
2035
|
toolCallId?: string;
|
|
2036
|
+
/** The id of the tool call that asked for this plan pause ({@link PendingAction} `plan_review.requestedByCallId`) —
|
|
2037
|
+
* present ONLY on a `plan_review` row whose requester carried a call id; OMITTED on every other row (the
|
|
2038
|
+
* {@link toolCallId} absence-shape note applies). It names the call that PRESENTED the plan, not a call the pause
|
|
2039
|
+
* gates: `toolCallId` stays omitted on a plan_review row. */
|
|
2040
|
+
requestedByCallId?: string;
|
|
2017
2041
|
/** The pending tool's name ({@link PendingAction} `tool_approval.toolName`) when this is an approval suspend.
|
|
2018
2042
|
* OMITTED (not `null`) for a non-`tool_approval` pendingAction — see {@link toolCallId}'s absence-shape note. */
|
|
2019
2043
|
toolName?: string;
|
|
@@ -2175,7 +2199,9 @@ export declare function summarizeCheckpoint(cp: Checkpoint, disclose?: (sentence
|
|
|
2175
2199
|
* worker), `"env_factory_missing"` (retryable on a factory-wired worker),
|
|
2176
2200
|
* `"governed_unwired"` (retryable on an org-wired worker), `"origin_missing"` (a pending approval row
|
|
2177
2201
|
* minted before the ask's origin was persisted on the park — terminal for the row's bytes; the host
|
|
2178
|
-
* decides the orphaned card itself, no worker version redeems it), `"
|
|
2202
|
+
* decides the orphaned card itself, no worker version redeems it), `"tool_identity_missing"` (a pending approval row
|
|
2203
|
+
* whose tool member is not whole — parked before 7.58.0 recorded the declaration, or damaged: an allow is refused, a deny
|
|
2204
|
+
* settles it; a worker of the release that parked it still reads it), `"ledger_event_unknown"` (a durable
|
|
2179
2205
|
* LEDGER carries an event kind this binary does not know, so the replay is refused rather than served
|
|
2180
2206
|
* incomplete — the one arm that is not row-scoped: NO row in that data directory is readable here, so
|
|
2181
2207
|
* the host rolls the binary forward instead of routing one token elsewhere), `"seat_retired"` (the row
|
|
@@ -2183,10 +2209,14 @@ export declare function summarizeCheckpoint(cp: Checkpoint, disclose?: (sentence
|
|
|
2183
2209
|
* steer seat, which no worker version reads and the host decides itself, or a retired mode-seed member of
|
|
2184
2210
|
* `inheritedGate`, which an engine at 7.38.x or earlier still reads once).
|
|
2185
2211
|
* · `invalid_outcome` pre-CAS row-integrity arms: `"real_approval_damaged"`, `"real_approval_forged"`,
|
|
2186
|
-
* `"read_face_damaged"`, `"read_face_forged"`, `"write_face_damaged"`, `"skill_grants_damaged"`, `"skill_scopes_damaged"`, `"constraint_chain_missing"`, `"hands_coordinates_damaged"`, `"requirements_damaged"` (all terminal for the row's
|
|
2212
|
+
* `"read_face_damaged"`, `"read_face_forged"`, `"write_face_damaged"`, `"skill_grants_damaged"`, `"skill_scopes_damaged"`, `"constraint_chain_missing"`, `"hands_coordinates_damaged"`, `"requirements_damaged"`, `"bound_input_hash_missing"` (all terminal for the row's
|
|
2187
2213
|
* current bytes — no worker version redeems a damaged row).
|
|
2214
|
+
*
|
|
2215
|
+
* THE ONE RULE for `checkpoint.invalid_outcome` (registered in `docs/CLOSED-SETS.md`, which also says what a host reads from it): `detail.reason` is a
|
|
2216
|
+
* ROW-INTEGRITY word and only that, `detail.field` ({@link CheckpointErrorField}) names the cell of the decision to act on, a refusal carries at most
|
|
2217
|
+
* one of them, and a refusal with neither is never a damaged row.
|
|
2188
2218
|
*/
|
|
2189
|
-
export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "governed_unwired" | "origin_missing" | "ledger_event_unknown" | "seat_retired" | "real_approval_damaged" | "real_approval_forged" | "read_face_damaged" | "read_face_forged"
|
|
2219
|
+
export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "governed_unwired" | "origin_missing" | "tool_identity_missing" | "ledger_event_unknown" | "seat_retired" | "real_approval_damaged" | "real_approval_forged" | "read_face_damaged" | "read_face_forged"
|
|
2190
2220
|
/** `state.writeFace` is present but not a well-formed section. No `_forged` twin: the section is
|
|
2191
2221
|
* legal-and-absent at every version, so there is no version to judge a fabrication against — and a
|
|
2192
2222
|
* fabricated "open" still needs the LIVE resolution to say open too. */
|
|
@@ -2199,6 +2229,10 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
|
|
|
2199
2229
|
* is present below v10, or does not equal the words the row's content carries (a segment dropped, or a word not
|
|
2200
2230
|
* declared) — terminal for the row's bytes. */
|
|
2201
2231
|
| "requirements_damaged"
|
|
2232
|
+
/** A pending tool approval whose row format is at or above the binding era carries no persisted `boundInputHash` — every mint at that
|
|
2233
|
+
* version writes one, so its absence is corruption or a caller-declared downgrade, and the decision-action input binding has nothing to
|
|
2234
|
+
* bind to. Terminal for the row's bytes (a pre-binding row, which never minted a hash, binds on `boundCallId` alone and is not this). */
|
|
2235
|
+
| "bound_input_hash_missing"
|
|
2202
2236
|
/** On `resume.parent_constraint_mismatch`: a re-supplied chain entry whose path rules depend on the leg that installed it has
|
|
2203
2237
|
* no installation record (a chain written before the record existed) / a record that does not cover the chain entry for
|
|
2204
2238
|
* entry / a record member naming no absolute root. */
|
|
@@ -2212,9 +2246,8 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
|
|
|
2212
2246
|
| "not_a_list" | "not_a_string" | "unknown_name" | "unsupported_pattern" | "invalid_record" | "renamed_mount" | "registry_occupied"
|
|
2213
2247
|
/** On `config.unknown_role` (a fresh run's terminal `detail.detail.reason`; on a resume, `detail.reason` of `checkpoint.config_refused` with `detail.code` `config.unknown_role`)
|
|
2214
2248
|
* — a model binding or a role word the engine cannot read: a word the model catalog does not hold (`"unknown_model_ref"`), a value that is
|
|
2215
|
-
* no model reference at all — a number, a boolean, a list (`"not_a_model_ref"`), or a role word outside the vocabulary — a `roles` key, a
|
|
2216
|
-
|
|
2217
|
-
| "unknown_model_ref" | "not_a_model_ref" | "unknown_role_word";
|
|
2249
|
+
* no model reference at all — a number, a boolean, a list (`"not_a_model_ref"`), or a role word outside the vocabulary — a `roles` key, a `modelRole` value (`"unknown_role_word"`) — or a task naming no model whose requested role and fallback chain supply none (`"no_model_for_role"`, `field` the requested role's seat). The sentence names the seat the refusal's `field` names (`roles.consolidate`, `tiers.pro`, `TaskSpec.model`). */
|
|
2250
|
+
| "unknown_model_ref" | "not_a_model_ref" | "unknown_role_word" | "no_model_for_role";
|
|
2218
2251
|
/**
|
|
2219
2252
|
* The codes a RESUME's pre-claim configuration screen carries as `detail.code` of a `checkpoint.config_refused` — the words prepare's
|
|
2220
2253
|
* doors throw, held unchanged so one refusal reads the same on a fresh run (`TaskResult.errorCode`) and on a resume: the mode, output-style,
|
|
@@ -2237,7 +2270,7 @@ export type CheckpointConfigRefusalCode = (typeof CHECKPOINT_CONFIG_REFUSAL_CODE
|
|
|
2237
2270
|
export declare const isCheckpointConfigRefusalCode: (word: unknown) => word is CheckpointConfigRefusalCode;
|
|
2238
2271
|
/** The words of a {@link CheckpointError}'s optional `detail.field` (what each means: the `detail` member's doc). A CLOSED SET with one home, registered in
|
|
2239
2272
|
* `docs/CLOSED-SETS.md`: a consumer holding a table over it is tsc-red on a new word until it places the word. */
|
|
2240
|
-
export type CheckpointErrorField = "boundCallId" | "boundInputHash" | "boundGrantDigest" | "answer" | "hostDecision" | "approver" | "feedback" | "taskConfig" | "deps" | "inheritedGate";
|
|
2273
|
+
export type CheckpointErrorField = "boundCallId" | "boundInputHash" | "boundGrantDigest" | "answer" | "hostDecision" | "approver" | "feedback" | "outcome" | "updatedInput" | "decision" | "reason" | "taskConfig" | "deps" | "inheritedGate";
|
|
2241
2274
|
/** A typed checkpoint-store error so callers branch on `code` (mirrors `SessionError`). */
|
|
2242
2275
|
export declare class CheckpointError extends Error {
|
|
2243
2276
|
readonly code: "checkpoint.already_exists" | "checkpoint.already_resolved" | "checkpoint.not_found"
|
|
@@ -2420,7 +2453,10 @@ export declare class CheckpointError extends Error {
|
|
|
2420
2453
|
* resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
|
|
2421
2454
|
* well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
|
|
2422
2455
|
* it), or `"feedback"` (the allow's `feedback` is not fit to deliver — it carries the engine's `<system-reminder>` tag, is not a string, rides a deny,
|
|
2423
|
-
* or rides a decide a machine made: re-decide with the words changed or dropped; the binding did not change)
|
|
2456
|
+
* or rides a decide a machine made: re-decide with the words changed or dropped; the binding did not change), or — an approval decide's own
|
|
2457
|
+
* payload — `"outcome"` (the resume's outcome is not an object naming its gate: send one), `"updatedInput"` (the person's edit is not plain JSON data the
|
|
2458
|
+
* engine can capture: re-decide with a plain edit, or without one), `"decision"` (the verdict word is neither `allow` nor `deny`) or `"reason"` (the deny's
|
|
2459
|
+
* words are not a plain string, or carry the engine's `<system-reminder>` tag: change or drop them; the binding did not change). On a `checkpoint.config_refused` `field` names which INPUT carries the refusal — `"taskConfig"`
|
|
2424
2460
|
* (the re-supplied config: correct it and resume the same token), `"deps"` (the deployment's own seat — and the policies the
|
|
2425
2461
|
* caller re-supplies as inherited constraints: correct them and resume the same token) or `"inheritedGate"` (the row's record: no config reaches it; expire the row). The throw
|
|
2426
2462
|
* sites always knew which arm fired; this carries that fact instead of dropping it (ruled
|
|
@@ -2633,7 +2669,10 @@ export declare class CheckpointError extends Error {
|
|
|
2633
2669
|
* resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
|
|
2634
2670
|
* well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
|
|
2635
2671
|
* it), or `"feedback"` (the allow's `feedback` is not fit to deliver — it carries the engine's `<system-reminder>` tag, is not a string, rides a deny,
|
|
2636
|
-
* or rides a decide a machine made: re-decide with the words changed or dropped; the binding did not change)
|
|
2672
|
+
* or rides a decide a machine made: re-decide with the words changed or dropped; the binding did not change), or — an approval decide's own
|
|
2673
|
+
* payload — `"outcome"` (the resume's outcome is not an object naming its gate: send one), `"updatedInput"` (the person's edit is not plain JSON data the
|
|
2674
|
+
* engine can capture: re-decide with a plain edit, or without one), `"decision"` (the verdict word is neither `allow` nor `deny`) or `"reason"` (the deny's
|
|
2675
|
+
* words are not a plain string, or carry the engine's `<system-reminder>` tag: change or drop them; the binding did not change). On a `checkpoint.config_refused` `field` names which INPUT carries the refusal — `"taskConfig"`
|
|
2637
2676
|
* (the re-supplied config: correct it and resume the same token), `"deps"` (the deployment's own seat — and the policies the
|
|
2638
2677
|
* caller re-supplies as inherited constraints: correct them and resume the same token) or `"inheritedGate"` (the row's record: no config reaches it; expire the row). The throw
|
|
2639
2678
|
* sites always knew which arm fired; this carries that fact instead of dropping it (ruled
|
|
@@ -3036,12 +3075,9 @@ export interface CheckpointStore {
|
|
|
3036
3075
|
* full {@link Checkpoint} payloads. Read-only — it never mutates a row, takes no CAS, and has ZERO effect on
|
|
3037
3076
|
* the once-only resolve. The PENDING predicate is byte-for-byte the {@link resolve} CAS's (`scope === scope &&
|
|
3038
3077
|
* status === 'pending'`), so the list reflects exactly the rows that are still resumable. Order is unspecified
|
|
3039
|
-
* (the inbox sorts by `severity`/`deadline` itself). An empty scope returns `[]`.
|
|
3040
|
-
*
|
|
3041
|
-
* **OPTIONAL** for backward-compat (RL-1336-checkpoint-listbyscope) with external {@link CheckpointStore} impls (a caller probes
|
|
3042
|
-
* `store.listByScope?.(scope) ?? []`); ALL THREE first-party impls (in-memory, file, Pg) provide it.
|
|
3078
|
+
* (the inbox sorts by `severity`/`deadline` itself). An empty scope returns `[]`. Required: every store answers it.
|
|
3043
3079
|
*/
|
|
3044
|
-
listByScope
|
|
3080
|
+
listByScope(scope: string): Promise<CheckpointSummary[]>;
|
|
3045
3081
|
/**
|
|
3046
3082
|
* Deployment seam: the DISTINCT scopes that currently have at least one PENDING checkpoint — the
|
|
3047
3083
|
* enumeration face `listByScope` lacks. A host keeping its own scope registry (e.g. a sidecar file for a
|
|
@@ -3050,7 +3086,7 @@ export interface CheckpointStore {
|
|
|
3050
3086
|
* it matches `listByScope`'s visible surface, so `listScopes() × listByScope()` is exactly the full inbox,
|
|
3051
3087
|
* and a member the summary does not project is read with `get(token)` on the listed token — the composition
|
|
3052
3088
|
* a deployment's approval queue is, rather than a query of its own over the store's rows.
|
|
3053
|
-
* **OPTIONAL**
|
|
3089
|
+
* **OPTIONAL** (unlike the required {@link listByScope}); the in-memory and file first-party impls provide it.
|
|
3054
3090
|
*/
|
|
3055
3091
|
listScopes?(): Promise<string[]>;
|
|
3056
3092
|
/** The PENDING rows of every scope past their deadline, one facet per call ({@link CheckpointOverdueQuery}; read by
|
|
@@ -3139,6 +3175,12 @@ export declare const ACTOR_ASSERTION_FROZEN_FIELDS: readonly ["id", "hostAsserte
|
|
|
3139
3175
|
* on its own surface and parks it again through `setPendingSteer` if it still applies.
|
|
3140
3176
|
*/
|
|
3141
3177
|
export declare function readPendingSteerQueue(state: Pick<CheckpointState, "pendingSteerQueue">): PendingSteerEntry[];
|
|
3178
|
+
/**
|
|
3179
|
+
* The parked queue's ONE identity judgment (the append below and the wake entrance read it): the held entry
|
|
3180
|
+
* when `entry` repeats it identically (the replay), `undefined` for a new `inputId`, else
|
|
3181
|
+
* `steering.duplicate_input_id` naming the facets that differ — the key alone is no proof of a replay.
|
|
3182
|
+
*/
|
|
3183
|
+
export declare function judgeParkedSteerRepeat(queue: readonly PendingSteerEntry[], entry: Omit<PendingSteerEntry, "seq">): PendingSteerEntry | undefined;
|
|
3142
3184
|
/**
|
|
3143
3185
|
* design/171 §5.3/§6.3 — THE append, shared by every backend so the bounds and the ordering are one
|
|
3144
3186
|
* implementation rather than one per store.
|
|
@@ -3204,9 +3246,8 @@ export declare class InMemoryCheckpointStore implements CheckpointStore {
|
|
|
3204
3246
|
readonly deleteSessionCheckpoints?: (sessionId: string, guard: CheckpointDeleteGuard) => Promise<number>;
|
|
3205
3247
|
/** `disclose` is the listing projections' own seat ({@link summarizeCheckpoint}'s and the listing faces'): this store has no
|
|
3206
3248
|
* path, so it forwards each sentence for a row read past a damage, called synchronously by the listing that read it.
|
|
3207
|
-
* `sessionHeadOf` (a session store's `headOf`) is what {@link CheckpointStore.deleteSessionCheckpoints} judges its guard by.
|
|
3208
|
-
|
|
3209
|
-
constructor(opts?: {
|
|
3249
|
+
* `sessionHeadOf` (a session store's `headOf`) is what {@link CheckpointStore.deleteSessionCheckpoints} judges its guard by; `holderIsCurrent` ({@link HolderJudge}), a resolve's `expect.holder`. */
|
|
3250
|
+
constructor(options?: {
|
|
3210
3251
|
disclose?: (sentence: string) => void;
|
|
3211
3252
|
sessionHeadOf?: (sessionId: string) => Promise<{
|
|
3212
3253
|
readonly owner: string | null;
|
|
@@ -3,7 +3,7 @@ import { uuidv7 } from "../internal/harness.js";
|
|
|
3
3
|
import { PROBE_CAUSE_PATH_MAX, PROBE_REASON_MAX, inlineUntrusted, sanitizeUntrustedText } from "./untrusted-text.js";
|
|
4
4
|
import { carriesBidiControls } from "./tool-policy.js";
|
|
5
5
|
import { isAutoModeFallbackCause, readDenialLimitFallback } from "./auto-mode.js";
|
|
6
|
-
import { isAskOrigin, isPersistedRuleMandate } from "./ask-origin.js";
|
|
6
|
+
import { isAskOrigin, isPermissionMode, isPersistedRuleMandate } from "./ask-origin.js";
|
|
7
7
|
import { isRunOrigin, RUN_ORIGINS } from "./run-origin.js";
|
|
8
8
|
import { describeRejectedValue } from "./tool-search-setting.js";
|
|
9
9
|
import { readBoundBinding } from "./skill-grant-binding.js";
|
|
@@ -14,8 +14,8 @@ import { checkpointDeadlinePassed, deleteSessionRowsAtStart, readCheckpointOverd
|
|
|
14
14
|
import { renderUntrustedCommandText, stripFormatCharacters } from "./permission-rule-model.js";
|
|
15
15
|
import { egressText } from "./untrusted-egress.js";
|
|
16
16
|
import { steerReplayRefusal } from "./steer-replay.js";
|
|
17
|
-
import { isPermissionMode } from "./ask-origin.js";
|
|
18
17
|
import { readRetentionDeclaration } from "./retention.js";
|
|
18
|
+
import { receiveOptions } from "./own-property-receipt.js";
|
|
19
19
|
export function mintCheckpointToken() {
|
|
20
20
|
return randomBytes(16).toString("hex");
|
|
21
21
|
}
|
|
@@ -275,6 +275,12 @@ export function checkpointIndexFacts(cp) {
|
|
|
275
275
|
hasBidiControls: tool?.hasBidiControls === true ? true : null,
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
|
+
export function planReviewRequesterOf(pendingAction) {
|
|
279
|
+
if (pendingAction.kind !== "plan_review")
|
|
280
|
+
return undefined;
|
|
281
|
+
const id = pendingAction.requestedByCallId;
|
|
282
|
+
return typeof id === "string" && id !== "" ? id : undefined;
|
|
283
|
+
}
|
|
278
284
|
export function summarizeCheckpoint(cp, disclose) {
|
|
279
285
|
const facts = checkpointIndexFacts(cp);
|
|
280
286
|
const descriptor = facts.riskDescriptor;
|
|
@@ -285,6 +291,7 @@ export function summarizeCheckpoint(cp, disclose) {
|
|
|
285
291
|
}
|
|
286
292
|
const cardReading = parkedApprovalCardOf(cp.gate);
|
|
287
293
|
const tool = cp.pendingAction.kind === "tool_approval" ? cp.pendingAction : undefined;
|
|
294
|
+
const requestedByCallId = planReviewRequesterOf(cp.pendingAction);
|
|
288
295
|
let toolInput;
|
|
289
296
|
if (tool !== undefined) {
|
|
290
297
|
try {
|
|
@@ -313,6 +320,7 @@ export function summarizeCheckpoint(cp, disclose) {
|
|
|
313
320
|
...(cp.sourceTaskId !== undefined ? { sourceTaskId: cp.sourceTaskId } : {}),
|
|
314
321
|
...(cp.principal !== undefined ? { principal: cp.principal } : {}),
|
|
315
322
|
...(facts.toolCallId !== null ? { toolCallId: facts.toolCallId } : {}),
|
|
323
|
+
...(requestedByCallId !== undefined ? { requestedByCallId } : {}),
|
|
316
324
|
...(facts.toolName !== null ? { toolName: facts.toolName } : {}),
|
|
317
325
|
...(cardReading.kind === "card" ? { approvalCard: cardReading.card } : {}),
|
|
318
326
|
...(toolInput !== undefined ? { toolInput } : {}),
|
|
@@ -536,15 +544,19 @@ export function readPendingSteerQueue(state) {
|
|
|
536
544
|
}
|
|
537
545
|
return [...(state.pendingSteerQueue ?? [])].sort((a, b) => a.seq - b.seq);
|
|
538
546
|
}
|
|
547
|
+
export function judgeParkedSteerRepeat(queue, entry) {
|
|
548
|
+
const collision = queue.find((e) => e.inputId === entry.inputId);
|
|
549
|
+
if (collision === undefined)
|
|
550
|
+
return undefined;
|
|
551
|
+
const refusal = steerReplayRefusal(collision, entry, { seat: "parked", inputId: entry.inputId });
|
|
552
|
+
if (refusal !== undefined)
|
|
553
|
+
throw new CheckpointError("steering.duplicate_input_id", refusal.message, refusal.detail);
|
|
554
|
+
return collision;
|
|
555
|
+
}
|
|
539
556
|
export function appendPendingSteer(state, entry) {
|
|
540
557
|
const current = readPendingSteerQueue(state);
|
|
541
|
-
|
|
542
|
-
if (collision !== undefined) {
|
|
543
|
-
const refusal = steerReplayRefusal(collision, entry, { seat: "parked", inputId: entry.inputId });
|
|
544
|
-
if (refusal !== undefined)
|
|
545
|
-
throw new CheckpointError("steering.duplicate_input_id", refusal.message, refusal.detail);
|
|
558
|
+
if (judgeParkedSteerRepeat(current, entry) !== undefined)
|
|
546
559
|
return current;
|
|
547
|
-
}
|
|
548
560
|
const nextSeq = current.reduce((max, e) => Math.max(max, e.seq), 0) + 1;
|
|
549
561
|
const next = [...current, { ...entry, seq: nextSeq }];
|
|
550
562
|
const totalEntries = next.length;
|
|
@@ -571,7 +583,8 @@ export class InMemoryCheckpointStore {
|
|
|
571
583
|
fault = null;
|
|
572
584
|
disclose;
|
|
573
585
|
holderIsCurrent;
|
|
574
|
-
constructor(
|
|
586
|
+
constructor(options) {
|
|
587
|
+
const opts = receiveOptions(options, "InMemoryCheckpointStore");
|
|
575
588
|
this.retention = readRetentionDeclaration("InMemoryCheckpointStore.retention", opts.retention);
|
|
576
589
|
this.disclose = opts.disclose;
|
|
577
590
|
this.holderIsCurrent = opts.holderIsCurrent;
|
|
@@ -125,6 +125,12 @@ export declare const CLAMP_SET: Readonly<{
|
|
|
125
125
|
readonly script: true;
|
|
126
126
|
readonly carrier: "specSeat";
|
|
127
127
|
}>;
|
|
128
|
+
classifyAllShell: Readonly<{
|
|
129
|
+
readonly law: "restricting";
|
|
130
|
+
readonly value: true;
|
|
131
|
+
readonly script: true;
|
|
132
|
+
readonly carrier: "specSeat";
|
|
133
|
+
}>;
|
|
128
134
|
fileHistory: Readonly<{
|
|
129
135
|
readonly law: "restricting";
|
|
130
136
|
readonly value: "disabled";
|
|
@@ -257,6 +263,23 @@ export declare function clampRecordError(message: string): Error & {
|
|
|
257
263
|
* whose value is `undefined` carries nothing and is read as absent (the retired-key door's presence rule).
|
|
258
264
|
*/
|
|
259
265
|
export declare function assertClampRecord(record: unknown, owner: string, carrier?: ClampCarrier, extra?: readonly string[]): void;
|
|
266
|
+
/**
|
|
267
|
+
* Read a STATED floor — the clamp values a durable record says its run was born under — back under the table's law, or say
|
|
268
|
+
* why it cannot be read. A floor is the table's own value shape ({@link ClampValues}) and nothing looser: every key a row,
|
|
269
|
+
* a restricting row's value exactly its restricting value (a field row: exactly `{ <field>: <value> }`), an add-only row a
|
|
270
|
+
* non-empty list whose every entry its row's entry law accepts. `{}` is a floor (nothing was clamped); ABSENT is not — a
|
|
271
|
+
* record that states no floor cannot say what a revival under it would widen, and a key this build's table does not have
|
|
272
|
+
* (a newer writer's row) is refused rather than ignored, because ignoring it drops a restriction.
|
|
273
|
+
* The floor is judged and projected from ONE plain-data copy (`structuredClone`): a value that is not plain data refuses, and
|
|
274
|
+
* nothing an accessor answers on a second read can differ from what was judged.
|
|
275
|
+
*/
|
|
276
|
+
export declare function readClampFloor(floor: unknown): {
|
|
277
|
+
ok: true;
|
|
278
|
+
floor: ClampValues;
|
|
279
|
+
} | {
|
|
280
|
+
ok: false;
|
|
281
|
+
why: string;
|
|
282
|
+
};
|
|
260
283
|
/** The restricting values of every row that ANY of `records` carries — the clamp seat a waker hands a revival. */
|
|
261
284
|
export declare function clampValuesOf(...records: ReadonlyArray<object | undefined>): ClampValues;
|
|
262
285
|
/**
|
|
@@ -286,6 +309,12 @@ export declare const CHILD_CLAMP_SEATS_NOT_CARRIED: Readonly<Record<string, stri
|
|
|
286
309
|
* shape it misses leaves the real constructor invisible while a namesake answers for it.
|
|
287
310
|
*/
|
|
288
311
|
export declare const ENGINE_CHILD_SPEC_CONSTRUCTORS: readonly ["src/agents/subagent.ts#buildChildSpec", "src/agents/subagent.ts#observerSpec", "src/agents/subagent.ts#resumeSpec", "src/agents/verify.ts#verifierSpec", "src/agents/verify.ts#fixLegSpec", "src/orchestration/workflow-primitives.ts#workflowChildClamps"];
|
|
312
|
+
/** Do these clamps leave nobody on the leg to ask — the hard-headless clamp (`interactiveTools: false`) or the declaration
|
|
313
|
+
* that nobody can be asked (`approvalReach: "none"`)? The one reading {@link postureUnderClamps} and a revival's posture read. */
|
|
314
|
+
export declare function clampsReachNoPerson(clamps: {
|
|
315
|
+
readonly interactiveTools: boolean | undefined;
|
|
316
|
+
readonly approvalReach: TaskSpec["approvalReach"] | undefined;
|
|
317
|
+
}): boolean;
|
|
289
318
|
/**
|
|
290
319
|
* The interaction posture a leg keeps under the clamps it inherited: `"interactive"` promises a person on the leg, and a
|
|
291
320
|
* leg that inherited the hard-headless clamp (`interactiveTools: false`) or the declaration that nobody can be asked
|
|
@@ -86,6 +86,7 @@ export const CLAMP_SET = Object.freeze({
|
|
|
86
86
|
complianceAdditionalDenies: Object.freeze({ law: "addOnly", identity: complianceIdentity, entry: complianceCapabilityProblem, script: COMPLIANCE_SCRIPT_LAW, deploymentLayer: "compliancePostureResolver", carrier: "clamp" }),
|
|
87
87
|
oneShot: Object.freeze({ law: "restricting", value: true, script: true, carrier: "specSeat" }),
|
|
88
88
|
memoryPersistenceCapable: Object.freeze({ law: "restricting", value: false, script: true, carrier: "specSeat" }),
|
|
89
|
+
classifyAllShell: Object.freeze({ law: "restricting", value: true, script: true, carrier: "specSeat" }),
|
|
89
90
|
fileHistory: Object.freeze({ law: "restricting", value: "disabled", script: false, carrier: "specSeat" }),
|
|
90
91
|
projectMemory: Object.freeze({ law: "restricting", value: "disabled", script: false, carrier: "specSeat" }),
|
|
91
92
|
promptForm: Object.freeze({ law: "restricting", value: "minimal", script: false, carrier: "specSeat" }),
|
|
@@ -239,6 +240,57 @@ export function assertClampRecord(record, owner, carrier, extra = []) {
|
|
|
239
240
|
throw clampRecordError(`${owner} names ${unknown.map((k) => JSON.stringify(k)).join(", ")}, which the clamp table does not carry there — the legal seats are ${legal.join(", ")}. Refused rather than ignored: a seat nobody reads would read to the caller as wired.`);
|
|
240
241
|
}
|
|
241
242
|
}
|
|
243
|
+
export function readClampFloor(floor) {
|
|
244
|
+
if (floor === undefined)
|
|
245
|
+
return { ok: false, why: "the record states no policy floor (written before records carried one, or by a store that does not keep it)" };
|
|
246
|
+
let copy;
|
|
247
|
+
try {
|
|
248
|
+
copy = structuredClone(floor);
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
return { ok: false, why: "the record's policy floor is not plain data" };
|
|
252
|
+
}
|
|
253
|
+
const proto = typeof copy === "object" && copy !== null ? Object.getPrototypeOf(copy) : undefined;
|
|
254
|
+
if (copy === null || typeof copy !== "object" || Array.isArray(copy) || (proto !== Object.prototype && proto !== null)) {
|
|
255
|
+
return { ok: false, why: `the record's policy floor is not a record of clamp seats (got ${copy === null ? "null" : Array.isArray(copy) ? "an array" : typeof copy})` };
|
|
256
|
+
}
|
|
257
|
+
const stated = copy;
|
|
258
|
+
for (const [key, v] of Object.entries(stated)) {
|
|
259
|
+
if (v === undefined)
|
|
260
|
+
continue;
|
|
261
|
+
const row = CLAMP_SEATS.includes(key) ? CLAMP_SET[key] : undefined;
|
|
262
|
+
if (row === undefined)
|
|
263
|
+
return { ok: false, why: `the record's policy floor names ${describeStated(key)}, which this build's clamp table does not have` };
|
|
264
|
+
const seat = key;
|
|
265
|
+
if (row.law === "restricting") {
|
|
266
|
+
const field = fieldOf(row);
|
|
267
|
+
const exact = field === undefined ? v === row.value : typeof v === "object" && v !== null && !Array.isArray(v) && Object.keys(v).length === 1 && cellOf(row, v) === row.value;
|
|
268
|
+
if (!exact)
|
|
269
|
+
return { ok: false, why: `the record's policy floor states ${clampCellPath(seat)} as ${describeStated(v)}, which is not its restricting value ${describeStated(row.value)}` };
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
if (!Array.isArray(v) || v.length === 0)
|
|
273
|
+
return { ok: false, why: `the record's policy floor states ${seat} as ${Array.isArray(v) ? "an empty list" : describeStated(v)} — a floor's add-only seat is a non-empty list` };
|
|
274
|
+
const entries = v;
|
|
275
|
+
for (const e of entries) {
|
|
276
|
+
const problem = row.entry(e, `policyFloor.${seat}`);
|
|
277
|
+
if (problem !== undefined)
|
|
278
|
+
return { ok: false, why: problem };
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return { ok: true, floor: clampSeatsOf(stated) };
|
|
282
|
+
}
|
|
283
|
+
function describeStated(v) {
|
|
284
|
+
try {
|
|
285
|
+
const s = JSON.stringify(v);
|
|
286
|
+
if (s === undefined)
|
|
287
|
+
return typeof v;
|
|
288
|
+
return s.length > 80 ? `${s.slice(0, 77)}...` : s;
|
|
289
|
+
}
|
|
290
|
+
catch {
|
|
291
|
+
return typeof v;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
242
294
|
export function clampValuesOf(...records) {
|
|
243
295
|
return clampSeatsOf(foldClampSources(...records));
|
|
244
296
|
}
|
|
@@ -263,8 +315,11 @@ export const ENGINE_CHILD_SPEC_CONSTRUCTORS = Object.freeze([
|
|
|
263
315
|
"src/agents/verify.ts#fixLegSpec",
|
|
264
316
|
"src/orchestration/workflow-primitives.ts#workflowChildClamps",
|
|
265
317
|
]);
|
|
318
|
+
export function clampsReachNoPerson(clamps) {
|
|
319
|
+
return clamps.interactiveTools === false || clamps.approvalReach === "none";
|
|
320
|
+
}
|
|
266
321
|
export function postureUnderClamps(posture, clamps) {
|
|
267
|
-
return posture === "interactive" && (clamps
|
|
322
|
+
return posture === "interactive" && clampsReachNoPerson(clamps) ? "headless" : posture;
|
|
268
323
|
}
|
|
269
324
|
export function engineHeadlessLegSeats() {
|
|
270
325
|
return { interactiveTools: false, approvalReach: "none", interactionPosture: "headless" };
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
export type ComplianceProfile = "hipaa" | "zdr";
|
|
3
3
|
/** Closed capability set the ENGINE can veto end-to-end (see the module header for the entry-point
|
|
4
4
|
* map — a capability is admitted here only with its full interception story). */
|
|
5
|
-
export type ComplianceCapability = "mcp_servers" | "workflows" | "web_fetch" | "org_memory_mount";
|
|
5
|
+
export type ComplianceCapability = "mcp_servers" | "workflows" | "web_fetch" | "org_memory_mount" | "a2a_peers";
|
|
6
6
|
/** Every member of {@link ComplianceCapability} — the fail-closed "deny everything managed" set used
|
|
7
7
|
* when the posture resolver itself fails. `satisfies` keeps it in lockstep with the union. */
|
|
8
|
-
export declare const COMPLIANCE_CAPABILITIES: readonly ["mcp_servers", "workflows", "web_fetch", "org_memory_mount"];
|
|
8
|
+
export declare const COMPLIANCE_CAPABILITIES: readonly ["mcp_servers", "workflows", "web_fetch", "org_memory_mount", "a2a_peers"];
|
|
9
9
|
/**
|
|
10
10
|
* A principal's resolved compliance posture, supplied by the trusted deployment resolver. The
|
|
11
11
|
* effective deny set is `BUILTIN_COMPLIANCE_DENIES[profile] ∪ additionalDenies` — supply can only
|
|
@@ -32,7 +32,7 @@ export declare function resolveComplianceDenies(posture: CompliancePosture): Rea
|
|
|
32
32
|
/** One deny list member's refusal under the closed capability set, labelled with the list that carried it, or
|
|
33
33
|
* `undefined` when it is a member. */
|
|
34
34
|
export declare function complianceCapabilityProblem(cap: unknown, owner: string): string | undefined;
|
|
35
|
-
/** The core web-fetch tool face's canonical mounted name (`
|
|
35
|
+
/** The core web-fetch tool face's canonical mounted name (`webFetchToolSpec` in tools/web.ts). */
|
|
36
36
|
export declare const WEB_FETCH_TOOL_NAME = "WebFetch";
|
|
37
37
|
/**
|
|
38
38
|
* The CALL-TIME half of the `web_fetch` double point (CC form — mount check + call guard): given the
|
package/dist/core/compliance.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describeRejectedValue } from "./tool-search-setting.js";
|
|
2
|
-
export const COMPLIANCE_CAPABILITIES = Object.freeze(["mcp_servers", "workflows", "web_fetch", "org_memory_mount"]);
|
|
2
|
+
export const COMPLIANCE_CAPABILITIES = Object.freeze(["mcp_servers", "workflows", "web_fetch", "org_memory_mount", "a2a_peers"]);
|
|
3
3
|
export const BUILTIN_COMPLIANCE_DENIES = {
|
|
4
4
|
hipaa: ["web_fetch", "org_memory_mount"],
|
|
5
5
|
zdr: ["org_memory_mount"],
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A protocol peer's account of itself, read without the credentials its connection's requests carried — the MCP server's `serverInfo`,
|
|
3
|
+
* its instructions and its tool listing, the A2A peer's agent card. The needle is the connection's credentials (`PeerCarrier.credentials`:
|
|
4
|
+
* what the seat answered that the withheld table holds) and the one eraser is `eraseSentCredentials` (protocol-http-auth.ts, beside the
|
|
5
|
+
* failure text's). Free text holding the needle is erased in place; a NAME holding it (a tool's name or input schema, the server's own
|
|
6
|
+
* name, a skill's id, the card's name) is never rewritten — what it names is refused instead. Either way the site is announced, once per
|
|
7
|
+
* (materialization, peer, site), as `mcp.credential_echoed` (operator) through {@link credentialEchoNotice}.
|
|
8
|
+
*/
|
|
9
|
+
import { type EngineNotice } from "./engine-notice.js";
|
|
10
|
+
import type { PeerCarrier } from "./peer-seat.js";
|
|
11
|
+
/** Where a peer echoed its connection's credentials into what it said about itself — the closed set `mcp.credential_echoed` names
|
|
12
|
+
* (`detail.where`). */
|
|
13
|
+
export declare const CREDENTIAL_ECHO_SITES: readonly ["server_info", "instructions", "tool_listing", "agent_card"];
|
|
14
|
+
export type CredentialEchoSite = (typeof CREDENTIAL_ECHO_SITES)[number];
|
|
15
|
+
/** What a peer's account is read with: the needle, and who hears that a site held it. */
|
|
16
|
+
export interface CredentialEcho {
|
|
17
|
+
readonly credentials: readonly string[];
|
|
18
|
+
readonly announce: (where: CredentialEchoSite) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const NO_CREDENTIAL_ECHO: CredentialEcho;
|
|
21
|
+
/** The drop reason of a tool whose name or input schema holds its connection's credential. */
|
|
22
|
+
export declare const CREDENTIAL_ECHO_DROP_REASON = "its name or input schema holds a credential this connection's requests carried (the server echoed it back); neither is rewritten, so the tool is not mounted";
|
|
23
|
+
/** A free text of the peer's with the needle erased in place (absent stays absent); a text that held it announces `where`. */
|
|
24
|
+
export declare function erasedEcho(text: string | undefined, echo: CredentialEcho, where: CredentialEchoSite): string | undefined;
|
|
25
|
+
/** Whether a NAME the peer gave holds the needle (announced as `where` when it does): such a name is refused, never rewritten. */
|
|
26
|
+
export declare function nameEchoes(name: string, echo: CredentialEcho, where: CredentialEchoSite): boolean;
|
|
27
|
+
/** A listed input schema as one text for the needle (its keys and values, JSON-escaped as the echo spellings expect); a schema JSON cannot
|
|
28
|
+
* carry reads as nothing (the schema gate refuses it on its own). */
|
|
29
|
+
export declare function schemaText(schema: unknown): string;
|
|
30
|
+
/** A listed tool the needle refuses — named with it, or its input schema holding it (the schema is the tool's structure: its property
|
|
31
|
+
* names are what the model sends, not prose to edit) — as its drop record, the name erased; `undefined` for a tool the needle leaves. */
|
|
32
|
+
export declare function echoedToolDrop(name: string, inputSchema: unknown, echo: CredentialEcho): {
|
|
33
|
+
tool: string;
|
|
34
|
+
reason: string;
|
|
35
|
+
} | undefined;
|
|
36
|
+
/** How a connection's account is read: its carrier's credentials, a site that held one announced through `announce`. */
|
|
37
|
+
export declare function carrierEcho(carrier: {
|
|
38
|
+
readonly credentials: PeerCarrier["credentials"] | readonly string[];
|
|
39
|
+
}, announce: ((where: CredentialEchoSite) => void) | undefined): CredentialEcho;
|
|
40
|
+
/** The server's `serverInfo` as its status projects it: `name` is a name (holding the needle, the record is not projected — never
|
|
41
|
+
* rewritten), `version` free text (erased in place). */
|
|
42
|
+
export declare function serverInfoOf(info: {
|
|
43
|
+
name: string;
|
|
44
|
+
version: string;
|
|
45
|
+
} | undefined, echo: CredentialEcho): {
|
|
46
|
+
name: string;
|
|
47
|
+
version: string;
|
|
48
|
+
} | undefined;
|
|
49
|
+
/** One materialization's announcer: each (peer, site) heard once, a throwing listener never a fault of the dial it describes. */
|
|
50
|
+
export declare function echoAnnouncer(onCredentialEchoed: ((peer: string, where: CredentialEchoSite) => void) | undefined): (peer: string, where: CredentialEchoSite) => void;
|
|
51
|
+
/** The runner's listener → `mcp.credential_echoed` (engine-notice.ts): the peer and the site, never a value; operator audience. */
|
|
52
|
+
export declare function credentialEchoNotice(onNotice: ((notice: EngineNotice) => void) | undefined, sessionId: string, runId: string, protocol: "mcp" | "a2a"): (server: string, where: CredentialEchoSite) => void;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { deliverEngineNotice } from "./engine-notice.js";
|
|
2
|
+
import { eraseSentCredentials } from "./protocol-http-auth.js";
|
|
3
|
+
import { inlineUntrusted } from "./untrusted-text.js";
|
|
4
|
+
export const CREDENTIAL_ECHO_SITES = Object.freeze(["server_info", "instructions", "tool_listing", "agent_card"]);
|
|
5
|
+
export const NO_CREDENTIAL_ECHO = Object.freeze({ credentials: Object.freeze([]), announce: () => undefined });
|
|
6
|
+
export const CREDENTIAL_ECHO_DROP_REASON = "its name or input schema holds a credential this connection's requests carried (the server echoed it back); neither is rewritten, so the tool is not mounted";
|
|
7
|
+
export function erasedEcho(text, echo, where) {
|
|
8
|
+
if (typeof text !== "string")
|
|
9
|
+
return text;
|
|
10
|
+
const erased = eraseSentCredentials(text, echo.credentials);
|
|
11
|
+
if (erased !== text)
|
|
12
|
+
echo.announce(where);
|
|
13
|
+
return erased;
|
|
14
|
+
}
|
|
15
|
+
export function nameEchoes(name, echo, where) {
|
|
16
|
+
const echoed = typeof name === "string" && eraseSentCredentials(name, echo.credentials) !== name;
|
|
17
|
+
if (echoed)
|
|
18
|
+
echo.announce(where);
|
|
19
|
+
return echoed;
|
|
20
|
+
}
|
|
21
|
+
export function schemaText(schema) {
|
|
22
|
+
try {
|
|
23
|
+
return JSON.stringify(schema) ?? "";
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function echoedToolDrop(name, inputSchema, echo) {
|
|
30
|
+
if (!nameEchoes(name, echo, "tool_listing") && !nameEchoes(schemaText(inputSchema), echo, "tool_listing"))
|
|
31
|
+
return undefined;
|
|
32
|
+
return { tool: inlineUntrusted(eraseSentCredentials(name, echo.credentials)), reason: CREDENTIAL_ECHO_DROP_REASON };
|
|
33
|
+
}
|
|
34
|
+
export function carrierEcho(carrier, announce) {
|
|
35
|
+
return { credentials: carrier.credentials, announce: announce ?? NO_CREDENTIAL_ECHO.announce };
|
|
36
|
+
}
|
|
37
|
+
export function serverInfoOf(info, echo) {
|
|
38
|
+
if (info === undefined)
|
|
39
|
+
return undefined;
|
|
40
|
+
if (nameEchoes(info.name, echo, "server_info"))
|
|
41
|
+
return undefined;
|
|
42
|
+
return { name: info.name, version: erasedEcho(info.version, echo, "server_info") ?? info.version };
|
|
43
|
+
}
|
|
44
|
+
export function echoAnnouncer(onCredentialEchoed) {
|
|
45
|
+
const announced = new Set();
|
|
46
|
+
return (peer, where) => {
|
|
47
|
+
const key = `${peer}\u0000${where}`;
|
|
48
|
+
if (onCredentialEchoed === undefined || announced.has(key))
|
|
49
|
+
return;
|
|
50
|
+
announced.add(key);
|
|
51
|
+
try {
|
|
52
|
+
onCredentialEchoed(peer, where);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const SITE_WORDS = { server_info: "serverInfo", instructions: "instructions", tool_listing: "tool listing", agent_card: "agent card" };
|
|
59
|
+
export function credentialEchoNotice(onNotice, sessionId, runId, protocol) {
|
|
60
|
+
return (server, where) => deliverEngineNotice(onNotice, {
|
|
61
|
+
code: "mcp.credential_echoed",
|
|
62
|
+
message: `${protocol === "mcp" ? "MCP server" : "A2A peer"} "${inlineUntrusted(server, 120)}" echoed a credential its requests carried into its ${SITE_WORDS[where]} — the engine erased it there (a name holding it was refused, not rewritten); the endpoint repeats what it is sent, so check what it logs and publishes.`,
|
|
63
|
+
detail: { protocol, server, where, sessionId, runId },
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -94,11 +94,21 @@ export interface CredentialVocabulary {
|
|
|
94
94
|
readonly policy: VocabularyPolicy;
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
|
-
* The URI scheme
|
|
98
|
-
*
|
|
99
|
-
*
|
|
97
|
+
* The URI scheme: RFC 3986's scheme production plus `_`, of any length, read from the START of its run of scheme characters
|
|
98
|
+
* (a run's leading digits and marks are taken into it, so the match keeps them). An unanchored unbounded `\w+` made every
|
|
99
|
+
* `://` pattern quadratic in the longest unbroken word run (one long base64 paste cost seconds of synchronous CPU), and a
|
|
100
|
+
* 64-character cap that replaced it missed a longer scheme; anchored at the run's start, each run is tried once — linear, and
|
|
101
|
+
* no scheme is too long to be read.
|
|
100
102
|
*/
|
|
101
103
|
export declare const URI_SCHEME_SOURCE: string;
|
|
104
|
+
/**
|
|
105
|
+
* A URL's userinfo with the `@` that ends it, up to the LAST `@` before the host (a password may hold `@`): runs of characters
|
|
106
|
+
* that are no `/`, white space, `"` or `@`, each closed by an `@`. The class holds all of RFC 3986's userinfo (unreserved,
|
|
107
|
+
* pct-encoded, sub-delims — `'` among them — and `:`) and the characters a password written unencoded carries (`#`, `?`, …);
|
|
108
|
+
* `"` ends it, the quote of a string around the URL. The one userinfo grammar: every reader that removes a userinfo matches
|
|
109
|
+
* this, and each renders the match its own way.
|
|
110
|
+
*/
|
|
111
|
+
export declare const URL_USERINFO_SOURCE: string;
|
|
102
112
|
/** The fewest characters a string can have and still be read as a credential: the floor of a vendor-prefixed token's body
|
|
103
113
|
* and of a bearer / authorization credential run in this table, and of the value rules of the env scrub. A shorter
|
|
104
114
|
* string names no secret, whoever holds it. */
|