@oh-my-pi/pi-wire 18.13.2 → 18.14.0

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 CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.14.0] - 2026-10-29
6
+
7
+ ### Added
8
+
9
+ - Added the TSP `json` kind for displaying raw JSON values as interactive, expandable trees in the terminal.
10
+ - Added `TspEditorProps.typeahead` support so programs that cannot yet read input can preserve typed text, display it at the caret, and submit it when input becomes available.
11
+
12
+ ## [18.13.3] - 2026-10-28
13
+
14
+ ### Changed
15
+
16
+ - Updated Bun engine requirement to ≥1.4.4
17
+
18
+ ### Removed
19
+
20
+ - Removed `TspPalette` definition and `t` verb from the protocol specification
21
+
5
22
  ## [18.12.3] - 2026-10-19
6
23
 
7
24
  ### Added
@@ -26,9 +26,9 @@ export declare const TSP_DEFAULT_APC_LIMIT = 65536;
26
26
  /** Unacknowledged frames a sender may have in flight unless the hello reply says otherwise. */
27
27
  export declare const TSP_DEFAULT_CREDITS = 2;
28
28
  /** One-letter message verb. */
29
- export type TspVerb = "q" | "o" | "f" | "b" | "t" | "x" | "r" | "e";
29
+ export type TspVerb = "q" | "o" | "f" | "b" | "x" | "r" | "e";
30
30
  /** Every component kind in the v1 vocabulary. */
31
- export declare const TSP_KINDS: readonly ["col", "row", "card", "section", "rule", "spacer", "text", "md", "code", "diff", "ansi", "math", "image", "media", "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"];
31
+ export declare const TSP_KINDS: readonly ["col", "row", "card", "section", "rule", "spacer", "text", "md", "code", "diff", "ansi", "math", "image", "media", "kv", "table", "tree", "json", "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"];
32
32
  export type TspKind = (typeof TSP_KINDS)[number];
33
33
  /** Semantic colour of a node's chrome. */
34
34
  export type TspTone = "neutral" | "accent" | "info" | "success" | "warning" | "error" | "pending" | "muted" | "user";
@@ -104,8 +104,10 @@ export interface TspCommonProps {
104
104
  * right after another tooltip or card), anchored below it (above without
105
105
  * room) and clamped to the window. It stays open while the pointer is over
106
106
  * the node or the card, closes on leave (short grace), press, key or scroll,
107
- * and replaces the node's `title` tooltip while open. Terminals that don't
108
- * know it ignore it and keep showing `title`.
107
+ * and replaces the node's `title` tooltip while open. A lone `md` card is a
108
+ * wide read-only preview the pointer passes through (open only over the
109
+ * node). On an `agent` it opens over the row, not the children. Terminals
110
+ * that don't know it ignore it and keep showing `title`.
109
111
  */
110
112
  hovercard?: TspPropNode;
111
113
  }
@@ -277,6 +279,20 @@ export interface TspTreeNode {
277
279
  export interface TspTreeProps {
278
280
  nodes: readonly TspTreeNode[];
279
281
  }
282
+ /**
283
+ * A raw JSON value the terminal draws as an interactive tree: small containers
284
+ * whole on one row, larger ones folded to a preview that expands on click.
285
+ * Folding is local to the terminal and sends no events.
286
+ */
287
+ export interface TspJsonProps {
288
+ /** Any JSON value; absent reads as null. */
289
+ value: unknown;
290
+ /**
291
+ * Levels of containers expanded below the top-level entries (default 0:
292
+ * the root's entries listed, every container among them folded).
293
+ */
294
+ open?: number;
295
+ }
280
296
  export interface TspBadgeProps {
281
297
  text: string;
282
298
  }
@@ -367,6 +383,9 @@ export interface TspEditorProps {
367
383
  * Independent of text editability or keyboard focus; absent or false is not ready. */
368
384
  sendable?: boolean;
369
385
  maxLines?: number;
386
+ /** The program cannot read input yet: while the field has the focus, the terminal keeps
387
+ * what is typed into it, draws it at the caret, and sends it once this clears. */
388
+ typeahead?: boolean;
370
389
  }
371
390
  export type TspInputProps = Omit<TspEditorProps, "maxLines">;
372
391
  export interface TspStatusProps {
@@ -899,6 +918,7 @@ export interface TspPropsByKind {
899
918
  kv: TspKvProps;
900
919
  table: TspTableProps;
901
920
  tree: TspTreeProps;
921
+ json: TspJsonProps;
902
922
  badge: TspBadgeProps;
903
923
  kbd: TspKbdProps;
904
924
  icon: TspIconProps;
@@ -990,23 +1010,6 @@ export interface TspClose {
990
1010
  /** Keep `main` in scrollback (true) or remove the surface (false). */
991
1011
  keep: boolean;
992
1012
  }
993
- /**
994
- * Verb `t`: the program's resolved theme for a surface, sent after `o` and
995
- * before its first `f`, and again whenever the theme or variant changes.
996
- * Each variant maps token names to `#rrggbb`; tokens left at the terminal
997
- * default are omitted. A program with one variant sends only that one.
998
- */
999
- export interface TspPalette {
1000
- /** Surface id. */
1001
- sf: string;
1002
- dark?: Readonly<Record<string, string>>;
1003
- light?: Readonly<Record<string, string>>;
1004
- /** Theme names behind each variant. */
1005
- name?: {
1006
- dark?: string;
1007
- light?: string;
1008
- };
1009
- }
1010
1013
  /** Verb `q`. */
1011
1014
  export type TspQuery = {
1012
1015
  q: "hello";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-wire",
4
- "version": "18.13.2",
4
+ "version": "18.14.0",
5
5
  "description": "Shared wire protocol types for omp packages",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": {
@@ -36,14 +36,13 @@
36
36
  "@types/bun": "^1.3.14"
37
37
  },
38
38
  "engines": {
39
- "bun": ">=1.3.14"
39
+ "bun": ">=1.4.4"
40
40
  },
41
41
  "files": [
42
42
  "src",
43
43
  "README.md",
44
44
  "CHANGELOG.md",
45
45
  "LICENSE",
46
- "THIRD-PARTY-NOTICES.txt",
47
46
  "dist/types"
48
47
  ],
49
48
  "exports": {
package/src/tsp.ts CHANGED
@@ -28,7 +28,7 @@ export const TSP_DEFAULT_APC_LIMIT = 65_536;
28
28
  export const TSP_DEFAULT_CREDITS = 2;
29
29
 
30
30
  /** One-letter message verb. */
31
- export type TspVerb = "q" | "o" | "f" | "b" | "t" | "x" | "r" | "e";
31
+ export type TspVerb = "q" | "o" | "f" | "b" | "x" | "r" | "e";
32
32
 
33
33
  // ═══════════════════════════════════════════════════════════════════════════
34
34
  // Vocabulary
@@ -53,6 +53,7 @@ export const TSP_KINDS = [
53
53
  "kv",
54
54
  "table",
55
55
  "tree",
56
+ "json",
56
57
  "badge",
57
58
  "kbd",
58
59
  "icon",
@@ -154,8 +155,10 @@ export interface TspCommonProps {
154
155
  * right after another tooltip or card), anchored below it (above without
155
156
  * room) and clamped to the window. It stays open while the pointer is over
156
157
  * the node or the card, closes on leave (short grace), press, key or scroll,
157
- * and replaces the node's `title` tooltip while open. Terminals that don't
158
- * know it ignore it and keep showing `title`.
158
+ * and replaces the node's `title` tooltip while open. A lone `md` card is a
159
+ * wide read-only preview the pointer passes through (open only over the
160
+ * node). On an `agent` it opens over the row, not the children. Terminals
161
+ * that don't know it ignore it and keep showing `title`.
159
162
  */
160
163
  hovercard?: TspPropNode;
161
164
  }
@@ -313,6 +316,20 @@ export interface TspTreeNode {
313
316
  export interface TspTreeProps {
314
317
  nodes: readonly TspTreeNode[];
315
318
  }
319
+ /**
320
+ * A raw JSON value the terminal draws as an interactive tree: small containers
321
+ * whole on one row, larger ones folded to a preview that expands on click.
322
+ * Folding is local to the terminal and sends no events.
323
+ */
324
+ export interface TspJsonProps {
325
+ /** Any JSON value; absent reads as null. */
326
+ value: unknown;
327
+ /**
328
+ * Levels of containers expanded below the top-level entries (default 0:
329
+ * the root's entries listed, every container among them folded).
330
+ */
331
+ open?: number;
332
+ }
316
333
  export interface TspBadgeProps {
317
334
  text: string;
318
335
  }
@@ -394,6 +411,9 @@ export interface TspEditorProps {
394
411
  * Independent of text editability or keyboard focus; absent or false is not ready. */
395
412
  sendable?: boolean;
396
413
  maxLines?: number;
414
+ /** The program cannot read input yet: while the field has the focus, the terminal keeps
415
+ * what is typed into it, draws it at the caret, and sends it once this clears. */
416
+ typeahead?: boolean;
397
417
  }
398
418
  export type TspInputProps = Omit<TspEditorProps, "maxLines">;
399
419
  export interface TspStatusProps {
@@ -863,6 +883,7 @@ export interface TspPropsByKind {
863
883
  kv: TspKvProps;
864
884
  table: TspTableProps;
865
885
  tree: TspTreeProps;
886
+ json: TspJsonProps;
866
887
  badge: TspBadgeProps;
867
888
  kbd: TspKbdProps;
868
889
  icon: TspIconProps;
@@ -969,21 +990,6 @@ export interface TspClose {
969
990
  keep: boolean;
970
991
  }
971
992
 
972
- /**
973
- * Verb `t`: the program's resolved theme for a surface, sent after `o` and
974
- * before its first `f`, and again whenever the theme or variant changes.
975
- * Each variant maps token names to `#rrggbb`; tokens left at the terminal
976
- * default are omitted. A program with one variant sends only that one.
977
- */
978
- export interface TspPalette {
979
- /** Surface id. */
980
- sf: string;
981
- dark?: Readonly<Record<string, string>>;
982
- light?: Readonly<Record<string, string>>;
983
- /** Theme names behind each variant. */
984
- name?: { dark?: string; light?: string };
985
- }
986
-
987
993
  /** Verb `q`. */
988
994
  export type TspQuery =
989
995
  | { q: "hello"; v: readonly number[]; app: string; ver?: string; features?: readonly string[] }