@opencode/browse 0.0.17-dev.153 → 0.0.17-dev.154
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-m0j3qnw1.mjs → cli-b1a4wehd.mjs} +10 -10
- package/dist/cli.mjs +19 -16
- package/dist/{helpers-4g7zbsnc.mjs → helpers-4dc8bwcq.mjs} +1 -1
- package/dist/{main-s60xbp7n.mjs → main-1bj9pxrn.mjs} +2 -2
- package/dist/{main-gyvm9gdn.mjs → main-7tpc4ff1.mjs} +2 -2
- package/dist/{main-rr7mhs8s.mjs → main-cp57k02g.mjs} +3 -3
- package/dist/{main-h53t7qqd.mjs → main-cvmtmn9v.mjs} +1 -1
- package/dist/main-e9prwwjg.mjs +4 -0
- package/dist/{main-dhqe5ms2.mjs → main-f1y8arm5.mjs} +3 -3
- package/dist/{main-fy8bze4f.mjs → main-mh43bbrh.mjs} +3 -3
- package/dist/{main-4bf2dyps.mjs → main-q61mzkdk.mjs} +1 -1
- package/dist/{main-q67650ha.mjs → main-r013n42g.mjs} +2 -2
- package/dist/{main-zfjqvx5j.mjs → main-r5x5kmz5.mjs} +1 -1
- package/dist/{main-0bd10nkt.mjs → main-xa2jmwcw.mjs} +2 -2
- package/dist/{mcp-d6q97s13.mjs → mcp-7xce28nt.mjs} +72 -10
- package/dist/{migrate-pvnmfkty.mjs → migrate-g69mmry2.mjs} +4 -4
- package/dist/{relay-qrpmyt13.mjs → relay-nfphdh3e.mjs} +10 -10
- package/dist/{runtime-update-eqbm0qk4.mjs → runtime-update-9mn6pkfp.mjs} +4 -4
- package/dist/{setup-68xar70w.mjs → setup-g4mytak4.mjs} +7 -7
- package/dist/{supervisor-w75g0agp.mjs → supervisor-nzpee3fp.mjs} +45 -5
- package/dist/{update-2vfqksb5.mjs → update-m2pgdzm6.mjs} +3 -3
- package/dist/{version-1aegffmv.mjs → version-65ktt8gg.mjs} +1 -1
- package/package.json +1 -1
- package/dist/main-90t2fp6z.mjs +0 -4
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
opencodeBrowserVersion2,
|
|
20
20
|
opencodeBrowserBuildId2
|
|
21
|
-
} from "./main-
|
|
21
|
+
} from "./main-e9prwwjg.mjs";
|
|
22
22
|
import {
|
|
23
23
|
configRoot2,
|
|
24
24
|
dataRoot,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
devExtension,
|
|
32
32
|
installCommand,
|
|
33
33
|
autoUpdateStatus
|
|
34
|
-
} from "./main-
|
|
34
|
+
} from "./main-mh43bbrh.mjs";
|
|
35
35
|
import {
|
|
36
36
|
extensionProtocolVersion,
|
|
37
37
|
extensionProtocolAdvice
|
|
@@ -57,29 +57,29 @@ import {
|
|
|
57
57
|
ensureExtensionConnected,
|
|
58
58
|
stoppedRelayStatus,
|
|
59
59
|
statusCollections
|
|
60
|
-
} from "./main-
|
|
60
|
+
} from "./main-f1y8arm5.mjs";
|
|
61
61
|
import"./main-4h7rfhhr.mjs";
|
|
62
62
|
import {
|
|
63
63
|
updateJson2,
|
|
64
64
|
formatUpdateNotice2,
|
|
65
65
|
updateNotice2
|
|
66
|
-
} from "./main-
|
|
66
|
+
} from "./main-7tpc4ff1.mjs";
|
|
67
67
|
import {
|
|
68
68
|
settingKeys,
|
|
69
69
|
formatSettings,
|
|
70
70
|
ensureSessionExists
|
|
71
|
-
} from "./main-
|
|
71
|
+
} from "./main-1bj9pxrn.mjs";
|
|
72
72
|
import {
|
|
73
73
|
addSecret,
|
|
74
74
|
listSecrets,
|
|
75
75
|
removeSecret
|
|
76
|
-
} from "./main-
|
|
76
|
+
} from "./main-r5x5kmz5.mjs";
|
|
77
77
|
import {
|
|
78
78
|
defaultJournalBaseDir,
|
|
79
79
|
readJournalEntries,
|
|
80
80
|
formatJournalEntry
|
|
81
|
-
} from "./main-
|
|
82
|
-
import"./main-
|
|
81
|
+
} from "./main-xa2jmwcw.mjs";
|
|
82
|
+
import"./main-cvmtmn9v.mjs";
|
|
83
83
|
import {
|
|
84
84
|
taggedEnum,
|
|
85
85
|
is2,
|
|
@@ -5875,7 +5875,7 @@ var status = make("status", {
|
|
|
5875
5875
|
}
|
|
5876
5876
|
})).pipe(withDescription4("Show relay, extension, and target status"));
|
|
5877
5877
|
var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
|
|
5878
|
-
const { runMcpServer } = yield* promise(() => import("./mcp-
|
|
5878
|
+
const { runMcpServer } = yield* promise(() => import("./mcp-7xce28nt.mjs"));
|
|
5879
5879
|
yield* runMcpServer;
|
|
5880
5880
|
})).pipe(withDescription4("Run the browse MCP server over stdio"));
|
|
5881
5881
|
registerCliCommand(400, () => tabs);
|
|
@@ -6323,7 +6323,7 @@ registerCliCommand(710, () => flightRecorder);
|
|
|
6323
6323
|
|
|
6324
6324
|
// src/cli/relay.ts
|
|
6325
6325
|
var serve = make("serve", {}, fn("Cli.serve")(function* () {
|
|
6326
|
-
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-
|
|
6326
|
+
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-nfphdh3e.mjs"), import("./helpers-4dc8bwcq.mjs")]));
|
|
6327
6327
|
const port = yield* portConfig;
|
|
6328
6328
|
const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
|
|
6329
6329
|
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.154";
|
|
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,26 +17,29 @@ 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-g69mmry2.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-65ktt8gg.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-nzpee3fp.mjs")).supervisesMcp()) {
|
|
29
|
+
const { runBinaryMcp } = await import("./supervisor-nzpee3fp.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-
|
|
35
|
-
let
|
|
34
|
+
const { runMcpServer } = await import("./mcp-7xce28nt.mjs");
|
|
35
|
+
let stdinGone = false;
|
|
36
|
+
const onStdinGone = () => {
|
|
37
|
+
stdinGone = true;
|
|
38
|
+
};
|
|
39
|
+
process.stdin.once("end", onStdinGone);
|
|
40
|
+
process.stdin.once("close", onStdinGone);
|
|
41
|
+
process.stdin.once("error", onStdinGone);
|
|
36
42
|
let signalled = false;
|
|
37
|
-
process.stdin.once("end", () => {
|
|
38
|
-
stdinEnded = true;
|
|
39
|
-
});
|
|
40
43
|
const onSignal = () => {
|
|
41
44
|
signalled = true;
|
|
42
45
|
};
|
|
@@ -44,19 +47,19 @@ if (command === "--version" || command === "-v") {
|
|
|
44
47
|
process.once("SIGTERM", onSignal);
|
|
45
48
|
runMcpServer.pipe(NodeRuntime.runMain({
|
|
46
49
|
teardown: (exit, onExit) => defaultTeardown(exit, (code) => {
|
|
47
|
-
if (
|
|
50
|
+
if (stdinGone && !signalled && code === 130)
|
|
48
51
|
return process.exit(0);
|
|
49
52
|
onExit(code);
|
|
50
53
|
})
|
|
51
54
|
}));
|
|
52
55
|
} else if (command === "self-update" || command === "runtime-switch") {
|
|
53
|
-
const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-
|
|
56
|
+
const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-9mn6pkfp.mjs");
|
|
54
57
|
await (command === "self-update" ? runSelfUpdate : runRuntimeSwitch)(process.argv.slice(3));
|
|
55
58
|
} else if (command === "update" && !askedForHelp) {
|
|
56
|
-
const { runUpdateCommand } = await import("./update-
|
|
59
|
+
const { runUpdateCommand } = await import("./update-m2pgdzm6.mjs");
|
|
57
60
|
await runUpdateCommand(process.argv.slice(3));
|
|
58
61
|
} else if (command && setupCommands.has(command) && !askedForHelp) {
|
|
59
|
-
const { runSetup } = await import("./setup-
|
|
62
|
+
const { runSetup } = await import("./setup-g4mytak4.mjs");
|
|
60
63
|
await runSetup(command, process.argv.slice(3));
|
|
61
64
|
} else {
|
|
62
65
|
if (preCliHelp || !command || command === "--help" || command === "-h") {
|
|
@@ -93,9 +96,9 @@ executable in ~/.local/bin (or $XDG_BIN_HOME).
|
|
|
93
96
|
`);
|
|
94
97
|
}
|
|
95
98
|
if (command === "status" && !askedForHelp && !process.argv.includes("--json")) {
|
|
96
|
-
const { printSetupStatus } = await import("./setup-
|
|
99
|
+
const { printSetupStatus } = await import("./setup-g4mytak4.mjs");
|
|
97
100
|
printSetupStatus();
|
|
98
101
|
}
|
|
99
|
-
const { runCli } = await import("./cli-
|
|
102
|
+
const { runCli } = await import("./cli-b1a4wehd.mjs");
|
|
100
103
|
runCli(preCliHelp ? ["--help"] : undefined);
|
|
101
104
|
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
parseTargetSelection2,
|
|
13
13
|
getObject2,
|
|
14
14
|
getString2
|
|
15
|
-
} from "./main-
|
|
15
|
+
} from "./main-f1y8arm5.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-mh43bbrh.mjs";
|
|
107
107
|
|
|
108
108
|
// node_modules/effect/dist/PrimaryKey.js
|
|
109
109
|
var symbol = "~effect/PrimaryKey";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
installedRuntime2,
|
|
7
7
|
autoUpdateStatus,
|
|
8
8
|
updateAvailable
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-mh43bbrh.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-9mn6pkfp.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-e9prwwjg.mjs";
|
|
4
4
|
import {
|
|
5
5
|
configRoot2,
|
|
6
6
|
dataRoot,
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
storeUrl,
|
|
21
21
|
installedVersion,
|
|
22
22
|
runCommand
|
|
23
|
-
} from "./main-
|
|
23
|
+
} from "./main-mh43bbrh.mjs";
|
|
24
24
|
import {
|
|
25
25
|
formatPairingCode
|
|
26
|
-
} from "./main-
|
|
26
|
+
} from "./main-q61mzkdk.mjs";
|
|
27
27
|
import {
|
|
28
28
|
unpackedExtensionId
|
|
29
29
|
} from "./main-b3jrctcx.mjs";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./main-bc8cjey0.mjs";
|
|
16
16
|
import {
|
|
17
17
|
opencodeBrowserBuildId2
|
|
18
|
-
} from "./main-
|
|
18
|
+
} from "./main-e9prwwjg.mjs";
|
|
19
19
|
import {
|
|
20
20
|
compiledBinary,
|
|
21
21
|
scriptEntry,
|
|
@@ -24,10 +24,10 @@ import {
|
|
|
24
24
|
compareVersions,
|
|
25
25
|
installedRuntime2,
|
|
26
26
|
installedVersion
|
|
27
|
-
} from "./main-
|
|
27
|
+
} from "./main-mh43bbrh.mjs";
|
|
28
28
|
import {
|
|
29
29
|
relayAuthorization
|
|
30
|
-
} from "./main-
|
|
30
|
+
} from "./main-cvmtmn9v.mjs";
|
|
31
31
|
import {
|
|
32
32
|
Pointer,
|
|
33
33
|
passthrough,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-e9prwwjg.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.154", 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.154.zip", sha256: "642eeb582627e8d79ba3bb4ed810ca2eb98f27940f5bf03071eab47327a9e279", size: 183293 }) {
|
|
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,13 +5,13 @@ import {
|
|
|
5
5
|
bundledPairingCodeTtlMs,
|
|
6
6
|
mintPairingCode,
|
|
7
7
|
writeExtensionPairing
|
|
8
|
-
} from "./main-
|
|
8
|
+
} from "./main-q61mzkdk.mjs";
|
|
9
9
|
import {
|
|
10
10
|
configRoot2,
|
|
11
11
|
cacheRoot,
|
|
12
12
|
devExtensionUrl,
|
|
13
13
|
devExtensionFolder
|
|
14
|
-
} from "./main-
|
|
14
|
+
} from "./main-mh43bbrh.mjs";
|
|
15
15
|
|
|
16
16
|
// src/setup/dev-extension.ts
|
|
17
17
|
import { createHash } from "node:crypto";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./main-4h7rfhhr.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isValidSessionId2
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-f1y8arm5.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-mh43bbrh.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-e9prwwjg.mjs";
|
|
49
49
|
import {
|
|
50
50
|
cliCommand,
|
|
51
51
|
autoUpdateStatus
|
|
52
|
-
} from "./main-
|
|
52
|
+
} from "./main-mh43bbrh.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-f1y8arm5.mjs";
|
|
73
73
|
import"./main-4h7rfhhr.mjs";
|
|
74
74
|
import {
|
|
75
75
|
updateJson2,
|
|
76
76
|
createUpdateWatcher2
|
|
77
|
-
} from "./main-
|
|
77
|
+
} from "./main-7tpc4ff1.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-1bj9pxrn.mjs";
|
|
159
159
|
import {
|
|
160
160
|
makeUnsafe,
|
|
161
161
|
make3,
|
|
162
162
|
listSecrets
|
|
163
|
-
} from "./main-
|
|
163
|
+
} from "./main-r5x5kmz5.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-cvmtmn9v.mjs";
|
|
179
179
|
import {
|
|
180
180
|
Class,
|
|
181
181
|
taggedEnum,
|
|
@@ -353,7 +353,9 @@ import {
|
|
|
353
353
|
ignore,
|
|
354
354
|
ignoreCause,
|
|
355
355
|
timeout,
|
|
356
|
+
sleep,
|
|
356
357
|
race,
|
|
358
|
+
raceFirst,
|
|
357
359
|
when2,
|
|
358
360
|
match4,
|
|
359
361
|
matchCauseEffect,
|
|
@@ -367,6 +369,7 @@ import {
|
|
|
367
369
|
scope,
|
|
368
370
|
scoped,
|
|
369
371
|
acquireRelease,
|
|
372
|
+
acquireUseRelease,
|
|
370
373
|
ensuring,
|
|
371
374
|
onError,
|
|
372
375
|
onExit,
|
|
@@ -9570,6 +9573,33 @@ registerMcpTools({
|
|
|
9570
9573
|
|
|
9571
9574
|
// src/mcp.ts
|
|
9572
9575
|
var packageRoot = path4.dirname(path4.dirname(fileURLToPath(import.meta.url)));
|
|
9576
|
+
var toolCalls = {
|
|
9577
|
+
running: 0,
|
|
9578
|
+
idle: []
|
|
9579
|
+
};
|
|
9580
|
+
var toolCallsIdle = callback2((resume) => {
|
|
9581
|
+
if (toolCalls.running === 0) {
|
|
9582
|
+
resume(void_3);
|
|
9583
|
+
return void_3;
|
|
9584
|
+
}
|
|
9585
|
+
const wake = () => resume(void_3);
|
|
9586
|
+
toolCalls.idle.push(wake);
|
|
9587
|
+
return sync2(() => {
|
|
9588
|
+
const index = toolCalls.idle.indexOf(wake);
|
|
9589
|
+
if (index !== -1)
|
|
9590
|
+
toolCalls.idle.splice(index, 1);
|
|
9591
|
+
});
|
|
9592
|
+
});
|
|
9593
|
+
var toolCallStarted = () => {
|
|
9594
|
+
toolCalls.running++;
|
|
9595
|
+
};
|
|
9596
|
+
var toolCallFinished = () => {
|
|
9597
|
+
toolCalls.running--;
|
|
9598
|
+
if (toolCalls.running > 0)
|
|
9599
|
+
return;
|
|
9600
|
+
for (const wake of toolCalls.idle.splice(0))
|
|
9601
|
+
wake();
|
|
9602
|
+
};
|
|
9573
9603
|
var mcpInstructions = `browse drives the user's real Chrome-family browser through the browse extension, so logins, extensions and open tabs are already there and the user can watch or take over. \`execute\` runs Playwright JavaScript on a session's page; the session tools manage named tabs.
|
|
9574
9604
|
|
|
9575
9605
|
Use one loop: inspect, act, verify.
|
|
@@ -9636,10 +9666,10 @@ var registerTools = gen(function* () {
|
|
|
9636
9666
|
handle: (payload) => {
|
|
9637
9667
|
const requiresRelay = typeof spec.requiresRelayCompatibility === "function" ? spec.requiresRelayCompatibility(payload) : spec.requiresRelayCompatibility !== false;
|
|
9638
9668
|
const operation = requiresRelay ? ensureRelay({ relay }).pipe(flatMap3((readiness) => readiness.buildProblem ? fail6(new Error(readiness.buildProblem)) : spec.handle(payload))) : spec.handle(payload);
|
|
9639
|
-
return operation.pipe(match4({
|
|
9669
|
+
return acquireUseRelease(sync2(toolCallStarted), () => operation.pipe(match4({
|
|
9640
9670
|
onFailure: (error) => toolResult({ text: mcpErrorMessage2(spec.name, error.message), isError: true }),
|
|
9641
9671
|
onSuccess: (value) => spec.result ? spec.result(value) : toolResultForValue2(value, spec.outputSchema ? { outputSchema: spec.outputSchema } : {})
|
|
9642
|
-
}), flatMap3((result) => ctx.caller.pipe(map5((caller) => withUpdateNote(caller, spec.name, result)))));
|
|
9672
|
+
}), flatMap3((result) => ctx.caller.pipe(map5((caller) => withUpdateNote(caller, spec.name, result))))), () => sync2(toolCallFinished));
|
|
9643
9673
|
}
|
|
9644
9674
|
});
|
|
9645
9675
|
yield* forEach(buildRegisteredMcpTools(ctx), register, { discard: true });
|
|
@@ -9651,7 +9681,39 @@ var mcpServerLayer = layerStdio({
|
|
|
9651
9681
|
protocols: [v2026_07_28, v2025_11_252, v2025_06_182, v2025_03_262, v2024_11_052]
|
|
9652
9682
|
});
|
|
9653
9683
|
var mcpToolsLayer = effectDiscard(registerTools);
|
|
9654
|
-
var
|
|
9684
|
+
var toolCallWaitMs = 30000;
|
|
9685
|
+
var answerFlushMs = 150;
|
|
9686
|
+
var finishToolCalls = gen(function* () {
|
|
9687
|
+
const deadline = Date.now() + toolCallWaitMs;
|
|
9688
|
+
while (true) {
|
|
9689
|
+
const remaining = Math.max(0, deadline - Date.now());
|
|
9690
|
+
if (toolCalls.running > 0) {
|
|
9691
|
+
if (remaining === 0)
|
|
9692
|
+
return;
|
|
9693
|
+
yield* raceFirst(toolCallsIdle, sleep(remaining));
|
|
9694
|
+
continue;
|
|
9695
|
+
}
|
|
9696
|
+
yield* sleep(answerFlushMs);
|
|
9697
|
+
if (toolCalls.running === 0)
|
|
9698
|
+
return;
|
|
9699
|
+
}
|
|
9700
|
+
});
|
|
9701
|
+
var stdinClosed = callback2((resume) => {
|
|
9702
|
+
if (process.stdin.readableEnded || process.stdin.destroyed) {
|
|
9703
|
+
resume(void_3);
|
|
9704
|
+
return void_3;
|
|
9705
|
+
}
|
|
9706
|
+
const closed = () => resume(void_3);
|
|
9707
|
+
process.stdin.once("end", closed);
|
|
9708
|
+
process.stdin.once("close", closed);
|
|
9709
|
+
process.stdin.once("error", closed);
|
|
9710
|
+
return sync2(() => {
|
|
9711
|
+
process.stdin.off("end", closed);
|
|
9712
|
+
process.stdin.off("close", closed);
|
|
9713
|
+
process.stdin.off("error", closed);
|
|
9714
|
+
});
|
|
9715
|
+
});
|
|
9716
|
+
var runMcpServer = launch(mcpServerLayer.pipe(provide2(mcpToolsLayer.pipe(provide2(McpServer.layer))), provide2(layer), provide2(layerFetchMcp))).pipe(raceFirst(stdinClosed.pipe(andThen2(finishToolCalls), andThen2(interrupt3))));
|
|
9655
9717
|
export {
|
|
9656
9718
|
mcpErrorMessage2 as mcpErrorMessage,
|
|
9657
9719
|
mcpInstructions,
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
browseServerCommand,
|
|
7
7
|
editAgentConfig,
|
|
8
8
|
configureMcp
|
|
9
|
-
} from "./main-
|
|
10
|
-
import"./main-
|
|
9
|
+
} from "./main-cp57k02g.mjs";
|
|
10
|
+
import"./main-e9prwwjg.mjs";
|
|
11
11
|
import {
|
|
12
12
|
configRoot2,
|
|
13
13
|
dataRoot,
|
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
cacheRoot,
|
|
16
16
|
binRoot,
|
|
17
17
|
binaryName
|
|
18
|
-
} from "./main-
|
|
18
|
+
} from "./main-mh43bbrh.mjs";
|
|
19
19
|
import"./main-4h7rfhhr.mjs";
|
|
20
|
-
import"./main-
|
|
20
|
+
import"./main-q61mzkdk.mjs";
|
|
21
21
|
import"./main-b3jrctcx.mjs";
|
|
22
22
|
import {
|
|
23
23
|
legacyDataRoot,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2,
|
|
3
3
|
opencodeBrowserBuildId2
|
|
4
|
-
} from "./main-
|
|
4
|
+
} from "./main-e9prwwjg.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-mh43bbrh.mjs";
|
|
29
29
|
import {
|
|
30
30
|
extensionProtocolVersion,
|
|
31
31
|
minExtensionProtocolVersion,
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
isRestrictedTarget2,
|
|
103
103
|
isRestrictedUrl2,
|
|
104
104
|
dataUrlDocument2
|
|
105
|
-
} from "./main-
|
|
105
|
+
} from "./main-f1y8arm5.mjs";
|
|
106
106
|
import {
|
|
107
107
|
context,
|
|
108
108
|
pendingPairingCodeKeys,
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
pairingSessionKey,
|
|
121
121
|
sessionProof,
|
|
122
122
|
wrapToken
|
|
123
|
-
} from "./main-
|
|
123
|
+
} from "./main-q61mzkdk.mjs";
|
|
124
124
|
import {
|
|
125
125
|
makeUnsafe,
|
|
126
126
|
terminateChildProcess,
|
|
@@ -142,16 +142,16 @@ import {
|
|
|
142
142
|
checkNavigationUrl,
|
|
143
143
|
readSecret,
|
|
144
144
|
secretText
|
|
145
|
-
} from "./main-
|
|
145
|
+
} from "./main-r5x5kmz5.mjs";
|
|
146
146
|
import {
|
|
147
147
|
defaultJournalBaseDir,
|
|
148
148
|
makeJournalEntry,
|
|
149
149
|
appendJournalEntry,
|
|
150
150
|
startJournalRetention
|
|
151
|
-
} from "./main-
|
|
151
|
+
} from "./main-xa2jmwcw.mjs";
|
|
152
152
|
import {
|
|
153
153
|
createUpdateWatcher2
|
|
154
|
-
} from "./main-
|
|
154
|
+
} from "./main-7tpc4ff1.mjs";
|
|
155
155
|
import {
|
|
156
156
|
SettingsInputError,
|
|
157
157
|
parseSettingChanges,
|
|
@@ -159,13 +159,13 @@ import {
|
|
|
159
159
|
settingsToExtension,
|
|
160
160
|
describeSettings,
|
|
161
161
|
describeChanges
|
|
162
|
-
} from "./main-
|
|
162
|
+
} from "./main-1bj9pxrn.mjs";
|
|
163
163
|
import {
|
|
164
164
|
relayHostname,
|
|
165
165
|
isLocalPeer,
|
|
166
166
|
installedDevExtension,
|
|
167
167
|
syncDevExtension
|
|
168
|
-
} from "./main-
|
|
168
|
+
} from "./main-r013n42g.mjs";
|
|
169
169
|
import {
|
|
170
170
|
legacyRoots
|
|
171
171
|
} from "./main-ckssvk4c.mjs";
|
|
@@ -186,7 +186,7 @@ import {
|
|
|
186
186
|
relayToken,
|
|
187
187
|
secretsEqual,
|
|
188
188
|
ensurePrivateDirectory
|
|
189
|
-
} from "./main-
|
|
189
|
+
} from "./main-cvmtmn9v.mjs";
|
|
190
190
|
import {
|
|
191
191
|
taggedEnum,
|
|
192
192
|
is2,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import"./main-9bk4pprj.mjs";
|
|
2
|
-
import"./main-
|
|
2
|
+
import"./main-e9prwwjg.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-mh43bbrh.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-f1y8arm5.mjs";
|
|
27
27
|
import"./main-4h7rfhhr.mjs";
|
|
28
28
|
import"./main-bc8cjey0.mjs";
|
|
29
|
-
import"./main-
|
|
29
|
+
import"./main-cvmtmn9v.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-cp57k02g.mjs";
|
|
67
67
|
import {
|
|
68
68
|
opencodeBrowserBuildId2
|
|
69
|
-
} from "./main-
|
|
69
|
+
} from "./main-e9prwwjg.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-mh43bbrh.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-q61mzkdk.mjs";
|
|
101
101
|
import {
|
|
102
102
|
unpackedExtensionId,
|
|
103
103
|
extensionProtocolSkew,
|
|
@@ -105,16 +105,16 @@ import {
|
|
|
105
105
|
} from "./main-b3jrctcx.mjs";
|
|
106
106
|
import {
|
|
107
107
|
defaultSiteSecretsDir
|
|
108
|
-
} from "./main-
|
|
108
|
+
} from "./main-r5x5kmz5.mjs";
|
|
109
109
|
import {
|
|
110
110
|
parseHostname,
|
|
111
111
|
readRelayConfig,
|
|
112
112
|
writeRelayConfig,
|
|
113
113
|
syncDevExtension
|
|
114
|
-
} from "./main-
|
|
114
|
+
} from "./main-r013n42g.mjs";
|
|
115
115
|
import {
|
|
116
116
|
relayAuthorization
|
|
117
|
-
} from "./main-
|
|
117
|
+
} from "./main-cvmtmn9v.mjs";
|
|
118
118
|
|
|
119
119
|
// src/setup.ts
|
|
120
120
|
import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync } from "node:fs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-e9prwwjg.mjs";
|
|
2
2
|
import {
|
|
3
3
|
entrySpawnCommand,
|
|
4
4
|
installedRuntime2,
|
|
5
5
|
installedVersion
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-mh43bbrh.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-b1a4wehd.mjs");
|
|
38
38
|
return runCli();
|
|
39
39
|
}
|
|
40
40
|
const REPLAY = `opencode-browser-shim-initialize-${randomUUID()}`;
|
|
@@ -45,6 +45,7 @@ async function runBinaryMcp(args) {
|
|
|
45
45
|
process.env.OPENCODE_BROWSER_CLIENT_PID = String(process.pid);
|
|
46
46
|
let version = current();
|
|
47
47
|
let child;
|
|
48
|
+
const servers = new Set;
|
|
48
49
|
let initialize;
|
|
49
50
|
let initialized;
|
|
50
51
|
let swapping = false;
|
|
@@ -57,11 +58,44 @@ async function runBinaryMcp(args) {
|
|
|
57
58
|
const toChild = (line) => child.stdin.write(line + `
|
|
58
59
|
`);
|
|
59
60
|
let finishing = false;
|
|
61
|
+
const exit = (code, flush) => {
|
|
62
|
+
finishing = true;
|
|
63
|
+
if (!flush)
|
|
64
|
+
return process.exit(code);
|
|
65
|
+
process.stdout.write("", () => process.exit(code));
|
|
66
|
+
};
|
|
60
67
|
const finish = (code) => {
|
|
61
68
|
if (finishing)
|
|
62
69
|
return;
|
|
70
|
+
for (const running of servers)
|
|
71
|
+
running.kill();
|
|
72
|
+
exit(code, true);
|
|
73
|
+
};
|
|
74
|
+
let stopping;
|
|
75
|
+
let stopDeadline;
|
|
76
|
+
let leaving = false;
|
|
77
|
+
const stopped = () => {
|
|
78
|
+
if (!stopping || leaving)
|
|
79
|
+
return;
|
|
80
|
+
leaving = true;
|
|
81
|
+
clearTimeout(stopDeadline);
|
|
82
|
+
exit(stopping.code, stopping.flush);
|
|
83
|
+
};
|
|
84
|
+
const stop = (code, flush, force = false) => {
|
|
85
|
+
if (stopping || finishing && !force)
|
|
86
|
+
return;
|
|
87
|
+
stopping = { code, flush };
|
|
63
88
|
finishing = true;
|
|
64
|
-
|
|
89
|
+
for (const running of servers)
|
|
90
|
+
running.kill();
|
|
91
|
+
if (servers.size === 0)
|
|
92
|
+
return stopped();
|
|
93
|
+
stopDeadline = setTimeout(() => {
|
|
94
|
+
for (const running of servers)
|
|
95
|
+
running.kill("SIGKILL");
|
|
96
|
+
stopped();
|
|
97
|
+
}, 2000);
|
|
98
|
+
stopDeadline.unref();
|
|
65
99
|
};
|
|
66
100
|
const parse = (line) => {
|
|
67
101
|
try {
|
|
@@ -94,6 +128,7 @@ async function runBinaryMcp(args) {
|
|
|
94
128
|
const [file, ...prefix] = entrySpawnCommand(command());
|
|
95
129
|
const next = spawn(file, [...prefix, "mcp", ...args], { stdio: ["pipe", "pipe", "inherit"], env: { ...process.env, [directEnvironmentVariable]: "1" }, windowsHide: true });
|
|
96
130
|
next.stdin.on("error", () => {});
|
|
131
|
+
servers.add(next);
|
|
97
132
|
child = next;
|
|
98
133
|
let linesDone = false;
|
|
99
134
|
let exited;
|
|
@@ -103,8 +138,11 @@ async function runBinaryMcp(args) {
|
|
|
103
138
|
finish(exited.code ?? (exited.signal ? 1 : 0));
|
|
104
139
|
};
|
|
105
140
|
next.on("close", (code, signal) => {
|
|
141
|
+
servers.delete(next);
|
|
106
142
|
exited = { code, signal };
|
|
107
143
|
finishChild();
|
|
144
|
+
if (stopping && servers.size === 0)
|
|
145
|
+
stopped();
|
|
108
146
|
});
|
|
109
147
|
const reader = createInterface({ input: next.stdout });
|
|
110
148
|
reader.on("close", () => {
|
|
@@ -208,8 +246,10 @@ async function runBinaryMcp(args) {
|
|
|
208
246
|
start(false);
|
|
209
247
|
createInterface({ input: process.stdin }).on("line", fromClient).on("close", () => {
|
|
210
248
|
child.stdin.end();
|
|
211
|
-
setTimeout(() =>
|
|
249
|
+
setTimeout(() => stop(0, true), 5000).unref();
|
|
212
250
|
});
|
|
251
|
+
process.on("SIGINT", () => stop(130, false, true));
|
|
252
|
+
process.on("SIGTERM", () => stop(143, false, true));
|
|
213
253
|
setInterval(() => void maybeSwap(), 1000).unref();
|
|
214
254
|
}
|
|
215
255
|
function supervisesMcp() {
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
updateNotice2,
|
|
5
5
|
createUpdateWatcher2,
|
|
6
6
|
runUpdateCommand2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-7tpc4ff1.mjs";
|
|
8
8
|
import"./main-b3jrctcx.mjs";
|
|
9
|
-
import"./main-
|
|
10
|
-
import"./main-
|
|
9
|
+
import"./main-mh43bbrh.mjs";
|
|
10
|
+
import"./main-e9prwwjg.mjs";
|
|
11
11
|
export {
|
|
12
12
|
createUpdateWatcher2 as createUpdateWatcher,
|
|
13
13
|
formatUpdateNotice2 as formatUpdateNotice,
|
package/package.json
CHANGED
package/dist/main-90t2fp6z.mjs
DELETED