@ai-matrx/desktop-protocol 0.21.2 → 0.21.4

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.js CHANGED
@@ -112,7 +112,7 @@ import { z as z2 } from "zod";
112
112
  import { z } from "zod";
113
113
  import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
114
114
  var PROTOCOL_MAJOR = 1;
115
- var PROTOCOL_MINOR = 21;
115
+ var PROTOCOL_MINOR = 22;
116
116
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
117
117
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
118
118
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -810,164 +810,303 @@ var ClipboardReadResult = z11.strictObject({
810
810
  var ClipboardWriteParams = z11.strictObject({ text: z11.string().max(1048576) });
811
811
  var ClipboardWriteResult = z11.strictObject({ bytes: nonNegInt });
812
812
 
813
- // src/schema/proc.ts
813
+ // src/schema/git.ts
814
814
  import { z as z12 } from "zod";
815
- var ProcSort = z12.enum(["cpu", "memory", "pid", "name"]);
816
- var ProcListParams = z12.strictObject({
815
+ var GIT_MAX_OUTPUT_CHARS = 262144;
816
+ var GitText = z12.string().max(GIT_MAX_OUTPUT_CHARS);
817
+ var GitName = z12.string().min(1).max(255).regex(/^[^-\s][^\s]*$/);
818
+ var GitOutputResult = z12.strictObject({ output: GitText, truncated: z12.boolean() });
819
+ var GitStatusParams = z12.strictObject({ cwd: AbsPath });
820
+ var GitStatusFile = z12.strictObject({
821
+ path: z12.string(),
822
+ /** Porcelain v1 status letters: index (staged) and worktree; "?" for untracked. */
823
+ index: z12.string().length(1),
824
+ worktree: z12.string().length(1)
825
+ });
826
+ var GitStatusResult = z12.strictObject({
827
+ /** The checked-out branch; null when HEAD is detached. */
828
+ branch: z12.string().nullable(),
829
+ upstream: z12.string().nullable(),
830
+ ahead: nonNegInt,
831
+ behind: nonNegInt,
832
+ files: z12.array(GitStatusFile).max(5e3),
833
+ clean: z12.boolean(),
834
+ /** More than 5000 changed files: the list is cut. */
835
+ truncated: z12.boolean()
836
+ });
837
+ var GitDiffParams = z12.strictObject({ cwd: AbsPath, path: z12.string().max(4096).optional(), staged: z12.boolean().default(false) });
838
+ var GitDiffResult = z12.strictObject({ diff: GitText, truncated: z12.boolean() });
839
+ var GitLogParams = z12.strictObject({ cwd: AbsPath, limit: z12.int().min(1).max(500).default(50) });
840
+ var GitLogCommit = z12.strictObject({ sha: z12.string(), short: z12.string(), author: z12.string(), date: z12.string(), subject: z12.string() });
841
+ var GitLogResult = z12.strictObject({ commits: z12.array(GitLogCommit).max(500) });
842
+ var GitAddParams = z12.strictObject({ cwd: AbsPath, paths: z12.array(z12.string().min(1).max(4096)).min(1).max(1e3) });
843
+ var GitCommitParams = z12.strictObject({
844
+ cwd: AbsPath,
845
+ message: z12.string().min(1).max(65536),
846
+ amend: z12.boolean().default(false),
847
+ /** "Name <email>"; absent = the computer's own git identity. */
848
+ author: z12.string().max(512).optional()
849
+ });
850
+ var GitCommitResult = z12.strictObject({ sha: z12.string(), output: GitText, truncated: z12.boolean() });
851
+ var GitPushParams = z12.strictObject({ cwd: AbsPath, remote: GitName.default("origin"), branch: GitName.optional(), force_with_lease: z12.boolean().default(false) });
852
+ var GitPullParams = z12.strictObject({ cwd: AbsPath, remote: GitName.default("origin"), branch: GitName.optional(), rebase: z12.boolean().default(false) });
853
+ var GitBranchParams = z12.strictObject({ cwd: AbsPath, action: z12.enum(["list", "create", "delete", "switch"]), name: GitName.optional() });
854
+ var GitBranchResult = z12.strictObject({
855
+ /** The branch checked out after the action; null when detached. */
856
+ current: z12.string().nullable(),
857
+ /** Local branches (filled by `list`; empty otherwise). */
858
+ branches: z12.array(z12.string()).max(5e3),
859
+ output: GitText,
860
+ truncated: z12.boolean()
861
+ });
862
+ var GitStashParams = z12.strictObject({ cwd: AbsPath, action: z12.enum(["push", "pop", "list", "drop"]), message: z12.string().max(4096).optional() });
863
+ var GitCloneParams = z12.strictObject({
864
+ url: z12.string().min(1).max(4096).regex(/^[^-]/),
865
+ /** The folder to create; must not exist yet (or be empty). */
866
+ dest: AbsPath,
867
+ branch: GitName.optional(),
868
+ depth: z12.int().min(1).max(1e6).optional()
869
+ });
870
+
871
+ // src/schema/web.ts
872
+ import { z as z13 } from "zod";
873
+ var WEB_MAX_TEXT_CHARS = 524288;
874
+ var WebUrl = z13.string().min(1).max(8192).regex(/^https?:\/\//);
875
+ var WebText = z13.string().max(WEB_MAX_TEXT_CHARS);
876
+ var WebHeader = z13.strictObject({ name: z13.string().min(1).max(256), value: z13.string().max(8192) });
877
+ var WebFetchParams = z13.strictObject({
878
+ url: WebUrl,
879
+ method: z13.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]).default("GET"),
880
+ headers: z13.array(WebHeader).max(64).default([]),
881
+ body: z13.string().max(1048576).optional(),
882
+ follow_redirects: z13.boolean().default(true),
883
+ timeout_s: z13.int().min(1).max(300).default(30)
884
+ });
885
+ var WebFetchResult = z13.strictObject({
886
+ status: z13.int().min(100).max(999),
887
+ reason: z13.string(),
888
+ /** The final URL after redirects. */
889
+ url: z13.string(),
890
+ content_type: z13.string().nullable(),
891
+ headers: z13.array(WebHeader),
892
+ body: WebText,
893
+ truncated: z13.boolean(),
894
+ bytes: nonNegInt,
895
+ elapsed_ms: nonNegInt
896
+ });
897
+ var WebScrapeParams = z13.strictObject({
898
+ urls: z13.array(WebUrl).min(1).max(20),
899
+ use_cache: z13.boolean().default(true),
900
+ get_links: z13.boolean().default(false)
901
+ });
902
+ var WebScrapePage = z13.strictObject({
903
+ url: z13.string(),
904
+ ok: z13.boolean(),
905
+ status: z13.int().min(0).max(999).nullable(),
906
+ title: z13.string().nullable(),
907
+ /** The page's readable content (markdown-like text from the scraper's parse). */
908
+ text: WebText,
909
+ truncated: z13.boolean(),
910
+ /** Links found on the page (only with get_links). */
911
+ links: z13.array(z13.string()).max(2e3),
912
+ /** Why the page failed (blocked, timeout, not found…), in the scraper's words; null when ok. */
913
+ error: z13.string().nullable(),
914
+ /** How the page was fetched (http, browser, cache). */
915
+ via: z13.string().nullable()
916
+ });
917
+ var WebScrapeResult = z13.strictObject({ pages: z13.array(WebScrapePage), elapsed_ms: nonNegInt });
918
+ var WebSearchParams = z13.strictObject({
919
+ keywords: z13.array(z13.string().min(1).max(400)).min(1).max(5),
920
+ country: z13.string().min(2).max(2).default("us"),
921
+ count: z13.int().min(1).max(20).default(10),
922
+ freshness: z13.enum(["pd", "pw", "pm", "py"]).optional()
923
+ });
924
+ var WebSearchHit = z13.strictObject({ title: z13.string(), url: z13.string(), description: z13.string() });
925
+ var WebSearchQueryResult = z13.strictObject({ keyword: z13.string(), hits: z13.array(WebSearchHit), error: z13.string().nullable() });
926
+ var WebSearchResult = z13.strictObject({ queries: z13.array(WebSearchQueryResult), elapsed_ms: nonNegInt });
927
+ var ToolsWebSearchParams = z13.strictObject({
928
+ keywords: z13.array(z13.string().min(1).max(400)).min(1).max(5),
929
+ country: z13.string().min(2).max(2).default("us"),
930
+ count: z13.int().min(1).max(20).default(10),
931
+ freshness: z13.enum(["pd", "pw", "pm", "py"]).optional(),
932
+ brave_api_key: z13.string().min(1).max(512).nullable()
933
+ });
934
+ var WebBrowserFetchParams = z13.strictObject({
935
+ url: WebUrl,
936
+ /** A CSS selector to wait for before reading the page. */
937
+ wait_for: z13.string().max(1024).optional(),
938
+ wait_timeout_ms: z13.int().min(100).max(12e4).default(3e4),
939
+ /** true: readable text; false: the rendered HTML. */
940
+ extract_text: z13.boolean().default(true)
941
+ });
942
+ var WebBrowserFetchResult = z13.strictObject({
943
+ url: z13.string(),
944
+ status: z13.int().min(0).max(999).nullable(),
945
+ title: z13.string().nullable(),
946
+ content: WebText,
947
+ truncated: z13.boolean(),
948
+ elapsed_ms: nonNegInt
949
+ });
950
+ var ToolsServiceProgress = z13.strictObject({ phase: z13.enum(["fetching", "installing"]), done: nonNegInt, total: nonNegInt });
951
+
952
+ // src/schema/proc.ts
953
+ import { z as z14 } from "zod";
954
+ var ProcSort = z14.enum(["cpu", "memory", "pid", "name"]);
955
+ var ProcListParams = z14.strictObject({
817
956
  /** Case-insensitive substring of the process name or its command line. */
818
- name: z12.string().min(1).max(128).optional(),
957
+ name: z14.string().min(1).max(128).optional(),
819
958
  sort: ProcSort.default("cpu"),
820
- limit: z12.int().min(1).max(500).default(50)
959
+ limit: z14.int().min(1).max(500).default(50)
821
960
  });
822
- var ProcInfo = z12.strictObject({
823
- pid: z12.int().min(0),
961
+ var ProcInfo = z14.strictObject({
962
+ pid: z14.int().min(0),
824
963
  /** Parent process id; null where the OS does not report it. */
825
- ppid: z12.int().min(0).nullable(),
826
- name: z12.string().max(256),
964
+ ppid: z14.int().min(0).nullable(),
965
+ name: z14.string().max(256),
827
966
  /** The command line, cut to 1024 characters. */
828
- command: z12.string().max(1024),
967
+ command: z14.string().max(1024),
829
968
  /** Share of one core, as `ps` and Task Manager report it; null where the OS does not say. */
830
- cpu_percent: z12.number().min(0).nullable(),
969
+ cpu_percent: z14.number().min(0).nullable(),
831
970
  memory_bytes: nonNegInt.nullable(),
832
- user: z12.string().max(128).nullable()
971
+ user: z14.string().max(128).nullable()
833
972
  });
834
- var ProcListResult = z12.strictObject({
835
- processes: z12.array(ProcInfo).max(500),
973
+ var ProcListResult = z14.strictObject({
974
+ processes: z14.array(ProcInfo).max(500),
836
975
  /** Processes that matched before `limit`. */
837
976
  total: nonNegInt,
838
- truncated: z12.boolean()
977
+ truncated: z14.boolean()
839
978
  });
840
- var ProcPortsParams = z12.strictObject({
979
+ var ProcPortsParams = z14.strictObject({
841
980
  /** Only this port. */
842
- port: z12.int().min(1).max(65535).optional()
981
+ port: z14.int().min(1).max(65535).optional()
843
982
  });
844
- var ProcPort = z12.strictObject({
845
- port: z12.int().min(1).max(65535),
846
- protocol: z12.enum(["tcp", "udp"]),
983
+ var ProcPort = z14.strictObject({
984
+ port: z14.int().min(1).max(65535),
985
+ protocol: z14.enum(["tcp", "udp"]),
847
986
  /** The local address it listens on ("127.0.0.1", "*", "::"). */
848
- address: z12.string().max(64),
849
- pid: z12.int().min(0).nullable(),
850
- process: z12.string().max(256).nullable()
987
+ address: z14.string().max(64),
988
+ pid: z14.int().min(0).nullable(),
989
+ process: z14.string().max(256).nullable()
851
990
  });
852
- var ProcPortsResult = z12.strictObject({ ports: z12.array(ProcPort).max(4e3) });
853
- var ProcKillParams = z12.strictObject({
854
- pid: z12.int().min(1),
991
+ var ProcPortsResult = z14.strictObject({ ports: z14.array(ProcPort).max(4e3) });
992
+ var ProcKillParams = z14.strictObject({
993
+ pid: z14.int().min(1),
855
994
  /** Kill outright (SIGKILL; on Windows the same /F) instead of asking it to quit. */
856
- force: z12.boolean().default(false)
995
+ force: z14.boolean().default(false)
857
996
  });
858
- var ProcKillResult = z12.strictObject({
859
- pid: z12.int().min(1),
860
- signal: z12.enum(["SIGTERM", "SIGKILL"]),
997
+ var ProcKillResult = z14.strictObject({
998
+ pid: z14.int().min(1),
999
+ signal: z14.enum(["SIGTERM", "SIGKILL"]),
861
1000
  /** True when the process was gone within 3 s. */
862
- exited: z12.boolean()
1001
+ exited: z14.boolean()
863
1002
  });
864
1003
 
865
1004
  // src/schema/system.ts
866
- import { z as z13 } from "zod";
867
- var SystemOpenUrlParams = z13.strictObject({
1005
+ import { z as z15 } from "zod";
1006
+ var SystemOpenUrlParams = z15.strictObject({
868
1007
  /** http, https or mailto; opened in the person's default app for it. */
869
- url: z13.string().min(1).max(4096)
1008
+ url: z15.string().min(1).max(4096)
870
1009
  });
871
- var SystemOpenUrlResult = z13.strictObject({ url: z13.string().max(4096) });
872
- var SystemOpenPathParams = z13.strictObject({
1010
+ var SystemOpenUrlResult = z15.strictObject({ url: z15.string().max(4096) });
1011
+ var SystemOpenPathParams = z15.strictObject({
873
1012
  path: AbsPath,
874
1013
  /** Show it in the file manager (Finder, Explorer) instead of opening it. */
875
- reveal: z13.boolean().default(false)
1014
+ reveal: z15.boolean().default(false)
876
1015
  });
877
- var SystemOpenPathResult = z13.strictObject({ path: AbsPath, revealed: z13.boolean() });
878
- var SystemNotifyParams = z13.strictObject({
879
- title: z13.string().min(1).max(128),
880
- body: z13.string().max(1024).default("")
1016
+ var SystemOpenPathResult = z15.strictObject({ path: AbsPath, revealed: z15.boolean() });
1017
+ var SystemNotifyParams = z15.strictObject({
1018
+ title: z15.string().min(1).max(128),
1019
+ body: z15.string().max(1024).default("")
881
1020
  });
882
- var SystemNotifyResult = z13.strictObject({
1021
+ var SystemNotifyResult = z15.strictObject({
883
1022
  /** False when this computer has no notification service to show it (a bare Linux box). */
884
- shown: z13.boolean()
1023
+ shown: z15.boolean()
885
1024
  });
886
1025
 
887
1026
  // src/schema/screen.ts
888
- import { z as z14 } from "zod";
889
- var ScreenDisplay = z14.strictObject({
1027
+ import { z as z16 } from "zod";
1028
+ var ScreenDisplay = z16.strictObject({
890
1029
  /** The OS's display id; pass it to screen.capture. */
891
1030
  id: nonNegInt,
892
- name: z14.string().max(128),
1031
+ name: z16.string().max(128),
893
1032
  /** Position and size in the OS's logical points (x and y may be negative left of or above the main display). */
894
- x: z14.int(),
895
- y: z14.int(),
896
- width: z14.int().min(1),
897
- height: z14.int().min(1),
1033
+ x: z16.int(),
1034
+ y: z16.int(),
1035
+ width: z16.int().min(1),
1036
+ height: z16.int().min(1),
898
1037
  /** Pixels per point (2 on a Retina display). */
899
- scale: z14.number().min(0.1).max(8),
900
- primary: z14.boolean()
1038
+ scale: z16.number().min(0.1).max(8),
1039
+ primary: z16.boolean()
901
1040
  });
902
- var ScreenListParams = z14.strictObject({});
903
- var ScreenListResult = z14.strictObject({ displays: z14.array(ScreenDisplay).max(32) });
904
- var ScreenCaptureParams = z14.strictObject({
1041
+ var ScreenListParams = z16.strictObject({});
1042
+ var ScreenListResult = z16.strictObject({ displays: z16.array(ScreenDisplay).max(32) });
1043
+ var ScreenCaptureParams = z16.strictObject({
905
1044
  /** The display (from screen.list); the primary display when absent. */
906
1045
  display_id: nonNegInt.optional(),
907
- format: z14.enum(["jpeg", "png"]).default("jpeg"),
1046
+ format: z16.enum(["jpeg", "png"]).default("jpeg"),
908
1047
  /** Scale the picture down to at most this width in pixels (kept when already smaller). */
909
- max_width: z14.int().min(160).max(7680).default(1600)
1048
+ max_width: z16.int().min(160).max(7680).default(1600)
910
1049
  });
911
- var ScreenCaptureResult = z14.strictObject({
1050
+ var ScreenCaptureResult = z16.strictObject({
912
1051
  display_id: nonNegInt,
913
- mime_type: z14.enum(["image/jpeg", "image/png"]),
914
- width: z14.int().min(1),
915
- height: z14.int().min(1),
1052
+ mime_type: z16.enum(["image/jpeg", "image/png"]),
1053
+ width: z16.int().min(1),
1054
+ height: z16.int().min(1),
916
1055
  /** The display's full resolution in pixels, before scaling. */
917
- source_width: z14.int().min(1),
918
- source_height: z14.int().min(1),
1056
+ source_width: z16.int().min(1),
1057
+ source_height: z16.int().min(1),
919
1058
  /** The image, base64 (at most 6 MiB of text). */
920
- data_base64: z14.string().max(6291456)
1059
+ data_base64: z16.string().max(6291456)
921
1060
  });
922
1061
 
923
1062
  // src/schema/window.ts
924
- import { z as z15 } from "zod";
925
- var WindowInfo = z15.strictObject({
1063
+ import { z as z17 } from "zod";
1064
+ var WindowInfo = z17.strictObject({
926
1065
  /** The OS's window handle (macOS window number, Windows HWND, X11 window id). */
927
1066
  id: nonNegInt,
928
- title: z15.string().max(512),
1067
+ title: z17.string().max(512),
929
1068
  /** Position and size in logical points. */
930
- x: z15.int(),
931
- y: z15.int(),
932
- width: z15.int().min(0),
933
- height: z15.int().min(0),
1069
+ x: z17.int(),
1070
+ y: z17.int(),
1071
+ width: z17.int().min(0),
1072
+ height: z17.int().min(0),
934
1073
  /**
935
1074
  * The application that owns the window, by the name the OS shows people; absent when the OS does
936
1075
  * not say. Optional (never null, the schema rule) because it was added in protocol 1.7: an older
937
1076
  * app's answer has no such field (FIELDS_SINCE).
938
1077
  */
939
- app: z15.string().max(256).optional(),
1078
+ app: z17.string().max(256).optional(),
940
1079
  /** The owning process id; absent when the OS does not say. Added in protocol 1.7. */
941
- pid: z15.int().min(0).optional()
1080
+ pid: z17.int().min(0).optional()
942
1081
  });
943
- var WindowListParams = z15.strictObject({
1082
+ var WindowListParams = z17.strictObject({
944
1083
  /** Case-insensitive substring of the window title. */
945
- title: z15.string().min(1).max(256).optional(),
946
- limit: z15.int().min(1).max(500).default(100)
1084
+ title: z17.string().min(1).max(256).optional(),
1085
+ limit: z17.int().min(1).max(500).default(100)
947
1086
  });
948
- var WindowListResult = z15.strictObject({
949
- windows: z15.array(WindowInfo).max(500),
1087
+ var WindowListResult = z17.strictObject({
1088
+ windows: z17.array(WindowInfo).max(500),
950
1089
  total: nonNegInt,
951
- truncated: z15.boolean()
1090
+ truncated: z17.boolean()
952
1091
  });
953
- var WindowFocusParams = z15.strictObject({ id: nonNegInt });
954
- var WindowFocusResult = z15.strictObject({ window: WindowInfo });
955
- var WindowMoveParams = z15.strictObject({
1092
+ var WindowFocusParams = z17.strictObject({ id: nonNegInt });
1093
+ var WindowFocusResult = z17.strictObject({ window: WindowInfo });
1094
+ var WindowMoveParams = z17.strictObject({
956
1095
  id: nonNegInt,
957
1096
  /** New top-left corner; unchanged when absent. */
958
- x: z15.int().optional(),
959
- y: z15.int().optional(),
1097
+ x: z17.int().optional(),
1098
+ y: z17.int().optional(),
960
1099
  /** New size; unchanged when absent. */
961
- width: z15.int().min(50).max(16384).optional(),
962
- height: z15.int().min(50).max(16384).optional()
1100
+ width: z17.int().min(50).max(16384).optional(),
1101
+ height: z17.int().min(50).max(16384).optional()
963
1102
  });
964
- var WindowMoveResult = z15.strictObject({ window: WindowInfo });
965
- var WindowMinimizeParams = z15.strictObject({ id: nonNegInt });
966
- var WindowMinimizeResult = z15.strictObject({ id: nonNegInt });
1103
+ var WindowMoveResult = z17.strictObject({ window: WindowInfo });
1104
+ var WindowMinimizeParams = z17.strictObject({ id: nonNegInt });
1105
+ var WindowMinimizeResult = z17.strictObject({ id: nonNegInt });
967
1106
 
968
1107
  // src/schema/input.ts
969
- import { z as z16 } from "zod";
970
- var InputKey = z16.enum([
1108
+ import { z as z18 } from "zod";
1109
+ var InputKey = z18.enum([
971
1110
  "cmd",
972
1111
  "ctrl",
973
1112
  "alt",
@@ -1047,181 +1186,181 @@ var InputKey = z16.enum([
1047
1186
  "backslash",
1048
1187
  "grave"
1049
1188
  ]);
1050
- var InputTypeTextParams = z16.strictObject({ text: z16.string().min(1).max(1e4) });
1051
- var InputTypeTextResult = z16.strictObject({ characters: z16.int().min(1) });
1052
- var InputHotkeyParams = z16.strictObject({
1189
+ var InputTypeTextParams = z18.strictObject({ text: z18.string().min(1).max(1e4) });
1190
+ var InputTypeTextResult = z18.strictObject({ characters: z18.int().min(1) });
1191
+ var InputHotkeyParams = z18.strictObject({
1053
1192
  /** Pressed together in order and released in reverse: ["cmd", "shift", "t"]. */
1054
- keys: z16.array(InputKey).min(1).max(6)
1193
+ keys: z18.array(InputKey).min(1).max(6)
1055
1194
  });
1056
- var InputHotkeyResult = z16.strictObject({ keys: z16.array(InputKey) });
1057
- var InputPoint = z16.strictObject({ x: z16.int(), y: z16.int() });
1058
- var InputMouseMoveParams = z16.strictObject({
1195
+ var InputHotkeyResult = z18.strictObject({ keys: z18.array(InputKey) });
1196
+ var InputPoint = z18.strictObject({ x: z18.int(), y: z18.int() });
1197
+ var InputMouseMoveParams = z18.strictObject({
1059
1198
  /** Screen position in logical points (the coordinates screen.list and window.list report). */
1060
- x: z16.int(),
1061
- y: z16.int()
1199
+ x: z18.int(),
1200
+ y: z18.int()
1062
1201
  });
1063
- var InputMouseMoveResult = z16.strictObject({
1202
+ var InputMouseMoveResult = z18.strictObject({
1064
1203
  /** Where the pointer is now, read back from the OS. */
1065
1204
  position: InputPoint
1066
1205
  });
1067
- var InputMouseClickParams = z16.strictObject({
1206
+ var InputMouseClickParams = z18.strictObject({
1068
1207
  /** Move here first; clicks where the pointer is when absent. */
1069
- x: z16.int().optional(),
1070
- y: z16.int().optional(),
1071
- button: z16.enum(["left", "right", "middle"]).default("left"),
1072
- double: z16.boolean().default(false)
1208
+ x: z18.int().optional(),
1209
+ y: z18.int().optional(),
1210
+ button: z18.enum(["left", "right", "middle"]).default("left"),
1211
+ double: z18.boolean().default(false)
1073
1212
  });
1074
- var InputMouseClickResult = z16.strictObject({
1213
+ var InputMouseClickResult = z18.strictObject({
1075
1214
  position: InputPoint,
1076
- button: z16.enum(["left", "right", "middle"]),
1077
- double: z16.boolean()
1215
+ button: z18.enum(["left", "right", "middle"]),
1216
+ double: z18.boolean()
1078
1217
  });
1079
1218
 
1080
1219
  // src/schema/power.ts
1081
- import { z as z17 } from "zod";
1082
- var PowerStatusParams = z17.strictObject({});
1083
- var PowerStatusResult = z17.strictObject({
1084
- has_battery: z17.boolean(),
1220
+ import { z as z19 } from "zod";
1221
+ var PowerStatusParams = z19.strictObject({});
1222
+ var PowerStatusResult = z19.strictObject({
1223
+ has_battery: z19.boolean(),
1085
1224
  /** 0–100; null without a battery. */
1086
- percent: z17.number().min(0).max(100).nullable(),
1087
- charging: z17.boolean().nullable(),
1225
+ percent: z19.number().min(0).max(100).nullable(),
1226
+ charging: z19.boolean().nullable(),
1088
1227
  /** On wall power; null where the OS does not say. */
1089
- plugged_in: z17.boolean().nullable(),
1228
+ plugged_in: z19.boolean().nullable(),
1090
1229
  /** Minutes of battery left; null when charging, unknown or without a battery. */
1091
1230
  minutes_left: nonNegInt.nullable(),
1092
1231
  /** Matrx 2 is keeping the computer awake (power.prevent_sleep) until this time; null when it is not. */
1093
1232
  awake_until_ms: epochMs.nullable()
1094
1233
  });
1095
- var PowerPreventSleepParams = z17.strictObject({
1234
+ var PowerPreventSleepParams = z19.strictObject({
1096
1235
  /** Keep the computer awake this long; 0 lets it sleep again now. */
1097
- seconds: z17.int().min(0).max(86400),
1236
+ seconds: z19.int().min(0).max(86400),
1098
1237
  /** Shown where the OS lists what keeps it awake. */
1099
- reason: z17.string().min(1).max(128).default("Matrx 2 is working")
1238
+ reason: z19.string().min(1).max(128).default("Matrx 2 is working")
1100
1239
  });
1101
- var PowerPreventSleepResult = z17.strictObject({
1240
+ var PowerPreventSleepResult = z19.strictObject({
1102
1241
  /** When it may sleep again; null after seconds 0. */
1103
1242
  awake_until_ms: epochMs.nullable()
1104
1243
  });
1105
1244
 
1106
1245
  // src/schema/audio.ts
1107
- import { z as z18 } from "zod";
1108
- var AudioDevice = z18.strictObject({
1246
+ import { z as z20 } from "zod";
1247
+ var AudioDevice = z20.strictObject({
1109
1248
  /** The OS's name for it, as audio.record takes it. */
1110
- id: z18.string().min(1).max(256),
1111
- name: z18.string().max(256),
1112
- default: z18.boolean()
1249
+ id: z20.string().min(1).max(256),
1250
+ name: z20.string().max(256),
1251
+ default: z20.boolean()
1113
1252
  });
1114
- var AudioDevicesParams = z18.strictObject({});
1115
- var AudioDevicesResult = z18.strictObject({
1116
- inputs: z18.array(AudioDevice).max(64),
1117
- outputs: z18.array(AudioDevice).max(64)
1253
+ var AudioDevicesParams = z20.strictObject({});
1254
+ var AudioDevicesResult = z20.strictObject({
1255
+ inputs: z20.array(AudioDevice).max(64),
1256
+ outputs: z20.array(AudioDevice).max(64)
1118
1257
  });
1119
- var AudioRecordParams = z18.strictObject({
1120
- seconds: z18.number().min(0.5).max(600),
1258
+ var AudioRecordParams = z20.strictObject({
1259
+ seconds: z20.number().min(0.5).max(600),
1121
1260
  /** The microphone (from audio.devices); the default input when absent. */
1122
- device_id: z18.string().min(1).max(256).optional(),
1261
+ device_id: z20.string().min(1).max(256).optional(),
1123
1262
  /** Where the WAV file goes; a new file in the temp folder when absent. */
1124
1263
  path: AbsPath.optional()
1125
1264
  });
1126
- var AudioRecordResult = z18.strictObject({
1265
+ var AudioRecordResult = z20.strictObject({
1127
1266
  path: AbsPath,
1128
- seconds: z18.number().min(0),
1267
+ seconds: z20.number().min(0),
1129
1268
  bytes: nonNegInt,
1130
1269
  /** Loudest sample, 0–1: 0 means the device gave silence. */
1131
- peak: z18.number().min(0).max(1)
1270
+ peak: z20.number().min(0).max(1)
1132
1271
  });
1133
- var AudioPlayParams = z18.strictObject({ path: AbsPath });
1134
- var AudioPlayResult = z18.strictObject({ path: AbsPath, seconds: z18.number().min(0) });
1272
+ var AudioPlayParams = z20.strictObject({ path: AbsPath });
1273
+ var AudioPlayResult = z20.strictObject({ path: AbsPath, seconds: z20.number().min(0) });
1135
1274
 
1136
1275
  // src/schema/resources.ts
1137
- import { z as z19 } from "zod";
1138
- var ResourcesDisk = z19.strictObject({
1276
+ import { z as z21 } from "zod";
1277
+ var ResourcesDisk = z21.strictObject({
1139
1278
  /** Where it is mounted ("/", "C:"). */
1140
- mount: z19.string().max(512),
1279
+ mount: z21.string().max(512),
1141
1280
  /** The volume's name as the file manager shows it ("Macintosh HD", "Local Disk (C:)"). Since 1.17. */
1142
- name: z19.string().max(256).optional(),
1281
+ name: z21.string().max(256).optional(),
1143
1282
  /** The file system ("apfs", "NTFS", "ext4"). */
1144
- fs: z19.string().max(64),
1283
+ fs: z21.string().max(64),
1145
1284
  size_bytes: nonNegInt,
1146
1285
  used_bytes: nonNegInt,
1147
1286
  available_bytes: nonNegInt
1148
1287
  });
1149
- var ResourcesSnapshotParams = z19.strictObject({});
1150
- var ResourcesSnapshotResult = z19.strictObject({
1151
- cpu: z19.strictObject({
1288
+ var ResourcesSnapshotParams = z21.strictObject({});
1289
+ var ResourcesSnapshotResult = z21.strictObject({
1290
+ cpu: z21.strictObject({
1152
1291
  /** Busy share of all cores, 0–100, measured now. */
1153
- percent: z19.number().min(0).max(100),
1154
- cores: z19.int().min(1),
1292
+ percent: z21.number().min(0).max(100),
1293
+ cores: z21.int().min(1),
1155
1294
  /** 1, 5 and 15 minute load averages; null on Windows. */
1156
- load: z19.array(z19.number().min(0)).length(3).nullable()
1295
+ load: z21.array(z21.number().min(0)).length(3).nullable()
1157
1296
  }),
1158
- memory: z19.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt, available_bytes: nonNegInt }),
1159
- swap: z19.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt }),
1160
- disks: z19.array(ResourcesDisk).max(64),
1297
+ memory: z21.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt, available_bytes: nonNegInt }),
1298
+ swap: z21.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt }),
1299
+ disks: z21.array(ResourcesDisk).max(64),
1161
1300
  uptime_seconds: nonNegInt
1162
1301
  });
1163
- var ResourcesJobKind = z19.enum(["type-check", "tests", "build", "lint", "dev server", "language server", "search"]);
1164
- var ResourcesStrain = z19.enum(["good", "strain", "overloaded"]);
1165
- var ResourcesPressure = z19.enum(["normal", "warning", "critical"]);
1166
- var ResourcesJob = z19.strictObject({
1302
+ var ResourcesJobKind = z21.enum(["type-check", "tests", "build", "lint", "dev server", "language server", "search"]);
1303
+ var ResourcesStrain = z21.enum(["good", "strain", "overloaded"]);
1304
+ var ResourcesPressure = z21.enum(["normal", "warning", "critical"]);
1305
+ var ResourcesJob = z21.strictObject({
1167
1306
  /** The job's root process (Stop takes its whole tree). */
1168
- pid: z19.int().min(0),
1307
+ pid: z21.int().min(0),
1169
1308
  kind: ResourcesJobKind,
1170
1309
  /** Its heaviest process's command line, shortened ("…/lib/tsc --noEmit -p tsconfig.json"). */
1171
- command: z19.string().max(256),
1310
+ command: z21.string().max(256),
1172
1311
  /** Who started it: "Claude Code", "Codex", "Cursor", "VS Code", "Terminal", "local stack", "detached"; null when unknown. */
1173
- started_by: z19.string().max(64).nullable(),
1312
+ started_by: z21.string().max(64).nullable(),
1174
1313
  /** Whatever started it is gone and nothing waits for it. */
1175
- orphan: z19.boolean(),
1314
+ orphan: z21.boolean(),
1176
1315
  /** A type-check queued for its turn (no compiler running yet). */
1177
- waiting: z19.boolean(),
1316
+ waiting: z21.boolean(),
1178
1317
  /** The project folder it runs in ("matrx-frontend"); null when not in one. */
1179
- folder: z19.string().max(256).nullable(),
1318
+ folder: z21.string().max(256).nullable(),
1180
1319
  /** The same command in the same folder, running this many times (1 = no duplicate). */
1181
- duplicates: z19.int().min(1),
1182
- processes: z19.int().min(1),
1320
+ duplicates: z21.int().min(1),
1321
+ processes: z21.int().min(1),
1183
1322
  /** Sum over the tree, as `ps` reports it: 100 = one full core. */
1184
- cpu_percent: z19.number().min(0),
1323
+ cpu_percent: z21.number().min(0),
1185
1324
  /** Real memory (macOS: the physical footprint Activity Monitor shows, compressed included). */
1186
1325
  memory_bytes: nonNegInt,
1187
1326
  started_at_ms: epochMs.nullable(),
1188
1327
  /** False for an app, an agent session, a terminal, a system process, the local stack or Matrx 2 itself. */
1189
- stoppable: z19.boolean()
1328
+ stoppable: z21.boolean()
1190
1329
  });
1191
- var ResourcesProcess = z19.strictObject({
1192
- pid: z19.int().min(0),
1330
+ var ResourcesProcess = z21.strictObject({
1331
+ pid: z21.int().min(0),
1193
1332
  /** The command line, shortened. */
1194
- name: z19.string().max(256),
1195
- cpu_percent: z19.number().min(0),
1333
+ name: z21.string().max(256),
1334
+ cpu_percent: z21.number().min(0),
1196
1335
  memory_bytes: nonNegInt,
1197
- started_by: z19.string().max(64).nullable(),
1336
+ started_by: z21.string().max(64).nullable(),
1198
1337
  /** The job it belongs to ("type-check in aidream"); null when none. */
1199
- job: z19.string().max(256).nullable(),
1338
+ job: z21.string().max(256).nullable(),
1200
1339
  started_at_ms: epochMs.nullable()
1201
1340
  });
1202
- var ResourcesVerdict = z19.strictObject({
1341
+ var ResourcesVerdict = z21.strictObject({
1203
1342
  level: ResourcesStrain,
1204
1343
  /** One sentence ("Your Mac is under strain. 3 type-checks are running at once."). */
1205
- text: z19.string().max(256),
1344
+ text: z21.string().max(256),
1206
1345
  /** The biggest jobs behind it; null when all is well. */
1207
- cause: z19.string().max(1024).nullable()
1346
+ cause: z21.string().max(1024).nullable()
1208
1347
  });
1209
- var ResourcesSample = z19.strictObject({
1348
+ var ResourcesSample = z21.strictObject({
1210
1349
  at_ms: epochMs,
1211
1350
  /** The 1-minute load average. */
1212
- load: z19.number().min(0),
1351
+ load: z21.number().min(0),
1213
1352
  memory_used_bytes: nonNegInt,
1214
1353
  typechecks: nonNegInt
1215
1354
  });
1216
- var ResourcesActivityParams = z19.strictObject({});
1217
- var ResourcesActivityResult = z19.strictObject({
1355
+ var ResourcesActivityParams = z21.strictObject({});
1356
+ var ResourcesActivityResult = z21.strictObject({
1218
1357
  /** False until the first reading (a second or two after start). */
1219
- ready: z19.boolean(),
1358
+ ready: z21.boolean(),
1220
1359
  sampled_at_ms: epochMs.nullable(),
1221
- cores: z19.int().min(1),
1360
+ cores: z21.int().min(1),
1222
1361
  /** 1, 5 and 15 minute load averages. */
1223
- load: z19.array(z19.number().min(0)).length(3),
1224
- memory: z19.strictObject({
1362
+ load: z21.array(z21.number().min(0)).length(3),
1363
+ memory: z21.strictObject({
1225
1364
  total_bytes: nonNegInt,
1226
1365
  /** Activity Monitor's Memory Used: app memory + wired + compressed. */
1227
1366
  used_bytes: nonNegInt,
@@ -1232,49 +1371,49 @@ var ResourcesActivityResult = z19.strictObject({
1232
1371
  pressure: ResourcesPressure.nullable()
1233
1372
  }),
1234
1373
  verdict: ResourcesVerdict,
1235
- typechecks: z19.strictObject({ running: nonNegInt, waiting: nonNegInt, comfort: nonNegInt }),
1374
+ typechecks: z21.strictObject({ running: nonNegInt, waiting: nonNegInt, comfort: nonNegInt }),
1236
1375
  /** Heaviest first (1 GB weighs as much as 16 % of a core). */
1237
- jobs: z19.array(ResourcesJob).max(200),
1376
+ jobs: z21.array(ResourcesJob).max(200),
1238
1377
  /** The 15 heaviest by memory and the 15 busiest by CPU, together. */
1239
- top: z19.array(ResourcesProcess).max(30),
1378
+ top: z21.array(ResourcesProcess).max(30),
1240
1379
  /** The last hour, oldest first. */
1241
- history: z19.array(ResourcesSample).max(1200)
1380
+ history: z21.array(ResourcesSample).max(1200)
1242
1381
  });
1243
- var ResourcesStopJobParams = z19.strictObject({ pid: z19.int().min(1) });
1244
- var ResourcesStopJobResult = z19.strictObject({
1382
+ var ResourcesStopJobParams = z21.strictObject({ pid: z21.int().min(1) });
1383
+ var ResourcesStopJobResult = z21.strictObject({
1245
1384
  /** Processes signalled; whatever is still running 5 seconds later is force-stopped. */
1246
1385
  processes: nonNegInt,
1247
1386
  /** It had finished before the request arrived. */
1248
- already_finished: z19.boolean()
1387
+ already_finished: z21.boolean()
1249
1388
  });
1250
- var ResourcesIncident = z19.strictObject({
1389
+ var ResourcesIncident = z21.strictObject({
1251
1390
  at_ms: epochMs,
1252
1391
  verdict: ResourcesVerdict,
1253
- load: z19.number().min(0),
1392
+ load: z21.number().min(0),
1254
1393
  memory_used_bytes: nonNegInt,
1255
1394
  compressed_bytes: nonNegInt,
1256
1395
  pressure: ResourcesPressure.nullable(),
1257
- jobs: z19.array(
1258
- z19.strictObject({
1396
+ jobs: z21.array(
1397
+ z21.strictObject({
1259
1398
  kind: ResourcesJobKind,
1260
- started_by: z19.string().max(64).nullable(),
1261
- folder: z19.string().max(256).nullable(),
1262
- command: z19.string().max(256),
1263
- cpu_percent: z19.number().min(0),
1399
+ started_by: z21.string().max(64).nullable(),
1400
+ folder: z21.string().max(256).nullable(),
1401
+ command: z21.string().max(256),
1402
+ cpu_percent: z21.number().min(0),
1264
1403
  memory_bytes: nonNegInt,
1265
- duplicates: z19.int().min(1)
1404
+ duplicates: z21.int().min(1)
1266
1405
  })
1267
1406
  ).max(8)
1268
1407
  });
1269
- var ResourcesIncidentsParams = z19.strictObject({ limit: z19.int().min(1).max(200).default(50) });
1270
- var ResourcesIncidentsResult = z19.strictObject({
1408
+ var ResourcesIncidentsParams = z21.strictObject({ limit: z21.int().min(1).max(200).default(50) });
1409
+ var ResourcesIncidentsResult = z21.strictObject({
1271
1410
  /** Newest first; at most one a minute is written. */
1272
- incidents: z19.array(ResourcesIncident).max(200)
1411
+ incidents: z21.array(ResourcesIncident).max(200)
1273
1412
  });
1274
1413
 
1275
1414
  // src/schema/diag.ts
1276
- import { z as z20 } from "zod";
1277
- var DiagProcess = z20.enum([
1415
+ import { z as z22 } from "zod";
1416
+ var DiagProcess = z22.enum([
1278
1417
  "main",
1279
1418
  "renderer",
1280
1419
  "hosted_page",
@@ -1287,7 +1426,7 @@ var DiagProcess = z20.enum([
1287
1426
  "coding_sessions",
1288
1427
  "claude_accounts"
1289
1428
  ]);
1290
- var DiagErrorKind = z20.enum([
1429
+ var DiagErrorKind = z22.enum([
1291
1430
  "uncaught_exception",
1292
1431
  "unhandled_rejection",
1293
1432
  "renderer_crash",
@@ -1299,235 +1438,235 @@ var DiagErrorKind = z20.enum([
1299
1438
  "banner",
1300
1439
  "logged_error"
1301
1440
  ]);
1302
- var DiagErrorStatus = z20.enum(["waiting", "sent", "resolved"]);
1303
- var DiagErrorEntry = z20.strictObject({
1441
+ var DiagErrorStatus = z22.enum(["waiting", "sent", "resolved"]);
1442
+ var DiagErrorEntry = z22.strictObject({
1304
1443
  /** sha256 prefix over process, kind, source, code and the normalized message. */
1305
- signature: z20.string().regex(/^[0-9a-f]{32}$/),
1444
+ signature: z22.string().regex(/^[0-9a-f]{32}$/),
1306
1445
  process: DiagProcess,
1307
1446
  kind: DiagErrorKind,
1308
1447
  /** Where: a cap.op, a log event, a screen or page name. */
1309
- source: z20.string().min(1).max(128),
1448
+ source: z22.string().min(1).max(128),
1310
1449
  /** An ErrorCode, an exit code or signal, an error class; null when there is none. */
1311
- code: z20.string().max(64).nullable(),
1450
+ code: z22.string().max(64).nullable(),
1312
1451
  /** The first occurrence's message, personal data removed. */
1313
- message: z20.string().max(500),
1452
+ message: z22.string().max(500),
1314
1453
  count: nonNegInt,
1315
1454
  first_seen_ms: epochMs,
1316
1455
  last_seen_ms: epochMs,
1317
1456
  status: DiagErrorStatus,
1318
1457
  /** What the agent who resolved it wrote; null until resolved. */
1319
- resolution_note: z20.string().max(500).nullable(),
1320
- app_version: z20.string().max(64)
1458
+ resolution_note: z22.string().max(500).nullable(),
1459
+ app_version: z22.string().max(64)
1321
1460
  });
1322
- var DiagErrorsListParams = z20.strictObject({
1461
+ var DiagErrorsListParams = z22.strictObject({
1323
1462
  /** open = waiting or sent; all includes resolved. */
1324
- status: z20.enum(["open", "all"]).default("open"),
1325
- limit: z20.int().min(1).max(500).default(200)
1463
+ status: z22.enum(["open", "all"]).default("open"),
1464
+ limit: z22.int().min(1).max(500).default(200)
1326
1465
  });
1327
- var DiagErrorsListResult = z20.strictObject({
1466
+ var DiagErrorsListResult = z22.strictObject({
1328
1467
  /** Newest last_seen first. */
1329
- entries: z20.array(DiagErrorEntry).max(500),
1468
+ entries: z22.array(DiagErrorEntry).max(500),
1330
1469
  total_signatures: nonNegInt,
1331
1470
  total_occurrences: nonNegInt,
1332
1471
  /** Signatures with occurrences not yet delivered. */
1333
1472
  waiting: nonNegInt,
1334
1473
  /** signed_out = kept until sign-in; ok = the last delivery worked; failing = the last delivery failed (kept, retried). */
1335
- delivery: z20.enum(["signed_out", "ok", "failing"]),
1474
+ delivery: z22.enum(["signed_out", "ok", "failing"]),
1336
1475
  last_delivery_ms: epochMs.nullable()
1337
1476
  });
1338
- var DiagErrorsReportParams = z20.strictObject({
1339
- process: z20.enum(["renderer", "hosted_page"]),
1340
- kind: z20.enum(["uncaught_exception", "unhandled_rejection", "console_error", "banner"]),
1477
+ var DiagErrorsReportParams = z22.strictObject({
1478
+ process: z22.enum(["renderer", "hosted_page"]),
1479
+ kind: z22.enum(["uncaught_exception", "unhandled_rejection", "console_error", "banner"]),
1341
1480
  /** The screen or page, e.g. "code.chats". */
1342
- source: z20.string().min(1).max(128),
1343
- message: z20.string().min(1).max(2e3),
1344
- code: z20.string().max(64).optional(),
1345
- stack: z20.string().max(8e3).optional()
1481
+ source: z22.string().min(1).max(128),
1482
+ message: z22.string().min(1).max(2e3),
1483
+ code: z22.string().max(64).optional(),
1484
+ stack: z22.string().max(8e3).optional()
1346
1485
  });
1347
- var DiagErrorsReportResult = z20.strictObject({
1348
- signature: z20.string().regex(/^[0-9a-f]{32}$/)
1486
+ var DiagErrorsReportResult = z22.strictObject({
1487
+ signature: z22.string().regex(/^[0-9a-f]{32}$/)
1349
1488
  });
1350
- var DiagErrorsChangedEvent = z20.strictObject({
1489
+ var DiagErrorsChangedEvent = z22.strictObject({
1351
1490
  total_signatures: nonNegInt,
1352
1491
  waiting: nonNegInt
1353
1492
  });
1354
1493
 
1355
1494
  // src/schema/stack.ts
1356
- import { z as z21 } from "zod";
1357
- var StackServerName = z21.string().regex(/^[a-z0-9_-]{1,64}$/);
1358
- var StackTone = z21.enum(["good", "wait", "bad", "off"]);
1359
- var StackServer = z21.strictObject({
1495
+ import { z as z23 } from "zod";
1496
+ var StackServerName = z23.string().regex(/^[a-z0-9_-]{1,64}$/);
1497
+ var StackTone = z23.enum(["good", "wait", "bad", "off"]);
1498
+ var StackServer = z23.strictObject({
1360
1499
  name: StackServerName,
1361
1500
  /** One word: Healthy, Starting, Unhealthy, Restarting, Stopping, Waiting, Stopped, Crashed, Off. */
1362
- label: z21.string().max(32),
1501
+ label: z23.string().max(32),
1363
1502
  tone: StackTone,
1364
1503
  /** What is going on, in one or two plain sentences. */
1365
- sentence: z21.string().max(2e3),
1504
+ sentence: z23.string().max(2e3),
1366
1505
  /** The config's own description of the server. */
1367
- description: z21.string().max(512),
1506
+ description: z23.string().max(512),
1368
1507
  /** Where the server answers, when its description names an address. */
1369
- open_url: z21.string().max(2048).nullable(),
1370
- log_file: z21.string().max(4096),
1508
+ open_url: z23.string().max(2048).nullable(),
1509
+ log_file: z23.string().max(4096),
1371
1510
  /** When its log file was last written. */
1372
1511
  last_output_at_ms: epochMs.nullable(),
1373
1512
  started_at_ms: epochMs.nullable(),
1374
1513
  restarts: nonNegInt,
1375
- exit_code: z21.int().nullable(),
1376
- pid: z21.int().nullable(),
1514
+ exit_code: z23.int().nullable(),
1515
+ pid: z23.int().nullable(),
1377
1516
  /** (1.18) CPU of the server's process and everything under it, in percent of one core; absent when it is not running. */
1378
- cpu_percent: z21.number().min(0).optional(),
1517
+ cpu_percent: z23.number().min(0).optional(),
1379
1518
  /** (1.18) Memory of the same processes: the physical footprint (Activity Monitor's Memory) summed; absent when it is not running. */
1380
1519
  memory_bytes: nonNegInt.optional()
1381
1520
  });
1382
- var StackEvent = z21.strictObject({
1521
+ var StackEvent = z23.strictObject({
1383
1522
  at_ms: epochMs,
1384
1523
  /** A server name, or "stack" for the stack as a whole. */
1385
- server: z21.string().max(64),
1524
+ server: z23.string().max(64),
1386
1525
  /** started · stopped · healthy · unhealthy · crashed · exited · restarting · stopping · action · action-done · action-failed · setup · error */
1387
- kind: z21.string().max(32),
1388
- text: z21.string().max(4e3)
1526
+ kind: z23.string().max(32),
1527
+ text: z23.string().max(4e3)
1389
1528
  });
1390
- var StackStateParams = z21.strictObject({});
1391
- var StackStateResult = z21.strictObject({
1529
+ var StackStateParams = z23.strictObject({});
1530
+ var StackStateResult = z23.strictObject({
1392
1531
  /** The stack's config file, when found. */
1393
- config_path: z21.string().max(4096).nullable(),
1532
+ config_path: z23.string().max(4096).nullable(),
1394
1533
  /** Why the stack cannot be run from here (no config, no process-compose), else null. */
1395
- problem: z21.string().max(1e3).nullable(),
1396
- stack_up: z21.boolean(),
1534
+ problem: z23.string().max(1e3).nullable(),
1535
+ stack_up: z23.boolean(),
1397
1536
  stack_started_at_ms: epochMs.nullable(),
1398
- servers: z21.array(StackServer).max(64),
1537
+ servers: z23.array(StackServer).max(64),
1399
1538
  /** One line about the one-shot setup steps ("Docker Desktop: running."), or null. */
1400
- setup_note: z21.string().max(500).nullable(),
1539
+ setup_note: z23.string().max(500).nullable(),
1401
1540
  /** Start everything / Stop everything in flight. */
1402
- pending: z21.strictObject({ verb: z21.enum(["start", "stop"]), label: z21.string().max(64), since_ms: epochMs }).nullable(),
1541
+ pending: z23.strictObject({ verb: z23.enum(["start", "stop"]), label: z23.string().max(64), since_ms: epochMs }).nullable(),
1403
1542
  /** The newest entries last. */
1404
- events: z21.array(StackEvent).max(300)
1543
+ events: z23.array(StackEvent).max(300)
1405
1544
  });
1406
- var StackStartParams = z21.strictObject({});
1407
- var StackStopParams = z21.strictObject({});
1408
- var StackRunResult = z21.strictObject({ accepted: z21.boolean() });
1409
- var StackServerActionParams = z21.strictObject({
1545
+ var StackStartParams = z23.strictObject({});
1546
+ var StackStopParams = z23.strictObject({});
1547
+ var StackRunResult = z23.strictObject({ accepted: z23.boolean() });
1548
+ var StackServerActionParams = z23.strictObject({
1410
1549
  name: StackServerName,
1411
- verb: z21.enum(["start", "stop", "restart"])
1550
+ verb: z23.enum(["start", "stop", "restart"])
1412
1551
  });
1413
- var StackServerActionResult = z21.strictObject({ message: z21.string().max(1e3) });
1414
- var StackLogsParams = z21.strictObject({
1552
+ var StackServerActionResult = z23.strictObject({ message: z23.string().max(1e3) });
1553
+ var StackLogsParams = z23.strictObject({
1415
1554
  name: StackServerName,
1416
1555
  /** Without `offset`: the last this-many complete lines. With it: new lines after it, at most this many. */
1417
- lines: z21.int().min(1).max(2e5).default(2e3),
1556
+ lines: z23.int().min(1).max(2e5).default(2e3),
1418
1557
  /** Byte offset the last read ended at: answer only what was written after it (follow). */
1419
1558
  offset: nonNegInt.optional(),
1420
1559
  /** A "Clear" point: the lines written after this byte offset (no `offset`). */
1421
1560
  since: nonNegInt.optional(),
1422
1561
  /** With `offset`: wait up to this long for a new line when none is waiting (0 answers at once). */
1423
- wait_ms: z21.int().min(0).max(25e3).default(0)
1562
+ wait_ms: z23.int().min(0).max(25e3).default(0)
1424
1563
  });
1425
- var StackLogsResult = z21.strictObject({
1564
+ var StackLogsResult = z23.strictObject({
1426
1565
  /** Complete lines, colour codes removed. */
1427
- lines: z21.array(z21.string().max(65536)).max(2e5),
1566
+ lines: z23.array(z23.string().max(65536)).max(2e5),
1428
1567
  /** Where these lines end: pass it back as `offset` to follow. */
1429
1568
  offset: nonNegInt,
1430
1569
  /** False when `since` no longer exists (the log rotated): the lines are the plain tail instead. */
1431
- since_valid: z21.boolean(),
1570
+ since_valid: z23.boolean(),
1432
1571
  /** The log was rotated or truncated since `offset`: these lines start the file again. */
1433
- reset: z21.boolean(),
1434
- log_file: z21.string().max(4096)
1572
+ reset: z23.boolean(),
1573
+ log_file: z23.string().max(4096)
1435
1574
  });
1436
- var StackErrorsParams = z21.strictObject({
1437
- window_minutes: z21.int().min(1).max(1440).default(60)
1575
+ var StackErrorsParams = z23.strictObject({
1576
+ window_minutes: z23.int().min(1).max(1440).default(60)
1438
1577
  });
1439
- var StackErrorsResult = z21.strictObject({
1578
+ var StackErrorsResult = z23.strictObject({
1440
1579
  /** Per server: a heading line ("=== aidream — errors in the last 60 minutes (<file>) ===") and each error with the 10 lines after it. */
1441
- sections: z21.array(z21.strictObject({ name: StackServerName, heading: z21.string().max(4096), lines: z21.array(z21.string().max(65536)).max(5e3) })).max(64),
1442
- window_minutes: z21.int().min(1).max(1440)
1580
+ sections: z23.array(z23.strictObject({ name: StackServerName, heading: z23.string().max(4096), lines: z23.array(z23.string().max(65536)).max(5e3) })).max(64),
1581
+ window_minutes: z23.int().min(1).max(1440)
1443
1582
  });
1444
1583
 
1445
1584
  // src/schema/fs-watch.ts
1446
- import { z as z22 } from "zod";
1447
- var FsWatchId = z22.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
1448
- var FsWatchStartParams = z22.strictObject({
1585
+ import { z as z24 } from "zod";
1586
+ var FsWatchId = z24.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
1587
+ var FsWatchStartParams = z24.strictObject({
1449
1588
  path: AbsPath,
1450
- recursive: z22.boolean().default(true),
1589
+ recursive: z24.boolean().default(true),
1451
1590
  /** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
1452
- ignore: z22.array(z22.string().max(256)).max(64).default([])
1591
+ ignore: z24.array(z24.string().max(256)).max(64).default([])
1453
1592
  });
1454
- var FsWatchStartResult = z22.strictObject({
1593
+ var FsWatchStartResult = z24.strictObject({
1455
1594
  watch_id: FsWatchId,
1456
1595
  path: AbsPath,
1457
1596
  /** The watch ends by itself if nobody reads it for 30 minutes. */
1458
1597
  expires_at_ms: epochMs
1459
1598
  });
1460
- var FsWatchEventsParams = z22.strictObject({
1599
+ var FsWatchEventsParams = z24.strictObject({
1461
1600
  watch_id: FsWatchId,
1462
1601
  /** Wait up to this long for a first change when none is waiting (0 answers at once). */
1463
- wait_ms: z22.int().min(0).max(25e3).default(0)
1602
+ wait_ms: z24.int().min(0).max(25e3).default(0)
1464
1603
  });
1465
- var FsWatchEventsResult = z22.strictObject({
1604
+ var FsWatchEventsResult = z24.strictObject({
1466
1605
  /** What changed since the last read, oldest first; re-checked against the disk when read. */
1467
- changes: z22.array(FsChange).max(1e3),
1606
+ changes: z24.array(FsChange).max(1e3),
1468
1607
  /** Changes were dropped (more than 1000 waited): list the folder again. */
1469
- overflow: z22.boolean(),
1608
+ overflow: z24.boolean(),
1470
1609
  expires_at_ms: epochMs
1471
1610
  });
1472
- var FsWatchStopParams = z22.strictObject({ watch_id: FsWatchId });
1473
- var FsWatchStopResult = z22.strictObject({ watch_id: FsWatchId });
1611
+ var FsWatchStopParams = z24.strictObject({ watch_id: FsWatchId });
1612
+ var FsWatchStopResult = z24.strictObject({ watch_id: FsWatchId });
1474
1613
 
1475
1614
  // src/schema/exec-job.ts
1476
- import { z as z23 } from "zod";
1477
- var ExecJobId = z23.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
1478
- var ExecJobStartParams = z23.strictObject({
1479
- command: z23.string().min(1).max(131072),
1615
+ import { z as z25 } from "zod";
1616
+ var ExecJobId = z25.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
1617
+ var ExecJobStartParams = z25.strictObject({
1618
+ command: z25.string().min(1).max(131072),
1480
1619
  /** The folder it runs in; the home folder when absent. */
1481
1620
  cwd: AbsPath.optional(),
1482
- env: z23.record(z23.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z23.string().max(32768)).optional()
1621
+ env: z25.record(z25.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z25.string().max(32768)).optional()
1483
1622
  });
1484
- var ExecJobStartResult = z23.strictObject({ job_id: ExecJobId, pid: z23.int().min(1), cwd: AbsPath });
1485
- var ExecJobOutputParams = z23.strictObject({
1623
+ var ExecJobStartResult = z25.strictObject({ job_id: ExecJobId, pid: z25.int().min(1), cwd: AbsPath });
1624
+ var ExecJobOutputParams = z25.strictObject({
1486
1625
  job_id: ExecJobId,
1487
1626
  /** Byte offset into the job's output to read from (next_offset of the last read; 0 = the start). */
1488
1627
  offset: nonNegInt.default(0),
1489
1628
  /** Wait up to this long for new output or the exit when none is waiting (0 answers at once). */
1490
- wait_ms: z23.int().min(0).max(25e3).default(0),
1491
- max_bytes: z23.int().min(1024).max(1048576).default(65536)
1629
+ wait_ms: z25.int().min(0).max(25e3).default(0),
1630
+ max_bytes: z25.int().min(1024).max(1048576).default(65536)
1492
1631
  });
1493
- var ExecJobOutputResult = z23.strictObject({
1632
+ var ExecJobOutputResult = z25.strictObject({
1494
1633
  /** stdout and stderr interleaved as they arrived (UTF-8). */
1495
- output: z23.string(),
1634
+ output: z25.string(),
1496
1635
  next_offset: nonNegInt,
1497
1636
  /** Bytes before `offset` that are gone (the job keeps its last 4 MiB). */
1498
1637
  dropped_bytes: nonNegInt,
1499
- running: z23.boolean(),
1500
- exit_code: z23.int().nullable()
1638
+ running: z25.boolean(),
1639
+ exit_code: z25.int().nullable()
1501
1640
  });
1502
- var ExecJobStopParams = z23.strictObject({
1641
+ var ExecJobStopParams = z25.strictObject({
1503
1642
  job_id: ExecJobId,
1504
1643
  /** End it at once (SIGKILL; on Windows the whole tree with /F) instead of asking it to quit. */
1505
- force: z23.boolean().default(false)
1644
+ force: z25.boolean().default(false)
1506
1645
  });
1507
- var ExecJobStopResult = z23.strictObject({ job_id: ExecJobId, exited: z23.boolean(), exit_code: z23.int().nullable() });
1508
- var ExecJobInfo = z23.strictObject({
1646
+ var ExecJobStopResult = z25.strictObject({ job_id: ExecJobId, exited: z25.boolean(), exit_code: z25.int().nullable() });
1647
+ var ExecJobInfo = z25.strictObject({
1509
1648
  job_id: ExecJobId,
1510
- command: z23.string().max(1024),
1511
- pid: z23.int().min(1),
1649
+ command: z25.string().max(1024),
1650
+ pid: z25.int().min(1),
1512
1651
  cwd: AbsPath,
1513
- running: z23.boolean(),
1514
- exit_code: z23.int().nullable(),
1652
+ running: z25.boolean(),
1653
+ exit_code: z25.int().nullable(),
1515
1654
  started_at_ms: epochMs,
1516
1655
  output_bytes: nonNegInt
1517
1656
  });
1518
- var ExecJobListParams = z23.strictObject({});
1519
- var ExecJobListResult = z23.strictObject({ jobs: z23.array(ExecJobInfo).max(64) });
1657
+ var ExecJobListParams = z25.strictObject({});
1658
+ var ExecJobListResult = z25.strictObject({ jobs: z25.array(ExecJobInfo).max(64) });
1520
1659
 
1521
1660
  // src/schema/coding.ts
1522
- import { z as z24 } from "zod";
1661
+ import { z as z26 } from "zod";
1523
1662
  import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN2 } from "@ai-matrx/kit/uuid";
1524
- var CodingServiceCredentials = z24.strictObject({
1525
- access_token: z24.string().min(16).max(16384),
1526
- user_id: z24.string().regex(UUID_SHAPE_PATTERN2),
1663
+ var CodingServiceCredentials = z26.strictObject({
1664
+ access_token: z26.string().min(16).max(16384),
1665
+ user_id: z26.string().regex(UUID_SHAPE_PATTERN2),
1527
1666
  /** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
1528
- server_url: z24.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
1667
+ server_url: z26.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
1529
1668
  });
1530
- var CodingHistoryBlocked = z24.enum([
1669
+ var CodingHistoryBlocked = z26.enum([
1531
1670
  "signed_out",
1532
1671
  "offline",
1533
1672
  "organization_required",
@@ -1535,11 +1674,11 @@ var CodingHistoryBlocked = z24.enum([
1535
1674
  "cloud_list_unavailable",
1536
1675
  "history_too_large"
1537
1676
  ]);
1538
- var CodingHistoryFailure = z24.strictObject({
1539
- session_id: z24.string().max(64),
1540
- reason: z24.string().max(300)
1677
+ var CodingHistoryFailure = z26.strictObject({
1678
+ session_id: z26.string().max(64),
1679
+ reason: z26.string().max(300)
1541
1680
  });
1542
- var CodingHistoryRun = z24.strictObject({
1681
+ var CodingHistoryRun = z26.strictObject({
1543
1682
  /** Claude Code sessions found on this computer. */
1544
1683
  local_sessions: nonNegInt,
1545
1684
  /** Of those, already complete in AI Matrx. */
@@ -1554,39 +1693,39 @@ var CodingHistoryRun = z24.strictObject({
1554
1693
  /** Changed while being read; a later run takes them. */
1555
1694
  changed: nonNegInt,
1556
1695
  failed: nonNegInt,
1557
- failures: z24.array(CodingHistoryFailure).max(20),
1696
+ failures: z26.array(CodingHistoryFailure).max(20),
1558
1697
  /** Candidates not reached yet. */
1559
1698
  remaining: nonNegInt,
1560
1699
  /** The one line a person reads, e.g. "Imported 12 of 14 sessions. 140 already in AI Matrx." */
1561
- summary: z24.string().max(400)
1700
+ summary: z26.string().max(400)
1562
1701
  });
1563
- var CodingHistoryStep = z24.strictObject({
1702
+ var CodingHistoryStep = z26.strictObject({
1564
1703
  /** Null when the run could not start (blocked before a plan existed). */
1565
- plan_id: z24.string().regex(/^[0-9a-f]{32}$/).nullable(),
1566
- finished: z24.boolean(),
1704
+ plan_id: z26.string().regex(/^[0-9a-f]{32}$/).nullable(),
1705
+ finished: z26.boolean(),
1567
1706
  blocked: CodingHistoryBlocked.nullable(),
1568
1707
  run: CodingHistoryRun
1569
1708
  });
1570
- var CodingPlanMissingParams = z24.strictObject({ credentials: CodingServiceCredentials.nullable() });
1571
- var CodingImportNextParams = z24.strictObject({
1572
- plan_id: z24.string().regex(/^[0-9a-f]{32}$/),
1709
+ var CodingPlanMissingParams = z26.strictObject({ credentials: CodingServiceCredentials.nullable() });
1710
+ var CodingImportNextParams = z26.strictObject({
1711
+ plan_id: z26.string().regex(/^[0-9a-f]{32}$/),
1573
1712
  credentials: CodingServiceCredentials.nullable()
1574
1713
  });
1575
- var CodingServiceProgress = z24.strictObject({
1576
- phase: z24.enum(["checking", "importing"]),
1714
+ var CodingServiceProgress = z26.strictObject({
1715
+ phase: z26.enum(["checking", "importing"]),
1577
1716
  done: nonNegInt,
1578
1717
  total: nonNegInt
1579
1718
  });
1580
- var CodingHistoryImportMissingParams = z24.strictObject({});
1581
- var CodingHistoryImportMissingResult = z24.strictObject({
1582
- state: z24.enum(["done", "blocked", "cancelled"]),
1719
+ var CodingHistoryImportMissingParams = z26.strictObject({});
1720
+ var CodingHistoryImportMissingResult = z26.strictObject({
1721
+ state: z26.enum(["done", "blocked", "cancelled"]),
1583
1722
  blocked: CodingHistoryBlocked.nullable(),
1584
1723
  run: CodingHistoryRun,
1585
1724
  elapsed_ms: nonNegInt
1586
1725
  });
1587
- var CodingHistoryProgressEvent = z24.strictObject({
1726
+ var CodingHistoryProgressEvent = z26.strictObject({
1588
1727
  request_id: RequestId,
1589
- phase: z24.enum(["checking", "importing"]),
1728
+ phase: z26.enum(["checking", "importing"]),
1590
1729
  /** Sessions settled so far, of `total` candidates (0 of 0 while checking). */
1591
1730
  done: nonNegInt,
1592
1731
  total: nonNegInt,
@@ -1595,23 +1734,23 @@ var CodingHistoryProgressEvent = z24.strictObject({
1595
1734
  });
1596
1735
 
1597
1736
  // src/schema/apps.ts
1598
- import { z as z25 } from "zod";
1737
+ import { z as z27 } from "zod";
1599
1738
  import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN3 } from "@ai-matrx/kit/uuid";
1600
- var AppKey = z25.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
1601
- var AppProfileId = z25.string().regex(UUID_SHAPE_PATTERN3);
1602
- var AppProfileLocator = z25.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}$/);
1603
- var AppSupport = z25.enum(["supported", "partial", "unsupported"]);
1604
- var AppFeatureStatus = z25.strictObject({
1739
+ var AppKey = z27.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
1740
+ var AppProfileId = z27.string().regex(UUID_SHAPE_PATTERN3);
1741
+ var AppProfileLocator = z27.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}$/);
1742
+ var AppSupport = z27.enum(["supported", "partial", "unsupported"]);
1743
+ var AppFeatureStatus = z27.strictObject({
1605
1744
  status: AppSupport,
1606
1745
  /** One line, set whenever status is not "supported". */
1607
- reason: z25.string().max(140).nullable()
1746
+ reason: z27.string().max(140).nullable()
1608
1747
  });
1609
- var AppInfo = z25.strictObject({
1748
+ var AppInfo = z27.strictObject({
1610
1749
  app_key: AppKey,
1611
- name: z25.string().max(64),
1612
- installed: z25.boolean(),
1750
+ name: z27.string().max(64),
1751
+ installed: z27.boolean(),
1613
1752
  /** The app's own version string, or null when it is not installed or does not say. */
1614
- version: z25.string().max(64).nullable(),
1753
+ version: z27.string().max(64).nullable(),
1615
1754
  /** The install found (an .app bundle, an .exe, a binary), or null. */
1616
1755
  location: AbsPath.nullable(),
1617
1756
  /** Open the app at all on this OS. */
@@ -1621,148 +1760,148 @@ var AppInfo = z25.strictObject({
1621
1760
  /** Plan usage read from the app's own files on this OS. */
1622
1761
  usage: AppFeatureStatus
1623
1762
  });
1624
- var AppUsageReading = z25.strictObject({
1625
- window: z25.enum(["five_hour", "weekly", "extra"]),
1763
+ var AppUsageReading = z27.strictObject({
1764
+ window: z27.enum(["five_hour", "weekly", "extra"]),
1626
1765
  /** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
1627
- percent: z25.number().min(0).max(1e4),
1766
+ percent: z27.number().min(0).max(1e4),
1628
1767
  /** When the app recorded it. */
1629
1768
  sampled_at_ms: epochMs,
1630
1769
  /** True when the window has rolled over since the sample, so the figure has reset. */
1631
- reset_since: z25.boolean()
1770
+ reset_since: z27.boolean()
1632
1771
  });
1633
- var AppProfile = z25.strictObject({
1772
+ var AppProfile = z27.strictObject({
1634
1773
  /** The row's id; null for a folder found on disk that no row names yet. */
1635
1774
  id: AppProfileId.nullable(),
1636
1775
  app_key: AppKey,
1637
- display_name: z25.string().min(1).max(120),
1776
+ display_name: z27.string().min(1).max(120),
1638
1777
  /** The account the person means to be signed in here; null when not stated (never guessed). */
1639
- account_identity: z25.string().min(3).max(320).nullable(),
1778
+ account_identity: z27.string().min(3).max(320).nullable(),
1640
1779
  profile_locator: AppProfileLocator.nullable(),
1641
1780
  /** The device the row is tied to; null when the row names none. */
1642
1781
  device_id: DeviceId.nullable(),
1643
1782
  /** The folder this profile resolves to on this device; null for a row tied to another device. */
1644
1783
  folder: AbsPath.nullable(),
1645
1784
  /** The folder exists on this device. */
1646
- on_disk: z25.boolean(),
1785
+ on_disk: z27.boolean(),
1647
1786
  /** An instance with this profile is running; null when it could not be determined. */
1648
- running: z25.boolean().nullable(),
1787
+ running: z27.boolean().nullable(),
1649
1788
  /** Usage the app recorded for this profile; null when the app exposes none here. */
1650
- usage: z25.array(AppUsageReading).nullable(),
1789
+ usage: z27.array(AppUsageReading).nullable(),
1651
1790
  last_opened_ms: epochMs.nullable()
1652
1791
  });
1653
- var AppsListParams = z25.strictObject({});
1654
- var AppsListResult = z25.strictObject({ apps: z25.array(AppInfo) });
1655
- var AppsProfilesListParams = z25.strictObject({
1792
+ var AppsListParams = z27.strictObject({});
1793
+ var AppsListResult = z27.strictObject({ apps: z27.array(AppInfo) });
1794
+ var AppsProfilesListParams = z27.strictObject({
1656
1795
  /** Only this app's profiles; every app's when absent. */
1657
1796
  app_key: AppKey.optional()
1658
1797
  });
1659
- var AppsProfilesListResult = z25.strictObject({
1660
- profiles: z25.array(AppProfile),
1798
+ var AppsProfilesListResult = z27.strictObject({
1799
+ profiles: z27.array(AppProfile),
1661
1800
  /**
1662
1801
  * Whether the saved rows could be read: false while signed out or offline, when only folders
1663
1802
  * found on disk are listed.
1664
1803
  */
1665
- registry: z25.enum(["ok", "signed_out", "unavailable"])
1804
+ registry: z27.enum(["ok", "signed_out", "unavailable"])
1666
1805
  });
1667
- var AppsProfilesSaveParams = z25.strictObject({
1806
+ var AppsProfilesSaveParams = z27.strictObject({
1668
1807
  id: AppProfileId.optional(),
1669
1808
  app_key: AppKey,
1670
- display_name: z25.string().min(1).max(120),
1671
- account_identity: z25.string().min(3).max(320).nullable(),
1809
+ display_name: z27.string().min(1).max(120),
1810
+ account_identity: z27.string().min(3).max(320).nullable(),
1672
1811
  /** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
1673
1812
  profile_locator: AppProfileLocator.nullable(),
1674
1813
  /** On create with profile_locator null: make a new folder named after display_name instead. */
1675
- new_folder: z25.boolean().default(false)
1814
+ new_folder: z27.boolean().default(false)
1676
1815
  });
1677
1816
  var AppsProfilesSaveResult = AppProfile;
1678
- var AppsProfilesRemoveParams = z25.strictObject({ id: AppProfileId });
1679
- var AppsProfilesRemoveResult = z25.strictObject({ removed: z25.boolean() });
1680
- var AppsOpenParams = z25.strictObject({
1817
+ var AppsProfilesRemoveParams = z27.strictObject({ id: AppProfileId });
1818
+ var AppsProfilesRemoveResult = z27.strictObject({ removed: z27.boolean() });
1819
+ var AppsOpenParams = z27.strictObject({
1681
1820
  app_key: AppKey,
1682
1821
  profile_id: AppProfileId.optional()
1683
1822
  });
1684
- var AppsOpenResult = z25.strictObject({
1823
+ var AppsOpenResult = z27.strictObject({
1685
1824
  /** True when an instance with this profile was already running; it is brought forward. */
1686
- already_running: z25.boolean(),
1825
+ already_running: z27.boolean(),
1687
1826
  folder: AbsPath.nullable()
1688
1827
  });
1689
1828
 
1690
1829
  // src/schema/apps-chats.ts
1691
- import { z as z26 } from "zod";
1692
- var ChatId = z26.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/);
1693
- var ChatPlace = z26.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/);
1694
- var ChatProjectId = z26.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
1695
- var ChatWindow = z26.strictObject({
1830
+ import { z as z28 } from "zod";
1831
+ var ChatId = z28.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/);
1832
+ var ChatPlace = z28.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/);
1833
+ var ChatProjectId = z28.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
1834
+ var ChatWindow = z28.strictObject({
1696
1835
  key: ChatPlace,
1697
1836
  /** The app's default profile (Claude: the main window, which lists every account's chats). */
1698
- main: z26.boolean(),
1837
+ main: z28.boolean(),
1699
1838
  /** The account the window is signed into, when known. */
1700
- account: z26.string().max(320).nullable()
1839
+ account: z28.string().max(320).nullable()
1701
1840
  });
1702
- var ChatProject = z26.strictObject({
1841
+ var ChatProject = z28.strictObject({
1703
1842
  id: ChatProjectId,
1704
- name: z26.string().min(1).max(200),
1705
- archived: z26.boolean(),
1843
+ name: z28.string().min(1).max(200),
1844
+ archived: z28.boolean(),
1706
1845
  /** Chats in it. */
1707
1846
  count: nonNegInt
1708
1847
  });
1709
- var ChatPin = z26.strictObject({
1848
+ var ChatPin = z28.strictObject({
1710
1849
  /** The window whose account pins it; an account with no window of its own is named by its email. */
1711
- window: z26.string().min(1).max(320),
1850
+ window: z28.string().min(1).max(320),
1712
1851
  /** When that account's pin list was last read; null when the reading has no time. */
1713
1852
  observed_at_ms: epochMs.nullable()
1714
1853
  });
1715
- var ChatRunning = z26.strictObject({
1854
+ var ChatRunning = z28.strictObject({
1716
1855
  window: ChatPlace,
1717
1856
  /** process: a live process resumed this chat there (exact); activity: that window's own record moved in the last 3 minutes. */
1718
- how: z26.enum(["process", "activity"])
1857
+ how: z28.enum(["process", "activity"])
1719
1858
  });
1720
- var ChatHidden = z26.strictObject({
1859
+ var ChatHidden = z28.strictObject({
1721
1860
  window: ChatPlace,
1722
- reason: z26.string().max(200)
1861
+ reason: z28.string().max(200)
1723
1862
  });
1724
- var ChatLastUse = z26.strictObject({
1863
+ var ChatLastUse = z28.strictObject({
1725
1864
  /** The conversation's last reply. */
1726
1865
  at_ms: epochMs,
1727
1866
  window: ChatPlace.nullable(),
1728
- account: z26.string().max(320).nullable(),
1867
+ account: z28.string().max(320).nullable(),
1729
1868
  /** How the window was decided (one short line). */
1730
- how: z26.string().max(120).nullable(),
1869
+ how: z28.string().max(120).nullable(),
1731
1870
  /** The account's 1-hour prompt cache is still warm. */
1732
- cache_warm: z26.boolean(),
1871
+ cache_warm: z28.boolean(),
1733
1872
  cache_minutes_left: nonNegInt
1734
1873
  });
1735
- var ChatAppProject = z26.strictObject({
1736
- id: z26.string().min(1).max(200),
1737
- name: z26.string().max(200)
1874
+ var ChatAppProject = z28.strictObject({
1875
+ id: z28.string().min(1).max(200),
1876
+ name: z28.string().max(200)
1738
1877
  });
1739
- var ChatTitleSource = z26.enum(["app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt"]);
1740
- var ChatRow = z26.strictObject({
1878
+ var ChatTitleSource = z28.enum(["app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt"]);
1879
+ var ChatRow = z28.strictObject({
1741
1880
  id: ChatId,
1742
1881
  /** The short id people see (the listing's first 8 characters). */
1743
- short_id: z26.string().max(16),
1882
+ short_id: z28.string().max(16),
1744
1883
  /** The listing's own name (Claude: local_<id>), null for a chat only in the holder. */
1745
- record: z26.string().max(160).nullable(),
1746
- title: z26.string().max(1e3),
1884
+ record: z28.string().max(160).nullable(),
1885
+ title: z28.string().max(1e3),
1747
1886
  last_active_ms: epochMs.nullable(),
1748
1887
  created_ms: epochMs.nullable(),
1749
- projects: z26.array(ChatProjectId).max(500),
1750
- starred: z26.boolean(),
1751
- pinned_in: z26.array(ChatPin).max(200),
1888
+ projects: z28.array(ChatProjectId).max(500),
1889
+ starred: z28.boolean(),
1890
+ pinned_in: z28.array(ChatPin).max(200),
1752
1891
  /** Every place it is listed now: window keys, plus "holder". */
1753
- places: z26.array(ChatPlace).max(200),
1754
- held: z26.boolean(),
1755
- running: z26.array(ChatRunning).max(200),
1756
- hidden_in: z26.array(ChatHidden).max(200),
1892
+ places: z28.array(ChatPlace).max(200),
1893
+ held: z28.boolean(),
1894
+ running: z28.array(ChatRunning).max(200),
1895
+ hidden_in: z28.array(ChatHidden).max(200),
1757
1896
  /** Kept out of the main window on purpose. */
1758
- hidden_from_main: z26.boolean(),
1897
+ hidden_from_main: z28.boolean(),
1759
1898
  /** Listed in a side window and not yet copied into main. */
1760
- main_pending: z26.boolean(),
1899
+ main_pending: z28.boolean(),
1761
1900
  /** A scheduled routine's run (its task id). */
1762
- scheduled: z26.string().max(200).nullable(),
1901
+ scheduled: z28.string().max(200).nullable(),
1763
1902
  /** Created recently and in no project: offered for filing. */
1764
- new_unfiled: z26.boolean(),
1765
- warnings: z26.array(z26.string().max(400)).max(20),
1903
+ new_unfiled: z28.boolean(),
1904
+ warnings: z28.array(z28.string().max(400)).max(20),
1766
1905
  last_use: ChatLastUse.nullable(),
1767
1906
  /** 1.13: the app's own project the chat is grouped under in the app (Codex), read only; absent = none or not an app that groups. */
1768
1907
  app_project: ChatAppProject.optional(),
@@ -1772,335 +1911,335 @@ var ChatRow = z26.strictObject({
1772
1911
  * 1.14: the chat's own title before the person's rename (the one title rule, `@ai-matrx/coding-sessions/sessions`);
1773
1912
  * `title` is what to show (`title_override` when set, else this).
1774
1913
  */
1775
- original_title: z26.string().max(1e3).optional(),
1914
+ original_title: z28.string().max(1e3).optional(),
1776
1915
  /** 1.14: where `original_title` came from (the one rule's sources, strongest first; 1.15: a closed set). */
1777
1916
  title_source: ChatTitleSource.optional(),
1778
1917
  /** 1.14: the person's rename inside Matrx (Coding Sessions), applied once by the row builder; absent = none. */
1779
- title_override: z26.string().min(1).max(300).optional(),
1918
+ title_override: z28.string().min(1).max(300).optional(),
1780
1919
  /** 1.15: the app itself archived it (hidden_in says where and why, in words for people; this is the typed fact). */
1781
- archived: z26.boolean().optional()
1920
+ archived: z28.boolean().optional()
1782
1921
  });
1783
- var ChatFamily = z26.strictObject({
1922
+ var ChatFamily = z28.strictObject({
1784
1923
  id: ChatId,
1785
1924
  fork_of: ChatId.nullable(),
1786
1925
  copy_of: ChatId.nullable()
1787
1926
  });
1788
- var AppsChatsListParams = z26.strictObject({
1927
+ var AppsChatsListParams = z28.strictObject({
1789
1928
  app_key: AppKey,
1790
1929
  /** Only these chats (a live update re-reads just what changed). */
1791
- ids: z26.array(ChatId).max(500).optional()
1930
+ ids: z28.array(ChatId).max(500).optional()
1792
1931
  });
1793
- var AppsChatsListResult = z26.strictObject({
1932
+ var AppsChatsListResult = z28.strictObject({
1794
1933
  app_key: AppKey,
1795
1934
  /** Bumps on every change the index sees; `apps.chats.changed` carries the same number. */
1796
1935
  version: nonNegInt,
1797
- windows: z26.array(ChatWindow).max(200),
1798
- projects: z26.array(ChatProject).max(5e3),
1799
- chats: z26.array(ChatRow).max(2e4),
1936
+ windows: z28.array(ChatWindow).max(200),
1937
+ projects: z28.array(ChatProject).max(5e3),
1938
+ chats: z28.array(ChatRow).max(2e4),
1800
1939
  /** How long a chat in no project counts as new. */
1801
1940
  new_window_ms: nonNegInt,
1802
1941
  /** 1.9: this is the copy saved at the last read, shown while everything is read again. */
1803
- updating: z26.boolean().optional(),
1942
+ updating: z28.boolean().optional(),
1804
1943
  /** 1.9: false while the folder watches are down (changes are not arriving); `apps.chats.watch_state` says when it changes. */
1805
- live: z26.boolean().optional(),
1944
+ live: z28.boolean().optional(),
1806
1945
  /** 1.10: every listed chat that is a fork or a copy of another (read from the conversations' first lines). */
1807
- families: z26.array(ChatFamily).max(2e4).optional()
1946
+ families: z28.array(ChatFamily).max(2e4).optional()
1808
1947
  });
1809
- var AppsChatsWatchParams = z26.strictObject({ app_key: AppKey });
1810
- var AppsChatsWatchResult = z26.strictObject({ resource_id: ResourceId, version: nonNegInt });
1811
- var AppsChatsChangedEvent = z26.strictObject({
1948
+ var AppsChatsWatchParams = z28.strictObject({ app_key: AppKey });
1949
+ var AppsChatsWatchResult = z28.strictObject({ resource_id: ResourceId, version: nonNegInt });
1950
+ var AppsChatsChangedEvent = z28.strictObject({
1812
1951
  app_key: AppKey,
1813
1952
  version: nonNegInt,
1814
- ids: z26.array(ChatId).max(1e3),
1815
- all: z26.boolean()
1953
+ ids: z28.array(ChatId).max(1e3),
1954
+ all: z28.boolean()
1816
1955
  });
1817
- var AppsChatsWatchStateEvent = z26.strictObject({
1956
+ var AppsChatsWatchStateEvent = z28.strictObject({
1818
1957
  app_key: AppKey,
1819
- live: z26.boolean(),
1820
- updating: z26.boolean(),
1821
- reason: z26.string().max(300).nullable()
1958
+ live: z28.boolean(),
1959
+ updating: z28.boolean(),
1960
+ reason: z28.string().max(300).nullable()
1822
1961
  });
1823
- var AppsChatsPlaceParams = z26.strictObject({
1962
+ var AppsChatsPlaceParams = z28.strictObject({
1824
1963
  app_key: AppKey,
1825
1964
  chat_id: ChatId,
1826
- action: z26.enum(["place", "take_off", "hold"]),
1965
+ action: z28.enum(["place", "take_off", "hold"]),
1827
1966
  /** The window (for place and take_off). */
1828
1967
  window: ChatPlace.optional(),
1829
1968
  /** take_off where it is open: stop it there first (the person confirmed). */
1830
- stop_if_open: z26.boolean().default(false)
1969
+ stop_if_open: z28.boolean().default(false)
1831
1970
  });
1832
- var AppsChatsPlaceResult = z26.strictObject({ chat: ChatRow, message: z26.string().max(400) });
1833
- var AppsProjectsFileManyParams = z26.strictObject({
1971
+ var AppsChatsPlaceResult = z28.strictObject({ chat: ChatRow, message: z28.string().max(400) });
1972
+ var AppsProjectsFileManyParams = z28.strictObject({
1834
1973
  app_key: AppKey,
1835
- chat_ids: z26.array(ChatId).min(1).max(500),
1974
+ chat_ids: z28.array(ChatId).min(1).max(500),
1836
1975
  project_id: ChatProjectId.optional(),
1837
- new_project_name: z26.string().min(1).max(200).optional()
1976
+ new_project_name: z28.string().min(1).max(200).optional()
1838
1977
  });
1839
- var AppsProjectsFileManyResult = z26.strictObject({ chats: z26.array(ChatRow).max(500), project: ChatProject });
1840
- var AppsProjectsUpdateParams = z26.strictObject({
1978
+ var AppsProjectsFileManyResult = z28.strictObject({ chats: z28.array(ChatRow).max(500), project: ChatProject });
1979
+ var AppsProjectsUpdateParams = z28.strictObject({
1841
1980
  app_key: AppKey,
1842
1981
  project_id: ChatProjectId,
1843
- name: z26.string().min(1).max(200).optional(),
1844
- archived: z26.boolean().optional()
1982
+ name: z28.string().min(1).max(200).optional(),
1983
+ archived: z28.boolean().optional()
1845
1984
  });
1846
- var AppsProjectsUpdateResult = z26.strictObject({ project: ChatProject });
1847
- var AppsProjectsCopyParams = z26.strictObject({ app_key: AppKey, project_id: ChatProjectId, new_project_name: z26.string().min(1).max(200) });
1848
- var AppsProjectsCopyResult = z26.strictObject({ project: ChatProject });
1849
- var AppsProjectsFileParams = z26.strictObject({
1985
+ var AppsProjectsUpdateResult = z28.strictObject({ project: ChatProject });
1986
+ var AppsProjectsCopyParams = z28.strictObject({ app_key: AppKey, project_id: ChatProjectId, new_project_name: z28.string().min(1).max(200) });
1987
+ var AppsProjectsCopyResult = z28.strictObject({ project: ChatProject });
1988
+ var AppsProjectsFileParams = z28.strictObject({
1850
1989
  app_key: AppKey,
1851
1990
  chat_id: ChatId,
1852
1991
  project_id: ChatProjectId.optional(),
1853
- new_project_name: z26.string().min(1).max(200).optional()
1992
+ new_project_name: z28.string().min(1).max(200).optional()
1854
1993
  });
1855
- var AppsProjectsFileResult = z26.strictObject({ chat: ChatRow, project: ChatProject });
1856
- var AppsProjectsUnfileParams = z26.strictObject({ app_key: AppKey, chat_id: ChatId, project_id: ChatProjectId });
1857
- var AppsProjectsUnfileResult = z26.strictObject({ chat: ChatRow });
1858
- var AppsChatsStarParams = z26.strictObject({ app_key: AppKey, chat_id: ChatId, starred: z26.boolean() });
1859
- var AppsChatsStarResult = z26.strictObject({ chat: ChatRow });
1994
+ var AppsProjectsFileResult = z28.strictObject({ chat: ChatRow, project: ChatProject });
1995
+ var AppsProjectsUnfileParams = z28.strictObject({ app_key: AppKey, chat_id: ChatId, project_id: ChatProjectId });
1996
+ var AppsProjectsUnfileResult = z28.strictObject({ chat: ChatRow });
1997
+ var AppsChatsStarParams = z28.strictObject({ app_key: AppKey, chat_id: ChatId, starred: z28.boolean() });
1998
+ var AppsChatsStarResult = z28.strictObject({ chat: ChatRow });
1860
1999
 
1861
2000
  // src/schema/apps-accounts.ts
1862
- import { z as z27 } from "zod";
1863
- var AppWindowInfo = z27.strictObject({
2001
+ import { z as z29 } from "zod";
2002
+ var AppWindowInfo = z29.strictObject({
1864
2003
  key: ChatPlace,
1865
2004
  /** The app's default profile (Claude: main, which may sign into any account). */
1866
- main: z27.boolean(),
2005
+ main: z29.boolean(),
1867
2006
  /** The account the window is meant for (null for main). */
1868
- account: z27.string().max(320).nullable(),
2007
+ account: z29.string().max(320).nullable(),
1869
2008
  /** The account signed in there now: an email, or the account id while it has no saved name. */
1870
- signed_in: z27.string().max(320).nullable(),
1871
- signed_in_is_email: z27.boolean(),
2009
+ signed_in: z29.string().max(320).nullable(),
2010
+ signed_in_is_email: z29.boolean(),
1872
2011
  /** Signed into another account than the one it is meant for. */
1873
- mismatch: z27.boolean(),
2012
+ mismatch: z29.boolean(),
1874
2013
  /** Its folder exists. */
1875
- created: z27.boolean(),
2014
+ created: z29.boolean(),
1876
2015
  /** Open now. */
1877
- running: z27.boolean(),
2016
+ running: z29.boolean(),
1878
2017
  /** Chats open in it now (a process resuming each one). */
1879
2018
  open_chats: nonNegInt
1880
2019
  });
1881
- var AccountUsage = z27.strictObject({
2020
+ var AccountUsage = z29.strictObject({
1882
2021
  /** The account's email, or "org <8 chars>" when no window has ever sampled that org. */
1883
- account: z27.string().max(320),
1884
- org: z27.string().max(80).nullable(),
2022
+ account: z29.string().max(320),
2023
+ org: z29.string().max(80).nullable(),
1885
2024
  /** False when the org was sampled in several accounts' windows and the vote is not clear (≥ 75 %). */
1886
- account_certain: z27.boolean(),
2025
+ account_certain: z29.boolean(),
1887
2026
  /** 5-hour use in percent (0 once the reading is over 5 hours old). */
1888
- five_hour: z27.number().nullable(),
1889
- five_hour_reset_since: z27.boolean(),
2027
+ five_hour: z29.number().nullable(),
2028
+ five_hour_reset_since: z29.boolean(),
1890
2029
  /** Weekly use in percent (0 once the week reset after the reading). */
1891
- weekly: z27.number().nullable(),
1892
- weekly_reset_since: z27.boolean(),
2030
+ weekly: z29.number().nullable(),
2031
+ weekly_reset_since: z29.boolean(),
1893
2032
  /** Extra-usage spend in percent of its cap, when on. */
1894
- extra_usage: z27.number().nullable(),
2033
+ extra_usage: z29.number().nullable(),
1895
2034
  extra_usage_as_of_ms: epochMs.nullable(),
1896
2035
  as_of_ms: epochMs,
1897
2036
  /** The windows meant for this account (and main when main took the reading). */
1898
- windows: z27.array(ChatPlace).max(200),
2037
+ windows: z29.array(ChatPlace).max(200),
1899
2038
  /** The window that took the reading is open now and the reading is under 30 minutes old. */
1900
- live: z27.boolean(),
2039
+ live: z29.boolean(),
1901
2040
  /** The next weekly reset, when known. */
1902
2041
  weekly_resets_at_ms: epochMs.nullable(),
1903
2042
  /** That reset time is Claude's own (its reading, or a reset seen in its usage history). */
1904
- weekly_reset_official: z27.boolean().nullable(),
2043
+ weekly_reset_official: z29.boolean().nullable(),
1905
2044
  /** 1.13: the account's plan as the app names it (Codex: "pro", "prolite"), when recorded. */
1906
- plan: z27.string().max(80).optional(),
2045
+ plan: z29.string().max(80).optional(),
1907
2046
  /** 1.13: the account's credit balance as the app records it (Codex), when recorded. */
1908
- credits: z27.string().max(40).optional()
2047
+ credits: z29.string().max(40).optional()
1909
2048
  });
1910
- var AccountReset = z27.strictObject({
2049
+ var AccountReset = z29.strictObject({
1911
2050
  window: ChatPlace,
1912
- account: z27.string().max(320).nullable(),
2051
+ account: z29.string().max(320).nullable(),
1913
2052
  next_reset_ms: epochMs.nullable(),
1914
2053
  /** claude: the app's own reading; usage_history: a weekly drop seen in its usage record; your_list: the person's own entry. */
1915
- source: z27.enum(["claude", "usage_history", "your_list"]).nullable(),
2054
+ source: z29.enum(["claude", "usage_history", "your_list"]).nullable(),
1916
2055
  /** claude or usage_history. */
1917
- official: z27.boolean(),
2056
+ official: z29.boolean(),
1918
2057
  /** Set when the person's list disagrees with the official time. */
1919
- note: z27.string().max(200).nullable()
2058
+ note: z29.string().max(200).nullable()
1920
2059
  });
1921
- var AppsWindowsListParams = z27.strictObject({ app_key: AppKey });
1922
- var AppsWindowsListResult = z27.strictObject({ app_key: AppKey, windows: z27.array(AppWindowInfo).max(200) });
1923
- var AppsAccountsUsageParams = z27.strictObject({ app_key: AppKey });
1924
- var AppsAccountsUsageResult = z27.strictObject({
2060
+ var AppsWindowsListParams = z29.strictObject({ app_key: AppKey });
2061
+ var AppsWindowsListResult = z29.strictObject({ app_key: AppKey, windows: z29.array(AppWindowInfo).max(200) });
2062
+ var AppsAccountsUsageParams = z29.strictObject({ app_key: AppKey });
2063
+ var AppsAccountsUsageResult = z29.strictObject({
1925
2064
  app_key: AppKey,
1926
- accounts: z27.array(AccountUsage).max(500),
2065
+ accounts: z29.array(AccountUsage).max(500),
1927
2066
  /** 1.12: the rows are right but something around them failed (a newly read reset time could not be saved); shown, never hidden. */
1928
- problem: z27.string().max(400).optional()
2067
+ problem: z29.string().max(400).optional()
1929
2068
  });
1930
- var AppsAccountsResetsParams = z27.strictObject({ app_key: AppKey });
1931
- var AppsAccountsResetsResult = z27.strictObject({
2069
+ var AppsAccountsResetsParams = z29.strictObject({ app_key: AppKey });
2070
+ var AppsAccountsResetsResult = z29.strictObject({
1932
2071
  app_key: AppKey,
1933
- resets: z27.array(AccountReset).max(200),
2072
+ resets: z29.array(AccountReset).max(200),
1934
2073
  /** 1.12: as on `apps.accounts.usage`. */
1935
- problem: z27.string().max(400).optional()
2074
+ problem: z29.string().max(400).optional()
1936
2075
  });
1937
- var AppsWindowActionResult = z27.strictObject({ message: z27.string().max(400) });
1938
- var AppsWindowsOpenParams = z27.strictObject({ app_key: AppKey, window: ChatPlace });
1939
- var AppsWindowsReloadParams = z27.strictObject({ app_key: AppKey, window: ChatPlace });
1940
- var ShownSection = z27.strictObject({
1941
- title: z27.string().max(300),
2076
+ var AppsWindowActionResult = z29.strictObject({ message: z29.string().max(400) });
2077
+ var AppsWindowsOpenParams = z29.strictObject({ app_key: AppKey, window: ChatPlace });
2078
+ var AppsWindowsReloadParams = z29.strictObject({ app_key: AppKey, window: ChatPlace });
2079
+ var ShownSection = z29.strictObject({
2080
+ title: z29.string().max(300),
1942
2081
  /** Rows drawn under it (a collapsed section draws none). */
1943
- rows: z27.number().int().nonnegative(),
1944
- expanded: z27.boolean()
2082
+ rows: z29.number().int().nonnegative(),
2083
+ expanded: z29.boolean()
1945
2084
  });
1946
- var AppsWindowsShownParams = z27.strictObject({ app_key: AppKey, window: ChatPlace });
1947
- var AppsWindowsShownResult = z27.strictObject({
2085
+ var AppsWindowsShownParams = z29.strictObject({ app_key: AppKey, window: ChatPlace });
2086
+ var AppsWindowsShownResult = z29.strictObject({
1948
2087
  window: ChatPlace,
1949
- open: z27.boolean(),
1950
- sections: z27.array(ShownSection).max(200),
1951
- problem: z27.string().max(400).nullable()
2088
+ open: z29.boolean(),
2089
+ sections: z29.array(ShownSection).max(200),
2090
+ problem: z29.string().max(400).nullable()
1952
2091
  });
1953
- var AppsWindowsRestartParams = z27.strictObject({ app_key: AppKey, window: ChatPlace, force: z27.boolean().default(false) });
1954
- var AppsWindowsRefreshUsageParams = z27.strictObject({ app_key: AppKey, window: ChatPlace });
1955
- var AppsProjectsMoveParams = z27.strictObject({
2092
+ var AppsWindowsRestartParams = z29.strictObject({ app_key: AppKey, window: ChatPlace, force: z29.boolean().default(false) });
2093
+ var AppsWindowsRefreshUsageParams = z29.strictObject({ app_key: AppKey, window: ChatPlace });
2094
+ var AppsProjectsMoveParams = z29.strictObject({
1956
2095
  app_key: AppKey,
1957
2096
  chat_id: ChatId,
1958
2097
  from_project_id: ChatProjectId,
1959
2098
  to_project_id: ChatProjectId.optional(),
1960
- new_project_name: z27.string().min(1).max(200).optional()
1961
- });
1962
- var AppsProjectsMoveResult = z27.strictObject({ chat: ChatRow, project: ChatProject });
1963
- var AppsProjectsCreateParams = z27.strictObject({ app_key: AppKey, name: z27.string().min(1).max(200) });
1964
- var AppsProjectsCreateResult = z27.strictObject({ project: ChatProject });
1965
- var AppsProjectsImportPinsParams = z27.strictObject({ app_key: AppKey });
1966
- var AppsProjectsImportPinsResult = z27.strictObject({ message: z27.string().max(400) });
1967
- var ProjectMoveChat = z27.strictObject({ chat_id: ChatId, title: z27.string().max(300) });
1968
- var ProjectMoveSkip = z27.strictObject({ chat_id: ChatId, title: z27.string().max(300), window: ChatPlace.nullable(), reason: z27.string().max(400) });
1969
- var ProjectMoveGroup = z27.strictObject({
1970
- ok: z27.boolean(),
1971
- name: z27.string().max(200),
2099
+ new_project_name: z29.string().min(1).max(200).optional()
2100
+ });
2101
+ var AppsProjectsMoveResult = z29.strictObject({ chat: ChatRow, project: ChatProject });
2102
+ var AppsProjectsCreateParams = z29.strictObject({ app_key: AppKey, name: z29.string().min(1).max(200) });
2103
+ var AppsProjectsCreateResult = z29.strictObject({ project: ChatProject });
2104
+ var AppsProjectsImportPinsParams = z29.strictObject({ app_key: AppKey });
2105
+ var AppsProjectsImportPinsResult = z29.strictObject({ message: z29.string().max(400) });
2106
+ var ProjectMoveChat = z29.strictObject({ chat_id: ChatId, title: z29.string().max(300) });
2107
+ var ProjectMoveSkip = z29.strictObject({ chat_id: ChatId, title: z29.string().max(300), window: ChatPlace.nullable(), reason: z29.string().max(400) });
2108
+ var ProjectMoveGroup = z29.strictObject({
2109
+ ok: z29.boolean(),
2110
+ name: z29.string().max(200),
1972
2111
  /** Why it is not (or was not) grouped — e.g. the window is open. */
1973
- reason: z27.string().max(400).optional(),
2112
+ reason: z29.string().max(400).optional(),
1974
2113
  /** Chats that get (or got) the group; already in it; taken from another group of the window. */
1975
2114
  assign: nonNegInt.optional(),
1976
2115
  already: nonNegInt.optional(),
1977
2116
  from_other_groups: nonNegInt.optional(),
1978
2117
  /** A group of that name was already there (reused, never doubled). */
1979
- group_exists: z27.boolean().optional()
2118
+ group_exists: z29.boolean().optional()
1980
2119
  });
1981
- var AppsProjectsToWindowParams = z27.strictObject({
2120
+ var AppsProjectsToWindowParams = z29.strictObject({
1982
2121
  app_key: AppKey,
1983
2122
  project_id: ChatProjectId,
1984
2123
  window: ChatPlace,
1985
2124
  /** Also take each chat off its other side windows where safe (never main, the holder, an open window). */
1986
- take_off: z27.boolean().default(false),
2125
+ take_off: z29.boolean().default(false),
1987
2126
  /** Also group them under the project's name in that window's sidebar (closed windows only). */
1988
- group: z27.boolean().default(false),
1989
- dry_run: z27.boolean().default(false)
2127
+ group: z29.boolean().default(false),
2128
+ dry_run: z29.boolean().default(false)
1990
2129
  });
1991
- var AppsProjectsToWindowResult = z27.strictObject({
2130
+ var AppsProjectsToWindowResult = z29.strictObject({
1992
2131
  project_id: ChatProjectId,
1993
2132
  window: ChatPlace,
1994
- dry_run: z27.boolean(),
1995
- place: z27.array(ProjectMoveChat).max(5e3),
1996
- already: z27.array(ProjectMoveChat).max(5e3),
1997
- take_off: z27.array(ProjectMoveChat.extend({ window: ChatPlace })).max(2e4),
1998
- skipped: z27.array(ProjectMoveSkip).max(2e4),
2133
+ dry_run: z29.boolean(),
2134
+ place: z29.array(ProjectMoveChat).max(5e3),
2135
+ already: z29.array(ProjectMoveChat).max(5e3),
2136
+ take_off: z29.array(ProjectMoveChat.extend({ window: ChatPlace })).max(2e4),
2137
+ skipped: z29.array(ProjectMoveSkip).max(2e4),
1999
2138
  /** Chats of the project from other apps (no windows to place into), left as they are. */
2000
2139
  other_apps: nonNegInt,
2001
2140
  group: ProjectMoveGroup.nullable(),
2002
- message: z27.string().max(400)
2141
+ message: z29.string().max(400)
2003
2142
  });
2004
- var ColdChat = z27.strictObject({
2143
+ var ColdChat = z29.strictObject({
2005
2144
  id: ChatId,
2006
- title: z27.string().max(1e3),
2007
- repo: z27.string().max(200).nullable(),
2008
- window: z27.string().max(64).nullable(),
2009
- account: z27.string().max(320).nullable(),
2010
- model_name: z27.string().max(120).nullable(),
2145
+ title: z29.string().max(1e3),
2146
+ repo: z29.string().max(200).nullable(),
2147
+ window: z29.string().max(64).nullable(),
2148
+ account: z29.string().max(320).nullable(),
2149
+ model_name: z29.string().max(120).nullable(),
2011
2150
  context_tokens: nonNegInt,
2012
2151
  cold_at_ms: epochMs,
2013
2152
  /** Waking it once the cache is cold. */
2014
- cold_cost: z27.number().nullable(),
2153
+ cold_cost: z29.number().nullable(),
2015
2154
  /** Waking it while the cache is warm. */
2016
- warm_cost: z27.number().nullable(),
2155
+ warm_cost: z29.number().nullable(),
2017
2156
  /** Its account is on extra usage (a 5-minute cache, and real money). */
2018
- extra_usage: z27.boolean(),
2157
+ extra_usage: z29.boolean(),
2019
2158
  /** A scheduled routine's run. */
2020
- scheduled: z27.boolean(),
2159
+ scheduled: z29.boolean(),
2021
2160
  /** It can be shown in its window (started in the desktop app). */
2022
- openable: z27.boolean(),
2161
+ openable: z29.boolean(),
2023
2162
  /** How its window was decided, or why it can't be opened. */
2024
- how: z27.string().max(200).nullable()
2163
+ how: z29.string().max(200).nullable()
2025
2164
  });
2026
- var AppsChatsColdParams = z27.strictObject({ app_key: AppKey });
2027
- var AppsChatsColdResult = z27.strictObject({
2165
+ var AppsChatsColdParams = z29.strictObject({ app_key: AppKey });
2166
+ var AppsChatsColdResult = z29.strictObject({
2028
2167
  app_key: AppKey,
2029
2168
  /** Waiting for the person with a warm cache, most urgent first. */
2030
- waiting: z27.array(ColdChat).max(2e3),
2169
+ waiting: z29.array(ColdChat).max(2e3),
2031
2170
  /** Went cold in the last while. */
2032
- recently_cold: z27.array(ColdChat).max(2e3),
2171
+ recently_cold: z29.array(ColdChat).max(2e3),
2033
2172
  /** Chats working right now (not waiting). */
2034
2173
  working: nonNegInt
2035
2174
  });
2036
- var AppsChatsOpenParams = z27.strictObject({ app_key: AppKey, chat_id: ChatId, window: ChatPlace.optional() });
2037
- var SpendSplit = z27.strictObject({ main: z27.number(), helpers: z27.number() });
2038
- var SpendScopes = z27.strictObject({ today: SpendSplit, week: SpendSplit });
2039
- var SpendAccount = z27.strictObject({
2040
- account: z27.string().max(320),
2175
+ var AppsChatsOpenParams = z29.strictObject({ app_key: AppKey, chat_id: ChatId, window: ChatPlace.optional() });
2176
+ var SpendSplit = z29.strictObject({ main: z29.number(), helpers: z29.number() });
2177
+ var SpendScopes = z29.strictObject({ today: SpendSplit, week: SpendSplit });
2178
+ var SpendAccount = z29.strictObject({
2179
+ account: z29.string().max(320),
2041
2180
  spend: SpendScopes,
2042
- last_hour: z27.number().nullable(),
2043
- last_5h: z27.number().nullable(),
2044
- five_hour: z27.number().nullable(),
2045
- weekly: z27.number().nullable(),
2181
+ last_hour: z29.number().nullable(),
2182
+ last_5h: z29.number().nullable(),
2183
+ five_hour: z29.number().nullable(),
2184
+ weekly: z29.number().nullable(),
2046
2185
  as_of_ms: epochMs.nullable(),
2047
2186
  weekly_resets_at_ms: epochMs.nullable(),
2048
2187
  /** When the 5-hour or weekly limit is projected to be reached at the current burn. */
2049
2188
  five_hour_full_at_ms: epochMs.nullable(),
2050
2189
  weekly_full_at_ms: epochMs.nullable(),
2051
2190
  /** The reading is too old to project. */
2052
- stale: z27.boolean()
2191
+ stale: z29.boolean()
2053
2192
  });
2054
- var SpendModel = z27.strictObject({ model: z27.string().max(120), name: z27.string().max(120), spend: SpendScopes });
2055
- var SpendChat = z27.strictObject({
2193
+ var SpendModel = z29.strictObject({ model: z29.string().max(120), name: z29.string().max(120), spend: SpendScopes });
2194
+ var SpendChat = z29.strictObject({
2056
2195
  id: ChatId,
2057
- title: z27.string().max(1e3),
2058
- repo: z27.string().max(200).nullable(),
2059
- window: z27.string().max(64).nullable(),
2196
+ title: z29.string().max(1e3),
2197
+ repo: z29.string().max(200).nullable(),
2198
+ window: z29.string().max(64).nullable(),
2060
2199
  spend: SpendScopes,
2061
2200
  helpers: nonNegInt
2062
2201
  });
2063
- var SpendHelper = z27.strictObject({ model: z27.string().max(120), steps: nonNegInt, over_steps: z27.boolean(), description: z27.string().max(400) });
2064
- var SpendLive = z27.strictObject({ id: ChatId, title: z27.string().max(1e3), window: z27.string().max(64).nullable(), helpers: z27.array(SpendHelper).max(200) });
2065
- var SpendIdleScope = z27.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: z27.number(), avoidable: z27.number() });
2066
- var SpendIdle = z27.strictObject({ id: ChatId, chat: z27.string().max(1e3), who: z27.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
2067
- var SpendStart = z27.strictObject({ repo: z27.string().max(200), count: nonNegInt, median: nonNegInt, latest: z27.array(nonNegInt).max(20), alarm: z27.string().max(400).nullable() });
2068
- var AppsSpendParams = z27.strictObject({ app_key: AppKey });
2069
- var AppsSpendResult = z27.strictObject({
2202
+ var SpendHelper = z29.strictObject({ model: z29.string().max(120), steps: nonNegInt, over_steps: z29.boolean(), description: z29.string().max(400) });
2203
+ var SpendLive = z29.strictObject({ id: ChatId, title: z29.string().max(1e3), window: z29.string().max(64).nullable(), helpers: z29.array(SpendHelper).max(200) });
2204
+ var SpendIdleScope = z29.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: z29.number(), avoidable: z29.number() });
2205
+ var SpendIdle = z29.strictObject({ id: ChatId, chat: z29.string().max(1e3), who: z29.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
2206
+ var SpendStart = z29.strictObject({ repo: z29.string().max(200), count: nonNegInt, median: nonNegInt, latest: z29.array(nonNegInt).max(20), alarm: z29.string().max(400).nullable() });
2207
+ var AppsSpendParams = z29.strictObject({ app_key: AppKey });
2208
+ var AppsSpendResult = z29.strictObject({
2070
2209
  app_key: AppKey,
2071
2210
  /** False while older chats are still being read. */
2072
- complete: z27.boolean(),
2073
- today_total: z27.number(),
2074
- week_total: z27.number(),
2075
- idle_today: z27.number(),
2076
- idle_week: z27.number(),
2211
+ complete: z29.boolean(),
2212
+ today_total: z29.number(),
2213
+ week_total: z29.number(),
2214
+ idle_today: z29.number(),
2215
+ idle_week: z29.number(),
2077
2216
  /** Models with no known list price. */
2078
- unpriced: z27.array(z27.string().max(120)).max(100),
2217
+ unpriced: z29.array(z29.string().max(120)).max(100),
2079
2218
  /** Helpers past their step budget, unusual starting sizes. */
2080
- alarms: z27.array(z27.string().max(400)).max(200),
2081
- live: z27.array(SpendLive).max(200),
2082
- accounts: z27.array(SpendAccount).max(200),
2083
- models: z27.array(SpendModel).max(100),
2084
- chats: z27.array(SpendChat).max(500),
2085
- idle: z27.array(SpendIdle).max(500),
2086
- starts: z27.array(SpendStart).max(200)
2087
- });
2088
- var AppsSyncStatusParams = z27.strictObject({ app_key: AppKey });
2089
- var AppsSyncStatusResult = z27.strictObject({
2090
- healthy: z27.boolean(),
2091
- summary: z27.string().max(400),
2092
- problems: z27.array(z27.string().max(400)).max(200),
2093
- warnings: z27.array(z27.string().max(400)).max(200),
2219
+ alarms: z29.array(z29.string().max(400)).max(200),
2220
+ live: z29.array(SpendLive).max(200),
2221
+ accounts: z29.array(SpendAccount).max(200),
2222
+ models: z29.array(SpendModel).max(100),
2223
+ chats: z29.array(SpendChat).max(500),
2224
+ idle: z29.array(SpendIdle).max(500),
2225
+ starts: z29.array(SpendStart).max(200)
2226
+ });
2227
+ var AppsSyncStatusParams = z29.strictObject({ app_key: AppKey });
2228
+ var AppsSyncStatusResult = z29.strictObject({
2229
+ healthy: z29.boolean(),
2230
+ summary: z29.string().max(400),
2231
+ problems: z29.array(z29.string().max(400)).max(200),
2232
+ warnings: z29.array(z29.string().max(400)).max(200),
2094
2233
  /** Accounts seen with no saved name yet (Save account names fixes them). */
2095
- unnamed_accounts: z27.array(z27.string().max(80)).max(200),
2234
+ unnamed_accounts: z29.array(z29.string().max(80)).max(200),
2096
2235
  /** The full report. */
2097
- output: z27.string().max(2e5)
2236
+ output: z29.string().max(2e5)
2098
2237
  });
2099
- var AppsSyncRunParams = z27.strictObject({ app_key: AppKey });
2100
- var AppsWindowsProcessesParams = z27.strictObject({ app_key: AppKey });
2101
- var AppsWindowsProcessesResult = z27.strictObject({ processes: z27.array(z27.string().max(2e3)).max(2e3) });
2102
- var AppsWindowsAddParams = z27.strictObject({ app_key: AppKey, window: ChatPlace, email: z27.string().min(3).max(320) });
2103
- var AppsWindowsSaveNamesParams = z27.strictObject({ app_key: AppKey });
2238
+ var AppsSyncRunParams = z29.strictObject({ app_key: AppKey });
2239
+ var AppsWindowsProcessesParams = z29.strictObject({ app_key: AppKey });
2240
+ var AppsWindowsProcessesResult = z29.strictObject({ processes: z29.array(z29.string().max(2e3)).max(2e3) });
2241
+ var AppsWindowsAddParams = z29.strictObject({ app_key: AppKey, window: ChatPlace, email: z29.string().min(3).max(320) });
2242
+ var AppsWindowsSaveNamesParams = z29.strictObject({ app_key: AppKey });
2104
2243
 
2105
2244
  // src/schema/registry.ts
2106
2245
  var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
@@ -2216,7 +2355,23 @@ var OPS = {
2216
2355
  // 1.21: what a window's sidebar draws (the Move-all grouping check).
2217
2356
  "apps.windows.shown": { params: AppsWindowsShownParams, result: AppsWindowsShownResult, kind: "unary", since: "1.21", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2218
2357
  // Claude Code history (SPEC §6 coding): served by the `coding` Python service through SERVICES below.
2219
- "coding.history.import_missing": { params: CodingHistoryImportMissingParams, result: CodingHistoryImportMissingResult, kind: "unary", since: "1.5", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "CANCELLED", "INTERNAL"] }
2358
+ "coding.history.import_missing": { params: CodingHistoryImportMissingParams, result: CodingHistoryImportMissingResult, kind: "unary", since: "1.5", errors: ["RESOURCE_BUSY", "RESOURCE_GONE", "CANCELLED", "INTERNAL"] },
2359
+ // 1.22: git for agents (core `git`, the system git; the cloud sandbox's /git/* set, SPEC 6.1).
2360
+ "git.status": { params: GitStatusParams, result: GitStatusResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
2361
+ "git.diff": { params: GitDiffParams, result: GitDiffResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
2362
+ "git.log": { params: GitLogParams, result: GitLogResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
2363
+ "git.add": { params: GitAddParams, result: GitOutputResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
2364
+ "git.commit": { params: GitCommitParams, result: GitCommitResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
2365
+ "git.push": { params: GitPushParams, result: GitOutputResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
2366
+ "git.pull": { params: GitPullParams, result: GitOutputResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
2367
+ "git.branch": { params: GitBranchParams, result: GitBranchResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
2368
+ "git.stash": { params: GitStashParams, result: GitOutputResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
2369
+ "git.clone": { params: GitCloneParams, result: GitOutputResult, kind: "unary", since: "1.22", errors: ["NOT_FOUND", "INVALID_PARAMS", "CONFLICT", "PLATFORM_UNSUPPORTED", "TIMEOUT", "INTERNAL"] },
2370
+ // 1.22: the web from this computer (the `tools` Python service: matrx_scraper's local lane).
2371
+ "web.fetch": { params: WebFetchParams, result: WebFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
2372
+ "web.scrape": { params: WebScrapeParams, result: WebScrapeResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
2373
+ "web.search": { params: WebSearchParams, result: WebSearchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
2374
+ "web.fetch_with_browser": { params: WebBrowserFetchParams, result: WebBrowserFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] }
2220
2375
  };
2221
2376
  var EVENTS = {
2222
2377
  "fs.changed": FsChangedEvent,