@steipete/summarize 0.16.3 → 0.17.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 +27 -1
- package/README.md +58 -13
- package/dist/esm/cache-keys.js +15 -0
- package/dist/esm/cache-keys.js.map +1 -1
- package/dist/esm/cache.js +12 -31
- package/dist/esm/cache.js.map +1 -1
- package/dist/esm/cli.js +1 -1
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/config/env.js +2 -0
- package/dist/esm/config/env.js.map +1 -1
- package/dist/esm/config/parse-helpers.js +3 -1
- package/dist/esm/config/parse-helpers.js.map +1 -1
- package/dist/esm/config/sections.js +8 -0
- package/dist/esm/config/sections.js.map +1 -1
- package/dist/esm/config/speakers.js +173 -0
- package/dist/esm/config/speakers.js.map +1 -0
- package/dist/esm/config.js +5 -0
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/costs.js.map +1 -1
- package/dist/esm/daemon/agent-model.js +44 -8
- package/dist/esm/daemon/agent-model.js.map +1 -1
- package/dist/esm/daemon/agent.js +6 -0
- package/dist/esm/daemon/agent.js.map +1 -1
- package/dist/esm/daemon/chat.js +109 -18
- package/dist/esm/daemon/chat.js.map +1 -1
- package/dist/esm/daemon/env-snapshot.js +5 -0
- package/dist/esm/daemon/env-snapshot.js.map +1 -1
- package/dist/esm/daemon/flow-context.js +13 -2
- package/dist/esm/daemon/flow-context.js.map +1 -1
- package/dist/esm/daemon/models.js +26 -0
- package/dist/esm/daemon/models.js.map +1 -1
- package/dist/esm/daemon/server-admin-routes.js +10 -1
- package/dist/esm/daemon/server-admin-routes.js.map +1 -1
- package/dist/esm/daemon/server-summarize-request.js +1 -0
- package/dist/esm/daemon/server-summarize-request.js.map +1 -1
- package/dist/esm/daemon/url-fetch-guard.js +36 -11
- package/dist/esm/daemon/url-fetch-guard.js.map +1 -1
- package/dist/esm/flags.js +7 -0
- package/dist/esm/flags.js.map +1 -1
- package/dist/esm/llm/cli-provider-output.js +111 -1
- package/dist/esm/llm/cli-provider-output.js.map +1 -1
- package/dist/esm/llm/cli.js +87 -6
- package/dist/esm/llm/cli.js.map +1 -1
- package/dist/esm/llm/generate-text-stream.js +40 -22
- package/dist/esm/llm/generate-text-stream.js.map +1 -1
- package/dist/esm/llm/generate-text.js +31 -2
- package/dist/esm/llm/generate-text.js.map +1 -1
- package/dist/esm/llm/model-id.js +2 -1
- package/dist/esm/llm/model-id.js.map +1 -1
- package/dist/esm/llm/model-options.js +22 -0
- package/dist/esm/llm/model-options.js.map +1 -1
- package/dist/esm/llm/provider-profile.js +30 -4
- package/dist/esm/llm/provider-profile.js.map +1 -1
- package/dist/esm/llm/providers/anthropic.js +41 -3
- package/dist/esm/llm/providers/anthropic.js.map +1 -1
- package/dist/esm/llm/providers/minimax.js +6 -0
- package/dist/esm/llm/providers/minimax.js.map +1 -0
- package/dist/esm/llm/providers/models.js +30 -1
- package/dist/esm/llm/providers/models.js.map +1 -1
- package/dist/esm/llm/providers/openai.js +40 -10
- package/dist/esm/llm/providers/openai.js.map +1 -1
- package/dist/esm/model-auto-cli.js +5 -1
- package/dist/esm/model-auto-cli.js.map +1 -1
- package/dist/esm/model-spec.js +26 -2
- package/dist/esm/model-spec.js.map +1 -1
- package/dist/esm/run/cli-fallback-state.js +3 -1
- package/dist/esm/run/cli-fallback-state.js.map +1 -1
- package/dist/esm/run/env.js +8 -2
- package/dist/esm/run/env.js.map +1 -1
- package/dist/esm/run/flows/asset/summary-attempts.js +12 -6
- package/dist/esm/run/flows/asset/summary-attempts.js.map +1 -1
- package/dist/esm/run/flows/asset/summary.js +6 -3
- package/dist/esm/run/flows/asset/summary.js.map +1 -1
- package/dist/esm/run/flows/url/extraction-session.js +65 -3
- package/dist/esm/run/flows/url/extraction-session.js.map +1 -1
- package/dist/esm/run/flows/url/fetch-options.js +1 -0
- package/dist/esm/run/flows/url/fetch-options.js.map +1 -1
- package/dist/esm/run/flows/url/flow.js +1 -1
- package/dist/esm/run/flows/url/flow.js.map +1 -1
- package/dist/esm/run/flows/url/markdown.js +38 -7
- package/dist/esm/run/flows/url/markdown.js.map +1 -1
- package/dist/esm/run/flows/url/slides-text-markdown.js +57 -9
- package/dist/esm/run/flows/url/slides-text-markdown.js.map +1 -1
- package/dist/esm/run/flows/url/summary-resolution.js +13 -7
- package/dist/esm/run/flows/url/summary-resolution.js.map +1 -1
- package/dist/esm/run/flows/url/types.js.map +1 -1
- package/dist/esm/run/help.js +17 -2
- package/dist/esm/run/help.js.map +1 -1
- package/dist/esm/run/run-config.js +8 -5
- package/dist/esm/run/run-config.js.map +1 -1
- package/dist/esm/run/run-env.js +14 -1
- package/dist/esm/run/run-env.js.map +1 -1
- package/dist/esm/run/run-metrics.js +25 -2
- package/dist/esm/run/run-metrics.js.map +1 -1
- package/dist/esm/run/run-models.js +4 -0
- package/dist/esm/run/run-models.js.map +1 -1
- package/dist/esm/run/run-settings-parse.js +4 -0
- package/dist/esm/run/run-settings-parse.js.map +1 -1
- package/dist/esm/run/run-settings.js +3 -2
- package/dist/esm/run/run-settings.js.map +1 -1
- package/dist/esm/run/runner-contexts.js +2 -0
- package/dist/esm/run/runner-contexts.js.map +1 -1
- package/dist/esm/run/runner-flags.js +27 -1
- package/dist/esm/run/runner-flags.js.map +1 -1
- package/dist/esm/run/runner-plan.js +29 -3
- package/dist/esm/run/runner-plan.js.map +1 -1
- package/dist/esm/run/runner-setup.js +9 -1
- package/dist/esm/run/runner-setup.js.map +1 -1
- package/dist/esm/run/streaming.js +1 -0
- package/dist/esm/run/streaming.js.map +1 -1
- package/dist/esm/run/summary-engine.js +40 -5
- package/dist/esm/run/summary-engine.js.map +1 -1
- package/dist/esm/shared/cache-store.js +68 -0
- package/dist/esm/shared/cache-store.js.map +1 -0
- package/dist/esm/shared/dns-pinned-fetch.js +93 -0
- package/dist/esm/shared/dns-pinned-fetch.js.map +1 -0
- package/dist/esm/shared/fetch-capabilities.js +37 -0
- package/dist/esm/shared/fetch-capabilities.js.map +1 -0
- package/dist/esm/shared/slides-presentation.js +3 -2
- package/dist/esm/shared/slides-presentation.js.map +1 -1
- package/dist/esm/shared/sse-events.js.map +1 -1
- package/dist/esm/shared/transcript-diarization-cache-scope.js +71 -0
- package/dist/esm/shared/transcript-diarization-cache-scope.js.map +1 -0
- package/dist/esm/slides/extract.js +11 -3
- package/dist/esm/slides/extract.js.map +1 -1
- package/dist/esm/slides/frame-extraction.js.map +1 -1
- package/dist/esm/slides/process.js +14 -3
- package/dist/esm/slides/process.js.map +1 -1
- package/dist/esm/slides/scene-detection.js +1 -1
- package/dist/esm/slides/scene-detection.js.map +1 -1
- package/dist/esm/speaker-identification/identify.js +274 -0
- package/dist/esm/speaker-identification/identify.js.map +1 -0
- package/dist/esm/speaker-identification/index.js +5 -0
- package/dist/esm/speaker-identification/index.js.map +1 -0
- package/dist/esm/speaker-identification/openai.js +110 -0
- package/dist/esm/speaker-identification/openai.js.map +1 -0
- package/dist/esm/speaker-identification/remember.js +181 -0
- package/dist/esm/speaker-identification/remember.js.map +1 -0
- package/dist/esm/speaker-identification/settings.js +110 -0
- package/dist/esm/speaker-identification/settings.js.map +1 -0
- package/dist/esm/speaker-identification/types.js +2 -0
- package/dist/esm/speaker-identification/types.js.map +1 -0
- package/dist/esm/tokenizer.js +25 -0
- package/dist/esm/tokenizer.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/cache-keys.d.ts +8 -0
- package/dist/types/cache.d.ts +3 -11
- package/dist/types/config/speakers.d.ts +2 -0
- package/dist/types/config/types.d.ts +43 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/costs.d.ts +2 -2
- package/dist/types/daemon/agent-model.d.ts +1 -0
- package/dist/types/daemon/env-snapshot.d.ts +1 -1
- package/dist/types/daemon/models.d.ts +3 -0
- package/dist/types/daemon/url-fetch-guard.d.ts +2 -1
- package/dist/types/flags.d.ts +2 -0
- package/dist/types/llm/cli-provider-output.d.ts +6 -1
- package/dist/types/llm/cli.d.ts +2 -1
- package/dist/types/llm/model-id.d.ts +1 -1
- package/dist/types/llm/model-options.d.ts +20 -0
- package/dist/types/llm/provider-profile.d.ts +4 -3
- package/dist/types/llm/providers/anthropic.d.ts +29 -2
- package/dist/types/llm/providers/minimax.d.ts +1 -0
- package/dist/types/llm/providers/models.d.ts +5 -0
- package/dist/types/llm/providers/openai.d.ts +6 -1
- package/dist/types/model-spec.d.ts +2 -2
- package/dist/types/run/flows/asset/summary.d.ts +2 -0
- package/dist/types/run/flows/url/fetch-options.d.ts +1 -0
- package/dist/types/run/flows/url/markdown.d.ts +1 -1
- package/dist/types/run/flows/url/slides-text-markdown.d.ts +2 -1
- package/dist/types/run/flows/url/types.d.ts +9 -2
- package/dist/types/run/run-config.d.ts +3 -2
- package/dist/types/run/run-context.d.ts +5 -1
- package/dist/types/run/run-env.d.ts +3 -0
- package/dist/types/run/run-settings.d.ts +4 -2
- package/dist/types/run/runner-flags.d.ts +6 -1
- package/dist/types/run/runner-setup.d.ts +1 -0
- package/dist/types/run/summary-engine.d.ts +9 -4
- package/dist/types/run/types.d.ts +1 -1
- package/dist/types/shared/cache-store.d.ts +34 -0
- package/dist/types/shared/dns-pinned-fetch.d.ts +1 -0
- package/dist/types/shared/fetch-capabilities.d.ts +10 -0
- package/dist/types/shared/slides-presentation.d.ts +2 -1
- package/dist/types/shared/sse-events.d.ts +1 -0
- package/dist/types/shared/transcript-diarization-cache-scope.d.ts +11 -0
- package/dist/types/slides/frame-extraction.d.ts +4 -3
- package/dist/types/slides/process.d.ts +8 -3
- package/dist/types/slides/scene-detection.d.ts +4 -3
- package/dist/types/speaker-identification/identify.d.ts +40 -0
- package/dist/types/speaker-identification/index.d.ts +5 -0
- package/dist/types/speaker-identification/openai.d.ts +27 -0
- package/dist/types/speaker-identification/remember.d.ts +7 -0
- package/dist/types/speaker-identification/settings.d.ts +6 -0
- package/dist/types/speaker-identification/types.d.ts +38 -0
- package/dist/types/tokenizer.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/docs/README.md +1 -1
- package/docs/cache.md +1 -1
- package/docs/chrome-extension.md +6 -4
- package/docs/cli.md +30 -3
- package/docs/commands/slides.md +3 -3
- package/docs/commands/summarize.md +22 -2
- package/docs/config.md +40 -2
- package/docs/index.md +1 -1
- package/docs/install.md +11 -9
- package/docs/llm.md +15 -2
- package/docs/media.md +2 -1
- package/docs/transcript-provider-flow.md +10 -0
- package/docs/youtube.md +45 -1
- package/package.json +16 -16
package/dist/types/costs.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { LlmTokenUsage } from "./llm/generate-text.js";
|
|
2
|
-
export type LlmProvider = "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "github-copilot" | "ollama" | "cli";
|
|
2
|
+
export type LlmProvider = "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "minimax" | "github-copilot" | "ollama" | "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: "summary" | "markdown";
|
|
8
|
+
purpose: "summary" | "markdown" | "speaker-identification";
|
|
9
9
|
};
|
|
10
10
|
export type RunMetricsReport = {
|
|
11
11
|
llm: Array<{
|
|
@@ -1,4 +1,4 @@
|
|
|
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", "NVIDIA_API_KEY", "NGC_API_KEY", "NVIDIA_BASE_URL", "Z_AI_API_KEY", "ZAI_API_KEY", "Z_AI_BASE_URL", "ZAI_BASE_URL", "OLLAMA_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", "ASSEMBLYAI_API_KEY", "SUMMARIZE_MODEL", "SUMMARIZE_TRANSCRIBER", "SUMMARIZE_ONNX_PARAKEET_CMD", "SUMMARIZE_ONNX_CANARY_CMD", "CLAUDE_PATH", "CODEX_PATH", "GEMINI_PATH", "AGENT_PATH", "OPENCLAW_PATH", "OPENCODE_PATH", "COPILOT_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", "NVIDIA_API_KEY", "NGC_API_KEY", "NVIDIA_BASE_URL", "MINIMAX_API_KEY", "MINIMAX_BASE_URL", "Z_AI_API_KEY", "ZAI_API_KEY", "Z_AI_BASE_URL", "ZAI_BASE_URL", "OLLAMA_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", "ASSEMBLYAI_API_KEY", "ELEVENLABS_API_KEY", "SUMMARIZE_MODEL", "SUMMARIZE_TRANSCRIBER", "SUMMARIZE_ONNX_PARAKEET_CMD", "SUMMARIZE_ONNX_CANARY_CMD", "CLAUDE_PATH", "CODEX_PATH", "GEMINI_PATH", "AGENT_PATH", "OPENCLAW_PATH", "OPENCODE_PATH", "COPILOT_PATH", "AGY_PATH", "ANTIGRAVITY_API_KEY", "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 {};
|
|
@@ -15,6 +15,7 @@ export declare function buildModelPickerOptions({ env, envForRun, configForCli,
|
|
|
15
15
|
xai: boolean;
|
|
16
16
|
openai: boolean;
|
|
17
17
|
nvidia: boolean;
|
|
18
|
+
minimax: boolean;
|
|
18
19
|
google: boolean;
|
|
19
20
|
anthropic: boolean;
|
|
20
21
|
openrouter: boolean;
|
|
@@ -27,6 +28,8 @@ export declare function buildModelPickerOptions({ env, envForRun, configForCli,
|
|
|
27
28
|
cliOpenclaw: boolean;
|
|
28
29
|
cliOpencode: boolean;
|
|
29
30
|
cliCopilot: boolean;
|
|
31
|
+
cliAgy: boolean;
|
|
32
|
+
cliPi: boolean;
|
|
30
33
|
};
|
|
31
34
|
openaiBaseUrl: string | null;
|
|
32
35
|
localModelsSource: {
|
|
@@ -7,7 +7,8 @@ export declare function isBlockedNetworkAddress(address: string): boolean;
|
|
|
7
7
|
export declare function assertDaemonUrlFetchAllowed(rawUrl: string, options?: {
|
|
8
8
|
lookup?: LookupFn;
|
|
9
9
|
}): Promise<void>;
|
|
10
|
-
export declare function createDaemonUrlFetchGuard(fetchImpl: typeof fetch, { lookup }?: {
|
|
10
|
+
export declare function createDaemonUrlFetchGuard(fetchImpl: typeof fetch, { lookup, pinnedFetchImpl, }?: {
|
|
11
11
|
lookup?: LookupFn;
|
|
12
|
+
pinnedFetchImpl?: typeof fetch;
|
|
12
13
|
}): typeof fetch;
|
|
13
14
|
export {};
|
package/dist/types/flags.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type PreprocessMode = "off" | "auto" | "always";
|
|
|
7
7
|
export type StreamMode = "auto" | "on" | "off";
|
|
8
8
|
export type MetricsMode = "off" | "on" | "detailed";
|
|
9
9
|
export type VideoMode = "auto" | "transcript" | "understand";
|
|
10
|
+
export type DiarizationMode = "auto" | "elevenlabs" | "openai";
|
|
10
11
|
export type LengthArg = {
|
|
11
12
|
kind: "preset";
|
|
12
13
|
preset: SummaryLength;
|
|
@@ -22,6 +23,7 @@ export declare function parsePreprocessMode(raw: string): PreprocessMode;
|
|
|
22
23
|
export declare function parseStreamMode(raw: string): StreamMode;
|
|
23
24
|
export declare function parseMetricsMode(raw: string): MetricsMode;
|
|
24
25
|
export declare function parseVideoMode(raw: string): VideoMode;
|
|
26
|
+
export declare function parseDiarizationMode(raw: string): DiarizationMode;
|
|
25
27
|
export declare function parseDurationMs(raw: string): number;
|
|
26
28
|
export declare function parseLengthArg(raw: string): LengthArg;
|
|
27
29
|
export declare function parseMaxExtractCharactersArg(raw: string | undefined): number | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CliProvider } from "../config.js";
|
|
2
2
|
import type { LlmTokenUsage } from "./generate-text.js";
|
|
3
|
-
export type JsonCliProvider = Exclude<CliProvider, "codex" | "openclaw" | "opencode" | "copilot">;
|
|
3
|
+
export type JsonCliProvider = Exclude<CliProvider, "codex" | "openclaw" | "opencode" | "copilot" | "agy" | "pi">;
|
|
4
4
|
export declare function isJsonCliProvider(provider: CliProvider): provider is JsonCliProvider;
|
|
5
5
|
export declare const parseCodexUsageFromJsonl: (output: string) => {
|
|
6
6
|
usage: LlmTokenUsage | null;
|
|
@@ -23,3 +23,8 @@ export declare function parseJsonProviderOutput(args: {
|
|
|
23
23
|
usage: LlmTokenUsage | null;
|
|
24
24
|
costUsd: number | null;
|
|
25
25
|
};
|
|
26
|
+
export declare function parsePiOutputFromJsonl(output: string): {
|
|
27
|
+
text: string;
|
|
28
|
+
usage: LlmTokenUsage | null;
|
|
29
|
+
costUsd: number | null;
|
|
30
|
+
};
|
package/dist/types/llm/cli.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ type RunCliModelOptions = {
|
|
|
12
12
|
config: CliConfig | null;
|
|
13
13
|
cwd?: string;
|
|
14
14
|
extraArgs?: string[];
|
|
15
|
+
systemPrompt?: string | null;
|
|
15
16
|
};
|
|
16
17
|
type CliRunResult = {
|
|
17
18
|
text: string;
|
|
@@ -20,5 +21,5 @@ type CliRunResult = {
|
|
|
20
21
|
};
|
|
21
22
|
export declare function isCliDisabled(provider: CliProvider, config: CliConfig | null | undefined): boolean;
|
|
22
23
|
export declare function resolveCliBinary(provider: CliProvider, config: CliConfig | null | undefined, env: Record<string, string | undefined>): string;
|
|
23
|
-
export declare function runCliModel({ provider, prompt, model, allowTools, timeoutMs, env, execFileImpl, config, cwd, extraArgs, }: RunCliModelOptions): Promise<CliRunResult>;
|
|
24
|
+
export declare function runCliModel({ provider, prompt, model, allowTools, timeoutMs, env, execFileImpl, config, cwd, extraArgs, systemPrompt, }: RunCliModelOptions): Promise<CliRunResult>;
|
|
24
25
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type LlmProvider = "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "github-copilot" | "ollama";
|
|
1
|
+
export type LlmProvider = "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "minimax" | "github-copilot" | "ollama";
|
|
2
2
|
export type ParsedModelId = {
|
|
3
3
|
provider: LlmProvider;
|
|
4
4
|
/**
|
|
@@ -13,4 +13,24 @@ export declare function parseOpenAiReasoningEffort(raw: string, label?: string):
|
|
|
13
13
|
export declare function parseOpenAiTextVerbosity(raw: string, label?: string): OpenAiTextVerbosity;
|
|
14
14
|
export declare function parseOpenAiServiceTier(raw: string, label?: string): OpenAiServiceTier;
|
|
15
15
|
export declare function mergeModelRequestOptions(...entries: Array<ModelRequestOptionsInput | null | undefined>): ModelRequestOptions | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Merge request options for a specific provider.
|
|
18
|
+
*
|
|
19
|
+
* - `openaiGlobalDefault` comes from the persisted `openai.*` config block — a
|
|
20
|
+
* provider-scoped default that must NOT bleed into non-openai requests.
|
|
21
|
+
* - `openaiOverride` comes from `--fast` / `--service-tier`, which are
|
|
22
|
+
* documented as OpenAI-only knobs. Also only for the openai provider.
|
|
23
|
+
* - `cliReasoningEffortOverride` comes from the explicit `--thinking` CLI flag,
|
|
24
|
+
* which is cross-provider (the user opted in for this run). It is forwarded
|
|
25
|
+
* to whichever provider is dispatched.
|
|
26
|
+
* - `attemptOptions` is the per-attempt options bag (from the model config or
|
|
27
|
+
* provider-prefixed CLI id) and applies to every provider.
|
|
28
|
+
*/
|
|
29
|
+
export declare function mergeRequestOptionsForProvider({ provider, openaiGlobalDefault, attemptOptions, openaiOverride, cliReasoningEffortOverride, }: {
|
|
30
|
+
provider: string;
|
|
31
|
+
openaiGlobalDefault: ModelRequestOptionsInput | null | undefined;
|
|
32
|
+
attemptOptions: ModelRequestOptionsInput | null | undefined;
|
|
33
|
+
openaiOverride: ModelRequestOptionsInput | null | undefined;
|
|
34
|
+
cliReasoningEffortOverride?: OpenAiReasoningEffort | undefined;
|
|
35
|
+
}): ModelRequestOptions | undefined;
|
|
16
36
|
export declare function toOpenAiServiceTierParam(serviceTier: string | undefined): string | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CliProvider } from "../config.js";
|
|
2
2
|
import type { ModelRequestOptions } from "./model-options.js";
|
|
3
3
|
import type { OpenAiClientConfig } from "./providers/types.js";
|
|
4
|
-
export type GatewayProvider = "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "github-copilot" | "ollama";
|
|
5
|
-
export type RequiredModelEnv = "XAI_API_KEY" | "OPENAI_API_KEY" | "NVIDIA_API_KEY" | "GEMINI_API_KEY" | "ANTHROPIC_API_KEY" | "OPENROUTER_API_KEY" | "Z_AI_API_KEY" | "GITHUB_TOKEN" | "OLLAMA_BASE_URL" | "CLI_CLAUDE" | "CLI_CODEX" | "CLI_GEMINI" | "CLI_AGENT" | "CLI_OPENCLAW" | "CLI_OPENCODE" | "CLI_COPILOT";
|
|
4
|
+
export type GatewayProvider = "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "minimax" | "github-copilot" | "ollama";
|
|
5
|
+
export type RequiredModelEnv = "XAI_API_KEY" | "OPENAI_API_KEY" | "NVIDIA_API_KEY" | "GEMINI_API_KEY" | "ANTHROPIC_API_KEY" | "OPENROUTER_API_KEY" | "Z_AI_API_KEY" | "MINIMAX_API_KEY" | "GITHUB_TOKEN" | "OLLAMA_BASE_URL" | "CLI_CLAUDE" | "CLI_CODEX" | "CLI_GEMINI" | "CLI_AGENT" | "CLI_OPENCLAW" | "CLI_OPENCODE" | "CLI_COPILOT" | "CLI_AGY" | "CLI_PI";
|
|
6
6
|
type GatewayProviderProfile = {
|
|
7
7
|
requiredEnv: RequiredModelEnv;
|
|
8
8
|
supportsDocuments: boolean;
|
|
@@ -10,6 +10,7 @@ type GatewayProviderProfile = {
|
|
|
10
10
|
supportsVideoUnderstanding: boolean;
|
|
11
11
|
};
|
|
12
12
|
export declare const DEFAULT_OLLAMA_BASE_URL = "http://localhost:11434/v1";
|
|
13
|
+
export declare const DEFAULT_MINIMAX_BASE_URL = "https://api.minimax.io/v1";
|
|
13
14
|
export declare const DEFAULT_CLI_MODELS: Record<CliProvider, string | null>;
|
|
14
15
|
export declare const DEFAULT_AUTO_CLI_ORDER: CliProvider[];
|
|
15
16
|
export declare function parseCliProviderName(raw: string): CliProvider | null;
|
|
@@ -23,7 +24,7 @@ export declare function envHasRequiredKey(env: Record<string, string | undefined
|
|
|
23
24
|
export declare function resolveRequiredEnvForModelId(modelId: string): RequiredModelEnv;
|
|
24
25
|
export declare function isVideoUnderstandingCapableModelId(modelId: string): boolean;
|
|
25
26
|
export declare function resolveOpenAiCompatibleClientConfigForProvider({ provider, openaiApiKey, openrouterApiKey, forceOpenRouter, openaiBaseUrlOverride, forceChatCompletions, requestOptions, }: {
|
|
26
|
-
provider: "openai" | "zai" | "nvidia" | "github-copilot" | "ollama";
|
|
27
|
+
provider: "openai" | "zai" | "nvidia" | "minimax" | "github-copilot" | "ollama";
|
|
27
28
|
openaiApiKey: string | null;
|
|
28
29
|
openrouterApiKey: string | null;
|
|
29
30
|
forceOpenRouter?: boolean;
|
|
@@ -1,13 +1,40 @@
|
|
|
1
|
-
import type { Context } from "@earendil-works/pi-ai";
|
|
1
|
+
import type { Context, Model, ThinkingLevel } from "@earendil-works/pi-ai";
|
|
2
|
+
import type { Api } from "@earendil-works/pi-ai";
|
|
2
3
|
import type { Attachment } from "../attachments.js";
|
|
4
|
+
import type { OpenAiReasoningEffort } from "../model-options.js";
|
|
3
5
|
import type { LlmTokenUsage } from "../types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Decide the model and `reasoning` option to pass into the pi-ai Anthropic
|
|
8
|
+
* adapter. Shared by non-streaming and streaming text dispatch.
|
|
9
|
+
*
|
|
10
|
+
* pi-ai 0.75.5 enables extended thinking whenever the caller passes a
|
|
11
|
+
* `reasoning` option, regardless of `model.reasoning`. So:
|
|
12
|
+
*
|
|
13
|
+
* - Registered models with `reasoning: true` (Claude 4+): forward `reasoning`.
|
|
14
|
+
* - Registered models with `reasoning: false` (Claude 3 / 3.5): drop
|
|
15
|
+
* `reasoning` entirely; forwarding it would have pi-ai send a `thinking`
|
|
16
|
+
* block to an API that rejects it.
|
|
17
|
+
* - Synthetic models (`tryGetModel` miss — typically custom
|
|
18
|
+
* `ANTHROPIC_BASE_URL` proxies in front of newer Claude versions):
|
|
19
|
+
* `createSyntheticModel` hard-codes `reasoning: false`, so we flip a copy
|
|
20
|
+
* to `reasoning: true` and forward the effort level.
|
|
21
|
+
*/
|
|
22
|
+
export declare function prepareAnthropicReasoning({ modelId, baseModel, reasoningEffort, }: {
|
|
23
|
+
modelId: string;
|
|
24
|
+
baseModel: Model<Api>;
|
|
25
|
+
reasoningEffort?: OpenAiReasoningEffort;
|
|
26
|
+
}): {
|
|
27
|
+
model: Model<Api>;
|
|
28
|
+
reasoning?: ThinkingLevel;
|
|
29
|
+
};
|
|
4
30
|
export declare function normalizeAnthropicModelAccessError(error: unknown, modelId: string): Error | null;
|
|
5
|
-
export declare function completeAnthropicText({ modelId, apiKey, context, temperature, maxOutputTokens, signal, anthropicBaseUrlOverride, }: {
|
|
31
|
+
export declare function completeAnthropicText({ modelId, apiKey, context, temperature, maxOutputTokens, reasoningEffort, signal, anthropicBaseUrlOverride, }: {
|
|
6
32
|
modelId: string;
|
|
7
33
|
apiKey: string;
|
|
8
34
|
context: Context;
|
|
9
35
|
temperature?: number;
|
|
10
36
|
maxOutputTokens?: number;
|
|
37
|
+
reasoningEffort?: OpenAiReasoningEffort;
|
|
11
38
|
signal: AbortSignal;
|
|
12
39
|
anthropicBaseUrlOverride?: string | null;
|
|
13
40
|
}): Promise<{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function enableMinimaxReasoningSplit(payload: unknown): unknown;
|
|
@@ -15,6 +15,11 @@ export declare function resolveNvidiaModel({ modelId, context, openaiBaseUrlOver
|
|
|
15
15
|
context: Context;
|
|
16
16
|
openaiBaseUrlOverride?: string | null;
|
|
17
17
|
}): Model<Api>;
|
|
18
|
+
export declare function resolveMinimaxModel({ modelId, openaiBaseUrlOverride, }: {
|
|
19
|
+
modelId: string;
|
|
20
|
+
context: Context;
|
|
21
|
+
openaiBaseUrlOverride?: string | null;
|
|
22
|
+
}): Model<Api>;
|
|
18
23
|
export declare function resolveOllamaModel({ modelId, context, ollamaBaseUrlOverride, }: {
|
|
19
24
|
modelId: string;
|
|
20
25
|
context: Context;
|
|
@@ -23,8 +23,12 @@ type OpenAiTextStreamResult = {
|
|
|
23
23
|
usage: Promise<LlmTokenUsage | null>;
|
|
24
24
|
resolvedModelId?: string;
|
|
25
25
|
};
|
|
26
|
+
export type OpenAiStructuredOutput = {
|
|
27
|
+
name: string;
|
|
28
|
+
schema: Record<string, unknown>;
|
|
29
|
+
};
|
|
26
30
|
export declare function resolveOpenAiClientConfig({ apiKeys, forceOpenRouter, openaiBaseUrlOverride, forceChatCompletions, requestOptions, }: OpenAiClientConfigInput): OpenAiClientConfig;
|
|
27
|
-
export declare function completeOpenAiText({ modelId, openaiConfig, context, temperature, maxOutputTokens, signal, fetchImpl, }: {
|
|
31
|
+
export declare function completeOpenAiText({ modelId, openaiConfig, context, temperature, maxOutputTokens, signal, fetchImpl, structuredOutput, }: {
|
|
28
32
|
modelId: string;
|
|
29
33
|
openaiConfig: OpenAiClientConfig;
|
|
30
34
|
context: Context;
|
|
@@ -32,6 +36,7 @@ export declare function completeOpenAiText({ modelId, openaiConfig, context, tem
|
|
|
32
36
|
maxOutputTokens?: number;
|
|
33
37
|
signal: AbortSignal;
|
|
34
38
|
fetchImpl?: typeof fetch;
|
|
39
|
+
structuredOutput?: OpenAiStructuredOutput;
|
|
35
40
|
}): Promise<OpenAiTextCompletionResult>;
|
|
36
41
|
export declare function streamOpenAiText({ modelId, openaiConfig, context, temperature, maxOutputTokens, signal, fetchImpl, }: {
|
|
37
42
|
modelId: string;
|
|
@@ -8,7 +8,7 @@ export type FixedModelSpec = {
|
|
|
8
8
|
provider: LlmProvider;
|
|
9
9
|
openrouterProviders: string[] | null;
|
|
10
10
|
forceOpenRouter: false;
|
|
11
|
-
requiredEnv: "XAI_API_KEY" | "OPENAI_API_KEY" | "GEMINI_API_KEY" | "ANTHROPIC_API_KEY" | "Z_AI_API_KEY" | "NVIDIA_API_KEY" | "GITHUB_TOKEN" | "OLLAMA_BASE_URL";
|
|
11
|
+
requiredEnv: "XAI_API_KEY" | "OPENAI_API_KEY" | "GEMINI_API_KEY" | "ANTHROPIC_API_KEY" | "Z_AI_API_KEY" | "NVIDIA_API_KEY" | "MINIMAX_API_KEY" | "GITHUB_TOKEN" | "OLLAMA_BASE_URL";
|
|
12
12
|
openaiBaseUrlOverride?: string | null;
|
|
13
13
|
forceChatCompletions?: boolean;
|
|
14
14
|
requestOptions?: ModelRequestOptions;
|
|
@@ -27,7 +27,7 @@ export type FixedModelSpec = {
|
|
|
27
27
|
llmModelId: null;
|
|
28
28
|
openrouterProviders: null;
|
|
29
29
|
forceOpenRouter: false;
|
|
30
|
-
requiredEnv: "CLI_CLAUDE" | "CLI_CODEX" | "CLI_GEMINI" | "CLI_AGENT" | "CLI_OPENCLAW" | "CLI_OPENCODE" | "CLI_COPILOT";
|
|
30
|
+
requiredEnv: "CLI_CLAUDE" | "CLI_CODEX" | "CLI_GEMINI" | "CLI_AGENT" | "CLI_OPENCLAW" | "CLI_OPENCODE" | "CLI_COPILOT" | "CLI_AGY" | "CLI_PI";
|
|
31
31
|
cliProvider: CliProvider;
|
|
32
32
|
cliModel: string | null;
|
|
33
33
|
};
|
|
@@ -70,6 +70,7 @@ export type AssetSummaryContext = {
|
|
|
70
70
|
xaiApiKey: string | null;
|
|
71
71
|
apiKey: string | null;
|
|
72
72
|
nvidiaApiKey: string | null;
|
|
73
|
+
minimaxApiKey: string | null;
|
|
73
74
|
openrouterApiKey: string | null;
|
|
74
75
|
apifyToken: string | null;
|
|
75
76
|
firecrawlConfigured: boolean;
|
|
@@ -85,6 +86,7 @@ export type AssetSummaryContext = {
|
|
|
85
86
|
zaiApiKey: string | null;
|
|
86
87
|
zaiBaseUrl: string;
|
|
87
88
|
nvidiaBaseUrl: string;
|
|
89
|
+
minimaxBaseUrl: string;
|
|
88
90
|
ollamaBaseUrl: string;
|
|
89
91
|
assemblyaiApiKey: string | null;
|
|
90
92
|
openaiApiKey: string | null;
|
|
@@ -5,6 +5,7 @@ type UrlFetchFlags = {
|
|
|
5
5
|
youtubeMode: "auto" | "web" | "apify" | "yt-dlp" | "no-auto";
|
|
6
6
|
videoMode: "auto" | "transcript" | "understand";
|
|
7
7
|
transcriptTimestamps: boolean;
|
|
8
|
+
transcriptDiarization: "auto" | "elevenlabs" | "openai" | null;
|
|
8
9
|
firecrawlMode: "off" | "auto" | "always";
|
|
9
10
|
slides: object | null;
|
|
10
11
|
throwOnAssetLikeHtmlError?: boolean;
|
|
@@ -15,7 +15,7 @@ export type MarkdownConverters = {
|
|
|
15
15
|
markdownRequested: boolean;
|
|
16
16
|
transcriptMarkdownRequested: boolean;
|
|
17
17
|
effectiveMarkdownMode: "off" | "auto" | "llm" | "readability";
|
|
18
|
-
markdownProvider: "none" | "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "github-copilot" | "ollama";
|
|
18
|
+
markdownProvider: "none" | "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "minimax" | "github-copilot" | "ollama";
|
|
19
19
|
markdownModel: MarkdownModel | null;
|
|
20
20
|
convertHtmlToMarkdown: ((args: {
|
|
21
21
|
url: string;
|
|
@@ -32,7 +32,7 @@ export declare function buildSlideTextFallback({ slides, transcriptTimedText, le
|
|
|
32
32
|
maxCharacters: number;
|
|
33
33
|
};
|
|
34
34
|
}): Map<number, string>;
|
|
35
|
-
export declare function coerceSummaryWithSlides({ markdown, slides, transcriptTimedText, lengthArg, }: {
|
|
35
|
+
export declare function coerceSummaryWithSlides({ markdown, slides, transcriptTimedText, lengthArg, reserveIntro, }: {
|
|
36
36
|
markdown: string;
|
|
37
37
|
slides: SlideTimelineEntry[];
|
|
38
38
|
transcriptTimedText?: string | null;
|
|
@@ -43,4 +43,5 @@ export declare function coerceSummaryWithSlides({ markdown, slides, transcriptTi
|
|
|
43
43
|
kind: "chars";
|
|
44
44
|
maxCharacters: number;
|
|
45
45
|
};
|
|
46
|
+
reserveIntro?: boolean;
|
|
46
47
|
}): string;
|
|
@@ -4,11 +4,12 @@ import type { ExtractedLinkContent, LinkPreviewProgressEvent, MediaCache } from
|
|
|
4
4
|
import type { LlmCall, RunMetricsReport } from "../../../costs.js";
|
|
5
5
|
import type { StreamMode } from "../../../flags.js";
|
|
6
6
|
import type { OutputLanguage } from "../../../language.js";
|
|
7
|
-
import type { ModelRequestOptions } from "../../../llm/model-options.js";
|
|
7
|
+
import type { ModelRequestOptions, OpenAiReasoningEffort } from "../../../llm/model-options.js";
|
|
8
8
|
import type { ExecFileFn } from "../../../markitdown.js";
|
|
9
9
|
import type { FixedModelSpec, RequestedModel } from "../../../model-spec.js";
|
|
10
10
|
import type { SummaryLength } from "../../../shared/contracts.js";
|
|
11
11
|
import type { SlideExtractionResult, SlideImage, SlideSettings, SlideSourceKind } from "../../../slides/index.js";
|
|
12
|
+
import type { SpeakerIdentificationSettings } from "../../../speaker-identification/index.js";
|
|
12
13
|
import type { PerfTrace } from "../../perf-trace.js";
|
|
13
14
|
import type { createSummaryEngine } from "../../summary-engine.js";
|
|
14
15
|
import type { SummarizeAssetArgs } from "../asset/summary.js";
|
|
@@ -32,6 +33,8 @@ export type UrlFlowFlags = {
|
|
|
32
33
|
firecrawlMode: "off" | "auto" | "always";
|
|
33
34
|
videoMode: "auto" | "transcript" | "understand";
|
|
34
35
|
transcriptTimestamps: boolean;
|
|
36
|
+
transcriptDiarization: "auto" | "elevenlabs" | "openai" | null;
|
|
37
|
+
speakerIdentification: SpeakerIdentificationSettings | null;
|
|
35
38
|
outputLanguage: OutputLanguage;
|
|
36
39
|
lengthArg: {
|
|
37
40
|
kind: "preset";
|
|
@@ -79,14 +82,16 @@ export type UrlFlowModel = {
|
|
|
79
82
|
configForModelSelection: SummarizeConfig | null;
|
|
80
83
|
envForAuto: Record<string, string | undefined>;
|
|
81
84
|
cliAvailability: Partial<Record<CliProvider, boolean>>;
|
|
82
|
-
openaiUseChatCompletions: boolean;
|
|
85
|
+
openaiUseChatCompletions: boolean | undefined;
|
|
83
86
|
openaiRequestOptions?: ModelRequestOptions;
|
|
84
87
|
openaiRequestOptionsOverride?: ModelRequestOptions;
|
|
88
|
+
cliReasoningEffortOverride?: OpenAiReasoningEffort;
|
|
85
89
|
openaiWhisperUsdPerMinute: number;
|
|
86
90
|
apiStatus: {
|
|
87
91
|
xaiApiKey: string | null;
|
|
88
92
|
apiKey: string | null;
|
|
89
93
|
nvidiaApiKey: string | null;
|
|
94
|
+
minimaxApiKey: string | null;
|
|
90
95
|
openrouterApiKey: string | null;
|
|
91
96
|
openrouterConfigured: boolean;
|
|
92
97
|
googleApiKey: string | null;
|
|
@@ -103,6 +108,7 @@ export type UrlFlowModel = {
|
|
|
103
108
|
zaiApiKey: string | null;
|
|
104
109
|
zaiBaseUrl: string;
|
|
105
110
|
nvidiaBaseUrl: string;
|
|
111
|
+
minimaxBaseUrl: string;
|
|
106
112
|
ollamaBaseUrl: string;
|
|
107
113
|
firecrawlConfigured: boolean;
|
|
108
114
|
firecrawlApiKey: string | null;
|
|
@@ -112,6 +118,7 @@ export type UrlFlowModel = {
|
|
|
112
118
|
falApiKey: string | null;
|
|
113
119
|
groqApiKey: string | null;
|
|
114
120
|
assemblyaiApiKey: string | null;
|
|
121
|
+
elevenlabsApiKey: string | null;
|
|
115
122
|
openaiApiKey: string | null;
|
|
116
123
|
};
|
|
117
124
|
summaryEngine: ReturnType<typeof createSummaryEngine>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CliProvider, SummarizeConfig } from "../config.js";
|
|
2
2
|
import { parseVideoMode } from "../flags.js";
|
|
3
3
|
import { type OutputLanguage } from "../language.js";
|
|
4
|
-
import type { ModelRequestOptions } from "../llm/model-options.js";
|
|
4
|
+
import type { ModelRequestOptions, OpenAiReasoningEffort } from "../llm/model-options.js";
|
|
5
5
|
export type ConfigState = {
|
|
6
6
|
config: SummarizeConfig | null;
|
|
7
7
|
configPath: string | null;
|
|
@@ -10,9 +10,10 @@ export type ConfigState = {
|
|
|
10
10
|
videoMode: ReturnType<typeof parseVideoMode>;
|
|
11
11
|
cliConfigForRun: SummarizeConfig["cli"] | undefined;
|
|
12
12
|
configForCli: SummarizeConfig | null;
|
|
13
|
-
openaiUseChatCompletions: boolean;
|
|
13
|
+
openaiUseChatCompletions: boolean | undefined;
|
|
14
14
|
openaiRequestOptions: ModelRequestOptions | undefined;
|
|
15
15
|
openaiRequestOptionsOverride: ModelRequestOptions | undefined;
|
|
16
|
+
cliReasoningEffortOverride: OpenAiReasoningEffort | undefined;
|
|
16
17
|
configModelLabel: string | null;
|
|
17
18
|
};
|
|
18
19
|
export declare function resolveConfigState({ envForRun, programOpts, languageExplicitlySet, videoModeExplicitlySet, cliFlagPresent, cliProviderArg, }: {
|
|
@@ -13,6 +13,7 @@ export declare function resolveRunContextState({ env, envForRun, programOpts, la
|
|
|
13
13
|
openrouterConfigured: boolean;
|
|
14
14
|
groqApiKey: string | null;
|
|
15
15
|
assemblyaiApiKey: string | null;
|
|
16
|
+
elevenlabsApiKey: string | null;
|
|
16
17
|
openaiApiKey: string | null;
|
|
17
18
|
xaiApiKey: string | null;
|
|
18
19
|
googleApiKey: string | null;
|
|
@@ -21,6 +22,8 @@ export declare function resolveRunContextState({ env, envForRun, programOpts, la
|
|
|
21
22
|
zaiBaseUrl: string;
|
|
22
23
|
nvidiaApiKey: string | null;
|
|
23
24
|
nvidiaBaseUrl: string;
|
|
25
|
+
minimaxApiKey: string | null;
|
|
26
|
+
minimaxBaseUrl: string;
|
|
24
27
|
ollamaBaseUrl: string;
|
|
25
28
|
firecrawlApiKey: string | null;
|
|
26
29
|
firecrawlConfigured: boolean;
|
|
@@ -46,8 +49,9 @@ export declare function resolveRunContextState({ env, envForRun, programOpts, la
|
|
|
46
49
|
videoMode: ReturnType<typeof import("../flags.js").parseVideoMode>;
|
|
47
50
|
cliConfigForRun: import("../config.js").SummarizeConfig["cli"] | undefined;
|
|
48
51
|
configForCli: import("../config.js").SummarizeConfig | null;
|
|
49
|
-
openaiUseChatCompletions: boolean;
|
|
52
|
+
openaiUseChatCompletions: boolean | undefined;
|
|
50
53
|
openaiRequestOptions: import("../llm/model-options.js").ModelRequestOptions | undefined;
|
|
51
54
|
openaiRequestOptionsOverride: import("../llm/model-options.js").ModelRequestOptions | undefined;
|
|
55
|
+
cliReasoningEffortOverride: import("../llm/model-options.js").OpenAiReasoningEffort | undefined;
|
|
52
56
|
configModelLabel: string | null;
|
|
53
57
|
};
|
|
@@ -5,6 +5,7 @@ export type EnvState = {
|
|
|
5
5
|
openrouterConfigured: boolean;
|
|
6
6
|
groqApiKey: string | null;
|
|
7
7
|
assemblyaiApiKey: string | null;
|
|
8
|
+
elevenlabsApiKey: string | null;
|
|
8
9
|
openaiApiKey: string | null;
|
|
9
10
|
xaiApiKey: string | null;
|
|
10
11
|
googleApiKey: string | null;
|
|
@@ -13,6 +14,8 @@ export type EnvState = {
|
|
|
13
14
|
zaiBaseUrl: string;
|
|
14
15
|
nvidiaApiKey: string | null;
|
|
15
16
|
nvidiaBaseUrl: string;
|
|
17
|
+
minimaxApiKey: string | null;
|
|
18
|
+
minimaxBaseUrl: string;
|
|
16
19
|
ollamaBaseUrl: string;
|
|
17
20
|
firecrawlApiKey: string | null;
|
|
18
21
|
firecrawlConfigured: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CliProvider } from "../config.js";
|
|
2
|
-
import type { FirecrawlMode, LengthArg, MarkdownMode, PreprocessMode, VideoMode, YoutubeMode } from "../flags.js";
|
|
2
|
+
import type { DiarizationMode, FirecrawlMode, LengthArg, MarkdownMode, PreprocessMode, VideoMode, YoutubeMode } from "../flags.js";
|
|
3
3
|
import type { OutputLanguage } from "../language.js";
|
|
4
4
|
import { type SummaryLengthTarget } from "../prompts/index.js";
|
|
5
5
|
export type ResolvedRunSettings = {
|
|
@@ -19,6 +19,7 @@ export type RunOverrides = {
|
|
|
19
19
|
youtubeMode: YoutubeMode | null;
|
|
20
20
|
videoMode: VideoMode | null;
|
|
21
21
|
transcriptTimestamps: boolean | null;
|
|
22
|
+
transcriptDiarization: DiarizationMode | null;
|
|
22
23
|
forceSummary: boolean | null;
|
|
23
24
|
timeoutMs: number | null;
|
|
24
25
|
retries: number | null;
|
|
@@ -34,6 +35,7 @@ export type RunOverridesInput = {
|
|
|
34
35
|
youtube?: unknown;
|
|
35
36
|
videoMode?: unknown;
|
|
36
37
|
timestamps?: unknown;
|
|
38
|
+
diarize?: unknown;
|
|
37
39
|
forceSummary?: unknown;
|
|
38
40
|
timeout?: unknown;
|
|
39
41
|
retries?: unknown;
|
|
@@ -67,6 +69,6 @@ export declare function resolveCliRunSettings({ length, firecrawl, markdownMode,
|
|
|
67
69
|
retries: string;
|
|
68
70
|
maxOutputTokens?: string | undefined;
|
|
69
71
|
}): ResolvedRunSettings;
|
|
70
|
-
export declare function resolveRunOverrides({ firecrawl, markdownMode, preprocess, youtube, videoMode, timestamps, forceSummary, timeout, retries, maxOutputTokens, transcriber, autoCliFallback, autoCliOrder, autoCliRememberLastSuccess, magicCliAuto, magicCliOrder, magicCliRememberLastSuccess, }: RunOverridesInput, options?: {
|
|
72
|
+
export declare function resolveRunOverrides({ firecrawl, markdownMode, preprocess, youtube, videoMode, timestamps, diarize, forceSummary, timeout, retries, maxOutputTokens, transcriber, autoCliFallback, autoCliOrder, autoCliRememberLastSuccess, magicCliAuto, magicCliOrder, magicCliRememberLastSuccess, }: RunOverridesInput, options?: {
|
|
71
73
|
strict?: boolean;
|
|
72
74
|
}): RunOverrides;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FirecrawlMode, type LengthArg, type MarkdownMode, type PreprocessMode, parseExtractFormat, parseMaxExtractCharactersArg, parseMetricsMode, parseStreamMode, type YoutubeMode } from "../flags.js";
|
|
1
|
+
import { type FirecrawlMode, type DiarizationMode, type LengthArg, type MarkdownMode, type PreprocessMode, parseExtractFormat, parseMaxExtractCharactersArg, parseMetricsMode, parseStreamMode, type YoutubeMode } from "../flags.js";
|
|
2
2
|
type Transcriber = "auto" | "whisper" | "parakeet" | "canary";
|
|
3
3
|
export type RunnerFlagResolution = {
|
|
4
4
|
videoModeExplicitlySet: boolean;
|
|
@@ -15,6 +15,11 @@ export type RunnerFlagResolution = {
|
|
|
15
15
|
debug: boolean;
|
|
16
16
|
verbose: boolean;
|
|
17
17
|
transcriber: Transcriber;
|
|
18
|
+
diarizationMode: DiarizationMode | null;
|
|
19
|
+
speakerProfileArg: string | null;
|
|
20
|
+
speakerAnchorArgs: string[];
|
|
21
|
+
speakerIdentificationOverride: boolean | null;
|
|
22
|
+
rememberSpeakers: boolean;
|
|
18
23
|
maxExtractCharacters: ReturnType<typeof parseMaxExtractCharactersArg>;
|
|
19
24
|
isYoutubeUrl: boolean;
|
|
20
25
|
format: ReturnType<typeof parseExtractFormat>;
|
|
@@ -2,6 +2,7 @@ export declare function prepareRunEnvironment(argv: string[], inputEnv: Record<s
|
|
|
2
2
|
normalizedArgv: string[];
|
|
3
3
|
envForRun: Record<string, string | undefined>;
|
|
4
4
|
};
|
|
5
|
+
export declare function normalizeDiarizeArgv(argv: string[]): string[];
|
|
5
6
|
export declare function handleVersionFlag({ versionRequested, stdout, importMetaUrl, }: {
|
|
6
7
|
versionRequested: boolean;
|
|
7
8
|
stdout: NodeJS.WritableStream;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CliProvider } from "../config.js";
|
|
2
2
|
import { runCliModel } from "../llm/cli.js";
|
|
3
|
-
import type { ModelRequestOptions } from "../llm/model-options.js";
|
|
3
|
+
import type { ModelRequestOptions, OpenAiReasoningEffort } from "../llm/model-options.js";
|
|
4
4
|
import type { Prompt } from "../llm/prompt.js";
|
|
5
5
|
import type { PerfTrace } from "./perf-trace.js";
|
|
6
6
|
import { type StreamOutputMode } from "./stream-output.js";
|
|
@@ -19,20 +19,21 @@ export type SummaryEngineDeps = {
|
|
|
19
19
|
plain: boolean;
|
|
20
20
|
verbose: boolean;
|
|
21
21
|
verboseColor: boolean;
|
|
22
|
-
openaiUseChatCompletions: boolean;
|
|
22
|
+
openaiUseChatCompletions: boolean | undefined;
|
|
23
23
|
openaiRequestOptions?: ModelRequestOptions;
|
|
24
24
|
openaiRequestOptionsOverride?: ModelRequestOptions;
|
|
25
|
+
cliReasoningEffortOverride?: OpenAiReasoningEffort;
|
|
25
26
|
cliConfigForRun: Parameters<typeof runCliModel>[0]["config"];
|
|
26
27
|
cliAvailability: Partial<Record<CliProvider, boolean>>;
|
|
27
28
|
trackedFetch: typeof fetch;
|
|
28
29
|
resolveMaxOutputTokensForCall: (modelId: string) => Promise<number | null>;
|
|
29
30
|
resolveMaxInputTokensForCall: (modelId: string) => Promise<number | null>;
|
|
30
31
|
llmCalls: Array<{
|
|
31
|
-
provider: "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "github-copilot" | "ollama" | "cli";
|
|
32
|
+
provider: "xai" | "openai" | "google" | "anthropic" | "zai" | "nvidia" | "minimax" | "github-copilot" | "ollama" | "cli";
|
|
32
33
|
model: string;
|
|
33
34
|
usage: Awaited<ReturnType<typeof summarizeWithModelId>>["usage"] | null;
|
|
34
35
|
costUsd?: number | null;
|
|
35
|
-
purpose: "summary" | "markdown";
|
|
36
|
+
purpose: "summary" | "markdown" | "speaker-identification";
|
|
36
37
|
}>;
|
|
37
38
|
clearProgressForStdout: () => void;
|
|
38
39
|
restoreProgressAfterStdout?: (() => void) | null;
|
|
@@ -56,6 +57,10 @@ export type SummaryEngineDeps = {
|
|
|
56
57
|
apiKey: string | null;
|
|
57
58
|
baseUrl: string;
|
|
58
59
|
};
|
|
60
|
+
minimax: {
|
|
61
|
+
apiKey: string | null;
|
|
62
|
+
baseUrl: string;
|
|
63
|
+
};
|
|
59
64
|
ollama: {
|
|
60
65
|
baseUrl: string;
|
|
61
66
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CliProvider } from "../config.js";
|
|
2
2
|
import type { LlmProvider } from "../llm/model-id.js";
|
|
3
3
|
import type { ModelRequestOptions } from "../llm/model-options.js";
|
|
4
|
-
export type ModelAttemptRequiredEnv = "XAI_API_KEY" | "OPENAI_API_KEY" | "NVIDIA_API_KEY" | "GEMINI_API_KEY" | "ANTHROPIC_API_KEY" | "OPENROUTER_API_KEY" | "Z_AI_API_KEY" | "GITHUB_TOKEN" | "OLLAMA_BASE_URL" | "CLI_CLAUDE" | "CLI_CODEX" | "CLI_GEMINI" | "CLI_AGENT" | "CLI_OPENCLAW" | "CLI_OPENCODE" | "CLI_COPILOT";
|
|
4
|
+
export type ModelAttemptRequiredEnv = "XAI_API_KEY" | "OPENAI_API_KEY" | "NVIDIA_API_KEY" | "GEMINI_API_KEY" | "ANTHROPIC_API_KEY" | "OPENROUTER_API_KEY" | "Z_AI_API_KEY" | "MINIMAX_API_KEY" | "GITHUB_TOKEN" | "OLLAMA_BASE_URL" | "CLI_CLAUDE" | "CLI_CODEX" | "CLI_GEMINI" | "CLI_AGENT" | "CLI_OPENCLAW" | "CLI_OPENCODE" | "CLI_COPILOT" | "CLI_AGY" | "CLI_PI";
|
|
5
5
|
export type ModelAttempt = {
|
|
6
6
|
transport: "native" | "openrouter" | "cli";
|
|
7
7
|
userModelId: string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type CacheKind = "extract" | "summary" | "transcript" | "chat" | "slides";
|
|
2
|
+
export type CacheCounts = Record<CacheKind, number>;
|
|
3
|
+
export type CacheStats = {
|
|
4
|
+
path: string;
|
|
5
|
+
sizeBytes: number;
|
|
6
|
+
totalEntries: number;
|
|
7
|
+
counts: CacheCounts;
|
|
8
|
+
};
|
|
9
|
+
export type PortableCacheRow = {
|
|
10
|
+
kind: CacheKind;
|
|
11
|
+
key: string;
|
|
12
|
+
value: string;
|
|
13
|
+
sizeBytes: number;
|
|
14
|
+
createdAt: number;
|
|
15
|
+
lastAccessedAt: number;
|
|
16
|
+
expiresAt: number | null;
|
|
17
|
+
};
|
|
18
|
+
export declare const CACHE_FORMAT_VERSION = 2;
|
|
19
|
+
export declare const DEFAULT_CACHE_MAX_MB = 512;
|
|
20
|
+
export declare const DEFAULT_CACHE_TTL_DAYS = 30;
|
|
21
|
+
export declare const CACHE_KINDS: readonly CacheKind[];
|
|
22
|
+
export declare function createEmptyCacheCounts(): CacheCounts;
|
|
23
|
+
export declare function isCacheKind(value: unknown): value is CacheKind;
|
|
24
|
+
export declare function measureCacheValueBytes(value: string): number;
|
|
25
|
+
export declare function buildPortableCacheRow({ kind, key, value, ttlMs, now, }: {
|
|
26
|
+
kind: CacheKind;
|
|
27
|
+
key: string;
|
|
28
|
+
value: string;
|
|
29
|
+
ttlMs: number | null;
|
|
30
|
+
now?: number;
|
|
31
|
+
}): PortableCacheRow;
|
|
32
|
+
export declare function isPortableCacheRowExpired(row: Pick<PortableCacheRow, "expiresAt">, now?: number): boolean;
|
|
33
|
+
export declare function parseCacheJson<T>(value: string | null | undefined): T | null;
|
|
34
|
+
export declare function summarizePortableCacheRows(rows: Iterable<Pick<PortableCacheRow, "kind" | "sizeBytes">>, path: string): CacheStats;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fetchWithDnsPinnedAddresses(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type DnsPinnedAddress = {
|
|
2
|
+
address: string;
|
|
3
|
+
family?: number;
|
|
4
|
+
};
|
|
5
|
+
export declare function markFetchAsDnsPinned<T extends typeof fetch>(fetchImpl: T, pinnedFetchImpl?: typeof fetch): T;
|
|
6
|
+
export declare function resolveDnsPinnedFetch(fetchImpl: typeof fetch): typeof fetch | null;
|
|
7
|
+
export declare function supportsDnsPinnedFetch(fetchImpl: typeof fetch): boolean;
|
|
8
|
+
export declare function isNativeOrBoundGlobalFetch(fetchImpl: typeof fetch): boolean;
|
|
9
|
+
export declare function attachDnsPinnedAddresses<T extends RequestInit>(init: T, addresses: DnsPinnedAddress[]): T;
|
|
10
|
+
export declare function readDnsPinnedAddresses(init: RequestInit | undefined): DnsPinnedAddress[] | null;
|