@ai-matrx/desktop-protocol 0.13.0 → 0.14.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 +10 -0
- package/dist/client.cjs +106 -38
- 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 +106 -38
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +103 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -6
- package/dist/index.d.ts +117 -6
- package/dist/index.js +103 -8
- package/dist/index.js.map +1 -1
- package/dist/{models-CxAHZMAM.d.cts → models-DqFPqtNS.d.cts} +173 -1
- package/dist/{models-CxAHZMAM.d.ts → models-DqFPqtNS.d.ts} +173 -1
- package/dist/react.d.cts +86 -0
- package/dist/react.d.ts +86 -0
- package/generated/desktop-protocol.schema.json +360 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.14.0 (protocol 1.3)
|
|
4
|
+
|
|
5
|
+
- The `proc` capability: `proc.list` (by CPU, memory, pid or name; a name filter), `proc.ports`
|
|
6
|
+
(listening TCP/UDP ports and their processes), `proc.kill` (ask to quit, or force).
|
|
7
|
+
- The `clipboard` capability: `clipboard.read`, `clipboard.write` (text, up to 1 MiB).
|
|
8
|
+
- TOOL_CATALOG: `desktop_process` and `desktop_clipboard` are built; launching and focusing apps
|
|
9
|
+
move to a planned `desktop_apps` over the `apps` capability.
|
|
10
|
+
|
|
11
|
+
Consumer action: none (new ops only; an older app answers UNKNOWN_OPERATION).
|
|
12
|
+
|
|
3
13
|
## 0.13.0
|
|
4
14
|
|
|
5
15
|
- `EXCLUDED_TOOLS`: tools armed with a device binding that are deliberately not device tools, with
|
package/dist/client.cjs
CHANGED
|
@@ -126,7 +126,7 @@ var import_zod2 = require("zod");
|
|
|
126
126
|
// src/schema/primitives.ts
|
|
127
127
|
var import_zod = require("zod");
|
|
128
128
|
var PROTOCOL_MAJOR = 1;
|
|
129
|
-
var PROTOCOL_MINOR =
|
|
129
|
+
var PROTOCOL_MINOR = 3;
|
|
130
130
|
var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
|
|
131
131
|
var ProtocolVersion = import_zod.z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
|
|
132
132
|
var RequestId = import_zod.z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
|
|
@@ -813,23 +813,86 @@ var RelayCallEnvelope = import_zod10.z.strictObject({
|
|
|
813
813
|
params: import_zod10.z.unknown()
|
|
814
814
|
});
|
|
815
815
|
|
|
816
|
-
// src/schema/
|
|
816
|
+
// src/schema/clipboard.ts
|
|
817
817
|
var import_zod11 = require("zod");
|
|
818
|
-
var
|
|
819
|
-
var
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
818
|
+
var ClipboardReadParams = import_zod11.z.strictObject({});
|
|
819
|
+
var ClipboardReadResult = import_zod11.z.strictObject({
|
|
820
|
+
/** The clipboard's text ("" when it holds none), cut to 1 MiB. */
|
|
821
|
+
text: import_zod11.z.string().max(1048576),
|
|
822
|
+
truncated: import_zod11.z.boolean()
|
|
823
|
+
});
|
|
824
|
+
var ClipboardWriteParams = import_zod11.z.strictObject({ text: import_zod11.z.string().max(1048576) });
|
|
825
|
+
var ClipboardWriteResult = import_zod11.z.strictObject({ bytes: nonNegInt });
|
|
826
|
+
|
|
827
|
+
// src/schema/proc.ts
|
|
828
|
+
var import_zod12 = require("zod");
|
|
829
|
+
var ProcSort = import_zod12.z.enum(["cpu", "memory", "pid", "name"]);
|
|
830
|
+
var ProcListParams = import_zod12.z.strictObject({
|
|
831
|
+
/** Case-insensitive substring of the process name or its command line. */
|
|
832
|
+
name: import_zod12.z.string().min(1).max(128).optional(),
|
|
833
|
+
sort: ProcSort.default("cpu"),
|
|
834
|
+
limit: import_zod12.z.int().min(1).max(500).default(50)
|
|
835
|
+
});
|
|
836
|
+
var ProcInfo = import_zod12.z.strictObject({
|
|
837
|
+
pid: import_zod12.z.int().min(0),
|
|
838
|
+
/** Parent process id; null where the OS does not report it. */
|
|
839
|
+
ppid: import_zod12.z.int().min(0).nullable(),
|
|
840
|
+
name: import_zod12.z.string().max(256),
|
|
841
|
+
/** The command line, cut to 1024 characters. */
|
|
842
|
+
command: import_zod12.z.string().max(1024),
|
|
843
|
+
/** Share of one core, as `ps` and Task Manager report it; null where the OS does not say. */
|
|
844
|
+
cpu_percent: import_zod12.z.number().min(0).nullable(),
|
|
845
|
+
memory_bytes: nonNegInt.nullable(),
|
|
846
|
+
user: import_zod12.z.string().max(128).nullable()
|
|
847
|
+
});
|
|
848
|
+
var ProcListResult = import_zod12.z.strictObject({
|
|
849
|
+
processes: import_zod12.z.array(ProcInfo).max(500),
|
|
850
|
+
/** Processes that matched before `limit`. */
|
|
851
|
+
total: nonNegInt,
|
|
852
|
+
truncated: import_zod12.z.boolean()
|
|
853
|
+
});
|
|
854
|
+
var ProcPortsParams = import_zod12.z.strictObject({
|
|
855
|
+
/** Only this port. */
|
|
856
|
+
port: import_zod12.z.int().min(1).max(65535).optional()
|
|
857
|
+
});
|
|
858
|
+
var ProcPort = import_zod12.z.strictObject({
|
|
859
|
+
port: import_zod12.z.int().min(1).max(65535),
|
|
860
|
+
protocol: import_zod12.z.enum(["tcp", "udp"]),
|
|
861
|
+
/** The local address it listens on ("127.0.0.1", "*", "::"). */
|
|
862
|
+
address: import_zod12.z.string().max(64),
|
|
863
|
+
pid: import_zod12.z.int().min(0).nullable(),
|
|
864
|
+
process: import_zod12.z.string().max(256).nullable()
|
|
865
|
+
});
|
|
866
|
+
var ProcPortsResult = import_zod12.z.strictObject({ ports: import_zod12.z.array(ProcPort).max(4e3) });
|
|
867
|
+
var ProcKillParams = import_zod12.z.strictObject({
|
|
868
|
+
pid: import_zod12.z.int().min(1),
|
|
869
|
+
/** Kill outright (SIGKILL; on Windows the same /F) instead of asking it to quit. */
|
|
870
|
+
force: import_zod12.z.boolean().default(false)
|
|
871
|
+
});
|
|
872
|
+
var ProcKillResult = import_zod12.z.strictObject({
|
|
873
|
+
pid: import_zod12.z.int().min(1),
|
|
874
|
+
signal: import_zod12.z.enum(["SIGTERM", "SIGKILL"]),
|
|
875
|
+
/** True when the process was gone within 3 s. */
|
|
876
|
+
exited: import_zod12.z.boolean()
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
// src/schema/apps.ts
|
|
880
|
+
var import_zod13 = require("zod");
|
|
881
|
+
var AppKey = import_zod13.z.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
|
|
882
|
+
var AppProfileId = import_zod13.z.string().regex(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/);
|
|
883
|
+
var AppProfileLocator = import_zod13.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}$/);
|
|
884
|
+
var AppSupport = import_zod13.z.enum(["supported", "partial", "unsupported"]);
|
|
885
|
+
var AppFeatureStatus = import_zod13.z.strictObject({
|
|
823
886
|
status: AppSupport,
|
|
824
887
|
/** One line, set whenever status is not "supported". */
|
|
825
|
-
reason:
|
|
888
|
+
reason: import_zod13.z.string().max(140).nullable()
|
|
826
889
|
});
|
|
827
|
-
var AppInfo =
|
|
890
|
+
var AppInfo = import_zod13.z.strictObject({
|
|
828
891
|
app_key: AppKey,
|
|
829
|
-
name:
|
|
830
|
-
installed:
|
|
892
|
+
name: import_zod13.z.string().max(64),
|
|
893
|
+
installed: import_zod13.z.boolean(),
|
|
831
894
|
/** The app's own version string, or null when it is not installed or does not say. */
|
|
832
|
-
version:
|
|
895
|
+
version: import_zod13.z.string().max(64).nullable(),
|
|
833
896
|
/** The install found (an .app bundle, an .exe, a binary), or null. */
|
|
834
897
|
location: AbsPath.nullable(),
|
|
835
898
|
/** Open the app at all on this OS. */
|
|
@@ -839,69 +902,69 @@ var AppInfo = import_zod11.z.strictObject({
|
|
|
839
902
|
/** Plan usage read from the app's own files on this OS. */
|
|
840
903
|
usage: AppFeatureStatus
|
|
841
904
|
});
|
|
842
|
-
var AppUsageReading =
|
|
843
|
-
window:
|
|
905
|
+
var AppUsageReading = import_zod13.z.strictObject({
|
|
906
|
+
window: import_zod13.z.enum(["five_hour", "weekly", "extra"]),
|
|
844
907
|
/** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
|
|
845
|
-
percent:
|
|
908
|
+
percent: import_zod13.z.number().min(0).max(1e4),
|
|
846
909
|
/** When the app recorded it. */
|
|
847
910
|
sampled_at_ms: epochMs,
|
|
848
911
|
/** True when the window has rolled over since the sample, so the figure has reset. */
|
|
849
|
-
reset_since:
|
|
912
|
+
reset_since: import_zod13.z.boolean()
|
|
850
913
|
});
|
|
851
|
-
var AppProfile =
|
|
914
|
+
var AppProfile = import_zod13.z.strictObject({
|
|
852
915
|
/** The row's id; null for a folder found on disk that no row names yet. */
|
|
853
916
|
id: AppProfileId.nullable(),
|
|
854
917
|
app_key: AppKey,
|
|
855
|
-
display_name:
|
|
918
|
+
display_name: import_zod13.z.string().min(1).max(120),
|
|
856
919
|
/** The account the person means to be signed in here; null when not stated (never guessed). */
|
|
857
|
-
account_identity:
|
|
920
|
+
account_identity: import_zod13.z.string().min(3).max(320).nullable(),
|
|
858
921
|
profile_locator: AppProfileLocator.nullable(),
|
|
859
922
|
/** The device the row is tied to; null when the row names none. */
|
|
860
923
|
device_id: DeviceId.nullable(),
|
|
861
924
|
/** The folder this profile resolves to on this device; null for a row tied to another device. */
|
|
862
925
|
folder: AbsPath.nullable(),
|
|
863
926
|
/** The folder exists on this device. */
|
|
864
|
-
on_disk:
|
|
927
|
+
on_disk: import_zod13.z.boolean(),
|
|
865
928
|
/** An instance with this profile is running; null when it could not be determined. */
|
|
866
|
-
running:
|
|
929
|
+
running: import_zod13.z.boolean().nullable(),
|
|
867
930
|
/** Usage the app recorded for this profile; null when the app exposes none here. */
|
|
868
|
-
usage:
|
|
931
|
+
usage: import_zod13.z.array(AppUsageReading).nullable(),
|
|
869
932
|
last_opened_ms: epochMs.nullable()
|
|
870
933
|
});
|
|
871
|
-
var AppsListParams =
|
|
872
|
-
var AppsListResult =
|
|
873
|
-
var AppsProfilesListParams =
|
|
934
|
+
var AppsListParams = import_zod13.z.strictObject({});
|
|
935
|
+
var AppsListResult = import_zod13.z.strictObject({ apps: import_zod13.z.array(AppInfo) });
|
|
936
|
+
var AppsProfilesListParams = import_zod13.z.strictObject({
|
|
874
937
|
/** Only this app's profiles; every app's when absent. */
|
|
875
938
|
app_key: AppKey.optional()
|
|
876
939
|
});
|
|
877
|
-
var AppsProfilesListResult =
|
|
878
|
-
profiles:
|
|
940
|
+
var AppsProfilesListResult = import_zod13.z.strictObject({
|
|
941
|
+
profiles: import_zod13.z.array(AppProfile),
|
|
879
942
|
/**
|
|
880
943
|
* Whether the saved rows could be read: false while signed out or offline, when only folders
|
|
881
944
|
* found on disk are listed.
|
|
882
945
|
*/
|
|
883
|
-
registry:
|
|
946
|
+
registry: import_zod13.z.enum(["ok", "signed_out", "unavailable"])
|
|
884
947
|
});
|
|
885
|
-
var AppsProfilesSaveParams =
|
|
948
|
+
var AppsProfilesSaveParams = import_zod13.z.strictObject({
|
|
886
949
|
id: AppProfileId.optional(),
|
|
887
950
|
app_key: AppKey,
|
|
888
|
-
display_name:
|
|
889
|
-
account_identity:
|
|
951
|
+
display_name: import_zod13.z.string().min(1).max(120),
|
|
952
|
+
account_identity: import_zod13.z.string().min(3).max(320).nullable(),
|
|
890
953
|
/** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
|
|
891
954
|
profile_locator: AppProfileLocator.nullable(),
|
|
892
955
|
/** On create with profile_locator null: make a new folder named after display_name instead. */
|
|
893
|
-
new_folder:
|
|
956
|
+
new_folder: import_zod13.z.boolean().default(false)
|
|
894
957
|
});
|
|
895
958
|
var AppsProfilesSaveResult = AppProfile;
|
|
896
|
-
var AppsProfilesRemoveParams =
|
|
897
|
-
var AppsProfilesRemoveResult =
|
|
898
|
-
var AppsOpenParams =
|
|
959
|
+
var AppsProfilesRemoveParams = import_zod13.z.strictObject({ id: AppProfileId });
|
|
960
|
+
var AppsProfilesRemoveResult = import_zod13.z.strictObject({ removed: import_zod13.z.boolean() });
|
|
961
|
+
var AppsOpenParams = import_zod13.z.strictObject({
|
|
899
962
|
app_key: AppKey,
|
|
900
963
|
profile_id: AppProfileId.optional()
|
|
901
964
|
});
|
|
902
|
-
var AppsOpenResult =
|
|
965
|
+
var AppsOpenResult = import_zod13.z.strictObject({
|
|
903
966
|
/** True when an instance with this profile was already running; it is brought forward. */
|
|
904
|
-
already_running:
|
|
967
|
+
already_running: import_zod13.z.boolean(),
|
|
905
968
|
folder: AbsPath.nullable()
|
|
906
969
|
});
|
|
907
970
|
|
|
@@ -941,7 +1004,12 @@ var OPS = {
|
|
|
941
1004
|
"apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
|
|
942
1005
|
"apps.profiles.save": { params: AppsProfilesSaveParams, result: AppsProfilesSaveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "DEVICE_OFFLINE", "INTERNAL"] },
|
|
943
1006
|
"apps.profiles.remove": { params: AppsProfilesRemoveParams, result: AppsProfilesRemoveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "DEVICE_OFFLINE", "INTERNAL"] },
|
|
944
|
-
"apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] }
|
|
1007
|
+
"apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] },
|
|
1008
|
+
"proc.list": { params: ProcListParams, result: ProcListResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
1009
|
+
"proc.ports": { params: ProcPortsParams, result: ProcPortsResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
1010
|
+
"proc.kill": { params: ProcKillParams, result: ProcKillResult, kind: "unary", since: "1.3", errors: ["NOT_FOUND", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "INTERNAL"] },
|
|
1011
|
+
"clipboard.read": { params: ClipboardReadParams, result: ClipboardReadResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
|
|
1012
|
+
"clipboard.write": { params: ClipboardWriteParams, result: ClipboardWriteResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "PAYLOAD_TOO_LARGE", "INTERNAL"] }
|
|
945
1013
|
};
|
|
946
1014
|
var EVENTS = {
|
|
947
1015
|
"fs.changed": FsChangedEvent,
|