@opencode/browse 0.0.6-dev.19 → 0.0.6-dev.21

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.
@@ -1,6 +1,10 @@
1
+ import {
2
+ opencodeBrowserVersion2
3
+ } from "./main-ek76h9k1.mjs";
1
4
  import {
2
5
  autoUpdateStatus
3
- } from "./main-yd50d95g.mjs";
6
+ } from "./main-0m569gdn.mjs";
7
+ import"./main-3gthmkzw.mjs";
4
8
  import {
5
9
  getObject2,
6
10
  Service,
@@ -8,15 +12,12 @@ import {
8
12
  relayBuildProblem,
9
13
  ensureRelay,
10
14
  ensureExtensionConnected
11
- } from "./main-8a245rm1.mjs";
12
- import"./main-75rdz6bc.mjs";
13
- import {
14
- opencodeBrowserVersion2
15
- } from "./main-ts9jjqs8.mjs";
15
+ } from "./main-qm2keaeb.mjs";
16
+ import"./main-7qs0mwvc.mjs";
16
17
  import {
17
18
  updateJson2,
18
19
  createUpdateWatcher2
19
- } from "./main-2wrztakb.mjs";
20
+ } from "./main-33kf3cfr.mjs";
20
21
  import {
21
22
  settingKeys,
22
23
  settingSpecs,
@@ -42,19 +43,17 @@ import {
42
43
  toolResult,
43
44
  readClient,
44
45
  listSecrets
45
- } from "./main-90enpn5q.mjs";
46
+ } from "./main-yq58hnwq.mjs";
46
47
 
47
48
  // src/mcp.ts
48
49
  import { NodeStdio } from "@effect/platform-node";
49
50
  import { Config, Context, Effect as Effect7, Layer, Option, Schedule } from "effect";
50
51
  import { McpProtocol, McpSchema, McpServer } from "effect/ai";
51
- import path5 from "node:path";
52
+ import path4 from "node:path";
52
53
  import { fileURLToPath } from "node:url";
53
54
 
54
55
  // src/mcp/browser.ts
55
56
  import { Effect } from "effect";
56
- import fs from "node:fs/promises";
57
- import path from "node:path";
58
57
 
59
58
  // src/mcp/registry.ts
60
59
  var groups = [];
@@ -128,7 +127,7 @@ registerMcpTools({
128
127
  build: (ctx) => [
129
128
  {
130
129
  name: "tabs_cleanup",
131
- description: "Close tabs agents opened that nobody has used for a while (no agent command and not visited by the user). Tabs the user shared or pinned, the active tab, tabs playing audio, recording, or waiting for a handoff stay open. Call it when you finish a task to leave the user's browser tidy; Browse also does this automatically after the user's idle setting (10 minutes unless they changed it).",
130
+ description: "Close tabs agents opened that nobody has used for a while (no agent command and not visited by the user). Tabs the user shared or pinned, the active tab, tabs playing audio, recording, or waiting for a handoff stay open. Call it when you finish a task to leave the user's browser tidy; browse also does this automatically after the user's idle setting (10 minutes unless they changed it).",
132
131
  inputSchema: objectSchema({
133
132
  idleMinutes: {
134
133
  type: "integer",
@@ -146,7 +145,7 @@ registerMcpTools({
146
145
  },
147
146
  {
148
147
  name: "settings",
149
- description: `Read or change the user's Browse settings, the same ones as the extension's options page: where agent tabs open (window), how they're grouped (grouping), when untouched agent tabs close (idleMinutes), the agent cursor (cursor), human-like input (humanInput) and handoff notifications (handoffNotifications). Use it only when the user asks to change how browse behaves, never on your own initiative. Without \`set\` it returns each setting's stored value, the value in effect, and the relay environment variable that overrides it, if any. With \`set\` it validates every value strictly, applies the change at once (the options page updates live) and returns what changed: tell the user what you changed. A setting an environment variable fixes is not changed, and the result says so. Security switches (${securityVariables.join(", ")}) are environment-only and can never be read or changed here.`,
148
+ description: `Read or change the user's browse settings, the same ones as the extension's options page: where agent tabs open (window), how they're grouped (grouping), when untouched agent tabs close (idleMinutes), the agent cursor (cursor), human-like input (humanInput) and handoff notifications (handoffNotifications). Use it only when the user asks to change how browse behaves, never on your own initiative. Without \`set\` it returns each setting's stored value, the value in effect, and the relay environment variable that overrides it, if any. With \`set\` it validates every value strictly, applies the change at once (the options page updates live) and returns what changed: tell the user what you changed. A setting an environment variable fixes is not changed, and the result says so. Security switches (${securityVariables.join(", ")}) are environment-only and can never be read or changed here.`,
150
149
  inputSchema: objectSchema({
151
150
  set: {
152
151
  type: "object",
@@ -174,13 +173,13 @@ registerMcpTools({
174
173
  {
175
174
  name: "skill",
176
175
  requiresRelayCompatibility: false,
177
- description: "Return the Browse agent skill instructions.",
176
+ description: "Return the browse agent skill instructions.",
178
177
  inputSchema: emptyInputSchema,
179
178
  readOnly: true,
180
179
  destructive: false,
181
180
  idempotent: true,
182
181
  handle: () => Effect.tryPromise({
183
- try: () => fs.readFile(path.join(ctx.packageRoot, "skills", "browse", "SKILL.md"), "utf8"),
182
+ try: () => import("./skill-text-v35020jn.mjs").then((module) => module.skillText),
184
183
  catch: (cause) => new Error("read opencode-browser skill", { cause })
185
184
  })
186
185
  }
@@ -195,7 +194,7 @@ registerMcpTools({
195
194
  {
196
195
  name: "execute",
197
196
  listsBrowsers: true,
198
- description: `Execute Playwright JavaScript against the Browse session. Code runs in a sandbox on the relay without process, require, import(), fs, child_process, http/https or Node fetch; save and read files with the files helper inside the execute file roots, and cookie access is limited to the session's pages. The result includes console logs, warnings, a bounded execution-context diagnostic when relevant, and an aftermath summary (URL movement, navigations, error counts, handoffs, and a bot challenge or block page when one appears: hand interactive ones to the user with handoff(), never solve or retry-loop them).${ctx.browserNote}`,
197
+ description: `Execute Playwright JavaScript against the browse session. Code runs in a sandbox on the relay without process, require, import(), fs, child_process, http/https or Node fetch; save and read files with the files helper inside the execute file roots, and cookie access is limited to the session's pages. The result includes console logs, warnings, a bounded execution-context diagnostic when relevant, and an aftermath summary (URL movement, navigations, error counts, handoffs, and a bot challenge or block page when one appears: hand interactive ones to the user with handoff(), never solve or retry-loop them).${ctx.browserNote}`,
199
198
  inputSchema: objectSchema({
200
199
  code: {
201
200
  type: "string",
@@ -203,7 +202,7 @@ registerMcpTools({
203
202
  },
204
203
  session: {
205
204
  type: "string",
206
- description: "Optional existing Browse session id. Explicit ids must already exist; omit this field to use the MCP server's current session, which is created when needed."
205
+ description: "Optional existing browse session id. Explicit ids must already exist; omit this field to use the MCP server's current session, which is created when needed."
207
206
  },
208
207
  targetUrl: {
209
208
  type: "string",
@@ -249,13 +248,13 @@ registerMcpTools({
249
248
 
250
249
  // src/mcp/network.ts
251
250
  import { Effect as Effect3 } from "effect";
252
- import path2 from "node:path";
251
+ import path from "node:path";
253
252
  registerMcpTools({
254
253
  order: 300,
255
254
  build: (ctx) => [
256
255
  {
257
256
  name: "network_start",
258
- description: "Start session-scoped network capture. Browse records normalized Playwright exchanges; HAR is only the optional export format. Bodies are embedded by default with per-body and total memory limits.",
257
+ description: "Start session-scoped network capture. browse records normalized Playwright exchanges; HAR is only the optional export format. Bodies are embedded by default with per-body and total memory limits.",
259
258
  inputSchema: objectSchema({
260
259
  session: {
261
260
  type: "string",
@@ -367,7 +366,7 @@ registerMcpTools({
367
366
  }
368
367
  return yield* ctx.relay.networkStop({
369
368
  sessionId,
370
- ...outputPath ? { outputPath: path2.resolve(outputPath) } : {},
369
+ ...outputPath ? { outputPath: path.resolve(outputPath) } : {},
371
370
  ...secrets ? { secrets } : {}
372
371
  });
373
372
  })
@@ -386,7 +385,7 @@ registerMcpTools({
386
385
 
387
386
  // src/mcp/recording.ts
388
387
  import { Effect as Effect4 } from "effect";
389
- import path3 from "node:path";
388
+ import path2 from "node:path";
390
389
  registerMcpTools({
391
390
  order: 400,
392
391
  build: (ctx) => [
@@ -409,7 +408,7 @@ registerMcpTools({
409
408
  maxDurationMs: { type: "integer", minimum: 1, description: "Maximum recording duration in milliseconds." },
410
409
  cursor: {
411
410
  type: "boolean",
412
- description: "Draw the ghost cursor in the recording, for demo videos. Off by default: recordings show only the page, with nothing from Browse in the frame."
411
+ description: "Draw the ghost cursor in the recording, for demo videos. Off by default: recordings show only the page, with nothing from browse in the frame."
413
412
  }
414
413
  }, ["outputPath"]),
415
414
  readOnly: false,
@@ -429,7 +428,7 @@ registerMcpTools({
429
428
  const cursor = optionalBooleanField(object, "cursor");
430
429
  return ctx.relay.recordingStart({
431
430
  sessionId: ctx.resolveSessionId(object),
432
- outputPath: path3.resolve(requiredStringField(object, "outputPath")),
431
+ outputPath: path2.resolve(requiredStringField(object, "outputPath")),
433
432
  ...mode ? { mode } : {},
434
433
  ...audio === undefined ? {} : { audio },
435
434
  ...frameRate === undefined ? {} : { frameRate },
@@ -539,7 +538,7 @@ registerMcpTools({
539
538
  const durationMs = optionalPositiveIntegerField(object, "durationMs");
540
539
  return ctx.relay.flightRecorderSaveLast({
541
540
  sessionId: ctx.resolveSessionId(object),
542
- outputPath: path3.resolve(requiredStringField(object, "outputPath")),
541
+ outputPath: path2.resolve(requiredStringField(object, "outputPath")),
543
542
  ...durationMs === undefined ? {} : { durationMs }
544
543
  });
545
544
  }
@@ -558,14 +557,14 @@ registerMcpTools({
558
557
 
559
558
  // src/mcp/secrets.ts
560
559
  import { Effect as Effect5 } from "effect";
561
- import path4 from "node:path";
560
+ import path3 from "node:path";
562
561
  registerMcpTools({
563
562
  order: 600,
564
563
  build: (ctx) => [
565
564
  {
566
565
  name: "secrets_list",
567
566
  requiresRelayCompatibility: false,
568
- description: 'List what agents may type without seeing: site secrets the user stored (names, kinds and allowed origins; type them with secrets.type(target, name) in execute; only the user adds them with `opencode-browser secrets add`), and Deadbolt logins the user granted to Browse for this session\'s allowed sites (title, username, which values and passkeys, never values; sign in with the signin tool or secrets.signIn(), or type one value with secrets.type(target, "deadbolt:<site>[/<username>]", { field })). Passkeys are listed by account (username, displayName). Only the user grants Deadbolt logins, in Deadbolt (`deadbolt agents allow <site>`, or `deadbolt agents allow --all`).',
567
+ description: 'List what agents may type without seeing: site secrets the user stored (names, kinds and allowed origins; type them with secrets.type(target, name) in execute; only the user adds them with `opencode-browser secrets add`), and Deadbolt logins the user granted to browse for this session\'s allowed sites (title, username, which values and passkeys, never values; sign in with the signin tool or secrets.signIn(), or type one value with secrets.type(target, "deadbolt:<site>[/<username>]", { field })). Passkeys are listed by account (username, displayName). Only the user grants Deadbolt logins, in Deadbolt (`deadbolt agents allow <site>`, or `deadbolt agents allow --all`).',
569
568
  inputSchema: sessionOnlyInputSchema,
570
569
  readOnly: true,
571
570
  destructive: false,
@@ -579,7 +578,7 @@ registerMcpTools({
579
578
  connected: false,
580
579
  logins: [],
581
580
  passkeys: [],
582
- note: "Browse isn't connected to Deadbolt. The user can connect it with `opencode-browser deadbolt connect` and grant logins with `deadbolt agents allow <site>`."
581
+ note: "browse isn't connected to Deadbolt. The user can connect it with `opencode-browser deadbolt connect` and grant logins with `deadbolt agents allow <site>`."
583
582
  }
584
583
  };
585
584
  }
@@ -595,7 +594,7 @@ registerMcpTools({
595
594
  },
596
595
  {
597
596
  name: "signin",
598
- description: 'Sign in to a site in the session\'s page with a Deadbolt login the user granted to Browse, without seeing any value. The relay does the whole sign-in in one call: username, submit, password, an authenticator (TOTP) code when asked (split boxes too), "Use password instead" toggles, and Sign in with Google when a Google login is granted. A username also picks the passkey account when the site signs in with a passkey. Returns only {status: signed_in | needs_user | needs_choice | not_granted | failed, step, reason}; needs_choice comes with choices [{username, displayName}] when several passkeys could sign in: call again with one username. needs_user means a captcha, a code sent by SMS or email, a push approval or a new-device check: hand it to the user with handoff() in execute. not_granted: tell the user what to allow (`deadbolt agents allow <site>`). Navigate to the sign-in page first, or pass site.',
597
+ description: 'Sign in to a site in the session\'s page with a Deadbolt login the user granted to browse, without seeing any value. The relay does the whole sign-in in one call: username, submit, password, an authenticator (TOTP) code when asked (split boxes too), "Use password instead" toggles, and Sign in with Google when a Google login is granted. A username also picks the passkey account when the site signs in with a passkey. Returns only {status: signed_in | needs_user | needs_choice | not_granted | failed, step, reason}; needs_choice comes with choices [{username, displayName}] when several passkeys could sign in: call again with one username. needs_user means a captcha, a code sent by SMS or email, a push approval or a new-device check: hand it to the user with handoff() in execute. not_granted: tell the user what to allow (`deadbolt agents allow <site>`). Navigate to the sign-in page first, or pass site.',
599
598
  inputSchema: objectSchema({
600
599
  site: {
601
600
  type: "string",
@@ -697,7 +696,7 @@ registerMcpTools({
697
696
  name: requiredStringField(object, "name"),
698
697
  command: requiredStringField(object, "command"),
699
698
  ...args ? { args } : {},
700
- cwd: path4.resolve(cwd ?? process.cwd()),
699
+ cwd: path3.resolve(cwd ?? process.cwd()),
701
700
  ...timeoutMs === undefined ? {} : { timeoutMs }
702
701
  });
703
702
  }
@@ -713,7 +712,7 @@ registerMcpTools({
713
712
  {
714
713
  name: "session_new",
715
714
  listsBrowsers: true,
716
- description: `Create a Browse session and make it current for this MCP server.${ctx.browserNote}`,
715
+ description: `Create a browse session and make it current for this MCP server.${ctx.browserNote}`,
717
716
  inputSchema: objectSchema({
718
717
  browser: ctx.browserProperty,
719
718
  id: { type: "string", description: "Optional lowercase session id." },
@@ -770,7 +769,7 @@ registerMcpTools({
770
769
  {
771
770
  name: "session_list",
772
771
  requiresRelayCompatibility: false,
773
- description: "List Browse sessions.",
772
+ description: "List browse sessions.",
774
773
  inputSchema: emptyInputSchema,
775
774
  readOnly: true,
776
775
  destructive: false,
@@ -780,7 +779,7 @@ registerMcpTools({
780
779
  {
781
780
  name: "session_current",
782
781
  requiresRelayCompatibility: false,
783
- description: "Return this MCP server's current Browse session id.",
782
+ description: "Return this MCP server's current browse session id.",
784
783
  inputSchema: emptyInputSchema,
785
784
  readOnly: true,
786
785
  destructive: false,
@@ -789,9 +788,9 @@ registerMcpTools({
789
788
  },
790
789
  {
791
790
  name: "session_use",
792
- description: "Set this MCP server's current Browse session id.",
791
+ description: "Set this MCP server's current browse session id.",
793
792
  inputSchema: objectSchema({
794
- id: { type: "string", description: "Existing Browse session id." }
793
+ id: { type: "string", description: "Existing browse session id." }
795
794
  }, ["id"]),
796
795
  readOnly: false,
797
796
  destructive: false,
@@ -805,7 +804,7 @@ registerMcpTools({
805
804
  },
806
805
  {
807
806
  name: "session_reset",
808
- description: "Reset a Browse session's state and page.",
807
+ description: "Reset a browse session's state and page.",
809
808
  inputSchema: objectSchema({
810
809
  id: sessionSchemaProperty,
811
810
  session: sessionAliasSchemaProperty
@@ -822,7 +821,7 @@ registerMcpTools({
822
821
  },
823
822
  {
824
823
  name: "session_delete",
825
- description: "Delete a Browse session.",
824
+ description: "Delete a browse session.",
826
825
  inputSchema: objectSchema({
827
826
  id: sessionSchemaProperty,
828
827
  session: sessionAliasSchemaProperty
@@ -842,11 +841,11 @@ registerMcpTools({
842
841
  },
843
842
  {
844
843
  name: "session_adopt",
845
- description: "Make an attached tab the Browse session's default page for subsequent bare execute calls. Omit targetUrl and targetIndex when only one user-attached tab is available.",
844
+ description: "Make an attached tab the browse session's default page for subsequent bare execute calls. Omit targetUrl and targetIndex when only one user-attached tab is available.",
846
845
  inputSchema: objectSchema({
847
846
  session: {
848
847
  type: "string",
849
- description: "Optional existing Browse session id. Explicit ids must already exist; omit this field to use the MCP server's current session, which is created when needed."
848
+ description: "Optional existing browse session id. Explicit ids must already exist; omit this field to use the MCP server's current session, which is created when needed."
850
849
  },
851
850
  targetUrl: {
852
851
  type: "string",
@@ -885,7 +884,7 @@ registerMcpTools({
885
884
  });
886
885
 
887
886
  // src/mcp.ts
888
- var packageRoot = path5.dirname(path5.dirname(fileURLToPath(import.meta.url)));
887
+ var packageRoot = path4.dirname(path4.dirname(fileURLToPath(import.meta.url)));
889
888
  function shimSession() {
890
889
  const value = process.env.OPENCODE_BROWSER_MCP_SESSION;
891
890
  return value && /^mcp-[0-9a-f]{8}$/.test(value) ? value : undefined;