@scarn/sdk 0.8.20 → 0.8.22

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 (102) hide show
  1. package/dist/auth/api-token-cache.d.ts +24 -0
  2. package/dist/auth/api-token-source.d.ts +39 -0
  3. package/dist/auth/authenticated-fetch.d.ts +10 -0
  4. package/dist/auth/index.d.ts +3 -0
  5. package/dist/auth/index.js +19 -0
  6. package/dist/automations/index.js +14 -17
  7. package/dist/{chunk-habmdf89.js → chunk-0bwsjn0b.js} +29 -29
  8. package/dist/{chunk-mzj1j0p5.js → chunk-0w13kxkr.js} +34 -31
  9. package/dist/{chunk-qgkx89eg.js → chunk-3j5wf2t5.js} +44 -43
  10. package/dist/{chunk-0y2fy5en.js → chunk-4361gxk0.js} +7 -7
  11. package/dist/{chunk-n3ywwx7n.js → chunk-52520csz.js} +15 -14
  12. package/dist/chunk-5dnfgyx8.js +159 -0
  13. package/dist/{chunk-tr3v83cn.js → chunk-5fa4arn1.js} +18 -11
  14. package/dist/{chunk-ngy1fdcx.js → chunk-631ffb6r.js} +10 -10
  15. package/dist/{chunk-01nfqm18.js → chunk-7anj08zc.js} +11 -9
  16. package/dist/{chunk-yq0sf8sb.js → chunk-7dr4kybf.js} +483 -451
  17. package/dist/chunk-7mhr5aex.js +171 -0
  18. package/dist/chunk-7rywbqzz.js +27 -0
  19. package/dist/{chunk-yf15kdte.js → chunk-9ct3xypr.js} +2636 -3864
  20. package/dist/chunk-9geh4c3v.js +1034 -0
  21. package/dist/{chunk-19brnwkp.js → chunk-9qf0eg7m.js} +19 -19
  22. package/dist/{chunk-y11p1q7r.js → chunk-aqqywy8g.js} +4 -4
  23. package/dist/chunk-bcvx11fn.js +174 -0
  24. package/dist/{chunk-z4smq8qd.js → chunk-cyfeaz43.js} +86 -86
  25. package/dist/chunk-czq37rrt.js +286 -0
  26. package/dist/chunk-ec5z8bbq.js +126 -0
  27. package/dist/{chunk-rt9tq4j6.js → chunk-h9yxx0hd.js} +7 -7
  28. package/dist/{chunk-t1dq2c2s.js → chunk-hma87efq.js} +40 -40
  29. package/dist/{chunk-5dny5jg1.js → chunk-hpv234hf.js} +11 -11
  30. package/dist/{chunk-rq5k7m33.js → chunk-k7xnsmp5.js} +182 -97
  31. package/dist/{chunk-91f5gm5z.js → chunk-kbpkpxcn.js} +22 -21
  32. package/dist/{chunk-6tra3gw8.js → chunk-kjn1knb9.js} +7 -7
  33. package/dist/{chunk-g4j5cfpc.js → chunk-p3s7cjfc.js} +17 -16
  34. package/dist/chunk-pq6hrtnb.js +49 -0
  35. package/dist/{chunk-mp2rqtcj.js → chunk-ptpy7nnm.js} +8 -8
  36. package/dist/{chunk-xqfj56m9.js → chunk-vn1rfxma.js} +8 -8
  37. package/dist/chunk-vyv8kvkv.js +113 -0
  38. package/dist/{chunk-0c60x3v8.js → chunk-xe2zgyz7.js} +35 -35
  39. package/dist/chunk-y4dwmhn2.js +14 -0
  40. package/dist/{chunk-098740f7.js → chunk-yypj3zn0.js} +8 -8
  41. package/dist/chunk-yzj1mfpr.js +1515 -0
  42. package/dist/client.d.ts +5 -1
  43. package/dist/client.js +62 -61
  44. package/dist/connectors/index.js +36 -37
  45. package/dist/contracts/artifact-markers.js +11 -12
  46. package/dist/contracts/artifacts.js +21 -23
  47. package/dist/contracts/automation-document/index.js +28 -30
  48. package/dist/contracts/pipeline-document/built-ins.d.ts +1 -1
  49. package/dist/contracts/pipeline-document/index.js +95 -97
  50. package/dist/contracts/step-artifact-submissions.js +20 -17
  51. package/dist/contracts/work-item-changes.js +8 -6
  52. package/dist/create-api-client.d.ts +11 -0
  53. package/dist/defaults/index.js +44 -884
  54. package/dist/defaults/load-push-defaults.d.ts +11 -4
  55. package/dist/defaults/project-ref.d.ts +2 -4
  56. package/dist/definitions/automations/automations-client.d.ts +2 -1
  57. package/dist/definitions/automations/index.js +6 -8
  58. package/dist/definitions/environments/environments-client.d.ts +2 -1
  59. package/dist/definitions/environments/index.js +37 -38
  60. package/dist/definitions/pipelines/index.js +12 -14
  61. package/dist/definitions/pipelines/pipeline-definitions-client.d.ts +2 -1
  62. package/dist/definitions/steps/define-mcp.d.ts +2 -2
  63. package/dist/definitions/steps/index.js +93 -95
  64. package/dist/definitions/steps/mcp-server-config.d.ts +13 -3
  65. package/dist/definitions/steps/step-definitions-client.d.ts +20 -1
  66. package/dist/definitions/validation/index.js +17 -18
  67. package/dist/devcontainer-config-path.js +9 -11
  68. package/dist/env-vars.js +37 -39
  69. package/dist/environment.js +41 -42
  70. package/dist/eslint.js +0 -2
  71. package/dist/generated/index.d.ts +2 -2
  72. package/dist/generated/sdk.gen.d.ts +41 -1
  73. package/dist/generated/types.gen.d.ts +1801 -0
  74. package/dist/git-url/git-repo-identity.js +0 -2
  75. package/dist/health-checks.js +15 -17
  76. package/dist/index.js +364 -358
  77. package/dist/jsonc.js +7 -8
  78. package/dist/managed-connections.d.ts +16 -0
  79. package/dist/managed-connections.js +9 -0
  80. package/dist/managed-runtimes.js +9 -11
  81. package/dist/opencode-mcp.d.ts +55 -1
  82. package/dist/opencode-mcp.js +33 -28
  83. package/dist/pipelines/index.js +78 -81
  84. package/dist/push/code-step-lookup.js +9 -10
  85. package/dist/push/index.d.ts +1 -0
  86. package/dist/push/index.js +109 -79
  87. package/dist/push/push-from-directory.d.ts +9 -1
  88. package/dist/push/pushed-mcp-servers.d.ts +28 -0
  89. package/dist/repo-config.js +41 -43
  90. package/dist/resolve-environment.js +14 -15
  91. package/dist/scarn-config-parser.js +5 -6
  92. package/dist/task-plane-client.d.ts +143 -1
  93. package/package.json +11 -3
  94. package/dist/chunk-46wmsgv7.js +0 -14
  95. package/dist/chunk-a56zc4s5.js +0 -119
  96. package/dist/chunk-aemxz9r7.js +0 -107
  97. package/dist/chunk-b9ja6ss5.js +0 -275
  98. package/dist/chunk-e0pt5x0e.js +0 -167
  99. package/dist/chunk-pqtd0hr7.js +0 -96
  100. package/dist/chunk-rphfy0fj.js +0 -167
  101. package/dist/chunk-y34zsgsw.js +0 -39
  102. package/dist/chunk-y64skrwp.js +0 -17
@@ -1,21 +1,22 @@
1
1
  // @bun
2
2
  import {
3
- PipelineDefinitions,
4
- createClient
5
- } from "./chunk-rq5k7m33.js";
3
+ PipelineDefinitions2,
4
+ createApiClient
5
+ } from "./chunk-k7xnsmp5.js";
6
6
  import {
7
- exports_external
8
- } from "./chunk-yf15kdte.js";
7
+ string,
8
+ object
9
+ } from "./chunk-9ct3xypr.js";
9
10
 
10
11
  // src/definitions/pipelines/pipeline-definitions-client.ts
11
- var pipelineDocumentIssueSchema = exports_external.object({
12
- code: exports_external.string(),
13
- path: exports_external.string(),
14
- message: exports_external.string(),
15
- hint: exports_external.string().optional()
12
+ var pipelineDocumentIssueSchema = object({
13
+ code: string(),
14
+ path: string(),
15
+ message: string(),
16
+ hint: string().optional()
16
17
  });
17
18
 
18
- class PipelineDefinitionsApiError extends Error {
19
+ class PipelineDefinitionsApiError2 extends Error {
19
20
  code;
20
21
  issues;
21
22
  constructor(error) {
@@ -36,13 +37,13 @@ function documentIssuesOf(meta) {
36
37
  }
37
38
  function unwrap(result) {
38
39
  if (result.error !== undefined) {
39
- throw new PipelineDefinitionsApiError(result.error);
40
+ throw new PipelineDefinitionsApiError2(result.error);
40
41
  }
41
42
  return result.data;
42
43
  }
43
- function createPipelineDefinitionsClient(baseUrl) {
44
- const client = createClient({ baseUrl });
45
- return buildPipelineDefinitionsClient(new PipelineDefinitions({ client }));
44
+ function createPipelineDefinitionsClient2(baseUrl, options) {
45
+ const client = createApiClient(baseUrl, { fetch: options?.fetch });
46
+ return buildPipelineDefinitionsClient(new PipelineDefinitions2({ client }));
46
47
  }
47
48
  var buildPipelineDefinitionsClient = (pipelineDefinitions) => ({
48
49
  listByProjectId: async (projectId, options) => unwrap(await pipelineDefinitions.listPipelineDefinitions({
@@ -76,7 +77,7 @@ var buildPipelineDefinitionsClient = (pipelineDefinitions) => ({
76
77
  }))
77
78
  });
78
79
  // src/definitions/pipelines/work-item-fields.ts
79
- var WORK_ITEM_TOP_LEVEL_FIELDS = [
80
+ var WORK_ITEM_TOP_LEVEL_FIELDS2 = [
80
81
  "id",
81
82
  "projectId",
82
83
  "platform",
@@ -92,13 +93,13 @@ var WORK_ITEM_TOP_LEVEL_FIELDS = [
92
93
  "createdAt",
93
94
  "updatedAt"
94
95
  ];
95
- var WORK_ITEM_FIELDS_PATH_PREFIX = "fields.";
96
- function resolveWorkItemFieldPath(record, path) {
96
+ var WORK_ITEM_FIELDS_PATH_PREFIX2 = "fields.";
97
+ function resolveWorkItemFieldPath2(record, path) {
97
98
  if (typeof record !== "object" || record === null)
98
99
  return;
99
100
  const asRecord = record;
100
- if (path.startsWith(WORK_ITEM_FIELDS_PATH_PREFIX)) {
101
- const fieldName = path.slice(WORK_ITEM_FIELDS_PATH_PREFIX.length);
101
+ if (path.startsWith(WORK_ITEM_FIELDS_PATH_PREFIX2)) {
102
+ const fieldName = path.slice(WORK_ITEM_FIELDS_PATH_PREFIX2.length);
102
103
  const fields = asRecord["fields"];
103
104
  if (typeof fields !== "object" || fields === null)
104
105
  return;
@@ -106,4 +107,4 @@ function resolveWorkItemFieldPath(record, path) {
106
107
  }
107
108
  return asRecord[path];
108
109
  }
109
- export { PipelineDefinitionsApiError, createPipelineDefinitionsClient, WORK_ITEM_TOP_LEVEL_FIELDS, WORK_ITEM_FIELDS_PATH_PREFIX, resolveWorkItemFieldPath };
110
+ export { PipelineDefinitionsApiError2, createPipelineDefinitionsClient2, WORK_ITEM_TOP_LEVEL_FIELDS2, WORK_ITEM_FIELDS_PATH_PREFIX2, resolveWorkItemFieldPath2 };
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  // src/push/code-step-lookup.ts
3
- function isStepDefinitionSpec(value) {
3
+ function isStepDefinitionSpec2(value) {
4
4
  if (typeof value !== "object" && typeof value !== "function")
5
5
  return false;
6
6
  if (value === null)
@@ -8,24 +8,24 @@ function isStepDefinitionSpec(value) {
8
8
  const obj = value;
9
9
  return typeof obj["key"] === "string" && typeof obj["name"] === "string" && typeof obj["version"] === "number" && (obj["kind"] === "user_defined" || obj["kind"] === "code");
10
10
  }
11
- function isEnvironmentHandle(value) {
11
+ function isEnvironmentHandle2(value) {
12
12
  if (typeof value !== "object" || value === null)
13
13
  return false;
14
14
  const obj = value;
15
15
  return obj["kind"] === "environment" && typeof obj["name"] === "string" && typeof obj["content"] === "object" && obj["content"] !== null;
16
16
  }
17
- function stepsInModule(mod) {
17
+ function stepsInModule2(mod) {
18
18
  const found = new Set;
19
19
  for (const [exportName, value] of Object.entries(mod)) {
20
- if (exportName !== "default" && isStepDefinitionSpec(value)) {
20
+ if (exportName !== "default" && isStepDefinitionSpec2(value)) {
21
21
  found.add(value);
22
22
  }
23
23
  }
24
24
  return [...found];
25
25
  }
26
- function findCodeStepInModule(mod, key) {
26
+ function findCodeStepInModule2(mod, key) {
27
27
  const fns = new Set;
28
- for (const spec of stepsInModule(mod)) {
28
+ for (const spec of stepsInModule2(mod)) {
29
29
  if (spec.kind !== "code" || spec.key !== key)
30
30
  continue;
31
31
  const fn = spec.entrypoint?.fn;
@@ -38,4 +38,4 @@ function findCodeStepInModule(mod, key) {
38
38
  return fns.values().next().value;
39
39
  }
40
40
 
41
- export { isStepDefinitionSpec, isEnvironmentHandle, stepsInModule, findCodeStepInModule };
41
+ export { isStepDefinitionSpec2, isEnvironmentHandle2, stepsInModule2, findCodeStepInModule2 };
@@ -1,21 +1,22 @@
1
1
  // @bun
2
2
  import {
3
- Automations,
4
- createClient
5
- } from "./chunk-rq5k7m33.js";
3
+ Automations2,
4
+ createApiClient
5
+ } from "./chunk-k7xnsmp5.js";
6
6
  import {
7
- exports_external
8
- } from "./chunk-yf15kdte.js";
7
+ string,
8
+ object
9
+ } from "./chunk-9ct3xypr.js";
9
10
 
10
11
  // src/definitions/automations/automations-client.ts
11
- var automationDocumentIssueSchema = exports_external.object({
12
- code: exports_external.string(),
13
- path: exports_external.string(),
14
- message: exports_external.string(),
15
- hint: exports_external.string().optional()
12
+ var automationDocumentIssueSchema = object({
13
+ code: string(),
14
+ path: string(),
15
+ message: string(),
16
+ hint: string().optional()
16
17
  });
17
18
 
18
- class AutomationsApiError extends Error {
19
+ class AutomationsApiError2 extends Error {
19
20
  code;
20
21
  issues;
21
22
  constructor(error) {
@@ -31,13 +32,13 @@ class AutomationsApiError extends Error {
31
32
  }
32
33
  function unwrap(result) {
33
34
  if (result.error !== undefined) {
34
- throw new AutomationsApiError(result.error);
35
+ throw new AutomationsApiError2(result.error);
35
36
  }
36
37
  return result.data;
37
38
  }
38
- function createAutomationsClient(baseUrl) {
39
- const client = createClient({ baseUrl });
40
- return buildAutomationsClient(new Automations({ client }));
39
+ function createAutomationsClient2(baseUrl, options) {
40
+ const client = createApiClient(baseUrl, { fetch: options?.fetch });
41
+ return buildAutomationsClient(new Automations2({ client }));
41
42
  }
42
43
  var buildAutomationsClient = (automations) => ({
43
44
  listByProjectId: async (projectId, options) => unwrap(await automations.listAutomations({
@@ -70,4 +71,4 @@ var buildAutomationsClient = (automations) => ({
70
71
  headers: options?.headers
71
72
  }))
72
73
  });
73
- export { AutomationsApiError, createAutomationsClient };
74
+ export { AutomationsApiError2, createAutomationsClient2 };
@@ -0,0 +1,49 @@
1
+ // @bun
2
+ import {
3
+ string,
4
+ number,
5
+ int,
6
+ unknown,
7
+ array,
8
+ object,
9
+ discriminatedUnion,
10
+ record,
11
+ _enum,
12
+ literal,
13
+ preprocess
14
+ } from "./chunk-9ct3xypr.js";
15
+
16
+ // src/health-checks.ts
17
+ var healthCheckSeverityValues2 = ["required", "warn"];
18
+ var healthCheckBaseSchema = object({
19
+ name: string().trim().min(1).optional(),
20
+ severity: _enum(healthCheckSeverityValues2).default("required"),
21
+ timeoutSeconds: number().gt(0).max(3600).default(15),
22
+ serialGroup: string().trim().min(1).optional()
23
+ });
24
+ var toolHealthCheckSchema2 = healthCheckBaseSchema.extend({
25
+ kind: literal("tool").default("tool"),
26
+ tool: string().trim().min(1),
27
+ mcp: string().trim().min(1).optional(),
28
+ args: record(string(), unknown()).optional()
29
+ }).strict();
30
+ var cliHealthCheckSchema2 = healthCheckBaseSchema.extend({
31
+ kind: literal("cli"),
32
+ command: array(string().min(1)).min(1),
33
+ expectExitCode: int().default(0)
34
+ }).strict();
35
+ function injectDefaultKind(value) {
36
+ if (typeof value === "object" && value !== null && !("kind" in value)) {
37
+ return { ...value, kind: "tool" };
38
+ }
39
+ return value;
40
+ }
41
+ var healthCheckSchema2 = preprocess(injectDefaultKind, discriminatedUnion("kind", [toolHealthCheckSchema2, cliHealthCheckSchema2]));
42
+ var healthChecksSchema2 = array(healthCheckSchema2);
43
+ var stepToolHealthCheckSchema2 = toolHealthCheckSchema2.omit({ mcp: true }).strict();
44
+ var stepHealthChecksInputSchema2 = array(preprocess(injectDefaultKind, discriminatedUnion("kind", [
45
+ stepToolHealthCheckSchema2,
46
+ cliHealthCheckSchema2
47
+ ])));
48
+
49
+ export { healthCheckSeverityValues2, toolHealthCheckSchema2, cliHealthCheckSchema2, healthCheckSchema2, healthChecksSchema2, stepToolHealthCheckSchema2, stepHealthChecksInputSchema2 };
@@ -1,11 +1,11 @@
1
1
  // @bun
2
2
  import {
3
- jsonPointer
4
- } from "./chunk-5dny5jg1.js";
3
+ captureSite,
4
+ AuthoringError
5
+ } from "./chunk-aqqywy8g.js";
5
6
  import {
6
- AuthoringError,
7
- captureSite
8
- } from "./chunk-y11p1q7r.js";
7
+ jsonPointer2
8
+ } from "./chunk-hpv234hf.js";
9
9
 
10
10
  // src/pipelines/refs.ts
11
11
  var REF = Symbol("scarn.ref");
@@ -370,17 +370,17 @@ function newState() {
370
370
  };
371
371
  }
372
372
  function issue(state, site, pointer, message) {
373
- state.issues.push({ site, pointer: jsonPointer(pointer), message });
373
+ state.issues.push({ site, pointer: jsonPointer2(pointer), message });
374
374
  }
375
375
  function mapSource(state, pointer, site) {
376
- const key = jsonPointer(pointer);
376
+ const key = jsonPointer2(pointer);
377
377
  if (site !== null && state.sourceMap[key] === undefined) {
378
378
  state.sourceMap[key] = site;
379
379
  }
380
380
  }
381
381
  function attempt(state, pointer, site, run) {
382
382
  const previous = state.tracker.pointer;
383
- setTrackerPointer(jsonPointer(pointer));
383
+ setTrackerPointer(jsonPointer2(pointer));
384
384
  try {
385
385
  return run();
386
386
  } catch (error) {
@@ -1,16 +1,16 @@
1
1
  // @bun
2
2
  import {
3
- AuthoringError,
4
3
  captureSite,
5
- chainOf,
6
- eachOf,
7
- nodeOf,
8
- registerChain,
4
+ AuthoringError,
5
+ stepOn,
9
6
  registerNode,
10
7
  registerTarget,
11
- stepOn,
12
- targetOf
13
- } from "./chunk-y11p1q7r.js";
8
+ registerChain,
9
+ nodeOf,
10
+ targetOf,
11
+ eachOf,
12
+ chainOf
13
+ } from "./chunk-aqqywy8g.js";
14
14
 
15
15
  // src/pipelines/model.ts
16
16
  function emptyChain(node) {
@@ -0,0 +1,113 @@
1
+ // @bun
2
+ import {
3
+ string,
4
+ boolean,
5
+ array,
6
+ object,
7
+ discriminatedUnion,
8
+ _enum,
9
+ literal
10
+ } from "./chunk-9ct3xypr.js";
11
+
12
+ // src/env-vars.ts
13
+ var ENV_VAR_NAME_PATTERN2 = /^[A-Z_][A-Z0-9_]*$/;
14
+ var RESERVED_ENV_VAR_NAMES2 = [
15
+ "HOME",
16
+ "XDG_CONFIG_HOME",
17
+ "XDG_DATA_HOME",
18
+ "OPENCODE_CONFIG_CONTENT",
19
+ "npm_config_cache"
20
+ ];
21
+ var RESERVED_ENV_VAR_PREFIX2 = "SCARN_";
22
+ var MAX_ENV_VARS2 = 64;
23
+ var MAX_ENV_VAR_NAME_LENGTH2 = 128;
24
+ var MAX_ENV_VAR_VALUE_LENGTH2 = 4096;
25
+ var INPUT_TOKEN_PATTERN = /\{\{input\.[^}]+\}\}/;
26
+ function containsInputToken2(value) {
27
+ return INPUT_TOKEN_PATTERN.test(value);
28
+ }
29
+ function isReservedEnvVarName2(name) {
30
+ return name.startsWith(RESERVED_ENV_VAR_PREFIX2) || RESERVED_ENV_VAR_NAMES2.includes(name);
31
+ }
32
+ var envVarNameSchema = string().max(MAX_ENV_VAR_NAME_LENGTH2).regex(ENV_VAR_NAME_PATTERN2, "must match /^[A-Z_][A-Z0-9_]*$/").refine((name) => !isReservedEnvVarName2(name), {
33
+ message: `is reserved (SCARN_*, ${RESERVED_ENV_VAR_NAMES2.join(", ")})`
34
+ });
35
+ var envVarValueSchema = string().max(MAX_ENV_VAR_VALUE_LENGTH2);
36
+ var envVarAppliesValues2 = ["agent", "setup", "both"];
37
+ var envVarAppliesSchema = _enum(envVarAppliesValues2).default("agent");
38
+ function appliesToAgent2(applies) {
39
+ return applies !== "setup";
40
+ }
41
+ function appliesToSetup2(applies) {
42
+ return applies === "setup" || applies === "both";
43
+ }
44
+ function isUninheritableWorkerEnvVarName2(name) {
45
+ return name.toUpperCase().startsWith(RESERVED_ENV_VAR_PREFIX2);
46
+ }
47
+ var valueEnvVarSchema = object({
48
+ name: envVarNameSchema,
49
+ source: literal("value"),
50
+ value: envVarValueSchema,
51
+ secret: boolean(),
52
+ applies: envVarAppliesSchema
53
+ }).strict().refine((entry) => !entry.secret || containsInputToken2(entry.value), {
54
+ path: ["value"],
55
+ message: "a secret value must contain an {{input.\u2026}} token; a static secret would be stored in plaintext. Use Env.inherit({ secret: true }) instead"
56
+ });
57
+ var inheritEnvVarSchema2 = object({
58
+ name: envVarNameSchema,
59
+ source: literal("inherit"),
60
+ from: string().max(MAX_ENV_VAR_NAME_LENGTH2).regex(/^[A-Za-z_][A-Za-z0-9_]*$/, "must be a valid environment variable name").refine((from) => !isUninheritableWorkerEnvVarName2(from), {
61
+ message: `cannot read worker variables starting with ${RESERVED_ENV_VAR_PREFIX2}`
62
+ }),
63
+ secret: boolean(),
64
+ optional: boolean(),
65
+ default: envVarValueSchema.optional(),
66
+ mcp: string().min(1).optional(),
67
+ applies: envVarAppliesSchema
68
+ }).strict().refine((entry) => !(entry.secret && entry.default !== undefined), {
69
+ path: ["default"],
70
+ message: "a secret cannot carry a default; it would be stored in plaintext"
71
+ });
72
+ var secretEnvVarSchema2 = object({
73
+ name: envVarNameSchema,
74
+ source: literal("secret"),
75
+ secretName: envVarNameSchema,
76
+ applies: envVarAppliesSchema
77
+ }).strict();
78
+ var envVarSpecSchema2 = discriminatedUnion("source", [
79
+ valueEnvVarSchema,
80
+ inheritEnvVarSchema2,
81
+ secretEnvVarSchema2
82
+ ]);
83
+ function isMaskedEnvVar2(entry) {
84
+ return entry.source === "secret" || entry.secret;
85
+ }
86
+ var envVarsSchema2 = array(envVarSpecSchema2).max(MAX_ENV_VARS2).refine((entries) => new Set(entries.map((entry) => entry.name)).size === entries.length, { message: "environment variable names must be unique" });
87
+ var storedEnvVarsSchema2 = array(discriminatedUnion("source", [
88
+ object({
89
+ name: string(),
90
+ source: literal("value"),
91
+ value: string(),
92
+ secret: boolean(),
93
+ applies: _enum(envVarAppliesValues2).default("agent")
94
+ }),
95
+ object({
96
+ name: string(),
97
+ source: literal("inherit"),
98
+ from: string(),
99
+ secret: boolean(),
100
+ optional: boolean(),
101
+ default: string().optional(),
102
+ mcp: string().optional(),
103
+ applies: _enum(envVarAppliesValues2).default("agent")
104
+ }),
105
+ object({
106
+ name: string(),
107
+ source: literal("secret"),
108
+ secretName: string(),
109
+ applies: _enum(envVarAppliesValues2).default("agent")
110
+ })
111
+ ]));
112
+
113
+ export { ENV_VAR_NAME_PATTERN2, RESERVED_ENV_VAR_NAMES2, RESERVED_ENV_VAR_PREFIX2, MAX_ENV_VARS2, MAX_ENV_VAR_NAME_LENGTH2, MAX_ENV_VAR_VALUE_LENGTH2, containsInputToken2, isReservedEnvVarName2, envVarAppliesValues2, appliesToAgent2, appliesToSetup2, isUninheritableWorkerEnvVarName2, inheritEnvVarSchema2, secretEnvVarSchema2, envVarSpecSchema2, isMaskedEnvVar2, envVarsSchema2, storedEnvVarsSchema2 };
@@ -1,31 +1,31 @@
1
1
  // @bun
2
2
  import {
3
- repoConfigInputSchema
4
- } from "./chunk-rphfy0fj.js";
3
+ artifactPlatforms2,
4
+ EMBEDDABLE_ARTIFACT_EXTENSIONS2,
5
+ findArtifactFields2
6
+ } from "./chunk-9qf0eg7m.js";
5
7
  import {
6
- environmentNameSchema,
7
- environmentRuntimeSchema
8
- } from "./chunk-e0pt5x0e.js";
8
+ findArtifactMarkers2
9
+ } from "./chunk-631ffb6r.js";
9
10
  import {
10
- devcontainerConfigPathSchema
11
- } from "./chunk-098740f7.js";
11
+ envVarsSchema2
12
+ } from "./chunk-vyv8kvkv.js";
12
13
  import {
13
- envVarsSchema
14
- } from "./chunk-aemxz9r7.js";
14
+ repoConfigInputSchema2
15
+ } from "./chunk-7mhr5aex.js";
15
16
  import {
16
- findArtifactMarkers
17
- } from "./chunk-ngy1fdcx.js";
17
+ devcontainerConfigPathSchema2
18
+ } from "./chunk-yypj3zn0.js";
18
19
  import {
19
- EMBEDDABLE_ARTIFACT_EXTENSIONS,
20
- artifactPlatforms,
21
- findArtifactFields
22
- } from "./chunk-19brnwkp.js";
20
+ environmentNameSchema2,
21
+ environmentRuntimeSchema2
22
+ } from "./chunk-bcvx11fn.js";
23
23
 
24
24
  // src/definitions/validation/validate-artifacts.ts
25
25
  function checkArtifactFields(steps) {
26
26
  const issues = [];
27
27
  for (const step of steps) {
28
- for (const field of findArtifactFields(step.resultSchemaJson ?? null)) {
28
+ for (const field of findArtifactFields2(step.resultSchemaJson ?? null)) {
29
29
  if (!field.inArray)
30
30
  continue;
31
31
  issues.push({
@@ -39,7 +39,7 @@ function checkArtifactFields(steps) {
39
39
  }
40
40
 
41
41
  // src/definitions/validation/validation-issue.ts
42
- function listPaths(paths, limit = 24) {
42
+ function listPaths2(paths, limit = 24) {
43
43
  if (paths.length === 0)
44
44
  return "";
45
45
  if (paths.length <= limit)
@@ -52,7 +52,7 @@ var isPlaceholder = (key) => /^<[^<>]*>$/.test(key);
52
52
  function stepMarkers(step) {
53
53
  if (!step.prompt)
54
54
  return [];
55
- return findArtifactMarkers(step.prompt).flatMap((marker) => marker.ref.type === "signal" && !isPlaceholder(marker.ref.stepKey) && !isPlaceholder(marker.ref.signalKey) ? [
55
+ return findArtifactMarkers2(step.prompt).flatMap((marker) => marker.ref.type === "signal" && !isPlaceholder(marker.ref.stepKey) && !isPlaceholder(marker.ref.signalKey) ? [
56
56
  {
57
57
  kind: marker.kind,
58
58
  stepKey: marker.ref.stepKey,
@@ -63,8 +63,8 @@ function stepMarkers(step) {
63
63
  var markerLabel = (marker) => `${marker.kind === "embed" ? "Artifact.embed" : "Artifact.link"}(` + `"signal/${marker.stepKey}/${marker.resultPath}")`;
64
64
  function checkMarkerTargets(steps, stepsByKey) {
65
65
  const issues = [];
66
- const embeddable = new Set(artifactPlatforms.flatMap((platform) => [
67
- ...EMBEDDABLE_ARTIFACT_EXTENSIONS[platform]
66
+ const embeddable = new Set(artifactPlatforms2.flatMap((platform) => [
67
+ ...EMBEDDABLE_ARTIFACT_EXTENSIONS2[platform]
68
68
  ]));
69
69
  for (const step of steps) {
70
70
  for (const marker of stepMarkers(step)) {
@@ -75,14 +75,14 @@ function checkMarkerTargets(steps, stepsByKey) {
75
75
  for (const target of targets) {
76
76
  if (!target.resultSchemaJson)
77
77
  continue;
78
- const fields = findArtifactFields(target.resultSchemaJson);
78
+ const fields = findArtifactFields2(target.resultSchemaJson);
79
79
  const field = fields.find((candidate) => candidate.path === marker.resultPath);
80
80
  if (!field) {
81
81
  const declared = fields.map((candidate) => candidate.path);
82
82
  issues.push({
83
83
  check: "artifact-marker",
84
84
  severity: "error",
85
- message: `${where}, but step "${target.key}" has no artifact field at ` + `"${marker.resultPath}". Artifact fields on "${target.key}": ` + `${declared.length > 0 ? listPaths(declared) : "(none)"}.`
85
+ message: `${where}, but step "${target.key}" has no artifact field at ` + `"${marker.resultPath}". Artifact fields on "${target.key}": ` + `${declared.length > 0 ? listPaths2(declared) : "(none)"}.`
86
86
  });
87
87
  continue;
88
88
  }
@@ -116,7 +116,7 @@ function checkEnv(steps) {
116
116
  continue;
117
117
  issues.push(...checkEnvMcpOwners(step));
118
118
  issues.push(...checkEnvApplies(step));
119
- const result = envVarsSchema.safeParse(envJson);
119
+ const result = envVarsSchema2.safeParse(envJson);
120
120
  if (result.success)
121
121
  continue;
122
122
  for (const issue of result.error.issues) {
@@ -145,7 +145,7 @@ function checkEnvMcpOwners(step) {
145
145
  issues.push({
146
146
  check: "env-var-mcp",
147
147
  severity: "error",
148
- message: `Step "${step.key}" env var #${String(index + 1)} ("${entry.name}") ` + `belongs to MCP server "${entry.mcp}", but the step declares no MCP ` + `server with that key. Declared servers: ` + `${serverKeys.length > 0 ? listPaths(serverKeys) : "(none)"}.`
148
+ message: `Step "${step.key}" env var #${String(index + 1)} ("${entry.name}") ` + `belongs to MCP server "${entry.mcp}", but the step declares no MCP ` + `server with that key. Declared servers: ` + `${serverKeys.length > 0 ? listPaths2(serverKeys) : "(none)"}.`
149
149
  });
150
150
  });
151
151
  return issues;
@@ -185,7 +185,7 @@ function checkRepo(steps) {
185
185
  if (!step.repo)
186
186
  continue;
187
187
  const where = `Step "${step.key}" repo`;
188
- const parsed = repoConfigInputSchema.safeParse(step.repo);
188
+ const parsed = repoConfigInputSchema2.safeParse(step.repo);
189
189
  if (!parsed.success) {
190
190
  for (const issue of parsed.error.issues) {
191
191
  const field = issue.path.map(String).join(".");
@@ -205,9 +205,9 @@ function checkRuntime(steps) {
205
205
  const issues = [];
206
206
  for (const step of steps) {
207
207
  if (step.environment?.kind === "named") {
208
- const result2 = environmentNameSchema.safeParse(step.environment.name);
209
- if (!result2.success) {
210
- for (const issue of result2.error.issues) {
208
+ const result = environmentNameSchema2.safeParse(step.environment.name);
209
+ if (!result.success) {
210
+ for (const issue of result.error.issues) {
211
211
  issues.push({
212
212
  check: "runtime",
213
213
  severity: "error",
@@ -223,7 +223,7 @@ function checkRuntime(steps) {
223
223
  if (runtime === undefined)
224
224
  continue;
225
225
  if (runtime.kind !== "devcontainer" && "config" in runtime) {
226
- const config = devcontainerConfigPathSchema.safeParse(runtime.config);
226
+ const config = devcontainerConfigPathSchema2.safeParse(runtime.config);
227
227
  if (!config.success) {
228
228
  for (const issue of config.error.issues) {
229
229
  issues.push({
@@ -241,7 +241,7 @@ function checkRuntime(steps) {
241
241
  message: `Step "${step.key}": code steps need a container, so Runtime.host() is not supported for codeStep. Use Runtime.managed.<id>() or Runtime.devcontainer(), or drop the runtime.`
242
242
  });
243
243
  }
244
- const result = environmentRuntimeSchema.safeParse(runtime);
244
+ const result = environmentRuntimeSchema2.safeParse(runtime);
245
245
  if (result.success)
246
246
  continue;
247
247
  for (const issue of result.error.issues) {
@@ -275,14 +275,14 @@ function checkHealthChecks(steps) {
275
275
  issues.push({
276
276
  check: "health-check-mcp-server",
277
277
  severity: "error",
278
- message: `${where} names MCP server "${check.mcp}", but the step declares no ` + `such server in mcps. Declared servers: ${mcpServerKeys.length > 0 ? listPaths([...mcpServerKeys].sort()) : "(none)"}.`
278
+ message: `${where} names MCP server "${check.mcp}", but the step declares no ` + `such server in mcps. Declared servers: ${mcpServerKeys.length > 0 ? listPaths2([...mcpServerKeys].sort()) : "(none)"}.`
279
279
  });
280
280
  }
281
281
  });
282
282
  }
283
283
  return issues;
284
284
  }
285
- function validateDefinitionSpecs(steps) {
285
+ function validateDefinitionSpecs2(steps) {
286
286
  const stepsByKey = new Map;
287
287
  for (const step of steps) {
288
288
  const existing = stepsByKey.get(step.key);
@@ -300,12 +300,12 @@ function validateDefinitionSpecs(steps) {
300
300
  ...checkRepo(steps)
301
301
  ];
302
302
  }
303
- function assertValidDefinitionSpecs(steps) {
304
- const issues = validateDefinitionSpecs(steps).filter((issue) => issue.severity === "error");
303
+ function assertValidDefinitionSpecs2(steps) {
304
+ const issues = validateDefinitionSpecs2(steps).filter((issue) => issue.severity === "error");
305
305
  if (issues.length === 0)
306
306
  return;
307
307
  const header = issues.length === 1 ? "Definition validation failed:" : `Definition validation failed with ${String(issues.length)} problems:`;
308
308
  throw new Error([header, ...issues.map((issue) => ` \u2022 ${issue.message}`)].join(`
309
309
  `));
310
310
  }
311
- export { listPaths, validateDefinitionSpecs, assertValidDefinitionSpecs };
311
+ export { listPaths2, validateDefinitionSpecs2, assertValidDefinitionSpecs2 };
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ import {
3
+ _enum
4
+ } from "./chunk-9ct3xypr.js";
5
+
6
+ // src/managed-runtimes.ts
7
+ var MANAGED_RUNTIME_IDS2 = ["bun1", "node24"];
8
+ var DEFAULT_CODE_STEP_RUNTIME_ID2 = "bun1";
9
+ var managedRuntimeIdSchema2 = _enum(MANAGED_RUNTIME_IDS2);
10
+ function isManagedRuntimeId2(value) {
11
+ return MANAGED_RUNTIME_IDS2.includes(value);
12
+ }
13
+
14
+ export { MANAGED_RUNTIME_IDS2, DEFAULT_CODE_STEP_RUNTIME_ID2, managedRuntimeIdSchema2, isManagedRuntimeId2 };
@@ -1,30 +1,30 @@
1
1
  // @bun
2
2
  import {
3
- exports_external
4
- } from "./chunk-yf15kdte.js";
3
+ string
4
+ } from "./chunk-9ct3xypr.js";
5
5
 
6
6
  // src/devcontainer-config-path.ts
7
- var MAX_DEVCONTAINER_CONFIG_PATH_LENGTH = 255;
8
- var DEVCONTAINER_CONFIG_BASENAMES = [
7
+ var MAX_DEVCONTAINER_CONFIG_PATH_LENGTH2 = 255;
8
+ var DEVCONTAINER_CONFIG_BASENAMES2 = [
9
9
  "devcontainer.json",
10
10
  ".devcontainer.json"
11
11
  ];
12
12
  var LEADING_CURRENT_DIR = /^(?:\.\/)+/;
13
13
  var DRIVE_LETTER = /^[A-Za-z]:/;
14
- function normalizeDevcontainerConfigPath(path) {
14
+ function normalizeDevcontainerConfigPath2(path) {
15
15
  return path.replace(LEADING_CURRENT_DIR, "");
16
16
  }
17
17
  function basenameOf(path) {
18
18
  return path.slice(Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\")) + 1);
19
19
  }
20
- var devcontainerConfigPathSchema = exports_external.string().max(MAX_DEVCONTAINER_CONFIG_PATH_LENGTH).overwrite(normalizeDevcontainerConfigPath).refine((path) => !path.includes("\\"), {
20
+ var devcontainerConfigPathSchema2 = string().max(MAX_DEVCONTAINER_CONFIG_PATH_LENGTH2).overwrite(normalizeDevcontainerConfigPath2).refine((path) => !path.includes("\\"), {
21
21
  message: "must use forward slashes, not backslashes"
22
22
  }).refine((path) => !path.startsWith("/") && !DRIVE_LETTER.test(path), {
23
23
  message: "must be relative to the repository root, not absolute"
24
24
  }).refine((path) => !path.split("/").includes(".."), {
25
25
  message: 'must not contain a ".." segment'
26
- }).refine((path) => DEVCONTAINER_CONFIG_BASENAMES.includes(basenameOf(path)), {
26
+ }).refine((path) => DEVCONTAINER_CONFIG_BASENAMES2.includes(basenameOf(path)), {
27
27
  message: 'must end in "devcontainer.json" or ".devcontainer.json"'
28
28
  });
29
29
 
30
- export { MAX_DEVCONTAINER_CONFIG_PATH_LENGTH, DEVCONTAINER_CONFIG_BASENAMES, normalizeDevcontainerConfigPath, devcontainerConfigPathSchema };
30
+ export { MAX_DEVCONTAINER_CONFIG_PATH_LENGTH2, DEVCONTAINER_CONFIG_BASENAMES2, normalizeDevcontainerConfigPath2, devcontainerConfigPathSchema2 };