lua-cli 3.32.6 → 3.33.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 +91 -18
- package/dist/api-exports.js +1138 -746
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +2117 -1281
- package/dist/index.js.map +1 -1
- package/dist/workflow-builder.d.ts +21 -8
- package/dist/workflow-builder.js +401 -258
- package/dist/workflow-builder.js.map +1 -1
- package/docs/CLI_REFERENCE.md +13 -11
- package/docs/README.md +2 -2
- package/docs/api/AI.md +9 -8
- package/docs/api/LuaAgent.md +5 -5
- package/docs/api/LuaWorkflow.md +16 -16
- package/docs/workflows/artefacts-and-datasets.md +4 -0
- package/docs/workflows/workspaces-and-long-steps.md +2 -2
- package/package.json +4 -3
- package/template/examples/workflows/linear-ready.trigger.ts +20 -9
- package/template/package.json +1 -1
package/dist/api-exports.d.ts
CHANGED
|
@@ -589,6 +589,20 @@ declare interface ApiResponse<T = any> {
|
|
|
589
589
|
/** LUA-812 — 503 VENDOR_UNAVAILABLE: the third-party vendor behind the API that failed (`unified` | `github` |
|
|
590
590
|
* `pusher` | `google`); `retryAfterSeconds` above is present only when a blind retry is safe. */
|
|
591
591
|
vendor?: string;
|
|
592
|
+
/** The vendor's own HTTP status when it answered (LUA-812); absent when nothing came back. */
|
|
593
|
+
vendorStatus?: number;
|
|
594
|
+
/** LUA-826 — on a 503 VENDOR_UNAVAILABLE from the GitHub token mint / the Unified.to passthrough: the code the
|
|
595
|
+
* site served before it moved to the shared one (`PROVIDER_ERROR` | `passthrough_upstream_error`) and its former
|
|
596
|
+
* line. One release, then gone — branch on `code`; these are for a script that still greps the old string. */
|
|
597
|
+
legacyCode?: string;
|
|
598
|
+
legacyMessage?: string;
|
|
599
|
+
/** LUA-820 — 424 PROVIDER_REJECTED: the model provider behind the agent refused the request (lua-core `provider-outcome.ts`):
|
|
600
|
+
* the provider's own status, the refusal reason (`invalid_api_key` | `forbidden` | `model_not_found` | `content_refused` |
|
|
601
|
+
* `quota_exhausted` | `bad_request`) and whose key it refused; `transient` is `false` — the mirror of a 503's `true`. */
|
|
602
|
+
providerStatus?: number;
|
|
603
|
+
reason?: string;
|
|
604
|
+
keyOwner?: 'platform' | 'byok';
|
|
605
|
+
transient?: boolean;
|
|
592
606
|
};
|
|
593
607
|
}
|
|
594
608
|
|
|
@@ -2073,11 +2087,16 @@ declare type FileMessage_2 = {
|
|
|
2073
2087
|
};
|
|
2074
2088
|
|
|
2075
2089
|
export declare interface ForeachOptions {
|
|
2076
|
-
/**
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2090
|
+
/**
|
|
2091
|
+
* Cluster G (B34): PURE builder lowering — emits `{ type:'mapping', id:'<foreachId>_items', mapConfig:{'': items} }`
|
|
2092
|
+
* before the foreach entry. The lowering carries a typed path ref (`init('rows')` / `step(x).path('list')`), an
|
|
2093
|
+
* `initData` descriptor (`fromInit('rows')`; `path` optional = the whole input) or a single-step descriptor
|
|
2094
|
+
* (`fromStep(x, 'list')`). The slot admits the whole `MapDescriptor` union because that is what every descriptor
|
|
2095
|
+
* factory is declared to return (LUA-864) — the members the lowering does not carry (`value` / `template` /
|
|
2096
|
+
* `fromRequest` / `rows` / `fromKnowledge`, a fan-in `fromStep([…])`) are `invalid-envelope` at build:
|
|
2097
|
+
* `.map({ '': … }, { id })` before the foreach instead.
|
|
2098
|
+
*/
|
|
2099
|
+
items?: TypedRef<unknown[]> | MapDescriptor | {
|
|
2081
2100
|
initData: true;
|
|
2082
2101
|
path?: string;
|
|
2083
2102
|
};
|
|
@@ -3815,8 +3834,11 @@ export declare interface LuaTriggerConfig<T = any> {
|
|
|
3815
3834
|
/** Skip invocation (HTTP 200, no agent run) when this returns false. */
|
|
3816
3835
|
filter?: (ctx: TriggerContext<T>) => boolean | Promise<boolean>;
|
|
3817
3836
|
/**
|
|
3818
|
-
* Shape the agent input. Return a `string` (the message)
|
|
3819
|
-
* `AgentInvocationInput` (you own the turn)
|
|
3837
|
+
* Shape the agent input. Return a `string` (the message), a full
|
|
3838
|
+
* `AgentInvocationInput` (you own the turn), or `{ startWorkflow: { name, … } }`
|
|
3839
|
+
* to start a workflow run instead of a chat turn (`TriggerStartWorkflow` — the
|
|
3840
|
+
* run is created in the delivery request, `trigger: 'webhook'`, and the
|
|
3841
|
+
* execution log row carries its `runId`). Returning null/undefined is an
|
|
3820
3842
|
* error — use `filter` to skip. Omit to use the default `body → message`,
|
|
3821
3843
|
* whose payload is capped at ~50k chars (like a no-code trigger); return a
|
|
3822
3844
|
* transform to forward larger or hand-picked fields as the message.
|
|
@@ -5104,8 +5126,16 @@ export declare interface LuaWorkflowConfig {
|
|
|
5104
5126
|
* for how many attempts the run may make.
|
|
5105
5127
|
*/
|
|
5106
5128
|
budget?: Pick<WorkflowDefinitionBudget, 'maxCredits' | 'maxSteps' | 'maxDurationSeconds'>;
|
|
5107
|
-
/**
|
|
5108
|
-
|
|
5129
|
+
/**
|
|
5130
|
+
* verbatim LuaJob union (D12) → Job{kind:'workflow'} on publish. `runAs` (LUA-779) governs the copy a
|
|
5131
|
+
* marketplace template freezes from this schedule: `'installer'` (the default when absent — every install's
|
|
5132
|
+
* fires run as the person who installed, who gets the run card in their inbox) or `'system'` (the frozen copy
|
|
5133
|
+
* runs user-less and unwatched — no inbox card for its runs; the install response says so). On this agent the
|
|
5134
|
+
* schedule runs as you either way.
|
|
5135
|
+
*/
|
|
5136
|
+
schedule?: JobSchedule & {
|
|
5137
|
+
runAs?: 'installer' | 'system';
|
|
5138
|
+
};
|
|
5109
5139
|
backfillOnEnable?: {
|
|
5110
5140
|
maxOccurrences?: number;
|
|
5111
5141
|
};
|
|
@@ -6594,9 +6624,25 @@ export declare interface TriggerContext<T = any> {
|
|
|
6594
6624
|
* `ctx.headers['x-hub-signature-256']`.
|
|
6595
6625
|
*/
|
|
6596
6626
|
/**
|
|
6597
|
-
* `transform` may start a workflow run instead of a chat turn (03 §3.7 / 07 — WF-205):
|
|
6598
|
-
* `{ startWorkflow: { name, input?, idempotencyKey?, correlationKey?, tags? } }`.
|
|
6599
|
-
*
|
|
6627
|
+
* `transform` may start a workflow run instead of a chat turn (03 §3.7 / 07 §7.2.1 — WF-205, LUA-875):
|
|
6628
|
+
* `{ startWorkflow: { name, input?, idempotencyKey?, notify?, correlationKey?, tags?, initialState?, replyTo?, onBehalfOf? } }`.
|
|
6629
|
+
*
|
|
6630
|
+
* The contract, the same on an HTTP trigger (`POST /trigger/:agentId/:token`) and a device trigger:
|
|
6631
|
+
* - the run is created synchronously in the delivery request — `200 { status: 'accepted', executionId, runId }` —
|
|
6632
|
+
* as the system principal (`trigger: 'webhook'`, the trigger's id on `run.triggerId`; no user connections are
|
|
6633
|
+
* mounted), and NO chat turn fires. A `prompt` / `messages` beside `startWorkflow` is ignored: the presence of
|
|
6634
|
+
* `startWorkflow` decides. A declared `tool` still wins over the whole transform (the both-declared rule).
|
|
6635
|
+
* - `idempotencyKey` is the ONE uniqueness key: a redelivery with the same key returns the SAME run (the
|
|
6636
|
+
* execution log row is `started_workflow` with that run's id). A webhook delivery has no key of its own —
|
|
6637
|
+
* set it from the vendor's delivery id (`linear:${issue.identifier}:ready-for-agent`, Stripe `event.id`,
|
|
6638
|
+
* GitHub `X-GitHub-Delivery`); without one every delivery starts a run.
|
|
6639
|
+
* - `notify` defaults to `'off'` (a system-principal run has no creator to notify); `replyTo` / `onBehalfOf`
|
|
6640
|
+
* make the run `principalKind: 'customer'`; `initialState` seeds the run's state (≤ 64 KB).
|
|
6641
|
+
* - a missing `name`, an unknown workflow, an input failing the workflow's `inputSchema`, or a
|
|
6642
|
+
* `concurrencyPolicy: 'forbid'` overlap is a typed row in `lua triggers logs` (`failed` / `skipped_overlap`)
|
|
6643
|
+
* on a `200` — the sender is never asked to retry a configuration error.
|
|
6644
|
+
* `name` is the agent-local workflow name (or its id — an id-or-name lookup, exactly what
|
|
6645
|
+
* `lua workflows describe <ref>` resolves); `correlationKey` accepts a literal or a
|
|
6600
6646
|
* `'${input.<field>}'` template the trigger fills.
|
|
6601
6647
|
*/
|
|
6602
6648
|
declare interface TriggerStartWorkflow {
|
|
@@ -6604,12 +6650,21 @@ declare interface TriggerStartWorkflow {
|
|
|
6604
6650
|
name: string;
|
|
6605
6651
|
input?: unknown;
|
|
6606
6652
|
idempotencyKey?: string;
|
|
6653
|
+
/** receipt delivery; default `'off'` — a trigger start runs as the system principal. */
|
|
6654
|
+
notify?: 'emailApp' | 'email' | 'app' | 'off';
|
|
6607
6655
|
correlationKey?: string;
|
|
6608
6656
|
tags?: string[];
|
|
6657
|
+
/** seeds the run's state (≤ 64 KB) instead of `{}`. */
|
|
6658
|
+
initialState?: Record<string, unknown>;
|
|
6609
6659
|
replyTo?: {
|
|
6610
6660
|
channel: string;
|
|
6611
6661
|
threadId: string;
|
|
6612
6662
|
};
|
|
6663
|
+
/** a customer principal without a reply channel. */
|
|
6664
|
+
onBehalfOf?: {
|
|
6665
|
+
kind: 'customer';
|
|
6666
|
+
externalId: string;
|
|
6667
|
+
};
|
|
6613
6668
|
};
|
|
6614
6669
|
}
|
|
6615
6670
|
|
|
@@ -7289,7 +7344,7 @@ declare type WorkflowJobHarness_2 = (typeof WORKFLOW_JOB_HARNESSES)[number];
|
|
|
7289
7344
|
|
|
7290
7345
|
declare type WorkflowJobResources = (typeof WORKFLOW_JOB_RESOURCES)[number];
|
|
7291
7346
|
|
|
7292
|
-
export declare type WorkflowJobToolId = 'shell' | 'read' | 'write' | 'edit' | 'glob' | 'grep' | 'git' | 'gh' | 'fetch';
|
|
7347
|
+
export declare type WorkflowJobToolId = 'shell' | 'read' | 'write' | 'edit' | 'glob' | 'grep' | 'git' | 'gh' | 'fetch' | 'ripwire';
|
|
7293
7348
|
|
|
7294
7349
|
export declare interface WorkflowMergePolicy {
|
|
7295
7350
|
strategy: 'rebase' | 'merge';
|
|
@@ -7298,6 +7353,27 @@ export declare interface WorkflowMergePolicy {
|
|
|
7298
7353
|
|
|
7299
7354
|
declare type WorkflowOnError = (typeof WORKFLOW_ON_ERROR)[number];
|
|
7300
7355
|
|
|
7356
|
+
/**
|
|
7357
|
+
* Matches WorkflowRunDto (R4 `fields:'summary'` — outputs are never inlined here).
|
|
7358
|
+
* The wire names the run `runId` (shared-types `WorkflowRunSummary`); `id` is the pre-R4 spelling some
|
|
7359
|
+
* envelopes still carry — read through `runIdOf()` (LUA-668: `status` printed "Run undefined").
|
|
7360
|
+
*/
|
|
7361
|
+
/**
|
|
7362
|
+
* LUA-877 — R4 `fields:'full'` / R5 `outputRef`: how to dereference an offloaded `{__cdnRef}` / `{__datasetRef}`
|
|
7363
|
+
* `output`. `GET url` is R32: a `cdn` ref answers a presigned download of the canonical JSON (+ `sha256`); a
|
|
7364
|
+
* `dataset` ref answers the presigned NDJSON plus the first page of rows (`?offset&limit`). Needs
|
|
7365
|
+
* `workflows:read-outputs` on the run. Absent beside an inline output and without the grant.
|
|
7366
|
+
*/
|
|
7367
|
+
declare interface WorkflowOutputRefDto {
|
|
7368
|
+
kind: 'cdn' | 'dataset';
|
|
7369
|
+
artefactId: string;
|
|
7370
|
+
url: string;
|
|
7371
|
+
size?: number;
|
|
7372
|
+
sha256?: string;
|
|
7373
|
+
rowCount?: number;
|
|
7374
|
+
contentType: string;
|
|
7375
|
+
}
|
|
7376
|
+
|
|
7301
7377
|
export declare interface WorkflowOutputVisibility {
|
|
7302
7378
|
roles: string[];
|
|
7303
7379
|
users?: string[];
|
|
@@ -7316,11 +7392,6 @@ declare interface WorkflowRetryPolicy {
|
|
|
7316
7392
|
maxBackoffSeconds?: number;
|
|
7317
7393
|
}
|
|
7318
7394
|
|
|
7319
|
-
/**
|
|
7320
|
-
* Matches WorkflowRunDto (R4 `fields:'summary'` — outputs are never inlined here).
|
|
7321
|
-
* The wire names the run `runId` (shared-types `WorkflowRunSummary`); `id` is the pre-R4 spelling some
|
|
7322
|
-
* envelopes still carry — read through `runIdOf()` (LUA-668: `status` printed "Run undefined").
|
|
7323
|
-
*/
|
|
7324
7395
|
declare interface WorkflowRun {
|
|
7325
7396
|
id?: string;
|
|
7326
7397
|
runId?: string;
|
|
@@ -7387,6 +7458,8 @@ declare interface WorkflowRun {
|
|
|
7387
7458
|
output?: unknown;
|
|
7388
7459
|
/** LUA-643: ≤ 2 KB preview beside an offloaded `output`. */
|
|
7389
7460
|
outputPreview?: string;
|
|
7461
|
+
/** LUA-877: the R32 route that dereferences an offloaded `output` (beside the ref; absent on an inline output). */
|
|
7462
|
+
outputRef?: WorkflowOutputRefDto;
|
|
7390
7463
|
/** LUA-643: every shape says whether a result exists; `--steps` (`fields:'full'`) serves it. */
|
|
7391
7464
|
hasOutput?: boolean;
|
|
7392
7465
|
/**
|