@sema-agent/core 7.70.0 → 7.71.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 +728 -0
- package/dist/agents/agent-transcript-tool.js +43 -19
- package/dist/agents/inherited-tool-pool.d.ts +5 -1
- package/dist/agents/inherited-tool-pool.js +6 -0
- package/dist/agents/retain-ledger.js +2 -0
- package/dist/agents/send-message-tool.d.ts +12 -1
- package/dist/agents/send-message-tool.js +47 -9
- package/dist/agents/subagent.js +31 -10
- package/dist/agents/tool-filter.js +1 -2
- package/dist/agents/verify.js +13 -2
- package/dist/agents/yield-adoption.js +11 -1
- package/dist/brain/claude-model-id.d.ts +11 -0
- package/dist/brain/claude-model-id.js +3 -1
- package/dist/config/catalog.js +10 -1
- package/dist/config/defaults.d.ts +3 -0
- package/dist/config/defaults.js +1 -0
- package/dist/core/allow-entry.js +1 -2
- package/dist/core/ask-origin.d.ts +55 -21
- package/dist/core/ask-origin.js +19 -11
- package/dist/core/ask-question.d.ts +4 -7
- package/dist/core/ask-question.js +2 -4
- package/dist/core/ask-unresolvable-notice.d.ts +17 -3
- package/dist/core/ask-unresolvable-notice.js +18 -4
- package/dist/core/attachment-source.d.ts +1 -1
- package/dist/core/attachment-source.js +2 -0
- package/dist/core/auto-compaction.d.ts +14 -4
- package/dist/core/auto-compaction.js +3 -2
- package/dist/core/auto-strip.js +2 -0
- package/dist/core/caller-text.d.ts +2 -33
- package/dist/core/caller-text.js +2 -23
- package/dist/core/caller-tool-name.js +1 -2
- package/dist/core/canonical-json.d.ts +9 -0
- package/dist/core/canonical-json.js +6 -0
- package/dist/core/checkpoint-features.d.ts +43 -80
- package/dist/core/checkpoint-features.js +10 -20
- package/dist/core/checkpoint-generation.d.ts +89 -19
- package/dist/core/checkpoint-generation.js +89 -14
- package/dist/core/checkpoint-queries.d.ts +95 -15
- package/dist/core/checkpoint-queries.js +108 -7
- package/dist/core/checkpoint-rekey.d.ts +2 -1
- package/dist/core/checkpoint-rekey.js +2 -2
- package/dist/core/checkpoint-requirements.d.ts +7 -6
- package/dist/core/checkpoint-requirements.js +2 -5
- package/dist/core/checkpoint-row-verdict.d.ts +3 -4
- package/dist/core/checkpoint-row-verdict.js +20 -41
- package/dist/core/checkpoint-store.d.ts +65 -41
- package/dist/core/checkpoint-store.js +28 -14
- package/dist/core/command-sandbox.d.ts +5 -3
- package/dist/core/command-sandbox.js +17 -9
- package/dist/core/config-refusal-codes.d.ts +1 -1
- package/dist/core/config-refusal-codes.js +1 -0
- package/dist/core/declaration-words.d.ts +2 -1
- package/dist/core/declaration-words.js +13 -2
- package/dist/core/effective-path-target.d.ts +23 -0
- package/dist/core/effective-path-target.js +15 -1
- package/dist/core/engine-attestation.d.ts +5 -1
- package/dist/core/engine-attestation.js +1 -0
- package/dist/core/engine-capabilities.d.ts +14 -9
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-notice.d.ts +62 -32
- package/dist/core/engine-version.js +1 -1
- package/dist/core/entries-not-applied.d.ts +1 -1
- package/dist/core/entries-not-applied.js +1 -0
- package/dist/core/file-history-store.d.ts +95 -11
- package/dist/core/file-history-store.js +117 -19
- package/dist/core/gate-fold.js +13 -7
- package/dist/core/gate-lanes.js +9 -9
- package/dist/core/governance-codes.d.ts +56 -7
- package/dist/core/governance-codes.js +105 -7
- package/dist/core/grant-holder.d.ts +53 -0
- package/dist/core/grant-holder.js +80 -0
- package/dist/core/hooks.d.ts +7 -3
- package/dist/core/hooks.js +2 -2
- package/dist/core/locked-config.d.ts +7 -1
- package/dist/core/locked-config.js +9 -2
- package/dist/core/mcp-call-meta.d.ts +52 -7
- package/dist/core/mcp-call-meta.js +21 -2
- package/dist/core/mcp-host-read.d.ts +1 -1
- package/dist/core/mcp-server-spec.d.ts +18 -0
- package/dist/core/mcp-server-spec.js +1 -0
- package/dist/core/mcp.js +2 -2
- package/dist/core/member-outcome.d.ts +22 -1
- package/dist/core/member-outcome.js +18 -6
- package/dist/core/memory-engine/delegation-settlement.js +5 -5
- package/dist/core/memory-engine/engine.js +19 -19
- package/dist/core/memory-engine/file-backend.d.ts +7 -2
- package/dist/core/memory-engine/file-backend.js +14 -12
- package/dist/core/memory-engine/frontmatter.js +1 -1
- package/dist/core/memory-engine/index.d.ts +1 -0
- package/dist/core/memory-engine/index.js +1 -0
- package/dist/core/memory-engine/layout.d.ts +34 -9
- package/dist/core/memory-engine/layout.js +36 -19
- package/dist/core/memory-engine/memory-deployment.js +8 -8
- package/dist/core/memory-engine/mount-failed-notice.d.ts +8 -5
- package/dist/core/memory-engine/mount-failed-notice.js +5 -2
- package/dist/core/mode-policy.d.ts +5 -0
- package/dist/core/mode-policy.js +6 -0
- package/dist/core/mods/host.d.ts +2 -1
- package/dist/core/mods/host.js +7 -6
- package/dist/core/mods/kernel/index.d.ts +1 -1
- package/dist/core/mods/kernel/index.js +1 -1
- package/dist/core/mods/kernel/registration.d.ts +5 -2
- package/dist/core/mods/kernel/registration.js +19 -3
- package/dist/core/mods/package.d.ts +12 -1
- package/dist/core/mods/package.js +36 -9
- package/dist/core/mods/stations.d.ts +7 -1
- package/dist/core/mods/stations.js +17 -3
- package/dist/core/mods/teammate-stations.d.ts +4 -1
- package/dist/core/mods/teammate-stations.js +1 -1
- package/dist/core/native-signal.d.ts +13 -0
- package/dist/core/native-signal.js +18 -0
- package/dist/core/park-resumability.d.ts +16 -14
- package/dist/core/park-resumability.js +9 -4
- package/dist/core/path-rule-binding.js +1 -1
- package/dist/core/permission-rule-model.d.ts +11 -5
- package/dist/core/permission-rule-model.js +5 -3
- package/dist/core/permission-rule-org.js +1 -1
- package/dist/core/permission-rule-provider.d.ts +5 -1
- package/dist/core/permission-rule-provider.js +6 -1
- package/dist/core/permission-rule-session.d.ts +35 -5
- package/dist/core/permission-rule-session.js +32 -1
- package/dist/core/permission-rule-store.d.ts +5 -1
- package/dist/core/permission-rule-store.js +28 -5
- package/dist/core/permission-rules.d.ts +2 -2
- package/dist/core/permission-rules.js +2 -3
- package/dist/core/principal-name.d.ts +12 -0
- package/dist/core/principal-name.js +6 -2
- package/dist/core/read-root-grant-screen.d.ts +7 -6
- package/dist/core/read-root-grant-screen.js +7 -8
- package/dist/core/remote-env.d.ts +42 -8
- package/dist/core/resume-config-judge.js +1 -1
- package/dist/core/resume-startup-cause.d.ts +19 -4
- package/dist/core/resume-startup-cause.js +25 -6
- package/dist/core/rewind-conversation.d.ts +4 -0
- package/dist/core/rewrite-rejudge.d.ts +9 -1
- package/dist/core/rewrite-rejudge.js +11 -1
- package/dist/core/rule-offer-read.js +3 -2
- package/dist/core/runner/assemble-result.d.ts +21 -11
- package/dist/core/runner/assemble-result.js +24 -4
- package/dist/core/runner/boundary-reminders.d.ts +104 -0
- package/dist/core/runner/boundary-reminders.js +108 -0
- package/dist/core/runner/branch-writeback.d.ts +21 -7
- package/dist/core/runner/branch-writeback.js +44 -6
- package/dist/core/runner/command-sandbox-frame.js +2 -1
- package/dist/core/runner/compact-session.js +11 -4
- package/dist/core/runner/constraint-layers.d.ts +24 -5
- package/dist/core/runner/constraint-layers.js +21 -2
- package/dist/core/runner/continuation-gate.js +3 -1
- package/dist/core/runner/contracts.d.ts +83 -13
- package/dist/core/runner/cross-boundary-lane.js +2 -1
- package/dist/core/runner/delegation-owner.d.ts +246 -45
- package/dist/core/runner/delegation-owner.js +237 -63
- package/dist/core/runner/expire-settle.d.ts +17 -0
- package/dist/core/runner/expire-settle.js +8 -2
- package/dist/core/runner/file-history-request.d.ts +4 -3
- package/dist/core/runner/file-history-request.js +4 -1
- package/dist/core/runner/file-history-restore.d.ts +11 -3
- package/dist/core/runner/file-history-restore.js +11 -3
- package/dist/core/runner/gate-exit.d.ts +22 -1
- package/dist/core/runner/gate-exit.js +12 -14
- package/dist/core/runner/nested-memory-content.js +1 -1
- package/dist/core/runner/nested-memory-lane.d.ts +10 -2
- package/dist/core/runner/nested-memory-lane.js +29 -8
- package/dist/core/runner/own-model-money-door.d.ts +13 -0
- package/dist/core/runner/own-model-money-door.js +17 -0
- package/dist/core/runner/park-commit.d.ts +4 -2
- package/dist/core/runner/park-commit.js +2 -1
- package/dist/core/runner/permission-rule-lanes.d.ts +4 -0
- package/dist/core/runner/permission-rule-lanes.js +7 -0
- package/dist/core/runner/person-path-rows.js +1 -1
- package/dist/core/runner/placement-fence.d.ts +8 -2
- package/dist/core/runner/placement-fence.js +8 -3
- package/dist/core/runner/policy-throw.d.ts +3 -2
- package/dist/core/runner/policy-throw.js +2 -2
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +23 -14
- package/dist/core/runner/prepare-acquire-reconcile.js +33 -15
- package/dist/core/runner/prepare-artifact.d.ts +14 -1
- package/dist/core/runner/prepare-artifact.js +7 -2
- package/dist/core/runner/prepare-ask-lane.d.ts +8 -0
- package/dist/core/runner/prepare-ask-lane.js +14 -5
- package/dist/core/runner/prepare-boundary-parks.js +5 -4
- package/dist/core/runner/prepare-config-doors.d.ts +9 -4
- package/dist/core/runner/prepare-config-doors.js +25 -8
- package/dist/core/runner/prepare-defer-classify.d.ts +8 -4
- package/dist/core/runner/prepare-defer-classify.js +6 -6
- package/dist/core/runner/prepare-execution-env.d.ts +4 -1
- package/dist/core/runner/prepare-execution-env.js +8 -3
- package/dist/core/runner/prepare-file-history.d.ts +26 -0
- package/dist/core/runner/prepare-file-history.js +15 -1
- package/dist/core/runner/prepare-inherited-gate.d.ts +8 -3
- package/dist/core/runner/prepare-inherited-gate.js +9 -2
- package/dist/core/runner/prepare-leg-adoption.d.ts +2 -2
- package/dist/core/runner/prepare-park-ask.js +8 -5
- package/dist/core/runner/prepare-policy-chain.d.ts +5 -0
- package/dist/core/runner/prepare-policy-chain.js +18 -7
- package/dist/core/runner/prepare-prompt-assembly.d.ts +3 -0
- package/dist/core/runner/prepare-prompt-assembly.js +4 -3
- package/dist/core/runner/prepare-suspend-saga.d.ts +4 -1
- package/dist/core/runner/prepare-suspend-saga.js +19 -5
- package/dist/core/runner/prepare-task.d.ts +2 -5
- package/dist/core/runner/prepare-task.js +71 -26
- package/dist/core/runner/prepare-turn-wiring.js +7 -5
- package/dist/core/runner/prepare-workspace-restore.js +59 -28
- package/dist/core/runner/read-root-grant.d.ts +1 -0
- package/dist/core/runner/read-root-grant.js +1 -2
- package/dist/core/runner/resume-admission.d.ts +3 -0
- package/dist/core/runner/resume-admission.js +6 -4
- package/dist/core/runner/resume-apply.js +7 -5
- package/dist/core/runner/resume-claim.d.ts +2 -2
- package/dist/core/runner/resume-claim.js +4 -4
- package/dist/core/runner/resume-policy-outcome.d.ts +1 -1
- package/dist/core/runner/resume-policy-outcome.js +6 -4
- package/dist/core/runner/resume-preflight.d.ts +3 -0
- package/dist/core/runner/resume-preflight.js +10 -3
- package/dist/core/runner/rewind-conversation.js +11 -4
- package/dist/core/runner/rewind-files.js +29 -14
- package/dist/core/runner/rewind-outcome.d.ts +27 -0
- package/dist/core/runner/rewind-outcome.js +14 -0
- package/dist/core/runner/run-attachment-seats.js +2 -1
- package/dist/core/runner/run-clock-and-content.js +2 -0
- package/dist/core/runner/run-identity-wiring.js +2 -0
- package/dist/core/runner/run-leg.js +11 -1
- package/dist/core/runner/run-notification-lane.d.ts +3 -0
- package/dist/core/runner/run-notification-lane.js +2 -2
- package/dist/core/runner/run-settle-and-teardown.d.ts +4 -2
- package/dist/core/runner/run-settle-and-teardown.js +52 -40
- package/dist/core/runner/run-stop-and-final-verify.d.ts +4 -0
- package/dist/core/runner/run-stop-and-final-verify.js +5 -4
- package/dist/core/runner/run-terminal-adoption.d.ts +1 -1
- package/dist/core/runner/run-terminal-adoption.js +3 -3
- package/dist/core/runner/run-turn-boundary.js +7 -0
- package/dist/core/runner/runtask.d.ts +7 -4
- package/dist/core/runner/runtask.js +18 -9
- package/dist/core/runner/session-call-grant-station.d.ts +64 -0
- package/dist/core/runner/session-call-grant-station.js +119 -0
- package/dist/core/runner/session-file-state-replay.js +2 -2
- package/dist/core/runner/session-prompt-seats.d.ts +95 -0
- package/dist/core/runner/session-prompt-seats.js +62 -0
- package/dist/core/runner/session-rule-policy.js +1 -1
- package/dist/core/runner/session-write-ledger.d.ts +8 -0
- package/dist/core/runner/session-write-ledger.js +16 -0
- package/dist/core/runner/side-call-account.js +5 -1
- package/dist/core/runner/stop-tail-notice.d.ts +7 -0
- package/dist/core/runner/stop-tail-notice.js +23 -8
- package/dist/core/runner/stream-reap.js +4 -2
- package/dist/core/runner/stream-settle-backstop.d.ts +1 -1
- package/dist/core/runner/stream-settle-backstop.js +17 -18
- package/dist/core/runner/terminal-account.js +17 -8
- package/dist/core/runner/terminal-projection.d.ts +3 -2
- package/dist/core/runner/terminal-projection.js +1 -1
- package/dist/core/runner/tool-turn-repair-seat.d.ts +2 -2
- package/dist/core/runner/tool-turn-repair-seat.js +12 -7
- package/dist/core/runner/turn-attachments.d.ts +22 -1
- package/dist/core/runner/turn-attachments.js +20 -3
- package/dist/core/runner-deps.d.ts +6 -2
- package/dist/core/secret-env.d.ts +26 -6
- package/dist/core/secret-env.js +6 -6
- package/dist/core/session-call-grant-screen.d.ts +58 -0
- package/dist/core/session-call-grant-screen.js +18 -0
- package/dist/core/session-call-grant.d.ts +93 -0
- package/dist/core/session-call-grant.js +524 -0
- package/dist/core/session-checkout.d.ts +3 -0
- package/dist/core/session-checkout.js +8 -3
- package/dist/core/session-policy-store.d.ts +14 -0
- package/dist/core/session-policy-store.js +16 -2
- package/dist/core/session-store.d.ts +18 -1
- package/dist/core/session-store.js +20 -4
- package/dist/core/session.d.ts +36 -4
- package/dist/core/shared-artifact-reads.d.ts +93 -0
- package/dist/core/shared-artifact-reads.js +94 -0
- package/dist/core/skill-grant.js +1 -1
- package/dist/core/skills-directory.d.ts +9 -45
- package/dist/core/skills-directory.js +9 -722
- package/dist/core/spend-account.js +3 -0
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +22 -4
- package/dist/core/store-contracts/checkpoint-store-contract.js +363 -29
- package/dist/core/store-contracts/file-history-store-contract.d.ts +11 -3
- package/dist/core/store-contracts/file-history-store-contract.js +62 -2
- package/dist/core/store-contracts/grant-fixture.d.ts +52 -0
- package/dist/core/store-contracts/grant-fixture.js +84 -0
- package/dist/core/store-contracts/session-repo-contract.js +18 -0
- package/dist/core/store-contracts/session-store-contract.d.ts +15 -1
- package/dist/core/store-contracts/session-store-contract.js +211 -2
- package/dist/core/store-contracts/workflow-journal-store-contract.js +47 -8
- package/dist/core/suspend-lane-reasons.d.ts +13 -0
- package/dist/core/suspend-lane-reasons.js +5 -0
- package/dist/core/synthetic-read-verdict.d.ts +5 -3
- package/dist/core/synthetic-read-verdict.js +1 -1
- package/dist/core/task-limits.d.ts +15 -0
- package/dist/core/task-notification.d.ts +33 -7
- package/dist/core/task-notification.js +34 -9
- package/dist/core/task-registry-agent.d.ts +1 -1
- package/dist/core/task-registry-agent.js +18 -7
- package/dist/core/task-registry-shared.d.ts +29 -4
- package/dist/core/task-registry-shared.js +7 -0
- package/dist/core/task-registry.d.ts +21 -1
- package/dist/core/task-registry.js +36 -9
- package/dist/core/task-result.d.ts +55 -1
- package/dist/core/task-spec.d.ts +17 -3
- package/dist/core/terminal-cause.d.ts +68 -5
- package/dist/core/tool-catalog-entries.js +1 -1
- package/dist/core/tool-check-reading.js +2 -1
- package/dist/core/tool-errors.js +1 -0
- package/dist/core/tool-list-grammar.d.ts +0 -47
- package/dist/core/tool-list-grammar.js +1 -75
- package/dist/core/tool-model-gate.d.ts +7 -11
- package/dist/core/tool-model-gate.js +5 -8
- package/dist/core/tool-name-aliases.js +2 -3
- package/dist/core/tool-name-readings.d.ts +4 -0
- package/dist/core/tool-name-readings.js +1 -0
- package/dist/core/tool-policy.d.ts +46 -4
- package/dist/core/tool-policy.js +47 -18
- package/dist/core/tool-result-store.d.ts +0 -24
- package/dist/core/tool-result-store.js +1 -36
- package/dist/core/tool-spec.d.ts +8 -4
- package/dist/core/untrusted-egress.js +2 -2
- package/dist/core/untrusted-text.d.ts +8 -0
- package/dist/core/untrusted-text.js +14 -0
- package/dist/core/user-attachment.d.ts +16 -1
- package/dist/core/user-attachment.js +42 -18
- package/dist/core/wiring-manifest.d.ts +4 -9
- package/dist/core/wiring-manifest.js +1 -1
- package/dist/core/workflow-journal-store.d.ts +55 -8
- package/dist/core/workflow-journal-store.js +34 -10
- package/dist/core/workflow-run-store-contract.js +56 -1
- package/dist/core/workflow-run-store.d.ts +43 -19
- package/dist/core/workflow-run-store.js +17 -2
- package/dist/engine/execution-env/node-execution-env.d.ts +3 -0
- package/dist/engine/execution-env/node-execution-env.js +4 -0
- package/dist/engine/harness/agent-harness.d.ts +10 -5
- package/dist/engine/harness/agent-harness.js +12 -4
- package/dist/engine/harness/types.d.ts +18 -0
- package/dist/engine/llm/tool-turns.d.ts +1 -1
- package/dist/engine/llm/types.d.ts +5 -4
- package/dist/engine/session/memory-repo.d.ts +15 -3
- package/dist/engine/session/memory-repo.js +21 -3
- package/dist/engine/session/memory-storage.d.ts +5 -0
- package/dist/engine/session/memory-storage.js +8 -3
- package/dist/engine/session/repo-utils.d.ts +9 -0
- package/dist/engine/session/repo-utils.js +14 -0
- package/dist/engine/session/storage-base.d.ts +20 -7
- package/dist/engine/session/storage-base.js +13 -1
- package/dist/index.d.ts +37 -19
- package/dist/index.js +30 -15
- package/dist/internal/harness.d.ts +1 -1
- package/dist/internal/harness.js +1 -1
- package/dist/orchestration/run-workflow-tool.d.ts +13 -1
- package/dist/orchestration/run-workflow-tool.js +101 -32
- package/dist/orchestration/workflow-park-adoption.d.ts +309 -92
- package/dist/orchestration/workflow-park-adoption.js +588 -323
- package/dist/orchestration/workflow-tree-id.d.ts +66 -0
- package/dist/orchestration/workflow-tree-id.js +66 -0
- package/dist/orchestration/workflow-types.d.ts +90 -11
- package/dist/orchestration/workflow-types.js +10 -1
- package/dist/orchestration/workflow.d.ts +30 -4
- package/dist/orchestration/workflow.js +424 -114
- package/dist/prompt-assembly/catalog/constitution.js +5 -1
- package/dist/prompt-assembly/catalog/core-behavior.d.ts +3 -4
- package/dist/prompt-assembly/catalog/core-behavior.js +61 -22
- package/dist/prompt-assembly/catalog/environment.js +2 -2
- package/dist/prompt-assembly/catalog/events.d.ts +16 -0
- package/dist/prompt-assembly/catalog/events.js +2 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/core-behavior.js +72 -44
- package/dist/prompt-assembly/catalog/locales/zh-Hans/environment.js +2 -2
- package/dist/prompt-assembly/catalog/locales/zh-Hans/events.js +2 -0
- package/dist/prompt-assembly/catalog/schema.d.ts +5 -1
- package/dist/prompt-assembly/catalog/schema.js +2 -0
- package/dist/prompt-assembly/catalog/sections.js +3 -14
- package/dist/prompt-assembly/event-registry.js +2 -0
- package/dist/prompt-assembly/select.js +1 -0
- package/dist/prompt-assembly/tool-catalog.d.ts +10 -7
- package/dist/prompt-assembly/tool-catalog.js +21 -7
- package/dist/prompt-assembly/types.d.ts +3 -0
- package/dist/prompts/default.d.ts +4 -1
- package/dist/prompts/default.js +6 -0
- package/dist/stores/file/checkpoint-store.d.ts +11 -10
- package/dist/stores/file/checkpoint-store.js +36 -10
- package/dist/stores/file/file-history-store.d.ts +6 -0
- package/dist/stores/file/file-history-store.js +21 -4
- package/dist/stores/file/fs-atomic.d.ts +1 -1
- package/dist/stores/file/index.d.ts +14 -4
- package/dist/stores/file/index.js +21 -5
- package/dist/stores/file/process-anchor.d.ts +9 -1
- package/dist/stores/file/session-policy-store.js +2 -17
- package/dist/stores/file/session-store.d.ts +27 -0
- package/dist/stores/file/session-store.js +81 -9
- package/dist/stores/file/workflow-journal-store.d.ts +14 -4
- package/dist/stores/file/workflow-journal-store.js +32 -24
- package/dist/stores/file/workflow-run-store.d.ts +15 -4
- package/dist/stores/file/workflow-run-store.js +76 -0
- package/dist/tools/artifact/artifact-tool.d.ts +10 -3
- package/dist/tools/artifact/artifact-tool.js +16 -1
- package/dist/tools/fs/bash-program-position.d.ts +10 -4
- package/dist/tools/fs/bash-program-position.js +11 -8
- package/dist/tools/fs/bash-readonly-classifier.d.ts +3 -1
- package/dist/tools/fs/bash-readonly-classifier.js +9 -2
- package/dist/tools/fs/find-actions.d.ts +30 -16
- package/dist/tools/fs/find-actions.js +272 -19
- package/dist/tools/fs/fs-bash.js +8 -5
- package/dist/tools/fs/fs-shared.d.ts +0 -29
- package/dist/tools/fs/fs-shared.js +0 -5
- package/dist/tools/fs/fs-write.js +2 -1
- package/dist/tools/fs/read-deny.d.ts +6 -1
- package/dist/tools/fs/read-deny.js +6 -1
- package/dist/tools/fs/read-floor.d.ts +6 -0
- package/dist/tools/fs/read-floor.js +5 -1
- package/dist/tools/fs/removal-actions.d.ts +43 -0
- package/dist/tools/fs/removal-actions.js +25 -0
- package/dist/tools/fs/removal-targets.d.ts +2 -21
- package/dist/tools/fs/removal-targets.js +2 -3
- package/dist/tools/fs/safety.d.ts +37 -1
- package/dist/tools/fs/safety.js +52 -0
- package/dist/tools/fs/shell-climb.d.ts +46 -0
- package/dist/tools/fs/shell-climb.js +79 -0
- package/dist/tools/fs/shell-read-check.js +47 -19
- package/dist/tools/fs/shell-read-establish.js +36 -22
- package/dist/tools/fs/shell-read-judge.d.ts +10 -2
- package/dist/tools/fs/shell-read-judge.js +4 -4
- package/dist/tools/fs/shell-read-plan.d.ts +3 -0
- package/dist/tools/fs/shell-read-plan.js +1 -1
- package/dist/tools/fs/shell-read-workdir.js +3 -2
- package/dist/tools/fs/shell-read-write-targets.d.ts +4 -3
- package/dist/tools/fs/shell-read-write-targets.js +3 -0
- package/package.json +2 -2
- package/test/export-surface.snapshot.json +169 -15
- package/wire-changes/core-stores-sql@7.71.0.json +40 -0
- package/wire-changes/core@7.71.0.json +5827 -0
- package/wire-changes/mods-kernel@7.71.0.json +52 -0
- package/wire-changes/primitives@7.71.0.json +473 -0
- package/wire-changes/wiki-gate@7.71.0.json +40 -0
- package/dist/core/frontmatter-fence.d.ts +0 -10
- package/dist/core/frontmatter-fence.js +0 -6
- package/dist/core/permission-rule-syntax.d.ts +0 -46
- package/dist/core/permission-rule-syntax.js +0 -52
|
@@ -104,7 +104,7 @@ export const NON_GOVERNANCE_MEMORY_CODES = new Set([
|
|
|
104
104
|
"memory.store_root_sensitive",
|
|
105
105
|
"memory.control_plane_split",
|
|
106
106
|
"memory.store_absent",
|
|
107
|
-
"memory.
|
|
107
|
+
"memory.root_anchor_damaged",
|
|
108
108
|
"memory.root_anchor_rerecorded",
|
|
109
109
|
"memory.root_reanchored",
|
|
110
110
|
"memory.control_plane_new_over_memory",
|
|
@@ -191,10 +191,13 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
191
191
|
"config.toolpolicy.unmatched_names",
|
|
192
192
|
"config.agent.unknown_tool",
|
|
193
193
|
"permission.allow_rule_not_used_in_auto",
|
|
194
|
+
"permission.revival_root_policy_unrestated",
|
|
194
195
|
"mods.registration_refused",
|
|
196
|
+
"mods.registration_refused_deployment",
|
|
195
197
|
"mods.display_withheld",
|
|
196
198
|
"mods.stop_ended",
|
|
197
199
|
"mods.stop_continue_dropped",
|
|
200
|
+
"mods.package_key_unread",
|
|
198
201
|
"peer.inbound_disposition",
|
|
199
202
|
"peer.inbound_unread",
|
|
200
203
|
"peer.notice_user_only",
|
|
@@ -235,6 +238,7 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
235
238
|
"workflow.governance_key_stripped",
|
|
236
239
|
"workflow.agent_option_ignored",
|
|
237
240
|
"workflow.parked_decision_unused",
|
|
241
|
+
"workflow.parked_decision_used",
|
|
238
242
|
"workflow.record_unwritten",
|
|
239
243
|
"memory.session_polluted",
|
|
240
244
|
"memory.harvest_quarantined",
|
|
@@ -276,6 +280,7 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
276
280
|
"context.tool_schema_removed",
|
|
277
281
|
"context.messages_omitted",
|
|
278
282
|
"instructions.withheld",
|
|
283
|
+
"instructions.outside_root",
|
|
279
284
|
"instructions.family_undeclared",
|
|
280
285
|
"task.user_steer_undrained",
|
|
281
286
|
"task.user_followup_undrained",
|
|
@@ -287,11 +292,15 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
287
292
|
"mods.turn_abort_unconsumed",
|
|
288
293
|
"task.late_approval",
|
|
289
294
|
"task.interrupt_unconsumed",
|
|
295
|
+
"task.wait_ceiling_reached",
|
|
290
296
|
"task.completed_past_limit",
|
|
291
297
|
"task.verdict_refused",
|
|
292
298
|
"task.tool_turn_incomplete",
|
|
299
|
+
"task.tool_turn_unrecovered",
|
|
293
300
|
"approval.read_root_granted",
|
|
294
301
|
"approval.read_root_grant_rejected",
|
|
302
|
+
"approval.session_call_granted",
|
|
303
|
+
"approval.session_call_grant_rejected",
|
|
295
304
|
"approval.approver_defect",
|
|
296
305
|
"memory.capture_opted_out",
|
|
297
306
|
"memory.capture_switched_off",
|
|
@@ -311,6 +320,7 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
311
320
|
"store.lock_retained",
|
|
312
321
|
"store.lock_reclaimed_on_declaration",
|
|
313
322
|
"store.append_log_parked",
|
|
323
|
+
"store.tree_id_stamp_incomplete",
|
|
314
324
|
"store.process_anchor_unavailable",
|
|
315
325
|
"store.process_anchor_lost",
|
|
316
326
|
"engine.debug_trace",
|
|
@@ -353,7 +363,9 @@ const NOTICE_AUDIENCE_TABLE = {
|
|
|
353
363
|
"task.halt_unconsumed": "user",
|
|
354
364
|
"task.late_approval": "user",
|
|
355
365
|
"task.interrupt_unconsumed": "user",
|
|
366
|
+
"task.wait_ceiling_reached": "user",
|
|
356
367
|
"task.tool_turn_incomplete": "user",
|
|
368
|
+
"task.tool_turn_unrecovered": "user",
|
|
357
369
|
"task.completed_past_limit": "operator",
|
|
358
370
|
"route.finish_reason_unknown": "user",
|
|
359
371
|
"route.stream_end_ignored": "user",
|
|
@@ -362,6 +374,8 @@ const NOTICE_AUDIENCE_TABLE = {
|
|
|
362
374
|
"route.credential_mismatch": "user",
|
|
363
375
|
"approval.read_root_granted": "user",
|
|
364
376
|
"approval.read_root_grant_rejected": "user",
|
|
377
|
+
"approval.session_call_granted": "user",
|
|
378
|
+
"approval.session_call_grant_rejected": "user",
|
|
365
379
|
"approval.approver_defect": "operator",
|
|
366
380
|
"config.durable_gate_unavailable": "user",
|
|
367
381
|
"config.permission_mode_unavailable": "user",
|
|
@@ -375,6 +389,7 @@ const NOTICE_AUDIENCE_TABLE = {
|
|
|
375
389
|
"config.toolpolicy.unmatched_names": "user",
|
|
376
390
|
"config.agent.unknown_tool": "user",
|
|
377
391
|
"permission.allow_rule_not_used_in_auto": "user",
|
|
392
|
+
"permission.revival_root_policy_unrestated": "operator",
|
|
378
393
|
"mods.registration_refused": "user",
|
|
379
394
|
"mods.display_withheld": "user",
|
|
380
395
|
"mods.stop_ended": "user",
|
|
@@ -386,8 +401,10 @@ const NOTICE_AUDIENCE_TABLE = {
|
|
|
386
401
|
"memory.consolidation_withheld": "operator",
|
|
387
402
|
"delegation.ask_unresolvable": "user",
|
|
388
403
|
"workflow.parked_decision_unused": "user",
|
|
404
|
+
"workflow.parked_decision_used": "user",
|
|
389
405
|
"task.verdict_refused": "user",
|
|
390
406
|
"inherit_env.names_withheld": "user",
|
|
407
|
+
"mods.registration_refused_deployment": "operator",
|
|
391
408
|
"config.autocompact_window_clamped": "operator",
|
|
392
409
|
"config.env_timeout_discarded": "operator",
|
|
393
410
|
"config.materialize_env_discarded": "operator",
|
|
@@ -444,6 +461,7 @@ const NOTICE_AUDIENCE_TABLE = {
|
|
|
444
461
|
"mcp.server_stderr": "operator",
|
|
445
462
|
"workflow.governance_key_stripped": "operator",
|
|
446
463
|
"workflow.agent_option_ignored": "operator",
|
|
464
|
+
"mods.package_key_unread": "operator",
|
|
447
465
|
"workflow.record_unwritten": "operator",
|
|
448
466
|
"memory.content_class_declared": "operator",
|
|
449
467
|
"memory.consolidation_recommended": "operator",
|
|
@@ -470,6 +488,7 @@ const NOTICE_AUDIENCE_TABLE = {
|
|
|
470
488
|
"context.tool_schema_removed": "user",
|
|
471
489
|
"context.messages_omitted": "user",
|
|
472
490
|
"instructions.withheld": "user",
|
|
491
|
+
"instructions.outside_root": "user",
|
|
473
492
|
"instructions.family_undeclared": "operator",
|
|
474
493
|
"skills.listing_truncated": "operator",
|
|
475
494
|
"agents.listing_truncated": "operator",
|
|
@@ -497,6 +516,7 @@ const NOTICE_AUDIENCE_TABLE = {
|
|
|
497
516
|
"store.lock_retained": "operator",
|
|
498
517
|
"store.lock_reclaimed_on_declaration": "operator",
|
|
499
518
|
"store.append_log_parked": "operator",
|
|
519
|
+
"store.tree_id_stamp_incomplete": "operator",
|
|
500
520
|
"store.process_anchor_unavailable": "operator",
|
|
501
521
|
"store.process_anchor_lost": "operator",
|
|
502
522
|
"memory.notice_unscoped": "operator",
|
|
@@ -545,7 +565,6 @@ const NOTICE_ATTENTION_TABLE = {
|
|
|
545
565
|
"memory.harvest_quarantined": "act",
|
|
546
566
|
"memory.harvest_refused": "act",
|
|
547
567
|
"memory.harvest_conflict": "act",
|
|
548
|
-
"memory.hold_opened": "act",
|
|
549
568
|
"memory.hold_disposed": "act",
|
|
550
569
|
"advisor.not_attached": "act",
|
|
551
570
|
"route.finish_reason_unknown": "act",
|
|
@@ -556,25 +575,27 @@ const NOTICE_ATTENTION_TABLE = {
|
|
|
556
575
|
"context.messages_omitted": "act",
|
|
557
576
|
"context.tool_schema_removed": "act",
|
|
558
577
|
"instructions.withheld": "act",
|
|
578
|
+
"instructions.outside_root": "inform",
|
|
559
579
|
"task.user_steer_undrained": "act",
|
|
560
580
|
"task.user_followup_undrained": "act",
|
|
561
581
|
"steering.parked_input_blocked": "act",
|
|
562
582
|
"mods.turn_aborted": "act",
|
|
583
|
+
"task.tool_turn_unrecovered": "act",
|
|
563
584
|
"task.halt_unconsumed": "act",
|
|
564
585
|
"task.interrupt_unconsumed": "act",
|
|
586
|
+
"task.wait_ceiling_reached": "act",
|
|
565
587
|
"task.late_approval": "act",
|
|
566
|
-
"memory.capture_opted_out": "act",
|
|
567
588
|
"memory.capture_optout_unpersisted": "act",
|
|
568
589
|
"memory.mount_failed": "act",
|
|
569
590
|
"session.lineage_rerooted": "act",
|
|
570
591
|
"server.model_unreachable": "act",
|
|
571
592
|
"permission.entry_mode_clamped": "act",
|
|
572
593
|
"memory.sync_layer_parked": "act",
|
|
594
|
+
"classifier.seat_rate_limited": "act",
|
|
573
595
|
"config.read_deny_floor_unkept": "inform",
|
|
574
596
|
"mcp.server_connecting": "inform",
|
|
575
597
|
"inherit_env.names_withheld": "inform",
|
|
576
598
|
"mods.display_withheld": "inform",
|
|
577
|
-
"classifier.seat_rate_limited": "inform",
|
|
578
599
|
"memory.session_polluted": "inform",
|
|
579
600
|
"task.tool_turn_incomplete": "inform",
|
|
580
601
|
"model.context_window_assumed": "inform",
|
|
@@ -586,6 +607,8 @@ const NOTICE_ATTENTION_TABLE = {
|
|
|
586
607
|
"task.verdict_refused": "inform",
|
|
587
608
|
"rewind.boundary_unrecorded": "inform",
|
|
588
609
|
"verify.verifier_is_implementer": "inform",
|
|
610
|
+
"memory.capture_opted_out": "inform",
|
|
611
|
+
"memory.hold_opened": "inform",
|
|
589
612
|
"mods.stop_ended": "inform",
|
|
590
613
|
"peer.inbound_disposition": "inform",
|
|
591
614
|
"peer.receipt_delivered_user_only": "inform",
|
|
@@ -596,6 +619,7 @@ const NOTICE_ATTENTION_TABLE = {
|
|
|
596
619
|
"route.stream_end_ignored": "inform",
|
|
597
620
|
"mods.turn_abort_unconsumed": "inform",
|
|
598
621
|
"approval.read_root_grant_rejected": "audit",
|
|
622
|
+
"approval.session_call_grant_rejected": "audit",
|
|
599
623
|
"task.turn_interrupted": "audit",
|
|
600
624
|
"classifier.unavailable_handed_on": "audit",
|
|
601
625
|
"peer.held_decision_applied": "audit",
|
|
@@ -605,6 +629,9 @@ const NOTICE_ATTENTION_TABLE = {
|
|
|
605
629
|
"memory.delegation_static_mark_waived": "audit",
|
|
606
630
|
"memory.hold_released": "audit",
|
|
607
631
|
"approval.read_root_granted": "audit",
|
|
632
|
+
"workflow.parked_decision_used": "audit",
|
|
633
|
+
"approval.session_call_granted": "audit",
|
|
634
|
+
"mods.registration_refused_deployment": "act",
|
|
608
635
|
"config.autocompact_window_clamped": "act",
|
|
609
636
|
"config.env_timeout_discarded": "act",
|
|
610
637
|
"config.materialize_env_discarded": "act",
|
|
@@ -632,6 +659,7 @@ const NOTICE_ATTENTION_TABLE = {
|
|
|
632
659
|
"config.cross_boundary_posture_undeclared": "act",
|
|
633
660
|
"config.cross_boundary_record_unwritten": "act",
|
|
634
661
|
"permission.rule_store_unreadable_relaxed": "act",
|
|
662
|
+
"permission.revival_root_policy_unrestated": "act",
|
|
635
663
|
"classifier.contract_broken": "act",
|
|
636
664
|
"checkpoint.execution_outcome_unrecorded": "act",
|
|
637
665
|
"delegation.transcript_integrity": "act",
|
|
@@ -657,6 +685,7 @@ const NOTICE_ATTENTION_TABLE = {
|
|
|
657
685
|
"artifact.owner_refused": "act",
|
|
658
686
|
"fs.staging_file_left": "act",
|
|
659
687
|
"store.lock_retained": "act",
|
|
688
|
+
"store.tree_id_stamp_incomplete": "act",
|
|
660
689
|
"store.process_anchor_lost": "act",
|
|
661
690
|
"workspace.sync_failed": "act",
|
|
662
691
|
"memory.layer_locked_legacy": "act",
|
|
@@ -677,6 +706,7 @@ const NOTICE_ATTENTION_TABLE = {
|
|
|
677
706
|
"mcp.server_stderr": "inform",
|
|
678
707
|
"workflow.governance_key_stripped": "inform",
|
|
679
708
|
"workflow.agent_option_ignored": "inform",
|
|
709
|
+
"mods.package_key_unread": "inform",
|
|
680
710
|
"memory.consolidation_recommended": "inform",
|
|
681
711
|
"memory.consolidation_refused": "inform",
|
|
682
712
|
"memory.consolidation_withheld": "inform",
|
|
@@ -775,10 +805,13 @@ const NOTICE_MINTER_TABLE = {
|
|
|
775
805
|
"config.toolpolicy.unmatched_names": "engine",
|
|
776
806
|
"config.agent.unknown_tool": "engine",
|
|
777
807
|
"permission.allow_rule_not_used_in_auto": "engine",
|
|
808
|
+
"permission.revival_root_policy_unrestated": "engine",
|
|
778
809
|
"mods.registration_refused": "engine",
|
|
810
|
+
"mods.registration_refused_deployment": "engine",
|
|
779
811
|
"mods.display_withheld": "engine",
|
|
780
812
|
"mods.stop_ended": "engine",
|
|
781
813
|
"mods.stop_continue_dropped": "engine",
|
|
814
|
+
"mods.package_key_unread": "engine",
|
|
782
815
|
"peer.inbound_disposition": "engine",
|
|
783
816
|
"peer.held_settled": "engine",
|
|
784
817
|
"peer.idle_subscription": "engine",
|
|
@@ -819,6 +852,7 @@ const NOTICE_MINTER_TABLE = {
|
|
|
819
852
|
"workflow.governance_key_stripped": "engine",
|
|
820
853
|
"workflow.agent_option_ignored": "engine",
|
|
821
854
|
"workflow.parked_decision_unused": "engine",
|
|
855
|
+
"workflow.parked_decision_used": "engine",
|
|
822
856
|
"workflow.record_unwritten": "engine",
|
|
823
857
|
"memory.session_polluted": "engine",
|
|
824
858
|
"memory.harvest_quarantined": "engine",
|
|
@@ -860,6 +894,7 @@ const NOTICE_MINTER_TABLE = {
|
|
|
860
894
|
"context.tool_schema_removed": "engine",
|
|
861
895
|
"context.messages_omitted": "engine",
|
|
862
896
|
"instructions.withheld": "engine",
|
|
897
|
+
"instructions.outside_root": "engine",
|
|
863
898
|
"instructions.family_undeclared": "engine",
|
|
864
899
|
"task.user_steer_undrained": "engine",
|
|
865
900
|
"task.user_followup_undrained": "engine",
|
|
@@ -871,11 +906,15 @@ const NOTICE_MINTER_TABLE = {
|
|
|
871
906
|
"mods.turn_abort_unconsumed": "engine",
|
|
872
907
|
"task.late_approval": "engine",
|
|
873
908
|
"task.interrupt_unconsumed": "engine",
|
|
909
|
+
"task.wait_ceiling_reached": "engine",
|
|
874
910
|
"task.completed_past_limit": "engine",
|
|
875
911
|
"task.verdict_refused": "engine",
|
|
876
912
|
"task.tool_turn_incomplete": "engine",
|
|
913
|
+
"task.tool_turn_unrecovered": "engine",
|
|
877
914
|
"approval.read_root_granted": "engine",
|
|
878
915
|
"approval.read_root_grant_rejected": "engine",
|
|
916
|
+
"approval.session_call_granted": "engine",
|
|
917
|
+
"approval.session_call_grant_rejected": "engine",
|
|
879
918
|
"approval.approver_defect": "engine",
|
|
880
919
|
"memory.capture_opted_out": "engine",
|
|
881
920
|
"memory.capture_switched_off": "engine",
|
|
@@ -895,6 +934,7 @@ const NOTICE_MINTER_TABLE = {
|
|
|
895
934
|
"store.lock_retained": "engine",
|
|
896
935
|
"store.lock_reclaimed_on_declaration": "engine",
|
|
897
936
|
"store.append_log_parked": "engine",
|
|
937
|
+
"store.tree_id_stamp_incomplete": "engine",
|
|
898
938
|
"store.process_anchor_unavailable": "engine",
|
|
899
939
|
"store.process_anchor_lost": "engine",
|
|
900
940
|
"engine.debug_trace": "engine",
|
|
@@ -1056,6 +1096,7 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
|
|
|
1056
1096
|
runId: "runId",
|
|
1057
1097
|
},
|
|
1058
1098
|
added: ["kind", "identity", "entries[].reason", "entries[].behavior", "entries[].member", "entries[].element.partition", "entries[].element.index", "entries[].element.read"],
|
|
1099
|
+
toDetail: { kind: ["stored_rule_row"] },
|
|
1059
1100
|
},
|
|
1060
1101
|
],
|
|
1061
1102
|
},
|
|
@@ -1081,6 +1122,7 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
|
|
|
1081
1122
|
runId: "runId",
|
|
1082
1123
|
},
|
|
1083
1124
|
added: ["kind", "identity"],
|
|
1125
|
+
toDetail: { kind: ["rule_text_unreadable"] },
|
|
1084
1126
|
},
|
|
1085
1127
|
],
|
|
1086
1128
|
},
|
|
@@ -1096,6 +1138,7 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
|
|
|
1096
1138
|
when: "kind mcp_injection_dropped (one entry)",
|
|
1097
1139
|
keys: { server: "entries[].entry", reason: "entries[].reason", field: "entries[].field", sessionId: "sessionId" },
|
|
1098
1140
|
added: ["kind", "count", "identity"],
|
|
1141
|
+
toDetail: { kind: ["mcp_injection_dropped"] },
|
|
1099
1142
|
},
|
|
1100
1143
|
],
|
|
1101
1144
|
},
|
|
@@ -1111,6 +1154,7 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
|
|
|
1111
1154
|
when: "kind model_word_unknown (one entry)",
|
|
1112
1155
|
keys: { model: "entries[].entry", seat: "entries[].seat", role: "entries[].role", reason: "entries[].reason", fallback: "entries[].fallback", sessionId: "sessionId", runId: "runId" },
|
|
1113
1156
|
added: ["kind", "count", "identity"],
|
|
1157
|
+
toDetail: { kind: ["model_word_unknown"] },
|
|
1114
1158
|
},
|
|
1115
1159
|
],
|
|
1116
1160
|
},
|
|
@@ -1139,6 +1183,7 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
|
|
|
1139
1183
|
sessionId: "sessionId",
|
|
1140
1184
|
},
|
|
1141
1185
|
added: ["kind", "count", "identity"],
|
|
1186
|
+
toDetail: { kind: ["allow_entry_inert"] },
|
|
1142
1187
|
bounded: { "entries[]": 8 },
|
|
1143
1188
|
},
|
|
1144
1189
|
{
|
|
@@ -1180,8 +1225,8 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
|
|
|
1180
1225
|
branches: [
|
|
1181
1226
|
{
|
|
1182
1227
|
to: "config.entries_not_applied",
|
|
1183
|
-
when: "allow-list entries
|
|
1184
|
-
detail: { bucket: ["toolAllow"] },
|
|
1228
|
+
when: "allow-list entries the old frame says read as no rule (each entry whose `entries[].reader` is no_rule): kind session_rule_unread",
|
|
1229
|
+
detail: { bucket: ["toolAllow"], "entries[].reader": ["no_rule"] },
|
|
1185
1230
|
keys: {
|
|
1186
1231
|
bucket: "bucket",
|
|
1187
1232
|
storedGrammar: "storedGrammar",
|
|
@@ -1193,11 +1238,31 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
|
|
|
1193
1238
|
sessionId: "sessionId",
|
|
1194
1239
|
},
|
|
1195
1240
|
added: ["kind", "count", "identity"],
|
|
1241
|
+
toDetail: { kind: ["session_rule_unread"] },
|
|
1242
|
+
bounded: { "entries[]": 8 },
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
to: "config.entries_not_applied",
|
|
1246
|
+
when: "grammar-0 allow-list entries the old frame says named no tool under that grammar's bare-name comparison (each entry whose `entries[].reader` is named_no_tool): kind session_rule_named_no_tool",
|
|
1247
|
+
detail: { bucket: ["toolAllow"], "entries[].reader": ["named_no_tool"] },
|
|
1248
|
+
keys: {
|
|
1249
|
+
bucket: "bucket",
|
|
1250
|
+
storedGrammar: "storedGrammar",
|
|
1251
|
+
"entries[].entry": "entries[].entry",
|
|
1252
|
+
"entries[].reader": "entries[].reader",
|
|
1253
|
+
"rewrite.by": "rewrite.by",
|
|
1254
|
+
"rewrite.stampsGrammar": "rewrite.stampsGrammar",
|
|
1255
|
+
rulesSessionId: "rulesSessionId",
|
|
1256
|
+
sessionId: "sessionId",
|
|
1257
|
+
},
|
|
1258
|
+
added: ["kind", "count", "identity"],
|
|
1259
|
+
toDetail: { kind: ["session_rule_named_no_tool"] },
|
|
1196
1260
|
bounded: { "entries[]": 8 },
|
|
1197
1261
|
},
|
|
1198
1262
|
{
|
|
1199
1263
|
to: "config.session_rules_reread",
|
|
1200
|
-
when: "entries whose meaning a later grammar revised, either list (only those entries)",
|
|
1264
|
+
when: "entries whose meaning a later grammar revised, either list (only those entries: each entry whose `entries[].reader` is grammar_revised)",
|
|
1265
|
+
detail: { "entries[].reader": ["grammar_revised"] },
|
|
1201
1266
|
keys: {
|
|
1202
1267
|
bucket: "bucket",
|
|
1203
1268
|
storedGrammar: "storedGrammar",
|
|
@@ -1211,4 +1276,37 @@ export const NOTICE_CODE_LINEAGE = Object.freeze({
|
|
|
1211
1276
|
},
|
|
1212
1277
|
],
|
|
1213
1278
|
},
|
|
1279
|
+
"mods.registration_refused": {
|
|
1280
|
+
change: "narrowed",
|
|
1281
|
+
in: "7.71.0",
|
|
1282
|
+
attentionBefore: "act",
|
|
1283
|
+
attentionAfter: "act",
|
|
1284
|
+
branches: [
|
|
1285
|
+
{
|
|
1286
|
+
to: "mods.registration_refused_deployment",
|
|
1287
|
+
when: "a registration of the deployment seat (`RunnerDeps.mods`) — told to the operator, not the person",
|
|
1288
|
+
detail: { seat: ["deployment"] },
|
|
1289
|
+
keys: { name: "name", seat: "seat", tier: "tier", provenance: "provenance", refusedBy: "refusedBy", reason: "reason", sessionId: "sessionId" },
|
|
1290
|
+
},
|
|
1291
|
+
],
|
|
1292
|
+
},
|
|
1293
|
+
"task.tool_turn_incomplete": {
|
|
1294
|
+
change: "narrowed",
|
|
1295
|
+
in: "7.71.0",
|
|
1296
|
+
attentionBefore: "inform",
|
|
1297
|
+
attentionAfter: "inform",
|
|
1298
|
+
branches: [
|
|
1299
|
+
{
|
|
1300
|
+
to: "task.tool_turn_unrecovered",
|
|
1301
|
+
when: "stream frames that could not be read (the response may be missing content), or earlier calls whose outcome is unknown",
|
|
1302
|
+
detail: { cause: ["bad_frame", "missing_result_synthesized"] },
|
|
1303
|
+
keys: { cause: "cause", count: "count", toolCallIds: "toolCallIds", sessionId: "sessionId", runId: "runId" },
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
to: "task.tool_turn_unrecovered",
|
|
1307
|
+
when: "dropped calls (cause truncated or unnamed) whose frame carries no `outcome`: the turn stated none, so they did not run and nothing asked the model to re-issue them",
|
|
1308
|
+
keys: { cause: "cause", count: "count", finishReason: "finishReason", inputTokens: "inputTokens", outputTokens: "outputTokens", contextWindow: "contextWindow", maxTokens: "maxTokens", reasksSoFar: "reasksSoFar", sessionId: "sessionId", runId: "runId" },
|
|
1309
|
+
},
|
|
1310
|
+
],
|
|
1311
|
+
},
|
|
1214
1312
|
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The grant holder: the value a host hands a run as `RunInternals.holder` — its credential for the one claim grant the run acts under —
|
|
3
|
+
* and the two words a store answers about it. The engine carries the value verbatim and never judges, stores, compares or prints it;
|
|
4
|
+
* the codec below is for hosts (the deployment's judge and the code that mints the value), so that every judge a deployment runs
|
|
5
|
+
* reads one encoding. The engine's own paths never call {@link encodeGrantHolder} / {@link decodeGrantHolder}.
|
|
6
|
+
*
|
|
7
|
+
* Two words, one each:
|
|
8
|
+
* - `holder.superseded` — a write carrying a holder whose grant is no longer the run's current leg, or whose run has ended: the store
|
|
9
|
+
* wrote nothing, and the leg stops without retrying ({@link holderSupersededError}, {@link isHolderSuperseded});
|
|
10
|
+
* - `holder.malformed` — a value {@link decodeGrantHolder} cannot read: a judge that meets one throws it, and the write throws with it,
|
|
11
|
+
* nothing written.
|
|
12
|
+
*/
|
|
13
|
+
/** What a grant names: the run (`taskId`) and the leg of that run the grant was given to (`legId`). Both non-empty strings. */
|
|
14
|
+
export interface GrantHolderParts {
|
|
15
|
+
readonly taskId: string;
|
|
16
|
+
readonly legId: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Encode a grant as the holder a host hands a run (`RunInternals.holder`).
|
|
20
|
+
*
|
|
21
|
+
* THE FORM: `g1.<taskId>.<legId>`, each part the UTF-8 bytes of its string in base64url with no padding. The value is opaque to
|
|
22
|
+
* everything but {@link decodeGrantHolder}: the engine never reads it, and a host does not parse it by hand.
|
|
23
|
+
*
|
|
24
|
+
* STABLE ACROSS VERSIONS: the `g1.<taskId>.<legId>` form does not change from one release to the next, so a host may hand the value
|
|
25
|
+
* between replicas and may store it. A future form takes a new prefix, and its release lists that change as hard-breaking.
|
|
26
|
+
*
|
|
27
|
+
* THE ROUND-TRIP LAW (both directions hold):
|
|
28
|
+
* - `decodeGrantHolder(encodeGrantHolder(p))` has the same `taskId` and `legId` as `p`, for every `p` this function accepts;
|
|
29
|
+
* - `encodeGrantHolder(decodeGrantHolder(h)) === h` for every `h` {@link decodeGrantHolder} accepts — each grant has exactly one
|
|
30
|
+
* encoding, so two holders are the same grant exactly when they are the same string.
|
|
31
|
+
*
|
|
32
|
+
* Refuses (`config.invalid_argument`) a part that is not a non-empty, well-formed string (a lone surrogate would not survive the
|
|
33
|
+
* round trip), naming the part, never its value.
|
|
34
|
+
*/
|
|
35
|
+
export declare function encodeGrantHolder(parts: GrantHolderParts): string;
|
|
36
|
+
/**
|
|
37
|
+
* Decode a holder minted by {@link encodeGrantHolder} (the form and the round-trip law are written there). Anything else — not a
|
|
38
|
+
* string, another version, a part that is not the one base64url encoding of non-empty UTF-8 — throws `holder.malformed`, never
|
|
39
|
+
* answers a grant: a judge that meets it throws, and the write that carried it throws with nothing written.
|
|
40
|
+
*/
|
|
41
|
+
export declare function decodeGrantHolder(holder: string): GrantHolderParts;
|
|
42
|
+
/**
|
|
43
|
+
* THE refusal a store answers a write that carries a holder its judge does not hold current — the one constructor every store uses
|
|
44
|
+
* (an append, a leaf move, a card's `put` or steer: the writes with no row a caller could re-read). `what` names the write ("append",
|
|
45
|
+
* "setLeafId", "put", …), never the holder. The store wrote nothing. A CAS-shaped verb (`resolve`, `expire`) does not throw it: it
|
|
46
|
+
* loses, and its caller's loss reading names the word.
|
|
47
|
+
*/
|
|
48
|
+
export declare function holderSupersededError(what: string): Error & {
|
|
49
|
+
readonly code: "holder.superseded";
|
|
50
|
+
};
|
|
51
|
+
/** THE reading of {@link holderSupersededError}: any thrown value whose `code` is `holder.superseded` (read once, guarded — a thrown
|
|
52
|
+
* value's accessor that throws is not this word). */
|
|
53
|
+
export declare function isHolderSuperseded(err: unknown): boolean;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const GRANT_HOLDER_PREFIX = "g1";
|
|
2
|
+
const PART = /^[A-Za-z0-9_-]+$/;
|
|
3
|
+
const UTF8 = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
|
|
4
|
+
function wellFormed(s) {
|
|
5
|
+
for (let i = 0; i < s.length; i++) {
|
|
6
|
+
const c = s.charCodeAt(i);
|
|
7
|
+
if (c >= 0xd800 && c <= 0xdbff) {
|
|
8
|
+
const next = s.charCodeAt(i + 1);
|
|
9
|
+
if (!(next >= 0xdc00 && next <= 0xdfff))
|
|
10
|
+
return false;
|
|
11
|
+
i++;
|
|
12
|
+
}
|
|
13
|
+
else if (c >= 0xdc00 && c <= 0xdfff) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
function codedError(code, message) {
|
|
20
|
+
const e = new Error(message);
|
|
21
|
+
e.code = code;
|
|
22
|
+
return e;
|
|
23
|
+
}
|
|
24
|
+
function malformed(why) {
|
|
25
|
+
const e = codedError("holder.malformed", `grant holder is malformed: ${why} — it was not minted by encodeGrantHolder; the write it rode did not run`);
|
|
26
|
+
e.name = "GrantHolderMalformedError";
|
|
27
|
+
return e;
|
|
28
|
+
}
|
|
29
|
+
function partToEncode(name, value) {
|
|
30
|
+
if (typeof value !== "string" || value === "" || !wellFormed(value)) {
|
|
31
|
+
const kind = typeof value !== "string" ? (value === null ? "null" : `a ${typeof value}`) : value === "" ? "an empty string" : "a string with a lone surrogate";
|
|
32
|
+
throw codedError("config.invalid_argument", `encodeGrantHolder: ${name} must be a non-empty, well-formed string (got ${kind})`);
|
|
33
|
+
}
|
|
34
|
+
return Buffer.from(value, "utf8").toString("base64url");
|
|
35
|
+
}
|
|
36
|
+
export function encodeGrantHolder(parts) {
|
|
37
|
+
const taskId = partToEncode("taskId", parts?.taskId);
|
|
38
|
+
const legId = partToEncode("legId", parts?.legId);
|
|
39
|
+
return `${GRANT_HOLDER_PREFIX}.${taskId}.${legId}`;
|
|
40
|
+
}
|
|
41
|
+
function decodePart(part, name) {
|
|
42
|
+
if (!PART.test(part))
|
|
43
|
+
throw malformed(`its ${name} part is not base64url`);
|
|
44
|
+
const bytes = Buffer.from(part, "base64url");
|
|
45
|
+
if (bytes.toString("base64url") !== part)
|
|
46
|
+
throw malformed(`its ${name} part is not in the one encoding of its bytes`);
|
|
47
|
+
let text;
|
|
48
|
+
try {
|
|
49
|
+
text = UTF8.decode(bytes);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
throw malformed(`its ${name} part is not UTF-8`);
|
|
53
|
+
}
|
|
54
|
+
if (text === "")
|
|
55
|
+
throw malformed(`its ${name} part is empty`);
|
|
56
|
+
return text;
|
|
57
|
+
}
|
|
58
|
+
export function decodeGrantHolder(holder) {
|
|
59
|
+
if (typeof holder !== "string")
|
|
60
|
+
throw malformed(`it is ${holder === null ? "null" : `a ${typeof holder}`}, not a string`);
|
|
61
|
+
const parts = holder.split(".");
|
|
62
|
+
if (parts.length !== 3 || parts[0] !== GRANT_HOLDER_PREFIX)
|
|
63
|
+
throw malformed(`it is not \`${GRANT_HOLDER_PREFIX}.<taskId>.<legId>\``);
|
|
64
|
+
return Object.freeze({ taskId: decodePart(parts[1], "taskId"), legId: decodePart(parts[2], "legId") });
|
|
65
|
+
}
|
|
66
|
+
export function holderSupersededError(what) {
|
|
67
|
+
const e = codedError("holder.superseded", `${what}: the run's grant is no longer current (another leg holds the run, or the run has ended) — nothing was written; stop this leg, do not retry`);
|
|
68
|
+
e.name = "HolderSupersededError";
|
|
69
|
+
return e;
|
|
70
|
+
}
|
|
71
|
+
export function isHolderSuperseded(err) {
|
|
72
|
+
if (err === null || (typeof err !== "object" && typeof err !== "function"))
|
|
73
|
+
return false;
|
|
74
|
+
try {
|
|
75
|
+
return err.code === "holder.superseded";
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
package/dist/core/hooks.d.ts
CHANGED
|
@@ -747,6 +747,8 @@ export type ContentAskOutcome = {
|
|
|
747
747
|
export interface ParkAttemptFailed {
|
|
748
748
|
/** Why the park could not be minted — a sentence, already worded for a reader. */
|
|
749
749
|
parkFailed: string;
|
|
750
|
+
/** The missing piece of durable-suspend infrastructure the failure is, when it is one (its manifest code; the deny exit carries only a word of that set). */
|
|
751
|
+
parkFailedReason?: import("./wiring-manifest.js").SuspendLaneReason;
|
|
750
752
|
}
|
|
751
753
|
/**
|
|
752
754
|
* design/182 §7 — what the ORG layer answers for ONE call (see `ToolGateInput.orgRules`).
|
|
@@ -916,7 +918,7 @@ export interface ToolGateInput extends PermissionSeatInputs, SkillGateSeats, All
|
|
|
916
918
|
* starting directory and answer for a run that has since `cd`ed. Absent ⇒ the contexts carry no
|
|
917
919
|
* `cwd`, which is the honest answer for a run with no tracked one. */
|
|
918
920
|
trackedCwd?: () => string | undefined;
|
|
919
|
-
/** The leg's target-reading stamp, applied where the gate's request is minted over the final args (a rewrite re-reads it: `withArgsReading`). */
|
|
921
|
+
/** The leg's target-reading stamp, applied where the gate's request is minted over the final args (a rewrite re-reads it: `withArgsReading`). Its answer is the request it was handed with a reading added, compared member by member by value (the call's binding digest; a clone of the whole request is the same call): one that moved the call (another tool name, call id, face or arguments) is a reading that failed, denied fail-closed in the stamp's own sentence (`stampedCallOf`). */
|
|
920
922
|
stampCallTarget?: CallTargetStamp;
|
|
921
923
|
/** The read-only env capability face put on every {@link PreToolUseEvent} this gate call
|
|
922
924
|
* builds ({@link HookEnvCapabilities}). Built ONCE per task by the runner (after the env is minted) and
|
|
@@ -951,7 +953,7 @@ export interface ToolGateInput extends PermissionSeatInputs, SkillGateSeats, All
|
|
|
951
953
|
* operator is reachable for THIS ask; the gate then re-routes onto the durable park leg (below),
|
|
952
954
|
* keeping the carried fail-closed deny when no park is armed. The optional trailing `callSignal`
|
|
953
955
|
* (design/384) is {@link ToolGateInput.callSignal}, passed through verbatim. `req` carries the delivery's landing ({@link GateDeliveredCall}): a fresh
|
|
954
|
-
* frozen copy minted at this delivery, not the object `adjudicate` saw — relate the two by `toolCallId`, never by object identity. */
|
|
956
|
+
* frozen copy minted at this delivery, not the object `adjudicate` saw — relate the two by `toolCallId`, never by object identity. The awaited answer is projected by name (`RECEIVED_RESOLUTION_MEMBERS`, each read once — a prototype getter, a hidden member, a Proxy's `get` alike — onto a fresh frozen plain object; nothing else is carried and nothing reads the answer after): one that is not an object whose `action` is `allow` or `deny` is nobody's yes, refused fail-closed in the out-of-contract sentence (`receivedResolution`). */
|
|
955
957
|
resolveAsk: (decision: PermissionResult, req: GateDeliveredCall, callSignal?: AbortSignal) => Promise<ResolvedAsk>;
|
|
956
958
|
/**
|
|
957
959
|
* design/45: route a policy `ask` to a **durable suspension** instead of the synchronous `resolveAsk`
|
|
@@ -1272,7 +1274,7 @@ export interface ToolGateInput extends PermissionSeatInputs, SkillGateSeats, All
|
|
|
1272
1274
|
* caller-side change that would have let the call run, present for the causes that say nobody could be asked (`approver_unavailable`,
|
|
1273
1275
|
* `no_approver_wired`) — for arguments no approval can be bound to, the binding's own sentence (the remedy's approver half would not
|
|
1274
1276
|
* let them run); `modelRemedy` = the way out the model read in its place where the engine can say what issuing the call again does — nobody can approve it, or it is asked again (`RefusedAsk.modelRemedy`; on an ask an ancestor floated back only where the leg has no park route; a policy's seat on a leg with no park route reads the first as before, though the policy may allow the call issued again — not a case the engine can say); `remedies` = its ways out as data, beside `remedy`; `question` = the refused call is the agent's own question to a person (its class set holds `content_question`); `unbindable` = no approval can be bound to its arguments (`remedy` is the binding's sentence);
|
|
1275
|
-
* `parkTargetGap` = the leg's sentence why it cannot hold a park, when that alone kept the call from parking (`GatePass.parkTargetGap`). Observe-only: a throwing seat never alters the deny. Absent ⇒ the deny stands silently (no notice sink).
|
|
1277
|
+
* `parkTargetGap` = the leg's sentence why it cannot hold a park, when that alone kept the call from parking (`GatePass.parkTargetGap`); `parkFailed` = a park attempted for the call could not be minted (its sentence as the deny's note quotes it; `parkFailedReason` its infrastructure code, when it names one). Observe-only: a throwing seat never alters the deny. Absent ⇒ the deny stands silently (no notice sink).
|
|
1276
1278
|
*/
|
|
1277
1279
|
onAskUnresolvable?: (info: {
|
|
1278
1280
|
toolName: string;
|
|
@@ -1287,6 +1289,8 @@ export interface ToolGateInput extends PermissionSeatInputs, SkillGateSeats, All
|
|
|
1287
1289
|
question?: true;
|
|
1288
1290
|
unbindable?: true;
|
|
1289
1291
|
parkTargetGap?: string;
|
|
1292
|
+
parkFailed?: string;
|
|
1293
|
+
parkFailedReason?: import("./wiring-manifest.js").SuspendLaneReason;
|
|
1290
1294
|
}) => void;
|
|
1291
1295
|
/**
|
|
1292
1296
|
* design/153 §2/§7.4 (件4 复审, MED): true means this call's ask is MARKED — an inherited ancestor
|
package/dist/core/hooks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readSuspendTargetGap } from "./unavailable-landing.js";
|
|
2
2
|
import { argsAsTheToolReads, stampArgsReading } from "./effective-path-target.js";
|
|
3
|
-
import { extensionAuthors, noteRewrite, readRejudge, rewriteChasedSentence, screeningAuthorship } from "./rewrite-rejudge.js";
|
|
3
|
+
import { answerAsShown, extensionAuthors, noteRewrite, readRejudge, rewriteChasedSentence, screeningAuthorship, shownDigestOf } from "./rewrite-rejudge.js";
|
|
4
4
|
import { decisionText, describeThrown, extensionQuestionText, foldHookAsk, isEngineRefusal, ownArgs, ownedReading, refuseOutOfContractDecision } from "./tool-policy.js";
|
|
5
5
|
import { createSettlementLedger, engineFailClosedExit, hookDenyExit, settledScreen, settledScreenExit, takeInheritedScreen, unownedArgsExit } from "./runner/gate-exit.js";
|
|
6
6
|
import { composeCallSignal } from "./runner/abort-race.js";
|
|
@@ -226,7 +226,7 @@ export function createPreToolUseScreening(input, readSettled = (decision) => ({
|
|
|
226
226
|
if (verdict?.action !== "ask")
|
|
227
227
|
return undefined;
|
|
228
228
|
const ask = { action: "ask", message: decisionText(verdict) ?? `approval required for "${toolName}" (an inherited PreToolUse hook)`, decisionReason: "hook", ...(verdict.requiresRealApproval === true ? { requiresRealApproval: true } : {}), ...(verdict.askReasons !== undefined ? { askReasons: verdict.askReasons } : {}) };
|
|
229
|
-
const settled = readSettled(await seat.installation.settle(ask, call, signal));
|
|
229
|
+
const settled = readSettled(answerAsShown(shownDigestOf(call), await seat.installation.settle(ask, call, signal), call));
|
|
230
230
|
if (settled.decision.action === "deny")
|
|
231
231
|
return settledScreen(settled, judgedOf());
|
|
232
232
|
if (settled.decision.action === "allow" && settled.decision.updatedInput !== undefined)
|
|
@@ -228,6 +228,12 @@ export declare function judgeEntryToolFaces(copy: McpServerSpec): McpEntryJudgme
|
|
|
228
228
|
* The entry is unchanged (a string is already the engine's own copy).
|
|
229
229
|
*/
|
|
230
230
|
export declare function judgeEntrySessionMetaKey(copy: McpServerSpec): McpEntryJudgment;
|
|
231
|
+
/**
|
|
232
|
+
* The `callerMeta` question for ONE snapshot MCP entry — asked by the door and the materialization entrance like its siblings, through the
|
|
233
|
+
* one judge ({@link judgeCallerMeta}); a value other than `true` / `false` refuses under `config.invalid_argument`, naming the server and the
|
|
234
|
+
* value's kind. The entry is unchanged.
|
|
235
|
+
*/
|
|
236
|
+
export declare function judgeEntryCallerMeta(copy: McpServerSpec): McpEntryJudgment;
|
|
231
237
|
/**
|
|
232
238
|
* The reserved-name question for ONE snapshot MCP entry, asked after its `toolAxes` and `toolFaces` were read: a declaration keyed by a
|
|
233
239
|
* reserved face word ({@link MCP_FACE_WORDS}) names a face of the server, never a tool — no tool of the server is ever mounted under that
|
|
@@ -254,7 +260,7 @@ export declare function judgeEntryHostTransport(copy: McpServerSpec): McpEntryJu
|
|
|
254
260
|
/**
|
|
255
261
|
* Everything a snapshot MCP entry declares beyond its plain data, judged: its `toolAxes` ({@link judgeEntryToolAxes}), its `toolFaces`
|
|
256
262
|
* ({@link judgeEntryToolFaces}), the keys of both against the reserved face words ({@link judgeEntryReservedKeys}), its `sessionMetaKey`
|
|
257
|
-
* ({@link judgeEntrySessionMetaKey}), its transport kind ({@link judgeEntryTransportKind}), its host transport ({@link judgeEntryHostTransport}) —
|
|
263
|
+
* ({@link judgeEntrySessionMetaKey}), its `callerMeta` ({@link judgeEntryCallerMeta}), its transport kind ({@link judgeEntryTransportKind}), its host transport ({@link judgeEntryHostTransport}) —
|
|
258
264
|
* in that order, the first refusal is the answer.
|
|
259
265
|
*
|
|
260
266
|
* The questions both entrances ask of a server's snapshot — the task's door (after its content class, {@link admitTaskMcpCopy}) and the library
|
|
@@ -5,7 +5,7 @@ import { declarationSubject as entrySubject, declarerNameOf } from "./declaratio
|
|
|
5
5
|
import { callerKey, callerText } from "./caller-text.js";
|
|
6
6
|
import { isPlainRecord, receive } from "./mods/kernel/receive.js";
|
|
7
7
|
import { TOOL_FACE_WORDS, readToolFaces } from "./tool-face-reader.js";
|
|
8
|
-
import { judgeSessionMetaKey } from "./mcp-call-meta.js";
|
|
8
|
+
import { judgeCallerMeta, judgeSessionMetaKey } from "./mcp-call-meta.js";
|
|
9
9
|
import { isMcpFaceWord } from "./mounted-mcp.js";
|
|
10
10
|
import { CONFIG_RECEIPT_MODE, optionKeys, strayMembersOf } from "./own-property-receipt.js";
|
|
11
11
|
import { isToolContentOrigin, TOOL_CONTENT_ORIGINS } from "./memory-engine/content-origin.js";
|
|
@@ -178,6 +178,12 @@ export function judgeEntrySessionMetaKey(copy) {
|
|
|
178
178
|
return { ok: true, entry: copy };
|
|
179
179
|
return { ok: false, error: codedError("config.invalid_argument", `${declarerWord("mcp")} ${declarerNameOf(copy.name)} declares ${inlineUntrusted(read.problem, 200)}. The key decides where the leg's session id rides on this server's requests, so it is refused rather than dropped or defaulted — a connector keyed on a session it never receives would share one state across every session.`) };
|
|
180
180
|
}
|
|
181
|
+
export function judgeEntryCallerMeta(copy) {
|
|
182
|
+
const read = judgeCallerMeta(copy.callerMeta);
|
|
183
|
+
if (!("problem" in read))
|
|
184
|
+
return { ok: true, entry: copy };
|
|
185
|
+
return { ok: false, error: codedError("config.invalid_argument", `${declarerWord("mcp")} ${declarerNameOf(copy.name)} declares ${inlineUntrusted(read.problem, 200)}. The value decides whether this server is told which task, run and delegation tree each request comes from, so it is refused rather than read as either — a server keyed on a caller it never receives would fold every caller into one.`) };
|
|
186
|
+
}
|
|
181
187
|
export function judgeEntryReservedKeys(copy) {
|
|
182
188
|
const reservedKey = (declared) => (isPlainRecord(declared) ? Object.keys(declared).find(isMcpFaceWord) : undefined);
|
|
183
189
|
const problem = (word) => `its key "${word}" is a reserved allowTools face word (a kind of read the engine makes of the server), never a tool name — no tool is ever mounted under it`;
|
|
@@ -220,7 +226,8 @@ export function judgeMcpEntryCopy(copy) {
|
|
|
220
226
|
const faces = axes.ok ? judgeEntryToolFaces(axes.entry) : axes;
|
|
221
227
|
const reserved = faces.ok ? judgeEntryReservedKeys(faces.entry) : faces;
|
|
222
228
|
const metaKey = reserved.ok ? judgeEntrySessionMetaKey(reserved.entry) : reserved;
|
|
223
|
-
const
|
|
229
|
+
const callerMeta = metaKey.ok ? judgeEntryCallerMeta(metaKey.entry) : metaKey;
|
|
230
|
+
const kind = callerMeta.ok ? judgeEntryTransportKind(callerMeta.entry) : callerMeta;
|
|
224
231
|
return kind.ok ? judgeEntryHostTransport(kind.entry) : kind;
|
|
225
232
|
}
|
|
226
233
|
function judgeEntryContentOrigin(copy) {
|