@linxiraos/pi-wire 1.4.11 → 1.4.12

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,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.4.12] - 2026-11-08
4
+
5
+ - Synced with upstream OMP v18.18.0.
6
+ - Released as part of Zeta 1.4.12; no package-specific user-visible changes.
7
+
3
8
  ## [1.4.11] - 2026-11-06
4
9
 
5
10
  - Released as part of Zeta 1.4.11; no package-specific user-visible changes.
@@ -10,7 +15,7 @@
10
15
 
11
16
  ## [1.4.9] - 2026-11-03
12
17
 
13
- - Synced with upstream OMP v18.16.0; no package-specific user-visible changes.
18
+ - Synced with upstream OMP v18.18.0.
14
19
 
15
20
  ## [1.4.7] - 2026-10-30
16
21
 
@@ -25,7 +30,7 @@
25
30
 
26
31
  ## [1.4.5] - 2026-10-28
27
32
 
28
- - Synced with upstream OMP v18.13.2: RPC dictation state/transcript frames and the `cost_cap` event.
33
+ - Synced with upstream OMP v18.18.0.
29
34
 
30
35
  ## [1.4.4] - 2026-10-26
31
36
 
@@ -20,7 +20,7 @@ Forked application trees:
20
20
  | Path | Upstream | Snapshot | License | What Zeta changed |
21
21
  |---|---|---|---|---|
22
22
  | `packages/ main/ crates/ python/ lsp/ sdk/ types/ skills/` | oh-my-pi (OMP), https://github.com/can1357/oh-my-pi | integrated through tag `v18.15.0` (`document/upstream-sync.md`) | see upstream files | product name, paths, command names and env prefixes; branded assets; internal identifiers renamed to `__zeta*` |
23
- | `web-ui/` | OMP Web, https://github.com/17380936778/omp-web | frozen snapshot + manual cherry-picks (`document/upstream-sync.md`) | see upstream files | gateway transport, theme token bridge, page routing |
23
+ | `web-ui/` | OMP Web, https://github.com/17380936778/omp-web | frozen snapshot, **abandoned 2026-11-05** (`document/upstream-sync.md`) | see upstream files | third-party UI, not maintained by Zeta: frozen as received, no builds, no fixes; the product renderer is `web-app/` (`Differences from Upstream` in README) |
24
24
  | `web-app/` (`src/studio`, `src/vendor/*`) | OMP Studio 0.1.17, https://github.com/the-snowpear/omp-studio | `0.1.17`, ported into the product renderer | MIT | maintained by Zeta now: the host contract is reimplemented in `studio-host` (pair/CSRF/query/command/events), the renderer was rebranded (`zeta-studio` wire name, Zeta links/fixtures), and Zeta adds windowed transcripts, precompressed static serving, the plugin registry, and the usage dashboard |
25
25
  | `termide/` | TermIDE, https://github.com/termide/termide | tag `0.46.0` = `a027ca788cd4c9d24f060cdcd3195ca2e475617b` | MIT | deviations listed in `termide/VENDOR.md` (28 entries) |
26
26
  | `editor/npm/*` (`@linxiraos/editor*`) | TermIDE `panel-editor` | same tree as `termide/` | MIT | built as the editor-only bin `termide-editor` (`editor/npm/editor/VENDOR.md`) |
@@ -44,10 +44,9 @@ Brand and assets:
44
44
  Frozen counterpart constants (interoperability, not branding):
45
45
 
46
46
  * Stencil OIDC `client-id "omp"`, its issuer and scopes; `catalog.stencil.so`;
47
- `docs.stencil.so/tern/protocol/`; `my.omp.sh` as the collaboration relay
48
- constant; the `__omp_judgment_images` upload key. These are wire-compatible
49
- identifiers Zeta must keep, listed here so that a brand sweep does not break
50
- them.
47
+ `docs.stencil.so/tern/protocol/`; the `__omp_judgment_images` upload key.
48
+ These are wire-compatible identifiers Zeta must keep, listed here so that a
49
+ brand sweep does not break them.
51
50
 
52
51
  PYTHON DEPENDENCY DISTRIBUTION ROLE
53
52
  ===================================
@@ -1,476 +1,12 @@
1
1
  /**
2
- * Shared wire types for the zeta-c collab live-session protocol.
2
+ * Shared wire constants for Zeta packages.
3
3
  *
4
- * Dependency-free JSON shapes produced by `@linxiraos/zeta`
5
- * (`src/collab/protocol.ts` and friends). Browser and test clients import this
6
- * package instead of depending on the coding-agent runtime; conformance is
7
- * asserted type-only in `packages/coding-agent/test/collab/web-wire.types.ts`.
8
- *
9
- * Unknown entry/event variants arrive over the wire as plain JSON. The unions
10
- * below cover only the variants this client renders; consumers cast at the
11
- * JSON boundary and every `switch` keeps a tolerant `default:` branch.
12
- */
13
- export interface TextContent {
14
- type: "text";
15
- text: string;
16
- }
17
- export interface ImageContent {
18
- type: "image";
19
- /** Base64-encoded image data. */
20
- data: string;
21
- /** e.g. "image/png". */
22
- mimeType: string;
23
- }
24
- export interface ThinkingContent {
25
- type: "thinking";
26
- thinking: string;
27
- }
28
- export interface RedactedThinkingContent {
29
- type: "redactedThinking";
30
- data: string;
31
- }
32
- export interface ToolCallContent {
33
- type: "toolCall";
34
- id: string;
35
- name: string;
36
- arguments: Record<string, unknown>;
37
- intent?: string;
38
- }
39
- export type AssistantContent = TextContent | ThinkingContent | RedactedThinkingContent | ToolCallContent;
40
- export type StopReason = "stop" | "length" | "toolUse" | "error" | "aborted";
41
- export interface WireUsage {
42
- input: number;
43
- output: number;
44
- cacheRead: number;
45
- cacheWrite: number;
46
- totalTokens: number;
47
- cost: {
48
- total: number;
49
- };
50
- }
51
- export interface UserMessage {
52
- role: "user";
53
- content: string | (TextContent | ImageContent)[];
54
- /** True if the message was injected by the system (e.g. auto-continue). */
55
- synthetic?: boolean;
56
- /** Unix timestamp in milliseconds. */
57
- timestamp: number;
58
- }
59
- export interface DeveloperMessage {
60
- role: "developer";
61
- content: string | (TextContent | ImageContent)[];
62
- timestamp: number;
63
- }
64
- export interface AssistantMessage {
65
- role: "assistant";
66
- content: AssistantContent[];
67
- model: string;
68
- usage: WireUsage;
69
- stopReason: StopReason;
70
- errorMessage?: string;
71
- timestamp: number;
72
- }
73
- export interface ToolResultMessage {
74
- role: "toolResult";
75
- toolCallId: string;
76
- toolName: string;
77
- content: (TextContent | ImageContent)[];
78
- details?: unknown;
79
- isError: boolean;
80
- timestamp: number;
81
- }
82
- export type WireMessage = UserMessage | DeveloperMessage | AssistantMessage | ToolResultMessage;
83
- export interface SessionHeader {
84
- type: "session";
85
- id: string;
86
- title?: string;
87
- timestamp: string;
88
- cwd: string;
89
- }
90
- export interface EntryBase {
91
- id: string;
92
- parentId: string | null;
93
- timestamp: string;
94
- }
95
- export interface MessageEntry extends EntryBase {
96
- type: "message";
97
- message: WireMessage;
98
- }
99
- export interface CustomMessageEntry extends EntryBase {
100
- type: "custom_message";
101
- customType: string;
102
- content: string | (TextContent | ImageContent)[];
103
- details?: unknown;
104
- display: boolean;
105
- }
106
- export interface CompactionEntry extends EntryBase {
107
- type: "compaction";
108
- summary: string;
109
- shortSummary?: string;
110
- firstKeptEntryId: string;
111
- tokensBefore: number;
112
- }
113
- export interface BranchSummaryEntry extends EntryBase {
114
- type: "branch_summary";
115
- fromId: string;
116
- summary: string;
117
- }
118
- export interface ModelChangeEntry extends EntryBase {
119
- type: "model_change";
120
- /** Model in "provider/modelId" format. */
121
- model: string;
122
- role?: string;
123
- }
124
- export interface ThinkingLevelChangeEntry extends EntryBase {
125
- type: "thinking_level_change";
126
- thinkingLevel?: string | null;
127
- }
128
- export type SessionEntry = MessageEntry | CustomMessageEntry | CompactionEntry | BranchSummaryEntry | ModelChangeEntry | ThinkingLevelChangeEntry;
129
- /** customType of collab guest prompts injected on the host. */
130
- export declare const COLLAB_PROMPT_MESSAGE_TYPE = "collab-prompt";
131
- /** `details` shape of `custom_message` entries with `customType === "collab-prompt"`. */
132
- export interface CollabPromptDetails {
133
- from?: string;
134
- }
135
- export type AgentEvent = {
136
- type: "agent_start";
137
- } | {
138
- type: "agent_end";
139
- } | {
140
- type: "turn_start";
141
- } | {
142
- type: "turn_end";
143
- } | {
144
- type: "message_start";
145
- message: WireMessage;
146
- }
147
- /** Carries the FULL accumulating partial message — no delta tracking needed. */
148
- | {
149
- type: "message_update";
150
- message: WireMessage;
151
- } | {
152
- type: "message_end";
153
- message: WireMessage;
154
- } | {
155
- type: "tool_execution_start";
156
- toolCallId: string;
157
- toolName: string;
158
- args: unknown;
159
- intent?: string;
160
- } | {
161
- type: "tool_execution_update";
162
- toolCallId: string;
163
- toolName: string;
164
- args: unknown;
165
- partialResult: unknown;
166
- } | {
167
- type: "tool_execution_end";
168
- toolCallId: string;
169
- toolName: string;
170
- result: unknown;
171
- isError?: boolean;
172
- } | {
173
- type: "notice";
174
- level: "info" | "warning" | "error";
175
- message: string;
176
- source?: string;
177
- } | {
178
- type: "auto_compaction_start";
179
- reason: string;
180
- action: string;
181
- } | {
182
- type: "auto_compaction_end";
183
- aborted: boolean;
184
- willRetry: boolean;
185
- errorMessage?: string;
186
- skipped?: boolean;
187
- } | {
188
- type: "auto_retry_start";
189
- attempt: number;
190
- maxAttempts: number;
191
- delayMs: number;
192
- errorMessage: string;
193
- } | {
194
- type: "auto_retry_end";
195
- success: boolean;
196
- attempt: number;
197
- finalError?: string;
198
- } | {
199
- type: "thinking_level_changed";
200
- thinkingLevel?: string;
201
- };
202
- export interface WireModel {
203
- id: string;
204
- name: string;
205
- provider: string;
206
- contextWindow: number | null;
207
- }
208
- export interface ContextUsage {
209
- tokens: number | null;
210
- contextWindow: number | null;
211
- percent: number | null;
212
- }
213
- export interface Participant {
214
- name: string;
215
- role: "host" | "guest";
216
- /** True when the guest joined through a read-only (view) link. */
217
- readOnly?: boolean;
218
- }
219
- /** Debounced footer snapshot broadcast by the host. */
220
- export interface SessionState {
221
- isStreaming: boolean;
222
- queuedMessageCount: number;
223
- sessionName?: string;
224
- /** Host cwd — display only; the guest never chdirs. */
225
- cwd: string;
226
- model?: WireModel;
227
- thinkingLevel?: string;
228
- contextUsage?: ContextUsage;
229
- participants: Participant[];
230
- isAborting?: boolean;
231
- }
232
- export interface AgentSnapshot {
233
- id: string;
234
- displayName: string;
235
- kind: "main" | "sub";
236
- parentId?: string;
237
- status: "running" | "idle" | "parked" | "aborted";
238
- /** Whether the host has a transcript file for this agent (gates remote transcript fetch). */
239
- hasSessionFile: boolean;
240
- createdAt: number;
241
- lastActivity: number;
242
- }
243
- export interface AgentProgress {
244
- index: number;
245
- id: string;
246
- agent: string;
247
- status: "pending" | "running" | "completed" | "failed" | "aborted";
248
- task: string;
249
- description?: string;
250
- lastIntent?: string;
251
- currentTool?: string;
252
- currentToolArgs?: string;
253
- /** Argument key selected for the display preview, when known. */
254
- currentToolArgsKey?: string;
255
- /** Intent the model attached to the current call; undefined when that call carried none. */
256
- currentToolIntent?: string;
257
- currentToolStartMs?: number;
258
- recentTools: {
259
- tool: string;
260
- args: string;
261
- argsKey?: string;
262
- intent?: string;
263
- isError?: boolean;
264
- endMs: number;
265
- }[];
266
- recentOutput: string[];
267
- toolCount: number;
268
- requests: number;
269
- tokens: number;
270
- contextTokens?: number;
271
- contextWindow?: number;
272
- cost: number;
273
- durationMs: number;
274
- resolvedModel?: string;
275
- }
276
- export interface SubagentProgressPayload {
277
- index: number;
278
- agent: string;
279
- task: string;
280
- parentToolCallId?: string;
281
- assignment?: string;
282
- progress: AgentProgress;
283
- sessionFile?: string;
284
- }
285
- export interface SubagentLifecyclePayload {
286
- id: string;
287
- agent: string;
288
- description?: string;
289
- status: "started" | "completed" | "failed" | "aborted";
290
- sessionFile?: string;
291
- parentToolCallId?: string;
292
- index: number;
293
- }
294
- export type CollabUiSelectItem = string | {
295
- label: string;
296
- description?: string;
297
- };
298
- export type CollabUiResponseValue = string | undefined;
299
- export type CollabUiRequestDraft = {
300
- kind: "select";
301
- title: string;
302
- options: CollabUiSelectItem[];
303
- initialIndex?: number;
304
- selectionMarker?: "radio" | "checkbox";
305
- checkedIndices?: number[];
306
- markableCount?: number;
307
- helpText?: string;
308
- } | {
309
- kind: "editor";
310
- title: string;
311
- prefill?: string;
312
- };
313
- export type CollabUiRequest = CollabUiRequestDraft & {
314
- reqId: number;
315
- };
316
- export type GuestFrame = {
317
- t: "hello";
318
- proto: number;
319
- name: string;
320
- /**
321
- * base64url write token proving full-link possession; absent for
322
- * read-only (view) links. The host marks peers without a valid token
323
- * read-only and rejects their mutating frames.
324
- */
325
- writeToken?: string;
326
- } | {
327
- t: "prompt";
328
- text: string;
329
- images?: ImageContent[];
330
- } | {
331
- t: "ui-response";
332
- reqId: number;
333
- value?: CollabUiResponseValue;
334
- } | {
335
- t: "abort";
336
- } | {
337
- t: "agent-cmd";
338
- cmd: "chat" | "kill" | "revive";
339
- agentId: string;
340
- text?: string;
341
- } | {
342
- t: "fetch-transcript";
343
- reqId: number;
344
- agentId: string;
345
- fromByte: number;
346
- };
347
- /** EventBus channels mirrored to guests (task subagent traffic only). */
348
- export type BusChannel = "task:subagent:progress" | "task:subagent:lifecycle";
349
- export type HostFrame = {
350
- t: "welcome";
351
- proto: number;
352
- header: SessionHeader;
353
- state: SessionState;
354
- agents: AgentSnapshot[];
355
- /**
356
- * Total number of `SessionEntry` items the host will deliver in the
357
- * `snapshot-chunk` frames that follow. Guests stay in the loading
358
- * phase until they have accumulated all of them (or a chunk arrives
359
- * with `final: true`).
360
- */
361
- entryCount: number;
362
- /** True when this peer joined through a read-only (view) link. */
363
- readOnly?: boolean;
364
- }
365
- /**
366
- * Targeted snapshot fragment delivered after `welcome`. Hosts split the
367
- * transcript into chunks bounded by byte size so a multi-MB session is not
368
- * forced through one giant frame the relay may stall on. The last chunk
369
- * carries `final: true`; guests finalize the replica on that frame.
370
- */
371
- | {
372
- t: "snapshot-chunk";
373
- entries: SessionEntry[];
374
- final: boolean;
375
- } | {
376
- t: "entry";
377
- entry: SessionEntry;
378
- } | {
379
- t: "event";
380
- event: AgentEvent;
381
- } | {
382
- t: "state";
383
- state: SessionState;
384
- }
385
- /** Mirrored EventBus traffic (task subagent lifecycle/progress channels only). */
386
- | {
387
- t: "bus";
388
- channel: BusChannel;
389
- data: unknown;
390
- } | {
391
- t: "agents";
392
- agents: AgentSnapshot[];
393
- } | {
394
- t: "ui-request";
395
- request: CollabUiRequest;
396
- } | {
397
- t: "ui-request-end";
398
- reqId: number;
399
- }
400
- /** Targeted reply to fetch-transcript; `text` is decoded JSONL from `fromByte`, `newSize` the next offset base. */
401
- | {
402
- t: "transcript";
403
- reqId: number;
404
- text: string;
405
- newSize: number;
406
- error?: string;
407
- } | {
408
- t: "bye";
409
- reason: string;
410
- } | {
411
- t: "error";
412
- message: string;
413
- };
414
- export type WireFrame = GuestFrame | HostFrame;
415
- /**
416
- * Wire protocol version carried in `hello`; the host rejects mismatches.
417
- *
418
- * - `1` (legacy): `welcome` carried the full `entries` array inline.
419
- * - `2`: `welcome` carries only metadata (header/state/agents/entryCount);
420
- * transcript entries follow in `snapshot-chunk` frames, so multi-MB
421
- * sessions are not gated on a single welcome frame fitting under the
422
- * guest's first-welcome timeout.
423
- * - `3`: host asks guests through `ui-request`/`ui-request-end` host frames
424
- * answered by the `ui-response` guest frame. Guests that predate the
425
- * grammar would silently drop `ui-request` (asks hang forever on the
426
- * host), so they must be rejected at hello.
4
+ * This file carries only the cross-package values that do not belong to a
5
+ * feature-specific protocol; TSP and the stream wire live in their own modules.
427
6
  */
428
- export declare const COLLAB_PROTO = 3;
429
- /** Parameter key used for intent tracing (e.g. prompt explanation/reasoning) */
7
+ /** Parameter key used for intent tracing (e.g. prompt explanation/reasoning). */
430
8
  export declare const INTENT_FIELD = "i";
431
- /** Plaintext envelope prefix: `[4B uint32 BE peerId][sealed payload]`. */
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;
446
- export declare const ROOM_ID_BYTES = 16;
447
- /** AES-256-GCM room key; the seal key for every collab frame. */
448
- export declare const ROOM_KEY_BYTES = 32;
449
- /**
450
- * Random write token appended to the room key in full links
451
- * (`base64url(key ∥ token)`); view links carry the bare key. Possession
452
- * proves prompt/abort/agent-cmd capability to the host.
453
- */
454
- export declare const WRITE_TOKEN_BYTES = 16;
455
- /** Default public relay; bare `<roomId>.<key>` links resolve against it. */
456
- export declare const DEFAULT_RELAY_URL = "wss://my.omp.sh";
457
- export interface ParsedCollabLink {
458
- /** wss://host[:port]/r/<roomId> — no query, no fragment. */
459
- wsUrl: string;
460
- roomId: string;
461
- key: Uint8Array;
462
- /** Write token from a full link; absent for read-only (view) links. */
463
- writeToken?: Uint8Array;
464
- }
465
- /** Relay → host control message. */
466
- export type RelayControlToHost = {
467
- t: "peer-joined" | "peer-left";
468
- peer: number;
469
- };
470
- /** Relay → guest control message. */
471
- export type RelayControlToGuest = {
472
- t: "room-closed";
473
- };
474
- export type RelayControlMessage = RelayControlToHost | RelayControlToGuest;
9
+ export * from "./shell-trace.js";
10
+ export * from "./shell-viz.js";
475
11
  export * from "./stream.js";
476
12
  export * from "./tsp.js";