lua-cli 3.48.0 → 3.49.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.
@@ -199,6 +199,9 @@ declare interface AgentInvocationEffects {
199
199
  /** Set once per run when the agent reported it could not finish. Trusted
200
200
  * side channel: the run's own account of why, not a regex over its prose. */
201
201
  blocker?: TaskRunBlocker;
202
+ /** BAC-1974: set when an unattended task run reported it had nothing to tell
203
+ * the user. Same vocabulary as a workflow's declared `neutral` outcome (BAC-1949). */
204
+ declaredOutcome?: 'neutral';
202
205
  }
203
206
 
204
207
  export declare interface AgentInvocationInput {
@@ -388,6 +391,11 @@ declare interface AgentInvocationMeter {
388
391
  * that advertises no reasoning) — a non-effort turn's meter is byte-identical to today's.
389
392
  */
390
393
  effortApplied?: ReasoningEffort;
394
+ /**
395
+ * BAC-1976 — how many model steps the turn ran (`fullOutput.steps.length`), so the workflow worker can tell a
396
+ * step that hit the agent step cap from a clean finish. Server-owned like `effortApplied`; absent when unknown.
397
+ */
398
+ modelSteps?: number;
391
399
  }
392
400
 
393
401
  declare interface AgentInvocationOutput {
@@ -1935,23 +1943,542 @@ export declare interface BatchingConfig {
1935
1943
  serializeProcessing?: boolean;
1936
1944
  }
1937
1945
 
1946
+ export declare const Browser: BrowserApi;
1947
+
1948
+ /**
1949
+ * The full command surface (mirrors the desktop bridge's registry). Grouped the
1950
+ * way the agent-browser CLI groups them so the surface is complete without
1951
+ * 50+ near-duplicate names.
1952
+ */
1953
+ declare const BROWSER_COMMANDS: readonly [{
1954
+ readonly name: "health";
1955
+ readonly description: "Check the local browser engine is installed and responsive.";
1956
+ }, {
1957
+ readonly name: "session_open";
1958
+ readonly description: "Open/attach a browser session (its own cookies/auth). Args: url?, headed?, profile?, confirmActions?. Only use the browser when the user explicitly asked for it, or said yes when you asked.";
1959
+ }, {
1960
+ readonly name: "navigate";
1961
+ readonly description: "Navigate the session to a URL. Args: url, waitUntil?. Only use the browser when the user explicitly asked for it, or said yes when you asked.";
1962
+ }, {
1963
+ readonly name: "back";
1964
+ readonly description: "Go back in history.";
1965
+ }, {
1966
+ readonly name: "forward";
1967
+ readonly description: "Go forward in history.";
1968
+ }, {
1969
+ readonly name: "reload";
1970
+ readonly description: "Reload the current page.";
1971
+ }, {
1972
+ readonly name: "pushstate";
1973
+ readonly description: "SPA client-side navigation. Args: url.";
1974
+ }, {
1975
+ readonly name: "close";
1976
+ readonly description: "Close the session’s browser.";
1977
+ }, {
1978
+ readonly name: "read";
1979
+ readonly description: "Read one page in a fresh session that is closed afterwards: open the URL, wait, return its title and content. Args: url, waitFor?(load|networkidle|selector), selector?, format?(text|html|markdown), timeoutMs?.";
1980
+ }, {
1981
+ readonly name: "snapshot";
1982
+ readonly description: "Accessibility-tree snapshot with element refs (@e1…) — see what to click/fill. Args: interactiveOnly?, selector?, urls?, compact?, depth?.";
1983
+ }, {
1984
+ readonly name: "get";
1985
+ readonly description: "Read from the page. Args: what(text|html|value|attr|title|url|count|box|styles), selector?, attr?.";
1986
+ }, {
1987
+ readonly name: "is";
1988
+ readonly description: "Check element state. Args: check(visible|enabled|checked), selector.";
1989
+ }, {
1990
+ readonly name: "click";
1991
+ readonly description: "Click an element. Args: selector(@eN or CSS), newTab?.";
1992
+ }, {
1993
+ readonly name: "dblclick";
1994
+ readonly description: "Double-click an element. Args: selector.";
1995
+ }, {
1996
+ readonly name: "fill";
1997
+ readonly description: "Clear and fill a field. Args: selector, text.";
1998
+ }, {
1999
+ readonly name: "type";
2000
+ readonly description: "Type into an element. Args: selector, text.";
2001
+ }, {
2002
+ readonly name: "press";
2003
+ readonly description: "Press a key/chord (Enter, Control+a). Args: key.";
2004
+ }, {
2005
+ readonly name: "hover";
2006
+ readonly description: "Hover an element. Args: selector.";
2007
+ }, {
2008
+ readonly name: "focus";
2009
+ readonly description: "Focus an element. Args: selector.";
2010
+ }, {
2011
+ readonly name: "select";
2012
+ readonly description: "Select a dropdown option. Args: selector, value.";
2013
+ }, {
2014
+ readonly name: "check";
2015
+ readonly description: "Check a checkbox. Args: selector.";
2016
+ }, {
2017
+ readonly name: "uncheck";
2018
+ readonly description: "Uncheck a checkbox. Args: selector.";
2019
+ }, {
2020
+ readonly name: "scroll";
2021
+ readonly description: "Scroll. Args: direction(up|down|left|right), px?, selector?.";
2022
+ }, {
2023
+ readonly name: "scrollintoview";
2024
+ readonly description: "Scroll an element into view. Args: selector.";
2025
+ }, {
2026
+ readonly name: "drag";
2027
+ readonly description: "Drag and drop. Args: source, target.";
2028
+ }, {
2029
+ readonly name: "upload";
2030
+ readonly description: "Upload local file(s) to a file input. Args: selector, files[].";
2031
+ }, {
2032
+ readonly name: "find";
2033
+ readonly description: "Act by semantic locator. Args: by(role|text|label|placeholder|alt|title|testid), query, action(click|fill|type|hover|focus|check|uncheck|text), value?, name?, exact?.";
2034
+ }, {
2035
+ readonly name: "act";
2036
+ readonly description: "Act on the page: ref+action (deterministic) or natural-language instruction (engine AI). Args: ref?, action?, value?, instruction?.";
2037
+ }, {
2038
+ readonly name: "extract";
2039
+ readonly description: "Extract data by natural-language instruction (engine AI). Args: instruction.";
2040
+ }, {
2041
+ readonly name: "wait";
2042
+ readonly description: "Wait for a condition. Provide one of: selector(+state), ms, text, url, load, fn.";
2043
+ }, {
2044
+ readonly name: "tab";
2045
+ readonly description: "Manage tabs. Args: action(list|new|switch|close), target?, url?, label?.";
2046
+ }, {
2047
+ readonly name: "window_new";
2048
+ readonly description: "Open a new browser window. Args: url?.";
2049
+ }, {
2050
+ readonly name: "frame";
2051
+ readonly description: "Switch frame context. Args: target(@eN | CSS | \"main\").";
2052
+ }, {
2053
+ readonly name: "screenshot";
2054
+ readonly description: "Screenshot the page. Args: fullPage?, path?.";
2055
+ }, {
2056
+ readonly name: "pdf";
2057
+ readonly description: "Save the page as PDF. Args: path.";
2058
+ }, {
2059
+ readonly name: "cookies";
2060
+ readonly description: "Manage cookies. Args: action(get|set|clear), name?, value?.";
2061
+ }, {
2062
+ readonly name: "storage";
2063
+ readonly description: "Manage web storage. Args: area(local|session), action(get|set|clear), key?, value?.";
2064
+ }, {
2065
+ readonly name: "set";
2066
+ readonly description: "Configure the browser. Args: setting(viewport|device|geo|headers|credentials|media), args[].";
2067
+ }, {
2068
+ readonly name: "download";
2069
+ readonly description: "Download a file (click a selector to trigger, or wait for one). Args: selector?, path?.";
2070
+ }, {
2071
+ readonly name: "clipboard";
2072
+ readonly description: "Clipboard. Args: action(read|write|copy|paste), text?.";
2073
+ }, {
2074
+ readonly name: "auth";
2075
+ readonly description: "Use a saved login profile. Args: action(login|list|show), name?. (Credentials are saved via the desktop, never the agent.)";
2076
+ }, {
2077
+ readonly name: "confirm";
2078
+ readonly description: "Approve a pending confirmation_required action. Args: id.";
2079
+ }, {
2080
+ readonly name: "deny";
2081
+ readonly description: "Reject a pending confirmation_required action. Args: id.";
2082
+ }, {
2083
+ readonly name: "network";
2084
+ readonly description: "Inspect/control network. Args: action(route|unroute|requests|har) + relevant fields.";
2085
+ }, {
2086
+ readonly name: "console";
2087
+ readonly description: "View browser console messages. Args: clear?.";
2088
+ }, {
2089
+ readonly name: "errors";
2090
+ readonly description: "View uncaught page JS errors. Args: clear?.";
2091
+ }, {
2092
+ readonly name: "mouse";
2093
+ readonly description: "Low-level mouse. Args: action(move|down|up|wheel), x?, y?, button?, dy?, dx?.";
2094
+ }, {
2095
+ readonly name: "keyboard";
2096
+ readonly description: "Low-level keyboard at focus. Args: action(type|inserttext|keydown|keyup), text?, key?.";
2097
+ }, {
2098
+ readonly name: "state";
2099
+ readonly description: "Persist/restore storage+auth state to a file. Args: action(save|load|list|clear), path?.";
2100
+ }];
2101
+
2102
+ declare const BROWSER_ERROR_NAME = "BrowserError";
2103
+
2104
+ declare const BROWSER_EXECUTE_STATUSES: readonly ["completed", "failed", "stopped"];
2105
+
2106
+ declare const BROWSER_EXECUTE_STOP_REASONS: readonly ["done", "model_failed", "max_steps", "cost_cap", "timeout", "confirmation_required", "invalid_action", "repeated_action", "schema_mismatch", "browser_error", "cancelled", "error"];
2107
+
2108
+ declare const BROWSER_FALLBACKS: readonly ["browser-use", "none"];
2109
+
2110
+ declare const BROWSER_LOG_CONTENT_MODES: readonly ["summary", "full", "none"];
2111
+
2112
+ declare const BROWSER_READ_FORMATS: readonly ["text", "html", "markdown"];
2113
+
2114
+ declare const BROWSER_READ_LOAD_STATES: readonly ["load", "networkidle"];
2115
+
2116
+ declare const BROWSER_READ_LOGIN_BLOCKER = "login_required";
2117
+
2118
+ declare const BROWSER_SCREENSHOT_POLICIES: readonly ["always", "onError", "never"];
2119
+
2120
+ export declare interface BrowserApi extends BrowserStepwiseApi {
2121
+ read(url: string, options?: BrowserApiReadOptions): Promise<BrowserReadResult>;
2122
+ execute(input: BrowserExecuteInput): Promise<BrowserExecuteResult>;
2123
+ }
2124
+
2125
+ export declare type BrowserApiReadOptions = BrowserReadOptions & BrowserProfileOption;
2126
+
2127
+ export declare interface BrowserCommandInputs {
2128
+ health: BrowserSessionInput;
2129
+ session_open: BrowserSessionInput & {
2130
+ url?: string;
2131
+ headed?: boolean;
2132
+ profile?: string;
2133
+ confirmActions?: string[];
2134
+ };
2135
+ navigate: UrlInput & {
2136
+ waitUntil?: LoadState;
2137
+ };
2138
+ back: BrowserSessionInput;
2139
+ forward: BrowserSessionInput;
2140
+ reload: BrowserSessionInput;
2141
+ pushstate: UrlInput;
2142
+ close: BrowserSessionInput;
2143
+ snapshot: BrowserSessionInput & {
2144
+ interactiveOnly?: boolean;
2145
+ selector?: string;
2146
+ urls?: boolean;
2147
+ compact?: boolean;
2148
+ depth?: number;
2149
+ };
2150
+ get: BrowserSessionInput & {
2151
+ what: 'text' | 'html' | 'value' | 'attr' | 'title' | 'url' | 'count' | 'box' | 'styles';
2152
+ selector?: string;
2153
+ attr?: string;
2154
+ };
2155
+ is: SelectorInput & {
2156
+ check: 'visible' | 'enabled' | 'checked';
2157
+ };
2158
+ click: SelectorInput & {
2159
+ newTab?: boolean;
2160
+ };
2161
+ dblclick: SelectorInput;
2162
+ fill: SelectorTextInput;
2163
+ type: SelectorTextInput;
2164
+ press: BrowserSessionInput & {
2165
+ key: string;
2166
+ };
2167
+ hover: SelectorInput;
2168
+ focus: SelectorInput;
2169
+ select: SelectorInput & {
2170
+ value: string;
2171
+ };
2172
+ check: SelectorInput;
2173
+ uncheck: SelectorInput;
2174
+ scroll: BrowserSessionInput & {
2175
+ direction: 'up' | 'down' | 'left' | 'right';
2176
+ px?: number;
2177
+ selector?: string;
2178
+ };
2179
+ scrollintoview: SelectorInput;
2180
+ drag: BrowserSessionInput & {
2181
+ source: string;
2182
+ target: string;
2183
+ };
2184
+ upload: SelectorInput & {
2185
+ files: string[];
2186
+ };
2187
+ find: BrowserSessionInput & {
2188
+ by: 'role' | 'text' | 'label' | 'placeholder' | 'alt' | 'title' | 'testid';
2189
+ query: string;
2190
+ action: 'click' | 'fill' | 'type' | 'hover' | 'focus' | 'check' | 'uncheck' | 'text';
2191
+ value?: string;
2192
+ name?: string;
2193
+ exact?: boolean;
2194
+ };
2195
+ act: BrowserSessionInput & {
2196
+ ref?: string;
2197
+ action?: string;
2198
+ value?: string;
2199
+ instruction?: string;
2200
+ };
2201
+ extract: BrowserSessionInput & {
2202
+ instruction: string;
2203
+ };
2204
+ wait: BrowserSessionInput & {
2205
+ selector?: string;
2206
+ state?: 'visible' | 'hidden';
2207
+ ms?: number;
2208
+ text?: string;
2209
+ url?: string;
2210
+ load?: LoadState;
2211
+ fn?: string;
2212
+ };
2213
+ tab: BrowserSessionInput & {
2214
+ action: 'list' | 'new' | 'switch' | 'close';
2215
+ target?: string;
2216
+ url?: string;
2217
+ label?: string;
2218
+ };
2219
+ window_new: BrowserSessionInput & {
2220
+ url?: string;
2221
+ };
2222
+ frame: BrowserSessionInput & {
2223
+ target: string;
2224
+ };
2225
+ screenshot: BrowserSessionInput & {
2226
+ fullPage?: boolean;
2227
+ path?: string;
2228
+ };
2229
+ pdf: BrowserSessionInput & {
2230
+ path: string;
2231
+ };
2232
+ cookies: BrowserSessionInput & {
2233
+ action: 'get' | 'set' | 'clear';
2234
+ name?: string;
2235
+ value?: string;
2236
+ };
2237
+ storage: BrowserSessionInput & {
2238
+ area: 'local' | 'session';
2239
+ action: 'get' | 'set' | 'clear';
2240
+ key?: string;
2241
+ value?: string;
2242
+ };
2243
+ set: BrowserSessionInput & {
2244
+ setting: 'viewport' | 'device' | 'geo' | 'headers' | 'credentials' | 'media' | 'offline';
2245
+ args: Array<string | number>;
2246
+ };
2247
+ download: BrowserSessionInput & {
2248
+ selector?: string;
2249
+ path?: string;
2250
+ };
2251
+ clipboard: BrowserSessionInput & {
2252
+ action: 'read' | 'write' | 'copy' | 'paste';
2253
+ text?: string;
2254
+ };
2255
+ auth: BrowserSessionInput & {
2256
+ action: 'login' | 'list' | 'show';
2257
+ name?: string;
2258
+ };
2259
+ confirm: IdInput;
2260
+ deny: IdInput;
2261
+ network: BrowserSessionInput & {
2262
+ action: 'route' | 'unroute' | 'requests' | 'har';
2263
+ url?: string;
2264
+ abort?: boolean;
2265
+ body?: string;
2266
+ resourceType?: string;
2267
+ filter?: string;
2268
+ type?: string;
2269
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
2270
+ status?: string;
2271
+ requestId?: string;
2272
+ };
2273
+ console: ClearInput;
2274
+ errors: ClearInput;
2275
+ mouse: BrowserSessionInput & {
2276
+ action: 'move' | 'down' | 'up' | 'wheel';
2277
+ x?: number;
2278
+ y?: number;
2279
+ button?: 'left' | 'right' | 'middle';
2280
+ dy?: number;
2281
+ dx?: number;
2282
+ };
2283
+ keyboard: BrowserSessionInput & {
2284
+ action: 'type' | 'inserttext' | 'keydown' | 'keyup';
2285
+ text?: string;
2286
+ key?: string;
2287
+ };
2288
+ state: BrowserSessionInput & {
2289
+ action: 'save' | 'load' | 'list' | 'clear';
2290
+ path?: string;
2291
+ };
2292
+ }
2293
+
2294
+ declare type BrowserCommandMethod<I> = {} extends I ? (input?: I) => Promise<BrowserCommandResult> : (input: I) => Promise<BrowserCommandResult>;
2295
+
2296
+ /** Union of every command name. */
2297
+ declare type BrowserCommandName = (typeof BROWSER_COMMANDS)[number]['name'];
2298
+
2299
+ declare interface BrowserCommandOutput {
2300
+ /**
2301
+ * Which engine served the command. `none` = a precondition failed before any
2302
+ * engine ran (e.g. missing agentId, or a local-only policy with no device) —
2303
+ * so callers don't mistake it for a failed cloud attempt.
2304
+ */
2305
+ engine: 'local' | 'cloud-agent-browser' | 'cloud' | 'none';
2306
+ data?: unknown;
2307
+ error?: string;
2308
+ code?: string;
2309
+ }
2310
+
2311
+ export declare interface BrowserCommandResult extends BrowserCommandOutput {
2312
+ code?: BrowserErrorCode | (string & {});
2313
+ }
2314
+
2315
+ /**
2316
+ * Which engine a browser command may run on. `auto` (default) prefers the local
2317
+ * desktop Device and falls back to the cloud; `agent-browser` is local-only (no
2318
+ * paid cloud fallback); `browser-use` is cloud-only. Mirrors
2319
+ * `BrowserSwitchConfig.engine` on the dev-facing switch.
2320
+ */
2321
+ declare type BrowserEngine = 'auto' | 'agent-browser' | 'browser-use';
2322
+
2323
+ export declare type BrowserErrorCode = 'BROWSER_DISABLED' | 'BROWSER_UNAVAILABLE' | 'BROWSER_RUN_SCOPE_MISSING' | 'BROWSER_WORKER_NOT_CONFIGURED' | 'BROWSER_DOMAIN_NOT_ALLOWED' | 'BROWSER_PROFILE_NOT_FOUND' | 'session_lost' | 'unreachable' | BrowserWorkerErrorCode;
2324
+
2325
+ export declare interface BrowserErrorFields {
2326
+ name: typeof BROWSER_ERROR_NAME;
2327
+ /** `'http_error'`: the page answered an HTTP error status with nothing to read; see `status`. */
2328
+ code: BrowserErrorCode;
2329
+ /** HTTP status of the page's main document, when the error is an `'http_error'` and the status is known. */
2330
+ status?: number;
2331
+ }
2332
+
2333
+ export declare interface BrowserExecuteInput {
2334
+ task: string;
2335
+ sessionKey?: string;
2336
+ url?: string;
2337
+ startUrl?: string;
2338
+ schema?: Record<string, unknown>;
2339
+ maxSteps?: number;
2340
+ maxCostUsd?: number;
2341
+ model?: string;
2342
+ timeoutMs?: number;
2343
+ allowAnyDomain?: boolean;
2344
+ allowedDomains?: string[];
2345
+ browser?: string;
2346
+ }
2347
+
2348
+ export declare interface BrowserExecutePendingAction {
2349
+ category: string;
2350
+ action: string;
2351
+ url?: string;
2352
+ confirmationId?: string;
2353
+ }
2354
+
2355
+ export declare interface BrowserExecuteResult {
2356
+ status: BrowserExecuteStatus;
2357
+ output: unknown;
2358
+ steps: number;
2359
+ stopReason?: BrowserExecuteStopReason;
2360
+ costUsd?: number;
2361
+ finalUrl?: string;
2362
+ engine: BrowserCommandOutput['engine'];
2363
+ error?: string;
2364
+ code?: string;
2365
+ pendingAction?: BrowserExecutePendingAction;
2366
+ history?: BrowserExecuteStep[];
2367
+ liveUrl?: string;
2368
+ sessionKey?: string;
2369
+ detail?: string;
2370
+ navigationScope?: string[];
2371
+ }
2372
+
2373
+ export declare type BrowserExecuteStatus = (typeof BROWSER_EXECUTE_STATUSES)[number];
2374
+
2375
+ export declare interface BrowserExecuteStep {
2376
+ step: number;
2377
+ intent: string;
2378
+ action: string;
2379
+ url?: string;
2380
+ ok: boolean;
2381
+ error?: string;
2382
+ }
2383
+
2384
+ export declare type BrowserExecuteStopReason = (typeof BROWSER_EXECUTE_STOP_REASONS)[number];
2385
+
2386
+ declare type BrowserFallback = (typeof BROWSER_FALLBACKS)[number];
2387
+
2388
+ declare type BrowserLogContent = (typeof BROWSER_LOG_CONTENT_MODES)[number];
2389
+
2390
+ export declare interface BrowserProfileOption {
2391
+ browser?: string;
2392
+ }
2393
+
2394
+ export declare type BrowserReadFormat = (typeof BROWSER_READ_FORMATS)[number];
2395
+
2396
+ export declare type BrowserReadLoadState = (typeof BROWSER_READ_LOAD_STATES)[number];
2397
+
2398
+ export declare interface BrowserReadOptions {
2399
+ /** Wait before reading: `'load'`, `'networkidle'`, or a CSS selector that must appear. */
2400
+ waitFor?: BrowserReadLoadState | (string & {});
2401
+ /**
2402
+ * CSS selector to read (default `'body'`). Every match is read, in document order, with matches joined by a
2403
+ * blank line and empty matches skipped, up to the content cap. On the Lua cloud browser this holds for
2404
+ * `'text'` and `'markdown'`; `'html'` returns the inner HTML of the first match. On the desktop browser every
2405
+ * format reads the first match. `matches` on the result says how many elements matched.
2406
+ */
2407
+ selector?: string;
2408
+ /**
2409
+ * `'text'` (default) or `'html'`. `'markdown'` is accepted but returns plain text for now, and the result
2410
+ * says `format: 'text'`.
2411
+ */
2412
+ format?: BrowserReadFormat;
2413
+ /** Budget for the whole read in ms (1000 to 100000, default 60000). */
2414
+ timeoutMs?: number;
2415
+ sessionKey?: string;
2416
+ }
2417
+
2418
+ export declare interface BrowserReadResult {
2419
+ /** The URL you asked for. */
2420
+ url: string;
2421
+ /** The URL the page ended on after redirects. */
2422
+ finalUrl: string;
2423
+ title: string;
2424
+ content: string;
2425
+ format: 'text' | 'html';
2426
+ /** True when `content` hit the content cap or not every match was read. */
2427
+ truncated: boolean;
2428
+ /**
2429
+ * HTTP status of the page's main document, e.g. `200` or `404`. A 404 page that has a body is still read, so
2430
+ * check this before trusting `content`. Absent when the browser could not observe the response.
2431
+ */
2432
+ status?: number;
2433
+ /** How many elements matched `selector`, when a selector other than `'body'` was given. */
2434
+ matches?: number;
2435
+ /** Set when the page is a wall rather than the content you asked for. */
2436
+ blocked?: true;
2437
+ /** `'login_required'`: the URL redirected to a sign-in page, so the content needs a signed-in session. */
2438
+ blocker?: typeof BROWSER_READ_LOGIN_BLOCKER;
2439
+ blockerKind?: 'login';
2440
+ /** What to do about the wall. */
2441
+ blockerGuidance?: string;
2442
+ }
2443
+
2444
+ declare type BrowserScreenshotPolicy = (typeof BROWSER_SCREENSHOT_POLICIES)[number];
2445
+
2446
+ export declare interface BrowserSessionInput extends BrowserProfileOption {
2447
+ sessionKey?: string;
2448
+ }
2449
+
2450
+ export declare type BrowserStepwiseApi = {
2451
+ [K in BrowserStepwiseCommandName]: BrowserCommandMethod<BrowserCommandInputs[K]>;
2452
+ };
2453
+
2454
+ export declare type BrowserStepwiseCommandName = Exclude<BrowserCommandName, 'read'>;
2455
+
1938
2456
  /**
1939
2457
  * Browser switch config (LuaBrowser). `browser: true` is the zero-code form —
1940
- * the agent gets browser tools injected, like `searchWeb`, routed to the user's
1941
- * local browser (desktop) or the Browser-Use cloud fallback. The object form
1942
- * adds optional policy.
2458
+ * the agent gets browser tools and the `Browser` global, routed to the user's
2459
+ * desktop browser when it is online, else the Lua cloud browser. The object
2460
+ * form adds optional policy.
1943
2461
  */
1944
2462
  export declare interface BrowserSwitchConfig {
1945
- /** Preferred engine; 'auto' lets the platform pick local (desktop) vs cloud. */
2463
+ /** 'auto' (default): desktop when online, else the Lua cloud browser. 'agent-browser': desktop or Lua cloud, never Browser-Use. 'browser-use': Browser-Use only. */
1946
2464
  engine?: 'auto' | 'browser-use' | 'agent-browser';
1947
- /** Egress allowlist — domains the browser may navigate/sub-request. */
2465
+ fallback?: 'browser-use' | 'none';
2466
+ proxyCountry?: string;
2467
+ /** Hosts the browser may open; checked before every command that opens a URL. On the Lua cloud browser it also applies to redirects and everything a page loads. */
1948
2468
  allowedDomains?: string[];
1949
- /** Names of vault credential entries the agent may use (never raw secrets). */
2469
+ confirmActions?: string[];
2470
+ logContent?: BrowserLogContent;
2471
+ screenshots?: BrowserScreenshotPolicy;
2472
+ /** Accepted but not enforced yet. */
1950
2473
  credentials?: string[];
1951
- /** Hard cap on a single browser session's duration (cost control). */
2474
+ /** Lua cloud browser session length in minutes: default 10, at most 60 (a larger value is cut to 60). */
1952
2475
  maxSessionMinutes?: number;
2476
+ /** Lua cloud browser idle timeout in seconds: default 120, at most 900 (a larger value is cut to 900). */
2477
+ idleTimeoutSeconds?: number;
1953
2478
  }
1954
2479
 
2480
+ declare type BrowserWorkerErrorCode = 'unauthorized' | 'invalid_request' | 'invalid_argument' | 'policy_mismatch' | 'unsupported' | 'blocked_scheme' | 'blocked_private_host' | 'blocked_domain' | 'session_cap' | 'session_not_on_this_pod' | 'no_page' | 'draining' | 'timeout' | 'engine_unavailable' | 'engine_error' | 'http_error';
2481
+
1955
2482
  /** What `.commit()` hands to `LuaWorkflow` — internal; never `new LuaWorkflow({...})` by users. */
1956
2483
  declare interface BuiltWorkflow {
1957
2484
  config: LuaWorkflowConfig;
@@ -2437,6 +2964,10 @@ export declare interface ChoiceQuestion<L extends string = string> {
2437
2964
  options: Record<L, string>;
2438
2965
  }
2439
2966
 
2967
+ declare interface ClearInput extends BrowserSessionInput {
2968
+ clear?: boolean;
2969
+ }
2970
+
2440
2971
  /**
2441
2972
  * U6 (wave 2) — connection inspection, account pinning and capability checks; U33 — the same checks run
2442
2973
  * with the CONVERSATION USER's principal. Owner: U6 (catalogue, list, pin, check, cleanup); U33 owns only
@@ -3063,6 +3594,7 @@ export declare interface DecisionError extends Error {
3063
3594
  readonly code: DecisionErrorFields['code'];
3064
3595
  readonly provider?: DecisionProvider;
3065
3596
  readonly upstreamStatus?: number;
3597
+ readonly decisionId?: string;
3066
3598
  }
3067
3599
 
3068
3600
  export declare const DecisionError: new (message: string, fields: DecisionErrorFields) => DecisionError;
@@ -3073,6 +3605,7 @@ export declare interface DecisionErrorFields {
3073
3605
  code: DecisionErrorCode | (string & {});
3074
3606
  provider?: DecisionProvider;
3075
3607
  upstreamStatus?: number;
3608
+ decisionId?: string;
3076
3609
  }
3077
3610
 
3078
3611
  declare type DecisionFallback = DecisionProvider | 'none';
@@ -3129,6 +3662,8 @@ export declare interface DecisionResult<Q extends DecisionQuestions = DecisionQu
3129
3662
  durationMs: number;
3130
3663
  cached: boolean;
3131
3664
  fallback?: DecisionFallbackInfo;
3665
+ decisionName?: string;
3666
+ decisionVersion?: string;
3132
3667
  }
3133
3668
 
3134
3669
  declare type DecisionRoutingRule = (typeof DECISION_ROUTING_RULES)[number];
@@ -3160,6 +3695,8 @@ declare interface DecisionUsage {
3160
3695
  inputTokens: number | null;
3161
3696
  }
3162
3697
 
3698
+ export declare function defineBrowser(config: LuaBrowserConfig): LuaBrowser;
3699
+
3163
3700
  export declare function defineDecision<Q extends DecisionQuestions>(config: LuaDecisionConfig<Q>): LuaDecision<Q>;
3164
3701
 
3165
3702
  /**
@@ -4143,6 +4680,10 @@ declare interface IdentifiedEntity {
4143
4680
  _id?: string;
4144
4681
  }
4145
4682
 
4683
+ declare interface IdInput extends BrowserSessionInput {
4684
+ id: string;
4685
+ }
4686
+
4146
4687
  export declare interface ImageMessage {
4147
4688
  type: 'image';
4148
4689
  image: string;
@@ -5056,8 +5597,16 @@ declare interface LlmContextStep {
5056
5597
  cacheCreationTokens?: number;
5057
5598
  cacheCreationTokens5m?: number;
5058
5599
  cacheCreationTokens1h?: number;
5600
+ /** The step's output tokens. Cost only: settlement never reads it. */
5601
+ outputTokens?: number;
5602
+ /** As the provider reported them: outside `outputTokens` on Gemini, a subset of it on OpenAI. Cost only. */
5603
+ reasoningTokens?: number;
5604
+ /** The model id the provider says served the step (a fallback leg names itself here). Cost only. */
5605
+ model?: string;
5059
5606
  }
5060
5607
 
5608
+ declare type LoadState = 'load' | 'domcontentloaded' | 'networkidle';
5609
+
5061
5610
  /**
5062
5611
  * Structured logging: `log.debug/info/warn/error(message, fields?)`.
5063
5612
  *
@@ -5189,6 +5738,7 @@ export declare class LuaAgent {
5189
5738
  private readonly batching?;
5190
5739
  private readonly governance?;
5191
5740
  private readonly browser?;
5741
+ private readonly browsers?;
5192
5742
  /**
5193
5743
  * Creates a new LuaAgent instance.
5194
5744
  *
@@ -5226,6 +5776,7 @@ export declare class LuaAgent {
5226
5776
  getBatching(): BatchingConfig | undefined;
5227
5777
  getDevices(): LuaDevice[];
5228
5778
  getVoices(): LuaVoice[] | undefined;
5779
+ getBrowsers(): LuaBrowser[] | undefined;
5229
5780
  getDecisions(): LuaDecision[];
5230
5781
  }
5231
5782
 
@@ -5290,12 +5841,13 @@ export declare interface LuaAgentConfig {
5290
5841
  /** Governance policy configuration. When set, tool calls, preprocessors, and postprocessors are governed. */
5291
5842
  governance?: GovernanceConfig;
5292
5843
  /**
5293
- * Browser switch (LuaBrowser). `true` turns on browser tools with platform
5294
- * defaults; an object adds policy (engine, allowedDomains, credentials,
5295
- * maxSessionMinutes). Off by default — a browser session costs money and
5844
+ * Browser switch (LuaBrowser). `true` turns on browser tools and the
5845
+ * `Browser` global with platform defaults; an object adds policy (see
5846
+ * `BrowserSwitchConfig`). Off by default — a browser session costs money and
5296
5847
  * carries risk, so it's opt-in (unlike always-on searchWeb).
5297
5848
  */
5298
5849
  browser?: boolean | BrowserSwitchConfig;
5850
+ browsers?: LuaBrowser[];
5299
5851
  }
5300
5852
 
5301
5853
  /**
@@ -5323,6 +5875,44 @@ export declare type LuaAgentModel = string | ((request: LuaRequest) => string |
5323
5875
  /** The signed-in person a route runs for (never an API key, never anonymous). */
5324
5876
  export declare type LuaAuth = WebRouteAuth;
5325
5877
 
5878
+ export declare class LuaBrowser {
5879
+ readonly name: string;
5880
+ readonly description?: string;
5881
+ readonly engine: LuaBrowserSettings['engine'];
5882
+ readonly fallback: LuaBrowserSettings['fallback'];
5883
+ readonly proxyCountry: LuaBrowserSettings['proxyCountry'];
5884
+ readonly allowedDomains: LuaBrowserSettings['allowedDomains'];
5885
+ readonly confirmActions: LuaBrowserSettings['confirmActions'];
5886
+ readonly maxSessionMinutes: LuaBrowserSettings['maxSessionMinutes'];
5887
+ readonly idleTimeoutSeconds: LuaBrowserSettings['idleTimeoutSeconds'];
5888
+ readonly maxConcurrentSessions: LuaBrowserSettings['maxConcurrentSessions'];
5889
+ readonly screenshots: LuaBrowserSettings['screenshots'];
5890
+ readonly logContent: LuaBrowserSettings['logContent'];
5891
+ readonly persist: LuaBrowserSettings['persist'];
5892
+ readonly credentials: LuaBrowserSettings['credentials'];
5893
+ constructor(config: LuaBrowserConfig);
5894
+ }
5895
+
5896
+ export declare interface LuaBrowserConfig extends LuaBrowserSettings {
5897
+ name: string;
5898
+ description?: string;
5899
+ }
5900
+
5901
+ export declare interface LuaBrowserSettings {
5902
+ engine?: BrowserEngine;
5903
+ fallback?: BrowserFallback;
5904
+ proxyCountry?: string;
5905
+ allowedDomains?: string[];
5906
+ confirmActions?: string[];
5907
+ maxSessionMinutes?: number;
5908
+ idleTimeoutSeconds?: number;
5909
+ maxConcurrentSessions?: number;
5910
+ screenshots?: BrowserScreenshotPolicy;
5911
+ logContent?: BrowserLogContent;
5912
+ persist?: boolean;
5913
+ credentials?: string[];
5914
+ }
5915
+
5326
5916
  export declare class LuaDecision<Q extends DecisionQuestions = DecisionQuestions> {
5327
5917
  readonly name: string;
5328
5918
  readonly description?: string;
@@ -6070,7 +6660,7 @@ export declare interface LuaTriggerConfig<T = any> {
6070
6660
  *
6071
6661
  * export default new LuaVoice({
6072
6662
  * name: 'support-line',
6073
- * llm: 'openai/gpt-5.2-chat-latest',
6663
+ * llm: 'openai/chat-latest',
6074
6664
  * stt: 'deepgram/nova-3',
6075
6665
  * tts: { model: 'cartesia/sonic-3', voice: '9626c31c-bec5-4cca-baa8-f8ba9e84c8bc' },
6076
6666
  * vad: 'silero',
@@ -6170,7 +6760,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
6170
6760
  name: z.ZodOptional<z.ZodString>;
6171
6761
  llm: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
6172
6762
  kind: z.ZodLiteral<"inference">;
6173
- /** Provider-prefixed model id (e.g. `'openai/gpt-5.2-chat-latest'`). */
6763
+ /** Provider-prefixed model id (e.g. `'openai/chat-latest'`). */
6174
6764
  model: z.ZodString;
6175
6765
  /**
6176
6766
  * TTS-only — provider voice id. Inference's TTS API takes voice
@@ -6236,7 +6826,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
6236
6826
  }>]>;
6237
6827
  stt: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
6238
6828
  kind: z.ZodLiteral<"inference">;
6239
- /** Provider-prefixed model id (e.g. `'openai/gpt-5.2-chat-latest'`). */
6829
+ /** Provider-prefixed model id (e.g. `'openai/chat-latest'`). */
6240
6830
  model: z.ZodString;
6241
6831
  /**
6242
6832
  * TTS-only — provider voice id. Inference's TTS API takes voice
@@ -6302,7 +6892,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
6302
6892
  }>]>>;
6303
6893
  tts: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
6304
6894
  kind: z.ZodLiteral<"inference">;
6305
- /** Provider-prefixed model id (e.g. `'openai/gpt-5.2-chat-latest'`). */
6895
+ /** Provider-prefixed model id (e.g. `'openai/chat-latest'`). */
6306
6896
  model: z.ZodString;
6307
6897
  /**
6308
6898
  * TTS-only — provider voice id. Inference's TTS API takes voice
@@ -7305,7 +7895,9 @@ export declare type LuaWorkflowBuildCode = 'duplicate-step-id' | 'unknown-step-r
7305
7895
  /** BAC-2062: the builder mirror of the BAC-619 validator codes: a `waitForSignal` name a delivery refuses. */
7306
7896
  | 'signal-name-invalid'
7307
7897
  /** BAC-2062: a numeric approval / waitForSignal `timeoutHours` outside 1..720. */
7308
- | 'timeout-hours-out-of-range' | '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';
7898
+ | 'timeout-hours-out-of-range' | 'editable-path-invalid' | 'env-template-secret-key' | 'invalid-envelope'
7899
+ /** BAC-2341: a `concurrencyKey` declared without `concurrencyPolicy:'forbid'` (the server's 400 twin). */
7900
+ | 'concurrency-key-requires-forbid' | 'invalid-step' | 'invalid-step-id' | 'invalid-workflow-name' | 'schedule-input-required' | 'schedule-input-invalid' | 'hitl-duration-defaulted' | 'WORKFLOW_UNPLACED_STEP';
7309
7901
 
7310
7902
  export declare interface LuaWorkflowBuilder {
7311
7903
  then(step: StepRef): this;
@@ -7372,6 +7964,11 @@ export declare interface LuaWorkflowConfig {
7372
7964
  stateSchema?: ZodType;
7373
7965
  /** 'forbid' = jobs-style overlap guard per workflow (D21-r1) — every start path gets 409 `RUNS_IN_FLIGHT`. */
7374
7966
  concurrencyPolicy?: 'allow' | 'forbid';
7967
+ /**
7968
+ * Scope the `forbid` overlap guard per correlation key instead of workflow-wide. Requires `concurrencyPolicy:'forbid'`;
7969
+ * absent means workflow-wide. Rides the manifest and the push body, not the graph envelope or `graphHash`.
7970
+ */
7971
+ concurrencyKey?: 'correlationKey';
7375
7972
  /** Who may READ this workflow's run outputs beyond `workflows:read-outputs` holders (B44). Envelope member outside `graphHash`. */
7376
7973
  outputVisibility?: WorkflowOutputVisibility;
7377
7974
  /**
@@ -9029,6 +9626,14 @@ export declare interface SecretTestOutcome {
9029
9626
 
9030
9627
  export declare type SecretTestResult = (typeof SECRET_TEST_RESULTS)[number];
9031
9628
 
9629
+ declare interface SelectorInput extends BrowserSessionInput {
9630
+ selector: string;
9631
+ }
9632
+
9633
+ declare interface SelectorTextInput extends SelectorInput {
9634
+ text: string;
9635
+ }
9636
+
9032
9637
  declare interface SendTemplateButtonValue {
9033
9638
  sub_type: WhatsAppTemplateButtonType;
9034
9639
  index: string;
@@ -10000,6 +10605,10 @@ declare interface UpdateJobVersionDTO {
10000
10605
  metadata?: Record<string, any>;
10001
10606
  }
10002
10607
 
10608
+ declare interface UrlInput extends BrowserSessionInput {
10609
+ url: string;
10610
+ }
10611
+
10003
10612
  /**
10004
10613
  * Function type for resolving URL at runtime.
10005
10614
  * Use env() inside to access agent environment variables.