@opencode/browse 0.0.17-dev.156 → 0.0.17-dev.157
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-gtgdn4q2.mjs → cli-bnwccwpc.mjs} +10 -10
- package/dist/cli.mjs +11 -11
- package/dist/{helpers-chz33rt0.mjs → helpers-s926ewzp.mjs} +1 -1
- package/dist/{main-nt7t4kx0.mjs → main-2be5p7he.mjs} +1 -1
- package/dist/{main-c2smsbck.mjs → main-4gph14fn.mjs} +2 -2
- package/dist/main-4pt08reg.mjs +4 -0
- package/dist/{main-savs00n9.mjs → main-5d6tc78f.mjs} +2 -2
- package/dist/{main-rfjyvkdf.mjs → main-d5r6evna.mjs} +3 -3
- package/dist/{main-apxe9ms5.mjs → main-jqerqpen.mjs} +1 -1
- package/dist/{main-ahzjp9cb.mjs → main-nf1jjqr6.mjs} +2 -2
- package/dist/{main-egt4w5v2.mjs → main-s8p6mgme.mjs} +3 -3
- package/dist/{main-g48hcxk8.mjs → main-ttge8j3c.mjs} +193 -15
- package/dist/{main-9kkg3fqe.mjs → main-w5xdsghz.mjs} +2 -2
- package/dist/{main-6h525ws1.mjs → main-yy5d2qyc.mjs} +1 -1
- package/dist/{mcp-1y4m3myg.mjs → mcp-ssmt3281.mjs} +7 -7
- package/dist/{migrate-ys9zg9k1.mjs → migrate-5pypptb1.mjs} +4 -4
- package/dist/{relay-m9f12gpd.mjs → relay-b4558nfw.mjs} +69 -94
- package/dist/{runtime-update-azmache9.mjs → runtime-update-x6kavk5m.mjs} +4 -4
- package/dist/{setup-ww0gfytd.mjs → setup-8x0gq8st.mjs} +7 -7
- package/dist/{supervisor-k97vbjqm.mjs → supervisor-aqcdky44.mjs} +3 -3
- package/dist/{update-80zdbxfv.mjs → update-83qrfkzg.mjs} +3 -3
- package/dist/{version-fdpmdgd0.mjs → version-rbrky7t2.mjs} +1 -1
- package/package.json +1 -1
- package/dist/main-5j79t1df.mjs +0 -4
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import {
|
|
25
25
|
opencodeBrowserVersion2,
|
|
26
26
|
opencodeBrowserBuildId2
|
|
27
|
-
} from "./main-
|
|
27
|
+
} from "./main-4pt08reg.mjs";
|
|
28
28
|
import {
|
|
29
29
|
configRoot2,
|
|
30
30
|
dataRoot,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
devExtension,
|
|
38
38
|
installCommand,
|
|
39
39
|
autoUpdateStatus
|
|
40
|
-
} from "./main-
|
|
40
|
+
} from "./main-s8p6mgme.mjs";
|
|
41
41
|
import {
|
|
42
42
|
extensionProtocolVersion,
|
|
43
43
|
extensionProtocolAdvice
|
|
@@ -63,29 +63,29 @@ import {
|
|
|
63
63
|
ensureExtensionConnected,
|
|
64
64
|
stoppedRelayStatus,
|
|
65
65
|
statusCollections
|
|
66
|
-
} from "./main-
|
|
66
|
+
} from "./main-ttge8j3c.mjs";
|
|
67
67
|
import"./main-4h7rfhhr.mjs";
|
|
68
68
|
import {
|
|
69
69
|
updateJson2,
|
|
70
70
|
formatUpdateNotice2,
|
|
71
71
|
updateNotice2
|
|
72
|
-
} from "./main-
|
|
72
|
+
} from "./main-5d6tc78f.mjs";
|
|
73
73
|
import {
|
|
74
74
|
settingKeys,
|
|
75
75
|
formatSettings,
|
|
76
76
|
ensureSessionExists
|
|
77
|
-
} from "./main-
|
|
77
|
+
} from "./main-nf1jjqr6.mjs";
|
|
78
78
|
import {
|
|
79
79
|
addSecret,
|
|
80
80
|
listSecrets,
|
|
81
81
|
removeSecret
|
|
82
|
-
} from "./main-
|
|
82
|
+
} from "./main-jqerqpen.mjs";
|
|
83
83
|
import {
|
|
84
84
|
defaultJournalBaseDir,
|
|
85
85
|
readJournalEntries,
|
|
86
86
|
formatJournalEntry
|
|
87
|
-
} from "./main-
|
|
88
|
-
import"./main-
|
|
87
|
+
} from "./main-w5xdsghz.mjs";
|
|
88
|
+
import"./main-2be5p7he.mjs";
|
|
89
89
|
import {
|
|
90
90
|
taggedEnum,
|
|
91
91
|
is2,
|
|
@@ -5843,7 +5843,7 @@ var status = make("status", {
|
|
|
5843
5843
|
}
|
|
5844
5844
|
})).pipe(withDescription4("Show relay, extension, and target status"));
|
|
5845
5845
|
var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
|
|
5846
|
-
const { runMcpServer } = yield* promise(() => import("./mcp-
|
|
5846
|
+
const { runMcpServer } = yield* promise(() => import("./mcp-ssmt3281.mjs"));
|
|
5847
5847
|
yield* runMcpServer;
|
|
5848
5848
|
})).pipe(withDescription4("Run the browse MCP server over stdio"));
|
|
5849
5849
|
registerCliCommand(400, () => tabs);
|
|
@@ -6291,7 +6291,7 @@ registerCliCommand(710, () => flightRecorder);
|
|
|
6291
6291
|
|
|
6292
6292
|
// src/cli/relay.ts
|
|
6293
6293
|
var serve = make("serve", {}, fn("Cli.serve")(function* () {
|
|
6294
|
-
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-
|
|
6294
|
+
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-b4558nfw.mjs"), import("./helpers-s926ewzp.mjs")]));
|
|
6295
6295
|
const port = yield* portConfig;
|
|
6296
6296
|
const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
|
|
6297
6297
|
yield* scoped(gen(function* () {
|
package/dist/cli.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
// src/main.ts
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
var embeddedVersion = "0.0.17-dev.
|
|
9
|
+
var embeddedVersion = "0.0.17-dev.157";
|
|
10
10
|
var setupCommands = new Set(["install", "uninstall", "extension", "pair", "set"]);
|
|
11
11
|
var command = process.argv[2];
|
|
12
12
|
var args = process.argv.slice(3);
|
|
@@ -17,21 +17,21 @@ var askedForHelp = command === "--help" || command === "-h" || options.some((arg
|
|
|
17
17
|
var preCliHelp = askedForHelp && (command === "update" || command !== undefined && setupCommands.has(command));
|
|
18
18
|
if (command !== "--version" && command !== "-v" && !askedForHelp && !process.env.OPENCODE_BROWSER_HOME && legacyRoots().some((root) => fs.existsSync(root))) {
|
|
19
19
|
try {
|
|
20
|
-
const { migrateLegacy } = await import("./migrate-
|
|
20
|
+
const { migrateLegacy } = await import("./migrate-5pypptb1.mjs");
|
|
21
21
|
migrateLegacy();
|
|
22
22
|
} catch {}
|
|
23
23
|
}
|
|
24
24
|
if (command === "--version" || command === "-v") {
|
|
25
|
-
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-
|
|
25
|
+
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-rbrky7t2.mjs")).opencodeBrowserVersion;
|
|
26
26
|
process.stdout.write(`${opencodeBrowserVersion}
|
|
27
27
|
`);
|
|
28
|
-
} else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-
|
|
29
|
-
const { runBinaryMcp } = await import("./supervisor-
|
|
28
|
+
} else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-aqcdky44.mjs")).supervisesMcp()) {
|
|
29
|
+
const { runBinaryMcp } = await import("./supervisor-aqcdky44.mjs");
|
|
30
30
|
await runBinaryMcp(process.argv.slice(3));
|
|
31
31
|
} else if (invokedAs === "opencode-browser-mcp" || command === "mcp" && process.argv.length === 3) {
|
|
32
32
|
const { NodeRuntime } = await import("./index-7d47yfra.mjs");
|
|
33
33
|
const { defaultTeardown } = await import("./Runtime-qfc1eg1n.mjs");
|
|
34
|
-
const { runMcpServer } = await import("./mcp-
|
|
34
|
+
const { runMcpServer } = await import("./mcp-ssmt3281.mjs");
|
|
35
35
|
let stdinGone = false;
|
|
36
36
|
const onStdinGone = () => {
|
|
37
37
|
stdinGone = true;
|
|
@@ -53,13 +53,13 @@ if (command === "--version" || command === "-v") {
|
|
|
53
53
|
})
|
|
54
54
|
}));
|
|
55
55
|
} else if (command === "self-update" || command === "runtime-switch") {
|
|
56
|
-
const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-
|
|
56
|
+
const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-x6kavk5m.mjs");
|
|
57
57
|
await (command === "self-update" ? runSelfUpdate : runRuntimeSwitch)(process.argv.slice(3));
|
|
58
58
|
} else if (command === "update" && !askedForHelp) {
|
|
59
|
-
const { runUpdateCommand } = await import("./update-
|
|
59
|
+
const { runUpdateCommand } = await import("./update-83qrfkzg.mjs");
|
|
60
60
|
await runUpdateCommand(process.argv.slice(3));
|
|
61
61
|
} else if (command && setupCommands.has(command) && !askedForHelp) {
|
|
62
|
-
const { runSetup } = await import("./setup-
|
|
62
|
+
const { runSetup } = await import("./setup-8x0gq8st.mjs");
|
|
63
63
|
await runSetup(command, process.argv.slice(3));
|
|
64
64
|
} else {
|
|
65
65
|
if (preCliHelp || !command || command === "--help" || command === "-h") {
|
|
@@ -96,9 +96,9 @@ executable in ~/.local/bin (or $XDG_BIN_HOME).
|
|
|
96
96
|
`);
|
|
97
97
|
}
|
|
98
98
|
if (command === "status" && !askedForHelp && !process.argv.includes("--json")) {
|
|
99
|
-
const { printSetupStatus } = await import("./setup-
|
|
99
|
+
const { printSetupStatus } = await import("./setup-8x0gq8st.mjs");
|
|
100
100
|
printSetupStatus();
|
|
101
101
|
}
|
|
102
|
-
const { runCli } = await import("./cli-
|
|
102
|
+
const { runCli } = await import("./cli-bnwccwpc.mjs");
|
|
103
103
|
runCli(preCliHelp ? ["--help"] : undefined);
|
|
104
104
|
}
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
bundledPairingCodeTtlMs,
|
|
6
6
|
mintPairingCode,
|
|
7
7
|
writeExtensionPairing
|
|
8
|
-
} from "./main-
|
|
8
|
+
} from "./main-yy5d2qyc.mjs";
|
|
9
9
|
import {
|
|
10
10
|
configRoot2,
|
|
11
11
|
cacheRoot,
|
|
12
12
|
devExtensionUrl,
|
|
13
13
|
devExtensionFolder
|
|
14
|
-
} from "./main-
|
|
14
|
+
} from "./main-s8p6mgme.mjs";
|
|
15
15
|
|
|
16
16
|
// src/setup/dev-extension.ts
|
|
17
17
|
import { createHash } from "node:crypto";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
installedRuntime2,
|
|
7
7
|
autoUpdateStatus,
|
|
8
8
|
updateAvailable
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-s8p6mgme.mjs";
|
|
10
10
|
import {
|
|
11
11
|
unpackedReloadAdvice
|
|
12
12
|
} from "./main-b3jrctcx.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 { runInstalledUpdate } = await import("./runtime-update-
|
|
318
|
+
const { runInstalledUpdate } = await import("./runtime-update-x6kavk5m.mjs");
|
|
319
319
|
if (await runInstalledUpdate(args))
|
|
320
320
|
return;
|
|
321
321
|
if (compiledBinary()) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-4pt08reg.mjs";
|
|
4
4
|
import {
|
|
5
5
|
configRoot2,
|
|
6
6
|
dataRoot,
|
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
storeUrl,
|
|
21
21
|
installedVersion,
|
|
22
22
|
runCommand
|
|
23
|
-
} from "./main-
|
|
23
|
+
} from "./main-s8p6mgme.mjs";
|
|
24
24
|
import {
|
|
25
25
|
writeStdout
|
|
26
26
|
} from "./main-tk4axre7.mjs";
|
|
27
27
|
import {
|
|
28
28
|
formatPairingCode
|
|
29
|
-
} from "./main-
|
|
29
|
+
} from "./main-yy5d2qyc.mjs";
|
|
30
30
|
import {
|
|
31
31
|
unpackedExtensionId
|
|
32
32
|
} from "./main-b3jrctcx.mjs";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
parseTargetSelection2,
|
|
13
13
|
getObject2,
|
|
14
14
|
getString2
|
|
15
|
-
} from "./main-
|
|
15
|
+
} from "./main-ttge8j3c.mjs";
|
|
16
16
|
import {
|
|
17
17
|
isStream,
|
|
18
18
|
provideContext
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
} from "./main-qazf3bhk.mjs";
|
|
104
104
|
import {
|
|
105
105
|
cliCommand
|
|
106
|
-
} from "./main-
|
|
106
|
+
} from "./main-s8p6mgme.mjs";
|
|
107
107
|
|
|
108
108
|
// node_modules/effect/dist/PrimaryKey.js
|
|
109
109
|
var symbol = "~effect/PrimaryKey";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-4pt08reg.mjs";
|
|
4
4
|
|
|
5
5
|
// src/paths.ts
|
|
6
6
|
import fs from "node:fs";
|
|
@@ -110,7 +110,7 @@ function cliInstall() {
|
|
|
110
110
|
return { kind: "binary", binary: installedBinary() ?? process.execPath, pathEnv: process.env.PATH };
|
|
111
111
|
if (fromCheckout())
|
|
112
112
|
return { kind: "checkout", bundle: path.join(packageRoot(), "dist", "cli.mjs") };
|
|
113
|
-
return { kind: "npm", version: "0.0.17-dev.
|
|
113
|
+
return { kind: "npm", version: "0.0.17-dev.157", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
|
|
114
114
|
}
|
|
115
115
|
function cliPrefix(install = cliInstall()) {
|
|
116
116
|
if (install.kind === "binary") {
|
|
@@ -132,7 +132,7 @@ function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjh
|
|
|
132
132
|
return id ? { id } : {};
|
|
133
133
|
}
|
|
134
134
|
var RELEASE_SERVICE = "https://anoma.ly/release";
|
|
135
|
-
function devExtension(baked = { file: "browse-extension-0.0.17-dev.
|
|
135
|
+
function devExtension(baked = { file: "browse-extension-0.0.17-dev.157.zip", sha256: "e9945c1ebc94bb8543f6de77b71b002640188743b45ab418839fb544bf70b95e", size: 183292 }) {
|
|
136
136
|
return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
|
|
137
137
|
}
|
|
138
138
|
var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
|
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
extensionProtocolAdvice,
|
|
6
6
|
parseJsonObject
|
|
7
7
|
} from "./main-b3jrctcx.mjs";
|
|
8
|
+
import {
|
|
9
|
+
ensurePrivateDirectorySync
|
|
10
|
+
} from "./main-4h7rfhhr.mjs";
|
|
8
11
|
import {
|
|
9
12
|
get,
|
|
10
13
|
post,
|
|
@@ -15,8 +18,9 @@ import {
|
|
|
15
18
|
} from "./main-bc8cjey0.mjs";
|
|
16
19
|
import {
|
|
17
20
|
opencodeBrowserBuildId2
|
|
18
|
-
} from "./main-
|
|
21
|
+
} from "./main-4pt08reg.mjs";
|
|
19
22
|
import {
|
|
23
|
+
stateRoot,
|
|
20
24
|
compiledBinary,
|
|
21
25
|
scriptEntry,
|
|
22
26
|
cliCommand,
|
|
@@ -24,10 +28,10 @@ import {
|
|
|
24
28
|
compareVersions,
|
|
25
29
|
installedRuntime2,
|
|
26
30
|
installedVersion
|
|
27
|
-
} from "./main-
|
|
31
|
+
} from "./main-s8p6mgme.mjs";
|
|
28
32
|
import {
|
|
29
33
|
relayAuthorization
|
|
30
|
-
} from "./main-
|
|
34
|
+
} from "./main-2be5p7he.mjs";
|
|
31
35
|
import {
|
|
32
36
|
Pointer,
|
|
33
37
|
passthrough,
|
|
@@ -132,6 +136,9 @@ import {
|
|
|
132
136
|
isObject,
|
|
133
137
|
isTagged
|
|
134
138
|
} from "./main-qazf3bhk.mjs";
|
|
139
|
+
import {
|
|
140
|
+
__require
|
|
141
|
+
} from "./main-j98fzrvv.mjs";
|
|
135
142
|
|
|
136
143
|
// node_modules/effect/dist/ConfigProvider.js
|
|
137
144
|
function makeValue(value) {
|
|
@@ -1320,8 +1327,8 @@ async function dataUrlDocument2(url) {
|
|
|
1320
1327
|
// src/relay/lifecycle.ts
|
|
1321
1328
|
import { execFileSync, spawn } from "node:child_process";
|
|
1322
1329
|
import crypto2 from "node:crypto";
|
|
1323
|
-
import
|
|
1324
|
-
import
|
|
1330
|
+
import path3 from "node:path";
|
|
1331
|
+
import process3 from "node:process";
|
|
1325
1332
|
import { fileURLToPath } from "node:url";
|
|
1326
1333
|
// src/relay/client.ts
|
|
1327
1334
|
var portConfig = Int("OPENCODE_BROWSER_PORT").pipe(withDefault(defaultPort2));
|
|
@@ -1507,8 +1514,177 @@ function mcpClientPid() {
|
|
|
1507
1514
|
}
|
|
1508
1515
|
var layerFetchMcp = effect(Service, make3({ clientPid: mcpClientPid() })).pipe(provide2(layerNodeHttp));
|
|
1509
1516
|
|
|
1517
|
+
// src/relay/log.ts
|
|
1518
|
+
import fs from "node:fs";
|
|
1519
|
+
import os from "node:os";
|
|
1520
|
+
import path from "node:path";
|
|
1521
|
+
var maxLogBytes = 1e6;
|
|
1522
|
+
var maxEntryCharacters = 64000;
|
|
1523
|
+
function managedRelayLogPath(home = os.homedir()) {
|
|
1524
|
+
return path.join(stateRoot(home), "logs", "relay.log");
|
|
1525
|
+
}
|
|
1526
|
+
function appendManagedRelayProcessLog(message, home = os.homedir()) {
|
|
1527
|
+
try {
|
|
1528
|
+
const logPath = managedRelayLogPath(home);
|
|
1529
|
+
ensurePrivateDirectorySync(path.dirname(logPath));
|
|
1530
|
+
const entry = `${new Date().toISOString()} ${message.slice(0, maxEntryCharacters)}
|
|
1531
|
+
`;
|
|
1532
|
+
const stat = fs.statSync(logPath, { throwIfNoEntry: false });
|
|
1533
|
+
if (stat && stat.size + Buffer.byteLength(entry) > maxLogBytes)
|
|
1534
|
+
fs.renameSync(logPath, `${logPath}.1`);
|
|
1535
|
+
fs.appendFileSync(logPath, entry, { encoding: "utf8", mode: 384 });
|
|
1536
|
+
fs.chmodSync(logPath, 384);
|
|
1537
|
+
} catch {}
|
|
1538
|
+
}
|
|
1539
|
+
function relayLog(event, fields = {}) {
|
|
1540
|
+
const detail = Object.entries(fields).filter(([, value]) => value !== undefined).map(([key, value]) => `${key}=${typeof value === "string" && !/\s/.test(value) ? value : JSON.stringify(value)}`).join(" ");
|
|
1541
|
+
appendManagedRelayProcessLog(detail ? `${event} ${detail}` : event);
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
// src/relay/windows-launch.ts
|
|
1545
|
+
import { existsSync } from "node:fs";
|
|
1546
|
+
import path2 from "node:path";
|
|
1547
|
+
import process2 from "node:process";
|
|
1548
|
+
var createNewProcessGroup = 512;
|
|
1549
|
+
var createUnicodeEnvironment = 1024;
|
|
1550
|
+
var createNoWindow = 134217728;
|
|
1551
|
+
var startupInfoSize = 104;
|
|
1552
|
+
var processInformationSize = 24;
|
|
1553
|
+
var windowsAbsolutePath = /^(?:[A-Za-z]:[\\/]|\\\\)/;
|
|
1554
|
+
var kernel32;
|
|
1555
|
+
function kernel32Library() {
|
|
1556
|
+
if (kernel32)
|
|
1557
|
+
return kernel32;
|
|
1558
|
+
const ffi = __require("bun:ffi");
|
|
1559
|
+
kernel32 = ffi.dlopen("kernel32.dll", {
|
|
1560
|
+
CreateProcessW: {
|
|
1561
|
+
args: [
|
|
1562
|
+
ffi.FFIType.ptr,
|
|
1563
|
+
ffi.FFIType.ptr,
|
|
1564
|
+
ffi.FFIType.ptr,
|
|
1565
|
+
ffi.FFIType.ptr,
|
|
1566
|
+
ffi.FFIType.i32,
|
|
1567
|
+
ffi.FFIType.u32,
|
|
1568
|
+
ffi.FFIType.ptr,
|
|
1569
|
+
ffi.FFIType.ptr,
|
|
1570
|
+
ffi.FFIType.ptr,
|
|
1571
|
+
ffi.FFIType.ptr
|
|
1572
|
+
],
|
|
1573
|
+
returns: ffi.FFIType.i32
|
|
1574
|
+
},
|
|
1575
|
+
CloseHandle: { args: [ffi.FFIType.ptr], returns: ffi.FFIType.i32 },
|
|
1576
|
+
GetLastError: { args: [], returns: ffi.FFIType.u32 }
|
|
1577
|
+
});
|
|
1578
|
+
return kernel32;
|
|
1579
|
+
}
|
|
1580
|
+
function resolveWindowsExecutable(executable, env, exists) {
|
|
1581
|
+
if (!executable || executable.includes("\x00"))
|
|
1582
|
+
return;
|
|
1583
|
+
if (windowsAbsolutePath.test(executable))
|
|
1584
|
+
return executable;
|
|
1585
|
+
if (/[\\/:]/.test(executable))
|
|
1586
|
+
return;
|
|
1587
|
+
const searchPath = windowsPathVariable(env);
|
|
1588
|
+
if (!searchPath)
|
|
1589
|
+
return;
|
|
1590
|
+
const names = path2.win32.extname(executable) ? [executable] : [`${executable}.exe`, `${executable}.com`];
|
|
1591
|
+
for (const entry of searchPath.split(path2.win32.delimiter)) {
|
|
1592
|
+
const trimmed = entry.trim();
|
|
1593
|
+
const directory = trimmed.startsWith('"') && trimmed.endsWith('"') ? trimmed.slice(1, -1) : trimmed;
|
|
1594
|
+
if (!windowsAbsolutePath.test(directory))
|
|
1595
|
+
continue;
|
|
1596
|
+
for (const name of names) {
|
|
1597
|
+
const candidate = path2.win32.join(directory, name);
|
|
1598
|
+
if (exists(candidate))
|
|
1599
|
+
return candidate;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
return;
|
|
1603
|
+
}
|
|
1604
|
+
function windowsPathVariable(env) {
|
|
1605
|
+
let value;
|
|
1606
|
+
for (const [name, candidate] of Object.entries(env)) {
|
|
1607
|
+
if (name.toUpperCase() === "PATH" && candidate !== undefined)
|
|
1608
|
+
value = candidate;
|
|
1609
|
+
}
|
|
1610
|
+
return value;
|
|
1611
|
+
}
|
|
1612
|
+
function windowsLaunchProblem(launch, env) {
|
|
1613
|
+
if (!launch.executable)
|
|
1614
|
+
return "the executable is empty";
|
|
1615
|
+
if (launch.executable.includes("\x00") || launch.args.some((argument) => argument.includes("\x00")))
|
|
1616
|
+
return "the executable or an argument contains NUL";
|
|
1617
|
+
if (Object.values(env).some((value) => value?.includes("\x00")))
|
|
1618
|
+
return "an environment value contains NUL";
|
|
1619
|
+
return;
|
|
1620
|
+
}
|
|
1621
|
+
function launchWindowsRelay(launch, env, onFallback) {
|
|
1622
|
+
const fallback = (reason) => {
|
|
1623
|
+
onFallback?.(reason);
|
|
1624
|
+
return false;
|
|
1625
|
+
};
|
|
1626
|
+
const problem = windowsLaunchProblem(launch, env);
|
|
1627
|
+
if (problem)
|
|
1628
|
+
return fallback(problem);
|
|
1629
|
+
if (!process2.versions.bun)
|
|
1630
|
+
return fallback("this process is not running under Bun");
|
|
1631
|
+
const executable = resolveWindowsExecutable(launch.executable, env, existsSync);
|
|
1632
|
+
if (!executable)
|
|
1633
|
+
return fallback(`could not resolve ${JSON.stringify(launch.executable)} through PATH`);
|
|
1634
|
+
let started = false;
|
|
1635
|
+
try {
|
|
1636
|
+
const kernel32 = kernel32Library();
|
|
1637
|
+
const startupInfo = new Uint8Array(startupInfoSize);
|
|
1638
|
+
const startup = new DataView(startupInfo.buffer);
|
|
1639
|
+
startup.setUint32(0, startupInfoSize, true);
|
|
1640
|
+
startup.setUint32(60, 1, true);
|
|
1641
|
+
startup.setUint16(64, 0, true);
|
|
1642
|
+
const processInformation = new Uint8Array(processInformationSize);
|
|
1643
|
+
const created = kernel32.symbols.CreateProcessW(wideZ(executable), wideZ(windowsCommandLine(executable, launch.args)), null, null, 0, createNoWindow | createNewProcessGroup | createUnicodeEnvironment, Buffer.from(windowsEnvironmentBlock(env), "utf16le"), null, startupInfo, processInformation);
|
|
1644
|
+
if (!created) {
|
|
1645
|
+
let code;
|
|
1646
|
+
try {
|
|
1647
|
+
code = kernel32.symbols.GetLastError();
|
|
1648
|
+
} catch {}
|
|
1649
|
+
return fallback(`CreateProcessW failed${code === undefined ? "" : ` (GetLastError() = ${code})`}`);
|
|
1650
|
+
}
|
|
1651
|
+
started = true;
|
|
1652
|
+
const info = new DataView(processInformation.buffer);
|
|
1653
|
+
kernel32.symbols.CloseHandle(info.getBigUint64(0, true));
|
|
1654
|
+
kernel32.symbols.CloseHandle(info.getBigUint64(8, true));
|
|
1655
|
+
return true;
|
|
1656
|
+
} catch (error) {
|
|
1657
|
+
if (started)
|
|
1658
|
+
return true;
|
|
1659
|
+
return fallback(error instanceof Error ? error.message : String(error));
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
function quoteWindowsArgument(argument) {
|
|
1663
|
+
return `"${argument.replace(/(\\*)"/g, "$1$1\\\"").replace(/(\\+)$/, "$1$1")}"`;
|
|
1664
|
+
}
|
|
1665
|
+
function windowsCommandLine(executable, args) {
|
|
1666
|
+
return [executable, ...args].map(quoteWindowsArgument).join(" ");
|
|
1667
|
+
}
|
|
1668
|
+
function windowsEnvironmentBlock(env) {
|
|
1669
|
+
const entries = new Map;
|
|
1670
|
+
for (const [name, value] of Object.entries(env)) {
|
|
1671
|
+
if (value === undefined || name === "" || name.includes("=") || name.includes("\x00"))
|
|
1672
|
+
continue;
|
|
1673
|
+
entries.set(name.toUpperCase(), [name, value]);
|
|
1674
|
+
}
|
|
1675
|
+
const sorted = [...entries.values()].sort(([left], [right]) => {
|
|
1676
|
+
const a = left.toUpperCase();
|
|
1677
|
+
const b = right.toUpperCase();
|
|
1678
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
1679
|
+
});
|
|
1680
|
+
return sorted.length === 0 ? "\x00\x00" : `${sorted.map(([name, value]) => `${name}=${value}\x00`).join("")}\x00`;
|
|
1681
|
+
}
|
|
1682
|
+
function wideZ(value) {
|
|
1683
|
+
return Buffer.from(`${value}\x00`, "utf16le");
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1510
1686
|
// src/relay/lifecycle.ts
|
|
1511
|
-
var loadedCliEntrypoint = compiledBinary() ?
|
|
1687
|
+
var loadedCliEntrypoint = compiledBinary() ? process3.execPath : fileURLToPath(new URL(import.meta.url.endsWith(".ts") ? "../main.ts" : "./cli.mjs", import.meta.url));
|
|
1512
1688
|
var clientInstanceId = crypto2.randomUUID();
|
|
1513
1689
|
function shouldWaitForExtensionReconnect(readiness) {
|
|
1514
1690
|
return readiness.started || readiness.waitForReconnect === true;
|
|
@@ -1734,18 +1910,20 @@ function stoppedRelayStatus(endpoint) {
|
|
|
1734
1910
|
function statusCollections(status) {
|
|
1735
1911
|
return status.sessions && status.targets ? { sessions: status.sessions, targets: status.targets } : undefined;
|
|
1736
1912
|
}
|
|
1737
|
-
function startManagedRelay(entrypoint = loadedCliEntrypoint, executable =
|
|
1913
|
+
function startManagedRelay(entrypoint = loadedCliEntrypoint, executable = process3.execPath, execArgv = process3.execArgv, options = {}) {
|
|
1738
1914
|
return try_2({
|
|
1739
1915
|
try: () => {
|
|
1740
1916
|
if (!entrypoint) {
|
|
1741
1917
|
throw new Error("Cannot locate the browse CLI entrypoint");
|
|
1742
1918
|
}
|
|
1743
1919
|
const launch = managedRelayLaunch(entrypoint, executable, execArgv);
|
|
1744
|
-
const
|
|
1920
|
+
const env = Object.fromEntries(Object.entries(relayEnvironment(process3.env)).filter(([name]) => name.toUpperCase() !== "OPENCODE_BROWSER_RESTART_REQUEST_ID"));
|
|
1745
1921
|
const childEnv = { ...env, OPENCODE_BROWSER_MANAGED_RELAY: "1", ...options.restartRequestId ? { OPENCODE_BROWSER_RESTART_REQUEST_ID: options.restartRequestId } : {} };
|
|
1746
|
-
if (
|
|
1747
|
-
|
|
1748
|
-
|
|
1922
|
+
if (process3.platform === "win32") {
|
|
1923
|
+
if (launchWindowsRelay(launch, childEnv, (reason) => relayLog("relay.launch.fallback", { executable: launch.executable, reason })))
|
|
1924
|
+
return;
|
|
1925
|
+
const args = launch.args.map(quoteWindowsArgument).join(" ");
|
|
1926
|
+
execFileSync(path3.join(process3.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" });
|
|
1749
1927
|
return;
|
|
1750
1928
|
}
|
|
1751
1929
|
const child = spawn(launch.executable, launch.args, {
|
|
@@ -1809,7 +1987,7 @@ function relayEnvironment(env) {
|
|
|
1809
1987
|
return relayEnvironmentNames.has(upper) || relayEnvironmentPrefixes.some((prefix) => upper.startsWith(prefix));
|
|
1810
1988
|
}));
|
|
1811
1989
|
}
|
|
1812
|
-
function managedRelayLaunch(entrypoint = loadedCliEntrypoint, executable =
|
|
1990
|
+
function managedRelayLaunch(entrypoint = loadedCliEntrypoint, executable = process3.execPath, execArgv = process3.execArgv) {
|
|
1813
1991
|
if (!scriptEntry(entrypoint))
|
|
1814
1992
|
return { executable: entrypoint, args: ["serve"] };
|
|
1815
1993
|
return {
|
|
@@ -1818,9 +1996,9 @@ function managedRelayLaunch(entrypoint = loadedCliEntrypoint, executable = proce
|
|
|
1818
1996
|
};
|
|
1819
1997
|
}
|
|
1820
1998
|
function managedRelayEntrypoint(entrypoint) {
|
|
1821
|
-
const name =
|
|
1999
|
+
const name = path3.basename(entrypoint);
|
|
1822
2000
|
if (name === "index.ts" || name === "opencode-browser-client.ts" || name === "cli.ts")
|
|
1823
|
-
return
|
|
2001
|
+
return path3.join(path3.dirname(entrypoint), "main.ts");
|
|
1824
2002
|
return entrypoint;
|
|
1825
2003
|
}
|
|
1826
2004
|
function isRelayUnreachable(error) {
|
|
@@ -1833,4 +2011,4 @@ function isRelayStartingOrUnreachable(error) {
|
|
|
1833
2011
|
return isRelayStarting(error) || isRelayUnreachable(error);
|
|
1834
2012
|
}
|
|
1835
2013
|
|
|
1836
|
-
export { withDefault, option, String2, Int, Boolean2, SessionContainer, SessionsContainer, SessionDeleted, SessionResetResponse, ExecuteRequest, SessionAdoptRequest, SessionNewRequest, SessionEnsureRequest, SessionIdRequest, SessionAllowlistRequest, SessionAdoptResponse, ExecuteLogEntry, ExecuteLogSummary, ExecuteAftermath, AuthenticatedJsonRequest, AuthenticatedJsonOutcome, ExtensionStatus, RelayVersion, RelayShutdownRequest, NetworkStartRequest, NetworkSessionRequest, NetworkStopRequest, AuthProfileSummary, NetworkStopResponse, AuthProfileRequest, AuthRefreshRequest, AuthRunRequest, AuthRunResponse, RecordingQuality, RecordingTargetRequest, RecordingStartRequest, TabsCleanupResponse, SettingsGetResponse, SettingsSetResponse, FlightRecorderStartRequest, FlightRecorderSaveRequest, 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, portConfig, extensionOriginsConfig, endpointForPort, RelayUnreachable, RelayRejected, Service, layerFetch, layerFetchMcp, shouldWaitForExtensionReconnect, relayBuildProblem, ensureRelay, restartRelay, extensionReconnectWaitMs, ensureExtensionConnected, stoppedRelayStatus, statusCollections, startManagedRelay };
|
|
2014
|
+
export { withDefault, option, String2, Int, Boolean2, SessionContainer, SessionsContainer, SessionDeleted, SessionResetResponse, ExecuteRequest, SessionAdoptRequest, SessionNewRequest, SessionEnsureRequest, SessionIdRequest, SessionAllowlistRequest, SessionAdoptResponse, ExecuteLogEntry, ExecuteLogSummary, ExecuteAftermath, AuthenticatedJsonRequest, AuthenticatedJsonOutcome, ExtensionStatus, RelayVersion, RelayShutdownRequest, NetworkStartRequest, NetworkSessionRequest, NetworkStopRequest, AuthProfileSummary, NetworkStopResponse, AuthProfileRequest, AuthRefreshRequest, AuthRunRequest, AuthRunResponse, RecordingQuality, RecordingTargetRequest, RecordingStartRequest, TabsCleanupResponse, SettingsGetResponse, SettingsSetResponse, FlightRecorderStartRequest, FlightRecorderSaveRequest, 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, portConfig, extensionOriginsConfig, endpointForPort, RelayUnreachable, RelayRejected, Service, layerFetch, layerFetchMcp, appendManagedRelayProcessLog, relayLog, shouldWaitForExtensionReconnect, relayBuildProblem, ensureRelay, restartRelay, extensionReconnectWaitMs, ensureExtensionConnected, stoppedRelayStatus, statusCollections, startManagedRelay };
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./main-4h7rfhhr.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isValidSessionId2
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-ttge8j3c.mjs";
|
|
7
7
|
import {
|
|
8
8
|
decodeUnknownOption,
|
|
9
9
|
optionalKey,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./main-xycdhwqs.mjs";
|
|
20
20
|
import {
|
|
21
21
|
stateRoot
|
|
22
|
-
} from "./main-
|
|
22
|
+
} from "./main-s8p6mgme.mjs";
|
|
23
23
|
|
|
24
24
|
// src/session-manager/journal.ts
|
|
25
25
|
import fs from "node:fs";
|
|
@@ -45,11 +45,11 @@ import {
|
|
|
45
45
|
} from "./main-bc8cjey0.mjs";
|
|
46
46
|
import {
|
|
47
47
|
opencodeBrowserVersion2
|
|
48
|
-
} from "./main-
|
|
48
|
+
} from "./main-4pt08reg.mjs";
|
|
49
49
|
import {
|
|
50
50
|
cliCommand,
|
|
51
51
|
autoUpdateStatus
|
|
52
|
-
} from "./main-
|
|
52
|
+
} from "./main-s8p6mgme.mjs";
|
|
53
53
|
import"./main-b3jrctcx.mjs";
|
|
54
54
|
import {
|
|
55
55
|
option,
|
|
@@ -69,12 +69,12 @@ import {
|
|
|
69
69
|
relayBuildProblem,
|
|
70
70
|
ensureRelay,
|
|
71
71
|
ensureExtensionConnected
|
|
72
|
-
} from "./main-
|
|
72
|
+
} from "./main-ttge8j3c.mjs";
|
|
73
73
|
import"./main-4h7rfhhr.mjs";
|
|
74
74
|
import {
|
|
75
75
|
updateJson2,
|
|
76
76
|
createUpdateWatcher2
|
|
77
|
-
} from "./main-
|
|
77
|
+
} from "./main-5d6tc78f.mjs";
|
|
78
78
|
import {
|
|
79
79
|
settingSpecs,
|
|
80
80
|
securityVariables,
|
|
@@ -155,12 +155,12 @@ import {
|
|
|
155
155
|
toolResultForValue2,
|
|
156
156
|
mcpErrorMessage2,
|
|
157
157
|
toolResult
|
|
158
|
-
} from "./main-
|
|
158
|
+
} from "./main-nf1jjqr6.mjs";
|
|
159
159
|
import {
|
|
160
160
|
makeUnsafe,
|
|
161
161
|
make3,
|
|
162
162
|
listSecrets
|
|
163
|
-
} from "./main-
|
|
163
|
+
} from "./main-jqerqpen.mjs";
|
|
164
164
|
import {
|
|
165
165
|
Clock,
|
|
166
166
|
type,
|
|
@@ -175,7 +175,7 @@ import {
|
|
|
175
175
|
orElse,
|
|
176
176
|
exhaustive
|
|
177
177
|
} from "./main-4074weqb.mjs";
|
|
178
|
-
import"./main-
|
|
178
|
+
import"./main-2be5p7he.mjs";
|
|
179
179
|
import {
|
|
180
180
|
Class,
|
|
181
181
|
taggedEnum,
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
browseServerCommand,
|
|
7
7
|
editAgentConfig,
|
|
8
8
|
configureMcp
|
|
9
|
-
} from "./main-
|
|
10
|
-
import"./main-
|
|
9
|
+
} from "./main-d5r6evna.mjs";
|
|
10
|
+
import"./main-4pt08reg.mjs";
|
|
11
11
|
import {
|
|
12
12
|
configRoot2,
|
|
13
13
|
dataRoot,
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
cacheRoot,
|
|
16
16
|
binRoot,
|
|
17
17
|
binaryName
|
|
18
|
-
} from "./main-
|
|
18
|
+
} from "./main-s8p6mgme.mjs";
|
|
19
19
|
import"./main-tk4axre7.mjs";
|
|
20
20
|
import"./main-4h7rfhhr.mjs";
|
|
21
|
-
import"./main-
|
|
21
|
+
import"./main-yy5d2qyc.mjs";
|
|
22
22
|
import"./main-b3jrctcx.mjs";
|
|
23
23
|
import {
|
|
24
24
|
legacyDataRoot,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2,
|
|
3
3
|
opencodeBrowserBuildId2
|
|
4
|
-
} from "./main-
|
|
4
|
+
} from "./main-4pt08reg.mjs";
|
|
5
5
|
import {
|
|
6
6
|
defaultRoots,
|
|
7
7
|
configRoot2,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
setStoredMode,
|
|
26
26
|
autoUpdateStatus,
|
|
27
27
|
createAutoUpdater
|
|
28
|
-
} from "./main-
|
|
28
|
+
} from "./main-s8p6mgme.mjs";
|
|
29
29
|
import {
|
|
30
30
|
extensionProtocolVersion,
|
|
31
31
|
minExtensionProtocolVersion,
|
|
@@ -101,8 +101,10 @@ import {
|
|
|
101
101
|
getTargetInfo2,
|
|
102
102
|
isRestrictedTarget2,
|
|
103
103
|
isRestrictedUrl2,
|
|
104
|
-
dataUrlDocument2
|
|
105
|
-
|
|
104
|
+
dataUrlDocument2,
|
|
105
|
+
appendManagedRelayProcessLog,
|
|
106
|
+
relayLog
|
|
107
|
+
} from "./main-ttge8j3c.mjs";
|
|
106
108
|
import {
|
|
107
109
|
context,
|
|
108
110
|
pendingPairingCodeKeys,
|
|
@@ -120,7 +122,7 @@ import {
|
|
|
120
122
|
pairingSessionKey,
|
|
121
123
|
sessionProof,
|
|
122
124
|
wrapToken
|
|
123
|
-
} from "./main-
|
|
125
|
+
} from "./main-yy5d2qyc.mjs";
|
|
124
126
|
import {
|
|
125
127
|
makeUnsafe,
|
|
126
128
|
terminateChildProcess,
|
|
@@ -143,16 +145,16 @@ import {
|
|
|
143
145
|
checkNavigationUrl,
|
|
144
146
|
readSecret,
|
|
145
147
|
secretText
|
|
146
|
-
} from "./main-
|
|
148
|
+
} from "./main-jqerqpen.mjs";
|
|
147
149
|
import {
|
|
148
150
|
defaultJournalBaseDir,
|
|
149
151
|
makeJournalEntry,
|
|
150
152
|
appendJournalEntry,
|
|
151
153
|
startJournalRetention
|
|
152
|
-
} from "./main-
|
|
154
|
+
} from "./main-w5xdsghz.mjs";
|
|
153
155
|
import {
|
|
154
156
|
createUpdateWatcher2
|
|
155
|
-
} from "./main-
|
|
157
|
+
} from "./main-5d6tc78f.mjs";
|
|
156
158
|
import {
|
|
157
159
|
SettingsInputError,
|
|
158
160
|
parseSettingChanges,
|
|
@@ -160,13 +162,13 @@ import {
|
|
|
160
162
|
settingsToExtension,
|
|
161
163
|
describeSettings,
|
|
162
164
|
describeChanges
|
|
163
|
-
} from "./main-
|
|
165
|
+
} from "./main-nf1jjqr6.mjs";
|
|
164
166
|
import {
|
|
165
167
|
relayHostname,
|
|
166
168
|
isLocalPeer,
|
|
167
169
|
installedDevExtension,
|
|
168
170
|
syncDevExtension
|
|
169
|
-
} from "./main-
|
|
171
|
+
} from "./main-4gph14fn.mjs";
|
|
170
172
|
import {
|
|
171
173
|
legacyRoots
|
|
172
174
|
} from "./main-ckssvk4c.mjs";
|
|
@@ -187,7 +189,7 @@ import {
|
|
|
187
189
|
relayToken,
|
|
188
190
|
secretsEqual,
|
|
189
191
|
ensurePrivateDirectory
|
|
190
|
-
} from "./main-
|
|
192
|
+
} from "./main-2be5p7he.mjs";
|
|
191
193
|
import {
|
|
192
194
|
taggedEnum,
|
|
193
195
|
is2,
|
|
@@ -301,7 +303,7 @@ import {
|
|
|
301
303
|
|
|
302
304
|
// src/relay.ts
|
|
303
305
|
import crypto10 from "node:crypto";
|
|
304
|
-
import
|
|
306
|
+
import path14 from "node:path";
|
|
305
307
|
|
|
306
308
|
// src/relay/browser-links.ts
|
|
307
309
|
import dns from "node:dns/promises";
|
|
@@ -10838,33 +10840,6 @@ class Recorder {
|
|
|
10838
10840
|
}
|
|
10839
10841
|
}
|
|
10840
10842
|
|
|
10841
|
-
// src/relay/log.ts
|
|
10842
|
-
import fs8 from "node:fs";
|
|
10843
|
-
import os5 from "node:os";
|
|
10844
|
-
import path8 from "node:path";
|
|
10845
|
-
var maxLogBytes = 1e6;
|
|
10846
|
-
var maxEntryCharacters = 64000;
|
|
10847
|
-
function managedRelayLogPath(home = os5.homedir()) {
|
|
10848
|
-
return path8.join(stateRoot(home), "logs", "relay.log");
|
|
10849
|
-
}
|
|
10850
|
-
function appendManagedRelayProcessLog(message, home = os5.homedir()) {
|
|
10851
|
-
try {
|
|
10852
|
-
const logPath = managedRelayLogPath(home);
|
|
10853
|
-
ensurePrivateDirectorySync(path8.dirname(logPath));
|
|
10854
|
-
const entry = `${new Date().toISOString()} ${message.slice(0, maxEntryCharacters)}
|
|
10855
|
-
`;
|
|
10856
|
-
const stat = fs8.statSync(logPath, { throwIfNoEntry: false });
|
|
10857
|
-
if (stat && stat.size + Buffer.byteLength(entry) > maxLogBytes)
|
|
10858
|
-
fs8.renameSync(logPath, `${logPath}.1`);
|
|
10859
|
-
fs8.appendFileSync(logPath, entry, { encoding: "utf8", mode: 384 });
|
|
10860
|
-
fs8.chmodSync(logPath, 384);
|
|
10861
|
-
} catch {}
|
|
10862
|
-
}
|
|
10863
|
-
function relayLog(event, fields = {}) {
|
|
10864
|
-
const detail = Object.entries(fields).filter(([, value]) => value !== undefined).map(([key, value]) => `${key}=${typeof value === "string" && !/\s/.test(value) ? value : JSON.stringify(value)}`).join(" ");
|
|
10865
|
-
appendManagedRelayProcessLog(detail ? `${event} ${detail}` : event);
|
|
10866
|
-
}
|
|
10867
|
-
|
|
10868
10843
|
// src/execute/patchright-tuning.ts
|
|
10869
10844
|
function tunePatchright({ server }) {
|
|
10870
10845
|
const page = server?.Page?.prototype;
|
|
@@ -11331,15 +11306,15 @@ class ExecuteSandbox extends DefaultPageHost {
|
|
|
11331
11306
|
}
|
|
11332
11307
|
|
|
11333
11308
|
// src/recording-relay/flight-recorder.ts
|
|
11334
|
-
import
|
|
11335
|
-
import
|
|
11309
|
+
import fs9 from "node:fs/promises";
|
|
11310
|
+
import path9 from "node:path";
|
|
11336
11311
|
import { performance as performance3 } from "node:perf_hooks";
|
|
11337
11312
|
|
|
11338
11313
|
// src/recording-relay/ffmpeg-encoder.ts
|
|
11339
11314
|
import { execFile, spawn } from "node:child_process";
|
|
11340
11315
|
import crypto6 from "node:crypto";
|
|
11341
11316
|
import { once } from "node:events";
|
|
11342
|
-
import
|
|
11317
|
+
import fs8 from "node:fs/promises";
|
|
11343
11318
|
|
|
11344
11319
|
// src/recording-relay/mjpeg-matroska.ts
|
|
11345
11320
|
var ebml = Buffer.from("1A45DFA3", "hex");
|
|
@@ -11456,7 +11431,7 @@ function mjpegMatroskaFrame(timestampMs, durationMs, frameLength) {
|
|
|
11456
11431
|
import { performance as performance2 } from "node:perf_hooks";
|
|
11457
11432
|
|
|
11458
11433
|
// src/recording-relay/types.ts
|
|
11459
|
-
import
|
|
11434
|
+
import path8 from "node:path";
|
|
11460
11435
|
var defaultMaxDurationMs = 15 * 60 * 1000;
|
|
11461
11436
|
var defaultCdpFrameRate = 60;
|
|
11462
11437
|
var maxRecordingFrameRate = 60;
|
|
@@ -11552,7 +11527,7 @@ function findByRecordingTarget(map, target, ambiguousMessage) {
|
|
|
11552
11527
|
return map.values().next().value;
|
|
11553
11528
|
}
|
|
11554
11529
|
function cdpArtifactType(outputPath) {
|
|
11555
|
-
const extension =
|
|
11530
|
+
const extension = path8.extname(outputPath).toLowerCase();
|
|
11556
11531
|
if (extension === ".webm")
|
|
11557
11532
|
return "webm";
|
|
11558
11533
|
if (extension === ".mp4")
|
|
@@ -11751,7 +11726,7 @@ async function createFfmpegVideoEncoder(options) {
|
|
|
11751
11726
|
await writeStreamChunk(child.stdin, mjpegMatroskaHeader(options.width, options.height));
|
|
11752
11727
|
} catch (error) {
|
|
11753
11728
|
await exit;
|
|
11754
|
-
await
|
|
11729
|
+
await fs8.rm(temporaryOutputPath, { force: true });
|
|
11755
11730
|
throw error;
|
|
11756
11731
|
}
|
|
11757
11732
|
let completed = false;
|
|
@@ -11795,10 +11770,10 @@ async function createFfmpegVideoEncoder(options) {
|
|
|
11795
11770
|
throw error;
|
|
11796
11771
|
if (inputError)
|
|
11797
11772
|
throw inputError;
|
|
11798
|
-
await
|
|
11773
|
+
await fs8.rename(temporaryOutputPath, options.outputPath);
|
|
11799
11774
|
completed = true;
|
|
11800
11775
|
})().catch(async (error) => {
|
|
11801
|
-
await
|
|
11776
|
+
await fs8.rm(temporaryOutputPath, { force: true });
|
|
11802
11777
|
throw error;
|
|
11803
11778
|
});
|
|
11804
11779
|
return finishingPromise;
|
|
@@ -11810,7 +11785,7 @@ async function createFfmpegVideoEncoder(options) {
|
|
|
11810
11785
|
return cancelPromise;
|
|
11811
11786
|
cancelPromise = (async () => {
|
|
11812
11787
|
await terminate();
|
|
11813
|
-
await
|
|
11788
|
+
await fs8.rm(temporaryOutputPath, { force: true });
|
|
11814
11789
|
})();
|
|
11815
11790
|
return cancelPromise;
|
|
11816
11791
|
}
|
|
@@ -11974,7 +11949,7 @@ class FlightRecorderRelay {
|
|
|
11974
11949
|
const startAt = frames[0].receivedAt;
|
|
11975
11950
|
const endAt = frames.at(-1).receivedAt;
|
|
11976
11951
|
const durationMs = Math.max(1, endAt - startAt);
|
|
11977
|
-
await
|
|
11952
|
+
await fs9.mkdir(path9.dirname(target.outputPath), { recursive: true });
|
|
11978
11953
|
let encoder;
|
|
11979
11954
|
try {
|
|
11980
11955
|
encoder = await (this.options.startVideoEncoder ?? startFfmpegVideoEncoder)({
|
|
@@ -11998,7 +11973,7 @@ class FlightRecorderRelay {
|
|
|
11998
11973
|
sourceFrameCount: recorder.sourceFrameCount,
|
|
11999
11974
|
droppedFrameCount: recorder.droppedFrameCount
|
|
12000
11975
|
};
|
|
12001
|
-
await
|
|
11976
|
+
await fs9.writeFile(`${target.outputPath}.json`, `${JSON.stringify({ ...receipt, savedAt: new Date(this.now()).toISOString(), retainedDurationMs: this.retainedDuration(recorder) }, null, 2)}
|
|
12002
11977
|
`, "utf8");
|
|
12003
11978
|
return receipt;
|
|
12004
11979
|
} catch (error) {
|
|
@@ -12099,7 +12074,7 @@ class FlightRecorderRelay {
|
|
|
12099
12074
|
}
|
|
12100
12075
|
async function assertOutputAvailable(filePath) {
|
|
12101
12076
|
try {
|
|
12102
|
-
await
|
|
12077
|
+
await fs9.stat(filePath);
|
|
12103
12078
|
} catch (error) {
|
|
12104
12079
|
if (error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
12105
12080
|
return;
|
|
@@ -12292,8 +12267,8 @@ function resolveExactHandoffTarget(options) {
|
|
|
12292
12267
|
}
|
|
12293
12268
|
|
|
12294
12269
|
// src/relay/lifecycle-log.ts
|
|
12295
|
-
import
|
|
12296
|
-
import
|
|
12270
|
+
import fs10 from "node:fs";
|
|
12271
|
+
import path10 from "node:path";
|
|
12297
12272
|
var requestFields = {
|
|
12298
12273
|
instanceId: RelayShutdownRequest.fields.instanceId,
|
|
12299
12274
|
requestId: RelayShutdownRequest.fields.requestId,
|
|
@@ -12311,30 +12286,30 @@ var RelayLifecycleEvent = TaggedUnion({
|
|
|
12311
12286
|
}
|
|
12312
12287
|
});
|
|
12313
12288
|
function appendRelayLifecycleEvent(filePath, event) {
|
|
12314
|
-
const directory =
|
|
12289
|
+
const directory = path10.dirname(filePath);
|
|
12315
12290
|
ensurePrivateDirectorySync(directory);
|
|
12316
12291
|
const entry = `${JSON.stringify({ ...encodeSync(RelayLifecycleEvent)(event), timestamp: new Date().toISOString() })}
|
|
12317
12292
|
`;
|
|
12318
|
-
const file =
|
|
12293
|
+
const file = fs10.openSync(filePath, "a+", 384);
|
|
12319
12294
|
try {
|
|
12320
|
-
|
|
12321
|
-
if (
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
|
|
12295
|
+
fs10.fchmodSync(file, 384);
|
|
12296
|
+
if (fs10.fstatSync(file).size + Buffer.byteLength(entry) > 256000)
|
|
12297
|
+
fs10.ftruncateSync(file, 0);
|
|
12298
|
+
fs10.writeFileSync(file, entry);
|
|
12299
|
+
fs10.fsyncSync(file);
|
|
12325
12300
|
} finally {
|
|
12326
|
-
|
|
12301
|
+
fs10.closeSync(file);
|
|
12327
12302
|
}
|
|
12328
|
-
const parent =
|
|
12303
|
+
const parent = fs10.openSync(directory, "r");
|
|
12329
12304
|
try {
|
|
12330
12305
|
try {
|
|
12331
|
-
|
|
12306
|
+
fs10.fsyncSync(parent);
|
|
12332
12307
|
} catch (error) {
|
|
12333
12308
|
if (!isUnsupportedDirectorySyncError(error))
|
|
12334
12309
|
throw error;
|
|
12335
12310
|
}
|
|
12336
12311
|
} finally {
|
|
12337
|
-
|
|
12312
|
+
fs10.closeSync(parent);
|
|
12338
12313
|
}
|
|
12339
12314
|
}
|
|
12340
12315
|
|
|
@@ -13754,8 +13729,8 @@ function sendNotFound(response) {
|
|
|
13754
13729
|
|
|
13755
13730
|
// src/recording-relay.ts
|
|
13756
13731
|
import crypto7 from "node:crypto";
|
|
13757
|
-
import
|
|
13758
|
-
import
|
|
13732
|
+
import fs12 from "node:fs/promises";
|
|
13733
|
+
import path12 from "node:path";
|
|
13759
13734
|
import { performance as performance4 } from "node:perf_hooks";
|
|
13760
13735
|
|
|
13761
13736
|
// src/recording-relay/protocol.ts
|
|
@@ -13823,8 +13798,8 @@ function validateUint32(value, field, positive) {
|
|
|
13823
13798
|
}
|
|
13824
13799
|
|
|
13825
13800
|
// src/recording-relay/cdp-capture.ts
|
|
13826
|
-
import
|
|
13827
|
-
import
|
|
13801
|
+
import fs11 from "node:fs/promises";
|
|
13802
|
+
import path11 from "node:path";
|
|
13828
13803
|
function handleCdpScreencastFrame(context, recording, options) {
|
|
13829
13804
|
const frame = parseScreencastFrame(options.params);
|
|
13830
13805
|
acknowledgeScreencastFrame({
|
|
@@ -13889,7 +13864,7 @@ async function startCdpRecording(context, options, starting) {
|
|
|
13889
13864
|
if (!artifactType) {
|
|
13890
13865
|
return { success: false, error: "CDP recording output path must end in .webm or .mp4" };
|
|
13891
13866
|
}
|
|
13892
|
-
await
|
|
13867
|
+
await fs11.mkdir(path11.dirname(options.outputPath), { recursive: true });
|
|
13893
13868
|
if (starting.cancelled)
|
|
13894
13869
|
return cancelledResult();
|
|
13895
13870
|
const frameRate = options.frameRate ?? defaultCdpFrameRate;
|
|
@@ -14028,7 +14003,7 @@ async function finishCdpRecording(context, recording) {
|
|
|
14028
14003
|
await writeSourceFrame(recording, recording.lastFrame, endFrameNumber);
|
|
14029
14004
|
recording.frameCount = endFrameNumber;
|
|
14030
14005
|
await recording.encoder.finish();
|
|
14031
|
-
const stat = await
|
|
14006
|
+
const stat = await fs11.stat(recording.outputPath);
|
|
14032
14007
|
const quality = recordingQuality(recording, durationMs);
|
|
14033
14008
|
const metadata = {
|
|
14034
14009
|
mode: "cdp",
|
|
@@ -14042,7 +14017,7 @@ async function finishCdpRecording(context, recording) {
|
|
|
14042
14017
|
...quality,
|
|
14043
14018
|
mimeType: recording.artifactType === "mp4" ? "video/mp4" : "video/webm"
|
|
14044
14019
|
};
|
|
14045
|
-
await
|
|
14020
|
+
await fs11.writeFile(`${recording.outputPath}.json`, `${JSON.stringify(metadata, null, 2)}
|
|
14046
14021
|
`, "utf8");
|
|
14047
14022
|
return {
|
|
14048
14023
|
success: true,
|
|
@@ -14405,7 +14380,7 @@ class RecordingRelay {
|
|
|
14405
14380
|
throw new Error("No tab capture data was received");
|
|
14406
14381
|
await recording.file.sync();
|
|
14407
14382
|
await recording.file.close();
|
|
14408
|
-
await
|
|
14383
|
+
await fs12.rename(recording.temporaryPath, recording.outputPath);
|
|
14409
14384
|
recording.finalized = true;
|
|
14410
14385
|
recording.resolveStop?.({
|
|
14411
14386
|
success: true,
|
|
@@ -14451,7 +14426,7 @@ class RecordingRelay {
|
|
|
14451
14426
|
await recording.writePromise.catch(() => {});
|
|
14452
14427
|
await recording.file.close().catch(() => {});
|
|
14453
14428
|
if (!recording.finalized)
|
|
14454
|
-
await
|
|
14429
|
+
await fs12.rm(recording.temporaryPath, { force: true }).catch(() => {});
|
|
14455
14430
|
if (this.activeRecordings.get(recording.tabId) === recording) {
|
|
14456
14431
|
this.activeRecordings.delete(recording.tabId);
|
|
14457
14432
|
this.recordingChanged(recording.tabId);
|
|
@@ -14475,11 +14450,11 @@ class RecordingRelay {
|
|
|
14475
14450
|
if (cdpArtifactType(options.outputPath) !== "webm") {
|
|
14476
14451
|
return { success: false, error: "tabCapture recording output path must end in .webm; use --mode cdp for MP4" };
|
|
14477
14452
|
}
|
|
14478
|
-
await
|
|
14453
|
+
await fs12.mkdir(path12.dirname(options.outputPath), { recursive: true });
|
|
14479
14454
|
if (starting.cancelled)
|
|
14480
14455
|
return { success: false, error: "Recording was cancelled while starting" };
|
|
14481
14456
|
const temporaryPath = `${options.outputPath}.partial-${process.pid}-${crypto7.randomUUID()}`;
|
|
14482
|
-
const file = await
|
|
14457
|
+
const file = await fs12.open(temporaryPath, "wx", 384);
|
|
14483
14458
|
const recording = {
|
|
14484
14459
|
tabId: options.tabId,
|
|
14485
14460
|
...options.sessionId ? { sessionId: options.sessionId } : {},
|
|
@@ -16803,7 +16778,7 @@ function createExtensionEventHandler(options) {
|
|
|
16803
16778
|
|
|
16804
16779
|
// src/relay/extension-handshake.ts
|
|
16805
16780
|
import crypto8 from "node:crypto";
|
|
16806
|
-
import
|
|
16781
|
+
import fs13 from "node:fs";
|
|
16807
16782
|
import { WebSocket as WebSocket3 } from "ws";
|
|
16808
16783
|
var maxPreAuthMessageBytes = 64 * 1024;
|
|
16809
16784
|
var preAuthHandshakeTimeoutMs = 1e4;
|
|
@@ -16825,7 +16800,7 @@ class ExtensionHandshake {
|
|
|
16825
16800
|
this.options = options;
|
|
16826
16801
|
}
|
|
16827
16802
|
rejectedProtocol() {
|
|
16828
|
-
return this.mismatch ?? (
|
|
16803
|
+
return this.mismatch ?? (fs13.existsSync(oldStoreMarker()) ? extensionProtocolCompatibility(2) : undefined);
|
|
16829
16804
|
}
|
|
16830
16805
|
mismatchAdvice(version) {
|
|
16831
16806
|
return extensionProtocolAdvice(version, { install: installCommand() }, !this.mismatch || this.mismatch.origin === `chrome-extension://${this.options.storeId}` ? "store" : this.mismatch.origin === stableUnpackedExtensionOrigin2 ? "unpacked" : undefined);
|
|
@@ -16980,8 +16955,8 @@ class ExtensionHandshake {
|
|
|
16980
16955
|
return;
|
|
16981
16956
|
}
|
|
16982
16957
|
this.mismatch = undefined;
|
|
16983
|
-
if (
|
|
16984
|
-
|
|
16958
|
+
if (fs13.existsSync(oldStoreMarker()))
|
|
16959
|
+
fs13.rmSync(oldStoreMarker(), { force: true });
|
|
16985
16960
|
if (message.method === "protocol") {
|
|
16986
16961
|
if (message.params?.unpaired === true) {
|
|
16987
16962
|
this.lastUnpaired = Date.now();
|
|
@@ -18202,9 +18177,9 @@ class RootTargetLifecycle {
|
|
|
18202
18177
|
}
|
|
18203
18178
|
|
|
18204
18179
|
// src/session-manager/catalog.ts
|
|
18205
|
-
import
|
|
18206
|
-
import
|
|
18207
|
-
import
|
|
18180
|
+
import fs14 from "node:fs/promises";
|
|
18181
|
+
import os5 from "node:os";
|
|
18182
|
+
import path13 from "node:path";
|
|
18208
18183
|
import crypto9 from "node:crypto";
|
|
18209
18184
|
var PersistedSession = Struct({
|
|
18210
18185
|
id: String3,
|
|
@@ -18224,8 +18199,8 @@ var Catalog = Struct({
|
|
|
18224
18199
|
version: Literal(1),
|
|
18225
18200
|
sessions: ArraySchema(PersistedSession)
|
|
18226
18201
|
});
|
|
18227
|
-
function defaultSessionCatalogPath(port, home =
|
|
18228
|
-
return
|
|
18202
|
+
function defaultSessionCatalogPath(port, home = os5.homedir()) {
|
|
18203
|
+
return path13.join(dataRoot(home), "relays", String(port), "sessions.json");
|
|
18229
18204
|
}
|
|
18230
18205
|
|
|
18231
18206
|
class SessionCatalog {
|
|
@@ -18236,7 +18211,7 @@ class SessionCatalog {
|
|
|
18236
18211
|
async load() {
|
|
18237
18212
|
let text;
|
|
18238
18213
|
try {
|
|
18239
|
-
text = await
|
|
18214
|
+
text = await fs14.readFile(this.filePath, "utf8");
|
|
18240
18215
|
} catch (error) {
|
|
18241
18216
|
if (isNodeError(error) && error.code === "ENOENT")
|
|
18242
18217
|
return [];
|
|
@@ -18252,7 +18227,7 @@ class SessionCatalog {
|
|
|
18252
18227
|
const detail = error instanceof Error && error.message ? `: ${error.message}` : "";
|
|
18253
18228
|
const corruptPath = `${this.filePath}.corrupt-${Date.now()}`;
|
|
18254
18229
|
try {
|
|
18255
|
-
await
|
|
18230
|
+
await fs14.rename(this.filePath, corruptPath);
|
|
18256
18231
|
console.error(`Browse session catalog at ${this.filePath} was unreadable${detail}; moved it to ${corruptPath} and started with no saved sessions`);
|
|
18257
18232
|
} catch (moveError) {
|
|
18258
18233
|
console.error(`Browse session catalog at ${this.filePath} was unreadable${detail}; could not move it aside (${moveError instanceof Error ? moveError.message : String(moveError)}), starting with no saved sessions`);
|
|
@@ -18261,21 +18236,21 @@ class SessionCatalog {
|
|
|
18261
18236
|
}
|
|
18262
18237
|
}
|
|
18263
18238
|
async save(sessions) {
|
|
18264
|
-
const directory =
|
|
18239
|
+
const directory = path13.dirname(this.filePath);
|
|
18265
18240
|
const temporaryPath = `${this.filePath}.${process.pid}.${crypto9.randomUUID()}.tmp`;
|
|
18266
18241
|
const contents = `${JSON.stringify({ version: 1, sessions }, null, 2)}
|
|
18267
18242
|
`;
|
|
18268
18243
|
let temporaryFile;
|
|
18269
18244
|
try {
|
|
18270
|
-
await
|
|
18271
|
-
await
|
|
18272
|
-
temporaryFile = await
|
|
18245
|
+
await fs14.mkdir(directory, { recursive: true, mode: 448 });
|
|
18246
|
+
await fs14.chmod(directory, 448);
|
|
18247
|
+
temporaryFile = await fs14.open(temporaryPath, "wx", 384);
|
|
18273
18248
|
await temporaryFile.writeFile(contents, "utf8");
|
|
18274
18249
|
await temporaryFile.sync();
|
|
18275
18250
|
await temporaryFile.close();
|
|
18276
18251
|
temporaryFile = undefined;
|
|
18277
|
-
await
|
|
18278
|
-
const directoryHandle = await
|
|
18252
|
+
await fs14.rename(temporaryPath, this.filePath);
|
|
18253
|
+
const directoryHandle = await fs14.open(directory, "r");
|
|
18279
18254
|
try {
|
|
18280
18255
|
try {
|
|
18281
18256
|
await directoryHandle.sync();
|
|
@@ -18291,7 +18266,7 @@ class SessionCatalog {
|
|
|
18291
18266
|
await temporaryFile?.close();
|
|
18292
18267
|
} catch {}
|
|
18293
18268
|
try {
|
|
18294
|
-
await
|
|
18269
|
+
await fs14.rm(temporaryPath, { force: true });
|
|
18295
18270
|
} catch {}
|
|
18296
18271
|
throw new Error(`Could not write browse session catalog at ${this.filePath}`, { cause: error });
|
|
18297
18272
|
}
|
|
@@ -18783,7 +18758,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
18783
18758
|
const restartTimeoutMs = yield* Int("OPENCODE_BROWSER_RESTART_TIMEOUT_MS").pipe(withDefault(1e4));
|
|
18784
18759
|
const clientGoneGraceMs = yield* Int("OPENCODE_BROWSER_CLIENT_GONE_GRACE_MS").pipe(withDefault(60000));
|
|
18785
18760
|
const restartRequestId = yield* option(String2("OPENCODE_BROWSER_RESTART_REQUEST_ID"));
|
|
18786
|
-
const lifecycleLogPath =
|
|
18761
|
+
const lifecycleLogPath = path14.join(stateRoot(), "relays", String(port), "lifecycle.jsonl");
|
|
18787
18762
|
const audit = (event) => try_2(() => appendRelayLifecycleEvent(lifecycleLogPath, event));
|
|
18788
18763
|
function setProtectedUi(tabId, protectedUi) {
|
|
18789
18764
|
const changed = registry.markRootTargetProtectedUi(tabId, protectedUi);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import"./main-9bk4pprj.mjs";
|
|
2
|
-
import"./main-
|
|
2
|
+
import"./main-4pt08reg.mjs";
|
|
3
3
|
import {
|
|
4
4
|
cliCommand,
|
|
5
5
|
installCommand,
|
|
@@ -16,17 +16,17 @@ import {
|
|
|
16
16
|
registryUrl,
|
|
17
17
|
fetchPublished,
|
|
18
18
|
runInstaller
|
|
19
|
-
} from "./main-
|
|
19
|
+
} from "./main-s8p6mgme.mjs";
|
|
20
20
|
import"./main-b3jrctcx.mjs";
|
|
21
21
|
import {
|
|
22
22
|
Service,
|
|
23
23
|
layerFetch,
|
|
24
24
|
restartRelay,
|
|
25
25
|
startManagedRelay
|
|
26
|
-
} from "./main-
|
|
26
|
+
} from "./main-ttge8j3c.mjs";
|
|
27
27
|
import"./main-4h7rfhhr.mjs";
|
|
28
28
|
import"./main-bc8cjey0.mjs";
|
|
29
|
-
import"./main-
|
|
29
|
+
import"./main-2be5p7he.mjs";
|
|
30
30
|
import {
|
|
31
31
|
succeed6,
|
|
32
32
|
gen,
|
|
@@ -63,10 +63,10 @@ import {
|
|
|
63
63
|
installRuntime,
|
|
64
64
|
installedRuntime,
|
|
65
65
|
manualMcpEntry
|
|
66
|
-
} from "./main-
|
|
66
|
+
} from "./main-d5r6evna.mjs";
|
|
67
67
|
import {
|
|
68
68
|
opencodeBrowserBuildId2
|
|
69
|
-
} from "./main-
|
|
69
|
+
} from "./main-4pt08reg.mjs";
|
|
70
70
|
import {
|
|
71
71
|
installedBinaryPath,
|
|
72
72
|
installerBinaryPath,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
autoUpdateStatus,
|
|
84
84
|
describeAutoUpdate,
|
|
85
85
|
runCommand
|
|
86
|
-
} from "./main-
|
|
86
|
+
} from "./main-s8p6mgme.mjs";
|
|
87
87
|
import"./main-4h7rfhhr.mjs";
|
|
88
88
|
import {
|
|
89
89
|
pairingCodeTtlMs,
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
revokeBrowserToken,
|
|
98
98
|
legacyPairingCode,
|
|
99
99
|
removeLegacyPairingCode
|
|
100
|
-
} from "./main-
|
|
100
|
+
} from "./main-yy5d2qyc.mjs";
|
|
101
101
|
import {
|
|
102
102
|
unpackedExtensionId,
|
|
103
103
|
extensionProtocolSkew,
|
|
@@ -106,16 +106,16 @@ import {
|
|
|
106
106
|
import"./main-tk4axre7.mjs";
|
|
107
107
|
import {
|
|
108
108
|
defaultSiteSecretsDir
|
|
109
|
-
} from "./main-
|
|
109
|
+
} from "./main-jqerqpen.mjs";
|
|
110
110
|
import {
|
|
111
111
|
parseHostname,
|
|
112
112
|
readRelayConfig,
|
|
113
113
|
writeRelayConfig,
|
|
114
114
|
syncDevExtension
|
|
115
|
-
} from "./main-
|
|
115
|
+
} from "./main-4gph14fn.mjs";
|
|
116
116
|
import {
|
|
117
117
|
relayAuthorization
|
|
118
|
-
} from "./main-
|
|
118
|
+
} from "./main-2be5p7he.mjs";
|
|
119
119
|
|
|
120
120
|
// src/setup.ts
|
|
121
121
|
import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync } from "node:fs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-4pt08reg.mjs";
|
|
2
2
|
import {
|
|
3
3
|
entrySpawnCommand,
|
|
4
4
|
installedRuntime2,
|
|
5
5
|
installedVersion
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-s8p6mgme.mjs";
|
|
7
7
|
|
|
8
8
|
// src/mcp/supervisor.ts
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
@@ -34,7 +34,7 @@ async function runBinaryMcp(args) {
|
|
|
34
34
|
const runtime = installedRuntime2();
|
|
35
35
|
if (!runtime || runtime.kind === "npx") {
|
|
36
36
|
process.env[directEnvironmentVariable] = "1";
|
|
37
|
-
const { runCli } = await import("./cli-
|
|
37
|
+
const { runCli } = await import("./cli-bnwccwpc.mjs");
|
|
38
38
|
return runCli();
|
|
39
39
|
}
|
|
40
40
|
const REPLAY = `opencode-browser-shim-initialize-${randomUUID()}`;
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
updateNotice2,
|
|
5
5
|
createUpdateWatcher2,
|
|
6
6
|
runUpdateCommand2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-5d6tc78f.mjs";
|
|
8
8
|
import"./main-b3jrctcx.mjs";
|
|
9
|
-
import"./main-
|
|
10
|
-
import"./main-
|
|
9
|
+
import"./main-s8p6mgme.mjs";
|
|
10
|
+
import"./main-4pt08reg.mjs";
|
|
11
11
|
export {
|
|
12
12
|
createUpdateWatcher2 as createUpdateWatcher,
|
|
13
13
|
formatUpdateNotice2 as formatUpdateNotice,
|
package/package.json
CHANGED
package/dist/main-5j79t1df.mjs
DELETED