@steipete/summarize 0.21.14 → 0.21.15
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 +15 -0
- package/dist/esm/cache-database.js +32 -0
- package/dist/esm/cache-database.js.map +1 -0
- package/dist/esm/cache-keys.js +33 -0
- package/dist/esm/cache-keys.js.map +1 -1
- package/dist/esm/cache-store.js +194 -0
- package/dist/esm/cache-store.js.map +1 -0
- package/dist/esm/cache.js +33 -295
- package/dist/esm/cache.js.map +1 -1
- package/dist/esm/cli-args.js +13 -0
- package/dist/esm/cli-args.js.map +1 -0
- package/dist/esm/cli-main.js +2 -2
- package/dist/esm/cli-main.js.map +1 -1
- package/dist/esm/costs.js +4 -14
- package/dist/esm/costs.js.map +1 -1
- package/dist/esm/daemon/agent-model.js +1 -1
- package/dist/esm/daemon/agent-model.js.map +1 -1
- package/dist/esm/daemon/cli.js +6 -18
- package/dist/esm/daemon/cli.js.map +1 -1
- package/dist/esm/daemon/server.js +1 -1
- package/dist/esm/daemon/server.js.map +1 -1
- package/dist/esm/engine/web-summary.js +0 -1
- package/dist/esm/engine/web-summary.js.map +1 -1
- package/dist/esm/llm/generate-text.js +0 -1
- package/dist/esm/llm/generate-text.js.map +1 -1
- package/dist/esm/model-auto.js +1 -1
- package/dist/esm/model-auto.js.map +1 -1
- package/dist/esm/refresh-free/presentation.js +2 -16
- package/dist/esm/refresh-free/presentation.js.map +1 -1
- package/dist/esm/run/bird.js +1 -12
- package/dist/esm/run/bird.js.map +1 -1
- package/dist/esm/run/cli-preflight.js +5 -16
- package/dist/esm/run/cli-preflight.js.map +1 -1
- package/dist/esm/run/cli-summarize-command.js +1 -1
- package/dist/esm/run/cli-summarize-command.js.map +1 -1
- package/dist/esm/run/flows/asset/summary-attempts.js +0 -1
- package/dist/esm/run/flows/asset/summary-attempts.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/slides-output-render.js +1 -1
- package/dist/esm/run/flows/url/slides-output-render.js.map +1 -1
- package/dist/esm/run/flows/url/slides-output-stream.js +3 -14
- package/dist/esm/run/flows/url/slides-output-stream.js.map +1 -1
- package/dist/esm/run/flows/url/slides-output.js +0 -1
- package/dist/esm/run/flows/url/slides-output.js.map +1 -1
- package/dist/esm/run/flows/url/summary-finish.js.map +1 -1
- package/dist/esm/run/flows/url/summary-json.js +26 -0
- package/dist/esm/run/flows/url/summary-json.js.map +1 -1
- package/dist/esm/run/flows/url/summary.js +2 -29
- package/dist/esm/run/flows/url/summary.js.map +1 -1
- package/dist/esm/run/format.js +1 -11
- package/dist/esm/run/format.js.map +1 -1
- package/dist/esm/run/markdown-streamer.js +15 -0
- package/dist/esm/run/markdown-streamer.js.map +1 -0
- package/dist/esm/run/run-settings.js +1 -1
- package/dist/esm/run/run-settings.js.map +1 -1
- package/dist/esm/run/runner.js +1 -2
- package/dist/esm/run/runner.js.map +1 -1
- package/dist/esm/run/stream-output.js +5 -20
- package/dist/esm/run/stream-output.js.map +1 -1
- package/dist/esm/run/summary-stream.js +3 -14
- package/dist/esm/run/summary-stream.js.map +1 -1
- package/dist/esm/run/terminal.js +10 -16
- package/dist/esm/run/terminal.js.map +1 -1
- package/dist/esm/run/transcriber-cli.js +3 -14
- package/dist/esm/run/transcriber-cli.js.map +1 -1
- package/dist/esm/shared/numbers.js +12 -0
- package/dist/esm/shared/numbers.js.map +1 -0
- package/dist/esm/slides/extract.js +12 -127
- package/dist/esm/slides/extract.js.map +1 -1
- package/dist/esm/slides/frame-extraction.js +2 -1
- package/dist/esm/slides/frame-extraction.js.map +1 -1
- package/dist/esm/slides/runtime.js +82 -0
- package/dist/esm/slides/runtime.js.map +1 -0
- package/dist/esm/slides/scene-calibration.js +111 -0
- package/dist/esm/slides/scene-calibration.js.map +1 -0
- package/dist/esm/slides/scene-detection.js +1 -111
- package/dist/esm/slides/scene-detection.js.map +1 -1
- package/dist/esm/slides/store.js +33 -0
- package/dist/esm/slides/store.js.map +1 -1
- package/dist/esm/tty/progress/transcript-state.js +0 -13
- package/dist/esm/tty/progress/transcript-state.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/cache-database.d.ts +12 -0
- package/dist/types/cache-keys.d.ts +28 -0
- package/dist/types/cache-store.d.ts +16 -0
- package/dist/types/cache.d.ts +4 -45
- package/dist/types/cli-args.d.ts +1 -0
- package/dist/types/run/flows/url/slides-output-render.d.ts +1 -4
- package/dist/types/run/flows/url/summary-json.d.ts +19 -0
- package/dist/types/run/format.d.ts +1 -1
- package/dist/types/run/markdown-streamer.d.ts +6 -0
- package/dist/types/run/terminal.d.ts +2 -2
- package/dist/types/shared/numbers.d.ts +1 -0
- package/dist/types/slides/runtime.d.ts +22 -0
- package/dist/types/slides/scene-calibration.d.ts +12 -0
- package/dist/types/slides/scene-detection.d.ts +0 -11
- package/dist/types/slides/store.d.ts +2 -0
- package/dist/types/version.d.ts +1 -1
- package/docs/README.md +1 -1
- package/docs/agent.md +4 -2
- package/docs/cache.md +3 -1
- package/docs/commands/refresh-free.md +2 -0
- package/docs/commands/slides.md +23 -10
- package/docs/engine.md +2 -0
- package/docs/nvidia-onnx-transcription.md +2 -0
- package/docs/slides-rendering-flow.md +2 -0
- package/package.json +4 -4
package/docs/README.md
CHANGED
package/docs/agent.md
CHANGED
|
@@ -57,7 +57,7 @@ Service installation keeps launchd, systemd, and Scheduled Task policy in separa
|
|
|
57
57
|
|
|
58
58
|
Defined in `apps/chrome-extension/wxt.config.ts`:
|
|
59
59
|
|
|
60
|
-
- `userScripts` – optional; requested via Options for `browserjs()`
|
|
60
|
+
- `userScripts` – optional; requested via Options for `browserjs()` page-context script execution.
|
|
61
61
|
- `debugger` – required only in `build:automation` for **native input** and the **debugger** tool.
|
|
62
62
|
|
|
63
63
|
Neither permission is needed for summarization. The standard Chrome build omits `debugger` because
|
|
@@ -66,6 +66,8 @@ and it hides debugger-backed tools. The separate automation build declares it as
|
|
|
66
66
|
|
|
67
67
|
#### Chrome: enable User Scripts (if needed)
|
|
68
68
|
|
|
69
|
+
Immediate `browserjs()` execution requires [Chrome 135+](https://developer.chrome.com/docs/extensions/reference/api/userScripts#method-execute). The extension installation minimum remains Chrome 120+.
|
|
70
|
+
|
|
69
71
|
1. `chrome://extensions`
|
|
70
72
|
2. Open extension details
|
|
71
73
|
3. Enable **Allow User Scripts**
|
|
@@ -206,7 +208,7 @@ REPL environment:
|
|
|
206
208
|
|
|
207
209
|
- Runs in a **sandboxed iframe** (no DOM access to the panel).
|
|
208
210
|
- `browserjs(fn, ...args)` runs the function **in the page context**.
|
|
209
|
-
- Uses `chrome.userScripts.execute`
|
|
211
|
+
- Uses `chrome.userScripts.execute` (Chrome 135+) for page-context execution.
|
|
210
212
|
- `navigate({ url })` available inside the REPL (always use for navigation).
|
|
211
213
|
- `sleep(ms)` helper.
|
|
212
214
|
- Console output is captured and returned; return values are appended as `=> value`.
|
package/docs/cache.md
CHANGED
|
@@ -10,6 +10,8 @@ read_when:
|
|
|
10
10
|
|
|
11
11
|
Lightweight, CLI-only SQLite cache. Single DB file.
|
|
12
12
|
|
|
13
|
+
`src/cache.ts` exposes cache configuration, keys, and maintenance operations. `cache-store.ts` owns SQLite rows, eviction, slide-file cleanup, and the transcript adapter; `cache-database.ts` isolates the Node/Bun database binding. Versioned key construction lives in `cache-keys.ts`.
|
|
14
|
+
|
|
13
15
|
## Goals
|
|
14
16
|
|
|
15
17
|
- Avoid repeated transcripts/extractions/summaries.
|
|
@@ -97,6 +99,6 @@ Media cache eviction:
|
|
|
97
99
|
## Notes
|
|
98
100
|
|
|
99
101
|
- Core owns the transcript-source inventory used by both extraction and SQLite reads, including embedded captions and native YouTube media. Cache hits retain their original source diagnostics.
|
|
100
|
-
-
|
|
102
|
+
- The extension has a separate browser panel cache in `chrome.storage.local`: URL-keyed entries use a 30-day TTL and an 8 MB size limit. It shares portable row formatting with core; daemon extraction and summary caches still use SQLite.
|
|
101
103
|
- No third-party SQLite deps.
|
|
102
104
|
- Transcript namespace currently includes the YouTube mode (e.g. `yt:auto`, `yt:web`).
|
|
@@ -76,6 +76,8 @@ summarize refresh-free --runs 3 --smart 5 --verbose
|
|
|
76
76
|
|
|
77
77
|
A short summary of survivors and rejected candidates is printed on stdout.
|
|
78
78
|
|
|
79
|
+
Color follows the rest of the CLI: `FORCE_COLOR=0` disables it, while a nonzero `FORCE_COLOR` takes precedence over `NO_COLOR`. Without an override, color requires a capable terminal.
|
|
80
|
+
|
|
79
81
|
## See also
|
|
80
82
|
|
|
81
83
|
- [LLM overview](../llm.md) — `--model` syntax, including `free`.
|
package/docs/commands/slides.md
CHANGED
|
@@ -34,7 +34,7 @@ If a required tool is missing, summarize prints a clear warning and exits non-ze
|
|
|
34
34
|
## Flags
|
|
35
35
|
|
|
36
36
|
`--slides-ocr`
|
|
37
|
-
: Run OCR on every extracted slide.
|
|
37
|
+
: Run OCR on every extracted slide. Stores `ocrText` and `ocrConfidence` in `slides.json` and the JSON response.
|
|
38
38
|
|
|
39
39
|
`--slides-dir <dir>`
|
|
40
40
|
: Output base directory. Default: `./slides`. A per-video subfolder is created inside.
|
|
@@ -77,20 +77,33 @@ If a required tool is missing, summarize prints a clear warning and exits non-ze
|
|
|
77
77
|
Each run writes a directory like:
|
|
78
78
|
|
|
79
79
|
```text
|
|
80
|
-
slides/<
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
slides/<source-id>/
|
|
81
|
+
slide_0001_18.60s.png
|
|
82
|
+
slide_0002_42.20s.png
|
|
83
83
|
...
|
|
84
|
-
|
|
84
|
+
slides.json
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
The filenames include the slide index and timestamp. `slides.json` records the manifest, including OCR results when requested; OCR does not create separate text files. `ocrConfidence` uses a 0–1 scale.
|
|
88
|
+
|
|
89
|
+
In `--json` mode, stdout contains an envelope like this (additional extraction metadata omitted):
|
|
88
90
|
|
|
89
91
|
```json
|
|
90
92
|
{
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
|
|
93
|
+
"ok": true,
|
|
94
|
+
"slides": {
|
|
95
|
+
"sourceUrl": "https://example.com/lecture.mp4",
|
|
96
|
+
"slidesDir": "/absolute/path/slides/<id>",
|
|
97
|
+
"slides": [
|
|
98
|
+
{
|
|
99
|
+
"index": 1,
|
|
100
|
+
"timestamp": 18.6,
|
|
101
|
+
"imagePath": "/absolute/path/slides/<id>/slide_0001_18.60s.png",
|
|
102
|
+
"ocrText": "Recognized slide text",
|
|
103
|
+
"ocrConfidence": 0.92
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
94
107
|
}
|
|
95
108
|
```
|
|
96
109
|
|
|
@@ -109,7 +122,7 @@ summarize slides "https://youtu.be/..." \
|
|
|
109
122
|
--slides-max 24 --slides-scene-threshold 0.2
|
|
110
123
|
|
|
111
124
|
# Pipe-friendly JSON for an automation.
|
|
112
|
-
summarize slides "https://youtu.be/..." --json | jq '.slides[].
|
|
125
|
+
summarize slides "https://youtu.be/..." --json | jq '.slides.slides[].imagePath'
|
|
113
126
|
|
|
114
127
|
# Force re-extraction after editing the source video.
|
|
115
128
|
summarize slides "./talk.mp4" --no-cache -o ./out
|
package/docs/engine.md
CHANGED
|
@@ -46,6 +46,8 @@ Core owns file-summary instruction construction and timed-transcript parsing/for
|
|
|
46
46
|
|
|
47
47
|
The engine never writes summary text to stdout.
|
|
48
48
|
|
|
49
|
+
CLI summary and slide adapters share the terminal Markdown streamer factory in `src/run/markdown-streamer.ts`; each adapter retains its own progress and stream lifecycle. Standalone command preflight uses `src/cli-args.ts` for the same equals-form and separate-value option semantics.
|
|
50
|
+
|
|
49
51
|
Each provider attempt resolves one request shared by streaming, direct completion, and fallback completion. Stream consumption owns output-handler lifecycle and marks visible or handler failures as interrupted; only an uncommitted provider failure can fall back to completion. Usage collection happens after successful stream consumption and does not trigger another model call.
|
|
50
52
|
|
|
51
53
|
`SummaryStreamHandler` receives normalized chunks:
|
|
@@ -44,12 +44,14 @@ For the Chrome extension, you can pick a permanent default under **Settings →
|
|
|
44
44
|
- Artifacts are stored under `${SUMMARIZE_ONNX_CACHE_DIR || $XDG_CACHE_HOME || ~/.cache}/summarize/onnx/<model>/`.
|
|
45
45
|
- Set `SUMMARIZE_ONNX_MODEL_BASE_URL` to point at a mirror (defaults to the Hugging Face repo for the chosen model).
|
|
46
46
|
- The first run downloads `model.onnx` and `vocab.txt`; subsequent runs reuse cached files.
|
|
47
|
+
- Downloads are committed to the cache only after the full response is written. Failed downloads remove their temporary files, so the next run retries instead of using a partial model. If an older version left a corrupt cached artifact, remove that artifact once to download it again.
|
|
47
48
|
|
|
48
49
|
## Behavior
|
|
49
50
|
|
|
50
51
|
- Input audio is transcoded to 16kHz mono WAV via `ffmpeg` when available; otherwise the original file is passed to the CLI.
|
|
51
52
|
- Onnx errors (missing command, non-zero exit, empty output) fall back to the existing Whisper flow with a note recorded in the transcript metadata.
|
|
52
53
|
- Progress UI shows "ONNX (Parakeet/Canary)" while the external transcriber runs.
|
|
54
|
+
- In-memory audio is staged until the external transcriber exits, then removed on success or failure.
|
|
53
55
|
|
|
54
56
|
## Notes
|
|
55
57
|
|
|
@@ -30,6 +30,8 @@ Rule: keep terminal I/O in render helpers; keep state mutations in the state sto
|
|
|
30
30
|
|
|
31
31
|
`src/slides/process.ts` owns media-tool spawning, deadlines, exit errors, and output collection. Line callbacks, text capture, and binary capture share that lifecycle; OCR uses binary capture to avoid logging recognized text. Ignored stdout is drained so child processes cannot block on a full pipe.
|
|
32
32
|
|
|
33
|
+
`src/slides/runtime.ts` owns tool resolution, worker/sample settings, and progress/log adapters. `scene-calibration.ts` owns optional frame sampling and hash-based threshold calibration; `scene-detection.ts` owns scene timestamps and selection. Output-directory preparation and per-directory serialization live with cache paths in `store.ts`, keeping extraction orchestration focused on the pipeline.
|
|
34
|
+
|
|
33
35
|
Frame extraction trims decoded input before collecting `showinfo` and signal statistics. Timestamp conversion uses the explicit input-seek origin, including zero, so pre-seek frames cannot move a later slide backward or cause final duration filtering to discard it.
|
|
34
36
|
|
|
35
37
|
Completed slide results carry an extractor version in memory and `slides.json`. Cache validation rejects older/unversioned extraction results, including SQLite copies, so corrected timing regenerates stale frames without invalidating unrelated transcript or summary caches.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steipete/summarize",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.15",
|
|
4
4
|
"description": "Link → clean text → summary.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"summarize": "./dist/cli.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@earendil-works/pi-ai": "^0.85.
|
|
37
|
-
"@steipete/summarize-core": "0.21.
|
|
36
|
+
"@earendil-works/pi-ai": "^0.85.1",
|
|
37
|
+
"@steipete/summarize-core": "0.21.15",
|
|
38
38
|
"bpe-lite": "^0.5.2",
|
|
39
39
|
"commander": "^15.0.0",
|
|
40
40
|
"file-type": "^22.0.2",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"markdansi": "^0.3.3",
|
|
43
43
|
"mime": "^4.1.0",
|
|
44
44
|
"osc-progress": "^0.3.3",
|
|
45
|
-
"tokentally": "^0.1.
|
|
45
|
+
"tokentally": "^0.1.5",
|
|
46
46
|
"undici": "8.10.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|