@sema-agent/core 7.51.2 → 7.53.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 +698 -2
- package/README.md +3 -1
- package/dist/agents/agent-transcript-tool.d.ts +1 -1
- package/dist/agents/cascade.js +4 -0
- package/dist/agents/cross-session-envelope.d.ts +8 -0
- package/dist/agents/cross-session-envelope.js +6 -0
- package/dist/agents/cross-session-judge.d.ts +21 -1
- package/dist/agents/cross-session-judge.js +8 -0
- package/dist/agents/cross-session-ref.d.ts +5 -0
- package/dist/agents/cross-session-ref.js +1 -0
- package/dist/agents/cumulative-stats.d.ts +3 -0
- package/dist/agents/cumulative-stats.js +3 -0
- package/dist/agents/list-agents-tool.d.ts +1 -1
- package/dist/agents/org-delivery-gate.d.ts +122 -0
- package/dist/agents/org-delivery-gate.js +69 -0
- package/dist/agents/peer-held-queue.d.ts +9 -4
- package/dist/agents/peer-held-queue.js +6 -5
- package/dist/agents/peer-session-drain.d.ts +35 -5
- package/dist/agents/peer-session-drain.js +271 -180
- package/dist/agents/read-inbox-tool.d.ts +8 -1
- package/dist/agents/read-inbox-tool.js +5 -1
- package/dist/agents/repair-loop.js +4 -0
- package/dist/agents/send-message-tool.d.ts +11 -16
- package/dist/agents/send-message-tool.js +11 -13
- package/dist/agents/subagent.d.ts +3 -0
- package/dist/agents/subagent.js +105 -76
- package/dist/agents/tool-filter.d.ts +58 -13
- package/dist/agents/tool-filter.js +34 -14
- package/dist/bench/metrics.d.ts +1 -0
- package/dist/brain/anthropic.d.ts +6 -1
- package/dist/brain/anthropic.js +17 -13
- package/dist/brain/model-presets.d.ts +4 -5
- package/dist/brain/model-presets.js +6 -5
- package/dist/brain/open-responses.js +16 -12
- package/dist/brain/openai.js +16 -12
- package/dist/brain/request-params.d.ts +12 -33
- package/dist/brain/request-params.js +5 -2
- package/dist/brain/request-route.d.ts +9 -8
- package/dist/brain/request-route.js +1 -0
- package/dist/brain/route-adjudicator.d.ts +123 -47
- package/dist/brain/route-adjudicator.js +171 -42
- package/dist/brain/route-conformance.js +2 -2
- package/dist/brain/routing.d.ts +24 -1
- package/dist/brain/routing.js +54 -19
- package/dist/brain/status-sink.d.ts +18 -0
- package/dist/brain/status-sink.js +7 -0
- package/dist/brain/timeout.js +5 -4
- package/dist/core/a2a.d.ts +5 -2
- package/dist/core/a2a.js +30 -13
- package/dist/core/allow-entry.d.ts +42 -9
- package/dist/core/allow-entry.js +25 -18
- package/dist/core/auto-compaction.d.ts +80 -20
- package/dist/core/auto-compaction.js +65 -18
- package/dist/core/auto-promote.d.ts +2 -1
- package/dist/core/auto-promote.js +2 -2
- package/dist/core/caller-tool-name.d.ts +9 -0
- package/dist/core/caller-tool-name.js +13 -0
- package/dist/core/checkpoint-requirements.d.ts +7 -1
- package/dist/core/checkpoint-requirements.js +2 -0
- package/dist/core/checkpoint-store.d.ts +57 -24
- package/dist/core/checkpoint-store.js +3 -3
- package/dist/core/child-clamp-seats.d.ts +6 -0
- package/dist/core/child-clamp-seats.js +2 -1
- package/dist/core/compliance.js +3 -1
- package/dist/core/credential-vocabulary.d.ts +33 -8
- package/dist/core/credential-vocabulary.js +32 -7
- package/dist/core/decision-receipt.d.ts +2 -2
- package/dist/core/delegation-frames.d.ts +9 -2
- package/dist/core/delegation-name.d.ts +18 -0
- package/dist/core/delegation-name.js +47 -0
- package/dist/core/effective-path-target.d.ts +25 -6
- package/dist/core/effective-path-target.js +24 -2
- package/dist/core/engine-capabilities.d.ts +8 -1
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-notice.d.ts +49 -21
- package/dist/core/frontmatter-fence.d.ts +10 -0
- package/dist/core/frontmatter-fence.js +6 -0
- package/dist/core/gate-fold.js +8 -25
- package/dist/core/gate-lanes.js +358 -274
- package/dist/core/gate-outcome.d.ts +11 -6
- package/dist/core/governance-codes.d.ts +11 -4
- package/dist/core/governance-codes.js +12 -3
- package/dist/core/hands-band-screen.d.ts +7 -0
- package/dist/core/hands-band-screen.js +32 -0
- package/dist/core/hooks.d.ts +283 -739
- package/dist/core/hooks.js +100 -193
- package/dist/{tools/fs → core}/image-admission.d.ts +21 -3
- package/dist/{tools/fs → core}/image-admission.js +24 -6
- package/dist/core/locked-config.d.ts +84 -32
- package/dist/core/locked-config.js +128 -42
- package/dist/core/mcp-connection-pool.d.ts +4 -1
- package/dist/core/mcp-connection-pool.js +7 -2
- package/dist/core/mcp-probe.d.ts +12 -9
- package/dist/core/mcp-probe.js +3 -3
- package/dist/core/mcp-server-spec.d.ts +104 -10
- package/dist/core/mcp-server-spec.js +183 -33
- package/dist/core/mcp.d.ts +31 -20
- package/dist/core/mcp.js +66 -56
- package/dist/core/memory-engine/data-plane.js +5 -1
- package/dist/core/memory-engine/distiller.js +16 -2
- package/dist/core/memory-engine/engine.d.ts +22 -30
- package/dist/core/memory-engine/engine.js +16 -10
- package/dist/core/memory-engine/frontmatter.d.ts +6 -0
- package/dist/core/memory-engine/frontmatter.js +19 -16
- package/dist/core/memory.d.ts +2 -2
- package/dist/core/mode-policy.d.ts +5 -16
- package/dist/core/mode-policy.js +7 -19
- package/dist/core/model-seat.d.ts +4 -1
- package/dist/core/mods/dollar.d.ts +109 -0
- package/dist/core/mods/dollar.js +154 -0
- package/dist/core/mods/host.d.ts +23 -0
- package/dist/core/mods/host.js +21 -0
- package/dist/core/mods/kernel/budget.d.ts +43 -0
- package/dist/core/mods/kernel/budget.js +83 -0
- package/dist/core/mods/kernel/dispatch.d.ts +100 -0
- package/dist/core/mods/kernel/dispatch.js +699 -0
- package/dist/core/mods/kernel/events.d.ts +245 -0
- package/dist/core/mods/kernel/events.js +210 -0
- package/dist/core/mods/kernel/index.d.ts +6 -0
- package/dist/core/mods/kernel/index.js +5 -0
- package/dist/core/mods/kernel/receive.d.ts +94 -0
- package/dist/core/mods/kernel/receive.js +188 -0
- package/dist/core/mods/kernel/registration.d.ts +131 -0
- package/dist/core/mods/kernel/registration.js +102 -0
- package/dist/core/mods/kernel/site-rules.d.ts +149 -0
- package/dist/core/mods/kernel/site-rules.js +296 -0
- package/dist/core/mods/stations.d.ts +344 -0
- package/dist/core/mods/stations.js +437 -0
- package/dist/core/mounted-mcp.d.ts +57 -0
- package/dist/core/mounted-mcp.js +71 -2
- package/dist/core/own-property-receipt.d.ts +13 -0
- package/dist/core/own-property-receipt.js +13 -23
- package/dist/core/parent-spec-seat.d.ts +18 -7
- package/dist/core/parent-spec-seat.js +6 -2
- package/dist/core/path-identity.js +2 -1
- package/dist/core/permission-rule-model.d.ts +58 -9
- package/dist/core/permission-rule-model.js +81 -7
- package/dist/core/permission-rule-org.d.ts +163 -33
- package/dist/core/permission-rule-org.js +205 -71
- package/dist/core/permission-rule-syntax.d.ts +15 -0
- package/dist/core/permission-rule-syntax.js +24 -16
- package/dist/core/permission-rules.d.ts +14 -2
- package/dist/core/permission-rules.js +63 -23
- package/dist/core/prompt-section-seat.d.ts +15 -27
- package/dist/core/prompt-section-seat.js +73 -40
- package/dist/core/protocol-http-auth.d.ts +3 -1
- package/dist/core/protocol-http-auth.js +2 -0
- package/dist/core/reminder-mint.d.ts +2 -2
- package/dist/core/remote-env.d.ts +24 -12
- package/dist/core/remote-env.js +1 -0
- package/dist/core/resume-startup-cause.d.ts +16 -1
- package/dist/core/resume-startup-cause.js +4 -1
- package/dist/core/retention.js +7 -2
- package/dist/core/retired-keys.d.ts +12 -2
- package/dist/core/retired-keys.js +15 -1
- package/dist/core/roles.js +60 -10
- package/dist/core/rule-lane-reads.js +1 -1
- package/dist/core/runner/announce-once-ledger.d.ts +31 -1
- package/dist/core/runner/announce-once-ledger.js +22 -0
- package/dist/core/runner/assemble-result.d.ts +9 -0
- package/dist/core/runner/assemble-result.js +3 -1
- package/dist/core/runner/call-hook-stations.d.ts +23 -27
- package/dist/core/runner/call-hook-stations.js +58 -42
- package/dist/core/runner/caller-stop-gate.d.ts +25 -0
- package/dist/core/runner/caller-stop-gate.js +7 -0
- package/dist/core/runner/compaction-seams.d.ts +8 -22
- package/dist/core/runner/compaction-seams.js +28 -53
- package/dist/core/runner/construction-doors.js +11 -1
- package/dist/core/runner/contracts.d.ts +86 -83
- package/dist/core/runner/credential-origin-seat.d.ts +2 -0
- package/dist/core/runner/credential-origin-seat.js +19 -0
- package/dist/core/runner/extra-body-dropped-seat.d.ts +2 -6
- package/dist/core/runner/gate-exit.d.ts +47 -36
- package/dist/core/runner/gate-exit.js +12 -5
- package/dist/core/runner/image.js +1 -2
- package/dist/core/runner/inline-image.js +1 -1
- package/dist/core/runner/mcp-redial.d.ts +52 -10
- package/dist/core/runner/mcp-redial.js +38 -9
- package/dist/core/runner/notice-seat-input.d.ts +11 -0
- package/dist/core/runner/notice-seat-input.js +1 -0
- package/dist/core/runner/permission-rule-lanes.d.ts +5 -2
- package/dist/core/runner/permission-rule-lanes.js +22 -10
- package/dist/core/runner/person-path-rows.d.ts +3 -1
- package/dist/core/runner/person-path-rows.js +3 -2
- package/dist/core/runner/prepare-acquire-reconcile.js +5 -1
- package/dist/core/runner/prepare-ask-lane.d.ts +5 -7
- package/dist/core/runner/prepare-ask-lane.js +6 -15
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -2
- package/dist/core/runner/prepare-caps-and-workflow.js +25 -8
- package/dist/core/runner/prepare-config-doors.d.ts +52 -1
- package/dist/core/runner/prepare-config-doors.js +168 -143
- package/dist/core/runner/prepare-defer-classify.js +7 -11
- package/dist/core/runner/prepare-delegation-surface.d.ts +2 -2
- package/dist/core/runner/prepare-delegation-surface.js +7 -5
- package/dist/core/runner/prepare-gate-stations.d.ts +8 -11
- package/dist/core/runner/prepare-gate-stations.js +11 -10
- package/dist/core/runner/prepare-hands-readface.d.ts +1 -1
- package/dist/core/runner/prepare-hands-readface.js +2 -1
- package/dist/core/runner/prepare-inherited-gate.d.ts +8 -12
- package/dist/core/runner/prepare-inherited-gate.js +10 -23
- package/dist/core/runner/prepare-listings.d.ts +1 -1
- package/dist/core/runner/prepare-listings.js +4 -2
- package/dist/core/runner/prepare-memory-engine-session.d.ts +0 -6
- package/dist/core/runner/prepare-memory-engine-session.js +20 -7
- package/dist/core/runner/prepare-memory.d.ts +3 -2
- package/dist/core/runner/prepare-memory.js +6 -2
- package/dist/core/runner/prepare-offload-wrappers.d.ts +4 -4
- package/dist/core/runner/prepare-offload-wrappers.js +2 -1
- package/dist/core/runner/prepare-park-ask.js +10 -14
- package/dist/core/runner/prepare-policy-chain.d.ts +17 -15
- package/dist/core/runner/prepare-policy-chain.js +104 -109
- package/dist/core/runner/prepare-project-context.d.ts +1 -1
- package/dist/core/runner/prepare-project-context.js +11 -12
- package/dist/core/runner/prepare-prompt-assembly.d.ts +45 -40
- package/dist/core/runner/prepare-prompt-assembly.js +138 -101
- package/dist/core/runner/prepare-prompt-inputs.d.ts +28 -23
- package/dist/core/runner/prepare-prompt-inputs.js +11 -10
- package/dist/core/runner/prepare-protocol-tools.d.ts +11 -7
- package/dist/core/runner/prepare-protocol-tools.js +20 -13
- package/dist/core/runner/prepare-question-face.d.ts +4 -2
- package/dist/core/runner/prepare-question-face.js +4 -3
- package/dist/core/runner/prepare-safety-scan.js +6 -10
- package/dist/core/runner/prepare-suspend-saga.d.ts +6 -0
- package/dist/core/runner/prepare-suspend-saga.js +7 -5
- package/dist/core/runner/prepare-task.js +41 -23
- package/dist/core/runner/prepare-turn-wiring.d.ts +13 -15
- package/dist/core/runner/prepare-turn-wiring.js +29 -27
- package/dist/core/runner/prepare-wiring-manifest.d.ts +13 -9
- package/dist/core/runner/prepare-wiring-manifest.js +14 -11
- package/dist/core/runner/resume-admission.d.ts +4 -1
- package/dist/core/runner/resume-admission.js +7 -5
- package/dist/core/runner/resume-apply.d.ts +5 -2
- package/dist/core/runner/resume-apply.js +24 -42
- package/dist/core/runner/resume-checkpoint-screen.d.ts +1 -0
- package/dist/core/runner/resume-checkpoint-screen.js +9 -1
- package/dist/core/runner/resume-internals-and-config.d.ts +3 -3
- package/dist/core/runner/resume-internals-and-config.js +3 -8
- package/dist/core/runner/resume-preflight.js +38 -16
- package/dist/core/runner/retired-runner-deps.d.ts +5 -6
- package/dist/core/runner/retired-runner-deps.js +4 -5
- package/dist/core/runner/run-brain-sinks.d.ts +3 -2
- package/dist/core/runner/run-brain-sinks.js +5 -1
- package/dist/core/runner/run-compaction-machinery.d.ts +7 -1
- package/dist/core/runner/run-compaction-machinery.js +7 -33
- package/dist/core/runner/run-harness-handlers.js +4 -2
- package/dist/core/runner/run-identity-wiring.d.ts +3 -1
- package/dist/core/runner/run-identity-wiring.js +3 -2
- package/dist/core/runner/run-leg.js +103 -95
- package/dist/core/runner/run-notification-lane.js +1 -0
- package/dist/core/runner/run-recovery-lanes.d.ts +3 -0
- package/dist/core/runner/run-recovery-lanes.js +14 -11
- package/dist/core/runner/run-settle-and-teardown.js +9 -28
- package/dist/core/runner/run-stop-and-final-verify.js +18 -25
- package/dist/core/runner/run-terminal-adoption.d.ts +3 -0
- package/dist/core/runner/run-terminal-adoption.js +34 -22
- package/dist/core/runner/run-tool-mount-facts.js +5 -3
- package/dist/core/runner/run-turn-boundary.js +32 -37
- package/dist/core/runner/runtask.d.ts +6 -7
- package/dist/core/runner/runtask.js +15 -73
- package/dist/core/runner/session-rule-policy.d.ts +5 -5
- package/dist/core/runner/session-rule-policy.js +13 -8
- package/dist/core/runner/side-call-account.d.ts +68 -0
- package/dist/core/runner/side-call-account.js +61 -0
- package/dist/core/runner/skills-seat.d.ts +15 -0
- package/dist/core/runner/skills-seat.js +57 -0
- package/dist/core/runner/stream-halt-verbs.js +12 -17
- package/dist/core/runner/stream-lifecycle-verbs.js +8 -5
- package/dist/core/runner/stream-steer-verb.d.ts +1 -1
- package/dist/core/runner/stream-steer-verb.js +20 -38
- package/dist/core/runner/sub-agent-deny-lists.d.ts +124 -23
- package/dist/core/runner/sub-agent-deny-lists.js +230 -71
- package/dist/core/runner/synthetic-tools.d.ts +5 -2
- package/dist/core/runner/synthetic-tools.js +2 -12
- package/dist/core/runner/tool-end-body.d.ts +5 -6
- package/dist/core/runner/tool-end-body.js +6 -4
- package/dist/core/runner/tool-not-executed.d.ts +15 -0
- package/dist/core/runner/tool-not-executed.js +30 -0
- package/dist/core/runner/tool-occurrence.d.ts +8 -7
- package/dist/core/runner/tool-occurrence.js +5 -5
- package/dist/core/runner/tool-result-media-seat.d.ts +1 -1
- package/dist/core/runner-deps.d.ts +43 -36
- package/dist/core/safety-merge-corpus.js +18 -2
- package/dist/core/secret-env.d.ts +88 -20
- package/dist/core/secret-env.js +192 -38
- package/dist/core/session-policy-store.d.ts +71 -16
- package/dist/core/session-policy-store.js +138 -28
- package/dist/core/session-reconcile.d.ts +4 -0
- package/dist/core/session-reconcile.js +2 -1
- package/dist/core/shell-read-silence.js +3 -32
- package/dist/core/side-query.d.ts +5 -3
- package/dist/core/skill-grant.d.ts +3 -2
- package/dist/core/skill-grant.js +17 -9
- package/dist/core/skills-directory.d.ts +31 -11
- package/dist/core/skills-directory.js +655 -104
- package/dist/core/store-contracts/mailbox-store-contract.js +13 -0
- package/dist/core/task-event.d.ts +49 -3
- package/dist/core/task-notification.js +2 -2
- package/dist/core/task-result.d.ts +8 -0
- package/dist/core/task-spec.d.ts +20 -19
- package/dist/core/task-stream.d.ts +14 -4
- package/dist/core/tighten-task-spec.d.ts +4 -3
- package/dist/core/tighten-task-spec.js +2 -4
- package/dist/core/tool-check-reading.d.ts +74 -0
- package/dist/core/tool-check-reading.js +80 -0
- package/dist/core/tool-policy.d.ts +62 -18
- package/dist/core/tool-policy.js +86 -15
- package/dist/core/tool-registry.d.ts +20 -0
- package/dist/core/tool-registry.js +4 -0
- package/dist/core/tool-spec.d.ts +10 -6
- package/dist/core/tools.js +2 -0
- package/dist/core/trace.d.ts +51 -32
- package/dist/core/types.d.ts +2 -2
- package/dist/core/types.js +1 -1
- package/dist/core/unc-spelling.d.ts +10 -0
- package/dist/core/unc-spelling.js +3 -0
- package/dist/core/untrusted-egress.d.ts +8 -0
- package/dist/core/untrusted-egress.js +4 -1
- package/dist/core/untrusted-text.d.ts +16 -0
- package/dist/core/untrusted-text.js +7 -2
- package/dist/core/user-attachment.d.ts +25 -4
- package/dist/core/user-attachment.js +63 -42
- package/dist/core/wiring-manifest.d.ts +18 -15
- package/dist/core/wiring-manifest.js +2 -2
- package/dist/engine/compaction/utils.js +1 -2
- package/dist/engine/execution-env/node-execution-env.d.ts +4 -3
- package/dist/engine/execution-env/symlink-chain.js +1 -1
- package/dist/engine/harness/agent-harness.d.ts +1 -1
- package/dist/engine/harness/agent-harness.js +5 -4
- package/dist/engine/harness/types.d.ts +20 -16
- package/dist/engine/harness/types.js +7 -1
- package/dist/engine/llm/types.d.ts +12 -7
- package/dist/engine/loop/agent-loop.d.ts +12 -1
- package/dist/engine/loop/agent-loop.js +18 -6
- package/dist/engine/loop/types.d.ts +8 -2
- package/dist/engine/lsp/node-lsp-manager.d.ts +2 -2
- package/dist/engine/session/import-validate.js +3 -10
- package/dist/engine/session/session.d.ts +4 -4
- package/dist/engine/session/session.js +4 -4
- package/dist/index.d.ts +33 -23
- package/dist/index.js +23 -15
- package/dist/internal/harness.d.ts +2 -1
- package/dist/internal/harness.js +2 -1
- package/dist/orchestration/goal.d.ts +24 -1
- package/dist/orchestration/goal.js +3 -2
- package/dist/orchestration/run-spec.d.ts +4 -6
- package/dist/orchestration/run-spec.js +39 -63
- package/dist/orchestration/run-workflow-tool.js +1 -2
- package/dist/orchestration/workflow.d.ts +11 -3
- package/dist/orchestration/workflow.js +11 -2
- package/dist/prompt-assembly/artifact-store.d.ts +72 -56
- package/dist/prompt-assembly/artifact-store.js +60 -52
- package/dist/prompt-assembly/artifact.d.ts +90 -76
- package/dist/prompt-assembly/artifact.js +197 -145
- package/dist/prompt-assembly/assemble.d.ts +36 -29
- package/dist/prompt-assembly/assemble.js +34 -220
- package/dist/prompt-assembly/bands.d.ts +20 -0
- package/dist/prompt-assembly/bands.js +18 -0
- package/dist/prompt-assembly/catalog/constitution.d.ts +23 -0
- package/dist/prompt-assembly/catalog/constitution.js +69 -0
- package/dist/prompt-assembly/catalog/core-behavior.d.ts +9 -0
- package/dist/prompt-assembly/catalog/core-behavior.js +85 -0
- package/dist/prompt-assembly/catalog/index.d.ts +11 -0
- package/dist/prompt-assembly/catalog/index.js +60 -0
- package/dist/prompt-assembly/catalog/memory.d.ts +13 -0
- package/dist/prompt-assembly/catalog/memory.js +6 -0
- package/dist/prompt-assembly/catalog/modes.d.ts +15 -0
- package/dist/prompt-assembly/catalog/modes.js +137 -0
- package/dist/prompt-assembly/catalog/role.d.ts +10 -0
- package/dist/prompt-assembly/catalog/role.js +157 -0
- package/dist/prompt-assembly/catalog/schema.d.ts +138 -0
- package/dist/prompt-assembly/catalog/schema.js +25 -0
- package/dist/prompt-assembly/catalog/sections.d.ts +9 -0
- package/dist/prompt-assembly/catalog/sections.js +98 -0
- package/dist/prompt-assembly/catalog/team.d.ts +4 -0
- package/dist/prompt-assembly/catalog/team.js +258 -0
- package/dist/prompt-assembly/composer.d.ts +26 -28
- package/dist/prompt-assembly/composer.js +124 -46
- package/dist/prompt-assembly/epoch.d.ts +89 -79
- package/dist/prompt-assembly/epoch.js +115 -142
- package/dist/prompt-assembly/explain.d.ts +58 -34
- package/dist/prompt-assembly/explain.js +21 -24
- package/dist/prompt-assembly/overlay.d.ts +137 -0
- package/dist/prompt-assembly/overlay.js +339 -0
- package/dist/prompt-assembly/renderers.d.ts +21 -0
- package/dist/prompt-assembly/renderers.js +39 -0
- package/dist/prompt-assembly/section-usage.d.ts +3 -3
- package/dist/prompt-assembly/section-usage.js +1 -1
- package/dist/prompt-assembly/select.d.ts +71 -0
- package/dist/prompt-assembly/select.js +106 -0
- package/dist/prompt-assembly/sugar.d.ts +31 -0
- package/dist/prompt-assembly/sugar.js +20 -0
- package/dist/prompt-assembly/turn-snapshot.d.ts +3 -2
- package/dist/prompt-assembly/types.d.ts +45 -148
- package/dist/prompts/coordinator.d.ts +2 -21
- package/dist/prompts/coordinator.js +3 -255
- package/dist/prompts/cowork.d.ts +27 -16
- package/dist/prompts/cowork.js +2 -23
- package/dist/prompts/default.d.ts +38 -511
- package/dist/prompts/default.js +20 -288
- package/dist/prompts/supervisor.d.ts +6 -71
- package/dist/prompts/supervisor.js +6 -117
- package/dist/stores/file/permission-rule-store.d.ts +1 -1
- package/dist/stores/file/permission-rule-store.js +2 -1
- package/dist/tools/artifact/artifact-tool.js +4 -3
- package/dist/tools/fs/bash-readonly-classifier.d.ts +6 -5
- package/dist/tools/fs/dir-entries.d.ts +4 -2
- package/dist/tools/fs/dir-entries.js +16 -4
- package/dist/tools/fs/fs-bash.d.ts +1 -1
- package/dist/tools/fs/fs-bash.js +22 -11
- package/dist/tools/fs/fs-pdf.js +17 -13
- package/dist/tools/fs/fs-read.js +4 -3
- package/dist/tools/fs/fs-shared.d.ts +1 -10
- package/dist/tools/fs/fs-shared.js +3 -4
- package/dist/tools/fs/fs-write.js +2 -1
- package/dist/tools/fs/notebook.js +1 -1
- package/dist/tools/fs/pdf.d.ts +20 -10
- package/dist/tools/fs/pdf.js +19 -10
- package/dist/tools/fs/program-read-model.d.ts +68 -8
- package/dist/tools/fs/program-read-model.js +112 -33
- package/dist/tools/fs/program-read-model.rows.js +30 -10
- package/dist/tools/fs/read-deny-home.d.ts +25 -9
- package/dist/tools/fs/read-deny-home.js +28 -27
- package/dist/tools/fs/read-deny.d.ts +41 -11
- package/dist/tools/fs/read-deny.js +51 -5
- package/dist/tools/fs/safety.d.ts +4 -26
- package/dist/tools/fs/safety.js +10 -32
- package/dist/tools/fs/search.js +15 -10
- package/dist/tools/fs/shell-read-argv.d.ts +3 -2
- package/dist/tools/fs/shell-read-argv.js +118 -38
- package/dist/tools/fs/shell-read-establish.d.ts +5 -5
- package/dist/tools/fs/shell-read-establish.js +11 -61
- package/dist/tools/fs/shell-read-identity.js +6 -3
- package/dist/tools/fs/shell-read-judge.d.ts +13 -15
- package/dist/tools/fs/shell-read-judge.js +18 -4
- package/dist/tools/fs/shell-read-plan.d.ts +2 -2
- package/dist/tools/web.js +1 -1
- package/package.json +13 -1
- package/test/export-surface.snapshot.json +306 -103
- package/wire-changes/core@7.52.0.json +5859 -0
- package/wire-changes/core@7.53.0.json +1946 -0
- package/dist/core/hook-seats.d.ts +0 -66
- package/dist/core/hook-seats.js +0 -37
- package/dist/prompt-assembly/packs/sema-default.d.ts +0 -2
- package/dist/prompt-assembly/packs/sema-default.js +0 -147
- package/dist/prompts/simple-sections.d.ts +0 -58
- package/dist/prompts/simple-sections.js +0 -43
package/dist/core/hooks.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { createSettlementLedger, engineFailClosedExit, hookDenyExit } from "./runner/gate-exit.js";
|
|
4
|
-
import {
|
|
1
|
+
import { argsAsTheToolReads, stampArgsReading } from "./effective-path-target.js";
|
|
2
|
+
import { abortedSeatDeny, decisionText, describeThrown, isEngineRefusal, ownArgs, ownedReading, refuseOutOfContractDecision, unaskedSeatAnswer } from "./tool-policy.js";
|
|
3
|
+
import { createSettlementLedger, engineFailClosedExit, hookDenyExit, unownedArgsExit } from "./runner/gate-exit.js";
|
|
4
|
+
import { classicEventBase, dispatchClassic, ENGINE_CORE_ANSWER, engineCore, failedHandlerClause, judgedInputOf, observePermissionDenied, recordScreeningChain } from "./mods/stations.js";
|
|
5
5
|
import { runGateFold } from "./gate-fold.js";
|
|
6
6
|
import { runGateLanes } from "./gate-lanes.js";
|
|
7
7
|
export { normalizeOrgGateVerdict, normalizePersistedRuleHit } from "./rule-lane-reads.js";
|
|
8
|
-
export { cloneObserverInput } from "./runner/gate-exit.js";
|
|
9
8
|
import { brandPolicyAskClass } from "./ask-class.js";
|
|
10
9
|
import { isAskOrigin, screenAskClassMembers } from "./ask-origin.js";
|
|
11
10
|
import { isAutoModeFallbackCause } from "./auto-mode.js";
|
|
@@ -13,92 +12,6 @@ import { inlineUntrusted } from "./untrusted-text.js";
|
|
|
13
12
|
export { formatHookFeedback } from "./reminder-mint.js";
|
|
14
13
|
import { createSafeNotifier } from "./safe-notify.js";
|
|
15
14
|
import { wireOf } from "./tool-name-readings.js";
|
|
16
|
-
export const DEFAULT_HOOK_TIMEOUT_MS = 600_000;
|
|
17
|
-
export const MAX_HOOK_TIMEOUT_MS = 2_147_483_647;
|
|
18
|
-
const POST_ABORT_GRACE_MS = 1_000;
|
|
19
|
-
export function postAbortGraceMs(remainingMs) {
|
|
20
|
-
return Math.max(0, Math.min(POST_ABORT_GRACE_MS, remainingMs));
|
|
21
|
-
}
|
|
22
|
-
const badHookTimeoutReported = new WeakSet();
|
|
23
|
-
export function resolveHookTimeoutMs(supplied, report, owner) {
|
|
24
|
-
if (supplied === undefined)
|
|
25
|
-
return DEFAULT_HOOK_TIMEOUT_MS;
|
|
26
|
-
if (Number.isFinite(supplied) && supplied >= 0 && supplied <= MAX_HOOK_TIMEOUT_MS)
|
|
27
|
-
return supplied;
|
|
28
|
-
if (report !== undefined && !(owner !== undefined && badHookTimeoutReported.has(owner))) {
|
|
29
|
-
if (owner !== undefined)
|
|
30
|
-
badHookTimeoutReported.add(owner);
|
|
31
|
-
try {
|
|
32
|
-
report(new Error(`Hooks.timeoutMs must be a non-negative finite number no greater than ${MAX_HOOK_TIMEOUT_MS} (got ${String(supplied)}) — ` +
|
|
33
|
-
`every hook seat falls back to the ${DEFAULT_HOOK_TIMEOUT_MS}ms default`));
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return DEFAULT_HOOK_TIMEOUT_MS;
|
|
39
|
-
}
|
|
40
|
-
export async function runHookSeat(seat, bound, call) {
|
|
41
|
-
void seat;
|
|
42
|
-
const timeoutMs = resolveHookTimeoutMs(bound.timeoutMs, bound.onBadTimeout, bound.owner);
|
|
43
|
-
const taskSignal = bound.signal;
|
|
44
|
-
const controller = new AbortController();
|
|
45
|
-
const pending = Promise.resolve(call(controller.signal));
|
|
46
|
-
const startedAt = performance.now();
|
|
47
|
-
return await new Promise((resolve, reject) => {
|
|
48
|
-
let settled = false;
|
|
49
|
-
let listening = false;
|
|
50
|
-
let timer;
|
|
51
|
-
const clearTimer = () => {
|
|
52
|
-
if (timer !== undefined)
|
|
53
|
-
clearTimeout(timer);
|
|
54
|
-
timer = undefined;
|
|
55
|
-
};
|
|
56
|
-
const finish = (act) => {
|
|
57
|
-
if (settled)
|
|
58
|
-
return;
|
|
59
|
-
settled = true;
|
|
60
|
-
clearTimer();
|
|
61
|
-
if (listening)
|
|
62
|
-
taskSignal?.removeEventListener("abort", onAbort);
|
|
63
|
-
act();
|
|
64
|
-
};
|
|
65
|
-
const expire = (cause) => finish(() => {
|
|
66
|
-
void pending.then(undefined, () => {
|
|
67
|
-
});
|
|
68
|
-
resolve({ expired: true, cause });
|
|
69
|
-
queueMicrotask(() => {
|
|
70
|
-
try {
|
|
71
|
-
controller.abort();
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
const collapseToGrace = () => {
|
|
78
|
-
if (settled)
|
|
79
|
-
return;
|
|
80
|
-
clearTimer();
|
|
81
|
-
timer = setTimeout(() => expire("aborted"), postAbortGraceMs(timeoutMs - (performance.now() - startedAt)));
|
|
82
|
-
};
|
|
83
|
-
const onAbort = () => (bound.abortEnds === true ? expire("aborted") : collapseToGrace());
|
|
84
|
-
timer = setTimeout(() => expire("timeout"), timeoutMs);
|
|
85
|
-
if (taskSignal !== undefined) {
|
|
86
|
-
if (taskSignal.aborted) {
|
|
87
|
-
onAbort();
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
taskSignal.addEventListener("abort", onAbort, { once: true });
|
|
91
|
-
listening = true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
pending.then((value) => finish(() => resolve({ expired: false, value })), (err) => finish(() => reject(asThrownError(err))));
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
export function hookSeatExpiredError(seat, timeoutMs, cause, consequence) {
|
|
98
|
-
return new Error(cause === "timeout"
|
|
99
|
-
? `the deployment's ${seat} hook did not answer within its ${timeoutMs}ms bound (Hooks.timeoutMs) — ${consequence}`
|
|
100
|
-
: `the deployment's ${seat} hook had not answered when the task was cancelled — ${consequence}`);
|
|
101
|
-
}
|
|
102
15
|
const reflectApply = Reflect.apply;
|
|
103
16
|
const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
104
17
|
const getPrototypeOf = Object.getPrototypeOf;
|
|
@@ -174,54 +87,92 @@ export function mintHookInvocationIdentity(facts) {
|
|
|
174
87
|
...(facts.parentToolCallId !== undefined ? { parentToolCallId: facts.parentToolCallId } : {}),
|
|
175
88
|
}));
|
|
176
89
|
}
|
|
177
|
-
function
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
`same hook and fails the same way. Hook error: ${cause || "(no message)"}`);
|
|
90
|
+
function screenPreToolUseResult(r) {
|
|
91
|
+
if (r === undefined || r === null || r === false)
|
|
92
|
+
return r;
|
|
93
|
+
return refuseOutOfContractDecision(r, { reasonIsNonInput: true });
|
|
182
94
|
}
|
|
183
|
-
function
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
: `the task was cancelled while a PreToolUse hook was still screening ${subject}; the call was NOT executed ` +
|
|
189
|
-
`(fail-closed). No verdict was reached — this is the run ending, not the tool failing.`;
|
|
95
|
+
function preToolUseAnswerViolation(answer) {
|
|
96
|
+
const r = screenPreToolUseResult(answer);
|
|
97
|
+
if (r === undefined || r === null || r === false || !isEngineRefusal(r))
|
|
98
|
+
return undefined;
|
|
99
|
+
return typeof r.message === "string" ? r.message : "the PreToolUse answer was refused by the engine";
|
|
190
100
|
}
|
|
191
|
-
function
|
|
192
|
-
if (
|
|
101
|
+
function preToolUseRefusedReason(subject, failed) {
|
|
102
|
+
if (failed === undefined) {
|
|
103
|
+
return `the task was cancelled while a PreToolUse hook was still screening ${subject}; the call was NOT executed ` + `(fail-closed). No verdict was reached — this is the run ending, not the tool failing.`;
|
|
104
|
+
}
|
|
105
|
+
const tail = failed.cause === "threw"
|
|
106
|
+
? ` This is a failure of the deployment's hook, NOT of the tool itself — an identical retry reaches the same hook and fails the same way.`
|
|
107
|
+
: failed.cause === "timeout"
|
|
108
|
+
? ` This is a failure of the deployment's hook, NOT of the tool itself — the screening face never returned a verdict, so nothing was decided about this call either way.`
|
|
109
|
+
: "";
|
|
110
|
+
return `a PreToolUse hook ${failedHandlerClause(failed)} while screening ${subject}; the call was NOT executed (fail-closed).${tail}`;
|
|
111
|
+
}
|
|
112
|
+
export function createPreToolUseScreening(input) {
|
|
113
|
+
const bus = input.modBus;
|
|
114
|
+
if (bus === undefined || !bus.hasHandlers("classic.PreToolUse"))
|
|
193
115
|
return undefined;
|
|
194
|
-
|
|
116
|
+
const { toolCallId, toolName } = input.event;
|
|
117
|
+
const screenedName = wireOf("gate.preToolUse", input.event);
|
|
118
|
+
const eventOf = (args) => {
|
|
119
|
+
const cwd = input.trackedCwd?.();
|
|
120
|
+
return {
|
|
121
|
+
...classicEventBase(input.identity, input.observedPermissionMode?.()),
|
|
122
|
+
tool: screenedName,
|
|
123
|
+
tool_use_id: toolCallId,
|
|
124
|
+
input: judgedInputOf(args),
|
|
125
|
+
...(typeof cwd === "string" ? { cwd } : {}),
|
|
126
|
+
...(input.hookEnv !== undefined ? { env: input.hookEnv } : {}),
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
return {
|
|
130
|
+
screen: async (args, subject) => {
|
|
131
|
+
let outcome;
|
|
132
|
+
try {
|
|
133
|
+
outcome = await dispatchClassic(bus, "classic.PreToolUse", eventOf(args), { ...(input.abortSignal !== undefined ? { signal: input.abortSignal } : {}), checkAnswer: preToolUseAnswerViolation });
|
|
134
|
+
}
|
|
135
|
+
catch (err) {
|
|
136
|
+
return { kind: "refused", reason: preToolUseRefusedReason(subject, { kind: "failed", registration: "engine", cause: "threw", reason: `could not raise the screening: ${describeThrown(err)}`, skipped: [] }) };
|
|
137
|
+
}
|
|
138
|
+
if (outcome === undefined || outcome.kind === "aborted")
|
|
139
|
+
return { kind: "refused", reason: preToolUseRefusedReason(subject, undefined) };
|
|
140
|
+
if (outcome.kind === "failed")
|
|
141
|
+
return { kind: "refused", reason: preToolUseRefusedReason(subject, outcome) };
|
|
142
|
+
const r = screenPreToolUseResult(outcome.answer);
|
|
143
|
+
return { kind: "answered", answer: r === null || r === false ? undefined : r, ...(outcome.answeredBy !== undefined ? { answeredBy: outcome.answeredBy } : {}) };
|
|
144
|
+
},
|
|
145
|
+
deniedReason: (answer) => decisionText(answer) ?? `tool "${toolName}" blocked by a PreToolUse hook`,
|
|
146
|
+
};
|
|
195
147
|
}
|
|
196
|
-
export function createPreToolUseConstraintPolicy(
|
|
197
|
-
|
|
148
|
+
export function createPreToolUseConstraintPolicy(chain, env) {
|
|
149
|
+
const judges = (p) => !p.observe;
|
|
150
|
+
const minted = brandPolicyAskClass({
|
|
198
151
|
check: async (req, signal) => {
|
|
152
|
+
if (!chain.hasHandlers("classic.PreToolUse", judges))
|
|
153
|
+
return { action: "allow" };
|
|
199
154
|
const unasked = unaskedSeatAnswer(req, signal, { aborted: `the inherited PreToolUse screening of "${req.toolName}" was not consulted: the run or turn was already interrupted`, unreachable: `the inherited PreToolUse screening of "${req.toolName}" was not consulted: nobody can be asked about this call` }, "hook");
|
|
200
155
|
if (unasked !== undefined)
|
|
201
156
|
return unasked;
|
|
202
|
-
|
|
203
|
-
|
|
157
|
+
const subject = `this call to "${req.toolName}"`;
|
|
158
|
+
let outcome;
|
|
204
159
|
try {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
return { action: "deny", message: preToolUseUnansweredReason(`this call to "${req.toolName}"`, boundMs, seat.cause), decisionReason: "hook" };
|
|
213
|
-
}
|
|
214
|
-
r = screenPreToolUseResult(seat.value);
|
|
160
|
+
outcome = await chain.dispatch("classic.PreToolUse", { tool: req.toolName, tool_use_id: req.toolCallId, input: judgedInputOf(req.args), ...(env !== undefined ? { env } : {}) }, {
|
|
161
|
+
bottom: engineCore,
|
|
162
|
+
participant: judges,
|
|
163
|
+
...(signal !== undefined ? { signal } : {}),
|
|
164
|
+
checkAnswer: (a) => (a === ENGINE_CORE_ANSWER ? undefined : preToolUseAnswerViolation(a)),
|
|
165
|
+
});
|
|
215
166
|
}
|
|
216
167
|
catch (err) {
|
|
217
|
-
|
|
218
|
-
onCrash?.(err);
|
|
219
|
-
}
|
|
220
|
-
catch {
|
|
221
|
-
}
|
|
222
|
-
return { action: "deny", message: preToolUseCrashReason(`this call to "${req.toolName}"`, err), decisionReason: "hook" };
|
|
168
|
+
return { action: "deny", message: preToolUseRefusedReason(subject, { kind: "failed", registration: "engine", cause: "threw", reason: `could not raise the screening: ${describeThrown(err)}`, skipped: [] }), decisionReason: "hook" };
|
|
223
169
|
}
|
|
224
|
-
if (
|
|
170
|
+
if (outcome.kind === "aborted")
|
|
171
|
+
return abortedSeatDeny(req, `the inherited PreToolUse screening of "${req.toolName}" ended when the run or turn was interrupted`, "hook");
|
|
172
|
+
if (outcome.kind === "failed")
|
|
173
|
+
return { action: "deny", message: preToolUseRefusedReason(subject, outcome), decisionReason: "hook" };
|
|
174
|
+
const r = screenPreToolUseResult(outcome.answer);
|
|
175
|
+
if (r === undefined || r === null || r === false)
|
|
225
176
|
return { action: "allow" };
|
|
226
177
|
if (r.action === "deny") {
|
|
227
178
|
return { action: "deny", message: decisionText(r) ?? `tool "${req.toolName}" blocked by a PreToolUse hook`, decisionReason: "hook" };
|
|
@@ -239,6 +190,8 @@ export function createPreToolUseConstraintPolicy(preToolUse, env, onCrash, timeo
|
|
|
239
190
|
return r.updatedInput !== undefined ? { action: "allow", updatedInput: r.updatedInput, ...stated } : { action: "allow", ...stated };
|
|
240
191
|
},
|
|
241
192
|
}, "hook");
|
|
193
|
+
recordScreeningChain(minted, chain);
|
|
194
|
+
return minted;
|
|
242
195
|
}
|
|
243
196
|
export function askCarryRowMembers(carry) {
|
|
244
197
|
if (carry === undefined)
|
|
@@ -253,54 +206,21 @@ export function askCarryRowMembers(carry) {
|
|
|
253
206
|
...(classed !== undefined ? classed : {}),
|
|
254
207
|
};
|
|
255
208
|
}
|
|
256
|
-
export function createPreToolUseScreening(preToolUse, input, hookSeatMs, notifier) {
|
|
257
|
-
if (preToolUse === undefined)
|
|
258
|
-
return undefined;
|
|
259
|
-
const { toolCallId, toolName } = input.event;
|
|
260
|
-
const screenedName = wireOf("gate.preToolUse", input.event);
|
|
261
|
-
const hookCtx = (seatSignal) => ({
|
|
262
|
-
toolCallId,
|
|
263
|
-
toolName: screenedName,
|
|
264
|
-
...(seatSignal !== undefined ? { signal: seatSignal } : {}),
|
|
265
|
-
...(() => {
|
|
266
|
-
const c = input.trackedCwd?.();
|
|
267
|
-
return typeof c === "string" ? { cwd: c } : {};
|
|
268
|
-
})(),
|
|
269
|
-
...(input.hookEnv !== undefined ? { env: input.hookEnv } : {}),
|
|
270
|
-
...(input.identity !== undefined ? { identity: input.identity } : {}),
|
|
271
|
-
});
|
|
272
|
-
const bound = { timeoutMs: hookSeatMs, ...(input.abortSignal !== undefined ? { signal: input.abortSignal } : {}), abortEnds: true };
|
|
273
|
-
return {
|
|
274
|
-
screen: (args) => runHookSeat("preToolUse", bound, (sig) => preToolUse(screenedName, args, hookCtx(sig))),
|
|
275
|
-
screened: screenPreToolUseResult,
|
|
276
|
-
crashReason: preToolUseCrashReason,
|
|
277
|
-
unansweredReason: async (subject, cause) => {
|
|
278
|
-
if (cause === "timeout")
|
|
279
|
-
traceHookCrash(input, hookSeatExpiredError("preToolUse", hookSeatMs, cause, `${subject} was NOT executed (fail-closed) and the screening face was signalled to stop`), notifier);
|
|
280
|
-
return preToolUseUnansweredReason(subject, hookSeatMs, cause);
|
|
281
|
-
},
|
|
282
|
-
deniedReason: (answer) => decisionText(answer) ?? `tool "${toolName}" blocked by a PreToolUse hook`,
|
|
283
|
-
refusedReason: (answer) => String(answer.message ?? `the PreToolUse hook's result for "${toolName}" was refused by the engine`),
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
209
|
export async function runToolGate(input) {
|
|
287
|
-
const { event,
|
|
210
|
+
const { event, adjudicate, resolveAsk, suspendAsk } = input;
|
|
288
211
|
const { toolCallId, toolName } = event;
|
|
289
212
|
const callSignal = input.callSignal;
|
|
290
213
|
const modelInput = event.input;
|
|
214
|
+
const owned = ownArgs(modelInput);
|
|
215
|
+
const args = owned.ok ? owned.value : modelInput;
|
|
291
216
|
const notifier = createSafeNotifier(input.onNotifyError !== undefined ? { onError: input.onNotifyError } : undefined);
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
await notifier.notifyAsync(async () => {
|
|
298
|
-
const seat = await runHookSeat("permissionDenied", observerBound, (sig) => input.permissionDenied?.({ ...payload, signal: sig }));
|
|
299
|
-
if (seat.expired)
|
|
300
|
-
throw hookSeatExpiredError("permissionDenied", hookSeatMs, seat.cause, "the deny observation was abandoned; the deny itself is unchanged");
|
|
301
|
-
}, "toolGate.permissionDenied");
|
|
217
|
+
const notifyPermissionDeniedSeat = (payload) => {
|
|
218
|
+
const mode = input.observedPermissionMode?.();
|
|
219
|
+
const seen = mode !== undefined ? { ...payload, permissionMode: mode } : payload;
|
|
220
|
+
const onHostObserverFailure = (err) => void notifier.notify(() => { throw err; }, "toolGate.permissionDenied");
|
|
221
|
+
return observePermissionDenied({ legBus: input.modBus, hostObserver: input.permissionDenied, payload: seen, signal: input.abortSignal, onHostObserverFailure });
|
|
302
222
|
};
|
|
303
|
-
const screening = createPreToolUseScreening(
|
|
223
|
+
const screening = createPreToolUseScreening(input);
|
|
304
224
|
const pass = {
|
|
305
225
|
input,
|
|
306
226
|
event,
|
|
@@ -315,8 +235,9 @@ export async function runToolGate(input) {
|
|
|
315
235
|
notifyPermissionDenied: notifyPermissionDeniedSeat,
|
|
316
236
|
screening,
|
|
317
237
|
afterFold: runGateLanes,
|
|
318
|
-
currentInput:
|
|
319
|
-
req: { toolName, args
|
|
238
|
+
currentInput: args,
|
|
239
|
+
req: Object.freeze({ toolName, args, toolCallId, ...(() => { const f = input.toolFaceOf?.(toolName); const read = event.readArguments; if (f !== undefined && read !== undefined)
|
|
240
|
+
stampArgsReading(f, ownedReading(read)); return f !== undefined ? { face: f } : {}; })() }),
|
|
320
241
|
preToolContext: [],
|
|
321
242
|
hookAsk: undefined,
|
|
322
243
|
parkFailed: undefined,
|
|
@@ -326,29 +247,15 @@ export async function runToolGate(input) {
|
|
|
326
247
|
tightenedBy: undefined,
|
|
327
248
|
policyRewrite: undefined,
|
|
328
249
|
};
|
|
250
|
+
if (!owned.ok)
|
|
251
|
+
return await unownedArgsExit(pass, owned.reason);
|
|
329
252
|
if (screening !== undefined) {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
const seat = await screening.screen(pass.currentInput);
|
|
334
|
-
if (seat.expired)
|
|
335
|
-
unanswered = seat.cause;
|
|
336
|
-
else
|
|
337
|
-
r = screening.screened(seat.value);
|
|
338
|
-
}
|
|
339
|
-
catch (err) {
|
|
340
|
-
const reason = screening.crashReason(`this call to "${toolName}"`, err);
|
|
341
|
-
traceHookCrash(input, err, notifier);
|
|
342
|
-
return await engineFailClosedExit(pass, reason);
|
|
343
|
-
}
|
|
344
|
-
if (unanswered !== undefined) {
|
|
345
|
-
const reason = await screening.unansweredReason(`this call to "${toolName}"`, unanswered);
|
|
346
|
-
return await engineFailClosedExit(pass, reason);
|
|
253
|
+
const screened = await screening.screen(pass.currentInput, `this call to "${toolName}"`);
|
|
254
|
+
if (screened.kind === "refused") {
|
|
255
|
+
return await engineFailClosedExit(pass, screened.reason);
|
|
347
256
|
}
|
|
257
|
+
const r = screened.answer;
|
|
348
258
|
if (r) {
|
|
349
|
-
if (isEngineRefusal(r)) {
|
|
350
|
-
return await engineFailClosedExit(pass, screening.refusedReason(r));
|
|
351
|
-
}
|
|
352
259
|
if (r.additionalContext) {
|
|
353
260
|
pass.preToolContext.push(r.additionalContext);
|
|
354
261
|
}
|
|
@@ -356,13 +263,13 @@ export async function runToolGate(input) {
|
|
|
356
263
|
return hookDenyExit(pass, screening.deniedReason(r));
|
|
357
264
|
}
|
|
358
265
|
if (r.updatedInput !== undefined) {
|
|
359
|
-
pass.currentInput = r.updatedInput;
|
|
266
|
+
pass.currentInput = argsAsTheToolReads(pass.req, r.updatedInput);
|
|
360
267
|
}
|
|
361
268
|
if (r.action === "ask") {
|
|
362
269
|
pass.hookAsk = r;
|
|
363
270
|
}
|
|
364
271
|
if (r.action === "allow")
|
|
365
|
-
pass.
|
|
272
|
+
pass.hookAllowedBy = screened.answeredBy !== undefined ? [screened.answeredBy] : [];
|
|
366
273
|
}
|
|
367
274
|
}
|
|
368
275
|
return await runGateFold(pass);
|
|
@@ -24,9 +24,27 @@
|
|
|
24
24
|
* before the frame and the transcript read them. A block whose bytes the admission refuses becomes a text
|
|
25
25
|
* block that names the tool, the refusal and the size — never the bytes, and never silently nothing.
|
|
26
26
|
*/
|
|
27
|
-
import type { DocumentContent, ImageContent } from "
|
|
28
|
-
import { type ImageDimensions, type ImageDownsampler } from "
|
|
29
|
-
import { type MediaBlock } from "
|
|
27
|
+
import type { DocumentContent, ImageContent } from "../internal/llm.js";
|
|
28
|
+
import { type ImageDimensions, type ImageDownsampler } from "./image-downsample.js";
|
|
29
|
+
import { type MediaBlock } from "./media-byte-cap.js";
|
|
30
|
+
/** Byte cap on a Read-image WITHOUT a downsampler: an image file is returned AS a visual
|
|
31
|
+
* `ImageContent` block (base64) rather than refused. Bounded so a huge image cannot blow the request.
|
|
32
|
+
* This stat-time cap only bounds the READ; the accept/refuse decision is the base64 gate below (the
|
|
33
|
+
* provider limit is on base64 LENGTH, so the effective no-sharp accept bound is raw ≤ 3.75MB). */
|
|
34
|
+
export declare const MAX_IMAGE_READ_BYTES: number;
|
|
35
|
+
/** Byte cap on a Read-image WITH a downsampler: sharp can shrink a big photo to CC's 2000×2000/3.75MB
|
|
36
|
+
* target, so the smaller hard refusal does not apply (CC readImageWithTokenBudget reads the file
|
|
37
|
+
* unbounded; we keep an OOM sanity bound — deliberate delta, camera photos fit comfortably). */
|
|
38
|
+
export declare const MAX_IMAGE_DOWNSAMPLE_INPUT_BYTES: number;
|
|
39
|
+
/** Max raw size sent whole as a document block (CC `PDF_TARGET_RAW_SIZE`). */
|
|
40
|
+
export declare const PDF_TARGET_RAW_SIZE: number;
|
|
41
|
+
/** Verify the raw bytes actually ARE the image format the extension claims (magic-number sniff). Extension alone
|
|
42
|
+
* is forgeable: a `.png` holding text / an empty file / a truncated blob would otherwise become a malformed
|
|
43
|
+
* `ImageContent` that makes the NEXT provider request fail (400). Pure — no I/O. */
|
|
44
|
+
export declare function imageMagicMatches(bytes: Uint8Array, mimeType: string): boolean;
|
|
45
|
+
/** True when the bytes start with the `%PDF-` magic. Magic outranks extension both ways: a mis-named
|
|
46
|
+
* `.pdf` without it is refused, and a non-`.pdf` file carrying it is read AS a PDF. */
|
|
47
|
+
export declare function pdfMagicMatches(bytes: Uint8Array): boolean;
|
|
30
48
|
/** The image types the content API accepts — the only ones a signature check can verify. */
|
|
31
49
|
export declare const ADMITTED_IMAGE_MIME_TYPES: readonly ["image/png", "image/jpeg", "image/gif", "image/webp"];
|
|
32
50
|
/** The raw-byte read cap for an image, with or without a downsampler. */
|
|
@@ -1,9 +1,27 @@
|
|
|
1
|
-
import { MCP_IMAGE_MAX_BASE64 } from "
|
|
2
|
-
import { claimedMediaType } from "
|
|
3
|
-
import { readMember } from "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { MCP_IMAGE_MAX_BASE64 } from "./image-downsample.js";
|
|
2
|
+
import { claimedMediaType } from "./media-byte-cap.js";
|
|
3
|
+
import { readMember } from "./thrown-value.js";
|
|
4
|
+
export const MAX_IMAGE_READ_BYTES = 5 * 1024 * 1024;
|
|
5
|
+
export const MAX_IMAGE_DOWNSAMPLE_INPUT_BYTES = 64 * 1024 * 1024;
|
|
6
|
+
export const PDF_TARGET_RAW_SIZE = 20 * 1024 * 1024;
|
|
7
|
+
export function imageMagicMatches(bytes, mimeType) {
|
|
8
|
+
const b = bytes;
|
|
9
|
+
switch (mimeType) {
|
|
10
|
+
case "image/png":
|
|
11
|
+
return b.length >= 8 && b[0] === 0x89 && b[1] === 0x50 && b[2] === 0x4e && b[3] === 0x47 && b[4] === 0x0d && b[5] === 0x0a && b[6] === 0x1a && b[7] === 0x0a;
|
|
12
|
+
case "image/jpeg":
|
|
13
|
+
return b.length >= 3 && b[0] === 0xff && b[1] === 0xd8 && b[2] === 0xff;
|
|
14
|
+
case "image/gif":
|
|
15
|
+
return b.length >= 6 && b[0] === 0x47 && b[1] === 0x49 && b[2] === 0x46 && b[3] === 0x38 && (b[4] === 0x37 || b[4] === 0x39) && b[5] === 0x61;
|
|
16
|
+
case "image/webp":
|
|
17
|
+
return b.length >= 12 && b[0] === 0x52 && b[1] === 0x49 && b[2] === 0x46 && b[3] === 0x46 && b[8] === 0x57 && b[9] === 0x45 && b[10] === 0x42 && b[11] === 0x50;
|
|
18
|
+
default:
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function pdfMagicMatches(bytes) {
|
|
23
|
+
return bytes.length >= 5 && bytes[0] === 0x25 && bytes[1] === 0x50 && bytes[2] === 0x44 && bytes[3] === 0x46 && bytes[4] === 0x2d;
|
|
24
|
+
}
|
|
7
25
|
export const ADMITTED_IMAGE_MIME_TYPES = Object.freeze(["image/png", "image/jpeg", "image/gif", "image/webp"]);
|
|
8
26
|
export function imageReadCap(downsampler) {
|
|
9
27
|
return downsampler ? MAX_IMAGE_DOWNSAMPLE_INPUT_BYTES : MAX_IMAGE_READ_BYTES;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { McpServerSpec, RunnerDeps, TaskSpec } from "./types.js";
|
|
1
|
+
import type { A2aServerSpec, McpServerSpec, RunnerDeps, TaskSpec } from "./types.js";
|
|
2
|
+
import { type ToolAxesSurface } from "./mcp-server-spec.js";
|
|
2
3
|
import type { ToolPolicy } from "./tool-policy.js";
|
|
3
4
|
/** The closed set of administratively lockable configuration keys. Adding a member is a deliberate
|
|
4
5
|
* edit HERE (tsc forces the registry row), never a free-form string. */
|
|
@@ -34,7 +35,7 @@ export interface LockedConfig {
|
|
|
34
35
|
keys: readonly LockedKey[];
|
|
35
36
|
}
|
|
36
37
|
/** The preflight's resolved snapshot — the ONLY thing downstream task assembly reads for the
|
|
37
|
-
* guarded slots (never the raw `spec.mcp` / `spec.toolPolicy` fields). */
|
|
38
|
+
* guarded slots (never the raw `spec.mcp` / `spec.a2a` / `spec.toolPolicy` fields). */
|
|
38
39
|
export interface LockedPreflight {
|
|
39
40
|
/** The validated lock set (empty when the deployment declares none). */
|
|
40
41
|
lockedKeys: ReadonlySet<LockedKey>;
|
|
@@ -45,6 +46,10 @@ export interface LockedPreflight {
|
|
|
45
46
|
* `undefined` (core has no deployment-level MCP seat — a locked deployment mounts no
|
|
46
47
|
* task-supplied servers). */
|
|
47
48
|
mcp: TaskSpec["mcp"];
|
|
49
|
+
/** The task's A2A peers: a frozen SNAPSHOT of `spec.a2a` whose `toolAxes` were judged here by the same reader and with the same
|
|
50
|
+
* disposition as an MCP server's (a declaration that does not fit refused the whole prepare), each peer carrying the reader's plain
|
|
51
|
+
* copy; `undefined` when the spec declares no peer (absent or empty). Read once, here: the peers dialed are the peers judged. */
|
|
52
|
+
a2a: TaskSpec["a2a"];
|
|
48
53
|
/** Effective caller tool policy: the same `spec.toolPolicy ?? deps.toolPolicy` slot the gate has
|
|
49
54
|
* always enforced, resolved ONCE here. With `toolPolicy` locked, the deployment's own
|
|
50
55
|
* `deps.toolPolicy` is the whole answer (a spec-supplied policy has already been refused). */
|
|
@@ -56,12 +61,27 @@ export interface LockedPreflight {
|
|
|
56
61
|
* site). Unlocked: `spec.basePolicyForResumeEdit ?? deps.basePolicyForResumeEdit`. */
|
|
57
62
|
basePolicyForResumeEdit: ToolPolicy | undefined;
|
|
58
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* How one configuration door is entered: `seat` names the input that carries the value the door judges — the task's configuration or the
|
|
66
|
+
* deployment's deps. A prepare enters each door as it stands ({@link ENTER_AS_IS}: the door's own coded throw); a resume's screen before the
|
|
67
|
+
* claim enters the same door through the resume's refusal channel, which names the seat (`asResumeConfigRefusal`). One door, one function,
|
|
68
|
+
* two entrances: the seat is written once, where the door is called.
|
|
69
|
+
*/
|
|
70
|
+
export type ConfigDoorEntry = <T>(seat: "taskConfig" | "deps", door: () => T) => T;
|
|
71
|
+
export declare const ENTER_AS_IS: ConfigDoorEntry;
|
|
59
72
|
/**
|
|
60
73
|
* Validate a deployment's lock declaration against the closed registry. Fail-loud on any unknown
|
|
61
74
|
* key (`config.locked_registry`): a security control that doesn't parse must refuse to arm, not
|
|
62
75
|
* degrade to "that key silently unlocked". Exported for deployments that want the check at their
|
|
63
76
|
* own startup; the task-preparation preflight runs it on every leg regardless (a mis-declared lock
|
|
64
|
-
* then fails the first prepare instead of silently guarding nothing
|
|
77
|
+
* then fails the first prepare instead of silently guarding nothing — and, on a resume, the screen before
|
|
78
|
+
* the claim, which calls the same preflight).
|
|
79
|
+
*
|
|
80
|
+
* Total over the declaration: anything but `undefined` (no locks) or plain data whose `keys` is a list of registry names — `null`, a
|
|
81
|
+
* list, a primitive, a `keys` that is absent or not a list, a declaration that is not plain data (a Proxy, a `Set` of keys, a class
|
|
82
|
+
* instance, a getter that throws), an element that is not a string, a string that is not a registry name — is the same coded refusal
|
|
83
|
+
* naming `RunnerDeps.lockedConfig` and the member (an element by its index), never a TypeError and never "no locks". The declaration is
|
|
84
|
+
* read once, by the one declaration reading.
|
|
65
85
|
*/
|
|
66
86
|
export declare function resolveLockedKeys(config: LockedConfig | undefined): ReadonlySet<LockedKey>;
|
|
67
87
|
/**
|
|
@@ -74,23 +94,33 @@ export declare function resolveLockedKeys(config: LockedConfig | undefined): Rea
|
|
|
74
94
|
* read off a LIVE object is only true for as long as the object holds still, and the fail-open
|
|
75
95
|
* direction is the reachable one — so both boundaries consume data instead.
|
|
76
96
|
*
|
|
77
|
-
* The read discipline is the load-bearing part, and it is why
|
|
78
|
-
* "read the property, then copy the object": a getter answering ALTERNATING LEGAL values would
|
|
97
|
+
* The read discipline is the load-bearing part, and it is why the copy is made in the pass that reads
|
|
98
|
+
* rather than "read the property, then copy the object": a getter answering ALTERNATING LEGAL values would
|
|
79
99
|
* satisfy any number of re-reads (`"external"` to a validator, `"local"` to a mint site), and no
|
|
80
|
-
* vocabulary guard anywhere has purchase on a legal value. One
|
|
81
|
-
*
|
|
82
|
-
*
|
|
100
|
+
* vocabulary guard anywhere has purchase on a legal value. One pass evaluates every member EXACTLY ONCE
|
|
101
|
+
* and materializes the result as plain data; every later reader — validator, connect, refresh — then sees
|
|
102
|
+
* the same byte. Frozen so nothing downstream rewrites it.
|
|
83
103
|
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
104
|
+
* Plain data, stated: an entry IS plain data, to its whole depth, or it is refused whole. The entry is read
|
|
105
|
+
* by the one declaration reading ({@link receiveDeclaration} — the engine's one receipt of a caller's object,
|
|
106
|
+
* in its declaration mode): every own member read once off its captured descriptor, every level copied, every
|
|
107
|
+
* copied container frozen; an object the entry reaches through two members is read once, and both hold the one
|
|
108
|
+
* copy. So a server's `transport` with its `args` / `env` / `headers`, `allowTools`, `toolFaces`, `toolAxes`
|
|
109
|
+
* and a peer's `headers` and `allowSkills` are the copy's own, and a host that edits its own nested object after
|
|
110
|
+
* the door (a header value, an `allowSkills.push`) reaches nothing the engine holds: the dial, a refresh and a
|
|
111
|
+
* re-dial all work from this copy, on both surfaces. The axes are then judged on that copy by their own reader
|
|
112
|
+
* ({@link judgeEntryToolAxes}).
|
|
113
|
+
*
|
|
114
|
+
* There is no third outcome between "copied whole" and "refused": a value the copy cannot carry whole is a
|
|
115
|
+
* declaration the engine cannot read — a Proxy at any level, an object whose prototype is neither
|
|
116
|
+
* `Object.prototype` nor null (a class instance, a map, `process.env`, a record built on a prototype or in another
|
|
117
|
+
* realm, whose members a copy would drop or could not tell from its own), a function, a structure that contains
|
|
118
|
+
* itself, a getter that throws (whatever it throws), a nesting too deep to read, a list element that is not a
|
|
119
|
+
* string, a member named `__proto__`, an entry that is not an object. Each is refused as `config.invalid_argument`
|
|
120
|
+
* naming the declarer and the member where reading stopped (`toolFaces.write_file`, `allowTools[2]`), never as the
|
|
121
|
+
* raw error the host's code threw, and never by handing the host's object on: a member some of whose getters have
|
|
122
|
+
* already run would be read again downstream, and could answer differently. The door refuses the whole prepare and
|
|
123
|
+
* a library entrance the whole call, with this one sentence either way.
|
|
94
124
|
*
|
|
95
125
|
* Exported because the SECOND boundary needs the identical guarantee: `materializeMcpTools` is public
|
|
96
126
|
* and a library caller reaches it without passing any door, so it snapshots its own input through
|
|
@@ -98,16 +128,39 @@ export declare function resolveLockedKeys(config: LockedConfig | undefined): Rea
|
|
|
98
128
|
*/
|
|
99
129
|
export declare function snapshotMcpEntries(entries: readonly McpServerSpec[]): McpServerSpec[];
|
|
100
130
|
/**
|
|
101
|
-
* The
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
131
|
+
* The refusal of a declaration the engine cannot read (`config.invalid_argument`). `declarer` is the entry's own name as the engine captured
|
|
132
|
+
* it ({@link capturedName}) — absent when there was none to capture — so a consumer that holds the refused entry by a name (the A2A
|
|
133
|
+
* entrance's warning, its collision check) takes it from here and never reads the caller's object again.
|
|
134
|
+
*/
|
|
135
|
+
export type DeclarationRefusal = Error & {
|
|
136
|
+
code: "config.invalid_argument";
|
|
137
|
+
declarer?: string;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* The name a refused entry is held under by a consumer that holds it by a name (the A2A entrance): the refusal's own `declarer`, read as
|
|
141
|
+
* own data — never through anything the refusal's prototype carries — or `undefined` (the consumer names the entry by its place).
|
|
142
|
+
*/
|
|
143
|
+
export declare function refusedDeclarer(refusal: unknown): string | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* One entry of EITHER surface that declares `toolAxes` (an MCP server, an A2A peer) as frozen plain data, read by the discipline
|
|
146
|
+
* {@link snapshotMcpEntries} states: the entry and everything in it read once by the one declaration reading and copied to its whole
|
|
147
|
+
* depth, or the entry refused ({@link DeclarationRefusal}), naming the member where reading stopped. The A2A peer's door and its
|
|
148
|
+
* materialization snapshot through this same function, so the two surfaces' declarations reach the one judge ({@link judgeEntryToolAxes})
|
|
149
|
+
* read the same way; `at` is the surface the entry sits on, which only decides what the refusal calls the declarer.
|
|
150
|
+
*/
|
|
151
|
+
export declare function snapshotDeclaredEntry<E extends McpServerSpec | A2aServerSpec>(entry: E, at: ToolAxesSurface): E;
|
|
152
|
+
/**
|
|
153
|
+
* The `toolAxes` question for ONE snapshot entry of either surface (`at`: an MCP server, an A2A peer) — asked by the preparation door (a
|
|
154
|
+
* refusal ends the prepare) and by each materialization entrance (a refusal fails that server's or that peer's dial), so there is one
|
|
155
|
+
* reading, one copy and one sentence whichever surface and whichever time it is asked. `ok: true` carries the entry with the reader's
|
|
156
|
+
* PLAIN COPY of the axes in place of the caller's object: what was judged is the very value the connect and every refresh read, not a
|
|
157
|
+
* live object that could answer differently later. The copy is frozen with the entry — a tool that shallow-copies a server
|
|
158
|
+
* (`mountedMcp()`) to customise its axes must not rewrite what the parent reads. `ok: false` carries the coded refusal
|
|
159
|
+
* (`config.invalid_argument`) naming the declarer, the tool (or skill) and the member, never a value.
|
|
107
160
|
*/
|
|
108
|
-
export declare function judgeEntryToolAxes(copy:
|
|
161
|
+
export declare function judgeEntryToolAxes<E extends McpServerSpec | A2aServerSpec>(copy: E, at: ToolAxesSurface): {
|
|
109
162
|
ok: true;
|
|
110
|
-
entry:
|
|
163
|
+
entry: E;
|
|
111
164
|
} | {
|
|
112
165
|
ok: false;
|
|
113
166
|
error: Error & {
|
|
@@ -118,14 +171,13 @@ export declare function judgeEntryToolAxes(copy: McpServerSpec): {
|
|
|
118
171
|
* The single preflight resolver: validate the lock declaration, refuse a spec that tries to occupy
|
|
119
172
|
* a locked slot (`config.locked_key`, two-state — the whole prepare is rejected, nothing is
|
|
120
173
|
* silently dropped or merged), and produce the resolved snapshot downstream assembly consumes.
|
|
121
|
-
* Runs BEFORE any side effect of task preparation
|
|
174
|
+
* Runs BEFORE any side effect of task preparation — and, on a resume, before the claim: the resume's
|
|
175
|
+
* screen calls this same function (`enter` naming each refusal's seat) and hands the leg the frozen
|
|
176
|
+
* entries it judged, so the leg's prepare judges engine-owned plain data and dials what was judged.
|
|
122
177
|
*/
|
|
123
|
-
export declare function preflightLockedConfig(spec: TaskSpec, deps: RunnerDeps): LockedPreflight;
|
|
178
|
+
export declare function preflightLockedConfig(spec: Pick<TaskSpec, "mcp" | "a2a" | "toolPolicy" | "basePolicyForResumeEdit">, deps: RunnerDeps, enter?: ConfigDoorEntry): LockedPreflight;
|
|
124
179
|
/**
|
|
125
180
|
* The two caller policies a prepare resolves to: the task's own seat over the deployment's, or the deployment's alone
|
|
126
|
-
* under a `toolPolicy` lock
|
|
181
|
+
* under a `toolPolicy` lock — one resolution, read by the preflight above (which a resume enters before its claim).
|
|
127
182
|
*/
|
|
128
183
|
export declare function callerPolicySeats(spec: Pick<TaskSpec, "toolPolicy" | "basePolicyForResumeEdit">, deps: Pick<RunnerDeps, "toolPolicy" | "basePolicyForResumeEdit">, toolPolicyLocked: boolean): Pick<LockedPreflight, "toolPolicy" | "basePolicyForResumeEdit">;
|
|
129
|
-
/** The retired-member door over the resolved caller policies: a member the engine no longer reads is refused by name
|
|
130
|
-
* (`config.deps_retired_key`), never dropped in silence. */
|
|
131
|
-
export declare function assertCallerPoliciesCurrent(policies: Pick<LockedPreflight, "toolPolicy" | "basePolicyForResumeEdit">): void;
|