@linxiraos/pi-wire 1.1.26 → 1.2.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
@@ -1,7 +1,15 @@
1
- # Changelog
2
-
3
1
  ## [Unreleased]
4
2
 
3
+ ## [1.2.0] - 2026-10-12
4
+
5
+ ### Added
6
+
7
+ - Added `TspToolProps.command` (the command line Copy command copies), `TspToolProps.preview: "children"` (the collapsed body stays whole while its children clamp) and `TspCodeProps.preview`
8
+
9
+ ### Changed
10
+
11
+ - Updated `TspEditorProps.placeholder` and `TspInputProps.placeholder` to accept `TspText`, enabling styled placeholder text.
12
+
5
13
  ## [1.1.26] - 2026-10-03
6
14
 
7
15
  - 版本线推进至 1.1.26;本版无独立用户可见变化。
@@ -72,24 +80,6 @@
72
80
 
73
81
  - 同步 1.1.4 发布线(与 1.1.3 无功能差异)。
74
82
 
75
- ## [1.1.3] - 2026-08-25
76
-
77
- ### Fixed
78
-
79
- - Republished as 1.1.3 to reset the latest tag after the broken 1.1.2 (no functional change over 1.1.1).
80
-
81
- ## [1.1.2] - 2026-08-25
82
-
83
- ### Fixed
84
-
85
- - Republished as 1.1.2 to reset the `latest` tag after the broken 1.1.0 (no functional change over 1.1.1).
86
-
87
- ## [1.1.1] - 2026-08-25
88
-
89
- ### Fixed
90
-
91
- - Published tarballs now carry real dependency versions instead of Bun's `catalog:` protocol (1.1.0 installs failed with "Unsupported URL Type catalog:").
92
-
93
83
  ## [1.1.0] - 2026-08-25
94
84
 
95
85
  ### Changed
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Wire contract for Skillshare (`skills.omp.sh`): an npm-style registry for
3
- * omp skills. Shared by the omp CLI (`omp skill …`), the Go server
3
+ * zetacode skills. Shared by the omp CLI (`zetacode skill …`), the Go server
4
4
  * (`stencil/apps/skills`), and its web UI (which mirrors this file).
5
5
  *
6
6
  * Packages are scoped: `@scope/name`. A scope is a Stencil username claimed on
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Wire types for `omp stream`: Twitch-style live screen sharing at
2
+ * Wire types for `zetacode stream`: Twitch-style live screen sharing at
3
3
  * `live.omp.sh/<username>`.
4
4
  *
5
- * Independent from collab. A publisher (`omp stream`) sends plaintext JSON
5
+ * Independent from collab. A publisher (`zetacode stream`) sends plaintext JSON
6
6
  * screen deltas for one or more panes (one pane per omp session attached in
7
7
  * the same working directory); the stream server materializes each pane
8
8
  * (viewport + bounded history) so late viewers receive a snapshot without
@@ -182,7 +182,7 @@ export declare const STREAM_AUTH_ENV = "STENCIL_API_KEY";
182
182
  /** Longest accepted clip description (runes). Titles share `STREAM_TITLE_MAX`. */
183
183
  export declare const CLIP_DESCRIPTION_MAX = 5000;
184
184
  /**
185
- * `POST /api/clips` answer. The body is an `.ompcast` recording (optionally
185
+ * `POST /api/clips` answer. The body is an `.zetacast` recording (optionally
186
186
  * `Content-Encoding: gzip`) whose header may carry `title` and `description`;
187
187
  * the bearer identifies the uploading Stencil account.
188
188
  */
@@ -11,9 +11,11 @@
11
11
  * `q` query, `o` open, `f` frame, `b` blob, `t` palette, `x` close. Terminal →
12
12
  * program: `r` reply, `e` event (on the pty's input side).
13
13
  *
14
- * The normative spec is `crates/tern/SURFACE_PROTOCOL.md` in the Stencil
15
- * repository; these types mirror it. Unknown fields and verbs are ignored in
16
- * both directions, so every addition here is optional.
14
+ * The normative spec is the Tern SDK's Surface Protocol and Elements reference
15
+ * (`docs/sdk/src/protocol` and `docs/sdk/src/elements` in the Stencil
16
+ * repository, https://docs.stencil.so/tern/protocol/); these types mirror it.
17
+ * Unknown fields and verbs are ignored in both directions, so every addition
18
+ * here is optional.
17
19
  */
18
20
  /** Protocol version this build speaks. */
19
21
  export declare const TSP_VERSION = 1;
@@ -168,6 +170,8 @@ export interface TspCodeProps {
168
170
  tone: TspTone;
169
171
  }[];
170
172
  wrap?: boolean;
173
+ /** Clamp to the first `lines` drawn lines under a "N more lines" button; gives way inside an open disclosure. */
174
+ preview?: TspPreview;
171
175
  }
172
176
  export interface TspDiffHunk {
173
177
  oldStart: number;
@@ -321,13 +325,17 @@ export interface TspEditorProps {
321
325
  decor?: readonly TspEditorDecoration[];
322
326
  /** Inline completion suffix drawn after the caret. */
323
327
  ghost?: string;
324
- placeholder?: string;
328
+ /** Dim text while `text` is empty; spans style it (`em` for italics). */
329
+ placeholder?: TspText;
325
330
  prompt?: TspText;
326
331
  /** Mode label (vim). */
327
332
  mode?: string;
328
333
  /** The text is code in this language (`python`, `bash`): highlighted, in the mono face. */
329
334
  lang?: string;
330
335
  readonly?: boolean;
336
+ /** Ready to accept an atomic `send` when advertised in `hello.features`.
337
+ * Independent of text editability or keyboard focus; absent or false is not ready. */
338
+ sendable?: boolean;
331
339
  maxLines?: number;
332
340
  }
333
341
  export type TspInputProps = Omit<TspEditorProps, "maxLines">;
@@ -415,7 +423,7 @@ export interface TspPickerItem {
415
423
  export interface TspPickerColumn {
416
424
  id: string;
417
425
  head?: string;
418
- /** `elapsed`: the value is an age in ms at send; Tern clocks it (spec §9). */
426
+ /** `elapsed`: the value is an age in ms at send; Tern clocks it. */
419
427
  format?: "text" | "num" | "price" | "bar" | "time" | "elapsed" | "dim";
420
428
  /** Lower priorities hide first when narrow. */
421
429
  priority?: number;
@@ -641,6 +649,8 @@ export interface TspToolProps {
641
649
  targetKind?: "command" | "path" | "pattern" | "query" | "text";
642
650
  /** Language for `command` highlighting (`bash`, `python`, `js`). */
643
651
  lang?: string;
652
+ /** The raw command line the head's Copy command button copies; a `command` target sets it implicitly. */
653
+ command?: string;
644
654
  /** `file://` link for path targets (⌘-click opens). */
645
655
  href?: string;
646
656
  /** Short facts after the target: `+8 −1`, `5 matches · 2 files`, `22 lines`. */
@@ -665,12 +675,15 @@ export interface TspToolProps {
665
675
  frame?: "card" | "inline";
666
676
  collapsible?: boolean;
667
677
  collapsed?: boolean;
668
- /** Body clamp while collapsed: `{lines}` shows the head of the body, `{tail}` the end (bash output). */
678
+ /**
679
+ * Body clamp while collapsed: `{lines}` shows the head of the body, `{tail}` the end (bash output).
680
+ * `children`: the collapsed body stays whole and the children's own previews (`ansi`, `code`) clamp instead.
681
+ */
669
682
  preview?: {
670
683
  lines: number;
671
684
  } | {
672
685
  tail: number;
673
- } | "none";
686
+ } | "none" | "children";
674
687
  /** Actions offered in the head on hover (`copy`, `rerun`, `open`). */
675
688
  tools?: readonly TspPickerAction[];
676
689
  }
@@ -932,6 +945,7 @@ export type TspQuery = {
932
945
  v: readonly number[];
933
946
  app: string;
934
947
  ver?: string;
948
+ features?: readonly string[];
935
949
  } | {
936
950
  q: "blobs";
937
951
  ids: readonly string[];
@@ -953,6 +967,8 @@ export type TspReply = {
953
967
  };
954
968
  dark?: boolean;
955
969
  reduceMotion?: boolean;
970
+ /** The user's system reads a 12-hour clock (`false`: 24-hour); absent from older terminals. */
971
+ hour12?: boolean;
956
972
  } | {
957
973
  r: "blobs";
958
974
  have: readonly string[];
@@ -1028,6 +1044,31 @@ export type TspEvent = {
1028
1044
  cursor: number;
1029
1045
  len: number;
1030
1046
  }
1047
+ /**
1048
+ * Undo the last change to the text of `editor`/`input` node `id` through the
1049
+ * program's own undo history (an applied `edit` is one unit, as typing is); a
1050
+ * no-op when there is nothing to undo. Sent only when `hello` lists `"undo"`.
1051
+ */
1052
+ | {
1053
+ ev: "undo";
1054
+ sf: string;
1055
+ id: string;
1056
+ }
1057
+ /**
1058
+ * Submit `text` as one prompt through the addressed composer's ordinary
1059
+ * submission path, without paste or keyboard simulation. Sent only when
1060
+ * the program's `hello.features` includes `"send"` and `sf`/`id` identify
1061
+ * a live editable composer whose `sendable` is exactly true. Writable text
1062
+ * or keyboard focus alone does not imply submission readiness. Blank text is
1063
+ * a no-op; an existing draft is retained for local recall, not appended to
1064
+ * the supplied prompt.
1065
+ */
1066
+ | {
1067
+ ev: "send";
1068
+ sf: string;
1069
+ id: string;
1070
+ text: string;
1071
+ }
1031
1072
  /**
1032
1073
  * The user clicked into node `id` (an `editor`/`input` without the focus, or
1033
1074
  * a `prefs` sheet while the focus is outside it): the program moves its
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@linxiraos/pi-wire",
4
- "version": "1.1.26",
4
+ "version": "1.2.0",
5
5
  "description": "Shared wire protocol types for omp packages",
6
6
  "homepage": "https://linxira-os.github.io/zeta/",
7
7
  "author": "Can Boluk",
package/src/skillshare.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Wire contract for Skillshare (`skills.omp.sh`): an npm-style registry for
3
- * omp skills. Shared by the omp CLI (`omp skill …`), the Go server
3
+ * zetacode skills. Shared by the omp CLI (`zetacode skill …`), the Go server
4
4
  * (`stencil/apps/skills`), and its web UI (which mirrors this file).
5
5
  *
6
6
  * Packages are scoped: `@scope/name`. A scope is a Stencil username claimed on
package/src/stream.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Wire types for `omp stream`: Twitch-style live screen sharing at
2
+ * Wire types for `zetacode stream`: Twitch-style live screen sharing at
3
3
  * `live.omp.sh/<username>`.
4
4
  *
5
- * Independent from collab. A publisher (`omp stream`) sends plaintext JSON
5
+ * Independent from collab. A publisher (`zetacode stream`) sends plaintext JSON
6
6
  * screen deltas for one or more panes (one pane per omp session attached in
7
7
  * the same working directory); the stream server materializes each pane
8
8
  * (viewport + bounded history) so late viewers receive a snapshot without
@@ -145,7 +145,7 @@ export const STREAM_AUTH_ENV = "STENCIL_API_KEY";
145
145
  export const CLIP_DESCRIPTION_MAX = 5000;
146
146
 
147
147
  /**
148
- * `POST /api/clips` answer. The body is an `.ompcast` recording (optionally
148
+ * `POST /api/clips` answer. The body is an `.zetacast` recording (optionally
149
149
  * `Content-Encoding: gzip`) whose header may carry `title` and `description`;
150
150
  * the bearer identifies the uploading Stencil account.
151
151
  */
package/src/tsp.ts CHANGED
@@ -11,9 +11,11 @@
11
11
  * `q` query, `o` open, `f` frame, `b` blob, `t` palette, `x` close. Terminal →
12
12
  * program: `r` reply, `e` event (on the pty's input side).
13
13
  *
14
- * The normative spec is `crates/tern/SURFACE_PROTOCOL.md` in the Stencil
15
- * repository; these types mirror it. Unknown fields and verbs are ignored in
16
- * both directions, so every addition here is optional.
14
+ * The normative spec is the Tern SDK's Surface Protocol and Elements reference
15
+ * (`docs/sdk/src/protocol` and `docs/sdk/src/elements` in the Stencil
16
+ * repository, https://docs.stencil.so/tern/protocol/); these types mirror it.
17
+ * Unknown fields and verbs are ignored in both directions, so every addition
18
+ * here is optional.
17
19
  */
18
20
 
19
21
  /** Protocol version this build speaks. */
@@ -215,6 +217,8 @@ export interface TspCodeProps {
215
217
  numbers?: boolean;
216
218
  marks?: readonly { line: number; tone: TspTone }[];
217
219
  wrap?: boolean;
220
+ /** Clamp to the first `lines` drawn lines under a "N more lines" button; gives way inside an open disclosure. */
221
+ preview?: TspPreview;
218
222
  }
219
223
  export interface TspDiffHunk {
220
224
  oldStart: number;
@@ -350,13 +354,17 @@ export interface TspEditorProps {
350
354
  decor?: readonly TspEditorDecoration[];
351
355
  /** Inline completion suffix drawn after the caret. */
352
356
  ghost?: string;
353
- placeholder?: string;
357
+ /** Dim text while `text` is empty; spans style it (`em` for italics). */
358
+ placeholder?: TspText;
354
359
  prompt?: TspText;
355
360
  /** Mode label (vim). */
356
361
  mode?: string;
357
362
  /** The text is code in this language (`python`, `bash`): highlighted, in the mono face. */
358
363
  lang?: string;
359
364
  readonly?: boolean;
365
+ /** Ready to accept an atomic `send` when advertised in `hello.features`.
366
+ * Independent of text editability or keyboard focus; absent or false is not ready. */
367
+ sendable?: boolean;
360
368
  maxLines?: number;
361
369
  }
362
370
  export type TspInputProps = Omit<TspEditorProps, "maxLines">;
@@ -433,7 +441,7 @@ export interface TspPickerItem {
433
441
  export interface TspPickerColumn {
434
442
  id: string;
435
443
  head?: string;
436
- /** `elapsed`: the value is an age in ms at send; Tern clocks it (spec §9). */
444
+ /** `elapsed`: the value is an age in ms at send; Tern clocks it. */
437
445
  format?: "text" | "num" | "price" | "bar" | "time" | "elapsed" | "dim";
438
446
  /** Lower priorities hide first when narrow. */
439
447
  priority?: number;
@@ -630,6 +638,8 @@ export interface TspToolProps {
630
638
  targetKind?: "command" | "path" | "pattern" | "query" | "text";
631
639
  /** Language for `command` highlighting (`bash`, `python`, `js`). */
632
640
  lang?: string;
641
+ /** The raw command line the head's Copy command button copies; a `command` target sets it implicitly. */
642
+ command?: string;
633
643
  /** `file://` link for path targets (⌘-click opens). */
634
644
  href?: string;
635
645
  /** Short facts after the target: `+8 −1`, `5 matches · 2 files`, `22 lines`. */
@@ -650,8 +660,11 @@ export interface TspToolProps {
650
660
  frame?: "card" | "inline";
651
661
  collapsible?: boolean;
652
662
  collapsed?: boolean;
653
- /** Body clamp while collapsed: `{lines}` shows the head of the body, `{tail}` the end (bash output). */
654
- preview?: { lines: number } | { tail: number } | "none";
663
+ /**
664
+ * Body clamp while collapsed: `{lines}` shows the head of the body, `{tail}` the end (bash output).
665
+ * `children`: the collapsed body stays whole and the children's own previews (`ansi`, `code`) clamp instead.
666
+ */
667
+ preview?: { lines: number } | { tail: number } | "none" | "children";
655
668
  /** Actions offered in the head on hover (`copy`, `rerun`, `open`). */
656
669
  tools?: readonly TspPickerAction[];
657
670
  }
@@ -902,7 +915,7 @@ export interface TspPalette {
902
915
 
903
916
  /** Verb `q`. */
904
917
  export type TspQuery =
905
- | { q: "hello"; v: readonly number[]; app: string; ver?: string }
918
+ | { q: "hello"; v: readonly number[]; app: string; ver?: string; features?: readonly string[] }
906
919
  | { q: "blobs"; ids: readonly string[] };
907
920
 
908
921
  /** Verb `r`. */
@@ -920,6 +933,8 @@ export type TspReply =
920
933
  cell?: { w: number; h: number };
921
934
  dark?: boolean;
922
935
  reduceMotion?: boolean;
936
+ /** The user's system reads a 12-hour clock (`false`: 24-hour); absent from older terminals. */
937
+ hour12?: boolean;
923
938
  }
924
939
  | { r: "blobs"; have: readonly string[] };
925
940
 
@@ -948,6 +963,22 @@ export type TspEvent =
948
963
  * text length the terminal saw, a mismatch makes the edit stale).
949
964
  */
950
965
  | { ev: "edit"; sf: string; id: string; from: number; to: number; text: string; cursor: number; len: number }
966
+ /**
967
+ * Undo the last change to the text of `editor`/`input` node `id` through the
968
+ * program's own undo history (an applied `edit` is one unit, as typing is); a
969
+ * no-op when there is nothing to undo. Sent only when `hello` lists `"undo"`.
970
+ */
971
+ | { ev: "undo"; sf: string; id: string }
972
+ /**
973
+ * Submit `text` as one prompt through the addressed composer's ordinary
974
+ * submission path, without paste or keyboard simulation. Sent only when
975
+ * the program's `hello.features` includes `"send"` and `sf`/`id` identify
976
+ * a live editable composer whose `sendable` is exactly true. Writable text
977
+ * or keyboard focus alone does not imply submission readiness. Blank text is
978
+ * a no-op; an existing draft is retained for local recall, not appended to
979
+ * the supplied prompt.
980
+ */
981
+ | { ev: "send"; sf: string; id: string; text: string }
951
982
  /**
952
983
  * The user clicked into node `id` (an `editor`/`input` without the focus, or
953
984
  * a `prefs` sheet while the focus is outside it): the program moves its