@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/CHANGELOG.md +13 -0
- package/dist/client.cjs +468 -342
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +468 -342
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +347 -191
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +267 -6
- package/dist/index.d.ts +267 -6
- package/dist/index.js +347 -191
- package/dist/index.js.map +1 -1
- package/dist/{models-BOPMXUz-.d.cts → models-Cz3I_rBU.d.cts} +362 -1
- package/dist/{models-BOPMXUz-.d.ts → models-Cz3I_rBU.d.ts} +362 -1
- package/dist/react.d.cts +142 -0
- package/dist/react.d.ts +142 -0
- package/generated/desktop-protocol.schema.json +537 -2
- package/package.json +1 -1
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 =
|
|
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/
|
|
1307
|
+
// src/schema/diag.ts
|
|
1308
1308
|
var import_zod20 = require("zod");
|
|
1309
|
-
var
|
|
1310
|
-
|
|
1311
|
-
|
|
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:
|
|
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:
|
|
1397
|
+
sentence: import_zod21.z.string().max(2e3),
|
|
1318
1398
|
/** The config's own description of the server. */
|
|
1319
|
-
description:
|
|
1399
|
+
description: import_zod21.z.string().max(512),
|
|
1320
1400
|
/** Where the server answers, when its description names an address. */
|
|
1321
|
-
open_url:
|
|
1322
|
-
log_file:
|
|
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:
|
|
1328
|
-
pid:
|
|
1329
|
-
|
|
1330
|
-
|
|
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:
|
|
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:
|
|
1336
|
-
text:
|
|
1419
|
+
kind: import_zod21.z.string().max(32),
|
|
1420
|
+
text: import_zod21.z.string().max(4e3)
|
|
1337
1421
|
});
|
|
1338
|
-
var StackStateParams =
|
|
1339
|
-
var StackStateResult =
|
|
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:
|
|
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:
|
|
1344
|
-
stack_up:
|
|
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:
|
|
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:
|
|
1432
|
+
setup_note: import_zod21.z.string().max(500).nullable(),
|
|
1349
1433
|
/** Start everything / Stop everything in flight. */
|
|
1350
|
-
pending:
|
|
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:
|
|
1436
|
+
events: import_zod21.z.array(StackEvent).max(300)
|
|
1353
1437
|
});
|
|
1354
|
-
var StackStartParams =
|
|
1355
|
-
var StackStopParams =
|
|
1356
|
-
var StackRunResult =
|
|
1357
|
-
var StackServerActionParams =
|
|
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:
|
|
1443
|
+
verb: import_zod21.z.enum(["start", "stop", "restart"])
|
|
1360
1444
|
});
|
|
1361
|
-
var StackServerActionResult =
|
|
1362
|
-
var StackLogsParams =
|
|
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:
|
|
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:
|
|
1455
|
+
wait_ms: import_zod21.z.int().min(0).max(25e3).default(0)
|
|
1372
1456
|
});
|
|
1373
|
-
var StackLogsResult =
|
|
1457
|
+
var StackLogsResult = import_zod21.z.strictObject({
|
|
1374
1458
|
/** Complete lines, colour codes removed. */
|
|
1375
|
-
lines:
|
|
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:
|
|
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:
|
|
1382
|
-
log_file:
|
|
1465
|
+
reset: import_zod21.z.boolean(),
|
|
1466
|
+
log_file: import_zod21.z.string().max(4096)
|
|
1383
1467
|
});
|
|
1384
|
-
var StackErrorsParams =
|
|
1385
|
-
window_minutes:
|
|
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 =
|
|
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:
|
|
1390
|
-
window_minutes:
|
|
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
|
|
1395
|
-
var FsWatchId =
|
|
1396
|
-
var FsWatchStartParams =
|
|
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:
|
|
1482
|
+
recursive: import_zod22.z.boolean().default(true),
|
|
1399
1483
|
/** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
|
|
1400
|
-
ignore:
|
|
1484
|
+
ignore: import_zod22.z.array(import_zod22.z.string().max(256)).max(64).default([])
|
|
1401
1485
|
});
|
|
1402
|
-
var FsWatchStartResult =
|
|
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 =
|
|
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:
|
|
1495
|
+
wait_ms: import_zod22.z.int().min(0).max(25e3).default(0)
|
|
1412
1496
|
});
|
|
1413
|
-
var FsWatchEventsResult =
|
|
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:
|
|
1499
|
+
changes: import_zod22.z.array(FsChange).max(1e3),
|
|
1416
1500
|
/** Changes were dropped (more than 1000 waited): list the folder again. */
|
|
1417
|
-
overflow:
|
|
1501
|
+
overflow: import_zod22.z.boolean(),
|
|
1418
1502
|
expires_at_ms: epochMs
|
|
1419
1503
|
});
|
|
1420
|
-
var FsWatchStopParams =
|
|
1421
|
-
var FsWatchStopResult =
|
|
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
|
|
1425
|
-
var ExecJobId =
|
|
1426
|
-
var ExecJobStartParams =
|
|
1427
|
-
command:
|
|
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:
|
|
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 =
|
|
1433
|
-
var ExecJobOutputParams =
|
|
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:
|
|
1439
|
-
max_bytes:
|
|
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 =
|
|
1525
|
+
var ExecJobOutputResult = import_zod23.z.strictObject({
|
|
1442
1526
|
/** stdout and stderr interleaved as they arrived (UTF-8). */
|
|
1443
|
-
output:
|
|
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:
|
|
1448
|
-
exit_code:
|
|
1531
|
+
running: import_zod23.z.boolean(),
|
|
1532
|
+
exit_code: import_zod23.z.int().nullable()
|
|
1449
1533
|
});
|
|
1450
|
-
var ExecJobStopParams =
|
|
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:
|
|
1537
|
+
force: import_zod23.z.boolean().default(false)
|
|
1454
1538
|
});
|
|
1455
|
-
var ExecJobStopResult =
|
|
1456
|
-
var ExecJobInfo =
|
|
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:
|
|
1459
|
-
pid:
|
|
1542
|
+
command: import_zod23.z.string().max(1024),
|
|
1543
|
+
pid: import_zod23.z.int().min(1),
|
|
1460
1544
|
cwd: AbsPath,
|
|
1461
|
-
running:
|
|
1462
|
-
exit_code:
|
|
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 =
|
|
1467
|
-
var ExecJobListResult =
|
|
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
|
|
1554
|
+
var import_zod24 = require("zod");
|
|
1471
1555
|
var import_uuid2 = require("@ai-matrx/kit/uuid");
|
|
1472
|
-
var CodingServiceCredentials =
|
|
1473
|
-
access_token:
|
|
1474
|
-
user_id:
|
|
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:
|
|
1560
|
+
server_url: import_zod24.z.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
|
|
1477
1561
|
});
|
|
1478
|
-
var CodingHistoryBlocked =
|
|
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 =
|
|
1487
|
-
session_id:
|
|
1488
|
-
reason:
|
|
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 =
|
|
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:
|
|
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:
|
|
1593
|
+
summary: import_zod24.z.string().max(400)
|
|
1510
1594
|
});
|
|
1511
|
-
var CodingHistoryStep =
|
|
1595
|
+
var CodingHistoryStep = import_zod24.z.strictObject({
|
|
1512
1596
|
/** Null when the run could not start (blocked before a plan existed). */
|
|
1513
|
-
plan_id:
|
|
1514
|
-
finished:
|
|
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 =
|
|
1519
|
-
var CodingImportNextParams =
|
|
1520
|
-
plan_id:
|
|
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 =
|
|
1524
|
-
phase:
|
|
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 =
|
|
1529
|
-
var CodingHistoryImportMissingResult =
|
|
1530
|
-
state:
|
|
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 =
|
|
1619
|
+
var CodingHistoryProgressEvent = import_zod24.z.strictObject({
|
|
1536
1620
|
request_id: RequestId,
|
|
1537
|
-
phase:
|
|
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
|
|
1630
|
+
var import_zod25 = require("zod");
|
|
1547
1631
|
var import_uuid3 = require("@ai-matrx/kit/uuid");
|
|
1548
|
-
var AppKey =
|
|
1549
|
-
var AppProfileId =
|
|
1550
|
-
var AppProfileLocator =
|
|
1551
|
-
var AppSupport =
|
|
1552
|
-
var AppFeatureStatus =
|
|
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:
|
|
1639
|
+
reason: import_zod25.z.string().max(140).nullable()
|
|
1556
1640
|
});
|
|
1557
|
-
var AppInfo =
|
|
1641
|
+
var AppInfo = import_zod25.z.strictObject({
|
|
1558
1642
|
app_key: AppKey,
|
|
1559
|
-
name:
|
|
1560
|
-
installed:
|
|
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:
|
|
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 =
|
|
1573
|
-
window:
|
|
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:
|
|
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:
|
|
1663
|
+
reset_since: import_zod25.z.boolean()
|
|
1580
1664
|
});
|
|
1581
|
-
var AppProfile =
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
1682
|
+
usage: import_zod25.z.array(AppUsageReading).nullable(),
|
|
1599
1683
|
last_opened_ms: epochMs.nullable()
|
|
1600
1684
|
});
|
|
1601
|
-
var AppsListParams =
|
|
1602
|
-
var AppsListResult =
|
|
1603
|
-
var AppsProfilesListParams =
|
|
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 =
|
|
1608
|
-
profiles:
|
|
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:
|
|
1697
|
+
registry: import_zod25.z.enum(["ok", "signed_out", "unavailable"])
|
|
1614
1698
|
});
|
|
1615
|
-
var AppsProfilesSaveParams =
|
|
1699
|
+
var AppsProfilesSaveParams = import_zod25.z.strictObject({
|
|
1616
1700
|
id: AppProfileId.optional(),
|
|
1617
1701
|
app_key: AppKey,
|
|
1618
|
-
display_name:
|
|
1619
|
-
account_identity:
|
|
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:
|
|
1707
|
+
new_folder: import_zod25.z.boolean().default(false)
|
|
1624
1708
|
});
|
|
1625
1709
|
var AppsProfilesSaveResult = AppProfile;
|
|
1626
|
-
var AppsProfilesRemoveParams =
|
|
1627
|
-
var AppsProfilesRemoveResult =
|
|
1628
|
-
var AppsOpenParams =
|
|
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 =
|
|
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:
|
|
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
|
|
1640
|
-
var ChatId =
|
|
1641
|
-
var ChatPlace =
|
|
1642
|
-
var ChatProjectId =
|
|
1643
|
-
var ChatWindow =
|
|
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:
|
|
1730
|
+
main: import_zod26.z.boolean(),
|
|
1647
1731
|
/** The account the window is signed into, when known. */
|
|
1648
|
-
account:
|
|
1732
|
+
account: import_zod26.z.string().max(320).nullable()
|
|
1649
1733
|
});
|
|
1650
|
-
var ChatProject =
|
|
1734
|
+
var ChatProject = import_zod26.z.strictObject({
|
|
1651
1735
|
id: ChatProjectId,
|
|
1652
|
-
name:
|
|
1653
|
-
archived:
|
|
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 =
|
|
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:
|
|
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 =
|
|
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:
|
|
1750
|
+
how: import_zod26.z.enum(["process", "activity"])
|
|
1667
1751
|
});
|
|
1668
|
-
var ChatHidden =
|
|
1752
|
+
var ChatHidden = import_zod26.z.strictObject({
|
|
1669
1753
|
window: ChatPlace,
|
|
1670
|
-
reason:
|
|
1754
|
+
reason: import_zod26.z.string().max(200)
|
|
1671
1755
|
});
|
|
1672
|
-
var ChatLastUse =
|
|
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:
|
|
1760
|
+
account: import_zod26.z.string().max(320).nullable(),
|
|
1677
1761
|
/** How the window was decided (one short line). */
|
|
1678
|
-
how:
|
|
1762
|
+
how: import_zod26.z.string().max(120).nullable(),
|
|
1679
1763
|
/** The account's 1-hour prompt cache is still warm. */
|
|
1680
|
-
cache_warm:
|
|
1764
|
+
cache_warm: import_zod26.z.boolean(),
|
|
1681
1765
|
cache_minutes_left: nonNegInt
|
|
1682
1766
|
});
|
|
1683
|
-
var ChatAppProject =
|
|
1684
|
-
id:
|
|
1685
|
-
name:
|
|
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 =
|
|
1688
|
-
var ChatRow =
|
|
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:
|
|
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:
|
|
1694
|
-
title:
|
|
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:
|
|
1698
|
-
starred:
|
|
1699
|
-
pinned_in:
|
|
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:
|
|
1702
|
-
held:
|
|
1703
|
-
running:
|
|
1704
|
-
hidden_in:
|
|
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:
|
|
1790
|
+
hidden_from_main: import_zod26.z.boolean(),
|
|
1707
1791
|
/** Listed in a side window and not yet copied into main. */
|
|
1708
|
-
main_pending:
|
|
1792
|
+
main_pending: import_zod26.z.boolean(),
|
|
1709
1793
|
/** A scheduled routine's run (its task id). */
|
|
1710
|
-
scheduled:
|
|
1794
|
+
scheduled: import_zod26.z.string().max(200).nullable(),
|
|
1711
1795
|
/** Created recently and in no project: offered for filing. */
|
|
1712
|
-
new_unfiled:
|
|
1713
|
-
warnings:
|
|
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:
|
|
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:
|
|
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:
|
|
1813
|
+
archived: import_zod26.z.boolean().optional()
|
|
1730
1814
|
});
|
|
1731
|
-
var ChatFamily =
|
|
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 =
|
|
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:
|
|
1823
|
+
ids: import_zod26.z.array(ChatId).max(500).optional()
|
|
1740
1824
|
});
|
|
1741
|
-
var AppsChatsListResult =
|
|
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:
|
|
1746
|
-
projects:
|
|
1747
|
-
chats:
|
|
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:
|
|
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:
|
|
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:
|
|
1839
|
+
families: import_zod26.z.array(ChatFamily).max(2e4).optional()
|
|
1756
1840
|
});
|
|
1757
|
-
var AppsChatsWatchParams =
|
|
1758
|
-
var AppsChatsWatchResult =
|
|
1759
|
-
var AppsChatsChangedEvent =
|
|
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:
|
|
1763
|
-
all:
|
|
1846
|
+
ids: import_zod26.z.array(ChatId).max(1e3),
|
|
1847
|
+
all: import_zod26.z.boolean()
|
|
1764
1848
|
});
|
|
1765
|
-
var AppsChatsWatchStateEvent =
|
|
1849
|
+
var AppsChatsWatchStateEvent = import_zod26.z.strictObject({
|
|
1766
1850
|
app_key: AppKey,
|
|
1767
|
-
live:
|
|
1768
|
-
updating:
|
|
1769
|
-
reason:
|
|
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 =
|
|
1855
|
+
var AppsChatsPlaceParams = import_zod26.z.strictObject({
|
|
1772
1856
|
app_key: AppKey,
|
|
1773
1857
|
chat_id: ChatId,
|
|
1774
|
-
action:
|
|
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:
|
|
1862
|
+
stop_if_open: import_zod26.z.boolean().default(false)
|
|
1779
1863
|
});
|
|
1780
|
-
var AppsChatsPlaceResult =
|
|
1781
|
-
var AppsProjectsFileManyParams =
|
|
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:
|
|
1867
|
+
chat_ids: import_zod26.z.array(ChatId).min(1).max(500),
|
|
1784
1868
|
project_id: ChatProjectId.optional(),
|
|
1785
|
-
new_project_name:
|
|
1869
|
+
new_project_name: import_zod26.z.string().min(1).max(200).optional()
|
|
1786
1870
|
});
|
|
1787
|
-
var AppsProjectsFileManyResult =
|
|
1788
|
-
var AppsProjectsUpdateParams =
|
|
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:
|
|
1792
|
-
archived:
|
|
1875
|
+
name: import_zod26.z.string().min(1).max(200).optional(),
|
|
1876
|
+
archived: import_zod26.z.boolean().optional()
|
|
1793
1877
|
});
|
|
1794
|
-
var AppsProjectsUpdateResult =
|
|
1795
|
-
var AppsProjectsCopyParams =
|
|
1796
|
-
var AppsProjectsCopyResult =
|
|
1797
|
-
var AppsProjectsFileParams =
|
|
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:
|
|
1885
|
+
new_project_name: import_zod26.z.string().min(1).max(200).optional()
|
|
1802
1886
|
});
|
|
1803
|
-
var AppsProjectsFileResult =
|
|
1804
|
-
var AppsProjectsUnfileParams =
|
|
1805
|
-
var AppsProjectsUnfileResult =
|
|
1806
|
-
var AppsChatsStarParams =
|
|
1807
|
-
var AppsChatsStarResult =
|
|
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
|
|
1811
|
-
var AppWindowInfo =
|
|
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:
|
|
1898
|
+
main: import_zod27.z.boolean(),
|
|
1815
1899
|
/** The account the window is meant for (null for main). */
|
|
1816
|
-
account:
|
|
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:
|
|
1819
|
-
signed_in_is_email:
|
|
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:
|
|
1905
|
+
mismatch: import_zod27.z.boolean(),
|
|
1822
1906
|
/** Its folder exists. */
|
|
1823
|
-
created:
|
|
1907
|
+
created: import_zod27.z.boolean(),
|
|
1824
1908
|
/** Open now. */
|
|
1825
|
-
running:
|
|
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 =
|
|
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:
|
|
1832
|
-
org:
|
|
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:
|
|
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:
|
|
1837
|
-
five_hour_reset_since:
|
|
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:
|
|
1840
|
-
weekly_reset_since:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
1940
|
+
credits: import_zod27.z.string().max(40).optional()
|
|
1857
1941
|
});
|
|
1858
|
-
var AccountReset =
|
|
1942
|
+
var AccountReset = import_zod27.z.strictObject({
|
|
1859
1943
|
window: ChatPlace,
|
|
1860
|
-
account:
|
|
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:
|
|
1947
|
+
source: import_zod27.z.enum(["claude", "usage_history", "your_list"]).nullable(),
|
|
1864
1948
|
/** claude or usage_history. */
|
|
1865
|
-
official:
|
|
1949
|
+
official: import_zod27.z.boolean(),
|
|
1866
1950
|
/** Set when the person's list disagrees with the official time. */
|
|
1867
|
-
note:
|
|
1951
|
+
note: import_zod27.z.string().max(200).nullable()
|
|
1868
1952
|
});
|
|
1869
|
-
var AppsWindowsListParams =
|
|
1870
|
-
var AppsWindowsListResult =
|
|
1871
|
-
var AppsAccountsUsageParams =
|
|
1872
|
-
var AppsAccountsUsageResult =
|
|
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:
|
|
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:
|
|
1960
|
+
problem: import_zod27.z.string().max(400).optional()
|
|
1877
1961
|
});
|
|
1878
|
-
var AppsAccountsResetsParams =
|
|
1879
|
-
var AppsAccountsResetsResult =
|
|
1962
|
+
var AppsAccountsResetsParams = import_zod27.z.strictObject({ app_key: AppKey });
|
|
1963
|
+
var AppsAccountsResetsResult = import_zod27.z.strictObject({
|
|
1880
1964
|
app_key: AppKey,
|
|
1881
|
-
resets:
|
|
1965
|
+
resets: import_zod27.z.array(AccountReset).max(200),
|
|
1882
1966
|
/** 1.12: as on `apps.accounts.usage`. */
|
|
1883
|
-
problem:
|
|
1884
|
-
});
|
|
1885
|
-
var AppsWindowActionResult =
|
|
1886
|
-
var AppsWindowsOpenParams =
|
|
1887
|
-
var AppsWindowsReloadParams =
|
|
1888
|
-
var AppsWindowsRestartParams =
|
|
1889
|
-
var AppsWindowsRefreshUsageParams =
|
|
1890
|
-
var AppsProjectsMoveParams =
|
|
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:
|
|
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
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
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:
|
|
1905
|
-
repo:
|
|
1906
|
-
window:
|
|
1907
|
-
account:
|
|
1908
|
-
model_name:
|
|
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:
|
|
2033
|
+
cold_cost: import_zod27.z.number().nullable(),
|
|
1913
2034
|
/** Waking it while the cache is warm. */
|
|
1914
|
-
warm_cost:
|
|
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:
|
|
2037
|
+
extra_usage: import_zod27.z.boolean(),
|
|
1917
2038
|
/** A scheduled routine's run. */
|
|
1918
|
-
scheduled:
|
|
2039
|
+
scheduled: import_zod27.z.boolean(),
|
|
1919
2040
|
/** It can be shown in its window (started in the desktop app). */
|
|
1920
|
-
openable:
|
|
2041
|
+
openable: import_zod27.z.boolean(),
|
|
1921
2042
|
/** How its window was decided, or why it can't be opened. */
|
|
1922
|
-
how:
|
|
2043
|
+
how: import_zod27.z.string().max(200).nullable()
|
|
1923
2044
|
});
|
|
1924
|
-
var AppsChatsColdParams =
|
|
1925
|
-
var AppsChatsColdResult =
|
|
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:
|
|
2049
|
+
waiting: import_zod27.z.array(ColdChat).max(2e3),
|
|
1929
2050
|
/** Went cold in the last while. */
|
|
1930
|
-
recently_cold:
|
|
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 =
|
|
1935
|
-
var SpendSplit =
|
|
1936
|
-
var SpendScopes =
|
|
1937
|
-
var SpendAccount =
|
|
1938
|
-
account:
|
|
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:
|
|
1941
|
-
last_5h:
|
|
1942
|
-
five_hour:
|
|
1943
|
-
weekly:
|
|
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:
|
|
2071
|
+
stale: import_zod27.z.boolean()
|
|
1951
2072
|
});
|
|
1952
|
-
var SpendModel =
|
|
1953
|
-
var SpendChat =
|
|
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:
|
|
1956
|
-
repo:
|
|
1957
|
-
window:
|
|
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 =
|
|
1962
|
-
var SpendLive =
|
|
1963
|
-
var SpendIdleScope =
|
|
1964
|
-
var SpendIdle =
|
|
1965
|
-
var SpendStart =
|
|
1966
|
-
var AppsSpendParams =
|
|
1967
|
-
var AppsSpendResult =
|
|
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:
|
|
1971
|
-
today_total:
|
|
1972
|
-
week_total:
|
|
1973
|
-
idle_today:
|
|
1974
|
-
idle_week:
|
|
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:
|
|
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:
|
|
1979
|
-
live:
|
|
1980
|
-
accounts:
|
|
1981
|
-
models:
|
|
1982
|
-
chats:
|
|
1983
|
-
idle:
|
|
1984
|
-
starts:
|
|
1985
|
-
});
|
|
1986
|
-
var AppsSyncStatusParams =
|
|
1987
|
-
var AppsSyncStatusResult =
|
|
1988
|
-
healthy:
|
|
1989
|
-
summary:
|
|
1990
|
-
problems:
|
|
1991
|
-
warnings:
|
|
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:
|
|
2114
|
+
unnamed_accounts: import_zod27.z.array(import_zod27.z.string().max(80)).max(200),
|
|
1994
2115
|
/** The full report. */
|
|
1995
|
-
output:
|
|
2116
|
+
output: import_zod27.z.string().max(2e5)
|
|
1996
2117
|
});
|
|
1997
|
-
var AppsSyncRunParams =
|
|
1998
|
-
var AppsWindowsProcessesParams =
|
|
1999
|
-
var AppsWindowsProcessesResult =
|
|
2000
|
-
var AppsWindowsAddParams =
|
|
2001
|
-
var AppsWindowsSaveNamesParams =
|
|
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
|