@maudecode/talaria-web-contracts 1.16.1 → 1.17.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.
Files changed (40) hide show
  1. package/dist/router.d.ts +634 -20
  2. package/dist/routes/automation.d.ts +147 -9
  3. package/dist/routes/automation.js +15 -8
  4. package/dist/routes/automation.js.map +1 -1
  5. package/dist/routes/chat.d.ts +51 -0
  6. package/dist/routes/git.d.ts +22 -1
  7. package/dist/routes/git.js +7 -3
  8. package/dist/routes/git.js.map +1 -1
  9. package/dist/routes/raw.js +2 -2
  10. package/dist/routes/raw.js.map +1 -1
  11. package/dist/routes/sessions.d.ts +315 -0
  12. package/dist/routes/sessions.js +10 -0
  13. package/dist/routes/sessions.js.map +1 -1
  14. package/dist/routes/settings.d.ts +101 -2
  15. package/dist/routes/settings.js +4 -4
  16. package/dist/routes/settings.js.map +1 -1
  17. package/dist/routes/tools.d.ts +73 -8
  18. package/dist/routes/tools.js +1 -1
  19. package/dist/routes/tools.js.map +1 -1
  20. package/dist/routes/workspaces.d.ts +14 -0
  21. package/dist/sidecar/methods.d.ts +120 -0
  22. package/dist/sidecar/namespaces.d.ts +204 -1
  23. package/dist/sidecar/namespaces.js +53 -7
  24. package/dist/sidecar/namespaces.js.map +1 -1
  25. package/dist/sidecar/version.d.ts +1 -1
  26. package/dist/sidecar/version.js +1 -1
  27. package/dist/sidecar/version.js.map +1 -1
  28. package/dist/sse.d.ts +42 -4
  29. package/dist/sse.js +12 -4
  30. package/dist/sse.js.map +1 -1
  31. package/dist/views.d.ts +618 -9
  32. package/dist/views.js +109 -18
  33. package/dist/views.js.map +1 -1
  34. package/fixtures/sidecar/commands.json +195 -92
  35. package/fixtures/sidecar/kanban.json +24 -8
  36. package/fixtures/sidecar/process.json +25 -0
  37. package/fixtures/sidecar/rpc.json +2 -0
  38. package/fixtures/sidecar/runtime.json +3 -3
  39. package/fixtures/sidecar/usage.json +38 -0
  40. package/package.json +1 -1
@@ -91,6 +91,20 @@ export declare const workspacesContract: {
91
91
  truncated: z.ZodOptional<z.ZodBoolean>;
92
92
  binary: z.ZodOptional<z.ZodBoolean>;
93
93
  mime: z.ZodOptional<z.ZodString>;
94
+ preview: z.ZodOptional<z.ZodEnum<{
95
+ text: "text";
96
+ image: "image";
97
+ audio: "audio";
98
+ video: "video";
99
+ pdf: "pdf";
100
+ markdown: "markdown";
101
+ csv: "csv";
102
+ html: "html";
103
+ binary: "binary";
104
+ }>>;
105
+ table: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
106
+ table_truncated: z.ZodOptional<z.ZodBoolean>;
107
+ preview_url: z.ZodOptional<z.ZodString>;
94
108
  }, z.core.$loose>, Record<never, never>, Record<never, never>>;
95
109
  save: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
96
110
  session_id: z.ZodString;
@@ -25,6 +25,8 @@ export declare const SIDECAR_METHODS: {
25
25
  effort: z.ZodOptional<z.ZodString>;
26
26
  }, z.core.$strip>>>;
27
27
  ephemeral_system_prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
28
+ persist_user_message: z.ZodOptional<z.ZodString>;
29
+ ephemeral: z.ZodOptional<z.ZodBoolean>;
28
30
  }, z.core.$strip>;
29
31
  readonly result: z.ZodObject<{
30
32
  status: z.ZodEnum<{
@@ -33,12 +35,15 @@ export declare const SIDECAR_METHODS: {
33
35
  completed: "completed";
34
36
  }>;
35
37
  messages: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
38
+ context_messages: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
39
+ post_compression_context_tokens_estimate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
36
40
  final_response: z.ZodString;
37
41
  error: z.ZodNullable<z.ZodString>;
38
42
  failed: z.ZodBoolean;
39
43
  partial: z.ZodBoolean;
40
44
  compression_exhausted: z.ZodBoolean;
41
45
  tool_limit_reached: z.ZodBoolean;
46
+ max_iterations_summary_request: z.ZodString;
42
47
  usage: z.ZodObject<{
43
48
  prompt_tokens: z.ZodNumber;
44
49
  completion_tokens: z.ZodNumber;
@@ -75,6 +80,15 @@ export declare const SIDECAR_METHODS: {
75
80
  data: z.ZodObject<{
76
81
  text: z.ZodString;
77
82
  }, z.core.$catchall<z.ZodUnknown>>;
83
+ }, z.core.$strip>, z.ZodObject<{
84
+ event: z.ZodLiteral<"usage">;
85
+ data: z.ZodObject<{
86
+ prompt_tokens: z.ZodNumber;
87
+ completion_tokens: z.ZodNumber;
88
+ cache_read_tokens: z.ZodNumber;
89
+ cache_write_tokens: z.ZodNumber;
90
+ estimated_cost_usd: z.ZodNullable<z.ZodNumber>;
91
+ }, z.core.$strip>;
78
92
  }, z.core.$strip>, z.ZodObject<{
79
93
  event: z.ZodLiteral<"tool">;
80
94
  data: z.ZodObject<{
@@ -226,6 +240,7 @@ export declare const SIDECAR_METHODS: {
226
240
  };
227
241
  readonly 'chat.commit_memory': {
228
242
  readonly params: z.ZodObject<{
243
+ profile_home: z.ZodString;
229
244
  session_id: z.ZodString;
230
245
  }, z.core.$strip>;
231
246
  readonly result: z.ZodObject<{
@@ -358,6 +373,7 @@ export declare const SIDECAR_METHODS: {
358
373
  provider: z.ZodString;
359
374
  base_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
360
375
  api_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
376
+ credential_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
361
377
  }, z.core.$strip>;
362
378
  readonly result: z.ZodObject<{
363
379
  snapshot: z.ZodNullable<z.ZodObject<{
@@ -369,6 +385,82 @@ export declare const SIDECAR_METHODS: {
369
385
  }, z.core.$catchall<z.ZodUnknown>>>;
370
386
  }, z.core.$strip>;
371
387
  };
388
+ readonly 'usage.pool': {
389
+ readonly params: z.ZodObject<{
390
+ profile_home: z.ZodString;
391
+ provider: z.ZodString;
392
+ api_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
393
+ }, z.core.$strip>;
394
+ readonly result: z.ZodObject<{
395
+ entries: z.ZodArray<z.ZodObject<{
396
+ credential_id: z.ZodString;
397
+ label: z.ZodString;
398
+ status: z.ZodEnum<{
399
+ available: "available";
400
+ exhausted: "exhausted";
401
+ dead: "dead";
402
+ }>;
403
+ unavailable_reason: z.ZodNullable<z.ZodString>;
404
+ retry_after: z.ZodNullable<z.ZodString>;
405
+ matches_api_key: z.ZodBoolean;
406
+ }, z.core.$strip>>;
407
+ }, z.core.$strip>;
408
+ };
409
+ readonly 'usage.pool_providers': {
410
+ readonly params: z.ZodObject<{
411
+ profile_home: z.ZodString;
412
+ }, z.core.$strip>;
413
+ readonly result: z.ZodObject<{
414
+ providers: z.ZodArray<z.ZodString>;
415
+ }, z.core.$strip>;
416
+ };
417
+ readonly 'usage.balance': {
418
+ readonly params: z.ZodObject<{
419
+ profile_home: z.ZodString;
420
+ provider: z.ZodEnum<{
421
+ openrouter: "openrouter";
422
+ deepseek: "deepseek";
423
+ "opencode-go": "opencode-go";
424
+ }>;
425
+ credential_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
426
+ api_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
427
+ }, z.core.$strip>;
428
+ readonly result: z.ZodObject<{
429
+ status: z.ZodEnum<{
430
+ ok: "ok";
431
+ unavailable: "unavailable";
432
+ no_key: "no_key";
433
+ http_error: "http_error";
434
+ }>;
435
+ http_status: z.ZodNullable<z.ZodNumber>;
436
+ quota: z.ZodNullable<z.ZodObject<{
437
+ limit_remaining: z.ZodNullable<z.ZodNumber>;
438
+ usage: z.ZodNullable<z.ZodNumber>;
439
+ limit: z.ZodNullable<z.ZodNumber>;
440
+ }, z.core.$strip>>;
441
+ label: z.ZodNullable<z.ZodString>;
442
+ is_available: z.ZodNullable<z.ZodBoolean>;
443
+ balances: z.ZodArray<z.ZodObject<{
444
+ currency: z.ZodEnum<{
445
+ CNY: "CNY";
446
+ USD: "USD";
447
+ }>;
448
+ total: z.ZodNumber;
449
+ granted: z.ZodNullable<z.ZodNumber>;
450
+ topped_up: z.ZodNullable<z.ZodNumber>;
451
+ }, z.core.$strip>>;
452
+ windows: z.ZodArray<z.ZodObject<{
453
+ key: z.ZodEnum<{
454
+ rolling: "rolling";
455
+ weekly: "weekly";
456
+ monthly: "monthly";
457
+ }>;
458
+ used_percent: z.ZodNumber;
459
+ reset_at: z.ZodString;
460
+ rate_limited: z.ZodBoolean;
461
+ }, z.core.$strip>>;
462
+ }, z.core.$strip>;
463
+ };
372
464
  readonly 'process.drain': {
373
465
  readonly params: z.ZodObject<{
374
466
  profile_home: z.ZodString;
@@ -384,6 +476,14 @@ export declare const SIDECAR_METHODS: {
384
476
  }, z.core.$catchall<z.ZodUnknown>>>;
385
477
  }, z.core.$strip>;
386
478
  };
479
+ readonly 'process.recover': {
480
+ readonly params: z.ZodObject<{
481
+ base_home: z.ZodString;
482
+ }, z.core.$strip>;
483
+ readonly result: z.ZodObject<{
484
+ homes: z.ZodNumber;
485
+ }, z.core.$strip>;
486
+ };
387
487
  readonly 'process.requeue': {
388
488
  readonly params: z.ZodObject<{
389
489
  events: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -400,6 +500,14 @@ export declare const SIDECAR_METHODS: {
400
500
  ok: z.ZodBoolean;
401
501
  }, z.core.$strip>;
402
502
  };
503
+ readonly 'process.consumed': {
504
+ readonly params: z.ZodObject<{
505
+ process_ids: z.ZodArray<z.ZodString>;
506
+ }, z.core.$strip>;
507
+ readonly result: z.ZodObject<{
508
+ consumed: z.ZodArray<z.ZodString>;
509
+ }, z.core.$strip>;
510
+ };
403
511
  readonly 'process.claim_delivery': {
404
512
  readonly params: z.ZodObject<{
405
513
  profile_home: z.ZodString;
@@ -1160,6 +1268,8 @@ export declare const SIDECAR_METHODS: {
1160
1268
  title: z.ZodString;
1161
1269
  status: z.ZodString;
1162
1270
  priority: z.ZodNumber;
1271
+ claim_live: z.ZodBoolean;
1272
+ has_completion_evidence: z.ZodBoolean;
1163
1273
  }, z.core.$catchall<z.ZodUnknown>>>;
1164
1274
  }, z.core.$strip>>;
1165
1275
  tenants: z.ZodArray<z.ZodString>;
@@ -1257,6 +1367,8 @@ export declare const SIDECAR_METHODS: {
1257
1367
  title: z.ZodString;
1258
1368
  status: z.ZodString;
1259
1369
  priority: z.ZodNumber;
1370
+ claim_live: z.ZodBoolean;
1371
+ has_completion_evidence: z.ZodBoolean;
1260
1372
  }, z.core.$catchall<z.ZodUnknown>>;
1261
1373
  comments: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1262
1374
  events: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1280,6 +1392,8 @@ export declare const SIDECAR_METHODS: {
1280
1392
  title: z.ZodString;
1281
1393
  status: z.ZodString;
1282
1394
  priority: z.ZodNumber;
1395
+ claim_live: z.ZodBoolean;
1396
+ has_completion_evidence: z.ZodBoolean;
1283
1397
  }, z.core.$catchall<z.ZodUnknown>>;
1284
1398
  read_only: z.ZodBoolean;
1285
1399
  }, z.core.$strip>;
@@ -1297,6 +1411,8 @@ export declare const SIDECAR_METHODS: {
1297
1411
  title: z.ZodString;
1298
1412
  status: z.ZodString;
1299
1413
  priority: z.ZodNumber;
1414
+ claim_live: z.ZodBoolean;
1415
+ has_completion_evidence: z.ZodBoolean;
1300
1416
  }, z.core.$catchall<z.ZodUnknown>>;
1301
1417
  read_only: z.ZodBoolean;
1302
1418
  }, z.core.$strip>;
@@ -1311,6 +1427,7 @@ export declare const SIDECAR_METHODS: {
1311
1427
  unblock: "unblock";
1312
1428
  }>;
1313
1429
  reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1430
+ confirm_running_exit: z.ZodOptional<z.ZodBoolean>;
1314
1431
  }, z.core.$strip>;
1315
1432
  readonly result: z.ZodObject<{
1316
1433
  task: z.ZodObject<{
@@ -1318,6 +1435,8 @@ export declare const SIDECAR_METHODS: {
1318
1435
  title: z.ZodString;
1319
1436
  status: z.ZodString;
1320
1437
  priority: z.ZodNumber;
1438
+ claim_live: z.ZodBoolean;
1439
+ has_completion_evidence: z.ZodBoolean;
1321
1440
  }, z.core.$catchall<z.ZodUnknown>>;
1322
1441
  read_only: z.ZodBoolean;
1323
1442
  }, z.core.$strip>;
@@ -1488,6 +1607,7 @@ export declare const SIDECAR_METHODS: {
1488
1607
  subcommands: z.ZodArray<z.ZodString>;
1489
1608
  cli_only: z.ZodBoolean;
1490
1609
  gateway_only: z.ZodBoolean;
1610
+ exec: z.ZodBoolean;
1491
1611
  }, z.core.$strip>>;
1492
1612
  }, z.core.$strip>;
1493
1613
  };
@@ -175,6 +175,7 @@ export declare const CommandSchema: z.ZodObject<{
175
175
  subcommands: z.ZodArray<z.ZodString>;
176
176
  cli_only: z.ZodBoolean;
177
177
  gateway_only: z.ZodBoolean;
178
+ exec: z.ZodBoolean;
178
179
  }, z.core.$strip>;
179
180
  /**
180
181
  * A model-provider plugin installed and enabled in the profile (TAL-288); bundled providers are built-ins. `setup` is the Agent's
@@ -208,6 +209,7 @@ export declare const COMMANDS_METHODS: {
208
209
  subcommands: z.ZodArray<z.ZodString>;
209
210
  cli_only: z.ZodBoolean;
210
211
  gateway_only: z.ZodBoolean;
212
+ exec: z.ZodBoolean;
211
213
  }, z.core.$strip>>;
212
214
  }, z.core.$strip>;
213
215
  };
@@ -273,11 +275,14 @@ export declare const COMMANDS_METHODS: {
273
275
  }, z.core.$strip>;
274
276
  };
275
277
  };
278
+ /** `claim_live`: a running task's worker still holds its claim. `has_completion_evidence`: the task stores a result, which the Agent requires to complete it (TAL-557). */
276
279
  export declare const KanbanTaskSchema: z.ZodObject<{
277
280
  id: z.ZodString;
278
281
  title: z.ZodString;
279
282
  status: z.ZodString;
280
283
  priority: z.ZodNumber;
284
+ claim_live: z.ZodBoolean;
285
+ has_completion_evidence: z.ZodBoolean;
281
286
  }, z.core.$catchall<z.ZodUnknown>>;
282
287
  export declare const KanbanBoardSchema: z.ZodUnion<readonly [z.ZodObject<{
283
288
  changed: z.ZodLiteral<false>;
@@ -292,6 +297,8 @@ export declare const KanbanBoardSchema: z.ZodUnion<readonly [z.ZodObject<{
292
297
  title: z.ZodString;
293
298
  status: z.ZodString;
294
299
  priority: z.ZodNumber;
300
+ claim_live: z.ZodBoolean;
301
+ has_completion_evidence: z.ZodBoolean;
295
302
  }, z.core.$catchall<z.ZodUnknown>>>;
296
303
  }, z.core.$strip>>;
297
304
  tenants: z.ZodArray<z.ZodString>;
@@ -349,6 +356,8 @@ export declare const KANBAN_METHODS: {
349
356
  title: z.ZodString;
350
357
  status: z.ZodString;
351
358
  priority: z.ZodNumber;
359
+ claim_live: z.ZodBoolean;
360
+ has_completion_evidence: z.ZodBoolean;
352
361
  }, z.core.$catchall<z.ZodUnknown>>>;
353
362
  }, z.core.$strip>>;
354
363
  tenants: z.ZodArray<z.ZodString>;
@@ -446,6 +455,8 @@ export declare const KANBAN_METHODS: {
446
455
  title: z.ZodString;
447
456
  status: z.ZodString;
448
457
  priority: z.ZodNumber;
458
+ claim_live: z.ZodBoolean;
459
+ has_completion_evidence: z.ZodBoolean;
449
460
  }, z.core.$catchall<z.ZodUnknown>>;
450
461
  comments: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
451
462
  events: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -469,6 +480,8 @@ export declare const KANBAN_METHODS: {
469
480
  title: z.ZodString;
470
481
  status: z.ZodString;
471
482
  priority: z.ZodNumber;
483
+ claim_live: z.ZodBoolean;
484
+ has_completion_evidence: z.ZodBoolean;
472
485
  }, z.core.$catchall<z.ZodUnknown>>;
473
486
  read_only: z.ZodBoolean;
474
487
  }, z.core.$strip>;
@@ -486,6 +499,8 @@ export declare const KANBAN_METHODS: {
486
499
  title: z.ZodString;
487
500
  status: z.ZodString;
488
501
  priority: z.ZodNumber;
502
+ claim_live: z.ZodBoolean;
503
+ has_completion_evidence: z.ZodBoolean;
489
504
  }, z.core.$catchall<z.ZodUnknown>>;
490
505
  read_only: z.ZodBoolean;
491
506
  }, z.core.$strip>;
@@ -500,6 +515,7 @@ export declare const KANBAN_METHODS: {
500
515
  unblock: "unblock";
501
516
  }>;
502
517
  reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
518
+ confirm_running_exit: z.ZodOptional<z.ZodBoolean>;
503
519
  }, z.core.$strip>;
504
520
  readonly result: z.ZodObject<{
505
521
  task: z.ZodObject<{
@@ -507,6 +523,8 @@ export declare const KANBAN_METHODS: {
507
523
  title: z.ZodString;
508
524
  status: z.ZodString;
509
525
  priority: z.ZodNumber;
526
+ claim_live: z.ZodBoolean;
527
+ has_completion_evidence: z.ZodBoolean;
510
528
  }, z.core.$catchall<z.ZodUnknown>>;
511
529
  read_only: z.ZodBoolean;
512
530
  }, z.core.$strip>;
@@ -1415,6 +1433,15 @@ export declare const PROCESS_METHODS: {
1415
1433
  }, z.core.$catchall<z.ZodUnknown>>>;
1416
1434
  }, z.core.$strip>;
1417
1435
  };
1436
+ /** TAL-533: re-adopt the base home's and every named profile's checkpointed background processes in a fresh sidecar. */
1437
+ readonly 'process.recover': {
1438
+ readonly params: z.ZodObject<{
1439
+ base_home: z.ZodString;
1440
+ }, z.core.$strip>;
1441
+ readonly result: z.ZodObject<{
1442
+ homes: z.ZodNumber;
1443
+ }, z.core.$strip>;
1444
+ };
1418
1445
  readonly 'process.requeue': {
1419
1446
  readonly params: z.ZodObject<{
1420
1447
  events: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1431,6 +1458,15 @@ export declare const PROCESS_METHODS: {
1431
1458
  ok: z.ZodBoolean;
1432
1459
  }, z.core.$strip>;
1433
1460
  };
1461
+ /** TAL-532: the subset the agent already holds from its own turn (consumed via wait/log, or poll-observed). */
1462
+ readonly 'process.consumed': {
1463
+ readonly params: z.ZodObject<{
1464
+ process_ids: z.ZodArray<z.ZodString>;
1465
+ }, z.core.$strip>;
1466
+ readonly result: z.ZodObject<{
1467
+ consumed: z.ZodArray<z.ZodString>;
1468
+ }, z.core.$strip>;
1469
+ };
1434
1470
  /** TAL-459: the Agent's durable delivery ledger. A null claim means another consumer delivered (or holds) it; "" means nothing durable to acknowledge. */
1435
1471
  readonly 'process.claim_delivery': {
1436
1472
  readonly params: z.ZodObject<{
@@ -1543,6 +1579,62 @@ export declare const AccountUsageSnapshotSchema: z.ZodObject<{
1543
1579
  windows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1544
1580
  details: z.ZodArray<z.ZodUnknown>;
1545
1581
  }, z.core.$catchall<z.ZodUnknown>>;
1582
+ /**
1583
+ * TAL-548: one credential-pool entry's local state (no network, no secrets); the server derives a quota source per entry.
1584
+ * `matches_api_key`: the entry's key is the server-resolved `api_key` passed to `usage.pool`.
1585
+ */
1586
+ export declare const PoolEntrySchema: z.ZodObject<{
1587
+ credential_id: z.ZodString;
1588
+ label: z.ZodString;
1589
+ status: z.ZodEnum<{
1590
+ available: "available";
1591
+ exhausted: "exhausted";
1592
+ dead: "dead";
1593
+ }>;
1594
+ unavailable_reason: z.ZodNullable<z.ZodString>;
1595
+ retry_after: z.ZodNullable<z.ZodString>;
1596
+ matches_api_key: z.ZodBoolean;
1597
+ }, z.core.$strip>;
1598
+ /**
1599
+ * TAL-548: one key-based balance read. The key is the pool entry's (`credential_id`) or the server-resolved `api_key`.
1600
+ * `ok` carries the provider's sanitised fields: OpenRouter `quota`/`label`, DeepSeek `balances`/`is_available`, OpenCode Go
1601
+ * `windows`; `http_error` carries the status code.
1602
+ */
1603
+ export declare const BalanceResultSchema: z.ZodObject<{
1604
+ status: z.ZodEnum<{
1605
+ ok: "ok";
1606
+ unavailable: "unavailable";
1607
+ no_key: "no_key";
1608
+ http_error: "http_error";
1609
+ }>;
1610
+ http_status: z.ZodNullable<z.ZodNumber>;
1611
+ quota: z.ZodNullable<z.ZodObject<{
1612
+ limit_remaining: z.ZodNullable<z.ZodNumber>;
1613
+ usage: z.ZodNullable<z.ZodNumber>;
1614
+ limit: z.ZodNullable<z.ZodNumber>;
1615
+ }, z.core.$strip>>;
1616
+ label: z.ZodNullable<z.ZodString>;
1617
+ is_available: z.ZodNullable<z.ZodBoolean>;
1618
+ balances: z.ZodArray<z.ZodObject<{
1619
+ currency: z.ZodEnum<{
1620
+ CNY: "CNY";
1621
+ USD: "USD";
1622
+ }>;
1623
+ total: z.ZodNumber;
1624
+ granted: z.ZodNullable<z.ZodNumber>;
1625
+ topped_up: z.ZodNullable<z.ZodNumber>;
1626
+ }, z.core.$strip>>;
1627
+ windows: z.ZodArray<z.ZodObject<{
1628
+ key: z.ZodEnum<{
1629
+ rolling: "rolling";
1630
+ weekly: "weekly";
1631
+ monthly: "monthly";
1632
+ }>;
1633
+ used_percent: z.ZodNumber;
1634
+ reset_at: z.ZodString;
1635
+ rate_limited: z.ZodBoolean;
1636
+ }, z.core.$strip>>;
1637
+ }, z.core.$strip>;
1546
1638
  export declare const USAGE_METHODS: {
1547
1639
  readonly 'usage.account': {
1548
1640
  readonly params: z.ZodObject<{
@@ -1550,6 +1642,7 @@ export declare const USAGE_METHODS: {
1550
1642
  provider: z.ZodString;
1551
1643
  base_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1552
1644
  api_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1645
+ credential_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1553
1646
  }, z.core.$strip>;
1554
1647
  readonly result: z.ZodObject<{
1555
1648
  snapshot: z.ZodNullable<z.ZodObject<{
@@ -1561,6 +1654,83 @@ export declare const USAGE_METHODS: {
1561
1654
  }, z.core.$catchall<z.ZodUnknown>>>;
1562
1655
  }, z.core.$strip>;
1563
1656
  };
1657
+ readonly 'usage.pool': {
1658
+ readonly params: z.ZodObject<{
1659
+ profile_home: z.ZodString;
1660
+ provider: z.ZodString;
1661
+ api_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1662
+ }, z.core.$strip>;
1663
+ readonly result: z.ZodObject<{
1664
+ entries: z.ZodArray<z.ZodObject<{
1665
+ credential_id: z.ZodString;
1666
+ label: z.ZodString;
1667
+ status: z.ZodEnum<{
1668
+ available: "available";
1669
+ exhausted: "exhausted";
1670
+ dead: "dead";
1671
+ }>;
1672
+ unavailable_reason: z.ZodNullable<z.ZodString>;
1673
+ retry_after: z.ZodNullable<z.ZodString>;
1674
+ matches_api_key: z.ZodBoolean;
1675
+ }, z.core.$strip>>;
1676
+ }, z.core.$strip>;
1677
+ };
1678
+ /** TAL-548: the providers whose persisted credential pool holds an account the user added, keyed or not. */
1679
+ readonly 'usage.pool_providers': {
1680
+ readonly params: z.ZodObject<{
1681
+ profile_home: z.ZodString;
1682
+ }, z.core.$strip>;
1683
+ readonly result: z.ZodObject<{
1684
+ providers: z.ZodArray<z.ZodString>;
1685
+ }, z.core.$strip>;
1686
+ };
1687
+ readonly 'usage.balance': {
1688
+ readonly params: z.ZodObject<{
1689
+ profile_home: z.ZodString;
1690
+ provider: z.ZodEnum<{
1691
+ openrouter: "openrouter";
1692
+ deepseek: "deepseek";
1693
+ "opencode-go": "opencode-go";
1694
+ }>;
1695
+ credential_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1696
+ api_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1697
+ }, z.core.$strip>;
1698
+ readonly result: z.ZodObject<{
1699
+ status: z.ZodEnum<{
1700
+ ok: "ok";
1701
+ unavailable: "unavailable";
1702
+ no_key: "no_key";
1703
+ http_error: "http_error";
1704
+ }>;
1705
+ http_status: z.ZodNullable<z.ZodNumber>;
1706
+ quota: z.ZodNullable<z.ZodObject<{
1707
+ limit_remaining: z.ZodNullable<z.ZodNumber>;
1708
+ usage: z.ZodNullable<z.ZodNumber>;
1709
+ limit: z.ZodNullable<z.ZodNumber>;
1710
+ }, z.core.$strip>>;
1711
+ label: z.ZodNullable<z.ZodString>;
1712
+ is_available: z.ZodNullable<z.ZodBoolean>;
1713
+ balances: z.ZodArray<z.ZodObject<{
1714
+ currency: z.ZodEnum<{
1715
+ CNY: "CNY";
1716
+ USD: "USD";
1717
+ }>;
1718
+ total: z.ZodNumber;
1719
+ granted: z.ZodNullable<z.ZodNumber>;
1720
+ topped_up: z.ZodNullable<z.ZodNumber>;
1721
+ }, z.core.$strip>>;
1722
+ windows: z.ZodArray<z.ZodObject<{
1723
+ key: z.ZodEnum<{
1724
+ rolling: "rolling";
1725
+ weekly: "weekly";
1726
+ monthly: "monthly";
1727
+ }>;
1728
+ used_percent: z.ZodNumber;
1729
+ reset_at: z.ZodString;
1730
+ rate_limited: z.ZodBoolean;
1731
+ }, z.core.$strip>>;
1732
+ }, z.core.$strip>;
1733
+ };
1564
1734
  };
1565
1735
  export declare const CONFIG_METHODS: {
1566
1736
  readonly 'config.get': {
@@ -1618,7 +1788,13 @@ export declare const ChatUsageSchema: z.ZodObject<{
1618
1788
  cache_write_tokens: z.ZodNumber;
1619
1789
  estimated_cost_usd: z.ZodNullable<z.ZodNumber>;
1620
1790
  }, z.core.$strip>;
1621
- /** `failed`, `partial`, and `compression_exhausted` are the Agent's own turn-result flags, forwarded as sent; `failed` also sets `status: 'error'`. */
1791
+ /**
1792
+ * `failed`, `partial`, and `compression_exhausted` are the Agent's own turn-result flags, forwarded as sent; `failed` also sets `status: 'error'`.
1793
+ * `max_iterations_summary_request` is the Agent's text for the user row it appends to ask for a summary once its tool budget runs out
1794
+ * (`tool_limit_reached`); the server drops that trailing row of an exhausted turn from the transcript and the model context (TAL-537).
1795
+ * A completed `compressed` turn also carries `context_messages`, its `messages` with tool output pruned and capped for the model (row for row),
1796
+ * and `post_compression_context_tokens_estimate`, the next request's estimated size (TAL-539); both are null otherwise.
1797
+ */
1622
1798
  export declare const ChatStartResultSchema: z.ZodObject<{
1623
1799
  status: z.ZodEnum<{
1624
1800
  error: "error";
@@ -1626,12 +1802,15 @@ export declare const ChatStartResultSchema: z.ZodObject<{
1626
1802
  completed: "completed";
1627
1803
  }>;
1628
1804
  messages: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1805
+ context_messages: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
1806
+ post_compression_context_tokens_estimate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1629
1807
  final_response: z.ZodString;
1630
1808
  error: z.ZodNullable<z.ZodString>;
1631
1809
  failed: z.ZodBoolean;
1632
1810
  partial: z.ZodBoolean;
1633
1811
  compression_exhausted: z.ZodBoolean;
1634
1812
  tool_limit_reached: z.ZodBoolean;
1813
+ max_iterations_summary_request: z.ZodString;
1635
1814
  usage: z.ZodObject<{
1636
1815
  prompt_tokens: z.ZodNumber;
1637
1816
  completion_tokens: z.ZodNumber;
@@ -1668,6 +1847,15 @@ export declare const ChatStreamSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1668
1847
  data: z.ZodObject<{
1669
1848
  text: z.ZodString;
1670
1849
  }, z.core.$catchall<z.ZodUnknown>>;
1850
+ }, z.core.$strip>, z.ZodObject<{
1851
+ event: z.ZodLiteral<"usage">;
1852
+ data: z.ZodObject<{
1853
+ prompt_tokens: z.ZodNumber;
1854
+ completion_tokens: z.ZodNumber;
1855
+ cache_read_tokens: z.ZodNumber;
1856
+ cache_write_tokens: z.ZodNumber;
1857
+ estimated_cost_usd: z.ZodNullable<z.ZodNumber>;
1858
+ }, z.core.$strip>;
1671
1859
  }, z.core.$strip>, z.ZodObject<{
1672
1860
  event: z.ZodLiteral<"tool">;
1673
1861
  data: z.ZodObject<{
@@ -1735,6 +1923,8 @@ export declare const CHAT_METHODS: {
1735
1923
  effort: z.ZodOptional<z.ZodString>;
1736
1924
  }, z.core.$strip>>>;
1737
1925
  ephemeral_system_prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1926
+ persist_user_message: z.ZodOptional<z.ZodString>;
1927
+ ephemeral: z.ZodOptional<z.ZodBoolean>;
1738
1928
  }, z.core.$strip>;
1739
1929
  readonly result: z.ZodObject<{
1740
1930
  status: z.ZodEnum<{
@@ -1743,12 +1933,15 @@ export declare const CHAT_METHODS: {
1743
1933
  completed: "completed";
1744
1934
  }>;
1745
1935
  messages: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1936
+ context_messages: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
1937
+ post_compression_context_tokens_estimate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1746
1938
  final_response: z.ZodString;
1747
1939
  error: z.ZodNullable<z.ZodString>;
1748
1940
  failed: z.ZodBoolean;
1749
1941
  partial: z.ZodBoolean;
1750
1942
  compression_exhausted: z.ZodBoolean;
1751
1943
  tool_limit_reached: z.ZodBoolean;
1944
+ max_iterations_summary_request: z.ZodString;
1752
1945
  usage: z.ZodObject<{
1753
1946
  prompt_tokens: z.ZodNumber;
1754
1947
  completion_tokens: z.ZodNumber;
@@ -1785,6 +1978,15 @@ export declare const CHAT_METHODS: {
1785
1978
  data: z.ZodObject<{
1786
1979
  text: z.ZodString;
1787
1980
  }, z.core.$catchall<z.ZodUnknown>>;
1981
+ }, z.core.$strip>, z.ZodObject<{
1982
+ event: z.ZodLiteral<"usage">;
1983
+ data: z.ZodObject<{
1984
+ prompt_tokens: z.ZodNumber;
1985
+ completion_tokens: z.ZodNumber;
1986
+ cache_read_tokens: z.ZodNumber;
1987
+ cache_write_tokens: z.ZodNumber;
1988
+ estimated_cost_usd: z.ZodNullable<z.ZodNumber>;
1989
+ }, z.core.$strip>;
1788
1990
  }, z.core.$strip>, z.ZodObject<{
1789
1991
  event: z.ZodLiteral<"tool">;
1790
1992
  data: z.ZodObject<{
@@ -1954,6 +2156,7 @@ export declare const CHAT_METHODS: {
1954
2156
  };
1955
2157
  readonly 'chat.commit_memory': {
1956
2158
  readonly params: z.ZodObject<{
2159
+ profile_home: z.ZodString;
1957
2160
  session_id: z.ZodString;
1958
2161
  }, z.core.$strip>;
1959
2162
  readonly result: z.ZodObject<{