agents
Version:
A home for your AI agents
72 lines (70 loc) • 2.26 kB
TypeScript
import { T as BrowserSource } from "./browser-CI97khiJ.js";
//#region src/browser/browser-tool.d.ts
interface BrowserToolOptions {
/**
* The browser the tool drives — usually a `Browser` installed on the
* host's Lifecycle. Tools built from the same `Browser` share it.
*/
browser: BrowserSource;
/**
* Worker Loader binding the model's code runs in. Each run gets a fresh
* Dynamic Worker with no network access.
*
* Requires `"worker_loaders": [{ "binding": "LOADER" }]` in wrangler.jsonc.
*/
loader: WorkerLoader;
/** How long one run may take, in milliseconds. Defaults to 60000 (60s). */
timeoutMs?: number;
/**
* Who is driving, when several chats or users share one `Browser`: runs
* with the same scope share an active tab, and each scope keeps its own.
* Cookies and logins are shared by every scope. Defaults to `"shared"`,
* one active tab for every tool that leaves it out.
*/
scope?: string;
/**
* @deprecated Not needed any more: the tool no longer runs on a codemode
* facet. Ignored.
*/
ctx?: DurableObjectState;
}
/** The model's input to `browserTool`: JavaScript to run. */
interface BrowserToolInput {
code: string;
}
/** What happened to the browser during a run, added to its result. */
interface BrowserReportFields {
/**
* Sentences telling the model what happened to its browser: it was
* restarted, its tab was closed by someone else, another scope is working
* in its tab too, or the page opened new tabs.
*/
notice?: string;
}
/**
* The result of one `browserTool` run: the code's result, or the
* error it threw, plus what happened to the browser. Errors are returned,
* not thrown, so the model can read them and try again.
*/
type BrowserToolOutput = (
| {
status: "completed" /** Identifies the run, for logs and UIs. */;
executionId: string;
result: unknown /** What the code wrote to the console. */;
logs?: string[];
}
| {
status: "error";
executionId: string;
error: string;
logs?: string[];
}
) &
BrowserReportFields;
//#endregion
export {
BrowserToolOptions as n,
BrowserToolOutput as r,
BrowserToolInput as t
};
//# sourceMappingURL=browser-tool-Cxtiwfua.d.ts.map