@oh-my-pi/pi-tui 18.12.2 → 18.12.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/types/autocomplete.d.ts +6 -0
  3. package/dist/types/chat/skill-message.d.ts +3 -4
  4. package/dist/types/components/sparkline.d.ts +34 -0
  5. package/dist/types/index.d.ts +1 -0
  6. package/dist/types/native/describe.d.ts +7 -1
  7. package/dist/types/native/tone.d.ts +2 -0
  8. package/dist/types/overlays/agent-hub.d.ts +3 -3
  9. package/dist/types/overlays/approval-dialog.d.ts +15 -1
  10. package/dist/types/overlays/jobs-panel.d.ts +3 -0
  11. package/dist/types/overlays/model-browser.d.ts +1 -1
  12. package/dist/types/sixel.d.ts +28 -0
  13. package/dist/types/status-line/host.d.ts +3 -0
  14. package/dist/types/tools/irc.d.ts +6 -0
  15. package/dist/types/tools/job-widget.d.ts +226 -0
  16. package/dist/types/tools/output-meta.d.ts +1 -1
  17. package/dist/types/tools/streaming-output.d.ts +1 -0
  18. package/dist/types/tools/task.d.ts +12 -0
  19. package/dist/types/tools/wait.d.ts +5 -0
  20. package/package.json +9 -9
  21. package/src/autocomplete.ts +12 -1
  22. package/src/chat/skill-message.ts +19 -21
  23. package/src/components/editor.ts +17 -7
  24. package/src/components/image.ts +5 -4
  25. package/src/components/sparkline.ts +89 -0
  26. package/src/index.ts +1 -0
  27. package/src/native/describe.ts +18 -1
  28. package/src/native/tone.ts +22 -0
  29. package/src/overlays/agent-hub.ts +14 -10
  30. package/src/overlays/agent-transcript-viewer.ts +2 -2
  31. package/src/overlays/approval-dialog.ts +59 -13
  32. package/src/overlays/jobs-panel.ts +10 -0
  33. package/src/overlays/model-browser.ts +3 -0
  34. package/src/prompt/attachment-chips.ts +1 -1
  35. package/src/sixel.ts +185 -0
  36. package/src/status-line/component.ts +19 -2
  37. package/src/status-line/host.ts +3 -0
  38. package/src/terminal-capabilities.ts +4 -1
  39. package/src/theme/symbols.ts +5 -3
  40. package/src/tools/irc.ts +6 -0
  41. package/src/tools/job-widget.ts +1036 -0
  42. package/src/tools/output-meta.ts +1 -1
  43. package/src/tools/streaming-output.ts +11 -9
  44. package/src/tools/task.ts +25 -1
  45. package/src/tools/wait.ts +141 -85
  46. package/src/tui.ts +45 -5
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.12.3] - 2026-10-19
6
+
7
+ ### Added
8
+
9
+ - Added `IrcMessage.broadcast`, set on each copy of an `agent://all` broadcast so recipients can tell it from a direct message ([#16312](https://github.com/can1357/oh-my-pi/pull/16312) by [@will-bogusz](https://github.com/will-bogusz))
10
+ - `AutocompleteItem.descriptionMatch` marks a slash command matched only through its description; `Editor` Enter no longer applies such a row unless the user moved the selection onto it ([#16265](https://github.com/can1357/oh-my-pi/issues/16265))
11
+ - `ApprovalDialogComponent` accepts `grants` and `onGrant`: grant choices above **Approve Once**, led by a toggle that keeps them across sessions ([#16049](https://github.com/can1357/oh-my-pi/pull/16049) by [@Peribunt](https://github.com/Peribunt))
12
+ - Added `describeJobWidget`/`renderJobWidgetLines` to draw a background job's widget natively and as terminal lines, `describeJobTiles`/`renderJobTileLines` to draw jobs as tiles (status, title, figure, widget), and `renderSparkline` (with `peakBuckets`/`fitSparkValues`) for one-row block sparklines
13
+
14
+ ### Fixed
15
+
16
+ - Fixed transparent images with empty top rows disappearing inside Zellij ([#16346](https://github.com/can1357/oh-my-pi/pull/16346) by [@Bouska](https://github.com/Bouska))
17
+ - Fixed bash output rewritten by the output minimizer skipping the per-line column cap (`tools.outputMaxColumns`), so a line wider than the cap reached the model whole; the raw output stays in its artifact ([#16314](https://github.com/can1357/oh-my-pi/pull/16314) by [@will-bogusz](https://github.com/will-bogusz))
18
+ - Fixed the composer caret drifting one cell left per pasted image or video chip in terminals that draw the chip icon as a wide emoji (JetBrains terminal); the `unicode` preset now uses `📷`/`🎬` chip icons ([#16270](https://github.com/can1357/oh-my-pi/issues/16270))
19
+ - Fixed Tern hiding user text sent with `/skill:<name>` inside a collapsed skill card; only the loaded skill prompt is hidden ([#16311](https://github.com/can1357/oh-my-pi/issues/16311))
20
+ - Fixed SIXEL charts and images overlapping following content when their top rows scroll out of the viewport ([#16245](https://github.com/can1357/oh-my-pi/pull/16245) by [@JustasMasiulis](https://github.com/JustasMasiulis)).
21
+
5
22
  ## [18.12.2] - 2026-10-18
6
23
 
7
24
  ### Added
@@ -39,6 +39,12 @@ export interface AutocompleteItem {
39
39
  state?: string;
40
40
  /** Dim hint text shown inline after cursor when this item is selected */
41
41
  hint?: string;
42
+ /**
43
+ * Slash command matched only through its description, not its name or an alias:
44
+ * a browse hit, so Enter submits the typed text instead of running it unless the
45
+ * user moved the selection onto it.
46
+ */
47
+ descriptionMatch?: boolean;
42
48
  }
43
49
  type Awaitable<T> = T | Promise<T>;
44
50
  export interface SlashCommand {
@@ -20,10 +20,9 @@ export declare class SkillMessageComponent extends Container {
20
20
  setExpanded(expanded: boolean): void;
21
21
  handleNativeEvent(event: NativeUiEvent): void;
22
22
  /**
23
- * A user-toned card (role `omp.skill`): the skill chip (linked to its
24
- * SKILL.md) and prompt size in the head, the user's draft as markdown, and
25
- * the loaded skill prompt, described only while expanded because it can
26
- * be large.
23
+ * A user-toned card (role `omp.skill`): the skill chip and prompt size in
24
+ * the head, the user's draft always visible, and only the loaded skill
25
+ * prompt behind a disclosure.
27
26
  */
28
27
  describe(): NativeNode;
29
28
  /**
@@ -0,0 +1,34 @@
1
+ /**
2
+ * One-row block sparklines (`▁▂▃▅▇█`) for ANSI renderers: the usage history
3
+ * in `omp usage`, a job widget's series in the `wait` card and status line.
4
+ */
5
+ /** Block glyphs from lowest to highest. */
6
+ export declare const SPARK_LEVELS: readonly ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"];
7
+ /** How {@link renderSparkline} maps values to glyphs and styles them. */
8
+ export interface SparklineOptions {
9
+ /** Domain low end; values at or below it draw the lowest block. Default 0. */
10
+ readonly min?: number;
11
+ /** Domain high end; values at or above it draw the full block. Default the largest value. */
12
+ readonly max?: number;
13
+ /** Styles one glyph; `fraction` is the value's 0–1 position in the domain. */
14
+ readonly style?: (glyph: string, value: number, fraction: number) => string;
15
+ /** What a missing value draws, already styled. Default a space. */
16
+ readonly gap?: string;
17
+ }
18
+ /** The block glyph for a 0–1 fraction of the domain. */
19
+ export declare function sparkGlyph(fraction: number): string;
20
+ /** One cell per value, oldest first; `undefined` (and non-finite) values draw the gap. */
21
+ export declare function renderSparkline(values: readonly (number | undefined)[], options?: SparklineOptions): string;
22
+ /**
23
+ * `values` squeezed into at most `cells` points by equal-count bucket means,
24
+ * newest bucket last; shorter series come back unchanged.
25
+ */
26
+ export declare function fitSparkValues(values: readonly number[], cells: number): readonly number[];
27
+ /**
28
+ * The largest value per time bucket over `[sinceMs, nowMs]`, `cells` buckets
29
+ * wide; buckets without a point are `undefined` (a gap in the sparkline).
30
+ */
31
+ export declare function peakBuckets(points: Iterable<{
32
+ readonly at: number;
33
+ readonly value: number;
34
+ }>, sinceMs: number, nowMs: number, cells: number): (number | undefined)[];
@@ -24,6 +24,7 @@ export * from "./components/section.js";
24
24
  export * from "./components/select-list.js";
25
25
  export * from "./components/settings-list.js";
26
26
  export * from "./components/spacer.js";
27
+ export * from "./components/sparkline.js";
27
28
  export * from "./components/tab-bar.js";
28
29
  export * from "./components/table.js";
29
30
  export * from "./components/text.js";
@@ -9,7 +9,7 @@
9
9
  * ]);
10
10
  * }
11
11
  */
12
- import type { TspKind, TspProps, TspSpan, TspText } from "@oh-my-pi/pi-wire";
12
+ import type { TspKind, TspPropNode, TspProps, TspSpan, TspText } from "@oh-my-pi/pi-wire";
13
13
  import type { NativeChild, NativeNode } from "./node.js";
14
14
  /** A node of any kind. */
15
15
  export declare function node<K extends TspKind>(k: K, p?: TspProps<K>, c?: readonly NativeChild[], key?: string): NativeNode;
@@ -37,6 +37,12 @@ export declare const EMPTY_NODE: NativeNode;
37
37
  export declare function keyed(described: NativeNode, key: string): NativeNode;
38
38
  /** `described` mounted but not laid out when `hidden` (cheap visibility toggles keep ids and view state). */
39
39
  export declare function withHidden(described: NativeNode, hidden: boolean): NativeNode;
40
+ /**
41
+ * A described tree as the node tree a prop carries (a `hovercard`): plain
42
+ * nodes only, since nothing reconciles inside a prop; component children
43
+ * (which describe themselves per frame) are left out.
44
+ */
45
+ export declare function propNode(described: NativeNode): TspPropNode;
40
46
  /** Stable node key for an arbitrary identity string; keys join into `/` keypaths, so identities are hashed. */
41
47
  export declare function stableKey(identity: string): string;
42
48
  /** Drop absent entries (`undefined`, `null`, `false`) from a child list. */
@@ -17,6 +17,8 @@ export interface BackgroundChrome {
17
17
  }
18
18
  /** Map an omp background token to card tone/role. */
19
19
  export declare function backgroundChrome(bg: ThemeBg | undefined): BackgroundChrome;
20
+ /** The omp theme colour an ANSI renderer draws a TSP tone with (the inverse of {@link colorTone}). */
21
+ export declare function toneColor(tone: TspTone): ThemeColor;
20
22
  /**
21
23
  * Tone of an omp colour used as a severity or border colour; undefined for
22
24
  * colours that carry no tone (callers pick their own fallback).
@@ -5,11 +5,11 @@
5
5
  * - Table view: every registered agent except Main (Main IS the ambient
6
6
  * chat), live from the global AgentHubRegistry — status, unread irc count,
7
7
  * current/last task, last activity. Navigate with keys, wheel, hover, and
8
- * click; `r` revives a parked agent, `x` aborts + releases one.
8
+ * click; `r` revives a parked or killed agent, `x` aborts + releases one.
9
9
  * - Chat view: per-agent transcript (incremental session-file tail, absorbed
10
10
  * from the old session observer overlay) plus an input line. Submitting
11
- * revives a parked agent, then prompts/steers it; the message lands in the
12
- * agent's persisted history via the normal prompt path.
11
+ * revives a parked or killed agent, then prompts/steers it; the message
12
+ * lands in the agent's persisted history via the normal prompt path.
13
13
  *
14
14
  * Replaces the old SessionObserverOverlayComponent (ctrl+s observer).
15
15
  */
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Tool-approval prompt in the composer's place, presented like the ask
3
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
4
+ * optional grants (led by a toggle that keeps them across sessions), Approve,
5
+ * an optional "approve for this session", and Deny — and an action
5
6
  * bar. The arrows move between the choices and Enter takes the highlighted
6
7
  * one; `app.approval.approve` (Ctrl+Enter by default) approves this call
7
8
  * outright and Esc denies. Enter and the approve chord only arm
@@ -23,6 +24,13 @@ interface ApprovalDialogCallbacks {
23
24
  onApprove(): void;
24
25
  onDeny(): void;
25
26
  }
27
+ /** A choice that approves the call and remembers more than it: a folder, or the exact target. */
28
+ export interface ApprovalDialogGrant {
29
+ /** Label while the grant is remembered for this session. */
30
+ readonly label: string;
31
+ /** Label once the remember toggle keeps it across sessions. */
32
+ readonly alwaysLabel: string;
33
+ }
26
34
  /** The composer mounted beneath the dialog: it receives every key the dialog does not own. */
27
35
  export interface ApprovalDialogDraft {
28
36
  /** True while the composer holds a draft — text, attachments, or a paste still landing: keys then edit and send it. */
@@ -48,6 +56,12 @@ interface ApprovalDialogOptions {
48
56
  label: string;
49
57
  onApprove(): void;
50
58
  };
59
+ /**
60
+ * Grants to offer above Approve, led by a toggle that keeps them across sessions; Approve then
61
+ * reads "Approve Once". `onGrant` gets the chosen grant and whether the toggle was on.
62
+ */
63
+ grants?: readonly ApprovalDialogGrant[];
64
+ onGrant?(grant: ApprovalDialogGrant, always: boolean): void;
51
65
  }
52
66
  export declare class ApprovalDialogComponent implements Component {
53
67
  #private;
@@ -1,6 +1,7 @@
1
1
  import type { Component } from "../tui.js";
2
2
  import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.js";
3
3
  import { type JobTreeAgent } from "./job-tree.js";
4
+ import { type JobWidgetView } from "../tools/job-widget.js";
4
5
  /** One async job as the session snapshots it. */
5
6
  export interface JobsPanelJob {
6
7
  readonly id: string;
@@ -35,6 +36,8 @@ export interface JobsPanelDetail {
35
36
  readonly output?: string;
36
37
  /** Artifact holding the full output when `output` is cut. */
37
38
  readonly artifactId?: string;
39
+ /** The job's live widget (frozen once it settles), drawn above the output. */
40
+ readonly widget?: JobWidgetView;
38
41
  }
39
42
  /** The session behind a {@link JobsSheet}. */
40
43
  export interface JobsSheetSource {
@@ -7,7 +7,7 @@ import { type ThemeColor } from "../theme/theme.js";
7
7
  import type { TspPickerColumn, TspPickerGroup, TspPickerItem, TspPickerMark } from "@oh-my-pi/pi-wire";
8
8
  import type { NativeChild, NativeNode, NativeUiEvent } from "../native/node.js";
9
9
  /** Canonical display ordering of built-in model roles. */
10
- export type ModelRole = "default" | "smol" | "slow" | "vision" | "plan" | "commit" | "tiny" | "memory" | "task" | "advisor" | "image" | "web" | "speech" | "dictation" | "judge";
10
+ export type ModelRole = "default" | "smol" | "slow" | "vision" | "plan" | "commit" | "tiny" | "memory" | "task" | "advisor" | "widget" | "image" | "web" | "speech" | "dictation" | "judge";
11
11
  export declare const MODEL_ROLE_IDS: ModelRole[];
12
12
  export declare const CHAT_MODEL_ROLE_IDS: ModelRole[];
13
13
  export declare const KIND_ROLE_IDS: ModelRole[];
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Give an empty first band an explicit transparent width. Zellij derives the
3
+ * decoded image width from its first pixel row, ignoring the raster minimum
4
+ * for transparent images; an omitted band otherwise makes the image invisible.
5
+ * Palette definitions stay before drawing so cropping can still parse them.
6
+ */
7
+ export declare function ensureSixelRasterWidth(sequence: string): string;
8
+ /**
9
+ * Crop integer pixel rows from a raw (not tmux-wrapped) SIXEL DCS image.
10
+ * Runs are shifted between adjacent six-pixel bands, never decoded to pixels.
11
+ * Palette selections, overdraw order, transparent gaps and DCS background mode
12
+ * are retained. A nonpositive crop returns the original sequence unchanged.
13
+ *
14
+ * The supported grammar is the native icy_sixel encoder's: one leading raster
15
+ * declaration with positive dimensions and square pixels, prefix RGB/HLS palette
16
+ * definitions, register selections, sixel characters, repeats, `$` and `-`.
17
+ * ESC DCS/ST framing only, as the TUI emits it. Palette definitions after
18
+ * drawing, additional raster declarations, other controls and malformed input
19
+ * throw; forwarding an unsupported image uncropped would reintroduce raster
20
+ * overflow.
21
+ *
22
+ * Without maxHeightPixels the crop is exact, including a partial final band with
23
+ * zero padding bits and the exact declared raster height. Some terminals still
24
+ * allocate all six rows of that final band. The TUI supplies its available pixel
25
+ * height to cap the result at a whole-band boundary, matching the native encoder's
26
+ * policy of dropping bottom pixels rather than overwriting the following row.
27
+ */
28
+ export declare function cropSixelTop(sequence: string, pixels: number, maxHeightPixels?: number): string;
@@ -1,6 +1,7 @@
1
1
  import type { AgentMessage, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
2
2
  import type { Tool, UsageLimit, UsageReport } from "@oh-my-pi/pi-ai";
3
3
  import type { Model } from "@oh-my-pi/pi-catalog/types";
4
+ import type { JobWidgetEntry } from "../tools/job-widget.js";
4
5
  import type { CompactionBoundaries } from "./context-usage.js";
5
6
  import type { StatusLineSettings, StatusResetExpiry } from "./types.js";
6
7
  export interface StatusAccountIdentity {
@@ -74,6 +75,8 @@ export interface StatusLineSession {
74
75
  agentId?: string;
75
76
  }[];
76
77
  } | null | undefined;
78
+ /** Widgets of the running background jobs, in job order; the jobs segment appends the freshest one's glance. */
79
+ getRunningJobWidgets?(): readonly JobWidgetEntry[];
77
80
  getGoalModeState(): {
78
81
  goal?: {
79
82
  status: string;
@@ -19,6 +19,12 @@ export interface IrcMessage {
19
19
  * ping-pong forever.
20
20
  */
21
21
  wakeRelay?: boolean;
22
+ /**
23
+ * One leg of an `all` broadcast. Like relays, broadcasts never draw an
24
+ * automatic wake-turn reply: every woken idle peer would otherwise answer
25
+ * the broadcaster, mostly to say the message was not for it.
26
+ */
27
+ broadcast?: boolean;
22
28
  }
23
29
  /** Delivery outcome for one peer recipient. */
24
30
  export interface IrcDeliveryReceipt {
@@ -0,0 +1,226 @@
1
+ /**
2
+ * Live widgets for background jobs: the rendered state of what a job is
3
+ * doing (a benchmark's requests/s over time, tests passed per model, CI jobs
4
+ * green so far), shown in the `wait` card, the HUD's jobs pill and the jobs
5
+ * sheet.
6
+ *
7
+ * A widget is data, not code. In coding-agent, a cheap model writes a
8
+ * `JobWidgetSpec` once per job (rules that pull numbers out of the job's
9
+ * output streams, and the blocks to draw them with); the job-widgets runtime
10
+ * then applies those rules to every new line and recomputes a
11
+ * {@link JobWidgetView}. Renderers here draw that view as TSP nodes (Tern) or
12
+ * ANSI lines, and never see a rule or a regex.
13
+ */
14
+ import type { TspPropNode, TspSpan, TspTone } from "@oh-my-pi/pi-wire";
15
+ import type { NativeNode } from "../native/node.js";
16
+ import type { Theme } from "../theme/theme.js";
17
+ /** Where a widget's view stands. */
18
+ export type JobWidgetState =
19
+ /** The cheap model is writing the spec; the view holds the model-free fallback meanwhile. */
20
+ "authoring"
21
+ /** The spec's rules drive the view. */
22
+ | "live"
23
+ /** No spec (no model, authoring failed, nothing to read yet): last line and rates only. */
24
+ | "fallback";
25
+ /** A formatted number with the direction it moved, for headlines and stats. */
26
+ export interface JobWidgetTrend {
27
+ /** `▲ 15%`, `▼ 3.2 ms`. */
28
+ text: string;
29
+ /** `success` when the move is toward `better`, `error` away from it, `muted` without a direction. */
30
+ tone: "success" | "error" | "muted";
31
+ }
32
+ /** The headline value: the one number a glance should take away (`186 tok/s`). */
33
+ export interface JobWidgetHeadline {
34
+ /** Formatted value with its unit. */
35
+ text: string;
36
+ /** What the value is, when the title does not already say it (`decode`, `p50`). */
37
+ label?: string;
38
+ trend?: JobWidgetTrend;
39
+ }
40
+ /** A time series drawn as columns, newest right, with optional reference lines. */
41
+ export interface JobWidgetSparkBlock {
42
+ kind: "spark";
43
+ /** What the series measures (`tok/s · nvfp4 b1`). */
44
+ label: string;
45
+ /** At most 48 values, oldest first, already downsampled. */
46
+ values: number[];
47
+ /** Domain of the chart; covers the values and every mark. */
48
+ min: number;
49
+ max: number;
50
+ /** Horizontal reference lines in value units (a target, a baseline). */
51
+ marks?: {
52
+ value: number;
53
+ label: string;
54
+ tone?: TspTone;
55
+ }[];
56
+ /** Latest value, formatted (`186 tok/s`). */
57
+ last: string;
58
+ /** Per-point tooltip text, same length as `values` (`12:04:31 · 186 tok/s`). */
59
+ tips?: string[];
60
+ tone?: TspTone;
61
+ }
62
+ /** One bar per key (a model, a shard): a value against a common maximum. */
63
+ export interface JobWidgetBarsBlock {
64
+ kind: "bars";
65
+ label: string;
66
+ items: {
67
+ label: string;
68
+ value: number;
69
+ text: string;
70
+ tone?: TspTone;
71
+ }[];
72
+ /** The value a full bar stands for. */
73
+ max: number;
74
+ }
75
+ /** Progress of a countable whole (`7/9 trials`). */
76
+ export interface JobWidgetMeterBlock {
77
+ kind: "meter";
78
+ label: string;
79
+ /** 0–1. */
80
+ value: number;
81
+ /** `7/9 trials`. */
82
+ text: string;
83
+ tone?: TspTone;
84
+ }
85
+ /** A few labelled numbers on one line (`p50 41 ms · p99 212 ms · errors 0`). */
86
+ export interface JobWidgetStatBlock {
87
+ kind: "stat";
88
+ items: {
89
+ label: string;
90
+ text: string;
91
+ tone?: TspTone;
92
+ trend?: JobWidgetTrend;
93
+ }[];
94
+ }
95
+ /** One cell per key with its latest state (CI jobs, shards, workers). */
96
+ export interface JobWidgetGridBlock {
97
+ kind: "grid";
98
+ label: string;
99
+ items: {
100
+ label: string;
101
+ text: string;
102
+ tone: TspTone;
103
+ }[];
104
+ }
105
+ /** The latest line a rule captured (the test now running, the current phase). */
106
+ export interface JobWidgetTextBlock {
107
+ kind: "text";
108
+ text: string;
109
+ }
110
+ export type JobWidgetBlock = JobWidgetSparkBlock | JobWidgetBarsBlock | JobWidgetMeterBlock | JobWidgetStatBlock | JobWidgetGridBlock | JobWidgetTextBlock;
111
+ /**
112
+ * Everything a renderer needs to draw one job's widget. Plain JSON: it rides
113
+ * on `JobSnapshot.widget` through `wait` progress updates and is persisted
114
+ * with the final `wait` result, so a sealed card redraws the last state after
115
+ * a session reload.
116
+ */
117
+ export interface JobWidgetView {
118
+ /** Short name of what is being watched (`verb-bench · 3 models`). */
119
+ title: string;
120
+ headline?: JobWidgetHeadline;
121
+ /** What the job is doing now: a subagent's stage, or the last line of output. */
122
+ stage?: string;
123
+ /** Top to bottom; the first block is the primary one, and compact views show only it. */
124
+ blocks: JobWidgetBlock[];
125
+ state: JobWidgetState;
126
+ /** Epoch ms of the newest data the view reflects. */
127
+ updatedAt: number;
128
+ }
129
+ /** A running job's widget, as the HUD and the status line list them. */
130
+ export interface JobWidgetEntry {
131
+ id: string;
132
+ type: JobTileType;
133
+ view: JobWidgetView;
134
+ }
135
+ /** What a glance at a widget reads: its headline, else the primary figure of its blocks. */
136
+ export interface JobWidgetGlance {
137
+ text: string;
138
+ label?: string;
139
+ trend?: JobWidgetTrend;
140
+ }
141
+ /** What one glance at the widget reads: the headline, else the latest figure of its first spark or meter. */
142
+ export declare function jobWidgetGlance(view: JobWidgetView): JobWidgetGlance | undefined;
143
+ /** The widget's first spark cut to its newest `points` values (the HUD's mini chart); undefined without data. */
144
+ export declare function jobWidgetSpark(view: JobWidgetView, points?: number): JobWidgetSparkBlock | undefined;
145
+ /** The entry whose live widget (one a spec drives) saw data last. */
146
+ export declare function latestJobWidget<T extends JobWidgetEntry>(entries: readonly T[]): T | undefined;
147
+ /** The widget as one plain line for tooltips: `verb-bench · 3 models — decode 186 tok/s ▲ 15%`. */
148
+ export declare function jobWidgetSummary(view: JobWidgetView): string;
149
+ /** Spans of a glance: muted label, strong number, toned trend. */
150
+ export declare function jobWidgetGlanceSpans(glance: JobWidgetGlance): TspSpan[];
151
+ /**
152
+ * A glance for the ANSI status line: the figure with its trend, then a
153
+ * `cells`-wide sparkline of the primary spark when there is one.
154
+ */
155
+ export declare function formatJobWidgetGlance(view: JobWidgetView, theme: Theme, cells?: number): string;
156
+ /**
157
+ * A job's whole widget as a TSP subtree (role `omp.job.widget`), as the jobs
158
+ * sheet details it: a head row (title, stage, headline) over every block.
159
+ */
160
+ export declare function describeJobWidget(view: JobWidgetView): NativeNode;
161
+ /**
162
+ * The HUD jobs pill's hover card: up to four running jobs as tiles, then a
163
+ * count of the rest; undefined without widgets. Its tiles carry no clock:
164
+ * Tern draws the card only once hovered, and a clock drawn then would start
165
+ * from the last time the program wrote.
166
+ */
167
+ export declare function describeJobWidgetsHovercard(entries: readonly JobWidgetEntry[]): TspPropNode | undefined;
168
+ /** The HUD's mini chart: the newest values of the widget's first spark; undefined without one. */
169
+ export declare function describeJobWidgetMiniSpark(view: JobWidgetView): NativeNode | undefined;
170
+ /** Where a tiled job stands. */
171
+ export type JobTileStatus = "running" | "completed" | "failed" | "cancelled";
172
+ /** What kind of job a tile shows: a subagent (`task`) goes by its name, any other job by what it runs. */
173
+ export type JobTileType = "bash" | "task" | "eval";
174
+ /** One job as a tile draws it: who it is, how long it has run, and its widget when it has one. */
175
+ export interface JobTile {
176
+ id: string;
177
+ type: JobTileType;
178
+ status: JobTileStatus;
179
+ /** The job's label (a command): the title of a job that is no subagent, before a widget names it. */
180
+ label: string;
181
+ /** How long the job has run; a tile without it shows no clock. */
182
+ durationMs?: number;
183
+ /** Whether the job is live (its dot pulses, its clock runs); settled and sealed tiles freeze. */
184
+ live: boolean;
185
+ /** The job's widget; only a live one (a spec drives it) draws figures and charts, any lends its stage. */
186
+ widget?: JobWidgetView;
187
+ /** A task's own completion estimate (0–100), drawn as a ring. */
188
+ completionPercent?: number;
189
+ /** What the job is doing now, when its widget names nothing: a task's stage in its own words. */
190
+ stage?: string;
191
+ exitCode?: number;
192
+ }
193
+ /**
194
+ * Jobs as one frame of equal tiles (role `omp.job.tiles`) that wraps onto
195
+ * more rows when the frame runs out of width.
196
+ */
197
+ export declare function describeJobTiles(tiles: readonly JobTile[]): NativeNode;
198
+ /**
199
+ * One job as a tile (role `omp.job.tile`): a head line (status, name, id,
200
+ * a task's own completion estimate as a ring, clock), then what a live
201
+ * widget shows (the figure a glance takes away, its primary block, quiet
202
+ * lines of stats) and the stage. With nothing to chart, the stage is the
203
+ * tile's body.
204
+ */
205
+ export declare function describeJobTile(tile: JobTile): NativeNode;
206
+ /**
207
+ * A job's whole widget as terminal lines, each within `width` (capped at 80
208
+ * so bars stay next to their labels): the head line (title, stage, headline
209
+ * at the right), then every block under a shared label column.
210
+ */
211
+ export declare function renderJobWidgetLines(view: JobWidgetView, width: number, theme: Theme): string[];
212
+ /** How the ANSI wait card draws a tile. */
213
+ export interface JobTileLineOptions {
214
+ /** Opens the title line: the caller's status icon and type badge. */
215
+ lead: string;
216
+ /** Closes the title line at the right, after the figure: the duration. */
217
+ meta: string;
218
+ /** Every block rather than the primary one alone (an expanded card). */
219
+ full?: boolean;
220
+ }
221
+ /**
222
+ * A tile as terminal lines within `width`: the lead, name and id with the
223
+ * figure and meta at the right, then a live widget's primary block (every
224
+ * block when `full`) and dim lines of stats and stage, capped at 80 cells.
225
+ */
226
+ export declare function renderJobTileLines(tile: JobTile, width: number, theme: Theme, options: JobTileLineOptions): string[];
@@ -110,7 +110,7 @@ export interface OutputMeta {
110
110
  /** Capture failure of this output itself; aggregate reports keep source failures on their entries. */
111
111
  artifactError?: OutputArtifactError;
112
112
  source?: SourceMeta;
113
- /** The output is a bounded page of session artifact storage its `source` re-reads with line selectors; spill-to-artifact skips it. */
113
+ /** The output is a bounded page of a file or session artifact its `source` re-reads with line selectors; spill-to-artifact skips it. */
114
114
  pagedSource?: true;
115
115
  diagnostics?: DiagnosticMeta;
116
116
  limits?: LimitsMeta;
@@ -261,6 +261,7 @@ export declare class OutputSink {
261
261
  * Replace the in-memory buffer with the given text. Used when an upstream
262
262
  * minimizer rewrites the captured output after the raw bytes have already
263
263
  * been streamed.
264
+ * The replacement is held to the per-line column cap like streamed output.
264
265
  *
265
266
  * After this call the buffer is authoritative: streaming counters realign
266
267
  * to the replacement, the retained head window is cleared, and head
@@ -265,6 +265,18 @@ export interface AgentProgress {
265
265
  advisor?: boolean;
266
266
  /** The agent's latest self-estimate of task completion (0–100), from the periodic `task.completionProbe` side request. */
267
267
  completionPercent?: number;
268
+ /**
269
+ * The agent's current step in its own words (one line, ≤ 80 chars), from the
270
+ * same probe reply as {@link completionPercent}. Running rows prefer it over
271
+ * `lastIntent`; the job widget uses it as its stage line.
272
+ */
273
+ stage?: string;
274
+ /**
275
+ * What the agent says shows its progress live (one line, ≤ 200 chars), e.g.
276
+ * "BENCH lines in bg_2 pipe:1, tok_s higher is better, target 70% of roofline";
277
+ * from the probe reply. Feeds the job widget author's brief; never rendered.
278
+ */
279
+ watch?: string;
268
280
  /** Data extracted by registered subprocess tool handlers (keyed by tool name) */
269
281
  extractedToolData?: Record<string, unknown[]>;
270
282
  /**
@@ -3,6 +3,7 @@ import type { Theme } from "../theme/theme.js";
3
3
  import { type OutputMeta } from "./output-meta.js";
4
4
  import { type ConfiguredThinkingLevel } from "../render/render-utils.js";
5
5
  import type { StructuredSubagentOutput } from "./task.js";
6
+ import { type JobWidgetView } from "./job-widget.js";
6
7
  import type { RenderResultOptions, ToolActivitySummary } from "./renderer.js";
7
8
  import type { IrcDeliveryReceipt, IrcMessage } from "./irc.js";
8
9
  import type { NativeToolView, ToolRenderResult } from "./renderer.js";
@@ -29,6 +30,10 @@ export interface JobSnapshot {
29
30
  advisor?: boolean;
30
31
  /** The task agent's latest self-estimated completion (0–100); see `AgentProgress.completionPercent`. */
31
32
  completionPercent?: number;
33
+ /** The task agent's latest stage in its own words; see `AgentProgress.stage`. */
34
+ stage?: string;
35
+ /** The job's live widget, while one is being drawn; frozen at its last state once the job settles. */
36
+ widget?: JobWidgetView;
32
37
  resultText?: string;
33
38
  errorText?: string;
34
39
  /** Source-output metadata retained for per-job warnings and persisted row rendering. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-tui",
4
- "version": "18.12.2",
4
+ "version": "18.12.3",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": {
@@ -41,14 +41,14 @@
41
41
  "gen:glyphs": "bun scripts/gen-glyphs.ts"
42
42
  },
43
43
  "dependencies": {
44
- "@oh-my-pi/omptype": "18.12.2",
45
- "@oh-my-pi/pi-agent-core": "18.12.2",
46
- "@oh-my-pi/pi-ai": "18.12.2",
47
- "@oh-my-pi/pi-catalog": "18.12.2",
48
- "@oh-my-pi/pi-natives": "18.12.2",
49
- "@oh-my-pi/pi-utils": "18.12.2",
50
- "@oh-my-pi/pi-wire": "18.12.2",
51
- "@oh-my-pi/snapcompact": "18.12.2"
44
+ "@oh-my-pi/omptype": "18.12.3",
45
+ "@oh-my-pi/pi-agent-core": "18.12.3",
46
+ "@oh-my-pi/pi-ai": "18.12.3",
47
+ "@oh-my-pi/pi-catalog": "18.12.3",
48
+ "@oh-my-pi/pi-natives": "18.12.3",
49
+ "@oh-my-pi/pi-utils": "18.12.3",
50
+ "@oh-my-pi/pi-wire": "18.12.3",
51
+ "@oh-my-pi/snapcompact": "18.12.3"
52
52
  },
53
53
  "devDependencies": {
54
54
  "kitty-vt-wasm": "^0.2.0"
@@ -226,6 +226,12 @@ export interface AutocompleteItem {
226
226
  state?: string;
227
227
  /** Dim hint text shown inline after cursor when this item is selected */
228
228
  hint?: string;
229
+ /**
230
+ * Slash command matched only through its description, not its name or an alias:
231
+ * a browse hit, so Enter submits the typed text instead of running it unless the
232
+ * user moved the selection onto it.
233
+ */
234
+ descriptionMatch?: boolean;
229
235
  }
230
236
 
231
237
  type Awaitable<T> = T | Promise<T>;
@@ -437,6 +443,7 @@ function buildSlashCommandCompletions(
437
443
  ...(cmd.iconName && { iconName: cmd.iconName }),
438
444
  ...(fullDesc && { description: fullDesc }),
439
445
  ...nativeTextMemo,
446
+ ...(nameScore === 0 && { descriptionMatch: true }),
440
447
  };
441
448
  }
442
449
 
@@ -444,7 +451,11 @@ function buildSlashCommandCompletions(
444
451
  for (const alias of getCommandAliases(cmd)) {
445
452
  if (alias === name) continue;
446
453
  const aliasScore = scoreCommandTextMatch(lowerPrefix, alias.toLowerCase());
447
- if (aliasScore === 0 || (best && aliasScore <= best.score)) continue;
454
+ if (aliasScore === 0) continue;
455
+ // An alias can match even when the description outranks it; Enter
456
+ // must still accept the command rather than submit the raw query.
457
+ if (best?.descriptionMatch) delete best.descriptionMatch;
458
+ if (best && aliasScore <= best.score) continue;
448
459
  const fullDesc = resolveFullDesc();
449
460
  best = {
450
461
  value: alias,