lua-cli 3.48.0 → 3.49.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.
@@ -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,552 @@ export declare interface BatchingConfig {
1935
1943
  serializeProcessing?: boolean;
1936
1944
  }
1937
1945
 
1946
+ export declare const Browser: BrowserApi;
1947
+
1948
+ declare const BROWSER_BOT_WALL_KINDS: readonly ["captcha", "bot-block", "empty-content"];
1949
+
1950
+ /**
1951
+ * The full command surface (mirrors the desktop bridge's registry). Grouped the
1952
+ * way the agent-browser CLI groups them so the surface is complete without
1953
+ * 50+ near-duplicate names.
1954
+ */
1955
+ declare const BROWSER_COMMANDS: readonly [{
1956
+ readonly name: "health";
1957
+ readonly description: "Check the local browser engine is installed and responsive.";
1958
+ }, {
1959
+ readonly name: "session_open";
1960
+ 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.";
1961
+ }, {
1962
+ readonly name: "navigate";
1963
+ 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.";
1964
+ }, {
1965
+ readonly name: "back";
1966
+ readonly description: "Go back in history.";
1967
+ }, {
1968
+ readonly name: "forward";
1969
+ readonly description: "Go forward in history.";
1970
+ }, {
1971
+ readonly name: "reload";
1972
+ readonly description: "Reload the current page.";
1973
+ }, {
1974
+ readonly name: "pushstate";
1975
+ readonly description: "SPA client-side navigation. Args: url.";
1976
+ }, {
1977
+ readonly name: "close";
1978
+ readonly description: "Close the session’s browser.";
1979
+ }, {
1980
+ readonly name: "read";
1981
+ 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?.";
1982
+ }, {
1983
+ readonly name: "snapshot";
1984
+ readonly description: "Accessibility-tree snapshot with element refs (@e1…) — see what to click/fill. Args: interactiveOnly?, selector?, urls?, compact?, depth?.";
1985
+ }, {
1986
+ readonly name: "get";
1987
+ readonly description: "Read from the page. Args: what(text|html|value|attr|title|url|count|box|styles), selector?, attr?.";
1988
+ }, {
1989
+ readonly name: "is";
1990
+ readonly description: "Check element state. Args: check(visible|enabled|checked), selector.";
1991
+ }, {
1992
+ readonly name: "click";
1993
+ readonly description: "Click an element. Args: selector(@eN or CSS), newTab?.";
1994
+ }, {
1995
+ readonly name: "dblclick";
1996
+ readonly description: "Double-click an element. Args: selector.";
1997
+ }, {
1998
+ readonly name: "fill";
1999
+ readonly description: "Clear and fill a field. Args: selector, text.";
2000
+ }, {
2001
+ readonly name: "type";
2002
+ readonly description: "Type into an element. Args: selector, text.";
2003
+ }, {
2004
+ readonly name: "press";
2005
+ readonly description: "Press a key/chord (Enter, Control+a). Args: key.";
2006
+ }, {
2007
+ readonly name: "hover";
2008
+ readonly description: "Hover an element. Args: selector.";
2009
+ }, {
2010
+ readonly name: "focus";
2011
+ readonly description: "Focus an element. Args: selector.";
2012
+ }, {
2013
+ readonly name: "select";
2014
+ readonly description: "Select a dropdown option. Args: selector, value.";
2015
+ }, {
2016
+ readonly name: "check";
2017
+ readonly description: "Check a checkbox. Args: selector.";
2018
+ }, {
2019
+ readonly name: "uncheck";
2020
+ readonly description: "Uncheck a checkbox. Args: selector.";
2021
+ }, {
2022
+ readonly name: "scroll";
2023
+ readonly description: "Scroll. Args: direction(up|down|left|right), px?, selector?.";
2024
+ }, {
2025
+ readonly name: "scrollintoview";
2026
+ readonly description: "Scroll an element into view. Args: selector.";
2027
+ }, {
2028
+ readonly name: "drag";
2029
+ readonly description: "Drag and drop. Args: source, target.";
2030
+ }, {
2031
+ readonly name: "upload";
2032
+ readonly description: "Upload local file(s) to a file input. Args: selector, files[].";
2033
+ }, {
2034
+ readonly name: "find";
2035
+ 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?.";
2036
+ }, {
2037
+ readonly name: "act";
2038
+ readonly description: "Act on the page: ref+action (deterministic) or natural-language instruction (engine AI). Args: ref?, action?, value?, instruction?.";
2039
+ }, {
2040
+ readonly name: "extract";
2041
+ readonly description: "Extract data by natural-language instruction (engine AI). Args: instruction.";
2042
+ }, {
2043
+ readonly name: "wait";
2044
+ readonly description: "Wait for a condition. Provide one of: selector(+state), ms, text, url, load, fn.";
2045
+ }, {
2046
+ readonly name: "tab";
2047
+ readonly description: "Manage tabs. Args: action(list|new|switch|close), target?, url?, label?.";
2048
+ }, {
2049
+ readonly name: "window_new";
2050
+ readonly description: "Open a new browser window. Args: url?.";
2051
+ }, {
2052
+ readonly name: "frame";
2053
+ readonly description: "Switch frame context. Args: target(@eN | CSS | \"main\").";
2054
+ }, {
2055
+ readonly name: "screenshot";
2056
+ readonly description: "Screenshot the page. Args: fullPage?, path?.";
2057
+ }, {
2058
+ readonly name: "pdf";
2059
+ readonly description: "Save the page as PDF. Args: path.";
2060
+ }, {
2061
+ readonly name: "cookies";
2062
+ readonly description: "Manage cookies. Args: action(get|set|clear), name?, value?.";
2063
+ }, {
2064
+ readonly name: "storage";
2065
+ readonly description: "Manage web storage. Args: area(local|session), action(get|set|clear), key?, value?.";
2066
+ }, {
2067
+ readonly name: "set";
2068
+ readonly description: "Configure the browser. Args: setting(viewport|device|geo|headers|credentials|media), args[].";
2069
+ }, {
2070
+ readonly name: "download";
2071
+ readonly description: "Download a file (click a selector to trigger, or wait for one). Args: selector?, path?.";
2072
+ }, {
2073
+ readonly name: "clipboard";
2074
+ readonly description: "Clipboard. Args: action(read|write|copy|paste), text?.";
2075
+ }, {
2076
+ readonly name: "auth";
2077
+ readonly description: "Use a saved login profile. Args: action(login|list|show), name?. (Credentials are saved via the desktop, never the agent.)";
2078
+ }, {
2079
+ readonly name: "confirm";
2080
+ readonly description: "Approve a pending confirmation_required action. Args: id.";
2081
+ }, {
2082
+ readonly name: "deny";
2083
+ readonly description: "Reject a pending confirmation_required action. Args: id.";
2084
+ }, {
2085
+ readonly name: "network";
2086
+ readonly description: "Inspect/control network. Args: action(route|unroute|requests|har) + relevant fields.";
2087
+ }, {
2088
+ readonly name: "console";
2089
+ readonly description: "View browser console messages. Args: clear?.";
2090
+ }, {
2091
+ readonly name: "errors";
2092
+ readonly description: "View uncaught page JS errors. Args: clear?.";
2093
+ }, {
2094
+ readonly name: "mouse";
2095
+ readonly description: "Low-level mouse. Args: action(move|down|up|wheel), x?, y?, button?, dy?, dx?.";
2096
+ }, {
2097
+ readonly name: "keyboard";
2098
+ readonly description: "Low-level keyboard at focus. Args: action(type|inserttext|keydown|keyup), text?, key?.";
2099
+ }, {
2100
+ readonly name: "state";
2101
+ readonly description: "Persist/restore storage+auth state to a file. Args: action(save|load|list|clear), path?.";
2102
+ }];
2103
+
2104
+ declare const BROWSER_ERROR_NAME = "BrowserError";
2105
+
2106
+ declare const BROWSER_EXECUTE_STATUSES: readonly ["completed", "failed", "stopped"];
2107
+
2108
+ 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"];
2109
+
2110
+ declare const BROWSER_FALLBACKS: readonly ["browser-use", "none"];
2111
+
2112
+ declare const BROWSER_LOG_CONTENT_MODES: readonly ["summary", "full", "none"];
2113
+
2114
+ declare const BROWSER_READ_BOT_WALL_BLOCKER = "bot_wall";
2115
+
2116
+ declare const BROWSER_READ_FORMATS: readonly ["text", "html", "markdown"];
2117
+
2118
+ declare const BROWSER_READ_LOAD_STATES: readonly ["load", "networkidle"];
2119
+
2120
+ declare const BROWSER_READ_LOGIN_BLOCKER = "login_required";
2121
+
2122
+ declare const BROWSER_SCREENSHOT_POLICIES: readonly ["always", "onError", "never"];
2123
+
2124
+ export declare interface BrowserApi extends BrowserStepwiseApi {
2125
+ read(url: string, options?: BrowserApiReadOptions): Promise<BrowserReadResult>;
2126
+ execute(input: BrowserExecuteInput): Promise<BrowserExecuteResult>;
2127
+ }
2128
+
2129
+ export declare type BrowserApiReadOptions = BrowserReadOptions & BrowserProfileOption;
2130
+
2131
+ declare type BrowserBotWallKind = (typeof BROWSER_BOT_WALL_KINDS)[number];
2132
+
2133
+ export declare interface BrowserCommandInputs {
2134
+ health: BrowserSessionInput;
2135
+ session_open: BrowserSessionInput & {
2136
+ url?: string;
2137
+ headed?: boolean;
2138
+ profile?: string;
2139
+ confirmActions?: string[];
2140
+ };
2141
+ navigate: UrlInput & {
2142
+ waitUntil?: LoadState;
2143
+ };
2144
+ back: BrowserSessionInput;
2145
+ forward: BrowserSessionInput;
2146
+ reload: BrowserSessionInput;
2147
+ pushstate: UrlInput;
2148
+ close: BrowserSessionInput;
2149
+ snapshot: BrowserSessionInput & {
2150
+ interactiveOnly?: boolean;
2151
+ selector?: string;
2152
+ urls?: boolean;
2153
+ compact?: boolean;
2154
+ depth?: number;
2155
+ };
2156
+ get: BrowserSessionInput & {
2157
+ what: 'text' | 'html' | 'value' | 'attr' | 'title' | 'url' | 'count' | 'box' | 'styles';
2158
+ selector?: string;
2159
+ attr?: string;
2160
+ };
2161
+ is: SelectorInput & {
2162
+ check: 'visible' | 'enabled' | 'checked';
2163
+ };
2164
+ click: SelectorInput & {
2165
+ newTab?: boolean;
2166
+ };
2167
+ dblclick: SelectorInput;
2168
+ fill: SelectorTextInput;
2169
+ type: SelectorTextInput;
2170
+ press: BrowserSessionInput & {
2171
+ key: string;
2172
+ };
2173
+ hover: SelectorInput;
2174
+ focus: SelectorInput;
2175
+ select: SelectorInput & {
2176
+ value: string;
2177
+ };
2178
+ check: SelectorInput;
2179
+ uncheck: SelectorInput;
2180
+ scroll: BrowserSessionInput & {
2181
+ direction: 'up' | 'down' | 'left' | 'right';
2182
+ px?: number;
2183
+ selector?: string;
2184
+ };
2185
+ scrollintoview: SelectorInput;
2186
+ drag: BrowserSessionInput & {
2187
+ source: string;
2188
+ target: string;
2189
+ };
2190
+ upload: SelectorInput & {
2191
+ files: string[];
2192
+ };
2193
+ find: BrowserSessionInput & {
2194
+ by: 'role' | 'text' | 'label' | 'placeholder' | 'alt' | 'title' | 'testid';
2195
+ query: string;
2196
+ action: 'click' | 'fill' | 'type' | 'hover' | 'focus' | 'check' | 'uncheck' | 'text';
2197
+ value?: string;
2198
+ name?: string;
2199
+ exact?: boolean;
2200
+ };
2201
+ act: BrowserSessionInput & {
2202
+ ref?: string;
2203
+ action?: string;
2204
+ value?: string;
2205
+ instruction?: string;
2206
+ };
2207
+ extract: BrowserSessionInput & {
2208
+ instruction: string;
2209
+ };
2210
+ wait: BrowserSessionInput & {
2211
+ selector?: string;
2212
+ state?: 'visible' | 'hidden';
2213
+ ms?: number;
2214
+ text?: string;
2215
+ url?: string;
2216
+ load?: LoadState;
2217
+ fn?: string;
2218
+ };
2219
+ tab: BrowserSessionInput & {
2220
+ action: 'list' | 'new' | 'switch' | 'close';
2221
+ target?: string;
2222
+ url?: string;
2223
+ label?: string;
2224
+ };
2225
+ window_new: BrowserSessionInput & {
2226
+ url?: string;
2227
+ };
2228
+ frame: BrowserSessionInput & {
2229
+ target: string;
2230
+ };
2231
+ screenshot: BrowserSessionInput & {
2232
+ fullPage?: boolean;
2233
+ path?: string;
2234
+ };
2235
+ pdf: BrowserSessionInput & {
2236
+ path: string;
2237
+ };
2238
+ cookies: BrowserSessionInput & {
2239
+ action: 'get' | 'set' | 'clear';
2240
+ name?: string;
2241
+ value?: string;
2242
+ };
2243
+ storage: BrowserSessionInput & {
2244
+ area: 'local' | 'session';
2245
+ action: 'get' | 'set' | 'clear';
2246
+ key?: string;
2247
+ value?: string;
2248
+ };
2249
+ set: BrowserSessionInput & {
2250
+ setting: 'viewport' | 'device' | 'geo' | 'headers' | 'credentials' | 'media' | 'offline';
2251
+ args: Array<string | number>;
2252
+ };
2253
+ download: BrowserSessionInput & {
2254
+ selector?: string;
2255
+ path?: string;
2256
+ };
2257
+ clipboard: BrowserSessionInput & {
2258
+ action: 'read' | 'write' | 'copy' | 'paste';
2259
+ text?: string;
2260
+ };
2261
+ auth: BrowserSessionInput & {
2262
+ action: 'login' | 'list' | 'show';
2263
+ name?: string;
2264
+ };
2265
+ confirm: IdInput;
2266
+ deny: IdInput;
2267
+ network: BrowserSessionInput & {
2268
+ action: 'route' | 'unroute' | 'requests' | 'har';
2269
+ url?: string;
2270
+ abort?: boolean;
2271
+ body?: string;
2272
+ resourceType?: string;
2273
+ filter?: string;
2274
+ type?: string;
2275
+ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
2276
+ status?: string;
2277
+ requestId?: string;
2278
+ };
2279
+ console: ClearInput;
2280
+ errors: ClearInput;
2281
+ mouse: BrowserSessionInput & {
2282
+ action: 'move' | 'down' | 'up' | 'wheel';
2283
+ x?: number;
2284
+ y?: number;
2285
+ button?: 'left' | 'right' | 'middle';
2286
+ dy?: number;
2287
+ dx?: number;
2288
+ };
2289
+ keyboard: BrowserSessionInput & {
2290
+ action: 'type' | 'inserttext' | 'keydown' | 'keyup';
2291
+ text?: string;
2292
+ key?: string;
2293
+ };
2294
+ state: BrowserSessionInput & {
2295
+ action: 'save' | 'load' | 'list' | 'clear';
2296
+ path?: string;
2297
+ };
2298
+ }
2299
+
2300
+ declare type BrowserCommandMethod<I> = {} extends I ? (input?: I) => Promise<BrowserCommandResult> : (input: I) => Promise<BrowserCommandResult>;
2301
+
2302
+ /** Union of every command name. */
2303
+ declare type BrowserCommandName = (typeof BROWSER_COMMANDS)[number]['name'];
2304
+
2305
+ declare interface BrowserCommandOutput {
2306
+ /**
2307
+ * Which engine served the command. `none` = a precondition failed before any
2308
+ * engine ran (e.g. missing agentId, or a local-only policy with no device) —
2309
+ * so callers don't mistake it for a failed cloud attempt.
2310
+ */
2311
+ engine: 'local' | 'cloud-agent-browser' | 'cloud' | 'none';
2312
+ data?: unknown;
2313
+ error?: string;
2314
+ code?: string;
2315
+ }
2316
+
2317
+ export declare interface BrowserCommandResult extends BrowserCommandOutput {
2318
+ code?: BrowserErrorCode | (string & {});
2319
+ }
2320
+
2321
+ /**
2322
+ * Which engine a browser command may run on. `auto` (default) prefers the local
2323
+ * desktop Device and falls back to the cloud; `agent-browser` is local-only (no
2324
+ * paid cloud fallback); `browser-use` is cloud-only. Mirrors
2325
+ * `BrowserSwitchConfig.engine` on the dev-facing switch.
2326
+ */
2327
+ declare type BrowserEngine = 'auto' | 'agent-browser' | 'browser-use';
2328
+
2329
+ 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;
2330
+
2331
+ export declare interface BrowserErrorFields {
2332
+ name: typeof BROWSER_ERROR_NAME;
2333
+ /** `'http_error'`: the page answered an HTTP error status with nothing to read; see `status`. */
2334
+ code: BrowserErrorCode;
2335
+ /** HTTP status of the page's main document, when the error is an `'http_error'` and the status is known. */
2336
+ status?: number;
2337
+ }
2338
+
2339
+ export declare interface BrowserExecuteInput {
2340
+ task: string;
2341
+ sessionKey?: string;
2342
+ url?: string;
2343
+ startUrl?: string;
2344
+ schema?: Record<string, unknown>;
2345
+ maxSteps?: number;
2346
+ maxCostUsd?: number;
2347
+ model?: string;
2348
+ timeoutMs?: number;
2349
+ allowAnyDomain?: boolean;
2350
+ allowedDomains?: string[];
2351
+ browser?: string;
2352
+ }
2353
+
2354
+ export declare interface BrowserExecutePendingAction {
2355
+ category: string;
2356
+ action: string;
2357
+ url?: string;
2358
+ confirmationId?: string;
2359
+ }
2360
+
2361
+ export declare interface BrowserExecuteResult {
2362
+ status: BrowserExecuteStatus;
2363
+ output: unknown;
2364
+ steps: number;
2365
+ stopReason?: BrowserExecuteStopReason;
2366
+ costUsd?: number;
2367
+ finalUrl?: string;
2368
+ engine: BrowserCommandOutput['engine'];
2369
+ error?: string;
2370
+ code?: string;
2371
+ pendingAction?: BrowserExecutePendingAction;
2372
+ history?: BrowserExecuteStep[];
2373
+ liveUrl?: string;
2374
+ sessionKey?: string;
2375
+ detail?: string;
2376
+ navigationScope?: string[];
2377
+ }
2378
+
2379
+ export declare type BrowserExecuteStatus = (typeof BROWSER_EXECUTE_STATUSES)[number];
2380
+
2381
+ export declare interface BrowserExecuteStep {
2382
+ step: number;
2383
+ intent: string;
2384
+ action: string;
2385
+ url?: string;
2386
+ ok: boolean;
2387
+ error?: string;
2388
+ }
2389
+
2390
+ export declare type BrowserExecuteStopReason = (typeof BROWSER_EXECUTE_STOP_REASONS)[number];
2391
+
2392
+ declare type BrowserFallback = (typeof BROWSER_FALLBACKS)[number];
2393
+
2394
+ declare type BrowserLogContent = (typeof BROWSER_LOG_CONTENT_MODES)[number];
2395
+
2396
+ export declare interface BrowserProfileOption {
2397
+ browser?: string;
2398
+ }
2399
+
2400
+ export declare type BrowserReadFormat = (typeof BROWSER_READ_FORMATS)[number];
2401
+
2402
+ export declare type BrowserReadLoadState = (typeof BROWSER_READ_LOAD_STATES)[number];
2403
+
2404
+ export declare interface BrowserReadOptions {
2405
+ /** Wait before reading: `'load'`, `'networkidle'`, or a CSS selector that must appear. */
2406
+ waitFor?: BrowserReadLoadState | (string & {});
2407
+ /**
2408
+ * CSS selector to read (default `'body'`). Every match is read, in document order, with matches joined by a
2409
+ * blank line and empty matches skipped, up to the content cap. On the Lua cloud browser this holds for
2410
+ * `'text'` and `'markdown'`; `'html'` returns the inner HTML of the first match. On the desktop browser every
2411
+ * format reads the first match. `matches` on the result says how many elements matched.
2412
+ */
2413
+ selector?: string;
2414
+ /**
2415
+ * `'text'` (default) or `'html'`. `'markdown'` is accepted but returns plain text for now, and the result
2416
+ * says `format: 'text'`.
2417
+ */
2418
+ format?: BrowserReadFormat;
2419
+ /** Budget for the whole read in ms (1000 to 100000, default 60000). */
2420
+ timeoutMs?: number;
2421
+ sessionKey?: string;
2422
+ }
2423
+
2424
+ export declare interface BrowserReadResult {
2425
+ /** The URL you asked for. */
2426
+ url: string;
2427
+ /** The URL the page ended on after redirects. */
2428
+ finalUrl: string;
2429
+ title: string;
2430
+ content: string;
2431
+ format: 'text' | 'html';
2432
+ /** True when `content` hit the content cap or not every match was read. */
2433
+ truncated: boolean;
2434
+ /**
2435
+ * HTTP status of the page's main document, e.g. `200` or `404`. A 404 page that has a body is still read, so
2436
+ * check this before trusting `content`. Absent when the browser could not observe the response.
2437
+ */
2438
+ status?: number;
2439
+ /** How many elements matched `selector`, when a selector other than `'body'` was given. */
2440
+ matches?: number;
2441
+ /** Set when the page is a wall rather than the content you asked for. */
2442
+ blocked?: true;
2443
+ /**
2444
+ * `'login_required'`: the URL redirected to a sign-in page, so the content needs a signed-in session.
2445
+ * `'bot_wall'`: the site showed a captcha, refused the automated browser, or served an empty page; `content` is
2446
+ * that wall, not the page you asked for.
2447
+ */
2448
+ blocker?: typeof BROWSER_READ_LOGIN_BLOCKER | typeof BROWSER_READ_BOT_WALL_BLOCKER;
2449
+ blockerKind?: 'login' | BrowserBotWallKind;
2450
+ /** What to do about the wall. */
2451
+ blockerGuidance?: string;
2452
+ }
2453
+
2454
+ declare type BrowserScreenshotPolicy = (typeof BROWSER_SCREENSHOT_POLICIES)[number];
2455
+
2456
+ export declare interface BrowserSessionInput extends BrowserProfileOption {
2457
+ sessionKey?: string;
2458
+ }
2459
+
2460
+ export declare type BrowserStepwiseApi = {
2461
+ [K in BrowserStepwiseCommandName]: BrowserCommandMethod<BrowserCommandInputs[K]>;
2462
+ };
2463
+
2464
+ export declare type BrowserStepwiseCommandName = Exclude<BrowserCommandName, 'read'>;
2465
+
1938
2466
  /**
1939
2467
  * 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.
2468
+ * the agent gets browser tools and the `Browser` global, routed to the user's
2469
+ * desktop browser when it is online, else the Lua cloud browser. The object
2470
+ * form adds optional policy.
1943
2471
  */
1944
2472
  export declare interface BrowserSwitchConfig {
1945
- /** Preferred engine; 'auto' lets the platform pick local (desktop) vs cloud. */
2473
+ /** '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
2474
  engine?: 'auto' | 'browser-use' | 'agent-browser';
1947
- /** Egress allowlist — domains the browser may navigate/sub-request. */
2475
+ fallback?: 'browser-use' | 'none';
2476
+ proxyCountry?: string;
2477
+ /** 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
2478
  allowedDomains?: string[];
1949
- /** Names of vault credential entries the agent may use (never raw secrets). */
2479
+ confirmActions?: string[];
2480
+ logContent?: BrowserLogContent;
2481
+ screenshots?: BrowserScreenshotPolicy;
2482
+ /** Accepted but not enforced yet. */
1950
2483
  credentials?: string[];
1951
- /** Hard cap on a single browser session's duration (cost control). */
2484
+ /** Lua cloud browser session length in minutes: default 10, at most 60 (a larger value is cut to 60). */
1952
2485
  maxSessionMinutes?: number;
2486
+ /** Lua cloud browser idle timeout in seconds: default 120, at most 900 (a larger value is cut to 900). */
2487
+ idleTimeoutSeconds?: number;
1953
2488
  }
1954
2489
 
2490
+ 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';
2491
+
1955
2492
  /** What `.commit()` hands to `LuaWorkflow` — internal; never `new LuaWorkflow({...})` by users. */
1956
2493
  declare interface BuiltWorkflow {
1957
2494
  config: LuaWorkflowConfig;
@@ -2437,6 +2974,10 @@ export declare interface ChoiceQuestion<L extends string = string> {
2437
2974
  options: Record<L, string>;
2438
2975
  }
2439
2976
 
2977
+ declare interface ClearInput extends BrowserSessionInput {
2978
+ clear?: boolean;
2979
+ }
2980
+
2440
2981
  /**
2441
2982
  * U6 (wave 2) — connection inspection, account pinning and capability checks; U33 — the same checks run
2442
2983
  * with the CONVERSATION USER's principal. Owner: U6 (catalogue, list, pin, check, cleanup); U33 owns only
@@ -3039,6 +3580,7 @@ declare const DECISION_ERROR_CODES: {
3039
3580
  readonly DISABLED: "decision_disabled";
3040
3581
  readonly INSUFFICIENT_CREDITS: "decision_insufficient_credits";
3041
3582
  readonly NOT_FOUND: "decision_not_found";
3583
+ readonly CANCELLED: "decision_cancelled";
3042
3584
  };
3043
3585
 
3044
3586
  declare const DECISION_PROVIDERS: readonly ["jev", "openai"];
@@ -3063,6 +3605,7 @@ export declare interface DecisionError extends Error {
3063
3605
  readonly code: DecisionErrorFields['code'];
3064
3606
  readonly provider?: DecisionProvider;
3065
3607
  readonly upstreamStatus?: number;
3608
+ readonly decisionId?: string;
3066
3609
  }
3067
3610
 
3068
3611
  export declare const DecisionError: new (message: string, fields: DecisionErrorFields) => DecisionError;
@@ -3073,6 +3616,7 @@ export declare interface DecisionErrorFields {
3073
3616
  code: DecisionErrorCode | (string & {});
3074
3617
  provider?: DecisionProvider;
3075
3618
  upstreamStatus?: number;
3619
+ decisionId?: string;
3076
3620
  }
3077
3621
 
3078
3622
  declare type DecisionFallback = DecisionProvider | 'none';
@@ -3129,6 +3673,8 @@ export declare interface DecisionResult<Q extends DecisionQuestions = DecisionQu
3129
3673
  durationMs: number;
3130
3674
  cached: boolean;
3131
3675
  fallback?: DecisionFallbackInfo;
3676
+ decisionName?: string;
3677
+ decisionVersion?: string;
3132
3678
  }
3133
3679
 
3134
3680
  declare type DecisionRoutingRule = (typeof DECISION_ROUTING_RULES)[number];
@@ -3160,6 +3706,8 @@ declare interface DecisionUsage {
3160
3706
  inputTokens: number | null;
3161
3707
  }
3162
3708
 
3709
+ export declare function defineBrowser(config: LuaBrowserConfig): LuaBrowser;
3710
+
3163
3711
  export declare function defineDecision<Q extends DecisionQuestions>(config: LuaDecisionConfig<Q>): LuaDecision<Q>;
3164
3712
 
3165
3713
  /**
@@ -4143,6 +4691,10 @@ declare interface IdentifiedEntity {
4143
4691
  _id?: string;
4144
4692
  }
4145
4693
 
4694
+ declare interface IdInput extends BrowserSessionInput {
4695
+ id: string;
4696
+ }
4697
+
4146
4698
  export declare interface ImageMessage {
4147
4699
  type: 'image';
4148
4700
  image: string;
@@ -5056,8 +5608,16 @@ declare interface LlmContextStep {
5056
5608
  cacheCreationTokens?: number;
5057
5609
  cacheCreationTokens5m?: number;
5058
5610
  cacheCreationTokens1h?: number;
5611
+ /** The step's output tokens. Cost only: settlement never reads it. */
5612
+ outputTokens?: number;
5613
+ /** As the provider reported them: outside `outputTokens` on Gemini, a subset of it on OpenAI. Cost only. */
5614
+ reasoningTokens?: number;
5615
+ /** The model id the provider says served the step (a fallback leg names itself here). Cost only. */
5616
+ model?: string;
5059
5617
  }
5060
5618
 
5619
+ declare type LoadState = 'load' | 'domcontentloaded' | 'networkidle';
5620
+
5061
5621
  /**
5062
5622
  * Structured logging: `log.debug/info/warn/error(message, fields?)`.
5063
5623
  *
@@ -5189,6 +5749,7 @@ export declare class LuaAgent {
5189
5749
  private readonly batching?;
5190
5750
  private readonly governance?;
5191
5751
  private readonly browser?;
5752
+ private readonly browsers?;
5192
5753
  /**
5193
5754
  * Creates a new LuaAgent instance.
5194
5755
  *
@@ -5226,6 +5787,7 @@ export declare class LuaAgent {
5226
5787
  getBatching(): BatchingConfig | undefined;
5227
5788
  getDevices(): LuaDevice[];
5228
5789
  getVoices(): LuaVoice[] | undefined;
5790
+ getBrowsers(): LuaBrowser[] | undefined;
5229
5791
  getDecisions(): LuaDecision[];
5230
5792
  }
5231
5793
 
@@ -5290,12 +5852,13 @@ export declare interface LuaAgentConfig {
5290
5852
  /** Governance policy configuration. When set, tool calls, preprocessors, and postprocessors are governed. */
5291
5853
  governance?: GovernanceConfig;
5292
5854
  /**
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
5855
+ * Browser switch (LuaBrowser). `true` turns on browser tools and the
5856
+ * `Browser` global with platform defaults; an object adds policy (see
5857
+ * `BrowserSwitchConfig`). Off by default — a browser session costs money and
5296
5858
  * carries risk, so it's opt-in (unlike always-on searchWeb).
5297
5859
  */
5298
5860
  browser?: boolean | BrowserSwitchConfig;
5861
+ browsers?: LuaBrowser[];
5299
5862
  }
5300
5863
 
5301
5864
  /**
@@ -5323,6 +5886,44 @@ export declare type LuaAgentModel = string | ((request: LuaRequest) => string |
5323
5886
  /** The signed-in person a route runs for (never an API key, never anonymous). */
5324
5887
  export declare type LuaAuth = WebRouteAuth;
5325
5888
 
5889
+ export declare class LuaBrowser {
5890
+ readonly name: string;
5891
+ readonly description?: string;
5892
+ readonly engine: LuaBrowserSettings['engine'];
5893
+ readonly fallback: LuaBrowserSettings['fallback'];
5894
+ readonly proxyCountry: LuaBrowserSettings['proxyCountry'];
5895
+ readonly allowedDomains: LuaBrowserSettings['allowedDomains'];
5896
+ readonly confirmActions: LuaBrowserSettings['confirmActions'];
5897
+ readonly maxSessionMinutes: LuaBrowserSettings['maxSessionMinutes'];
5898
+ readonly idleTimeoutSeconds: LuaBrowserSettings['idleTimeoutSeconds'];
5899
+ readonly maxConcurrentSessions: LuaBrowserSettings['maxConcurrentSessions'];
5900
+ readonly screenshots: LuaBrowserSettings['screenshots'];
5901
+ readonly logContent: LuaBrowserSettings['logContent'];
5902
+ readonly persist: LuaBrowserSettings['persist'];
5903
+ readonly credentials: LuaBrowserSettings['credentials'];
5904
+ constructor(config: LuaBrowserConfig);
5905
+ }
5906
+
5907
+ export declare interface LuaBrowserConfig extends LuaBrowserSettings {
5908
+ name: string;
5909
+ description?: string;
5910
+ }
5911
+
5912
+ export declare interface LuaBrowserSettings {
5913
+ engine?: BrowserEngine;
5914
+ fallback?: BrowserFallback;
5915
+ proxyCountry?: string;
5916
+ allowedDomains?: string[];
5917
+ confirmActions?: string[];
5918
+ maxSessionMinutes?: number;
5919
+ idleTimeoutSeconds?: number;
5920
+ maxConcurrentSessions?: number;
5921
+ screenshots?: BrowserScreenshotPolicy;
5922
+ logContent?: BrowserLogContent;
5923
+ persist?: boolean;
5924
+ credentials?: string[];
5925
+ }
5926
+
5326
5927
  export declare class LuaDecision<Q extends DecisionQuestions = DecisionQuestions> {
5327
5928
  readonly name: string;
5328
5929
  readonly description?: string;
@@ -6070,7 +6671,7 @@ export declare interface LuaTriggerConfig<T = any> {
6070
6671
  *
6071
6672
  * export default new LuaVoice({
6072
6673
  * name: 'support-line',
6073
- * llm: 'openai/gpt-5.2-chat-latest',
6674
+ * llm: 'openai/chat-latest',
6074
6675
  * stt: 'deepgram/nova-3',
6075
6676
  * tts: { model: 'cartesia/sonic-3', voice: '9626c31c-bec5-4cca-baa8-f8ba9e84c8bc' },
6076
6677
  * vad: 'silero',
@@ -6170,7 +6771,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
6170
6771
  name: z.ZodOptional<z.ZodString>;
6171
6772
  llm: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
6172
6773
  kind: z.ZodLiteral<"inference">;
6173
- /** Provider-prefixed model id (e.g. `'openai/gpt-5.2-chat-latest'`). */
6774
+ /** Provider-prefixed model id (e.g. `'openai/chat-latest'`). */
6174
6775
  model: z.ZodString;
6175
6776
  /**
6176
6777
  * TTS-only — provider voice id. Inference's TTS API takes voice
@@ -6236,7 +6837,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
6236
6837
  }>]>;
6237
6838
  stt: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
6238
6839
  kind: z.ZodLiteral<"inference">;
6239
- /** Provider-prefixed model id (e.g. `'openai/gpt-5.2-chat-latest'`). */
6840
+ /** Provider-prefixed model id (e.g. `'openai/chat-latest'`). */
6240
6841
  model: z.ZodString;
6241
6842
  /**
6242
6843
  * TTS-only — provider voice id. Inference's TTS API takes voice
@@ -6302,7 +6903,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
6302
6903
  }>]>>;
6303
6904
  tts: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
6304
6905
  kind: z.ZodLiteral<"inference">;
6305
- /** Provider-prefixed model id (e.g. `'openai/gpt-5.2-chat-latest'`). */
6906
+ /** Provider-prefixed model id (e.g. `'openai/chat-latest'`). */
6306
6907
  model: z.ZodString;
6307
6908
  /**
6308
6909
  * TTS-only — provider voice id. Inference's TTS API takes voice
@@ -7305,7 +7906,9 @@ export declare type LuaWorkflowBuildCode = 'duplicate-step-id' | 'unknown-step-r
7305
7906
  /** BAC-2062: the builder mirror of the BAC-619 validator codes: a `waitForSignal` name a delivery refuses. */
7306
7907
  | 'signal-name-invalid'
7307
7908
  /** 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';
7909
+ | 'timeout-hours-out-of-range' | 'editable-path-invalid' | 'env-template-secret-key' | 'invalid-envelope'
7910
+ /** BAC-2341: a `concurrencyKey` declared without `concurrencyPolicy:'forbid'` (the server's 400 twin). */
7911
+ | '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
7912
 
7310
7913
  export declare interface LuaWorkflowBuilder {
7311
7914
  then(step: StepRef): this;
@@ -7372,6 +7975,11 @@ export declare interface LuaWorkflowConfig {
7372
7975
  stateSchema?: ZodType;
7373
7976
  /** 'forbid' = jobs-style overlap guard per workflow (D21-r1) — every start path gets 409 `RUNS_IN_FLIGHT`. */
7374
7977
  concurrencyPolicy?: 'allow' | 'forbid';
7978
+ /**
7979
+ * Scope the `forbid` overlap guard per correlation key instead of workflow-wide. Requires `concurrencyPolicy:'forbid'`;
7980
+ * absent means workflow-wide. Rides the manifest and the push body, not the graph envelope or `graphHash`.
7981
+ */
7982
+ concurrencyKey?: 'correlationKey';
7375
7983
  /** Who may READ this workflow's run outputs beyond `workflows:read-outputs` holders (B44). Envelope member outside `graphHash`. */
7376
7984
  outputVisibility?: WorkflowOutputVisibility;
7377
7985
  /**
@@ -9029,6 +9637,14 @@ export declare interface SecretTestOutcome {
9029
9637
 
9030
9638
  export declare type SecretTestResult = (typeof SECRET_TEST_RESULTS)[number];
9031
9639
 
9640
+ declare interface SelectorInput extends BrowserSessionInput {
9641
+ selector: string;
9642
+ }
9643
+
9644
+ declare interface SelectorTextInput extends SelectorInput {
9645
+ text: string;
9646
+ }
9647
+
9032
9648
  declare interface SendTemplateButtonValue {
9033
9649
  sub_type: WhatsAppTemplateButtonType;
9034
9650
  index: string;
@@ -10000,6 +10616,10 @@ declare interface UpdateJobVersionDTO {
10000
10616
  metadata?: Record<string, any>;
10001
10617
  }
10002
10618
 
10619
+ declare interface UrlInput extends BrowserSessionInput {
10620
+ url: string;
10621
+ }
10622
+
10003
10623
  /**
10004
10624
  * Function type for resolving URL at runtime.
10005
10625
  * Use env() inside to access agent environment variables.
@@ -10664,6 +11284,12 @@ declare const WORKFLOW_AGENT_EFFORTS: readonly ["low", "medium", "high"];
10664
11284
  /** `approval.onDeny` (§6.4.11 deny-as-data): `'fail'` fails the step on a denial; default `'continue'`. */
10665
11285
  declare const WORKFLOW_APPROVAL_ON_DENY: readonly ["fail", "continue"];
10666
11286
 
11287
+ /** Default `budget.maxDurationSeconds` of a workflow run (7 days). @catalogLimit workflow.run.defaultMaxDuration seconds */
11288
+ export declare const WORKFLOW_DEFAULT_MAX_DURATION_SECONDS = 604800;
11289
+
11290
+ /** Default `budget.maxDurationSeconds` when the graph can park on a human (approval, signal, suspend): 30 days. @catalogLimit workflow.run.hitlDefaultMaxDuration seconds */
11291
+ export declare const WORKFLOW_HITL_MAX_DURATION_SECONDS = 2592000;
11292
+
10667
11293
  /** D19-r2 (B22; 05 §5.17.6 Harness row) — both behind one `CodingHarness { run(turn) }`. */
10668
11294
  declare const WORKFLOW_JOB_HARNESSES: readonly ["claude-code", "generic"];
10669
11295
 
@@ -10834,6 +11460,8 @@ export declare interface WorkflowGoalEnvelope {
10834
11460
  maxRuns: number;
10835
11461
  budget?: LuaWorkflowConfig['budget'];
10836
11462
  maxTotalCredits?: number;
11463
+ /** The organisation's budget unit, as reported by the server (read-only; never sent on create). */
11464
+ budgetUnit?: 'actions' | 'credits';
10837
11465
  initialState?: Record<string, unknown>;
10838
11466
  }
10839
11467