@ai-matrx/desktop-protocol 0.17.11 → 0.17.13
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 +15 -0
- package/dist/client.cjs +507 -298
- 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 +507 -298
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +352 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +395 -8
- package/dist/index.d.ts +395 -8
- package/dist/index.js +352 -83
- package/dist/index.js.map +1 -1
- package/dist/{models-dIUgWoHB.d.cts → models-BOPMXUz-.d.cts} +591 -1
- package/dist/{models-dIUgWoHB.d.ts → models-BOPMXUz-.d.ts} +591 -1
- package/dist/react.d.cts +251 -0
- package/dist/react.d.ts +251 -0
- package/generated/desktop-protocol.schema.json +1215 -97
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -143,7 +143,7 @@ var import_zod2 = require("zod");
|
|
|
143
143
|
// src/schema/primitives.ts
|
|
144
144
|
var import_zod = require("zod");
|
|
145
145
|
var PROTOCOL_MAJOR = 1;
|
|
146
|
-
var PROTOCOL_MINOR =
|
|
146
|
+
var PROTOCOL_MINOR = 17;
|
|
147
147
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
148
148
|
var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
149
149
|
var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -1169,6 +1169,8 @@ var import_zod19 = require("zod");
|
|
|
1169
1169
|
var ResourcesDisk = import_zod19.z.strictObject({
|
|
1170
1170
|
/** Where it is mounted ("/", "C:"). */
|
|
1171
1171
|
mount: import_zod19.z.string().max(512),
|
|
1172
|
+
/** The volume's name as the file manager shows it ("Macintosh HD", "Local Disk (C:)"). Since 1.17. */
|
|
1173
|
+
name: import_zod19.z.string().max(256).optional(),
|
|
1172
1174
|
/** The file system ("apfs", "NTFS", "ext4"). */
|
|
1173
1175
|
fs: import_zod19.z.string().max(64),
|
|
1174
1176
|
size_bytes: nonNegInt,
|
|
@@ -1189,92 +1191,289 @@ var ResourcesSnapshotResult = import_zod19.z.strictObject({
|
|
|
1189
1191
|
disks: import_zod19.z.array(ResourcesDisk).max(64),
|
|
1190
1192
|
uptime_seconds: nonNegInt
|
|
1191
1193
|
});
|
|
1194
|
+
var ResourcesJobKind = import_zod19.z.enum(["type-check", "tests", "build", "lint", "dev server", "language server", "search"]);
|
|
1195
|
+
var ResourcesStrain = import_zod19.z.enum(["good", "strain", "overloaded"]);
|
|
1196
|
+
var ResourcesPressure = import_zod19.z.enum(["normal", "warning", "critical"]);
|
|
1197
|
+
var ResourcesJob = import_zod19.z.strictObject({
|
|
1198
|
+
/** The job's root process (Stop takes its whole tree). */
|
|
1199
|
+
pid: import_zod19.z.int().min(0),
|
|
1200
|
+
kind: ResourcesJobKind,
|
|
1201
|
+
/** Its heaviest process's command line, shortened ("…/lib/tsc --noEmit -p tsconfig.json"). */
|
|
1202
|
+
command: import_zod19.z.string().max(256),
|
|
1203
|
+
/** Who started it: "Claude Code", "Codex", "Cursor", "VS Code", "Terminal", "local stack", "detached"; null when unknown. */
|
|
1204
|
+
started_by: import_zod19.z.string().max(64).nullable(),
|
|
1205
|
+
/** Whatever started it is gone and nothing waits for it. */
|
|
1206
|
+
orphan: import_zod19.z.boolean(),
|
|
1207
|
+
/** A type-check queued for its turn (no compiler running yet). */
|
|
1208
|
+
waiting: import_zod19.z.boolean(),
|
|
1209
|
+
/** The project folder it runs in ("matrx-frontend"); null when not in one. */
|
|
1210
|
+
folder: import_zod19.z.string().max(256).nullable(),
|
|
1211
|
+
/** The same command in the same folder, running this many times (1 = no duplicate). */
|
|
1212
|
+
duplicates: import_zod19.z.int().min(1),
|
|
1213
|
+
processes: import_zod19.z.int().min(1),
|
|
1214
|
+
/** Sum over the tree, as `ps` reports it: 100 = one full core. */
|
|
1215
|
+
cpu_percent: import_zod19.z.number().min(0),
|
|
1216
|
+
/** Real memory (macOS: the physical footprint Activity Monitor shows, compressed included). */
|
|
1217
|
+
memory_bytes: nonNegInt,
|
|
1218
|
+
started_at_ms: epochMs.nullable(),
|
|
1219
|
+
/** False for an app, an agent session, a terminal, a system process, the local stack or Matrx 2 itself. */
|
|
1220
|
+
stoppable: import_zod19.z.boolean()
|
|
1221
|
+
});
|
|
1222
|
+
var ResourcesProcess = import_zod19.z.strictObject({
|
|
1223
|
+
pid: import_zod19.z.int().min(0),
|
|
1224
|
+
/** The command line, shortened. */
|
|
1225
|
+
name: import_zod19.z.string().max(256),
|
|
1226
|
+
cpu_percent: import_zod19.z.number().min(0),
|
|
1227
|
+
memory_bytes: nonNegInt,
|
|
1228
|
+
started_by: import_zod19.z.string().max(64).nullable(),
|
|
1229
|
+
/** The job it belongs to ("type-check in aidream"); null when none. */
|
|
1230
|
+
job: import_zod19.z.string().max(256).nullable(),
|
|
1231
|
+
started_at_ms: epochMs.nullable()
|
|
1232
|
+
});
|
|
1233
|
+
var ResourcesVerdict = import_zod19.z.strictObject({
|
|
1234
|
+
level: ResourcesStrain,
|
|
1235
|
+
/** One sentence ("Your Mac is under strain. 3 type-checks are running at once."). */
|
|
1236
|
+
text: import_zod19.z.string().max(256),
|
|
1237
|
+
/** The biggest jobs behind it; null when all is well. */
|
|
1238
|
+
cause: import_zod19.z.string().max(1024).nullable()
|
|
1239
|
+
});
|
|
1240
|
+
var ResourcesSample = import_zod19.z.strictObject({
|
|
1241
|
+
at_ms: epochMs,
|
|
1242
|
+
/** The 1-minute load average. */
|
|
1243
|
+
load: import_zod19.z.number().min(0),
|
|
1244
|
+
memory_used_bytes: nonNegInt,
|
|
1245
|
+
typechecks: nonNegInt
|
|
1246
|
+
});
|
|
1247
|
+
var ResourcesActivityParams = import_zod19.z.strictObject({});
|
|
1248
|
+
var ResourcesActivityResult = import_zod19.z.strictObject({
|
|
1249
|
+
/** False until the first reading (a second or two after start). */
|
|
1250
|
+
ready: import_zod19.z.boolean(),
|
|
1251
|
+
sampled_at_ms: epochMs.nullable(),
|
|
1252
|
+
cores: import_zod19.z.int().min(1),
|
|
1253
|
+
/** 1, 5 and 15 minute load averages. */
|
|
1254
|
+
load: import_zod19.z.array(import_zod19.z.number().min(0)).length(3),
|
|
1255
|
+
memory: import_zod19.z.strictObject({
|
|
1256
|
+
total_bytes: nonNegInt,
|
|
1257
|
+
/** Activity Monitor's Memory Used: app memory + wired + compressed. */
|
|
1258
|
+
used_bytes: nonNegInt,
|
|
1259
|
+
/** Data held compressed, and the memory the compressor takes to hold it. */
|
|
1260
|
+
compressed_bytes: nonNegInt,
|
|
1261
|
+
compressor_bytes: nonNegInt,
|
|
1262
|
+
swap_used_bytes: nonNegInt,
|
|
1263
|
+
pressure: ResourcesPressure.nullable()
|
|
1264
|
+
}),
|
|
1265
|
+
verdict: ResourcesVerdict,
|
|
1266
|
+
typechecks: import_zod19.z.strictObject({ running: nonNegInt, waiting: nonNegInt, comfort: nonNegInt }),
|
|
1267
|
+
/** Heaviest first (1 GB weighs as much as 16 % of a core). */
|
|
1268
|
+
jobs: import_zod19.z.array(ResourcesJob).max(200),
|
|
1269
|
+
/** The 15 heaviest by memory and the 15 busiest by CPU, together. */
|
|
1270
|
+
top: import_zod19.z.array(ResourcesProcess).max(30),
|
|
1271
|
+
/** The last hour, oldest first. */
|
|
1272
|
+
history: import_zod19.z.array(ResourcesSample).max(1200)
|
|
1273
|
+
});
|
|
1274
|
+
var ResourcesStopJobParams = import_zod19.z.strictObject({ pid: import_zod19.z.int().min(1) });
|
|
1275
|
+
var ResourcesStopJobResult = import_zod19.z.strictObject({
|
|
1276
|
+
/** Processes signalled; whatever is still running 5 seconds later is force-stopped. */
|
|
1277
|
+
processes: nonNegInt,
|
|
1278
|
+
/** It had finished before the request arrived. */
|
|
1279
|
+
already_finished: import_zod19.z.boolean()
|
|
1280
|
+
});
|
|
1281
|
+
var ResourcesIncident = import_zod19.z.strictObject({
|
|
1282
|
+
at_ms: epochMs,
|
|
1283
|
+
verdict: ResourcesVerdict,
|
|
1284
|
+
load: import_zod19.z.number().min(0),
|
|
1285
|
+
memory_used_bytes: nonNegInt,
|
|
1286
|
+
compressed_bytes: nonNegInt,
|
|
1287
|
+
pressure: ResourcesPressure.nullable(),
|
|
1288
|
+
jobs: import_zod19.z.array(
|
|
1289
|
+
import_zod19.z.strictObject({
|
|
1290
|
+
kind: ResourcesJobKind,
|
|
1291
|
+
started_by: import_zod19.z.string().max(64).nullable(),
|
|
1292
|
+
folder: import_zod19.z.string().max(256).nullable(),
|
|
1293
|
+
command: import_zod19.z.string().max(256),
|
|
1294
|
+
cpu_percent: import_zod19.z.number().min(0),
|
|
1295
|
+
memory_bytes: nonNegInt,
|
|
1296
|
+
duplicates: import_zod19.z.int().min(1)
|
|
1297
|
+
})
|
|
1298
|
+
).max(8)
|
|
1299
|
+
});
|
|
1300
|
+
var ResourcesIncidentsParams = import_zod19.z.strictObject({ limit: import_zod19.z.int().min(1).max(200).default(50) });
|
|
1301
|
+
var ResourcesIncidentsResult = import_zod19.z.strictObject({
|
|
1302
|
+
/** Newest first; at most one a minute is written. */
|
|
1303
|
+
incidents: import_zod19.z.array(ResourcesIncident).max(200)
|
|
1304
|
+
});
|
|
1192
1305
|
|
|
1193
|
-
// src/schema/
|
|
1306
|
+
// src/schema/stack.ts
|
|
1194
1307
|
var import_zod20 = require("zod");
|
|
1195
|
-
var
|
|
1196
|
-
var
|
|
1308
|
+
var StackServerName = import_zod20.z.string().regex(/^[a-z0-9_-]{1,64}$/);
|
|
1309
|
+
var StackTone = import_zod20.z.enum(["good", "wait", "bad", "off"]);
|
|
1310
|
+
var StackServer = import_zod20.z.strictObject({
|
|
1311
|
+
name: StackServerName,
|
|
1312
|
+
/** One word: Healthy, Starting, Unhealthy, Restarting, Stopping, Waiting, Stopped, Crashed, Off. */
|
|
1313
|
+
label: import_zod20.z.string().max(32),
|
|
1314
|
+
tone: StackTone,
|
|
1315
|
+
/** What is going on, in one or two plain sentences. */
|
|
1316
|
+
sentence: import_zod20.z.string().max(2e3),
|
|
1317
|
+
/** The config's own description of the server. */
|
|
1318
|
+
description: import_zod20.z.string().max(512),
|
|
1319
|
+
/** Where the server answers, when its description names an address. */
|
|
1320
|
+
open_url: import_zod20.z.string().max(2048).nullable(),
|
|
1321
|
+
log_file: import_zod20.z.string().max(4096),
|
|
1322
|
+
/** When its log file was last written. */
|
|
1323
|
+
last_output_at_ms: epochMs.nullable(),
|
|
1324
|
+
started_at_ms: epochMs.nullable(),
|
|
1325
|
+
restarts: nonNegInt,
|
|
1326
|
+
exit_code: import_zod20.z.int().nullable(),
|
|
1327
|
+
pid: import_zod20.z.int().nullable()
|
|
1328
|
+
});
|
|
1329
|
+
var StackEvent = import_zod20.z.strictObject({
|
|
1330
|
+
at_ms: epochMs,
|
|
1331
|
+
/** A server name, or "stack" for the stack as a whole. */
|
|
1332
|
+
server: import_zod20.z.string().max(64),
|
|
1333
|
+
/** started · stopped · healthy · unhealthy · crashed · exited · restarting · stopping · action · action-done · action-failed · setup · error */
|
|
1334
|
+
kind: import_zod20.z.string().max(32),
|
|
1335
|
+
text: import_zod20.z.string().max(4e3)
|
|
1336
|
+
});
|
|
1337
|
+
var StackStateParams = import_zod20.z.strictObject({});
|
|
1338
|
+
var StackStateResult = import_zod20.z.strictObject({
|
|
1339
|
+
/** The stack's config file, when found. */
|
|
1340
|
+
config_path: import_zod20.z.string().max(4096).nullable(),
|
|
1341
|
+
/** Why the stack cannot be run from here (no config, no process-compose), else null. */
|
|
1342
|
+
problem: import_zod20.z.string().max(1e3).nullable(),
|
|
1343
|
+
stack_up: import_zod20.z.boolean(),
|
|
1344
|
+
stack_started_at_ms: epochMs.nullable(),
|
|
1345
|
+
servers: import_zod20.z.array(StackServer).max(64),
|
|
1346
|
+
/** One line about the one-shot setup steps ("Docker Desktop: running."), or null. */
|
|
1347
|
+
setup_note: import_zod20.z.string().max(500).nullable(),
|
|
1348
|
+
/** Start everything / Stop everything in flight. */
|
|
1349
|
+
pending: import_zod20.z.strictObject({ verb: import_zod20.z.enum(["start", "stop"]), label: import_zod20.z.string().max(64), since_ms: epochMs }).nullable(),
|
|
1350
|
+
/** The newest entries last. */
|
|
1351
|
+
events: import_zod20.z.array(StackEvent).max(300)
|
|
1352
|
+
});
|
|
1353
|
+
var StackStartParams = import_zod20.z.strictObject({});
|
|
1354
|
+
var StackStopParams = import_zod20.z.strictObject({});
|
|
1355
|
+
var StackRunResult = import_zod20.z.strictObject({ accepted: import_zod20.z.boolean() });
|
|
1356
|
+
var StackServerActionParams = import_zod20.z.strictObject({
|
|
1357
|
+
name: StackServerName,
|
|
1358
|
+
verb: import_zod20.z.enum(["start", "stop", "restart"])
|
|
1359
|
+
});
|
|
1360
|
+
var StackServerActionResult = import_zod20.z.strictObject({ message: import_zod20.z.string().max(1e3) });
|
|
1361
|
+
var StackLogsParams = import_zod20.z.strictObject({
|
|
1362
|
+
name: StackServerName,
|
|
1363
|
+
/** Without `offset`: the last this-many complete lines. With it: new lines after it, at most this many. */
|
|
1364
|
+
lines: import_zod20.z.int().min(1).max(2e5).default(2e3),
|
|
1365
|
+
/** Byte offset the last read ended at: answer only what was written after it (follow). */
|
|
1366
|
+
offset: nonNegInt.optional(),
|
|
1367
|
+
/** A "Clear" point: the lines written after this byte offset (no `offset`). */
|
|
1368
|
+
since: nonNegInt.optional(),
|
|
1369
|
+
/** With `offset`: wait up to this long for a new line when none is waiting (0 answers at once). */
|
|
1370
|
+
wait_ms: import_zod20.z.int().min(0).max(25e3).default(0)
|
|
1371
|
+
});
|
|
1372
|
+
var StackLogsResult = import_zod20.z.strictObject({
|
|
1373
|
+
/** Complete lines, colour codes removed. */
|
|
1374
|
+
lines: import_zod20.z.array(import_zod20.z.string().max(65536)).max(2e5),
|
|
1375
|
+
/** Where these lines end: pass it back as `offset` to follow. */
|
|
1376
|
+
offset: nonNegInt,
|
|
1377
|
+
/** False when `since` no longer exists (the log rotated): the lines are the plain tail instead. */
|
|
1378
|
+
since_valid: import_zod20.z.boolean(),
|
|
1379
|
+
/** The log was rotated or truncated since `offset`: these lines start the file again. */
|
|
1380
|
+
reset: import_zod20.z.boolean(),
|
|
1381
|
+
log_file: import_zod20.z.string().max(4096)
|
|
1382
|
+
});
|
|
1383
|
+
var StackErrorsParams = import_zod20.z.strictObject({
|
|
1384
|
+
window_minutes: import_zod20.z.int().min(1).max(1440).default(60)
|
|
1385
|
+
});
|
|
1386
|
+
var StackErrorsResult = import_zod20.z.strictObject({
|
|
1387
|
+
/** Per server: a heading line ("=== aidream — errors in the last 60 minutes (<file>) ===") and each error with the 10 lines after it. */
|
|
1388
|
+
sections: import_zod20.z.array(import_zod20.z.strictObject({ name: StackServerName, heading: import_zod20.z.string().max(4096), lines: import_zod20.z.array(import_zod20.z.string().max(65536)).max(5e3) })).max(64),
|
|
1389
|
+
window_minutes: import_zod20.z.int().min(1).max(1440)
|
|
1390
|
+
});
|
|
1391
|
+
|
|
1392
|
+
// src/schema/fs-watch.ts
|
|
1393
|
+
var import_zod21 = require("zod");
|
|
1394
|
+
var FsWatchId = import_zod21.z.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
|
|
1395
|
+
var FsWatchStartParams = import_zod21.z.strictObject({
|
|
1197
1396
|
path: AbsPath,
|
|
1198
|
-
recursive:
|
|
1397
|
+
recursive: import_zod21.z.boolean().default(true),
|
|
1199
1398
|
/** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
|
|
1200
|
-
ignore:
|
|
1399
|
+
ignore: import_zod21.z.array(import_zod21.z.string().max(256)).max(64).default([])
|
|
1201
1400
|
});
|
|
1202
|
-
var FsWatchStartResult =
|
|
1401
|
+
var FsWatchStartResult = import_zod21.z.strictObject({
|
|
1203
1402
|
watch_id: FsWatchId,
|
|
1204
1403
|
path: AbsPath,
|
|
1205
1404
|
/** The watch ends by itself if nobody reads it for 30 minutes. */
|
|
1206
1405
|
expires_at_ms: epochMs
|
|
1207
1406
|
});
|
|
1208
|
-
var FsWatchEventsParams =
|
|
1407
|
+
var FsWatchEventsParams = import_zod21.z.strictObject({
|
|
1209
1408
|
watch_id: FsWatchId,
|
|
1210
1409
|
/** Wait up to this long for a first change when none is waiting (0 answers at once). */
|
|
1211
|
-
wait_ms:
|
|
1410
|
+
wait_ms: import_zod21.z.int().min(0).max(25e3).default(0)
|
|
1212
1411
|
});
|
|
1213
|
-
var FsWatchEventsResult =
|
|
1412
|
+
var FsWatchEventsResult = import_zod21.z.strictObject({
|
|
1214
1413
|
/** What changed since the last read, oldest first; re-checked against the disk when read. */
|
|
1215
|
-
changes:
|
|
1414
|
+
changes: import_zod21.z.array(FsChange).max(1e3),
|
|
1216
1415
|
/** Changes were dropped (more than 1000 waited): list the folder again. */
|
|
1217
|
-
overflow:
|
|
1416
|
+
overflow: import_zod21.z.boolean(),
|
|
1218
1417
|
expires_at_ms: epochMs
|
|
1219
1418
|
});
|
|
1220
|
-
var FsWatchStopParams =
|
|
1221
|
-
var FsWatchStopResult =
|
|
1419
|
+
var FsWatchStopParams = import_zod21.z.strictObject({ watch_id: FsWatchId });
|
|
1420
|
+
var FsWatchStopResult = import_zod21.z.strictObject({ watch_id: FsWatchId });
|
|
1222
1421
|
|
|
1223
1422
|
// src/schema/exec-job.ts
|
|
1224
|
-
var
|
|
1225
|
-
var ExecJobId =
|
|
1226
|
-
var ExecJobStartParams =
|
|
1227
|
-
command:
|
|
1423
|
+
var import_zod22 = require("zod");
|
|
1424
|
+
var ExecJobId = import_zod22.z.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
|
|
1425
|
+
var ExecJobStartParams = import_zod22.z.strictObject({
|
|
1426
|
+
command: import_zod22.z.string().min(1).max(131072),
|
|
1228
1427
|
/** The folder it runs in; the home folder when absent. */
|
|
1229
1428
|
cwd: AbsPath.optional(),
|
|
1230
|
-
env:
|
|
1429
|
+
env: import_zod22.z.record(import_zod22.z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), import_zod22.z.string().max(32768)).optional()
|
|
1231
1430
|
});
|
|
1232
|
-
var ExecJobStartResult =
|
|
1233
|
-
var ExecJobOutputParams =
|
|
1431
|
+
var ExecJobStartResult = import_zod22.z.strictObject({ job_id: ExecJobId, pid: import_zod22.z.int().min(1), cwd: AbsPath });
|
|
1432
|
+
var ExecJobOutputParams = import_zod22.z.strictObject({
|
|
1234
1433
|
job_id: ExecJobId,
|
|
1235
1434
|
/** Byte offset into the job's output to read from (next_offset of the last read; 0 = the start). */
|
|
1236
1435
|
offset: nonNegInt.default(0),
|
|
1237
1436
|
/** Wait up to this long for new output or the exit when none is waiting (0 answers at once). */
|
|
1238
|
-
wait_ms:
|
|
1239
|
-
max_bytes:
|
|
1437
|
+
wait_ms: import_zod22.z.int().min(0).max(25e3).default(0),
|
|
1438
|
+
max_bytes: import_zod22.z.int().min(1024).max(1048576).default(65536)
|
|
1240
1439
|
});
|
|
1241
|
-
var ExecJobOutputResult =
|
|
1440
|
+
var ExecJobOutputResult = import_zod22.z.strictObject({
|
|
1242
1441
|
/** stdout and stderr interleaved as they arrived (UTF-8). */
|
|
1243
|
-
output:
|
|
1442
|
+
output: import_zod22.z.string(),
|
|
1244
1443
|
next_offset: nonNegInt,
|
|
1245
1444
|
/** Bytes before `offset` that are gone (the job keeps its last 4 MiB). */
|
|
1246
1445
|
dropped_bytes: nonNegInt,
|
|
1247
|
-
running:
|
|
1248
|
-
exit_code:
|
|
1446
|
+
running: import_zod22.z.boolean(),
|
|
1447
|
+
exit_code: import_zod22.z.int().nullable()
|
|
1249
1448
|
});
|
|
1250
|
-
var ExecJobStopParams =
|
|
1449
|
+
var ExecJobStopParams = import_zod22.z.strictObject({
|
|
1251
1450
|
job_id: ExecJobId,
|
|
1252
1451
|
/** End it at once (SIGKILL; on Windows the whole tree with /F) instead of asking it to quit. */
|
|
1253
|
-
force:
|
|
1452
|
+
force: import_zod22.z.boolean().default(false)
|
|
1254
1453
|
});
|
|
1255
|
-
var ExecJobStopResult =
|
|
1256
|
-
var ExecJobInfo =
|
|
1454
|
+
var ExecJobStopResult = import_zod22.z.strictObject({ job_id: ExecJobId, exited: import_zod22.z.boolean(), exit_code: import_zod22.z.int().nullable() });
|
|
1455
|
+
var ExecJobInfo = import_zod22.z.strictObject({
|
|
1257
1456
|
job_id: ExecJobId,
|
|
1258
|
-
command:
|
|
1259
|
-
pid:
|
|
1457
|
+
command: import_zod22.z.string().max(1024),
|
|
1458
|
+
pid: import_zod22.z.int().min(1),
|
|
1260
1459
|
cwd: AbsPath,
|
|
1261
|
-
running:
|
|
1262
|
-
exit_code:
|
|
1460
|
+
running: import_zod22.z.boolean(),
|
|
1461
|
+
exit_code: import_zod22.z.int().nullable(),
|
|
1263
1462
|
started_at_ms: epochMs,
|
|
1264
1463
|
output_bytes: nonNegInt
|
|
1265
1464
|
});
|
|
1266
|
-
var ExecJobListParams =
|
|
1267
|
-
var ExecJobListResult =
|
|
1465
|
+
var ExecJobListParams = import_zod22.z.strictObject({});
|
|
1466
|
+
var ExecJobListResult = import_zod22.z.strictObject({ jobs: import_zod22.z.array(ExecJobInfo).max(64) });
|
|
1268
1467
|
|
|
1269
1468
|
// src/schema/coding.ts
|
|
1270
|
-
var
|
|
1271
|
-
var CodingServiceCredentials =
|
|
1272
|
-
access_token:
|
|
1273
|
-
user_id:
|
|
1469
|
+
var import_zod23 = require("zod");
|
|
1470
|
+
var CodingServiceCredentials = import_zod23.z.strictObject({
|
|
1471
|
+
access_token: import_zod23.z.string().min(16).max(16384),
|
|
1472
|
+
user_id: import_zod23.z.string().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/),
|
|
1274
1473
|
/** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
|
|
1275
|
-
server_url:
|
|
1474
|
+
server_url: import_zod23.z.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
|
|
1276
1475
|
});
|
|
1277
|
-
var CodingHistoryBlocked =
|
|
1476
|
+
var CodingHistoryBlocked = import_zod23.z.enum([
|
|
1278
1477
|
"signed_out",
|
|
1279
1478
|
"offline",
|
|
1280
1479
|
"organization_required",
|
|
@@ -1282,11 +1481,11 @@ var CodingHistoryBlocked = import_zod22.z.enum([
|
|
|
1282
1481
|
"cloud_list_unavailable",
|
|
1283
1482
|
"history_too_large"
|
|
1284
1483
|
]);
|
|
1285
|
-
var CodingHistoryFailure =
|
|
1286
|
-
session_id:
|
|
1287
|
-
reason:
|
|
1484
|
+
var CodingHistoryFailure = import_zod23.z.strictObject({
|
|
1485
|
+
session_id: import_zod23.z.string().max(64),
|
|
1486
|
+
reason: import_zod23.z.string().max(300)
|
|
1288
1487
|
});
|
|
1289
|
-
var CodingHistoryRun =
|
|
1488
|
+
var CodingHistoryRun = import_zod23.z.strictObject({
|
|
1290
1489
|
/** Claude Code sessions found on this computer. */
|
|
1291
1490
|
local_sessions: nonNegInt,
|
|
1292
1491
|
/** Of those, already complete in AI Matrx. */
|
|
@@ -1301,39 +1500,39 @@ var CodingHistoryRun = import_zod22.z.strictObject({
|
|
|
1301
1500
|
/** Changed while being read; a later run takes them. */
|
|
1302
1501
|
changed: nonNegInt,
|
|
1303
1502
|
failed: nonNegInt,
|
|
1304
|
-
failures:
|
|
1503
|
+
failures: import_zod23.z.array(CodingHistoryFailure).max(20),
|
|
1305
1504
|
/** Candidates not reached yet. */
|
|
1306
1505
|
remaining: nonNegInt,
|
|
1307
1506
|
/** The one line a person reads, e.g. "Imported 12 of 14 sessions. 140 already in AI Matrx." */
|
|
1308
|
-
summary:
|
|
1507
|
+
summary: import_zod23.z.string().max(400)
|
|
1309
1508
|
});
|
|
1310
|
-
var CodingHistoryStep =
|
|
1509
|
+
var CodingHistoryStep = import_zod23.z.strictObject({
|
|
1311
1510
|
/** Null when the run could not start (blocked before a plan existed). */
|
|
1312
|
-
plan_id:
|
|
1313
|
-
finished:
|
|
1511
|
+
plan_id: import_zod23.z.string().regex(/^[0-9a-f]{32}$/).nullable(),
|
|
1512
|
+
finished: import_zod23.z.boolean(),
|
|
1314
1513
|
blocked: CodingHistoryBlocked.nullable(),
|
|
1315
1514
|
run: CodingHistoryRun
|
|
1316
1515
|
});
|
|
1317
|
-
var CodingPlanMissingParams =
|
|
1318
|
-
var CodingImportNextParams =
|
|
1319
|
-
plan_id:
|
|
1516
|
+
var CodingPlanMissingParams = import_zod23.z.strictObject({ credentials: CodingServiceCredentials.nullable() });
|
|
1517
|
+
var CodingImportNextParams = import_zod23.z.strictObject({
|
|
1518
|
+
plan_id: import_zod23.z.string().regex(/^[0-9a-f]{32}$/),
|
|
1320
1519
|
credentials: CodingServiceCredentials.nullable()
|
|
1321
1520
|
});
|
|
1322
|
-
var CodingServiceProgress =
|
|
1323
|
-
phase:
|
|
1521
|
+
var CodingServiceProgress = import_zod23.z.strictObject({
|
|
1522
|
+
phase: import_zod23.z.enum(["checking", "importing"]),
|
|
1324
1523
|
done: nonNegInt,
|
|
1325
1524
|
total: nonNegInt
|
|
1326
1525
|
});
|
|
1327
|
-
var CodingHistoryImportMissingParams =
|
|
1328
|
-
var CodingHistoryImportMissingResult =
|
|
1329
|
-
state:
|
|
1526
|
+
var CodingHistoryImportMissingParams = import_zod23.z.strictObject({});
|
|
1527
|
+
var CodingHistoryImportMissingResult = import_zod23.z.strictObject({
|
|
1528
|
+
state: import_zod23.z.enum(["done", "blocked", "cancelled"]),
|
|
1330
1529
|
blocked: CodingHistoryBlocked.nullable(),
|
|
1331
1530
|
run: CodingHistoryRun,
|
|
1332
1531
|
elapsed_ms: nonNegInt
|
|
1333
1532
|
});
|
|
1334
|
-
var CodingHistoryProgressEvent =
|
|
1533
|
+
var CodingHistoryProgressEvent = import_zod23.z.strictObject({
|
|
1335
1534
|
request_id: RequestId,
|
|
1336
|
-
phase:
|
|
1535
|
+
phase: import_zod23.z.enum(["checking", "importing"]),
|
|
1337
1536
|
/** Sessions settled so far, of `total` candidates (0 of 0 while checking). */
|
|
1338
1537
|
done: nonNegInt,
|
|
1339
1538
|
total: nonNegInt,
|
|
@@ -1342,22 +1541,22 @@ var CodingHistoryProgressEvent = import_zod22.z.strictObject({
|
|
|
1342
1541
|
});
|
|
1343
1542
|
|
|
1344
1543
|
// src/schema/apps.ts
|
|
1345
|
-
var
|
|
1346
|
-
var AppKey =
|
|
1347
|
-
var AppProfileId =
|
|
1348
|
-
var AppProfileLocator =
|
|
1349
|
-
var AppSupport =
|
|
1350
|
-
var AppFeatureStatus =
|
|
1544
|
+
var import_zod24 = require("zod");
|
|
1545
|
+
var AppKey = import_zod24.z.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
|
|
1546
|
+
var AppProfileId = import_zod24.z.string().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/);
|
|
1547
|
+
var AppProfileLocator = import_zod24.z.string().min(1).max(512).regex(/^[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}(\/[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}){0,7}$/);
|
|
1548
|
+
var AppSupport = import_zod24.z.enum(["supported", "partial", "unsupported"]);
|
|
1549
|
+
var AppFeatureStatus = import_zod24.z.strictObject({
|
|
1351
1550
|
status: AppSupport,
|
|
1352
1551
|
/** One line, set whenever status is not "supported". */
|
|
1353
|
-
reason:
|
|
1552
|
+
reason: import_zod24.z.string().max(140).nullable()
|
|
1354
1553
|
});
|
|
1355
|
-
var AppInfo =
|
|
1554
|
+
var AppInfo = import_zod24.z.strictObject({
|
|
1356
1555
|
app_key: AppKey,
|
|
1357
|
-
name:
|
|
1358
|
-
installed:
|
|
1556
|
+
name: import_zod24.z.string().max(64),
|
|
1557
|
+
installed: import_zod24.z.boolean(),
|
|
1359
1558
|
/** The app's own version string, or null when it is not installed or does not say. */
|
|
1360
|
-
version:
|
|
1559
|
+
version: import_zod24.z.string().max(64).nullable(),
|
|
1361
1560
|
/** The install found (an .app bundle, an .exe, a binary), or null. */
|
|
1362
1561
|
location: AbsPath.nullable(),
|
|
1363
1562
|
/** Open the app at all on this OS. */
|
|
@@ -1367,148 +1566,148 @@ var AppInfo = import_zod23.z.strictObject({
|
|
|
1367
1566
|
/** Plan usage read from the app's own files on this OS. */
|
|
1368
1567
|
usage: AppFeatureStatus
|
|
1369
1568
|
});
|
|
1370
|
-
var AppUsageReading =
|
|
1371
|
-
window:
|
|
1569
|
+
var AppUsageReading = import_zod24.z.strictObject({
|
|
1570
|
+
window: import_zod24.z.enum(["five_hour", "weekly", "extra"]),
|
|
1372
1571
|
/** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
|
|
1373
|
-
percent:
|
|
1572
|
+
percent: import_zod24.z.number().min(0).max(1e4),
|
|
1374
1573
|
/** When the app recorded it. */
|
|
1375
1574
|
sampled_at_ms: epochMs,
|
|
1376
1575
|
/** True when the window has rolled over since the sample, so the figure has reset. */
|
|
1377
|
-
reset_since:
|
|
1576
|
+
reset_since: import_zod24.z.boolean()
|
|
1378
1577
|
});
|
|
1379
|
-
var AppProfile =
|
|
1578
|
+
var AppProfile = import_zod24.z.strictObject({
|
|
1380
1579
|
/** The row's id; null for a folder found on disk that no row names yet. */
|
|
1381
1580
|
id: AppProfileId.nullable(),
|
|
1382
1581
|
app_key: AppKey,
|
|
1383
|
-
display_name:
|
|
1582
|
+
display_name: import_zod24.z.string().min(1).max(120),
|
|
1384
1583
|
/** The account the person means to be signed in here; null when not stated (never guessed). */
|
|
1385
|
-
account_identity:
|
|
1584
|
+
account_identity: import_zod24.z.string().min(3).max(320).nullable(),
|
|
1386
1585
|
profile_locator: AppProfileLocator.nullable(),
|
|
1387
1586
|
/** The device the row is tied to; null when the row names none. */
|
|
1388
1587
|
device_id: DeviceId.nullable(),
|
|
1389
1588
|
/** The folder this profile resolves to on this device; null for a row tied to another device. */
|
|
1390
1589
|
folder: AbsPath.nullable(),
|
|
1391
1590
|
/** The folder exists on this device. */
|
|
1392
|
-
on_disk:
|
|
1591
|
+
on_disk: import_zod24.z.boolean(),
|
|
1393
1592
|
/** An instance with this profile is running; null when it could not be determined. */
|
|
1394
|
-
running:
|
|
1593
|
+
running: import_zod24.z.boolean().nullable(),
|
|
1395
1594
|
/** Usage the app recorded for this profile; null when the app exposes none here. */
|
|
1396
|
-
usage:
|
|
1595
|
+
usage: import_zod24.z.array(AppUsageReading).nullable(),
|
|
1397
1596
|
last_opened_ms: epochMs.nullable()
|
|
1398
1597
|
});
|
|
1399
|
-
var AppsListParams =
|
|
1400
|
-
var AppsListResult =
|
|
1401
|
-
var AppsProfilesListParams =
|
|
1598
|
+
var AppsListParams = import_zod24.z.strictObject({});
|
|
1599
|
+
var AppsListResult = import_zod24.z.strictObject({ apps: import_zod24.z.array(AppInfo) });
|
|
1600
|
+
var AppsProfilesListParams = import_zod24.z.strictObject({
|
|
1402
1601
|
/** Only this app's profiles; every app's when absent. */
|
|
1403
1602
|
app_key: AppKey.optional()
|
|
1404
1603
|
});
|
|
1405
|
-
var AppsProfilesListResult =
|
|
1406
|
-
profiles:
|
|
1604
|
+
var AppsProfilesListResult = import_zod24.z.strictObject({
|
|
1605
|
+
profiles: import_zod24.z.array(AppProfile),
|
|
1407
1606
|
/**
|
|
1408
1607
|
* Whether the saved rows could be read: false while signed out or offline, when only folders
|
|
1409
1608
|
* found on disk are listed.
|
|
1410
1609
|
*/
|
|
1411
|
-
registry:
|
|
1610
|
+
registry: import_zod24.z.enum(["ok", "signed_out", "unavailable"])
|
|
1412
1611
|
});
|
|
1413
|
-
var AppsProfilesSaveParams =
|
|
1612
|
+
var AppsProfilesSaveParams = import_zod24.z.strictObject({
|
|
1414
1613
|
id: AppProfileId.optional(),
|
|
1415
1614
|
app_key: AppKey,
|
|
1416
|
-
display_name:
|
|
1417
|
-
account_identity:
|
|
1615
|
+
display_name: import_zod24.z.string().min(1).max(120),
|
|
1616
|
+
account_identity: import_zod24.z.string().min(3).max(320).nullable(),
|
|
1418
1617
|
/** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
|
|
1419
1618
|
profile_locator: AppProfileLocator.nullable(),
|
|
1420
1619
|
/** On create with profile_locator null: make a new folder named after display_name instead. */
|
|
1421
|
-
new_folder:
|
|
1620
|
+
new_folder: import_zod24.z.boolean().default(false)
|
|
1422
1621
|
});
|
|
1423
1622
|
var AppsProfilesSaveResult = AppProfile;
|
|
1424
|
-
var AppsProfilesRemoveParams =
|
|
1425
|
-
var AppsProfilesRemoveResult =
|
|
1426
|
-
var AppsOpenParams =
|
|
1623
|
+
var AppsProfilesRemoveParams = import_zod24.z.strictObject({ id: AppProfileId });
|
|
1624
|
+
var AppsProfilesRemoveResult = import_zod24.z.strictObject({ removed: import_zod24.z.boolean() });
|
|
1625
|
+
var AppsOpenParams = import_zod24.z.strictObject({
|
|
1427
1626
|
app_key: AppKey,
|
|
1428
1627
|
profile_id: AppProfileId.optional()
|
|
1429
1628
|
});
|
|
1430
|
-
var AppsOpenResult =
|
|
1629
|
+
var AppsOpenResult = import_zod24.z.strictObject({
|
|
1431
1630
|
/** True when an instance with this profile was already running; it is brought forward. */
|
|
1432
|
-
already_running:
|
|
1631
|
+
already_running: import_zod24.z.boolean(),
|
|
1433
1632
|
folder: AbsPath.nullable()
|
|
1434
1633
|
});
|
|
1435
1634
|
|
|
1436
1635
|
// src/schema/apps-chats.ts
|
|
1437
|
-
var
|
|
1438
|
-
var ChatId =
|
|
1439
|
-
var ChatPlace =
|
|
1440
|
-
var ChatProjectId =
|
|
1441
|
-
var ChatWindow =
|
|
1636
|
+
var import_zod25 = require("zod");
|
|
1637
|
+
var ChatId = import_zod25.z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/);
|
|
1638
|
+
var ChatPlace = import_zod25.z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/);
|
|
1639
|
+
var ChatProjectId = import_zod25.z.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
|
|
1640
|
+
var ChatWindow = import_zod25.z.strictObject({
|
|
1442
1641
|
key: ChatPlace,
|
|
1443
1642
|
/** The app's default profile (Claude: the main window, which lists every account's chats). */
|
|
1444
|
-
main:
|
|
1643
|
+
main: import_zod25.z.boolean(),
|
|
1445
1644
|
/** The account the window is signed into, when known. */
|
|
1446
|
-
account:
|
|
1645
|
+
account: import_zod25.z.string().max(320).nullable()
|
|
1447
1646
|
});
|
|
1448
|
-
var ChatProject =
|
|
1647
|
+
var ChatProject = import_zod25.z.strictObject({
|
|
1449
1648
|
id: ChatProjectId,
|
|
1450
|
-
name:
|
|
1451
|
-
archived:
|
|
1649
|
+
name: import_zod25.z.string().min(1).max(200),
|
|
1650
|
+
archived: import_zod25.z.boolean(),
|
|
1452
1651
|
/** Chats in it. */
|
|
1453
1652
|
count: nonNegInt
|
|
1454
1653
|
});
|
|
1455
|
-
var ChatPin =
|
|
1654
|
+
var ChatPin = import_zod25.z.strictObject({
|
|
1456
1655
|
/** The window whose account pins it; an account with no window of its own is named by its email. */
|
|
1457
|
-
window:
|
|
1656
|
+
window: import_zod25.z.string().min(1).max(320),
|
|
1458
1657
|
/** When that account's pin list was last read; null when the reading has no time. */
|
|
1459
1658
|
observed_at_ms: epochMs.nullable()
|
|
1460
1659
|
});
|
|
1461
|
-
var ChatRunning =
|
|
1660
|
+
var ChatRunning = import_zod25.z.strictObject({
|
|
1462
1661
|
window: ChatPlace,
|
|
1463
1662
|
/** process: a live process resumed this chat there (exact); activity: that window's own record moved in the last 3 minutes. */
|
|
1464
|
-
how:
|
|
1663
|
+
how: import_zod25.z.enum(["process", "activity"])
|
|
1465
1664
|
});
|
|
1466
|
-
var ChatHidden =
|
|
1665
|
+
var ChatHidden = import_zod25.z.strictObject({
|
|
1467
1666
|
window: ChatPlace,
|
|
1468
|
-
reason:
|
|
1667
|
+
reason: import_zod25.z.string().max(200)
|
|
1469
1668
|
});
|
|
1470
|
-
var ChatLastUse =
|
|
1669
|
+
var ChatLastUse = import_zod25.z.strictObject({
|
|
1471
1670
|
/** The conversation's last reply. */
|
|
1472
1671
|
at_ms: epochMs,
|
|
1473
1672
|
window: ChatPlace.nullable(),
|
|
1474
|
-
account:
|
|
1673
|
+
account: import_zod25.z.string().max(320).nullable(),
|
|
1475
1674
|
/** How the window was decided (one short line). */
|
|
1476
|
-
how:
|
|
1675
|
+
how: import_zod25.z.string().max(120).nullable(),
|
|
1477
1676
|
/** The account's 1-hour prompt cache is still warm. */
|
|
1478
|
-
cache_warm:
|
|
1677
|
+
cache_warm: import_zod25.z.boolean(),
|
|
1479
1678
|
cache_minutes_left: nonNegInt
|
|
1480
1679
|
});
|
|
1481
|
-
var ChatAppProject =
|
|
1482
|
-
id:
|
|
1483
|
-
name:
|
|
1680
|
+
var ChatAppProject = import_zod25.z.strictObject({
|
|
1681
|
+
id: import_zod25.z.string().min(1).max(200),
|
|
1682
|
+
name: import_zod25.z.string().max(200)
|
|
1484
1683
|
});
|
|
1485
|
-
var ChatTitleSource =
|
|
1486
|
-
var ChatRow =
|
|
1684
|
+
var ChatTitleSource = import_zod25.z.enum(["app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt"]);
|
|
1685
|
+
var ChatRow = import_zod25.z.strictObject({
|
|
1487
1686
|
id: ChatId,
|
|
1488
1687
|
/** The short id people see (the listing's first 8 characters). */
|
|
1489
|
-
short_id:
|
|
1688
|
+
short_id: import_zod25.z.string().max(16),
|
|
1490
1689
|
/** The listing's own name (Claude: local_<id>), null for a chat only in the holder. */
|
|
1491
|
-
record:
|
|
1492
|
-
title:
|
|
1690
|
+
record: import_zod25.z.string().max(160).nullable(),
|
|
1691
|
+
title: import_zod25.z.string().max(1e3),
|
|
1493
1692
|
last_active_ms: epochMs.nullable(),
|
|
1494
1693
|
created_ms: epochMs.nullable(),
|
|
1495
|
-
projects:
|
|
1496
|
-
starred:
|
|
1497
|
-
pinned_in:
|
|
1694
|
+
projects: import_zod25.z.array(ChatProjectId).max(500),
|
|
1695
|
+
starred: import_zod25.z.boolean(),
|
|
1696
|
+
pinned_in: import_zod25.z.array(ChatPin).max(200),
|
|
1498
1697
|
/** Every place it is listed now: window keys, plus "holder". */
|
|
1499
|
-
places:
|
|
1500
|
-
held:
|
|
1501
|
-
running:
|
|
1502
|
-
hidden_in:
|
|
1698
|
+
places: import_zod25.z.array(ChatPlace).max(200),
|
|
1699
|
+
held: import_zod25.z.boolean(),
|
|
1700
|
+
running: import_zod25.z.array(ChatRunning).max(200),
|
|
1701
|
+
hidden_in: import_zod25.z.array(ChatHidden).max(200),
|
|
1503
1702
|
/** Kept out of the main window on purpose. */
|
|
1504
|
-
hidden_from_main:
|
|
1703
|
+
hidden_from_main: import_zod25.z.boolean(),
|
|
1505
1704
|
/** Listed in a side window and not yet copied into main. */
|
|
1506
|
-
main_pending:
|
|
1705
|
+
main_pending: import_zod25.z.boolean(),
|
|
1507
1706
|
/** A scheduled routine's run (its task id). */
|
|
1508
|
-
scheduled:
|
|
1707
|
+
scheduled: import_zod25.z.string().max(200).nullable(),
|
|
1509
1708
|
/** Created recently and in no project: offered for filing. */
|
|
1510
|
-
new_unfiled:
|
|
1511
|
-
warnings:
|
|
1709
|
+
new_unfiled: import_zod25.z.boolean(),
|
|
1710
|
+
warnings: import_zod25.z.array(import_zod25.z.string().max(400)).max(20),
|
|
1512
1711
|
last_use: ChatLastUse.nullable(),
|
|
1513
1712
|
/** 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. */
|
|
1514
1713
|
app_project: ChatAppProject.optional(),
|
|
@@ -1518,285 +1717,285 @@ var ChatRow = import_zod24.z.strictObject({
|
|
|
1518
1717
|
* 1.14: the chat's own title before the person's rename (the one title rule, `@ai-matrx/coding-sessions/sessions`);
|
|
1519
1718
|
* `title` is what to show (`title_override` when set, else this).
|
|
1520
1719
|
*/
|
|
1521
|
-
original_title:
|
|
1720
|
+
original_title: import_zod25.z.string().max(1e3).optional(),
|
|
1522
1721
|
/** 1.14: where `original_title` came from (the one rule's sources, strongest first; 1.15: a closed set). */
|
|
1523
1722
|
title_source: ChatTitleSource.optional(),
|
|
1524
1723
|
/** 1.14: the person's rename inside Matrx (Coding Sessions), applied once by the row builder; absent = none. */
|
|
1525
|
-
title_override:
|
|
1724
|
+
title_override: import_zod25.z.string().min(1).max(300).optional(),
|
|
1526
1725
|
/** 1.15: the app itself archived it (hidden_in says where and why, in words for people; this is the typed fact). */
|
|
1527
|
-
archived:
|
|
1726
|
+
archived: import_zod25.z.boolean().optional()
|
|
1528
1727
|
});
|
|
1529
|
-
var ChatFamily =
|
|
1728
|
+
var ChatFamily = import_zod25.z.strictObject({
|
|
1530
1729
|
id: ChatId,
|
|
1531
1730
|
fork_of: ChatId.nullable(),
|
|
1532
1731
|
copy_of: ChatId.nullable()
|
|
1533
1732
|
});
|
|
1534
|
-
var AppsChatsListParams =
|
|
1733
|
+
var AppsChatsListParams = import_zod25.z.strictObject({
|
|
1535
1734
|
app_key: AppKey,
|
|
1536
1735
|
/** Only these chats (a live update re-reads just what changed). */
|
|
1537
|
-
ids:
|
|
1736
|
+
ids: import_zod25.z.array(ChatId).max(500).optional()
|
|
1538
1737
|
});
|
|
1539
|
-
var AppsChatsListResult =
|
|
1738
|
+
var AppsChatsListResult = import_zod25.z.strictObject({
|
|
1540
1739
|
app_key: AppKey,
|
|
1541
1740
|
/** Bumps on every change the index sees; `apps.chats.changed` carries the same number. */
|
|
1542
1741
|
version: nonNegInt,
|
|
1543
|
-
windows:
|
|
1544
|
-
projects:
|
|
1545
|
-
chats:
|
|
1742
|
+
windows: import_zod25.z.array(ChatWindow).max(200),
|
|
1743
|
+
projects: import_zod25.z.array(ChatProject).max(5e3),
|
|
1744
|
+
chats: import_zod25.z.array(ChatRow).max(2e4),
|
|
1546
1745
|
/** How long a chat in no project counts as new. */
|
|
1547
1746
|
new_window_ms: nonNegInt,
|
|
1548
1747
|
/** 1.9: this is the copy saved at the last read, shown while everything is read again. */
|
|
1549
|
-
updating:
|
|
1748
|
+
updating: import_zod25.z.boolean().optional(),
|
|
1550
1749
|
/** 1.9: false while the folder watches are down (changes are not arriving); `apps.chats.watch_state` says when it changes. */
|
|
1551
|
-
live:
|
|
1750
|
+
live: import_zod25.z.boolean().optional(),
|
|
1552
1751
|
/** 1.10: every listed chat that is a fork or a copy of another (read from the conversations' first lines). */
|
|
1553
|
-
families:
|
|
1752
|
+
families: import_zod25.z.array(ChatFamily).max(2e4).optional()
|
|
1554
1753
|
});
|
|
1555
|
-
var AppsChatsWatchParams =
|
|
1556
|
-
var AppsChatsWatchResult =
|
|
1557
|
-
var AppsChatsChangedEvent =
|
|
1754
|
+
var AppsChatsWatchParams = import_zod25.z.strictObject({ app_key: AppKey });
|
|
1755
|
+
var AppsChatsWatchResult = import_zod25.z.strictObject({ resource_id: ResourceId, version: nonNegInt });
|
|
1756
|
+
var AppsChatsChangedEvent = import_zod25.z.strictObject({
|
|
1558
1757
|
app_key: AppKey,
|
|
1559
1758
|
version: nonNegInt,
|
|
1560
|
-
ids:
|
|
1561
|
-
all:
|
|
1759
|
+
ids: import_zod25.z.array(ChatId).max(1e3),
|
|
1760
|
+
all: import_zod25.z.boolean()
|
|
1562
1761
|
});
|
|
1563
|
-
var AppsChatsWatchStateEvent =
|
|
1762
|
+
var AppsChatsWatchStateEvent = import_zod25.z.strictObject({
|
|
1564
1763
|
app_key: AppKey,
|
|
1565
|
-
live:
|
|
1566
|
-
updating:
|
|
1567
|
-
reason:
|
|
1764
|
+
live: import_zod25.z.boolean(),
|
|
1765
|
+
updating: import_zod25.z.boolean(),
|
|
1766
|
+
reason: import_zod25.z.string().max(300).nullable()
|
|
1568
1767
|
});
|
|
1569
|
-
var AppsChatsPlaceParams =
|
|
1768
|
+
var AppsChatsPlaceParams = import_zod25.z.strictObject({
|
|
1570
1769
|
app_key: AppKey,
|
|
1571
1770
|
chat_id: ChatId,
|
|
1572
|
-
action:
|
|
1771
|
+
action: import_zod25.z.enum(["place", "take_off", "hold"]),
|
|
1573
1772
|
/** The window (for place and take_off). */
|
|
1574
1773
|
window: ChatPlace.optional(),
|
|
1575
1774
|
/** take_off where it is open: stop it there first (the person confirmed). */
|
|
1576
|
-
stop_if_open:
|
|
1775
|
+
stop_if_open: import_zod25.z.boolean().default(false)
|
|
1577
1776
|
});
|
|
1578
|
-
var AppsChatsPlaceResult =
|
|
1579
|
-
var AppsProjectsFileManyParams =
|
|
1777
|
+
var AppsChatsPlaceResult = import_zod25.z.strictObject({ chat: ChatRow, message: import_zod25.z.string().max(400) });
|
|
1778
|
+
var AppsProjectsFileManyParams = import_zod25.z.strictObject({
|
|
1580
1779
|
app_key: AppKey,
|
|
1581
|
-
chat_ids:
|
|
1780
|
+
chat_ids: import_zod25.z.array(ChatId).min(1).max(500),
|
|
1582
1781
|
project_id: ChatProjectId.optional(),
|
|
1583
|
-
new_project_name:
|
|
1782
|
+
new_project_name: import_zod25.z.string().min(1).max(200).optional()
|
|
1584
1783
|
});
|
|
1585
|
-
var AppsProjectsFileManyResult =
|
|
1586
|
-
var AppsProjectsUpdateParams =
|
|
1784
|
+
var AppsProjectsFileManyResult = import_zod25.z.strictObject({ chats: import_zod25.z.array(ChatRow).max(500), project: ChatProject });
|
|
1785
|
+
var AppsProjectsUpdateParams = import_zod25.z.strictObject({
|
|
1587
1786
|
app_key: AppKey,
|
|
1588
1787
|
project_id: ChatProjectId,
|
|
1589
|
-
name:
|
|
1590
|
-
archived:
|
|
1788
|
+
name: import_zod25.z.string().min(1).max(200).optional(),
|
|
1789
|
+
archived: import_zod25.z.boolean().optional()
|
|
1591
1790
|
});
|
|
1592
|
-
var AppsProjectsUpdateResult =
|
|
1593
|
-
var AppsProjectsCopyParams =
|
|
1594
|
-
var AppsProjectsCopyResult =
|
|
1595
|
-
var AppsProjectsFileParams =
|
|
1791
|
+
var AppsProjectsUpdateResult = import_zod25.z.strictObject({ project: ChatProject });
|
|
1792
|
+
var AppsProjectsCopyParams = import_zod25.z.strictObject({ app_key: AppKey, project_id: ChatProjectId, new_project_name: import_zod25.z.string().min(1).max(200) });
|
|
1793
|
+
var AppsProjectsCopyResult = import_zod25.z.strictObject({ project: ChatProject });
|
|
1794
|
+
var AppsProjectsFileParams = import_zod25.z.strictObject({
|
|
1596
1795
|
app_key: AppKey,
|
|
1597
1796
|
chat_id: ChatId,
|
|
1598
1797
|
project_id: ChatProjectId.optional(),
|
|
1599
|
-
new_project_name:
|
|
1798
|
+
new_project_name: import_zod25.z.string().min(1).max(200).optional()
|
|
1600
1799
|
});
|
|
1601
|
-
var AppsProjectsFileResult =
|
|
1602
|
-
var AppsProjectsUnfileParams =
|
|
1603
|
-
var AppsProjectsUnfileResult =
|
|
1604
|
-
var AppsChatsStarParams =
|
|
1605
|
-
var AppsChatsStarResult =
|
|
1800
|
+
var AppsProjectsFileResult = import_zod25.z.strictObject({ chat: ChatRow, project: ChatProject });
|
|
1801
|
+
var AppsProjectsUnfileParams = import_zod25.z.strictObject({ app_key: AppKey, chat_id: ChatId, project_id: ChatProjectId });
|
|
1802
|
+
var AppsProjectsUnfileResult = import_zod25.z.strictObject({ chat: ChatRow });
|
|
1803
|
+
var AppsChatsStarParams = import_zod25.z.strictObject({ app_key: AppKey, chat_id: ChatId, starred: import_zod25.z.boolean() });
|
|
1804
|
+
var AppsChatsStarResult = import_zod25.z.strictObject({ chat: ChatRow });
|
|
1606
1805
|
|
|
1607
1806
|
// src/schema/apps-accounts.ts
|
|
1608
|
-
var
|
|
1609
|
-
var AppWindowInfo =
|
|
1807
|
+
var import_zod26 = require("zod");
|
|
1808
|
+
var AppWindowInfo = import_zod26.z.strictObject({
|
|
1610
1809
|
key: ChatPlace,
|
|
1611
1810
|
/** The app's default profile (Claude: main, which may sign into any account). */
|
|
1612
|
-
main:
|
|
1811
|
+
main: import_zod26.z.boolean(),
|
|
1613
1812
|
/** The account the window is meant for (null for main). */
|
|
1614
|
-
account:
|
|
1813
|
+
account: import_zod26.z.string().max(320).nullable(),
|
|
1615
1814
|
/** The account signed in there now: an email, or the account id while it has no saved name. */
|
|
1616
|
-
signed_in:
|
|
1617
|
-
signed_in_is_email:
|
|
1815
|
+
signed_in: import_zod26.z.string().max(320).nullable(),
|
|
1816
|
+
signed_in_is_email: import_zod26.z.boolean(),
|
|
1618
1817
|
/** Signed into another account than the one it is meant for. */
|
|
1619
|
-
mismatch:
|
|
1818
|
+
mismatch: import_zod26.z.boolean(),
|
|
1620
1819
|
/** Its folder exists. */
|
|
1621
|
-
created:
|
|
1820
|
+
created: import_zod26.z.boolean(),
|
|
1622
1821
|
/** Open now. */
|
|
1623
|
-
running:
|
|
1822
|
+
running: import_zod26.z.boolean(),
|
|
1624
1823
|
/** Chats open in it now (a process resuming each one). */
|
|
1625
1824
|
open_chats: nonNegInt
|
|
1626
1825
|
});
|
|
1627
|
-
var AccountUsage =
|
|
1826
|
+
var AccountUsage = import_zod26.z.strictObject({
|
|
1628
1827
|
/** The account's email, or "org <8 chars>" when no window has ever sampled that org. */
|
|
1629
|
-
account:
|
|
1630
|
-
org:
|
|
1828
|
+
account: import_zod26.z.string().max(320),
|
|
1829
|
+
org: import_zod26.z.string().max(80).nullable(),
|
|
1631
1830
|
/** False when the org was sampled in several accounts' windows and the vote is not clear (≥ 75 %). */
|
|
1632
|
-
account_certain:
|
|
1831
|
+
account_certain: import_zod26.z.boolean(),
|
|
1633
1832
|
/** 5-hour use in percent (0 once the reading is over 5 hours old). */
|
|
1634
|
-
five_hour:
|
|
1635
|
-
five_hour_reset_since:
|
|
1833
|
+
five_hour: import_zod26.z.number().nullable(),
|
|
1834
|
+
five_hour_reset_since: import_zod26.z.boolean(),
|
|
1636
1835
|
/** Weekly use in percent (0 once the week reset after the reading). */
|
|
1637
|
-
weekly:
|
|
1638
|
-
weekly_reset_since:
|
|
1836
|
+
weekly: import_zod26.z.number().nullable(),
|
|
1837
|
+
weekly_reset_since: import_zod26.z.boolean(),
|
|
1639
1838
|
/** Extra-usage spend in percent of its cap, when on. */
|
|
1640
|
-
extra_usage:
|
|
1839
|
+
extra_usage: import_zod26.z.number().nullable(),
|
|
1641
1840
|
extra_usage_as_of_ms: epochMs.nullable(),
|
|
1642
1841
|
as_of_ms: epochMs,
|
|
1643
1842
|
/** The windows meant for this account (and main when main took the reading). */
|
|
1644
|
-
windows:
|
|
1843
|
+
windows: import_zod26.z.array(ChatPlace).max(200),
|
|
1645
1844
|
/** The window that took the reading is open now and the reading is under 30 minutes old. */
|
|
1646
|
-
live:
|
|
1845
|
+
live: import_zod26.z.boolean(),
|
|
1647
1846
|
/** The next weekly reset, when known. */
|
|
1648
1847
|
weekly_resets_at_ms: epochMs.nullable(),
|
|
1649
1848
|
/** That reset time is Claude's own (its reading, or a reset seen in its usage history). */
|
|
1650
|
-
weekly_reset_official:
|
|
1849
|
+
weekly_reset_official: import_zod26.z.boolean().nullable(),
|
|
1651
1850
|
/** 1.13: the account's plan as the app names it (Codex: "pro", "prolite"), when recorded. */
|
|
1652
|
-
plan:
|
|
1851
|
+
plan: import_zod26.z.string().max(80).optional(),
|
|
1653
1852
|
/** 1.13: the account's credit balance as the app records it (Codex), when recorded. */
|
|
1654
|
-
credits:
|
|
1853
|
+
credits: import_zod26.z.string().max(40).optional()
|
|
1655
1854
|
});
|
|
1656
|
-
var AccountReset =
|
|
1855
|
+
var AccountReset = import_zod26.z.strictObject({
|
|
1657
1856
|
window: ChatPlace,
|
|
1658
|
-
account:
|
|
1857
|
+
account: import_zod26.z.string().max(320).nullable(),
|
|
1659
1858
|
next_reset_ms: epochMs.nullable(),
|
|
1660
1859
|
/** claude: the app's own reading; usage_history: a weekly drop seen in its usage record; your_list: the person's own entry. */
|
|
1661
|
-
source:
|
|
1860
|
+
source: import_zod26.z.enum(["claude", "usage_history", "your_list"]).nullable(),
|
|
1662
1861
|
/** claude or usage_history. */
|
|
1663
|
-
official:
|
|
1862
|
+
official: import_zod26.z.boolean(),
|
|
1664
1863
|
/** Set when the person's list disagrees with the official time. */
|
|
1665
|
-
note:
|
|
1864
|
+
note: import_zod26.z.string().max(200).nullable()
|
|
1666
1865
|
});
|
|
1667
|
-
var AppsWindowsListParams =
|
|
1668
|
-
var AppsWindowsListResult =
|
|
1669
|
-
var AppsAccountsUsageParams =
|
|
1670
|
-
var AppsAccountsUsageResult =
|
|
1866
|
+
var AppsWindowsListParams = import_zod26.z.strictObject({ app_key: AppKey });
|
|
1867
|
+
var AppsWindowsListResult = import_zod26.z.strictObject({ app_key: AppKey, windows: import_zod26.z.array(AppWindowInfo).max(200) });
|
|
1868
|
+
var AppsAccountsUsageParams = import_zod26.z.strictObject({ app_key: AppKey });
|
|
1869
|
+
var AppsAccountsUsageResult = import_zod26.z.strictObject({
|
|
1671
1870
|
app_key: AppKey,
|
|
1672
|
-
accounts:
|
|
1871
|
+
accounts: import_zod26.z.array(AccountUsage).max(500),
|
|
1673
1872
|
/** 1.12: the rows are right but something around them failed (a newly read reset time could not be saved); shown, never hidden. */
|
|
1674
|
-
problem:
|
|
1873
|
+
problem: import_zod26.z.string().max(400).optional()
|
|
1675
1874
|
});
|
|
1676
|
-
var AppsAccountsResetsParams =
|
|
1677
|
-
var AppsAccountsResetsResult =
|
|
1875
|
+
var AppsAccountsResetsParams = import_zod26.z.strictObject({ app_key: AppKey });
|
|
1876
|
+
var AppsAccountsResetsResult = import_zod26.z.strictObject({
|
|
1678
1877
|
app_key: AppKey,
|
|
1679
|
-
resets:
|
|
1878
|
+
resets: import_zod26.z.array(AccountReset).max(200),
|
|
1680
1879
|
/** 1.12: as on `apps.accounts.usage`. */
|
|
1681
|
-
problem:
|
|
1682
|
-
});
|
|
1683
|
-
var AppsWindowActionResult =
|
|
1684
|
-
var AppsWindowsOpenParams =
|
|
1685
|
-
var AppsWindowsReloadParams =
|
|
1686
|
-
var AppsWindowsRestartParams =
|
|
1687
|
-
var AppsWindowsRefreshUsageParams =
|
|
1688
|
-
var AppsProjectsMoveParams =
|
|
1880
|
+
problem: import_zod26.z.string().max(400).optional()
|
|
1881
|
+
});
|
|
1882
|
+
var AppsWindowActionResult = import_zod26.z.strictObject({ message: import_zod26.z.string().max(400) });
|
|
1883
|
+
var AppsWindowsOpenParams = import_zod26.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
1884
|
+
var AppsWindowsReloadParams = import_zod26.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
1885
|
+
var AppsWindowsRestartParams = import_zod26.z.strictObject({ app_key: AppKey, window: ChatPlace, force: import_zod26.z.boolean().default(false) });
|
|
1886
|
+
var AppsWindowsRefreshUsageParams = import_zod26.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
1887
|
+
var AppsProjectsMoveParams = import_zod26.z.strictObject({
|
|
1689
1888
|
app_key: AppKey,
|
|
1690
1889
|
chat_id: ChatId,
|
|
1691
1890
|
from_project_id: ChatProjectId,
|
|
1692
1891
|
to_project_id: ChatProjectId.optional(),
|
|
1693
|
-
new_project_name:
|
|
1694
|
-
});
|
|
1695
|
-
var AppsProjectsMoveResult =
|
|
1696
|
-
var AppsProjectsCreateParams =
|
|
1697
|
-
var AppsProjectsCreateResult =
|
|
1698
|
-
var AppsProjectsImportPinsParams =
|
|
1699
|
-
var AppsProjectsImportPinsResult =
|
|
1700
|
-
var ColdChat =
|
|
1892
|
+
new_project_name: import_zod26.z.string().min(1).max(200).optional()
|
|
1893
|
+
});
|
|
1894
|
+
var AppsProjectsMoveResult = import_zod26.z.strictObject({ chat: ChatRow, project: ChatProject });
|
|
1895
|
+
var AppsProjectsCreateParams = import_zod26.z.strictObject({ app_key: AppKey, name: import_zod26.z.string().min(1).max(200) });
|
|
1896
|
+
var AppsProjectsCreateResult = import_zod26.z.strictObject({ project: ChatProject });
|
|
1897
|
+
var AppsProjectsImportPinsParams = import_zod26.z.strictObject({ app_key: AppKey });
|
|
1898
|
+
var AppsProjectsImportPinsResult = import_zod26.z.strictObject({ message: import_zod26.z.string().max(400) });
|
|
1899
|
+
var ColdChat = import_zod26.z.strictObject({
|
|
1701
1900
|
id: ChatId,
|
|
1702
|
-
title:
|
|
1703
|
-
repo:
|
|
1704
|
-
window:
|
|
1705
|
-
account:
|
|
1706
|
-
model_name:
|
|
1901
|
+
title: import_zod26.z.string().max(1e3),
|
|
1902
|
+
repo: import_zod26.z.string().max(200).nullable(),
|
|
1903
|
+
window: import_zod26.z.string().max(64).nullable(),
|
|
1904
|
+
account: import_zod26.z.string().max(320).nullable(),
|
|
1905
|
+
model_name: import_zod26.z.string().max(120).nullable(),
|
|
1707
1906
|
context_tokens: nonNegInt,
|
|
1708
1907
|
cold_at_ms: epochMs,
|
|
1709
1908
|
/** Waking it once the cache is cold. */
|
|
1710
|
-
cold_cost:
|
|
1909
|
+
cold_cost: import_zod26.z.number().nullable(),
|
|
1711
1910
|
/** Waking it while the cache is warm. */
|
|
1712
|
-
warm_cost:
|
|
1911
|
+
warm_cost: import_zod26.z.number().nullable(),
|
|
1713
1912
|
/** Its account is on extra usage (a 5-minute cache, and real money). */
|
|
1714
|
-
extra_usage:
|
|
1913
|
+
extra_usage: import_zod26.z.boolean(),
|
|
1715
1914
|
/** A scheduled routine's run. */
|
|
1716
|
-
scheduled:
|
|
1915
|
+
scheduled: import_zod26.z.boolean(),
|
|
1717
1916
|
/** It can be shown in its window (started in the desktop app). */
|
|
1718
|
-
openable:
|
|
1917
|
+
openable: import_zod26.z.boolean(),
|
|
1719
1918
|
/** How its window was decided, or why it can't be opened. */
|
|
1720
|
-
how:
|
|
1919
|
+
how: import_zod26.z.string().max(200).nullable()
|
|
1721
1920
|
});
|
|
1722
|
-
var AppsChatsColdParams =
|
|
1723
|
-
var AppsChatsColdResult =
|
|
1921
|
+
var AppsChatsColdParams = import_zod26.z.strictObject({ app_key: AppKey });
|
|
1922
|
+
var AppsChatsColdResult = import_zod26.z.strictObject({
|
|
1724
1923
|
app_key: AppKey,
|
|
1725
1924
|
/** Waiting for the person with a warm cache, most urgent first. */
|
|
1726
|
-
waiting:
|
|
1925
|
+
waiting: import_zod26.z.array(ColdChat).max(2e3),
|
|
1727
1926
|
/** Went cold in the last while. */
|
|
1728
|
-
recently_cold:
|
|
1927
|
+
recently_cold: import_zod26.z.array(ColdChat).max(2e3),
|
|
1729
1928
|
/** Chats working right now (not waiting). */
|
|
1730
1929
|
working: nonNegInt
|
|
1731
1930
|
});
|
|
1732
|
-
var AppsChatsOpenParams =
|
|
1733
|
-
var SpendSplit =
|
|
1734
|
-
var SpendScopes =
|
|
1735
|
-
var SpendAccount =
|
|
1736
|
-
account:
|
|
1931
|
+
var AppsChatsOpenParams = import_zod26.z.strictObject({ app_key: AppKey, chat_id: ChatId, window: ChatPlace.optional() });
|
|
1932
|
+
var SpendSplit = import_zod26.z.strictObject({ main: import_zod26.z.number(), helpers: import_zod26.z.number() });
|
|
1933
|
+
var SpendScopes = import_zod26.z.strictObject({ today: SpendSplit, week: SpendSplit });
|
|
1934
|
+
var SpendAccount = import_zod26.z.strictObject({
|
|
1935
|
+
account: import_zod26.z.string().max(320),
|
|
1737
1936
|
spend: SpendScopes,
|
|
1738
|
-
last_hour:
|
|
1739
|
-
last_5h:
|
|
1740
|
-
five_hour:
|
|
1741
|
-
weekly:
|
|
1937
|
+
last_hour: import_zod26.z.number().nullable(),
|
|
1938
|
+
last_5h: import_zod26.z.number().nullable(),
|
|
1939
|
+
five_hour: import_zod26.z.number().nullable(),
|
|
1940
|
+
weekly: import_zod26.z.number().nullable(),
|
|
1742
1941
|
as_of_ms: epochMs.nullable(),
|
|
1743
1942
|
weekly_resets_at_ms: epochMs.nullable(),
|
|
1744
1943
|
/** When the 5-hour or weekly limit is projected to be reached at the current burn. */
|
|
1745
1944
|
five_hour_full_at_ms: epochMs.nullable(),
|
|
1746
1945
|
weekly_full_at_ms: epochMs.nullable(),
|
|
1747
1946
|
/** The reading is too old to project. */
|
|
1748
|
-
stale:
|
|
1947
|
+
stale: import_zod26.z.boolean()
|
|
1749
1948
|
});
|
|
1750
|
-
var SpendModel =
|
|
1751
|
-
var SpendChat =
|
|
1949
|
+
var SpendModel = import_zod26.z.strictObject({ model: import_zod26.z.string().max(120), name: import_zod26.z.string().max(120), spend: SpendScopes });
|
|
1950
|
+
var SpendChat = import_zod26.z.strictObject({
|
|
1752
1951
|
id: ChatId,
|
|
1753
|
-
title:
|
|
1754
|
-
repo:
|
|
1755
|
-
window:
|
|
1952
|
+
title: import_zod26.z.string().max(1e3),
|
|
1953
|
+
repo: import_zod26.z.string().max(200).nullable(),
|
|
1954
|
+
window: import_zod26.z.string().max(64).nullable(),
|
|
1756
1955
|
spend: SpendScopes,
|
|
1757
1956
|
helpers: nonNegInt
|
|
1758
1957
|
});
|
|
1759
|
-
var SpendHelper =
|
|
1760
|
-
var SpendLive =
|
|
1761
|
-
var SpendIdleScope =
|
|
1762
|
-
var SpendIdle =
|
|
1763
|
-
var SpendStart =
|
|
1764
|
-
var AppsSpendParams =
|
|
1765
|
-
var AppsSpendResult =
|
|
1958
|
+
var SpendHelper = import_zod26.z.strictObject({ model: import_zod26.z.string().max(120), steps: nonNegInt, over_steps: import_zod26.z.boolean(), description: import_zod26.z.string().max(400) });
|
|
1959
|
+
var SpendLive = import_zod26.z.strictObject({ id: ChatId, title: import_zod26.z.string().max(1e3), window: import_zod26.z.string().max(64).nullable(), helpers: import_zod26.z.array(SpendHelper).max(200) });
|
|
1960
|
+
var SpendIdleScope = import_zod26.z.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: import_zod26.z.number(), avoidable: import_zod26.z.number() });
|
|
1961
|
+
var SpendIdle = import_zod26.z.strictObject({ id: ChatId, chat: import_zod26.z.string().max(1e3), who: import_zod26.z.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
|
|
1962
|
+
var SpendStart = import_zod26.z.strictObject({ repo: import_zod26.z.string().max(200), count: nonNegInt, median: nonNegInt, latest: import_zod26.z.array(nonNegInt).max(20), alarm: import_zod26.z.string().max(400).nullable() });
|
|
1963
|
+
var AppsSpendParams = import_zod26.z.strictObject({ app_key: AppKey });
|
|
1964
|
+
var AppsSpendResult = import_zod26.z.strictObject({
|
|
1766
1965
|
app_key: AppKey,
|
|
1767
1966
|
/** False while older chats are still being read. */
|
|
1768
|
-
complete:
|
|
1769
|
-
today_total:
|
|
1770
|
-
week_total:
|
|
1771
|
-
idle_today:
|
|
1772
|
-
idle_week:
|
|
1967
|
+
complete: import_zod26.z.boolean(),
|
|
1968
|
+
today_total: import_zod26.z.number(),
|
|
1969
|
+
week_total: import_zod26.z.number(),
|
|
1970
|
+
idle_today: import_zod26.z.number(),
|
|
1971
|
+
idle_week: import_zod26.z.number(),
|
|
1773
1972
|
/** Models with no known list price. */
|
|
1774
|
-
unpriced:
|
|
1973
|
+
unpriced: import_zod26.z.array(import_zod26.z.string().max(120)).max(100),
|
|
1775
1974
|
/** Helpers past their step budget, unusual starting sizes. */
|
|
1776
|
-
alarms:
|
|
1777
|
-
live:
|
|
1778
|
-
accounts:
|
|
1779
|
-
models:
|
|
1780
|
-
chats:
|
|
1781
|
-
idle:
|
|
1782
|
-
starts:
|
|
1783
|
-
});
|
|
1784
|
-
var AppsSyncStatusParams =
|
|
1785
|
-
var AppsSyncStatusResult =
|
|
1786
|
-
healthy:
|
|
1787
|
-
summary:
|
|
1788
|
-
problems:
|
|
1789
|
-
warnings:
|
|
1975
|
+
alarms: import_zod26.z.array(import_zod26.z.string().max(400)).max(200),
|
|
1976
|
+
live: import_zod26.z.array(SpendLive).max(200),
|
|
1977
|
+
accounts: import_zod26.z.array(SpendAccount).max(200),
|
|
1978
|
+
models: import_zod26.z.array(SpendModel).max(100),
|
|
1979
|
+
chats: import_zod26.z.array(SpendChat).max(500),
|
|
1980
|
+
idle: import_zod26.z.array(SpendIdle).max(500),
|
|
1981
|
+
starts: import_zod26.z.array(SpendStart).max(200)
|
|
1982
|
+
});
|
|
1983
|
+
var AppsSyncStatusParams = import_zod26.z.strictObject({ app_key: AppKey });
|
|
1984
|
+
var AppsSyncStatusResult = import_zod26.z.strictObject({
|
|
1985
|
+
healthy: import_zod26.z.boolean(),
|
|
1986
|
+
summary: import_zod26.z.string().max(400),
|
|
1987
|
+
problems: import_zod26.z.array(import_zod26.z.string().max(400)).max(200),
|
|
1988
|
+
warnings: import_zod26.z.array(import_zod26.z.string().max(400)).max(200),
|
|
1790
1989
|
/** Accounts seen with no saved name yet (Save account names fixes them). */
|
|
1791
|
-
unnamed_accounts:
|
|
1990
|
+
unnamed_accounts: import_zod26.z.array(import_zod26.z.string().max(80)).max(200),
|
|
1792
1991
|
/** The full report. */
|
|
1793
|
-
output:
|
|
1992
|
+
output: import_zod26.z.string().max(2e5)
|
|
1794
1993
|
});
|
|
1795
|
-
var AppsSyncRunParams =
|
|
1796
|
-
var AppsWindowsProcessesParams =
|
|
1797
|
-
var AppsWindowsProcessesResult =
|
|
1798
|
-
var AppsWindowsAddParams =
|
|
1799
|
-
var AppsWindowsSaveNamesParams =
|
|
1994
|
+
var AppsSyncRunParams = import_zod26.z.strictObject({ app_key: AppKey });
|
|
1995
|
+
var AppsWindowsProcessesParams = import_zod26.z.strictObject({ app_key: AppKey });
|
|
1996
|
+
var AppsWindowsProcessesResult = import_zod26.z.strictObject({ processes: import_zod26.z.array(import_zod26.z.string().max(2e3)).max(2e3) });
|
|
1997
|
+
var AppsWindowsAddParams = import_zod26.z.strictObject({ app_key: AppKey, window: ChatPlace, email: import_zod26.z.string().min(3).max(320) });
|
|
1998
|
+
var AppsWindowsSaveNamesParams = import_zod26.z.strictObject({ app_key: AppKey });
|
|
1800
1999
|
|
|
1801
2000
|
// src/schema/registry.ts
|
|
1802
2001
|
var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
|
|
@@ -1892,9 +2091,19 @@ var OPS = {
|
|
|
1892
2091
|
"power.status": { params: PowerStatusParams, result: PowerStatusResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
|
|
1893
2092
|
"power.prevent_sleep": { params: PowerPreventSleepParams, result: PowerPreventSleepResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
1894
2093
|
"resources.snapshot": { params: ResourcesSnapshotParams, result: ResourcesSnapshotResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
|
|
2094
|
+
"resources.activity": { params: ResourcesActivityParams, result: ResourcesActivityResult, kind: "unary", since: "1.17", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2095
|
+
"resources.stop_job": { params: ResourcesStopJobParams, result: ResourcesStopJobResult, kind: "unary", since: "1.17", errors: ["NOT_FOUND", "CONFLICT", "AUTH_FORBIDDEN", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2096
|
+
"resources.incidents": { params: ResourcesIncidentsParams, result: ResourcesIncidentsResult, kind: "unary", since: "1.17", errors: ["INTERNAL"] },
|
|
1895
2097
|
"audio.devices": { params: AudioDevicesParams, result: AudioDevicesResult, kind: "unary", since: "1.6", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
1896
2098
|
"audio.record": { params: AudioRecordParams, result: AudioRecordResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "RESOURCE_BUSY", "INTERNAL"] },
|
|
1897
2099
|
"audio.play": { params: AudioPlayParams, result: AudioPlayResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2100
|
+
// The local AI Matrx servers (aidream's process-compose stack), supervised from Matrx 2's core.
|
|
2101
|
+
"stack.state": { params: StackStateParams, result: StackStateResult, kind: "unary", since: "1.16", errors: ["INTERNAL"] },
|
|
2102
|
+
"stack.start": { params: StackStartParams, result: StackRunResult, kind: "unary", since: "1.16", errors: ["RESOURCE_BUSY", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2103
|
+
"stack.stop": { params: StackStopParams, result: StackRunResult, kind: "unary", since: "1.16", errors: ["RESOURCE_BUSY", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2104
|
+
"stack.server.action": { params: StackServerActionParams, result: StackServerActionResult, kind: "unary", since: "1.16", errors: ["NOT_FOUND", "CONFLICT", "INTERNAL"] },
|
|
2105
|
+
"stack.logs": { params: StackLogsParams, result: StackLogsResult, kind: "unary", since: "1.16", errors: ["NOT_FOUND", "INTERNAL"] },
|
|
2106
|
+
"stack.errors": { params: StackErrorsParams, result: StackErrorsResult, kind: "unary", since: "1.16", errors: ["INTERNAL"] },
|
|
1898
2107
|
// Claude Code history (SPEC §6 coding): served by the `coding` Python service through SERVICES below.
|
|
1899
2108
|
"coding.history.import_missing": { params: CodingHistoryImportMissingParams, result: CodingHistoryImportMissingResult, kind: "unary", since: "1.5", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "CANCELLED", "INTERNAL"] }
|
|
1900
2109
|
};
|