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