@treeseed/sdk 0.13.0-rc.90 → 0.13.0-rc.92

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.
Files changed (52) hide show
  1. package/dist/.treeseed-build-complete.json +1 -1
  2. package/dist/agent-capacity/contracts/capacity/assignments/assignment-context-pack.d.ts +6 -6
  3. package/dist/agent-capacity/validation/agent-definition-schema.d.ts +144 -144
  4. package/dist/capacity-provider/environment-catalog.d.ts +12 -12
  5. package/dist/capacity-provider/index.d.ts +1 -0
  6. package/dist/capacity-provider/index.js +1 -0
  7. package/dist/capacity-provider/install-configuration.d.ts +39 -0
  8. package/dist/capacity-provider/install-configuration.js +18 -0
  9. package/dist/configuration/secrets-capability.d.ts +3 -0
  10. package/dist/configuration/secrets-capability.js +3 -0
  11. package/dist/content/validation/agent-operational-content-schemas.d.ts +16 -16
  12. package/dist/content/validation/auxiliary-content-schemas.d.ts +20 -20
  13. package/dist/content/validation/content-model-schemas.d.ts +304 -304
  14. package/dist/content/validation/portable-content-data.d.ts +28 -28
  15. package/dist/deployment/ai-hosting.d.ts +297 -0
  16. package/dist/deployment/ai-hosting.js +63 -0
  17. package/dist/deployment/ai-instance.d.ts +48 -0
  18. package/dist/deployment/ai-instance.js +23 -0
  19. package/dist/deployment/hosted-topology-template.d.ts +24 -24
  20. package/dist/deployment/hosted-topology.d.ts +114 -114
  21. package/dist/deployment/index.d.ts +2 -0
  22. package/dist/deployment/index.js +2 -0
  23. package/dist/deployment/schemas.d.ts +38 -38
  24. package/dist/development/schemas.d.ts +76 -76
  25. package/dist/operator-contracts/canonical-command-tree.js +3 -10
  26. package/dist/operator-contracts/catalog/communication-operations.d.ts +5 -5
  27. package/dist/operator-contracts/catalog/hosted-topology-operations.d.ts +21 -21
  28. package/dist/operator-contracts/catalog/inbox-operations.d.ts +8 -8
  29. package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.d.ts +29 -0
  30. package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.js +18 -0
  31. package/dist/operator-contracts/catalog/infrastructure/command-tree-paths.d.ts +3 -0
  32. package/dist/operator-contracts/catalog/infrastructure/command-tree-paths.js +15 -0
  33. package/dist/operator-contracts/communication/contracts.d.ts +34 -34
  34. package/dist/operator-contracts/control-plane-operations.d.ts +63 -34
  35. package/dist/operator-contracts/control-plane-operations.js +3 -17
  36. package/dist/operator-contracts/inbox/contracts.d.ts +30 -30
  37. package/dist/operator-contracts/operation-builder.d.ts +1 -0
  38. package/dist/operator-contracts/operation-builder.js +17 -0
  39. package/dist/platform/schemas.d.ts +220 -40
  40. package/dist/platform/schemas.js +7 -2
  41. package/dist/platform/workset.js +5 -1
  42. package/dist/secrets-capability/github-actions-encryption.js +1 -1
  43. package/dist/secrets-capability/provider-operation-contracts.d.ts +14 -0
  44. package/dist/secrets-capability/service-provider-contracts.d.ts +4 -2
  45. package/dist/secrets-capability/service-provider-contracts.js +41 -27
  46. package/dist/secrets-capability/shared-access.d.ts +51 -0
  47. package/dist/secrets-capability/shared-access.js +36 -0
  48. package/dist/secrets-capability/shared-resources.d.ts +376 -0
  49. package/dist/secrets-capability/shared-resources.js +91 -0
  50. package/dist/secrets-capability/vault-contracts.d.ts +132 -0
  51. package/dist/secrets-capability/vault-contracts.js +56 -0
  52. package/package.json +1 -1
@@ -297,14 +297,14 @@ export declare function validatePortableContentData(model: string, value: unknow
297
297
  commit?: {
298
298
  allowed: boolean;
299
299
  } | undefined;
300
- network?: {
301
- allowWeb?: boolean | undefined;
302
- allowedDomains?: string[] | undefined;
303
- } | undefined;
304
300
  content?: Record<string, {
305
301
  operations: string[];
306
302
  filters?: Record<string, unknown> | undefined;
307
303
  }> | undefined;
304
+ network?: {
305
+ allowWeb?: boolean | undefined;
306
+ allowedDomains?: string[] | undefined;
307
+ } | undefined;
308
308
  shell?: {
309
309
  allowCommands?: boolean | undefined;
310
310
  allowedCommands?: string[] | undefined;
@@ -319,14 +319,14 @@ export declare function validatePortableContentData(model: string, value: unknow
319
319
  commit?: {
320
320
  allowed: boolean;
321
321
  } | undefined;
322
- network?: {
323
- allowWeb?: boolean | undefined;
324
- allowedDomains?: string[] | undefined;
325
- } | undefined;
326
322
  content?: Record<string, {
327
323
  operations: string[];
328
324
  filters?: Record<string, unknown> | undefined;
329
325
  }> | undefined;
326
+ network?: {
327
+ allowWeb?: boolean | undefined;
328
+ allowedDomains?: string[] | undefined;
329
+ } | undefined;
330
330
  shell?: {
331
331
  allowCommands?: boolean | undefined;
332
332
  allowedCommands?: string[] | undefined;
@@ -921,14 +921,14 @@ export declare function validatePortableContentData(model: string, value: unknow
921
921
  commit?: {
922
922
  allowed: boolean;
923
923
  } | undefined;
924
- network?: {
925
- allowWeb?: boolean | undefined;
926
- allowedDomains?: string[] | undefined;
927
- } | undefined;
928
924
  content?: Record<string, {
929
925
  operations: string[];
930
926
  filters?: Record<string, unknown> | undefined;
931
927
  }> | undefined;
928
+ network?: {
929
+ allowWeb?: boolean | undefined;
930
+ allowedDomains?: string[] | undefined;
931
+ } | undefined;
932
932
  shell?: {
933
933
  allowCommands?: boolean | undefined;
934
934
  allowedCommands?: string[] | undefined;
@@ -1093,14 +1093,14 @@ export declare function validatePortableContentData(model: string, value: unknow
1093
1093
  commit?: {
1094
1094
  allowed: boolean;
1095
1095
  } | undefined;
1096
- network?: {
1097
- allowWeb?: boolean | undefined;
1098
- allowedDomains?: string[] | undefined;
1099
- } | undefined;
1100
1096
  content?: Record<string, {
1101
1097
  operations: string[];
1102
1098
  filters?: Record<string, unknown> | undefined;
1103
1099
  }> | undefined;
1100
+ network?: {
1101
+ allowWeb?: boolean | undefined;
1102
+ allowedDomains?: string[] | undefined;
1103
+ } | undefined;
1104
1104
  shell?: {
1105
1105
  allowCommands?: boolean | undefined;
1106
1106
  allowedCommands?: string[] | undefined;
@@ -1265,14 +1265,14 @@ export declare function validatePortableContentData(model: string, value: unknow
1265
1265
  commit?: {
1266
1266
  allowed: boolean;
1267
1267
  } | undefined;
1268
- network?: {
1269
- allowWeb?: boolean | undefined;
1270
- allowedDomains?: string[] | undefined;
1271
- } | undefined;
1272
1268
  content?: Record<string, {
1273
1269
  operations: string[];
1274
1270
  filters?: Record<string, unknown> | undefined;
1275
1271
  }> | undefined;
1272
+ network?: {
1273
+ allowWeb?: boolean | undefined;
1274
+ allowedDomains?: string[] | undefined;
1275
+ } | undefined;
1276
1276
  shell?: {
1277
1277
  allowCommands?: boolean | undefined;
1278
1278
  allowedCommands?: string[] | undefined;
@@ -1437,14 +1437,14 @@ export declare function validatePortableContentData(model: string, value: unknow
1437
1437
  commit?: {
1438
1438
  allowed: boolean;
1439
1439
  } | undefined;
1440
- network?: {
1441
- allowWeb?: boolean | undefined;
1442
- allowedDomains?: string[] | undefined;
1443
- } | undefined;
1444
1440
  content?: Record<string, {
1445
1441
  operations: string[];
1446
1442
  filters?: Record<string, unknown> | undefined;
1447
1443
  }> | undefined;
1444
+ network?: {
1445
+ allowWeb?: boolean | undefined;
1446
+ allowedDomains?: string[] | undefined;
1447
+ } | undefined;
1448
1448
  shell?: {
1449
1449
  allowCommands?: boolean | undefined;
1450
1450
  allowedCommands?: string[] | undefined;
@@ -1628,8 +1628,8 @@ export declare function validatePortableContentData(model: string, value: unknow
1628
1628
  directory: string;
1629
1629
  integrity?: string | undefined;
1630
1630
  } | {
1631
- version: string;
1632
1631
  kind: "r2";
1632
+ version: string;
1633
1633
  objectKey: string;
1634
1634
  integrity?: string | undefined;
1635
1635
  bucket?: string | undefined;
@@ -1649,8 +1649,8 @@ export declare function validatePortableContentData(model: string, value: unknow
1649
1649
  teamId?: string | undefined;
1650
1650
  sourceRef?: string | undefined;
1651
1651
  } | {
1652
- id: string;
1653
1652
  kind: "workday" | "api" | "handler" | "spec" | "message_chain" | "manager_worker" | "ui" | "context-query" | "context-query-set";
1653
+ id: string;
1654
1654
  trigger: Record<string, unknown>;
1655
1655
  agent: string;
1656
1656
  contextQueryRefs: string[];
@@ -1710,8 +1710,8 @@ export declare function validatePortableContentData(model: string, value: unknow
1710
1710
  purpose: string;
1711
1711
  target: {
1712
1712
  kind: "code" | "content" | "graph" | "mixed";
1713
- paths?: string[] | undefined;
1714
1713
  models?: string[] | undefined;
1714
+ paths?: string[] | undefined;
1715
1715
  };
1716
1716
  description: string;
1717
1717
  revision: number;
@@ -1746,9 +1746,9 @@ export declare function validatePortableContentData(model: string, value: unknow
1746
1746
  }[];
1747
1747
  mergePolicy: "replace" | "append";
1748
1748
  } | {
1749
+ kind: "status" | "message" | "summary" | "plan";
1749
1750
  id: string;
1750
1751
  variables: string[];
1751
- kind: "status" | "message" | "summary" | "plan";
1752
1752
  description: string;
1753
1753
  revision: number;
1754
1754
  title: string;
@@ -0,0 +1,297 @@
1
+ import { z } from 'zod';
2
+ /** Public intent only: credentials are resolved at execution, never serialized here. */
3
+ export declare const aiHostingScheduleSchema: z.ZodEffects<z.ZodObject<{
4
+ timeZone: z.ZodEffects<z.ZodString, string, string>;
5
+ weekdays: z.ZodArray<z.ZodNumber, "many">;
6
+ start: z.ZodString;
7
+ end: z.ZodString;
8
+ startupLeadMinutes: z.ZodNumber;
9
+ idleAction: z.ZodLiteral<"hibernate">;
10
+ activeWorkPolicy: z.ZodLiteral<"drain-and-checkpoint">;
11
+ }, "strict", z.ZodTypeAny, {
12
+ start: string;
13
+ activeWorkPolicy: "drain-and-checkpoint";
14
+ timeZone: string;
15
+ weekdays: number[];
16
+ end: string;
17
+ startupLeadMinutes: number;
18
+ idleAction: "hibernate";
19
+ }, {
20
+ start: string;
21
+ activeWorkPolicy: "drain-and-checkpoint";
22
+ timeZone: string;
23
+ weekdays: number[];
24
+ end: string;
25
+ startupLeadMinutes: number;
26
+ idleAction: "hibernate";
27
+ }>, {
28
+ start: string;
29
+ activeWorkPolicy: "drain-and-checkpoint";
30
+ timeZone: string;
31
+ weekdays: number[];
32
+ end: string;
33
+ startupLeadMinutes: number;
34
+ idleAction: "hibernate";
35
+ }, {
36
+ start: string;
37
+ activeWorkPolicy: "drain-and-checkpoint";
38
+ timeZone: string;
39
+ weekdays: number[];
40
+ end: string;
41
+ startupLeadMinutes: number;
42
+ idleAction: "hibernate";
43
+ }>;
44
+ export declare const aiHostingDeploymentSchema: z.ZodEffects<z.ZodObject<{
45
+ schemaVersion: z.ZodLiteral<"treeseed.ai-hosting-deployment/v1">;
46
+ teamId: z.ZodString;
47
+ projectId: z.ZodString;
48
+ deploymentId: z.ZodString;
49
+ environment: z.ZodEnum<["staging", "production"]>;
50
+ provider: z.ZodLiteral<"hyperstack">;
51
+ hostingBindingId: z.ZodString;
52
+ components: z.ZodArray<z.ZodObject<{
53
+ componentId: z.ZodEnum<["ai-inference", "ai-training"]>;
54
+ releaseDigest: z.ZodString;
55
+ }, "strict", z.ZodTypeAny, {
56
+ componentId: "ai-inference" | "ai-training";
57
+ releaseDigest: string;
58
+ }, {
59
+ componentId: "ai-inference" | "ai-training";
60
+ releaseDigest: string;
61
+ }>, "many">;
62
+ machine: z.ZodObject<{
63
+ name: z.ZodString;
64
+ environmentName: z.ZodString;
65
+ flavorName: z.ZodString;
66
+ imageName: z.ZodString;
67
+ keypairName: z.ZodString;
68
+ volumeName: z.ZodString;
69
+ }, "strict", z.ZodTypeAny, {
70
+ name: string;
71
+ environmentName: string;
72
+ flavorName: string;
73
+ imageName: string;
74
+ keypairName: string;
75
+ volumeName: string;
76
+ }, {
77
+ name: string;
78
+ environmentName: string;
79
+ flavorName: string;
80
+ imageName: string;
81
+ keypairName: string;
82
+ volumeName: string;
83
+ }>;
84
+ gpuAdmission: z.ZodLiteral<"exclusive-engine">;
85
+ storage: z.ZodArray<z.ZodObject<{
86
+ bindingId: z.ZodString;
87
+ purpose: z.ZodEnum<["datasets", "models", "checkpoints", "artifacts"]>;
88
+ access: z.ZodEnum<["read", "write"]>;
89
+ }, "strict", z.ZodTypeAny, {
90
+ purpose: "artifacts" | "datasets" | "models" | "checkpoints";
91
+ bindingId: string;
92
+ access: "read" | "write";
93
+ }, {
94
+ purpose: "artifacts" | "datasets" | "models" | "checkpoints";
95
+ bindingId: string;
96
+ access: "read" | "write";
97
+ }>, "many">;
98
+ schedule: z.ZodOptional<z.ZodEffects<z.ZodObject<{
99
+ timeZone: z.ZodEffects<z.ZodString, string, string>;
100
+ weekdays: z.ZodArray<z.ZodNumber, "many">;
101
+ start: z.ZodString;
102
+ end: z.ZodString;
103
+ startupLeadMinutes: z.ZodNumber;
104
+ idleAction: z.ZodLiteral<"hibernate">;
105
+ activeWorkPolicy: z.ZodLiteral<"drain-and-checkpoint">;
106
+ }, "strict", z.ZodTypeAny, {
107
+ start: string;
108
+ activeWorkPolicy: "drain-and-checkpoint";
109
+ timeZone: string;
110
+ weekdays: number[];
111
+ end: string;
112
+ startupLeadMinutes: number;
113
+ idleAction: "hibernate";
114
+ }, {
115
+ start: string;
116
+ activeWorkPolicy: "drain-and-checkpoint";
117
+ timeZone: string;
118
+ weekdays: number[];
119
+ end: string;
120
+ startupLeadMinutes: number;
121
+ idleAction: "hibernate";
122
+ }>, {
123
+ start: string;
124
+ activeWorkPolicy: "drain-and-checkpoint";
125
+ timeZone: string;
126
+ weekdays: number[];
127
+ end: string;
128
+ startupLeadMinutes: number;
129
+ idleAction: "hibernate";
130
+ }, {
131
+ start: string;
132
+ activeWorkPolicy: "drain-and-checkpoint";
133
+ timeZone: string;
134
+ weekdays: number[];
135
+ end: string;
136
+ startupLeadMinutes: number;
137
+ idleAction: "hibernate";
138
+ }>>;
139
+ }, "strict", z.ZodTypeAny, {
140
+ schemaVersion: "treeseed.ai-hosting-deployment/v1";
141
+ components: {
142
+ componentId: "ai-inference" | "ai-training";
143
+ releaseDigest: string;
144
+ }[];
145
+ projectId: string;
146
+ teamId: string;
147
+ environment: "production" | "staging";
148
+ provider: "hyperstack";
149
+ deploymentId: string;
150
+ hostingBindingId: string;
151
+ machine: {
152
+ name: string;
153
+ environmentName: string;
154
+ flavorName: string;
155
+ imageName: string;
156
+ keypairName: string;
157
+ volumeName: string;
158
+ };
159
+ gpuAdmission: "exclusive-engine";
160
+ storage: {
161
+ purpose: "artifacts" | "datasets" | "models" | "checkpoints";
162
+ bindingId: string;
163
+ access: "read" | "write";
164
+ }[];
165
+ schedule?: {
166
+ start: string;
167
+ activeWorkPolicy: "drain-and-checkpoint";
168
+ timeZone: string;
169
+ weekdays: number[];
170
+ end: string;
171
+ startupLeadMinutes: number;
172
+ idleAction: "hibernate";
173
+ } | undefined;
174
+ }, {
175
+ schemaVersion: "treeseed.ai-hosting-deployment/v1";
176
+ components: {
177
+ componentId: "ai-inference" | "ai-training";
178
+ releaseDigest: string;
179
+ }[];
180
+ projectId: string;
181
+ teamId: string;
182
+ environment: "production" | "staging";
183
+ provider: "hyperstack";
184
+ deploymentId: string;
185
+ hostingBindingId: string;
186
+ machine: {
187
+ name: string;
188
+ environmentName: string;
189
+ flavorName: string;
190
+ imageName: string;
191
+ keypairName: string;
192
+ volumeName: string;
193
+ };
194
+ gpuAdmission: "exclusive-engine";
195
+ storage: {
196
+ purpose: "artifacts" | "datasets" | "models" | "checkpoints";
197
+ bindingId: string;
198
+ access: "read" | "write";
199
+ }[];
200
+ schedule?: {
201
+ start: string;
202
+ activeWorkPolicy: "drain-and-checkpoint";
203
+ timeZone: string;
204
+ weekdays: number[];
205
+ end: string;
206
+ startupLeadMinutes: number;
207
+ idleAction: "hibernate";
208
+ } | undefined;
209
+ }>, {
210
+ schemaVersion: "treeseed.ai-hosting-deployment/v1";
211
+ components: {
212
+ componentId: "ai-inference" | "ai-training";
213
+ releaseDigest: string;
214
+ }[];
215
+ projectId: string;
216
+ teamId: string;
217
+ environment: "production" | "staging";
218
+ provider: "hyperstack";
219
+ deploymentId: string;
220
+ hostingBindingId: string;
221
+ machine: {
222
+ name: string;
223
+ environmentName: string;
224
+ flavorName: string;
225
+ imageName: string;
226
+ keypairName: string;
227
+ volumeName: string;
228
+ };
229
+ gpuAdmission: "exclusive-engine";
230
+ storage: {
231
+ purpose: "artifacts" | "datasets" | "models" | "checkpoints";
232
+ bindingId: string;
233
+ access: "read" | "write";
234
+ }[];
235
+ schedule?: {
236
+ start: string;
237
+ activeWorkPolicy: "drain-and-checkpoint";
238
+ timeZone: string;
239
+ weekdays: number[];
240
+ end: string;
241
+ startupLeadMinutes: number;
242
+ idleAction: "hibernate";
243
+ } | undefined;
244
+ }, {
245
+ schemaVersion: "treeseed.ai-hosting-deployment/v1";
246
+ components: {
247
+ componentId: "ai-inference" | "ai-training";
248
+ releaseDigest: string;
249
+ }[];
250
+ projectId: string;
251
+ teamId: string;
252
+ environment: "production" | "staging";
253
+ provider: "hyperstack";
254
+ deploymentId: string;
255
+ hostingBindingId: string;
256
+ machine: {
257
+ name: string;
258
+ environmentName: string;
259
+ flavorName: string;
260
+ imageName: string;
261
+ keypairName: string;
262
+ volumeName: string;
263
+ };
264
+ gpuAdmission: "exclusive-engine";
265
+ storage: {
266
+ purpose: "artifacts" | "datasets" | "models" | "checkpoints";
267
+ bindingId: string;
268
+ access: "read" | "write";
269
+ }[];
270
+ schedule?: {
271
+ start: string;
272
+ activeWorkPolicy: "drain-and-checkpoint";
273
+ timeZone: string;
274
+ weekdays: number[];
275
+ end: string;
276
+ startupLeadMinutes: number;
277
+ idleAction: "hibernate";
278
+ } | undefined;
279
+ }>;
280
+ export type AiHostingDeployment = z.infer<typeof aiHostingDeploymentSchema>;
281
+ export type AiHostingSchedule = z.infer<typeof aiHostingScheduleSchema>;
282
+ /** Engine selection is independent from the infrastructure provider or credentials. */
283
+ export declare const AI_HOSTING_TARGETS: readonly [{
284
+ readonly id: "ai-inference";
285
+ readonly project: "ai";
286
+ readonly engine: "vllm";
287
+ readonly capability: "ai-inference-hosting";
288
+ readonly runtimeOwner: "ai";
289
+ readonly infrastructureOwner: "deployment";
290
+ }, {
291
+ readonly id: "ai-training";
292
+ readonly project: "ai";
293
+ readonly engine: "axolotl";
294
+ readonly capability: "ai-training-hosting";
295
+ readonly runtimeOwner: "ai";
296
+ readonly infrastructureOwner: "deployment";
297
+ }];
@@ -0,0 +1,63 @@
1
+ import { z } from "zod";
2
+ const id = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u);
3
+ const name = z.string().trim().min(1).max(128);
4
+ const digest = z.string().regex(/^sha256:[a-f0-9]{64}$/u);
5
+ const time = z.string().regex(/^(?:[01][0-9]|2[0-3]):[0-5][0-9]$/u);
6
+ const aiHostingScheduleSchema = z.object({
7
+ timeZone: z.string().refine((value) => {
8
+ try {
9
+ new Intl.DateTimeFormat("en", { timeZone: value });
10
+ return true;
11
+ } catch {
12
+ return false;
13
+ }
14
+ }, "Use an IANA time zone."),
15
+ weekdays: z.array(z.number().int().min(1).max(7)).min(1).max(7),
16
+ start: time,
17
+ end: time,
18
+ startupLeadMinutes: z.number().int().min(0).max(120),
19
+ idleAction: z.literal("hibernate"),
20
+ activeWorkPolicy: z.literal("drain-and-checkpoint")
21
+ }).strict().superRefine((value, context) => {
22
+ if (new Set(value.weekdays).size !== value.weekdays.length) context.addIssue({ code: "custom", path: ["weekdays"], message: "Choose each weekday once." });
23
+ if (value.start >= value.end) context.addIssue({ code: "custom", path: ["end"], message: "End must follow start on the same local day." });
24
+ });
25
+ const storage = z.object({
26
+ bindingId: id,
27
+ purpose: z.enum(["datasets", "models", "checkpoints", "artifacts"]),
28
+ access: z.enum(["read", "write"])
29
+ }).strict();
30
+ const component = z.object({ componentId: z.enum(["ai-inference", "ai-training"]), releaseDigest: digest }).strict();
31
+ const aiHostingDeploymentSchema = z.object({
32
+ schemaVersion: z.literal("treeseed.ai-hosting-deployment/v1"),
33
+ teamId: id,
34
+ projectId: id,
35
+ deploymentId: id,
36
+ environment: z.enum(["staging", "production"]),
37
+ provider: z.literal("hyperstack"),
38
+ hostingBindingId: id,
39
+ components: z.array(component).min(1).max(2),
40
+ machine: z.object({ name, environmentName: name, flavorName: name, imageName: name, keypairName: name, volumeName: name }).strict(),
41
+ gpuAdmission: z.literal("exclusive-engine"),
42
+ storage: z.array(storage).min(1).max(16),
43
+ schedule: aiHostingScheduleSchema.optional()
44
+ }).strict().superRefine((value, context) => {
45
+ if (new Set(value.components.map((item) => item.componentId)).size !== value.components.length)
46
+ context.addIssue({ code: "custom", path: ["components"], message: "Each engine can be selected once." });
47
+ if (!value.storage.some((item) => item.purpose === "models" && item.access === "read"))
48
+ context.addIssue({ code: "custom", path: ["storage"], message: "An authorized model read binding is required." });
49
+ if (value.components.some((item) => item.componentId === "ai-training")) {
50
+ for (const [purpose, access] of [["datasets", "read"], ["checkpoints", "write"]])
51
+ if (!value.storage.some((item) => item.purpose === purpose && item.access === access))
52
+ context.addIssue({ code: "custom", path: ["storage"], message: `Training requires ${purpose} ${access} access.` });
53
+ }
54
+ });
55
+ const AI_HOSTING_TARGETS = [
56
+ { id: "ai-inference", project: "ai", engine: "vllm", capability: "ai-inference-hosting", runtimeOwner: "ai", infrastructureOwner: "deployment" },
57
+ { id: "ai-training", project: "ai", engine: "axolotl", capability: "ai-training-hosting", runtimeOwner: "ai", infrastructureOwner: "deployment" }
58
+ ];
59
+ export {
60
+ AI_HOSTING_TARGETS,
61
+ aiHostingDeploymentSchema,
62
+ aiHostingScheduleSchema
63
+ };
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ export declare const aiInstanceDraftSchema: z.ZodEffects<z.ZodObject<{
3
+ name: z.ZodString;
4
+ projectId: z.ZodString;
5
+ purpose: z.ZodEnum<["inference", "training", "both"]>;
6
+ hostingConnectionId: z.ZodString;
7
+ storageConnectionId: z.ZodNullable<z.ZodString>;
8
+ model: z.ZodString;
9
+ schedule: z.ZodEnum<["always", "weekdays"]>;
10
+ timeZone: z.ZodEffects<z.ZodString, string, string>;
11
+ }, "strict", z.ZodTypeAny, {
12
+ name: string;
13
+ projectId: string;
14
+ purpose: "inference" | "training" | "both";
15
+ timeZone: string;
16
+ schedule: "weekdays" | "always";
17
+ hostingConnectionId: string;
18
+ storageConnectionId: string | null;
19
+ model: string;
20
+ }, {
21
+ name: string;
22
+ projectId: string;
23
+ purpose: "inference" | "training" | "both";
24
+ timeZone: string;
25
+ schedule: "weekdays" | "always";
26
+ hostingConnectionId: string;
27
+ storageConnectionId: string | null;
28
+ model: string;
29
+ }>, {
30
+ name: string;
31
+ projectId: string;
32
+ purpose: "inference" | "training" | "both";
33
+ timeZone: string;
34
+ schedule: "weekdays" | "always";
35
+ hostingConnectionId: string;
36
+ storageConnectionId: string | null;
37
+ model: string;
38
+ }, {
39
+ name: string;
40
+ projectId: string;
41
+ purpose: "inference" | "training" | "both";
42
+ timeZone: string;
43
+ schedule: "weekdays" | "always";
44
+ hostingConnectionId: string;
45
+ storageConnectionId: string | null;
46
+ model: string;
47
+ }>;
48
+ export type AiInstanceDraft = z.infer<typeof aiInstanceDraftSchema>;
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ const aiInstanceDraftSchema = z.object({
3
+ name: z.string().trim().min(1).max(128),
4
+ projectId: z.string().min(1).max(128),
5
+ purpose: z.enum(["inference", "training", "both"]),
6
+ hostingConnectionId: z.string().min(1).max(128),
7
+ storageConnectionId: z.string().min(1).max(128).nullable(),
8
+ model: z.string().trim().min(1).max(512),
9
+ schedule: z.enum(["always", "weekdays"]),
10
+ timeZone: z.string().refine((value) => {
11
+ try {
12
+ new Intl.DateTimeFormat("en", { timeZone: value });
13
+ return true;
14
+ } catch {
15
+ return false;
16
+ }
17
+ }, "Use an IANA time zone.")
18
+ }).strict().superRefine((value, context) => {
19
+ if (value.purpose !== "inference" && !value.storageConnectionId) context.addIssue({ code: "custom", path: ["storageConnectionId"], message: "Training requires a storage connection." });
20
+ });
21
+ export {
22
+ aiInstanceDraftSchema
23
+ };