@ai-matrx/desktop-protocol 0.17.12 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/client.cjs +123 -4
- 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 +123 -4
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +157 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +259 -8
- package/dist/index.d.ts +259 -8
- package/dist/index.js +157 -8
- package/dist/index.js.map +1 -1
- package/dist/{models-A0PWllJz.d.cts → models-BOPMXUz-.d.cts} +362 -1
- package/dist/{models-A0PWllJz.d.ts → models-BOPMXUz-.d.ts} +362 -1
- package/dist/react.d.cts +136 -0
- package/dist/react.d.ts +136 -0
- package/generated/desktop-protocol.schema.json +610 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.18.0
|
|
4
|
+
|
|
5
|
+
The three UUID-shaped ids (`DeviceId`, the desktop app profile id, a coding session's `user_id`) take their pattern from `@ai-matrx/kit/uuid`'s `UUID_SHAPE_PATTERN` instead of spelling the regex. The generated JSON Schema and Pydantic models are byte-identical (`generate --check` contract hash unchanged). New dependency: `@ai-matrx/kit`.
|
|
6
|
+
|
|
7
|
+
**Consumer action:** none.
|
|
8
|
+
|
|
9
|
+
## 0.17.13
|
|
10
|
+
### Unreleased
|
|
11
|
+
### (protocol 1.17)
|
|
12
|
+
|
|
13
|
+
- **What is using the computer.** `resources.activity`: processes grouped into jobs (type-check, tests, build, lint, dev server, language server, search) with who started each, its project folder, duplicates, orphans and queued type-checks; the heaviest processes; the strain verdict; memory as Activity Monitor counts it (used, compressed, pressure); the last hour. `resources.stop_job` stops a listed job's whole tree (protected trees refused). `resources.incidents`: the slowdown log, newest first. `ResourcesDisk.name` (optional): the volume's name as the file manager shows it, stripped for peers below 1.17 (guard: versioning.test.ts "disk name 1.17").
|
|
14
|
+
|
|
15
|
+
Consumer action: none for older peers.
|
|
16
|
+
|
|
3
17
|
## 0.17.12
|
|
4
18
|
### (protocol 1.16)
|
|
5
19
|
|
package/dist/client.cjs
CHANGED
|
@@ -142,13 +142,14 @@ var import_zod2 = require("zod");
|
|
|
142
142
|
|
|
143
143
|
// src/schema/primitives.ts
|
|
144
144
|
var import_zod = require("zod");
|
|
145
|
+
var import_uuid = require("@ai-matrx/kit/uuid");
|
|
145
146
|
var PROTOCOL_MAJOR = 1;
|
|
146
|
-
var PROTOCOL_MINOR =
|
|
147
|
+
var PROTOCOL_MINOR = 17;
|
|
147
148
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
148
149
|
var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
149
150
|
var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
150
151
|
var ResourceId = import_zod.z.string().regex(/^(pty|watch)_[A-Za-z0-9]{16,40}$/);
|
|
151
|
-
var DeviceId = import_zod.z.string().regex(
|
|
152
|
+
var DeviceId = import_zod.z.string().regex(import_uuid.UUID_SHAPE_PATTERN);
|
|
152
153
|
var AbsPath = import_zod.z.string().min(1).max(4096).regex(/^(\/|[A-Za-z]:\/)[^\\\u0000]*$/);
|
|
153
154
|
var u32 = import_zod.z.int().min(0).max(4294967295);
|
|
154
155
|
var nonNegInt = import_zod.z.int().min(0);
|
|
@@ -1169,6 +1170,8 @@ var import_zod19 = require("zod");
|
|
|
1169
1170
|
var ResourcesDisk = import_zod19.z.strictObject({
|
|
1170
1171
|
/** Where it is mounted ("/", "C:"). */
|
|
1171
1172
|
mount: import_zod19.z.string().max(512),
|
|
1173
|
+
/** The volume's name as the file manager shows it ("Macintosh HD", "Local Disk (C:)"). Since 1.17. */
|
|
1174
|
+
name: import_zod19.z.string().max(256).optional(),
|
|
1172
1175
|
/** The file system ("apfs", "NTFS", "ext4"). */
|
|
1173
1176
|
fs: import_zod19.z.string().max(64),
|
|
1174
1177
|
size_bytes: nonNegInt,
|
|
@@ -1189,6 +1192,117 @@ var ResourcesSnapshotResult = import_zod19.z.strictObject({
|
|
|
1189
1192
|
disks: import_zod19.z.array(ResourcesDisk).max(64),
|
|
1190
1193
|
uptime_seconds: nonNegInt
|
|
1191
1194
|
});
|
|
1195
|
+
var ResourcesJobKind = import_zod19.z.enum(["type-check", "tests", "build", "lint", "dev server", "language server", "search"]);
|
|
1196
|
+
var ResourcesStrain = import_zod19.z.enum(["good", "strain", "overloaded"]);
|
|
1197
|
+
var ResourcesPressure = import_zod19.z.enum(["normal", "warning", "critical"]);
|
|
1198
|
+
var ResourcesJob = import_zod19.z.strictObject({
|
|
1199
|
+
/** The job's root process (Stop takes its whole tree). */
|
|
1200
|
+
pid: import_zod19.z.int().min(0),
|
|
1201
|
+
kind: ResourcesJobKind,
|
|
1202
|
+
/** Its heaviest process's command line, shortened ("…/lib/tsc --noEmit -p tsconfig.json"). */
|
|
1203
|
+
command: import_zod19.z.string().max(256),
|
|
1204
|
+
/** Who started it: "Claude Code", "Codex", "Cursor", "VS Code", "Terminal", "local stack", "detached"; null when unknown. */
|
|
1205
|
+
started_by: import_zod19.z.string().max(64).nullable(),
|
|
1206
|
+
/** Whatever started it is gone and nothing waits for it. */
|
|
1207
|
+
orphan: import_zod19.z.boolean(),
|
|
1208
|
+
/** A type-check queued for its turn (no compiler running yet). */
|
|
1209
|
+
waiting: import_zod19.z.boolean(),
|
|
1210
|
+
/** The project folder it runs in ("matrx-frontend"); null when not in one. */
|
|
1211
|
+
folder: import_zod19.z.string().max(256).nullable(),
|
|
1212
|
+
/** The same command in the same folder, running this many times (1 = no duplicate). */
|
|
1213
|
+
duplicates: import_zod19.z.int().min(1),
|
|
1214
|
+
processes: import_zod19.z.int().min(1),
|
|
1215
|
+
/** Sum over the tree, as `ps` reports it: 100 = one full core. */
|
|
1216
|
+
cpu_percent: import_zod19.z.number().min(0),
|
|
1217
|
+
/** Real memory (macOS: the physical footprint Activity Monitor shows, compressed included). */
|
|
1218
|
+
memory_bytes: nonNegInt,
|
|
1219
|
+
started_at_ms: epochMs.nullable(),
|
|
1220
|
+
/** False for an app, an agent session, a terminal, a system process, the local stack or Matrx 2 itself. */
|
|
1221
|
+
stoppable: import_zod19.z.boolean()
|
|
1222
|
+
});
|
|
1223
|
+
var ResourcesProcess = import_zod19.z.strictObject({
|
|
1224
|
+
pid: import_zod19.z.int().min(0),
|
|
1225
|
+
/** The command line, shortened. */
|
|
1226
|
+
name: import_zod19.z.string().max(256),
|
|
1227
|
+
cpu_percent: import_zod19.z.number().min(0),
|
|
1228
|
+
memory_bytes: nonNegInt,
|
|
1229
|
+
started_by: import_zod19.z.string().max(64).nullable(),
|
|
1230
|
+
/** The job it belongs to ("type-check in aidream"); null when none. */
|
|
1231
|
+
job: import_zod19.z.string().max(256).nullable(),
|
|
1232
|
+
started_at_ms: epochMs.nullable()
|
|
1233
|
+
});
|
|
1234
|
+
var ResourcesVerdict = import_zod19.z.strictObject({
|
|
1235
|
+
level: ResourcesStrain,
|
|
1236
|
+
/** One sentence ("Your Mac is under strain. 3 type-checks are running at once."). */
|
|
1237
|
+
text: import_zod19.z.string().max(256),
|
|
1238
|
+
/** The biggest jobs behind it; null when all is well. */
|
|
1239
|
+
cause: import_zod19.z.string().max(1024).nullable()
|
|
1240
|
+
});
|
|
1241
|
+
var ResourcesSample = import_zod19.z.strictObject({
|
|
1242
|
+
at_ms: epochMs,
|
|
1243
|
+
/** The 1-minute load average. */
|
|
1244
|
+
load: import_zod19.z.number().min(0),
|
|
1245
|
+
memory_used_bytes: nonNegInt,
|
|
1246
|
+
typechecks: nonNegInt
|
|
1247
|
+
});
|
|
1248
|
+
var ResourcesActivityParams = import_zod19.z.strictObject({});
|
|
1249
|
+
var ResourcesActivityResult = import_zod19.z.strictObject({
|
|
1250
|
+
/** False until the first reading (a second or two after start). */
|
|
1251
|
+
ready: import_zod19.z.boolean(),
|
|
1252
|
+
sampled_at_ms: epochMs.nullable(),
|
|
1253
|
+
cores: import_zod19.z.int().min(1),
|
|
1254
|
+
/** 1, 5 and 15 minute load averages. */
|
|
1255
|
+
load: import_zod19.z.array(import_zod19.z.number().min(0)).length(3),
|
|
1256
|
+
memory: import_zod19.z.strictObject({
|
|
1257
|
+
total_bytes: nonNegInt,
|
|
1258
|
+
/** Activity Monitor's Memory Used: app memory + wired + compressed. */
|
|
1259
|
+
used_bytes: nonNegInt,
|
|
1260
|
+
/** Data held compressed, and the memory the compressor takes to hold it. */
|
|
1261
|
+
compressed_bytes: nonNegInt,
|
|
1262
|
+
compressor_bytes: nonNegInt,
|
|
1263
|
+
swap_used_bytes: nonNegInt,
|
|
1264
|
+
pressure: ResourcesPressure.nullable()
|
|
1265
|
+
}),
|
|
1266
|
+
verdict: ResourcesVerdict,
|
|
1267
|
+
typechecks: import_zod19.z.strictObject({ running: nonNegInt, waiting: nonNegInt, comfort: nonNegInt }),
|
|
1268
|
+
/** Heaviest first (1 GB weighs as much as 16 % of a core). */
|
|
1269
|
+
jobs: import_zod19.z.array(ResourcesJob).max(200),
|
|
1270
|
+
/** The 15 heaviest by memory and the 15 busiest by CPU, together. */
|
|
1271
|
+
top: import_zod19.z.array(ResourcesProcess).max(30),
|
|
1272
|
+
/** The last hour, oldest first. */
|
|
1273
|
+
history: import_zod19.z.array(ResourcesSample).max(1200)
|
|
1274
|
+
});
|
|
1275
|
+
var ResourcesStopJobParams = import_zod19.z.strictObject({ pid: import_zod19.z.int().min(1) });
|
|
1276
|
+
var ResourcesStopJobResult = import_zod19.z.strictObject({
|
|
1277
|
+
/** Processes signalled; whatever is still running 5 seconds later is force-stopped. */
|
|
1278
|
+
processes: nonNegInt,
|
|
1279
|
+
/** It had finished before the request arrived. */
|
|
1280
|
+
already_finished: import_zod19.z.boolean()
|
|
1281
|
+
});
|
|
1282
|
+
var ResourcesIncident = import_zod19.z.strictObject({
|
|
1283
|
+
at_ms: epochMs,
|
|
1284
|
+
verdict: ResourcesVerdict,
|
|
1285
|
+
load: import_zod19.z.number().min(0),
|
|
1286
|
+
memory_used_bytes: nonNegInt,
|
|
1287
|
+
compressed_bytes: nonNegInt,
|
|
1288
|
+
pressure: ResourcesPressure.nullable(),
|
|
1289
|
+
jobs: import_zod19.z.array(
|
|
1290
|
+
import_zod19.z.strictObject({
|
|
1291
|
+
kind: ResourcesJobKind,
|
|
1292
|
+
started_by: import_zod19.z.string().max(64).nullable(),
|
|
1293
|
+
folder: import_zod19.z.string().max(256).nullable(),
|
|
1294
|
+
command: import_zod19.z.string().max(256),
|
|
1295
|
+
cpu_percent: import_zod19.z.number().min(0),
|
|
1296
|
+
memory_bytes: nonNegInt,
|
|
1297
|
+
duplicates: import_zod19.z.int().min(1)
|
|
1298
|
+
})
|
|
1299
|
+
).max(8)
|
|
1300
|
+
});
|
|
1301
|
+
var ResourcesIncidentsParams = import_zod19.z.strictObject({ limit: import_zod19.z.int().min(1).max(200).default(50) });
|
|
1302
|
+
var ResourcesIncidentsResult = import_zod19.z.strictObject({
|
|
1303
|
+
/** Newest first; at most one a minute is written. */
|
|
1304
|
+
incidents: import_zod19.z.array(ResourcesIncident).max(200)
|
|
1305
|
+
});
|
|
1192
1306
|
|
|
1193
1307
|
// src/schema/stack.ts
|
|
1194
1308
|
var import_zod20 = require("zod");
|
|
@@ -1354,9 +1468,10 @@ var ExecJobListResult = import_zod22.z.strictObject({ jobs: import_zod22.z.array
|
|
|
1354
1468
|
|
|
1355
1469
|
// src/schema/coding.ts
|
|
1356
1470
|
var import_zod23 = require("zod");
|
|
1471
|
+
var import_uuid2 = require("@ai-matrx/kit/uuid");
|
|
1357
1472
|
var CodingServiceCredentials = import_zod23.z.strictObject({
|
|
1358
1473
|
access_token: import_zod23.z.string().min(16).max(16384),
|
|
1359
|
-
user_id: import_zod23.z.string().regex(
|
|
1474
|
+
user_id: import_zod23.z.string().regex(import_uuid2.UUID_SHAPE_PATTERN),
|
|
1360
1475
|
/** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
|
|
1361
1476
|
server_url: import_zod23.z.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
|
|
1362
1477
|
});
|
|
@@ -1429,8 +1544,9 @@ var CodingHistoryProgressEvent = import_zod23.z.strictObject({
|
|
|
1429
1544
|
|
|
1430
1545
|
// src/schema/apps.ts
|
|
1431
1546
|
var import_zod24 = require("zod");
|
|
1547
|
+
var import_uuid3 = require("@ai-matrx/kit/uuid");
|
|
1432
1548
|
var AppKey = import_zod24.z.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
|
|
1433
|
-
var AppProfileId = import_zod24.z.string().regex(
|
|
1549
|
+
var AppProfileId = import_zod24.z.string().regex(import_uuid3.UUID_SHAPE_PATTERN);
|
|
1434
1550
|
var AppProfileLocator = import_zod24.z.string().min(1).max(512).regex(/^[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}(\/[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}){0,7}$/);
|
|
1435
1551
|
var AppSupport = import_zod24.z.enum(["supported", "partial", "unsupported"]);
|
|
1436
1552
|
var AppFeatureStatus = import_zod24.z.strictObject({
|
|
@@ -1978,6 +2094,9 @@ var OPS = {
|
|
|
1978
2094
|
"power.status": { params: PowerStatusParams, result: PowerStatusResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
|
|
1979
2095
|
"power.prevent_sleep": { params: PowerPreventSleepParams, result: PowerPreventSleepResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
1980
2096
|
"resources.snapshot": { params: ResourcesSnapshotParams, result: ResourcesSnapshotResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
|
|
2097
|
+
"resources.activity": { params: ResourcesActivityParams, result: ResourcesActivityResult, kind: "unary", since: "1.17", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2098
|
+
"resources.stop_job": { params: ResourcesStopJobParams, result: ResourcesStopJobResult, kind: "unary", since: "1.17", errors: ["NOT_FOUND", "CONFLICT", "AUTH_FORBIDDEN", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2099
|
+
"resources.incidents": { params: ResourcesIncidentsParams, result: ResourcesIncidentsResult, kind: "unary", since: "1.17", errors: ["INTERNAL"] },
|
|
1981
2100
|
"audio.devices": { params: AudioDevicesParams, result: AudioDevicesResult, kind: "unary", since: "1.6", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
1982
2101
|
"audio.record": { params: AudioRecordParams, result: AudioRecordResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "RESOURCE_BUSY", "INTERNAL"] },
|
|
1983
2102
|
"audio.play": { params: AudioPlayParams, result: AudioPlayResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|