@sema-agent/core 7.48.0 → 7.49.1
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 +457 -0
- package/README.md +2 -2
- package/dist/agents/cascade.d.ts +2 -5
- package/dist/agents/child-failure.d.ts +20 -0
- package/dist/agents/child-failure.js +28 -0
- package/dist/agents/cross-session-ref.d.ts +11 -3
- package/dist/agents/cross-session-ref.js +6 -0
- package/dist/agents/cumulative-stats.d.ts +12 -15
- package/dist/agents/cumulative-stats.js +1 -1
- package/dist/agents/extra-tool-names.js +1 -1
- package/dist/agents/inherited-tool-pool.d.ts +17 -13
- package/dist/agents/inherited-tool-pool.js +4 -3
- package/dist/agents/peer-session-drain.d.ts +3 -2
- package/dist/agents/peer-session-drain.js +5 -4
- package/dist/agents/send-message-tool.js +2 -9
- package/dist/agents/subagent.d.ts +10 -29
- package/dist/agents/subagent.js +65 -53
- package/dist/agents/suspend-guard.d.ts +1 -1
- package/dist/agents/tool-filter.d.ts +76 -65
- package/dist/agents/tool-filter.js +122 -92
- package/dist/agents/verify.d.ts +4 -7
- package/dist/agents/verify.js +6 -7
- package/dist/bench/metrics.d.ts +1 -2
- package/dist/brain/anthropic.js +133 -79
- package/dist/brain/errors.d.ts +53 -6
- package/dist/brain/errors.js +22 -2
- package/dist/brain/input-too-long.d.ts +40 -19
- package/dist/brain/input-too-long.js +3 -16
- package/dist/brain/open-responses.js +19 -10
- package/dist/brain/openai.js +123 -32
- package/dist/brain/provider-dialect.d.ts +214 -0
- package/dist/brain/provider-dialect.js +186 -0
- package/dist/brain/request-params.d.ts +27 -8
- package/dist/brain/request-params.js +7 -12
- package/dist/brain/request-route.d.ts +84 -0
- package/dist/brain/request-route.js +41 -0
- package/dist/brain/retry.d.ts +8 -0
- package/dist/brain/retry.js +10 -4
- package/dist/brain/route-adjudicator.d.ts +7 -0
- package/dist/brain/route-adjudicator.js +5 -1
- package/dist/brain/status-sink.d.ts +20 -0
- package/dist/brain/status-sink.js +11 -0
- package/dist/brain/stream-engine.d.ts +52 -1
- package/dist/brain/stream-engine.js +81 -24
- package/dist/brain/stream-shared.d.ts +57 -11
- package/dist/brain/stream-shared.js +28 -2
- package/dist/core/a2a.d.ts +1 -0
- package/dist/core/agent-config-dir.js +3 -2
- package/dist/core/allow-entry.d.ts +21 -12
- package/dist/core/allow-entry.js +38 -31
- package/dist/core/arg-summary.d.ts +21 -28
- package/dist/core/arg-summary.js +235 -88
- package/dist/core/ask-origin.d.ts +42 -24
- package/dist/core/ask-origin.js +18 -13
- package/dist/core/auto-mode-prompt-assets.d.ts +2 -2
- package/dist/core/auto-mode-prompt-assets.js +1 -1
- package/dist/core/auto-mode-prompt.d.ts +11 -1
- package/dist/core/auto-mode-prompt.js +13 -10
- package/dist/core/auto-mode-rebuild.d.ts +7 -0
- package/dist/core/auto-mode-rebuild.js +4 -1
- package/dist/core/canonical-json.d.ts +3 -0
- package/dist/core/canonical-json.js +2 -1
- package/dist/core/checkpoint-requirements.d.ts +892 -0
- package/dist/core/checkpoint-requirements.js +333 -0
- package/dist/core/checkpoint-store.d.ts +94 -65
- package/dist/core/checkpoint-store.js +14 -26
- package/dist/core/child-clamp-seats.d.ts +228 -69
- package/dist/core/child-clamp-seats.js +211 -17
- package/dist/core/classifier-unavailable-arm.d.ts +5 -1
- package/dist/core/classifier-unavailable-arm.js +3 -3
- package/dist/core/compliance.d.ts +3 -0
- package/dist/core/compliance.js +9 -4
- package/dist/core/credential-vocabulary.d.ts +140 -0
- package/dist/core/credential-vocabulary.js +131 -0
- package/dist/core/decision-receipt.js +1 -1
- package/dist/core/effective-path-target.d.ts +73 -16
- package/dist/core/effective-path-target.js +63 -33
- package/dist/core/engine-notice.d.ts +43 -11
- package/dist/core/file-history-store.js +2 -2
- package/dist/core/fs-write-gate-policy.d.ts +4 -0
- package/dist/core/fs-write-gate-policy.js +22 -5
- package/dist/core/gate-bounded-await.d.ts +28 -13
- package/dist/core/gate-bounded-await.js +41 -4
- package/dist/core/gate-fold.d.ts +1 -1
- package/dist/core/gate-fold.js +24 -25
- package/dist/core/gate-lanes.js +16 -15
- package/dist/core/gate-outcome.d.ts +20 -5
- package/dist/core/gate-outcome.js +5 -0
- package/dist/core/governance-codes.d.ts +11 -4
- package/dist/core/governance-codes.js +14 -3
- package/dist/core/hooks.d.ts +21 -0
- package/dist/core/locked-config.d.ts +8 -0
- package/dist/core/locked-config.js +14 -2
- package/dist/core/lsp.js +3 -5
- package/dist/core/mailbox-store.d.ts +3 -4
- package/dist/core/mcp-connection-pool.d.ts +75 -0
- package/dist/core/mcp-connection-pool.js +128 -0
- package/dist/core/mcp-failure.d.ts +2 -1
- package/dist/core/mcp-failure.js +13 -2
- package/dist/core/mcp.d.ts +4 -0
- package/dist/core/mcp.js +70 -43
- package/dist/core/memory-engine/content-origin.js +2 -14
- package/dist/core/memory-engine/engine.d.ts +32 -22
- package/dist/core/memory-engine/engine.js +103 -55
- package/dist/core/memory-engine/file-backend.d.ts +13 -30
- package/dist/core/memory-engine/file-backend.js +37 -252
- package/dist/core/memory-engine/index.d.ts +1 -1
- package/dist/core/memory-engine/index.js +1 -1
- package/dist/core/memory-engine/layout.d.ts +139 -9
- package/dist/core/memory-engine/layout.js +350 -7
- package/dist/core/memory-engine/scope-contract.d.ts +10 -0
- package/dist/core/memory-engine/scope-contract.js +8 -0
- package/dist/core/memory-engine/session-incarnation.d.ts +14 -4
- package/dist/core/memory-engine/session-incarnation.js +5 -2
- package/dist/core/memory-engine/types.d.ts +10 -1
- package/dist/core/memory.js +5 -17
- package/dist/core/model-seat.d.ts +4 -4
- package/dist/core/model-seat.js +1 -1
- package/dist/core/mounted-mcp.d.ts +57 -0
- package/dist/core/mounted-mcp.js +19 -0
- package/dist/core/namespaced-rule-name.d.ts +29 -0
- package/dist/core/namespaced-rule-name.js +52 -0
- package/dist/core/park-selfcheck.d.ts +1 -1
- package/dist/core/park-selfcheck.js +16 -6
- package/dist/core/path-guard-rows.d.ts +99 -0
- package/dist/core/path-guard-rows.js +45 -0
- package/dist/core/path-identity.d.ts +22 -16
- package/dist/core/path-identity.js +10 -10
- package/dist/core/path-rule-binding.d.ts +2 -1
- package/dist/core/path-rule-binding.js +3 -1
- package/dist/core/pause-registry.d.ts +16 -2
- package/dist/core/pause-registry.js +6 -0
- package/dist/core/permission-rule-consent.js +0 -7
- package/dist/core/permission-rule-model.d.ts +68 -24
- package/dist/core/permission-rule-model.js +105 -24
- package/dist/core/permission-rule-store.js +2 -2
- package/dist/core/permission-rules.d.ts +3 -30
- package/dist/core/permission-rules.js +4 -54
- package/dist/core/read-root-candidate.d.ts +1 -3
- package/dist/core/read-root-candidate.js +4 -15
- package/dist/core/real-approval.d.ts +4 -3
- package/dist/core/retired-keys.d.ts +13 -0
- package/dist/core/retired-keys.js +14 -0
- package/dist/core/roles.d.ts +2 -3
- package/dist/core/roles.js +15 -6
- package/dist/core/runner/assemble-result.d.ts +0 -7
- package/dist/core/runner/assemble-result.js +19 -31
- package/dist/core/runner/caller-roster.d.ts +78 -0
- package/dist/core/runner/caller-roster.js +219 -0
- package/dist/core/runner/checkpoint-scope.d.ts +16 -16
- package/dist/core/runner/checkpoint-scope.js +2 -2
- package/dist/core/runner/child-tree.js +2 -2
- package/dist/core/runner/contracts.d.ts +68 -35
- package/dist/core/runner/decide-continuation.d.ts +51 -3
- package/dist/core/runner/decide-continuation.js +76 -21
- package/dist/core/runner/denial-limit-arms.d.ts +17 -5
- package/dist/core/runner/denial-limit-arms.js +11 -9
- package/dist/core/runner/extra-body-dropped-seat.d.ts +8 -0
- package/dist/core/runner/extra-body-dropped-seat.js +22 -0
- package/dist/core/runner/finish-reason-seat.d.ts +9 -0
- package/dist/core/runner/finish-reason-seat.js +40 -0
- package/dist/core/runner/gate-exit.d.ts +44 -32
- package/dist/core/runner/gate-exit.js +112 -25
- package/dist/core/runner/inherited-ask-grants.js +6 -4
- package/dist/core/runner/mcp-redial.d.ts +3 -3
- package/dist/core/runner/mcp-redial.js +3 -4
- package/dist/core/runner/permission-rule-lanes.d.ts +1 -2
- package/dist/core/runner/permission-rule-lanes.js +5 -4
- package/dist/core/runner/prepare-artifact.d.ts +4 -0
- package/dist/core/runner/prepare-artifact.js +2 -1
- package/dist/core/runner/prepare-ask-lane.d.ts +2 -0
- package/dist/core/runner/prepare-ask-lane.js +12 -6
- package/dist/core/runner/prepare-boundary-parks.d.ts +5 -8
- package/dist/core/runner/prepare-boundary-parks.js +4 -7
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +11 -15
- package/dist/core/runner/prepare-caps-and-workflow.js +19 -27
- package/dist/core/runner/prepare-config-doors.d.ts +9 -9
- package/dist/core/runner/prepare-config-doors.js +10 -5
- package/dist/core/runner/prepare-defer-classify.d.ts +2 -2
- package/dist/core/runner/prepare-defer-classify.js +5 -3
- package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
- package/dist/core/runner/prepare-delegation-surface.js +3 -3
- package/dist/core/runner/prepare-gate-stations.d.ts +4 -4
- package/dist/core/runner/prepare-gate-stations.js +9 -7
- package/dist/core/runner/prepare-hands-readface.d.ts +7 -7
- package/dist/core/runner/prepare-hands-readface.js +7 -7
- package/dist/core/runner/prepare-inherited-gate.d.ts +7 -6
- package/dist/core/runner/prepare-inherited-gate.js +14 -15
- package/dist/core/runner/prepare-listings.d.ts +7 -24
- package/dist/core/runner/prepare-listings.js +4 -5
- package/dist/core/runner/prepare-memory-engine-session.d.ts +2 -0
- package/dist/core/runner/prepare-memory-engine-session.js +4 -3
- package/dist/core/runner/prepare-memory.d.ts +6 -0
- package/dist/core/runner/prepare-memory.js +13 -13
- package/dist/core/runner/prepare-offload-wrappers.d.ts +5 -0
- package/dist/core/runner/prepare-offload-wrappers.js +3 -3
- package/dist/core/runner/prepare-park-ask.d.ts +7 -8
- package/dist/core/runner/prepare-park-ask.js +17 -10
- package/dist/core/runner/prepare-policy-chain.js +24 -44
- package/dist/core/runner/prepare-project-context.d.ts +1 -1
- package/dist/core/runner/prepare-project-context.js +3 -4
- package/dist/core/runner/prepare-protocol-tools.d.ts +9 -3
- package/dist/core/runner/prepare-protocol-tools.js +3 -4
- package/dist/core/runner/prepare-run-refs.d.ts +3 -0
- package/dist/core/runner/prepare-run-refs.js +2 -1
- package/dist/core/runner/prepare-safety-scan.d.ts +4 -8
- package/dist/core/runner/prepare-safety-scan.js +1 -2
- package/dist/core/runner/prepare-suspend-saga.d.ts +7 -1
- package/dist/core/runner/prepare-suspend-saga.js +28 -12
- package/dist/core/runner/prepare-task.d.ts +1 -1
- package/dist/core/runner/prepare-task.js +67 -56
- package/dist/core/runner/prepare-wiring-manifest.d.ts +11 -10
- package/dist/core/runner/prepare-wiring-manifest.js +5 -8
- package/dist/core/runner/resume-apply.js +7 -14
- package/dist/core/runner/resume-checkpoint-screen.js +11 -4
- package/dist/core/runner/resume-internals-and-config.js +2 -2
- package/dist/core/runner/resume-policy-outcome.js +5 -32
- package/dist/core/runner/resume-review-outcome.js +4 -1
- package/dist/core/runner/retired-runner-deps.d.ts +6 -0
- package/dist/core/runner/retired-runner-deps.js +10 -1
- package/dist/core/runner/run-brain-sinks.d.ts +4 -0
- package/dist/core/runner/run-brain-sinks.js +5 -2
- package/dist/core/runner/run-harness-handlers.js +29 -36
- package/dist/core/runner/run-leg.d.ts +0 -2
- package/dist/core/runner/run-leg.js +32 -33
- package/dist/core/runner/run-terminal-adoption.js +4 -3
- package/dist/core/runner/runtask.js +8 -8
- package/dist/core/runner/session-rule-policy.js +5 -5
- package/dist/core/runner/stream-settle-backstop.js +7 -4
- package/dist/core/runner/sub-agent-deny-lists.d.ts +51 -12
- package/dist/core/runner/sub-agent-deny-lists.js +111 -80
- package/dist/core/runner/terminal-account.d.ts +48 -0
- package/dist/core/runner/terminal-account.js +186 -0
- package/dist/core/runner/tool-end-body.d.ts +54 -17
- package/dist/core/runner/tool-end-body.js +27 -2
- package/dist/core/runner/tool-face-overlay.d.ts +3 -1
- package/dist/core/runner/tool-face-overlay.js +6 -4
- package/dist/core/runner/tool-occurrence.d.ts +106 -0
- package/dist/core/runner/tool-occurrence.js +123 -0
- package/dist/core/runner/tool-progress-lane.d.ts +16 -8
- package/dist/core/runner/tool-progress-lane.js +25 -34
- package/dist/core/runner/tool-turn-repair-seat.d.ts +28 -4
- package/dist/core/runner/tool-turn-repair-seat.js +36 -13
- package/dist/core/runner/turn-attachments.d.ts +1 -1
- package/dist/core/runner/write-protection-station.d.ts +21 -9
- package/dist/core/runner/write-protection-station.js +20 -17
- package/dist/core/runner-deps.d.ts +12 -22
- package/dist/core/secret-env.d.ts +16 -5
- package/dist/core/secret-env.js +23 -63
- package/dist/core/sensitive-path-policy.d.ts +19 -18
- package/dist/core/sensitive-path-policy.js +73 -49
- package/dist/core/session-reconcile.d.ts +3 -0
- package/dist/core/session-reconcile.js +5 -4
- package/dist/core/session-store.d.ts +5 -0
- package/dist/core/session-store.js +12 -0
- package/dist/core/session.d.ts +13 -0
- package/dist/core/shared-memory/normalize.d.ts +17 -4
- package/dist/core/shared-memory/normalize.js +7 -7
- package/dist/core/shell-lexer.js +5 -4
- package/dist/core/shell-wrapper-projection.js +1 -1
- package/dist/core/skill-grant.js +1 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +13 -0
- package/dist/core/store-contracts/mailbox-store-contract.d.ts +7 -14
- package/dist/core/store-contracts/session-store-incarnation-contract.d.ts +27 -0
- package/dist/core/store-contracts/session-store-incarnation-contract.js +92 -0
- package/dist/core/stub-env.d.ts +2 -0
- package/dist/core/stub-env.js +1 -0
- package/dist/core/synthetic-read-verdict.js +2 -2
- package/dist/core/task-event.d.ts +59 -5
- package/dist/core/task-result.d.ts +1 -1
- package/dist/core/task-spec.d.ts +42 -9
- package/dist/core/terminal-cause.d.ts +94 -11
- package/dist/core/tighten-task-spec.d.ts +5 -4
- package/dist/core/tighten-task-spec.js +20 -25
- package/dist/core/tool-catalog-entries.d.ts +5 -7
- package/dist/core/tool-catalog-entries.js +14 -15
- package/dist/core/tool-face.d.ts +47 -0
- package/dist/core/tool-face.js +5 -0
- package/dist/core/tool-model-gate.d.ts +5 -5
- package/dist/core/tool-name-aliases.d.ts +26 -2
- package/dist/core/tool-name-aliases.js +13 -0
- package/dist/core/tool-name-list.d.ts +30 -0
- package/dist/core/tool-name-list.js +55 -0
- package/dist/core/tool-name-readings.d.ts +1 -9
- package/dist/core/tool-name-readings.js +1 -3
- package/dist/core/tool-policy.d.ts +195 -85
- package/dist/core/tool-policy.js +165 -380
- package/dist/core/tool-registry.d.ts +44 -1
- package/dist/core/tool-registry.js +26 -0
- package/dist/core/tool-roster.d.ts +19 -1
- package/dist/core/tool-roster.js +21 -2
- package/dist/core/tool-spec-members.d.ts +45 -0
- package/dist/core/tool-spec-members.js +169 -0
- package/dist/core/tool-spec.d.ts +46 -8
- package/dist/core/tools.d.ts +6 -2
- package/dist/core/tools.js +8 -4
- package/dist/core/untrusted-egress.js +29 -26
- package/dist/core/untrusted-text.d.ts +13 -10
- package/dist/core/untrusted-text.js +6 -44
- package/dist/core/workflow-journal-store.d.ts +4 -1
- package/dist/core/write-protect.d.ts +65 -29
- package/dist/core/write-protect.js +235 -177
- package/dist/engine/compaction/compaction.d.ts +2 -2
- package/dist/engine/execution-env/node-execution-env.d.ts +5 -23
- package/dist/engine/execution-env/node-execution-env.js +16 -38
- package/dist/engine/execution-env/symlink-chain.d.ts +23 -0
- package/dist/engine/execution-env/symlink-chain.js +32 -0
- package/dist/engine/harness/types.d.ts +7 -0
- package/dist/engine/llm/tool-turns.d.ts +3 -0
- package/dist/engine/llm/tool-turns.js +1 -0
- package/dist/engine/llm/types.d.ts +59 -23
- package/dist/engine/loop/agent-loop.js +16 -2
- package/dist/engine/session/memory-repo.js +11 -3
- package/dist/engine/session/repo-utils.d.ts +8 -0
- package/dist/engine/session/repo-utils.js +13 -0
- package/dist/index.d.ts +20 -23
- package/dist/index.js +17 -20
- package/dist/internal/harness.d.ts +1 -1
- package/dist/internal/harness.js +1 -1
- package/dist/internal/llm.d.ts +2 -2
- package/dist/internal/llm.js +1 -1
- package/dist/orchestration/governance-baseline-validity.js +1 -1
- package/dist/orchestration/run-spec.js +3 -3
- package/dist/orchestration/run-workflow-tool.d.ts +16 -35
- package/dist/orchestration/run-workflow-tool.js +38 -78
- package/dist/orchestration/workflow-governance.d.ts +21 -25
- package/dist/orchestration/workflow-governance.js +38 -78
- package/dist/orchestration/workflow-primitives.d.ts +7 -22
- package/dist/orchestration/workflow-primitives.js +5 -12
- package/dist/orchestration/workflow-types.d.ts +1 -1
- package/dist/orchestration/workflow.d.ts +61 -11
- package/dist/orchestration/workflow.js +189 -117
- package/dist/scenarios/full-body.d.ts +1 -1
- package/dist/shell/lex.d.ts +0 -21
- package/dist/shell/lex.js +250 -68
- package/dist/shell/shell-words.d.ts +35 -0
- package/dist/shell/shell-words.js +65 -0
- package/dist/stores/file/checkpoint-store.d.ts +5 -5
- package/dist/stores/file/checkpoint-store.js +5 -2
- package/dist/stores/file/index.d.ts +0 -8
- package/dist/stores/file/index.js +0 -12
- package/dist/stores/file/session-store.d.ts +3 -0
- package/dist/stores/file/session-store.js +44 -19
- package/dist/tools/artifact/artifact-tool.js +2 -0
- package/dist/tools/fs/bash-program-position.d.ts +12 -4
- package/dist/tools/fs/bash-program-position.js +32 -9
- package/dist/tools/fs/bash-readonly-classifier.d.ts +1 -1
- package/dist/tools/fs/bash-readonly-classifier.js +8 -7
- package/dist/tools/fs/containment-face.d.ts +4 -0
- package/dist/tools/fs/containment-face.js +3 -0
- package/dist/tools/fs/fs-shared.d.ts +10 -0
- package/dist/tools/fs/fs-shared.js +18 -0
- package/dist/tools/fs/fs-write.js +4 -2
- package/dist/tools/fs/index.d.ts +1 -1
- package/dist/tools/fs/program-read-model.d.ts +46 -20
- package/dist/tools/fs/program-read-model.js +50 -20
- package/dist/tools/fs/program-read-model.rows.d.ts +0 -14
- package/dist/tools/fs/program-read-model.rows.js +16 -15
- package/dist/tools/fs/read-deny-home.d.ts +33 -47
- package/dist/tools/fs/read-deny-home.js +35 -49
- package/dist/tools/fs/read-deny.d.ts +23 -22
- package/dist/tools/fs/read-deny.js +114 -89
- package/dist/tools/fs/removal-targets.d.ts +56 -23
- package/dist/tools/fs/removal-targets.js +65 -87
- package/dist/tools/fs/safety.d.ts +29 -22
- package/dist/tools/fs/safety.js +17 -11
- package/dist/tools/fs/search.js +10 -8
- package/dist/tools/fs/shell-read-argv.js +1 -1
- package/dist/tools/fs/shell-read-bindings.d.ts +169 -37
- package/dist/tools/fs/shell-read-bindings.js +324 -86
- package/dist/tools/fs/shell-read-builtins.d.ts +35 -0
- package/dist/tools/fs/shell-read-builtins.js +43 -0
- package/dist/tools/fs/shell-read-check.d.ts +15 -1
- package/dist/tools/fs/shell-read-check.js +67 -43
- package/dist/tools/fs/shell-read-establish.js +6 -6
- package/dist/tools/fs/shell-read-functions.d.ts +22 -0
- package/dist/tools/fs/shell-read-functions.js +29 -0
- package/dist/tools/fs/shell-read-judge.d.ts +51 -18
- package/dist/tools/fs/shell-read-judge.js +40 -4
- package/dist/tools/fs/shell-read-plan.d.ts +12 -6
- package/dist/tools/fs/shell-read-plan.js +118 -113
- package/dist/tools/fs/shell-read-start.d.ts +29 -6
- package/dist/tools/fs/shell-read-start.js +16 -9
- package/dist/tools/fs/shell-read-word.js +4 -0
- package/dist/tools/fs/shell-read-workdir.d.ts +156 -0
- package/dist/tools/fs/shell-read-workdir.js +281 -0
- package/dist/tools/fs/shell-read-write-targets.d.ts +5 -2
- package/dist/tools/fs/shell-read-write-targets.js +14 -5
- package/dist/tools/fs/shell-reentry-text.d.ts +4 -6
- package/dist/tools/fs/shell-reentry-text.js +3 -11
- package/dist/tools/task-list.d.ts +1 -2
- package/dist/tools/web.js +1 -1
- package/package.json +4 -1
- package/test/export-surface.snapshot.json +107 -143
- package/wire-changes/core@7.49.0.json +4765 -0
- package/dist/agents/teacher.d.ts +0 -159
- package/dist/agents/teacher.js +0 -577
- package/dist/agents/team.d.ts +0 -226
- package/dist/agents/team.js +0 -257
- package/dist/core/strategy-store.d.ts +0 -238
- package/dist/core/strategy-store.js +0 -253
- package/dist/orchestration/builtin-workflows.d.ts +0 -133
- package/dist/orchestration/builtin-workflows.js +0 -159
- package/dist/scenarios/env.d.ts +0 -40
- package/dist/scenarios/env.js +0 -39
- package/dist/scenarios/scenario-registry.d.ts +0 -110
- package/dist/scenarios/scenario-registry.js +0 -140
- package/dist/scenarios/teacher-quickstart.d.ts +0 -40
- package/dist/scenarios/teacher-quickstart.js +0 -12
- package/dist/stores/cc/lockfile.d.ts +0 -10
- package/dist/stores/cc/lockfile.js +0 -98
- package/dist/stores/cc/mailbox-store.d.ts +0 -20
- package/dist/stores/cc/mailbox-store.js +0 -255
- package/dist/stores/cc/roster-adapter.d.ts +0 -12
- package/dist/stores/cc/roster-adapter.js +0 -117
- package/dist/stores/cc/sidecar-transcript.d.ts +0 -97
- package/dist/stores/cc/sidecar-transcript.js +0 -264
- package/dist/stores/cc/task-list-store.d.ts +0 -2
- package/dist/stores/cc/task-list-store.js +0 -125
- package/dist/stores/file/strategy-store.d.ts +0 -97
- package/dist/stores/file/strategy-store.js +0 -341
|
@@ -19,6 +19,11 @@ export interface ToolCallFace {
|
|
|
19
19
|
contractId: string;
|
|
20
20
|
shapeDigest: string;
|
|
21
21
|
implementationRevision: string;
|
|
22
|
+
/** Which approval card this call renders under (the closed set `TOOL_APPROVAL_CARDS`; `generic` when the tool
|
|
23
|
+
* declares none). Minted with the face — a reserved card only for the engine tool that owns it — and copied onto the
|
|
24
|
+
* ask, the parked gate and the pending row, so no reader recovers the card from a name. Absent on a face rebuilt
|
|
25
|
+
* from a park row (a re-judgment reads no card). */
|
|
26
|
+
approvalCard?: import("./tool-face.js").ToolApprovalCard;
|
|
22
27
|
}
|
|
23
28
|
export interface ToolCallRequest {
|
|
24
29
|
/** The tool's wire name — the Runner's gate resolves a call made under an alias to the wire name of the tool it
|
|
@@ -114,6 +119,17 @@ export interface ToolCallRequest {
|
|
|
114
119
|
* directory by writing one back.
|
|
115
120
|
*/
|
|
116
121
|
advertisedWritableRoots?: readonly string[];
|
|
122
|
+
/**
|
|
123
|
+
* The engine data root's spellings — the ONE exempt root every exemptible path row is judged under (the data-root
|
|
124
|
+
* exemption, path-guard-rows.ts): resolved once per leg from `RunnerDeps.memoryEngineDir` (absent ⇒ the resolver's own
|
|
125
|
+
* chain, `$AGENT_DATA_DIR ?? ~/.ai-agent`) and stamped by the Runner on every policy adjudication of the leg. A path guard
|
|
126
|
+
* that judges a write under the exemption reads it here, so the guard and the engine's own write judgment speak about
|
|
127
|
+
* the same directory instead of a second copy the deployment keeps by hand.
|
|
128
|
+
*
|
|
129
|
+
* ABSENT outside a Runner (a policy driven directly by a host): the guard then reads the resolver's own chain, the root
|
|
130
|
+
* a Runner with no `memoryEngineDir` would stamp. Read-only, frozen.
|
|
131
|
+
*/
|
|
132
|
+
exemptRoots?: readonly string[];
|
|
117
133
|
/**
|
|
118
134
|
* design/80 D-E-core: read-only per-run budget snapshot so a STATELESS policy can self-limit against
|
|
119
135
|
* state that survives suspend/resume (a fresh in-memory counter would reset every leg — the supervisor
|
|
@@ -177,68 +193,87 @@ export declare function advertisedWritableRootsSeat(seat: {
|
|
|
177
193
|
} | undefined): {
|
|
178
194
|
advertisedWritableRoots?: readonly string[];
|
|
179
195
|
};
|
|
196
|
+
/** Stamp {@link ToolCallRequest.exemptRoots} from the leg's one resolution of the data root — the ONE place that value
|
|
197
|
+
* becomes a request field, beside {@link advertisedWritableRootsSeat} at every adjudication station. */
|
|
198
|
+
export declare function exemptRootsSeat(exemptRoots: readonly string[]): {
|
|
199
|
+
exemptRoots: readonly string[];
|
|
200
|
+
};
|
|
180
201
|
/** Declared beside the receipt's list (decision-receipt.ts) — a new member added to either side is a compile error rather
|
|
181
202
|
* than a silent drift between the type and the screen; re-exported here, the module every consumer of the decision reads. */
|
|
182
203
|
export type { DecisionReason };
|
|
183
|
-
/**
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
204
|
+
/**
|
|
205
|
+
* The engine's ATTESTATION record — the one carrier of what an engine station knows about a decision and a policy cannot
|
|
206
|
+
* state: WHO settled the call's wait and WHICH question that answered (the settlement, the ask's origin word and class set,
|
|
207
|
+
* the digest of the arguments the answer licenses), and the facts the classifier stations, the in-fold unresolvable arms
|
|
208
|
+
* and the policy fold record. It rides the decision as its `attestation` member and is read through {@link attestationOf}
|
|
209
|
+
* alone; the decision object's identity carries nothing.
|
|
210
|
+
*
|
|
211
|
+
* Minted only by {@link mintAttestation} and combined only by {@link mergeAttestation}: both freeze the record and enter it
|
|
212
|
+
* in a module-private brand set, so a value a caller composed — a literal, a copy, a structured clone — is not a record, and
|
|
213
|
+
* the receipt refuses a decision carrying one. A record is bound to the call it was minted for (`toolCallId` + `toolName`):
|
|
214
|
+
* handed back for another call it reads as absent. A spread of a decision keeps its record, and the record still says only
|
|
215
|
+
* what the engine minted — a refusal record on an allow is a contradiction the gate's exit refuses, and a resolution's
|
|
216
|
+
* answer binds the arguments it licensed (`inputDigest`).
|
|
217
|
+
*/
|
|
218
|
+
export interface EngineAttestation {
|
|
219
|
+
readonly toolCallId: string;
|
|
220
|
+
readonly toolName: string;
|
|
221
|
+
/** What ended the call's wait. The answer group — `settlement`, `origin`, `classes`, `inputDigest` — travels as one. */
|
|
222
|
+
readonly settlement?: Settlement;
|
|
223
|
+
/** The settled ask's origin word. */
|
|
224
|
+
readonly origin?: AskOrigin;
|
|
225
|
+
/** The settled ask's class set (`ASK_CLASSES` order), when the minting station held one. */
|
|
226
|
+
readonly classes?: readonly import("./ask-origin.js").AskClass[];
|
|
227
|
+
/** `boundInputHashOf` of the arguments the settlement licenses: an approver's edit, the snapshot shown, or the asked args. */
|
|
228
|
+
readonly inputDigest?: string;
|
|
229
|
+
/** The FORM of a classifier round that did not rule (a classifier deny's cause). */
|
|
230
|
+
readonly classifierCause?: import("./gate-outcome.js").ClassifierDenyCause;
|
|
231
|
+
/** WHICH model answered a classification, on either arm. */
|
|
232
|
+
readonly classifierRound?: import("./auto-mode.js").AutoModeClassifierRound;
|
|
233
|
+
/** Why an in-fold deny refused an ask nobody could resolve. */
|
|
234
|
+
readonly unresolvableCause?: import("./ask-unresolvable-notice.js").AskUnresolvableCause;
|
|
235
|
+
/** The classes of the asks a policy fold collapsed — the proof behind a decision's `foldedAskClasses`. */
|
|
236
|
+
readonly foldedClasses?: readonly import("./ask-origin.js").AskClass[];
|
|
237
|
+
}
|
|
238
|
+
/** The members a station attests — everything but the call binding. */
|
|
239
|
+
export type AttestationMembers = Omit<EngineAttestation, "toolCallId" | "toolName">;
|
|
240
|
+
/** Mint a record for `call`. Engine stations only: not re-exported from `src/index.ts`. The values are DETACHED snapshots, so a
|
|
241
|
+
* caller that later mutates the settlement object it was handed cannot rewrite what the engine attests. */
|
|
242
|
+
export declare function mintAttestation(call: {
|
|
211
243
|
toolCallId: string;
|
|
212
244
|
toolName: string;
|
|
213
|
-
}):
|
|
214
|
-
/**
|
|
215
|
-
|
|
216
|
-
|
|
245
|
+
}, members: AttestationMembers): EngineAttestation;
|
|
246
|
+
/** Is `v` a record the engine minted (the brand alone — no binding)? The receipt's test. */
|
|
247
|
+
export declare function isEngineAttestation(v: unknown): v is EngineAttestation;
|
|
248
|
+
/** THE read: the record `d` carries FOR `call` — a branded record bound to that call, else `undefined` (a record bound to
|
|
249
|
+
* another call is a replayed one and reads as absent). Read off the own data member, never through an accessor. */
|
|
250
|
+
export declare function attestationOf(d: unknown, call: {
|
|
217
251
|
toolCallId: string;
|
|
218
252
|
toolName: string;
|
|
219
|
-
}):
|
|
220
|
-
/**
|
|
221
|
-
|
|
253
|
+
}): EngineAttestation | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* Combine two records for `call`, member GROUP by group: the later record's group stands where it has one, the earlier's
|
|
256
|
+
* fills a group the later lacks. A record not bound to `call` contributes nothing. `answer` scope is the veto's merge: the
|
|
257
|
+
* earlier record contributes ONLY its answer, and only when the later carries none — a person's yes rides a later layer's
|
|
258
|
+
* deny (invariant I3) while the refusing station's own facts stay its own.
|
|
259
|
+
*/
|
|
260
|
+
export declare function mergeAttestation(call: {
|
|
222
261
|
toolCallId: string;
|
|
223
262
|
toolName: string;
|
|
224
|
-
}):
|
|
225
|
-
/**
|
|
226
|
-
*
|
|
227
|
-
export declare function
|
|
263
|
+
}, earlier: EngineAttestation | undefined, later: EngineAttestation | undefined, scope?: "all" | "answer"): EngineAttestation | undefined;
|
|
264
|
+
/** `d` with `members` attested for `call`, merged over the record it already carries for that call (the new members' groups
|
|
265
|
+
* win). Always a fresh object — the receipt hands out frozen ones. */
|
|
266
|
+
export declare function attest<T extends object>(d: T, call: {
|
|
228
267
|
toolCallId: string;
|
|
229
268
|
toolName: string;
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
export declare function engineSettlementOf(d: unknown, call: {
|
|
269
|
+
}, members: AttestationMembers): T;
|
|
270
|
+
/** `d` carrying `record` (a fresh object), or `d` itself when there is no record to put on it. */
|
|
271
|
+
export declare function withAttestation<T extends object>(d: T, record: EngineAttestation | undefined): T;
|
|
272
|
+
/** The `task_aborted`-attested deny an engine policy answers on an aborted signal instead of reaching a seat. */
|
|
273
|
+
export declare function abortedSeatDeny(req: {
|
|
236
274
|
toolCallId: string;
|
|
237
275
|
toolName: string;
|
|
238
|
-
}):
|
|
239
|
-
settlement: Settlement;
|
|
240
|
-
origin: AskOrigin;
|
|
241
|
-
} | undefined;
|
|
276
|
+
}, message: string, origin: AskOrigin): PermissionResult;
|
|
242
277
|
/**
|
|
243
278
|
* design/252 G-7 — how long an approver-attribution identifier may be.
|
|
244
279
|
*
|
|
@@ -288,9 +323,9 @@ export declare function screenApproverAttribution(v: unknown): {
|
|
|
288
323
|
* - `deny` blocks the call.
|
|
289
324
|
* Human-readable text is `message`; read it via {@link decisionText}.
|
|
290
325
|
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
326
|
+
* What ended a wait is not a policy's to state: it rides only the `attestation` member, an engine-minted
|
|
327
|
+
* record ({@link EngineAttestation}) the receipt refuses in any other form, and the gate's exit mints the one
|
|
328
|
+
* settlement record ({@link import("./gate-outcome.js").GateOutcome}) from it; a policy that puts a `settledBy`
|
|
294
329
|
* or `approver` member on its verdict is putting an unread property on it.
|
|
295
330
|
* RB-479-B① (ruled 2026-08-02): the legacy `reason` field is REMOVED — one name for one thing.
|
|
296
331
|
*
|
|
@@ -303,6 +338,7 @@ export type PermissionResult = {
|
|
|
303
338
|
updatedInput?: unknown;
|
|
304
339
|
message?: string;
|
|
305
340
|
decisionReason?: DecisionReason;
|
|
341
|
+
attestation?: EngineAttestation;
|
|
306
342
|
} | {
|
|
307
343
|
action: "ask";
|
|
308
344
|
updatedInput?: unknown;
|
|
@@ -418,12 +454,12 @@ export type PermissionResult = {
|
|
|
418
454
|
/** The ask's whole class set, in {@link import("./ask-origin.js").ASK_CLASSES} order (see
|
|
419
455
|
* {@link AskRequest.classes}). Stamped beside {@link askClass}, under the same rule. */
|
|
420
456
|
classes?: readonly import("./ask-origin.js").AskClass[];
|
|
421
|
-
/** WHICH integrity guard minted this ask — a removal of a protected location, an unverifiable recursive delete
|
|
422
|
-
* or the session-transcript write. ENGINE-STAMPED by the guard policies; a fold-internal fact the class
|
|
457
|
+
/** WHICH integrity guard minted this ask — a removal of a protected location, an unverifiable recursive delete,
|
|
458
|
+
* shell text the engine cannot read or the session-transcript write. ENGINE-STAMPED by the guard policies; a fold-internal fact the class
|
|
423
459
|
* derivation reads ({@link import("./ask-origin.js").classifyAsk}) so the guards, which mint the same
|
|
424
460
|
* `requiresRealApproval` ask, are told apart by a fact and not by their prose. Never copied onto the
|
|
425
461
|
* approval request or the park row. */
|
|
426
|
-
guard?: "dangerous_delete" | "unverifiable_delete" | "transcript_write" | "artifact_shared_read";
|
|
462
|
+
guard?: "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "artifact_shared_read";
|
|
427
463
|
/** The call could not be READ against a rule that may reach it — a content-form deny row, a content-form
|
|
428
464
|
* ask row, or a persisted-rule row (the lexer's word). ENGINE-STAMPED at the three unreadable mint sites;
|
|
429
465
|
* the class derivation reads it as `rule_unreadable` (a mode may release it, a person may clear it, no
|
|
@@ -439,14 +475,17 @@ export type PermissionResult = {
|
|
|
439
475
|
/** The classes of the OTHER asks a policy fold collapsed into this one
|
|
440
476
|
* ({@link import("./ask-origin.js").decisionAskClassesOf} per contributing ask, unioned), so a member the
|
|
441
477
|
* fold does not copy — a guard mark, an unreadable-rule fact, a bare real-approval bit — is not lost behind
|
|
442
|
-
* the ask that won the slot. ENGINE-WRITTEN by {@link combinePolicies}, which attests the
|
|
443
|
-
*
|
|
478
|
+
* the ask that won the slot. ENGINE-WRITTEN by {@link combinePolicies}, which attests the list it wrote
|
|
479
|
+
* ({@link EngineAttestation.foldedClasses}); the receipt refuses the member unless the decision's record carries that very
|
|
480
|
+
* list (a policy's own, an edited list are refused). Fold-internal, never on the request. */
|
|
444
481
|
foldedAskClasses?: readonly import("./ask-origin.js").AskClass[];
|
|
482
|
+
attestation?: EngineAttestation;
|
|
445
483
|
} | {
|
|
446
484
|
action: "deny";
|
|
447
485
|
updatedInput?: unknown;
|
|
448
486
|
message?: string;
|
|
449
487
|
decisionReason?: DecisionReason;
|
|
488
|
+
attestation?: EngineAttestation;
|
|
450
489
|
};
|
|
451
490
|
/**
|
|
452
491
|
* design/252 G-2 — WHY a piece of rule-provenance evidence is not on an ask.
|
|
@@ -556,12 +595,18 @@ export interface ToolPolicy {
|
|
|
556
595
|
* through {@link combinePolicies}; read with {@link toolPolicyPathRules}. Its presence also tells the Runner to read
|
|
557
596
|
* each call's target ({@link ToolCallRequest.targetReading}). */
|
|
558
597
|
readonly pathRules?: (anchors: import("./permission-rule-model.js").PathRuleBases) => readonly import("./path-rule-binding.js").BoundPathRule[];
|
|
559
|
-
/**
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
|
|
598
|
+
/** The guarded WRITE rows this policy refuses — rows of the one path table (path-guard-rows.ts), stated as data. The
|
|
599
|
+
* engine judges them for a writer the policy cannot see as a call (the shell's file commands) by its ONE write judgment:
|
|
600
|
+
* the leg's views of the target (spelling, real target, symlink chain) under the leg's one exempt root
|
|
601
|
+
* ({@link ToolCallRequest.exemptRoots}) beside the always-on write-protection table. A target one of them covers is not
|
|
602
|
+
* placed, so no permission mode answers the command and its ask reaches a person — it is not refused. The rows of ONE
|
|
603
|
+
* judgment: a row placed below a declared root is placed where that root resolves in `env` (resolved per call). A PURE
|
|
604
|
+
* statement: no side effect, no verdict; a call that throws leaves the target unplaced. Carried through
|
|
605
|
+
* {@link combinePolicies} (the members' rows, in order); read with {@link toolPolicyWriteGuardRows}. */
|
|
606
|
+
readonly writeGuardRows?: (at: {
|
|
607
|
+
readonly env?: import("../internal/harness-types.js").ExecutionEnv;
|
|
608
|
+
readonly signal?: AbortSignal;
|
|
609
|
+
}) => Promise<readonly import("./path-guard-rows.js").PathGuardRow[]>;
|
|
565
610
|
/** The raw tool-name lists a name-keyed policy was built from — the prepare-time policy-name audit's feed (a retired
|
|
566
611
|
* name refuses the run, an unmounted one is advised). Carried through {@link combinePolicies} (the union of the
|
|
567
612
|
* members' groups); read with {@link toolPolicyNameSets}. */
|
|
@@ -572,10 +617,11 @@ export interface ToolPolicy {
|
|
|
572
617
|
* each by name off the wrapped policy, {@link combinePolicies} folds each. The fence makes a new {@link ToolPolicy} member
|
|
573
618
|
* a compile error until the table names it.
|
|
574
619
|
*/
|
|
575
|
-
declare const TOOL_POLICY_CARRIED_MEMBERS: readonly ["projection", "pathRules", "
|
|
620
|
+
declare const TOOL_POLICY_CARRIED_MEMBERS: readonly ["projection", "pathRules", "writeGuardRows", "nameSets"];
|
|
576
621
|
type ToolPolicyCarriedMember = (typeof TOOL_POLICY_CARRIED_MEMBERS)[number];
|
|
577
622
|
export type ToolPolicyCarriesEveryMember = AssertAllKeysHandled<Exclude<Exclude<keyof ToolPolicy, "check">, ToolPolicyCarriedMember>>;
|
|
578
|
-
/** The carried members that are set on `p`, each read by name — an accessor or a non-enumerable member included.
|
|
623
|
+
/** The carried members that are set on `p`, each read by name — an accessor or a non-enumerable member included. A
|
|
624
|
+
* retired member `p` still holds would not be carried: it is refused by name instead (`config.deps_retired_key`). */
|
|
579
625
|
export declare function carriedMembersOf(p: {
|
|
580
626
|
readonly [K in ToolPolicyCarriedMember]?: ToolPolicy[K];
|
|
581
627
|
}): {
|
|
@@ -583,7 +629,7 @@ export declare function carriedMembersOf(p: {
|
|
|
583
629
|
};
|
|
584
630
|
/**
|
|
585
631
|
* The ONE way to wrap a policy: the wrapper decides through `check`; every member {@link ToolPolicy} declares beside it
|
|
586
|
-
* (projection, name sets, path deny rows, write
|
|
632
|
+
* (projection, name sets, path deny rows, guarded write rows — the carried-member table) rides as `inner` holds it, read
|
|
587
633
|
* by name, so a class instance's accessor or a non-enumerable member rides too — a `{ check }` literal drops them, and
|
|
588
634
|
* engine stations the wrapper never sees read each one. The carried members describe what `inner` refuses, so the wrapper
|
|
589
635
|
* must refuse at least that (an observer, a tightener); one that releases what `inner` refuses is a policy of its own.
|
|
@@ -594,9 +640,10 @@ export declare function wrapToolPolicy<P extends ToolPolicy>(inner: P, check: To
|
|
|
594
640
|
* the leg the policies are installed on (a policy already installed answers with its own installation's rows). The deny
|
|
595
641
|
* tables take the rows that guard a face (`faces` non-empty) of a deny rule. */
|
|
596
642
|
export declare function toolPolicyPathRules(policies: readonly (ToolPolicy | undefined)[], anchors: import("./permission-rule-model.js").PathRuleBases): readonly import("./path-rule-binding.js").BoundPathRule[];
|
|
597
|
-
/** The
|
|
598
|
-
*
|
|
599
|
-
|
|
643
|
+
/** The guarded write rows the given policies carry together (combined policies included): every member's rows of one
|
|
644
|
+
* judgment, in member order (a member that throws throws here — the judgment leaves the target unplaced). `undefined`
|
|
645
|
+
* when none carries any. */
|
|
646
|
+
export declare function toolPolicyWriteGuardRows(policies: readonly (ToolPolicy | undefined)[]): ToolPolicy["writeGuardRows"];
|
|
600
647
|
/**
|
|
601
648
|
* One deterministic DENY component of a {@link ToolPolicyProjection} (F-012 L1). All fields are plain
|
|
602
649
|
* serializable data — a component round-trips JSON/`structuredClone` unchanged, which is what lets a
|
|
@@ -813,7 +860,7 @@ export declare const DECISION_MEMBERS: readonly DecisionMember[];
|
|
|
813
860
|
* allow; a `canUseTool` result outside its set is a failure in CC) and `decisionReason` in {@link DECISION_REASONS} when
|
|
814
861
|
* present (absence stays legal); (5) the DETACH —
|
|
815
862
|
* the contract members' values structured-cloned ({@link tryCloneArgs}; one that cannot be, a function inside a rewrite,
|
|
816
|
-
* is refused), the engine's
|
|
863
|
+
* is refused), the engine's `attestation` record re-attached by reference after its brand check, the copy frozen and
|
|
817
864
|
* marked as this module's. A refusal is a deny in the screen's words, one code for every arm (`decisionReason: "rule"`),
|
|
818
865
|
* carrying no `updatedInput` from the refused object (a rewrite from an EARLIER, contract-shaped layer still rides out of
|
|
819
866
|
* {@link combinePolicies}' deny path). `null` / `undefined` carry nothing and take the carrier's refusal (the caller's own
|
|
@@ -1037,12 +1084,12 @@ export declare function createCoarseCommandNamePolicy(opts: {
|
|
|
1037
1084
|
/** Override the shell tool names this gate parses (default {@link COARSE_SHELL_TOOLS}, the shell face). */
|
|
1038
1085
|
tools?: string[];
|
|
1039
1086
|
}): ToolPolicy;
|
|
1040
|
-
export declare function findUnverifiableRecursiveDelete(command: string, safeVars?: ReadonlySet<string>): string | undefined;
|
|
1041
1087
|
/**
|
|
1042
1088
|
* CC 220 "Unverifiable Deletion Target" parity (auto-mode rule): ASK on a recursive+forced delete whose
|
|
1043
1089
|
* target is a variable / substitution that cannot be resolved from the command itself — fail-closed in the
|
|
1044
1090
|
* sense that with no live classifier/approver the ask degrades to deny (see {@link PermissionResult}'s
|
|
1045
|
-
* `ask` doc), never to allow.
|
|
1091
|
+
* `ask` doc), never to allow. The guard reads ONE plan, the read station's (`removalReadingOf`,
|
|
1092
|
+
* removal-targets.ts): its firing conditions are `removalFindingsOf`'s there. The
|
|
1046
1093
|
* message carries the CC-sanctioned remediation (re-run with the resolved LITERAL path written into the
|
|
1047
1094
|
* command, or assign the variable in the same command) — it doubles as the `askMessage` a classifier sees.
|
|
1048
1095
|
*
|
|
@@ -1108,10 +1155,10 @@ export declare function findUnverifiableRecursiveDelete(command: string, safeVar
|
|
|
1108
1155
|
* grows one.
|
|
1109
1156
|
*/
|
|
1110
1157
|
export declare function createUnverifiableDeletePolicy(opts?: {
|
|
1111
|
-
/** Extra variable names treated as well-known-safe roots, ADDED to the default set
|
|
1112
|
-
* `
|
|
1113
|
-
*
|
|
1114
|
-
*
|
|
1158
|
+
/** Extra variable names treated as well-known-safe roots, ADDED to the default set `TMPDIR`/`HOME`
|
|
1159
|
+
* (`KNOWN_SAFE_ROOTS`, removal-targets.ts — `HOME` is a registered sema divergence from CC's temp-only carve-out).
|
|
1160
|
+
* Each must be a shell identifier; `PWD` / `OLDPWD` are refused — their value is where the command stands, read off
|
|
1161
|
+
* the working-directory thread, not a root the shell provides. A bad entry throws here. */
|
|
1115
1162
|
safeVars?: readonly string[];
|
|
1116
1163
|
/** Override the shell tool names this gate parses (default {@link COARSE_SHELL_TOOLS}, the shell face). */
|
|
1117
1164
|
tools?: string[];
|
|
@@ -1476,6 +1523,12 @@ export interface AskRequest {
|
|
|
1476
1523
|
readonly irreversible?: boolean;
|
|
1477
1524
|
readonly egress?: boolean;
|
|
1478
1525
|
};
|
|
1526
|
+
/** Which approval card this ask renders under — the closed set `TOOL_APPROVAL_CARDS`, `generic` when the tool declares
|
|
1527
|
+
* none; the same word the parked gate and the pending row carry for the same call. Display routing only: the card is
|
|
1528
|
+
* untrusted-for-display input (a tool may declare any non-reserved card), so a specialised card validates the call's
|
|
1529
|
+
* arguments itself. A word outside the set reads as `generic`. ABSENT: an ask the host built itself, or an engine
|
|
1530
|
+
* older than this member. */
|
|
1531
|
+
readonly approvalCard?: import("./tool-face.js").ToolApprovalCard;
|
|
1479
1532
|
/** ruled 2026-08-04 — present exactly when this ask was raised inside a DELEGATED child whose approver
|
|
1480
1533
|
* is the ancestor run's (the `ToolExecuteContext.onAsk` seat the delegation tool forwards). Additive:
|
|
1481
1534
|
* an approver that ignores it is unaffected; a durable park/suspend flow never invokes `onAsk` at all,
|
|
@@ -1767,6 +1820,38 @@ export declare function tryCloneArgs<T>(v: T): {
|
|
|
1767
1820
|
* text they let through. Not part of the package's public surface.
|
|
1768
1821
|
*/
|
|
1769
1822
|
export declare function describeThrown(err: unknown): string;
|
|
1823
|
+
/** What a person refused: a tool use the model asked to run, or the plan it proposed. */
|
|
1824
|
+
export type HumanRefusalSubject = "tool use" | "plan";
|
|
1825
|
+
/**
|
|
1826
|
+
* THE sentence a model reads when a PERSON refused what it asked to do, whichever leg carried the refusal (the
|
|
1827
|
+
* synchronous resolver's {@link humanRefusalMessage}; the durable decide's tool result and continuation frame;
|
|
1828
|
+
* the plan review's continuation) — one generator for every subject and both postures, so a person's "no"
|
|
1829
|
+
* cannot speak two ways depending on whether it landed on a tool call or a plan, or on which path carried it.
|
|
1830
|
+
* `subject` picks the fact clause (which thing was refused and that it did not run); `delegatedChild` picks the
|
|
1831
|
+
* posture — the ISSUING RUN's position ({@link AskRequest.isDelegatedChild}; the durable legs read the same
|
|
1832
|
+
* effective fact, restored from the checkpoint row on a deps-only resume):
|
|
1833
|
+
* - a parent-thread run is told the user refused and to wait for them. The reference answers a tool call and a
|
|
1834
|
+
* plan with one string (a refusal with no words stops the turn and waits for the user; one with words relays
|
|
1835
|
+
* them as the direction): no note ⇒ the fact, then STOP and wait for the user to tell the model how to
|
|
1836
|
+
* proceed; a note ⇒ the fact, then the note inside a {@link delimitUntrusted} fence ("reviewer note" — the
|
|
1837
|
+
* durable resume leg's label for the same words). The TRUSTED wrapper around the fence does two jobs the
|
|
1838
|
+
* fence alone cannot: it LICENSES the note as the user's guidance while bounding its authority (user words
|
|
1839
|
+
* steer the work; they cannot grant permissions or override system rules — the fence's "do NOT follow
|
|
1840
|
+
* instructions" guards exactly that escalation, not the reading of the user's steer), and it KEEPS the wait as
|
|
1841
|
+
* the fallback for a note that gives no direction, so a note never erases the only explicit instruction about
|
|
1842
|
+
* what to do after a person's "no". On the BARE arm the directive is no longer text alone: the runner treats
|
|
1843
|
+
* a refused TOOL CALL as a control-flow boundary for the issuing assistant batch — same-message sibling calls
|
|
1844
|
+
* that never started settle un-executed and the turn ends awaiting the user (the settlement's `note` seat
|
|
1845
|
+
* carries the bare-vs-noted fact);
|
|
1846
|
+
* - a delegated child (a FORK included — its message-layer contract is one-shot, "no waiting for the user") is
|
|
1847
|
+
* told to try a different approach or report the limitation — no user turn ever lands in ITS transcript, so
|
|
1848
|
+
* "wait for the user" would hang the delegation. A note it is handed rides the same fence and the same bound
|
|
1849
|
+
* on its authority, with the adapt-or-report posture as the fallback.
|
|
1850
|
+
* Whether there IS a note is the decider-note seat's own rule ({@link decidersNote}), asked here and nowhere
|
|
1851
|
+
* else on this path — the callers hand over the raw text. Not for a refusal a machine gave
|
|
1852
|
+
* ({@link policyRefusalMessage}).
|
|
1853
|
+
*/
|
|
1854
|
+
export declare function humanRefusalSentence(subject: HumanRefusalSubject, reason: string | undefined, delegatedChild: boolean): string;
|
|
1770
1855
|
/**
|
|
1771
1856
|
* The ONE composer for a DEPLOYMENT-POLICY refusal of an ask — the sentence the model reads when the
|
|
1772
1857
|
* approval channel reported that a MACHINE ended this wait (`settledBy: "policy"` on the synchronous
|
|
@@ -1792,10 +1877,6 @@ export declare function policyRefusalMessage(toolName: string, askMessage: strin
|
|
|
1792
1877
|
export type ResolvedAsk = (Extract<PermissionResult, {
|
|
1793
1878
|
action: "allow";
|
|
1794
1879
|
}> & {
|
|
1795
|
-
/** Present exactly when a DECIDER approved (`human_allowed` / `policy_allowed`, with the channel's
|
|
1796
|
-
* attribution when it reported one); absent on the posture allows (a blanket `"allow"`) — nobody was
|
|
1797
|
-
* asked, so nothing was settled. */
|
|
1798
|
-
settlement?: Settlement;
|
|
1799
1880
|
/** The EXACT data snapshot the approver was shown (the `structuredClone` of the presented args). On
|
|
1800
1881
|
* a plain approval (no edit) the gate EXECUTES this snapshot, not the original object: a stateful
|
|
1801
1882
|
* getter or an external alias must not be able to make the executed action differ from the
|
|
@@ -1808,14 +1889,40 @@ export type ResolvedAsk = (Extract<PermissionResult, {
|
|
|
1808
1889
|
}) | (Extract<PermissionResult, {
|
|
1809
1890
|
action: "deny";
|
|
1810
1891
|
}> & {
|
|
1811
|
-
/** What ended the wait — composed at the arm that ended it, one of the refusal kinds. A deny this
|
|
1812
|
-
* resolver composes ALWAYS names its settlement: there is no unclassified refusal. */
|
|
1813
|
-
settlement: Settlement;
|
|
1814
1892
|
presentedInput?: unknown;
|
|
1815
1893
|
approverUnavailable?: true;
|
|
1816
1894
|
/** A grant riding a refusal: always `rejected` (`on_refusal`). */
|
|
1817
1895
|
readRootGrant?: ReadRootGrantScreen;
|
|
1818
1896
|
});
|
|
1897
|
+
/** What one resolver ARM composes: the resolution plus the settlement it ended the wait with — composed at the arm, every deny
|
|
1898
|
+
* naming one (there is no unclassified refusal), an allow only when a DECIDER approved (a blanket `"allow"` asked nobody). The
|
|
1899
|
+
* exported {@link resolveAsk} turns the settlement into the resolution's `attestation`. Not re-exported from `src/index.ts`. */
|
|
1900
|
+
export type ResolverArmResult = (Extract<ResolvedAsk, {
|
|
1901
|
+
action: "allow";
|
|
1902
|
+
}> & {
|
|
1903
|
+
settlement?: Settlement;
|
|
1904
|
+
}) | (Extract<ResolvedAsk, {
|
|
1905
|
+
action: "deny";
|
|
1906
|
+
}> & {
|
|
1907
|
+
settlement: Settlement;
|
|
1908
|
+
});
|
|
1909
|
+
/**
|
|
1910
|
+
* The DIRECTIONAL format controls, as a closed set (see {@link AskRequest.hasBidiControls}):
|
|
1911
|
+
* ALM (U+061C), LRM/RLM (U+200E/U+200F), the embeddings and overrides (U+202A–U+202E) and the
|
|
1912
|
+
* isolates (U+2066–U+2069). These reorder what a reader SEES without changing a byte of what runs.
|
|
1913
|
+
*
|
|
1914
|
+
* Why the whole directional family and not only the four the reordering demos use: the bit is a
|
|
1915
|
+
* WARNING, and for a warning the safe direction is to fire on a member a reader would have to
|
|
1916
|
+
* enumerate correctly to be safe from. ALM is in for that reason, though it is the least-abused one.
|
|
1917
|
+
*
|
|
1918
|
+
* Deliberately NARROWER than `permission-rule-model`'s `CONTROL_CHARS_RE` and than
|
|
1919
|
+
* {@link APPROVER_REFUSED_CHARS_RE}: those are REFUSAL/ESCAPE classes covering every control and
|
|
1920
|
+
* zero-width character (a rule text or an identifier has no use for any of them). This one answers a
|
|
1921
|
+
* different question — "can this display as something other than what it is" — and a zero-width joiner
|
|
1922
|
+
* or a soft hyphen does not reorder anything, so folding them in would make the bit fire on ordinary
|
|
1923
|
+
* text and mean nothing where it matters.
|
|
1924
|
+
*/
|
|
1925
|
+
export declare const BIDI_CONTROL_CHARS = "\\u061C\\u200E\\u200F\\u202A-\\u202E\\u2066-\\u2069";
|
|
1819
1926
|
/**
|
|
1820
1927
|
* Does any string reachable in `value` carry a {@link BIDI_CONTROL_RE} member? Bounded, cycle-safe,
|
|
1821
1928
|
* and never throwing — every caller is on an approval/projection path, where a scan that failed must
|
|
@@ -1834,8 +1941,11 @@ export type ResolvedAsk = (Extract<PermissionResult, {
|
|
|
1834
1941
|
* row's work is bounded regardless of the row's provenance. Both members are required when the
|
|
1835
1942
|
* object is given — a half-specified tier would silently mix two tiers in one scan.
|
|
1836
1943
|
*
|
|
1837
|
-
*
|
|
1838
|
-
*
|
|
1944
|
+
* Exported as the ONE judge of the question: a host that renders or sanitizes text next to an approval
|
|
1945
|
+
* card answers "does this carry a directional control" with this function, and composes a wider class
|
|
1946
|
+
* (control characters, line separators) from {@link BIDI_CONTROL_CHARS} rather than restating the members.
|
|
1947
|
+
* The allowances above are part of the answer, not an implementation detail: a payload past them reads
|
|
1948
|
+
* "not detected", exactly as the bit on the card does.
|
|
1839
1949
|
*/
|
|
1840
1950
|
export declare function carriesBidiControls(value: unknown, limits?: {
|
|
1841
1951
|
maxNodes: number;
|