@steipete/summarize 0.17.1 → 0.17.2
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 +20 -0
- package/README.md +17 -9
- package/dist/esm/daemon/flow-context.js +8 -0
- package/dist/esm/daemon/flow-context.js.map +1 -1
- package/dist/esm/daemon/server.js +27 -8
- package/dist/esm/daemon/server.js.map +1 -1
- package/dist/esm/llm/provider-profile.js +1 -1
- package/dist/esm/llm/provider-profile.js.map +1 -1
- package/dist/esm/logging/daemon.js +36 -40
- package/dist/esm/logging/daemon.js.map +1 -1
- package/dist/esm/run/flows/asset/media.js +75 -8
- package/dist/esm/run/flows/asset/media.js.map +1 -1
- package/dist/esm/run/flows/asset/summary.js.map +1 -1
- package/dist/esm/run/help.js +2 -1
- package/dist/esm/run/help.js.map +1 -1
- package/dist/esm/run/runner-contexts.js +8 -0
- package/dist/esm/run/runner-contexts.js.map +1 -1
- package/dist/esm/run/runner-plan.js +10 -3
- package/dist/esm/run/runner-plan.js.map +1 -1
- package/dist/esm/run/runner-setup.js +6 -1
- package/dist/esm/run/runner-setup.js.map +1 -1
- package/dist/esm/tty/spinner.js +100 -32
- package/dist/esm/tty/spinner.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/daemon/server.d.ts +5 -0
- package/dist/types/logging/daemon.d.ts +8 -3
- package/dist/types/run/flows/asset/summary.d.ts +10 -1
- package/dist/types/run/flows/url/summary-json.d.ts +1 -1
- package/dist/types/tty/spinner.d.ts +2 -2
- package/dist/types/version.d.ts +1 -1
- package/docs/chrome-extension.md +11 -6
- package/docs/commands/summarize.md +1 -1
- package/docs/install.md +1 -1
- package/docs/media.md +6 -2
- package/docs/transcript-provider-flow.md +3 -1
- package/docs/youtube.md +1 -1
- package/package.json +2 -5
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Logger } from "tslog";
|
|
2
1
|
import type { SummarizeConfig } from "../config.js";
|
|
3
2
|
export type DaemonLogLevel = "debug" | "info" | "warn" | "error";
|
|
4
3
|
export type DaemonLogFormat = "json" | "pretty";
|
|
@@ -10,11 +9,17 @@ export type DaemonLoggingConfig = {
|
|
|
10
9
|
maxBytes: number;
|
|
11
10
|
maxFiles: number;
|
|
12
11
|
};
|
|
12
|
+
export type DaemonLogWriter = {
|
|
13
|
+
debug: (payload: Record<string, unknown>) => void;
|
|
14
|
+
info: (payload: Record<string, unknown>) => void;
|
|
15
|
+
warn: (payload: Record<string, unknown>) => void;
|
|
16
|
+
error: (payload: Record<string, unknown>) => void;
|
|
17
|
+
};
|
|
13
18
|
export type DaemonLogger = {
|
|
14
19
|
enabled: boolean;
|
|
15
20
|
config: DaemonLoggingConfig | null;
|
|
16
|
-
logger:
|
|
17
|
-
getSubLogger: (name: string, logObj?: Record<string, unknown>) =>
|
|
21
|
+
logger: DaemonLogWriter | null;
|
|
22
|
+
getSubLogger: (name: string, logObj?: Record<string, unknown>) => DaemonLogWriter | null;
|
|
18
23
|
};
|
|
19
24
|
export declare function resolveDaemonLoggingConfig({ env, config, }: {
|
|
20
25
|
env: Record<string, string | undefined>;
|
|
@@ -6,6 +6,7 @@ import type { OutputLanguage } from "../../../language.js";
|
|
|
6
6
|
import type { ExecFileFn } from "../../../markitdown.js";
|
|
7
7
|
import type { FixedModelSpec, RequestedModel } from "../../../model-spec.js";
|
|
8
8
|
import type { SummaryLength } from "../../../shared/contracts.js";
|
|
9
|
+
import type { SpeakerIdentificationSettings } from "../../../speaker-identification/index.js";
|
|
9
10
|
import { type AssetAttachment } from "../../attachments.js";
|
|
10
11
|
import type { createSummaryEngine } from "../../summary-engine.js";
|
|
11
12
|
export type AssetSummaryContext = {
|
|
@@ -28,6 +29,10 @@ export type AssetSummaryContext = {
|
|
|
28
29
|
forceSummary: boolean;
|
|
29
30
|
outputLanguage: OutputLanguage;
|
|
30
31
|
videoMode: "auto" | "transcript" | "understand";
|
|
32
|
+
transcriptTimestamps: boolean;
|
|
33
|
+
transcriptDiarization: "auto" | "elevenlabs" | "openai" | null;
|
|
34
|
+
speakerIdentification: SpeakerIdentificationSettings | null;
|
|
35
|
+
configPath: string | null;
|
|
31
36
|
fixedModelSpec: FixedModelSpec | null;
|
|
32
37
|
promptOverride?: string | null;
|
|
33
38
|
lengthInstruction?: string | null;
|
|
@@ -88,13 +93,17 @@ export type AssetSummaryContext = {
|
|
|
88
93
|
nvidiaBaseUrl: string;
|
|
89
94
|
minimaxBaseUrl: string;
|
|
90
95
|
ollamaBaseUrl: string;
|
|
96
|
+
falApiKey: string | null;
|
|
97
|
+
groqApiKey: string | null;
|
|
91
98
|
assemblyaiApiKey: string | null;
|
|
99
|
+
elevenlabsApiKey: string | null;
|
|
100
|
+
googleApiKey: string | null;
|
|
92
101
|
openaiApiKey: string | null;
|
|
93
102
|
};
|
|
94
103
|
};
|
|
95
104
|
export type AssetSummaryContextInput = {
|
|
96
105
|
io: Pick<AssetSummaryContext, "env" | "envForRun" | "stdout" | "stderr" | "execFileImpl" | "trackedFetch">;
|
|
97
|
-
summary: Pick<AssetSummaryContext, "timeoutMs" | "preprocessMode" | "format" | "extractMode" | "lengthArg" | "forceSummary" | "outputLanguage" | "videoMode" | "promptOverride" | "lengthInstruction" | "languageInstruction" | "maxOutputTokensArg" | "summaryCacheBypass">;
|
|
106
|
+
summary: Pick<AssetSummaryContext, "timeoutMs" | "preprocessMode" | "format" | "extractMode" | "lengthArg" | "forceSummary" | "outputLanguage" | "videoMode" | "transcriptTimestamps" | "transcriptDiarization" | "speakerIdentification" | "configPath" | "promptOverride" | "lengthInstruction" | "languageInstruction" | "maxOutputTokensArg" | "summaryCacheBypass">;
|
|
98
107
|
model: Pick<AssetSummaryContext, "fixedModelSpec" | "isFallbackModel" | "isImplicitAutoSelection" | "allowAutoCliFallback" | "desiredOutputTokens" | "envForAuto" | "configForModelSelection" | "cliAvailability" | "requestedModel" | "requestedModelInput" | "requestedModelLabel" | "wantsFreeNamedModel" | "isNamedModelSelection" | "summaryEngine" | "getLiteLlmCatalog" | "llmCalls">;
|
|
99
108
|
output: Pick<AssetSummaryContext, "json" | "metricsEnabled" | "metricsDetailed" | "shouldComputeReport" | "runStartedAtMs" | "verbose" | "verboseColor" | "streamingEnabled" | "plain">;
|
|
100
109
|
hooks: Pick<AssetSummaryContext, "writeViaFooter" | "clearProgressForStdout" | "restoreProgressAfterStdout" | "buildReport" | "estimateCostUsd">;
|
|
@@ -14,9 +14,9 @@ export declare function buildUrlJsonInput(options: {
|
|
|
14
14
|
markdown: "auto" | "llm" | "off" | "readability";
|
|
15
15
|
timestamps: boolean;
|
|
16
16
|
length: {
|
|
17
|
-
maxCharacters?: undefined;
|
|
18
17
|
kind: "preset";
|
|
19
18
|
preset: "long" | "medium" | "short" | "xl" | "xxl";
|
|
19
|
+
maxCharacters?: undefined;
|
|
20
20
|
} | {
|
|
21
21
|
preset?: undefined;
|
|
22
22
|
kind: "chars";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
export type SpinnerColor = "cyan" | "magenta" | "yellow" | "green" | "gray" | "blue";
|
|
2
2
|
export declare function startSpinner({ text, enabled, stream, color, }: {
|
|
3
3
|
text: string;
|
|
4
4
|
enabled: boolean;
|
|
5
5
|
stream: NodeJS.WritableStream;
|
|
6
|
-
color?:
|
|
6
|
+
color?: SpinnerColor;
|
|
7
7
|
}): {
|
|
8
8
|
stop: () => void;
|
|
9
9
|
clear: () => void;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const FALLBACK_VERSION = "0.17.
|
|
1
|
+
export declare const FALLBACK_VERSION = "0.17.2";
|
|
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/chrome-extension.md
CHANGED
|
@@ -13,7 +13,7 @@ Goal: Chrome **Side Panel** (“real sidebar”) summarizes **what you see** on
|
|
|
13
13
|
Quickstart:
|
|
14
14
|
|
|
15
15
|
- Build/load extension: `apps/chrome-extension/README.md`
|
|
16
|
-
- Chrome Browser mode works immediately without a daemon for page summaries and fetchable
|
|
16
|
+
- Chrome Browser mode works immediately without a daemon for page summaries, fetchable video slides, and fetchable YouTube/direct/embedded media transcription.
|
|
17
17
|
- Optional: install summarize for daemon-backed media support:
|
|
18
18
|
- `npm i -g @steipete/summarize`
|
|
19
19
|
- `brew install summarize` (macOS, Linux)
|
|
@@ -27,7 +27,7 @@ Quickstart:
|
|
|
27
27
|
Firefox notes:
|
|
28
28
|
|
|
29
29
|
- Sidebar UX differs from Chrome’s side panel (persistent sidebar instead of slide-in panel).
|
|
30
|
-
- Firefox
|
|
30
|
+
- Firefox loading is smoke-tested with Mozilla `web-ext`; Playwright page-level Firefox tests remain diagnostic-only. See `apps/chrome-extension/tests/README-firefox.md`.
|
|
31
31
|
- Compatibility details: `apps/chrome-extension/docs/firefox.md`.
|
|
32
32
|
|
|
33
33
|
Dev (repo checkout):
|
|
@@ -59,6 +59,10 @@ Dev (repo checkout):
|
|
|
59
59
|
- “Need extension-side traces”:
|
|
60
60
|
- Options → Logs → `extension.log` (panel/background events).
|
|
61
61
|
- Enable “Extended logging” in Advanced settings for full pipeline traces.
|
|
62
|
+
- Captionless YouTube transcription is slow on first use:
|
|
63
|
+
- Chrome downloads and caches the multilingual Whisper Tiny model on demand.
|
|
64
|
+
- WebGPU is preferred; a slower WASM/CPU path is used when WebGPU is unavailable.
|
|
65
|
+
- Offline model bundling and subscription/download workflows are not currently provided.
|
|
62
66
|
- “Stream ended unexpectedly” / empty chat response:
|
|
63
67
|
- The daemon likely stopped mid-stream. Restart it, then click “Try again”.
|
|
64
68
|
- `summarize daemon restart`
|
|
@@ -81,7 +85,7 @@ Dev (repo checkout):
|
|
|
81
85
|
- **Extension (MV3, WXT)**
|
|
82
86
|
- Side Panel UI: length + typography controls (font family + size), auto/manual toggle.
|
|
83
87
|
- Background service worker: tab + navigation tracking, content extraction, starts summarize runs.
|
|
84
|
-
- Chrome offscreen page: runs
|
|
88
|
+
- Chrome offscreen page: runs MediaBunny with native WebCodecs for ranged video slides and chunked local media transcription, plus an idle-evictable Whisper runtime.
|
|
85
89
|
- Content script: extract readable article text from the **rendered DOM** via Readability; also detect SPA URL changes.
|
|
86
90
|
- Panel page streams SSE directly (MV3 service workers can be flaky for long-lived streams).
|
|
87
91
|
- **Daemon (local, autostart service)**
|
|
@@ -94,8 +98,9 @@ Dev (repo checkout):
|
|
|
94
98
|
1. User opens side panel (click extension icon).
|
|
95
99
|
2. Panel sends a “ready” message to the background (plus periodic “ping” heartbeats while open).
|
|
96
100
|
3. On nav/tab change (and auto enabled): background asks the content script to extract `{ url, title, text }` (best-effort).
|
|
97
|
-
4.
|
|
98
|
-
5.
|
|
101
|
+
4. In Chrome Browser mode, fetchable audio is decoded in bounded chunks through MediaBunny/WebCodecs and transcribed locally. YouTube prefers active-player/watch-page direct audio, then Android VR, buffered direct audio, and captured SABR.
|
|
102
|
+
5. In Daemon mode, background `POST`s payload to `/v1/summarize` with `Authorization: Bearer <token>`.
|
|
103
|
+
6. Panel opens `/v1/summarize/<id>/events` (SSE) and renders streamed Markdown.
|
|
99
104
|
|
|
100
105
|
## Auto Mode (URL + Page Text)
|
|
101
106
|
|
|
@@ -120,7 +125,7 @@ See `docs/media.md` for detection and transcript rules.
|
|
|
120
125
|
## Slides (Side Panel)
|
|
121
126
|
|
|
122
127
|
- The slides toggle lights up on media-friendly URLs (YouTube/watch|shorts, youtu.be, direct media) or when the page reports video/audio. Defaults to Video on those pages.
|
|
123
|
-
- Turning slides **on** refreshes the current summary and requests slide extraction. Chrome Browser mode uses
|
|
128
|
+
- Turning slides **on** refreshes the current summary and requests slide extraction. Chrome Browser mode uses MediaBunny with native WebCodecs and ranged reads for fetchable videos, then falls back to visible-tab capture. Daemon mode adds `yt-dlp`, native ffmpeg, and optional `tesseract` OCR.
|
|
124
129
|
- Active slide mode is slide-first:
|
|
125
130
|
- vertical image/text cards
|
|
126
131
|
- transcript-first text; OCR fallback
|
|
@@ -70,7 +70,7 @@ If `[input]` is omitted, summarize prints concise help and exits.
|
|
|
70
70
|
: Include timestamps in transcripts when available.
|
|
71
71
|
|
|
72
72
|
`--diarize [provider]`
|
|
73
|
-
:
|
|
73
|
+
: Add speaker labels to YouTube, local audio/video, or direct media URLs. Provider: `auto`, `elevenlabs`, or `openai`.
|
|
74
74
|
|
|
75
75
|
`--identify-speakers` / `--no-identify-speakers`
|
|
76
76
|
: Resolve generic diarization labels to names, or disable configured resolution for one run. Uses authoritative anchors and OpenAI GPT-5.5 context inference.
|
package/docs/install.md
CHANGED
|
@@ -88,7 +88,7 @@ export OPENAI_API_KEY=...
|
|
|
88
88
|
export FAL_KEY=...
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
If native `ffmpeg`/`ffprobe` are missing, summarize falls back to its bundled LGPL FFmpeg WebAssembly build. Native ffmpeg remains recommended for speed and broader codec/filter support. YouTube
|
|
91
|
+
If native `ffmpeg`/`ffprobe` are missing, summarize falls back to its bundled LGPL FFmpeg WebAssembly build. Native ffmpeg remains recommended for speed and broader codec/filter support. Automatic YouTube transcription can resolve Android VR direct audio without `yt-dlp`; explicit `--youtube yt-dlp`, diarization, and some slide/media flows still require it.
|
|
92
92
|
|
|
93
93
|
Set `SUMMARIZE_DISABLE_FFMPEG_WASM=1` to disable the bundled fallback.
|
|
94
94
|
|
package/docs/media.md
CHANGED
|
@@ -17,18 +17,20 @@ read_when:
|
|
|
17
17
|
|
|
18
18
|
1. Embedded captions (VTT/JSON) when available.
|
|
19
19
|
2. yt-dlp download + transcription (Groq first; then ONNX/local whisper.cpp; then AssemblyAI/Gemini/OpenAI/FAL fallback).
|
|
20
|
+
3. YouTube only: Android VR direct audio + the same transcription chain when yt-dlp is missing or fails.
|
|
20
21
|
|
|
21
22
|
## CLI behavior
|
|
22
23
|
|
|
23
24
|
- `--video-mode transcript` prefers transcript-first media handling even when a page has text.
|
|
24
25
|
- Direct media URLs (mp4/webm/m4a/etc) skip HTML and transcribe.
|
|
25
26
|
- Local audio/video files are routed through the same transcript-first pipeline.
|
|
26
|
-
-
|
|
27
|
+
- `--diarize [auto|elevenlabs|openai]` adds speaker labels to local files and direct media URLs; `--identify-speakers`, anchors, profiles, and remembered mappings use the same naming pass as YouTube. Local files do not require `yt-dlp`.
|
|
28
|
+
- YouTube still uses the YouTube transcript pipeline (captions → yt-dlp → Android VR direct audio fallback).
|
|
27
29
|
- X/Twitter status URLs with detected video auto-switch to transcript-first (yt-dlp), even in auto mode.
|
|
28
30
|
- X broadcasts (`/i/broadcasts/...`) are treated as media-only and go transcript-first by default.
|
|
29
31
|
- Local media files are capped at 2 GB. Remote podcast/media transcription downloads are capped at 512 MB by default and fail closed with `Remote media too large` even when the server omits or under-reports `Content-Length`; other remote media URLs are best-effort via yt-dlp.
|
|
30
32
|
- Operators who accept the disk/DoS tradeoff for larger remote podcast/media files can opt in with `SUMMARIZE_REMOTE_MEDIA_MAX_BYTES=<positive integer byte limit>`. The override must be a finite positive integer byte count; fractional, sub-byte, or otherwise invalid values are ignored and the default 512 MB cap remains in effect.
|
|
31
|
-
- Remote transcription providers: `ASSEMBLYAI_API_KEY`, `GEMINI_API_KEY` / `GOOGLE_GENERATIVE_AI_API_KEY` / `GOOGLE_API_KEY`, `OPENAI_API_KEY`, `FAL_KEY` (plus `GROQ_API_KEY` before local/remote fallback).
|
|
33
|
+
- Remote transcription providers: `ASSEMBLYAI_API_KEY`, `GEMINI_API_KEY` / `GOOGLE_GENERATIVE_AI_API_KEY` / `GOOGLE_API_KEY`, `OPENAI_API_KEY`, `FAL_KEY` (plus `GROQ_API_KEY` before local/remote fallback). Diarization uses `ELEVENLABS_API_KEY` or `OPENAI_API_KEY`.
|
|
32
34
|
- Gemini uses the Files API automatically for larger uploads.
|
|
33
35
|
|
|
34
36
|
## Shared helpers
|
|
@@ -42,6 +44,8 @@ read_when:
|
|
|
42
44
|
- When media is detected on a page, the Summarize button gains a dropdown caret (Page/Video or Page/Audio).
|
|
43
45
|
- Selecting Video/Audio forces URL mode + transcript-first extraction for that run only.
|
|
44
46
|
- Selection is not stored.
|
|
47
|
+
- Chrome Browser mode transcribes fetchable direct and embedded media in bounded MediaBunny/WebCodecs chunks with browser-cached multilingual Whisper Tiny. YouTube prefers active-player/watch-page direct audio, then Android VR, buffered direct audio, and captured SABR.
|
|
48
|
+
- Browser slide extraction uses ranged MediaBunny URL reads instead of buffering the complete video. The Whisper runtime is disposed after an idle period while the downloaded model remains in browser cache.
|
|
45
49
|
|
|
46
50
|
## Known limits
|
|
47
51
|
|
|
@@ -16,7 +16,9 @@ Goal: keep provider entrypoints thin; keep provider policy explicit.
|
|
|
16
16
|
- `packages/core/src/content/transcript/providers/youtube.ts`
|
|
17
17
|
YouTube orchestration only.
|
|
18
18
|
Web captions first.
|
|
19
|
-
`yt-dlp
|
|
19
|
+
`yt-dlp`, Android VR direct media, then Apify fallback.
|
|
20
|
+
- `packages/core/src/content/transcript/providers/youtube/native-media.ts`
|
|
21
|
+
Android VR direct-audio resolution + shared media transcription only.
|
|
20
22
|
- `packages/core/src/content/transcript/providers/podcast.ts`
|
|
21
23
|
Podcast orchestration only.
|
|
22
24
|
Feed/Spotify/Apple/enclosure/`yt-dlp` chain.
|
package/docs/youtube.md
CHANGED
|
@@ -57,7 +57,7 @@ summarize "https://www.youtube.com/watch?v=..." --extract --diarize openai --tim
|
|
|
57
57
|
- `auto`: ElevenLabs Scribe v2 first, then OpenAI `gpt-4o-transcribe-diarize`.
|
|
58
58
|
- `elevenlabs`: requires `ELEVENLABS_API_KEY`.
|
|
59
59
|
- `openai`: requires `OPENAI_API_KEY`.
|
|
60
|
-
-
|
|
60
|
+
- YouTube diarization requires `yt-dlp`; OpenAI uses `ffmpeg` to compress uploads above its size limit when available. Local media diarization does not require `yt-dlp`.
|
|
61
61
|
|
|
62
62
|
## Speaker identification
|
|
63
63
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steipete/summarize",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"description": "Link → clean text → summary.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"summarize": "./dist/cli.js",
|
|
@@ -39,15 +39,12 @@
|
|
|
39
39
|
"json5": "^2.2.3",
|
|
40
40
|
"markdansi": "^0.3.1",
|
|
41
41
|
"mime": "^4.1.0",
|
|
42
|
-
"ora": "^9.4.0",
|
|
43
42
|
"osc-progress": "^0.3.0",
|
|
44
43
|
"tokentally": "^0.1.1",
|
|
45
|
-
"tslog": "^4.10.2",
|
|
46
44
|
"undici": "8.4.1",
|
|
47
|
-
"@steipete/summarize-core": "0.17.
|
|
45
|
+
"@steipete/summarize-core": "0.17.2"
|
|
48
46
|
},
|
|
49
47
|
"devDependencies": {
|
|
50
|
-
"@fal-ai/client": "^1.10.1",
|
|
51
48
|
"@types/node": "^24.13.1",
|
|
52
49
|
"@types/sanitize-html": "^2.16.1",
|
|
53
50
|
"@typescript/native-preview": "7.0.0-dev.20260609.1",
|