@opencode/browse 0.0.9-dev.49 → 0.0.9-dev.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cli-yrjyft4m.mjs → cli-2s0kbpd0.mjs} +10 -9
- package/dist/cli.mjs +9 -9
- package/dist/{helpers-8bew9zx6.mjs → helpers-k6ssr91j.mjs} +2 -2
- package/dist/{main-10xd16tq.mjs → main-18562erp.mjs} +2 -2
- package/dist/{main-mdvkc05f.mjs → main-4enbz1sk.mjs} +25 -7
- package/dist/main-4k77gxd5.mjs +4 -0
- package/dist/{main-cctvx210.mjs → main-5e282683.mjs} +2 -2
- package/dist/{main-30jfvc54.mjs → main-b1w24bkh.mjs} +3 -3
- package/dist/{main-82n18wqt.mjs → main-dvpyp93v.mjs} +3 -3
- package/dist/{main-x4n2ygmq.mjs → main-mka4cjme.mjs} +2 -2
- package/dist/{main-6wbv6r89.mjs → main-verf0stx.mjs} +1 -1
- package/dist/{mcp-mb6w6k32.mjs → mcp-veqqzr8c.mjs} +6 -6
- package/dist/{relay-y0s3q0ww.mjs → relay-5vygepa3.mjs} +8 -8
- package/dist/{runtime-update-y96cb23k.mjs → runtime-update-cwthq9r4.mjs} +4 -4
- package/dist/{setup-k9ej74b8.mjs → setup-5ecdk44a.mjs} +88 -18
- package/dist/{supervisor-etb7z5ey.mjs → supervisor-ervana3e.mjs} +3 -3
- package/dist/{update-bqbd38e8.mjs → update-jzteb8ea.mjs} +3 -3
- package/dist/{version-rc3q2c66.mjs → version-1wnzkqza.mjs} +1 -1
- package/package.json +1 -1
- package/dist/main-9n6hhjy2.mjs +0 -4
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
import {
|
|
106
106
|
opencodeBrowserVersion2,
|
|
107
107
|
opencodeBrowserBuildId2
|
|
108
|
-
} from "./main-
|
|
108
|
+
} from "./main-4k77gxd5.mjs";
|
|
109
109
|
import {
|
|
110
110
|
dataRoot,
|
|
111
111
|
fromCheckout,
|
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
devExtension,
|
|
116
116
|
installCommand,
|
|
117
117
|
autoUpdateStatus
|
|
118
|
-
} from "./main-
|
|
118
|
+
} from "./main-5e282683.mjs";
|
|
119
119
|
import {
|
|
120
120
|
extensionProtocolVersion,
|
|
121
121
|
extensionProtocolAdvice
|
|
@@ -141,13 +141,13 @@ import {
|
|
|
141
141
|
ensureExtensionConnected,
|
|
142
142
|
stoppedRelayStatus,
|
|
143
143
|
statusCollections
|
|
144
|
-
} from "./main-
|
|
145
|
-
import"./main-
|
|
144
|
+
} from "./main-4enbz1sk.mjs";
|
|
145
|
+
import"./main-verf0stx.mjs";
|
|
146
146
|
import {
|
|
147
147
|
updateJson2,
|
|
148
148
|
formatUpdateNotice2,
|
|
149
149
|
updateNotice2
|
|
150
|
-
} from "./main-
|
|
150
|
+
} from "./main-18562erp.mjs";
|
|
151
151
|
import {
|
|
152
152
|
settingKeys,
|
|
153
153
|
formatSettings,
|
|
@@ -155,12 +155,12 @@ import {
|
|
|
155
155
|
addSecret,
|
|
156
156
|
listSecrets,
|
|
157
157
|
removeSecret
|
|
158
|
-
} from "./main-
|
|
158
|
+
} from "./main-dvpyp93v.mjs";
|
|
159
159
|
import {
|
|
160
160
|
defaultJournalBaseDir,
|
|
161
161
|
readJournalEntries,
|
|
162
162
|
formatJournalEntry
|
|
163
|
-
} from "./main-
|
|
163
|
+
} from "./main-b1w24bkh.mjs";
|
|
164
164
|
import {
|
|
165
165
|
pipeArguments,
|
|
166
166
|
dual,
|
|
@@ -5540,6 +5540,7 @@ var exitWith = (code) => sync2(() => {
|
|
|
5540
5540
|
});
|
|
5541
5541
|
var hostErrorTags = new Set([
|
|
5542
5542
|
"RelayClient.RelayUnreachable",
|
|
5543
|
+
"RelayClient.RelayTimedOut",
|
|
5543
5544
|
"RelayLifecycle.RelayStartFailed",
|
|
5544
5545
|
"RelayLifecycle.ExtensionDisconnected"
|
|
5545
5546
|
]);
|
|
@@ -5855,7 +5856,7 @@ var status = make("status", {
|
|
|
5855
5856
|
}
|
|
5856
5857
|
})).pipe(withDescription4("Show relay, extension, and target status"));
|
|
5857
5858
|
var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
|
|
5858
|
-
const { runMcpServer } = yield* promise(() => import("./mcp-
|
|
5859
|
+
const { runMcpServer } = yield* promise(() => import("./mcp-veqqzr8c.mjs"));
|
|
5859
5860
|
yield* runMcpServer;
|
|
5860
5861
|
})).pipe(withDescription4("Run the browse MCP server over stdio"));
|
|
5861
5862
|
registerCliCommand(400, () => tabs);
|
|
@@ -6303,7 +6304,7 @@ registerCliCommand(710, () => flightRecorder);
|
|
|
6303
6304
|
|
|
6304
6305
|
// src/cli/relay.ts
|
|
6305
6306
|
var serve = make("serve", {}, fn("Cli.serve")(function* () {
|
|
6306
|
-
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-
|
|
6307
|
+
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-5vygepa3.mjs"), import("./helpers-k6ssr91j.mjs")]));
|
|
6307
6308
|
const port = yield* portConfig;
|
|
6308
6309
|
const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
|
|
6309
6310
|
yield* scoped(gen(function* () {
|
package/dist/cli.mjs
CHANGED
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
// src/main.ts
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
var embeddedVersion = "0.0.9-dev.
|
|
5
|
+
var embeddedVersion = "0.0.9-dev.53";
|
|
6
6
|
var setupCommands = new Set(["install", "uninstall", "extension", "pair", "rollback", "set"]);
|
|
7
7
|
var command = process.argv[2];
|
|
8
8
|
var invokedAs = path.basename(process.argv[1] ?? "");
|
|
9
9
|
if (command === "--version" || command === "-v") {
|
|
10
|
-
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-
|
|
10
|
+
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-1wnzkqza.mjs")).opencodeBrowserVersion;
|
|
11
11
|
process.stdout.write(`${opencodeBrowserVersion}
|
|
12
12
|
`);
|
|
13
13
|
} else if (command === "mcp" && globalThis.__OPENCODE_BROWSER_COMPILED__ && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1") {
|
|
14
|
-
const { runBinaryMcp } = await import("./supervisor-
|
|
14
|
+
const { runBinaryMcp } = await import("./supervisor-ervana3e.mjs");
|
|
15
15
|
await runBinaryMcp(process.argv.slice(3));
|
|
16
16
|
} else if (invokedAs === "opencode-browser-mcp" || command === "mcp" && process.argv.length === 3) {
|
|
17
17
|
const { NodeRuntime } = await import("./index-8v65jg3n.mjs");
|
|
18
|
-
const { runMcpServer } = await import("./mcp-
|
|
18
|
+
const { runMcpServer } = await import("./mcp-veqqzr8c.mjs");
|
|
19
19
|
runMcpServer.pipe(NodeRuntime.runMain);
|
|
20
20
|
} else if (command === "runtime-install" || command === "runtime-switch") {
|
|
21
|
-
const { runRuntimeInstall, runRuntimeSwitch } = await import("./runtime-update-
|
|
21
|
+
const { runRuntimeInstall, runRuntimeSwitch } = await import("./runtime-update-cwthq9r4.mjs");
|
|
22
22
|
await (command === "runtime-install" ? runRuntimeInstall : runRuntimeSwitch)(process.argv.slice(3));
|
|
23
23
|
} else if (command === "update") {
|
|
24
|
-
const { runUpdateCommand } = await import("./update-
|
|
24
|
+
const { runUpdateCommand } = await import("./update-jzteb8ea.mjs");
|
|
25
25
|
await runUpdateCommand(process.argv.slice(3));
|
|
26
26
|
} else if (command && setupCommands.has(command)) {
|
|
27
|
-
const { runSetup } = await import("./setup-
|
|
27
|
+
const { runSetup } = await import("./setup-5ecdk44a.mjs");
|
|
28
28
|
await runSetup(command, process.argv.slice(3));
|
|
29
29
|
} else {
|
|
30
30
|
if (!command || command === "--help" || command === "-h") {
|
|
@@ -59,9 +59,9 @@ if (command === "--version" || command === "-v") {
|
|
|
59
59
|
`);
|
|
60
60
|
}
|
|
61
61
|
if (command === "status" && !process.argv.includes("--json")) {
|
|
62
|
-
const { printSetupStatus } = await import("./setup-
|
|
62
|
+
const { printSetupStatus } = await import("./setup-5ecdk44a.mjs");
|
|
63
63
|
printSetupStatus();
|
|
64
64
|
}
|
|
65
|
-
const { runCli } = await import("./cli-
|
|
65
|
+
const { runCli } = await import("./cli-2s0kbpd0.mjs");
|
|
66
66
|
runCli();
|
|
67
67
|
}
|
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
isRestrictedTarget2,
|
|
32
32
|
isRestrictedUrl2,
|
|
33
33
|
dataUrlDocument2
|
|
34
|
-
} from "./main-
|
|
35
|
-
import"./main-
|
|
34
|
+
} from "./main-4enbz1sk.mjs";
|
|
35
|
+
import"./main-verf0stx.mjs";
|
|
36
36
|
import"./main-3gthmkzw.mjs";
|
|
37
37
|
export {
|
|
38
38
|
HttpRouteError2 as HttpRouteError,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
compareVersions,
|
|
7
7
|
npmRuntime,
|
|
8
8
|
autoUpdateStatus
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-5e282683.mjs";
|
|
10
10
|
import {
|
|
11
11
|
unpackedReloadAdvice
|
|
12
12
|
} from "./main-3gthmkzw.mjs";
|
|
@@ -315,7 +315,7 @@ function runUpdate(args, deps) {
|
|
|
315
315
|
async function runUpdateCommand2(args) {
|
|
316
316
|
const log = (line) => process.stdout.write(line + `
|
|
317
317
|
`);
|
|
318
|
-
const { runNpmUpdate } = await import("./runtime-update-
|
|
318
|
+
const { runNpmUpdate } = await import("./runtime-update-cwthq9r4.mjs");
|
|
319
319
|
if (await runNpmUpdate(args))
|
|
320
320
|
return;
|
|
321
321
|
if (compiledBinary()) {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./main-3gthmkzw.mjs";
|
|
7
7
|
import {
|
|
8
8
|
relayAuthorization
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-verf0stx.mjs";
|
|
10
10
|
import {
|
|
11
11
|
assignProperty,
|
|
12
12
|
PipeInspectableProto,
|
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
try_,
|
|
40
40
|
fromResult,
|
|
41
41
|
flatMap3,
|
|
42
|
+
andThen,
|
|
42
43
|
result,
|
|
43
44
|
map5,
|
|
44
45
|
catch_,
|
|
@@ -47,6 +48,10 @@ import {
|
|
|
47
48
|
orDie,
|
|
48
49
|
tapError,
|
|
49
50
|
retry,
|
|
51
|
+
timeoutOrElse,
|
|
52
|
+
sleep,
|
|
53
|
+
raceFirst,
|
|
54
|
+
forever,
|
|
50
55
|
fnUntraced,
|
|
51
56
|
fn,
|
|
52
57
|
mapEager,
|
|
@@ -103,14 +108,14 @@ import {
|
|
|
103
108
|
} from "./main-ta3yc4kx.mjs";
|
|
104
109
|
import {
|
|
105
110
|
opencodeBrowserBuildId2
|
|
106
|
-
} from "./main-
|
|
111
|
+
} from "./main-4k77gxd5.mjs";
|
|
107
112
|
import {
|
|
108
113
|
compiledBinary,
|
|
109
114
|
scriptEntry,
|
|
110
115
|
cliCommand,
|
|
111
116
|
installCommand,
|
|
112
117
|
npmRuntime
|
|
113
|
-
} from "./main-
|
|
118
|
+
} from "./main-5e282683.mjs";
|
|
114
119
|
import {
|
|
115
120
|
dual,
|
|
116
121
|
memoize,
|
|
@@ -1299,7 +1304,7 @@ async function dataUrlDocument2(url) {
|
|
|
1299
1304
|
}
|
|
1300
1305
|
|
|
1301
1306
|
// src/relay/lifecycle.ts
|
|
1302
|
-
import { spawn } from "node:child_process";
|
|
1307
|
+
import { execFileSync, spawn } from "node:child_process";
|
|
1303
1308
|
import crypto2 from "node:crypto";
|
|
1304
1309
|
import path from "node:path";
|
|
1305
1310
|
import process2 from "node:process";
|
|
@@ -1325,6 +1330,9 @@ class RelayRejected extends TaggedError2()("RelayClient.RelayRejected", {
|
|
|
1325
1330
|
}) {
|
|
1326
1331
|
}
|
|
1327
1332
|
|
|
1333
|
+
class RelayTimedOut extends TaggedError2()("RelayClient.RelayTimedOut", { message: String3, path: String3 }) {
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1328
1336
|
class RelayDecodeFailed extends TaggedError2()("RelayClient.RelayDecodeFailed", {
|
|
1329
1337
|
message: String3,
|
|
1330
1338
|
path: String3,
|
|
@@ -1394,12 +1402,16 @@ var make3 = fn("RelayClient.make")(function* (options) {
|
|
|
1394
1402
|
const authorized = setHeader(request, "authorization", authorization);
|
|
1395
1403
|
return options?.clientPid === undefined ? authorized : setHeader(authorized, "opencode-browser-client-pid", String(options.clientPid));
|
|
1396
1404
|
};
|
|
1397
|
-
const getJson = (path, schema) => suspend2(() => httpClient.execute(authorize(get2(new URL(path, endpoint))))).pipe(mapError(transportError(path)), flatMap3((response) => handleResponse(response, path, schema)))
|
|
1405
|
+
const getJson = (path, schema) => suspend2(() => httpClient.execute(authorize(get2(new URL(path, endpoint))))).pipe(mapError(transportError(path)), flatMap3((response) => handleResponse(response, path, schema)), timeoutOrElse({ duration: 5000, orElse: () => fail4(new RelayTimedOut({
|
|
1406
|
+
message: `The relay on port ${new URL(endpoint).port} isn't answering (${path} timed out).`,
|
|
1407
|
+
path
|
|
1408
|
+
})) }));
|
|
1409
|
+
const checkWhileWaiting = sleep(30000).pipe(andThen(getJson("/version", RelayVersion)), forever);
|
|
1398
1410
|
const postJson = (path, body, schema) => post(new URL(path, endpoint)).pipe(bodyJson(body), mapError((cause) => new RelayEncodeFailed({
|
|
1399
1411
|
message: `Could not encode relay request for ${path}`,
|
|
1400
1412
|
path,
|
|
1401
1413
|
cause
|
|
1402
|
-
})), flatMap3((request) => httpClient.execute(authorize(request)).pipe(mapError(transportError(path)), flatMap3((response) => handleResponse(response, path, schema)))));
|
|
1414
|
+
})), flatMap3((request) => httpClient.execute(authorize(request)).pipe(mapError(transportError(path)), flatMap3((response) => handleResponse(response, path, schema)), raceFirst(checkWhileWaiting))));
|
|
1403
1415
|
const recordingTargetBody = (target) => ({
|
|
1404
1416
|
...target.sessionId ? { sessionId: target.sessionId } : {},
|
|
1405
1417
|
...target.tabId === undefined ? {} : { tabId: target.tabId }
|
|
@@ -1690,10 +1702,16 @@ function startManagedRelay(entrypoint = loadedCliEntrypoint, executable = proces
|
|
|
1690
1702
|
}
|
|
1691
1703
|
const launch = managedRelayLaunch(entrypoint, executable, execArgv);
|
|
1692
1704
|
const { OPENCODE_BROWSER_RESTART_REQUEST_ID: _inheritedRestartRequestId, ...env } = relayEnvironment(process2.env);
|
|
1705
|
+
const childEnv = { ...env, OPENCODE_BROWSER_MANAGED_RELAY: "1", ...options.restartRequestId ? { OPENCODE_BROWSER_RESTART_REQUEST_ID: options.restartRequestId } : {} };
|
|
1706
|
+
if (process2.platform === "win32") {
|
|
1707
|
+
const args = launch.args.map((s) => `"${s.replace(/(\\*)"/g, "$1$1\\\"").replace(/(\\+)$/, "$1$1")}"`).join(" ");
|
|
1708
|
+
execFileSync(path.join(process2.env.SystemRoot, "System32/WindowsPowerShell/v1.0/powershell.exe"), ["-NoProfile", "-NonInteractive", "-Command", "Start-Process -ErrorAction Stop -WindowStyle Hidden -FilePath $env:BROWSE_EXE -ArgumentList $env:BROWSE_ARGS"], { env: { ...childEnv, BROWSE_EXE: launch.executable, BROWSE_ARGS: args }, windowsHide: true, stdio: "ignore" });
|
|
1709
|
+
return;
|
|
1710
|
+
}
|
|
1693
1711
|
const child = spawn(launch.executable, launch.args, {
|
|
1694
1712
|
detached: true,
|
|
1695
1713
|
stdio: "ignore",
|
|
1696
|
-
env:
|
|
1714
|
+
env: childEnv
|
|
1697
1715
|
});
|
|
1698
1716
|
child.unref();
|
|
1699
1717
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-4k77gxd5.mjs";
|
|
4
4
|
|
|
5
5
|
// src/update/auto-update.ts
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
@@ -70,7 +70,7 @@ function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjh
|
|
|
70
70
|
return id ? { id } : {};
|
|
71
71
|
}
|
|
72
72
|
var RELEASE_SERVICE = "https://anoma.ly/release";
|
|
73
|
-
function devExtension(baked = { file: "browse-extension-0.0.9-dev.
|
|
73
|
+
function devExtension(baked = { file: "browse-extension-0.0.9-dev.53.zip", sha256: "2ea79660726849e5be0bb0c54f4c76eabfbe3e3582739efcfd7a9e31dc01c7f8", size: 184272 }) {
|
|
74
74
|
return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
|
|
75
75
|
}
|
|
76
76
|
var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isNodeError
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-verf0stx.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isValidSessionId2
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-4enbz1sk.mjs";
|
|
7
7
|
import {
|
|
8
8
|
isSome,
|
|
9
9
|
decodeUnknownOption,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./main-ta3yc4kx.mjs";
|
|
18
18
|
import {
|
|
19
19
|
dataRoot
|
|
20
|
-
} from "./main-
|
|
20
|
+
} from "./main-5e282683.mjs";
|
|
21
21
|
|
|
22
22
|
// src/session-manager/journal.ts
|
|
23
23
|
import fs from "node:fs";
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
parseTargetSelection2,
|
|
3
3
|
getObject2,
|
|
4
4
|
getString2
|
|
5
|
-
} from "./main-
|
|
5
|
+
} from "./main-4enbz1sk.mjs";
|
|
6
6
|
import {
|
|
7
7
|
isNodeError,
|
|
8
8
|
writeJsonFileAtomically
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-verf0stx.mjs";
|
|
10
10
|
import {
|
|
11
11
|
getStackTraceLimit,
|
|
12
12
|
setStackTraceLimit,
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
import {
|
|
106
106
|
dataRoot,
|
|
107
107
|
cliCommand
|
|
108
|
-
} from "./main-
|
|
108
|
+
} from "./main-5e282683.mjs";
|
|
109
109
|
import {
|
|
110
110
|
pipeArguments,
|
|
111
111
|
identity,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePrivateJsonFileSync
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-verf0stx.mjs";
|
|
4
4
|
import {
|
|
5
5
|
dataRoot,
|
|
6
6
|
devExtensionUrl,
|
|
7
7
|
devExtensionFolder
|
|
8
|
-
} from "./main-
|
|
8
|
+
} from "./main-5e282683.mjs";
|
|
9
9
|
|
|
10
10
|
// src/relay/browser-pairing.ts
|
|
11
11
|
import crypto from "node:crypto";
|
|
@@ -258,10 +258,10 @@ import {
|
|
|
258
258
|
} from "./main-ta3yc4kx.mjs";
|
|
259
259
|
import {
|
|
260
260
|
opencodeBrowserVersion2
|
|
261
|
-
} from "./main-
|
|
261
|
+
} from "./main-4k77gxd5.mjs";
|
|
262
262
|
import {
|
|
263
263
|
autoUpdateStatus
|
|
264
|
-
} from "./main-
|
|
264
|
+
} from "./main-5e282683.mjs";
|
|
265
265
|
import"./main-3gthmkzw.mjs";
|
|
266
266
|
import {
|
|
267
267
|
option,
|
|
@@ -272,12 +272,12 @@ import {
|
|
|
272
272
|
relayBuildProblem,
|
|
273
273
|
ensureRelay,
|
|
274
274
|
ensureExtensionConnected
|
|
275
|
-
} from "./main-
|
|
276
|
-
import"./main-
|
|
275
|
+
} from "./main-4enbz1sk.mjs";
|
|
276
|
+
import"./main-verf0stx.mjs";
|
|
277
277
|
import {
|
|
278
278
|
updateJson2,
|
|
279
279
|
createUpdateWatcher2
|
|
280
|
-
} from "./main-
|
|
280
|
+
} from "./main-18562erp.mjs";
|
|
281
281
|
import {
|
|
282
282
|
makeUnsafe,
|
|
283
283
|
make,
|
|
@@ -350,7 +350,7 @@ import {
|
|
|
350
350
|
mcpErrorMessage2,
|
|
351
351
|
toolResult,
|
|
352
352
|
listSecrets
|
|
353
|
-
} from "./main-
|
|
353
|
+
} from "./main-dvpyp93v.mjs";
|
|
354
354
|
import {
|
|
355
355
|
Clock,
|
|
356
356
|
type,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2,
|
|
3
3
|
opencodeBrowserBuildId2
|
|
4
|
-
} from "./main-
|
|
4
|
+
} from "./main-4k77gxd5.mjs";
|
|
5
5
|
import {
|
|
6
6
|
dataRoot,
|
|
7
7
|
oldStoreMarker,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
setStoredMode,
|
|
20
20
|
autoUpdateStatus,
|
|
21
21
|
createAutoUpdater
|
|
22
|
-
} from "./main-
|
|
22
|
+
} from "./main-5e282683.mjs";
|
|
23
23
|
import {
|
|
24
24
|
extensionProtocolVersion,
|
|
25
25
|
minExtensionProtocolVersion,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
relayToken,
|
|
44
44
|
secretsEqual,
|
|
45
45
|
ensurePrivateDirectory
|
|
46
|
-
} from "./main-
|
|
46
|
+
} from "./main-verf0stx.mjs";
|
|
47
47
|
import {
|
|
48
48
|
withDefault,
|
|
49
49
|
option,
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
isRestrictedTarget2,
|
|
98
98
|
isRestrictedUrl2,
|
|
99
99
|
dataUrlDocument2
|
|
100
|
-
} from "./main-
|
|
100
|
+
} from "./main-4enbz1sk.mjs";
|
|
101
101
|
import {
|
|
102
102
|
relayHostname,
|
|
103
103
|
isLocalPeer,
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
wrapToken,
|
|
120
120
|
installedDevExtension,
|
|
121
121
|
syncDevExtension
|
|
122
|
-
} from "./main-
|
|
122
|
+
} from "./main-mka4cjme.mjs";
|
|
123
123
|
import {
|
|
124
124
|
makeUnsafe,
|
|
125
125
|
SettingsInputError,
|
|
@@ -147,16 +147,16 @@ import {
|
|
|
147
147
|
checkNavigationUrl,
|
|
148
148
|
readSecret,
|
|
149
149
|
secretText
|
|
150
|
-
} from "./main-
|
|
150
|
+
} from "./main-dvpyp93v.mjs";
|
|
151
151
|
import {
|
|
152
152
|
defaultJournalBaseDir,
|
|
153
153
|
makeJournalEntry,
|
|
154
154
|
appendJournalEntry,
|
|
155
155
|
startJournalRetention
|
|
156
|
-
} from "./main-
|
|
156
|
+
} from "./main-b1w24bkh.mjs";
|
|
157
157
|
import {
|
|
158
158
|
createUpdateWatcher2
|
|
159
|
-
} from "./main-
|
|
159
|
+
} from "./main-18562erp.mjs";
|
|
160
160
|
import {
|
|
161
161
|
isNone,
|
|
162
162
|
isSome,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-4k77gxd5.mjs";
|
|
2
2
|
import {
|
|
3
3
|
cliCommand,
|
|
4
4
|
installCommand,
|
|
@@ -18,15 +18,15 @@ import {
|
|
|
18
18
|
installVersion,
|
|
19
19
|
pruneVersions,
|
|
20
20
|
switchVersion
|
|
21
|
-
} from "./main-
|
|
21
|
+
} from "./main-5e282683.mjs";
|
|
22
22
|
import"./main-3gthmkzw.mjs";
|
|
23
23
|
import {
|
|
24
24
|
Service,
|
|
25
25
|
layerFetch,
|
|
26
26
|
restartRelay,
|
|
27
27
|
startManagedRelay
|
|
28
|
-
} from "./main-
|
|
29
|
-
import"./main-
|
|
28
|
+
} from "./main-4enbz1sk.mjs";
|
|
29
|
+
import"./main-verf0stx.mjs";
|
|
30
30
|
import {
|
|
31
31
|
succeed6,
|
|
32
32
|
suspend2,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
opencodeBrowserVersion2
|
|
3
|
-
|
|
2
|
+
opencodeBrowserVersion2,
|
|
3
|
+
opencodeBrowserBuildId2
|
|
4
|
+
} from "./main-4k77gxd5.mjs";
|
|
4
5
|
import {
|
|
5
6
|
dataRoot,
|
|
6
7
|
oldStoreMarker,
|
|
@@ -25,10 +26,10 @@ import {
|
|
|
25
26
|
installVersion,
|
|
26
27
|
pruneVersions,
|
|
27
28
|
switchVersion
|
|
28
|
-
} from "./main-
|
|
29
|
+
} from "./main-5e282683.mjs";
|
|
29
30
|
import {
|
|
30
31
|
relayAuthorization
|
|
31
|
-
} from "./main-
|
|
32
|
+
} from "./main-verf0stx.mjs";
|
|
32
33
|
import {
|
|
33
34
|
parseHostname,
|
|
34
35
|
readRelayConfig,
|
|
@@ -45,7 +46,7 @@ import {
|
|
|
45
46
|
legacyPairingCode,
|
|
46
47
|
removeLegacyPairingCode,
|
|
47
48
|
syncDevExtension
|
|
48
|
-
} from "./main-
|
|
49
|
+
} from "./main-mka4cjme.mjs";
|
|
49
50
|
import {
|
|
50
51
|
unpackedExtensionId,
|
|
51
52
|
extensionProtocolSkew,
|
|
@@ -11153,14 +11154,14 @@ function launcher(browser) {
|
|
|
11153
11154
|
// src/setup/commands.ts
|
|
11154
11155
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
11155
11156
|
import { randomUUID } from "node:crypto";
|
|
11156
|
-
import { existsSync as existsSync5, mkdirSync as mkdirSync3, readdirSync as readdirSync3, rmSync as rmSync3 } from "node:fs";
|
|
11157
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync3, readdirSync as readdirSync3, readFileSync as readFileSync5, rmSync as rmSync3 } from "node:fs";
|
|
11157
11158
|
import { networkInterfaces } from "node:os";
|
|
11158
11159
|
import path6 from "node:path";
|
|
11159
11160
|
import { createInterface as createInterface2 } from "node:readline/promises";
|
|
11160
11161
|
|
|
11161
11162
|
// src/setup/binary.ts
|
|
11162
11163
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
11163
|
-
import { existsSync as existsSync3, mkdirSync, readdirSync as readdirSync2, readFileSync as readFileSync3, rmSync, statSync, writeFileSync } from "node:fs";
|
|
11164
|
+
import { existsSync as existsSync3, mkdirSync, readdirSync as readdirSync2, readFileSync as readFileSync3, rmdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
11164
11165
|
import path4 from "node:path";
|
|
11165
11166
|
async function installBinaryRuntime() {
|
|
11166
11167
|
const binary = process.execPath;
|
|
@@ -11291,14 +11292,21 @@ ${block}`, `
|
|
|
11291
11292
|
}
|
|
11292
11293
|
}
|
|
11293
11294
|
}
|
|
11294
|
-
|
|
11295
|
-
rmSync(binary, { force: true });
|
|
11296
|
-
if (readdirSync2(dir).length === 0)
|
|
11297
|
-
rmSync(dir, { recursive: true, force: true });
|
|
11295
|
+
if (!existsSync3(dir))
|
|
11298
11296
|
return;
|
|
11299
|
-
|
|
11300
|
-
|
|
11297
|
+
const prefix = path4.basename(binary) + ".old-";
|
|
11298
|
+
const stale = process.platform !== "win32" ? [] : readdirSync2(dir).filter((name) => name.startsWith(prefix) && /^(?:[a-f\d]{8}|\d{13})$/i.test(name.slice(prefix.length)));
|
|
11299
|
+
const left = [];
|
|
11300
|
+
for (const file of [binary, ...stale.map((name) => path4.join(dir, name))]) {
|
|
11301
|
+
try {
|
|
11302
|
+
rmSync(file, { force: true });
|
|
11303
|
+
} catch {
|
|
11304
|
+
left.push(file);
|
|
11305
|
+
}
|
|
11301
11306
|
}
|
|
11307
|
+
if (readdirSync2(dir).length === 0)
|
|
11308
|
+
rmdirSync(dir);
|
|
11309
|
+
return left.length ? left.join(", ") : undefined;
|
|
11302
11310
|
}
|
|
11303
11311
|
|
|
11304
11312
|
// src/setup/guidance.ts
|
|
@@ -11523,7 +11531,7 @@ function ensureRelay(entry) {
|
|
|
11523
11531
|
timeout: 30000
|
|
11524
11532
|
});
|
|
11525
11533
|
if (started.status !== 0)
|
|
11526
|
-
fail(`Couldn't
|
|
11534
|
+
fail(started.stderr?.trim() || `Couldn't reach the browse relay: ${started.error?.message || `run ${cliCommand("doctor")}`}`);
|
|
11527
11535
|
}
|
|
11528
11536
|
var extensionStatus = (installWaiting = false) => fetch(`${relayBase()}/extension/status`, {
|
|
11529
11537
|
headers: { ...relayHeaders(), ...installWaiting ? { "x-browse-install": "waiting" } : {} },
|
|
@@ -11725,8 +11733,64 @@ async function confirmSecretRemoval(args) {
|
|
|
11725
11733
|
if (!/^y(es)?$/i.test(answer.trim()))
|
|
11726
11734
|
fail("Uninstall cancelled; nothing was removed.");
|
|
11727
11735
|
}
|
|
11736
|
+
async function stopInstalledRelay() {
|
|
11737
|
+
const base = relayBase();
|
|
11738
|
+
const audit = path6.join(files.dir, "relays", new URL(base).port, "lifecycle.jsonl");
|
|
11739
|
+
if (!existsSync5(audit))
|
|
11740
|
+
return;
|
|
11741
|
+
const probe = async () => {
|
|
11742
|
+
try {
|
|
11743
|
+
const response = await fetch(`${base}/version`, { redirect: "error", signal: AbortSignal.timeout(2000) });
|
|
11744
|
+
return response.ok ? await response.json() : undefined;
|
|
11745
|
+
} catch (error) {
|
|
11746
|
+
const e = error;
|
|
11747
|
+
if (error instanceof SyntaxError)
|
|
11748
|
+
return;
|
|
11749
|
+
if (["ECONNREFUSED", "ConnectionRefused"].includes(e.cause?.code ?? e.code ?? ""))
|
|
11750
|
+
return;
|
|
11751
|
+
throw error;
|
|
11752
|
+
}
|
|
11753
|
+
};
|
|
11754
|
+
const relay = await probe();
|
|
11755
|
+
if (!relay?.managed || !relay.instanceId)
|
|
11756
|
+
return;
|
|
11757
|
+
const ours = readFileSync5(audit, "utf8").trim().split(`
|
|
11758
|
+
`).some((line) => {
|
|
11759
|
+
const event = JSON.parse(line);
|
|
11760
|
+
return event._tag === "Ready" && event.instanceId === relay.instanceId;
|
|
11761
|
+
});
|
|
11762
|
+
if (!ours)
|
|
11763
|
+
return;
|
|
11764
|
+
if (relay.shutdownProtocol !== 2)
|
|
11765
|
+
throw new Error("Stop the legacy relay manually, then run uninstall again.");
|
|
11766
|
+
const response = await fetch(`${base}/shutdown`, {
|
|
11767
|
+
method: "POST",
|
|
11768
|
+
redirect: "error",
|
|
11769
|
+
headers: { ...relayHeaders(), "content-type": "application/json" },
|
|
11770
|
+
signal: AbortSignal.timeout(15000),
|
|
11771
|
+
body: JSON.stringify({
|
|
11772
|
+
instanceId: relay.instanceId,
|
|
11773
|
+
requestId: randomUUID(),
|
|
11774
|
+
reason: "explicit-restart",
|
|
11775
|
+
force: true,
|
|
11776
|
+
client: { kind: "cli", instanceId: randomUUID(), buildId: opencodeBrowserBuildId2 }
|
|
11777
|
+
})
|
|
11778
|
+
});
|
|
11779
|
+
if (!response.ok || !(await response.json()).stopping)
|
|
11780
|
+
throw new Error("The running relay refused shutdown. Stop it manually, then run uninstall again.");
|
|
11781
|
+
for (let n = 0;n < 100; n++) {
|
|
11782
|
+
const current = await probe();
|
|
11783
|
+
if (!current)
|
|
11784
|
+
return;
|
|
11785
|
+
if (current.instanceId !== relay.instanceId)
|
|
11786
|
+
throw new Error("Another relay started during uninstall; no files were removed.");
|
|
11787
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
11788
|
+
}
|
|
11789
|
+
throw new Error("The relay is still stopping. Run uninstall again once it exits.");
|
|
11790
|
+
}
|
|
11728
11791
|
async function uninstall(args) {
|
|
11729
11792
|
await confirmSecretRemoval(args);
|
|
11793
|
+
await stopInstalledRelay();
|
|
11730
11794
|
const host = removeLegacyHost();
|
|
11731
11795
|
const settings = readJson(files.settings);
|
|
11732
11796
|
const mcp = (settings?.opencodeConfigs ?? [configFile()]).flatMap((file) => [MCP_NAME, LEGACY_MCP_NAME].filter((name) => removeMcp(name, settings?.entry, file)));
|
|
@@ -11739,11 +11803,17 @@ async function uninstall(args) {
|
|
|
11739
11803
|
}
|
|
11740
11804
|
}
|
|
11741
11805
|
const binary = readCurrent(layout)?.binary;
|
|
11742
|
-
|
|
11743
|
-
|
|
11806
|
+
try {
|
|
11807
|
+
rmSync3(files.dir, { recursive: true, force: true });
|
|
11808
|
+
log2(`✓ Removed ${files.dir}`);
|
|
11809
|
+
} catch (error) {
|
|
11810
|
+
if (process.platform !== "win32" || !["EBUSY", "EPERM", "EACCES"].includes(error.code ?? ""))
|
|
11811
|
+
throw error;
|
|
11812
|
+
log2(`! Couldn't remove all of ${files.dir}; close running browse agents and remove the remaining files.`);
|
|
11813
|
+
}
|
|
11744
11814
|
if (binary) {
|
|
11745
11815
|
const left = removeBinaryInstall(binary);
|
|
11746
|
-
log2(left ? `! Couldn't remove ${left}
|
|
11816
|
+
log2(left ? `! Couldn't remove ${left}. After uninstall exits, close any browse agents using the file(s) and delete them.` : `✓ Removed ${binary}`);
|
|
11747
11817
|
}
|
|
11748
11818
|
if (host)
|
|
11749
11819
|
log2("✓ Removed the native messaging host of an earlier version");
|
|
@@ -12092,7 +12162,7 @@ async function runSetup(command, args) {
|
|
|
12092
12162
|
if (command === "set")
|
|
12093
12163
|
return set(args);
|
|
12094
12164
|
if (command === "rollback") {
|
|
12095
|
-
const { runRollback } = await import("./runtime-update-
|
|
12165
|
+
const { runRollback } = await import("./runtime-update-cwthq9r4.mjs");
|
|
12096
12166
|
return runRollback(args);
|
|
12097
12167
|
}
|
|
12098
12168
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-4k77gxd5.mjs";
|
|
2
2
|
import {
|
|
3
3
|
versionEntry,
|
|
4
4
|
readCurrent,
|
|
5
5
|
npmRuntime
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-5e282683.mjs";
|
|
7
7
|
|
|
8
8
|
// src/mcp/supervisor.ts
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
@@ -14,7 +14,7 @@ async function runBinaryMcp(args) {
|
|
|
14
14
|
const runtime = npmRuntime();
|
|
15
15
|
if (!runtime) {
|
|
16
16
|
process.env[directEnvironmentVariable] = "1";
|
|
17
|
-
const { runCli } = await import("./cli-
|
|
17
|
+
const { runCli } = await import("./cli-2s0kbpd0.mjs");
|
|
18
18
|
return runCli();
|
|
19
19
|
}
|
|
20
20
|
const { layout } = runtime;
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
updateNotice2,
|
|
5
5
|
createUpdateWatcher2,
|
|
6
6
|
runUpdateCommand2
|
|
7
|
-
} from "./main-
|
|
8
|
-
import"./main-
|
|
9
|
-
import"./main-
|
|
7
|
+
} from "./main-18562erp.mjs";
|
|
8
|
+
import"./main-5e282683.mjs";
|
|
9
|
+
import"./main-4k77gxd5.mjs";
|
|
10
10
|
import"./main-3gthmkzw.mjs";
|
|
11
11
|
export {
|
|
12
12
|
createUpdateWatcher2 as createUpdateWatcher,
|
package/package.json
CHANGED
package/dist/main-9n6hhjy2.mjs
DELETED