@ai-matrx/desktop-protocol 0.13.0 → 0.15.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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.0 (protocol 1.4)
4
+
5
+ - Computer control: `system.open_url` / `system.open_path` / `system.notify`; `screen.list` /
6
+ `screen.capture` (a display as JPEG or PNG, scaled to `max_width`); `window.list` /
7
+ `window.focus` / `window.move` / `window.minimize`; `input.type_text` / `input.hotkey` /
8
+ `input.mouse_move` / `input.mouse_click`; `power.status` / `power.prevent_sleep`;
9
+ `resources.snapshot` (CPU, memory, swap, disks).
10
+ - Polled folder watches for callers that ask rather than hold a stream: `fs.watch.start` /
11
+ `fs.watch.events` / `fs.watch.stop`. Background jobs: `exec.job.start` / `exec.job.output` /
12
+ `exec.job.stop` / `exec.job.list`.
13
+ - TOOL_CATALOG: shell_job, desktop_apps, desktop_system, desktop_screen, desktop_window,
14
+ desktop_input, desktop_power, desktop_resources and fs_watch are built; desktop_resources is
15
+ `resources.snapshot` only (the busiest processes are desktop_process).
16
+
17
+ Consumer action: none (new ops only; an older app answers UNKNOWN_OPERATION).
18
+
19
+ ## 0.14.0 (protocol 1.3)
20
+
21
+ - The `proc` capability: `proc.list` (by CPU, memory, pid or name; a name filter), `proc.ports`
22
+ (listening TCP/UDP ports and their processes), `proc.kill` (ask to quit, or force).
23
+ - The `clipboard` capability: `clipboard.read`, `clipboard.write` (text, up to 1 MiB).
24
+ - TOOL_CATALOG: `desktop_process` and `desktop_clipboard` are built; launching and focusing apps
25
+ move to a planned `desktop_apps` over the `apps` capability.
26
+
27
+ Consumer action: none (new ops only; an older app answers UNKNOWN_OPERATION).
28
+
3
29
  ## 0.13.0
4
30
 
5
31
  - `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 = 2;
129
+ var PROTOCOL_MINOR = 4;
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,421 @@ var RelayCallEnvelope = import_zod10.z.strictObject({
813
813
  params: import_zod10.z.unknown()
814
814
  });
815
815
 
816
- // src/schema/apps.ts
816
+ // src/schema/clipboard.ts
817
817
  var import_zod11 = require("zod");
818
- var AppKey = import_zod11.z.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
819
- var AppProfileId = import_zod11.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}$/);
820
- var AppProfileLocator = import_zod11.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}$/);
821
- var AppSupport = import_zod11.z.enum(["supported", "partial", "unsupported"]);
822
- var AppFeatureStatus = import_zod11.z.strictObject({
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/system.ts
880
+ var import_zod13 = require("zod");
881
+ var SystemOpenUrlParams = import_zod13.z.strictObject({
882
+ /** http, https or mailto; opened in the person's default app for it. */
883
+ url: import_zod13.z.string().min(1).max(4096)
884
+ });
885
+ var SystemOpenUrlResult = import_zod13.z.strictObject({ url: import_zod13.z.string().max(4096) });
886
+ var SystemOpenPathParams = import_zod13.z.strictObject({
887
+ path: AbsPath,
888
+ /** Show it in the file manager (Finder, Explorer) instead of opening it. */
889
+ reveal: import_zod13.z.boolean().default(false)
890
+ });
891
+ var SystemOpenPathResult = import_zod13.z.strictObject({ path: AbsPath, revealed: import_zod13.z.boolean() });
892
+ var SystemNotifyParams = import_zod13.z.strictObject({
893
+ title: import_zod13.z.string().min(1).max(128),
894
+ body: import_zod13.z.string().max(1024).default("")
895
+ });
896
+ var SystemNotifyResult = import_zod13.z.strictObject({
897
+ /** False when this computer has no notification service to show it (a bare Linux box). */
898
+ shown: import_zod13.z.boolean()
899
+ });
900
+
901
+ // src/schema/screen.ts
902
+ var import_zod14 = require("zod");
903
+ var ScreenDisplay = import_zod14.z.strictObject({
904
+ /** The OS's display id; pass it to screen.capture. */
905
+ id: nonNegInt,
906
+ name: import_zod14.z.string().max(128),
907
+ /** Position and size in the OS's logical points (x and y may be negative left of or above the main display). */
908
+ x: import_zod14.z.int(),
909
+ y: import_zod14.z.int(),
910
+ width: import_zod14.z.int().min(1),
911
+ height: import_zod14.z.int().min(1),
912
+ /** Pixels per point (2 on a Retina display). */
913
+ scale: import_zod14.z.number().min(0.1).max(8),
914
+ primary: import_zod14.z.boolean()
915
+ });
916
+ var ScreenListParams = import_zod14.z.strictObject({});
917
+ var ScreenListResult = import_zod14.z.strictObject({ displays: import_zod14.z.array(ScreenDisplay).max(32) });
918
+ var ScreenCaptureParams = import_zod14.z.strictObject({
919
+ /** The display (from screen.list); the primary display when absent. */
920
+ display_id: nonNegInt.optional(),
921
+ format: import_zod14.z.enum(["jpeg", "png"]).default("jpeg"),
922
+ /** Scale the picture down to at most this width in pixels (kept when already smaller). */
923
+ max_width: import_zod14.z.int().min(160).max(7680).default(1600)
924
+ });
925
+ var ScreenCaptureResult = import_zod14.z.strictObject({
926
+ display_id: nonNegInt,
927
+ mime_type: import_zod14.z.enum(["image/jpeg", "image/png"]),
928
+ width: import_zod14.z.int().min(1),
929
+ height: import_zod14.z.int().min(1),
930
+ /** The display's full resolution in pixels, before scaling. */
931
+ source_width: import_zod14.z.int().min(1),
932
+ source_height: import_zod14.z.int().min(1),
933
+ /** The image, base64 (at most 6 MiB of text). */
934
+ data_base64: import_zod14.z.string().max(6291456)
935
+ });
936
+
937
+ // src/schema/window.ts
938
+ var import_zod15 = require("zod");
939
+ var WindowInfo = import_zod15.z.strictObject({
940
+ /** The OS's window handle (macOS window number, Windows HWND, X11 window id). */
941
+ id: nonNegInt,
942
+ title: import_zod15.z.string().max(512),
943
+ /** Position and size in logical points. */
944
+ x: import_zod15.z.int(),
945
+ y: import_zod15.z.int(),
946
+ width: import_zod15.z.int().min(0),
947
+ height: import_zod15.z.int().min(0)
948
+ });
949
+ var WindowListParams = import_zod15.z.strictObject({
950
+ /** Case-insensitive substring of the window title. */
951
+ title: import_zod15.z.string().min(1).max(256).optional(),
952
+ limit: import_zod15.z.int().min(1).max(500).default(100)
953
+ });
954
+ var WindowListResult = import_zod15.z.strictObject({
955
+ windows: import_zod15.z.array(WindowInfo).max(500),
956
+ total: nonNegInt,
957
+ truncated: import_zod15.z.boolean()
958
+ });
959
+ var WindowFocusParams = import_zod15.z.strictObject({ id: nonNegInt });
960
+ var WindowFocusResult = import_zod15.z.strictObject({ window: WindowInfo });
961
+ var WindowMoveParams = import_zod15.z.strictObject({
962
+ id: nonNegInt,
963
+ /** New top-left corner; unchanged when absent. */
964
+ x: import_zod15.z.int().optional(),
965
+ y: import_zod15.z.int().optional(),
966
+ /** New size; unchanged when absent. */
967
+ width: import_zod15.z.int().min(50).max(16384).optional(),
968
+ height: import_zod15.z.int().min(50).max(16384).optional()
969
+ });
970
+ var WindowMoveResult = import_zod15.z.strictObject({ window: WindowInfo });
971
+ var WindowMinimizeParams = import_zod15.z.strictObject({ id: nonNegInt });
972
+ var WindowMinimizeResult = import_zod15.z.strictObject({ id: nonNegInt });
973
+
974
+ // src/schema/input.ts
975
+ var import_zod16 = require("zod");
976
+ var InputKey = import_zod16.z.enum([
977
+ "cmd",
978
+ "ctrl",
979
+ "alt",
980
+ "shift",
981
+ "meta",
982
+ "a",
983
+ "b",
984
+ "c",
985
+ "d",
986
+ "e",
987
+ "f",
988
+ "g",
989
+ "h",
990
+ "i",
991
+ "j",
992
+ "k",
993
+ "l",
994
+ "m",
995
+ "n",
996
+ "o",
997
+ "p",
998
+ "q",
999
+ "r",
1000
+ "s",
1001
+ "t",
1002
+ "u",
1003
+ "v",
1004
+ "w",
1005
+ "x",
1006
+ "y",
1007
+ "z",
1008
+ "0",
1009
+ "1",
1010
+ "2",
1011
+ "3",
1012
+ "4",
1013
+ "5",
1014
+ "6",
1015
+ "7",
1016
+ "8",
1017
+ "9",
1018
+ "f1",
1019
+ "f2",
1020
+ "f3",
1021
+ "f4",
1022
+ "f5",
1023
+ "f6",
1024
+ "f7",
1025
+ "f8",
1026
+ "f9",
1027
+ "f10",
1028
+ "f11",
1029
+ "f12",
1030
+ "enter",
1031
+ "tab",
1032
+ "escape",
1033
+ "space",
1034
+ "backspace",
1035
+ "delete",
1036
+ "up",
1037
+ "down",
1038
+ "left",
1039
+ "right",
1040
+ "home",
1041
+ "end",
1042
+ "pageup",
1043
+ "pagedown",
1044
+ "minus",
1045
+ "equal",
1046
+ "comma",
1047
+ "period",
1048
+ "slash",
1049
+ "semicolon",
1050
+ "quote",
1051
+ "bracketleft",
1052
+ "bracketright",
1053
+ "backslash",
1054
+ "grave"
1055
+ ]);
1056
+ var InputTypeTextParams = import_zod16.z.strictObject({ text: import_zod16.z.string().min(1).max(1e4) });
1057
+ var InputTypeTextResult = import_zod16.z.strictObject({ characters: import_zod16.z.int().min(1) });
1058
+ var InputHotkeyParams = import_zod16.z.strictObject({
1059
+ /** Pressed together in order and released in reverse: ["cmd", "shift", "t"]. */
1060
+ keys: import_zod16.z.array(InputKey).min(1).max(6)
1061
+ });
1062
+ var InputHotkeyResult = import_zod16.z.strictObject({ keys: import_zod16.z.array(InputKey) });
1063
+ var InputPoint = import_zod16.z.strictObject({ x: import_zod16.z.int(), y: import_zod16.z.int() });
1064
+ var InputMouseMoveParams = import_zod16.z.strictObject({
1065
+ /** Screen position in logical points (the coordinates screen.list and window.list report). */
1066
+ x: import_zod16.z.int(),
1067
+ y: import_zod16.z.int()
1068
+ });
1069
+ var InputMouseMoveResult = import_zod16.z.strictObject({
1070
+ /** Where the pointer is now, read back from the OS. */
1071
+ position: InputPoint
1072
+ });
1073
+ var InputMouseClickParams = import_zod16.z.strictObject({
1074
+ /** Move here first; clicks where the pointer is when absent. */
1075
+ x: import_zod16.z.int().optional(),
1076
+ y: import_zod16.z.int().optional(),
1077
+ button: import_zod16.z.enum(["left", "right", "middle"]).default("left"),
1078
+ double: import_zod16.z.boolean().default(false)
1079
+ });
1080
+ var InputMouseClickResult = import_zod16.z.strictObject({
1081
+ position: InputPoint,
1082
+ button: import_zod16.z.enum(["left", "right", "middle"]),
1083
+ double: import_zod16.z.boolean()
1084
+ });
1085
+
1086
+ // src/schema/power.ts
1087
+ var import_zod17 = require("zod");
1088
+ var PowerStatusParams = import_zod17.z.strictObject({});
1089
+ var PowerStatusResult = import_zod17.z.strictObject({
1090
+ has_battery: import_zod17.z.boolean(),
1091
+ /** 0–100; null without a battery. */
1092
+ percent: import_zod17.z.number().min(0).max(100).nullable(),
1093
+ charging: import_zod17.z.boolean().nullable(),
1094
+ /** On wall power; null where the OS does not say. */
1095
+ plugged_in: import_zod17.z.boolean().nullable(),
1096
+ /** Minutes of battery left; null when charging, unknown or without a battery. */
1097
+ minutes_left: nonNegInt.nullable(),
1098
+ /** Matrx 2 is keeping the computer awake (power.prevent_sleep) until this time; null when it is not. */
1099
+ awake_until_ms: epochMs.nullable()
1100
+ });
1101
+ var PowerPreventSleepParams = import_zod17.z.strictObject({
1102
+ /** Keep the computer awake this long; 0 lets it sleep again now. */
1103
+ seconds: import_zod17.z.int().min(0).max(86400),
1104
+ /** Shown where the OS lists what keeps it awake. */
1105
+ reason: import_zod17.z.string().min(1).max(128).default("Matrx 2 is working")
1106
+ });
1107
+ var PowerPreventSleepResult = import_zod17.z.strictObject({
1108
+ /** When it may sleep again; null after seconds 0. */
1109
+ awake_until_ms: epochMs.nullable()
1110
+ });
1111
+
1112
+ // src/schema/resources.ts
1113
+ var import_zod18 = require("zod");
1114
+ var ResourcesDisk = import_zod18.z.strictObject({
1115
+ /** Where it is mounted ("/", "C:"). */
1116
+ mount: import_zod18.z.string().max(512),
1117
+ /** The file system ("apfs", "NTFS", "ext4"). */
1118
+ fs: import_zod18.z.string().max(64),
1119
+ size_bytes: nonNegInt,
1120
+ used_bytes: nonNegInt,
1121
+ available_bytes: nonNegInt
1122
+ });
1123
+ var ResourcesSnapshotParams = import_zod18.z.strictObject({});
1124
+ var ResourcesSnapshotResult = import_zod18.z.strictObject({
1125
+ cpu: import_zod18.z.strictObject({
1126
+ /** Busy share of all cores, 0–100, measured now. */
1127
+ percent: import_zod18.z.number().min(0).max(100),
1128
+ cores: import_zod18.z.int().min(1),
1129
+ /** 1, 5 and 15 minute load averages; null on Windows. */
1130
+ load: import_zod18.z.array(import_zod18.z.number().min(0)).length(3).nullable()
1131
+ }),
1132
+ memory: import_zod18.z.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt, available_bytes: nonNegInt }),
1133
+ swap: import_zod18.z.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt }),
1134
+ disks: import_zod18.z.array(ResourcesDisk).max(64),
1135
+ uptime_seconds: nonNegInt
1136
+ });
1137
+
1138
+ // src/schema/fs-watch.ts
1139
+ var import_zod19 = require("zod");
1140
+ var FsWatchId = import_zod19.z.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
1141
+ var FsWatchStartParams = import_zod19.z.strictObject({
1142
+ path: AbsPath,
1143
+ recursive: import_zod19.z.boolean().default(true),
1144
+ /** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
1145
+ ignore: import_zod19.z.array(import_zod19.z.string().max(256)).max(64).default([])
1146
+ });
1147
+ var FsWatchStartResult = import_zod19.z.strictObject({
1148
+ watch_id: FsWatchId,
1149
+ path: AbsPath,
1150
+ /** The watch ends by itself if nobody reads it for 30 minutes. */
1151
+ expires_at_ms: epochMs
1152
+ });
1153
+ var FsWatchEventsParams = import_zod19.z.strictObject({
1154
+ watch_id: FsWatchId,
1155
+ /** Wait up to this long for a first change when none is waiting (0 answers at once). */
1156
+ wait_ms: import_zod19.z.int().min(0).max(25e3).default(0)
1157
+ });
1158
+ var FsWatchEventsResult = import_zod19.z.strictObject({
1159
+ /** What changed since the last read, oldest first; re-checked against the disk when read. */
1160
+ changes: import_zod19.z.array(FsChange).max(1e3),
1161
+ /** Changes were dropped (more than 1000 waited): list the folder again. */
1162
+ overflow: import_zod19.z.boolean(),
1163
+ expires_at_ms: epochMs
1164
+ });
1165
+ var FsWatchStopParams = import_zod19.z.strictObject({ watch_id: FsWatchId });
1166
+ var FsWatchStopResult = import_zod19.z.strictObject({ watch_id: FsWatchId });
1167
+
1168
+ // src/schema/exec-job.ts
1169
+ var import_zod20 = require("zod");
1170
+ var ExecJobId = import_zod20.z.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
1171
+ var ExecJobStartParams = import_zod20.z.strictObject({
1172
+ command: import_zod20.z.string().min(1).max(131072),
1173
+ /** The folder it runs in; the home folder when absent. */
1174
+ cwd: AbsPath.optional(),
1175
+ env: import_zod20.z.record(import_zod20.z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), import_zod20.z.string().max(32768)).optional()
1176
+ });
1177
+ var ExecJobStartResult = import_zod20.z.strictObject({ job_id: ExecJobId, pid: import_zod20.z.int().min(1), cwd: AbsPath });
1178
+ var ExecJobOutputParams = import_zod20.z.strictObject({
1179
+ job_id: ExecJobId,
1180
+ /** Byte offset into the job's output to read from (next_offset of the last read; 0 = the start). */
1181
+ offset: nonNegInt.default(0),
1182
+ /** Wait up to this long for new output or the exit when none is waiting (0 answers at once). */
1183
+ wait_ms: import_zod20.z.int().min(0).max(25e3).default(0),
1184
+ max_bytes: import_zod20.z.int().min(1024).max(1048576).default(65536)
1185
+ });
1186
+ var ExecJobOutputResult = import_zod20.z.strictObject({
1187
+ /** stdout and stderr interleaved as they arrived (UTF-8). */
1188
+ output: import_zod20.z.string(),
1189
+ next_offset: nonNegInt,
1190
+ /** Bytes before `offset` that are gone (the job keeps its last 4 MiB). */
1191
+ dropped_bytes: nonNegInt,
1192
+ running: import_zod20.z.boolean(),
1193
+ exit_code: import_zod20.z.int().nullable()
1194
+ });
1195
+ var ExecJobStopParams = import_zod20.z.strictObject({
1196
+ job_id: ExecJobId,
1197
+ /** End it at once (SIGKILL; on Windows the whole tree with /F) instead of asking it to quit. */
1198
+ force: import_zod20.z.boolean().default(false)
1199
+ });
1200
+ var ExecJobStopResult = import_zod20.z.strictObject({ job_id: ExecJobId, exited: import_zod20.z.boolean(), exit_code: import_zod20.z.int().nullable() });
1201
+ var ExecJobInfo = import_zod20.z.strictObject({
1202
+ job_id: ExecJobId,
1203
+ command: import_zod20.z.string().max(1024),
1204
+ pid: import_zod20.z.int().min(1),
1205
+ cwd: AbsPath,
1206
+ running: import_zod20.z.boolean(),
1207
+ exit_code: import_zod20.z.int().nullable(),
1208
+ started_at_ms: epochMs,
1209
+ output_bytes: nonNegInt
1210
+ });
1211
+ var ExecJobListParams = import_zod20.z.strictObject({});
1212
+ var ExecJobListResult = import_zod20.z.strictObject({ jobs: import_zod20.z.array(ExecJobInfo).max(64) });
1213
+
1214
+ // src/schema/apps.ts
1215
+ var import_zod21 = require("zod");
1216
+ var AppKey = import_zod21.z.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
1217
+ var AppProfileId = import_zod21.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}$/);
1218
+ var AppProfileLocator = import_zod21.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}$/);
1219
+ var AppSupport = import_zod21.z.enum(["supported", "partial", "unsupported"]);
1220
+ var AppFeatureStatus = import_zod21.z.strictObject({
823
1221
  status: AppSupport,
824
1222
  /** One line, set whenever status is not "supported". */
825
- reason: import_zod11.z.string().max(140).nullable()
1223
+ reason: import_zod21.z.string().max(140).nullable()
826
1224
  });
827
- var AppInfo = import_zod11.z.strictObject({
1225
+ var AppInfo = import_zod21.z.strictObject({
828
1226
  app_key: AppKey,
829
- name: import_zod11.z.string().max(64),
830
- installed: import_zod11.z.boolean(),
1227
+ name: import_zod21.z.string().max(64),
1228
+ installed: import_zod21.z.boolean(),
831
1229
  /** The app's own version string, or null when it is not installed or does not say. */
832
- version: import_zod11.z.string().max(64).nullable(),
1230
+ version: import_zod21.z.string().max(64).nullable(),
833
1231
  /** The install found (an .app bundle, an .exe, a binary), or null. */
834
1232
  location: AbsPath.nullable(),
835
1233
  /** Open the app at all on this OS. */
@@ -839,69 +1237,69 @@ var AppInfo = import_zod11.z.strictObject({
839
1237
  /** Plan usage read from the app's own files on this OS. */
840
1238
  usage: AppFeatureStatus
841
1239
  });
842
- var AppUsageReading = import_zod11.z.strictObject({
843
- window: import_zod11.z.enum(["five_hour", "weekly", "extra"]),
1240
+ var AppUsageReading = import_zod21.z.strictObject({
1241
+ window: import_zod21.z.enum(["five_hour", "weekly", "extra"]),
844
1242
  /** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
845
- percent: import_zod11.z.number().min(0).max(1e4),
1243
+ percent: import_zod21.z.number().min(0).max(1e4),
846
1244
  /** When the app recorded it. */
847
1245
  sampled_at_ms: epochMs,
848
1246
  /** True when the window has rolled over since the sample, so the figure has reset. */
849
- reset_since: import_zod11.z.boolean()
1247
+ reset_since: import_zod21.z.boolean()
850
1248
  });
851
- var AppProfile = import_zod11.z.strictObject({
1249
+ var AppProfile = import_zod21.z.strictObject({
852
1250
  /** The row's id; null for a folder found on disk that no row names yet. */
853
1251
  id: AppProfileId.nullable(),
854
1252
  app_key: AppKey,
855
- display_name: import_zod11.z.string().min(1).max(120),
1253
+ display_name: import_zod21.z.string().min(1).max(120),
856
1254
  /** The account the person means to be signed in here; null when not stated (never guessed). */
857
- account_identity: import_zod11.z.string().min(3).max(320).nullable(),
1255
+ account_identity: import_zod21.z.string().min(3).max(320).nullable(),
858
1256
  profile_locator: AppProfileLocator.nullable(),
859
1257
  /** The device the row is tied to; null when the row names none. */
860
1258
  device_id: DeviceId.nullable(),
861
1259
  /** The folder this profile resolves to on this device; null for a row tied to another device. */
862
1260
  folder: AbsPath.nullable(),
863
1261
  /** The folder exists on this device. */
864
- on_disk: import_zod11.z.boolean(),
1262
+ on_disk: import_zod21.z.boolean(),
865
1263
  /** An instance with this profile is running; null when it could not be determined. */
866
- running: import_zod11.z.boolean().nullable(),
1264
+ running: import_zod21.z.boolean().nullable(),
867
1265
  /** Usage the app recorded for this profile; null when the app exposes none here. */
868
- usage: import_zod11.z.array(AppUsageReading).nullable(),
1266
+ usage: import_zod21.z.array(AppUsageReading).nullable(),
869
1267
  last_opened_ms: epochMs.nullable()
870
1268
  });
871
- var AppsListParams = import_zod11.z.strictObject({});
872
- var AppsListResult = import_zod11.z.strictObject({ apps: import_zod11.z.array(AppInfo) });
873
- var AppsProfilesListParams = import_zod11.z.strictObject({
1269
+ var AppsListParams = import_zod21.z.strictObject({});
1270
+ var AppsListResult = import_zod21.z.strictObject({ apps: import_zod21.z.array(AppInfo) });
1271
+ var AppsProfilesListParams = import_zod21.z.strictObject({
874
1272
  /** Only this app's profiles; every app's when absent. */
875
1273
  app_key: AppKey.optional()
876
1274
  });
877
- var AppsProfilesListResult = import_zod11.z.strictObject({
878
- profiles: import_zod11.z.array(AppProfile),
1275
+ var AppsProfilesListResult = import_zod21.z.strictObject({
1276
+ profiles: import_zod21.z.array(AppProfile),
879
1277
  /**
880
1278
  * Whether the saved rows could be read: false while signed out or offline, when only folders
881
1279
  * found on disk are listed.
882
1280
  */
883
- registry: import_zod11.z.enum(["ok", "signed_out", "unavailable"])
1281
+ registry: import_zod21.z.enum(["ok", "signed_out", "unavailable"])
884
1282
  });
885
- var AppsProfilesSaveParams = import_zod11.z.strictObject({
1283
+ var AppsProfilesSaveParams = import_zod21.z.strictObject({
886
1284
  id: AppProfileId.optional(),
887
1285
  app_key: AppKey,
888
- display_name: import_zod11.z.string().min(1).max(120),
889
- account_identity: import_zod11.z.string().min(3).max(320).nullable(),
1286
+ display_name: import_zod21.z.string().min(1).max(120),
1287
+ account_identity: import_zod21.z.string().min(3).max(320).nullable(),
890
1288
  /** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
891
1289
  profile_locator: AppProfileLocator.nullable(),
892
1290
  /** On create with profile_locator null: make a new folder named after display_name instead. */
893
- new_folder: import_zod11.z.boolean().default(false)
1291
+ new_folder: import_zod21.z.boolean().default(false)
894
1292
  });
895
1293
  var AppsProfilesSaveResult = AppProfile;
896
- var AppsProfilesRemoveParams = import_zod11.z.strictObject({ id: AppProfileId });
897
- var AppsProfilesRemoveResult = import_zod11.z.strictObject({ removed: import_zod11.z.boolean() });
898
- var AppsOpenParams = import_zod11.z.strictObject({
1294
+ var AppsProfilesRemoveParams = import_zod21.z.strictObject({ id: AppProfileId });
1295
+ var AppsProfilesRemoveResult = import_zod21.z.strictObject({ removed: import_zod21.z.boolean() });
1296
+ var AppsOpenParams = import_zod21.z.strictObject({
899
1297
  app_key: AppKey,
900
1298
  profile_id: AppProfileId.optional()
901
1299
  });
902
- var AppsOpenResult = import_zod11.z.strictObject({
1300
+ var AppsOpenResult = import_zod21.z.strictObject({
903
1301
  /** True when an instance with this profile was already running; it is brought forward. */
904
- already_running: import_zod11.z.boolean(),
1302
+ already_running: import_zod21.z.boolean(),
905
1303
  folder: AbsPath.nullable()
906
1304
  });
907
1305
 
@@ -941,7 +1339,35 @@ var OPS = {
941
1339
  "apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
942
1340
  "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
1341
  "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"] }
1342
+ "apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] },
1343
+ "proc.list": { params: ProcListParams, result: ProcListResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1344
+ "proc.ports": { params: ProcPortsParams, result: ProcPortsResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1345
+ "proc.kill": { params: ProcKillParams, result: ProcKillResult, kind: "unary", since: "1.3", errors: ["NOT_FOUND", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "INTERNAL"] },
1346
+ "clipboard.read": { params: ClipboardReadParams, result: ClipboardReadResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
1347
+ "clipboard.write": { params: ClipboardWriteParams, result: ClipboardWriteResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "PAYLOAD_TOO_LARGE", "INTERNAL"] },
1348
+ "fs.watch.start": { params: FsWatchStartParams, result: FsWatchStartResult, kind: "unary", since: "1.4", errors: [...FS_ERR, "RATE_LIMITED"] },
1349
+ "fs.watch.events": { params: FsWatchEventsParams, result: FsWatchEventsResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS", "INTERNAL"] },
1350
+ "fs.watch.stop": { params: FsWatchStopParams, result: FsWatchStopResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS"] },
1351
+ "exec.job.start": { params: ExecJobStartParams, result: ExecJobStartResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "NOT_FOUND", "RATE_LIMITED", "INTERNAL"] },
1352
+ "exec.job.output": { params: ExecJobOutputParams, result: ExecJobOutputResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS"] },
1353
+ "exec.job.stop": { params: ExecJobStopParams, result: ExecJobStopResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS", "INTERNAL"] },
1354
+ "exec.job.list": { params: ExecJobListParams, result: ExecJobListResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
1355
+ "system.open_url": { params: SystemOpenUrlParams, result: SystemOpenUrlResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1356
+ "system.open_path": { params: SystemOpenPathParams, result: SystemOpenPathResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1357
+ "system.notify": { params: SystemNotifyParams, result: SystemNotifyResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "INTERNAL"] },
1358
+ "screen.list": { params: ScreenListParams, result: ScreenListResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1359
+ "screen.capture": { params: ScreenCaptureParams, result: ScreenCaptureResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "PAYLOAD_TOO_LARGE", "INTERNAL"] },
1360
+ "window.list": { params: WindowListParams, result: WindowListResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1361
+ "window.focus": { params: WindowFocusParams, result: WindowFocusResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1362
+ "window.move": { params: WindowMoveParams, result: WindowMoveResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1363
+ "window.minimize": { params: WindowMinimizeParams, result: WindowMinimizeResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1364
+ "input.type_text": { params: InputTypeTextParams, result: InputTypeTextResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1365
+ "input.hotkey": { params: InputHotkeyParams, result: InputHotkeyResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1366
+ "input.mouse_move": { params: InputMouseMoveParams, result: InputMouseMoveResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1367
+ "input.mouse_click": { params: InputMouseClickParams, result: InputMouseClickResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1368
+ "power.status": { params: PowerStatusParams, result: PowerStatusResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
1369
+ "power.prevent_sleep": { params: PowerPreventSleepParams, result: PowerPreventSleepResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1370
+ "resources.snapshot": { params: ResourcesSnapshotParams, result: ResourcesSnapshotResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] }
945
1371
  };
946
1372
  var EVENTS = {
947
1373
  "fs.changed": FsChangedEvent,