@atcx/contract 7.9.0 → 7.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/config-file-schema.d.ts +1 -0
- package/dist/daemon-contract.d.ts +35 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +94 -54
- package/dist/request-param-schemas.d.ts +3 -0
- package/dist/workspace-prune.d.ts +55 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
<p>
|
|
5
5
|
<a href="https://www.npmjs.com/package/@atcx/contract"><img src="https://img.shields.io/npm/v/@atcx/contract" alt="npm version"></a>
|
|
6
|
-
<a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.
|
|
6
|
+
<a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.11.0/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license"></a>
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
<p>
|
|
10
|
-
<a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.
|
|
11
|
-
<a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.
|
|
10
|
+
<a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.11.0/docs/architecture/protocol/contract.md">The published contract</a> •
|
|
11
|
+
<a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.11.0/docs/architecture/protocol/protocol.md">The client protocol</a>
|
|
12
12
|
</p>
|
|
13
13
|
</div>
|
|
14
14
|
|
|
@@ -54,9 +54,9 @@ bun add -d @opentelemetry/api
|
|
|
54
54
|
## Configuration
|
|
55
55
|
|
|
56
56
|
`CONFIG_FILE_SCHEMA` parses the top-level keys of atc's `config.json`, and the
|
|
57
|
-
[configuration guide](https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.
|
|
57
|
+
[configuration guide](https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.11.0/docs/guides/configuration.md) describes each key.
|
|
58
58
|
|
|
59
59
|
## Documentation
|
|
60
60
|
|
|
61
|
-
[The published contract](https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.
|
|
61
|
+
[The published contract](https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.11.0/docs/architecture/protocol/contract.md) covers what the package holds
|
|
62
62
|
and how its version moves with atc's.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const CONFIG_FILE_SCHEMA: z.ZodObject<{
|
|
3
3
|
agents: z.ZodOptional<z.ZodUnknown>;
|
|
4
|
+
sources: z.ZodOptional<z.ZodUnknown>;
|
|
4
5
|
dirs: z.ZodOptional<z.ZodUnknown>;
|
|
5
6
|
workspaces: z.ZodOptional<z.ZodUnknown>;
|
|
6
7
|
authProfiles: z.ZodOptional<z.ZodUnknown>;
|
|
@@ -71,6 +71,41 @@ export declare const DAEMON_CONTRACT: {
|
|
|
71
71
|
keyed: boolean;
|
|
72
72
|
}> & Record<never, never>>;
|
|
73
73
|
};
|
|
74
|
+
workspaces: {
|
|
75
|
+
prune: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
76
|
+
remove: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
+
dryRun: z.ZodBoolean;
|
|
79
|
+
folders: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
80
|
+
verdict: z.ZodLiteral<"remove">;
|
|
81
|
+
kind: z.ZodEnum<{
|
|
82
|
+
state: "state";
|
|
83
|
+
workspace: "workspace";
|
|
84
|
+
}>;
|
|
85
|
+
path: z.ZodString;
|
|
86
|
+
bytes: z.ZodNullable<z.ZodNumber>;
|
|
87
|
+
found: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
88
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
89
|
+
verdict: z.ZodLiteral<"keep">;
|
|
90
|
+
kind: z.ZodEnum<{
|
|
91
|
+
state: "state";
|
|
92
|
+
workspace: "workspace";
|
|
93
|
+
}>;
|
|
94
|
+
path: z.ZodString;
|
|
95
|
+
bytes: z.ZodNullable<z.ZodNumber>;
|
|
96
|
+
reasons: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
97
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
98
|
+
verdict: z.ZodLiteral<"skip">;
|
|
99
|
+
kind: z.ZodLiteral<"workspace">;
|
|
100
|
+
path: z.ZodString;
|
|
101
|
+
reason: z.ZodString;
|
|
102
|
+
}, z.core.$strip>], "verdict">>>;
|
|
103
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, import("./daemon-error-map.js").DaemonErrorMap>, Readonly<{
|
|
104
|
+
access: "owner" | "principal";
|
|
105
|
+
readOnly: boolean;
|
|
106
|
+
keyed: boolean;
|
|
107
|
+
}> & Record<never, never>>;
|
|
108
|
+
};
|
|
74
109
|
dirs: {
|
|
75
110
|
list: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
76
111
|
dirs: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -110,7 +110,7 @@ var ANSWER_VIEW_SCHEMA = z4.object({
|
|
|
110
110
|
complete: z4.boolean()
|
|
111
111
|
});
|
|
112
112
|
// packages/contract/src/contract-version.ts
|
|
113
|
-
var CONTRACT_VERSION = "7.
|
|
113
|
+
var CONTRACT_VERSION = "7.11.0";
|
|
114
114
|
|
|
115
115
|
// packages/contract/src/daemon-features.ts
|
|
116
116
|
var DAEMON_FEATURES = [
|
|
@@ -167,6 +167,7 @@ function buildOptionalString() {
|
|
|
167
167
|
// packages/contract/src/config-file-schema.ts
|
|
168
168
|
var CONFIG_FILE_SCHEMA = z7.object({
|
|
169
169
|
agents: z7.unknown().optional(),
|
|
170
|
+
sources: z7.unknown().optional(),
|
|
170
171
|
dirs: z7.unknown().optional(),
|
|
171
172
|
workspaces: z7.unknown().optional(),
|
|
172
173
|
authProfiles: z7.unknown().optional(),
|
|
@@ -180,7 +181,7 @@ var CONFIG_FILE_SCHEMA = z7.object({
|
|
|
180
181
|
});
|
|
181
182
|
// packages/contract/src/daemon-contract.ts
|
|
182
183
|
import { eventIterator, oc } from "@orpc/contract";
|
|
183
|
-
import { z as
|
|
184
|
+
import { z as z39 } from "zod";
|
|
184
185
|
|
|
185
186
|
// packages/contract/src/daemon-error-map.ts
|
|
186
187
|
import { z as z8 } from "zod";
|
|
@@ -707,6 +708,9 @@ var REQUEST_PARAM_SCHEMAS = {
|
|
|
707
708
|
path: z31.string({ error: "daemon.backup path must be an absolute path" }).refine((path) => path.startsWith("/"), "daemon.backup path must be an absolute path")
|
|
708
709
|
}),
|
|
709
710
|
"daemon.restarted": z31.object({ result: RESTART_RESULT_SCHEMA }),
|
|
711
|
+
"workspaces.prune": z31.object({
|
|
712
|
+
remove: z31.boolean({ error: "workspaces.prune remove must be a boolean" }).optional()
|
|
713
|
+
}),
|
|
710
714
|
"session.list": z31.object({}),
|
|
711
715
|
"dirs.list": z31.object({}),
|
|
712
716
|
"agents.list": z31.object({}),
|
|
@@ -939,16 +943,48 @@ var WORKSPACE_CLEANUP_SCHEMA = z37.discriminatedUnion("outcome", [
|
|
|
939
943
|
z37.object({ outcome: z37.literal("none") })
|
|
940
944
|
]);
|
|
941
945
|
|
|
942
|
-
// packages/contract/src/
|
|
943
|
-
|
|
946
|
+
// packages/contract/src/workspace-prune.ts
|
|
947
|
+
import { z as z38 } from "zod";
|
|
944
948
|
var STRINGS2 = z38.array(z38.string()).readonly();
|
|
945
|
-
var
|
|
946
|
-
var
|
|
947
|
-
|
|
948
|
-
|
|
949
|
+
var KIND = z38.enum(["workspace", "state"]);
|
|
950
|
+
var BYTES = z38.number().int().nonnegative().nullable();
|
|
951
|
+
var PRUNE_FOLDER_SCHEMA = z38.discriminatedUnion("verdict", [
|
|
952
|
+
z38.object({
|
|
953
|
+
verdict: z38.literal("remove"),
|
|
954
|
+
kind: KIND,
|
|
955
|
+
path: z38.string(),
|
|
956
|
+
bytes: BYTES,
|
|
957
|
+
found: STRINGS2
|
|
958
|
+
}),
|
|
959
|
+
z38.object({
|
|
960
|
+
verdict: z38.literal("keep"),
|
|
961
|
+
kind: KIND,
|
|
962
|
+
path: z38.string(),
|
|
963
|
+
bytes: BYTES,
|
|
964
|
+
reasons: STRINGS2
|
|
965
|
+
}),
|
|
966
|
+
z38.object({
|
|
967
|
+
verdict: z38.literal("skip"),
|
|
968
|
+
kind: z38.literal("workspace"),
|
|
969
|
+
path: z38.string(),
|
|
970
|
+
reason: z38.string()
|
|
971
|
+
})
|
|
972
|
+
]);
|
|
973
|
+
var WORKSPACE_PRUNE_SCHEMA = z38.object({
|
|
974
|
+
dryRun: z38.boolean(),
|
|
975
|
+
folders: z38.array(PRUNE_FOLDER_SCHEMA).readonly()
|
|
976
|
+
});
|
|
977
|
+
|
|
978
|
+
// packages/contract/src/daemon-contract.ts
|
|
979
|
+
var EMPTY = z39.object({});
|
|
980
|
+
var STRINGS3 = z39.array(z39.string()).readonly();
|
|
981
|
+
var FORGET_CONFIRM = z39.object({ confirmToken: z39.string(), expiresAt: z39.number() });
|
|
982
|
+
var FORGET_DONE = z39.object({
|
|
983
|
+
forgotten: z39.literal(true),
|
|
984
|
+
destroyed: z39.boolean(),
|
|
949
985
|
workspace: WORKSPACE_CLEANUP_SCHEMA
|
|
950
986
|
});
|
|
951
|
-
var PENDING_PROMPT =
|
|
987
|
+
var PENDING_PROMPT = z39.object({ message: z39.string() });
|
|
952
988
|
var ACT = { access: "principal", readOnly: false, keyed: false };
|
|
953
989
|
var READ = { access: "principal", readOnly: true, keyed: false };
|
|
954
990
|
var KEYED = { access: "principal", readOnly: false, keyed: true };
|
|
@@ -961,72 +997,75 @@ var DAEMON_CONTRACT = {
|
|
|
961
997
|
ping: base.meta(READ).input(PARAMS["daemon.ping"]).output(EMPTY),
|
|
962
998
|
quit: base.meta(OWNER).input(PARAMS["daemon.quit"]).output(EMPTY),
|
|
963
999
|
restarted: base.meta(OWNER).input(PARAMS["daemon.restarted"]).output(EMPTY),
|
|
964
|
-
backup: base.meta(OWNER).input(PARAMS["daemon.backup"]).output(
|
|
1000
|
+
backup: base.meta(OWNER).input(PARAMS["daemon.backup"]).output(z39.object({ path: z39.string(), bytes: z39.number() }))
|
|
1001
|
+
},
|
|
1002
|
+
workspaces: {
|
|
1003
|
+
prune: base.meta(OWNER).input(PARAMS["workspaces.prune"]).output(WORKSPACE_PRUNE_SCHEMA)
|
|
965
1004
|
},
|
|
966
1005
|
dirs: {
|
|
967
|
-
list: base.meta(READ).input(PARAMS["dirs.list"]).output(
|
|
1006
|
+
list: base.meta(READ).input(PARAMS["dirs.list"]).output(z39.object({ dirs: STRINGS3 }))
|
|
968
1007
|
},
|
|
969
1008
|
agents: {
|
|
970
1009
|
list: base.meta(READ).input(PARAMS["agents.list"]).output(AGENT_LIST_SCHEMA)
|
|
971
1010
|
},
|
|
972
1011
|
sources: {
|
|
973
|
-
list: base.meta(READ).input(PARAMS["sources.list"]).output(
|
|
974
|
-
source:
|
|
975
|
-
scope:
|
|
976
|
-
candidates:
|
|
1012
|
+
list: base.meta(READ).input(PARAMS["sources.list"]).output(z39.object({
|
|
1013
|
+
source: z39.string(),
|
|
1014
|
+
scope: z39.string().nullable(),
|
|
1015
|
+
candidates: z39.array(SOURCE_CANDIDATE_SCHEMA).readonly()
|
|
977
1016
|
})),
|
|
978
1017
|
interpret: base.meta(READ).input(PARAMS["sources.interpret"]).output(SOURCE_INTERPRETATION_SCHEMA),
|
|
979
|
-
complete: base.meta(READ).input(PARAMS["sources.complete"]).output(
|
|
1018
|
+
complete: base.meta(READ).input(PARAMS["sources.complete"]).output(z39.object({ completions: z39.array(SOURCE_CANDIDATE_SCHEMA).readonly() }))
|
|
980
1019
|
},
|
|
981
1020
|
git: {
|
|
982
1021
|
probe: base.meta(READ).input(PARAMS["git.probe"]).output(GIT_PROBE_RESULT_SCHEMA)
|
|
983
1022
|
},
|
|
984
1023
|
fleet: {
|
|
985
|
-
list: base.meta(READ).input(PARAMS["fleet.list"]).output(
|
|
986
|
-
restore: base.meta(OWNER).input(PARAMS["fleet.restore"]).output(
|
|
1024
|
+
list: base.meta(READ).input(PARAMS["fleet.list"]).output(z39.object({ fleet: z39.array(FLEET_ENTRY_VIEW_SCHEMA).readonly() })),
|
|
1025
|
+
restore: base.meta(OWNER).input(PARAMS["fleet.restore"]).output(z39.object({ restored: z39.number() }))
|
|
987
1026
|
},
|
|
988
1027
|
session: {
|
|
989
|
-
list: base.meta(READ).input(PARAMS["session.list"]).output(
|
|
1028
|
+
list: base.meta(READ).input(PARAMS["session.list"]).output(z39.object({ sessions: z39.array(SESSION_DESCRIPTOR_SCHEMA).readonly() })),
|
|
990
1029
|
spawn: base.meta(KEYED).input(PARAMS["session.spawn"]).output(SPAWN_ANSWER_SCHEMA),
|
|
991
|
-
kill: base.input(PARAMS["session.kill"]).output(
|
|
1030
|
+
kill: base.input(PARAMS["session.kill"]).output(z39.object({ stopped: z39.boolean().optional() })),
|
|
992
1031
|
ack: base.input(PARAMS["session.ack"]).output(EMPTY),
|
|
993
|
-
forget: base.input(PARAMS["session.forget"]).output(
|
|
994
|
-
resumeCommand: base.meta(READ).input(PARAMS["session.resumeCommand"]).output(
|
|
1032
|
+
forget: base.input(PARAMS["session.forget"]).output(z39.union([FORGET_CONFIRM, FORGET_DONE])),
|
|
1033
|
+
resumeCommand: base.meta(READ).input(PARAMS["session.resumeCommand"]).output(z39.object({ command: z39.string() })),
|
|
995
1034
|
auth: {
|
|
996
|
-
revoke: base.meta(OWNER).input(PARAMS["session.auth.revoke"]).output(
|
|
997
|
-
rebind: base.meta(OWNER).input(PARAMS["session.auth.rebind"]).output(
|
|
1035
|
+
revoke: base.meta(OWNER).input(PARAMS["session.auth.revoke"]).output(z39.object({ revoked: z39.literal(true) })),
|
|
1036
|
+
rebind: base.meta(OWNER).input(PARAMS["session.auth.rebind"]).output(z39.object({ revision: z39.number(), restartPending: STRINGS3 }))
|
|
998
1037
|
},
|
|
999
|
-
update: base.input(PARAMS["session.update"]).output(
|
|
1038
|
+
update: base.input(PARAMS["session.update"]).output(z39.object({ renameSkipped: z39.string().optional() })),
|
|
1000
1039
|
scope: {
|
|
1001
|
-
add: base.input(PARAMS["session.scope.add"]).output(
|
|
1040
|
+
add: base.input(PARAMS["session.scope.add"]).output(z39.object({ record: PUBLISHED_RECORD_SCHEMA }))
|
|
1002
1041
|
},
|
|
1003
|
-
attach: base.input(PARAMS["session.attach"]).output(
|
|
1042
|
+
attach: base.input(PARAMS["session.attach"]).output(z39.object({ cols: z39.number(), rows: z39.number() })),
|
|
1004
1043
|
detach: base.input(PARAMS["session.detach"]).output(EMPTY),
|
|
1005
|
-
watch: base.meta(READ).input(PARAMS["session.watch"]).output(
|
|
1044
|
+
watch: base.meta(READ).input(PARAMS["session.watch"]).output(z39.object({ cols: z39.number(), rows: z39.number(), seq: z39.number(), replay: z39.string() })),
|
|
1006
1045
|
input: base.input(PARAMS["session.input"]).output(EMPTY),
|
|
1007
1046
|
submit: base.input(PARAMS["session.submit"]).output(EMPTY),
|
|
1008
1047
|
resize: base.input(PARAMS["session.resize"]).output(EMPTY),
|
|
1009
|
-
screen: base.meta(READ).input(PARAMS["session.screen"]).output(
|
|
1010
|
-
menu: base.meta(READ).input(PARAMS["session.menu"]).output(
|
|
1011
|
-
choose: base.input(PARAMS["session.choose"]).output(
|
|
1012
|
-
pressed:
|
|
1048
|
+
screen: base.meta(READ).input(PARAMS["session.screen"]).output(z39.object({ text: z39.string(), cols: z39.number(), rows: z39.number() })),
|
|
1049
|
+
menu: base.meta(READ).input(PARAMS["session.menu"]).output(z39.object({ menu: MENU_VIEW_SCHEMA.nullable() })),
|
|
1050
|
+
choose: base.input(PARAMS["session.choose"]).output(z39.object({
|
|
1051
|
+
pressed: z39.string(),
|
|
1013
1052
|
menu: MENU_VIEW_SCHEMA.nullable(),
|
|
1014
|
-
partial:
|
|
1053
|
+
partial: z39.literal(true).optional()
|
|
1015
1054
|
})),
|
|
1016
1055
|
eject: base.input(PARAMS["session.eject"]).output(EMPTY),
|
|
1017
1056
|
adopt: base.input(PARAMS["session.adopt"]).output(EMPTY),
|
|
1018
|
-
get: base.meta(READ).input(PARAMS["session.get"]).output(
|
|
1057
|
+
get: base.meta(READ).input(PARAMS["session.get"]).output(z39.object({
|
|
1019
1058
|
session: SESSION_DESCRIPTOR_SCHEMA,
|
|
1020
|
-
prompt:
|
|
1021
|
-
lastActivityAt:
|
|
1059
|
+
prompt: z39.string().nullable(),
|
|
1060
|
+
lastActivityAt: z39.number(),
|
|
1022
1061
|
pending: PENDING_PROMPT.nullable(),
|
|
1023
|
-
result:
|
|
1062
|
+
result: z39.string().nullable(),
|
|
1024
1063
|
sessionRecord: PUBLISHED_RECORD_SCHEMA.nullable()
|
|
1025
1064
|
})),
|
|
1026
|
-
read: base.meta(READ).input(PARAMS["session.read"]).output(
|
|
1027
|
-
rows:
|
|
1028
|
-
cursor:
|
|
1029
|
-
more:
|
|
1065
|
+
read: base.meta(READ).input(PARAMS["session.read"]).output(z39.object({
|
|
1066
|
+
rows: z39.array(TRANSCRIPT_ROW_SCHEMA).readonly(),
|
|
1067
|
+
cursor: z39.string(),
|
|
1068
|
+
more: z39.boolean()
|
|
1030
1069
|
})),
|
|
1031
1070
|
message: base.meta(KEYED).input(PARAMS["session.message"]).output(MESSAGE_ANSWER_SCHEMA),
|
|
1032
1071
|
tap: base.input(PARAMS["session.tap"]).output(EMPTY)
|
|
@@ -1076,7 +1115,7 @@ var GATEWAY_PATHS = {
|
|
|
1076
1115
|
}
|
|
1077
1116
|
};
|
|
1078
1117
|
// packages/contract/src/gateway-registry-schema.ts
|
|
1079
|
-
import { z as
|
|
1118
|
+
import { z as z40 } from "zod";
|
|
1080
1119
|
|
|
1081
1120
|
// packages/contract/src/max-events-cursor-bytes.ts
|
|
1082
1121
|
var MAX_EVENTS_CURSOR_BYTES = 4096;
|
|
@@ -1088,24 +1127,24 @@ var MAX_REGISTRY_DAEMONS = 36;
|
|
|
1088
1127
|
var DAEMON_NAME_PATTERN = /^[a-z][a-z0-9-]{0,30}$/u;
|
|
1089
1128
|
var ADDRESS_PATTERN = /^(?:\[(?<v6>[^\]]+)\]|(?<host>[^:[\]]+)):(?<port>\d{1,5})$/u;
|
|
1090
1129
|
var ADDRESS_MESSAGE = "needs an address of <host>:<port> with a port from 1 to 65535";
|
|
1091
|
-
var ADDRESS_SCHEMA =
|
|
1130
|
+
var ADDRESS_SCHEMA = z40.string({ error: ADDRESS_MESSAGE }).transform((raw, ctx) => {
|
|
1092
1131
|
const groups = ADDRESS_PATTERN.exec(raw)?.groups;
|
|
1093
1132
|
const host = groups?.["v6"] ?? groups?.["host"];
|
|
1094
1133
|
const port = Number(groups?.["port"]);
|
|
1095
1134
|
if (host === undefined || !Number.isInteger(port) || port < 1 || port > 65535) {
|
|
1096
1135
|
ctx.issues.push({ code: "custom", message: ADDRESS_MESSAGE, input: raw });
|
|
1097
|
-
return
|
|
1136
|
+
return z40.NEVER;
|
|
1098
1137
|
}
|
|
1099
1138
|
return { host, port };
|
|
1100
1139
|
});
|
|
1101
1140
|
var DAEMON_ID_MESSAGE = "needs the daemonID that atc daemon id prints on its host";
|
|
1102
|
-
var DAEMON_ID_SCHEMA2 =
|
|
1103
|
-
var DAEMON_SCHEMA =
|
|
1104
|
-
var GATEWAY_REGISTRY_SCHEMA =
|
|
1105
|
-
daemons:
|
|
1141
|
+
var DAEMON_ID_SCHEMA2 = z40.string({ error: DAEMON_ID_MESSAGE }).regex(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/u, DAEMON_ID_MESSAGE);
|
|
1142
|
+
var DAEMON_SCHEMA = z40.object({ address: ADDRESS_SCHEMA, daemonID: DAEMON_ID_SCHEMA2 }, { error: "must be an object with address and daemonID" });
|
|
1143
|
+
var GATEWAY_REGISTRY_SCHEMA = z40.object({
|
|
1144
|
+
daemons: z40.record(z40.string().regex(DAEMON_NAME_PATTERN), DAEMON_SCHEMA, {
|
|
1106
1145
|
error: (issue) => issue.code === "invalid_key" ? `must match ${DAEMON_NAME_PATTERN.source}` : "the registry must be an object whose daemons is an object"
|
|
1107
1146
|
}),
|
|
1108
|
-
defaultDaemon:
|
|
1147
|
+
defaultDaemon: z40.string({
|
|
1109
1148
|
error: "defaultDaemon is required and must name a daemon in the registry"
|
|
1110
1149
|
})
|
|
1111
1150
|
}, { error: "the registry must be an object whose daemons is an object" }).superRefine((registry, ctx) => {
|
|
@@ -1170,11 +1209,11 @@ var SESSION_ENV_NAMES = {
|
|
|
1170
1209
|
scopeFile: "AUTO_MODE_SCOPE_FILE"
|
|
1171
1210
|
};
|
|
1172
1211
|
// packages/contract/src/procedure-meta.ts
|
|
1173
|
-
import { z as
|
|
1174
|
-
var PROCEDURE_META_SCHEMA =
|
|
1175
|
-
access:
|
|
1176
|
-
readOnly:
|
|
1177
|
-
keyed:
|
|
1212
|
+
import { z as z41 } from "zod";
|
|
1213
|
+
var PROCEDURE_META_SCHEMA = z41.object({
|
|
1214
|
+
access: z41.enum(["owner", "principal"]),
|
|
1215
|
+
readOnly: z41.boolean(),
|
|
1216
|
+
keyed: z41.boolean()
|
|
1178
1217
|
});
|
|
1179
1218
|
export {
|
|
1180
1219
|
AGENT_ENTRY_SCHEMA,
|
|
@@ -1221,6 +1260,7 @@ export {
|
|
|
1221
1260
|
SPAWN_OPTION_SPEC_SCHEMA,
|
|
1222
1261
|
TRANSCRIPT_ROW_SCHEMA,
|
|
1223
1262
|
WORKSPACE_CLEANUP_SCHEMA,
|
|
1263
|
+
WORKSPACE_PRUNE_SCHEMA,
|
|
1224
1264
|
checkDaemon,
|
|
1225
1265
|
resolveAtcPaths,
|
|
1226
1266
|
resolveHomeDir,
|
|
@@ -51,6 +51,9 @@ export declare const REQUEST_PARAM_SCHEMAS: {
|
|
|
51
51
|
error: z.ZodNullable<z.ZodString>;
|
|
52
52
|
}, z.core.$strip>;
|
|
53
53
|
}, z.core.$strip>;
|
|
54
|
+
readonly 'workspaces.prune': z.ZodObject<{
|
|
55
|
+
remove: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
}, z.core.$strip>;
|
|
54
57
|
readonly 'session.list': z.ZodObject<{}, z.core.$strip>;
|
|
55
58
|
readonly 'dirs.list': z.ZodObject<{}, z.core.$strip>;
|
|
56
59
|
readonly 'agents.list': z.ZodObject<{}, z.core.$strip>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const PRUNE_FOLDER_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
verdict: z.ZodLiteral<"remove">;
|
|
4
|
+
kind: z.ZodEnum<{
|
|
5
|
+
state: "state";
|
|
6
|
+
workspace: "workspace";
|
|
7
|
+
}>;
|
|
8
|
+
path: z.ZodString;
|
|
9
|
+
bytes: z.ZodNullable<z.ZodNumber>;
|
|
10
|
+
found: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
verdict: z.ZodLiteral<"keep">;
|
|
13
|
+
kind: z.ZodEnum<{
|
|
14
|
+
state: "state";
|
|
15
|
+
workspace: "workspace";
|
|
16
|
+
}>;
|
|
17
|
+
path: z.ZodString;
|
|
18
|
+
bytes: z.ZodNullable<z.ZodNumber>;
|
|
19
|
+
reasons: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
verdict: z.ZodLiteral<"skip">;
|
|
22
|
+
kind: z.ZodLiteral<"workspace">;
|
|
23
|
+
path: z.ZodString;
|
|
24
|
+
reason: z.ZodString;
|
|
25
|
+
}, z.core.$strip>], "verdict">;
|
|
26
|
+
export declare const WORKSPACE_PRUNE_SCHEMA: z.ZodObject<{
|
|
27
|
+
dryRun: z.ZodBoolean;
|
|
28
|
+
folders: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
29
|
+
verdict: z.ZodLiteral<"remove">;
|
|
30
|
+
kind: z.ZodEnum<{
|
|
31
|
+
state: "state";
|
|
32
|
+
workspace: "workspace";
|
|
33
|
+
}>;
|
|
34
|
+
path: z.ZodString;
|
|
35
|
+
bytes: z.ZodNullable<z.ZodNumber>;
|
|
36
|
+
found: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
37
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
38
|
+
verdict: z.ZodLiteral<"keep">;
|
|
39
|
+
kind: z.ZodEnum<{
|
|
40
|
+
state: "state";
|
|
41
|
+
workspace: "workspace";
|
|
42
|
+
}>;
|
|
43
|
+
path: z.ZodString;
|
|
44
|
+
bytes: z.ZodNullable<z.ZodNumber>;
|
|
45
|
+
reasons: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
46
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
+
verdict: z.ZodLiteral<"skip">;
|
|
48
|
+
kind: z.ZodLiteral<"workspace">;
|
|
49
|
+
path: z.ZodString;
|
|
50
|
+
reason: z.ZodString;
|
|
51
|
+
}, z.core.$strip>], "verdict">>>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type WorkspacePruneFolder = Readonly<z.output<typeof PRUNE_FOLDER_SCHEMA>>;
|
|
54
|
+
export type WorkspacePrune = Readonly<z.output<typeof WORKSPACE_PRUNE_SCHEMA>>;
|
|
55
|
+
export {};
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"zod": "4.6.7"
|
|
19
19
|
},
|
|
20
20
|
"name": "@atcx/contract",
|
|
21
|
-
"version": "7.
|
|
21
|
+
"version": "7.11.0",
|
|
22
22
|
"description": "atc's public contract: the daemon's request contract, the event, session record, hello and config schemas, the error codes, the session env names, the state paths, and the gateway's routes and registry schema",
|
|
23
23
|
"homepage": "https://github.com/zgeoff/atc/tree/main/packages/contract#readme",
|
|
24
24
|
"bugs": "https://github.com/zgeoff/atc/issues",
|