@oh-my-pi/pi-wire 16.2.13 → 16.3.2

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,16 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [16.3.0] - 2026-07-02
6
+
7
+ ### Breaking Changes
8
+
9
+ - Upgraded the collaboration protocol to version 3. Guests using version 2 will now be rejected during the handshake with a protocol-mismatch error.
10
+
11
+ ### Added
12
+
13
+ - Added support for interactive UI request and response frames, enabling browser guests to respond to prompts initiated by the host.
14
+
5
15
  ## [16.1.8] - 2026-06-20
6
16
 
7
17
  ### Breaking Changes
@@ -284,6 +284,28 @@ export interface SubagentLifecyclePayload {
284
284
  parentToolCallId?: string;
285
285
  index: number;
286
286
  }
287
+ export type CollabUiSelectItem = string | {
288
+ label: string;
289
+ description?: string;
290
+ };
291
+ export type CollabUiResponseValue = string | undefined;
292
+ export type CollabUiRequestDraft = {
293
+ kind: "select";
294
+ title: string;
295
+ options: CollabUiSelectItem[];
296
+ initialIndex?: number;
297
+ selectionMarker?: "radio" | "checkbox";
298
+ checkedIndices?: number[];
299
+ markableCount?: number;
300
+ helpText?: string;
301
+ } | {
302
+ kind: "editor";
303
+ title: string;
304
+ prefill?: string;
305
+ };
306
+ export type CollabUiRequest = CollabUiRequestDraft & {
307
+ reqId: number;
308
+ };
287
309
  export type GuestFrame = {
288
310
  t: "hello";
289
311
  proto: number;
@@ -298,6 +320,10 @@ export type GuestFrame = {
298
320
  t: "prompt";
299
321
  text: string;
300
322
  images?: ImageContent[];
323
+ } | {
324
+ t: "ui-response";
325
+ reqId: number;
326
+ value?: CollabUiResponseValue;
301
327
  } | {
302
328
  t: "abort";
303
329
  } | {
@@ -357,6 +383,12 @@ export type HostFrame = {
357
383
  } | {
358
384
  t: "agents";
359
385
  agents: AgentSnapshot[];
386
+ } | {
387
+ t: "ui-request";
388
+ request: CollabUiRequest;
389
+ } | {
390
+ t: "ui-request-end";
391
+ reqId: number;
360
392
  }
361
393
  /** Targeted reply to fetch-transcript; `text` is decoded JSONL from `fromByte`, `newSize` the next offset base. */
362
394
  | {
@@ -381,8 +413,12 @@ export type WireFrame = GuestFrame | HostFrame;
381
413
  * transcript entries follow in `snapshot-chunk` frames, so multi-MB
382
414
  * sessions are not gated on a single welcome frame fitting under the
383
415
  * guest's first-welcome timeout.
416
+ * - `3`: host asks guests through `ui-request`/`ui-request-end` host frames
417
+ * answered by the `ui-response` guest frame. Guests that predate the
418
+ * grammar would silently drop `ui-request` (asks hang forever on the
419
+ * host), so they must be rejected at hello.
384
420
  */
385
- export declare const COLLAB_PROTO = 2;
421
+ export declare const COLLAB_PROTO = 3;
386
422
  /** Parameter key used for intent tracing (e.g. prompt explanation/reasoning) */
387
423
  export declare const INTENT_FIELD = "i";
388
424
  /** Plaintext envelope prefix: `[4B uint32 BE peerId][sealed payload]`. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-wire",
4
- "version": "16.2.13",
4
+ "version": "16.3.2",
5
5
  "description": "Shared wire protocol types for Oh My Pi packages",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
package/src/index.ts CHANGED
@@ -298,6 +298,29 @@ export interface SubagentLifecyclePayload {
298
298
  // Frames (JSON inside the AES-GCM seal)
299
299
  // ═══════════════════════════════════════════════════════════════════════════
300
300
 
301
+ export type CollabUiSelectItem = string | { label: string; description?: string };
302
+
303
+ export type CollabUiResponseValue = string | undefined;
304
+
305
+ export type CollabUiRequestDraft =
306
+ | {
307
+ kind: "select";
308
+ title: string;
309
+ options: CollabUiSelectItem[];
310
+ initialIndex?: number;
311
+ selectionMarker?: "radio" | "checkbox";
312
+ checkedIndices?: number[];
313
+ markableCount?: number;
314
+ helpText?: string;
315
+ }
316
+ | {
317
+ kind: "editor";
318
+ title: string;
319
+ prefill?: string;
320
+ };
321
+
322
+ export type CollabUiRequest = CollabUiRequestDraft & { reqId: number };
323
+
301
324
  export type GuestFrame =
302
325
  | {
303
326
  t: "hello";
@@ -311,6 +334,7 @@ export type GuestFrame =
311
334
  writeToken?: string;
312
335
  }
313
336
  | { t: "prompt"; text: string; images?: ImageContent[] }
337
+ | { t: "ui-response"; reqId: number; value?: CollabUiResponseValue }
314
338
  | { t: "abort" }
315
339
  | { t: "agent-cmd"; cmd: "chat" | "kill" | "revive"; agentId: string; text?: string }
316
340
  | { t: "fetch-transcript"; reqId: number; agentId: string; fromByte: number };
@@ -348,6 +372,8 @@ export type HostFrame =
348
372
  /** Mirrored EventBus traffic (task subagent lifecycle/progress channels only). */
349
373
  | { t: "bus"; channel: BusChannel; data: unknown }
350
374
  | { t: "agents"; agents: AgentSnapshot[] }
375
+ | { t: "ui-request"; request: CollabUiRequest }
376
+ | { t: "ui-request-end"; reqId: number }
351
377
  /** Targeted reply to fetch-transcript; `text` is decoded JSONL from `fromByte`, `newSize` the next offset base. */
352
378
  | { t: "transcript"; reqId: number; text: string; newSize: number; error?: string }
353
379
  | { t: "bye"; reason: string }
@@ -363,8 +389,12 @@ export type WireFrame = GuestFrame | HostFrame;
363
389
  * transcript entries follow in `snapshot-chunk` frames, so multi-MB
364
390
  * sessions are not gated on a single welcome frame fitting under the
365
391
  * guest's first-welcome timeout.
392
+ * - `3`: host asks guests through `ui-request`/`ui-request-end` host frames
393
+ * answered by the `ui-response` guest frame. Guests that predate the
394
+ * grammar would silently drop `ui-request` (asks hang forever on the
395
+ * host), so they must be rejected at hello.
366
396
  */
367
- export const COLLAB_PROTO = 2;
397
+ export const COLLAB_PROTO = 3;
368
398
 
369
399
  /** Parameter key used for intent tracing (e.g. prompt explanation/reasoning) */
370
400
  export const INTENT_FIELD = "i";