@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
package/dist/types/cache.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { TranscriptCache } from
|
|
2
|
-
import type { LengthArg } from
|
|
3
|
-
import type { OutputLanguage } from
|
|
4
|
-
export type CacheKind =
|
|
1
|
+
import type { TranscriptCache } from "./content/index.js";
|
|
2
|
+
import type { LengthArg } from "./flags.js";
|
|
3
|
+
import type { OutputLanguage } from "./language.js";
|
|
4
|
+
export type CacheKind = "extract" | "summary" | "transcript" | "chat" | "slides";
|
|
5
5
|
export type CacheConfig = {
|
|
6
6
|
enabled?: boolean;
|
|
7
7
|
maxMb?: number;
|
|
@@ -21,7 +21,7 @@ export type CacheStore = {
|
|
|
21
21
|
transcriptCache: TranscriptCache;
|
|
22
22
|
};
|
|
23
23
|
export type CacheState = {
|
|
24
|
-
mode:
|
|
24
|
+
mode: "default" | "bypass";
|
|
25
25
|
store: CacheStore | null;
|
|
26
26
|
ttlMs: number;
|
|
27
27
|
maxBytes: number;
|
|
@@ -46,7 +46,7 @@ export declare function clearCacheFiles(path: string): void;
|
|
|
46
46
|
export declare function hashString(value: string): string;
|
|
47
47
|
export declare function hashJson(value: unknown): string;
|
|
48
48
|
export declare function normalizeContentForHash(content: string): string;
|
|
49
|
-
export declare function extractTaggedBlock(prompt: string, tag:
|
|
49
|
+
export declare function extractTaggedBlock(prompt: string, tag: "instructions" | "content"): string | null;
|
|
50
50
|
export declare function buildPromptHash(prompt: string): string;
|
|
51
51
|
export declare function buildLengthKey(lengthArg: LengthArg): string;
|
|
52
52
|
export declare function buildLanguageKey(outputLanguage: OutputLanguage): string;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
|
-
export type AutoRuleKind =
|
|
2
|
-
export type VideoMode =
|
|
3
|
-
export type CliProvider =
|
|
1
|
+
export type AutoRuleKind = "text" | "website" | "youtube" | "image" | "video" | "file";
|
|
2
|
+
export type VideoMode = "auto" | "transcript" | "understand";
|
|
3
|
+
export type CliProvider = "claude" | "codex" | "gemini" | "agent";
|
|
4
4
|
export type CliProviderConfig = {
|
|
5
5
|
binary?: string;
|
|
6
6
|
extraArgs?: string[];
|
|
7
7
|
model?: string;
|
|
8
8
|
};
|
|
9
|
+
export type CliAutoFallbackConfig = {
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
onlyWhenNoApiKeys?: boolean;
|
|
12
|
+
order?: CliProvider[];
|
|
13
|
+
};
|
|
14
|
+
export type CliMagicAutoConfig = CliAutoFallbackConfig;
|
|
9
15
|
export type CliConfig = {
|
|
10
16
|
enabled?: CliProvider[];
|
|
11
17
|
claude?: CliProviderConfig;
|
|
12
18
|
codex?: CliProviderConfig;
|
|
13
19
|
gemini?: CliProviderConfig;
|
|
20
|
+
agent?: CliProviderConfig;
|
|
21
|
+
autoFallback?: CliAutoFallbackConfig;
|
|
22
|
+
magicAuto?: CliAutoFallbackConfig;
|
|
23
|
+
promptOverride?: string;
|
|
24
|
+
allowTools?: boolean;
|
|
25
|
+
cwd?: string;
|
|
26
|
+
extraArgs?: string[];
|
|
14
27
|
};
|
|
15
28
|
export type OpenAiConfig = {
|
|
16
29
|
/**
|
|
@@ -27,7 +40,7 @@ export type OpenAiConfig = {
|
|
|
27
40
|
*/
|
|
28
41
|
whisperUsdPerMinute?: number;
|
|
29
42
|
};
|
|
30
|
-
export type MediaCacheVerifyMode =
|
|
43
|
+
export type MediaCacheVerifyMode = "none" | "size" | "hash";
|
|
31
44
|
export type MediaCacheConfig = {
|
|
32
45
|
enabled?: boolean;
|
|
33
46
|
maxMb?: number;
|
|
@@ -51,8 +64,20 @@ export type GoogleConfig = {
|
|
|
51
64
|
*/
|
|
52
65
|
baseUrl?: string;
|
|
53
66
|
};
|
|
54
|
-
export type
|
|
55
|
-
|
|
67
|
+
export type ApiKeysConfig = {
|
|
68
|
+
openai?: string;
|
|
69
|
+
anthropic?: string;
|
|
70
|
+
google?: string;
|
|
71
|
+
xai?: string;
|
|
72
|
+
openrouter?: string;
|
|
73
|
+
zai?: string;
|
|
74
|
+
apify?: string;
|
|
75
|
+
firecrawl?: string;
|
|
76
|
+
fal?: string;
|
|
77
|
+
};
|
|
78
|
+
export type EnvConfig = Record<string, string>;
|
|
79
|
+
export type LoggingLevel = "debug" | "info" | "warn" | "error";
|
|
80
|
+
export type LoggingFormat = "json" | "pretty";
|
|
56
81
|
export type LoggingConfig = {
|
|
57
82
|
enabled?: boolean;
|
|
58
83
|
level?: LoggingLevel;
|
|
@@ -99,7 +124,7 @@ export type AutoRule = {
|
|
|
99
124
|
export type ModelConfig = {
|
|
100
125
|
id: string;
|
|
101
126
|
} | {
|
|
102
|
-
mode:
|
|
127
|
+
mode: "auto";
|
|
103
128
|
rules?: AutoRule[];
|
|
104
129
|
} | {
|
|
105
130
|
name: string;
|
|
@@ -164,7 +189,24 @@ export type SummarizeConfig = {
|
|
|
164
189
|
google?: GoogleConfig;
|
|
165
190
|
xai?: XaiConfig;
|
|
166
191
|
logging?: LoggingConfig;
|
|
192
|
+
/**
|
|
193
|
+
* Generic environment variable defaults.
|
|
194
|
+
*
|
|
195
|
+
* Precedence: process env > config file env.
|
|
196
|
+
*/
|
|
197
|
+
env?: EnvConfig;
|
|
198
|
+
/**
|
|
199
|
+
* Legacy API key shortcuts. Prefer `env` for new configs.
|
|
200
|
+
*
|
|
201
|
+
* Precedence: environment variables > config file apiKeys.
|
|
202
|
+
*/
|
|
203
|
+
apiKeys?: ApiKeysConfig;
|
|
167
204
|
};
|
|
205
|
+
export declare function resolveConfigEnv(config: SummarizeConfig | null | undefined): EnvConfig;
|
|
206
|
+
export declare function mergeConfigEnv({ env, config, }: {
|
|
207
|
+
env: Record<string, string | undefined>;
|
|
208
|
+
config: SummarizeConfig | null | undefined;
|
|
209
|
+
}): Record<string, string | undefined>;
|
|
168
210
|
export declare function loadSummarizeConfig({ env }: {
|
|
169
211
|
env: Record<string, string | undefined>;
|
|
170
212
|
}): {
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import type { Message } from
|
|
1
|
+
import type { Message } from "@mariozechner/pi-ai";
|
|
2
2
|
export type InputTarget = {
|
|
3
|
-
kind:
|
|
3
|
+
kind: "url";
|
|
4
4
|
url: string;
|
|
5
5
|
} | {
|
|
6
|
-
kind:
|
|
6
|
+
kind: "file";
|
|
7
7
|
filePath: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "stdin";
|
|
8
10
|
};
|
|
9
11
|
export type UrlKind = {
|
|
10
|
-
kind:
|
|
12
|
+
kind: "website";
|
|
11
13
|
} | {
|
|
12
|
-
kind:
|
|
14
|
+
kind: "asset";
|
|
13
15
|
};
|
|
14
16
|
export type AssetAttachment = {
|
|
15
17
|
mediaType: string;
|
|
16
18
|
filename: string | null;
|
|
17
|
-
kind:
|
|
19
|
+
kind: "image" | "file";
|
|
18
20
|
bytes: Uint8Array;
|
|
19
21
|
};
|
|
20
22
|
export declare function resolveInputTarget(raw: string): InputTarget;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "@steipete/summarize-core/content";
|
package/dist/types/costs.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { LlmTokenUsage } from
|
|
2
|
-
export type LlmProvider =
|
|
1
|
+
import type { LlmTokenUsage } from "./llm/generate-text.js";
|
|
2
|
+
export type LlmProvider = "xai" | "openai" | "google" | "anthropic" | "zai" | "cli";
|
|
3
3
|
export type LlmCall = {
|
|
4
4
|
provider: LlmProvider;
|
|
5
5
|
model: string;
|
|
6
6
|
usage: LlmTokenUsage | null;
|
|
7
7
|
costUsd?: number | null;
|
|
8
|
-
purpose:
|
|
8
|
+
purpose: "summary" | "markdown";
|
|
9
9
|
};
|
|
10
10
|
export type RunMetricsReport = {
|
|
11
11
|
llm: Array<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AssistantMessage } from
|
|
1
|
+
import type { AssistantMessage } from "@mariozechner/pi-ai";
|
|
2
2
|
export declare function buildAgentPromptHash(automationEnabled: boolean): string;
|
|
3
3
|
export declare function streamAgentResponse({ env, pageUrl, pageTitle, pageContent, messages, modelOverride, tools, automationEnabled, onChunk, onAssistant, signal, }: {
|
|
4
4
|
env: Record<string, string | undefined>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type DaemonRequestedMode =
|
|
1
|
+
export type DaemonRequestedMode = "auto" | "page" | "url";
|
|
2
2
|
export declare function resolveAutoDaemonMode({ url, hasText }: {
|
|
3
3
|
url: string;
|
|
4
4
|
hasText: boolean;
|
|
5
5
|
}): {
|
|
6
|
-
primary:
|
|
7
|
-
fallback:
|
|
6
|
+
primary: "page" | "url";
|
|
7
|
+
fallback: "page" | "url" | null;
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Message } from
|
|
1
|
+
import type { Message } from "@mariozechner/pi-ai";
|
|
2
2
|
type ChatSession = {
|
|
3
3
|
id: string;
|
|
4
4
|
lastMeta: {
|
|
@@ -22,6 +22,6 @@ export declare function streamChatResponse({ env, fetchImpl, session: _session,
|
|
|
22
22
|
messages: Message[];
|
|
23
23
|
modelOverride: string | null;
|
|
24
24
|
pushToSession: (event: ChatEvent) => void;
|
|
25
|
-
emitMeta: (patch: Partial<ChatSession[
|
|
25
|
+
emitMeta: (patch: Partial<ChatSession["lastMeta"]>) => void;
|
|
26
26
|
}): Promise<void>;
|
|
27
27
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EnvSnapshot } from
|
|
1
|
+
import type { EnvSnapshot } from "./env-snapshot.js";
|
|
2
2
|
export type DaemonConfigV1 = {
|
|
3
3
|
version: 1;
|
|
4
4
|
token: string;
|
|
@@ -15,5 +15,5 @@ export declare function readDaemonConfig({ env, }: {
|
|
|
15
15
|
}): Promise<DaemonConfig | null>;
|
|
16
16
|
export declare function writeDaemonConfig({ env, config, }: {
|
|
17
17
|
env: Record<string, string | undefined>;
|
|
18
|
-
config: Omit<DaemonConfig,
|
|
18
|
+
config: Omit<DaemonConfig, "version" | "installedAt"> & Partial<Pick<DaemonConfig, "installedAt">>;
|
|
19
19
|
}): Promise<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const ENV_KEYS: readonly ["PATH", "XAI_API_KEY", "XAI_BASE_URL", "OPENAI_API_KEY", "OPENAI_BASE_URL", "OPENROUTER_API_KEY", "OPENAI_USE_CHAT_COMPLETIONS", "Z_AI_API_KEY", "ZAI_API_KEY", "Z_AI_BASE_URL", "ZAI_BASE_URL", "GEMINI_API_KEY", "GOOGLE_BASE_URL", "GEMINI_BASE_URL", "GOOGLE_GENERATIVE_AI_API_KEY", "GOOGLE_API_KEY", "ANTHROPIC_API_KEY", "ANTHROPIC_BASE_URL", "FIRECRAWL_API_KEY", "APIFY_API_TOKEN", "YT_DLP_PATH", "FAL_KEY", "SUMMARIZE_MODEL", "SUMMARIZE_TRANSCRIBER", "SUMMARIZE_ONNX_PARAKEET_CMD", "SUMMARIZE_ONNX_CANARY_CMD", "CLAUDE_PATH", "CODEX_PATH", "GEMINI_PATH", "UVX_PATH"];
|
|
1
|
+
declare const ENV_KEYS: readonly ["PATH", "XAI_API_KEY", "XAI_BASE_URL", "OPENAI_API_KEY", "OPENAI_WHISPER_BASE_URL", "OPENAI_BASE_URL", "OPENROUTER_API_KEY", "OPENAI_USE_CHAT_COMPLETIONS", "Z_AI_API_KEY", "ZAI_API_KEY", "Z_AI_BASE_URL", "ZAI_BASE_URL", "GEMINI_API_KEY", "GOOGLE_BASE_URL", "GEMINI_BASE_URL", "GOOGLE_GENERATIVE_AI_API_KEY", "GOOGLE_API_KEY", "ANTHROPIC_API_KEY", "ANTHROPIC_BASE_URL", "FIRECRAWL_API_KEY", "APIFY_API_TOKEN", "YT_DLP_PATH", "SUMMARIZE_YT_DLP_COOKIES_FROM_BROWSER", "YT_DLP_COOKIES_FROM_BROWSER", "FAL_KEY", "GROQ_API_KEY", "SUMMARIZE_MODEL", "SUMMARIZE_TRANSCRIBER", "SUMMARIZE_ONNX_PARAKEET_CMD", "SUMMARIZE_ONNX_CANARY_CMD", "CLAUDE_PATH", "CODEX_PATH", "GEMINI_PATH", "AGENT_PATH", "UVX_PATH"];
|
|
2
2
|
export type EnvSnapshot = Partial<Record<(typeof ENV_KEYS)[number], string>>;
|
|
3
3
|
export declare function buildEnvSnapshotFromEnv(env: Record<string, string | undefined>): EnvSnapshot;
|
|
4
4
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { CacheState } from
|
|
2
|
-
import type { ExtractedLinkContent, LinkPreviewProgressEvent, MediaCache } from
|
|
3
|
-
import type { UrlFlowContext } from
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import type { CacheState } from "../cache.js";
|
|
2
|
+
import type { ExtractedLinkContent, LinkPreviewProgressEvent, MediaCache } from "../content/index.js";
|
|
3
|
+
import type { UrlFlowContext } from "../run/flows/url/types.js";
|
|
4
|
+
import type { SlideImage, SlideSettings, SlideSourceKind } from "../slides/index.js";
|
|
5
|
+
import { type RunOverrides } from "../run/run-settings.js";
|
|
6
6
|
type TextSink = {
|
|
7
7
|
writeChunk: (text: string) => void;
|
|
8
8
|
};
|
|
@@ -16,14 +16,14 @@ export type DaemonUrlFlowContextArgs = {
|
|
|
16
16
|
lengthRaw: unknown;
|
|
17
17
|
languageRaw: unknown;
|
|
18
18
|
maxExtractCharacters: number | null;
|
|
19
|
-
format?:
|
|
19
|
+
format?: "text" | "markdown";
|
|
20
20
|
overrides?: RunOverrides | null;
|
|
21
21
|
extractOnly?: boolean;
|
|
22
22
|
slides?: SlideSettings | null;
|
|
23
23
|
hooks?: {
|
|
24
24
|
onModelChosen?: ((modelId: string) => void) | null;
|
|
25
25
|
onExtracted?: ((extracted: ExtractedLinkContent) => void) | null;
|
|
26
|
-
onSlidesExtracted?: ((slides: Awaited<ReturnType<typeof import(
|
|
26
|
+
onSlidesExtracted?: ((slides: Awaited<ReturnType<typeof import("../slides/index.js").extractSlidesForSource>>) => void) | null;
|
|
27
27
|
onSlidesProgress?: ((text: string) => void) | null;
|
|
28
28
|
onSlidesDone?: ((result: {
|
|
29
29
|
ok: boolean;
|
|
@@ -15,6 +15,14 @@ export declare function buildLaunchAgentPlist({ label, programArguments, working
|
|
|
15
15
|
stdoutPath: string;
|
|
16
16
|
stderrPath: string;
|
|
17
17
|
}): string;
|
|
18
|
+
export declare function resolveLaunchctlTargetUid({ uid, sudoUid, }?: {
|
|
19
|
+
uid?: number;
|
|
20
|
+
sudoUid?: string;
|
|
21
|
+
}): number;
|
|
22
|
+
export declare function resolveLaunchctlDomains({ uid, sudoUid, }?: {
|
|
23
|
+
uid?: number;
|
|
24
|
+
sudoUid?: string;
|
|
25
|
+
}): string[];
|
|
18
26
|
export declare function isLaunchAgentLoaded(): Promise<boolean>;
|
|
19
27
|
export declare function uninstallLaunchAgent({ env, stdout, }: {
|
|
20
28
|
env: Record<string, string | undefined>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SummarizeConfig } from
|
|
1
|
+
import type { SummarizeConfig } from "../config.js";
|
|
2
2
|
export type ModelPickerOption = {
|
|
3
3
|
id: string;
|
|
4
4
|
label: string;
|
|
@@ -18,10 +18,14 @@ export declare function buildModelPickerOptions({ env, envForRun, configForCli,
|
|
|
18
18
|
anthropic: boolean;
|
|
19
19
|
openrouter: boolean;
|
|
20
20
|
zai: boolean;
|
|
21
|
+
cliClaude: boolean;
|
|
22
|
+
cliGemini: boolean;
|
|
23
|
+
cliCodex: boolean;
|
|
24
|
+
cliAgent: boolean;
|
|
21
25
|
};
|
|
22
26
|
openaiBaseUrl: string | null;
|
|
23
27
|
localModelsSource: {
|
|
24
|
-
kind:
|
|
28
|
+
kind: "openai-compatible";
|
|
25
29
|
baseUrlHost: string;
|
|
26
30
|
} | null;
|
|
27
31
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ProcessObserver } from
|
|
2
|
-
type ProcessStatus =
|
|
1
|
+
import type { ProcessObserver } from "@steipete/summarize-core/processes";
|
|
2
|
+
type ProcessStatus = "running" | "exited" | "error";
|
|
3
3
|
type OutputLine = {
|
|
4
|
-
stream:
|
|
4
|
+
stream: "stdout" | "stderr";
|
|
5
5
|
line: string;
|
|
6
6
|
};
|
|
7
7
|
type ProcessListItem = {
|
|
@@ -57,7 +57,7 @@ export declare class ProcessRegistry {
|
|
|
57
57
|
}): ProcessListResult;
|
|
58
58
|
getLogs(id: string, opts?: {
|
|
59
59
|
tail?: number;
|
|
60
|
-
stream?:
|
|
60
|
+
stream?: "stdout" | "stderr" | "merged";
|
|
61
61
|
}): ProcessLogResult | null;
|
|
62
62
|
private register;
|
|
63
63
|
private prune;
|
|
@@ -68,6 +68,6 @@ export declare function buildProcessListResult(registry: ProcessRegistry, opts?:
|
|
|
68
68
|
}): ProcessListResult;
|
|
69
69
|
export declare function buildProcessLogsResult(registry: ProcessRegistry, id: string, opts?: {
|
|
70
70
|
tail?: number;
|
|
71
|
-
stream?:
|
|
71
|
+
stream?: "stdout" | "stderr" | "merged";
|
|
72
72
|
}): ProcessLogResult | null;
|
|
73
73
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
1
|
+
import type { DaemonConfig } from "./config.js";
|
|
2
|
+
import { type SseEvent } from "../shared/sse-events.js";
|
|
3
3
|
type SessionEvent = SseEvent;
|
|
4
4
|
export declare function buildHealthPayload(importMetaUrl?: string): {
|
|
5
5
|
ok: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type LinkPreviewProgressEvent } from
|
|
1
|
+
import { type LinkPreviewProgressEvent } from "@steipete/summarize-core/content";
|
|
2
2
|
export declare function formatProgress(event: LinkPreviewProgressEvent): string | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CacheState } from
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
4
|
-
import
|
|
1
|
+
import type { CacheState } from "../cache.js";
|
|
2
|
+
import type { RunOverrides } from "../run/run-settings.js";
|
|
3
|
+
import type { SlideExtractionResult, SlideImage, SlideSettings, SlideSourceKind } from "../slides/index.js";
|
|
4
|
+
import { type ExtractedLinkContent, type MediaCache } from "../content/index.js";
|
|
5
5
|
export type VisiblePageInput = {
|
|
6
6
|
url: string;
|
|
7
7
|
title: string | null;
|
|
@@ -37,7 +37,7 @@ export declare function streamSummaryForVisiblePage({ env, fetchImpl, input, mod
|
|
|
37
37
|
promptOverride: string | null;
|
|
38
38
|
lengthRaw: unknown;
|
|
39
39
|
languageRaw: unknown;
|
|
40
|
-
format?:
|
|
40
|
+
format?: "text" | "markdown";
|
|
41
41
|
sink: StreamSink;
|
|
42
42
|
cache: CacheState;
|
|
43
43
|
mediaCache: MediaCache | null;
|
|
@@ -54,7 +54,7 @@ export declare function streamSummaryForUrl({ env, fetchImpl, input, modelOverri
|
|
|
54
54
|
promptOverride: string | null;
|
|
55
55
|
lengthRaw: unknown;
|
|
56
56
|
languageRaw: unknown;
|
|
57
|
-
format?:
|
|
57
|
+
format?: "text" | "markdown";
|
|
58
58
|
sink: StreamSink;
|
|
59
59
|
cache: CacheState;
|
|
60
60
|
mediaCache: MediaCache | null;
|
|
@@ -90,7 +90,7 @@ export declare function extractContentForUrl({ env, fetchImpl, input, cache, med
|
|
|
90
90
|
cache: CacheState;
|
|
91
91
|
mediaCache: MediaCache | null;
|
|
92
92
|
overrides: RunOverrides;
|
|
93
|
-
format?:
|
|
93
|
+
format?: "text" | "markdown";
|
|
94
94
|
slides?: SlideSettings | null;
|
|
95
95
|
hooks?: {
|
|
96
96
|
onSlidesExtracted?: ((slides: SlideExtractionResult) => void) | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ScrapeWithFirecrawl } from
|
|
1
|
+
import type { ScrapeWithFirecrawl } from "@steipete/summarize-core/content";
|
|
2
2
|
export declare function createFirecrawlScraper({ apiKey, fetchImpl, }: {
|
|
3
3
|
apiKey: string;
|
|
4
4
|
fetchImpl: typeof fetch;
|
package/dist/types/flags.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { SummaryLength } from
|
|
2
|
-
export type YoutubeMode =
|
|
3
|
-
export type FirecrawlMode =
|
|
4
|
-
export type MarkdownMode =
|
|
5
|
-
export type ExtractFormat =
|
|
6
|
-
export type PreprocessMode =
|
|
7
|
-
export type StreamMode =
|
|
8
|
-
export type MetricsMode =
|
|
9
|
-
export type VideoMode =
|
|
1
|
+
import type { SummaryLength } from "./shared/contracts.js";
|
|
2
|
+
export type YoutubeMode = "auto" | "web" | "apify" | "yt-dlp" | "no-auto";
|
|
3
|
+
export type FirecrawlMode = "off" | "auto" | "always";
|
|
4
|
+
export type MarkdownMode = "off" | "auto" | "llm" | "readability";
|
|
5
|
+
export type ExtractFormat = "text" | "markdown";
|
|
6
|
+
export type PreprocessMode = "off" | "auto" | "always";
|
|
7
|
+
export type StreamMode = "auto" | "on" | "off";
|
|
8
|
+
export type MetricsMode = "off" | "on" | "detailed";
|
|
9
|
+
export type VideoMode = "auto" | "transcript" | "understand";
|
|
10
10
|
export type LengthArg = {
|
|
11
|
-
kind:
|
|
11
|
+
kind: "preset";
|
|
12
12
|
preset: SummaryLength;
|
|
13
13
|
} | {
|
|
14
|
-
kind:
|
|
14
|
+
kind: "chars";
|
|
15
15
|
maxCharacters: number;
|
|
16
16
|
};
|
|
17
17
|
export declare function parseYoutubeMode(raw: string): YoutubeMode;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export type { SummaryLength } from
|
|
4
|
-
export { SUMMARY_LENGTHS } from
|
|
1
|
+
export * from "./content/index.js";
|
|
2
|
+
export * from "./prompts/index.js";
|
|
3
|
+
export type { SummaryLength } from "./shared/contracts.js";
|
|
4
|
+
export { SUMMARY_LENGTHS } from "./shared/contracts.js";
|
package/dist/types/language.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "@steipete/summarize-core/language";
|
package/dist/types/llm/cli.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CliConfig, CliProvider } from
|
|
2
|
-
import type { ExecFileFn } from
|
|
3
|
-
import type { LlmTokenUsage } from
|
|
1
|
+
import type { CliConfig, CliProvider } from "../config.js";
|
|
2
|
+
import type { ExecFileFn } from "../markitdown.js";
|
|
3
|
+
import type { LlmTokenUsage } from "./generate-text.js";
|
|
4
4
|
type RunCliModelOptions = {
|
|
5
5
|
provider: CliProvider;
|
|
6
6
|
prompt: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Context } from
|
|
2
|
-
import {
|
|
3
|
-
import type
|
|
1
|
+
import type { Context } from "@mariozechner/pi-ai";
|
|
2
|
+
import type { LlmTokenUsage } from "./types.js";
|
|
3
|
+
import { type Prompt } from "./prompt.js";
|
|
4
4
|
export type LlmApiKeys = {
|
|
5
5
|
xaiApiKey: string | null;
|
|
6
6
|
openaiApiKey: string | null;
|
|
@@ -11,7 +11,7 @@ export type LlmApiKeys = {
|
|
|
11
11
|
export type OpenRouterOptions = {
|
|
12
12
|
providers: string[] | null;
|
|
13
13
|
};
|
|
14
|
-
export type { LlmTokenUsage } from
|
|
14
|
+
export type { LlmTokenUsage } from "./types.js";
|
|
15
15
|
type RetryNotice = {
|
|
16
16
|
attempt: number;
|
|
17
17
|
maxRetries: number;
|
|
@@ -37,7 +37,7 @@ export declare function generateTextWithModelId({ modelId, apiKeys, prompt, temp
|
|
|
37
37
|
}): Promise<{
|
|
38
38
|
text: string;
|
|
39
39
|
canonicalModelId: string;
|
|
40
|
-
provider:
|
|
40
|
+
provider: "xai" | "openai" | "google" | "anthropic" | "zai";
|
|
41
41
|
usage: LlmTokenUsage | null;
|
|
42
42
|
}>;
|
|
43
43
|
export declare function streamTextWithModelId({ modelId, apiKeys, prompt, temperature, maxOutputTokens, timeoutMs, fetchImpl, forceOpenRouter, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, forceChatCompletions, }: {
|
|
@@ -57,7 +57,7 @@ export declare function streamTextWithModelId({ modelId, apiKeys, prompt, temper
|
|
|
57
57
|
}): Promise<{
|
|
58
58
|
textStream: AsyncIterable<string>;
|
|
59
59
|
canonicalModelId: string;
|
|
60
|
-
provider:
|
|
60
|
+
provider: "xai" | "openai" | "google" | "anthropic" | "zai";
|
|
61
61
|
usage: Promise<LlmTokenUsage | null>;
|
|
62
62
|
lastError: () => unknown;
|
|
63
63
|
}>;
|
|
@@ -78,7 +78,7 @@ export declare function streamTextWithContext({ modelId, apiKeys, context, tempe
|
|
|
78
78
|
}): Promise<{
|
|
79
79
|
textStream: AsyncIterable<string>;
|
|
80
80
|
canonicalModelId: string;
|
|
81
|
-
provider:
|
|
81
|
+
provider: "xai" | "openai" | "google" | "anthropic" | "zai";
|
|
82
82
|
usage: Promise<LlmTokenUsage | null>;
|
|
83
83
|
lastError: () => unknown;
|
|
84
84
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ConvertHtmlToMarkdown } from
|
|
2
|
-
import type { LlmTokenUsage } from
|
|
1
|
+
import type { ConvertHtmlToMarkdown } from "@steipete/summarize-core/content";
|
|
2
|
+
import type { LlmTokenUsage } from "./generate-text.js";
|
|
3
3
|
export declare function createHtmlToMarkdownConverter({ modelId, forceOpenRouter, xaiApiKey, googleApiKey, openaiApiKey, openaiBaseUrlOverride, anthropicBaseUrlOverride, googleBaseUrlOverride, xaiBaseUrlOverride, anthropicApiKey, openrouterApiKey, fetchImpl, forceChatCompletions, retries, onRetry, onUsage, }: {
|
|
4
4
|
modelId: string;
|
|
5
5
|
forceOpenRouter?: boolean;
|
|
@@ -23,7 +23,7 @@ export declare function createHtmlToMarkdownConverter({ modelId, forceOpenRouter
|
|
|
23
23
|
}) => void;
|
|
24
24
|
onUsage?: (usage: {
|
|
25
25
|
model: string;
|
|
26
|
-
provider:
|
|
26
|
+
provider: "xai" | "openai" | "google" | "anthropic" | "zai";
|
|
27
27
|
usage: LlmTokenUsage | null;
|
|
28
28
|
}) => void;
|
|
29
29
|
}): ConvertHtmlToMarkdown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UserMessage } from
|
|
2
|
-
import type { Attachment } from
|
|
1
|
+
import type { UserMessage } from "@mariozechner/pi-ai";
|
|
2
|
+
import type { Attachment } from "./attachments.js";
|
|
3
3
|
export type Prompt = {
|
|
4
4
|
system?: string;
|
|
5
5
|
userText: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Context } from
|
|
2
|
-
import type { Attachment } from
|
|
3
|
-
import type { LlmTokenUsage } from
|
|
1
|
+
import type { Context } from "@mariozechner/pi-ai";
|
|
2
|
+
import type { Attachment } from "../attachments.js";
|
|
3
|
+
import type { LlmTokenUsage } from "../types.js";
|
|
4
4
|
export declare function normalizeAnthropicModelAccessError(error: unknown, modelId: string): Error | null;
|
|
5
5
|
export declare function completeAnthropicText({ modelId, apiKey, context, temperature, maxOutputTokens, signal, anthropicBaseUrlOverride, }: {
|
|
6
6
|
modelId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Context } from
|
|
2
|
-
import type { Attachment } from
|
|
3
|
-
import type { LlmTokenUsage } from
|
|
1
|
+
import type { Context } from "@mariozechner/pi-ai";
|
|
2
|
+
import type { Attachment } from "../attachments.js";
|
|
3
|
+
import type { LlmTokenUsage } from "../types.js";
|
|
4
4
|
export declare function completeGoogleText({ modelId, apiKey, context, temperature, maxOutputTokens, signal, googleBaseUrlOverride, }: {
|
|
5
5
|
modelId: string;
|
|
6
6
|
apiKey: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Api, Context, Model } from
|
|
2
|
-
import type { OpenAiClientConfig } from
|
|
1
|
+
import type { Api, Context, Model } from "@mariozechner/pi-ai";
|
|
2
|
+
import type { OpenAiClientConfig } from "./types.js";
|
|
3
3
|
export declare function resolveOpenAiModel({ modelId, context, openaiConfig, }: {
|
|
4
4
|
modelId: string;
|
|
5
5
|
context: Context;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Context } from
|
|
2
|
-
import type { Attachment } from
|
|
3
|
-
import type { LlmTokenUsage } from
|
|
4
|
-
import type { OpenAiClientConfig } from
|
|
1
|
+
import type { Context } from "@mariozechner/pi-ai";
|
|
2
|
+
import type { Attachment } from "../attachments.js";
|
|
3
|
+
import type { LlmTokenUsage } from "../types.js";
|
|
4
|
+
import type { OpenAiClientConfig } from "./types.js";
|
|
5
5
|
export type OpenAiClientConfigInput = {
|
|
6
6
|
apiKeys: {
|
|
7
7
|
openaiApiKey: string | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Api, AssistantMessage, Context, KnownProvider, Model } from
|
|
1
|
+
import type { Api, AssistantMessage, Context, KnownProvider, Model } from "@mariozechner/pi-ai";
|
|
2
2
|
export declare function resolveBaseUrlOverride(raw: string | null | undefined): string | null;
|
|
3
3
|
export declare function bytesToBase64(bytes: Uint8Array): string;
|
|
4
4
|
export declare function extractText(message: AssistantMessage): string;
|
|
@@ -7,7 +7,7 @@ export declare function tryGetModel(provider: KnownProvider, modelId: string): M
|
|
|
7
7
|
export declare function createSyntheticModel({ provider, modelId, api, baseUrl, allowImages, headers, }: {
|
|
8
8
|
provider: KnownProvider;
|
|
9
9
|
modelId: string;
|
|
10
|
-
api: Model<Api>[
|
|
10
|
+
api: Model<Api>["api"];
|
|
11
11
|
baseUrl: string;
|
|
12
12
|
allowImages: boolean;
|
|
13
13
|
headers?: Record<string, string>;
|