From 512c109479abdba2e94f014c1cd5f2670bf1649d Mon Sep 17 00:00:00 2001 From: J Date: Thu, 29 Oct 2026 13:09:18 -0700 Subject: [PATCH 1/3] Meet the plugin directory's rules for mod code The directory's validation blocked the submission on two rules: - It accepts no settings call from a mod that keeps its engine for later, as every button and timer here does. The Timeline tab's Turn on summaries button called $.config.set; the offer now says how to turn summary lines on (set summaryModel to haiku) and has a Got it button that dismisses it. The config.set hook and the summary setting the module kept are gone too: a change in /config reloads the mod with the new value, so the setting is now a plain value read at load. - It reads $ only as $.noun.method(...) calls, whole. $.plugin.name, a property, becomes the mod's fixed name, and a $.fs.stat call that Prettier split across lines is kept on one line. The plugin README now also says the mod changes no settings, that the summary call goes through Claude Code's own model access and the mod reads no credential, what its hooks answer, and that /pad-export never replaces a file that isn't an earlier export. Version 0.4.0. --- CHANGELOG.md | 6 +- README.md | 21 ++-- sessionpad/.claude-plugin/plugin.json | 2 +- sessionpad/README.md | 7 +- sessionpad/hooks/register.ts | 40 ++----- sessionpad/src/drafts.ts | 2 +- sessionpad/src/prune.ts | 6 +- sessionpad/src/settings.ts | 27 ++--- sessionpad/src/ui.tsx | 49 ++------ sessionpad/tests/harness.tsx | 15 --- sessionpad/tests/offer.test.tsx | 165 ++++---------------------- 11 files changed, 76 insertions(+), 264 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30ad96c..00de483 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog -## Unreleased +## 0.4.0 (not released yet) + +### Changed + +- The Timeline tab's summary offer says how to turn summary lines on (set `summaryModel` to `haiku`) and has a **Got it** button, instead of a **Turn on summaries** button that changed the setting: the plugin directory accepts no settings call from a mod that keeps its engine for later, as every button and timer in this one does. A change in `/config` reloads the mod with the new value, as before. ### Added diff --git a/README.md b/README.md index bb28e2d..8a8cee1 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,15 @@ A Claude Code mod that gives every session a small notepad: a one-line headline > [!NOTE] > **Summary lines spend some of your Claude usage, so they are off until you turn them on.** With them on, the mod asks Claude Haiku for a one-line summary after each turn. A call sends about 500 tokens and gets about 20 back. At the API prices of October 2026 that is about $0.00006 a turn on Haiku 5.5 ($0.10 and $0.50 per million tokens in and out), or about 6 cents per 1,000 turns; if your Claude Code's `haiku` is Haiku 4.5 ($1 and $5), ten times that. On a Pro or Max plan it counts against your usage limits instead of costing money, and a single turn of your own conversation usually uses thousands of times as much. The Timeline tab's last line shows the running total. > -> To turn them on, press **Turn on summaries** in the Timeline tab, or set `summaryModel` to `haiku` in `/config` (or with `/plugin configure sessionpad@sessionpad`). To turn them off, set it back to `off`. Sessions already open in other windows may keep the old setting until they start again. While they are off, each turn's line in the Timeline is its prompt's first line, and the mod makes no model calls at all. +> To turn them on, set `summaryModel` to `haiku`: in a terminal session with `/config` or `/plugin configure sessionpad@sessionpad`, or from a shell (which serves the Desktop app's sessions too) with +> +> ```bash +> echo '{"summaryModel":"haiku"}' | claude plugin configure sessionpad@sessionpad --values-stdin +> ``` +> +> To turn them off, set it back to `off` the same way. Sessions already open in other windows may keep the old setting until they start again. While they are off, each turn's line in the Timeline is its prompt's first line, and the mod makes no model calls at all. -Status: alpha. Version 0.3.0, released 2026-10-29, with all four milestones built (notes, timeline, workspace, pruning). +Status: alpha. Version 0.4.0, not released yet; 0.3.0 was released 2026-10-29, with all four milestones built (notes, timeline, workspace, pruning). ## What it does @@ -128,8 +134,7 @@ That leaves your data. To delete it too, delete the mod's store file, the one na `claude plugin validate` reads the mod the way Claude Code will and lists every event it hooks and every API call it makes. For this version it reports, in part (the full report also lists the hooks that answer for themselves and the `$.state` values, and names the function behind each call): ``` -hooks: session.start, classic.SessionStart{source=clear|resume|fork}, - config.set{key="sessionpad.summaryModel"}, session.end, +hooks: session.start, classic.SessionStart{source=clear|resume|fork}, session.end, command.run{command=pad|sessionpad}, command.run{command=note|pad-note}, command.run{command=headline|pad-headline}, command.run{command=pad-export}, prompt.submit, turn.start, tool.call{tool=Edit|Write|NotebookEdit|Bash}, @@ -137,7 +142,7 @@ hooks: session.start, classic.SessionStart{source=clear|resume|fork}, tool.call{tool=mcp__sessionpad__notes_read}, ui.render{component=Pane, requestId=sessionpad}, ui.render{component=AbovePrompt} calls: $.clock.after, $.clock.every, $.clock.now, $.command.list, - $.command.register, $.config.set, $.env.get, $.fs.exists, $.fs.list, + $.command.register, $.env.get, $.fs.exists, $.fs.list, $.fs.read, $.fs.stat, $.fs.write, $.model.complete, $.process.run, $.session.cwd, $.session.id, $.session.repo, $.state.get, $.state.set, $.store.delete, $.store.get, $.store.keys, $.store.set, $.tool.register, @@ -146,7 +151,7 @@ env reads: CLAUDE_CONFIG_DIR, HOME, USERPROFILE env writes: nothing ``` -There is no `$.http`: the only thing that leaves your machine is the summary line's model call, described above. `$.process.run` runs `git` (read-only commands), `du -sk` and `rm` on the mod's own files. `$.config.set` changes only the mod's own `summaryModel`, when you press **Turn on summaries**, and the `config.set` hook only watches that one setting change. The hooks on `prompt.submit`, `turn.start` and the `tool.call` for Edit, Write, NotebookEdit and Bash only watch: each passes the event on and hands back what came back, untouched. Run `claude plugin validate sessionpad` in a clone to see the full report. +There is no `$.http`: the only thing that leaves your machine is the summary line's model call, described above. `$.process.run` runs `git` (read-only commands), `du -sk` and `rm` on the mod's own files. The mod changes no settings: the plugin directory accepts no settings call from a mod that, as this one does in its buttons and timers, keeps the engine for later, so the Timeline tab says how to turn summary lines on instead of doing it. The hooks on `prompt.submit`, `turn.start` and the `tool.call` for Edit, Write, NotebookEdit and Bash only watch: each passes the event on and hands back what came back, untouched. Run `claude plugin validate sessionpad` in a clone to see the full report. ## Development @@ -177,11 +182,11 @@ Decisions made while building, and places where this build of Claude Code (2.1.3 - **The input field sits under the headline**, above the notes, so it stays in view however many notes there are. - **The tools wait behind tool search**, as MCP tools do, so they cost nothing on requests that don't use them. Their names (`mcp__sessionpad__note`, `mcp__sessionpad__notes_read`) are enough for Claude to find them. - **Bold text uses `bold`**, which every surface draws; the Desktop app's table turns it into its own weight. -- **How it looks.** The pane follows the Cards design, `mockups/pane_as_drawn/02-cards.html` (the choice is recorded in `DECISION.md` beside it), drawn only with what a design test page (`/pad-demo`, removed once the look was settled) showed each surface can draw, as `mockups/sessionpad_pane/RENDERING.md` records. On Desktop the headline, each note, each day of the timeline and the current worktree sit on soft filled cards: a faint round border around a see-through grey fill (`rgba(128, 128, 128, 0.12)`), which reads as a light grey on the light pane and a dark grey on the dark one, so it follows the mode where an opaque raw color would turn unreadable in one of them; the Undo card is tinted red the same way. The cards were first filled with the theme's `promptBorder` shade, which drew too dark for the dim text and the buttons on them. A terminal would fill those with a mid grey block, so there a card is a grey frame, and the headline and the note being edited take the accent frame. The open tab is the app's primary pill on Desktop; a colored or bold label inside a Button draws only in a terminal, which shows the open tab that way. Hover can't reveal anything on Desktop and a terminal has none, so every button says what it does in its own label. An edited note's Save is its field's own submit button, since Desktop draws that button whatever else is beside it. Both fields, the note field and an edited note's, ask for three rows; 2.1.299, the oldest release the mod supports, has no `rows` for a field and draws them as one line. Times sit in a fixed-width column, since runs of spaces collapse on both surfaces. Text in the timeline wraps rather than being cut, and the pane is sized to `100%` of its body rather than a count of cells, since the Desktop app's proportional text doesn't keep to one. What the note field and an open note's field hold is kept as it is typed, so a redraw for any other reason (a note added from another window, say) puts it back; it is kept in the module rather than in `$.state`, because a `$.state` write draws the pane again and the Desktop app then draws the field afresh, which made its border flash at every keystroke. Emptying the note field after a note is added takes two draws, since the app sets a field's text only when the value it is drawn with changes and typing drew nothing: one with what the field holds, then, a quarter of a second later, one empty. A reload of the mod starts them over: it comes with an update of the mod and with a change to its settings (**Turn on summaries** is one), and then the note field empties, and a note open for editing stays open but shows its own text again, losing what was typed in it and not saved. +- **How it looks.** The pane follows the Cards design, `mockups/pane_as_drawn/02-cards.html` (the choice is recorded in `DECISION.md` beside it), drawn only with what a design test page (`/pad-demo`, removed once the look was settled) showed each surface can draw, as `mockups/sessionpad_pane/RENDERING.md` records. On Desktop the headline, each note, each day of the timeline and the current worktree sit on soft filled cards: a faint round border around a see-through grey fill (`rgba(128, 128, 128, 0.12)`), which reads as a light grey on the light pane and a dark grey on the dark one, so it follows the mode where an opaque raw color would turn unreadable in one of them; the Undo card is tinted red the same way. The cards were first filled with the theme's `promptBorder` shade, which drew too dark for the dim text and the buttons on them. A terminal would fill those with a mid grey block, so there a card is a grey frame, and the headline and the note being edited take the accent frame. The open tab is the app's primary pill on Desktop; a colored or bold label inside a Button draws only in a terminal, which shows the open tab that way. Hover can't reveal anything on Desktop and a terminal has none, so every button says what it does in its own label. An edited note's Save is its field's own submit button, since Desktop draws that button whatever else is beside it. Both fields, the note field and an edited note's, ask for three rows; 2.1.299, the oldest release the mod supports, has no `rows` for a field and draws them as one line. Times sit in a fixed-width column, since runs of spaces collapse on both surfaces. Text in the timeline wraps rather than being cut, and the pane is sized to `100%` of its body rather than a count of cells, since the Desktop app's proportional text doesn't keep to one. What the note field and an open note's field hold is kept as it is typed, so a redraw for any other reason (a note added from another window, say) puts it back; it is kept in the module rather than in `$.state`, because a `$.state` write draws the pane again and the Desktop app then draws the field afresh, which made its border flash at every keystroke. Emptying the note field after a note is added takes two draws, since the app sets a field's text only when the value it is drawn with changes and typing drew nothing: one with what the field holds, then, a quarter of a second later, one empty. A reload of the mod starts them over: it comes with an update of the mod and with a change to its settings (in `/config`, say), and then the note field empties, and a note open for editing stays open but shows its own text again, losing what was typed in it and not saved. - **The tab digits are the terminal's.** A digit presses a tab only while the pane holds the keyboard, which a terminal gives it with ctrl+x tab; elsewhere a digit goes to the prompt, so the Desktop app's tabs are drawn without them. - **The band's width.** The band refuses Claude Code's own row under a Box with a width, so the width is on the row that holds the headline and, on Desktop, the **Open pad** button. - **Open pad lives in the band.** A mod can't add a button to the app's toolbar or title bar: the places it can draw are the transcript's messages, the prompt's hints, the band above the prompt and panes. The band is the one always in view, so the button goes there, on every surface but the terminal. -- **Summaries are off by default.** `summaryModel` ships as `off`, since each call spends some of the person's usage and spending it should be their choice. The line Haiku writes is what makes the Timeline worth reading after a few days away, so the Timeline tab offers it once, with **Turn on summaries** and **Not now**; the answer is kept for every session under the store key `summary-offer`, which pruning leaves alone. Changing `summaryModel` in `/config` counts as an answer too, and the next turn follows it without a reload. +- **Summaries are off by default.** `summaryModel` ships as `off`, since each call spends some of the person's usage and spending it should be their choice. The line Haiku writes is what makes the Timeline worth reading after a few days away, so while it is off the Timeline tab says what it costs and how to turn it on, until **Got it** dismisses that for every session (the store key `summary-offer`, which pruning leaves alone). The tab can't turn it on itself: the plugin directory accepts no settings call from a mod that keeps its engine for later, as every button and timer here does. A change in `/config` reloads the mod with the new value. - **The pane opens only when asked:** with `/pad`, or with the band's **Open pad** button on Desktop. Opening it unasked at the start of a session with notes is still an open question. - `$.fs.write` creates missing directories, which the timeline file relies on. The home folder comes from `HOME`, else `USERPROFILE` on Windows, and `CLAUDE_CONFIG_DIR` wins over both. With none of them set, no timeline is kept and `/pad-export` asks for a path. - **A turn's prompt comes from `turn.start`**, not `prompt.submit` as the spec had it. `turn.start` carries the turn's id, the same one `turn.complete` carries, so the prompt and the end are paired exactly; `prompt.submit` also fires for prompts typed while a turn runs, which join that turn rather than starting one. diff --git a/sessionpad/.claude-plugin/plugin.json b/sessionpad/.claude-plugin/plugin.json index ec0dfa4..9f0062d 100644 --- a/sessionpad/.claude-plugin/plugin.json +++ b/sessionpad/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "sessionpad", "displayName": "Session Pad", - "version": "0.3.0", + "version": "0.4.0", "description": "A notepad for each Claude Code session: a headline and notes, a timeline of every turn, and the session's worktree and disk use, in a pane and above the prompt.", "author": { "name": "J" diff --git a/sessionpad/README.md b/sessionpad/README.md index b4e2562..1166937 100644 --- a/sessionpad/README.md +++ b/sessionpad/README.md @@ -21,7 +21,7 @@ Session Pad is a Claude Code mod: it runs in Claude Code 2.1.299 or later, in th ## What it runs, sends and stores - **Nothing leaves your machine unless you turn on summary lines.** The mod makes no network calls of its own. -- **Summary lines are off until you turn them on**, with **Turn on summaries** in the Timeline tab or the `summaryModel` setting. With them on, after each turn the mod asks Claude Haiku, on your own plan or API key, for a one-line summary. It sends the prompt's first 200 characters, the start of Claude's final answer (1,500 characters at most), the names of the files written (not their paths or contents) and the number of commands run. A call is about 500 tokens in and 20 out, roughly 6 cents per 1,000 turns on Haiku 5.5 at the API prices of October 2026 (ten times that if your Claude Code's `haiku` is Haiku 4.5); the Timeline tab shows the running total. +- **Summary lines are off until you turn them on**, with the `summaryModel` setting; the Timeline tab says how. With them on, after each turn the mod asks Claude Haiku, on your own plan or API key, for a one-line summary. It sends the prompt's first 200 characters, the start of Claude's final answer (1,500 characters at most), the names of the files written (not their paths or contents) and the number of commands run. A call is about 500 tokens in and 20 out, roughly 6 cents per 1,000 turns on Haiku 5.5 at the API prices of October 2026 (ten times that if your Claude Code's `haiku` is Haiku 4.5); the Timeline tab shows the running total. - **What it watches in the session:** it hooks each prompt you send, each turn's start and end, and each Edit, Write, NotebookEdit and Bash call, to write the timeline: the prompt's first 200 characters, the paths of the files written (up to 25 a turn) and how many commands ran. These hooks only observe: they pass every prompt and call on unchanged, and never block one. - **Programs it runs:** `git`, read-only, in the session's folder, for the branch and the worktrees; `du -sk` from your home folder (the root folder where there is none), in the background, to measure worktree sizes (the `measureDisk` setting turns this off); and `rm`, only on the mod's own timeline files, when old sessions are pruned (where there is no `rm`, as on Windows, those files are emptied instead). - **What it stores, all on your machine:** @@ -32,7 +32,10 @@ Session Pad is a Claude Code mod: it runs in Claude Code 2.1.299 or later, in th The two `~/.claude` folders are under `CLAUDE_CONFIG_DIR` instead when that is set. - **What it deletes:** a session nobody has opened for `retentionDays` (90 by default) loses its pad, its timeline file (and any copy of one put aside as unreadable) and its index row; sizes measured that long ago go too, and so do timeline files that old that no session in the index owns. Exports are never touched. -- **Settings it changes:** only its own `summaryModel`, when you press **Turn on summaries**. +- **Settings it changes:** none. It reads its own settings, and a change you make in `/config` reloads it. +- **The model call** goes through Claude Code's own model access, on the plan or API key the session already uses; the mod never reads a key, token or credential itself. +- **What its hooks change:** nothing that passes through them, with two exceptions that are the mod's own: its hooks on its two tools, `note` and `notes_read`, answer those tools, which is how they work, and its commands answer `/pad`, `/note`, `/headline` and `/pad-export`. +- **Files it writes outside its own folders:** only the `/pad-export` file you name. An export never replaces a file that isn't an earlier export: each one starts with the line ``, and a file without it is left alone. ## Settings diff --git a/sessionpad/hooks/register.ts b/sessionpad/hooks/register.ts index a377a94..545e3cb 100644 --- a/sessionpad/hooks/register.ts +++ b/sessionpad/hooks/register.ts @@ -19,7 +19,7 @@ import { readThisPad, setThisHeadline, } from "../src/pad"; -import { OFFER_KEY, summaryModelNow, useSummaryModel } from "../src/settings"; +import { OFFER_KEY } from "../src/settings"; import { forgetPaneEdits, readHeadline, showOffer } from "../src/state"; import { PRUNE_DELAY_MS, pruneOld, retentionDays } from "../src/prune"; import { forgetRenewals, touchSeen } from "../src/store"; @@ -93,7 +93,9 @@ export function describePad(pad: Pad): string { /** Command names another plugin or Claude Code itself already uses. */ async function takenCommands($: EngineInterface): Promise> { try { - const own = $.plugin.name; + // The manifest's name, which never changes; the directory's check reads + // only $.noun.method(...) calls, not a property such as $.plugin.name. + const own = "sessionpad"; const commands = await $.command.list(); const others = commands.filter( (one) => !(one.source === "plugin" && one.plugin?.split("@")[0] === own) @@ -382,12 +384,12 @@ function keepSeen($: EngineInterface, days: number): void { /** * Shows the Timeline tab's offer to turn summary lines on while they are off - * and nobody has answered it yet; never fails the caller. + * and nobody has dismissed it yet; never fails the caller. */ -async function refreshOffer($: EngineInterface): Promise { +async function refreshOffer($: EngineInterface, isOff: boolean): Promise { try { const isAnswered = (await $.store.get(OFFER_KEY)) !== undefined; - await showOffer($, summaryModelNow() === null && !isAnswered); + await showOffer($, isOff && !isAnswered); } catch { // No offer this time: the store couldn't say whether it was answered. } @@ -409,12 +411,9 @@ export const register: Register = (on, options) => { const showBand = options.showBand !== false; setMeasureDisk(options.measureDisk !== false); const retention = retentionDays(options.retentionDays); - useSummaryModel(summaryModel(options.summaryModel)); + // A change to the setting in /config reloads the module with it. const timeline: TimelineSettings = { - // Read at each turn: the Timeline tab or /config may turn summaries on. - get summaryModel() { - return summaryModelNow(); - }, + summaryModel: summaryModel(options.summaryModel), cap: timelineCap(options.timelineCap), }; // The session id whose pad is loaded, to carry the pad across /clear and @@ -449,7 +448,7 @@ export const register: Register = (on, options) => { to: "debug", }); } - await refreshOffer($); + await refreshOffer($, timeline.summaryModel === null); // A new session or a reload: no `du` from before is still this module's. forgetMeasuring(); forgetRenewals(); @@ -517,29 +516,12 @@ export const register: Register = (on, options) => { // The Undo card and an open note belonged to the pad left behind, so // they go too, should a host keep $.state. await forgetPaneEdits($).catch(() => undefined); - await refreshOffer($); + await refreshOffer($, timeline.summaryModel === null); await showWorkspace($); return next(e); } ).catch(($, e, next) => next(e)); - // The person set summaryModel in /config: the next turn follows it, and the - // Timeline tab stops offering, since they have chosen. The key is spelled - // out (SUMMARY_CONFIG_KEY's value) so validate can read the matcher. - on("config.set", { key: "sessionpad.summaryModel" }, async ($, e, next) => { - const result = await next(e); - if (result.deny === undefined) { - useSummaryModel(summaryModel(result.value)); - try { - await showOffer($, false); - await $.store.set(OFFER_KEY, { at: await $.clock.now() }); - } catch { - // The setting is written either way; only the offer's answer is lost. - } - } - return result; - }).catch(($, e, next) => next(e)); // replays the result next settled to - // Observe only, and instant: every session.end hook shares 1.5 seconds. on("session.end", ($, e, next) => { endedId = e.sessionId; diff --git a/sessionpad/src/drafts.ts b/sessionpad/src/drafts.ts index f6df38c..f375122 100644 --- a/sessionpad/src/drafts.ts +++ b/sessionpad/src/drafts.ts @@ -5,7 +5,7 @@ // The pane reads these while drawing, so a redraw for any other reason (a // note added from another window, say) puts back what was typed. A reload // of the mod starts them over: it comes with an update of the mod, and with -// a change to its settings (Turn on summaries is one). The note field then +// a change to its settings in /config. The note field then // empties, and a note open for editing stays open but shows its own text // again, losing what was typed in it and not saved. diff --git a/sessionpad/src/prune.ts b/sessionpad/src/prune.ts index 410877f..f5deade 100644 --- a/sessionpad/src/prune.ts +++ b/sessionpad/src/prune.ts @@ -219,9 +219,9 @@ async function isStillUnseen( const row = parseIndex(await $.store.get(INDEX_KEY))[id]; if (row !== undefined && row.lastSeen >= before) return false; if (timelineDir === null) return true; - const file = await $.fs - .stat(`${timelineDir}/${fileName(id)}.json`) - .catch(() => undefined); + // Kept on one line: the directory's check reads $.noun.method(...) whole. + const path = `${timelineDir}/${fileName(id)}.json`; + const file = await $.fs.stat(path).catch(() => undefined); return file === undefined || file.mtimeMs < before; } diff --git a/sessionpad/src/settings.ts b/sessionpad/src/settings.ts index 88a8014..5dbd8f7 100644 --- a/sessionpad/src/settings.ts +++ b/sessionpad/src/settings.ts @@ -1,23 +1,12 @@ -// The summary setting as this module runs with it: read when the module -// loads, and changed when the person turns summaries on from the Timeline tab -// or changes the setting in /config, so the next turn follows it without a -// reload. - -/** The setting's key as `$.config` names it. */ -export const SUMMARY_CONFIG_KEY = "sessionpad.summaryModel"; +// The summary setting's offer. The mod never changes the setting itself (the +// plugin directory accepts no settings call from a mod that keeps its engine +// for later, as every button and timer here does): the Timeline tab says how +// to turn summary lines on, and a change in /config reloads the mod with the +// new value. /** - * The store key that records that the person answered the Timeline tab's - * offer, or changed the setting themselves: shared by every session, so the - * offer is made once, and never pruned. + * The store key that records that the person dismissed the Timeline tab's + * offer: shared by every session, so the offer is made once, and never + * pruned. */ export const OFFER_KEY = "summary-offer"; - -let model: string | null = null; - -/** The model that writes summary lines now, or null while they are off. */ -export const summaryModelNow = (): string | null => model; - -export function useSummaryModel(next: string | null): void { - model = next; -} diff --git a/sessionpad/src/ui.tsx b/sessionpad/src/ui.tsx index e9c454f..7b6c6dd 100644 --- a/sessionpad/src/ui.tsx +++ b/sessionpad/src/ui.tsx @@ -74,8 +74,7 @@ import { showOffer, showTab, } from "./state"; -import { OFFER_KEY, SUMMARY_CONFIG_KEY, useSummaryModel } from "./settings"; -import { summaryModel } from "./summary"; +import { OFFER_KEY } from "./settings"; import { RECENT_COUNT } from "./timeline"; import { formatSize, isMeasureDisk, scheduleRefresh } from "./workspace"; @@ -576,36 +575,8 @@ export function turnMarks( .join(" ยท "); } -/** - * Turns summary lines on from the Timeline tab's offer, as the person would - * in /config, and records the answer so the offer isn't made again. - */ -async function pressSummariesOn($: EngineInterface): Promise { - await guarded($, "turning summary lines on", async () => { - const result = await $.config.set({ - key: SUMMARY_CONFIG_KEY, - value: "haiku", - }); - if (result.deny !== undefined) { - $.ui.toast(`sessionpad: summary lines stay off: ${result.deny}`); - return; - } - // This module's own change: its config.set hook doesn't see it. What - // was written counts, since another plugin's hook may have changed it. - const model = summaryModel(result.value); - useSummaryModel(model); - await showOffer($, false); - await rememberAnswer($); - $.ui.toast( - model === null - ? "sessionpad: summary lines stay off: the setting was written as off." - : `Summary lines are on: ${model} writes one after each turn. Set summaryModel to off in /config to stop.` - ); - }); -} - /** Hides the offer, here and in every other session. */ -async function pressNotNow($: EngineInterface): Promise { +async function pressGotIt($: EngineInterface): Promise { await guarded($, "hiding the offer", async () => { await showOffer($, false); await rememberAnswer($); @@ -662,7 +633,9 @@ async function renderTimelineTab( Turned on, Haiku writes one line after each turn: about 500 tokens in - and 20 out, from your plan's usage or your API key. + and 20 out, from your plan's usage or your API key. To turn them on, set + summaryModel to haiku: with /config in a terminal session, or from a + shell as the README shows.