lua-cli 3.31.0 → 3.32.1
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 +81 -5
- package/dist/api-exports.js +686 -126
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +2003 -308
- package/dist/index.js.map +1 -1
- package/dist/workflow-builder.d.ts +37 -3
- package/dist/workflow-builder.js +658 -117
- package/dist/workflow-builder.js.map +1 -1
- package/docs/README.md +2 -2
- package/docs/api/LuaWorkflow.md +44 -28
- package/docs/api/Workflows.md +2 -1
- package/docs/workflows/approvals.md +14 -1
- package/docs/workflows/connections-in-coding-turns.md +1 -0
- package/docs/workflows/git-credentials.md +22 -1
- package/docs/workflows/goals.md +46 -0
- package/docs/workflows/recovery.md +6 -2
- package/docs/workflows/replay-local.md +10 -10
- package/docs/workflows/schedules.md +15 -0
- package/docs/workflows/testing-offline.md +22 -19
- package/docs/workflows/workspaces-and-long-steps.md +2 -0
- package/package.json +3 -3
- package/template/examples/workflows/CLAUDE.md +16 -13
- package/template/examples/workflows/pr-review-round.ts +57 -20
- package/template/examples/workflows/provision-tenant.ts +25 -8
- package/template/examples/workflows/refund-approval.ts +30 -17
- package/template/examples/workflows/support-triage.ts +59 -22
- package/template/examples/workflows/ticket-to-pr.ts +103 -31
- package/template/examples/workflows/vendor-invoices.ts +69 -16
- package/template/package.json +1 -1
|
@@ -36,6 +36,15 @@ export declare interface AgentStepOptions {
|
|
|
36
36
|
harness?: WorkflowJobHarness;
|
|
37
37
|
/** Coding-turn cap for a tier:'job' step (1..500); absent ⇒ the platform default. A monorepo change needs more than the default. */
|
|
38
38
|
maxTurns?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Per-ATTEMPT ceilings for a tier:'job' step (LUA-636): `maxTurns` bounds one harness query; these bound the whole
|
|
41
|
+
* attempt (every pass and resumed segment). Crossing one checkpoints the workspace and ends the attempt
|
|
42
|
+
* `attempt_budget_exhausted` — retryable, so the step's `retry` policy continues from that tree with a fresh
|
|
43
|
+
* session. `maxMessages` counts harness messages (one per content block; 1..5000, default 400),
|
|
44
|
+
* `maxInputTokens` the attempt's input-side tokens (prompt + cache; 1M..500M, default 30M).
|
|
45
|
+
*/
|
|
46
|
+
maxMessages?: number;
|
|
47
|
+
maxInputTokens?: number;
|
|
39
48
|
}
|
|
40
49
|
|
|
41
50
|
export declare interface AgentToolScope {
|
|
@@ -80,9 +89,11 @@ declare interface BuiltWorkflow {
|
|
|
80
89
|
steps: Record<string, LuaWorkflowStep<any, any, any>>;
|
|
81
90
|
warnings: LuaWorkflowBuildWarning[];
|
|
82
91
|
envTemplateKeys: string[];
|
|
92
|
+
/** `.workflow(id, ref, …, { workspace })` targets; `workspace:'inherit'` marks an inherit child — the compiler defers `workspace-not-declared` for it (03 §3.1). */
|
|
83
93
|
nestedRefs: Array<{
|
|
84
94
|
id: string;
|
|
85
95
|
name: string;
|
|
96
|
+
workspace?: 'inherit';
|
|
86
97
|
}>;
|
|
87
98
|
}
|
|
88
99
|
|
|
@@ -249,16 +260,23 @@ export declare class LuaWorkflow {
|
|
|
249
260
|
getBuildWarnings(): LuaWorkflowBuildWarning[];
|
|
250
261
|
/** Every `env.template(KEY)` placeholder key the graph carries (sorted, deduped) — `ManifestWorkflow.envTemplateKeys`. */
|
|
251
262
|
getEnvTemplateKeys(): string[];
|
|
252
|
-
/** `.workflow(id, ref)` targets by name — `ManifestWorkflow.workflowRefs
|
|
263
|
+
/** `.workflow(id, ref)` targets by name — `ManifestWorkflow.workflowRefs`; `workspace:'inherit'` marks the inherit children the compiler defers `workspace-not-declared` for. */
|
|
253
264
|
getNestedWorkflowRefs(): Array<{
|
|
254
265
|
id: string;
|
|
255
266
|
name: string;
|
|
267
|
+
workspace?: 'inherit';
|
|
256
268
|
}>;
|
|
257
269
|
/** Pure: no I/O, no env, no time. Called by the compiler in the VM tier and by `lua test`. */
|
|
258
270
|
__serializeGraph(): SerializedWorkflowGraph;
|
|
259
271
|
}
|
|
260
272
|
|
|
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'
|
|
273
|
+
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'
|
|
274
|
+
/**
|
|
275
|
+
* @deprecated LUA-635 — the builder no longer throws it: a mount with no envelope `workspace` is the SHARED validator's
|
|
276
|
+
* verdict (deferred for an inherit child, 03 §3.1 table). Kept for one minor so a consumer switching on the union still
|
|
277
|
+
* compiles; removed in the next.
|
|
278
|
+
*/
|
|
279
|
+
| '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
280
|
|
|
263
281
|
export declare interface LuaWorkflowBuilder {
|
|
264
282
|
then(step: StepRef): this;
|
|
@@ -296,7 +314,7 @@ export declare interface LuaWorkflowBuilder {
|
|
|
296
314
|
toolStep(id: string, tool: LuaTool<any>, opts?: ToolStepOptions): this;
|
|
297
315
|
approval(id: string, opts: ApprovalOptions): this;
|
|
298
316
|
waitForSignal(id: string, opts: WaitForSignalOptions): this;
|
|
299
|
-
/** nested run; depth ≤ 3 */
|
|
317
|
+
/** nested run; depth ≤ 3 — declares `id`, so a container may place it by string ref (03 §3.2.0) */
|
|
300
318
|
workflow(id: string, ref: LuaWorkflow | string, input?: LuaMapConfig, opts?: {
|
|
301
319
|
workspace?: 'inherit';
|
|
302
320
|
}): this;
|
|
@@ -344,6 +362,13 @@ export declare interface LuaWorkflowConfig {
|
|
|
344
362
|
/** NEVER set by hand — the compiler derives it from the source file. */
|
|
345
363
|
form?: 'graph' | 'script';
|
|
346
364
|
workspace?: WorkspaceSpec;
|
|
365
|
+
/**
|
|
366
|
+
* Declared connection keys. `workspace.credentialsRef` and a step's `requiredConnections` may name a
|
|
367
|
+
* `key` instead of a connection id; the engine resolves it against the owner agent's own connections
|
|
368
|
+
* at run time (agent-scoped first, then org-scoped — never a user's), so the same definition runs on
|
|
369
|
+
* a template install, a hand-built agent and a duplicate without a frozen id.
|
|
370
|
+
*/
|
|
371
|
+
connections?: WorkflowConnectionDeclaration[];
|
|
347
372
|
}
|
|
348
373
|
|
|
349
374
|
export declare interface LuaWorkflowStep<TIn extends ZodType = ZodType, TOut extends ZodType = ZodType, TResume extends ZodType = ZodType> {
|
|
@@ -582,6 +607,15 @@ export declare interface WorkflowBusinessHours {
|
|
|
582
607
|
};
|
|
583
608
|
}
|
|
584
609
|
|
|
610
|
+
declare interface WorkflowConnectionDeclaration {
|
|
611
|
+
/** /^[a-z][a-z0-9_-]{0,63}$/ — unique per workflow. */
|
|
612
|
+
key: string;
|
|
613
|
+
/** Catalog integration type (`'github'`, `'linear'`, …). */
|
|
614
|
+
integrationType: string;
|
|
615
|
+
required?: boolean;
|
|
616
|
+
description?: string;
|
|
617
|
+
}
|
|
618
|
+
|
|
585
619
|
export declare interface WorkflowFourEyes {
|
|
586
620
|
edit: WorkflowApproverSpec;
|
|
587
621
|
approve: WorkflowApproverSpec;
|