@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai-codex.js","sourceRoot":"","sources":["../../../src/utils/oauth/openai-codex.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,kEAAkE;AAClE,IAAI,YAAY,GAAoD,IAAI,CAAC;AACzE,IAAI,KAAK,GAAsC,IAAI,CAAC;AACpD,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC;IACzF,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QAChC,YAAY,GAAG,CAAC,CAAC,WAAW,CAAC;IAC9B,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QAC9B,KAAK,GAAG,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;A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UAAU;YAChC,iBAAiB,EAAE,SAAS,CAAC,iBAAiB;SAC9C,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,WAA6B;QAC/C,OAAO,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,SAAS,CAAC,WAA6B;QACtC,OAAO,WAAW,CAAC,MAAM,CAAC;IAC3B,CAAC;CACD,CAAC","sourcesContent":["/**\n * OpenAI Codex (ChatGPT OAuth) flow\n *\n * NOTE: This module uses Node.js crypto and http for the OAuth callback.\n * It is only intended for CLI use, not browser environments.\n */\n\n// NEVER convert to top-level imports - breaks browser/Vite builds\nlet _randomBytes: typeof import(\"node:crypto\").randomBytes | null = null;\nlet _http: typeof import(\"node:http\") | null = null;\nif (typeof process !== \"undefined\" && (process.versions?.node || process.versions?.bun)) {\n\timport(\"node:crypto\").then((m) => {\n\t\t_randomBytes = m.randomBytes;\n\t});\n\timport(\"node:http\").then((m) => {\n\t\t_http = m;\n\t});\n}\n\nimport { getProviderEnvValue } from \"../provider-env.ts\";\nimport { pollOAuthDeviceCodeFlow } from \"./device-code.ts\";\nimport { oauthErrorHtml, oauthSuccessHtml } from \"./oauth-page.ts\";\nimport { generatePKCE } from \"./pkce.ts\";\nimport type {\n\tOAuthCredentials,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthProviderInterface,\n} from \"./types.ts\";\n\nconst CLIENT_ID = \"app_EMoamEEZ73f0CkXaXp7hrann\";\nconst AUTH_BASE_URL = \"https://auth.openai.com\";\nconst AUTHORIZE_URL = `${AUTH_BASE_URL}/oauth/authorize`;\nconst TOKEN_URL = `${AUTH_BASE_URL}/oauth/token`;\nconst REDIRECT_URI = \"http://localhost:1455/auth/callback\";\nconst DEVICE_USER_CODE_URL = `${AUTH_BASE_URL}/api/accounts/deviceauth/usercode`;\nconst DEVICE_TOKEN_URL = `${AUTH_BASE_URL}/api/accounts/deviceauth/token`;\nconst DEVICE_VERIFICATION_URI = `${AUTH_BASE_URL}/codex/device`;\nconst DEVICE_REDIRECT_URI = `${AUTH_BASE_URL}/deviceauth/callback`;\nconst DEVICE_CODE_TIMEOUT_SECONDS = 15 * 60;\nexport const OPENAI_CODEX_BROWSER_LOGIN_METHOD = \"browser\";\nexport const OPENAI_CODEX_DEVICE_CODE_LOGIN_METHOD = \"device_code\";\nconst SCOPE = \"openid profile email offline_access\";\nconst JWT_CLAIM_PATH = \"https://api.openai.com/auth\";\n\ntype OAuthToken = { access: string; refresh: string; expires: number };\ntype TokenOperation = \"exchange\" | \"refresh\";\n\nfunction getCallbackHost(): string {\n\treturn getProviderEnvValue(\"PI_OAUTH_CALLBACK_HOST\") || \"127.0.0.1\";\n}\n\ntype DeviceAuthInfo = {\n\tdeviceAuthId: string;\n\tuserCode: string;\n\tintervalSeconds: number;\n};\n\ntype DeviceTokenSuccess = {\n\tauthorizationCode: string;\n\tcodeVerifier: string;\n};\n\ntype JwtPayload = {\n\t[JWT_CLAIM_PATH]?: {\n\t\tchatgpt_account_id?: string;\n\t};\n\t[key: string]: unknown;\n};\n\nfunction createState(): string {\n\tif (!_randomBytes) {\n\t\tthrow new Error(\"OpenAI Codex OAuth is only available in Node.js environments\");\n\t}\n\treturn _randomBytes(16).toString(\"hex\");\n}\n\nfunction parseAuthorizationInput(input: string): { code?: string; state?: string } {\n\tconst value = input.trim();\n\tif (!value) return {};\n\n\ttry {\n\t\tconst url = new URL(value);\n\t\treturn {\n\t\t\tcode: url.searchParams.get(\"code\") ?? undefined,\n\t\t\tstate: url.searchParams.get(\"state\") ?? undefined,\n\t\t};\n\t} catch {\n\t\t// not a URL\n\t}\n\n\tif (value.includes(\"#\")) {\n\t\tconst [code, state] = value.split(\"#\", 2);\n\t\treturn { code, state };\n\t}\n\n\tif (value.includes(\"code=\")) {\n\t\tconst params = new URLSearchParams(value);\n\t\treturn {\n\t\t\tcode: params.get(\"code\") ?? undefined,\n\t\t\tstate: params.get(\"state\") ?? undefined,\n\t\t};\n\t}\n\n\treturn { code: value };\n}\n\nfunction decodeJwt(token: string): JwtPayload | null {\n\ttry {\n\t\tconst parts = token.split(\".\");\n\t\tif (parts.length !== 3) return null;\n\t\tconst payload = parts[1] ?? \"\";\n\t\tconst decoded = atob(payload);\n\t\treturn JSON.parse(decoded) as JwtPayload;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nasync function fetchWithLoginCancellation(input: string, init: RequestInit): Promise<Response> {\n\ttry {\n\t\treturn await fetch(input, init);\n\t} catch (error) {\n\t\tif (init.signal?.aborted) {\n\t\t\tthrow new Error(\"Login cancelled\");\n\t\t}\n\t\tthrow error;\n\t}\n}\n\nasync function readTokenResponse(response: Response, operation: TokenOperation): Promise<OAuthToken> {\n\tif (!response.ok) {\n\t\tconst text = await response.text().catch(() => \"\");\n\t\tthrow new Error(`OpenAI Codex token ${operation} failed (${response.status}): ${text || response.statusText}`);\n\t}\n\n\tconst rawJson = await response.json();\n\tconst json = rawJson as {\n\t\taccess_token?: string;\n\t\trefresh_token?: string;\n\t\texpires_in?: number;\n\t} | null;\n\tif (!json?.access_token || !json.refresh_token || typeof json.expires_in !== \"number\") {\n\t\tthrow new Error(`OpenAI Codex token ${operation} response missing fields: ${JSON.stringify(json)}`);\n\t}\n\n\treturn {\n\t\taccess: json.access_token,\n\t\trefresh: json.refresh_token,\n\t\texpires: Date.now() + json.expires_in * 1000,\n\t};\n}\n\nasync function exchangeAuthorizationCode(\n\tcode: string,\n\tverifier: string,\n\tredirectUri: string = REDIRECT_URI,\n\tsignal?: AbortSignal,\n): Promise<OAuthToken> {\n\tconst response = await fetchWithLoginCancellation(TOKEN_URL, {\n\t\tmethod: \"POST\",\n\t\theaders: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\n\t\tbody: new URLSearchParams({\n\t\t\tgrant_type: \"authorization_code\",\n\t\t\tclient_id: CLIENT_ID,\n\t\t\tcode,\n\t\t\tcode_verifier: verifier,\n\t\t\tredirect_uri: redirectUri,\n\t\t}),\n\t\tsignal,\n\t});\n\n\treturn readTokenResponse(response, \"exchange\");\n}\n\nasync function refreshAccessToken(refreshToken: string): Promise<OAuthToken> {\n\tlet response: Response;\n\ttry {\n\t\tresponse = await fetch(TOKEN_URL, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\n\t\t\tbody: new URLSearchParams({\n\t\t\t\tgrant_type: \"refresh_token\",\n\t\t\t\trefresh_token: refreshToken,\n\t\t\t\tclient_id: CLIENT_ID,\n\t\t\t}),\n\t\t});\n\t} catch (error) {\n\t\tthrow new Error(`OpenAI Codex token refresh error: ${error instanceof Error ? error.message : String(error)}`);\n\t}\n\n\treturn readTokenResponse(response, \"refresh\");\n}\n\nasync function startOpenAICodexDeviceAuth(signal?: AbortSignal): Promise<DeviceAuthInfo> {\n\tconst response = await fetchWithLoginCancellation(DEVICE_USER_CODE_URL, {\n\t\tmethod: \"POST\",\n\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\tbody: JSON.stringify({ client_id: CLIENT_ID }),\n\t\tsignal,\n\t});\n\n\tif (!response.ok) {\n\t\tif (response.status === 404) {\n\t\t\tthrow new Error(\n\t\t\t\t\"OpenAI Codex device code login is not enabled for this server. Use browser login or verify the server URL.\",\n\t\t\t);\n\t\t}\n\t\tconst responseBody = await response.text().catch(() => \"\");\n\t\tthrow new Error(\n\t\t\t`OpenAI Codex device code request failed with status ${response.status}${responseBody ? `: ${responseBody}` : \"\"}`,\n\t\t);\n\t}\n\n\tconst rawJson = await response.json();\n\tconst json = rawJson as {\n\t\tdevice_auth_id?: string;\n\t\tuser_code?: string;\n\t\tinterval?: number | string;\n\t} | null;\n\tconst intervalSeconds = typeof json?.interval === \"string\" ? Number(json.interval.trim()) : json?.interval;\n\tif (\n\t\t!json?.device_auth_id ||\n\t\t!json.user_code ||\n\t\ttypeof intervalSeconds !== \"number\" ||\n\t\t!Number.isFinite(intervalSeconds) ||\n\t\tintervalSeconds < 0\n\t) {\n\t\tthrow new Error(`Invalid OpenAI Codex device code response: ${JSON.stringify(json)}`);\n\t}\n\n\treturn {\n\t\tdeviceAuthId: json.device_auth_id,\n\t\tuserCode: json.user_code,\n\t\tintervalSeconds,\n\t};\n}\n\nasync function pollOpenAICodexDeviceAuth(device: DeviceAuthInfo, signal?: AbortSignal): Promise<DeviceTokenSuccess> {\n\treturn pollOAuthDeviceCodeFlow<DeviceTokenSuccess>({\n\t\tintervalSeconds: device.intervalSeconds,\n\t\texpiresInSeconds: DEVICE_CODE_TIMEOUT_SECONDS,\n\t\tsignal,\n\t\tpoll: async () => {\n\t\t\tconst response = await fetchWithLoginCancellation(DEVICE_TOKEN_URL, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\tdevice_auth_id: device.deviceAuthId,\n\t\t\t\t\tuser_code: device.userCode,\n\t\t\t\t}),\n\t\t\t\tsignal,\n\t\t\t});\n\n\t\t\tif (response.ok) {\n\t\t\t\tconst rawJson = await response.json();\n\t\t\t\tconst json = rawJson as { authorization_code?: string; code_verifier?: string } | null;\n\t\t\t\tif (!json?.authorization_code || !json.code_verifier) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\t\tmessage: `Invalid OpenAI Codex device auth token response: ${JSON.stringify(json)}`,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstatus: \"complete\",\n\t\t\t\t\tvalue: { authorizationCode: json.authorization_code, codeVerifier: json.code_verifier },\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (response.status === 403 || response.status === 404) {\n\t\t\t\treturn { status: \"pending\" };\n\t\t\t}\n\n\t\t\tconst responseBody = await response.text().catch(() => \"\");\n\t\t\tlet errorCode: unknown;\n\t\t\ttry {\n\t\t\t\tconst json = JSON.parse(responseBody) as { error?: string | { code?: string } } | null;\n\t\t\t\tconst error = json?.error;\n\t\t\t\terrorCode = typeof error === \"object\" ? error?.code : error;\n\t\t\t} catch {}\n\n\t\t\tif (errorCode === \"deviceauth_authorization_pending\") {\n\t\t\t\treturn { status: \"pending\" };\n\t\t\t}\n\t\t\tif (errorCode === \"slow_down\") {\n\t\t\t\treturn { status: \"slow_down\" };\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tstatus: \"failed\",\n\t\t\t\tmessage: `OpenAI Codex device auth failed with status ${response.status}${responseBody ? `: ${responseBody}` : \"\"}`,\n\t\t\t};\n\t\t},\n\t});\n}\n\nasync function createAuthorizationFlow(\n\toriginator: string = \"senpi\",\n): Promise<{ verifier: string; state: string; url: string }> {\n\tconst { verifier, challenge } = await generatePKCE();\n\tconst state = createState();\n\n\tconst url = new URL(AUTHORIZE_URL);\n\turl.searchParams.set(\"response_type\", \"code\");\n\turl.searchParams.set(\"client_id\", CLIENT_ID);\n\turl.searchParams.set(\"redirect_uri\", REDIRECT_URI);\n\turl.searchParams.set(\"scope\", SCOPE);\n\turl.searchParams.set(\"code_challenge\", challenge);\n\turl.searchParams.set(\"code_challenge_method\", \"S256\");\n\turl.searchParams.set(\"state\", state);\n\turl.searchParams.set(\"id_token_add_organizations\", \"true\");\n\turl.searchParams.set(\"codex_cli_simplified_flow\", \"true\");\n\turl.searchParams.set(\"originator\", originator);\n\n\treturn { verifier, state, url: url.toString() };\n}\n\ntype OAuthServerInfo = {\n\tclose: () => void;\n\tcancelWait: () => void;\n\twaitForCode: () => Promise<{ code: string } | null>;\n};\n\nfunction startLocalOAuthServer(state: string): Promise<OAuthServerInfo> {\n\tif (!_http) {\n\t\tthrow new Error(\"OpenAI Codex OAuth is only available in Node.js environments\");\n\t}\n\n\tlet settleWait: ((value: { code: string } | null) => void) | undefined;\n\tconst waitForCodePromise = new Promise<{ code: string } | null>((resolve) => {\n\t\tlet settled = false;\n\t\tsettleWait = (value) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tresolve(value);\n\t\t};\n\t});\n\n\tconst server = _http.createServer((req, res) => {\n\t\ttry {\n\t\t\tconst url = new URL(req.url || \"\", \"http://localhost\");\n\t\t\tif (url.pathname !== \"/auth/callback\") {\n\t\t\t\tres.statusCode = 404;\n\t\t\t\tres.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\t\tres.end(oauthErrorHtml(\"Callback route not found.\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (url.searchParams.get(\"state\") !== state) {\n\t\t\t\tres.statusCode = 400;\n\t\t\t\tres.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\t\tres.end(oauthErrorHtml(\"State mismatch.\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst code = url.searchParams.get(\"code\");\n\t\t\tif (!code) {\n\t\t\t\tres.statusCode = 400;\n\t\t\t\tres.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\t\tres.end(oauthErrorHtml(\"Missing authorization code.\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tres.statusCode = 200;\n\t\t\tres.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\tres.end(oauthSuccessHtml(\"OpenAI authentication completed. You can close this window.\"));\n\t\t\tsettleWait?.({ code });\n\t\t} catch {\n\t\t\tres.statusCode = 500;\n\t\t\tres.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\tres.end(oauthErrorHtml(\"Internal error while processing OAuth callback.\"));\n\t\t}\n\t});\n\n\treturn new Promise((resolve) => {\n\t\tserver\n\t\t\t.listen(1455, getCallbackHost(), () => {\n\t\t\t\tresolve({\n\t\t\t\t\tclose: () => server.close(),\n\t\t\t\t\tcancelWait: () => {\n\t\t\t\t\t\tsettleWait?.(null);\n\t\t\t\t\t},\n\t\t\t\t\twaitForCode: () => waitForCodePromise,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.on(\"error\", (_err: NodeJS.ErrnoException) => {\n\t\t\t\tsettleWait?.(null);\n\t\t\t\tresolve({\n\t\t\t\t\tclose: () => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tserver.close();\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// ignore\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcancelWait: () => {},\n\t\t\t\t\twaitForCode: async () => null,\n\t\t\t\t});\n\t\t\t});\n\t});\n}\n\nfunction getAccountId(accessToken: string): string | null {\n\tconst payload = decodeJwt(accessToken);\n\tconst auth = payload?.[JWT_CLAIM_PATH];\n\tconst accountId = auth?.chatgpt_account_id;\n\treturn typeof accountId === \"string\" && accountId.length > 0 ? accountId : null;\n}\n\nfunction credentialsFromToken(token: OAuthToken): OAuthCredentials {\n\tconst accountId = getAccountId(token.access);\n\tif (!accountId) {\n\t\tthrow new Error(\"Failed to extract accountId from token\");\n\t}\n\n\treturn {\n\t\taccess: token.access,\n\t\trefresh: token.refresh,\n\t\texpires: token.expires,\n\t\taccountId,\n\t};\n}\n\nasync function exchangeAuthorizationCodeForCredentials(\n\tcode: string,\n\tverifier: string,\n\tredirectUri: string,\n\tsignal?: AbortSignal,\n): Promise<OAuthCredentials> {\n\treturn credentialsFromToken(await exchangeAuthorizationCode(code, verifier, redirectUri, signal));\n}\n\n/**\n * Login with OpenAI Codex OAuth using the Codex device-code flow.\n */\nexport async function loginOpenAICodexDeviceCode(options: {\n\tonDeviceCode: (info: OAuthDeviceCodeInfo) => void;\n\tsignal?: AbortSignal;\n}): Promise<OAuthCredentials> {\n\tconst device = await startOpenAICodexDeviceAuth(options.signal);\n\toptions.onDeviceCode({\n\t\tuserCode: device.userCode,\n\t\tverificationUri: DEVICE_VERIFICATION_URI,\n\t\tintervalSeconds: device.intervalSeconds,\n\t\texpiresInSeconds: DEVICE_CODE_TIMEOUT_SECONDS,\n\t});\n\tconst code = await pollOpenAICodexDeviceAuth(device, options.signal);\n\treturn exchangeAuthorizationCodeForCredentials(\n\t\tcode.authorizationCode,\n\t\tcode.codeVerifier,\n\t\tDEVICE_REDIRECT_URI,\n\t\toptions.signal,\n\t);\n}\n\n/**\n * Login with OpenAI Codex OAuth\n *\n * @param options.onAuth - Called with URL and instructions when auth starts\n * @param options.onPrompt - Called to prompt user for manual code paste (fallback if no onManualCodeInput)\n * @param options.onProgress - Optional progress messages\n * @param options.onManualCodeInput - Optional promise that resolves with user-pasted code.\n * Races with browser callback - whichever completes first wins.\n * Useful for showing paste input immediately alongside browser flow.\n * @param options.originator - OAuth originator parameter (defaults to \"senpi\")\n */\nexport async function loginOpenAICodex(options: {\n\tonAuth: (info: { url: string; instructions?: string }) => void;\n\tonPrompt: (prompt: OAuthPrompt) => Promise<string>;\n\tonProgress?: (message: string) => void;\n\tonManualCodeInput?: () => Promise<string>;\n\toriginator?: string;\n}): Promise<OAuthCredentials> {\n\tconst { verifier, state, url } = await createAuthorizationFlow(options.originator);\n\tconst server = await startLocalOAuthServer(state);\n\n\toptions.onAuth({ url, instructions: \"A browser window should open. Complete login to finish.\" });\n\n\tlet code: string | undefined;\n\ttry {\n\t\tif (options.onManualCodeInput) {\n\t\t\t// Race between browser callback and manual input\n\t\t\tlet manualCode: string | undefined;\n\t\t\tlet manualError: Error | undefined;\n\t\t\tconst manualPromise = options\n\t\t\t\t.onManualCodeInput()\n\t\t\t\t.then((input) => {\n\t\t\t\t\tmanualCode = input;\n\t\t\t\t\tserver.cancelWait();\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\tmanualError = err instanceof Error ? err : new Error(String(err));\n\t\t\t\t\tserver.cancelWait();\n\t\t\t\t});\n\n\t\t\tconst result = await server.waitForCode();\n\n\t\t\t// If manual input was cancelled, throw that error\n\t\t\tif (manualError) {\n\t\t\t\tthrow manualError;\n\t\t\t}\n\n\t\t\tif (result?.code) {\n\t\t\t\t// Browser callback won\n\t\t\t\tcode = result.code;\n\t\t\t} else if (manualCode) {\n\t\t\t\t// Manual input won (or callback timed out and user had entered code)\n\t\t\t\tconst parsed = parseAuthorizationInput(manualCode);\n\t\t\t\tif (parsed.state && parsed.state !== state) {\n\t\t\t\t\tthrow new Error(\"State mismatch\");\n\t\t\t\t}\n\t\t\t\tcode = parsed.code;\n\t\t\t}\n\n\t\t\t// If still no code, wait for manual promise to complete and try that\n\t\t\tif (!code) {\n\t\t\t\tawait manualPromise;\n\t\t\t\tif (manualError) {\n\t\t\t\t\tthrow manualError;\n\t\t\t\t}\n\t\t\t\tif (manualCode) {\n\t\t\t\t\tconst parsed = parseAuthorizationInput(manualCode);\n\t\t\t\t\tif (parsed.state && parsed.state !== state) {\n\t\t\t\t\t\tthrow new Error(\"State mismatch\");\n\t\t\t\t\t}\n\t\t\t\t\tcode = parsed.code;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Original flow: wait for callback, then prompt if needed\n\t\t\tconst result = await server.waitForCode();\n\t\t\tif (result?.code) {\n\t\t\t\tcode = result.code;\n\t\t\t}\n\t\t}\n\n\t\t// Fallback to onPrompt if still no code\n\t\tif (!code) {\n\t\t\tconst input = await options.onPrompt({\n\t\t\t\tmessage: \"Paste the authorization code (or full redirect URL):\",\n\t\t\t});\n\t\t\tconst parsed = parseAuthorizationInput(input);\n\t\t\tif (parsed.state && parsed.state !== state) {\n\t\t\t\tthrow new Error(\"State mismatch\");\n\t\t\t}\n\t\t\tcode = parsed.code;\n\t\t}\n\n\t\tif (!code) {\n\t\t\tthrow new Error(\"Missing authorization code\");\n\t\t}\n\n\t\treturn exchangeAuthorizationCodeForCredentials(code, verifier, REDIRECT_URI);\n\t} finally {\n\t\tserver.close();\n\t}\n}\n\n/**\n * Refresh OpenAI Codex OAuth token\n */\nexport async function refreshOpenAICodexToken(refreshToken: string): Promise<OAuthCredentials> {\n\treturn credentialsFromToken(await refreshAccessToken(refreshToken));\n}\n\nexport const openaiCodexOAuthProvider: OAuthProviderInterface = {\n\tid: \"openai-codex\",\n\tname: \"ChatGPT Plus/Pro (Codex Subscription)\",\n\tusesCallbackServer: true,\n\n\tasync login(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials> {\n\t\tconst loginMethod = await callbacks.onSelect({\n\t\t\tmessage: \"Select OpenAI Codex login method:\",\n\t\t\toptions: [\n\t\t\t\t{ id: OPENAI_CODEX_BROWSER_LOGIN_METHOD, label: \"Browser login (default)\" },\n\t\t\t\t{ id: OPENAI_CODEX_DEVICE_CODE_LOGIN_METHOD, label: \"Device code login (headless)\" },\n\t\t\t],\n\t\t});\n\t\tif (!loginMethod) {\n\t\t\tthrow new Error(\"Login cancelled\");\n\t\t}\n\n\t\tif (loginMethod === OPENAI_CODEX_DEVICE_CODE_LOGIN_METHOD) {\n\t\t\treturn loginOpenAICodexDeviceCode({\n\t\t\t\tonDeviceCode: callbacks.onDeviceCode,\n\t\t\t\tsignal: callbacks.signal,\n\t\t\t});\n\t\t}\n\n\t\tif (loginMethod !== OPENAI_CODEX_BROWSER_LOGIN_METHOD) {\n\t\t\tthrow new Error(`Unknown OpenAI Codex login method: ${loginMethod}`);\n\t\t}\n\n\t\treturn loginOpenAICodex({\n\t\t\tonAuth: callbacks.onAuth,\n\t\t\tonPrompt: callbacks.onPrompt,\n\t\t\tonProgress: callbacks.onProgress,\n\t\t\tonManualCodeInput: callbacks.onManualCodeInput,\n\t\t});\n\t},\n\n\tasync refreshToken(credentials: OAuthCredentials): Promise<OAuthCredentials> {\n\t\treturn refreshOpenAICodexToken(credentials.refresh);\n\t},\n\n\tgetApiKey(credentials: OAuthCredentials): string {\n\t\treturn credentials.access;\n\t},\n};\n"]}
|
|
1
|
+
{"version":3,"file":"openai-codex.js","sourceRoot":"","sources":["../../../src/utils/oauth/openai-codex.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,kEAAkE;AAClE,IAAI,YAAY,GAAoD,IAAI,CAAC;AACzE,IAAI,KAAK,GAAsC,IAAI,CAAC;AACpD,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,IAAI,OAAO,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,MAAM,IAAI,KAAK,CAAC,sCAAsC,WAAW,EAAE,CAAC,CAAC;QACtE,CAAC;QAED,OAAO,gBAAgB,CAAC;YACvB,MAAM,EAAE,SAAS,CAAC,MAAM;YACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ;YAC5B,UAAU,EAAE,SAAS,CAAC,UAAU;YAChC,iBAAiB,EAAE,SAAS,CAAC,iBAAiB;SAC9C,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,WAA6B;QAC/C,OAAO,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,SAAS,CAAC,WAA6B;QACtC,OAAO,WAAW,CAAC,MAAM,CAAC;IAC3B,CAAC;CACD,CAAC","sourcesContent":["/**\n * OpenAI Codex (ChatGPT OAuth) flow\n *\n * NOTE: This module uses Node.js crypto and http for the OAuth callback.\n * It is only intended for CLI use, not browser environments.\n */\n\n// NEVER convert to top-level imports - breaks browser/Vite builds\nlet _randomBytes: typeof import(\"node:crypto\").randomBytes | null = null;\nlet _http: typeof import(\"node:http\") | null = null;\nif (typeof process !== \"undefined\" && (process.versions?.node || process.versions?.bun)) {\n\timport(\"node:crypto\").then((m) => {\n\t\t_randomBytes = m.randomBytes;\n\t});\n\timport(\"node:http\").then((m) => {\n\t\t_http = m;\n\t});\n}\n\nimport type { OAuthAuth } from \"../../auth/types.ts\";\nimport { getProviderEnvValue } from \"../provider-env.ts\";\nimport { pollOAuthDeviceCodeFlow } from \"./device-code.ts\";\nimport { oauthErrorHtml, oauthSuccessHtml } from \"./oauth-page.ts\";\nimport { generatePKCE } from \"./pkce.ts\";\nimport type {\n\tOAuthCredentials,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthProviderInterface,\n} from \"./types.ts\";\n\nconst CLIENT_ID = \"app_EMoamEEZ73f0CkXaXp7hrann\";\nconst AUTH_BASE_URL = \"https://auth.openai.com\";\nconst AUTHORIZE_URL = `${AUTH_BASE_URL}/oauth/authorize`;\nconst TOKEN_URL = `${AUTH_BASE_URL}/oauth/token`;\nconst REDIRECT_URI = \"http://localhost:1455/auth/callback\";\nconst DEVICE_USER_CODE_URL = `${AUTH_BASE_URL}/api/accounts/deviceauth/usercode`;\nconst DEVICE_TOKEN_URL = `${AUTH_BASE_URL}/api/accounts/deviceauth/token`;\nconst DEVICE_VERIFICATION_URI = `${AUTH_BASE_URL}/codex/device`;\nconst DEVICE_REDIRECT_URI = `${AUTH_BASE_URL}/deviceauth/callback`;\nconst DEVICE_CODE_TIMEOUT_SECONDS = 15 * 60;\nexport const OPENAI_CODEX_BROWSER_LOGIN_METHOD = \"browser\";\nexport const OPENAI_CODEX_DEVICE_CODE_LOGIN_METHOD = \"device_code\";\nconst SCOPE = \"openid profile email offline_access\";\nconst JWT_CLAIM_PATH = \"https://api.openai.com/auth\";\n\ntype OAuthToken = { access: string; refresh: string; expires: number };\ntype TokenOperation = \"exchange\" | \"refresh\";\n\nfunction getCallbackHost(): string {\n\treturn getProviderEnvValue(\"PI_OAUTH_CALLBACK_HOST\") || \"127.0.0.1\";\n}\n\ntype DeviceAuthInfo = {\n\tdeviceAuthId: string;\n\tuserCode: string;\n\tintervalSeconds: number;\n};\n\ntype DeviceTokenSuccess = {\n\tauthorizationCode: string;\n\tcodeVerifier: string;\n};\n\ntype JwtPayload = {\n\t[JWT_CLAIM_PATH]?: {\n\t\tchatgpt_account_id?: string;\n\t};\n\t[key: string]: unknown;\n};\n\nfunction createState(): string {\n\tif (!_randomBytes) {\n\t\tthrow new Error(\"OpenAI Codex OAuth is only available in Node.js environments\");\n\t}\n\treturn _randomBytes(16).toString(\"hex\");\n}\n\nfunction parseAuthorizationInput(input: string): { code?: string; state?: string } {\n\tconst value = input.trim();\n\tif (!value) return {};\n\n\ttry {\n\t\tconst url = new URL(value);\n\t\treturn {\n\t\t\tcode: url.searchParams.get(\"code\") ?? undefined,\n\t\t\tstate: url.searchParams.get(\"state\") ?? undefined,\n\t\t};\n\t} catch {\n\t\t// not a URL\n\t}\n\n\tif (value.includes(\"#\")) {\n\t\tconst [code, state] = value.split(\"#\", 2);\n\t\treturn { code, state };\n\t}\n\n\tif (value.includes(\"code=\")) {\n\t\tconst params = new URLSearchParams(value);\n\t\treturn {\n\t\t\tcode: params.get(\"code\") ?? undefined,\n\t\t\tstate: params.get(\"state\") ?? undefined,\n\t\t};\n\t}\n\n\treturn { code: value };\n}\n\nfunction decodeJwt(token: string): JwtPayload | null {\n\ttry {\n\t\tconst parts = token.split(\".\");\n\t\tif (parts.length !== 3) return null;\n\t\tconst payload = parts[1] ?? \"\";\n\t\tconst decoded = atob(payload);\n\t\treturn JSON.parse(decoded) as JwtPayload;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nasync function fetchWithLoginCancellation(input: string, init: RequestInit): Promise<Response> {\n\ttry {\n\t\treturn await fetch(input, init);\n\t} catch (error) {\n\t\tif (init.signal?.aborted) {\n\t\t\tthrow new Error(\"Login cancelled\");\n\t\t}\n\t\tthrow error;\n\t}\n}\n\nasync function readTokenResponse(response: Response, operation: TokenOperation): Promise<OAuthToken> {\n\tif (!response.ok) {\n\t\tconst text = await response.text().catch(() => \"\");\n\t\tthrow new Error(`OpenAI Codex token ${operation} failed (${response.status}): ${text || response.statusText}`);\n\t}\n\n\tconst rawJson = await response.json();\n\tconst json = rawJson as {\n\t\taccess_token?: string;\n\t\trefresh_token?: string;\n\t\texpires_in?: number;\n\t} | null;\n\tif (!json?.access_token || !json.refresh_token || typeof json.expires_in !== \"number\") {\n\t\tthrow new Error(`OpenAI Codex token ${operation} response missing fields: ${JSON.stringify(json)}`);\n\t}\n\n\treturn {\n\t\taccess: json.access_token,\n\t\trefresh: json.refresh_token,\n\t\texpires: Date.now() + json.expires_in * 1000,\n\t};\n}\n\nasync function exchangeAuthorizationCode(\n\tcode: string,\n\tverifier: string,\n\tredirectUri: string = REDIRECT_URI,\n\tsignal?: AbortSignal,\n): Promise<OAuthToken> {\n\tconst response = await fetchWithLoginCancellation(TOKEN_URL, {\n\t\tmethod: \"POST\",\n\t\theaders: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\n\t\tbody: new URLSearchParams({\n\t\t\tgrant_type: \"authorization_code\",\n\t\t\tclient_id: CLIENT_ID,\n\t\t\tcode,\n\t\t\tcode_verifier: verifier,\n\t\t\tredirect_uri: redirectUri,\n\t\t}),\n\t\tsignal,\n\t});\n\n\treturn readTokenResponse(response, \"exchange\");\n}\n\nasync function refreshAccessToken(refreshToken: string): Promise<OAuthToken> {\n\tlet response: Response;\n\ttry {\n\t\tresponse = await fetch(TOKEN_URL, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/x-www-form-urlencoded\" },\n\t\t\tbody: new URLSearchParams({\n\t\t\t\tgrant_type: \"refresh_token\",\n\t\t\t\trefresh_token: refreshToken,\n\t\t\t\tclient_id: CLIENT_ID,\n\t\t\t}),\n\t\t});\n\t} catch (error) {\n\t\tthrow new Error(`OpenAI Codex token refresh error: ${error instanceof Error ? error.message : String(error)}`);\n\t}\n\n\treturn readTokenResponse(response, \"refresh\");\n}\n\nasync function startOpenAICodexDeviceAuth(signal?: AbortSignal): Promise<DeviceAuthInfo> {\n\tconst response = await fetchWithLoginCancellation(DEVICE_USER_CODE_URL, {\n\t\tmethod: \"POST\",\n\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\tbody: JSON.stringify({ client_id: CLIENT_ID }),\n\t\tsignal,\n\t});\n\n\tif (!response.ok) {\n\t\tif (response.status === 404) {\n\t\t\tthrow new Error(\n\t\t\t\t\"OpenAI Codex device code login is not enabled for this server. Use browser login or verify the server URL.\",\n\t\t\t);\n\t\t}\n\t\tconst responseBody = await response.text().catch(() => \"\");\n\t\tthrow new Error(\n\t\t\t`OpenAI Codex device code request failed with status ${response.status}${responseBody ? `: ${responseBody}` : \"\"}`,\n\t\t);\n\t}\n\n\tconst rawJson = await response.json();\n\tconst json = rawJson as {\n\t\tdevice_auth_id?: string;\n\t\tuser_code?: string;\n\t\tinterval?: number | string;\n\t} | null;\n\tconst intervalSeconds = typeof json?.interval === \"string\" ? Number(json.interval.trim()) : json?.interval;\n\tif (\n\t\t!json?.device_auth_id ||\n\t\t!json.user_code ||\n\t\ttypeof intervalSeconds !== \"number\" ||\n\t\t!Number.isFinite(intervalSeconds) ||\n\t\tintervalSeconds < 0\n\t) {\n\t\tthrow new Error(`Invalid OpenAI Codex device code response: ${JSON.stringify(json)}`);\n\t}\n\n\treturn {\n\t\tdeviceAuthId: json.device_auth_id,\n\t\tuserCode: json.user_code,\n\t\tintervalSeconds,\n\t};\n}\n\nasync function pollOpenAICodexDeviceAuth(device: DeviceAuthInfo, signal?: AbortSignal): Promise<DeviceTokenSuccess> {\n\treturn pollOAuthDeviceCodeFlow<DeviceTokenSuccess>({\n\t\tintervalSeconds: device.intervalSeconds,\n\t\texpiresInSeconds: DEVICE_CODE_TIMEOUT_SECONDS,\n\t\tsignal,\n\t\tpoll: async () => {\n\t\t\tconst response = await fetchWithLoginCancellation(DEVICE_TOKEN_URL, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\tdevice_auth_id: device.deviceAuthId,\n\t\t\t\t\tuser_code: device.userCode,\n\t\t\t\t}),\n\t\t\t\tsignal,\n\t\t\t});\n\n\t\t\tif (response.ok) {\n\t\t\t\tconst rawJson = await response.json();\n\t\t\t\tconst json = rawJson as { authorization_code?: string; code_verifier?: string } | null;\n\t\t\t\tif (!json?.authorization_code || !json.code_verifier) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tstatus: \"failed\",\n\t\t\t\t\t\tmessage: `Invalid OpenAI Codex device auth token response: ${JSON.stringify(json)}`,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstatus: \"complete\",\n\t\t\t\t\tvalue: { authorizationCode: json.authorization_code, codeVerifier: json.code_verifier },\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (response.status === 403 || response.status === 404) {\n\t\t\t\treturn { status: \"pending\" };\n\t\t\t}\n\n\t\t\tconst responseBody = await response.text().catch(() => \"\");\n\t\t\tlet errorCode: unknown;\n\t\t\ttry {\n\t\t\t\tconst json = JSON.parse(responseBody) as { error?: string | { code?: string } } | null;\n\t\t\t\tconst error = json?.error;\n\t\t\t\terrorCode = typeof error === \"object\" ? error?.code : error;\n\t\t\t} catch {}\n\n\t\t\tif (errorCode === \"deviceauth_authorization_pending\") {\n\t\t\t\treturn { status: \"pending\" };\n\t\t\t}\n\t\t\tif (errorCode === \"slow_down\") {\n\t\t\t\treturn { status: \"slow_down\" };\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tstatus: \"failed\",\n\t\t\t\tmessage: `OpenAI Codex device auth failed with status ${response.status}${responseBody ? `: ${responseBody}` : \"\"}`,\n\t\t\t};\n\t\t},\n\t});\n}\n\nasync function createAuthorizationFlow(\n\toriginator: string = \"senpi\",\n): Promise<{ verifier: string; state: string; url: string }> {\n\tconst { verifier, challenge } = await generatePKCE();\n\tconst state = createState();\n\n\tconst url = new URL(AUTHORIZE_URL);\n\turl.searchParams.set(\"response_type\", \"code\");\n\turl.searchParams.set(\"client_id\", CLIENT_ID);\n\turl.searchParams.set(\"redirect_uri\", REDIRECT_URI);\n\turl.searchParams.set(\"scope\", SCOPE);\n\turl.searchParams.set(\"code_challenge\", challenge);\n\turl.searchParams.set(\"code_challenge_method\", \"S256\");\n\turl.searchParams.set(\"state\", state);\n\turl.searchParams.set(\"id_token_add_organizations\", \"true\");\n\turl.searchParams.set(\"codex_cli_simplified_flow\", \"true\");\n\turl.searchParams.set(\"originator\", originator);\n\n\treturn { verifier, state, url: url.toString() };\n}\n\ntype OAuthServerInfo = {\n\tclose: () => void;\n\tcancelWait: () => void;\n\twaitForCode: () => Promise<{ code: string } | null>;\n};\n\nfunction startLocalOAuthServer(state: string): Promise<OAuthServerInfo> {\n\tif (!_http) {\n\t\tthrow new Error(\"OpenAI Codex OAuth is only available in Node.js environments\");\n\t}\n\n\tlet settleWait: ((value: { code: string } | null) => void) | undefined;\n\tconst waitForCodePromise = new Promise<{ code: string } | null>((resolve) => {\n\t\tlet settled = false;\n\t\tsettleWait = (value) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tresolve(value);\n\t\t};\n\t});\n\n\tconst server = _http.createServer((req, res) => {\n\t\ttry {\n\t\t\tconst url = new URL(req.url || \"\", \"http://localhost\");\n\t\t\tif (url.pathname !== \"/auth/callback\") {\n\t\t\t\tres.statusCode = 404;\n\t\t\t\tres.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\t\tres.end(oauthErrorHtml(\"Callback route not found.\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (url.searchParams.get(\"state\") !== state) {\n\t\t\t\tres.statusCode = 400;\n\t\t\t\tres.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\t\tres.end(oauthErrorHtml(\"State mismatch.\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst code = url.searchParams.get(\"code\");\n\t\t\tif (!code) {\n\t\t\t\tres.statusCode = 400;\n\t\t\t\tres.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\t\tres.end(oauthErrorHtml(\"Missing authorization code.\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tres.statusCode = 200;\n\t\t\tres.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\tres.end(oauthSuccessHtml(\"OpenAI authentication completed. You can close this window.\"));\n\t\t\tsettleWait?.({ code });\n\t\t} catch {\n\t\t\tres.statusCode = 500;\n\t\t\tres.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n\t\t\tres.end(oauthErrorHtml(\"Internal error while processing OAuth callback.\"));\n\t\t}\n\t});\n\n\treturn new Promise((resolve) => {\n\t\tserver\n\t\t\t.listen(1455, getCallbackHost(), () => {\n\t\t\t\tresolve({\n\t\t\t\t\tclose: () => server.close(),\n\t\t\t\t\tcancelWait: () => {\n\t\t\t\t\t\tsettleWait?.(null);\n\t\t\t\t\t},\n\t\t\t\t\twaitForCode: () => waitForCodePromise,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.on(\"error\", (_err: NodeJS.ErrnoException) => {\n\t\t\t\tsettleWait?.(null);\n\t\t\t\tresolve({\n\t\t\t\t\tclose: () => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tserver.close();\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// ignore\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcancelWait: () => {},\n\t\t\t\t\twaitForCode: async () => null,\n\t\t\t\t});\n\t\t\t});\n\t});\n}\n\nfunction getAccountId(accessToken: string): string | null {\n\tconst payload = decodeJwt(accessToken);\n\tconst auth = payload?.[JWT_CLAIM_PATH];\n\tconst accountId = auth?.chatgpt_account_id;\n\treturn typeof accountId === \"string\" && accountId.length > 0 ? accountId : null;\n}\n\nfunction credentialsFromToken(token: OAuthToken): OAuthCredentials {\n\tconst accountId = getAccountId(token.access);\n\tif (!accountId) {\n\t\tthrow new Error(\"Failed to extract accountId from token\");\n\t}\n\n\treturn {\n\t\taccess: token.access,\n\t\trefresh: token.refresh,\n\t\texpires: token.expires,\n\t\taccountId,\n\t};\n}\n\nasync function exchangeAuthorizationCodeForCredentials(\n\tcode: string,\n\tverifier: string,\n\tredirectUri: string,\n\tsignal?: AbortSignal,\n): Promise<OAuthCredentials> {\n\treturn credentialsFromToken(await exchangeAuthorizationCode(code, verifier, redirectUri, signal));\n}\n\n/**\n * Login with OpenAI Codex OAuth using the Codex device-code flow.\n */\nexport async function loginOpenAICodexDeviceCode(options: {\n\tonDeviceCode: (info: OAuthDeviceCodeInfo) => void;\n\tsignal?: AbortSignal;\n}): Promise<OAuthCredentials> {\n\tconst device = await startOpenAICodexDeviceAuth(options.signal);\n\toptions.onDeviceCode({\n\t\tuserCode: device.userCode,\n\t\tverificationUri: DEVICE_VERIFICATION_URI,\n\t\tintervalSeconds: device.intervalSeconds,\n\t\texpiresInSeconds: DEVICE_CODE_TIMEOUT_SECONDS,\n\t});\n\tconst code = await pollOpenAICodexDeviceAuth(device, options.signal);\n\treturn exchangeAuthorizationCodeForCredentials(\n\t\tcode.authorizationCode,\n\t\tcode.codeVerifier,\n\t\tDEVICE_REDIRECT_URI,\n\t\toptions.signal,\n\t);\n}\n\n/**\n * Login with OpenAI Codex OAuth\n *\n * @param options.onAuth - Called with URL and instructions when auth starts\n * @param options.onPrompt - Called to prompt user for manual code paste (fallback if no onManualCodeInput)\n * @param options.onProgress - Optional progress messages\n * @param options.onManualCodeInput - Optional promise that resolves with user-pasted code.\n * Races with browser callback - whichever completes first wins.\n * Useful for showing paste input immediately alongside browser flow.\n * @param options.originator - OAuth originator parameter (defaults to \"senpi\")\n */\nexport async function loginOpenAICodex(options: {\n\tonAuth: (info: { url: string; instructions?: string }) => void;\n\tonPrompt: (prompt: OAuthPrompt) => Promise<string>;\n\tonProgress?: (message: string) => void;\n\tonManualCodeInput?: () => Promise<string>;\n\toriginator?: string;\n}): Promise<OAuthCredentials> {\n\tconst { verifier, state, url } = await createAuthorizationFlow(options.originator);\n\tconst server = await startLocalOAuthServer(state);\n\n\toptions.onAuth({ url, instructions: \"A browser window should open. Complete login to finish.\" });\n\n\tlet code: string | undefined;\n\ttry {\n\t\tif (options.onManualCodeInput) {\n\t\t\t// Race between browser callback and manual input\n\t\t\tlet manualCode: string | undefined;\n\t\t\tlet manualError: Error | undefined;\n\t\t\tconst manualPromise = options\n\t\t\t\t.onManualCodeInput()\n\t\t\t\t.then((input) => {\n\t\t\t\t\tmanualCode = input;\n\t\t\t\t\tserver.cancelWait();\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\tmanualError = err instanceof Error ? err : new Error(String(err));\n\t\t\t\t\tserver.cancelWait();\n\t\t\t\t});\n\n\t\t\tconst result = await server.waitForCode();\n\n\t\t\t// If manual input was cancelled, throw that error\n\t\t\tif (manualError) {\n\t\t\t\tthrow manualError;\n\t\t\t}\n\n\t\t\tif (result?.code) {\n\t\t\t\t// Browser callback won\n\t\t\t\tcode = result.code;\n\t\t\t} else if (manualCode) {\n\t\t\t\t// Manual input won (or callback timed out and user had entered code)\n\t\t\t\tconst parsed = parseAuthorizationInput(manualCode);\n\t\t\t\tif (parsed.state && parsed.state !== state) {\n\t\t\t\t\tthrow new Error(\"State mismatch\");\n\t\t\t\t}\n\t\t\t\tcode = parsed.code;\n\t\t\t}\n\n\t\t\t// If still no code, wait for manual promise to complete and try that\n\t\t\tif (!code) {\n\t\t\t\tawait manualPromise;\n\t\t\t\tif (manualError) {\n\t\t\t\t\tthrow manualError;\n\t\t\t\t}\n\t\t\t\tif (manualCode) {\n\t\t\t\t\tconst parsed = parseAuthorizationInput(manualCode);\n\t\t\t\t\tif (parsed.state && parsed.state !== state) {\n\t\t\t\t\t\tthrow new Error(\"State mismatch\");\n\t\t\t\t\t}\n\t\t\t\t\tcode = parsed.code;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Original flow: wait for callback, then prompt if needed\n\t\t\tconst result = await server.waitForCode();\n\t\t\tif (result?.code) {\n\t\t\t\tcode = result.code;\n\t\t\t}\n\t\t}\n\n\t\t// Fallback to onPrompt if still no code\n\t\tif (!code) {\n\t\t\tconst input = await options.onPrompt({\n\t\t\t\tmessage: \"Paste the authorization code (or full redirect URL):\",\n\t\t\t});\n\t\t\tconst parsed = parseAuthorizationInput(input);\n\t\t\tif (parsed.state && parsed.state !== state) {\n\t\t\t\tthrow new Error(\"State mismatch\");\n\t\t\t}\n\t\t\tcode = parsed.code;\n\t\t}\n\n\t\tif (!code) {\n\t\t\tthrow new Error(\"Missing authorization code\");\n\t\t}\n\n\t\treturn exchangeAuthorizationCodeForCredentials(code, verifier, REDIRECT_URI);\n\t} finally {\n\t\tserver.close();\n\t}\n}\n\n/**\n * Refresh OpenAI Codex OAuth token\n */\nexport async function refreshOpenAICodexToken(refreshToken: string): Promise<OAuthCredentials> {\n\treturn credentialsFromToken(await refreshAccessToken(refreshToken));\n}\n\nexport const openaiCodexOAuth: OAuthAuth = {\n\tname: \"OpenAI (ChatGPT Plus/Pro)\",\n\n\tasync login(callbacks) {\n\t\tconst method = await callbacks.prompt({\n\t\t\ttype: \"select\",\n\t\t\tmessage: \"Select OpenAI Codex login method:\",\n\t\t\toptions: [\n\t\t\t\t{ id: OPENAI_CODEX_BROWSER_LOGIN_METHOD, label: \"Browser login (default)\" },\n\t\t\t\t{ id: OPENAI_CODEX_DEVICE_CODE_LOGIN_METHOD, label: \"Device code login (headless)\" },\n\t\t\t],\n\t\t});\n\n\t\tif (method === OPENAI_CODEX_DEVICE_CODE_LOGIN_METHOD) {\n\t\t\tconst credentials = await loginOpenAICodexDeviceCode({\n\t\t\t\tonDeviceCode: (info) => callbacks.notify({ type: \"device_code\", ...info }),\n\t\t\t\tsignal: callbacks.signal,\n\t\t\t});\n\t\t\treturn { ...credentials, type: \"oauth\" };\n\t\t}\n\t\tif (method !== OPENAI_CODEX_BROWSER_LOGIN_METHOD) {\n\t\t\tthrow new Error(`Unknown OpenAI Codex login method: ${method}`);\n\t\t}\n\n\t\t// The manual_code prompt races the local callback server; abort it once\n\t\t// the flow settles so the UI can dismiss the pending input.\n\t\tconst manualAbort = new AbortController();\n\t\ttry {\n\t\t\tconst credentials = await loginOpenAICodex({\n\t\t\t\tonAuth: (info) => callbacks.notify({ type: \"auth_url\", url: info.url, instructions: info.instructions }),\n\t\t\t\tonProgress: (message) => callbacks.notify({ type: \"progress\", message }),\n\t\t\t\tonPrompt: (prompt) =>\n\t\t\t\t\tcallbacks.prompt({ type: \"text\", message: prompt.message, placeholder: prompt.placeholder }),\n\t\t\t\tonManualCodeInput: () =>\n\t\t\t\t\tcallbacks.prompt({\n\t\t\t\t\t\ttype: \"manual_code\",\n\t\t\t\t\t\tmessage: \"Complete login in your browser, or paste the authorization code / redirect URL here:\",\n\t\t\t\t\t\tplaceholder: REDIRECT_URI,\n\t\t\t\t\t\tsignal: manualAbort.signal,\n\t\t\t\t\t}),\n\t\t\t});\n\t\t\treturn { ...credentials, type: \"oauth\" };\n\t\t} finally {\n\t\t\tmanualAbort.abort();\n\t\t}\n\t},\n\n\tasync refresh(credential) {\n\t\treturn { ...(await refreshOpenAICodexToken(credential.refresh)), type: \"oauth\" };\n\t},\n\n\tasync toAuth(credential) {\n\t\treturn { apiKey: credential.access };\n\t},\n};\n\nexport const openaiCodexOAuthProvider: OAuthProviderInterface = {\n\tid: \"openai-codex\",\n\tname: \"ChatGPT Plus/Pro (Codex Subscription)\",\n\tusesCallbackServer: true,\n\n\tasync login(callbacks: OAuthLoginCallbacks): Promise<OAuthCredentials> {\n\t\tconst loginMethod = await callbacks.onSelect({\n\t\t\tmessage: \"Select OpenAI Codex login method:\",\n\t\t\toptions: [\n\t\t\t\t{ id: OPENAI_CODEX_BROWSER_LOGIN_METHOD, label: \"Browser login (default)\" },\n\t\t\t\t{ id: OPENAI_CODEX_DEVICE_CODE_LOGIN_METHOD, label: \"Device code login (headless)\" },\n\t\t\t],\n\t\t});\n\t\tif (!loginMethod) {\n\t\t\tthrow new Error(\"Login cancelled\");\n\t\t}\n\n\t\tif (loginMethod === OPENAI_CODEX_DEVICE_CODE_LOGIN_METHOD) {\n\t\t\treturn loginOpenAICodexDeviceCode({\n\t\t\t\tonDeviceCode: callbacks.onDeviceCode,\n\t\t\t\tsignal: callbacks.signal,\n\t\t\t});\n\t\t}\n\n\t\tif (loginMethod !== OPENAI_CODEX_BROWSER_LOGIN_METHOD) {\n\t\t\tthrow new Error(`Unknown OpenAI Codex login method: ${loginMethod}`);\n\t\t}\n\n\t\treturn loginOpenAICodex({\n\t\t\tonAuth: callbacks.onAuth,\n\t\t\tonPrompt: callbacks.onPrompt,\n\t\t\tonProgress: callbacks.onProgress,\n\t\t\tonManualCodeInput: callbacks.onManualCodeInput,\n\t\t});\n\t},\n\n\tasync refreshToken(credentials: OAuthCredentials): Promise<OAuthCredentials> {\n\t\treturn refreshOpenAICodexToken(credentials.refresh);\n\t},\n\n\tgetApiKey(credentials: OAuthCredentials): string {\n\t\treturn credentials.access;\n\t},\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AssistantMessage } from "../types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Classifies whether a failed assistant message looks like a transient provider
|
|
4
|
+
* or transport error, so callers can decide if the last assistant turn should be
|
|
5
|
+
* restarted.
|
|
6
|
+
*
|
|
7
|
+
* This does not implement retry policy. Callers should first handle context
|
|
8
|
+
* overflow separately, then apply their own retry budget, backoff, and reporting
|
|
9
|
+
* before restarting the assistant turn.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isRetryableAssistantError(message: AssistantMessage): boolean;
|
|
12
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAiFpD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAK5E"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
function buildProviderErrorPattern(patterns) {
|
|
2
|
+
return new RegExp(patterns.join("|"), "i");
|
|
3
|
+
}
|
|
4
|
+
const NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN = buildProviderErrorPattern([
|
|
5
|
+
// OpenCode Go/free-tier limits returned as 429 JSON error types by OpenCode's
|
|
6
|
+
// Zen API. These are subscription/account limits, not transient throttles.
|
|
7
|
+
"GoUsageLimitError",
|
|
8
|
+
"FreeUsageLimitError",
|
|
9
|
+
// OpenCode Go subscription-limit text asks users to enable available-balance
|
|
10
|
+
// usage after rolling/weekly/monthly limits are reached.
|
|
11
|
+
"Monthly usage limit reached",
|
|
12
|
+
"available balance",
|
|
13
|
+
// Generic quota/budget/billing exhaustion. `insufficient_quota` is OpenAI's
|
|
14
|
+
// quota/billing error code; the other strings cover common gateway wording.
|
|
15
|
+
"insufficient_quota",
|
|
16
|
+
"out of budget",
|
|
17
|
+
"quota exceeded",
|
|
18
|
+
"billing",
|
|
19
|
+
]);
|
|
20
|
+
const RETRYABLE_PROVIDER_ERROR_PATTERN = buildProviderErrorPattern([
|
|
21
|
+
// Generic provider load, HTTP status, and server-side transient failures.
|
|
22
|
+
"overloaded",
|
|
23
|
+
"rate.?limit",
|
|
24
|
+
"too many requests",
|
|
25
|
+
"429",
|
|
26
|
+
"500",
|
|
27
|
+
"502",
|
|
28
|
+
"503",
|
|
29
|
+
"504",
|
|
30
|
+
"service.?unavailable",
|
|
31
|
+
"server.?error",
|
|
32
|
+
"internal.?error",
|
|
33
|
+
// Wrapper/provider text for transient upstream failures, including OpenRouter
|
|
34
|
+
// "Provider returned error" responses (#2264).
|
|
35
|
+
"provider.?returned.?error",
|
|
36
|
+
// Network, proxy, and fetch transport failures. This includes OpenAI Codex
|
|
37
|
+
// raw-fetch failures such as "upstream connect", "connection refused", and
|
|
38
|
+
// "reset before headers" (#733), plus OpenRouter connection drops (#3317).
|
|
39
|
+
"network.?error",
|
|
40
|
+
"connection.?error",
|
|
41
|
+
"connection.?refused",
|
|
42
|
+
"connection.?lost",
|
|
43
|
+
"other side closed",
|
|
44
|
+
"fetch failed",
|
|
45
|
+
"upstream.?connect",
|
|
46
|
+
"reset before headers",
|
|
47
|
+
"socket hang up",
|
|
48
|
+
"timed? out",
|
|
49
|
+
"timeout",
|
|
50
|
+
"terminated",
|
|
51
|
+
// WebSocket transports can report close/error text instead of HTTP/fetch text.
|
|
52
|
+
"websocket.?closed",
|
|
53
|
+
"websocket.?error",
|
|
54
|
+
// Premature stream endings from SDKs and transports. Anthropic can throw
|
|
55
|
+
// "stream ended without ..." and "Anthropic stream ended before message_stop"
|
|
56
|
+
// (#4433); Bedrock/Smithy can throw an HTTP/2 no-response error (#3594).
|
|
57
|
+
"ended without",
|
|
58
|
+
"stream ended before message_stop",
|
|
59
|
+
"http2 request did not get a response",
|
|
60
|
+
// Provider-requested retry delay cap failures should flow through the outer
|
|
61
|
+
// retry policy so callers can surface/abort the backoff (#1123).
|
|
62
|
+
"retry delay",
|
|
63
|
+
// Explicit retry guidance emitted mid-stream by OpenAI Responses and Bedrock
|
|
64
|
+
// stream exceptions (#6019).
|
|
65
|
+
"you can retry your request",
|
|
66
|
+
"try your request again",
|
|
67
|
+
"please retry your request",
|
|
68
|
+
]);
|
|
69
|
+
/**
|
|
70
|
+
* Classifies whether a failed assistant message looks like a transient provider
|
|
71
|
+
* or transport error, so callers can decide if the last assistant turn should be
|
|
72
|
+
* restarted.
|
|
73
|
+
*
|
|
74
|
+
* This does not implement retry policy. Callers should first handle context
|
|
75
|
+
* overflow separately, then apply their own retry budget, backoff, and reporting
|
|
76
|
+
* before restarting the assistant turn.
|
|
77
|
+
*/
|
|
78
|
+
export function isRetryableAssistantError(message) {
|
|
79
|
+
if (message.stopReason !== "error" || !message.errorMessage)
|
|
80
|
+
return false;
|
|
81
|
+
const errorMessage = message.errorMessage;
|
|
82
|
+
if (NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN.test(errorMessage))
|
|
83
|
+
return false;
|
|
84
|
+
return RETRYABLE_PROVIDER_ERROR_PATTERN.test(errorMessage);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAEA,SAAS,yBAAyB,CAAC,QAA2B;IAC7D,OAAO,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,0CAA0C,GAAG,yBAAyB,CAAC;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gC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["import type { AssistantMessage } from \"../types.ts\";\n\nfunction buildProviderErrorPattern(patterns: readonly string[]): RegExp {\n\treturn new RegExp(patterns.join(\"|\"), \"i\");\n}\n\nconst NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN = buildProviderErrorPattern([\n\t// OpenCode Go/free-tier limits returned as 429 JSON error types by OpenCode's\n\t// Zen API. These are subscription/account limits, not transient throttles.\n\t\"GoUsageLimitError\",\n\t\"FreeUsageLimitError\",\n\n\t// OpenCode Go subscription-limit text asks users to enable available-balance\n\t// usage after rolling/weekly/monthly limits are reached.\n\t\"Monthly usage limit reached\",\n\t\"available balance\",\n\n\t// Generic quota/budget/billing exhaustion. `insufficient_quota` is OpenAI's\n\t// quota/billing error code; the other strings cover common gateway wording.\n\t\"insufficient_quota\",\n\t\"out of budget\",\n\t\"quota exceeded\",\n\t\"billing\",\n]);\n\nconst RETRYABLE_PROVIDER_ERROR_PATTERN = buildProviderErrorPattern([\n\t// Generic provider load, HTTP status, and server-side transient failures.\n\t\"overloaded\",\n\t\"rate.?limit\",\n\t\"too many requests\",\n\t\"429\",\n\t\"500\",\n\t\"502\",\n\t\"503\",\n\t\"504\",\n\t\"service.?unavailable\",\n\t\"server.?error\",\n\t\"internal.?error\",\n\n\t// Wrapper/provider text for transient upstream failures, including OpenRouter\n\t// \"Provider returned error\" responses (#2264).\n\t\"provider.?returned.?error\",\n\n\t// Network, proxy, and fetch transport failures. This includes OpenAI Codex\n\t// raw-fetch failures such as \"upstream connect\", \"connection refused\", and\n\t// \"reset before headers\" (#733), plus OpenRouter connection drops (#3317).\n\t\"network.?error\",\n\t\"connection.?error\",\n\t\"connection.?refused\",\n\t\"connection.?lost\",\n\t\"other side closed\",\n\t\"fetch failed\",\n\t\"upstream.?connect\",\n\t\"reset before headers\",\n\t\"socket hang up\",\n\t\"timed? out\",\n\t\"timeout\",\n\t\"terminated\",\n\n\t// WebSocket transports can report close/error text instead of HTTP/fetch text.\n\t\"websocket.?closed\",\n\t\"websocket.?error\",\n\n\t// Premature stream endings from SDKs and transports. Anthropic can throw\n\t// \"stream ended without ...\" and \"Anthropic stream ended before message_stop\"\n\t// (#4433); Bedrock/Smithy can throw an HTTP/2 no-response error (#3594).\n\t\"ended without\",\n\t\"stream ended before message_stop\",\n\t\"http2 request did not get a response\",\n\n\t// Provider-requested retry delay cap failures should flow through the outer\n\t// retry policy so callers can surface/abort the backoff (#1123).\n\t\"retry delay\",\n\n\t// Explicit retry guidance emitted mid-stream by OpenAI Responses and Bedrock\n\t// stream exceptions (#6019).\n\t\"you can retry your request\",\n\t\"try your request again\",\n\t\"please retry your request\",\n]);\n\n/**\n * Classifies whether a failed assistant message looks like a transient provider\n * or transport error, so callers can decide if the last assistant turn should be\n * restarted.\n *\n * This does not implement retry policy. Callers should first handle context\n * overflow separately, then apply their own retry budget, backoff, and reporting\n * before restarting the assistant turn.\n */\nexport function isRetryableAssistantError(message: AssistantMessage): boolean {\n\tif (message.stopReason !== \"error\" || !message.errorMessage) return false;\n\tconst errorMessage = message.errorMessage;\n\tif (NON_RETRYABLE_PROVIDER_LIMIT_ERROR_PATTERN.test(errorMessage)) return false;\n\treturn RETRYABLE_PROVIDER_ERROR_PATTERN.test(errorMessage);\n}\n"]}
|
|
@@ -1,59 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-ai",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "2026.6.
|
|
4
|
+
"version": "2026.6.30",
|
|
5
5
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
+
"sideEffects": [
|
|
10
|
+
"./dist/compat.js",
|
|
11
|
+
"./dist/images.js",
|
|
12
|
+
"./dist/providers/images/register-builtins.js"
|
|
13
|
+
],
|
|
9
14
|
"exports": {
|
|
10
15
|
".": {
|
|
11
16
|
"types": "./dist/index.d.ts",
|
|
12
17
|
"import": "./dist/index.js"
|
|
13
18
|
},
|
|
14
|
-
"./
|
|
15
|
-
"types": "./dist/
|
|
16
|
-
"import": "./dist/
|
|
17
|
-
},
|
|
18
|
-
"./amazon-bedrock": {
|
|
19
|
-
"types": "./dist/providers/amazon-bedrock.d.ts",
|
|
20
|
-
"import": "./dist/providers/amazon-bedrock.js"
|
|
21
|
-
},
|
|
22
|
-
"./anthropic": {
|
|
23
|
-
"types": "./dist/providers/anthropic.d.ts",
|
|
24
|
-
"import": "./dist/providers/anthropic.js"
|
|
25
|
-
},
|
|
26
|
-
"./azure-openai-responses": {
|
|
27
|
-
"types": "./dist/providers/azure-openai-responses.d.ts",
|
|
28
|
-
"import": "./dist/providers/azure-openai-responses.js"
|
|
29
|
-
},
|
|
30
|
-
"./google": {
|
|
31
|
-
"types": "./dist/providers/google.d.ts",
|
|
32
|
-
"import": "./dist/providers/google.js"
|
|
33
|
-
},
|
|
34
|
-
"./google-vertex": {
|
|
35
|
-
"types": "./dist/providers/google-vertex.d.ts",
|
|
36
|
-
"import": "./dist/providers/google-vertex.js"
|
|
37
|
-
},
|
|
38
|
-
"./mistral": {
|
|
39
|
-
"types": "./dist/providers/mistral.d.ts",
|
|
40
|
-
"import": "./dist/providers/mistral.js"
|
|
41
|
-
},
|
|
42
|
-
"./openai-codex-responses": {
|
|
43
|
-
"types": "./dist/providers/openai-codex-responses.d.ts",
|
|
44
|
-
"import": "./dist/providers/openai-codex-responses.js"
|
|
45
|
-
},
|
|
46
|
-
"./openai-completions": {
|
|
47
|
-
"types": "./dist/providers/openai-completions.d.ts",
|
|
48
|
-
"import": "./dist/providers/openai-completions.js"
|
|
19
|
+
"./compat": {
|
|
20
|
+
"types": "./dist/compat.d.ts",
|
|
21
|
+
"import": "./dist/compat.js"
|
|
49
22
|
},
|
|
50
|
-
"./
|
|
51
|
-
"types": "./dist/providers
|
|
52
|
-
"import": "./dist/providers
|
|
23
|
+
"./providers/*": {
|
|
24
|
+
"types": "./dist/providers/*.d.ts",
|
|
25
|
+
"import": "./dist/providers/*.js"
|
|
53
26
|
},
|
|
54
|
-
"./
|
|
55
|
-
"types": "./dist/
|
|
56
|
-
"import": "./dist/
|
|
27
|
+
"./api/*": {
|
|
28
|
+
"types": "./dist/api/*.d.ts",
|
|
29
|
+
"import": "./dist/api/*.js"
|
|
57
30
|
},
|
|
58
31
|
"./oauth": {
|
|
59
32
|
"types": "./dist/oauth.d.ts",
|
|
@@ -46,6 +46,8 @@ export interface MarkdownTheme {
|
|
|
46
46
|
export interface MarkdownOptions {
|
|
47
47
|
/** Preserve source list markers instead of normalizing them. */
|
|
48
48
|
preserveOrderedListMarkers?: boolean;
|
|
49
|
+
/** Preserve source backslash escapes instead of normalizing escaped punctuation. */
|
|
50
|
+
preserveBackslashEscapes?: boolean;
|
|
49
51
|
}
|
|
50
52
|
export declare class Markdown implements Component {
|
|
51
53
|
private text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/components/markdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/components/markdown.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAoG3C,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC;AAED,wBAAgB,6BAA6B,IAAI,MAAM,CAEtD;AAED,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC,gCAAgC;IAChC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACjC,gCAAgC;IAChC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,gBAAgB;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kBA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Y;IAIpB;;;OAGG;IACH,OAAO,CAAC,WAAW;CA6KnB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// allow: SIZE_OK - existing markdown renderer is oversized; this merge only preserves behavior and cache-key correctness.
|
|
1
2
|
import { Marked, Tokenizer } from "marked";
|
|
2
3
|
import { getCapabilities, hyperlink, isImageLine } from "../terminal-image.js";
|
|
3
4
|
import { applyBackgroundToLine, visibleWidth, wrapTextWithAnsi } from "../utils.js";
|
|
@@ -146,7 +147,7 @@ export class Markdown {
|
|
|
146
147
|
this.paddingX,
|
|
147
148
|
this.paddingY,
|
|
148
149
|
this.theme.codeBlockIndent ?? " ",
|
|
149
|
-
this.options.preserveOrderedListMarkers ? 1 : 0,
|
|
150
|
+
(this.options.preserveOrderedListMarkers ? 1 : 0) | (this.options.preserveBackslashEscapes ? 2 : 0),
|
|
150
151
|
objectId(this.theme),
|
|
151
152
|
styleKey,
|
|
152
153
|
getCapabilities().images ?? "",
|
|
@@ -479,6 +480,9 @@ export class Markdown {
|
|
|
479
480
|
};
|
|
480
481
|
for (const token of tokens) {
|
|
481
482
|
switch (token.type) {
|
|
483
|
+
case "escape":
|
|
484
|
+
result += applyTextWithNewlines(this.options.preserveBackslashEscapes ? token.raw : token.text);
|
|
485
|
+
break;
|
|
482
486
|
case "text":
|
|
483
487
|
// Text tokens in list items can have nested tokens for inline formatting
|
|
484
488
|
if (token.tokens && token.tokens.length > 0) {
|