@code-yeongyu/senpi 2026.6.21 → 2026.6.30
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 +151 -0
- package/README.md +41 -5
- package/dist/bun/register-bedrock.js +1 -1
- package/dist/bun/register-bedrock.js.map +1 -1
- package/dist/cli/args.js +1 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +13 -25
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/session-picker.d.ts +2 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +5 -4
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/startup-ui.d.ts +4 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +63 -14
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/core/agent-session.d.ts +4 -3
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +34 -26
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +6 -12
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +4 -19
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -1
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +7 -4
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/dynamic-prompt/style.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/style.js +26 -1
- package/dist/core/dynamic-prompt/style.js.map +1 -1
- package/dist/core/experimental.d.ts +2 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +4 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/openai-remote.d.ts +1 -1
- package/dist/core/extensions/builtin/compaction/openai-remote.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/openai-remote.js +1 -1
- package/dist/core/extensions/builtin/compaction/openai-remote.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.js +2 -1
- package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
- package/dist/core/extensions/builtin/goal/command-registration.d.ts +12 -0
- package/dist/core/extensions/builtin/goal/command-registration.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/command-registration.js +86 -0
- package/dist/core/extensions/builtin/goal/command-registration.js.map +1 -0
- package/dist/core/extensions/builtin/goal/continuation.d.ts +2 -1
- package/dist/core/extensions/builtin/goal/continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/continuation.js +33 -2
- package/dist/core/extensions/builtin/goal/continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/index.js +19 -136
- package/dist/core/extensions/builtin/goal/index.js.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.d.ts +10 -0
- package/dist/core/extensions/builtin/goal/tool-registration.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/tool-registration.js +63 -0
- package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/command-runner.d.ts +25 -0
- package/dist/core/extensions/builtin/hooks/command-runner.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/command-runner.js +152 -0
- package/dist/core/extensions/builtin/hooks/command-runner.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/command.d.ts +11 -0
- package/dist/core/extensions/builtin/hooks/command.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/command.js +180 -0
- package/dist/core/extensions/builtin/hooks/command.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/config-loader.d.ts +19 -0
- package/dist/core/extensions/builtin/hooks/config-loader.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/config-loader.js +125 -0
- package/dist/core/extensions/builtin/hooks/config-loader.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/diagnostics.d.ts +10 -0
- package/dist/core/extensions/builtin/hooks/diagnostics.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/diagnostics.js +14 -0
- package/dist/core/extensions/builtin/hooks/diagnostics.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/dispatcher.d.ts +60 -0
- package/dist/core/extensions/builtin/hooks/dispatcher.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/dispatcher.js +161 -0
- package/dist/core/extensions/builtin/hooks/dispatcher.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/handler.d.ts +12 -0
- package/dist/core/extensions/builtin/hooks/handler.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/handler.js +128 -0
- package/dist/core/extensions/builtin/hooks/handler.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/index.d.ts +6 -0
- package/dist/core/extensions/builtin/hooks/index.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/index.js +216 -0
- package/dist/core/extensions/builtin/hooks/index.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/lifecycle-adapter.d.ts +29 -0
- package/dist/core/extensions/builtin/hooks/lifecycle-adapter.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/lifecycle-adapter.js +276 -0
- package/dist/core/extensions/builtin/hooks/lifecycle-adapter.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/matcher.d.ts +7 -0
- package/dist/core/extensions/builtin/hooks/matcher.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/matcher.js +109 -0
- package/dist/core/extensions/builtin/hooks/matcher.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/output-bounds.d.ts +29 -0
- package/dist/core/extensions/builtin/hooks/output-bounds.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/output-bounds.js +47 -0
- package/dist/core/extensions/builtin/hooks/output-bounds.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/output-parser.d.ts +27 -0
- package/dist/core/extensions/builtin/hooks/output-parser.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/output-parser.js +168 -0
- package/dist/core/extensions/builtin/hooks/output-parser.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/plugin-loader.d.ts +11 -0
- package/dist/core/extensions/builtin/hooks/plugin-loader.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/plugin-loader.js +138 -0
- package/dist/core/extensions/builtin/hooks/plugin-loader.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/plugin-manifest.d.ts +47 -0
- package/dist/core/extensions/builtin/hooks/plugin-manifest.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/plugin-manifest.js +86 -0
- package/dist/core/extensions/builtin/hooks/plugin-manifest.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/prompt-adapter.d.ts +30 -0
- package/dist/core/extensions/builtin/hooks/prompt-adapter.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/prompt-adapter.js +59 -0
- package/dist/core/extensions/builtin/hooks/prompt-adapter.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/safety.d.ts +14 -0
- package/dist/core/extensions/builtin/hooks/safety.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/safety.js +179 -0
- package/dist/core/extensions/builtin/hooks/safety.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/schema.d.ts +3 -0
- package/dist/core/extensions/builtin/hooks/schema.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/schema.js +94 -0
- package/dist/core/extensions/builtin/hooks/schema.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/stop-adapter.d.ts +18 -0
- package/dist/core/extensions/builtin/hooks/stop-adapter.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/stop-adapter.js +282 -0
- package/dist/core/extensions/builtin/hooks/stop-adapter.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/tool-adapter.d.ts +11 -0
- package/dist/core/extensions/builtin/hooks/tool-adapter.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/tool-adapter.js +158 -0
- package/dist/core/extensions/builtin/hooks/tool-adapter.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/trust-storage.d.ts +24 -0
- package/dist/core/extensions/builtin/hooks/trust-storage.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/trust-storage.js +102 -0
- package/dist/core/extensions/builtin/hooks/trust-storage.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/trust.d.ts +34 -0
- package/dist/core/extensions/builtin/hooks/trust.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/trust.js +194 -0
- package/dist/core/extensions/builtin/hooks/trust.js.map +1 -0
- package/dist/core/extensions/builtin/hooks/types.d.ts +134 -0
- package/dist/core/extensions/builtin/hooks/types.d.ts.map +1 -0
- package/dist/core/extensions/builtin/hooks/types.js +36 -0
- package/dist/core/extensions/builtin/hooks/types.js.map +1 -0
- package/dist/core/extensions/builtin/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/index.js +4 -0
- package/dist/core/extensions/builtin/index.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/cli.d.ts +3 -1
- package/dist/core/extensions/builtin/permission-system/cli.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/cli.js +14 -0
- package/dist/core/extensions/builtin/permission-system/cli.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/config.d.ts +3 -1
- package/dist/core/extensions/builtin/permission-system/config.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/config.js +26 -0
- package/dist/core/extensions/builtin/permission-system/config.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/external-dir.js +2 -2
- package/dist/core/extensions/builtin/permission-system/external-dir.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/index.js +11 -2
- package/dist/core/extensions/builtin/permission-system/index.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/parsers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/parsers.js +39 -16
- package/dist/core/extensions/builtin/permission-system/parsers.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/settings.d.ts +6 -5
- package/dist/core/extensions/builtin/permission-system/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/settings.js +26 -6
- package/dist/core/extensions/builtin/permission-system/settings.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/types.d.ts +1 -0
- package/dist/core/extensions/builtin/permission-system/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/types.js.map +1 -1
- package/dist/core/extensions/builtin/pi-codex-app-server/capability-negotiator.d.ts +42 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/capability-negotiator.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/capability-negotiator.js +130 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/capability-negotiator.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/error-mapper.d.ts +27 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/error-mapper.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/error-mapper.js +18 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/error-mapper.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/extension.d.ts +25 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/extension.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/extension.js +110 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/extension.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/id-mapper.d.ts +48 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/id-mapper.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/id-mapper.js +74 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/id-mapper.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/index.d.ts +3 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/index.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/index.js +5 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/index.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/item-stream-projector.d.ts +29 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/item-stream-projector.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/item-stream-projector.js +105 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/item-stream-projector.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/notification-projector.d.ts +49 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/notification-projector.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/notification-projector.js +99 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/notification-projector.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-core.d.ts +42 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-core.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-core.js +191 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-core.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-inventory.d.ts +3 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-inventory.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-inventory.js +103 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-inventory.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-required-surfaces.d.ts +7 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-required-surfaces.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-required-surfaces.js +234 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/protocol-required-surfaces.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/reconnect-resume-token.d.ts +18 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/reconnect-resume-token.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/reconnect-resume-token.js +77 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/reconnect-resume-token.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/reconnect-resume.d.ts +70 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/reconnect-resume.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/reconnect-resume.js +138 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/reconnect-resume.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/request-router-params.d.ts +34 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/request-router-params.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/request-router-params.js +92 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/request-router-params.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/request-router.d.ts +32 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/request-router.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/request-router.js +279 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/request-router.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/runtime-errors.d.ts +6 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/runtime-errors.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/runtime-errors.js +8 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/runtime-errors.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/server-request-bridge.d.ts +76 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/server-request-bridge.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/server-request-bridge.js +169 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/server-request-bridge.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/server-request-fields.d.ts +24 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/server-request-fields.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/server-request-fields.js +81 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/server-request-fields.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/session-registry.d.ts +42 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/session-registry.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/session-registry.js +89 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/session-registry.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/stream-backpressure.d.ts +36 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/stream-backpressure.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/stream-backpressure.js +94 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/stream-backpressure.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/transport-runtime.d.ts +34 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/transport-runtime.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/transport-runtime.js +179 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/transport-runtime.js.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/websocket-transport.d.ts +20 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/websocket-transport.d.ts.map +1 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/websocket-transport.js +90 -0
- package/dist/core/extensions/builtin/pi-codex-app-server/websocket-transport.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.d.ts +3 -0
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js +12 -0
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-4-8.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +6 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
- package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/content.d.ts +2 -2
- package/dist/core/extensions/builtin/webfetch/webfetch/content.d.ts.map +1 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/content.js +170 -7
- package/dist/core/extensions/builtin/webfetch/webfetch/content.js.map +1 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/fetcher.d.ts.map +1 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/fetcher.js +101 -43
- package/dist/core/extensions/builtin/webfetch/webfetch/fetcher.js.map +1 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/tool.js +2 -2
- package/dist/core/extensions/builtin/webfetch/webfetch/tool.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +25 -14
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +5 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +20 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +19 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +1 -1
- package/dist/core/model-registry.d.ts +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +4 -6
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-manager.d.ts +1 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +14 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/provider-attribution.d.ts +2 -2
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/provider-display-names.js +1 -1
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/resource-loader.d.ts +14 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +40 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +20 -14
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +5 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +75 -14
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-resident-store.d.ts.map +1 -1
- package/dist/core/session-resident-store.js +63 -2
- package/dist/core/session-resident-store.js.map +1 -1
- package/dist/core/settings-manager.d.ts +5 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +14 -6
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/timings.d.ts +4 -2
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +24 -14
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +19 -11
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +12 -25
- package/dist/core/tools/read.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +22 -7
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +13 -11
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +3 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +11 -3
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/render-signature.d.ts +2 -0
- package/dist/modes/interactive/components/render-signature.d.ts.map +1 -0
- package/dist/modes/interactive/components/render-signature.js +101 -0
- package/dist/modes/interactive/components/render-signature.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +14 -3
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +4 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/user-message.js +1 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +64 -48
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +0 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +2 -13
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +10 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +11 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/rpc-entry.d.ts +3 -0
- package/dist/rpc-entry.d.ts.map +1 -0
- package/dist/rpc-entry.js +10 -0
- package/dist/rpc-entry.js.map +1 -0
- package/dist/utils/child-process.js +1 -1
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/image-convert.d.ts +1 -0
- package/dist/utils/image-convert.d.ts.map +1 -1
- package/dist/utils/image-convert.js +21 -15
- package/dist/utils/image-convert.js.map +1 -1
- package/dist/utils/image-process.d.ts +18 -0
- package/dist/utils/image-process.d.ts.map +1 -0
- package/dist/utils/image-process.js +83 -0
- package/dist/utils/image-process.js.map +1 -0
- package/dist/utils/mime.d.ts.map +1 -1
- package/dist/utils/mime.js +41 -0
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/version-check.d.ts +1 -0
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +7 -0
- package/dist/utils/version-check.js.map +1 -1
- package/docs/compaction.md +3 -1
- package/docs/extensions.md +456 -1
- package/docs/index.md +1 -1
- package/docs/keybindings.md +2 -2
- package/docs/models.md +4 -2
- package/docs/packages.md +9 -6
- package/docs/providers.md +3 -2
- package/docs/security.md +4 -0
- package/docs/settings.md +63 -0
- package/docs/terminal-setup.md +1 -7
- package/docs/tui.md +3 -3
- package/docs/usage.md +6 -4
- package/examples/extensions/README.md +1 -0
- package/examples/extensions/custom-compaction.ts +5 -4
- package/examples/extensions/custom-provider-anthropic/index.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +11 -7
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +1 -1
- package/examples/extensions/gondolin/package-lock.json +5 -5
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/handoff.ts +4 -4
- package/examples/extensions/plan-mode/README.md +3 -2
- package/examples/extensions/plan-mode/index.ts +87 -37
- package/examples/extensions/qna.ts +4 -4
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/summarize.ts +4 -3
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/02-custom-model.ts +2 -2
- package/examples/sdk/12-full-control.ts +2 -2
- package/node_modules/@earendil-works/pi-agent-core/README.md +0 -18
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +2 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +2 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +6 -19
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts +3 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +2 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +4 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +17 -15
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.d.ts +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +2 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +24 -22
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts +2 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +19 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +24 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +4 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/README.md +651 -526
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts +71 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +1277 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.lazy.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.lazy.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +231 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.lazy.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.lazy.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts +38 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +895 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.lazy.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.lazy.js +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/cloudflare.d.ts +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/cloudflare.js +7 -12
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/github-copilot-headers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/github-copilot-headers.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +436 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.lazy.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.lazy.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts +69 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +346 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +478 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.lazy.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.lazy.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +59 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +562 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.lazy.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.lazy.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/openai-codex-responses.d.ts +2 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/openai-codex-responses.js +54 -43
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.lazy.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.lazy.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +1094 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.lazy.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.lazy.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +568 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +657 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.lazy.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.lazy.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/{providers/images/openrouter.js → api/openrouter-images.js} +5 -15
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.lazy.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.lazy.js +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/simple-options.d.ts +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/simple-options.js +11 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/context.d.ts +7 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/context.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/context.js +42 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/context.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.d.ts +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.js +39 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.d.ts +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js +46 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +100 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +180 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.d.ts +2 -4
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.js +3 -4
- package/node_modules/@earendil-works/pi-ai/dist/bedrock-provider.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts +65 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.js +195 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +45 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +45 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.d.ts +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.js +0 -3
- package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/images-models.d.ts +93 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-models.js +139 -0
- package/node_modules/@earendil-works/pi-ai/dist/images-models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/images.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +21 -3
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +10 -5
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/legacy-api-aliases.d.ts +42 -0
- package/node_modules/@earendil-works/pi-ai/dist/legacy-api-aliases.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/legacy-api-aliases.js +49 -0
- package/node_modules/@earendil-works/pi-ai/dist/legacy-api-aliases.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +134 -25
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +2343 -399
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +70 -17244
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +239 -65
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +147 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts +2 -38
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +35 -896
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts +1735 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js +1692 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.d.ts +86 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.js +60 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts +4 -69
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +20 -1273
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.d.ts +424 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js +405 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts +2 -15
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +11 -234
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts +804 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js +743 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.d.ts +45 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js +41 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cerebras.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts +765 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js +666 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js +85 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.js +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.d.ts +302 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.js +239 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.d.ts +63 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.js +43 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/deepseek.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts +60 -11
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +86 -22
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.js +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.d.ts +376 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js +294 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/fireworks.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.js +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.d.ts +616 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js +426 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.d.ts +1 -68
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.js +1 -345
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.d.ts +4 -13
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js +33 -478
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.models.d.ts +202 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.models.js +182 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.d.ts +4 -11
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.js +15 -439
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.models.d.ts +328 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.models.js +288 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/google.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.d.ts +128 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js +125 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/groq.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.d.ts +963 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.js +869 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/huggingface.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/{openrouter.d.ts → register-builtins.d.ts} +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.js +34 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.d.ts +63 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.js +59 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.d.ts +54 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.js +56 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax-cn.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.d.ts +54 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.js +56 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/minimax.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.d.ts +2 -25
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js +12 -567
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.d.ts +513 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js +515 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.d.ts +234 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.js +169 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.d.ts +234 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.js +169 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.d.ts +563 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js +385 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/nvidia.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.d.ts +87 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.js +77 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts +2 -22
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +1 -1070
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts +1 -19
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js +1 -584
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts +2 -13
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +1 -656
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.d.ts +805 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.js +743 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.d.ts +309 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js +240 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.d.ts +976 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js +815 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-images.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-images.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-images.js +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter-images.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts +5402 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +4634 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.d.ts +1 -36
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.js +1 -190
- package/node_modules/@earendil-works/pi-ai/dist/providers/register-builtins.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.d.ts +598 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js +380 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/together.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts +3210 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +3169 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.d.ts +157 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js +131 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.d.ts +113 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js +95 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-ams.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.d.ts +113 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js +95 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-cn.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.d.ts +113 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js +95 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi-token-plan-sgp.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.d.ts +135 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js +113 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/xiaomi.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.d.ts +153 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.js +114 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai-coding-cn.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.d.ts +153 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.js +114 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/zai.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/stream.d.ts +1 -5
- package/node_modules/@earendil-works/pi-ai/dist/stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/stream.js +1 -53
- package/node_modules/@earendil-works/pi-ai/dist/stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +74 -8
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.d.ts +17 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +98 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.js +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/headers.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js +31 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +33 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.js +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +49 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +86 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +15 -42
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +5 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +3 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/node_modules/marked/README.md +8 -0
- package/node_modules/marked/bin/main.js +12 -11
- package/node_modules/marked/lib/marked.d.ts +22 -11
- package/node_modules/marked/lib/marked.esm.js +50 -46
- package/node_modules/marked/lib/marked.esm.js.map +3 -3
- package/node_modules/marked/lib/marked.umd.js +50 -46
- package/node_modules/marked/lib/marked.umd.js.map +3 -3
- package/node_modules/marked/man/marked.1 +1 -1
- package/node_modules/marked/package.json +17 -17
- package/npm-shrinkwrap.json +788 -38
- package/package.json +11 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/base.d.ts +0 -20
- package/node_modules/@earendil-works/pi-agent-core/dist/base.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/base.js +0 -20
- package/node_modules/@earendil-works/pi-agent-core/dist/base.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.d.ts +0 -20
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.js +0 -44
- package/node_modules/@earendil-works/pi-ai/dist/api-registry.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/base.d.ts +0 -30
- package/node_modules/@earendil-works/pi-ai/dist/base.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/base.js +0 -18
- package/node_modules/@earendil-works/pi-ai/dist/base.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot-headers.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-prompt-cache.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/transform-messages.js.map +0 -1
- /package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/github-copilot-headers.d.ts +0 -0
- /package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/github-copilot-headers.js +0 -0
- /package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/openai-prompt-cache.d.ts +0 -0
- /package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/openai-prompt-cache.js +0 -0
- /package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/transform-messages.d.ts +0 -0
- /package/node_modules/@earendil-works/pi-ai/dist/{providers → api}/transform-messages.js +0 -0
- /package/node_modules/marked/{LICENSE.md → LICENSE} +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import lockfile from "proper-lockfile";
|
|
4
|
+
import { CONFIG_DIR_NAME, getAgentDir } from "../../../../config.js";
|
|
5
|
+
import { emptyHookTrustState, readHookTrustStateJson } from "./trust.js";
|
|
6
|
+
export class FileHookStateStorage {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
const agentDir = options.agentDir ?? getAgentDir();
|
|
9
|
+
this.globalStatePath = join(agentDir, "hooks-state.json");
|
|
10
|
+
this.projectStatePath = join(options.cwd, CONFIG_DIR_NAME, "hooks-state.json");
|
|
11
|
+
}
|
|
12
|
+
read(scope) {
|
|
13
|
+
return withHookStateFileLock(statePathForScope(scope, this.globalStatePath, this.projectStatePath), (path) => readHookTrustStateJson(existsSync(path) ? readFileSync(path, "utf-8") : undefined));
|
|
14
|
+
}
|
|
15
|
+
update(scope, updater) {
|
|
16
|
+
return withHookStateFileLock(statePathForScope(scope, this.globalStatePath, this.projectStatePath), (path) => {
|
|
17
|
+
const current = readHookTrustStateJson(existsSync(path) ? readFileSync(path, "utf-8") : undefined);
|
|
18
|
+
const next = updater(current);
|
|
19
|
+
writeFileSync(path, serializeHookTrustState(next), "utf-8");
|
|
20
|
+
return next;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export class InMemoryHookStateStorage {
|
|
25
|
+
constructor() {
|
|
26
|
+
this.globalState = emptyHookTrustState();
|
|
27
|
+
this.projectState = emptyHookTrustState();
|
|
28
|
+
}
|
|
29
|
+
read(scope) {
|
|
30
|
+
return scope === "global" ? this.globalState : this.projectState;
|
|
31
|
+
}
|
|
32
|
+
update(scope, updater) {
|
|
33
|
+
const next = updater(this.read(scope));
|
|
34
|
+
if (scope === "global") {
|
|
35
|
+
this.globalState = next;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.projectState = next;
|
|
39
|
+
}
|
|
40
|
+
return next;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function statePathForScope(scope, globalStatePath, projectStatePath) {
|
|
44
|
+
return scope === "global" ? globalStatePath : projectStatePath;
|
|
45
|
+
}
|
|
46
|
+
function serializeHookTrustState(state) {
|
|
47
|
+
const sortedHooks = {};
|
|
48
|
+
for (const key of Object.keys(state.hooks).sort()) {
|
|
49
|
+
const entry = state.hooks[key];
|
|
50
|
+
if (entry !== undefined) {
|
|
51
|
+
sortedHooks[key] = entry;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return `${JSON.stringify({ version: 1, hooks: sortedHooks }, null, 2)}\n`;
|
|
55
|
+
}
|
|
56
|
+
function acquireHookStateLockSync(path) {
|
|
57
|
+
const stateDir = dirname(path);
|
|
58
|
+
mkdirSync(stateDir, { recursive: true });
|
|
59
|
+
const maxAttempts = 10;
|
|
60
|
+
const delayMs = 20;
|
|
61
|
+
let lastError;
|
|
62
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
63
|
+
try {
|
|
64
|
+
return lockfile.lockSync(stateDir, { realpath: false, lockfilePath: `${path}.lock` });
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
const code = errorCode(error);
|
|
68
|
+
if (code !== "ELOCKED" || attempt === maxAttempts) {
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
lastError = error;
|
|
72
|
+
const start = Date.now();
|
|
73
|
+
while (Date.now() - start < delayMs) {
|
|
74
|
+
Date.now();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (lastError instanceof Error) {
|
|
79
|
+
throw lastError;
|
|
80
|
+
}
|
|
81
|
+
throw new Error("Failed to acquire hook state lock");
|
|
82
|
+
}
|
|
83
|
+
function errorCode(error) {
|
|
84
|
+
if (!isRecord(error)) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
const code = error.code;
|
|
88
|
+
return typeof code === "string" ? code : undefined;
|
|
89
|
+
}
|
|
90
|
+
function isRecord(value) {
|
|
91
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
92
|
+
}
|
|
93
|
+
function withHookStateFileLock(path, fn) {
|
|
94
|
+
const release = acquireHookStateLockSync(path);
|
|
95
|
+
try {
|
|
96
|
+
return fn(path);
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
release();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=trust-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trust-storage.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/hooks/trust-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAA8B,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAarG,MAAM,OAAO,oBAAoB;IAIhC,YAAY,OAAoC;QAC/C,MAAM,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AAQ,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,qBAAqB,CAAI,IAAY,EAAE,EAAuB;IACtE,MAAM,OAAO,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,CAAC;QACJ,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;YAAS,CAAC;QACV,OAAO,EAAE,CAAC;IACX,CAAC;AACF,CAAC","sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport lockfile from \"proper-lockfile\";\nimport { CONFIG_DIR_NAME, getAgentDir } from \"../../../../config.ts\";\nimport { emptyHookTrustState, type HookTrustStorageScope, readHookTrustStateJson } from \"./trust.ts\";\nimport type { HookTrustEntry, HookTrustState } from \"./types.ts\";\n\nexport interface HookStateStorage {\n\tread(scope: HookTrustStorageScope): HookTrustState;\n\tupdate(scope: HookTrustStorageScope, updater: (current: HookTrustState) => HookTrustState): HookTrustState;\n}\n\nexport type FileHookStateStorageOptions = {\n\treadonly agentDir?: string;\n\treadonly cwd: string;\n};\n\nexport class FileHookStateStorage implements HookStateStorage {\n\tprivate readonly globalStatePath: string;\n\tprivate readonly projectStatePath: string;\n\n\tconstructor(options: FileHookStateStorageOptions) {\n\t\tconst agentDir = options.agentDir ?? getAgentDir();\n\t\tthis.globalStatePath = join(agentDir, \"hooks-state.json\");\n\t\tthis.projectStatePath = join(options.cwd, CONFIG_DIR_NAME, \"hooks-state.json\");\n\t}\n\n\tread(scope: HookTrustStorageScope): HookTrustState {\n\t\treturn withHookStateFileLock(statePathForScope(scope, this.globalStatePath, this.projectStatePath), (path) =>\n\t\t\treadHookTrustStateJson(existsSync(path) ? readFileSync(path, \"utf-8\") : undefined),\n\t\t);\n\t}\n\n\tupdate(scope: HookTrustStorageScope, updater: (current: HookTrustState) => HookTrustState): HookTrustState {\n\t\treturn withHookStateFileLock(statePathForScope(scope, this.globalStatePath, this.projectStatePath), (path) => {\n\t\t\tconst current = readHookTrustStateJson(existsSync(path) ? readFileSync(path, \"utf-8\") : undefined);\n\t\t\tconst next = updater(current);\n\t\t\twriteFileSync(path, serializeHookTrustState(next), \"utf-8\");\n\t\t\treturn next;\n\t\t});\n\t}\n}\n\nexport class InMemoryHookStateStorage implements HookStateStorage {\n\tprivate globalState: HookTrustState = emptyHookTrustState();\n\tprivate projectState: HookTrustState = emptyHookTrustState();\n\n\tread(scope: HookTrustStorageScope): HookTrustState {\n\t\treturn scope === \"global\" ? this.globalState : this.projectState;\n\t}\n\n\tupdate(scope: HookTrustStorageScope, updater: (current: HookTrustState) => HookTrustState): HookTrustState {\n\t\tconst next = updater(this.read(scope));\n\t\tif (scope === \"global\") {\n\t\t\tthis.globalState = next;\n\t\t} else {\n\t\t\tthis.projectState = next;\n\t\t}\n\t\treturn next;\n\t}\n}\n\nfunction statePathForScope(scope: HookTrustStorageScope, globalStatePath: string, projectStatePath: string): string {\n\treturn scope === \"global\" ? globalStatePath : projectStatePath;\n}\n\nfunction serializeHookTrustState(state: HookTrustState): string {\n\tconst sortedHooks: Record<string, HookTrustEntry> = {};\n\tfor (const key of Object.keys(state.hooks).sort()) {\n\t\tconst entry = state.hooks[key];\n\t\tif (entry !== undefined) {\n\t\t\tsortedHooks[key] = entry;\n\t\t}\n\t}\n\treturn `${JSON.stringify({ version: 1, hooks: sortedHooks }, null, 2)}\\n`;\n}\n\nfunction acquireHookStateLockSync(path: string): () => void {\n\tconst stateDir = dirname(path);\n\tmkdirSync(stateDir, { recursive: true });\n\tconst maxAttempts = 10;\n\tconst delayMs = 20;\n\tlet lastError: unknown;\n\n\tfor (let attempt = 1; attempt <= maxAttempts; attempt++) {\n\t\ttry {\n\t\t\treturn lockfile.lockSync(stateDir, { realpath: false, lockfilePath: `${path}.lock` });\n\t\t} catch (error) {\n\t\t\tconst code = errorCode(error);\n\t\t\tif (code !== \"ELOCKED\" || attempt === maxAttempts) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tlastError = error;\n\t\t\tconst start = Date.now();\n\t\t\twhile (Date.now() - start < delayMs) {\n\t\t\t\tDate.now();\n\t\t\t}\n\t\t}\n\t}\n\n\tif (lastError instanceof Error) {\n\t\tthrow lastError;\n\t}\n\tthrow new Error(\"Failed to acquire hook state lock\");\n}\n\nfunction errorCode(error: unknown): string | undefined {\n\tif (!isRecord(error)) {\n\t\treturn undefined;\n\t}\n\tconst code = error.code;\n\treturn typeof code === \"string\" ? code : undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction withHookStateFileLock<T>(path: string, fn: (path: string) => T): T {\n\tconst release = acquireHookStateLockSync(path);\n\ttry {\n\t\treturn fn(path);\n\t} finally {\n\t\trelease();\n\t}\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ExecutableHookHandler, HookSourceScope, HookTrustEntry, HookTrustState } from "./types.ts";
|
|
2
|
+
export type HookTrustPlatform = NodeJS.Platform;
|
|
3
|
+
export type HookTrustStorageScope = "global" | "project";
|
|
4
|
+
export type HookTrustOptions = {
|
|
5
|
+
readonly platform?: HookTrustPlatform;
|
|
6
|
+
};
|
|
7
|
+
export type HookTrustStorageOptions = {
|
|
8
|
+
readonly projectTrusted: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type HookTrustRecord = {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly currentHash: string;
|
|
13
|
+
readonly enabled: boolean;
|
|
14
|
+
readonly trusted: boolean;
|
|
15
|
+
readonly executable: boolean;
|
|
16
|
+
readonly scope: HookSourceScope;
|
|
17
|
+
readonly sourcePath: string;
|
|
18
|
+
readonly matcher?: string;
|
|
19
|
+
readonly commandPreview: string;
|
|
20
|
+
readonly entry?: HookTrustEntry;
|
|
21
|
+
};
|
|
22
|
+
export declare function emptyHookTrustState(): HookTrustState;
|
|
23
|
+
export declare function hookTrustId(handler: ExecutableHookHandler): string;
|
|
24
|
+
export declare function buildHookTrustRecord(handler: ExecutableHookHandler, options?: HookTrustOptions): HookTrustRecord;
|
|
25
|
+
export declare function createHookTrustEntry(handler: ExecutableHookHandler, options?: HookTrustOptions & {
|
|
26
|
+
readonly updatedAt?: string;
|
|
27
|
+
}): HookTrustEntry;
|
|
28
|
+
export declare function hashCommandHook(handler: ExecutableHookHandler, options?: HookTrustOptions): string;
|
|
29
|
+
export declare function isCommandHookTrusted(handler: ExecutableHookHandler, state: HookTrustState, options?: HookTrustOptions): boolean;
|
|
30
|
+
export declare function listHookTrustRecords(handlers: readonly ExecutableHookHandler[], state: HookTrustState, options?: HookTrustOptions): readonly HookTrustRecord[];
|
|
31
|
+
export declare function filterExecutableTrustedHooks(handlers: readonly ExecutableHookHandler[], state: HookTrustState, options?: HookTrustOptions): readonly ExecutableHookHandler[];
|
|
32
|
+
export declare function readHookTrustStateJson(input: string | undefined): HookTrustState;
|
|
33
|
+
export declare function hookTrustStorageScope(handler: ExecutableHookHandler, options: HookTrustStorageOptions): HookTrustStorageScope | undefined;
|
|
34
|
+
//# sourceMappingURL=trust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trust.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/hooks/trust.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,qBAAqB,EAErB,eAAe,EACf,cAAc,EACd,cAAc,EACd,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC;AAChD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CACtC,CAAC;AAEF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,EACrB,OAAO,GAAE,gBAAqB,GAC5B,SAAS,eAAe,EAAE,CAE5B;AAED,wBAAgB,4BAA4B,CAC3C,QAAQ,EAAE,SAAS,qBAAqB,EAAE,EAC1C,KAAK,EAAE,cAAc,EACrB,OAAO,GAAE,gBAAqB,GAC5B,SAAS,qBAAqB,EAAE,CAElC;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,CAYhF;AAED,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,uBAAuB,GAC9B,qBAAqB,GAAG,SAAS,CAKnC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { DEFAULT_HOOK_TIMEOUT_SECONDS, isValidHookTimeoutSeconds } from "./safety.js";
|
|
3
|
+
const HOOK_STATE_VERSION = 1;
|
|
4
|
+
export function emptyHookTrustState() {
|
|
5
|
+
return { version: HOOK_STATE_VERSION, hooks: {} };
|
|
6
|
+
}
|
|
7
|
+
export function hookTrustId(handler) {
|
|
8
|
+
return `hk_${sourceKeyHash(handler.source)}_${handler.event}_${handler.groupIndex}_${handler.handlerIndex}`;
|
|
9
|
+
}
|
|
10
|
+
export function buildHookTrustRecord(handler, options = {}) {
|
|
11
|
+
const id = hookTrustId(handler);
|
|
12
|
+
const currentHash = hashCommandHook(handler, options);
|
|
13
|
+
const commandPreview = selectedCommand(handler, options.platform ?? process.platform);
|
|
14
|
+
return {
|
|
15
|
+
id,
|
|
16
|
+
currentHash,
|
|
17
|
+
enabled: true,
|
|
18
|
+
trusted: false,
|
|
19
|
+
executable: false,
|
|
20
|
+
scope: handler.source.scope,
|
|
21
|
+
sourcePath: handler.source.sourcePath,
|
|
22
|
+
...(handler.matcher === undefined ? {} : { matcher: handler.matcher }),
|
|
23
|
+
commandPreview,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function createHookTrustEntry(handler, options = {}) {
|
|
27
|
+
const commandPreview = selectedCommand(handler, options.platform ?? process.platform);
|
|
28
|
+
return {
|
|
29
|
+
enabled: true,
|
|
30
|
+
trustedHash: hashCommandHook(handler, options),
|
|
31
|
+
scope: handler.source.scope,
|
|
32
|
+
sourcePath: handler.source.sourcePath,
|
|
33
|
+
...(handler.matcher === undefined ? {} : { matcher: handler.matcher }),
|
|
34
|
+
commandPreview,
|
|
35
|
+
updatedAt: options.updatedAt ?? new Date().toISOString(),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function hashCommandHook(handler, options = {}) {
|
|
39
|
+
const platform = options.platform ?? process.platform;
|
|
40
|
+
const hook = {
|
|
41
|
+
async: false,
|
|
42
|
+
command: handler.config.command,
|
|
43
|
+
commandWindows: handler.config.commandWindows,
|
|
44
|
+
platformCommand: selectedCommand(handler, platform),
|
|
45
|
+
statusMessage: handler.config.statusMessage,
|
|
46
|
+
timeout: normalizedTimeout(handler.config.timeout),
|
|
47
|
+
type: "command",
|
|
48
|
+
};
|
|
49
|
+
const identity = {
|
|
50
|
+
event: handler.event,
|
|
51
|
+
hook,
|
|
52
|
+
matcher: handler.matcher,
|
|
53
|
+
sourceKeyHash: sourceKeyHash(handler.source),
|
|
54
|
+
};
|
|
55
|
+
return `sha256:${sha256Hex(JSON.stringify(canonicalJson(identity)))}`;
|
|
56
|
+
}
|
|
57
|
+
export function isCommandHookTrusted(handler, state, options = {}) {
|
|
58
|
+
const record = buildStatefulHookTrustRecord(handler, state, options);
|
|
59
|
+
return record.executable;
|
|
60
|
+
}
|
|
61
|
+
export function listHookTrustRecords(handlers, state, options = {}) {
|
|
62
|
+
return handlers.map((handler) => buildStatefulHookTrustRecord(handler, state, options));
|
|
63
|
+
}
|
|
64
|
+
export function filterExecutableTrustedHooks(handlers, state, options = {}) {
|
|
65
|
+
return handlers.filter((handler) => buildStatefulHookTrustRecord(handler, state, options).executable);
|
|
66
|
+
}
|
|
67
|
+
export function readHookTrustStateJson(input) {
|
|
68
|
+
if (input === undefined || input.trim() === "") {
|
|
69
|
+
return emptyHookTrustState();
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
return parseHookTrustState(JSON.parse(input));
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
if (error instanceof Error) {
|
|
76
|
+
return emptyHookTrustState();
|
|
77
|
+
}
|
|
78
|
+
return emptyHookTrustState();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export function hookTrustStorageScope(handler, options) {
|
|
82
|
+
if (handler.source.scope === "project") {
|
|
83
|
+
return options.projectTrusted ? "project" : undefined;
|
|
84
|
+
}
|
|
85
|
+
return "global";
|
|
86
|
+
}
|
|
87
|
+
function buildStatefulHookTrustRecord(handler, state, options) {
|
|
88
|
+
const base = buildHookTrustRecord(handler, options);
|
|
89
|
+
const entry = state.hooks[base.id];
|
|
90
|
+
const enabled = entry?.enabled ?? true;
|
|
91
|
+
const trusted = entry?.trustedHash === base.currentHash;
|
|
92
|
+
return {
|
|
93
|
+
...base,
|
|
94
|
+
enabled,
|
|
95
|
+
trusted,
|
|
96
|
+
executable: enabled && trusted,
|
|
97
|
+
...(entry === undefined ? {} : { entry }),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function parseHookTrustState(input) {
|
|
101
|
+
if (!isRecord(input) || input.version !== HOOK_STATE_VERSION || !isRecord(input.hooks)) {
|
|
102
|
+
return emptyHookTrustState();
|
|
103
|
+
}
|
|
104
|
+
const hooks = {};
|
|
105
|
+
for (const [id, entry] of Object.entries(input.hooks)) {
|
|
106
|
+
const parsed = parseHookTrustEntry(entry);
|
|
107
|
+
if (parsed !== undefined) {
|
|
108
|
+
hooks[id] = parsed;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { version: HOOK_STATE_VERSION, hooks };
|
|
112
|
+
}
|
|
113
|
+
function parseHookTrustEntry(input) {
|
|
114
|
+
if (!isRecord(input)) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const enabled = input.enabled;
|
|
118
|
+
const trustedHash = input.trustedHash;
|
|
119
|
+
const scope = input.scope;
|
|
120
|
+
const sourcePath = input.sourcePath;
|
|
121
|
+
const matcher = input.matcher;
|
|
122
|
+
const commandPreview = input.commandPreview;
|
|
123
|
+
const updatedAt = input.updatedAt;
|
|
124
|
+
if (typeof enabled !== "boolean" ||
|
|
125
|
+
(trustedHash !== undefined && typeof trustedHash !== "string") ||
|
|
126
|
+
!isHookSourceScope(scope) ||
|
|
127
|
+
typeof sourcePath !== "string" ||
|
|
128
|
+
(matcher !== undefined && typeof matcher !== "string") ||
|
|
129
|
+
typeof commandPreview !== "string" ||
|
|
130
|
+
typeof updatedAt !== "string") {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
enabled,
|
|
135
|
+
...(trustedHash === undefined ? {} : { trustedHash }),
|
|
136
|
+
scope,
|
|
137
|
+
sourcePath,
|
|
138
|
+
...(matcher === undefined ? {} : { matcher }),
|
|
139
|
+
commandPreview,
|
|
140
|
+
updatedAt,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function selectedCommand(handler, platform) {
|
|
144
|
+
if (platform === "win32" && handler.config.commandWindows !== undefined) {
|
|
145
|
+
return handler.config.commandWindows;
|
|
146
|
+
}
|
|
147
|
+
return handler.config.command;
|
|
148
|
+
}
|
|
149
|
+
function normalizedTimeout(timeout) {
|
|
150
|
+
if (timeout === undefined) {
|
|
151
|
+
return DEFAULT_HOOK_TIMEOUT_SECONDS;
|
|
152
|
+
}
|
|
153
|
+
if (!isValidHookTimeoutSeconds(timeout)) {
|
|
154
|
+
throw new Error("Invalid command hook timeout reached trust hashing.");
|
|
155
|
+
}
|
|
156
|
+
return timeout;
|
|
157
|
+
}
|
|
158
|
+
function sourceKeyHash(source) {
|
|
159
|
+
return sha256Hex([source.scope, source.sourcePath, source.pluginRoot ?? "", source.manifestPath ?? ""].join("\0")).slice(0, 12);
|
|
160
|
+
}
|
|
161
|
+
function sha256Hex(value) {
|
|
162
|
+
return createHash("sha256").update(value).digest("hex");
|
|
163
|
+
}
|
|
164
|
+
function canonicalJson(value) {
|
|
165
|
+
if (Array.isArray(value)) {
|
|
166
|
+
return value.map(canonicalJson);
|
|
167
|
+
}
|
|
168
|
+
if (!isJsonRecord(value)) {
|
|
169
|
+
return value;
|
|
170
|
+
}
|
|
171
|
+
const result = {};
|
|
172
|
+
for (const key of Object.keys(value).sort()) {
|
|
173
|
+
const child = value[key];
|
|
174
|
+
if (child !== undefined) {
|
|
175
|
+
result[key] = canonicalJson(child);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
function isRecord(value) {
|
|
181
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
182
|
+
}
|
|
183
|
+
function isJsonRecord(value) {
|
|
184
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
185
|
+
}
|
|
186
|
+
function isHookSourceScope(value) {
|
|
187
|
+
return (value === "global" ||
|
|
188
|
+
value === "project" ||
|
|
189
|
+
value === "plugin" ||
|
|
190
|
+
value === "runtime" ||
|
|
191
|
+
value === "cli" ||
|
|
192
|
+
value === "managed");
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=trust.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trust.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/hooks/trust.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAyCtF,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,MAAM,UAAU,mBAAmB;IAClC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAA8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,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,YAAY,CAAC,KAAgB;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACxC,OAAO,CACN,KAAK,KAAK,QAAQ;QAClB,KAAK,KAAK,SAAS;QACnB,KAAK,KAAK,QAAQ;QAClB,KAAK,KAAK,SAAS;QACnB,KAAK,KAAK,KAAK;QACf,KAAK,KAAK,SAAS,CACnB,CAAC;AACH,CAAC","sourcesContent":["import { createHash } from \"node:crypto\";\nimport { DEFAULT_HOOK_TIMEOUT_SECONDS, isValidHookTimeoutSeconds } from \"./safety.ts\";\nimport type {\n\tExecutableHookHandler,\n\tHookSourceMetadata,\n\tHookSourceScope,\n\tHookTrustEntry,\n\tHookTrustState,\n} from \"./types.ts\";\n\nexport type HookTrustPlatform = NodeJS.Platform;\nexport type HookTrustStorageScope = \"global\" | \"project\";\n\nexport type HookTrustOptions = {\n\treadonly platform?: HookTrustPlatform;\n};\n\nexport type HookTrustStorageOptions = {\n\treadonly projectTrusted: boolean;\n};\n\nexport type HookTrustRecord = {\n\treadonly id: string;\n\treadonly currentHash: string;\n\treadonly enabled: boolean;\n\treadonly trusted: boolean;\n\treadonly executable: boolean;\n\treadonly scope: HookSourceScope;\n\treadonly sourcePath: string;\n\treadonly matcher?: string;\n\treadonly commandPreview: string;\n\treadonly entry?: HookTrustEntry;\n};\n\ntype JsonValue =\n\t| null\n\t| boolean\n\t| number\n\t| string\n\t| readonly JsonValue[]\n\t| { readonly [key: string]: JsonValue | undefined };\n\nconst HOOK_STATE_VERSION = 1;\n\nexport function emptyHookTrustState(): HookTrustState {\n\treturn { version: HOOK_STATE_VERSION, hooks: {} };\n}\n\nexport function hookTrustId(handler: ExecutableHookHandler): string {\n\treturn `hk_${sourceKeyHash(handler.source)}_${handler.event}_${handler.groupIndex}_${handler.handlerIndex}`;\n}\n\nexport function buildHookTrustRecord(handler: ExecutableHookHandler, options: HookTrustOptions = {}): HookTrustRecord {\n\tconst id = hookTrustId(handler);\n\tconst currentHash = hashCommandHook(handler, options);\n\tconst commandPreview = selectedCommand(handler, options.platform ?? process.platform);\n\treturn {\n\t\tid,\n\t\tcurrentHash,\n\t\tenabled: true,\n\t\ttrusted: false,\n\t\texecutable: false,\n\t\tscope: handler.source.scope,\n\t\tsourcePath: handler.source.sourcePath,\n\t\t...(handler.matcher === undefined ? {} : { matcher: handler.matcher }),\n\t\tcommandPreview,\n\t};\n}\n\nexport function createHookTrustEntry(\n\thandler: ExecutableHookHandler,\n\toptions: HookTrustOptions & { readonly updatedAt?: string } = {},\n): HookTrustEntry {\n\tconst commandPreview = selectedCommand(handler, options.platform ?? process.platform);\n\treturn {\n\t\tenabled: true,\n\t\ttrustedHash: hashCommandHook(handler, options),\n\t\tscope: handler.source.scope,\n\t\tsourcePath: handler.source.sourcePath,\n\t\t...(handler.matcher === undefined ? {} : { matcher: handler.matcher }),\n\t\tcommandPreview,\n\t\tupdatedAt: options.updatedAt ?? new Date().toISOString(),\n\t};\n}\n\nexport function hashCommandHook(handler: ExecutableHookHandler, options: HookTrustOptions = {}): string {\n\tconst platform = options.platform ?? process.platform;\n\tconst hook: { [key: string]: JsonValue | undefined } = {\n\t\tasync: false,\n\t\tcommand: handler.config.command,\n\t\tcommandWindows: handler.config.commandWindows,\n\t\tplatformCommand: selectedCommand(handler, platform),\n\t\tstatusMessage: handler.config.statusMessage,\n\t\ttimeout: normalizedTimeout(handler.config.timeout),\n\t\ttype: \"command\",\n\t};\n\tconst identity: { [key: string]: JsonValue | undefined } = {\n\t\tevent: handler.event,\n\t\thook,\n\t\tmatcher: handler.matcher,\n\t\tsourceKeyHash: sourceKeyHash(handler.source),\n\t};\n\treturn `sha256:${sha256Hex(JSON.stringify(canonicalJson(identity)))}`;\n}\n\nexport function isCommandHookTrusted(\n\thandler: ExecutableHookHandler,\n\tstate: HookTrustState,\n\toptions: HookTrustOptions = {},\n): boolean {\n\tconst record = buildStatefulHookTrustRecord(handler, state, options);\n\treturn record.executable;\n}\n\nexport function listHookTrustRecords(\n\thandlers: readonly ExecutableHookHandler[],\n\tstate: HookTrustState,\n\toptions: HookTrustOptions = {},\n): readonly HookTrustRecord[] {\n\treturn handlers.map((handler) => buildStatefulHookTrustRecord(handler, state, options));\n}\n\nexport function filterExecutableTrustedHooks(\n\thandlers: readonly ExecutableHookHandler[],\n\tstate: HookTrustState,\n\toptions: HookTrustOptions = {},\n): readonly ExecutableHookHandler[] {\n\treturn handlers.filter((handler) => buildStatefulHookTrustRecord(handler, state, options).executable);\n}\n\nexport function readHookTrustStateJson(input: string | undefined): HookTrustState {\n\tif (input === undefined || input.trim() === \"\") {\n\t\treturn emptyHookTrustState();\n\t}\n\ttry {\n\t\treturn parseHookTrustState(JSON.parse(input));\n\t} catch (error) {\n\t\tif (error instanceof Error) {\n\t\t\treturn emptyHookTrustState();\n\t\t}\n\t\treturn emptyHookTrustState();\n\t}\n}\n\nexport function hookTrustStorageScope(\n\thandler: ExecutableHookHandler,\n\toptions: HookTrustStorageOptions,\n): HookTrustStorageScope | undefined {\n\tif (handler.source.scope === \"project\") {\n\t\treturn options.projectTrusted ? \"project\" : undefined;\n\t}\n\treturn \"global\";\n}\n\nfunction buildStatefulHookTrustRecord(\n\thandler: ExecutableHookHandler,\n\tstate: HookTrustState,\n\toptions: HookTrustOptions,\n): HookTrustRecord {\n\tconst base = buildHookTrustRecord(handler, options);\n\tconst entry = state.hooks[base.id];\n\tconst enabled = entry?.enabled ?? true;\n\tconst trusted = entry?.trustedHash === base.currentHash;\n\treturn {\n\t\t...base,\n\t\tenabled,\n\t\ttrusted,\n\t\texecutable: enabled && trusted,\n\t\t...(entry === undefined ? {} : { entry }),\n\t};\n}\n\nfunction parseHookTrustState(input: unknown): HookTrustState {\n\tif (!isRecord(input) || input.version !== HOOK_STATE_VERSION || !isRecord(input.hooks)) {\n\t\treturn emptyHookTrustState();\n\t}\n\n\tconst hooks: Record<string, HookTrustEntry> = {};\n\tfor (const [id, entry] of Object.entries(input.hooks)) {\n\t\tconst parsed = parseHookTrustEntry(entry);\n\t\tif (parsed !== undefined) {\n\t\t\thooks[id] = parsed;\n\t\t}\n\t}\n\treturn { version: HOOK_STATE_VERSION, hooks };\n}\n\nfunction parseHookTrustEntry(input: unknown): HookTrustEntry | undefined {\n\tif (!isRecord(input)) {\n\t\treturn undefined;\n\t}\n\tconst enabled = input.enabled;\n\tconst trustedHash = input.trustedHash;\n\tconst scope = input.scope;\n\tconst sourcePath = input.sourcePath;\n\tconst matcher = input.matcher;\n\tconst commandPreview = input.commandPreview;\n\tconst updatedAt = input.updatedAt;\n\tif (\n\t\ttypeof enabled !== \"boolean\" ||\n\t\t(trustedHash !== undefined && typeof trustedHash !== \"string\") ||\n\t\t!isHookSourceScope(scope) ||\n\t\ttypeof sourcePath !== \"string\" ||\n\t\t(matcher !== undefined && typeof matcher !== \"string\") ||\n\t\ttypeof commandPreview !== \"string\" ||\n\t\ttypeof updatedAt !== \"string\"\n\t) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\tenabled,\n\t\t...(trustedHash === undefined ? {} : { trustedHash }),\n\t\tscope,\n\t\tsourcePath,\n\t\t...(matcher === undefined ? {} : { matcher }),\n\t\tcommandPreview,\n\t\tupdatedAt,\n\t};\n}\n\nfunction selectedCommand(handler: ExecutableHookHandler, platform: HookTrustPlatform): string {\n\tif (platform === \"win32\" && handler.config.commandWindows !== undefined) {\n\t\treturn handler.config.commandWindows;\n\t}\n\treturn handler.config.command;\n}\n\nfunction normalizedTimeout(timeout: number | undefined): number {\n\tif (timeout === undefined) {\n\t\treturn DEFAULT_HOOK_TIMEOUT_SECONDS;\n\t}\n\tif (!isValidHookTimeoutSeconds(timeout)) {\n\t\tthrow new Error(\"Invalid command hook timeout reached trust hashing.\");\n\t}\n\treturn timeout;\n}\n\nfunction sourceKeyHash(source: HookSourceMetadata): string {\n\treturn sha256Hex(\n\t\t[source.scope, source.sourcePath, source.pluginRoot ?? \"\", source.manifestPath ?? \"\"].join(\"\\0\"),\n\t).slice(0, 12);\n}\n\nfunction sha256Hex(value: string): string {\n\treturn createHash(\"sha256\").update(value).digest(\"hex\");\n}\n\nfunction canonicalJson(value: JsonValue): JsonValue {\n\tif (Array.isArray(value)) {\n\t\treturn value.map(canonicalJson);\n\t}\n\tif (!isJsonRecord(value)) {\n\t\treturn value;\n\t}\n\tconst result: { [key: string]: JsonValue } = {};\n\tfor (const key of Object.keys(value).sort()) {\n\t\tconst child = value[key];\n\t\tif (child !== undefined) {\n\t\t\tresult[key] = canonicalJson(child);\n\t\t}\n\t}\n\treturn result;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isJsonRecord(value: JsonValue): value is { readonly [key: string]: JsonValue | undefined } {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isHookSourceScope(value: unknown): value is HookSourceScope {\n\treturn (\n\t\tvalue === \"global\" ||\n\t\tvalue === \"project\" ||\n\t\tvalue === \"plugin\" ||\n\t\tvalue === \"runtime\" ||\n\t\tvalue === \"cli\" ||\n\t\tvalue === \"managed\"\n\t);\n}\n"]}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export declare const SUPPORTED_HOOK_EVENTS: readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "SessionStart", "PreCompact", "PostCompact", "Stop"];
|
|
2
|
+
export declare const UNSUPPORTED_KNOWN_HOOK_EVENTS: readonly ["PermissionRequest", "PermissionDenied", "SubagentStart", "SubagentStop", "Notification", "Setup", "UserPromptExpansion", "PostToolUseFailure", "PostToolBatch", "TaskCreated", "TaskCompleted", "StopFailure", "TeammateIdle", "InstructionsLoaded", "ConfigChange", "CwdChanged", "FileChanged", "WorktreeCreate", "WorktreeRemove", "MessageDisplay", "SessionEnd", "Elicitation", "ElicitationResult"];
|
|
3
|
+
export declare const UNSUPPORTED_HANDLER_TYPES: readonly ["prompt", "agent", "http", "mcp_tool"];
|
|
4
|
+
export type SupportedHookEvent = (typeof SUPPORTED_HOOK_EVENTS)[number];
|
|
5
|
+
export type UnsupportedKnownHookEvent = (typeof UNSUPPORTED_KNOWN_HOOK_EVENTS)[number];
|
|
6
|
+
export type HookSourceScope = "global" | "project" | "plugin" | "runtime" | "cli" | "managed";
|
|
7
|
+
export type HookDiscoveryTiming = "pre-session" | "runtime";
|
|
8
|
+
export type HookSourceMetadata = {
|
|
9
|
+
readonly scope: HookSourceScope;
|
|
10
|
+
readonly sourcePath: string;
|
|
11
|
+
readonly displayOrder: number;
|
|
12
|
+
readonly discoveredAt: HookDiscoveryTiming;
|
|
13
|
+
readonly pluginRoot?: string;
|
|
14
|
+
readonly manifestPath?: string;
|
|
15
|
+
};
|
|
16
|
+
export type CommandHookConfig = {
|
|
17
|
+
readonly type: "command";
|
|
18
|
+
readonly command: string;
|
|
19
|
+
readonly commandWindows?: string;
|
|
20
|
+
readonly timeout?: number;
|
|
21
|
+
readonly statusMessage?: string;
|
|
22
|
+
};
|
|
23
|
+
export type ExecutableHookHandler = {
|
|
24
|
+
readonly event: SupportedHookEvent;
|
|
25
|
+
readonly matcher?: string;
|
|
26
|
+
readonly groupIndex: number;
|
|
27
|
+
readonly handlerIndex: number;
|
|
28
|
+
readonly config: CommandHookConfig;
|
|
29
|
+
readonly source: HookSourceMetadata;
|
|
30
|
+
};
|
|
31
|
+
export type HookDiagnosticCode = "invalid_root" | "invalid_hooks" | "invalid_event_config" | "invalid_matcher" | "invalid_handler_group" | "invalid_handler_list" | "invalid_handler" | "invalid_command" | "invalid_command_windows" | "invalid_command_target" | "missing_command_target" | "invalid_timeout" | "invalid_status_message" | "unknown_event" | "unsupported_event" | "unsupported_field" | "unsupported_handler_type" | "unsupported_async_handler" | "unsupported_command_variant";
|
|
32
|
+
export type HookDiagnostic = {
|
|
33
|
+
readonly code: HookDiagnosticCode;
|
|
34
|
+
readonly severity: "error" | "warning";
|
|
35
|
+
readonly message: string;
|
|
36
|
+
readonly path: string;
|
|
37
|
+
readonly source: HookSourceMetadata;
|
|
38
|
+
readonly event?: string;
|
|
39
|
+
};
|
|
40
|
+
export type ParsedHookConfig = {
|
|
41
|
+
readonly executableHandlers: readonly ExecutableHookHandler[];
|
|
42
|
+
readonly diagnostics: readonly HookDiagnostic[];
|
|
43
|
+
};
|
|
44
|
+
export type HookTrustEntry = {
|
|
45
|
+
readonly enabled: boolean;
|
|
46
|
+
readonly trustedHash?: string;
|
|
47
|
+
readonly scope: HookSourceScope;
|
|
48
|
+
readonly sourcePath: string;
|
|
49
|
+
readonly matcher?: string;
|
|
50
|
+
readonly commandPreview: string;
|
|
51
|
+
readonly updatedAt: string;
|
|
52
|
+
};
|
|
53
|
+
export type HookTrustState = {
|
|
54
|
+
readonly version: 1;
|
|
55
|
+
readonly hooks: Readonly<Record<string, HookTrustEntry>>;
|
|
56
|
+
};
|
|
57
|
+
export type HookRuntimeState = {
|
|
58
|
+
readonly parsed: ParsedHookConfig;
|
|
59
|
+
readonly trust: HookTrustState;
|
|
60
|
+
};
|
|
61
|
+
export type HookInputWire = {
|
|
62
|
+
readonly event: "SessionStart";
|
|
63
|
+
readonly sessionId: string;
|
|
64
|
+
readonly cwd: string;
|
|
65
|
+
readonly hook_event_name?: "SessionStart";
|
|
66
|
+
readonly reason?: string;
|
|
67
|
+
readonly session_id?: string;
|
|
68
|
+
readonly transcript_path?: string;
|
|
69
|
+
} | {
|
|
70
|
+
readonly event: "UserPromptSubmit";
|
|
71
|
+
readonly prompt: string;
|
|
72
|
+
readonly cwd: string;
|
|
73
|
+
readonly session_id?: string;
|
|
74
|
+
readonly permission_mode?: string;
|
|
75
|
+
readonly transcript_path?: string;
|
|
76
|
+
} | {
|
|
77
|
+
readonly event: "PreToolUse";
|
|
78
|
+
readonly toolName: string;
|
|
79
|
+
readonly toolInput: unknown;
|
|
80
|
+
readonly cwd: string;
|
|
81
|
+
readonly session_id?: string;
|
|
82
|
+
readonly hook_event_name?: "PreToolUse";
|
|
83
|
+
readonly tool_name?: string;
|
|
84
|
+
readonly tool_input?: unknown;
|
|
85
|
+
readonly tool_use_id?: string;
|
|
86
|
+
} | {
|
|
87
|
+
readonly event: "PostToolUse";
|
|
88
|
+
readonly toolName: string;
|
|
89
|
+
readonly toolInput: unknown;
|
|
90
|
+
readonly toolOutput: unknown;
|
|
91
|
+
readonly cwd: string;
|
|
92
|
+
readonly session_id?: string;
|
|
93
|
+
readonly hook_event_name?: "PostToolUse";
|
|
94
|
+
readonly tool_name?: string;
|
|
95
|
+
readonly tool_input?: unknown;
|
|
96
|
+
readonly tool_response?: unknown;
|
|
97
|
+
readonly tool_use_id?: string;
|
|
98
|
+
} | {
|
|
99
|
+
readonly event: "PreCompact";
|
|
100
|
+
readonly reason: string;
|
|
101
|
+
readonly cwd: string;
|
|
102
|
+
readonly custom_instructions?: string;
|
|
103
|
+
readonly hook_event_name?: "PreCompact";
|
|
104
|
+
readonly request_id?: string;
|
|
105
|
+
readonly session_id?: string;
|
|
106
|
+
readonly transcript_path?: string;
|
|
107
|
+
readonly will_retry?: boolean;
|
|
108
|
+
} | {
|
|
109
|
+
readonly event: "PostCompact";
|
|
110
|
+
readonly reason: string;
|
|
111
|
+
readonly cwd: string;
|
|
112
|
+
readonly accepted?: boolean;
|
|
113
|
+
readonly hook_event_name?: "PostCompact";
|
|
114
|
+
readonly request_id?: string;
|
|
115
|
+
readonly session_id?: string;
|
|
116
|
+
readonly transcript_path?: string;
|
|
117
|
+
readonly will_retry?: boolean;
|
|
118
|
+
} | {
|
|
119
|
+
readonly event: "Stop";
|
|
120
|
+
readonly stopReason?: string;
|
|
121
|
+
readonly cwd: string;
|
|
122
|
+
readonly hook_event_name?: "Stop";
|
|
123
|
+
readonly session_id?: string;
|
|
124
|
+
readonly transcript_path?: string;
|
|
125
|
+
};
|
|
126
|
+
export type HookOutputWire = {
|
|
127
|
+
readonly decision?: "approve" | "block" | "deny" | "ask";
|
|
128
|
+
readonly reason?: string;
|
|
129
|
+
readonly additionalContext?: string;
|
|
130
|
+
readonly updatedInput?: unknown;
|
|
131
|
+
readonly updatedToolOutput?: unknown;
|
|
132
|
+
readonly continue?: boolean;
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/hooks/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,YACjC,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,MAAM,CACG,CAAC;AAEX,eAAO,MAAM,6BAA6B,YACzC,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,cAAc,EACd,OAAO,EACP,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,mBAAmB,CACV,CAAC;AAEX,eAAO,MAAM,yBAAyB,YAAI,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAU,CAAC;AAE1F,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AACxE,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AACvF,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG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IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC7B,GACD;IACA,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEL,MAAM,MAAM,cAAc,GAAG;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;IACzD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const SUPPORTED_HOOK_EVENTS = [
|
|
2
|
+
"PreToolUse",
|
|
3
|
+
"PostToolUse",
|
|
4
|
+
"UserPromptSubmit",
|
|
5
|
+
"SessionStart",
|
|
6
|
+
"PreCompact",
|
|
7
|
+
"PostCompact",
|
|
8
|
+
"Stop",
|
|
9
|
+
];
|
|
10
|
+
export const UNSUPPORTED_KNOWN_HOOK_EVENTS = [
|
|
11
|
+
"PermissionRequest",
|
|
12
|
+
"PermissionDenied",
|
|
13
|
+
"SubagentStart",
|
|
14
|
+
"SubagentStop",
|
|
15
|
+
"Notification",
|
|
16
|
+
"Setup",
|
|
17
|
+
"UserPromptExpansion",
|
|
18
|
+
"PostToolUseFailure",
|
|
19
|
+
"PostToolBatch",
|
|
20
|
+
"TaskCreated",
|
|
21
|
+
"TaskCompleted",
|
|
22
|
+
"StopFailure",
|
|
23
|
+
"TeammateIdle",
|
|
24
|
+
"InstructionsLoaded",
|
|
25
|
+
"ConfigChange",
|
|
26
|
+
"CwdChanged",
|
|
27
|
+
"FileChanged",
|
|
28
|
+
"WorktreeCreate",
|
|
29
|
+
"WorktreeRemove",
|
|
30
|
+
"MessageDisplay",
|
|
31
|
+
"SessionEnd",
|
|
32
|
+
"Elicitation",
|
|
33
|
+
"ElicitationResult",
|
|
34
|
+
];
|
|
35
|
+
export const UNSUPPORTED_HANDLER_TYPES = ["prompt", "agent", "http", "mcp_tool"];
|
|
36
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/hooks/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACpC,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,cAAc;IACd,YAAY;IACZ,aAAa;IACb,MAAM;CACG,CAAC;AAEX,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC5C,mBAAmB;IACnB,kBAAkB;IAClB,eAAe;IACf,cAAc;IACd,cAAc;IACd,OAAO;IACP,qBAAqB;IACrB,oBAAoB;IACpB,eAAe;IACf,aAAa;IACb,eAAe;IACf,aAAa;IACb,cAAc;IACd,oBAAoB;IACpB,cAAc;IACd,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,mBAAmB;CACV,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAU,CAAC","sourcesContent":["export const SUPPORTED_HOOK_EVENTS = [\n\t\"PreToolUse\",\n\t\"PostToolUse\",\n\t\"UserPromptSubmit\",\n\t\"SessionStart\",\n\t\"PreCompact\",\n\t\"PostCompact\",\n\t\"Stop\",\n] as const;\n\nexport const UNSUPPORTED_KNOWN_HOOK_EVENTS = [\n\t\"PermissionRequest\",\n\t\"PermissionDenied\",\n\t\"SubagentStart\",\n\t\"SubagentStop\",\n\t\"Notification\",\n\t\"Setup\",\n\t\"UserPromptExpansion\",\n\t\"PostToolUseFailure\",\n\t\"PostToolBatch\",\n\t\"TaskCreated\",\n\t\"TaskCompleted\",\n\t\"StopFailure\",\n\t\"TeammateIdle\",\n\t\"InstructionsLoaded\",\n\t\"ConfigChange\",\n\t\"CwdChanged\",\n\t\"FileChanged\",\n\t\"WorktreeCreate\",\n\t\"WorktreeRemove\",\n\t\"MessageDisplay\",\n\t\"SessionEnd\",\n\t\"Elicitation\",\n\t\"ElicitationResult\",\n] as const;\n\nexport const UNSUPPORTED_HANDLER_TYPES = [\"prompt\", \"agent\", \"http\", \"mcp_tool\"] as const;\n\nexport type SupportedHookEvent = (typeof SUPPORTED_HOOK_EVENTS)[number];\nexport type UnsupportedKnownHookEvent = (typeof UNSUPPORTED_KNOWN_HOOK_EVENTS)[number];\nexport type HookSourceScope = \"global\" | \"project\" | \"plugin\" | \"runtime\" | \"cli\" | \"managed\";\nexport type HookDiscoveryTiming = \"pre-session\" | \"runtime\";\n\nexport type HookSourceMetadata = {\n\treadonly scope: HookSourceScope;\n\treadonly sourcePath: string;\n\treadonly displayOrder: number;\n\treadonly discoveredAt: HookDiscoveryTiming;\n\treadonly pluginRoot?: string;\n\treadonly manifestPath?: string;\n};\n\nexport type CommandHookConfig = {\n\treadonly type: \"command\";\n\treadonly command: string;\n\treadonly commandWindows?: string;\n\treadonly timeout?: number;\n\treadonly statusMessage?: string;\n};\n\nexport type ExecutableHookHandler = {\n\treadonly event: SupportedHookEvent;\n\treadonly matcher?: string;\n\treadonly groupIndex: number;\n\treadonly handlerIndex: number;\n\treadonly config: CommandHookConfig;\n\treadonly source: HookSourceMetadata;\n};\n\nexport type HookDiagnosticCode =\n\t| \"invalid_root\"\n\t| \"invalid_hooks\"\n\t| \"invalid_event_config\"\n\t| \"invalid_matcher\"\n\t| \"invalid_handler_group\"\n\t| \"invalid_handler_list\"\n\t| \"invalid_handler\"\n\t| \"invalid_command\"\n\t| \"invalid_command_windows\"\n\t| \"invalid_command_target\"\n\t| \"missing_command_target\"\n\t| \"invalid_timeout\"\n\t| \"invalid_status_message\"\n\t| \"unknown_event\"\n\t| \"unsupported_event\"\n\t| \"unsupported_field\"\n\t| \"unsupported_handler_type\"\n\t| \"unsupported_async_handler\"\n\t| \"unsupported_command_variant\";\n\nexport type HookDiagnostic = {\n\treadonly code: HookDiagnosticCode;\n\treadonly severity: \"error\" | \"warning\";\n\treadonly message: string;\n\treadonly path: string;\n\treadonly source: HookSourceMetadata;\n\treadonly event?: string;\n};\n\nexport type ParsedHookConfig = {\n\treadonly executableHandlers: readonly ExecutableHookHandler[];\n\treadonly diagnostics: readonly HookDiagnostic[];\n};\n\nexport type HookTrustEntry = {\n\treadonly enabled: boolean;\n\treadonly trustedHash?: string;\n\treadonly scope: HookSourceScope;\n\treadonly sourcePath: string;\n\treadonly matcher?: string;\n\treadonly commandPreview: string;\n\treadonly updatedAt: string;\n};\n\nexport type HookTrustState = {\n\treadonly version: 1;\n\treadonly hooks: Readonly<Record<string, HookTrustEntry>>;\n};\n\nexport type HookRuntimeState = {\n\treadonly parsed: ParsedHookConfig;\n\treadonly trust: HookTrustState;\n};\n\nexport type HookInputWire =\n\t| {\n\t\t\treadonly event: \"SessionStart\";\n\t\t\treadonly sessionId: string;\n\t\t\treadonly cwd: string;\n\t\t\treadonly hook_event_name?: \"SessionStart\";\n\t\t\treadonly reason?: string;\n\t\t\treadonly session_id?: string;\n\t\t\treadonly transcript_path?: string;\n\t }\n\t| {\n\t\t\treadonly event: \"UserPromptSubmit\";\n\t\t\treadonly prompt: string;\n\t\t\treadonly cwd: string;\n\t\t\treadonly session_id?: string;\n\t\t\treadonly permission_mode?: string;\n\t\t\treadonly transcript_path?: string;\n\t }\n\t| {\n\t\t\treadonly event: \"PreToolUse\";\n\t\t\treadonly toolName: string;\n\t\t\treadonly toolInput: unknown;\n\t\t\treadonly cwd: string;\n\t\t\treadonly session_id?: string;\n\t\t\treadonly hook_event_name?: \"PreToolUse\";\n\t\t\treadonly tool_name?: string;\n\t\t\treadonly tool_input?: unknown;\n\t\t\treadonly tool_use_id?: string;\n\t }\n\t| {\n\t\t\treadonly event: \"PostToolUse\";\n\t\t\treadonly toolName: string;\n\t\t\treadonly toolInput: unknown;\n\t\t\treadonly toolOutput: unknown;\n\t\t\treadonly cwd: string;\n\t\t\treadonly session_id?: string;\n\t\t\treadonly hook_event_name?: \"PostToolUse\";\n\t\t\treadonly tool_name?: string;\n\t\t\treadonly tool_input?: unknown;\n\t\t\treadonly tool_response?: unknown;\n\t\t\treadonly tool_use_id?: string;\n\t }\n\t| {\n\t\t\treadonly event: \"PreCompact\";\n\t\t\treadonly reason: string;\n\t\t\treadonly cwd: string;\n\t\t\treadonly custom_instructions?: string;\n\t\t\treadonly hook_event_name?: \"PreCompact\";\n\t\t\treadonly request_id?: string;\n\t\t\treadonly session_id?: string;\n\t\t\treadonly transcript_path?: string;\n\t\t\treadonly will_retry?: boolean;\n\t }\n\t| {\n\t\t\treadonly event: \"PostCompact\";\n\t\t\treadonly reason: string;\n\t\t\treadonly cwd: string;\n\t\t\treadonly accepted?: boolean;\n\t\t\treadonly hook_event_name?: \"PostCompact\";\n\t\t\treadonly request_id?: string;\n\t\t\treadonly session_id?: string;\n\t\t\treadonly transcript_path?: string;\n\t\t\treadonly will_retry?: boolean;\n\t }\n\t| {\n\t\t\treadonly event: \"Stop\";\n\t\t\treadonly stopReason?: string;\n\t\t\treadonly cwd: string;\n\t\t\treadonly hook_event_name?: \"Stop\";\n\t\t\treadonly session_id?: string;\n\t\t\treadonly transcript_path?: string;\n\t };\n\nexport type HookOutputWire = {\n\treadonly decision?: \"approve\" | \"block\" | \"deny\" | \"ask\";\n\treadonly reason?: string;\n\treadonly additionalContext?: string;\n\treadonly updatedInput?: unknown;\n\treadonly updatedToolOutput?: unknown;\n\treadonly continue?: boolean;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAKpD,OAAO,aAAa,MAAM,WAAW,CAAC;AACtC,OAAO,cAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAKpD,OAAO,aAAa,MAAM,WAAW,CAAC;AACtC,OAAO,cAAc,MAAM,YAAY,CAAC;AAUxC,OAAO,wBAAwB,MAAM,wBAAwB,CAAC;AAO9D,OAAO,YAAY,MAAM,UAAU,CAAC;AAIpC,MAAM,WAAW,uBAAuB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,gBAAgB,CAAC;CAC1B;AAED,eAAO,MAAM,yBAAyB,YAAI,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,KAAK,CAAU,CAAC;AAEhG,eAAO,MAAM,+BAA+B;;;;;CAKoC,CAAC;AAEjF,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,EAsBtD,CAAC"}
|
|
@@ -7,9 +7,11 @@ import filesExtension from "./files.js";
|
|
|
7
7
|
import goalExtension from "./goal/index.js";
|
|
8
8
|
import gptApplyPatchExtension from "./gpt-apply-patch/index.js";
|
|
9
9
|
import historySearchExtension from "./history-search/index.js";
|
|
10
|
+
import hooksExtension from "./hooks/index.js";
|
|
10
11
|
import nestedAgentsMdExtension from "./nested-agents-md/index.js";
|
|
11
12
|
import openaiWebSearchExtension from "./openai-web-search/index.js";
|
|
12
13
|
import permissionSystemExtension from "./permission-system/index.js";
|
|
14
|
+
import piCodexAppServerExtension from "./pi-codex-app-server/index.js";
|
|
13
15
|
import promptPresetExtension from "./prompt-preset/index.js";
|
|
14
16
|
import promptUrlWidgetExtension from "./prompt-url-widget.js";
|
|
15
17
|
import redrawsExtension from "./redraws.js";
|
|
@@ -29,6 +31,7 @@ export const globalDefaultExtensionFactories = {
|
|
|
29
31
|
tps: tpsExtension,
|
|
30
32
|
};
|
|
31
33
|
export const builtinExtensions = [
|
|
34
|
+
{ id: "hooks", factory: hooksExtension },
|
|
32
35
|
{ id: "permission-system", factory: permissionSystemExtension },
|
|
33
36
|
{ id: "gpt-apply-patch", factory: gptApplyPatchExtension },
|
|
34
37
|
{ id: "prompt-preset", factory: promptPresetExtension },
|
|
@@ -48,5 +51,6 @@ export const builtinExtensions = [
|
|
|
48
51
|
{ id: "nested-agents-md", factory: nestedAgentsMdExtension },
|
|
49
52
|
{ id: "rules", factory: piRulesExtension },
|
|
50
53
|
{ id: "goal", factory: goalExtension },
|
|
54
|
+
{ id: "pi-codex-app-server", factory: piCodexAppServerExtension },
|
|
51
55
|
];
|
|
52
56
|
//# sourceMappingURL=index.js.map
|