@steipete/summarize 0.21.14 → 0.22.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.
Files changed (155) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +12 -0
  3. package/completions/summarize.fish +2 -1
  4. package/dist/esm/cache-database.js +32 -0
  5. package/dist/esm/cache-database.js.map +1 -0
  6. package/dist/esm/cache-keys.js +33 -0
  7. package/dist/esm/cache-keys.js.map +1 -1
  8. package/dist/esm/cache-store.js +194 -0
  9. package/dist/esm/cache-store.js.map +1 -0
  10. package/dist/esm/cache.js +33 -295
  11. package/dist/esm/cache.js.map +1 -1
  12. package/dist/esm/cli-args.js +13 -0
  13. package/dist/esm/cli-args.js.map +1 -0
  14. package/dist/esm/cli-main.js +3 -2
  15. package/dist/esm/cli-main.js.map +1 -1
  16. package/dist/esm/costs.js +4 -14
  17. package/dist/esm/costs.js.map +1 -1
  18. package/dist/esm/daemon/agent-model.js +1 -1
  19. package/dist/esm/daemon/agent-model.js.map +1 -1
  20. package/dist/esm/daemon/cli.js +27 -31
  21. package/dist/esm/daemon/cli.js.map +1 -1
  22. package/dist/esm/daemon/server.js +1 -1
  23. package/dist/esm/daemon/server.js.map +1 -1
  24. package/dist/esm/daemon/summarize-progress.js +4 -0
  25. package/dist/esm/daemon/summarize-progress.js.map +1 -1
  26. package/dist/esm/engine/web-summary.js +0 -1
  27. package/dist/esm/engine/web-summary.js.map +1 -1
  28. package/dist/esm/llm/cli-runners/plain.js +44 -16
  29. package/dist/esm/llm/cli-runners/plain.js.map +1 -1
  30. package/dist/esm/llm/generate-text.js +0 -1
  31. package/dist/esm/llm/generate-text.js.map +1 -1
  32. package/dist/esm/locale.js +742 -0
  33. package/dist/esm/locale.js.map +1 -0
  34. package/dist/esm/model-auto.js +1 -1
  35. package/dist/esm/model-auto.js.map +1 -1
  36. package/dist/esm/refresh-free/presentation.js +15 -26
  37. package/dist/esm/refresh-free/presentation.js.map +1 -1
  38. package/dist/esm/refresh-free.js +2 -1
  39. package/dist/esm/refresh-free.js.map +1 -1
  40. package/dist/esm/run/bird.js +1 -12
  41. package/dist/esm/run/bird.js.map +1 -1
  42. package/dist/esm/run/cli-input-progress.js +11 -8
  43. package/dist/esm/run/cli-input-progress.js.map +1 -1
  44. package/dist/esm/run/cli-preflight.js +15 -23
  45. package/dist/esm/run/cli-preflight.js.map +1 -1
  46. package/dist/esm/run/cli-summarize-command.js +5 -3
  47. package/dist/esm/run/cli-summarize-command.js.map +1 -1
  48. package/dist/esm/run/finish-line-labels.js +4 -0
  49. package/dist/esm/run/finish-line-labels.js.map +1 -1
  50. package/dist/esm/run/finish-line.js +8 -3
  51. package/dist/esm/run/finish-line.js.map +1 -1
  52. package/dist/esm/run/flows/asset/media.js +3 -1
  53. package/dist/esm/run/flows/asset/media.js.map +1 -1
  54. package/dist/esm/run/flows/asset/summary-attempts.js +0 -1
  55. package/dist/esm/run/flows/asset/summary-attempts.js.map +1 -1
  56. package/dist/esm/run/flows/url/extract.js +5 -0
  57. package/dist/esm/run/flows/url/extract.js.map +1 -1
  58. package/dist/esm/run/flows/url/extraction-session.js +3 -1
  59. package/dist/esm/run/flows/url/extraction-session.js.map +1 -1
  60. package/dist/esm/run/flows/url/flow-progress.js +16 -9
  61. package/dist/esm/run/flows/url/flow-progress.js.map +1 -1
  62. package/dist/esm/run/flows/url/flow.js +1 -1
  63. package/dist/esm/run/flows/url/flow.js.map +1 -1
  64. package/dist/esm/run/flows/url/slides-output-render.js +1 -1
  65. package/dist/esm/run/flows/url/slides-output-render.js.map +1 -1
  66. package/dist/esm/run/flows/url/slides-output-stream.js +3 -14
  67. package/dist/esm/run/flows/url/slides-output-stream.js.map +1 -1
  68. package/dist/esm/run/flows/url/slides-output.js +0 -1
  69. package/dist/esm/run/flows/url/slides-output.js.map +1 -1
  70. package/dist/esm/run/flows/url/summary-finish.js.map +1 -1
  71. package/dist/esm/run/flows/url/summary-json.js +26 -0
  72. package/dist/esm/run/flows/url/summary-json.js.map +1 -1
  73. package/dist/esm/run/flows/url/summary.js +2 -29
  74. package/dist/esm/run/flows/url/summary.js.map +1 -1
  75. package/dist/esm/run/format.js +1 -11
  76. package/dist/esm/run/format.js.map +1 -1
  77. package/dist/esm/run/help.js +1 -0
  78. package/dist/esm/run/help.js.map +1 -1
  79. package/dist/esm/run/markdown-streamer.js +15 -0
  80. package/dist/esm/run/markdown-streamer.js.map +1 -0
  81. package/dist/esm/run/run-input.js +3 -2
  82. package/dist/esm/run/run-input.js.map +1 -1
  83. package/dist/esm/run/run-settings.js +1 -1
  84. package/dist/esm/run/run-settings.js.map +1 -1
  85. package/dist/esm/run/runner-setup.js +32 -5
  86. package/dist/esm/run/runner-setup.js.map +1 -1
  87. package/dist/esm/run/runner.js +17 -8
  88. package/dist/esm/run/runner.js.map +1 -1
  89. package/dist/esm/run/slides-cli.js +12 -8
  90. package/dist/esm/run/slides-cli.js.map +1 -1
  91. package/dist/esm/run/status-cli.js +20 -2
  92. package/dist/esm/run/status-cli.js.map +1 -1
  93. package/dist/esm/run/stream-output.js +5 -20
  94. package/dist/esm/run/stream-output.js.map +1 -1
  95. package/dist/esm/run/summary-stream.js +3 -14
  96. package/dist/esm/run/summary-stream.js.map +1 -1
  97. package/dist/esm/run/terminal.js +10 -16
  98. package/dist/esm/run/terminal.js.map +1 -1
  99. package/dist/esm/run/transcriber-cli.js +16 -24
  100. package/dist/esm/run/transcriber-cli.js.map +1 -1
  101. package/dist/esm/shared/numbers.js +12 -0
  102. package/dist/esm/shared/numbers.js.map +1 -0
  103. package/dist/esm/slides/extract.js +12 -127
  104. package/dist/esm/slides/extract.js.map +1 -1
  105. package/dist/esm/slides/frame-extraction.js +2 -1
  106. package/dist/esm/slides/frame-extraction.js.map +1 -1
  107. package/dist/esm/slides/runtime.js +82 -0
  108. package/dist/esm/slides/runtime.js.map +1 -0
  109. package/dist/esm/slides/scene-calibration.js +111 -0
  110. package/dist/esm/slides/scene-calibration.js.map +1 -0
  111. package/dist/esm/slides/scene-detection.js +1 -111
  112. package/dist/esm/slides/scene-detection.js.map +1 -1
  113. package/dist/esm/slides/store.js +33 -0
  114. package/dist/esm/slides/store.js.map +1 -1
  115. package/dist/esm/tty/progress/transcript-state.js +0 -13
  116. package/dist/esm/tty/progress/transcript-state.js.map +1 -1
  117. package/dist/esm/tty/website-progress.js +27 -2
  118. package/dist/esm/tty/website-progress.js.map +1 -1
  119. package/dist/esm/version.js +1 -1
  120. package/dist/esm/version.js.map +1 -1
  121. package/dist/types/cache-database.d.ts +12 -0
  122. package/dist/types/cache-keys.d.ts +28 -0
  123. package/dist/types/cache-store.d.ts +16 -0
  124. package/dist/types/cache.d.ts +4 -45
  125. package/dist/types/cli-args.d.ts +1 -0
  126. package/dist/types/llm/cli-runners/plain.d.ts +1 -0
  127. package/dist/types/locale.d.ts +13 -0
  128. package/dist/types/run/finish-line-labels.d.ts +1 -1
  129. package/dist/types/run/flows/url/slides-output-render.d.ts +1 -4
  130. package/dist/types/run/flows/url/summary-json.d.ts +19 -0
  131. package/dist/types/run/format.d.ts +1 -1
  132. package/dist/types/run/markdown-streamer.d.ts +6 -0
  133. package/dist/types/run/run-input.d.ts +2 -1
  134. package/dist/types/run/runner-setup.d.ts +1 -0
  135. package/dist/types/run/terminal.d.ts +2 -2
  136. package/dist/types/shared/numbers.d.ts +1 -0
  137. package/dist/types/slides/runtime.d.ts +22 -0
  138. package/dist/types/slides/scene-calibration.d.ts +12 -0
  139. package/dist/types/slides/scene-detection.d.ts +0 -11
  140. package/dist/types/slides/store.d.ts +2 -0
  141. package/dist/types/tty/website-progress.d.ts +3 -1
  142. package/dist/types/version.d.ts +1 -1
  143. package/docs/README.md +1 -1
  144. package/docs/agent.md +4 -2
  145. package/docs/cache.md +3 -1
  146. package/docs/cli.md +1 -1
  147. package/docs/commands/refresh-free.md +2 -0
  148. package/docs/commands/slides.md +23 -10
  149. package/docs/engine.md +2 -0
  150. package/docs/install.md +4 -0
  151. package/docs/language.md +19 -0
  152. package/docs/nvidia-onnx-transcription.md +2 -0
  153. package/docs/slides-rendering-flow.md +2 -0
  154. package/docs/website.md +3 -1
  155. package/package.json +4 -4
@@ -1,3 +1,5 @@
1
+ import type { ExtractedLinkContent } from "../../../content/index.js";
2
+ import type { RunMetricsReport } from "../../../costs.js";
1
3
  import type { UrlFlowContext } from "./types.js";
2
4
  export declare function buildUrlJsonInput(options: {
3
5
  flags: UrlFlowContext["flags"];
@@ -34,3 +36,20 @@ export declare function buildUrlJsonInput(options: {
34
36
  label: string;
35
37
  };
36
38
  };
39
+ type SlidesResult = Awaited<ReturnType<typeof import("../../../slides/index.js").extractSlidesForSource>>;
40
+ export declare function writeUrlJsonOutput({ ctx, url, extracted, effectiveMarkdownMode, prompt, slides, summary, llm, }: {
41
+ ctx: UrlFlowContext;
42
+ url: string;
43
+ extracted: ExtractedLinkContent;
44
+ effectiveMarkdownMode: "off" | "auto" | "llm" | "readability";
45
+ prompt: string;
46
+ slides?: SlidesResult | null;
47
+ summary: string | null;
48
+ llm: {
49
+ provider: string;
50
+ model: string;
51
+ maxCompletionTokens: number | null;
52
+ strategy: "single";
53
+ } | null;
54
+ }): Promise<RunMetricsReport | null>;
55
+ export {};
@@ -1,7 +1,7 @@
1
+ export { sumNumbersOrNull } from "../shared/numbers.js";
1
2
  export { resolveTargetCharacters } from "../shared/summary-length.js";
2
3
  export declare function formatOptionalString(value: string | null | undefined): string;
3
4
  export declare function formatOptionalNumber(value: number | null | undefined): string;
4
- export declare function sumNumbersOrNull(values: Array<number | null>): number | null;
5
5
  export declare function formatUSD(value: number): string;
6
6
  export declare function estimateWhisperTranscriptionCostUsd({ transcriptionProvider, transcriptSource, mediaDurationSeconds, openaiWhisperUsdPerMinute, }: {
7
7
  transcriptionProvider: string | null;
@@ -0,0 +1,6 @@
1
+ import { createMarkdownStreamer } from "markdansi";
2
+ export declare function createTerminalMarkdownStreamer({ stdout, env, envForRun, }: {
3
+ stdout: NodeJS.WritableStream;
4
+ env: Record<string, string | undefined>;
5
+ envForRun: Record<string, string | undefined>;
6
+ }): ReturnType<typeof createMarkdownStreamer>;
@@ -5,9 +5,10 @@ export type InputResolution = {
5
5
  url: string | null;
6
6
  cliProviderArgRaw: string | null;
7
7
  };
8
- export declare function resolveRunInput({ program, cliFlagPresent, cliProviderArgRaw, stdout, }: {
8
+ export declare function resolveRunInput({ program, cliFlagPresent, cliProviderArgRaw, env, stdout, }: {
9
9
  program: Command;
10
10
  cliFlagPresent: boolean;
11
11
  cliProviderArgRaw: string | null;
12
+ env: Record<string, string | undefined>;
12
13
  stdout: NodeJS.WritableStream;
13
14
  }): InputResolution;
@@ -4,6 +4,7 @@ export declare function prepareRunEnvironment(argv: string[], inputEnv: Record<s
4
4
  envForRun: Record<string, string | undefined>;
5
5
  };
6
6
  export declare function argvBeforeSeparator(argv: readonly string[]): string[];
7
+ export declare function stripCliLocaleArgs(argv: readonly string[]): string[];
7
8
  export declare function normalizeDiarizeArgv(argv: string[]): string[];
8
9
  export declare function handleVersionFlag({ versionRequested, stdout, importMetaUrl, }: {
9
10
  versionRequested: boolean;
@@ -1,7 +1,7 @@
1
1
  export declare function isRichTty(stream: NodeJS.WritableStream): boolean;
2
2
  export declare function supportsColor(stream: NodeJS.WritableStream, env: Record<string, string | undefined>): boolean;
3
- export declare function terminalWidth(stream: NodeJS.WritableStream, env: Record<string, string | undefined>): number;
4
- export declare function terminalHeight(stream: NodeJS.WritableStream, env: Record<string, string | undefined>): number;
3
+ export declare function terminalWidth(stream: NodeJS.WritableStream, env?: Record<string, string | undefined>): number;
4
+ export declare function terminalHeight(stream: NodeJS.WritableStream, env?: Record<string, string | undefined>): number;
5
5
  /** Default max width for markdown rendering to keep text readable on wide terminals. */
6
6
  export declare const DEFAULT_MAX_RENDER_WIDTH = 120;
7
7
  export declare function markdownRenderWidth(stream: NodeJS.WritableStream, env: Record<string, string | undefined>): number;
@@ -0,0 +1 @@
1
+ export declare function sumNumbersOrNull(values: Array<number | null>): number | null;
@@ -0,0 +1,22 @@
1
+ import type { ProcessCommand } from "./process.js";
2
+ type SlidesLogger = ((message: string) => void) | null;
3
+ export declare function createSlidesLogger(logger: SlidesLogger): {
4
+ logSlides: (message: string) => void;
5
+ logSlidesTiming: (label: string, startedAt: number) => number;
6
+ };
7
+ export declare function resolveSlidesWorkers(env: Record<string, string | undefined>): number;
8
+ export declare function resolveSlidesSampleCount(env: Record<string, string | undefined>): number;
9
+ export declare function resolveSlidesYtDlpExtractFormat(env: Record<string, string | undefined>): string;
10
+ export declare function resolveSlidesStreamFallback(env: Record<string, string | undefined>): boolean;
11
+ type ResolveRunnableToolArgs = {
12
+ binary: string;
13
+ env: Record<string, string | undefined>;
14
+ explicitEnvKey?: string;
15
+ probeArgs: string[];
16
+ };
17
+ export declare function resolveRunnableTool(args: ResolveRunnableToolArgs & {
18
+ binary: "ffmpeg" | "ffprobe";
19
+ }): Promise<ProcessCommand | null>;
20
+ export declare function resolveRunnableTool(args: ResolveRunnableToolArgs): Promise<string | null>;
21
+ export declare function createSlidesProgress(onSlidesProgress: ((text: string) => void) | null | undefined): ((label: string, percent: number, detail?: string) => void) | null;
22
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type ProcessCommand } from "./process.js";
2
+ export declare function calibrateSceneThreshold({ ffmpegPath, inputPath, durationSeconds, sampleCount, timeoutMs, logSlides, }: {
3
+ ffmpegPath: ProcessCommand;
4
+ inputPath: string;
5
+ durationSeconds: number | null;
6
+ sampleCount: number;
7
+ timeoutMs: number;
8
+ logSlides?: ((message: string) => void) | null;
9
+ }): Promise<{
10
+ threshold: number;
11
+ confidence: number;
12
+ }>;
@@ -17,17 +17,6 @@ export declare function resolveExtractedTimestamp({ requested, actual, seekBase,
17
17
  seekBase?: number | null;
18
18
  }): number;
19
19
  export declare function roundThreshold(value: number): number;
20
- export declare function calibrateSceneThreshold({ ffmpegPath, inputPath, durationSeconds, sampleCount, timeoutMs, logSlides, }: {
21
- ffmpegPath: ProcessCommand;
22
- inputPath: string;
23
- durationSeconds: number | null;
24
- sampleCount: number;
25
- timeoutMs: number;
26
- logSlides?: ((message: string) => void) | null;
27
- }): Promise<{
28
- threshold: number;
29
- confidence: number;
30
- }>;
31
20
  export declare function buildSegments(durationSeconds: number | null, workers: number): Array<{
32
21
  start: number;
33
22
  duration: number;
@@ -14,3 +14,5 @@ export declare function readSlidesCacheIfValid({ source, settings, }: {
14
14
  source: SlideSource;
15
15
  settings: SlideSettings;
16
16
  }): Promise<SlideExtractionResult | null>;
17
+ export declare function prepareSlidesDir(slidesDir: string): Promise<void>;
18
+ export declare function withSlidesLock<T>(key: string, fn: () => Promise<T>, onWait?: (() => void) | null): Promise<T>;
@@ -1,7 +1,9 @@
1
1
  import type { LinkPreviewProgressEvent } from "@steipete/summarize-core/content";
2
+ import { type CliLocale } from "../locale.js";
2
3
  import type { OscProgressController } from "./osc-progress.js";
3
4
  import type { ThemeRenderer } from "./theme.js";
4
- export declare function createWebsiteProgress({ enabled, spinner, oscProgress, theme, }: {
5
+ export declare function createWebsiteProgress({ enabled, spinner, oscProgress, theme, locale, }: {
6
+ locale?: CliLocale;
5
7
  enabled: boolean;
6
8
  spinner: {
7
9
  setText: (text: string) => void;
@@ -1,4 +1,4 @@
1
- export declare const FALLBACK_VERSION = "0.21.14";
1
+ export declare const FALLBACK_VERSION = "0.22.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
@@ -24,4 +24,4 @@ summary: "Docs index for summarize behaviors and modes."
24
24
 
25
25
  ## Website
26
26
 
27
- - Jekyll site source: `docs/` (Markdown → HTML via GitHub Pages Actions)
27
+ - Site source: `docs/`, rendered by `scripts/build-docs-site.mjs` and deployed through GitHub Pages Actions.
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()` main-world script execution.
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` in the main world.
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
- - No extension cache (daemon uses CLI cache).
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`).
package/docs/cli.md CHANGED
@@ -177,7 +177,7 @@ Notes:
177
177
  - If a CLI call fails, auto mode falls back to the next candidate.
178
178
  - Cursor Agent CLI uses the `agent` binary and relies on Cursor CLI auth (login or `CURSOR_API_KEY`).
179
179
  - Antigravity CLI uses the active agy session model; `cli.agy.model` is ignored by runtime selection.
180
- - Antigravity normal text summaries run `agy --print <prompt>` in a temporary cwd with `--sandbox`. Because current agy print mode requires the prompt in argv, large prompts are rejected before launch using platform-specific argv limits; use another CLI/provider for large or sensitive extracted content. Attachment prompts keep the caller cwd so agy can inspect the requested path but do not auto-approve tools.
180
+ - Antigravity normal text summaries run `agy --print <prompt>` in a temporary cwd with `--sandbox`. When the prompt or command length exceeds platform argv limits (e.g. 120 KB on Linux/macOS), the document `<content>` payload is automatically offloaded to a temporary file (`document.txt`) with restricted `0o600` permissions and referenced via `file://` in `--print`, preserving instructions before and after the content block in argv while cleaning up the single temporary directory on success, failure, or timeout. Untagged prompts are offloaded as a complete request. Short text prompts retain best-effort no-tools guidance; offloaded prompts permit reading the supplied document while discouraging file edits, local file links, and work-log narration. This is prompt steering, not a hard capability boundary. Attachment prompts keep the caller cwd so agy can inspect the requested path but do not auto-approve tools.
181
181
  - pi runs in JSON mode (`--print --mode json`) with `--no-tools`, `--no-context-files`, `--no-extensions`, `--no-skills`, `--no-session` for isolated summarization. It receives the summarize system prompt via `--system-prompt`, the summarize prompt over stdin, and reports usage/cost via JSONL events. Use `PI_PATH` to override the binary path.
182
182
  - Codex CLI normal text summaries run isolated by default: `codex exec --ephemeral --ignore-user-config --ignore-rules -C <temp-dir> ...` with a sanitized temporary `CODEX_HOME` that carries auth only. Set `cli.codex.isolated` to `false` only when you intentionally need Codex to inherit local config/rules.
183
183
  - Gemini CLI is invoked in headless mode with `--prompt` for compatibility with current Gemini CLI releases.
@@ -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`.
@@ -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. Saves a `.txt` next to each PNG.
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/<video-id>/
81
- 001.png
82
- 002.png
80
+ slides/<source-id>/
81
+ slide_0001_18.60s.png
82
+ slide_0002_42.20s.png
83
83
  ...
84
- 001.txt # only with --slides-ocr
84
+ slides.json
85
85
  ```
86
86
 
87
- In `--json` mode, stdout is:
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
- "url": "...",
92
- "outDir": "slides/<id>",
93
- "slides": [{ "index": 1, "path": "...001.png", "timeSeconds": 18.6, "ocr": "..." }]
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[].path'
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:
package/docs/install.md CHANGED
@@ -30,6 +30,10 @@ brew install summarize
30
30
 
31
31
  The Homebrew formula lives in `homebrew/core`. If Homebrew isn't available, use the npm route.
32
32
 
33
+ ### Standalone macOS archives
34
+
35
+ The [macOS archives on GitHub Releases](https://github.com/steipete/summarize/releases/latest) contain standalone arm64 and x64 binaries. They require macOS 13 or newer and do not require Node.js.
36
+
33
37
  ### npx (no install)
34
38
 
35
39
  ```bash
package/docs/language.md CHANGED
@@ -20,6 +20,8 @@ summarize <input> --language en
20
20
  summarize <input> --language de
21
21
  summarize <input> --language english
22
22
  summarize <input> --lang german
23
+ summarize <input> --language tr
24
+ summarize <input> --language turkish
23
25
  ```
24
26
 
25
27
  Supported inputs (best-effort):
@@ -27,6 +29,7 @@ Supported inputs (best-effort):
27
29
  - `auto` (default): match the source language
28
30
  - Common shorthands: `en`, `de`, `es`, `fr`, ...
29
31
  - Common names: `english`, `german`/`deutsch`, `spanish`, ...
32
+ - Turkish aliases: `tr`, `tr-TR`, `turkish`, and `Türkçe`/`turkce`
30
33
  - BCP-47-ish tags: `en-US`, `pt-BR`, ...
31
34
  - Free-form hints: `German, formal`
32
35
 
@@ -49,3 +52,19 @@ Legacy (still supported):
49
52
  ```
50
53
 
51
54
  Unknown values are passed through to the model (sanitized).
55
+
56
+ ## CLI language
57
+
58
+ `--language` selects the language of the generated summary. It does not translate
59
+ the command-line interface. Use `--locale tr` (or `SUMMARIZE_LOCALE=tr`) for
60
+ Turkish help, progress, and status text. The CLI remains English by default;
61
+ unknown locales fall back to English. Command names, flags, model/provider IDs,
62
+ URLs, paths, and protocol identifiers are never translated.
63
+ Raw diagnostics and provider error messages, including Antigravity command-size errors, retain their original text. Syndication progress labels are included in the Turkish catalogs; uncatalogued status text falls back to English.
64
+
65
+ ## Extension interface language
66
+
67
+ Choose English, Turkish, or Automatic under Options → User interface. Existing
68
+ profiles keep English until you choose a locale; fresh installations use the
69
+ browser language. The setting updates an already-open side panel immediately.
70
+ It does not translate summary content, user data, or diagnostic log payloads.
@@ -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/docs/website.md CHANGED
@@ -38,7 +38,9 @@ Daemon note:
38
38
  ## Twitter/X
39
39
 
40
40
  - Tweet audio transcription runs only with `--video-mode transcript` (auto mode skips yt-dlp for tweets).
41
- - Tweet text extraction prefers `xurl` when installed, falls back to `bird`, then Nitter.
41
+ - Tweet text extraction prefers `xurl` when installed, falls back to `bird`, then Twitter Syndication API, then Nitter.
42
+ - `--video-mode transcript` still requests the tweet's audio transcript when text extraction uses the Syndication API; if no transcript is available, the extracted tweet text remains available.
43
+ - Syndication responses marked as truncated continue to the remaining extractors instead of treating a long-form tweet preview as complete content.
42
44
 
43
45
  ## Flags
44
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steipete/summarize",
3
- "version": "0.21.14",
3
+ "version": "0.22.0",
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.0",
37
- "@steipete/summarize-core": "0.21.14",
36
+ "@earendil-works/pi-ai": "^0.85.1",
37
+ "@steipete/summarize-core": "0.22.0",
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.4",
45
+ "tokentally": "^0.1.5",
46
46
  "undici": "8.10.2"
47
47
  },
48
48
  "devDependencies": {