@scarn/sdk 0.8.17 → 0.8.19

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 (62) hide show
  1. package/dist/{chunk-g2mzg278.js → chunk-0c60x3v8.js} +51 -59
  2. package/dist/{chunk-dhqeg0wf.js → chunk-2tmrw253.js} +1 -1
  3. package/dist/{chunk-r03knh9j.js → chunk-3zp2qtf8.js} +80 -1
  4. package/dist/{chunk-ar6hcj1r.js → chunk-6tra3gw8.js} +7 -1
  5. package/dist/{chunk-a04phj60.js → chunk-833ef6dg.js} +121 -260
  6. package/dist/{chunk-2ekz6tr5.js → chunk-aemxz9r7.js} +18 -2
  7. package/dist/chunk-e0pt5x0e.js +167 -0
  8. package/dist/chunk-mmy80pec.js +64 -0
  9. package/dist/chunk-mzj1j0p5.js +116 -0
  10. package/dist/{chunk-cdj0yqgs.js → chunk-pqtd0hr7.js} +12 -2
  11. package/dist/chunk-qgkx89eg.js +210 -0
  12. package/dist/chunk-rphfy0fj.js +167 -0
  13. package/dist/chunk-t1dq2c2s.js +224 -0
  14. package/dist/{chunk-qs7p11rp.js → chunk-tvjcfh6s.js} +5 -1
  15. package/dist/{chunk-1wnv6rb2.js → chunk-ymywp5ht.js} +1 -1
  16. package/dist/client.js +8 -2
  17. package/dist/connectors/catalog.d.ts +49 -0
  18. package/dist/connectors/index.d.ts +45 -0
  19. package/dist/connectors/index.js +41 -0
  20. package/dist/defaults/index.js +2 -2
  21. package/dist/definitions/automations/index.js +2 -2
  22. package/dist/definitions/environments/define-environment.d.ts +39 -0
  23. package/dist/definitions/environments/environments-client.d.ts +50 -0
  24. package/dist/definitions/environments/index.d.ts +6 -0
  25. package/dist/definitions/environments/index.js +97 -0
  26. package/dist/definitions/pipelines/index.js +2 -2
  27. package/dist/definitions/steps/compile-mcps.d.ts +8 -12
  28. package/dist/definitions/steps/define-code-step.d.ts +18 -11
  29. package/dist/definitions/steps/define-step.d.ts +14 -25
  30. package/dist/definitions/steps/env.d.ts +30 -8
  31. package/dist/definitions/steps/index.js +30 -13
  32. package/dist/definitions/steps/mcp-server-config.d.ts +19 -9
  33. package/dist/definitions/steps/repo.d.ts +56 -28
  34. package/dist/definitions/steps/runtime.d.ts +54 -39
  35. package/dist/definitions/steps/step-definitions-client.d.ts +222 -63
  36. package/dist/definitions/steps/step-handle.d.ts +8 -1
  37. package/dist/definitions/validation/index.js +6 -3
  38. package/dist/definitions/validation/validate-repo.d.ts +3 -7
  39. package/dist/definitions/validation/validate-runtime.d.ts +2 -7
  40. package/dist/env-vars.d.ts +57 -1
  41. package/dist/env-vars.js +7 -1
  42. package/dist/environment.d.ts +564 -0
  43. package/dist/environment.js +46 -0
  44. package/dist/generated/index.d.ts +2 -2
  45. package/dist/generated/sdk.gen.d.ts +27 -2
  46. package/dist/generated/types.gen.d.ts +2141 -187
  47. package/dist/index.d.ts +2 -0
  48. package/dist/index.js +94 -28
  49. package/dist/opencode-mcp.d.ts +75 -4
  50. package/dist/opencode-mcp.js +2 -1
  51. package/dist/push/code-step-lookup.d.ts +6 -0
  52. package/dist/push/code-step-lookup.js +3 -1
  53. package/dist/push/collect-definitions.d.ts +13 -0
  54. package/dist/push/index.js +127 -15
  55. package/dist/push/push-from-directory.d.ts +11 -2
  56. package/dist/repo-config.d.ts +88 -30
  57. package/dist/repo-config.js +21 -5
  58. package/dist/resolve-environment.d.ts +19 -0
  59. package/dist/resolve-environment.js +19 -0
  60. package/dist/task-plane-client.d.ts +132 -22
  61. package/package.json +17 -1
  62. package/dist/chunk-2sk92cnd.js +0 -103
@@ -0,0 +1,564 @@
1
+ import { z } from "zod";
2
+ import { type EnvVarSpec } from "./env-vars";
3
+ import { managedRuntimeIdSchema } from "./managed-runtimes";
4
+ import { type ConnectorVarsMissing } from "./connectors";
5
+ export declare const environmentNameSchema: z.ZodString;
6
+ export declare const environmentRuntimeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7
+ kind: z.ZodLiteral<"devcontainer">;
8
+ config: z.ZodOptional<z.ZodString>;
9
+ }, z.core.$strict>, z.ZodObject<{
10
+ kind: z.ZodLiteral<"managed">;
11
+ id: z.ZodEnum<{
12
+ bun1: "bun1";
13
+ node24: "node24";
14
+ }>;
15
+ }, z.core.$strict>, z.ZodObject<{
16
+ kind: z.ZodLiteral<"host">;
17
+ }, z.core.$strict>], "kind">;
18
+ /** Environments have no branch: the step's repo `baseBranch` picks the code. */
19
+ export declare const rejectEnvironmentBranch: z.core.$ZodErrorMap;
20
+ /**
21
+ * The fields an environment defines, shared by an inline environment in a
22
+ * task execution config (v3, plus `kind: "inline"`) and a named
23
+ * environment's content (plus `description`). Strict write rules.
24
+ */
25
+ export declare const environmentFieldsSchema: z.ZodObject<{
26
+ runtime: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
27
+ kind: z.ZodLiteral<"devcontainer">;
28
+ config: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strict>, z.ZodObject<{
30
+ kind: z.ZodLiteral<"managed">;
31
+ id: z.ZodEnum<{
32
+ bun1: "bun1";
33
+ node24: "node24";
34
+ }>;
35
+ }, z.core.$strict>, z.ZodObject<{
36
+ kind: z.ZodLiteral<"host">;
37
+ }, z.core.$strict>], "kind">>;
38
+ vars: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
39
+ name: z.ZodString;
40
+ source: z.ZodLiteral<"value">;
41
+ value: z.ZodString;
42
+ secret: z.ZodBoolean;
43
+ applies: z.ZodDefault<z.ZodEnum<{
44
+ agent: "agent";
45
+ setup: "setup";
46
+ both: "both";
47
+ }>>;
48
+ }, z.core.$strict>, z.ZodObject<{
49
+ name: z.ZodString;
50
+ source: z.ZodLiteral<"inherit">;
51
+ from: z.ZodString;
52
+ secret: z.ZodBoolean;
53
+ optional: z.ZodBoolean;
54
+ default: z.ZodOptional<z.ZodString>;
55
+ mcp: z.ZodOptional<z.ZodString>;
56
+ applies: z.ZodDefault<z.ZodEnum<{
57
+ agent: "agent";
58
+ setup: "setup";
59
+ both: "both";
60
+ }>>;
61
+ }, z.core.$strict>, z.ZodObject<{
62
+ name: z.ZodString;
63
+ source: z.ZodLiteral<"secret">;
64
+ secretName: z.ZodString;
65
+ applies: z.ZodDefault<z.ZodEnum<{
66
+ agent: "agent";
67
+ setup: "setup";
68
+ both: "both";
69
+ }>>;
70
+ }, z.core.$strict>], "source">>>;
71
+ connectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
72
+ }, z.core.$strict>;
73
+ type EnvironmentVarsAndRuntime = {
74
+ runtime?: {
75
+ kind: string;
76
+ } | undefined;
77
+ vars?: readonly Pick<EnvVarSpec, "name" | "applies">[] | undefined;
78
+ };
79
+ /** A var that needs a container to set up, on an environment whose runtime is host. */
80
+ export declare const findHostSetupVar: ({ runtime, vars, }: EnvironmentVarsAndRuntime) => Pick<EnvVarSpec, "name" | "applies"> | undefined;
81
+ export declare const hostSetupVarMessage: (entry: Pick<EnvVarSpec, "name" | "applies">) => string;
82
+ /**
83
+ * A named environment's content as written (`PUT
84
+ * /projects/:projectId/environments/:name`, and what `defineEnvironment`
85
+ * compiles to): the inline environment fields plus `description`, with the
86
+ * checks that need the whole environment (no setup vars on host, every
87
+ * connector's required vars present).
88
+ */
89
+ export declare const environmentContentSchema: z.ZodObject<{
90
+ runtime: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
91
+ kind: z.ZodLiteral<"devcontainer">;
92
+ config: z.ZodOptional<z.ZodString>;
93
+ }, z.core.$strict>, z.ZodObject<{
94
+ kind: z.ZodLiteral<"managed">;
95
+ id: z.ZodEnum<{
96
+ bun1: "bun1";
97
+ node24: "node24";
98
+ }>;
99
+ }, z.core.$strict>, z.ZodObject<{
100
+ kind: z.ZodLiteral<"host">;
101
+ }, z.core.$strict>], "kind">>;
102
+ vars: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
103
+ name: z.ZodString;
104
+ source: z.ZodLiteral<"value">;
105
+ value: z.ZodString;
106
+ secret: z.ZodBoolean;
107
+ applies: z.ZodDefault<z.ZodEnum<{
108
+ agent: "agent";
109
+ setup: "setup";
110
+ both: "both";
111
+ }>>;
112
+ }, z.core.$strict>, z.ZodObject<{
113
+ name: z.ZodString;
114
+ source: z.ZodLiteral<"inherit">;
115
+ from: z.ZodString;
116
+ secret: z.ZodBoolean;
117
+ optional: z.ZodBoolean;
118
+ default: z.ZodOptional<z.ZodString>;
119
+ mcp: z.ZodOptional<z.ZodString>;
120
+ applies: z.ZodDefault<z.ZodEnum<{
121
+ agent: "agent";
122
+ setup: "setup";
123
+ both: "both";
124
+ }>>;
125
+ }, z.core.$strict>, z.ZodObject<{
126
+ name: z.ZodString;
127
+ source: z.ZodLiteral<"secret">;
128
+ secretName: z.ZodString;
129
+ applies: z.ZodDefault<z.ZodEnum<{
130
+ agent: "agent";
131
+ setup: "setup";
132
+ both: "both";
133
+ }>>;
134
+ }, z.core.$strict>], "source">>>;
135
+ connectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
136
+ description: z.ZodOptional<z.ZodString>;
137
+ }, z.core.$strict>;
138
+ export type EnvironmentContentInput = z.input<typeof environmentContentSchema>;
139
+ /** A named environment's content after parsing: every var carries `applies`. */
140
+ export type EnvironmentContentOutput = z.output<typeof environmentContentSchema>;
141
+ /** Inline refs contain compiled vars, so they retain input templates. */
142
+ export declare const environmentRefSchema: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
143
+ kind: z.ZodLiteral<"named">;
144
+ name: z.ZodString;
145
+ }, z.core.$strict>, z.ZodObject<{
146
+ kind: z.ZodLiteral<"inline">;
147
+ runtime: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
148
+ kind: z.ZodLiteral<"devcontainer">;
149
+ config: z.ZodOptional<z.ZodString>;
150
+ }, z.core.$strict>, z.ZodObject<{
151
+ kind: z.ZodLiteral<"managed">;
152
+ id: z.ZodEnum<{
153
+ bun1: "bun1";
154
+ node24: "node24";
155
+ }>;
156
+ }, z.core.$strict>, z.ZodObject<{
157
+ kind: z.ZodLiteral<"host">;
158
+ }, z.core.$strict>], "kind">>;
159
+ envJson: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
160
+ name: z.ZodString;
161
+ source: z.ZodLiteral<"value">;
162
+ value: z.ZodString;
163
+ secret: z.ZodBoolean;
164
+ applies: z.ZodDefault<z.ZodEnum<{
165
+ agent: "agent";
166
+ setup: "setup";
167
+ both: "both";
168
+ }>>;
169
+ }, z.core.$strict>, z.ZodObject<{
170
+ name: z.ZodString;
171
+ source: z.ZodLiteral<"inherit">;
172
+ from: z.ZodString;
173
+ secret: z.ZodBoolean;
174
+ optional: z.ZodBoolean;
175
+ default: z.ZodOptional<z.ZodString>;
176
+ mcp: z.ZodOptional<z.ZodString>;
177
+ applies: z.ZodDefault<z.ZodEnum<{
178
+ agent: "agent";
179
+ setup: "setup";
180
+ both: "both";
181
+ }>>;
182
+ }, z.core.$strict>, z.ZodObject<{
183
+ name: z.ZodString;
184
+ source: z.ZodLiteral<"secret">;
185
+ secretName: z.ZodString;
186
+ applies: z.ZodDefault<z.ZodEnum<{
187
+ agent: "agent";
188
+ setup: "setup";
189
+ both: "both";
190
+ }>>;
191
+ }, z.core.$strict>], "source">>>>;
192
+ connectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
193
+ }, z.core.$strict>], "kind">>;
194
+ export declare const environmentRefReadSchema: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
195
+ kind: z.ZodLiteral<"named">;
196
+ name: z.ZodString;
197
+ }, z.core.$strict>, z.ZodObject<{
198
+ kind: z.ZodLiteral<"inline">;
199
+ runtime: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
200
+ kind: z.ZodLiteral<"devcontainer">;
201
+ config: z.ZodOptional<z.ZodString>;
202
+ }, z.core.$strict>, z.ZodObject<{
203
+ kind: z.ZodLiteral<"managed">;
204
+ id: z.ZodEnum<{
205
+ bun1: "bun1";
206
+ node24: "node24";
207
+ }>;
208
+ }, z.core.$strict>, z.ZodObject<{
209
+ kind: z.ZodLiteral<"host">;
210
+ }, z.core.$strict>], "kind">>;
211
+ connectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
212
+ envJson: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
213
+ name: z.ZodString;
214
+ source: z.ZodLiteral<"value">;
215
+ value: z.ZodString;
216
+ secret: z.ZodBoolean;
217
+ applies: z.ZodDefault<z.ZodEnum<{
218
+ agent: "agent";
219
+ setup: "setup";
220
+ both: "both";
221
+ }>>;
222
+ }, z.core.$strip>, z.ZodObject<{
223
+ name: z.ZodString;
224
+ source: z.ZodLiteral<"inherit">;
225
+ from: z.ZodString;
226
+ secret: z.ZodBoolean;
227
+ optional: z.ZodBoolean;
228
+ default: z.ZodOptional<z.ZodString>;
229
+ mcp: z.ZodOptional<z.ZodString>;
230
+ applies: z.ZodDefault<z.ZodEnum<{
231
+ agent: "agent";
232
+ setup: "setup";
233
+ both: "both";
234
+ }>>;
235
+ }, z.core.$strip>, z.ZodObject<{
236
+ name: z.ZodString;
237
+ source: z.ZodLiteral<"secret">;
238
+ secretName: z.ZodString;
239
+ applies: z.ZodDefault<z.ZodEnum<{
240
+ agent: "agent";
241
+ setup: "setup";
242
+ both: "both";
243
+ }>>;
244
+ }, z.core.$strip>], "source">>>>;
245
+ }, z.core.$strict>], "kind">>;
246
+ /** An inline environment as read, or a named environment's content in the same shape. */
247
+ export declare const inlineEnvironmentReadSchema: z.ZodNullable<z.ZodObject<{
248
+ kind: z.ZodLiteral<"inline">;
249
+ runtime: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
250
+ kind: z.ZodLiteral<"devcontainer">;
251
+ config: z.ZodOptional<z.ZodString>;
252
+ }, z.core.$strict>, z.ZodObject<{
253
+ kind: z.ZodLiteral<"managed">;
254
+ id: z.ZodEnum<{
255
+ bun1: "bun1";
256
+ node24: "node24";
257
+ }>;
258
+ }, z.core.$strict>, z.ZodObject<{
259
+ kind: z.ZodLiteral<"host">;
260
+ }, z.core.$strict>], "kind">>;
261
+ connectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
262
+ envJson: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
263
+ name: z.ZodString;
264
+ source: z.ZodLiteral<"value">;
265
+ value: z.ZodString;
266
+ secret: z.ZodBoolean;
267
+ applies: z.ZodDefault<z.ZodEnum<{
268
+ agent: "agent";
269
+ setup: "setup";
270
+ both: "both";
271
+ }>>;
272
+ }, z.core.$strip>, z.ZodObject<{
273
+ name: z.ZodString;
274
+ source: z.ZodLiteral<"inherit">;
275
+ from: z.ZodString;
276
+ secret: z.ZodBoolean;
277
+ optional: z.ZodBoolean;
278
+ default: z.ZodOptional<z.ZodString>;
279
+ mcp: z.ZodOptional<z.ZodString>;
280
+ applies: z.ZodDefault<z.ZodEnum<{
281
+ agent: "agent";
282
+ setup: "setup";
283
+ both: "both";
284
+ }>>;
285
+ }, z.core.$strip>, z.ZodObject<{
286
+ name: z.ZodString;
287
+ source: z.ZodLiteral<"secret">;
288
+ secretName: z.ZodString;
289
+ applies: z.ZodDefault<z.ZodEnum<{
290
+ agent: "agent";
291
+ setup: "setup";
292
+ both: "both";
293
+ }>>;
294
+ }, z.core.$strip>], "source">>>>;
295
+ }, z.core.$strict>>;
296
+ /**
297
+ * Read-side counterpart of `environmentFieldsSchema`: structural only, so
298
+ * tightening a write rule never makes a stored row unreadable.
299
+ */
300
+ export declare const storedEnvironmentRuntimeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
301
+ kind: z.ZodLiteral<"devcontainer">;
302
+ config: z.ZodOptional<z.ZodString>;
303
+ }, z.core.$strip>, z.ZodObject<{
304
+ kind: z.ZodLiteral<"managed">;
305
+ id: z.ZodEnum<{
306
+ bun1: "bun1";
307
+ node24: "node24";
308
+ }>;
309
+ }, z.core.$strip>, z.ZodObject<{
310
+ kind: z.ZodLiteral<"host">;
311
+ }, z.core.$strip>], "kind">;
312
+ export declare const storedEnvironmentFieldsSchema: z.ZodObject<{
313
+ runtime: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
314
+ kind: z.ZodLiteral<"devcontainer">;
315
+ config: z.ZodOptional<z.ZodString>;
316
+ }, z.core.$strip>, z.ZodObject<{
317
+ kind: z.ZodLiteral<"managed">;
318
+ id: z.ZodEnum<{
319
+ bun1: "bun1";
320
+ node24: "node24";
321
+ }>;
322
+ }, z.core.$strip>, z.ZodObject<{
323
+ kind: z.ZodLiteral<"host">;
324
+ }, z.core.$strip>], "kind">>;
325
+ vars: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
326
+ name: z.ZodString;
327
+ source: z.ZodLiteral<"value">;
328
+ value: z.ZodString;
329
+ secret: z.ZodBoolean;
330
+ applies: z.ZodDefault<z.ZodEnum<{
331
+ agent: "agent";
332
+ setup: "setup";
333
+ both: "both";
334
+ }>>;
335
+ }, z.core.$strip>, z.ZodObject<{
336
+ name: z.ZodString;
337
+ source: z.ZodLiteral<"inherit">;
338
+ from: z.ZodString;
339
+ secret: z.ZodBoolean;
340
+ optional: z.ZodBoolean;
341
+ default: z.ZodOptional<z.ZodString>;
342
+ mcp: z.ZodOptional<z.ZodString>;
343
+ applies: z.ZodDefault<z.ZodEnum<{
344
+ agent: "agent";
345
+ setup: "setup";
346
+ both: "both";
347
+ }>>;
348
+ }, z.core.$strip>, z.ZodObject<{
349
+ name: z.ZodString;
350
+ source: z.ZodLiteral<"secret">;
351
+ secretName: z.ZodString;
352
+ applies: z.ZodDefault<z.ZodEnum<{
353
+ agent: "agent";
354
+ setup: "setup";
355
+ both: "both";
356
+ }>>;
357
+ }, z.core.$strip>], "source">>>;
358
+ connectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
359
+ }, z.core.$strip>;
360
+ /** Read-side shape of a named environment's content. */
361
+ export declare const storedEnvironmentContentSchema: z.ZodObject<{
362
+ runtime: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
363
+ kind: z.ZodLiteral<"devcontainer">;
364
+ config: z.ZodOptional<z.ZodString>;
365
+ }, z.core.$strip>, z.ZodObject<{
366
+ kind: z.ZodLiteral<"managed">;
367
+ id: z.ZodEnum<{
368
+ bun1: "bun1";
369
+ node24: "node24";
370
+ }>;
371
+ }, z.core.$strip>, z.ZodObject<{
372
+ kind: z.ZodLiteral<"host">;
373
+ }, z.core.$strip>], "kind">>;
374
+ vars: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
375
+ name: z.ZodString;
376
+ source: z.ZodLiteral<"value">;
377
+ value: z.ZodString;
378
+ secret: z.ZodBoolean;
379
+ applies: z.ZodDefault<z.ZodEnum<{
380
+ agent: "agent";
381
+ setup: "setup";
382
+ both: "both";
383
+ }>>;
384
+ }, z.core.$strip>, z.ZodObject<{
385
+ name: z.ZodString;
386
+ source: z.ZodLiteral<"inherit">;
387
+ from: z.ZodString;
388
+ secret: z.ZodBoolean;
389
+ optional: z.ZodBoolean;
390
+ default: z.ZodOptional<z.ZodString>;
391
+ mcp: z.ZodOptional<z.ZodString>;
392
+ applies: z.ZodDefault<z.ZodEnum<{
393
+ agent: "agent";
394
+ setup: "setup";
395
+ both: "both";
396
+ }>>;
397
+ }, z.core.$strip>, z.ZodObject<{
398
+ name: z.ZodString;
399
+ source: z.ZodLiteral<"secret">;
400
+ secretName: z.ZodString;
401
+ applies: z.ZodDefault<z.ZodEnum<{
402
+ agent: "agent";
403
+ setup: "setup";
404
+ both: "both";
405
+ }>>;
406
+ }, z.core.$strip>], "source">>>;
407
+ connectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
408
+ description: z.ZodOptional<z.ZodString>;
409
+ }, z.core.$strip>;
410
+ export type StoredEnvironmentContent = z.output<typeof storedEnvironmentContentSchema>;
411
+ /**
412
+ * A run's environment as the server hands it to the worker: an inline
413
+ * environment as stored, a named environment's pinned version with its
414
+ * content, a name the project no longer has (`notFound`), or null for the
415
+ * repository's default.
416
+ */
417
+ export declare const resolvedEnvironmentRefSchema: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
418
+ kind: z.ZodLiteral<"inline">;
419
+ runtime: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
420
+ kind: z.ZodLiteral<"devcontainer">;
421
+ config: z.ZodOptional<z.ZodString>;
422
+ }, z.core.$strict>, z.ZodObject<{
423
+ kind: z.ZodLiteral<"managed">;
424
+ id: z.ZodEnum<{
425
+ bun1: "bun1";
426
+ node24: "node24";
427
+ }>;
428
+ }, z.core.$strict>, z.ZodObject<{
429
+ kind: z.ZodLiteral<"host">;
430
+ }, z.core.$strict>], "kind">>;
431
+ envJson: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
432
+ name: z.ZodString;
433
+ source: z.ZodLiteral<"value">;
434
+ value: z.ZodString;
435
+ secret: z.ZodBoolean;
436
+ applies: z.ZodDefault<z.ZodEnum<{
437
+ agent: "agent";
438
+ setup: "setup";
439
+ both: "both";
440
+ }>>;
441
+ }, z.core.$strip>, z.ZodObject<{
442
+ name: z.ZodString;
443
+ source: z.ZodLiteral<"inherit">;
444
+ from: z.ZodString;
445
+ secret: z.ZodBoolean;
446
+ optional: z.ZodBoolean;
447
+ default: z.ZodOptional<z.ZodString>;
448
+ mcp: z.ZodOptional<z.ZodString>;
449
+ applies: z.ZodDefault<z.ZodEnum<{
450
+ agent: "agent";
451
+ setup: "setup";
452
+ both: "both";
453
+ }>>;
454
+ }, z.core.$strip>, z.ZodObject<{
455
+ name: z.ZodString;
456
+ source: z.ZodLiteral<"secret">;
457
+ secretName: z.ZodString;
458
+ applies: z.ZodDefault<z.ZodEnum<{
459
+ agent: "agent";
460
+ setup: "setup";
461
+ both: "both";
462
+ }>>;
463
+ }, z.core.$strip>], "source">>>>;
464
+ connectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
465
+ }, z.core.$strict>, z.ZodObject<{
466
+ kind: z.ZodLiteral<"named">;
467
+ name: z.ZodString;
468
+ version: z.ZodNumber;
469
+ content: z.ZodObject<{
470
+ runtime: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
471
+ kind: z.ZodLiteral<"devcontainer">;
472
+ config: z.ZodOptional<z.ZodString>;
473
+ }, z.core.$strip>, z.ZodObject<{
474
+ kind: z.ZodLiteral<"managed">;
475
+ id: z.ZodEnum<{
476
+ bun1: "bun1";
477
+ node24: "node24";
478
+ }>;
479
+ }, z.core.$strip>, z.ZodObject<{
480
+ kind: z.ZodLiteral<"host">;
481
+ }, z.core.$strip>], "kind">>;
482
+ vars: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
483
+ name: z.ZodString;
484
+ source: z.ZodLiteral<"value">;
485
+ value: z.ZodString;
486
+ secret: z.ZodBoolean;
487
+ applies: z.ZodDefault<z.ZodEnum<{
488
+ agent: "agent";
489
+ setup: "setup";
490
+ both: "both";
491
+ }>>;
492
+ }, z.core.$strip>, z.ZodObject<{
493
+ name: z.ZodString;
494
+ source: z.ZodLiteral<"inherit">;
495
+ from: z.ZodString;
496
+ secret: z.ZodBoolean;
497
+ optional: z.ZodBoolean;
498
+ default: z.ZodOptional<z.ZodString>;
499
+ mcp: z.ZodOptional<z.ZodString>;
500
+ applies: z.ZodDefault<z.ZodEnum<{
501
+ agent: "agent";
502
+ setup: "setup";
503
+ both: "both";
504
+ }>>;
505
+ }, z.core.$strip>, z.ZodObject<{
506
+ name: z.ZodString;
507
+ source: z.ZodLiteral<"secret">;
508
+ secretName: z.ZodString;
509
+ applies: z.ZodDefault<z.ZodEnum<{
510
+ agent: "agent";
511
+ setup: "setup";
512
+ both: "both";
513
+ }>>;
514
+ }, z.core.$strip>], "source">>>;
515
+ connectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
516
+ description: z.ZodOptional<z.ZodString>;
517
+ }, z.core.$strip>;
518
+ }, z.core.$strict>, z.ZodObject<{
519
+ kind: z.ZodLiteral<"named">;
520
+ name: z.ZodString;
521
+ notFound: z.ZodLiteral<true>;
522
+ }, z.core.$strict>]>>;
523
+ export type ResolvedEnvironmentRef = z.output<typeof resolvedEnvironmentRefSchema>;
524
+ export type ResolvedEnvironmentRefInput = z.input<typeof resolvedEnvironmentRefSchema>;
525
+ export type EnvironmentRefRead = z.input<typeof environmentRefReadSchema>;
526
+ export type EnvironmentRef = z.input<typeof environmentRefSchema>;
527
+ export type ResolvedEnvironment = {
528
+ source: "named" | "inline" | "repo-default";
529
+ name?: string;
530
+ runtime: {
531
+ kind: "devcontainer";
532
+ config: string;
533
+ } | {
534
+ kind: "managed";
535
+ id: z.infer<typeof managedRuntimeIdSchema>;
536
+ } | {
537
+ kind: "host";
538
+ };
539
+ envVars: EnvVarSpec[];
540
+ /** Catalog connector ids the environment turns on. */
541
+ connectors: string[];
542
+ };
543
+ export declare class EnvironmentNotFound extends Error {
544
+ readonly environmentName: string;
545
+ readonly kind = "EnvironmentNotFound";
546
+ readonly code = "SCARN_ENVIRONMENT_NOT_FOUND";
547
+ constructor(environmentName: string);
548
+ }
549
+ export declare class EnvironmentInvalid extends Error {
550
+ readonly environment: string | undefined;
551
+ readonly issues: z.ZodError["issues"];
552
+ readonly kind = "EnvironmentInvalid";
553
+ readonly code = "SCARN_ENVIRONMENT_INVALID";
554
+ /** `environment` is `environment <name> v<N>` for a named environment. */
555
+ constructor(environment: string | undefined, issues: z.ZodError["issues"]);
556
+ }
557
+ export declare class BrokenDevcontainerReference extends Error {
558
+ readonly configPath: string;
559
+ readonly kind = "BrokenDevcontainerReference";
560
+ readonly code = "SCARN_DEVCONTAINER_REFERENCE_BROKEN";
561
+ constructor(configPath: string, discoveryPaths?: readonly string[]);
562
+ }
563
+ export type EnvironmentError = EnvironmentNotFound | EnvironmentInvalid | BrokenDevcontainerReference | ConnectorVarsMissing;
564
+ export {};
@@ -0,0 +1,46 @@
1
+ // @bun
2
+ import {
3
+ BrokenDevcontainerReference,
4
+ EnvironmentInvalid,
5
+ EnvironmentNotFound,
6
+ environmentContentSchema,
7
+ environmentFieldsSchema,
8
+ environmentNameSchema,
9
+ environmentRefReadSchema,
10
+ environmentRefSchema,
11
+ environmentRuntimeSchema,
12
+ findHostSetupVar,
13
+ hostSetupVarMessage,
14
+ inlineEnvironmentReadSchema,
15
+ rejectEnvironmentBranch,
16
+ resolvedEnvironmentRefSchema,
17
+ storedEnvironmentContentSchema,
18
+ storedEnvironmentFieldsSchema,
19
+ storedEnvironmentRuntimeSchema
20
+ } from "./chunk-e0pt5x0e.js";
21
+ import"./chunk-098740f7.js";
22
+ import"./chunk-46wmsgv7.js";
23
+ import"./chunk-qgkx89eg.js";
24
+ import"./chunk-pqtd0hr7.js";
25
+ import"./chunk-aemxz9r7.js";
26
+ import"./chunk-yf15kdte.js";
27
+ import"./chunk-y64skrwp.js";
28
+ export {
29
+ BrokenDevcontainerReference,
30
+ EnvironmentInvalid,
31
+ EnvironmentNotFound,
32
+ environmentContentSchema,
33
+ environmentFieldsSchema,
34
+ environmentNameSchema,
35
+ environmentRefReadSchema,
36
+ environmentRefSchema,
37
+ environmentRuntimeSchema,
38
+ findHostSetupVar,
39
+ hostSetupVarMessage,
40
+ inlineEnvironmentReadSchema,
41
+ rejectEnvironmentBranch,
42
+ resolvedEnvironmentRefSchema,
43
+ storedEnvironmentContentSchema,
44
+ storedEnvironmentFieldsSchema,
45
+ storedEnvironmentRuntimeSchema
46
+ };