@ai-matrx/desktop-protocol 0.17.11 → 0.17.12

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