@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.cjs
CHANGED
|
@@ -340,6 +340,8 @@ __export(src_exports, {
|
|
|
340
340
|
DocumentsPdfTextParams: () => DocumentsPdfTextParams,
|
|
341
341
|
DocumentsPdfTextResult: () => DocumentsPdfTextResult,
|
|
342
342
|
DocumentsSheet: () => DocumentsSheet,
|
|
343
|
+
DownloadKind: () => DownloadKind,
|
|
344
|
+
DownloadRow: () => DownloadRow,
|
|
343
345
|
EVENTS: () => EVENTS,
|
|
344
346
|
EXCLUDED_TOOLS: () => EXCLUDED_TOOLS,
|
|
345
347
|
EndMsg: () => EndMsg,
|
|
@@ -496,6 +498,10 @@ __export(src_exports, {
|
|
|
496
498
|
MlServiceStatus: () => MlServiceStatus,
|
|
497
499
|
MlStatusParams: () => MlStatusParams,
|
|
498
500
|
MlStatusResult: () => MlStatusResult,
|
|
501
|
+
ModelsDownloadsCancelParams: () => ModelsDownloadsCancelParams,
|
|
502
|
+
ModelsDownloadsCancelResult: () => ModelsDownloadsCancelResult,
|
|
503
|
+
ModelsDownloadsListParams: () => ModelsDownloadsListParams,
|
|
504
|
+
ModelsDownloadsListResult: () => ModelsDownloadsListResult,
|
|
499
505
|
ModelsInstallParams: () => ModelsInstallParams,
|
|
500
506
|
ModelsInstallResult: () => ModelsInstallResult,
|
|
501
507
|
ModelsLlmInstallParams: () => ModelsLlmInstallParams,
|
|
@@ -714,6 +720,7 @@ __export(src_exports, {
|
|
|
714
720
|
StreamMsg: () => StreamMsg,
|
|
715
721
|
SysinfoGetParams: () => SysinfoGetParams,
|
|
716
722
|
SysinfoGetResult: () => SysinfoGetResult,
|
|
723
|
+
SysinfoGraphicsAdapter: () => SysinfoGraphicsAdapter,
|
|
717
724
|
SysinfoHardwareParams: () => SysinfoHardwareParams,
|
|
718
725
|
SysinfoHardwareResult: () => SysinfoHardwareResult,
|
|
719
726
|
SystemNotifyParams: () => SystemNotifyParams,
|
|
@@ -838,6 +845,7 @@ __export(src_exports, {
|
|
|
838
845
|
hasFlag: () => hasFlag,
|
|
839
846
|
isConnectionEnd: () => isConnectionEnd,
|
|
840
847
|
isDesktopProtocolError: () => isDesktopProtocolError,
|
|
848
|
+
isInconclusive: () => isInconclusive,
|
|
841
849
|
isTerminalClose: () => isTerminalClose,
|
|
842
850
|
knows: () => knows,
|
|
843
851
|
negotiate: () => negotiate,
|
|
@@ -858,7 +866,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
858
866
|
var import_zod = require("zod");
|
|
859
867
|
var import_uuid = require("@ai-matrx/kit/uuid");
|
|
860
868
|
var PROTOCOL_MAJOR = 1;
|
|
861
|
-
var PROTOCOL_MINOR =
|
|
869
|
+
var PROTOCOL_MINOR = 45;
|
|
862
870
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
863
871
|
var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
864
872
|
var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -1305,6 +1313,14 @@ var SysinfoGetResult = import_zod5.z.strictObject({
|
|
|
1305
1313
|
})
|
|
1306
1314
|
).optional()
|
|
1307
1315
|
});
|
|
1316
|
+
var SysinfoGraphicsAdapter = import_zod5.z.strictObject({
|
|
1317
|
+
name: import_zod5.z.string().max(128),
|
|
1318
|
+
vendor: import_zod5.z.string().max(64).nullable(),
|
|
1319
|
+
memory_bytes: nonNegInt.nullable(),
|
|
1320
|
+
/** True when the OS gives only an approximate size (Windows AdapterRAM, capped at 4 GB). */
|
|
1321
|
+
memory_approximate: import_zod5.z.boolean(),
|
|
1322
|
+
unified: import_zod5.z.boolean()
|
|
1323
|
+
});
|
|
1308
1324
|
var SysinfoHardwareParams = import_zod5.z.strictObject({});
|
|
1309
1325
|
var SysinfoHardwareResult = import_zod5.z.strictObject({
|
|
1310
1326
|
/** "Mac Studio", "MacBook Pro", "ThinkPad X1 Carbon". */
|
|
@@ -1320,7 +1336,10 @@ var SysinfoHardwareResult = import_zod5.z.strictObject({
|
|
|
1320
1336
|
os_name: import_zod5.z.string().max(64).nullable(),
|
|
1321
1337
|
/** "26.6.2". */
|
|
1322
1338
|
os_version: import_zod5.z.string().max(64).nullable(),
|
|
1323
|
-
os_build: import_zod5.z.string().max(64).nullable()
|
|
1339
|
+
os_build: import_zod5.z.string().max(64).nullable(),
|
|
1340
|
+
/** (1.45) Every graphics adapter, as System Information's Graphics/Displays lists them. Optional:
|
|
1341
|
+
* a core older than 1.45 omits it. */
|
|
1342
|
+
graphics: import_zod5.z.array(SysinfoGraphicsAdapter).max(16).optional()
|
|
1324
1343
|
});
|
|
1325
1344
|
|
|
1326
1345
|
// src/schema/fs.ts
|
|
@@ -1763,6 +1782,29 @@ var ModelsLlmStartParams = import_zod10.z.strictObject({
|
|
|
1763
1782
|
var ModelsLlmStartResult = import_zod10.z.strictObject({ running: LlmRunning, elapsed_ms: nonNegInt });
|
|
1764
1783
|
var ModelsLlmStopParams = import_zod10.z.strictObject({});
|
|
1765
1784
|
var ModelsLlmStopResult = import_zod10.z.strictObject({ stopped: import_zod10.z.boolean() });
|
|
1785
|
+
var DownloadKind = import_zod10.z.enum(["speech_model", "text_model", "runtime"]);
|
|
1786
|
+
var DownloadRow = import_zod10.z.strictObject({
|
|
1787
|
+
/** The job's key in the service: "model:base", "llm:smollm2-135m", "llm-server", "runtime". */
|
|
1788
|
+
key: import_zod10.z.string().max(64),
|
|
1789
|
+
kind: DownloadKind,
|
|
1790
|
+
/** The model id for a model download; null for a runtime. */
|
|
1791
|
+
model: import_zod10.z.string().max(64).nullable(),
|
|
1792
|
+
/** "running" while it downloads; "stopped" when only its half-done file is left (Resume re-runs the install). */
|
|
1793
|
+
state: import_zod10.z.enum(["running", "stopped"]),
|
|
1794
|
+
/** What it is doing now ("download", "verify", …); null when stopped. */
|
|
1795
|
+
step: import_zod10.z.string().max(32).nullable(),
|
|
1796
|
+
bytes_done: nonNegInt,
|
|
1797
|
+
bytes_total: nonNegInt.nullable(),
|
|
1798
|
+
fraction: import_zod10.z.number().min(0).max(1).nullable(),
|
|
1799
|
+
/** Unix ms; null when stopped. */
|
|
1800
|
+
started_at: nonNegInt.nullable(),
|
|
1801
|
+
/** The folder it downloads into (Show in Finder). */
|
|
1802
|
+
path: import_zod10.z.string().max(1024).nullable()
|
|
1803
|
+
});
|
|
1804
|
+
var ModelsDownloadsListParams = import_zod10.z.strictObject({});
|
|
1805
|
+
var ModelsDownloadsListResult = import_zod10.z.strictObject({ downloads: import_zod10.z.array(DownloadRow).max(64) });
|
|
1806
|
+
var ModelsDownloadsCancelParams = import_zod10.z.strictObject({ key: import_zod10.z.string().max(64) });
|
|
1807
|
+
var ModelsDownloadsCancelResult = import_zod10.z.strictObject({ cancelled: import_zod10.z.boolean() });
|
|
1766
1808
|
var MlServiceState = import_zod10.z.enum(["starting", "ready", "restarting", "failed", "stopped"]);
|
|
1767
1809
|
var MlServiceStatus = import_zod10.z.strictObject({
|
|
1768
1810
|
state: MlServiceState,
|
|
@@ -2637,7 +2679,13 @@ var ToolLevelResult = import_zod16.z.strictObject({
|
|
|
2637
2679
|
suite: import_zod16.z.string().min(1).max(200),
|
|
2638
2680
|
/** The test case inside the suite. */
|
|
2639
2681
|
test: import_zod16.z.string().min(1).max(300),
|
|
2640
|
-
run_at_ms: import_zod16.z.int().min(0)
|
|
2682
|
+
run_at_ms: import_zod16.z.int().min(0),
|
|
2683
|
+
/**
|
|
2684
|
+
* Chat level: how many tool calls the agent's turn made, of any tool. `0` means the turn never
|
|
2685
|
+
* exercised a tool (the model answered in prose, or the chat request failed), so the result is
|
|
2686
|
+
* no evidence about the tool: it never turns a cell red. Absent on older results.
|
|
2687
|
+
*/
|
|
2688
|
+
calls_made: import_zod16.z.int().min(0).optional()
|
|
2641
2689
|
});
|
|
2642
2690
|
var ToolResultsFile = import_zod16.z.strictObject({
|
|
2643
2691
|
schema: import_zod16.z.literal("matrx.tool-results.v1"),
|
|
@@ -5057,6 +5105,8 @@ var OPS = {
|
|
|
5057
5105
|
"models.llm.install": { params: ModelsLlmInstallParams, result: ModelsLlmInstallResult, kind: "unary", since: "1.31", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "TIMEOUT", "CANCELLED", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
5058
5106
|
"models.llm.start": { params: ModelsLlmStartParams, result: ModelsLlmStartResult, kind: "unary", since: "1.31", errors: ["NOT_FOUND", "RESOURCE_BUSY", "RESOURCE_GONE", "TIMEOUT", "CANCELLED", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
5059
5107
|
"models.llm.stop": { params: ModelsLlmStopParams, result: ModelsLlmStopResult, kind: "unary", since: "1.31", errors: ["INTERNAL"] },
|
|
5108
|
+
"models.downloads.list": { params: ModelsDownloadsListParams, result: ModelsDownloadsListResult, kind: "unary", since: "1.45", errors: ["INTERNAL"] },
|
|
5109
|
+
"models.downloads.cancel": { params: ModelsDownloadsCancelParams, result: ModelsDownloadsCancelResult, kind: "unary", since: "1.45", errors: ["NOT_FOUND", "INTERNAL"] },
|
|
5060
5110
|
// Desktop apps and their profiles (SPEC §6 apps); profiles are rows in users.desktop_app_profile.
|
|
5061
5111
|
"apps.list": { params: AppsListParams, result: AppsListResult, kind: "unary", since: "1.2", errors: ["INTERNAL"] },
|
|
5062
5112
|
"apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
|
|
@@ -5314,7 +5364,9 @@ var SERVICES = {
|
|
|
5314
5364
|
"ml.llm_status": { params: ModelsLlmStatusParams, result: ModelsLlmStatusResult },
|
|
5315
5365
|
"ml.llm_install": { params: ModelsLlmInstallParams, result: ModelsLlmInstallResult },
|
|
5316
5366
|
"ml.llm_start": { params: ModelsLlmStartParams, result: ModelsLlmStartResult },
|
|
5317
|
-
"ml.llm_stop": { params: ModelsLlmStopParams, result: ModelsLlmStopResult }
|
|
5367
|
+
"ml.llm_stop": { params: ModelsLlmStopParams, result: ModelsLlmStopResult },
|
|
5368
|
+
"ml.downloads": { params: ModelsDownloadsListParams, result: ModelsDownloadsListResult },
|
|
5369
|
+
"ml.download_cancel": { params: ModelsDownloadsCancelParams, result: ModelsDownloadsCancelResult }
|
|
5318
5370
|
}
|
|
5319
5371
|
},
|
|
5320
5372
|
coding: {
|
|
@@ -5373,6 +5425,7 @@ var NAMED_SCHEMAS = {
|
|
|
5373
5425
|
SysinfoGetResult,
|
|
5374
5426
|
SysinfoHardwareParams,
|
|
5375
5427
|
SysinfoHardwareResult,
|
|
5428
|
+
SysinfoGraphicsAdapter,
|
|
5376
5429
|
FsKind,
|
|
5377
5430
|
FsEntry,
|
|
5378
5431
|
FsListParams,
|
|
@@ -5465,6 +5518,12 @@ var NAMED_SCHEMAS = {
|
|
|
5465
5518
|
ModelsLlmStartResult,
|
|
5466
5519
|
ModelsLlmStopParams,
|
|
5467
5520
|
ModelsLlmStopResult,
|
|
5521
|
+
DownloadKind,
|
|
5522
|
+
DownloadRow,
|
|
5523
|
+
ModelsDownloadsListParams,
|
|
5524
|
+
ModelsDownloadsListResult,
|
|
5525
|
+
ModelsDownloadsCancelParams,
|
|
5526
|
+
ModelsDownloadsCancelResult,
|
|
5468
5527
|
CodingServiceCredentials,
|
|
5469
5528
|
CodingHistoryBlocked,
|
|
5470
5529
|
CodingHistoryFailure,
|
|
@@ -6124,7 +6183,8 @@ var FIELDS_SINCE = {
|
|
|
6124
6183
|
WebBrowserFetchResult: { source: "1.40" },
|
|
6125
6184
|
SysinfoGetResult: { requirements: "1.41" },
|
|
6126
6185
|
"SysinfoGetResult.permissions[]": { detail: "1.41" },
|
|
6127
|
-
MessagesSendParams: { service: "1.42" }
|
|
6186
|
+
MessagesSendParams: { service: "1.42" },
|
|
6187
|
+
SysinfoHardwareResult: { graphics: "1.45" }
|
|
6128
6188
|
};
|
|
6129
6189
|
var NULL_SINCE = {
|
|
6130
6190
|
"RelayDeviceStatusEvent.since_ms": { since: "1.1", olderPeersGet: 0 }
|
|
@@ -6210,6 +6270,7 @@ var RESULT_PATH = /* @__PURE__ */ new Map([
|
|
|
6210
6270
|
["apps.windows.update_state", "AppsWindowsUpdateStateResult"],
|
|
6211
6271
|
["web.fetch_with_browser", "WebBrowserFetchResult"],
|
|
6212
6272
|
["sysinfo.get", "SysinfoGetResult"],
|
|
6273
|
+
["sysinfo.hardware", "SysinfoHardwareResult"],
|
|
6213
6274
|
["apps.projects.to_window", "AppsProjectsToWindowResult"]
|
|
6214
6275
|
]);
|
|
6215
6276
|
var NESTED_RESULTS = /* @__PURE__ */ new Map([
|
|
@@ -6288,7 +6349,7 @@ function forPeer(op, part, value, version) {
|
|
|
6288
6349
|
var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
|
|
6289
6350
|
|
|
6290
6351
|
// src/contract.ts
|
|
6291
|
-
var CONTRACT_SHA256 = "
|
|
6352
|
+
var CONTRACT_SHA256 = "5de0c64447e01d6ff3a467492e9ea725b42091ddcb039eb8001f4ff0413f84c6";
|
|
6292
6353
|
|
|
6293
6354
|
// src/close-policy.ts
|
|
6294
6355
|
var CLOSE_RULES = {
|
|
@@ -6542,6 +6603,9 @@ function builtOps() {
|
|
|
6542
6603
|
var TOOL_LEVELS = ["programmatic", "protocol", "chat"];
|
|
6543
6604
|
var TOOL_PLATFORMS = ["darwin", "win32", "linux"];
|
|
6544
6605
|
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;
|
|
6606
|
+
function isInconclusive(e) {
|
|
6607
|
+
return e.outcome === "skip" || e.calls_made === 0;
|
|
6608
|
+
}
|
|
6545
6609
|
var REQUIRED = {
|
|
6546
6610
|
programmatic: [{ label: "in process", ok: (e) => e.transport === "in_process" }],
|
|
6547
6611
|
protocol: [
|
|
@@ -6554,18 +6618,22 @@ var REQUIRED = {
|
|
|
6554
6618
|
function cellFor(tool2, platform, level, evidence) {
|
|
6555
6619
|
if (!tool2.platforms.includes(platform)) return { state: "unsupported", missing: [], last_run_at_ms: null, evidence: [] };
|
|
6556
6620
|
const latest = /* @__PURE__ */ new Map();
|
|
6621
|
+
const latestInconclusive = /* @__PURE__ */ new Map();
|
|
6557
6622
|
for (const e of evidence) {
|
|
6558
6623
|
const key = `${e.suite}\0${e.test.replace(UUID_IN_NAME, "<id>")}\0${e.transport}\0${e.remote_network}`;
|
|
6559
|
-
const
|
|
6560
|
-
|
|
6624
|
+
const into = isInconclusive(e) ? latestInconclusive : latest;
|
|
6625
|
+
const prev = into.get(key);
|
|
6626
|
+
if (!prev || prev.run_at_ms < e.run_at_ms) into.set(key, e);
|
|
6561
6627
|
}
|
|
6562
|
-
const runs = [...latest.values()].
|
|
6628
|
+
const runs = [...latest.values()].sort((a, b) => b.run_at_ms - a.run_at_ms);
|
|
6629
|
+
const unproven = [...latestInconclusive].filter(([k, e]) => (latest.get(k)?.run_at_ms ?? -1) < e.run_at_ms).map(([, e]) => e);
|
|
6630
|
+
const shown = [...runs, ...unproven].sort((a, b) => b.run_at_ms - a.run_at_ms);
|
|
6563
6631
|
const last = runs[0]?.run_at_ms ?? null;
|
|
6564
6632
|
if (tool2.state === "planned" && runs.length === 0) return { state: "not_built", missing: [], last_run_at_ms: null, evidence: [] };
|
|
6565
|
-
if (runs.length === 0) return { state: "untested", missing: REQUIRED[level].map((r) => r.label), last_run_at_ms: null, evidence:
|
|
6566
|
-
if (runs.some((e) => e.outcome === "fail")) return { state: "fail", missing: [], last_run_at_ms: last, evidence:
|
|
6633
|
+
if (runs.length === 0) return { state: "untested", missing: REQUIRED[level].map((r) => r.label), last_run_at_ms: null, evidence: shown };
|
|
6634
|
+
if (runs.some((e) => e.outcome === "fail")) return { state: "fail", missing: [], last_run_at_ms: last, evidence: shown };
|
|
6567
6635
|
const missing = REQUIRED[level].filter((r) => !runs.some((e) => e.outcome === "pass" && r.ok(e))).map((r) => r.label);
|
|
6568
|
-
return { state: missing.length === 0 ? "pass" : "partial", missing, last_run_at_ms: last, evidence:
|
|
6636
|
+
return { state: missing.length === 0 ? "pass" : "partial", missing, last_run_at_ms: last, evidence: shown };
|
|
6569
6637
|
}
|
|
6570
6638
|
function buildToolStatus(files, opts) {
|
|
6571
6639
|
const parsed = files.map((f, i) => {
|
|
@@ -6580,7 +6648,17 @@ function buildToolStatus(files, opts) {
|
|
|
6580
6648
|
if (!known.has(r.tool)) throw new Error(`a result names ${r.tool}, which is not in the tool catalog`);
|
|
6581
6649
|
const key = `${r.tool}|${r.platform}|${r.level}`;
|
|
6582
6650
|
const list = byKey.get(key) ?? [];
|
|
6583
|
-
list.push({
|
|
6651
|
+
list.push({
|
|
6652
|
+
suite: r.suite,
|
|
6653
|
+
test: r.test,
|
|
6654
|
+
transport: r.transport,
|
|
6655
|
+
outcome: r.outcome,
|
|
6656
|
+
remote_network: r.remote_network,
|
|
6657
|
+
commit: file.commit,
|
|
6658
|
+
run_at_ms: r.run_at_ms,
|
|
6659
|
+
detail: r.detail,
|
|
6660
|
+
...r.calls_made === void 0 ? {} : { calls_made: r.calls_made }
|
|
6661
|
+
});
|
|
6584
6662
|
byKey.set(key, list);
|
|
6585
6663
|
}
|
|
6586
6664
|
}
|