@steipete/summarize 0.9.0 → 0.11.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 +121 -0
- package/LICENSE +1 -1
- package/README.md +391 -183
- package/dist/cli.js +1 -1
- package/dist/esm/cache.js +134 -64
- package/dist/esm/cache.js.map +1 -1
- package/dist/esm/cli-main.js +27 -27
- package/dist/esm/cli-main.js.map +1 -1
- package/dist/esm/cli.js +2 -2
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/config.js +396 -126
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/content/asset.js +53 -50
- package/dist/esm/content/asset.js.map +1 -1
- package/dist/esm/content/index.js +1 -1
- package/dist/esm/content/index.js.map +1 -1
- package/dist/esm/costs.js +1 -1
- package/dist/esm/costs.js.map +1 -1
- package/dist/esm/daemon/agent.js +548 -0
- package/dist/esm/daemon/agent.js.map +1 -0
- package/dist/esm/daemon/auto-mode.js +3 -3
- package/dist/esm/daemon/auto-mode.js.map +1 -1
- package/dist/esm/daemon/chat.js +88 -178
- package/dist/esm/daemon/chat.js.map +1 -1
- package/dist/esm/daemon/cli-entrypoint.js +72 -0
- package/dist/esm/daemon/cli-entrypoint.js.map +1 -0
- package/dist/esm/daemon/cli.js +91 -83
- package/dist/esm/daemon/cli.js.map +1 -1
- package/dist/esm/daemon/config.js +15 -15
- package/dist/esm/daemon/config.js.map +1 -1
- package/dist/esm/daemon/constants.js +6 -6
- package/dist/esm/daemon/constants.js.map +1 -1
- package/dist/esm/daemon/env-merge.js.map +1 -1
- package/dist/esm/daemon/env-snapshot.js +36 -28
- package/dist/esm/daemon/env-snapshot.js.map +1 -1
- package/dist/esm/daemon/flow-context.js +86 -32
- package/dist/esm/daemon/flow-context.js.map +1 -1
- package/dist/esm/daemon/launchd.js +119 -47
- package/dist/esm/daemon/launchd.js.map +1 -1
- package/dist/esm/daemon/meta.js +5 -5
- package/dist/esm/daemon/meta.js.map +1 -1
- package/dist/esm/daemon/models.js +54 -31
- package/dist/esm/daemon/models.js.map +1 -1
- package/dist/esm/daemon/process-registry.js +206 -0
- package/dist/esm/daemon/process-registry.js.map +1 -0
- package/dist/esm/daemon/schtasks.js +96 -32
- package/dist/esm/daemon/schtasks.js.map +1 -1
- package/dist/esm/daemon/server.js +832 -158
- package/dist/esm/daemon/server.js.map +1 -1
- package/dist/esm/daemon/summarize-progress.js +11 -11
- package/dist/esm/daemon/summarize-progress.js.map +1 -1
- package/dist/esm/daemon/summarize.js +61 -32
- package/dist/esm/daemon/summarize.js.map +1 -1
- package/dist/esm/daemon/systemd.js +96 -35
- package/dist/esm/daemon/systemd.js.map +1 -1
- package/dist/esm/firecrawl.js +12 -12
- package/dist/esm/firecrawl.js.map +1 -1
- package/dist/esm/flags.js +55 -31
- package/dist/esm/flags.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/language.js +1 -1
- package/dist/esm/language.js.map +1 -1
- package/dist/esm/llm/cli.js +128 -64
- package/dist/esm/llm/cli.js.map +1 -1
- package/dist/esm/llm/errors.js +1 -1
- package/dist/esm/llm/errors.js.map +1 -1
- package/dist/esm/llm/generate-text.js +107 -98
- package/dist/esm/llm/generate-text.js.map +1 -1
- package/dist/esm/llm/google-models.js +17 -17
- package/dist/esm/llm/google-models.js.map +1 -1
- package/dist/esm/llm/html-to-markdown.js +3 -3
- package/dist/esm/llm/html-to-markdown.js.map +1 -1
- package/dist/esm/llm/model-id.js +38 -16
- package/dist/esm/llm/model-id.js.map +1 -1
- package/dist/esm/llm/prompt.js +5 -5
- package/dist/esm/llm/prompt.js.map +1 -1
- package/dist/esm/llm/providers/anthropic.js +33 -33
- package/dist/esm/llm/providers/anthropic.js.map +1 -1
- package/dist/esm/llm/providers/google.js +19 -19
- package/dist/esm/llm/providers/google.js.map +1 -1
- package/dist/esm/llm/providers/models.js +30 -30
- package/dist/esm/llm/providers/models.js.map +1 -1
- package/dist/esm/llm/providers/openai.js +36 -35
- package/dist/esm/llm/providers/openai.js.map +1 -1
- package/dist/esm/llm/providers/shared.js +8 -8
- package/dist/esm/llm/providers/shared.js.map +1 -1
- package/dist/esm/llm/transcript-to-markdown.js +9 -5
- package/dist/esm/llm/transcript-to-markdown.js.map +1 -1
- package/dist/esm/llm/usage.js +18 -18
- package/dist/esm/llm/usage.js.map +1 -1
- package/dist/esm/logging/daemon.js +21 -21
- package/dist/esm/logging/daemon.js.map +1 -1
- package/dist/esm/logging/ring-file.js +5 -5
- package/dist/esm/logging/ring-file.js.map +1 -1
- package/dist/esm/markitdown.js +21 -19
- package/dist/esm/markitdown.js.map +1 -1
- package/dist/esm/media-cache.js +251 -0
- package/dist/esm/media-cache.js.map +1 -0
- package/dist/esm/model-auto.js +175 -106
- package/dist/esm/model-auto.js.map +1 -1
- package/dist/esm/model-spec.js +52 -42
- package/dist/esm/model-spec.js.map +1 -1
- package/dist/esm/pricing/litellm.js +4 -4
- package/dist/esm/pricing/litellm.js.map +1 -1
- package/dist/esm/processes.js +2 -0
- package/dist/esm/processes.js.map +1 -0
- package/dist/esm/prompts/index.js +1 -1
- package/dist/esm/prompts/index.js.map +1 -1
- package/dist/esm/refresh-free.js +81 -81
- package/dist/esm/refresh-free.js.map +1 -1
- package/dist/esm/run/attachments.js +47 -44
- package/dist/esm/run/attachments.js.map +1 -1
- package/dist/esm/run/bird.js +125 -12
- package/dist/esm/run/bird.js.map +1 -1
- package/dist/esm/run/cache-state.js +7 -7
- package/dist/esm/run/cache-state.js.map +1 -1
- package/dist/esm/run/cli-fallback-state.js +45 -0
- package/dist/esm/run/cli-fallback-state.js.map +1 -0
- package/dist/esm/run/cli-preflight.js +40 -22
- package/dist/esm/run/cli-preflight.js.map +1 -1
- package/dist/esm/run/constants.js +12 -12
- package/dist/esm/run/constants.js.map +1 -1
- package/dist/esm/run/cookies/twitter.js +47 -47
- package/dist/esm/run/cookies/twitter.js.map +1 -1
- package/dist/esm/run/env.js +21 -15
- package/dist/esm/run/env.js.map +1 -1
- package/dist/esm/run/fetch-with-timeout.js +4 -4
- package/dist/esm/run/fetch-with-timeout.js.map +1 -1
- package/dist/esm/run/finish-line.js +78 -71
- package/dist/esm/run/finish-line.js.map +1 -1
- package/dist/esm/run/flows/asset/extract.js +70 -0
- package/dist/esm/run/flows/asset/extract.js.map +1 -0
- package/dist/esm/run/flows/asset/input.js +202 -37
- package/dist/esm/run/flows/asset/input.js.map +1 -1
- package/dist/esm/run/flows/asset/media-policy.js +3 -0
- package/dist/esm/run/flows/asset/media-policy.js.map +1 -0
- package/dist/esm/run/flows/asset/media.js +233 -0
- package/dist/esm/run/flows/asset/media.js.map +1 -0
- package/dist/esm/run/flows/asset/output.js +98 -0
- package/dist/esm/run/flows/asset/output.js.map +1 -0
- package/dist/esm/run/flows/asset/preprocess.js +79 -44
- package/dist/esm/run/flows/asset/preprocess.js.map +1 -1
- package/dist/esm/run/flows/asset/summary.js +306 -89
- package/dist/esm/run/flows/asset/summary.js.map +1 -1
- package/dist/esm/run/flows/url/extract.js +31 -31
- package/dist/esm/run/flows/url/extract.js.map +1 -1
- package/dist/esm/run/flows/url/flow.js +388 -82
- package/dist/esm/run/flows/url/flow.js.map +1 -1
- package/dist/esm/run/flows/url/markdown.js +61 -56
- package/dist/esm/run/flows/url/markdown.js.map +1 -1
- package/dist/esm/run/flows/url/slides-output.js +487 -0
- package/dist/esm/run/flows/url/slides-output.js.map +1 -0
- package/dist/esm/run/flows/url/slides-text.js +628 -0
- package/dist/esm/run/flows/url/slides-text.js.map +1 -0
- package/dist/esm/run/flows/url/summary.js +493 -152
- package/dist/esm/run/flows/url/summary.js.map +1 -1
- package/dist/esm/run/format.js +10 -10
- package/dist/esm/run/format.js.map +1 -1
- package/dist/esm/run/help.js +179 -84
- package/dist/esm/run/help.js.map +1 -1
- package/dist/esm/run/logging.js +20 -12
- package/dist/esm/run/logging.js.map +1 -1
- package/dist/esm/run/markdown.js +12 -12
- package/dist/esm/run/markdown.js.map +1 -1
- package/dist/esm/run/media-cache-state.js +33 -0
- package/dist/esm/run/media-cache-state.js.map +1 -0
- package/dist/esm/run/model-attempts.js.map +1 -1
- package/dist/esm/run/openrouter.js +11 -11
- package/dist/esm/run/openrouter.js.map +1 -1
- package/dist/esm/run/progress.js +19 -1
- package/dist/esm/run/progress.js.map +1 -1
- package/dist/esm/run/run-config.js +16 -16
- package/dist/esm/run/run-config.js.map +1 -1
- package/dist/esm/run/run-context.js +2 -2
- package/dist/esm/run/run-context.js.map +1 -1
- package/dist/esm/run/run-env.js +55 -54
- package/dist/esm/run/run-env.js.map +1 -1
- package/dist/esm/run/run-input.js +3 -3
- package/dist/esm/run/run-input.js.map +1 -1
- package/dist/esm/run/run-metrics.js +16 -16
- package/dist/esm/run/run-metrics.js.map +1 -1
- package/dist/esm/run/run-models.js +28 -23
- package/dist/esm/run/run-models.js.map +1 -1
- package/dist/esm/run/run-output.js +3 -3
- package/dist/esm/run/run-output.js.map +1 -1
- package/dist/esm/run/run-settings.js +108 -21
- package/dist/esm/run/run-settings.js.map +1 -1
- package/dist/esm/run/run-stream.js +4 -4
- package/dist/esm/run/run-stream.js.map +1 -1
- package/dist/esm/run/runner.js +327 -100
- package/dist/esm/run/runner.js.map +1 -1
- package/dist/esm/run/slides-cli.js +226 -0
- package/dist/esm/run/slides-cli.js.map +1 -0
- package/dist/esm/run/slides-render.js +163 -0
- package/dist/esm/run/slides-render.js.map +1 -0
- package/dist/esm/run/stdin-temp-file.js +77 -0
- package/dist/esm/run/stdin-temp-file.js.map +1 -0
- package/dist/esm/run/stream-output.js +17 -10
- package/dist/esm/run/stream-output.js.map +1 -1
- package/dist/esm/run/streaming.js +16 -16
- package/dist/esm/run/streaming.js.map +1 -1
- package/dist/esm/run/summary-engine.js +89 -57
- package/dist/esm/run/summary-engine.js.map +1 -1
- package/dist/esm/run/summary-llm.js +3 -3
- package/dist/esm/run/summary-llm.js.map +1 -1
- package/dist/esm/run/terminal.js +4 -4
- package/dist/esm/run/terminal.js.map +1 -1
- package/dist/esm/run/tips.js +2 -2
- package/dist/esm/run/tips.js.map +1 -1
- package/dist/esm/run/transcriber-cli.js +148 -0
- package/dist/esm/run/transcriber-cli.js.map +1 -0
- package/dist/esm/run.js +1 -1
- package/dist/esm/run.js.map +1 -1
- package/dist/esm/shared/contracts.js +1 -1
- package/dist/esm/shared/contracts.js.map +1 -1
- package/dist/esm/shared/sse-events.js +16 -12
- package/dist/esm/shared/sse-events.js.map +1 -1
- package/dist/esm/shared/streaming-merge.js +3 -3
- package/dist/esm/shared/streaming-merge.js.map +1 -1
- package/dist/esm/slides/extract.js +1951 -0
- package/dist/esm/slides/extract.js.map +1 -0
- package/dist/esm/slides/index.js +4 -0
- package/dist/esm/slides/index.js.map +1 -0
- package/dist/esm/slides/settings.js +73 -0
- package/dist/esm/slides/settings.js.map +1 -0
- package/dist/esm/slides/store.js +111 -0
- package/dist/esm/slides/store.js.map +1 -0
- package/dist/esm/slides/types.js +2 -0
- package/dist/esm/slides/types.js.map +1 -0
- package/dist/esm/tty/format.js +13 -13
- package/dist/esm/tty/format.js.map +1 -1
- package/dist/esm/tty/osc-progress.js +22 -2
- package/dist/esm/tty/osc-progress.js.map +1 -1
- package/dist/esm/tty/progress/fetch-html.js +20 -16
- package/dist/esm/tty/progress/fetch-html.js.map +1 -1
- package/dist/esm/tty/progress/transcript.js +127 -68
- package/dist/esm/tty/progress/transcript.js.map +1 -1
- package/dist/esm/tty/spinner.js +21 -10
- package/dist/esm/tty/spinner.js.map +1 -1
- package/dist/esm/tty/theme.js +189 -0
- package/dist/esm/tty/theme.js.map +1 -0
- package/dist/esm/tty/website-progress.js +38 -34
- package/dist/esm/tty/website-progress.js.map +1 -1
- package/dist/esm/version.js +29 -29
- package/dist/esm/version.js.map +1 -1
- package/dist/types/cache.d.ts +19 -7
- package/dist/types/config.d.ts +71 -6
- package/dist/types/content/asset.d.ts +8 -6
- package/dist/types/content/index.d.ts +1 -1
- package/dist/types/costs.d.ts +3 -3
- package/dist/types/daemon/agent.d.ts +25 -0
- package/dist/types/daemon/auto-mode.d.ts +3 -3
- package/dist/types/daemon/chat.d.ts +10 -18
- package/dist/types/daemon/cli-entrypoint.d.ts +2 -0
- package/dist/types/daemon/config.d.ts +2 -2
- package/dist/types/daemon/env-merge.d.ts +1 -1
- package/dist/types/daemon/env-snapshot.d.ts +1 -1
- package/dist/types/daemon/flow-context.d.ts +24 -4
- package/dist/types/daemon/launchd.d.ts +12 -0
- package/dist/types/daemon/models.d.ts +6 -2
- package/dist/types/daemon/process-registry.d.ts +73 -0
- package/dist/types/daemon/schtasks.d.ts +4 -0
- package/dist/types/daemon/server.d.ts +2 -2
- package/dist/types/daemon/summarize-progress.d.ts +1 -1
- package/dist/types/daemon/summarize.d.ts +38 -7
- package/dist/types/daemon/systemd.d.ts +4 -0
- package/dist/types/firecrawl.d.ts +1 -1
- package/dist/types/flags.d.ts +12 -11
- package/dist/types/index.d.ts +4 -4
- package/dist/types/language.d.ts +1 -1
- package/dist/types/llm/attachments.d.ts +1 -1
- package/dist/types/llm/cli.d.ts +3 -3
- package/dist/types/llm/generate-text.d.ts +7 -7
- package/dist/types/llm/html-to-markdown.d.ts +3 -3
- package/dist/types/llm/model-id.d.ts +1 -1
- package/dist/types/llm/prompt.d.ts +2 -2
- package/dist/types/llm/providers/anthropic.d.ts +3 -3
- package/dist/types/llm/providers/google.d.ts +3 -3
- package/dist/types/llm/providers/models.d.ts +2 -2
- package/dist/types/llm/providers/openai.d.ts +4 -4
- package/dist/types/llm/providers/shared.d.ts +2 -2
- package/dist/types/llm/transcript-to-markdown.d.ts +4 -2
- package/dist/types/llm/usage.d.ts +1 -1
- package/dist/types/logging/daemon.d.ts +4 -4
- package/dist/types/markitdown.d.ts +1 -1
- package/dist/types/media-cache.d.ts +22 -0
- package/dist/types/model-auto.d.ts +14 -4
- package/dist/types/model-spec.d.ts +10 -10
- package/dist/types/pricing/litellm.d.ts +1 -1
- package/dist/types/processes.d.ts +1 -0
- package/dist/types/prompts/index.d.ts +1 -1
- package/dist/types/run/attachments.d.ts +7 -7
- package/dist/types/run/bird.d.ts +7 -0
- package/dist/types/run/cache-state.d.ts +2 -2
- package/dist/types/run/cli-fallback-state.d.ts +6 -0
- package/dist/types/run/constants.d.ts +1 -1
- package/dist/types/run/cookies/twitter.d.ts +1 -1
- package/dist/types/run/env.d.ts +1 -1
- package/dist/types/run/finish-line.d.ts +7 -6
- package/dist/types/run/flows/asset/extract.d.ts +18 -0
- package/dist/types/run/flows/asset/input.d.ts +19 -3
- package/dist/types/run/flows/asset/media-policy.d.ts +2 -0
- package/dist/types/run/flows/asset/media.d.ts +21 -0
- package/dist/types/run/flows/asset/output.d.ts +42 -0
- package/dist/types/run/flows/asset/preprocess.d.ts +23 -17
- package/dist/types/run/flows/asset/summary.d.ts +24 -16
- package/dist/types/run/flows/url/extract.d.ts +3 -2
- package/dist/types/run/flows/url/flow.d.ts +1 -1
- package/dist/types/run/flows/url/markdown.d.ts +6 -6
- package/dist/types/run/flows/url/slides-output.d.ts +66 -0
- package/dist/types/run/flows/url/slides-text.d.ts +87 -0
- package/dist/types/run/flows/url/summary.d.ts +18 -10
- package/dist/types/run/flows/url/types.d.ts +52 -21
- package/dist/types/run/format.d.ts +3 -3
- package/dist/types/run/help.d.ts +4 -1
- package/dist/types/run/logging.d.ts +3 -2
- package/dist/types/run/media-cache-state.d.ts +7 -0
- package/dist/types/run/model-attempts.d.ts +1 -1
- package/dist/types/run/progress.d.ts +2 -1
- package/dist/types/run/run-config.d.ts +4 -4
- package/dist/types/run/run-context.d.ts +3 -1
- package/dist/types/run/run-env.d.ts +3 -1
- package/dist/types/run/run-input.d.ts +2 -2
- package/dist/types/run/run-metrics.d.ts +3 -3
- package/dist/types/run/run-models.d.ts +3 -2
- package/dist/types/run/run-output.d.ts +1 -1
- package/dist/types/run/run-settings.d.ts +20 -5
- package/dist/types/run/run-stream.d.ts +2 -2
- package/dist/types/run/runner.d.ts +3 -2
- package/dist/types/run/slides-cli.d.ts +9 -0
- package/dist/types/run/slides-render.d.ts +30 -0
- package/dist/types/run/stdin-temp-file.d.ts +9 -0
- package/dist/types/run/stream-output.d.ts +3 -2
- package/dist/types/run/streaming.d.ts +4 -4
- package/dist/types/run/summary-engine.d.ts +22 -12
- package/dist/types/run/summary-llm.d.ts +5 -5
- package/dist/types/run/transcriber-cli.d.ts +8 -0
- package/dist/types/run/types.d.ts +4 -4
- package/dist/types/run.d.ts +1 -1
- package/dist/types/shared/contracts.d.ts +2 -2
- package/dist/types/shared/sse-events.d.ts +26 -6
- package/dist/types/slides/extract.d.ts +43 -0
- package/dist/types/slides/index.d.ts +5 -0
- package/dist/types/slides/settings.d.ts +20 -0
- package/dist/types/slides/store.d.ts +15 -0
- package/dist/types/slides/types.d.ts +40 -0
- package/dist/types/tty/osc-progress.d.ts +5 -5
- package/dist/types/tty/progress/fetch-html.d.ts +5 -3
- package/dist/types/tty/progress/transcript.d.ts +5 -3
- package/dist/types/tty/spinner.d.ts +3 -1
- package/dist/types/tty/theme.d.ts +44 -0
- package/dist/types/tty/website-progress.d.ts +5 -3
- package/dist/types/version.d.ts +1 -1
- package/docs/README.md +1 -1
- package/docs/_config.yml +26 -0
- package/docs/_layouts/default.html +60 -0
- package/docs/agent.md +367 -0
- package/docs/assets/site.css +748 -0
- package/docs/assets/site.js +72 -0
- package/docs/assets/summarize-cli.png +0 -0
- package/docs/assets/summarize-extension.png +0 -0
- package/docs/assets/youtube-slides.png +0 -0
- package/docs/cache.md +29 -3
- package/docs/chrome-extension.md +72 -16
- package/docs/cli.md +59 -13
- package/docs/config.md +109 -12
- package/docs/extract-only.md +10 -0
- package/docs/index.html +224 -0
- package/docs/index.md +25 -0
- package/docs/llm.md +18 -5
- package/docs/manual-tests.md +2 -0
- package/docs/media.md +6 -2
- package/docs/model-auto.md +3 -2
- package/docs/nvidia-onnx-transcription.md +55 -0
- package/docs/openai.md +1 -1
- package/docs/releasing.md +3 -0
- package/docs/site/404.html +4 -1
- package/docs/site/assets/site.css +399 -228
- package/docs/site/assets/site.js +46 -46
- package/docs/site/assets/summarize-cli.png +0 -0
- package/docs/site/assets/summarize-extension.png +0 -0
- package/docs/site/docs/chrome-extension.html +101 -0
- package/docs/site/docs/config.html +30 -8
- package/docs/site/docs/extract-only.html +17 -4
- package/docs/site/docs/firecrawl.html +13 -3
- package/docs/site/docs/index.html +40 -6
- package/docs/site/docs/llm.html +20 -5
- package/docs/site/docs/openai.html +19 -5
- package/docs/site/docs/website.html +30 -9
- package/docs/site/docs/youtube.html +13 -3
- package/docs/site/index.html +168 -85
- package/docs/slides.md +82 -0
- package/docs/smoketest.md +29 -20
- package/docs/timestamps.md +124 -0
- package/docs/website.md +13 -0
- package/docs/youtube.md +20 -0
- package/package.json +57 -48
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ExtractedLinkContent } from "../../../content/index.js";
|
|
2
|
+
import type { SummaryLength } from "../../../shared/contracts.js";
|
|
3
|
+
import type { SlideExtractionResult, SlideImage, SlideSourceKind } from "../../../slides/index.js";
|
|
4
|
+
import type { SummaryStreamHandler } from "../../summary-engine.js";
|
|
5
|
+
import { type StreamOutputMode } from "../../stream-output.js";
|
|
6
|
+
export type SlidesTerminalOutput = {
|
|
7
|
+
onSlidesExtracted: (slides: SlideExtractionResult) => void;
|
|
8
|
+
onSlidesDone: (result: {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
error?: string | null;
|
|
11
|
+
}) => void;
|
|
12
|
+
onSlideChunk: (chunk: {
|
|
13
|
+
slide: SlideImage;
|
|
14
|
+
meta: {
|
|
15
|
+
slidesDir: string;
|
|
16
|
+
sourceUrl: string;
|
|
17
|
+
sourceId: string;
|
|
18
|
+
sourceKind: SlideSourceKind;
|
|
19
|
+
ocrAvailable: boolean;
|
|
20
|
+
};
|
|
21
|
+
}) => void;
|
|
22
|
+
streamHandler: SummaryStreamHandler;
|
|
23
|
+
renderFromText: (summary: string) => Promise<void>;
|
|
24
|
+
};
|
|
25
|
+
export declare function createSlidesTerminalOutput({ io, flags, extracted, slides, enabled, outputMode, clearProgressForStdout, restoreProgressAfterStdout, onProgressText, }: {
|
|
26
|
+
io: {
|
|
27
|
+
env: Record<string, string | undefined>;
|
|
28
|
+
envForRun: Record<string, string | undefined>;
|
|
29
|
+
stdout: NodeJS.WritableStream;
|
|
30
|
+
stderr: NodeJS.WritableStream;
|
|
31
|
+
};
|
|
32
|
+
flags: {
|
|
33
|
+
plain: boolean;
|
|
34
|
+
lengthArg: {
|
|
35
|
+
kind: "preset";
|
|
36
|
+
preset: SummaryLength;
|
|
37
|
+
} | {
|
|
38
|
+
kind: "chars";
|
|
39
|
+
maxCharacters: number;
|
|
40
|
+
};
|
|
41
|
+
slidesDebug?: boolean;
|
|
42
|
+
};
|
|
43
|
+
extracted: ExtractedLinkContent;
|
|
44
|
+
slides: SlideExtractionResult | null | undefined;
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
outputMode?: StreamOutputMode | null;
|
|
47
|
+
clearProgressForStdout: () => void;
|
|
48
|
+
restoreProgressAfterStdout?: (() => void) | null;
|
|
49
|
+
onProgressText?: ((text: string) => void) | null;
|
|
50
|
+
}): SlidesTerminalOutput | null;
|
|
51
|
+
export declare function createSlidesSummaryStreamHandler({ stdout, env, envForRun, plain, outputMode, clearProgressForStdout, restoreProgressAfterStdout, renderSlide, getSlideIndexOrder, getSlideMeta, debugWrite, }: {
|
|
52
|
+
stdout: NodeJS.WritableStream;
|
|
53
|
+
env: Record<string, string | undefined>;
|
|
54
|
+
envForRun: Record<string, string | undefined>;
|
|
55
|
+
plain: boolean;
|
|
56
|
+
outputMode: StreamOutputMode;
|
|
57
|
+
clearProgressForStdout: () => void;
|
|
58
|
+
restoreProgressAfterStdout?: (() => void) | null;
|
|
59
|
+
renderSlide: (index: number, title?: string | null) => Promise<void>;
|
|
60
|
+
getSlideIndexOrder: () => number[];
|
|
61
|
+
getSlideMeta?: ((index: number) => {
|
|
62
|
+
total: number;
|
|
63
|
+
timestamp: number | null;
|
|
64
|
+
}) | null;
|
|
65
|
+
debugWrite?: ((text: string) => void) | null;
|
|
66
|
+
}): SummaryStreamHandler;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { SummaryLength } from "../../../shared/contracts.js";
|
|
2
|
+
export type TranscriptSegment = {
|
|
3
|
+
startSeconds: number;
|
|
4
|
+
text: string;
|
|
5
|
+
};
|
|
6
|
+
export type SlideTimelineEntry = {
|
|
7
|
+
index: number;
|
|
8
|
+
timestamp: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const splitSlideTitleFromText: ({ text, }: {
|
|
11
|
+
text: string;
|
|
12
|
+
slideIndex: number;
|
|
13
|
+
total: number;
|
|
14
|
+
}) => {
|
|
15
|
+
title: string | null;
|
|
16
|
+
body: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const ensureSlideTitleLine: ({ text, slide, total, }: {
|
|
19
|
+
text: string;
|
|
20
|
+
slide: SlideTimelineEntry;
|
|
21
|
+
total: number;
|
|
22
|
+
}) => string;
|
|
23
|
+
export declare function findSlidesSectionStart(markdown: string): number | null;
|
|
24
|
+
export declare function splitSummaryFromSlides(markdown: string): {
|
|
25
|
+
summary: string;
|
|
26
|
+
slidesSection: string | null;
|
|
27
|
+
};
|
|
28
|
+
export declare function parseSlideSummariesFromMarkdown(markdown: string): Map<number, string>;
|
|
29
|
+
export declare function extractSlideMarkers(markdown: string): number[];
|
|
30
|
+
export declare function normalizeSummarySlideHeadings(markdown: string): string;
|
|
31
|
+
export declare function buildSlideTextFallback({ slides, transcriptTimedText, lengthArg, }: {
|
|
32
|
+
slides: SlideTimelineEntry[];
|
|
33
|
+
transcriptTimedText: string | null | undefined;
|
|
34
|
+
lengthArg: {
|
|
35
|
+
kind: "preset";
|
|
36
|
+
preset: SummaryLength;
|
|
37
|
+
} | {
|
|
38
|
+
kind: "chars";
|
|
39
|
+
maxCharacters: number;
|
|
40
|
+
};
|
|
41
|
+
}): Map<number, string>;
|
|
42
|
+
export declare function coerceSummaryWithSlides({ markdown, slides, transcriptTimedText, lengthArg, }: {
|
|
43
|
+
markdown: string;
|
|
44
|
+
slides: SlideTimelineEntry[];
|
|
45
|
+
transcriptTimedText?: string | null;
|
|
46
|
+
lengthArg: {
|
|
47
|
+
kind: "preset";
|
|
48
|
+
preset: SummaryLength;
|
|
49
|
+
} | {
|
|
50
|
+
kind: "chars";
|
|
51
|
+
maxCharacters: number;
|
|
52
|
+
};
|
|
53
|
+
}): string;
|
|
54
|
+
export declare function interleaveSlidesIntoTranscript({ transcriptTimedText, slides, }: {
|
|
55
|
+
transcriptTimedText: string;
|
|
56
|
+
slides: SlideTimelineEntry[];
|
|
57
|
+
}): string;
|
|
58
|
+
export declare function parseTranscriptTimedText(input: string | null | undefined): TranscriptSegment[];
|
|
59
|
+
export declare function formatTimestamp(seconds: number): string;
|
|
60
|
+
export declare function resolveSlideTextBudget({ lengthArg, slideCount, }: {
|
|
61
|
+
lengthArg: {
|
|
62
|
+
kind: "preset";
|
|
63
|
+
preset: SummaryLength;
|
|
64
|
+
} | {
|
|
65
|
+
kind: "chars";
|
|
66
|
+
maxCharacters: number;
|
|
67
|
+
};
|
|
68
|
+
slideCount: number;
|
|
69
|
+
}): number;
|
|
70
|
+
export declare function resolveSlideWindowSeconds({ lengthArg, }: {
|
|
71
|
+
lengthArg: {
|
|
72
|
+
kind: "preset";
|
|
73
|
+
preset: SummaryLength;
|
|
74
|
+
} | {
|
|
75
|
+
kind: "chars";
|
|
76
|
+
maxCharacters: number;
|
|
77
|
+
};
|
|
78
|
+
}): number;
|
|
79
|
+
export declare function getTranscriptTextForSlide({ slide, nextSlide, segments, budget, windowSeconds, }: {
|
|
80
|
+
slide: SlideTimelineEntry;
|
|
81
|
+
nextSlide: SlideTimelineEntry | null;
|
|
82
|
+
segments: TranscriptSegment[];
|
|
83
|
+
budget: number;
|
|
84
|
+
windowSeconds: number;
|
|
85
|
+
}): string;
|
|
86
|
+
export declare function formatOsc8Link(label: string, url: string | null, enabled: boolean): string;
|
|
87
|
+
export declare function buildTimestampUrl(sourceUrl: string, seconds: number): string | null;
|
|
@@ -1,30 +1,38 @@
|
|
|
1
|
-
import type { ExtractedLinkContent } from
|
|
2
|
-
import type { UrlExtractionUi } from
|
|
3
|
-
import type {
|
|
4
|
-
|
|
1
|
+
import type { ExtractedLinkContent } from "../../../content/index.js";
|
|
2
|
+
import type { UrlExtractionUi } from "./extract.js";
|
|
3
|
+
import type { SlidesTerminalOutput } from "./slides-output.js";
|
|
4
|
+
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, }: {
|
|
5
7
|
extracted: ExtractedLinkContent;
|
|
6
|
-
outputLanguage: UrlFlowContext[
|
|
7
|
-
lengthArg: UrlFlowContext[
|
|
8
|
+
outputLanguage: UrlFlowContext["flags"]["outputLanguage"];
|
|
9
|
+
lengthArg: UrlFlowContext["flags"]["lengthArg"];
|
|
8
10
|
promptOverride?: string | null;
|
|
9
11
|
lengthInstruction?: string | null;
|
|
10
12
|
languageInstruction?: string | null;
|
|
13
|
+
slides?: SlidesResult | null;
|
|
11
14
|
}): string;
|
|
12
|
-
export declare function outputExtractedUrl({ ctx, url, extracted, extractionUi, prompt, effectiveMarkdownMode, transcriptionCostLabel, }: {
|
|
15
|
+
export declare function outputExtractedUrl({ ctx, url, extracted, extractionUi, prompt, effectiveMarkdownMode, transcriptionCostLabel, slides, slidesOutput, }: {
|
|
13
16
|
ctx: UrlFlowContext;
|
|
14
17
|
url: string;
|
|
15
18
|
extracted: ExtractedLinkContent;
|
|
16
19
|
extractionUi: UrlExtractionUi;
|
|
17
20
|
prompt: string;
|
|
18
|
-
effectiveMarkdownMode:
|
|
21
|
+
effectiveMarkdownMode: "off" | "auto" | "llm" | "readability";
|
|
19
22
|
transcriptionCostLabel: string | null;
|
|
23
|
+
slides?: Awaited<ReturnType<typeof import("../../../slides/index.js").extractSlidesForSource>> | null;
|
|
24
|
+
slidesOutput?: SlidesTerminalOutput | null;
|
|
20
25
|
}): Promise<void>;
|
|
21
|
-
export declare function summarizeExtractedUrl({ ctx, url, extracted, extractionUi, prompt, effectiveMarkdownMode, transcriptionCostLabel, onModelChosen, }: {
|
|
26
|
+
export declare function summarizeExtractedUrl({ ctx, url, extracted, extractionUi, prompt, effectiveMarkdownMode, transcriptionCostLabel, onModelChosen, slides, slidesOutput, }: {
|
|
22
27
|
ctx: UrlFlowContext;
|
|
23
28
|
url: string;
|
|
24
29
|
extracted: ExtractedLinkContent;
|
|
25
30
|
extractionUi: UrlExtractionUi;
|
|
26
31
|
prompt: string;
|
|
27
|
-
effectiveMarkdownMode:
|
|
32
|
+
effectiveMarkdownMode: "off" | "auto" | "llm" | "readability";
|
|
28
33
|
transcriptionCostLabel: string | null;
|
|
29
34
|
onModelChosen?: ((modelId: string) => void) | null;
|
|
35
|
+
slides?: Awaited<ReturnType<typeof import("../../../slides/index.js").extractSlidesForSource>> | null;
|
|
36
|
+
slidesOutput?: SlidesTerminalOutput | null;
|
|
30
37
|
}): Promise<void>;
|
|
38
|
+
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import type { CacheState } from
|
|
2
|
-
import type { SummarizeConfig } from
|
|
3
|
-
import type { ExtractedLinkContent, LinkPreviewProgressEvent } from
|
|
4
|
-
import type { LlmCall, RunMetricsReport } from
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
1
|
+
import type { CacheState } from "../../../cache.js";
|
|
2
|
+
import type { CliProvider, SummarizeConfig } from "../../../config.js";
|
|
3
|
+
import type { ExtractedLinkContent, LinkPreviewProgressEvent, MediaCache } from "../../../content/index.js";
|
|
4
|
+
import type { LlmCall, RunMetricsReport } from "../../../costs.js";
|
|
5
|
+
import type { StreamMode } from "../../../flags.js";
|
|
6
|
+
import type { OutputLanguage } from "../../../language.js";
|
|
7
|
+
import type { ExecFileFn } from "../../../markitdown.js";
|
|
8
|
+
import type { FixedModelSpec, RequestedModel } from "../../../model-spec.js";
|
|
9
|
+
import type { SummaryLength } from "../../../shared/contracts.js";
|
|
10
|
+
import type { SlideExtractionResult, SlideImage, SlideSettings, SlideSourceKind } from "../../../slides/index.js";
|
|
11
|
+
import type { createSummaryEngine } from "../../summary-engine.js";
|
|
12
|
+
import type { SummarizeAssetArgs } from "../asset/summary.js";
|
|
11
13
|
export type UrlFlowIo = {
|
|
12
14
|
env: Record<string, string | undefined>;
|
|
13
15
|
envForRun: Record<string, string | undefined>;
|
|
@@ -20,23 +22,26 @@ export type UrlFlowFlags = {
|
|
|
20
22
|
timeoutMs: number;
|
|
21
23
|
maxExtractCharacters?: number | null;
|
|
22
24
|
retries: number;
|
|
23
|
-
format:
|
|
24
|
-
markdownMode:
|
|
25
|
-
preprocessMode:
|
|
26
|
-
youtubeMode:
|
|
27
|
-
firecrawlMode:
|
|
28
|
-
videoMode:
|
|
25
|
+
format: "text" | "markdown";
|
|
26
|
+
markdownMode: "off" | "auto" | "llm" | "readability";
|
|
27
|
+
preprocessMode: "off" | "auto" | "always";
|
|
28
|
+
youtubeMode: "auto" | "web" | "yt-dlp" | "apify" | "no-auto";
|
|
29
|
+
firecrawlMode: "off" | "auto" | "always";
|
|
30
|
+
videoMode: "auto" | "transcript" | "understand";
|
|
31
|
+
transcriptTimestamps: boolean;
|
|
29
32
|
outputLanguage: OutputLanguage;
|
|
30
33
|
lengthArg: {
|
|
31
|
-
kind:
|
|
34
|
+
kind: "preset";
|
|
32
35
|
preset: SummaryLength;
|
|
33
36
|
} | {
|
|
34
|
-
kind:
|
|
37
|
+
kind: "chars";
|
|
35
38
|
maxCharacters: number;
|
|
36
39
|
};
|
|
40
|
+
forceSummary: boolean;
|
|
37
41
|
promptOverride?: string | null;
|
|
38
42
|
lengthInstruction?: string | null;
|
|
39
43
|
languageInstruction?: string | null;
|
|
44
|
+
summaryCacheBypass: boolean;
|
|
40
45
|
maxOutputTokensArg: number | null;
|
|
41
46
|
json: boolean;
|
|
42
47
|
extractMode: boolean;
|
|
@@ -47,10 +52,14 @@ export type UrlFlowFlags = {
|
|
|
47
52
|
verbose: boolean;
|
|
48
53
|
verboseColor: boolean;
|
|
49
54
|
progressEnabled: boolean;
|
|
55
|
+
streamMode: StreamMode;
|
|
50
56
|
streamingEnabled: boolean;
|
|
51
57
|
plain: boolean;
|
|
52
58
|
configPath: string | null;
|
|
53
59
|
configModelLabel: string | null;
|
|
60
|
+
slides: SlideSettings | null;
|
|
61
|
+
slidesDebug: boolean;
|
|
62
|
+
slidesOutput?: boolean;
|
|
54
63
|
};
|
|
55
64
|
export type UrlFlowModel = {
|
|
56
65
|
requestedModel: RequestedModel;
|
|
@@ -58,12 +67,14 @@ export type UrlFlowModel = {
|
|
|
58
67
|
requestedModelLabel: string;
|
|
59
68
|
fixedModelSpec: FixedModelSpec | null;
|
|
60
69
|
isFallbackModel: boolean;
|
|
70
|
+
isImplicitAutoSelection: boolean;
|
|
71
|
+
allowAutoCliFallback: boolean;
|
|
61
72
|
isNamedModelSelection: boolean;
|
|
62
73
|
wantsFreeNamedModel: boolean;
|
|
63
74
|
desiredOutputTokens: number | null;
|
|
64
75
|
configForModelSelection: SummarizeConfig | null;
|
|
65
76
|
envForAuto: Record<string, string | undefined>;
|
|
66
|
-
cliAvailability: Partial<Record<
|
|
77
|
+
cliAvailability: Partial<Record<CliProvider, boolean>>;
|
|
67
78
|
openaiUseChatCompletions: boolean;
|
|
68
79
|
openaiWhisperUsdPerMinute: number;
|
|
69
80
|
apiStatus: {
|
|
@@ -87,23 +98,42 @@ export type UrlFlowModel = {
|
|
|
87
98
|
firecrawlApiKey: string | null;
|
|
88
99
|
apifyToken: string | null;
|
|
89
100
|
ytDlpPath: string | null;
|
|
101
|
+
ytDlpCookiesFromBrowser: string | null;
|
|
90
102
|
falApiKey: string | null;
|
|
103
|
+
groqApiKey: string | null;
|
|
91
104
|
openaiTranscriptionKey: string | null;
|
|
92
105
|
};
|
|
93
106
|
summaryEngine: ReturnType<typeof createSummaryEngine>;
|
|
94
|
-
getLiteLlmCatalog: () => Promise<Awaited<ReturnType<typeof import(
|
|
107
|
+
getLiteLlmCatalog: () => Promise<Awaited<ReturnType<typeof import("../../../pricing/litellm.js").loadLiteLlmCatalog>>["catalog"]>;
|
|
95
108
|
llmCalls: LlmCall[];
|
|
96
109
|
};
|
|
97
110
|
export type UrlFlowHooks = {
|
|
98
111
|
onModelChosen?: ((modelId: string) => void) | null;
|
|
99
112
|
onExtracted?: ((extracted: ExtractedLinkContent) => void) | null;
|
|
113
|
+
onSlidesExtracted?: ((slides: SlideExtractionResult) => void) | null;
|
|
114
|
+
onSlidesProgress?: ((text: string) => void) | null;
|
|
115
|
+
onSlidesDone?: ((result: {
|
|
116
|
+
ok: boolean;
|
|
117
|
+
error?: string | null;
|
|
118
|
+
}) => void) | null;
|
|
119
|
+
onSlideChunk?: (chunk: {
|
|
120
|
+
slide: SlideImage;
|
|
121
|
+
meta: {
|
|
122
|
+
slidesDir: string;
|
|
123
|
+
sourceUrl: string;
|
|
124
|
+
sourceId: string;
|
|
125
|
+
sourceKind: SlideSourceKind;
|
|
126
|
+
ocrAvailable: boolean;
|
|
127
|
+
};
|
|
128
|
+
}) => void;
|
|
100
129
|
onLinkPreviewProgress?: ((event: LinkPreviewProgressEvent) => void) | null;
|
|
101
130
|
onSummaryCached?: ((cached: boolean) => void) | null;
|
|
102
131
|
setTranscriptionCost: (costUsd: number | null, label: string | null) => void;
|
|
103
132
|
summarizeAsset: (args: SummarizeAssetArgs) => Promise<void>;
|
|
104
133
|
writeViaFooter: (parts: string[]) => void;
|
|
105
134
|
clearProgressForStdout: () => void;
|
|
106
|
-
|
|
135
|
+
restoreProgressAfterStdout?: (() => void) | null;
|
|
136
|
+
setClearProgressBeforeStdout: (fn: (() => undefined | (() => void)) | null) => void;
|
|
107
137
|
clearProgressIfCurrent: (fn: () => void) => void;
|
|
108
138
|
buildReport: () => Promise<RunMetricsReport>;
|
|
109
139
|
estimateCostUsd: () => Promise<number | null>;
|
|
@@ -118,5 +148,6 @@ export type UrlFlowContext = {
|
|
|
118
148
|
flags: UrlFlowFlags;
|
|
119
149
|
model: UrlFlowModel;
|
|
120
150
|
cache: CacheState;
|
|
151
|
+
mediaCache: MediaCache | null;
|
|
121
152
|
hooks: UrlFlowHooks;
|
|
122
153
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SummaryLength } from
|
|
1
|
+
import type { SummaryLength } from "../shared/contracts.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;
|
|
@@ -10,9 +10,9 @@ export declare function estimateWhisperTranscriptionCostUsd({ transcriptionProvi
|
|
|
10
10
|
openaiWhisperUsdPerMinute: number;
|
|
11
11
|
}): number | null;
|
|
12
12
|
export declare function resolveTargetCharacters(lengthArg: {
|
|
13
|
-
kind:
|
|
13
|
+
kind: "preset";
|
|
14
14
|
preset: SummaryLength;
|
|
15
15
|
} | {
|
|
16
|
-
kind:
|
|
16
|
+
kind: "chars";
|
|
17
17
|
maxCharacters: number;
|
|
18
18
|
}, maxMap: Record<SummaryLength, number>): number;
|
package/dist/types/run/help.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { Command } from
|
|
1
|
+
import { Command } from "commander";
|
|
2
2
|
export declare function buildProgram(): Command;
|
|
3
|
+
export declare function applyHelpStyle(program: Command, env: Record<string, string | undefined>, stdout: NodeJS.WritableStream): void;
|
|
4
|
+
export declare function buildSlidesProgram(): Command;
|
|
3
5
|
export declare function attachRichHelp(program: Command, env: Record<string, string | undefined>, stdout: NodeJS.WritableStream): void;
|
|
4
6
|
export declare function buildConciseHelp(): string;
|
|
5
7
|
export declare function buildRefreshFreeHelp(): string;
|
|
6
8
|
export declare function buildDaemonHelp(): string;
|
|
9
|
+
export declare function buildTranscriberHelp(): string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export declare function writeVerbose(stderr: NodeJS.WritableStream, verbose: boolean, message: string, color: boolean): void;
|
|
2
|
-
export declare function createRetryLogger({ stderr, verbose, color, modelId, }: {
|
|
1
|
+
export declare function writeVerbose(stderr: NodeJS.WritableStream, verbose: boolean, message: string, color: boolean, env?: Record<string, string | undefined>): void;
|
|
2
|
+
export declare function createRetryLogger({ stderr, verbose, color, modelId, env, }: {
|
|
3
3
|
stderr: NodeJS.WritableStream;
|
|
4
4
|
verbose: boolean;
|
|
5
5
|
color: boolean;
|
|
6
6
|
modelId: string;
|
|
7
|
+
env?: Record<string, string | undefined>;
|
|
7
8
|
}): (notice: {
|
|
8
9
|
attempt: number;
|
|
9
10
|
maxRetries: number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SummarizeConfig } from "../config.js";
|
|
2
|
+
import type { MediaCache } from "../content/index.js";
|
|
3
|
+
export declare function createMediaCacheFromConfig({ envForRun, config, noMediaCacheFlag, }: {
|
|
4
|
+
envForRun: Record<string, string | undefined>;
|
|
5
|
+
config: SummarizeConfig | null;
|
|
6
|
+
noMediaCacheFlag?: boolean;
|
|
7
|
+
}): Promise<MediaCache | null>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ModelAttempt, ModelAttemptRequiredEnv } from
|
|
1
|
+
import type { ModelAttempt, ModelAttemptRequiredEnv } from "./types.js";
|
|
2
2
|
export declare function runModelAttempts<T>({ attempts, isFallbackModel, isNamedModelSelection, envHasKeyFor, formatMissingModelError, onAutoSkip, onAutoFailure, onFixedModelError, runAttempt, }: {
|
|
3
3
|
attempts: ModelAttempt[];
|
|
4
4
|
isFallbackModel: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type ProgressGate = {
|
|
2
|
-
setClearProgressBeforeStdout: (fn: (() => void) | null) => void;
|
|
2
|
+
setClearProgressBeforeStdout: (fn: (() => undefined | (() => void)) | null) => void;
|
|
3
3
|
clearProgressForStdout: () => void;
|
|
4
|
+
restoreProgressAfterStdout: () => void;
|
|
4
5
|
clearProgressIfCurrent: (fn: () => void) => void;
|
|
5
6
|
};
|
|
6
7
|
export declare function createProgressGate(): ProgressGate;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { CliProvider, SummarizeConfig } from
|
|
2
|
-
import { parseVideoMode } from
|
|
3
|
-
import { type OutputLanguage } from
|
|
1
|
+
import type { CliProvider, SummarizeConfig } from "../config.js";
|
|
2
|
+
import { parseVideoMode } from "../flags.js";
|
|
3
|
+
import { type OutputLanguage } from "../language.js";
|
|
4
4
|
export type ConfigState = {
|
|
5
5
|
config: SummarizeConfig | null;
|
|
6
6
|
configPath: string | null;
|
|
7
7
|
outputLanguage: OutputLanguage;
|
|
8
8
|
openaiWhisperUsdPerMinute: number;
|
|
9
9
|
videoMode: ReturnType<typeof parseVideoMode>;
|
|
10
|
-
cliConfigForRun: SummarizeConfig[
|
|
10
|
+
cliConfigForRun: SummarizeConfig["cli"] | undefined;
|
|
11
11
|
configForCli: SummarizeConfig | null;
|
|
12
12
|
openaiUseChatCompletions: boolean;
|
|
13
13
|
configModelLabel: string | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CliProvider } from
|
|
1
|
+
import type { CliProvider } from "../config.js";
|
|
2
2
|
export declare function resolveRunContextState({ env, envForRun, programOpts, languageExplicitlySet, videoModeExplicitlySet, cliFlagPresent, cliProviderArg, }: {
|
|
3
3
|
env: Record<string, string | undefined>;
|
|
4
4
|
envForRun: Record<string, string | undefined>;
|
|
@@ -11,6 +11,7 @@ export declare function resolveRunContextState({ env, envForRun, programOpts, la
|
|
|
11
11
|
apiKey: string | null;
|
|
12
12
|
openrouterApiKey: string | null;
|
|
13
13
|
openrouterConfigured: boolean;
|
|
14
|
+
groqApiKey: string | null;
|
|
14
15
|
openaiTranscriptionKey: string | null;
|
|
15
16
|
xaiApiKey: string | null;
|
|
16
17
|
googleApiKey: string | null;
|
|
@@ -23,6 +24,7 @@ export declare function resolveRunContextState({ env, envForRun, programOpts, la
|
|
|
23
24
|
anthropicConfigured: boolean;
|
|
24
25
|
apifyToken: string | null;
|
|
25
26
|
ytDlpPath: string | null;
|
|
27
|
+
ytDlpCookiesFromBrowser: string | null;
|
|
26
28
|
falApiKey: string | null;
|
|
27
29
|
cliAvailability: Partial<Record<CliProvider, boolean>>;
|
|
28
30
|
envForAuto: Record<string, string | undefined>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { CliProvider, SummarizeConfig } from
|
|
1
|
+
import type { CliProvider, SummarizeConfig } from "../config.js";
|
|
2
2
|
export type EnvState = {
|
|
3
3
|
apiKey: string | null;
|
|
4
4
|
openrouterApiKey: string | null;
|
|
5
5
|
openrouterConfigured: boolean;
|
|
6
|
+
groqApiKey: string | null;
|
|
6
7
|
openaiTranscriptionKey: string | null;
|
|
7
8
|
xaiApiKey: string | null;
|
|
8
9
|
googleApiKey: string | null;
|
|
@@ -15,6 +16,7 @@ export type EnvState = {
|
|
|
15
16
|
anthropicConfigured: boolean;
|
|
16
17
|
apifyToken: string | null;
|
|
17
18
|
ytDlpPath: string | null;
|
|
19
|
+
ytDlpCookiesFromBrowser: string | null;
|
|
18
20
|
falApiKey: string | null;
|
|
19
21
|
cliAvailability: Partial<Record<CliProvider, boolean>>;
|
|
20
22
|
envForAuto: Record<string, string | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Command } from
|
|
2
|
-
import type { InputTarget } from
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { InputTarget } from "../content/asset.js";
|
|
3
3
|
export type InputResolution = {
|
|
4
4
|
inputTarget: InputTarget;
|
|
5
5
|
url: string | null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { LlmCall, RunMetricsReport } from
|
|
2
|
-
import { loadLiteLlmCatalog } from
|
|
1
|
+
import type { LlmCall, RunMetricsReport } from "../costs.js";
|
|
2
|
+
import { loadLiteLlmCatalog } from "../pricing/litellm.js";
|
|
3
3
|
export type RunMetrics = {
|
|
4
4
|
llmCalls: LlmCall[];
|
|
5
5
|
trackedFetch: typeof fetch;
|
|
6
6
|
buildReport: () => Promise<RunMetricsReport>;
|
|
7
7
|
estimateCostUsd: () => Promise<number | null>;
|
|
8
|
-
getLiteLlmCatalog: () => Promise<Awaited<ReturnType<typeof loadLiteLlmCatalog>>[
|
|
8
|
+
getLiteLlmCatalog: () => Promise<Awaited<ReturnType<typeof loadLiteLlmCatalog>>["catalog"]>;
|
|
9
9
|
resolveMaxOutputTokensForCall: (modelId: string) => Promise<number | null>;
|
|
10
10
|
resolveMaxInputTokensForCall: (modelId: string) => Promise<number | null>;
|
|
11
11
|
setTranscriptionCost: (costUsd: number | null, label: string | null) => void;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { SummarizeConfig } from
|
|
2
|
-
import type { RequestedModel } from
|
|
1
|
+
import type { SummarizeConfig } from "../config.js";
|
|
2
|
+
import type { RequestedModel } from "../model-spec.js";
|
|
3
3
|
export type ModelSelection = {
|
|
4
4
|
requestedModel: RequestedModel;
|
|
5
5
|
requestedModelInput: string;
|
|
6
6
|
requestedModelLabel: string;
|
|
7
7
|
isNamedModelSelection: boolean;
|
|
8
|
+
isImplicitAutoSelection: boolean;
|
|
8
9
|
wantsFreeNamedModel: boolean;
|
|
9
10
|
configForModelSelection: SummarizeConfig | null;
|
|
10
11
|
isFallbackModel: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { CliProvider } from "../config.js";
|
|
2
|
+
import type { FirecrawlMode, LengthArg, MarkdownMode, PreprocessMode, VideoMode, YoutubeMode } from "../flags.js";
|
|
3
|
+
import type { OutputLanguage } from "../language.js";
|
|
4
|
+
import type { SummaryLengthTarget } from "../prompts/index.js";
|
|
4
5
|
export type ResolvedRunSettings = {
|
|
5
6
|
lengthArg: LengthArg;
|
|
6
7
|
firecrawlMode: FirecrawlMode;
|
|
@@ -17,9 +18,14 @@ export type RunOverrides = {
|
|
|
17
18
|
preprocessMode: PreprocessMode | null;
|
|
18
19
|
youtubeMode: YoutubeMode | null;
|
|
19
20
|
videoMode: VideoMode | null;
|
|
21
|
+
transcriptTimestamps: boolean | null;
|
|
22
|
+
forceSummary: boolean | null;
|
|
20
23
|
timeoutMs: number | null;
|
|
21
24
|
retries: number | null;
|
|
22
25
|
maxOutputTokensArg: number | null;
|
|
26
|
+
transcriber: "auto" | "whisper" | "parakeet" | "canary" | null;
|
|
27
|
+
autoCliFallbackEnabled: boolean | null;
|
|
28
|
+
autoCliOrder: CliProvider[] | null;
|
|
23
29
|
};
|
|
24
30
|
export type RunOverridesInput = {
|
|
25
31
|
firecrawl?: unknown;
|
|
@@ -27,9 +33,18 @@ export type RunOverridesInput = {
|
|
|
27
33
|
preprocess?: unknown;
|
|
28
34
|
youtube?: unknown;
|
|
29
35
|
videoMode?: unknown;
|
|
36
|
+
timestamps?: unknown;
|
|
37
|
+
forceSummary?: unknown;
|
|
30
38
|
timeout?: unknown;
|
|
31
39
|
retries?: unknown;
|
|
32
40
|
maxOutputTokens?: unknown;
|
|
41
|
+
transcriber?: unknown;
|
|
42
|
+
autoCliFallback?: unknown;
|
|
43
|
+
autoCliOrder?: unknown;
|
|
44
|
+
autoCliRememberLastSuccess?: unknown;
|
|
45
|
+
magicCliAuto?: unknown;
|
|
46
|
+
magicCliOrder?: unknown;
|
|
47
|
+
magicCliRememberLastSuccess?: unknown;
|
|
33
48
|
};
|
|
34
49
|
export declare function resolveSummaryLength(raw: unknown, fallback?: string): {
|
|
35
50
|
lengthArg: LengthArg;
|
|
@@ -44,13 +59,13 @@ export declare function resolveCliRunSettings({ length, firecrawl, markdownMode,
|
|
|
44
59
|
firecrawl: string;
|
|
45
60
|
markdownMode?: string | undefined;
|
|
46
61
|
markdown?: string | undefined;
|
|
47
|
-
format:
|
|
62
|
+
format: "text" | "markdown";
|
|
48
63
|
preprocess: string;
|
|
49
64
|
youtube: string;
|
|
50
65
|
timeout: string;
|
|
51
66
|
retries: string;
|
|
52
67
|
maxOutputTokens?: string | undefined;
|
|
53
68
|
}): ResolvedRunSettings;
|
|
54
|
-
export declare function resolveRunOverrides({ firecrawl, markdownMode, preprocess, youtube, videoMode, timeout, retries, maxOutputTokens, }: RunOverridesInput, options?: {
|
|
69
|
+
export declare function resolveRunOverrides({ firecrawl, markdownMode, preprocess, youtube, videoMode, timestamps, forceSummary, timeout, retries, maxOutputTokens, transcriber, autoCliFallback, autoCliOrder, autoCliRememberLastSuccess, magicCliAuto, magicCliOrder, magicCliRememberLastSuccess, }: RunOverridesInput, options?: {
|
|
55
70
|
strict?: boolean;
|
|
56
71
|
}): RunOverrides;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { StreamMode } from
|
|
1
|
+
import type { StreamMode } from "../flags.js";
|
|
2
2
|
export type StreamSettings = {
|
|
3
|
-
effectiveStreamMode:
|
|
3
|
+
effectiveStreamMode: "on" | "off";
|
|
4
4
|
streamingEnabled: boolean;
|
|
5
5
|
};
|
|
6
6
|
export declare function resolveStreamSettings({ streamMode, stdout, json, extractMode, }: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { ExecFileFn } from
|
|
1
|
+
import type { ExecFileFn } from "../markitdown.js";
|
|
2
2
|
type RunEnv = {
|
|
3
3
|
env: Record<string, string | undefined>;
|
|
4
4
|
fetch: typeof fetch;
|
|
5
5
|
execFile?: ExecFileFn;
|
|
6
|
+
stdin?: NodeJS.ReadableStream;
|
|
6
7
|
stdout: NodeJS.WritableStream;
|
|
7
8
|
stderr: NodeJS.WritableStream;
|
|
8
9
|
};
|
|
9
|
-
export declare function runCli(argv: string[], { env, fetch, execFile: execFileOverride, stdout, stderr }: RunEnv): Promise<void>;
|
|
10
|
+
export declare function runCli(argv: string[], { env: inputEnv, fetch, execFile: execFileOverride, stdin, stdout, stderr }: RunEnv): Promise<void>;
|
|
10
11
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type SlidesCliContext = {
|
|
2
|
+
normalizedArgv: string[];
|
|
3
|
+
envForRun: Record<string, string | undefined>;
|
|
4
|
+
fetchImpl: typeof fetch;
|
|
5
|
+
stdout: NodeJS.WritableStream;
|
|
6
|
+
stderr: NodeJS.WritableStream;
|
|
7
|
+
};
|
|
8
|
+
export declare function handleSlidesCliRequest({ normalizedArgv, envForRun, stdout, stderr, }: SlidesCliContext): Promise<boolean>;
|
|
9
|
+
export {};
|