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