@ai-matrx/desktop-protocol 0.21.15 → 0.21.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/client.cjs +675 -599
- 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 +675 -599
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +844 -744
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +162 -6
- package/dist/index.d.ts +162 -6
- package/dist/index.js +844 -744
- package/dist/index.js.map +1 -1
- package/dist/{models-BFxuhPGw.d.cts → models-BpZriuN2.d.cts} +206 -1
- package/dist/{models-BFxuhPGw.d.ts → models-BpZriuN2.d.ts} +206 -1
- package/dist/react.d.cts +80 -0
- package/dist/react.d.ts +80 -0
- package/generated/desktop-protocol.schema.json +352 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -21,8 +21,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
AbsPath: () => AbsPath,
|
|
24
|
+
AccountAgent: () => AccountAgent,
|
|
25
|
+
AccountAgentsListParams: () => AccountAgentsListParams,
|
|
26
|
+
AccountAgentsListResult: () => AccountAgentsListResult,
|
|
27
|
+
AccountReadState: () => AccountReadState,
|
|
24
28
|
AccountReset: () => AccountReset,
|
|
29
|
+
AccountRowId: () => AccountRowId,
|
|
25
30
|
AccountUsage: () => AccountUsage,
|
|
31
|
+
AccountVaultCopyParams: () => AccountVaultCopyParams,
|
|
32
|
+
AccountVaultCopyResult: () => AccountVaultCopyResult,
|
|
33
|
+
AccountVaultListParams: () => AccountVaultListParams,
|
|
34
|
+
AccountVaultListResult: () => AccountVaultListResult,
|
|
26
35
|
AppFeatureStatus: () => AppFeatureStatus,
|
|
27
36
|
AppInfo: () => AppInfo,
|
|
28
37
|
AppKey: () => AppKey,
|
|
@@ -434,6 +443,9 @@ __export(src_exports, {
|
|
|
434
443
|
TranscriptionModelId: () => TranscriptionModelId,
|
|
435
444
|
TranscriptionModelInfo: () => TranscriptionModelInfo,
|
|
436
445
|
VERSIONED_RESULT_OPS: () => VERSIONED_RESULT_OPS,
|
|
446
|
+
VaultFieldSummary: () => VaultFieldSummary,
|
|
447
|
+
VaultItemKind: () => VaultItemKind,
|
|
448
|
+
VaultItemSummary: () => VaultItemSummary,
|
|
437
449
|
WEB_MAX_TEXT_CHARS: () => WEB_MAX_TEXT_CHARS,
|
|
438
450
|
WebBrowserFetchParams: () => WebBrowserFetchParams,
|
|
439
451
|
WebBrowserFetchResult: () => WebBrowserFetchResult,
|
|
@@ -488,7 +500,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
488
500
|
var import_zod = require("zod");
|
|
489
501
|
var import_uuid = require("@ai-matrx/kit/uuid");
|
|
490
502
|
var PROTOCOL_MAJOR = 1;
|
|
491
|
-
var PROTOCOL_MINOR =
|
|
503
|
+
var PROTOCOL_MINOR = 23;
|
|
492
504
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
493
505
|
var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
494
506
|
var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -1286,24 +1298,96 @@ var ModelsStatusResult = import_zod10.z.strictObject({
|
|
|
1286
1298
|
});
|
|
1287
1299
|
var ModelsProgressEvent = import_zod10.z.strictObject({ request_id: RequestId, progress: MlProgress });
|
|
1288
1300
|
|
|
1289
|
-
// src/schema/
|
|
1301
|
+
// src/schema/account.ts
|
|
1290
1302
|
var import_zod11 = require("zod");
|
|
1291
1303
|
var import_uuid2 = require("@ai-matrx/kit/uuid");
|
|
1292
|
-
var
|
|
1293
|
-
var
|
|
1294
|
-
var
|
|
1295
|
-
|
|
1296
|
-
|
|
1304
|
+
var AccountRowId = import_zod11.z.string().regex(import_uuid2.UUID_SHAPE_PATTERN);
|
|
1305
|
+
var AccountReadState = import_zod11.z.enum(["ok", "signed_out", "unavailable"]);
|
|
1306
|
+
var AccountAgent = import_zod11.z.strictObject({
|
|
1307
|
+
id: AccountRowId,
|
|
1308
|
+
name: import_zod11.z.string().min(1).max(200),
|
|
1309
|
+
description: import_zod11.z.string().max(2e3),
|
|
1310
|
+
/** The agent's category ("" when it has none): the library's folders. */
|
|
1311
|
+
category: import_zod11.z.string().max(120),
|
|
1312
|
+
/** The agent's kind as the platform names it (user, builtin, orchestra…). */
|
|
1313
|
+
agent_type: import_zod11.z.string().max(40),
|
|
1314
|
+
is_favorite: import_zod11.z.boolean(),
|
|
1315
|
+
/** The person owns it (false: shared with them). */
|
|
1316
|
+
is_owner: import_zod11.z.boolean(),
|
|
1317
|
+
/** Who shared it, when it is shared with the person. */
|
|
1318
|
+
shared_by: import_zod11.z.string().max(320).nullable(),
|
|
1319
|
+
/** The organization it belongs to. */
|
|
1320
|
+
organization: import_zod11.z.string().max(200).nullable(),
|
|
1321
|
+
updated_at_ms: epochMs
|
|
1322
|
+
});
|
|
1323
|
+
var AccountAgentsListParams = import_zod11.z.strictObject({});
|
|
1324
|
+
var AccountAgentsListResult = import_zod11.z.strictObject({
|
|
1325
|
+
state: AccountReadState,
|
|
1326
|
+
/** One line when state is not "ok" (what went wrong, in plain words); null otherwise. */
|
|
1327
|
+
problem: import_zod11.z.string().max(300).nullable(),
|
|
1328
|
+
agents: import_zod11.z.array(AccountAgent).max(2e3)
|
|
1329
|
+
});
|
|
1330
|
+
var VaultItemKind = import_zod11.z.enum(["login", "passkey", "key", "other"]);
|
|
1331
|
+
var VaultFieldSummary = import_zod11.z.strictObject({
|
|
1332
|
+
key: import_zod11.z.string().min(1).max(120),
|
|
1333
|
+
/** visible: shown as written; revealable: copyable on request; sealed: never leaves the server. */
|
|
1334
|
+
handling: import_zod11.z.enum(["visible", "revealable", "sealed"]),
|
|
1335
|
+
/** The masked hint the server keeps ("••••ab12"), or "" when it keeps none. */
|
|
1336
|
+
hint: import_zod11.z.string().max(200)
|
|
1337
|
+
});
|
|
1338
|
+
var VaultItemSummary = import_zod11.z.strictObject({
|
|
1339
|
+
id: AccountRowId,
|
|
1340
|
+
name: import_zod11.z.string().min(1).max(200),
|
|
1341
|
+
kind: VaultItemKind,
|
|
1342
|
+
/** The platform's definition ("website_login", "native_passkey", "custom"…). */
|
|
1343
|
+
definition: import_zod11.z.string().max(80),
|
|
1344
|
+
/** The sign-in's user name hint (its "username" field's hint); null when it has none. */
|
|
1345
|
+
username: import_zod11.z.string().max(200).nullable(),
|
|
1346
|
+
/** The sites a sign-in is for. */
|
|
1347
|
+
urls: import_zod11.z.array(import_zod11.z.string().max(2048)).max(20),
|
|
1348
|
+
notes: import_zod11.z.string().max(4e3).nullable(),
|
|
1349
|
+
fields: import_zod11.z.array(VaultFieldSummary).max(50),
|
|
1350
|
+
/** Shared with the person by someone else (Passwords' shared groups). */
|
|
1351
|
+
shared: import_zod11.z.boolean(),
|
|
1352
|
+
/** active, or the server's other states (a deleted item waits in "deleted"). */
|
|
1353
|
+
status: import_zod11.z.string().max(40),
|
|
1354
|
+
created_at_ms: epochMs,
|
|
1355
|
+
updated_at_ms: epochMs
|
|
1356
|
+
});
|
|
1357
|
+
var AccountVaultListParams = import_zod11.z.strictObject({});
|
|
1358
|
+
var AccountVaultListResult = import_zod11.z.strictObject({
|
|
1359
|
+
state: AccountReadState,
|
|
1360
|
+
problem: import_zod11.z.string().max(300).nullable(),
|
|
1361
|
+
items: import_zod11.z.array(VaultItemSummary).max(5e3)
|
|
1362
|
+
});
|
|
1363
|
+
var AccountVaultCopyParams = import_zod11.z.strictObject({
|
|
1364
|
+
item_id: AccountRowId,
|
|
1365
|
+
field_key: import_zod11.z.string().min(1).max(120)
|
|
1366
|
+
});
|
|
1367
|
+
var AccountVaultCopyResult = import_zod11.z.strictObject({
|
|
1368
|
+
copied: import_zod11.z.boolean(),
|
|
1369
|
+
/** When the clipboard is cleared again if it still holds the value (Passwords clears a copied password). */
|
|
1370
|
+
clears_at_ms: epochMs
|
|
1371
|
+
});
|
|
1372
|
+
|
|
1373
|
+
// src/schema/apps.ts
|
|
1374
|
+
var import_zod12 = require("zod");
|
|
1375
|
+
var import_uuid3 = require("@ai-matrx/kit/uuid");
|
|
1376
|
+
var AppKey = import_zod12.z.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
|
|
1377
|
+
var AppProfileId = import_zod12.z.string().regex(import_uuid3.UUID_SHAPE_PATTERN);
|
|
1378
|
+
var AppProfileLocator = import_zod12.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}$/);
|
|
1379
|
+
var AppSupport = import_zod12.z.enum(["supported", "partial", "unsupported"]);
|
|
1380
|
+
var AppFeatureStatus = import_zod12.z.strictObject({
|
|
1297
1381
|
status: AppSupport,
|
|
1298
1382
|
/** One line, set whenever status is not "supported". */
|
|
1299
|
-
reason:
|
|
1383
|
+
reason: import_zod12.z.string().max(140).nullable()
|
|
1300
1384
|
});
|
|
1301
|
-
var AppInfo =
|
|
1385
|
+
var AppInfo = import_zod12.z.strictObject({
|
|
1302
1386
|
app_key: AppKey,
|
|
1303
|
-
name:
|
|
1304
|
-
installed:
|
|
1387
|
+
name: import_zod12.z.string().max(64),
|
|
1388
|
+
installed: import_zod12.z.boolean(),
|
|
1305
1389
|
/** The app's own version string, or null when it is not installed or does not say. */
|
|
1306
|
-
version:
|
|
1390
|
+
version: import_zod12.z.string().max(64).nullable(),
|
|
1307
1391
|
/** The install found (an .app bundle, an .exe, a binary), or null. */
|
|
1308
1392
|
location: AbsPath.nullable(),
|
|
1309
1393
|
/** Open the app at all on this OS. */
|
|
@@ -1313,148 +1397,148 @@ var AppInfo = import_zod11.z.strictObject({
|
|
|
1313
1397
|
/** Plan usage read from the app's own files on this OS. */
|
|
1314
1398
|
usage: AppFeatureStatus
|
|
1315
1399
|
});
|
|
1316
|
-
var AppUsageReading =
|
|
1317
|
-
window:
|
|
1400
|
+
var AppUsageReading = import_zod12.z.strictObject({
|
|
1401
|
+
window: import_zod12.z.enum(["five_hour", "weekly", "extra"]),
|
|
1318
1402
|
/** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
|
|
1319
|
-
percent:
|
|
1403
|
+
percent: import_zod12.z.number().min(0).max(1e4),
|
|
1320
1404
|
/** When the app recorded it. */
|
|
1321
1405
|
sampled_at_ms: epochMs,
|
|
1322
1406
|
/** True when the window has rolled over since the sample, so the figure has reset. */
|
|
1323
|
-
reset_since:
|
|
1407
|
+
reset_since: import_zod12.z.boolean()
|
|
1324
1408
|
});
|
|
1325
|
-
var AppProfile =
|
|
1409
|
+
var AppProfile = import_zod12.z.strictObject({
|
|
1326
1410
|
/** The row's id; null for a folder found on disk that no row names yet. */
|
|
1327
1411
|
id: AppProfileId.nullable(),
|
|
1328
1412
|
app_key: AppKey,
|
|
1329
|
-
display_name:
|
|
1413
|
+
display_name: import_zod12.z.string().min(1).max(120),
|
|
1330
1414
|
/** The account the person means to be signed in here; null when not stated (never guessed). */
|
|
1331
|
-
account_identity:
|
|
1415
|
+
account_identity: import_zod12.z.string().min(3).max(320).nullable(),
|
|
1332
1416
|
profile_locator: AppProfileLocator.nullable(),
|
|
1333
1417
|
/** The device the row is tied to; null when the row names none. */
|
|
1334
1418
|
device_id: DeviceId.nullable(),
|
|
1335
1419
|
/** The folder this profile resolves to on this device; null for a row tied to another device. */
|
|
1336
1420
|
folder: AbsPath.nullable(),
|
|
1337
1421
|
/** The folder exists on this device. */
|
|
1338
|
-
on_disk:
|
|
1422
|
+
on_disk: import_zod12.z.boolean(),
|
|
1339
1423
|
/** An instance with this profile is running; null when it could not be determined. */
|
|
1340
|
-
running:
|
|
1424
|
+
running: import_zod12.z.boolean().nullable(),
|
|
1341
1425
|
/** Usage the app recorded for this profile; null when the app exposes none here. */
|
|
1342
|
-
usage:
|
|
1426
|
+
usage: import_zod12.z.array(AppUsageReading).nullable(),
|
|
1343
1427
|
last_opened_ms: epochMs.nullable()
|
|
1344
1428
|
});
|
|
1345
|
-
var AppsListParams =
|
|
1346
|
-
var AppsListResult =
|
|
1347
|
-
var AppsProfilesListParams =
|
|
1429
|
+
var AppsListParams = import_zod12.z.strictObject({});
|
|
1430
|
+
var AppsListResult = import_zod12.z.strictObject({ apps: import_zod12.z.array(AppInfo) });
|
|
1431
|
+
var AppsProfilesListParams = import_zod12.z.strictObject({
|
|
1348
1432
|
/** Only this app's profiles; every app's when absent. */
|
|
1349
1433
|
app_key: AppKey.optional()
|
|
1350
1434
|
});
|
|
1351
|
-
var AppsProfilesListResult =
|
|
1352
|
-
profiles:
|
|
1435
|
+
var AppsProfilesListResult = import_zod12.z.strictObject({
|
|
1436
|
+
profiles: import_zod12.z.array(AppProfile),
|
|
1353
1437
|
/**
|
|
1354
1438
|
* Whether the saved rows could be read: false while signed out or offline, when only folders
|
|
1355
1439
|
* found on disk are listed.
|
|
1356
1440
|
*/
|
|
1357
|
-
registry:
|
|
1441
|
+
registry: import_zod12.z.enum(["ok", "signed_out", "unavailable"])
|
|
1358
1442
|
});
|
|
1359
|
-
var AppsProfilesSaveParams =
|
|
1443
|
+
var AppsProfilesSaveParams = import_zod12.z.strictObject({
|
|
1360
1444
|
id: AppProfileId.optional(),
|
|
1361
1445
|
app_key: AppKey,
|
|
1362
|
-
display_name:
|
|
1363
|
-
account_identity:
|
|
1446
|
+
display_name: import_zod12.z.string().min(1).max(120),
|
|
1447
|
+
account_identity: import_zod12.z.string().min(3).max(320).nullable(),
|
|
1364
1448
|
/** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
|
|
1365
1449
|
profile_locator: AppProfileLocator.nullable(),
|
|
1366
1450
|
/** On create with profile_locator null: make a new folder named after display_name instead. */
|
|
1367
|
-
new_folder:
|
|
1451
|
+
new_folder: import_zod12.z.boolean().default(false)
|
|
1368
1452
|
});
|
|
1369
1453
|
var AppsProfilesSaveResult = AppProfile;
|
|
1370
|
-
var AppsProfilesRemoveParams =
|
|
1371
|
-
var AppsProfilesRemoveResult =
|
|
1372
|
-
var AppsOpenParams =
|
|
1454
|
+
var AppsProfilesRemoveParams = import_zod12.z.strictObject({ id: AppProfileId });
|
|
1455
|
+
var AppsProfilesRemoveResult = import_zod12.z.strictObject({ removed: import_zod12.z.boolean() });
|
|
1456
|
+
var AppsOpenParams = import_zod12.z.strictObject({
|
|
1373
1457
|
app_key: AppKey,
|
|
1374
1458
|
profile_id: AppProfileId.optional()
|
|
1375
1459
|
});
|
|
1376
|
-
var AppsOpenResult =
|
|
1460
|
+
var AppsOpenResult = import_zod12.z.strictObject({
|
|
1377
1461
|
/** True when an instance with this profile was already running; it is brought forward. */
|
|
1378
|
-
already_running:
|
|
1462
|
+
already_running: import_zod12.z.boolean(),
|
|
1379
1463
|
folder: AbsPath.nullable()
|
|
1380
1464
|
});
|
|
1381
1465
|
|
|
1382
1466
|
// src/schema/apps-chats.ts
|
|
1383
|
-
var
|
|
1384
|
-
var ChatId =
|
|
1385
|
-
var ChatPlace =
|
|
1386
|
-
var ChatProjectId =
|
|
1387
|
-
var ChatWindow =
|
|
1467
|
+
var import_zod13 = require("zod");
|
|
1468
|
+
var ChatId = import_zod13.z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/);
|
|
1469
|
+
var ChatPlace = import_zod13.z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/);
|
|
1470
|
+
var ChatProjectId = import_zod13.z.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
|
|
1471
|
+
var ChatWindow = import_zod13.z.strictObject({
|
|
1388
1472
|
key: ChatPlace,
|
|
1389
1473
|
/** The app's default profile (Claude: the main window, which lists every account's chats). */
|
|
1390
|
-
main:
|
|
1474
|
+
main: import_zod13.z.boolean(),
|
|
1391
1475
|
/** The account the window is signed into, when known. */
|
|
1392
|
-
account:
|
|
1476
|
+
account: import_zod13.z.string().max(320).nullable()
|
|
1393
1477
|
});
|
|
1394
|
-
var ChatProject =
|
|
1478
|
+
var ChatProject = import_zod13.z.strictObject({
|
|
1395
1479
|
id: ChatProjectId,
|
|
1396
|
-
name:
|
|
1397
|
-
archived:
|
|
1480
|
+
name: import_zod13.z.string().min(1).max(200),
|
|
1481
|
+
archived: import_zod13.z.boolean(),
|
|
1398
1482
|
/** Chats in it. */
|
|
1399
1483
|
count: nonNegInt
|
|
1400
1484
|
});
|
|
1401
|
-
var ChatPin =
|
|
1485
|
+
var ChatPin = import_zod13.z.strictObject({
|
|
1402
1486
|
/** The window whose account pins it; an account with no window of its own is named by its email. */
|
|
1403
|
-
window:
|
|
1487
|
+
window: import_zod13.z.string().min(1).max(320),
|
|
1404
1488
|
/** When that account's pin list was last read; null when the reading has no time. */
|
|
1405
1489
|
observed_at_ms: epochMs.nullable()
|
|
1406
1490
|
});
|
|
1407
|
-
var ChatRunning =
|
|
1491
|
+
var ChatRunning = import_zod13.z.strictObject({
|
|
1408
1492
|
window: ChatPlace,
|
|
1409
1493
|
/** process: a live process resumed this chat there (exact); activity: that window's own record moved in the last 3 minutes. */
|
|
1410
|
-
how:
|
|
1494
|
+
how: import_zod13.z.enum(["process", "activity"])
|
|
1411
1495
|
});
|
|
1412
|
-
var ChatHidden =
|
|
1496
|
+
var ChatHidden = import_zod13.z.strictObject({
|
|
1413
1497
|
window: ChatPlace,
|
|
1414
|
-
reason:
|
|
1498
|
+
reason: import_zod13.z.string().max(200)
|
|
1415
1499
|
});
|
|
1416
|
-
var ChatLastUse =
|
|
1500
|
+
var ChatLastUse = import_zod13.z.strictObject({
|
|
1417
1501
|
/** The conversation's last reply. */
|
|
1418
1502
|
at_ms: epochMs,
|
|
1419
1503
|
window: ChatPlace.nullable(),
|
|
1420
|
-
account:
|
|
1504
|
+
account: import_zod13.z.string().max(320).nullable(),
|
|
1421
1505
|
/** How the window was decided (one short line). */
|
|
1422
|
-
how:
|
|
1506
|
+
how: import_zod13.z.string().max(120).nullable(),
|
|
1423
1507
|
/** The account's 1-hour prompt cache is still warm. */
|
|
1424
|
-
cache_warm:
|
|
1508
|
+
cache_warm: import_zod13.z.boolean(),
|
|
1425
1509
|
cache_minutes_left: nonNegInt
|
|
1426
1510
|
});
|
|
1427
|
-
var ChatAppProject =
|
|
1428
|
-
id:
|
|
1429
|
-
name:
|
|
1511
|
+
var ChatAppProject = import_zod13.z.strictObject({
|
|
1512
|
+
id: import_zod13.z.string().min(1).max(200),
|
|
1513
|
+
name: import_zod13.z.string().max(200)
|
|
1430
1514
|
});
|
|
1431
|
-
var ChatTitleSource =
|
|
1432
|
-
var ChatRow =
|
|
1515
|
+
var ChatTitleSource = import_zod13.z.enum(["app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt"]);
|
|
1516
|
+
var ChatRow = import_zod13.z.strictObject({
|
|
1433
1517
|
id: ChatId,
|
|
1434
1518
|
/** The short id people see (the listing's first 8 characters). */
|
|
1435
|
-
short_id:
|
|
1519
|
+
short_id: import_zod13.z.string().max(16),
|
|
1436
1520
|
/** The listing's own name (Claude: local_<id>), null for a chat only in the holder. */
|
|
1437
|
-
record:
|
|
1438
|
-
title:
|
|
1521
|
+
record: import_zod13.z.string().max(160).nullable(),
|
|
1522
|
+
title: import_zod13.z.string().max(1e3),
|
|
1439
1523
|
last_active_ms: epochMs.nullable(),
|
|
1440
1524
|
created_ms: epochMs.nullable(),
|
|
1441
|
-
projects:
|
|
1442
|
-
starred:
|
|
1443
|
-
pinned_in:
|
|
1525
|
+
projects: import_zod13.z.array(ChatProjectId).max(500),
|
|
1526
|
+
starred: import_zod13.z.boolean(),
|
|
1527
|
+
pinned_in: import_zod13.z.array(ChatPin).max(200),
|
|
1444
1528
|
/** Every place it is listed now: window keys, plus "holder". */
|
|
1445
|
-
places:
|
|
1446
|
-
held:
|
|
1447
|
-
running:
|
|
1448
|
-
hidden_in:
|
|
1529
|
+
places: import_zod13.z.array(ChatPlace).max(200),
|
|
1530
|
+
held: import_zod13.z.boolean(),
|
|
1531
|
+
running: import_zod13.z.array(ChatRunning).max(200),
|
|
1532
|
+
hidden_in: import_zod13.z.array(ChatHidden).max(200),
|
|
1449
1533
|
/** Kept out of the main window on purpose. */
|
|
1450
|
-
hidden_from_main:
|
|
1534
|
+
hidden_from_main: import_zod13.z.boolean(),
|
|
1451
1535
|
/** Listed in a side window and not yet copied into main. */
|
|
1452
|
-
main_pending:
|
|
1536
|
+
main_pending: import_zod13.z.boolean(),
|
|
1453
1537
|
/** A scheduled routine's run (its task id). */
|
|
1454
|
-
scheduled:
|
|
1538
|
+
scheduled: import_zod13.z.string().max(200).nullable(),
|
|
1455
1539
|
/** Created recently and in no project: offered for filing. */
|
|
1456
|
-
new_unfiled:
|
|
1457
|
-
warnings:
|
|
1540
|
+
new_unfiled: import_zod13.z.boolean(),
|
|
1541
|
+
warnings: import_zod13.z.array(import_zod13.z.string().max(400)).max(20),
|
|
1458
1542
|
last_use: ChatLastUse.nullable(),
|
|
1459
1543
|
/** 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. */
|
|
1460
1544
|
app_project: ChatAppProject.optional(),
|
|
@@ -1464,718 +1548,718 @@ var ChatRow = import_zod12.z.strictObject({
|
|
|
1464
1548
|
* 1.14: the chat's own title before the person's rename (the one title rule, `@ai-matrx/coding-sessions/sessions`);
|
|
1465
1549
|
* `title` is what to show (`title_override` when set, else this).
|
|
1466
1550
|
*/
|
|
1467
|
-
original_title:
|
|
1551
|
+
original_title: import_zod13.z.string().max(1e3).optional(),
|
|
1468
1552
|
/** 1.14: where `original_title` came from (the one rule's sources, strongest first; 1.15: a closed set). */
|
|
1469
1553
|
title_source: ChatTitleSource.optional(),
|
|
1470
1554
|
/** 1.14: the person's rename inside Matrx (Coding Sessions), applied once by the row builder; absent = none. */
|
|
1471
|
-
title_override:
|
|
1555
|
+
title_override: import_zod13.z.string().min(1).max(300).optional(),
|
|
1472
1556
|
/** 1.15: the app itself archived it (hidden_in says where and why, in words for people; this is the typed fact). */
|
|
1473
|
-
archived:
|
|
1557
|
+
archived: import_zod13.z.boolean().optional()
|
|
1474
1558
|
});
|
|
1475
|
-
var ChatFamily =
|
|
1559
|
+
var ChatFamily = import_zod13.z.strictObject({
|
|
1476
1560
|
id: ChatId,
|
|
1477
1561
|
fork_of: ChatId.nullable(),
|
|
1478
1562
|
copy_of: ChatId.nullable()
|
|
1479
1563
|
});
|
|
1480
|
-
var AppsChatsListParams =
|
|
1564
|
+
var AppsChatsListParams = import_zod13.z.strictObject({
|
|
1481
1565
|
app_key: AppKey,
|
|
1482
1566
|
/** Only these chats (a live update re-reads just what changed). */
|
|
1483
|
-
ids:
|
|
1567
|
+
ids: import_zod13.z.array(ChatId).max(500).optional()
|
|
1484
1568
|
});
|
|
1485
|
-
var AppsChatsListResult =
|
|
1569
|
+
var AppsChatsListResult = import_zod13.z.strictObject({
|
|
1486
1570
|
app_key: AppKey,
|
|
1487
1571
|
/** Bumps on every change the index sees; `apps.chats.changed` carries the same number. */
|
|
1488
1572
|
version: nonNegInt,
|
|
1489
|
-
windows:
|
|
1490
|
-
projects:
|
|
1491
|
-
chats:
|
|
1573
|
+
windows: import_zod13.z.array(ChatWindow).max(200),
|
|
1574
|
+
projects: import_zod13.z.array(ChatProject).max(5e3),
|
|
1575
|
+
chats: import_zod13.z.array(ChatRow).max(2e4),
|
|
1492
1576
|
/** How long a chat in no project counts as new. */
|
|
1493
1577
|
new_window_ms: nonNegInt,
|
|
1494
1578
|
/** 1.9: this is the copy saved at the last read, shown while everything is read again. */
|
|
1495
|
-
updating:
|
|
1579
|
+
updating: import_zod13.z.boolean().optional(),
|
|
1496
1580
|
/** 1.9: false while the folder watches are down (changes are not arriving); `apps.chats.watch_state` says when it changes. */
|
|
1497
|
-
live:
|
|
1581
|
+
live: import_zod13.z.boolean().optional(),
|
|
1498
1582
|
/** 1.10: every listed chat that is a fork or a copy of another (read from the conversations' first lines). */
|
|
1499
|
-
families:
|
|
1583
|
+
families: import_zod13.z.array(ChatFamily).max(2e4).optional()
|
|
1500
1584
|
});
|
|
1501
|
-
var AppsChatsWatchParams =
|
|
1502
|
-
var AppsChatsWatchResult =
|
|
1503
|
-
var AppsChatsChangedEvent =
|
|
1585
|
+
var AppsChatsWatchParams = import_zod13.z.strictObject({ app_key: AppKey });
|
|
1586
|
+
var AppsChatsWatchResult = import_zod13.z.strictObject({ resource_id: ResourceId, version: nonNegInt });
|
|
1587
|
+
var AppsChatsChangedEvent = import_zod13.z.strictObject({
|
|
1504
1588
|
app_key: AppKey,
|
|
1505
1589
|
version: nonNegInt,
|
|
1506
|
-
ids:
|
|
1507
|
-
all:
|
|
1590
|
+
ids: import_zod13.z.array(ChatId).max(1e3),
|
|
1591
|
+
all: import_zod13.z.boolean()
|
|
1508
1592
|
});
|
|
1509
|
-
var AppsChatsWatchStateEvent =
|
|
1593
|
+
var AppsChatsWatchStateEvent = import_zod13.z.strictObject({
|
|
1510
1594
|
app_key: AppKey,
|
|
1511
|
-
live:
|
|
1512
|
-
updating:
|
|
1513
|
-
reason:
|
|
1595
|
+
live: import_zod13.z.boolean(),
|
|
1596
|
+
updating: import_zod13.z.boolean(),
|
|
1597
|
+
reason: import_zod13.z.string().max(300).nullable()
|
|
1514
1598
|
});
|
|
1515
|
-
var AppsChatsPlaceParams =
|
|
1599
|
+
var AppsChatsPlaceParams = import_zod13.z.strictObject({
|
|
1516
1600
|
app_key: AppKey,
|
|
1517
1601
|
chat_id: ChatId,
|
|
1518
|
-
action:
|
|
1602
|
+
action: import_zod13.z.enum(["place", "take_off", "hold"]),
|
|
1519
1603
|
/** The window (for place and take_off). */
|
|
1520
1604
|
window: ChatPlace.optional(),
|
|
1521
1605
|
/** take_off where it is open: stop it there first (the person confirmed). */
|
|
1522
|
-
stop_if_open:
|
|
1606
|
+
stop_if_open: import_zod13.z.boolean().default(false)
|
|
1523
1607
|
});
|
|
1524
|
-
var AppsChatsPlaceResult =
|
|
1525
|
-
var AppsProjectsFileManyParams =
|
|
1608
|
+
var AppsChatsPlaceResult = import_zod13.z.strictObject({ chat: ChatRow, message: import_zod13.z.string().max(400) });
|
|
1609
|
+
var AppsProjectsFileManyParams = import_zod13.z.strictObject({
|
|
1526
1610
|
app_key: AppKey,
|
|
1527
|
-
chat_ids:
|
|
1611
|
+
chat_ids: import_zod13.z.array(ChatId).min(1).max(500),
|
|
1528
1612
|
project_id: ChatProjectId.optional(),
|
|
1529
|
-
new_project_name:
|
|
1613
|
+
new_project_name: import_zod13.z.string().min(1).max(200).optional()
|
|
1530
1614
|
});
|
|
1531
|
-
var AppsProjectsFileManyResult =
|
|
1532
|
-
var AppsProjectsUpdateParams =
|
|
1615
|
+
var AppsProjectsFileManyResult = import_zod13.z.strictObject({ chats: import_zod13.z.array(ChatRow).max(500), project: ChatProject });
|
|
1616
|
+
var AppsProjectsUpdateParams = import_zod13.z.strictObject({
|
|
1533
1617
|
app_key: AppKey,
|
|
1534
1618
|
project_id: ChatProjectId,
|
|
1535
|
-
name:
|
|
1536
|
-
archived:
|
|
1619
|
+
name: import_zod13.z.string().min(1).max(200).optional(),
|
|
1620
|
+
archived: import_zod13.z.boolean().optional()
|
|
1537
1621
|
});
|
|
1538
|
-
var AppsProjectsUpdateResult =
|
|
1539
|
-
var AppsProjectsCopyParams =
|
|
1540
|
-
var AppsProjectsCopyResult =
|
|
1541
|
-
var AppsProjectsFileParams =
|
|
1622
|
+
var AppsProjectsUpdateResult = import_zod13.z.strictObject({ project: ChatProject });
|
|
1623
|
+
var AppsProjectsCopyParams = import_zod13.z.strictObject({ app_key: AppKey, project_id: ChatProjectId, new_project_name: import_zod13.z.string().min(1).max(200) });
|
|
1624
|
+
var AppsProjectsCopyResult = import_zod13.z.strictObject({ project: ChatProject });
|
|
1625
|
+
var AppsProjectsFileParams = import_zod13.z.strictObject({
|
|
1542
1626
|
app_key: AppKey,
|
|
1543
1627
|
chat_id: ChatId,
|
|
1544
1628
|
project_id: ChatProjectId.optional(),
|
|
1545
|
-
new_project_name:
|
|
1629
|
+
new_project_name: import_zod13.z.string().min(1).max(200).optional()
|
|
1546
1630
|
});
|
|
1547
|
-
var AppsProjectsFileResult =
|
|
1548
|
-
var AppsProjectsUnfileParams =
|
|
1549
|
-
var AppsProjectsUnfileResult =
|
|
1550
|
-
var AppsChatsStarParams =
|
|
1551
|
-
var AppsChatsStarResult =
|
|
1631
|
+
var AppsProjectsFileResult = import_zod13.z.strictObject({ chat: ChatRow, project: ChatProject });
|
|
1632
|
+
var AppsProjectsUnfileParams = import_zod13.z.strictObject({ app_key: AppKey, chat_id: ChatId, project_id: ChatProjectId });
|
|
1633
|
+
var AppsProjectsUnfileResult = import_zod13.z.strictObject({ chat: ChatRow });
|
|
1634
|
+
var AppsChatsStarParams = import_zod13.z.strictObject({ app_key: AppKey, chat_id: ChatId, starred: import_zod13.z.boolean() });
|
|
1635
|
+
var AppsChatsStarResult = import_zod13.z.strictObject({ chat: ChatRow });
|
|
1552
1636
|
|
|
1553
1637
|
// src/schema/apps-accounts.ts
|
|
1554
|
-
var
|
|
1555
|
-
var AppWindowInfo =
|
|
1638
|
+
var import_zod14 = require("zod");
|
|
1639
|
+
var AppWindowInfo = import_zod14.z.strictObject({
|
|
1556
1640
|
key: ChatPlace,
|
|
1557
1641
|
/** The app's default profile (Claude: main, which may sign into any account). */
|
|
1558
|
-
main:
|
|
1642
|
+
main: import_zod14.z.boolean(),
|
|
1559
1643
|
/** The account the window is meant for (null for main). */
|
|
1560
|
-
account:
|
|
1644
|
+
account: import_zod14.z.string().max(320).nullable(),
|
|
1561
1645
|
/** The account signed in there now: an email, or the account id while it has no saved name. */
|
|
1562
|
-
signed_in:
|
|
1563
|
-
signed_in_is_email:
|
|
1646
|
+
signed_in: import_zod14.z.string().max(320).nullable(),
|
|
1647
|
+
signed_in_is_email: import_zod14.z.boolean(),
|
|
1564
1648
|
/** Signed into another account than the one it is meant for. */
|
|
1565
|
-
mismatch:
|
|
1649
|
+
mismatch: import_zod14.z.boolean(),
|
|
1566
1650
|
/** Its folder exists. */
|
|
1567
|
-
created:
|
|
1651
|
+
created: import_zod14.z.boolean(),
|
|
1568
1652
|
/** Open now. */
|
|
1569
|
-
running:
|
|
1653
|
+
running: import_zod14.z.boolean(),
|
|
1570
1654
|
/** Chats open in it now (a process resuming each one). */
|
|
1571
1655
|
open_chats: nonNegInt
|
|
1572
1656
|
});
|
|
1573
|
-
var AccountUsage =
|
|
1657
|
+
var AccountUsage = import_zod14.z.strictObject({
|
|
1574
1658
|
/** The account's email, or "org <8 chars>" when no window has ever sampled that org. */
|
|
1575
|
-
account:
|
|
1576
|
-
org:
|
|
1659
|
+
account: import_zod14.z.string().max(320),
|
|
1660
|
+
org: import_zod14.z.string().max(80).nullable(),
|
|
1577
1661
|
/** False when the org was sampled in several accounts' windows and the vote is not clear (≥ 75 %). */
|
|
1578
|
-
account_certain:
|
|
1662
|
+
account_certain: import_zod14.z.boolean(),
|
|
1579
1663
|
/** 5-hour use in percent (0 once the reading is over 5 hours old). */
|
|
1580
|
-
five_hour:
|
|
1581
|
-
five_hour_reset_since:
|
|
1664
|
+
five_hour: import_zod14.z.number().nullable(),
|
|
1665
|
+
five_hour_reset_since: import_zod14.z.boolean(),
|
|
1582
1666
|
/** Weekly use in percent (0 once the week reset after the reading). */
|
|
1583
|
-
weekly:
|
|
1584
|
-
weekly_reset_since:
|
|
1667
|
+
weekly: import_zod14.z.number().nullable(),
|
|
1668
|
+
weekly_reset_since: import_zod14.z.boolean(),
|
|
1585
1669
|
/** Extra-usage spend in percent of its cap, when on. */
|
|
1586
|
-
extra_usage:
|
|
1670
|
+
extra_usage: import_zod14.z.number().nullable(),
|
|
1587
1671
|
extra_usage_as_of_ms: epochMs.nullable(),
|
|
1588
1672
|
as_of_ms: epochMs,
|
|
1589
1673
|
/** The windows meant for this account (and main when main took the reading). */
|
|
1590
|
-
windows:
|
|
1674
|
+
windows: import_zod14.z.array(ChatPlace).max(200),
|
|
1591
1675
|
/** The window that took the reading is open now and the reading is under 30 minutes old. */
|
|
1592
|
-
live:
|
|
1676
|
+
live: import_zod14.z.boolean(),
|
|
1593
1677
|
/** The next weekly reset, when known. */
|
|
1594
1678
|
weekly_resets_at_ms: epochMs.nullable(),
|
|
1595
1679
|
/** That reset time is Claude's own (its reading, or a reset seen in its usage history). */
|
|
1596
|
-
weekly_reset_official:
|
|
1680
|
+
weekly_reset_official: import_zod14.z.boolean().nullable(),
|
|
1597
1681
|
/** 1.13: the account's plan as the app names it (Codex: "pro", "prolite"), when recorded. */
|
|
1598
|
-
plan:
|
|
1682
|
+
plan: import_zod14.z.string().max(80).optional(),
|
|
1599
1683
|
/** 1.13: the account's credit balance as the app records it (Codex), when recorded. */
|
|
1600
|
-
credits:
|
|
1684
|
+
credits: import_zod14.z.string().max(40).optional()
|
|
1601
1685
|
});
|
|
1602
|
-
var AccountReset =
|
|
1686
|
+
var AccountReset = import_zod14.z.strictObject({
|
|
1603
1687
|
window: ChatPlace,
|
|
1604
|
-
account:
|
|
1688
|
+
account: import_zod14.z.string().max(320).nullable(),
|
|
1605
1689
|
next_reset_ms: epochMs.nullable(),
|
|
1606
1690
|
/** claude: the app's own reading; usage_history: a weekly drop seen in its usage record; your_list: the person's own entry. */
|
|
1607
|
-
source:
|
|
1691
|
+
source: import_zod14.z.enum(["claude", "usage_history", "your_list"]).nullable(),
|
|
1608
1692
|
/** claude or usage_history. */
|
|
1609
|
-
official:
|
|
1693
|
+
official: import_zod14.z.boolean(),
|
|
1610
1694
|
/** Set when the person's list disagrees with the official time. */
|
|
1611
|
-
note:
|
|
1695
|
+
note: import_zod14.z.string().max(200).nullable()
|
|
1612
1696
|
});
|
|
1613
|
-
var AppsWindowsListParams =
|
|
1614
|
-
var AppsWindowsListResult =
|
|
1615
|
-
var AppsAccountsUsageParams =
|
|
1616
|
-
var AppsAccountsUsageResult =
|
|
1697
|
+
var AppsWindowsListParams = import_zod14.z.strictObject({ app_key: AppKey });
|
|
1698
|
+
var AppsWindowsListResult = import_zod14.z.strictObject({ app_key: AppKey, windows: import_zod14.z.array(AppWindowInfo).max(200) });
|
|
1699
|
+
var AppsAccountsUsageParams = import_zod14.z.strictObject({ app_key: AppKey });
|
|
1700
|
+
var AppsAccountsUsageResult = import_zod14.z.strictObject({
|
|
1617
1701
|
app_key: AppKey,
|
|
1618
|
-
accounts:
|
|
1702
|
+
accounts: import_zod14.z.array(AccountUsage).max(500),
|
|
1619
1703
|
/** 1.12: the rows are right but something around them failed (a newly read reset time could not be saved); shown, never hidden. */
|
|
1620
|
-
problem:
|
|
1704
|
+
problem: import_zod14.z.string().max(400).optional()
|
|
1621
1705
|
});
|
|
1622
|
-
var AppsAccountsResetsParams =
|
|
1623
|
-
var AppsAccountsResetsResult =
|
|
1706
|
+
var AppsAccountsResetsParams = import_zod14.z.strictObject({ app_key: AppKey });
|
|
1707
|
+
var AppsAccountsResetsResult = import_zod14.z.strictObject({
|
|
1624
1708
|
app_key: AppKey,
|
|
1625
|
-
resets:
|
|
1709
|
+
resets: import_zod14.z.array(AccountReset).max(200),
|
|
1626
1710
|
/** 1.12: as on `apps.accounts.usage`. */
|
|
1627
|
-
problem:
|
|
1711
|
+
problem: import_zod14.z.string().max(400).optional()
|
|
1628
1712
|
});
|
|
1629
|
-
var AppsWindowActionResult =
|
|
1630
|
-
var AppsWindowsOpenParams =
|
|
1631
|
-
var AppsWindowsReloadParams =
|
|
1632
|
-
var ShownSection =
|
|
1633
|
-
title:
|
|
1713
|
+
var AppsWindowActionResult = import_zod14.z.strictObject({ message: import_zod14.z.string().max(400) });
|
|
1714
|
+
var AppsWindowsOpenParams = import_zod14.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
1715
|
+
var AppsWindowsReloadParams = import_zod14.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
1716
|
+
var ShownSection = import_zod14.z.strictObject({
|
|
1717
|
+
title: import_zod14.z.string().max(300),
|
|
1634
1718
|
/** Rows drawn under it (a collapsed section draws none). */
|
|
1635
|
-
rows:
|
|
1636
|
-
expanded:
|
|
1719
|
+
rows: import_zod14.z.number().int().nonnegative(),
|
|
1720
|
+
expanded: import_zod14.z.boolean()
|
|
1637
1721
|
});
|
|
1638
|
-
var AppsWindowsShownParams =
|
|
1639
|
-
var AppsWindowsShownResult =
|
|
1722
|
+
var AppsWindowsShownParams = import_zod14.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
1723
|
+
var AppsWindowsShownResult = import_zod14.z.strictObject({
|
|
1640
1724
|
window: ChatPlace,
|
|
1641
|
-
open:
|
|
1642
|
-
sections:
|
|
1643
|
-
problem:
|
|
1725
|
+
open: import_zod14.z.boolean(),
|
|
1726
|
+
sections: import_zod14.z.array(ShownSection).max(200),
|
|
1727
|
+
problem: import_zod14.z.string().max(400).nullable()
|
|
1644
1728
|
});
|
|
1645
|
-
var AppsWindowsRestartParams =
|
|
1646
|
-
var AppsWindowsRefreshUsageParams =
|
|
1647
|
-
var AppsProjectsMoveParams =
|
|
1729
|
+
var AppsWindowsRestartParams = import_zod14.z.strictObject({ app_key: AppKey, window: ChatPlace, force: import_zod14.z.boolean().default(false) });
|
|
1730
|
+
var AppsWindowsRefreshUsageParams = import_zod14.z.strictObject({ app_key: AppKey, window: ChatPlace });
|
|
1731
|
+
var AppsProjectsMoveParams = import_zod14.z.strictObject({
|
|
1648
1732
|
app_key: AppKey,
|
|
1649
1733
|
chat_id: ChatId,
|
|
1650
1734
|
from_project_id: ChatProjectId,
|
|
1651
1735
|
to_project_id: ChatProjectId.optional(),
|
|
1652
|
-
new_project_name:
|
|
1653
|
-
});
|
|
1654
|
-
var AppsProjectsMoveResult =
|
|
1655
|
-
var AppsProjectsCreateParams =
|
|
1656
|
-
var AppsProjectsCreateResult =
|
|
1657
|
-
var AppsProjectsImportPinsParams =
|
|
1658
|
-
var AppsProjectsImportPinsResult =
|
|
1659
|
-
var ProjectMoveChat =
|
|
1660
|
-
var ProjectMoveSkip =
|
|
1661
|
-
var ProjectMoveGroup =
|
|
1662
|
-
ok:
|
|
1663
|
-
name:
|
|
1736
|
+
new_project_name: import_zod14.z.string().min(1).max(200).optional()
|
|
1737
|
+
});
|
|
1738
|
+
var AppsProjectsMoveResult = import_zod14.z.strictObject({ chat: ChatRow, project: ChatProject });
|
|
1739
|
+
var AppsProjectsCreateParams = import_zod14.z.strictObject({ app_key: AppKey, name: import_zod14.z.string().min(1).max(200) });
|
|
1740
|
+
var AppsProjectsCreateResult = import_zod14.z.strictObject({ project: ChatProject });
|
|
1741
|
+
var AppsProjectsImportPinsParams = import_zod14.z.strictObject({ app_key: AppKey });
|
|
1742
|
+
var AppsProjectsImportPinsResult = import_zod14.z.strictObject({ message: import_zod14.z.string().max(400) });
|
|
1743
|
+
var ProjectMoveChat = import_zod14.z.strictObject({ chat_id: ChatId, title: import_zod14.z.string().max(300) });
|
|
1744
|
+
var ProjectMoveSkip = import_zod14.z.strictObject({ chat_id: ChatId, title: import_zod14.z.string().max(300), window: ChatPlace.nullable(), reason: import_zod14.z.string().max(400) });
|
|
1745
|
+
var ProjectMoveGroup = import_zod14.z.strictObject({
|
|
1746
|
+
ok: import_zod14.z.boolean(),
|
|
1747
|
+
name: import_zod14.z.string().max(200),
|
|
1664
1748
|
/** Why it is not (or was not) grouped — e.g. the window is open. */
|
|
1665
|
-
reason:
|
|
1749
|
+
reason: import_zod14.z.string().max(400).optional(),
|
|
1666
1750
|
/** Chats that get (or got) the group; already in it; taken from another group of the window. */
|
|
1667
1751
|
assign: nonNegInt.optional(),
|
|
1668
1752
|
already: nonNegInt.optional(),
|
|
1669
1753
|
from_other_groups: nonNegInt.optional(),
|
|
1670
1754
|
/** A group of that name was already there (reused, never doubled). */
|
|
1671
|
-
group_exists:
|
|
1755
|
+
group_exists: import_zod14.z.boolean().optional()
|
|
1672
1756
|
});
|
|
1673
|
-
var AppsProjectsToWindowParams =
|
|
1757
|
+
var AppsProjectsToWindowParams = import_zod14.z.strictObject({
|
|
1674
1758
|
app_key: AppKey,
|
|
1675
1759
|
project_id: ChatProjectId,
|
|
1676
1760
|
window: ChatPlace,
|
|
1677
1761
|
/** Also take each chat off its other side windows where safe (never main, the holder, an open window). */
|
|
1678
|
-
take_off:
|
|
1762
|
+
take_off: import_zod14.z.boolean().default(false),
|
|
1679
1763
|
/** Also group them under the project's name in that window's sidebar (closed windows only). */
|
|
1680
|
-
group:
|
|
1681
|
-
dry_run:
|
|
1764
|
+
group: import_zod14.z.boolean().default(false),
|
|
1765
|
+
dry_run: import_zod14.z.boolean().default(false)
|
|
1682
1766
|
});
|
|
1683
|
-
var AppsProjectsToWindowResult =
|
|
1767
|
+
var AppsProjectsToWindowResult = import_zod14.z.strictObject({
|
|
1684
1768
|
project_id: ChatProjectId,
|
|
1685
1769
|
window: ChatPlace,
|
|
1686
|
-
dry_run:
|
|
1687
|
-
place:
|
|
1688
|
-
already:
|
|
1689
|
-
take_off:
|
|
1690
|
-
skipped:
|
|
1770
|
+
dry_run: import_zod14.z.boolean(),
|
|
1771
|
+
place: import_zod14.z.array(ProjectMoveChat).max(5e3),
|
|
1772
|
+
already: import_zod14.z.array(ProjectMoveChat).max(5e3),
|
|
1773
|
+
take_off: import_zod14.z.array(ProjectMoveChat.extend({ window: ChatPlace })).max(2e4),
|
|
1774
|
+
skipped: import_zod14.z.array(ProjectMoveSkip).max(2e4),
|
|
1691
1775
|
/** Chats of the project from other apps (no windows to place into), left as they are. */
|
|
1692
1776
|
other_apps: nonNegInt,
|
|
1693
1777
|
group: ProjectMoveGroup.nullable(),
|
|
1694
|
-
message:
|
|
1778
|
+
message: import_zod14.z.string().max(400)
|
|
1695
1779
|
});
|
|
1696
|
-
var ColdChat =
|
|
1780
|
+
var ColdChat = import_zod14.z.strictObject({
|
|
1697
1781
|
id: ChatId,
|
|
1698
|
-
title:
|
|
1699
|
-
repo:
|
|
1700
|
-
window:
|
|
1701
|
-
account:
|
|
1702
|
-
model_name:
|
|
1782
|
+
title: import_zod14.z.string().max(1e3),
|
|
1783
|
+
repo: import_zod14.z.string().max(200).nullable(),
|
|
1784
|
+
window: import_zod14.z.string().max(64).nullable(),
|
|
1785
|
+
account: import_zod14.z.string().max(320).nullable(),
|
|
1786
|
+
model_name: import_zod14.z.string().max(120).nullable(),
|
|
1703
1787
|
context_tokens: nonNegInt,
|
|
1704
1788
|
cold_at_ms: epochMs,
|
|
1705
1789
|
/** Waking it once the cache is cold. */
|
|
1706
|
-
cold_cost:
|
|
1790
|
+
cold_cost: import_zod14.z.number().nullable(),
|
|
1707
1791
|
/** Waking it while the cache is warm. */
|
|
1708
|
-
warm_cost:
|
|
1792
|
+
warm_cost: import_zod14.z.number().nullable(),
|
|
1709
1793
|
/** Its account is on extra usage (a 5-minute cache, and real money). */
|
|
1710
|
-
extra_usage:
|
|
1794
|
+
extra_usage: import_zod14.z.boolean(),
|
|
1711
1795
|
/** A scheduled routine's run. */
|
|
1712
|
-
scheduled:
|
|
1796
|
+
scheduled: import_zod14.z.boolean(),
|
|
1713
1797
|
/** It can be shown in its window (started in the desktop app). */
|
|
1714
|
-
openable:
|
|
1798
|
+
openable: import_zod14.z.boolean(),
|
|
1715
1799
|
/** How its window was decided, or why it can't be opened. */
|
|
1716
|
-
how:
|
|
1800
|
+
how: import_zod14.z.string().max(200).nullable()
|
|
1717
1801
|
});
|
|
1718
|
-
var AppsChatsColdParams =
|
|
1719
|
-
var AppsChatsColdResult =
|
|
1802
|
+
var AppsChatsColdParams = import_zod14.z.strictObject({ app_key: AppKey });
|
|
1803
|
+
var AppsChatsColdResult = import_zod14.z.strictObject({
|
|
1720
1804
|
app_key: AppKey,
|
|
1721
1805
|
/** Waiting for the person with a warm cache, most urgent first. */
|
|
1722
|
-
waiting:
|
|
1806
|
+
waiting: import_zod14.z.array(ColdChat).max(2e3),
|
|
1723
1807
|
/** Went cold in the last while. */
|
|
1724
|
-
recently_cold:
|
|
1808
|
+
recently_cold: import_zod14.z.array(ColdChat).max(2e3),
|
|
1725
1809
|
/** Chats working right now (not waiting). */
|
|
1726
1810
|
working: nonNegInt
|
|
1727
1811
|
});
|
|
1728
|
-
var AppsChatsOpenParams =
|
|
1729
|
-
var SpendSplit =
|
|
1730
|
-
var SpendScopes =
|
|
1731
|
-
var SpendAccount =
|
|
1732
|
-
account:
|
|
1812
|
+
var AppsChatsOpenParams = import_zod14.z.strictObject({ app_key: AppKey, chat_id: ChatId, window: ChatPlace.optional() });
|
|
1813
|
+
var SpendSplit = import_zod14.z.strictObject({ main: import_zod14.z.number(), helpers: import_zod14.z.number() });
|
|
1814
|
+
var SpendScopes = import_zod14.z.strictObject({ today: SpendSplit, week: SpendSplit });
|
|
1815
|
+
var SpendAccount = import_zod14.z.strictObject({
|
|
1816
|
+
account: import_zod14.z.string().max(320),
|
|
1733
1817
|
spend: SpendScopes,
|
|
1734
|
-
last_hour:
|
|
1735
|
-
last_5h:
|
|
1736
|
-
five_hour:
|
|
1737
|
-
weekly:
|
|
1818
|
+
last_hour: import_zod14.z.number().nullable(),
|
|
1819
|
+
last_5h: import_zod14.z.number().nullable(),
|
|
1820
|
+
five_hour: import_zod14.z.number().nullable(),
|
|
1821
|
+
weekly: import_zod14.z.number().nullable(),
|
|
1738
1822
|
as_of_ms: epochMs.nullable(),
|
|
1739
1823
|
weekly_resets_at_ms: epochMs.nullable(),
|
|
1740
1824
|
/** When the 5-hour or weekly limit is projected to be reached at the current burn. */
|
|
1741
1825
|
five_hour_full_at_ms: epochMs.nullable(),
|
|
1742
1826
|
weekly_full_at_ms: epochMs.nullable(),
|
|
1743
1827
|
/** The reading is too old to project. */
|
|
1744
|
-
stale:
|
|
1828
|
+
stale: import_zod14.z.boolean()
|
|
1745
1829
|
});
|
|
1746
|
-
var SpendModel =
|
|
1747
|
-
var SpendChat =
|
|
1830
|
+
var SpendModel = import_zod14.z.strictObject({ model: import_zod14.z.string().max(120), name: import_zod14.z.string().max(120), spend: SpendScopes });
|
|
1831
|
+
var SpendChat = import_zod14.z.strictObject({
|
|
1748
1832
|
id: ChatId,
|
|
1749
|
-
title:
|
|
1750
|
-
repo:
|
|
1751
|
-
window:
|
|
1833
|
+
title: import_zod14.z.string().max(1e3),
|
|
1834
|
+
repo: import_zod14.z.string().max(200).nullable(),
|
|
1835
|
+
window: import_zod14.z.string().max(64).nullable(),
|
|
1752
1836
|
spend: SpendScopes,
|
|
1753
1837
|
helpers: nonNegInt
|
|
1754
1838
|
});
|
|
1755
|
-
var SpendHelper =
|
|
1756
|
-
var SpendLive =
|
|
1757
|
-
var SpendIdleScope =
|
|
1758
|
-
var SpendIdle =
|
|
1759
|
-
var SpendStart =
|
|
1760
|
-
var AppsSpendParams =
|
|
1761
|
-
var AppsSpendResult =
|
|
1839
|
+
var SpendHelper = import_zod14.z.strictObject({ model: import_zod14.z.string().max(120), steps: nonNegInt, over_steps: import_zod14.z.boolean(), description: import_zod14.z.string().max(400) });
|
|
1840
|
+
var SpendLive = import_zod14.z.strictObject({ id: ChatId, title: import_zod14.z.string().max(1e3), window: import_zod14.z.string().max(64).nullable(), helpers: import_zod14.z.array(SpendHelper).max(200) });
|
|
1841
|
+
var SpendIdleScope = import_zod14.z.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: import_zod14.z.number(), avoidable: import_zod14.z.number() });
|
|
1842
|
+
var SpendIdle = import_zod14.z.strictObject({ id: ChatId, chat: import_zod14.z.string().max(1e3), who: import_zod14.z.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
|
|
1843
|
+
var SpendStart = import_zod14.z.strictObject({ repo: import_zod14.z.string().max(200), count: nonNegInt, median: nonNegInt, latest: import_zod14.z.array(nonNegInt).max(20), alarm: import_zod14.z.string().max(400).nullable() });
|
|
1844
|
+
var AppsSpendParams = import_zod14.z.strictObject({ app_key: AppKey });
|
|
1845
|
+
var AppsSpendResult = import_zod14.z.strictObject({
|
|
1762
1846
|
app_key: AppKey,
|
|
1763
1847
|
/** False while older chats are still being read. */
|
|
1764
|
-
complete:
|
|
1765
|
-
today_total:
|
|
1766
|
-
week_total:
|
|
1767
|
-
idle_today:
|
|
1768
|
-
idle_week:
|
|
1848
|
+
complete: import_zod14.z.boolean(),
|
|
1849
|
+
today_total: import_zod14.z.number(),
|
|
1850
|
+
week_total: import_zod14.z.number(),
|
|
1851
|
+
idle_today: import_zod14.z.number(),
|
|
1852
|
+
idle_week: import_zod14.z.number(),
|
|
1769
1853
|
/** Models with no known list price. */
|
|
1770
|
-
unpriced:
|
|
1854
|
+
unpriced: import_zod14.z.array(import_zod14.z.string().max(120)).max(100),
|
|
1771
1855
|
/** Helpers past their step budget, unusual starting sizes. */
|
|
1772
|
-
alarms:
|
|
1773
|
-
live:
|
|
1774
|
-
accounts:
|
|
1775
|
-
models:
|
|
1776
|
-
chats:
|
|
1777
|
-
idle:
|
|
1778
|
-
starts:
|
|
1779
|
-
});
|
|
1780
|
-
var AppsSyncStatusParams =
|
|
1781
|
-
var AppsSyncStatusResult =
|
|
1782
|
-
healthy:
|
|
1783
|
-
summary:
|
|
1784
|
-
problems:
|
|
1785
|
-
warnings:
|
|
1856
|
+
alarms: import_zod14.z.array(import_zod14.z.string().max(400)).max(200),
|
|
1857
|
+
live: import_zod14.z.array(SpendLive).max(200),
|
|
1858
|
+
accounts: import_zod14.z.array(SpendAccount).max(200),
|
|
1859
|
+
models: import_zod14.z.array(SpendModel).max(100),
|
|
1860
|
+
chats: import_zod14.z.array(SpendChat).max(500),
|
|
1861
|
+
idle: import_zod14.z.array(SpendIdle).max(500),
|
|
1862
|
+
starts: import_zod14.z.array(SpendStart).max(200)
|
|
1863
|
+
});
|
|
1864
|
+
var AppsSyncStatusParams = import_zod14.z.strictObject({ app_key: AppKey });
|
|
1865
|
+
var AppsSyncStatusResult = import_zod14.z.strictObject({
|
|
1866
|
+
healthy: import_zod14.z.boolean(),
|
|
1867
|
+
summary: import_zod14.z.string().max(400),
|
|
1868
|
+
problems: import_zod14.z.array(import_zod14.z.string().max(400)).max(200),
|
|
1869
|
+
warnings: import_zod14.z.array(import_zod14.z.string().max(400)).max(200),
|
|
1786
1870
|
/** Accounts seen with no saved name yet (Save account names fixes them). */
|
|
1787
|
-
unnamed_accounts:
|
|
1871
|
+
unnamed_accounts: import_zod14.z.array(import_zod14.z.string().max(80)).max(200),
|
|
1788
1872
|
/** The full report. */
|
|
1789
|
-
output:
|
|
1873
|
+
output: import_zod14.z.string().max(2e5)
|
|
1790
1874
|
});
|
|
1791
|
-
var AppsSyncRunParams =
|
|
1792
|
-
var AppsWindowsProcessesParams =
|
|
1793
|
-
var AppsWindowsProcessesResult =
|
|
1794
|
-
var AppsWindowsAddParams =
|
|
1795
|
-
var AppsWindowsSaveNamesParams =
|
|
1875
|
+
var AppsSyncRunParams = import_zod14.z.strictObject({ app_key: AppKey });
|
|
1876
|
+
var AppsWindowsProcessesParams = import_zod14.z.strictObject({ app_key: AppKey });
|
|
1877
|
+
var AppsWindowsProcessesResult = import_zod14.z.strictObject({ processes: import_zod14.z.array(import_zod14.z.string().max(2e3)).max(2e3) });
|
|
1878
|
+
var AppsWindowsAddParams = import_zod14.z.strictObject({ app_key: AppKey, window: ChatPlace, email: import_zod14.z.string().min(3).max(320) });
|
|
1879
|
+
var AppsWindowsSaveNamesParams = import_zod14.z.strictObject({ app_key: AppKey });
|
|
1796
1880
|
|
|
1797
1881
|
// src/schema/service.ts
|
|
1798
|
-
var
|
|
1882
|
+
var import_zod15 = require("zod");
|
|
1799
1883
|
var SERVICE_MAX_FRAME_BYTES = 16777216;
|
|
1800
|
-
var ServiceName =
|
|
1801
|
-
var ContractHash =
|
|
1802
|
-
var ServiceToken =
|
|
1884
|
+
var ServiceName = import_zod15.z.enum(["ml", "coding", "tools"]);
|
|
1885
|
+
var ContractHash = import_zod15.z.string().regex(/^[0-9a-f]{64}$/);
|
|
1886
|
+
var ServiceToken = import_zod15.z.string().regex(/^[A-Za-z0-9_-]{43}$/);
|
|
1803
1887
|
var ServiceRequestId = u32;
|
|
1804
|
-
var ServiceHello =
|
|
1805
|
-
var ServiceWelcome =
|
|
1806
|
-
type:
|
|
1888
|
+
var ServiceHello = import_zod15.z.strictObject({ type: import_zod15.z.literal("hello"), token: ServiceToken, contract: ContractHash });
|
|
1889
|
+
var ServiceWelcome = import_zod15.z.strictObject({
|
|
1890
|
+
type: import_zod15.z.literal("welcome"),
|
|
1807
1891
|
service: ServiceName,
|
|
1808
1892
|
contract: ContractHash,
|
|
1809
1893
|
pid: nonNegInt,
|
|
1810
1894
|
/** The interpreter's version, e.g. "3.13.15". */
|
|
1811
|
-
python:
|
|
1895
|
+
python: import_zod15.z.string().max(32),
|
|
1812
1896
|
/** Every op this service serves; must equal SERVICES[service] exactly. */
|
|
1813
|
-
ops:
|
|
1897
|
+
ops: import_zod15.z.array(import_zod15.z.string().min(1).max(64)).max(64)
|
|
1814
1898
|
});
|
|
1815
|
-
var ServiceRequest =
|
|
1816
|
-
type:
|
|
1899
|
+
var ServiceRequest = import_zod15.z.strictObject({
|
|
1900
|
+
type: import_zod15.z.literal("request"),
|
|
1817
1901
|
id: ServiceRequestId,
|
|
1818
|
-
op:
|
|
1819
|
-
params:
|
|
1902
|
+
op: import_zod15.z.string().min(1).max(64),
|
|
1903
|
+
params: import_zod15.z.unknown()
|
|
1820
1904
|
// validated by the service against SERVICES[service][op].params
|
|
1821
1905
|
});
|
|
1822
|
-
var ServiceResponse =
|
|
1823
|
-
type:
|
|
1906
|
+
var ServiceResponse = import_zod15.z.strictObject({
|
|
1907
|
+
type: import_zod15.z.literal("response"),
|
|
1824
1908
|
id: ServiceRequestId,
|
|
1825
|
-
result:
|
|
1909
|
+
result: import_zod15.z.unknown()
|
|
1826
1910
|
// validated by the core against SERVICES[service][op].result
|
|
1827
1911
|
});
|
|
1828
|
-
var ServiceErrorMsg =
|
|
1829
|
-
var ServiceProgressMsg =
|
|
1830
|
-
var ServiceCancel =
|
|
1831
|
-
var ServicePing =
|
|
1832
|
-
var ServicePong =
|
|
1833
|
-
type:
|
|
1912
|
+
var ServiceErrorMsg = import_zod15.z.strictObject({ type: import_zod15.z.literal("error"), id: ServiceRequestId, error: ProtocolErrorBody });
|
|
1913
|
+
var ServiceProgressMsg = import_zod15.z.strictObject({ type: import_zod15.z.literal("progress"), id: ServiceRequestId, progress: import_zod15.z.unknown() });
|
|
1914
|
+
var ServiceCancel = import_zod15.z.strictObject({ type: import_zod15.z.literal("cancel"), id: ServiceRequestId });
|
|
1915
|
+
var ServicePing = import_zod15.z.strictObject({ type: import_zod15.z.literal("ping"), id: ServiceRequestId });
|
|
1916
|
+
var ServicePong = import_zod15.z.strictObject({
|
|
1917
|
+
type: import_zod15.z.literal("pong"),
|
|
1834
1918
|
id: ServiceRequestId,
|
|
1835
1919
|
/** Requests running now. */
|
|
1836
1920
|
busy: nonNegInt
|
|
1837
1921
|
});
|
|
1838
|
-
var ServiceShutdown =
|
|
1839
|
-
var CoreToServiceMsg =
|
|
1840
|
-
var ServiceToCoreMsg =
|
|
1922
|
+
var ServiceShutdown = import_zod15.z.strictObject({ type: import_zod15.z.literal("shutdown") });
|
|
1923
|
+
var CoreToServiceMsg = import_zod15.z.discriminatedUnion("type", [ServiceHello, ServiceRequest, ServiceCancel, ServicePing, ServiceShutdown]);
|
|
1924
|
+
var ServiceToCoreMsg = import_zod15.z.discriminatedUnion("type", [ServiceWelcome, ServiceResponse, ServiceErrorMsg, ServiceProgressMsg, ServicePong]);
|
|
1841
1925
|
|
|
1842
1926
|
// src/schema/tools.ts
|
|
1843
|
-
var
|
|
1844
|
-
var ToolLevel =
|
|
1845
|
-
var ToolOutcome =
|
|
1846
|
-
var ToolPlatform =
|
|
1847
|
-
var ToolTransport =
|
|
1848
|
-
var ToolName =
|
|
1849
|
-
var ToolLevelResult =
|
|
1927
|
+
var import_zod16 = require("zod");
|
|
1928
|
+
var ToolLevel = import_zod16.z.enum(["programmatic", "protocol", "chat"]);
|
|
1929
|
+
var ToolOutcome = import_zod16.z.enum(["pass", "fail", "skip"]);
|
|
1930
|
+
var ToolPlatform = import_zod16.z.enum(["darwin", "win32", "linux"]);
|
|
1931
|
+
var ToolTransport = import_zod16.z.enum(["in_process", "localhost", "relay", "agent"]);
|
|
1932
|
+
var ToolName = import_zod16.z.string().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/);
|
|
1933
|
+
var ToolLevelResult = import_zod16.z.strictObject({
|
|
1850
1934
|
tool: ToolName,
|
|
1851
1935
|
level: ToolLevel,
|
|
1852
1936
|
platform: ToolPlatform,
|
|
1853
1937
|
transport: ToolTransport,
|
|
1854
1938
|
outcome: ToolOutcome,
|
|
1855
1939
|
/** True when the caller sat on a different network from the device (a phone on cellular, CI). */
|
|
1856
|
-
remote_network:
|
|
1940
|
+
remote_network: import_zod16.z.boolean(),
|
|
1857
1941
|
/** One line: what was asserted, or why it failed. Never a token, a file's contents or a path under a real home. */
|
|
1858
|
-
detail:
|
|
1942
|
+
detail: import_zod16.z.string().max(500),
|
|
1859
1943
|
/** The harness that produced it, e.g. `matrx-desktop test/tools/programmatic.test.ts`. */
|
|
1860
|
-
suite:
|
|
1944
|
+
suite: import_zod16.z.string().min(1).max(200),
|
|
1861
1945
|
/** The test case inside the suite. */
|
|
1862
|
-
test:
|
|
1863
|
-
run_at_ms:
|
|
1946
|
+
test: import_zod16.z.string().min(1).max(300),
|
|
1947
|
+
run_at_ms: import_zod16.z.int().min(0)
|
|
1864
1948
|
});
|
|
1865
|
-
var ToolResultsFile =
|
|
1866
|
-
schema:
|
|
1949
|
+
var ToolResultsFile = import_zod16.z.strictObject({
|
|
1950
|
+
schema: import_zod16.z.literal("matrx.tool-results.v1"),
|
|
1867
1951
|
/** The producing repo's commit (short or full SHA). */
|
|
1868
|
-
commit:
|
|
1869
|
-
results:
|
|
1952
|
+
commit: import_zod16.z.string().min(4).max(64),
|
|
1953
|
+
results: import_zod16.z.array(ToolLevelResult).max(1e4)
|
|
1870
1954
|
});
|
|
1871
1955
|
|
|
1872
1956
|
// src/schema/proc.ts
|
|
1873
|
-
var
|
|
1874
|
-
var ProcSort =
|
|
1875
|
-
var ProcListParams =
|
|
1957
|
+
var import_zod17 = require("zod");
|
|
1958
|
+
var ProcSort = import_zod17.z.enum(["cpu", "memory", "pid", "name"]);
|
|
1959
|
+
var ProcListParams = import_zod17.z.strictObject({
|
|
1876
1960
|
/** Case-insensitive substring of the process name or its command line. */
|
|
1877
|
-
name:
|
|
1961
|
+
name: import_zod17.z.string().min(1).max(128).optional(),
|
|
1878
1962
|
sort: ProcSort.default("cpu"),
|
|
1879
|
-
limit:
|
|
1963
|
+
limit: import_zod17.z.int().min(1).max(500).default(50)
|
|
1880
1964
|
});
|
|
1881
|
-
var ProcInfo =
|
|
1882
|
-
pid:
|
|
1965
|
+
var ProcInfo = import_zod17.z.strictObject({
|
|
1966
|
+
pid: import_zod17.z.int().min(0),
|
|
1883
1967
|
/** Parent process id; null where the OS does not report it. */
|
|
1884
|
-
ppid:
|
|
1885
|
-
name:
|
|
1968
|
+
ppid: import_zod17.z.int().min(0).nullable(),
|
|
1969
|
+
name: import_zod17.z.string().max(256),
|
|
1886
1970
|
/** The command line, cut to 1024 characters. */
|
|
1887
|
-
command:
|
|
1971
|
+
command: import_zod17.z.string().max(1024),
|
|
1888
1972
|
/** Share of one core, as `ps` and Task Manager report it; null where the OS does not say. */
|
|
1889
|
-
cpu_percent:
|
|
1973
|
+
cpu_percent: import_zod17.z.number().min(0).nullable(),
|
|
1890
1974
|
memory_bytes: nonNegInt.nullable(),
|
|
1891
|
-
user:
|
|
1975
|
+
user: import_zod17.z.string().max(128).nullable()
|
|
1892
1976
|
});
|
|
1893
|
-
var ProcListResult =
|
|
1894
|
-
processes:
|
|
1977
|
+
var ProcListResult = import_zod17.z.strictObject({
|
|
1978
|
+
processes: import_zod17.z.array(ProcInfo).max(500),
|
|
1895
1979
|
/** Processes that matched before `limit`. */
|
|
1896
1980
|
total: nonNegInt,
|
|
1897
|
-
truncated:
|
|
1981
|
+
truncated: import_zod17.z.boolean()
|
|
1898
1982
|
});
|
|
1899
|
-
var ProcPortsParams =
|
|
1983
|
+
var ProcPortsParams = import_zod17.z.strictObject({
|
|
1900
1984
|
/** Only this port. */
|
|
1901
|
-
port:
|
|
1985
|
+
port: import_zod17.z.int().min(1).max(65535).optional()
|
|
1902
1986
|
});
|
|
1903
|
-
var ProcPort =
|
|
1904
|
-
port:
|
|
1905
|
-
protocol:
|
|
1987
|
+
var ProcPort = import_zod17.z.strictObject({
|
|
1988
|
+
port: import_zod17.z.int().min(1).max(65535),
|
|
1989
|
+
protocol: import_zod17.z.enum(["tcp", "udp"]),
|
|
1906
1990
|
/** The local address it listens on ("127.0.0.1", "*", "::"). */
|
|
1907
|
-
address:
|
|
1908
|
-
pid:
|
|
1909
|
-
process:
|
|
1991
|
+
address: import_zod17.z.string().max(64),
|
|
1992
|
+
pid: import_zod17.z.int().min(0).nullable(),
|
|
1993
|
+
process: import_zod17.z.string().max(256).nullable()
|
|
1910
1994
|
});
|
|
1911
|
-
var ProcPortsResult =
|
|
1912
|
-
var ProcKillParams =
|
|
1913
|
-
pid:
|
|
1995
|
+
var ProcPortsResult = import_zod17.z.strictObject({ ports: import_zod17.z.array(ProcPort).max(4e3) });
|
|
1996
|
+
var ProcKillParams = import_zod17.z.strictObject({
|
|
1997
|
+
pid: import_zod17.z.int().min(1),
|
|
1914
1998
|
/** Kill outright (SIGKILL; on Windows the same /F) instead of asking it to quit. */
|
|
1915
|
-
force:
|
|
1999
|
+
force: import_zod17.z.boolean().default(false)
|
|
1916
2000
|
});
|
|
1917
|
-
var ProcKillResult =
|
|
1918
|
-
pid:
|
|
1919
|
-
signal:
|
|
2001
|
+
var ProcKillResult = import_zod17.z.strictObject({
|
|
2002
|
+
pid: import_zod17.z.int().min(1),
|
|
2003
|
+
signal: import_zod17.z.enum(["SIGTERM", "SIGKILL"]),
|
|
1920
2004
|
/** True when the process was gone within 3 s. */
|
|
1921
|
-
exited:
|
|
2005
|
+
exited: import_zod17.z.boolean()
|
|
1922
2006
|
});
|
|
1923
2007
|
|
|
1924
2008
|
// src/schema/clipboard.ts
|
|
1925
|
-
var
|
|
1926
|
-
var ClipboardReadParams =
|
|
1927
|
-
var ClipboardReadResult =
|
|
2009
|
+
var import_zod18 = require("zod");
|
|
2010
|
+
var ClipboardReadParams = import_zod18.z.strictObject({});
|
|
2011
|
+
var ClipboardReadResult = import_zod18.z.strictObject({
|
|
1928
2012
|
/** The clipboard's text ("" when it holds none), cut to 1 MiB. */
|
|
1929
|
-
text:
|
|
1930
|
-
truncated:
|
|
2013
|
+
text: import_zod18.z.string().max(1048576),
|
|
2014
|
+
truncated: import_zod18.z.boolean()
|
|
1931
2015
|
});
|
|
1932
|
-
var ClipboardWriteParams =
|
|
1933
|
-
var ClipboardWriteResult =
|
|
2016
|
+
var ClipboardWriteParams = import_zod18.z.strictObject({ text: import_zod18.z.string().max(1048576) });
|
|
2017
|
+
var ClipboardWriteResult = import_zod18.z.strictObject({ bytes: nonNegInt });
|
|
1934
2018
|
|
|
1935
2019
|
// src/schema/git.ts
|
|
1936
|
-
var
|
|
2020
|
+
var import_zod19 = require("zod");
|
|
1937
2021
|
var GIT_MAX_OUTPUT_CHARS = 262144;
|
|
1938
|
-
var GitText =
|
|
1939
|
-
var GitName =
|
|
1940
|
-
var GitOutputResult =
|
|
1941
|
-
var GitStatusParams =
|
|
1942
|
-
var GitStatusFile =
|
|
1943
|
-
path:
|
|
2022
|
+
var GitText = import_zod19.z.string().max(GIT_MAX_OUTPUT_CHARS);
|
|
2023
|
+
var GitName = import_zod19.z.string().min(1).max(255).regex(/^[^-\s][^\s]*$/);
|
|
2024
|
+
var GitOutputResult = import_zod19.z.strictObject({ output: GitText, truncated: import_zod19.z.boolean() });
|
|
2025
|
+
var GitStatusParams = import_zod19.z.strictObject({ cwd: AbsPath });
|
|
2026
|
+
var GitStatusFile = import_zod19.z.strictObject({
|
|
2027
|
+
path: import_zod19.z.string(),
|
|
1944
2028
|
/** Porcelain v1 status letters: index (staged) and worktree; "?" for untracked. */
|
|
1945
|
-
index:
|
|
1946
|
-
worktree:
|
|
2029
|
+
index: import_zod19.z.string().length(1),
|
|
2030
|
+
worktree: import_zod19.z.string().length(1)
|
|
1947
2031
|
});
|
|
1948
|
-
var GitStatusResult =
|
|
2032
|
+
var GitStatusResult = import_zod19.z.strictObject({
|
|
1949
2033
|
/** The checked-out branch; null when HEAD is detached. */
|
|
1950
|
-
branch:
|
|
1951
|
-
upstream:
|
|
2034
|
+
branch: import_zod19.z.string().nullable(),
|
|
2035
|
+
upstream: import_zod19.z.string().nullable(),
|
|
1952
2036
|
ahead: nonNegInt,
|
|
1953
2037
|
behind: nonNegInt,
|
|
1954
|
-
files:
|
|
1955
|
-
clean:
|
|
2038
|
+
files: import_zod19.z.array(GitStatusFile).max(5e3),
|
|
2039
|
+
clean: import_zod19.z.boolean(),
|
|
1956
2040
|
/** More than 5000 changed files: the list is cut. */
|
|
1957
|
-
truncated:
|
|
1958
|
-
});
|
|
1959
|
-
var GitDiffParams =
|
|
1960
|
-
var GitDiffResult =
|
|
1961
|
-
var GitLogParams =
|
|
1962
|
-
var GitLogCommit =
|
|
1963
|
-
var GitLogResult =
|
|
1964
|
-
var GitAddParams =
|
|
1965
|
-
var GitCommitParams =
|
|
2041
|
+
truncated: import_zod19.z.boolean()
|
|
2042
|
+
});
|
|
2043
|
+
var GitDiffParams = import_zod19.z.strictObject({ cwd: AbsPath, path: import_zod19.z.string().max(4096).optional(), staged: import_zod19.z.boolean().default(false) });
|
|
2044
|
+
var GitDiffResult = import_zod19.z.strictObject({ diff: GitText, truncated: import_zod19.z.boolean() });
|
|
2045
|
+
var GitLogParams = import_zod19.z.strictObject({ cwd: AbsPath, limit: import_zod19.z.int().min(1).max(500).default(50) });
|
|
2046
|
+
var GitLogCommit = import_zod19.z.strictObject({ sha: import_zod19.z.string(), short: import_zod19.z.string(), author: import_zod19.z.string(), date: import_zod19.z.string(), subject: import_zod19.z.string() });
|
|
2047
|
+
var GitLogResult = import_zod19.z.strictObject({ commits: import_zod19.z.array(GitLogCommit).max(500) });
|
|
2048
|
+
var GitAddParams = import_zod19.z.strictObject({ cwd: AbsPath, paths: import_zod19.z.array(import_zod19.z.string().min(1).max(4096)).min(1).max(1e3) });
|
|
2049
|
+
var GitCommitParams = import_zod19.z.strictObject({
|
|
1966
2050
|
cwd: AbsPath,
|
|
1967
|
-
message:
|
|
1968
|
-
amend:
|
|
2051
|
+
message: import_zod19.z.string().min(1).max(65536),
|
|
2052
|
+
amend: import_zod19.z.boolean().default(false),
|
|
1969
2053
|
/** "Name <email>"; absent = the computer's own git identity. */
|
|
1970
|
-
author:
|
|
2054
|
+
author: import_zod19.z.string().max(512).optional()
|
|
1971
2055
|
});
|
|
1972
|
-
var GitCommitResult =
|
|
1973
|
-
var GitPushParams =
|
|
1974
|
-
var GitPullParams =
|
|
1975
|
-
var GitBranchParams =
|
|
1976
|
-
var GitBranchResult =
|
|
2056
|
+
var GitCommitResult = import_zod19.z.strictObject({ sha: import_zod19.z.string(), output: GitText, truncated: import_zod19.z.boolean() });
|
|
2057
|
+
var GitPushParams = import_zod19.z.strictObject({ cwd: AbsPath, remote: GitName.default("origin"), branch: GitName.optional(), force_with_lease: import_zod19.z.boolean().default(false) });
|
|
2058
|
+
var GitPullParams = import_zod19.z.strictObject({ cwd: AbsPath, remote: GitName.default("origin"), branch: GitName.optional(), rebase: import_zod19.z.boolean().default(false) });
|
|
2059
|
+
var GitBranchParams = import_zod19.z.strictObject({ cwd: AbsPath, action: import_zod19.z.enum(["list", "create", "delete", "switch"]), name: GitName.optional() });
|
|
2060
|
+
var GitBranchResult = import_zod19.z.strictObject({
|
|
1977
2061
|
/** The branch checked out after the action; null when detached. */
|
|
1978
|
-
current:
|
|
2062
|
+
current: import_zod19.z.string().nullable(),
|
|
1979
2063
|
/** Local branches (filled by `list`; empty otherwise). */
|
|
1980
|
-
branches:
|
|
2064
|
+
branches: import_zod19.z.array(import_zod19.z.string()).max(5e3),
|
|
1981
2065
|
output: GitText,
|
|
1982
|
-
truncated:
|
|
2066
|
+
truncated: import_zod19.z.boolean()
|
|
1983
2067
|
});
|
|
1984
|
-
var GitStashParams =
|
|
1985
|
-
var GitCloneParams =
|
|
1986
|
-
url:
|
|
2068
|
+
var GitStashParams = import_zod19.z.strictObject({ cwd: AbsPath, action: import_zod19.z.enum(["push", "pop", "list", "drop"]), message: import_zod19.z.string().max(4096).optional() });
|
|
2069
|
+
var GitCloneParams = import_zod19.z.strictObject({
|
|
2070
|
+
url: import_zod19.z.string().min(1).max(4096).regex(/^[^-]/),
|
|
1987
2071
|
/** The folder to create; must not exist yet (or be empty). */
|
|
1988
2072
|
dest: AbsPath,
|
|
1989
2073
|
branch: GitName.optional(),
|
|
1990
|
-
depth:
|
|
2074
|
+
depth: import_zod19.z.int().min(1).max(1e6).optional()
|
|
1991
2075
|
});
|
|
1992
2076
|
|
|
1993
2077
|
// src/schema/web.ts
|
|
1994
|
-
var
|
|
2078
|
+
var import_zod20 = require("zod");
|
|
1995
2079
|
var WEB_MAX_TEXT_CHARS = 524288;
|
|
1996
|
-
var WebUrl =
|
|
1997
|
-
var WebText =
|
|
1998
|
-
var WebHeader =
|
|
1999
|
-
var WebFetchParams =
|
|
2080
|
+
var WebUrl = import_zod20.z.string().min(1).max(8192).regex(/^https?:\/\//);
|
|
2081
|
+
var WebText = import_zod20.z.string().max(WEB_MAX_TEXT_CHARS);
|
|
2082
|
+
var WebHeader = import_zod20.z.strictObject({ name: import_zod20.z.string().min(1).max(256), value: import_zod20.z.string().max(8192) });
|
|
2083
|
+
var WebFetchParams = import_zod20.z.strictObject({
|
|
2000
2084
|
url: WebUrl,
|
|
2001
|
-
method:
|
|
2002
|
-
headers:
|
|
2003
|
-
body:
|
|
2004
|
-
follow_redirects:
|
|
2005
|
-
timeout_s:
|
|
2006
|
-
});
|
|
2007
|
-
var WebFetchResult =
|
|
2008
|
-
status:
|
|
2009
|
-
reason:
|
|
2085
|
+
method: import_zod20.z.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]).default("GET"),
|
|
2086
|
+
headers: import_zod20.z.array(WebHeader).max(64).default([]),
|
|
2087
|
+
body: import_zod20.z.string().max(1048576).optional(),
|
|
2088
|
+
follow_redirects: import_zod20.z.boolean().default(true),
|
|
2089
|
+
timeout_s: import_zod20.z.int().min(1).max(300).default(30)
|
|
2090
|
+
});
|
|
2091
|
+
var WebFetchResult = import_zod20.z.strictObject({
|
|
2092
|
+
status: import_zod20.z.int().min(100).max(999),
|
|
2093
|
+
reason: import_zod20.z.string(),
|
|
2010
2094
|
/** The final URL after redirects. */
|
|
2011
|
-
url:
|
|
2012
|
-
content_type:
|
|
2013
|
-
headers:
|
|
2095
|
+
url: import_zod20.z.string(),
|
|
2096
|
+
content_type: import_zod20.z.string().nullable(),
|
|
2097
|
+
headers: import_zod20.z.array(WebHeader),
|
|
2014
2098
|
body: WebText,
|
|
2015
|
-
truncated:
|
|
2099
|
+
truncated: import_zod20.z.boolean(),
|
|
2016
2100
|
bytes: nonNegInt,
|
|
2017
2101
|
elapsed_ms: nonNegInt
|
|
2018
2102
|
});
|
|
2019
|
-
var WebScrapeParams =
|
|
2020
|
-
urls:
|
|
2021
|
-
use_cache:
|
|
2022
|
-
get_links:
|
|
2103
|
+
var WebScrapeParams = import_zod20.z.strictObject({
|
|
2104
|
+
urls: import_zod20.z.array(WebUrl).min(1).max(20),
|
|
2105
|
+
use_cache: import_zod20.z.boolean().default(true),
|
|
2106
|
+
get_links: import_zod20.z.boolean().default(false)
|
|
2023
2107
|
});
|
|
2024
|
-
var WebScrapePage =
|
|
2025
|
-
url:
|
|
2026
|
-
ok:
|
|
2027
|
-
status:
|
|
2028
|
-
title:
|
|
2108
|
+
var WebScrapePage = import_zod20.z.strictObject({
|
|
2109
|
+
url: import_zod20.z.string(),
|
|
2110
|
+
ok: import_zod20.z.boolean(),
|
|
2111
|
+
status: import_zod20.z.int().min(0).max(999).nullable(),
|
|
2112
|
+
title: import_zod20.z.string().nullable(),
|
|
2029
2113
|
/** The page's readable content (markdown-like text from the scraper's parse). */
|
|
2030
2114
|
text: WebText,
|
|
2031
|
-
truncated:
|
|
2115
|
+
truncated: import_zod20.z.boolean(),
|
|
2032
2116
|
/** Links found on the page (only with get_links). */
|
|
2033
|
-
links:
|
|
2117
|
+
links: import_zod20.z.array(import_zod20.z.string()).max(2e3),
|
|
2034
2118
|
/** Why the page failed (blocked, timeout, not found…), in the scraper's words; null when ok. */
|
|
2035
|
-
error:
|
|
2119
|
+
error: import_zod20.z.string().nullable(),
|
|
2036
2120
|
/** How the page was fetched (http, browser, cache). */
|
|
2037
|
-
via:
|
|
2038
|
-
});
|
|
2039
|
-
var WebScrapeResult =
|
|
2040
|
-
var WebSearchParams =
|
|
2041
|
-
keywords:
|
|
2042
|
-
country:
|
|
2043
|
-
count:
|
|
2044
|
-
freshness:
|
|
2045
|
-
});
|
|
2046
|
-
var WebSearchHit =
|
|
2047
|
-
var WebSearchQueryResult =
|
|
2048
|
-
var WebSearchResult =
|
|
2049
|
-
var ToolsWebSearchParams =
|
|
2050
|
-
keywords:
|
|
2051
|
-
country:
|
|
2052
|
-
count:
|
|
2053
|
-
freshness:
|
|
2054
|
-
});
|
|
2055
|
-
var WebBrowserFetchParams =
|
|
2121
|
+
via: import_zod20.z.string().nullable()
|
|
2122
|
+
});
|
|
2123
|
+
var WebScrapeResult = import_zod20.z.strictObject({ pages: import_zod20.z.array(WebScrapePage), elapsed_ms: nonNegInt });
|
|
2124
|
+
var WebSearchParams = import_zod20.z.strictObject({
|
|
2125
|
+
keywords: import_zod20.z.array(import_zod20.z.string().min(1).max(400)).min(1).max(5),
|
|
2126
|
+
country: import_zod20.z.string().min(2).max(2).default("us"),
|
|
2127
|
+
count: import_zod20.z.int().min(1).max(20).default(10),
|
|
2128
|
+
freshness: import_zod20.z.enum(["pd", "pw", "pm", "py"]).optional()
|
|
2129
|
+
});
|
|
2130
|
+
var WebSearchHit = import_zod20.z.strictObject({ title: import_zod20.z.string(), url: import_zod20.z.string(), description: import_zod20.z.string() });
|
|
2131
|
+
var WebSearchQueryResult = import_zod20.z.strictObject({ keyword: import_zod20.z.string(), hits: import_zod20.z.array(WebSearchHit), error: import_zod20.z.string().nullable() });
|
|
2132
|
+
var WebSearchResult = import_zod20.z.strictObject({ queries: import_zod20.z.array(WebSearchQueryResult), elapsed_ms: nonNegInt });
|
|
2133
|
+
var ToolsWebSearchParams = import_zod20.z.strictObject({
|
|
2134
|
+
keywords: import_zod20.z.array(import_zod20.z.string().min(1).max(400)).min(1).max(5),
|
|
2135
|
+
country: import_zod20.z.string().min(2).max(2).default("us"),
|
|
2136
|
+
count: import_zod20.z.int().min(1).max(20).default(10),
|
|
2137
|
+
freshness: import_zod20.z.enum(["pd", "pw", "pm", "py"]).optional()
|
|
2138
|
+
});
|
|
2139
|
+
var WebBrowserFetchParams = import_zod20.z.strictObject({
|
|
2056
2140
|
url: WebUrl,
|
|
2057
2141
|
/** A CSS selector to wait for before reading the page. */
|
|
2058
|
-
wait_for:
|
|
2059
|
-
wait_timeout_ms:
|
|
2142
|
+
wait_for: import_zod20.z.string().max(1024).optional(),
|
|
2143
|
+
wait_timeout_ms: import_zod20.z.int().min(100).max(12e4).default(3e4),
|
|
2060
2144
|
/** true: readable text; false: the rendered HTML. */
|
|
2061
|
-
extract_text:
|
|
2145
|
+
extract_text: import_zod20.z.boolean().default(true)
|
|
2062
2146
|
});
|
|
2063
|
-
var WebBrowserFetchResult =
|
|
2064
|
-
url:
|
|
2065
|
-
status:
|
|
2066
|
-
title:
|
|
2147
|
+
var WebBrowserFetchResult = import_zod20.z.strictObject({
|
|
2148
|
+
url: import_zod20.z.string(),
|
|
2149
|
+
status: import_zod20.z.int().min(0).max(999).nullable(),
|
|
2150
|
+
title: import_zod20.z.string().nullable(),
|
|
2067
2151
|
content: WebText,
|
|
2068
|
-
truncated:
|
|
2152
|
+
truncated: import_zod20.z.boolean(),
|
|
2069
2153
|
elapsed_ms: nonNegInt
|
|
2070
2154
|
});
|
|
2071
|
-
var ToolsServiceProgress =
|
|
2155
|
+
var ToolsServiceProgress = import_zod20.z.strictObject({ phase: import_zod20.z.enum(["fetching", "installing"]), done: nonNegInt, total: nonNegInt });
|
|
2072
2156
|
|
|
2073
2157
|
// src/schema/system.ts
|
|
2074
|
-
var
|
|
2075
|
-
var SystemOpenUrlParams =
|
|
2158
|
+
var import_zod21 = require("zod");
|
|
2159
|
+
var SystemOpenUrlParams = import_zod21.z.strictObject({
|
|
2076
2160
|
/** http, https or mailto; opened in the person's default app for it. */
|
|
2077
|
-
url:
|
|
2161
|
+
url: import_zod21.z.string().min(1).max(4096)
|
|
2078
2162
|
});
|
|
2079
|
-
var SystemOpenUrlResult =
|
|
2080
|
-
var SystemOpenPathParams =
|
|
2163
|
+
var SystemOpenUrlResult = import_zod21.z.strictObject({ url: import_zod21.z.string().max(4096) });
|
|
2164
|
+
var SystemOpenPathParams = import_zod21.z.strictObject({
|
|
2081
2165
|
path: AbsPath,
|
|
2082
2166
|
/** Show it in the file manager (Finder, Explorer) instead of opening it. */
|
|
2083
|
-
reveal:
|
|
2167
|
+
reveal: import_zod21.z.boolean().default(false)
|
|
2084
2168
|
});
|
|
2085
|
-
var SystemOpenPathResult =
|
|
2086
|
-
var SystemNotifyParams =
|
|
2087
|
-
title:
|
|
2088
|
-
body:
|
|
2169
|
+
var SystemOpenPathResult = import_zod21.z.strictObject({ path: AbsPath, revealed: import_zod21.z.boolean() });
|
|
2170
|
+
var SystemNotifyParams = import_zod21.z.strictObject({
|
|
2171
|
+
title: import_zod21.z.string().min(1).max(128),
|
|
2172
|
+
body: import_zod21.z.string().max(1024).default("")
|
|
2089
2173
|
});
|
|
2090
|
-
var SystemNotifyResult =
|
|
2174
|
+
var SystemNotifyResult = import_zod21.z.strictObject({
|
|
2091
2175
|
/** False when this computer has no notification service to show it (a bare Linux box). */
|
|
2092
|
-
shown:
|
|
2176
|
+
shown: import_zod21.z.boolean()
|
|
2093
2177
|
});
|
|
2094
2178
|
|
|
2095
2179
|
// src/schema/screen.ts
|
|
2096
|
-
var
|
|
2097
|
-
var ScreenDisplay =
|
|
2180
|
+
var import_zod22 = require("zod");
|
|
2181
|
+
var ScreenDisplay = import_zod22.z.strictObject({
|
|
2098
2182
|
/** The OS's display id; pass it to screen.capture. */
|
|
2099
2183
|
id: nonNegInt,
|
|
2100
|
-
name:
|
|
2184
|
+
name: import_zod22.z.string().max(128),
|
|
2101
2185
|
/** Position and size in the OS's logical points (x and y may be negative left of or above the main display). */
|
|
2102
|
-
x:
|
|
2103
|
-
y:
|
|
2104
|
-
width:
|
|
2105
|
-
height:
|
|
2186
|
+
x: import_zod22.z.int(),
|
|
2187
|
+
y: import_zod22.z.int(),
|
|
2188
|
+
width: import_zod22.z.int().min(1),
|
|
2189
|
+
height: import_zod22.z.int().min(1),
|
|
2106
2190
|
/** Pixels per point (2 on a Retina display). */
|
|
2107
|
-
scale:
|
|
2108
|
-
primary:
|
|
2191
|
+
scale: import_zod22.z.number().min(0.1).max(8),
|
|
2192
|
+
primary: import_zod22.z.boolean()
|
|
2109
2193
|
});
|
|
2110
|
-
var ScreenListParams =
|
|
2111
|
-
var ScreenListResult =
|
|
2112
|
-
var ScreenCaptureParams =
|
|
2194
|
+
var ScreenListParams = import_zod22.z.strictObject({});
|
|
2195
|
+
var ScreenListResult = import_zod22.z.strictObject({ displays: import_zod22.z.array(ScreenDisplay).max(32) });
|
|
2196
|
+
var ScreenCaptureParams = import_zod22.z.strictObject({
|
|
2113
2197
|
/** The display (from screen.list); the primary display when absent. */
|
|
2114
2198
|
display_id: nonNegInt.optional(),
|
|
2115
|
-
format:
|
|
2199
|
+
format: import_zod22.z.enum(["jpeg", "png"]).default("jpeg"),
|
|
2116
2200
|
/** Scale the picture down to at most this width in pixels (kept when already smaller). */
|
|
2117
|
-
max_width:
|
|
2201
|
+
max_width: import_zod22.z.int().min(160).max(7680).default(1600)
|
|
2118
2202
|
});
|
|
2119
|
-
var ScreenCaptureResult =
|
|
2203
|
+
var ScreenCaptureResult = import_zod22.z.strictObject({
|
|
2120
2204
|
display_id: nonNegInt,
|
|
2121
|
-
mime_type:
|
|
2122
|
-
width:
|
|
2123
|
-
height:
|
|
2205
|
+
mime_type: import_zod22.z.enum(["image/jpeg", "image/png"]),
|
|
2206
|
+
width: import_zod22.z.int().min(1),
|
|
2207
|
+
height: import_zod22.z.int().min(1),
|
|
2124
2208
|
/** The display's full resolution in pixels, before scaling. */
|
|
2125
|
-
source_width:
|
|
2126
|
-
source_height:
|
|
2209
|
+
source_width: import_zod22.z.int().min(1),
|
|
2210
|
+
source_height: import_zod22.z.int().min(1),
|
|
2127
2211
|
/** The image, base64 (at most 6 MiB of text). */
|
|
2128
|
-
data_base64:
|
|
2212
|
+
data_base64: import_zod22.z.string().max(6291456)
|
|
2129
2213
|
});
|
|
2130
2214
|
|
|
2131
2215
|
// src/schema/window.ts
|
|
2132
|
-
var
|
|
2133
|
-
var WindowInfo =
|
|
2216
|
+
var import_zod23 = require("zod");
|
|
2217
|
+
var WindowInfo = import_zod23.z.strictObject({
|
|
2134
2218
|
/** The OS's window handle (macOS window number, Windows HWND, X11 window id). */
|
|
2135
2219
|
id: nonNegInt,
|
|
2136
|
-
title:
|
|
2220
|
+
title: import_zod23.z.string().max(512),
|
|
2137
2221
|
/** Position and size in logical points. */
|
|
2138
|
-
x:
|
|
2139
|
-
y:
|
|
2140
|
-
width:
|
|
2141
|
-
height:
|
|
2222
|
+
x: import_zod23.z.int(),
|
|
2223
|
+
y: import_zod23.z.int(),
|
|
2224
|
+
width: import_zod23.z.int().min(0),
|
|
2225
|
+
height: import_zod23.z.int().min(0),
|
|
2142
2226
|
/**
|
|
2143
2227
|
* The application that owns the window, by the name the OS shows people; absent when the OS does
|
|
2144
2228
|
* not say. Optional (never null, the schema rule) because it was added in protocol 1.7: an older
|
|
2145
2229
|
* app's answer has no such field (FIELDS_SINCE).
|
|
2146
2230
|
*/
|
|
2147
|
-
app:
|
|
2231
|
+
app: import_zod23.z.string().max(256).optional(),
|
|
2148
2232
|
/** The owning process id; absent when the OS does not say. Added in protocol 1.7. */
|
|
2149
|
-
pid:
|
|
2233
|
+
pid: import_zod23.z.int().min(0).optional()
|
|
2150
2234
|
});
|
|
2151
|
-
var WindowListParams =
|
|
2235
|
+
var WindowListParams = import_zod23.z.strictObject({
|
|
2152
2236
|
/** Case-insensitive substring of the window title. */
|
|
2153
|
-
title:
|
|
2154
|
-
limit:
|
|
2237
|
+
title: import_zod23.z.string().min(1).max(256).optional(),
|
|
2238
|
+
limit: import_zod23.z.int().min(1).max(500).default(100)
|
|
2155
2239
|
});
|
|
2156
|
-
var WindowListResult =
|
|
2157
|
-
windows:
|
|
2240
|
+
var WindowListResult = import_zod23.z.strictObject({
|
|
2241
|
+
windows: import_zod23.z.array(WindowInfo).max(500),
|
|
2158
2242
|
total: nonNegInt,
|
|
2159
|
-
truncated:
|
|
2243
|
+
truncated: import_zod23.z.boolean()
|
|
2160
2244
|
});
|
|
2161
|
-
var WindowFocusParams =
|
|
2162
|
-
var WindowFocusResult =
|
|
2163
|
-
var WindowMoveParams =
|
|
2245
|
+
var WindowFocusParams = import_zod23.z.strictObject({ id: nonNegInt });
|
|
2246
|
+
var WindowFocusResult = import_zod23.z.strictObject({ window: WindowInfo });
|
|
2247
|
+
var WindowMoveParams = import_zod23.z.strictObject({
|
|
2164
2248
|
id: nonNegInt,
|
|
2165
2249
|
/** New top-left corner; unchanged when absent. */
|
|
2166
|
-
x:
|
|
2167
|
-
y:
|
|
2250
|
+
x: import_zod23.z.int().optional(),
|
|
2251
|
+
y: import_zod23.z.int().optional(),
|
|
2168
2252
|
/** New size; unchanged when absent. */
|
|
2169
|
-
width:
|
|
2170
|
-
height:
|
|
2253
|
+
width: import_zod23.z.int().min(50).max(16384).optional(),
|
|
2254
|
+
height: import_zod23.z.int().min(50).max(16384).optional()
|
|
2171
2255
|
});
|
|
2172
|
-
var WindowMoveResult =
|
|
2173
|
-
var WindowMinimizeParams =
|
|
2174
|
-
var WindowMinimizeResult =
|
|
2256
|
+
var WindowMoveResult = import_zod23.z.strictObject({ window: WindowInfo });
|
|
2257
|
+
var WindowMinimizeParams = import_zod23.z.strictObject({ id: nonNegInt });
|
|
2258
|
+
var WindowMinimizeResult = import_zod23.z.strictObject({ id: nonNegInt });
|
|
2175
2259
|
|
|
2176
2260
|
// src/schema/input.ts
|
|
2177
|
-
var
|
|
2178
|
-
var InputKey =
|
|
2261
|
+
var import_zod24 = require("zod");
|
|
2262
|
+
var InputKey = import_zod24.z.enum([
|
|
2179
2263
|
"cmd",
|
|
2180
2264
|
"ctrl",
|
|
2181
2265
|
"alt",
|
|
@@ -2255,65 +2339,65 @@ var InputKey = import_zod23.z.enum([
|
|
|
2255
2339
|
"backslash",
|
|
2256
2340
|
"grave"
|
|
2257
2341
|
]);
|
|
2258
|
-
var InputTypeTextParams =
|
|
2259
|
-
var InputTypeTextResult =
|
|
2260
|
-
var InputHotkeyParams =
|
|
2342
|
+
var InputTypeTextParams = import_zod24.z.strictObject({ text: import_zod24.z.string().min(1).max(1e4) });
|
|
2343
|
+
var InputTypeTextResult = import_zod24.z.strictObject({ characters: import_zod24.z.int().min(1) });
|
|
2344
|
+
var InputHotkeyParams = import_zod24.z.strictObject({
|
|
2261
2345
|
/** Pressed together in order and released in reverse: ["cmd", "shift", "t"]. */
|
|
2262
|
-
keys:
|
|
2346
|
+
keys: import_zod24.z.array(InputKey).min(1).max(6)
|
|
2263
2347
|
});
|
|
2264
|
-
var InputHotkeyResult =
|
|
2265
|
-
var InputPoint =
|
|
2266
|
-
var InputMouseMoveParams =
|
|
2348
|
+
var InputHotkeyResult = import_zod24.z.strictObject({ keys: import_zod24.z.array(InputKey) });
|
|
2349
|
+
var InputPoint = import_zod24.z.strictObject({ x: import_zod24.z.int(), y: import_zod24.z.int() });
|
|
2350
|
+
var InputMouseMoveParams = import_zod24.z.strictObject({
|
|
2267
2351
|
/** Screen position in logical points (the coordinates screen.list and window.list report). */
|
|
2268
|
-
x:
|
|
2269
|
-
y:
|
|
2352
|
+
x: import_zod24.z.int(),
|
|
2353
|
+
y: import_zod24.z.int()
|
|
2270
2354
|
});
|
|
2271
|
-
var InputMouseMoveResult =
|
|
2355
|
+
var InputMouseMoveResult = import_zod24.z.strictObject({
|
|
2272
2356
|
/** Where the pointer is now, read back from the OS. */
|
|
2273
2357
|
position: InputPoint
|
|
2274
2358
|
});
|
|
2275
|
-
var InputMouseClickParams =
|
|
2359
|
+
var InputMouseClickParams = import_zod24.z.strictObject({
|
|
2276
2360
|
/** Move here first; clicks where the pointer is when absent. */
|
|
2277
|
-
x:
|
|
2278
|
-
y:
|
|
2279
|
-
button:
|
|
2280
|
-
double:
|
|
2361
|
+
x: import_zod24.z.int().optional(),
|
|
2362
|
+
y: import_zod24.z.int().optional(),
|
|
2363
|
+
button: import_zod24.z.enum(["left", "right", "middle"]).default("left"),
|
|
2364
|
+
double: import_zod24.z.boolean().default(false)
|
|
2281
2365
|
});
|
|
2282
|
-
var InputMouseClickResult =
|
|
2366
|
+
var InputMouseClickResult = import_zod24.z.strictObject({
|
|
2283
2367
|
position: InputPoint,
|
|
2284
|
-
button:
|
|
2285
|
-
double:
|
|
2368
|
+
button: import_zod24.z.enum(["left", "right", "middle"]),
|
|
2369
|
+
double: import_zod24.z.boolean()
|
|
2286
2370
|
});
|
|
2287
2371
|
|
|
2288
2372
|
// src/schema/power.ts
|
|
2289
|
-
var
|
|
2290
|
-
var PowerStatusParams =
|
|
2291
|
-
var PowerStatusResult =
|
|
2292
|
-
has_battery:
|
|
2373
|
+
var import_zod25 = require("zod");
|
|
2374
|
+
var PowerStatusParams = import_zod25.z.strictObject({});
|
|
2375
|
+
var PowerStatusResult = import_zod25.z.strictObject({
|
|
2376
|
+
has_battery: import_zod25.z.boolean(),
|
|
2293
2377
|
/** 0–100; null without a battery. */
|
|
2294
|
-
percent:
|
|
2295
|
-
charging:
|
|
2378
|
+
percent: import_zod25.z.number().min(0).max(100).nullable(),
|
|
2379
|
+
charging: import_zod25.z.boolean().nullable(),
|
|
2296
2380
|
/** On wall power; null where the OS does not say. */
|
|
2297
|
-
plugged_in:
|
|
2381
|
+
plugged_in: import_zod25.z.boolean().nullable(),
|
|
2298
2382
|
/** Minutes of battery left; null when charging, unknown or without a battery. */
|
|
2299
2383
|
minutes_left: nonNegInt.nullable(),
|
|
2300
2384
|
/** Matrx 2 is keeping the computer awake (power.prevent_sleep) until this time; null when it is not. */
|
|
2301
2385
|
awake_until_ms: epochMs.nullable()
|
|
2302
2386
|
});
|
|
2303
|
-
var PowerPreventSleepParams =
|
|
2387
|
+
var PowerPreventSleepParams = import_zod25.z.strictObject({
|
|
2304
2388
|
/** Keep the computer awake this long; 0 lets it sleep again now. */
|
|
2305
|
-
seconds:
|
|
2389
|
+
seconds: import_zod25.z.int().min(0).max(86400),
|
|
2306
2390
|
/** Shown where the OS lists what keeps it awake. */
|
|
2307
|
-
reason:
|
|
2391
|
+
reason: import_zod25.z.string().min(1).max(128).default("Matrx 2 is working")
|
|
2308
2392
|
});
|
|
2309
|
-
var PowerPreventSleepResult =
|
|
2393
|
+
var PowerPreventSleepResult = import_zod25.z.strictObject({
|
|
2310
2394
|
/** When it may sleep again; null after seconds 0. */
|
|
2311
2395
|
awake_until_ms: epochMs.nullable()
|
|
2312
2396
|
});
|
|
2313
2397
|
|
|
2314
2398
|
// src/schema/diag.ts
|
|
2315
|
-
var
|
|
2316
|
-
var DiagProcess =
|
|
2399
|
+
var import_zod26 = require("zod");
|
|
2400
|
+
var DiagProcess = import_zod26.z.enum([
|
|
2317
2401
|
"main",
|
|
2318
2402
|
"renderer",
|
|
2319
2403
|
"hosted_page",
|
|
@@ -2326,7 +2410,7 @@ var DiagProcess = import_zod25.z.enum([
|
|
|
2326
2410
|
"coding_sessions",
|
|
2327
2411
|
"claude_accounts"
|
|
2328
2412
|
]);
|
|
2329
|
-
var DiagErrorKind =
|
|
2413
|
+
var DiagErrorKind = import_zod26.z.enum([
|
|
2330
2414
|
"uncaught_exception",
|
|
2331
2415
|
"unhandled_rejection",
|
|
2332
2416
|
"renderer_crash",
|
|
@@ -2338,148 +2422,148 @@ var DiagErrorKind = import_zod25.z.enum([
|
|
|
2338
2422
|
"banner",
|
|
2339
2423
|
"logged_error"
|
|
2340
2424
|
]);
|
|
2341
|
-
var DiagErrorStatus =
|
|
2342
|
-
var DiagErrorEntry =
|
|
2425
|
+
var DiagErrorStatus = import_zod26.z.enum(["waiting", "sent", "resolved"]);
|
|
2426
|
+
var DiagErrorEntry = import_zod26.z.strictObject({
|
|
2343
2427
|
/** sha256 prefix over process, kind, source, code and the normalized message. */
|
|
2344
|
-
signature:
|
|
2428
|
+
signature: import_zod26.z.string().regex(/^[0-9a-f]{32}$/),
|
|
2345
2429
|
process: DiagProcess,
|
|
2346
2430
|
kind: DiagErrorKind,
|
|
2347
2431
|
/** Where: a cap.op, a log event, a screen or page name. */
|
|
2348
|
-
source:
|
|
2432
|
+
source: import_zod26.z.string().min(1).max(128),
|
|
2349
2433
|
/** An ErrorCode, an exit code or signal, an error class; null when there is none. */
|
|
2350
|
-
code:
|
|
2434
|
+
code: import_zod26.z.string().max(64).nullable(),
|
|
2351
2435
|
/** The first occurrence's message, personal data removed. */
|
|
2352
|
-
message:
|
|
2436
|
+
message: import_zod26.z.string().max(500),
|
|
2353
2437
|
count: nonNegInt,
|
|
2354
2438
|
first_seen_ms: epochMs,
|
|
2355
2439
|
last_seen_ms: epochMs,
|
|
2356
2440
|
status: DiagErrorStatus,
|
|
2357
2441
|
/** What the agent who resolved it wrote; null until resolved. */
|
|
2358
|
-
resolution_note:
|
|
2359
|
-
app_version:
|
|
2442
|
+
resolution_note: import_zod26.z.string().max(500).nullable(),
|
|
2443
|
+
app_version: import_zod26.z.string().max(64)
|
|
2360
2444
|
});
|
|
2361
|
-
var DiagErrorsListParams =
|
|
2445
|
+
var DiagErrorsListParams = import_zod26.z.strictObject({
|
|
2362
2446
|
/** open = waiting or sent; all includes resolved. */
|
|
2363
|
-
status:
|
|
2364
|
-
limit:
|
|
2447
|
+
status: import_zod26.z.enum(["open", "all"]).default("open"),
|
|
2448
|
+
limit: import_zod26.z.int().min(1).max(500).default(200)
|
|
2365
2449
|
});
|
|
2366
|
-
var DiagErrorsListResult =
|
|
2450
|
+
var DiagErrorsListResult = import_zod26.z.strictObject({
|
|
2367
2451
|
/** Newest last_seen first. */
|
|
2368
|
-
entries:
|
|
2452
|
+
entries: import_zod26.z.array(DiagErrorEntry).max(500),
|
|
2369
2453
|
total_signatures: nonNegInt,
|
|
2370
2454
|
total_occurrences: nonNegInt,
|
|
2371
2455
|
/** Signatures with occurrences not yet delivered. */
|
|
2372
2456
|
waiting: nonNegInt,
|
|
2373
2457
|
/** signed_out = kept until sign-in; ok = the last delivery worked; failing = the last delivery failed (kept, retried). */
|
|
2374
|
-
delivery:
|
|
2458
|
+
delivery: import_zod26.z.enum(["signed_out", "ok", "failing"]),
|
|
2375
2459
|
last_delivery_ms: epochMs.nullable()
|
|
2376
2460
|
});
|
|
2377
|
-
var DiagErrorsReportParams =
|
|
2378
|
-
process:
|
|
2379
|
-
kind:
|
|
2461
|
+
var DiagErrorsReportParams = import_zod26.z.strictObject({
|
|
2462
|
+
process: import_zod26.z.enum(["renderer", "hosted_page"]),
|
|
2463
|
+
kind: import_zod26.z.enum(["uncaught_exception", "unhandled_rejection", "console_error", "banner"]),
|
|
2380
2464
|
/** The screen or page, e.g. "code.chats". */
|
|
2381
|
-
source:
|
|
2382
|
-
message:
|
|
2383
|
-
code:
|
|
2384
|
-
stack:
|
|
2465
|
+
source: import_zod26.z.string().min(1).max(128),
|
|
2466
|
+
message: import_zod26.z.string().min(1).max(2e3),
|
|
2467
|
+
code: import_zod26.z.string().max(64).optional(),
|
|
2468
|
+
stack: import_zod26.z.string().max(8e3).optional()
|
|
2385
2469
|
});
|
|
2386
|
-
var DiagErrorsReportResult =
|
|
2387
|
-
signature:
|
|
2470
|
+
var DiagErrorsReportResult = import_zod26.z.strictObject({
|
|
2471
|
+
signature: import_zod26.z.string().regex(/^[0-9a-f]{32}$/)
|
|
2388
2472
|
});
|
|
2389
|
-
var DiagErrorsChangedEvent =
|
|
2473
|
+
var DiagErrorsChangedEvent = import_zod26.z.strictObject({
|
|
2390
2474
|
total_signatures: nonNegInt,
|
|
2391
2475
|
waiting: nonNegInt
|
|
2392
2476
|
});
|
|
2393
2477
|
|
|
2394
2478
|
// src/schema/resources.ts
|
|
2395
|
-
var
|
|
2396
|
-
var ResourcesDisk =
|
|
2479
|
+
var import_zod27 = require("zod");
|
|
2480
|
+
var ResourcesDisk = import_zod27.z.strictObject({
|
|
2397
2481
|
/** Where it is mounted ("/", "C:"). */
|
|
2398
|
-
mount:
|
|
2482
|
+
mount: import_zod27.z.string().max(512),
|
|
2399
2483
|
/** The volume's name as the file manager shows it ("Macintosh HD", "Local Disk (C:)"). Since 1.17. */
|
|
2400
|
-
name:
|
|
2484
|
+
name: import_zod27.z.string().max(256).optional(),
|
|
2401
2485
|
/** The file system ("apfs", "NTFS", "ext4"). */
|
|
2402
|
-
fs:
|
|
2486
|
+
fs: import_zod27.z.string().max(64),
|
|
2403
2487
|
size_bytes: nonNegInt,
|
|
2404
2488
|
used_bytes: nonNegInt,
|
|
2405
2489
|
available_bytes: nonNegInt
|
|
2406
2490
|
});
|
|
2407
|
-
var ResourcesSnapshotParams =
|
|
2408
|
-
var ResourcesSnapshotResult =
|
|
2409
|
-
cpu:
|
|
2491
|
+
var ResourcesSnapshotParams = import_zod27.z.strictObject({});
|
|
2492
|
+
var ResourcesSnapshotResult = import_zod27.z.strictObject({
|
|
2493
|
+
cpu: import_zod27.z.strictObject({
|
|
2410
2494
|
/** Busy share of all cores, 0–100, measured now. */
|
|
2411
|
-
percent:
|
|
2412
|
-
cores:
|
|
2495
|
+
percent: import_zod27.z.number().min(0).max(100),
|
|
2496
|
+
cores: import_zod27.z.int().min(1),
|
|
2413
2497
|
/** 1, 5 and 15 minute load averages; null on Windows. */
|
|
2414
|
-
load:
|
|
2498
|
+
load: import_zod27.z.array(import_zod27.z.number().min(0)).length(3).nullable()
|
|
2415
2499
|
}),
|
|
2416
|
-
memory:
|
|
2417
|
-
swap:
|
|
2418
|
-
disks:
|
|
2500
|
+
memory: import_zod27.z.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt, available_bytes: nonNegInt }),
|
|
2501
|
+
swap: import_zod27.z.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt }),
|
|
2502
|
+
disks: import_zod27.z.array(ResourcesDisk).max(64),
|
|
2419
2503
|
uptime_seconds: nonNegInt
|
|
2420
2504
|
});
|
|
2421
|
-
var ResourcesJobKind =
|
|
2422
|
-
var ResourcesStrain =
|
|
2423
|
-
var ResourcesPressure =
|
|
2424
|
-
var ResourcesJob =
|
|
2505
|
+
var ResourcesJobKind = import_zod27.z.enum(["type-check", "tests", "build", "lint", "dev server", "language server", "search"]);
|
|
2506
|
+
var ResourcesStrain = import_zod27.z.enum(["good", "strain", "overloaded"]);
|
|
2507
|
+
var ResourcesPressure = import_zod27.z.enum(["normal", "warning", "critical"]);
|
|
2508
|
+
var ResourcesJob = import_zod27.z.strictObject({
|
|
2425
2509
|
/** The job's root process (Stop takes its whole tree). */
|
|
2426
|
-
pid:
|
|
2510
|
+
pid: import_zod27.z.int().min(0),
|
|
2427
2511
|
kind: ResourcesJobKind,
|
|
2428
2512
|
/** Its heaviest process's command line, shortened ("…/lib/tsc --noEmit -p tsconfig.json"). */
|
|
2429
|
-
command:
|
|
2513
|
+
command: import_zod27.z.string().max(256),
|
|
2430
2514
|
/** Who started it: "Claude Code", "Codex", "Cursor", "VS Code", "Terminal", "local stack", "detached"; null when unknown. */
|
|
2431
|
-
started_by:
|
|
2515
|
+
started_by: import_zod27.z.string().max(64).nullable(),
|
|
2432
2516
|
/** Whatever started it is gone and nothing waits for it. */
|
|
2433
|
-
orphan:
|
|
2517
|
+
orphan: import_zod27.z.boolean(),
|
|
2434
2518
|
/** A type-check queued for its turn (no compiler running yet). */
|
|
2435
|
-
waiting:
|
|
2519
|
+
waiting: import_zod27.z.boolean(),
|
|
2436
2520
|
/** The project folder it runs in ("matrx-frontend"); null when not in one. */
|
|
2437
|
-
folder:
|
|
2521
|
+
folder: import_zod27.z.string().max(256).nullable(),
|
|
2438
2522
|
/** The same command in the same folder, running this many times (1 = no duplicate). */
|
|
2439
|
-
duplicates:
|
|
2440
|
-
processes:
|
|
2523
|
+
duplicates: import_zod27.z.int().min(1),
|
|
2524
|
+
processes: import_zod27.z.int().min(1),
|
|
2441
2525
|
/** Sum over the tree, as `ps` reports it: 100 = one full core. */
|
|
2442
|
-
cpu_percent:
|
|
2526
|
+
cpu_percent: import_zod27.z.number().min(0),
|
|
2443
2527
|
/** Real memory (macOS: the physical footprint Activity Monitor shows, compressed included). */
|
|
2444
2528
|
memory_bytes: nonNegInt,
|
|
2445
2529
|
started_at_ms: epochMs.nullable(),
|
|
2446
2530
|
/** False for an app, an agent session, a terminal, a system process, the local stack or Matrx 2 itself. */
|
|
2447
|
-
stoppable:
|
|
2531
|
+
stoppable: import_zod27.z.boolean()
|
|
2448
2532
|
});
|
|
2449
|
-
var ResourcesProcess =
|
|
2450
|
-
pid:
|
|
2533
|
+
var ResourcesProcess = import_zod27.z.strictObject({
|
|
2534
|
+
pid: import_zod27.z.int().min(0),
|
|
2451
2535
|
/** The command line, shortened. */
|
|
2452
|
-
name:
|
|
2453
|
-
cpu_percent:
|
|
2536
|
+
name: import_zod27.z.string().max(256),
|
|
2537
|
+
cpu_percent: import_zod27.z.number().min(0),
|
|
2454
2538
|
memory_bytes: nonNegInt,
|
|
2455
|
-
started_by:
|
|
2539
|
+
started_by: import_zod27.z.string().max(64).nullable(),
|
|
2456
2540
|
/** The job it belongs to ("type-check in aidream"); null when none. */
|
|
2457
|
-
job:
|
|
2541
|
+
job: import_zod27.z.string().max(256).nullable(),
|
|
2458
2542
|
started_at_ms: epochMs.nullable()
|
|
2459
2543
|
});
|
|
2460
|
-
var ResourcesVerdict =
|
|
2544
|
+
var ResourcesVerdict = import_zod27.z.strictObject({
|
|
2461
2545
|
level: ResourcesStrain,
|
|
2462
2546
|
/** One sentence ("Your Mac is under strain. 3 type-checks are running at once."). */
|
|
2463
|
-
text:
|
|
2547
|
+
text: import_zod27.z.string().max(256),
|
|
2464
2548
|
/** The biggest jobs behind it; null when all is well. */
|
|
2465
|
-
cause:
|
|
2549
|
+
cause: import_zod27.z.string().max(1024).nullable()
|
|
2466
2550
|
});
|
|
2467
|
-
var ResourcesSample =
|
|
2551
|
+
var ResourcesSample = import_zod27.z.strictObject({
|
|
2468
2552
|
at_ms: epochMs,
|
|
2469
2553
|
/** The 1-minute load average. */
|
|
2470
|
-
load:
|
|
2554
|
+
load: import_zod27.z.number().min(0),
|
|
2471
2555
|
memory_used_bytes: nonNegInt,
|
|
2472
2556
|
typechecks: nonNegInt
|
|
2473
2557
|
});
|
|
2474
|
-
var ResourcesActivityParams =
|
|
2475
|
-
var ResourcesActivityResult =
|
|
2558
|
+
var ResourcesActivityParams = import_zod27.z.strictObject({});
|
|
2559
|
+
var ResourcesActivityResult = import_zod27.z.strictObject({
|
|
2476
2560
|
/** False until the first reading (a second or two after start). */
|
|
2477
|
-
ready:
|
|
2561
|
+
ready: import_zod27.z.boolean(),
|
|
2478
2562
|
sampled_at_ms: epochMs.nullable(),
|
|
2479
|
-
cores:
|
|
2563
|
+
cores: import_zod27.z.int().min(1),
|
|
2480
2564
|
/** 1, 5 and 15 minute load averages. */
|
|
2481
|
-
load:
|
|
2482
|
-
memory:
|
|
2565
|
+
load: import_zod27.z.array(import_zod27.z.number().min(0)).length(3),
|
|
2566
|
+
memory: import_zod27.z.strictObject({
|
|
2483
2567
|
total_bytes: nonNegInt,
|
|
2484
2568
|
/** Activity Monitor's Memory Used: app memory + wired + compressed. */
|
|
2485
2569
|
used_bytes: nonNegInt,
|
|
@@ -2490,252 +2574,252 @@ var ResourcesActivityResult = import_zod26.z.strictObject({
|
|
|
2490
2574
|
pressure: ResourcesPressure.nullable()
|
|
2491
2575
|
}),
|
|
2492
2576
|
verdict: ResourcesVerdict,
|
|
2493
|
-
typechecks:
|
|
2577
|
+
typechecks: import_zod27.z.strictObject({ running: nonNegInt, waiting: nonNegInt, comfort: nonNegInt }),
|
|
2494
2578
|
/** Heaviest first (1 GB weighs as much as 16 % of a core). */
|
|
2495
|
-
jobs:
|
|
2579
|
+
jobs: import_zod27.z.array(ResourcesJob).max(200),
|
|
2496
2580
|
/** The 15 heaviest by memory and the 15 busiest by CPU, together. */
|
|
2497
|
-
top:
|
|
2581
|
+
top: import_zod27.z.array(ResourcesProcess).max(30),
|
|
2498
2582
|
/** The last hour, oldest first. */
|
|
2499
|
-
history:
|
|
2583
|
+
history: import_zod27.z.array(ResourcesSample).max(1200)
|
|
2500
2584
|
});
|
|
2501
|
-
var ResourcesStopJobParams =
|
|
2502
|
-
var ResourcesStopJobResult =
|
|
2585
|
+
var ResourcesStopJobParams = import_zod27.z.strictObject({ pid: import_zod27.z.int().min(1) });
|
|
2586
|
+
var ResourcesStopJobResult = import_zod27.z.strictObject({
|
|
2503
2587
|
/** Processes signalled; whatever is still running 5 seconds later is force-stopped. */
|
|
2504
2588
|
processes: nonNegInt,
|
|
2505
2589
|
/** It had finished before the request arrived. */
|
|
2506
|
-
already_finished:
|
|
2590
|
+
already_finished: import_zod27.z.boolean()
|
|
2507
2591
|
});
|
|
2508
|
-
var ResourcesIncident =
|
|
2592
|
+
var ResourcesIncident = import_zod27.z.strictObject({
|
|
2509
2593
|
at_ms: epochMs,
|
|
2510
2594
|
verdict: ResourcesVerdict,
|
|
2511
|
-
load:
|
|
2595
|
+
load: import_zod27.z.number().min(0),
|
|
2512
2596
|
memory_used_bytes: nonNegInt,
|
|
2513
2597
|
compressed_bytes: nonNegInt,
|
|
2514
2598
|
pressure: ResourcesPressure.nullable(),
|
|
2515
|
-
jobs:
|
|
2516
|
-
|
|
2599
|
+
jobs: import_zod27.z.array(
|
|
2600
|
+
import_zod27.z.strictObject({
|
|
2517
2601
|
kind: ResourcesJobKind,
|
|
2518
|
-
started_by:
|
|
2519
|
-
folder:
|
|
2520
|
-
command:
|
|
2521
|
-
cpu_percent:
|
|
2602
|
+
started_by: import_zod27.z.string().max(64).nullable(),
|
|
2603
|
+
folder: import_zod27.z.string().max(256).nullable(),
|
|
2604
|
+
command: import_zod27.z.string().max(256),
|
|
2605
|
+
cpu_percent: import_zod27.z.number().min(0),
|
|
2522
2606
|
memory_bytes: nonNegInt,
|
|
2523
|
-
duplicates:
|
|
2607
|
+
duplicates: import_zod27.z.int().min(1)
|
|
2524
2608
|
})
|
|
2525
2609
|
).max(8)
|
|
2526
2610
|
});
|
|
2527
|
-
var ResourcesIncidentsParams =
|
|
2528
|
-
var ResourcesIncidentsResult =
|
|
2611
|
+
var ResourcesIncidentsParams = import_zod27.z.strictObject({ limit: import_zod27.z.int().min(1).max(200).default(50) });
|
|
2612
|
+
var ResourcesIncidentsResult = import_zod27.z.strictObject({
|
|
2529
2613
|
/** Newest first; at most one a minute is written. */
|
|
2530
|
-
incidents:
|
|
2614
|
+
incidents: import_zod27.z.array(ResourcesIncident).max(200)
|
|
2531
2615
|
});
|
|
2532
2616
|
|
|
2533
2617
|
// src/schema/stack.ts
|
|
2534
|
-
var
|
|
2535
|
-
var StackServerName =
|
|
2536
|
-
var StackTone =
|
|
2537
|
-
var StackServer =
|
|
2618
|
+
var import_zod28 = require("zod");
|
|
2619
|
+
var StackServerName = import_zod28.z.string().regex(/^[a-z0-9_-]{1,64}$/);
|
|
2620
|
+
var StackTone = import_zod28.z.enum(["good", "wait", "bad", "off"]);
|
|
2621
|
+
var StackServer = import_zod28.z.strictObject({
|
|
2538
2622
|
name: StackServerName,
|
|
2539
2623
|
/** One word: Healthy, Starting, Unhealthy, Restarting, Stopping, Waiting, Stopped, Crashed, Off. */
|
|
2540
|
-
label:
|
|
2624
|
+
label: import_zod28.z.string().max(32),
|
|
2541
2625
|
tone: StackTone,
|
|
2542
2626
|
/** What is going on, in one or two plain sentences. */
|
|
2543
|
-
sentence:
|
|
2627
|
+
sentence: import_zod28.z.string().max(2e3),
|
|
2544
2628
|
/** The config's own description of the server. */
|
|
2545
|
-
description:
|
|
2629
|
+
description: import_zod28.z.string().max(512),
|
|
2546
2630
|
/** Where the server answers, when its description names an address. */
|
|
2547
|
-
open_url:
|
|
2548
|
-
log_file:
|
|
2631
|
+
open_url: import_zod28.z.string().max(2048).nullable(),
|
|
2632
|
+
log_file: import_zod28.z.string().max(4096),
|
|
2549
2633
|
/** When its log file was last written. */
|
|
2550
2634
|
last_output_at_ms: epochMs.nullable(),
|
|
2551
2635
|
started_at_ms: epochMs.nullable(),
|
|
2552
2636
|
restarts: nonNegInt,
|
|
2553
|
-
exit_code:
|
|
2554
|
-
pid:
|
|
2637
|
+
exit_code: import_zod28.z.int().nullable(),
|
|
2638
|
+
pid: import_zod28.z.int().nullable(),
|
|
2555
2639
|
/** (1.18) CPU of the server's process and everything under it, in percent of one core; absent when it is not running. */
|
|
2556
|
-
cpu_percent:
|
|
2640
|
+
cpu_percent: import_zod28.z.number().min(0).optional(),
|
|
2557
2641
|
/** (1.18) Memory of the same processes: the physical footprint (Activity Monitor's Memory) summed; absent when it is not running. */
|
|
2558
2642
|
memory_bytes: nonNegInt.optional()
|
|
2559
2643
|
});
|
|
2560
|
-
var StackEvent =
|
|
2644
|
+
var StackEvent = import_zod28.z.strictObject({
|
|
2561
2645
|
at_ms: epochMs,
|
|
2562
2646
|
/** A server name, or "stack" for the stack as a whole. */
|
|
2563
|
-
server:
|
|
2647
|
+
server: import_zod28.z.string().max(64),
|
|
2564
2648
|
/** started · stopped · healthy · unhealthy · crashed · exited · restarting · stopping · action · action-done · action-failed · setup · error */
|
|
2565
|
-
kind:
|
|
2566
|
-
text:
|
|
2649
|
+
kind: import_zod28.z.string().max(32),
|
|
2650
|
+
text: import_zod28.z.string().max(4e3)
|
|
2567
2651
|
});
|
|
2568
|
-
var StackStateParams =
|
|
2569
|
-
var StackStateResult =
|
|
2652
|
+
var StackStateParams = import_zod28.z.strictObject({});
|
|
2653
|
+
var StackStateResult = import_zod28.z.strictObject({
|
|
2570
2654
|
/** The stack's config file, when found. */
|
|
2571
|
-
config_path:
|
|
2655
|
+
config_path: import_zod28.z.string().max(4096).nullable(),
|
|
2572
2656
|
/** Why the stack cannot be run from here (no config, no process-compose), else null. */
|
|
2573
|
-
problem:
|
|
2574
|
-
stack_up:
|
|
2657
|
+
problem: import_zod28.z.string().max(1e3).nullable(),
|
|
2658
|
+
stack_up: import_zod28.z.boolean(),
|
|
2575
2659
|
stack_started_at_ms: epochMs.nullable(),
|
|
2576
|
-
servers:
|
|
2660
|
+
servers: import_zod28.z.array(StackServer).max(64),
|
|
2577
2661
|
/** One line about the one-shot setup steps ("Docker Desktop: running."), or null. */
|
|
2578
|
-
setup_note:
|
|
2662
|
+
setup_note: import_zod28.z.string().max(500).nullable(),
|
|
2579
2663
|
/** Start everything / Stop everything in flight. */
|
|
2580
|
-
pending:
|
|
2664
|
+
pending: import_zod28.z.strictObject({ verb: import_zod28.z.enum(["start", "stop"]), label: import_zod28.z.string().max(64), since_ms: epochMs }).nullable(),
|
|
2581
2665
|
/** The newest entries last. */
|
|
2582
|
-
events:
|
|
2666
|
+
events: import_zod28.z.array(StackEvent).max(300)
|
|
2583
2667
|
});
|
|
2584
|
-
var StackStartParams =
|
|
2585
|
-
var StackStopParams =
|
|
2586
|
-
var StackRunResult =
|
|
2587
|
-
var StackServerActionParams =
|
|
2668
|
+
var StackStartParams = import_zod28.z.strictObject({});
|
|
2669
|
+
var StackStopParams = import_zod28.z.strictObject({});
|
|
2670
|
+
var StackRunResult = import_zod28.z.strictObject({ accepted: import_zod28.z.boolean() });
|
|
2671
|
+
var StackServerActionParams = import_zod28.z.strictObject({
|
|
2588
2672
|
name: StackServerName,
|
|
2589
|
-
verb:
|
|
2673
|
+
verb: import_zod28.z.enum(["start", "stop", "restart"])
|
|
2590
2674
|
});
|
|
2591
|
-
var StackServerActionResult =
|
|
2592
|
-
var StackLogsParams =
|
|
2675
|
+
var StackServerActionResult = import_zod28.z.strictObject({ message: import_zod28.z.string().max(1e3) });
|
|
2676
|
+
var StackLogsParams = import_zod28.z.strictObject({
|
|
2593
2677
|
name: StackServerName,
|
|
2594
2678
|
/** Without `offset`: the last this-many complete lines. With it: new lines after it, at most this many. */
|
|
2595
|
-
lines:
|
|
2679
|
+
lines: import_zod28.z.int().min(1).max(2e5).default(2e3),
|
|
2596
2680
|
/** Byte offset the last read ended at: answer only what was written after it (follow). */
|
|
2597
2681
|
offset: nonNegInt.optional(),
|
|
2598
2682
|
/** A "Clear" point: the lines written after this byte offset (no `offset`). */
|
|
2599
2683
|
since: nonNegInt.optional(),
|
|
2600
2684
|
/** With `offset`: wait up to this long for a new line when none is waiting (0 answers at once). */
|
|
2601
|
-
wait_ms:
|
|
2685
|
+
wait_ms: import_zod28.z.int().min(0).max(25e3).default(0)
|
|
2602
2686
|
});
|
|
2603
|
-
var StackLogsResult =
|
|
2687
|
+
var StackLogsResult = import_zod28.z.strictObject({
|
|
2604
2688
|
/** Complete lines, colour codes removed. */
|
|
2605
|
-
lines:
|
|
2689
|
+
lines: import_zod28.z.array(import_zod28.z.string().max(65536)).max(2e5),
|
|
2606
2690
|
/** Where these lines end: pass it back as `offset` to follow. */
|
|
2607
2691
|
offset: nonNegInt,
|
|
2608
2692
|
/** False when `since` no longer exists (the log rotated): the lines are the plain tail instead. */
|
|
2609
|
-
since_valid:
|
|
2693
|
+
since_valid: import_zod28.z.boolean(),
|
|
2610
2694
|
/** The log was rotated or truncated since `offset`: these lines start the file again. */
|
|
2611
|
-
reset:
|
|
2612
|
-
log_file:
|
|
2695
|
+
reset: import_zod28.z.boolean(),
|
|
2696
|
+
log_file: import_zod28.z.string().max(4096)
|
|
2613
2697
|
});
|
|
2614
|
-
var StackErrorsParams =
|
|
2615
|
-
window_minutes:
|
|
2698
|
+
var StackErrorsParams = import_zod28.z.strictObject({
|
|
2699
|
+
window_minutes: import_zod28.z.int().min(1).max(1440).default(60)
|
|
2616
2700
|
});
|
|
2617
|
-
var StackErrorsResult =
|
|
2701
|
+
var StackErrorsResult = import_zod28.z.strictObject({
|
|
2618
2702
|
/** Per server: a heading line ("=== aidream — errors in the last 60 minutes (<file>) ===") and each error with the 10 lines after it. */
|
|
2619
|
-
sections:
|
|
2620
|
-
window_minutes:
|
|
2703
|
+
sections: import_zod28.z.array(import_zod28.z.strictObject({ name: StackServerName, heading: import_zod28.z.string().max(4096), lines: import_zod28.z.array(import_zod28.z.string().max(65536)).max(5e3) })).max(64),
|
|
2704
|
+
window_minutes: import_zod28.z.int().min(1).max(1440)
|
|
2621
2705
|
});
|
|
2622
2706
|
|
|
2623
2707
|
// src/schema/audio.ts
|
|
2624
|
-
var
|
|
2625
|
-
var AudioDevice =
|
|
2708
|
+
var import_zod29 = require("zod");
|
|
2709
|
+
var AudioDevice = import_zod29.z.strictObject({
|
|
2626
2710
|
/** The OS's name for it, as audio.record takes it. */
|
|
2627
|
-
id:
|
|
2628
|
-
name:
|
|
2629
|
-
default:
|
|
2711
|
+
id: import_zod29.z.string().min(1).max(256),
|
|
2712
|
+
name: import_zod29.z.string().max(256),
|
|
2713
|
+
default: import_zod29.z.boolean()
|
|
2630
2714
|
});
|
|
2631
|
-
var AudioDevicesParams =
|
|
2632
|
-
var AudioDevicesResult =
|
|
2633
|
-
inputs:
|
|
2634
|
-
outputs:
|
|
2715
|
+
var AudioDevicesParams = import_zod29.z.strictObject({});
|
|
2716
|
+
var AudioDevicesResult = import_zod29.z.strictObject({
|
|
2717
|
+
inputs: import_zod29.z.array(AudioDevice).max(64),
|
|
2718
|
+
outputs: import_zod29.z.array(AudioDevice).max(64)
|
|
2635
2719
|
});
|
|
2636
|
-
var AudioRecordParams =
|
|
2637
|
-
seconds:
|
|
2720
|
+
var AudioRecordParams = import_zod29.z.strictObject({
|
|
2721
|
+
seconds: import_zod29.z.number().min(0.5).max(600),
|
|
2638
2722
|
/** The microphone (from audio.devices); the default input when absent. */
|
|
2639
|
-
device_id:
|
|
2723
|
+
device_id: import_zod29.z.string().min(1).max(256).optional(),
|
|
2640
2724
|
/** Where the WAV file goes; a new file in the temp folder when absent. */
|
|
2641
2725
|
path: AbsPath.optional()
|
|
2642
2726
|
});
|
|
2643
|
-
var AudioRecordResult =
|
|
2727
|
+
var AudioRecordResult = import_zod29.z.strictObject({
|
|
2644
2728
|
path: AbsPath,
|
|
2645
|
-
seconds:
|
|
2729
|
+
seconds: import_zod29.z.number().min(0),
|
|
2646
2730
|
bytes: nonNegInt,
|
|
2647
2731
|
/** Loudest sample, 0–1: 0 means the device gave silence. */
|
|
2648
|
-
peak:
|
|
2732
|
+
peak: import_zod29.z.number().min(0).max(1)
|
|
2649
2733
|
});
|
|
2650
|
-
var AudioPlayParams =
|
|
2651
|
-
var AudioPlayResult =
|
|
2734
|
+
var AudioPlayParams = import_zod29.z.strictObject({ path: AbsPath });
|
|
2735
|
+
var AudioPlayResult = import_zod29.z.strictObject({ path: AbsPath, seconds: import_zod29.z.number().min(0) });
|
|
2652
2736
|
|
|
2653
2737
|
// src/schema/fs-watch.ts
|
|
2654
|
-
var
|
|
2655
|
-
var FsWatchId =
|
|
2656
|
-
var FsWatchStartParams =
|
|
2738
|
+
var import_zod30 = require("zod");
|
|
2739
|
+
var FsWatchId = import_zod30.z.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
|
|
2740
|
+
var FsWatchStartParams = import_zod30.z.strictObject({
|
|
2657
2741
|
path: AbsPath,
|
|
2658
|
-
recursive:
|
|
2742
|
+
recursive: import_zod30.z.boolean().default(true),
|
|
2659
2743
|
/** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
|
|
2660
|
-
ignore:
|
|
2744
|
+
ignore: import_zod30.z.array(import_zod30.z.string().max(256)).max(64).default([])
|
|
2661
2745
|
});
|
|
2662
|
-
var FsWatchStartResult =
|
|
2746
|
+
var FsWatchStartResult = import_zod30.z.strictObject({
|
|
2663
2747
|
watch_id: FsWatchId,
|
|
2664
2748
|
path: AbsPath,
|
|
2665
2749
|
/** The watch ends by itself if nobody reads it for 30 minutes. */
|
|
2666
2750
|
expires_at_ms: epochMs
|
|
2667
2751
|
});
|
|
2668
|
-
var FsWatchEventsParams =
|
|
2752
|
+
var FsWatchEventsParams = import_zod30.z.strictObject({
|
|
2669
2753
|
watch_id: FsWatchId,
|
|
2670
2754
|
/** Wait up to this long for a first change when none is waiting (0 answers at once). */
|
|
2671
|
-
wait_ms:
|
|
2755
|
+
wait_ms: import_zod30.z.int().min(0).max(25e3).default(0)
|
|
2672
2756
|
});
|
|
2673
|
-
var FsWatchEventsResult =
|
|
2757
|
+
var FsWatchEventsResult = import_zod30.z.strictObject({
|
|
2674
2758
|
/** What changed since the last read, oldest first; re-checked against the disk when read. */
|
|
2675
|
-
changes:
|
|
2759
|
+
changes: import_zod30.z.array(FsChange).max(1e3),
|
|
2676
2760
|
/** Changes were dropped (more than 1000 waited): list the folder again. */
|
|
2677
|
-
overflow:
|
|
2761
|
+
overflow: import_zod30.z.boolean(),
|
|
2678
2762
|
expires_at_ms: epochMs
|
|
2679
2763
|
});
|
|
2680
|
-
var FsWatchStopParams =
|
|
2681
|
-
var FsWatchStopResult =
|
|
2764
|
+
var FsWatchStopParams = import_zod30.z.strictObject({ watch_id: FsWatchId });
|
|
2765
|
+
var FsWatchStopResult = import_zod30.z.strictObject({ watch_id: FsWatchId });
|
|
2682
2766
|
|
|
2683
2767
|
// src/schema/exec-job.ts
|
|
2684
|
-
var
|
|
2685
|
-
var ExecJobId =
|
|
2686
|
-
var ExecJobStartParams =
|
|
2687
|
-
command:
|
|
2768
|
+
var import_zod31 = require("zod");
|
|
2769
|
+
var ExecJobId = import_zod31.z.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
|
|
2770
|
+
var ExecJobStartParams = import_zod31.z.strictObject({
|
|
2771
|
+
command: import_zod31.z.string().min(1).max(131072),
|
|
2688
2772
|
/** The folder it runs in; the home folder when absent. */
|
|
2689
2773
|
cwd: AbsPath.optional(),
|
|
2690
|
-
env:
|
|
2774
|
+
env: import_zod31.z.record(import_zod31.z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), import_zod31.z.string().max(32768)).optional()
|
|
2691
2775
|
});
|
|
2692
|
-
var ExecJobStartResult =
|
|
2693
|
-
var ExecJobOutputParams =
|
|
2776
|
+
var ExecJobStartResult = import_zod31.z.strictObject({ job_id: ExecJobId, pid: import_zod31.z.int().min(1), cwd: AbsPath });
|
|
2777
|
+
var ExecJobOutputParams = import_zod31.z.strictObject({
|
|
2694
2778
|
job_id: ExecJobId,
|
|
2695
2779
|
/** Byte offset into the job's output to read from (next_offset of the last read; 0 = the start). */
|
|
2696
2780
|
offset: nonNegInt.default(0),
|
|
2697
2781
|
/** Wait up to this long for new output or the exit when none is waiting (0 answers at once). */
|
|
2698
|
-
wait_ms:
|
|
2699
|
-
max_bytes:
|
|
2782
|
+
wait_ms: import_zod31.z.int().min(0).max(25e3).default(0),
|
|
2783
|
+
max_bytes: import_zod31.z.int().min(1024).max(1048576).default(65536)
|
|
2700
2784
|
});
|
|
2701
|
-
var ExecJobOutputResult =
|
|
2785
|
+
var ExecJobOutputResult = import_zod31.z.strictObject({
|
|
2702
2786
|
/** stdout and stderr interleaved as they arrived (UTF-8). */
|
|
2703
|
-
output:
|
|
2787
|
+
output: import_zod31.z.string(),
|
|
2704
2788
|
next_offset: nonNegInt,
|
|
2705
2789
|
/** Bytes before `offset` that are gone (the job keeps its last 4 MiB). */
|
|
2706
2790
|
dropped_bytes: nonNegInt,
|
|
2707
|
-
running:
|
|
2708
|
-
exit_code:
|
|
2791
|
+
running: import_zod31.z.boolean(),
|
|
2792
|
+
exit_code: import_zod31.z.int().nullable()
|
|
2709
2793
|
});
|
|
2710
|
-
var ExecJobStopParams =
|
|
2794
|
+
var ExecJobStopParams = import_zod31.z.strictObject({
|
|
2711
2795
|
job_id: ExecJobId,
|
|
2712
2796
|
/** End it at once (SIGKILL; on Windows the whole tree with /F) instead of asking it to quit. */
|
|
2713
|
-
force:
|
|
2797
|
+
force: import_zod31.z.boolean().default(false)
|
|
2714
2798
|
});
|
|
2715
|
-
var ExecJobStopResult =
|
|
2716
|
-
var ExecJobInfo =
|
|
2799
|
+
var ExecJobStopResult = import_zod31.z.strictObject({ job_id: ExecJobId, exited: import_zod31.z.boolean(), exit_code: import_zod31.z.int().nullable() });
|
|
2800
|
+
var ExecJobInfo = import_zod31.z.strictObject({
|
|
2717
2801
|
job_id: ExecJobId,
|
|
2718
|
-
command:
|
|
2719
|
-
pid:
|
|
2802
|
+
command: import_zod31.z.string().max(1024),
|
|
2803
|
+
pid: import_zod31.z.int().min(1),
|
|
2720
2804
|
cwd: AbsPath,
|
|
2721
|
-
running:
|
|
2722
|
-
exit_code:
|
|
2805
|
+
running: import_zod31.z.boolean(),
|
|
2806
|
+
exit_code: import_zod31.z.int().nullable(),
|
|
2723
2807
|
started_at_ms: epochMs,
|
|
2724
2808
|
output_bytes: nonNegInt
|
|
2725
2809
|
});
|
|
2726
|
-
var ExecJobListParams =
|
|
2727
|
-
var ExecJobListResult =
|
|
2810
|
+
var ExecJobListParams = import_zod31.z.strictObject({});
|
|
2811
|
+
var ExecJobListResult = import_zod31.z.strictObject({ jobs: import_zod31.z.array(ExecJobInfo).max(64) });
|
|
2728
2812
|
|
|
2729
2813
|
// src/schema/coding.ts
|
|
2730
|
-
var
|
|
2731
|
-
var
|
|
2732
|
-
var CodingServiceCredentials =
|
|
2733
|
-
access_token:
|
|
2734
|
-
user_id:
|
|
2814
|
+
var import_zod32 = require("zod");
|
|
2815
|
+
var import_uuid4 = require("@ai-matrx/kit/uuid");
|
|
2816
|
+
var CodingServiceCredentials = import_zod32.z.strictObject({
|
|
2817
|
+
access_token: import_zod32.z.string().min(16).max(16384),
|
|
2818
|
+
user_id: import_zod32.z.string().regex(import_uuid4.UUID_SHAPE_PATTERN),
|
|
2735
2819
|
/** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
|
|
2736
|
-
server_url:
|
|
2820
|
+
server_url: import_zod32.z.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
|
|
2737
2821
|
});
|
|
2738
|
-
var CodingHistoryBlocked =
|
|
2822
|
+
var CodingHistoryBlocked = import_zod32.z.enum([
|
|
2739
2823
|
"signed_out",
|
|
2740
2824
|
"offline",
|
|
2741
2825
|
"organization_required",
|
|
@@ -2743,11 +2827,11 @@ var CodingHistoryBlocked = import_zod31.z.enum([
|
|
|
2743
2827
|
"cloud_list_unavailable",
|
|
2744
2828
|
"history_too_large"
|
|
2745
2829
|
]);
|
|
2746
|
-
var CodingHistoryFailure =
|
|
2747
|
-
session_id:
|
|
2748
|
-
reason:
|
|
2830
|
+
var CodingHistoryFailure = import_zod32.z.strictObject({
|
|
2831
|
+
session_id: import_zod32.z.string().max(64),
|
|
2832
|
+
reason: import_zod32.z.string().max(300)
|
|
2749
2833
|
});
|
|
2750
|
-
var CodingHistoryRun =
|
|
2834
|
+
var CodingHistoryRun = import_zod32.z.strictObject({
|
|
2751
2835
|
/** Claude Code sessions found on this computer. */
|
|
2752
2836
|
local_sessions: nonNegInt,
|
|
2753
2837
|
/** Of those, already complete in AI Matrx. */
|
|
@@ -2762,39 +2846,39 @@ var CodingHistoryRun = import_zod31.z.strictObject({
|
|
|
2762
2846
|
/** Changed while being read; a later run takes them. */
|
|
2763
2847
|
changed: nonNegInt,
|
|
2764
2848
|
failed: nonNegInt,
|
|
2765
|
-
failures:
|
|
2849
|
+
failures: import_zod32.z.array(CodingHistoryFailure).max(20),
|
|
2766
2850
|
/** Candidates not reached yet. */
|
|
2767
2851
|
remaining: nonNegInt,
|
|
2768
2852
|
/** The one line a person reads, e.g. "Imported 12 of 14 sessions. 140 already in AI Matrx." */
|
|
2769
|
-
summary:
|
|
2853
|
+
summary: import_zod32.z.string().max(400)
|
|
2770
2854
|
});
|
|
2771
|
-
var CodingHistoryStep =
|
|
2855
|
+
var CodingHistoryStep = import_zod32.z.strictObject({
|
|
2772
2856
|
/** Null when the run could not start (blocked before a plan existed). */
|
|
2773
|
-
plan_id:
|
|
2774
|
-
finished:
|
|
2857
|
+
plan_id: import_zod32.z.string().regex(/^[0-9a-f]{32}$/).nullable(),
|
|
2858
|
+
finished: import_zod32.z.boolean(),
|
|
2775
2859
|
blocked: CodingHistoryBlocked.nullable(),
|
|
2776
2860
|
run: CodingHistoryRun
|
|
2777
2861
|
});
|
|
2778
|
-
var CodingPlanMissingParams =
|
|
2779
|
-
var CodingImportNextParams =
|
|
2780
|
-
plan_id:
|
|
2862
|
+
var CodingPlanMissingParams = import_zod32.z.strictObject({ credentials: CodingServiceCredentials.nullable() });
|
|
2863
|
+
var CodingImportNextParams = import_zod32.z.strictObject({
|
|
2864
|
+
plan_id: import_zod32.z.string().regex(/^[0-9a-f]{32}$/),
|
|
2781
2865
|
credentials: CodingServiceCredentials.nullable()
|
|
2782
2866
|
});
|
|
2783
|
-
var CodingServiceProgress =
|
|
2784
|
-
phase:
|
|
2867
|
+
var CodingServiceProgress = import_zod32.z.strictObject({
|
|
2868
|
+
phase: import_zod32.z.enum(["checking", "importing"]),
|
|
2785
2869
|
done: nonNegInt,
|
|
2786
2870
|
total: nonNegInt
|
|
2787
2871
|
});
|
|
2788
|
-
var CodingHistoryImportMissingParams =
|
|
2789
|
-
var CodingHistoryImportMissingResult =
|
|
2790
|
-
state:
|
|
2872
|
+
var CodingHistoryImportMissingParams = import_zod32.z.strictObject({});
|
|
2873
|
+
var CodingHistoryImportMissingResult = import_zod32.z.strictObject({
|
|
2874
|
+
state: import_zod32.z.enum(["done", "blocked", "cancelled"]),
|
|
2791
2875
|
blocked: CodingHistoryBlocked.nullable(),
|
|
2792
2876
|
run: CodingHistoryRun,
|
|
2793
2877
|
elapsed_ms: nonNegInt
|
|
2794
2878
|
});
|
|
2795
|
-
var CodingHistoryProgressEvent =
|
|
2879
|
+
var CodingHistoryProgressEvent = import_zod32.z.strictObject({
|
|
2796
2880
|
request_id: RequestId,
|
|
2797
|
-
phase:
|
|
2881
|
+
phase: import_zod32.z.enum(["checking", "importing"]),
|
|
2798
2882
|
/** Sessions settled so far, of `total` candidates (0 of 0 while checking). */
|
|
2799
2883
|
done: nonNegInt,
|
|
2800
2884
|
total: nonNegInt,
|
|
@@ -2932,7 +3016,11 @@ var OPS = {
|
|
|
2932
3016
|
"web.fetch": { params: WebFetchParams, result: WebFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
|
|
2933
3017
|
"web.scrape": { params: WebScrapeParams, result: WebScrapeResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
|
|
2934
3018
|
"web.search": { params: WebSearchParams, result: WebSearchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
|
|
2935
|
-
"web.fetch_with_browser": { params: WebBrowserFetchParams, result: WebBrowserFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] }
|
|
3019
|
+
"web.fetch_with_browser": { params: WebBrowserFetchParams, result: WebBrowserFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
|
|
3020
|
+
// 1.23: the signed-in person's own agents and Vault, read as them (the desktop's Agents library and Vault).
|
|
3021
|
+
"account.agents.list": { params: AccountAgentsListParams, result: AccountAgentsListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
|
|
3022
|
+
"account.vault.list": { params: AccountVaultListParams, result: AccountVaultListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
|
|
3023
|
+
"account.vault.copy": { params: AccountVaultCopyParams, result: AccountVaultCopyResult, kind: "unary", since: "1.23", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "INVALID_PARAMS", "DEVICE_OFFLINE", "INTERNAL"] }
|
|
2936
3024
|
};
|
|
2937
3025
|
var EVENTS = {
|
|
2938
3026
|
"fs.changed": FsChangedEvent,
|
|
@@ -3365,7 +3453,19 @@ var NAMED_SCHEMAS = {
|
|
|
3365
3453
|
ToolsWebSearchParams,
|
|
3366
3454
|
WebBrowserFetchParams,
|
|
3367
3455
|
WebBrowserFetchResult,
|
|
3368
|
-
ToolsServiceProgress
|
|
3456
|
+
ToolsServiceProgress,
|
|
3457
|
+
AccountRowId,
|
|
3458
|
+
AccountReadState,
|
|
3459
|
+
AccountAgent,
|
|
3460
|
+
AccountAgentsListParams,
|
|
3461
|
+
AccountAgentsListResult,
|
|
3462
|
+
VaultItemKind,
|
|
3463
|
+
VaultFieldSummary,
|
|
3464
|
+
VaultItemSummary,
|
|
3465
|
+
AccountVaultListParams,
|
|
3466
|
+
AccountVaultListResult,
|
|
3467
|
+
AccountVaultCopyParams,
|
|
3468
|
+
AccountVaultCopyResult
|
|
3369
3469
|
};
|
|
3370
3470
|
|
|
3371
3471
|
// src/versioning.ts
|
|
@@ -3511,7 +3611,7 @@ function forPeer(op, part, value, version) {
|
|
|
3511
3611
|
var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
|
|
3512
3612
|
|
|
3513
3613
|
// src/contract.ts
|
|
3514
|
-
var CONTRACT_SHA256 = "
|
|
3614
|
+
var CONTRACT_SHA256 = "764fdad5d8851da877e508f4aad2853aaa8fc3b057291488523ef2dd35615208";
|
|
3515
3615
|
|
|
3516
3616
|
// src/close-policy.ts
|
|
3517
3617
|
var CLOSE_RULES = {
|