@scarn/sdk 0.0.0-stage → 0.0.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/dist/chunk-4361gxk0.js +166 -0
- package/dist/chunk-4vehh3dq.js +333 -0
- package/dist/chunk-56e4kp0a.js +162 -0
- package/dist/chunk-5mmj03ah.js +1074 -0
- package/dist/chunk-631ffb6r.js +57 -0
- package/dist/chunk-91p9vzcs.js +1453 -0
- package/dist/chunk-9s07v9r1.js +30 -0
- package/dist/chunk-b21233rt.js +78 -0
- package/dist/chunk-dnn39qt4.js +13539 -0
- package/dist/chunk-eg1hcvhb.js +300 -0
- package/dist/chunk-g0rdnn0r.js +95 -0
- package/dist/chunk-h9yxx0hd.js +116 -0
- package/dist/chunk-njd6npf0.js +35 -0
- package/dist/chunk-ny07ncb9.js +330 -0
- package/dist/chunk-p6kc9wq8.js +97 -0
- package/dist/chunk-qpw5wt1p.js +257 -0
- package/dist/chunk-rq3q8vg7.js +1094 -0
- package/dist/chunk-s0gap8r8.js +14 -0
- package/dist/chunk-tfm5hjzm.js +100 -0
- package/dist/chunk-ynk2bjae.js +1686 -0
- package/dist/chunk-zpqyjgb4.js +49 -0
- package/dist/client.d.ts +4 -0
- package/dist/client.js +57 -0
- package/dist/contracts/artifact-markers.d.ts +42 -0
- package/dist/contracts/artifact-markers.js +15 -0
- package/dist/contracts/artifacts.d.ts +67 -0
- package/dist/contracts/artifacts.js +25 -0
- package/dist/contracts/pipeline-document/built-ins.d.ts +23 -0
- package/dist/contracts/pipeline-document/conditions/operators.d.ts +8 -0
- package/dist/contracts/pipeline-document/index.d.ts +11 -0
- package/dist/contracts/pipeline-document/index.js +97 -0
- package/dist/contracts/pipeline-document/json.d.ts +35 -0
- package/dist/contracts/pipeline-document/routes.d.ts +16 -0
- package/dist/contracts/pipeline-document/schema.d.ts +780 -0
- package/dist/contracts/pipeline-document/step-contract.d.ts +11 -0
- package/dist/contracts/step-artifact-submissions.d.ts +71 -0
- package/dist/contracts/step-artifact-submissions.js +174 -0
- package/dist/defaults/atomic-json-file.d.ts +10 -0
- package/dist/defaults/auth-file.d.ts +14 -0
- package/dist/defaults/base-url.d.ts +1 -0
- package/dist/defaults/config-file.d.ts +46 -0
- package/dist/defaults/home-dir.d.ts +3 -0
- package/dist/defaults/index.d.ts +12 -0
- package/dist/defaults/index.js +1239 -0
- package/dist/defaults/legacy-config-migration.d.ts +27 -0
- package/dist/defaults/load-push-defaults.d.ts +25 -0
- package/dist/defaults/project-config.d.ts +32 -0
- package/dist/defaults/project-ref.d.ts +34 -0
- package/dist/definitions/artifacts/artifact.d.ts +62 -0
- package/dist/definitions/artifacts/index.d.ts +1 -0
- package/dist/definitions/pipelines/define-default-pipeline-assignment.d.ts +263 -0
- package/dist/definitions/pipelines/index.d.ts +3 -0
- package/dist/definitions/pipelines/index.js +24 -0
- package/dist/definitions/pipelines/pipeline-definitions-client.d.ts +208 -0
- package/dist/definitions/pipelines/work-item-fields.d.ts +93 -0
- package/dist/definitions/steps/compile-mcps.d.ts +34 -0
- package/dist/definitions/steps/define-code-step.d.ts +84 -0
- package/dist/definitions/steps/define-mcp.d.ts +79 -0
- package/dist/definitions/steps/define-step.d.ts +137 -0
- package/dist/definitions/steps/env.d.ts +136 -0
- package/dist/definitions/steps/index.d.ts +14 -0
- package/dist/definitions/steps/index.js +73 -0
- package/dist/definitions/steps/mcp-server-config.d.ts +102 -0
- package/dist/definitions/steps/prompt-template.d.ts +24 -0
- package/dist/definitions/steps/repo.d.ts +67 -0
- package/dist/definitions/steps/runtime.d.ts +115 -0
- package/dist/definitions/steps/step-definitions-client.d.ts +400 -0
- package/dist/definitions/steps/step-features.d.ts +109 -0
- package/dist/definitions/steps/step-handle.d.ts +25 -0
- package/dist/definitions/steps/step-ref.d.ts +19 -0
- package/dist/definitions/validation/index.d.ts +2 -0
- package/dist/definitions/validation/index.js +17 -0
- package/dist/definitions/validation/validate-artifact-markers.d.ts +3 -0
- package/dist/definitions/validation/validate-artifacts.d.ts +7 -0
- package/dist/definitions/validation/validate-definition-specs.d.ts +16 -0
- package/dist/definitions/validation/validate-env.d.ts +15 -0
- package/dist/definitions/validation/validate-repo.d.ts +13 -0
- package/dist/definitions/validation/validate-runtime.d.ts +12 -0
- package/dist/definitions/validation/validation-issue.d.ts +11 -0
- package/dist/devcontainer-config-path.d.ts +21 -0
- package/dist/devcontainer-config-path.js +13 -0
- package/dist/env-vars.d.ts +136 -0
- package/dist/env-vars.js +35 -0
- package/dist/eslint.d.ts +42 -0
- package/dist/eslint.js +125 -0
- package/dist/generated/client/client.gen.d.ts +2 -0
- package/dist/generated/client/index.d.ts +8 -0
- package/dist/generated/client/types.gen.d.ts +117 -0
- package/dist/generated/client/utils.gen.d.ts +33 -0
- package/dist/generated/client.gen.d.ts +12 -0
- package/dist/generated/core/auth.gen.d.ts +18 -0
- package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
- package/dist/generated/core/params.gen.d.ts +43 -0
- package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/generated/core/types.gen.d.ts +78 -0
- package/dist/generated/core/utils.gen.d.ts +19 -0
- package/dist/generated/index.d.ts +2 -0
- package/dist/generated/sdk.gen.d.ts +302 -0
- package/dist/generated/types.gen.d.ts +18368 -0
- package/dist/git-url/git-remote.d.ts +30 -0
- package/dist/git-url/git-repo-identity.d.ts +44 -0
- package/dist/git-url/git-repo-identity.js +159 -0
- package/dist/git-url/parse-git-host.d.ts +23 -0
- package/dist/health-checks.d.ts +169 -0
- package/dist/health-checks.js +19 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +293 -0
- package/dist/jsonc.d.ts +3 -0
- package/dist/jsonc.js +11 -0
- package/dist/managed-runtimes.d.ts +20 -0
- package/dist/managed-runtimes.js +13 -0
- package/dist/opencode-mcp.d.ts +313 -0
- package/dist/opencode-mcp.js +29 -0
- package/dist/pipelines/chain.d.ts +7 -0
- package/dist/pipelines/compile-args.d.ts +12 -0
- package/dist/pipelines/compile-chain.d.ts +9 -0
- package/dist/pipelines/compile-checks.d.ts +16 -0
- package/dist/pipelines/compile-state.d.ts +30 -0
- package/dist/pipelines/condition-data.d.ts +78 -0
- package/dist/pipelines/conditions.d.ts +47 -0
- package/dist/pipelines/context.d.ts +16 -0
- package/dist/pipelines/define-pipeline.d.ts +32 -0
- package/dist/pipelines/each.d.ts +5 -0
- package/dist/pipelines/errors.d.ts +26 -0
- package/dist/pipelines/handles.d.ts +29 -0
- package/dist/pipelines/index.d.ts +18 -0
- package/dist/pipelines/index.js +80 -0
- package/dist/pipelines/model.d.ts +103 -0
- package/dist/pipelines/nodes.d.ts +54 -0
- package/dist/pipelines/ref-types.d.ts +54 -0
- package/dist/pipelines/refs.d.ts +80 -0
- package/dist/pipelines/registry.d.ts +12 -0
- package/dist/pipelines/source.d.ts +17 -0
- package/dist/pipelines/types.d.ts +160 -0
- package/dist/push/code-step-lookup.d.ts +32 -0
- package/dist/push/code-step-lookup.js +11 -0
- package/dist/push/collect-definitions.d.ts +70 -0
- package/dist/push/collect-pipeline-documents.d.ts +14 -0
- package/dist/push/index.d.ts +6 -0
- package/dist/push/index.js +328 -0
- package/dist/push/push-from-directory.d.ts +37 -0
- package/dist/repo-config.d.ts +80 -0
- package/dist/repo-config.js +23 -0
- package/dist/scarn-config-parser.d.ts +29 -0
- package/dist/scarn-config-parser.js +9 -0
- package/dist/task-plane-client.d.ts +489 -0
- package/dist/z.d.ts +7 -0
- package/package.json +132 -4
- package/README.md +0 -3
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
artifactPlatforms2,
|
|
4
|
+
EMBEDDABLE_ARTIFACT_EXTENSIONS2,
|
|
5
|
+
findArtifactFields2
|
|
6
|
+
} from "./chunk-56e4kp0a.js";
|
|
7
|
+
import {
|
|
8
|
+
findArtifactMarkers2
|
|
9
|
+
} from "./chunk-631ffb6r.js";
|
|
10
|
+
import {
|
|
11
|
+
envVarsSchema2
|
|
12
|
+
} from "./chunk-p6kc9wq8.js";
|
|
13
|
+
import {
|
|
14
|
+
repoConfigInputSchema2,
|
|
15
|
+
repoRuntimeMismatch2
|
|
16
|
+
} from "./chunk-b21233rt.js";
|
|
17
|
+
import {
|
|
18
|
+
devcontainerConfigPathSchema2
|
|
19
|
+
} from "./chunk-9s07v9r1.js";
|
|
20
|
+
import {
|
|
21
|
+
MANAGED_RUNTIME_IDS2,
|
|
22
|
+
isManagedRuntimeId2
|
|
23
|
+
} from "./chunk-s0gap8r8.js";
|
|
24
|
+
|
|
25
|
+
// src/definitions/validation/validate-artifacts.ts
|
|
26
|
+
function checkArtifactFields(steps) {
|
|
27
|
+
const issues = [];
|
|
28
|
+
for (const step of steps) {
|
|
29
|
+
for (const field of findArtifactFields2(step.resultSchemaJson ?? null)) {
|
|
30
|
+
if (!field.inArray)
|
|
31
|
+
continue;
|
|
32
|
+
issues.push({
|
|
33
|
+
check: "artifact-field",
|
|
34
|
+
severity: "error",
|
|
35
|
+
message: `Step "${step.key}" declares artifact field "${field.path}" inside an ` + `array. Artifact fields in arrays aren't supported; declare a fixed ` + `number of named artifact fields instead.`
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return issues;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/definitions/validation/validation-issue.ts
|
|
43
|
+
function listPaths2(paths, limit = 24) {
|
|
44
|
+
if (paths.length === 0)
|
|
45
|
+
return "";
|
|
46
|
+
if (paths.length <= limit)
|
|
47
|
+
return paths.join(", ");
|
|
48
|
+
return `${paths.slice(0, limit).join(", ")}, \u2026 (${String(paths.length - limit)} more)`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/definitions/validation/validate-artifact-markers.ts
|
|
52
|
+
var isPlaceholder = (key) => /^<[^<>]*>$/.test(key);
|
|
53
|
+
function stepMarkers(step) {
|
|
54
|
+
if (!step.prompt)
|
|
55
|
+
return [];
|
|
56
|
+
return findArtifactMarkers2(step.prompt).flatMap((marker) => marker.ref.type === "signal" && !isPlaceholder(marker.ref.stepKey) && !isPlaceholder(marker.ref.signalKey) ? [
|
|
57
|
+
{
|
|
58
|
+
kind: marker.kind,
|
|
59
|
+
stepKey: marker.ref.stepKey,
|
|
60
|
+
resultPath: marker.ref.signalKey
|
|
61
|
+
}
|
|
62
|
+
] : []);
|
|
63
|
+
}
|
|
64
|
+
var markerLabel = (marker) => `${marker.kind === "embed" ? "Artifact.embed" : "Artifact.link"}(` + `"signal/${marker.stepKey}/${marker.resultPath}")`;
|
|
65
|
+
function checkMarkerTargets(steps, stepsByKey) {
|
|
66
|
+
const issues = [];
|
|
67
|
+
const embeddable = new Set(artifactPlatforms2.flatMap((platform) => [
|
|
68
|
+
...EMBEDDABLE_ARTIFACT_EXTENSIONS2[platform]
|
|
69
|
+
]));
|
|
70
|
+
for (const step of steps) {
|
|
71
|
+
for (const marker of stepMarkers(step)) {
|
|
72
|
+
const targets = stepsByKey.get(marker.stepKey);
|
|
73
|
+
if (!targets)
|
|
74
|
+
continue;
|
|
75
|
+
const where = `Step "${step.key}" uses ${markerLabel(marker)}`;
|
|
76
|
+
for (const target of targets) {
|
|
77
|
+
if (!target.resultSchemaJson)
|
|
78
|
+
continue;
|
|
79
|
+
const fields = findArtifactFields2(target.resultSchemaJson);
|
|
80
|
+
const field = fields.find((candidate) => candidate.path === marker.resultPath);
|
|
81
|
+
if (!field) {
|
|
82
|
+
const declared = fields.map((candidate) => candidate.path);
|
|
83
|
+
issues.push({
|
|
84
|
+
check: "artifact-marker",
|
|
85
|
+
severity: "error",
|
|
86
|
+
message: `${where}, but step "${target.key}" has no artifact field at ` + `"${marker.resultPath}". Artifact fields on "${target.key}": ` + `${declared.length > 0 ? listPaths2(declared) : "(none)"}.`
|
|
87
|
+
});
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (marker.kind !== "embed")
|
|
91
|
+
continue;
|
|
92
|
+
const { accept } = field;
|
|
93
|
+
if (accept.length === 0)
|
|
94
|
+
continue;
|
|
95
|
+
if (accept.some((extension) => embeddable.has(extension)))
|
|
96
|
+
continue;
|
|
97
|
+
issues.push({
|
|
98
|
+
check: "artifact-marker",
|
|
99
|
+
severity: "warning",
|
|
100
|
+
message: `${where}, but the field accepts only ${accept.join(", ")}, which ` + `no platform can embed, so it will always be linked. Embeddable ` + `extensions: ${[...embeddable].join(", ")}.`
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return issues;
|
|
106
|
+
}
|
|
107
|
+
function checkArtifactMarkers(steps, stepsByKey) {
|
|
108
|
+
return checkMarkerTargets(steps, stepsByKey);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// src/definitions/validation/validate-env.ts
|
|
112
|
+
function checkEnv(steps) {
|
|
113
|
+
const issues = [];
|
|
114
|
+
for (const step of steps) {
|
|
115
|
+
if (!step.envJson)
|
|
116
|
+
continue;
|
|
117
|
+
issues.push(...checkEnvMcpOwners(step));
|
|
118
|
+
issues.push(...checkEnvApplies(step));
|
|
119
|
+
const result = envVarsSchema2.safeParse(step.envJson);
|
|
120
|
+
if (result.success)
|
|
121
|
+
continue;
|
|
122
|
+
for (const issue of result.error.issues) {
|
|
123
|
+
const [index, ...field] = issue.path;
|
|
124
|
+
const entry = typeof index === "number" ? step.envJson[index] : undefined;
|
|
125
|
+
const where = typeof index === "number" && entry ? `Step "${step.key}" env var #${String(index + 1)} ("${entry.name}")` : `Step "${step.key}" env`;
|
|
126
|
+
const fieldLabel = field.length > 0 ? ` ${field.map(String).join(".")}` : "";
|
|
127
|
+
issues.push({
|
|
128
|
+
check: "env-var",
|
|
129
|
+
severity: "error",
|
|
130
|
+
message: `${where}${fieldLabel}: ${issue.message}`
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return issues;
|
|
135
|
+
}
|
|
136
|
+
function checkEnvMcpOwners(step) {
|
|
137
|
+
const serverKeys = Object.keys(step.opencodeMcpJson ?? {}).sort();
|
|
138
|
+
const serverKeySet = new Set(serverKeys);
|
|
139
|
+
const issues = [];
|
|
140
|
+
(step.envJson ?? []).forEach((entry, index) => {
|
|
141
|
+
if (entry.source !== "inherit" || entry.mcp === undefined)
|
|
142
|
+
return;
|
|
143
|
+
if (serverKeySet.has(entry.mcp))
|
|
144
|
+
return;
|
|
145
|
+
issues.push({
|
|
146
|
+
check: "env-var-mcp",
|
|
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 ? listPaths2(serverKeys) : "(none)"}.`
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
return issues;
|
|
152
|
+
}
|
|
153
|
+
function checkEnvApplies(step) {
|
|
154
|
+
const issues = [];
|
|
155
|
+
(step.envJson ?? []).forEach((entry, index) => {
|
|
156
|
+
const applies = entry.applies ?? "agent";
|
|
157
|
+
if (applies === "agent")
|
|
158
|
+
return;
|
|
159
|
+
const where = `Step "${step.key}" env var #${String(index + 1)} ("${entry.name}") applies "${applies}"`;
|
|
160
|
+
if (step.executionMode === "no_workspace") {
|
|
161
|
+
issues.push({
|
|
162
|
+
check: "env-var-applies",
|
|
163
|
+
severity: "error",
|
|
164
|
+
message: `${where}: setup variables reach devcontainer up, but the step runs on the host (executionMode "no_workspace") with no container to set up. Use applies "agent" or Runtime.devcontainer().`
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
if (entry.source === "inherit" && entry.mcp !== undefined) {
|
|
168
|
+
issues.push({
|
|
169
|
+
check: "env-var-applies",
|
|
170
|
+
severity: "error",
|
|
171
|
+
message: `${where}: it belongs to MCP server "${entry.mcp}", and MCP servers run inside the agent. Use applies "agent".`
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
return issues;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// src/definitions/validation/validate-repo.ts
|
|
179
|
+
function checkRepo(steps) {
|
|
180
|
+
const issues = [];
|
|
181
|
+
for (const step of steps) {
|
|
182
|
+
if (!step.repo)
|
|
183
|
+
continue;
|
|
184
|
+
const where = `Step "${step.key}" repo`;
|
|
185
|
+
const parsed = repoConfigInputSchema2.safeParse(step.repo);
|
|
186
|
+
if (!parsed.success) {
|
|
187
|
+
for (const issue of parsed.error.issues) {
|
|
188
|
+
const field = issue.path.map(String).join(".");
|
|
189
|
+
issues.push({
|
|
190
|
+
check: "repo",
|
|
191
|
+
severity: "error",
|
|
192
|
+
message: `${where}${field ? ` ${field}` : ""}: ${issue.message}`
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
const executionMode = step.executionMode ?? "workspace";
|
|
198
|
+
const mismatch = repoRuntimeMismatch2(executionMode, parsed.data.mode);
|
|
199
|
+
if (mismatch === null)
|
|
200
|
+
continue;
|
|
201
|
+
issues.push({
|
|
202
|
+
check: "repo",
|
|
203
|
+
severity: "error",
|
|
204
|
+
message: `${where} "${parsed.data.mode}" cannot be used with executionMode "${executionMode}": ${mismatch}.`
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return issues;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// src/definitions/validation/validate-runtime.ts
|
|
211
|
+
function checkRuntime(steps) {
|
|
212
|
+
const issues = [];
|
|
213
|
+
for (const step of steps) {
|
|
214
|
+
if (step.kind === "code" && step.executionMode === "no_workspace") {
|
|
215
|
+
issues.push({
|
|
216
|
+
check: "runtime",
|
|
217
|
+
severity: "error",
|
|
218
|
+
message: `Step "${step.key}": code steps run repo code and need a workspace, so Runtime.host() (executionMode "no_workspace") is not supported for codeStep. Use Runtime.managed.<id>() or Runtime.devcontainer(), or drop the runtime.`
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
issues.push(...checkManagedRuntime(step));
|
|
222
|
+
if (step.devcontainerConfigPath == null)
|
|
223
|
+
continue;
|
|
224
|
+
const where = `Step "${step.key}" devcontainerConfigPath "${step.devcontainerConfigPath}"`;
|
|
225
|
+
if (step.executionMode === "no_workspace") {
|
|
226
|
+
issues.push({
|
|
227
|
+
check: "runtime",
|
|
228
|
+
severity: "error",
|
|
229
|
+
message: `${where}: a devcontainer config needs a workspace, but the step runs on the host (executionMode "no_workspace"). Use Runtime.devcontainer({ config }) or drop the config.`
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
const result = devcontainerConfigPathSchema2.safeParse(step.devcontainerConfigPath);
|
|
233
|
+
if (result.success)
|
|
234
|
+
continue;
|
|
235
|
+
for (const issue of result.error.issues) {
|
|
236
|
+
issues.push({
|
|
237
|
+
check: "runtime",
|
|
238
|
+
severity: "error",
|
|
239
|
+
message: `${where}: ${issue.message}`
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return issues;
|
|
244
|
+
}
|
|
245
|
+
function checkManagedRuntime(step) {
|
|
246
|
+
if (step.managedRuntime == null)
|
|
247
|
+
return [];
|
|
248
|
+
const where = `Step "${step.key}" managedRuntime "${step.managedRuntime}"`;
|
|
249
|
+
const problems = [];
|
|
250
|
+
if (!isManagedRuntimeId2(step.managedRuntime)) {
|
|
251
|
+
problems.push(`unknown managed runtime; expected one of ${MANAGED_RUNTIME_IDS2.join(", ")}`);
|
|
252
|
+
}
|
|
253
|
+
if (step.kind !== "code") {
|
|
254
|
+
problems.push("managed runtimes are only supported for code steps. Use Runtime.devcontainer() or Runtime.host() for defineStep");
|
|
255
|
+
}
|
|
256
|
+
if (step.executionMode === "no_workspace") {
|
|
257
|
+
problems.push('a managed runtime needs a workspace, but the step runs on the host (executionMode "no_workspace")');
|
|
258
|
+
}
|
|
259
|
+
if (step.devcontainerConfigPath != null) {
|
|
260
|
+
problems.push("cannot be combined with devcontainerConfigPath. Use either Runtime.managed.<id>() or Runtime.devcontainer({ config })");
|
|
261
|
+
}
|
|
262
|
+
return problems.map((problem) => ({
|
|
263
|
+
check: "runtime",
|
|
264
|
+
severity: "error",
|
|
265
|
+
message: `${where}: ${problem}.`
|
|
266
|
+
}));
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// src/definitions/validation/validate-definition-specs.ts
|
|
270
|
+
function checkHealthChecks(steps) {
|
|
271
|
+
const issues = [];
|
|
272
|
+
for (const step of steps) {
|
|
273
|
+
const checks = step.healthChecksJson ?? [];
|
|
274
|
+
if (checks.length === 0)
|
|
275
|
+
continue;
|
|
276
|
+
const mcpServerKeys = Object.keys(step.opencodeMcpJson ?? {});
|
|
277
|
+
const mcpServerKeySet = new Set(mcpServerKeys);
|
|
278
|
+
checks.forEach((check, index) => {
|
|
279
|
+
if (check.kind === "cli")
|
|
280
|
+
return;
|
|
281
|
+
const label = check.name ?? check.tool;
|
|
282
|
+
const where = `Step "${step.key}" health check #${String(index + 1)} ("${label}")`;
|
|
283
|
+
if (!check.mcp)
|
|
284
|
+
return;
|
|
285
|
+
if (!mcpServerKeySet.has(check.mcp)) {
|
|
286
|
+
issues.push({
|
|
287
|
+
check: "health-check-mcp-server",
|
|
288
|
+
severity: "error",
|
|
289
|
+
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)"}.`
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
const prefix = `${check.mcp}_`;
|
|
293
|
+
if (check.tool.startsWith(prefix)) {
|
|
294
|
+
issues.push({
|
|
295
|
+
check: "health-check-double-qualified",
|
|
296
|
+
severity: "error",
|
|
297
|
+
message: `${where} sets mcp "${check.mcp}" and tool "${check.tool}", which already ` + `starts with "${prefix}". When "mcp" is set, "tool" should be the bare tool ` + `name \u2014 OpenCode resolves it to "${prefix}${check.tool}". Did you mean ` + `tool: "${check.tool.slice(prefix.length)}"?`
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
return issues;
|
|
303
|
+
}
|
|
304
|
+
function validateDefinitionSpecs2(steps) {
|
|
305
|
+
const stepsByKey = new Map;
|
|
306
|
+
for (const step of steps) {
|
|
307
|
+
const existing = stepsByKey.get(step.key);
|
|
308
|
+
if (existing)
|
|
309
|
+
existing.push(step);
|
|
310
|
+
else
|
|
311
|
+
stepsByKey.set(step.key, [step]);
|
|
312
|
+
}
|
|
313
|
+
return [
|
|
314
|
+
...checkArtifactFields(steps),
|
|
315
|
+
...checkArtifactMarkers(steps, stepsByKey),
|
|
316
|
+
...checkHealthChecks(steps),
|
|
317
|
+
...checkEnv(steps),
|
|
318
|
+
...checkRuntime(steps),
|
|
319
|
+
...checkRepo(steps)
|
|
320
|
+
];
|
|
321
|
+
}
|
|
322
|
+
function assertValidDefinitionSpecs2(steps) {
|
|
323
|
+
const issues = validateDefinitionSpecs2(steps).filter((issue) => issue.severity === "error");
|
|
324
|
+
if (issues.length === 0)
|
|
325
|
+
return;
|
|
326
|
+
const header = issues.length === 1 ? "Definition validation failed:" : `Definition validation failed with ${String(issues.length)} problems:`;
|
|
327
|
+
throw new Error([header, ...issues.map((issue) => ` \u2022 ${issue.message}`)].join(`
|
|
328
|
+
`));
|
|
329
|
+
}
|
|
330
|
+
export { listPaths2, validateDefinitionSpecs2, assertValidDefinitionSpecs2 };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
string,
|
|
4
|
+
boolean,
|
|
5
|
+
array,
|
|
6
|
+
object,
|
|
7
|
+
discriminatedUnion,
|
|
8
|
+
_enum,
|
|
9
|
+
literal
|
|
10
|
+
} from "./chunk-dnn39qt4.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 inheritEnvVarSchema = 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 envVarSpecSchema2 = discriminatedUnion("source", [
|
|
73
|
+
valueEnvVarSchema,
|
|
74
|
+
inheritEnvVarSchema
|
|
75
|
+
]);
|
|
76
|
+
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" });
|
|
77
|
+
var storedEnvVarsSchema2 = array(discriminatedUnion("source", [
|
|
78
|
+
object({
|
|
79
|
+
name: string(),
|
|
80
|
+
source: literal("value"),
|
|
81
|
+
value: string(),
|
|
82
|
+
secret: boolean(),
|
|
83
|
+
applies: _enum(envVarAppliesValues2).default("agent")
|
|
84
|
+
}),
|
|
85
|
+
object({
|
|
86
|
+
name: string(),
|
|
87
|
+
source: literal("inherit"),
|
|
88
|
+
from: string(),
|
|
89
|
+
secret: boolean(),
|
|
90
|
+
optional: boolean(),
|
|
91
|
+
default: string().optional(),
|
|
92
|
+
mcp: string().optional(),
|
|
93
|
+
applies: _enum(envVarAppliesValues2).default("agent")
|
|
94
|
+
})
|
|
95
|
+
]));
|
|
96
|
+
|
|
97
|
+
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, envVarSpecSchema2, envVarsSchema2, storedEnvVarsSchema2 };
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
createClient,
|
|
4
|
+
PipelineDefinitions2
|
|
5
|
+
} from "./chunk-ynk2bjae.js";
|
|
6
|
+
import {
|
|
7
|
+
string,
|
|
8
|
+
object
|
|
9
|
+
} from "./chunk-dnn39qt4.js";
|
|
10
|
+
|
|
11
|
+
// src/definitions/pipelines/pipeline-definitions-client.ts
|
|
12
|
+
var pipelineDocumentIssueSchema = object({
|
|
13
|
+
code: string(),
|
|
14
|
+
path: string(),
|
|
15
|
+
message: string(),
|
|
16
|
+
hint: string().optional()
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
class PipelineDefinitionsApiError2 extends Error {
|
|
20
|
+
code;
|
|
21
|
+
issues;
|
|
22
|
+
constructor(error) {
|
|
23
|
+
super(error.detail ?? error.title ?? JSON.stringify(error));
|
|
24
|
+
this.name = "PipelineDefinitionsApiError";
|
|
25
|
+
this.code = error.code;
|
|
26
|
+
this.issues = documentIssuesOf(error.meta);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function documentIssuesOf(meta) {
|
|
30
|
+
const errors = meta?.["errors"];
|
|
31
|
+
if (!Array.isArray(errors))
|
|
32
|
+
return [];
|
|
33
|
+
return errors.flatMap((error) => {
|
|
34
|
+
const parsed = pipelineDocumentIssueSchema.safeParse(error);
|
|
35
|
+
return parsed.success ? [parsed.data] : [];
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function unwrap(result) {
|
|
39
|
+
if (result.error !== undefined) {
|
|
40
|
+
throw new PipelineDefinitionsApiError2(result.error);
|
|
41
|
+
}
|
|
42
|
+
return result.data;
|
|
43
|
+
}
|
|
44
|
+
function createPipelineDefinitionsClient2(baseUrl) {
|
|
45
|
+
const client = createClient({ baseUrl });
|
|
46
|
+
return buildPipelineDefinitionsClient(new PipelineDefinitions2({ client }));
|
|
47
|
+
}
|
|
48
|
+
var buildPipelineDefinitionsClient = (pipelineDefinitions) => ({
|
|
49
|
+
listByProjectId: async (projectId, options) => unwrap(await pipelineDefinitions.listPipelineDefinitions({
|
|
50
|
+
path: { projectId },
|
|
51
|
+
headers: options?.headers
|
|
52
|
+
})),
|
|
53
|
+
get: async (pipelineDefinitionId, options) => unwrap(await pipelineDefinitions.getPipelineDefinition({
|
|
54
|
+
path: { pipelineDefinitionId },
|
|
55
|
+
headers: options?.headers
|
|
56
|
+
})),
|
|
57
|
+
create: async (input, options) => unwrap(await pipelineDefinitions.createPipelineDefinition({
|
|
58
|
+
body: input,
|
|
59
|
+
headers: options?.headers
|
|
60
|
+
})),
|
|
61
|
+
publishVersion: async (pipelineDefinitionId, document, options) => unwrap(await pipelineDefinitions.publishPipelineDefinitionVersion({
|
|
62
|
+
path: { pipelineDefinitionId },
|
|
63
|
+
body: { document },
|
|
64
|
+
headers: options?.headers
|
|
65
|
+
})),
|
|
66
|
+
activateVersion: async (pipelineDefinitionId, version, options) => unwrap(await pipelineDefinitions.activatePipelineDefinitionVersion({
|
|
67
|
+
path: { pipelineDefinitionId, version },
|
|
68
|
+
headers: options?.headers
|
|
69
|
+
})),
|
|
70
|
+
listVersions: async (pipelineDefinitionId, options) => unwrap(await pipelineDefinitions.listPipelineDefinitionVersions({
|
|
71
|
+
path: { pipelineDefinitionId },
|
|
72
|
+
headers: options?.headers
|
|
73
|
+
})),
|
|
74
|
+
getVersion: async (pipelineDefinitionId, version, options) => unwrap(await pipelineDefinitions.getPipelineDefinitionVersion({
|
|
75
|
+
path: { pipelineDefinitionId, version },
|
|
76
|
+
headers: options?.headers
|
|
77
|
+
}))
|
|
78
|
+
});
|
|
79
|
+
// src/definitions/pipelines/work-item-fields.ts
|
|
80
|
+
var WORK_ITEM_TOP_LEVEL_FIELDS2 = [
|
|
81
|
+
"id",
|
|
82
|
+
"projectId",
|
|
83
|
+
"platform",
|
|
84
|
+
"platformId",
|
|
85
|
+
"platformKey",
|
|
86
|
+
"url",
|
|
87
|
+
"title",
|
|
88
|
+
"description",
|
|
89
|
+
"sourceCreatedAt",
|
|
90
|
+
"sourceUpdatedAt",
|
|
91
|
+
"createdByUserId",
|
|
92
|
+
"parentWorkItemId",
|
|
93
|
+
"createdAt",
|
|
94
|
+
"updatedAt"
|
|
95
|
+
];
|
|
96
|
+
var WORK_ITEM_FIELDS_PATH_PREFIX2 = "fields.";
|
|
97
|
+
function resolveWorkItemFieldPath2(record, path) {
|
|
98
|
+
if (typeof record !== "object" || record === null)
|
|
99
|
+
return;
|
|
100
|
+
const asRecord = record;
|
|
101
|
+
if (path.startsWith(WORK_ITEM_FIELDS_PATH_PREFIX2)) {
|
|
102
|
+
const fieldName = path.slice(WORK_ITEM_FIELDS_PATH_PREFIX2.length);
|
|
103
|
+
const fields = asRecord["fields"];
|
|
104
|
+
if (typeof fields !== "object" || fields === null)
|
|
105
|
+
return;
|
|
106
|
+
return fields[fieldName];
|
|
107
|
+
}
|
|
108
|
+
return asRecord[path];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// src/definitions/pipelines/define-default-pipeline-assignment.ts
|
|
112
|
+
var DEFAULT_PIPELINE_ASSIGNMENT_FILENAME2 = "default-pipeline-assignment.ts";
|
|
113
|
+
function makeLeaf(fact, path, operator, value) {
|
|
114
|
+
const condition = {
|
|
115
|
+
_tag: "leaf",
|
|
116
|
+
fact,
|
|
117
|
+
...path ? { path } : {},
|
|
118
|
+
operator,
|
|
119
|
+
value
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
_condition: condition,
|
|
123
|
+
then(outcome) {
|
|
124
|
+
return {
|
|
125
|
+
_tag: "assignment_rule",
|
|
126
|
+
conditions: [condition],
|
|
127
|
+
mode: "all",
|
|
128
|
+
outcome
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function makeFieldRef(fact, path) {
|
|
134
|
+
const untyped = {
|
|
135
|
+
eq: (v) => makeLeaf(fact, path, "equal", v),
|
|
136
|
+
ne: (v) => makeLeaf(fact, path, "notEqual", v),
|
|
137
|
+
gt: (v) => makeLeaf(fact, path, "greaterThan", v),
|
|
138
|
+
gte: (v) => makeLeaf(fact, path, "greaterThanInclusive", v),
|
|
139
|
+
lt: (v) => makeLeaf(fact, path, "lessThan", v),
|
|
140
|
+
lte: (v) => makeLeaf(fact, path, "lessThanInclusive", v),
|
|
141
|
+
in: (vs) => makeLeaf(fact, path, "in", vs),
|
|
142
|
+
notIn: (vs) => makeLeaf(fact, path, "notIn", vs),
|
|
143
|
+
contains: (v) => makeLeaf(fact, path, "contains", v),
|
|
144
|
+
doesNotContain: (v) => makeLeaf(fact, path, "doesNotContain", v)
|
|
145
|
+
};
|
|
146
|
+
return untyped;
|
|
147
|
+
}
|
|
148
|
+
function buildWorkItemAccessor() {
|
|
149
|
+
const accessor = {
|
|
150
|
+
field: (name) => makeFieldRef("workItem", `$.${WORK_ITEM_FIELDS_PATH_PREFIX2}${name}`)
|
|
151
|
+
};
|
|
152
|
+
for (const key of WORK_ITEM_TOP_LEVEL_FIELDS2) {
|
|
153
|
+
accessor[key] = makeFieldRef("workItem", `$.${key}`);
|
|
154
|
+
}
|
|
155
|
+
return accessor;
|
|
156
|
+
}
|
|
157
|
+
function makeAssign(pipeline) {
|
|
158
|
+
const key = typeof pipeline === "string" ? pipeline : pipeline.key;
|
|
159
|
+
if (typeof key !== "string" || key.length === 0) {
|
|
160
|
+
throw new Error("assign() requires a pipeline key or the value definePipeline() returns.");
|
|
161
|
+
}
|
|
162
|
+
return { _tag: "assign", pipelineKey: key };
|
|
163
|
+
}
|
|
164
|
+
function extractCondition(ref) {
|
|
165
|
+
return ref._condition;
|
|
166
|
+
}
|
|
167
|
+
function makeGroup(mode, refs) {
|
|
168
|
+
const conditions = refs.map(extractCondition);
|
|
169
|
+
const condition = { _tag: "group", mode, conditions };
|
|
170
|
+
return {
|
|
171
|
+
_condition: condition,
|
|
172
|
+
then(outcome) {
|
|
173
|
+
return { _tag: "assignment_rule", conditions, mode, outcome };
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function buildCtx() {
|
|
178
|
+
return {
|
|
179
|
+
workItem: buildWorkItemAccessor(),
|
|
180
|
+
context: {
|
|
181
|
+
isNew: makeFieldRef("context", "$.isNew")
|
|
182
|
+
},
|
|
183
|
+
assign: makeAssign,
|
|
184
|
+
skip: () => ({ _tag: "skip" }),
|
|
185
|
+
all: (...refs) => makeGroup("all", refs),
|
|
186
|
+
any: (...refs) => makeGroup("any", refs)
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function defaultPipelineAssignment2(callback) {
|
|
190
|
+
const input = callback(buildCtx());
|
|
191
|
+
return {
|
|
192
|
+
_tag: "default_pipeline_assignment",
|
|
193
|
+
default: input.default,
|
|
194
|
+
rules: input.rules
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function serializeConditionNode(condition) {
|
|
198
|
+
if (condition._tag === "leaf") {
|
|
199
|
+
return {
|
|
200
|
+
fact: condition.fact,
|
|
201
|
+
...condition.path ? { path: condition.path } : {},
|
|
202
|
+
operator: condition.operator,
|
|
203
|
+
value: condition.value
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
if (condition.mode === "all") {
|
|
207
|
+
return { all: condition.conditions.map(serializeConditionNode) };
|
|
208
|
+
}
|
|
209
|
+
return { any: condition.conditions.map(serializeConditionNode) };
|
|
210
|
+
}
|
|
211
|
+
function serializeOutcome(outcome) {
|
|
212
|
+
if (outcome._tag === "skip")
|
|
213
|
+
return { type: "skip", params: null };
|
|
214
|
+
return { type: "assign", params: { pipelineKey: outcome.pipelineKey } };
|
|
215
|
+
}
|
|
216
|
+
function serializeAssignmentRule(rule) {
|
|
217
|
+
const { type, params } = serializeOutcome(rule.outcome);
|
|
218
|
+
return {
|
|
219
|
+
conditions: { [rule.mode]: rule.conditions.map(serializeConditionNode) },
|
|
220
|
+
event: { type, ...params ? { params } : {} }
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function serializeDefaultPipelineAssignment2(spec) {
|
|
224
|
+
let primaryKey = null;
|
|
225
|
+
if (spec.default._tag === "assign") {
|
|
226
|
+
primaryKey = spec.default.pipelineKey;
|
|
227
|
+
} else {
|
|
228
|
+
for (const rule of spec.rules) {
|
|
229
|
+
if (rule.outcome._tag === "assign") {
|
|
230
|
+
primaryKey = rule.outcome.pipelineKey;
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (primaryKey === null) {
|
|
236
|
+
throw new Error("defaultPipelineAssignment must contain at least one assign() outcome " + "(in `default` or in `rules`). A policy that only skips is not useful.");
|
|
237
|
+
}
|
|
238
|
+
const { type: defaultType, params: defaultParams } = serializeOutcome(spec.default);
|
|
239
|
+
const outcomeSet = new Set([defaultType]);
|
|
240
|
+
const serializedRules = spec.rules.map((rule) => {
|
|
241
|
+
outcomeSet.add(serializeOutcome(rule.outcome).type);
|
|
242
|
+
return serializeAssignmentRule(rule);
|
|
243
|
+
});
|
|
244
|
+
return {
|
|
245
|
+
pipelineDefinitionKey: primaryKey,
|
|
246
|
+
rulesJson: { rules: serializedRules },
|
|
247
|
+
defaultEventType: defaultType,
|
|
248
|
+
defaultEventParamsJson: defaultParams,
|
|
249
|
+
allowedEventTypes: [...outcomeSet]
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function isDefaultPipelineAssignmentSpec2(value) {
|
|
253
|
+
if (typeof value !== "object" || value === null)
|
|
254
|
+
return false;
|
|
255
|
+
return value["_tag"] === "default_pipeline_assignment";
|
|
256
|
+
}
|
|
257
|
+
export { PipelineDefinitionsApiError2, createPipelineDefinitionsClient2, WORK_ITEM_TOP_LEVEL_FIELDS2, WORK_ITEM_FIELDS_PATH_PREFIX2, resolveWorkItemFieldPath2, DEFAULT_PIPELINE_ASSIGNMENT_FILENAME2, defaultPipelineAssignment2, serializeDefaultPipelineAssignment2, isDefaultPipelineAssignmentSpec2 };
|