@linxiraos/pi-wire 1.2.0 → 1.3.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,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.3.0] - 2026-10-18
4
+
5
+ ### Added
6
+
7
+ - Added `TspPickerMark.icon`: an icon a picker mark draws instead of its initials when the terminal has it (`provider:<id>` names a model provider's logo)
8
+
3
9
  ## [1.2.0] - 2026-10-12
4
10
 
5
11
  ### Added
@@ -8,8 +8,8 @@ no rights in third-party code, fonts, data, or marks identified below.
8
8
  PYTHON DEPENDENCY DISTRIBUTION ROLE
9
9
  ===================================
10
10
 
11
- omp-rpc has no third-party runtime dependencies. robomp declares FastAPI,
12
- Uvicorn, HTTPX, Pydantic, pydantic-settings, python-dotenv, Click, and omp-rpc
11
+ zeta-rpc has no third-party runtime dependencies. robomp declares FastAPI,
12
+ Uvicorn, HTTPX, Pydantic, pydantic-settings, python-dotenv, Click, and zeta-rpc
13
13
  as ordinary installer-resolved dependencies. The Python wheels do not vendor
14
14
  those projects; each dependency remains a separately installed distribution
15
15
  carrying its own license metadata and files. Container/system assemblers must
@@ -79,9 +79,9 @@ uutils coreutils (https://github.com/uutils/coreutils), MIT
79
79
  --------------------------------------------------------------------------------
80
80
  Covers: base32, base64, basename, cat, cksum (shared checksum machinery),
81
81
  b2sum, md5sum, sha1sum, sha224sum, sha256sum, sha384sum, sha512sum, comm, cp,
82
- cut, date, dirname, head, hostname, ln, ls, mkdir, mktemp, mv, nproc, paste,
83
- printenv, readlink, realpath, rm, seq, sort, stat, tac, tail, tee, touch, tr,
84
- truncate, uname, uniq, wc, whoami, yes.
82
+ cut, date, dirname, head, hostname, ln, ls, mkdir, mktemp, mv, nl, nproc,
83
+ paste, printenv, readlink, realpath, rm, seq, sort, stat, tac, tail, tee,
84
+ touch, tr, truncate, uname, uniq, wc, whoami, yes.
85
85
 
86
86
  Copyright (c) uutils developers
87
87
 
@@ -824,6 +824,56 @@ public licenses.
824
824
 
825
825
  Creative Commons may be contacted at creativecommons.org.
826
826
 
827
+ -------------------------------------------------------------------------------
828
+ scripts/brand/fonts/ANSI Shadow.flf, scripts/brand/fonts/mini.flf
829
+
830
+ Two FIGlet font files from the standard FIGlet font distribution — the
831
+ figlet.org font set shipped by figlet.js
832
+ (https://github.com/patorjk/figlet.js/tree/master/fonts), fetched from
833
+ figlet.js 1.8.0 — vendored so the welcome/splash brand art
834
+ (`packages/tui/src/prompt/welcome.ts`) is generated reproducibly and offline
835
+ by `bun scripts/brand/generate-logo-art.ts`. Both files are unmodified and
836
+ retain their original FIGlet headers. They are build-time inputs only: no font
837
+ file or font data is compiled into, or shipped with, a Zeta release artifact.
838
+ The fonts' own headers carry their terms:
839
+
840
+ - `ANSI Shadow.flf` — "ANSI Shadow". Author unknown ("Font Author: ?" in the
841
+ header); a TheDraw-archive font converted with the FIGlet font editor
842
+ (http://patorjk.com/figfont-editor). Distributed under the FIGlet font
843
+ license as carried by the standard FIGlet font set: free to use and
844
+ redistribute with the header intact.
845
+ - `mini.flf` — "mini" by Glenn Chappell (4/93), from figlet release 2.1
846
+ (12 Aug 1994), "Includes ISO Latin-1"; modified by Paul Burton
847
+ <solution@earthlink.net> 12/96. Header grant: "Permission is hereby given to
848
+ modify this font, as long as the modifier's name is placed on a comment
849
+ line."
850
+
851
+ FIGlet renderer — `figlet` 1.8.0 (https://github.com/patorjk/figlet.js), a
852
+ root devDependency used only to generate the art at build time; it is not
853
+ imported by any runtime bundle or shipped artifact.
854
+
855
+ MIT License
856
+
857
+ Copyright (C) 2014-present Patrick Gillespie and other contributors
858
+
859
+ Permission is hereby granted, free of charge, to any person obtaining a copy
860
+ of this software and associated documentation files (the "Software"), to deal
861
+ in the Software without restriction, including without limitation the rights
862
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
863
+ copies of the Software, and to permit persons to whom the Software is
864
+ furnished to do so, subject to the following conditions:
865
+
866
+ The above copyright notice and this permission notice shall be included in
867
+ all copies or substantial portions of the Software.
868
+
869
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
870
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
871
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
872
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
873
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
874
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
875
+ SOFTWARE.
876
+
827
877
  BUN / NPM DEPENDENCY INVENTORY
828
878
  ==============================
829
879
  This inventory is traversed from bun.lock, not from the host node_modules tree.
@@ -1,7 +1,11 @@
1
1
  /**
2
- * Wire contract for Skillshare (`skills.omp.sh`): an npm-style registry for
3
- * zetacode skills. Shared by the omp CLI (`zetacode skill …`), the Go server
4
- * (`stencil/apps/skills`), and its web UI (which mirrors this file).
2
+ * Wire contract for Skillshare: an npm-style registry for zetacode skills.
3
+ * Shared by the omp CLI (`zetacode skill …`) and a registry server.
4
+ *
5
+ * Zeta ships no registry: extra skills come from the npm package
6
+ * `@linxiraos/linxira-skills` (`npm i -g @linxiraos/linxira-skills`), and the
7
+ * registry commands only work after the user configures `skills.registryUrl`.
8
+ * See {@link SKILLS_REGISTRY_UNAVAILABLE}.
5
9
  *
6
10
  * Packages are scoped: `@scope/name`. A scope is a Stencil username claimed on
7
11
  * first publish and bound to the account's immutable `sub` forever (usernames
@@ -13,8 +17,17 @@
13
17
  * `metadata.version` (semver, required to publish), `metadata.keywords`
14
18
  * (comma-separated), `metadata.repository`, `metadata.homepage`.
15
19
  */
16
- /** Default registry; `skills.registryUrl` overrides it. */
17
- export declare const DEFAULT_SKILLS_URL = "https://skills.omp.sh";
20
+ /**
21
+ * No skill registry ships with Zeta. Extra skills come from the npm package
22
+ * `@linxiraos/linxira-skills` (`npm i -g @linxiraos/linxira-skills`); the
23
+ * registry commands work against a user-configured `skills.registryUrl`.
24
+ */
25
+ export declare const SKILLS_REGISTRY_UNAVAILABLE = "no skill registry ships with Zeta; extra skills come from the npm package @linxiraos/linxira-skills (npm i -g @linxiraos/linxira-skills), or set skills.registryUrl to your own registry";
26
+ /**
27
+ * Default value of `skills.registryUrl`. Empty: no registry ships by default
28
+ * (see {@link SKILLS_REGISTRY_UNAVAILABLE}).
29
+ */
30
+ export declare const DEFAULT_SKILLS_URL = "";
18
31
  /** Scopes are Stencil usernames (or registry orgs): lowercase letters, digits, underscores; 3–32 chars. */
19
32
  export declare const SKILL_SCOPE_RE: RegExp;
20
33
  /** Registry skill names: ASCII kebab-case, 1–64 chars, no leading/trailing/double hyphens. */
@@ -54,8 +67,12 @@ export declare const SKILL_HEADERS: {
54
67
  /** Optional GitHub Actions OIDC token (audience {@link SKILLS_OIDC_AUDIENCE}); verified server-side. */
55
68
  readonly githubOidc: "X-Skill-GitHub-OIDC";
56
69
  };
57
- /** Audience CI must request for GitHub Actions OIDC tokens. */
58
- export declare const SKILLS_OIDC_AUDIENCE = "skills.omp.sh";
70
+ /**
71
+ * Audience CI requests for GitHub Actions OIDC tokens. No default ships: a
72
+ * self-hosted registry issues tokens for its own audience, so the value comes
73
+ * from the registry's configuration.
74
+ */
75
+ export declare const SKILLS_OIDC_AUDIENCE = "";
59
76
  /** Env var holding a registry publish token for CI (`sks_…`); wins over the Stencil login. */
60
77
  export declare const SKILLS_TOKEN_ENV = "SKILLS_TOKEN";
61
78
  /** Public identity of an account: current username + avatar seed (hash of the immutable sub). */
@@ -1,6 +1,9 @@
1
1
  /**
2
- * Wire types for `zetacode stream`: Twitch-style live screen sharing at
3
- * `live.omp.sh/<username>`.
2
+ * Wire types for `zetacode stream`: Twitch-style live screen sharing.
3
+ *
4
+ * Zeta ships no stream server, so there is no default host: `zetacode stream`
5
+ * and clip uploads only work against a compatible server the user configures
6
+ * in `stream.serverUrl`. See {@link STREAM_HOSTING_UNAVAILABLE}.
4
7
  *
5
8
  * Independent from collab. A publisher (`zetacode stream`) sends plaintext JSON
6
9
  * screen deltas for one or more panes (one pane per omp session attached in
@@ -12,8 +15,18 @@
12
15
  * strips every other sequence, truncates to the pane width, and redacts
13
16
  * secrets before a row leaves the session process.
14
17
  */
15
- /** Default stream server; its host route derives the channel from the bearer identity. */
16
- export declare const DEFAULT_STREAM_URL = "https://live.omp.sh";
18
+ /**
19
+ * No stream or clip hosting ships with Zeta. `stream.serverUrl` has no
20
+ * default; point it at a compatible server you run yourself to enable
21
+ * `zetacode stream` (the server derives the channel from the bearer identity).
22
+ */
23
+ export declare const STREAM_HOSTING_UNAVAILABLE = "no stream server ships with Zeta; set stream.serverUrl to a compatible server";
24
+ /**
25
+ * Default value of `stream.serverUrl`. Empty: Zeta ships no stream hosting, so
26
+ * users must point the setting at their own compatible server (see
27
+ * {@link STREAM_HOSTING_UNAVAILABLE}).
28
+ */
29
+ export declare const DEFAULT_STREAM_URL = "";
17
30
  /** Protocol version carried in `hello`/`snapshot`; the server rejects mismatches. */
18
31
  export declare const STREAM_PROTO = 1;
19
32
  /** Channel names are Stencil usernames: lowercase letters, numbers, and underscores; 3–32 chars. */
@@ -191,7 +204,7 @@ export interface ClipUploadResponse {
191
204
  /** Public clip page, `<server>/c/<id>`. */
192
205
  url: string;
193
206
  }
194
- /** HTTP/WS route layout of the stream server, relative to `DEFAULT_STREAM_URL`. */
207
+ /** HTTP/WS route layout of the stream server, relative to the configured `stream.serverUrl`. */
195
208
  export declare const STREAM_ROUTES: {
196
209
  readonly channels: "/api/channels";
197
210
  readonly channel: (name: string) => string;
@@ -28,7 +28,7 @@ export declare const TSP_DEFAULT_CREDITS = 2;
28
28
  /** One-letter message verb. */
29
29
  export type TspVerb = "q" | "o" | "f" | "b" | "t" | "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", "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", "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";
@@ -114,7 +114,7 @@ export interface TspColProps {
114
114
  }
115
115
  export interface TspRowProps {
116
116
  gap?: TspSpace;
117
- align?: "start" | "center" | "baseline" | "end";
117
+ align?: "start" | "center" | "baseline" | "end" | "stretch";
118
118
  justify?: "start" | "between" | "end";
119
119
  wrap?: boolean;
120
120
  }
@@ -161,7 +161,9 @@ export interface TspMarkdownProps {
161
161
  }
162
162
  export interface TspCodeProps {
163
163
  text?: string;
164
+ /** The language of text that is no file's (`bash`, `json`); wins over `path`. */
164
165
  lang?: string;
166
+ /** The file the text comes from: the terminal picks the grammar from it (and heads a block outside a tool card with it). */
165
167
  path?: string;
166
168
  start?: number;
167
169
  numbers?: boolean;
@@ -182,7 +184,9 @@ export interface TspDiffProps {
182
184
  /** Unified diff text (or give `hunks`). */
183
185
  text?: string;
184
186
  hunks?: readonly TspDiffHunk[];
187
+ /** The file the diff changes: the terminal picks the grammar from it. Not drawn. */
185
188
  path?: string;
189
+ /** A language overriding the one `path` gives. */
186
190
  lang?: string;
187
191
  mode?: "unified" | "split" | "auto";
188
192
  }
@@ -214,6 +218,23 @@ export interface TspImageProps {
214
218
  h?: TspExtent;
215
219
  };
216
220
  }
221
+ /**
222
+ * A file the terminal loads by path and shows in its media viewer (pictures, SVG, 3D models,
223
+ * PDF/video/audio, else a card). Programs check `cx.supports("media")` first.
224
+ */
225
+ export interface TspMediaProps {
226
+ /** The file: absolute, or relative to the pane's working directory. */
227
+ path: string;
228
+ /** Git revision to read instead of the disk file: a commit-ish (`HEAD`, a sha) or `:0` for the index. */
229
+ rev?: string;
230
+ /** `media` nodes of one surface sharing this name pan and zoom together (before/after compare). */
231
+ link?: string;
232
+ /** Size cap; the node otherwise fills its container. */
233
+ max?: {
234
+ w?: TspExtent;
235
+ h?: TspExtent;
236
+ };
237
+ }
217
238
  export interface TspKvProps {
218
239
  items: readonly {
219
240
  k: TspText;
@@ -385,10 +406,7 @@ export interface TspPickerItem {
385
406
  detail?: TspText;
386
407
  /** Leading visual: a named icon, a provider/avatar mark, or a status dot. */
387
408
  icon?: string;
388
- mark?: {
389
- text: string;
390
- seed?: string;
391
- };
409
+ mark?: TspPickerMark;
392
410
  dot?: TspTone;
393
411
  /** Label is a machine string (model id, path): mono, dim prefix and strong tail by the `/`. */
394
412
  mono?: boolean;
@@ -419,6 +437,16 @@ export interface TspPickerItem {
419
437
  role?: string;
420
438
  title?: string;
421
439
  }
440
+ /**
441
+ * A picker avatar: the `icon` when the terminal has it (`provider:<id>` names a
442
+ * model provider's logo by its id), else up to two initials of `text` on a
443
+ * gradient picked by `seed` (default `text`).
444
+ */
445
+ export interface TspPickerMark {
446
+ text: string;
447
+ seed?: string;
448
+ icon?: string;
449
+ }
422
450
  /** A right-aligned fact column in a picker. */
423
451
  export interface TspPickerColumn {
424
452
  id: string;
@@ -435,10 +463,7 @@ export interface TspPickerScope {
435
463
  id: string;
436
464
  label: TspText;
437
465
  icon?: string;
438
- mark?: {
439
- text: string;
440
- seed?: string;
441
- };
466
+ mark?: TspPickerMark;
442
467
  count?: number;
443
468
  /** Group heading this scope sits under (consecutive scopes with the same group share a head). */
444
469
  group?: string;
@@ -844,6 +869,7 @@ export interface TspPropsByKind {
844
869
  ansi: TspAnsiProps;
845
870
  math: TspMathProps;
846
871
  image: TspImageProps;
872
+ media: TspMediaProps;
847
873
  kv: TspKvProps;
848
874
  table: TspTableProps;
849
875
  tree: TspTreeProps;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@linxiraos/pi-wire",
4
- "version": "1.2.0",
4
+ "version": "1.3.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",
@@ -24,13 +24,13 @@
24
24
  "types": "./dist/types/index.d.ts",
25
25
  "scripts": {
26
26
  "check": "oxlint . && oxfmt --check --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts' && bun run check:types",
27
- "check:types": "tsgo -p tsconfig.json --noEmit",
27
+ "check:types": "tsc -p tsconfig.json --noEmit",
28
28
  "lint": "oxlint .",
29
29
  "fix": "oxlint --fix --fix-suggestions . && bun run fmt",
30
30
  "fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
31
31
  },
32
32
  "devDependencies": {
33
- "@types/bun": "^1.3.14"
33
+ "@types/bun": "1.4.3"
34
34
  },
35
35
  "engines": {
36
36
  "bun": ">=1.3.14"
package/src/skillshare.ts CHANGED
@@ -1,7 +1,11 @@
1
1
  /**
2
- * Wire contract for Skillshare (`skills.omp.sh`): an npm-style registry for
3
- * zetacode skills. Shared by the omp CLI (`zetacode skill …`), the Go server
4
- * (`stencil/apps/skills`), and its web UI (which mirrors this file).
2
+ * Wire contract for Skillshare: an npm-style registry for zetacode skills.
3
+ * Shared by the omp CLI (`zetacode skill …`) and a registry server.
4
+ *
5
+ * Zeta ships no registry: extra skills come from the npm package
6
+ * `@linxiraos/linxira-skills` (`npm i -g @linxiraos/linxira-skills`), and the
7
+ * registry commands only work after the user configures `skills.registryUrl`.
8
+ * See {@link SKILLS_REGISTRY_UNAVAILABLE}.
5
9
  *
6
10
  * Packages are scoped: `@scope/name`. A scope is a Stencil username claimed on
7
11
  * first publish and bound to the account's immutable `sub` forever (usernames
@@ -14,8 +18,19 @@
14
18
  * (comma-separated), `metadata.repository`, `metadata.homepage`.
15
19
  */
16
20
 
17
- /** Default registry; `skills.registryUrl` overrides it. */
18
- export const DEFAULT_SKILLS_URL = "https://skills.omp.sh";
21
+ /**
22
+ * No skill registry ships with Zeta. Extra skills come from the npm package
23
+ * `@linxiraos/linxira-skills` (`npm i -g @linxiraos/linxira-skills`); the
24
+ * registry commands work against a user-configured `skills.registryUrl`.
25
+ */
26
+ export const SKILLS_REGISTRY_UNAVAILABLE =
27
+ "no skill registry ships with Zeta; extra skills come from the npm package @linxiraos/linxira-skills (npm i -g @linxiraos/linxira-skills), or set skills.registryUrl to your own registry";
28
+
29
+ /**
30
+ * Default value of `skills.registryUrl`. Empty: no registry ships by default
31
+ * (see {@link SKILLS_REGISTRY_UNAVAILABLE}).
32
+ */
33
+ export const DEFAULT_SKILLS_URL = "";
19
34
 
20
35
  /** Scopes are Stencil usernames (or registry orgs): lowercase letters, digits, underscores; 3–32 chars. */
21
36
  export const SKILL_SCOPE_RE = /^[a-z0-9][a-z0-9_]{2,31}$/;
@@ -68,8 +83,12 @@ export const SKILL_HEADERS = {
68
83
  githubOidc: "X-Skill-GitHub-OIDC",
69
84
  } as const;
70
85
 
71
- /** Audience CI must request for GitHub Actions OIDC tokens. */
72
- export const SKILLS_OIDC_AUDIENCE = "skills.omp.sh";
86
+ /**
87
+ * Audience CI requests for GitHub Actions OIDC tokens. No default ships: a
88
+ * self-hosted registry issues tokens for its own audience, so the value comes
89
+ * from the registry's configuration.
90
+ */
91
+ export const SKILLS_OIDC_AUDIENCE = "";
73
92
 
74
93
  /** Env var holding a registry publish token for CI (`sks_…`); wins over the Stencil login. */
75
94
  export const SKILLS_TOKEN_ENV = "SKILLS_TOKEN";
package/src/stream.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  /**
2
- * Wire types for `zetacode stream`: Twitch-style live screen sharing at
3
- * `live.omp.sh/<username>`.
2
+ * Wire types for `zetacode stream`: Twitch-style live screen sharing.
3
+ *
4
+ * Zeta ships no stream server, so there is no default host: `zetacode stream`
5
+ * and clip uploads only work against a compatible server the user configures
6
+ * in `stream.serverUrl`. See {@link STREAM_HOSTING_UNAVAILABLE}.
4
7
  *
5
8
  * Independent from collab. A publisher (`zetacode stream`) sends plaintext JSON
6
9
  * screen deltas for one or more panes (one pane per omp session attached in
@@ -13,8 +16,20 @@
13
16
  * secrets before a row leaves the session process.
14
17
  */
15
18
 
16
- /** Default stream server; its host route derives the channel from the bearer identity. */
17
- export const DEFAULT_STREAM_URL = "https://live.omp.sh";
19
+ /**
20
+ * No stream or clip hosting ships with Zeta. `stream.serverUrl` has no
21
+ * default; point it at a compatible server you run yourself to enable
22
+ * `zetacode stream` (the server derives the channel from the bearer identity).
23
+ */
24
+ export const STREAM_HOSTING_UNAVAILABLE =
25
+ "no stream server ships with Zeta; set stream.serverUrl to a compatible server";
26
+
27
+ /**
28
+ * Default value of `stream.serverUrl`. Empty: Zeta ships no stream hosting, so
29
+ * users must point the setting at their own compatible server (see
30
+ * {@link STREAM_HOSTING_UNAVAILABLE}).
31
+ */
32
+ export const DEFAULT_STREAM_URL = "";
18
33
 
19
34
  /** Protocol version carried in `hello`/`snapshot`; the server rejects mismatches. */
20
35
  export const STREAM_PROTO = 1;
@@ -155,7 +170,7 @@ export interface ClipUploadResponse {
155
170
  url: string;
156
171
  }
157
172
 
158
- /** HTTP/WS route layout of the stream server, relative to `DEFAULT_STREAM_URL`. */
173
+ /** HTTP/WS route layout of the stream server, relative to the configured `stream.serverUrl`. */
159
174
  export const STREAM_ROUTES = {
160
175
  channels: "/api/channels",
161
176
  channel: (name: string) => `/api/channels/${name}`,
package/src/tsp.ts CHANGED
@@ -49,6 +49,7 @@ export const TSP_KINDS = [
49
49
  "ansi",
50
50
  "math",
51
51
  "image",
52
+ "media",
52
53
  "kv",
53
54
  "table",
54
55
  "tree",
@@ -164,7 +165,7 @@ export interface TspColProps {
164
165
  }
165
166
  export interface TspRowProps {
166
167
  gap?: TspSpace;
167
- align?: "start" | "center" | "baseline" | "end";
168
+ align?: "start" | "center" | "baseline" | "end" | "stretch";
168
169
  justify?: "start" | "between" | "end";
169
170
  wrap?: boolean;
170
171
  }
@@ -211,7 +212,9 @@ export interface TspMarkdownProps {
211
212
  }
212
213
  export interface TspCodeProps {
213
214
  text?: string;
215
+ /** The language of text that is no file's (`bash`, `json`); wins over `path`. */
214
216
  lang?: string;
217
+ /** The file the text comes from: the terminal picks the grammar from it (and heads a block outside a tool card with it). */
215
218
  path?: string;
216
219
  start?: number;
217
220
  numbers?: boolean;
@@ -229,7 +232,9 @@ export interface TspDiffProps {
229
232
  /** Unified diff text (or give `hunks`). */
230
233
  text?: string;
231
234
  hunks?: readonly TspDiffHunk[];
235
+ /** The file the diff changes: the terminal picks the grammar from it. Not drawn. */
232
236
  path?: string;
237
+ /** A language overriding the one `path` gives. */
233
238
  lang?: string;
234
239
  mode?: "unified" | "split" | "auto";
235
240
  }
@@ -258,6 +263,20 @@ export interface TspImageProps {
258
263
  h?: number;
259
264
  max?: { w?: TspExtent; h?: TspExtent };
260
265
  }
266
+ /**
267
+ * A file the terminal loads by path and shows in its media viewer (pictures, SVG, 3D models,
268
+ * PDF/video/audio, else a card). Programs check `cx.supports("media")` first.
269
+ */
270
+ export interface TspMediaProps {
271
+ /** The file: absolute, or relative to the pane's working directory. */
272
+ path: string;
273
+ /** Git revision to read instead of the disk file: a commit-ish (`HEAD`, a sha) or `:0` for the index. */
274
+ rev?: string;
275
+ /** `media` nodes of one surface sharing this name pan and zoom together (before/after compare). */
276
+ link?: string;
277
+ /** Size cap; the node otherwise fills its container. */
278
+ max?: { w?: TspExtent; h?: TspExtent };
279
+ }
261
280
  export interface TspKvProps {
262
281
  items: readonly { k: TspText; v: TspText }[];
263
282
  layout?: "grid" | "inline";
@@ -414,7 +433,7 @@ export interface TspPickerItem {
414
433
  detail?: TspText;
415
434
  /** Leading visual: a named icon, a provider/avatar mark, or a status dot. */
416
435
  icon?: string;
417
- mark?: { text: string; seed?: string };
436
+ mark?: TspPickerMark;
418
437
  dot?: TspTone;
419
438
  /** Label is a machine string (model id, path): mono, dim prefix and strong tail by the `/`. */
420
439
  mono?: boolean;
@@ -437,6 +456,17 @@ export interface TspPickerItem {
437
456
  title?: string;
438
457
  }
439
458
 
459
+ /**
460
+ * A picker avatar: the `icon` when the terminal has it (`provider:<id>` names a
461
+ * model provider's logo by its id), else up to two initials of `text` on a
462
+ * gradient picked by `seed` (default `text`).
463
+ */
464
+ export interface TspPickerMark {
465
+ text: string;
466
+ seed?: string;
467
+ icon?: string;
468
+ }
469
+
440
470
  /** A right-aligned fact column in a picker. */
441
471
  export interface TspPickerColumn {
442
472
  id: string;
@@ -454,7 +484,7 @@ export interface TspPickerScope {
454
484
  id: string;
455
485
  label: TspText;
456
486
  icon?: string;
457
- mark?: { text: string; seed?: string };
487
+ mark?: TspPickerMark;
458
488
  count?: number;
459
489
  /** Group heading this scope sits under (consecutive scopes with the same group share a head). */
460
490
  group?: string;
@@ -803,6 +833,7 @@ export interface TspPropsByKind {
803
833
  ansi: TspAnsiProps;
804
834
  math: TspMathProps;
805
835
  image: TspImageProps;
836
+ media: TspMediaProps;
806
837
  kv: TspKvProps;
807
838
  table: TspTableProps;
808
839
  tree: TspTreeProps;