lua-cli 3.49.2 → 3.50.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 +163 -16
- package/dist/api-exports.js +303 -23
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +316 -38
- package/dist/index.js.map +1 -1
- package/dist/workflow-builder.js +167 -17
- package/dist/workflow-builder.js.map +1 -1
- package/docs/README.md +3 -3
- package/docs/api/Agents.md +51 -9
- package/docs/api/Data.md +51 -0
- package/docs/api/Workflows.md +1 -0
- package/docs/workflows/schedules.md +1 -1
- package/package.json +3 -3
- package/template/package.json +1 -1
package/dist/api-exports.d.ts
CHANGED
|
@@ -708,9 +708,16 @@ export declare interface AgentsApi {
|
|
|
708
708
|
}): Promise<unknown>;
|
|
709
709
|
};
|
|
710
710
|
versions(agentId: string): {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
711
|
+
/**
|
|
712
|
+
* The target's agent versions, newest first (`supervision:observe`). `limit` is 1–50 (default 20). Optional:
|
|
713
|
+
* `status` keeps only those statuses (one, or a list); `offset` skips that many rows of the (filtered) list, so
|
|
714
|
+
* `{ limit: 50, offset: 50 }` is the second page. Page until a page is shorter than `limit`.
|
|
715
|
+
*
|
|
716
|
+
* Feature-detect: a platform older than these options ignores them and answers the newest `limit` rows of every
|
|
717
|
+
* status. Check that each row's `status` is one you asked for, and that an `offset` page starts BELOW the
|
|
718
|
+
* previous page's last `version`; if not, the platform does not support them yet.
|
|
719
|
+
*/
|
|
720
|
+
list(opts?: SupervisionVersionsListOptions): Promise<unknown>;
|
|
714
721
|
get(version: number): Promise<unknown>;
|
|
715
722
|
diff(from: number, to: number): Promise<unknown>;
|
|
716
723
|
/** Chat staged `version` (`supervision:preview`). No tools run unless `toolScope.skillIds` allowlists them. */
|
|
@@ -741,9 +748,11 @@ export declare interface AgentsApi {
|
|
|
741
748
|
expectActive: number;
|
|
742
749
|
}): Promise<unknown>;
|
|
743
750
|
/**
|
|
744
|
-
* Soft-delete `version` (`supervision:release`; only from a named workflow step)
|
|
745
|
-
*
|
|
746
|
-
* active version, never the last one.
|
|
751
|
+
* Soft-delete `version` (`supervision:release`; only from a named workflow step): a `superseded`
|
|
752
|
+
* version, or a `staged` one that was never active, is over 24 hours old and is not the newest
|
|
753
|
+
* staged version. Never the active version, never the last one. Refusals (409):
|
|
754
|
+
* `supervision_version_not_superseded` (active, deleted), `supervision_version_staged_was_active`,
|
|
755
|
+
* `supervision_version_staged_too_recent`, `supervision_version_staged_newest`.
|
|
747
756
|
*/
|
|
748
757
|
delete(version: number): Promise<{
|
|
749
758
|
deleted: true;
|
|
@@ -1150,6 +1159,18 @@ export declare interface AgentsApi {
|
|
|
1150
1159
|
*/
|
|
1151
1160
|
secrets(agentId: string): {
|
|
1152
1161
|
attach(requestIds: string[]): Promise<SecretAttachResult>;
|
|
1162
|
+
/**
|
|
1163
|
+
* Write ONE secret row into `agentId`'s own Data, from CODE (a workflow step or a job) so the secret never passes
|
|
1164
|
+
* through a model prompt: the row of `collection` whose `_pk` is `key` is replaced whole by `value` (flat fields:
|
|
1165
|
+
* string, finite number, boolean or null; at most 32 fields, 8 KB a string, 16 KB in all), or created. The agent
|
|
1166
|
+
* reads it with its own `Data.get(collection, { _pk: key })`. Needs `supervision:act` on `agentId` AND the
|
|
1167
|
+
* collection in the grant's `secretWriteCollections` (set only by an org admin; deny by default). The collection is
|
|
1168
|
+
* write-only for you: `Agents.data(agentId)` refuses it. Answers `{ ok, id, fingerprint }` and never the value;
|
|
1169
|
+
* the fingerprint is `sha256:` + the first 16 hex of SHA-256 over the stored row as JSON with sorted keys (`_pk`
|
|
1170
|
+
* included), so a token-free nudge carrying it tells the agent whether it already holds the row. Refused
|
|
1171
|
+
* `supervision_secret_write_not_granted` / `supervision_secret_bad_args`; not available offline.
|
|
1172
|
+
*/
|
|
1173
|
+
put(collection: string, key: string, value: Record<string, string | number | boolean | null>): Promise<SupervisedSecretPutResult>;
|
|
1153
1174
|
};
|
|
1154
1175
|
}
|
|
1155
1176
|
|
|
@@ -2033,7 +2054,7 @@ declare const BROWSER_COMMANDS: readonly [{
|
|
|
2033
2054
|
readonly description: "Upload local file(s) to a file input. Args: selector, files[].";
|
|
2034
2055
|
}, {
|
|
2035
2056
|
readonly name: "find";
|
|
2036
|
-
readonly description: "Act by semantic locator. Args: by(role|text|label|placeholder|alt|title|testid), query, action(click|fill|
|
|
2057
|
+
readonly description: "Act by semantic locator. Args: by(role|text|label|placeholder|alt|title|testid), query, action(click|fill|hover|check|text), value?, name?, exact?.";
|
|
2037
2058
|
}, {
|
|
2038
2059
|
readonly name: "act";
|
|
2039
2060
|
readonly description: "Act on the page: ref+action (deterministic) or natural-language instruction (engine AI). Args: ref?, action?, value?, instruction?.";
|
|
@@ -2042,7 +2063,7 @@ declare const BROWSER_COMMANDS: readonly [{
|
|
|
2042
2063
|
readonly description: "Extract data by natural-language instruction (engine AI). Args: instruction.";
|
|
2043
2064
|
}, {
|
|
2044
2065
|
readonly name: "wait";
|
|
2045
|
-
readonly description: "Wait for a condition. Provide one of: selector(
|
|
2066
|
+
readonly description: "Wait for a condition. Provide one of: selector (waits until it is visible), ms, text, url, load, fn.";
|
|
2046
2067
|
}, {
|
|
2047
2068
|
readonly name: "tab";
|
|
2048
2069
|
readonly description: "Manage tabs. Args: action(list|new|switch|close), target?, url?, label?.";
|
|
@@ -2066,7 +2087,7 @@ declare const BROWSER_COMMANDS: readonly [{
|
|
|
2066
2087
|
readonly description: "Manage web storage. Args: area(local|session), action(get|set|clear), key?, value?.";
|
|
2067
2088
|
}, {
|
|
2068
2089
|
readonly name: "set";
|
|
2069
|
-
readonly description: "Configure the browser. Args: setting(viewport|device|geo|headers|credentials|media), args[].";
|
|
2090
|
+
readonly description: "Configure the browser. Args: setting(viewport|device|geo|headers|credentials|media|offline), args[].";
|
|
2070
2091
|
}, {
|
|
2071
2092
|
readonly name: "download";
|
|
2072
2093
|
readonly description: "Download a file (click a selector to trigger, or wait for one). Args: selector?, path?.";
|
|
@@ -2096,7 +2117,7 @@ declare const BROWSER_COMMANDS: readonly [{
|
|
|
2096
2117
|
readonly description: "Low-level mouse. Args: action(move|down|up|wheel), x?, y?, button?, dy?, dx?.";
|
|
2097
2118
|
}, {
|
|
2098
2119
|
readonly name: "keyboard";
|
|
2099
|
-
readonly description: "Low-level keyboard at focus. Args: action(type|inserttext
|
|
2120
|
+
readonly description: "Low-level keyboard at focus. Args: action(type|inserttext), text. Use press for single keys and chords.";
|
|
2100
2121
|
}, {
|
|
2101
2122
|
readonly name: "state";
|
|
2102
2123
|
readonly description: "Persist/restore storage+auth state to a file. Args: action(save|load|list|clear), path?.";
|
|
@@ -2194,7 +2215,7 @@ export declare interface BrowserCommandInputs {
|
|
|
2194
2215
|
find: BrowserSessionInput & {
|
|
2195
2216
|
by: 'role' | 'text' | 'label' | 'placeholder' | 'alt' | 'title' | 'testid';
|
|
2196
2217
|
query: string;
|
|
2197
|
-
action: 'click' | 'fill' | '
|
|
2218
|
+
action: 'click' | 'fill' | 'hover' | 'check' | 'text';
|
|
2198
2219
|
value?: string;
|
|
2199
2220
|
name?: string;
|
|
2200
2221
|
exact?: boolean;
|
|
@@ -2210,7 +2231,7 @@ export declare interface BrowserCommandInputs {
|
|
|
2210
2231
|
};
|
|
2211
2232
|
wait: BrowserSessionInput & {
|
|
2212
2233
|
selector?: string;
|
|
2213
|
-
state?: 'visible'
|
|
2234
|
+
state?: 'visible';
|
|
2214
2235
|
ms?: number;
|
|
2215
2236
|
text?: string;
|
|
2216
2237
|
url?: string;
|
|
@@ -2288,9 +2309,8 @@ export declare interface BrowserCommandInputs {
|
|
|
2288
2309
|
dx?: number;
|
|
2289
2310
|
};
|
|
2290
2311
|
keyboard: BrowserSessionInput & {
|
|
2291
|
-
action: 'type' | 'inserttext'
|
|
2292
|
-
text
|
|
2293
|
-
key?: string;
|
|
2312
|
+
action: 'type' | 'inserttext';
|
|
2313
|
+
text: string;
|
|
2294
2314
|
};
|
|
2295
2315
|
state: BrowserSessionInput & {
|
|
2296
2316
|
action: 'save' | 'load' | 'list' | 'clear';
|
|
@@ -2927,8 +2947,10 @@ export declare interface ChatHistoryMessage {
|
|
|
2927
2947
|
* to render a "Voice call" divider in the thread.
|
|
2928
2948
|
*/
|
|
2929
2949
|
source?: 'voice' | 'chat';
|
|
2930
|
-
/**
|
|
2950
|
+
/** The model the assistant turn requested (catalog code), persisted in content metadata. */
|
|
2931
2951
|
model?: string;
|
|
2952
|
+
/** The catalog code of the model that served the turn's final step; differs from `model` when a fallback answered. */
|
|
2953
|
+
servedModel?: string;
|
|
2932
2954
|
/** True when the turn reached that model through the Auto selector. */
|
|
2933
2955
|
autoModelRequested?: boolean;
|
|
2934
2956
|
author?: {
|
|
@@ -3281,6 +3303,14 @@ declare interface CustomDataAPI {
|
|
|
3281
3303
|
* @returns Promise resolving to delete response
|
|
3282
3304
|
*/
|
|
3283
3305
|
delete(collectionName: string, entryId: string): Promise<DeleteCustomDataResponse>;
|
|
3306
|
+
/**
|
|
3307
|
+
* An org-shared Data collection (namespace) an org admin created and granted this agent. Returns the same surface
|
|
3308
|
+
* as `Data`, scoped to that namespace: `Data.shared('fleet_map').get('repos', { tier: 1 })`. Readers may call
|
|
3309
|
+
* `collections`, `get`, `getEntry` and `search`; writers may also `create`, `update`, `patch`, `increment` and
|
|
3310
|
+
* `delete`. A call outside the ACL rejects with `code === 'shared_data_forbidden'` (403). Deployed agents only:
|
|
3311
|
+
* local runs reject with `code === 'shared_data_unavailable_offline'`.
|
|
3312
|
+
*/
|
|
3313
|
+
shared(name: string): SharedDataAPI;
|
|
3284
3314
|
}
|
|
3285
3315
|
|
|
3286
3316
|
/** One collection in the agent's Data namespace, from Data.collections(). */
|
|
@@ -3501,6 +3531,29 @@ export declare const Data: {
|
|
|
3501
3531
|
* @returns Promise resolving when deletion is complete
|
|
3502
3532
|
*/
|
|
3503
3533
|
delete(collectionName: string, entryId: string): Promise<DeleteCustomDataResponse>;
|
|
3534
|
+
/**
|
|
3535
|
+
* An org-shared Data collection (namespace). An org admin creates it and names which agents of the org may read
|
|
3536
|
+
* and which may write it (`POST /admin/orgs/:orgId/shared-collections`); agents never create one. The handle has
|
|
3537
|
+
* the same methods as `Data`, scoped to the namespace, so a namespace can hold several collections:
|
|
3538
|
+
*
|
|
3539
|
+
* ```typescript
|
|
3540
|
+
* const map = Data.shared('fleet_map');
|
|
3541
|
+
* await map.create('repos', { repo: 'lua-core-services', tier: 1 }, { searchText: 'backend monorepo' }); // writers
|
|
3542
|
+
* const { data } = await map.get('repos', { tier: 1 }); // readers
|
|
3543
|
+
* const hits = await map.search('edges', 'who calls lua-agents', 10);
|
|
3544
|
+
* ```
|
|
3545
|
+
*
|
|
3546
|
+
* - Readers may `collections`, `get`, `getEntry`, `search`; writers may also `create`, `update`, `patch`,
|
|
3547
|
+
* `increment`, `delete` (a writer can read). Anything else rejects with `code === 'shared_data_forbidden'`
|
|
3548
|
+
* (403) — also when the name does not exist or belongs to another org.
|
|
3549
|
+
* - Same limits, filters, managed indexes, compare-and-swap and vector search as `Data`. Every write is audited
|
|
3550
|
+
* (agent, collection, entry id; never the value).
|
|
3551
|
+
* - A test session may read but not write (`shared_data_test_session_write_refused`, 409).
|
|
3552
|
+
* - Deployed agents only: under `lua test` every call rejects with `code === 'shared_data_unavailable_offline'`.
|
|
3553
|
+
*
|
|
3554
|
+
* @param name - The shared collection name the org admin created (1-128 of `[A-Za-z0-9_.-]`)
|
|
3555
|
+
*/
|
|
3556
|
+
shared(name: string): SharedDataAPI;
|
|
3504
3557
|
};
|
|
3505
3558
|
|
|
3506
3559
|
/**
|
|
@@ -5619,6 +5672,10 @@ declare interface LlmContextStep {
|
|
|
5619
5672
|
reasoningTokens?: number;
|
|
5620
5673
|
/** The model id the provider says served the step (a fallback leg names itself here). Cost only. */
|
|
5621
5674
|
model?: string;
|
|
5675
|
+
/** The catalog code of the leg that served the step. Audit only: settlement never reads it. */
|
|
5676
|
+
servedModel?: string;
|
|
5677
|
+
/** The step was rejected by an output processor and re-run; its reply never reached the user. Audit only. */
|
|
5678
|
+
discarded?: boolean;
|
|
5622
5679
|
}
|
|
5623
5680
|
|
|
5624
5681
|
declare type LoadState = 'load' | 'domcontentloaded' | 'networkidle';
|
|
@@ -9327,6 +9384,29 @@ declare interface RequestOverrides {
|
|
|
9327
9384
|
signal?: AbortSignal;
|
|
9328
9385
|
}
|
|
9329
9386
|
|
|
9387
|
+
/**
|
|
9388
|
+
* R13 — `ResolveApprovalResult` (§9.5.3; matches shared-types). LUA-759 (#2582 review): the no-op's `decidedBy` is
|
|
9389
|
+
* the spec's `WorkflowActorRef` — lua-api projects lua-core's trimmed `{kind, id, at, via}` record onto it, as it
|
|
9390
|
+
* does R12 / R36 / R37's `recorded.by` — never a string (the old `string` declaration printed `[object Object]`).
|
|
9391
|
+
*/
|
|
9392
|
+
declare type ResolveApprovalResult = {
|
|
9393
|
+
resolved: true;
|
|
9394
|
+
outcome: 'approved' | 'denied';
|
|
9395
|
+
runStatus: WorkflowRunStatus;
|
|
9396
|
+
stepId?: string;
|
|
9397
|
+
} | {
|
|
9398
|
+
resolved: false;
|
|
9399
|
+
outcome: 'noop';
|
|
9400
|
+
reason: 'already_resolved' | 'expired' | 'cancelled' | 'run_gone';
|
|
9401
|
+
decision?: 'approved' | 'denied' | 'expired';
|
|
9402
|
+
/** `approveResultLine` prints it as `<subjectId> via <source>`; an older lua-api's raw lua-core actor falls back to `actorLabel`. */
|
|
9403
|
+
decidedBy?: {
|
|
9404
|
+
subjectType: string;
|
|
9405
|
+
subjectId: string;
|
|
9406
|
+
source: string;
|
|
9407
|
+
};
|
|
9408
|
+
};
|
|
9409
|
+
|
|
9330
9410
|
/**
|
|
9331
9411
|
* R12 — `ResumeStepResult` (§9.5.3): the loser of a resume race gets the recorded outcome, never a 4xx. LUA-738
|
|
9332
9412
|
* (desktop #1018): `recorded.by` is the spec's `WorkflowActorRef` — lua-api projects lua-core's `{ kind, id }` onto
|
|
@@ -9698,6 +9778,16 @@ export declare interface SendTemplateValues {
|
|
|
9698
9778
|
|
|
9699
9779
|
export { SerializedWorkflowGraph }
|
|
9700
9780
|
|
|
9781
|
+
/** `Data.shared(name)`: the `Data` surface on an org-shared namespace (it does not nest). */
|
|
9782
|
+
export declare type SharedDataAPI = Omit<CustomDataAPI, 'shared'>;
|
|
9783
|
+
|
|
9784
|
+
/** Thrown by `Data.shared(name)` outside a deployed agent. `code` is the stable part. */
|
|
9785
|
+
export declare class SharedDataError extends Error {
|
|
9786
|
+
readonly code: string;
|
|
9787
|
+
readonly name = "SharedDataError";
|
|
9788
|
+
constructor(code: string, message: string);
|
|
9789
|
+
}
|
|
9790
|
+
|
|
9701
9791
|
/** R14 — 202 `{ accepted:true, signalId, consumed, stepId? }` · 200 `{ accepted:true, duplicate:true }` · 202 `{ accepted:false, reason }`. */
|
|
9702
9792
|
declare interface SignalRunResult {
|
|
9703
9793
|
accepted: boolean;
|
|
@@ -9812,6 +9902,15 @@ export declare interface SupervisedJobRegisterResult {
|
|
|
9812
9902
|
registered: boolean;
|
|
9813
9903
|
}
|
|
9814
9904
|
|
|
9905
|
+
/** What `secrets.put` answers: never the value. */
|
|
9906
|
+
declare interface SupervisedSecretPutResult {
|
|
9907
|
+
ok: true;
|
|
9908
|
+
/** The Data entry id of the row written (stable across later puts of the same key). */
|
|
9909
|
+
id: string;
|
|
9910
|
+
/** {@link SUPERVISED_SECRET_FINGERPRINT_DOC}. */
|
|
9911
|
+
fingerprint: string;
|
|
9912
|
+
}
|
|
9913
|
+
|
|
9815
9914
|
/** `workflows.get` — metadata only: never the graph, script, code or tools. */
|
|
9816
9915
|
declare interface SupervisedWorkflow {
|
|
9817
9916
|
workflowId: string;
|
|
@@ -10137,6 +10236,19 @@ declare interface SupervisionRunSummary {
|
|
|
10137
10236
|
completedAt?: number;
|
|
10138
10237
|
}
|
|
10139
10238
|
|
|
10239
|
+
/** Options of `Agents.versions(id).list` (supervision `versions.list`). */
|
|
10240
|
+
export declare interface SupervisionVersionsListOptions {
|
|
10241
|
+
/** Page size, 1–50 (default 20; larger values are clamped to 50). */
|
|
10242
|
+
limit?: number;
|
|
10243
|
+
/** Keep only these statuses (one, or a non-empty list). Omitted = every status, soft-deleted included. */
|
|
10244
|
+
status?: SupervisionVersionStatus | SupervisionVersionStatus[];
|
|
10245
|
+
/** Rows of the (filtered) newest-first list to skip, 0–10000 — `limit: 50, offset: 50` is the second page. */
|
|
10246
|
+
offset?: number;
|
|
10247
|
+
}
|
|
10248
|
+
|
|
10249
|
+
/** An agent version's lifecycle status, as a supervision `versions.list` filter. */
|
|
10250
|
+
export declare type SupervisionVersionStatus = 'active' | 'staged' | 'superseded' | 'deleted';
|
|
10251
|
+
|
|
10140
10252
|
/**
|
|
10141
10253
|
* Why an unattended run could not finish, reported by the agent itself instead
|
|
10142
10254
|
* of being guessed from its prose. The platform — not the agent — writes every
|
|
@@ -11982,6 +12094,41 @@ export declare interface WorkflowsApi {
|
|
|
11982
12094
|
note?: string;
|
|
11983
12095
|
}): Promise<Record<string, unknown>>;
|
|
11984
12096
|
};
|
|
12097
|
+
/**
|
|
12098
|
+
* Act as the SIGNED-IN VIEWER of a web-app route, never as the agent: the decision is authorized and audited
|
|
12099
|
+
* exactly as if that person decided it themselves (agent access, approver / four-eyes / step-up rules,
|
|
12100
|
+
* `decidedBy` = the viewer). Available only inside a `defineWebApp` route handler for a POST, PUT, PATCH or
|
|
12101
|
+
* DELETE call; anywhere else it throws `WorkflowsApiError` code `viewer_unavailable`. Under `lua apps dev` /
|
|
12102
|
+
* `lua test webapp` the route runs as you, so the call is made with your own CLI credentials.
|
|
12103
|
+
*
|
|
12104
|
+
* An approval that demands step-up or a specific surface answers `STEP_UP_REQUIRED` / `APPROVAL_SURFACE_DENIED`:
|
|
12105
|
+
* decide those in the Inbox. Other refusals pass through with their own codes (`NOT_AN_APPROVER`,
|
|
12106
|
+
* `FOUR_EYES_REQUIRED`, `APPROVAL_NOT_FOUND`, `PAYLOAD_MISMATCH`, …).
|
|
12107
|
+
*
|
|
12108
|
+
* @example
|
|
12109
|
+
* ```typescript
|
|
12110
|
+
* 'POST /approvals/:runId/:approvalId': route({
|
|
12111
|
+
* handler: async ({ params, body }) =>
|
|
12112
|
+
* json(await Workflows.viewer.decideApproval(params.runId, params.approvalId, { decision: body.decision, note: body.note })),
|
|
12113
|
+
* }),
|
|
12114
|
+
* ```
|
|
12115
|
+
*/
|
|
12116
|
+
viewer: {
|
|
12117
|
+
/**
|
|
12118
|
+
* R13 — approve or deny an approval as the viewer. `agentId` names the agent that owns the run (default: the
|
|
12119
|
+
* app's own agent); the viewer must be able to decide on that agent's runs, as in the Inbox.
|
|
12120
|
+
*/
|
|
12121
|
+
decideApproval(runId: string, approvalId: string, decision: {
|
|
12122
|
+
decision: 'approve' | 'deny';
|
|
12123
|
+
note?: string;
|
|
12124
|
+
expectedFingerprint?: string;
|
|
12125
|
+
agentId?: string;
|
|
12126
|
+
}): Promise<ResolveApprovalResult>;
|
|
12127
|
+
/** R12 — answer a step waiting for input (`suspend` / ask) as the viewer; `opts.agentId` as for decideApproval. */
|
|
12128
|
+
resume(runId: string, stepId: string, resumeData: unknown, opts?: {
|
|
12129
|
+
agentId?: string;
|
|
12130
|
+
}): Promise<ResumeStepResult>;
|
|
12131
|
+
};
|
|
11985
12132
|
}
|
|
11986
12133
|
|
|
11987
12134
|
export { WorkflowShell }
|