@av-pi-studio/protocol 0.0.113 → 0.0.114

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
@@ -1422,6 +1422,79 @@ export const agentUiListResponseSchema = z
1422
1422
  })
1423
1423
  .passthrough();
1424
1424
  // ===========================================================================
1425
+ // Agent todos (swe/features/agent-todos.md § Wire family) — sprint-079
1426
+ // ===========================================================================
1427
+ /** `deleted` is never sent: the daemon drops the extension's tombstones. */
1428
+ export const agentTodoStatusSchema = z.enum(["pending", "in_progress", "completed"]);
1429
+ /**
1430
+ * Hard limits the **daemon** applies before sending (truncating over-long text with `…`, never
1431
+ * rejecting). The schemas below deliberately do not enforce them: a newer daemon may raise a cap
1432
+ * and an older client must still parse the result. Clients read `AGENT_TODOS_MAX_TASKS` for the
1433
+ * "showing the first N" hint.
1434
+ */
1435
+ export const AGENT_TODOS_MAX_TASKS = 200;
1436
+ export const AGENT_TODO_MAX_SUBJECT_CHARS = 500;
1437
+ export const AGENT_TODO_MAX_ACTIVE_FORM_CHARS = 500;
1438
+ export const AGENT_TODO_MAX_OWNER_CHARS = 100;
1439
+ export const AGENT_TODO_MAX_DESCRIPTION_CHARS = 4000;
1440
+ export const AGENT_TODO_MAX_BLOCKED_BY = 50;
1441
+ export const agentTodoSchema = z
1442
+ .object({
1443
+ /** Safe integer, unique within a snapshot (not enforced: a duplicate renders, never rejects). */
1444
+ id: z.number().int(),
1445
+ subject: z.string(),
1446
+ status: agentTodoStatusSchema,
1447
+ activeForm: z.string().optional(),
1448
+ description: z.string().optional(),
1449
+ owner: z.string().optional(),
1450
+ /** Ids this task waits on; may name an id absent from the snapshot. */
1451
+ blockedBy: z.array(z.number().int()).optional(),
1452
+ })
1453
+ .passthrough();
1454
+ /**
1455
+ * One agent's whole todo list, last-value-wins. `seq` is strictly increasing per agent within one
1456
+ * daemon process lifetime and restarts at 1 after a daemon restart, so a client resets its
1457
+ * per-agent seq on reconnect and refetches. Empty `tasks` means "no list" (panel hidden).
1458
+ */
1459
+ export const agentTodosSnapshotSchema = z
1460
+ .object({
1461
+ agentId: z.string(),
1462
+ seq: z.number(),
1463
+ tasks: z.array(agentTodoSchema),
1464
+ /** True when the task cap dropped tasks. */
1465
+ truncated: z.boolean().optional(),
1466
+ })
1467
+ .passthrough();
1468
+ /** Works for live agents and process-less records. */
1469
+ export const agentTodosListRequestSchema = z
1470
+ .object({
1471
+ type: z.literal("agent_todos_list_request"),
1472
+ requestId: z.string(),
1473
+ agentId: z.string(),
1474
+ })
1475
+ .passthrough();
1476
+ /**
1477
+ * Success carries `snapshot` (and no `ok`); a refusal carries `ok: false` and an open-string
1478
+ * `error` (`not_found` documented, not enumerated). A failure to read the session never reaches
1479
+ * here as an error: the daemon answers an empty snapshot instead.
1480
+ */
1481
+ export const agentTodosListResponseSchema = z
1482
+ .object({
1483
+ type: z.literal("agent_todos_list_response"),
1484
+ requestId: z.string(),
1485
+ snapshot: agentTodosSnapshotSchema.optional(),
1486
+ ok: z.boolean().optional(),
1487
+ error: z.string().optional(),
1488
+ })
1489
+ .passthrough();
1490
+ /** Broadcast to every active session, no subscribe RPC (same shape as `skills_changed`). */
1491
+ export const agentTodosUpdateSchema = z
1492
+ .object({
1493
+ type: z.literal("agent_todos_update"),
1494
+ snapshot: agentTodosSnapshotSchema,
1495
+ })
1496
+ .passthrough();
1497
+ // ===========================================================================
1425
1498
  // RPC error
1426
1499
  // ===========================================================================
1427
1500
  export const rpcErrorSchema = z.object({
@@ -1528,6 +1601,9 @@ export const sessionMessageSchema = z.discriminatedUnion("type", [
1528
1601
  agentUiRespondResponseSchema,
1529
1602
  agentUiListRequestSchema,
1530
1603
  agentUiListResponseSchema,
1604
+ agentTodosListRequestSchema,
1605
+ agentTodosListResponseSchema,
1606
+ agentTodosUpdateSchema,
1531
1607
  rpcErrorSchema,
1532
1608
  ]);
1533
1609
  /**
@@ -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.114",
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
  }