@oh-my-pi/pi-coding-agent 15.10.0 → 15.10.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 (176) hide show
  1. package/CHANGELOG.md +75 -1
  2. package/dist/types/cli/dry-balance-cli.d.ts +15 -1
  3. package/dist/types/commit/analysis/conventional.d.ts +2 -2
  4. package/dist/types/commit/analysis/summary.d.ts +2 -2
  5. package/dist/types/commit/changelog/generate.d.ts +2 -2
  6. package/dist/types/commit/changelog/index.d.ts +2 -2
  7. package/dist/types/commit/map-reduce/index.d.ts +3 -3
  8. package/dist/types/commit/map-reduce/map-phase.d.ts +2 -2
  9. package/dist/types/commit/map-reduce/reduce-phase.d.ts +2 -2
  10. package/dist/types/commit/model-selection.d.ts +10 -4
  11. package/dist/types/config/api-key-resolver.d.ts +34 -0
  12. package/dist/types/config/model-registry.d.ts +17 -1
  13. package/dist/types/config/settings-schema.d.ts +9 -0
  14. package/dist/types/dap/config.d.ts +14 -1
  15. package/dist/types/dap/types.d.ts +10 -0
  16. package/dist/types/lsp/utils.d.ts +3 -2
  17. package/dist/types/modes/components/chat-block.d.ts +64 -0
  18. package/dist/types/modes/components/custom-editor.d.ts +3 -0
  19. package/dist/types/modes/components/overlay-box.d.ts +17 -0
  20. package/dist/types/modes/components/plan-review-overlay.d.ts +59 -0
  21. package/dist/types/modes/components/plan-toc.d.ts +41 -0
  22. package/dist/types/modes/components/read-tool-group.d.ts +2 -0
  23. package/dist/types/modes/components/transcript-container.d.ts +11 -0
  24. package/dist/types/modes/controllers/command-controller.d.ts +1 -0
  25. package/dist/types/modes/controllers/event-controller.d.ts +0 -1
  26. package/dist/types/modes/controllers/extension-ui-controller.d.ts +0 -1
  27. package/dist/types/modes/controllers/input-controller.d.ts +1 -1
  28. package/dist/types/modes/controllers/streaming-reveal.d.ts +22 -0
  29. package/dist/types/modes/controllers/tan-command-controller.d.ts +6 -0
  30. package/dist/types/modes/interactive-mode.d.ts +15 -5
  31. package/dist/types/modes/theme/theme.d.ts +1 -1
  32. package/dist/types/modes/types.d.ts +18 -5
  33. package/dist/types/modes/utils/copy-targets.d.ts +21 -1
  34. package/dist/types/plan-mode/approved-plan.d.ts +27 -8
  35. package/dist/types/plan-mode/plan-protection.d.ts +4 -4
  36. package/dist/types/sdk.d.ts +2 -0
  37. package/dist/types/session/agent-session.d.ts +21 -0
  38. package/dist/types/session/messages.d.ts +12 -0
  39. package/dist/types/session/session-manager.d.ts +3 -1
  40. package/dist/types/slash-commands/types.d.ts +4 -6
  41. package/dist/types/task/executor.d.ts +7 -0
  42. package/dist/types/task/index.d.ts +1 -0
  43. package/dist/types/task/render.d.ts +3 -2
  44. package/dist/types/tools/archive-reader.d.ts +5 -0
  45. package/dist/types/tools/ast-edit.d.ts +3 -0
  46. package/dist/types/tools/ast-grep.d.ts +3 -0
  47. package/dist/types/tools/bash.d.ts +1 -0
  48. package/dist/types/tools/find.d.ts +8 -4
  49. package/dist/types/tools/grouped-file-output.d.ts +95 -12
  50. package/dist/types/tools/memory-render.d.ts +4 -1
  51. package/dist/types/tools/plan-mode-guard.d.ts +8 -9
  52. package/dist/types/tools/render-utils.d.ts +5 -9
  53. package/dist/types/tools/search.d.ts +4 -0
  54. package/dist/types/tools/sqlite-reader.d.ts +1 -0
  55. package/dist/types/tools/todo.d.ts +3 -2
  56. package/dist/types/tools/write.d.ts +3 -0
  57. package/dist/types/tui/output-block.d.ts +16 -4
  58. package/dist/types/tui/status-line.d.ts +3 -0
  59. package/dist/types/utils/enhanced-paste.d.ts +20 -0
  60. package/dist/types/web/search/providers/kimi.d.ts +1 -1
  61. package/package.json +9 -9
  62. package/src/auto-thinking/classifier.ts +5 -1
  63. package/src/cli/dry-balance-cli.ts +52 -17
  64. package/src/cli/gallery-cli.ts +4 -1
  65. package/src/cli/gallery-fixtures/misc.ts +29 -0
  66. package/src/commit/analysis/conventional.ts +2 -2
  67. package/src/commit/analysis/summary.ts +2 -2
  68. package/src/commit/changelog/generate.ts +2 -2
  69. package/src/commit/changelog/index.ts +2 -2
  70. package/src/commit/map-reduce/index.ts +3 -3
  71. package/src/commit/map-reduce/map-phase.ts +2 -2
  72. package/src/commit/map-reduce/reduce-phase.ts +2 -2
  73. package/src/commit/model-selection.ts +33 -9
  74. package/src/commit/pipeline.ts +4 -4
  75. package/src/config/api-key-resolver.ts +58 -0
  76. package/src/config/model-registry.ts +25 -2
  77. package/src/config/settings-schema.ts +10 -0
  78. package/src/config/settings.ts +20 -2
  79. package/src/dap/config.ts +41 -2
  80. package/src/dap/defaults.json +1 -0
  81. package/src/dap/session.ts +1 -0
  82. package/src/dap/types.ts +10 -0
  83. package/src/debug/index.ts +40 -54
  84. package/src/edit/renderer.ts +82 -78
  85. package/src/eval/__tests__/llm-bridge.test.ts +90 -31
  86. package/src/eval/llm-bridge.ts +8 -3
  87. package/src/goals/tools/goal-tool.ts +36 -26
  88. package/src/internal-urls/docs-index.generated.ts +6 -6
  89. package/src/lsp/utils.ts +3 -2
  90. package/src/main.ts +9 -7
  91. package/src/memories/index.ts +12 -5
  92. package/src/mnemopi/backend.ts +5 -1
  93. package/src/modes/acp/acp-agent.ts +33 -26
  94. package/src/modes/components/assistant-message.ts +2 -9
  95. package/src/modes/components/chat-block.ts +111 -0
  96. package/src/modes/components/copy-selector.ts +1 -44
  97. package/src/modes/components/custom-editor.ts +23 -0
  98. package/src/modes/components/custom-message.ts +1 -3
  99. package/src/modes/components/execution-shared.ts +1 -2
  100. package/src/modes/components/hook-message.ts +1 -3
  101. package/src/modes/components/overlay-box.ts +108 -0
  102. package/src/modes/components/plan-review-overlay.ts +799 -0
  103. package/src/modes/components/plan-toc.ts +138 -0
  104. package/src/modes/components/read-tool-group.ts +20 -4
  105. package/src/modes/components/skill-message.ts +0 -1
  106. package/src/modes/components/tips.txt +1 -0
  107. package/src/modes/components/todo-reminder.ts +0 -2
  108. package/src/modes/components/tool-execution.ts +68 -88
  109. package/src/modes/components/transcript-container.ts +84 -24
  110. package/src/modes/components/user-message.ts +1 -2
  111. package/src/modes/controllers/command-controller-shared.ts +7 -6
  112. package/src/modes/controllers/command-controller.ts +57 -55
  113. package/src/modes/controllers/event-controller.ts +41 -40
  114. package/src/modes/controllers/extension-ui-controller.ts +10 -73
  115. package/src/modes/controllers/input-controller.ts +124 -119
  116. package/src/modes/controllers/mcp-command-controller.ts +69 -60
  117. package/src/modes/controllers/selector-controller.ts +23 -25
  118. package/src/modes/controllers/streaming-reveal.ts +212 -0
  119. package/src/modes/controllers/tan-command-controller.ts +173 -0
  120. package/src/modes/interactive-mode.ts +169 -94
  121. package/src/modes/setup-wizard/wizard-overlay.ts +1 -1
  122. package/src/modes/theme/theme-schema.json +1 -1
  123. package/src/modes/theme/theme.ts +8 -4
  124. package/src/modes/types.ts +18 -7
  125. package/src/modes/utils/copy-targets.ts +133 -27
  126. package/src/modes/utils/ui-helpers.ts +44 -46
  127. package/src/plan-mode/approved-plan.ts +66 -43
  128. package/src/plan-mode/plan-protection.ts +4 -4
  129. package/src/prompts/system/background-tan-dispatch.md +8 -0
  130. package/src/prompts/system/plan-mode-active.md +67 -58
  131. package/src/prompts/system/plan-mode-approved.md +1 -1
  132. package/src/sdk.ts +11 -37
  133. package/src/session/agent-session.ts +82 -6
  134. package/src/session/messages.ts +26 -0
  135. package/src/session/session-manager.ts +13 -5
  136. package/src/slash-commands/builtin-registry.ts +36 -9
  137. package/src/slash-commands/types.ts +4 -6
  138. package/src/task/executor.ts +5 -2
  139. package/src/task/index.ts +4 -0
  140. package/src/task/render.ts +212 -147
  141. package/src/tools/archive-reader.ts +64 -0
  142. package/src/tools/ask.ts +119 -164
  143. package/src/tools/ast-edit.ts +98 -71
  144. package/src/tools/ast-grep.ts +37 -43
  145. package/src/tools/bash.ts +50 -6
  146. package/src/tools/debug.ts +20 -8
  147. package/src/tools/fetch.ts +297 -7
  148. package/src/tools/find.ts +44 -30
  149. package/src/tools/gh-renderer.ts +81 -42
  150. package/src/tools/grouped-file-output.ts +272 -48
  151. package/src/tools/image-gen.ts +150 -103
  152. package/src/tools/inspect-image-renderer.ts +63 -41
  153. package/src/tools/inspect-image.ts +8 -1
  154. package/src/tools/job.ts +3 -4
  155. package/src/tools/memory-render.ts +4 -1
  156. package/src/tools/plan-mode-guard.ts +21 -39
  157. package/src/tools/read.ts +23 -16
  158. package/src/tools/render-utils.ts +21 -37
  159. package/src/tools/resolve.ts +14 -0
  160. package/src/tools/search-tool-bm25.ts +36 -23
  161. package/src/tools/search.ts +80 -78
  162. package/src/tools/sqlite-reader.ts +9 -12
  163. package/src/tools/todo.ts +118 -52
  164. package/src/tools/write.ts +81 -62
  165. package/src/tui/output-block.ts +60 -13
  166. package/src/tui/status-line.ts +5 -1
  167. package/src/utils/commit-message-generator.ts +9 -1
  168. package/src/utils/enhanced-paste.ts +202 -0
  169. package/src/utils/title-generator.ts +2 -1
  170. package/src/web/search/providers/anthropic.ts +25 -19
  171. package/src/web/search/providers/exa.ts +11 -3
  172. package/src/web/search/providers/kimi.ts +28 -17
  173. package/src/web/search/providers/parallel.ts +35 -24
  174. package/src/web/search/providers/synthetic.ts +8 -6
  175. package/src/web/search/providers/tavily.ts +9 -8
  176. package/src/web/search/providers/zai.ts +8 -6
package/CHANGELOG.md CHANGED
@@ -2,6 +2,80 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [15.10.1] - 2026-06-07
6
+
7
+ ### Added
8
+
9
+ - Added `display.smoothStreaming` setting (default `true`) to let users enable or disable smooth assistant-stream text reveal
10
+ - Added `/tan <work>` slash command to fork the current conversation into a background agent so tangential work can continue asynchronously while your main session stays active
11
+ - Added a background `/tan` dispatch message that records the handoff in the transcript and marks the delegated work as non-blocking
12
+ - Added `providerPromptCacheKey` support to `CreateAgentSessionOptions` so `/tan` background sessions can reuse the parent session’s prompt-cache lineage
13
+ - Added session cloning for `/tan` runs with copied artifacts and shared MCP proxy tools
14
+ - Added `SessionManager.forkFrom`’s optional `suppressBreadcrumb` mode to avoid breadcrumb updates when forking background `/tan` sessions
15
+ - Added OSC 5522 enhanced paste handling in `InputController`, so terminal clipboard events are decoded as image or text payloads and inserted without passing raw paste sequences to the editor
16
+ - Added bracketed image-path paste support in `CustomEditor` so a single pasted image file path (PNG/JPEG/GIF/WEBP) is loaded from disk and inserted as an image candidate
17
+ - Added direct support for `Image #N` insertion from pasted local image paths by routing successful image-path pastes through the same image normalization and resize flow as clipboard image pastes
18
+ - Added `/fresh` to rotate the provider-facing session id and clear in-memory provider stream/cache state without changing the local session file.
19
+ - Added a `ChatBlock` transcript primitive (`modes/components/chat-block.ts`) and a single `ctx.present(...)` sink (with `ctx.resetTranscript()`) so chat output is mounted in one place instead of the repeated `chatContainer.addChild(...)` + `ui.requestRender()` pattern scattered across controllers. `ChatBlock` carries a React/Svelte-style lifecycle — `onMount` starts effects, `onCleanup` registers teardown, `finish()` self-completes (stops timers and freezes the block at its final content), and `dispose()`/`resetTranscript()` tears everything down — so animated blocks own their own resources instead of leaking `setInterval`/`requestRender` bookkeeping into callers. The MCP "Connecting…" spinner is now such a block.
20
+ - Added a `framedBlock` output-block helper (`tui/output-block.ts`) plus a `borderColor` override and `applyBg: false` (no background fill) on output blocks, a `renderStatusLine` `iconOverride`, and an `icon.search` (magnifier) theme symbol — so tool renderers can draw self-contained muted-outline frames and search-family tools can show a magnifier instead of a checkmark.
21
+
22
+ ### Changed
23
+
24
+ - Changed the bash tool frame to use a plain top rule instead of repeating "Bash" in the title bar, and folded minimizer raw-output artifact links into the status footer as `Artifact: <id>`.
25
+
26
+ - Changed grouped `read` output to use a white filled-circle mark for the group/single-read success state and omit duplicate per-file success marks inside multi-read groups.
27
+
28
+ - Changed assistant streaming output to reveal text incrementally at 30 FPS with grapheme-safe adaptive catch-up, instead of replacing the whole message chunk-by-chunk
29
+ - Changed shimmer-driven TUI animations (working text, pending bash/eval borders, and theme activity-spinner documentation) to render at 30fps instead of 60fps.
30
+ - Changed running `task` tool agent rows to use a static `•` marker and shimmer only the subagent name, leaving descriptions, stats, and nested tool detail text solid while removing the rotating status glyph from those rows.
31
+ - Changed settings singleton method access to reuse bound methods for the active instance instead of allocating a new bound function on every `settings.get` lookup.
32
+ - Changed plan-mode approval to keep the drafted `local://<slug>-plan.md` file at its original name as the canonical plan path, so approved plans are no longer renamed when leaving plan mode
33
+ - Changed plan-mode write enforcement so only `local://` artifact files are writable during planning, blocking working-tree edits and allowing scratch or draft plan files in the local artifact area
34
+ - Changed the `todo` tool result renderer to stop redrawing every phase's full task list on each update: when a multi-phase list is rendered collapsed (the default, not manually expanded), only phases the latest update touched — the phase holding the in_progress task, any phase with a just-completed task, and phases named by the ops that ran (`init` counts as touching all) — render their tasks; untouched phases collapse to a one-line `N. Name done/total` summary. When call args are unavailable (e.g. transcript rebuilds) it falls back to the in_progress/completed-transition signals, and the manual expand toggle still shows every task. Also dropped the blank separator line previously inserted between phases.
35
+ - Changed non-agent API operations (title and commit-message generation, image generation, web search, eval `llm()`, auto-thinking classifier, memory consolidation) to use session-aware API key resolution with auth retries via `registry.resolver()` / `authStorage.resolver()`, refreshing the active credential before rotating to another account
36
+ - Changed image generation to wrap every provider fetch branch in `withAuth`, so 401 / usage-limit errors trigger credential force-refresh and rotation for authStorage-backed providers (OpenAI-hosted, antigravity, xai-oauth) while env-only providers (openrouter, gemini) stay single-attempt
37
+ - Changed web-search providers using `authStorage.getApiKey` (anthropic, exa, tavily, parallel, synthetic, zai, kimi) to wrap HTTP calls in `withAuth` for automatic credential rotation on 401 / usage-limit errors
38
+ - Changed the directory grouping for `find`, `search`, `ast_grep`, `ast_edit`, and `lsp` diagnostics from a single flat `# dir/` heading per immediate directory to a multi-level tree that folds the common path prefix into one heading. Previously every group repeated the full directory path — so results rooted outside cwd printed the absolute prefix (e.g. `/Users/me/proj/`) on every heading and nested directories were never collapsed. Now a single-child directory chain folds into one heading (`# packages/pkg/src/`, including an absolute root for out-of-cwd results), subdirectories nest one `#` deeper (`## nested/` → `### child.ts`), and each directory's own files are listed before its subdirectories. TUI hyperlink reconstruction tracks the nested directory stack across the whole output so file and code-frame links keep resolving to the correct absolute paths.
39
+ - Changed the plan-mode approval surface from an inline transcript block plus a separate bottom selector into a single fullscreen overlay (like `/copy`) and overhauled its navigation. The overlay now renders the plan per-section through `ScrollView` (line-level ↑/↓ scroll, Shift+↑/↓ to scroll faster, PgUp/PgDn, g/G) with no stray per-line `…`, and — when the terminal is wide enough and the plan has ≥2 headings — shows a compact VS Code-style section sidebar (the redundant plan-title heading and any "Contents" label are omitted). Focus moves between regions with Tab/Shift+Tab (and flows at the edges: Down past the last section or the bottom of the body drops into the approval options; Up steps back), while the sidebar glows to track the scrolled section. The sidebar can fast-jump between sections, delete a section (with `u` undo), and annotate sections with feedback (`a`); deletions and annotations are collected into refinement feedback that is submitted back to the model when the operator picks "Refine plan". Mouse works too: clicking an approval option activates it, clicking a sidebar section jumps to it, and the wheel scrolls the plan. ←/→ always drive the model-tier slider, Enter confirms, the external-editor key opens the plan, and Esc cancels. The overlay borrows the terminal's alternate screen buffer for its lifetime (`fullscreen` overlay), so the transcript stays put on the normal screen instead of bleeding through scrollback behind the modal.
40
+ - Changed the interactive controllers (command, MCP, selector, extension-UI, event), debug panels, and the status/error/warning helpers to render chat output through `ctx.present(...)` instead of appending to `chatContainer` and calling `ui.requestRender()` directly; transcript rebuilds dispose live blocks via `ctx.resetTranscript()` so animated blocks' timers stop on reset.
41
+ - Changed tool-execution block rendering so the container (`ToolExecutionComponent`) is a transparent passthrough — it no longer inserts a top/bottom blank line, adds left/right padding, or paints a state-colored background behind tool output. Tools with substantial body now self-frame with a muted outline and the tool title in the frame's top bar (`edit`/`apply_patch`, `write`, `ask`, `todo`, `github`, `goal`, `inspect_image`, `search_tool_bm25`, `task`), matching the already-framed `bash`/`read`/`eval`/`debug`/`web_search`/`lsp` blocks, while streaming/in-progress and trivial results collapse to a clean status line. The search-family list tools (`find`, `search`, `ast_grep`) and `job` render frameless/minimal; `find`/`search`/`ast_grep` show a magnifier on success instead of a checkmark, and `job` drops its `Job:` label prefix (the per-job rows are self-describing). The `search_tool_bm25`, `github`, and `inspect_image` frames draw with no background fill, and `inspect_image`'s label was shortened to `Inspect`.
42
+ - Changed the plan-mode active prompt (`prompts/system/plan-mode-active.md`) to make plans decision-complete and cut filler. Added an Objective framing ("another engineer can execute end-to-end without making a single design decision"), a shared "Resolving Unknowns" section (explore discoverable facts before asking; reserve `ask` for non-derivable preferences/tradeoffs with 2–4 options + a recommended default), and a single shared "The Plan" structure (Context / Approach grouped by behavior not file-by-file / ≤5 Critical files / Verification / Assumptions) that replaces the per-branch structure guidance previously duplicated across the iterative and parallel workflows. Added explicit prohibitions on sections that decide nothing (Non-Goals, Out of Scope, Alternatives Considered, Risks/Mitigations boilerplate, Future Work), on enumerating every file/line, and on inventing schema/validation/precedence policy the request never established.
43
+ - Changed completion notifications (`completion.notify`) to fire whenever the agent yields its turn, including in the foreground. The `agent_end` notification was previously gated behind background mode (`isBackgrounded`), so an ordinary foreground turn never emitted one; the gate is gone and the desktop toast now fires on every normal turn completion (still skipped for aborted/error turns and when `completion.notify` is `off`).
44
+ - Changed the in-progress `task` tool block to keep the shared `context` brief (`# Goal` / `# Constraints` background) visible after the first progress snapshot arrives, instead of dropping it the moment the streaming call view was replaced by the result frame, and to stop animating a spinner/clock next to the `Task` frame header while running — the per-agent body lines already carry their own running spinner, so the header now shows a static state icon (matching the completed/failed header icons). The context is rendered through a shared `buildContextSection` helper that also undoes per-field double-encoding, so the brief reads cleanly in the result frame even though `renderResult` receives the raw (un-repaired) tool args.
45
+ - Changed the messaging shown when you press Esc to interrupt a streaming turn from the ambiguous `Operation aborted` / `Tool execution was aborted: Request was aborted` to `Interrupted by user`, so a deliberate user interrupt no longer reads like an internal failure. Every Esc/flush interrupt path (`onEscape` while streaming, the queued-message restore-and-abort path, and the empty-submit queue flush) threads the reason through `AgentSession.abort({ reason })` → `Agent.abort(reason)` so it rides the `AbortController` onto the aborted assistant message's `errorMessage`; the turn label renders it verbatim on both the live and replay paths, and the synthetic placeholder results paired with in-flight tool calls now read `Tool execution was aborted: Interrupted by user`. Aborts that carry no reason still fall back to the retry-aware `Operation aborted` generic. Transcript label resolution is centralized in `resolveAbortLabel` (`session/messages.ts`).
46
+
47
+ ### Removed
48
+
49
+ - Removed the `/background` (and `/bg`) slash command and the background-mode subsystem it was the sole entry point for — `InteractiveMode.isBackgrounded`, `createBackgroundUiContext`, `handleBackgroundEvent`, and every `isBackgrounded` guard across the input/event/extension-UI controllers and UI helpers. The command suspended the whole process group via `SIGTSTP` (a leftover testing shortcut) instead of detaching the running agent, which is not the expected workflow — use terminal panes or a multiplexer instead.
50
+
51
+ ### Fixed
52
+
53
+ - Fixed inline `find` and `search` result blocks to align with grouped `read` output and render their success headers with the normal tool-title color instead of accent blue.
54
+
55
+ - Fixed the working-status shimmer to opt into the loader's 30fps animated-message repaint path while keeping both the status spinner and pending bash/eval tool spinners on their normal 80 ms glyph cadence.
56
+ - Fixed consecutive `read` tool calls failing to collapse into a single grouped block when a reasoning model emits one read per completion (`[thinking, read]`). The read group was reset on every assistant `message_start`, so each read rendered as its own one-entry `Read …` line; now a read run accretes across completions and is broken only by a rendered non-empty text/thinking block, a non-read tool, or a user/IRC message — matching the transcript-rebuild path. `ReadToolGroupComponent` now reports its live/finalized state so the growing `Read (N)` header repaints correctly on native-scrollback (risk) terminals.
57
+ - Fixed the `task` tool shared-context brief rendering raw Markdown headings (`# Goal`, `# Constraints`) inside framed call/result blocks instead of using the normal Markdown renderer.
58
+ - Fixed the animated pending border on `bash`/`eval` blocks leaving a frozen dark "bar" segment behind after a backgrounded command finalized through the async update path. Once a command is auto-backgrounded (`details.async.state === "running"`) the block stays "partial" in the TUI until the async job-manager delivers the final result, but it also gets committed to native scrollback — so a mid-sweep shimmer frame baked a stray darkened border segment into the committed copy. The border now stops animating (and the 60fps redraw loop stops) the moment a block enters the backgrounded state, so the committed frame is a clean static border.
59
+ - Fixed cold `omp` launch to clear native terminal history on the first paint, avoiding a once-per-launch duplicate welcome/transcript copy before the normal session replay.
60
+ - Fixed plan approval resolution so `resolve` with `action: "apply"` can still find the plan file when `extra.title` is missing or stale by falling back to the current plan path and most-recent local plan artifacts
61
+ - Fixed the search-family tool magnifier glyph (`find`, `search`, `ast_grep`, `search_tool_bm25`) to use the `accent` title color instead of `success` green, so the icon matches the tool title in the status header instead of standing out
62
+ - Fixed TTSR stream interrupts to pass the matched rule name through the abort reason, so aborted in-flight tool placeholders say why they were stopped instead of `Request was aborted`.
63
+ - Fixed URL reads for binary/special payloads to reuse local readers: remote archives list their root entries, SQLite databases show their table overview, notebooks render as editable cells, and unrenderable binary returns a metadata notice instead of decoded byte garbage.
64
+ - Fixed pasted image-file paths that cannot be loaded to fall back to normal text paste with status feedback instead of disappearing.
65
+ - Fixed tool-output file paths not being clickable OSC 8 `file://` hyperlinks in several renderers. `read` titles for plain text and image files (the common case) emitted no link at all because the renderer only linked when a `resolvedPath` was recorded — which the ordinary file/image read paths never set, keeping the absolute path only in `meta.source`; the renderer now falls back to that source path. `write` headers were never wrapped in a hyperlink and now link to the absolute path written (file, archive entry, SQLite, and conflict resolutions). `edit`/`apply_patch` headers wrapped the model-supplied (often cwd-relative) argument path, producing a root-anchored `file:///rel/path` URI; they now link the absolute `details.path` instead. Finally, `search`, `ast_grep`, and `ast_edit` produced doubled link targets (`/proj/src/src/file.ts`) for searches scoped to a subdirectory, because the renderer resolved the cwd-relative display paths against the scope directory rather than cwd — the scoped-search base is now the session cwd (with the scoped file's absolute path still seeding single-file body lines).
66
+ - Fixed `omp dry-balance --bench` to recover from 401 token failures by re-minting the failing OAuth credential in place before switching accounts
67
+ - Fixed the bash tool corrupting commands that embed multi-byte UTF-8 (e.g. `✓`/`×` inside a `grep -E` pattern) ahead of a trailing `| head`/`| tail`. The `bash.stripTrailingHeadTail` rewrite cut at char-offset positions reported by `brush-parser` while slicing the command by byte offset, so the trailing-pipe strip landed mid-pattern and dropped the closing quote — turning `… |✓|×|XCTAssert" | tail -80` into `… |✓|×-80` and making execution fail with `pi-natives:command: unterminated double quote`. Fixed in `pi_shell::fixup` (`@oh-my-pi/pi-natives`).
68
+ - Fixed `omp dry-balance --bench` to recover from 401 token failures by re-minting the failing OAuth credential in place before switching accounts
69
+ - Fixed duplicate file entries in grouped outputs for `find`, `search`, `ast_grep`, `ast_edit`, and `lsp` diagnostics when the same path appeared multiple times
70
+ - Fixed search, grep, and edit output rendering so repeated directory group blank-line boundaries no longer break nested path/link reconstruction
71
+ - Fixed `omp dry-balance --bench` flooding the terminal with staircased, duplicated spinner/status lines (and an indented summary) when the tty has ONLCR/OPOST disabled (raw mode). The interactive progress region separated rows with a bare LF and repositioned with a column-preserving `\x1b[<n>A` cursor-up, both of which only land at column 0 when the terminal translates LF→CRLF; with that translation off, every 80 ms redraw cascaded down and to the right into scrollback. The live region now carriage-returns before every cleared row, terminates each row with CRLF, and caps each row to the terminal width so a wrapped line cannot desync the cursor-up from the logical line count.
72
+ - Fixed inconsistent vertical spacing between transcript blocks: some blocks (tool results from `search`/`find` and other renderer-backed tools) rendered with a doubled gap (a leading `Spacer` plus the content box's own `paddingY`), while others (the grouped `read` card, file-mention lists, IRC cards) rendered with no gap at all. Vertical spacing is now owned entirely by the chat renderer: `TranscriptContainer` strips each block's plain-blank top/bottom edges and inserts exactly one blank line between consecutive blocks, so every block is separated by a single consistent gap regardless of which component produced it. Individual components (assistant/user/tool/read-group/bash/eval/skill/custom/hook/compaction/branch/todo-reminder/plan-review messages) no longer emit their own leading `Spacer`/`paddingY` for separation, and multi-row groups (IRC cards, file-mention lists, completed-job batches, and the bordered command/`/changelog`/`/context`/version/OAuth/debug panels) are wrapped as single `TranscriptBlock` children so the renderer spaces them as one unit. Background-colored box padding is preserved as block-internal design.
73
+ - Fixed `resolve` with `action: "discard"` surfacing a hard `isError` "No pending action to resolve" failure to the model when the agent asked to cancel a staged action (e.g. an `ast_edit` preview) but nothing was pending. A discard is a request to reach the "no staged change" end-state, which already holds in that case, so it is now honored as a successful cancellation (`"Nothing to discard; no pending action remains."` with `details.action: "discard"`) instead of an error. `action: "apply"` with no pending action still errors.
74
+ - Fixed the collapsed tool-output expand hint rendering double brackets (e.g. `((Ctrl+O for more))`) — the `EXPAND_HINT` text already carried its own parentheses and then `formatExpandHint` wrapped it again with the theme's bracket glyphs. The hint now resolves the key actually bound to `app.tools.expand` at render time and reads `⟨<key>: Expand⟩` (e.g. `⟨Ctrl+O: Expand⟩`), so a single bracket pair surrounds it and a user remap of the expand keybinding is reflected instead of a hard-coded `Ctrl+O`.
75
+ - Fixed the `edit`/`apply_patch` tool dropping its outlined frame while streaming/in-progress (only the final result was framed); the in-progress diff preview now renders inside the same muted frame as the completed result.
76
+ - Fixed the `todo` and `job` tools rendering a success icon and success styling on a failed/error result; error results now show the error icon and a red frame border.
77
+ - Fixed `debug` tool refusing every `dlv` launch on Go modules. The launch handler ran `validateLaunchProgram` before adapter selection and rejected any directory program with `launch program resolves to a directory`, while dlv's default `mode=debug` requires a Go package path (a directory or `.go` source file). Adapter resolution now precedes validation, directory programs prefer adapters that advertise `acceptsDirectoryProgram` before falling back to native extensionless debuggers, the rejection only fires when the resolved adapter does not advertise that flag (set on `dlv` in `dap/defaults.json`), and dlv's `mode` is derived from the program shape — directories and `.go` files launch as `mode=debug`, other files as `mode=exec` — so `omp` can debug both Go packages and pre-built binaries ([#2020](https://github.com/can1357/oh-my-pi/issues/2020)).
78
+
5
79
  ## [15.10.0] - 2026-06-06
6
80
 
7
81
  ### Breaking Changes
@@ -9496,4 +9570,4 @@ Initial public release.
9496
9570
  - Git branch display in footer
9497
9571
  - Message queueing during streaming responses
9498
9572
  - OAuth integration for Gmail and Google Calendar access
9499
- - HTML export with syntax highlighting and collapsible sections
9573
+ - HTML export with syntax highlighting and collapsible sections
@@ -1,4 +1,4 @@
1
- import type { Api, AssistantMessageEventStream, Context, Model, OAuthAccess, OAuthAccessResolution, SimpleStreamOptions } from "@oh-my-pi/pi-ai";
1
+ import type { Api, AssistantMessageEventStream, AuthCredentialSnapshotEntry, Context, Model, OAuthAccess, OAuthAccessResolution, SimpleStreamOptions } from "@oh-my-pi/pi-ai";
2
2
  import type { CanonicalModelVariant } from "../config/model-equivalence";
3
3
  import { type CanonicalModelQueryOptions } from "../config/model-registry";
4
4
  import { Settings } from "../config/settings";
@@ -20,6 +20,12 @@ export interface DryBalanceAuthOptions {
20
20
  export interface DryBalanceAuthStorage {
21
21
  getOAuthAccess(provider: string, sessionId?: string, options?: DryBalanceAuthOptions): Promise<OAuthAccess | undefined>;
22
22
  getOAuthAccesses?(provider: string, options?: DryBalanceAuthOptions): Promise<OAuthAccessResolution[]>;
23
+ /**
24
+ * Force-refresh a single credential by id (step (b) of the auth-retry
25
+ * policy). The bench re-mints the failing account's token in place on a
26
+ * 401 rather than rotating accounts — it is measuring each account.
27
+ */
28
+ forceRefreshCredentialById?(id: number, signal?: AbortSignal): Promise<AuthCredentialSnapshotEntry>;
23
29
  }
24
30
  export interface DryBalanceModelRegistry {
25
31
  authStorage: DryBalanceAuthStorage;
@@ -98,7 +104,15 @@ export interface DryBalanceDependencies {
98
104
  now?: () => number;
99
105
  stdoutIsTTY?: boolean;
100
106
  stderrIsTTY?: boolean;
107
+ stdoutColumns?: number;
108
+ stderrColumns?: number;
101
109
  }
110
+ interface DryBalanceBenchProgressSink {
111
+ markRunning(index: number, account: string): void;
112
+ complete(index: number, result: DryBalanceBenchResult): void;
113
+ close(): void;
114
+ }
115
+ export declare function createBenchProgressSink(total: number, write: (text: string) => void, interactive: boolean, columns: number): DryBalanceBenchProgressSink;
102
116
  export declare function formatDryBalanceText(summary: DryBalanceSummary): string;
103
117
  export declare function runDryBalanceCommand(command: DryBalanceCommandArgs, deps?: DryBalanceDependencies): Promise<DryBalanceSummary>;
104
118
  export {};
@@ -1,9 +1,9 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
- import type { Api, Model } from "@oh-my-pi/pi-ai";
2
+ import type { Api, ApiKey, Model } from "@oh-my-pi/pi-ai";
3
3
  import type { ConventionalAnalysis } from "../../commit/types";
4
4
  export interface ConventionalAnalysisInput {
5
5
  model: Model<Api>;
6
- apiKey: string;
6
+ apiKey: ApiKey;
7
7
  thinkingLevel?: ThinkingLevel;
8
8
  contextFiles?: Array<{
9
9
  path: string;
@@ -1,9 +1,9 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
- import type { Api, Model } from "@oh-my-pi/pi-ai";
2
+ import type { Api, ApiKey, Model } from "@oh-my-pi/pi-ai";
3
3
  import type { CommitSummary } from "../../commit/types";
4
4
  export interface SummaryInput {
5
5
  model: Model<Api>;
6
- apiKey: string;
6
+ apiKey: ApiKey;
7
7
  thinkingLevel?: ThinkingLevel;
8
8
  commitType: string;
9
9
  scope: string | null;
@@ -1,5 +1,5 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
- import type { Api, Model } from "@oh-my-pi/pi-ai";
2
+ import type { Api, ApiKey, Model } from "@oh-my-pi/pi-ai";
3
3
  import * as z from "zod/v4";
4
4
  import { type ChangelogGenerationResult } from "../../commit/types";
5
5
  export declare const changelogTool: {
@@ -19,7 +19,7 @@ export declare const changelogTool: {
19
19
  };
20
20
  export interface ChangelogPromptInput {
21
21
  model: Model<Api>;
22
- apiKey: string;
22
+ apiKey: ApiKey;
23
23
  thinkingLevel?: ThinkingLevel;
24
24
  changelogPath: string;
25
25
  isPackageChangelog: boolean;
@@ -1,9 +1,9 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
- import type { Api, Model } from "@oh-my-pi/pi-ai";
2
+ import type { Api, ApiKey, Model } from "@oh-my-pi/pi-ai";
3
3
  export interface ChangelogFlowInput {
4
4
  cwd: string;
5
5
  model: Model<Api>;
6
- apiKey: string;
6
+ apiKey: ApiKey;
7
7
  thinkingLevel?: ThinkingLevel;
8
8
  stagedFiles: string[];
9
9
  dryRun: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
- import type { Api, Model } from "@oh-my-pi/pi-ai";
2
+ import type { Api, ApiKey, Model } from "@oh-my-pi/pi-ai";
3
3
  import type { ConventionalAnalysis } from "../../commit/types";
4
4
  export interface MapReduceSettings {
5
5
  enabled?: boolean;
@@ -10,10 +10,10 @@ export interface MapReduceSettings {
10
10
  }
11
11
  export interface MapReduceInput {
12
12
  model: Model<Api>;
13
- apiKey: string;
13
+ apiKey: ApiKey;
14
14
  thinkingLevel?: ThinkingLevel;
15
15
  smolModel: Model<Api>;
16
- smolApiKey: string;
16
+ smolApiKey: ApiKey;
17
17
  smolThinkingLevel?: ThinkingLevel;
18
18
  diff: string;
19
19
  stat: string;
@@ -1,9 +1,9 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
- import type { Api, Model } from "@oh-my-pi/pi-ai";
2
+ import type { Api, ApiKey, Model } from "@oh-my-pi/pi-ai";
3
3
  import type { FileDiff, FileObservation } from "../../commit/types";
4
4
  export interface MapPhaseInput {
5
5
  model: Model<Api>;
6
- apiKey: string;
6
+ apiKey: ApiKey;
7
7
  thinkingLevel?: ThinkingLevel;
8
8
  files: FileDiff[];
9
9
  config?: {
@@ -1,9 +1,9 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
- import type { Api, Model } from "@oh-my-pi/pi-ai";
2
+ import type { Api, ApiKey, Model } from "@oh-my-pi/pi-ai";
3
3
  import type { ConventionalAnalysis, FileObservation } from "../../commit/types";
4
4
  export interface ReducePhaseInput {
5
5
  model: Model<Api>;
6
- apiKey: string;
6
+ apiKey: ApiKey;
7
7
  thinkingLevel?: ThinkingLevel;
8
8
  observations: FileObservation[];
9
9
  stat: string;
@@ -1,15 +1,21 @@
1
1
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
- import type { Api, Model } from "@oh-my-pi/pi-ai";
2
+ import type { Api, ApiKey, Model } from "@oh-my-pi/pi-ai";
3
+ import type { ApiKeyResolverRegistry } from "../config/api-key-resolver";
3
4
  import { type ModelLookupRegistry } from "../config/model-resolver";
4
5
  import type { Settings } from "../config/settings";
5
6
  export interface ResolvedCommitModel {
6
7
  model: Model<Api>;
7
- apiKey: string;
8
+ /**
9
+ * Resolver for the model's bearer: re-resolves on 401 / usage-limit so the
10
+ * whole commit pipeline (analysis, map/reduce, changelog) inherits the
11
+ * central force-refresh + account-rotation policy.
12
+ */
13
+ apiKey: ApiKey;
8
14
  thinkingLevel?: ThinkingLevel;
9
15
  }
10
- type CommitModelRegistry = ModelLookupRegistry & {
16
+ type CommitModelRegistry = ModelLookupRegistry & ApiKeyResolverRegistry & {
11
17
  getApiKey: (model: Model<Api>) => Promise<string | undefined>;
12
18
  };
13
19
  export declare function resolvePrimaryModel(override: string | undefined, settings: Settings, modelRegistry: CommitModelRegistry): Promise<ResolvedCommitModel>;
14
- export declare function resolveSmolModel(settings: Settings, modelRegistry: CommitModelRegistry, fallbackModel: Model<Api>, fallbackApiKey: string): Promise<ResolvedCommitModel>;
20
+ export declare function resolveSmolModel(settings: Settings, modelRegistry: CommitModelRegistry, fallbackModel: Model<Api>, fallbackApiKey: ApiKey): Promise<ResolvedCommitModel>;
15
21
  export {};
@@ -0,0 +1,34 @@
1
+ import type { ApiKeyResolver, AuthStorage } from "@oh-my-pi/pi-ai";
2
+ export interface ApiKeyResolverOptions {
3
+ /** Session id for credential stickiness; read at resolve time by the caller. */
4
+ sessionId?: string;
5
+ /** Provider base URL hint forwarded to the auth-storage cascade. */
6
+ baseUrl?: string;
7
+ }
8
+ /**
9
+ * Minimal slice of `ModelRegistry` the resolver needs. Typed structurally so
10
+ * narrower registry shells (e.g. the commit pipeline's `CommitModelRegistry`)
11
+ * can build resolvers without depending on the full class.
12
+ */
13
+ export interface ApiKeyResolverRegistry {
14
+ getApiKeyForProvider(provider: string, sessionId?: string, options?: {
15
+ baseUrl?: string;
16
+ forceRefresh?: boolean;
17
+ signal?: AbortSignal;
18
+ }): Promise<string | undefined>;
19
+ authStorage: Pick<AuthStorage, "rotateSessionCredential">;
20
+ /**
21
+ * Build an {@link ApiKeyResolver} implementing the central a/b/c auth-retry
22
+ * policy: initial → resolve; step (b) → force-refresh same account; step (c)
23
+ * → rotate to a sibling credential, then re-resolve.
24
+ *
25
+ * The resolver is stateless (safe to reuse across requests). Callers that
26
+ * need the initial key for a guard can call `resolveApiKeyOnce(resolver)`.
27
+ */
28
+ resolver(provider: string, options?: ApiKeyResolverOptions): ApiKeyResolver;
29
+ }
30
+ /**
31
+ * Default implementation of {@link ApiKeyResolverRegistry.resolver}.
32
+ * Also usable standalone for structural registries that don't carry the method.
33
+ */
34
+ export declare function createApiKeyResolver(registry: Pick<ApiKeyResolverRegistry, "getApiKeyForProvider" | "authStorage">, provider: string, options?: ApiKeyResolverOptions): ApiKeyResolver;
@@ -1,9 +1,11 @@
1
1
  import { type ModelRefreshStrategy } from "@oh-my-pi/pi-ai/model-manager";
2
2
  import type { Api, Context, Model, SimpleStreamOptions, ThinkingConfig } from "@oh-my-pi/pi-ai/types";
3
3
  import type { AssistantMessageEventStream } from "@oh-my-pi/pi-ai/utils/event-stream";
4
+ import type { ApiKeyResolver } from "@oh-my-pi/pi-ai";
4
5
  import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/utils/oauth/types";
5
6
  import { type ThemeColor } from "../modes/theme/theme";
6
7
  import type { AuthStorage } from "../session/auth-storage";
8
+ import { type ApiKeyResolverOptions } from "./api-key-resolver";
7
9
  import { type ConfigError, ConfigFile } from "./config-file";
8
10
  import { type CanonicalModelIndex, type CanonicalModelRecord, type CanonicalModelVariant, type ModelEquivalenceConfig } from "./model-equivalence";
9
11
  import { type Settings } from "./settings";
@@ -326,8 +328,22 @@ export declare class ModelRegistry {
326
328
  getApiKey(model: Model<Api>, sessionId?: string): Promise<string | undefined>;
327
329
  /**
328
330
  * Get API key for a provider (e.g., "openai").
331
+ *
332
+ * `options.forceRefresh` powers step (b) of the auth-retry policy — it
333
+ * re-mints the session-sticky OAuth token even when the cached copy still
334
+ * looks valid. `options.signal` is threaded into any broker-bound refresh.
335
+ */
336
+ getApiKeyForProvider(provider: string, sessionId?: string, options?: {
337
+ baseUrl?: string;
338
+ forceRefresh?: boolean;
339
+ signal?: AbortSignal;
340
+ }): Promise<string | undefined>;
341
+ /**
342
+ * Build an {@link ApiKeyResolver} for this provider, implementing the
343
+ * central a/b/c auth-retry policy. Callers that need the initial key for
344
+ * a guard can call `resolveApiKeyOnce(resolver)`.
329
345
  */
330
- getApiKeyForProvider(provider: string, sessionId?: string, baseUrl?: string): Promise<string | undefined>;
346
+ resolver(provider: string, options?: ApiKeyResolverOptions): ApiKeyResolver;
331
347
  /**
332
348
  * Check if a model is using OAuth credentials (subscription).
333
349
  */
@@ -689,6 +689,15 @@ export declare const SETTINGS_SCHEMA: {
689
689
  }];
690
690
  };
691
691
  };
692
+ readonly "display.smoothStreaming": {
693
+ readonly type: "boolean";
694
+ readonly default: true;
695
+ readonly ui: {
696
+ readonly tab: "appearance";
697
+ readonly label: "Smooth Streaming";
698
+ readonly description: "Reveal assistant text smoothly while streamed chunks arrive";
699
+ };
700
+ };
692
701
  readonly "display.showTokenUsage": {
693
702
  readonly type: "boolean";
694
703
  readonly default: false;
@@ -2,5 +2,18 @@ import type { DapAdapterConfig, DapResolvedAdapter } from "./types";
2
2
  export declare function getAdapterConfigs(): Record<string, DapAdapterConfig>;
3
3
  export declare function resolveAdapter(adapterName: string, cwd: string): DapResolvedAdapter | null;
4
4
  export declare function getAvailableAdapters(cwd: string): DapResolvedAdapter[];
5
- export declare function selectLaunchAdapter(program: string, cwd: string, adapterName?: string): DapResolvedAdapter | null;
5
+ export declare function selectLaunchAdapter(program: string, cwd: string, adapterName?: string, programKind?: LaunchProgramKind): DapResolvedAdapter | null;
6
6
  export declare function selectAttachAdapter(cwd: string, adapterName?: string, port?: number): DapResolvedAdapter | null;
7
+ /** How the launch `program` resolves on disk. `"missing"` is reserved for
8
+ * programs the adapter creates on demand (rare); we treat them like files. */
9
+ export type LaunchProgramKind = "file" | "directory" | "missing";
10
+ /** Compute adapter-specific launch arguments that depend on the resolved
11
+ * program. Returned values are spread over `adapter.launchDefaults` so they
12
+ * take precedence over the static defaults but can still be overridden by
13
+ * the fields `DapSessionManager.launch` sets explicitly (program, cwd, args).
14
+ *
15
+ * Currently scoped to dlv, where `mode` selects how the program path is
16
+ * interpreted: directories and `.go` source files debug as a Go package
17
+ * (`mode=debug`), anything else is treated as a compiled binary (`mode=exec`).
18
+ */
19
+ export declare function resolveLaunchOverrides(adapter: DapResolvedAdapter, program: string, programKind: LaunchProgramKind): Record<string, unknown>;
@@ -422,6 +422,10 @@ export interface DapAdapterConfig {
422
422
  * On Linux, connects via a unix domain socket.
423
423
  * On macOS, the adapter dials into a local TCP listener (--client-addr). */
424
424
  connectMode?: "stdio" | "socket";
425
+ /** When true, the adapter accepts a directory as the launch `program`
426
+ * (e.g. dlv treats it as a Go package path). When false/undefined, the
427
+ * debug tool rejects directory programs upfront. */
428
+ acceptsDirectoryProgram?: boolean;
425
429
  }
426
430
  export interface DapResolvedAdapter {
427
431
  name: string;
@@ -434,6 +438,7 @@ export interface DapResolvedAdapter {
434
438
  launchDefaults: Record<string, unknown>;
435
439
  attachDefaults: Record<string, unknown>;
436
440
  connectMode: "stdio" | "socket";
441
+ acceptsDirectoryProgram: boolean;
437
442
  }
438
443
  export interface DapBreakpointRecord {
439
444
  id?: number;
@@ -514,6 +519,11 @@ export interface DapLaunchSessionOptions {
514
519
  program: string;
515
520
  args?: string[];
516
521
  cwd: string;
522
+ /** Per-launch overrides merged over `adapter.launchDefaults`. Used to
523
+ * inject adapter-specific values that depend on the resolved program
524
+ * (e.g. dlv's `mode` switches between `debug` and `exec` based on
525
+ * whether `program` is a Go package path or a compiled binary). */
526
+ extraLaunchArguments?: Record<string, unknown>;
517
527
  }
518
528
  export interface DapAttachSessionOptions {
519
529
  adapter: DapResolvedAdapter;
@@ -28,9 +28,10 @@ export declare function severityToIcon(severity?: DiagnosticSeverity): string;
28
28
  */
29
29
  export declare function formatDiagnostic(diagnostic: Diagnostic, filePath: string): string;
30
30
  /**
31
- * Reformat pre-formatted diagnostic messages into grep-style directory/file groups.
31
+ * Reformat pre-formatted diagnostic messages into a multi-level, prefix-folded
32
+ * directory/file grouping (see `formatGroupedFiles`).
32
33
  * Input: ["path:line:col [sev] msg", ...]
33
- * Output: "# dir/\n## file.ts\n line:col [sev] msg"
34
+ * Output: "# pkg/src/\n## file.ts\n line:col [sev] msg"
34
35
  *
35
36
  * Messages that don't match the expected format are appended ungrouped at the end.
36
37
  */
@@ -0,0 +1,64 @@
1
+ import { Container } from "@oh-my-pi/pi-tui";
2
+ /**
3
+ * Capabilities a mounted {@link ChatBlock} may use against its host transcript.
4
+ * Kept minimal so blocks never reach into the full TUI/InteractiveMode surface.
5
+ */
6
+ export interface ChatBlockHost {
7
+ /** Schedule a repaint of the transcript. */
8
+ requestRender(): void;
9
+ }
10
+ /**
11
+ * Lifecycle-aware transcript block — the "return a block, let the host mount it"
12
+ * primitive, modelled on React/Svelte component lifecycles.
13
+ *
14
+ * Producers build and return a `ChatBlock` instead of poking `chatContainer` and
15
+ * `ui.requestRender()` directly. The host (`ctx.present`) appends it and calls
16
+ * {@link mount}, which runs {@link onMount}; effects started there register
17
+ * teardown via {@link onCleanup}. The block repaints through {@link requestRender}
18
+ * — never touching the TUI — and tears down exactly once on {@link finish}
19
+ * (self-complete: stop the animation, keep the final frame in the transcript) or
20
+ * {@link dispose} (host discards it, e.g. a transcript reset).
21
+ *
22
+ * While mounted and unfinished a block reports `isTranscriptBlockFinalized() ===
23
+ * false` so {@link "../components/transcript-container".TranscriptContainer}
24
+ * keeps it in the live, repaintable region on ED3-risk terminals; after
25
+ * `finish()`/`dispose()` it reports `true` and freezes at its final content.
26
+ */
27
+ export declare abstract class ChatBlock extends Container {
28
+ #private;
29
+ /**
30
+ * Run setup after the block is in the transcript: start timers/subscriptions
31
+ * and register their teardown with {@link onCleanup}. Default: no-op (a block
32
+ * whose content is fixed at construction needs no mount work).
33
+ */
34
+ protected onMount(): void;
35
+ /**
36
+ * Register a teardown to run on {@link finish}/{@link dispose}, à la a
37
+ * `useEffect` cleanup. If the block is already disposed the cleanup runs
38
+ * immediately so callers never leak.
39
+ */
40
+ protected onCleanup(cleanup: () => void): void;
41
+ /** Ask the host to repaint. No-op before mount or after dispose. */
42
+ protected requestRender(): void;
43
+ /** True between {@link mount} and {@link finish}/{@link dispose}. */
44
+ protected get active(): boolean;
45
+ /**
46
+ * Host-only: attach the host and run {@link onMount}. Idempotent — a second
47
+ * call (e.g. a transcript rebuild that re-presents the same instance) is a
48
+ * no-op.
49
+ */
50
+ mount(host: ChatBlockHost): void;
51
+ /**
52
+ * Self-complete: stop ongoing effects and freeze the block at its current
53
+ * content, leaving it rendered in the transcript. Use when the operation the
54
+ * block represents finishes (connection resolved, download done).
55
+ */
56
+ finish(): void;
57
+ /**
58
+ * Host-only teardown: release everything and propagate to children. Called
59
+ * when the host permanently discards the block (transcript reset). Idempotent.
60
+ */
61
+ dispose(): void;
62
+ /** Live blocks stay repaintable; finished/disposed ones may freeze. */
63
+ isTranscriptBlockFinalized(): boolean;
64
+ }
@@ -1,6 +1,7 @@
1
1
  import { Editor, type KeyId } from "@oh-my-pi/pi-tui";
2
2
  import type { AppKeybinding } from "../../config/keybindings";
3
3
  type ConfigurableEditorAction = Extract<AppKeybinding, "app.interrupt" | "app.clear" | "app.exit" | "app.suspend" | "app.display.reset" | "app.thinking.cycle" | "app.model.cycleForward" | "app.model.cycleBackward" | "app.model.select" | "app.model.selectTemporary" | "app.tools.expand" | "app.thinking.toggle" | "app.editor.external" | "app.history.search" | "app.message.dequeue" | "app.clipboard.pasteImage" | "app.clipboard.pasteTextRaw" | "app.clipboard.copyPrompt">;
4
+ export declare function extractBracketedImagePastePath(data: string): string | undefined;
4
5
  /**
5
6
  * Custom editor that handles configurable app-level shortcuts for coding-agent.
6
7
  */
@@ -29,6 +30,8 @@ export declare class CustomEditor extends Editor {
29
30
  onCopyPrompt?: () => void;
30
31
  /** Called when the configured image-paste shortcut is pressed. */
31
32
  onPasteImage?: () => Promise<boolean>;
33
+ /** Called when a bracketed paste contains exactly one image-file path. */
34
+ onPasteImagePath?: (path: string) => void;
32
35
  /** Called when the configured raw text-paste shortcut is pressed. */
33
36
  onPasteTextRaw?: () => void;
34
37
  /** Called when the configured dequeue shortcut is pressed. */
@@ -0,0 +1,17 @@
1
+ /** Pad or truncate a (possibly ANSI-styled) string to exactly `width` columns. */
2
+ export declare function fit(text: string, width: number): string;
3
+ /** Top border with an optional accent-colored title inset into the rule. */
4
+ export declare function topBorder(width: number, title: string): string;
5
+ /** A horizontal rule with left/right tees, splitting overlay sections. */
6
+ export declare function divider(width: number): string;
7
+ export declare function bottomBorder(width: number): string;
8
+ /** Wrap pre-styled content in vertical borders with single-column insets. */
9
+ export declare function row(content: string, width: number): string;
10
+ /** Body content width for a two-column overlay of total `width`. */
11
+ export declare function splitBodyWidth(width: number, sidebarWidth: number): number;
12
+ /** Top border carrying the title, split by a `┬` over the column divider. */
13
+ export declare function topBorderSplit(width: number, title: string, sidebarWidth: number): string;
14
+ /** Section rule that closes the sidebar column with a `┴` over the divider. */
15
+ export declare function dividerSplit(width: number, sidebarWidth: number): string;
16
+ /** A two-column content row: `│ sidebar │ body │`, each inset by one column. */
17
+ export declare function splitRow(sidebar: string, body: string, width: number, sidebarWidth: number): string;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Fullscreen plan-review overlay. The overlay owns its entire content: the plan
3
+ * is split into sections (preamble + one per heading), each rendered through its
4
+ * own {@link Markdown} and windowed by a {@link ScrollView}, while the approval
5
+ * options (plus the optional model-tier slider) sit beneath inside the same
6
+ * outlined box — one self-contained surface in the spirit of the `/copy` picker.
7
+ *
8
+ * When the terminal is wide enough and the plan has ≥2 headings, a Contents
9
+ * sidebar appears: it tracks the scrolled section with an accent "glow", and —
10
+ * when focused — lets the operator jump between sections, delete a section
11
+ * (with undo), and annotate sections with feedback that feeds the Refine loop.
12
+ *
13
+ * Focus regions (`toc`/`body`/`actions`) cycle with Tab/Shift+Tab; arrows move
14
+ * within the focused region and step left into the sidebar. The default focus is
15
+ * `actions`, so the muscle memory of the old single-target overlay carries over:
16
+ * ↑/↓ select options, Enter confirms, ←/→ drives the slider when there is no
17
+ * sidebar, g/G + PgUp/PgDn scroll, and the external-editor key opens the plan.
18
+ */
19
+ import { type Component } from "@oh-my-pi/pi-tui";
20
+ import type { HookSelectorSlider } from "./hook-selector";
21
+ export interface PlanReviewOverlayCallbacks {
22
+ /** Invoked with the chosen option label (never a disabled one). */
23
+ onPick: (label: string) => void;
24
+ /** Invoked on Esc / cancel. */
25
+ onCancel: () => void;
26
+ /** Invoked when the external-editor key is pressed (overlay stays open). */
27
+ onExternalEditor?: () => void;
28
+ /** Invoked with the new full plan text after an in-overlay delete/undo. */
29
+ onPlanEdited?: (content: string) => void;
30
+ /** Invoked with the Refine feedback markdown whenever annotations change. */
31
+ onFeedbackChange?: (feedback: string) => void;
32
+ }
33
+ export interface PlanReviewOverlayOptions {
34
+ /** Prompt rendered above the options (e.g. "Plan mode - next step"). */
35
+ promptTitle?: string;
36
+ options: string[];
37
+ /** Indices into `options` that render dimmed and cannot be selected. */
38
+ disabledIndices?: number[];
39
+ /** Trailing footer hint (cancel hint); the overlay prepends dynamic help. */
40
+ helpText?: string;
41
+ /** Initially highlighted option index. */
42
+ initialIndex?: number;
43
+ /** Optional model-tier slider rendered between the plan body and options. */
44
+ slider?: HookSelectorSlider;
45
+ /** Display label for the external-editor key, surfaced in the footer help. */
46
+ externalEditorLabel?: string;
47
+ }
48
+ export declare class PlanReviewOverlay implements Component {
49
+ #private;
50
+ private readonly callbacks;
51
+ constructor(planContent: string, options: PlanReviewOverlayOptions, callbacks: PlanReviewOverlayCallbacks);
52
+ invalidate(): void;
53
+ /** Swap the displayed plan (e.g. after an external-editor round-trip) and
54
+ * reset scroll/focus so the operator starts at the top. Does not emit
55
+ * `onPlanEdited` (the editor round-trip already persisted the file). */
56
+ setPlanContent(planContent: string): void;
57
+ handleInput(keyData: string): void;
58
+ render(width: number): string[];
59
+ }