@namzu/sdk 65.3.0 → 68.0.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 +167 -0
- package/dist/account/lock.d.ts +4 -12
- package/dist/account/lock.d.ts.map +1 -1
- package/dist/account/lock.js +5 -140
- package/dist/account/lock.js.map +1 -1
- package/dist/account/registry.d.ts.map +1 -1
- package/dist/account/registry.js +50 -6
- package/dist/account/registry.js.map +1 -1
- package/dist/account/types.d.ts +7 -5
- package/dist/account/types.d.ts.map +1 -1
- package/dist/account/types.js +6 -7
- package/dist/account/types.js.map +1 -1
- package/dist/authorization/dangerous-commands.d.ts +64 -0
- package/dist/authorization/dangerous-commands.d.ts.map +1 -0
- package/dist/authorization/dangerous-commands.js +479 -0
- package/dist/authorization/dangerous-commands.js.map +1 -0
- package/dist/authorization/gate.d.ts.map +1 -1
- package/dist/authorization/gate.js +19 -5
- package/dist/authorization/gate.js.map +1 -1
- package/dist/authorization/protected-paths.d.ts +11 -6
- package/dist/authorization/protected-paths.d.ts.map +1 -1
- package/dist/authorization/protected-paths.js +13 -8
- package/dist/authorization/protected-paths.js.map +1 -1
- package/dist/authorization/readonly-commands.d.ts +6 -1
- package/dist/authorization/readonly-commands.d.ts.map +1 -1
- package/dist/authorization/readonly-commands.js +35 -1
- package/dist/authorization/readonly-commands.js.map +1 -1
- package/dist/authorization/removal.d.ts +10 -0
- package/dist/authorization/removal.d.ts.map +1 -1
- package/dist/authorization/removal.js +7 -7
- package/dist/authorization/removal.js.map +1 -1
- package/dist/authorization/rules.d.ts +10 -0
- package/dist/authorization/rules.d.ts.map +1 -1
- package/dist/authorization/rules.js +60 -14
- package/dist/authorization/rules.js.map +1 -1
- package/dist/authorization/shell-lexer.d.ts +10 -0
- package/dist/authorization/shell-lexer.d.ts.map +1 -1
- package/dist/authorization/shell-lexer.js +15 -0
- package/dist/authorization/shell-lexer.js.map +1 -1
- package/dist/bridge/acp/permission.d.ts +5 -0
- package/dist/bridge/acp/permission.d.ts.map +1 -1
- package/dist/bridge/acp/permission.js.map +1 -1
- package/dist/bridge/acp/server.d.ts +8 -1
- package/dist/bridge/acp/server.d.ts.map +1 -1
- package/dist/bridge/acp/server.js +48 -6
- package/dist/bridge/acp/server.js.map +1 -1
- package/dist/compaction/context-breakdown.d.ts +25 -6
- package/dist/compaction/context-breakdown.d.ts.map +1 -1
- package/dist/compaction/context-breakdown.js +27 -7
- package/dist/compaction/context-breakdown.js.map +1 -1
- package/dist/compaction/dangling.d.ts.map +1 -1
- package/dist/compaction/dangling.js +2 -0
- package/dist/compaction/dangling.js.map +1 -1
- package/dist/compaction/extractor.d.ts +7 -1
- package/dist/compaction/extractor.d.ts.map +1 -1
- package/dist/compaction/extractor.js +8 -1
- package/dist/compaction/extractor.js.map +1 -1
- package/dist/compaction/index.d.ts +1 -1
- package/dist/compaction/index.d.ts.map +1 -1
- package/dist/compaction/index.js +1 -1
- package/dist/compaction/index.js.map +1 -1
- package/dist/compaction/managers/structured.js +2 -2
- package/dist/compaction/managers/structured.js.map +1 -1
- package/dist/compaction/manual.d.ts.map +1 -1
- package/dist/compaction/manual.js +11 -6
- package/dist/compaction/manual.js.map +1 -1
- package/dist/compaction/model-summary.d.ts.map +1 -1
- package/dist/compaction/model-summary.js +7 -1
- package/dist/compaction/model-summary.js.map +1 -1
- package/dist/compaction/summary.d.ts +13 -2
- package/dist/compaction/summary.d.ts.map +1 -1
- package/dist/compaction/summary.js +46 -3
- package/dist/compaction/summary.js.map +1 -1
- package/dist/constants/tools/index.d.ts +18 -1
- package/dist/constants/tools/index.d.ts.map +1 -1
- package/dist/constants/tools/index.js +28 -16
- package/dist/constants/tools/index.js.map +1 -1
- package/dist/manager/session/turn-recorder.d.ts +6 -0
- package/dist/manager/session/turn-recorder.d.ts.map +1 -1
- package/dist/manager/session/turn-recorder.js +29 -1
- package/dist/manager/session/turn-recorder.js.map +1 -1
- package/dist/network/audit.d.ts +49 -0
- package/dist/network/audit.d.ts.map +1 -0
- package/dist/network/audit.js +84 -0
- package/dist/network/audit.js.map +1 -0
- package/dist/network/clock.d.ts +21 -0
- package/dist/network/clock.d.ts.map +1 -0
- package/dist/network/clock.js +51 -0
- package/dist/network/clock.js.map +1 -0
- package/dist/network/discovery-mdns.d.ts +120 -0
- package/dist/network/discovery-mdns.d.ts.map +1 -0
- package/dist/network/discovery-mdns.js +442 -0
- package/dist/network/discovery-mdns.js.map +1 -0
- package/dist/network/discovery.d.ts +63 -0
- package/dist/network/discovery.d.ts.map +1 -0
- package/dist/network/discovery.js +163 -0
- package/dist/network/discovery.js.map +1 -0
- package/dist/network/fingerprint.d.ts +73 -0
- package/dist/network/fingerprint.d.ts.map +1 -0
- package/dist/network/fingerprint.js +208 -0
- package/dist/network/fingerprint.js.map +1 -0
- package/dist/network/identity.d.ts +38 -0
- package/dist/network/identity.d.ts.map +1 -0
- package/dist/network/identity.js +71 -0
- package/dist/network/identity.js.map +1 -0
- package/dist/network/index.d.ts +39 -0
- package/dist/network/index.d.ts.map +1 -0
- package/dist/network/index.js +25 -0
- package/dist/network/index.js.map +1 -0
- package/dist/network/join.d.ts +69 -0
- package/dist/network/join.d.ts.map +1 -0
- package/dist/network/join.js +136 -0
- package/dist/network/join.js.map +1 -0
- package/dist/network/mail-policy.d.ts +97 -0
- package/dist/network/mail-policy.d.ts.map +1 -0
- package/dist/network/mail-policy.js +147 -0
- package/dist/network/mail-policy.js.map +1 -0
- package/dist/network/membership.d.ts +76 -0
- package/dist/network/membership.d.ts.map +1 -0
- package/dist/network/membership.js +225 -0
- package/dist/network/membership.js.map +1 -0
- package/dist/network/roster.d.ts +59 -0
- package/dist/network/roster.d.ts.map +1 -0
- package/dist/network/roster.js +120 -0
- package/dist/network/roster.js.map +1 -0
- package/dist/network/service.d.ts +303 -0
- package/dist/network/service.d.ts.map +1 -0
- package/dist/network/service.js +1891 -0
- package/dist/network/service.js.map +1 -0
- package/dist/network/store.d.ts +141 -0
- package/dist/network/store.d.ts.map +1 -0
- package/dist/network/store.js +198 -0
- package/dist/network/store.js.map +1 -0
- package/dist/network/transport.d.ts +96 -0
- package/dist/network/transport.d.ts.map +1 -0
- package/dist/network/transport.js +342 -0
- package/dist/network/transport.js.map +1 -0
- package/dist/network/wire.d.ts +345 -0
- package/dist/network/wire.d.ts.map +1 -0
- package/dist/network/wire.js +212 -0
- package/dist/network/wire.js.map +1 -0
- package/dist/network/x509.d.ts +28 -0
- package/dist/network/x509.d.ts.map +1 -0
- package/dist/network/x509.js +84 -0
- package/dist/network/x509.js.map +1 -0
- package/dist/pals/activity/causality.d.ts.map +1 -1
- package/dist/pals/activity/causality.js +14 -2
- package/dist/pals/activity/causality.js.map +1 -1
- package/dist/peers/endpoint.d.ts.map +1 -1
- package/dist/peers/endpoint.js +6 -0
- package/dist/peers/endpoint.js.map +1 -1
- package/dist/peers/envelope.d.ts +18 -0
- package/dist/peers/envelope.d.ts.map +1 -1
- package/dist/peers/envelope.js +68 -5
- package/dist/peers/envelope.js.map +1 -1
- package/dist/peers/index.d.ts +5 -4
- package/dist/peers/index.d.ts.map +1 -1
- package/dist/peers/index.js +3 -2
- package/dist/peers/index.js.map +1 -1
- package/dist/peers/mode-word.d.ts +10 -0
- package/dist/peers/mode-word.d.ts.map +1 -0
- package/dist/peers/mode-word.js +19 -0
- package/dist/peers/mode-word.js.map +1 -0
- package/dist/peers/protocol.d.ts +42 -0
- package/dist/peers/protocol.d.ts.map +1 -1
- package/dist/peers/protocol.js +22 -1
- package/dist/peers/protocol.js.map +1 -1
- package/dist/peers/record.d.ts +8 -0
- package/dist/peers/record.d.ts.map +1 -1
- package/dist/peers/record.js +5 -0
- package/dist/peers/record.js.map +1 -1
- package/dist/plugin/session-hook-env.d.ts.map +1 -1
- package/dist/plugin/session-hook-env.js +22 -2
- package/dist/plugin/session-hook-env.js.map +1 -1
- package/dist/plugin/shell-hook.d.ts +16 -2
- package/dist/plugin/shell-hook.d.ts.map +1 -1
- package/dist/plugin/shell-hook.js +183 -14
- package/dist/plugin/shell-hook.js.map +1 -1
- package/dist/pricing/catalogue.generated.d.ts.map +1 -1
- package/dist/pricing/catalogue.generated.js +6 -0
- package/dist/pricing/catalogue.generated.js.map +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts +4 -2
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
- package/dist/prompt/coding-agent-doctrine.js +33 -38
- package/dist/prompt/coding-agent-doctrine.js.map +1 -1
- package/dist/provider/fallback.d.ts.map +1 -1
- package/dist/provider/fallback.js +12 -0
- package/dist/provider/fallback.js.map +1 -1
- package/dist/provider/idle-timeout.d.ts.map +1 -1
- package/dist/provider/idle-timeout.js +5 -0
- package/dist/provider/idle-timeout.js.map +1 -1
- package/dist/provider/model-window-suffix.d.ts.map +1 -1
- package/dist/provider/model-window-suffix.js +1 -0
- package/dist/provider/model-window-suffix.js.map +1 -1
- package/dist/provider/retry.d.ts.map +1 -1
- package/dist/provider/retry.js +5 -0
- package/dist/provider/retry.js.map +1 -1
- package/dist/public-runtime.d.ts +16 -8
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +24 -7
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +3 -2
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +2 -2
- package/dist/public-tools.js.map +1 -1
- package/dist/public-types.d.ts +10 -5
- package/dist/public-types.d.ts.map +1 -1
- package/dist/registry/command/kernel-commands.d.ts +11 -1
- package/dist/registry/command/kernel-commands.d.ts.map +1 -1
- package/dist/registry/command/kernel-commands.js +114 -46
- package/dist/registry/command/kernel-commands.js.map +1 -1
- package/dist/runtime/jobs/registry.d.ts +29 -1
- package/dist/runtime/jobs/registry.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.js +64 -0
- package/dist/runtime/jobs/registry.js.map +1 -1
- package/dist/runtime/query/auto-review/classifier.d.ts +30 -6
- package/dist/runtime/query/auto-review/classifier.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/classifier.js +40 -12
- package/dist/runtime/query/auto-review/classifier.js.map +1 -1
- package/dist/runtime/query/auto-review/feedback.d.ts +37 -0
- package/dist/runtime/query/auto-review/feedback.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/feedback.js +45 -0
- package/dist/runtime/query/auto-review/feedback.js.map +1 -0
- package/dist/runtime/query/auto-review/git-status.d.ts +59 -0
- package/dist/runtime/query/auto-review/git-status.d.ts.map +1 -0
- package/dist/runtime/query/auto-review/git-status.js +379 -0
- package/dist/runtime/query/auto-review/git-status.js.map +1 -0
- package/dist/runtime/query/auto-review/index.d.ts +3 -3
- package/dist/runtime/query/auto-review/index.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/index.js +2 -2
- package/dist/runtime/query/auto-review/index.js.map +1 -1
- package/dist/runtime/query/auto-review/prompt.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/prompt.js +6 -1
- package/dist/runtime/query/auto-review/prompt.js.map +1 -1
- package/dist/runtime/query/auto-review/transcript.d.ts +14 -1
- package/dist/runtime/query/auto-review/transcript.d.ts.map +1 -1
- package/dist/runtime/query/auto-review/transcript.js +48 -2
- package/dist/runtime/query/auto-review/transcript.js.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
- package/dist/runtime/query/executor/tool-call-admission.js +40 -3
- package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +32 -10
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +78 -17
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts +9 -0
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +54 -17
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/index.d.ts +1 -1
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +20 -6
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/compaction.js +5 -2
- package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js +5 -0
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/per-call-review.d.ts +1 -2
- package/dist/runtime/query/iteration/phases/per-call-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/per-call-review.js +2 -5
- package/dist/runtime/query/iteration/phases/per-call-review.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +6 -1
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/pasted-frames.d.ts +34 -0
- package/dist/runtime/query/pasted-frames.d.ts.map +1 -0
- package/dist/runtime/query/pasted-frames.js +108 -0
- package/dist/runtime/query/pasted-frames.js.map +1 -0
- package/dist/runtime/query/path-escalation.d.ts +6 -0
- package/dist/runtime/query/path-escalation.d.ts.map +1 -1
- package/dist/runtime/query/path-escalation.js +15 -3
- package/dist/runtime/query/path-escalation.js.map +1 -1
- package/dist/runtime/query/request-interrupted-turns.d.ts +20 -0
- package/dist/runtime/query/request-interrupted-turns.d.ts.map +1 -0
- package/dist/runtime/query/request-interrupted-turns.js +43 -0
- package/dist/runtime/query/request-interrupted-turns.js.map +1 -0
- package/dist/runtime/query/review-policy.d.ts +16 -6
- package/dist/runtime/query/review-policy.d.ts.map +1 -1
- package/dist/runtime/query/review-policy.js +111 -15
- package/dist/runtime/query/review-policy.js.map +1 -1
- package/dist/runtime/query/turn/outcome-ledger.d.ts +9 -0
- package/dist/runtime/query/turn/outcome-ledger.d.ts.map +1 -1
- package/dist/runtime/query/turn/outcome-ledger.js +94 -6
- package/dist/runtime/query/turn/outcome-ledger.js.map +1 -1
- package/dist/runtime/query/unanswered.d.ts +19 -0
- package/dist/runtime/query/unanswered.d.ts.map +1 -0
- package/dist/runtime/query/unanswered.js +25 -0
- package/dist/runtime/query/unanswered.js.map +1 -0
- package/dist/runtime/system-events.d.ts +4 -4
- package/dist/runtime/system-events.d.ts.map +1 -1
- package/dist/runtime/system-events.js +2 -0
- package/dist/runtime/system-events.js.map +1 -1
- package/dist/session/workspace/git-worktree.d.ts +8 -0
- package/dist/session/workspace/git-worktree.d.ts.map +1 -1
- package/dist/session/workspace/git-worktree.js +21 -3
- package/dist/session/workspace/git-worktree.js.map +1 -1
- package/dist/store/evidence/source-kind.d.ts +1 -1
- package/dist/store/evidence/source-kind.d.ts.map +1 -1
- package/dist/store/evidence/source-kind.js +1 -1
- package/dist/store/evidence/source-kind.js.map +1 -1
- package/dist/store/goal/index.d.ts +53 -3
- package/dist/store/goal/index.d.ts.map +1 -1
- package/dist/store/goal/index.js +245 -9
- package/dist/store/goal/index.js.map +1 -1
- package/dist/store/session-index/sqlite.d.ts.map +1 -1
- package/dist/store/session-index/sqlite.js +42 -3
- package/dist/store/session-index/sqlite.js.map +1 -1
- package/dist/store/session-log/disk.js +1 -1
- package/dist/store/session-log/disk.js.map +1 -1
- package/dist/store/session-log/lease.d.ts.map +1 -1
- package/dist/store/session-log/lease.js +3 -2
- package/dist/store/session-log/lease.js.map +1 -1
- package/dist/tools/admit-facts.d.ts.map +1 -1
- package/dist/tools/admit-facts.js +2 -0
- package/dist/tools/admit-facts.js.map +1 -1
- package/dist/tools/builtins/bash.d.ts +10 -2
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +56 -17
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/browser-local.d.ts +117 -0
- package/dist/tools/builtins/browser-local.d.ts.map +1 -0
- package/dist/tools/builtins/browser-local.js +437 -0
- package/dist/tools/builtins/browser-local.js.map +1 -0
- package/dist/tools/builtins/browser.d.ts +18 -1
- package/dist/tools/builtins/browser.d.ts.map +1 -1
- package/dist/tools/builtins/browser.js +84 -6
- package/dist/tools/builtins/browser.js.map +1 -1
- package/dist/tools/builtins/computer-use-window-id.d.ts +16 -0
- package/dist/tools/builtins/computer-use-window-id.d.ts.map +1 -0
- package/dist/tools/builtins/computer-use-window-id.js +52 -0
- package/dist/tools/builtins/computer-use-window-id.js.map +1 -0
- package/dist/tools/builtins/computer-use.d.ts +65 -7
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js +384 -71
- package/dist/tools/builtins/computer-use.js.map +1 -1
- package/dist/tools/builtins/content-fingerprint.d.ts +6 -0
- package/dist/tools/builtins/content-fingerprint.d.ts.map +1 -1
- package/dist/tools/builtins/content-fingerprint.js +7 -1
- package/dist/tools/builtins/content-fingerprint.js.map +1 -1
- package/dist/tools/builtins/edit.d.ts.map +1 -1
- package/dist/tools/builtins/edit.js +89 -7
- package/dist/tools/builtins/edit.js.map +1 -1
- package/dist/tools/builtins/file-write-result.d.ts.map +1 -1
- package/dist/tools/builtins/file-write-result.js +2 -1
- package/dist/tools/builtins/file-write-result.js.map +1 -1
- package/dist/tools/builtins/grep.js +1 -1
- package/dist/tools/builtins/grep.js.map +1 -1
- package/dist/tools/builtins/job.d.ts.map +1 -1
- package/dist/tools/builtins/job.js +4 -2
- package/dist/tools/builtins/job.js.map +1 -1
- package/dist/tools/builtins/monitor.d.ts.map +1 -1
- package/dist/tools/builtins/monitor.js +6 -1
- package/dist/tools/builtins/monitor.js.map +1 -1
- package/dist/tools/builtins/search-tools.d.ts +12 -1
- package/dist/tools/builtins/search-tools.d.ts.map +1 -1
- package/dist/tools/builtins/search-tools.js +166 -20
- package/dist/tools/builtins/search-tools.js.map +1 -1
- package/dist/tools/builtins/shell-read-credit.d.ts +18 -6
- package/dist/tools/builtins/shell-read-credit.d.ts.map +1 -1
- package/dist/tools/builtins/shell-read-credit.js +95 -27
- package/dist/tools/builtins/shell-read-credit.js.map +1 -1
- package/dist/tools/builtins/wait-for-job.d.ts.map +1 -1
- package/dist/tools/builtins/wait-for-job.js +14 -3
- package/dist/tools/builtins/wait-for-job.js.map +1 -1
- package/dist/tools/builtins/web-guidance.d.ts +6 -0
- package/dist/tools/builtins/web-guidance.d.ts.map +1 -1
- package/dist/tools/builtins/web-guidance.js +6 -0
- package/dist/tools/builtins/web-guidance.js.map +1 -1
- package/dist/tools/builtins/web.d.ts.map +1 -1
- package/dist/tools/builtins/web.js +2 -1
- package/dist/tools/builtins/web.js.map +1 -1
- package/dist/tools/builtins/write-file.d.ts.map +1 -1
- package/dist/tools/builtins/write-file.js +32 -2
- package/dist/tools/builtins/write-file.js.map +1 -1
- package/dist/tools/command-shell.d.ts +1 -1
- package/dist/tools/command-shell.d.ts.map +1 -1
- package/dist/tools/command-shell.js +6 -8
- package/dist/tools/command-shell.js.map +1 -1
- package/dist/tools/defineTool.d.ts +2 -0
- package/dist/tools/defineTool.d.ts.map +1 -1
- package/dist/tools/defineTool.js +17 -1
- package/dist/tools/defineTool.js.map +1 -1
- package/dist/tools/goal/confirmation.d.ts +82 -1
- package/dist/tools/goal/confirmation.d.ts.map +1 -1
- package/dist/tools/goal/confirmation.js +153 -3
- package/dist/tools/goal/confirmation.js.map +1 -1
- package/dist/tools/goal/index.d.ts.map +1 -1
- package/dist/tools/goal/index.js +34 -3
- package/dist/tools/goal/index.js.map +1 -1
- package/dist/tools/schedules/index.d.ts +1 -0
- package/dist/tools/schedules/index.d.ts.map +1 -1
- package/dist/tools/schedules/index.js +1 -0
- package/dist/tools/schedules/index.js.map +1 -1
- package/dist/tools/schedules/loop-tool.d.ts.map +1 -1
- package/dist/tools/schedules/loop-tool.js +8 -6
- package/dist/tools/schedules/loop-tool.js.map +1 -1
- package/dist/tools/schedules/present.js +1 -1
- package/dist/tools/schedules/present.js.map +1 -1
- package/dist/tools/schedules/timer-tools.d.ts +36 -0
- package/dist/tools/schedules/timer-tools.d.ts.map +1 -0
- package/dist/tools/schedules/timer-tools.js +234 -0
- package/dist/tools/schedules/timer-tools.js.map +1 -0
- package/dist/tools/schedules/types.d.ts +68 -3
- package/dist/tools/schedules/types.d.ts.map +1 -1
- package/dist/tools/task/create.d.ts.map +1 -1
- package/dist/tools/task/create.js +2 -0
- package/dist/tools/task/create.js.map +1 -1
- package/dist/toolsets/manager.d.ts +49 -7
- package/dist/toolsets/manager.d.ts.map +1 -1
- package/dist/toolsets/manager.js +239 -40
- package/dist/toolsets/manager.js.map +1 -1
- package/dist/turn/evidence-query.d.ts +18 -1
- package/dist/turn/evidence-query.d.ts.map +1 -1
- package/dist/turn/evidence-query.js +177 -35
- package/dist/turn/evidence-query.js.map +1 -1
- package/dist/turn/evidence-recall.d.ts +8 -1
- package/dist/turn/evidence-recall.d.ts.map +1 -1
- package/dist/turn/evidence-recall.js +82 -22
- package/dist/turn/evidence-recall.js.map +1 -1
- package/dist/turn/history-shed.d.ts +15 -0
- package/dist/turn/history-shed.d.ts.map +1 -0
- package/dist/turn/history-shed.js +23 -0
- package/dist/turn/history-shed.js.map +1 -0
- package/dist/types/acp/index.d.ts +26 -0
- package/dist/types/acp/index.d.ts.map +1 -1
- package/dist/types/authorization/index.d.ts +9 -1
- package/dist/types/authorization/index.d.ts.map +1 -1
- package/dist/types/authorization/index.js +11 -2
- package/dist/types/authorization/index.js.map +1 -1
- package/dist/types/command/index.d.ts +26 -2
- package/dist/types/command/index.d.ts.map +1 -1
- package/dist/types/command/index.js +5 -2
- package/dist/types/command/index.js.map +1 -1
- package/dist/types/common/index.d.ts +4 -2
- package/dist/types/common/index.d.ts.map +1 -1
- package/dist/types/common/index.js.map +1 -1
- package/dist/types/goal/index.d.ts +59 -0
- package/dist/types/goal/index.d.ts.map +1 -1
- package/dist/types/hitl/index.d.ts +10 -0
- package/dist/types/hitl/index.d.ts.map +1 -1
- package/dist/types/hitl/index.js.map +1 -1
- package/dist/types/message/index.d.ts +56 -1
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js +2 -1
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/permission/index.d.ts +14 -0
- package/dist/types/permission/index.d.ts.map +1 -1
- package/dist/types/permission/index.js +14 -0
- package/dist/types/permission/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +148 -1
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js +9 -0
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/provider/chat.d.ts +10 -5
- package/dist/types/provider/chat.d.ts.map +1 -1
- package/dist/types/provider/index.d.ts +1 -0
- package/dist/types/provider/index.d.ts.map +1 -1
- package/dist/types/provider/interface.d.ts +19 -0
- package/dist/types/provider/interface.d.ts.map +1 -1
- package/dist/types/provider/limits.d.ts +33 -0
- package/dist/types/provider/limits.d.ts.map +1 -0
- package/dist/types/provider/limits.js +7 -0
- package/dist/types/provider/limits.js.map +1 -0
- package/dist/types/provider/model.d.ts +5 -0
- package/dist/types/provider/model.d.ts.map +1 -1
- package/dist/types/session/config.d.ts +2 -2
- package/dist/types/session/outcome.d.ts +5 -2
- package/dist/types/session/outcome.d.ts.map +1 -1
- package/dist/types/session/outcome.js.map +1 -1
- package/dist/types/tool/index.d.ts +30 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/dist/types/tool/presentation.d.ts +4 -0
- package/dist/types/tool/presentation.d.ts.map +1 -1
- package/dist/utils/cost.d.ts +1 -1
- package/dist/utils/cost.d.ts.map +1 -1
- package/dist/utils/cost.js +14 -5
- package/dist/utils/cost.js.map +1 -1
- package/dist/utils/file-lock.d.ts +88 -0
- package/dist/utils/file-lock.d.ts.map +1 -0
- package/dist/utils/file-lock.js +281 -0
- package/dist/utils/file-lock.js.map +1 -0
- package/dist/utils/state-backup.d.ts +87 -0
- package/dist/utils/state-backup.d.ts.map +1 -0
- package/dist/utils/state-backup.js +272 -0
- package/dist/utils/state-backup.js.map +1 -0
- package/dist/utils/temp-sweep.d.ts +66 -0
- package/dist/utils/temp-sweep.d.ts.map +1 -0
- package/dist/utils/temp-sweep.js +311 -0
- package/dist/utils/temp-sweep.js.map +1 -0
- package/dist/utils/temp.d.ts +14 -0
- package/dist/utils/temp.d.ts.map +1 -1
- package/dist/utils/temp.js +70 -2
- package/dist/utils/temp.js.map +1 -1
- package/package.json +1 -1
- package/src/account/lock.ts +13 -133
- package/src/account/registry.ts +75 -21
- package/src/account/types.ts +8 -9
- package/src/authorization/dangerous-commands.ts +542 -0
- package/src/authorization/gate.ts +19 -5
- package/src/authorization/protected-paths.ts +13 -8
- package/src/authorization/readonly-commands.ts +35 -1
- package/src/authorization/removal.ts +7 -7
- package/src/authorization/rules.ts +75 -15
- package/src/authorization/shell-lexer.ts +19 -0
- package/src/bridge/acp/permission.ts +2 -0
- package/src/bridge/acp/server.ts +66 -6
- package/src/compaction/context-breakdown.ts +53 -11
- package/src/compaction/dangling.ts +2 -0
- package/src/compaction/extractor.ts +9 -1
- package/src/compaction/index.ts +1 -0
- package/src/compaction/managers/structured.ts +2 -2
- package/src/compaction/manual.ts +11 -3
- package/src/compaction/model-summary.ts +8 -1
- package/src/compaction/summary.ts +54 -7
- package/src/constants/tools/index.ts +30 -16
- package/src/manager/session/turn-recorder.ts +37 -1
- package/src/network/audit.ts +113 -0
- package/src/network/clock.ts +62 -0
- package/src/network/discovery-mdns.ts +485 -0
- package/src/network/discovery.ts +210 -0
- package/src/network/fingerprint.ts +241 -0
- package/src/network/identity.ts +98 -0
- package/src/network/index.ts +134 -0
- package/src/network/join.ts +177 -0
- package/src/network/mail-policy.ts +199 -0
- package/src/network/membership.ts +290 -0
- package/src/network/roster.ts +165 -0
- package/src/network/service.ts +2304 -0
- package/src/network/store.ts +261 -0
- package/src/network/transport.ts +445 -0
- package/src/network/wire.ts +250 -0
- package/src/network/x509.ts +114 -0
- package/src/pals/activity/causality.ts +16 -2
- package/src/peers/endpoint.ts +6 -0
- package/src/peers/envelope.ts +82 -5
- package/src/peers/index.ts +10 -2
- package/src/peers/mode-word.ts +18 -0
- package/src/peers/protocol.ts +24 -1
- package/src/peers/record.ts +5 -0
- package/src/plugin/session-hook-env.ts +25 -2
- package/src/plugin/shell-hook.ts +208 -14
- package/src/pricing/catalogue.generated.ts +6 -0
- package/src/pricing/rates.source.json +13 -7
- package/src/prompt/coding-agent-doctrine.ts +33 -38
- package/src/provider/fallback.ts +11 -0
- package/src/provider/idle-timeout.ts +5 -0
- package/src/provider/model-window-suffix.ts +1 -0
- package/src/provider/retry.ts +5 -0
- package/src/public-runtime.ts +116 -1
- package/src/public-tools.ts +11 -0
- package/src/public-types.ts +74 -1
- package/src/registry/command/kernel-commands.ts +136 -49
- package/src/runtime/jobs/registry.ts +93 -3
- package/src/runtime/query/auto-review/classifier.ts +76 -14
- package/src/runtime/query/auto-review/feedback.ts +50 -0
- package/src/runtime/query/auto-review/git-status.ts +437 -0
- package/src/runtime/query/auto-review/index.ts +7 -2
- package/src/runtime/query/auto-review/prompt.ts +6 -1
- package/src/runtime/query/auto-review/transcript.ts +67 -4
- package/src/runtime/query/executor/tool-call-admission.ts +49 -3
- package/src/runtime/query/executor.ts +104 -21
- package/src/runtime/query/index.ts +66 -17
- package/src/runtime/query/iteration/index.ts +33 -9
- package/src/runtime/query/iteration/phases/compaction.ts +4 -0
- package/src/runtime/query/iteration/phases/context.ts +5 -0
- package/src/runtime/query/iteration/phases/per-call-review.ts +8 -13
- package/src/runtime/query/iteration/phases/tool-review.ts +7 -1
- package/src/runtime/query/pasted-frames.ts +119 -0
- package/src/runtime/query/path-escalation.ts +27 -3
- package/src/runtime/query/request-interrupted-turns.ts +47 -0
- package/src/runtime/query/review-policy.ts +125 -22
- package/src/runtime/query/turn/outcome-ledger.ts +99 -6
- package/src/runtime/query/unanswered.ts +35 -0
- package/src/runtime/system-events.ts +2 -0
- package/src/session/workspace/git-worktree.ts +34 -3
- package/src/store/evidence/source-kind.ts +1 -1
- package/src/store/goal/index.ts +320 -21
- package/src/store/session-index/sqlite.ts +40 -3
- package/src/store/session-log/disk.ts +1 -1
- package/src/store/session-log/lease.ts +3 -2
- package/src/tools/admit-facts.ts +2 -0
- package/src/tools/builtins/bash.ts +62 -19
- package/src/tools/builtins/browser-local.ts +504 -0
- package/src/tools/builtins/browser.ts +108 -6
- package/src/tools/builtins/computer-use-window-id.ts +50 -0
- package/src/tools/builtins/computer-use.ts +460 -68
- package/src/tools/builtins/content-fingerprint.ts +8 -1
- package/src/tools/builtins/edit.ts +93 -7
- package/src/tools/builtins/file-write-result.ts +2 -1
- package/src/tools/builtins/grep.ts +1 -1
- package/src/tools/builtins/job.ts +4 -2
- package/src/tools/builtins/monitor.ts +6 -1
- package/src/tools/builtins/search-tools.ts +196 -21
- package/src/tools/builtins/shell-read-credit.ts +97 -33
- package/src/tools/builtins/wait-for-job.ts +13 -3
- package/src/tools/builtins/web-guidance.ts +6 -0
- package/src/tools/builtins/web.ts +2 -1
- package/src/tools/builtins/write-file.ts +31 -3
- package/src/tools/command-shell.ts +6 -8
- package/src/tools/defineTool.ts +20 -1
- package/src/tools/goal/confirmation.ts +227 -3
- package/src/tools/goal/index.ts +40 -4
- package/src/tools/schedules/index.ts +11 -0
- package/src/tools/schedules/loop-tool.ts +10 -6
- package/src/tools/schedules/present.ts +1 -1
- package/src/tools/schedules/timer-tools.ts +258 -0
- package/src/tools/schedules/types.ts +72 -3
- package/src/tools/task/create.ts +2 -0
- package/src/toolsets/manager.ts +262 -46
- package/src/turn/evidence-query.ts +183 -42
- package/src/turn/evidence-recall.ts +96 -19
- package/src/turn/history-shed.ts +30 -0
- package/src/types/acp/index.ts +24 -0
- package/src/types/authorization/index.ts +20 -3
- package/src/types/command/index.ts +27 -2
- package/src/types/common/index.ts +4 -2
- package/src/types/goal/index.ts +61 -0
- package/src/types/hitl/index.ts +10 -0
- package/src/types/message/index.ts +65 -0
- package/src/types/permission/index.ts +18 -0
- package/src/types/plugin/index.ts +205 -26
- package/src/types/provider/chat.ts +10 -5
- package/src/types/provider/index.ts +1 -0
- package/src/types/provider/interface.ts +21 -0
- package/src/types/provider/limits.ts +35 -0
- package/src/types/provider/model.ts +5 -0
- package/src/types/session/config.ts +2 -2
- package/src/types/session/outcome.ts +3 -1
- package/src/types/tool/index.ts +30 -2
- package/src/types/tool/presentation.ts +4 -0
- package/src/utils/cost.ts +15 -6
- package/src/utils/file-lock.ts +328 -0
- package/src/utils/state-backup.ts +318 -0
- package/src/utils/temp-sweep.ts +327 -0
- package/src/utils/temp.ts +73 -2
package/src/types/acp/index.ts
CHANGED
|
@@ -63,6 +63,8 @@ export interface AcpInitializeResult {
|
|
|
63
63
|
readonly promptAttachments?: boolean
|
|
64
64
|
/** True only when this host applies captured effort and review settings per prompt. */
|
|
65
65
|
readonly promptOptions?: boolean
|
|
66
|
+
/** True only when this host sets `pasted` ranges of a prompt apart from the person's own words. */
|
|
67
|
+
readonly promptPasted?: boolean
|
|
66
68
|
/**
|
|
67
69
|
* The review modes beyond the original five (`prompt`, `plan`,
|
|
68
70
|
* `accept-edits`, `auto`, `strict`) that this host applies per prompt:
|
|
@@ -144,6 +146,13 @@ export interface AcpRequestPermissionParams {
|
|
|
144
146
|
* that request only. Absent on an ordinary call and from an older agent.
|
|
145
147
|
*/
|
|
146
148
|
readonly alwaysAsk?: true
|
|
149
|
+
/**
|
|
150
|
+
* For a `computer_use` call, when the agent could tell: the application it
|
|
151
|
+
* works on, and why it should be put to a person even where that application
|
|
152
|
+
* was allowed (it closes, deletes, sends or submits). Absent on other calls
|
|
153
|
+
* and from an older agent.
|
|
154
|
+
*/
|
|
155
|
+
readonly computer?: { readonly app?: string; readonly consequence?: string }
|
|
147
156
|
}[]
|
|
148
157
|
}
|
|
149
158
|
|
|
@@ -186,6 +195,8 @@ export interface AcpFsWriteParams {
|
|
|
186
195
|
export interface AcpPromptOptions {
|
|
187
196
|
readonly effort?: ReasoningEffort
|
|
188
197
|
readonly permissionMode?: ReviewMode
|
|
198
|
+
/** The standing orchestration mode for this turn onward; the host decides whether it may run. */
|
|
199
|
+
readonly hypermode?: boolean
|
|
189
200
|
}
|
|
190
201
|
export interface AcpSessionPromptParams {
|
|
191
202
|
readonly sessionId: string
|
|
@@ -194,6 +205,19 @@ export interface AcpSessionPromptParams {
|
|
|
194
205
|
/** Inline user-owned bytes; store references are not admitted across this boundary. */
|
|
195
206
|
readonly attachments?: readonly (ImageAttachment | DocumentAttachment)[]
|
|
196
207
|
readonly options?: AcpPromptOptions
|
|
208
|
+
/**
|
|
209
|
+
* Which stretches of `prompt` the person pasted: `[start, end)` in UTF-16
|
|
210
|
+
* units, in order, not overlapping. The host sets them apart from the
|
|
211
|
+
* person's own words in the model request. Sent only to a host that
|
|
212
|
+
* advertises `promptPasted`; a prompt that is plain text omits it.
|
|
213
|
+
*/
|
|
214
|
+
readonly pasted?: readonly AcpPastedRange[]
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** One pasted stretch of a prompt. */
|
|
218
|
+
export interface AcpPastedRange {
|
|
219
|
+
readonly start: number
|
|
220
|
+
readonly end: number
|
|
197
221
|
}
|
|
198
222
|
|
|
199
223
|
/** Why a prompt stopped, in the peer's vocabulary. */
|
|
@@ -23,7 +23,15 @@ export type AuthorizationRule =
|
|
|
23
23
|
type: 'allow_read_only'
|
|
24
24
|
excludeCategories?: string[]
|
|
25
25
|
}
|
|
26
|
-
| {
|
|
26
|
+
| {
|
|
27
|
+
type: 'deny_dangerous_patterns'
|
|
28
|
+
/**
|
|
29
|
+
* Every entry of the raw-text list is a denial in every mode, as the
|
|
30
|
+
* floor was before it read what a command runs. Absent or false, only
|
|
31
|
+
* irreversible acts are refused and the rest are asked.
|
|
32
|
+
*/
|
|
33
|
+
strict?: boolean
|
|
34
|
+
}
|
|
27
35
|
| { type: 'allow_by_category'; categories: string[] }
|
|
28
36
|
| { type: 'allow_by_name'; toolNames: string[] }
|
|
29
37
|
| { type: 'deny_by_name'; toolNames: string[] }
|
|
@@ -162,7 +170,10 @@ const AllowReadOnlySchema = z.object({
|
|
|
162
170
|
// and `[]` are read identically.
|
|
163
171
|
excludeCategories: z.array(z.string()).optional(),
|
|
164
172
|
})
|
|
165
|
-
const DenyDangerousPatternsSchema = z.object({
|
|
173
|
+
const DenyDangerousPatternsSchema = z.object({
|
|
174
|
+
type: z.literal('deny_dangerous_patterns'),
|
|
175
|
+
strict: z.boolean().optional(),
|
|
176
|
+
})
|
|
166
177
|
const AllowByCategorySchema = z.object({
|
|
167
178
|
type: z.literal('allow_by_category'),
|
|
168
179
|
categories: z.array(z.string()),
|
|
@@ -243,7 +254,13 @@ export const AuthorizationGateConfigSchema = z.object({
|
|
|
243
254
|
* `.optional()` for the reason `AllowReadOnlySchema.excludeCategories` is.
|
|
244
255
|
*/
|
|
245
256
|
allowReadOnlyExcludeCategories: z.array(z.string()).optional(),
|
|
246
|
-
|
|
257
|
+
/**
|
|
258
|
+
* The dangerous-command floor. `true`: irreversible commands are refused in
|
|
259
|
+
* every mode and `sudo`, `su -`, `ssh user@host`, `eval` and a download piped
|
|
260
|
+
* into a shell are asked about. `'strict'`: every one of those is refused in
|
|
261
|
+
* every mode, which is what `true` did before the floor read what a command runs.
|
|
262
|
+
*/
|
|
263
|
+
denyDangerousPatterns: z.union([z.boolean(), z.literal('strict')]).default(false),
|
|
247
264
|
logDecisions: z.boolean().default(true),
|
|
248
265
|
})
|
|
249
266
|
|
|
@@ -7,13 +7,28 @@
|
|
|
7
7
|
* escaped: two non-TUI commands import that array from React-adjacent code
|
|
8
8
|
* to build a name list, for facts the kernel owns.
|
|
9
9
|
*
|
|
10
|
-
* **Never model-visible.** No descriptor is handed to a provider,
|
|
11
|
-
* dispatch path reaches the LLM, and nothing here is a `ToolDefinition`.
|
|
10
|
+
* **Never model-visible by default.** No descriptor is handed to a provider,
|
|
11
|
+
* no dispatch path reaches the LLM, and nothing here is a `ToolDefinition`.
|
|
12
12
|
* That separation is the whole point: a `/tasks` readout is a question the
|
|
13
13
|
* operator asked, and turning it into a tool would let the model call it,
|
|
14
14
|
* spend a turn on it, and put its output in the transcript as if the model
|
|
15
15
|
* had discovered something.
|
|
16
|
+
*
|
|
17
|
+
* A host that lets the person ask for a command in plain words reads the
|
|
18
|
+
* `modelRun` declaration below. A command that says nothing is `never`.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Whether the model may run a command for the person, and on what terms.
|
|
23
|
+
*
|
|
24
|
+
* - `run`: read-only or cosmetic and reversible, no spend, no change of
|
|
25
|
+
* authority. The model runs it at once.
|
|
26
|
+
* - `confirm`: changes the conversation, files, a schedule, the model, the
|
|
27
|
+
* spend rate or stored data. The person approves each call first.
|
|
28
|
+
* - `never`: signs in, widens authority, edits global configuration, reaches
|
|
29
|
+
* other machines or ends the session. The model asks the person to type it.
|
|
16
30
|
*/
|
|
31
|
+
export type HostCommandModelRun = 'run' | 'confirm' | 'never'
|
|
17
32
|
|
|
18
33
|
/**
|
|
19
34
|
* What a command produces, structured rather than rendered.
|
|
@@ -61,6 +76,16 @@ export interface HostCommandDescriptor {
|
|
|
61
76
|
readonly hint?: string
|
|
62
77
|
/** JSON Schema for the arguments, when the command takes any. */
|
|
63
78
|
readonly args?: Record<string, unknown>
|
|
79
|
+
/**
|
|
80
|
+
* What the model may do with this command. Absent reads as `never`, so a
|
|
81
|
+
* new command is never model-runnable by accident.
|
|
82
|
+
*/
|
|
83
|
+
readonly modelRun?: HostCommandModelRun
|
|
84
|
+
/**
|
|
85
|
+
* First argument words whose form only reads, and so runs although
|
|
86
|
+
* `modelRun` is stricter. The empty string names the form with no arguments.
|
|
87
|
+
*/
|
|
88
|
+
readonly modelRunReads?: readonly string[]
|
|
64
89
|
handler(ctx: HostCommandContext): Promise<HostCommandOutcome> | HostCommandOutcome
|
|
65
90
|
}
|
|
66
91
|
|
|
@@ -76,7 +76,8 @@ export interface TokenUsage {
|
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* The speed the provider says served this call, when it says. `'fast'` is a
|
|
79
|
-
* premium-priced mode
|
|
79
|
+
* premium-priced mode and `'ultrafast'` a tier above it that has no
|
|
80
|
+
* published per-token price, so pricing reads it per call: a per-call fact like
|
|
80
81
|
* {@link TokenUsage.cacheTtlMs}, never summed. Absent means standard or
|
|
81
82
|
* unreported.
|
|
82
83
|
*/
|
|
@@ -92,7 +93,8 @@ export interface TokenUsage {
|
|
|
92
93
|
/**
|
|
93
94
|
* The service tier the provider says served this call (`standard`,
|
|
94
95
|
* `priority`, `batch`). A per-call fact, never summed. Absent means
|
|
95
|
-
* unreported.
|
|
96
|
+
* unreported. A driver that reports fast mode through {@link TokenUsage.speed}
|
|
97
|
+
* leaves `priority` out of here.
|
|
96
98
|
*/
|
|
97
99
|
serviceTier?: string
|
|
98
100
|
|
package/src/types/goal/index.ts
CHANGED
|
@@ -48,10 +48,64 @@ export interface SessionGoal extends GoalRef {
|
|
|
48
48
|
readonly confirmedBy?: GoalConfirmedBy
|
|
49
49
|
/** Present exactly while {@link phase} is `blocked`. */
|
|
50
50
|
readonly blockedReason?: GoalBlockReason
|
|
51
|
+
/** Present while {@link phase} is `paused` because the goal reached a check-in. */
|
|
52
|
+
readonly pauseReason?: GoalBlockReason
|
|
53
|
+
/**
|
|
54
|
+
* Stop rules chosen when the goal was created. Absent means the rule is not
|
|
55
|
+
* applied, which is how every goal created before they existed behaves.
|
|
56
|
+
*/
|
|
57
|
+
readonly guards?: GoalGuards
|
|
58
|
+
/** Tokens spent by the goal's automatic turns so far. */
|
|
59
|
+
readonly tokensUsed?: number
|
|
60
|
+
/** What those turns cost, in USD, as far as it could be priced. */
|
|
61
|
+
readonly costUsd?: number
|
|
62
|
+
/** Automatic turns in a row that did nothing the record can show. */
|
|
63
|
+
readonly quietRounds?: number
|
|
64
|
+
/** Automatic turns in a row that ended on the same failure. */
|
|
65
|
+
readonly failureRounds?: number
|
|
66
|
+
/** The failure those turns ended on. */
|
|
67
|
+
readonly failureSignature?: string
|
|
68
|
+
/** What the most recent turn that did something did, in a few words. */
|
|
69
|
+
readonly lastAction?: string
|
|
70
|
+
/** The admitted round at which the last check-in pause was made. */
|
|
71
|
+
readonly checkedInAtRound?: number
|
|
72
|
+
/** The admitted round that was given as the last one because the token budget was reached. */
|
|
73
|
+
readonly wrapUpRound?: number
|
|
74
|
+
/** What a check of the completion report found missing; leads the next round. */
|
|
75
|
+
readonly missing?: readonly string[]
|
|
51
76
|
readonly createdAt: number
|
|
52
77
|
readonly updatedAt: number
|
|
53
78
|
}
|
|
54
79
|
|
|
80
|
+
/**
|
|
81
|
+
* The rules that stop a goal that is not getting anywhere or has spent what it
|
|
82
|
+
* was allowed. Every field is optional and an absent one is not applied.
|
|
83
|
+
*/
|
|
84
|
+
export interface GoalGuards {
|
|
85
|
+
/** Stop (block) after this many automatic turns in a row that changed nothing, or that ended on the same failure. */
|
|
86
|
+
readonly stallRounds?: number
|
|
87
|
+
/** Pause for a check-in after this many admitted rounds, and again after each further batch. `0` turns it off. */
|
|
88
|
+
readonly checkInEvery?: number
|
|
89
|
+
/** Tokens the goal's automatic turns may spend; one last round is given when it is reached. */
|
|
90
|
+
readonly tokenBudget?: number
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** What one finished automatic turn did, as the host read it from the turn's record. */
|
|
94
|
+
export interface GoalRoundOutcome {
|
|
95
|
+
/** Tokens the turn spent, when known. */
|
|
96
|
+
readonly tokens?: number
|
|
97
|
+
/** What the turn cost in USD, when it could be priced. */
|
|
98
|
+
readonly costUsd?: number
|
|
99
|
+
/** `empty`: nothing changed, no check ran, no completion was claimed. `unknown`: the record cannot tell. */
|
|
100
|
+
readonly progress: 'progress' | 'empty' | 'unknown'
|
|
101
|
+
/** The failure the turn ended on, as a stable short string; absent when it did not end on one. */
|
|
102
|
+
readonly failureSignature?: string
|
|
103
|
+
/** What the turn did, in a few words, for the line that says why a goal stopped. */
|
|
104
|
+
readonly action?: string
|
|
105
|
+
/** What a check of the completion report found missing. An empty list clears it. */
|
|
106
|
+
readonly missing?: readonly string[]
|
|
107
|
+
}
|
|
108
|
+
|
|
55
109
|
/** Immutable authority carried by exactly one admitted automatic turn. */
|
|
56
110
|
export interface GoalRoundAuthority extends GoalRef {
|
|
57
111
|
readonly sessionId: SessionId
|
|
@@ -60,4 +114,11 @@ export interface GoalRoundAuthority extends GoalRef {
|
|
|
60
114
|
/** One-based admitted round number. */
|
|
61
115
|
readonly round: number
|
|
62
116
|
readonly maxGoalRounds: number
|
|
117
|
+
/** Tokens and cost (USD) the goal's earlier automatic turns used, when any were recorded. */
|
|
118
|
+
readonly tokensUsed?: number
|
|
119
|
+
readonly costUsd?: number
|
|
120
|
+
/** This round is the last one: the token budget was reached and the model is to wrap up. */
|
|
121
|
+
readonly wrapUp?: boolean
|
|
122
|
+
/** What a check of an earlier completion report found missing; leads this round. */
|
|
123
|
+
readonly missing?: readonly string[]
|
|
63
124
|
}
|
package/src/types/hitl/index.ts
CHANGED
|
@@ -191,6 +191,16 @@ export interface ResumeContext {
|
|
|
191
191
|
line: string,
|
|
192
192
|
dialect: ShellDialect,
|
|
193
193
|
) => Promise<readonly LaunchedScript[]>
|
|
194
|
+
/**
|
|
195
|
+
* The working tree's short status (`git status --porcelain --branch`,
|
|
196
|
+
* capped) in the folder a shell line runs a destructive git command in:
|
|
197
|
+
* a hard reset, a forced clean, a checkout or restore over changes, a forced
|
|
198
|
+
* push, a forced branch deletion, a dropped or cleared stash, a rebase.
|
|
199
|
+
* Undefined for any other line, and when the folder cannot be known from
|
|
200
|
+
* the line or git does not answer quickly. Absent when the host runs its
|
|
201
|
+
* shell where this process cannot see the files.
|
|
202
|
+
*/
|
|
203
|
+
readonly gitStatus?: (line: string, dialect: ShellDialect) => Promise<string | undefined>
|
|
194
204
|
}
|
|
195
205
|
|
|
196
206
|
/** A script file a reviewed shell line launches, as read for its reviewer. */
|
|
@@ -303,11 +303,46 @@ export interface SystemMessage extends BaseMessage {
|
|
|
303
303
|
content: string
|
|
304
304
|
/** Host provenance for a derived summary, independent of its textual heading. */
|
|
305
305
|
source?: { readonly type: 'compaction-summary' }
|
|
306
|
+
/**
|
|
307
|
+
* On a compaction summary: the deferred tools the conversation had loaded
|
|
308
|
+
* before the pass cut the messages that loaded them. `ToolManager.availability`
|
|
309
|
+
* counts these like the receipts on tool messages, so a tool loaded before a
|
|
310
|
+
* compaction is still callable after it. Cumulative: a later summary carries
|
|
311
|
+
* what an earlier one did.
|
|
312
|
+
*/
|
|
313
|
+
revealedTools?: readonly ToolRevealReceipt[]
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* A range of a user message's `content` that the person pasted. The nonce is
|
|
318
|
+
* drawn once, when the message is made, and stays with it: the request frames
|
|
319
|
+
* the range the same way every time the message is sent.
|
|
320
|
+
*/
|
|
321
|
+
export interface PastedSpan {
|
|
322
|
+
/** Offset of the first character, in UTF-16 units. */
|
|
323
|
+
readonly start: number
|
|
324
|
+
/** Offset after the last character. */
|
|
325
|
+
readonly end: number
|
|
326
|
+
/** Lowercase hex, unique to this range. */
|
|
327
|
+
readonly nonce: string
|
|
306
328
|
}
|
|
307
329
|
|
|
308
330
|
export interface UserMessage extends BaseMessage {
|
|
309
331
|
role: 'user'
|
|
310
332
|
content: string
|
|
333
|
+
/**
|
|
334
|
+
* Ranges of `content` that were pasted. The content itself is what the
|
|
335
|
+
* person saw; only the model request sets these ranges apart.
|
|
336
|
+
*/
|
|
337
|
+
pasted?: readonly PastedSpan[]
|
|
338
|
+
/**
|
|
339
|
+
* One line the host wrote saying when the person sent this message (and, from
|
|
340
|
+
* the second message on, how long after the one before it). The model request
|
|
341
|
+
* puts it in front of `content`; `content` itself stays what the person typed,
|
|
342
|
+
* so every view of the conversation shows the message as it was. Written once,
|
|
343
|
+
* with the message, so a resume sends the same bytes.
|
|
344
|
+
*/
|
|
345
|
+
timeNote?: string
|
|
311
346
|
/** Optional image or document attachments. */
|
|
312
347
|
attachments?: readonly MessageAttachment[]
|
|
313
348
|
/** Host provenance for user-role input that was not authored by the operator. */
|
|
@@ -590,6 +625,27 @@ export interface ToolRevealReceipt {
|
|
|
590
625
|
readonly sourceKind: import('../toolset/index.js').ToolSourceKind
|
|
591
626
|
}
|
|
592
627
|
|
|
628
|
+
/**
|
|
629
|
+
* How a call that has a result came to have it without running to the end.
|
|
630
|
+
*
|
|
631
|
+
* `interrupted`: the turn stopped first, or the question about the call got
|
|
632
|
+
* no answer (it was paused, or the answer could not be taken). `rejected`: a
|
|
633
|
+
* person said no. `refused_by_mode`: the session's mode does not run such a
|
|
634
|
+
* call (plan mode is read-only; `strict` runs only what a rule allows), so it
|
|
635
|
+
* holds only while that mode does. `blocked_by_permissions`: a rule, a hook or
|
|
636
|
+
* another kernel guard refused it. `blocked_by_auto_mode`: the auto mode's
|
|
637
|
+
* classifier judged it unsafe. `auto_mode_unavailable`: the classifier could
|
|
638
|
+
* not give a verdict, so the call was held back without one. A result without
|
|
639
|
+
* an outcome ran, and `isError` says whether it failed.
|
|
640
|
+
*/
|
|
641
|
+
export type ToolResultOutcome =
|
|
642
|
+
| 'interrupted'
|
|
643
|
+
| 'rejected'
|
|
644
|
+
| 'refused_by_mode'
|
|
645
|
+
| 'blocked_by_permissions'
|
|
646
|
+
| 'blocked_by_auto_mode'
|
|
647
|
+
| 'auto_mode_unavailable'
|
|
648
|
+
|
|
593
649
|
export interface ToolMessage extends BaseMessage {
|
|
594
650
|
role: 'tool'
|
|
595
651
|
content: ToolResultContent
|
|
@@ -618,6 +674,13 @@ export interface ToolMessage extends BaseMessage {
|
|
|
618
674
|
* carries this too, with nothing extra to serialize.
|
|
619
675
|
*/
|
|
620
676
|
revealedTools?: readonly ToolRevealReceipt[]
|
|
677
|
+
/**
|
|
678
|
+
* Why the call did not simply run, written by the kernel where it made the
|
|
679
|
+
* result (see {@link ToolResultOutcome}). Never read from the result's text,
|
|
680
|
+
* which a tool controls. The auto mode's classifier is shown it, so a call
|
|
681
|
+
* tried again after a refusal is seen as a retry.
|
|
682
|
+
*/
|
|
683
|
+
outcome?: ToolResultOutcome
|
|
621
684
|
}
|
|
622
685
|
|
|
623
686
|
export type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage
|
|
@@ -802,6 +865,7 @@ export function createToolMessage(
|
|
|
802
865
|
toolCallId: string,
|
|
803
866
|
isError?: boolean,
|
|
804
867
|
revealedTools?: readonly ToolRevealReceipt[],
|
|
868
|
+
outcome?: ToolResultOutcome,
|
|
805
869
|
): ToolMessage {
|
|
806
870
|
return {
|
|
807
871
|
role: 'tool',
|
|
@@ -809,6 +873,7 @@ export function createToolMessage(
|
|
|
809
873
|
toolCallId,
|
|
810
874
|
...(isError !== undefined ? { isError } : {}),
|
|
811
875
|
...(revealedTools && revealedTools.length > 0 ? { revealedTools } : {}),
|
|
876
|
+
...(outcome !== undefined ? { outcome } : {}),
|
|
812
877
|
timestamp: Date.now(),
|
|
813
878
|
}
|
|
814
879
|
}
|
|
@@ -10,3 +10,21 @@ export type PermissionMode = 'plan' | 'auto'
|
|
|
10
10
|
*/
|
|
11
11
|
export const PLAN_MODE_REFUSAL =
|
|
12
12
|
'Refused: plan mode is read-only. Explore with the reading tools, then present the plan as your reply — what you would change, in which files, and in what order. The user will switch out of plan mode to have it carried out.'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* What the model is told when a call is refused under the review mode that
|
|
16
|
+
* runs only what a rule allows (`strict`). Beside the plan-mode texts because
|
|
17
|
+
* the executor reads all three to tell a refusal by the session's mode from
|
|
18
|
+
* one by a rule.
|
|
19
|
+
*/
|
|
20
|
+
export const STRICT_MODE_REFUSAL =
|
|
21
|
+
'Refused: this turn only permits tools an explicit rule allows, and no rule covers this call. Asking again will not change it — either the operator adds a rule, or this has to be done another way.'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The same refusal for a session whose plan mode has a plan file and a way to
|
|
25
|
+
* ask for approval: the plan goes in the file, and the exit tool puts it in
|
|
26
|
+
* front of the person. Telling that model to "present the plan as your reply"
|
|
27
|
+
* would send it around the approval dialog.
|
|
28
|
+
*/
|
|
29
|
+
export const PLAN_MODE_REFUSAL_WITH_PLAN_FILE =
|
|
30
|
+
'Refused: plan mode is read-only. Explore with the reading tools (read, glob, grep, and shell commands that only read; run git on its own, not after cd), write the plan to the plan file, then call exit_plan_mode so the user can approve it. Change nothing else before then.'
|
|
@@ -182,6 +182,61 @@ export type PluginHookEvent =
|
|
|
182
182
|
* does the removing; the host then removes nothing.
|
|
183
183
|
*/
|
|
184
184
|
| 'worktree_remove'
|
|
185
|
+
/**
|
|
186
|
+
* The session's model is about to change (`/model`, the model picker, the
|
|
187
|
+
* model's own switch request). Carries `modelSwitch` (the model left, the
|
|
188
|
+
* model asked for, and what asked). A hook answers before anything changes:
|
|
189
|
+
* `skip` refuses the switch, `continue` with `permission: { decision: 'ask' }`
|
|
190
|
+
* has the person confirm it, and `allow` (or no answer) lets it go ahead.
|
|
191
|
+
*/
|
|
192
|
+
| 'pre_model_switch'
|
|
193
|
+
/**
|
|
194
|
+
* The session's model changed, whatever the cause. Carries `modelSwitch`.
|
|
195
|
+
* A hook may `annotate`: the text reaches the model with the first request
|
|
196
|
+
* the new model serves.
|
|
197
|
+
*/
|
|
198
|
+
| 'post_model_switch'
|
|
199
|
+
/**
|
|
200
|
+
* A tool server asked the person for input. Carries `elicitation`. A hook
|
|
201
|
+
* may answer for the person (`elicitation: { action, content }`, with
|
|
202
|
+
* `accept`, `decline` or `cancel`) and the question is not shown; `skip`
|
|
203
|
+
* declines it.
|
|
204
|
+
*/
|
|
205
|
+
| 'elicitation'
|
|
206
|
+
/**
|
|
207
|
+
* The person (or an `elicitation` hook) answered a tool server's question,
|
|
208
|
+
* before the answer is sent. Carries `elicitation` with the `action` and
|
|
209
|
+
* `content` about to go. A hook may replace either (`elicitation`); `skip`
|
|
210
|
+
* turns the answer into a decline.
|
|
211
|
+
*/
|
|
212
|
+
| 'elicitation_result'
|
|
213
|
+
/**
|
|
214
|
+
* A folder was added to the session's working folders (`/add-dir`). Carries
|
|
215
|
+
* `directory` (absolute) and `directorySource`. Observational.
|
|
216
|
+
*/
|
|
217
|
+
| 'directory_added'
|
|
218
|
+
/**
|
|
219
|
+
* An instruction file (AGENTS.md, a rule, a file it includes) was read into
|
|
220
|
+
* the session. Carries `instructions`. Observational: it cannot be refused.
|
|
221
|
+
*/
|
|
222
|
+
| 'instructions_loaded'
|
|
223
|
+
/**
|
|
224
|
+
* A command the person typed (`/name args`) expanded into a prompt, before
|
|
225
|
+
* that prompt goes on. Carries `expansion` and, as `prompt`, what the
|
|
226
|
+
* command expanded to. `skip` stops it, and `annotate` adds context.
|
|
227
|
+
*/
|
|
228
|
+
| 'user_prompt_expansion'
|
|
229
|
+
/**
|
|
230
|
+
* A task is being created (`task_create`), before it is. Carries `task`.
|
|
231
|
+
* `skip` refuses it, and the reason reaches the model.
|
|
232
|
+
*/
|
|
233
|
+
| 'task_created'
|
|
234
|
+
/**
|
|
235
|
+
* A task is being marked completed (`task_update` with a status of
|
|
236
|
+
* `completed`), before it is. Carries `task`. `skip` refuses it, and the
|
|
237
|
+
* reason reaches the model.
|
|
238
|
+
*/
|
|
239
|
+
| 'task_completed'
|
|
185
240
|
| 'pre_llm_call'
|
|
186
241
|
| 'post_llm_call'
|
|
187
242
|
| 'iteration_start'
|
|
@@ -225,6 +280,15 @@ export function assertPluginHookEvent(event: PluginHookEvent): void {
|
|
|
225
280
|
case 'cwd_changed':
|
|
226
281
|
case 'worktree_create':
|
|
227
282
|
case 'worktree_remove':
|
|
283
|
+
case 'pre_model_switch':
|
|
284
|
+
case 'post_model_switch':
|
|
285
|
+
case 'elicitation':
|
|
286
|
+
case 'elicitation_result':
|
|
287
|
+
case 'directory_added':
|
|
288
|
+
case 'instructions_loaded':
|
|
289
|
+
case 'user_prompt_expansion':
|
|
290
|
+
case 'task_created':
|
|
291
|
+
case 'task_completed':
|
|
228
292
|
case 'pre_llm_call':
|
|
229
293
|
case 'post_llm_call':
|
|
230
294
|
case 'iteration_start':
|
|
@@ -347,6 +411,86 @@ export type PluginSessionSource = 'startup' | 'resume' | 'clear'
|
|
|
347
411
|
*/
|
|
348
412
|
export type PluginSessionEndReason = 'exit' | 'replaced' | 'clear'
|
|
349
413
|
|
|
414
|
+
/** What asked for a model change, on `pre_model_switch` and `post_model_switch`. */
|
|
415
|
+
export type PluginModelSwitchSource = 'command' | 'picker' | 'tool' | 'auto'
|
|
416
|
+
|
|
417
|
+
/** What a model-switch hook is shown. */
|
|
418
|
+
export interface PluginModelSwitchInfo {
|
|
419
|
+
/** The model in use before the change, with its provider when known (`provider/model`). */
|
|
420
|
+
readonly fromModel: string
|
|
421
|
+
/** The model the session uses after the change. */
|
|
422
|
+
readonly toModel: string
|
|
423
|
+
/** What the person (or the model) typed, when it differs from `toModel`; `null` when nothing was typed. */
|
|
424
|
+
readonly requestedModel: string | null
|
|
425
|
+
/** `command` (`/model`), `picker`, `tool` (the model's own request) or `auto` (Auto on). */
|
|
426
|
+
readonly source: PluginModelSwitchSource
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/** A tool server's question to the person, and the answer, on `elicitation` and `elicitation_result`. */
|
|
430
|
+
export interface PluginElicitationInfo {
|
|
431
|
+
readonly serverName: string
|
|
432
|
+
readonly message: string
|
|
433
|
+
readonly mode?: 'form' | 'url'
|
|
434
|
+
readonly url?: string
|
|
435
|
+
readonly elicitationId?: string
|
|
436
|
+
/** The form the server wants filled in, as the server wrote it. */
|
|
437
|
+
readonly requestedSchema?: unknown
|
|
438
|
+
/** On `elicitation_result`: how the question was answered. */
|
|
439
|
+
readonly action?: PluginElicitationAction
|
|
440
|
+
/** On `elicitation_result`: the values given. */
|
|
441
|
+
readonly content?: Readonly<Record<string, unknown>>
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export type PluginElicitationAction = 'accept' | 'decline' | 'cancel'
|
|
445
|
+
|
|
446
|
+
/** What answers a tool server's question in place of the person. */
|
|
447
|
+
export interface PluginElicitationAnswer {
|
|
448
|
+
readonly action: PluginElicitationAction
|
|
449
|
+
readonly content?: Readonly<Record<string, unknown>>
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/** What added a working folder, on `directory_added`. */
|
|
453
|
+
export type PluginDirectorySource = 'slash_command'
|
|
454
|
+
|
|
455
|
+
export type PluginInstructionMemoryType = 'User' | 'Project' | 'Local'
|
|
456
|
+
|
|
457
|
+
/** Why an instruction file was read, on `instructions_loaded`. */
|
|
458
|
+
export type PluginInstructionLoadReason =
|
|
459
|
+
| 'session_start'
|
|
460
|
+
| 'nested_traversal'
|
|
461
|
+
| 'include'
|
|
462
|
+
| 'compact'
|
|
463
|
+
|
|
464
|
+
/** What an `instructions_loaded` hook is shown. */
|
|
465
|
+
export interface PluginInstructionsInfo {
|
|
466
|
+
readonly filePath: string
|
|
467
|
+
readonly memoryType: PluginInstructionMemoryType
|
|
468
|
+
readonly loadReason: PluginInstructionLoadReason
|
|
469
|
+
/** The file that was being read when this one was included, for `include`. */
|
|
470
|
+
readonly parentFilePath?: string
|
|
471
|
+
/** The file whose location led to this one, for `nested_traversal`. */
|
|
472
|
+
readonly triggerFilePath?: string
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/** What a `user_prompt_expansion` hook is shown. */
|
|
476
|
+
export interface PluginPromptExpansionInfo {
|
|
477
|
+
readonly expansionType: 'slash_command'
|
|
478
|
+
/** The command's name, without the slash. */
|
|
479
|
+
readonly commandName: string
|
|
480
|
+
/** What was typed after the name. */
|
|
481
|
+
readonly commandArgs: string
|
|
482
|
+
/** Where the command came from (`user`, `project`, `plugin`, `skill`), when known. */
|
|
483
|
+
readonly commandSource?: string
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/** What a task hook is shown. */
|
|
487
|
+
export interface PluginTaskInfo {
|
|
488
|
+
/** Absent on `task_created`: the task has no id yet. */
|
|
489
|
+
readonly id?: string
|
|
490
|
+
readonly subject?: string
|
|
491
|
+
readonly description?: string
|
|
492
|
+
}
|
|
493
|
+
|
|
350
494
|
export interface PluginHookContext {
|
|
351
495
|
/** The turn the hook fired in. Absent on `session_start` and `session_end`. */
|
|
352
496
|
readonly turnId?: TurnId
|
|
@@ -382,6 +526,20 @@ export interface PluginHookContext {
|
|
|
382
526
|
readonly worktreeBaseRef?: string
|
|
383
527
|
/** The worktree to remove, on `worktree_remove`. */
|
|
384
528
|
readonly worktreePath?: string
|
|
529
|
+
/** The model change, on `pre_model_switch` and `post_model_switch`. */
|
|
530
|
+
readonly modelSwitch?: PluginModelSwitchInfo
|
|
531
|
+
/** The tool server's question and the answer, on `elicitation` and `elicitation_result`. */
|
|
532
|
+
readonly elicitation?: PluginElicitationInfo
|
|
533
|
+
/** The folder added, absolute, on `directory_added`. */
|
|
534
|
+
readonly directory?: string
|
|
535
|
+
/** What added it, on `directory_added`. */
|
|
536
|
+
readonly directorySource?: PluginDirectorySource
|
|
537
|
+
/** The instruction file, on `instructions_loaded`. */
|
|
538
|
+
readonly instructions?: PluginInstructionsInfo
|
|
539
|
+
/** The command that expanded, on `user_prompt_expansion`. */
|
|
540
|
+
readonly expansion?: PluginPromptExpansionInfo
|
|
541
|
+
/** The task, on `task_created` and `task_completed`. */
|
|
542
|
+
readonly task?: PluginTaskInfo
|
|
385
543
|
/** The pass, on `pre_compact` and `post_compact`. */
|
|
386
544
|
readonly compaction?: PluginCompactionInfo
|
|
387
545
|
readonly toolName?: string
|
|
@@ -509,6 +667,11 @@ export interface PluginHookNotes {
|
|
|
509
667
|
* worktree and creates none. Other events ignore it.
|
|
510
668
|
*/
|
|
511
669
|
readonly worktreePath?: string
|
|
670
|
+
/**
|
|
671
|
+
* On `elicitation` and `elicitation_result`: the answer that stands in for
|
|
672
|
+
* the person's, or replaces what they gave. Other events ignore it.
|
|
673
|
+
*/
|
|
674
|
+
readonly elicitation?: PluginElicitationAnswer
|
|
512
675
|
}
|
|
513
676
|
|
|
514
677
|
export type PluginHookResult =
|
|
@@ -596,32 +759,48 @@ export function assertPluginHookResult(result: PluginHookResult): asserts result
|
|
|
596
759
|
/** Actions the query can interpret for a particular hook event. */
|
|
597
760
|
export type PluginHookResultFor<E extends PluginHookEvent> = E extends 'user_prompt_submit'
|
|
598
761
|
? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'skip' | 'error' }>
|
|
599
|
-
: E extends '
|
|
600
|
-
? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'error' }>
|
|
601
|
-
: E extends
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
762
|
+
: E extends 'user_prompt_expansion'
|
|
763
|
+
? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'skip' | 'error' }>
|
|
764
|
+
: E extends
|
|
765
|
+
| 'pre_model_switch'
|
|
766
|
+
| 'elicitation'
|
|
767
|
+
| 'elicitation_result'
|
|
768
|
+
| 'task_created'
|
|
769
|
+
| 'task_completed'
|
|
770
|
+
? Extract<PluginHookResult, { action: 'continue' | 'skip' | 'error' }>
|
|
771
|
+
: E extends 'post_model_switch'
|
|
772
|
+
? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'error' }>
|
|
773
|
+
: E extends 'directory_added' | 'instructions_loaded'
|
|
774
|
+
? Extract<PluginHookResult, { action: 'continue' }>
|
|
775
|
+
: E extends 'subagent_start'
|
|
776
|
+
? Extract<PluginHookResult, { action: 'continue' | 'annotate' | 'error' }>
|
|
777
|
+
: E extends 'pre_tool_use'
|
|
778
|
+
? Extract<PluginHookResult, { action: 'continue' | 'skip' | 'modify' | 'error' }>
|
|
779
|
+
: E extends 'post_tool_use'
|
|
780
|
+
? Extract<PluginHookResult, { action: 'continue' | 'replace' | 'retry' | 'error' }>
|
|
781
|
+
: E extends 'post_tool_use_failure'
|
|
782
|
+
? Extract<PluginHookResult, { action: 'continue' | 'error' }>
|
|
783
|
+
: E extends 'permission_request'
|
|
784
|
+
? Extract<PluginHookResult, { action: 'continue' | 'skip' }>
|
|
785
|
+
: E extends 'pre_compact'
|
|
786
|
+
? Extract<
|
|
787
|
+
PluginHookResult,
|
|
788
|
+
{ action: 'continue' | 'annotate' | 'skip' | 'error' }
|
|
789
|
+
>
|
|
790
|
+
: E extends 'turn_end' | 'subagent_stop'
|
|
791
|
+
? Extract<PluginHookResult, { action: 'continue' | 'skip' | 'error' }>
|
|
792
|
+
: E extends 'session_start'
|
|
793
|
+
? Extract<PluginHookResult, { action: 'continue' | 'annotate' }>
|
|
794
|
+
: E extends
|
|
795
|
+
| 'turn_interrupt'
|
|
796
|
+
| 'session_end'
|
|
797
|
+
| 'notification'
|
|
798
|
+
| 'turn_failure'
|
|
799
|
+
| 'permission_denied'
|
|
800
|
+
| 'file_changed'
|
|
801
|
+
| 'cwd_changed'
|
|
802
|
+
? Extract<PluginHookResult, { action: 'continue' }>
|
|
803
|
+
: Extract<PluginHookResult, { action: 'continue' | 'error' }>
|
|
625
804
|
|
|
626
805
|
/** The event and its handler verdict stay correlated, including in hook arrays. */
|
|
627
806
|
export type PluginHookDefinition<E extends PluginHookEvent = PluginHookEvent> =
|