@linxiraos/pi-wire 1.4.7 → 1.4.10
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 +8 -0
- package/dist/types/index.d.ts +13 -2
- package/dist/types/tsp.d.ts +36 -6
- package/package.json +1 -1
- package/src/index.ts +24 -3
- package/src/tsp.ts +36 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.4.10] - 2026-11-05
|
|
4
|
+
|
|
5
|
+
- Released as part of Zeta 1.4.10; no package-specific user-visible changes.
|
|
6
|
+
|
|
7
|
+
## [1.4.9] - 2026-11-03
|
|
8
|
+
|
|
9
|
+
- Synced with upstream OMP v18.16.0; no package-specific user-visible changes.
|
|
10
|
+
|
|
3
11
|
## [1.4.7] - 2026-10-30
|
|
4
12
|
|
|
5
13
|
- Regenerated RPC/SDK wire from the OMP v18.14.0 schema; no user-facing API changes.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -430,6 +430,19 @@ export declare const COLLAB_PROTO = 3;
|
|
|
430
430
|
export declare const INTENT_FIELD = "i";
|
|
431
431
|
/** Plaintext envelope prefix: `[4B uint32 BE peerId][sealed payload]`. */
|
|
432
432
|
export declare const ENVELOPE_HEADER_LENGTH = 4;
|
|
433
|
+
/**
|
|
434
|
+
* Prefix `sealed` with its envelope header. Host→relay: peerId 0 broadcasts to
|
|
435
|
+
* all guests, peerId N targets guest N. Guest→relay: always 0; the relay
|
|
436
|
+
* rewrites it to the sender's id.
|
|
437
|
+
*/
|
|
438
|
+
export declare function packEnvelope(peerId: number, sealed: Uint8Array): Uint8Array<ArrayBuffer>;
|
|
439
|
+
/** Split an envelope into its peerId and sealed payload; `null` when shorter than the header. */
|
|
440
|
+
export declare function unpackEnvelope(data: Uint8Array): {
|
|
441
|
+
peerId: number;
|
|
442
|
+
payload: Uint8Array;
|
|
443
|
+
} | null;
|
|
444
|
+
/** Rewrite the peerId in place without copying the payload. */
|
|
445
|
+
export declare function rewriteEnvelopePeer(data: Uint8Array, peerId: number): void;
|
|
433
446
|
export declare const ROOM_ID_BYTES = 16;
|
|
434
447
|
/** AES-256-GCM room key; the seal key for every collab frame. */
|
|
435
448
|
export declare const ROOM_KEY_BYTES = 32;
|
|
@@ -441,8 +454,6 @@ export declare const ROOM_KEY_BYTES = 32;
|
|
|
441
454
|
export declare const WRITE_TOKEN_BYTES = 16;
|
|
442
455
|
/** Default public relay; bare `<roomId>.<key>` links resolve against it. */
|
|
443
456
|
export declare const DEFAULT_RELAY_URL = "wss://my.omp.sh";
|
|
444
|
-
/** Default share viewer/upload base; `/share` links resolve against `<base>/<id>#<key>`. */
|
|
445
|
-
export declare const DEFAULT_SHARE_URL = "https://my.omp.sh/s";
|
|
446
457
|
export interface ParsedCollabLink {
|
|
447
458
|
/** wss://host[:port]/r/<roomId> — no query, no fragment. */
|
|
448
459
|
wsUrl: string;
|
package/dist/types/tsp.d.ts
CHANGED
|
@@ -11,11 +11,9 @@
|
|
|
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 the Tern
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* Unknown fields and verbs are ignored in both directions, so every addition
|
|
18
|
-
* here is optional.
|
|
14
|
+
* The normative spec is the Tern Surface Protocol; this file mirrors its
|
|
15
|
+
* vocabulary. Unknown fields and verbs are ignored in both directions, so
|
|
16
|
+
* every addition here is optional.
|
|
19
17
|
*/
|
|
20
18
|
/** Protocol version this build speaks. */
|
|
21
19
|
export declare const TSP_VERSION = 1;
|
|
@@ -28,7 +26,7 @@ export declare const TSP_DEFAULT_CREDITS = 2;
|
|
|
28
26
|
/** One-letter message verb. */
|
|
29
27
|
export type TspVerb = "q" | "o" | "f" | "b" | "x" | "r" | "e";
|
|
30
28
|
/** 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", "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"];
|
|
29
|
+
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", "button", "status", "seg", "overlay", "toast", "rows", "picker", "prefs", "tool", "checklist", "agent", "chart", "meter", "effort"];
|
|
32
30
|
export type TspKind = (typeof TSP_KINDS)[number];
|
|
33
31
|
/** Semantic colour of a node's chrome. */
|
|
34
32
|
export type TspTone = "neutral" | "accent" | "info" | "success" | "warning" | "error" | "pending" | "muted" | "user";
|
|
@@ -176,7 +174,15 @@ export interface TspCodeProps {
|
|
|
176
174
|
lang?: string;
|
|
177
175
|
/** The file the text comes from: the terminal picks the grammar from it (and heads a block outside a tool card with it). */
|
|
178
176
|
path?: string;
|
|
177
|
+
/** The first line's number; later lines count up from it. */
|
|
179
178
|
start?: number;
|
|
179
|
+
/**
|
|
180
|
+
* Each line's number (one per line of `text`, strictly ascending), for non-contiguous lines: replaces counting from
|
|
181
|
+
* `start`, and a `…` gap row is drawn before every line whose number is not the previous one's + 1. Marks' `line` and
|
|
182
|
+
* folds' `from`/`to` are in this numbering. Ignored (numbers count from `start`) when its length differs from the
|
|
183
|
+
* text's line count or it is not strictly ascending.
|
|
184
|
+
*/
|
|
185
|
+
nums?: readonly number[];
|
|
180
186
|
numbers?: boolean;
|
|
181
187
|
marks?: readonly {
|
|
182
188
|
line: number;
|
|
@@ -355,6 +361,29 @@ export interface TspTabsProps {
|
|
|
355
361
|
label: TspText;
|
|
356
362
|
}[];
|
|
357
363
|
active?: string;
|
|
364
|
+
/** `underline` (default): an accent underline under the active tab; `segmented`: a well with a raised thumb. */
|
|
365
|
+
variant?: "underline" | "segmented";
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* A push button. A click sends an `action` event with `actions.click` (else
|
|
369
|
+
* `click`); a disabled or busy button sends nothing. It never takes focus.
|
|
370
|
+
*/
|
|
371
|
+
export interface TspButtonProps {
|
|
372
|
+
/** Label; empty with an `icon` draws an icon-only button (give it a `title` or `aria`). */
|
|
373
|
+
text?: string;
|
|
374
|
+
/** Leading icon name. */
|
|
375
|
+
icon?: string;
|
|
376
|
+
/** Keycaps drawn after the label (the key names of `kbd`); display only. */
|
|
377
|
+
keys?: readonly string[];
|
|
378
|
+
variant?: "default" | "primary" | "quiet" | "danger";
|
|
379
|
+
/** `md` 28px (bars, heads, forms), `sm` 22px (inline, rows). */
|
|
380
|
+
size?: "sm" | "md";
|
|
381
|
+
/** A pressed toggle. */
|
|
382
|
+
on?: boolean;
|
|
383
|
+
/** Dimmed and inert; a string is the reason, shown as the tooltip. */
|
|
384
|
+
disabled?: boolean | string;
|
|
385
|
+
/** A spinner in the icon's place; inert. */
|
|
386
|
+
busy?: boolean;
|
|
358
387
|
}
|
|
359
388
|
export interface TspEditorDecoration {
|
|
360
389
|
from: number;
|
|
@@ -932,6 +961,7 @@ export interface TspPropsByKind {
|
|
|
932
961
|
tabs: TspTabsProps;
|
|
933
962
|
editor: TspEditorProps;
|
|
934
963
|
input: TspInputProps;
|
|
964
|
+
button: TspButtonProps;
|
|
935
965
|
status: TspStatusProps;
|
|
936
966
|
seg: TspSegProps;
|
|
937
967
|
overlay: TspOverlayProps;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -410,6 +410,30 @@ export const INTENT_FIELD = "i";
|
|
|
410
410
|
/** Plaintext envelope prefix: `[4B uint32 BE peerId][sealed payload]`. */
|
|
411
411
|
export const ENVELOPE_HEADER_LENGTH = 4;
|
|
412
412
|
|
|
413
|
+
/**
|
|
414
|
+
* Prefix `sealed` with its envelope header. Host→relay: peerId 0 broadcasts to
|
|
415
|
+
* all guests, peerId N targets guest N. Guest→relay: always 0; the relay
|
|
416
|
+
* rewrites it to the sender's id.
|
|
417
|
+
*/
|
|
418
|
+
export function packEnvelope(peerId: number, sealed: Uint8Array): Uint8Array<ArrayBuffer> {
|
|
419
|
+
const out = new Uint8Array(ENVELOPE_HEADER_LENGTH + sealed.byteLength);
|
|
420
|
+
new DataView(out.buffer).setUint32(0, peerId, false);
|
|
421
|
+
out.set(sealed, ENVELOPE_HEADER_LENGTH);
|
|
422
|
+
return out;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/** Split an envelope into its peerId and sealed payload; `null` when shorter than the header. */
|
|
426
|
+
export function unpackEnvelope(data: Uint8Array): { peerId: number; payload: Uint8Array } | null {
|
|
427
|
+
if (data.byteLength < ENVELOPE_HEADER_LENGTH) return null;
|
|
428
|
+
const peerId = new DataView(data.buffer, data.byteOffset, ENVELOPE_HEADER_LENGTH).getUint32(0, false);
|
|
429
|
+
return { peerId, payload: data.subarray(ENVELOPE_HEADER_LENGTH) };
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/** Rewrite the peerId in place without copying the payload. */
|
|
433
|
+
export function rewriteEnvelopePeer(data: Uint8Array, peerId: number): void {
|
|
434
|
+
new DataView(data.buffer, data.byteOffset, ENVELOPE_HEADER_LENGTH).setUint32(0, peerId, false);
|
|
435
|
+
}
|
|
436
|
+
|
|
413
437
|
export const ROOM_ID_BYTES = 16;
|
|
414
438
|
|
|
415
439
|
/** AES-256-GCM room key; the seal key for every collab frame. */
|
|
@@ -425,9 +449,6 @@ export const WRITE_TOKEN_BYTES = 16;
|
|
|
425
449
|
/** Default public relay; bare `<roomId>.<key>` links resolve against it. */
|
|
426
450
|
export const DEFAULT_RELAY_URL = "wss://my.omp.sh";
|
|
427
451
|
|
|
428
|
-
/** Default share viewer/upload base; `/share` links resolve against `<base>/<id>#<key>`. */
|
|
429
|
-
export const DEFAULT_SHARE_URL = "https://my.omp.sh/s";
|
|
430
|
-
|
|
431
452
|
export interface ParsedCollabLink {
|
|
432
453
|
/** wss://host[:port]/r/<roomId> — no query, no fragment. */
|
|
433
454
|
wsUrl: string;
|
package/src/tsp.ts
CHANGED
|
@@ -11,11 +11,9 @@
|
|
|
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 the Tern
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* Unknown fields and verbs are ignored in both directions, so every addition
|
|
18
|
-
* here is optional.
|
|
14
|
+
* The normative spec is the Tern Surface Protocol; this file mirrors its
|
|
15
|
+
* vocabulary. Unknown fields and verbs are ignored in both directions, so
|
|
16
|
+
* every addition here is optional.
|
|
19
17
|
*/
|
|
20
18
|
|
|
21
19
|
/** Protocol version this build speaks. */
|
|
@@ -67,6 +65,7 @@ export const TSP_KINDS = [
|
|
|
67
65
|
"tabs",
|
|
68
66
|
"editor",
|
|
69
67
|
"input",
|
|
68
|
+
"button",
|
|
70
69
|
"status",
|
|
71
70
|
"seg",
|
|
72
71
|
"overlay",
|
|
@@ -228,7 +227,15 @@ export interface TspCodeProps {
|
|
|
228
227
|
lang?: string;
|
|
229
228
|
/** The file the text comes from: the terminal picks the grammar from it (and heads a block outside a tool card with it). */
|
|
230
229
|
path?: string;
|
|
230
|
+
/** The first line's number; later lines count up from it. */
|
|
231
231
|
start?: number;
|
|
232
|
+
/**
|
|
233
|
+
* Each line's number (one per line of `text`, strictly ascending), for non-contiguous lines: replaces counting from
|
|
234
|
+
* `start`, and a `…` gap row is drawn before every line whose number is not the previous one's + 1. Marks' `line` and
|
|
235
|
+
* folds' `from`/`to` are in this numbering. Ignored (numbers count from `start`) when its length differs from the
|
|
236
|
+
* text's line count or it is not strictly ascending.
|
|
237
|
+
*/
|
|
238
|
+
nums?: readonly number[];
|
|
232
239
|
numbers?: boolean;
|
|
233
240
|
marks?: readonly { line: number; tone: TspTone }[];
|
|
234
241
|
wrap?: boolean;
|
|
@@ -383,6 +390,29 @@ export interface TspItemProps {
|
|
|
383
390
|
export interface TspTabsProps {
|
|
384
391
|
items: readonly { id: string; label: TspText }[];
|
|
385
392
|
active?: string;
|
|
393
|
+
/** `underline` (default): an accent underline under the active tab; `segmented`: a well with a raised thumb. */
|
|
394
|
+
variant?: "underline" | "segmented";
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* A push button. A click sends an `action` event with `actions.click` (else
|
|
398
|
+
* `click`); a disabled or busy button sends nothing. It never takes focus.
|
|
399
|
+
*/
|
|
400
|
+
export interface TspButtonProps {
|
|
401
|
+
/** Label; empty with an `icon` draws an icon-only button (give it a `title` or `aria`). */
|
|
402
|
+
text?: string;
|
|
403
|
+
/** Leading icon name. */
|
|
404
|
+
icon?: string;
|
|
405
|
+
/** Keycaps drawn after the label (the key names of `kbd`); display only. */
|
|
406
|
+
keys?: readonly string[];
|
|
407
|
+
variant?: "default" | "primary" | "quiet" | "danger";
|
|
408
|
+
/** `md` 28px (bars, heads, forms), `sm` 22px (inline, rows). */
|
|
409
|
+
size?: "sm" | "md";
|
|
410
|
+
/** A pressed toggle. */
|
|
411
|
+
on?: boolean;
|
|
412
|
+
/** Dimmed and inert; a string is the reason, shown as the tooltip. */
|
|
413
|
+
disabled?: boolean | string;
|
|
414
|
+
/** A spinner in the icon's place; inert. */
|
|
415
|
+
busy?: boolean;
|
|
386
416
|
}
|
|
387
417
|
export interface TspEditorDecoration {
|
|
388
418
|
from: number;
|
|
@@ -897,6 +927,7 @@ export interface TspPropsByKind {
|
|
|
897
927
|
tabs: TspTabsProps;
|
|
898
928
|
editor: TspEditorProps;
|
|
899
929
|
input: TspInputProps;
|
|
930
|
+
button: TspButtonProps;
|
|
900
931
|
status: TspStatusProps;
|
|
901
932
|
seg: TspSegProps;
|
|
902
933
|
overlay: TspOverlayProps;
|