@opencode/browse 0.0.17-dev.184 → 0.0.17-dev.186

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-c7zk5z3d.mjs → cli-7289awyd.mjs} +39 -222
  3. package/dist/cli.mjs +19 -16
  4. package/dist/{helpers-2z6753nv.mjs → helpers-21yzw670.mjs} +1 -1
  5. package/dist/{index-gjq7chrk.mjs → index-4tw494gw.mjs} +2 -2
  6. package/dist/{legacy-runtime-ywz3g2n8.mjs → legacy-runtime-ytvtb4p6.mjs} +10 -8
  7. package/dist/{main-m45zegrn.mjs → main-0h387a1q.mjs} +1 -6
  8. package/dist/{main-b3n584bp.mjs → main-3ymzbg04.mjs} +30 -47
  9. package/dist/{main-pweq8vqv.mjs → main-7y134fzj.mjs} +26 -157
  10. package/dist/{main-8sn293dr.mjs → main-81fht5nj.mjs} +18 -16
  11. package/dist/{main-6hvv25x8.mjs → main-8xd753k5.mjs} +1 -1
  12. package/dist/{main-t29t4z9q.mjs → main-97vjgp95.mjs} +2 -2
  13. package/dist/{main-5p5ccmye.mjs → main-czz5kqq9.mjs} +2 -2
  14. package/dist/{main-62n1hcda.mjs → main-ghh2tvn1.mjs} +3 -3
  15. package/dist/{main-akpa411k.mjs → main-gmhbkamn.mjs} +118 -2
  16. package/dist/{main-jy92xsx2.mjs → main-gnfmgnwj.mjs} +15 -18
  17. package/dist/{main-4y0ebwtf.mjs → main-hv8t6206.mjs} +8 -6
  18. package/dist/{main-9frwnsnf.mjs → main-j4kq90pw.mjs} +1 -1
  19. package/dist/{main-a65k2jvs.mjs → main-ns026dfw.mjs} +5 -46
  20. package/dist/{main-jeta10c6.mjs → main-qjr69cgp.mjs} +8 -8
  21. package/dist/{main-wk9g7869.mjs → main-vw7jwd0n.mjs} +2 -2
  22. package/dist/main-wq3rxzcg.mjs +141 -0
  23. package/dist/main-xz6gd1xb.mjs +4 -0
  24. package/dist/main-y3h7b6gd.mjs +17 -0
  25. package/dist/{main-bprn8bde.mjs → main-z3txr4wt.mjs} +6 -6
  26. package/dist/{mcp-qhe69x59.mjs → mcp-gqnkhtt0.mjs} +121 -230
  27. package/dist/{migrate-8b015c1q.mjs → migrate-der69rr4.mjs} +14 -7
  28. package/dist/{relay-x5bbrs68.mjs → relay-32ed2ae2.mjs} +763 -368
  29. package/dist/remove-stored-secrets-58r3xd1b.mjs +6 -0
  30. package/dist/{runtime-update-07b127we.mjs → runtime-update-3v5znrk0.mjs} +13 -11
  31. package/dist/{setup-7a2dr5pd.mjs → setup-tzttzgb4.mjs} +25 -47
  32. package/dist/{skill-text-1rg5b5np.mjs → skill-text-0ndr12dz.mjs} +7 -31
  33. package/dist/{supervisor-sjxe3hda.mjs → supervisor-84gbxv46.mjs} +8 -6
  34. package/dist/{update-ya63f9v3.mjs → update-exnjhpqb.mjs} +3 -3
  35. package/dist/{version-p0229yf3.mjs → version-h0n5h8j4.mjs} +1 -1
  36. package/package.json +1 -1
  37. package/skills/browse/SKILL.md +7 -31
  38. package/dist/main-ayhsjnxa.mjs +0 -1324
  39. package/dist/main-yp8nt4dh.mjs +0 -4
@@ -4,18 +4,134 @@ import {
4
4
  isString,
5
5
  isNumber,
6
6
  isBoolean,
7
+ withFiber,
7
8
  succeed,
8
9
  fail2,
9
10
  isResult,
10
11
  isSuccess,
12
+ getCurrentFiber,
13
+ succeed2,
14
+ sync,
15
+ suspend,
16
+ succeedNone,
17
+ void_,
18
+ callback,
19
+ asSome,
20
+ flatMap2,
21
+ onExitPrimitive,
22
+ uninterruptibleMask,
11
23
  ClockRef,
12
24
  currentTimeMillis2
13
- } from "./main-m45zegrn.mjs";
25
+ } from "./main-0h387a1q.mjs";
14
26
 
15
27
  // node_modules/effect/dist/Clock.js
16
28
  var Clock = ClockRef;
17
29
  var currentTimeMillis = currentTimeMillis2;
18
30
 
31
+ // node_modules/effect/dist/Semaphore.js
32
+ var makeUnsafe = (permits) => new SemaphoreImpl(permits);
33
+ var waitForPermits = (self, n, effect) => callback((resume) => {
34
+ if (self.free >= n)
35
+ return resume(effect);
36
+ const observer = () => {
37
+ if (self.free < n)
38
+ return;
39
+ self.waiters.delete(observer);
40
+ resume(effect);
41
+ };
42
+ self.waiters.add(observer);
43
+ return sync(() => {
44
+ self.waiters.delete(observer);
45
+ });
46
+ });
47
+
48
+ class SemaphoreImpl {
49
+ waiters = /* @__PURE__ */ new Set;
50
+ taken = 0;
51
+ permits;
52
+ constructor(permits) {
53
+ this.permits = permits;
54
+ }
55
+ get free() {
56
+ return this.permits - this.taken;
57
+ }
58
+ take(n) {
59
+ const take = suspend(() => {
60
+ if (this.free < n) {
61
+ return waitForPermits(this, n, take);
62
+ }
63
+ this.taken += n;
64
+ return succeed2(n);
65
+ });
66
+ return take;
67
+ }
68
+ takeIfAvailable(n) {
69
+ return suspend(() => {
70
+ if (this.free < n)
71
+ return succeed2(false);
72
+ this.taken += n;
73
+ return succeed2(true);
74
+ });
75
+ }
76
+ releaseUnsafe(fiber, n) {
77
+ this.taken -= n;
78
+ if (this.waiters.size > 0) {
79
+ fiber.currentDispatcher.scheduleTask(() => {
80
+ for (const observer of this.waiters) {
81
+ if (this.free <= 0)
82
+ break;
83
+ observer();
84
+ }
85
+ }, 0);
86
+ }
87
+ return this.free;
88
+ }
89
+ resize(permits) {
90
+ return withFiber((fiber) => {
91
+ this.permits = permits;
92
+ if (this.free < 0)
93
+ return void_;
94
+ this.releaseUnsafe(fiber, 0);
95
+ return void_;
96
+ });
97
+ }
98
+ release(n) {
99
+ return withFiber((fiber) => succeed2(this.releaseUnsafe(fiber, n)));
100
+ }
101
+ get releaseAll() {
102
+ return withFiber((fiber) => succeed2(this.releaseUnsafe(fiber, this.taken)));
103
+ }
104
+ withPermits(n) {
105
+ return (self) => uninterruptibleMask((restore) => {
106
+ const acquire = suspend(() => {
107
+ if (this.free < n) {
108
+ const wait = waitForPermits(this, n, void_);
109
+ return flatMap2(restore(wait), () => acquire);
110
+ }
111
+ this.taken += n;
112
+ return onExitPrimitive(restore(self), () => {
113
+ this.releaseUnsafe(getCurrentFiber(), n);
114
+ return;
115
+ }, true);
116
+ });
117
+ return acquire;
118
+ });
119
+ }
120
+ withPermit = /* @__PURE__ */ this.withPermits(1);
121
+ withPermitsIfAvailable(n) {
122
+ return (self) => uninterruptibleMask((restore) => {
123
+ if (this.free < n)
124
+ return succeedNone;
125
+ this.taken += n;
126
+ return onExitPrimitive(restore(asSome(self)), () => {
127
+ this.releaseUnsafe(getCurrentFiber(), n);
128
+ return;
129
+ }, true);
130
+ });
131
+ }
132
+ }
133
+ var make = (permits) => sync(() => new SemaphoreImpl(permits));
134
+
19
135
  // node_modules/effect/dist/internal/matcher.js
20
136
  var TypeId = "~effect/Match/Matcher";
21
137
  var TypeMatcherProto = {
@@ -208,4 +324,4 @@ var boolean = isBoolean;
208
324
  var orElse = orElse2;
209
325
  var exhaustive = exhaustive2;
210
326
 
211
- export { Clock, currentTimeMillis, type, value, when, tag, tags, is, string, number, boolean, orElse, exhaustive };
327
+ export { Clock, currentTimeMillis, makeUnsafe, make, type, value, when, tag, tags, is, string, number, boolean, orElse, exhaustive };
@@ -1,16 +1,11 @@
1
1
  import {
2
- stateRoot,
3
- compiledBinary,
4
- scriptEntry,
5
- cliCommand,
6
- installCommand,
7
2
  browserUnresponsive,
8
3
  extensionReconnectAlarmPeriodMs,
9
4
  extensionProtocolAdvice,
10
5
  compareVersions,
11
6
  installedRuntime2,
12
7
  installedVersion
13
- } from "./main-pweq8vqv.mjs";
8
+ } from "./main-7y134fzj.mjs";
14
9
  import {
15
10
  ensurePrivateDirectorySync,
16
11
  SessionContainer,
@@ -26,10 +21,8 @@ import {
26
21
  RelayShutdownRequest,
27
22
  RelayShutdownResponse,
28
23
  NetworkStatusResponse,
29
- AuthProfileSummary,
30
24
  NetworkStopResponse,
31
25
  NetworkCancelResponse,
32
- AuthRunResponse,
33
26
  RecordingStartResponse,
34
27
  RecordingStopResponse,
35
28
  RecordingStatusResponse,
@@ -43,7 +36,7 @@ import {
43
36
  RelayErrorCode,
44
37
  ErrorEnvelope,
45
38
  defaultPort2
46
- } from "./main-a65k2jvs.mjs";
39
+ } from "./main-ns026dfw.mjs";
47
40
  import {
48
41
  get,
49
42
  post,
@@ -51,13 +44,13 @@ import {
51
44
  bodyJson,
52
45
  HttpClient,
53
46
  layerNodeHttp
54
- } from "./main-jeta10c6.mjs";
47
+ } from "./main-qjr69cgp.mjs";
55
48
  import {
56
49
  opencodeBrowserBuildId2
57
- } from "./main-yp8nt4dh.mjs";
50
+ } from "./main-xz6gd1xb.mjs";
58
51
  import {
59
52
  relayAuthorization
60
- } from "./main-5p5ccmye.mjs";
53
+ } from "./main-czz5kqq9.mjs";
61
54
  import {
62
55
  endpointForPort,
63
56
  configuredRelayPort,
@@ -65,7 +58,7 @@ import {
65
58
  readRelayState,
66
59
  processAlive,
67
60
  resolveRelayPort
68
- } from "./main-t29t4z9q.mjs";
61
+ } from "./main-97vjgp95.mjs";
69
62
  import {
70
63
  Pointer,
71
64
  passthrough,
@@ -92,7 +85,7 @@ import {
92
85
  Defect,
93
86
  TaggedError2,
94
87
  toCodecStringTree
95
- } from "./main-6hvv25x8.mjs";
88
+ } from "./main-8xd753k5.mjs";
96
89
  import {
97
90
  dual,
98
91
  memoize,
@@ -145,7 +138,14 @@ import {
145
138
  mapEager,
146
139
  flatMapEager,
147
140
  catchEager
148
- } from "./main-m45zegrn.mjs";
141
+ } from "./main-0h387a1q.mjs";
142
+ import {
143
+ stateRoot,
144
+ compiledBinary,
145
+ scriptEntry,
146
+ cliCommand,
147
+ installCommand
148
+ } from "./main-wq3rxzcg.mjs";
149
149
  import {
150
150
  __require
151
151
  } from "./main-j98fzrvv.mjs";
@@ -690,9 +690,6 @@ var make3 = fn("RelayClient.make")(function* (options) {
690
690
  networkStatus: (request) => postJson("/network/status", { ...request }, NetworkStatusResponse),
691
691
  networkStop: (request) => postJson("/network/stop", { ...request }, NetworkStopResponse),
692
692
  networkCancel: (request) => postJson("/network/cancel", { ...request }, NetworkCancelResponse),
693
- authStatus: (request) => postJson("/auth/status", { ...request }, AuthProfileSummary),
694
- authRefresh: (request) => postJson("/auth/refresh", { ...request }, NetworkStopResponse),
695
- authRun: (request) => postJson("/auth/run", { ...request }, AuthRunResponse),
696
693
  recordingStart: ({ sessionId, tabId, ...request }) => postJson("/recording/start", { ...recordingTargetBody({ sessionId, tabId }), ...request }, RecordingStartResponse),
697
694
  recordingStop: (target) => postJson("/recording/stop", recordingTargetBody(target), RecordingStopResponse),
698
695
  recordingStatus: (target) => getJson(`/recording/status${recordingTargetQuery(target)}`, RecordingStatusResponse),
@@ -1,13 +1,15 @@
1
1
  import {
2
- cacheRoot,
3
- compiledBinary,
4
- checkoutRoot,
5
- cliCommand,
6
2
  unpackedReloadAdvice,
7
3
  installedRuntime2,
8
4
  autoUpdateStatus,
9
5
  updateAvailable
10
- } from "./main-pweq8vqv.mjs";
6
+ } from "./main-7y134fzj.mjs";
7
+ import {
8
+ cacheRoot,
9
+ compiledBinary,
10
+ checkoutRoot,
11
+ cliCommand
12
+ } from "./main-wq3rxzcg.mjs";
11
13
 
12
14
  // src/update.ts
13
15
  import { execFile, spawnSync } from "node:child_process";
@@ -313,7 +315,7 @@ function runUpdate(args, deps) {
313
315
  async function runUpdateCommand2(args) {
314
316
  const log = (line) => process.stdout.write(line + `
315
317
  `);
316
- const { runInstalledUpdate } = await import("./runtime-update-07b127we.mjs");
318
+ const { runInstalledUpdate } = await import("./runtime-update-3v5znrk0.mjs");
317
319
  if (await runInstalledUpdate(args))
318
320
  return;
319
321
  if (compiledBinary()) {
@@ -9,7 +9,7 @@ import {
9
9
  tapCause,
10
10
  runFork,
11
11
  logError
12
- } from "./main-m45zegrn.mjs";
12
+ } from "./main-0h387a1q.mjs";
13
13
 
14
14
  // node_modules/effect/dist/Runtime.js
15
15
  var defaultTeardown2 = (exit, onExit) => {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unpackedExtensionId,
3
3
  parseJsonObject
4
- } from "./main-pweq8vqv.mjs";
4
+ } from "./main-7y134fzj.mjs";
5
5
  import {
6
6
  decodeUnknownOption,
7
7
  optionalKey,
@@ -29,7 +29,7 @@ import {
29
29
  NonEmptyString,
30
30
  TaggedError2,
31
31
  Json
32
- } from "./main-6hvv25x8.mjs";
32
+ } from "./main-8xd753k5.mjs";
33
33
  import {
34
34
  isString,
35
35
  isNumber,
@@ -42,7 +42,7 @@ import {
42
42
  callback2,
43
43
  fail6,
44
44
  catch_
45
- } from "./main-m45zegrn.mjs";
45
+ } from "./main-0h387a1q.mjs";
46
46
  // src/fs-durability.ts
47
47
  import crypto from "node:crypto";
48
48
  import fsSync from "node:fs";
@@ -364,8 +364,7 @@ var NetworkStartRequest = Struct({
364
364
  });
365
365
  var NetworkSessionRequest = Struct({ sessionId: NonEmptyString });
366
366
  var NetworkStopRequest = NetworkSessionRequest.pipe(fieldsAssign({
367
- outputPath: optionalKey(String3),
368
- secrets: optionalKey(NonEmptyString)
367
+ outputPath: optionalKey(String3)
369
368
  }));
370
369
  var NetworkStatusResponse = Struct({
371
370
  active: Boolean3,
@@ -379,23 +378,9 @@ var NetworkStatusResponse = Struct({
379
378
  urlFilter: optionalKey(String3),
380
379
  resourceTypes: optionalKey(ArraySchema(String3)),
381
380
  content: optionalKey(NetworkContentMode),
382
- secrets: optionalKey(String3),
383
381
  endsAt: optionalKey(String3),
384
382
  ended: optionalKey(String3)
385
383
  });
386
- var AuthProfileSlotSummary = Struct({
387
- ref: String3,
388
- sources: ArraySchema(String3),
389
- expiresAt: optionalKey(String3),
390
- expired: Boolean3
391
- });
392
- var AuthProfileSummary = Struct({
393
- name: String3,
394
- createdAt: String3,
395
- updatedAt: String3,
396
- slotCount: Number2,
397
- slots: ArraySchema(AuthProfileSlotSummary)
398
- });
399
384
  var NetworkEndpointDigest = Struct({
400
385
  method: String3,
401
386
  url: String3,
@@ -409,35 +394,9 @@ var NetworkStopResponse = NetworkStatusResponse.pipe(fieldsAssign({
409
394
  active: Literal(false),
410
395
  stoppedAt: String3,
411
396
  outputPath: optionalKey(String3),
412
- authProfile: optionalKey(AuthProfileSummary),
413
- updatedSecretRefs: ArraySchema(String3),
414
- observedSecretRefs: ArraySchema(String3),
415
397
  endpoints: optionalKey(ArraySchema(NetworkEndpointDigest))
416
398
  }));
417
399
  var NetworkCancelResponse = Struct({ cancelled: Boolean3 });
418
- var AuthProfileRequest = Struct({ name: NonEmptyString });
419
- var AuthRefreshRequest = Struct({
420
- sessionId: NonEmptyString,
421
- name: NonEmptyString,
422
- urlFilter: optionalKey(String3),
423
- timeoutMs: optionalKey(Int2.check(isGreaterThan(0)))
424
- });
425
- var AuthRunRequest = Struct({
426
- name: NonEmptyString,
427
- command: NonEmptyString,
428
- args: optionalKey(ArraySchema(String3)),
429
- cwd: optionalKey(String3),
430
- timeoutMs: optionalKey(Int2.check(isGreaterThan(0)))
431
- });
432
- var AuthRunResponse = Struct({
433
- exitCode: Number2,
434
- signal: NullOr(String3),
435
- stdout: String3,
436
- stderr: String3,
437
- stdoutTruncated: Boolean3,
438
- stderrTruncated: Boolean3,
439
- durationMs: Number2
440
- });
441
400
  var RecordingMode = Literals(["tab-capture", "cdp"]);
442
401
  var RecordingRequestedMode = Literals(["auto", "tab-capture", "cdp"]);
443
402
  var RecordingFrameRate = Number2.check(isInt(), isBetween({ minimum: 1, maximum: 60 }));
@@ -1017,4 +976,4 @@ async function dataUrlDocument2(url) {
1017
976
  return;
1018
977
  }
1019
978
 
1020
- export { isNodeError, isUnsupportedDirectorySyncError, writeJsonFileAtomically, ensurePrivateDirectorySync, writePrivateJsonFileSync, SessionContainer, SessionsContainer, SessionDeleted, SessionResetResponse, ExecuteRequest, SessionAdoptRequest, SessionNewRequest, SessionEnsureRequest, SessionIdRequest, SessionAllowlistRequest, SessionAdoptResponse, ExecuteLogEntry, ExecuteLogSummary, ExecuteAftermath, ExecuteResponse, AuthenticatedJsonRequest, AuthenticatedJsonOutcome, TargetSummaries, ExtensionStatus, RelayVersion, RelayShutdownRequest, RelayShutdownResponse, NetworkStartRequest, NetworkSessionRequest, NetworkStopRequest, NetworkStatusResponse, AuthProfileSummary, NetworkStopResponse, NetworkCancelResponse, AuthProfileRequest, AuthRefreshRequest, AuthRunRequest, AuthRunResponse, RecordingQuality, RecordingTargetRequest, RecordingStartRequest, RecordingStartResponse, RecordingStopResponse, RecordingStatusResponse, TabsCleanupResponse, SettingsGetResponse, SettingsSetResponse, RecordingCancelResponse, FlightRecorderStartRequest, FlightRecorderStatusResponse, FlightRecorderSaveRequest, FlightRecorderSaveResponse, FlightRecorderCancelResponse, RelayErrorCode, ErrorEnvelope, HttpRouteError2, formatHostForUrl2, listenHttpServer2, closeHttpServer2, closeWebSocketServer2, logCloseError2, sendJson2, readJsonBody2, stableUnpackedExtensionOrigin2, chromeExtensionOriginForPath2, parseAdditionalExtensionOrigins2, validateHostHeader2, validateBrowserFetchSite2, validateWebSocketOrigin2, defaultHost2, defaultPort2, optionalSessionId2, isValidSessionId2, requiredSessionId2, parseTargetSelection2, generateSessionId2, sendCdpResponse2, sendCdpEvent2, getObject2, getString2, createTargetUrl2, getNumber2, getIdText2, headerValue2, getTargetInfo2, isRestrictedTarget2, isRestrictedUrl2, dataUrlDocument2 };
979
+ export { isNodeError, isUnsupportedDirectorySyncError, writeJsonFileAtomically, ensurePrivateDirectorySync, writePrivateJsonFileSync, SessionContainer, SessionsContainer, SessionDeleted, SessionResetResponse, ExecuteRequest, SessionAdoptRequest, SessionNewRequest, SessionEnsureRequest, SessionIdRequest, SessionAllowlistRequest, SessionAdoptResponse, ExecuteLogEntry, ExecuteLogSummary, ExecuteAftermath, ExecuteResponse, AuthenticatedJsonRequest, AuthenticatedJsonOutcome, TargetSummaries, ExtensionStatus, RelayVersion, RelayShutdownRequest, RelayShutdownResponse, NetworkStartRequest, NetworkSessionRequest, NetworkStopRequest, NetworkStatusResponse, NetworkStopResponse, NetworkCancelResponse, RecordingQuality, RecordingTargetRequest, RecordingStartRequest, RecordingStartResponse, RecordingStopResponse, RecordingStatusResponse, TabsCleanupResponse, SettingsGetResponse, SettingsSetResponse, RecordingCancelResponse, FlightRecorderStartRequest, FlightRecorderStatusResponse, FlightRecorderSaveRequest, FlightRecorderSaveResponse, FlightRecorderCancelResponse, RelayErrorCode, ErrorEnvelope, HttpRouteError2, formatHostForUrl2, listenHttpServer2, closeHttpServer2, closeWebSocketServer2, logCloseError2, sendJson2, readJsonBody2, stableUnpackedExtensionOrigin2, chromeExtensionOriginForPath2, parseAdditionalExtensionOrigins2, validateHostHeader2, validateBrowserFetchSite2, validateWebSocketOrigin2, defaultHost2, defaultPort2, optionalSessionId2, isValidSessionId2, requiredSessionId2, parseTargetSelection2, generateSessionId2, sendCdpResponse2, sendCdpEvent2, getObject2, getString2, createTargetUrl2, getNumber2, getIdText2, headerValue2, getTargetInfo2, isRestrictedTarget2, isRestrictedUrl2, dataUrlDocument2 };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  makeRunMain2
3
- } from "./main-9frwnsnf.mjs";
3
+ } from "./main-j4kq90pw.mjs";
4
4
  import {
5
5
  Error2,
6
6
  TaggedError,
7
7
  tag2,
8
8
  Error3
9
- } from "./main-6hvv25x8.mjs";
9
+ } from "./main-8xd753k5.mjs";
10
10
  import {
11
11
  pipeArguments,
12
12
  dual,
@@ -187,7 +187,7 @@ import {
187
187
  fnUntraced,
188
188
  clockWith,
189
189
  effectify
190
- } from "./main-m45zegrn.mjs";
190
+ } from "./main-0h387a1q.mjs";
191
191
  import {
192
192
  __export
193
193
  } from "./main-j98fzrvv.mjs";
@@ -1734,7 +1734,7 @@ var decodeText = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, option
1734
1734
  var splitLines2 = (self) => self.channel.pipe(pipeTo(splitLines()), fromChannel3);
1735
1735
  var ensuring3 = /* @__PURE__ */ dual(2, (self, finalizer) => fromChannel3(ensuring2(self.channel, finalizer)));
1736
1736
  var provideContext = /* @__PURE__ */ dual(2, (self, context) => fromChannel3(provideContext3(self.channel, context)));
1737
- var run2 = /* @__PURE__ */ dual(2, (self, sink) => scopedWith((scope) => toPullScoped(self.channel, scope).pipe(flatMap3((upstream) => sink.transform(upstream, scope)), map6(([a]) => a))));
1737
+ var run = /* @__PURE__ */ dual(2, (self, sink) => scopedWith((scope) => toPullScoped(self.channel, scope).pipe(flatMap3((upstream) => sink.transform(upstream, scope)), map6(([a]) => a))));
1738
1738
  var runCollect = (self) => runFold(self.channel, () => [], (acc, chunk) => {
1739
1739
  for (let i = 0;i < chunk.length; i++) {
1740
1740
  acc.push(chunk[i]);
@@ -3184,7 +3184,7 @@ var sendBody = (nodeRequest, request, body) => suspend2(() => {
3184
3184
  });
3185
3185
  }
3186
3186
  case "Stream": {
3187
- return run2(mapError3(body.stream, (cause) => new HttpClientError({
3187
+ return run(mapError3(body.stream, (cause) => new HttpClientError({
3188
3188
  reason: new EncodeError({
3189
3189
  request,
3190
3190
  cause
@@ -4188,7 +4188,7 @@ var make17 = /* @__PURE__ */ gen(function* () {
4188
4188
  });
4189
4189
  }
4190
4190
  if (config.stream) {
4191
- yield* forkScoped(run2(config.stream, sink));
4191
+ yield* forkScoped(run(config.stream, sink));
4192
4192
  }
4193
4193
  inputSinks.set(fd, sink);
4194
4194
  break;
@@ -4228,7 +4228,7 @@ var make17 = /* @__PURE__ */ gen(function* () {
4228
4228
  });
4229
4229
  }
4230
4230
  if (isStream(config.stream)) {
4231
- return as(forkScoped(run2(config.stream, sink)), sink);
4231
+ return as(forkScoped(run(config.stream, sink)), sink);
4232
4232
  }
4233
4233
  return succeed6(sink);
4234
4234
  });
@@ -5355,4 +5355,4 @@ var layer13 = layer12;
5355
5355
 
5356
5356
  // node_modules/@effect/platform-node/dist/NodeServices.js
5357
5357
  var layer2 = /* @__PURE__ */ provideMerge(layer4, /* @__PURE__ */ mergeAll(layer8, layer6, layer10, layer, layer13));
5358
- export { filter, empty, make4, value2, empty2, fromInput, fromRecordUnsafe, set, setAll, merge, remove, join, interrupt, getCurrent, runIn, makeUnsafe2, make5, set2, Empty, make6, append, prepend, takeAll, take, remove2, make7, bounded, dropping, offer, offerUnsafe, offerAll, failCause, end, shutdownUnsafe, takeAll2, take2, isStream, fromQueue, unwrap, provideContext, run2, runForEach, runForEachArray, FileSystem, Path, Stdio, QuitError, isQuitError, Terminal, empty3, jsonUnsafe, get, post, setHeader, bodyJson, HttpClient, layerNodeHttp, exports_NodeHttpClient, runMain, exports_NodeRuntime, layer, exports_NodeStdio, layer2, exports_NodeServices };
5358
+ export { filter, empty, make4, value2, empty2, fromInput, fromRecordUnsafe, set, setAll, merge, remove, join, interrupt, getCurrent, runIn, makeUnsafe2, make5, set2, Empty, make6, append, prepend, takeAll, take, remove2, make7, bounded, dropping, offer, offerUnsafe, offerAll, failCause, end, shutdownUnsafe, takeAll2, take2, isStream, fromQueue, unwrap, provideContext, run, runForEach, runForEachArray, FileSystem, Path, Stdio, QuitError, isQuitError, Terminal, empty3, jsonUnsafe, get, post, setHeader, bodyJson, HttpClient, layerNodeHttp, exports_NodeHttpClient, runMain, exports_NodeRuntime, layer, exports_NodeStdio, layer2, exports_NodeServices };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  writePrivateJsonFileSync
3
- } from "./main-a65k2jvs.mjs";
3
+ } from "./main-ns026dfw.mjs";
4
4
  import {
5
5
  dataRoot,
6
6
  stateRoot
7
- } from "./main-pweq8vqv.mjs";
7
+ } from "./main-wq3rxzcg.mjs";
8
8
 
9
9
  // src/relay/browser-pairing.ts
10
10
  import crypto from "node:crypto";
@@ -0,0 +1,141 @@
1
+ // src/paths.ts
2
+ import fs from "node:fs";
3
+ import os from "node:os";
4
+ import path from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ var override = (home) => home === os.homedir() && process.env.OPENCODE_BROWSER_HOME ? process.env.OPENCODE_BROWSER_HOME : undefined;
7
+ var xdgRoot = (variable, fallback, home) => {
8
+ const configured = home === os.homedir() ? process.env[variable] : undefined;
9
+ return path.join(configured && path.isAbsolute(configured) ? configured : path.join(home, fallback), "browse");
10
+ };
11
+ function defaultConfigRoot(home = os.homedir()) {
12
+ return xdgRoot("XDG_CONFIG_HOME", ".config", home);
13
+ }
14
+ function defaultRoots(home = os.homedir()) {
15
+ return {
16
+ config: defaultConfigRoot(home),
17
+ data: xdgRoot("XDG_DATA_HOME", ".local/share", home),
18
+ state: xdgRoot("XDG_STATE_HOME", ".local/state", home),
19
+ cache: xdgRoot("XDG_CACHE_HOME", ".cache", home)
20
+ };
21
+ }
22
+ function configRoot2(home = os.homedir()) {
23
+ return override(home) ?? defaultConfigRoot(home);
24
+ }
25
+ function dataRoot(home = os.homedir()) {
26
+ return override(home) ?? xdgRoot("XDG_DATA_HOME", ".local/share", home);
27
+ }
28
+ function stateRoot(home = os.homedir()) {
29
+ return override(home) ?? xdgRoot("XDG_STATE_HOME", ".local/state", home);
30
+ }
31
+ function cacheRoot(home = os.homedir()) {
32
+ return override(home) ?? xdgRoot("XDG_CACHE_HOME", ".cache", home);
33
+ }
34
+ function installerBinRoot(home = os.homedir()) {
35
+ const configured = home === os.homedir() ? process.env.XDG_BIN_HOME : undefined;
36
+ return configured && path.isAbsolute(configured) ? configured : path.join(home, ".local", "bin");
37
+ }
38
+ function binRoot(home = os.homedir()) {
39
+ if (override(home))
40
+ return path.join(override(home), "bin");
41
+ return installerBinRoot(home);
42
+ }
43
+ var installedBinaryPath = (home = os.homedir()) => path.join(binRoot(home), binaryName());
44
+ var installerBinaryPath = (home = os.homedir()) => path.join(installerBinRoot(home), binaryName());
45
+ var defaultSettingsPath = (home = os.homedir()) => path.join(defaultConfigRoot(home), "settings.json");
46
+ var packageRoot = () => path.dirname(path.dirname(fileURLToPath(import.meta.url)));
47
+ var oldStoreMarker = () => path.join(stateRoot(), "old-store-extension");
48
+ function fromCheckout() {
49
+ return !compiledBinary() && fs.existsSync(path.join(packageRoot(), "src", "main.ts"));
50
+ }
51
+ var compiledBinary = () => globalThis.__OPENCODE_BROWSER_COMPILED__ === true;
52
+ var binaryPackage = () => globalThis.__OPENCODE_BROWSER_TARGET__ ? `@opencode/browse-${globalThis.__OPENCODE_BROWSER_TARGET__}` : undefined;
53
+ var binaryName = (platform = process.platform) => platform === "win32" ? "browse.exe" : "browse";
54
+ var scriptEntry = (entry) => /\.[cm]?[jt]s$/.test(entry);
55
+ var entryCommand = (entry, node = process.execPath) => scriptEntry(entry) ? [node, entry] : [entry];
56
+ var windowsShellShim = (entry, pathModule) => /\.(cmd|bat)$/i.test(entry) || pathModule.extname(entry) === "" && !pathModule.isAbsolute(entry) && !/[\\/]/.test(entry);
57
+ var npxEntry = (entry) => /(^|\/)_npx\//.test(entry.replaceAll("\\", "/"));
58
+ function resolveWindowsShim(entry, node = process.execPath, options = {}) {
59
+ const pathModule = options.pathModule ?? path.win32;
60
+ const exists = options.existsSync ?? fs.existsSync;
61
+ if (!windowsShellShim(entry, pathModule))
62
+ return;
63
+ const shimmed = /\.(cmd|bat)$/i.test(entry);
64
+ const withFolder = shimmed && (pathModule.isAbsolute(entry) || /[\\/]/.test(entry));
65
+ const directories = withFolder ? [pathModule.dirname(entry)] : (options.env ?? process.env).PATH?.split(";").map((directory) => directory.trim().replace(/^"(.*)"$/, "$1")).filter(Boolean) ?? [];
66
+ for (const directory of directories) {
67
+ if (!shimmed) {
68
+ const executable = pathModule.join(directory, `${entry}.exe`);
69
+ if (exists(executable))
70
+ return [executable];
71
+ }
72
+ const shim = withFolder ? entry : pathModule.join(directory, shimmed ? entry : `${entry}.cmd`);
73
+ if (!exists(shim))
74
+ continue;
75
+ const script = pathModule.join(directory, "node_modules", "@opencode", "browse", "dist", "cli.mjs");
76
+ if (exists(script))
77
+ return [node, script];
78
+ }
79
+ return;
80
+ }
81
+ function entrySpawnCommand(entry, node = process.execPath, options = {}) {
82
+ if (scriptEntry(entry))
83
+ return [node, entry];
84
+ const pathModule = options.pathModule ?? path.win32;
85
+ if ((options.platform ?? process.platform) !== "win32" || !windowsShellShim(entry, pathModule))
86
+ return [entry];
87
+ const resolved = resolveWindowsShim(entry, node, options);
88
+ if (resolved)
89
+ return resolved;
90
+ const running = options.running ?? runningEntry();
91
+ const compiled = options.compiled ?? compiledBinary();
92
+ const checkout = options.checkout ?? fromCheckout();
93
+ return !compiled && !checkout && scriptEntry(running) && !npxEntry(running) ? [node, running] : [entry];
94
+ }
95
+ function installedBinary() {
96
+ const binary = installedBinaryPath();
97
+ return fs.existsSync(binary) ? binary : undefined;
98
+ }
99
+ var runningEntry = () => compiledBinary() ? process.execPath : process.argv[1];
100
+ function checkoutRoot() {
101
+ return fromCheckout() ? path.dirname(packageRoot()) : undefined;
102
+ }
103
+ var quoted = (value) => /^[\w@%+=:,./-]+$/.test(value) ? value : JSON.stringify(value);
104
+ function cliInstall() {
105
+ if (compiledBinary())
106
+ return { kind: "binary", binary: installedBinary() ?? process.execPath, pathEnv: process.env.PATH };
107
+ if (fromCheckout())
108
+ return { kind: "checkout", bundle: path.join(packageRoot(), "dist", "cli.mjs") };
109
+ return { kind: "npm", version: "0.0.17-dev.186", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
110
+ }
111
+ function cliPrefix(install = cliInstall()) {
112
+ if (install.kind === "binary") {
113
+ const dir = path.dirname(install.binary);
114
+ const onPath = (install.pathEnv ?? "").split(path.delimiter).some((entry) => entry && path.resolve(entry) === dir);
115
+ return onPath ? "browse" : quoted(install.binary);
116
+ }
117
+ if (install.kind === "checkout")
118
+ return `node ${quoted(install.bundle)}`;
119
+ if (install.npx)
120
+ return install.version?.includes("-dev.") ? "npx @opencode/browse@dev" : "npx @opencode/browse";
121
+ return "browse";
122
+ }
123
+ var cliCommand = (args, install = cliInstall()) => `${cliPrefix(install)} ${args}`;
124
+ var STORE_ITEM_ID = /^[a-p]{32}$/;
125
+ var PUBLIC_STORE_ID = "mfnicocicmmlkpjnaffgihfjhdgjkdjg";
126
+ function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjhdgjkdjg" }) {
127
+ const id = [env.OPENCODE_BROWSER_STORE_ID, baked?.id].find((value) => value && STORE_ITEM_ID.test(value));
128
+ return id ? { id } : {};
129
+ }
130
+ var RELEASE_SERVICE = "https://anoma.ly/release";
131
+ function devExtension(baked = { file: "browse-extension-0.0.17-dev.186.zip", sha256: "51ad04fe10056462371fd33f1f28edb9537f66fb5b23f970fd264a8cd9cf0ca4", size: 187300 }) {
132
+ return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
133
+ }
134
+ var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
135
+ var devExtensionFolder = (root = cacheRoot()) => path.join(root, "extension");
136
+ var storeUrl = (id) => `https://chromewebstore.google.com/detail/${id}`;
137
+ function installCommand() {
138
+ return fromCheckout() ? `cd ${quoted(path.dirname(packageRoot()))} && bun run setup` : cliCommand("install");
139
+ }
140
+
141
+ export { defaultRoots, configRoot2, dataRoot, stateRoot, cacheRoot, binRoot, installedBinaryPath, installerBinaryPath, defaultSettingsPath, oldStoreMarker, fromCheckout, compiledBinary, binaryPackage, binaryName, scriptEntry, entryCommand, resolveWindowsShim, entrySpawnCommand, installedBinary, runningEntry, checkoutRoot, cliPrefix, cliCommand, PUBLIC_STORE_ID, storeConfig, RELEASE_SERVICE, devExtension, devExtensionUrl, devExtensionFolder, storeUrl, installCommand };
@@ -0,0 +1,4 @@
1
+ // src/version.ts
2
+ var opencodeBrowserVersion2 = "0.0.17-dev.186";
3
+ var opencodeBrowserBuildId2 = "2026-11-14T16:44:04.614Z";
4
+ export { opencodeBrowserVersion2, opencodeBrowserBuildId2 };
@@ -0,0 +1,17 @@
1
+ import {
2
+ dataRoot
3
+ } from "./main-wq3rxzcg.mjs";
4
+
5
+ // src/setup/remove-stored-secrets.ts
6
+ import fs from "node:fs";
7
+ import os from "node:os";
8
+ import path from "node:path";
9
+ function removeStoredSecrets2(home = os.homedir()) {
10
+ for (const folder of ["site-secrets", "secrets"]) {
11
+ try {
12
+ fs.rmSync(path.join(dataRoot(home), folder), { recursive: true, force: true });
13
+ } catch {}
14
+ }
15
+ }
16
+
17
+ export { removeStoredSecrets2 };
@@ -1,10 +1,7 @@
1
1
  import {
2
2
  isNodeError,
3
3
  isValidSessionId2
4
- } from "./main-a65k2jvs.mjs";
5
- import {
6
- stateRoot
7
- } from "./main-pweq8vqv.mjs";
4
+ } from "./main-ns026dfw.mjs";
8
5
  import {
9
6
  decodeUnknownOption,
10
7
  optionalKey,
@@ -14,10 +11,13 @@ import {
14
11
  Struct,
15
12
  ArraySchema,
16
13
  NullOr
17
- } from "./main-6hvv25x8.mjs";
14
+ } from "./main-8xd753k5.mjs";
18
15
  import {
19
16
  isSome
20
- } from "./main-m45zegrn.mjs";
17
+ } from "./main-0h387a1q.mjs";
18
+ import {
19
+ stateRoot
20
+ } from "./main-wq3rxzcg.mjs";
21
21
 
22
22
  // src/session-manager/journal.ts
23
23
  import fs from "node:fs";