@ai-matrx/desktop-protocol 0.18.0 → 0.20.0

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/client.js CHANGED
@@ -112,7 +112,7 @@ import { z as z2 } from "zod";
112
112
  import { z } from "zod";
113
113
  import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
114
114
  var PROTOCOL_MAJOR = 1;
115
- var PROTOCOL_MINOR = 17;
115
+ var PROTOCOL_MINOR = 20;
116
116
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
117
117
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
118
118
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -1272,178 +1272,262 @@ var ResourcesIncidentsResult = z19.strictObject({
1272
1272
  incidents: z19.array(ResourcesIncident).max(200)
1273
1273
  });
1274
1274
 
1275
- // src/schema/stack.ts
1275
+ // src/schema/diag.ts
1276
1276
  import { z as z20 } from "zod";
1277
- var StackServerName = z20.string().regex(/^[a-z0-9_-]{1,64}$/);
1278
- var StackTone = z20.enum(["good", "wait", "bad", "off"]);
1279
- var StackServer = z20.strictObject({
1277
+ var DiagProcess = z20.enum([
1278
+ "main",
1279
+ "renderer",
1280
+ "hosted_page",
1281
+ "core",
1282
+ "pty_host",
1283
+ "python_ml",
1284
+ "python_coding",
1285
+ "python_tools",
1286
+ "relay",
1287
+ "coding_sessions",
1288
+ "claude_accounts"
1289
+ ]);
1290
+ var DiagErrorKind = z20.enum([
1291
+ "uncaught_exception",
1292
+ "unhandled_rejection",
1293
+ "renderer_crash",
1294
+ "native_crash",
1295
+ "console_error",
1296
+ "load_failed",
1297
+ "op_failed",
1298
+ "child_exit",
1299
+ "banner",
1300
+ "logged_error"
1301
+ ]);
1302
+ var DiagErrorStatus = z20.enum(["waiting", "sent", "resolved"]);
1303
+ var DiagErrorEntry = z20.strictObject({
1304
+ /** sha256 prefix over process, kind, source, code and the normalized message. */
1305
+ signature: z20.string().regex(/^[0-9a-f]{32}$/),
1306
+ process: DiagProcess,
1307
+ kind: DiagErrorKind,
1308
+ /** Where: a cap.op, a log event, a screen or page name. */
1309
+ source: z20.string().min(1).max(128),
1310
+ /** An ErrorCode, an exit code or signal, an error class; null when there is none. */
1311
+ code: z20.string().max(64).nullable(),
1312
+ /** The first occurrence's message, personal data removed. */
1313
+ message: z20.string().max(500),
1314
+ count: nonNegInt,
1315
+ first_seen_ms: epochMs,
1316
+ last_seen_ms: epochMs,
1317
+ status: DiagErrorStatus,
1318
+ /** What the agent who resolved it wrote; null until resolved. */
1319
+ resolution_note: z20.string().max(500).nullable(),
1320
+ app_version: z20.string().max(64)
1321
+ });
1322
+ var DiagErrorsListParams = z20.strictObject({
1323
+ /** open = waiting or sent; all includes resolved. */
1324
+ status: z20.enum(["open", "all"]).default("open"),
1325
+ limit: z20.int().min(1).max(500).default(200)
1326
+ });
1327
+ var DiagErrorsListResult = z20.strictObject({
1328
+ /** Newest last_seen first. */
1329
+ entries: z20.array(DiagErrorEntry).max(500),
1330
+ total_signatures: nonNegInt,
1331
+ total_occurrences: nonNegInt,
1332
+ /** Signatures with occurrences not yet delivered. */
1333
+ waiting: nonNegInt,
1334
+ /** signed_out = kept until sign-in; ok = the last delivery worked; failing = the last delivery failed (kept, retried). */
1335
+ delivery: z20.enum(["signed_out", "ok", "failing"]),
1336
+ last_delivery_ms: epochMs.nullable()
1337
+ });
1338
+ var DiagErrorsReportParams = z20.strictObject({
1339
+ process: z20.enum(["renderer", "hosted_page"]),
1340
+ kind: z20.enum(["uncaught_exception", "unhandled_rejection", "console_error", "banner"]),
1341
+ /** The screen or page, e.g. "code.chats". */
1342
+ source: z20.string().min(1).max(128),
1343
+ message: z20.string().min(1).max(2e3),
1344
+ code: z20.string().max(64).optional(),
1345
+ stack: z20.string().max(8e3).optional()
1346
+ });
1347
+ var DiagErrorsReportResult = z20.strictObject({
1348
+ signature: z20.string().regex(/^[0-9a-f]{32}$/)
1349
+ });
1350
+ var DiagErrorsChangedEvent = z20.strictObject({
1351
+ total_signatures: nonNegInt,
1352
+ waiting: nonNegInt
1353
+ });
1354
+
1355
+ // src/schema/stack.ts
1356
+ import { z as z21 } from "zod";
1357
+ var StackServerName = z21.string().regex(/^[a-z0-9_-]{1,64}$/);
1358
+ var StackTone = z21.enum(["good", "wait", "bad", "off"]);
1359
+ var StackServer = z21.strictObject({
1280
1360
  name: StackServerName,
1281
1361
  /** One word: Healthy, Starting, Unhealthy, Restarting, Stopping, Waiting, Stopped, Crashed, Off. */
1282
- label: z20.string().max(32),
1362
+ label: z21.string().max(32),
1283
1363
  tone: StackTone,
1284
1364
  /** What is going on, in one or two plain sentences. */
1285
- sentence: z20.string().max(2e3),
1365
+ sentence: z21.string().max(2e3),
1286
1366
  /** The config's own description of the server. */
1287
- description: z20.string().max(512),
1367
+ description: z21.string().max(512),
1288
1368
  /** Where the server answers, when its description names an address. */
1289
- open_url: z20.string().max(2048).nullable(),
1290
- log_file: z20.string().max(4096),
1369
+ open_url: z21.string().max(2048).nullable(),
1370
+ log_file: z21.string().max(4096),
1291
1371
  /** When its log file was last written. */
1292
1372
  last_output_at_ms: epochMs.nullable(),
1293
1373
  started_at_ms: epochMs.nullable(),
1294
1374
  restarts: nonNegInt,
1295
- exit_code: z20.int().nullable(),
1296
- pid: z20.int().nullable()
1297
- });
1298
- var StackEvent = z20.strictObject({
1375
+ exit_code: z21.int().nullable(),
1376
+ pid: z21.int().nullable(),
1377
+ /** (1.18) CPU of the server's process and everything under it, in percent of one core; absent when it is not running. */
1378
+ cpu_percent: z21.number().min(0).optional(),
1379
+ /** (1.18) Memory of the same processes: the physical footprint (Activity Monitor's Memory) summed; absent when it is not running. */
1380
+ memory_bytes: nonNegInt.optional()
1381
+ });
1382
+ var StackEvent = z21.strictObject({
1299
1383
  at_ms: epochMs,
1300
1384
  /** A server name, or "stack" for the stack as a whole. */
1301
- server: z20.string().max(64),
1385
+ server: z21.string().max(64),
1302
1386
  /** started · stopped · healthy · unhealthy · crashed · exited · restarting · stopping · action · action-done · action-failed · setup · error */
1303
- kind: z20.string().max(32),
1304
- text: z20.string().max(4e3)
1387
+ kind: z21.string().max(32),
1388
+ text: z21.string().max(4e3)
1305
1389
  });
1306
- var StackStateParams = z20.strictObject({});
1307
- var StackStateResult = z20.strictObject({
1390
+ var StackStateParams = z21.strictObject({});
1391
+ var StackStateResult = z21.strictObject({
1308
1392
  /** The stack's config file, when found. */
1309
- config_path: z20.string().max(4096).nullable(),
1393
+ config_path: z21.string().max(4096).nullable(),
1310
1394
  /** Why the stack cannot be run from here (no config, no process-compose), else null. */
1311
- problem: z20.string().max(1e3).nullable(),
1312
- stack_up: z20.boolean(),
1395
+ problem: z21.string().max(1e3).nullable(),
1396
+ stack_up: z21.boolean(),
1313
1397
  stack_started_at_ms: epochMs.nullable(),
1314
- servers: z20.array(StackServer).max(64),
1398
+ servers: z21.array(StackServer).max(64),
1315
1399
  /** One line about the one-shot setup steps ("Docker Desktop: running."), or null. */
1316
- setup_note: z20.string().max(500).nullable(),
1400
+ setup_note: z21.string().max(500).nullable(),
1317
1401
  /** Start everything / Stop everything in flight. */
1318
- pending: z20.strictObject({ verb: z20.enum(["start", "stop"]), label: z20.string().max(64), since_ms: epochMs }).nullable(),
1402
+ pending: z21.strictObject({ verb: z21.enum(["start", "stop"]), label: z21.string().max(64), since_ms: epochMs }).nullable(),
1319
1403
  /** The newest entries last. */
1320
- events: z20.array(StackEvent).max(300)
1404
+ events: z21.array(StackEvent).max(300)
1321
1405
  });
1322
- var StackStartParams = z20.strictObject({});
1323
- var StackStopParams = z20.strictObject({});
1324
- var StackRunResult = z20.strictObject({ accepted: z20.boolean() });
1325
- var StackServerActionParams = z20.strictObject({
1406
+ var StackStartParams = z21.strictObject({});
1407
+ var StackStopParams = z21.strictObject({});
1408
+ var StackRunResult = z21.strictObject({ accepted: z21.boolean() });
1409
+ var StackServerActionParams = z21.strictObject({
1326
1410
  name: StackServerName,
1327
- verb: z20.enum(["start", "stop", "restart"])
1411
+ verb: z21.enum(["start", "stop", "restart"])
1328
1412
  });
1329
- var StackServerActionResult = z20.strictObject({ message: z20.string().max(1e3) });
1330
- var StackLogsParams = z20.strictObject({
1413
+ var StackServerActionResult = z21.strictObject({ message: z21.string().max(1e3) });
1414
+ var StackLogsParams = z21.strictObject({
1331
1415
  name: StackServerName,
1332
1416
  /** Without `offset`: the last this-many complete lines. With it: new lines after it, at most this many. */
1333
- lines: z20.int().min(1).max(2e5).default(2e3),
1417
+ lines: z21.int().min(1).max(2e5).default(2e3),
1334
1418
  /** Byte offset the last read ended at: answer only what was written after it (follow). */
1335
1419
  offset: nonNegInt.optional(),
1336
1420
  /** A "Clear" point: the lines written after this byte offset (no `offset`). */
1337
1421
  since: nonNegInt.optional(),
1338
1422
  /** With `offset`: wait up to this long for a new line when none is waiting (0 answers at once). */
1339
- wait_ms: z20.int().min(0).max(25e3).default(0)
1423
+ wait_ms: z21.int().min(0).max(25e3).default(0)
1340
1424
  });
1341
- var StackLogsResult = z20.strictObject({
1425
+ var StackLogsResult = z21.strictObject({
1342
1426
  /** Complete lines, colour codes removed. */
1343
- lines: z20.array(z20.string().max(65536)).max(2e5),
1427
+ lines: z21.array(z21.string().max(65536)).max(2e5),
1344
1428
  /** Where these lines end: pass it back as `offset` to follow. */
1345
1429
  offset: nonNegInt,
1346
1430
  /** False when `since` no longer exists (the log rotated): the lines are the plain tail instead. */
1347
- since_valid: z20.boolean(),
1431
+ since_valid: z21.boolean(),
1348
1432
  /** The log was rotated or truncated since `offset`: these lines start the file again. */
1349
- reset: z20.boolean(),
1350
- log_file: z20.string().max(4096)
1433
+ reset: z21.boolean(),
1434
+ log_file: z21.string().max(4096)
1351
1435
  });
1352
- var StackErrorsParams = z20.strictObject({
1353
- window_minutes: z20.int().min(1).max(1440).default(60)
1436
+ var StackErrorsParams = z21.strictObject({
1437
+ window_minutes: z21.int().min(1).max(1440).default(60)
1354
1438
  });
1355
- var StackErrorsResult = z20.strictObject({
1439
+ var StackErrorsResult = z21.strictObject({
1356
1440
  /** Per server: a heading line ("=== aidream — errors in the last 60 minutes (<file>) ===") and each error with the 10 lines after it. */
1357
- sections: z20.array(z20.strictObject({ name: StackServerName, heading: z20.string().max(4096), lines: z20.array(z20.string().max(65536)).max(5e3) })).max(64),
1358
- window_minutes: z20.int().min(1).max(1440)
1441
+ sections: z21.array(z21.strictObject({ name: StackServerName, heading: z21.string().max(4096), lines: z21.array(z21.string().max(65536)).max(5e3) })).max(64),
1442
+ window_minutes: z21.int().min(1).max(1440)
1359
1443
  });
1360
1444
 
1361
1445
  // src/schema/fs-watch.ts
1362
- import { z as z21 } from "zod";
1363
- var FsWatchId = z21.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
1364
- var FsWatchStartParams = z21.strictObject({
1446
+ import { z as z22 } from "zod";
1447
+ var FsWatchId = z22.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
1448
+ var FsWatchStartParams = z22.strictObject({
1365
1449
  path: AbsPath,
1366
- recursive: z21.boolean().default(true),
1450
+ recursive: z22.boolean().default(true),
1367
1451
  /** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
1368
- ignore: z21.array(z21.string().max(256)).max(64).default([])
1452
+ ignore: z22.array(z22.string().max(256)).max(64).default([])
1369
1453
  });
1370
- var FsWatchStartResult = z21.strictObject({
1454
+ var FsWatchStartResult = z22.strictObject({
1371
1455
  watch_id: FsWatchId,
1372
1456
  path: AbsPath,
1373
1457
  /** The watch ends by itself if nobody reads it for 30 minutes. */
1374
1458
  expires_at_ms: epochMs
1375
1459
  });
1376
- var FsWatchEventsParams = z21.strictObject({
1460
+ var FsWatchEventsParams = z22.strictObject({
1377
1461
  watch_id: FsWatchId,
1378
1462
  /** Wait up to this long for a first change when none is waiting (0 answers at once). */
1379
- wait_ms: z21.int().min(0).max(25e3).default(0)
1463
+ wait_ms: z22.int().min(0).max(25e3).default(0)
1380
1464
  });
1381
- var FsWatchEventsResult = z21.strictObject({
1465
+ var FsWatchEventsResult = z22.strictObject({
1382
1466
  /** What changed since the last read, oldest first; re-checked against the disk when read. */
1383
- changes: z21.array(FsChange).max(1e3),
1467
+ changes: z22.array(FsChange).max(1e3),
1384
1468
  /** Changes were dropped (more than 1000 waited): list the folder again. */
1385
- overflow: z21.boolean(),
1469
+ overflow: z22.boolean(),
1386
1470
  expires_at_ms: epochMs
1387
1471
  });
1388
- var FsWatchStopParams = z21.strictObject({ watch_id: FsWatchId });
1389
- var FsWatchStopResult = z21.strictObject({ watch_id: FsWatchId });
1472
+ var FsWatchStopParams = z22.strictObject({ watch_id: FsWatchId });
1473
+ var FsWatchStopResult = z22.strictObject({ watch_id: FsWatchId });
1390
1474
 
1391
1475
  // src/schema/exec-job.ts
1392
- import { z as z22 } from "zod";
1393
- var ExecJobId = z22.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
1394
- var ExecJobStartParams = z22.strictObject({
1395
- command: z22.string().min(1).max(131072),
1476
+ import { z as z23 } from "zod";
1477
+ var ExecJobId = z23.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
1478
+ var ExecJobStartParams = z23.strictObject({
1479
+ command: z23.string().min(1).max(131072),
1396
1480
  /** The folder it runs in; the home folder when absent. */
1397
1481
  cwd: AbsPath.optional(),
1398
- env: z22.record(z22.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z22.string().max(32768)).optional()
1482
+ env: z23.record(z23.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z23.string().max(32768)).optional()
1399
1483
  });
1400
- var ExecJobStartResult = z22.strictObject({ job_id: ExecJobId, pid: z22.int().min(1), cwd: AbsPath });
1401
- var ExecJobOutputParams = z22.strictObject({
1484
+ var ExecJobStartResult = z23.strictObject({ job_id: ExecJobId, pid: z23.int().min(1), cwd: AbsPath });
1485
+ var ExecJobOutputParams = z23.strictObject({
1402
1486
  job_id: ExecJobId,
1403
1487
  /** Byte offset into the job's output to read from (next_offset of the last read; 0 = the start). */
1404
1488
  offset: nonNegInt.default(0),
1405
1489
  /** Wait up to this long for new output or the exit when none is waiting (0 answers at once). */
1406
- wait_ms: z22.int().min(0).max(25e3).default(0),
1407
- max_bytes: z22.int().min(1024).max(1048576).default(65536)
1490
+ wait_ms: z23.int().min(0).max(25e3).default(0),
1491
+ max_bytes: z23.int().min(1024).max(1048576).default(65536)
1408
1492
  });
1409
- var ExecJobOutputResult = z22.strictObject({
1493
+ var ExecJobOutputResult = z23.strictObject({
1410
1494
  /** stdout and stderr interleaved as they arrived (UTF-8). */
1411
- output: z22.string(),
1495
+ output: z23.string(),
1412
1496
  next_offset: nonNegInt,
1413
1497
  /** Bytes before `offset` that are gone (the job keeps its last 4 MiB). */
1414
1498
  dropped_bytes: nonNegInt,
1415
- running: z22.boolean(),
1416
- exit_code: z22.int().nullable()
1499
+ running: z23.boolean(),
1500
+ exit_code: z23.int().nullable()
1417
1501
  });
1418
- var ExecJobStopParams = z22.strictObject({
1502
+ var ExecJobStopParams = z23.strictObject({
1419
1503
  job_id: ExecJobId,
1420
1504
  /** End it at once (SIGKILL; on Windows the whole tree with /F) instead of asking it to quit. */
1421
- force: z22.boolean().default(false)
1505
+ force: z23.boolean().default(false)
1422
1506
  });
1423
- var ExecJobStopResult = z22.strictObject({ job_id: ExecJobId, exited: z22.boolean(), exit_code: z22.int().nullable() });
1424
- var ExecJobInfo = z22.strictObject({
1507
+ var ExecJobStopResult = z23.strictObject({ job_id: ExecJobId, exited: z23.boolean(), exit_code: z23.int().nullable() });
1508
+ var ExecJobInfo = z23.strictObject({
1425
1509
  job_id: ExecJobId,
1426
- command: z22.string().max(1024),
1427
- pid: z22.int().min(1),
1510
+ command: z23.string().max(1024),
1511
+ pid: z23.int().min(1),
1428
1512
  cwd: AbsPath,
1429
- running: z22.boolean(),
1430
- exit_code: z22.int().nullable(),
1513
+ running: z23.boolean(),
1514
+ exit_code: z23.int().nullable(),
1431
1515
  started_at_ms: epochMs,
1432
1516
  output_bytes: nonNegInt
1433
1517
  });
1434
- var ExecJobListParams = z22.strictObject({});
1435
- var ExecJobListResult = z22.strictObject({ jobs: z22.array(ExecJobInfo).max(64) });
1518
+ var ExecJobListParams = z23.strictObject({});
1519
+ var ExecJobListResult = z23.strictObject({ jobs: z23.array(ExecJobInfo).max(64) });
1436
1520
 
1437
1521
  // src/schema/coding.ts
1438
- import { z as z23 } from "zod";
1522
+ import { z as z24 } from "zod";
1439
1523
  import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN2 } from "@ai-matrx/kit/uuid";
1440
- var CodingServiceCredentials = z23.strictObject({
1441
- access_token: z23.string().min(16).max(16384),
1442
- user_id: z23.string().regex(UUID_SHAPE_PATTERN2),
1524
+ var CodingServiceCredentials = z24.strictObject({
1525
+ access_token: z24.string().min(16).max(16384),
1526
+ user_id: z24.string().regex(UUID_SHAPE_PATTERN2),
1443
1527
  /** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
1444
- server_url: z23.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
1528
+ server_url: z24.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
1445
1529
  });
1446
- var CodingHistoryBlocked = z23.enum([
1530
+ var CodingHistoryBlocked = z24.enum([
1447
1531
  "signed_out",
1448
1532
  "offline",
1449
1533
  "organization_required",
@@ -1451,11 +1535,11 @@ var CodingHistoryBlocked = z23.enum([
1451
1535
  "cloud_list_unavailable",
1452
1536
  "history_too_large"
1453
1537
  ]);
1454
- var CodingHistoryFailure = z23.strictObject({
1455
- session_id: z23.string().max(64),
1456
- reason: z23.string().max(300)
1538
+ var CodingHistoryFailure = z24.strictObject({
1539
+ session_id: z24.string().max(64),
1540
+ reason: z24.string().max(300)
1457
1541
  });
1458
- var CodingHistoryRun = z23.strictObject({
1542
+ var CodingHistoryRun = z24.strictObject({
1459
1543
  /** Claude Code sessions found on this computer. */
1460
1544
  local_sessions: nonNegInt,
1461
1545
  /** Of those, already complete in AI Matrx. */
@@ -1470,39 +1554,39 @@ var CodingHistoryRun = z23.strictObject({
1470
1554
  /** Changed while being read; a later run takes them. */
1471
1555
  changed: nonNegInt,
1472
1556
  failed: nonNegInt,
1473
- failures: z23.array(CodingHistoryFailure).max(20),
1557
+ failures: z24.array(CodingHistoryFailure).max(20),
1474
1558
  /** Candidates not reached yet. */
1475
1559
  remaining: nonNegInt,
1476
1560
  /** The one line a person reads, e.g. "Imported 12 of 14 sessions. 140 already in AI Matrx." */
1477
- summary: z23.string().max(400)
1561
+ summary: z24.string().max(400)
1478
1562
  });
1479
- var CodingHistoryStep = z23.strictObject({
1563
+ var CodingHistoryStep = z24.strictObject({
1480
1564
  /** Null when the run could not start (blocked before a plan existed). */
1481
- plan_id: z23.string().regex(/^[0-9a-f]{32}$/).nullable(),
1482
- finished: z23.boolean(),
1565
+ plan_id: z24.string().regex(/^[0-9a-f]{32}$/).nullable(),
1566
+ finished: z24.boolean(),
1483
1567
  blocked: CodingHistoryBlocked.nullable(),
1484
1568
  run: CodingHistoryRun
1485
1569
  });
1486
- var CodingPlanMissingParams = z23.strictObject({ credentials: CodingServiceCredentials.nullable() });
1487
- var CodingImportNextParams = z23.strictObject({
1488
- plan_id: z23.string().regex(/^[0-9a-f]{32}$/),
1570
+ var CodingPlanMissingParams = z24.strictObject({ credentials: CodingServiceCredentials.nullable() });
1571
+ var CodingImportNextParams = z24.strictObject({
1572
+ plan_id: z24.string().regex(/^[0-9a-f]{32}$/),
1489
1573
  credentials: CodingServiceCredentials.nullable()
1490
1574
  });
1491
- var CodingServiceProgress = z23.strictObject({
1492
- phase: z23.enum(["checking", "importing"]),
1575
+ var CodingServiceProgress = z24.strictObject({
1576
+ phase: z24.enum(["checking", "importing"]),
1493
1577
  done: nonNegInt,
1494
1578
  total: nonNegInt
1495
1579
  });
1496
- var CodingHistoryImportMissingParams = z23.strictObject({});
1497
- var CodingHistoryImportMissingResult = z23.strictObject({
1498
- state: z23.enum(["done", "blocked", "cancelled"]),
1580
+ var CodingHistoryImportMissingParams = z24.strictObject({});
1581
+ var CodingHistoryImportMissingResult = z24.strictObject({
1582
+ state: z24.enum(["done", "blocked", "cancelled"]),
1499
1583
  blocked: CodingHistoryBlocked.nullable(),
1500
1584
  run: CodingHistoryRun,
1501
1585
  elapsed_ms: nonNegInt
1502
1586
  });
1503
- var CodingHistoryProgressEvent = z23.strictObject({
1587
+ var CodingHistoryProgressEvent = z24.strictObject({
1504
1588
  request_id: RequestId,
1505
- phase: z23.enum(["checking", "importing"]),
1589
+ phase: z24.enum(["checking", "importing"]),
1506
1590
  /** Sessions settled so far, of `total` candidates (0 of 0 while checking). */
1507
1591
  done: nonNegInt,
1508
1592
  total: nonNegInt,
@@ -1511,23 +1595,23 @@ var CodingHistoryProgressEvent = z23.strictObject({
1511
1595
  });
1512
1596
 
1513
1597
  // src/schema/apps.ts
1514
- import { z as z24 } from "zod";
1598
+ import { z as z25 } from "zod";
1515
1599
  import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN3 } from "@ai-matrx/kit/uuid";
1516
- var AppKey = z24.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
1517
- var AppProfileId = z24.string().regex(UUID_SHAPE_PATTERN3);
1518
- var AppProfileLocator = z24.string().min(1).max(512).regex(/^[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}(\/[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}){0,7}$/);
1519
- var AppSupport = z24.enum(["supported", "partial", "unsupported"]);
1520
- var AppFeatureStatus = z24.strictObject({
1600
+ var AppKey = z25.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
1601
+ var AppProfileId = z25.string().regex(UUID_SHAPE_PATTERN3);
1602
+ var AppProfileLocator = z25.string().min(1).max(512).regex(/^[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}(\/[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}){0,7}$/);
1603
+ var AppSupport = z25.enum(["supported", "partial", "unsupported"]);
1604
+ var AppFeatureStatus = z25.strictObject({
1521
1605
  status: AppSupport,
1522
1606
  /** One line, set whenever status is not "supported". */
1523
- reason: z24.string().max(140).nullable()
1607
+ reason: z25.string().max(140).nullable()
1524
1608
  });
1525
- var AppInfo = z24.strictObject({
1609
+ var AppInfo = z25.strictObject({
1526
1610
  app_key: AppKey,
1527
- name: z24.string().max(64),
1528
- installed: z24.boolean(),
1611
+ name: z25.string().max(64),
1612
+ installed: z25.boolean(),
1529
1613
  /** The app's own version string, or null when it is not installed or does not say. */
1530
- version: z24.string().max(64).nullable(),
1614
+ version: z25.string().max(64).nullable(),
1531
1615
  /** The install found (an .app bundle, an .exe, a binary), or null. */
1532
1616
  location: AbsPath.nullable(),
1533
1617
  /** Open the app at all on this OS. */
@@ -1537,148 +1621,148 @@ var AppInfo = z24.strictObject({
1537
1621
  /** Plan usage read from the app's own files on this OS. */
1538
1622
  usage: AppFeatureStatus
1539
1623
  });
1540
- var AppUsageReading = z24.strictObject({
1541
- window: z24.enum(["five_hour", "weekly", "extra"]),
1624
+ var AppUsageReading = z25.strictObject({
1625
+ window: z25.enum(["five_hour", "weekly", "extra"]),
1542
1626
  /** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
1543
- percent: z24.number().min(0).max(1e4),
1627
+ percent: z25.number().min(0).max(1e4),
1544
1628
  /** When the app recorded it. */
1545
1629
  sampled_at_ms: epochMs,
1546
1630
  /** True when the window has rolled over since the sample, so the figure has reset. */
1547
- reset_since: z24.boolean()
1631
+ reset_since: z25.boolean()
1548
1632
  });
1549
- var AppProfile = z24.strictObject({
1633
+ var AppProfile = z25.strictObject({
1550
1634
  /** The row's id; null for a folder found on disk that no row names yet. */
1551
1635
  id: AppProfileId.nullable(),
1552
1636
  app_key: AppKey,
1553
- display_name: z24.string().min(1).max(120),
1637
+ display_name: z25.string().min(1).max(120),
1554
1638
  /** The account the person means to be signed in here; null when not stated (never guessed). */
1555
- account_identity: z24.string().min(3).max(320).nullable(),
1639
+ account_identity: z25.string().min(3).max(320).nullable(),
1556
1640
  profile_locator: AppProfileLocator.nullable(),
1557
1641
  /** The device the row is tied to; null when the row names none. */
1558
1642
  device_id: DeviceId.nullable(),
1559
1643
  /** The folder this profile resolves to on this device; null for a row tied to another device. */
1560
1644
  folder: AbsPath.nullable(),
1561
1645
  /** The folder exists on this device. */
1562
- on_disk: z24.boolean(),
1646
+ on_disk: z25.boolean(),
1563
1647
  /** An instance with this profile is running; null when it could not be determined. */
1564
- running: z24.boolean().nullable(),
1648
+ running: z25.boolean().nullable(),
1565
1649
  /** Usage the app recorded for this profile; null when the app exposes none here. */
1566
- usage: z24.array(AppUsageReading).nullable(),
1650
+ usage: z25.array(AppUsageReading).nullable(),
1567
1651
  last_opened_ms: epochMs.nullable()
1568
1652
  });
1569
- var AppsListParams = z24.strictObject({});
1570
- var AppsListResult = z24.strictObject({ apps: z24.array(AppInfo) });
1571
- var AppsProfilesListParams = z24.strictObject({
1653
+ var AppsListParams = z25.strictObject({});
1654
+ var AppsListResult = z25.strictObject({ apps: z25.array(AppInfo) });
1655
+ var AppsProfilesListParams = z25.strictObject({
1572
1656
  /** Only this app's profiles; every app's when absent. */
1573
1657
  app_key: AppKey.optional()
1574
1658
  });
1575
- var AppsProfilesListResult = z24.strictObject({
1576
- profiles: z24.array(AppProfile),
1659
+ var AppsProfilesListResult = z25.strictObject({
1660
+ profiles: z25.array(AppProfile),
1577
1661
  /**
1578
1662
  * Whether the saved rows could be read: false while signed out or offline, when only folders
1579
1663
  * found on disk are listed.
1580
1664
  */
1581
- registry: z24.enum(["ok", "signed_out", "unavailable"])
1665
+ registry: z25.enum(["ok", "signed_out", "unavailable"])
1582
1666
  });
1583
- var AppsProfilesSaveParams = z24.strictObject({
1667
+ var AppsProfilesSaveParams = z25.strictObject({
1584
1668
  id: AppProfileId.optional(),
1585
1669
  app_key: AppKey,
1586
- display_name: z24.string().min(1).max(120),
1587
- account_identity: z24.string().min(3).max(320).nullable(),
1670
+ display_name: z25.string().min(1).max(120),
1671
+ account_identity: z25.string().min(3).max(320).nullable(),
1588
1672
  /** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
1589
1673
  profile_locator: AppProfileLocator.nullable(),
1590
1674
  /** On create with profile_locator null: make a new folder named after display_name instead. */
1591
- new_folder: z24.boolean().default(false)
1675
+ new_folder: z25.boolean().default(false)
1592
1676
  });
1593
1677
  var AppsProfilesSaveResult = AppProfile;
1594
- var AppsProfilesRemoveParams = z24.strictObject({ id: AppProfileId });
1595
- var AppsProfilesRemoveResult = z24.strictObject({ removed: z24.boolean() });
1596
- var AppsOpenParams = z24.strictObject({
1678
+ var AppsProfilesRemoveParams = z25.strictObject({ id: AppProfileId });
1679
+ var AppsProfilesRemoveResult = z25.strictObject({ removed: z25.boolean() });
1680
+ var AppsOpenParams = z25.strictObject({
1597
1681
  app_key: AppKey,
1598
1682
  profile_id: AppProfileId.optional()
1599
1683
  });
1600
- var AppsOpenResult = z24.strictObject({
1684
+ var AppsOpenResult = z25.strictObject({
1601
1685
  /** True when an instance with this profile was already running; it is brought forward. */
1602
- already_running: z24.boolean(),
1686
+ already_running: z25.boolean(),
1603
1687
  folder: AbsPath.nullable()
1604
1688
  });
1605
1689
 
1606
1690
  // src/schema/apps-chats.ts
1607
- import { z as z25 } from "zod";
1608
- var ChatId = z25.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/);
1609
- var ChatPlace = z25.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/);
1610
- var ChatProjectId = z25.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
1611
- var ChatWindow = z25.strictObject({
1691
+ import { z as z26 } from "zod";
1692
+ var ChatId = z26.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/);
1693
+ var ChatPlace = z26.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/);
1694
+ var ChatProjectId = z26.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
1695
+ var ChatWindow = z26.strictObject({
1612
1696
  key: ChatPlace,
1613
1697
  /** The app's default profile (Claude: the main window, which lists every account's chats). */
1614
- main: z25.boolean(),
1698
+ main: z26.boolean(),
1615
1699
  /** The account the window is signed into, when known. */
1616
- account: z25.string().max(320).nullable()
1700
+ account: z26.string().max(320).nullable()
1617
1701
  });
1618
- var ChatProject = z25.strictObject({
1702
+ var ChatProject = z26.strictObject({
1619
1703
  id: ChatProjectId,
1620
- name: z25.string().min(1).max(200),
1621
- archived: z25.boolean(),
1704
+ name: z26.string().min(1).max(200),
1705
+ archived: z26.boolean(),
1622
1706
  /** Chats in it. */
1623
1707
  count: nonNegInt
1624
1708
  });
1625
- var ChatPin = z25.strictObject({
1709
+ var ChatPin = z26.strictObject({
1626
1710
  /** The window whose account pins it; an account with no window of its own is named by its email. */
1627
- window: z25.string().min(1).max(320),
1711
+ window: z26.string().min(1).max(320),
1628
1712
  /** When that account's pin list was last read; null when the reading has no time. */
1629
1713
  observed_at_ms: epochMs.nullable()
1630
1714
  });
1631
- var ChatRunning = z25.strictObject({
1715
+ var ChatRunning = z26.strictObject({
1632
1716
  window: ChatPlace,
1633
1717
  /** process: a live process resumed this chat there (exact); activity: that window's own record moved in the last 3 minutes. */
1634
- how: z25.enum(["process", "activity"])
1718
+ how: z26.enum(["process", "activity"])
1635
1719
  });
1636
- var ChatHidden = z25.strictObject({
1720
+ var ChatHidden = z26.strictObject({
1637
1721
  window: ChatPlace,
1638
- reason: z25.string().max(200)
1722
+ reason: z26.string().max(200)
1639
1723
  });
1640
- var ChatLastUse = z25.strictObject({
1724
+ var ChatLastUse = z26.strictObject({
1641
1725
  /** The conversation's last reply. */
1642
1726
  at_ms: epochMs,
1643
1727
  window: ChatPlace.nullable(),
1644
- account: z25.string().max(320).nullable(),
1728
+ account: z26.string().max(320).nullable(),
1645
1729
  /** How the window was decided (one short line). */
1646
- how: z25.string().max(120).nullable(),
1730
+ how: z26.string().max(120).nullable(),
1647
1731
  /** The account's 1-hour prompt cache is still warm. */
1648
- cache_warm: z25.boolean(),
1732
+ cache_warm: z26.boolean(),
1649
1733
  cache_minutes_left: nonNegInt
1650
1734
  });
1651
- var ChatAppProject = z25.strictObject({
1652
- id: z25.string().min(1).max(200),
1653
- name: z25.string().max(200)
1735
+ var ChatAppProject = z26.strictObject({
1736
+ id: z26.string().min(1).max(200),
1737
+ name: z26.string().max(200)
1654
1738
  });
1655
- var ChatTitleSource = z25.enum(["app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt"]);
1656
- var ChatRow = z25.strictObject({
1739
+ var ChatTitleSource = z26.enum(["app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt"]);
1740
+ var ChatRow = z26.strictObject({
1657
1741
  id: ChatId,
1658
1742
  /** The short id people see (the listing's first 8 characters). */
1659
- short_id: z25.string().max(16),
1743
+ short_id: z26.string().max(16),
1660
1744
  /** The listing's own name (Claude: local_<id>), null for a chat only in the holder. */
1661
- record: z25.string().max(160).nullable(),
1662
- title: z25.string().max(1e3),
1745
+ record: z26.string().max(160).nullable(),
1746
+ title: z26.string().max(1e3),
1663
1747
  last_active_ms: epochMs.nullable(),
1664
1748
  created_ms: epochMs.nullable(),
1665
- projects: z25.array(ChatProjectId).max(500),
1666
- starred: z25.boolean(),
1667
- pinned_in: z25.array(ChatPin).max(200),
1749
+ projects: z26.array(ChatProjectId).max(500),
1750
+ starred: z26.boolean(),
1751
+ pinned_in: z26.array(ChatPin).max(200),
1668
1752
  /** Every place it is listed now: window keys, plus "holder". */
1669
- places: z25.array(ChatPlace).max(200),
1670
- held: z25.boolean(),
1671
- running: z25.array(ChatRunning).max(200),
1672
- hidden_in: z25.array(ChatHidden).max(200),
1753
+ places: z26.array(ChatPlace).max(200),
1754
+ held: z26.boolean(),
1755
+ running: z26.array(ChatRunning).max(200),
1756
+ hidden_in: z26.array(ChatHidden).max(200),
1673
1757
  /** Kept out of the main window on purpose. */
1674
- hidden_from_main: z25.boolean(),
1758
+ hidden_from_main: z26.boolean(),
1675
1759
  /** Listed in a side window and not yet copied into main. */
1676
- main_pending: z25.boolean(),
1760
+ main_pending: z26.boolean(),
1677
1761
  /** A scheduled routine's run (its task id). */
1678
- scheduled: z25.string().max(200).nullable(),
1762
+ scheduled: z26.string().max(200).nullable(),
1679
1763
  /** Created recently and in no project: offered for filing. */
1680
- new_unfiled: z25.boolean(),
1681
- warnings: z25.array(z25.string().max(400)).max(20),
1764
+ new_unfiled: z26.boolean(),
1765
+ warnings: z26.array(z26.string().max(400)).max(20),
1682
1766
  last_use: ChatLastUse.nullable(),
1683
1767
  /** 1.13: the app's own project the chat is grouped under in the app (Codex), read only; absent = none or not an app that groups. */
1684
1768
  app_project: ChatAppProject.optional(),
@@ -1688,285 +1772,322 @@ var ChatRow = z25.strictObject({
1688
1772
  * 1.14: the chat's own title before the person's rename (the one title rule, `@ai-matrx/coding-sessions/sessions`);
1689
1773
  * `title` is what to show (`title_override` when set, else this).
1690
1774
  */
1691
- original_title: z25.string().max(1e3).optional(),
1775
+ original_title: z26.string().max(1e3).optional(),
1692
1776
  /** 1.14: where `original_title` came from (the one rule's sources, strongest first; 1.15: a closed set). */
1693
1777
  title_source: ChatTitleSource.optional(),
1694
1778
  /** 1.14: the person's rename inside Matrx (Coding Sessions), applied once by the row builder; absent = none. */
1695
- title_override: z25.string().min(1).max(300).optional(),
1779
+ title_override: z26.string().min(1).max(300).optional(),
1696
1780
  /** 1.15: the app itself archived it (hidden_in says where and why, in words for people; this is the typed fact). */
1697
- archived: z25.boolean().optional()
1781
+ archived: z26.boolean().optional()
1698
1782
  });
1699
- var ChatFamily = z25.strictObject({
1783
+ var ChatFamily = z26.strictObject({
1700
1784
  id: ChatId,
1701
1785
  fork_of: ChatId.nullable(),
1702
1786
  copy_of: ChatId.nullable()
1703
1787
  });
1704
- var AppsChatsListParams = z25.strictObject({
1788
+ var AppsChatsListParams = z26.strictObject({
1705
1789
  app_key: AppKey,
1706
1790
  /** Only these chats (a live update re-reads just what changed). */
1707
- ids: z25.array(ChatId).max(500).optional()
1791
+ ids: z26.array(ChatId).max(500).optional()
1708
1792
  });
1709
- var AppsChatsListResult = z25.strictObject({
1793
+ var AppsChatsListResult = z26.strictObject({
1710
1794
  app_key: AppKey,
1711
1795
  /** Bumps on every change the index sees; `apps.chats.changed` carries the same number. */
1712
1796
  version: nonNegInt,
1713
- windows: z25.array(ChatWindow).max(200),
1714
- projects: z25.array(ChatProject).max(5e3),
1715
- chats: z25.array(ChatRow).max(2e4),
1797
+ windows: z26.array(ChatWindow).max(200),
1798
+ projects: z26.array(ChatProject).max(5e3),
1799
+ chats: z26.array(ChatRow).max(2e4),
1716
1800
  /** How long a chat in no project counts as new. */
1717
1801
  new_window_ms: nonNegInt,
1718
1802
  /** 1.9: this is the copy saved at the last read, shown while everything is read again. */
1719
- updating: z25.boolean().optional(),
1803
+ updating: z26.boolean().optional(),
1720
1804
  /** 1.9: false while the folder watches are down (changes are not arriving); `apps.chats.watch_state` says when it changes. */
1721
- live: z25.boolean().optional(),
1805
+ live: z26.boolean().optional(),
1722
1806
  /** 1.10: every listed chat that is a fork or a copy of another (read from the conversations' first lines). */
1723
- families: z25.array(ChatFamily).max(2e4).optional()
1807
+ families: z26.array(ChatFamily).max(2e4).optional()
1724
1808
  });
1725
- var AppsChatsWatchParams = z25.strictObject({ app_key: AppKey });
1726
- var AppsChatsWatchResult = z25.strictObject({ resource_id: ResourceId, version: nonNegInt });
1727
- var AppsChatsChangedEvent = z25.strictObject({
1809
+ var AppsChatsWatchParams = z26.strictObject({ app_key: AppKey });
1810
+ var AppsChatsWatchResult = z26.strictObject({ resource_id: ResourceId, version: nonNegInt });
1811
+ var AppsChatsChangedEvent = z26.strictObject({
1728
1812
  app_key: AppKey,
1729
1813
  version: nonNegInt,
1730
- ids: z25.array(ChatId).max(1e3),
1731
- all: z25.boolean()
1814
+ ids: z26.array(ChatId).max(1e3),
1815
+ all: z26.boolean()
1732
1816
  });
1733
- var AppsChatsWatchStateEvent = z25.strictObject({
1817
+ var AppsChatsWatchStateEvent = z26.strictObject({
1734
1818
  app_key: AppKey,
1735
- live: z25.boolean(),
1736
- updating: z25.boolean(),
1737
- reason: z25.string().max(300).nullable()
1819
+ live: z26.boolean(),
1820
+ updating: z26.boolean(),
1821
+ reason: z26.string().max(300).nullable()
1738
1822
  });
1739
- var AppsChatsPlaceParams = z25.strictObject({
1823
+ var AppsChatsPlaceParams = z26.strictObject({
1740
1824
  app_key: AppKey,
1741
1825
  chat_id: ChatId,
1742
- action: z25.enum(["place", "take_off", "hold"]),
1826
+ action: z26.enum(["place", "take_off", "hold"]),
1743
1827
  /** The window (for place and take_off). */
1744
1828
  window: ChatPlace.optional(),
1745
1829
  /** take_off where it is open: stop it there first (the person confirmed). */
1746
- stop_if_open: z25.boolean().default(false)
1830
+ stop_if_open: z26.boolean().default(false)
1747
1831
  });
1748
- var AppsChatsPlaceResult = z25.strictObject({ chat: ChatRow, message: z25.string().max(400) });
1749
- var AppsProjectsFileManyParams = z25.strictObject({
1832
+ var AppsChatsPlaceResult = z26.strictObject({ chat: ChatRow, message: z26.string().max(400) });
1833
+ var AppsProjectsFileManyParams = z26.strictObject({
1750
1834
  app_key: AppKey,
1751
- chat_ids: z25.array(ChatId).min(1).max(500),
1835
+ chat_ids: z26.array(ChatId).min(1).max(500),
1752
1836
  project_id: ChatProjectId.optional(),
1753
- new_project_name: z25.string().min(1).max(200).optional()
1837
+ new_project_name: z26.string().min(1).max(200).optional()
1754
1838
  });
1755
- var AppsProjectsFileManyResult = z25.strictObject({ chats: z25.array(ChatRow).max(500), project: ChatProject });
1756
- var AppsProjectsUpdateParams = z25.strictObject({
1839
+ var AppsProjectsFileManyResult = z26.strictObject({ chats: z26.array(ChatRow).max(500), project: ChatProject });
1840
+ var AppsProjectsUpdateParams = z26.strictObject({
1757
1841
  app_key: AppKey,
1758
1842
  project_id: ChatProjectId,
1759
- name: z25.string().min(1).max(200).optional(),
1760
- archived: z25.boolean().optional()
1843
+ name: z26.string().min(1).max(200).optional(),
1844
+ archived: z26.boolean().optional()
1761
1845
  });
1762
- var AppsProjectsUpdateResult = z25.strictObject({ project: ChatProject });
1763
- var AppsProjectsCopyParams = z25.strictObject({ app_key: AppKey, project_id: ChatProjectId, new_project_name: z25.string().min(1).max(200) });
1764
- var AppsProjectsCopyResult = z25.strictObject({ project: ChatProject });
1765
- var AppsProjectsFileParams = z25.strictObject({
1846
+ var AppsProjectsUpdateResult = z26.strictObject({ project: ChatProject });
1847
+ var AppsProjectsCopyParams = z26.strictObject({ app_key: AppKey, project_id: ChatProjectId, new_project_name: z26.string().min(1).max(200) });
1848
+ var AppsProjectsCopyResult = z26.strictObject({ project: ChatProject });
1849
+ var AppsProjectsFileParams = z26.strictObject({
1766
1850
  app_key: AppKey,
1767
1851
  chat_id: ChatId,
1768
1852
  project_id: ChatProjectId.optional(),
1769
- new_project_name: z25.string().min(1).max(200).optional()
1853
+ new_project_name: z26.string().min(1).max(200).optional()
1770
1854
  });
1771
- var AppsProjectsFileResult = z25.strictObject({ chat: ChatRow, project: ChatProject });
1772
- var AppsProjectsUnfileParams = z25.strictObject({ app_key: AppKey, chat_id: ChatId, project_id: ChatProjectId });
1773
- var AppsProjectsUnfileResult = z25.strictObject({ chat: ChatRow });
1774
- var AppsChatsStarParams = z25.strictObject({ app_key: AppKey, chat_id: ChatId, starred: z25.boolean() });
1775
- var AppsChatsStarResult = z25.strictObject({ chat: ChatRow });
1855
+ var AppsProjectsFileResult = z26.strictObject({ chat: ChatRow, project: ChatProject });
1856
+ var AppsProjectsUnfileParams = z26.strictObject({ app_key: AppKey, chat_id: ChatId, project_id: ChatProjectId });
1857
+ var AppsProjectsUnfileResult = z26.strictObject({ chat: ChatRow });
1858
+ var AppsChatsStarParams = z26.strictObject({ app_key: AppKey, chat_id: ChatId, starred: z26.boolean() });
1859
+ var AppsChatsStarResult = z26.strictObject({ chat: ChatRow });
1776
1860
 
1777
1861
  // src/schema/apps-accounts.ts
1778
- import { z as z26 } from "zod";
1779
- var AppWindowInfo = z26.strictObject({
1862
+ import { z as z27 } from "zod";
1863
+ var AppWindowInfo = z27.strictObject({
1780
1864
  key: ChatPlace,
1781
1865
  /** The app's default profile (Claude: main, which may sign into any account). */
1782
- main: z26.boolean(),
1866
+ main: z27.boolean(),
1783
1867
  /** The account the window is meant for (null for main). */
1784
- account: z26.string().max(320).nullable(),
1868
+ account: z27.string().max(320).nullable(),
1785
1869
  /** The account signed in there now: an email, or the account id while it has no saved name. */
1786
- signed_in: z26.string().max(320).nullable(),
1787
- signed_in_is_email: z26.boolean(),
1870
+ signed_in: z27.string().max(320).nullable(),
1871
+ signed_in_is_email: z27.boolean(),
1788
1872
  /** Signed into another account than the one it is meant for. */
1789
- mismatch: z26.boolean(),
1873
+ mismatch: z27.boolean(),
1790
1874
  /** Its folder exists. */
1791
- created: z26.boolean(),
1875
+ created: z27.boolean(),
1792
1876
  /** Open now. */
1793
- running: z26.boolean(),
1877
+ running: z27.boolean(),
1794
1878
  /** Chats open in it now (a process resuming each one). */
1795
1879
  open_chats: nonNegInt
1796
1880
  });
1797
- var AccountUsage = z26.strictObject({
1881
+ var AccountUsage = z27.strictObject({
1798
1882
  /** The account's email, or "org <8 chars>" when no window has ever sampled that org. */
1799
- account: z26.string().max(320),
1800
- org: z26.string().max(80).nullable(),
1883
+ account: z27.string().max(320),
1884
+ org: z27.string().max(80).nullable(),
1801
1885
  /** False when the org was sampled in several accounts' windows and the vote is not clear (≥ 75 %). */
1802
- account_certain: z26.boolean(),
1886
+ account_certain: z27.boolean(),
1803
1887
  /** 5-hour use in percent (0 once the reading is over 5 hours old). */
1804
- five_hour: z26.number().nullable(),
1805
- five_hour_reset_since: z26.boolean(),
1888
+ five_hour: z27.number().nullable(),
1889
+ five_hour_reset_since: z27.boolean(),
1806
1890
  /** Weekly use in percent (0 once the week reset after the reading). */
1807
- weekly: z26.number().nullable(),
1808
- weekly_reset_since: z26.boolean(),
1891
+ weekly: z27.number().nullable(),
1892
+ weekly_reset_since: z27.boolean(),
1809
1893
  /** Extra-usage spend in percent of its cap, when on. */
1810
- extra_usage: z26.number().nullable(),
1894
+ extra_usage: z27.number().nullable(),
1811
1895
  extra_usage_as_of_ms: epochMs.nullable(),
1812
1896
  as_of_ms: epochMs,
1813
1897
  /** The windows meant for this account (and main when main took the reading). */
1814
- windows: z26.array(ChatPlace).max(200),
1898
+ windows: z27.array(ChatPlace).max(200),
1815
1899
  /** The window that took the reading is open now and the reading is under 30 minutes old. */
1816
- live: z26.boolean(),
1900
+ live: z27.boolean(),
1817
1901
  /** The next weekly reset, when known. */
1818
1902
  weekly_resets_at_ms: epochMs.nullable(),
1819
1903
  /** That reset time is Claude's own (its reading, or a reset seen in its usage history). */
1820
- weekly_reset_official: z26.boolean().nullable(),
1904
+ weekly_reset_official: z27.boolean().nullable(),
1821
1905
  /** 1.13: the account's plan as the app names it (Codex: "pro", "prolite"), when recorded. */
1822
- plan: z26.string().max(80).optional(),
1906
+ plan: z27.string().max(80).optional(),
1823
1907
  /** 1.13: the account's credit balance as the app records it (Codex), when recorded. */
1824
- credits: z26.string().max(40).optional()
1908
+ credits: z27.string().max(40).optional()
1825
1909
  });
1826
- var AccountReset = z26.strictObject({
1910
+ var AccountReset = z27.strictObject({
1827
1911
  window: ChatPlace,
1828
- account: z26.string().max(320).nullable(),
1912
+ account: z27.string().max(320).nullable(),
1829
1913
  next_reset_ms: epochMs.nullable(),
1830
1914
  /** claude: the app's own reading; usage_history: a weekly drop seen in its usage record; your_list: the person's own entry. */
1831
- source: z26.enum(["claude", "usage_history", "your_list"]).nullable(),
1915
+ source: z27.enum(["claude", "usage_history", "your_list"]).nullable(),
1832
1916
  /** claude or usage_history. */
1833
- official: z26.boolean(),
1917
+ official: z27.boolean(),
1834
1918
  /** Set when the person's list disagrees with the official time. */
1835
- note: z26.string().max(200).nullable()
1919
+ note: z27.string().max(200).nullable()
1836
1920
  });
1837
- var AppsWindowsListParams = z26.strictObject({ app_key: AppKey });
1838
- var AppsWindowsListResult = z26.strictObject({ app_key: AppKey, windows: z26.array(AppWindowInfo).max(200) });
1839
- var AppsAccountsUsageParams = z26.strictObject({ app_key: AppKey });
1840
- var AppsAccountsUsageResult = z26.strictObject({
1921
+ var AppsWindowsListParams = z27.strictObject({ app_key: AppKey });
1922
+ var AppsWindowsListResult = z27.strictObject({ app_key: AppKey, windows: z27.array(AppWindowInfo).max(200) });
1923
+ var AppsAccountsUsageParams = z27.strictObject({ app_key: AppKey });
1924
+ var AppsAccountsUsageResult = z27.strictObject({
1841
1925
  app_key: AppKey,
1842
- accounts: z26.array(AccountUsage).max(500),
1926
+ accounts: z27.array(AccountUsage).max(500),
1843
1927
  /** 1.12: the rows are right but something around them failed (a newly read reset time could not be saved); shown, never hidden. */
1844
- problem: z26.string().max(400).optional()
1928
+ problem: z27.string().max(400).optional()
1845
1929
  });
1846
- var AppsAccountsResetsParams = z26.strictObject({ app_key: AppKey });
1847
- var AppsAccountsResetsResult = z26.strictObject({
1930
+ var AppsAccountsResetsParams = z27.strictObject({ app_key: AppKey });
1931
+ var AppsAccountsResetsResult = z27.strictObject({
1848
1932
  app_key: AppKey,
1849
- resets: z26.array(AccountReset).max(200),
1933
+ resets: z27.array(AccountReset).max(200),
1850
1934
  /** 1.12: as on `apps.accounts.usage`. */
1851
- problem: z26.string().max(400).optional()
1852
- });
1853
- var AppsWindowActionResult = z26.strictObject({ message: z26.string().max(400) });
1854
- var AppsWindowsOpenParams = z26.strictObject({ app_key: AppKey, window: ChatPlace });
1855
- var AppsWindowsReloadParams = z26.strictObject({ app_key: AppKey, window: ChatPlace });
1856
- var AppsWindowsRestartParams = z26.strictObject({ app_key: AppKey, window: ChatPlace, force: z26.boolean().default(false) });
1857
- var AppsWindowsRefreshUsageParams = z26.strictObject({ app_key: AppKey, window: ChatPlace });
1858
- var AppsProjectsMoveParams = z26.strictObject({
1935
+ problem: z27.string().max(400).optional()
1936
+ });
1937
+ var AppsWindowActionResult = z27.strictObject({ message: z27.string().max(400) });
1938
+ var AppsWindowsOpenParams = z27.strictObject({ app_key: AppKey, window: ChatPlace });
1939
+ var AppsWindowsReloadParams = z27.strictObject({ app_key: AppKey, window: ChatPlace });
1940
+ var AppsWindowsRestartParams = z27.strictObject({ app_key: AppKey, window: ChatPlace, force: z27.boolean().default(false) });
1941
+ var AppsWindowsRefreshUsageParams = z27.strictObject({ app_key: AppKey, window: ChatPlace });
1942
+ var AppsProjectsMoveParams = z27.strictObject({
1859
1943
  app_key: AppKey,
1860
1944
  chat_id: ChatId,
1861
1945
  from_project_id: ChatProjectId,
1862
1946
  to_project_id: ChatProjectId.optional(),
1863
- new_project_name: z26.string().min(1).max(200).optional()
1947
+ new_project_name: z27.string().min(1).max(200).optional()
1948
+ });
1949
+ var AppsProjectsMoveResult = z27.strictObject({ chat: ChatRow, project: ChatProject });
1950
+ var AppsProjectsCreateParams = z27.strictObject({ app_key: AppKey, name: z27.string().min(1).max(200) });
1951
+ var AppsProjectsCreateResult = z27.strictObject({ project: ChatProject });
1952
+ var AppsProjectsImportPinsParams = z27.strictObject({ app_key: AppKey });
1953
+ var AppsProjectsImportPinsResult = z27.strictObject({ message: z27.string().max(400) });
1954
+ var ProjectMoveChat = z27.strictObject({ chat_id: ChatId, title: z27.string().max(300) });
1955
+ var ProjectMoveSkip = z27.strictObject({ chat_id: ChatId, title: z27.string().max(300), window: ChatPlace.nullable(), reason: z27.string().max(400) });
1956
+ var ProjectMoveGroup = z27.strictObject({
1957
+ ok: z27.boolean(),
1958
+ name: z27.string().max(200),
1959
+ /** Why it is not (or was not) grouped — e.g. the window is open. */
1960
+ reason: z27.string().max(400).optional(),
1961
+ /** Chats that get (or got) the group; already in it; taken from another group of the window. */
1962
+ assign: nonNegInt.optional(),
1963
+ already: nonNegInt.optional(),
1964
+ from_other_groups: nonNegInt.optional(),
1965
+ /** A group of that name was already there (reused, never doubled). */
1966
+ group_exists: z27.boolean().optional()
1967
+ });
1968
+ var AppsProjectsToWindowParams = z27.strictObject({
1969
+ app_key: AppKey,
1970
+ project_id: ChatProjectId,
1971
+ window: ChatPlace,
1972
+ /** Also take each chat off its other side windows where safe (never main, the holder, an open window). */
1973
+ take_off: z27.boolean().default(false),
1974
+ /** Also group them under the project's name in that window's sidebar (closed windows only). */
1975
+ group: z27.boolean().default(false),
1976
+ dry_run: z27.boolean().default(false)
1864
1977
  });
1865
- var AppsProjectsMoveResult = z26.strictObject({ chat: ChatRow, project: ChatProject });
1866
- var AppsProjectsCreateParams = z26.strictObject({ app_key: AppKey, name: z26.string().min(1).max(200) });
1867
- var AppsProjectsCreateResult = z26.strictObject({ project: ChatProject });
1868
- var AppsProjectsImportPinsParams = z26.strictObject({ app_key: AppKey });
1869
- var AppsProjectsImportPinsResult = z26.strictObject({ message: z26.string().max(400) });
1870
- var ColdChat = z26.strictObject({
1978
+ var AppsProjectsToWindowResult = z27.strictObject({
1979
+ project_id: ChatProjectId,
1980
+ window: ChatPlace,
1981
+ dry_run: z27.boolean(),
1982
+ place: z27.array(ProjectMoveChat).max(5e3),
1983
+ already: z27.array(ProjectMoveChat).max(5e3),
1984
+ take_off: z27.array(ProjectMoveChat.extend({ window: ChatPlace })).max(2e4),
1985
+ skipped: z27.array(ProjectMoveSkip).max(2e4),
1986
+ /** Chats of the project from other apps (no windows to place into), left as they are. */
1987
+ other_apps: nonNegInt,
1988
+ group: ProjectMoveGroup.nullable(),
1989
+ message: z27.string().max(400)
1990
+ });
1991
+ var ColdChat = z27.strictObject({
1871
1992
  id: ChatId,
1872
- title: z26.string().max(1e3),
1873
- repo: z26.string().max(200).nullable(),
1874
- window: z26.string().max(64).nullable(),
1875
- account: z26.string().max(320).nullable(),
1876
- model_name: z26.string().max(120).nullable(),
1993
+ title: z27.string().max(1e3),
1994
+ repo: z27.string().max(200).nullable(),
1995
+ window: z27.string().max(64).nullable(),
1996
+ account: z27.string().max(320).nullable(),
1997
+ model_name: z27.string().max(120).nullable(),
1877
1998
  context_tokens: nonNegInt,
1878
1999
  cold_at_ms: epochMs,
1879
2000
  /** Waking it once the cache is cold. */
1880
- cold_cost: z26.number().nullable(),
2001
+ cold_cost: z27.number().nullable(),
1881
2002
  /** Waking it while the cache is warm. */
1882
- warm_cost: z26.number().nullable(),
2003
+ warm_cost: z27.number().nullable(),
1883
2004
  /** Its account is on extra usage (a 5-minute cache, and real money). */
1884
- extra_usage: z26.boolean(),
2005
+ extra_usage: z27.boolean(),
1885
2006
  /** A scheduled routine's run. */
1886
- scheduled: z26.boolean(),
2007
+ scheduled: z27.boolean(),
1887
2008
  /** It can be shown in its window (started in the desktop app). */
1888
- openable: z26.boolean(),
2009
+ openable: z27.boolean(),
1889
2010
  /** How its window was decided, or why it can't be opened. */
1890
- how: z26.string().max(200).nullable()
2011
+ how: z27.string().max(200).nullable()
1891
2012
  });
1892
- var AppsChatsColdParams = z26.strictObject({ app_key: AppKey });
1893
- var AppsChatsColdResult = z26.strictObject({
2013
+ var AppsChatsColdParams = z27.strictObject({ app_key: AppKey });
2014
+ var AppsChatsColdResult = z27.strictObject({
1894
2015
  app_key: AppKey,
1895
2016
  /** Waiting for the person with a warm cache, most urgent first. */
1896
- waiting: z26.array(ColdChat).max(2e3),
2017
+ waiting: z27.array(ColdChat).max(2e3),
1897
2018
  /** Went cold in the last while. */
1898
- recently_cold: z26.array(ColdChat).max(2e3),
2019
+ recently_cold: z27.array(ColdChat).max(2e3),
1899
2020
  /** Chats working right now (not waiting). */
1900
2021
  working: nonNegInt
1901
2022
  });
1902
- var AppsChatsOpenParams = z26.strictObject({ app_key: AppKey, chat_id: ChatId, window: ChatPlace.optional() });
1903
- var SpendSplit = z26.strictObject({ main: z26.number(), helpers: z26.number() });
1904
- var SpendScopes = z26.strictObject({ today: SpendSplit, week: SpendSplit });
1905
- var SpendAccount = z26.strictObject({
1906
- account: z26.string().max(320),
2023
+ var AppsChatsOpenParams = z27.strictObject({ app_key: AppKey, chat_id: ChatId, window: ChatPlace.optional() });
2024
+ var SpendSplit = z27.strictObject({ main: z27.number(), helpers: z27.number() });
2025
+ var SpendScopes = z27.strictObject({ today: SpendSplit, week: SpendSplit });
2026
+ var SpendAccount = z27.strictObject({
2027
+ account: z27.string().max(320),
1907
2028
  spend: SpendScopes,
1908
- last_hour: z26.number().nullable(),
1909
- last_5h: z26.number().nullable(),
1910
- five_hour: z26.number().nullable(),
1911
- weekly: z26.number().nullable(),
2029
+ last_hour: z27.number().nullable(),
2030
+ last_5h: z27.number().nullable(),
2031
+ five_hour: z27.number().nullable(),
2032
+ weekly: z27.number().nullable(),
1912
2033
  as_of_ms: epochMs.nullable(),
1913
2034
  weekly_resets_at_ms: epochMs.nullable(),
1914
2035
  /** When the 5-hour or weekly limit is projected to be reached at the current burn. */
1915
2036
  five_hour_full_at_ms: epochMs.nullable(),
1916
2037
  weekly_full_at_ms: epochMs.nullable(),
1917
2038
  /** The reading is too old to project. */
1918
- stale: z26.boolean()
2039
+ stale: z27.boolean()
1919
2040
  });
1920
- var SpendModel = z26.strictObject({ model: z26.string().max(120), name: z26.string().max(120), spend: SpendScopes });
1921
- var SpendChat = z26.strictObject({
2041
+ var SpendModel = z27.strictObject({ model: z27.string().max(120), name: z27.string().max(120), spend: SpendScopes });
2042
+ var SpendChat = z27.strictObject({
1922
2043
  id: ChatId,
1923
- title: z26.string().max(1e3),
1924
- repo: z26.string().max(200).nullable(),
1925
- window: z26.string().max(64).nullable(),
2044
+ title: z27.string().max(1e3),
2045
+ repo: z27.string().max(200).nullable(),
2046
+ window: z27.string().max(64).nullable(),
1926
2047
  spend: SpendScopes,
1927
2048
  helpers: nonNegInt
1928
2049
  });
1929
- var SpendHelper = z26.strictObject({ model: z26.string().max(120), steps: nonNegInt, over_steps: z26.boolean(), description: z26.string().max(400) });
1930
- var SpendLive = z26.strictObject({ id: ChatId, title: z26.string().max(1e3), window: z26.string().max(64).nullable(), helpers: z26.array(SpendHelper).max(200) });
1931
- var SpendIdleScope = z26.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: z26.number(), avoidable: z26.number() });
1932
- var SpendIdle = z26.strictObject({ id: ChatId, chat: z26.string().max(1e3), who: z26.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
1933
- var SpendStart = z26.strictObject({ repo: z26.string().max(200), count: nonNegInt, median: nonNegInt, latest: z26.array(nonNegInt).max(20), alarm: z26.string().max(400).nullable() });
1934
- var AppsSpendParams = z26.strictObject({ app_key: AppKey });
1935
- var AppsSpendResult = z26.strictObject({
2050
+ var SpendHelper = z27.strictObject({ model: z27.string().max(120), steps: nonNegInt, over_steps: z27.boolean(), description: z27.string().max(400) });
2051
+ var SpendLive = z27.strictObject({ id: ChatId, title: z27.string().max(1e3), window: z27.string().max(64).nullable(), helpers: z27.array(SpendHelper).max(200) });
2052
+ var SpendIdleScope = z27.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: z27.number(), avoidable: z27.number() });
2053
+ var SpendIdle = z27.strictObject({ id: ChatId, chat: z27.string().max(1e3), who: z27.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
2054
+ var SpendStart = z27.strictObject({ repo: z27.string().max(200), count: nonNegInt, median: nonNegInt, latest: z27.array(nonNegInt).max(20), alarm: z27.string().max(400).nullable() });
2055
+ var AppsSpendParams = z27.strictObject({ app_key: AppKey });
2056
+ var AppsSpendResult = z27.strictObject({
1936
2057
  app_key: AppKey,
1937
2058
  /** False while older chats are still being read. */
1938
- complete: z26.boolean(),
1939
- today_total: z26.number(),
1940
- week_total: z26.number(),
1941
- idle_today: z26.number(),
1942
- idle_week: z26.number(),
2059
+ complete: z27.boolean(),
2060
+ today_total: z27.number(),
2061
+ week_total: z27.number(),
2062
+ idle_today: z27.number(),
2063
+ idle_week: z27.number(),
1943
2064
  /** Models with no known list price. */
1944
- unpriced: z26.array(z26.string().max(120)).max(100),
2065
+ unpriced: z27.array(z27.string().max(120)).max(100),
1945
2066
  /** Helpers past their step budget, unusual starting sizes. */
1946
- alarms: z26.array(z26.string().max(400)).max(200),
1947
- live: z26.array(SpendLive).max(200),
1948
- accounts: z26.array(SpendAccount).max(200),
1949
- models: z26.array(SpendModel).max(100),
1950
- chats: z26.array(SpendChat).max(500),
1951
- idle: z26.array(SpendIdle).max(500),
1952
- starts: z26.array(SpendStart).max(200)
1953
- });
1954
- var AppsSyncStatusParams = z26.strictObject({ app_key: AppKey });
1955
- var AppsSyncStatusResult = z26.strictObject({
1956
- healthy: z26.boolean(),
1957
- summary: z26.string().max(400),
1958
- problems: z26.array(z26.string().max(400)).max(200),
1959
- warnings: z26.array(z26.string().max(400)).max(200),
2067
+ alarms: z27.array(z27.string().max(400)).max(200),
2068
+ live: z27.array(SpendLive).max(200),
2069
+ accounts: z27.array(SpendAccount).max(200),
2070
+ models: z27.array(SpendModel).max(100),
2071
+ chats: z27.array(SpendChat).max(500),
2072
+ idle: z27.array(SpendIdle).max(500),
2073
+ starts: z27.array(SpendStart).max(200)
2074
+ });
2075
+ var AppsSyncStatusParams = z27.strictObject({ app_key: AppKey });
2076
+ var AppsSyncStatusResult = z27.strictObject({
2077
+ healthy: z27.boolean(),
2078
+ summary: z27.string().max(400),
2079
+ problems: z27.array(z27.string().max(400)).max(200),
2080
+ warnings: z27.array(z27.string().max(400)).max(200),
1960
2081
  /** Accounts seen with no saved name yet (Save account names fixes them). */
1961
- unnamed_accounts: z26.array(z26.string().max(80)).max(200),
2082
+ unnamed_accounts: z27.array(z27.string().max(80)).max(200),
1962
2083
  /** The full report. */
1963
- output: z26.string().max(2e5)
2084
+ output: z27.string().max(2e5)
1964
2085
  });
1965
- var AppsSyncRunParams = z26.strictObject({ app_key: AppKey });
1966
- var AppsWindowsProcessesParams = z26.strictObject({ app_key: AppKey });
1967
- var AppsWindowsProcessesResult = z26.strictObject({ processes: z26.array(z26.string().max(2e3)).max(2e3) });
1968
- var AppsWindowsAddParams = z26.strictObject({ app_key: AppKey, window: ChatPlace, email: z26.string().min(3).max(320) });
1969
- var AppsWindowsSaveNamesParams = z26.strictObject({ app_key: AppKey });
2086
+ var AppsSyncRunParams = z27.strictObject({ app_key: AppKey });
2087
+ var AppsWindowsProcessesParams = z27.strictObject({ app_key: AppKey });
2088
+ var AppsWindowsProcessesResult = z27.strictObject({ processes: z27.array(z27.string().max(2e3)).max(2e3) });
2089
+ var AppsWindowsAddParams = z27.strictObject({ app_key: AppKey, window: ChatPlace, email: z27.string().min(3).max(320) });
2090
+ var AppsWindowsSaveNamesParams = z27.strictObject({ app_key: AppKey });
1970
2091
 
1971
2092
  // src/schema/registry.ts
1972
2093
  var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
@@ -2025,6 +2146,7 @@ var OPS = {
2025
2146
  "apps.projects.move": { params: AppsProjectsMoveParams, result: AppsProjectsMoveResult, kind: "unary", since: "1.10", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2026
2147
  "apps.projects.create": { params: AppsProjectsCreateParams, result: AppsProjectsCreateResult, kind: "unary", since: "1.10", errors: ["INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2027
2148
  "apps.projects.import_pins": { params: AppsProjectsImportPinsParams, result: AppsProjectsImportPinsResult, kind: "unary", since: "1.10", errors: ["CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2149
+ "apps.projects.to_window": { params: AppsProjectsToWindowParams, result: AppsProjectsToWindowResult, kind: "unary", since: "1.19", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2028
2150
  // 1.11: Going cold, Spend, sync health, windows upkeep.
2029
2151
  "apps.chats.cold": { params: AppsChatsColdParams, result: AppsChatsColdResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2030
2152
  "apps.chats.open": { params: AppsChatsOpenParams, result: AppsWindowActionResult, kind: "unary", since: "1.11", errors: ["NOT_FOUND", "CONFLICT", "TIMEOUT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
@@ -2075,6 +2197,9 @@ var OPS = {
2075
2197
  "stack.server.action": { params: StackServerActionParams, result: StackServerActionResult, kind: "unary", since: "1.16", errors: ["NOT_FOUND", "CONFLICT", "INTERNAL"] },
2076
2198
  "stack.logs": { params: StackLogsParams, result: StackLogsResult, kind: "unary", since: "1.16", errors: ["NOT_FOUND", "INTERNAL"] },
2077
2199
  "stack.errors": { params: StackErrorsParams, result: StackErrorsResult, kind: "unary", since: "1.16", errors: ["INTERNAL"] },
2200
+ // The device's error ledger (SPEC §3.12): every process's errors, grouped, delivered to ops.system_error.
2201
+ "diag.errors.list": { params: DiagErrorsListParams, result: DiagErrorsListResult, kind: "unary", since: "1.20", errors: ["INTERNAL"] },
2202
+ "diag.errors.report": { params: DiagErrorsReportParams, result: DiagErrorsReportResult, kind: "unary", since: "1.20", errors: ["INTERNAL"] },
2078
2203
  // Claude Code history (SPEC §6 coding): served by the `coding` Python service through SERVICES below.
2079
2204
  "coding.history.import_missing": { params: CodingHistoryImportMissingParams, result: CodingHistoryImportMissingResult, kind: "unary", since: "1.5", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "CANCELLED", "INTERNAL"] }
2080
2205
  };
@@ -2089,7 +2214,8 @@ var EVENTS = {
2089
2214
  "models.progress": ModelsProgressEvent,
2090
2215
  "coding.history.progress": CodingHistoryProgressEvent,
2091
2216
  "relay.device_status": RelayDeviceStatusEvent,
2092
- "relay.auth_expiring": RelayAuthExpiringEvent
2217
+ "relay.auth_expiring": RelayAuthExpiringEvent,
2218
+ "diag.errors.changed": DiagErrorsChangedEvent
2093
2219
  };
2094
2220
 
2095
2221
  // src/client/client.ts