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