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
package/dist/api-exports.d.ts
CHANGED
|
@@ -121,6 +121,14 @@ declare interface AgentInvocationInput {
|
|
|
121
121
|
/** Per-request model override ("provider/model" code). Unknown codes fall back per
|
|
122
122
|
* approved-models policy server-side. */
|
|
123
123
|
model?: string;
|
|
124
|
+
/**
|
|
125
|
+
* LUA-655 (review M2) — a platform re-ask the customer must not pay for: the workflow executor's
|
|
126
|
+
* output-repair turns. Honoured server-side ONLY on internally-authenticated turns
|
|
127
|
+
* (`buildChatRequest` drops a Bearer client's value): it rides `handleBilling` → lua-api's
|
|
128
|
+
* `deduct-credits` as `skipCredits`, which skips the legacy credit deduction (the seat gate and
|
|
129
|
+
* the settlement usage event still run, the skill-override posture).
|
|
130
|
+
*/
|
|
131
|
+
skipCredits?: boolean;
|
|
124
132
|
/** Task 14 (tasks-redesign) — per-task connector + skill scoping. See `AgentToolScope`. */
|
|
125
133
|
toolScope?: AgentToolScope_2;
|
|
126
134
|
/**
|
|
@@ -309,6 +317,15 @@ export declare interface AgentStepOptions {
|
|
|
309
317
|
harness?: WorkflowJobHarness;
|
|
310
318
|
/** Coding-turn cap for a tier:'job' step (1..500); absent ⇒ the platform default. A monorepo change needs more than the default. */
|
|
311
319
|
maxTurns?: number;
|
|
320
|
+
/**
|
|
321
|
+
* Per-ATTEMPT ceilings for a tier:'job' step (LUA-636): `maxTurns` bounds one harness query; these bound the whole
|
|
322
|
+
* attempt (every pass and resumed segment). Crossing one checkpoints the workspace and ends the attempt
|
|
323
|
+
* `attempt_budget_exhausted` — retryable, so the step's `retry` policy continues from that tree with a fresh
|
|
324
|
+
* session. `maxMessages` counts harness messages (one per content block; 1..5000, default 400),
|
|
325
|
+
* `maxInputTokens` the attempt's input-side tokens (prompt + cache; 1M..500M, default 30M).
|
|
326
|
+
*/
|
|
327
|
+
maxMessages?: number;
|
|
328
|
+
maxInputTokens?: number;
|
|
312
329
|
}
|
|
313
330
|
|
|
314
331
|
export declare interface AgentToolScope {
|
|
@@ -512,6 +529,15 @@ declare interface ApiResponse<T = any> {
|
|
|
512
529
|
error?: string;
|
|
513
530
|
oldAccountLabel?: string;
|
|
514
531
|
newAccountLabel?: string;
|
|
532
|
+
/** Workflow envelope detail (09 §9.11 `{ statusCode, message, code, ...detail }` is spread top-level). */
|
|
533
|
+
issues?: Array<{
|
|
534
|
+
path?: string;
|
|
535
|
+
message?: string;
|
|
536
|
+
code?: string;
|
|
537
|
+
}>;
|
|
538
|
+
stepId?: string;
|
|
539
|
+
/** the live step status on 409 NOT_SUSPENDED (LUA-644) */
|
|
540
|
+
status?: string;
|
|
515
541
|
};
|
|
516
542
|
}
|
|
517
543
|
|
|
@@ -875,9 +901,11 @@ declare interface BuiltWorkflow {
|
|
|
875
901
|
steps: Record<string, LuaWorkflowStep<any, any, any>>;
|
|
876
902
|
warnings: LuaWorkflowBuildWarning[];
|
|
877
903
|
envTemplateKeys: string[];
|
|
904
|
+
/** `.workflow(id, ref, …, { workspace })` targets; `workspace:'inherit'` marks an inherit child — the compiler defers `workspace-not-declared` for it (03 §3.1). */
|
|
878
905
|
nestedRefs: Array<{
|
|
879
906
|
id: string;
|
|
880
907
|
name: string;
|
|
908
|
+
workspace?: 'inherit';
|
|
881
909
|
}>;
|
|
882
910
|
}
|
|
883
911
|
|
|
@@ -4891,16 +4919,23 @@ export declare class LuaWorkflow {
|
|
|
4891
4919
|
getBuildWarnings(): LuaWorkflowBuildWarning[];
|
|
4892
4920
|
/** Every `env.template(KEY)` placeholder key the graph carries (sorted, deduped) — `ManifestWorkflow.envTemplateKeys`. */
|
|
4893
4921
|
getEnvTemplateKeys(): string[];
|
|
4894
|
-
/** `.workflow(id, ref)` targets by name — `ManifestWorkflow.workflowRefs
|
|
4922
|
+
/** `.workflow(id, ref)` targets by name — `ManifestWorkflow.workflowRefs`; `workspace:'inherit'` marks the inherit children the compiler defers `workspace-not-declared` for. */
|
|
4895
4923
|
getNestedWorkflowRefs(): Array<{
|
|
4896
4924
|
id: string;
|
|
4897
4925
|
name: string;
|
|
4926
|
+
workspace?: 'inherit';
|
|
4898
4927
|
}>;
|
|
4899
4928
|
/** Pure: no I/O, no env, no time. Called by the compiler in the VM tier and by `lua test`. */
|
|
4900
4929
|
__serializeGraph(): SerializedWorkflowGraph;
|
|
4901
4930
|
}
|
|
4902
4931
|
|
|
4903
|
-
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'
|
|
4932
|
+
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'
|
|
4933
|
+
/**
|
|
4934
|
+
* @deprecated LUA-635 — the builder no longer throws it: a mount with no envelope `workspace` is the SHARED validator's
|
|
4935
|
+
* verdict (deferred for an inherit child, 03 §3.1 table). Kept for one minor so a consumer switching on the union still
|
|
4936
|
+
* compiles; removed in the next.
|
|
4937
|
+
*/
|
|
4938
|
+
| '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';
|
|
4904
4939
|
|
|
4905
4940
|
export declare interface LuaWorkflowBuilder {
|
|
4906
4941
|
then(step: StepRef): this;
|
|
@@ -4938,7 +4973,7 @@ export declare interface LuaWorkflowBuilder {
|
|
|
4938
4973
|
toolStep(id: string, tool: LuaTool<any>, opts?: ToolStepOptions): this;
|
|
4939
4974
|
approval(id: string, opts: ApprovalOptions): this;
|
|
4940
4975
|
waitForSignal(id: string, opts: WaitForSignalOptions): this;
|
|
4941
|
-
/** nested run; depth ≤ 3 */
|
|
4976
|
+
/** nested run; depth ≤ 3 — declares `id`, so a container may place it by string ref (03 §3.2.0) */
|
|
4942
4977
|
workflow(id: string, ref: LuaWorkflow | string, input?: LuaMapConfig, opts?: {
|
|
4943
4978
|
workspace?: 'inherit';
|
|
4944
4979
|
}): this;
|
|
@@ -4986,6 +5021,13 @@ export declare interface LuaWorkflowConfig {
|
|
|
4986
5021
|
/** NEVER set by hand — the compiler derives it from the source file. */
|
|
4987
5022
|
form?: 'graph' | 'script';
|
|
4988
5023
|
workspace?: WorkspaceSpec;
|
|
5024
|
+
/**
|
|
5025
|
+
* Declared connection keys. `workspace.credentialsRef` and a step's `requiredConnections` may name a
|
|
5026
|
+
* `key` instead of a connection id; the engine resolves it against the owner agent's own connections
|
|
5027
|
+
* at run time (agent-scoped first, then org-scoped — never a user's), so the same definition runs on
|
|
5028
|
+
* a template install, a hand-built agent and a duplicate without a frozen id.
|
|
5029
|
+
*/
|
|
5030
|
+
connections?: WorkflowConnectionDeclaration[];
|
|
4989
5031
|
}
|
|
4990
5032
|
|
|
4991
5033
|
export declare interface LuaWorkflowStep<TIn extends ZodType = ZodType, TOut extends ZodType = ZodType, TResume extends ZodType = ZodType> {
|
|
@@ -7033,6 +7075,15 @@ export declare interface WorkflowBusinessHours {
|
|
|
7033
7075
|
};
|
|
7034
7076
|
}
|
|
7035
7077
|
|
|
7078
|
+
declare interface WorkflowConnectionDeclaration {
|
|
7079
|
+
/** /^[a-z][a-z0-9_-]{0,63}$/ — unique per workflow. */
|
|
7080
|
+
key: string;
|
|
7081
|
+
/** Catalog integration type (`'github'`, `'linear'`, …). */
|
|
7082
|
+
integrationType: string;
|
|
7083
|
+
required?: boolean;
|
|
7084
|
+
description?: string;
|
|
7085
|
+
}
|
|
7086
|
+
|
|
7036
7087
|
export declare interface WorkflowFourEyes {
|
|
7037
7088
|
edit: WorkflowApproverSpec;
|
|
7038
7089
|
approve: WorkflowApproverSpec;
|
|
@@ -7067,9 +7118,14 @@ export declare interface WorkflowOutputVisibility {
|
|
|
7067
7118
|
ownerBypass?: boolean;
|
|
7068
7119
|
}
|
|
7069
7120
|
|
|
7070
|
-
/**
|
|
7121
|
+
/**
|
|
7122
|
+
* Matches WorkflowRunDto (R4 `fields:'summary'` — outputs are never inlined here).
|
|
7123
|
+
* The wire names the run `runId` (shared-types `WorkflowRunSummary`); `id` is the pre-R4 spelling some
|
|
7124
|
+
* envelopes still carry — read through `runIdOf()` (LUA-668: `status` printed "Run undefined").
|
|
7125
|
+
*/
|
|
7071
7126
|
declare interface WorkflowRun {
|
|
7072
|
-
id
|
|
7127
|
+
id?: string;
|
|
7128
|
+
runId?: string;
|
|
7073
7129
|
workflowId: string;
|
|
7074
7130
|
workflowVersionId: string;
|
|
7075
7131
|
agentId: string;
|
|
@@ -7088,7 +7144,27 @@ declare interface WorkflowRun {
|
|
|
7088
7144
|
};
|
|
7089
7145
|
failureReason?: string;
|
|
7090
7146
|
restricted?: boolean;
|
|
7147
|
+
/** LUA-623: the keys the run's version declares, and what each resolved to on its agent (`connection.resolved` rows). */
|
|
7148
|
+
connections?: {
|
|
7149
|
+
declared: Array<{
|
|
7150
|
+
key: string;
|
|
7151
|
+
integrationType: string;
|
|
7152
|
+
required?: boolean;
|
|
7153
|
+
}>;
|
|
7154
|
+
resolved: Array<{
|
|
7155
|
+
key: string;
|
|
7156
|
+
connectionId: string;
|
|
7157
|
+
integrationType: string;
|
|
7158
|
+
scope: 'agent' | 'org';
|
|
7159
|
+
at: number;
|
|
7160
|
+
}>;
|
|
7161
|
+
};
|
|
7162
|
+
/** R4 `fields:'full'` only: the payload inline, else the `{__cdnRef}` it was offloaded under (LUA-643). */
|
|
7091
7163
|
output?: unknown;
|
|
7164
|
+
/** LUA-643: ≤ 2 KB preview beside an offloaded `output`. */
|
|
7165
|
+
outputPreview?: string;
|
|
7166
|
+
/** LUA-643: every shape says whether a result exists; `--steps` (`fields:'full'`) serves it. */
|
|
7167
|
+
hasOutput?: boolean;
|
|
7092
7168
|
createdAt: string;
|
|
7093
7169
|
startedAt?: string;
|
|
7094
7170
|
completedAt?: string;
|