@kana-ai/edgar-ext-browserbase 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,12 +23,14 @@ The extension calls the REST API with `fetch`, as the GitHub extension does. The
23
23
  - `create_session` holds `sandbox:write` for that one file. `connect_url_file` is `null` when the sandbox refuses the write, such as a call with no sandbox. The tool still returns `done` with `session_id`, so the stage can end the session with `end_session`.
24
24
  - `live_view_url` opens a live view of the browser for a person. It is `null` when the read of `GET /v1/sessions/{id}/debug` fails (an error answer, a network error, or an answer with no URL). The tool still returns `done` with `session_id`, because the session is billed once the POST answers: the stage can end it with `end_session`, and a retry does not start a second session.
25
25
  - With `keep_alive` off, the session ends when the last CDP client disconnects. In the smoke test, the session was `COMPLETED` five seconds after its start.
26
- - `end_session` on a session that already ended answers its current status.
26
+ - `end_session` is a side effect with no undo: an ended session does not start again. On a session that already ended, it answers its current status.
27
27
  - `list_sessions` reads the one page that the API answers.
28
28
  - `session_logs` returns the CDP method of each entry, at most 200. The full entries hold request and response bodies, which can hold page data.
29
29
  - `session_replay` returns the dashboard URL of the replay, and the HLS playlist URL of each page. A playlist URL needs the key in `X-BB-API-Key`.
30
30
  - `session_downloads` reads up to 100 downloads.
31
+ - `create_context` is a side effect with no undo: the context stays until `delete_context` removes it.
31
32
  - `delete_context` is a side effect with no undo: the cookies and storage of the context are gone.
33
+ - A side effect is held back in a dry run, and `edgar extensions approve` lists it.
32
34
  - The REST API has no screenshot call. To take one, drive the browser through the URL in `connect_url_file`.
33
35
 
34
36
  ## Configuration
@@ -3,8 +3,22 @@ import { z } from "zod";
3
3
  export const region = z.enum(["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"]);
4
4
  /** The extension's `[extensions.browserbase]` table. */
5
5
  export const config = z.strictObject({
6
- timeout_seconds: z.number().int().min(60).max(21600).default(300),
7
- keep_alive: z.boolean().default(false),
8
- record: z.boolean().default(true),
9
- region: region.optional(),
6
+ timeout_seconds: z
7
+ .number()
8
+ .int()
9
+ .min(60)
10
+ .max(21600)
11
+ .default(300)
12
+ .describe("How long one browser session may stay open, in seconds, when the tool input sets none. Default 300."),
13
+ keep_alive: z
14
+ .boolean()
15
+ .default(false)
16
+ .describe("Keep a session open after the last client disconnects, when the tool input does not say. Default false."),
17
+ record: z
18
+ .boolean()
19
+ .default(true)
20
+ .describe("Record each session so session_replay can play it back, when the tool input does not say. Default true."),
21
+ region: region
22
+ .optional()
23
+ .describe("The region the sessions run in. Browserbase picks one when it is not set."),
10
24
  });
@@ -10,6 +10,9 @@ export const contextTools = {
10
10
  input: createContext.input,
11
11
  output: createContext.output,
12
12
  ...apiAccess,
13
+ side_effect: true,
14
+ undo: "none",
15
+ undo_reason: "a context stays until delete_context removes it",
13
16
  execute: async ({ name }, ctx) => {
14
17
  const made = await browserbase(ctx, "POST", "/v1/contexts", createdContext, {
15
18
  projectId: ctx.secrets.get(PROJECT),
@@ -88,6 +88,9 @@ export const sessionTools = {
88
88
  input: endSession.input,
89
89
  output: endSession.output,
90
90
  ...apiAccess,
91
+ side_effect: true,
92
+ undo: "none",
93
+ undo_reason: "an ended session is not started again; create_session starts a new one",
91
94
  execute: async ({ session_id }, ctx) => {
92
95
  const ended = await browserbase(ctx, "POST", sessionPath(session_id), session, {
93
96
  projectId: ctx.secrets.get(PROJECT),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "contract": 1,
3
3
  "name": "browserbase",
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "config_schema": "schemas/config.json",
6
6
  "secrets": [
7
7
  {
@@ -46,7 +46,9 @@
46
46
  "output_schema": "schemas/end_session.out.json",
47
47
  "secrets": ["BROWSERBASE_API_KEY", "BROWSERBASE_PROJECT_ID"],
48
48
  "capabilities": ["network:api.browserbase.com"],
49
- "side_effect": false,
49
+ "side_effect": true,
50
+ "undo": "none",
51
+ "undo_reason": "an ended session is not started again; create_session starts a new one",
50
52
  "approval": "never",
51
53
  "disabled": false
52
54
  },
@@ -101,7 +103,9 @@
101
103
  "output_schema": "schemas/create_context.out.json",
102
104
  "secrets": ["BROWSERBASE_API_KEY", "BROWSERBASE_PROJECT_ID"],
103
105
  "capabilities": ["network:api.browserbase.com"],
104
- "side_effect": false,
106
+ "side_effect": true,
107
+ "undo": "none",
108
+ "undo_reason": "a context stays until delete_context removes it",
105
109
  "approval": "never",
106
110
  "disabled": false
107
111
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kana-ai/edgar-ext-browserbase",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "EDGAR extension for Browserbase: start, watch and end cloud browser sessions, and read their evidence.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -21,11 +21,11 @@
21
21
  ".": "./dist/src/index.js"
22
22
  },
23
23
  "dependencies": {
24
- "@kana-ai/edgar-sdk": "0.1.1",
24
+ "@kana-ai/edgar-sdk": "0.1.3",
25
25
  "zod": "4.6.7"
26
26
  },
27
27
  "devDependencies": {
28
- "@kana-ai/edgar-contracts": "0.1.1",
28
+ "@kana-ai/edgar-contracts": "0.1.3",
29
29
  "@types/node": "24.19.2",
30
30
  "ajv": "8.20.0",
31
31
  "oxfmt": "0.76.0",
@@ -4,19 +4,23 @@
4
4
  "properties": {
5
5
  "timeout_seconds": {
6
6
  "default": 300,
7
+ "description": "How long one browser session may stay open, in seconds, when the tool input sets none. Default 300.",
7
8
  "type": "integer",
8
9
  "minimum": 60,
9
10
  "maximum": 21600
10
11
  },
11
12
  "keep_alive": {
12
13
  "default": false,
14
+ "description": "Keep a session open after the last client disconnects, when the tool input does not say. Default false.",
13
15
  "type": "boolean"
14
16
  },
15
17
  "record": {
16
18
  "default": true,
19
+ "description": "Record each session so session_replay can play it back, when the tool input does not say. Default true.",
17
20
  "type": "boolean"
18
21
  },
19
22
  "region": {
23
+ "description": "The region the sessions run in. Browserbase picks one when it is not set.",
20
24
  "type": "string",
21
25
  "enum": ["us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1"]
22
26
  }