@steipete/summarize 0.16.2 → 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 +36 -0
- 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/server.js +72 -8
- package/dist/esm/daemon/server.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
|
@@ -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;
|
|
@@ -21,12 +21,13 @@ export type SlidePresentation = {
|
|
|
21
21
|
finalSummaryIndexes: Set<number>;
|
|
22
22
|
};
|
|
23
23
|
export type SlidePresentationTextKind = "intro" | "slide-body";
|
|
24
|
-
export declare function buildSlidePresentation({ markdown, slides, transcriptTimedText, lengthArg, coerce, includeTranscriptFallback, }: {
|
|
24
|
+
export declare function buildSlidePresentation({ markdown, slides, transcriptTimedText, lengthArg, coerce, coerceReserveIntro, includeTranscriptFallback, }: {
|
|
25
25
|
markdown: string;
|
|
26
26
|
slides: SlideTimelineEntry[];
|
|
27
27
|
transcriptTimedText?: string | null;
|
|
28
28
|
lengthArg: SlidePresentationLength;
|
|
29
29
|
coerce?: boolean;
|
|
30
|
+
coerceReserveIntro?: boolean;
|
|
30
31
|
includeTranscriptFallback?: boolean;
|
|
31
32
|
}): SlidePresentation;
|
|
32
33
|
export declare function createSlidesPresentationStream({ getSlideIndexOrder, getSlideMeta, onText, onSlide, debugWrite, }: {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CacheState } from "../cache.js";
|
|
2
|
+
type TranscriptDiarizationPreference = "auto" | "elevenlabs" | "openai";
|
|
3
|
+
type TranscriptDiarizationProvider = Exclude<TranscriptDiarizationPreference, "auto">;
|
|
4
|
+
type TranscriptDiarizationCacheScope = TranscriptDiarizationProvider | "auto";
|
|
5
|
+
export declare function resolveTranscriptDiarizationCacheReadScopes(preference: TranscriptDiarizationPreference | null | undefined): readonly TranscriptDiarizationCacheScope[] | null;
|
|
6
|
+
export declare function resolveTranscriptDiarizationCacheWriteScope({ preference, metadata, }: {
|
|
7
|
+
preference: TranscriptDiarizationPreference | null | undefined;
|
|
8
|
+
metadata: Record<string, unknown> | null | undefined;
|
|
9
|
+
}): TranscriptDiarizationCacheScope | null;
|
|
10
|
+
export declare function scopeTranscriptCacheForDiarization(cache: CacheState, preference: TranscriptDiarizationPreference | null): CacheState;
|
|
11
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type ProcessCommand } from "./process.js";
|
|
1
2
|
import type { SlideAutoTune, SlideImage } from "./types.js";
|
|
2
3
|
export declare function detectSlideTimestamps({ ffmpegPath, ffprobePath, inputPath, sceneThreshold, autoTuneThreshold, env, timeoutMs, warnings, workers, sampleCount, onSegmentProgress, logSlides, logSlidesTiming, }: {
|
|
3
|
-
ffmpegPath:
|
|
4
|
-
ffprobePath:
|
|
4
|
+
ffmpegPath: ProcessCommand;
|
|
5
|
+
ffprobePath: ProcessCommand | null;
|
|
5
6
|
inputPath: string;
|
|
6
7
|
sceneThreshold: number;
|
|
7
8
|
autoTuneThreshold: boolean;
|
|
@@ -19,7 +20,7 @@ export declare function detectSlideTimestamps({ ffmpegPath, ffprobePath, inputPa
|
|
|
19
20
|
durationSeconds: number | null;
|
|
20
21
|
}>;
|
|
21
22
|
export declare function extractFramesAtTimestamps({ ffmpegPath, inputPath, outputDir, timestamps, segments, durationSeconds, timeoutMs, workers, onProgress, onStatus, onSlide, logSlides, logSlidesTiming, }: {
|
|
22
|
-
ffmpegPath:
|
|
23
|
+
ffmpegPath: ProcessCommand;
|
|
23
24
|
inputPath: string;
|
|
24
25
|
outputDir: string;
|
|
25
26
|
timestamps: number[];
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { ProcessHandle } from "../processes.js";
|
|
2
|
-
export
|
|
2
|
+
export type ProcessCommand = string | {
|
|
3
3
|
command: string;
|
|
4
|
+
argsPrefix?: string[];
|
|
5
|
+
source?: "wasm";
|
|
6
|
+
};
|
|
7
|
+
export declare function runProcess({ command, args, timeoutMs, errorLabel, onStderrLine, onStdoutLine, }: {
|
|
8
|
+
command: ProcessCommand;
|
|
4
9
|
args: string[];
|
|
5
10
|
timeoutMs: number;
|
|
6
11
|
errorLabel: string;
|
|
@@ -8,13 +13,13 @@ export declare function runProcess({ command, args, timeoutMs, errorLabel, onStd
|
|
|
8
13
|
onStdoutLine?: (line: string, handle: ProcessHandle | null) => void;
|
|
9
14
|
}): Promise<void>;
|
|
10
15
|
export declare function runProcessCapture({ command, args, timeoutMs, errorLabel, }: {
|
|
11
|
-
command:
|
|
16
|
+
command: ProcessCommand;
|
|
12
17
|
args: string[];
|
|
13
18
|
timeoutMs: number;
|
|
14
19
|
errorLabel: string;
|
|
15
20
|
}): Promise<string>;
|
|
16
21
|
export declare function runProcessCaptureBuffer({ command, args, timeoutMs, errorLabel, }: {
|
|
17
|
-
command:
|
|
22
|
+
command: ProcessCommand;
|
|
18
23
|
args: string[];
|
|
19
24
|
timeoutMs: number;
|
|
20
25
|
errorLabel: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ProcessCommand } from "./process.js";
|
|
1
2
|
import type { SlideImage } from "./types.js";
|
|
2
3
|
export type SceneSegment = {
|
|
3
4
|
start: number;
|
|
@@ -12,7 +13,7 @@ export declare function resolveExtractedTimestamp({ requested, actual, seekBase,
|
|
|
12
13
|
}): number;
|
|
13
14
|
export declare function roundThreshold(value: number): number;
|
|
14
15
|
export declare function calibrateSceneThreshold({ ffmpegPath, inputPath, durationSeconds, sampleCount, timeoutMs, logSlides, }: {
|
|
15
|
-
ffmpegPath:
|
|
16
|
+
ffmpegPath: ProcessCommand;
|
|
16
17
|
inputPath: string;
|
|
17
18
|
durationSeconds: number | null;
|
|
18
19
|
sampleCount: number;
|
|
@@ -27,7 +28,7 @@ export declare function buildSegments(durationSeconds: number | null, workers: n
|
|
|
27
28
|
duration: number;
|
|
28
29
|
}>;
|
|
29
30
|
export declare function detectSceneTimestamps({ ffmpegPath, inputPath, threshold, timeoutMs, segments, workers, onSegmentProgress, runWithConcurrency, }: {
|
|
30
|
-
ffmpegPath:
|
|
31
|
+
ffmpegPath: ProcessCommand;
|
|
31
32
|
inputPath: string;
|
|
32
33
|
threshold: number;
|
|
33
34
|
timeoutMs: number;
|
|
@@ -60,7 +61,7 @@ export declare function buildIntervalTimestamps({ durationSeconds, minDurationSe
|
|
|
60
61
|
intervalSeconds: number;
|
|
61
62
|
} | null;
|
|
62
63
|
export declare function probeVideoInfo({ ffprobePath, inputPath, timeoutMs, }: {
|
|
63
|
-
ffprobePath:
|
|
64
|
+
ffprobePath: ProcessCommand;
|
|
64
65
|
inputPath: string;
|
|
65
66
|
timeoutMs: number;
|
|
66
67
|
}): Promise<{
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ExtractedLinkContent, TranscriptSegment } from "@steipete/summarize-core/content";
|
|
2
|
+
import type { LlmTokenUsage } from "../llm/types.js";
|
|
3
|
+
import { type InferSpeakerMappingsResult } from "./openai.js";
|
|
4
|
+
import type { SpeakerIdentificationSettings, SpeakerIdentityMapping } from "./types.js";
|
|
5
|
+
export declare class SpeakerIdentificationError extends Error {
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export type SpeakerIdentificationResult = {
|
|
9
|
+
extracted: ExtractedLinkContent;
|
|
10
|
+
mappings: SpeakerIdentityMapping[];
|
|
11
|
+
transcriptHash: string | null;
|
|
12
|
+
usage: LlmTokenUsage | null;
|
|
13
|
+
warning: string | null;
|
|
14
|
+
cacheable: boolean;
|
|
15
|
+
};
|
|
16
|
+
type InferMappings = (args: {
|
|
17
|
+
segments: TranscriptSegment[];
|
|
18
|
+
unresolvedSpeakers: string[];
|
|
19
|
+
anchoredMappings: Record<string, string>;
|
|
20
|
+
title: string | null;
|
|
21
|
+
description: string | null;
|
|
22
|
+
sourceUrl: string;
|
|
23
|
+
settings: SpeakerIdentificationSettings;
|
|
24
|
+
apiKey: string;
|
|
25
|
+
baseUrl: string | null;
|
|
26
|
+
timeoutMs: number;
|
|
27
|
+
fetchImpl: typeof fetch;
|
|
28
|
+
}) => Promise<InferSpeakerMappingsResult>;
|
|
29
|
+
export declare function identifySpeakersInExtractedContent({ extracted, sourceUrl, settings, openaiApiKey, openaiBaseUrl, timeoutMs, maxContentCharacters, fetchImpl, inferMappings, }: {
|
|
30
|
+
extracted: ExtractedLinkContent;
|
|
31
|
+
sourceUrl: string;
|
|
32
|
+
settings: SpeakerIdentificationSettings;
|
|
33
|
+
openaiApiKey: string | null;
|
|
34
|
+
openaiBaseUrl: string | null;
|
|
35
|
+
timeoutMs: number;
|
|
36
|
+
maxContentCharacters: number | null;
|
|
37
|
+
fetchImpl: typeof fetch;
|
|
38
|
+
inferMappings?: InferMappings;
|
|
39
|
+
}): Promise<SpeakerIdentificationResult>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { buildSpeakerSourceKey, DEFAULT_SPEAKER_IDENTIFICATION_CONFIDENCE, DEFAULT_SPEAKER_IDENTIFICATION_MODEL, parseSpeakerAnchor, resolveSpeakerIdentificationSettings, } from "./settings.js";
|
|
2
|
+
export { identifySpeakersInExtractedContent, SpeakerIdentificationError, type SpeakerIdentificationResult, } from "./identify.js";
|
|
3
|
+
export { buildSpeakerEvidence, inferSpeakerMappingsWithOpenAi, type InferSpeakerMappingsResult, type OpenAiSpeakerMapping, } from "./openai.js";
|
|
4
|
+
export { rememberSpeakerMappings } from "./remember.js";
|
|
5
|
+
export type { RememberedSpeakerMapping, ResolveSpeakerIdentificationInput, SpeakerAnchor, SpeakerIdentificationSettings, SpeakerIdentityMapping, } from "./types.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type TranscriptSegment } from "@steipete/summarize-core/content";
|
|
2
|
+
import type { LlmTokenUsage } from "../llm/types.js";
|
|
3
|
+
import type { SpeakerIdentificationSettings } from "./types.js";
|
|
4
|
+
export type OpenAiSpeakerMapping = {
|
|
5
|
+
speaker: string;
|
|
6
|
+
name: string;
|
|
7
|
+
confidence: number;
|
|
8
|
+
evidence: string;
|
|
9
|
+
};
|
|
10
|
+
export type InferSpeakerMappingsResult = {
|
|
11
|
+
mappings: OpenAiSpeakerMapping[];
|
|
12
|
+
usage: LlmTokenUsage | null;
|
|
13
|
+
};
|
|
14
|
+
export declare function buildSpeakerEvidence(segments: TranscriptSegment[]): string[];
|
|
15
|
+
export declare function inferSpeakerMappingsWithOpenAi({ segments, unresolvedSpeakers, anchoredMappings, title, description, sourceUrl, settings, apiKey, baseUrl, timeoutMs, fetchImpl, }: {
|
|
16
|
+
segments: TranscriptSegment[];
|
|
17
|
+
unresolvedSpeakers: string[];
|
|
18
|
+
anchoredMappings: Record<string, string>;
|
|
19
|
+
title: string | null;
|
|
20
|
+
description: string | null;
|
|
21
|
+
sourceUrl: string;
|
|
22
|
+
settings: SpeakerIdentificationSettings;
|
|
23
|
+
apiKey: string;
|
|
24
|
+
baseUrl: string | null;
|
|
25
|
+
timeoutMs: number;
|
|
26
|
+
fetchImpl: typeof fetch;
|
|
27
|
+
}): Promise<InferSpeakerMappingsResult>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SpeakerIdentificationSettings, SpeakerIdentityMapping } from "./types.js";
|
|
2
|
+
export declare function rememberSpeakerMappings({ configPath, settings, mappings, transcriptHash, }: {
|
|
3
|
+
configPath: string;
|
|
4
|
+
settings: SpeakerIdentificationSettings;
|
|
5
|
+
mappings: SpeakerIdentityMapping[];
|
|
6
|
+
transcriptHash: string;
|
|
7
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ResolveSpeakerIdentificationInput, SpeakerAnchor, SpeakerIdentificationSettings } from "./types.js";
|
|
2
|
+
export declare const DEFAULT_SPEAKER_IDENTIFICATION_MODEL = "openai/gpt-5.5";
|
|
3
|
+
export declare const DEFAULT_SPEAKER_IDENTIFICATION_CONFIDENCE = 0.85;
|
|
4
|
+
export declare function buildSpeakerSourceKey(sourceUrl: string): string;
|
|
5
|
+
export declare function parseSpeakerAnchor(raw: string, flag?: string): SpeakerAnchor;
|
|
6
|
+
export declare function resolveSpeakerIdentificationSettings({ config, sourceUrl, diarization, profileArg, anchorArgs, identifyOverride, remember, }: ResolveSpeakerIdentificationInput): SpeakerIdentificationSettings | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { SpeakersConfig } from "../config.js";
|
|
2
|
+
export type SpeakerAnchor = {
|
|
3
|
+
atMs: number;
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
export type SpeakerIdentityMapping = {
|
|
7
|
+
speaker: string;
|
|
8
|
+
name: string;
|
|
9
|
+
confidence: number;
|
|
10
|
+
source: "anchor" | "remembered" | "openai";
|
|
11
|
+
evidence?: string | null;
|
|
12
|
+
};
|
|
13
|
+
export type RememberedSpeakerMapping = {
|
|
14
|
+
transcriptHash: string;
|
|
15
|
+
mappings: Record<string, string>;
|
|
16
|
+
};
|
|
17
|
+
export type SpeakerIdentificationSettings = {
|
|
18
|
+
sourceKey: string;
|
|
19
|
+
profileName: string | null;
|
|
20
|
+
host: string | null;
|
|
21
|
+
knownSpeakers: string[];
|
|
22
|
+
context: string | null;
|
|
23
|
+
model: string;
|
|
24
|
+
minimumConfidence: number;
|
|
25
|
+
anchors: SpeakerAnchor[];
|
|
26
|
+
remembered: RememberedSpeakerMapping | null;
|
|
27
|
+
remember: boolean;
|
|
28
|
+
explicit: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type ResolveSpeakerIdentificationInput = {
|
|
31
|
+
config: SpeakersConfig | null | undefined;
|
|
32
|
+
sourceUrl: string;
|
|
33
|
+
diarization: "auto" | "elevenlabs" | "openai" | null;
|
|
34
|
+
profileArg: string | null;
|
|
35
|
+
anchorArgs: readonly string[];
|
|
36
|
+
identifyOverride: boolean | null;
|
|
37
|
+
remember: boolean;
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function countTokens(text: string): number;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const FALLBACK_VERSION = "0.
|
|
1
|
+
export declare const FALLBACK_VERSION = "0.17.0";
|
|
2
2
|
export declare function resolvePackageVersion(importMetaUrl?: string): string;
|
|
3
3
|
export declare function resolveGitSha(importMetaUrl?: string): string | null;
|
|
4
4
|
export declare function formatVersionLine(importMetaUrl?: string): string;
|
package/docs/README.md
CHANGED
|
@@ -6,7 +6,7 @@ summary: "Docs index for summarize behaviors and modes."
|
|
|
6
6
|
|
|
7
7
|
- `docs/chrome-extension.md` — Chrome side panel extension + daemon setup/troubleshooting
|
|
8
8
|
- `docs/cache.md` — cache design + config (SQLite)
|
|
9
|
-
- `docs/cli.md` — CLI models (Claude/Codex/Gemini/Agent/OpenClaw/OpenCode/Copilot)
|
|
9
|
+
- `docs/cli.md` — CLI models (Claude/Codex/Gemini/Agent/OpenClaw/OpenCode/Copilot/Antigravity/pi)
|
|
10
10
|
- `docs/config.md` — config file location, precedence, and schema
|
|
11
11
|
- `docs/extract-only.md` — extract mode (no summary LLM call)
|
|
12
12
|
- `docs/firecrawl.md` — Firecrawl mode + API key
|
package/docs/cache.md
CHANGED
|
@@ -43,7 +43,7 @@ Separate file cache for downloaded media (yt-dlp, direct media URLs). This is **
|
|
|
43
43
|
- **Summaries**
|
|
44
44
|
- key: `sha256({contentHash, promptHash, model, length, language, formatVersion})`
|
|
45
45
|
- cache hit even if URL differs (content hash wins).
|
|
46
|
-
- `contentHash` comes from the `<content>` block actually sent to the model (so slide timelines / transcript extras affect the key).
|
|
46
|
+
- `contentHash` comes from the `<content>` block actually sent to the model (so slide timelines / transcript extras affect the key), or from attached binary bytes when the prompt content is empty.
|
|
47
47
|
- **Slides** (manifest + on-disk images in the slides output dir)
|
|
48
48
|
- key: `sha256({url, slideSettings, formatVersion})`
|
|
49
49
|
|