@steipete/summarize 0.17.3 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/README.md +28 -9
- package/completions/summarize.fish +162 -0
- package/dist/esm/application/api-status.js +31 -0
- package/dist/esm/application/api-status.js.map +1 -0
- package/dist/esm/application/cli-fallback-state.js.map +1 -0
- package/dist/esm/{run/run-config.js → application/config-state.js} +32 -23
- package/dist/esm/application/config-state.js.map +1 -0
- package/dist/esm/application/context.js +15 -0
- package/dist/esm/application/context.js.map +1 -0
- package/dist/esm/{run/run-env.js → application/environment-state.js} +2 -2
- package/dist/esm/application/environment-state.js.map +1 -0
- package/dist/esm/application/environment.js +65 -0
- package/dist/esm/application/environment.js.map +1 -0
- package/dist/esm/application/execute-summarize.js +592 -0
- package/dist/esm/application/execute-summarize.js.map +1 -0
- package/dist/esm/application/execution-resources.js +159 -0
- package/dist/esm/application/execution-resources.js.map +1 -0
- package/dist/esm/{run/runner-contexts.js → application/flow-contexts.js} +17 -55
- package/dist/esm/application/flow-contexts.js.map +1 -0
- package/dist/esm/application/input-acquisition.js +147 -0
- package/dist/esm/application/input-acquisition.js.map +1 -0
- package/dist/esm/{run/run-metrics.js → application/metrics.js} +3 -3
- package/dist/esm/{run/run-metrics.js.map → application/metrics.js.map} +1 -1
- package/dist/esm/application/model-attempts.js +52 -0
- package/dist/esm/application/model-attempts.js.map +1 -0
- package/dist/esm/application/model-catalog.js +34 -0
- package/dist/esm/application/model-catalog.js.map +1 -0
- package/dist/esm/application/model-runtime.js +77 -0
- package/dist/esm/application/model-runtime.js.map +1 -0
- package/dist/esm/{run/run-models.js → application/model-selection.js} +2 -2
- package/dist/esm/application/model-selection.js.map +1 -0
- package/dist/esm/{run/run-output.js → application/output-policy.js} +2 -2
- package/dist/esm/application/output-policy.js.map +1 -0
- package/dist/esm/application/provider-runtime.js +37 -0
- package/dist/esm/application/provider-runtime.js.map +1 -0
- package/dist/esm/application/run-spec.js +110 -0
- package/dist/esm/application/run-spec.js.map +1 -0
- package/dist/esm/{run/stdin-temp-file.js → application/stdin-input.js} +1 -1
- package/dist/esm/{run/stdin-temp-file.js.map → application/stdin-input.js.map} +1 -1
- package/dist/esm/application/summarize-contracts.js +2 -0
- package/dist/esm/application/summarize-contracts.js.map +1 -0
- package/dist/esm/application/url-result.js +18 -0
- package/dist/esm/application/url-result.js.map +1 -0
- package/dist/esm/application/url-runtime.js +86 -0
- package/dist/esm/application/url-runtime.js.map +1 -0
- package/dist/esm/cache.js +8 -4
- package/dist/esm/cache.js.map +1 -1
- package/dist/esm/cli-main.js +33 -5
- package/dist/esm/cli-main.js.map +1 -1
- package/dist/esm/config/sections.js +7 -1
- package/dist/esm/config/sections.js.map +1 -1
- package/dist/esm/content/asset.js +36 -19
- package/dist/esm/content/asset.js.map +1 -1
- package/dist/esm/daemon/agent-cache.js +72 -0
- package/dist/esm/daemon/agent-cache.js.map +1 -0
- package/dist/esm/daemon/agent-model.js +97 -155
- package/dist/esm/daemon/agent-model.js.map +1 -1
- package/dist/esm/daemon/agent.js +9 -1
- package/dist/esm/daemon/agent.js.map +1 -1
- package/dist/esm/daemon/chat.js +33 -228
- package/dist/esm/daemon/chat.js.map +1 -1
- package/dist/esm/daemon/cli.js +4 -4
- package/dist/esm/daemon/cli.js.map +1 -1
- package/dist/esm/daemon/model-discovery.js +50 -0
- package/dist/esm/daemon/model-discovery.js.map +1 -0
- package/dist/esm/daemon/models.js +123 -190
- package/dist/esm/daemon/models.js.map +1 -1
- package/dist/esm/daemon/server-admin-routes.js +1 -0
- package/dist/esm/daemon/server-admin-routes.js.map +1 -1
- package/dist/esm/daemon/server-agent-route.js +39 -8
- package/dist/esm/daemon/server-agent-route.js.map +1 -1
- package/dist/esm/daemon/server-auth.js +30 -0
- package/dist/esm/daemon/server-auth.js.map +1 -0
- package/dist/esm/daemon/server-event-channel.js +30 -0
- package/dist/esm/daemon/server-event-channel.js.map +1 -0
- package/dist/esm/daemon/server-http.js +1 -0
- package/dist/esm/daemon/server-http.js.map +1 -1
- package/dist/esm/daemon/server-refresh-route.js +65 -0
- package/dist/esm/daemon/server-refresh-route.js.map +1 -0
- package/dist/esm/daemon/server-runtime.js +139 -0
- package/dist/esm/daemon/server-runtime.js.map +1 -0
- package/dist/esm/daemon/server-session-routes.js +16 -13
- package/dist/esm/daemon/server-session-routes.js.map +1 -1
- package/dist/esm/daemon/server-session.js +17 -55
- package/dist/esm/daemon/server-session.js.map +1 -1
- package/dist/esm/daemon/server-sse.js +2 -1
- package/dist/esm/daemon/server-sse.js.map +1 -1
- package/dist/esm/daemon/server-summarize-events.js +235 -0
- package/dist/esm/daemon/server-summarize-events.js.map +1 -0
- package/dist/esm/daemon/server-summarize-execution.js +94 -264
- package/dist/esm/daemon/server-summarize-execution.js.map +1 -1
- package/dist/esm/daemon/server-summarize-request.js +1 -17
- package/dist/esm/daemon/server-summarize-request.js.map +1 -1
- package/dist/esm/daemon/server-summarize-route.js +191 -0
- package/dist/esm/daemon/server-summarize-route.js.map +1 -0
- package/dist/esm/daemon/server.js +54 -379
- package/dist/esm/daemon/server.js.map +1 -1
- package/dist/esm/daemon/summarize-presentation.js +74 -0
- package/dist/esm/daemon/summarize-presentation.js.map +1 -0
- package/dist/esm/daemon/url-fetch-guard.js +12 -226
- package/dist/esm/daemon/url-fetch-guard.js.map +1 -1
- package/dist/esm/engine/cli-model-id.js +21 -0
- package/dist/esm/engine/cli-model-id.js.map +1 -0
- package/dist/esm/engine/errors.js +20 -0
- package/dist/esm/engine/errors.js.map +1 -0
- package/dist/esm/engine/events.js +2 -0
- package/dist/esm/engine/events.js.map +1 -0
- package/dist/esm/engine/fetch-with-timeout.js.map +1 -0
- package/dist/esm/engine/fixed-model-attempt.js +41 -0
- package/dist/esm/engine/fixed-model-attempt.js.map +1 -0
- package/dist/esm/{run → engine}/model-attempts.js +4 -0
- package/dist/esm/engine/model-attempts.js.map +1 -0
- package/dist/esm/{run/summary-llm.js → engine/model-call.js} +1 -1
- package/dist/esm/engine/model-call.js.map +1 -0
- package/dist/esm/engine/model-executor.js +389 -0
- package/dist/esm/engine/model-executor.js.map +1 -0
- package/dist/esm/engine/model-meta.js +12 -0
- package/dist/esm/engine/model-meta.js.map +1 -0
- package/dist/esm/engine/openrouter.js.map +1 -0
- package/dist/esm/engine/provider-attempt.js +19 -0
- package/dist/esm/engine/provider-attempt.js.map +1 -0
- package/dist/esm/{run → engine}/streaming.js +1 -1
- package/dist/esm/engine/streaming.js.map +1 -0
- package/dist/esm/engine/summary-execution.js +152 -0
- package/dist/esm/engine/summary-execution.js.map +1 -0
- package/dist/esm/engine/summary-timestamps.js.map +1 -0
- package/dist/esm/{run → engine}/types.js.map +1 -1
- package/dist/esm/{run/flows/url/summary-prompt.js → engine/web-prompt.js} +5 -4
- package/dist/esm/engine/web-prompt.js.map +1 -0
- package/dist/esm/engine/web-summary.js +175 -0
- package/dist/esm/engine/web-summary.js.map +1 -0
- package/dist/esm/flags.js +10 -0
- package/dist/esm/flags.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/llm/cli-exec.js +36 -1
- package/dist/esm/llm/cli-exec.js.map +1 -1
- package/dist/esm/llm/cli.js +13 -2
- package/dist/esm/llm/cli.js.map +1 -1
- package/dist/esm/llm/generate-text-stream.js +58 -21
- package/dist/esm/llm/generate-text-stream.js.map +1 -1
- package/dist/esm/llm/generate-text-types.js +2 -0
- package/dist/esm/llm/generate-text-types.js.map +1 -0
- package/dist/esm/llm/generate-text.js +21 -88
- package/dist/esm/llm/generate-text.js.map +1 -1
- package/dist/esm/llm/openai-client-config.js +47 -0
- package/dist/esm/llm/openai-client-config.js.map +1 -0
- package/dist/esm/llm/provider-capabilities.js +1 -1
- package/dist/esm/llm/provider-capabilities.js.map +1 -1
- package/dist/esm/llm/provider-profile.js +139 -49
- package/dist/esm/llm/provider-profile.js.map +1 -1
- package/dist/esm/llm/providers/models.js +28 -0
- package/dist/esm/llm/providers/models.js.map +1 -1
- package/dist/esm/llm/providers/openai/chat-completions.js +100 -0
- package/dist/esm/llm/providers/openai/chat-completions.js.map +1 -0
- package/dist/esm/llm/providers/openai/github-models.js +30 -0
- package/dist/esm/llm/providers/openai/github-models.js.map +1 -0
- package/dist/esm/llm/providers/openai/request-options.js +42 -0
- package/dist/esm/llm/providers/openai/request-options.js.map +1 -0
- package/dist/esm/llm/providers/openai/responses.js +166 -0
- package/dist/esm/llm/providers/openai/responses.js.map +1 -0
- package/dist/esm/llm/providers/openai/sse.js +57 -0
- package/dist/esm/llm/providers/openai/sse.js.map +1 -0
- package/dist/esm/llm/providers/openai/transport.js +109 -0
- package/dist/esm/llm/providers/openai/transport.js.map +1 -0
- package/dist/esm/llm/providers/openai/types.js +2 -0
- package/dist/esm/llm/providers/openai/types.js.map +1 -0
- package/dist/esm/llm/providers/openai.js +8 -549
- package/dist/esm/llm/providers/openai.js.map +1 -1
- package/dist/esm/logging/daemon.js +9 -1
- package/dist/esm/logging/daemon.js.map +1 -1
- package/dist/esm/media-cache.js +151 -65
- package/dist/esm/media-cache.js.map +1 -1
- package/dist/esm/model-auto.js +1 -1
- package/dist/esm/model-auto.js.map +1 -1
- package/dist/esm/refresh-free/benchmark.js +267 -0
- package/dist/esm/refresh-free/benchmark.js.map +1 -0
- package/dist/esm/refresh-free/catalog.js +118 -0
- package/dist/esm/refresh-free/catalog.js.map +1 -0
- package/dist/esm/refresh-free/config.js +110 -0
- package/dist/esm/refresh-free/config.js.map +1 -0
- package/dist/esm/refresh-free/presentation.js +161 -0
- package/dist/esm/refresh-free/presentation.js.map +1 -0
- package/dist/esm/refresh-free.js +68 -623
- package/dist/esm/refresh-free.js.map +1 -1
- package/dist/esm/run/cli-input-progress.js +114 -0
- package/dist/esm/run/cli-input-progress.js.map +1 -0
- package/dist/esm/run/cli-preflight.js +5 -1
- package/dist/esm/run/cli-preflight.js.map +1 -1
- package/dist/esm/run/cli-summarize-command.js +285 -0
- package/dist/esm/run/cli-summarize-command.js.map +1 -0
- package/dist/esm/run/cli-summarize-execution.js +75 -0
- package/dist/esm/run/cli-summarize-execution.js.map +1 -0
- package/dist/esm/run/cli-summarize-output.js +85 -0
- package/dist/esm/run/cli-summarize-output.js.map +1 -0
- package/dist/esm/run/cli-summarize-request.js +79 -0
- package/dist/esm/run/cli-summarize-request.js.map +1 -0
- package/dist/esm/run/constants.js +0 -33
- package/dist/esm/run/constants.js.map +1 -1
- package/dist/esm/run/env.js +2 -84
- package/dist/esm/run/env.js.map +1 -1
- package/dist/esm/run/flows/asset/extract.js +8 -3
- package/dist/esm/run/flows/asset/extract.js.map +1 -1
- package/dist/esm/run/flows/asset/media.js +50 -40
- package/dist/esm/run/flows/asset/media.js.map +1 -1
- package/dist/esm/run/flows/asset/output.js +8 -19
- package/dist/esm/run/flows/asset/output.js.map +1 -1
- package/dist/esm/run/flows/asset/preprocess.js.map +1 -1
- package/dist/esm/run/flows/asset/summary-attempts.js +19 -71
- package/dist/esm/run/flows/asset/summary-attempts.js.map +1 -1
- package/dist/esm/run/flows/asset/summary.js +189 -391
- package/dist/esm/run/flows/asset/summary.js.map +1 -1
- package/dist/esm/run/flows/asset/types.js +2 -0
- package/dist/esm/run/flows/asset/types.js.map +1 -0
- package/dist/esm/run/flows/url/extraction-session.js +1 -0
- package/dist/esm/run/flows/url/extraction-session.js.map +1 -1
- package/dist/esm/run/flows/url/fetch-options.js +3 -0
- package/dist/esm/run/flows/url/fetch-options.js.map +1 -1
- package/dist/esm/run/flows/url/flow.js +24 -20
- package/dist/esm/run/flows/url/flow.js.map +1 -1
- package/dist/esm/run/flows/url/markdown.js +54 -201
- package/dist/esm/run/flows/url/markdown.js.map +1 -1
- package/dist/esm/run/flows/url/slides-output-render.js +1 -1
- package/dist/esm/run/flows/url/slides-output-render.js.map +1 -1
- package/dist/esm/run/flows/url/slides-output-stream.js +32 -11
- package/dist/esm/run/flows/url/slides-output-stream.js.map +1 -1
- package/dist/esm/run/flows/url/slides-output.js.map +1 -1
- package/dist/esm/run/flows/url/slides-session.js +1 -1
- package/dist/esm/run/flows/url/slides-session.js.map +1 -1
- package/dist/esm/run/flows/url/summary-finish.js +1 -11
- package/dist/esm/run/flows/url/summary-finish.js.map +1 -1
- package/dist/esm/run/flows/url/summary-json.js +2 -11
- package/dist/esm/run/flows/url/summary-json.js.map +1 -1
- package/dist/esm/run/flows/url/summary.js +37 -33
- package/dist/esm/run/flows/url/summary.js.map +1 -1
- package/dist/esm/run/flows/url/types.js.map +1 -1
- package/dist/esm/run/flows/url/video-only.js +15 -9
- package/dist/esm/run/flows/url/video-only.js.map +1 -1
- package/dist/esm/run/format.js +1 -3
- package/dist/esm/run/format.js.map +1 -1
- package/dist/esm/run/help.js +19 -2
- package/dist/esm/run/help.js.map +1 -1
- package/dist/esm/run/run-input.js +1 -1
- package/dist/esm/run/run-input.js.map +1 -1
- package/dist/esm/run/run-settings.js +24 -4
- package/dist/esm/run/run-settings.js.map +1 -1
- package/dist/esm/run/runner-flags.js +2 -0
- package/dist/esm/run/runner-flags.js.map +1 -1
- package/dist/esm/run/runner.js +6 -9
- package/dist/esm/run/runner.js.map +1 -1
- package/dist/esm/run/slides-cli.js +1 -1
- package/dist/esm/run/slides-cli.js.map +1 -1
- package/dist/esm/run/status-cli.js +339 -0
- package/dist/esm/run/status-cli.js.map +1 -0
- package/dist/esm/run/stream-output.js +22 -7
- package/dist/esm/run/stream-output.js.map +1 -1
- package/dist/esm/run/summary-stream.js +70 -0
- package/dist/esm/run/summary-stream.js.map +1 -0
- package/dist/esm/shared/format-count.js +19 -0
- package/dist/esm/shared/format-count.js.map +1 -0
- package/dist/esm/shared/run-api-status.js +12 -0
- package/dist/esm/shared/run-api-status.js.map +1 -0
- package/dist/esm/shared/summary-length.js +4 -0
- package/dist/esm/shared/summary-length.js.map +1 -0
- package/dist/esm/slides/extract.js +5 -3
- package/dist/esm/slides/extract.js.map +1 -1
- package/dist/esm/slides/frame-extraction.js +2 -2
- package/dist/esm/slides/frame-extraction.js.map +1 -1
- package/dist/esm/slides/settings.js +1 -1
- package/dist/esm/slides/settings.js.map +1 -1
- package/dist/esm/tty/format.js +1 -18
- package/dist/esm/tty/format.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/application/api-status.d.ts +3 -0
- package/dist/types/{run/run-config.d.ts → application/config-state.d.ts} +18 -7
- package/dist/types/application/context.d.ts +8 -0
- package/dist/types/application/environment.d.ts +7 -0
- package/dist/types/application/execute-summarize.d.ts +3 -0
- package/dist/types/application/execution-resources.d.ts +65 -0
- package/dist/types/application/flow-contexts.d.ts +20 -0
- package/dist/types/application/input-acquisition.d.ts +46 -0
- package/dist/types/application/model-attempts.d.ts +36 -0
- package/dist/types/application/model-catalog.d.ts +4 -0
- package/dist/types/application/model-runtime.d.ts +63 -0
- package/dist/types/application/provider-runtime.d.ts +12 -0
- package/dist/types/application/run-spec.d.ts +49 -0
- package/dist/types/application/summarize-contracts.d.ts +201 -0
- package/dist/types/application/url-result.d.ts +36 -0
- package/dist/types/application/url-runtime.d.ts +18 -0
- package/dist/types/cache.d.ts +2 -2
- package/dist/types/cli-main.d.ts +1 -0
- package/dist/types/config/sections.d.ts +3 -2
- package/dist/types/config/types.d.ts +2 -0
- package/dist/types/content/asset.d.ts +3 -0
- package/dist/types/daemon/agent-cache.d.ts +21 -0
- package/dist/types/daemon/agent-model.d.ts +14 -2
- package/dist/types/daemon/agent.d.ts +2 -1
- package/dist/types/daemon/model-discovery.d.ts +9 -0
- package/dist/types/daemon/models.d.ts +22 -20
- package/dist/types/daemon/server-agent-route.d.ts +3 -1
- package/dist/types/daemon/server-auth.d.ts +11 -0
- package/dist/types/daemon/server-event-channel.d.ts +14 -0
- package/dist/types/daemon/server-refresh-route.d.ts +15 -0
- package/dist/types/daemon/server-runtime.d.ts +34 -0
- package/dist/types/daemon/server-session.d.ts +4 -16
- package/dist/types/daemon/server-sse.d.ts +1 -1
- package/dist/types/daemon/server-summarize-events.d.ts +54 -0
- package/dist/types/daemon/server-summarize-execution.d.ts +8 -18
- package/dist/types/daemon/server-summarize-request.d.ts +2 -2
- package/dist/types/daemon/server-summarize-route.d.ts +24 -0
- package/dist/types/daemon/server.d.ts +3 -8
- package/dist/types/daemon/summarize-presentation.d.ts +11 -0
- package/dist/types/daemon/url-fetch-guard.d.ts +4 -10
- package/dist/types/engine/cli-model-id.d.ts +5 -0
- package/dist/types/engine/errors.d.ts +6 -0
- package/dist/types/engine/events.d.ts +10 -0
- package/dist/types/engine/fixed-model-attempt.d.ts +3 -0
- package/dist/types/{run/summary-engine.d.ts → engine/model-executor.d.ts} +12 -64
- package/dist/types/engine/model-meta.d.ts +8 -0
- package/dist/types/engine/provider-attempt.d.ts +6 -0
- package/dist/types/{run → engine}/streaming.d.ts +1 -1
- package/dist/types/engine/summary-execution.d.ts +46 -0
- package/dist/types/{run/flows/url → engine}/summary-timestamps.d.ts +1 -1
- package/dist/types/{run → engine}/types.d.ts +5 -9
- package/dist/types/{run/flows/url/summary-prompt.d.ts → engine/web-prompt.d.ts} +8 -8
- package/dist/types/engine/web-summary.d.ts +82 -0
- package/dist/types/flags.d.ts +3 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/llm/cli-exec.d.ts +2 -1
- package/dist/types/llm/cli.d.ts +2 -1
- package/dist/types/llm/generate-text-stream.d.ts +2 -1
- package/dist/types/llm/generate-text-types.d.ts +7 -0
- package/dist/types/llm/generate-text.d.ts +3 -7
- package/dist/types/llm/openai-client-config.d.ts +13 -0
- package/dist/types/llm/provider-capabilities.d.ts +2 -2
- package/dist/types/llm/provider-profile.d.ts +37 -1
- package/dist/types/llm/providers/models.d.ts +6 -0
- package/dist/types/llm/providers/openai/chat-completions.d.ts +3 -0
- package/dist/types/llm/providers/openai/github-models.d.ts +2 -0
- package/dist/types/llm/providers/openai/request-options.d.ts +5 -0
- package/dist/types/llm/providers/openai/responses.d.ts +21 -0
- package/dist/types/llm/providers/openai/sse.d.ts +6 -0
- package/dist/types/llm/providers/openai/transport.d.ts +23 -0
- package/dist/types/llm/providers/openai/types.d.ts +26 -0
- package/dist/types/llm/providers/openai.d.ts +4 -42
- package/dist/types/refresh-free/benchmark.d.ts +68 -0
- package/dist/types/refresh-free/catalog.d.ts +25 -0
- package/dist/types/refresh-free/config.d.ts +6 -0
- package/dist/types/refresh-free/presentation.d.ts +55 -0
- package/dist/types/run/cli-input-progress.d.ts +13 -0
- package/dist/types/run/{runner-plan.d.ts → cli-summarize-command.d.ts} +2 -7
- package/dist/types/run/cli-summarize-execution.d.ts +13 -0
- package/dist/types/run/cli-summarize-output.d.ts +8 -0
- package/dist/types/run/cli-summarize-request.d.ts +30 -0
- package/dist/types/run/constants.d.ts +0 -4
- package/dist/types/run/env.d.ts +2 -13
- package/dist/types/run/flows/asset/extract.d.ts +2 -1
- package/dist/types/run/flows/asset/media.d.ts +13 -2
- package/dist/types/run/flows/asset/output.d.ts +10 -16
- package/dist/types/run/flows/asset/preprocess.d.ts +1 -1
- package/dist/types/run/flows/asset/summary-attempts.d.ts +3 -3
- package/dist/types/run/flows/asset/summary.d.ts +4 -119
- package/dist/types/run/flows/asset/types.d.ts +121 -0
- package/dist/types/run/flows/url/fetch-options.d.ts +1 -0
- package/dist/types/run/flows/url/flow.d.ts +26 -2
- package/dist/types/run/flows/url/markdown.d.ts +3 -9
- package/dist/types/run/flows/url/slides-output-state.d.ts +1 -1
- package/dist/types/run/flows/url/slides-output-stream.d.ts +1 -1
- package/dist/types/run/flows/url/slides-output.d.ts +2 -2
- package/dist/types/run/flows/url/summary-finish.d.ts +1 -8
- package/dist/types/run/flows/url/summary-json.d.ts +3 -18
- package/dist/types/run/flows/url/summary.d.ts +13 -13
- package/dist/types/run/flows/url/types.d.ts +8 -66
- package/dist/types/run/flows/url/video-only.d.ts +4 -0
- package/dist/types/run/format.d.ts +1 -8
- package/dist/types/run/help.d.ts +1 -0
- package/dist/types/run/run-settings.d.ts +5 -2
- package/dist/types/run/runner-flags.d.ts +1 -0
- package/dist/types/run/status-cli.d.ts +41 -0
- package/dist/types/run/stream-output.d.ts +3 -2
- package/dist/types/run/summary-stream.d.ts +11 -0
- package/dist/types/shared/format-count.d.ts +1 -0
- package/dist/types/shared/run-api-status.d.ts +44 -0
- package/dist/types/shared/summary-length.d.ts +9 -0
- package/dist/types/tty/format.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/docs/README.md +1 -0
- package/docs/chrome-extension.md +12 -6
- package/docs/cli.md +7 -2
- package/docs/commands/daemon.md +1 -1
- package/docs/commands/summarize.md +1 -1
- package/docs/config.md +24 -3
- package/docs/engine.md +109 -0
- package/docs/index.md +1 -1
- package/docs/llm.md +2 -2
- package/docs/quickstart.md +1 -1
- package/docs/website.md +3 -0
- package/package.json +7 -8
- package/dist/esm/daemon/flow-context.js +0 -355
- package/dist/esm/daemon/flow-context.js.map +0 -1
- package/dist/esm/daemon/summarize.js +0 -314
- package/dist/esm/daemon/summarize.js.map +0 -1
- package/dist/esm/run/cli-fallback-state.js.map +0 -1
- package/dist/esm/run/fetch-with-timeout.js.map +0 -1
- package/dist/esm/run/flows/asset/input.js +0 -312
- package/dist/esm/run/flows/asset/input.js.map +0 -1
- package/dist/esm/run/flows/url/slides-text-markdown.js +0 -550
- package/dist/esm/run/flows/url/slides-text-markdown.js.map +0 -1
- package/dist/esm/run/flows/url/slides-text-transcript.js +0 -208
- package/dist/esm/run/flows/url/slides-text-transcript.js.map +0 -1
- package/dist/esm/run/flows/url/slides-text-types.js +0 -2
- package/dist/esm/run/flows/url/slides-text-types.js.map +0 -1
- package/dist/esm/run/flows/url/slides-text.js +0 -3
- package/dist/esm/run/flows/url/slides-text.js.map +0 -1
- package/dist/esm/run/flows/url/summary-prompt.js.map +0 -1
- package/dist/esm/run/flows/url/summary-resolution.js +0 -349
- package/dist/esm/run/flows/url/summary-resolution.js.map +0 -1
- package/dist/esm/run/flows/url/summary-timestamps.js.map +0 -1
- package/dist/esm/run/model-attempts.js.map +0 -1
- package/dist/esm/run/openrouter.js.map +0 -1
- package/dist/esm/run/run-config.js.map +0 -1
- package/dist/esm/run/run-context.js +0 -19
- package/dist/esm/run/run-context.js.map +0 -1
- package/dist/esm/run/run-env.js.map +0 -1
- package/dist/esm/run/run-models.js.map +0 -1
- package/dist/esm/run/run-output.js.map +0 -1
- package/dist/esm/run/runner-contexts.js.map +0 -1
- package/dist/esm/run/runner-execution.js +0 -164
- package/dist/esm/run/runner-execution.js.map +0 -1
- package/dist/esm/run/runner-plan.js +0 -419
- package/dist/esm/run/runner-plan.js.map +0 -1
- package/dist/esm/run/streaming.js.map +0 -1
- package/dist/esm/run/summary-engine.js +0 -536
- package/dist/esm/run/summary-engine.js.map +0 -1
- package/dist/esm/run/summary-llm.js.map +0 -1
- package/dist/esm/shared/cache-store.js +0 -68
- package/dist/esm/shared/cache-store.js.map +0 -1
- package/dist/esm/shared/contracts.js +0 -2
- package/dist/esm/shared/contracts.js.map +0 -1
- package/dist/esm/shared/dns-pinned-fetch.js +0 -93
- package/dist/esm/shared/dns-pinned-fetch.js.map +0 -1
- package/dist/esm/shared/fetch-capabilities.js +0 -37
- package/dist/esm/shared/fetch-capabilities.js.map +0 -1
- package/dist/esm/shared/slides-presentation.js +0 -226
- package/dist/esm/shared/slides-presentation.js.map +0 -1
- package/dist/esm/shared/slides-text.js +0 -2
- package/dist/esm/shared/slides-text.js.map +0 -1
- package/dist/esm/shared/sse-events.js +0 -26
- package/dist/esm/shared/sse-events.js.map +0 -1
- package/dist/esm/shared/streaming-merge.js +0 -44
- package/dist/esm/shared/streaming-merge.js.map +0 -1
- package/dist/types/daemon/flow-context.d.ts +0 -50
- package/dist/types/daemon/summarize.d.ts +0 -104
- package/dist/types/run/flows/asset/input.d.ts +0 -34
- package/dist/types/run/flows/url/slides-text-markdown.d.ts +0 -47
- package/dist/types/run/flows/url/slides-text-transcript.d.ts +0 -36
- package/dist/types/run/flows/url/slides-text-types.d.ts +0 -8
- package/dist/types/run/flows/url/slides-text.d.ts +0 -3
- package/dist/types/run/flows/url/summary-resolution.d.ts +0 -31
- package/dist/types/run/run-context.d.ts +0 -57
- package/dist/types/run/runner-contexts.d.ts +0 -39
- package/dist/types/run/runner-execution.d.ts +0 -59
- package/dist/types/shared/cache-store.d.ts +0 -34
- package/dist/types/shared/contracts.d.ts +0 -2
- package/dist/types/shared/dns-pinned-fetch.d.ts +0 -1
- package/dist/types/shared/fetch-capabilities.d.ts +0 -10
- package/dist/types/shared/slides-presentation.d.ts +0 -45
- package/dist/types/shared/slides-text.d.ts +0 -1
- package/dist/types/shared/sse-events.d.ts +0 -66
- package/dist/types/shared/streaming-merge.d.ts +0 -4
- /package/dist/esm/{run → application}/cli-fallback-state.js +0 -0
- /package/dist/esm/{run → engine}/fetch-with-timeout.js +0 -0
- /package/dist/esm/{run → engine}/openrouter.js +0 -0
- /package/dist/esm/{run/flows/url → engine}/summary-timestamps.js +0 -0
- /package/dist/esm/{run → engine}/types.js +0 -0
- /package/dist/types/{run → application}/cli-fallback-state.d.ts +0 -0
- /package/dist/types/{run/run-env.d.ts → application/environment-state.d.ts} +0 -0
- /package/dist/types/{run/run-metrics.d.ts → application/metrics.d.ts} +0 -0
- /package/dist/types/{run/run-models.d.ts → application/model-selection.d.ts} +0 -0
- /package/dist/types/{run/run-output.d.ts → application/output-policy.d.ts} +0 -0
- /package/dist/types/{run/stdin-temp-file.d.ts → application/stdin-input.d.ts} +0 -0
- /package/dist/types/{run → engine}/fetch-with-timeout.d.ts +0 -0
- /package/dist/types/{run → engine}/model-attempts.d.ts +0 -0
- /package/dist/types/{run/summary-llm.d.ts → engine/model-call.d.ts} +0 -0
- /package/dist/types/{run → engine}/openrouter.d.ts +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { ExtractedLinkContent } from "
|
|
2
|
-
import type {
|
|
3
|
-
type
|
|
1
|
+
import type { ExtractedLinkContent } from "../content/index.js";
|
|
2
|
+
import type { OutputLanguage } from "../language.js";
|
|
3
|
+
import { type SummaryLengthArg } from "../shared/summary-length.js";
|
|
4
|
+
type SlidesResult = Awaited<ReturnType<typeof import("../slides/index.js").extractSlidesForSource>>;
|
|
4
5
|
export declare function shouldBypassShortContentSummary({ extracted, lengthArg, forceSummary, maxOutputTokensArg, json, countTokens, }: {
|
|
5
6
|
extracted: ExtractedLinkContent;
|
|
6
|
-
lengthArg:
|
|
7
|
+
lengthArg: SummaryLengthArg;
|
|
7
8
|
forceSummary: boolean;
|
|
8
9
|
maxOutputTokensArg: number | null;
|
|
9
10
|
json: boolean;
|
|
10
11
|
countTokens: (value: string) => number;
|
|
11
12
|
}): boolean;
|
|
12
|
-
export declare function buildUrlPrompt({ extracted, outputLanguage, lengthArg, promptOverride, lengthInstruction, languageInstruction, slides,
|
|
13
|
+
export declare function buildUrlPrompt({ extracted, outputLanguage, lengthArg, promptOverride, lengthInstruction, languageInstruction, slides, }: {
|
|
13
14
|
extracted: ExtractedLinkContent;
|
|
14
|
-
outputLanguage:
|
|
15
|
-
lengthArg:
|
|
15
|
+
outputLanguage: OutputLanguage;
|
|
16
|
+
lengthArg: SummaryLengthArg;
|
|
16
17
|
promptOverride?: string | null;
|
|
17
18
|
lengthInstruction?: string | null;
|
|
18
19
|
languageInstruction?: string | null;
|
|
19
20
|
slides?: SlidesResult | null;
|
|
20
|
-
buildSummaryTimestampLimitInstruction: (extracted: ExtractedLinkContent) => string | null;
|
|
21
21
|
}): string;
|
|
22
22
|
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type CacheState } from "../cache.js";
|
|
2
|
+
import type { CliProvider, SummarizeConfig } from "../config.js";
|
|
3
|
+
import type { ExtractedLinkContent } from "../content/index.js";
|
|
4
|
+
import type { StreamMode } from "../flags.js";
|
|
5
|
+
import type { OutputLanguage } from "../language.js";
|
|
6
|
+
import type { FixedModelSpec } from "../model-spec.js";
|
|
7
|
+
import type { RunApiStatus } from "../shared/run-api-status.js";
|
|
8
|
+
import type { SummaryLengthArg } from "../shared/summary-length.js";
|
|
9
|
+
import type { SummaryStreamHandler } from "./events.js";
|
|
10
|
+
import type { createModelExecutor } from "./model-executor.js";
|
|
11
|
+
import { buildModelMetaFromAttempt } from "./model-meta.js";
|
|
12
|
+
import type { ModelAttempt } from "./types.js";
|
|
13
|
+
type SlidesResult = Awaited<ReturnType<typeof import("../slides/index.js").extractSlidesForSource>>;
|
|
14
|
+
export type WebSummaryContext = {
|
|
15
|
+
io: {
|
|
16
|
+
envForRun: Record<string, string | undefined>;
|
|
17
|
+
fetch: typeof fetch;
|
|
18
|
+
};
|
|
19
|
+
flags: {
|
|
20
|
+
timeoutMs: number;
|
|
21
|
+
lengthArg: SummaryLengthArg;
|
|
22
|
+
outputLanguage: OutputLanguage;
|
|
23
|
+
summaryCacheBypass: boolean;
|
|
24
|
+
forceSummary: boolean;
|
|
25
|
+
maxOutputTokensArg: number | null;
|
|
26
|
+
json: boolean;
|
|
27
|
+
slides: unknown;
|
|
28
|
+
streamMode: StreamMode;
|
|
29
|
+
streamingEnabled: boolean;
|
|
30
|
+
};
|
|
31
|
+
model: {
|
|
32
|
+
requestedModelInput: string;
|
|
33
|
+
fixedModelSpec: FixedModelSpec | null;
|
|
34
|
+
isFallbackModel: boolean;
|
|
35
|
+
isImplicitAutoSelection: boolean;
|
|
36
|
+
allowAutoCliFallback: boolean;
|
|
37
|
+
isNamedModelSelection: boolean;
|
|
38
|
+
wantsFreeNamedModel: boolean;
|
|
39
|
+
desiredOutputTokens: number | null;
|
|
40
|
+
configForModelSelection: SummarizeConfig | null;
|
|
41
|
+
envForAuto: Record<string, string | undefined>;
|
|
42
|
+
cliAvailability: Partial<Record<CliProvider, boolean>>;
|
|
43
|
+
apiStatus: Pick<RunApiStatus, "zaiApiKey" | "zaiBaseUrl" | "nvidiaApiKey" | "nvidiaBaseUrl" | "minimaxApiKey" | "minimaxBaseUrl" | "ollamaBaseUrl">;
|
|
44
|
+
summaryEngine: ReturnType<typeof createModelExecutor>;
|
|
45
|
+
summaryStream: SummaryStreamHandler | null;
|
|
46
|
+
getLiteLlmCatalog: () => Promise<Awaited<ReturnType<typeof import("../pricing/litellm.js").loadLiteLlmCatalog>>["catalog"]>;
|
|
47
|
+
};
|
|
48
|
+
cache: CacheState;
|
|
49
|
+
};
|
|
50
|
+
export type WebSummaryRuntime = {
|
|
51
|
+
log?: ((message: string) => void) | null;
|
|
52
|
+
trace?: ((name: string, detail?: string | null) => void) | null;
|
|
53
|
+
onSummaryCached?: ((cached: boolean) => void) | null;
|
|
54
|
+
readLastSuccessfulCliProvider?: (() => Promise<CliProvider | null>) | null;
|
|
55
|
+
rememberCliProvider?: ((provider: CliProvider) => Promise<void>) | null;
|
|
56
|
+
};
|
|
57
|
+
type SummaryResolutionUseExtracted = {
|
|
58
|
+
kind: "use-extracted";
|
|
59
|
+
footerLabel: string;
|
|
60
|
+
verboseMessage: string | null;
|
|
61
|
+
};
|
|
62
|
+
type SummaryResolutionSummary = {
|
|
63
|
+
kind: "summary";
|
|
64
|
+
normalizedSummary: string;
|
|
65
|
+
summaryEmitted: boolean;
|
|
66
|
+
summaryFromCache: boolean;
|
|
67
|
+
usedAttempt: ModelAttempt;
|
|
68
|
+
modelMeta: ReturnType<typeof buildModelMetaFromAttempt>;
|
|
69
|
+
maxOutputTokensForCall: number | null;
|
|
70
|
+
};
|
|
71
|
+
export type UrlSummaryResolution = SummaryResolutionUseExtracted | SummaryResolutionSummary;
|
|
72
|
+
export declare function resolveUrlSummaryExecution({ ctx, url, extracted, prompt, onModelChosen, slides, streamHandler, runtime, }: {
|
|
73
|
+
ctx: WebSummaryContext;
|
|
74
|
+
url: string;
|
|
75
|
+
extracted: ExtractedLinkContent;
|
|
76
|
+
prompt: string;
|
|
77
|
+
onModelChosen?: ((modelId: string) => void) | null;
|
|
78
|
+
slides?: SlidesResult | null;
|
|
79
|
+
streamHandler?: SummaryStreamHandler | null;
|
|
80
|
+
runtime?: WebSummaryRuntime;
|
|
81
|
+
}): Promise<UrlSummaryResolution>;
|
|
82
|
+
export {};
|
package/dist/types/flags.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SummaryLength } from "
|
|
1
|
+
import type { SummaryLength } from "@steipete/summarize-core";
|
|
2
2
|
export type YoutubeMode = "auto" | "web" | "apify" | "yt-dlp" | "no-auto";
|
|
3
3
|
export type FirecrawlMode = "off" | "auto" | "always";
|
|
4
4
|
export type MarkdownMode = "off" | "auto" | "llm" | "readability";
|
|
@@ -7,6 +7,7 @@ export type PreprocessMode = "off" | "auto" | "always";
|
|
|
7
7
|
export type StreamMode = "auto" | "on" | "off";
|
|
8
8
|
export type MetricsMode = "off" | "on" | "detailed";
|
|
9
9
|
export type VideoMode = "auto" | "transcript" | "understand";
|
|
10
|
+
export type EmbeddedVideoMode = "auto" | "off" | "prefer" | "both";
|
|
10
11
|
export type DiarizationMode = "auto" | "elevenlabs" | "openai";
|
|
11
12
|
export type LengthArg = {
|
|
12
13
|
kind: "preset";
|
|
@@ -23,6 +24,7 @@ export declare function parsePreprocessMode(raw: string): PreprocessMode;
|
|
|
23
24
|
export declare function parseStreamMode(raw: string): StreamMode;
|
|
24
25
|
export declare function parseMetricsMode(raw: string): MetricsMode;
|
|
25
26
|
export declare function parseVideoMode(raw: string): VideoMode;
|
|
27
|
+
export declare function parseEmbeddedVideoMode(raw: string): EmbeddedVideoMode;
|
|
26
28
|
export declare function parseDiarizationMode(raw: string): DiarizationMode;
|
|
27
29
|
export declare function parseDurationMs(raw: string): number;
|
|
28
30
|
export declare function parseLengthArg(raw: string): LengthArg;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from "./content/index.js";
|
|
2
2
|
export * from "./prompts/index.js";
|
|
3
|
-
export type { SummaryLength } from "
|
|
4
|
-
export { SUMMARY_LENGTHS } from "
|
|
3
|
+
export type { SummaryLength } from "@steipete/summarize-core";
|
|
4
|
+
export { SUMMARY_LENGTHS } from "@steipete/summarize-core";
|
|
@@ -5,7 +5,7 @@ export declare class CliInterruptedError extends Error {
|
|
|
5
5
|
readonly signal: NodeJS.Signals;
|
|
6
6
|
constructor(signal: NodeJS.Signals);
|
|
7
7
|
}
|
|
8
|
-
export declare function execCliWithInput({ execFileImpl, cmd, args, input, timeoutMs, env, cwd, }: {
|
|
8
|
+
export declare function execCliWithInput({ execFileImpl, cmd, args, input, timeoutMs, env, cwd, signal, }: {
|
|
9
9
|
execFileImpl: ExecFileFn;
|
|
10
10
|
cmd: string;
|
|
11
11
|
args: string[];
|
|
@@ -13,6 +13,7 @@ export declare function execCliWithInput({ execFileImpl, cmd, args, input, timeo
|
|
|
13
13
|
timeoutMs: number;
|
|
14
14
|
env: Record<string, string | undefined>;
|
|
15
15
|
cwd?: string;
|
|
16
|
+
signal?: AbortSignal;
|
|
16
17
|
}): Promise<{
|
|
17
18
|
stdout: string;
|
|
18
19
|
stderr: string;
|
package/dist/types/llm/cli.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ type RunCliModelOptions = {
|
|
|
13
13
|
cwd?: string;
|
|
14
14
|
extraArgs?: string[];
|
|
15
15
|
systemPrompt?: string | null;
|
|
16
|
+
signal?: AbortSignal;
|
|
16
17
|
};
|
|
17
18
|
type CliRunResult = {
|
|
18
19
|
text: string;
|
|
@@ -21,5 +22,5 @@ type CliRunResult = {
|
|
|
21
22
|
};
|
|
22
23
|
export declare function isCliDisabled(provider: CliProvider, config: CliConfig | null | undefined): boolean;
|
|
23
24
|
export declare function resolveCliBinary(provider: CliProvider, config: CliConfig | null | undefined, env: Record<string, string | undefined>): string;
|
|
24
|
-
export declare function runCliModel({ provider, prompt, model, allowTools, timeoutMs, env, execFileImpl, config, cwd, extraArgs, systemPrompt, }: RunCliModelOptions): Promise<CliRunResult>;
|
|
25
|
+
export declare function runCliModel({ provider, prompt, model, allowTools, timeoutMs, env, execFileImpl, config, cwd, extraArgs, systemPrompt, signal, }: RunCliModelOptions): Promise<CliRunResult>;
|
|
25
26
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from "@earendil-works/pi-ai";
|
|
2
|
-
import type { LlmApiKeys } from "./generate-text.js";
|
|
2
|
+
import type { LlmApiKeys } from "./generate-text-types.js";
|
|
3
3
|
import type { LlmProvider } from "./model-id.js";
|
|
4
4
|
import type { ModelRequestOptions } from "./model-options.js";
|
|
5
5
|
import type { LlmTokenUsage } from "./types.js";
|
|
@@ -25,6 +25,7 @@ export type StreamTextResult = {
|
|
|
25
25
|
canonicalModelId: string;
|
|
26
26
|
provider: LlmProvider;
|
|
27
27
|
usage: Promise<LlmTokenUsage | null>;
|
|
28
|
+
finalText: Promise<string | null>;
|
|
28
29
|
lastError: () => unknown;
|
|
29
30
|
};
|
|
30
31
|
export declare function streamTextWithContext({ modelId, apiKeys, context, temperature, maxOutputTokens, timeoutMs, fetchImpl, forceOpenRouter, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, ollamaBaseUrlOverride, forceChatCompletions, requestOptions, }: StreamTextWithContextArgs): Promise<StreamTextResult>;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
+
import type { LlmApiKeys } from "./generate-text-types.js";
|
|
1
2
|
import type { LlmProvider } from "./model-id.js";
|
|
2
3
|
import type { ModelRequestOptions } from "./model-options.js";
|
|
3
4
|
import type { Prompt } from "./prompt.js";
|
|
4
5
|
import type { LlmTokenUsage } from "./types.js";
|
|
5
6
|
export { streamTextWithContext } from "./generate-text-stream.js";
|
|
6
|
-
export type LlmApiKeys
|
|
7
|
-
xaiApiKey: string | null;
|
|
8
|
-
openaiApiKey: string | null;
|
|
9
|
-
googleApiKey: string | null;
|
|
10
|
-
anthropicApiKey: string | null;
|
|
11
|
-
openrouterApiKey: string | null;
|
|
12
|
-
};
|
|
7
|
+
export type { LlmApiKeys } from "./generate-text-types.js";
|
|
13
8
|
export type OpenRouterOptions = {
|
|
14
9
|
providers: string[] | null;
|
|
15
10
|
};
|
|
@@ -66,5 +61,6 @@ export declare function streamTextWithModelId({ modelId, apiKeys, prompt, temper
|
|
|
66
61
|
canonicalModelId: string;
|
|
67
62
|
provider: LlmProvider;
|
|
68
63
|
usage: Promise<LlmTokenUsage | null>;
|
|
64
|
+
finalText: Promise<string | null>;
|
|
69
65
|
lastError: () => unknown;
|
|
70
66
|
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModelRequestOptions } from "./model-options.js";
|
|
2
|
+
import type { OpenAiClientConfig } from "./providers/types.js";
|
|
3
|
+
export type OpenAiClientConfigInput = {
|
|
4
|
+
apiKeys: {
|
|
5
|
+
openaiApiKey: string | null;
|
|
6
|
+
openrouterApiKey: string | null;
|
|
7
|
+
};
|
|
8
|
+
forceOpenRouter?: boolean;
|
|
9
|
+
openaiBaseUrlOverride?: string | null;
|
|
10
|
+
forceChatCompletions?: boolean;
|
|
11
|
+
requestOptions?: ModelRequestOptions;
|
|
12
|
+
};
|
|
13
|
+
export declare function resolveOpenAiClientConfig({ apiKeys, forceOpenRouter, openaiBaseUrlOverride, forceChatCompletions, requestOptions, }: OpenAiClientConfigInput): OpenAiClientConfig;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DEFAULT_AUTO_CLI_ORDER, DEFAULT_CLI_MODELS, envHasRequiredKey, getGatewayProviderProfile, isVideoUnderstandingCapableModelId, isVideoUnderstandingCapableProvider, parseCliProviderName, requiredEnvForCliProvider, requiredEnvForGatewayProvider, resolveOpenAiCompatibleClientConfigForProvider, resolveRequiredEnvForModelId, supportsDocumentAttachments, supportsStreaming, } from "./provider-profile.js";
|
|
2
|
-
export type { GatewayProvider, RequiredModelEnv } from "./provider-profile.js";
|
|
1
|
+
export { DEFAULT_AUTO_CLI_ORDER, DEFAULT_CLI_MODELS, cliProviderForRequiredEnv, envHasRequiredKey, formatMissingCliModelError, gatewayProviderForRequiredEnv, getCliProviderProfile, getGatewayProviderProfile, isGatewayProvider, isVideoUnderstandingCapableModelId, isVideoUnderstandingCapableProvider, isOpenAiCompatibleProvider, parseCliProviderName, requiredEnvForCliProvider, requiredEnvForGatewayProvider, resolveOpenAiCompatibleClientConfigForProvider, resolveProviderOpenAiOverrides, resolveRequiredEnvForModelId, supportsDocumentAttachments, supportsStreaming, } from "./provider-profile.js";
|
|
2
|
+
export type { GatewayProvider, GatewayProviderProfile, CliProviderProfile, ProviderOpenAiOverrides, ProviderExecution, ProviderRuntimeBindings, RequiredModelEnv, } from "./provider-profile.js";
|
|
@@ -3,22 +3,58 @@ import type { ModelRequestOptions } from "./model-options.js";
|
|
|
3
3
|
import type { OpenAiClientConfig } from "./providers/types.js";
|
|
4
4
|
export type GatewayProvider = "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "minimax" | "github-copilot" | "ollama";
|
|
5
5
|
export type RequiredModelEnv = "XAI_API_KEY" | "OPENAI_API_KEY" | "NVIDIA_API_KEY" | "GEMINI_API_KEY" | "ANTHROPIC_API_KEY" | "OPENROUTER_API_KEY" | "Z_AI_API_KEY" | "MINIMAX_API_KEY" | "GITHUB_TOKEN" | "OLLAMA_BASE_URL" | "CLI_CLAUDE" | "CLI_CODEX" | "CLI_GEMINI" | "CLI_AGENT" | "CLI_OPENCLAW" | "CLI_OPENCODE" | "CLI_COPILOT" | "CLI_AGY" | "CLI_PI";
|
|
6
|
-
type
|
|
6
|
+
export type ProviderExecution = "simple" | "google" | "anthropic" | "openai-http" | "openai-compatible";
|
|
7
|
+
export type GatewayProviderProfile = {
|
|
7
8
|
requiredEnv: RequiredModelEnv;
|
|
9
|
+
execution: ProviderExecution;
|
|
8
10
|
supportsDocuments: boolean;
|
|
9
11
|
supportsStreaming: boolean;
|
|
10
12
|
supportsVideoUnderstanding: boolean;
|
|
13
|
+
defaultBaseUrl?: string;
|
|
14
|
+
forceChatCompletions?: boolean;
|
|
11
15
|
};
|
|
12
16
|
export declare const DEFAULT_OLLAMA_BASE_URL = "http://localhost:11434/v1";
|
|
13
17
|
export declare const DEFAULT_MINIMAX_BASE_URL = "https://api.minimax.io/v1";
|
|
18
|
+
export type ProviderRuntimeBindings = {
|
|
19
|
+
apiKeys: Partial<Record<GatewayProvider, string | null>>;
|
|
20
|
+
baseUrls: Partial<Record<GatewayProvider, string | null>>;
|
|
21
|
+
openaiUseChatCompletions?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type ProviderOpenAiOverrides = {
|
|
24
|
+
openaiApiKeyOverride?: string | null;
|
|
25
|
+
openaiBaseUrlOverride?: string | null;
|
|
26
|
+
forceChatCompletions?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare function resolveProviderOpenAiOverrides({ provider, runtime, baseUrlOverride, }: {
|
|
29
|
+
provider: GatewayProvider;
|
|
30
|
+
runtime: ProviderRuntimeBindings;
|
|
31
|
+
baseUrlOverride?: string | null;
|
|
32
|
+
}): ProviderOpenAiOverrides;
|
|
33
|
+
type CliRequiredModelEnv = Extract<RequiredModelEnv, `CLI_${string}`>;
|
|
34
|
+
export type CliProviderProfile = {
|
|
35
|
+
requiredEnv: CliRequiredModelEnv;
|
|
36
|
+
defaultModel: string | null;
|
|
37
|
+
missingBinaryLabel: string;
|
|
38
|
+
installLabel: string;
|
|
39
|
+
pathEnv: string;
|
|
40
|
+
};
|
|
14
41
|
export declare const DEFAULT_CLI_MODELS: Record<CliProvider, string | null>;
|
|
15
42
|
export declare const DEFAULT_AUTO_CLI_ORDER: CliProvider[];
|
|
16
43
|
export declare function parseCliProviderName(raw: string): CliProvider | null;
|
|
44
|
+
export declare function getCliProviderProfile(provider: CliProvider): CliProviderProfile;
|
|
17
45
|
export declare function requiredEnvForCliProvider(provider: CliProvider): RequiredModelEnv;
|
|
46
|
+
export declare function cliProviderForRequiredEnv(requiredEnv: RequiredModelEnv): CliProvider | null;
|
|
47
|
+
export declare function formatMissingCliModelError({ requiredEnv, userModelId, }: {
|
|
48
|
+
requiredEnv: RequiredModelEnv;
|
|
49
|
+
userModelId: string;
|
|
50
|
+
}): string | null;
|
|
51
|
+
export declare function isGatewayProvider(provider: string): provider is GatewayProvider;
|
|
18
52
|
export declare function getGatewayProviderProfile(provider: GatewayProvider): GatewayProviderProfile;
|
|
19
53
|
export declare function requiredEnvForGatewayProvider(provider: GatewayProvider): RequiredModelEnv;
|
|
54
|
+
export declare function gatewayProviderForRequiredEnv(requiredEnv: RequiredModelEnv): GatewayProvider | null;
|
|
20
55
|
export declare function supportsDocumentAttachments(provider: GatewayProvider): boolean;
|
|
21
56
|
export declare function supportsStreaming(provider: GatewayProvider): boolean;
|
|
57
|
+
export declare function isOpenAiCompatibleProvider(provider: GatewayProvider): provider is "zai" | "nvidia" | "minimax" | "ollama";
|
|
22
58
|
export declare function isVideoUnderstandingCapableProvider(provider: GatewayProvider): boolean;
|
|
23
59
|
export declare function envHasRequiredKey(env: Record<string, string | undefined>, requiredEnv: RequiredModelEnv): boolean;
|
|
24
60
|
export declare function resolveRequiredEnvForModelId(modelId: string): RequiredModelEnv;
|
|
@@ -25,6 +25,12 @@ export declare function resolveOllamaModel({ modelId, context, ollamaBaseUrlOver
|
|
|
25
25
|
context: Context;
|
|
26
26
|
ollamaBaseUrlOverride?: string | null;
|
|
27
27
|
}): Model<Api>;
|
|
28
|
+
export declare function resolveOpenAiCompatibleGatewayModel({ provider, modelId, context, openaiConfig, }: {
|
|
29
|
+
provider: "zai" | "nvidia" | "minimax" | "ollama";
|
|
30
|
+
modelId: string;
|
|
31
|
+
context: Context;
|
|
32
|
+
openaiConfig: OpenAiClientConfig;
|
|
33
|
+
}): Model<Api>;
|
|
28
34
|
export declare function resolveXaiModel({ modelId, context, xaiBaseUrlOverride, }: {
|
|
29
35
|
modelId: string;
|
|
30
36
|
context: Context;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { OpenAiTextCompletionResult, OpenAiTextRequest, OpenAiTextStreamResult } from "./types.js";
|
|
2
|
+
export declare function completeOpenAiChatText({ modelId, openaiConfig, context, temperature, maxOutputTokens, signal, fetchImpl, }: OpenAiTextRequest): Promise<OpenAiTextCompletionResult>;
|
|
3
|
+
export declare function streamOpenAiChatText({ modelId, openaiConfig, context, temperature, maxOutputTokens, signal, fetchImpl, }: OpenAiTextRequest): Promise<OpenAiTextStreamResult>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ModelRequestOptions } from "../../model-options.js";
|
|
2
|
+
import type { OpenAiStructuredOutput } from "./types.js";
|
|
3
|
+
export declare function isOpenAiResponsesTextModelId(modelId: string): boolean;
|
|
4
|
+
export declare function buildOpenAiResponsesRequestOptions(requestOptions: ModelRequestOptions | undefined, structuredOutput?: OpenAiStructuredOutput): Record<string, unknown>;
|
|
5
|
+
export declare function buildOpenAiChatRequestOptions(requestOptions: ModelRequestOptions | undefined): Record<string, unknown>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Attachment } from "../../attachments.js";
|
|
2
|
+
import type { LlmTokenUsage } from "../../types.js";
|
|
3
|
+
import type { OpenAiClientConfig } from "../types.js";
|
|
4
|
+
import type { OpenAiStructuredOutput, OpenAiTextCompletionResult, OpenAiTextRequest, OpenAiTextStreamResult } from "./types.js";
|
|
5
|
+
export declare function completeOpenAiResponsesText({ modelId, openaiConfig, context, temperature, maxOutputTokens, signal, fetchImpl, structuredOutput, }: OpenAiTextRequest & {
|
|
6
|
+
structuredOutput?: OpenAiStructuredOutput;
|
|
7
|
+
}): Promise<OpenAiTextCompletionResult>;
|
|
8
|
+
export declare function streamOpenAiResponsesText({ modelId, openaiConfig, context, temperature, maxOutputTokens, signal, fetchImpl, }: OpenAiTextRequest): Promise<OpenAiTextStreamResult>;
|
|
9
|
+
export declare function completeOpenAiDocument({ modelId, openaiConfig, promptText, document, maxOutputTokens, temperature, timeoutMs, fetchImpl, }: {
|
|
10
|
+
modelId: string;
|
|
11
|
+
openaiConfig: OpenAiClientConfig;
|
|
12
|
+
promptText: string;
|
|
13
|
+
document: Attachment;
|
|
14
|
+
maxOutputTokens?: number;
|
|
15
|
+
temperature?: number;
|
|
16
|
+
timeoutMs: number;
|
|
17
|
+
fetchImpl: typeof fetch;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
text: string;
|
|
20
|
+
usage: LlmTokenUsage | null;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LlmTokenUsage } from "../../types.js";
|
|
2
|
+
export declare function parseOpenAiSseJsonStream(body: ReadableStream<Uint8Array>): AsyncGenerator<Record<string, unknown>>;
|
|
3
|
+
export declare function createDeferredUsage(): {
|
|
4
|
+
promise: Promise<LlmTokenUsage | null>;
|
|
5
|
+
resolve: (value: LlmTokenUsage | null) => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Context } from "@earendil-works/pi-ai";
|
|
2
|
+
import type { OpenAiClientConfig } from "../types.js";
|
|
3
|
+
export declare function isGitHubModelsBaseUrl(baseUrl: string | undefined): boolean;
|
|
4
|
+
export declare function isApiOpenAiBaseUrl(baseUrl: string | undefined): boolean;
|
|
5
|
+
export declare function resolveOpenAiResponsesUrl(baseUrl: string): URL;
|
|
6
|
+
export declare function resolveOpenAiChatCompletionsUrl(baseUrl: string): URL;
|
|
7
|
+
export declare function contextToChatCompletionMessages(context: Context): Array<{
|
|
8
|
+
role: string;
|
|
9
|
+
content: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function contextToResponsesInput(context: Context): Array<{
|
|
12
|
+
role: string;
|
|
13
|
+
content: Array<{
|
|
14
|
+
type: "input_text";
|
|
15
|
+
text: string;
|
|
16
|
+
}>;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function buildOpenAiRequestHeaders(openaiConfig: OpenAiClientConfig): Record<string, string>;
|
|
19
|
+
export declare function createOpenAiHttpError({ baseUrl, status, bodyText, }: {
|
|
20
|
+
baseUrl: string;
|
|
21
|
+
status: number;
|
|
22
|
+
bodyText: string;
|
|
23
|
+
}): Error;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Context } from "@earendil-works/pi-ai";
|
|
2
|
+
import type { LlmTokenUsage } from "../../types.js";
|
|
3
|
+
import type { OpenAiClientConfig } from "../types.js";
|
|
4
|
+
export type OpenAiTextRequest = {
|
|
5
|
+
modelId: string;
|
|
6
|
+
openaiConfig: OpenAiClientConfig;
|
|
7
|
+
context: Context;
|
|
8
|
+
temperature?: number;
|
|
9
|
+
maxOutputTokens?: number;
|
|
10
|
+
signal: AbortSignal;
|
|
11
|
+
fetchImpl: typeof fetch;
|
|
12
|
+
};
|
|
13
|
+
export type OpenAiTextCompletionResult = {
|
|
14
|
+
text: string;
|
|
15
|
+
usage: LlmTokenUsage | null;
|
|
16
|
+
resolvedModelId?: string;
|
|
17
|
+
};
|
|
18
|
+
export type OpenAiTextStreamResult = {
|
|
19
|
+
textStream: AsyncIterable<string>;
|
|
20
|
+
usage: Promise<LlmTokenUsage | null>;
|
|
21
|
+
resolvedModelId?: string;
|
|
22
|
+
};
|
|
23
|
+
export type OpenAiStructuredOutput = {
|
|
24
|
+
name: string;
|
|
25
|
+
schema: Record<string, unknown>;
|
|
26
|
+
};
|
|
@@ -1,33 +1,9 @@
|
|
|
1
1
|
import type { Context } from "@earendil-works/pi-ai";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import type { LlmTokenUsage } from "../types.js";
|
|
2
|
+
export { resolveOpenAiClientConfig, type OpenAiClientConfigInput, } from "../openai-client-config.js";
|
|
3
|
+
import type { OpenAiStructuredOutput, OpenAiTextCompletionResult, OpenAiTextStreamResult } from "./openai/types.js";
|
|
5
4
|
import type { OpenAiClientConfig } from "./types.js";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
openaiApiKey: string | null;
|
|
9
|
-
openrouterApiKey: string | null;
|
|
10
|
-
};
|
|
11
|
-
forceOpenRouter?: boolean;
|
|
12
|
-
openaiBaseUrlOverride?: string | null;
|
|
13
|
-
forceChatCompletions?: boolean;
|
|
14
|
-
requestOptions?: ModelRequestOptions;
|
|
15
|
-
};
|
|
16
|
-
type OpenAiTextCompletionResult = {
|
|
17
|
-
text: string;
|
|
18
|
-
usage: LlmTokenUsage | null;
|
|
19
|
-
resolvedModelId?: string;
|
|
20
|
-
};
|
|
21
|
-
type OpenAiTextStreamResult = {
|
|
22
|
-
textStream: AsyncIterable<string>;
|
|
23
|
-
usage: Promise<LlmTokenUsage | null>;
|
|
24
|
-
resolvedModelId?: string;
|
|
25
|
-
};
|
|
26
|
-
export type OpenAiStructuredOutput = {
|
|
27
|
-
name: string;
|
|
28
|
-
schema: Record<string, unknown>;
|
|
29
|
-
};
|
|
30
|
-
export declare function resolveOpenAiClientConfig({ apiKeys, forceOpenRouter, openaiBaseUrlOverride, forceChatCompletions, requestOptions, }: OpenAiClientConfigInput): OpenAiClientConfig;
|
|
5
|
+
export { completeOpenAiDocument } from "./openai/responses.js";
|
|
6
|
+
export type { OpenAiStructuredOutput } from "./openai/types.js";
|
|
31
7
|
export declare function completeOpenAiText({ modelId, openaiConfig, context, temperature, maxOutputTokens, signal, fetchImpl, structuredOutput, }: {
|
|
32
8
|
modelId: string;
|
|
33
9
|
openaiConfig: OpenAiClientConfig;
|
|
@@ -47,17 +23,3 @@ export declare function streamOpenAiText({ modelId, openaiConfig, context, tempe
|
|
|
47
23
|
signal: AbortSignal;
|
|
48
24
|
fetchImpl?: typeof fetch;
|
|
49
25
|
}): Promise<OpenAiTextStreamResult | null>;
|
|
50
|
-
export declare function completeOpenAiDocument({ modelId, openaiConfig, promptText, document, maxOutputTokens, temperature, timeoutMs, fetchImpl, }: {
|
|
51
|
-
modelId: string;
|
|
52
|
-
openaiConfig: OpenAiClientConfig;
|
|
53
|
-
promptText: string;
|
|
54
|
-
document: Attachment;
|
|
55
|
-
maxOutputTokens?: number;
|
|
56
|
-
temperature?: number;
|
|
57
|
-
timeoutMs: number;
|
|
58
|
-
fetchImpl: typeof fetch;
|
|
59
|
-
}): Promise<{
|
|
60
|
-
text: string;
|
|
61
|
-
usage: LlmTokenUsage | null;
|
|
62
|
-
}>;
|
|
63
|
-
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { generateTextWithModelId } from "../llm/generate-text.js";
|
|
2
|
+
import type { OpenRouterModelEntry } from "./catalog.js";
|
|
3
|
+
export type BenchmarkFailureKind = "empty" | "rateLimitMin" | "rateLimitDay" | "noProviders" | "timeout" | "providerError" | "other";
|
|
4
|
+
export type BenchmarkFailureCounts = Record<BenchmarkFailureKind, number>;
|
|
5
|
+
export type BenchmarkedOpenRouterModel = {
|
|
6
|
+
openrouterModelId: string;
|
|
7
|
+
initialLatencyMs: number;
|
|
8
|
+
medianLatencyMs: number;
|
|
9
|
+
totalLatencyMs: number;
|
|
10
|
+
successCount: number;
|
|
11
|
+
contextLength: number | null;
|
|
12
|
+
maxCompletionTokens: number | null;
|
|
13
|
+
supportedParametersCount: number;
|
|
14
|
+
modality: string | null;
|
|
15
|
+
inferredParamB: number | null;
|
|
16
|
+
};
|
|
17
|
+
type GenerateModel = typeof generateTextWithModelId;
|
|
18
|
+
export declare function classifyBenchmarkFailure(message: string): BenchmarkFailureKind;
|
|
19
|
+
export declare function benchmarkOpenRouterModels({ models, openrouterKey, concurrency, timeoutMs, fetchImpl, cooldownMs, generate, now, sleep, onProgress, onSuccess, onFailure, onCooldown, }: {
|
|
20
|
+
models: OpenRouterModelEntry[];
|
|
21
|
+
openrouterKey: string;
|
|
22
|
+
concurrency: number;
|
|
23
|
+
timeoutMs: number;
|
|
24
|
+
fetchImpl: typeof fetch;
|
|
25
|
+
cooldownMs?: number;
|
|
26
|
+
generate?: GenerateModel;
|
|
27
|
+
now?: () => number;
|
|
28
|
+
sleep?: (ms: number) => Promise<void>;
|
|
29
|
+
onProgress?: ((state: {
|
|
30
|
+
done: number;
|
|
31
|
+
total: number;
|
|
32
|
+
okCount: number;
|
|
33
|
+
elapsedMs: number;
|
|
34
|
+
}) => void) | null;
|
|
35
|
+
onSuccess?: ((result: {
|
|
36
|
+
modelId: string;
|
|
37
|
+
latencyMs: number;
|
|
38
|
+
}) => void) | null;
|
|
39
|
+
onFailure?: ((result: {
|
|
40
|
+
modelId: string;
|
|
41
|
+
kind: BenchmarkFailureKind;
|
|
42
|
+
message: string;
|
|
43
|
+
}) => void) | null;
|
|
44
|
+
onCooldown?: ((remainingMs: number) => void) | null;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
working: BenchmarkedOpenRouterModel[];
|
|
47
|
+
testedCount: number;
|
|
48
|
+
failureCounts: BenchmarkFailureCounts;
|
|
49
|
+
}>;
|
|
50
|
+
export declare function selectBenchmarkCandidates(working: BenchmarkedOpenRouterModel[], { smart, maxCandidates, }: {
|
|
51
|
+
smart: number;
|
|
52
|
+
maxCandidates: number;
|
|
53
|
+
}): string[];
|
|
54
|
+
export declare function refineBenchmarkCandidates({ working, selectedIds, extraRuns, openrouterKey, timeoutMs, fetchImpl, generate, now, onFailure, }: {
|
|
55
|
+
working: BenchmarkedOpenRouterModel[];
|
|
56
|
+
selectedIds: string[];
|
|
57
|
+
extraRuns: number;
|
|
58
|
+
openrouterKey: string;
|
|
59
|
+
timeoutMs: number;
|
|
60
|
+
fetchImpl: typeof fetch;
|
|
61
|
+
generate?: GenerateModel;
|
|
62
|
+
now?: () => number;
|
|
63
|
+
onFailure?: ((result: {
|
|
64
|
+
modelId: string;
|
|
65
|
+
error: unknown;
|
|
66
|
+
}) => void) | null;
|
|
67
|
+
}): Promise<BenchmarkedOpenRouterModel[]>;
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type OpenRouterModelEntry = {
|
|
2
|
+
id: string;
|
|
3
|
+
contextLength: number | null;
|
|
4
|
+
maxCompletionTokens: number | null;
|
|
5
|
+
supportedParametersCount: number;
|
|
6
|
+
modality: string | null;
|
|
7
|
+
inferredParamB: number | null;
|
|
8
|
+
createdAtMs: number | null;
|
|
9
|
+
};
|
|
10
|
+
export type FilteredOpenRouterCatalog = {
|
|
11
|
+
freeModelsAll: OpenRouterModelEntry[];
|
|
12
|
+
freeModelsAgeFiltered: OpenRouterModelEntry[];
|
|
13
|
+
freeModels: OpenRouterModelEntry[];
|
|
14
|
+
ageFilteredIds: string[];
|
|
15
|
+
smallFilteredIds: string[];
|
|
16
|
+
};
|
|
17
|
+
export declare function fetchOpenRouterCatalog(fetchImpl: typeof fetch): Promise<OpenRouterModelEntry[]>;
|
|
18
|
+
export declare function inferParamBFromIdOrName(text: string): number | null;
|
|
19
|
+
export declare function parseOpenRouterCatalog(payload: unknown): OpenRouterModelEntry[];
|
|
20
|
+
export declare function filterOpenRouterFreeModels(catalog: OpenRouterModelEntry[], { maxAgeDays, minParamB, nowMs, }: {
|
|
21
|
+
maxAgeDays: number;
|
|
22
|
+
minParamB: number;
|
|
23
|
+
nowMs?: number;
|
|
24
|
+
}): FilteredOpenRouterCatalog;
|
|
25
|
+
export declare function rankOpenRouterModelsForBenchmark(models: OpenRouterModelEntry[]): OpenRouterModelEntry[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function resolveRefreshFreeConfigPath(env: Record<string, string | undefined>): string;
|
|
2
|
+
export declare function writeFreeModelConfig({ env, candidates, setDefault, }: {
|
|
3
|
+
env: Record<string, string | undefined>;
|
|
4
|
+
candidates: string[];
|
|
5
|
+
setDefault: boolean;
|
|
6
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { BenchmarkedOpenRouterModel, BenchmarkFailureCounts, BenchmarkFailureKind } from "./benchmark.js";
|
|
2
|
+
export declare function formatRefreshFreeDuration(ms: number): string;
|
|
3
|
+
export declare class RefreshFreeReporter {
|
|
4
|
+
#private;
|
|
5
|
+
constructor({ stderr, env, verbose, }: {
|
|
6
|
+
stderr: NodeJS.WritableStream;
|
|
7
|
+
env: Record<string, string | undefined>;
|
|
8
|
+
verbose: boolean;
|
|
9
|
+
});
|
|
10
|
+
fetchingCatalog(): void;
|
|
11
|
+
filteredOldModels({ count, total, maxAgeDays, ids, }: {
|
|
12
|
+
count: number;
|
|
13
|
+
total: number;
|
|
14
|
+
maxAgeDays: number;
|
|
15
|
+
ids: string[];
|
|
16
|
+
}): void;
|
|
17
|
+
filteredSmallModels({ count, total, minParamB, ids, }: {
|
|
18
|
+
count: number;
|
|
19
|
+
total: number;
|
|
20
|
+
minParamB: number;
|
|
21
|
+
ids: string[];
|
|
22
|
+
}): void;
|
|
23
|
+
benchmarkStarting({ modelCount, totalRuns, concurrency, timeoutMs, }: {
|
|
24
|
+
modelCount: number;
|
|
25
|
+
totalRuns: number;
|
|
26
|
+
concurrency: number;
|
|
27
|
+
timeoutMs: number;
|
|
28
|
+
}): void;
|
|
29
|
+
benchmarkProgress({ done, total, okCount, elapsedMs, }: {
|
|
30
|
+
done: number;
|
|
31
|
+
total: number;
|
|
32
|
+
okCount: number;
|
|
33
|
+
elapsedMs: number;
|
|
34
|
+
}): void;
|
|
35
|
+
benchmarkSuccess({ modelId, latencyMs }: {
|
|
36
|
+
modelId: string;
|
|
37
|
+
latencyMs: number;
|
|
38
|
+
}): void;
|
|
39
|
+
benchmarkFailure({ modelId, kind, message, }: {
|
|
40
|
+
modelId: string;
|
|
41
|
+
kind: BenchmarkFailureKind;
|
|
42
|
+
message: string;
|
|
43
|
+
}): void;
|
|
44
|
+
cooldown(remainingMs: number): void;
|
|
45
|
+
benchmarkFinished(): void;
|
|
46
|
+
benchmarkResults({ workingCount, testedCount, failureCounts, }: {
|
|
47
|
+
workingCount: number;
|
|
48
|
+
testedCount: number;
|
|
49
|
+
failureCounts: BenchmarkFailureCounts;
|
|
50
|
+
}): void;
|
|
51
|
+
refining(candidateCount: number, extraRuns: number): void;
|
|
52
|
+
refinementFailure(modelId: string, error: unknown): void;
|
|
53
|
+
selected(candidateCount: number): void;
|
|
54
|
+
selectedModels(selectedIds: string[], refined: BenchmarkedOpenRouterModel[]): void;
|
|
55
|
+
}
|