@ai-matrx/desktop-protocol 0.21.35 → 0.21.37
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 +29 -1
- package/dist/client.cjs +39 -2
- 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 +39 -2
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +91 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -11
- package/dist/index.d.ts +45 -11
- package/dist/index.js +91 -13
- package/dist/index.js.map +1 -1
- package/dist/{models-Sz1BEet6.d.cts → models-B7jYxupg.d.cts} +210 -9
- package/dist/{models-Sz1BEet6.d.ts → models-B7jYxupg.d.ts} +210 -9
- package/dist/react.d.cts +50 -5
- package/dist/react.d.ts +50 -5
- package/generated/desktop-protocol.schema.json +249 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
|
|
4
4
|
var PROTOCOL_MAJOR = 1;
|
|
5
|
-
var PROTOCOL_MINOR =
|
|
5
|
+
var PROTOCOL_MINOR = 45;
|
|
6
6
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
7
7
|
var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
8
8
|
var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -449,6 +449,14 @@ var SysinfoGetResult = z5.strictObject({
|
|
|
449
449
|
})
|
|
450
450
|
).optional()
|
|
451
451
|
});
|
|
452
|
+
var SysinfoGraphicsAdapter = z5.strictObject({
|
|
453
|
+
name: z5.string().max(128),
|
|
454
|
+
vendor: z5.string().max(64).nullable(),
|
|
455
|
+
memory_bytes: nonNegInt.nullable(),
|
|
456
|
+
/** True when the OS gives only an approximate size (Windows AdapterRAM, capped at 4 GB). */
|
|
457
|
+
memory_approximate: z5.boolean(),
|
|
458
|
+
unified: z5.boolean()
|
|
459
|
+
});
|
|
452
460
|
var SysinfoHardwareParams = z5.strictObject({});
|
|
453
461
|
var SysinfoHardwareResult = z5.strictObject({
|
|
454
462
|
/** "Mac Studio", "MacBook Pro", "ThinkPad X1 Carbon". */
|
|
@@ -464,7 +472,10 @@ var SysinfoHardwareResult = z5.strictObject({
|
|
|
464
472
|
os_name: z5.string().max(64).nullable(),
|
|
465
473
|
/** "26.6.2". */
|
|
466
474
|
os_version: z5.string().max(64).nullable(),
|
|
467
|
-
os_build: z5.string().max(64).nullable()
|
|
475
|
+
os_build: z5.string().max(64).nullable(),
|
|
476
|
+
/** (1.45) Every graphics adapter, as System Information's Graphics/Displays lists them. Optional:
|
|
477
|
+
* a core older than 1.45 omits it. */
|
|
478
|
+
graphics: z5.array(SysinfoGraphicsAdapter).max(16).optional()
|
|
468
479
|
});
|
|
469
480
|
|
|
470
481
|
// src/schema/fs.ts
|
|
@@ -907,6 +918,29 @@ var ModelsLlmStartParams = z10.strictObject({
|
|
|
907
918
|
var ModelsLlmStartResult = z10.strictObject({ running: LlmRunning, elapsed_ms: nonNegInt });
|
|
908
919
|
var ModelsLlmStopParams = z10.strictObject({});
|
|
909
920
|
var ModelsLlmStopResult = z10.strictObject({ stopped: z10.boolean() });
|
|
921
|
+
var DownloadKind = z10.enum(["speech_model", "text_model", "runtime"]);
|
|
922
|
+
var DownloadRow = z10.strictObject({
|
|
923
|
+
/** The job's key in the service: "model:base", "llm:smollm2-135m", "llm-server", "runtime". */
|
|
924
|
+
key: z10.string().max(64),
|
|
925
|
+
kind: DownloadKind,
|
|
926
|
+
/** The model id for a model download; null for a runtime. */
|
|
927
|
+
model: z10.string().max(64).nullable(),
|
|
928
|
+
/** "running" while it downloads; "stopped" when only its half-done file is left (Resume re-runs the install). */
|
|
929
|
+
state: z10.enum(["running", "stopped"]),
|
|
930
|
+
/** What it is doing now ("download", "verify", …); null when stopped. */
|
|
931
|
+
step: z10.string().max(32).nullable(),
|
|
932
|
+
bytes_done: nonNegInt,
|
|
933
|
+
bytes_total: nonNegInt.nullable(),
|
|
934
|
+
fraction: z10.number().min(0).max(1).nullable(),
|
|
935
|
+
/** Unix ms; null when stopped. */
|
|
936
|
+
started_at: nonNegInt.nullable(),
|
|
937
|
+
/** The folder it downloads into (Show in Finder). */
|
|
938
|
+
path: z10.string().max(1024).nullable()
|
|
939
|
+
});
|
|
940
|
+
var ModelsDownloadsListParams = z10.strictObject({});
|
|
941
|
+
var ModelsDownloadsListResult = z10.strictObject({ downloads: z10.array(DownloadRow).max(64) });
|
|
942
|
+
var ModelsDownloadsCancelParams = z10.strictObject({ key: z10.string().max(64) });
|
|
943
|
+
var ModelsDownloadsCancelResult = z10.strictObject({ cancelled: z10.boolean() });
|
|
910
944
|
var MlServiceState = z10.enum(["starting", "ready", "restarting", "failed", "stopped"]);
|
|
911
945
|
var MlServiceStatus = z10.strictObject({
|
|
912
946
|
state: MlServiceState,
|
|
@@ -1781,7 +1815,13 @@ var ToolLevelResult = z16.strictObject({
|
|
|
1781
1815
|
suite: z16.string().min(1).max(200),
|
|
1782
1816
|
/** The test case inside the suite. */
|
|
1783
1817
|
test: z16.string().min(1).max(300),
|
|
1784
|
-
run_at_ms: z16.int().min(0)
|
|
1818
|
+
run_at_ms: z16.int().min(0),
|
|
1819
|
+
/**
|
|
1820
|
+
* Chat level: how many tool calls the agent's turn made, of any tool. `0` means the turn never
|
|
1821
|
+
* exercised a tool (the model answered in prose, or the chat request failed), so the result is
|
|
1822
|
+
* no evidence about the tool: it never turns a cell red. Absent on older results.
|
|
1823
|
+
*/
|
|
1824
|
+
calls_made: z16.int().min(0).optional()
|
|
1785
1825
|
});
|
|
1786
1826
|
var ToolResultsFile = z16.strictObject({
|
|
1787
1827
|
schema: z16.literal("matrx.tool-results.v1"),
|
|
@@ -4201,6 +4241,8 @@ var OPS = {
|
|
|
4201
4241
|
"models.llm.install": { params: ModelsLlmInstallParams, result: ModelsLlmInstallResult, kind: "unary", since: "1.31", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "TIMEOUT", "CANCELLED", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
4202
4242
|
"models.llm.start": { params: ModelsLlmStartParams, result: ModelsLlmStartResult, kind: "unary", since: "1.31", errors: ["NOT_FOUND", "RESOURCE_BUSY", "RESOURCE_GONE", "TIMEOUT", "CANCELLED", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
4203
4243
|
"models.llm.stop": { params: ModelsLlmStopParams, result: ModelsLlmStopResult, kind: "unary", since: "1.31", errors: ["INTERNAL"] },
|
|
4244
|
+
"models.downloads.list": { params: ModelsDownloadsListParams, result: ModelsDownloadsListResult, kind: "unary", since: "1.45", errors: ["INTERNAL"] },
|
|
4245
|
+
"models.downloads.cancel": { params: ModelsDownloadsCancelParams, result: ModelsDownloadsCancelResult, kind: "unary", since: "1.45", errors: ["NOT_FOUND", "INTERNAL"] },
|
|
4204
4246
|
// Desktop apps and their profiles (SPEC §6 apps); profiles are rows in users.desktop_app_profile.
|
|
4205
4247
|
"apps.list": { params: AppsListParams, result: AppsListResult, kind: "unary", since: "1.2", errors: ["INTERNAL"] },
|
|
4206
4248
|
"apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
|
|
@@ -4458,7 +4500,9 @@ var SERVICES = {
|
|
|
4458
4500
|
"ml.llm_status": { params: ModelsLlmStatusParams, result: ModelsLlmStatusResult },
|
|
4459
4501
|
"ml.llm_install": { params: ModelsLlmInstallParams, result: ModelsLlmInstallResult },
|
|
4460
4502
|
"ml.llm_start": { params: ModelsLlmStartParams, result: ModelsLlmStartResult },
|
|
4461
|
-
"ml.llm_stop": { params: ModelsLlmStopParams, result: ModelsLlmStopResult }
|
|
4503
|
+
"ml.llm_stop": { params: ModelsLlmStopParams, result: ModelsLlmStopResult },
|
|
4504
|
+
"ml.downloads": { params: ModelsDownloadsListParams, result: ModelsDownloadsListResult },
|
|
4505
|
+
"ml.download_cancel": { params: ModelsDownloadsCancelParams, result: ModelsDownloadsCancelResult }
|
|
4462
4506
|
}
|
|
4463
4507
|
},
|
|
4464
4508
|
coding: {
|
|
@@ -4517,6 +4561,7 @@ var NAMED_SCHEMAS = {
|
|
|
4517
4561
|
SysinfoGetResult,
|
|
4518
4562
|
SysinfoHardwareParams,
|
|
4519
4563
|
SysinfoHardwareResult,
|
|
4564
|
+
SysinfoGraphicsAdapter,
|
|
4520
4565
|
FsKind,
|
|
4521
4566
|
FsEntry,
|
|
4522
4567
|
FsListParams,
|
|
@@ -4609,6 +4654,12 @@ var NAMED_SCHEMAS = {
|
|
|
4609
4654
|
ModelsLlmStartResult,
|
|
4610
4655
|
ModelsLlmStopParams,
|
|
4611
4656
|
ModelsLlmStopResult,
|
|
4657
|
+
DownloadKind,
|
|
4658
|
+
DownloadRow,
|
|
4659
|
+
ModelsDownloadsListParams,
|
|
4660
|
+
ModelsDownloadsListResult,
|
|
4661
|
+
ModelsDownloadsCancelParams,
|
|
4662
|
+
ModelsDownloadsCancelResult,
|
|
4612
4663
|
CodingServiceCredentials,
|
|
4613
4664
|
CodingHistoryBlocked,
|
|
4614
4665
|
CodingHistoryFailure,
|
|
@@ -5268,7 +5319,8 @@ var FIELDS_SINCE = {
|
|
|
5268
5319
|
WebBrowserFetchResult: { source: "1.40" },
|
|
5269
5320
|
SysinfoGetResult: { requirements: "1.41" },
|
|
5270
5321
|
"SysinfoGetResult.permissions[]": { detail: "1.41" },
|
|
5271
|
-
MessagesSendParams: { service: "1.42" }
|
|
5322
|
+
MessagesSendParams: { service: "1.42" },
|
|
5323
|
+
SysinfoHardwareResult: { graphics: "1.45" }
|
|
5272
5324
|
};
|
|
5273
5325
|
var NULL_SINCE = {
|
|
5274
5326
|
"RelayDeviceStatusEvent.since_ms": { since: "1.1", olderPeersGet: 0 }
|
|
@@ -5354,6 +5406,7 @@ var RESULT_PATH = /* @__PURE__ */ new Map([
|
|
|
5354
5406
|
["apps.windows.update_state", "AppsWindowsUpdateStateResult"],
|
|
5355
5407
|
["web.fetch_with_browser", "WebBrowserFetchResult"],
|
|
5356
5408
|
["sysinfo.get", "SysinfoGetResult"],
|
|
5409
|
+
["sysinfo.hardware", "SysinfoHardwareResult"],
|
|
5357
5410
|
["apps.projects.to_window", "AppsProjectsToWindowResult"]
|
|
5358
5411
|
]);
|
|
5359
5412
|
var NESTED_RESULTS = /* @__PURE__ */ new Map([
|
|
@@ -5432,7 +5485,7 @@ function forPeer(op, part, value, version) {
|
|
|
5432
5485
|
var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
|
|
5433
5486
|
|
|
5434
5487
|
// src/contract.ts
|
|
5435
|
-
var CONTRACT_SHA256 = "
|
|
5488
|
+
var CONTRACT_SHA256 = "5de0c64447e01d6ff3a467492e9ea725b42091ddcb039eb8001f4ff0413f84c6";
|
|
5436
5489
|
|
|
5437
5490
|
// src/close-policy.ts
|
|
5438
5491
|
var CLOSE_RULES = {
|
|
@@ -5686,6 +5739,9 @@ function builtOps() {
|
|
|
5686
5739
|
var TOOL_LEVELS = ["programmatic", "protocol", "chat"];
|
|
5687
5740
|
var TOOL_PLATFORMS = ["darwin", "win32", "linux"];
|
|
5688
5741
|
var UUID_IN_NAME = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
|
|
5742
|
+
function isInconclusive(e) {
|
|
5743
|
+
return e.outcome === "skip" || e.calls_made === 0;
|
|
5744
|
+
}
|
|
5689
5745
|
var REQUIRED = {
|
|
5690
5746
|
programmatic: [{ label: "in process", ok: (e) => e.transport === "in_process" }],
|
|
5691
5747
|
protocol: [
|
|
@@ -5698,18 +5754,22 @@ var REQUIRED = {
|
|
|
5698
5754
|
function cellFor(tool2, platform, level, evidence) {
|
|
5699
5755
|
if (!tool2.platforms.includes(platform)) return { state: "unsupported", missing: [], last_run_at_ms: null, evidence: [] };
|
|
5700
5756
|
const latest = /* @__PURE__ */ new Map();
|
|
5757
|
+
const latestInconclusive = /* @__PURE__ */ new Map();
|
|
5701
5758
|
for (const e of evidence) {
|
|
5702
5759
|
const key = `${e.suite}\0${e.test.replace(UUID_IN_NAME, "<id>")}\0${e.transport}\0${e.remote_network}`;
|
|
5703
|
-
const
|
|
5704
|
-
|
|
5760
|
+
const into = isInconclusive(e) ? latestInconclusive : latest;
|
|
5761
|
+
const prev = into.get(key);
|
|
5762
|
+
if (!prev || prev.run_at_ms < e.run_at_ms) into.set(key, e);
|
|
5705
5763
|
}
|
|
5706
|
-
const runs = [...latest.values()].
|
|
5764
|
+
const runs = [...latest.values()].sort((a, b) => b.run_at_ms - a.run_at_ms);
|
|
5765
|
+
const unproven = [...latestInconclusive].filter(([k, e]) => (latest.get(k)?.run_at_ms ?? -1) < e.run_at_ms).map(([, e]) => e);
|
|
5766
|
+
const shown = [...runs, ...unproven].sort((a, b) => b.run_at_ms - a.run_at_ms);
|
|
5707
5767
|
const last = runs[0]?.run_at_ms ?? null;
|
|
5708
5768
|
if (tool2.state === "planned" && runs.length === 0) return { state: "not_built", missing: [], last_run_at_ms: null, evidence: [] };
|
|
5709
|
-
if (runs.length === 0) return { state: "untested", missing: REQUIRED[level].map((r) => r.label), last_run_at_ms: null, evidence:
|
|
5710
|
-
if (runs.some((e) => e.outcome === "fail")) return { state: "fail", missing: [], last_run_at_ms: last, evidence:
|
|
5769
|
+
if (runs.length === 0) return { state: "untested", missing: REQUIRED[level].map((r) => r.label), last_run_at_ms: null, evidence: shown };
|
|
5770
|
+
if (runs.some((e) => e.outcome === "fail")) return { state: "fail", missing: [], last_run_at_ms: last, evidence: shown };
|
|
5711
5771
|
const missing = REQUIRED[level].filter((r) => !runs.some((e) => e.outcome === "pass" && r.ok(e))).map((r) => r.label);
|
|
5712
|
-
return { state: missing.length === 0 ? "pass" : "partial", missing, last_run_at_ms: last, evidence:
|
|
5772
|
+
return { state: missing.length === 0 ? "pass" : "partial", missing, last_run_at_ms: last, evidence: shown };
|
|
5713
5773
|
}
|
|
5714
5774
|
function buildToolStatus(files, opts) {
|
|
5715
5775
|
const parsed = files.map((f, i) => {
|
|
@@ -5724,7 +5784,17 @@ function buildToolStatus(files, opts) {
|
|
|
5724
5784
|
if (!known.has(r.tool)) throw new Error(`a result names ${r.tool}, which is not in the tool catalog`);
|
|
5725
5785
|
const key = `${r.tool}|${r.platform}|${r.level}`;
|
|
5726
5786
|
const list = byKey.get(key) ?? [];
|
|
5727
|
-
list.push({
|
|
5787
|
+
list.push({
|
|
5788
|
+
suite: r.suite,
|
|
5789
|
+
test: r.test,
|
|
5790
|
+
transport: r.transport,
|
|
5791
|
+
outcome: r.outcome,
|
|
5792
|
+
remote_network: r.remote_network,
|
|
5793
|
+
commit: file.commit,
|
|
5794
|
+
run_at_ms: r.run_at_ms,
|
|
5795
|
+
detail: r.detail,
|
|
5796
|
+
...r.calls_made === void 0 ? {} : { calls_made: r.calls_made }
|
|
5797
|
+
});
|
|
5728
5798
|
byKey.set(key, list);
|
|
5729
5799
|
}
|
|
5730
5800
|
}
|
|
@@ -6131,6 +6201,8 @@ export {
|
|
|
6131
6201
|
DocumentsPdfTextParams,
|
|
6132
6202
|
DocumentsPdfTextResult,
|
|
6133
6203
|
DocumentsSheet,
|
|
6204
|
+
DownloadKind,
|
|
6205
|
+
DownloadRow,
|
|
6134
6206
|
EVENTS,
|
|
6135
6207
|
EXCLUDED_TOOLS,
|
|
6136
6208
|
EndMsg,
|
|
@@ -6287,6 +6359,10 @@ export {
|
|
|
6287
6359
|
MlServiceStatus,
|
|
6288
6360
|
MlStatusParams,
|
|
6289
6361
|
MlStatusResult,
|
|
6362
|
+
ModelsDownloadsCancelParams,
|
|
6363
|
+
ModelsDownloadsCancelResult,
|
|
6364
|
+
ModelsDownloadsListParams,
|
|
6365
|
+
ModelsDownloadsListResult,
|
|
6290
6366
|
ModelsInstallParams,
|
|
6291
6367
|
ModelsInstallResult,
|
|
6292
6368
|
ModelsLlmInstallParams,
|
|
@@ -6505,6 +6581,7 @@ export {
|
|
|
6505
6581
|
StreamMsg,
|
|
6506
6582
|
SysinfoGetParams,
|
|
6507
6583
|
SysinfoGetResult,
|
|
6584
|
+
SysinfoGraphicsAdapter,
|
|
6508
6585
|
SysinfoHardwareParams,
|
|
6509
6586
|
SysinfoHardwareResult,
|
|
6510
6587
|
SystemNotifyParams,
|
|
@@ -6629,6 +6706,7 @@ export {
|
|
|
6629
6706
|
hasFlag,
|
|
6630
6707
|
isConnectionEnd,
|
|
6631
6708
|
isDesktopProtocolError,
|
|
6709
|
+
isInconclusive,
|
|
6632
6710
|
isTerminalClose,
|
|
6633
6711
|
knows,
|
|
6634
6712
|
negotiate,
|