@oh-my-pi/pi-wire 18.4.5 → 18.4.6
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 +6 -0
- package/dist/types/tsp.d.ts +67 -14
- package/package.json +1 -1
- package/src/tsp.ts +61 -9
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [18.4.6] - 2026-10-01
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added the `TspMeterMark` component for marking a position on a meter track with a custom icon and a total value that defines the full span of the track.
|
|
10
|
+
|
|
5
11
|
## [18.4.4] - 2026-09-29
|
|
6
12
|
|
|
7
13
|
### Added
|
package/dist/types/tsp.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare const TSP_DEFAULT_CREDITS = 2;
|
|
|
26
26
|
/** One-letter message verb. */
|
|
27
27
|
export type TspVerb = "q" | "o" | "f" | "b" | "t" | "x" | "r" | "e";
|
|
28
28
|
/** Every component kind in the v1 vocabulary. */
|
|
29
|
-
export declare const TSP_KINDS: readonly ["col", "row", "card", "section", "rule", "spacer", "text", "md", "code", "diff", "ansi", "math", "image", "kv", "table", "tree", "badge", "kbd", "icon", "spinner", "shimmer", "elapsed", "progress", "rate", "list", "item", "tabs", "editor", "input", "status", "seg", "overlay", "toast", "rows", "picker", "prefs", "tool", "checklist", "agent", "chart", "meter"];
|
|
29
|
+
export declare const TSP_KINDS: readonly ["col", "row", "card", "section", "rule", "spacer", "text", "md", "code", "diff", "ansi", "math", "image", "kv", "table", "tree", "badge", "kbd", "icon", "spinner", "shimmer", "elapsed", "progress", "rate", "list", "item", "tabs", "editor", "input", "status", "seg", "overlay", "toast", "rows", "picker", "prefs", "tool", "checklist", "agent", "chart", "meter", "effort"];
|
|
30
30
|
export type TspKind = (typeof TSP_KINDS)[number];
|
|
31
31
|
/** Semantic colour of a node's chrome. */
|
|
32
32
|
export type TspTone = "neutral" | "accent" | "info" | "success" | "warning" | "error" | "pending" | "muted" | "user";
|
|
@@ -43,7 +43,9 @@ export type TspEffect = "shimmer" | "pulse" | "none";
|
|
|
43
43
|
* One styled run of text. `s` holds space-separated semantic tokens
|
|
44
44
|
* (`muted`, `dim`, `strong`, `em`, `accent`, `success`, `warning`, `error`,
|
|
45
45
|
* `info`, `code`, `mono`, `path`, `key`, `link`, `num`, `ins`, `del`, `mark`,
|
|
46
|
-
* `icon`, `hide`) or omp theme token names (`thinkingText`,
|
|
46
|
+
* `typo`, `icon`, `hide`) or omp theme token names (`thinkingText`,
|
|
47
|
+
* `toolTitle`, …). `mark` highlights (a match, the selected row); `typo` is a
|
|
48
|
+
* misspelled word, which the terminal underlines as its own spell checker does.
|
|
47
49
|
* `icon` marks a run of icon glyphs (Nerd Font / Private Use Area codepoints):
|
|
48
50
|
* the terminal draws it in its icon face and spaces it from neighbouring text
|
|
49
51
|
* itself, so senders omit padding spaces around icons. `hide` takes the run
|
|
@@ -57,8 +59,11 @@ export interface TspSpan {
|
|
|
57
59
|
}
|
|
58
60
|
/** Text given either as one plain string or as styled spans. */
|
|
59
61
|
export type TspText = string | readonly TspSpan[];
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
+
/**
|
|
63
|
+
* What a pointer gesture on a node does. `zoom` shows an `image` (and the images
|
|
64
|
+
* beside it) large in the terminal's viewer; it is an image's click by default.
|
|
65
|
+
*/
|
|
66
|
+
export type TspAction = "toggle" | "copy" | "open" | "zoom" | "select" | "activate" | (string & {});
|
|
62
67
|
/** Props every node accepts. */
|
|
63
68
|
export interface TspCommonProps {
|
|
64
69
|
role?: string;
|
|
@@ -86,7 +91,15 @@ export interface TspCommonProps {
|
|
|
86
91
|
aria?: string;
|
|
87
92
|
/** Target of an `open` action on this node (a URL or `file://` path). */
|
|
88
93
|
href?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Transient selection state drawn over the node without restyling it (the
|
|
96
|
+
* rewind page): `pick` marks the chosen point (adjacent picks read as one
|
|
97
|
+
* run), `drop` dims what the choice discards.
|
|
98
|
+
*/
|
|
99
|
+
mark?: TspMark;
|
|
89
100
|
}
|
|
101
|
+
/** A {@link TspCommonProps.mark}. */
|
|
102
|
+
export type TspMark = "pick" | "drop";
|
|
90
103
|
export type TspWrap = "word" | "char" | "none";
|
|
91
104
|
export type TspTruncate = "end" | "start" | "middle";
|
|
92
105
|
export type TspCardStatus = "pending" | "running" | "done" | "error" | "cancelled";
|
|
@@ -182,9 +195,13 @@ export interface TspMathProps {
|
|
|
182
195
|
text?: string;
|
|
183
196
|
display?: boolean;
|
|
184
197
|
}
|
|
198
|
+
/** Images the terminal ships (`image.p.builtin`): `omp` is omp's gradient mark. */
|
|
199
|
+
export type TspBuiltinImage = "omp";
|
|
185
200
|
export interface TspImageProps {
|
|
186
201
|
/** Content address (sha256 hex) of a blob sent with verb `b`. */
|
|
187
|
-
blob
|
|
202
|
+
blob?: string;
|
|
203
|
+
/** An image the terminal ships, drawn instead of any blob. */
|
|
204
|
+
builtin?: TspBuiltinImage;
|
|
188
205
|
alt?: string;
|
|
189
206
|
w?: number;
|
|
190
207
|
h?: number;
|
|
@@ -447,8 +464,11 @@ export interface TspPickerGroup {
|
|
|
447
464
|
* selected item's preview. A picker under `layer` is itself the modal sheet.
|
|
448
465
|
*/
|
|
449
466
|
export interface TspPickerProps {
|
|
450
|
-
/**
|
|
451
|
-
|
|
467
|
+
/**
|
|
468
|
+
* What is being picked, e.g. "Models" (plain: it is also the common `title` prop, which a picker does not use as a
|
|
469
|
+
* tooltip). Absent: the head is the icon and the search, and the placeholder names the sheet.
|
|
470
|
+
*/
|
|
471
|
+
title?: string;
|
|
452
472
|
subtitle?: TspText;
|
|
453
473
|
icon?: string;
|
|
454
474
|
/** Plural noun for counts and empty copy ("models", "sessions"). */
|
|
@@ -723,12 +743,31 @@ export interface TspAgentProps {
|
|
|
723
743
|
collapsible?: boolean;
|
|
724
744
|
collapsed?: boolean;
|
|
725
745
|
}
|
|
746
|
+
/**
|
|
747
|
+
* A thinking-effort glyph: a small ring that fills rung by rung with the level and
|
|
748
|
+
* turns into a flickering fireball at `max`. Leaf; the terminal draws everything.
|
|
749
|
+
*/
|
|
750
|
+
export interface TspEffortProps {
|
|
751
|
+
/** `off`, `minimal`, `low`, `medium`, `high`, `xhigh` or `max`; anything else (e.g. `auto`) draws an empty dashed ring. */
|
|
752
|
+
level: string;
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* A tick on a meter's track (compaction threshold, speculation point). A bar mark's `icon`
|
|
756
|
+
* (a symbol name, e.g. `context.compaction`) sits on the track, which breaks for it.
|
|
757
|
+
*/
|
|
758
|
+
export interface TspMeterMark {
|
|
759
|
+
/** Position, 0–1. */
|
|
760
|
+
at: number;
|
|
761
|
+
tone?: TspTone;
|
|
762
|
+
title?: string;
|
|
763
|
+
icon?: string;
|
|
764
|
+
}
|
|
726
765
|
/** A value drawn as a bar, ring or block grid (§8.2): context %, usage windows, agent context. */
|
|
727
766
|
export interface TspMeterProps {
|
|
728
767
|
/** 0–1, or null for unknown. */
|
|
729
768
|
value: number | null;
|
|
730
769
|
style?: "bar" | "ring" | "blocks";
|
|
731
|
-
/** `blocks` only: exactly this many cells in one row, `round(value × steps)` of them filled (effort meter). */
|
|
770
|
+
/** `blocks` only: exactly this many cells in one row, `round(value × steps)` of them filled (e.g. the effort chip's fallback meter). */
|
|
732
771
|
steps?: number;
|
|
733
772
|
/** Stacked parts instead of one fill (context breakdown); values sum to ≤ 1. */
|
|
734
773
|
parts?: readonly {
|
|
@@ -737,18 +776,16 @@ export interface TspMeterProps {
|
|
|
737
776
|
label?: string;
|
|
738
777
|
hatch?: boolean;
|
|
739
778
|
}[];
|
|
740
|
-
|
|
741
|
-
marks?: readonly {
|
|
742
|
-
at: number;
|
|
743
|
-
tone?: TspTone;
|
|
744
|
-
title?: string;
|
|
745
|
-
}[];
|
|
779
|
+
marks?: readonly TspMeterMark[];
|
|
746
780
|
/** Tone switches: at or above `warn` → warning, `bad` → error. */
|
|
747
781
|
thresholds?: {
|
|
748
782
|
warn?: number;
|
|
749
783
|
bad?: number;
|
|
750
784
|
};
|
|
785
|
+
/** The value as text (`74%`). */
|
|
751
786
|
label?: TspText;
|
|
787
|
+
/** The whole the track spans as text (a context window's `200K`). */
|
|
788
|
+
total?: TspText;
|
|
752
789
|
size?: "sm" | "md" | "lg";
|
|
753
790
|
}
|
|
754
791
|
/** Series data drawn natively: the usage heatmap, app dashboards (§9.2). */
|
|
@@ -820,6 +857,7 @@ export interface TspPropsByKind {
|
|
|
820
857
|
agent: TspAgentProps;
|
|
821
858
|
chart: TspChartProps;
|
|
822
859
|
meter: TspMeterProps;
|
|
860
|
+
effort: TspEffortProps;
|
|
823
861
|
}
|
|
824
862
|
/** Props of a node of kind `K`: its kind-specific props plus the common ones. */
|
|
825
863
|
export type TspProps<K extends TspKind = TspKind> = TspPropsByKind[K] & TspCommonProps;
|
|
@@ -966,6 +1004,21 @@ export type TspEvent = {
|
|
|
966
1004
|
id: string;
|
|
967
1005
|
item: string;
|
|
968
1006
|
value: boolean | number | string | readonly string[] | null;
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* An edit over the terminal's selection in an `editor`/`input` node: replace
|
|
1010
|
+
* `[from, to)` with `text`, caret to `cursor` (UTF-16 offsets; `len` is the
|
|
1011
|
+
* text length the terminal saw, a mismatch makes the edit stale).
|
|
1012
|
+
*/
|
|
1013
|
+
| {
|
|
1014
|
+
ev: "edit";
|
|
1015
|
+
sf: string;
|
|
1016
|
+
id: string;
|
|
1017
|
+
from: number;
|
|
1018
|
+
to: number;
|
|
1019
|
+
text: string;
|
|
1020
|
+
cursor: number;
|
|
1021
|
+
len: number;
|
|
969
1022
|
} | {
|
|
970
1023
|
ev: "error";
|
|
971
1024
|
sf?: string;
|
package/package.json
CHANGED
package/src/tsp.ts
CHANGED
|
@@ -75,6 +75,7 @@ export const TSP_KINDS = [
|
|
|
75
75
|
"agent",
|
|
76
76
|
"chart",
|
|
77
77
|
"meter",
|
|
78
|
+
"effort",
|
|
78
79
|
] as const;
|
|
79
80
|
|
|
80
81
|
export type TspKind = (typeof TSP_KINDS)[number];
|
|
@@ -98,7 +99,9 @@ export type TspEffect = "shimmer" | "pulse" | "none";
|
|
|
98
99
|
* One styled run of text. `s` holds space-separated semantic tokens
|
|
99
100
|
* (`muted`, `dim`, `strong`, `em`, `accent`, `success`, `warning`, `error`,
|
|
100
101
|
* `info`, `code`, `mono`, `path`, `key`, `link`, `num`, `ins`, `del`, `mark`,
|
|
101
|
-
* `icon`, `hide`) or omp theme token names (`thinkingText`,
|
|
102
|
+
* `typo`, `icon`, `hide`) or omp theme token names (`thinkingText`,
|
|
103
|
+
* `toolTitle`, …). `mark` highlights (a match, the selected row); `typo` is a
|
|
104
|
+
* misspelled word, which the terminal underlines as its own spell checker does.
|
|
102
105
|
* `icon` marks a run of icon glyphs (Nerd Font / Private Use Area codepoints):
|
|
103
106
|
* the terminal draws it in its icon face and spaces it from neighbouring text
|
|
104
107
|
* itself, so senders omit padding spaces around icons. `hide` takes the run
|
|
@@ -114,8 +117,11 @@ export interface TspSpan {
|
|
|
114
117
|
/** Text given either as one plain string or as styled spans. */
|
|
115
118
|
export type TspText = string | readonly TspSpan[];
|
|
116
119
|
|
|
117
|
-
/**
|
|
118
|
-
|
|
120
|
+
/**
|
|
121
|
+
* What a pointer gesture on a node does. `zoom` shows an `image` (and the images
|
|
122
|
+
* beside it) large in the terminal's viewer; it is an image's click by default.
|
|
123
|
+
*/
|
|
124
|
+
export type TspAction = "toggle" | "copy" | "open" | "zoom" | "select" | "activate" | (string & {});
|
|
119
125
|
|
|
120
126
|
/** Props every node accepts. */
|
|
121
127
|
export interface TspCommonProps {
|
|
@@ -134,8 +140,17 @@ export interface TspCommonProps {
|
|
|
134
140
|
aria?: string;
|
|
135
141
|
/** Target of an `open` action on this node (a URL or `file://` path). */
|
|
136
142
|
href?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Transient selection state drawn over the node without restyling it (the
|
|
145
|
+
* rewind page): `pick` marks the chosen point (adjacent picks read as one
|
|
146
|
+
* run), `drop` dims what the choice discards.
|
|
147
|
+
*/
|
|
148
|
+
mark?: TspMark;
|
|
137
149
|
}
|
|
138
150
|
|
|
151
|
+
/** A {@link TspCommonProps.mark}. */
|
|
152
|
+
export type TspMark = "pick" | "drop";
|
|
153
|
+
|
|
139
154
|
export type TspWrap = "word" | "char" | "none";
|
|
140
155
|
export type TspTruncate = "end" | "start" | "middle";
|
|
141
156
|
export type TspCardStatus = "pending" | "running" | "done" | "error" | "cancelled";
|
|
@@ -227,9 +242,13 @@ export interface TspMathProps {
|
|
|
227
242
|
text?: string;
|
|
228
243
|
display?: boolean;
|
|
229
244
|
}
|
|
245
|
+
/** Images the terminal ships (`image.p.builtin`): `omp` is omp's gradient mark. */
|
|
246
|
+
export type TspBuiltinImage = "omp";
|
|
230
247
|
export interface TspImageProps {
|
|
231
248
|
/** Content address (sha256 hex) of a blob sent with verb `b`. */
|
|
232
|
-
blob
|
|
249
|
+
blob?: string;
|
|
250
|
+
/** An image the terminal ships, drawn instead of any blob. */
|
|
251
|
+
builtin?: TspBuiltinImage;
|
|
233
252
|
alt?: string;
|
|
234
253
|
w?: number;
|
|
235
254
|
h?: number;
|
|
@@ -464,8 +483,11 @@ export interface TspPickerGroup {
|
|
|
464
483
|
* selected item's preview. A picker under `layer` is itself the modal sheet.
|
|
465
484
|
*/
|
|
466
485
|
export interface TspPickerProps {
|
|
467
|
-
/**
|
|
468
|
-
|
|
486
|
+
/**
|
|
487
|
+
* What is being picked, e.g. "Models" (plain: it is also the common `title` prop, which a picker does not use as a
|
|
488
|
+
* tooltip). Absent: the head is the icon and the search, and the placeholder names the sheet.
|
|
489
|
+
*/
|
|
490
|
+
title?: string;
|
|
469
491
|
subtitle?: TspText;
|
|
470
492
|
icon?: string;
|
|
471
493
|
/** Plural noun for counts and empty copy ("models", "sessions"). */
|
|
@@ -692,20 +714,43 @@ export interface TspAgentProps {
|
|
|
692
714
|
collapsed?: boolean;
|
|
693
715
|
}
|
|
694
716
|
|
|
717
|
+
/**
|
|
718
|
+
* A thinking-effort glyph: a small ring that fills rung by rung with the level and
|
|
719
|
+
* turns into a flickering fireball at `max`. Leaf; the terminal draws everything.
|
|
720
|
+
*/
|
|
721
|
+
export interface TspEffortProps {
|
|
722
|
+
/** `off`, `minimal`, `low`, `medium`, `high`, `xhigh` or `max`; anything else (e.g. `auto`) draws an empty dashed ring. */
|
|
723
|
+
level: string;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* A tick on a meter's track (compaction threshold, speculation point). A bar mark's `icon`
|
|
728
|
+
* (a symbol name, e.g. `context.compaction`) sits on the track, which breaks for it.
|
|
729
|
+
*/
|
|
730
|
+
export interface TspMeterMark {
|
|
731
|
+
/** Position, 0–1. */
|
|
732
|
+
at: number;
|
|
733
|
+
tone?: TspTone;
|
|
734
|
+
title?: string;
|
|
735
|
+
icon?: string;
|
|
736
|
+
}
|
|
737
|
+
|
|
695
738
|
/** A value drawn as a bar, ring or block grid (§8.2): context %, usage windows, agent context. */
|
|
696
739
|
export interface TspMeterProps {
|
|
697
740
|
/** 0–1, or null for unknown. */
|
|
698
741
|
value: number | null;
|
|
699
742
|
style?: "bar" | "ring" | "blocks";
|
|
700
|
-
/** `blocks` only: exactly this many cells in one row, `round(value × steps)` of them filled (effort meter). */
|
|
743
|
+
/** `blocks` only: exactly this many cells in one row, `round(value × steps)` of them filled (e.g. the effort chip's fallback meter). */
|
|
701
744
|
steps?: number;
|
|
702
745
|
/** Stacked parts instead of one fill (context breakdown); values sum to ≤ 1. */
|
|
703
746
|
parts?: readonly { value: number; token?: string; label?: string; hatch?: boolean }[];
|
|
704
|
-
|
|
705
|
-
marks?: readonly { at: number; tone?: TspTone; title?: string }[];
|
|
747
|
+
marks?: readonly TspMeterMark[];
|
|
706
748
|
/** Tone switches: at or above `warn` → warning, `bad` → error. */
|
|
707
749
|
thresholds?: { warn?: number; bad?: number };
|
|
750
|
+
/** The value as text (`74%`). */
|
|
708
751
|
label?: TspText;
|
|
752
|
+
/** The whole the track spans as text (a context window's `200K`). */
|
|
753
|
+
total?: TspText;
|
|
709
754
|
size?: "sm" | "md" | "lg";
|
|
710
755
|
}
|
|
711
756
|
/** Series data drawn natively: the usage heatmap, app dashboards (§9.2). */
|
|
@@ -771,6 +816,7 @@ export interface TspPropsByKind {
|
|
|
771
816
|
agent: TspAgentProps;
|
|
772
817
|
chart: TspChartProps;
|
|
773
818
|
meter: TspMeterProps;
|
|
819
|
+
effort: TspEffortProps;
|
|
774
820
|
}
|
|
775
821
|
|
|
776
822
|
/** Props of a node of kind `K`: its kind-specific props plus the common ones. */
|
|
@@ -886,5 +932,11 @@ export type TspEvent =
|
|
|
886
932
|
item: string;
|
|
887
933
|
value: boolean | number | string | readonly string[] | null;
|
|
888
934
|
}
|
|
935
|
+
/**
|
|
936
|
+
* An edit over the terminal's selection in an `editor`/`input` node: replace
|
|
937
|
+
* `[from, to)` with `text`, caret to `cursor` (UTF-16 offsets; `len` is the
|
|
938
|
+
* text length the terminal saw, a mismatch makes the edit stale).
|
|
939
|
+
*/
|
|
940
|
+
| { ev: "edit"; sf: string; id: string; from: number; to: number; text: string; cursor: number; len: number }
|
|
889
941
|
| { ev: "error"; sf?: string; s?: number; op?: number; msg: string }
|
|
890
942
|
| { ev: "gone"; sf?: string; ids: readonly string[] };
|