@steipete/summarize 0.8.2 → 0.10.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 +114 -1
- package/LICENSE +1 -1
- package/README.md +309 -182
- package/dist/cli.js +1 -1
- package/dist/esm/cache.js +72 -4
- package/dist/esm/cache.js.map +1 -1
- package/dist/esm/config.js +197 -1
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/content/asset.js +75 -2
- package/dist/esm/content/asset.js.map +1 -1
- package/dist/esm/daemon/agent.js +547 -0
- package/dist/esm/daemon/agent.js.map +1 -0
- package/dist/esm/daemon/chat.js +97 -0
- package/dist/esm/daemon/chat.js.map +1 -0
- package/dist/esm/daemon/cli.js +105 -10
- package/dist/esm/daemon/cli.js.map +1 -1
- package/dist/esm/daemon/env-snapshot.js +3 -0
- package/dist/esm/daemon/env-snapshot.js.map +1 -1
- package/dist/esm/daemon/flow-context.js +53 -28
- package/dist/esm/daemon/flow-context.js.map +1 -1
- package/dist/esm/daemon/launchd.js +27 -0
- package/dist/esm/daemon/launchd.js.map +1 -1
- package/dist/esm/daemon/process-registry.js +206 -0
- package/dist/esm/daemon/process-registry.js.map +1 -0
- package/dist/esm/daemon/schtasks.js +64 -0
- package/dist/esm/daemon/schtasks.js.map +1 -1
- package/dist/esm/daemon/server.js +1034 -52
- package/dist/esm/daemon/server.js.map +1 -1
- package/dist/esm/daemon/summarize.js +66 -18
- package/dist/esm/daemon/summarize.js.map +1 -1
- package/dist/esm/daemon/systemd.js +61 -0
- package/dist/esm/daemon/systemd.js.map +1 -1
- package/dist/esm/flags.js +24 -0
- package/dist/esm/flags.js.map +1 -1
- package/dist/esm/llm/attachments.js +2 -0
- package/dist/esm/llm/attachments.js.map +1 -0
- package/dist/esm/llm/errors.js +6 -0
- package/dist/esm/llm/errors.js.map +1 -0
- package/dist/esm/llm/generate-text.js +206 -356
- package/dist/esm/llm/generate-text.js.map +1 -1
- package/dist/esm/llm/html-to-markdown.js +1 -2
- package/dist/esm/llm/html-to-markdown.js.map +1 -1
- package/dist/esm/llm/prompt.js.map +1 -1
- package/dist/esm/llm/providers/anthropic.js +126 -0
- package/dist/esm/llm/providers/anthropic.js.map +1 -0
- package/dist/esm/llm/providers/google.js +78 -0
- package/dist/esm/llm/providers/google.js.map +1 -0
- package/dist/esm/llm/providers/models.js +111 -0
- package/dist/esm/llm/providers/models.js.map +1 -0
- package/dist/esm/llm/providers/openai.js +150 -0
- package/dist/esm/llm/providers/openai.js.map +1 -0
- package/dist/esm/llm/providers/shared.js +48 -0
- package/dist/esm/llm/providers/shared.js.map +1 -0
- package/dist/esm/llm/providers/types.js +2 -0
- package/dist/esm/llm/providers/types.js.map +1 -0
- package/dist/esm/llm/transcript-to-markdown.js +1 -2
- package/dist/esm/llm/transcript-to-markdown.js.map +1 -1
- package/dist/esm/llm/types.js +2 -0
- package/dist/esm/llm/types.js.map +1 -0
- package/dist/esm/llm/usage.js +69 -0
- package/dist/esm/llm/usage.js.map +1 -0
- package/dist/esm/logging/daemon.js +124 -0
- package/dist/esm/logging/daemon.js.map +1 -0
- package/dist/esm/logging/ring-file.js +66 -0
- package/dist/esm/logging/ring-file.js.map +1 -0
- package/dist/esm/media-cache.js +251 -0
- package/dist/esm/media-cache.js.map +1 -0
- package/dist/esm/model-auto.js +103 -5
- package/dist/esm/model-auto.js.map +1 -1
- package/dist/esm/processes.js +2 -0
- package/dist/esm/processes.js.map +1 -0
- package/dist/esm/refresh-free.js +3 -3
- package/dist/esm/refresh-free.js.map +1 -1
- package/dist/esm/run/attachments.js +8 -4
- package/dist/esm/run/attachments.js.map +1 -1
- package/dist/esm/run/bird.js +118 -5
- package/dist/esm/run/bird.js.map +1 -1
- package/dist/esm/run/cache-state.js +3 -2
- package/dist/esm/run/cache-state.js.map +1 -1
- package/dist/esm/run/cli-preflight.js +19 -1
- package/dist/esm/run/cli-preflight.js.map +1 -1
- package/dist/esm/run/constants.js +0 -7
- package/dist/esm/run/constants.js.map +1 -1
- package/dist/esm/run/finish-line.js +58 -11
- package/dist/esm/run/finish-line.js.map +1 -1
- package/dist/esm/run/flows/asset/extract.js +70 -0
- package/dist/esm/run/flows/asset/extract.js.map +1 -0
- package/dist/esm/run/flows/asset/input.js +209 -25
- package/dist/esm/run/flows/asset/input.js.map +1 -1
- package/dist/esm/run/flows/asset/media-policy.js +3 -0
- package/dist/esm/run/flows/asset/media-policy.js.map +1 -0
- package/dist/esm/run/flows/asset/media.js +224 -0
- package/dist/esm/run/flows/asset/media.js.map +1 -0
- package/dist/esm/run/flows/asset/output.js +98 -0
- package/dist/esm/run/flows/asset/output.js.map +1 -0
- package/dist/esm/run/flows/asset/preprocess.js +92 -16
- package/dist/esm/run/flows/asset/preprocess.js.map +1 -1
- package/dist/esm/run/flows/asset/summary.js +165 -11
- package/dist/esm/run/flows/asset/summary.js.map +1 -1
- package/dist/esm/run/flows/url/extract.js +6 -6
- package/dist/esm/run/flows/url/extract.js.map +1 -1
- package/dist/esm/run/flows/url/flow.js +338 -36
- package/dist/esm/run/flows/url/flow.js.map +1 -1
- package/dist/esm/run/flows/url/markdown.js +6 -1
- package/dist/esm/run/flows/url/markdown.js.map +1 -1
- package/dist/esm/run/flows/url/slides-output.js +485 -0
- package/dist/esm/run/flows/url/slides-output.js.map +1 -0
- package/dist/esm/run/flows/url/slides-text.js +628 -0
- package/dist/esm/run/flows/url/slides-text.js.map +1 -0
- package/dist/esm/run/flows/url/summary.js +358 -83
- package/dist/esm/run/flows/url/summary.js.map +1 -1
- package/dist/esm/run/help.js +94 -5
- package/dist/esm/run/help.js.map +1 -1
- package/dist/esm/run/logging.js +12 -4
- package/dist/esm/run/logging.js.map +1 -1
- package/dist/esm/run/media-cache-state.js +33 -0
- package/dist/esm/run/media-cache-state.js.map +1 -0
- package/dist/esm/run/progress.js +19 -1
- package/dist/esm/run/progress.js.map +1 -1
- package/dist/esm/run/run-context.js +19 -0
- package/dist/esm/run/run-context.js.map +1 -0
- package/dist/esm/run/run-output.js +1 -1
- package/dist/esm/run/run-output.js.map +1 -1
- package/dist/esm/run/run-settings.js +182 -0
- package/dist/esm/run/run-settings.js.map +1 -0
- package/dist/esm/run/runner.js +225 -32
- package/dist/esm/run/runner.js.map +1 -1
- package/dist/esm/run/slides-cli.js +225 -0
- package/dist/esm/run/slides-cli.js.map +1 -0
- package/dist/esm/run/slides-render.js +163 -0
- package/dist/esm/run/slides-render.js.map +1 -0
- package/dist/esm/run/stream-output.js +63 -0
- package/dist/esm/run/stream-output.js.map +1 -0
- package/dist/esm/run/streaming.js +16 -43
- package/dist/esm/run/streaming.js.map +1 -1
- package/dist/esm/run/summary-engine.js +59 -41
- package/dist/esm/run/summary-engine.js.map +1 -1
- package/dist/esm/run/transcriber-cli.js +148 -0
- package/dist/esm/run/transcriber-cli.js.map +1 -0
- package/dist/esm/shared/sse-events.js +26 -0
- package/dist/esm/shared/sse-events.js.map +1 -0
- package/dist/esm/shared/streaming-merge.js +44 -0
- package/dist/esm/shared/streaming-merge.js.map +1 -0
- package/dist/esm/slides/extract.js +1942 -0
- package/dist/esm/slides/extract.js.map +1 -0
- package/dist/esm/slides/index.js +4 -0
- package/dist/esm/slides/index.js.map +1 -0
- package/dist/esm/slides/settings.js +73 -0
- package/dist/esm/slides/settings.js.map +1 -0
- package/dist/esm/slides/store.js +111 -0
- package/dist/esm/slides/store.js.map +1 -0
- package/dist/esm/slides/types.js +2 -0
- package/dist/esm/slides/types.js.map +1 -0
- package/dist/esm/tty/osc-progress.js +21 -1
- package/dist/esm/tty/osc-progress.js.map +1 -1
- package/dist/esm/tty/progress/fetch-html.js +8 -4
- package/dist/esm/tty/progress/fetch-html.js.map +1 -1
- package/dist/esm/tty/progress/transcript.js +82 -31
- package/dist/esm/tty/progress/transcript.js.map +1 -1
- package/dist/esm/tty/spinner.js +2 -2
- package/dist/esm/tty/spinner.js.map +1 -1
- package/dist/esm/tty/theme.js +189 -0
- package/dist/esm/tty/theme.js.map +1 -0
- package/dist/esm/tty/website-progress.js +17 -13
- package/dist/esm/tty/website-progress.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/cache.d.ts +14 -2
- package/dist/types/config.d.ts +34 -0
- package/dist/types/daemon/agent.d.ts +25 -0
- package/dist/types/daemon/chat.d.ts +27 -0
- package/dist/types/daemon/env-snapshot.d.ts +1 -1
- package/dist/types/daemon/flow-context.d.ts +24 -3
- package/dist/types/daemon/launchd.d.ts +4 -0
- package/dist/types/daemon/process-registry.d.ts +73 -0
- package/dist/types/daemon/schtasks.d.ts +4 -0
- package/dist/types/daemon/server.d.ts +7 -1
- package/dist/types/daemon/summarize.d.ts +47 -5
- package/dist/types/daemon/systemd.d.ts +4 -0
- package/dist/types/flags.d.ts +1 -0
- package/dist/types/llm/attachments.d.ts +6 -0
- package/dist/types/llm/errors.d.ts +1 -0
- package/dist/types/llm/generate-text.d.ts +29 -13
- package/dist/types/llm/prompt.d.ts +7 -2
- package/dist/types/llm/providers/anthropic.d.ts +30 -0
- package/dist/types/llm/providers/google.d.ts +29 -0
- package/dist/types/llm/providers/models.d.ts +27 -0
- package/dist/types/llm/providers/openai.d.ts +38 -0
- package/dist/types/llm/providers/shared.d.ts +14 -0
- package/dist/types/llm/providers/types.d.ts +6 -0
- package/dist/types/llm/types.d.ts +5 -0
- package/dist/types/llm/usage.d.ts +5 -0
- package/dist/types/logging/daemon.d.ts +26 -0
- package/dist/types/logging/ring-file.d.ts +10 -0
- package/dist/types/media-cache.d.ts +22 -0
- package/dist/types/model-auto.d.ts +1 -0
- package/dist/types/processes.d.ts +1 -0
- package/dist/types/run/attachments.d.ts +9 -6
- package/dist/types/run/bird.d.ts +7 -0
- package/dist/types/run/constants.d.ts +0 -2
- package/dist/types/run/finish-line.d.ts +59 -1
- package/dist/types/run/flows/asset/extract.d.ts +18 -0
- package/dist/types/run/flows/asset/input.d.ts +12 -2
- package/dist/types/run/flows/asset/media-policy.d.ts +2 -0
- package/dist/types/run/flows/asset/media.d.ts +21 -0
- package/dist/types/run/flows/asset/output.d.ts +42 -0
- package/dist/types/run/flows/asset/preprocess.d.ts +22 -2
- package/dist/types/run/flows/asset/summary.d.ts +6 -0
- package/dist/types/run/flows/url/extract.d.ts +2 -1
- package/dist/types/run/flows/url/slides-output.d.ts +66 -0
- package/dist/types/run/flows/url/slides-text.d.ts +87 -0
- package/dist/types/run/flows/url/summary.d.ts +11 -3
- package/dist/types/run/flows/url/types.d.ts +29 -2
- package/dist/types/run/help.d.ts +3 -0
- package/dist/types/run/logging.d.ts +3 -2
- package/dist/types/run/media-cache-state.d.ts +7 -0
- package/dist/types/run/progress.d.ts +2 -1
- package/dist/types/run/run-context.d.ts +44 -0
- package/dist/types/run/run-settings.d.ts +62 -0
- package/dist/types/run/slides-cli.d.ts +9 -0
- package/dist/types/run/slides-render.d.ts +30 -0
- package/dist/types/run/stream-output.d.ts +12 -0
- package/dist/types/run/streaming.d.ts +10 -4
- package/dist/types/run/summary-engine.d.ts +15 -3
- package/dist/types/run/summary-llm.d.ts +2 -2
- package/dist/types/run/transcriber-cli.d.ts +8 -0
- package/dist/types/shared/sse-events.d.ts +64 -0
- package/dist/types/shared/streaming-merge.d.ts +4 -0
- package/dist/types/slides/extract.d.ts +42 -0
- package/dist/types/slides/index.d.ts +5 -0
- package/dist/types/slides/settings.d.ts +20 -0
- package/dist/types/slides/store.d.ts +15 -0
- package/dist/types/slides/types.d.ts +40 -0
- package/dist/types/tty/osc-progress.d.ts +2 -2
- package/dist/types/tty/progress/fetch-html.d.ts +3 -1
- package/dist/types/tty/progress/transcript.d.ts +3 -1
- package/dist/types/tty/spinner.d.ts +3 -1
- package/dist/types/tty/theme.d.ts +44 -0
- package/dist/types/tty/website-progress.d.ts +3 -1
- package/dist/types/version.d.ts +1 -1
- package/docs/README.md +13 -8
- package/docs/_config.yml +26 -0
- package/docs/_layouts/default.html +60 -0
- package/docs/agent.md +333 -0
- package/docs/assets/site.css +748 -0
- package/docs/assets/site.js +72 -0
- package/docs/assets/summarize-cli.png +0 -0
- package/docs/assets/summarize-extension.png +0 -0
- package/docs/assets/youtube-slides.png +0 -0
- package/docs/cache.md +29 -3
- package/docs/chrome-extension.md +85 -7
- package/docs/config.md +74 -2
- package/docs/extract-only.md +10 -2
- package/docs/index.html +205 -0
- package/docs/index.md +25 -0
- package/docs/language.md +1 -1
- package/docs/llm.md +17 -1
- package/docs/manual-tests.md +2 -0
- package/docs/media.md +37 -0
- package/docs/model-auto.md +2 -1
- package/docs/nvidia-onnx-transcription.md +55 -0
- package/docs/openai.md +5 -0
- package/docs/releasing.md +26 -0
- package/docs/site/assets/site.css +399 -228
- package/docs/site/assets/summarize-cli.png +0 -0
- package/docs/site/assets/summarize-extension.png +0 -0
- package/docs/site/docs/chrome-extension.html +89 -0
- package/docs/site/docs/config.html +1 -0
- package/docs/site/docs/extract-only.html +1 -0
- package/docs/site/docs/firecrawl.html +1 -0
- package/docs/site/docs/index.html +5 -0
- package/docs/site/docs/llm.html +1 -0
- package/docs/site/docs/openai.html +1 -0
- package/docs/site/docs/website.html +1 -0
- package/docs/site/docs/youtube.html +1 -0
- package/docs/site/index.html +148 -84
- package/docs/slides.md +74 -0
- package/docs/timestamps.md +103 -0
- package/docs/website.md +13 -0
- package/docs/youtube.md +16 -0
- package/package.json +22 -18
- package/dist/esm/daemon/request-settings.js +0 -91
- package/dist/esm/daemon/request-settings.js.map +0 -1
- package/dist/types/daemon/request-settings.d.ts +0 -27
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Api, AssistantMessage, Context, KnownProvider, Model } from '@mariozechner/pi-ai';
|
|
2
|
+
export declare function resolveBaseUrlOverride(raw: string | null | undefined): string | null;
|
|
3
|
+
export declare function bytesToBase64(bytes: Uint8Array): string;
|
|
4
|
+
export declare function extractText(message: AssistantMessage): string;
|
|
5
|
+
export declare function wantsImages(context: Context): boolean;
|
|
6
|
+
export declare function tryGetModel(provider: KnownProvider, modelId: string): Model<Api> | null;
|
|
7
|
+
export declare function createSyntheticModel({ provider, modelId, api, baseUrl, allowImages, headers, }: {
|
|
8
|
+
provider: KnownProvider;
|
|
9
|
+
modelId: string;
|
|
10
|
+
api: Model<Api>['api'];
|
|
11
|
+
baseUrl: string;
|
|
12
|
+
allowImages: boolean;
|
|
13
|
+
headers?: Record<string, string>;
|
|
14
|
+
}): Model<Api>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LlmTokenUsage } from './types.js';
|
|
2
|
+
export declare function normalizeTokenUsage(raw: unknown): LlmTokenUsage | null;
|
|
3
|
+
export declare function normalizeAnthropicUsage(raw: unknown): LlmTokenUsage | null;
|
|
4
|
+
export declare function normalizeOpenAiUsage(raw: unknown): LlmTokenUsage | null;
|
|
5
|
+
export declare function normalizeGoogleUsage(raw: unknown): LlmTokenUsage | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Logger } from 'tslog';
|
|
2
|
+
import type { SummarizeConfig } from '../config.js';
|
|
3
|
+
export type DaemonLogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
4
|
+
export type DaemonLogFormat = 'json' | 'pretty';
|
|
5
|
+
export type DaemonLoggingConfig = {
|
|
6
|
+
enabled: true;
|
|
7
|
+
level: DaemonLogLevel;
|
|
8
|
+
format: DaemonLogFormat;
|
|
9
|
+
file: string;
|
|
10
|
+
maxBytes: number;
|
|
11
|
+
maxFiles: number;
|
|
12
|
+
};
|
|
13
|
+
export type DaemonLogger = {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
config: DaemonLoggingConfig | null;
|
|
16
|
+
logger: Logger<Record<string, unknown>> | null;
|
|
17
|
+
getSubLogger: (name: string, logObj?: Record<string, unknown>) => Logger<Record<string, unknown>> | null;
|
|
18
|
+
};
|
|
19
|
+
export declare function resolveDaemonLoggingConfig({ env, config, }: {
|
|
20
|
+
env: Record<string, string | undefined>;
|
|
21
|
+
config: SummarizeConfig | null;
|
|
22
|
+
}): DaemonLoggingConfig | null;
|
|
23
|
+
export declare function createDaemonLogger({ env, config, }: {
|
|
24
|
+
env: Record<string, string | undefined>;
|
|
25
|
+
config: SummarizeConfig | null;
|
|
26
|
+
}): DaemonLogger;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type RingFileOptions = {
|
|
2
|
+
filePath: string;
|
|
3
|
+
maxBytes: number;
|
|
4
|
+
maxFiles: number;
|
|
5
|
+
};
|
|
6
|
+
export type RingFileWriter = {
|
|
7
|
+
write: (line: string) => void;
|
|
8
|
+
flush: () => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
export declare function createRingFileWriter(options: RingFileOptions): RingFileWriter;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MediaCache } from './content/index.js';
|
|
2
|
+
export type MediaCacheVerifyMode = 'none' | 'size' | 'hash';
|
|
3
|
+
export type MediaCacheConfig = {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
maxMb?: number;
|
|
6
|
+
ttlDays?: number;
|
|
7
|
+
path?: string;
|
|
8
|
+
verify?: MediaCacheVerifyMode;
|
|
9
|
+
};
|
|
10
|
+
export declare const DEFAULT_MEDIA_CACHE_MAX_MB = 2048;
|
|
11
|
+
export declare const DEFAULT_MEDIA_CACHE_TTL_DAYS = 7;
|
|
12
|
+
export declare const DEFAULT_MEDIA_CACHE_VERIFY: MediaCacheVerifyMode;
|
|
13
|
+
export declare function resolveMediaCachePath({ env, cachePath, }: {
|
|
14
|
+
env: Record<string, string | undefined>;
|
|
15
|
+
cachePath: string | null;
|
|
16
|
+
}): string | null;
|
|
17
|
+
export declare function createMediaCache({ path, maxBytes, ttlMs, verify, }: {
|
|
18
|
+
path: string;
|
|
19
|
+
maxBytes: number;
|
|
20
|
+
ttlMs: number;
|
|
21
|
+
verify?: MediaCacheVerifyMode;
|
|
22
|
+
}): Promise<MediaCache>;
|
|
@@ -9,6 +9,7 @@ export type AutoSelectionInput = {
|
|
|
9
9
|
config: SummarizeConfig | null;
|
|
10
10
|
catalog: LiteLlmCatalog | null;
|
|
11
11
|
openrouterProvidersFromEnv: string[] | null;
|
|
12
|
+
openrouterModelIds?: string[] | null;
|
|
12
13
|
cliAvailability?: Partial<Record<CliProvider, boolean>>;
|
|
13
14
|
};
|
|
14
15
|
export type AutoModelAttempt = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@steipete/summarize-core/processes';
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { PromptPayload } from '../llm/prompt.js';
|
|
1
|
+
import type { loadLocalAsset } from '../content/asset.js';
|
|
3
2
|
export type AssetAttachment = Awaited<ReturnType<typeof loadLocalAsset>>['attachment'];
|
|
3
|
+
export declare const MAX_DOCUMENT_BYTES_DEFAULT: number;
|
|
4
4
|
export declare function isUnsupportedAttachmentError(error: unknown): boolean;
|
|
5
5
|
export declare function isTextLikeMediaType(mediaType: string): boolean;
|
|
6
6
|
export declare function assertAssetMediaTypeSupported({ attachment, sizeLabel, }: {
|
|
7
7
|
attachment: AssetAttachment;
|
|
8
8
|
sizeLabel: string | null;
|
|
9
9
|
}): void;
|
|
10
|
-
export declare function buildAssetPromptPayload({ promptText, attachment, }: {
|
|
11
|
-
promptText: string;
|
|
12
|
-
attachment: AssetAttachment;
|
|
13
|
-
}): PromptPayload;
|
|
14
10
|
export declare function getTextContentFromAttachment(attachment: AssetAttachment): {
|
|
15
11
|
content: string;
|
|
16
12
|
bytes: number;
|
|
@@ -22,6 +18,13 @@ export declare function ensureCliAttachmentPath({ sourceKind, sourceLabel, attac
|
|
|
22
18
|
attachment: AssetAttachment;
|
|
23
19
|
}): Promise<string>;
|
|
24
20
|
export declare function shouldMarkitdownConvertMediaType(mediaType: string): boolean;
|
|
21
|
+
export declare function supportsNativeFileAttachment({ provider, attachment, }: {
|
|
22
|
+
provider: 'xai' | 'openai' | 'google' | 'anthropic' | 'zai';
|
|
23
|
+
attachment: {
|
|
24
|
+
kind: 'image' | 'file';
|
|
25
|
+
mediaType: string;
|
|
26
|
+
};
|
|
27
|
+
}): boolean;
|
|
25
28
|
export declare function assertProviderSupportsAttachment({ provider, modelId, attachment, }: {
|
|
26
29
|
provider: 'xai' | 'openai' | 'google' | 'anthropic' | 'zai';
|
|
27
30
|
modelId: string;
|
package/dist/types/run/bird.d.ts
CHANGED
|
@@ -6,6 +6,13 @@ type BirdTweetPayload = {
|
|
|
6
6
|
name?: string;
|
|
7
7
|
};
|
|
8
8
|
createdAt?: string;
|
|
9
|
+
media?: BirdTweetMedia | null;
|
|
10
|
+
};
|
|
11
|
+
type BirdTweetMedia = {
|
|
12
|
+
kind: 'video' | 'audio';
|
|
13
|
+
urls: string[];
|
|
14
|
+
preferredUrl: string | null;
|
|
15
|
+
source: 'extended_entities' | 'card' | 'entities';
|
|
9
16
|
};
|
|
10
17
|
export declare function readTweetWithBird(args: {
|
|
11
18
|
url: string;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { ModelConfig } from '../config.js';
|
|
2
|
-
import type { SummaryLength } from '../shared/contracts.js';
|
|
3
2
|
export declare const BIRD_TIP = "Tip: Install bird\uD83D\uDC26 for better Twitter support: https://github.com/steipete/bird";
|
|
4
3
|
export declare const UVX_TIP = "Tip: Install uv (uvx) for local Markdown conversion: brew install uv (or set UVX_PATH to your uvx binary).";
|
|
5
4
|
export declare const SUPPORT_URL = "https://github.com/steipete/summarize";
|
|
6
5
|
export declare const TWITTER_HOSTS: Set<string>;
|
|
7
|
-
export declare const SUMMARY_LENGTH_MAX_CHARACTERS: Record<SummaryLength, number>;
|
|
8
6
|
export declare const MAX_TEXT_BYTES_DEFAULT: number;
|
|
9
7
|
export declare const BUILTIN_MODELS: Record<string, ModelConfig>;
|
|
10
8
|
export declare const VERBOSE_PREFIX = "[summarize]";
|
|
@@ -2,6 +2,10 @@ export type FinishLineText = {
|
|
|
2
2
|
line: string;
|
|
3
3
|
details: string | null;
|
|
4
4
|
};
|
|
5
|
+
export type FinishLineModel = {
|
|
6
|
+
lineParts: string[];
|
|
7
|
+
detailParts: string[];
|
|
8
|
+
};
|
|
5
9
|
export type ExtractDiagnosticsForFinishLine = {
|
|
6
10
|
strategy: 'bird' | 'firecrawl' | 'html' | 'nitter';
|
|
7
11
|
firecrawl: {
|
|
@@ -41,7 +45,7 @@ export type ExtractedForLengths = {
|
|
|
41
45
|
};
|
|
42
46
|
export declare function formatModelLabelForDisplay(model: string): string;
|
|
43
47
|
export declare function buildLengthPartsForFinishLine(extracted: ExtractedForLengths, detailed: boolean): string[] | null;
|
|
44
|
-
export declare function writeFinishLine({ stderr, elapsedMs, elapsedLabel, label, model, report, costUsd, detailed, extraParts, color, }: {
|
|
48
|
+
export declare function writeFinishLine({ stderr, elapsedMs, elapsedLabel, label, model, report, costUsd, detailed, extraParts, color, env, }: {
|
|
45
49
|
stderr: NodeJS.WritableStream;
|
|
46
50
|
elapsedMs: number;
|
|
47
51
|
elapsedLabel?: string | null;
|
|
@@ -67,6 +71,7 @@ export declare function writeFinishLine({ stderr, elapsedMs, elapsedLabel, label
|
|
|
67
71
|
detailed: boolean;
|
|
68
72
|
extraParts?: string[] | null;
|
|
69
73
|
color: boolean;
|
|
74
|
+
env?: Record<string, string | undefined>;
|
|
70
75
|
}): void;
|
|
71
76
|
export declare function buildFinishLineText({ elapsedMs, elapsedLabel, label, model, report, costUsd, detailed, extraParts, }: {
|
|
72
77
|
elapsedMs: number;
|
|
@@ -93,6 +98,59 @@ export declare function buildFinishLineText({ elapsedMs, elapsedLabel, label, mo
|
|
|
93
98
|
detailed: boolean;
|
|
94
99
|
extraParts?: string[] | null;
|
|
95
100
|
}): FinishLineText;
|
|
101
|
+
export declare function buildFinishLineVariants({ elapsedMs, elapsedLabel, label, model, report, costUsd, compactExtraParts, detailedExtraParts, }: {
|
|
102
|
+
elapsedMs: number;
|
|
103
|
+
elapsedLabel?: string | null;
|
|
104
|
+
label?: string | null;
|
|
105
|
+
model: string | null;
|
|
106
|
+
report: {
|
|
107
|
+
llm: Array<{
|
|
108
|
+
promptTokens: number | null;
|
|
109
|
+
completionTokens: number | null;
|
|
110
|
+
totalTokens: number | null;
|
|
111
|
+
calls: number;
|
|
112
|
+
}>;
|
|
113
|
+
services: {
|
|
114
|
+
firecrawl: {
|
|
115
|
+
requests: number;
|
|
116
|
+
};
|
|
117
|
+
apify: {
|
|
118
|
+
requests: number;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
costUsd: number | null;
|
|
123
|
+
compactExtraParts?: string[] | null;
|
|
124
|
+
detailedExtraParts?: string[] | null;
|
|
125
|
+
}): {
|
|
126
|
+
compact: FinishLineText;
|
|
127
|
+
detailed: FinishLineText;
|
|
128
|
+
};
|
|
129
|
+
export declare function formatFinishLineText(model: FinishLineModel, detailed: boolean): FinishLineText;
|
|
130
|
+
export declare function buildFinishLineModel({ elapsedMs, elapsedLabel, label, model, report, costUsd, extraParts, }: {
|
|
131
|
+
elapsedMs: number;
|
|
132
|
+
elapsedLabel?: string | null;
|
|
133
|
+
label?: string | null;
|
|
134
|
+
model: string | null;
|
|
135
|
+
report: {
|
|
136
|
+
llm: Array<{
|
|
137
|
+
promptTokens: number | null;
|
|
138
|
+
completionTokens: number | null;
|
|
139
|
+
totalTokens: number | null;
|
|
140
|
+
calls: number;
|
|
141
|
+
}>;
|
|
142
|
+
services: {
|
|
143
|
+
firecrawl: {
|
|
144
|
+
requests: number;
|
|
145
|
+
};
|
|
146
|
+
apify: {
|
|
147
|
+
requests: number;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
costUsd: number | null;
|
|
152
|
+
extraParts?: string[] | null;
|
|
153
|
+
}): FinishLineModel;
|
|
96
154
|
export declare function buildExtractFinishLabel(args: {
|
|
97
155
|
extracted: {
|
|
98
156
|
diagnostics: ExtractDiagnosticsForFinishLine;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ExecFileFn } from '../../../markitdown.js';
|
|
2
|
+
import { type AssetAttachment } from '../../attachments.js';
|
|
3
|
+
import type { ExtractDiagnosticsForFinishLine } from '../../finish-line.js';
|
|
4
|
+
export type AssetExtractContext = {
|
|
5
|
+
env: Record<string, string | undefined>;
|
|
6
|
+
envForRun: Record<string, string | undefined>;
|
|
7
|
+
execFileImpl: ExecFileFn;
|
|
8
|
+
timeoutMs: number;
|
|
9
|
+
preprocessMode: 'off' | 'auto' | 'always';
|
|
10
|
+
};
|
|
11
|
+
export type AssetExtractResult = {
|
|
12
|
+
content: string;
|
|
13
|
+
diagnostics: ExtractDiagnosticsForFinishLine;
|
|
14
|
+
};
|
|
15
|
+
export declare function extractAssetContent({ ctx, attachment, }: {
|
|
16
|
+
ctx: AssetExtractContext;
|
|
17
|
+
attachment: AssetAttachment;
|
|
18
|
+
}): Promise<AssetExtractResult>;
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import { type InputTarget } from '../../../content/asset.js';
|
|
1
|
+
import { type InputTarget, loadRemoteAsset } from '../../../content/asset.js';
|
|
2
|
+
import { startSpinner } from '../../../tty/spinner.js';
|
|
2
3
|
import type { SummarizeAssetArgs } from './summary.js';
|
|
3
4
|
export type AssetInputContext = {
|
|
4
5
|
env: Record<string, string | undefined>;
|
|
6
|
+
envForRun: Record<string, string | undefined>;
|
|
5
7
|
stderr: NodeJS.WritableStream;
|
|
6
8
|
progressEnabled: boolean;
|
|
7
9
|
timeoutMs: number;
|
|
8
10
|
trackedFetch: typeof fetch;
|
|
9
11
|
summarizeAsset: (args: SummarizeAssetArgs) => Promise<void>;
|
|
10
|
-
|
|
12
|
+
summarizeMediaFile?: (args: SummarizeAssetArgs) => Promise<void>;
|
|
13
|
+
setClearProgressBeforeStdout: (fn: (() => undefined | (() => void)) | null) => void;
|
|
11
14
|
clearProgressIfCurrent: (fn: () => void) => void;
|
|
12
15
|
};
|
|
16
|
+
type UrlAssetHandler = (args: {
|
|
17
|
+
loaded: Awaited<ReturnType<typeof loadRemoteAsset>>;
|
|
18
|
+
spinner: ReturnType<typeof startSpinner>;
|
|
19
|
+
clearProgressLine: () => void;
|
|
20
|
+
}) => Promise<void>;
|
|
13
21
|
export declare function handleFileInput(ctx: AssetInputContext, inputTarget: InputTarget): Promise<boolean>;
|
|
22
|
+
export declare function withUrlAsset(ctx: AssetInputContext, url: string, isYoutubeUrl: boolean, handler: UrlAssetHandler): Promise<boolean>;
|
|
14
23
|
export declare function handleUrlAsset(ctx: AssetInputContext, url: string, isYoutubeUrl: boolean): Promise<boolean>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Media file transcription handler for local audio/video files.
|
|
3
|
+
* Phase 2: Transcript provider integration
|
|
4
|
+
* Phase 2.2: Local file path handling for transcript caching
|
|
5
|
+
*/
|
|
6
|
+
import type { AssetSummaryContext, SummarizeAssetArgs } from './summary.js';
|
|
7
|
+
/**
|
|
8
|
+
* Handler for local audio/video files.
|
|
9
|
+
*
|
|
10
|
+
* Phase 2 Implementation:
|
|
11
|
+
* 1. Validates transcription provider availability
|
|
12
|
+
* 2. Creates LinkPreviewClient with necessary dependencies
|
|
13
|
+
* 3. Calls client.fetchLinkContent to trigger transcription
|
|
14
|
+
* 4. Converts transcript text to AssetAttachment
|
|
15
|
+
* 5. Calls summarizeAsset with the transcript
|
|
16
|
+
*
|
|
17
|
+
* Phase 2.2 Enhancement:
|
|
18
|
+
* - Captures file modification time for cache invalidation
|
|
19
|
+
* - Passes fileMtime to transcript cache for local file support
|
|
20
|
+
*/
|
|
21
|
+
export declare function summarizeMediaFile(ctx: AssetSummaryContext, args: SummarizeAssetArgs): Promise<void>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { RunMetricsReport } from '../../../costs.js';
|
|
2
|
+
import type { AssetAttachment } from '../../attachments.js';
|
|
3
|
+
import type { AssetExtractResult } from './extract.js';
|
|
4
|
+
export declare function outputExtractedAsset({ io, flags, hooks, url, sourceLabel, attachment, extracted, apiStatus, }: {
|
|
5
|
+
io: {
|
|
6
|
+
env: Record<string, string | undefined>;
|
|
7
|
+
envForRun: Record<string, string | undefined>;
|
|
8
|
+
stdout: NodeJS.WritableStream;
|
|
9
|
+
stderr: NodeJS.WritableStream;
|
|
10
|
+
};
|
|
11
|
+
flags: {
|
|
12
|
+
timeoutMs: number;
|
|
13
|
+
preprocessMode: 'off' | 'auto' | 'always';
|
|
14
|
+
format: 'text' | 'markdown';
|
|
15
|
+
plain: boolean;
|
|
16
|
+
json: boolean;
|
|
17
|
+
metricsEnabled: boolean;
|
|
18
|
+
metricsDetailed: boolean;
|
|
19
|
+
shouldComputeReport: boolean;
|
|
20
|
+
runStartedAtMs: number;
|
|
21
|
+
verboseColor: boolean;
|
|
22
|
+
};
|
|
23
|
+
hooks: {
|
|
24
|
+
clearProgressForStdout: () => void;
|
|
25
|
+
restoreProgressAfterStdout?: (() => void) | null;
|
|
26
|
+
buildReport: () => Promise<RunMetricsReport>;
|
|
27
|
+
estimateCostUsd: () => Promise<number | null>;
|
|
28
|
+
};
|
|
29
|
+
url: string;
|
|
30
|
+
sourceLabel: string;
|
|
31
|
+
attachment: AssetAttachment;
|
|
32
|
+
extracted: AssetExtractResult;
|
|
33
|
+
apiStatus: {
|
|
34
|
+
xaiApiKey: string | null;
|
|
35
|
+
apiKey: string | null;
|
|
36
|
+
openrouterApiKey: string | null;
|
|
37
|
+
apifyToken: string | null;
|
|
38
|
+
firecrawlConfigured: boolean;
|
|
39
|
+
googleConfigured: boolean;
|
|
40
|
+
anthropicConfigured: boolean;
|
|
41
|
+
};
|
|
42
|
+
}): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OutputLanguage } from '../../../language.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Attachment } from '../../../llm/attachments.js';
|
|
3
3
|
import { convertToMarkdownWithMarkitdown } from '../../../markitdown.js';
|
|
4
4
|
import type { FixedModelSpec } from '../../../model-spec.js';
|
|
5
5
|
import type { SummaryLength } from '../../../shared/contracts.js';
|
|
@@ -25,14 +25,34 @@ export type AssetPreprocessContext = {
|
|
|
25
25
|
languageInstruction?: string | null;
|
|
26
26
|
};
|
|
27
27
|
export type AssetPreprocessResult = {
|
|
28
|
-
promptPayload: PromptPayload;
|
|
29
28
|
promptText: string;
|
|
29
|
+
attachments: Attachment[];
|
|
30
30
|
assetFooterParts: string[];
|
|
31
31
|
textContent: {
|
|
32
32
|
content: string;
|
|
33
33
|
bytes: number;
|
|
34
34
|
} | null;
|
|
35
35
|
};
|
|
36
|
+
export type DocumentHandlingDecision = {
|
|
37
|
+
mode: 'inline';
|
|
38
|
+
} | {
|
|
39
|
+
mode: 'attach';
|
|
40
|
+
} | {
|
|
41
|
+
mode: 'preprocess';
|
|
42
|
+
} | {
|
|
43
|
+
mode: 'error';
|
|
44
|
+
error: Error;
|
|
45
|
+
};
|
|
46
|
+
export declare function resolveDocumentHandling({ attachment, textContent, fileBytes, preprocessMode, fixedModelSpec, }: {
|
|
47
|
+
attachment: AssetAttachment;
|
|
48
|
+
textContent: {
|
|
49
|
+
content: string;
|
|
50
|
+
bytes: number;
|
|
51
|
+
} | null;
|
|
52
|
+
fileBytes: Uint8Array | null;
|
|
53
|
+
preprocessMode: 'off' | 'auto' | 'always';
|
|
54
|
+
fixedModelSpec: FixedModelSpec | null;
|
|
55
|
+
}): DocumentHandlingDecision;
|
|
36
56
|
export declare function prepareAssetPrompt({ ctx, attachment, }: {
|
|
37
57
|
ctx: AssetPreprocessContext;
|
|
38
58
|
attachment: AssetAttachment;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CacheState } from '../../../cache.js';
|
|
2
2
|
import type { CliProvider, SummarizeConfig } from '../../../config.js';
|
|
3
|
+
import type { MediaCache } from '../../../content/index.js';
|
|
3
4
|
import type { LlmCall, RunMetricsReport } from '../../../costs.js';
|
|
4
5
|
import type { OutputLanguage } from '../../../language.js';
|
|
5
6
|
import type { ExecFileFn } from '../../../markitdown.js';
|
|
@@ -16,6 +17,7 @@ export type AssetSummaryContext = {
|
|
|
16
17
|
timeoutMs: number;
|
|
17
18
|
preprocessMode: 'off' | 'auto' | 'always';
|
|
18
19
|
format: 'text' | 'markdown';
|
|
20
|
+
extractMode: boolean;
|
|
19
21
|
lengthArg: {
|
|
20
22
|
kind: 'preset';
|
|
21
23
|
preset: SummaryLength;
|
|
@@ -23,6 +25,7 @@ export type AssetSummaryContext = {
|
|
|
23
25
|
kind: 'chars';
|
|
24
26
|
maxCharacters: number;
|
|
25
27
|
};
|
|
28
|
+
forceSummary: boolean;
|
|
26
29
|
outputLanguage: OutputLanguage;
|
|
27
30
|
videoMode: 'auto' | 'transcript' | 'understand';
|
|
28
31
|
fixedModelSpec: FixedModelSpec | null;
|
|
@@ -53,11 +56,14 @@ export type AssetSummaryContext = {
|
|
|
53
56
|
trackedFetch: typeof fetch;
|
|
54
57
|
writeViaFooter: (parts: string[]) => void;
|
|
55
58
|
clearProgressForStdout: () => void;
|
|
59
|
+
restoreProgressAfterStdout?: (() => void) | null;
|
|
56
60
|
getLiteLlmCatalog: () => Promise<Awaited<ReturnType<typeof import('../../../pricing/litellm.js').loadLiteLlmCatalog>>['catalog']>;
|
|
57
61
|
buildReport: () => Promise<RunMetricsReport>;
|
|
58
62
|
estimateCostUsd: () => Promise<number | null>;
|
|
59
63
|
llmCalls: LlmCall[];
|
|
60
64
|
cache: CacheState;
|
|
65
|
+
summaryCacheBypass: boolean;
|
|
66
|
+
mediaCache: MediaCache | null;
|
|
61
67
|
apiStatus: {
|
|
62
68
|
xaiApiKey: string | null;
|
|
63
69
|
apiKey: string | null;
|
|
@@ -14,9 +14,10 @@ export declare function fetchLinkContentWithBirdTip({ client, url, options, env,
|
|
|
14
14
|
env: Record<string, string | undefined>;
|
|
15
15
|
}): Promise<ExtractedLinkContent>;
|
|
16
16
|
export declare function deriveExtractionUi(extracted: ExtractedLinkContent): UrlExtractionUi;
|
|
17
|
-
export declare function logExtractionDiagnostics({ extracted, stderr, verbose, verboseColor, }: {
|
|
17
|
+
export declare function logExtractionDiagnostics({ extracted, stderr, verbose, verboseColor, env, }: {
|
|
18
18
|
extracted: ExtractedLinkContent;
|
|
19
19
|
stderr: NodeJS.WritableStream;
|
|
20
20
|
verbose: boolean;
|
|
21
21
|
verboseColor: boolean;
|
|
22
|
+
env?: Record<string, string | undefined>;
|
|
22
23
|
}): void;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ExtractedLinkContent } from '../../../content/index.js';
|
|
2
|
+
import type { SummaryLength } from '../../../shared/contracts.js';
|
|
3
|
+
import type { SlideExtractionResult, SlideImage, SlideSourceKind } from '../../../slides/index.js';
|
|
4
|
+
import { type StreamOutputMode } from '../../stream-output.js';
|
|
5
|
+
import type { SummaryStreamHandler } from '../../summary-engine.js';
|
|
6
|
+
export type SlidesTerminalOutput = {
|
|
7
|
+
onSlidesExtracted: (slides: SlideExtractionResult) => void;
|
|
8
|
+
onSlidesDone: (result: {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
error?: string | null;
|
|
11
|
+
}) => void;
|
|
12
|
+
onSlideChunk: (chunk: {
|
|
13
|
+
slide: SlideImage;
|
|
14
|
+
meta: {
|
|
15
|
+
slidesDir: string;
|
|
16
|
+
sourceUrl: string;
|
|
17
|
+
sourceId: string;
|
|
18
|
+
sourceKind: SlideSourceKind;
|
|
19
|
+
ocrAvailable: boolean;
|
|
20
|
+
};
|
|
21
|
+
}) => void;
|
|
22
|
+
streamHandler: SummaryStreamHandler;
|
|
23
|
+
renderFromText: (summary: string) => Promise<void>;
|
|
24
|
+
};
|
|
25
|
+
export declare function createSlidesTerminalOutput({ io, flags, extracted, slides, enabled, outputMode, clearProgressForStdout, restoreProgressAfterStdout, onProgressText, }: {
|
|
26
|
+
io: {
|
|
27
|
+
env: Record<string, string | undefined>;
|
|
28
|
+
envForRun: Record<string, string | undefined>;
|
|
29
|
+
stdout: NodeJS.WritableStream;
|
|
30
|
+
stderr: NodeJS.WritableStream;
|
|
31
|
+
};
|
|
32
|
+
flags: {
|
|
33
|
+
plain: boolean;
|
|
34
|
+
lengthArg: {
|
|
35
|
+
kind: 'preset';
|
|
36
|
+
preset: SummaryLength;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'chars';
|
|
39
|
+
maxCharacters: number;
|
|
40
|
+
};
|
|
41
|
+
slidesDebug?: boolean;
|
|
42
|
+
};
|
|
43
|
+
extracted: ExtractedLinkContent;
|
|
44
|
+
slides: SlideExtractionResult | null | undefined;
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
outputMode?: StreamOutputMode | null;
|
|
47
|
+
clearProgressForStdout: () => void;
|
|
48
|
+
restoreProgressAfterStdout?: (() => void) | null;
|
|
49
|
+
onProgressText?: ((text: string) => void) | null;
|
|
50
|
+
}): SlidesTerminalOutput | null;
|
|
51
|
+
export declare function createSlidesSummaryStreamHandler({ stdout, env, envForRun, plain, outputMode, clearProgressForStdout, restoreProgressAfterStdout, renderSlide, getSlideIndexOrder, getSlideMeta, debugWrite, }: {
|
|
52
|
+
stdout: NodeJS.WritableStream;
|
|
53
|
+
env: Record<string, string | undefined>;
|
|
54
|
+
envForRun: Record<string, string | undefined>;
|
|
55
|
+
plain: boolean;
|
|
56
|
+
outputMode: StreamOutputMode;
|
|
57
|
+
clearProgressForStdout: () => void;
|
|
58
|
+
restoreProgressAfterStdout?: (() => void) | null;
|
|
59
|
+
renderSlide: (index: number, title?: string | null) => Promise<void>;
|
|
60
|
+
getSlideIndexOrder: () => number[];
|
|
61
|
+
getSlideMeta?: ((index: number) => {
|
|
62
|
+
total: number;
|
|
63
|
+
timestamp: number | null;
|
|
64
|
+
}) | null;
|
|
65
|
+
debugWrite?: ((text: string) => void) | null;
|
|
66
|
+
}): SummaryStreamHandler;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { SummaryLength } from '../../../shared/contracts.js';
|
|
2
|
+
export type TranscriptSegment = {
|
|
3
|
+
startSeconds: number;
|
|
4
|
+
text: string;
|
|
5
|
+
};
|
|
6
|
+
export type SlideTimelineEntry = {
|
|
7
|
+
index: number;
|
|
8
|
+
timestamp: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const splitSlideTitleFromText: ({ text, }: {
|
|
11
|
+
text: string;
|
|
12
|
+
slideIndex: number;
|
|
13
|
+
total: number;
|
|
14
|
+
}) => {
|
|
15
|
+
title: string | null;
|
|
16
|
+
body: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const ensureSlideTitleLine: ({ text, slide, total, }: {
|
|
19
|
+
text: string;
|
|
20
|
+
slide: SlideTimelineEntry;
|
|
21
|
+
total: number;
|
|
22
|
+
}) => string;
|
|
23
|
+
export declare function findSlidesSectionStart(markdown: string): number | null;
|
|
24
|
+
export declare function splitSummaryFromSlides(markdown: string): {
|
|
25
|
+
summary: string;
|
|
26
|
+
slidesSection: string | null;
|
|
27
|
+
};
|
|
28
|
+
export declare function parseSlideSummariesFromMarkdown(markdown: string): Map<number, string>;
|
|
29
|
+
export declare function extractSlideMarkers(markdown: string): number[];
|
|
30
|
+
export declare function normalizeSummarySlideHeadings(markdown: string): string;
|
|
31
|
+
export declare function buildSlideTextFallback({ slides, transcriptTimedText, lengthArg, }: {
|
|
32
|
+
slides: SlideTimelineEntry[];
|
|
33
|
+
transcriptTimedText: string | null | undefined;
|
|
34
|
+
lengthArg: {
|
|
35
|
+
kind: 'preset';
|
|
36
|
+
preset: SummaryLength;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'chars';
|
|
39
|
+
maxCharacters: number;
|
|
40
|
+
};
|
|
41
|
+
}): Map<number, string>;
|
|
42
|
+
export declare function coerceSummaryWithSlides({ markdown, slides, transcriptTimedText, lengthArg, }: {
|
|
43
|
+
markdown: string;
|
|
44
|
+
slides: SlideTimelineEntry[];
|
|
45
|
+
transcriptTimedText?: string | null;
|
|
46
|
+
lengthArg: {
|
|
47
|
+
kind: 'preset';
|
|
48
|
+
preset: SummaryLength;
|
|
49
|
+
} | {
|
|
50
|
+
kind: 'chars';
|
|
51
|
+
maxCharacters: number;
|
|
52
|
+
};
|
|
53
|
+
}): string;
|
|
54
|
+
export declare function interleaveSlidesIntoTranscript({ transcriptTimedText, slides, }: {
|
|
55
|
+
transcriptTimedText: string;
|
|
56
|
+
slides: SlideTimelineEntry[];
|
|
57
|
+
}): string;
|
|
58
|
+
export declare function parseTranscriptTimedText(input: string | null | undefined): TranscriptSegment[];
|
|
59
|
+
export declare function formatTimestamp(seconds: number): string;
|
|
60
|
+
export declare function resolveSlideTextBudget({ lengthArg, slideCount, }: {
|
|
61
|
+
lengthArg: {
|
|
62
|
+
kind: 'preset';
|
|
63
|
+
preset: SummaryLength;
|
|
64
|
+
} | {
|
|
65
|
+
kind: 'chars';
|
|
66
|
+
maxCharacters: number;
|
|
67
|
+
};
|
|
68
|
+
slideCount: number;
|
|
69
|
+
}): number;
|
|
70
|
+
export declare function resolveSlideWindowSeconds({ lengthArg, }: {
|
|
71
|
+
lengthArg: {
|
|
72
|
+
kind: 'preset';
|
|
73
|
+
preset: SummaryLength;
|
|
74
|
+
} | {
|
|
75
|
+
kind: 'chars';
|
|
76
|
+
maxCharacters: number;
|
|
77
|
+
};
|
|
78
|
+
}): number;
|
|
79
|
+
export declare function getTranscriptTextForSlide({ slide, nextSlide, segments, budget, windowSeconds, }: {
|
|
80
|
+
slide: SlideTimelineEntry;
|
|
81
|
+
nextSlide: SlideTimelineEntry | null;
|
|
82
|
+
segments: TranscriptSegment[];
|
|
83
|
+
budget: number;
|
|
84
|
+
windowSeconds: number;
|
|
85
|
+
}): string;
|
|
86
|
+
export declare function formatOsc8Link(label: string, url: string | null, enabled: boolean): string;
|
|
87
|
+
export declare function buildTimestampUrl(sourceUrl: string, seconds: number): string | null;
|