@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/dist/client.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BackoffOptions } from '@ai-matrx/realtime';
|
|
2
2
|
export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/realtime';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-
|
|
5
|
-
export { i as isDesktopProtocolError } from './models-
|
|
4
|
+
import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-BOPMXUz-.cjs';
|
|
5
|
+
export { i as isDesktopProtocolError } from './models-BOPMXUz-.cjs';
|
|
6
6
|
import { FrameHeader } from './frame.cjs';
|
|
7
7
|
|
|
8
8
|
/** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
|
package/dist/client.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BackoffOptions } from '@ai-matrx/realtime';
|
|
2
2
|
export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/realtime';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-
|
|
5
|
-
export { i as isDesktopProtocolError } from './models-
|
|
4
|
+
import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-BOPMXUz-.js';
|
|
5
|
+
export { i as isDesktopProtocolError } from './models-BOPMXUz-.js';
|
|
6
6
|
import { FrameHeader } from './frame.js';
|
|
7
7
|
|
|
8
8
|
/** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
|
package/dist/client.js
CHANGED
|
@@ -110,13 +110,14 @@ import { z as z2 } from "zod";
|
|
|
110
110
|
|
|
111
111
|
// src/schema/primitives.ts
|
|
112
112
|
import { z } from "zod";
|
|
113
|
+
import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
|
|
113
114
|
var PROTOCOL_MAJOR = 1;
|
|
114
|
-
var PROTOCOL_MINOR =
|
|
115
|
+
var PROTOCOL_MINOR = 17;
|
|
115
116
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
116
117
|
var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
117
118
|
var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
118
119
|
var ResourceId = z.string().regex(/^(pty|watch)_[A-Za-z0-9]{16,40}$/);
|
|
119
|
-
var DeviceId = z.string().regex(
|
|
120
|
+
var DeviceId = z.string().regex(UUID_SHAPE_PATTERN);
|
|
120
121
|
var AbsPath = z.string().min(1).max(4096).regex(/^(\/|[A-Za-z]:\/)[^\\\u0000]*$/);
|
|
121
122
|
var u32 = z.int().min(0).max(4294967295);
|
|
122
123
|
var nonNegInt = z.int().min(0);
|
|
@@ -1137,6 +1138,8 @@ import { z as z19 } from "zod";
|
|
|
1137
1138
|
var ResourcesDisk = z19.strictObject({
|
|
1138
1139
|
/** Where it is mounted ("/", "C:"). */
|
|
1139
1140
|
mount: z19.string().max(512),
|
|
1141
|
+
/** The volume's name as the file manager shows it ("Macintosh HD", "Local Disk (C:)"). Since 1.17. */
|
|
1142
|
+
name: z19.string().max(256).optional(),
|
|
1140
1143
|
/** The file system ("apfs", "NTFS", "ext4"). */
|
|
1141
1144
|
fs: z19.string().max(64),
|
|
1142
1145
|
size_bytes: nonNegInt,
|
|
@@ -1157,6 +1160,117 @@ var ResourcesSnapshotResult = z19.strictObject({
|
|
|
1157
1160
|
disks: z19.array(ResourcesDisk).max(64),
|
|
1158
1161
|
uptime_seconds: nonNegInt
|
|
1159
1162
|
});
|
|
1163
|
+
var ResourcesJobKind = z19.enum(["type-check", "tests", "build", "lint", "dev server", "language server", "search"]);
|
|
1164
|
+
var ResourcesStrain = z19.enum(["good", "strain", "overloaded"]);
|
|
1165
|
+
var ResourcesPressure = z19.enum(["normal", "warning", "critical"]);
|
|
1166
|
+
var ResourcesJob = z19.strictObject({
|
|
1167
|
+
/** The job's root process (Stop takes its whole tree). */
|
|
1168
|
+
pid: z19.int().min(0),
|
|
1169
|
+
kind: ResourcesJobKind,
|
|
1170
|
+
/** Its heaviest process's command line, shortened ("…/lib/tsc --noEmit -p tsconfig.json"). */
|
|
1171
|
+
command: z19.string().max(256),
|
|
1172
|
+
/** Who started it: "Claude Code", "Codex", "Cursor", "VS Code", "Terminal", "local stack", "detached"; null when unknown. */
|
|
1173
|
+
started_by: z19.string().max(64).nullable(),
|
|
1174
|
+
/** Whatever started it is gone and nothing waits for it. */
|
|
1175
|
+
orphan: z19.boolean(),
|
|
1176
|
+
/** A type-check queued for its turn (no compiler running yet). */
|
|
1177
|
+
waiting: z19.boolean(),
|
|
1178
|
+
/** The project folder it runs in ("matrx-frontend"); null when not in one. */
|
|
1179
|
+
folder: z19.string().max(256).nullable(),
|
|
1180
|
+
/** The same command in the same folder, running this many times (1 = no duplicate). */
|
|
1181
|
+
duplicates: z19.int().min(1),
|
|
1182
|
+
processes: z19.int().min(1),
|
|
1183
|
+
/** Sum over the tree, as `ps` reports it: 100 = one full core. */
|
|
1184
|
+
cpu_percent: z19.number().min(0),
|
|
1185
|
+
/** Real memory (macOS: the physical footprint Activity Monitor shows, compressed included). */
|
|
1186
|
+
memory_bytes: nonNegInt,
|
|
1187
|
+
started_at_ms: epochMs.nullable(),
|
|
1188
|
+
/** False for an app, an agent session, a terminal, a system process, the local stack or Matrx 2 itself. */
|
|
1189
|
+
stoppable: z19.boolean()
|
|
1190
|
+
});
|
|
1191
|
+
var ResourcesProcess = z19.strictObject({
|
|
1192
|
+
pid: z19.int().min(0),
|
|
1193
|
+
/** The command line, shortened. */
|
|
1194
|
+
name: z19.string().max(256),
|
|
1195
|
+
cpu_percent: z19.number().min(0),
|
|
1196
|
+
memory_bytes: nonNegInt,
|
|
1197
|
+
started_by: z19.string().max(64).nullable(),
|
|
1198
|
+
/** The job it belongs to ("type-check in aidream"); null when none. */
|
|
1199
|
+
job: z19.string().max(256).nullable(),
|
|
1200
|
+
started_at_ms: epochMs.nullable()
|
|
1201
|
+
});
|
|
1202
|
+
var ResourcesVerdict = z19.strictObject({
|
|
1203
|
+
level: ResourcesStrain,
|
|
1204
|
+
/** One sentence ("Your Mac is under strain. 3 type-checks are running at once."). */
|
|
1205
|
+
text: z19.string().max(256),
|
|
1206
|
+
/** The biggest jobs behind it; null when all is well. */
|
|
1207
|
+
cause: z19.string().max(1024).nullable()
|
|
1208
|
+
});
|
|
1209
|
+
var ResourcesSample = z19.strictObject({
|
|
1210
|
+
at_ms: epochMs,
|
|
1211
|
+
/** The 1-minute load average. */
|
|
1212
|
+
load: z19.number().min(0),
|
|
1213
|
+
memory_used_bytes: nonNegInt,
|
|
1214
|
+
typechecks: nonNegInt
|
|
1215
|
+
});
|
|
1216
|
+
var ResourcesActivityParams = z19.strictObject({});
|
|
1217
|
+
var ResourcesActivityResult = z19.strictObject({
|
|
1218
|
+
/** False until the first reading (a second or two after start). */
|
|
1219
|
+
ready: z19.boolean(),
|
|
1220
|
+
sampled_at_ms: epochMs.nullable(),
|
|
1221
|
+
cores: z19.int().min(1),
|
|
1222
|
+
/** 1, 5 and 15 minute load averages. */
|
|
1223
|
+
load: z19.array(z19.number().min(0)).length(3),
|
|
1224
|
+
memory: z19.strictObject({
|
|
1225
|
+
total_bytes: nonNegInt,
|
|
1226
|
+
/** Activity Monitor's Memory Used: app memory + wired + compressed. */
|
|
1227
|
+
used_bytes: nonNegInt,
|
|
1228
|
+
/** Data held compressed, and the memory the compressor takes to hold it. */
|
|
1229
|
+
compressed_bytes: nonNegInt,
|
|
1230
|
+
compressor_bytes: nonNegInt,
|
|
1231
|
+
swap_used_bytes: nonNegInt,
|
|
1232
|
+
pressure: ResourcesPressure.nullable()
|
|
1233
|
+
}),
|
|
1234
|
+
verdict: ResourcesVerdict,
|
|
1235
|
+
typechecks: z19.strictObject({ running: nonNegInt, waiting: nonNegInt, comfort: nonNegInt }),
|
|
1236
|
+
/** Heaviest first (1 GB weighs as much as 16 % of a core). */
|
|
1237
|
+
jobs: z19.array(ResourcesJob).max(200),
|
|
1238
|
+
/** The 15 heaviest by memory and the 15 busiest by CPU, together. */
|
|
1239
|
+
top: z19.array(ResourcesProcess).max(30),
|
|
1240
|
+
/** The last hour, oldest first. */
|
|
1241
|
+
history: z19.array(ResourcesSample).max(1200)
|
|
1242
|
+
});
|
|
1243
|
+
var ResourcesStopJobParams = z19.strictObject({ pid: z19.int().min(1) });
|
|
1244
|
+
var ResourcesStopJobResult = z19.strictObject({
|
|
1245
|
+
/** Processes signalled; whatever is still running 5 seconds later is force-stopped. */
|
|
1246
|
+
processes: nonNegInt,
|
|
1247
|
+
/** It had finished before the request arrived. */
|
|
1248
|
+
already_finished: z19.boolean()
|
|
1249
|
+
});
|
|
1250
|
+
var ResourcesIncident = z19.strictObject({
|
|
1251
|
+
at_ms: epochMs,
|
|
1252
|
+
verdict: ResourcesVerdict,
|
|
1253
|
+
load: z19.number().min(0),
|
|
1254
|
+
memory_used_bytes: nonNegInt,
|
|
1255
|
+
compressed_bytes: nonNegInt,
|
|
1256
|
+
pressure: ResourcesPressure.nullable(),
|
|
1257
|
+
jobs: z19.array(
|
|
1258
|
+
z19.strictObject({
|
|
1259
|
+
kind: ResourcesJobKind,
|
|
1260
|
+
started_by: z19.string().max(64).nullable(),
|
|
1261
|
+
folder: z19.string().max(256).nullable(),
|
|
1262
|
+
command: z19.string().max(256),
|
|
1263
|
+
cpu_percent: z19.number().min(0),
|
|
1264
|
+
memory_bytes: nonNegInt,
|
|
1265
|
+
duplicates: z19.int().min(1)
|
|
1266
|
+
})
|
|
1267
|
+
).max(8)
|
|
1268
|
+
});
|
|
1269
|
+
var ResourcesIncidentsParams = z19.strictObject({ limit: z19.int().min(1).max(200).default(50) });
|
|
1270
|
+
var ResourcesIncidentsResult = z19.strictObject({
|
|
1271
|
+
/** Newest first; at most one a minute is written. */
|
|
1272
|
+
incidents: z19.array(ResourcesIncident).max(200)
|
|
1273
|
+
});
|
|
1160
1274
|
|
|
1161
1275
|
// src/schema/stack.ts
|
|
1162
1276
|
import { z as z20 } from "zod";
|
|
@@ -1322,9 +1436,10 @@ var ExecJobListResult = z22.strictObject({ jobs: z22.array(ExecJobInfo).max(64)
|
|
|
1322
1436
|
|
|
1323
1437
|
// src/schema/coding.ts
|
|
1324
1438
|
import { z as z23 } from "zod";
|
|
1439
|
+
import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN2 } from "@ai-matrx/kit/uuid";
|
|
1325
1440
|
var CodingServiceCredentials = z23.strictObject({
|
|
1326
1441
|
access_token: z23.string().min(16).max(16384),
|
|
1327
|
-
user_id: z23.string().regex(
|
|
1442
|
+
user_id: z23.string().regex(UUID_SHAPE_PATTERN2),
|
|
1328
1443
|
/** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
|
|
1329
1444
|
server_url: z23.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
|
|
1330
1445
|
});
|
|
@@ -1397,8 +1512,9 @@ var CodingHistoryProgressEvent = z23.strictObject({
|
|
|
1397
1512
|
|
|
1398
1513
|
// src/schema/apps.ts
|
|
1399
1514
|
import { z as z24 } from "zod";
|
|
1515
|
+
import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN3 } from "@ai-matrx/kit/uuid";
|
|
1400
1516
|
var AppKey = z24.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
|
|
1401
|
-
var AppProfileId = z24.string().regex(
|
|
1517
|
+
var AppProfileId = z24.string().regex(UUID_SHAPE_PATTERN3);
|
|
1402
1518
|
var AppProfileLocator = z24.string().min(1).max(512).regex(/^[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}(\/[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}){0,7}$/);
|
|
1403
1519
|
var AppSupport = z24.enum(["supported", "partial", "unsupported"]);
|
|
1404
1520
|
var AppFeatureStatus = z24.strictObject({
|
|
@@ -1946,6 +2062,9 @@ var OPS = {
|
|
|
1946
2062
|
"power.status": { params: PowerStatusParams, result: PowerStatusResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
|
|
1947
2063
|
"power.prevent_sleep": { params: PowerPreventSleepParams, result: PowerPreventSleepResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
1948
2064
|
"resources.snapshot": { params: ResourcesSnapshotParams, result: ResourcesSnapshotResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
|
|
2065
|
+
"resources.activity": { params: ResourcesActivityParams, result: ResourcesActivityResult, kind: "unary", since: "1.17", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2066
|
+
"resources.stop_job": { params: ResourcesStopJobParams, result: ResourcesStopJobResult, kind: "unary", since: "1.17", errors: ["NOT_FOUND", "CONFLICT", "AUTH_FORBIDDEN", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2067
|
+
"resources.incidents": { params: ResourcesIncidentsParams, result: ResourcesIncidentsResult, kind: "unary", since: "1.17", errors: ["INTERNAL"] },
|
|
1949
2068
|
"audio.devices": { params: AudioDevicesParams, result: AudioDevicesResult, kind: "unary", since: "1.6", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
1950
2069
|
"audio.record": { params: AudioRecordParams, result: AudioRecordResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "RESOURCE_BUSY", "INTERNAL"] },
|
|
1951
2070
|
"audio.play": { params: AudioPlayParams, result: AudioPlayResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|