@kb-labs/workflow-contracts 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +359 -0
- package/dist/index.d.ts +7631 -0
- package/dist/index.js +849 -0
- package/dist/index.js.map +1 -0
- package/examples/ai-ci.yml +22 -0
- package/examples/conditional-deployment.yml +46 -0
- package/examples/nested-workflow.yml +25 -0
- package/examples/plugin-audit-workflow.yml +44 -0
- package/examples/plugin-release-workflow.yml +36 -0
- package/examples/plugin-workflow-example.yml +25 -0
- package/examples/workflow-with-hooks.yml +46 -0
- package/package.json +52 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,849 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { RUN_STATES, JOB_STATES, STEP_STATES, JOB_PRIORITIES } from '@kb-labs/workflow-constants';
|
|
3
|
+
import { defineFlags } from '@kb-labs/sdk';
|
|
4
|
+
|
|
5
|
+
// src/schemas.ts
|
|
6
|
+
var RUN_STATE_VALUES = RUN_STATES;
|
|
7
|
+
var JOB_STATE_VALUES = JOB_STATES;
|
|
8
|
+
var STEP_STATE_VALUES = STEP_STATES;
|
|
9
|
+
var RunStateSchema = z.enum(RUN_STATE_VALUES);
|
|
10
|
+
var JobStateSchema = z.enum(JOB_STATE_VALUES);
|
|
11
|
+
var StepStateSchema = z.enum(STEP_STATE_VALUES);
|
|
12
|
+
var IdempotencyKeySchema = z.string().min(1).max(256);
|
|
13
|
+
var ConcurrencyGroupSchema = z.string().min(1).max(256);
|
|
14
|
+
var TenantIdSchema = z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/).describe("Tenant identifier").optional();
|
|
15
|
+
var RetryModeSchema = z.enum(["exp", "lin"]);
|
|
16
|
+
var RetryPolicySchema = z.object({
|
|
17
|
+
max: z.number().int().nonnegative(),
|
|
18
|
+
backoff: RetryModeSchema.default("exp"),
|
|
19
|
+
initialIntervalMs: z.number().int().positive().default(1e3),
|
|
20
|
+
maxIntervalMs: z.number().int().positive().optional()
|
|
21
|
+
});
|
|
22
|
+
var TimeoutSchema = z.number().int().positive().max(1e3 * 60 * 60 * 24);
|
|
23
|
+
var ExecutionTargetSchema = z.object({
|
|
24
|
+
environmentId: z.string().min(1).optional(),
|
|
25
|
+
workspaceId: z.string().min(1).optional(),
|
|
26
|
+
namespace: z.string().min(1).optional(),
|
|
27
|
+
workdir: z.string().min(1).optional()
|
|
28
|
+
});
|
|
29
|
+
var IsolationProfileSchema = z.enum(["strict", "balanced", "relaxed"]);
|
|
30
|
+
var PhaseSchema = z.object({
|
|
31
|
+
label: z.string().min(1),
|
|
32
|
+
description: z.string().optional()
|
|
33
|
+
});
|
|
34
|
+
var StepProgressSchema = z.object({
|
|
35
|
+
source: z.string().min(1),
|
|
36
|
+
format: z.string().min(1)
|
|
37
|
+
});
|
|
38
|
+
var StepArtifactSchema = z.object({
|
|
39
|
+
type: z.enum(["markdown", "issues", "table", "diff", "log", "json", "link"]),
|
|
40
|
+
source: z.string().min(1),
|
|
41
|
+
label: z.string().min(1),
|
|
42
|
+
digest: z.string().optional(),
|
|
43
|
+
showInSummary: z.boolean().optional()
|
|
44
|
+
});
|
|
45
|
+
var ApprovalReviewItemSchema = z.object({
|
|
46
|
+
artifact: z.string().min(1),
|
|
47
|
+
editable: z.boolean().optional(),
|
|
48
|
+
decisions: z.boolean().optional()
|
|
49
|
+
});
|
|
50
|
+
var StepSpecSchema = z.object({
|
|
51
|
+
name: z.string().min(1),
|
|
52
|
+
uses: z.union([
|
|
53
|
+
z.literal("builtin:shell"),
|
|
54
|
+
z.literal("builtin:approval"),
|
|
55
|
+
z.literal("builtin:gate"),
|
|
56
|
+
z.string().regex(/^(plugin:|workflow:)?[a-zA-Z0-9@/_:+#.-]+$/)
|
|
57
|
+
]).optional(),
|
|
58
|
+
id: z.string().min(1).max(64).regex(/^[a-zA-Z0-9_-]+$/).optional(),
|
|
59
|
+
if: z.string().optional(),
|
|
60
|
+
with: z.record(z.string(), z.unknown()).optional(),
|
|
61
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
62
|
+
secrets: z.array(z.string().min(1)).optional(),
|
|
63
|
+
timeoutMs: TimeoutSchema.optional(),
|
|
64
|
+
continueOnError: z.boolean().optional(),
|
|
65
|
+
// Presentation layer
|
|
66
|
+
summary: z.string().optional(),
|
|
67
|
+
phase: z.string().optional(),
|
|
68
|
+
progress: StepProgressSchema.optional(),
|
|
69
|
+
artifacts: z.record(z.string().min(1), StepArtifactSchema).optional()
|
|
70
|
+
});
|
|
71
|
+
var JobConcurrencySchema = z.object({
|
|
72
|
+
group: ConcurrencyGroupSchema,
|
|
73
|
+
cancelInProgress: z.boolean().optional()
|
|
74
|
+
});
|
|
75
|
+
var ArtifactMergeStrategySchema = z.enum(["append", "overwrite", "json-merge"]);
|
|
76
|
+
var ArtifactMergeSourceSchema = z.object({
|
|
77
|
+
runId: z.string().min(1),
|
|
78
|
+
jobId: z.string().min(1).optional()
|
|
79
|
+
});
|
|
80
|
+
var ArtifactMergeConfigSchema = z.object({
|
|
81
|
+
strategy: ArtifactMergeStrategySchema,
|
|
82
|
+
from: z.array(ArtifactMergeSourceSchema).min(1)
|
|
83
|
+
});
|
|
84
|
+
var JobArtifactsSchema = z.object({
|
|
85
|
+
produce: z.array(z.string().min(1)).optional(),
|
|
86
|
+
consume: z.array(z.string().min(1)).optional(),
|
|
87
|
+
merge: ArtifactMergeConfigSchema.optional()
|
|
88
|
+
}).optional();
|
|
89
|
+
var JobHooksSchema = z.object({
|
|
90
|
+
pre: z.array(StepSpecSchema).optional(),
|
|
91
|
+
post: z.array(StepSpecSchema).optional(),
|
|
92
|
+
onFailure: z.array(StepSpecSchema).optional(),
|
|
93
|
+
onSuccess: z.array(StepSpecSchema).optional()
|
|
94
|
+
}).optional();
|
|
95
|
+
var JobSpecSchema = z.object({
|
|
96
|
+
runsOn: z.enum(["local", "sandbox"]),
|
|
97
|
+
target: ExecutionTargetSchema.optional(),
|
|
98
|
+
isolation: IsolationProfileSchema.optional(),
|
|
99
|
+
concurrency: JobConcurrencySchema.optional(),
|
|
100
|
+
steps: z.array(StepSpecSchema).min(1),
|
|
101
|
+
artifacts: JobArtifactsSchema,
|
|
102
|
+
hooks: JobHooksSchema,
|
|
103
|
+
if: z.string().optional(),
|
|
104
|
+
timeoutMs: TimeoutSchema.optional(),
|
|
105
|
+
retries: RetryPolicySchema.optional(),
|
|
106
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
107
|
+
secrets: z.array(z.string().min(1)).optional(),
|
|
108
|
+
needs: z.array(z.string().min(1)).optional(),
|
|
109
|
+
priority: z.enum(["high", "normal", "low"]).optional()
|
|
110
|
+
});
|
|
111
|
+
var WorkflowTriggerSchema = z.object({
|
|
112
|
+
manual: z.boolean().optional(),
|
|
113
|
+
push: z.boolean().optional(),
|
|
114
|
+
webhook: z.union([
|
|
115
|
+
z.boolean(),
|
|
116
|
+
z.object({
|
|
117
|
+
secret: z.string().min(1).optional(),
|
|
118
|
+
path: z.string().min(1).optional(),
|
|
119
|
+
headers: z.record(z.string(), z.string()).optional()
|
|
120
|
+
})
|
|
121
|
+
]).optional(),
|
|
122
|
+
schedule: z.object({
|
|
123
|
+
cron: z.string().min(1),
|
|
124
|
+
timezone: z.string().min(1).optional()
|
|
125
|
+
}).optional()
|
|
126
|
+
}).refine(
|
|
127
|
+
(value) => value.manual || value.push || !!value.webhook || !!value.schedule,
|
|
128
|
+
{
|
|
129
|
+
message: "At least one trigger must be defined",
|
|
130
|
+
path: ["manual"]
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
var WorkflowInputFieldSchema = z.object({
|
|
134
|
+
type: z.enum(["string", "number", "boolean"]),
|
|
135
|
+
description: z.string().optional(),
|
|
136
|
+
required: z.boolean().optional(),
|
|
137
|
+
default: z.unknown().optional()
|
|
138
|
+
});
|
|
139
|
+
var WorkflowSpecSchema = z.object({
|
|
140
|
+
name: z.string().min(1),
|
|
141
|
+
version: z.string().min(1),
|
|
142
|
+
description: z.string().optional(),
|
|
143
|
+
target: ExecutionTargetSchema.optional(),
|
|
144
|
+
isolation: IsolationProfileSchema.optional(),
|
|
145
|
+
on: WorkflowTriggerSchema,
|
|
146
|
+
inputs: z.record(z.string(), WorkflowInputFieldSchema).optional(),
|
|
147
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
148
|
+
secrets: z.array(z.string().min(1)).optional(),
|
|
149
|
+
jobs: z.record(z.string().min(1), JobSpecSchema),
|
|
150
|
+
// Presentation layer
|
|
151
|
+
phases: z.record(z.string().min(1), PhaseSchema).optional()
|
|
152
|
+
}).refine(
|
|
153
|
+
(value) => Object.keys(value.jobs).length > 0 && Object.keys(value.jobs).every((key) => key.trim().length > 0),
|
|
154
|
+
{
|
|
155
|
+
message: "At least one job must be defined with a non-empty id",
|
|
156
|
+
path: ["jobs"]
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
var StepRunErrorSchema = z.object({
|
|
160
|
+
message: z.string(),
|
|
161
|
+
code: z.string().optional(),
|
|
162
|
+
stack: z.string().optional(),
|
|
163
|
+
timestamp: z.string().optional(),
|
|
164
|
+
details: z.record(z.string(), z.unknown()).optional()
|
|
165
|
+
});
|
|
166
|
+
var StepRunSchema = z.object({
|
|
167
|
+
id: z.string().min(1),
|
|
168
|
+
runId: z.string().min(1),
|
|
169
|
+
jobId: z.string().min(1),
|
|
170
|
+
name: z.string().min(1),
|
|
171
|
+
index: z.number().int().nonnegative(),
|
|
172
|
+
status: StepStateSchema,
|
|
173
|
+
queuedAt: z.string().datetime(),
|
|
174
|
+
startedAt: z.string().datetime().optional(),
|
|
175
|
+
finishedAt: z.string().datetime().optional(),
|
|
176
|
+
durationMs: z.number().int().nonnegative().optional(),
|
|
177
|
+
attempt: z.number().int().nonnegative().default(0),
|
|
178
|
+
timeoutMs: TimeoutSchema.optional(),
|
|
179
|
+
continueOnError: z.boolean().optional(),
|
|
180
|
+
error: StepRunErrorSchema.optional(),
|
|
181
|
+
outputs: z.record(z.string(), z.unknown()).optional(),
|
|
182
|
+
skipReason: z.string().optional(),
|
|
183
|
+
spec: StepSpecSchema
|
|
184
|
+
});
|
|
185
|
+
var JobRunSchema = z.object({
|
|
186
|
+
id: z.string().min(1),
|
|
187
|
+
runId: z.string().min(1),
|
|
188
|
+
tenantId: TenantIdSchema,
|
|
189
|
+
// ← Inherited from run for isolation
|
|
190
|
+
jobName: z.string().min(1),
|
|
191
|
+
status: JobStateSchema,
|
|
192
|
+
runsOn: z.enum(["local", "sandbox"]),
|
|
193
|
+
queuedAt: z.string().datetime(),
|
|
194
|
+
startedAt: z.string().datetime().optional(),
|
|
195
|
+
finishedAt: z.string().datetime().optional(),
|
|
196
|
+
durationMs: z.number().int().nonnegative().optional(),
|
|
197
|
+
attempt: z.number().int().nonnegative().default(0),
|
|
198
|
+
concurrency: JobConcurrencySchema.optional(),
|
|
199
|
+
retries: RetryPolicySchema.optional(),
|
|
200
|
+
timeoutMs: TimeoutSchema.optional(),
|
|
201
|
+
target: ExecutionTargetSchema.optional(),
|
|
202
|
+
isolation: IsolationProfileSchema.optional(),
|
|
203
|
+
artifacts: JobArtifactsSchema,
|
|
204
|
+
error: StepRunErrorSchema.optional(),
|
|
205
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
206
|
+
secrets: z.array(z.string().min(1)).optional(),
|
|
207
|
+
needs: z.array(z.string().min(1)).optional(),
|
|
208
|
+
pendingDependencies: z.array(z.string().min(1)).optional(),
|
|
209
|
+
blocked: z.boolean().optional(),
|
|
210
|
+
priority: z.enum(["high", "normal", "low"]).optional(),
|
|
211
|
+
steps: z.array(StepRunSchema)
|
|
212
|
+
});
|
|
213
|
+
var RunTriggerSchema = z.object({
|
|
214
|
+
type: z.enum(["manual", "webhook", "push", "schedule", "workflow"]),
|
|
215
|
+
actor: z.string().optional(),
|
|
216
|
+
payload: z.record(z.string(), z.unknown()).optional(),
|
|
217
|
+
parentRunId: z.string().optional(),
|
|
218
|
+
parentJobId: z.string().optional(),
|
|
219
|
+
parentStepId: z.string().optional(),
|
|
220
|
+
invokedByWorkflowId: z.string().optional()
|
|
221
|
+
});
|
|
222
|
+
var RunMetadataSchema = z.object({
|
|
223
|
+
idempotencyKey: IdempotencyKeySchema.optional(),
|
|
224
|
+
concurrencyGroup: ConcurrencyGroupSchema.optional(),
|
|
225
|
+
target: ExecutionTargetSchema.optional(),
|
|
226
|
+
isolation: IsolationProfileSchema.optional(),
|
|
227
|
+
workflowId: z.string().optional(),
|
|
228
|
+
workflowDepth: z.number().int().nonnegative().optional(),
|
|
229
|
+
parentRunId: z.string().optional(),
|
|
230
|
+
parentJobId: z.string().optional(),
|
|
231
|
+
parentStepId: z.string().optional()
|
|
232
|
+
});
|
|
233
|
+
var ResultErrorSchema = z.object({
|
|
234
|
+
message: z.string().min(1),
|
|
235
|
+
code: z.string().optional(),
|
|
236
|
+
details: z.record(z.string(), z.unknown()).optional()
|
|
237
|
+
});
|
|
238
|
+
var ResultMetricsSchema = z.object({
|
|
239
|
+
timeMs: z.number().int().nonnegative().optional(),
|
|
240
|
+
cpuMs: z.number().int().nonnegative().optional(),
|
|
241
|
+
memMb: z.number().nonnegative().optional(),
|
|
242
|
+
jobsTotal: z.number().int().nonnegative().optional(),
|
|
243
|
+
jobsSucceeded: z.number().int().nonnegative().optional(),
|
|
244
|
+
jobsFailed: z.number().int().nonnegative().optional(),
|
|
245
|
+
jobsCancelled: z.number().int().nonnegative().optional(),
|
|
246
|
+
stepsTotal: z.number().int().nonnegative().optional(),
|
|
247
|
+
stepsFailed: z.number().int().nonnegative().optional(),
|
|
248
|
+
stepsCancelled: z.number().int().nonnegative().optional()
|
|
249
|
+
});
|
|
250
|
+
var ExecutionResultSchema = z.object({
|
|
251
|
+
status: RunStateSchema,
|
|
252
|
+
summary: z.string().optional(),
|
|
253
|
+
startedAt: z.string().datetime().optional(),
|
|
254
|
+
completedAt: z.string().datetime().optional(),
|
|
255
|
+
metrics: ResultMetricsSchema.optional(),
|
|
256
|
+
details: z.record(z.string(), z.unknown()).optional(),
|
|
257
|
+
outputs: z.record(z.string(), z.unknown()).optional(),
|
|
258
|
+
error: ResultErrorSchema.optional()
|
|
259
|
+
});
|
|
260
|
+
var RunSchema = z.object({
|
|
261
|
+
id: z.string().min(1),
|
|
262
|
+
tenantId: TenantIdSchema,
|
|
263
|
+
// ← Multi-tenancy support
|
|
264
|
+
name: z.string().min(1),
|
|
265
|
+
version: z.string().min(1),
|
|
266
|
+
status: RunStateSchema,
|
|
267
|
+
createdAt: z.string().datetime(),
|
|
268
|
+
queuedAt: z.string().datetime(),
|
|
269
|
+
startedAt: z.string().datetime().optional(),
|
|
270
|
+
finishedAt: z.string().datetime().optional(),
|
|
271
|
+
durationMs: z.number().int().nonnegative().optional(),
|
|
272
|
+
trigger: RunTriggerSchema,
|
|
273
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
274
|
+
secrets: z.array(z.string().min(1)).optional(),
|
|
275
|
+
jobs: z.array(JobRunSchema),
|
|
276
|
+
artifacts: z.array(z.string()).optional(),
|
|
277
|
+
metadata: RunMetadataSchema.optional(),
|
|
278
|
+
result: ExecutionResultSchema.optional()
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
// src/expressions.ts
|
|
282
|
+
function parseWorkflowUses(uses) {
|
|
283
|
+
if (!uses.startsWith("workflow:")) {
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
const workflowId = uses.slice("workflow:".length);
|
|
287
|
+
if (!workflowId) {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
return {
|
|
291
|
+
type: "workflow",
|
|
292
|
+
workflowId,
|
|
293
|
+
mode: "wait",
|
|
294
|
+
// default
|
|
295
|
+
inheritEnv: true
|
|
296
|
+
// default
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function extractExpressions(str) {
|
|
300
|
+
const pattern = /\$\{\{\s*([^}]+)\s*\}\}/g;
|
|
301
|
+
const matches = [];
|
|
302
|
+
let match;
|
|
303
|
+
while ((match = pattern.exec(str)) !== null) {
|
|
304
|
+
matches.push(match[1].trim());
|
|
305
|
+
}
|
|
306
|
+
return matches;
|
|
307
|
+
}
|
|
308
|
+
function evaluateExpression(expr, context) {
|
|
309
|
+
const trimmed = expr.trim();
|
|
310
|
+
if (trimmed.includes("&&")) {
|
|
311
|
+
const parts = trimmed.split("&&").map((p) => p.trim());
|
|
312
|
+
return parts.every((part) => evaluateExpression(part, context));
|
|
313
|
+
}
|
|
314
|
+
if (trimmed.includes("||")) {
|
|
315
|
+
const parts = trimmed.split("||").map((p) => p.trim());
|
|
316
|
+
return parts.some((part) => evaluateExpression(part, context));
|
|
317
|
+
}
|
|
318
|
+
if (trimmed.startsWith("!")) {
|
|
319
|
+
return !evaluateExpression(trimmed.slice(1).trim(), context);
|
|
320
|
+
}
|
|
321
|
+
if (trimmed.startsWith("(") && trimmed.endsWith(")")) {
|
|
322
|
+
return evaluateExpression(trimmed.slice(1, -1).trim(), context);
|
|
323
|
+
}
|
|
324
|
+
if (trimmed === "true") {
|
|
325
|
+
return true;
|
|
326
|
+
}
|
|
327
|
+
if (trimmed === "false") {
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
330
|
+
if (trimmed.includes("==")) {
|
|
331
|
+
const parts = trimmed.split("==").map((s) => s.trim());
|
|
332
|
+
if (parts.length === 2 && parts[0] && parts[1]) {
|
|
333
|
+
const left = resolveValue(parts[0], context);
|
|
334
|
+
const right = resolveValue(parts[1], context);
|
|
335
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
336
|
+
return left === right;
|
|
337
|
+
}
|
|
338
|
+
return coerceToString(left) === coerceToString(right);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (trimmed.includes("!=")) {
|
|
342
|
+
const parts = trimmed.split("!=").map((s) => s.trim());
|
|
343
|
+
if (parts.length === 2 && parts[0] && parts[1]) {
|
|
344
|
+
const left = resolveValue(parts[0], context);
|
|
345
|
+
const right = resolveValue(parts[1], context);
|
|
346
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
347
|
+
return left !== right;
|
|
348
|
+
}
|
|
349
|
+
return coerceToString(left) !== coerceToString(right);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (trimmed.includes("contains(")) {
|
|
353
|
+
const match = trimmed.match(/contains\(([^,]+),\s*([^)]+)\)/);
|
|
354
|
+
if (match && match[1] && match[2]) {
|
|
355
|
+
const value2 = resolveValue(match[1].trim(), context);
|
|
356
|
+
const search = match[2].trim().replace(/^["']|["']$/g, "");
|
|
357
|
+
return String(value2).includes(search);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (trimmed.includes("startsWith(")) {
|
|
361
|
+
const match = trimmed.match(/startsWith\(([^,]+),\s*([^)]+)\)/);
|
|
362
|
+
if (match && match[1] && match[2]) {
|
|
363
|
+
const value2 = resolveValue(match[1].trim(), context);
|
|
364
|
+
const prefix = match[2].trim().replace(/^["']|["']$/g, "");
|
|
365
|
+
return String(value2).startsWith(prefix);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
if (trimmed.includes("endsWith(")) {
|
|
369
|
+
const match = trimmed.match(/endsWith\(([^,]+),\s*([^)]+)\)/);
|
|
370
|
+
if (match && match[1] && match[2]) {
|
|
371
|
+
const value2 = resolveValue(match[1].trim(), context);
|
|
372
|
+
const suffix = match[2].trim().replace(/^["']|["']$/g, "");
|
|
373
|
+
return String(value2).endsWith(suffix);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
const value = resolveValue(trimmed, context);
|
|
377
|
+
return Boolean(value);
|
|
378
|
+
}
|
|
379
|
+
function resolveValue(path, context) {
|
|
380
|
+
const cleanPath = path.replace(/^["']|["']$/g, "");
|
|
381
|
+
if (cleanPath.startsWith("env.")) {
|
|
382
|
+
const key = cleanPath.slice("env.".length);
|
|
383
|
+
return context.env[key] ?? "";
|
|
384
|
+
}
|
|
385
|
+
if (cleanPath.startsWith("trigger.")) {
|
|
386
|
+
const key = cleanPath.slice("trigger.".length);
|
|
387
|
+
if (key === "type") {
|
|
388
|
+
return context.trigger.type;
|
|
389
|
+
}
|
|
390
|
+
if (key === "actor") {
|
|
391
|
+
return context.trigger.actor ?? "";
|
|
392
|
+
}
|
|
393
|
+
if (key.startsWith("payload.")) {
|
|
394
|
+
const payloadKey = key.slice("payload.".length);
|
|
395
|
+
return context.trigger.payload?.[payloadKey] ?? "";
|
|
396
|
+
}
|
|
397
|
+
return "";
|
|
398
|
+
}
|
|
399
|
+
if (cleanPath.startsWith("steps.")) {
|
|
400
|
+
const rest = cleanPath.slice("steps.".length);
|
|
401
|
+
const match = rest.match(/^([^.]+)\.outputs\.(.+)$/);
|
|
402
|
+
if (match) {
|
|
403
|
+
const stepId = match[1];
|
|
404
|
+
const outputKey = match[2];
|
|
405
|
+
const outputs = context.steps[stepId]?.outputs;
|
|
406
|
+
if (outputs === void 0) return "";
|
|
407
|
+
const parts = outputKey.split(".");
|
|
408
|
+
let value = outputs;
|
|
409
|
+
for (const part of parts) {
|
|
410
|
+
if (value === void 0 || value === null || typeof value !== "object") return "";
|
|
411
|
+
value = value[part];
|
|
412
|
+
}
|
|
413
|
+
return value !== void 0 ? value : "";
|
|
414
|
+
}
|
|
415
|
+
return "";
|
|
416
|
+
}
|
|
417
|
+
if (cleanPath.startsWith("matrix.") && context.matrix) {
|
|
418
|
+
const key = cleanPath.slice("matrix.".length);
|
|
419
|
+
return context.matrix[key] ?? "";
|
|
420
|
+
}
|
|
421
|
+
const num = Number(cleanPath);
|
|
422
|
+
if (!isNaN(num) && isFinite(num)) {
|
|
423
|
+
return num;
|
|
424
|
+
}
|
|
425
|
+
if (cleanPath === "true") {
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
if (cleanPath === "false") {
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
return cleanPath;
|
|
432
|
+
}
|
|
433
|
+
function coerceToString(value) {
|
|
434
|
+
if (value === null || value === void 0) {
|
|
435
|
+
return "";
|
|
436
|
+
}
|
|
437
|
+
if (typeof value === "boolean") {
|
|
438
|
+
return value ? "true" : "false";
|
|
439
|
+
}
|
|
440
|
+
return String(value);
|
|
441
|
+
}
|
|
442
|
+
function interpolateString(str, context) {
|
|
443
|
+
const expressions = extractExpressions(str);
|
|
444
|
+
let result = str;
|
|
445
|
+
for (const expr of expressions) {
|
|
446
|
+
const value = resolveValueWithFallback(expr, context);
|
|
447
|
+
const replacement = coerceToString(value);
|
|
448
|
+
const pattern = new RegExp(
|
|
449
|
+
`\\$\\{\\{\\s*${escapeRegex(expr)}\\s*\\}\\}`,
|
|
450
|
+
"g"
|
|
451
|
+
);
|
|
452
|
+
result = result.replace(pattern, replacement);
|
|
453
|
+
}
|
|
454
|
+
return result;
|
|
455
|
+
}
|
|
456
|
+
function escapeRegex(str) {
|
|
457
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
458
|
+
}
|
|
459
|
+
function resolveValueWithFallback(expr, context) {
|
|
460
|
+
const parts = splitOnOperator(expr, "||");
|
|
461
|
+
if (parts.length === 1) {
|
|
462
|
+
return resolveValue(parts[0].trim(), context);
|
|
463
|
+
}
|
|
464
|
+
for (let i = 0; i < parts.length; i++) {
|
|
465
|
+
const value = resolveValue(parts[i].trim(), context);
|
|
466
|
+
if (isTruthy(value)) {
|
|
467
|
+
return value;
|
|
468
|
+
}
|
|
469
|
+
if (i === parts.length - 1) {
|
|
470
|
+
return value;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
return "";
|
|
474
|
+
}
|
|
475
|
+
function splitOnOperator(expr, op) {
|
|
476
|
+
const parts = [];
|
|
477
|
+
let current = "";
|
|
478
|
+
let inSingle = false;
|
|
479
|
+
let inDouble = false;
|
|
480
|
+
let i = 0;
|
|
481
|
+
while (i < expr.length) {
|
|
482
|
+
const ch = expr[i];
|
|
483
|
+
if (ch === "'" && !inDouble) {
|
|
484
|
+
inSingle = !inSingle;
|
|
485
|
+
current += ch;
|
|
486
|
+
i++;
|
|
487
|
+
} else if (ch === '"' && !inSingle) {
|
|
488
|
+
inDouble = !inDouble;
|
|
489
|
+
current += ch;
|
|
490
|
+
i++;
|
|
491
|
+
} else if (!inSingle && !inDouble && expr.slice(i, i + op.length) === op) {
|
|
492
|
+
parts.push(current);
|
|
493
|
+
current = "";
|
|
494
|
+
i += op.length;
|
|
495
|
+
} else {
|
|
496
|
+
current += ch;
|
|
497
|
+
i++;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
parts.push(current);
|
|
501
|
+
return parts;
|
|
502
|
+
}
|
|
503
|
+
function isTruthy(value) {
|
|
504
|
+
if (value === "" || value === null || value === void 0 || value === false || value === 0) {
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
function resolveExpression(str, context) {
|
|
510
|
+
const trimmed = str.trim();
|
|
511
|
+
const singleExprMatch = trimmed.match(/^\$\{\{\s*([^}]+)\s*\}\}$/);
|
|
512
|
+
if (singleExprMatch && singleExprMatch[1]) {
|
|
513
|
+
return resolveValueWithFallback(singleExprMatch[1].trim(), context);
|
|
514
|
+
}
|
|
515
|
+
if (trimmed.includes("${{")) {
|
|
516
|
+
return interpolateString(trimmed, context);
|
|
517
|
+
}
|
|
518
|
+
return str;
|
|
519
|
+
}
|
|
520
|
+
function interpolateObject(obj, context) {
|
|
521
|
+
const result = {};
|
|
522
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
523
|
+
result[key] = interpolateValue(value, context);
|
|
524
|
+
}
|
|
525
|
+
return result;
|
|
526
|
+
}
|
|
527
|
+
function interpolateValue(value, context) {
|
|
528
|
+
if (typeof value === "string") {
|
|
529
|
+
return resolveExpression(value, context);
|
|
530
|
+
}
|
|
531
|
+
if (Array.isArray(value)) {
|
|
532
|
+
return value.map((item) => interpolateValue(item, context));
|
|
533
|
+
}
|
|
534
|
+
if (value !== null && typeof value === "object") {
|
|
535
|
+
return interpolateObject(value, context);
|
|
536
|
+
}
|
|
537
|
+
return value;
|
|
538
|
+
}
|
|
539
|
+
var statusFlags = defineFlags({
|
|
540
|
+
json: {
|
|
541
|
+
type: "boolean",
|
|
542
|
+
description: "Output result as JSON",
|
|
543
|
+
default: false
|
|
544
|
+
},
|
|
545
|
+
"job-id": {
|
|
546
|
+
type: "string",
|
|
547
|
+
description: "Job ID to get status for"
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
var logsFlags = defineFlags({
|
|
551
|
+
json: {
|
|
552
|
+
type: "boolean",
|
|
553
|
+
description: "Output result as JSON",
|
|
554
|
+
default: false
|
|
555
|
+
},
|
|
556
|
+
"job-id": {
|
|
557
|
+
type: "string",
|
|
558
|
+
description: "Job ID to get logs for (required)"
|
|
559
|
+
},
|
|
560
|
+
follow: {
|
|
561
|
+
type: "boolean",
|
|
562
|
+
description: "Follow log output (stream new logs)",
|
|
563
|
+
default: false
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
var metricsFlags = defineFlags({
|
|
567
|
+
json: {
|
|
568
|
+
type: "boolean",
|
|
569
|
+
description: "Output result as JSON",
|
|
570
|
+
default: false
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
var healthFlags = defineFlags({
|
|
574
|
+
json: {
|
|
575
|
+
type: "boolean",
|
|
576
|
+
description: "Output result as JSON",
|
|
577
|
+
default: false
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
var listFlags = defineFlags({
|
|
581
|
+
json: {
|
|
582
|
+
type: "boolean",
|
|
583
|
+
description: "Output result as JSON",
|
|
584
|
+
default: false
|
|
585
|
+
},
|
|
586
|
+
status: {
|
|
587
|
+
type: "string",
|
|
588
|
+
description: "Filter by status (running, completed, failed)"
|
|
589
|
+
},
|
|
590
|
+
type: {
|
|
591
|
+
type: "string",
|
|
592
|
+
description: 'Filter by type: "runs" (active executions), "cron" (scheduled jobs)'
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
var runFlags = defineFlags({
|
|
596
|
+
json: {
|
|
597
|
+
type: "boolean",
|
|
598
|
+
description: "Output result as JSON",
|
|
599
|
+
default: false
|
|
600
|
+
},
|
|
601
|
+
handler: {
|
|
602
|
+
type: "string",
|
|
603
|
+
description: 'Plugin handler to run (e.g., "mind:rag-query")'
|
|
604
|
+
},
|
|
605
|
+
input: {
|
|
606
|
+
type: "string",
|
|
607
|
+
description: "JSON string of input parameters"
|
|
608
|
+
},
|
|
609
|
+
priority: {
|
|
610
|
+
type: "number",
|
|
611
|
+
description: "Job priority (1-10, default: 5)"
|
|
612
|
+
},
|
|
613
|
+
wait: {
|
|
614
|
+
type: "boolean",
|
|
615
|
+
description: "Wait for job completion",
|
|
616
|
+
default: false
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
var JOB_PRIORITY_VALUES = JOB_PRIORITIES;
|
|
620
|
+
var CronScheduleSchema = z.string().regex(
|
|
621
|
+
/^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|\*\/([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])) (\*|([0-9]|1[0-9]|2[0-3])|\*\/([0-9]|1[0-9]|2[0-3])) (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])|\*\/([1-9]|1[0-9]|2[0-9]|3[0-1])) (\*|([1-9]|1[0-2])|\*\/([1-9]|1[0-2])) (\*|[0-6]|\*\/[0-6])$/,
|
|
622
|
+
"Invalid cron expression"
|
|
623
|
+
).describe("Cron schedule expression");
|
|
624
|
+
var PluginCronJobSchema = z.object({
|
|
625
|
+
id: z.string().min(1).max(64).describe("Unique cron job identifier"),
|
|
626
|
+
schedule: CronScheduleSchema,
|
|
627
|
+
handler: z.string().min(1).describe('Plugin handler (e.g., "mind:rag-index")'),
|
|
628
|
+
input: z.record(z.string(), z.unknown()).optional().describe("Input parameters for handler"),
|
|
629
|
+
priority: z.enum(JOB_PRIORITY_VALUES).default("normal"),
|
|
630
|
+
enabled: z.boolean().default(true).describe("Whether cron job is enabled"),
|
|
631
|
+
timezone: z.string().optional().describe("Timezone for schedule (default: UTC)"),
|
|
632
|
+
metadata: z.record(z.string(), z.unknown()).optional().describe("Additional metadata")
|
|
633
|
+
});
|
|
634
|
+
var UserCronJobSchema = z.object({
|
|
635
|
+
name: z.string().min(1).describe("Human-readable job name"),
|
|
636
|
+
schedule: CronScheduleSchema,
|
|
637
|
+
autoStart: z.boolean().default(true).describe("Auto-start on daemon boot"),
|
|
638
|
+
priority: z.enum(JOB_PRIORITY_VALUES).default("normal"),
|
|
639
|
+
enabled: z.boolean().default(true).describe("Whether cron job is enabled"),
|
|
640
|
+
timezone: z.string().optional().describe("Timezone for schedule (default: UTC)"),
|
|
641
|
+
env: z.record(z.string(), z.string()).optional().describe("Environment variables"),
|
|
642
|
+
jobs: z.record(z.string(), z.any()).describe("Workflow jobs specification"),
|
|
643
|
+
metadata: z.record(z.string(), z.unknown()).optional().describe("Additional metadata")
|
|
644
|
+
});
|
|
645
|
+
var CronExecutionSchema = z.object({
|
|
646
|
+
cronJobId: z.string(),
|
|
647
|
+
runId: z.string().describe("Workflow run ID"),
|
|
648
|
+
scheduledAt: z.string().datetime().describe("When execution was scheduled"),
|
|
649
|
+
startedAt: z.string().datetime().optional().describe("When execution started"),
|
|
650
|
+
finishedAt: z.string().datetime().optional().describe("When execution finished"),
|
|
651
|
+
status: z.enum(["pending", "running", "success", "failed"]),
|
|
652
|
+
error: z.object({
|
|
653
|
+
message: z.string(),
|
|
654
|
+
stack: z.string().optional()
|
|
655
|
+
}).optional()
|
|
656
|
+
});
|
|
657
|
+
var JobStatusSchema = z.enum([
|
|
658
|
+
"pending",
|
|
659
|
+
"running",
|
|
660
|
+
"completed",
|
|
661
|
+
"failed",
|
|
662
|
+
"cancelled"
|
|
663
|
+
]);
|
|
664
|
+
var JobStatusInfoSchema = z.object({
|
|
665
|
+
id: z.string(),
|
|
666
|
+
type: z.string(),
|
|
667
|
+
status: JobStatusSchema,
|
|
668
|
+
tenantId: z.string().optional(),
|
|
669
|
+
priority: z.number().optional(),
|
|
670
|
+
createdAt: z.union([z.string(), z.date()]).optional(),
|
|
671
|
+
startedAt: z.union([z.string(), z.date()]).optional(),
|
|
672
|
+
finishedAt: z.union([z.string(), z.date()]).optional(),
|
|
673
|
+
attempt: z.number().optional(),
|
|
674
|
+
maxRetries: z.number().optional(),
|
|
675
|
+
result: z.unknown().optional(),
|
|
676
|
+
error: z.string().optional(),
|
|
677
|
+
progress: z.number().min(0).max(100).optional(),
|
|
678
|
+
progressMessage: z.string().optional()
|
|
679
|
+
});
|
|
680
|
+
var JobListResponseSchema = z.object({
|
|
681
|
+
jobs: z.array(JobStatusInfoSchema)
|
|
682
|
+
});
|
|
683
|
+
var JobCancelResponseSchema = z.object({
|
|
684
|
+
cancelled: z.boolean()
|
|
685
|
+
});
|
|
686
|
+
var CronInfoSchema = z.object({
|
|
687
|
+
id: z.string(),
|
|
688
|
+
schedule: z.string(),
|
|
689
|
+
jobType: z.string(),
|
|
690
|
+
timezone: z.string().optional(),
|
|
691
|
+
enabled: z.boolean(),
|
|
692
|
+
lastRun: z.union([z.string(), z.date()]).optional(),
|
|
693
|
+
nextRun: z.union([z.string(), z.date()]).optional(),
|
|
694
|
+
pluginId: z.string().optional()
|
|
695
|
+
});
|
|
696
|
+
var CronListResponseSchema = z.object({
|
|
697
|
+
crons: z.array(CronInfoSchema)
|
|
698
|
+
});
|
|
699
|
+
var WorkflowInfoSchema = z.object({
|
|
700
|
+
id: z.string(),
|
|
701
|
+
name: z.string(),
|
|
702
|
+
description: z.string().optional(),
|
|
703
|
+
source: z.enum(["manifest", "standalone"]),
|
|
704
|
+
pluginId: z.string().optional(),
|
|
705
|
+
status: z.enum(["active", "inactive"]).optional(),
|
|
706
|
+
tags: z.array(z.string()).optional()
|
|
707
|
+
});
|
|
708
|
+
var WorkflowListResponseSchema = z.object({
|
|
709
|
+
workflows: z.array(WorkflowInfoSchema)
|
|
710
|
+
});
|
|
711
|
+
var WorkflowRunRequestSchema = z.object({
|
|
712
|
+
input: z.unknown().optional(),
|
|
713
|
+
target: z.object({
|
|
714
|
+
environmentId: z.string().min(1).optional(),
|
|
715
|
+
workspaceId: z.string().min(1).optional(),
|
|
716
|
+
namespace: z.string().min(1).optional(),
|
|
717
|
+
workdir: z.string().min(1).optional()
|
|
718
|
+
}).optional(),
|
|
719
|
+
isolation: z.enum(["strict", "balanced", "relaxed"]).optional(),
|
|
720
|
+
trigger: z.object({
|
|
721
|
+
type: z.enum(["manual", "api", "cron"]),
|
|
722
|
+
user: z.string().optional()
|
|
723
|
+
}).optional()
|
|
724
|
+
});
|
|
725
|
+
var DashboardStatsResponseSchema = z.object({
|
|
726
|
+
workflows: z.object({
|
|
727
|
+
total: z.number(),
|
|
728
|
+
active: z.number(),
|
|
729
|
+
inactive: z.number()
|
|
730
|
+
}),
|
|
731
|
+
jobs: z.object({
|
|
732
|
+
running: z.number(),
|
|
733
|
+
pending: z.number(),
|
|
734
|
+
completed: z.number(),
|
|
735
|
+
failed: z.number()
|
|
736
|
+
}),
|
|
737
|
+
crons: z.object({
|
|
738
|
+
total: z.number(),
|
|
739
|
+
enabled: z.number(),
|
|
740
|
+
disabled: z.number()
|
|
741
|
+
}),
|
|
742
|
+
activeExecutions: z.array(z.object({
|
|
743
|
+
id: z.string(),
|
|
744
|
+
type: z.string(),
|
|
745
|
+
workflowName: z.string().optional(),
|
|
746
|
+
status: z.literal("running"),
|
|
747
|
+
progress: z.number().min(0).max(100).optional(),
|
|
748
|
+
progressMessage: z.string().optional(),
|
|
749
|
+
startedAt: z.string(),
|
|
750
|
+
durationMs: z.number().optional()
|
|
751
|
+
})),
|
|
752
|
+
recentActivity: z.array(z.object({
|
|
753
|
+
id: z.string(),
|
|
754
|
+
type: z.string(),
|
|
755
|
+
workflowName: z.string().optional(),
|
|
756
|
+
status: z.enum(["completed", "failed", "cancelled"]),
|
|
757
|
+
finishedAt: z.string(),
|
|
758
|
+
durationMs: z.number().optional(),
|
|
759
|
+
error: z.string().optional()
|
|
760
|
+
}))
|
|
761
|
+
});
|
|
762
|
+
var JobLogsResponseSchema = z.object({
|
|
763
|
+
jobId: z.string(),
|
|
764
|
+
logs: z.array(z.object({
|
|
765
|
+
timestamp: z.string(),
|
|
766
|
+
level: z.enum(["info", "warn", "error", "debug"]),
|
|
767
|
+
message: z.string(),
|
|
768
|
+
context: z.record(z.unknown()).optional()
|
|
769
|
+
})),
|
|
770
|
+
total: z.number(),
|
|
771
|
+
hasMore: z.boolean()
|
|
772
|
+
});
|
|
773
|
+
var JobStepInfoSchema = z.object({
|
|
774
|
+
name: z.string(),
|
|
775
|
+
handler: z.string().optional(),
|
|
776
|
+
status: z.enum(["pending", "running", "completed", "failed", "skipped"]),
|
|
777
|
+
progress: z.number().min(0).max(100).optional(),
|
|
778
|
+
startedAt: z.string().optional(),
|
|
779
|
+
finishedAt: z.string().optional(),
|
|
780
|
+
durationMs: z.number().optional(),
|
|
781
|
+
error: z.string().optional(),
|
|
782
|
+
output: z.unknown().optional()
|
|
783
|
+
});
|
|
784
|
+
var JobStepsResponseSchema = z.object({
|
|
785
|
+
jobId: z.string(),
|
|
786
|
+
workflowName: z.string().optional(),
|
|
787
|
+
status: z.enum(["pending", "running", "completed", "failed", "cancelled"]),
|
|
788
|
+
steps: z.array(JobStepInfoSchema),
|
|
789
|
+
currentStep: z.number().optional()
|
|
790
|
+
});
|
|
791
|
+
var WorkflowRunInfoSchema = z.object({
|
|
792
|
+
id: z.string(),
|
|
793
|
+
workflowId: z.string(),
|
|
794
|
+
status: z.enum(["pending", "running", "completed", "failed", "cancelled"]),
|
|
795
|
+
trigger: z.object({
|
|
796
|
+
type: z.enum(["manual", "api", "cron"]),
|
|
797
|
+
user: z.string().optional()
|
|
798
|
+
}),
|
|
799
|
+
startedAt: z.string(),
|
|
800
|
+
finishedAt: z.string().optional(),
|
|
801
|
+
durationMs: z.number().optional(),
|
|
802
|
+
error: z.string().optional()
|
|
803
|
+
});
|
|
804
|
+
var WorkflowRunHistoryResponseSchema = z.object({
|
|
805
|
+
workflowId: z.string(),
|
|
806
|
+
runs: z.array(WorkflowRunInfoSchema),
|
|
807
|
+
total: z.number()
|
|
808
|
+
});
|
|
809
|
+
|
|
810
|
+
// src/routes.ts
|
|
811
|
+
var WORKFLOW_BASE_PATH = "/plugins/workflow";
|
|
812
|
+
var WORKFLOW_ROUTES = {
|
|
813
|
+
/** GET /stats - Dashboard statistics */
|
|
814
|
+
STATS: "/stats",
|
|
815
|
+
/** GET /workflows - List all workflow definitions */
|
|
816
|
+
WORKFLOWS: "/workflows",
|
|
817
|
+
/** GET /workflows/:id - Get workflow definition details */
|
|
818
|
+
WORKFLOW_DETAIL: "/workflows/:id",
|
|
819
|
+
/** POST /workflows/:id/run - Run a workflow */
|
|
820
|
+
WORKFLOW_RUN: "/workflows/:id/run",
|
|
821
|
+
/** GET /workflows/:id/runs - Get workflow run history */
|
|
822
|
+
WORKFLOW_RUNS: "/workflows/:id/runs",
|
|
823
|
+
/** POST /workflows/runs/:runId/cancel - Cancel a workflow run */
|
|
824
|
+
WORKFLOW_RUN_CANCEL: "/workflows/runs/:runId/cancel",
|
|
825
|
+
/** GET /runs - List all workflow runs */
|
|
826
|
+
RUNS: "/runs",
|
|
827
|
+
/** GET /runs/:runId - Get a specific workflow run */
|
|
828
|
+
RUN_DETAIL: "/runs/:runId",
|
|
829
|
+
/** GET /jobs - List all jobs */
|
|
830
|
+
JOBS: "/jobs",
|
|
831
|
+
/** GET /jobs/:jobId - Get job details */
|
|
832
|
+
JOB_DETAIL: "/jobs/:jobId",
|
|
833
|
+
/** GET /jobs/:jobId/logs - Get job logs */
|
|
834
|
+
JOB_LOGS: "/jobs/:jobId/logs",
|
|
835
|
+
/** GET /jobs/:jobId/steps - Get job execution steps */
|
|
836
|
+
JOB_STEPS: "/jobs/:jobId/steps",
|
|
837
|
+
/** POST /jobs/:jobId/cancel - Cancel a job */
|
|
838
|
+
JOB_CANCEL: "/jobs/:jobId/cancel",
|
|
839
|
+
/** GET /cron - List cron jobs */
|
|
840
|
+
CRON: "/cron",
|
|
841
|
+
/** GET /runs/:runId/pending-approvals - List pending approvals */
|
|
842
|
+
PENDING_APPROVALS: "/runs/:runId/pending-approvals",
|
|
843
|
+
/** POST /runs/:runId/approve - Resolve an approval */
|
|
844
|
+
RESOLVE_APPROVAL: "/runs/:runId/approve"
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
export { ApprovalReviewItemSchema, ArtifactMergeConfigSchema, ArtifactMergeSourceSchema, ArtifactMergeStrategySchema, ConcurrencyGroupSchema, CronExecutionSchema, CronInfoSchema, CronListResponseSchema, CronScheduleSchema, DashboardStatsResponseSchema, ExecutionResultSchema, ExecutionTargetSchema, IdempotencyKeySchema, IsolationProfileSchema, JobArtifactsSchema, JobCancelResponseSchema, JobConcurrencySchema, JobHooksSchema, JobListResponseSchema, JobLogsResponseSchema, JobRunSchema, JobSpecSchema, JobStateSchema, JobStatusInfoSchema, JobStatusSchema, JobStepInfoSchema, JobStepsResponseSchema, PhaseSchema, PluginCronJobSchema, ResultErrorSchema, ResultMetricsSchema, RetryModeSchema, RetryPolicySchema, RunMetadataSchema, RunSchema, RunStateSchema, RunTriggerSchema, StepArtifactSchema, StepProgressSchema, StepRunErrorSchema, StepRunSchema, StepSpecSchema, StepStateSchema, TenantIdSchema, TimeoutSchema, UserCronJobSchema, WORKFLOW_BASE_PATH, WORKFLOW_ROUTES, WorkflowInfoSchema, WorkflowInputFieldSchema, WorkflowListResponseSchema, WorkflowRunHistoryResponseSchema, WorkflowRunInfoSchema, WorkflowRunRequestSchema, WorkflowSpecSchema, WorkflowTriggerSchema, evaluateExpression, extractExpressions, healthFlags, interpolateObject, interpolateString, listFlags, logsFlags, metricsFlags, parseWorkflowUses, resolveExpression, resolveValue, runFlags, statusFlags };
|
|
848
|
+
//# sourceMappingURL=index.js.map
|
|
849
|
+
//# sourceMappingURL=index.js.map
|