@steipete/summarize 0.17.3 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/README.md +21 -2
- 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 +7 -3
- 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/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-agent-route.js +39 -8
- package/dist/esm/daemon/server-agent-route.js.map +1 -1
- package/dist/esm/daemon/server-auth.js +29 -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-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 +16 -55
- package/dist/esm/daemon/server-session.js.map +1 -1
- package/dist/esm/daemon/server-sse.js +1 -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/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 +23 -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 +36 -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 +14 -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 +18 -1
- 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 +23 -3
- 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 +2 -1
- 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/cli.md +7 -2
- 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 +6 -5
- 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,17 +1,9 @@
|
|
|
1
|
+
import { type UrlSummaryPresentationResolution } from "../../../application/url-result.js";
|
|
1
2
|
import type { ExtractedLinkContent } from "../../../content/index.js";
|
|
3
|
+
import { type UrlSummaryResolution } from "../../../engine/web-summary.js";
|
|
2
4
|
import type { UrlExtractionUi } from "./extract.js";
|
|
3
5
|
import type { SlidesTerminalOutput } from "./slides-output.js";
|
|
4
6
|
import type { UrlFlowContext } from "./types.js";
|
|
5
|
-
type SlidesResult = Awaited<ReturnType<typeof import("../../../slides/index.js").extractSlidesForSource>>;
|
|
6
|
-
export declare function buildUrlPrompt({ extracted, outputLanguage, lengthArg, promptOverride, lengthInstruction, languageInstruction, slides, }: {
|
|
7
|
-
extracted: ExtractedLinkContent;
|
|
8
|
-
outputLanguage: UrlFlowContext["flags"]["outputLanguage"];
|
|
9
|
-
lengthArg: UrlFlowContext["flags"]["lengthArg"];
|
|
10
|
-
promptOverride?: string | null;
|
|
11
|
-
lengthInstruction?: string | null;
|
|
12
|
-
languageInstruction?: string | null;
|
|
13
|
-
slides?: SlidesResult | null;
|
|
14
|
-
}): string;
|
|
15
7
|
export declare function outputExtractedUrl({ ctx, url, extracted, extractionUi, prompt, effectiveMarkdownMode, transcriptionCostLabel, slides, slidesOutput, }: {
|
|
16
8
|
ctx: UrlFlowContext;
|
|
17
9
|
url: string;
|
|
@@ -23,7 +15,16 @@ export declare function outputExtractedUrl({ ctx, url, extracted, extractionUi,
|
|
|
23
15
|
slides?: Awaited<ReturnType<typeof import("../../../slides/index.js").extractSlidesForSource>> | null;
|
|
24
16
|
slidesOutput?: SlidesTerminalOutput | null;
|
|
25
17
|
}): Promise<void>;
|
|
26
|
-
export declare function
|
|
18
|
+
export declare function executeExtractedUrlSummary({ ctx, url, extracted, prompt, onModelChosen, slides, slidesOutput, }: {
|
|
19
|
+
ctx: UrlFlowContext;
|
|
20
|
+
url: string;
|
|
21
|
+
extracted: ExtractedLinkContent;
|
|
22
|
+
prompt: string;
|
|
23
|
+
onModelChosen?: ((modelId: string) => void) | null;
|
|
24
|
+
slides?: Awaited<ReturnType<typeof import("../../../slides/index.js").extractSlidesForSource>> | null;
|
|
25
|
+
slidesOutput?: SlidesTerminalOutput | null;
|
|
26
|
+
}): Promise<UrlSummaryResolution>;
|
|
27
|
+
export declare function presentExtractedUrlSummary({ ctx, url, extracted, extractionUi, prompt, effectiveMarkdownMode, transcriptionCostLabel, resolution, slides, slidesOutput, }: {
|
|
27
28
|
ctx: UrlFlowContext;
|
|
28
29
|
url: string;
|
|
29
30
|
extracted: ExtractedLinkContent;
|
|
@@ -31,8 +32,7 @@ export declare function summarizeExtractedUrl({ ctx, url, extracted, extractionU
|
|
|
31
32
|
prompt: string;
|
|
32
33
|
effectiveMarkdownMode: "off" | "auto" | "llm" | "readability";
|
|
33
34
|
transcriptionCostLabel: string | null;
|
|
34
|
-
|
|
35
|
+
resolution: UrlSummaryPresentationResolution | UrlSummaryResolution;
|
|
35
36
|
slides?: Awaited<ReturnType<typeof import("../../../slides/index.js").extractSlidesForSource>> | null;
|
|
36
37
|
slidesOutput?: SlidesTerminalOutput | null;
|
|
37
38
|
}): Promise<void>;
|
|
38
|
-
export {};
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
+
import type { SummaryLength } from "@steipete/summarize-core";
|
|
2
|
+
import type { ExecutableRunModel } from "../../../application/model-runtime.js";
|
|
1
3
|
import type { CacheState } from "../../../cache.js";
|
|
2
|
-
import type { CliProvider, SummarizeConfig } from "../../../config.js";
|
|
3
4
|
import type { ExtractedLinkContent, LinkPreviewProgressEvent, MediaCache } from "../../../content/index.js";
|
|
4
|
-
import type {
|
|
5
|
+
import type { RunMetricsReport } from "../../../costs.js";
|
|
5
6
|
import type { StreamMode } from "../../../flags.js";
|
|
6
7
|
import type { OutputLanguage } from "../../../language.js";
|
|
7
|
-
import type { ModelRequestOptions, OpenAiReasoningEffort } from "../../../llm/model-options.js";
|
|
8
8
|
import type { ExecFileFn } from "../../../markitdown.js";
|
|
9
|
-
import type { FixedModelSpec, RequestedModel } from "../../../model-spec.js";
|
|
10
|
-
import type { SummaryLength } from "../../../shared/contracts.js";
|
|
11
9
|
import type { SlideExtractionResult, SlideImage, SlideSettings, SlideSourceKind } from "../../../slides/index.js";
|
|
12
10
|
import type { SpeakerIdentificationSettings } from "../../../speaker-identification/index.js";
|
|
13
11
|
import type { PerfTrace } from "../../perf-trace.js";
|
|
14
|
-
import type {
|
|
15
|
-
import type { SummarizeAssetArgs } from "../asset/summary.js";
|
|
12
|
+
import type { AssetSummaryResult, SummarizeAssetArgs } from "../asset/types.js";
|
|
16
13
|
export type UrlFlowIo = {
|
|
17
14
|
env: Record<string, string | undefined>;
|
|
18
15
|
envForRun: Record<string, string | undefined>;
|
|
@@ -32,6 +29,7 @@ export type UrlFlowFlags = {
|
|
|
32
29
|
youtubeMode: "auto" | "web" | "yt-dlp" | "apify" | "no-auto";
|
|
33
30
|
firecrawlMode: "off" | "auto" | "always";
|
|
34
31
|
videoMode: "auto" | "transcript" | "understand";
|
|
32
|
+
embeddedVideoMode: "auto" | "off" | "prefer" | "both";
|
|
35
33
|
transcriptTimestamps: boolean;
|
|
36
34
|
transcriptDiarization: "auto" | "elevenlabs" | "openai" | null;
|
|
37
35
|
speakerIdentification: SpeakerIdentificationSettings | null;
|
|
@@ -68,63 +66,7 @@ export type UrlFlowFlags = {
|
|
|
68
66
|
slidesOutput?: boolean;
|
|
69
67
|
throwOnAssetLikeHtmlError?: boolean;
|
|
70
68
|
};
|
|
71
|
-
export type UrlFlowModel =
|
|
72
|
-
requestedModel: RequestedModel;
|
|
73
|
-
requestedModelInput: string;
|
|
74
|
-
requestedModelLabel: string;
|
|
75
|
-
fixedModelSpec: FixedModelSpec | null;
|
|
76
|
-
isFallbackModel: boolean;
|
|
77
|
-
isImplicitAutoSelection: boolean;
|
|
78
|
-
allowAutoCliFallback: boolean;
|
|
79
|
-
isNamedModelSelection: boolean;
|
|
80
|
-
wantsFreeNamedModel: boolean;
|
|
81
|
-
desiredOutputTokens: number | null;
|
|
82
|
-
configForModelSelection: SummarizeConfig | null;
|
|
83
|
-
envForAuto: Record<string, string | undefined>;
|
|
84
|
-
cliAvailability: Partial<Record<CliProvider, boolean>>;
|
|
85
|
-
openaiUseChatCompletions: boolean | undefined;
|
|
86
|
-
openaiRequestOptions?: ModelRequestOptions;
|
|
87
|
-
openaiRequestOptionsOverride?: ModelRequestOptions;
|
|
88
|
-
cliReasoningEffortOverride?: OpenAiReasoningEffort;
|
|
89
|
-
openaiWhisperUsdPerMinute: number;
|
|
90
|
-
apiStatus: {
|
|
91
|
-
xaiApiKey: string | null;
|
|
92
|
-
apiKey: string | null;
|
|
93
|
-
nvidiaApiKey: string | null;
|
|
94
|
-
minimaxApiKey: string | null;
|
|
95
|
-
openrouterApiKey: string | null;
|
|
96
|
-
openrouterConfigured: boolean;
|
|
97
|
-
googleApiKey: string | null;
|
|
98
|
-
googleConfigured: boolean;
|
|
99
|
-
anthropicApiKey: string | null;
|
|
100
|
-
anthropicConfigured: boolean;
|
|
101
|
-
providerBaseUrls: {
|
|
102
|
-
openai: string | null;
|
|
103
|
-
nvidia: string | null;
|
|
104
|
-
anthropic: string | null;
|
|
105
|
-
google: string | null;
|
|
106
|
-
xai: string | null;
|
|
107
|
-
};
|
|
108
|
-
zaiApiKey: string | null;
|
|
109
|
-
zaiBaseUrl: string;
|
|
110
|
-
nvidiaBaseUrl: string;
|
|
111
|
-
minimaxBaseUrl: string;
|
|
112
|
-
ollamaBaseUrl: string;
|
|
113
|
-
firecrawlConfigured: boolean;
|
|
114
|
-
firecrawlApiKey: string | null;
|
|
115
|
-
apifyToken: string | null;
|
|
116
|
-
ytDlpPath: string | null;
|
|
117
|
-
ytDlpCookiesFromBrowser: string | null;
|
|
118
|
-
falApiKey: string | null;
|
|
119
|
-
groqApiKey: string | null;
|
|
120
|
-
assemblyaiApiKey: string | null;
|
|
121
|
-
elevenlabsApiKey: string | null;
|
|
122
|
-
openaiApiKey: string | null;
|
|
123
|
-
};
|
|
124
|
-
summaryEngine: ReturnType<typeof createSummaryEngine>;
|
|
125
|
-
getLiteLlmCatalog: () => Promise<Awaited<ReturnType<typeof import("../../../pricing/litellm.js").loadLiteLlmCatalog>>["catalog"]>;
|
|
126
|
-
llmCalls: LlmCall[];
|
|
127
|
-
};
|
|
69
|
+
export type UrlFlowModel = ExecutableRunModel;
|
|
128
70
|
export type UrlFlowHooks = {
|
|
129
71
|
onModelChosen?: ((modelId: string) => void) | null;
|
|
130
72
|
onExtracted?: ((extracted: ExtractedLinkContent) => void) | null;
|
|
@@ -147,7 +89,7 @@ export type UrlFlowHooks = {
|
|
|
147
89
|
onLinkPreviewProgress?: ((event: LinkPreviewProgressEvent) => void) | null;
|
|
148
90
|
onSummaryCached?: ((cached: boolean) => void) | null;
|
|
149
91
|
setTranscriptionCost: (costUsd: number | null, label: string | null) => void;
|
|
150
|
-
summarizeAsset: (args: SummarizeAssetArgs) => Promise<
|
|
92
|
+
summarizeAsset: (args: SummarizeAssetArgs) => Promise<AssetSummaryResult>;
|
|
151
93
|
writeViaFooter: (parts: string[]) => void;
|
|
152
94
|
clearProgressForStdout: () => void;
|
|
153
95
|
restoreProgressAfterStdout?: (() => void) | null;
|
|
@@ -174,7 +116,7 @@ export declare function createUrlFlowContext(options: {
|
|
|
174
116
|
eventHooks?: Partial<UrlFlowEventHooks>;
|
|
175
117
|
}): UrlFlowContext;
|
|
176
118
|
/**
|
|
177
|
-
* Wiring struct for `
|
|
119
|
+
* Wiring struct for `executeUrlFlow`.
|
|
178
120
|
* CLI runner populates the full surface; daemon uses a smaller subset (no TTY/progress/footer),
|
|
179
121
|
* but both share the same extraction/cache/model logic.
|
|
180
122
|
*/
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { type ExtractedLinkContent } from "../../../content/index.js";
|
|
2
2
|
import type { SlideExtractionResult } from "../../../slides/index.js";
|
|
3
|
+
import type { AssetSummaryResult } from "../asset/types.js";
|
|
3
4
|
import { type UrlExtractionUi } from "./extract.js";
|
|
4
5
|
import type { UrlFlowContext } from "./types.js";
|
|
5
6
|
export type VideoOnlyResult = {
|
|
6
7
|
handled: true;
|
|
8
|
+
extracted: ExtractedLinkContent;
|
|
9
|
+
slides: SlideExtractionResult | null;
|
|
10
|
+
summary: AssetSummaryResult;
|
|
7
11
|
} | {
|
|
8
12
|
handled: false;
|
|
9
13
|
extracted: ExtractedLinkContent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export { resolveTargetCharacters } from "../shared/summary-length.js";
|
|
2
2
|
export declare function formatOptionalString(value: string | null | undefined): string;
|
|
3
3
|
export declare function formatOptionalNumber(value: number | null | undefined): string;
|
|
4
4
|
export declare function sumNumbersOrNull(values: Array<number | null>): number | null;
|
|
@@ -9,10 +9,3 @@ export declare function estimateWhisperTranscriptionCostUsd({ transcriptionProvi
|
|
|
9
9
|
mediaDurationSeconds: number | null;
|
|
10
10
|
openaiWhisperUsdPerMinute: number;
|
|
11
11
|
}): number | null;
|
|
12
|
-
export declare function resolveTargetCharacters(lengthArg: {
|
|
13
|
-
kind: "preset";
|
|
14
|
-
preset: SummaryLength;
|
|
15
|
-
} | {
|
|
16
|
-
kind: "chars";
|
|
17
|
-
maxCharacters: number;
|
|
18
|
-
}, maxMap: Record<SummaryLength, number>): number;
|
package/dist/types/run/help.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export declare function buildSlidesProgram(): Command;
|
|
|
5
5
|
export declare function attachRichHelp(program: Command, env: Record<string, string | undefined>, stdout: NodeJS.WritableStream): void;
|
|
6
6
|
export declare function buildConciseHelp(): string;
|
|
7
7
|
export declare function buildRefreshFreeHelp(): string;
|
|
8
|
+
export declare function buildStatusHelp(): string;
|
|
8
9
|
export declare function buildDaemonHelp(): string;
|
|
9
10
|
export declare function buildTranscriberHelp(): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CliProvider } from "../config.js";
|
|
2
|
-
import type { DiarizationMode, FirecrawlMode, LengthArg, MarkdownMode, PreprocessMode, VideoMode, YoutubeMode } from "../flags.js";
|
|
2
|
+
import type { DiarizationMode, EmbeddedVideoMode, FirecrawlMode, LengthArg, MarkdownMode, PreprocessMode, VideoMode, YoutubeMode } from "../flags.js";
|
|
3
3
|
import type { OutputLanguage } from "../language.js";
|
|
4
4
|
import { type SummaryLengthTarget } from "../prompts/index.js";
|
|
5
5
|
export type ResolvedRunSettings = {
|
|
@@ -18,6 +18,7 @@ export type RunOverrides = {
|
|
|
18
18
|
preprocessMode: PreprocessMode | null;
|
|
19
19
|
youtubeMode: YoutubeMode | null;
|
|
20
20
|
videoMode: VideoMode | null;
|
|
21
|
+
embeddedVideoMode: EmbeddedVideoMode | null;
|
|
21
22
|
transcriptTimestamps: boolean | null;
|
|
22
23
|
transcriptDiarization: DiarizationMode | null;
|
|
23
24
|
forceSummary: boolean | null;
|
|
@@ -34,6 +35,7 @@ export type RunOverridesInput = {
|
|
|
34
35
|
preprocess?: unknown;
|
|
35
36
|
youtube?: unknown;
|
|
36
37
|
videoMode?: unknown;
|
|
38
|
+
embeddedVideo?: unknown;
|
|
37
39
|
timestamps?: unknown;
|
|
38
40
|
diarize?: unknown;
|
|
39
41
|
forceSummary?: unknown;
|
|
@@ -48,6 +50,7 @@ export type RunOverridesInput = {
|
|
|
48
50
|
magicCliOrder?: unknown;
|
|
49
51
|
magicCliRememberLastSuccess?: unknown;
|
|
50
52
|
};
|
|
53
|
+
export declare function createEmptyRunOverrides(): RunOverrides;
|
|
51
54
|
export declare function resolveSummaryLength(raw: unknown, fallback?: string): {
|
|
52
55
|
lengthArg: LengthArg;
|
|
53
56
|
summaryLength: SummaryLengthTarget;
|
|
@@ -69,6 +72,6 @@ export declare function resolveCliRunSettings({ length, firecrawl, markdownMode,
|
|
|
69
72
|
retries: string;
|
|
70
73
|
maxOutputTokens?: string | undefined;
|
|
71
74
|
}): ResolvedRunSettings;
|
|
72
|
-
export declare function resolveRunOverrides({ firecrawl, markdownMode, preprocess, youtube, videoMode, timestamps, diarize, forceSummary, timeout, retries, maxOutputTokens, transcriber, autoCliFallback, autoCliOrder, autoCliRememberLastSuccess, magicCliAuto, magicCliOrder, magicCliRememberLastSuccess, }: RunOverridesInput, options?: {
|
|
75
|
+
export declare function resolveRunOverrides({ firecrawl, markdownMode, preprocess, youtube, videoMode, embeddedVideo, timestamps, diarize, forceSummary, timeout, retries, maxOutputTokens, transcriber, autoCliFallback, autoCliOrder, autoCliRememberLastSuccess, magicCliAuto, magicCliOrder, magicCliRememberLastSuccess, }: RunOverridesInput, options?: {
|
|
73
76
|
strict?: boolean;
|
|
74
77
|
}): RunOverrides;
|
|
@@ -2,6 +2,7 @@ import { type FirecrawlMode, type DiarizationMode, type LengthArg, type Markdown
|
|
|
2
2
|
type Transcriber = "auto" | "whisper" | "parakeet" | "canary";
|
|
3
3
|
export type RunnerFlagResolution = {
|
|
4
4
|
videoModeExplicitlySet: boolean;
|
|
5
|
+
embeddedVideoExplicitlySet: boolean;
|
|
5
6
|
lengthExplicitlySet: boolean;
|
|
6
7
|
languageExplicitlySet: boolean;
|
|
7
8
|
noCacheFlag: boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
type StatusModel = {
|
|
2
|
+
selection: string;
|
|
3
|
+
source: "config" | "environment" | "default";
|
|
4
|
+
};
|
|
5
|
+
type StatusPreset = {
|
|
6
|
+
name: string;
|
|
7
|
+
model: string;
|
|
8
|
+
candidates?: string[];
|
|
9
|
+
};
|
|
10
|
+
type StatusProvider = {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
kind: "api" | "cli" | "local";
|
|
14
|
+
state: "configured" | "available" | "usable";
|
|
15
|
+
source?: string;
|
|
16
|
+
model?: string;
|
|
17
|
+
path?: string;
|
|
18
|
+
endpoint?: string;
|
|
19
|
+
models?: string[];
|
|
20
|
+
};
|
|
21
|
+
export type StatusReport = {
|
|
22
|
+
model: StatusModel;
|
|
23
|
+
presets: StatusPreset[];
|
|
24
|
+
providers: StatusProvider[];
|
|
25
|
+
probed: boolean;
|
|
26
|
+
config?: {
|
|
27
|
+
path: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare function buildStatusReport({ env, fetchImpl, probe, }: {
|
|
31
|
+
env: Record<string, string | undefined>;
|
|
32
|
+
fetchImpl: typeof fetch;
|
|
33
|
+
probe: boolean;
|
|
34
|
+
}): Promise<StatusReport>;
|
|
35
|
+
export declare function handleStatusCliRequest({ normalizedArgv, envForRun, fetchImpl, stdout, }: {
|
|
36
|
+
normalizedArgv: string[];
|
|
37
|
+
envForRun: Record<string, string | undefined>;
|
|
38
|
+
fetchImpl: typeof fetch;
|
|
39
|
+
stdout: NodeJS.WritableStream;
|
|
40
|
+
}): Promise<boolean>;
|
|
41
|
+
export {};
|
|
@@ -8,7 +8,8 @@ export declare function createStreamOutputGate({ stdout, clearProgressForStdout,
|
|
|
8
8
|
rewriteOnReplacement?: boolean;
|
|
9
9
|
restoreDuringStream?: boolean;
|
|
10
10
|
}): {
|
|
11
|
-
handleChunk: (streamed: string, prevStreamed: string) =>
|
|
12
|
-
finalize: (finalText: string) =>
|
|
11
|
+
handleChunk: (streamed: string, prevStreamed: string) => boolean;
|
|
12
|
+
finalize: (finalText: string) => boolean;
|
|
13
|
+
reset: () => void;
|
|
13
14
|
getFlushedLen: () => number;
|
|
14
15
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SummaryStreamHandler } from "../engine/events.js";
|
|
2
|
+
import { type StreamOutputMode } from "./stream-output.js";
|
|
3
|
+
export declare function createTerminalSummaryStream({ stdout, env, envForRun, plain, outputMode, clearProgressForStdout, restoreProgressAfterStdout, }: {
|
|
4
|
+
stdout: NodeJS.WritableStream;
|
|
5
|
+
env: Record<string, string | undefined>;
|
|
6
|
+
envForRun: Record<string, string | undefined>;
|
|
7
|
+
plain: boolean;
|
|
8
|
+
outputMode?: StreamOutputMode | null;
|
|
9
|
+
clearProgressForStdout: () => void;
|
|
10
|
+
restoreProgressAfterStdout?: (() => void) | null;
|
|
11
|
+
}): SummaryStreamHandler;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatCompactCount(value: number): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type RunApiStatus = {
|
|
2
|
+
apiKey: string | null;
|
|
3
|
+
openrouterApiKey: string | null;
|
|
4
|
+
openrouterConfigured: boolean;
|
|
5
|
+
groqApiKey: string | null;
|
|
6
|
+
assemblyaiApiKey: string | null;
|
|
7
|
+
elevenlabsApiKey: string | null;
|
|
8
|
+
openaiApiKey: string | null;
|
|
9
|
+
xaiApiKey: string | null;
|
|
10
|
+
googleApiKey: string | null;
|
|
11
|
+
anthropicApiKey: string | null;
|
|
12
|
+
zaiApiKey: string | null;
|
|
13
|
+
zaiBaseUrl: string;
|
|
14
|
+
nvidiaApiKey: string | null;
|
|
15
|
+
nvidiaBaseUrl: string;
|
|
16
|
+
minimaxApiKey: string | null;
|
|
17
|
+
minimaxBaseUrl: string;
|
|
18
|
+
ollamaBaseUrl: string;
|
|
19
|
+
firecrawlApiKey: string | null;
|
|
20
|
+
firecrawlConfigured: boolean;
|
|
21
|
+
googleConfigured: boolean;
|
|
22
|
+
anthropicConfigured: boolean;
|
|
23
|
+
apifyToken: string | null;
|
|
24
|
+
ytDlpPath: string | null;
|
|
25
|
+
ytDlpCookiesFromBrowser: string | null;
|
|
26
|
+
falApiKey: string | null;
|
|
27
|
+
providerBaseUrls: {
|
|
28
|
+
openai: string | null;
|
|
29
|
+
nvidia: string | null;
|
|
30
|
+
anthropic: string | null;
|
|
31
|
+
google: string | null;
|
|
32
|
+
xai: string | null;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type RunApiAvailability = Pick<RunApiStatus, "xaiApiKey" | "apiKey" | "openrouterApiKey" | "apifyToken" | "firecrawlConfigured" | "googleConfigured" | "anthropicConfigured">;
|
|
36
|
+
export declare function buildRunJsonEnv(apiStatus: RunApiAvailability): {
|
|
37
|
+
hasXaiKey: boolean;
|
|
38
|
+
hasOpenAIKey: boolean;
|
|
39
|
+
hasOpenRouterKey: boolean;
|
|
40
|
+
hasApifyToken: boolean;
|
|
41
|
+
hasFirecrawlKey: boolean;
|
|
42
|
+
hasGoogleKey: boolean;
|
|
43
|
+
hasAnthropicKey: boolean;
|
|
44
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SummaryLength } from "@steipete/summarize-core";
|
|
2
|
+
export type SummaryLengthArg = {
|
|
3
|
+
kind: "preset";
|
|
4
|
+
preset: SummaryLength;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "chars";
|
|
7
|
+
maxCharacters: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function resolveTargetCharacters(lengthArg: SummaryLengthArg, maxMap: Record<SummaryLength, number>): number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function formatElapsedMs(ms: number): string;
|
|
2
2
|
export declare function formatBytes(bytes: number): string;
|
|
3
3
|
export declare function formatBytesPerSecond(bytesPerSecond: number): string;
|
|
4
|
-
export declare function formatCompactCount(value: number): string;
|
|
5
4
|
export declare function formatMinutesSmart(valueMinutes: number): string;
|
|
6
5
|
export declare function formatDurationSecondsSmart(value: number): string;
|
|
6
|
+
export { formatCompactCount } from "../shared/format-count.js";
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const FALLBACK_VERSION = "0.
|
|
1
|
+
export declare const FALLBACK_VERSION = "0.18.1";
|
|
2
2
|
export declare function resolvePackageVersion(importMetaUrl?: string): string;
|
|
3
3
|
export declare function resolveGitSha(importMetaUrl?: string): string | null;
|
|
4
4
|
export declare function formatVersionLine(importMetaUrl?: string): string;
|
package/docs/README.md
CHANGED
|
@@ -9,6 +9,7 @@ summary: "Docs index for summarize behaviors and modes."
|
|
|
9
9
|
- `docs/cli.md` — CLI models (Claude/Codex/Gemini/Agent/OpenClaw/OpenCode/Copilot/Antigravity/pi)
|
|
10
10
|
- `docs/config.md` — config file location, precedence, and schema
|
|
11
11
|
- `docs/extract-only.md` — extract mode (no summary LLM call)
|
|
12
|
+
- `docs/engine.md` — headless execution engine architecture
|
|
12
13
|
- `docs/firecrawl.md` — Firecrawl mode + API key
|
|
13
14
|
- `docs/language.md` — output language (`--language` / config `language`)
|
|
14
15
|
- `docs/llm.md` — LLM summarization + model config (Gateway/OpenAI)
|
package/docs/cli.md
CHANGED
|
@@ -13,7 +13,7 @@ Summarize can use installed CLIs (Claude, Codex, Gemini, Cursor Agent, OpenClaw,
|
|
|
13
13
|
## Model ids
|
|
14
14
|
|
|
15
15
|
- `cli/claude/<model>` (e.g. `cli/claude/sonnet`)
|
|
16
|
-
- `cli/codex/<model>` (e.g. `cli/codex/gpt-5.
|
|
16
|
+
- `cli/codex/<model>` (e.g. `cli/codex/gpt-5.5`)
|
|
17
17
|
- `cli/gemini/<model>` (e.g. `cli/gemini/flash`)
|
|
18
18
|
- `cli/agent/<model>` (e.g. `cli/agent/auto`)
|
|
19
19
|
- `cli/openclaw/<model>` (e.g. `cli/openclaw/main`)
|
|
@@ -27,6 +27,7 @@ Summarize can use installed CLIs (Claude, Codex, Gemini, Cursor Agent, OpenClaw,
|
|
|
27
27
|
- `cli/pi` (use pi's configured default model)
|
|
28
28
|
|
|
29
29
|
Use `--cli [provider]` (case-insensitive) for the provider default, or `--model cli/<provider>/<model>` to pin a model.
|
|
30
|
+
Bare `cli/codex` defaults to GPT-5.5; set `cli.codex.model` to override it.
|
|
30
31
|
Antigravity does not support per-call model selection in print mode, so use `cli/agy` without a model suffix. pi supports `cli/pi/<model>` or a configured `cli.pi.model`.
|
|
31
32
|
If `--cli` is provided without a provider, auto selection is used with CLI enabled.
|
|
32
33
|
|
|
@@ -94,6 +95,10 @@ Binary lookup:
|
|
|
94
95
|
- `COPILOT_PATH` (optional override)
|
|
95
96
|
- Otherwise uses `PATH`
|
|
96
97
|
|
|
98
|
+
Run `summarize status` to list enabled CLI providers whose executable is currently available.
|
|
99
|
+
`summarize status --verbose` also prints the resolved executable path and configured CLI model.
|
|
100
|
+
Missing or disabled providers are omitted.
|
|
101
|
+
|
|
97
102
|
## Attachments (images/files)
|
|
98
103
|
|
|
99
104
|
When a CLI attempt is used for an image or non-text file, Summarize switches to a
|
|
@@ -129,7 +134,7 @@ path-based prompt and enables the required tool flags:
|
|
|
129
134
|
"onlyWhenNoApiKeys": true,
|
|
130
135
|
"order": ["claude", "gemini", "codex", "agent", "openclaw", "opencode", "copilot"]
|
|
131
136
|
},
|
|
132
|
-
"codex": { "model": "gpt-5.
|
|
137
|
+
"codex": { "model": "gpt-5.5" },
|
|
133
138
|
"gemini": { "model": "flash", "extraArgs": ["--verbose"] },
|
|
134
139
|
"claude": {
|
|
135
140
|
"model": "sonnet",
|
|
@@ -110,7 +110,7 @@ If `[input]` is omitted, summarize prints concise help and exits.
|
|
|
110
110
|
### Summary control
|
|
111
111
|
|
|
112
112
|
`--length <length>`
|
|
113
|
-
: `short`, `medium`, `long`, `xl`, `xxl` (or `s`/`m`/`l`) or a character cap like `20000` or `20k`. Default `
|
|
113
|
+
: `short`, `medium`, `long`, `xl`, `xxl` (or `s`/`m`/`l`) or a character cap like `20000` or `20k`. Default `long`. Override globally via `output.length` in [Config](../config.md).
|
|
114
114
|
|
|
115
115
|
`--force-summary`
|
|
116
116
|
: Always run the LLM, even when extracted content is shorter than the requested length.
|
package/docs/config.md
CHANGED
|
@@ -16,6 +16,22 @@ Default path:
|
|
|
16
16
|
|
|
17
17
|
- `~/.summarize/config.json`
|
|
18
18
|
|
|
19
|
+
## Status
|
|
20
|
+
|
|
21
|
+
Inspect the effective model selection and positive provider setup:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
summarize status
|
|
25
|
+
summarize status --verbose
|
|
26
|
+
summarize status --probe
|
|
27
|
+
summarize status --json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The command omits missing providers and never prints secret values. API providers appear as
|
|
31
|
+
`configured` when an effective key is present. Enabled CLI providers appear as `available` when
|
|
32
|
+
their executable can be resolved. `--probe` checks supported OpenAI-compatible/local model-list
|
|
33
|
+
endpoints without running inference and marks successful providers as `usable`.
|
|
34
|
+
|
|
19
35
|
## Precedence
|
|
20
36
|
|
|
21
37
|
For `model`:
|
|
@@ -35,7 +51,7 @@ For output length:
|
|
|
35
51
|
|
|
36
52
|
1. CLI flag `--length`
|
|
37
53
|
2. Config file `output.length`
|
|
38
|
-
3. Built-in default (`
|
|
54
|
+
3. Built-in default (`long`)
|
|
39
55
|
|
|
40
56
|
See `docs/language.md` for supported values.
|
|
41
57
|
|
|
@@ -358,10 +374,15 @@ For auto selection with rules:
|
|
|
358
374
|
}
|
|
359
375
|
]
|
|
360
376
|
},
|
|
361
|
-
"media": {
|
|
377
|
+
"media": {
|
|
378
|
+
"videoMode": "auto",
|
|
379
|
+
"embeddedVideo": "auto"
|
|
380
|
+
}
|
|
362
381
|
}
|
|
363
382
|
```
|
|
364
383
|
|
|
384
|
+
`media.embeddedVideo` accepts `"auto"`, `"off"`, `"prefer"`, or `"both"`. Automatic mode uses only high-confidence primary YouTube embeds and free captions, combining the transcript with substantial article text.
|
|
385
|
+
|
|
365
386
|
Notes:
|
|
366
387
|
|
|
367
388
|
- Parsed leniently (JSON5), but **comments are not allowed**.
|
|
@@ -398,7 +419,7 @@ Examples:
|
|
|
398
419
|
"onlyWhenNoApiKeys": true,
|
|
399
420
|
"order": ["claude", "gemini", "codex", "agent", "openclaw", "opencode", "copilot"]
|
|
400
421
|
},
|
|
401
|
-
"codex": { "model": "gpt-5.
|
|
422
|
+
"codex": { "model": "gpt-5.5" },
|
|
402
423
|
"claude": { "binary": "/usr/local/bin/claude", "extraArgs": ["--verbose"] },
|
|
403
424
|
"agent": { "binary": "/usr/local/bin/agent", "model": "gpt-5.2" },
|
|
404
425
|
"openclaw": { "binary": "/usr/local/bin/openclaw", "model": "main" },
|
package/docs/engine.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Execution engine"
|
|
3
|
+
summary: "Headless summary execution shared by CLI and daemon adapters."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Execution engine
|
|
7
|
+
|
|
8
|
+
`src/engine` owns summary policy and execution. It has no terminal, daemon, HTTP transport, or process UI dependencies.
|
|
9
|
+
|
|
10
|
+
CLI and daemon code remain adapters:
|
|
11
|
+
|
|
12
|
+
- CLI resolves command flags, owns progress and terminal rendering, then invokes engine modules.
|
|
13
|
+
- Daemon resolves request/config state, maps engine stream events to response chunks, and owns SSE/HTTP behavior.
|
|
14
|
+
- Browser code continues to depend on `@steipete/summarize-core`, not the Node execution engine.
|
|
15
|
+
|
|
16
|
+
## Module map
|
|
17
|
+
|
|
18
|
+
| Module | Responsibility |
|
|
19
|
+
| ----------------------- | ------------------------------------------------------------------- |
|
|
20
|
+
| `model-executor.ts` | Provider/CLI calls, retries, streaming, token limits, usage |
|
|
21
|
+
| `summary-execution.ts` | Attempt order, cache reads/writes, fallback outcomes |
|
|
22
|
+
| `web-summary.ts` | URL summary attempts, short-content bypass, timestamp normalization |
|
|
23
|
+
| `web-prompt.ts` | URL prompt construction and slide transcript budgeting |
|
|
24
|
+
| `summary-timestamps.ts` | Timestamp bounds, sanitation, fallback key moments |
|
|
25
|
+
| `events.ts` | Adapter-neutral summary stream contract |
|
|
26
|
+
| `errors.ts` | Stable engine error-code guards |
|
|
27
|
+
| `types.ts` | Model attempts and typed execution results |
|
|
28
|
+
| `model-call.ts` | Provider model resolution and non-streaming calls |
|
|
29
|
+
| `streaming.ts` | Stream capability and chunk normalization |
|
|
30
|
+
|
|
31
|
+
## Dependency rules
|
|
32
|
+
|
|
33
|
+
`src/engine/**` must not import:
|
|
34
|
+
|
|
35
|
+
- `src/run/**`
|
|
36
|
+
- `src/daemon/**`
|
|
37
|
+
- `src/tty/**`
|
|
38
|
+
|
|
39
|
+
The boundary test enforces this rule.
|
|
40
|
+
|
|
41
|
+
Engine modules may depend on portable domain/config modules, provider clients, cache interfaces, prompts, and injected runtime functions.
|
|
42
|
+
|
|
43
|
+
## Streaming
|
|
44
|
+
|
|
45
|
+
The engine never writes summary text to stdout.
|
|
46
|
+
|
|
47
|
+
`SummaryStreamHandler` receives normalized chunks:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
type SummaryStreamChunk = {
|
|
51
|
+
streamed: string;
|
|
52
|
+
prevStreamed: string;
|
|
53
|
+
appended: string;
|
|
54
|
+
};
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Adapters decide how to consume them:
|
|
58
|
+
|
|
59
|
+
- CLI: plain/ANSI rendering, line or delta mode, progress coordination
|
|
60
|
+
- daemon: response chunks and final newline
|
|
61
|
+
- slides: interleaved slide presentation
|
|
62
|
+
|
|
63
|
+
`SummaryAttemptResult.summaryEmitted` tells the adapter whether a stream handler already emitted the result. Cache hits and forced non-streaming calls return `false`, so the adapter writes the final summary once.
|
|
64
|
+
|
|
65
|
+
## Error routing
|
|
66
|
+
|
|
67
|
+
Fallback decisions use stable codes rather than message matching.
|
|
68
|
+
|
|
69
|
+
Asset-like responses discovered during HTML extraction throw `AssetLikeHtmlFetchError` with code `ASSET_LIKE_HTML_FETCH`. Input routing uses that code to retry the URL as an asset and optionally enable Firecrawl fallback.
|
|
70
|
+
|
|
71
|
+
The user-facing error text remains descriptive, but it is not a control-flow contract.
|
|
72
|
+
|
|
73
|
+
## Adapter ownership
|
|
74
|
+
|
|
75
|
+
Adapters own:
|
|
76
|
+
|
|
77
|
+
- stdout/stderr
|
|
78
|
+
- terminal capability and markdown rendering
|
|
79
|
+
- progress lifecycle and signals
|
|
80
|
+
- request/SSE serialization
|
|
81
|
+
- CLI fallback-state persistence callbacks
|
|
82
|
+
- cache/resource construction and cleanup
|
|
83
|
+
|
|
84
|
+
The engine owns:
|
|
85
|
+
|
|
86
|
+
- prompt policy
|
|
87
|
+
- model attempts and provider overrides
|
|
88
|
+
- summary cache keys and normalization
|
|
89
|
+
- stream normalization
|
|
90
|
+
- timestamp validation
|
|
91
|
+
- retry/fallback outcomes
|
|
92
|
+
|
|
93
|
+
## Tests
|
|
94
|
+
|
|
95
|
+
Key coverage:
|
|
96
|
+
|
|
97
|
+
- engine import-boundary test
|
|
98
|
+
- model executor streaming with and without handlers
|
|
99
|
+
- terminal stream adapter output
|
|
100
|
+
- daemon cache and visible-page output
|
|
101
|
+
- typed asset-like HTML fallback routing
|
|
102
|
+
- URL prompt and timestamp normalization
|
|
103
|
+
- existing URL, asset, provider, cache, and CLI characterization suites
|
|
104
|
+
|
|
105
|
+
## Public API
|
|
106
|
+
|
|
107
|
+
`src/engine` is internal. It is not exported from the package root.
|
|
108
|
+
|
|
109
|
+
Any future public engine API needs a separate contract review for cancellation, resource ownership, error stability, and versioning.
|
package/docs/index.md
CHANGED
package/docs/llm.md
CHANGED
|
@@ -46,7 +46,7 @@ installed, auto mode can use local CLI models via `cli.enabled` or implicit auto
|
|
|
46
46
|
|
|
47
47
|
- `--model <model>`
|
|
48
48
|
- Examples:
|
|
49
|
-
- `cli/codex/gpt-5.
|
|
49
|
+
- `cli/codex/gpt-5.5`
|
|
50
50
|
- `openai/gpt-5.5`
|
|
51
51
|
- `codex-fast` (explicit Codex CLI GPT Fast preset)
|
|
52
52
|
- `cli/claude/sonnet`
|
|
@@ -94,7 +94,7 @@ installed, auto mode can use local CLI models via `cli.enabled` or implicit auto
|
|
|
94
94
|
- `--length short|medium|long|xl|xxl|<chars>`
|
|
95
95
|
- This is _soft guidance_ to the model (no hard truncation).
|
|
96
96
|
- Minimum numeric value: 50 chars.
|
|
97
|
-
- Built-in default: `
|
|
97
|
+
- Built-in default: `long`.
|
|
98
98
|
- Config default: `output.length` in `~/.summarize/config.json`.
|
|
99
99
|
- Output format is Markdown; use short paragraphs and only add bullets when they improve scanability.
|
|
100
100
|
- `--force-summary`
|
package/docs/quickstart.md
CHANGED
|
@@ -34,7 +34,7 @@ summarize "https://example.com" --cli codex
|
|
|
34
34
|
summarize "https://en.wikipedia.org/wiki/Llama"
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
You'll see streaming Markdown in the terminal. The default length is `
|
|
37
|
+
You'll see streaming Markdown in the terminal. The default length is `long` (~4k chars); use `--length` to change it:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
summarize "https://example.com/long-article" --length short
|