@ai-matrx/desktop-protocol 0.17.3 → 0.17.5

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/schema/primitives.ts
2
2
  import { z } from "zod";
3
3
  var PROTOCOL_MAJOR = 1;
4
- var PROTOCOL_MINOR = 7;
4
+ var PROTOCOL_MINOR = 9;
5
5
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
6
6
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
7
7
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -891,250 +891,394 @@ var AppsOpenResult = z11.strictObject({
891
891
  folder: AbsPath.nullable()
892
892
  });
893
893
 
894
- // src/schema/service.ts
894
+ // src/schema/apps-chats.ts
895
895
  import { z as z12 } from "zod";
896
+ var ChatId = z12.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/);
897
+ var ChatPlace = z12.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/);
898
+ var ChatProjectId = z12.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
899
+ var ChatWindow = z12.strictObject({
900
+ key: ChatPlace,
901
+ /** The app's default profile (Claude: the main window, which lists every account's chats). */
902
+ main: z12.boolean(),
903
+ /** The account the window is signed into, when known. */
904
+ account: z12.string().max(320).nullable()
905
+ });
906
+ var ChatProject = z12.strictObject({
907
+ id: ChatProjectId,
908
+ name: z12.string().min(1).max(200),
909
+ archived: z12.boolean(),
910
+ /** Chats in it. */
911
+ count: nonNegInt
912
+ });
913
+ var ChatPin = z12.strictObject({
914
+ /** The window whose account pins it; an account with no window of its own is named by its email. */
915
+ window: z12.string().min(1).max(320),
916
+ /** When that account's pin list was last read; null when the reading has no time. */
917
+ observed_at_ms: epochMs.nullable()
918
+ });
919
+ var ChatRunning = z12.strictObject({
920
+ window: ChatPlace,
921
+ /** process: a live process resumed this chat there (exact); activity: that window's own record moved in the last 3 minutes. */
922
+ how: z12.enum(["process", "activity"])
923
+ });
924
+ var ChatHidden = z12.strictObject({
925
+ window: ChatPlace,
926
+ reason: z12.string().max(200)
927
+ });
928
+ var ChatLastUse = z12.strictObject({
929
+ /** The conversation's last reply. */
930
+ at_ms: epochMs,
931
+ window: ChatPlace.nullable(),
932
+ account: z12.string().max(320).nullable(),
933
+ /** How the window was decided (one short line). */
934
+ how: z12.string().max(120).nullable(),
935
+ /** The account's 1-hour prompt cache is still warm. */
936
+ cache_warm: z12.boolean(),
937
+ cache_minutes_left: nonNegInt
938
+ });
939
+ var ChatRow = z12.strictObject({
940
+ id: ChatId,
941
+ /** The short id people see (the listing's first 8 characters). */
942
+ short_id: z12.string().max(16),
943
+ /** The listing's own name (Claude: local_<id>), null for a chat only in the holder. */
944
+ record: z12.string().max(160).nullable(),
945
+ title: z12.string().max(1e3),
946
+ last_active_ms: epochMs.nullable(),
947
+ created_ms: epochMs.nullable(),
948
+ projects: z12.array(ChatProjectId).max(500),
949
+ starred: z12.boolean(),
950
+ pinned_in: z12.array(ChatPin).max(200),
951
+ /** Every place it is listed now: window keys, plus "holder". */
952
+ places: z12.array(ChatPlace).max(200),
953
+ held: z12.boolean(),
954
+ running: z12.array(ChatRunning).max(200),
955
+ hidden_in: z12.array(ChatHidden).max(200),
956
+ /** Kept out of the main window on purpose. */
957
+ hidden_from_main: z12.boolean(),
958
+ /** Listed in a side window and not yet copied into main. */
959
+ main_pending: z12.boolean(),
960
+ /** A scheduled routine's run (its task id). */
961
+ scheduled: z12.string().max(200).nullable(),
962
+ /** Created recently and in no project: offered for filing. */
963
+ new_unfiled: z12.boolean(),
964
+ warnings: z12.array(z12.string().max(400)).max(20),
965
+ last_use: ChatLastUse.nullable()
966
+ });
967
+ var AppsChatsListParams = z12.strictObject({
968
+ app_key: AppKey,
969
+ /** Only these chats (a live update re-reads just what changed). */
970
+ ids: z12.array(ChatId).max(500).optional()
971
+ });
972
+ var AppsChatsListResult = z12.strictObject({
973
+ app_key: AppKey,
974
+ /** Bumps on every change the index sees; `apps.chats.changed` carries the same number. */
975
+ version: nonNegInt,
976
+ windows: z12.array(ChatWindow).max(200),
977
+ projects: z12.array(ChatProject).max(5e3),
978
+ chats: z12.array(ChatRow).max(2e4),
979
+ /** How long a chat in no project counts as new. */
980
+ new_window_ms: nonNegInt,
981
+ /** 1.9: this is the copy saved at the last read, shown while everything is read again. */
982
+ updating: z12.boolean().optional(),
983
+ /** 1.9: false while the folder watches are down (changes are not arriving); `apps.chats.watch_state` says when it changes. */
984
+ live: z12.boolean().optional()
985
+ });
986
+ var AppsChatsWatchParams = z12.strictObject({ app_key: AppKey });
987
+ var AppsChatsWatchResult = z12.strictObject({ resource_id: ResourceId, version: nonNegInt });
988
+ var AppsChatsChangedEvent = z12.strictObject({
989
+ app_key: AppKey,
990
+ version: nonNegInt,
991
+ ids: z12.array(ChatId).max(1e3),
992
+ all: z12.boolean()
993
+ });
994
+ var AppsChatsWatchStateEvent = z12.strictObject({
995
+ app_key: AppKey,
996
+ live: z12.boolean(),
997
+ updating: z12.boolean(),
998
+ reason: z12.string().max(300).nullable()
999
+ });
1000
+ var AppsChatsPlaceParams = z12.strictObject({
1001
+ app_key: AppKey,
1002
+ chat_id: ChatId,
1003
+ action: z12.enum(["place", "take_off", "hold"]),
1004
+ /** The window (for place and take_off). */
1005
+ window: ChatPlace.optional(),
1006
+ /** take_off where it is open: stop it there first (the person confirmed). */
1007
+ stop_if_open: z12.boolean().default(false)
1008
+ });
1009
+ var AppsChatsPlaceResult = z12.strictObject({ chat: ChatRow, message: z12.string().max(400) });
1010
+ var AppsProjectsFileManyParams = z12.strictObject({
1011
+ app_key: AppKey,
1012
+ chat_ids: z12.array(ChatId).min(1).max(500),
1013
+ project_id: ChatProjectId.optional(),
1014
+ new_project_name: z12.string().min(1).max(200).optional()
1015
+ });
1016
+ var AppsProjectsFileManyResult = z12.strictObject({ chats: z12.array(ChatRow).max(500), project: ChatProject });
1017
+ var AppsProjectsUpdateParams = z12.strictObject({
1018
+ app_key: AppKey,
1019
+ project_id: ChatProjectId,
1020
+ name: z12.string().min(1).max(200).optional(),
1021
+ archived: z12.boolean().optional()
1022
+ });
1023
+ var AppsProjectsUpdateResult = z12.strictObject({ project: ChatProject });
1024
+ var AppsProjectsCopyParams = z12.strictObject({ app_key: AppKey, project_id: ChatProjectId, new_project_name: z12.string().min(1).max(200) });
1025
+ var AppsProjectsCopyResult = z12.strictObject({ project: ChatProject });
1026
+ var AppsProjectsFileParams = z12.strictObject({
1027
+ app_key: AppKey,
1028
+ chat_id: ChatId,
1029
+ project_id: ChatProjectId.optional(),
1030
+ new_project_name: z12.string().min(1).max(200).optional()
1031
+ });
1032
+ var AppsProjectsFileResult = z12.strictObject({ chat: ChatRow, project: ChatProject });
1033
+ var AppsProjectsUnfileParams = z12.strictObject({ app_key: AppKey, chat_id: ChatId, project_id: ChatProjectId });
1034
+ var AppsProjectsUnfileResult = z12.strictObject({ chat: ChatRow });
1035
+ var AppsChatsStarParams = z12.strictObject({ app_key: AppKey, chat_id: ChatId, starred: z12.boolean() });
1036
+ var AppsChatsStarResult = z12.strictObject({ chat: ChatRow });
1037
+
1038
+ // src/schema/service.ts
1039
+ import { z as z13 } from "zod";
896
1040
  var SERVICE_MAX_FRAME_BYTES = 16777216;
897
- var ServiceName = z12.enum(["ml", "coding"]);
898
- var ContractHash = z12.string().regex(/^[0-9a-f]{64}$/);
899
- var ServiceToken = z12.string().regex(/^[A-Za-z0-9_-]{43}$/);
1041
+ var ServiceName = z13.enum(["ml", "coding"]);
1042
+ var ContractHash = z13.string().regex(/^[0-9a-f]{64}$/);
1043
+ var ServiceToken = z13.string().regex(/^[A-Za-z0-9_-]{43}$/);
900
1044
  var ServiceRequestId = u32;
901
- var ServiceHello = z12.strictObject({ type: z12.literal("hello"), token: ServiceToken, contract: ContractHash });
902
- var ServiceWelcome = z12.strictObject({
903
- type: z12.literal("welcome"),
1045
+ var ServiceHello = z13.strictObject({ type: z13.literal("hello"), token: ServiceToken, contract: ContractHash });
1046
+ var ServiceWelcome = z13.strictObject({
1047
+ type: z13.literal("welcome"),
904
1048
  service: ServiceName,
905
1049
  contract: ContractHash,
906
1050
  pid: nonNegInt,
907
1051
  /** The interpreter's version, e.g. "3.13.15". */
908
- python: z12.string().max(32),
1052
+ python: z13.string().max(32),
909
1053
  /** Every op this service serves; must equal SERVICES[service] exactly. */
910
- ops: z12.array(z12.string().min(1).max(64)).max(64)
1054
+ ops: z13.array(z13.string().min(1).max(64)).max(64)
911
1055
  });
912
- var ServiceRequest = z12.strictObject({
913
- type: z12.literal("request"),
1056
+ var ServiceRequest = z13.strictObject({
1057
+ type: z13.literal("request"),
914
1058
  id: ServiceRequestId,
915
- op: z12.string().min(1).max(64),
916
- params: z12.unknown()
1059
+ op: z13.string().min(1).max(64),
1060
+ params: z13.unknown()
917
1061
  // validated by the service against SERVICES[service][op].params
918
1062
  });
919
- var ServiceResponse = z12.strictObject({
920
- type: z12.literal("response"),
1063
+ var ServiceResponse = z13.strictObject({
1064
+ type: z13.literal("response"),
921
1065
  id: ServiceRequestId,
922
- result: z12.unknown()
1066
+ result: z13.unknown()
923
1067
  // validated by the core against SERVICES[service][op].result
924
1068
  });
925
- var ServiceErrorMsg = z12.strictObject({ type: z12.literal("error"), id: ServiceRequestId, error: ProtocolErrorBody });
926
- var ServiceProgressMsg = z12.strictObject({ type: z12.literal("progress"), id: ServiceRequestId, progress: z12.unknown() });
927
- var ServiceCancel = z12.strictObject({ type: z12.literal("cancel"), id: ServiceRequestId });
928
- var ServicePing = z12.strictObject({ type: z12.literal("ping"), id: ServiceRequestId });
929
- var ServicePong = z12.strictObject({
930
- type: z12.literal("pong"),
1069
+ var ServiceErrorMsg = z13.strictObject({ type: z13.literal("error"), id: ServiceRequestId, error: ProtocolErrorBody });
1070
+ var ServiceProgressMsg = z13.strictObject({ type: z13.literal("progress"), id: ServiceRequestId, progress: z13.unknown() });
1071
+ var ServiceCancel = z13.strictObject({ type: z13.literal("cancel"), id: ServiceRequestId });
1072
+ var ServicePing = z13.strictObject({ type: z13.literal("ping"), id: ServiceRequestId });
1073
+ var ServicePong = z13.strictObject({
1074
+ type: z13.literal("pong"),
931
1075
  id: ServiceRequestId,
932
1076
  /** Requests running now. */
933
1077
  busy: nonNegInt
934
1078
  });
935
- var ServiceShutdown = z12.strictObject({ type: z12.literal("shutdown") });
936
- var CoreToServiceMsg = z12.discriminatedUnion("type", [ServiceHello, ServiceRequest, ServiceCancel, ServicePing, ServiceShutdown]);
937
- var ServiceToCoreMsg = z12.discriminatedUnion("type", [ServiceWelcome, ServiceResponse, ServiceErrorMsg, ServiceProgressMsg, ServicePong]);
1079
+ var ServiceShutdown = z13.strictObject({ type: z13.literal("shutdown") });
1080
+ var CoreToServiceMsg = z13.discriminatedUnion("type", [ServiceHello, ServiceRequest, ServiceCancel, ServicePing, ServiceShutdown]);
1081
+ var ServiceToCoreMsg = z13.discriminatedUnion("type", [ServiceWelcome, ServiceResponse, ServiceErrorMsg, ServiceProgressMsg, ServicePong]);
938
1082
 
939
1083
  // src/schema/tools.ts
940
- import { z as z13 } from "zod";
941
- var ToolLevel = z13.enum(["programmatic", "protocol", "chat"]);
942
- var ToolOutcome = z13.enum(["pass", "fail", "skip"]);
943
- var ToolPlatform = z13.enum(["darwin", "win32", "linux"]);
944
- var ToolTransport = z13.enum(["in_process", "localhost", "relay", "agent"]);
945
- var ToolName = z13.string().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/);
946
- var ToolLevelResult = z13.strictObject({
1084
+ import { z as z14 } from "zod";
1085
+ var ToolLevel = z14.enum(["programmatic", "protocol", "chat"]);
1086
+ var ToolOutcome = z14.enum(["pass", "fail", "skip"]);
1087
+ var ToolPlatform = z14.enum(["darwin", "win32", "linux"]);
1088
+ var ToolTransport = z14.enum(["in_process", "localhost", "relay", "agent"]);
1089
+ var ToolName = z14.string().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/);
1090
+ var ToolLevelResult = z14.strictObject({
947
1091
  tool: ToolName,
948
1092
  level: ToolLevel,
949
1093
  platform: ToolPlatform,
950
1094
  transport: ToolTransport,
951
1095
  outcome: ToolOutcome,
952
1096
  /** True when the caller sat on a different network from the device (a phone on cellular, CI). */
953
- remote_network: z13.boolean(),
1097
+ remote_network: z14.boolean(),
954
1098
  /** One line: what was asserted, or why it failed. Never a token, a file's contents or a path under a real home. */
955
- detail: z13.string().max(500),
1099
+ detail: z14.string().max(500),
956
1100
  /** The harness that produced it, e.g. `matrx-desktop test/tools/programmatic.test.ts`. */
957
- suite: z13.string().min(1).max(200),
1101
+ suite: z14.string().min(1).max(200),
958
1102
  /** The test case inside the suite. */
959
- test: z13.string().min(1).max(300),
960
- run_at_ms: z13.int().min(0)
1103
+ test: z14.string().min(1).max(300),
1104
+ run_at_ms: z14.int().min(0)
961
1105
  });
962
- var ToolResultsFile = z13.strictObject({
963
- schema: z13.literal("matrx.tool-results.v1"),
1106
+ var ToolResultsFile = z14.strictObject({
1107
+ schema: z14.literal("matrx.tool-results.v1"),
964
1108
  /** The producing repo's commit (short or full SHA). */
965
- commit: z13.string().min(4).max(64),
966
- results: z13.array(ToolLevelResult).max(1e4)
1109
+ commit: z14.string().min(4).max(64),
1110
+ results: z14.array(ToolLevelResult).max(1e4)
967
1111
  });
968
1112
 
969
1113
  // src/schema/proc.ts
970
- import { z as z14 } from "zod";
971
- var ProcSort = z14.enum(["cpu", "memory", "pid", "name"]);
972
- var ProcListParams = z14.strictObject({
1114
+ import { z as z15 } from "zod";
1115
+ var ProcSort = z15.enum(["cpu", "memory", "pid", "name"]);
1116
+ var ProcListParams = z15.strictObject({
973
1117
  /** Case-insensitive substring of the process name or its command line. */
974
- name: z14.string().min(1).max(128).optional(),
1118
+ name: z15.string().min(1).max(128).optional(),
975
1119
  sort: ProcSort.default("cpu"),
976
- limit: z14.int().min(1).max(500).default(50)
1120
+ limit: z15.int().min(1).max(500).default(50)
977
1121
  });
978
- var ProcInfo = z14.strictObject({
979
- pid: z14.int().min(0),
1122
+ var ProcInfo = z15.strictObject({
1123
+ pid: z15.int().min(0),
980
1124
  /** Parent process id; null where the OS does not report it. */
981
- ppid: z14.int().min(0).nullable(),
982
- name: z14.string().max(256),
1125
+ ppid: z15.int().min(0).nullable(),
1126
+ name: z15.string().max(256),
983
1127
  /** The command line, cut to 1024 characters. */
984
- command: z14.string().max(1024),
1128
+ command: z15.string().max(1024),
985
1129
  /** Share of one core, as `ps` and Task Manager report it; null where the OS does not say. */
986
- cpu_percent: z14.number().min(0).nullable(),
1130
+ cpu_percent: z15.number().min(0).nullable(),
987
1131
  memory_bytes: nonNegInt.nullable(),
988
- user: z14.string().max(128).nullable()
1132
+ user: z15.string().max(128).nullable()
989
1133
  });
990
- var ProcListResult = z14.strictObject({
991
- processes: z14.array(ProcInfo).max(500),
1134
+ var ProcListResult = z15.strictObject({
1135
+ processes: z15.array(ProcInfo).max(500),
992
1136
  /** Processes that matched before `limit`. */
993
1137
  total: nonNegInt,
994
- truncated: z14.boolean()
1138
+ truncated: z15.boolean()
995
1139
  });
996
- var ProcPortsParams = z14.strictObject({
1140
+ var ProcPortsParams = z15.strictObject({
997
1141
  /** Only this port. */
998
- port: z14.int().min(1).max(65535).optional()
1142
+ port: z15.int().min(1).max(65535).optional()
999
1143
  });
1000
- var ProcPort = z14.strictObject({
1001
- port: z14.int().min(1).max(65535),
1002
- protocol: z14.enum(["tcp", "udp"]),
1144
+ var ProcPort = z15.strictObject({
1145
+ port: z15.int().min(1).max(65535),
1146
+ protocol: z15.enum(["tcp", "udp"]),
1003
1147
  /** The local address it listens on ("127.0.0.1", "*", "::"). */
1004
- address: z14.string().max(64),
1005
- pid: z14.int().min(0).nullable(),
1006
- process: z14.string().max(256).nullable()
1148
+ address: z15.string().max(64),
1149
+ pid: z15.int().min(0).nullable(),
1150
+ process: z15.string().max(256).nullable()
1007
1151
  });
1008
- var ProcPortsResult = z14.strictObject({ ports: z14.array(ProcPort).max(4e3) });
1009
- var ProcKillParams = z14.strictObject({
1010
- pid: z14.int().min(1),
1152
+ var ProcPortsResult = z15.strictObject({ ports: z15.array(ProcPort).max(4e3) });
1153
+ var ProcKillParams = z15.strictObject({
1154
+ pid: z15.int().min(1),
1011
1155
  /** Kill outright (SIGKILL; on Windows the same /F) instead of asking it to quit. */
1012
- force: z14.boolean().default(false)
1156
+ force: z15.boolean().default(false)
1013
1157
  });
1014
- var ProcKillResult = z14.strictObject({
1015
- pid: z14.int().min(1),
1016
- signal: z14.enum(["SIGTERM", "SIGKILL"]),
1158
+ var ProcKillResult = z15.strictObject({
1159
+ pid: z15.int().min(1),
1160
+ signal: z15.enum(["SIGTERM", "SIGKILL"]),
1017
1161
  /** True when the process was gone within 3 s. */
1018
- exited: z14.boolean()
1162
+ exited: z15.boolean()
1019
1163
  });
1020
1164
 
1021
1165
  // src/schema/clipboard.ts
1022
- import { z as z15 } from "zod";
1023
- var ClipboardReadParams = z15.strictObject({});
1024
- var ClipboardReadResult = z15.strictObject({
1166
+ import { z as z16 } from "zod";
1167
+ var ClipboardReadParams = z16.strictObject({});
1168
+ var ClipboardReadResult = z16.strictObject({
1025
1169
  /** The clipboard's text ("" when it holds none), cut to 1 MiB. */
1026
- text: z15.string().max(1048576),
1027
- truncated: z15.boolean()
1170
+ text: z16.string().max(1048576),
1171
+ truncated: z16.boolean()
1028
1172
  });
1029
- var ClipboardWriteParams = z15.strictObject({ text: z15.string().max(1048576) });
1030
- var ClipboardWriteResult = z15.strictObject({ bytes: nonNegInt });
1173
+ var ClipboardWriteParams = z16.strictObject({ text: z16.string().max(1048576) });
1174
+ var ClipboardWriteResult = z16.strictObject({ bytes: nonNegInt });
1031
1175
 
1032
1176
  // src/schema/system.ts
1033
- import { z as z16 } from "zod";
1034
- var SystemOpenUrlParams = z16.strictObject({
1177
+ import { z as z17 } from "zod";
1178
+ var SystemOpenUrlParams = z17.strictObject({
1035
1179
  /** http, https or mailto; opened in the person's default app for it. */
1036
- url: z16.string().min(1).max(4096)
1180
+ url: z17.string().min(1).max(4096)
1037
1181
  });
1038
- var SystemOpenUrlResult = z16.strictObject({ url: z16.string().max(4096) });
1039
- var SystemOpenPathParams = z16.strictObject({
1182
+ var SystemOpenUrlResult = z17.strictObject({ url: z17.string().max(4096) });
1183
+ var SystemOpenPathParams = z17.strictObject({
1040
1184
  path: AbsPath,
1041
1185
  /** Show it in the file manager (Finder, Explorer) instead of opening it. */
1042
- reveal: z16.boolean().default(false)
1186
+ reveal: z17.boolean().default(false)
1043
1187
  });
1044
- var SystemOpenPathResult = z16.strictObject({ path: AbsPath, revealed: z16.boolean() });
1045
- var SystemNotifyParams = z16.strictObject({
1046
- title: z16.string().min(1).max(128),
1047
- body: z16.string().max(1024).default("")
1188
+ var SystemOpenPathResult = z17.strictObject({ path: AbsPath, revealed: z17.boolean() });
1189
+ var SystemNotifyParams = z17.strictObject({
1190
+ title: z17.string().min(1).max(128),
1191
+ body: z17.string().max(1024).default("")
1048
1192
  });
1049
- var SystemNotifyResult = z16.strictObject({
1193
+ var SystemNotifyResult = z17.strictObject({
1050
1194
  /** False when this computer has no notification service to show it (a bare Linux box). */
1051
- shown: z16.boolean()
1195
+ shown: z17.boolean()
1052
1196
  });
1053
1197
 
1054
1198
  // src/schema/screen.ts
1055
- import { z as z17 } from "zod";
1056
- var ScreenDisplay = z17.strictObject({
1199
+ import { z as z18 } from "zod";
1200
+ var ScreenDisplay = z18.strictObject({
1057
1201
  /** The OS's display id; pass it to screen.capture. */
1058
1202
  id: nonNegInt,
1059
- name: z17.string().max(128),
1203
+ name: z18.string().max(128),
1060
1204
  /** Position and size in the OS's logical points (x and y may be negative left of or above the main display). */
1061
- x: z17.int(),
1062
- y: z17.int(),
1063
- width: z17.int().min(1),
1064
- height: z17.int().min(1),
1205
+ x: z18.int(),
1206
+ y: z18.int(),
1207
+ width: z18.int().min(1),
1208
+ height: z18.int().min(1),
1065
1209
  /** Pixels per point (2 on a Retina display). */
1066
- scale: z17.number().min(0.1).max(8),
1067
- primary: z17.boolean()
1210
+ scale: z18.number().min(0.1).max(8),
1211
+ primary: z18.boolean()
1068
1212
  });
1069
- var ScreenListParams = z17.strictObject({});
1070
- var ScreenListResult = z17.strictObject({ displays: z17.array(ScreenDisplay).max(32) });
1071
- var ScreenCaptureParams = z17.strictObject({
1213
+ var ScreenListParams = z18.strictObject({});
1214
+ var ScreenListResult = z18.strictObject({ displays: z18.array(ScreenDisplay).max(32) });
1215
+ var ScreenCaptureParams = z18.strictObject({
1072
1216
  /** The display (from screen.list); the primary display when absent. */
1073
1217
  display_id: nonNegInt.optional(),
1074
- format: z17.enum(["jpeg", "png"]).default("jpeg"),
1218
+ format: z18.enum(["jpeg", "png"]).default("jpeg"),
1075
1219
  /** Scale the picture down to at most this width in pixels (kept when already smaller). */
1076
- max_width: z17.int().min(160).max(7680).default(1600)
1220
+ max_width: z18.int().min(160).max(7680).default(1600)
1077
1221
  });
1078
- var ScreenCaptureResult = z17.strictObject({
1222
+ var ScreenCaptureResult = z18.strictObject({
1079
1223
  display_id: nonNegInt,
1080
- mime_type: z17.enum(["image/jpeg", "image/png"]),
1081
- width: z17.int().min(1),
1082
- height: z17.int().min(1),
1224
+ mime_type: z18.enum(["image/jpeg", "image/png"]),
1225
+ width: z18.int().min(1),
1226
+ height: z18.int().min(1),
1083
1227
  /** The display's full resolution in pixels, before scaling. */
1084
- source_width: z17.int().min(1),
1085
- source_height: z17.int().min(1),
1228
+ source_width: z18.int().min(1),
1229
+ source_height: z18.int().min(1),
1086
1230
  /** The image, base64 (at most 6 MiB of text). */
1087
- data_base64: z17.string().max(6291456)
1231
+ data_base64: z18.string().max(6291456)
1088
1232
  });
1089
1233
 
1090
1234
  // src/schema/window.ts
1091
- import { z as z18 } from "zod";
1092
- var WindowInfo = z18.strictObject({
1235
+ import { z as z19 } from "zod";
1236
+ var WindowInfo = z19.strictObject({
1093
1237
  /** The OS's window handle (macOS window number, Windows HWND, X11 window id). */
1094
1238
  id: nonNegInt,
1095
- title: z18.string().max(512),
1239
+ title: z19.string().max(512),
1096
1240
  /** Position and size in logical points. */
1097
- x: z18.int(),
1098
- y: z18.int(),
1099
- width: z18.int().min(0),
1100
- height: z18.int().min(0),
1241
+ x: z19.int(),
1242
+ y: z19.int(),
1243
+ width: z19.int().min(0),
1244
+ height: z19.int().min(0),
1101
1245
  /**
1102
1246
  * The application that owns the window, by the name the OS shows people; absent when the OS does
1103
1247
  * not say. Optional (never null, the schema rule) because it was added in protocol 1.7: an older
1104
1248
  * app's answer has no such field (FIELDS_SINCE).
1105
1249
  */
1106
- app: z18.string().max(256).optional(),
1250
+ app: z19.string().max(256).optional(),
1107
1251
  /** The owning process id; absent when the OS does not say. Added in protocol 1.7. */
1108
- pid: z18.int().min(0).optional()
1252
+ pid: z19.int().min(0).optional()
1109
1253
  });
1110
- var WindowListParams = z18.strictObject({
1254
+ var WindowListParams = z19.strictObject({
1111
1255
  /** Case-insensitive substring of the window title. */
1112
- title: z18.string().min(1).max(256).optional(),
1113
- limit: z18.int().min(1).max(500).default(100)
1256
+ title: z19.string().min(1).max(256).optional(),
1257
+ limit: z19.int().min(1).max(500).default(100)
1114
1258
  });
1115
- var WindowListResult = z18.strictObject({
1116
- windows: z18.array(WindowInfo).max(500),
1259
+ var WindowListResult = z19.strictObject({
1260
+ windows: z19.array(WindowInfo).max(500),
1117
1261
  total: nonNegInt,
1118
- truncated: z18.boolean()
1262
+ truncated: z19.boolean()
1119
1263
  });
1120
- var WindowFocusParams = z18.strictObject({ id: nonNegInt });
1121
- var WindowFocusResult = z18.strictObject({ window: WindowInfo });
1122
- var WindowMoveParams = z18.strictObject({
1264
+ var WindowFocusParams = z19.strictObject({ id: nonNegInt });
1265
+ var WindowFocusResult = z19.strictObject({ window: WindowInfo });
1266
+ var WindowMoveParams = z19.strictObject({
1123
1267
  id: nonNegInt,
1124
1268
  /** New top-left corner; unchanged when absent. */
1125
- x: z18.int().optional(),
1126
- y: z18.int().optional(),
1269
+ x: z19.int().optional(),
1270
+ y: z19.int().optional(),
1127
1271
  /** New size; unchanged when absent. */
1128
- width: z18.int().min(50).max(16384).optional(),
1129
- height: z18.int().min(50).max(16384).optional()
1272
+ width: z19.int().min(50).max(16384).optional(),
1273
+ height: z19.int().min(50).max(16384).optional()
1130
1274
  });
1131
- var WindowMoveResult = z18.strictObject({ window: WindowInfo });
1132
- var WindowMinimizeParams = z18.strictObject({ id: nonNegInt });
1133
- var WindowMinimizeResult = z18.strictObject({ id: nonNegInt });
1275
+ var WindowMoveResult = z19.strictObject({ window: WindowInfo });
1276
+ var WindowMinimizeParams = z19.strictObject({ id: nonNegInt });
1277
+ var WindowMinimizeResult = z19.strictObject({ id: nonNegInt });
1134
1278
 
1135
1279
  // src/schema/input.ts
1136
- import { z as z19 } from "zod";
1137
- var InputKey = z19.enum([
1280
+ import { z as z20 } from "zod";
1281
+ var InputKey = z20.enum([
1138
1282
  "cmd",
1139
1283
  "ctrl",
1140
1284
  "alt",
@@ -1214,203 +1358,203 @@ var InputKey = z19.enum([
1214
1358
  "backslash",
1215
1359
  "grave"
1216
1360
  ]);
1217
- var InputTypeTextParams = z19.strictObject({ text: z19.string().min(1).max(1e4) });
1218
- var InputTypeTextResult = z19.strictObject({ characters: z19.int().min(1) });
1219
- var InputHotkeyParams = z19.strictObject({
1361
+ var InputTypeTextParams = z20.strictObject({ text: z20.string().min(1).max(1e4) });
1362
+ var InputTypeTextResult = z20.strictObject({ characters: z20.int().min(1) });
1363
+ var InputHotkeyParams = z20.strictObject({
1220
1364
  /** Pressed together in order and released in reverse: ["cmd", "shift", "t"]. */
1221
- keys: z19.array(InputKey).min(1).max(6)
1365
+ keys: z20.array(InputKey).min(1).max(6)
1222
1366
  });
1223
- var InputHotkeyResult = z19.strictObject({ keys: z19.array(InputKey) });
1224
- var InputPoint = z19.strictObject({ x: z19.int(), y: z19.int() });
1225
- var InputMouseMoveParams = z19.strictObject({
1367
+ var InputHotkeyResult = z20.strictObject({ keys: z20.array(InputKey) });
1368
+ var InputPoint = z20.strictObject({ x: z20.int(), y: z20.int() });
1369
+ var InputMouseMoveParams = z20.strictObject({
1226
1370
  /** Screen position in logical points (the coordinates screen.list and window.list report). */
1227
- x: z19.int(),
1228
- y: z19.int()
1371
+ x: z20.int(),
1372
+ y: z20.int()
1229
1373
  });
1230
- var InputMouseMoveResult = z19.strictObject({
1374
+ var InputMouseMoveResult = z20.strictObject({
1231
1375
  /** Where the pointer is now, read back from the OS. */
1232
1376
  position: InputPoint
1233
1377
  });
1234
- var InputMouseClickParams = z19.strictObject({
1378
+ var InputMouseClickParams = z20.strictObject({
1235
1379
  /** Move here first; clicks where the pointer is when absent. */
1236
- x: z19.int().optional(),
1237
- y: z19.int().optional(),
1238
- button: z19.enum(["left", "right", "middle"]).default("left"),
1239
- double: z19.boolean().default(false)
1380
+ x: z20.int().optional(),
1381
+ y: z20.int().optional(),
1382
+ button: z20.enum(["left", "right", "middle"]).default("left"),
1383
+ double: z20.boolean().default(false)
1240
1384
  });
1241
- var InputMouseClickResult = z19.strictObject({
1385
+ var InputMouseClickResult = z20.strictObject({
1242
1386
  position: InputPoint,
1243
- button: z19.enum(["left", "right", "middle"]),
1244
- double: z19.boolean()
1387
+ button: z20.enum(["left", "right", "middle"]),
1388
+ double: z20.boolean()
1245
1389
  });
1246
1390
 
1247
1391
  // src/schema/power.ts
1248
- import { z as z20 } from "zod";
1249
- var PowerStatusParams = z20.strictObject({});
1250
- var PowerStatusResult = z20.strictObject({
1251
- has_battery: z20.boolean(),
1392
+ import { z as z21 } from "zod";
1393
+ var PowerStatusParams = z21.strictObject({});
1394
+ var PowerStatusResult = z21.strictObject({
1395
+ has_battery: z21.boolean(),
1252
1396
  /** 0–100; null without a battery. */
1253
- percent: z20.number().min(0).max(100).nullable(),
1254
- charging: z20.boolean().nullable(),
1397
+ percent: z21.number().min(0).max(100).nullable(),
1398
+ charging: z21.boolean().nullable(),
1255
1399
  /** On wall power; null where the OS does not say. */
1256
- plugged_in: z20.boolean().nullable(),
1400
+ plugged_in: z21.boolean().nullable(),
1257
1401
  /** Minutes of battery left; null when charging, unknown or without a battery. */
1258
1402
  minutes_left: nonNegInt.nullable(),
1259
1403
  /** Matrx 2 is keeping the computer awake (power.prevent_sleep) until this time; null when it is not. */
1260
1404
  awake_until_ms: epochMs.nullable()
1261
1405
  });
1262
- var PowerPreventSleepParams = z20.strictObject({
1406
+ var PowerPreventSleepParams = z21.strictObject({
1263
1407
  /** Keep the computer awake this long; 0 lets it sleep again now. */
1264
- seconds: z20.int().min(0).max(86400),
1408
+ seconds: z21.int().min(0).max(86400),
1265
1409
  /** Shown where the OS lists what keeps it awake. */
1266
- reason: z20.string().min(1).max(128).default("Matrx 2 is working")
1410
+ reason: z21.string().min(1).max(128).default("Matrx 2 is working")
1267
1411
  });
1268
- var PowerPreventSleepResult = z20.strictObject({
1412
+ var PowerPreventSleepResult = z21.strictObject({
1269
1413
  /** When it may sleep again; null after seconds 0. */
1270
1414
  awake_until_ms: epochMs.nullable()
1271
1415
  });
1272
1416
 
1273
1417
  // src/schema/resources.ts
1274
- import { z as z21 } from "zod";
1275
- var ResourcesDisk = z21.strictObject({
1418
+ import { z as z22 } from "zod";
1419
+ var ResourcesDisk = z22.strictObject({
1276
1420
  /** Where it is mounted ("/", "C:"). */
1277
- mount: z21.string().max(512),
1421
+ mount: z22.string().max(512),
1278
1422
  /** The file system ("apfs", "NTFS", "ext4"). */
1279
- fs: z21.string().max(64),
1423
+ fs: z22.string().max(64),
1280
1424
  size_bytes: nonNegInt,
1281
1425
  used_bytes: nonNegInt,
1282
1426
  available_bytes: nonNegInt
1283
1427
  });
1284
- var ResourcesSnapshotParams = z21.strictObject({});
1285
- var ResourcesSnapshotResult = z21.strictObject({
1286
- cpu: z21.strictObject({
1428
+ var ResourcesSnapshotParams = z22.strictObject({});
1429
+ var ResourcesSnapshotResult = z22.strictObject({
1430
+ cpu: z22.strictObject({
1287
1431
  /** Busy share of all cores, 0–100, measured now. */
1288
- percent: z21.number().min(0).max(100),
1289
- cores: z21.int().min(1),
1432
+ percent: z22.number().min(0).max(100),
1433
+ cores: z22.int().min(1),
1290
1434
  /** 1, 5 and 15 minute load averages; null on Windows. */
1291
- load: z21.array(z21.number().min(0)).length(3).nullable()
1435
+ load: z22.array(z22.number().min(0)).length(3).nullable()
1292
1436
  }),
1293
- memory: z21.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt, available_bytes: nonNegInt }),
1294
- swap: z21.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt }),
1295
- disks: z21.array(ResourcesDisk).max(64),
1437
+ memory: z22.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt, available_bytes: nonNegInt }),
1438
+ swap: z22.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt }),
1439
+ disks: z22.array(ResourcesDisk).max(64),
1296
1440
  uptime_seconds: nonNegInt
1297
1441
  });
1298
1442
 
1299
1443
  // src/schema/audio.ts
1300
- import { z as z22 } from "zod";
1301
- var AudioDevice = z22.strictObject({
1444
+ import { z as z23 } from "zod";
1445
+ var AudioDevice = z23.strictObject({
1302
1446
  /** The OS's name for it, as audio.record takes it. */
1303
- id: z22.string().min(1).max(256),
1304
- name: z22.string().max(256),
1305
- default: z22.boolean()
1447
+ id: z23.string().min(1).max(256),
1448
+ name: z23.string().max(256),
1449
+ default: z23.boolean()
1306
1450
  });
1307
- var AudioDevicesParams = z22.strictObject({});
1308
- var AudioDevicesResult = z22.strictObject({
1309
- inputs: z22.array(AudioDevice).max(64),
1310
- outputs: z22.array(AudioDevice).max(64)
1451
+ var AudioDevicesParams = z23.strictObject({});
1452
+ var AudioDevicesResult = z23.strictObject({
1453
+ inputs: z23.array(AudioDevice).max(64),
1454
+ outputs: z23.array(AudioDevice).max(64)
1311
1455
  });
1312
- var AudioRecordParams = z22.strictObject({
1313
- seconds: z22.number().min(0.5).max(600),
1456
+ var AudioRecordParams = z23.strictObject({
1457
+ seconds: z23.number().min(0.5).max(600),
1314
1458
  /** The microphone (from audio.devices); the default input when absent. */
1315
- device_id: z22.string().min(1).max(256).optional(),
1459
+ device_id: z23.string().min(1).max(256).optional(),
1316
1460
  /** Where the WAV file goes; a new file in the temp folder when absent. */
1317
1461
  path: AbsPath.optional()
1318
1462
  });
1319
- var AudioRecordResult = z22.strictObject({
1463
+ var AudioRecordResult = z23.strictObject({
1320
1464
  path: AbsPath,
1321
- seconds: z22.number().min(0),
1465
+ seconds: z23.number().min(0),
1322
1466
  bytes: nonNegInt,
1323
1467
  /** Loudest sample, 0–1: 0 means the device gave silence. */
1324
- peak: z22.number().min(0).max(1)
1468
+ peak: z23.number().min(0).max(1)
1325
1469
  });
1326
- var AudioPlayParams = z22.strictObject({ path: AbsPath });
1327
- var AudioPlayResult = z22.strictObject({ path: AbsPath, seconds: z22.number().min(0) });
1470
+ var AudioPlayParams = z23.strictObject({ path: AbsPath });
1471
+ var AudioPlayResult = z23.strictObject({ path: AbsPath, seconds: z23.number().min(0) });
1328
1472
 
1329
1473
  // src/schema/fs-watch.ts
1330
- import { z as z23 } from "zod";
1331
- var FsWatchId = z23.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
1332
- var FsWatchStartParams = z23.strictObject({
1474
+ import { z as z24 } from "zod";
1475
+ var FsWatchId = z24.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
1476
+ var FsWatchStartParams = z24.strictObject({
1333
1477
  path: AbsPath,
1334
- recursive: z23.boolean().default(true),
1478
+ recursive: z24.boolean().default(true),
1335
1479
  /** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
1336
- ignore: z23.array(z23.string().max(256)).max(64).default([])
1480
+ ignore: z24.array(z24.string().max(256)).max(64).default([])
1337
1481
  });
1338
- var FsWatchStartResult = z23.strictObject({
1482
+ var FsWatchStartResult = z24.strictObject({
1339
1483
  watch_id: FsWatchId,
1340
1484
  path: AbsPath,
1341
1485
  /** The watch ends by itself if nobody reads it for 30 minutes. */
1342
1486
  expires_at_ms: epochMs
1343
1487
  });
1344
- var FsWatchEventsParams = z23.strictObject({
1488
+ var FsWatchEventsParams = z24.strictObject({
1345
1489
  watch_id: FsWatchId,
1346
1490
  /** Wait up to this long for a first change when none is waiting (0 answers at once). */
1347
- wait_ms: z23.int().min(0).max(25e3).default(0)
1491
+ wait_ms: z24.int().min(0).max(25e3).default(0)
1348
1492
  });
1349
- var FsWatchEventsResult = z23.strictObject({
1493
+ var FsWatchEventsResult = z24.strictObject({
1350
1494
  /** What changed since the last read, oldest first; re-checked against the disk when read. */
1351
- changes: z23.array(FsChange).max(1e3),
1495
+ changes: z24.array(FsChange).max(1e3),
1352
1496
  /** Changes were dropped (more than 1000 waited): list the folder again. */
1353
- overflow: z23.boolean(),
1497
+ overflow: z24.boolean(),
1354
1498
  expires_at_ms: epochMs
1355
1499
  });
1356
- var FsWatchStopParams = z23.strictObject({ watch_id: FsWatchId });
1357
- var FsWatchStopResult = z23.strictObject({ watch_id: FsWatchId });
1500
+ var FsWatchStopParams = z24.strictObject({ watch_id: FsWatchId });
1501
+ var FsWatchStopResult = z24.strictObject({ watch_id: FsWatchId });
1358
1502
 
1359
1503
  // src/schema/exec-job.ts
1360
- import { z as z24 } from "zod";
1361
- var ExecJobId = z24.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
1362
- var ExecJobStartParams = z24.strictObject({
1363
- command: z24.string().min(1).max(131072),
1504
+ import { z as z25 } from "zod";
1505
+ var ExecJobId = z25.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
1506
+ var ExecJobStartParams = z25.strictObject({
1507
+ command: z25.string().min(1).max(131072),
1364
1508
  /** The folder it runs in; the home folder when absent. */
1365
1509
  cwd: AbsPath.optional(),
1366
- env: z24.record(z24.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z24.string().max(32768)).optional()
1510
+ env: z25.record(z25.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z25.string().max(32768)).optional()
1367
1511
  });
1368
- var ExecJobStartResult = z24.strictObject({ job_id: ExecJobId, pid: z24.int().min(1), cwd: AbsPath });
1369
- var ExecJobOutputParams = z24.strictObject({
1512
+ var ExecJobStartResult = z25.strictObject({ job_id: ExecJobId, pid: z25.int().min(1), cwd: AbsPath });
1513
+ var ExecJobOutputParams = z25.strictObject({
1370
1514
  job_id: ExecJobId,
1371
1515
  /** Byte offset into the job's output to read from (next_offset of the last read; 0 = the start). */
1372
1516
  offset: nonNegInt.default(0),
1373
1517
  /** Wait up to this long for new output or the exit when none is waiting (0 answers at once). */
1374
- wait_ms: z24.int().min(0).max(25e3).default(0),
1375
- max_bytes: z24.int().min(1024).max(1048576).default(65536)
1518
+ wait_ms: z25.int().min(0).max(25e3).default(0),
1519
+ max_bytes: z25.int().min(1024).max(1048576).default(65536)
1376
1520
  });
1377
- var ExecJobOutputResult = z24.strictObject({
1521
+ var ExecJobOutputResult = z25.strictObject({
1378
1522
  /** stdout and stderr interleaved as they arrived (UTF-8). */
1379
- output: z24.string(),
1523
+ output: z25.string(),
1380
1524
  next_offset: nonNegInt,
1381
1525
  /** Bytes before `offset` that are gone (the job keeps its last 4 MiB). */
1382
1526
  dropped_bytes: nonNegInt,
1383
- running: z24.boolean(),
1384
- exit_code: z24.int().nullable()
1527
+ running: z25.boolean(),
1528
+ exit_code: z25.int().nullable()
1385
1529
  });
1386
- var ExecJobStopParams = z24.strictObject({
1530
+ var ExecJobStopParams = z25.strictObject({
1387
1531
  job_id: ExecJobId,
1388
1532
  /** End it at once (SIGKILL; on Windows the whole tree with /F) instead of asking it to quit. */
1389
- force: z24.boolean().default(false)
1533
+ force: z25.boolean().default(false)
1390
1534
  });
1391
- var ExecJobStopResult = z24.strictObject({ job_id: ExecJobId, exited: z24.boolean(), exit_code: z24.int().nullable() });
1392
- var ExecJobInfo = z24.strictObject({
1535
+ var ExecJobStopResult = z25.strictObject({ job_id: ExecJobId, exited: z25.boolean(), exit_code: z25.int().nullable() });
1536
+ var ExecJobInfo = z25.strictObject({
1393
1537
  job_id: ExecJobId,
1394
- command: z24.string().max(1024),
1395
- pid: z24.int().min(1),
1538
+ command: z25.string().max(1024),
1539
+ pid: z25.int().min(1),
1396
1540
  cwd: AbsPath,
1397
- running: z24.boolean(),
1398
- exit_code: z24.int().nullable(),
1541
+ running: z25.boolean(),
1542
+ exit_code: z25.int().nullable(),
1399
1543
  started_at_ms: epochMs,
1400
1544
  output_bytes: nonNegInt
1401
1545
  });
1402
- var ExecJobListParams = z24.strictObject({});
1403
- var ExecJobListResult = z24.strictObject({ jobs: z24.array(ExecJobInfo).max(64) });
1546
+ var ExecJobListParams = z25.strictObject({});
1547
+ var ExecJobListResult = z25.strictObject({ jobs: z25.array(ExecJobInfo).max(64) });
1404
1548
 
1405
1549
  // src/schema/coding.ts
1406
- import { z as z25 } from "zod";
1407
- var CodingServiceCredentials = z25.strictObject({
1408
- access_token: z25.string().min(16).max(16384),
1409
- user_id: z25.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}$/),
1550
+ import { z as z26 } from "zod";
1551
+ var CodingServiceCredentials = z26.strictObject({
1552
+ access_token: z26.string().min(16).max(16384),
1553
+ user_id: z26.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}$/),
1410
1554
  /** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
1411
- server_url: z25.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
1555
+ server_url: z26.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
1412
1556
  });
1413
- var CodingHistoryBlocked = z25.enum([
1557
+ var CodingHistoryBlocked = z26.enum([
1414
1558
  "signed_out",
1415
1559
  "offline",
1416
1560
  "organization_required",
@@ -1418,11 +1562,11 @@ var CodingHistoryBlocked = z25.enum([
1418
1562
  "cloud_list_unavailable",
1419
1563
  "history_too_large"
1420
1564
  ]);
1421
- var CodingHistoryFailure = z25.strictObject({
1422
- session_id: z25.string().max(64),
1423
- reason: z25.string().max(300)
1565
+ var CodingHistoryFailure = z26.strictObject({
1566
+ session_id: z26.string().max(64),
1567
+ reason: z26.string().max(300)
1424
1568
  });
1425
- var CodingHistoryRun = z25.strictObject({
1569
+ var CodingHistoryRun = z26.strictObject({
1426
1570
  /** Claude Code sessions found on this computer. */
1427
1571
  local_sessions: nonNegInt,
1428
1572
  /** Of those, already complete in AI Matrx. */
@@ -1437,39 +1581,39 @@ var CodingHistoryRun = z25.strictObject({
1437
1581
  /** Changed while being read; a later run takes them. */
1438
1582
  changed: nonNegInt,
1439
1583
  failed: nonNegInt,
1440
- failures: z25.array(CodingHistoryFailure).max(20),
1584
+ failures: z26.array(CodingHistoryFailure).max(20),
1441
1585
  /** Candidates not reached yet. */
1442
1586
  remaining: nonNegInt,
1443
1587
  /** The one line a person reads, e.g. "Imported 12 of 14 sessions. 140 already in AI Matrx." */
1444
- summary: z25.string().max(400)
1588
+ summary: z26.string().max(400)
1445
1589
  });
1446
- var CodingHistoryStep = z25.strictObject({
1590
+ var CodingHistoryStep = z26.strictObject({
1447
1591
  /** Null when the run could not start (blocked before a plan existed). */
1448
- plan_id: z25.string().regex(/^[0-9a-f]{32}$/).nullable(),
1449
- finished: z25.boolean(),
1592
+ plan_id: z26.string().regex(/^[0-9a-f]{32}$/).nullable(),
1593
+ finished: z26.boolean(),
1450
1594
  blocked: CodingHistoryBlocked.nullable(),
1451
1595
  run: CodingHistoryRun
1452
1596
  });
1453
- var CodingPlanMissingParams = z25.strictObject({ credentials: CodingServiceCredentials.nullable() });
1454
- var CodingImportNextParams = z25.strictObject({
1455
- plan_id: z25.string().regex(/^[0-9a-f]{32}$/),
1597
+ var CodingPlanMissingParams = z26.strictObject({ credentials: CodingServiceCredentials.nullable() });
1598
+ var CodingImportNextParams = z26.strictObject({
1599
+ plan_id: z26.string().regex(/^[0-9a-f]{32}$/),
1456
1600
  credentials: CodingServiceCredentials.nullable()
1457
1601
  });
1458
- var CodingServiceProgress = z25.strictObject({
1459
- phase: z25.enum(["checking", "importing"]),
1602
+ var CodingServiceProgress = z26.strictObject({
1603
+ phase: z26.enum(["checking", "importing"]),
1460
1604
  done: nonNegInt,
1461
1605
  total: nonNegInt
1462
1606
  });
1463
- var CodingHistoryImportMissingParams = z25.strictObject({});
1464
- var CodingHistoryImportMissingResult = z25.strictObject({
1465
- state: z25.enum(["done", "blocked", "cancelled"]),
1607
+ var CodingHistoryImportMissingParams = z26.strictObject({});
1608
+ var CodingHistoryImportMissingResult = z26.strictObject({
1609
+ state: z26.enum(["done", "blocked", "cancelled"]),
1466
1610
  blocked: CodingHistoryBlocked.nullable(),
1467
1611
  run: CodingHistoryRun,
1468
1612
  elapsed_ms: nonNegInt
1469
1613
  });
1470
- var CodingHistoryProgressEvent = z25.strictObject({
1614
+ var CodingHistoryProgressEvent = z26.strictObject({
1471
1615
  request_id: RequestId,
1472
- phase: z25.enum(["checking", "importing"]),
1616
+ phase: z26.enum(["checking", "importing"]),
1473
1617
  /** Sessions settled so far, of `total` candidates (0 of 0 while checking). */
1474
1618
  done: nonNegInt,
1475
1619
  total: nonNegInt,
@@ -1514,6 +1658,15 @@ var OPS = {
1514
1658
  "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"] },
1515
1659
  "apps.profiles.remove": { params: AppsProfilesRemoveParams, result: AppsProfilesRemoveResult, kind: "unary", since: "1.2", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "DEVICE_OFFLINE", "INTERNAL"] },
1516
1660
  "apps.open": { params: AppsOpenParams, result: AppsOpenResult, kind: "unary", since: "1.2", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "AUTH_REQUIRED", "DEVICE_OFFLINE", "INTERNAL"] },
1661
+ "apps.chats.list": { params: AppsChatsListParams, result: AppsChatsListResult, kind: "unary", since: "1.8", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1662
+ "apps.chats.watch": { params: AppsChatsWatchParams, result: AppsChatsWatchResult, kind: "resource", since: "1.8", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "RESOURCE_BUSY", "INTERNAL"] },
1663
+ "apps.chats.star": { params: AppsChatsStarParams, result: AppsChatsStarResult, kind: "unary", since: "1.8", errors: ["NOT_FOUND", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1664
+ "apps.projects.file": { params: AppsProjectsFileParams, result: AppsProjectsFileResult, kind: "unary", since: "1.8", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1665
+ "apps.chats.place": { params: AppsChatsPlaceParams, result: AppsChatsPlaceResult, kind: "unary", since: "1.9", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1666
+ "apps.projects.file_many": { params: AppsProjectsFileManyParams, result: AppsProjectsFileManyResult, kind: "unary", since: "1.9", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1667
+ "apps.projects.update": { params: AppsProjectsUpdateParams, result: AppsProjectsUpdateResult, kind: "unary", since: "1.9", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1668
+ "apps.projects.copy": { params: AppsProjectsCopyParams, result: AppsProjectsCopyResult, kind: "unary", since: "1.9", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1669
+ "apps.projects.unfile": { params: AppsProjectsUnfileParams, result: AppsProjectsUnfileResult, kind: "unary", since: "1.8", errors: ["NOT_FOUND", "CONFLICT", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1517
1670
  "proc.list": { params: ProcListParams, result: ProcListResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1518
1671
  "proc.ports": { params: ProcPortsParams, result: ProcPortsResult, kind: "unary", since: "1.3", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
1519
1672
  "proc.kill": { params: ProcKillParams, result: ProcKillResult, kind: "unary", since: "1.3", errors: ["NOT_FOUND", "AUTH_FORBIDDEN", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "INTERNAL"] },
@@ -1550,6 +1703,8 @@ var OPS = {
1550
1703
  };
1551
1704
  var EVENTS = {
1552
1705
  "fs.changed": FsChangedEvent,
1706
+ "apps.chats.changed": AppsChatsChangedEvent,
1707
+ "apps.chats.watch_state": AppsChatsWatchStateEvent,
1553
1708
  "exec.exited": ExecExitedEvent,
1554
1709
  "exec.title": ExecTitleEvent,
1555
1710
  "exec.cwd": ExecCwdEvent,
@@ -1814,7 +1969,37 @@ var NAMED_SCHEMAS = {
1814
1969
  AppsProfilesRemoveParams,
1815
1970
  AppsProfilesRemoveResult,
1816
1971
  AppsOpenParams,
1817
- AppsOpenResult
1972
+ AppsOpenResult,
1973
+ ChatId,
1974
+ ChatPlace,
1975
+ ChatProjectId,
1976
+ ChatWindow,
1977
+ ChatProject,
1978
+ ChatPin,
1979
+ ChatRunning,
1980
+ ChatHidden,
1981
+ ChatLastUse,
1982
+ ChatRow,
1983
+ AppsChatsListParams,
1984
+ AppsChatsListResult,
1985
+ AppsChatsWatchParams,
1986
+ AppsChatsWatchResult,
1987
+ AppsChatsChangedEvent,
1988
+ AppsChatsStarParams,
1989
+ AppsChatsStarResult,
1990
+ AppsProjectsFileParams,
1991
+ AppsProjectsFileResult,
1992
+ AppsProjectsUnfileParams,
1993
+ AppsProjectsUnfileResult,
1994
+ AppsChatsWatchStateEvent,
1995
+ AppsChatsPlaceParams,
1996
+ AppsChatsPlaceResult,
1997
+ AppsProjectsFileManyParams,
1998
+ AppsProjectsFileManyResult,
1999
+ AppsProjectsUpdateParams,
2000
+ AppsProjectsUpdateResult,
2001
+ AppsProjectsCopyParams,
2002
+ AppsProjectsCopyResult
1818
2003
  };
1819
2004
 
1820
2005
  // src/versioning.ts
@@ -1823,7 +2008,8 @@ var FIELDS_SINCE = {
1823
2008
  "ProtocolErrorBody.data": { edits_failed: "1.1" },
1824
2009
  "RelayCallResponse|0": { protocol_version: "1.1" },
1825
2010
  "RelayCallResponse|1": { protocol_version: "1.1" },
1826
- WindowInfo: { app: "1.7", pid: "1.7" }
2011
+ WindowInfo: { app: "1.7", pid: "1.7" },
2012
+ AppsChatsListResult: { updating: "1.9", live: "1.9" }
1827
2013
  };
1828
2014
  var NULL_SINCE = {
1829
2015
  "RelayDeviceStatusEvent.since_ms": { since: "1.1", olderPeersGet: 0 }
@@ -1876,7 +2062,10 @@ function strip(value, fields, version) {
1876
2062
  }
1877
2063
  return out ?? value;
1878
2064
  }
1879
- var RESULT_PATH = /* @__PURE__ */ new Map([["fs.patch", "FsPatchResult"]]);
2065
+ var RESULT_PATH = /* @__PURE__ */ new Map([
2066
+ ["fs.patch", "FsPatchResult"],
2067
+ ["apps.chats.list", "AppsChatsListResult"]
2068
+ ]);
1880
2069
  var WINDOW_RESULTS = /* @__PURE__ */ new Map([
1881
2070
  ["window.list", "windows"],
1882
2071
  ["window.focus", "window"],
@@ -1917,7 +2106,7 @@ function forPeer(op, part, value, version) {
1917
2106
  var VERSIONED_RESULT_OPS = [...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys()];
1918
2107
 
1919
2108
  // src/contract.ts
1920
- var CONTRACT_SHA256 = "5525674072a767340a8bd75a4e4b98c588577a866b4d381edeb377401729e14d";
2109
+ var CONTRACT_SHA256 = "8a36e6b958c871853f0a9520e49c92dd30aa05442765c5a1f04c4caa71a35229";
1921
2110
 
1922
2111
  // src/close-policy.ts
1923
2112
  var CLOSE_RULES = {
@@ -2267,6 +2456,16 @@ export {
2267
2456
  AppProfileLocator,
2268
2457
  AppSupport,
2269
2458
  AppUsageReading,
2459
+ AppsChatsChangedEvent,
2460
+ AppsChatsListParams,
2461
+ AppsChatsListResult,
2462
+ AppsChatsPlaceParams,
2463
+ AppsChatsPlaceResult,
2464
+ AppsChatsStarParams,
2465
+ AppsChatsStarResult,
2466
+ AppsChatsWatchParams,
2467
+ AppsChatsWatchResult,
2468
+ AppsChatsWatchStateEvent,
2270
2469
  AppsListParams,
2271
2470
  AppsListResult,
2272
2471
  AppsOpenParams,
@@ -2277,6 +2476,16 @@ export {
2277
2476
  AppsProfilesRemoveResult,
2278
2477
  AppsProfilesSaveParams,
2279
2478
  AppsProfilesSaveResult,
2479
+ AppsProjectsCopyParams,
2480
+ AppsProjectsCopyResult,
2481
+ AppsProjectsFileManyParams,
2482
+ AppsProjectsFileManyResult,
2483
+ AppsProjectsFileParams,
2484
+ AppsProjectsFileResult,
2485
+ AppsProjectsUnfileParams,
2486
+ AppsProjectsUnfileResult,
2487
+ AppsProjectsUpdateParams,
2488
+ AppsProjectsUpdateResult,
2280
2489
  AudioDevice,
2281
2490
  AudioDevicesParams,
2282
2491
  AudioDevicesResult,
@@ -2289,6 +2498,16 @@ export {
2289
2498
  CLOSE_RULES,
2290
2499
  CONTRACT_SHA256,
2291
2500
  CancelMsg,
2501
+ ChatHidden,
2502
+ ChatId,
2503
+ ChatLastUse,
2504
+ ChatPin,
2505
+ ChatPlace,
2506
+ ChatProject,
2507
+ ChatProjectId,
2508
+ ChatRow,
2509
+ ChatRunning,
2510
+ ChatWindow,
2292
2511
  ClientToCoreMsg,
2293
2512
  ClientType,
2294
2513
  ClipboardReadParams,