@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/dist/client.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BackoffOptions } from '@ai-matrx/realtime';
2
2
  export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/realtime';
3
3
  import { z } from 'zod';
4
- import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-CxAHZMAM.cjs';
5
- export { i as isDesktopProtocolError } from './models-CxAHZMAM.cjs';
4
+ import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-iOvmEOHd.cjs';
5
+ export { i as isDesktopProtocolError } from './models-iOvmEOHd.cjs';
6
6
  import { FrameHeader } from './frame.cjs';
7
7
 
8
8
  /** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
package/dist/client.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BackoffOptions } from '@ai-matrx/realtime';
2
2
  export { RECONNECT_ALARM_ATTEMPTS } from '@ai-matrx/realtime';
3
3
  import { z } from 'zod';
4
- import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-CxAHZMAM.js';
5
- export { i as isDesktopProtocolError } from './models-CxAHZMAM.js';
4
+ import { W as Welcome, D as DesktopProtocolError, C as CloseOutcome, O as OpName, a as OpParams, b as OpResult, c as OPS, S as StreamMeta, E as EndReason, d as EVENTS, e as ClientType, M as ModelsTranscribeResult, T as TranscriptionModelId, f as MlProgress } from './models-iOvmEOHd.js';
5
+ export { i as isDesktopProtocolError } from './models-iOvmEOHd.js';
6
6
  import { FrameHeader } from './frame.js';
7
7
 
8
8
  /** The subset of the WHATWG WebSocket the client uses — browser, React Native, `ws` and Workers all fit. */
package/dist/client.js CHANGED
@@ -94,7 +94,7 @@ import { z as z2 } from "zod";
94
94
  // src/schema/primitives.ts
95
95
  import { z } from "zod";
96
96
  var PROTOCOL_MAJOR = 1;
97
- var PROTOCOL_MINOR = 2;
97
+ var PROTOCOL_MINOR = 4;
98
98
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
99
99
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
100
100
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -781,23 +781,421 @@ var RelayCallEnvelope = z10.strictObject({
781
781
  params: z10.unknown()
782
782
  });
783
783
 
784
- // src/schema/apps.ts
784
+ // src/schema/clipboard.ts
785
785
  import { z as z11 } from "zod";
786
- var AppKey = z11.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
787
- var AppProfileId = z11.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}$/);
788
- var AppProfileLocator = z11.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}$/);
789
- var AppSupport = z11.enum(["supported", "partial", "unsupported"]);
790
- var AppFeatureStatus = z11.strictObject({
786
+ var ClipboardReadParams = z11.strictObject({});
787
+ var ClipboardReadResult = z11.strictObject({
788
+ /** The clipboard's text ("" when it holds none), cut to 1 MiB. */
789
+ text: z11.string().max(1048576),
790
+ truncated: z11.boolean()
791
+ });
792
+ var ClipboardWriteParams = z11.strictObject({ text: z11.string().max(1048576) });
793
+ var ClipboardWriteResult = z11.strictObject({ bytes: nonNegInt });
794
+
795
+ // src/schema/proc.ts
796
+ import { z as z12 } from "zod";
797
+ var ProcSort = z12.enum(["cpu", "memory", "pid", "name"]);
798
+ var ProcListParams = z12.strictObject({
799
+ /** Case-insensitive substring of the process name or its command line. */
800
+ name: z12.string().min(1).max(128).optional(),
801
+ sort: ProcSort.default("cpu"),
802
+ limit: z12.int().min(1).max(500).default(50)
803
+ });
804
+ var ProcInfo = z12.strictObject({
805
+ pid: z12.int().min(0),
806
+ /** Parent process id; null where the OS does not report it. */
807
+ ppid: z12.int().min(0).nullable(),
808
+ name: z12.string().max(256),
809
+ /** The command line, cut to 1024 characters. */
810
+ command: z12.string().max(1024),
811
+ /** Share of one core, as `ps` and Task Manager report it; null where the OS does not say. */
812
+ cpu_percent: z12.number().min(0).nullable(),
813
+ memory_bytes: nonNegInt.nullable(),
814
+ user: z12.string().max(128).nullable()
815
+ });
816
+ var ProcListResult = z12.strictObject({
817
+ processes: z12.array(ProcInfo).max(500),
818
+ /** Processes that matched before `limit`. */
819
+ total: nonNegInt,
820
+ truncated: z12.boolean()
821
+ });
822
+ var ProcPortsParams = z12.strictObject({
823
+ /** Only this port. */
824
+ port: z12.int().min(1).max(65535).optional()
825
+ });
826
+ var ProcPort = z12.strictObject({
827
+ port: z12.int().min(1).max(65535),
828
+ protocol: z12.enum(["tcp", "udp"]),
829
+ /** The local address it listens on ("127.0.0.1", "*", "::"). */
830
+ address: z12.string().max(64),
831
+ pid: z12.int().min(0).nullable(),
832
+ process: z12.string().max(256).nullable()
833
+ });
834
+ var ProcPortsResult = z12.strictObject({ ports: z12.array(ProcPort).max(4e3) });
835
+ var ProcKillParams = z12.strictObject({
836
+ pid: z12.int().min(1),
837
+ /** Kill outright (SIGKILL; on Windows the same /F) instead of asking it to quit. */
838
+ force: z12.boolean().default(false)
839
+ });
840
+ var ProcKillResult = z12.strictObject({
841
+ pid: z12.int().min(1),
842
+ signal: z12.enum(["SIGTERM", "SIGKILL"]),
843
+ /** True when the process was gone within 3 s. */
844
+ exited: z12.boolean()
845
+ });
846
+
847
+ // src/schema/system.ts
848
+ import { z as z13 } from "zod";
849
+ var SystemOpenUrlParams = z13.strictObject({
850
+ /** http, https or mailto; opened in the person's default app for it. */
851
+ url: z13.string().min(1).max(4096)
852
+ });
853
+ var SystemOpenUrlResult = z13.strictObject({ url: z13.string().max(4096) });
854
+ var SystemOpenPathParams = z13.strictObject({
855
+ path: AbsPath,
856
+ /** Show it in the file manager (Finder, Explorer) instead of opening it. */
857
+ reveal: z13.boolean().default(false)
858
+ });
859
+ var SystemOpenPathResult = z13.strictObject({ path: AbsPath, revealed: z13.boolean() });
860
+ var SystemNotifyParams = z13.strictObject({
861
+ title: z13.string().min(1).max(128),
862
+ body: z13.string().max(1024).default("")
863
+ });
864
+ var SystemNotifyResult = z13.strictObject({
865
+ /** False when this computer has no notification service to show it (a bare Linux box). */
866
+ shown: z13.boolean()
867
+ });
868
+
869
+ // src/schema/screen.ts
870
+ import { z as z14 } from "zod";
871
+ var ScreenDisplay = z14.strictObject({
872
+ /** The OS's display id; pass it to screen.capture. */
873
+ id: nonNegInt,
874
+ name: z14.string().max(128),
875
+ /** Position and size in the OS's logical points (x and y may be negative left of or above the main display). */
876
+ x: z14.int(),
877
+ y: z14.int(),
878
+ width: z14.int().min(1),
879
+ height: z14.int().min(1),
880
+ /** Pixels per point (2 on a Retina display). */
881
+ scale: z14.number().min(0.1).max(8),
882
+ primary: z14.boolean()
883
+ });
884
+ var ScreenListParams = z14.strictObject({});
885
+ var ScreenListResult = z14.strictObject({ displays: z14.array(ScreenDisplay).max(32) });
886
+ var ScreenCaptureParams = z14.strictObject({
887
+ /** The display (from screen.list); the primary display when absent. */
888
+ display_id: nonNegInt.optional(),
889
+ format: z14.enum(["jpeg", "png"]).default("jpeg"),
890
+ /** Scale the picture down to at most this width in pixels (kept when already smaller). */
891
+ max_width: z14.int().min(160).max(7680).default(1600)
892
+ });
893
+ var ScreenCaptureResult = z14.strictObject({
894
+ display_id: nonNegInt,
895
+ mime_type: z14.enum(["image/jpeg", "image/png"]),
896
+ width: z14.int().min(1),
897
+ height: z14.int().min(1),
898
+ /** The display's full resolution in pixels, before scaling. */
899
+ source_width: z14.int().min(1),
900
+ source_height: z14.int().min(1),
901
+ /** The image, base64 (at most 6 MiB of text). */
902
+ data_base64: z14.string().max(6291456)
903
+ });
904
+
905
+ // src/schema/window.ts
906
+ import { z as z15 } from "zod";
907
+ var WindowInfo = z15.strictObject({
908
+ /** The OS's window handle (macOS window number, Windows HWND, X11 window id). */
909
+ id: nonNegInt,
910
+ title: z15.string().max(512),
911
+ /** Position and size in logical points. */
912
+ x: z15.int(),
913
+ y: z15.int(),
914
+ width: z15.int().min(0),
915
+ height: z15.int().min(0)
916
+ });
917
+ var WindowListParams = z15.strictObject({
918
+ /** Case-insensitive substring of the window title. */
919
+ title: z15.string().min(1).max(256).optional(),
920
+ limit: z15.int().min(1).max(500).default(100)
921
+ });
922
+ var WindowListResult = z15.strictObject({
923
+ windows: z15.array(WindowInfo).max(500),
924
+ total: nonNegInt,
925
+ truncated: z15.boolean()
926
+ });
927
+ var WindowFocusParams = z15.strictObject({ id: nonNegInt });
928
+ var WindowFocusResult = z15.strictObject({ window: WindowInfo });
929
+ var WindowMoveParams = z15.strictObject({
930
+ id: nonNegInt,
931
+ /** New top-left corner; unchanged when absent. */
932
+ x: z15.int().optional(),
933
+ y: z15.int().optional(),
934
+ /** New size; unchanged when absent. */
935
+ width: z15.int().min(50).max(16384).optional(),
936
+ height: z15.int().min(50).max(16384).optional()
937
+ });
938
+ var WindowMoveResult = z15.strictObject({ window: WindowInfo });
939
+ var WindowMinimizeParams = z15.strictObject({ id: nonNegInt });
940
+ var WindowMinimizeResult = z15.strictObject({ id: nonNegInt });
941
+
942
+ // src/schema/input.ts
943
+ import { z as z16 } from "zod";
944
+ var InputKey = z16.enum([
945
+ "cmd",
946
+ "ctrl",
947
+ "alt",
948
+ "shift",
949
+ "meta",
950
+ "a",
951
+ "b",
952
+ "c",
953
+ "d",
954
+ "e",
955
+ "f",
956
+ "g",
957
+ "h",
958
+ "i",
959
+ "j",
960
+ "k",
961
+ "l",
962
+ "m",
963
+ "n",
964
+ "o",
965
+ "p",
966
+ "q",
967
+ "r",
968
+ "s",
969
+ "t",
970
+ "u",
971
+ "v",
972
+ "w",
973
+ "x",
974
+ "y",
975
+ "z",
976
+ "0",
977
+ "1",
978
+ "2",
979
+ "3",
980
+ "4",
981
+ "5",
982
+ "6",
983
+ "7",
984
+ "8",
985
+ "9",
986
+ "f1",
987
+ "f2",
988
+ "f3",
989
+ "f4",
990
+ "f5",
991
+ "f6",
992
+ "f7",
993
+ "f8",
994
+ "f9",
995
+ "f10",
996
+ "f11",
997
+ "f12",
998
+ "enter",
999
+ "tab",
1000
+ "escape",
1001
+ "space",
1002
+ "backspace",
1003
+ "delete",
1004
+ "up",
1005
+ "down",
1006
+ "left",
1007
+ "right",
1008
+ "home",
1009
+ "end",
1010
+ "pageup",
1011
+ "pagedown",
1012
+ "minus",
1013
+ "equal",
1014
+ "comma",
1015
+ "period",
1016
+ "slash",
1017
+ "semicolon",
1018
+ "quote",
1019
+ "bracketleft",
1020
+ "bracketright",
1021
+ "backslash",
1022
+ "grave"
1023
+ ]);
1024
+ var InputTypeTextParams = z16.strictObject({ text: z16.string().min(1).max(1e4) });
1025
+ var InputTypeTextResult = z16.strictObject({ characters: z16.int().min(1) });
1026
+ var InputHotkeyParams = z16.strictObject({
1027
+ /** Pressed together in order and released in reverse: ["cmd", "shift", "t"]. */
1028
+ keys: z16.array(InputKey).min(1).max(6)
1029
+ });
1030
+ var InputHotkeyResult = z16.strictObject({ keys: z16.array(InputKey) });
1031
+ var InputPoint = z16.strictObject({ x: z16.int(), y: z16.int() });
1032
+ var InputMouseMoveParams = z16.strictObject({
1033
+ /** Screen position in logical points (the coordinates screen.list and window.list report). */
1034
+ x: z16.int(),
1035
+ y: z16.int()
1036
+ });
1037
+ var InputMouseMoveResult = z16.strictObject({
1038
+ /** Where the pointer is now, read back from the OS. */
1039
+ position: InputPoint
1040
+ });
1041
+ var InputMouseClickParams = z16.strictObject({
1042
+ /** Move here first; clicks where the pointer is when absent. */
1043
+ x: z16.int().optional(),
1044
+ y: z16.int().optional(),
1045
+ button: z16.enum(["left", "right", "middle"]).default("left"),
1046
+ double: z16.boolean().default(false)
1047
+ });
1048
+ var InputMouseClickResult = z16.strictObject({
1049
+ position: InputPoint,
1050
+ button: z16.enum(["left", "right", "middle"]),
1051
+ double: z16.boolean()
1052
+ });
1053
+
1054
+ // src/schema/power.ts
1055
+ import { z as z17 } from "zod";
1056
+ var PowerStatusParams = z17.strictObject({});
1057
+ var PowerStatusResult = z17.strictObject({
1058
+ has_battery: z17.boolean(),
1059
+ /** 0–100; null without a battery. */
1060
+ percent: z17.number().min(0).max(100).nullable(),
1061
+ charging: z17.boolean().nullable(),
1062
+ /** On wall power; null where the OS does not say. */
1063
+ plugged_in: z17.boolean().nullable(),
1064
+ /** Minutes of battery left; null when charging, unknown or without a battery. */
1065
+ minutes_left: nonNegInt.nullable(),
1066
+ /** Matrx 2 is keeping the computer awake (power.prevent_sleep) until this time; null when it is not. */
1067
+ awake_until_ms: epochMs.nullable()
1068
+ });
1069
+ var PowerPreventSleepParams = z17.strictObject({
1070
+ /** Keep the computer awake this long; 0 lets it sleep again now. */
1071
+ seconds: z17.int().min(0).max(86400),
1072
+ /** Shown where the OS lists what keeps it awake. */
1073
+ reason: z17.string().min(1).max(128).default("Matrx 2 is working")
1074
+ });
1075
+ var PowerPreventSleepResult = z17.strictObject({
1076
+ /** When it may sleep again; null after seconds 0. */
1077
+ awake_until_ms: epochMs.nullable()
1078
+ });
1079
+
1080
+ // src/schema/resources.ts
1081
+ import { z as z18 } from "zod";
1082
+ var ResourcesDisk = z18.strictObject({
1083
+ /** Where it is mounted ("/", "C:"). */
1084
+ mount: z18.string().max(512),
1085
+ /** The file system ("apfs", "NTFS", "ext4"). */
1086
+ fs: z18.string().max(64),
1087
+ size_bytes: nonNegInt,
1088
+ used_bytes: nonNegInt,
1089
+ available_bytes: nonNegInt
1090
+ });
1091
+ var ResourcesSnapshotParams = z18.strictObject({});
1092
+ var ResourcesSnapshotResult = z18.strictObject({
1093
+ cpu: z18.strictObject({
1094
+ /** Busy share of all cores, 0–100, measured now. */
1095
+ percent: z18.number().min(0).max(100),
1096
+ cores: z18.int().min(1),
1097
+ /** 1, 5 and 15 minute load averages; null on Windows. */
1098
+ load: z18.array(z18.number().min(0)).length(3).nullable()
1099
+ }),
1100
+ memory: z18.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt, available_bytes: nonNegInt }),
1101
+ swap: z18.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt }),
1102
+ disks: z18.array(ResourcesDisk).max(64),
1103
+ uptime_seconds: nonNegInt
1104
+ });
1105
+
1106
+ // src/schema/fs-watch.ts
1107
+ import { z as z19 } from "zod";
1108
+ var FsWatchId = z19.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
1109
+ var FsWatchStartParams = z19.strictObject({
1110
+ path: AbsPath,
1111
+ recursive: z19.boolean().default(true),
1112
+ /** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
1113
+ ignore: z19.array(z19.string().max(256)).max(64).default([])
1114
+ });
1115
+ var FsWatchStartResult = z19.strictObject({
1116
+ watch_id: FsWatchId,
1117
+ path: AbsPath,
1118
+ /** The watch ends by itself if nobody reads it for 30 minutes. */
1119
+ expires_at_ms: epochMs
1120
+ });
1121
+ var FsWatchEventsParams = z19.strictObject({
1122
+ watch_id: FsWatchId,
1123
+ /** Wait up to this long for a first change when none is waiting (0 answers at once). */
1124
+ wait_ms: z19.int().min(0).max(25e3).default(0)
1125
+ });
1126
+ var FsWatchEventsResult = z19.strictObject({
1127
+ /** What changed since the last read, oldest first; re-checked against the disk when read. */
1128
+ changes: z19.array(FsChange).max(1e3),
1129
+ /** Changes were dropped (more than 1000 waited): list the folder again. */
1130
+ overflow: z19.boolean(),
1131
+ expires_at_ms: epochMs
1132
+ });
1133
+ var FsWatchStopParams = z19.strictObject({ watch_id: FsWatchId });
1134
+ var FsWatchStopResult = z19.strictObject({ watch_id: FsWatchId });
1135
+
1136
+ // src/schema/exec-job.ts
1137
+ import { z as z20 } from "zod";
1138
+ var ExecJobId = z20.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
1139
+ var ExecJobStartParams = z20.strictObject({
1140
+ command: z20.string().min(1).max(131072),
1141
+ /** The folder it runs in; the home folder when absent. */
1142
+ cwd: AbsPath.optional(),
1143
+ env: z20.record(z20.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z20.string().max(32768)).optional()
1144
+ });
1145
+ var ExecJobStartResult = z20.strictObject({ job_id: ExecJobId, pid: z20.int().min(1), cwd: AbsPath });
1146
+ var ExecJobOutputParams = z20.strictObject({
1147
+ job_id: ExecJobId,
1148
+ /** Byte offset into the job's output to read from (next_offset of the last read; 0 = the start). */
1149
+ offset: nonNegInt.default(0),
1150
+ /** Wait up to this long for new output or the exit when none is waiting (0 answers at once). */
1151
+ wait_ms: z20.int().min(0).max(25e3).default(0),
1152
+ max_bytes: z20.int().min(1024).max(1048576).default(65536)
1153
+ });
1154
+ var ExecJobOutputResult = z20.strictObject({
1155
+ /** stdout and stderr interleaved as they arrived (UTF-8). */
1156
+ output: z20.string(),
1157
+ next_offset: nonNegInt,
1158
+ /** Bytes before `offset` that are gone (the job keeps its last 4 MiB). */
1159
+ dropped_bytes: nonNegInt,
1160
+ running: z20.boolean(),
1161
+ exit_code: z20.int().nullable()
1162
+ });
1163
+ var ExecJobStopParams = z20.strictObject({
1164
+ job_id: ExecJobId,
1165
+ /** End it at once (SIGKILL; on Windows the whole tree with /F) instead of asking it to quit. */
1166
+ force: z20.boolean().default(false)
1167
+ });
1168
+ var ExecJobStopResult = z20.strictObject({ job_id: ExecJobId, exited: z20.boolean(), exit_code: z20.int().nullable() });
1169
+ var ExecJobInfo = z20.strictObject({
1170
+ job_id: ExecJobId,
1171
+ command: z20.string().max(1024),
1172
+ pid: z20.int().min(1),
1173
+ cwd: AbsPath,
1174
+ running: z20.boolean(),
1175
+ exit_code: z20.int().nullable(),
1176
+ started_at_ms: epochMs,
1177
+ output_bytes: nonNegInt
1178
+ });
1179
+ var ExecJobListParams = z20.strictObject({});
1180
+ var ExecJobListResult = z20.strictObject({ jobs: z20.array(ExecJobInfo).max(64) });
1181
+
1182
+ // src/schema/apps.ts
1183
+ import { z as z21 } from "zod";
1184
+ var AppKey = z21.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
1185
+ var AppProfileId = z21.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}$/);
1186
+ var AppProfileLocator = z21.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}$/);
1187
+ var AppSupport = z21.enum(["supported", "partial", "unsupported"]);
1188
+ var AppFeatureStatus = z21.strictObject({
791
1189
  status: AppSupport,
792
1190
  /** One line, set whenever status is not "supported". */
793
- reason: z11.string().max(140).nullable()
1191
+ reason: z21.string().max(140).nullable()
794
1192
  });
795
- var AppInfo = z11.strictObject({
1193
+ var AppInfo = z21.strictObject({
796
1194
  app_key: AppKey,
797
- name: z11.string().max(64),
798
- installed: z11.boolean(),
1195
+ name: z21.string().max(64),
1196
+ installed: z21.boolean(),
799
1197
  /** The app's own version string, or null when it is not installed or does not say. */
800
- version: z11.string().max(64).nullable(),
1198
+ version: z21.string().max(64).nullable(),
801
1199
  /** The install found (an .app bundle, an .exe, a binary), or null. */
802
1200
  location: AbsPath.nullable(),
803
1201
  /** Open the app at all on this OS. */
@@ -807,69 +1205,69 @@ var AppInfo = z11.strictObject({
807
1205
  /** Plan usage read from the app's own files on this OS. */
808
1206
  usage: AppFeatureStatus
809
1207
  });
810
- var AppUsageReading = z11.strictObject({
811
- window: z11.enum(["five_hour", "weekly", "extra"]),
1208
+ var AppUsageReading = z21.strictObject({
1209
+ window: z21.enum(["five_hour", "weekly", "extra"]),
812
1210
  /** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
813
- percent: z11.number().min(0).max(1e4),
1211
+ percent: z21.number().min(0).max(1e4),
814
1212
  /** When the app recorded it. */
815
1213
  sampled_at_ms: epochMs,
816
1214
  /** True when the window has rolled over since the sample, so the figure has reset. */
817
- reset_since: z11.boolean()
1215
+ reset_since: z21.boolean()
818
1216
  });
819
- var AppProfile = z11.strictObject({
1217
+ var AppProfile = z21.strictObject({
820
1218
  /** The row's id; null for a folder found on disk that no row names yet. */
821
1219
  id: AppProfileId.nullable(),
822
1220
  app_key: AppKey,
823
- display_name: z11.string().min(1).max(120),
1221
+ display_name: z21.string().min(1).max(120),
824
1222
  /** The account the person means to be signed in here; null when not stated (never guessed). */
825
- account_identity: z11.string().min(3).max(320).nullable(),
1223
+ account_identity: z21.string().min(3).max(320).nullable(),
826
1224
  profile_locator: AppProfileLocator.nullable(),
827
1225
  /** The device the row is tied to; null when the row names none. */
828
1226
  device_id: DeviceId.nullable(),
829
1227
  /** The folder this profile resolves to on this device; null for a row tied to another device. */
830
1228
  folder: AbsPath.nullable(),
831
1229
  /** The folder exists on this device. */
832
- on_disk: z11.boolean(),
1230
+ on_disk: z21.boolean(),
833
1231
  /** An instance with this profile is running; null when it could not be determined. */
834
- running: z11.boolean().nullable(),
1232
+ running: z21.boolean().nullable(),
835
1233
  /** Usage the app recorded for this profile; null when the app exposes none here. */
836
- usage: z11.array(AppUsageReading).nullable(),
1234
+ usage: z21.array(AppUsageReading).nullable(),
837
1235
  last_opened_ms: epochMs.nullable()
838
1236
  });
839
- var AppsListParams = z11.strictObject({});
840
- var AppsListResult = z11.strictObject({ apps: z11.array(AppInfo) });
841
- var AppsProfilesListParams = z11.strictObject({
1237
+ var AppsListParams = z21.strictObject({});
1238
+ var AppsListResult = z21.strictObject({ apps: z21.array(AppInfo) });
1239
+ var AppsProfilesListParams = z21.strictObject({
842
1240
  /** Only this app's profiles; every app's when absent. */
843
1241
  app_key: AppKey.optional()
844
1242
  });
845
- var AppsProfilesListResult = z11.strictObject({
846
- profiles: z11.array(AppProfile),
1243
+ var AppsProfilesListResult = z21.strictObject({
1244
+ profiles: z21.array(AppProfile),
847
1245
  /**
848
1246
  * Whether the saved rows could be read: false while signed out or offline, when only folders
849
1247
  * found on disk are listed.
850
1248
  */
851
- registry: z11.enum(["ok", "signed_out", "unavailable"])
1249
+ registry: z21.enum(["ok", "signed_out", "unavailable"])
852
1250
  });
853
- var AppsProfilesSaveParams = z11.strictObject({
1251
+ var AppsProfilesSaveParams = z21.strictObject({
854
1252
  id: AppProfileId.optional(),
855
1253
  app_key: AppKey,
856
- display_name: z11.string().min(1).max(120),
857
- account_identity: z11.string().min(3).max(320).nullable(),
1254
+ display_name: z21.string().min(1).max(120),
1255
+ account_identity: z21.string().min(3).max(320).nullable(),
858
1256
  /** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
859
1257
  profile_locator: AppProfileLocator.nullable(),
860
1258
  /** On create with profile_locator null: make a new folder named after display_name instead. */
861
- new_folder: z11.boolean().default(false)
1259
+ new_folder: z21.boolean().default(false)
862
1260
  });
863
1261
  var AppsProfilesSaveResult = AppProfile;
864
- var AppsProfilesRemoveParams = z11.strictObject({ id: AppProfileId });
865
- var AppsProfilesRemoveResult = z11.strictObject({ removed: z11.boolean() });
866
- var AppsOpenParams = z11.strictObject({
1262
+ var AppsProfilesRemoveParams = z21.strictObject({ id: AppProfileId });
1263
+ var AppsProfilesRemoveResult = z21.strictObject({ removed: z21.boolean() });
1264
+ var AppsOpenParams = z21.strictObject({
867
1265
  app_key: AppKey,
868
1266
  profile_id: AppProfileId.optional()
869
1267
  });
870
- var AppsOpenResult = z11.strictObject({
1268
+ var AppsOpenResult = z21.strictObject({
871
1269
  /** True when an instance with this profile was already running; it is brought forward. */
872
- already_running: z11.boolean(),
1270
+ already_running: z21.boolean(),
873
1271
  folder: AbsPath.nullable()
874
1272
  });
875
1273
 
@@ -909,7 +1307,35 @@ var OPS = {
909
1307
  "apps.profiles.list": { params: AppsProfilesListParams, result: AppsProfilesListResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "INVALID_PARAMS", "INTERNAL"] },
910
1308
  "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"] },
911
1309
  "apps.profiles.remove": { params: AppsProfilesRemoveParams, result: AppsProfilesRemoveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "DEVICE_OFFLINE", "INTERNAL"] },
912
- "apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] }
1310
+ "apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] },
1311
+ "proc.list": { params: ProcListParams, result: ProcListResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1312
+ "proc.ports": { params: ProcPortsParams, result: ProcPortsResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1313
+ "proc.kill": { params: ProcKillParams, result: ProcKillResult, kind: "unary", since: "1.3", errors: ["NOT_FOUND", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "INTERNAL"] },
1314
+ "clipboard.read": { params: ClipboardReadParams, result: ClipboardReadResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
1315
+ "clipboard.write": { params: ClipboardWriteParams, result: ClipboardWriteResult, kind: "unary", since: "1.3", errors: ["PLATFORM_UNSUPPORTED", "PAYLOAD_TOO_LARGE", "INTERNAL"] },
1316
+ "fs.watch.start": { params: FsWatchStartParams, result: FsWatchStartResult, kind: "unary", since: "1.4", errors: [...FS_ERR, "RATE_LIMITED"] },
1317
+ "fs.watch.events": { params: FsWatchEventsParams, result: FsWatchEventsResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS", "INTERNAL"] },
1318
+ "fs.watch.stop": { params: FsWatchStopParams, result: FsWatchStopResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS"] },
1319
+ "exec.job.start": { params: ExecJobStartParams, result: ExecJobStartResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "NOT_FOUND", "RATE_LIMITED", "INTERNAL"] },
1320
+ "exec.job.output": { params: ExecJobOutputParams, result: ExecJobOutputResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS"] },
1321
+ "exec.job.stop": { params: ExecJobStopParams, result: ExecJobStopResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS", "INTERNAL"] },
1322
+ "exec.job.list": { params: ExecJobListParams, result: ExecJobListResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
1323
+ "system.open_url": { params: SystemOpenUrlParams, result: SystemOpenUrlResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1324
+ "system.open_path": { params: SystemOpenPathParams, result: SystemOpenPathResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1325
+ "system.notify": { params: SystemNotifyParams, result: SystemNotifyResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "INTERNAL"] },
1326
+ "screen.list": { params: ScreenListParams, result: ScreenListResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1327
+ "screen.capture": { params: ScreenCaptureParams, result: ScreenCaptureResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "PAYLOAD_TOO_LARGE", "INTERNAL"] },
1328
+ "window.list": { params: WindowListParams, result: WindowListResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1329
+ "window.focus": { params: WindowFocusParams, result: WindowFocusResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1330
+ "window.move": { params: WindowMoveParams, result: WindowMoveResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1331
+ "window.minimize": { params: WindowMinimizeParams, result: WindowMinimizeResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1332
+ "input.type_text": { params: InputTypeTextParams, result: InputTypeTextResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1333
+ "input.hotkey": { params: InputHotkeyParams, result: InputHotkeyResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1334
+ "input.mouse_move": { params: InputMouseMoveParams, result: InputMouseMoveResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1335
+ "input.mouse_click": { params: InputMouseClickParams, result: InputMouseClickResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1336
+ "power.status": { params: PowerStatusParams, result: PowerStatusResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
1337
+ "power.prevent_sleep": { params: PowerPreventSleepParams, result: PowerPreventSleepResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1338
+ "resources.snapshot": { params: ResourcesSnapshotParams, result: ResourcesSnapshotResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] }
913
1339
  };
914
1340
  var EVENTS = {
915
1341
  "fs.changed": FsChangedEvent,