@hyperbrowser/sdk 1.2.2 → 1.4.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.
Files changed (43) hide show
  1. package/README.md +427 -3
  2. package/dist/client.d.ts +2 -0
  3. package/dist/client.js +2 -0
  4. package/dist/error.d.ts +2 -0
  5. package/dist/error.js +4 -1
  6. package/dist/sandbox/process.d.ts +7 -3
  7. package/dist/sandbox/process.js +15 -3
  8. package/dist/sandbox/secret-references.d.ts +4 -0
  9. package/dist/sandbox/secret-references.js +11 -2
  10. package/dist/secret-values.d.ts +14 -0
  11. package/dist/secret-values.js +153 -0
  12. package/dist/secrets-envelope.d.ts +5 -0
  13. package/dist/secrets-envelope.js +17 -7
  14. package/dist/services/credentials.d.ts +24 -0
  15. package/dist/services/credentials.js +48 -0
  16. package/dist/services/sandboxes.d.ts +3 -2
  17. package/dist/services/sandboxes.js +20 -10
  18. package/dist/services/secrets.d.ts +19 -4
  19. package/dist/services/secrets.js +53 -17
  20. package/dist/services/sessions.d.ts +2 -0
  21. package/dist/services/sessions.js +2 -0
  22. package/dist/services/vaults.d.ts +26 -0
  23. package/dist/services/vaults.js +80 -0
  24. package/dist/tools/anthropic.d.ts +1 -0
  25. package/dist/tools/anthropic.js +6 -1
  26. package/dist/tools/gemini.d.ts +56 -0
  27. package/dist/tools/gemini.js +40 -0
  28. package/dist/tools/index.d.ts +92 -0
  29. package/dist/tools/index.js +81 -1
  30. package/dist/tools/openai.d.ts +1 -0
  31. package/dist/tools/openai.js +10 -1
  32. package/dist/tools/schema.d.ts +49 -0
  33. package/dist/tools/schema.js +53 -4
  34. package/dist/types/constants.d.ts +26 -4
  35. package/dist/types/credential.d.ts +120 -0
  36. package/dist/types/credential.js +2 -0
  37. package/dist/types/index.d.ts +4 -2
  38. package/dist/types/sandbox.d.ts +89 -2
  39. package/dist/types/secret.d.ts +61 -3
  40. package/dist/types/session.d.ts +14 -0
  41. package/dist/types/vault.d.ts +55 -0
  42. package/dist/types/vault.js +2 -0
  43. package/package.json +1 -1
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VaultsService = void 0;
4
+ const error_1 = require("../error");
5
+ const base_1 = require("./base");
6
+ const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
7
+ /** Teams hold at most 100 vaults, so this covers every exact-name match. */
8
+ const NAME_LOOKUP_LIMIT = 100;
9
+ const vaultPath = (id) => `/vaults/${encodeURIComponent(id)}`;
10
+ /**
11
+ * Vaults name a set of environment variables whose values come from stored
12
+ * secrets. Pass one as `vault` to a sandbox process
13
+ * or sandbox create, or attach it to a browser session with
14
+ * `credentials: [{ vault }]` and fill its entries by name.
15
+ *
16
+ * Methods that take `vault` accept its ID or its exact name. A UUID-shaped
17
+ * argument is tried as an ID first and then as a name.
18
+ */
19
+ class VaultsService extends base_1.BaseService {
20
+ async list(params = {}) {
21
+ const { page, limit, search } = params;
22
+ const response = await this.request("/vaults", undefined, {
23
+ search,
24
+ page,
25
+ limit,
26
+ });
27
+ return { ...response, vaults: response.vaults ?? [] };
28
+ }
29
+ get(vault) {
30
+ return this.resolve(vault);
31
+ }
32
+ /** Create a vault. Entries name secrets, never values. */
33
+ create(params) {
34
+ return this.request("/vaults", { method: "POST", body: JSON.stringify(params) });
35
+ }
36
+ /**
37
+ * Change a vault's description or its entries:
38
+ * each entry given replaces that variable, `null` removes it, and entries
39
+ * not given are kept.
40
+ */
41
+ async update(vault, params) {
42
+ const { id } = await this.resolve(vault);
43
+ return await this.request(vaultPath(id), {
44
+ method: "PATCH",
45
+ body: JSON.stringify(params),
46
+ });
47
+ }
48
+ /** Delete a vault. The secrets its entries name are kept. */
49
+ async delete(vault) {
50
+ const { id } = await this.resolve(vault);
51
+ return await this.request(vaultPath(id), { method: "DELETE" });
52
+ }
53
+ async resolve(key) {
54
+ if (typeof key !== "string" || !key.trim()) {
55
+ throw (0, error_1.invalidRequest)("A vault ID or name is required");
56
+ }
57
+ key = key.trim();
58
+ if (UUID_PATTERN.test(key)) {
59
+ try {
60
+ return await this.request(vaultPath(key));
61
+ }
62
+ catch (error) {
63
+ if (!(error instanceof error_1.HyperbrowserError) || error.statusCode !== 404) {
64
+ throw error;
65
+ }
66
+ }
67
+ }
68
+ const { vaults } = await this.list({ search: key, limit: NAME_LOOKUP_LIMIT });
69
+ const vault = vaults.find((candidate) => candidate.name === key);
70
+ if (!vault) {
71
+ throw new error_1.HyperbrowserError(`Vault ${JSON.stringify(key)} not found`, {
72
+ statusCode: 404,
73
+ code: "VAULT_NOT_FOUND",
74
+ service: "control",
75
+ });
76
+ }
77
+ return vault;
78
+ }
79
+ }
80
+ exports.VaultsService = VaultsService;
@@ -38,3 +38,4 @@ export declare const EXTRACT_TOOL_ANTHROPIC: Tool;
38
38
  export declare const BROWSER_USE_TOOL_ANTHROPIC: Tool;
39
39
  export declare const CLAUDE_COMPUTER_USE_TOOL_ANTHROPIC: Tool;
40
40
  export declare const OPENAI_CUA_TOOL_ANTHROPIC: Tool;
41
+ export declare const FILL_CREDENTIAL_TOOL_ANTHROPIC: Tool;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OPENAI_CUA_TOOL_ANTHROPIC = exports.CLAUDE_COMPUTER_USE_TOOL_ANTHROPIC = exports.BROWSER_USE_TOOL_ANTHROPIC = exports.EXTRACT_TOOL_ANTHROPIC = exports.CRAWL_TOOL_ANTHROPIC = exports.SCREENSHOT_TOOL_ANTHROPIC = exports.SCRAPE_TOOL_ANTHROPIC = void 0;
3
+ exports.FILL_CREDENTIAL_TOOL_ANTHROPIC = exports.OPENAI_CUA_TOOL_ANTHROPIC = exports.CLAUDE_COMPUTER_USE_TOOL_ANTHROPIC = exports.BROWSER_USE_TOOL_ANTHROPIC = exports.EXTRACT_TOOL_ANTHROPIC = exports.CRAWL_TOOL_ANTHROPIC = exports.SCREENSHOT_TOOL_ANTHROPIC = exports.SCRAPE_TOOL_ANTHROPIC = void 0;
4
4
  const schema_1 = require("./schema");
5
5
  exports.SCRAPE_TOOL_ANTHROPIC = {
6
6
  input_schema: schema_1.SCRAPE_SCHEMA,
@@ -37,3 +37,8 @@ exports.OPENAI_CUA_TOOL_ANTHROPIC = {
37
37
  name: "openai_cua",
38
38
  description: schema_1.OPENAI_CUA_DESCRIPTION,
39
39
  };
40
+ exports.FILL_CREDENTIAL_TOOL_ANTHROPIC = {
41
+ input_schema: schema_1.FILL_CREDENTIAL_SCHEMA,
42
+ name: "fill_credential",
43
+ description: schema_1.FILL_CREDENTIAL_DESCRIPTION,
44
+ };
@@ -0,0 +1,56 @@
1
+ export declare const FILL_CREDENTIAL_TOOL_GEMINI: {
2
+ name: string;
3
+ description: string;
4
+ parameters: {
5
+ type: string;
6
+ properties: {
7
+ credential: {
8
+ type: string;
9
+ nullable: boolean;
10
+ description: string;
11
+ };
12
+ vault: {
13
+ type: string;
14
+ nullable: boolean;
15
+ description: string;
16
+ };
17
+ fields: {
18
+ type: string;
19
+ description: string;
20
+ minItems: string;
21
+ maxItems: string;
22
+ items: {
23
+ type: string;
24
+ properties: {
25
+ selector: {
26
+ type: string;
27
+ description: string;
28
+ };
29
+ field: {
30
+ type: string;
31
+ nullable: boolean;
32
+ description: string;
33
+ };
34
+ };
35
+ required: string[];
36
+ };
37
+ };
38
+ page_id: {
39
+ type: string;
40
+ nullable: boolean;
41
+ description: string;
42
+ };
43
+ page_url: {
44
+ type: string;
45
+ nullable: boolean;
46
+ description: string;
47
+ };
48
+ frame_url: {
49
+ type: string;
50
+ nullable: boolean;
51
+ description: string;
52
+ };
53
+ };
54
+ required: string[];
55
+ };
56
+ };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FILL_CREDENTIAL_TOOL_GEMINI = void 0;
4
+ const schema_1 = require("./schema");
5
+ // This declaration covers fill_credential only. General tool/schema conversion
6
+ // belongs in a separate change rather than expanding the credentials API.
7
+ const nullableString = (description) => ({ type: "STRING", nullable: true, description });
8
+ const properties = schema_1.FILL_CREDENTIAL_SCHEMA.properties;
9
+ exports.FILL_CREDENTIAL_TOOL_GEMINI = {
10
+ name: "fill_credential",
11
+ description: schema_1.FILL_CREDENTIAL_DESCRIPTION,
12
+ parameters: {
13
+ type: "OBJECT",
14
+ properties: {
15
+ credential: nullableString(properties.credential.description),
16
+ vault: nullableString(properties.vault.description),
17
+ fields: {
18
+ type: "ARRAY",
19
+ description: properties.fields.description,
20
+ minItems: String(properties.fields.minItems),
21
+ maxItems: String(properties.fields.maxItems),
22
+ items: {
23
+ type: "OBJECT",
24
+ properties: {
25
+ selector: {
26
+ type: "STRING",
27
+ description: properties.fields.items.properties.selector.description,
28
+ },
29
+ field: nullableString(properties.fields.items.properties.field.description),
30
+ },
31
+ required: properties.fields.items.required,
32
+ },
33
+ },
34
+ page_id: nullableString(properties.page_id.description),
35
+ page_url: nullableString(properties.page_url.description),
36
+ frame_url: nullableString(properties.frame_url.description),
37
+ },
38
+ required: schema_1.FILL_CREDENTIAL_SCHEMA.required,
39
+ },
40
+ };
@@ -1,6 +1,22 @@
1
1
  import { HyperbrowserClient } from "../client";
2
2
  import { StartScrapeJobParams, StartCrawlJobParams, StartBrowserUseTaskParams, StartCuaTaskParams, StartClaudeComputerUseTaskParams } from "../types";
3
3
  import { StartExtractJobParams } from "../types/extract";
4
+ export { FILL_CREDENTIAL_DESCRIPTION, FILL_CREDENTIAL_SCHEMA } from "./schema";
5
+ export { FILL_CREDENTIAL_TOOL_OPENAI } from "./openai";
6
+ export { FILL_CREDENTIAL_TOOL_ANTHROPIC } from "./anthropic";
7
+ export * from "./gemini";
8
+ /** What the model passes to `fill_credential`. Unused options are null. */
9
+ export interface CredentialFillToolParams {
10
+ credential?: string | null;
11
+ vault?: string | null;
12
+ fields: {
13
+ selector: string;
14
+ field?: string | null;
15
+ }[];
16
+ page_id?: string | null;
17
+ page_url?: string | null;
18
+ frame_url?: string | null;
19
+ }
4
20
  export declare class WebsiteScrapeTool {
5
21
  static openaiToolDefinition: import("./openai").ChatCompletionTool;
6
22
  static anthropicToolDefinition: import("./anthropic").Tool;
@@ -36,3 +52,79 @@ export declare class OpenAICuaTool {
36
52
  static anthropicToolDefinition: import("./anthropic").Tool;
37
53
  static runnable(hb: HyperbrowserClient, params: StartCuaTaskParams): Promise<string>;
38
54
  }
55
+ /**
56
+ * Lets a model fill a secret, or a vault's entries, attached to a browser
57
+ * session. The application binds the session; the model chooses only names,
58
+ * selectors and which tab, and never sees values.
59
+ *
60
+ * It deliberately has no `onePassword`: a 1Password fill names its own
61
+ * allowed origins, and a model choosing them would defeat the origin check.
62
+ * Applications call `sessions.credentials.fill` directly for 1Password.
63
+ */
64
+ export declare class CredentialFillTool {
65
+ static openaiToolDefinition: import("./openai").ChatCompletionTool;
66
+ static anthropicToolDefinition: import("./anthropic").Tool;
67
+ static geminiToolDefinition: {
68
+ name: string;
69
+ description: string;
70
+ parameters: {
71
+ type: string;
72
+ properties: {
73
+ credential: {
74
+ type: string;
75
+ nullable: boolean;
76
+ description: string;
77
+ };
78
+ vault: {
79
+ type: string;
80
+ nullable: boolean;
81
+ description: string;
82
+ };
83
+ fields: {
84
+ type: string;
85
+ description: string;
86
+ minItems: string;
87
+ maxItems: string;
88
+ items: {
89
+ type: string;
90
+ properties: {
91
+ selector: {
92
+ type: string;
93
+ description: string;
94
+ };
95
+ field: {
96
+ type: string;
97
+ nullable: boolean;
98
+ description: string;
99
+ };
100
+ };
101
+ required: string[];
102
+ };
103
+ };
104
+ page_id: {
105
+ type: string;
106
+ nullable: boolean;
107
+ description: string;
108
+ };
109
+ page_url: {
110
+ type: string;
111
+ nullable: boolean;
112
+ description: string;
113
+ };
114
+ frame_url: {
115
+ type: string;
116
+ nullable: boolean;
117
+ description: string;
118
+ };
119
+ };
120
+ required: string[];
121
+ };
122
+ };
123
+ /**
124
+ * Run a `fill_credential` call in `sessionId` and return the result as JSON
125
+ * text for the model. API and validation errors come back as
126
+ * `{"error": {"code", "message", "retryable", "details"}}` rather than
127
+ * being thrown, so the model can react to them.
128
+ */
129
+ static runnable(hb: HyperbrowserClient, sessionId: string, params: CredentialFillToolParams): Promise<string>;
130
+ }
@@ -1,8 +1,33 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpenAICuaTool = exports.ClaudeComputerUseTool = exports.BrowserUseTool = exports.WebsiteExtractTool = exports.WebsiteCrawlTool = exports.WebsiteScreenshotTool = exports.WebsiteScrapeTool = void 0;
17
+ exports.CredentialFillTool = exports.OpenAICuaTool = exports.ClaudeComputerUseTool = exports.BrowserUseTool = exports.WebsiteExtractTool = exports.WebsiteCrawlTool = exports.WebsiteScreenshotTool = exports.WebsiteScrapeTool = exports.FILL_CREDENTIAL_TOOL_ANTHROPIC = exports.FILL_CREDENTIAL_TOOL_OPENAI = exports.FILL_CREDENTIAL_SCHEMA = exports.FILL_CREDENTIAL_DESCRIPTION = void 0;
4
18
  const openai_1 = require("./openai");
5
19
  const anthropic_1 = require("./anthropic");
20
+ const gemini_1 = require("./gemini");
21
+ const client_1 = require("../client");
22
+ const secrets_envelope_1 = require("../secrets-envelope");
23
+ var schema_1 = require("./schema");
24
+ Object.defineProperty(exports, "FILL_CREDENTIAL_DESCRIPTION", { enumerable: true, get: function () { return schema_1.FILL_CREDENTIAL_DESCRIPTION; } });
25
+ Object.defineProperty(exports, "FILL_CREDENTIAL_SCHEMA", { enumerable: true, get: function () { return schema_1.FILL_CREDENTIAL_SCHEMA; } });
26
+ var openai_2 = require("./openai");
27
+ Object.defineProperty(exports, "FILL_CREDENTIAL_TOOL_OPENAI", { enumerable: true, get: function () { return openai_2.FILL_CREDENTIAL_TOOL_OPENAI; } });
28
+ var anthropic_2 = require("./anthropic");
29
+ Object.defineProperty(exports, "FILL_CREDENTIAL_TOOL_ANTHROPIC", { enumerable: true, get: function () { return anthropic_2.FILL_CREDENTIAL_TOOL_ANTHROPIC; } });
30
+ __exportStar(require("./gemini"), exports);
6
31
  class WebsiteScrapeTool {
7
32
  static async runnable(hb, params) {
8
33
  const resp = await hb.scrape.startAndWait(params);
@@ -77,3 +102,58 @@ class OpenAICuaTool {
77
102
  exports.OpenAICuaTool = OpenAICuaTool;
78
103
  OpenAICuaTool.openaiToolDefinition = openai_1.OPENAI_CUA_TOOL_OPENAI;
79
104
  OpenAICuaTool.anthropicToolDefinition = anthropic_1.OPENAI_CUA_TOOL_ANTHROPIC;
105
+ /**
106
+ * Lets a model fill a secret, or a vault's entries, attached to a browser
107
+ * session. The application binds the session; the model chooses only names,
108
+ * selectors and which tab, and never sees values.
109
+ *
110
+ * It deliberately has no `onePassword`: a 1Password fill names its own
111
+ * allowed origins, and a model choosing them would defeat the origin check.
112
+ * Applications call `sessions.credentials.fill` directly for 1Password.
113
+ */
114
+ class CredentialFillTool {
115
+ /**
116
+ * Run a `fill_credential` call in `sessionId` and return the result as JSON
117
+ * text for the model. API and validation errors come back as
118
+ * `{"error": {"code", "message", "retryable", "details"}}` rather than
119
+ * being thrown, so the model can react to them.
120
+ */
121
+ static async runnable(hb, sessionId, params) {
122
+ try {
123
+ // Model output is checked by fill; only the known keys are passed on.
124
+ // Null (strict mode's "not given") and "" (what Gemini tends to send
125
+ // for unused strings) are left out.
126
+ const input = (0, secrets_envelope_1.isPlainObject)(params) ? params : {};
127
+ const given = (value) => value === null || value === "" ? undefined : value;
128
+ const request = {
129
+ credential: given(input.credential),
130
+ vault: given(input.vault),
131
+ fields: (Array.isArray(input.fields)
132
+ ? input.fields.map((entry) => (0, secrets_envelope_1.isPlainObject)(entry) ? { selector: entry.selector, field: given(entry.field) } : entry)
133
+ : input.fields),
134
+ pageId: given(input.page_id),
135
+ pageUrl: given(input.page_url),
136
+ frameUrl: given(input.frame_url),
137
+ };
138
+ return JSON.stringify(await hb.sessions.credentials.fill(sessionId, request));
139
+ }
140
+ catch (error) {
141
+ if (!(error instanceof client_1.HyperbrowserError)) {
142
+ throw error;
143
+ }
144
+ return JSON.stringify({
145
+ error: {
146
+ code: error.code ?? null,
147
+ message: error.message.replace(/^\[Hyperbrowser\]: /, ""),
148
+ retryable: error.retryable,
149
+ // details is the error body; the model gets the server's own details.
150
+ details: (0, secrets_envelope_1.isPlainObject)(error.details) ? (error.details.details ?? null) : null,
151
+ },
152
+ });
153
+ }
154
+ }
155
+ }
156
+ exports.CredentialFillTool = CredentialFillTool;
157
+ CredentialFillTool.openaiToolDefinition = openai_1.FILL_CREDENTIAL_TOOL_OPENAI;
158
+ CredentialFillTool.anthropicToolDefinition = anthropic_1.FILL_CREDENTIAL_TOOL_ANTHROPIC;
159
+ CredentialFillTool.geminiToolDefinition = gemini_1.FILL_CREDENTIAL_TOOL_GEMINI;
@@ -43,3 +43,4 @@ export declare const EXTRACT_TOOL_OPENAI: ChatCompletionTool;
43
43
  export declare const BROWSER_USE_TOOL_OPENAI: ChatCompletionTool;
44
44
  export declare const CLAUDE_COMPUTER_USE_TOOL_OPENAI: ChatCompletionTool;
45
45
  export declare const OPENAI_CUA_TOOL_OPENAI: ChatCompletionTool;
46
+ export declare const FILL_CREDENTIAL_TOOL_OPENAI: ChatCompletionTool;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OPENAI_CUA_TOOL_OPENAI = exports.CLAUDE_COMPUTER_USE_TOOL_OPENAI = exports.BROWSER_USE_TOOL_OPENAI = exports.EXTRACT_TOOL_OPENAI = exports.CRAWL_TOOL_OPENAI = exports.SCREENSHOT_TOOL_OPENAI = exports.SCRAPE_TOOL_OPENAI = void 0;
3
+ exports.FILL_CREDENTIAL_TOOL_OPENAI = exports.OPENAI_CUA_TOOL_OPENAI = exports.CLAUDE_COMPUTER_USE_TOOL_OPENAI = exports.BROWSER_USE_TOOL_OPENAI = exports.EXTRACT_TOOL_OPENAI = exports.CRAWL_TOOL_OPENAI = exports.SCREENSHOT_TOOL_OPENAI = exports.SCRAPE_TOOL_OPENAI = void 0;
4
4
  const schema_1 = require("./schema");
5
5
  exports.SCRAPE_TOOL_OPENAI = {
6
6
  type: "function",
@@ -65,3 +65,12 @@ exports.OPENAI_CUA_TOOL_OPENAI = {
65
65
  strict: true,
66
66
  },
67
67
  };
68
+ exports.FILL_CREDENTIAL_TOOL_OPENAI = {
69
+ type: "function",
70
+ function: {
71
+ name: "fill_credential",
72
+ description: schema_1.FILL_CREDENTIAL_DESCRIPTION,
73
+ parameters: schema_1.FILL_CREDENTIAL_SCHEMA,
74
+ strict: true,
75
+ },
76
+ };
@@ -266,3 +266,52 @@ export declare const OPENAI_CUA_SCHEMA: {
266
266
  required: string[];
267
267
  additionalProperties: boolean;
268
268
  };
269
+ export declare const FILL_CREDENTIAL_DESCRIPTION = "Fill stored login details into inputs on the browser session's page. You never see the values: you name what to fill and give a CSS selector for each input. Pass exactly one of:\n- credential: the name of one stored secret, such as a password. Each field is just {\"selector\"}.\n- vault: the name of a vault that groups a login's secrets under entry names such as USERNAME, PASSWORD or OTP. Each field is {\"selector\", \"field\"}, where field is the entry to type into that input. A one-time-code (TOTP) entry types the code that is current at the moment of the fill.\n\nThis tool only types. It does NOT submit the form: after a fill, click the login or submit button, or press Enter, with your other browser tools. For logins split over several screens (for example the username first, then the password), fill the inputs on the current screen, submit, and fill the rest on the next screen. Calling it again is safe; it replaces what is in the inputs.\n\nOn success it returns JSON with an outcome per input:\n- \"filled\": the input now holds the value.\n- \"not_found\": no input matched the selector. Look at the page again and use a selector that matches the input.\n- \"ambiguous\": several visible inputs matched. Use a more specific selector that matches exactly one.\n- \"not_editable\": the element is disabled, read-only, hidden or not a text input. Select the actual visible input, or wait until it becomes editable.\n- \"not_accepted\": the page did not keep the value (for example a length limit, or a script cleared it). Check the form, and tell the user if it keeps happening.\nSubmit only once every input you need is \"filled\".\n\nOn failure it returns JSON {\"error\": {\"code\", \"message\", \"retryable\", \"details\"}}. If the code is CREDENTIAL_PAGE_AMBIGUOUS, several tabs could be the target: call again with page_id set to the pageId of the tab with the login form from details.pages, or with page_url set to the start of that tab's URL. CREDENTIAL_ORIGIN_NOT_ALLOWED means these details may not be used on the current site; nothing was typed, so do not try to work around it, and tell the user. CREDENTIAL_NOT_ATTACHED, SECRET_NOT_FOUND, VAULT_NOT_FOUND and VAULT_ENTRY_NOT_FOUND mean the name is wrong or was not made available to this session; use a name you were given. CREDENTIAL_FRAME_NOT_FOUND means no iframe matched frame_url. If retryable is true, you may try the same call again.";
270
+ export declare const FILL_CREDENTIAL_SCHEMA: {
271
+ type: "object";
272
+ properties: {
273
+ credential: {
274
+ type: string[];
275
+ description: string;
276
+ };
277
+ vault: {
278
+ type: string[];
279
+ description: string;
280
+ };
281
+ fields: {
282
+ type: string;
283
+ description: string;
284
+ minItems: number;
285
+ maxItems: number;
286
+ items: {
287
+ type: string;
288
+ properties: {
289
+ selector: {
290
+ type: string;
291
+ description: string;
292
+ };
293
+ field: {
294
+ type: string[];
295
+ description: string;
296
+ };
297
+ };
298
+ required: string[];
299
+ additionalProperties: boolean;
300
+ };
301
+ };
302
+ page_id: {
303
+ type: string[];
304
+ description: string;
305
+ };
306
+ page_url: {
307
+ type: string[];
308
+ description: string;
309
+ };
310
+ frame_url: {
311
+ type: string[];
312
+ description: string;
313
+ };
314
+ };
315
+ required: string[];
316
+ additionalProperties: boolean;
317
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OPENAI_CUA_SCHEMA = exports.CLAUDE_COMPUTER_USE_SCHEMA = exports.BROWSER_USE_SCHEMA = exports.EXTRACT_SCHEMA = exports.CRAWL_SCHEMA = exports.SCREENSHOT_SCHEMA = exports.SCRAPE_SCHEMA = exports.CLAUDE_COMPUTER_USE_DESCRIPTION = exports.OPENAI_CUA_DESCRIPTION = void 0;
3
+ exports.FILL_CREDENTIAL_SCHEMA = exports.FILL_CREDENTIAL_DESCRIPTION = exports.OPENAI_CUA_SCHEMA = exports.CLAUDE_COMPUTER_USE_SCHEMA = exports.BROWSER_USE_SCHEMA = exports.EXTRACT_SCHEMA = exports.CRAWL_SCHEMA = exports.SCREENSHOT_SCHEMA = exports.SCRAPE_SCHEMA = exports.CLAUDE_COMPUTER_USE_DESCRIPTION = exports.OPENAI_CUA_DESCRIPTION = void 0;
4
4
  exports.OPENAI_CUA_DESCRIPTION = `This tool utilizes OpenAI's model to autonomously execute general-purpose browser-based tasks with balanced performance and reliability using a cloud browser. It handles complex interactions effectively with practical reasoning and clear execution.
5
5
 
6
6
  Optimal for tasks requiring:
@@ -179,9 +179,9 @@ const BROWSER_USE_LLM_SCHEMA = {
179
179
  enum: [
180
180
  "gpt-4o",
181
181
  "gpt-4o-mini",
182
- "claude-3-7-sonnet-20250219",
183
- "claude-3-5-sonnet-20241022",
184
- "claude-3-5-haiku-20241022",
182
+ "claude-sonnet-5",
183
+ "claude-sonnet-4-6",
184
+ "claude-haiku-5-5",
185
185
  "gemini-2.0-flash",
186
186
  "gemini-3.8-flash",
187
187
  ],
@@ -238,3 +238,52 @@ exports.OPENAI_CUA_SCHEMA = {
238
238
  required: ["task", "sessionOptions"],
239
239
  additionalProperties: false,
240
240
  };
241
+ exports.FILL_CREDENTIAL_DESCRIPTION = `Fill stored login details into inputs on the browser session's page. You never see the values: you name what to fill and give a CSS selector for each input. Pass exactly one of:
242
+ - credential: the name of one stored secret, such as a password. Each field is just {"selector"}.
243
+ - vault: the name of a vault that groups a login's secrets under entry names such as USERNAME, PASSWORD or OTP. Each field is {"selector", "field"}, where field is the entry to type into that input. A one-time-code (TOTP) entry types the code that is current at the moment of the fill.
244
+
245
+ This tool only types. It does NOT submit the form: after a fill, click the login or submit button, or press Enter, with your other browser tools. For logins split over several screens (for example the username first, then the password), fill the inputs on the current screen, submit, and fill the rest on the next screen. Calling it again is safe; it replaces what is in the inputs.
246
+
247
+ On success it returns JSON with an outcome per input:
248
+ - "filled": the input now holds the value.
249
+ - "not_found": no input matched the selector. Look at the page again and use a selector that matches the input.
250
+ - "ambiguous": several visible inputs matched. Use a more specific selector that matches exactly one.
251
+ - "not_editable": the element is disabled, read-only, hidden or not a text input. Select the actual visible input, or wait until it becomes editable.
252
+ - "not_accepted": the page did not keep the value (for example a length limit, or a script cleared it). Check the form, and tell the user if it keeps happening.
253
+ Submit only once every input you need is "filled".
254
+
255
+ On failure it returns JSON {"error": {"code", "message", "retryable", "details"}}. If the code is CREDENTIAL_PAGE_AMBIGUOUS, several tabs could be the target: call again with page_id set to the pageId of the tab with the login form from details.pages, or with page_url set to the start of that tab's URL. CREDENTIAL_ORIGIN_NOT_ALLOWED means these details may not be used on the current site; nothing was typed, so do not try to work around it, and tell the user. CREDENTIAL_NOT_ATTACHED, SECRET_NOT_FOUND, VAULT_NOT_FOUND and VAULT_ENTRY_NOT_FOUND mean the name is wrong or was not made available to this session; use a name you were given. CREDENTIAL_FRAME_NOT_FOUND means no iframe matched frame_url. If retryable is true, you may try the same call again.`;
256
+ const nullableString = (description) => ({
257
+ type: ["string", "null"],
258
+ description,
259
+ });
260
+ exports.FILL_CREDENTIAL_SCHEMA = {
261
+ type: "object",
262
+ properties: {
263
+ credential: nullableString('Name of a stored secret to type, for example "github-password". Null when you pass vault.'),
264
+ vault: nullableString('Name of a vault whose entries to type, for example "github-login". Null when you pass credential.'),
265
+ fields: {
266
+ type: "array",
267
+ description: "The inputs to fill on the page, each listed once: one entry per input, at most 16.",
268
+ minItems: 1,
269
+ maxItems: 16,
270
+ items: {
271
+ type: "object",
272
+ properties: {
273
+ selector: {
274
+ type: "string",
275
+ description: 'CSS selector for the input to type into, matching exactly one visible input, for example "#login_field" or "input[name=password]".',
276
+ },
277
+ field: nullableString('With vault: the entry to type into this input, such as "USERNAME", "PASSWORD" or "OTP". Null with credential.'),
278
+ },
279
+ required: ["selector", "field"],
280
+ additionalProperties: false,
281
+ },
282
+ },
283
+ page_id: nullableString("Usually null. Set it only after a call failed with CREDENTIAL_PAGE_AMBIGUOUS because several tabs could be the target: the pageId of the tab with the login form, from that error's details.pages. Not with page_url."),
284
+ page_url: nullableString('Usually null. Instead of page_id, the URL (or the start of it) of the tab to fill, for example "https://github.com/login". Not with page_id.'),
285
+ frame_url: nullableString('Null unless the login form is inside an iframe. Then the URL of that iframe, or the start of it, for example "https://accounts.example.com/login".'),
286
+ },
287
+ required: ["credential", "vault", "fields", "page_id", "page_url", "frame_url"],
288
+ additionalProperties: false,
289
+ };
@@ -1,4 +1,4 @@
1
- export type SessionEventLogType = "captcha_detected" | "captcha_solved" | "captcha_error" | "file_downloaded";
1
+ export type SessionEventLogType = "captcha_detected" | "captcha_solved" | "captcha_error" | "file_downloaded" | "tab_opened" | "credential_filled" | "credential_fill_refused";
2
2
  export type ScrapeFormat = "markdown" | "html" | "links" | "screenshot";
3
3
  export type ScrapeJobStatus = "pending" | "running" | "completed" | "failed";
4
4
  export type ExtractJobStatus = "pending" | "running" | "completed" | "failed";
@@ -19,13 +19,35 @@ export type RecordingStatus = "not_enabled" | "pending" | "in_progress" | "compl
19
19
  export type DownloadsStatus = "not_enabled" | "pending" | "in_progress" | "completed" | "failed";
20
20
  export declare const POLLING_ATTEMPTS = 5;
21
21
  export type BrowserUseVersion = "0.1.40" | "0.7.10" | "latest";
22
- export type BrowserUseLlm = "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-5" | "gpt-5-mini" | "claude-sonnet-5" | "claude-sonnet-4-5" | "claude-sonnet-4-6" | "claude-haiku-5-5" | "claude-sonnet-4-20250514" | "claude-3-7-sonnet-20250219" | "claude-3-5-sonnet-20241022" | "claude-3-5-haiku-20241022" | "gemini-2.0-flash" | "gemini-2.5-flash" | "gemini-3.8-flash";
23
- export type ClaudeComputerUseLlm = "claude-opus-5-5" | "claude-fable-5-1" | "claude-opus-5" | "claude-opus-4-5" | "claude-opus-4-6" | "claude-opus-4-7" | "claude-opus-4-8" | "claude-haiku-5-5" | "claude-haiku-4-5-20251001" | "claude-sonnet-5-5" | "claude-sonnet-5" | "claude-sonnet-4-5" | "claude-sonnet-4-6" | "claude-sonnet-4-20250514" | "claude-3-7-sonnet-20250219";
22
+ export type BrowserUseLlm = "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-5" | "gpt-5-mini" | "claude-sonnet-5" | "claude-sonnet-4-6" | "claude-haiku-5-5"
23
+ /** @deprecated Retires November 30, 2026; use "claude-sonnet-5". */
24
+ | "claude-sonnet-4-5"
25
+ /** @deprecated Retired; the API maps this to "claude-sonnet-5". */
26
+ | "claude-sonnet-4-20250514"
27
+ /** @deprecated Retired; the API maps this to "claude-sonnet-5". */
28
+ | "claude-3-7-sonnet-20250219"
29
+ /** @deprecated Retired; the API maps this to "claude-sonnet-5". */
30
+ | "claude-3-5-sonnet-20241022"
31
+ /** @deprecated Retired; the API maps this to "claude-sonnet-5". */
32
+ | "claude-3-5-haiku-20241022" | "gemini-2.0-flash" | "gemini-2.5-flash" | "gemini-3.8-flash";
33
+ export type ClaudeComputerUseLlm = "claude-opus-5-5" | "claude-fable-5-1" | "claude-opus-5" | "claude-opus-4-8" | "claude-opus-4-7" | "claude-opus-4-6" | "claude-opus-4-5" | "claude-sonnet-5-5" | "claude-sonnet-5" | "claude-sonnet-4-6" | "claude-haiku-5-5" | "claude-haiku-4-5-20251001"
34
+ /** @deprecated Retires November 30, 2026; use "claude-sonnet-5-5". */
35
+ | "claude-sonnet-4-5"
36
+ /** @deprecated Retired; the API maps this to "claude-sonnet-4-6". */
37
+ | "claude-sonnet-4-20250514"
38
+ /** @deprecated Retired; the API maps this to "claude-sonnet-4-6". */
39
+ | "claude-3-7-sonnet-20250219"
40
+ /** @deprecated Retired; the API maps this to "claude-opus-4-8". */
41
+ | "claude-opus-4-20250514"
42
+ /** @deprecated Retired legacy ID; the API maps this to "claude-opus-4-8". */
43
+ | "claude-4-opus-20250514";
24
44
  export type ClaudeComputerUseReasoningEffort = "low" | "medium" | "high" | "xhigh" | "max";
25
45
  export type CuaLlm = "computer-use-preview" | "gpt-6-astra" | "gpt-6.1-sol" | "gpt-6-sol" | "gpt-6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra" | "gpt-5.6-luna" | "gpt-5.5" | "gpt-5.4" | "gpt-5.4-mini";
26
46
  export type CuaReasoningEffort = "none" | "low" | "medium" | "high" | "xhigh" | "max";
27
47
  export type HyperAgentVersion = "0.8.0" | "1.1.0";
28
- export type HyperAgentLlm = "gpt-5.6-luna" | "gpt-5.5" | "gpt-5.2" | "gpt-5.1" | "gpt-5" | "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-sonnet-5" | "claude-sonnet-4-5" | "claude-sonnet-4-6" | "claude-haiku-5-5" | "gemini-2.5-flash" | "gemini-3.8-flash" | "gemini-3.7-flash" | "gemini-3-flash-preview";
48
+ export type HyperAgentLlm = "gpt-6-luna" | "gpt-5.6-luna" | "gpt-5.5" | "gpt-5.2" | "gpt-5.1" | "gpt-5" | "gpt-5-mini" | "gpt-4o" | "gpt-4o-mini" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-sonnet-5" | "claude-sonnet-4-6" | "claude-haiku-5-5"
49
+ /** @deprecated Retires November 30, 2026; use "claude-sonnet-5". */
50
+ | "claude-sonnet-4-5" | "gemini-2.5-flash" | "gemini-3.8-flash" | "gemini-3.7-flash" | "gemini-3-flash-preview";
29
51
  export type GeminiComputerUseLlm = "gemini-4-argon" | "gemini-3.8-flash" | "gemini-3.7-flash" | "gemini-3.6-flash" | "gemini-3.5-flash" | "gemini-3.5-flash-lite" | "gemini-3-flash-preview" | "gemini-2.5-computer-use-preview-10-2025";
30
52
  export type GeminiComputerUseReasoningEffort = "minimal" | "low" | "medium" | "high";
31
53
  export type GrokComputerUseLlm = "grok-4.7" | "grok-4.6" | "grok-4.5";