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