@av-pi-studio/protocol 0.0.113 → 0.0.115

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/dist/messages.js CHANGED
@@ -241,6 +241,14 @@ export const agentStreamEventSchema = z.discriminatedUnion("kind", [
241
241
  callId: z.string().optional(),
242
242
  tool: toolCallDetailSchema,
243
243
  status: z.string().optional(),
244
+ /**
245
+ * Ephemeral in-flight output snapshot (Pi `tool_execution_update`). Producer contract: broadcast
246
+ * with no `seq`, never appended to the timeline, never replayed from history, and never sent
247
+ * after the call's terminal event. Consumer contract: upsert by `callId` and let the snapshot
248
+ * supersede earlier output — never accumulate. Describes the delivery, not the tool call, so a
249
+ * client must not store it on its row model.
250
+ */
251
+ partial: z.boolean().optional(),
244
252
  }),
245
253
  z.object({ kind: z.literal("turn_started"), turnId: z.string().optional() }),
246
254
  z.object({ kind: z.literal("turn_completed"), turnId: z.string().optional() }),
@@ -1422,6 +1430,79 @@ export const agentUiListResponseSchema = z
1422
1430
  })
1423
1431
  .passthrough();
1424
1432
  // ===========================================================================
1433
+ // Agent todos (swe/features/agent-todos.md § Wire family) — sprint-079
1434
+ // ===========================================================================
1435
+ /** `deleted` is never sent: the daemon drops the extension's tombstones. */
1436
+ export const agentTodoStatusSchema = z.enum(["pending", "in_progress", "completed"]);
1437
+ /**
1438
+ * Hard limits the **daemon** applies before sending (truncating over-long text with `…`, never
1439
+ * rejecting). The schemas below deliberately do not enforce them: a newer daemon may raise a cap
1440
+ * and an older client must still parse the result. Clients read `AGENT_TODOS_MAX_TASKS` for the
1441
+ * "showing the first N" hint.
1442
+ */
1443
+ export const AGENT_TODOS_MAX_TASKS = 200;
1444
+ export const AGENT_TODO_MAX_SUBJECT_CHARS = 500;
1445
+ export const AGENT_TODO_MAX_ACTIVE_FORM_CHARS = 500;
1446
+ export const AGENT_TODO_MAX_OWNER_CHARS = 100;
1447
+ export const AGENT_TODO_MAX_DESCRIPTION_CHARS = 4000;
1448
+ export const AGENT_TODO_MAX_BLOCKED_BY = 50;
1449
+ export const agentTodoSchema = z
1450
+ .object({
1451
+ /** Safe integer, unique within a snapshot (not enforced: a duplicate renders, never rejects). */
1452
+ id: z.number().int(),
1453
+ subject: z.string(),
1454
+ status: agentTodoStatusSchema,
1455
+ activeForm: z.string().optional(),
1456
+ description: z.string().optional(),
1457
+ owner: z.string().optional(),
1458
+ /** Ids this task waits on; may name an id absent from the snapshot. */
1459
+ blockedBy: z.array(z.number().int()).optional(),
1460
+ })
1461
+ .passthrough();
1462
+ /**
1463
+ * One agent's whole todo list, last-value-wins. `seq` is strictly increasing per agent within one
1464
+ * daemon process lifetime and restarts at 1 after a daemon restart, so a client resets its
1465
+ * per-agent seq on reconnect and refetches. Empty `tasks` means "no list" (panel hidden).
1466
+ */
1467
+ export const agentTodosSnapshotSchema = z
1468
+ .object({
1469
+ agentId: z.string(),
1470
+ seq: z.number(),
1471
+ tasks: z.array(agentTodoSchema),
1472
+ /** True when the task cap dropped tasks. */
1473
+ truncated: z.boolean().optional(),
1474
+ })
1475
+ .passthrough();
1476
+ /** Works for live agents and process-less records. */
1477
+ export const agentTodosListRequestSchema = z
1478
+ .object({
1479
+ type: z.literal("agent_todos_list_request"),
1480
+ requestId: z.string(),
1481
+ agentId: z.string(),
1482
+ })
1483
+ .passthrough();
1484
+ /**
1485
+ * Success carries `snapshot` (and no `ok`); a refusal carries `ok: false` and an open-string
1486
+ * `error` (`not_found` documented, not enumerated). A failure to read the session never reaches
1487
+ * here as an error: the daemon answers an empty snapshot instead.
1488
+ */
1489
+ export const agentTodosListResponseSchema = z
1490
+ .object({
1491
+ type: z.literal("agent_todos_list_response"),
1492
+ requestId: z.string(),
1493
+ snapshot: agentTodosSnapshotSchema.optional(),
1494
+ ok: z.boolean().optional(),
1495
+ error: z.string().optional(),
1496
+ })
1497
+ .passthrough();
1498
+ /** Broadcast to every active session, no subscribe RPC (same shape as `skills_changed`). */
1499
+ export const agentTodosUpdateSchema = z
1500
+ .object({
1501
+ type: z.literal("agent_todos_update"),
1502
+ snapshot: agentTodosSnapshotSchema,
1503
+ })
1504
+ .passthrough();
1505
+ // ===========================================================================
1425
1506
  // RPC error
1426
1507
  // ===========================================================================
1427
1508
  export const rpcErrorSchema = z.object({
@@ -1528,6 +1609,9 @@ export const sessionMessageSchema = z.discriminatedUnion("type", [
1528
1609
  agentUiRespondResponseSchema,
1529
1610
  agentUiListRequestSchema,
1530
1611
  agentUiListResponseSchema,
1612
+ agentTodosListRequestSchema,
1613
+ agentTodosListResponseSchema,
1614
+ agentTodosUpdateSchema,
1531
1615
  rpcErrorSchema,
1532
1616
  ]);
1533
1617
  /**
@@ -24,6 +24,7 @@ export declare const agentCapabilityFlagsSchema: z.ZodObject<{
24
24
  supportsRewindBoth: z.ZodOptional<z.ZodBoolean>;
25
25
  supportsSteering: z.ZodOptional<z.ZodBoolean>;
26
26
  supportsExtensionUi: z.ZodOptional<z.ZodBoolean>;
27
+ supportsTodos: z.ZodOptional<z.ZodBoolean>;
27
28
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
28
29
  supportsStreaming: z.ZodBoolean;
29
30
  supportsSessionPersistence: z.ZodBoolean;
@@ -36,6 +37,7 @@ export declare const agentCapabilityFlagsSchema: z.ZodObject<{
36
37
  supportsRewindBoth: z.ZodOptional<z.ZodBoolean>;
37
38
  supportsSteering: z.ZodOptional<z.ZodBoolean>;
38
39
  supportsExtensionUi: z.ZodOptional<z.ZodBoolean>;
40
+ supportsTodos: z.ZodOptional<z.ZodBoolean>;
39
41
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
40
42
  supportsStreaming: z.ZodBoolean;
41
43
  supportsSessionPersistence: z.ZodBoolean;
@@ -48,6 +50,7 @@ export declare const agentCapabilityFlagsSchema: z.ZodObject<{
48
50
  supportsRewindBoth: z.ZodOptional<z.ZodBoolean>;
49
51
  supportsSteering: z.ZodOptional<z.ZodBoolean>;
50
52
  supportsExtensionUi: z.ZodOptional<z.ZodBoolean>;
53
+ supportsTodos: z.ZodOptional<z.ZodBoolean>;
51
54
  }, z.ZodTypeAny, "passthrough">>;
52
55
  export type AgentCapabilityFlags = z.infer<typeof agentCapabilityFlagsSchema>;
53
56
  /** UI metadata for a provider mode (plan/default/full-access/...). */
@@ -108,6 +111,7 @@ export declare const providerDefinitionSchema: z.ZodObject<{
108
111
  supportsRewindBoth: z.ZodOptional<z.ZodBoolean>;
109
112
  supportsSteering: z.ZodOptional<z.ZodBoolean>;
110
113
  supportsExtensionUi: z.ZodOptional<z.ZodBoolean>;
114
+ supportsTodos: z.ZodOptional<z.ZodBoolean>;
111
115
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
112
116
  supportsStreaming: z.ZodBoolean;
113
117
  supportsSessionPersistence: z.ZodBoolean;
@@ -120,6 +124,7 @@ export declare const providerDefinitionSchema: z.ZodObject<{
120
124
  supportsRewindBoth: z.ZodOptional<z.ZodBoolean>;
121
125
  supportsSteering: z.ZodOptional<z.ZodBoolean>;
122
126
  supportsExtensionUi: z.ZodOptional<z.ZodBoolean>;
127
+ supportsTodos: z.ZodOptional<z.ZodBoolean>;
123
128
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
124
129
  supportsStreaming: z.ZodBoolean;
125
130
  supportsSessionPersistence: z.ZodBoolean;
@@ -132,6 +137,7 @@ export declare const providerDefinitionSchema: z.ZodObject<{
132
137
  supportsRewindBoth: z.ZodOptional<z.ZodBoolean>;
133
138
  supportsSteering: z.ZodOptional<z.ZodBoolean>;
134
139
  supportsExtensionUi: z.ZodOptional<z.ZodBoolean>;
140
+ supportsTodos: z.ZodOptional<z.ZodBoolean>;
135
141
  }, z.ZodTypeAny, "passthrough">>;
136
142
  }, "strip", z.ZodTypeAny, {
137
143
  id: string;
@@ -157,6 +163,7 @@ export declare const providerDefinitionSchema: z.ZodObject<{
157
163
  supportsRewindBoth?: boolean | undefined;
158
164
  supportsSteering?: boolean | undefined;
159
165
  supportsExtensionUi?: boolean | undefined;
166
+ supportsTodos?: boolean | undefined;
160
167
  } & {
161
168
  [k: string]: unknown;
162
169
  };
@@ -184,6 +191,7 @@ export declare const providerDefinitionSchema: z.ZodObject<{
184
191
  supportsRewindBoth?: boolean | undefined;
185
192
  supportsSteering?: boolean | undefined;
186
193
  supportsExtensionUi?: boolean | undefined;
194
+ supportsTodos?: boolean | undefined;
187
195
  } & {
188
196
  [k: string]: unknown;
189
197
  };
@@ -30,6 +30,10 @@ export const agentCapabilityFlagsSchema = z
30
30
  // provider's `AgentSession` implements `onUiRequest`/`respondToUi` and dialogs/fire-and-forget
31
31
  // extension UI methods are forwarded to clients instead of being auto-cancelled/dropped.
32
32
  supportsExtensionUi: z.boolean().optional(),
33
+ // Agent todos capability (features/agent-todos.md) — additive, optional. When true, the
34
+ // provider's `AgentSession` implements `onTodos`/`readTodos` (and its client `readTodos`) and the
35
+ // daemon derives and broadcasts the agent's todo list.
36
+ supportsTodos: z.boolean().optional(),
33
37
  })
34
38
  .passthrough();
35
39
  /** UI metadata for a provider mode (plan/default/full-access/...). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@av-pi-studio/protocol",
3
- "version": "0.0.113",
3
+ "version": "0.0.115",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.map",
@@ -21,5 +21,10 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "zod": "^3.23.0"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/avatsaev/pi-studio.git",
28
+ "directory": "packages/protocol"
24
29
  }
25
30
  }