@oh-my-pi/pi-tui 18.11.1 → 18.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -127
- package/dist/types/apps/git/git-tui.d.ts +16 -2
- package/dist/types/charts/chart-svg.d.ts +7 -13
- package/dist/types/chat/table-chart.d.ts +11 -15
- package/dist/types/chrome/transcript-container.d.ts +2 -0
- package/dist/types/components/markdown.d.ts +4 -3
- package/dist/types/overlays/agent-hub-projection.d.ts +10 -5
- package/dist/types/overlays/approval-dialog.d.ts +25 -15
- package/dist/types/overlays/model-picker.d.ts +2 -0
- package/dist/types/overlays/session-selector.d.ts +2 -0
- package/dist/types/prompt/composer.d.ts +20 -0
- package/dist/types/prompt/custom-editor.d.ts +2 -0
- package/dist/types/prompt/internal-url-autocomplete.d.ts +1 -0
- package/dist/types/prompt/macos-spelling.d.ts +2 -1
- package/dist/types/prompt/prose-gate.d.ts +3 -0
- package/dist/types/prompt/queued-messages.d.ts +1 -1
- package/dist/types/prompt/typing-word.d.ts +25 -0
- package/dist/types/status-line/host.d.ts +6 -4
- package/dist/types/terminal.d.ts +1 -1
- package/dist/types/theme/symbols.d.ts +1 -1
- package/dist/types/tools/task.d.ts +8 -0
- package/dist/types/tui.d.ts +9 -0
- package/package.json +9 -9
- package/src/apps/git/git-tui.ts +27 -10
- package/src/apps/git/sidebar.ts +5 -1
- package/src/autocomplete.ts +7 -0
- package/src/charts/chart-svg.ts +19 -22
- package/src/chat/assistant-message.ts +3 -3
- package/src/chat/table-chart.ts +24 -57
- package/src/chrome/transcript-container.ts +10 -0
- package/src/components/markdown.ts +74 -5
- package/src/components/settings-list.ts +2 -4
- package/src/overlays/agent-hub-projection.ts +63 -12
- package/src/overlays/approval-dialog.ts +104 -36
- package/src/overlays/btw-history-panel.ts +30 -23
- package/src/overlays/extensions/extension-list.ts +4 -6
- package/src/overlays/model-picker.ts +58 -21
- package/src/overlays/session-selector.ts +14 -9
- package/src/overlays/settings-selector.ts +3 -0
- package/src/prompt/composer.ts +158 -11
- package/src/prompt/custom-editor.ts +19 -1
- package/src/prompt/internal-url-autocomplete.ts +1 -0
- package/src/prompt/macos-spelling.ts +28 -5
- package/src/prompt/prose-gate.ts +3 -0
- package/src/prompt/queued-messages.ts +9 -2
- package/src/prompt/typing-word.ts +59 -0
- package/src/status-line/component.ts +18 -10
- package/src/status-line/footer.ts +18 -35
- package/src/status-line/host.ts +6 -1
- package/src/status-line/segments.ts +15 -5
- package/src/terminal-capabilities.ts +9 -19
- package/src/terminal.ts +97 -24
- package/src/theme/symbols.ts +1 -0
- package/src/theme/theme-class.ts +1 -0
- package/src/tools/eval.ts +40 -7
- package/src/tools/task.ts +8 -0
- package/src/tui.ts +28 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [18.11.3] - 2026-10-16
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added selection-only session and model picker actions for `/seance`, so choosing a source or model leaves the active session and model unchanged ([#15036](https://github.com/can1357/oh-my-pi/pull/15036) by [@anatoli-tsinovoy](https://github.com/anatoli-tsinovoy))
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- `ApprovalDialogComponent` shows a choice list (Approve, an optional `session` row, Deny): the arrow keys move between them and Enter (armed after `APPROVE_ARM_MS`) takes the highlighted one; while a composer draft holds Enter the highlight sits on Deny, relabeled "Deny and send message"; Tern clicks on a choice take it; Page Up/Down scroll the details
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Fixed a streamed Markdown list keeping every item out of native scrollback until the turn ended, so rows that scrolled off screen were unreachable mid-stream; items in front of the newest one now retire as soon as it begins ([#13676](https://github.com/can1357/oh-my-pi/issues/13676), [#15993](https://github.com/can1357/oh-my-pi/pull/15993) by [@shgew](https://github.com/shgew))
|
|
18
|
+
- Fixed SIXEL charts and SVG figures being resampled before display, which softened their text, on terminals whose cell height is not a multiple of 6 such as Windows Terminal ([#16007](https://github.com/can1357/oh-my-pi/issues/16007))
|
|
19
|
+
|
|
20
|
+
## [18.11.2] - 2026-10-16
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Improved nested tool status line rendering: moved preview content into a dedicated collapsible code block when expanded and limited field widths on the one-line summary
|
|
25
|
+
- Suppressed typo highlighting for the word currently being typed to avoid distracting inline markers while composing
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Fixed double-clicking an extension switched off in `/extensions` in Tern not switching it back on
|
|
30
|
+
- Fixed the queued-messages badge in Tern showing a bare count that read as the first message's number; it now reads `N queued`
|
|
31
|
+
- Fixed table charts on TSP terminals to use SVG fences and respect terminal palette
|
|
32
|
+
- Fixed table charts in Tern's native view drawing in the other appearance's colors (light labels on a light page) when omp's light/dark detection disagreed with Tern; Tern now colors them in the theme it shows, like the prose around them
|
|
33
|
+
- Fixed the /btw history answer being stuck at the bottom while a follow-up is being written: Up/Down and Page Up/Down now scroll the answer without leaving the draft ([#15902](https://github.com/can1357/oh-my-pi/pull/15902) by [@H4vC](https://github.com/H4vC))
|
|
34
|
+
- Fixed macOS editor spelling assistance hanging silently when the spelling service stops responding; it now reports and disables itself instead ([#12084](https://github.com/can1357/oh-my-pi/issues/12084), [#14341](https://github.com/can1357/oh-my-pi/pull/14341) by [@F0Rextasy](https://github.com/F0Rextasy))
|
|
35
|
+
- Fixed a chip toggled in a multi-select setting's open submenu leaving its row and its tab's changed badge showing the old selection until the submenu was closed ([#14444](https://github.com/can1357/oh-my-pi/pull/14444) by [@F0Rextasy](https://github.com/F0Rextasy))
|
|
36
|
+
- Fixed `@` file autocomplete freezing when the project contains a symlink into a very large directory tree; the fuzzy walk now stops after 1.5 s and the popup falls back to the immediate-directory listing ([#12317](https://github.com/can1357/oh-my-pi/issues/12317), [#14330](https://github.com/can1357/oh-my-pi/pull/14330) by [@F0Rextasy](https://github.com/F0Rextasy))
|
|
37
|
+
- Fixed omp in a Tern pane showing the classic CLI when a shell rc, dev shell or `.env` set `TERM` to a `screen*`/`tmux*` value with no multiplexer running; only a real tmux/screen/zellij/herdr/cmux/wmux session now keeps Tern's native view off
|
|
38
|
+
- omp inside devenv 2.x's reloading `devenv shell` now starts on the classic renderer instead of opening Tern's native view and abandoning it: devenv's terminal layer drops Tern's protocol, so the native view needs `devenv shell --no-reload`. The debug log now records why a Tern pane stays on the classic renderer
|
|
39
|
+
- Fixed large terminal paints on Windows being split mid-row, which let other output land inside a row; writes are now cut at row boundaries ([#14187](https://github.com/can1357/oh-my-pi/pull/14187) by [@mateusant13](https://github.com/mateusant13))
|
|
40
|
+
- Fixed `TUI.addStartListener()` hooks added after `start()` never running until the next stop/start cycle; a hook added to a running TUI now runs at once ([#15369](https://github.com/can1357/oh-my-pi/pull/15369) by [@LoneExile](https://github.com/LoneExile))
|
|
41
|
+
- Fixed the git viewer advertising stage, discard, select and commit keys while showing a clean tree's HEAD commit, where none of them do anything; the footer and sidebar now describe the commit view ([#14347](https://github.com/can1357/oh-my-pi/issues/14347), [#14480](https://github.com/can1357/oh-my-pi/pull/14480) by [@F0Rextasy](https://github.com/F0Rextasy))
|
|
42
|
+
- Fixed the status line `pr` segment keeping the previous branch's PR after switching to the default branch, a detached HEAD, or a branch without a PR ([#15455](https://github.com/can1357/oh-my-pi/pull/15455) by [@ravshansbox](https://github.com/ravshansbox))
|
|
43
|
+
- Fixed the status-line footer total leaving out task subagent spend; it now reads the session's cumulative usage, the same source the interactive status line uses ([#14393](https://github.com/can1357/oh-my-pi/pull/14393) by [@F0Rextasy](https://github.com/F0Rextasy))
|
|
44
|
+
- Fixed transcript rows disappearing from scrollback or reappearing out of order when bottom chrome stays taller after a turn, self-clearing HUDs close, or the composer shape changes ([#15820](https://github.com/can1357/oh-my-pi/pull/15820) by [@emmahyde](https://github.com/emmahyde))
|
|
45
|
+
|
|
5
46
|
## [18.11.1] - 2026-10-15
|
|
6
47
|
|
|
7
48
|
### Added
|
|
@@ -2542,130 +2583,4 @@
|
|
|
2542
2583
|
- Fixed visible tail line updates when appending new content during viewport overflow conditions
|
|
2543
2584
|
- Fixed cursor positioning instability when appending content under external cursor relocation by using absolute screen addressing instead of relative cursor movement
|
|
2544
2585
|
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
### Breaking Changes
|
|
2548
|
-
|
|
2549
|
-
- Removed `getMermaidImage` callback from MarkdownTheme; replaced with `getMermaidAscii` that accepts ASCII string instead of image data
|
|
2550
|
-
- Removed mermaid module exports (`renderMermaidToPng`, `extractMermaidBlocks`, `prerenderMermaidBlocks`, `MermaidImage` interface)
|
|
2551
|
-
|
|
2552
|
-
### Changed
|
|
2553
|
-
|
|
2554
|
-
- Mermaid diagrams now render as ASCII text instead of terminal graphics protocol images
|
|
2555
|
-
|
|
2556
|
-
## [13.5.1] - 2026-03-01
|
|
2557
|
-
|
|
2558
|
-
### Fixed
|
|
2559
|
-
|
|
2560
|
-
- Fixed viewport shift handling to prevent stale content when mixed updates remap screen rows
|
|
2561
|
-
|
|
2562
|
-
## [13.5.0] - 2026-03-01
|
|
2563
|
-
|
|
2564
|
-
### Breaking Changes
|
|
2565
|
-
|
|
2566
|
-
- Removed `PI_TUI_RESIZE_CLEAR_STRATEGY`; resize behavior is no longer configurable between viewport/scrollback modes. The renderer now uses fixed semantics: width changes perform a hard reset (`3J` + full content rewrite), while height changes and diff fallbacks use viewport-scoped repainting.
|
|
2567
|
-
|
|
2568
|
-
### Added
|
|
2569
|
-
|
|
2570
|
-
- Added a new terminal regression suite in `packages/tui/test/render-regressions.test.ts` covering no-op render stability, targeted middle-line diffs, shrink cleanup, width-resize truncation without ghost rows, shrink/grow viewport tail anchoring, scrollback deduplication across forced redraws, overlay restore behavior, and rapid mutation convergence.
|
|
2571
|
-
- Expanded `packages/tui/test/overlay-scroll.test.ts` with stress coverage for overflow shrink/regrow cycles, resize oscillation, overlay toggle churn, no-op render loops, and hardware-cursor-only updates while bounding scrollback growth and blank-run artifacts.
|
|
2572
|
-
|
|
2573
|
-
### Changed
|
|
2574
|
-
|
|
2575
|
-
- Refactored render orchestration to explicit `hardReset` and `viewportRepaint` paths, with targeted fallbacks for offscreen diff ranges and unsafe row deltas.
|
|
2576
|
-
- Switched startup to `requestRender(true)` so the first frame always initializes renderer state with a forced full path.
|
|
2577
|
-
- Replaced legacy viewport bookkeeping (`previousViewportTop`) with `viewportTopRow` tracking and consistent screen-relative cursor calculations.
|
|
2578
|
-
- Updated stop-sequence cursor placement to target the visible working area and clamp to terminal bounds before final newline emission.
|
|
2579
|
-
- Documented the intentional performance policy of not forcing full repaint on every viewport-top shift, relying on narrower safety guards instead.
|
|
2580
|
-
|
|
2581
|
-
### Fixed
|
|
2582
|
-
|
|
2583
|
-
- Fixed stale/duplicated terminal cursor dedup state by synchronizing `#lastCursorSequence` in all render write paths (hard reset, viewport repaint, deleted-lines clear path, append fast path, and differential path).
|
|
2584
|
-
- Fixed scroll overshoot on `stop()` when content fills the viewport by clamping target row movement to valid screen rows.
|
|
2585
|
-
|
|
2586
|
-
## [13.4.0] - 2026-03-01
|
|
2587
|
-
|
|
2588
|
-
### Added
|
|
2589
|
-
|
|
2590
|
-
- Added `PI_TUI_RESIZE_CLEAR_STRATEGY` environment variable to control terminal behavior on resize: `viewport` (default) clears/redraws the viewport while preserving scrollback, or `scrollback` clears all history
|
|
2591
|
-
|
|
2592
|
-
### Changed
|
|
2593
|
-
|
|
2594
|
-
- Changed resize redraw behavior to use configurable clear semantics (`viewport` vs `scrollback`) while keeping full content rendering for scrollback navigation
|
|
2595
|
-
|
|
2596
|
-
### Fixed
|
|
2597
|
-
|
|
2598
|
-
- Fixed loader component rendering lines wider than terminal width, preventing text overflow and display artifacts
|
|
2599
|
-
|
|
2600
|
-
## [13.3.11] - 2026-02-28
|
|
2601
|
-
|
|
2602
|
-
### Fixed
|
|
2603
|
-
|
|
2604
|
-
- Restored terminal image protocol override and fallback detection for image rendering, including `PI_FORCE_IMAGE_PROTOCOL` support and Kitty fallback for screen/tmux/ghostty-style TERM environments.
|
|
2605
|
-
|
|
2606
|
-
## [13.3.8] - 2026-02-28
|
|
2607
|
-
|
|
2608
|
-
### Breaking Changes
|
|
2609
|
-
|
|
2610
|
-
- Changed mermaid hash type from string to bigint in `getMermaidImage` callback and `extractMermaidBlocks` return type
|
|
2611
|
-
- Removed `mime-types` and `@types/mime-types` from dependencies
|
|
2612
|
-
- Removed `@xterm/xterm` from dependencies
|
|
2613
|
-
|
|
2614
|
-
### Changed
|
|
2615
|
-
|
|
2616
|
-
- Updated mermaid hash computation to use `Bun.hash.xxHash64()` instead of `Bun.hash().toString(16)`
|
|
2617
|
-
|
|
2618
|
-
## [12.19.0] - 2026-02-22
|
|
2619
|
-
|
|
2620
|
-
### Added
|
|
2621
|
-
|
|
2622
|
-
- Added `getTopBorderAvailableWidth()` method to calculate available width for top border content accounting for border characters and padding
|
|
2623
|
-
|
|
2624
|
-
### Fixed
|
|
2625
|
-
|
|
2626
|
-
- Fixed stale viewport rows appearing when terminal height increases by triggering full re-render on height changes
|
|
2627
|
-
|
|
2628
|
-
## [12.18.0] - 2026-02-21
|
|
2629
|
-
|
|
2630
|
-
### Fixed
|
|
2631
|
-
|
|
2632
|
-
- Fixed viewport synchronization issue by clearing scrollback when terminal state becomes desynced during full re-renders
|
|
2633
|
-
|
|
2634
|
-
## [12.12.2] - 2026-02-19
|
|
2635
|
-
|
|
2636
|
-
### Fixed
|
|
2637
|
-
|
|
2638
|
-
- Fixed non-forced full re-renders clearing terminal scrollback history during streaming updates by limiting scrollback clears to explicit forced re-renders.
|
|
2639
|
-
|
|
2640
|
-
## [12.12.0] - 2026-02-19
|
|
2641
|
-
|
|
2642
|
-
### Added
|
|
2643
|
-
|
|
2644
|
-
- Added PageUp/PageDown navigation for editor content and autocomplete selection to jump across long wrapped inputs faster.
|
|
2645
|
-
|
|
2646
|
-
### Fixed
|
|
2647
|
-
|
|
2648
|
-
- Fixed history-entry navigation anchoring (Up opens at top, Down opens at bottom) and preserved editor scroll context when max-height changes to keep cursor movement visible in long prompts ([#99](https://github.com/can1357/oh-my-pi/issues/99)).
|
|
2649
|
-
|
|
2650
|
-
## [12.11.3] - 2026-02-19
|
|
2651
|
-
|
|
2652
|
-
### Fixed
|
|
2653
|
-
|
|
2654
|
-
- Fixed differential deleted-line rendering when content shrinks to empty so stale first-row content is cleared reliably.
|
|
2655
|
-
- Fixed incremental stale-row clearing to use erase-below semantics in synchronized output, reducing leftover-line artifacts after shrink operations.
|
|
2656
|
-
|
|
2657
|
-
## [12.9.0] - 2026-02-17
|
|
2658
|
-
|
|
2659
|
-
### Added
|
|
2660
|
-
|
|
2661
|
-
- Exported `getTerminalId()` function to get a stable identifier for the current terminal, with support for TTY device paths and terminal multiplexers
|
|
2662
|
-
- Exported `getTtyPath()` function to resolve the TTY device path for stdin via POSIX `ttyname(3)`
|
|
2663
|
-
|
|
2664
|
-
## [12.5.0] - 2026-02-15
|
|
2665
|
-
|
|
2666
|
-
### Added
|
|
2667
|
-
|
|
2668
|
-
- Added `cursorOverride` and `cursorOverrideWidth` properties to customize the end-of-text cursor glyph with ANSI-styled strings
|
|
2669
|
-
- Added `getUseTerminalCursor()` method to query the terminal cursor mode setting
|
|
2670
|
-
|
|
2671
|
-
Older entries are archived in [packages/tui/CHANGELOG.md@090e359aa972](https://github.com/can1357/oh-my-pi/blob/090e359aa97267de88bd365054685c8234843cd7/packages/tui/CHANGELOG.md).
|
|
2586
|
+
Older entries are archived in [packages/tui/CHANGELOG.md@20c388be2131](https://github.com/can1357/oh-my-pi/blob/20c388be2131e06f731a8759ec3ab6121d6ada1c/packages/tui/CHANGELOG.md).
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* scrollbar, right sidebar (file management + commit form while dirty, HEAD
|
|
8
8
|
* commit details with author avatar when clean). Submitting an empty commit
|
|
9
9
|
* form generates an llm-git-compatible message; submitting populated fields
|
|
10
|
-
* commits them. A footer shows key hints
|
|
10
|
+
* commits them. A footer shows key hints; the staging and discarding ones are
|
|
11
|
+
* omitted while the tree is clean, where they cannot fire.
|
|
11
12
|
*
|
|
12
13
|
* `tab` moves focus between the diff and the sidebar; both panes take
|
|
13
14
|
* arrows/PgUp/PgDn, vim motions (`j`/`k`/`h`/`l`/`g`/`G`), and mouse
|
|
@@ -22,7 +23,8 @@
|
|
|
22
23
|
* refreshes. In the sidebar tree `←`/`→` collapse/expand directories,
|
|
23
24
|
* `enter` opens the selected file in the diff pane, `space` stages or
|
|
24
25
|
* unstages the selected row, and `delete` discards it — on a directory,
|
|
25
|
-
* every file underneath it.
|
|
26
|
+
* every file underneath it. All of the staging and discarding keys are inert
|
|
27
|
+
* on a clean tree, which shows the HEAD commit instead of a change list.
|
|
26
28
|
*/
|
|
27
29
|
import { TUI } from "../../tui.js";
|
|
28
30
|
import type { AvatarSource } from "./avatar.js";
|
|
@@ -58,6 +60,17 @@ export interface GitTuiHost {
|
|
|
58
60
|
stagedAll: boolean;
|
|
59
61
|
}>;
|
|
60
62
|
}
|
|
63
|
+
type Focus = "diff" | "sidebar";
|
|
64
|
+
/**
|
|
65
|
+
* Footer key hints. A clean tree renders the HEAD commit view, where stage
|
|
66
|
+
* and discard cannot fire: `#patchTargetFor` returns null and
|
|
67
|
+
* `#discardCurrentFile` returns early for `area: "commit"` rows, and the
|
|
68
|
+
* sidebar only builds stage/discard actions for the unstaged/staged
|
|
69
|
+
* sections. `commit` needs the commit form (absent on a clean tree) and
|
|
70
|
+
* `select` feeds the line-level stage/discard actions (no-ops on commit
|
|
71
|
+
* rows), so the commit view drops those too and says what it is showing.
|
|
72
|
+
*/
|
|
73
|
+
export declare function gitFooterHints(clean: boolean, focus: Focus): string;
|
|
61
74
|
/**
|
|
62
75
|
* Mount the git TUI as a fullscreen overlay on an existing TUI (the `/git`
|
|
63
76
|
* slash command). Resolves when the user closes it; the caller restores focus.
|
|
@@ -65,3 +78,4 @@ export interface GitTuiHost {
|
|
|
65
78
|
export declare function showGitOverlay(ui: TUI, host: GitTuiHost): Promise<void>;
|
|
66
79
|
/** Run the fullscreen git TUI standalone (`omp git`) until the user quits. */
|
|
67
80
|
export declare function runGitTui(host: GitTuiHost): Promise<void>;
|
|
81
|
+
export {};
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* Draws a {@link ChartSpec} as a standalone SVG document colored only with
|
|
3
3
|
* figure tokens — `var(--fg)`, `var(--muted)`, `var(--border)`,
|
|
4
4
|
* `var(--accent)`, `var(--surface)`, `var(--c1)`…`var(--c6)` — on a
|
|
5
|
-
* transparent background — the token vocabulary of assistant ```svg figures
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* transparent background — the token vocabulary of assistant ```svg figures:
|
|
6
|
+
* the host resolves them against the live theme (`prepareSvg`) for the
|
|
7
|
+
* rasterized terminal image, and a TSP terminal draws the chart as an ```svg
|
|
8
|
+
* figure in the palette it shows. The root carries {@link chartAlt} as its
|
|
9
|
+
* `aria-label`.
|
|
8
10
|
*
|
|
9
11
|
* Styled after Apple's charts and Tern's UI: a UI sans (Geist where Tern
|
|
10
12
|
* provides it), muted labels, hairline gridlines that recede behind the
|
|
@@ -39,16 +41,8 @@
|
|
|
39
41
|
*/
|
|
40
42
|
import { type ChartSpec } from "./chart-plan.js";
|
|
41
43
|
import { type Dimension } from "./table-data.js";
|
|
42
|
-
/**
|
|
43
|
-
export
|
|
44
|
-
readonly svg: string;
|
|
45
|
-
readonly width: number;
|
|
46
|
-
readonly height: number;
|
|
47
|
-
}
|
|
48
|
-
/** The SVG document for `spec`. */
|
|
49
|
-
export declare function renderChartSvg(spec: ChartSpec): ChartSvg;
|
|
50
|
-
/** One-line description of the chart, for screen readers and terminals that show the alt text. */
|
|
51
|
-
export declare function chartAlt(spec: ChartSpec): string;
|
|
44
|
+
/** The SVG document for `spec`, labeled for screen readers with {@link chartAlt}. */
|
|
45
|
+
export declare function renderChartSvg(spec: ChartSpec): string;
|
|
52
46
|
/**
|
|
53
47
|
* A value in base units as an axis label: durations and sizes in the unit,
|
|
54
48
|
* counts compacted under the suffix (`12k`, `3.4M`), that `magnitude` reads
|
|
@@ -2,7 +2,6 @@ import type { Tokens } from "@oh-my-pi/pi-utils/marked";
|
|
|
2
2
|
import { type ChartPlan } from "../charts/chart-plan.js";
|
|
3
3
|
import { type TableAnalysis } from "../charts/table-data.js";
|
|
4
4
|
import type { ImageBudget } from "../components/image.js";
|
|
5
|
-
import type { NativeNode } from "../native/node.js";
|
|
6
5
|
import type { Component } from "../tui.js";
|
|
7
6
|
/**
|
|
8
7
|
* `smart`: a model refines the local guess where meaning decides (kind,
|
|
@@ -24,17 +23,11 @@ export interface TableChartRequest {
|
|
|
24
23
|
* for no chart. A rejection falls back to the local guess.
|
|
25
24
|
*/
|
|
26
25
|
export type TableChartPlanner = (request: TableChartRequest) => Promise<ChartPlan | null>;
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/** Size in SVG user units. */
|
|
33
|
-
readonly width: number;
|
|
34
|
-
readonly height: number;
|
|
35
|
-
}
|
|
36
|
-
/** The chart under a table: drawn, none, or a smart pick on its way (the promise settles once the cache holds it). */
|
|
37
|
-
export type ChartLookup = TableChart | null | Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* The chart under a table: its SVG, colored with figure tokens (`var(--accent)`, …)
|
|
28
|
+
* still to resolve; none; or a smart pick on its way (the promise settles once the cache holds it).
|
|
29
|
+
*/
|
|
30
|
+
export type ChartLookup = string | null | Promise<void>;
|
|
38
31
|
/** One run of a Markdown block: prose (ending at a charted table), or the chart drawn after that table. */
|
|
39
32
|
export type ChartSegment = {
|
|
40
33
|
readonly kind: "markdown";
|
|
@@ -60,10 +53,13 @@ export declare function splitTableCharts(markdown: string, streaming: boolean):
|
|
|
60
53
|
*/
|
|
61
54
|
export declare function lookupTableChart(table: Tokens.Table): ChartLookup;
|
|
62
55
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
56
|
+
* Chart `svg` as a Markdown ```svg fence, for a TSP terminal's `md` node. Its
|
|
57
|
+
* figure tokens stay unresolved: the terminal draws the fence as a figure in
|
|
58
|
+
* the palette it shows the prose in, so the chart cannot fall out of step with
|
|
59
|
+
* the page when omp's own idea of the appearance does, and a theme switch
|
|
60
|
+
* recolors it without a resend.
|
|
65
61
|
*/
|
|
66
|
-
export declare function
|
|
62
|
+
export declare function chartFence(svg: string): string;
|
|
67
63
|
export interface TableChartFigureOptions {
|
|
68
64
|
/** Shared inline-image budget. */
|
|
69
65
|
budget?: ImageBudget;
|
|
@@ -100,6 +100,8 @@ export declare class TranscriptContainer extends Container {
|
|
|
100
100
|
blockModes(): readonly TranscriptBlockMode[];
|
|
101
101
|
/** Emitted stable semantic-row counts in transcript order. */
|
|
102
102
|
emittedStableRows(): readonly number[];
|
|
103
|
+
/** Whether any block is still streaming or otherwise unfinalized. */
|
|
104
|
+
hasActiveBlock(): boolean;
|
|
103
105
|
/** Whether visible active capacity and live-block memory permit another admission. */
|
|
104
106
|
canAdmit(rows: number): boolean;
|
|
105
107
|
/** Prepares one atomic replay of the committed ledger and an emitted active-head prefix. */
|
|
@@ -185,9 +185,10 @@ export declare class Markdown implements Component {
|
|
|
185
185
|
*/
|
|
186
186
|
describe(_cx: DescribeContext): NativeNode;
|
|
187
187
|
/**
|
|
188
|
-
* Width-independent source prefix of the last render
|
|
189
|
-
*
|
|
190
|
-
* display-math opener whose block an append could still close
|
|
188
|
+
* Width-independent source prefix of the last render that no append can
|
|
189
|
+
* change: up to a frozen Markdown block boundary, stopping in front of a
|
|
190
|
+
* display-math opener whose block an append could still close, or, while a
|
|
191
|
+
* list streams as the last block, up to its newest top-level item. Only
|
|
191
192
|
* meaningful while streaming (transient render cache on); grows
|
|
192
193
|
* monotonically under append-only `setText`.
|
|
193
194
|
*/
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { AgentMetricsSummary, AgentRecordLike, AgentStatus } from "./agent-hub-types.js";
|
|
2
2
|
import type { ObservableSession } from "./session-observer-registry.js";
|
|
3
3
|
export type AgentMetrics = AgentMetricsSummary;
|
|
4
|
+
export interface AgentCostSnapshot {
|
|
5
|
+
cost: number | undefined;
|
|
6
|
+
}
|
|
4
7
|
export interface AggregateMetrics extends AgentMetrics {
|
|
5
8
|
reportedAgents: number;
|
|
6
9
|
/** Rows whose duration is an observer-measured active runtime. */
|
|
@@ -17,14 +20,16 @@ export declare const STATUS_ORDER: Record<AgentStatus, number>;
|
|
|
17
20
|
export declare function progressMetrics(observed: ObservableSession | undefined): AgentMetrics | undefined;
|
|
18
21
|
/** Live session used to cache a row's direct assistant usage, including with observer progress. */
|
|
19
22
|
export declare function hubFallbackStatsSession<TRecord extends AgentRecordLike>(ref: TRecord, observed: ObservableSession | undefined): NonNullable<TRecord["session"]> | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Preserve progress/history for non-cost metrics, overlaying cumulative direct-session cost.
|
|
22
|
-
* Persisted `history.metrics.cost` is a leaf-scoped snapshot, so it never overrides live
|
|
23
|
-
* progress; only the cumulative direct-cost sources do.
|
|
24
|
-
*/
|
|
23
|
+
/** Full Agent Hub row metrics; see {@link projectRowMetrics} for source precedence. */
|
|
25
24
|
export declare function hubRowMetrics<TRecord extends AgentRecordLike>(ref: TRecord, observed: ObservableSession | undefined, sessionMetrics: WeakMap<object, {
|
|
26
25
|
metrics: AgentMetrics | undefined;
|
|
27
26
|
}>): AgentMetrics | undefined;
|
|
27
|
+
/** Cost-only projection for frequent status updates; full roster metrics keep their own cache. */
|
|
28
|
+
export declare function aggregateCost<TRecord extends AgentRecordLike>(args: {
|
|
29
|
+
rows: readonly TRecord[];
|
|
30
|
+
observedById: ReadonlyMap<string, ObservableSession>;
|
|
31
|
+
sessionCosts: WeakMap<object, AgentCostSnapshot>;
|
|
32
|
+
}): number;
|
|
28
33
|
export declare function aggregateMetrics<TRecord extends AgentRecordLike>(args: {
|
|
29
34
|
rows: readonly TRecord[];
|
|
30
35
|
observedById: ReadonlyMap<string, ObservableSession>;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tool-approval prompt in the composer's place, presented like the ask
|
|
3
|
-
* dialog: the approval title and its details over
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
3
|
+
* dialog: the approval title and its details over a list of choices —
|
|
4
|
+
* Approve, an optional "approve for this session", and Deny — and an action
|
|
5
|
+
* bar. The arrows move between the choices and Enter takes the highlighted
|
|
6
|
+
* one; `app.approval.approve` (Ctrl+Enter by default) approves this call
|
|
7
|
+
* outright and Esc denies. Enter and the approve chord only arm
|
|
8
|
+
* {@link APPROVE_ARM_MS} after mount, so a key meant for the composer (Enter,
|
|
9
|
+
* or the follow-up chord pressed mid-run) as the prompt appears never answers
|
|
10
|
+
* it. With an {@link ApprovalDialogDraft}, every other key edits the composer
|
|
11
|
+
* mounted beneath the dialog, so a message can deny the call and steer the
|
|
12
|
+
* turn instead: while the composer holds a draft, the arrows and Enter edit and
|
|
13
|
+
* send it, and the highlight sits on Deny, relabeled to say Enter sends.
|
|
14
|
+
* The prompt stays a few rows so the composer keeps its room; Page Up/Down
|
|
15
|
+
* scroll the details, and with a full prompt the expand key
|
|
16
|
+
* (`app.tools.expand`) swaps it in, wrapped.
|
|
13
17
|
*/
|
|
14
18
|
import { type Component, type TUI } from "../index.js";
|
|
15
|
-
import type
|
|
16
|
-
/**
|
|
19
|
+
import { type NativeNode, type NativeUiEvent } from "../native/node.js";
|
|
20
|
+
/** Enter and the approve key are ignored this long after mount, so a key sent as the prompt appears cannot answer it. */
|
|
17
21
|
export declare const APPROVE_ARM_MS = 500;
|
|
18
22
|
interface ApprovalDialogCallbacks {
|
|
19
23
|
onApprove(): void;
|
|
@@ -39,6 +43,11 @@ interface ApprovalDialogOptions {
|
|
|
39
43
|
onTimeoutReset?: () => void;
|
|
40
44
|
/** Route typing to the composer instead of dropping it. */
|
|
41
45
|
draft?: ApprovalDialogDraft;
|
|
46
|
+
/** Offer to approve this and later like calls for the rest of the session, as the row between Approve and Deny. */
|
|
47
|
+
session?: {
|
|
48
|
+
label: string;
|
|
49
|
+
onApprove(): void;
|
|
50
|
+
};
|
|
42
51
|
}
|
|
43
52
|
export declare class ApprovalDialogComponent implements Component {
|
|
44
53
|
#private;
|
|
@@ -59,11 +68,12 @@ export declare class ApprovalDialogComponent implements Component {
|
|
|
59
68
|
/**
|
|
60
69
|
* In the dock, in the composer's place and framed as the composer is (an
|
|
61
70
|
* `omp.editor.*` root role), like the ask dialog, rather than a card over
|
|
62
|
-
* the transcript: the title, the details,
|
|
63
|
-
*
|
|
71
|
+
* the transcript: the title, the details, the choices with the keyboard's
|
|
72
|
+
* highlight (a click takes one), then Details (with a full prompt), Deny,
|
|
73
|
+
* and the primary Approve, whose keys show in their tooltips.
|
|
64
74
|
*/
|
|
65
75
|
describe(): NativeNode;
|
|
66
|
-
/** Deny, Approve, and Details run exactly what Esc, the approve key, and the expand key run. */
|
|
76
|
+
/** Deny, Approve, and Details run exactly what Esc, the approve key, and the expand key run; a click on a choice takes it. */
|
|
67
77
|
handleNativeEvent(event: NativeUiEvent): void;
|
|
68
78
|
}
|
|
69
79
|
export {};
|
|
@@ -57,6 +57,8 @@ export interface ModelPickerOptions {
|
|
|
57
57
|
taskModeKeys?: readonly KeyId[];
|
|
58
58
|
/** `provider/id` highlighted and preselected in task mode (current Task subagent model). */
|
|
59
59
|
taskSelector?: string;
|
|
60
|
+
/** Present selection-only chrome; consumers handle the chosen selector without mutating a session. */
|
|
61
|
+
selectOnly?: boolean;
|
|
60
62
|
}
|
|
61
63
|
/** Rows the browser renders around its list window (search + blank, blank + two detail rows). */
|
|
62
64
|
export declare const BROWSER_FRAME_ROWS = 5;
|
|
@@ -127,6 +127,8 @@ export interface SessionSelectorOptions<T extends SessionSelectorEntry = Session
|
|
|
127
127
|
allSessions?: T[];
|
|
128
128
|
/** Picker heading; defaults to "Resume Session". */
|
|
129
129
|
title?: string;
|
|
130
|
+
/** Primary action label; defaults to "Resume" (ANSI footer defaults to "select"). */
|
|
131
|
+
actionLabel?: string;
|
|
130
132
|
/** Fixed scope label, or false to omit the scope suffix. */
|
|
131
133
|
scopeLabel?: string | false;
|
|
132
134
|
/**
|
|
@@ -59,6 +59,20 @@ export interface RuntimeChildrenOptions {
|
|
|
59
59
|
* to the roots below the transcript in render order.
|
|
60
60
|
*/
|
|
61
61
|
readonly nativeDock?: readonly Component[];
|
|
62
|
+
/**
|
|
63
|
+
* Below-transcript roots the user opens and closes (the editor surface that
|
|
64
|
+
* drafts and dialogs swap into, docked reports). Their rows never become
|
|
65
|
+
* part of the post-run chrome floor, so collapsing them refills the screen.
|
|
66
|
+
*/
|
|
67
|
+
readonly transientChrome?: readonly Component[];
|
|
68
|
+
/**
|
|
69
|
+
* Transient roots that clear themselves (todo and subagent HUDs, progress).
|
|
70
|
+
* Their first paint can be their tallest, e.g. a restored todo list on a
|
|
71
|
+
* resumed session, so unlike {@link transientChrome} it is never treated as
|
|
72
|
+
* their resting height: all of their rows stay out of the floor. Roots listed
|
|
73
|
+
* here are transient and need not also appear in `transientChrome`.
|
|
74
|
+
*/
|
|
75
|
+
readonly selfClearingChrome?: readonly Component[];
|
|
62
76
|
}
|
|
63
77
|
/** Controls the first terminal paint for a composer that does not already own the terminal. */
|
|
64
78
|
export interface ComposerStartOptions {
|
|
@@ -157,6 +171,12 @@ export declare class Composer implements TerminalFrameProvider, NativeSurfacePro
|
|
|
157
171
|
setPreferences(update: Partial<ComposerPreferences>): void;
|
|
158
172
|
/** Patch welcome data in place as version, session, and project discovery complete. */
|
|
159
173
|
updateWelcome(update: ComposerWelcomeUpdate): void;
|
|
174
|
+
/**
|
|
175
|
+
* Mark whether a host agent run is in flight. Mid-run gaps with no streaming
|
|
176
|
+
* block (tool arguments not yet parseable, between tool calls) then do not
|
|
177
|
+
* count as the run ending when the post-run chrome floor is decided.
|
|
178
|
+
*/
|
|
179
|
+
setRunActive(active: boolean): void;
|
|
160
180
|
/** Replace optional header content around the stable welcome scene. */
|
|
161
181
|
setHeaderExtras(before: readonly Component[], after: readonly Component[]): void;
|
|
162
182
|
/** Update the canonical editor reference after InteractiveMode remounts a custom editor. */
|
|
@@ -198,6 +198,8 @@ export declare class CustomEditor extends Editor {
|
|
|
198
198
|
* item markers use the accent color so separate follow-ups remain visible while composing.
|
|
199
199
|
* Called once per layout segment, so whole-buffer inputs are computed once per text revision. */
|
|
200
200
|
decorateText: (text: string, context: EditorTextDecorationContext) => string;
|
|
201
|
+
/** Catch the typed word up with the caret first: its leaving the word (or a blur) re-describes the typo marks. */
|
|
202
|
+
describe(cx: DescribeContext): NativeNode;
|
|
201
203
|
/**
|
|
202
204
|
* TSP decorations: magic keywords shimmer (terminal-clocked) in the accent
|
|
203
205
|
* color, chips and markers take their token colors, misspellings are marked,
|
|
@@ -30,7 +30,8 @@ export declare class MacOSSpellingProvider implements EditorTextAssistProvider {
|
|
|
30
30
|
decorateTypos(text: string, context: SpellingDecorationContext, decorate?: (span: string) => string): string;
|
|
31
31
|
/**
|
|
32
32
|
* Misspelled prose ranges in `text` (offsets into it), in order and
|
|
33
|
-
* non-overlapping
|
|
33
|
+
* non-overlapping, except ones touching `context.typing` (the word still
|
|
34
|
+
* being typed). Schedules the verification check for uncached text; its
|
|
34
35
|
* result arrives through {@link onUpdate}.
|
|
35
36
|
*/
|
|
36
37
|
typoRanges(text: string, context: SpellingDecorationContext): readonly native.SpellingRange[];
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import type { TypingWord } from "./typing-word.js";
|
|
1
2
|
/** Logical source location for one rendered editor segment. */
|
|
2
3
|
export interface SpellingDecorationContext {
|
|
3
4
|
editorText: string;
|
|
4
5
|
lines: readonly string[];
|
|
5
6
|
line: number;
|
|
6
7
|
startCol: number;
|
|
8
|
+
/** The word being typed: typo marks touching it wait until the caret leaves it. */
|
|
9
|
+
typing?: TypingWord | undefined;
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
12
|
* Whether `text[start, end)` is a prose word: unmasked by {@link maskNonProse},
|
|
@@ -10,7 +10,7 @@ export interface QueuedMessageGroup {
|
|
|
10
10
|
* Messages queued while the agent works, above the editor. ANSI: a heading
|
|
11
11
|
* per group, numbered dim rows and the dequeue hint. Natively (§8.1): a
|
|
12
12
|
* stack of pills, each `corner-down-right` · the text · `⌥↑ Edit`, the total
|
|
13
|
-
*
|
|
13
|
+
* (`N queued`, not a position) in the first pill when more than one waits; the edit control sends
|
|
14
14
|
* `queue.edit`, answered like the dequeue key.
|
|
15
15
|
*/
|
|
16
16
|
export declare class QueuedMessagesBand extends Container {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The word being typed in the composer. Misspelling marks hold off on it until
|
|
3
|
+
* the caret leaves it (a space or punctuation, a caret move, losing focus), the
|
|
4
|
+
* way Slack and Chromium mark a typo only once its word is done; marks on other
|
|
5
|
+
* words stay while typing.
|
|
6
|
+
*/
|
|
7
|
+
/** A word of one logical line, as UTF-16 columns `[start, end)`. */
|
|
8
|
+
export interface TypingWord {
|
|
9
|
+
line: number;
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
}
|
|
13
|
+
/** Follows an editor's text revision and caret to know which word is being typed. */
|
|
14
|
+
export declare class TypingWordTracker {
|
|
15
|
+
#private;
|
|
16
|
+
/** The word being typed, if any. */
|
|
17
|
+
get word(): TypingWord | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Catch up with the editor: an edit that leaves the caret in (or right after)
|
|
20
|
+
* a word starts typing it; a caret move out of that word, or losing focus,
|
|
21
|
+
* ends it. The first call only records the revision, so a restored draft is
|
|
22
|
+
* not held. Returns whether the held word changed.
|
|
23
|
+
*/
|
|
24
|
+
update(revision: number, lines: readonly string[], line: number, col: number, focused: boolean): boolean;
|
|
25
|
+
}
|
|
@@ -97,11 +97,13 @@ export interface FooterSession {
|
|
|
97
97
|
autoResolvedThinkingLevel(): string | undefined;
|
|
98
98
|
getContextUsage: StatusLineSession["getContextUsage"];
|
|
99
99
|
modelRegistry: Pick<StatusLineSession["modelRegistry"], "isUsingOAuth">;
|
|
100
|
+
/**
|
|
101
|
+
* Cumulative session rollup. Unlike the active-window stats it spans every
|
|
102
|
+
* entry in the session, so compaction does not reset the counters, and it
|
|
103
|
+
* folds in usage carried by completed `task` tool results.
|
|
104
|
+
*/
|
|
100
105
|
sessionManager: {
|
|
101
|
-
|
|
102
|
-
type: string;
|
|
103
|
-
message?: AgentMessage;
|
|
104
|
-
}[];
|
|
106
|
+
getUsageStatistics: StatusLineSession["sessionManager"]["getUsageStatistics"];
|
|
105
107
|
};
|
|
106
108
|
}
|
|
107
109
|
/**
|
package/dist/types/terminal.d.ts
CHANGED
|
@@ -117,7 +117,7 @@ export type GlyphProtocolReportHandler = (supported: boolean) => void;
|
|
|
117
117
|
/**
|
|
118
118
|
* Outcome of the Tern Surface Protocol `hello` probe: the terminal's reply,
|
|
119
119
|
* or null when it answered the DA1 sentinel first (no TSP) or the probe was
|
|
120
|
-
* skipped (`PI_TUI_NATIVE=0`, multiplexers).
|
|
120
|
+
* skipped (`PI_TUI_NATIVE=0`, multiplexers, devenv's reloading shell).
|
|
121
121
|
*/
|
|
122
122
|
export type TspHelloHandler = (hello: TspHello | null) => void;
|
|
123
123
|
/**
|
|
@@ -9,7 +9,7 @@ export type SymbolMap = Record<SymbolKey, string>;
|
|
|
9
9
|
* resolves through `Theme.cmd` to either a dedicated `cmd.*` symbol or an
|
|
10
10
|
* existing `icon.*` symbol shared with the rest of the UI.
|
|
11
11
|
*/
|
|
12
|
-
export type SlashCommandIconName = "action" | "prompt" | "extension" | "settings" | "gear" | "shield" | "wave" | "compass" | "inbox" | "swap" | "expand" | "computer" | "eye" | "todo" | "stats" | "news" | "keyboard" | "export" | "clipboard" | "share" | "broadcast" | "globe" | "copy" | "plus" | "restart" | "eraser" | "trash" | "compress" | "vibrate" | "handoff" | "history" | "question" | "rocket" | "stethoscope" | "redo" | "bug" | "memory" | "pencil" | "folderMove" | "folderPlus" | "folderMinus" | "hammer" | "power" | "cart" | "model" | "plan" | "prewalk" | "goal" | "pause" | "loop" | "session" | "jobs" | "gauge" | "context" | "agents" | "branch" | "tree" | "signIn" | "signOut" | "advisor" | "host" | "package" | "fast" | "voice" | "tools" | "rule" | "skill" | "mcp" | "pin";
|
|
12
|
+
export type SlashCommandIconName = "action" | "prompt" | "extension" | "settings" | "gear" | "shield" | "wave" | "compass" | "inbox" | "swap" | "expand" | "computer" | "eye" | "todo" | "stats" | "news" | "keyboard" | "export" | "clipboard" | "share" | "broadcast" | "globe" | "copy" | "plus" | "restart" | "eraser" | "trash" | "compress" | "vibrate" | "handoff" | "history" | "question" | "rocket" | "stethoscope" | "redo" | "bug" | "memory" | "pencil" | "folderMove" | "folderPlus" | "folderMinus" | "hammer" | "power" | "cart" | "model" | "plan" | "prewalk" | "goal" | "pause" | "loop" | "session" | "jobs" | "gauge" | "context" | "ghost" | "agents" | "branch" | "tree" | "signIn" | "signOut" | "advisor" | "host" | "package" | "fast" | "voice" | "tools" | "rule" | "skill" | "mcp" | "pin";
|
|
13
13
|
export declare const SYMBOL_PRESETS: Record<SymbolPreset, SymbolMap>;
|
|
14
14
|
export type SpinnerType = "status" | "activity";
|
|
15
15
|
export declare const SPINNER_FRAMES: Record<SymbolPreset, Record<SpinnerType, string[]>>;
|