lua-cli 3.29.1 → 3.31.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/api-exports.d.ts +1185 -77
- package/dist/api-exports.js +5032 -137
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +25610 -14399
- package/dist/index.js.map +1 -1
- package/dist/voice/test/index.d.ts +40 -40
- package/dist/workflow-builder.d.ts +766 -0
- package/dist/workflow-builder.js +5732 -0
- package/dist/workflow-builder.js.map +1 -0
- package/docs/API_INDEX.md +2 -0
- package/docs/README.md +27 -9
- package/docs/api/Jobs.md +10 -10
- package/docs/api/LuaWorkflow.md +73 -0
- package/docs/api/Workflows.md +110 -0
- package/docs/workflows/approvals.md +28 -0
- package/docs/workflows/artefacts-and-datasets.md +19 -0
- package/docs/workflows/coding-harness.md +12 -0
- package/docs/workflows/compliance-gates.md +16 -0
- package/docs/workflows/connections-in-coding-turns.md +9 -0
- package/docs/workflows/correlation-keys.md +11 -0
- package/docs/workflows/env-overlays.md +12 -0
- package/docs/workflows/evidence-bundles.md +11 -0
- package/docs/workflows/exports.md +5 -0
- package/docs/workflows/external-content-and-toolscope.md +11 -0
- package/docs/workflows/git-credentials.md +11 -0
- package/docs/workflows/knowledge-bindings.md +13 -0
- package/docs/workflows/limits.md +11 -0
- package/docs/workflows/long-steps-and-checkpoints.md +13 -0
- package/docs/workflows/migrating-cloud-tasks.md +9 -0
- package/docs/workflows/migrating-runs.md +13 -0
- package/docs/workflows/output-visibility.md +9 -0
- package/docs/workflows/per-item-approvals.md +9 -0
- package/docs/workflows/private-network-sources.md +12 -0
- package/docs/workflows/recovery.md +28 -0
- package/docs/workflows/replay-local.md +35 -0
- package/docs/workflows/reply-channels.md +11 -0
- package/docs/workflows/retention-and-archival.md +82 -0
- package/docs/workflows/roles.md +12 -0
- package/docs/workflows/schedules.md +11 -0
- package/docs/workflows/script-form.md +50 -0
- package/docs/workflows/testing-offline.md +46 -0
- package/docs/workflows/workspace-backends.md +11 -0
- package/docs/workflows/workspaces-and-long-steps.md +27 -0
- package/package.json +7 -2
- package/scripts/run-api-extractor.mjs +1 -1
- package/template/.gitignore +2 -0
- package/template/examples/workflows/CLAUDE.md +24 -0
- package/template/examples/workflows/adversarial-verify.workflow.script.js +48 -0
- package/template/examples/workflows/github-review.webhook.ts +19 -0
- package/template/examples/workflows/linear-ready.trigger.ts +21 -0
- package/template/examples/workflows/outreach.ts +55 -0
- package/template/examples/workflows/pr-review-round.ts +38 -0
- package/template/examples/workflows/provision-tenant.ts +18 -0
- package/template/examples/workflows/refund-approval.ts +44 -0
- package/template/examples/workflows/research-brief.ts +42 -0
- package/template/examples/workflows/reviewed-brief.ts +19 -0
- package/template/examples/workflows/support-triage.ts +44 -0
- package/template/examples/workflows/ticket-to-pr.ts +65 -0
- package/template/examples/workflows/vendor-invoices.ts +30 -0
- package/template/lua.skill.yaml +1 -0
- package/template/package.json +1 -1
|
@@ -0,0 +1,766 @@
|
|
|
1
|
+
import { ArtefactRef } from '@lua/workflow-graph';
|
|
2
|
+
import { DatasetRef } from '@lua/workflow-graph';
|
|
3
|
+
import { EnvRefBinding } from '@lua/workflow-graph';
|
|
4
|
+
import { fromKnowledge as fromKnowledge_2 } from '@lua/workflow-graph';
|
|
5
|
+
import { JsonSchema } from '@lua/workflow-graph';
|
|
6
|
+
import { KnowledgeBindingSpec } from '@lua/workflow-graph';
|
|
7
|
+
import { Literal } from '@lua/workflow-graph';
|
|
8
|
+
import { LuaMapConfig } from '@lua/workflow-graph';
|
|
9
|
+
import { LuaPredicate } from '@lua/workflow-graph';
|
|
10
|
+
import { MapDescriptor } from '@lua/workflow-graph';
|
|
11
|
+
import { PathOrLiteral } from '@lua/workflow-graph';
|
|
12
|
+
import { SerializedWorkflowGraph } from '@lua/workflow-graph';
|
|
13
|
+
import { TemplateBinding } from '@lua/workflow-graph';
|
|
14
|
+
import { TypedRef } from '@lua/workflow-graph';
|
|
15
|
+
import { WorkflowGraphEntry } from '@lua/workflow-graph';
|
|
16
|
+
import type { z } from 'zod';
|
|
17
|
+
import { ZodType } from 'zod';
|
|
18
|
+
|
|
19
|
+
export declare interface AgentStepOptions {
|
|
20
|
+
agentId: string | EnvRefBinding;
|
|
21
|
+
prompt: TemplateLike;
|
|
22
|
+
outputSchema?: ZodType;
|
|
23
|
+
model?: string;
|
|
24
|
+
toolScope?: AgentToolScope & {
|
|
25
|
+
jobTools?: WorkflowJobToolId[];
|
|
26
|
+
};
|
|
27
|
+
timeoutSeconds?: number;
|
|
28
|
+
retry?: RetryPolicy;
|
|
29
|
+
onError?: 'fail' | 'continue' | 'park';
|
|
30
|
+
requiredConnections?: string[];
|
|
31
|
+
/** static-only persona override (§11 S3) */
|
|
32
|
+
systemPrompt?: string;
|
|
33
|
+
tier?: 'job';
|
|
34
|
+
workspace?: WorkflowStepWorkspace;
|
|
35
|
+
jobResources?: 'small' | 'medium' | 'large';
|
|
36
|
+
harness?: WorkflowJobHarness;
|
|
37
|
+
/** Coding-turn cap for a tier:'job' step (1..500); absent ⇒ the platform default. A monorepo change needs more than the default. */
|
|
38
|
+
maxTurns?: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export declare interface AgentToolScope {
|
|
42
|
+
connectionIds?: string[];
|
|
43
|
+
skillIds?: string[];
|
|
44
|
+
toolIds?: string[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare const and: (...args: LuaPredicate[]) => LuaPredicate;
|
|
48
|
+
|
|
49
|
+
export declare interface ApprovalOptions {
|
|
50
|
+
title: string;
|
|
51
|
+
details?: TemplateBinding;
|
|
52
|
+
/** default 'creator' */
|
|
53
|
+
approver?: WorkflowApproverSpec;
|
|
54
|
+
excludeInitiator?: boolean;
|
|
55
|
+
fourEyes?: WorkflowFourEyes;
|
|
56
|
+
/** default 168; a binding is resolved at suspend time and must yield 1..720 */
|
|
57
|
+
timeoutHours?: number | TemplateBinding;
|
|
58
|
+
/** 'deny' (default) | 'cancel-run' | 'fail' | a chain of ≤ 3 hops ending in one terminal member */
|
|
59
|
+
onTimeout?: WorkflowSuspendTimeoutChain;
|
|
60
|
+
/** default 'continue' (denial is data unless 'fail') */
|
|
61
|
+
onDeny?: 'fail' | 'continue';
|
|
62
|
+
businessHours?: WorkflowBusinessHours;
|
|
63
|
+
editable?: boolean;
|
|
64
|
+
/** grammar: `drafts`, `drafts[*]`, `drafts[*].body`, `drafts[3].body`, `summary.title` */
|
|
65
|
+
editablePaths?: string[];
|
|
66
|
+
editedPayloadSchema?: ZodType;
|
|
67
|
+
itemsPath?: string;
|
|
68
|
+
itemApprover?: WorkflowApproverSpec | {
|
|
69
|
+
fromItem: string;
|
|
70
|
+
};
|
|
71
|
+
itemTimeout?: WorkflowSuspendOnTimeout;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { ArtefactRef }
|
|
75
|
+
|
|
76
|
+
/** What `.commit()` hands to `LuaWorkflow` — internal; never `new LuaWorkflow({...})` by users. */
|
|
77
|
+
declare interface BuiltWorkflow {
|
|
78
|
+
config: LuaWorkflowConfig;
|
|
79
|
+
graph: WorkflowGraphEntry[];
|
|
80
|
+
steps: Record<string, LuaWorkflowStep<any, any, any>>;
|
|
81
|
+
warnings: LuaWorkflowBuildWarning[];
|
|
82
|
+
envTemplateKeys: string[];
|
|
83
|
+
nestedRefs: Array<{
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** A container arm: a `StepRef`, or (B14 — lands with WF-509) the two-element chain `[mapConfig, stepRef]`. */
|
|
90
|
+
export declare type ContainerArm = StepRef | [LuaMapConfig, StepRef];
|
|
91
|
+
|
|
92
|
+
export declare function createStep<TIn extends ZodType, TOut extends ZodType, TResume extends ZodType = ZodType>(s: LuaWorkflowStep<TIn, TOut, TResume>): LuaWorkflowStep<TIn, TOut, TResume>;
|
|
93
|
+
|
|
94
|
+
export declare function createWorkflow(cfg: LuaWorkflowConfig): LuaWorkflowBuilder;
|
|
95
|
+
|
|
96
|
+
export { DatasetRef }
|
|
97
|
+
|
|
98
|
+
export declare function defineWorkflow(cfg: LuaWorkflowConfig, build: (wf: LuaWorkflowBuilder) => LuaWorkflow): LuaWorkflow;
|
|
99
|
+
|
|
100
|
+
declare type Depth = [never, 0, 1, 2, 3, 4];
|
|
101
|
+
|
|
102
|
+
/** Template-literal walk of T's object keys, depth ≤ 4 (P1-21). */
|
|
103
|
+
export declare type DotPath<T, D extends number = 4> = [D] extends [never] ? never : T extends readonly unknown[] ? never : T extends object ? {
|
|
104
|
+
[K in keyof T & string]: NonNullable<T[K]> extends object ? K | `${K}.${DotPath<NonNullable<T[K]>, Depth[D]>}` : K;
|
|
105
|
+
}[keyof T & string] : never;
|
|
106
|
+
|
|
107
|
+
export { EnvRefBinding }
|
|
108
|
+
|
|
109
|
+
export declare const eq: <T>(l: TypedRef<T>, r: TypedRef<T> | Literal<T>) => LuaPredicate;
|
|
110
|
+
|
|
111
|
+
export declare const exists: (ref: TypedRef<unknown>) => LuaPredicate;
|
|
112
|
+
|
|
113
|
+
export declare const falsy: (ref: TypedRef<unknown>) => LuaPredicate;
|
|
114
|
+
|
|
115
|
+
export declare interface ForeachOptions {
|
|
116
|
+
/** Cluster G (B34): PURE builder lowering — emits `{ type:'mapping', id:'<foreachId>_items', mapConfig:{'': items} }` before the foreach entry. */
|
|
117
|
+
items?: TypedRef<unknown[]> | {
|
|
118
|
+
step: string;
|
|
119
|
+
path: string;
|
|
120
|
+
} | {
|
|
121
|
+
initData: true;
|
|
122
|
+
path?: string;
|
|
123
|
+
};
|
|
124
|
+
/** default 4, max 16 */
|
|
125
|
+
concurrency?: number;
|
|
126
|
+
/** default 256 — a FAIL-FAST bound at runtime, never a truncation (P0-6). */
|
|
127
|
+
maxItems?: number;
|
|
128
|
+
chunk?: {
|
|
129
|
+
size: number;
|
|
130
|
+
};
|
|
131
|
+
rateLimit?: {
|
|
132
|
+
perSecond?: number;
|
|
133
|
+
perMinute?: number;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export declare const fromInit: (path: string) => MapDescriptor;
|
|
138
|
+
|
|
139
|
+
export declare const fromKnowledge: typeof fromKnowledge_2;
|
|
140
|
+
|
|
141
|
+
export declare const fromRequest: (path: string) => MapDescriptor;
|
|
142
|
+
|
|
143
|
+
/** path default '' = whole output */
|
|
144
|
+
export declare const fromStep: (s: LuaWorkflowStep<any, any, any> | string | Array<LuaWorkflowStep<any, any, any> | string>, path?: string) => MapDescriptor;
|
|
145
|
+
|
|
146
|
+
export declare const gt: (l: TypedRef<number> | number, r: TypedRef<number> | Literal<number> | number) => LuaPredicate;
|
|
147
|
+
|
|
148
|
+
export declare const gte: (l: TypedRef<number> | number, r: TypedRef<number> | Literal<number> | number) => LuaPredicate;
|
|
149
|
+
|
|
150
|
+
export declare const init: <T = unknown>(path: string) => TypedRef<T>;
|
|
151
|
+
|
|
152
|
+
export declare const inSet: <T extends string | number | boolean | null>(v: TypedRef<T>, set: T[]) => LuaPredicate;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Job schedule configuration
|
|
156
|
+
* Supports either cron-style recurring schedules or one-time execution
|
|
157
|
+
*/
|
|
158
|
+
declare type JobSchedule = {
|
|
159
|
+
type: 'cron';
|
|
160
|
+
expression: string;
|
|
161
|
+
timezone?: string;
|
|
162
|
+
} | {
|
|
163
|
+
type: 'once';
|
|
164
|
+
executeAt: Date | string;
|
|
165
|
+
} | {
|
|
166
|
+
type: 'interval';
|
|
167
|
+
seconds: number;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export { JsonSchema }
|
|
171
|
+
|
|
172
|
+
export { KnowledgeBindingSpec }
|
|
173
|
+
|
|
174
|
+
export declare const lit: <const V extends string | number | boolean | null>(v: V) => Literal<V>;
|
|
175
|
+
|
|
176
|
+
export { Literal }
|
|
177
|
+
|
|
178
|
+
export declare interface LoopOptions {
|
|
179
|
+
/** default 100 */
|
|
180
|
+
maxIterations?: number;
|
|
181
|
+
/** engine timer between iterations, 1..86 400 (B24) */
|
|
182
|
+
intervalSeconds?: number;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export declare const lt: (l: TypedRef<number> | number, r: TypedRef<number> | Literal<number> | number) => LuaPredicate;
|
|
186
|
+
|
|
187
|
+
export declare const lte: (l: TypedRef<number> | number, r: TypedRef<number> | Literal<number> | number) => LuaPredicate;
|
|
188
|
+
|
|
189
|
+
export { LuaMapConfig }
|
|
190
|
+
|
|
191
|
+
export { LuaPredicate }
|
|
192
|
+
|
|
193
|
+
declare interface LuaTool<TInput extends ZodType = ZodType> {
|
|
194
|
+
/** Unique tool name (alphanumeric, hyphens, underscores only) */
|
|
195
|
+
name: string;
|
|
196
|
+
/** Description of what the tool does */
|
|
197
|
+
description: string;
|
|
198
|
+
/** Zod schema for input validation */
|
|
199
|
+
inputSchema: TInput;
|
|
200
|
+
/**
|
|
201
|
+
* Async function that executes the tool logic.
|
|
202
|
+
*
|
|
203
|
+
* `ctx` is `undefined` when the tool runs from the chat path (lua-core's
|
|
204
|
+
* vm-execution doesn't pass a second arg today). When the tool runs
|
|
205
|
+
* inside a voice session, `ctx` carries the voice runtime's delegates
|
|
206
|
+
* (`ctx.voice.say(...)` to emit a spoken acknowledgement, plus the
|
|
207
|
+
* `toolCallId` LiveKit assigned). Tools that want to bridge both modes
|
|
208
|
+
* read `ctx?.voice` and branch.
|
|
209
|
+
*/
|
|
210
|
+
execute: (input: any, ctx?: LuaToolCtx) => Promise<any>;
|
|
211
|
+
/** Optional async function that determines if the tool should be available */
|
|
212
|
+
condition?: () => Promise<boolean>;
|
|
213
|
+
/**
|
|
214
|
+
* Optional voice-only metadata. When present, the lua-livekit worker
|
|
215
|
+
* applies these flags to the wrapped LiveKit `llm.tool()` registration.
|
|
216
|
+
* Tools without this field work in chat and voice unchanged.
|
|
217
|
+
*/
|
|
218
|
+
voice?: {
|
|
219
|
+
flags?: ToolFlag[];
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Per-call context passed to a `LuaTool.execute` running inside a voice
|
|
225
|
+
* session. Imported here (rather than in `voice.ts`) to break a circular
|
|
226
|
+
* import — `LuaVoiceTool` extends `LuaTool` and would otherwise loop.
|
|
227
|
+
*
|
|
228
|
+
* The chat path (lua-core's vm-execution) doesn't pass a second arg, so
|
|
229
|
+
* `ctx` is `undefined` for chat. The voice path passes `{ toolCallId,
|
|
230
|
+
* voice: { say } }`. Tools that want to act differently inside a voice
|
|
231
|
+
* call check for `ctx?.voice` and use the typed surface.
|
|
232
|
+
*/
|
|
233
|
+
declare interface LuaToolCtx {
|
|
234
|
+
/** LiveKit's tool-call id (voice only). */
|
|
235
|
+
toolCallId?: string;
|
|
236
|
+
/** Voice-runtime delegates. Only set when the tool runs over voice. */
|
|
237
|
+
voice?: {
|
|
238
|
+
say(text: string): Promise<void>;
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export declare class LuaWorkflow {
|
|
243
|
+
private readonly built;
|
|
244
|
+
constructor(built: BuiltWorkflow);
|
|
245
|
+
getName(): string;
|
|
246
|
+
getConfig(): LuaWorkflowConfig;
|
|
247
|
+
getSteps(): Record<string, LuaWorkflowStep<any, any, any>>;
|
|
248
|
+
/** Builder warnings (`map-id-required`, `hitl-duration-defaulted`, `schedule-input-*`) — the compiler prints them. */
|
|
249
|
+
getBuildWarnings(): LuaWorkflowBuildWarning[];
|
|
250
|
+
/** Every `env.template(KEY)` placeholder key the graph carries (sorted, deduped) — `ManifestWorkflow.envTemplateKeys`. */
|
|
251
|
+
getEnvTemplateKeys(): string[];
|
|
252
|
+
/** `.workflow(id, ref)` targets by name — `ManifestWorkflow.workflowRefs`. */
|
|
253
|
+
getNestedWorkflowRefs(): Array<{
|
|
254
|
+
id: string;
|
|
255
|
+
name: string;
|
|
256
|
+
}>;
|
|
257
|
+
/** Pure: no I/O, no env, no time. Called by the compiler in the VM tier and by `lua test`. */
|
|
258
|
+
__serializeGraph(): SerializedWorkflowGraph;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export declare type LuaWorkflowBuildCode = 'duplicate-step-id' | 'unknown-step-ref' | 'map-id-required' | 'closure-predicate' | 'closure-binding' | 'timeout-out-of-range' | 'timeout-exceeds-tier' | 'job-timeout-exceeds-cap' | 'long-job-requires-workspace' | 'workspace-requires-job-tier' | 'workspace-not-declared' | 'workspace-inherit-without-parent-workspace' | 'workspace-inherit-conflict' | 'harness-requires-job-tier' | 'max-turns-requires-job-tier' | 'max-turns-invalid' | 'cap-exceeded' | 'chunk-size-invalid' | 'rate-limit-invalid' | 'backoff-invalid' | 'loop-interval-out-of-range' | 'mapping-placement' | 'container-arm-empty' | 'approval-inside-container' | 'empty-graph' | 'ephemeral-role-too-long' | 'role-ref-and-inline' | 'approver-excludes-only-candidate' | 'four-eyes-requires-editable' | 'escalation-chain-not-terminal' | 'escalation-chain-too-long' | 'editable-path-invalid' | 'env-template-secret-key' | 'invalid-envelope' | 'invalid-step' | 'invalid-step-id' | 'invalid-workflow-name' | 'schedule-input-required' | 'schedule-input-invalid' | 'hitl-duration-defaulted' | 'WORKFLOW_UNPLACED_STEP';
|
|
262
|
+
|
|
263
|
+
export declare interface LuaWorkflowBuilder {
|
|
264
|
+
then(step: StepRef): this;
|
|
265
|
+
/** 2..16 arms; output = { [stepId]: output } */
|
|
266
|
+
parallel(steps: ContainerArm[], opts?: {
|
|
267
|
+
merge?: WorkflowMergePolicy;
|
|
268
|
+
}): this;
|
|
269
|
+
/** all-true arms run (Mastra); exclusive:true ≡ switch() */
|
|
270
|
+
branch(arms: Array<[LuaPredicate, StepRef]>, opts?: {
|
|
271
|
+
exclusive?: boolean;
|
|
272
|
+
}): this;
|
|
273
|
+
/** first true arm only ⇒ conditional{ exclusive:true, otherwise } */
|
|
274
|
+
switch(arms: Array<[LuaPredicate, StepRef]>, otherwise?: StepRef): this;
|
|
275
|
+
foreach(step: ContainerArm, opts?: ForeachOptions): this;
|
|
276
|
+
dowhile(step: ContainerArm, predicate: LuaPredicate, opts?: LoopOptions): this;
|
|
277
|
+
dountil(step: ContainerArm, predicate: LuaPredicate, opts?: LoopOptions): this;
|
|
278
|
+
/** top-level only. `id` is REQUIRED once the workflow has ≥ 2 maps (`map-id-required`). */
|
|
279
|
+
map(mapping: LuaMapConfig, opts?: {
|
|
280
|
+
id?: string;
|
|
281
|
+
}): this;
|
|
282
|
+
/** literal only; engine-side wait, no lease */
|
|
283
|
+
sleep(ms: number, opts?: {
|
|
284
|
+
id?: string;
|
|
285
|
+
businessHours?: WorkflowBusinessHours;
|
|
286
|
+
}): this;
|
|
287
|
+
/** a TemplateBinding lowers to `<id>_at` mapping + `sleepUntil{dateFrom}` (D6-r1) */
|
|
288
|
+
sleepUntil(iso: string | TemplateBinding, opts?: {
|
|
289
|
+
id?: string;
|
|
290
|
+
businessHours?: WorkflowBusinessHours;
|
|
291
|
+
round?: 'next-open' | 'next-close';
|
|
292
|
+
}): this;
|
|
293
|
+
agentStep(id: string, opts: AgentStepOptions): this;
|
|
294
|
+
/** D25 ephemeral specialist: runs AS THE OWNING AGENT (`agentId:'$self'`) with an additive role block. */
|
|
295
|
+
specialistStep(id: string, opts: SpecialistStepOptions): this;
|
|
296
|
+
toolStep(id: string, tool: LuaTool<any>, opts?: ToolStepOptions): this;
|
|
297
|
+
approval(id: string, opts: ApprovalOptions): this;
|
|
298
|
+
waitForSignal(id: string, opts: WaitForSignalOptions): this;
|
|
299
|
+
/** nested run; depth ≤ 3 */
|
|
300
|
+
workflow(id: string, ref: LuaWorkflow | string, input?: LuaMapConfig, opts?: {
|
|
301
|
+
workspace?: 'inherit';
|
|
302
|
+
}): this;
|
|
303
|
+
commit(): LuaWorkflow;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export declare class LuaWorkflowBuildError extends Error {
|
|
307
|
+
readonly code: LuaWorkflowBuildCode;
|
|
308
|
+
readonly hint?: string | undefined;
|
|
309
|
+
constructor(code: LuaWorkflowBuildCode, message: string, hint?: string | undefined);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export declare interface LuaWorkflowBuildWarning {
|
|
313
|
+
code: LuaWorkflowBuildCode;
|
|
314
|
+
message: string;
|
|
315
|
+
stepId?: string;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export declare interface LuaWorkflowConfig {
|
|
319
|
+
/** /^[a-z][a-z0-9-_]*$/ — server identifier */
|
|
320
|
+
name: string;
|
|
321
|
+
description?: string;
|
|
322
|
+
inputSchema: ZodType;
|
|
323
|
+
outputSchema?: ZodType;
|
|
324
|
+
/** types `ctx.state`; ≤ 64KB at runtime */
|
|
325
|
+
stateSchema?: ZodType;
|
|
326
|
+
/** 'forbid' = jobs-style overlap guard per workflow (D21-r1) — every start path gets 409 `RUNS_IN_FLIGHT`. */
|
|
327
|
+
concurrencyPolicy?: 'allow' | 'forbid';
|
|
328
|
+
/** Who may READ this workflow's run outputs beyond `workflows:read-outputs` holders (B44). Envelope member outside `graphHash`. */
|
|
329
|
+
outputVisibility?: WorkflowOutputVisibility;
|
|
330
|
+
/** `maxDurationSeconds` default 604 800; 2 592 000 when the graph contains an approval / waitForSignal / suspend-capable step (P1-4). */
|
|
331
|
+
budget?: {
|
|
332
|
+
maxCredits?: number;
|
|
333
|
+
maxSteps?: number;
|
|
334
|
+
maxDurationSeconds?: number;
|
|
335
|
+
};
|
|
336
|
+
/** verbatim LuaJob union (D12) → Job{kind:'workflow'} on publish */
|
|
337
|
+
schedule?: JobSchedule;
|
|
338
|
+
backfillOnEnable?: {
|
|
339
|
+
maxOccurrences?: number;
|
|
340
|
+
};
|
|
341
|
+
/** Literal JSON passed as run input on every scheduled fire; must validate against `inputSchema` (P0-5e). */
|
|
342
|
+
scheduleInput?: Record<string, unknown>;
|
|
343
|
+
goal?: WorkflowGoalEnvelope;
|
|
344
|
+
/** NEVER set by hand — the compiler derives it from the source file. */
|
|
345
|
+
form?: 'graph' | 'script';
|
|
346
|
+
workspace?: WorkspaceSpec;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export declare interface LuaWorkflowStep<TIn extends ZodType = ZodType, TOut extends ZodType = ZodType, TResume extends ZodType = ZodType> {
|
|
350
|
+
/** /^[a-z][a-zA-Z0-9_-]{0,63}$/ — unique per workflow; `[`, `#`, `.`, `:` reserved. */
|
|
351
|
+
id: string;
|
|
352
|
+
description?: string;
|
|
353
|
+
inputSchema: TIn;
|
|
354
|
+
outputSchema: TOut;
|
|
355
|
+
suspendSchema?: ZodType;
|
|
356
|
+
resumeSchema?: TResume;
|
|
357
|
+
execute: (ctx: WorkflowStepContext<z.infer<TIn>, z.infer<TResume>>) => Promise<z.infer<TOut>>;
|
|
358
|
+
/** 1..600 (D19); default 300 — on `tier:'job'` 1..86 400, default 3600. */
|
|
359
|
+
timeoutSeconds?: number;
|
|
360
|
+
/** Run this step as a k8s Job (hours tier). Implied by `workspace`. */
|
|
361
|
+
tier?: 'job';
|
|
362
|
+
workspace?: WorkflowStepWorkspace;
|
|
363
|
+
jobResources?: 'small' | 'medium' | 'large';
|
|
364
|
+
jobTools?: WorkflowJobToolId[];
|
|
365
|
+
/** default { maxAttempts: 1 } */
|
|
366
|
+
retry?: RetryPolicy;
|
|
367
|
+
/** default 'none'; 'external' ⇒ park on platform-fault reclaim. */
|
|
368
|
+
sideEffects?: 'none' | 'external';
|
|
369
|
+
/** What the FINAL failure of this step does to the run (default 'fail'). */
|
|
370
|
+
onError?: 'fail' | 'continue' | 'park';
|
|
371
|
+
requiredConnections?: string[];
|
|
372
|
+
/** Deadline for a `ctx.suspend()` suspension; default 168, max 720. */
|
|
373
|
+
resumeTimeoutHours?: number;
|
|
374
|
+
businessHours?: WorkflowBusinessHours;
|
|
375
|
+
onSuspendTimeout?: 'fail' | 'cancel-run';
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export { MapDescriptor }
|
|
379
|
+
|
|
380
|
+
export declare const ne: <T>(l: TypedRef<T>, r: TypedRef<T> | Literal<T>) => LuaPredicate;
|
|
381
|
+
|
|
382
|
+
export declare const not: (arg: LuaPredicate) => LuaPredicate;
|
|
383
|
+
|
|
384
|
+
export declare const notExists: (ref: TypedRef<unknown>) => LuaPredicate;
|
|
385
|
+
|
|
386
|
+
export declare const notIn: <T extends string | number | boolean | null>(v: TypedRef<T>, set: T[]) => LuaPredicate;
|
|
387
|
+
|
|
388
|
+
export declare const or: (...args: LuaPredicate[]) => LuaPredicate;
|
|
389
|
+
|
|
390
|
+
export { PathOrLiteral }
|
|
391
|
+
|
|
392
|
+
/** P split on '.' walked into T; `unknown` past depth 4 or through an index. */
|
|
393
|
+
export declare type PathValue<T, P extends string> = P extends `${infer H}.${infer R}` ? H extends keyof T ? PathValue<NonNullable<T[H]>, R> : unknown : P extends keyof T ? T[P] : unknown;
|
|
394
|
+
|
|
395
|
+
export declare type ReplyChannel = 'whatsapp' | 'sms' | 'email' | 'webchat' | 'slack';
|
|
396
|
+
|
|
397
|
+
export declare interface RetryPolicy {
|
|
398
|
+
maxAttempts: number;
|
|
399
|
+
/** delay before attempt 2 (default 0 = immediate) */
|
|
400
|
+
backoffSeconds?: number;
|
|
401
|
+
/** 'fixed' (default) | 'exponential' — an engine timer, never a sleep inside the step VM (P1-10). */
|
|
402
|
+
backoff?: 'fixed' | 'exponential';
|
|
403
|
+
/** default 3600; only meaningful with 'exponential' (`backoff-invalid` otherwise). */
|
|
404
|
+
maxBackoffSeconds?: number;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export declare const rows: (s: LuaWorkflowStep<any, any, any> | string, path: string, page: {
|
|
408
|
+
offset: number;
|
|
409
|
+
limit: number;
|
|
410
|
+
}) => MapDescriptor;
|
|
411
|
+
|
|
412
|
+
export { SerializedWorkflowGraph }
|
|
413
|
+
|
|
414
|
+
export declare interface SpecialistStepOptions {
|
|
415
|
+
role: WorkflowSpecialistRole | {
|
|
416
|
+
ref: string;
|
|
417
|
+
};
|
|
418
|
+
prompt: TemplateLike;
|
|
419
|
+
outputSchema?: ZodType;
|
|
420
|
+
model?: string;
|
|
421
|
+
toolScope?: AgentToolScope;
|
|
422
|
+
timeoutSeconds?: number;
|
|
423
|
+
retry?: RetryPolicy;
|
|
424
|
+
onError?: 'fail' | 'continue' | 'park';
|
|
425
|
+
requiredConnections?: string[];
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export declare const state: <T = unknown>(path: string) => TypedRef<T>;
|
|
429
|
+
|
|
430
|
+
/** `step(x).path('confidence')` is `TypedRef<number>` when `x.outputSchema` says so; a string id yields `TypedRef<unknown>`. */
|
|
431
|
+
export declare function step<TOut extends ZodType>(s: LuaWorkflowStep<any, TOut, any>): StepPathRef<z.infer<TOut>>;
|
|
432
|
+
|
|
433
|
+
export declare function step(id: string): {
|
|
434
|
+
path(p: string): TypedRef<unknown>;
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
/** Typed string ref for `agentStep`/`toolStep` ids: `stepOf<typeof angle>('techAngle').path('confidence')`. */
|
|
438
|
+
export declare function stepOf<TOut extends ZodType>(id: string): StepPathRef<z.infer<TOut>>;
|
|
439
|
+
|
|
440
|
+
export declare interface StepPathRef<TOut> {
|
|
441
|
+
path<P extends DotPath<TOut>>(p: P): TypedRef<PathValue<TOut, P>>;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/** An inline step object, or a string naming an entry declared by an `agentStep`/`specialistStep`/`toolStep`/`map` call in the same chain (03 §3.2.0). */
|
|
445
|
+
export declare type StepRef = LuaWorkflowStep<any, any, any> | string;
|
|
446
|
+
|
|
447
|
+
/** placeholders: ${initData.*} ${stepResults.<id>.*} ${state.*} */
|
|
448
|
+
export declare const template: (s: string) => TemplateBinding;
|
|
449
|
+
|
|
450
|
+
export { TemplateBinding }
|
|
451
|
+
|
|
452
|
+
/** A prompt / literal slot: a string, a `template(...)` binding, or an `env.template(KEY)` placeholder (B33). */
|
|
453
|
+
export declare type TemplateLike = string | TemplateBinding | EnvRefBinding;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Lua Tool interface.
|
|
457
|
+
* Defines the structure of a tool that can be added to a LuaSkill.
|
|
458
|
+
*
|
|
459
|
+
* @template TInput - Zod schema type for input validation
|
|
460
|
+
*
|
|
461
|
+
* @example
|
|
462
|
+
* ```typescript
|
|
463
|
+
* import { z } from 'zod';
|
|
464
|
+
* import { LuaTool } from 'lua-cli';
|
|
465
|
+
*
|
|
466
|
+
* const weatherTool: LuaTool = {
|
|
467
|
+
* name: 'get_weather',
|
|
468
|
+
* description: 'Gets current weather for a city',
|
|
469
|
+
* inputSchema: z.object({
|
|
470
|
+
* city: z.string(),
|
|
471
|
+
* units: z.enum(['metric', 'imperial']).optional()
|
|
472
|
+
* }),
|
|
473
|
+
* execute: async (input) => {
|
|
474
|
+
* // Fetch weather data...
|
|
475
|
+
* return { temperature: 72, condition: 'sunny' };
|
|
476
|
+
* }
|
|
477
|
+
* };
|
|
478
|
+
* ```
|
|
479
|
+
*
|
|
480
|
+
* @example
|
|
481
|
+
* ```typescript
|
|
482
|
+
* // Tool with condition - only available to premium users
|
|
483
|
+
* class PremiumSearchTool implements LuaTool {
|
|
484
|
+
* name = "premium_search";
|
|
485
|
+
* description = "Advanced search for premium users";
|
|
486
|
+
* inputSchema = z.object({ query: z.string() });
|
|
487
|
+
*
|
|
488
|
+
* // Condition runs before tool is offered to LLM
|
|
489
|
+
* condition = async () => {
|
|
490
|
+
* const user = await User.get();
|
|
491
|
+
* return user.data?.isPremium === true;
|
|
492
|
+
* };
|
|
493
|
+
*
|
|
494
|
+
* execute = async (input) => { ... };
|
|
495
|
+
* }
|
|
496
|
+
* ```
|
|
497
|
+
*/
|
|
498
|
+
/**
|
|
499
|
+
* Tool-level flags mirrored from LiveKit's `ToolFlag`. Used by `LuaTool.voice.flags`
|
|
500
|
+
* to control tool availability + interruption semantics during a voice session.
|
|
501
|
+
* Defined here (not voice.ts) so LuaTool's voice metadata stays self-contained
|
|
502
|
+
* with no risk of circular imports.
|
|
503
|
+
*/
|
|
504
|
+
declare enum ToolFlag {
|
|
505
|
+
NONE = "none",
|
|
506
|
+
/** Tool is hidden from the LLM during the first turn after onEnter. */
|
|
507
|
+
IGNORE_ON_ENTER = "ignore_on_enter",
|
|
508
|
+
/** User speech does not interrupt the agent while this tool is executing. */
|
|
509
|
+
DISALLOW_INTERRUPTION = "disallow_interruption"
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
export declare interface ToolStepOptions {
|
|
513
|
+
input?: LuaMapConfig;
|
|
514
|
+
timeoutSeconds?: number;
|
|
515
|
+
retry?: RetryPolicy;
|
|
516
|
+
sideEffects?: 'none' | 'external';
|
|
517
|
+
onError?: 'fail' | 'continue' | 'park';
|
|
518
|
+
requiredConnections?: string[];
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
export declare const truthy: (ref: TypedRef<unknown>) => LuaPredicate;
|
|
522
|
+
|
|
523
|
+
export { TypedRef }
|
|
524
|
+
|
|
525
|
+
export declare const value: (v: unknown) => MapDescriptor;
|
|
526
|
+
|
|
527
|
+
export declare interface WaitForSignalOptions {
|
|
528
|
+
signal: string;
|
|
529
|
+
schema?: ZodType;
|
|
530
|
+
timeoutHours?: number | TemplateBinding;
|
|
531
|
+
/** default 'fail'; 'continue' ⇒ output {received:false,timedOut:true} */
|
|
532
|
+
onTimeout?: 'fail' | 'continue';
|
|
533
|
+
businessHours?: WorkflowBusinessHours;
|
|
534
|
+
/** default ['webhook','api','user'] */
|
|
535
|
+
acceptedSources?: Array<'webhook' | 'api' | 'user' | 'agent'>;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export declare const WORKFLOW_DEFAULT_MAX_DURATION_SECONDS = 604800;
|
|
539
|
+
|
|
540
|
+
export declare const WORKFLOW_HITL_MAX_DURATION_SECONDS = 2592000;
|
|
541
|
+
|
|
542
|
+
export declare type WorkflowApproverSpec = 'creator' | 'org-admins' | {
|
|
543
|
+
users: string[] | TemplateBinding;
|
|
544
|
+
} | {
|
|
545
|
+
role: string | TemplateBinding | MapDescriptor;
|
|
546
|
+
} | {
|
|
547
|
+
group: string | TemplateBinding;
|
|
548
|
+
} | {
|
|
549
|
+
governance: {
|
|
550
|
+
policyId: string;
|
|
551
|
+
};
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
export declare interface WorkflowArtefactMeta {
|
|
555
|
+
artefactId: string;
|
|
556
|
+
name: string;
|
|
557
|
+
contentType: string;
|
|
558
|
+
bytes: number;
|
|
559
|
+
kind: 'file' | 'dataset' | 'image' | 'document';
|
|
560
|
+
datasetSchema?: JsonSchema;
|
|
561
|
+
rowCount?: number;
|
|
562
|
+
producer: {
|
|
563
|
+
stepId: string;
|
|
564
|
+
attempt: number;
|
|
565
|
+
source: 'turn' | 'ctx' | 'input';
|
|
566
|
+
};
|
|
567
|
+
previewCdnRef?: string;
|
|
568
|
+
title?: string;
|
|
569
|
+
source?: {
|
|
570
|
+
kind: 'step' | 'input' | 'url' | 'connection' | 'upload';
|
|
571
|
+
ref?: string;
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
export declare interface WorkflowBusinessHours {
|
|
576
|
+
tz: string;
|
|
577
|
+
calendar?: 'mon-fri' | {
|
|
578
|
+
days: number[];
|
|
579
|
+
start: string;
|
|
580
|
+
end: string;
|
|
581
|
+
holidays?: string[];
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export declare interface WorkflowFourEyes {
|
|
586
|
+
edit: WorkflowApproverSpec;
|
|
587
|
+
approve: WorkflowApproverSpec;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export declare interface WorkflowGoalEnvelope {
|
|
591
|
+
objective: string;
|
|
592
|
+
judge: {
|
|
593
|
+
agentId: string | '$self';
|
|
594
|
+
role?: WorkflowSpecialistRole;
|
|
595
|
+
schema: ZodType;
|
|
596
|
+
};
|
|
597
|
+
cadence: JobSchedule[];
|
|
598
|
+
maxRuns: number;
|
|
599
|
+
budget?: LuaWorkflowConfig['budget'];
|
|
600
|
+
maxTotalCredits?: number;
|
|
601
|
+
initialState?: Record<string, unknown>;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
export declare type WorkflowJobHarness = 'claude-code' | 'generic';
|
|
605
|
+
|
|
606
|
+
export declare type WorkflowJobToolId = 'shell' | 'read' | 'write' | 'edit' | 'glob' | 'grep' | 'git' | 'gh' | 'fetch';
|
|
607
|
+
|
|
608
|
+
export declare interface WorkflowMergePolicy {
|
|
609
|
+
strategy: 'rebase' | 'merge';
|
|
610
|
+
onConflict: 'fail' | 'agent';
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
export declare interface WorkflowOutputVisibility {
|
|
614
|
+
roles: string[];
|
|
615
|
+
users?: string[];
|
|
616
|
+
ownerBypass?: boolean;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
export declare type WorkflowRunTrigger = 'chat' | 'sdk' | 'api' | 'schedule' | 'webhook' | 'template' | 'workflow' | 'device';
|
|
620
|
+
|
|
621
|
+
export declare interface WorkflowSpecialistRole {
|
|
622
|
+
name: string;
|
|
623
|
+
instructions: string;
|
|
624
|
+
tools: string[];
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
export declare interface WorkflowStepContext<TIn = unknown, TResume = unknown, TState = Record<string, unknown>> {
|
|
628
|
+
runId: string;
|
|
629
|
+
workflowId: string;
|
|
630
|
+
workflowVersionId: string;
|
|
631
|
+
stepId: string;
|
|
632
|
+
attempt: number;
|
|
633
|
+
/** `${lineageId}:${stepId}` — stable across retries, resumes, `retry-step` AND repair runs. THE key for side-effect dedup. */
|
|
634
|
+
occurrenceId: string;
|
|
635
|
+
/** The run's recovery lineage: the first run's id in a repair chain; `=== runId` for a non-repair run. */
|
|
636
|
+
lineageId: string;
|
|
637
|
+
/** Resolved bindings snapshot (mapping descriptors applied by the advancer). Plain JSON. */
|
|
638
|
+
inputData: TIn;
|
|
639
|
+
/** Present only when re-invoked after resume. `execute` RE-RUNS FROM THE TOP (Mastra semantics). */
|
|
640
|
+
resumeData?: TResume;
|
|
641
|
+
/** What the prior invocation passed to `suspend()`. */
|
|
642
|
+
suspendData?: unknown;
|
|
643
|
+
getInitData<T = unknown>(): T;
|
|
644
|
+
/** Output of an UPSTREAM step. Throws `WorkflowStepResultError{ code:'STEP_RESULT_NOT_ANCESTOR' }` for a non-ancestor. */
|
|
645
|
+
getStepResult<T = unknown>(stepId: string): T;
|
|
646
|
+
/** Run-scoped KV, ledger-backed, ≤ 64KB total. `set` is durable when the step terminalizes. */
|
|
647
|
+
state: {
|
|
648
|
+
get<K extends keyof TState>(k: K): TState[K] | undefined;
|
|
649
|
+
set<K extends keyof TState>(k: K, v: TState[K]): Promise<void>;
|
|
650
|
+
};
|
|
651
|
+
/** Terminal for this invocation → step `suspended` kind:'input'. Never returns. */
|
|
652
|
+
suspend(payload: unknown): Promise<never>;
|
|
653
|
+
/** Early successful exit with `result` as the step output. Never returns. */
|
|
654
|
+
bail<T>(result: T): never;
|
|
655
|
+
/** Early successful exit for the WHOLE RUN (Cluster G, B8). Never returns. */
|
|
656
|
+
bailRun<T>(output: T): never;
|
|
657
|
+
/** → `step.progress` event (≤ 1000 per attempt; 1KB each). */
|
|
658
|
+
log(message: string): void;
|
|
659
|
+
/** Aborts on run cancel and on the sandbox wall. */
|
|
660
|
+
signal: AbortSignal;
|
|
661
|
+
/** Sub-agent env, exactly as jobs receive it. */
|
|
662
|
+
env: Record<string, string>;
|
|
663
|
+
/** EXACTLY-ONCE effect keyed on `{occurrenceId, key}` (P1-18). Claim → run `fn` → settle. */
|
|
664
|
+
once<T>(key: string, fn: () => Promise<T>): Promise<T>;
|
|
665
|
+
/** Job-tier steps only: the mounted run workspace. */
|
|
666
|
+
workspace?: {
|
|
667
|
+
path: string;
|
|
668
|
+
mount: 'rw' | 'ro';
|
|
669
|
+
branch?: string;
|
|
670
|
+
baseSha?: string;
|
|
671
|
+
arm?: string;
|
|
672
|
+
backend?: WorkflowWorkspaceBackend;
|
|
673
|
+
};
|
|
674
|
+
/** The run artefact store (P1-8). */
|
|
675
|
+
artefacts: {
|
|
676
|
+
put(name: string, data: Uint8Array | string | ReadableStream, opts: {
|
|
677
|
+
contentType: string;
|
|
678
|
+
kind?: 'file' | 'dataset' | 'image' | 'document';
|
|
679
|
+
datasetSchema?: JsonSchema;
|
|
680
|
+
title?: string;
|
|
681
|
+
source?: {
|
|
682
|
+
kind: 'step' | 'input' | 'url' | 'connection' | 'upload';
|
|
683
|
+
ref?: string;
|
|
684
|
+
};
|
|
685
|
+
}): Promise<{
|
|
686
|
+
artefactId: string;
|
|
687
|
+
}>;
|
|
688
|
+
get(artefactId: string): Promise<{
|
|
689
|
+
url: string;
|
|
690
|
+
meta: WorkflowArtefactMeta;
|
|
691
|
+
stream(opts?: {
|
|
692
|
+
range?: {
|
|
693
|
+
start: number;
|
|
694
|
+
end?: number;
|
|
695
|
+
};
|
|
696
|
+
}): Promise<ReadableStream>;
|
|
697
|
+
rows(page: {
|
|
698
|
+
offset: number;
|
|
699
|
+
limit: number;
|
|
700
|
+
}): Promise<{
|
|
701
|
+
rows: unknown[];
|
|
702
|
+
rowCount: number;
|
|
703
|
+
nextOffset?: number;
|
|
704
|
+
}>;
|
|
705
|
+
}>;
|
|
706
|
+
list(): Promise<WorkflowArtefactMeta[]>;
|
|
707
|
+
};
|
|
708
|
+
/** Stamped by the executor for observability; read-only. */
|
|
709
|
+
runtime: {
|
|
710
|
+
trigger: WorkflowRunTrigger;
|
|
711
|
+
parentRunId?: string;
|
|
712
|
+
agentVersion?: number;
|
|
713
|
+
traceparent?: string;
|
|
714
|
+
correlationKey?: string;
|
|
715
|
+
tags?: string[];
|
|
716
|
+
principalKind: 'user' | 'service' | 'customer';
|
|
717
|
+
replyTo?: {
|
|
718
|
+
channel: ReplyChannel;
|
|
719
|
+
threadId: string;
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/** Thrown by `ctx.getStepResult` for a non-ancestor / unknown id — never `undefined` (03 §3.1). */
|
|
725
|
+
export declare interface WorkflowStepResultError extends Error {
|
|
726
|
+
code: 'STEP_RESULT_NOT_ANCESTOR';
|
|
727
|
+
stepId: string;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export declare interface WorkflowStepWorkspace {
|
|
731
|
+
mount: 'rw' | 'ro';
|
|
732
|
+
isolation?: 'shared' | 'worktree';
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
export declare interface WorkflowSuspendOnTimeout {
|
|
736
|
+
timeoutHours: number | TemplateBinding;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
export declare type WorkflowSuspendTimeoutChain = WorkflowSuspendTimeoutChainMember | WorkflowSuspendTimeoutChainMember[];
|
|
740
|
+
|
|
741
|
+
export declare type WorkflowSuspendTimeoutChainMember = 'deny' | 'cancel-run' | 'fail' | 'continue' | {
|
|
742
|
+
escalateTo: WorkflowApproverSpec;
|
|
743
|
+
timeoutHours: number;
|
|
744
|
+
};
|
|
745
|
+
|
|
746
|
+
export declare type WorkflowWorkspaceBackend = 'ebs' | 'efs' | 's3';
|
|
747
|
+
|
|
748
|
+
export declare type WorkspaceSpec = {
|
|
749
|
+
kind: 'git';
|
|
750
|
+
repo: string | TemplateBinding;
|
|
751
|
+
ref?: string | TemplateBinding;
|
|
752
|
+
credentialsRef?: string;
|
|
753
|
+
sizeGb?: number;
|
|
754
|
+
ttlHours?: number;
|
|
755
|
+
verify?: string;
|
|
756
|
+
keepArtefacts?: boolean;
|
|
757
|
+
backend?: WorkflowWorkspaceBackend;
|
|
758
|
+
} | {
|
|
759
|
+
kind: 'empty';
|
|
760
|
+
sizeGb?: number;
|
|
761
|
+
ttlHours?: number;
|
|
762
|
+
keepArtefacts?: boolean;
|
|
763
|
+
backend?: WorkflowWorkspaceBackend;
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
export { }
|