@ai-matrx/desktop-protocol 0.21.15 → 0.21.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { z } from "zod";
3
3
  import { UUID_SHAPE_PATTERN } from "@ai-matrx/kit/uuid";
4
4
  var PROTOCOL_MAJOR = 1;
5
- var PROTOCOL_MINOR = 22;
5
+ var PROTOCOL_MINOR = 24;
6
6
  var PROTOCOL_VERSION = `${PROTOCOL_MAJOR}.${PROTOCOL_MINOR}`;
7
7
  var ProtocolVersion = z.string().regex(/^[1-9][0-9]{0,2}\.[0-9]{1,3}$/);
8
8
  var RequestId = z.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
@@ -415,6 +415,23 @@ var SysinfoGetResult = z5.strictObject({
415
415
  })
416
416
  )
417
417
  });
418
+ var SysinfoHardwareParams = z5.strictObject({});
419
+ var SysinfoHardwareResult = z5.strictObject({
420
+ /** "Mac Studio", "MacBook Pro", "ThinkPad X1 Carbon". */
421
+ model_name: z5.string().max(128).nullable(),
422
+ /** What tells two of that model apart: "M3 Ultra, 2025", "14-inch, Nov 2023". */
423
+ model_detail: z5.string().max(128).nullable(),
424
+ /** "Mac15,14", the vendor's model number. */
425
+ model_identifier: z5.string().max(128).nullable(),
426
+ /** "Apple M3 Ultra", "Intel Core i7-1185G7". */
427
+ chip: z5.string().max(128).nullable(),
428
+ serial_number: z5.string().max(128).nullable(),
429
+ /** The OS's own name with its release name: "macOS Tahoe", "Windows 11 Pro", "Ubuntu". */
430
+ os_name: z5.string().max(64).nullable(),
431
+ /** "26.6.2". */
432
+ os_version: z5.string().max(64).nullable(),
433
+ os_build: z5.string().max(64).nullable()
434
+ });
418
435
 
419
436
  // src/schema/fs.ts
420
437
  import { z as z6 } from "zod";
@@ -800,24 +817,96 @@ var ModelsStatusResult = z10.strictObject({
800
817
  });
801
818
  var ModelsProgressEvent = z10.strictObject({ request_id: RequestId, progress: MlProgress });
802
819
 
803
- // src/schema/apps.ts
820
+ // src/schema/account.ts
804
821
  import { z as z11 } from "zod";
805
822
  import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN2 } from "@ai-matrx/kit/uuid";
806
- var AppKey = z11.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
807
- var AppProfileId = z11.string().regex(UUID_SHAPE_PATTERN2);
808
- var AppProfileLocator = z11.string().min(1).max(512).regex(/^[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}(\/[A-Za-z0-9 _()+@,-][A-Za-z0-9 ._()+@,-]{0,127}){0,7}$/);
809
- var AppSupport = z11.enum(["supported", "partial", "unsupported"]);
810
- var AppFeatureStatus = z11.strictObject({
823
+ var AccountRowId = z11.string().regex(UUID_SHAPE_PATTERN2);
824
+ var AccountReadState = z11.enum(["ok", "signed_out", "unavailable"]);
825
+ var AccountAgent = z11.strictObject({
826
+ id: AccountRowId,
827
+ name: z11.string().min(1).max(200),
828
+ description: z11.string().max(2e3),
829
+ /** The agent's category ("" when it has none): the library's folders. */
830
+ category: z11.string().max(120),
831
+ /** The agent's kind as the platform names it (user, builtin, orchestra…). */
832
+ agent_type: z11.string().max(40),
833
+ is_favorite: z11.boolean(),
834
+ /** The person owns it (false: shared with them). */
835
+ is_owner: z11.boolean(),
836
+ /** Who shared it, when it is shared with the person. */
837
+ shared_by: z11.string().max(320).nullable(),
838
+ /** The organization it belongs to. */
839
+ organization: z11.string().max(200).nullable(),
840
+ updated_at_ms: epochMs
841
+ });
842
+ var AccountAgentsListParams = z11.strictObject({});
843
+ var AccountAgentsListResult = z11.strictObject({
844
+ state: AccountReadState,
845
+ /** One line when state is not "ok" (what went wrong, in plain words); null otherwise. */
846
+ problem: z11.string().max(300).nullable(),
847
+ agents: z11.array(AccountAgent).max(2e3)
848
+ });
849
+ var VaultItemKind = z11.enum(["login", "passkey", "key", "other"]);
850
+ var VaultFieldSummary = z11.strictObject({
851
+ key: z11.string().min(1).max(120),
852
+ /** visible: shown as written; revealable: copyable on request; sealed: never leaves the server. */
853
+ handling: z11.enum(["visible", "revealable", "sealed"]),
854
+ /** The masked hint the server keeps ("••••ab12"), or "" when it keeps none. */
855
+ hint: z11.string().max(200)
856
+ });
857
+ var VaultItemSummary = z11.strictObject({
858
+ id: AccountRowId,
859
+ name: z11.string().min(1).max(200),
860
+ kind: VaultItemKind,
861
+ /** The platform's definition ("website_login", "native_passkey", "custom"…). */
862
+ definition: z11.string().max(80),
863
+ /** The sign-in's user name hint (its "username" field's hint); null when it has none. */
864
+ username: z11.string().max(200).nullable(),
865
+ /** The sites a sign-in is for. */
866
+ urls: z11.array(z11.string().max(2048)).max(20),
867
+ notes: z11.string().max(4e3).nullable(),
868
+ fields: z11.array(VaultFieldSummary).max(50),
869
+ /** Shared with the person by someone else (Passwords' shared groups). */
870
+ shared: z11.boolean(),
871
+ /** active, or the server's other states (a deleted item waits in "deleted"). */
872
+ status: z11.string().max(40),
873
+ created_at_ms: epochMs,
874
+ updated_at_ms: epochMs
875
+ });
876
+ var AccountVaultListParams = z11.strictObject({});
877
+ var AccountVaultListResult = z11.strictObject({
878
+ state: AccountReadState,
879
+ problem: z11.string().max(300).nullable(),
880
+ items: z11.array(VaultItemSummary).max(5e3)
881
+ });
882
+ var AccountVaultCopyParams = z11.strictObject({
883
+ item_id: AccountRowId,
884
+ field_key: z11.string().min(1).max(120)
885
+ });
886
+ var AccountVaultCopyResult = z11.strictObject({
887
+ copied: z11.boolean(),
888
+ /** When the clipboard is cleared again if it still holds the value (Passwords clears a copied password). */
889
+ clears_at_ms: epochMs
890
+ });
891
+
892
+ // src/schema/apps.ts
893
+ import { z as z12 } from "zod";
894
+ import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN3 } from "@ai-matrx/kit/uuid";
895
+ var AppKey = z12.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);
896
+ var AppProfileId = z12.string().regex(UUID_SHAPE_PATTERN3);
897
+ var AppProfileLocator = z12.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}$/);
898
+ var AppSupport = z12.enum(["supported", "partial", "unsupported"]);
899
+ var AppFeatureStatus = z12.strictObject({
811
900
  status: AppSupport,
812
901
  /** One line, set whenever status is not "supported". */
813
- reason: z11.string().max(140).nullable()
902
+ reason: z12.string().max(140).nullable()
814
903
  });
815
- var AppInfo = z11.strictObject({
904
+ var AppInfo = z12.strictObject({
816
905
  app_key: AppKey,
817
- name: z11.string().max(64),
818
- installed: z11.boolean(),
906
+ name: z12.string().max(64),
907
+ installed: z12.boolean(),
819
908
  /** The app's own version string, or null when it is not installed or does not say. */
820
- version: z11.string().max(64).nullable(),
909
+ version: z12.string().max(64).nullable(),
821
910
  /** The install found (an .app bundle, an .exe, a binary), or null. */
822
911
  location: AbsPath.nullable(),
823
912
  /** Open the app at all on this OS. */
@@ -827,148 +916,148 @@ var AppInfo = z11.strictObject({
827
916
  /** Plan usage read from the app's own files on this OS. */
828
917
  usage: AppFeatureStatus
829
918
  });
830
- var AppUsageReading = z11.strictObject({
831
- window: z11.enum(["five_hour", "weekly", "extra"]),
919
+ var AppUsageReading = z12.strictObject({
920
+ window: z12.enum(["five_hour", "weekly", "extra"]),
832
921
  /** 0–100 for five_hour and weekly; extra-usage spend as a percent of its cap (may pass 100). */
833
- percent: z11.number().min(0).max(1e4),
922
+ percent: z12.number().min(0).max(1e4),
834
923
  /** When the app recorded it. */
835
924
  sampled_at_ms: epochMs,
836
925
  /** True when the window has rolled over since the sample, so the figure has reset. */
837
- reset_since: z11.boolean()
926
+ reset_since: z12.boolean()
838
927
  });
839
- var AppProfile = z11.strictObject({
928
+ var AppProfile = z12.strictObject({
840
929
  /** The row's id; null for a folder found on disk that no row names yet. */
841
930
  id: AppProfileId.nullable(),
842
931
  app_key: AppKey,
843
- display_name: z11.string().min(1).max(120),
932
+ display_name: z12.string().min(1).max(120),
844
933
  /** The account the person means to be signed in here; null when not stated (never guessed). */
845
- account_identity: z11.string().min(3).max(320).nullable(),
934
+ account_identity: z12.string().min(3).max(320).nullable(),
846
935
  profile_locator: AppProfileLocator.nullable(),
847
936
  /** The device the row is tied to; null when the row names none. */
848
937
  device_id: DeviceId.nullable(),
849
938
  /** The folder this profile resolves to on this device; null for a row tied to another device. */
850
939
  folder: AbsPath.nullable(),
851
940
  /** The folder exists on this device. */
852
- on_disk: z11.boolean(),
941
+ on_disk: z12.boolean(),
853
942
  /** An instance with this profile is running; null when it could not be determined. */
854
- running: z11.boolean().nullable(),
943
+ running: z12.boolean().nullable(),
855
944
  /** Usage the app recorded for this profile; null when the app exposes none here. */
856
- usage: z11.array(AppUsageReading).nullable(),
945
+ usage: z12.array(AppUsageReading).nullable(),
857
946
  last_opened_ms: epochMs.nullable()
858
947
  });
859
- var AppsListParams = z11.strictObject({});
860
- var AppsListResult = z11.strictObject({ apps: z11.array(AppInfo) });
861
- var AppsProfilesListParams = z11.strictObject({
948
+ var AppsListParams = z12.strictObject({});
949
+ var AppsListResult = z12.strictObject({ apps: z12.array(AppInfo) });
950
+ var AppsProfilesListParams = z12.strictObject({
862
951
  /** Only this app's profiles; every app's when absent. */
863
952
  app_key: AppKey.optional()
864
953
  });
865
- var AppsProfilesListResult = z11.strictObject({
866
- profiles: z11.array(AppProfile),
954
+ var AppsProfilesListResult = z12.strictObject({
955
+ profiles: z12.array(AppProfile),
867
956
  /**
868
957
  * Whether the saved rows could be read: false while signed out or offline, when only folders
869
958
  * found on disk are listed.
870
959
  */
871
- registry: z11.enum(["ok", "signed_out", "unavailable"])
960
+ registry: z12.enum(["ok", "signed_out", "unavailable"])
872
961
  });
873
- var AppsProfilesSaveParams = z11.strictObject({
962
+ var AppsProfilesSaveParams = z12.strictObject({
874
963
  id: AppProfileId.optional(),
875
964
  app_key: AppKey,
876
- display_name: z11.string().min(1).max(120),
877
- account_identity: z11.string().min(3).max(320).nullable(),
965
+ display_name: z12.string().min(1).max(120),
966
+ account_identity: z12.string().min(3).max(320).nullable(),
878
967
  /** On create: the folder to use (one found on disk), or null for the app's default profile. Ignored on update. */
879
968
  profile_locator: AppProfileLocator.nullable(),
880
969
  /** On create with profile_locator null: make a new folder named after display_name instead. */
881
- new_folder: z11.boolean().default(false)
970
+ new_folder: z12.boolean().default(false)
882
971
  });
883
972
  var AppsProfilesSaveResult = AppProfile;
884
- var AppsProfilesRemoveParams = z11.strictObject({ id: AppProfileId });
885
- var AppsProfilesRemoveResult = z11.strictObject({ removed: z11.boolean() });
886
- var AppsOpenParams = z11.strictObject({
973
+ var AppsProfilesRemoveParams = z12.strictObject({ id: AppProfileId });
974
+ var AppsProfilesRemoveResult = z12.strictObject({ removed: z12.boolean() });
975
+ var AppsOpenParams = z12.strictObject({
887
976
  app_key: AppKey,
888
977
  profile_id: AppProfileId.optional()
889
978
  });
890
- var AppsOpenResult = z11.strictObject({
979
+ var AppsOpenResult = z12.strictObject({
891
980
  /** True when an instance with this profile was already running; it is brought forward. */
892
- already_running: z11.boolean(),
981
+ already_running: z12.boolean(),
893
982
  folder: AbsPath.nullable()
894
983
  });
895
984
 
896
985
  // src/schema/apps-chats.ts
897
- import { z as z12 } from "zod";
898
- var ChatId = z12.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/);
899
- var ChatPlace = z12.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/);
900
- var ChatProjectId = z12.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
901
- var ChatWindow = z12.strictObject({
986
+ import { z as z13 } from "zod";
987
+ var ChatId = z13.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/);
988
+ var ChatPlace = z13.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/);
989
+ var ChatProjectId = z13.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/);
990
+ var ChatWindow = z13.strictObject({
902
991
  key: ChatPlace,
903
992
  /** The app's default profile (Claude: the main window, which lists every account's chats). */
904
- main: z12.boolean(),
993
+ main: z13.boolean(),
905
994
  /** The account the window is signed into, when known. */
906
- account: z12.string().max(320).nullable()
995
+ account: z13.string().max(320).nullable()
907
996
  });
908
- var ChatProject = z12.strictObject({
997
+ var ChatProject = z13.strictObject({
909
998
  id: ChatProjectId,
910
- name: z12.string().min(1).max(200),
911
- archived: z12.boolean(),
999
+ name: z13.string().min(1).max(200),
1000
+ archived: z13.boolean(),
912
1001
  /** Chats in it. */
913
1002
  count: nonNegInt
914
1003
  });
915
- var ChatPin = z12.strictObject({
1004
+ var ChatPin = z13.strictObject({
916
1005
  /** The window whose account pins it; an account with no window of its own is named by its email. */
917
- window: z12.string().min(1).max(320),
1006
+ window: z13.string().min(1).max(320),
918
1007
  /** When that account's pin list was last read; null when the reading has no time. */
919
1008
  observed_at_ms: epochMs.nullable()
920
1009
  });
921
- var ChatRunning = z12.strictObject({
1010
+ var ChatRunning = z13.strictObject({
922
1011
  window: ChatPlace,
923
1012
  /** process: a live process resumed this chat there (exact); activity: that window's own record moved in the last 3 minutes. */
924
- how: z12.enum(["process", "activity"])
1013
+ how: z13.enum(["process", "activity"])
925
1014
  });
926
- var ChatHidden = z12.strictObject({
1015
+ var ChatHidden = z13.strictObject({
927
1016
  window: ChatPlace,
928
- reason: z12.string().max(200)
1017
+ reason: z13.string().max(200)
929
1018
  });
930
- var ChatLastUse = z12.strictObject({
1019
+ var ChatLastUse = z13.strictObject({
931
1020
  /** The conversation's last reply. */
932
1021
  at_ms: epochMs,
933
1022
  window: ChatPlace.nullable(),
934
- account: z12.string().max(320).nullable(),
1023
+ account: z13.string().max(320).nullable(),
935
1024
  /** How the window was decided (one short line). */
936
- how: z12.string().max(120).nullable(),
1025
+ how: z13.string().max(120).nullable(),
937
1026
  /** The account's 1-hour prompt cache is still warm. */
938
- cache_warm: z12.boolean(),
1027
+ cache_warm: z13.boolean(),
939
1028
  cache_minutes_left: nonNegInt
940
1029
  });
941
- var ChatAppProject = z12.strictObject({
942
- id: z12.string().min(1).max(200),
943
- name: z12.string().max(200)
1030
+ var ChatAppProject = z13.strictObject({
1031
+ id: z13.string().min(1).max(200),
1032
+ name: z13.string().max(200)
944
1033
  });
945
- var ChatTitleSource = z12.enum(["app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt"]);
946
- var ChatRow = z12.strictObject({
1034
+ var ChatTitleSource = z13.enum(["app", "app-remembered", "custom-title", "ai-title", "agent-name", "summary", "first-prompt", "last-prompt"]);
1035
+ var ChatRow = z13.strictObject({
947
1036
  id: ChatId,
948
1037
  /** The short id people see (the listing's first 8 characters). */
949
- short_id: z12.string().max(16),
1038
+ short_id: z13.string().max(16),
950
1039
  /** The listing's own name (Claude: local_<id>), null for a chat only in the holder. */
951
- record: z12.string().max(160).nullable(),
952
- title: z12.string().max(1e3),
1040
+ record: z13.string().max(160).nullable(),
1041
+ title: z13.string().max(1e3),
953
1042
  last_active_ms: epochMs.nullable(),
954
1043
  created_ms: epochMs.nullable(),
955
- projects: z12.array(ChatProjectId).max(500),
956
- starred: z12.boolean(),
957
- pinned_in: z12.array(ChatPin).max(200),
1044
+ projects: z13.array(ChatProjectId).max(500),
1045
+ starred: z13.boolean(),
1046
+ pinned_in: z13.array(ChatPin).max(200),
958
1047
  /** Every place it is listed now: window keys, plus "holder". */
959
- places: z12.array(ChatPlace).max(200),
960
- held: z12.boolean(),
961
- running: z12.array(ChatRunning).max(200),
962
- hidden_in: z12.array(ChatHidden).max(200),
1048
+ places: z13.array(ChatPlace).max(200),
1049
+ held: z13.boolean(),
1050
+ running: z13.array(ChatRunning).max(200),
1051
+ hidden_in: z13.array(ChatHidden).max(200),
963
1052
  /** Kept out of the main window on purpose. */
964
- hidden_from_main: z12.boolean(),
1053
+ hidden_from_main: z13.boolean(),
965
1054
  /** Listed in a side window and not yet copied into main. */
966
- main_pending: z12.boolean(),
1055
+ main_pending: z13.boolean(),
967
1056
  /** A scheduled routine's run (its task id). */
968
- scheduled: z12.string().max(200).nullable(),
1057
+ scheduled: z13.string().max(200).nullable(),
969
1058
  /** Created recently and in no project: offered for filing. */
970
- new_unfiled: z12.boolean(),
971
- warnings: z12.array(z12.string().max(400)).max(20),
1059
+ new_unfiled: z13.boolean(),
1060
+ warnings: z13.array(z13.string().max(400)).max(20),
972
1061
  last_use: ChatLastUse.nullable(),
973
1062
  /** 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. */
974
1063
  app_project: ChatAppProject.optional(),
@@ -978,718 +1067,742 @@ var ChatRow = z12.strictObject({
978
1067
  * 1.14: the chat's own title before the person's rename (the one title rule, `@ai-matrx/coding-sessions/sessions`);
979
1068
  * `title` is what to show (`title_override` when set, else this).
980
1069
  */
981
- original_title: z12.string().max(1e3).optional(),
1070
+ original_title: z13.string().max(1e3).optional(),
982
1071
  /** 1.14: where `original_title` came from (the one rule's sources, strongest first; 1.15: a closed set). */
983
1072
  title_source: ChatTitleSource.optional(),
984
1073
  /** 1.14: the person's rename inside Matrx (Coding Sessions), applied once by the row builder; absent = none. */
985
- title_override: z12.string().min(1).max(300).optional(),
1074
+ title_override: z13.string().min(1).max(300).optional(),
986
1075
  /** 1.15: the app itself archived it (hidden_in says where and why, in words for people; this is the typed fact). */
987
- archived: z12.boolean().optional()
1076
+ archived: z13.boolean().optional()
988
1077
  });
989
- var ChatFamily = z12.strictObject({
1078
+ var ChatFamily = z13.strictObject({
990
1079
  id: ChatId,
991
1080
  fork_of: ChatId.nullable(),
992
1081
  copy_of: ChatId.nullable()
993
1082
  });
994
- var AppsChatsListParams = z12.strictObject({
1083
+ var AppsChatsListParams = z13.strictObject({
995
1084
  app_key: AppKey,
996
1085
  /** Only these chats (a live update re-reads just what changed). */
997
- ids: z12.array(ChatId).max(500).optional()
1086
+ ids: z13.array(ChatId).max(500).optional()
998
1087
  });
999
- var AppsChatsListResult = z12.strictObject({
1088
+ var AppsChatsListResult = z13.strictObject({
1000
1089
  app_key: AppKey,
1001
1090
  /** Bumps on every change the index sees; `apps.chats.changed` carries the same number. */
1002
1091
  version: nonNegInt,
1003
- windows: z12.array(ChatWindow).max(200),
1004
- projects: z12.array(ChatProject).max(5e3),
1005
- chats: z12.array(ChatRow).max(2e4),
1092
+ windows: z13.array(ChatWindow).max(200),
1093
+ projects: z13.array(ChatProject).max(5e3),
1094
+ chats: z13.array(ChatRow).max(2e4),
1006
1095
  /** How long a chat in no project counts as new. */
1007
1096
  new_window_ms: nonNegInt,
1008
1097
  /** 1.9: this is the copy saved at the last read, shown while everything is read again. */
1009
- updating: z12.boolean().optional(),
1098
+ updating: z13.boolean().optional(),
1010
1099
  /** 1.9: false while the folder watches are down (changes are not arriving); `apps.chats.watch_state` says when it changes. */
1011
- live: z12.boolean().optional(),
1100
+ live: z13.boolean().optional(),
1012
1101
  /** 1.10: every listed chat that is a fork or a copy of another (read from the conversations' first lines). */
1013
- families: z12.array(ChatFamily).max(2e4).optional()
1102
+ families: z13.array(ChatFamily).max(2e4).optional()
1014
1103
  });
1015
- var AppsChatsWatchParams = z12.strictObject({ app_key: AppKey });
1016
- var AppsChatsWatchResult = z12.strictObject({ resource_id: ResourceId, version: nonNegInt });
1017
- var AppsChatsChangedEvent = z12.strictObject({
1104
+ var AppsChatsWatchParams = z13.strictObject({ app_key: AppKey });
1105
+ var AppsChatsWatchResult = z13.strictObject({ resource_id: ResourceId, version: nonNegInt });
1106
+ var AppsChatsChangedEvent = z13.strictObject({
1018
1107
  app_key: AppKey,
1019
1108
  version: nonNegInt,
1020
- ids: z12.array(ChatId).max(1e3),
1021
- all: z12.boolean()
1109
+ ids: z13.array(ChatId).max(1e3),
1110
+ all: z13.boolean()
1022
1111
  });
1023
- var AppsChatsWatchStateEvent = z12.strictObject({
1112
+ var AppsChatsWatchStateEvent = z13.strictObject({
1024
1113
  app_key: AppKey,
1025
- live: z12.boolean(),
1026
- updating: z12.boolean(),
1027
- reason: z12.string().max(300).nullable()
1114
+ live: z13.boolean(),
1115
+ updating: z13.boolean(),
1116
+ reason: z13.string().max(300).nullable()
1028
1117
  });
1029
- var AppsChatsPlaceParams = z12.strictObject({
1118
+ var AppsChatsPlaceParams = z13.strictObject({
1030
1119
  app_key: AppKey,
1031
1120
  chat_id: ChatId,
1032
- action: z12.enum(["place", "take_off", "hold"]),
1121
+ action: z13.enum(["place", "take_off", "hold"]),
1033
1122
  /** The window (for place and take_off). */
1034
1123
  window: ChatPlace.optional(),
1035
1124
  /** take_off where it is open: stop it there first (the person confirmed). */
1036
- stop_if_open: z12.boolean().default(false)
1125
+ stop_if_open: z13.boolean().default(false)
1037
1126
  });
1038
- var AppsChatsPlaceResult = z12.strictObject({ chat: ChatRow, message: z12.string().max(400) });
1039
- var AppsProjectsFileManyParams = z12.strictObject({
1127
+ var AppsChatsPlaceResult = z13.strictObject({ chat: ChatRow, message: z13.string().max(400) });
1128
+ var AppsProjectsFileManyParams = z13.strictObject({
1040
1129
  app_key: AppKey,
1041
- chat_ids: z12.array(ChatId).min(1).max(500),
1130
+ chat_ids: z13.array(ChatId).min(1).max(500),
1042
1131
  project_id: ChatProjectId.optional(),
1043
- new_project_name: z12.string().min(1).max(200).optional()
1132
+ new_project_name: z13.string().min(1).max(200).optional()
1044
1133
  });
1045
- var AppsProjectsFileManyResult = z12.strictObject({ chats: z12.array(ChatRow).max(500), project: ChatProject });
1046
- var AppsProjectsUpdateParams = z12.strictObject({
1134
+ var AppsProjectsFileManyResult = z13.strictObject({ chats: z13.array(ChatRow).max(500), project: ChatProject });
1135
+ var AppsProjectsUpdateParams = z13.strictObject({
1047
1136
  app_key: AppKey,
1048
1137
  project_id: ChatProjectId,
1049
- name: z12.string().min(1).max(200).optional(),
1050
- archived: z12.boolean().optional()
1138
+ name: z13.string().min(1).max(200).optional(),
1139
+ archived: z13.boolean().optional()
1051
1140
  });
1052
- var AppsProjectsUpdateResult = z12.strictObject({ project: ChatProject });
1053
- var AppsProjectsCopyParams = z12.strictObject({ app_key: AppKey, project_id: ChatProjectId, new_project_name: z12.string().min(1).max(200) });
1054
- var AppsProjectsCopyResult = z12.strictObject({ project: ChatProject });
1055
- var AppsProjectsFileParams = z12.strictObject({
1141
+ var AppsProjectsUpdateResult = z13.strictObject({ project: ChatProject });
1142
+ var AppsProjectsCopyParams = z13.strictObject({ app_key: AppKey, project_id: ChatProjectId, new_project_name: z13.string().min(1).max(200) });
1143
+ var AppsProjectsCopyResult = z13.strictObject({ project: ChatProject });
1144
+ var AppsProjectsFileParams = z13.strictObject({
1056
1145
  app_key: AppKey,
1057
1146
  chat_id: ChatId,
1058
1147
  project_id: ChatProjectId.optional(),
1059
- new_project_name: z12.string().min(1).max(200).optional()
1148
+ new_project_name: z13.string().min(1).max(200).optional()
1060
1149
  });
1061
- var AppsProjectsFileResult = z12.strictObject({ chat: ChatRow, project: ChatProject });
1062
- var AppsProjectsUnfileParams = z12.strictObject({ app_key: AppKey, chat_id: ChatId, project_id: ChatProjectId });
1063
- var AppsProjectsUnfileResult = z12.strictObject({ chat: ChatRow });
1064
- var AppsChatsStarParams = z12.strictObject({ app_key: AppKey, chat_id: ChatId, starred: z12.boolean() });
1065
- var AppsChatsStarResult = z12.strictObject({ chat: ChatRow });
1150
+ var AppsProjectsFileResult = z13.strictObject({ chat: ChatRow, project: ChatProject });
1151
+ var AppsProjectsUnfileParams = z13.strictObject({ app_key: AppKey, chat_id: ChatId, project_id: ChatProjectId });
1152
+ var AppsProjectsUnfileResult = z13.strictObject({ chat: ChatRow });
1153
+ var AppsChatsStarParams = z13.strictObject({ app_key: AppKey, chat_id: ChatId, starred: z13.boolean() });
1154
+ var AppsChatsStarResult = z13.strictObject({ chat: ChatRow });
1066
1155
 
1067
1156
  // src/schema/apps-accounts.ts
1068
- import { z as z13 } from "zod";
1069
- var AppWindowInfo = z13.strictObject({
1157
+ import { z as z14 } from "zod";
1158
+ var AppWindowInfo = z14.strictObject({
1070
1159
  key: ChatPlace,
1071
1160
  /** The app's default profile (Claude: main, which may sign into any account). */
1072
- main: z13.boolean(),
1161
+ main: z14.boolean(),
1073
1162
  /** The account the window is meant for (null for main). */
1074
- account: z13.string().max(320).nullable(),
1163
+ account: z14.string().max(320).nullable(),
1075
1164
  /** The account signed in there now: an email, or the account id while it has no saved name. */
1076
- signed_in: z13.string().max(320).nullable(),
1077
- signed_in_is_email: z13.boolean(),
1165
+ signed_in: z14.string().max(320).nullable(),
1166
+ signed_in_is_email: z14.boolean(),
1078
1167
  /** Signed into another account than the one it is meant for. */
1079
- mismatch: z13.boolean(),
1168
+ mismatch: z14.boolean(),
1080
1169
  /** Its folder exists. */
1081
- created: z13.boolean(),
1170
+ created: z14.boolean(),
1082
1171
  /** Open now. */
1083
- running: z13.boolean(),
1172
+ running: z14.boolean(),
1084
1173
  /** Chats open in it now (a process resuming each one). */
1085
1174
  open_chats: nonNegInt
1086
1175
  });
1087
- var AccountUsage = z13.strictObject({
1176
+ var AccountUsage = z14.strictObject({
1088
1177
  /** The account's email, or "org <8 chars>" when no window has ever sampled that org. */
1089
- account: z13.string().max(320),
1090
- org: z13.string().max(80).nullable(),
1178
+ account: z14.string().max(320),
1179
+ org: z14.string().max(80).nullable(),
1091
1180
  /** False when the org was sampled in several accounts' windows and the vote is not clear (≥ 75 %). */
1092
- account_certain: z13.boolean(),
1181
+ account_certain: z14.boolean(),
1093
1182
  /** 5-hour use in percent (0 once the reading is over 5 hours old). */
1094
- five_hour: z13.number().nullable(),
1095
- five_hour_reset_since: z13.boolean(),
1183
+ five_hour: z14.number().nullable(),
1184
+ five_hour_reset_since: z14.boolean(),
1096
1185
  /** Weekly use in percent (0 once the week reset after the reading). */
1097
- weekly: z13.number().nullable(),
1098
- weekly_reset_since: z13.boolean(),
1186
+ weekly: z14.number().nullable(),
1187
+ weekly_reset_since: z14.boolean(),
1099
1188
  /** Extra-usage spend in percent of its cap, when on. */
1100
- extra_usage: z13.number().nullable(),
1189
+ extra_usage: z14.number().nullable(),
1101
1190
  extra_usage_as_of_ms: epochMs.nullable(),
1102
1191
  as_of_ms: epochMs,
1103
1192
  /** The windows meant for this account (and main when main took the reading). */
1104
- windows: z13.array(ChatPlace).max(200),
1193
+ windows: z14.array(ChatPlace).max(200),
1105
1194
  /** The window that took the reading is open now and the reading is under 30 minutes old. */
1106
- live: z13.boolean(),
1195
+ live: z14.boolean(),
1107
1196
  /** The next weekly reset, when known. */
1108
1197
  weekly_resets_at_ms: epochMs.nullable(),
1109
1198
  /** That reset time is Claude's own (its reading, or a reset seen in its usage history). */
1110
- weekly_reset_official: z13.boolean().nullable(),
1199
+ weekly_reset_official: z14.boolean().nullable(),
1111
1200
  /** 1.13: the account's plan as the app names it (Codex: "pro", "prolite"), when recorded. */
1112
- plan: z13.string().max(80).optional(),
1201
+ plan: z14.string().max(80).optional(),
1113
1202
  /** 1.13: the account's credit balance as the app records it (Codex), when recorded. */
1114
- credits: z13.string().max(40).optional()
1203
+ credits: z14.string().max(40).optional()
1115
1204
  });
1116
- var AccountReset = z13.strictObject({
1205
+ var AccountReset = z14.strictObject({
1117
1206
  window: ChatPlace,
1118
- account: z13.string().max(320).nullable(),
1207
+ account: z14.string().max(320).nullable(),
1119
1208
  next_reset_ms: epochMs.nullable(),
1120
1209
  /** claude: the app's own reading; usage_history: a weekly drop seen in its usage record; your_list: the person's own entry. */
1121
- source: z13.enum(["claude", "usage_history", "your_list"]).nullable(),
1210
+ source: z14.enum(["claude", "usage_history", "your_list"]).nullable(),
1122
1211
  /** claude or usage_history. */
1123
- official: z13.boolean(),
1212
+ official: z14.boolean(),
1124
1213
  /** Set when the person's list disagrees with the official time. */
1125
- note: z13.string().max(200).nullable()
1214
+ note: z14.string().max(200).nullable()
1126
1215
  });
1127
- var AppsWindowsListParams = z13.strictObject({ app_key: AppKey });
1128
- var AppsWindowsListResult = z13.strictObject({ app_key: AppKey, windows: z13.array(AppWindowInfo).max(200) });
1129
- var AppsAccountsUsageParams = z13.strictObject({ app_key: AppKey });
1130
- var AppsAccountsUsageResult = z13.strictObject({
1216
+ var AppsWindowsListParams = z14.strictObject({ app_key: AppKey });
1217
+ var AppsWindowsListResult = z14.strictObject({ app_key: AppKey, windows: z14.array(AppWindowInfo).max(200) });
1218
+ var AppsAccountsUsageParams = z14.strictObject({ app_key: AppKey });
1219
+ var AppsAccountsUsageResult = z14.strictObject({
1131
1220
  app_key: AppKey,
1132
- accounts: z13.array(AccountUsage).max(500),
1221
+ accounts: z14.array(AccountUsage).max(500),
1133
1222
  /** 1.12: the rows are right but something around them failed (a newly read reset time could not be saved); shown, never hidden. */
1134
- problem: z13.string().max(400).optional()
1223
+ problem: z14.string().max(400).optional()
1135
1224
  });
1136
- var AppsAccountsResetsParams = z13.strictObject({ app_key: AppKey });
1137
- var AppsAccountsResetsResult = z13.strictObject({
1225
+ var AppsAccountsResetsParams = z14.strictObject({ app_key: AppKey });
1226
+ var AppsAccountsResetsResult = z14.strictObject({
1138
1227
  app_key: AppKey,
1139
- resets: z13.array(AccountReset).max(200),
1228
+ resets: z14.array(AccountReset).max(200),
1140
1229
  /** 1.12: as on `apps.accounts.usage`. */
1141
- problem: z13.string().max(400).optional()
1230
+ problem: z14.string().max(400).optional()
1142
1231
  });
1143
- var AppsWindowActionResult = z13.strictObject({ message: z13.string().max(400) });
1144
- var AppsWindowsOpenParams = z13.strictObject({ app_key: AppKey, window: ChatPlace });
1145
- var AppsWindowsReloadParams = z13.strictObject({ app_key: AppKey, window: ChatPlace });
1146
- var ShownSection = z13.strictObject({
1147
- title: z13.string().max(300),
1232
+ var AppsWindowActionResult = z14.strictObject({ message: z14.string().max(400) });
1233
+ var AppsWindowsOpenParams = z14.strictObject({ app_key: AppKey, window: ChatPlace });
1234
+ var AppsWindowsReloadParams = z14.strictObject({ app_key: AppKey, window: ChatPlace });
1235
+ var ShownSection = z14.strictObject({
1236
+ title: z14.string().max(300),
1148
1237
  /** Rows drawn under it (a collapsed section draws none). */
1149
- rows: z13.number().int().nonnegative(),
1150
- expanded: z13.boolean()
1238
+ rows: z14.number().int().nonnegative(),
1239
+ expanded: z14.boolean()
1151
1240
  });
1152
- var AppsWindowsShownParams = z13.strictObject({ app_key: AppKey, window: ChatPlace });
1153
- var AppsWindowsShownResult = z13.strictObject({
1241
+ var AppsWindowsShownParams = z14.strictObject({ app_key: AppKey, window: ChatPlace });
1242
+ var AppsWindowsShownResult = z14.strictObject({
1154
1243
  window: ChatPlace,
1155
- open: z13.boolean(),
1156
- sections: z13.array(ShownSection).max(200),
1157
- problem: z13.string().max(400).nullable()
1244
+ open: z14.boolean(),
1245
+ sections: z14.array(ShownSection).max(200),
1246
+ problem: z14.string().max(400).nullable()
1158
1247
  });
1159
- var AppsWindowsRestartParams = z13.strictObject({ app_key: AppKey, window: ChatPlace, force: z13.boolean().default(false) });
1160
- var AppsWindowsRefreshUsageParams = z13.strictObject({ app_key: AppKey, window: ChatPlace });
1161
- var AppsProjectsMoveParams = z13.strictObject({
1248
+ var AppsWindowsRestartParams = z14.strictObject({ app_key: AppKey, window: ChatPlace, force: z14.boolean().default(false) });
1249
+ var AppsWindowsRefreshUsageParams = z14.strictObject({ app_key: AppKey, window: ChatPlace });
1250
+ var AppsProjectsMoveParams = z14.strictObject({
1162
1251
  app_key: AppKey,
1163
1252
  chat_id: ChatId,
1164
1253
  from_project_id: ChatProjectId,
1165
1254
  to_project_id: ChatProjectId.optional(),
1166
- new_project_name: z13.string().min(1).max(200).optional()
1167
- });
1168
- var AppsProjectsMoveResult = z13.strictObject({ chat: ChatRow, project: ChatProject });
1169
- var AppsProjectsCreateParams = z13.strictObject({ app_key: AppKey, name: z13.string().min(1).max(200) });
1170
- var AppsProjectsCreateResult = z13.strictObject({ project: ChatProject });
1171
- var AppsProjectsImportPinsParams = z13.strictObject({ app_key: AppKey });
1172
- var AppsProjectsImportPinsResult = z13.strictObject({ message: z13.string().max(400) });
1173
- var ProjectMoveChat = z13.strictObject({ chat_id: ChatId, title: z13.string().max(300) });
1174
- var ProjectMoveSkip = z13.strictObject({ chat_id: ChatId, title: z13.string().max(300), window: ChatPlace.nullable(), reason: z13.string().max(400) });
1175
- var ProjectMoveGroup = z13.strictObject({
1176
- ok: z13.boolean(),
1177
- name: z13.string().max(200),
1255
+ new_project_name: z14.string().min(1).max(200).optional()
1256
+ });
1257
+ var AppsProjectsMoveResult = z14.strictObject({ chat: ChatRow, project: ChatProject });
1258
+ var AppsProjectsCreateParams = z14.strictObject({ app_key: AppKey, name: z14.string().min(1).max(200) });
1259
+ var AppsProjectsCreateResult = z14.strictObject({ project: ChatProject });
1260
+ var AppsProjectsImportPinsParams = z14.strictObject({ app_key: AppKey });
1261
+ var AppsProjectsImportPinsResult = z14.strictObject({ message: z14.string().max(400) });
1262
+ var ProjectMoveChat = z14.strictObject({ chat_id: ChatId, title: z14.string().max(300) });
1263
+ var ProjectMoveSkip = z14.strictObject({ chat_id: ChatId, title: z14.string().max(300), window: ChatPlace.nullable(), reason: z14.string().max(400) });
1264
+ var ProjectMoveGroup = z14.strictObject({
1265
+ ok: z14.boolean(),
1266
+ name: z14.string().max(200),
1178
1267
  /** Why it is not (or was not) grouped — e.g. the window is open. */
1179
- reason: z13.string().max(400).optional(),
1268
+ reason: z14.string().max(400).optional(),
1180
1269
  /** Chats that get (or got) the group; already in it; taken from another group of the window. */
1181
1270
  assign: nonNegInt.optional(),
1182
1271
  already: nonNegInt.optional(),
1183
1272
  from_other_groups: nonNegInt.optional(),
1184
1273
  /** A group of that name was already there (reused, never doubled). */
1185
- group_exists: z13.boolean().optional()
1274
+ group_exists: z14.boolean().optional()
1186
1275
  });
1187
- var AppsProjectsToWindowParams = z13.strictObject({
1276
+ var AppsProjectsToWindowParams = z14.strictObject({
1188
1277
  app_key: AppKey,
1189
1278
  project_id: ChatProjectId,
1190
1279
  window: ChatPlace,
1191
1280
  /** Also take each chat off its other side windows where safe (never main, the holder, an open window). */
1192
- take_off: z13.boolean().default(false),
1281
+ take_off: z14.boolean().default(false),
1193
1282
  /** Also group them under the project's name in that window's sidebar (closed windows only). */
1194
- group: z13.boolean().default(false),
1195
- dry_run: z13.boolean().default(false)
1283
+ group: z14.boolean().default(false),
1284
+ dry_run: z14.boolean().default(false)
1196
1285
  });
1197
- var AppsProjectsToWindowResult = z13.strictObject({
1286
+ var AppsProjectsToWindowResult = z14.strictObject({
1198
1287
  project_id: ChatProjectId,
1199
1288
  window: ChatPlace,
1200
- dry_run: z13.boolean(),
1201
- place: z13.array(ProjectMoveChat).max(5e3),
1202
- already: z13.array(ProjectMoveChat).max(5e3),
1203
- take_off: z13.array(ProjectMoveChat.extend({ window: ChatPlace })).max(2e4),
1204
- skipped: z13.array(ProjectMoveSkip).max(2e4),
1289
+ dry_run: z14.boolean(),
1290
+ place: z14.array(ProjectMoveChat).max(5e3),
1291
+ already: z14.array(ProjectMoveChat).max(5e3),
1292
+ take_off: z14.array(ProjectMoveChat.extend({ window: ChatPlace })).max(2e4),
1293
+ skipped: z14.array(ProjectMoveSkip).max(2e4),
1205
1294
  /** Chats of the project from other apps (no windows to place into), left as they are. */
1206
1295
  other_apps: nonNegInt,
1207
1296
  group: ProjectMoveGroup.nullable(),
1208
- message: z13.string().max(400)
1297
+ message: z14.string().max(400)
1209
1298
  });
1210
- var ColdChat = z13.strictObject({
1299
+ var ColdChat = z14.strictObject({
1211
1300
  id: ChatId,
1212
- title: z13.string().max(1e3),
1213
- repo: z13.string().max(200).nullable(),
1214
- window: z13.string().max(64).nullable(),
1215
- account: z13.string().max(320).nullable(),
1216
- model_name: z13.string().max(120).nullable(),
1301
+ title: z14.string().max(1e3),
1302
+ repo: z14.string().max(200).nullable(),
1303
+ window: z14.string().max(64).nullable(),
1304
+ account: z14.string().max(320).nullable(),
1305
+ model_name: z14.string().max(120).nullable(),
1217
1306
  context_tokens: nonNegInt,
1218
1307
  cold_at_ms: epochMs,
1219
1308
  /** Waking it once the cache is cold. */
1220
- cold_cost: z13.number().nullable(),
1309
+ cold_cost: z14.number().nullable(),
1221
1310
  /** Waking it while the cache is warm. */
1222
- warm_cost: z13.number().nullable(),
1311
+ warm_cost: z14.number().nullable(),
1223
1312
  /** Its account is on extra usage (a 5-minute cache, and real money). */
1224
- extra_usage: z13.boolean(),
1313
+ extra_usage: z14.boolean(),
1225
1314
  /** A scheduled routine's run. */
1226
- scheduled: z13.boolean(),
1315
+ scheduled: z14.boolean(),
1227
1316
  /** It can be shown in its window (started in the desktop app). */
1228
- openable: z13.boolean(),
1317
+ openable: z14.boolean(),
1229
1318
  /** How its window was decided, or why it can't be opened. */
1230
- how: z13.string().max(200).nullable()
1319
+ how: z14.string().max(200).nullable()
1231
1320
  });
1232
- var AppsChatsColdParams = z13.strictObject({ app_key: AppKey });
1233
- var AppsChatsColdResult = z13.strictObject({
1321
+ var AppsChatsColdParams = z14.strictObject({ app_key: AppKey });
1322
+ var AppsChatsColdResult = z14.strictObject({
1234
1323
  app_key: AppKey,
1235
1324
  /** Waiting for the person with a warm cache, most urgent first. */
1236
- waiting: z13.array(ColdChat).max(2e3),
1325
+ waiting: z14.array(ColdChat).max(2e3),
1237
1326
  /** Went cold in the last while. */
1238
- recently_cold: z13.array(ColdChat).max(2e3),
1327
+ recently_cold: z14.array(ColdChat).max(2e3),
1239
1328
  /** Chats working right now (not waiting). */
1240
1329
  working: nonNegInt
1241
1330
  });
1242
- var AppsChatsOpenParams = z13.strictObject({ app_key: AppKey, chat_id: ChatId, window: ChatPlace.optional() });
1243
- var SpendSplit = z13.strictObject({ main: z13.number(), helpers: z13.number() });
1244
- var SpendScopes = z13.strictObject({ today: SpendSplit, week: SpendSplit });
1245
- var SpendAccount = z13.strictObject({
1246
- account: z13.string().max(320),
1331
+ var AppsChatsOpenParams = z14.strictObject({ app_key: AppKey, chat_id: ChatId, window: ChatPlace.optional() });
1332
+ var SpendSplit = z14.strictObject({ main: z14.number(), helpers: z14.number() });
1333
+ var SpendScopes = z14.strictObject({ today: SpendSplit, week: SpendSplit });
1334
+ var SpendAccount = z14.strictObject({
1335
+ account: z14.string().max(320),
1247
1336
  spend: SpendScopes,
1248
- last_hour: z13.number().nullable(),
1249
- last_5h: z13.number().nullable(),
1250
- five_hour: z13.number().nullable(),
1251
- weekly: z13.number().nullable(),
1337
+ last_hour: z14.number().nullable(),
1338
+ last_5h: z14.number().nullable(),
1339
+ five_hour: z14.number().nullable(),
1340
+ weekly: z14.number().nullable(),
1252
1341
  as_of_ms: epochMs.nullable(),
1253
1342
  weekly_resets_at_ms: epochMs.nullable(),
1254
1343
  /** When the 5-hour or weekly limit is projected to be reached at the current burn. */
1255
1344
  five_hour_full_at_ms: epochMs.nullable(),
1256
1345
  weekly_full_at_ms: epochMs.nullable(),
1257
1346
  /** The reading is too old to project. */
1258
- stale: z13.boolean()
1347
+ stale: z14.boolean()
1259
1348
  });
1260
- var SpendModel = z13.strictObject({ model: z13.string().max(120), name: z13.string().max(120), spend: SpendScopes });
1261
- var SpendChat = z13.strictObject({
1349
+ var SpendModel = z14.strictObject({ model: z14.string().max(120), name: z14.string().max(120), spend: SpendScopes });
1350
+ var SpendChat = z14.strictObject({
1262
1351
  id: ChatId,
1263
- title: z13.string().max(1e3),
1264
- repo: z13.string().max(200).nullable(),
1265
- window: z13.string().max(64).nullable(),
1352
+ title: z14.string().max(1e3),
1353
+ repo: z14.string().max(200).nullable(),
1354
+ window: z14.string().max(64).nullable(),
1266
1355
  spend: SpendScopes,
1267
1356
  helpers: nonNegInt
1268
1357
  });
1269
- var SpendHelper = z13.strictObject({ model: z13.string().max(120), steps: nonNegInt, over_steps: z13.boolean(), description: z13.string().max(400) });
1270
- var SpendLive = z13.strictObject({ id: ChatId, title: z13.string().max(1e3), window: z13.string().max(64).nullable(), helpers: z13.array(SpendHelper).max(200) });
1271
- var SpendIdleScope = z13.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: z13.number(), avoidable: z13.number() });
1272
- var SpendIdle = z13.strictObject({ id: ChatId, chat: z13.string().max(1e3), who: z13.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
1273
- var SpendStart = z13.strictObject({ repo: z13.string().max(200), count: nonNegInt, median: nonNegInt, latest: z13.array(nonNegInt).max(20), alarm: z13.string().max(400).nullable() });
1274
- var AppsSpendParams = z13.strictObject({ app_key: AppKey });
1275
- var AppsSpendResult = z13.strictObject({
1358
+ var SpendHelper = z14.strictObject({ model: z14.string().max(120), steps: nonNegInt, over_steps: z14.boolean(), description: z14.string().max(400) });
1359
+ var SpendLive = z14.strictObject({ id: ChatId, title: z14.string().max(1e3), window: z14.string().max(64).nullable(), helpers: z14.array(SpendHelper).max(200) });
1360
+ var SpendIdleScope = z14.strictObject({ count: nonNegInt, tokens: nonNegInt, cost: z14.number(), avoidable: z14.number() });
1361
+ var SpendIdle = z14.strictObject({ id: ChatId, chat: z14.string().max(1e3), who: z14.string().max(400), today: SpendIdleScope, week: SpendIdleScope, last_ms: epochMs });
1362
+ var SpendStart = z14.strictObject({ repo: z14.string().max(200), count: nonNegInt, median: nonNegInt, latest: z14.array(nonNegInt).max(20), alarm: z14.string().max(400).nullable() });
1363
+ var SpendDay = z14.strictObject({ date: z14.string().regex(/^\d{4}-\d{2}-\d{2}$/), main: z14.number(), helpers: z14.number() });
1364
+ var AppsSpendParams = z14.strictObject({ app_key: AppKey });
1365
+ var AppsSpendResult = z14.strictObject({
1276
1366
  app_key: AppKey,
1277
1367
  /** False while older chats are still being read. */
1278
- complete: z13.boolean(),
1279
- today_total: z13.number(),
1280
- week_total: z13.number(),
1281
- idle_today: z13.number(),
1282
- idle_week: z13.number(),
1368
+ complete: z14.boolean(),
1369
+ today_total: z14.number(),
1370
+ week_total: z14.number(),
1371
+ idle_today: z14.number(),
1372
+ idle_week: z14.number(),
1283
1373
  /** Models with no known list price. */
1284
- unpriced: z13.array(z13.string().max(120)).max(100),
1374
+ unpriced: z14.array(z14.string().max(120)).max(100),
1285
1375
  /** Helpers past their step budget, unusual starting sizes. */
1286
- alarms: z13.array(z13.string().max(400)).max(200),
1287
- live: z13.array(SpendLive).max(200),
1288
- accounts: z13.array(SpendAccount).max(200),
1289
- models: z13.array(SpendModel).max(100),
1290
- chats: z13.array(SpendChat).max(500),
1291
- idle: z13.array(SpendIdle).max(500),
1292
- starts: z13.array(SpendStart).max(200)
1293
- });
1294
- var AppsSyncStatusParams = z13.strictObject({ app_key: AppKey });
1295
- var AppsSyncStatusResult = z13.strictObject({
1296
- healthy: z13.boolean(),
1297
- summary: z13.string().max(400),
1298
- problems: z13.array(z13.string().max(400)).max(200),
1299
- warnings: z13.array(z13.string().max(400)).max(200),
1376
+ alarms: z14.array(z14.string().max(400)).max(200),
1377
+ live: z14.array(SpendLive).max(200),
1378
+ accounts: z14.array(SpendAccount).max(200),
1379
+ models: z14.array(SpendModel).max(100),
1380
+ /** (1.24) The last 7 days, oldest first (today last). */
1381
+ days: z14.array(SpendDay).max(14).optional(),
1382
+ chats: z14.array(SpendChat).max(500),
1383
+ idle: z14.array(SpendIdle).max(500),
1384
+ starts: z14.array(SpendStart).max(200)
1385
+ });
1386
+ var AppsSyncStatusParams = z14.strictObject({ app_key: AppKey });
1387
+ var AppsSyncStatusResult = z14.strictObject({
1388
+ healthy: z14.boolean(),
1389
+ summary: z14.string().max(400),
1390
+ problems: z14.array(z14.string().max(400)).max(200),
1391
+ warnings: z14.array(z14.string().max(400)).max(200),
1300
1392
  /** Accounts seen with no saved name yet (Save account names fixes them). */
1301
- unnamed_accounts: z13.array(z13.string().max(80)).max(200),
1393
+ unnamed_accounts: z14.array(z14.string().max(80)).max(200),
1302
1394
  /** The full report. */
1303
- output: z13.string().max(2e5)
1395
+ output: z14.string().max(2e5)
1304
1396
  });
1305
- var AppsSyncRunParams = z13.strictObject({ app_key: AppKey });
1306
- var AppsWindowsProcessesParams = z13.strictObject({ app_key: AppKey });
1307
- var AppsWindowsProcessesResult = z13.strictObject({ processes: z13.array(z13.string().max(2e3)).max(2e3) });
1308
- var AppsWindowsAddParams = z13.strictObject({ app_key: AppKey, window: ChatPlace, email: z13.string().min(3).max(320) });
1309
- var AppsWindowsSaveNamesParams = z13.strictObject({ app_key: AppKey });
1397
+ var AppsSyncRunParams = z14.strictObject({ app_key: AppKey });
1398
+ var AppsWindowsProcessesParams = z14.strictObject({ app_key: AppKey });
1399
+ var AppsWindowsProcessesResult = z14.strictObject({ processes: z14.array(z14.string().max(2e3)).max(2e3) });
1400
+ var AppsWindowsAddParams = z14.strictObject({ app_key: AppKey, window: ChatPlace, email: z14.string().min(3).max(320) });
1401
+ var AppsWindowsSaveNamesParams = z14.strictObject({ app_key: AppKey });
1310
1402
 
1311
1403
  // src/schema/service.ts
1312
- import { z as z14 } from "zod";
1404
+ import { z as z15 } from "zod";
1313
1405
  var SERVICE_MAX_FRAME_BYTES = 16777216;
1314
- var ServiceName = z14.enum(["ml", "coding", "tools"]);
1315
- var ContractHash = z14.string().regex(/^[0-9a-f]{64}$/);
1316
- var ServiceToken = z14.string().regex(/^[A-Za-z0-9_-]{43}$/);
1406
+ var ServiceName = z15.enum(["ml", "coding", "tools"]);
1407
+ var ContractHash = z15.string().regex(/^[0-9a-f]{64}$/);
1408
+ var ServiceToken = z15.string().regex(/^[A-Za-z0-9_-]{43}$/);
1317
1409
  var ServiceRequestId = u32;
1318
- var ServiceHello = z14.strictObject({ type: z14.literal("hello"), token: ServiceToken, contract: ContractHash });
1319
- var ServiceWelcome = z14.strictObject({
1320
- type: z14.literal("welcome"),
1410
+ var ServiceHello = z15.strictObject({ type: z15.literal("hello"), token: ServiceToken, contract: ContractHash });
1411
+ var ServiceWelcome = z15.strictObject({
1412
+ type: z15.literal("welcome"),
1321
1413
  service: ServiceName,
1322
1414
  contract: ContractHash,
1323
1415
  pid: nonNegInt,
1324
1416
  /** The interpreter's version, e.g. "3.13.15". */
1325
- python: z14.string().max(32),
1417
+ python: z15.string().max(32),
1326
1418
  /** Every op this service serves; must equal SERVICES[service] exactly. */
1327
- ops: z14.array(z14.string().min(1).max(64)).max(64)
1419
+ ops: z15.array(z15.string().min(1).max(64)).max(64)
1328
1420
  });
1329
- var ServiceRequest = z14.strictObject({
1330
- type: z14.literal("request"),
1421
+ var ServiceRequest = z15.strictObject({
1422
+ type: z15.literal("request"),
1331
1423
  id: ServiceRequestId,
1332
- op: z14.string().min(1).max(64),
1333
- params: z14.unknown()
1424
+ op: z15.string().min(1).max(64),
1425
+ params: z15.unknown()
1334
1426
  // validated by the service against SERVICES[service][op].params
1335
1427
  });
1336
- var ServiceResponse = z14.strictObject({
1337
- type: z14.literal("response"),
1428
+ var ServiceResponse = z15.strictObject({
1429
+ type: z15.literal("response"),
1338
1430
  id: ServiceRequestId,
1339
- result: z14.unknown()
1431
+ result: z15.unknown()
1340
1432
  // validated by the core against SERVICES[service][op].result
1341
1433
  });
1342
- var ServiceErrorMsg = z14.strictObject({ type: z14.literal("error"), id: ServiceRequestId, error: ProtocolErrorBody });
1343
- var ServiceProgressMsg = z14.strictObject({ type: z14.literal("progress"), id: ServiceRequestId, progress: z14.unknown() });
1344
- var ServiceCancel = z14.strictObject({ type: z14.literal("cancel"), id: ServiceRequestId });
1345
- var ServicePing = z14.strictObject({ type: z14.literal("ping"), id: ServiceRequestId });
1346
- var ServicePong = z14.strictObject({
1347
- type: z14.literal("pong"),
1434
+ var ServiceErrorMsg = z15.strictObject({ type: z15.literal("error"), id: ServiceRequestId, error: ProtocolErrorBody });
1435
+ var ServiceProgressMsg = z15.strictObject({ type: z15.literal("progress"), id: ServiceRequestId, progress: z15.unknown() });
1436
+ var ServiceCancel = z15.strictObject({ type: z15.literal("cancel"), id: ServiceRequestId });
1437
+ var ServicePing = z15.strictObject({ type: z15.literal("ping"), id: ServiceRequestId });
1438
+ var ServicePong = z15.strictObject({
1439
+ type: z15.literal("pong"),
1348
1440
  id: ServiceRequestId,
1349
1441
  /** Requests running now. */
1350
1442
  busy: nonNegInt
1351
1443
  });
1352
- var ServiceShutdown = z14.strictObject({ type: z14.literal("shutdown") });
1353
- var CoreToServiceMsg = z14.discriminatedUnion("type", [ServiceHello, ServiceRequest, ServiceCancel, ServicePing, ServiceShutdown]);
1354
- var ServiceToCoreMsg = z14.discriminatedUnion("type", [ServiceWelcome, ServiceResponse, ServiceErrorMsg, ServiceProgressMsg, ServicePong]);
1444
+ var ServiceShutdown = z15.strictObject({ type: z15.literal("shutdown") });
1445
+ var CoreToServiceMsg = z15.discriminatedUnion("type", [ServiceHello, ServiceRequest, ServiceCancel, ServicePing, ServiceShutdown]);
1446
+ var ServiceToCoreMsg = z15.discriminatedUnion("type", [ServiceWelcome, ServiceResponse, ServiceErrorMsg, ServiceProgressMsg, ServicePong]);
1355
1447
 
1356
1448
  // src/schema/tools.ts
1357
- import { z as z15 } from "zod";
1358
- var ToolLevel = z15.enum(["programmatic", "protocol", "chat"]);
1359
- var ToolOutcome = z15.enum(["pass", "fail", "skip"]);
1360
- var ToolPlatform = z15.enum(["darwin", "win32", "linux"]);
1361
- var ToolTransport = z15.enum(["in_process", "localhost", "relay", "agent"]);
1362
- var ToolName = z15.string().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/);
1363
- var ToolLevelResult = z15.strictObject({
1449
+ import { z as z16 } from "zod";
1450
+ var ToolLevel = z16.enum(["programmatic", "protocol", "chat"]);
1451
+ var ToolOutcome = z16.enum(["pass", "fail", "skip"]);
1452
+ var ToolPlatform = z16.enum(["darwin", "win32", "linux"]);
1453
+ var ToolTransport = z16.enum(["in_process", "localhost", "relay", "agent"]);
1454
+ var ToolName = z16.string().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/);
1455
+ var ToolLevelResult = z16.strictObject({
1364
1456
  tool: ToolName,
1365
1457
  level: ToolLevel,
1366
1458
  platform: ToolPlatform,
1367
1459
  transport: ToolTransport,
1368
1460
  outcome: ToolOutcome,
1369
1461
  /** True when the caller sat on a different network from the device (a phone on cellular, CI). */
1370
- remote_network: z15.boolean(),
1462
+ remote_network: z16.boolean(),
1371
1463
  /** One line: what was asserted, or why it failed. Never a token, a file's contents or a path under a real home. */
1372
- detail: z15.string().max(500),
1464
+ detail: z16.string().max(500),
1373
1465
  /** The harness that produced it, e.g. `matrx-desktop test/tools/programmatic.test.ts`. */
1374
- suite: z15.string().min(1).max(200),
1466
+ suite: z16.string().min(1).max(200),
1375
1467
  /** The test case inside the suite. */
1376
- test: z15.string().min(1).max(300),
1377
- run_at_ms: z15.int().min(0)
1468
+ test: z16.string().min(1).max(300),
1469
+ run_at_ms: z16.int().min(0)
1378
1470
  });
1379
- var ToolResultsFile = z15.strictObject({
1380
- schema: z15.literal("matrx.tool-results.v1"),
1471
+ var ToolResultsFile = z16.strictObject({
1472
+ schema: z16.literal("matrx.tool-results.v1"),
1381
1473
  /** The producing repo's commit (short or full SHA). */
1382
- commit: z15.string().min(4).max(64),
1383
- results: z15.array(ToolLevelResult).max(1e4)
1474
+ commit: z16.string().min(4).max(64),
1475
+ results: z16.array(ToolLevelResult).max(1e4)
1384
1476
  });
1385
1477
 
1386
1478
  // src/schema/proc.ts
1387
- import { z as z16 } from "zod";
1388
- var ProcSort = z16.enum(["cpu", "memory", "pid", "name"]);
1389
- var ProcListParams = z16.strictObject({
1479
+ import { z as z17 } from "zod";
1480
+ var ProcSort = z17.enum(["cpu", "memory", "pid", "name"]);
1481
+ var ProcListParams = z17.strictObject({
1390
1482
  /** Case-insensitive substring of the process name or its command line. */
1391
- name: z16.string().min(1).max(128).optional(),
1483
+ name: z17.string().min(1).max(128).optional(),
1392
1484
  sort: ProcSort.default("cpu"),
1393
- limit: z16.int().min(1).max(500).default(50)
1485
+ limit: z17.int().min(1).max(500).default(50)
1394
1486
  });
1395
- var ProcInfo = z16.strictObject({
1396
- pid: z16.int().min(0),
1487
+ var ProcInfo = z17.strictObject({
1488
+ pid: z17.int().min(0),
1397
1489
  /** Parent process id; null where the OS does not report it. */
1398
- ppid: z16.int().min(0).nullable(),
1399
- name: z16.string().max(256),
1490
+ ppid: z17.int().min(0).nullable(),
1491
+ name: z17.string().max(256),
1400
1492
  /** The command line, cut to 1024 characters. */
1401
- command: z16.string().max(1024),
1493
+ command: z17.string().max(1024),
1402
1494
  /** Share of one core, as `ps` and Task Manager report it; null where the OS does not say. */
1403
- cpu_percent: z16.number().min(0).nullable(),
1495
+ cpu_percent: z17.number().min(0).nullable(),
1404
1496
  memory_bytes: nonNegInt.nullable(),
1405
- user: z16.string().max(128).nullable()
1497
+ user: z17.string().max(128).nullable()
1406
1498
  });
1407
- var ProcListResult = z16.strictObject({
1408
- processes: z16.array(ProcInfo).max(500),
1499
+ var ProcListResult = z17.strictObject({
1500
+ processes: z17.array(ProcInfo).max(500),
1409
1501
  /** Processes that matched before `limit`. */
1410
1502
  total: nonNegInt,
1411
- truncated: z16.boolean()
1503
+ truncated: z17.boolean()
1412
1504
  });
1413
- var ProcPortsParams = z16.strictObject({
1505
+ var ProcPortsParams = z17.strictObject({
1414
1506
  /** Only this port. */
1415
- port: z16.int().min(1).max(65535).optional()
1507
+ port: z17.int().min(1).max(65535).optional()
1416
1508
  });
1417
- var ProcPort = z16.strictObject({
1418
- port: z16.int().min(1).max(65535),
1419
- protocol: z16.enum(["tcp", "udp"]),
1509
+ var ProcPort = z17.strictObject({
1510
+ port: z17.int().min(1).max(65535),
1511
+ protocol: z17.enum(["tcp", "udp"]),
1420
1512
  /** The local address it listens on ("127.0.0.1", "*", "::"). */
1421
- address: z16.string().max(64),
1422
- pid: z16.int().min(0).nullable(),
1423
- process: z16.string().max(256).nullable()
1513
+ address: z17.string().max(64),
1514
+ pid: z17.int().min(0).nullable(),
1515
+ process: z17.string().max(256).nullable()
1424
1516
  });
1425
- var ProcPortsResult = z16.strictObject({ ports: z16.array(ProcPort).max(4e3) });
1426
- var ProcKillParams = z16.strictObject({
1427
- pid: z16.int().min(1),
1517
+ var ProcPortsResult = z17.strictObject({ ports: z17.array(ProcPort).max(4e3) });
1518
+ var ProcKillParams = z17.strictObject({
1519
+ pid: z17.int().min(1),
1428
1520
  /** Kill outright (SIGKILL; on Windows the same /F) instead of asking it to quit. */
1429
- force: z16.boolean().default(false)
1521
+ force: z17.boolean().default(false)
1430
1522
  });
1431
- var ProcKillResult = z16.strictObject({
1432
- pid: z16.int().min(1),
1433
- signal: z16.enum(["SIGTERM", "SIGKILL"]),
1523
+ var ProcKillResult = z17.strictObject({
1524
+ pid: z17.int().min(1),
1525
+ signal: z17.enum(["SIGTERM", "SIGKILL"]),
1434
1526
  /** True when the process was gone within 3 s. */
1435
- exited: z16.boolean()
1527
+ exited: z17.boolean()
1436
1528
  });
1437
1529
 
1438
1530
  // src/schema/clipboard.ts
1439
- import { z as z17 } from "zod";
1440
- var ClipboardReadParams = z17.strictObject({});
1441
- var ClipboardReadResult = z17.strictObject({
1531
+ import { z as z18 } from "zod";
1532
+ var ClipboardReadParams = z18.strictObject({});
1533
+ var ClipboardReadResult = z18.strictObject({
1442
1534
  /** The clipboard's text ("" when it holds none), cut to 1 MiB. */
1443
- text: z17.string().max(1048576),
1444
- truncated: z17.boolean()
1535
+ text: z18.string().max(1048576),
1536
+ truncated: z18.boolean()
1445
1537
  });
1446
- var ClipboardWriteParams = z17.strictObject({ text: z17.string().max(1048576) });
1447
- var ClipboardWriteResult = z17.strictObject({ bytes: nonNegInt });
1538
+ var ClipboardWriteParams = z18.strictObject({ text: z18.string().max(1048576) });
1539
+ var ClipboardWriteResult = z18.strictObject({ bytes: nonNegInt });
1448
1540
 
1449
1541
  // src/schema/git.ts
1450
- import { z as z18 } from "zod";
1542
+ import { z as z19 } from "zod";
1451
1543
  var GIT_MAX_OUTPUT_CHARS = 262144;
1452
- var GitText = z18.string().max(GIT_MAX_OUTPUT_CHARS);
1453
- var GitName = z18.string().min(1).max(255).regex(/^[^-\s][^\s]*$/);
1454
- var GitOutputResult = z18.strictObject({ output: GitText, truncated: z18.boolean() });
1455
- var GitStatusParams = z18.strictObject({ cwd: AbsPath });
1456
- var GitStatusFile = z18.strictObject({
1457
- path: z18.string(),
1544
+ var GitText = z19.string().max(GIT_MAX_OUTPUT_CHARS);
1545
+ var GitName = z19.string().min(1).max(255).regex(/^[^-\s][^\s]*$/);
1546
+ var GitOutputResult = z19.strictObject({ output: GitText, truncated: z19.boolean() });
1547
+ var GitStatusParams = z19.strictObject({ cwd: AbsPath });
1548
+ var GitStatusFile = z19.strictObject({
1549
+ path: z19.string(),
1458
1550
  /** Porcelain v1 status letters: index (staged) and worktree; "?" for untracked. */
1459
- index: z18.string().length(1),
1460
- worktree: z18.string().length(1)
1551
+ index: z19.string().length(1),
1552
+ worktree: z19.string().length(1)
1461
1553
  });
1462
- var GitStatusResult = z18.strictObject({
1554
+ var GitStatusResult = z19.strictObject({
1463
1555
  /** The checked-out branch; null when HEAD is detached. */
1464
- branch: z18.string().nullable(),
1465
- upstream: z18.string().nullable(),
1556
+ branch: z19.string().nullable(),
1557
+ upstream: z19.string().nullable(),
1466
1558
  ahead: nonNegInt,
1467
1559
  behind: nonNegInt,
1468
- files: z18.array(GitStatusFile).max(5e3),
1469
- clean: z18.boolean(),
1560
+ files: z19.array(GitStatusFile).max(5e3),
1561
+ clean: z19.boolean(),
1470
1562
  /** More than 5000 changed files: the list is cut. */
1471
- truncated: z18.boolean()
1472
- });
1473
- var GitDiffParams = z18.strictObject({ cwd: AbsPath, path: z18.string().max(4096).optional(), staged: z18.boolean().default(false) });
1474
- var GitDiffResult = z18.strictObject({ diff: GitText, truncated: z18.boolean() });
1475
- var GitLogParams = z18.strictObject({ cwd: AbsPath, limit: z18.int().min(1).max(500).default(50) });
1476
- var GitLogCommit = z18.strictObject({ sha: z18.string(), short: z18.string(), author: z18.string(), date: z18.string(), subject: z18.string() });
1477
- var GitLogResult = z18.strictObject({ commits: z18.array(GitLogCommit).max(500) });
1478
- var GitAddParams = z18.strictObject({ cwd: AbsPath, paths: z18.array(z18.string().min(1).max(4096)).min(1).max(1e3) });
1479
- var GitCommitParams = z18.strictObject({
1563
+ truncated: z19.boolean()
1564
+ });
1565
+ var GitDiffParams = z19.strictObject({ cwd: AbsPath, path: z19.string().max(4096).optional(), staged: z19.boolean().default(false) });
1566
+ var GitDiffResult = z19.strictObject({ diff: GitText, truncated: z19.boolean() });
1567
+ var GitLogParams = z19.strictObject({ cwd: AbsPath, limit: z19.int().min(1).max(500).default(50) });
1568
+ var GitLogCommit = z19.strictObject({ sha: z19.string(), short: z19.string(), author: z19.string(), date: z19.string(), subject: z19.string() });
1569
+ var GitLogResult = z19.strictObject({ commits: z19.array(GitLogCommit).max(500) });
1570
+ var GitAddParams = z19.strictObject({ cwd: AbsPath, paths: z19.array(z19.string().min(1).max(4096)).min(1).max(1e3) });
1571
+ var GitCommitParams = z19.strictObject({
1480
1572
  cwd: AbsPath,
1481
- message: z18.string().min(1).max(65536),
1482
- amend: z18.boolean().default(false),
1573
+ message: z19.string().min(1).max(65536),
1574
+ amend: z19.boolean().default(false),
1483
1575
  /** "Name <email>"; absent = the computer's own git identity. */
1484
- author: z18.string().max(512).optional()
1576
+ author: z19.string().max(512).optional()
1485
1577
  });
1486
- var GitCommitResult = z18.strictObject({ sha: z18.string(), output: GitText, truncated: z18.boolean() });
1487
- var GitPushParams = z18.strictObject({ cwd: AbsPath, remote: GitName.default("origin"), branch: GitName.optional(), force_with_lease: z18.boolean().default(false) });
1488
- var GitPullParams = z18.strictObject({ cwd: AbsPath, remote: GitName.default("origin"), branch: GitName.optional(), rebase: z18.boolean().default(false) });
1489
- var GitBranchParams = z18.strictObject({ cwd: AbsPath, action: z18.enum(["list", "create", "delete", "switch"]), name: GitName.optional() });
1490
- var GitBranchResult = z18.strictObject({
1578
+ var GitCommitResult = z19.strictObject({ sha: z19.string(), output: GitText, truncated: z19.boolean() });
1579
+ var GitPushParams = z19.strictObject({ cwd: AbsPath, remote: GitName.default("origin"), branch: GitName.optional(), force_with_lease: z19.boolean().default(false) });
1580
+ var GitPullParams = z19.strictObject({ cwd: AbsPath, remote: GitName.default("origin"), branch: GitName.optional(), rebase: z19.boolean().default(false) });
1581
+ var GitBranchParams = z19.strictObject({ cwd: AbsPath, action: z19.enum(["list", "create", "delete", "switch"]), name: GitName.optional() });
1582
+ var GitBranchResult = z19.strictObject({
1491
1583
  /** The branch checked out after the action; null when detached. */
1492
- current: z18.string().nullable(),
1584
+ current: z19.string().nullable(),
1493
1585
  /** Local branches (filled by `list`; empty otherwise). */
1494
- branches: z18.array(z18.string()).max(5e3),
1586
+ branches: z19.array(z19.string()).max(5e3),
1495
1587
  output: GitText,
1496
- truncated: z18.boolean()
1588
+ truncated: z19.boolean()
1497
1589
  });
1498
- var GitStashParams = z18.strictObject({ cwd: AbsPath, action: z18.enum(["push", "pop", "list", "drop"]), message: z18.string().max(4096).optional() });
1499
- var GitCloneParams = z18.strictObject({
1500
- url: z18.string().min(1).max(4096).regex(/^[^-]/),
1590
+ var GitStashParams = z19.strictObject({ cwd: AbsPath, action: z19.enum(["push", "pop", "list", "drop"]), message: z19.string().max(4096).optional() });
1591
+ var GitCloneParams = z19.strictObject({
1592
+ url: z19.string().min(1).max(4096).regex(/^[^-]/),
1501
1593
  /** The folder to create; must not exist yet (or be empty). */
1502
1594
  dest: AbsPath,
1503
1595
  branch: GitName.optional(),
1504
- depth: z18.int().min(1).max(1e6).optional()
1596
+ depth: z19.int().min(1).max(1e6).optional()
1505
1597
  });
1506
1598
 
1507
1599
  // src/schema/web.ts
1508
- import { z as z19 } from "zod";
1600
+ import { z as z20 } from "zod";
1509
1601
  var WEB_MAX_TEXT_CHARS = 524288;
1510
- var WebUrl = z19.string().min(1).max(8192).regex(/^https?:\/\//);
1511
- var WebText = z19.string().max(WEB_MAX_TEXT_CHARS);
1512
- var WebHeader = z19.strictObject({ name: z19.string().min(1).max(256), value: z19.string().max(8192) });
1513
- var WebFetchParams = z19.strictObject({
1602
+ var WebUrl = z20.string().min(1).max(8192).regex(/^https?:\/\//);
1603
+ var WebText = z20.string().max(WEB_MAX_TEXT_CHARS);
1604
+ var WebHeader = z20.strictObject({ name: z20.string().min(1).max(256), value: z20.string().max(8192) });
1605
+ var WebFetchParams = z20.strictObject({
1514
1606
  url: WebUrl,
1515
- method: z19.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]).default("GET"),
1516
- headers: z19.array(WebHeader).max(64).default([]),
1517
- body: z19.string().max(1048576).optional(),
1518
- follow_redirects: z19.boolean().default(true),
1519
- timeout_s: z19.int().min(1).max(300).default(30)
1520
- });
1521
- var WebFetchResult = z19.strictObject({
1522
- status: z19.int().min(100).max(999),
1523
- reason: z19.string(),
1607
+ method: z20.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]).default("GET"),
1608
+ headers: z20.array(WebHeader).max(64).default([]),
1609
+ body: z20.string().max(1048576).optional(),
1610
+ follow_redirects: z20.boolean().default(true),
1611
+ timeout_s: z20.int().min(1).max(300).default(30)
1612
+ });
1613
+ var WebFetchResult = z20.strictObject({
1614
+ status: z20.int().min(100).max(999),
1615
+ reason: z20.string(),
1524
1616
  /** The final URL after redirects. */
1525
- url: z19.string(),
1526
- content_type: z19.string().nullable(),
1527
- headers: z19.array(WebHeader),
1617
+ url: z20.string(),
1618
+ content_type: z20.string().nullable(),
1619
+ headers: z20.array(WebHeader),
1528
1620
  body: WebText,
1529
- truncated: z19.boolean(),
1621
+ truncated: z20.boolean(),
1530
1622
  bytes: nonNegInt,
1531
1623
  elapsed_ms: nonNegInt
1532
1624
  });
1533
- var WebScrapeParams = z19.strictObject({
1534
- urls: z19.array(WebUrl).min(1).max(20),
1535
- use_cache: z19.boolean().default(true),
1536
- get_links: z19.boolean().default(false)
1625
+ var WebScrapeParams = z20.strictObject({
1626
+ urls: z20.array(WebUrl).min(1).max(20),
1627
+ use_cache: z20.boolean().default(true),
1628
+ get_links: z20.boolean().default(false)
1537
1629
  });
1538
- var WebScrapePage = z19.strictObject({
1539
- url: z19.string(),
1540
- ok: z19.boolean(),
1541
- status: z19.int().min(0).max(999).nullable(),
1542
- title: z19.string().nullable(),
1630
+ var WebScrapePage = z20.strictObject({
1631
+ url: z20.string(),
1632
+ ok: z20.boolean(),
1633
+ status: z20.int().min(0).max(999).nullable(),
1634
+ title: z20.string().nullable(),
1543
1635
  /** The page's readable content (markdown-like text from the scraper's parse). */
1544
1636
  text: WebText,
1545
- truncated: z19.boolean(),
1637
+ truncated: z20.boolean(),
1546
1638
  /** Links found on the page (only with get_links). */
1547
- links: z19.array(z19.string()).max(2e3),
1639
+ links: z20.array(z20.string()).max(2e3),
1548
1640
  /** Why the page failed (blocked, timeout, not found…), in the scraper's words; null when ok. */
1549
- error: z19.string().nullable(),
1641
+ error: z20.string().nullable(),
1550
1642
  /** How the page was fetched (http, browser, cache). */
1551
- via: z19.string().nullable()
1552
- });
1553
- var WebScrapeResult = z19.strictObject({ pages: z19.array(WebScrapePage), elapsed_ms: nonNegInt });
1554
- var WebSearchParams = z19.strictObject({
1555
- keywords: z19.array(z19.string().min(1).max(400)).min(1).max(5),
1556
- country: z19.string().min(2).max(2).default("us"),
1557
- count: z19.int().min(1).max(20).default(10),
1558
- freshness: z19.enum(["pd", "pw", "pm", "py"]).optional()
1559
- });
1560
- var WebSearchHit = z19.strictObject({ title: z19.string(), url: z19.string(), description: z19.string() });
1561
- var WebSearchQueryResult = z19.strictObject({ keyword: z19.string(), hits: z19.array(WebSearchHit), error: z19.string().nullable() });
1562
- var WebSearchResult = z19.strictObject({ queries: z19.array(WebSearchQueryResult), elapsed_ms: nonNegInt });
1563
- var ToolsWebSearchParams = z19.strictObject({
1564
- keywords: z19.array(z19.string().min(1).max(400)).min(1).max(5),
1565
- country: z19.string().min(2).max(2).default("us"),
1566
- count: z19.int().min(1).max(20).default(10),
1567
- freshness: z19.enum(["pd", "pw", "pm", "py"]).optional()
1568
- });
1569
- var WebBrowserFetchParams = z19.strictObject({
1643
+ via: z20.string().nullable()
1644
+ });
1645
+ var WebScrapeResult = z20.strictObject({ pages: z20.array(WebScrapePage), elapsed_ms: nonNegInt });
1646
+ var WebSearchParams = z20.strictObject({
1647
+ keywords: z20.array(z20.string().min(1).max(400)).min(1).max(5),
1648
+ country: z20.string().min(2).max(2).default("us"),
1649
+ count: z20.int().min(1).max(20).default(10),
1650
+ freshness: z20.enum(["pd", "pw", "pm", "py"]).optional()
1651
+ });
1652
+ var WebSearchHit = z20.strictObject({ title: z20.string(), url: z20.string(), description: z20.string() });
1653
+ var WebSearchQueryResult = z20.strictObject({ keyword: z20.string(), hits: z20.array(WebSearchHit), error: z20.string().nullable() });
1654
+ var WebSearchResult = z20.strictObject({ queries: z20.array(WebSearchQueryResult), elapsed_ms: nonNegInt });
1655
+ var ToolsWebSearchParams = z20.strictObject({
1656
+ keywords: z20.array(z20.string().min(1).max(400)).min(1).max(5),
1657
+ country: z20.string().min(2).max(2).default("us"),
1658
+ count: z20.int().min(1).max(20).default(10),
1659
+ freshness: z20.enum(["pd", "pw", "pm", "py"]).optional()
1660
+ });
1661
+ var WebBrowserFetchParams = z20.strictObject({
1570
1662
  url: WebUrl,
1571
1663
  /** A CSS selector to wait for before reading the page. */
1572
- wait_for: z19.string().max(1024).optional(),
1573
- wait_timeout_ms: z19.int().min(100).max(12e4).default(3e4),
1664
+ wait_for: z20.string().max(1024).optional(),
1665
+ wait_timeout_ms: z20.int().min(100).max(12e4).default(3e4),
1574
1666
  /** true: readable text; false: the rendered HTML. */
1575
- extract_text: z19.boolean().default(true)
1667
+ extract_text: z20.boolean().default(true)
1576
1668
  });
1577
- var WebBrowserFetchResult = z19.strictObject({
1578
- url: z19.string(),
1579
- status: z19.int().min(0).max(999).nullable(),
1580
- title: z19.string().nullable(),
1669
+ var WebBrowserFetchResult = z20.strictObject({
1670
+ url: z20.string(),
1671
+ status: z20.int().min(0).max(999).nullable(),
1672
+ title: z20.string().nullable(),
1581
1673
  content: WebText,
1582
- truncated: z19.boolean(),
1674
+ truncated: z20.boolean(),
1583
1675
  elapsed_ms: nonNegInt
1584
1676
  });
1585
- var ToolsServiceProgress = z19.strictObject({ phase: z19.enum(["fetching", "installing"]), done: nonNegInt, total: nonNegInt });
1677
+ var ToolsServiceProgress = z20.strictObject({ phase: z20.enum(["fetching", "installing"]), done: nonNegInt, total: nonNegInt });
1586
1678
 
1587
1679
  // src/schema/system.ts
1588
- import { z as z20 } from "zod";
1589
- var SystemOpenUrlParams = z20.strictObject({
1680
+ import { z as z21 } from "zod";
1681
+ var SystemOpenUrlParams = z21.strictObject({
1590
1682
  /** http, https or mailto; opened in the person's default app for it. */
1591
- url: z20.string().min(1).max(4096)
1683
+ url: z21.string().min(1).max(4096)
1592
1684
  });
1593
- var SystemOpenUrlResult = z20.strictObject({ url: z20.string().max(4096) });
1594
- var SystemOpenPathParams = z20.strictObject({
1685
+ var SystemOpenUrlResult = z21.strictObject({ url: z21.string().max(4096) });
1686
+ var SystemOpenPathParams = z21.strictObject({
1595
1687
  path: AbsPath,
1596
1688
  /** Show it in the file manager (Finder, Explorer) instead of opening it. */
1597
- reveal: z20.boolean().default(false)
1689
+ reveal: z21.boolean().default(false)
1598
1690
  });
1599
- var SystemOpenPathResult = z20.strictObject({ path: AbsPath, revealed: z20.boolean() });
1600
- var SystemNotifyParams = z20.strictObject({
1601
- title: z20.string().min(1).max(128),
1602
- body: z20.string().max(1024).default("")
1691
+ var SystemOpenPathResult = z21.strictObject({ path: AbsPath, revealed: z21.boolean() });
1692
+ var SystemNotifyParams = z21.strictObject({
1693
+ title: z21.string().min(1).max(128),
1694
+ body: z21.string().max(1024).default("")
1603
1695
  });
1604
- var SystemNotifyResult = z20.strictObject({
1696
+ var SystemNotifyResult = z21.strictObject({
1605
1697
  /** False when this computer has no notification service to show it (a bare Linux box). */
1606
- shown: z20.boolean()
1607
- });
1698
+ shown: z21.boolean()
1699
+ });
1700
+ var SystemSettingsPane = z21.enum([
1701
+ "displays",
1702
+ "night_shift",
1703
+ "sound",
1704
+ "keyboard",
1705
+ "keyboard_shortcuts",
1706
+ "text_input",
1707
+ "dictation",
1708
+ "energy",
1709
+ "about",
1710
+ "storage",
1711
+ "system_report"
1712
+ ]);
1713
+ var SystemOpenSettingsParams = z21.strictObject({ pane: SystemSettingsPane });
1714
+ var SystemOpenSettingsResult = z21.strictObject({ pane: SystemSettingsPane });
1608
1715
 
1609
1716
  // src/schema/screen.ts
1610
- import { z as z21 } from "zod";
1611
- var ScreenDisplay = z21.strictObject({
1717
+ import { z as z22 } from "zod";
1718
+ var ScreenDisplay = z22.strictObject({
1612
1719
  /** The OS's display id; pass it to screen.capture. */
1613
1720
  id: nonNegInt,
1614
- name: z21.string().max(128),
1721
+ name: z22.string().max(128),
1615
1722
  /** Position and size in the OS's logical points (x and y may be negative left of or above the main display). */
1616
- x: z21.int(),
1617
- y: z21.int(),
1618
- width: z21.int().min(1),
1619
- height: z21.int().min(1),
1723
+ x: z22.int(),
1724
+ y: z22.int(),
1725
+ width: z22.int().min(1),
1726
+ height: z22.int().min(1),
1620
1727
  /** Pixels per point (2 on a Retina display). */
1621
- scale: z21.number().min(0.1).max(8),
1622
- primary: z21.boolean()
1623
- });
1624
- var ScreenListParams = z21.strictObject({});
1625
- var ScreenListResult = z21.strictObject({ displays: z21.array(ScreenDisplay).max(32) });
1626
- var ScreenCaptureParams = z21.strictObject({
1728
+ scale: z22.number().min(0.1).max(8),
1729
+ primary: z22.boolean(),
1730
+ /** (1.24) Clockwise rotation in degrees (Displays' Rotation: 0 is Standard). */
1731
+ rotation: z22.int().min(0).max(359).optional(),
1732
+ /** (1.24) Refresh rate in hertz; absent where the OS does not say. */
1733
+ refresh_hz: z22.number().min(0).max(1e3).optional(),
1734
+ /** (1.24) The computer's own screen (a laptop's), not one plugged in. */
1735
+ builtin: z22.boolean().optional()
1736
+ });
1737
+ var ScreenListParams = z22.strictObject({});
1738
+ var ScreenListResult = z22.strictObject({ displays: z22.array(ScreenDisplay).max(32) });
1739
+ var ScreenCaptureParams = z22.strictObject({
1627
1740
  /** The display (from screen.list); the primary display when absent. */
1628
1741
  display_id: nonNegInt.optional(),
1629
- format: z21.enum(["jpeg", "png"]).default("jpeg"),
1742
+ format: z22.enum(["jpeg", "png"]).default("jpeg"),
1630
1743
  /** Scale the picture down to at most this width in pixels (kept when already smaller). */
1631
- max_width: z21.int().min(160).max(7680).default(1600)
1744
+ max_width: z22.int().min(160).max(7680).default(1600)
1632
1745
  });
1633
- var ScreenCaptureResult = z21.strictObject({
1746
+ var ScreenCaptureResult = z22.strictObject({
1634
1747
  display_id: nonNegInt,
1635
- mime_type: z21.enum(["image/jpeg", "image/png"]),
1636
- width: z21.int().min(1),
1637
- height: z21.int().min(1),
1748
+ mime_type: z22.enum(["image/jpeg", "image/png"]),
1749
+ width: z22.int().min(1),
1750
+ height: z22.int().min(1),
1638
1751
  /** The display's full resolution in pixels, before scaling. */
1639
- source_width: z21.int().min(1),
1640
- source_height: z21.int().min(1),
1752
+ source_width: z22.int().min(1),
1753
+ source_height: z22.int().min(1),
1641
1754
  /** The image, base64 (at most 6 MiB of text). */
1642
- data_base64: z21.string().max(6291456)
1755
+ data_base64: z22.string().max(6291456)
1643
1756
  });
1644
1757
 
1645
1758
  // src/schema/window.ts
1646
- import { z as z22 } from "zod";
1647
- var WindowInfo = z22.strictObject({
1759
+ import { z as z23 } from "zod";
1760
+ var WindowInfo = z23.strictObject({
1648
1761
  /** The OS's window handle (macOS window number, Windows HWND, X11 window id). */
1649
1762
  id: nonNegInt,
1650
- title: z22.string().max(512),
1763
+ title: z23.string().max(512),
1651
1764
  /** Position and size in logical points. */
1652
- x: z22.int(),
1653
- y: z22.int(),
1654
- width: z22.int().min(0),
1655
- height: z22.int().min(0),
1765
+ x: z23.int(),
1766
+ y: z23.int(),
1767
+ width: z23.int().min(0),
1768
+ height: z23.int().min(0),
1656
1769
  /**
1657
1770
  * The application that owns the window, by the name the OS shows people; absent when the OS does
1658
1771
  * not say. Optional (never null, the schema rule) because it was added in protocol 1.7: an older
1659
1772
  * app's answer has no such field (FIELDS_SINCE).
1660
1773
  */
1661
- app: z22.string().max(256).optional(),
1774
+ app: z23.string().max(256).optional(),
1662
1775
  /** The owning process id; absent when the OS does not say. Added in protocol 1.7. */
1663
- pid: z22.int().min(0).optional()
1776
+ pid: z23.int().min(0).optional()
1664
1777
  });
1665
- var WindowListParams = z22.strictObject({
1778
+ var WindowListParams = z23.strictObject({
1666
1779
  /** Case-insensitive substring of the window title. */
1667
- title: z22.string().min(1).max(256).optional(),
1668
- limit: z22.int().min(1).max(500).default(100)
1780
+ title: z23.string().min(1).max(256).optional(),
1781
+ limit: z23.int().min(1).max(500).default(100)
1669
1782
  });
1670
- var WindowListResult = z22.strictObject({
1671
- windows: z22.array(WindowInfo).max(500),
1783
+ var WindowListResult = z23.strictObject({
1784
+ windows: z23.array(WindowInfo).max(500),
1672
1785
  total: nonNegInt,
1673
- truncated: z22.boolean()
1786
+ truncated: z23.boolean()
1674
1787
  });
1675
- var WindowFocusParams = z22.strictObject({ id: nonNegInt });
1676
- var WindowFocusResult = z22.strictObject({ window: WindowInfo });
1677
- var WindowMoveParams = z22.strictObject({
1788
+ var WindowFocusParams = z23.strictObject({ id: nonNegInt });
1789
+ var WindowFocusResult = z23.strictObject({ window: WindowInfo });
1790
+ var WindowMoveParams = z23.strictObject({
1678
1791
  id: nonNegInt,
1679
1792
  /** New top-left corner; unchanged when absent. */
1680
- x: z22.int().optional(),
1681
- y: z22.int().optional(),
1793
+ x: z23.int().optional(),
1794
+ y: z23.int().optional(),
1682
1795
  /** New size; unchanged when absent. */
1683
- width: z22.int().min(50).max(16384).optional(),
1684
- height: z22.int().min(50).max(16384).optional()
1796
+ width: z23.int().min(50).max(16384).optional(),
1797
+ height: z23.int().min(50).max(16384).optional()
1685
1798
  });
1686
- var WindowMoveResult = z22.strictObject({ window: WindowInfo });
1687
- var WindowMinimizeParams = z22.strictObject({ id: nonNegInt });
1688
- var WindowMinimizeResult = z22.strictObject({ id: nonNegInt });
1799
+ var WindowMoveResult = z23.strictObject({ window: WindowInfo });
1800
+ var WindowMinimizeParams = z23.strictObject({ id: nonNegInt });
1801
+ var WindowMinimizeResult = z23.strictObject({ id: nonNegInt });
1689
1802
 
1690
1803
  // src/schema/input.ts
1691
- import { z as z23 } from "zod";
1692
- var InputKey = z23.enum([
1804
+ import { z as z24 } from "zod";
1805
+ var InputKey = z24.enum([
1693
1806
  "cmd",
1694
1807
  "ctrl",
1695
1808
  "alt",
@@ -1769,65 +1882,107 @@ var InputKey = z23.enum([
1769
1882
  "backslash",
1770
1883
  "grave"
1771
1884
  ]);
1772
- var InputTypeTextParams = z23.strictObject({ text: z23.string().min(1).max(1e4) });
1773
- var InputTypeTextResult = z23.strictObject({ characters: z23.int().min(1) });
1774
- var InputHotkeyParams = z23.strictObject({
1885
+ var InputTypeTextParams = z24.strictObject({ text: z24.string().min(1).max(1e4) });
1886
+ var InputTypeTextResult = z24.strictObject({ characters: z24.int().min(1) });
1887
+ var InputHotkeyParams = z24.strictObject({
1775
1888
  /** Pressed together in order and released in reverse: ["cmd", "shift", "t"]. */
1776
- keys: z23.array(InputKey).min(1).max(6)
1889
+ keys: z24.array(InputKey).min(1).max(6)
1777
1890
  });
1778
- var InputHotkeyResult = z23.strictObject({ keys: z23.array(InputKey) });
1779
- var InputPoint = z23.strictObject({ x: z23.int(), y: z23.int() });
1780
- var InputMouseMoveParams = z23.strictObject({
1891
+ var InputHotkeyResult = z24.strictObject({ keys: z24.array(InputKey) });
1892
+ var InputPoint = z24.strictObject({ x: z24.int(), y: z24.int() });
1893
+ var InputMouseMoveParams = z24.strictObject({
1781
1894
  /** Screen position in logical points (the coordinates screen.list and window.list report). */
1782
- x: z23.int(),
1783
- y: z23.int()
1895
+ x: z24.int(),
1896
+ y: z24.int()
1784
1897
  });
1785
- var InputMouseMoveResult = z23.strictObject({
1898
+ var InputMouseMoveResult = z24.strictObject({
1786
1899
  /** Where the pointer is now, read back from the OS. */
1787
1900
  position: InputPoint
1788
1901
  });
1789
- var InputMouseClickParams = z23.strictObject({
1902
+ var InputMouseClickParams = z24.strictObject({
1790
1903
  /** Move here first; clicks where the pointer is when absent. */
1791
- x: z23.int().optional(),
1792
- y: z23.int().optional(),
1793
- button: z23.enum(["left", "right", "middle"]).default("left"),
1794
- double: z23.boolean().default(false)
1904
+ x: z24.int().optional(),
1905
+ y: z24.int().optional(),
1906
+ button: z24.enum(["left", "right", "middle"]).default("left"),
1907
+ double: z24.boolean().default(false)
1795
1908
  });
1796
- var InputMouseClickResult = z23.strictObject({
1909
+ var InputMouseClickResult = z24.strictObject({
1797
1910
  position: InputPoint,
1798
- button: z23.enum(["left", "right", "middle"]),
1799
- double: z23.boolean()
1911
+ button: z24.enum(["left", "right", "middle"]),
1912
+ double: z24.boolean()
1913
+ });
1914
+ var InputKeyboardSettingsParams = z24.strictObject({});
1915
+ var InputKeyboardSettingsResult = z24.strictObject({
1916
+ /** Key repeat is off (a held key types once). */
1917
+ repeat_off: z24.boolean().nullable(),
1918
+ /** Time between repeats while a key is held (Key repeat rate: shorter is faster). */
1919
+ repeat_interval_ms: nonNegInt.nullable(),
1920
+ /** Time a key is held before it starts repeating (Delay until repeat). */
1921
+ repeat_delay_ms: nonNegInt.nullable(),
1922
+ /** What the fn / globe key does alone. */
1923
+ fn_key: z24.enum(["nothing", "input_source", "emoji", "dictation"]).nullable(),
1924
+ /** Tab moves focus between every control. */
1925
+ keyboard_navigation: z24.boolean().nullable(),
1926
+ /** The enabled input sources by name ("U.S.", "ABC – Extended"). */
1927
+ input_sources: z24.array(z24.string().max(128)).max(64),
1928
+ /** A key repeat change takes effect only after the person logs out and in again (macOS). */
1929
+ applies_after_login: z24.boolean()
1930
+ });
1931
+ var InputSetKeyboardSettingsParams = z24.strictObject({
1932
+ repeat_off: z24.boolean().optional(),
1933
+ repeat_interval_ms: z24.int().min(15).max(2e3).optional(),
1934
+ repeat_delay_ms: z24.int().min(150).max(2e3).optional(),
1935
+ keyboard_navigation: z24.boolean().optional()
1800
1936
  });
1801
1937
 
1802
1938
  // src/schema/power.ts
1803
- import { z as z24 } from "zod";
1804
- var PowerStatusParams = z24.strictObject({});
1805
- var PowerStatusResult = z24.strictObject({
1806
- has_battery: z24.boolean(),
1939
+ import { z as z25 } from "zod";
1940
+ var PowerEnergy = z25.strictObject({
1941
+ display_sleep_minutes: nonNegInt.nullable(),
1942
+ /** The computer itself sleeps after this long idle; null = never (Prevent automatic sleeping). */
1943
+ sleep_minutes: nonNegInt.nullable(),
1944
+ /** Hard disks sleep after this long; null = never. */
1945
+ disk_sleep_minutes: nonNegInt.nullable(),
1946
+ wake_for_network: z25.boolean().nullable(),
1947
+ restart_after_power_failure: z25.boolean().nullable(),
1948
+ /** Low Power Mode (Energy Mode "Low Power"). */
1949
+ low_power_mode: z25.boolean().nullable()
1950
+ });
1951
+ var PowerStatusParams = z25.strictObject({});
1952
+ var PowerStatusResult = z25.strictObject({
1953
+ has_battery: z25.boolean(),
1807
1954
  /** 0–100; null without a battery. */
1808
- percent: z24.number().min(0).max(100).nullable(),
1809
- charging: z24.boolean().nullable(),
1955
+ percent: z25.number().min(0).max(100).nullable(),
1956
+ charging: z25.boolean().nullable(),
1810
1957
  /** On wall power; null where the OS does not say. */
1811
- plugged_in: z24.boolean().nullable(),
1958
+ plugged_in: z25.boolean().nullable(),
1812
1959
  /** Minutes of battery left; null when charging, unknown or without a battery. */
1813
1960
  minutes_left: nonNegInt.nullable(),
1814
1961
  /** Matrx 2 is keeping the computer awake (power.prevent_sleep) until this time; null when it is not. */
1815
- awake_until_ms: epochMs.nullable()
1962
+ awake_until_ms: epochMs.nullable(),
1963
+ /** (1.24) The OS's own energy settings; absent where it keeps none Matrx 2 can read. */
1964
+ energy: PowerEnergy.optional()
1965
+ });
1966
+ var PowerHistoryParams = z25.strictObject({});
1967
+ var PowerHistoryPoint = z25.strictObject({ at_ms: epochMs, percent: z25.number().min(0).max(100), plugged_in: z25.boolean() });
1968
+ var PowerHistoryResult = z25.strictObject({
1969
+ /** Oldest first; empty without a battery or where the OS keeps no log. */
1970
+ points: z25.array(PowerHistoryPoint).max(5e3)
1816
1971
  });
1817
- var PowerPreventSleepParams = z24.strictObject({
1972
+ var PowerPreventSleepParams = z25.strictObject({
1818
1973
  /** Keep the computer awake this long; 0 lets it sleep again now. */
1819
- seconds: z24.int().min(0).max(86400),
1974
+ seconds: z25.int().min(0).max(86400),
1820
1975
  /** Shown where the OS lists what keeps it awake. */
1821
- reason: z24.string().min(1).max(128).default("Matrx 2 is working")
1976
+ reason: z25.string().min(1).max(128).default("Matrx 2 is working")
1822
1977
  });
1823
- var PowerPreventSleepResult = z24.strictObject({
1978
+ var PowerPreventSleepResult = z25.strictObject({
1824
1979
  /** When it may sleep again; null after seconds 0. */
1825
1980
  awake_until_ms: epochMs.nullable()
1826
1981
  });
1827
1982
 
1828
1983
  // src/schema/diag.ts
1829
- import { z as z25 } from "zod";
1830
- var DiagProcess = z25.enum([
1984
+ import { z as z26 } from "zod";
1985
+ var DiagProcess = z26.enum([
1831
1986
  "main",
1832
1987
  "renderer",
1833
1988
  "hosted_page",
@@ -1840,7 +1995,7 @@ var DiagProcess = z25.enum([
1840
1995
  "coding_sessions",
1841
1996
  "claude_accounts"
1842
1997
  ]);
1843
- var DiagErrorKind = z25.enum([
1998
+ var DiagErrorKind = z26.enum([
1844
1999
  "uncaught_exception",
1845
2000
  "unhandled_rejection",
1846
2001
  "renderer_crash",
@@ -1852,148 +2007,148 @@ var DiagErrorKind = z25.enum([
1852
2007
  "banner",
1853
2008
  "logged_error"
1854
2009
  ]);
1855
- var DiagErrorStatus = z25.enum(["waiting", "sent", "resolved"]);
1856
- var DiagErrorEntry = z25.strictObject({
2010
+ var DiagErrorStatus = z26.enum(["waiting", "sent", "resolved"]);
2011
+ var DiagErrorEntry = z26.strictObject({
1857
2012
  /** sha256 prefix over process, kind, source, code and the normalized message. */
1858
- signature: z25.string().regex(/^[0-9a-f]{32}$/),
2013
+ signature: z26.string().regex(/^[0-9a-f]{32}$/),
1859
2014
  process: DiagProcess,
1860
2015
  kind: DiagErrorKind,
1861
2016
  /** Where: a cap.op, a log event, a screen or page name. */
1862
- source: z25.string().min(1).max(128),
2017
+ source: z26.string().min(1).max(128),
1863
2018
  /** An ErrorCode, an exit code or signal, an error class; null when there is none. */
1864
- code: z25.string().max(64).nullable(),
2019
+ code: z26.string().max(64).nullable(),
1865
2020
  /** The first occurrence's message, personal data removed. */
1866
- message: z25.string().max(500),
2021
+ message: z26.string().max(500),
1867
2022
  count: nonNegInt,
1868
2023
  first_seen_ms: epochMs,
1869
2024
  last_seen_ms: epochMs,
1870
2025
  status: DiagErrorStatus,
1871
2026
  /** What the agent who resolved it wrote; null until resolved. */
1872
- resolution_note: z25.string().max(500).nullable(),
1873
- app_version: z25.string().max(64)
2027
+ resolution_note: z26.string().max(500).nullable(),
2028
+ app_version: z26.string().max(64)
1874
2029
  });
1875
- var DiagErrorsListParams = z25.strictObject({
2030
+ var DiagErrorsListParams = z26.strictObject({
1876
2031
  /** open = waiting or sent; all includes resolved. */
1877
- status: z25.enum(["open", "all"]).default("open"),
1878
- limit: z25.int().min(1).max(500).default(200)
2032
+ status: z26.enum(["open", "all"]).default("open"),
2033
+ limit: z26.int().min(1).max(500).default(200)
1879
2034
  });
1880
- var DiagErrorsListResult = z25.strictObject({
2035
+ var DiagErrorsListResult = z26.strictObject({
1881
2036
  /** Newest last_seen first. */
1882
- entries: z25.array(DiagErrorEntry).max(500),
2037
+ entries: z26.array(DiagErrorEntry).max(500),
1883
2038
  total_signatures: nonNegInt,
1884
2039
  total_occurrences: nonNegInt,
1885
2040
  /** Signatures with occurrences not yet delivered. */
1886
2041
  waiting: nonNegInt,
1887
2042
  /** signed_out = kept until sign-in; ok = the last delivery worked; failing = the last delivery failed (kept, retried). */
1888
- delivery: z25.enum(["signed_out", "ok", "failing"]),
2043
+ delivery: z26.enum(["signed_out", "ok", "failing"]),
1889
2044
  last_delivery_ms: epochMs.nullable()
1890
2045
  });
1891
- var DiagErrorsReportParams = z25.strictObject({
1892
- process: z25.enum(["renderer", "hosted_page"]),
1893
- kind: z25.enum(["uncaught_exception", "unhandled_rejection", "console_error", "banner"]),
2046
+ var DiagErrorsReportParams = z26.strictObject({
2047
+ process: z26.enum(["renderer", "hosted_page"]),
2048
+ kind: z26.enum(["uncaught_exception", "unhandled_rejection", "console_error", "banner"]),
1894
2049
  /** The screen or page, e.g. "code.chats". */
1895
- source: z25.string().min(1).max(128),
1896
- message: z25.string().min(1).max(2e3),
1897
- code: z25.string().max(64).optional(),
1898
- stack: z25.string().max(8e3).optional()
2050
+ source: z26.string().min(1).max(128),
2051
+ message: z26.string().min(1).max(2e3),
2052
+ code: z26.string().max(64).optional(),
2053
+ stack: z26.string().max(8e3).optional()
1899
2054
  });
1900
- var DiagErrorsReportResult = z25.strictObject({
1901
- signature: z25.string().regex(/^[0-9a-f]{32}$/)
2055
+ var DiagErrorsReportResult = z26.strictObject({
2056
+ signature: z26.string().regex(/^[0-9a-f]{32}$/)
1902
2057
  });
1903
- var DiagErrorsChangedEvent = z25.strictObject({
2058
+ var DiagErrorsChangedEvent = z26.strictObject({
1904
2059
  total_signatures: nonNegInt,
1905
2060
  waiting: nonNegInt
1906
2061
  });
1907
2062
 
1908
2063
  // src/schema/resources.ts
1909
- import { z as z26 } from "zod";
1910
- var ResourcesDisk = z26.strictObject({
2064
+ import { z as z27 } from "zod";
2065
+ var ResourcesDisk = z27.strictObject({
1911
2066
  /** Where it is mounted ("/", "C:"). */
1912
- mount: z26.string().max(512),
2067
+ mount: z27.string().max(512),
1913
2068
  /** The volume's name as the file manager shows it ("Macintosh HD", "Local Disk (C:)"). Since 1.17. */
1914
- name: z26.string().max(256).optional(),
2069
+ name: z27.string().max(256).optional(),
1915
2070
  /** The file system ("apfs", "NTFS", "ext4"). */
1916
- fs: z26.string().max(64),
2071
+ fs: z27.string().max(64),
1917
2072
  size_bytes: nonNegInt,
1918
2073
  used_bytes: nonNegInt,
1919
2074
  available_bytes: nonNegInt
1920
2075
  });
1921
- var ResourcesSnapshotParams = z26.strictObject({});
1922
- var ResourcesSnapshotResult = z26.strictObject({
1923
- cpu: z26.strictObject({
2076
+ var ResourcesSnapshotParams = z27.strictObject({});
2077
+ var ResourcesSnapshotResult = z27.strictObject({
2078
+ cpu: z27.strictObject({
1924
2079
  /** Busy share of all cores, 0–100, measured now. */
1925
- percent: z26.number().min(0).max(100),
1926
- cores: z26.int().min(1),
2080
+ percent: z27.number().min(0).max(100),
2081
+ cores: z27.int().min(1),
1927
2082
  /** 1, 5 and 15 minute load averages; null on Windows. */
1928
- load: z26.array(z26.number().min(0)).length(3).nullable()
2083
+ load: z27.array(z27.number().min(0)).length(3).nullable()
1929
2084
  }),
1930
- memory: z26.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt, available_bytes: nonNegInt }),
1931
- swap: z26.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt }),
1932
- disks: z26.array(ResourcesDisk).max(64),
2085
+ memory: z27.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt, available_bytes: nonNegInt }),
2086
+ swap: z27.strictObject({ total_bytes: nonNegInt, used_bytes: nonNegInt }),
2087
+ disks: z27.array(ResourcesDisk).max(64),
1933
2088
  uptime_seconds: nonNegInt
1934
2089
  });
1935
- var ResourcesJobKind = z26.enum(["type-check", "tests", "build", "lint", "dev server", "language server", "search"]);
1936
- var ResourcesStrain = z26.enum(["good", "strain", "overloaded"]);
1937
- var ResourcesPressure = z26.enum(["normal", "warning", "critical"]);
1938
- var ResourcesJob = z26.strictObject({
2090
+ var ResourcesJobKind = z27.enum(["type-check", "tests", "build", "lint", "dev server", "language server", "search"]);
2091
+ var ResourcesStrain = z27.enum(["good", "strain", "overloaded"]);
2092
+ var ResourcesPressure = z27.enum(["normal", "warning", "critical"]);
2093
+ var ResourcesJob = z27.strictObject({
1939
2094
  /** The job's root process (Stop takes its whole tree). */
1940
- pid: z26.int().min(0),
2095
+ pid: z27.int().min(0),
1941
2096
  kind: ResourcesJobKind,
1942
2097
  /** Its heaviest process's command line, shortened ("…/lib/tsc --noEmit -p tsconfig.json"). */
1943
- command: z26.string().max(256),
2098
+ command: z27.string().max(256),
1944
2099
  /** Who started it: "Claude Code", "Codex", "Cursor", "VS Code", "Terminal", "local stack", "detached"; null when unknown. */
1945
- started_by: z26.string().max(64).nullable(),
2100
+ started_by: z27.string().max(64).nullable(),
1946
2101
  /** Whatever started it is gone and nothing waits for it. */
1947
- orphan: z26.boolean(),
2102
+ orphan: z27.boolean(),
1948
2103
  /** A type-check queued for its turn (no compiler running yet). */
1949
- waiting: z26.boolean(),
2104
+ waiting: z27.boolean(),
1950
2105
  /** The project folder it runs in ("matrx-frontend"); null when not in one. */
1951
- folder: z26.string().max(256).nullable(),
2106
+ folder: z27.string().max(256).nullable(),
1952
2107
  /** The same command in the same folder, running this many times (1 = no duplicate). */
1953
- duplicates: z26.int().min(1),
1954
- processes: z26.int().min(1),
2108
+ duplicates: z27.int().min(1),
2109
+ processes: z27.int().min(1),
1955
2110
  /** Sum over the tree, as `ps` reports it: 100 = one full core. */
1956
- cpu_percent: z26.number().min(0),
2111
+ cpu_percent: z27.number().min(0),
1957
2112
  /** Real memory (macOS: the physical footprint Activity Monitor shows, compressed included). */
1958
2113
  memory_bytes: nonNegInt,
1959
2114
  started_at_ms: epochMs.nullable(),
1960
2115
  /** False for an app, an agent session, a terminal, a system process, the local stack or Matrx 2 itself. */
1961
- stoppable: z26.boolean()
2116
+ stoppable: z27.boolean()
1962
2117
  });
1963
- var ResourcesProcess = z26.strictObject({
1964
- pid: z26.int().min(0),
2118
+ var ResourcesProcess = z27.strictObject({
2119
+ pid: z27.int().min(0),
1965
2120
  /** The command line, shortened. */
1966
- name: z26.string().max(256),
1967
- cpu_percent: z26.number().min(0),
2121
+ name: z27.string().max(256),
2122
+ cpu_percent: z27.number().min(0),
1968
2123
  memory_bytes: nonNegInt,
1969
- started_by: z26.string().max(64).nullable(),
2124
+ started_by: z27.string().max(64).nullable(),
1970
2125
  /** The job it belongs to ("type-check in aidream"); null when none. */
1971
- job: z26.string().max(256).nullable(),
2126
+ job: z27.string().max(256).nullable(),
1972
2127
  started_at_ms: epochMs.nullable()
1973
2128
  });
1974
- var ResourcesVerdict = z26.strictObject({
2129
+ var ResourcesVerdict = z27.strictObject({
1975
2130
  level: ResourcesStrain,
1976
2131
  /** One sentence ("Your Mac is under strain. 3 type-checks are running at once."). */
1977
- text: z26.string().max(256),
2132
+ text: z27.string().max(256),
1978
2133
  /** The biggest jobs behind it; null when all is well. */
1979
- cause: z26.string().max(1024).nullable()
2134
+ cause: z27.string().max(1024).nullable()
1980
2135
  });
1981
- var ResourcesSample = z26.strictObject({
2136
+ var ResourcesSample = z27.strictObject({
1982
2137
  at_ms: epochMs,
1983
2138
  /** The 1-minute load average. */
1984
- load: z26.number().min(0),
2139
+ load: z27.number().min(0),
1985
2140
  memory_used_bytes: nonNegInt,
1986
2141
  typechecks: nonNegInt
1987
2142
  });
1988
- var ResourcesActivityParams = z26.strictObject({});
1989
- var ResourcesActivityResult = z26.strictObject({
2143
+ var ResourcesActivityParams = z27.strictObject({});
2144
+ var ResourcesActivityResult = z27.strictObject({
1990
2145
  /** False until the first reading (a second or two after start). */
1991
- ready: z26.boolean(),
2146
+ ready: z27.boolean(),
1992
2147
  sampled_at_ms: epochMs.nullable(),
1993
- cores: z26.int().min(1),
2148
+ cores: z27.int().min(1),
1994
2149
  /** 1, 5 and 15 minute load averages. */
1995
- load: z26.array(z26.number().min(0)).length(3),
1996
- memory: z26.strictObject({
2150
+ load: z27.array(z27.number().min(0)).length(3),
2151
+ memory: z27.strictObject({
1997
2152
  total_bytes: nonNegInt,
1998
2153
  /** Activity Monitor's Memory Used: app memory + wired + compressed. */
1999
2154
  used_bytes: nonNegInt,
@@ -2004,252 +2159,269 @@ var ResourcesActivityResult = z26.strictObject({
2004
2159
  pressure: ResourcesPressure.nullable()
2005
2160
  }),
2006
2161
  verdict: ResourcesVerdict,
2007
- typechecks: z26.strictObject({ running: nonNegInt, waiting: nonNegInt, comfort: nonNegInt }),
2162
+ typechecks: z27.strictObject({ running: nonNegInt, waiting: nonNegInt, comfort: nonNegInt }),
2008
2163
  /** Heaviest first (1 GB weighs as much as 16 % of a core). */
2009
- jobs: z26.array(ResourcesJob).max(200),
2164
+ jobs: z27.array(ResourcesJob).max(200),
2010
2165
  /** The 15 heaviest by memory and the 15 busiest by CPU, together. */
2011
- top: z26.array(ResourcesProcess).max(30),
2166
+ top: z27.array(ResourcesProcess).max(30),
2012
2167
  /** The last hour, oldest first. */
2013
- history: z26.array(ResourcesSample).max(1200)
2168
+ history: z27.array(ResourcesSample).max(1200)
2014
2169
  });
2015
- var ResourcesStopJobParams = z26.strictObject({ pid: z26.int().min(1) });
2016
- var ResourcesStopJobResult = z26.strictObject({
2170
+ var ResourcesStopJobParams = z27.strictObject({ pid: z27.int().min(1) });
2171
+ var ResourcesStopJobResult = z27.strictObject({
2017
2172
  /** Processes signalled; whatever is still running 5 seconds later is force-stopped. */
2018
2173
  processes: nonNegInt,
2019
2174
  /** It had finished before the request arrived. */
2020
- already_finished: z26.boolean()
2175
+ already_finished: z27.boolean()
2021
2176
  });
2022
- var ResourcesIncident = z26.strictObject({
2177
+ var ResourcesIncident = z27.strictObject({
2023
2178
  at_ms: epochMs,
2024
2179
  verdict: ResourcesVerdict,
2025
- load: z26.number().min(0),
2180
+ load: z27.number().min(0),
2026
2181
  memory_used_bytes: nonNegInt,
2027
2182
  compressed_bytes: nonNegInt,
2028
2183
  pressure: ResourcesPressure.nullable(),
2029
- jobs: z26.array(
2030
- z26.strictObject({
2184
+ jobs: z27.array(
2185
+ z27.strictObject({
2031
2186
  kind: ResourcesJobKind,
2032
- started_by: z26.string().max(64).nullable(),
2033
- folder: z26.string().max(256).nullable(),
2034
- command: z26.string().max(256),
2035
- cpu_percent: z26.number().min(0),
2187
+ started_by: z27.string().max(64).nullable(),
2188
+ folder: z27.string().max(256).nullable(),
2189
+ command: z27.string().max(256),
2190
+ cpu_percent: z27.number().min(0),
2036
2191
  memory_bytes: nonNegInt,
2037
- duplicates: z26.int().min(1)
2192
+ duplicates: z27.int().min(1)
2038
2193
  })
2039
2194
  ).max(8)
2040
2195
  });
2041
- var ResourcesIncidentsParams = z26.strictObject({ limit: z26.int().min(1).max(200).default(50) });
2042
- var ResourcesIncidentsResult = z26.strictObject({
2196
+ var ResourcesIncidentsParams = z27.strictObject({ limit: z27.int().min(1).max(200).default(50) });
2197
+ var ResourcesIncidentsResult = z27.strictObject({
2043
2198
  /** Newest first; at most one a minute is written. */
2044
- incidents: z26.array(ResourcesIncident).max(200)
2199
+ incidents: z27.array(ResourcesIncident).max(200)
2045
2200
  });
2046
2201
 
2047
2202
  // src/schema/stack.ts
2048
- import { z as z27 } from "zod";
2049
- var StackServerName = z27.string().regex(/^[a-z0-9_-]{1,64}$/);
2050
- var StackTone = z27.enum(["good", "wait", "bad", "off"]);
2051
- var StackServer = z27.strictObject({
2203
+ import { z as z28 } from "zod";
2204
+ var StackServerName = z28.string().regex(/^[a-z0-9_-]{1,64}$/);
2205
+ var StackTone = z28.enum(["good", "wait", "bad", "off"]);
2206
+ var StackServer = z28.strictObject({
2052
2207
  name: StackServerName,
2053
2208
  /** One word: Healthy, Starting, Unhealthy, Restarting, Stopping, Waiting, Stopped, Crashed, Off. */
2054
- label: z27.string().max(32),
2209
+ label: z28.string().max(32),
2055
2210
  tone: StackTone,
2056
2211
  /** What is going on, in one or two plain sentences. */
2057
- sentence: z27.string().max(2e3),
2212
+ sentence: z28.string().max(2e3),
2058
2213
  /** The config's own description of the server. */
2059
- description: z27.string().max(512),
2214
+ description: z28.string().max(512),
2060
2215
  /** Where the server answers, when its description names an address. */
2061
- open_url: z27.string().max(2048).nullable(),
2062
- log_file: z27.string().max(4096),
2216
+ open_url: z28.string().max(2048).nullable(),
2217
+ log_file: z28.string().max(4096),
2063
2218
  /** When its log file was last written. */
2064
2219
  last_output_at_ms: epochMs.nullable(),
2065
2220
  started_at_ms: epochMs.nullable(),
2066
2221
  restarts: nonNegInt,
2067
- exit_code: z27.int().nullable(),
2068
- pid: z27.int().nullable(),
2222
+ exit_code: z28.int().nullable(),
2223
+ pid: z28.int().nullable(),
2069
2224
  /** (1.18) CPU of the server's process and everything under it, in percent of one core; absent when it is not running. */
2070
- cpu_percent: z27.number().min(0).optional(),
2225
+ cpu_percent: z28.number().min(0).optional(),
2071
2226
  /** (1.18) Memory of the same processes: the physical footprint (Activity Monitor's Memory) summed; absent when it is not running. */
2072
2227
  memory_bytes: nonNegInt.optional()
2073
2228
  });
2074
- var StackEvent = z27.strictObject({
2229
+ var StackEvent = z28.strictObject({
2075
2230
  at_ms: epochMs,
2076
2231
  /** A server name, or "stack" for the stack as a whole. */
2077
- server: z27.string().max(64),
2232
+ server: z28.string().max(64),
2078
2233
  /** started · stopped · healthy · unhealthy · crashed · exited · restarting · stopping · action · action-done · action-failed · setup · error */
2079
- kind: z27.string().max(32),
2080
- text: z27.string().max(4e3)
2234
+ kind: z28.string().max(32),
2235
+ text: z28.string().max(4e3)
2081
2236
  });
2082
- var StackStateParams = z27.strictObject({});
2083
- var StackStateResult = z27.strictObject({
2237
+ var StackStateParams = z28.strictObject({});
2238
+ var StackStateResult = z28.strictObject({
2084
2239
  /** The stack's config file, when found. */
2085
- config_path: z27.string().max(4096).nullable(),
2240
+ config_path: z28.string().max(4096).nullable(),
2086
2241
  /** Why the stack cannot be run from here (no config, no process-compose), else null. */
2087
- problem: z27.string().max(1e3).nullable(),
2088
- stack_up: z27.boolean(),
2242
+ problem: z28.string().max(1e3).nullable(),
2243
+ stack_up: z28.boolean(),
2089
2244
  stack_started_at_ms: epochMs.nullable(),
2090
- servers: z27.array(StackServer).max(64),
2245
+ servers: z28.array(StackServer).max(64),
2091
2246
  /** One line about the one-shot setup steps ("Docker Desktop: running."), or null. */
2092
- setup_note: z27.string().max(500).nullable(),
2247
+ setup_note: z28.string().max(500).nullable(),
2093
2248
  /** Start everything / Stop everything in flight. */
2094
- pending: z27.strictObject({ verb: z27.enum(["start", "stop"]), label: z27.string().max(64), since_ms: epochMs }).nullable(),
2249
+ pending: z28.strictObject({ verb: z28.enum(["start", "stop"]), label: z28.string().max(64), since_ms: epochMs }).nullable(),
2095
2250
  /** The newest entries last. */
2096
- events: z27.array(StackEvent).max(300)
2251
+ events: z28.array(StackEvent).max(300)
2097
2252
  });
2098
- var StackStartParams = z27.strictObject({});
2099
- var StackStopParams = z27.strictObject({});
2100
- var StackRunResult = z27.strictObject({ accepted: z27.boolean() });
2101
- var StackServerActionParams = z27.strictObject({
2253
+ var StackStartParams = z28.strictObject({});
2254
+ var StackStopParams = z28.strictObject({});
2255
+ var StackRunResult = z28.strictObject({ accepted: z28.boolean() });
2256
+ var StackServerActionParams = z28.strictObject({
2102
2257
  name: StackServerName,
2103
- verb: z27.enum(["start", "stop", "restart"])
2258
+ verb: z28.enum(["start", "stop", "restart"])
2104
2259
  });
2105
- var StackServerActionResult = z27.strictObject({ message: z27.string().max(1e3) });
2106
- var StackLogsParams = z27.strictObject({
2260
+ var StackServerActionResult = z28.strictObject({ message: z28.string().max(1e3) });
2261
+ var StackLogsParams = z28.strictObject({
2107
2262
  name: StackServerName,
2108
2263
  /** Without `offset`: the last this-many complete lines. With it: new lines after it, at most this many. */
2109
- lines: z27.int().min(1).max(2e5).default(2e3),
2264
+ lines: z28.int().min(1).max(2e5).default(2e3),
2110
2265
  /** Byte offset the last read ended at: answer only what was written after it (follow). */
2111
2266
  offset: nonNegInt.optional(),
2112
2267
  /** A "Clear" point: the lines written after this byte offset (no `offset`). */
2113
2268
  since: nonNegInt.optional(),
2114
2269
  /** With `offset`: wait up to this long for a new line when none is waiting (0 answers at once). */
2115
- wait_ms: z27.int().min(0).max(25e3).default(0)
2270
+ wait_ms: z28.int().min(0).max(25e3).default(0)
2116
2271
  });
2117
- var StackLogsResult = z27.strictObject({
2272
+ var StackLogsResult = z28.strictObject({
2118
2273
  /** Complete lines, colour codes removed. */
2119
- lines: z27.array(z27.string().max(65536)).max(2e5),
2274
+ lines: z28.array(z28.string().max(65536)).max(2e5),
2120
2275
  /** Where these lines end: pass it back as `offset` to follow. */
2121
2276
  offset: nonNegInt,
2122
2277
  /** False when `since` no longer exists (the log rotated): the lines are the plain tail instead. */
2123
- since_valid: z27.boolean(),
2278
+ since_valid: z28.boolean(),
2124
2279
  /** The log was rotated or truncated since `offset`: these lines start the file again. */
2125
- reset: z27.boolean(),
2126
- log_file: z27.string().max(4096)
2280
+ reset: z28.boolean(),
2281
+ log_file: z28.string().max(4096)
2127
2282
  });
2128
- var StackErrorsParams = z27.strictObject({
2129
- window_minutes: z27.int().min(1).max(1440).default(60)
2283
+ var StackErrorsParams = z28.strictObject({
2284
+ window_minutes: z28.int().min(1).max(1440).default(60)
2130
2285
  });
2131
- var StackErrorsResult = z27.strictObject({
2286
+ var StackErrorsResult = z28.strictObject({
2132
2287
  /** Per server: a heading line ("=== aidream — errors in the last 60 minutes (<file>) ===") and each error with the 10 lines after it. */
2133
- sections: z27.array(z27.strictObject({ name: StackServerName, heading: z27.string().max(4096), lines: z27.array(z27.string().max(65536)).max(5e3) })).max(64),
2134
- window_minutes: z27.int().min(1).max(1440)
2288
+ sections: z28.array(z28.strictObject({ name: StackServerName, heading: z28.string().max(4096), lines: z28.array(z28.string().max(65536)).max(5e3) })).max(64),
2289
+ window_minutes: z28.int().min(1).max(1440)
2135
2290
  });
2136
2291
 
2137
2292
  // src/schema/audio.ts
2138
- import { z as z28 } from "zod";
2139
- var AudioDevice = z28.strictObject({
2293
+ import { z as z29 } from "zod";
2294
+ var AudioDevice = z29.strictObject({
2140
2295
  /** The OS's name for it, as audio.record takes it. */
2141
- id: z28.string().min(1).max(256),
2142
- name: z28.string().max(256),
2143
- default: z28.boolean()
2144
- });
2145
- var AudioDevicesParams = z28.strictObject({});
2146
- var AudioDevicesResult = z28.strictObject({
2147
- inputs: z28.array(AudioDevice).max(64),
2148
- outputs: z28.array(AudioDevice).max(64)
2149
- });
2150
- var AudioRecordParams = z28.strictObject({
2151
- seconds: z28.number().min(0.5).max(600),
2296
+ id: z29.string().min(1).max(256),
2297
+ name: z29.string().max(256),
2298
+ default: z29.boolean(),
2299
+ /** (1.24) How it is connected, as Sound's Type column says it: "Built-in", "USB", "Bluetooth",
2300
+ * "DisplayPort", "HDMI", "AirPlay", "Virtual". Absent where the OS does not say. */
2301
+ kind: z29.string().max(64).optional()
2302
+ });
2303
+ var AudioDevicesParams = z29.strictObject({});
2304
+ var AudioDevicesResult = z29.strictObject({
2305
+ inputs: z29.array(AudioDevice).max(64),
2306
+ outputs: z29.array(AudioDevice).max(64)
2307
+ });
2308
+ var AudioRecordParams = z29.strictObject({
2309
+ seconds: z29.number().min(0.5).max(600),
2152
2310
  /** The microphone (from audio.devices); the default input when absent. */
2153
- device_id: z28.string().min(1).max(256).optional(),
2311
+ device_id: z29.string().min(1).max(256).optional(),
2154
2312
  /** Where the WAV file goes; a new file in the temp folder when absent. */
2155
2313
  path: AbsPath.optional()
2156
2314
  });
2157
- var AudioRecordResult = z28.strictObject({
2315
+ var AudioRecordResult = z29.strictObject({
2158
2316
  path: AbsPath,
2159
- seconds: z28.number().min(0),
2317
+ seconds: z29.number().min(0),
2160
2318
  bytes: nonNegInt,
2161
2319
  /** Loudest sample, 0–1: 0 means the device gave silence. */
2162
- peak: z28.number().min(0).max(1)
2320
+ peak: z29.number().min(0).max(1)
2321
+ });
2322
+ var AudioPlayParams = z29.strictObject({ path: AbsPath });
2323
+ var AudioPlayResult = z29.strictObject({ path: AbsPath, seconds: z29.number().min(0) });
2324
+ var AudioLevelsParams = z29.strictObject({});
2325
+ var AudioLevelsResult = z29.strictObject({
2326
+ output_volume: z29.number().min(0).max(100).nullable(),
2327
+ output_muted: z29.boolean().nullable(),
2328
+ input_volume: z29.number().min(0).max(100).nullable(),
2329
+ /** The alert (beep) volume, a share of the output volume. */
2330
+ alert_volume: z29.number().min(0).max(100).nullable()
2331
+ });
2332
+ var AudioSetLevelsParams = z29.strictObject({
2333
+ output_volume: z29.number().min(0).max(100).optional(),
2334
+ output_muted: z29.boolean().optional(),
2335
+ input_volume: z29.number().min(0).max(100).optional(),
2336
+ alert_volume: z29.number().min(0).max(100).optional()
2163
2337
  });
2164
- var AudioPlayParams = z28.strictObject({ path: AbsPath });
2165
- var AudioPlayResult = z28.strictObject({ path: AbsPath, seconds: z28.number().min(0) });
2166
2338
 
2167
2339
  // src/schema/fs-watch.ts
2168
- import { z as z29 } from "zod";
2169
- var FsWatchId = z29.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
2170
- var FsWatchStartParams = z29.strictObject({
2340
+ import { z as z30 } from "zod";
2341
+ var FsWatchId = z30.string().regex(/^fw_[A-Za-z0-9]{12,40}$/);
2342
+ var FsWatchStartParams = z30.strictObject({
2171
2343
  path: AbsPath,
2172
- recursive: z29.boolean().default(true),
2344
+ recursive: z30.boolean().default(true),
2173
2345
  /** Globs relative to `path` whose changes are not reported (".git/**", "node_modules/**"). */
2174
- ignore: z29.array(z29.string().max(256)).max(64).default([])
2346
+ ignore: z30.array(z30.string().max(256)).max(64).default([])
2175
2347
  });
2176
- var FsWatchStartResult = z29.strictObject({
2348
+ var FsWatchStartResult = z30.strictObject({
2177
2349
  watch_id: FsWatchId,
2178
2350
  path: AbsPath,
2179
2351
  /** The watch ends by itself if nobody reads it for 30 minutes. */
2180
2352
  expires_at_ms: epochMs
2181
2353
  });
2182
- var FsWatchEventsParams = z29.strictObject({
2354
+ var FsWatchEventsParams = z30.strictObject({
2183
2355
  watch_id: FsWatchId,
2184
2356
  /** Wait up to this long for a first change when none is waiting (0 answers at once). */
2185
- wait_ms: z29.int().min(0).max(25e3).default(0)
2357
+ wait_ms: z30.int().min(0).max(25e3).default(0)
2186
2358
  });
2187
- var FsWatchEventsResult = z29.strictObject({
2359
+ var FsWatchEventsResult = z30.strictObject({
2188
2360
  /** What changed since the last read, oldest first; re-checked against the disk when read. */
2189
- changes: z29.array(FsChange).max(1e3),
2361
+ changes: z30.array(FsChange).max(1e3),
2190
2362
  /** Changes were dropped (more than 1000 waited): list the folder again. */
2191
- overflow: z29.boolean(),
2363
+ overflow: z30.boolean(),
2192
2364
  expires_at_ms: epochMs
2193
2365
  });
2194
- var FsWatchStopParams = z29.strictObject({ watch_id: FsWatchId });
2195
- var FsWatchStopResult = z29.strictObject({ watch_id: FsWatchId });
2366
+ var FsWatchStopParams = z30.strictObject({ watch_id: FsWatchId });
2367
+ var FsWatchStopResult = z30.strictObject({ watch_id: FsWatchId });
2196
2368
 
2197
2369
  // src/schema/exec-job.ts
2198
- import { z as z30 } from "zod";
2199
- var ExecJobId = z30.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
2200
- var ExecJobStartParams = z30.strictObject({
2201
- command: z30.string().min(1).max(131072),
2370
+ import { z as z31 } from "zod";
2371
+ var ExecJobId = z31.string().regex(/^job_[A-Za-z0-9]{12,40}$/);
2372
+ var ExecJobStartParams = z31.strictObject({
2373
+ command: z31.string().min(1).max(131072),
2202
2374
  /** The folder it runs in; the home folder when absent. */
2203
2375
  cwd: AbsPath.optional(),
2204
- env: z30.record(z30.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z30.string().max(32768)).optional()
2376
+ env: z31.record(z31.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z31.string().max(32768)).optional()
2205
2377
  });
2206
- var ExecJobStartResult = z30.strictObject({ job_id: ExecJobId, pid: z30.int().min(1), cwd: AbsPath });
2207
- var ExecJobOutputParams = z30.strictObject({
2378
+ var ExecJobStartResult = z31.strictObject({ job_id: ExecJobId, pid: z31.int().min(1), cwd: AbsPath });
2379
+ var ExecJobOutputParams = z31.strictObject({
2208
2380
  job_id: ExecJobId,
2209
2381
  /** Byte offset into the job's output to read from (next_offset of the last read; 0 = the start). */
2210
2382
  offset: nonNegInt.default(0),
2211
2383
  /** Wait up to this long for new output or the exit when none is waiting (0 answers at once). */
2212
- wait_ms: z30.int().min(0).max(25e3).default(0),
2213
- max_bytes: z30.int().min(1024).max(1048576).default(65536)
2384
+ wait_ms: z31.int().min(0).max(25e3).default(0),
2385
+ max_bytes: z31.int().min(1024).max(1048576).default(65536)
2214
2386
  });
2215
- var ExecJobOutputResult = z30.strictObject({
2387
+ var ExecJobOutputResult = z31.strictObject({
2216
2388
  /** stdout and stderr interleaved as they arrived (UTF-8). */
2217
- output: z30.string(),
2389
+ output: z31.string(),
2218
2390
  next_offset: nonNegInt,
2219
2391
  /** Bytes before `offset` that are gone (the job keeps its last 4 MiB). */
2220
2392
  dropped_bytes: nonNegInt,
2221
- running: z30.boolean(),
2222
- exit_code: z30.int().nullable()
2393
+ running: z31.boolean(),
2394
+ exit_code: z31.int().nullable()
2223
2395
  });
2224
- var ExecJobStopParams = z30.strictObject({
2396
+ var ExecJobStopParams = z31.strictObject({
2225
2397
  job_id: ExecJobId,
2226
2398
  /** End it at once (SIGKILL; on Windows the whole tree with /F) instead of asking it to quit. */
2227
- force: z30.boolean().default(false)
2399
+ force: z31.boolean().default(false)
2228
2400
  });
2229
- var ExecJobStopResult = z30.strictObject({ job_id: ExecJobId, exited: z30.boolean(), exit_code: z30.int().nullable() });
2230
- var ExecJobInfo = z30.strictObject({
2401
+ var ExecJobStopResult = z31.strictObject({ job_id: ExecJobId, exited: z31.boolean(), exit_code: z31.int().nullable() });
2402
+ var ExecJobInfo = z31.strictObject({
2231
2403
  job_id: ExecJobId,
2232
- command: z30.string().max(1024),
2233
- pid: z30.int().min(1),
2404
+ command: z31.string().max(1024),
2405
+ pid: z31.int().min(1),
2234
2406
  cwd: AbsPath,
2235
- running: z30.boolean(),
2236
- exit_code: z30.int().nullable(),
2407
+ running: z31.boolean(),
2408
+ exit_code: z31.int().nullable(),
2237
2409
  started_at_ms: epochMs,
2238
2410
  output_bytes: nonNegInt
2239
2411
  });
2240
- var ExecJobListParams = z30.strictObject({});
2241
- var ExecJobListResult = z30.strictObject({ jobs: z30.array(ExecJobInfo).max(64) });
2412
+ var ExecJobListParams = z31.strictObject({});
2413
+ var ExecJobListResult = z31.strictObject({ jobs: z31.array(ExecJobInfo).max(64) });
2242
2414
 
2243
2415
  // src/schema/coding.ts
2244
- import { z as z31 } from "zod";
2245
- import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN3 } from "@ai-matrx/kit/uuid";
2246
- var CodingServiceCredentials = z31.strictObject({
2247
- access_token: z31.string().min(16).max(16384),
2248
- user_id: z31.string().regex(UUID_SHAPE_PATTERN3),
2416
+ import { z as z32 } from "zod";
2417
+ import { UUID_SHAPE_PATTERN as UUID_SHAPE_PATTERN4 } from "@ai-matrx/kit/uuid";
2418
+ var CodingServiceCredentials = z32.strictObject({
2419
+ access_token: z32.string().min(16).max(16384),
2420
+ user_id: z32.string().regex(UUID_SHAPE_PATTERN4),
2249
2421
  /** The AI Matrx server this app talks to (production, or a local server on the nightly copy). */
2250
- server_url: z31.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
2422
+ server_url: z32.string().min(1).max(2048).regex(/^https?:\/\/[^\s/?#]+(\/[^\s?#]*)?$/)
2251
2423
  });
2252
- var CodingHistoryBlocked = z31.enum([
2424
+ var CodingHistoryBlocked = z32.enum([
2253
2425
  "signed_out",
2254
2426
  "offline",
2255
2427
  "organization_required",
@@ -2257,11 +2429,11 @@ var CodingHistoryBlocked = z31.enum([
2257
2429
  "cloud_list_unavailable",
2258
2430
  "history_too_large"
2259
2431
  ]);
2260
- var CodingHistoryFailure = z31.strictObject({
2261
- session_id: z31.string().max(64),
2262
- reason: z31.string().max(300)
2432
+ var CodingHistoryFailure = z32.strictObject({
2433
+ session_id: z32.string().max(64),
2434
+ reason: z32.string().max(300)
2263
2435
  });
2264
- var CodingHistoryRun = z31.strictObject({
2436
+ var CodingHistoryRun = z32.strictObject({
2265
2437
  /** Claude Code sessions found on this computer. */
2266
2438
  local_sessions: nonNegInt,
2267
2439
  /** Of those, already complete in AI Matrx. */
@@ -2276,39 +2448,39 @@ var CodingHistoryRun = z31.strictObject({
2276
2448
  /** Changed while being read; a later run takes them. */
2277
2449
  changed: nonNegInt,
2278
2450
  failed: nonNegInt,
2279
- failures: z31.array(CodingHistoryFailure).max(20),
2451
+ failures: z32.array(CodingHistoryFailure).max(20),
2280
2452
  /** Candidates not reached yet. */
2281
2453
  remaining: nonNegInt,
2282
2454
  /** The one line a person reads, e.g. "Imported 12 of 14 sessions. 140 already in AI Matrx." */
2283
- summary: z31.string().max(400)
2455
+ summary: z32.string().max(400)
2284
2456
  });
2285
- var CodingHistoryStep = z31.strictObject({
2457
+ var CodingHistoryStep = z32.strictObject({
2286
2458
  /** Null when the run could not start (blocked before a plan existed). */
2287
- plan_id: z31.string().regex(/^[0-9a-f]{32}$/).nullable(),
2288
- finished: z31.boolean(),
2459
+ plan_id: z32.string().regex(/^[0-9a-f]{32}$/).nullable(),
2460
+ finished: z32.boolean(),
2289
2461
  blocked: CodingHistoryBlocked.nullable(),
2290
2462
  run: CodingHistoryRun
2291
2463
  });
2292
- var CodingPlanMissingParams = z31.strictObject({ credentials: CodingServiceCredentials.nullable() });
2293
- var CodingImportNextParams = z31.strictObject({
2294
- plan_id: z31.string().regex(/^[0-9a-f]{32}$/),
2464
+ var CodingPlanMissingParams = z32.strictObject({ credentials: CodingServiceCredentials.nullable() });
2465
+ var CodingImportNextParams = z32.strictObject({
2466
+ plan_id: z32.string().regex(/^[0-9a-f]{32}$/),
2295
2467
  credentials: CodingServiceCredentials.nullable()
2296
2468
  });
2297
- var CodingServiceProgress = z31.strictObject({
2298
- phase: z31.enum(["checking", "importing"]),
2469
+ var CodingServiceProgress = z32.strictObject({
2470
+ phase: z32.enum(["checking", "importing"]),
2299
2471
  done: nonNegInt,
2300
2472
  total: nonNegInt
2301
2473
  });
2302
- var CodingHistoryImportMissingParams = z31.strictObject({});
2303
- var CodingHistoryImportMissingResult = z31.strictObject({
2304
- state: z31.enum(["done", "blocked", "cancelled"]),
2474
+ var CodingHistoryImportMissingParams = z32.strictObject({});
2475
+ var CodingHistoryImportMissingResult = z32.strictObject({
2476
+ state: z32.enum(["done", "blocked", "cancelled"]),
2305
2477
  blocked: CodingHistoryBlocked.nullable(),
2306
2478
  run: CodingHistoryRun,
2307
2479
  elapsed_ms: nonNegInt
2308
2480
  });
2309
- var CodingHistoryProgressEvent = z31.strictObject({
2481
+ var CodingHistoryProgressEvent = z32.strictObject({
2310
2482
  request_id: RequestId,
2311
- phase: z31.enum(["checking", "importing"]),
2483
+ phase: z32.enum(["checking", "importing"]),
2312
2484
  /** Sessions settled so far, of `total` candidates (0 of 0 while checking). */
2313
2485
  done: nonNegInt,
2314
2486
  total: nonNegInt,
@@ -2320,6 +2492,7 @@ var CodingHistoryProgressEvent = z31.strictObject({
2320
2492
  var FS_ERR = ["NOT_FOUND", "PERMISSION_DENIED_OS", "INVALID_PARAMS", "RESOURCE_BUSY", "INTERNAL"];
2321
2493
  var OPS = {
2322
2494
  "sysinfo.get": { params: SysinfoGetParams, result: SysinfoGetResult, kind: "unary", since: "1.0", errors: ["INTERNAL"] },
2495
+ "sysinfo.hardware": { params: SysinfoHardwareParams, result: SysinfoHardwareResult, kind: "unary", since: "1.24", errors: ["INTERNAL"] },
2323
2496
  "fs.list": { params: FsListParams, result: FsListResult, kind: "unary", since: "1.0", errors: FS_ERR },
2324
2497
  "fs.stat": { params: FsStatParams, result: FsStatResult, kind: "unary", since: "1.0", errors: FS_ERR },
2325
2498
  "fs.read": { params: FsReadParams, result: FsReadResult, kind: "unary", since: "1.0", errors: [...FS_ERR, "PAYLOAD_TOO_LARGE"] },
@@ -2396,6 +2569,7 @@ var OPS = {
2396
2569
  "exec.job.stop": { params: ExecJobStopParams, result: ExecJobStopResult, kind: "unary", since: "1.4", errors: ["RESOURCE_GONE", "INVALID_PARAMS", "INTERNAL"] },
2397
2570
  "exec.job.list": { params: ExecJobListParams, result: ExecJobListResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
2398
2571
  "system.open_url": { params: SystemOpenUrlParams, result: SystemOpenUrlResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2572
+ "system.open_settings": { params: SystemOpenSettingsParams, result: SystemOpenSettingsResult, kind: "unary", since: "1.24", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
2399
2573
  "system.open_path": { params: SystemOpenPathParams, result: SystemOpenPathResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2400
2574
  "system.notify": { params: SystemNotifyParams, result: SystemNotifyResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "INTERNAL"] },
2401
2575
  "screen.list": { params: ScreenListParams, result: ScreenListResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
@@ -2405,16 +2579,21 @@ var OPS = {
2405
2579
  "window.move": { params: WindowMoveParams, result: WindowMoveResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2406
2580
  "window.minimize": { params: WindowMinimizeParams, result: WindowMinimizeResult, kind: "unary", since: "1.4", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2407
2581
  "input.type_text": { params: InputTypeTextParams, result: InputTypeTextResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2582
+ "input.keyboard_settings": { params: InputKeyboardSettingsParams, result: InputKeyboardSettingsResult, kind: "unary", since: "1.24", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
2583
+ "input.set_keyboard_settings": { params: InputSetKeyboardSettingsParams, result: InputKeyboardSettingsResult, kind: "unary", since: "1.24", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2408
2584
  "input.hotkey": { params: InputHotkeyParams, result: InputHotkeyResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2409
2585
  "input.mouse_move": { params: InputMouseMoveParams, result: InputMouseMoveResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2410
2586
  "input.mouse_click": { params: InputMouseClickParams, result: InputMouseClickResult, kind: "unary", since: "1.4", errors: ["INVALID_PARAMS", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2411
2587
  "power.status": { params: PowerStatusParams, result: PowerStatusResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
2588
+ "power.history": { params: PowerHistoryParams, result: PowerHistoryResult, kind: "unary", since: "1.24", errors: ["INTERNAL"] },
2412
2589
  "power.prevent_sleep": { params: PowerPreventSleepParams, result: PowerPreventSleepResult, kind: "unary", since: "1.4", errors: ["PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2413
2590
  "resources.snapshot": { params: ResourcesSnapshotParams, result: ResourcesSnapshotResult, kind: "unary", since: "1.4", errors: ["INTERNAL"] },
2414
2591
  "resources.activity": { params: ResourcesActivityParams, result: ResourcesActivityResult, kind: "unary", since: "1.17", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
2415
2592
  "resources.stop_job": { params: ResourcesStopJobParams, result: ResourcesStopJobResult, kind: "unary", since: "1.17", errors: ["NOT_FOUND", "CONFLICT", "AUTH_FORBIDDEN", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2416
2593
  "resources.incidents": { params: ResourcesIncidentsParams, result: ResourcesIncidentsResult, kind: "unary", since: "1.17", errors: ["INTERNAL"] },
2417
2594
  "audio.devices": { params: AudioDevicesParams, result: AudioDevicesResult, kind: "unary", since: "1.6", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
2595
+ "audio.levels": { params: AudioLevelsParams, result: AudioLevelsResult, kind: "unary", since: "1.24", errors: ["PLATFORM_UNSUPPORTED", "INTERNAL"] },
2596
+ "audio.set_levels": { params: AudioSetLevelsParams, result: AudioLevelsResult, kind: "unary", since: "1.24", errors: ["INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2418
2597
  "audio.record": { params: AudioRecordParams, result: AudioRecordResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "PERMISSION_DENIED_OS", "PLATFORM_UNSUPPORTED", "RESOURCE_BUSY", "INTERNAL"] },
2419
2598
  "audio.play": { params: AudioPlayParams, result: AudioPlayResult, kind: "unary", since: "1.6", errors: ["NOT_FOUND", "INVALID_PARAMS", "PLATFORM_UNSUPPORTED", "INTERNAL"] },
2420
2599
  // The local AI Matrx servers (aidream's process-compose stack), supervised from Matrx 2's core.
@@ -2446,7 +2625,11 @@ var OPS = {
2446
2625
  "web.fetch": { params: WebFetchParams, result: WebFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
2447
2626
  "web.scrape": { params: WebScrapeParams, result: WebScrapeResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
2448
2627
  "web.search": { params: WebSearchParams, result: WebSearchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
2449
- "web.fetch_with_browser": { params: WebBrowserFetchParams, result: WebBrowserFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] }
2628
+ "web.fetch_with_browser": { params: WebBrowserFetchParams, result: WebBrowserFetchResult, kind: "unary", since: "1.22", errors: ["INVALID_PARAMS", "TIMEOUT", "RESOURCE_BUSY", "AUTH_REQUIRED", "INTERNAL"] },
2629
+ // 1.23: the signed-in person's own agents and Vault, read as them (the desktop's Agents library and Vault).
2630
+ "account.agents.list": { params: AccountAgentsListParams, result: AccountAgentsListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
2631
+ "account.vault.list": { params: AccountVaultListParams, result: AccountVaultListResult, kind: "unary", since: "1.23", errors: ["INTERNAL"] },
2632
+ "account.vault.copy": { params: AccountVaultCopyParams, result: AccountVaultCopyResult, kind: "unary", since: "1.23", errors: ["AUTH_REQUIRED", "AUTH_FORBIDDEN", "NOT_FOUND", "INVALID_PARAMS", "DEVICE_OFFLINE", "INTERNAL"] }
2450
2633
  };
2451
2634
  var EVENTS = {
2452
2635
  "fs.changed": FsChangedEvent,
@@ -2520,6 +2703,8 @@ var NAMED_SCHEMAS = {
2520
2703
  OsPermissionName,
2521
2704
  SysinfoGetParams,
2522
2705
  SysinfoGetResult,
2706
+ SysinfoHardwareParams,
2707
+ SysinfoHardwareResult,
2523
2708
  FsKind,
2524
2709
  FsEntry,
2525
2710
  FsListParams,
@@ -2646,6 +2831,9 @@ var NAMED_SCHEMAS = {
2646
2831
  SystemOpenUrlResult,
2647
2832
  SystemOpenPathParams,
2648
2833
  SystemOpenPathResult,
2834
+ SystemSettingsPane,
2835
+ SystemOpenSettingsParams,
2836
+ SystemOpenSettingsResult,
2649
2837
  SystemNotifyParams,
2650
2838
  SystemNotifyResult,
2651
2839
  ScreenDisplay,
@@ -2663,6 +2851,9 @@ var NAMED_SCHEMAS = {
2663
2851
  WindowMinimizeParams,
2664
2852
  WindowMinimizeResult,
2665
2853
  InputKey,
2854
+ InputKeyboardSettingsParams,
2855
+ InputKeyboardSettingsResult,
2856
+ InputSetKeyboardSettingsParams,
2666
2857
  InputPoint,
2667
2858
  InputTypeTextParams,
2668
2859
  InputTypeTextResult,
@@ -2676,6 +2867,10 @@ var NAMED_SCHEMAS = {
2676
2867
  PowerStatusResult,
2677
2868
  PowerPreventSleepParams,
2678
2869
  PowerPreventSleepResult,
2870
+ PowerEnergy,
2871
+ PowerHistoryParams,
2872
+ PowerHistoryPoint,
2873
+ PowerHistoryResult,
2679
2874
  ResourcesDisk,
2680
2875
  ResourcesSnapshotParams,
2681
2876
  ResourcesSnapshotResult,
@@ -2700,6 +2895,9 @@ var NAMED_SCHEMAS = {
2700
2895
  AudioRecordResult,
2701
2896
  AudioPlayParams,
2702
2897
  AudioPlayResult,
2898
+ AudioLevelsParams,
2899
+ AudioLevelsResult,
2900
+ AudioSetLevelsParams,
2703
2901
  StackServerName,
2704
2902
  StackTone,
2705
2903
  StackServer,
@@ -2839,6 +3037,7 @@ var NAMED_SCHEMAS = {
2839
3037
  SpendIdleScope,
2840
3038
  SpendIdle,
2841
3039
  SpendStart,
3040
+ SpendDay,
2842
3041
  AppsSpendParams,
2843
3042
  AppsSpendResult,
2844
3043
  AppsSyncStatusParams,
@@ -2879,7 +3078,19 @@ var NAMED_SCHEMAS = {
2879
3078
  ToolsWebSearchParams,
2880
3079
  WebBrowserFetchParams,
2881
3080
  WebBrowserFetchResult,
2882
- ToolsServiceProgress
3081
+ ToolsServiceProgress,
3082
+ AccountRowId,
3083
+ AccountReadState,
3084
+ AccountAgent,
3085
+ AccountAgentsListParams,
3086
+ AccountAgentsListResult,
3087
+ VaultItemKind,
3088
+ VaultFieldSummary,
3089
+ VaultItemSummary,
3090
+ AccountVaultListParams,
3091
+ AccountVaultListResult,
3092
+ AccountVaultCopyParams,
3093
+ AccountVaultCopyResult
2883
3094
  };
2884
3095
 
2885
3096
  // src/versioning.ts
@@ -2895,7 +3106,11 @@ var FIELDS_SINCE = {
2895
3106
  ChatRow: { app_project: "1.13", tokens: "1.13", original_title: "1.14", title_source: "1.14", title_override: "1.14", archived: "1.15" },
2896
3107
  AccountUsage: { plan: "1.13", credits: "1.13" },
2897
3108
  ResourcesDisk: { name: "1.17" },
2898
- StackServer: { cpu_percent: "1.18", memory_bytes: "1.18" }
3109
+ StackServer: { cpu_percent: "1.18", memory_bytes: "1.18" },
3110
+ AudioDevice: { kind: "1.24" },
3111
+ ScreenDisplay: { rotation: "1.24", refresh_hz: "1.24", builtin: "1.24" },
3112
+ PowerStatusResult: { energy: "1.24" },
3113
+ AppsSpendResult: { days: "1.24" }
2899
3114
  };
2900
3115
  var NULL_SINCE = {
2901
3116
  "RelayDeviceStatusEvent.since_ms": { since: "1.1", olderPeersGet: 0 }
@@ -3025,7 +3240,7 @@ function forPeer(op, part, value, version) {
3025
3240
  var VERSIONED_RESULT_OPS = [.../* @__PURE__ */ new Set([...RESULT_PATH.keys(), ...WINDOW_RESULTS.keys(), ...NESTED_RESULTS.keys()])];
3026
3241
 
3027
3242
  // src/contract.ts
3028
- var CONTRACT_SHA256 = "3649fe15a3400c32aa7a60712c93ebbefa639adc6218db849a13fa952e24bb04";
3243
+ var CONTRACT_SHA256 = "89943d5297e89b0ae7433b24c3076be1f65ca39a5edc3f338620597b24009226";
3029
3244
 
3030
3245
  // src/close-policy.ts
3031
3246
  var CLOSE_RULES = {
@@ -3079,13 +3294,13 @@ var TOOL_CATALOG = [
3079
3294
  // ── 2. Computer control (TS owners) ──────────────────────────────────────────────────────────
3080
3295
  { name: "desktop_process", group: "os_control", state: "built", path: "device_op", ops: ["proc.list", "proc.ports", "proc.kill"], platforms: ALL, summary: "Running processes and ports; stop one" },
3081
3296
  { name: "desktop_apps", group: "os_control", state: "built", path: "device_op", ops: ["apps.list", "apps.open"], platforms: ALL, summary: "Installed apps; open or bring one forward" },
3082
- { name: "desktop_system", group: "os_control", state: "built", path: "device_op", ops: ["sysinfo.get", "system.open_url", "system.open_path", "system.notify"], platforms: ALL, summary: "System facts, open, notify" },
3297
+ { name: "desktop_system", group: "os_control", state: "built", path: "device_op", ops: ["sysinfo.get", "sysinfo.hardware", "system.open_url", "system.open_path", "system.open_settings", "system.notify"], platforms: ALL, summary: "System facts, open, notify" },
3083
3298
  { name: "desktop_clipboard", group: "os_control", state: "built", path: "device_op", ops: ["clipboard.read", "clipboard.write"], platforms: ALL, summary: "Read and write the clipboard's text" },
3084
3299
  { name: "desktop_screen", group: "os_control", state: "built", path: "device_op", ops: ["screen.list", "screen.capture"], platforms: ALL, summary: "Displays and screenshots" },
3085
3300
  { name: "desktop_window", group: "os_control", state: "built", path: "device_op", ops: ["window.list", "window.focus", "window.move", "window.minimize"], platforms: ALL, summary: "Find, focus and arrange windows" },
3086
- { name: "desktop_input", group: "os_control", state: "built", path: "device_op", ops: ["input.type_text", "input.hotkey", "input.mouse_click", "input.mouse_move"], platforms: ALL, summary: "Keyboard and mouse" },
3087
- { name: "desktop_audio", group: "os_control", state: "built", path: "device_op", ops: ["audio.devices", "audio.record", "audio.play"], platforms: ALL, summary: "Audio devices, record, play" },
3088
- { name: "desktop_power", group: "os_control", state: "built", path: "device_op", ops: ["power.status", "power.prevent_sleep"], platforms: ALL, summary: "Battery and keep awake" },
3301
+ { name: "desktop_input", group: "os_control", state: "built", path: "device_op", ops: ["input.type_text", "input.hotkey", "input.mouse_click", "input.mouse_move", "input.keyboard_settings", "input.set_keyboard_settings"], platforms: ALL, summary: "Keyboard and mouse" },
3302
+ { name: "desktop_audio", group: "os_control", state: "built", path: "device_op", ops: ["audio.devices", "audio.levels", "audio.set_levels", "audio.record", "audio.play"], platforms: ALL, summary: "Audio devices, record, play" },
3303
+ { name: "desktop_power", group: "os_control", state: "built", path: "device_op", ops: ["power.status", "power.history", "power.prevent_sleep"], platforms: ALL, summary: "Battery and keep awake" },
3089
3304
  { name: "desktop_resources", group: "os_control", state: "built", path: "device_op", ops: ["resources.snapshot", "resources.activity", "resources.stop_job", "resources.incidents"], platforms: ALL, summary: "CPU, memory and disk use; what is using them, grouped into jobs; stop a job; the slowdown log" },
3090
3305
  { name: "fs_watch", group: "os_control", state: "built", path: "device_op", ops: ["fs.watch.start", "fs.watch.events", "fs.watch.stop"], platforms: ALL, summary: "Watch a folder; read what changed" },
3091
3306
  // ── 3. Personal apps and automation ──────────────────────────────────────────────────────────
@@ -3369,8 +3584,17 @@ function renderToolStatusMarkdown(status) {
3369
3584
  }
3370
3585
  export {
3371
3586
  AbsPath,
3587
+ AccountAgent,
3588
+ AccountAgentsListParams,
3589
+ AccountAgentsListResult,
3590
+ AccountReadState,
3372
3591
  AccountReset,
3592
+ AccountRowId,
3373
3593
  AccountUsage,
3594
+ AccountVaultCopyParams,
3595
+ AccountVaultCopyResult,
3596
+ AccountVaultListParams,
3597
+ AccountVaultListResult,
3374
3598
  AppFeatureStatus,
3375
3599
  AppInfo,
3376
3600
  AppKey,
@@ -3446,10 +3670,13 @@ export {
3446
3670
  AudioDevice,
3447
3671
  AudioDevicesParams,
3448
3672
  AudioDevicesResult,
3673
+ AudioLevelsParams,
3674
+ AudioLevelsResult,
3449
3675
  AudioPlayParams,
3450
3676
  AudioPlayResult,
3451
3677
  AudioRecordParams,
3452
3678
  AudioRecordResult,
3679
+ AudioSetLevelsParams,
3453
3680
  BEARER_PREFIX,
3454
3681
  BROADCAST_CID,
3455
3682
  CLOSE_RULES,
@@ -3608,11 +3835,14 @@ export {
3608
3835
  InputHotkeyParams,
3609
3836
  InputHotkeyResult,
3610
3837
  InputKey,
3838
+ InputKeyboardSettingsParams,
3839
+ InputKeyboardSettingsResult,
3611
3840
  InputMouseClickParams,
3612
3841
  InputMouseClickResult,
3613
3842
  InputMouseMoveParams,
3614
3843
  InputMouseMoveResult,
3615
3844
  InputPoint,
3845
+ InputSetKeyboardSettingsParams,
3616
3846
  InputTypeTextParams,
3617
3847
  InputTypeTextResult,
3618
3848
  LEGACY_ACTIONS,
@@ -3643,6 +3873,10 @@ export {
3643
3873
  PROTOCOL_MAJOR,
3644
3874
  PROTOCOL_MINOR,
3645
3875
  PROTOCOL_VERSION,
3876
+ PowerEnergy,
3877
+ PowerHistoryParams,
3878
+ PowerHistoryPoint,
3879
+ PowerHistoryResult,
3646
3880
  PowerPreventSleepParams,
3647
3881
  PowerPreventSleepResult,
3648
3882
  PowerStatusParams,
@@ -3732,6 +3966,7 @@ export {
3732
3966
  Signal,
3733
3967
  SpendAccount,
3734
3968
  SpendChat,
3969
+ SpendDay,
3735
3970
  SpendHelper,
3736
3971
  SpendIdle,
3737
3972
  SpendIdleScope,
@@ -3759,12 +3994,17 @@ export {
3759
3994
  StreamMsg,
3760
3995
  SysinfoGetParams,
3761
3996
  SysinfoGetResult,
3997
+ SysinfoHardwareParams,
3998
+ SysinfoHardwareResult,
3762
3999
  SystemNotifyParams,
3763
4000
  SystemNotifyResult,
3764
4001
  SystemOpenPathParams,
3765
4002
  SystemOpenPathResult,
4003
+ SystemOpenSettingsParams,
4004
+ SystemOpenSettingsResult,
3766
4005
  SystemOpenUrlParams,
3767
4006
  SystemOpenUrlResult,
4007
+ SystemSettingsPane,
3768
4008
  TOOL_CATALOG,
3769
4009
  TOOL_GROUPS,
3770
4010
  TOOL_LEVELS,
@@ -3782,6 +4022,9 @@ export {
3782
4022
  TranscriptionModelId,
3783
4023
  TranscriptionModelInfo,
3784
4024
  VERSIONED_RESULT_OPS,
4025
+ VaultFieldSummary,
4026
+ VaultItemKind,
4027
+ VaultItemSummary,
3785
4028
  WEB_MAX_TEXT_CHARS,
3786
4029
  WebBrowserFetchParams,
3787
4030
  WebBrowserFetchResult,