repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

terminal-notifier: support for `notify-send` on lnx

ae90fa5406fb9ed2243a144061471abff243c6f5

Review <review@example.invalid> ·

unsigned

Browse filesCompare with HEAD

Changed files (4)

CHANGELOG.md

Modified
2 2 # Changelog
4 4 ## Unreleased
6 -- Add the `rtk` extension for rewriting Pi `bash` tool calls through `rtk rewrite`
7 - when `rtk >= 0.23.0` is available
8 -- Warn once and keep `rtk` idle when the RTK binary is missing or too old
9 -- Add local `rtk summary` fallbacks only for noisy diagnostic commands
10 - (`journalctl`, `ps`, `systemctl status`, and selected `hyprctl` queries),
11 - without auto-wrapping `mise` gate commands
12 -- Suppress leaks assignment-span false positives on common programmer-noun keys
13 - (`seed`, `id`, `name`, `count`, `type`, `value`, `path`, `key`, `ts`, `time`,
14 - `date`, `idx`, `mode`, `flag`, `opts`, `params`, `args`, `options`, `label`,
15 - `field`, `tag`, `node`, `host`, `port`, `version`); heuristic only, does not
16 - affect dotenv/env learning
17 -- Deduplicate leaks `ctx.ui.notify` per-process via `notifiedPlaceholders` so
18 - re-notification of the same redacted value across requests is suppressed
19 -- Group within-notice redactions by `(path, labels)` and render duplicates as
20 - `×N` so one notice shows distinct secrets, not every occurrence
21 -- Classify goal extension API errors into kinds (context_overflow, transport,
22 - server, rate_limit, stream, parse, auth, quota, bad_request, unknown) with
23 - human-readable short/detail/hint and retryability
24 -- Let Pi core own retry/compaction for goal errors: defer while Pi retry is
25 - pending, pause after retry exhaustion, and pause immediately when Pi retry is
26 - disabled or unavailable
27 -- Avoid mutating goal state for context-overflow errors while Pi core retry is
28 - pending
29 -- Make Ctrl+C cancel an active goal and abort the current Pi run like Escape
30 -- Prune goal transcript rows and persisted assistant failure messages from active
31 - goal LLM context so reload/resume cannot resurrect failed retry payloads
32 -- Prune failed assistant tool-use/tool-result cascades from active goal LLM
33 - context before assistant error messages
34 -- Pause the goal loop on terminal errors (auth 401/403, quota,
35 - bad_request 400, `stopReason === "aborted"`) and after Pi core retry exhaustion
36 -- Derive user-facing `lastReason` and notifications from the classifier instead
37 - of raw API JSON, while keeping raw errors in `goal-event` entries for debugging
38 -- Bump TypeScript dev dependency to 6.0.3
39 -- Reduce Vitest slow-test overhead by removing a non-terminating goal harness
40 - retry case, shrinking leaks cap-loop tests, reusing harness sessions, and using
41 - in-process extension factories where available
42 -- Reuse Vitest fork workers across files with `isolate: false` and cap fork
43 - workers at 3 to reduce full-suite import overhead and process contention while
44 - preserving fork isolation
45 -- Use the Vitest minimal reporter to reduce full-suite output overhead
46 -- Convert simple harness smoke tests for angel, tldr, terse, usage, cwd, cost,
47 - context-size, and builtin-tools to in-process extension factories
48 -- Speed llmiterate watcher tests by reducing directory refresh debounce to 50ms
49 - and tightening fixed sleeps while keeping real `fs.watch` coverage
50 -- Speed llmiterate RPC tests with per-test worker/temp cleanup and concurrent
51 - isolated RPC cases
52 -- Merge diff-review SSR spike coverage into server HTML tests and align the
53 - direct SSR preload smoke with the production `parsePatchFiles` +
54 - `preloadFileDiff` path
55 -- Speed nu-bang execution and completion tests by using non-login Nushell
56 - subprocesses, avoiding a duplicate escaped-prefix completion call, and loading
57 - the harness smoke test through the exported extension factory
58 -- Further speed nu-bang real-world tests with a shared seeded cwd, concurrent
59 - isolated cases, and batched pure Nushell pipeline coverage
60 -- Update brainstorming companion test coverage for the current arrow-function
61 - `toggleSelect` output
62 -- Render TLDR widget as icon-prefixed padded lines instead of a boxed panel
63 -- Render expanded goal widget as icon-prefixed wrapped lines while keeping the
64 - compact/collapsed goal widget to one width-truncated line
65 -- Preserve goal elapsed time across criteria/mode changes and pause/resume, keep
66 - retryable errors running, and clear stale errors on resume or successful retry
67 - turns
68 -- Accumulate judge verdicts in the goal widget without adding judge/internal
69 - errors to verdict history
70 -- Keep visible goal judge/event reasons untruncated while preserving internal
71 - bounded context snippets
72 -- Expand and autocomplete prompt templates when starting goals with
73 - `/goal /template args`
74 -- Rename `autoresearch` extension package/slug to `tune` and slash command to
75 - `/tune`
76 -- Move tune session state to `.pi/tune/`
77 -- Restyle tune dashboard with the Nugu diff-review palette, theme selector,
78 - cards, side drawer, chart, and live session.jsonl refresh
79 -- Fix tune dashboard runs-table sticky header positioning with measured topbar
80 - height, overflow-visible table panels, and chart-only clipping so the header
81 - stays below the topbar while scrolling
82 -- Add jj-native tune keep/discard flow and exclusive tune repo lock
83 -- Render clamped `run_experiment` timeout values consistently with execution
84 - semantics
85 -- Show captured checks output when checks time out
86 -- Keep exported tune dashboard server routes pointed at the latest export files
87 -- Make `/tune clear` delete only `session.jsonl`, reset last run duration, and
88 - migrate legacy tune state before clearing
89 -- Migrate legacy tune state before tune start and dashboard export flows
90 -- Add `.pi/tune/config.json` `autoResumeLimit` to cap automatic tune resume turns;
91 - default, null, missing, and invalid values mean unlimited
92 -- Make tune dashboard and current-best reporting ignore discarded runs, using kept
93 - runs only
94 -- Require tune ASI log entries to include a `next_action_hint` for dashboard and
95 - compaction guidance
96 -- Add `wiki` as the research and persistent knowledge-base skill
97 -- Make `research` a compatibility alias for the `wiki` workflow
98 -- Route new research evidence to `~/Notes/Wiki/raw-sources/` and treat
99 - `~/.pi/research/` as legacy cache
100 -- Expand `wiki` ingest for web pages, repos, archives, files, directories,
101 - pasted text, and legacy research migration
102 -- Add Linux and Linux userland skills with safe read-only diagnosis, XDG-aware
103 - user config guidance, and root-escalation boundaries
104 -- Add the `ironbar` skill for configuring Ironbar, GTK4 styling, CLI/IPC,
105 - Ironvars, modules, and official reference lookup
106 -- Add the `wtf` feedback prompt for capturing agent behavior surprises
107 -- Add root live terminal and browser test prompts split from extension testing
108 -- Tighten `checkhealth` trigger wording and remove `roadmap` as a trigger
109 -- Change the goal widget expanded-mode shortcut from `ctrl+shift+g` to `alt+g`
110 -- Trim and harden the tmux skill with pane-ID tracking, readiness gates, safe
111 - input helpers, polluted-pane quarantine, and bounded stop guidance
112 -- Remove obsolete tmux agent workflow and tooling migration planning notes
113 -- Remove stale provider test prompt templates that hardcoded an old `/tmp`
114 - findings file
115 -- Stop exporting prompt templates from the goal extension package
116 -- Convert brainstorming visual companion server and launchers from
117 - CommonJS/shell scripts to cross-platform ESM `.mjs` Node scripts
118 -- Add deterministic brainstorming companion commands for start/stop, choice
119 - screens, custom screens, waiting screens, event listing/clearing, waiting for
120 - browser choices, and per-screen event reset
121 -- Add brainstorming `open-choice` and `open-screen` for first visual choices
122 - that open the browser and wait for the click in one command
123 -- Reject empty brainstorming visual companion starts and direct
124 - `start-server.mjs` CLI use
125 -- Cap brainstorming visual wait timeouts at 30000ms
126 -- Add brainstorming `ask-choice` to write a fresh choice screen, clear old
127 - events, wait for browser click, and return the selected event without terminal
128 - reply
129 -- Add brainstorming `ask-screen --html-file` for custom clickable mockups that
130 - wait for browser choice without shell heredocs or terminal replies
131 -- Add `write-screen --html-file` and `companion.mjs --help` for deterministic
132 - brainstorming visual workflows
133 -- Fix brainstorming visual event clearing to avoid delayed server-side races
134 - after new screens
135 -- Add brainstorming companion lifecycle cleanup with owner PID tracking, global
136 - server registry, orphan cleanup, and browser disconnect timeout
137 -- Shorten the brainstorming browser-visuals consent prompt to a terse opt-in
138 - question
139 -- Make brainstorming visual mode sticky after the first browser mockup and
140 - require browser mockups for follow-up UI shape, placement, control
141 - presentation, composer, and terminal behavior choices
142 -- Point brainstorming visual companion guide references at the explicit skill
143 - path
144 -- Add the `web-ui` skill for standalone HTML/CSS UI, visual mockups, dashboards,
145 - landing pages, and no-build tools with minimal vanilla JS and no default
146 - frameworks
147 -- Harden `web-ui` guidance to require complete standalone HTML documents,
148 - representative one-screen first passes, root CSS tokens, mandatory
149 - `:focus-visible`, and bounded static slices for complex viewers, traces, and
150 - graphs
151 -- Route custom brainstorming HTML/CSS mockups through `web-ui` guidance when
152 - available
153 -- Add brainstorming visual companion Node test coverage for the human-agent
154 - browser workflow, reloads, events, assets, screen rendering, lifecycle
155 - cleanup, help output, file-backed screens, deterministic open commands,
156 - timeout caps, and `npm run test:brainstorming`
157 -- Add `mise run clean` for generated caches and scratch artifacts, clearing
158 - `.demo/` contents while keeping the directory and removing `node_modules`,
159 - `__pycache__`, `.ruff_cache`, and `extensions/diff-review/static/`
160 -- Move static extension checks fully under `mise run check`, remove the npm
161 - `check` script, and run skill checks, static-check regression tests, and
162 - extension checks directly from `mise.toml`
163 -- Add script-local `scripts/extensions.json` `secretScanIgnore` support for exact
164 - repo-relative static secret-scan ignore paths, with regression coverage
165 -- Make web extension tool availability checks cross-platform without requiring
166 - Unix `which`, handle Windows `.cmd`/`.bat` shims with spaces, avoid stale
167 - negative PATH cache entries, notify missing required/optional tools at the
168 - right severity, and add coverage
169 -- In `web` search, aggregate all backend failures into a single `info`-level
170 - notification instead of noisy per-fallback warnings; only notify when every
171 - backend fails
172 -- Preserve original `web` search backend failures with `AggregateError` and
173 - sanitize/truncate aggregate notification text
174 -- Add `web` search fallback regression coverage for silent fallback success,
175 - all-backend failure notification, DDG captcha handling, and preserved errors
176 -- Simplify Z.AI web search API errors to preserve code, status, and raw message
177 - without provider-specific classification buckets
178 -- Replace `zai/glm-5.1` and `kimi/kimi-for-coding` example references with
179 - `openai-codex/gpt-5.5`
180 -- Make web and super tool widgets compact by default, gate previews, analyses,
181 - and result lists behind expansion, and use `app.tools.expand` key hints
182 -- Handle benign stdin `EPIPE` when web extension helper commands exit before
183 - consuming input
184 -- Add the `mode` extension for session-local mode switching with `/mode`,
185 - prompt/tool filtering, model and thinking-level application, branch restore,
186 - and config reload coverage
187 -- Use Vitest v8 coverage for the mode 100% coverage gate so `npm ci` and
188 - coverage runs agree
189 -- Add a notes extension design for a manual branch-local prompt parking lot with
190 - `/note add/send/edit/rm/clear`, autocomplete, `alt+n`, a compact/expanded
191 - widget restored compact on session start when notes exist, branch-local custom
192 - session entries that survive compaction without entering model context, and
193 - raw follow-up-only `/note send <id>` activation with no steer mode
194 -- Add a task-by-task notes extension implementation plan covering package
195 - skeleton, session replay, widget rendering, edit/remove/clear/send commands,
196 - autocomplete, branch-local tests, and repository verification
197 -- Implement the notes extension with branch-local custom session entries,
198 - compact/expanded widget rendering, `/note add/send/edit/rm/clear`, note-id
199 - autocomplete previews, and harness coverage
200 -- Harden `llmiterate` stale-run detection and re-queueing: when markers shift
201 - due to file changes or earlier completions, invalidated runs fail fast with
202 - "marker span changed before background agent start", same-file agent shifts
203 - avoid stale error spam, and watcher rescans re-detect markers at new positions
204 - for one-by-one resolution
205 -- Always warm the `llmiterate` RPC worker on `/llmiterate on` and reload, with no
206 - warmup config, auto mode, or idle-kill policy
207 -- Fix `llmiterate` README formatting so repository lint passes
208 -- Harden leaks redaction with quoted dotenv inline comments, broader provider
209 - token patterns, captured-group index handling, invalid regex stats, and
210 - cycle/bigint-safe payload redaction
211 -- Precompile leaks built-in regexes once and add regression coverage for modern
212 - provider tokens, dotenv parsing, invalid regex status, duplicate capture
213 - offsets, and cyclic payloads
214 -- Implement the spec-aligned leaks redaction engine with in-memory placeholder
215 - mapping, local placeholder restoration, copied non-symlinked demo fixtures, no
216 - external tmp demo path references, and no legacy runtime persistence settings
217 -- Add leaks direct, edge, safety, and real Pi/LLM validation tests plus a 100%
218 - coverage gate
219 -- Use Vitest Istanbul coverage for the leaks 100% coverage gate so `npm ci` and
220 - coverage runs agree
221 -- Document that leaks protects provider-bound plaintext exposure only and is not
222 - an exfiltration guard, sandbox, DLP layer, or permission system
223 -- Clarify that leaks may restore/materialize plaintext locally for normal Pi tool
224 - workflows; the boundary is provider exposure, not local tool execution
225 -- Add a leaks spec covering brutal settings, automatic dotenv/env exact-match
226 - sources, false-positive policy, and non-goals
227 -- Add a spec-aligned leaks implementation plan in `extensions/leaks/PLAN.md`
228 - with ordered V0-V9 validation coverage, an executable V0 scope/authority
229 - ledger test, and a normative requirement ledger
230 -- Plan leaks placeholders as `__LEAK_<TAG>[_<TAG>...]_<HMAC12>[_N]__`, using
231 - metadata-rich capped tags without secret length/shape encoding, preserving the
232 - smallest secret-bearing spans in credentialed URLs, sensitive query params,
233 - headers, and cookies while treating usernames and other metadata as non-secret
234 -- Clarify leaks URL/config handling: uncredentialed `DATABASE_URL`, `REDIS_URL`,
235 - and `MONGO_URL` values are not secret by key alone; generic JSON/YAML/TOML
236 - parsing is out of scope unless quoted key/value patterns prove necessary
237 -- Plan private-key redaction around whole-block replacement with labels derived
238 - from standard PEM, OpenSSH, PGP, and age secret-key markers
239 -- Clarify leaks public keys and certificates are visible, shell text is handled
240 - by component detectors instead of shell parsing, bare entropy is visible unless
241 - it matches a high-confidence shape or learned sensitive value, JWTs redact as
242 - whole tokens, and provider-specific IDs redact when reliable patterns exist
243 -- Keep one stable leaks placeholder per secret value after first mapping, order
244 - first-seen tags by semantic priority, cap placeholder tags, and keep mappings
245 - memory-only
246 -- Define leaks custom regex capture semantics and UX: no groups redact full
247 - match, group 1 redacts group 1, extra groups warn, faulty regex input never
248 - breaks startup or provider requests, missing labels load as `CUSTOM_REGEX` with
249 - warning, labels must match `[A-Z0-9_]+`, and `/leaks status` reports safe
250 - warning and error counts/details
251 -- Clarify leaks false-positive policy: redact values only, never environment or
252 - CI references, and never redact names, hosts, domains, IDs, or internal
253 - metadata unless a high-confidence provider-specific pattern or custom regex
254 - matches
255 -- Exclude homomorphic encryption, symbolic secret transform tools, and semantic
256 - secret-byte editing from leaks; exact placeholder copy, move, rename, and
257 - preserve workflows should keep working locally
258 -- Define leaks general requirements: transparent normal Pi workflows except
259 - secret-internal transformations, high performance and correctness on every
260 - message, fail-open tolerance for faulty regex input, and human-friendly status
261 - and notifications without exposing secrets
262 -- Report leaks provider redaction paths, labels, and placeholders in safe
263 - metadata and show unbounded path/label details in redaction notifications
6 +- Add the `gestalt` skill for visual-organization audits of UIs, diagrams,
7 + screenshots, dashboards, hierarchy, grouping, and scan-path issues
265 9 ## 0.0.3

extensions/terminal-notifier/README.md

Modified
43 43 Suppresses agent completion notifications while terminal is focused.
45 45 Agent completion notifications include status, elapsed time when available,
46 -project basename, and model name/provider/id when available.
46 +project basename, Git branch, session name, model name/provider/id, and a bounded
47 +last user prompt snippet when available.
48 49 Assistant `stopReason` maps to notification status:

extensions/terminal-notifier/__tests__/harness.test.ts

Modified
1 1 import path from "node:path";
2 2 import { afterEach, describe, expect, it } from "vitest";
3 3 import { createTestSession, type TestSession } from "../../../test/harness";
4 -import { linuxNotifySendArgs, selectNotificationBackend } from "../index";
4 +import {
5 + agentDoneNotification,
6 + linuxNotifySendArgs,
7 + selectNotificationBackend,
8 +} from "../index";
6 10 describe("terminal-notifier native notifications", () => {
7 11 it("uses notify-send on Linux when available", () => {
50 +describe("terminal-notifier payload", () => {
51 + it("includes useful bounded context in completion body", () => {
52 + expect(
53 + agentDoneNotification(
54 + {
55 + messages: [
56 + { role: "user", content: "implement richer Pi notifications" },
57 + { role: "assistant", stopReason: "stop" },
58 + ],
59 + },
60 + {
61 + cwd: "/home/oli/Workspace/dotfiles/pi-ext",
62 + model: { name: "GPT-5.5", provider: "openai", id: "gpt-5.5" },
63 + durationMs: 45_000,
64 + branch: "trunk",
65 + sessionName: "notifier work",
66 + },
67 + ),
68 + ).toEqual({
69 + title: "Pi done",
70 + message:
71 + "Ready after 45s • pi-ext • trunk • notifier work • GPT-5.5\n↳ implement richer Pi notifications",
72 + severity: "info",
73 + });
74 + });
76 + it("bounds and normalizes prompt snippets", () => {
77 + const notification = agentDoneNotification(
78 + {
79 + messages: [
80 + {
81 + role: "user",
82 + content: [
83 + {
84 + type: "text",
85 + text: "first line\nsecond line with enough text to need truncation here",
86 + },
87 + ],
88 + },
89 + { role: "assistant", stopReason: "stop" },
90 + ],
91 + },
92 + { durationMs: 1000 },
93 + );
95 + expect(notification.message).toBe(
96 + "Ready after 1s\n↳ first line second line with enough text to need truncation…",
97 + );
98 + });
99 +});
46 101 describe("terminal-notifier pi-test-harness", () => {
47 102 let t: TestSession | undefined;

extensions/terminal-notifier/index.ts

Modified
16 16 import { execFile, spawnSync } from "node:child_process";
17 +import { existsSync, readFileSync, statSync } from "node:fs";
18 +import { dirname, isAbsolute, join, resolve } from "node:path";
17 19 import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
18 20 import * as focus from "./focus.js";
55 57 function basename(path: string): string {
56 - return path.replace(/\/+$/, "").split("/").pop() || path;
58 + return (
59 + path
60 + .replace(/[/\\]+$/, "")
61 + .split(/[/\\]/)
62 + .pop() || path
63 + );
59 -function agentDoneNotification(
66 +function textContent(value: unknown): string {
67 + if (typeof value === "string") return value;
68 + if (!Array.isArray(value)) return "";
69 + return value
70 + .map((part) => {
71 + const item = part as { type?: unknown; text?: unknown } | undefined;
72 + return item?.type === "text" && typeof item.text === "string"
73 + ? item.text
74 + : "";
75 + })
76 + .filter(Boolean)
77 + .join(" ");
80 +function lastUserPrompt(messages: unknown[]): string {
81 + for (let i = messages.length - 1; i >= 0; i--) {
82 + const message = messages[i] as
83 + | { role?: unknown; content?: unknown }
84 + | undefined;
85 + if (message?.role !== "user") continue;
86 + const text = compact(textContent(message.content));
87 + if (text) return text;
88 + }
89 + return "";
92 +function promptSnippet(messages: unknown[]): string {
93 + const text = lastUserPrompt(messages);
94 + const max = 58;
95 + if (text.length <= max) return text;
96 + return `${text.slice(0, max).trimEnd()}…`;
99 +function formatMessage(
100 + head: string,
101 + context: string[],
102 + prompt: string,
103 +): string {
104 + const line = [head, ...context].filter(Boolean).join(" • ");
105 + return prompt ? `${line}\n↳ ${prompt}` : line;
108 +export function currentGitBranch(cwd: string): string {
109 + try {
110 + let dir = resolve(cwd);
111 + while (true) {
112 + const dotGit = join(dir, ".git");
113 + if (existsSync(dotGit)) {
114 + const stat = statSync(dotGit);
115 + const gitDir = stat.isDirectory()
116 + ? dotGit
117 + : resolveGitFile(dotGit, dir);
118 + const head = readFileSync(join(gitDir, "HEAD"), "utf8").trim();
119 + if (head.startsWith("ref: refs/heads/")) {
120 + return head.slice("ref: refs/heads/".length);
122 + return /^[0-9a-f]{7,}$/i.test(head) ? head.slice(0, 7) : "";
124 + const parent = dirname(dir);
125 + if (parent === dir) return "";
126 + dir = parent;
128 + } catch {
129 + return "";
133 +function resolveGitFile(dotGit: string, worktreeDir: string): string {
134 + const text = readFileSync(dotGit, "utf8").trim();
135 + const prefix = "gitdir:";
136 + if (!text.toLowerCase().startsWith(prefix)) return dotGit;
137 + const target = text.slice(prefix.length).trim();
138 + return isAbsolute(target) ? target : resolve(worktreeDir, target);
141 +export function agentDoneNotification(
60 142 event: { messages?: unknown[] },
61 143 meta: {
62 144 cwd?: string;
63 145 model?: { provider?: string; id?: string; name?: string };
64 146 durationMs?: number;
147 + branch?: string;
148 + sessionName?: string;
66 150 ): AgentDoneNotification {
67 151 const messages = Array.isArray(event.messages) ? event.messages : [];
68 152 const duration = formatDuration(meta.durationMs);
69 - const project = meta.cwd ? `project: ${basename(meta.cwd)}` : "";
70 153 const model = meta.model
71 154 ? compact(meta.model.name) ||
72 155 [compact(meta.model.provider), compact(meta.model.id)]
73 156 .filter(Boolean)
74 157 .join("/")
76 - const suffix = [project, model].filter(Boolean).join(" • ");
159 + const context = [
160 + meta.cwd ? basename(meta.cwd) : "",
161 + compact(meta.branch),
162 + compact(meta.sessionName),
163 + model,
164 + ].filter(Boolean);
165 + const prompt = promptSnippet(messages);
78 167 for (let i = messages.length - 1; i >= 0; i--) {
79 168 const message = messages[i] as
84 173 if (message.stopReason === "aborted") {
85 174 return {
86 175 title: "Pi aborted",
87 - message: [`Stopped${duration ? ` after ${duration}` : ""}`, suffix]
88 - .filter(Boolean)
89 - .join(" • "),
176 + message: formatMessage(
177 + `Stopped${duration ? ` after ${duration}` : ""}`,
178 + context,
179 + prompt,
180 + ),
90 181 severity: "warning",
95 186 const detail = compact(message.errorMessage);
96 187 return {
97 188 title: "Pi error",
98 - message: [
189 + message: formatMessage(
99 190 `Failed${duration ? ` after ${duration}` : ""}`,
100 - detail,
101 - suffix,
102 - ]
103 - .filter(Boolean)
104 - .join(" • "),
191 + [detail, ...context],
192 + prompt,
193 + ),
105 194 severity: "error",
109 198 return {
110 199 title: "Pi done",
111 - message: [`Ready${duration ? ` after ${duration}` : ""}`, suffix]
112 - .filter(Boolean)
113 - .join(" • "),
200 + message: formatMessage(
201 + `Ready${duration ? ` after ${duration}` : ""}`,
202 + context,
203 + prompt,
204 + ),
114 205 severity: "info",
118 209 return {
119 210 title: "Pi done",
120 - message: [`Ready${duration ? ` after ${duration}` : ""}`, suffix]
121 - .filter(Boolean)
122 - .join(" • "),
211 + message: formatMessage(
212 + `Ready${duration ? ` after ${duration}` : ""}`,
213 + context,
214 + prompt,
215 + ),
123 216 severity: "info",
282 375 agentStartedAt === undefined
283 376 ? undefined
284 377 : Date.now() - agentStartedAt,
378 + branch: currentGitBranch(ctx.cwd),
379 + sessionName: pi.getSessionName(),
286 381 notify(title, message, severity, backend);