@steipete/summarize 0.10.0 → 0.11.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 +80 -28
- package/README.md +115 -30
- package/dist/cli.js +1 -1
- package/dist/esm/cache.js +67 -65
- 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 +310 -166
- 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 +165 -164
- package/dist/esm/daemon/agent.js.map +1 -1
- 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 +16 -14
- 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 +63 -87
- 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 -31
- package/dist/esm/daemon/env-snapshot.js.map +1 -1
- package/dist/esm/daemon/flow-context.js +59 -28
- package/dist/esm/daemon/flow-context.js.map +1 -1
- package/dist/esm/daemon/launchd.js +100 -55
- 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 +15 -15
- package/dist/esm/daemon/process-registry.js.map +1 -1
- package/dist/esm/daemon/schtasks.js +42 -42
- package/dist/esm/daemon/schtasks.js.map +1 -1
- package/dist/esm/daemon/server.js +248 -244
- 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 +29 -29
- package/dist/esm/daemon/summarize.js.map +1 -1
- package/dist/esm/daemon/systemd.js +47 -47
- 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 +32 -32
- 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 +35 -34
- 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 +39 -39
- package/dist/esm/media-cache.js.map +1 -1
- 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 +1 -1
- package/dist/esm/processes.js.map +1 -1
- 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 +26 -26
- 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 +24 -24
- 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 +68 -68
- package/dist/esm/run/finish-line.js.map +1 -1
- package/dist/esm/run/flows/asset/extract.js +15 -15
- package/dist/esm/run/flows/asset/extract.js.map +1 -1
- package/dist/esm/run/flows/asset/input.js +47 -66
- package/dist/esm/run/flows/asset/input.js.map +1 -1
- package/dist/esm/run/flows/asset/media-policy.js +1 -1
- package/dist/esm/run/flows/asset/media-policy.js.map +1 -1
- package/dist/esm/run/flows/asset/media.js +49 -40
- package/dist/esm/run/flows/asset/media.js.map +1 -1
- package/dist/esm/run/flows/asset/output.js +12 -12
- package/dist/esm/run/flows/asset/output.js.map +1 -1
- 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 +173 -106
- package/dist/esm/run/flows/asset/summary.js.map +1 -1
- package/dist/esm/run/flows/url/extract.js +26 -26
- package/dist/esm/run/flows/url/extract.js.map +1 -1
- package/dist/esm/run/flows/url/flow.js +104 -98
- package/dist/esm/run/flows/url/flow.js.map +1 -1
- package/dist/esm/run/flows/url/markdown.js +57 -57
- package/dist/esm/run/flows/url/markdown.js.map +1 -1
- package/dist/esm/run/flows/url/slides-output.js +61 -59
- package/dist/esm/run/flows/url/slides-output.js.map +1 -1
- package/dist/esm/run/flows/url/slides-text.js +85 -85
- package/dist/esm/run/flows/url/slides-text.js.map +1 -1
- package/dist/esm/run/flows/url/summary.js +174 -107
- 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 +141 -135
- package/dist/esm/run/help.js.map +1 -1
- package/dist/esm/run/logging.js +10 -10
- 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 +5 -5
- package/dist/esm/run/media-cache-state.js.map +1 -1
- 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 +1 -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 +83 -34
- 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 +166 -127
- package/dist/esm/run/runner.js.map +1 -1
- package/dist/esm/run/slides-cli.js +43 -42
- package/dist/esm/run/slides-cli.js.map +1 -1
- package/dist/esm/run/slides-render.js +36 -36
- package/dist/esm/run/slides-render.js.map +1 -1
- 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 +7 -7
- 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 +57 -51
- 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 +49 -49
- package/dist/esm/run/transcriber-cli.js.map +1 -1
- 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 -16
- 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 +258 -249
- package/dist/esm/slides/extract.js.map +1 -1
- package/dist/esm/slides/index.js +3 -3
- package/dist/esm/slides/index.js.map +1 -1
- package/dist/esm/slides/settings.js +14 -14
- package/dist/esm/slides/settings.js.map +1 -1
- package/dist/esm/slides/store.js +9 -9
- package/dist/esm/slides/store.js.map +1 -1
- package/dist/esm/tty/format.js +13 -13
- package/dist/esm/tty/format.js.map +1 -1
- package/dist/esm/tty/osc-progress.js +1 -1
- package/dist/esm/tty/osc-progress.js.map +1 -1
- package/dist/esm/tty/progress/fetch-html.js +14 -14
- package/dist/esm/tty/progress/fetch-html.js.map +1 -1
- package/dist/esm/tty/progress/transcript.js +70 -62
- package/dist/esm/tty/progress/transcript.js.map +1 -1
- package/dist/esm/tty/spinner.js +20 -9
- package/dist/esm/tty/spinner.js.map +1 -1
- package/dist/esm/tty/theme.js +92 -92
- package/dist/esm/tty/theme.js.map +1 -1
- package/dist/esm/tty/website-progress.js +32 -32
- 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 +6 -6
- package/dist/types/config.d.ts +49 -7
- 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 +1 -1
- package/dist/types/daemon/auto-mode.d.ts +3 -3
- package/dist/types/daemon/chat.d.ts +2 -2
- 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 +7 -7
- package/dist/types/daemon/launchd.d.ts +8 -0
- package/dist/types/daemon/models.d.ts +6 -2
- package/dist/types/daemon/process-registry.d.ts +5 -5
- 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 +7 -7
- package/dist/types/firecrawl.d.ts +1 -1
- package/dist/types/flags.d.ts +11 -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 +2 -2
- 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 -1
- 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 +2 -2
- 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 +5 -5
- package/dist/types/run/flows/asset/extract.d.ts +4 -4
- package/dist/types/run/flows/asset/input.d.ts +9 -3
- package/dist/types/run/flows/asset/media.d.ts +1 -1
- package/dist/types/run/flows/asset/output.d.ts +5 -5
- package/dist/types/run/flows/asset/preprocess.d.ts +23 -17
- package/dist/types/run/flows/asset/summary.d.ts +19 -17
- package/dist/types/run/flows/url/extract.d.ts +1 -1
- 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 +7 -7
- package/dist/types/run/flows/url/slides-text.d.ts +9 -9
- package/dist/types/run/flows/url/summary.d.ts +11 -11
- package/dist/types/run/flows/url/types.d.ts +26 -22
- package/dist/types/run/format.d.ts +3 -3
- package/dist/types/run/help.d.ts +1 -1
- package/dist/types/run/media-cache-state.d.ts +2 -2
- package/dist/types/run/model-attempts.d.ts +1 -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 +15 -6
- package/dist/types/run/run-stream.d.ts +2 -2
- package/dist/types/run/runner.d.ts +3 -2
- package/dist/types/run/slides-render.d.ts +4 -4
- package/dist/types/run/stdin-temp-file.d.ts +9 -0
- package/dist/types/run/stream-output.d.ts +1 -1
- package/dist/types/run/streaming.d.ts +4 -4
- package/dist/types/run/summary-engine.d.ts +11 -11
- package/dist/types/run/summary-llm.d.ts +5 -5
- 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 +9 -9
- package/dist/types/slides/extract.d.ts +5 -4
- package/dist/types/slides/index.d.ts +5 -5
- package/dist/types/slides/store.d.ts +2 -2
- package/dist/types/slides/types.d.ts +2 -2
- package/dist/types/tty/osc-progress.d.ts +5 -5
- package/dist/types/tty/progress/fetch-html.d.ts +3 -3
- package/dist/types/tty/progress/transcript.d.ts +3 -3
- package/dist/types/tty/spinner.d.ts +2 -2
- package/dist/types/tty/theme.d.ts +2 -2
- package/dist/types/tty/website-progress.d.ts +3 -3
- package/dist/types/version.d.ts +1 -1
- package/docs/agent.md +38 -4
- package/docs/assets/site.js +46 -46
- package/docs/chrome-extension.md +11 -5
- package/docs/cli.md +59 -13
- package/docs/config.md +59 -10
- package/docs/extract-only.md +2 -0
- package/docs/index.html +33 -14
- package/docs/llm.md +7 -4
- package/docs/media.md +5 -4
- package/docs/model-auto.md +3 -2
- package/docs/nvidia-onnx-transcription.md +3 -3
- package/docs/openai.md +1 -1
- package/docs/releasing.md +3 -0
- package/docs/site/404.html +4 -1
- package/docs/site/assets/site.js +46 -46
- package/docs/site/docs/chrome-extension.html +18 -6
- package/docs/site/docs/config.html +29 -8
- package/docs/site/docs/extract-only.html +16 -4
- package/docs/site/docs/firecrawl.html +12 -3
- package/docs/site/docs/index.html +35 -6
- package/docs/site/docs/llm.html +19 -5
- package/docs/site/docs/openai.html +18 -5
- package/docs/site/docs/website.html +29 -9
- package/docs/site/docs/youtube.html +12 -3
- package/docs/site/index.html +33 -14
- package/docs/slides.md +13 -5
- package/docs/smoketest.md +29 -20
- package/docs/timestamps.md +21 -0
- package/docs/website.md +2 -1
- package/docs/youtube.md +4 -0
- package/package.json +36 -35
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SummaryLength } from
|
|
1
|
+
import type { SummaryLength } from "../../../shared/contracts.js";
|
|
2
2
|
export type TranscriptSegment = {
|
|
3
3
|
startSeconds: number;
|
|
4
4
|
text: string;
|
|
@@ -32,10 +32,10 @@ export declare function buildSlideTextFallback({ slides, transcriptTimedText, le
|
|
|
32
32
|
slides: SlideTimelineEntry[];
|
|
33
33
|
transcriptTimedText: string | null | undefined;
|
|
34
34
|
lengthArg: {
|
|
35
|
-
kind:
|
|
35
|
+
kind: "preset";
|
|
36
36
|
preset: SummaryLength;
|
|
37
37
|
} | {
|
|
38
|
-
kind:
|
|
38
|
+
kind: "chars";
|
|
39
39
|
maxCharacters: number;
|
|
40
40
|
};
|
|
41
41
|
}): Map<number, string>;
|
|
@@ -44,10 +44,10 @@ export declare function coerceSummaryWithSlides({ markdown, slides, transcriptTi
|
|
|
44
44
|
slides: SlideTimelineEntry[];
|
|
45
45
|
transcriptTimedText?: string | null;
|
|
46
46
|
lengthArg: {
|
|
47
|
-
kind:
|
|
47
|
+
kind: "preset";
|
|
48
48
|
preset: SummaryLength;
|
|
49
49
|
} | {
|
|
50
|
-
kind:
|
|
50
|
+
kind: "chars";
|
|
51
51
|
maxCharacters: number;
|
|
52
52
|
};
|
|
53
53
|
}): string;
|
|
@@ -59,20 +59,20 @@ export declare function parseTranscriptTimedText(input: string | null | undefine
|
|
|
59
59
|
export declare function formatTimestamp(seconds: number): string;
|
|
60
60
|
export declare function resolveSlideTextBudget({ lengthArg, slideCount, }: {
|
|
61
61
|
lengthArg: {
|
|
62
|
-
kind:
|
|
62
|
+
kind: "preset";
|
|
63
63
|
preset: SummaryLength;
|
|
64
64
|
} | {
|
|
65
|
-
kind:
|
|
65
|
+
kind: "chars";
|
|
66
66
|
maxCharacters: number;
|
|
67
67
|
};
|
|
68
68
|
slideCount: number;
|
|
69
69
|
}): number;
|
|
70
70
|
export declare function resolveSlideWindowSeconds({ lengthArg, }: {
|
|
71
71
|
lengthArg: {
|
|
72
|
-
kind:
|
|
72
|
+
kind: "preset";
|
|
73
73
|
preset: SummaryLength;
|
|
74
74
|
} | {
|
|
75
|
-
kind:
|
|
75
|
+
kind: "chars";
|
|
76
76
|
maxCharacters: number;
|
|
77
77
|
};
|
|
78
78
|
}): number;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { ExtractedLinkContent } from
|
|
2
|
-
import type { UrlExtractionUi } from
|
|
3
|
-
import type { SlidesTerminalOutput } from
|
|
4
|
-
import type { UrlFlowContext } from
|
|
5
|
-
type SlidesResult = Awaited<ReturnType<typeof import(
|
|
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
6
|
export declare function buildUrlPrompt({ extracted, outputLanguage, lengthArg, promptOverride, lengthInstruction, languageInstruction, slides, }: {
|
|
7
7
|
extracted: ExtractedLinkContent;
|
|
8
|
-
outputLanguage: UrlFlowContext[
|
|
9
|
-
lengthArg: UrlFlowContext[
|
|
8
|
+
outputLanguage: UrlFlowContext["flags"]["outputLanguage"];
|
|
9
|
+
lengthArg: UrlFlowContext["flags"]["lengthArg"];
|
|
10
10
|
promptOverride?: string | null;
|
|
11
11
|
lengthInstruction?: string | null;
|
|
12
12
|
languageInstruction?: string | null;
|
|
@@ -18,9 +18,9 @@ export declare function outputExtractedUrl({ ctx, url, extracted, extractionUi,
|
|
|
18
18
|
extracted: ExtractedLinkContent;
|
|
19
19
|
extractionUi: UrlExtractionUi;
|
|
20
20
|
prompt: string;
|
|
21
|
-
effectiveMarkdownMode:
|
|
21
|
+
effectiveMarkdownMode: "off" | "auto" | "llm" | "readability";
|
|
22
22
|
transcriptionCostLabel: string | null;
|
|
23
|
-
slides?: Awaited<ReturnType<typeof import(
|
|
23
|
+
slides?: Awaited<ReturnType<typeof import("../../../slides/index.js").extractSlidesForSource>> | null;
|
|
24
24
|
slidesOutput?: SlidesTerminalOutput | null;
|
|
25
25
|
}): Promise<void>;
|
|
26
26
|
export declare function summarizeExtractedUrl({ ctx, url, extracted, extractionUi, prompt, effectiveMarkdownMode, transcriptionCostLabel, onModelChosen, slides, slidesOutput, }: {
|
|
@@ -29,10 +29,10 @@ export declare function summarizeExtractedUrl({ ctx, url, extracted, extractionU
|
|
|
29
29
|
extracted: ExtractedLinkContent;
|
|
30
30
|
extractionUi: UrlExtractionUi;
|
|
31
31
|
prompt: string;
|
|
32
|
-
effectiveMarkdownMode:
|
|
32
|
+
effectiveMarkdownMode: "off" | "auto" | "llm" | "readability";
|
|
33
33
|
transcriptionCostLabel: string | null;
|
|
34
34
|
onModelChosen?: ((modelId: string) => void) | null;
|
|
35
|
-
slides?: Awaited<ReturnType<typeof import(
|
|
35
|
+
slides?: Awaited<ReturnType<typeof import("../../../slides/index.js").extractSlidesForSource>> | null;
|
|
36
36
|
slidesOutput?: SlidesTerminalOutput | null;
|
|
37
37
|
}): Promise<void>;
|
|
38
38
|
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { CacheState } from
|
|
2
|
-
import type { SummarizeConfig } from
|
|
3
|
-
import type { ExtractedLinkContent, LinkPreviewProgressEvent, MediaCache } from
|
|
4
|
-
import type { LlmCall, RunMetricsReport } from
|
|
5
|
-
import type { StreamMode } from
|
|
6
|
-
import type { OutputLanguage } from
|
|
7
|
-
import type { ExecFileFn } from
|
|
8
|
-
import type { FixedModelSpec, RequestedModel } from
|
|
9
|
-
import type { SummaryLength } from
|
|
10
|
-
import type { SlideExtractionResult, SlideImage, SlideSettings, SlideSourceKind } from
|
|
11
|
-
import type { createSummaryEngine } from
|
|
12
|
-
import type { SummarizeAssetArgs } from
|
|
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";
|
|
13
13
|
export type UrlFlowIo = {
|
|
14
14
|
env: Record<string, string | undefined>;
|
|
15
15
|
envForRun: Record<string, string | undefined>;
|
|
@@ -22,19 +22,19 @@ export type UrlFlowFlags = {
|
|
|
22
22
|
timeoutMs: number;
|
|
23
23
|
maxExtractCharacters?: number | null;
|
|
24
24
|
retries: number;
|
|
25
|
-
format:
|
|
26
|
-
markdownMode:
|
|
27
|
-
preprocessMode:
|
|
28
|
-
youtubeMode:
|
|
29
|
-
firecrawlMode:
|
|
30
|
-
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
31
|
transcriptTimestamps: boolean;
|
|
32
32
|
outputLanguage: OutputLanguage;
|
|
33
33
|
lengthArg: {
|
|
34
|
-
kind:
|
|
34
|
+
kind: "preset";
|
|
35
35
|
preset: SummaryLength;
|
|
36
36
|
} | {
|
|
37
|
-
kind:
|
|
37
|
+
kind: "chars";
|
|
38
38
|
maxCharacters: number;
|
|
39
39
|
};
|
|
40
40
|
forceSummary: boolean;
|
|
@@ -67,12 +67,14 @@ export type UrlFlowModel = {
|
|
|
67
67
|
requestedModelLabel: string;
|
|
68
68
|
fixedModelSpec: FixedModelSpec | null;
|
|
69
69
|
isFallbackModel: boolean;
|
|
70
|
+
isImplicitAutoSelection: boolean;
|
|
71
|
+
allowAutoCliFallback: boolean;
|
|
70
72
|
isNamedModelSelection: boolean;
|
|
71
73
|
wantsFreeNamedModel: boolean;
|
|
72
74
|
desiredOutputTokens: number | null;
|
|
73
75
|
configForModelSelection: SummarizeConfig | null;
|
|
74
76
|
envForAuto: Record<string, string | undefined>;
|
|
75
|
-
cliAvailability: Partial<Record<
|
|
77
|
+
cliAvailability: Partial<Record<CliProvider, boolean>>;
|
|
76
78
|
openaiUseChatCompletions: boolean;
|
|
77
79
|
openaiWhisperUsdPerMinute: number;
|
|
78
80
|
apiStatus: {
|
|
@@ -96,11 +98,13 @@ export type UrlFlowModel = {
|
|
|
96
98
|
firecrawlApiKey: string | null;
|
|
97
99
|
apifyToken: string | null;
|
|
98
100
|
ytDlpPath: string | null;
|
|
101
|
+
ytDlpCookiesFromBrowser: string | null;
|
|
99
102
|
falApiKey: string | null;
|
|
103
|
+
groqApiKey: string | null;
|
|
100
104
|
openaiTranscriptionKey: string | null;
|
|
101
105
|
};
|
|
102
106
|
summaryEngine: ReturnType<typeof createSummaryEngine>;
|
|
103
|
-
getLiteLlmCatalog: () => Promise<Awaited<ReturnType<typeof import(
|
|
107
|
+
getLiteLlmCatalog: () => Promise<Awaited<ReturnType<typeof import("../../../pricing/litellm.js").loadLiteLlmCatalog>>["catalog"]>;
|
|
104
108
|
llmCalls: LlmCall[];
|
|
105
109
|
};
|
|
106
110
|
export type UrlFlowHooks = {
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import { Command } from
|
|
1
|
+
import { Command } from "commander";
|
|
2
2
|
export declare function buildProgram(): Command;
|
|
3
3
|
export declare function applyHelpStyle(program: Command, env: Record<string, string | undefined>, stdout: NodeJS.WritableStream): void;
|
|
4
4
|
export declare function buildSlidesProgram(): Command;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SummarizeConfig } from
|
|
2
|
-
import type { MediaCache } from
|
|
1
|
+
import type { SummarizeConfig } from "../config.js";
|
|
2
|
+
import type { MediaCache } from "../content/index.js";
|
|
3
3
|
export declare function createMediaCacheFromConfig({ envForRun, config, noMediaCacheFlag, }: {
|
|
4
4
|
envForRun: Record<string, string | undefined>;
|
|
5
5
|
config: SummarizeConfig | 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,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;
|
|
@@ -22,7 +23,9 @@ export type RunOverrides = {
|
|
|
22
23
|
timeoutMs: number | null;
|
|
23
24
|
retries: number | null;
|
|
24
25
|
maxOutputTokensArg: number | null;
|
|
25
|
-
transcriber:
|
|
26
|
+
transcriber: "auto" | "whisper" | "parakeet" | "canary" | null;
|
|
27
|
+
autoCliFallbackEnabled: boolean | null;
|
|
28
|
+
autoCliOrder: CliProvider[] | null;
|
|
26
29
|
};
|
|
27
30
|
export type RunOverridesInput = {
|
|
28
31
|
firecrawl?: unknown;
|
|
@@ -36,6 +39,12 @@ export type RunOverridesInput = {
|
|
|
36
39
|
retries?: unknown;
|
|
37
40
|
maxOutputTokens?: unknown;
|
|
38
41
|
transcriber?: unknown;
|
|
42
|
+
autoCliFallback?: unknown;
|
|
43
|
+
autoCliOrder?: unknown;
|
|
44
|
+
autoCliRememberLastSuccess?: unknown;
|
|
45
|
+
magicCliAuto?: unknown;
|
|
46
|
+
magicCliOrder?: unknown;
|
|
47
|
+
magicCliRememberLastSuccess?: unknown;
|
|
39
48
|
};
|
|
40
49
|
export declare function resolveSummaryLength(raw: unknown, fallback?: string): {
|
|
41
50
|
lengthArg: LengthArg;
|
|
@@ -50,13 +59,13 @@ export declare function resolveCliRunSettings({ length, firecrawl, markdownMode,
|
|
|
50
59
|
firecrawl: string;
|
|
51
60
|
markdownMode?: string | undefined;
|
|
52
61
|
markdown?: string | undefined;
|
|
53
|
-
format:
|
|
62
|
+
format: "text" | "markdown";
|
|
54
63
|
preprocess: string;
|
|
55
64
|
youtube: string;
|
|
56
65
|
timeout: string;
|
|
57
66
|
retries: string;
|
|
58
67
|
maxOutputTokens?: string | undefined;
|
|
59
68
|
}): ResolvedRunSettings;
|
|
60
|
-
export declare function resolveRunOverrides({ firecrawl, markdownMode, preprocess, youtube, videoMode, timestamps, forceSummary, timeout, retries, maxOutputTokens, transcriber, }: 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?: {
|
|
61
70
|
strict?: boolean;
|
|
62
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 {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { SlideImage } from
|
|
2
|
-
export type SlidesRenderMode =
|
|
3
|
-
export type InlineProtocol =
|
|
4
|
-
type RenderSlide = Pick<SlideImage,
|
|
1
|
+
import type { SlideImage } from "../slides/types.js";
|
|
2
|
+
export type SlidesRenderMode = "none" | "auto" | "kitty" | "iterm";
|
|
3
|
+
export type InlineProtocol = "none" | "kitty" | "iterm";
|
|
4
|
+
type RenderSlide = Pick<SlideImage, "imagePath" | "index" | "timestamp">;
|
|
5
5
|
export declare function renderSlidesInline({ slides, mode, env, stdout, labelForSlide, }: {
|
|
6
6
|
slides: RenderSlide[];
|
|
7
7
|
mode: SlidesRenderMode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type StdinTempFile = {
|
|
2
|
+
filePath: string;
|
|
3
|
+
kind: "text" | "binary";
|
|
4
|
+
cleanup: () => Promise<void>;
|
|
5
|
+
};
|
|
6
|
+
export declare function createTempFileFromStdin({ stream, maxBytes, }: {
|
|
7
|
+
stream: NodeJS.ReadableStream;
|
|
8
|
+
maxBytes?: number;
|
|
9
|
+
}): Promise<StdinTempFile>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type StreamOutputMode =
|
|
1
|
+
export type StreamOutputMode = "line" | "delta";
|
|
2
2
|
export declare function createStreamOutputGate({ stdout, clearProgressForStdout, restoreProgressAfterStdout, outputMode, richTty, }: {
|
|
3
3
|
stdout: NodeJS.WritableStream;
|
|
4
4
|
clearProgressForStdout: () => void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { mergeStreamingChunk } from
|
|
1
|
+
export { mergeStreamingChunk } from "../shared/streaming-merge.js";
|
|
2
2
|
export declare function isGoogleStreamingUnsupportedError(error: unknown): boolean;
|
|
3
3
|
export declare function isStreamingTimeoutError(error: unknown): boolean;
|
|
4
4
|
export declare function canStream({ provider, prompt, transport, }: {
|
|
5
|
-
provider:
|
|
5
|
+
provider: "xai" | "openai" | "google" | "anthropic" | "zai";
|
|
6
6
|
prompt: {
|
|
7
7
|
attachments?: Array<{
|
|
8
|
-
kind:
|
|
8
|
+
kind: "text" | "image" | "document";
|
|
9
9
|
}>;
|
|
10
10
|
};
|
|
11
|
-
transport:
|
|
11
|
+
transport: "cli" | "native" | "openrouter";
|
|
12
12
|
}): boolean;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { CliProvider } from
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
import type { CliProvider } from "../config.js";
|
|
2
|
+
import type { Prompt } from "../llm/prompt.js";
|
|
3
|
+
import type { ModelAttempt, ModelMeta } from "./types.js";
|
|
4
|
+
import { runCliModel } from "../llm/cli.js";
|
|
5
|
+
import { type StreamOutputMode } from "./stream-output.js";
|
|
6
|
+
import { summarizeWithModelId } from "./summary-llm.js";
|
|
7
7
|
export type SummaryEngineDeps = {
|
|
8
8
|
env: Record<string, string | undefined>;
|
|
9
9
|
envForRun: Record<string, string | undefined>;
|
|
10
10
|
stdout: NodeJS.WritableStream;
|
|
11
11
|
stderr: NodeJS.WritableStream;
|
|
12
|
-
execFileImpl: Parameters<typeof runCliModel>[0][
|
|
12
|
+
execFileImpl: Parameters<typeof runCliModel>[0]["execFileImpl"];
|
|
13
13
|
timeoutMs: number;
|
|
14
14
|
retries: number;
|
|
15
15
|
streamingEnabled: boolean;
|
|
@@ -18,17 +18,17 @@ export type SummaryEngineDeps = {
|
|
|
18
18
|
verbose: boolean;
|
|
19
19
|
verboseColor: boolean;
|
|
20
20
|
openaiUseChatCompletions: boolean;
|
|
21
|
-
cliConfigForRun: Parameters<typeof runCliModel>[0][
|
|
21
|
+
cliConfigForRun: Parameters<typeof runCliModel>[0]["config"];
|
|
22
22
|
cliAvailability: Partial<Record<CliProvider, boolean>>;
|
|
23
23
|
trackedFetch: typeof fetch;
|
|
24
24
|
resolveMaxOutputTokensForCall: (modelId: string) => Promise<number | null>;
|
|
25
25
|
resolveMaxInputTokensForCall: (modelId: string) => Promise<number | null>;
|
|
26
26
|
llmCalls: Array<{
|
|
27
|
-
provider:
|
|
27
|
+
provider: "xai" | "openai" | "google" | "anthropic" | "zai" | "cli";
|
|
28
28
|
model: string;
|
|
29
|
-
usage: Awaited<ReturnType<typeof summarizeWithModelId>>[
|
|
29
|
+
usage: Awaited<ReturnType<typeof summarizeWithModelId>>["usage"] | null;
|
|
30
30
|
costUsd?: number | null;
|
|
31
|
-
purpose:
|
|
31
|
+
purpose: "summary" | "markdown";
|
|
32
32
|
}>;
|
|
33
33
|
clearProgressForStdout: () => void;
|
|
34
34
|
restoreProgressAfterStdout?: (() => void) | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
1
|
+
import type { parseGatewayStyleModelId } from "../llm/model-id.js";
|
|
2
|
+
import type { Prompt } from "../llm/prompt.js";
|
|
3
|
+
import { generateTextWithModelId } from "../llm/generate-text.js";
|
|
4
4
|
export declare function resolveModelIdForLlmCall({ parsedModel, apiKeys, fetchImpl, timeoutMs, }: {
|
|
5
5
|
parsedModel: ReturnType<typeof parseGatewayStyleModelId>;
|
|
6
6
|
apiKeys: {
|
|
@@ -41,7 +41,7 @@ export declare function summarizeWithModelId({ modelId, prompt, maxOutputTokens,
|
|
|
41
41
|
}) => void;
|
|
42
42
|
}): Promise<{
|
|
43
43
|
text: string;
|
|
44
|
-
provider:
|
|
44
|
+
provider: "xai" | "openai" | "google" | "anthropic" | "zai";
|
|
45
45
|
canonicalModelId: string;
|
|
46
|
-
usage: Awaited<ReturnType<typeof generateTextWithModelId>>[
|
|
46
|
+
usage: Awaited<ReturnType<typeof generateTextWithModelId>>["usage"];
|
|
47
47
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CliProvider } from
|
|
2
|
-
export type ModelAttemptRequiredEnv =
|
|
1
|
+
import type { CliProvider } from "../config.js";
|
|
2
|
+
export type ModelAttemptRequiredEnv = "XAI_API_KEY" | "OPENAI_API_KEY" | "GEMINI_API_KEY" | "ANTHROPIC_API_KEY" | "OPENROUTER_API_KEY" | "Z_AI_API_KEY" | "CLI_CLAUDE" | "CLI_CODEX" | "CLI_GEMINI" | "CLI_AGENT";
|
|
3
3
|
export type ModelAttempt = {
|
|
4
|
-
transport:
|
|
4
|
+
transport: "native" | "openrouter" | "cli";
|
|
5
5
|
userModelId: string;
|
|
6
6
|
llmModelId: string | null;
|
|
7
7
|
openrouterProviders: string[] | null;
|
|
@@ -14,7 +14,7 @@ export type ModelAttempt = {
|
|
|
14
14
|
cliModel?: string | null;
|
|
15
15
|
};
|
|
16
16
|
export type ModelMeta = {
|
|
17
|
-
provider:
|
|
17
|
+
provider: "xai" | "openai" | "google" | "anthropic" | "zai" | "cli";
|
|
18
18
|
canonical: string;
|
|
19
19
|
};
|
|
20
20
|
export type MarkdownModel = {
|
package/dist/types/run.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { runCli } from
|
|
1
|
+
export { runCli } from "./run/runner.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { SummaryLength } from
|
|
2
|
-
export { SUMMARY_LENGTHS } from
|
|
1
|
+
export type { SummaryLength } from "@steipete/summarize-core";
|
|
2
|
+
export { SUMMARY_LENGTHS } from "@steipete/summarize-core";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AssistantMessage } from
|
|
1
|
+
import type { AssistantMessage } from "@mariozechner/pi-ai";
|
|
2
2
|
export type SseMetaData = {
|
|
3
3
|
model: string | null;
|
|
4
4
|
modelLabel: string | null;
|
|
@@ -26,32 +26,32 @@ export type SseMetricsData = {
|
|
|
26
26
|
detailsDetailed: string | null;
|
|
27
27
|
};
|
|
28
28
|
export type SseEvent = {
|
|
29
|
-
event:
|
|
29
|
+
event: "meta";
|
|
30
30
|
data: SseMetaData;
|
|
31
31
|
} | {
|
|
32
|
-
event:
|
|
32
|
+
event: "slides";
|
|
33
33
|
data: SseSlidesData;
|
|
34
34
|
} | {
|
|
35
|
-
event:
|
|
35
|
+
event: "status";
|
|
36
36
|
data: {
|
|
37
37
|
text: string;
|
|
38
38
|
};
|
|
39
39
|
} | {
|
|
40
|
-
event:
|
|
40
|
+
event: "chunk";
|
|
41
41
|
data: {
|
|
42
42
|
text: string;
|
|
43
43
|
};
|
|
44
44
|
} | {
|
|
45
|
-
event:
|
|
45
|
+
event: "assistant";
|
|
46
46
|
data: AssistantMessage;
|
|
47
47
|
} | {
|
|
48
|
-
event:
|
|
48
|
+
event: "metrics";
|
|
49
49
|
data: SseMetricsData;
|
|
50
50
|
} | {
|
|
51
|
-
event:
|
|
51
|
+
event: "done";
|
|
52
52
|
data: Record<string, never>;
|
|
53
53
|
} | {
|
|
54
|
-
event:
|
|
54
|
+
event: "error";
|
|
55
55
|
data: {
|
|
56
56
|
message: string;
|
|
57
57
|
};
|