@steipete/summarize 0.19.0 → 0.20.1

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 (130) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +5 -3
  3. package/completions/summarize.fish +1 -1
  4. package/dist/esm/application/asset-execution.js +122 -0
  5. package/dist/esm/application/asset-execution.js.map +1 -0
  6. package/dist/esm/application/execute-summarize.js +37 -318
  7. package/dist/esm/application/execute-summarize.js.map +1 -1
  8. package/dist/esm/application/execution-input.js +81 -0
  9. package/dist/esm/application/execution-input.js.map +1 -0
  10. package/dist/esm/application/url-routing.js +117 -0
  11. package/dist/esm/application/url-routing.js.map +1 -0
  12. package/dist/esm/config/parse-helpers.js +22 -0
  13. package/dist/esm/config/parse-helpers.js.map +1 -1
  14. package/dist/esm/config/sections.js +46 -126
  15. package/dist/esm/config/sections.js.map +1 -1
  16. package/dist/esm/content/asset.js +11 -1
  17. package/dist/esm/content/asset.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/agent.js +64 -32
  21. package/dist/esm/daemon/agent.js.map +1 -1
  22. package/dist/esm/daemon/cli-health.js +61 -0
  23. package/dist/esm/daemon/cli-health.js.map +1 -0
  24. package/dist/esm/daemon/cli-service.js +135 -0
  25. package/dist/esm/daemon/cli-service.js.map +1 -0
  26. package/dist/esm/daemon/cli.js +5 -211
  27. package/dist/esm/daemon/cli.js.map +1 -1
  28. package/dist/esm/daemon/config.js +1 -1
  29. package/dist/esm/daemon/config.js.map +1 -1
  30. package/dist/esm/daemon/models.js +1 -1
  31. package/dist/esm/daemon/models.js.map +1 -1
  32. package/dist/esm/daemon/schtasks.js +7 -2
  33. package/dist/esm/daemon/schtasks.js.map +1 -1
  34. package/dist/esm/engine/model-executor.js +76 -17
  35. package/dist/esm/engine/model-executor.js.map +1 -1
  36. package/dist/esm/llm/cli-provider-output/codex.js +143 -0
  37. package/dist/esm/llm/cli-provider-output/codex.js.map +1 -0
  38. package/dist/esm/llm/cli-provider-output/opencode.js +102 -0
  39. package/dist/esm/llm/cli-provider-output/opencode.js.map +1 -0
  40. package/dist/esm/llm/cli-provider-output/pi.js +94 -0
  41. package/dist/esm/llm/cli-provider-output/pi.js.map +1 -0
  42. package/dist/esm/llm/cli-provider-output/shared.js +11 -0
  43. package/dist/esm/llm/cli-provider-output/shared.js.map +1 -0
  44. package/dist/esm/llm/cli-provider-output.js +41 -440
  45. package/dist/esm/llm/cli-provider-output.js.map +1 -1
  46. package/dist/esm/llm/cli-runners/codex.js +97 -0
  47. package/dist/esm/llm/cli-runners/codex.js.map +1 -0
  48. package/dist/esm/llm/cli-runners/json.js +43 -0
  49. package/dist/esm/llm/cli-runners/json.js.map +1 -0
  50. package/dist/esm/llm/cli-runners/openclaw.js +45 -0
  51. package/dist/esm/llm/cli-runners/openclaw.js.map +1 -0
  52. package/dist/esm/llm/cli-runners/opencode.js +31 -0
  53. package/dist/esm/llm/cli-runners/opencode.js.map +1 -0
  54. package/dist/esm/llm/cli-runners/pi.js +43 -0
  55. package/dist/esm/llm/cli-runners/pi.js.map +1 -0
  56. package/dist/esm/llm/cli-runners/plain.js +63 -0
  57. package/dist/esm/llm/cli-runners/plain.js.map +1 -0
  58. package/dist/esm/llm/cli-runners/types.js +2 -0
  59. package/dist/esm/llm/cli-runners/types.js.map +1 -0
  60. package/dist/esm/llm/cli.js +34 -366
  61. package/dist/esm/llm/cli.js.map +1 -1
  62. package/dist/esm/llm/generate-text-shared.js +127 -9
  63. package/dist/esm/llm/generate-text-shared.js.map +1 -1
  64. package/dist/esm/llm/generate-text-stream.js +6 -4
  65. package/dist/esm/llm/generate-text-stream.js.map +1 -1
  66. package/dist/esm/llm/generate-text.js +83 -42
  67. package/dist/esm/llm/generate-text.js.map +1 -1
  68. package/dist/esm/llm/github-models.js +23 -0
  69. package/dist/esm/llm/github-models.js.map +1 -1
  70. package/dist/esm/llm/providers/anthropic.js +32 -14
  71. package/dist/esm/llm/providers/anthropic.js.map +1 -1
  72. package/dist/esm/llm/providers/google.js +52 -8
  73. package/dist/esm/llm/providers/google.js.map +1 -1
  74. package/dist/esm/llm/providers/models.js +23 -17
  75. package/dist/esm/llm/providers/models.js.map +1 -1
  76. package/dist/esm/llm/providers/openai/chat-completions.js +2 -8
  77. package/dist/esm/llm/providers/openai/chat-completions.js.map +1 -1
  78. package/dist/esm/llm/providers/openai/github-models.js +1 -13
  79. package/dist/esm/llm/providers/openai/github-models.js.map +1 -1
  80. package/dist/esm/llm/providers/openai/responses.js +2 -8
  81. package/dist/esm/llm/providers/openai/responses.js.map +1 -1
  82. package/dist/esm/llm/providers/openai/sse.js +28 -44
  83. package/dist/esm/llm/providers/openai/sse.js.map +1 -1
  84. package/dist/esm/llm/providers/openai.js +3 -1
  85. package/dist/esm/llm/providers/openai.js.map +1 -1
  86. package/dist/esm/llm/providers/shared.js +10 -1
  87. package/dist/esm/llm/providers/shared.js.map +1 -1
  88. package/dist/esm/model-auto.js +1 -1
  89. package/dist/esm/model-auto.js.map +1 -1
  90. package/dist/esm/run/help.js +2 -1
  91. package/dist/esm/run/help.js.map +1 -1
  92. package/dist/esm/slides/frame-extraction.js +5 -1
  93. package/dist/esm/slides/frame-extraction.js.map +1 -1
  94. package/dist/esm/slides/scene-detection.js +19 -3
  95. package/dist/esm/slides/scene-detection.js.map +1 -1
  96. package/dist/esm/version.js +1 -1
  97. package/dist/types/application/asset-execution.d.ts +21 -0
  98. package/dist/types/application/execution-input.d.ts +13 -0
  99. package/dist/types/application/url-routing.d.ts +37 -0
  100. package/dist/types/config/parse-helpers.d.ts +6 -0
  101. package/dist/types/content/asset.d.ts +3 -0
  102. package/dist/types/daemon/cli-health.d.ts +25 -0
  103. package/dist/types/daemon/cli-service.d.ts +39 -0
  104. package/dist/types/llm/cli-provider-output/codex.d.ts +9 -0
  105. package/dist/types/llm/cli-provider-output/opencode.d.ts +6 -0
  106. package/dist/types/llm/cli-provider-output/pi.d.ts +6 -0
  107. package/dist/types/llm/cli-provider-output/shared.d.ts +2 -0
  108. package/dist/types/llm/cli-provider-output.d.ts +3 -18
  109. package/dist/types/llm/cli-runners/codex.d.ts +2 -0
  110. package/dist/types/llm/cli-runners/json.d.ts +3 -0
  111. package/dist/types/llm/cli-runners/openclaw.d.ts +2 -0
  112. package/dist/types/llm/cli-runners/opencode.d.ts +2 -0
  113. package/dist/types/llm/cli-runners/pi.d.ts +2 -0
  114. package/dist/types/llm/cli-runners/plain.d.ts +3 -0
  115. package/dist/types/llm/cli-runners/types.d.ts +22 -0
  116. package/dist/types/llm/cli.d.ts +1 -6
  117. package/dist/types/llm/generate-text-shared.d.ts +2 -1
  118. package/dist/types/llm/github-models.d.ts +2 -0
  119. package/dist/types/llm/providers/anthropic.d.ts +15 -8
  120. package/dist/types/llm/providers/models.d.ts +4 -1
  121. package/dist/types/llm/providers/openai/sse.d.ts +1 -0
  122. package/dist/types/llm/providers/shared.d.ts +1 -0
  123. package/dist/types/slides/scene-detection.d.ts +7 -1
  124. package/dist/types/version.d.ts +1 -1
  125. package/docs/chrome-extension.md +11 -6
  126. package/docs/commands/daemon.md +3 -3
  127. package/docs/commands/summarize.md +1 -1
  128. package/docs/install.md +1 -1
  129. package/docs/llm.md +1 -1
  130. package/package.json +11 -11
@@ -1,11 +1,16 @@
1
1
  import { type ProcessCommand } from "./process.js";
2
2
  import type { SlideImage } from "./types.js";
3
+ export type FfmpegVfrArgs = ["-fps_mode" | "-vsync", "vfr"];
3
4
  export type SceneSegment = {
4
5
  start: number;
5
6
  end: number | null;
6
7
  };
7
8
  export declare function clamp(value: number, min: number, max: number): number;
8
9
  export declare function parseShowinfoTimestamp(line: string): number | null;
10
+ export declare function resolveFfmpegVfrArgs({ ffmpegPath, timeoutMs, }: {
11
+ ffmpegPath: ProcessCommand;
12
+ timeoutMs: number;
13
+ }): Promise<FfmpegVfrArgs>;
9
14
  export declare function resolveExtractedTimestamp({ requested, actual, seekBase, }: {
10
15
  requested: number;
11
16
  actual: number | null;
@@ -27,11 +32,12 @@ export declare function buildSegments(durationSeconds: number | null, workers: n
27
32
  start: number;
28
33
  duration: number;
29
34
  }>;
30
- export declare function detectSceneTimestamps({ ffmpegPath, inputPath, threshold, timeoutMs, segments, workers, onSegmentProgress, runWithConcurrency, }: {
35
+ export declare function detectSceneTimestamps({ ffmpegPath, inputPath, threshold, timeoutMs, vfrArgs, segments, workers, onSegmentProgress, runWithConcurrency, }: {
31
36
  ffmpegPath: ProcessCommand;
32
37
  inputPath: string;
33
38
  threshold: number;
34
39
  timeoutMs: number;
40
+ vfrArgs: FfmpegVfrArgs;
35
41
  segments?: Array<{
36
42
  start: number;
37
43
  duration: number;
@@ -1,4 +1,4 @@
1
- export declare const FALLBACK_VERSION = "0.19.0";
1
+ export declare const FALLBACK_VERSION = "0.20.1";
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;
@@ -21,7 +21,8 @@ Quickstart:
21
21
  - `brew install summarize` (macOS, Linux)
22
22
  - Firefox sidebar build: `pnpm -C apps/chrome-extension build:firefox` (load via `about:debugging` → temporary add-on)
23
23
  - Open side panel → copy token install command → run for daemon mode:
24
- - `summarize daemon install --token <TOKEN>` (macOS: LaunchAgent, Linux: systemd user, Windows: Scheduled Task)
24
+ - `summarize daemon install --token <TOKEN> --port 8787` (macOS: LaunchAgent, Linux: systemd user, Windows: Scheduled Task)
25
+ - Non-default port: replace `8787`, then set the same value in **Options → Runtime → Daemon → Port**.
25
26
  - Verify:
26
27
  - `summarize daemon status`
27
28
  - Restart (if needed): `summarize daemon restart`
@@ -44,6 +45,7 @@ Dev (repo checkout):
44
45
 
45
46
  - “Daemon not reachable”:
46
47
  - `summarize daemon status`
48
+ - If the daemon uses a non-default port, confirm **Options → Runtime → Daemon → Port** matches the daemon configuration.
47
49
  - Logs: `~/.summarize/logs/daemon.err.log`
48
50
  - Windows install:
49
51
  - `summarize daemon install` registers a Scheduled Task via `schtasks /Create /XML`, which requires an **elevated** shell. Run it from an Administrator PowerShell/cmd; otherwise you'll see `schtasks create failed: ERROR: Access is denied.`
@@ -54,7 +56,7 @@ Dev (repo checkout):
54
56
  - Re-run: `summarize daemon install --token <TOKEN>`.
55
57
  - Windows containers:
56
58
  - `summarize daemon install --token <TOKEN>` starts the daemon for the current container session but does not create a Scheduled Task.
57
- - Run that command manually each time the container starts, or add it to your container startup. Also publish the daemon port in `docker-compose.yml`:
59
+ - Run that command manually each time the container starts, or add it to your container startup. Also publish the configured daemon port in `docker-compose.yml` (default `8787`):
58
60
  `ports: ['8787:8787']`
59
61
  `command: ['cmd', '/c', 'summarize daemon install --token <TOKEN>']`
60
62
  - Then restart the container and verify `http://127.0.0.1:8787/health`.
@@ -77,7 +79,7 @@ Dev (repo checkout):
77
79
  - The content script wasn’t injected (yet), or Chrome blocked site access.
78
80
  - Chrome → extension details → “Site access” → “On all sites” (or allow the domain), then reload the tab.
79
81
  - “<site> wants to look for and connect to any device on your local network”:
80
- - Trigger: content scripts (page context) hitting the daemon on `http://127.0.0.1:8787` (hover summaries) can cause Chrome to attribute the request to the current origin and prompt per-site.
82
+ - Trigger: content scripts (page context) hitting the configured daemon origin (default `http://127.0.0.1:8787`) can cause Chrome to attribute the request to the current origin and prompt per-site.
81
83
  - Fix: hover summaries must proxy daemon calls via the extension background service worker (reload the extension after updating).
82
84
  - Verify daemon: `summarize daemon status` (or `curl http://127.0.0.1:8787/health`).
83
85
  - Repro/dev: `pnpm -C apps/chrome-extension dev` then enable “Hover summaries” and hover a link.
@@ -92,9 +94,10 @@ Dev (repo checkout):
92
94
  - Direct provider adapters: OpenAI-compatible SSE, Anthropic Messages SSE, and Gemini SSE, normalized to the same summary/chat/tool-call contracts.
93
95
  - Panel page streams SSE directly (MV3 service workers can be flaky for long-lived streams).
94
96
  - **Daemon (local, autostart service)**
95
- - HTTP server on `127.0.0.1:8787` only.
97
+ - HTTP server on `127.0.0.1` (default port `8787`).
96
98
  - Token-authenticated API.
97
99
  - Runs the existing summarize pipeline (env/config-based) and streams tokens to client via SSE.
100
+ - Port is configurable: set **Options → Runtime → Daemon → Port** to match a daemon started with `summarize daemon install --port <n>` (e.g. when `8787` is taken by another service). The extension talks to `127.0.0.1:<port>` for every daemon call.
98
101
 
99
102
  ## Data Flow
100
103
 
@@ -159,6 +162,7 @@ See `docs/media.md` for detection and transcript rules.
159
162
  - AI connection (Options → Runtime): Direct | Daemon.
160
163
  - Direct provider and credential/base URL (Options → Runtime). `auto` uses the configured provider, otherwise Gemini Nano; an explicit provider prefix overrides the selection.
161
164
  - Media/slide runtime (Options → Runtime): Browser | Daemon.
165
+ - Daemon port (Options → Runtime; default `8787`): must match the installed daemon port.
162
166
  - Model preset: `auto` | Gemini Nano | `free` | custom string (e.g. `openai/gpt-5-mini`, `openrouter/...`, `github-copilot/...`). Explicit Gemini Nano summaries stay on-device in either connection mode.
163
167
  - Length: `short|medium|long|xl|xxl` (or a character target like `20k`). Tooltips show target ranges + paragraph guidance (from `packages/core/src/prompts/summary-lengths.ts`).
164
168
  - Language: `auto` (match source) or a tag like `en`, `de`, `pt-BR` (or free-form like “German”).
@@ -190,11 +194,12 @@ Problem: daemon must be secured; extension must discover and pair with it.
190
194
  - Side panel “Setup” state:
191
195
  - Generates token (random, 32+ bytes).
192
196
  - Shows:
193
- - `summarize daemon install --token <TOKEN>` (macOS: LaunchAgent, Linux: systemd user, Windows: Scheduled Task)
197
+ - `summarize daemon install --token <TOKEN> --port <PORT>` (macOS: LaunchAgent, Linux: systemd user, Windows: Scheduled Task)
194
198
  - `summarize daemon status`
195
199
  - “Copy command” button.
196
200
  - Daemon stores paired tokens in `~/.summarize/daemon.json`.
197
201
  - Extension stores token in `chrome.storage.local`.
202
+ - The manifest permits HTTP to `127.0.0.1` on any port; bearer tokens are attached only for the exact configured daemon origin.
198
203
  - If daemon unreachable or 401: show Setup state + troubleshooting.
199
204
 
200
205
  ## Daemon Endpoints
@@ -269,7 +274,7 @@ Notes:
269
274
  ## Daemon Autostart
270
275
 
271
276
  - CLI commands:
272
- - `summarize daemon install --token <token> [--port 8787]`
277
+ - `summarize daemon install --token <token> [--port <PORT>]`
273
278
  - Writes `~/.summarize/daemon.json`
274
279
  - Installs platform autostart service; verifies `/health`
275
280
  - `summarize daemon uninstall`
@@ -70,7 +70,7 @@ summarize daemon run --port 8787
70
70
  ## Options
71
71
 
72
72
  `--port <n>`
73
- : TCP port. Default `8787`. The Side Panel reads it from `~/.summarize/daemon.json`.
73
+ : TCP port. Default `8787`. For a non-default port, set the same value in the extension under **Options → Runtime → Daemon → Port**; browser extensions cannot read `~/.summarize/daemon.json`.
74
74
 
75
75
  `--token <token>`
76
76
  : Bearer token. Required for `install`. Stored in `~/.summarize/daemon.json` (mode `0600`).
@@ -96,9 +96,9 @@ The daemon is documented in detail in [Chrome extension](../chrome-extension.md)
96
96
 
97
97
  ## Notes
98
98
 
99
- - **Containers** — `install` starts the daemon for the current container session but does not register a Scheduled Task / unit. Run `summarize daemon run` from your entrypoint instead, and publish port `8787` so the host browser can reach it.
99
+ - **Containers** — `install` starts the daemon for the current container session but does not register a Scheduled Task / unit. Run `summarize daemon run` from your entrypoint instead, publish the configured port (default `8787`), and set the same port in the extension.
100
100
  - **Token rotation** — running `install --token <NEW>` adds a new paired browser; old browsers keep working. Edit `daemon.json` by hand to revoke.
101
- - **Multiple installs** — only one daemon per user. Reinstall to upgrade.
101
+ - **Multiple installs** — only one daemon per user. Reinstall to upgrade; omitting `--port` preserves the configured port.
102
102
 
103
103
  ## See also
104
104
 
@@ -142,7 +142,7 @@ If `[input]` is omitted, summarize prints concise help and exits.
142
142
  : Hard cap for LLM output tokens. Accepts `2000`, `2k`. Overrides provider defaults.
143
143
 
144
144
  `--retries <count>`
145
- : LLM retry attempts on timeout. Default `1`.
145
+ : LLM retry attempts after timeouts or transient API failures. Default `1`.
146
146
 
147
147
  ### Output
148
148
 
package/docs/install.md CHANGED
@@ -129,7 +129,7 @@ Use `PORT=4001 ./scripts/docs-serve.sh` to pick another port.
129
129
  ## Notes (Windows / containers)
130
130
 
131
131
  - **Windows native:** `summarize` runs under Node 24. The daemon registers a Scheduled Task on first install.
132
- - **Windows containers:** `summarize daemon install` starts the daemon for the current container session but does not register a Scheduled Task. Run the install on each startup or add it to the container entrypoint, and publish port `8787` so a host browser can reach the daemon.
132
+ - **Windows containers:** `summarize daemon install` starts the daemon for the current container session but does not register a Scheduled Task. Run the install on each startup or add it to the container entrypoint, publish the configured port (default `8787`), and set the same port under **Options → Runtime → Daemon → Port**.
133
133
  - **WSL2:** treat as Linux. The daemon installs as a systemd user service if `systemd` is available; otherwise run `summarize daemon run` in a long-lived shell.
134
134
 
135
135
  Next: head to [Quickstart](quickstart.md).
package/docs/llm.md CHANGED
@@ -112,7 +112,7 @@ installed, auto mode can use local CLI models via `cli.enabled` or implicit auto
112
112
  - `--service-tier default|fast|priority|flex`
113
113
  - OpenAI service tier override. `fast` is the summarize-facing alias for OpenAI `priority`; `default` sends no service tier.
114
114
  - `--retries <count>`
115
- - LLM retry attempts on timeout (default: 1).
115
+ - LLM retry attempts after timeouts or transient API failures (default: 1).
116
116
  - `--json` (includes prompt + summary in one JSON object)
117
117
 
118
118
  ## Prompt rules
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steipete/summarize",
3
- "version": "0.19.0",
3
+ "version": "0.20.1",
4
4
  "description": "Link → clean text → summary.",
5
5
  "bin": {
6
6
  "summarize": "./dist/cli.js",
@@ -33,30 +33,30 @@
33
33
  }
34
34
  },
35
35
  "dependencies": {
36
- "@earendil-works/pi-ai": "^0.79.1",
36
+ "@earendil-works/pi-ai": "^0.80.2",
37
37
  "bpe-lite": "^0.5.2",
38
38
  "commander": "^15.0.0",
39
39
  "file-type": "^22.0.1",
40
40
  "json5": "^2.2.3",
41
41
  "markdansi": "^0.3.1",
42
42
  "mime": "^4.1.0",
43
- "osc-progress": "^0.3.0",
43
+ "osc-progress": "^0.3.1",
44
44
  "tokentally": "^0.1.1",
45
- "undici": "8.4.1",
46
- "@steipete/summarize-core": "0.19.0"
45
+ "undici": "8.5.0",
46
+ "@steipete/summarize-core": "0.20.1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/node": "^24.13.1",
50
50
  "@types/sanitize-html": "^2.16.1",
51
- "@typescript/native-preview": "7.0.0-dev.20260609.1",
52
- "@vitest/coverage-v8": "^4.1.8",
53
- "happy-dom": "^20.10.1",
54
- "oxfmt": "0.54.0",
55
- "oxlint": "^1.69.0",
51
+ "@typescript/native-preview": "7.0.0-dev.20260615.1",
52
+ "@vitest/coverage-v8": "^4.1.9",
53
+ "happy-dom": "^20.10.4",
54
+ "oxfmt": "0.55.0",
55
+ "oxlint": "^1.70.0",
56
56
  "oxlint-tsgolint": "^0.23.0",
57
57
  "rimraf": "^6.1.3",
58
58
  "typescript": "^6.0.3",
59
- "vitest": "^4.1.8"
59
+ "vitest": "^4.1.9"
60
60
  },
61
61
  "engines": {
62
62
  "node": ">=24"