@ai-matrx/desktop-protocol 0.21.25 → 0.21.27
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 +12 -0
- package/dist/client.cjs +100 -1
- 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 +100 -1
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +183 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +145 -8
- package/dist/index.d.ts +145 -8
- package/dist/index.js +183 -12
- package/dist/index.js.map +1 -1
- package/dist/{models-CXjW101n.d.cts → models-BJsUM5sC.d.cts} +841 -14
- package/dist/{models-CXjW101n.d.ts → models-BJsUM5sC.d.ts} +841 -14
- package/dist/react.d.cts +239 -2
- package/dist/react.d.ts +239 -2
- package/generated/desktop-protocol.schema.json +576 -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 = 32;
|
|
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_-]+$/);
|
|
@@ -521,6 +521,8 @@ var FsMkdirParams = z6.strictObject({ path: AbsPath, parents: z6.boolean().defau
|
|
|
521
521
|
var FsMkdirResult = z6.strictObject({ path: AbsPath, created: z6.boolean() });
|
|
522
522
|
var FsMoveParams = z6.strictObject({ from_path: AbsPath, to_path: AbsPath, overwrite: z6.boolean().default(false) });
|
|
523
523
|
var FsMoveResult = z6.strictObject({ from_path: AbsPath, to_path: AbsPath });
|
|
524
|
+
var FsCopyParams = z6.strictObject({ from_path: AbsPath, to_path: AbsPath, overwrite: z6.boolean().default(false) });
|
|
525
|
+
var FsCopyResult = z6.strictObject({ from_path: AbsPath, to_path: AbsPath });
|
|
524
526
|
var FsDeleteParams = z6.strictObject({
|
|
525
527
|
path: AbsPath,
|
|
526
528
|
recursive: z6.boolean().default(false),
|
|
@@ -589,6 +591,36 @@ var FsSearchContentResult = z6.strictObject({
|
|
|
589
591
|
})
|
|
590
592
|
)
|
|
591
593
|
});
|
|
594
|
+
var FsSearchIndexParams = z6.strictObject({
|
|
595
|
+
query: z6.string().min(1).max(256),
|
|
596
|
+
/** Only under this folder; absent: the whole computer (the walk: the home folder). */
|
|
597
|
+
scope: AbsPath.optional(),
|
|
598
|
+
max_results: z6.int().min(1).max(1e3).default(200)
|
|
599
|
+
});
|
|
600
|
+
var FsSearchIndexResult = z6.strictObject({
|
|
601
|
+
entries: z6.array(FsEntry).max(1e3),
|
|
602
|
+
truncated: z6.boolean(),
|
|
603
|
+
source: z6.enum(["index", "walk"])
|
|
604
|
+
});
|
|
605
|
+
var FsInfoParams = z6.strictObject({ path: AbsPath });
|
|
606
|
+
var FsInfoResult = z6.strictObject({
|
|
607
|
+
entry: FsEntry,
|
|
608
|
+
created: z6.number().min(0).nullable(),
|
|
609
|
+
// seconds, float
|
|
610
|
+
owner: z6.string().max(256).nullable(),
|
|
611
|
+
group: z6.string().max(256).nullable(),
|
|
612
|
+
/** A file's logical size, or a folder's whole tree (null when the walk was cut short). */
|
|
613
|
+
total_size: nonNegInt.nullable(),
|
|
614
|
+
/** Bytes the OS uses for it on disk (blocks), same bound as total_size. */
|
|
615
|
+
size_on_disk: nonNegInt.nullable(),
|
|
616
|
+
/** A folder's own children (not its tree); null for a file. */
|
|
617
|
+
items: nonNegInt.nullable(),
|
|
618
|
+
hidden: z6.boolean(),
|
|
619
|
+
/** Finder's Locked (macOS uchg); null where the OS has no such flag. */
|
|
620
|
+
locked: z6.boolean().nullable(),
|
|
621
|
+
/** The volume holding it refuses writes (a disk image, a read-only share). */
|
|
622
|
+
read_only: z6.boolean()
|
|
623
|
+
});
|
|
592
624
|
var FsChange = z6.strictObject({
|
|
593
625
|
type: z6.enum(["created", "modified", "deleted", "moved"]),
|
|
594
626
|
path: AbsPath,
|
|
@@ -809,6 +841,49 @@ var MlProgress = z10.strictObject({
|
|
|
809
841
|
/** The segment just transcribed (transcribe only): text appears as it is recognised. */
|
|
810
842
|
segment: TranscriptSegment.nullable()
|
|
811
843
|
});
|
|
844
|
+
var TextModelId = z10.enum([
|
|
845
|
+
"smollm2-135m",
|
|
846
|
+
"llama-3.2-3b",
|
|
847
|
+
"phi-4-mini",
|
|
848
|
+
"gemma-3-4b",
|
|
849
|
+
"llama-3.1-8b",
|
|
850
|
+
"qwen-2.5-7b",
|
|
851
|
+
"mistral-small-3.1",
|
|
852
|
+
"gpt-oss-20b",
|
|
853
|
+
"qwen-2.5-coder-7b",
|
|
854
|
+
"qwen-2.5-coder-14b"
|
|
855
|
+
]);
|
|
856
|
+
var TextModelInfo = z10.strictObject({
|
|
857
|
+
id: TextModelId,
|
|
858
|
+
/** Download size of the weights. */
|
|
859
|
+
size_bytes: nonNegInt,
|
|
860
|
+
installed: z10.boolean()
|
|
861
|
+
});
|
|
862
|
+
var LlmServerState = z10.enum(["stopped", "starting", "running", "failed"]);
|
|
863
|
+
var LlmRunning = z10.strictObject({ id: TextModelId, port: z10.int().min(1024).max(65535) });
|
|
864
|
+
var ModelsLlmStatusParams = z10.strictObject({});
|
|
865
|
+
var ModelsLlmStatusResult = z10.strictObject({
|
|
866
|
+
state: LlmServerState,
|
|
867
|
+
/** Every model in the catalog, with whether its weights are on this computer. */
|
|
868
|
+
models: z10.array(TextModelInfo).max(64),
|
|
869
|
+
running: LlmRunning.nullable(),
|
|
870
|
+
/** The model being loaded while `state` is "starting". */
|
|
871
|
+
starting: TextModelId.nullable(),
|
|
872
|
+
/** Non-null while the server program or a model's weights are being downloaded. */
|
|
873
|
+
install: MlInstallProgress.nullable(),
|
|
874
|
+
/** Why the last start or download failed, one human line; null otherwise. */
|
|
875
|
+
error: z10.string().max(300).nullable()
|
|
876
|
+
});
|
|
877
|
+
var ModelsLlmInstallParams = z10.strictObject({ model: TextModelId });
|
|
878
|
+
var ModelsLlmInstallResult = z10.strictObject({ model: TextModelId, elapsed_ms: nonNegInt });
|
|
879
|
+
var ModelsLlmStartParams = z10.strictObject({
|
|
880
|
+
model: TextModelId,
|
|
881
|
+
/** Tokens of context; the service picks a size that fits this computer when omitted. */
|
|
882
|
+
context_length: z10.int().min(512).max(131072).optional()
|
|
883
|
+
});
|
|
884
|
+
var ModelsLlmStartResult = z10.strictObject({ running: LlmRunning, elapsed_ms: nonNegInt });
|
|
885
|
+
var ModelsLlmStopParams = z10.strictObject({});
|
|
886
|
+
var ModelsLlmStopResult = z10.strictObject({ stopped: z10.boolean() });
|
|
812
887
|
var MlServiceState = z10.enum(["starting", "ready", "restarting", "failed", "stopped"]);
|
|
813
888
|
var MlServiceStatus = z10.strictObject({
|
|
814
889
|
state: MlServiceState,
|
|
@@ -1290,6 +1365,19 @@ var ProjectMoveGroup = z14.strictObject({
|
|
|
1290
1365
|
/** A group of that name was already there (reused, never doubled). */
|
|
1291
1366
|
group_exists: z14.boolean().optional()
|
|
1292
1367
|
});
|
|
1368
|
+
var ProjectMovePin = z14.strictObject({
|
|
1369
|
+
ok: z14.boolean(),
|
|
1370
|
+
/** "now" = written into the closed window; "next_close" = queued until that window closes. */
|
|
1371
|
+
when: z14.enum(["now", "next_close"]),
|
|
1372
|
+
/** Pinned by this call (dry run: would be). */
|
|
1373
|
+
pinned: nonNegInt,
|
|
1374
|
+
/** Already pinned there. */
|
|
1375
|
+
already: nonNegInt,
|
|
1376
|
+
/** Waiting for the window to close (dry run: would wait). */
|
|
1377
|
+
queued: nonNegInt,
|
|
1378
|
+
/** Why not pinned (ok false), or why queued. */
|
|
1379
|
+
reason: z14.string().max(400).optional()
|
|
1380
|
+
});
|
|
1293
1381
|
var AppsProjectsToWindowParams = z14.strictObject({
|
|
1294
1382
|
app_key: AppKey,
|
|
1295
1383
|
project_id: ChatProjectId,
|
|
@@ -1298,6 +1386,8 @@ var AppsProjectsToWindowParams = z14.strictObject({
|
|
|
1298
1386
|
take_off: z14.boolean().default(false),
|
|
1299
1387
|
/** Also group them under the project's name in that window's sidebar (closed windows only). */
|
|
1300
1388
|
group: z14.boolean().default(false),
|
|
1389
|
+
/** 1.32: also pin them in that window (now if closed, else when it next closes). */
|
|
1390
|
+
pin: z14.boolean().optional(),
|
|
1301
1391
|
dry_run: z14.boolean().default(false)
|
|
1302
1392
|
});
|
|
1303
1393
|
var AppsProjectsToWindowResult = z14.strictObject({
|
|
@@ -1311,6 +1401,8 @@ var AppsProjectsToWindowResult = z14.strictObject({
|
|
|
1311
1401
|
/** Chats of the project from other apps (no windows to place into), left as they are. */
|
|
1312
1402
|
other_apps: nonNegInt,
|
|
1313
1403
|
group: ProjectMoveGroup.nullable(),
|
|
1404
|
+
/** 1.32: the pin in the target window (absent: not asked). */
|
|
1405
|
+
pin: ProjectMovePin.optional(),
|
|
1314
1406
|
message: z14.string().max(400)
|
|
1315
1407
|
});
|
|
1316
1408
|
var ColdChat = z14.strictObject({
|
|
@@ -2691,6 +2783,9 @@ var OPS = {
|
|
|
2691
2783
|
"fs.write": { params: FsWriteParams, result: FsWriteResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "CONFLICT", "PAYLOAD_TOO_LARGE"] },
|
|
2692
2784
|
"fs.mkdir": { params: FsMkdirParams, result: FsMkdirResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "CONFLICT"] },
|
|
2693
2785
|
"fs.move": { params: FsMoveParams, result: FsMoveResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "CONFLICT"] },
|
|
2786
|
+
"fs.copy": { params: FsCopyParams, result: FsCopyResult, kind: "unary", since: "1.30", errors: [...FS_ERR, "CONFLICT"] },
|
|
2787
|
+
"fs.info": { params: FsInfoParams, result: FsInfoResult, kind: "unary", since: "1.30", errors: FS_ERR },
|
|
2788
|
+
"fs.search_index": { params: FsSearchIndexParams, result: FsSearchIndexResult, kind: "unary", since: "1.30", errors: [...FS_ERR, "TIMEOUT"] },
|
|
2694
2789
|
"fs.delete": { params: FsDeleteParams, result: FsDeleteResult, kind: "unary", since: "1.0", errors: FS_ERR },
|
|
2695
2790
|
"fs.watch": { params: FsWatchParams, result: FsWatchResult, kind: "resource", since: "1.0", errors: [...FS_ERR, "RATE_LIMITED"] },
|
|
2696
2791
|
"fs.patch": { params: FsPatchParams, result: FsPatchResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "CONFLICT"] },
|
|
@@ -2711,6 +2806,10 @@ var OPS = {
|
|
|
2711
2806
|
"models.status": { params: ModelsStatusParams, result: ModelsStatusResult, kind: "unary", since: "1.2", errors: ["INTERNAL"] },
|
|
2712
2807
|
"models.install": { params: ModelsInstallParams, result: ModelsInstallResult, kind: "unary", since: "1.2", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "TIMEOUT", "CANCELLED", "INTERNAL"] },
|
|
2713
2808
|
"models.transcribe": { params: ModelsTranscribeParams, result: ModelsTranscribeResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "PERMISSION_DENIED_OS", "RESOURCE_BUSY", "RESOURCE_GONE", "CANCELLED", "PAYLOAD_TOO_LARGE", "INTERNAL"] },
|
|
2809
|
+
"models.llm.status": { params: ModelsLlmStatusParams, result: ModelsLlmStatusResult, kind: "unary", since: "1.31", errors: ["INTERNAL"] },
|
|
2810
|
+
"models.llm.install": { params: ModelsLlmInstallParams, result: ModelsLlmInstallResult, kind: "unary", since: "1.31", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "TIMEOUT", "CANCELLED", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2811
|
+
"models.llm.start": { params: ModelsLlmStartParams, result: ModelsLlmStartResult, kind: "unary", since: "1.31", errors: ["NOT_FOUND", "RESOURCE_BUSY", "RESOURCE_GONE", "TIMEOUT", "CANCELLED", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
2812
|
+
"models.llm.stop": { params: ModelsLlmStopParams, result: ModelsLlmStopResult, kind: "unary", since: "1.31", errors: ["INTERNAL"] },
|
|
2714
2813
|
// Desktop apps and their profiles (SPEC §6 apps); profiles are rows in users.desktop_app_profile.
|
|
2715
2814
|
"apps.list": { params: AppsListParams, result: AppsListResult, kind: "unary", since: "1.2", errors: ["INTERNAL"] },
|
|
2716
2815
|
"apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
|
|
@@ -2861,7 +2960,11 @@ var SERVICES = {
|
|
|
2861
2960
|
ops: {
|
|
2862
2961
|
"ml.status": { params: MlStatusParams, result: MlStatusResult },
|
|
2863
2962
|
"ml.install": { params: ModelsInstallParams, result: ModelsInstallResult },
|
|
2864
|
-
"ml.transcribe": { params: ModelsTranscribeParams, result: ModelsTranscribeResult }
|
|
2963
|
+
"ml.transcribe": { params: ModelsTranscribeParams, result: ModelsTranscribeResult },
|
|
2964
|
+
"ml.llm_status": { params: ModelsLlmStatusParams, result: ModelsLlmStatusResult },
|
|
2965
|
+
"ml.llm_install": { params: ModelsLlmInstallParams, result: ModelsLlmInstallResult },
|
|
2966
|
+
"ml.llm_start": { params: ModelsLlmStartParams, result: ModelsLlmStartResult },
|
|
2967
|
+
"ml.llm_stop": { params: ModelsLlmStopParams, result: ModelsLlmStopResult }
|
|
2865
2968
|
}
|
|
2866
2969
|
},
|
|
2867
2970
|
coding: {
|
|
@@ -2931,6 +3034,12 @@ var NAMED_SCHEMAS = {
|
|
|
2931
3034
|
FsMkdirResult,
|
|
2932
3035
|
FsMoveParams,
|
|
2933
3036
|
FsMoveResult,
|
|
3037
|
+
FsCopyParams,
|
|
3038
|
+
FsCopyResult,
|
|
3039
|
+
FsInfoParams,
|
|
3040
|
+
FsInfoResult,
|
|
3041
|
+
FsSearchIndexParams,
|
|
3042
|
+
FsSearchIndexResult,
|
|
2934
3043
|
FsDeleteParams,
|
|
2935
3044
|
FsDeleteResult,
|
|
2936
3045
|
FsWatchParams,
|
|
@@ -2989,6 +3098,18 @@ var NAMED_SCHEMAS = {
|
|
|
2989
3098
|
ModelsStatusParams,
|
|
2990
3099
|
ModelsStatusResult,
|
|
2991
3100
|
ModelsProgressEvent,
|
|
3101
|
+
TextModelId,
|
|
3102
|
+
TextModelInfo,
|
|
3103
|
+
LlmServerState,
|
|
3104
|
+
LlmRunning,
|
|
3105
|
+
ModelsLlmStatusParams,
|
|
3106
|
+
ModelsLlmStatusResult,
|
|
3107
|
+
ModelsLlmInstallParams,
|
|
3108
|
+
ModelsLlmInstallResult,
|
|
3109
|
+
ModelsLlmStartParams,
|
|
3110
|
+
ModelsLlmStartResult,
|
|
3111
|
+
ModelsLlmStopParams,
|
|
3112
|
+
ModelsLlmStopResult,
|
|
2992
3113
|
CodingServiceCredentials,
|
|
2993
3114
|
CodingHistoryBlocked,
|
|
2994
3115
|
CodingHistoryFailure,
|
|
@@ -3228,6 +3349,7 @@ var NAMED_SCHEMAS = {
|
|
|
3228
3349
|
ProjectMoveChat,
|
|
3229
3350
|
ProjectMoveSkip,
|
|
3230
3351
|
ProjectMoveGroup,
|
|
3352
|
+
ProjectMovePin,
|
|
3231
3353
|
AppsProjectsToWindowParams,
|
|
3232
3354
|
AppsProjectsToWindowResult,
|
|
3233
3355
|
ShownSection,
|
|
@@ -3362,7 +3484,9 @@ var FIELDS_SINCE = {
|
|
|
3362
3484
|
ScreenDisplay: { rotation: "1.24", refresh_hz: "1.24", builtin: "1.24" },
|
|
3363
3485
|
PowerStatusResult: { energy: "1.24" },
|
|
3364
3486
|
AppsSpendResult: { days: "1.24" },
|
|
3365
|
-
AppsWindowsUpdateStateResult: { closed_by_update: "1.27" }
|
|
3487
|
+
AppsWindowsUpdateStateResult: { closed_by_update: "1.27" },
|
|
3488
|
+
AppsProjectsToWindowParams: { pin: "1.32" },
|
|
3489
|
+
AppsProjectsToWindowResult: { pin: "1.32" }
|
|
3366
3490
|
};
|
|
3367
3491
|
var NULL_SINCE = {
|
|
3368
3492
|
"RelayDeviceStatusEvent.since_ms": { since: "1.1", olderPeersGet: 0 }
|
|
@@ -3498,7 +3622,7 @@ function forPeer(op, part, value, version) {
|
|
|
3498
3622
|
var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
|
|
3499
3623
|
|
|
3500
3624
|
// src/contract.ts
|
|
3501
|
-
var CONTRACT_SHA256 = "
|
|
3625
|
+
var CONTRACT_SHA256 = "ee8e6c98c76f3557f832157e3b2b21bb23ebb74b67b79151f3b9ff788f5273ee";
|
|
3502
3626
|
|
|
3503
3627
|
// src/close-policy.ts
|
|
3504
3628
|
var CLOSE_RULES = {
|
|
@@ -3555,6 +3679,7 @@ var TOOL_CATALOG = [
|
|
|
3555
3679
|
{ name: "desktop_system", group: "os_control", state: "built", path: "device_op", ops: ["sysinfo.get", "sysinfo.hardware", "system.open_url", "system.open_path", "system.open_settings", "system.notify"], platforms: ALL, summary: "System facts, open, notify" },
|
|
3556
3680
|
{ name: "desktop_clipboard", group: "os_control", state: "built", path: "device_op", ops: ["clipboard.read", "clipboard.write"], platforms: ALL, summary: "Read and write the clipboard's text" },
|
|
3557
3681
|
{ name: "desktop_screen", group: "os_control", state: "built", path: "device_op", ops: ["screen.list", "screen.capture"], platforms: ALL, summary: "Displays and screenshots" },
|
|
3682
|
+
{ name: "desktop_browser", group: "os_control", state: "built", path: "device_op", ops: ["browser.sessions", "browser.call"], platforms: ALL, summary: "The person's own browser through the AI Matrx extension: tabs, read, screenshot, navigate, click, type" },
|
|
3558
3683
|
{ name: "desktop_window", group: "os_control", state: "built", path: "device_op", ops: ["window.list", "window.focus", "window.move", "window.minimize"], platforms: ALL, summary: "Find, focus and arrange windows" },
|
|
3559
3684
|
{ name: "desktop_input", group: "os_control", state: "built", path: "device_op", ops: ["input.type_text", "input.hotkey", "input.mouse_click", "input.mouse_move", "input.keyboard_settings", "input.set_keyboard_settings"], platforms: ALL, summary: "Keyboard and mouse" },
|
|
3560
3685
|
{ name: "desktop_audio", group: "os_control", state: "built", path: "device_op", ops: ["audio.devices", "audio.levels", "audio.set_levels", "audio.record", "audio.play"], platforms: ALL, summary: "Audio devices, record, play" },
|
|
@@ -3637,14 +3762,15 @@ var LEGACY_ACTIONS = {
|
|
|
3637
3762
|
"local_system.open_url": tool("desktop_system"),
|
|
3638
3763
|
"local_system.open_path": tool("desktop_system"),
|
|
3639
3764
|
"local_system.notify": tool("desktop_system"),
|
|
3640
|
-
|
|
3641
|
-
"local_browser.
|
|
3642
|
-
"local_browser.
|
|
3643
|
-
"local_browser.
|
|
3644
|
-
"local_browser.
|
|
3645
|
-
"local_browser.
|
|
3646
|
-
"local_browser.
|
|
3647
|
-
"local_browser.
|
|
3765
|
+
// The person's own browser is the AI Matrx extension paired with Matrx 2 (cap browser).
|
|
3766
|
+
"local_browser.navigate": tool("desktop_browser"),
|
|
3767
|
+
"local_browser.click": tool("desktop_browser"),
|
|
3768
|
+
"local_browser.type_text": tool("desktop_browser"),
|
|
3769
|
+
"local_browser.extract": tool("desktop_browser"),
|
|
3770
|
+
"local_browser.screenshot": tool("desktop_browser"),
|
|
3771
|
+
"local_browser.eval": dropped("The extension runs no page script for Matrx 2: its script and cdp tools are privileged and refused over the desktop path; read, click and type cover what eval was used for"),
|
|
3772
|
+
"local_browser.tabs": tool("desktop_browser"),
|
|
3773
|
+
"local_browser.close": tool("desktop_browser"),
|
|
3648
3774
|
"local_web.fetch": tool("desktop_web"),
|
|
3649
3775
|
"local_web.fetch_with_browser": tool("desktop_web"),
|
|
3650
3776
|
"local_web.scrape": tool("desktop_web"),
|
|
@@ -3840,6 +3966,29 @@ function renderToolStatusMarkdown(status) {
|
|
|
3840
3966
|
}
|
|
3841
3967
|
return lines.join("\n");
|
|
3842
3968
|
}
|
|
3969
|
+
|
|
3970
|
+
// src/tools/policy.ts
|
|
3971
|
+
function refusedOps(disabledTools) {
|
|
3972
|
+
const off = new Set(disabledTools);
|
|
3973
|
+
const senders = /* @__PURE__ */ new Map();
|
|
3974
|
+
for (const tool2 of TOOL_CATALOG) for (const op of tool2.ops) senders.set(op, [...senders.get(op) ?? [], tool2.name]);
|
|
3975
|
+
const refused = /* @__PURE__ */ new Set();
|
|
3976
|
+
for (const [op, tools] of senders) if (tools.every((t) => off.has(t))) refused.add(op);
|
|
3977
|
+
return refused;
|
|
3978
|
+
}
|
|
3979
|
+
function toolsSending(op) {
|
|
3980
|
+
return TOOL_CATALOG.filter((t) => t.ops.includes(op)).map((t) => t.name);
|
|
3981
|
+
}
|
|
3982
|
+
function sharedOpsBlocking(tool2, disabledTools) {
|
|
3983
|
+
const entry = TOOL_CATALOG.find((t) => t.name === tool2);
|
|
3984
|
+
if (!entry || entry.ops.length === 0) return [];
|
|
3985
|
+
const off = /* @__PURE__ */ new Set([...disabledTools, tool2]);
|
|
3986
|
+
const refused = refusedOps([...off]);
|
|
3987
|
+
if (entry.ops.some((op) => refused.has(op))) return [];
|
|
3988
|
+
const keepers = /* @__PURE__ */ new Set();
|
|
3989
|
+
for (const op of entry.ops) for (const other of TOOL_CATALOG) if (other.name !== tool2 && !off.has(other.name) && other.ops.includes(op)) keepers.add(other.name);
|
|
3990
|
+
return [...keepers].sort();
|
|
3991
|
+
}
|
|
3843
3992
|
export {
|
|
3844
3993
|
AbsPath,
|
|
3845
3994
|
AccountAgent,
|
|
@@ -4074,10 +4223,14 @@ export {
|
|
|
4074
4223
|
FrameHeader,
|
|
4075
4224
|
FsChange,
|
|
4076
4225
|
FsChangedEvent,
|
|
4226
|
+
FsCopyParams,
|
|
4227
|
+
FsCopyResult,
|
|
4077
4228
|
FsDeleteParams,
|
|
4078
4229
|
FsDeleteResult,
|
|
4079
4230
|
FsEncoding,
|
|
4080
4231
|
FsEntry,
|
|
4232
|
+
FsInfoParams,
|
|
4233
|
+
FsInfoResult,
|
|
4081
4234
|
FsKind,
|
|
4082
4235
|
FsListParams,
|
|
4083
4236
|
FsListResult,
|
|
@@ -4095,6 +4248,8 @@ export {
|
|
|
4095
4248
|
FsReadStreamResult,
|
|
4096
4249
|
FsSearchContentParams,
|
|
4097
4250
|
FsSearchContentResult,
|
|
4251
|
+
FsSearchIndexParams,
|
|
4252
|
+
FsSearchIndexResult,
|
|
4098
4253
|
FsSearchPathsParams,
|
|
4099
4254
|
FsSearchPathsResult,
|
|
4100
4255
|
FsStatParams,
|
|
@@ -4146,6 +4301,8 @@ export {
|
|
|
4146
4301
|
LEGACY_ACTIONS,
|
|
4147
4302
|
LEGACY_DISPATCHERS,
|
|
4148
4303
|
Limits,
|
|
4304
|
+
LlmRunning,
|
|
4305
|
+
LlmServerState,
|
|
4149
4306
|
MATRX_EXTENSION_IDS,
|
|
4150
4307
|
MlInstallPhase,
|
|
4151
4308
|
MlInstallProgress,
|
|
@@ -4157,6 +4314,14 @@ export {
|
|
|
4157
4314
|
MlStatusResult,
|
|
4158
4315
|
ModelsInstallParams,
|
|
4159
4316
|
ModelsInstallResult,
|
|
4317
|
+
ModelsLlmInstallParams,
|
|
4318
|
+
ModelsLlmInstallResult,
|
|
4319
|
+
ModelsLlmStartParams,
|
|
4320
|
+
ModelsLlmStartResult,
|
|
4321
|
+
ModelsLlmStatusParams,
|
|
4322
|
+
ModelsLlmStatusResult,
|
|
4323
|
+
ModelsLlmStopParams,
|
|
4324
|
+
ModelsLlmStopResult,
|
|
4160
4325
|
ModelsProgressEvent,
|
|
4161
4326
|
ModelsStatusParams,
|
|
4162
4327
|
ModelsStatusResult,
|
|
@@ -4191,6 +4356,7 @@ export {
|
|
|
4191
4356
|
ProcSort,
|
|
4192
4357
|
ProjectMoveChat,
|
|
4193
4358
|
ProjectMoveGroup,
|
|
4359
|
+
ProjectMovePin,
|
|
4194
4360
|
ProjectMoveSkip,
|
|
4195
4361
|
ProtocolErrorBody,
|
|
4196
4362
|
ProtocolVersion,
|
|
@@ -4308,6 +4474,8 @@ export {
|
|
|
4308
4474
|
TOOL_GROUPS,
|
|
4309
4475
|
TOOL_LEVELS,
|
|
4310
4476
|
TOOL_PLATFORMS,
|
|
4477
|
+
TextModelId,
|
|
4478
|
+
TextModelInfo,
|
|
4311
4479
|
TitleCopies,
|
|
4312
4480
|
TitleMismatch,
|
|
4313
4481
|
ToolLevel,
|
|
@@ -4368,9 +4536,12 @@ export {
|
|
|
4368
4536
|
negotiate,
|
|
4369
4537
|
nonNegInt,
|
|
4370
4538
|
readCid,
|
|
4539
|
+
refusedOps,
|
|
4371
4540
|
renderToolStatusMarkdown,
|
|
4541
|
+
sharedOpsBlocking,
|
|
4372
4542
|
stampCid,
|
|
4373
4543
|
statusForPeer,
|
|
4544
|
+
toolsSending,
|
|
4374
4545
|
u32,
|
|
4375
4546
|
versionSubprotocol
|
|
4376
4547
|
};
|