@opencode/browse 0.0.17-dev.185 → 0.0.17-dev.188

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 (39) hide show
  1. package/dist/{Runtime-xss8qan1.mjs → Runtime-hmy7zww1.mjs} +1 -1
  2. package/dist/{cli-fk82qmwb.mjs → cli-5ezftnv2.mjs} +39 -222
  3. package/dist/cli.mjs +18 -18
  4. package/dist/{helpers-v2zmfak2.mjs → helpers-k5ybc61c.mjs} +1 -1
  5. package/dist/{index-gjq7chrk.mjs → index-37ssbv86.mjs} +2 -2
  6. package/dist/{legacy-runtime-rvfsgmzn.mjs → legacy-runtime-j0sw664c.mjs} +10 -9
  7. package/dist/{main-m45zegrn.mjs → main-0h387a1q.mjs} +1 -6
  8. package/dist/{main-jeta10c6.mjs → main-3514h33n.mjs} +11 -11
  9. package/dist/{main-qwf4vk41.mjs → main-4qq4n32k.mjs} +2 -2
  10. package/dist/{main-1b344j42.mjs → main-66fy08h5.mjs} +8 -25
  11. package/dist/{main-x7takqns.mjs → main-7h3v45ag.mjs} +26 -17
  12. package/dist/{main-t2jyedkv.mjs → main-7v4scg8t.mjs} +8 -6
  13. package/dist/{main-6hvv25x8.mjs → main-8xd753k5.mjs} +1 -1
  14. package/dist/{main-akpa411k.mjs → main-9q9919e3.mjs} +118 -2
  15. package/dist/{main-2wrvr3gc.mjs → main-ba028a85.mjs} +34 -27
  16. package/dist/{main-sbqypb33.mjs → main-d8km89cz.mjs} +2 -2
  17. package/dist/main-dab23et4.mjs +17 -0
  18. package/dist/{main-9frwnsnf.mjs → main-j4kq90pw.mjs} +1 -1
  19. package/dist/{main-3ewrhbqw.mjs → main-kzcrfvmh.mjs} +4 -4
  20. package/dist/{main-z32979g4.mjs → main-m9n50a86.mjs} +41 -162
  21. package/dist/{main-ndmgt6k5.mjs → main-mvjg1jye.mjs} +5 -46
  22. package/dist/{main-xjskgtdr.mjs → main-pqxrvknr.mjs} +2 -2
  23. package/dist/main-qrqem3fy.mjs +4 -0
  24. package/dist/{main-xct4r41x.mjs → main-svhdexdh.mjs} +4 -4
  25. package/dist/main-tryp3jph.mjs +141 -0
  26. package/dist/{mcp-2xkjfnqz.mjs → mcp-jh4atts2.mjs} +37 -140
  27. package/dist/{migrate-fygxtp2g.mjs → migrate-r433scvg.mjs} +14 -7
  28. package/dist/{relay-mbjgxbtr.mjs → relay-1epy67be.mjs} +648 -372
  29. package/dist/remove-stored-secrets-wy3pakjj.mjs +6 -0
  30. package/dist/{runtime-update-ngg3m888.mjs → runtime-update-ww2pejn2.mjs} +13 -11
  31. package/dist/{setup-t0pbhmzh.mjs → setup-n1hpbkz2.mjs} +27 -49
  32. package/dist/{skill-text-1rg5b5np.mjs → skill-text-0ndr12dz.mjs} +7 -31
  33. package/dist/{update-heze6vjn.mjs → update-z7qvagkc.mjs} +3 -3
  34. package/dist/{version-x1kkvpqn.mjs → version-2123c138.mjs} +1 -1
  35. package/package.json +1 -1
  36. package/skills/browse/SKILL.md +7 -31
  37. package/dist/main-6my7bmf1.mjs +0 -1324
  38. package/dist/main-ew8jna3e.mjs +0 -4
  39. package/dist/supervisor-wrrnbfhw.mjs +0 -269
@@ -5,7 +5,7 @@ import {
5
5
  getErrorExitCode2,
6
6
  errorReported2,
7
7
  getErrorReported2
8
- } from "./main-9frwnsnf.mjs";
8
+ } from "./main-j4kq90pw.mjs";
9
9
  export {
10
10
  defaultTeardown2 as defaultTeardown,
11
11
  errorExitCode2 as errorExitCode,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  errorExitCode2,
4
4
  errorReported2
5
- } from "./main-9frwnsnf.mjs";
5
+ } from "./main-j4kq90pw.mjs";
6
6
  import {
7
7
  make4,
8
8
  value2,
@@ -14,7 +14,7 @@ import {
14
14
  Terminal,
15
15
  runMain,
16
16
  layer2
17
- } from "./main-jeta10c6.mjs";
17
+ } from "./main-3514h33n.mjs";
18
18
  import {
19
19
  ExitCode,
20
20
  failure,
@@ -25,26 +25,16 @@ import"./main-pmfd055v.mjs";
25
25
  import {
26
26
  opencodeBrowserVersion2,
27
27
  opencodeBrowserBuildId2
28
- } from "./main-ew8jna3e.mjs";
28
+ } from "./main-qrqem3fy.mjs";
29
29
  import {
30
- configRoot2,
31
- dataRoot,
32
- stateRoot,
33
- cacheRoot,
34
- fromCheckout,
35
- compiledBinary,
36
- binaryPackage,
37
- cliCommand,
38
- devExtension,
39
- installCommand,
40
30
  extensionProtocolVersion,
41
31
  extensionProtocolAdvice,
42
32
  autoUpdateStatus
43
- } from "./main-z32979g4.mjs";
33
+ } from "./main-m9n50a86.mjs";
44
34
  import {
45
35
  defaultPort2,
46
36
  isValidSessionId2
47
- } from "./main-ndmgt6k5.mjs";
37
+ } from "./main-mvjg1jye.mjs";
48
38
  import {
49
39
  option,
50
40
  String2,
@@ -63,31 +53,38 @@ import {
63
53
  ensureExtensionConnected,
64
54
  stoppedRelayStatus,
65
55
  statusCollections
66
- } from "./main-2wrvr3gc.mjs";
56
+ } from "./main-ba028a85.mjs";
67
57
  import {
68
58
  updateJson2,
69
59
  formatUpdateNotice2,
70
60
  updateNotice2
71
- } from "./main-t2jyedkv.mjs";
61
+ } from "./main-7v4scg8t.mjs";
72
62
  import {
73
63
  settingKeys,
74
64
  formatSettings,
75
65
  ensureSessionExists
76
- } from "./main-1b344j42.mjs";
77
- import {
78
- addSecret,
79
- listSecrets,
80
- removeSecret
81
- } from "./main-6my7bmf1.mjs";
66
+ } from "./main-66fy08h5.mjs";
82
67
  import {
83
68
  defaultJournalBaseDir,
84
69
  readJournalEntries,
85
70
  formatJournalEntry
86
- } from "./main-3ewrhbqw.mjs";
87
- import"./main-xjskgtdr.mjs";
71
+ } from "./main-kzcrfvmh.mjs";
72
+ import"./main-pqxrvknr.mjs";
88
73
  import {
89
74
  endpointForPort
90
- } from "./main-qwf4vk41.mjs";
75
+ } from "./main-4qq4n32k.mjs";
76
+ import {
77
+ configRoot2,
78
+ dataRoot,
79
+ stateRoot,
80
+ cacheRoot,
81
+ fromCheckout,
82
+ compiledBinary,
83
+ binaryPackage,
84
+ cliCommand,
85
+ devExtension,
86
+ installCommand
87
+ } from "./main-tryp3jph.mjs";
91
88
  import {
92
89
  taggedEnum,
93
90
  is2,
@@ -108,7 +105,7 @@ import {
108
105
  Defect,
109
106
  TaggedError2,
110
107
  toCodecStringTree
111
- } from "./main-6hvv25x8.mjs";
108
+ } from "./main-8xd753k5.mjs";
112
109
  import {
113
110
  pipeArguments,
114
111
  dual,
@@ -189,7 +186,7 @@ import {
189
186
  interrupt3,
190
187
  fnUntraced,
191
188
  fn
192
- } from "./main-m45zegrn.mjs";
189
+ } from "./main-0h387a1q.mjs";
193
190
 
194
191
  // node_modules/effect/dist/Number.js
195
192
  var Number2 = globalThis.Number;
@@ -4998,8 +4995,8 @@ var runWith = (command, config) => {
4998
4995
  }, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed(error) : fail2(error), (error) => andThen2(showHelp(command, error, config.renderErrors !== false), fail6(error))), catchFilter((error) => config.renderErrors !== false && isCliError(error) && error._tag === "UserError" ? succeed(error) : fail2(error), (error) => andThen2(showUserError(error), fail6(error))), catchFilter((e) => isQuitError(e) ? succeed(e) : fail2(e), (_) => interrupt3));
4999
4996
  };
5000
4997
  // src/cli.ts
5001
- import path5 from "node:path";
5002
- import process4 from "node:process";
4998
+ import path4 from "node:path";
4999
+ import process3 from "node:process";
5003
5000
  import { fileURLToPath, pathToFileURL } from "node:url";
5004
5001
 
5005
5002
  // src/session-manager/store.ts
@@ -5522,8 +5519,6 @@ var sessionIdConfig = option(String2("OPENCODE_BROWSER_SESSION"));
5522
5519
  var agentSessionIdConfig = option(String2("OPENCODE_SESSION_ID"));
5523
5520
  var targetUrlConfig = option(String2("OPENCODE_BROWSER_TARGET_URL"));
5524
5521
  var targetIndexConfig = option(Int("OPENCODE_BROWSER_TARGET_INDEX"));
5525
- var encodedCliOperandsMarker = "bc-cli-operands:v1";
5526
- var encodedCliOperandPrefix = "bc-cli-operand:";
5527
5522
  var jsonFlag = Boolean4("json").pipe(withDefault2(false), withDescription3("Print machine-readable JSON"));
5528
5523
  var sessionFlag = (description) => {
5529
5524
  const flag = String8("session").pipe(optional4, withAlias2("s"));
@@ -5585,26 +5580,6 @@ function formatRecordingQuality(quality) {
5585
5580
  ].join(`
5586
5581
  `);
5587
5582
  }
5588
- function normalizeCliArguments(args) {
5589
- const delimiter = args.indexOf("--");
5590
- const secretsRun = args.findIndex((argument, index) => argument === "secrets" && args[index + 1] === "run");
5591
- if (delimiter === -1 || secretsRun === -1 || secretsRun > delimiter)
5592
- return args;
5593
- return [
5594
- ...args.slice(0, delimiter),
5595
- encodedCliOperandsMarker,
5596
- ...args.slice(delimiter + 1).map((operand) => `${encodedCliOperandPrefix}${encodeURIComponent(operand)}`)
5597
- ];
5598
- }
5599
- function decodeCliOperands(operands) {
5600
- if (operands[0] !== encodedCliOperandsMarker)
5601
- return operands;
5602
- return operands.slice(1).map((operand) => {
5603
- if (!operand.startsWith(encodedCliOperandPrefix))
5604
- throw new Error("Invalid encoded secrets run operand");
5605
- return decodeURIComponent(operand.slice(encodedCliOperandPrefix.length));
5606
- });
5607
- }
5608
5583
  function formatSessionContinuation(sessionId) {
5609
5584
  return `Session: ${sessionId}. Continue with --session ${sessionId}.`;
5610
5585
  }
@@ -5858,7 +5833,7 @@ var status = make("status", {
5858
5833
  }
5859
5834
  })).pipe(withDescription4("Show relay, extension, and target status"));
5860
5835
  var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
5861
- const { runMcpServer } = yield* promise(() => import("./mcp-2xkjfnqz.mjs"));
5836
+ const { runMcpServer } = yield* promise(() => import("./mcp-jh4atts2.mjs"));
5862
5837
  yield* runMcpServer;
5863
5838
  })).pipe(withDescription4("Run the browse MCP server over stdio"));
5864
5839
  registerCliCommand(400, () => tabs);
@@ -5879,7 +5854,7 @@ registerCliCommand(810, ({ packageRoot }) => make("doctor", {
5879
5854
  }
5880
5855
  })).pipe(withDescription4("Diagnose the local browse install and runtime")));
5881
5856
  registerCliCommand(820, () => make("skill", {}, fn("Cli.skill")(function* () {
5882
- const { skillText } = yield* promise(() => import("./skill-text-1rg5b5np.mjs"));
5857
+ const { skillText } = yield* promise(() => import("./skill-text-0ndr12dz.mjs"));
5883
5858
  yield* log(skillText.trimEnd());
5884
5859
  })).pipe(withDescription4("Print the browse agent skill text")));
5885
5860
  registerCliCommand(900, () => mcp);
@@ -6058,8 +6033,7 @@ function formatNetworkStatus(status) {
6058
6033
  }
6059
6034
  function formatNetworkResult(result) {
6060
6035
  const output = result.outputPath ? ` output=${result.outputPath}` : "";
6061
- const profile = result.authProfile ? ` secrets=${result.authProfile.name}(${result.authProfile.slotCount})` : "";
6062
- return `Network capture stopped: entries=${result.entryCount} responses=${result.responseCount} failures=${result.failureCount} bodyBytes=${result.capturedBodyBytes} truncated=${result.truncatedBodyCount} dropped=${result.droppedEntryCount}${output}${profile}`;
6036
+ return `Network capture stopped: entries=${result.entryCount} responses=${result.responseCount} failures=${result.failureCount} bodyBytes=${result.capturedBodyBytes} truncated=${result.truncatedBodyCount} dropped=${result.droppedEntryCount}${output}`;
6063
6037
  }
6064
6038
  var networkStart = make("start", {
6065
6039
  session: sessionFlag("Capture the default page for this browse session"),
@@ -6111,24 +6085,18 @@ var networkStatus = make("status", {
6111
6085
  var networkStop = make("stop", {
6112
6086
  session: sessionFlag(),
6113
6087
  output: String8("output").pipe(optional4, withAlias2("o"), withDescription3("Write a credential-redacted HAR artifact to this path")),
6114
- secrets: String8("secrets").pipe(optional4, withDescription3("Store captured credentials under this reusable profile name")),
6115
6088
  json: jsonFlag
6116
- }, fn("Cli.networkStop")(function* ({ session, output, secrets, json }) {
6089
+ }, fn("Cli.networkStop")(function* ({ session, output, json }) {
6117
6090
  const relay = yield* Service;
6118
6091
  const outputValue = getOrUndefined(output);
6119
- const secretsValue = getOrUndefined(secrets);
6120
- if (!outputValue && !secretsValue) {
6121
- return yield* fail6(new Error("network stop requires --output, --secrets, or both"));
6122
- }
6123
6092
  const sessionId = yield* networkSession(session);
6124
6093
  yield* ensureCliRelay();
6125
6094
  const result = yield* relay.networkStop({
6126
6095
  sessionId,
6127
- ...outputValue ? { outputPath: path2.resolve(outputValue) } : {},
6128
- ...secretsValue ? { secrets: secretsValue } : {}
6096
+ ...outputValue ? { outputPath: path2.resolve(outputValue) } : {}
6129
6097
  });
6130
6098
  yield* printOr(json, result, formatNetworkResult(result));
6131
- })).pipe(withDescription4("Stop capture and write a redacted artifact or reusable secret profile"));
6099
+ })).pipe(withDescription4("Stop capture and optionally write a credential-redacted artifact"));
6132
6100
  var networkCancel = make("cancel", { session: sessionFlag() }, fn("Cli.networkCancel")(function* ({ session }) {
6133
6101
  const relay = yield* Service;
6134
6102
  const sessionId = yield* networkSession(session);
@@ -6306,12 +6274,12 @@ registerCliCommand(710, () => flightRecorder);
6306
6274
 
6307
6275
  // src/cli/relay.ts
6308
6276
  var serve = make("serve", {}, fn("Cli.serve")(function* () {
6309
- const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-mbjgxbtr.mjs"), import("./helpers-v2zmfak2.mjs")]));
6277
+ const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-1epy67be.mjs"), import("./helpers-k5ybc61c.mjs")]));
6310
6278
  const port = process.env.OPENCODE_BROWSER_PORT === undefined ? undefined : yield* portConfig;
6311
6279
  const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
6312
6280
  yield* scoped(gen(function* () {
6313
6281
  const relay = yield* startRelay({ ...port === undefined ? {} : { port }, additionalExtensionOrigins });
6314
- yield* promise(() => import("./legacy-runtime-rvfsgmzn.mjs").then((module) => module.commitLegacyTakeover()));
6282
+ yield* promise(() => import("./legacy-runtime-j0sw664c.mjs").then((module) => module.commitLegacyTakeover()));
6315
6283
  yield* log(`browse relay listening at ${relay.url}`);
6316
6284
  yield* log(`browse connects automatically while the browser runs. Run \`${cliCommand("status")}\` to check.`);
6317
6285
  yield* never;
@@ -6329,157 +6297,6 @@ var relay = make("relay").pipe(withDescription4("Manage the local relay lifecycl
6329
6297
  registerCliCommand(100, () => serve);
6330
6298
  registerCliCommand(110, () => relay);
6331
6299
 
6332
- // src/cli/secrets.ts
6333
- import path4 from "node:path";
6334
- import process3 from "node:process";
6335
- var secretsStatus = make("status", {
6336
- name: String7("name"),
6337
- json: jsonFlag
6338
- }, fn("Cli.secretsStatus")(function* ({ name, json }) {
6339
- const relay = yield* Service;
6340
- yield* ensureCliRelay();
6341
- const result = yield* relay.authStatus({ name });
6342
- if (json) {
6343
- yield* emitJson(result);
6344
- return;
6345
- }
6346
- yield* log(`Secrets profile ${result.name}: slots=${result.slotCount} updatedAt=${result.updatedAt}`);
6347
- yield* forEach(result.slots, (slot) => log(`- ${slot.ref} sources=${slot.sources.join(",")} expired=${slot.expired}${slot.expiresAt ? ` expiresAt=${slot.expiresAt}` : ""}`));
6348
- })).pipe(withDescription4("Show secret profile metadata without revealing values"));
6349
- var secretsRefresh = make("refresh", {
6350
- name: String7("name"),
6351
- session: sessionFlag(),
6352
- urlFilter: String8("url").pipe(optional4, withDescription3("Observe credentials only on matching request URLs")),
6353
- timeoutMs: Int6("timeout-ms").pipe(optional4, withDescription3("Page reload timeout, defaults to 30000")),
6354
- json: jsonFlag
6355
- }, fn("Cli.secretsRefresh")(function* ({ name, session, urlFilter, timeoutMs, json }) {
6356
- const relay = yield* Service;
6357
- yield* ensureCliRelayAndExtension();
6358
- const sessionId = yield* networkSession(session);
6359
- const result = yield* relay.authRefresh({
6360
- sessionId,
6361
- name,
6362
- ...isSome(urlFilter) ? { urlFilter: urlFilter.value } : {},
6363
- ...isSome(timeoutMs) ? { timeoutMs: timeoutMs.value } : {}
6364
- });
6365
- yield* printOr(json, result, `Secrets profile ${name} refreshed: observed=${result.observedSecretRefs.length} changed=${result.updatedSecretRefs.length}`);
6366
- })).pipe(withDescription4("Reload a session page and refresh a profile while preserving stable references"));
6367
- var secretsRun = make("run", {
6368
- name: String7("name"),
6369
- command: String7("command").pipe(variadic2({ min: 1 })),
6370
- cwd: String8("cwd").pipe(optional4, withDescription3("Child process working directory")),
6371
- timeoutMs: Int6("timeout-ms").pipe(optional4, withDescription3("Child timeout in milliseconds, defaults to 120000"))
6372
- }, fn("Cli.secretsRun")(function* ({ name, command, cwd, timeoutMs }) {
6373
- const relay = yield* Service;
6374
- yield* ensureCliRelay();
6375
- const [executable, ...args] = decodeCliOperands(command);
6376
- if (!executable)
6377
- return yield* fail6(new Error("secrets run requires a command after --"));
6378
- const result = yield* relay.authRun({
6379
- name,
6380
- command: executable,
6381
- args,
6382
- cwd: path4.resolve(getOrElse(cwd, () => process3.cwd())),
6383
- ...isSome(timeoutMs) ? { timeoutMs: timeoutMs.value } : {}
6384
- });
6385
- yield* sync2(() => {
6386
- if (result.stdout)
6387
- process3.stdout.write(result.stdout);
6388
- if (result.stderr)
6389
- process3.stderr.write(result.stderr);
6390
- if (result.stdoutTruncated || result.stderrTruncated)
6391
- process3.stderr.write(`
6392
- Browse truncated child output.
6393
- `);
6394
- if (result.exitCode !== 0)
6395
- process3.exitCode = result.exitCode;
6396
- });
6397
- })).pipe(withDescription4("Run a command with profile values injected as BC_SECRET_* environment variables"));
6398
- function readSecretValue(prompt) {
6399
- const input = process3.stdin;
6400
- if (!input.isTTY) {
6401
- return new Promise((resolve, reject) => {
6402
- const chunks = [];
6403
- input.on("data", (chunk) => chunks.push(chunk));
6404
- input.once("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
6405
- input.once("error", reject);
6406
- });
6407
- }
6408
- return new Promise((resolve, reject) => {
6409
- process3.stderr.write(prompt);
6410
- let value = "";
6411
- const finish = (result) => {
6412
- input.setRawMode(false);
6413
- input.pause();
6414
- input.off("data", onData);
6415
- process3.stderr.write(`
6416
- `);
6417
- if (result instanceof Error)
6418
- reject(result);
6419
- else
6420
- resolve(result);
6421
- };
6422
- const onData = (chunk) => {
6423
- for (const char of chunk.toString("utf8")) {
6424
- if (char === "\r" || char === `
6425
- `)
6426
- return finish(value);
6427
- if (char === "\x03")
6428
- return finish(new Error("Cancelled"));
6429
- if (char === "" || char === "\b")
6430
- value = value.slice(0, -1);
6431
- else
6432
- value += char;
6433
- }
6434
- };
6435
- input.setRawMode(true);
6436
- input.resume();
6437
- input.on("data", onData);
6438
- });
6439
- }
6440
- var secretsAdd = make("add", {
6441
- name: String7("name").pipe(withDescription2('Secret name agents use: secrets.type(locator, "name")')),
6442
- origin: String8("origin").pipe(atLeast2(1), withDescription3("Origin the secret may be typed on (repeatable): https://example.com, *.example.com (https), http://localhost:3000")),
6443
- totp: Boolean4("totp").pipe(withDefault2(false), withDescription3("The value is a TOTP seed (base32 or otpauth:// URI); typing it types the current code. Storing the seed beside the password makes 2FA one factor")),
6444
- json: jsonFlag
6445
- }, fn("Cli.secretsAdd")(function* ({ name, origin, totp, json }) {
6446
- const value = yield* tryPromise({
6447
- try: () => readSecretValue(totp ? `TOTP seed for ${name} (hidden): ` : `Value for ${name} (hidden): `),
6448
- catch: (cause) => cause instanceof Error ? cause : new Error("Could not read the secret value")
6449
- });
6450
- const result = yield* addSecret({
6451
- name,
6452
- value,
6453
- allowedOrigins: origin,
6454
- kind: totp ? "totp" : "password"
6455
- });
6456
- if (json) {
6457
- yield* emitJson(result);
6458
- return;
6459
- }
6460
- yield* log(`Saved ${result.kind} secret ${result.name}; it can be typed on ${result.allowedOrigins.join(", ")}`);
6461
- if (totp)
6462
- yield* error("Note: with the TOTP seed stored here, anyone who can use these secrets has both factors. Prefer handing 2FA to a person when you can.");
6463
- })).pipe(withDescription4("Store a secret agents can type only on its origins (value from stdin or a hidden prompt)"));
6464
- var secretsList = make("list", { json: jsonFlag }, fn("Cli.secretsList")(function* ({ json }) {
6465
- const secrets = yield* listSecrets();
6466
- if (json) {
6467
- yield* emitJson({ secrets });
6468
- return;
6469
- }
6470
- if (secrets.length === 0) {
6471
- yield* log("No site secrets");
6472
- return;
6473
- }
6474
- yield* forEach(secrets, (secret) => log(`${secret.name} ${secret.kind} ${secret.allowedOrigins.join(",")}`));
6475
- })).pipe(withDescription4("List site secrets (names, kinds and origins, never values)"));
6476
- var secretsRemove = make("remove", { name: String7("name") }, fn("Cli.secretsRemove")(function* ({ name }) {
6477
- const removed = yield* removeSecret(name);
6478
- yield* log(removed ? `Removed ${name}` : `No secret named ${name}`);
6479
- })).pipe(withDescription4("Delete a site secret"));
6480
- var secrets = make("secrets").pipe(withDescription4("Site secrets agents can type without seeing them, and captured credential profiles"), withSubcommands([secretsAdd, secretsList, secretsRemove, secretsStatus, secretsRefresh, secretsRun]));
6481
- registerCliCommand(610, () => secrets);
6482
-
6483
6300
  // src/cli/session.ts
6484
6301
  function describeStop(stopped) {
6485
6302
  return [stopped.execute ? "a running execute" : undefined, stopped.handoff ? "a pending handoff" : undefined].filter(Boolean).join(" and ") + (stopped.forced ? " (the script did not stop in time and was abandoned with its state)" : "");
@@ -6662,10 +6479,10 @@ registerCliCommand(300, () => session);
6662
6479
  registerCliCommand(800, () => journal);
6663
6480
 
6664
6481
  // src/cli.ts
6665
- var packageRoot = path5.dirname(path5.dirname(fileURLToPath(import.meta.url)));
6482
+ var packageRoot = path4.dirname(path4.dirname(fileURLToPath(import.meta.url)));
6666
6483
  var opencodeBrowser = make("browse").pipe(withDescription4("Control the user's existing browser through the browse extension"), withSubcommands(buildRegisteredCliCommands({ packageRoot })));
6667
6484
  var mainLayer = mergeAll(layerFetch, layer).pipe(provideMerge(layer2));
6668
- function runCli(rawArgs = process4.argv.slice(2)) {
6485
+ function runCli(rawArgs = process3.argv.slice(2)) {
6669
6486
  const cliArgs = hoistJsonFlag(rawArgs);
6670
6487
  const subcommand = cliArgs.argv.find((arg) => !arg.startsWith("-"));
6671
6488
  const commandName = subcommand ? `browse ${subcommand}` : "browse";
@@ -6694,9 +6511,9 @@ function runCli(rawArgs = process4.argv.slice(2)) {
6694
6511
  const silent = () => {};
6695
6512
  const askedForHelp = cliArgs.argv.some((arg) => arg === "--help" || arg === "-h");
6696
6513
  const quietJson = cliArgs.json && !askedForHelp;
6697
- runWith(opencodeBrowser, { version: opencodeBrowserVersion2, renderErrors: !quietJson })(normalizeCliArguments(cliArgs.argv)).pipe(quietJson ? provideService(Console, { ...globalThis.console, log: silent }) : (effect) => effect, catchIf(isCliError, reportUsageError), catch_(reportFailure), provide3(mainLayer), runMain);
6514
+ runWith(opencodeBrowser, { version: opencodeBrowserVersion2, renderErrors: !quietJson })(cliArgs.argv).pipe(quietJson ? provideService(Console, { ...globalThis.console, log: silent }) : (effect) => effect, catchIf(isCliError, reportUsageError), catch_(reportFailure), provide3(mainLayer), runMain);
6698
6515
  }
6699
- if (process4.argv[1] && import.meta.url === pathToFileURL(process4.argv[1]).href && import.meta.url.endsWith("/cli.ts")) {
6516
+ if (process3.argv[1] && import.meta.url === pathToFileURL(process3.argv[1]).href && import.meta.url.endsWith("/cli.ts")) {
6700
6517
  runCli();
6701
6518
  }
6702
6519
  export {
package/dist/cli.mjs CHANGED
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  // src/main.ts
10
10
  import path from "node:path";
11
- var embeddedVersion = "0.0.17-dev.185";
11
+ var embeddedVersion = "0.0.17-dev.188";
12
12
  var setupCommands = new Set(["install", "uninstall", "extension", "pair", "set"]);
13
13
  var command = process.argv[2];
14
14
  var args = process.argv.slice(3);
@@ -18,26 +18,27 @@ var options = separator === -1 ? args : args.slice(0, separator);
18
18
  var askedForHelp = command === "--help" || command === "-h" || options.some((arg) => arg === "--help" || arg === "-h");
19
19
  var preCliHelp = askedForHelp && (command === "update" || command !== undefined && setupCommands.has(command));
20
20
  var oldRuntime = legacyRuntime();
21
- var takingOver = command === "serve" && !askedForHelp && legacyRuntimeActive(oldRuntime) && await import("./legacy-runtime-rvfsgmzn.mjs").then((module) => module.prepareLegacyTakeover(oldRuntime)).catch(() => false);
21
+ var takingOver = command === "serve" && !askedForHelp && legacyRuntimeActive(oldRuntime) && await import("./legacy-runtime-j0sw664c.mjs").then((module) => module.prepareLegacyTakeover(oldRuntime)).catch(() => false);
22
22
  if (!takingOver)
23
23
  settleLegacyHome(process.env, oldRuntime);
24
+ if (command !== "--version" && command !== "-v" && !askedForHelp && !takingOver) {
25
+ const { removeStoredSecrets } = await import("./remove-stored-secrets-wy3pakjj.mjs");
26
+ removeStoredSecrets();
27
+ }
24
28
  if (command !== "--version" && command !== "-v" && !askedForHelp && !takingOver && !process.env.OPENCODE_BROWSER_HOME && legacyRootsLeft()) {
25
29
  try {
26
- const { migrateLegacy } = await import("./migrate-fygxtp2g.mjs");
30
+ const { migrateLegacy } = await import("./migrate-r433scvg.mjs");
27
31
  migrateLegacy();
28
32
  } catch {}
29
33
  }
30
34
  if (command === "--version" || command === "-v") {
31
- const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-x1kkvpqn.mjs")).opencodeBrowserVersion;
35
+ const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-2123c138.mjs")).opencodeBrowserVersion;
32
36
  process.stdout.write(`${opencodeBrowserVersion}
33
37
  `);
34
- } else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-wrrnbfhw.mjs")).supervisesMcp()) {
35
- const { runBinaryMcp } = await import("./supervisor-wrrnbfhw.mjs");
36
- await runBinaryMcp(process.argv.slice(3));
37
38
  } else if (invokedAs === "opencode-browser-mcp" || command === "mcp" && process.argv.length === 3) {
38
- const { NodeRuntime } = await import("./index-gjq7chrk.mjs");
39
- const { defaultTeardown } = await import("./Runtime-xss8qan1.mjs");
40
- const { runMcpServer } = await import("./mcp-2xkjfnqz.mjs");
39
+ const { NodeRuntime } = await import("./index-37ssbv86.mjs");
40
+ const { defaultTeardown } = await import("./Runtime-hmy7zww1.mjs");
41
+ const { runMcpServer } = await import("./mcp-jh4atts2.mjs");
41
42
  let stdinGone = false;
42
43
  const onStdinGone = () => {
43
44
  stdinGone = true;
@@ -54,18 +55,18 @@ if (command === "--version" || command === "-v") {
54
55
  runMcpServer.pipe(NodeRuntime.runMain({
55
56
  teardown: (exit, onExit) => defaultTeardown(exit, (code) => {
56
57
  if (stdinGone && !signalled && code === 130)
57
- return process.exit(0);
58
+ return void process.stdout.write("", () => process.exit(0));
58
59
  onExit(code);
59
60
  })
60
61
  }));
61
62
  } else if (command === "self-update" || command === "runtime-switch") {
62
- const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-ngg3m888.mjs");
63
+ const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-ww2pejn2.mjs");
63
64
  await (command === "self-update" ? runSelfUpdate : runRuntimeSwitch)(process.argv.slice(3));
64
65
  } else if (command === "update" && !askedForHelp) {
65
- const { runUpdateCommand } = await import("./update-heze6vjn.mjs");
66
+ const { runUpdateCommand } = await import("./update-z7qvagkc.mjs");
66
67
  await runUpdateCommand(process.argv.slice(3));
67
68
  } else if (command && setupCommands.has(command) && !askedForHelp) {
68
- const { runSetup } = await import("./setup-t0pbhmzh.mjs");
69
+ const { runSetup } = await import("./setup-n1hpbkz2.mjs");
69
70
  await runSetup(command, process.argv.slice(3));
70
71
  } else {
71
72
  if (preCliHelp || !command || command === "--help" || command === "-h") {
@@ -92,8 +93,7 @@ if (command === "--version" || command === "-v") {
92
93
  update [--check] Update now: rerun whatever installed browse (the install script for a binary
93
94
  install, npm install -g for an npm one); --check only says whether there's an
94
95
  update. A git clone pulls the newer commits and runs setup again.
95
- uninstall [--yes] Remove everything install set up (--yes skips confirming that stored
96
- secret profiles and site secrets are deleted)
96
+ uninstall Remove everything install set up
97
97
 
98
98
  browse keeps its files in $XDG_CONFIG_HOME/browse, $XDG_DATA_HOME/browse, $XDG_STATE_HOME/browse and
99
99
  $XDG_CACHE_HOME/browse (defaults under ~/.config, ~/.local/share, ~/.local/state and ~/.cache), and the
@@ -102,9 +102,9 @@ executable in ~/.local/bin (or $XDG_BIN_HOME).
102
102
  `);
103
103
  }
104
104
  if (command === "status" && !askedForHelp && !process.argv.includes("--json")) {
105
- const { printSetupStatus } = await import("./setup-t0pbhmzh.mjs");
105
+ const { printSetupStatus } = await import("./setup-n1hpbkz2.mjs");
106
106
  printSetupStatus();
107
107
  }
108
- const { runCli } = await import("./cli-fk82qmwb.mjs");
108
+ const { runCli } = await import("./cli-5ezftnv2.mjs");
109
109
  runCli(preCliHelp ? ["--help"] : undefined);
110
110
  }
@@ -32,7 +32,7 @@ import {
32
32
  isRestrictedTarget2,
33
33
  isRestrictedUrl2,
34
34
  dataUrlDocument2
35
- } from "./main-ndmgt6k5.mjs";
35
+ } from "./main-mvjg1jye.mjs";
36
36
  export {
37
37
  HttpRouteError2 as HttpRouteError,
38
38
  chromeExtensionOriginForPath2 as chromeExtensionOriginForPath,
@@ -3,8 +3,8 @@ import {
3
3
  exports_NodeRuntime,
4
4
  exports_NodeStdio,
5
5
  exports_NodeServices
6
- } from "./main-jeta10c6.mjs";
7
- import"./main-9frwnsnf.mjs";
6
+ } from "./main-3514h33n.mjs";
7
+ import"./main-j4kq90pw.mjs";
8
8
  export {
9
9
  exports_NodeHttpClient as NodeHttpClient,
10
10
  exports_NodeRuntime as NodeRuntime,
@@ -1,10 +1,8 @@
1
- import"./main-ndmgt6k5.mjs";
1
+ import"./main-mvjg1jye.mjs";
2
2
  import {
3
- installerBinaryPath,
4
- compiledBinary,
5
3
  channelOf,
6
4
  installedRuntime2
7
- } from "./main-z32979g4.mjs";
5
+ } from "./main-m9n50a86.mjs";
8
6
  import {
9
7
  legacyRuntimeActive,
10
8
  insidePath,
@@ -12,12 +10,16 @@ import {
12
10
  } from "./main-pmfd055v.mjs";
13
11
  import {
14
12
  opencodeBrowserVersion2
15
- } from "./main-ew8jna3e.mjs";
13
+ } from "./main-qrqem3fy.mjs";
16
14
  import {
17
15
  relayPortPinned,
18
16
  resolveRelayPort,
19
17
  probeRelayPort
20
- } from "./main-qwf4vk41.mjs";
18
+ } from "./main-4qq4n32k.mjs";
19
+ import {
20
+ installerBinaryPath,
21
+ compiledBinary
22
+ } from "./main-tryp3jph.mjs";
21
23
 
22
24
  // src/setup/legacy-runtime.ts
23
25
  import fs from "node:fs";
@@ -50,7 +52,7 @@ async function prepareLegacyTakeover(legacy, options = {}) {
50
52
  return false;
51
53
  }
52
54
  const home = options.home ?? os.homedir();
53
- const { copyLegacyData } = await import("./migrate-fygxtp2g.mjs");
55
+ const { copyLegacyData } = await import("./migrate-r433scvg.mjs");
54
56
  delete env.OPENCODE_BROWSER_HOME;
55
57
  copyLegacyData(home);
56
58
  pending = { legacy, install, home };
@@ -64,7 +66,7 @@ async function commitLegacyTakeover(now = Date.now()) {
64
66
  try {
65
67
  if (!adoptLegacyRuntime(legacy, install, now))
66
68
  return false;
67
- const { migrateLegacy } = await import("./migrate-fygxtp2g.mjs");
69
+ const { migrateLegacy } = await import("./migrate-r433scvg.mjs");
68
70
  migrateLegacy(home, now);
69
71
  return true;
70
72
  } catch {
@@ -100,7 +102,6 @@ function writeForwarder(entry, runtime) {
100
102
  `child.on("exit", (code, signal) => { process.exitCode = code ?? (signal ? 1 : 0) })`
101
103
  ] : [
102
104
  `import { pathToFileURL } from "node:url"`,
103
- `if (process.env.OPENCODE_BROWSER_CLIENT_PID === String(process.ppid)) delete process.env.OPENCODE_BROWSER_CLIENT_PID`,
104
105
  `process.argv[1] = ${target}`,
105
106
  `await import(pathToFileURL(${target}).href)`
106
107
  ];
@@ -3621,10 +3621,6 @@ var ignoreCause2 = /* @__PURE__ */ dual((args) => isEffect2(args[0]), (self, opt
3621
3621
  onSuccess: (_) => void_
3622
3622
  });
3623
3623
  });
3624
- var option = (self) => match6(self, {
3625
- onFailure: none,
3626
- onSuccess: some
3627
- });
3628
3624
  var result2 = (self) => matchEager(self, {
3629
3625
  onFailure: fail2,
3630
3626
  onSuccess: succeed
@@ -5287,7 +5283,6 @@ var flatMap3 = flatMap2;
5287
5283
  var andThen2 = andThen;
5288
5284
  var tap = tap2;
5289
5285
  var result = result2;
5290
- var option2 = option;
5291
5286
  var exit = exit2;
5292
5287
  var map6 = map;
5293
5288
  var as = as2;
@@ -5397,4 +5392,4 @@ var flatMapEager = flatMapEager2;
5397
5392
  var catchEager = catchEager2;
5398
5393
  var fnUntracedEager = fnUntracedEager2;
5399
5394
 
5400
- export { pipeArguments, Prototype, Class3, dual, identity, constant, constTrue, constFalse, constUndefined, constVoid, pipe, flow, memoize, memoizeIdempotent, isString, isNumber, isBoolean, isBigInt, isSymbol, isPropertyKey, isFunction, isUndefined, isNotUndefined, isNotNull, isNullish, isNotNullish, isNever, isUnknown, isObjectOrArray, isObject, isReadonlyObject, isObjectKeyword, hasProperty, isTagged, isError, symbol2, hash, structure, array, symbol3, equals, symbolRedactable, redact, format, formatPropertyKey, formatPath, formatJson, NodeInspectSymbol, toJson, BaseProto, Class4, getStackTraceLimit, setStackTraceLimit, assignProperty, assignProperties, args, PipeInspectableProto, causeFail, exitSucceed, exitFailCause, exitFail, withFiber, Error4, TaggedError3, Done, Prototype2, make9, strictEqual, Tuple2, Number3, isLessThan, isGreaterThan2, isLessThanOrEqualTo, isGreaterThanOrEqualTo2, none, some, isNone, isSome, match, getOrElse, fromNullishOr, fromUndefinedOr, getOrUndefined, map2, flatMap, filter2, exists, Service2, makeUnsafe3, empty4, make10, add, getOrUndefined2, getOrUndefinedUnsafe, getUnsafe, get2, merge2, Reference, normalize, succeed, fail2, try_, isResult, isFailure, isSuccess, mapError, map3, match2, fromIterable, match3, append2, isArrayNonEmpty, isReadonlyArrayNonEmpty, isCanonicalArrayIndex, take3, findFirstIndex, findFirst, findLast, empty5, of, map4, reduce, makeEquivalence, fromInputUnsafe, isFinite2, isZero, zero, millis, seconds, toMillis, Scheduler, ParentSpan, externalSpan, DisablePropagation, getCurrentFiber, fiberJoin, fiberInterrupt, succeed2, sync, suspend, succeedNone, void_, callback, asSome, andThen, flatMap2, effectIsExit, exitInterrupt, exitVoid, exitZipRight, onExitPrimitive, uninterruptibleMask, resolveConcurrency, iterateEager, iterateConcurrent, fiberRunIn, makeLatchUnsafe, ClockRef, currentTimeMillis2, ConsoleRef, LogLevelOrder, reportCauseUnsafe, isCause, isReason, isFailReason, fromReasons, fail3, die, makeFailReason, makeDieReason, makeInterruptReason, hasInterruptsOnly, map5, squash, findError, hasDies, hasInterrupts, interruptors, Done2, done, IllegalArgumentError, ExceededCapacityError, UnknownError, StackTrace, isExit, succeed3, failCause2, fail4, die2, interrupt2, void_2, isSuccess2, isFailure2, hasInterrupts2, asVoid, isDeferred, makeUnsafe4, make11, _await, done2, fail5, interruptWith, isDone, isDoneUnsafe, succeed4, doneUnsafe, CurrentLogLevel, MinimumLogLevel, Scope, make12, makeUnsafe5, provide, addFinalizerExit, addFinalizer, fork, forkUnsafe, close, closeUnsafe, use, succeed5, effect, effectContext, effectDiscard, mergeAll, provide2, provideMerge, launch, catchDone, isDoneCause, doneExitFromCause, matchEffect, modifyDelay, spaced, setInputType, isEffect, all, forEach, whileLoop, promise, tryPromise, succeed6, succeedNone2, suspend2, sync2, void_3, callback2, never, gen, fail6, failCause3, failCauseSync, die3, try_2, withFiber2, fromResult, flatMap3, andThen2, tap, result, option2, exit, map6, as, asVoid2, zipWith, catch_, catchTag, catchTags, catchCause, catchDefect, catchIf, catchFilter, catchCauseIf, mapError2, orDie, tapError, tapCause, retry, sandbox, ignore, ignoreCause, orElseSucceed, timeout, timeoutOption, timeoutOrElse, sleep, race, raceFirst, when2, match4, matchCauseEffect, matchEffect2, context2, contextWith, provide3, provideContext2, serviceOption, updateContext, provideService, scope, scoped, scopedWith, acquireRelease, acquireUseRelease, addFinalizer2, ensuring, onError, onExit, cached, interrupt3, interruptible, onInterrupt, uninterruptible, uninterruptibleMask2, forever, repeat, makeSpanScoped, useSpan, withSpan, withParentSpan, forkChild, forkIn, forkScoped, forkDetach, runFork, runForkWith, runPromise, runSync, runSyncExit, fnUntraced, fn, clockWith, logFatal, logError, logDebug, annotateLogs, effectify, mapEager, mapErrorEager, mapBothEager, flatMapEager, catchEager, fnUntracedEager };
5395
+ export { pipeArguments, Prototype, Class3, dual, identity, constant, constTrue, constFalse, constUndefined, constVoid, pipe, flow, memoize, memoizeIdempotent, isString, isNumber, isBoolean, isBigInt, isSymbol, isPropertyKey, isFunction, isUndefined, isNotUndefined, isNotNull, isNullish, isNotNullish, isNever, isUnknown, isObjectOrArray, isObject, isReadonlyObject, isObjectKeyword, hasProperty, isTagged, isError, symbol2, hash, structure, array, symbol3, equals, symbolRedactable, redact, format, formatPropertyKey, formatPath, formatJson, NodeInspectSymbol, toJson, BaseProto, Class4, getStackTraceLimit, setStackTraceLimit, assignProperty, assignProperties, args, PipeInspectableProto, causeFail, exitSucceed, exitFailCause, exitFail, withFiber, Error4, TaggedError3, Done, Prototype2, make9, strictEqual, Tuple2, Number3, isLessThan, isGreaterThan2, isLessThanOrEqualTo, isGreaterThanOrEqualTo2, none, some, isNone, isSome, match, getOrElse, fromNullishOr, fromUndefinedOr, getOrUndefined, map2, flatMap, filter2, exists, Service2, makeUnsafe3, empty4, make10, add, getOrUndefined2, getOrUndefinedUnsafe, getUnsafe, get2, merge2, Reference, normalize, succeed, fail2, try_, isResult, isFailure, isSuccess, mapError, map3, match2, fromIterable, match3, append2, isArrayNonEmpty, isReadonlyArrayNonEmpty, isCanonicalArrayIndex, take3, findFirstIndex, findFirst, findLast, empty5, of, map4, reduce, makeEquivalence, fromInputUnsafe, isFinite2, isZero, zero, millis, seconds, toMillis, Scheduler, ParentSpan, externalSpan, DisablePropagation, getCurrentFiber, fiberJoin, fiberInterrupt, succeed2, sync, suspend, succeedNone, void_, callback, asSome, andThen, flatMap2, effectIsExit, exitInterrupt, exitVoid, exitZipRight, onExitPrimitive, uninterruptibleMask, resolveConcurrency, iterateEager, iterateConcurrent, fiberRunIn, makeLatchUnsafe, ClockRef, currentTimeMillis2, ConsoleRef, LogLevelOrder, reportCauseUnsafe, isCause, isReason, isFailReason, fromReasons, fail3, die, makeFailReason, makeDieReason, makeInterruptReason, hasInterruptsOnly, map5, squash, findError, hasDies, hasInterrupts, interruptors, Done2, done, IllegalArgumentError, ExceededCapacityError, UnknownError, StackTrace, isExit, succeed3, failCause2, fail4, die2, interrupt2, void_2, isSuccess2, isFailure2, hasInterrupts2, asVoid, isDeferred, makeUnsafe4, make11, _await, done2, fail5, interruptWith, isDone, isDoneUnsafe, succeed4, doneUnsafe, CurrentLogLevel, MinimumLogLevel, Scope, make12, makeUnsafe5, provide, addFinalizerExit, addFinalizer, fork, forkUnsafe, close, closeUnsafe, use, succeed5, effect, effectContext, effectDiscard, mergeAll, provide2, provideMerge, launch, catchDone, isDoneCause, doneExitFromCause, matchEffect, modifyDelay, spaced, setInputType, isEffect, all, forEach, whileLoop, promise, tryPromise, succeed6, succeedNone2, suspend2, sync2, void_3, callback2, never, gen, fail6, failCause3, failCauseSync, die3, try_2, withFiber2, fromResult, flatMap3, andThen2, tap, result, exit, map6, as, asVoid2, zipWith, catch_, catchTag, catchTags, catchCause, catchDefect, catchIf, catchFilter, catchCauseIf, mapError2, orDie, tapError, tapCause, retry, sandbox, ignore, ignoreCause, orElseSucceed, timeout, timeoutOption, timeoutOrElse, sleep, race, raceFirst, when2, match4, matchCauseEffect, matchEffect2, context2, contextWith, provide3, provideContext2, serviceOption, updateContext, provideService, scope, scoped, scopedWith, acquireRelease, acquireUseRelease, addFinalizer2, ensuring, onError, onExit, cached, interrupt3, interruptible, onInterrupt, uninterruptible, uninterruptibleMask2, forever, repeat, makeSpanScoped, useSpan, withSpan, withParentSpan, forkChild, forkIn, forkScoped, forkDetach, runFork, runForkWith, runPromise, runSync, runSyncExit, fnUntraced, fn, clockWith, logFatal, logError, logDebug, annotateLogs, effectify, mapEager, mapErrorEager, mapBothEager, flatMapEager, catchEager, fnUntracedEager };