@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
@@ -1,6 +1,3 @@
1
- import {
2
- cliCommand
3
- } from "./main-pweq8vqv.mjs";
4
1
  import {
5
2
  SessionDeleted,
6
3
  ExecuteLogEntry,
@@ -8,18 +5,17 @@ import {
8
5
  ExecuteAftermath,
9
6
  ExtensionStatus,
10
7
  RelayVersion,
11
- AuthProfileSummary,
12
8
  RecordingQuality,
13
9
  SettingsGetResponse,
14
10
  SettingsSetResponse,
15
11
  parseTargetSelection2,
16
12
  getObject2,
17
13
  getString2
18
- } from "./main-a65k2jvs.mjs";
14
+ } from "./main-ns026dfw.mjs";
19
15
  import {
20
16
  isStream,
21
17
  provideContext
22
- } from "./main-jeta10c6.mjs";
18
+ } from "./main-qjr69cgp.mjs";
23
19
  import {
24
20
  TaggedError,
25
21
  passthrough,
@@ -65,7 +61,7 @@ import {
65
61
  toJsonSchemaDocument,
66
62
  Json,
67
63
  JsonObject
68
- } from "./main-6hvv25x8.mjs";
64
+ } from "./main-8xd753k5.mjs";
69
65
  import {
70
66
  pipeArguments,
71
67
  identity,
@@ -101,7 +97,10 @@ import {
101
97
  contextWith,
102
98
  provide3,
103
99
  fnUntraced
104
- } from "./main-m45zegrn.mjs";
100
+ } from "./main-0h387a1q.mjs";
101
+ import {
102
+ cliCommand
103
+ } from "./main-wq3rxzcg.mjs";
105
104
 
106
105
  // node_modules/effect/dist/PrimaryKey.js
107
106
  var symbol = "~effect/PrimaryKey";
@@ -237,7 +236,7 @@ var makeProto = (options) => {
237
236
  Rpc.key = `effect/rpc/Rpc/${options._tag}`;
238
237
  return Rpc;
239
238
  };
240
- var make = (tag, options) => {
239
+ var make2 = (tag, options) => {
241
240
  const successSchema = options?.success ?? Void;
242
241
  const errorSchema = options?.error ?? Never;
243
242
  const defectSchema = options?.defect ?? Defect();
@@ -420,7 +419,7 @@ var makeProto2 = (options) => Object.assign(function() {}, RpcGroupProto, {
420
419
  requests: options.requests,
421
420
  annotations: options.annotations
422
421
  });
423
- var make2 = (...rpcs) => makeProto2({
422
+ var make3 = (...rpcs) => makeProto2({
424
423
  requests: new Map(rpcs.map((rpc) => [rpc._tag, rpc])),
425
424
  annotations: empty4()
426
425
  });
@@ -611,7 +610,7 @@ class InternalError extends (/* @__PURE__ */ Error3("effect/ai/McpSchema/Interna
611
610
  }
612
611
  var McpError = /* @__PURE__ */ Union([ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, McpErrorBase]);
613
612
 
614
- class Ping extends (/* @__PURE__ */ make("ping", {
613
+ class Ping extends (/* @__PURE__ */ make2("ping", {
615
614
  success: /* @__PURE__ */ Struct({}),
616
615
  error: McpError,
617
616
  payload: /* @__PURE__ */ UndefinedOr(RequestMeta)
@@ -627,7 +626,7 @@ class InitializeResult extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct(
627
626
  }))) {
628
627
  }
629
628
 
630
- class Initialize extends (/* @__PURE__ */ make("initialize", {
629
+ class Initialize extends (/* @__PURE__ */ make2("initialize", {
631
630
  success: InitializeResult,
632
631
  error: McpError,
633
632
  payload: {
@@ -638,7 +637,7 @@ class Initialize extends (/* @__PURE__ */ make("initialize", {
638
637
  }
639
638
  })) {
640
639
  }
641
- class CancelledNotification extends (/* @__PURE__ */ make("notifications/cancelled", {
640
+ class CancelledNotification extends (/* @__PURE__ */ make2("notifications/cancelled", {
642
641
  payload: {
643
642
  ...NotificationMeta.fields,
644
643
  requestId: RequestId,
@@ -647,7 +646,7 @@ class CancelledNotification extends (/* @__PURE__ */ make("notifications/cancell
647
646
  })) {
648
647
  }
649
648
 
650
- class ProgressNotification extends (/* @__PURE__ */ make("notifications/progress", {
649
+ class ProgressNotification extends (/* @__PURE__ */ make2("notifications/progress", {
651
650
  payload: {
652
651
  ...NotificationMeta.fields,
653
652
  progressToken: ProgressToken,
@@ -718,7 +717,7 @@ class ReadResourceResult extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struc
718
717
  }))) {
719
718
  }
720
719
 
721
- class ReadResource extends (/* @__PURE__ */ make("resources/read", {
720
+ class ReadResource extends (/* @__PURE__ */ make2("resources/read", {
722
721
  success: ReadResourceResult,
723
722
  error: McpError,
724
723
  payload: {
@@ -728,12 +727,12 @@ class ReadResource extends (/* @__PURE__ */ make("resources/read", {
728
727
  })) {
729
728
  }
730
729
 
731
- class ResourceListChangedNotification extends (/* @__PURE__ */ make("notifications/resources/list_changed", {
730
+ class ResourceListChangedNotification extends (/* @__PURE__ */ make2("notifications/resources/list_changed", {
732
731
  payload: /* @__PURE__ */ UndefinedOr(NotificationMeta)
733
732
  })) {
734
733
  }
735
734
 
736
- class Subscribe extends (/* @__PURE__ */ make("resources/subscribe", {
735
+ class Subscribe extends (/* @__PURE__ */ make2("resources/subscribe", {
737
736
  success: /* @__PURE__ */ Struct({}),
738
737
  error: McpError,
739
738
  payload: {
@@ -743,7 +742,7 @@ class Subscribe extends (/* @__PURE__ */ make("resources/subscribe", {
743
742
  })) {
744
743
  }
745
744
 
746
- class Unsubscribe extends (/* @__PURE__ */ make("resources/unsubscribe", {
745
+ class Unsubscribe extends (/* @__PURE__ */ make2("resources/unsubscribe", {
747
746
  success: /* @__PURE__ */ Struct({}),
748
747
  error: McpError,
749
748
  payload: {
@@ -753,7 +752,7 @@ class Unsubscribe extends (/* @__PURE__ */ make("resources/unsubscribe", {
753
752
  })) {
754
753
  }
755
754
 
756
- class ResourceUpdatedNotification extends (/* @__PURE__ */ make("notifications/resources/updated", {
755
+ class ResourceUpdatedNotification extends (/* @__PURE__ */ make2("notifications/resources/updated", {
757
756
  payload: {
758
757
  ...NotificationMeta.fields,
759
758
  uri: String3
@@ -838,7 +837,7 @@ class GetPromptResult extends (/* @__PURE__ */ Class2("@effect/ai/McpSchema/GetP
838
837
  })) {
839
838
  }
840
839
 
841
- class GetPrompt extends (/* @__PURE__ */ make("prompts/get", {
840
+ class GetPrompt extends (/* @__PURE__ */ make2("prompts/get", {
842
841
  success: GetPromptResult,
843
842
  error: McpError,
844
843
  payload: {
@@ -850,7 +849,7 @@ class GetPrompt extends (/* @__PURE__ */ make("prompts/get", {
850
849
  })) {
851
850
  }
852
851
 
853
- class PromptListChangedNotification extends (/* @__PURE__ */ make("notifications/prompts/list_changed", {
852
+ class PromptListChangedNotification extends (/* @__PURE__ */ make2("notifications/prompts/list_changed", {
854
853
  payload: /* @__PURE__ */ UndefinedOr(NotificationMeta)
855
854
  })) {
856
855
  }
@@ -895,7 +894,7 @@ class CallToolResult extends (/* @__PURE__ */ Class2("@effect/ai/McpSchema/CallT
895
894
  })) {
896
895
  }
897
896
 
898
- class CallTool extends (/* @__PURE__ */ make("tools/call", {
897
+ class CallTool extends (/* @__PURE__ */ make2("tools/call", {
899
898
  success: CallToolResult,
900
899
  error: McpError,
901
900
  payload: {
@@ -906,13 +905,13 @@ class CallTool extends (/* @__PURE__ */ make("tools/call", {
906
905
  })) {
907
906
  }
908
907
 
909
- class ToolListChangedNotification extends (/* @__PURE__ */ make("notifications/tools/list_changed", {
908
+ class ToolListChangedNotification extends (/* @__PURE__ */ make2("notifications/tools/list_changed", {
910
909
  payload: /* @__PURE__ */ UndefinedOr(NotificationMeta)
911
910
  })) {
912
911
  }
913
912
  var LoggingLevel = /* @__PURE__ */ Literals(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
914
913
 
915
- class SetLevel extends (/* @__PURE__ */ make("logging/setLevel", {
914
+ class SetLevel extends (/* @__PURE__ */ make2("logging/setLevel", {
916
915
  payload: {
917
916
  ...RequestMeta.fields,
918
917
  level: LoggingLevel
@@ -922,7 +921,7 @@ class SetLevel extends (/* @__PURE__ */ make("logging/setLevel", {
922
921
  })) {
923
922
  }
924
923
 
925
- class LoggingMessageNotification extends (/* @__PURE__ */ make("notifications/message", {
924
+ class LoggingMessageNotification extends (/* @__PURE__ */ make2("notifications/message", {
926
925
  payload: /* @__PURE__ */ Struct({
927
926
  ...NotificationMeta.fields,
928
927
  level: LoggingLevel,
@@ -995,7 +994,7 @@ class CreateMessageResult extends (/* @__PURE__ */ Class2("@effect/ai/McpSchema/
995
994
  })) {
996
995
  }
997
996
 
998
- class CreateMessage extends (/* @__PURE__ */ make("sampling/createMessage", {
997
+ class CreateMessage extends (/* @__PURE__ */ make2("sampling/createMessage", {
999
998
  success: CreateMessageResult,
1000
999
  error: McpError,
1001
1000
  payload: {
@@ -1040,7 +1039,7 @@ class ListRootsResult extends (/* @__PURE__ */ Class2("@effect/ai/McpSchema/List
1040
1039
  })) {
1041
1040
  }
1042
1041
 
1043
- class ListRoots extends (/* @__PURE__ */ make("roots/list", {
1042
+ class ListRoots extends (/* @__PURE__ */ make2("roots/list", {
1044
1043
  success: ListRootsResult,
1045
1044
  error: McpError,
1046
1045
  payload: /* @__PURE__ */ UndefinedOr(RequestMeta)
@@ -1177,14 +1176,14 @@ class ElicitDeclineResult extends (/* @__PURE__ */ Class2("@effect/ai/McpSchema/
1177
1176
  })) {
1178
1177
  }
1179
1178
  var ElicitResult = /* @__PURE__ */ Union([ElicitAcceptResult, ElicitDeclineResult]);
1180
- class Elicit extends (/* @__PURE__ */ make("elicitation/create", {
1179
+ class Elicit extends (/* @__PURE__ */ make2("elicitation/create", {
1181
1180
  success: ElicitResult,
1182
1181
  error: McpError,
1183
1182
  payload: ElicitRequestParams
1184
1183
  })) {
1185
1184
  }
1186
1185
 
1187
- class ElicitationCompleteNotification extends (/* @__PURE__ */ make("notifications/elicitation/complete", {
1186
+ class ElicitationCompleteNotification extends (/* @__PURE__ */ make2("notifications/elicitation/complete", {
1188
1187
  payload: {
1189
1188
  elicitationId: String3
1190
1189
  }
@@ -1212,7 +1211,7 @@ class McpServerClient extends (/* @__PURE__ */ Service2()("effect/ai/McpSchema/M
1212
1211
 
1213
1212
  class McpServerClientMiddleware extends (/* @__PURE__ */ Service()("effect/ai/McpSchema/McpServerClientMiddleware")) {
1214
1213
  }
1215
- class ServerNotificationRpcs extends (/* @__PURE__ */ make2(CancelledNotification, ProgressNotification, LoggingMessageNotification, ResourceUpdatedNotification, ResourceListChangedNotification, ToolListChangedNotification, PromptListChangedNotification, ElicitationCompleteNotification)) {
1214
+ class ServerNotificationRpcs extends (/* @__PURE__ */ make3(CancelledNotification, ProgressNotification, LoggingMessageNotification, ResourceUpdatedNotification, ResourceListChangedNotification, ToolListChangedNotification, PromptListChangedNotification, ElicitationCompleteNotification)) {
1216
1215
  }
1217
1216
  class EnabledWhen extends (/* @__PURE__ */ Service2()("effect/ai/McpSchema/EnabledWhen")) {
1218
1217
  }
@@ -1366,9 +1365,6 @@ var sessionSchemaProperty = {
1366
1365
  description: "Optional session id. Defaults to your current session."
1367
1366
  };
1368
1367
  var sessionAliasSchemaProperty = { type: "string", description: "Same as id." };
1369
- var sessionOnlyInputSchema = objectSchema({
1370
- session: sessionSchemaProperty
1371
- });
1372
1368
  var ExecuteToolOutput = Struct({
1373
1369
  session: String3,
1374
1370
  value: optionalKey(Unknown),
@@ -1409,14 +1405,10 @@ var NetworkToolOutput = Struct({
1409
1405
  urlFilter: optionalKey(String3),
1410
1406
  resourceTypes: optionalKey(ArraySchema(String3)),
1411
1407
  content: optionalKey(Literals(["omit", "embed"])),
1412
- secrets: optionalKey(String3),
1413
1408
  endsAt: optionalKey(String3),
1414
1409
  ended: optionalKey(String3),
1415
1410
  stoppedAt: optionalKey(String3),
1416
1411
  outputPath: optionalKey(String3),
1417
- authProfile: optionalKey(AuthProfileSummary),
1418
- updatedSecretRefs: optionalKey(ArraySchema(String3)),
1419
- observedSecretRefs: optionalKey(ArraySchema(String3)),
1420
1412
  endpoints: optionalKey(ArraySchema(Struct({
1421
1413
  method: String3,
1422
1414
  url: String3,
@@ -1484,15 +1476,6 @@ var SettingsToolOutput = Struct({
1484
1476
  overridden: optionalKey(SettingsSetResponse.fields.overridden),
1485
1477
  message: optionalKey(SettingsSetResponse.fields.message)
1486
1478
  });
1487
- var SecretsListToolOutput = Struct({
1488
- secrets: ArraySchema(Struct({
1489
- name: String3,
1490
- kind: Literals(["password", "totp"]),
1491
- allowedOrigins: ArraySchema(String3),
1492
- createdAt: String3,
1493
- updatedAt: String3
1494
- }))
1495
- });
1496
1479
  function toolOutputJson(schema) {
1497
1480
  const document = toJsonSchemaDocument(schema);
1498
1481
  const json = Object.keys(document.definitions).length === 0 ? document.schema : { ...document.schema, $defs: document.definitions };
@@ -1768,4 +1751,4 @@ function toolResult(options) {
1768
1751
  });
1769
1752
  }
1770
1753
 
1771
- export { settingKeys, settingSpecs, securityVariables, SettingsInputError, parseSettingChanges, settingsFromExtension, settingsToExtension, describeSettings, describeChanges, formatSettings, isStreamSchema, getStreamSchemas, ClientAbort, ServerClient, make, exitSchema, isWrapper, make2, Implementation, ClientCapabilities, INVALID_REQUEST_ERROR_CODE, METHOD_NOT_FOUND_ERROR_CODE, INVALID_PARAMS_ERROR_CODE, INTERNAL_ERROR_CODE, HEADER_MISMATCH_ERROR_CODE, ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, McpError, Ping, Initialize, CancelledNotification, ProgressNotification, ResourceListChangedNotification, ResourceUpdatedNotification, Prompt, TextContent, PromptListChangedNotification, Tool, CallToolResult, ToolListChangedNotification, LoggingLevel, LoggingMessageNotification, CreateMessage, ListRootsResult, ListRoots, Elicit, McpReverseOperationUnsupported, McpReverseOperationError, McpRequestContext, McpServerClient, McpServerClientMiddleware, ServerNotificationRpcs, EnabledWhen, mcpUpdateNote2, objectSchema, valuesSchema, emptyInputSchema, sessionSchemaProperty, sessionAliasSchemaProperty, sessionOnlyInputSchema, StatusToolOutput, CurrentSessionToolOutput, SessionDeleteToolOutput, NetworkToolOutput, RecordingToolOutput, FlightRecorderToolOutput, agentSettingKeys, SettingsToolOutput, SecretsListToolOutput, toolOutputJson, executeToolResult, ensureSessionExists, parseExecuteArguments, parseAdoptArguments, requiredStringField, requiredAction, optionalStringField, optionalBooleanField, optionalPositiveIntegerField, optionalStringArrayField, requireObject, toolResultForValue2, mcpErrorMessage2, toolResult };
1754
+ export { settingKeys, settingSpecs, securityVariables, SettingsInputError, parseSettingChanges, settingsFromExtension, settingsToExtension, describeSettings, describeChanges, formatSettings, isStreamSchema, getStreamSchemas, ClientAbort, ServerClient, make2, exitSchema, isWrapper, make3, Implementation, ClientCapabilities, INVALID_REQUEST_ERROR_CODE, METHOD_NOT_FOUND_ERROR_CODE, INVALID_PARAMS_ERROR_CODE, INTERNAL_ERROR_CODE, HEADER_MISMATCH_ERROR_CODE, ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, McpError, Ping, Initialize, CancelledNotification, ProgressNotification, ResourceListChangedNotification, ResourceUpdatedNotification, Prompt, TextContent, PromptListChangedNotification, Tool, CallToolResult, ToolListChangedNotification, LoggingLevel, LoggingMessageNotification, CreateMessage, ListRootsResult, ListRoots, Elicit, McpReverseOperationUnsupported, McpReverseOperationError, McpRequestContext, McpServerClient, McpServerClientMiddleware, ServerNotificationRpcs, EnabledWhen, mcpUpdateNote2, objectSchema, valuesSchema, emptyInputSchema, sessionSchemaProperty, sessionAliasSchemaProperty, StatusToolOutput, CurrentSessionToolOutput, SessionDeleteToolOutput, NetworkToolOutput, RecordingToolOutput, FlightRecorderToolOutput, agentSettingKeys, SettingsToolOutput, toolOutputJson, executeToolResult, ensureSessionExists, parseExecuteArguments, parseAdoptArguments, requiredStringField, requiredAction, optionalStringField, optionalBooleanField, optionalPositiveIntegerField, optionalStringArrayField, requireObject, toolResultForValue2, mcpErrorMessage2, toolResult };
@@ -4,147 +4,16 @@ import {
4
4
  } from "./main-pmfd055v.mjs";
5
5
  import {
6
6
  opencodeBrowserVersion2
7
- } from "./main-yp8nt4dh.mjs";
8
-
9
- // src/paths.ts
10
- import fs from "node:fs";
11
- import os from "node:os";
12
- import path from "node:path";
13
- import { fileURLToPath } from "node:url";
14
- var override = (home) => home === os.homedir() && process.env.OPENCODE_BROWSER_HOME ? process.env.OPENCODE_BROWSER_HOME : undefined;
15
- var xdgRoot = (variable, fallback, home) => {
16
- const configured = home === os.homedir() ? process.env[variable] : undefined;
17
- return path.join(configured && path.isAbsolute(configured) ? configured : path.join(home, fallback), "browse");
18
- };
19
- function defaultConfigRoot(home = os.homedir()) {
20
- return xdgRoot("XDG_CONFIG_HOME", ".config", home);
21
- }
22
- function defaultRoots(home = os.homedir()) {
23
- return {
24
- config: defaultConfigRoot(home),
25
- data: xdgRoot("XDG_DATA_HOME", ".local/share", home),
26
- state: xdgRoot("XDG_STATE_HOME", ".local/state", home),
27
- cache: xdgRoot("XDG_CACHE_HOME", ".cache", home)
28
- };
29
- }
30
- function configRoot2(home = os.homedir()) {
31
- return override(home) ?? defaultConfigRoot(home);
32
- }
33
- function dataRoot(home = os.homedir()) {
34
- return override(home) ?? xdgRoot("XDG_DATA_HOME", ".local/share", home);
35
- }
36
- function stateRoot(home = os.homedir()) {
37
- return override(home) ?? xdgRoot("XDG_STATE_HOME", ".local/state", home);
38
- }
39
- function cacheRoot(home = os.homedir()) {
40
- return override(home) ?? xdgRoot("XDG_CACHE_HOME", ".cache", home);
41
- }
42
- function installerBinRoot(home = os.homedir()) {
43
- const configured = home === os.homedir() ? process.env.XDG_BIN_HOME : undefined;
44
- return configured && path.isAbsolute(configured) ? configured : path.join(home, ".local", "bin");
45
- }
46
- function binRoot(home = os.homedir()) {
47
- if (override(home))
48
- return path.join(override(home), "bin");
49
- return installerBinRoot(home);
50
- }
51
- var installedBinaryPath = (home = os.homedir()) => path.join(binRoot(home), binaryName());
52
- var installerBinaryPath = (home = os.homedir()) => path.join(installerBinRoot(home), binaryName());
53
- var defaultSettingsPath = (home = os.homedir()) => path.join(defaultConfigRoot(home), "settings.json");
54
- var packageRoot = () => path.dirname(path.dirname(fileURLToPath(import.meta.url)));
55
- var oldStoreMarker = () => path.join(stateRoot(), "old-store-extension");
56
- function fromCheckout() {
57
- return !compiledBinary() && fs.existsSync(path.join(packageRoot(), "src", "main.ts"));
58
- }
59
- var compiledBinary = () => globalThis.__OPENCODE_BROWSER_COMPILED__ === true;
60
- var binaryPackage = () => globalThis.__OPENCODE_BROWSER_TARGET__ ? `@opencode/browse-${globalThis.__OPENCODE_BROWSER_TARGET__}` : undefined;
61
- var binaryName = (platform = process.platform) => platform === "win32" ? "browse.exe" : "browse";
62
- var scriptEntry = (entry) => /\.[cm]?[jt]s$/.test(entry);
63
- var entryCommand = (entry, node = process.execPath) => scriptEntry(entry) ? [node, entry] : [entry];
64
- var windowsShellShim = (entry, pathModule) => /\.(cmd|bat)$/i.test(entry) || pathModule.extname(entry) === "" && !pathModule.isAbsolute(entry) && !/[\\/]/.test(entry);
65
- var npxEntry = (entry) => /(^|\/)_npx\//.test(entry.replaceAll("\\", "/"));
66
- function resolveWindowsShim(entry, node = process.execPath, options = {}) {
67
- const pathModule = options.pathModule ?? path.win32;
68
- const exists = options.existsSync ?? fs.existsSync;
69
- if (!windowsShellShim(entry, pathModule))
70
- return;
71
- const shimmed = /\.(cmd|bat)$/i.test(entry);
72
- const withFolder = shimmed && (pathModule.isAbsolute(entry) || /[\\/]/.test(entry));
73
- const directories = withFolder ? [pathModule.dirname(entry)] : (options.env ?? process.env).PATH?.split(";").map((directory) => directory.trim().replace(/^"(.*)"$/, "$1")).filter(Boolean) ?? [];
74
- for (const directory of directories) {
75
- if (!shimmed) {
76
- const executable = pathModule.join(directory, `${entry}.exe`);
77
- if (exists(executable))
78
- return [executable];
79
- }
80
- const shim = withFolder ? entry : pathModule.join(directory, shimmed ? entry : `${entry}.cmd`);
81
- if (!exists(shim))
82
- continue;
83
- const script = pathModule.join(directory, "node_modules", "@opencode", "browse", "dist", "cli.mjs");
84
- if (exists(script))
85
- return [node, script];
86
- }
87
- return;
88
- }
89
- function entrySpawnCommand(entry, node = process.execPath, options = {}) {
90
- if (scriptEntry(entry))
91
- return [node, entry];
92
- const pathModule = options.pathModule ?? path.win32;
93
- if ((options.platform ?? process.platform) !== "win32" || !windowsShellShim(entry, pathModule))
94
- return [entry];
95
- const resolved = resolveWindowsShim(entry, node, options);
96
- if (resolved)
97
- return resolved;
98
- const running = options.running ?? runningEntry();
99
- const compiled = options.compiled ?? compiledBinary();
100
- const checkout = options.checkout ?? fromCheckout();
101
- return !compiled && !checkout && scriptEntry(running) && !npxEntry(running) ? [node, running] : [entry];
102
- }
103
- function installedBinary() {
104
- const binary = installedBinaryPath();
105
- return fs.existsSync(binary) ? binary : undefined;
106
- }
107
- var runningEntry = () => compiledBinary() ? process.execPath : process.argv[1];
108
- function checkoutRoot() {
109
- return fromCheckout() ? path.dirname(packageRoot()) : undefined;
110
- }
111
- var quoted = (value) => /^[\w@%+=:,./-]+$/.test(value) ? value : JSON.stringify(value);
112
- function cliInstall() {
113
- if (compiledBinary())
114
- return { kind: "binary", binary: installedBinary() ?? process.execPath, pathEnv: process.env.PATH };
115
- if (fromCheckout())
116
- return { kind: "checkout", bundle: path.join(packageRoot(), "dist", "cli.mjs") };
117
- return { kind: "npm", version: "0.0.17-dev.184", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
118
- }
119
- function cliPrefix(install = cliInstall()) {
120
- if (install.kind === "binary") {
121
- const dir = path.dirname(install.binary);
122
- const onPath = (install.pathEnv ?? "").split(path.delimiter).some((entry) => entry && path.resolve(entry) === dir);
123
- return onPath ? "browse" : quoted(install.binary);
124
- }
125
- if (install.kind === "checkout")
126
- return `node ${quoted(install.bundle)}`;
127
- if (install.npx)
128
- return install.version?.includes("-dev.") ? "npx @opencode/browse@dev" : "npx @opencode/browse";
129
- return "browse";
130
- }
131
- var cliCommand = (args, install = cliInstall()) => `${cliPrefix(install)} ${args}`;
132
- var STORE_ITEM_ID = /^[a-p]{32}$/;
133
- var PUBLIC_STORE_ID = "mfnicocicmmlkpjnaffgihfjhdgjkdjg";
134
- function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjhdgjkdjg" }) {
135
- const id = [env.OPENCODE_BROWSER_STORE_ID, baked?.id].find((value) => value && STORE_ITEM_ID.test(value));
136
- return id ? { id } : {};
137
- }
138
- var RELEASE_SERVICE = "https://anoma.ly/release";
139
- function devExtension(baked = { file: "browse-extension-0.0.17-dev.184.zip", sha256: "2c4433c8516f1f8025e3f01d312ae8d2126ec6909708b8a2d79d84f4cd1c01c6", size: 187301 }) {
140
- return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
141
- }
142
- var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
143
- var devExtensionFolder = (root = cacheRoot()) => path.join(root, "extension");
144
- var storeUrl = (id) => `https://chromewebstore.google.com/detail/${id}`;
145
- function installCommand() {
146
- return fromCheckout() ? `cd ${quoted(path.dirname(packageRoot()))} && bun run setup` : cliCommand("install");
147
- }
7
+ } from "./main-xz6gd1xb.mjs";
8
+ import {
9
+ stateRoot,
10
+ fromCheckout,
11
+ compiledBinary,
12
+ entrySpawnCommand,
13
+ installedBinary,
14
+ cliPrefix,
15
+ RELEASE_SERVICE
16
+ } from "./main-wq3rxzcg.mjs";
148
17
 
149
18
  // src/protocol.ts
150
19
  var extensionProtocolVersion = 3;
@@ -262,13 +131,13 @@ function isJsonObject(value) {
262
131
  // src/update/auto-update.ts
263
132
  import { spawn, spawnSync } from "node:child_process";
264
133
  import { chmodSync as chmodSync2, closeSync, existsSync, mkdirSync as mkdirSync2, mkdtempSync, openSync, readFileSync as readFileSync2, renameSync, rmSync, realpathSync, writeFileSync as writeFileSync2 } from "node:fs";
265
- import os2 from "node:os";
266
- import path3 from "node:path";
134
+ import os from "node:os";
135
+ import path2 from "node:path";
267
136
 
268
137
  // src/update/release-service.ts
269
138
  import crypto from "node:crypto";
270
139
  import { chmodSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
271
- import path2 from "node:path";
140
+ import path from "node:path";
272
141
  function serviceTarget(target) {
273
142
  return target.replace(/^darwin-/, "macos-");
274
143
  }
@@ -457,7 +326,7 @@ async function checkRelease(options) {
457
326
  return { status: "manifest", releaseVersion, decision, ...manifest.etag ? { etag: manifest.etag } : {} };
458
327
  }
459
328
  function rolloutBucket(root = stateRoot()) {
460
- const file = path2.join(root, "rollout-bucket");
329
+ const file = path.join(root, "rollout-bucket");
461
330
  try {
462
331
  const saved = Number(readFileSync(file, "utf8").trim());
463
332
  if (Number.isInteger(saved) && saved >= 0 && saved < 100)
@@ -509,7 +378,7 @@ function installKind(entry = process.argv[1] ?? "", checkout = fromCheckout()) {
509
378
  }
510
379
  var packageVersion = (entry) => {
511
380
  try {
512
- const manifest = path3.join(path3.dirname(path3.dirname(entry)), "package.json");
381
+ const manifest = path2.join(path2.dirname(path2.dirname(entry)), "package.json");
513
382
  const version = JSON.parse(readFileSync2(manifest, "utf8")).version;
514
383
  return typeof version === "string" ? version : undefined;
515
384
  } catch {
@@ -537,15 +406,15 @@ function installedRuntime2(entry = process.argv[1] ?? process.execPath) {
537
406
  return { kind, entry: resolved, version: packageVersion(resolved) ?? opencodeBrowserVersion2 };
538
407
  }
539
408
  async function updateTarget(runtime, run = runCommand, env = process.env) {
540
- if (runtime.kind !== "npm" || !insidePath(runtime.entry, path3.join(legacyDataRoot(), "runtime", "versions")))
409
+ if (runtime.kind !== "npm" || !insidePath(runtime.entry, path2.join(legacyDataRoot(), "runtime", "versions")))
541
410
  return runtime;
542
411
  const root = await npmGlobalRoot(run, env);
543
- return root ? { ...runtime, entry: path3.join(root, ...PACKAGE_NAME.split("/"), "dist", "cli.mjs") } : undefined;
412
+ return root ? { ...runtime, entry: path2.join(root, ...PACKAGE_NAME.split("/"), "dist", "cli.mjs") } : undefined;
544
413
  }
545
414
  async function npmGlobalRoot(run = runCommand, env = process.env) {
546
415
  const result = await run("npm", ["root", "-g"], { timeoutMs: 20000, env });
547
416
  const root = result.status === 0 ? result.stdout.trim() : "";
548
- return root && path3.isAbsolute(root) ? root : undefined;
417
+ return root && path2.isAbsolute(root) ? root : undefined;
549
418
  }
550
419
  function installedVersion(runtime) {
551
420
  if (runtime.kind === "binary") {
@@ -554,7 +423,7 @@ function installedVersion(runtime) {
554
423
  }
555
424
  return packageVersion(runtime.entry);
556
425
  }
557
- var autoUpdateStatePath = () => path3.join(stateRoot(), "auto-update.json");
426
+ var autoUpdateStatePath = () => path2.join(stateRoot(), "auto-update.json");
558
427
  function readJson(file) {
559
428
  try {
560
429
  return JSON.parse(readFileSync2(file, "utf8"));
@@ -563,7 +432,7 @@ function readJson(file) {
563
432
  }
564
433
  }
565
434
  function writeJsonAtomic(file, value) {
566
- mkdirSync2(path3.dirname(file), { recursive: true, mode: 448 });
435
+ mkdirSync2(path2.dirname(file), { recursive: true, mode: 448 });
567
436
  const temporary = `${file}.${process.pid}.tmp`;
568
437
  writeFileSync2(temporary, JSON.stringify(value, null, 2) + `
569
438
  `, { mode: 384 });
@@ -640,7 +509,7 @@ function updateAvailable(status) {
640
509
  return status.install === "binary" ? status.latest !== status.version : compareVersions(status.latest, status.version) > 0;
641
510
  }
642
511
  var runCommand = (command, args, options = {}) => new Promise((resolve) => {
643
- const npmCli = process.platform === "win32" && command === "npm" ? path3.join(path3.dirname(process.execPath), "node_modules", "npm", "bin", "npm-cli.js") : undefined;
512
+ const npmCli = process.platform === "win32" && command === "npm" ? path2.join(path2.dirname(process.execPath), "node_modules", "npm", "bin", "npm-cli.js") : undefined;
644
513
  const [file, argv] = npmCli && existsSync(npmCli) ? [process.execPath, [npmCli, ...args]] : [command, args];
645
514
  const child = spawn(file, argv, { env: options.env ?? process.env, stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
646
515
  let stdout = "";
@@ -709,8 +578,8 @@ async function runInstaller(options) {
709
578
  }) : options.installer ?? globalThis.__OPENCODE_BROWSER_INSTALLER__;
710
579
  if (!script)
711
580
  throw new Error("this build has no installer to run; install browse again with the install script");
712
- const directory = mkdtempSync(path3.join(os2.tmpdir(), "browse-install-"));
713
- const file = path3.join(directory, platform === "win32" ? "install.ps1" : "install");
581
+ const directory = mkdtempSync(path2.join(os.tmpdir(), "browse-install-"));
582
+ const file = path2.join(directory, platform === "win32" ? "install.ps1" : "install");
714
583
  const args = [...options.version ? ["--version", options.version] : options.channel ? ["--channel", options.channel] : [], "--no-setup"];
715
584
  try {
716
585
  writeFileSync2(file, script, { mode: platform === "win32" ? 384 : 448 });
@@ -902,9 +771,9 @@ function createAutoUpdater(deps) {
902
771
  }
903
772
  function spawnRuntimeChild(runtime, args, onExit, env = process.env) {
904
773
  const { OPENCODE_BROWSER_MANAGED_RELAY: _managed, OPENCODE_BROWSER_RESTART_REQUEST_ID: _request, ...rest } = env;
905
- const directory = path3.join(stateRoot(), "logs");
774
+ const directory = path2.join(stateRoot(), "logs");
906
775
  mkdirSync2(directory, { recursive: true, mode: 448 });
907
- const log = openSync(path3.join(directory, "auto-update.log"), "a", 384);
776
+ const log = openSync(path2.join(directory, "auto-update.log"), "a", 384);
908
777
  try {
909
778
  const [file, ...prefix] = entrySpawnCommand(runtime.entry);
910
779
  const child = spawn(file, [...prefix, ...args], { detached: true, stdio: ["ignore", log, log], env: rest, windowsHide: true });
@@ -920,4 +789,4 @@ function spawnRuntimeChild(runtime, args, onExit, env = process.env) {
920
789
  }
921
790
  }
922
791
 
923
- export { defaultRoots, configRoot2, dataRoot, stateRoot, cacheRoot, binRoot, installedBinaryPath, installerBinaryPath, defaultSettingsPath, oldStoreMarker, fromCheckout, compiledBinary, binaryPackage, binaryName, scriptEntry, entryCommand, resolveWindowsShim, entrySpawnCommand, runningEntry, checkoutRoot, cliCommand, PUBLIC_STORE_ID, storeConfig, devExtension, devExtensionUrl, devExtensionFolder, storeUrl, installCommand, extensionProtocolVersion, minExtensionProtocolVersion, unpackedExtensionId, browserUnresponsive, browserReloading, unpackedReloadAdvice, checkoutReloadPrefix, extensionReconnectAlarmPeriodMs, extensionProtocolCompatibility, extensionProtocolSkew, extensionProtocolAdvice, makePageStatus, parseJsonObject, isCdpRequest, isExtensionResponse, isExtensionEvent, isJsonObject, runningServiceTarget, releaseChannel, checkRelease, autoUpdateModes, UPDATE_VERSION, channelOf, compareVersions, installedRuntime2, updateTarget, npmGlobalRoot, installedVersion, updateState, autoUpdateOverride, storedMode, effectiveMode, setStoredMode, autoUpdateStatus, describeAutoUpdate, updateAvailable, runCommand, registryUrl, fetchPublished, runInstaller, createAutoUpdater };
792
+ export { extensionProtocolVersion, minExtensionProtocolVersion, unpackedExtensionId, browserUnresponsive, browserReloading, unpackedReloadAdvice, checkoutReloadPrefix, extensionReconnectAlarmPeriodMs, extensionProtocolCompatibility, extensionProtocolSkew, extensionProtocolAdvice, makePageStatus, parseJsonObject, isCdpRequest, isExtensionResponse, isExtensionEvent, isJsonObject, runningServiceTarget, releaseChannel, checkRelease, autoUpdateModes, UPDATE_VERSION, channelOf, compareVersions, installedRuntime2, updateTarget, npmGlobalRoot, installedVersion, updateState, autoUpdateOverride, storedMode, effectiveMode, setStoredMode, autoUpdateStatus, describeAutoUpdate, updateAvailable, runCommand, registryUrl, fetchPublished, runInstaller, createAutoUpdater };
@@ -1,6 +1,21 @@
1
1
  import {
2
2
  opencodeBrowserVersion2
3
- } from "./main-yp8nt4dh.mjs";
3
+ } from "./main-xz6gd1xb.mjs";
4
+ import {
5
+ unpackedExtensionId,
6
+ npmGlobalRoot,
7
+ installedVersion,
8
+ runCommand
9
+ } from "./main-7y134fzj.mjs";
10
+ import {
11
+ writeStdout
12
+ } from "./main-tk4axre7.mjs";
13
+ import {
14
+ defaultPort2
15
+ } from "./main-ns026dfw.mjs";
16
+ import {
17
+ formatPairingCode
18
+ } from "./main-vw7jwd0n.mjs";
4
19
  import {
5
20
  configRoot2,
6
21
  dataRoot,
@@ -17,21 +32,8 @@ import {
17
32
  storeConfig,
18
33
  devExtension,
19
34
  devExtensionFolder,
20
- storeUrl,
21
- unpackedExtensionId,
22
- npmGlobalRoot,
23
- installedVersion,
24
- runCommand
25
- } from "./main-pweq8vqv.mjs";
26
- import {
27
- writeStdout
28
- } from "./main-tk4axre7.mjs";
29
- import {
30
- defaultPort2
31
- } from "./main-a65k2jvs.mjs";
32
- import {
33
- formatPairingCode
34
- } from "./main-wk9g7869.mjs";
35
+ storeUrl
36
+ } from "./main-wq3rxzcg.mjs";
35
37
  import {
36
38
  __toESM,
37
39
  __commonJS,
@@ -86,7 +86,7 @@ import {
86
86
  mapBothEager,
87
87
  flatMapEager,
88
88
  fnUntracedEager
89
- } from "./main-m45zegrn.mjs";
89
+ } from "./main-0h387a1q.mjs";
90
90
 
91
91
  // node_modules/effect/dist/Data.js
92
92
  var Class = class extends Class3 {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  writePrivateJsonFileSync,
3
3
  defaultPort2
4
- } from "./main-a65k2jvs.mjs";
4
+ } from "./main-ns026dfw.mjs";
5
5
  import {
6
6
  stateRoot
7
- } from "./main-pweq8vqv.mjs";
7
+ } from "./main-wq3rxzcg.mjs";
8
8
 
9
9
  // src/relay/port.ts
10
10
  import fs from "node:fs";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ensurePrivateDirectorySync
3
- } from "./main-a65k2jvs.mjs";
3
+ } from "./main-ns026dfw.mjs";
4
4
  import {
5
5
  dataRoot
6
- } from "./main-pweq8vqv.mjs";
6
+ } from "./main-wq3rxzcg.mjs";
7
7
 
8
8
  // src/relay/secrets.ts
9
9
  import crypto from "node:crypto";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  writePrivateJsonFileSync
3
- } from "./main-a65k2jvs.mjs";
3
+ } from "./main-ns026dfw.mjs";
4
4
  import {
5
5
  bundledPairingCodeTtlMs,
6
6
  mintPairingCode,
7
7
  writeExtensionPairing
8
- } from "./main-wk9g7869.mjs";
8
+ } from "./main-vw7jwd0n.mjs";
9
9
  import {
10
10
  configRoot2,
11
11
  cacheRoot,
12
12
  devExtensionUrl,
13
13
  devExtensionFolder
14
- } from "./main-pweq8vqv.mjs";
14
+ } from "./main-wq3rxzcg.mjs";
15
15
 
16
16
  // src/setup/dev-extension.ts
17
17
  import { createHash } from "node:crypto";