@steipete/summarize 0.18.1 → 0.20.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 +32 -0
- package/README.md +11 -9
- package/dist/esm/application/asset-execution.js +122 -0
- package/dist/esm/application/asset-execution.js.map +1 -0
- package/dist/esm/application/execute-summarize.js +37 -318
- package/dist/esm/application/execute-summarize.js.map +1 -1
- package/dist/esm/application/execution-input.js +81 -0
- package/dist/esm/application/execution-input.js.map +1 -0
- package/dist/esm/application/url-routing.js +117 -0
- package/dist/esm/application/url-routing.js.map +1 -0
- package/dist/esm/cache.js +2 -2
- package/dist/esm/cache.js.map +1 -1
- package/dist/esm/config/parse-helpers.js +22 -0
- package/dist/esm/config/parse-helpers.js.map +1 -1
- package/dist/esm/config/sections.js +46 -126
- package/dist/esm/config/sections.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/agent.js +63 -31
- package/dist/esm/daemon/agent.js.map +1 -1
- package/dist/esm/daemon/cli-health.js +61 -0
- package/dist/esm/daemon/cli-health.js.map +1 -0
- package/dist/esm/daemon/cli-service.js +135 -0
- package/dist/esm/daemon/cli-service.js.map +1 -0
- package/dist/esm/daemon/cli.js +5 -211
- package/dist/esm/daemon/cli.js.map +1 -1
- package/dist/esm/daemon/config.js +1 -1
- package/dist/esm/daemon/config.js.map +1 -1
- package/dist/esm/daemon/server-admin-routes.js +1 -0
- package/dist/esm/daemon/server-admin-routes.js.map +1 -1
- package/dist/esm/daemon/server-auth.js +1 -0
- package/dist/esm/daemon/server-auth.js.map +1 -1
- package/dist/esm/daemon/server-http.js +1 -0
- package/dist/esm/daemon/server-http.js.map +1 -1
- package/dist/esm/daemon/server-session.js +1 -0
- package/dist/esm/daemon/server-session.js.map +1 -1
- package/dist/esm/daemon/server-sse.js +1 -0
- package/dist/esm/daemon/server-sse.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/errors.js +1 -1
- package/dist/esm/engine/errors.js.map +1 -1
- package/dist/esm/llm/cli-provider-output/codex.js +143 -0
- package/dist/esm/llm/cli-provider-output/codex.js.map +1 -0
- package/dist/esm/llm/cli-provider-output/opencode.js +102 -0
- package/dist/esm/llm/cli-provider-output/opencode.js.map +1 -0
- package/dist/esm/llm/cli-provider-output/pi.js +94 -0
- package/dist/esm/llm/cli-provider-output/pi.js.map +1 -0
- package/dist/esm/llm/cli-provider-output/shared.js +11 -0
- package/dist/esm/llm/cli-provider-output/shared.js.map +1 -0
- package/dist/esm/llm/cli-provider-output.js +41 -440
- package/dist/esm/llm/cli-provider-output.js.map +1 -1
- package/dist/esm/llm/cli-runners/codex.js +97 -0
- package/dist/esm/llm/cli-runners/codex.js.map +1 -0
- package/dist/esm/llm/cli-runners/json.js +43 -0
- package/dist/esm/llm/cli-runners/json.js.map +1 -0
- package/dist/esm/llm/cli-runners/openclaw.js +45 -0
- package/dist/esm/llm/cli-runners/openclaw.js.map +1 -0
- package/dist/esm/llm/cli-runners/opencode.js +31 -0
- package/dist/esm/llm/cli-runners/opencode.js.map +1 -0
- package/dist/esm/llm/cli-runners/pi.js +43 -0
- package/dist/esm/llm/cli-runners/pi.js.map +1 -0
- package/dist/esm/llm/cli-runners/plain.js +63 -0
- package/dist/esm/llm/cli-runners/plain.js.map +1 -0
- package/dist/esm/llm/cli-runners/types.js +2 -0
- package/dist/esm/llm/cli-runners/types.js.map +1 -0
- package/dist/esm/llm/cli.js +34 -366
- package/dist/esm/llm/cli.js.map +1 -1
- package/dist/esm/llm/generate-text.js +1 -1
- package/dist/esm/llm/generate-text.js.map +1 -1
- package/dist/esm/llm/github-models.js +23 -0
- package/dist/esm/llm/github-models.js.map +1 -1
- package/dist/esm/llm/providers/openai/github-models.js +1 -13
- package/dist/esm/llm/providers/openai/github-models.js.map +1 -1
- package/dist/esm/llm/providers/openai/sse.js +11 -44
- package/dist/esm/llm/providers/openai/sse.js.map +1 -1
- package/dist/esm/model-auto.js +1 -1
- package/dist/esm/model-auto.js.map +1 -1
- package/dist/esm/run/flows/url/flow.js +1 -0
- package/dist/esm/run/flows/url/flow.js.map +1 -1
- package/dist/esm/run/flows/url/summary.js +2 -1
- package/dist/esm/run/flows/url/summary.js.map +1 -1
- package/dist/esm/run/flows/url/video-only.js +1 -0
- package/dist/esm/run/flows/url/video-only.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/run-settings.js +1 -1
- package/dist/esm/run/run-settings.js.map +1 -1
- package/dist/esm/slides/extract.js +3 -2
- package/dist/esm/slides/extract.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/application/asset-execution.d.ts +21 -0
- package/dist/types/application/execution-input.d.ts +13 -0
- package/dist/types/application/url-routing.d.ts +37 -0
- package/dist/types/config/parse-helpers.d.ts +6 -0
- package/dist/types/daemon/cli-health.d.ts +25 -0
- package/dist/types/daemon/cli-service.d.ts +39 -0
- package/dist/types/llm/cli-provider-output/codex.d.ts +9 -0
- package/dist/types/llm/cli-provider-output/opencode.d.ts +6 -0
- package/dist/types/llm/cli-provider-output/pi.d.ts +6 -0
- package/dist/types/llm/cli-provider-output/shared.d.ts +2 -0
- package/dist/types/llm/cli-provider-output.d.ts +3 -18
- package/dist/types/llm/cli-runners/codex.d.ts +2 -0
- package/dist/types/llm/cli-runners/json.d.ts +3 -0
- package/dist/types/llm/cli-runners/openclaw.d.ts +2 -0
- package/dist/types/llm/cli-runners/opencode.d.ts +2 -0
- package/dist/types/llm/cli-runners/pi.d.ts +2 -0
- package/dist/types/llm/cli-runners/plain.d.ts +3 -0
- package/dist/types/llm/cli-runners/types.d.ts +22 -0
- package/dist/types/llm/cli.d.ts +1 -6
- package/dist/types/llm/github-models.d.ts +2 -0
- package/dist/types/version.d.ts +1 -1
- package/docs/chrome-extension.md +23 -12
- package/docs/commands/daemon.md +4 -4
- package/docs/install.md +1 -1
- package/package.json +4 -6
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
2
|
+
export declare function waitForHealth({ fetchImpl, port, timeoutMs, }: {
|
|
3
|
+
fetchImpl: typeof fetch;
|
|
4
|
+
port: number;
|
|
5
|
+
timeoutMs: number;
|
|
6
|
+
}): Promise<void>;
|
|
7
|
+
export declare function waitForHealthWithRetries({ fetchImpl, port, attempts, timeoutMs, delayMs, }: {
|
|
8
|
+
fetchImpl: typeof fetch;
|
|
9
|
+
port: number;
|
|
10
|
+
attempts: number;
|
|
11
|
+
timeoutMs: number;
|
|
12
|
+
delayMs: number;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
export declare function checkAuth({ fetchImpl, token, port, }: {
|
|
15
|
+
fetchImpl: typeof fetch;
|
|
16
|
+
token: string;
|
|
17
|
+
port: number;
|
|
18
|
+
}): Promise<boolean>;
|
|
19
|
+
export declare function checkAuthWithRetries({ fetchImpl, token, port, attempts, delayMs, }: {
|
|
20
|
+
fetchImpl: typeof fetch;
|
|
21
|
+
token: string;
|
|
22
|
+
port: number;
|
|
23
|
+
attempts: number;
|
|
24
|
+
delayMs: number;
|
|
25
|
+
}): Promise<boolean>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
type DaemonServiceInstallArgs = {
|
|
2
|
+
env: Record<string, string | undefined>;
|
|
3
|
+
stdout: NodeJS.WritableStream;
|
|
4
|
+
programArguments: string[];
|
|
5
|
+
workingDirectory?: string;
|
|
6
|
+
};
|
|
7
|
+
export type DaemonService = {
|
|
8
|
+
label: string;
|
|
9
|
+
loadedText: string;
|
|
10
|
+
notLoadedText: string;
|
|
11
|
+
install: (args: DaemonServiceInstallArgs) => Promise<void>;
|
|
12
|
+
uninstall: (args: {
|
|
13
|
+
env: Record<string, string | undefined>;
|
|
14
|
+
stdout: NodeJS.WritableStream;
|
|
15
|
+
}) => Promise<void>;
|
|
16
|
+
restart: (args: {
|
|
17
|
+
env: Record<string, string | undefined>;
|
|
18
|
+
stdout: NodeJS.WritableStream;
|
|
19
|
+
}) => Promise<void>;
|
|
20
|
+
isLoaded: (args: {
|
|
21
|
+
env: Record<string, string | undefined>;
|
|
22
|
+
}) => Promise<boolean>;
|
|
23
|
+
};
|
|
24
|
+
export type DaemonProgram = {
|
|
25
|
+
programArguments: string[];
|
|
26
|
+
workingDirectory?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare function resolveDaemonService(): DaemonService;
|
|
29
|
+
export declare function resolveDaemonProgramArguments({ dev, }: {
|
|
30
|
+
dev: boolean;
|
|
31
|
+
}): Promise<DaemonProgram>;
|
|
32
|
+
export declare function formatProgramArguments(args: string[]): string;
|
|
33
|
+
export declare function readInstalledDaemonCommand(env: Record<string, string | undefined>): Promise<DaemonProgram | null>;
|
|
34
|
+
export declare function startDetachedContainerDaemon({ env, programArguments, workingDirectory, }: {
|
|
35
|
+
env: Record<string, string | undefined>;
|
|
36
|
+
programArguments: string[];
|
|
37
|
+
workingDirectory?: string;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LlmTokenUsage } from "../generate-text.js";
|
|
2
|
+
export declare const parseCodexUsageFromJsonl: (output: string) => {
|
|
3
|
+
usage: LlmTokenUsage | null;
|
|
4
|
+
costUsd: number | null;
|
|
5
|
+
};
|
|
6
|
+
export declare function parseCodexOutputFromJsonl(output: string): {
|
|
7
|
+
text: string | null;
|
|
8
|
+
sawStructuredEvent: boolean;
|
|
9
|
+
};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import type { CliProvider } from "../config.js";
|
|
2
2
|
import type { LlmTokenUsage } from "./generate-text.js";
|
|
3
|
+
export { parseCodexOutputFromJsonl, parseCodexUsageFromJsonl, } from "./cli-provider-output/codex.js";
|
|
4
|
+
export { parseOpenCodeOutputFromJsonl } from "./cli-provider-output/opencode.js";
|
|
5
|
+
export { parsePiOutputFromJsonl } from "./cli-provider-output/pi.js";
|
|
3
6
|
export type JsonCliProvider = Exclude<CliProvider, "codex" | "openclaw" | "opencode" | "copilot" | "agy" | "pi">;
|
|
4
7
|
export declare function isJsonCliProvider(provider: CliProvider): provider is JsonCliProvider;
|
|
5
|
-
export declare const parseCodexUsageFromJsonl: (output: string) => {
|
|
6
|
-
usage: LlmTokenUsage | null;
|
|
7
|
-
costUsd: number | null;
|
|
8
|
-
};
|
|
9
|
-
export declare function parseCodexOutputFromJsonl(output: string): {
|
|
10
|
-
text: string | null;
|
|
11
|
-
sawStructuredEvent: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare function parseOpenCodeOutputFromJsonl(output: string): {
|
|
14
|
-
text: string;
|
|
15
|
-
usage: LlmTokenUsage | null;
|
|
16
|
-
costUsd: number | null;
|
|
17
|
-
};
|
|
18
8
|
export declare function parseJsonProviderOutput(args: {
|
|
19
9
|
provider: JsonCliProvider;
|
|
20
10
|
stdout: string;
|
|
@@ -23,8 +13,3 @@ export declare function parseJsonProviderOutput(args: {
|
|
|
23
13
|
usage: LlmTokenUsage | null;
|
|
24
14
|
costUsd: number | null;
|
|
25
15
|
};
|
|
26
|
-
export declare function parsePiOutputFromJsonl(output: string): {
|
|
27
|
-
text: string;
|
|
28
|
-
usage: LlmTokenUsage | null;
|
|
29
|
-
costUsd: number | null;
|
|
30
|
-
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CliProviderConfig } from "../../config.js";
|
|
2
|
+
import type { ExecFileFn } from "../../markitdown.js";
|
|
3
|
+
import type { LlmTokenUsage } from "../generate-text.js";
|
|
4
|
+
export type CliRunResult = {
|
|
5
|
+
text: string;
|
|
6
|
+
usage: LlmTokenUsage | null;
|
|
7
|
+
costUsd: number | null;
|
|
8
|
+
};
|
|
9
|
+
export type ResolvedCliRunOptions = {
|
|
10
|
+
binary: string;
|
|
11
|
+
prompt: string;
|
|
12
|
+
requestedModel: string | null;
|
|
13
|
+
allowTools: boolean;
|
|
14
|
+
timeoutMs: number;
|
|
15
|
+
env: Record<string, string | undefined>;
|
|
16
|
+
execFileImpl: ExecFileFn;
|
|
17
|
+
providerConfig?: CliProviderConfig;
|
|
18
|
+
providerExtraArgs: string[];
|
|
19
|
+
cwd?: string;
|
|
20
|
+
systemPrompt?: string | null;
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
};
|
package/dist/types/llm/cli.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CliConfig, CliProvider } from "../config.js";
|
|
2
2
|
import type { ExecFileFn } from "../markitdown.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { CliRunResult } from "./cli-runners/types.js";
|
|
4
4
|
type RunCliModelOptions = {
|
|
5
5
|
provider: CliProvider;
|
|
6
6
|
prompt: string;
|
|
@@ -15,11 +15,6 @@ type RunCliModelOptions = {
|
|
|
15
15
|
systemPrompt?: string | null;
|
|
16
16
|
signal?: AbortSignal;
|
|
17
17
|
};
|
|
18
|
-
type CliRunResult = {
|
|
19
|
-
text: string;
|
|
20
|
-
usage: LlmTokenUsage | null;
|
|
21
|
-
costUsd: number | null;
|
|
22
|
-
};
|
|
23
18
|
export declare function isCliDisabled(provider: CliProvider, config: CliConfig | null | undefined): boolean;
|
|
24
19
|
export declare function resolveCliBinary(provider: CliProvider, config: CliConfig | null | undefined, env: Record<string, string | undefined>): string;
|
|
25
20
|
export declare function runCliModel({ provider, prompt, model, allowTools, timeoutMs, env, execFileImpl, config, cwd, extraArgs, systemPrompt, signal, }: RunCliModelOptions): Promise<CliRunResult>;
|
|
@@ -3,3 +3,5 @@ export declare const GITHUB_MODELS_API_VERSION = "2026-03-10";
|
|
|
3
3
|
export declare function resolveGitHubModelsApiKey(env: Record<string, string | undefined>): string | null;
|
|
4
4
|
export declare function resolveGitHubCopilotBackendModelId(model: string): string;
|
|
5
5
|
export declare function buildGitHubModelsHeaders(existing?: Record<string, string>): Record<string, string>;
|
|
6
|
+
export declare function resolveGitHubModelsCompatFallbackModelId(modelId: string): string | null;
|
|
7
|
+
export declare function shouldRetryGitHubModelsCompat(error: unknown): boolean;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const FALLBACK_VERSION = "0.
|
|
1
|
+
export declare const FALLBACK_VERSION = "0.20.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/chrome-extension.md
CHANGED
|
@@ -13,13 +13,16 @@ 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
|
-
-
|
|
16
|
+
- Direct mode works immediately without a daemon. Auto uses a configured provider, otherwise Gemini Nano when available with extractive fallback.
|
|
17
|
+
- Configured direct providers support summaries, chat, automation, hover summaries, and public-URL extraction without a daemon. Provider keys stay in extension-local storage.
|
|
18
|
+
- Browser media provides daemonless transcription, slide extraction, and Gemini Nano per-slide summaries. OCR, process/log tools, CLI fallbacks, and broader native media support require the daemon.
|
|
17
19
|
- Optional: install summarize for daemon-backed media support:
|
|
18
20
|
- `npm i -g @steipete/summarize`
|
|
19
21
|
- `brew install summarize` (macOS, Linux)
|
|
20
22
|
- Firefox sidebar build: `pnpm -C apps/chrome-extension build:firefox` (load via `about:debugging` → temporary add-on)
|
|
21
23
|
- Open side panel → copy token install command → run for daemon mode:
|
|
22
|
-
- `summarize daemon install --token <TOKEN
|
|
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**.
|
|
23
26
|
- Verify:
|
|
24
27
|
- `summarize daemon status`
|
|
25
28
|
- Restart (if needed): `summarize daemon restart`
|
|
@@ -32,7 +35,7 @@ Firefox notes:
|
|
|
32
35
|
|
|
33
36
|
Dev (repo checkout):
|
|
34
37
|
|
|
35
|
-
- Use: `pnpm summarize daemon install --token <TOKEN> --dev` (autostart service runs `src/cli.ts` via
|
|
38
|
+
- Use: `pnpm summarize daemon install --token <TOKEN> --dev` (autostart service runs `src/cli.ts` via Node's native TypeScript support; no `dist/` build required).
|
|
36
39
|
- E2E (Playwright): `pnpm -C apps/chrome-extension test:e2e`
|
|
37
40
|
- First run: `pnpm -C apps/chrome-extension exec playwright install chromium`
|
|
38
41
|
- Chromium runs headless by default.
|
|
@@ -42,6 +45,7 @@ Dev (repo checkout):
|
|
|
42
45
|
|
|
43
46
|
- “Daemon not reachable”:
|
|
44
47
|
- `summarize daemon status`
|
|
48
|
+
- If the daemon uses a non-default port, confirm **Options → Runtime → Daemon → Port** matches the daemon configuration.
|
|
45
49
|
- Logs: `~/.summarize/logs/daemon.err.log`
|
|
46
50
|
- Windows install:
|
|
47
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.`
|
|
@@ -52,7 +56,7 @@ Dev (repo checkout):
|
|
|
52
56
|
- Re-run: `summarize daemon install --token <TOKEN>`.
|
|
53
57
|
- Windows containers:
|
|
54
58
|
- `summarize daemon install --token <TOKEN>` starts the daemon for the current container session but does not create a Scheduled Task.
|
|
55
|
-
- 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`):
|
|
56
60
|
`ports: ['8787:8787']`
|
|
57
61
|
`command: ['cmd', '/c', 'summarize daemon install --token <TOKEN>']`
|
|
58
62
|
- Then restart the container and verify `http://127.0.0.1:8787/health`.
|
|
@@ -75,7 +79,7 @@ Dev (repo checkout):
|
|
|
75
79
|
- The content script wasn’t injected (yet), or Chrome blocked site access.
|
|
76
80
|
- Chrome → extension details → “Site access” → “On all sites” (or allow the domain), then reload the tab.
|
|
77
81
|
- “<site> wants to look for and connect to any device on your local network”:
|
|
78
|
-
- Trigger: content scripts (page context) hitting the daemon
|
|
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.
|
|
79
83
|
- Fix: hover summaries must proxy daemon calls via the extension background service worker (reload the extension after updating).
|
|
80
84
|
- Verify daemon: `summarize daemon status` (or `curl http://127.0.0.1:8787/health`).
|
|
81
85
|
- Repro/dev: `pnpm -C apps/chrome-extension dev` then enable “Hover summaries” and hover a link.
|
|
@@ -87,11 +91,13 @@ Dev (repo checkout):
|
|
|
87
91
|
- Background service worker: tab + navigation tracking, content extraction, starts summarize runs.
|
|
88
92
|
- Chrome offscreen page: runs MediaBunny with native WebCodecs for ranged video slides and chunked local media transcription, plus an idle-evictable Whisper runtime.
|
|
89
93
|
- Content script: extract readable article text from the **rendered DOM** via Readability; also detect SPA URL changes.
|
|
94
|
+
- Direct provider adapters: OpenAI-compatible SSE, Anthropic Messages SSE, and Gemini SSE, normalized to the same summary/chat/tool-call contracts.
|
|
90
95
|
- Panel page streams SSE directly (MV3 service workers can be flaky for long-lived streams).
|
|
91
96
|
- **Daemon (local, autostart service)**
|
|
92
|
-
- HTTP server on `127.0.0.1
|
|
97
|
+
- HTTP server on `127.0.0.1` (default port `8787`).
|
|
93
98
|
- Token-authenticated API.
|
|
94
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.
|
|
95
101
|
|
|
96
102
|
## Data Flow
|
|
97
103
|
|
|
@@ -99,8 +105,8 @@ Dev (repo checkout):
|
|
|
99
105
|
2. Panel sends a “ready” message to the background (plus periodic “ping” heartbeats while open).
|
|
100
106
|
3. On nav/tab change (and auto enabled): background asks the content script to extract `{ url, title, text }` (best-effort).
|
|
101
107
|
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
|
|
103
|
-
6.
|
|
108
|
+
5. In Direct mode, background uses Gemini Nano for Auto without provider credentials, or calls the selected provider and returns the normalized summary/chat result to the panel.
|
|
109
|
+
6. In Daemon mode, background `POST`s payload to `/v1/summarize` with `Authorization: Bearer <token>`; the panel streams `/v1/summarize/<id>/events`.
|
|
104
110
|
|
|
105
111
|
## Auto Mode (URL + Page Text)
|
|
106
112
|
|
|
@@ -153,7 +159,11 @@ See `docs/media.md` for detection and transcript rules.
|
|
|
153
159
|
## Model Selection UX
|
|
154
160
|
|
|
155
161
|
- Settings:
|
|
156
|
-
-
|
|
162
|
+
- AI connection (Options → Runtime): Direct | Daemon.
|
|
163
|
+
- Direct provider and credential/base URL (Options → Runtime). `auto` uses the configured provider, otherwise Gemini Nano; an explicit provider prefix overrides the selection.
|
|
164
|
+
- Media/slide runtime (Options → Runtime): Browser | Daemon.
|
|
165
|
+
- Daemon port (Options → Runtime; default `8787`): must match the installed daemon port.
|
|
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.
|
|
157
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`).
|
|
158
168
|
- Language: `auto` (match source) or a tag like `en`, `de`, `pt-BR` (or free-form like “German”).
|
|
159
169
|
- Prompt override (advanced): custom instruction prefix (context + content still appended).
|
|
@@ -162,7 +172,7 @@ See `docs/media.md` for detection and transcript rules.
|
|
|
162
172
|
- Typography: font family (dropdown + custom), font size (slider).
|
|
163
173
|
- Advanced overrides (Options → Advanced tab).
|
|
164
174
|
- Leave blank to use daemon config/defaults; set a value to override.
|
|
165
|
-
- Chat
|
|
175
|
+
- Chat: enabled for a configured Direct provider or authenticated daemon.
|
|
166
176
|
- Summary timestamps (advanced): include `[mm:ss]` links in summaries for media when available (default on).
|
|
167
177
|
- Slides parallel (advanced): show summary first and extract slides in parallel (default on).
|
|
168
178
|
- Slides OCR text (advanced): allow OCR text as a slide text source (default off).
|
|
@@ -184,11 +194,12 @@ Problem: daemon must be secured; extension must discover and pair with it.
|
|
|
184
194
|
- Side panel “Setup” state:
|
|
185
195
|
- Generates token (random, 32+ bytes).
|
|
186
196
|
- Shows:
|
|
187
|
-
- `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)
|
|
188
198
|
- `summarize daemon status`
|
|
189
199
|
- “Copy command” button.
|
|
190
200
|
- Daemon stores paired tokens in `~/.summarize/daemon.json`.
|
|
191
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.
|
|
192
203
|
- If daemon unreachable or 401: show Setup state + troubleshooting.
|
|
193
204
|
|
|
194
205
|
## Daemon Endpoints
|
|
@@ -263,7 +274,7 @@ Notes:
|
|
|
263
274
|
## Daemon Autostart
|
|
264
275
|
|
|
265
276
|
- CLI commands:
|
|
266
|
-
- `summarize daemon install --token <token> [--port
|
|
277
|
+
- `summarize daemon install --token <token> [--port <PORT>]`
|
|
267
278
|
- Writes `~/.summarize/daemon.json`
|
|
268
279
|
- Installs platform autostart service; verifies `/health`
|
|
269
280
|
- `summarize daemon uninstall`
|
package/docs/commands/daemon.md
CHANGED
|
@@ -70,13 +70,13 @@ summarize daemon run --port 8787
|
|
|
70
70
|
## Options
|
|
71
71
|
|
|
72
72
|
`--port <n>`
|
|
73
|
-
: TCP port. Default `8787`.
|
|
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`).
|
|
77
77
|
|
|
78
78
|
`--dev`
|
|
79
|
-
: Install a service that runs `src/cli.ts` via
|
|
79
|
+
: Install a service that runs `src/cli.ts` via Node's native TypeScript support from the current repo. Useful while hacking on the daemon — don't ship it to users.
|
|
80
80
|
|
|
81
81
|
## HTTP endpoints
|
|
82
82
|
|
|
@@ -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,
|
|
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
|
|
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,
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steipete/summarize",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Link → clean text → summary.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"summarize": "./dist/cli.js",
|
|
@@ -43,20 +43,18 @@
|
|
|
43
43
|
"osc-progress": "^0.3.0",
|
|
44
44
|
"tokentally": "^0.1.1",
|
|
45
45
|
"undici": "8.4.1",
|
|
46
|
-
"@steipete/summarize-core": "0.
|
|
46
|
+
"@steipete/summarize-core": "0.20.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/node": "^24.13.1",
|
|
50
50
|
"@types/sanitize-html": "^2.16.1",
|
|
51
51
|
"@typescript/native-preview": "7.0.0-dev.20260609.1",
|
|
52
52
|
"@vitest/coverage-v8": "^4.1.8",
|
|
53
|
-
"esbuild": "^0.28.0",
|
|
54
53
|
"happy-dom": "^20.10.1",
|
|
55
54
|
"oxfmt": "0.54.0",
|
|
56
55
|
"oxlint": "^1.69.0",
|
|
57
56
|
"oxlint-tsgolint": "^0.23.0",
|
|
58
57
|
"rimraf": "^6.1.3",
|
|
59
|
-
"tsx": "^4.22.4",
|
|
60
58
|
"typescript": "^6.0.3",
|
|
61
59
|
"vitest": "^4.1.8"
|
|
62
60
|
},
|
|
@@ -71,9 +69,9 @@
|
|
|
71
69
|
"build:lib": "tsgo -p tsconfig.build.json",
|
|
72
70
|
"check": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm test:coverage",
|
|
73
71
|
"clean": "rimraf dist packages/core/dist",
|
|
74
|
-
"dev:cli": "
|
|
72
|
+
"dev:cli": "node --import ./scripts/register-typescript.mjs src/cli.ts",
|
|
75
73
|
"docs:build": "node scripts/build-docs-site.mjs",
|
|
76
|
-
"docs:list": "
|
|
74
|
+
"docs:list": "node --import ./scripts/register-typescript.mjs scripts/docs-list.ts",
|
|
77
75
|
"docs:serve": "bash scripts/docs-serve.sh",
|
|
78
76
|
"format": "oxfmt --write",
|
|
79
77
|
"format:check": "oxfmt --check",
|