lua-cli 3.32.6 → 3.34.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 +100 -20
- package/dist/api-exports.js +1417 -713
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +2457 -1296
- package/dist/index.js.map +1 -1
- package/dist/workflow-builder.d.ts +21 -8
- package/dist/workflow-builder.js +724 -269
- 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 +6 -5
- 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
|
};
|
|
@@ -5674,8 +5704,15 @@ export declare type PreProcessorAction = 'proceed' | 'block';
|
|
|
5674
5704
|
export declare type PreProcessorBlockResponse = {
|
|
5675
5705
|
/** Stop processing immediately */
|
|
5676
5706
|
action: 'block';
|
|
5677
|
-
/**
|
|
5678
|
-
|
|
5707
|
+
/**
|
|
5708
|
+
* Message to show to the user.
|
|
5709
|
+
*
|
|
5710
|
+
* Omit it (or leave it empty) to end the turn SILENTLY — nothing is sent on
|
|
5711
|
+
* any channel. That is the supported way to stay quiet, e.g. while a human
|
|
5712
|
+
* agent is handling the conversation. The user's message is still recorded in
|
|
5713
|
+
* the agent's history; only the reply is suppressed.
|
|
5714
|
+
*/
|
|
5715
|
+
response?: string;
|
|
5679
5716
|
/** Optional metadata */
|
|
5680
5717
|
metadata?: Record<string, any>;
|
|
5681
5718
|
};
|
|
@@ -6594,9 +6631,25 @@ export declare interface TriggerContext<T = any> {
|
|
|
6594
6631
|
* `ctx.headers['x-hub-signature-256']`.
|
|
6595
6632
|
*/
|
|
6596
6633
|
/**
|
|
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
|
-
*
|
|
6634
|
+
* `transform` may start a workflow run instead of a chat turn (03 §3.7 / 07 §7.2.1 — WF-205, LUA-875):
|
|
6635
|
+
* `{ startWorkflow: { name, input?, idempotencyKey?, notify?, correlationKey?, tags?, initialState?, replyTo?, onBehalfOf? } }`.
|
|
6636
|
+
*
|
|
6637
|
+
* The contract, the same on an HTTP trigger (`POST /trigger/:agentId/:token`) and a device trigger:
|
|
6638
|
+
* - the run is created synchronously in the delivery request — `200 { status: 'accepted', executionId, runId }` —
|
|
6639
|
+
* as the system principal (`trigger: 'webhook'`, the trigger's id on `run.triggerId`; no user connections are
|
|
6640
|
+
* mounted), and NO chat turn fires. A `prompt` / `messages` beside `startWorkflow` is ignored: the presence of
|
|
6641
|
+
* `startWorkflow` decides. A declared `tool` still wins over the whole transform (the both-declared rule).
|
|
6642
|
+
* - `idempotencyKey` is the ONE uniqueness key: a redelivery with the same key returns the SAME run (the
|
|
6643
|
+
* execution log row is `started_workflow` with that run's id). A webhook delivery has no key of its own —
|
|
6644
|
+
* set it from the vendor's delivery id (`linear:${issue.identifier}:ready-for-agent`, Stripe `event.id`,
|
|
6645
|
+
* GitHub `X-GitHub-Delivery`); without one every delivery starts a run.
|
|
6646
|
+
* - `notify` defaults to `'off'` (a system-principal run has no creator to notify); `replyTo` / `onBehalfOf`
|
|
6647
|
+
* make the run `principalKind: 'customer'`; `initialState` seeds the run's state (≤ 64 KB).
|
|
6648
|
+
* - a missing `name`, an unknown workflow, an input failing the workflow's `inputSchema`, or a
|
|
6649
|
+
* `concurrencyPolicy: 'forbid'` overlap is a typed row in `lua triggers logs` (`failed` / `skipped_overlap`)
|
|
6650
|
+
* on a `200` — the sender is never asked to retry a configuration error.
|
|
6651
|
+
* `name` is the agent-local workflow name (or its id — an id-or-name lookup, exactly what
|
|
6652
|
+
* `lua workflows describe <ref>` resolves); `correlationKey` accepts a literal or a
|
|
6600
6653
|
* `'${input.<field>}'` template the trigger fills.
|
|
6601
6654
|
*/
|
|
6602
6655
|
declare interface TriggerStartWorkflow {
|
|
@@ -6604,12 +6657,21 @@ declare interface TriggerStartWorkflow {
|
|
|
6604
6657
|
name: string;
|
|
6605
6658
|
input?: unknown;
|
|
6606
6659
|
idempotencyKey?: string;
|
|
6660
|
+
/** receipt delivery; default `'off'` — a trigger start runs as the system principal. */
|
|
6661
|
+
notify?: 'emailApp' | 'email' | 'app' | 'off';
|
|
6607
6662
|
correlationKey?: string;
|
|
6608
6663
|
tags?: string[];
|
|
6664
|
+
/** seeds the run's state (≤ 64 KB) instead of `{}`. */
|
|
6665
|
+
initialState?: Record<string, unknown>;
|
|
6609
6666
|
replyTo?: {
|
|
6610
6667
|
channel: string;
|
|
6611
6668
|
threadId: string;
|
|
6612
6669
|
};
|
|
6670
|
+
/** a customer principal without a reply channel. */
|
|
6671
|
+
onBehalfOf?: {
|
|
6672
|
+
kind: 'customer';
|
|
6673
|
+
externalId: string;
|
|
6674
|
+
};
|
|
6613
6675
|
};
|
|
6614
6676
|
}
|
|
6615
6677
|
|
|
@@ -7289,7 +7351,7 @@ declare type WorkflowJobHarness_2 = (typeof WORKFLOW_JOB_HARNESSES)[number];
|
|
|
7289
7351
|
|
|
7290
7352
|
declare type WorkflowJobResources = (typeof WORKFLOW_JOB_RESOURCES)[number];
|
|
7291
7353
|
|
|
7292
|
-
export declare type WorkflowJobToolId = 'shell' | 'read' | 'write' | 'edit' | 'glob' | 'grep' | 'git' | 'gh' | 'fetch';
|
|
7354
|
+
export declare type WorkflowJobToolId = 'shell' | 'read' | 'write' | 'edit' | 'glob' | 'grep' | 'git' | 'gh' | 'fetch' | 'ripwire';
|
|
7293
7355
|
|
|
7294
7356
|
export declare interface WorkflowMergePolicy {
|
|
7295
7357
|
strategy: 'rebase' | 'merge';
|
|
@@ -7298,6 +7360,27 @@ export declare interface WorkflowMergePolicy {
|
|
|
7298
7360
|
|
|
7299
7361
|
declare type WorkflowOnError = (typeof WORKFLOW_ON_ERROR)[number];
|
|
7300
7362
|
|
|
7363
|
+
/**
|
|
7364
|
+
* Matches WorkflowRunDto (R4 `fields:'summary'` — outputs are never inlined here).
|
|
7365
|
+
* The wire names the run `runId` (shared-types `WorkflowRunSummary`); `id` is the pre-R4 spelling some
|
|
7366
|
+
* envelopes still carry — read through `runIdOf()` (LUA-668: `status` printed "Run undefined").
|
|
7367
|
+
*/
|
|
7368
|
+
/**
|
|
7369
|
+
* LUA-877 — R4 `fields:'full'` / R5 `outputRef`: how to dereference an offloaded `{__cdnRef}` / `{__datasetRef}`
|
|
7370
|
+
* `output`. `GET url` is R32: a `cdn` ref answers a presigned download of the canonical JSON (+ `sha256`); a
|
|
7371
|
+
* `dataset` ref answers the presigned NDJSON plus the first page of rows (`?offset&limit`). Needs
|
|
7372
|
+
* `workflows:read-outputs` on the run. Absent beside an inline output and without the grant.
|
|
7373
|
+
*/
|
|
7374
|
+
declare interface WorkflowOutputRefDto {
|
|
7375
|
+
kind: 'cdn' | 'dataset';
|
|
7376
|
+
artefactId: string;
|
|
7377
|
+
url: string;
|
|
7378
|
+
size?: number;
|
|
7379
|
+
sha256?: string;
|
|
7380
|
+
rowCount?: number;
|
|
7381
|
+
contentType: string;
|
|
7382
|
+
}
|
|
7383
|
+
|
|
7301
7384
|
export declare interface WorkflowOutputVisibility {
|
|
7302
7385
|
roles: string[];
|
|
7303
7386
|
users?: string[];
|
|
@@ -7316,11 +7399,6 @@ declare interface WorkflowRetryPolicy {
|
|
|
7316
7399
|
maxBackoffSeconds?: number;
|
|
7317
7400
|
}
|
|
7318
7401
|
|
|
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
7402
|
declare interface WorkflowRun {
|
|
7325
7403
|
id?: string;
|
|
7326
7404
|
runId?: string;
|
|
@@ -7387,6 +7465,8 @@ declare interface WorkflowRun {
|
|
|
7387
7465
|
output?: unknown;
|
|
7388
7466
|
/** LUA-643: ≤ 2 KB preview beside an offloaded `output`. */
|
|
7389
7467
|
outputPreview?: string;
|
|
7468
|
+
/** LUA-877: the R32 route that dereferences an offloaded `output` (beside the ref; absent on an inline output). */
|
|
7469
|
+
outputRef?: WorkflowOutputRefDto;
|
|
7390
7470
|
/** LUA-643: every shape says whether a result exists; `--steps` (`fields:'full'`) serves it. */
|
|
7391
7471
|
hasOutput?: boolean;
|
|
7392
7472
|
/**
|