@opencode/browse 0.0.17-dev.180 → 0.0.17-dev.182
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/{Runtime-jrg7sc9p.mjs → Runtime-xss8qan1.mjs} +1 -1
- package/dist/{cli-dbb5bjne.mjs → cli-29nz7n5s.mjs} +42 -41
- package/dist/cli.mjs +14 -14
- package/dist/{helpers-mbetgbwv.mjs → helpers-vyfqh9b2.mjs} +1 -3
- package/dist/{index-j79y2me1.mjs → index-gjq7chrk.mjs} +2 -2
- package/dist/{legacy-runtime-eky6yenx.mjs → legacy-runtime-6hnptg9g.mjs} +30 -17
- package/dist/main-4vvyemrj.mjs +4 -0
- package/dist/{main-awaqqre9.mjs → main-6a10pzcy.mjs} +117 -4
- package/dist/{main-f98q5tcf.mjs → main-6hvv25x8.mjs} +27 -29
- package/dist/main-6yn76a8h.mjs +1014 -0
- package/dist/{main-q2d5bd1e.mjs → main-7y95agwd.mjs} +8 -10
- package/dist/{main-3mhynene.mjs → main-9frwnsnf.mjs} +3 -5
- package/dist/{main-048kx59h.mjs → main-akpa411k.mjs} +6 -8
- package/dist/{main-v2a390e1.mjs → main-ddha60b9.mjs} +7 -9
- package/dist/{main-wfmad10p.mjs → main-emsvawnv.mjs} +16 -18
- package/dist/{main-g1frnq76.mjs → main-fak5r9je.mjs} +8 -7
- package/dist/{main-fpn564ph.mjs → main-gffzw2p5.mjs} +7 -4
- package/dist/{main-s3g4jwx5.mjs → main-jeta10c6.mjs} +23 -25
- package/dist/{main-wpt5ha44.mjs → main-m45zegrn.mjs} +371 -167
- package/dist/{main-46wtkfsd.mjs → main-qrjqb2nq.mjs} +200 -989
- package/dist/{main-jwss6gk9.mjs → main-s32xre10.mjs} +2 -2
- package/dist/main-wr4d7914.mjs +213 -0
- package/dist/{main-r8g3xydm.mjs → main-yegq8f5a.mjs} +3 -5
- package/dist/{main-44rp8pxg.mjs → main-zhhwe1b2.mjs} +4 -4
- package/dist/{mcp-amxrbrbd.mjs → mcp-s4zq3r5e.mjs} +37 -32
- package/dist/{migrate-07f3f3yp.mjs → migrate-bjbv00k0.mjs} +5 -6
- package/dist/{relay-e7fx469h.mjs → relay-c4d4s5wv.mjs} +134 -63
- package/dist/{runtime-update-xt7x7j6c.mjs → runtime-update-dxb97fdt.mjs} +9 -9
- package/dist/{setup-m85mamg6.mjs → setup-mjb2zzdx.mjs} +196 -129
- package/dist/{skill-text-7bqtc16a.mjs → skill-text-1rg5b5np.mjs} +12 -0
- package/dist/{supervisor-6zbwkkpt.mjs → supervisor-vwmswj0w.mjs} +10 -6
- package/dist/{update-drswqt2m.mjs → update-b708rvmn.mjs} +3 -4
- package/dist/{version-v3heqz8b.mjs → version-qnx1byw6.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +12 -0
- package/dist/main-4h7rfhhr.mjs +0 -61
- package/dist/main-amkq7v9m.mjs +0 -4
- package/dist/main-gg7f12gg.mjs +0 -114
- package/dist/main-qazf3bhk.mjs +0 -223
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import {
|
|
2
|
+
writePrivateJsonFileSync,
|
|
3
|
+
defaultPort2
|
|
4
|
+
} from "./main-6yn76a8h.mjs";
|
|
5
|
+
import {
|
|
6
|
+
stateRoot
|
|
7
|
+
} from "./main-6a10pzcy.mjs";
|
|
8
|
+
|
|
9
|
+
// src/relay/port.ts
|
|
10
|
+
import fs from "node:fs";
|
|
11
|
+
import net from "node:net";
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
var fallbackPorts = [19990, 19991, 19992, 19993, 19994, 19995, 19996, 19997];
|
|
14
|
+
var endpointForPort = (port) => `http://127.0.0.1:${port}`;
|
|
15
|
+
function envPort(env = process.env) {
|
|
16
|
+
const raw = env.OPENCODE_BROWSER_PORT;
|
|
17
|
+
if (raw === undefined || raw.trim() === "")
|
|
18
|
+
return;
|
|
19
|
+
const port = Number(raw);
|
|
20
|
+
return Number.isSafeInteger(port) && port > 0 && port < 65536 ? port : undefined;
|
|
21
|
+
}
|
|
22
|
+
var configuredRelayPort = (env = process.env) => envPort(env) ?? defaultPort2;
|
|
23
|
+
var relayPortPinned = (env = process.env) => envPort(env) !== undefined;
|
|
24
|
+
var isPort = (value) => typeof value === "number" && Number.isSafeInteger(value) && value > 0 && value < 65536;
|
|
25
|
+
var isPositiveInt = (value) => typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
26
|
+
var relayStatePath = (root = stateRoot(), configuredPort = configuredRelayPort()) => path.join(root, "relays", String(configuredPort), "relay.json");
|
|
27
|
+
var lastRelayPortPath = (root = stateRoot(), configuredPort = configuredRelayPort()) => path.join(root, "relays", String(configuredPort), "last-port.json");
|
|
28
|
+
function readLastRelayPort(root = stateRoot(), configuredPort = configuredRelayPort()) {
|
|
29
|
+
try {
|
|
30
|
+
const value = JSON.parse(fs.readFileSync(lastRelayPortPath(root, configuredPort), "utf8"));
|
|
31
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && isPort(value.port) ? value.port : undefined;
|
|
32
|
+
} catch {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function writeLastRelayPort(port, root = stateRoot(), configuredPort = configuredRelayPort()) {
|
|
37
|
+
writePrivateJsonFileSync(lastRelayPortPath(root, configuredPort), { port }, { ensureParent: true });
|
|
38
|
+
}
|
|
39
|
+
function readRelayState(root = stateRoot(), configuredPort = configuredRelayPort()) {
|
|
40
|
+
try {
|
|
41
|
+
const value = JSON.parse(fs.readFileSync(relayStatePath(root, configuredPort), "utf8"));
|
|
42
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
43
|
+
return;
|
|
44
|
+
if (!isPort(value.port) || value.configuredPort !== configuredPort || !isPositiveInt(value.pid))
|
|
45
|
+
return;
|
|
46
|
+
if (typeof value.instanceId !== "string" || value.instanceId === "" || typeof value.startedAt !== "string")
|
|
47
|
+
return;
|
|
48
|
+
return {
|
|
49
|
+
port: value.port,
|
|
50
|
+
configuredPort: value.configuredPort,
|
|
51
|
+
pid: value.pid,
|
|
52
|
+
instanceId: value.instanceId,
|
|
53
|
+
startedAt: value.startedAt
|
|
54
|
+
};
|
|
55
|
+
} catch {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function writeRelayState(state, root = stateRoot()) {
|
|
60
|
+
writePrivateJsonFileSync(relayStatePath(root, state.configuredPort), state, { ensureParent: true });
|
|
61
|
+
}
|
|
62
|
+
function removeRelayState(instanceId, root = stateRoot(), configuredPort = configuredRelayPort()) {
|
|
63
|
+
const state = readRelayState(root, configuredPort);
|
|
64
|
+
if (!state || state.instanceId !== instanceId)
|
|
65
|
+
return;
|
|
66
|
+
try {
|
|
67
|
+
fs.rmSync(relayStatePath(root, state.configuredPort), { force: true });
|
|
68
|
+
} catch {}
|
|
69
|
+
}
|
|
70
|
+
function processAlive(pid) {
|
|
71
|
+
try {
|
|
72
|
+
process.kill(pid, 0);
|
|
73
|
+
return true;
|
|
74
|
+
} catch {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function resolveRelayPort(root = stateRoot()) {
|
|
79
|
+
const pinned = envPort();
|
|
80
|
+
if (pinned !== undefined)
|
|
81
|
+
return pinned;
|
|
82
|
+
const state = readRelayState(root);
|
|
83
|
+
if (state && state.configuredPort === configuredRelayPort() && processAlive(state.pid))
|
|
84
|
+
return state.port;
|
|
85
|
+
return defaultPort2;
|
|
86
|
+
}
|
|
87
|
+
function relayPortCandidates(configuredPort = configuredRelayPort()) {
|
|
88
|
+
return [...new Set([configuredPort, ...fallbackPorts])];
|
|
89
|
+
}
|
|
90
|
+
var browseVersion = (body) => typeof body === "object" && body !== null && typeof body.version === "string" && typeof body.instanceId === "string";
|
|
91
|
+
var relayStarting = (body) => typeof body === "object" && body !== null && body.code === "relay-starting";
|
|
92
|
+
async function probeRelayPort(port, timeoutMs = 500) {
|
|
93
|
+
try {
|
|
94
|
+
const response = await fetch(`${endpointForPort(port)}/version`, {
|
|
95
|
+
redirect: "manual",
|
|
96
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
97
|
+
});
|
|
98
|
+
const body = await response.json().catch(() => {
|
|
99
|
+
return;
|
|
100
|
+
});
|
|
101
|
+
if (response.status === 200 && browseVersion(body))
|
|
102
|
+
return "browse";
|
|
103
|
+
if (response.status === 503 && relayStarting(body))
|
|
104
|
+
return "browse";
|
|
105
|
+
return "other";
|
|
106
|
+
} catch {
|
|
107
|
+
return "nobody";
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async function browseVersionAt(port, timeoutMs) {
|
|
111
|
+
try {
|
|
112
|
+
const response = await fetch(`${endpointForPort(port)}/version`, {
|
|
113
|
+
redirect: "manual",
|
|
114
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
115
|
+
});
|
|
116
|
+
if (response.status !== 200)
|
|
117
|
+
return;
|
|
118
|
+
const body = await response.json().catch(() => {
|
|
119
|
+
return;
|
|
120
|
+
});
|
|
121
|
+
return browseVersion(body) ? body : undefined;
|
|
122
|
+
} catch {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
async function verifiedRelay(options = {}) {
|
|
127
|
+
const root = options.root ?? stateRoot();
|
|
128
|
+
const configuredPort = configuredRelayPort();
|
|
129
|
+
const state = readRelayState(root, configuredPort);
|
|
130
|
+
const live = state !== undefined && state.configuredPort === configuredPort && processAlive(state.pid) ? state : undefined;
|
|
131
|
+
const port = envPort() ?? live?.port ?? defaultPort2;
|
|
132
|
+
const version = await browseVersionAt(port, options.timeoutMs ?? 3000);
|
|
133
|
+
if (!version)
|
|
134
|
+
return;
|
|
135
|
+
const reread = readRelayState(root, configuredPort);
|
|
136
|
+
const after = reread !== undefined && reread.configuredPort === configuredPort && processAlive(reread.pid) ? reread : undefined;
|
|
137
|
+
const same = live === undefined ? true : after !== undefined && after.port === live.port && after.instanceId === live.instanceId;
|
|
138
|
+
if (!same)
|
|
139
|
+
return;
|
|
140
|
+
if (after && (after.port !== port || version.instanceId !== after.instanceId))
|
|
141
|
+
return;
|
|
142
|
+
return { endpoint: endpointForPort(port), instanceId: version.instanceId };
|
|
143
|
+
}
|
|
144
|
+
async function verifiedRelayEndpoint(options = {}) {
|
|
145
|
+
return (await verifiedRelay(options))?.endpoint;
|
|
146
|
+
}
|
|
147
|
+
async function liveRecordedRelay(configuredPort, root, timeoutMs) {
|
|
148
|
+
const state = readRelayState(root, configuredPort);
|
|
149
|
+
if (!state || state.configuredPort !== configuredPort || !processAlive(state.pid))
|
|
150
|
+
return;
|
|
151
|
+
const version = await browseVersionAt(state.port, timeoutMs);
|
|
152
|
+
return version?.instanceId === state.instanceId ? state : undefined;
|
|
153
|
+
}
|
|
154
|
+
async function liveRelayPort(options = {}) {
|
|
155
|
+
const root = options.root ?? stateRoot();
|
|
156
|
+
const state = await liveRecordedRelay(configuredRelayPort(), root, options.timeoutMs ?? 800);
|
|
157
|
+
return state?.port;
|
|
158
|
+
}
|
|
159
|
+
function portListText(ports) {
|
|
160
|
+
const groups = [];
|
|
161
|
+
const sorted = [...ports].sort((left, right) => left - right);
|
|
162
|
+
for (let index = 0;index < sorted.length; index++) {
|
|
163
|
+
const first = sorted[index];
|
|
164
|
+
let last = first;
|
|
165
|
+
while (sorted[index + 1] === last + 1)
|
|
166
|
+
last = sorted[++index];
|
|
167
|
+
groups.push(first === last ? String(first) : `${first}-${last}`);
|
|
168
|
+
}
|
|
169
|
+
return groups.join(", ");
|
|
170
|
+
}
|
|
171
|
+
function canBind(host, port) {
|
|
172
|
+
return new Promise((resolve) => {
|
|
173
|
+
const server = net.createServer();
|
|
174
|
+
server.unref();
|
|
175
|
+
server.once("error", (error) => resolve(error.code !== "EADDRINUSE"));
|
|
176
|
+
server.listen({ host, port, exclusive: true }, () => server.close(() => resolve(true)));
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
async function canListen(host, port) {
|
|
180
|
+
if (!await canBind(host, port))
|
|
181
|
+
return false;
|
|
182
|
+
return loopbackHost(host) || canBind("127.0.0.1", port);
|
|
183
|
+
}
|
|
184
|
+
var alreadyInUse = (host, port) => new Error(`listen EADDRINUSE: address already in use ${host}:${port}`);
|
|
185
|
+
var loopbackHost = (host) => host === "localhost" || host === "::1" || host === "[::1]" || /^127\./.test(host);
|
|
186
|
+
async function chooseRelayPort(options = {}) {
|
|
187
|
+
const configuredPort = options.configuredPort ?? configuredRelayPort();
|
|
188
|
+
const pinned = options.pinned ?? relayPortPinned();
|
|
189
|
+
if (pinned)
|
|
190
|
+
return configuredPort;
|
|
191
|
+
const host = options.host ?? "127.0.0.1";
|
|
192
|
+
const root = options.root ?? stateRoot();
|
|
193
|
+
const candidates = options.candidates ?? relayPortCandidates(configuredPort);
|
|
194
|
+
const probeTimeoutMs = options.probeTimeoutMs ?? 500;
|
|
195
|
+
const recorded = await liveRecordedRelay(configuredPort, root, probeTimeoutMs);
|
|
196
|
+
if (recorded)
|
|
197
|
+
throw alreadyInUse(host, recorded.port);
|
|
198
|
+
const last = !loopbackHost(host) ? readLastRelayPort(root, configuredPort) : undefined;
|
|
199
|
+
if (last !== undefined && await canListen(host, last))
|
|
200
|
+
return last;
|
|
201
|
+
for (const port of candidates) {
|
|
202
|
+
if (await canListen(host, port))
|
|
203
|
+
return port;
|
|
204
|
+
const owner = await probeRelayPort(port, probeTimeoutMs);
|
|
205
|
+
if (owner === "browse")
|
|
206
|
+
throw alreadyInUse(host, port);
|
|
207
|
+
if (owner === "nobody")
|
|
208
|
+
throw alreadyInUse(host, port);
|
|
209
|
+
}
|
|
210
|
+
throw new Error(`browse relay ports ${portListText(candidates)} are all in use. Set OPENCODE_BROWSER_PORT to a free port, or stop the program holding them.`);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export { endpointForPort, configuredRelayPort, relayPortPinned, writeLastRelayPort, readRelayState, writeRelayState, removeRelayState, processAlive, resolveRelayPort, probeRelayPort, verifiedRelay, verifiedRelayEndpoint, liveRelayPort, chooseRelayPort };
|
|
@@ -3,13 +3,11 @@ import {
|
|
|
3
3
|
compiledBinary,
|
|
4
4
|
checkoutRoot,
|
|
5
5
|
cliCommand,
|
|
6
|
+
unpackedReloadAdvice,
|
|
6
7
|
installedRuntime2,
|
|
7
8
|
autoUpdateStatus,
|
|
8
9
|
updateAvailable
|
|
9
|
-
} from "./main-
|
|
10
|
-
import {
|
|
11
|
-
unpackedReloadAdvice
|
|
12
|
-
} from "./main-gg7f12gg.mjs";
|
|
10
|
+
} from "./main-6a10pzcy.mjs";
|
|
13
11
|
|
|
14
12
|
// src/update.ts
|
|
15
13
|
import { execFile, spawnSync } from "node:child_process";
|
|
@@ -315,7 +313,7 @@ function runUpdate(args, deps) {
|
|
|
315
313
|
async function runUpdateCommand2(args) {
|
|
316
314
|
const log = (line) => process.stdout.write(line + `
|
|
317
315
|
`);
|
|
318
|
-
const { runInstalledUpdate } = await import("./runtime-update-
|
|
316
|
+
const { runInstalledUpdate } = await import("./runtime-update-dxb97fdt.mjs");
|
|
319
317
|
if (await runInstalledUpdate(args))
|
|
320
318
|
return;
|
|
321
319
|
if (compiledBinary()) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePrivateJsonFileSync
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-6yn76a8h.mjs";
|
|
4
4
|
import {
|
|
5
5
|
bundledPairingCodeTtlMs,
|
|
6
6
|
mintPairingCode,
|
|
7
7
|
writeExtensionPairing
|
|
8
|
-
} from "./main-
|
|
8
|
+
} from "./main-gffzw2p5.mjs";
|
|
9
9
|
import {
|
|
10
10
|
configRoot2,
|
|
11
11
|
cacheRoot,
|
|
12
12
|
devExtensionUrl,
|
|
13
13
|
devExtensionFolder
|
|
14
|
-
} from "./main-
|
|
14
|
+
} from "./main-6a10pzcy.mjs";
|
|
15
15
|
|
|
16
16
|
// src/setup/dev-extension.ts
|
|
17
17
|
import { createHash } from "node:crypto";
|
|
@@ -54,7 +54,7 @@ async function syncDevExtension(extension, options = {}) {
|
|
|
54
54
|
const manifest = JSON.parse(readFileSync(path.join(staging, "manifest.json"), "utf8"));
|
|
55
55
|
if (!manifest.key)
|
|
56
56
|
throw new Error("the dev extension has no manifest key, so it wouldn't have browse's unpacked ID");
|
|
57
|
-
writeExtensionPairing(staging, mintPairingCode(undefined, { ttlMs: bundledPairingCodeTtlMs }));
|
|
57
|
+
writeExtensionPairing(staging, mintPairingCode(undefined, { ttlMs: bundledPairingCodeTtlMs }), options.port);
|
|
58
58
|
const build = (() => {
|
|
59
59
|
try {
|
|
60
60
|
return JSON.parse(readFileSync(path.join(staging, "build.json"), "utf8")).build;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-9frwnsnf.mjs";
|
|
2
2
|
import {
|
|
3
3
|
filter,
|
|
4
4
|
empty,
|
|
@@ -42,19 +42,16 @@ import {
|
|
|
42
42
|
empty3,
|
|
43
43
|
jsonUnsafe,
|
|
44
44
|
layer
|
|
45
|
-
} from "./main-
|
|
45
|
+
} from "./main-jeta10c6.mjs";
|
|
46
46
|
import"./main-pmfd055v.mjs";
|
|
47
47
|
import {
|
|
48
48
|
opencodeBrowserVersion2
|
|
49
|
-
} from "./main-
|
|
49
|
+
} from "./main-4vvyemrj.mjs";
|
|
50
50
|
import {
|
|
51
51
|
cliCommand,
|
|
52
52
|
autoUpdateStatus
|
|
53
|
-
} from "./main-
|
|
54
|
-
import"./main-gg7f12gg.mjs";
|
|
53
|
+
} from "./main-6a10pzcy.mjs";
|
|
55
54
|
import {
|
|
56
|
-
option,
|
|
57
|
-
String2,
|
|
58
55
|
SessionContainer,
|
|
59
56
|
SessionsContainer,
|
|
60
57
|
SessionResetResponse,
|
|
@@ -63,19 +60,22 @@ import {
|
|
|
63
60
|
NetworkStopResponse,
|
|
64
61
|
AuthRunResponse,
|
|
65
62
|
TabsCleanupResponse,
|
|
66
|
-
getObject2
|
|
63
|
+
getObject2
|
|
64
|
+
} from "./main-6yn76a8h.mjs";
|
|
65
|
+
import {
|
|
66
|
+
option,
|
|
67
|
+
String2,
|
|
67
68
|
RelayRejected,
|
|
68
69
|
Service,
|
|
69
70
|
layerFetchMcp,
|
|
70
71
|
relayBuildProblem,
|
|
71
72
|
ensureRelay,
|
|
72
73
|
ensureExtensionConnected
|
|
73
|
-
} from "./main-
|
|
74
|
-
import"./main-4h7rfhhr.mjs";
|
|
74
|
+
} from "./main-qrjqb2nq.mjs";
|
|
75
75
|
import {
|
|
76
76
|
updateJson2,
|
|
77
77
|
createUpdateWatcher2
|
|
78
|
-
} from "./main-
|
|
78
|
+
} from "./main-yegq8f5a.mjs";
|
|
79
79
|
import {
|
|
80
80
|
settingSpecs,
|
|
81
81
|
securityVariables,
|
|
@@ -156,12 +156,12 @@ import {
|
|
|
156
156
|
toolResultForValue2,
|
|
157
157
|
mcpErrorMessage2,
|
|
158
158
|
toolResult
|
|
159
|
-
} from "./main-
|
|
159
|
+
} from "./main-emsvawnv.mjs";
|
|
160
160
|
import {
|
|
161
161
|
makeUnsafe,
|
|
162
162
|
make3,
|
|
163
163
|
listSecrets
|
|
164
|
-
} from "./main-
|
|
164
|
+
} from "./main-7y95agwd.mjs";
|
|
165
165
|
import {
|
|
166
166
|
Clock,
|
|
167
167
|
type,
|
|
@@ -175,8 +175,9 @@ import {
|
|
|
175
175
|
boolean,
|
|
176
176
|
orElse,
|
|
177
177
|
exhaustive
|
|
178
|
-
} from "./main-
|
|
179
|
-
import"./main-
|
|
178
|
+
} from "./main-akpa411k.mjs";
|
|
179
|
+
import"./main-s32xre10.mjs";
|
|
180
|
+
import"./main-wr4d7914.mjs";
|
|
180
181
|
import {
|
|
181
182
|
Class,
|
|
182
183
|
taggedEnum,
|
|
@@ -225,8 +226,21 @@ import {
|
|
|
225
226
|
toCodecJson,
|
|
226
227
|
Json,
|
|
227
228
|
JsonObject
|
|
228
|
-
} from "./main-
|
|
229
|
+
} from "./main-6hvv25x8.mjs";
|
|
229
230
|
import {
|
|
231
|
+
pipeArguments,
|
|
232
|
+
dual,
|
|
233
|
+
identity,
|
|
234
|
+
constant,
|
|
235
|
+
constTrue,
|
|
236
|
+
constVoid,
|
|
237
|
+
flow,
|
|
238
|
+
isString,
|
|
239
|
+
isNullish,
|
|
240
|
+
isObject,
|
|
241
|
+
isReadonlyObject,
|
|
242
|
+
hasProperty,
|
|
243
|
+
isTagged,
|
|
230
244
|
hash,
|
|
231
245
|
equals,
|
|
232
246
|
redact,
|
|
@@ -395,22 +409,7 @@ import {
|
|
|
395
409
|
logError,
|
|
396
410
|
logDebug,
|
|
397
411
|
annotateLogs
|
|
398
|
-
} from "./main-
|
|
399
|
-
import {
|
|
400
|
-
pipeArguments,
|
|
401
|
-
dual,
|
|
402
|
-
identity,
|
|
403
|
-
constant,
|
|
404
|
-
constTrue,
|
|
405
|
-
constVoid,
|
|
406
|
-
flow,
|
|
407
|
-
isString,
|
|
408
|
-
isNullish,
|
|
409
|
-
isObject,
|
|
410
|
-
isReadonlyObject,
|
|
411
|
-
hasProperty,
|
|
412
|
-
isTagged
|
|
413
|
-
} from "./main-qazf3bhk.mjs";
|
|
412
|
+
} from "./main-m45zegrn.mjs";
|
|
414
413
|
|
|
415
414
|
// node_modules/effect/dist/PubSub.js
|
|
416
415
|
var TypeId = "~effect/PubSub";
|
|
@@ -9406,6 +9405,10 @@ registerMcpTools({
|
|
|
9406
9405
|
type: "array",
|
|
9407
9406
|
items: { type: "string" },
|
|
9408
9407
|
description: "Optional domain allowlist: hosts or origins this session's tabs may load (example.com, *.example.com, https://app.example.com, http://localhost:3000). Navigations elsewhere are refused or sent back to about:blank; private and loopback addresses need an exact entry."
|
|
9408
|
+
},
|
|
9409
|
+
keepVisible: {
|
|
9410
|
+
type: "boolean",
|
|
9411
|
+
description: "Keep this session's own tabs visible and focused to the page between execute calls, for apps that pause or disconnect while hidden. Pages can notice. It never raises or focuses the window, never applies to a tab the user lent you, and is released when the session is deleted or reset or the tab closes."
|
|
9409
9412
|
}
|
|
9410
9413
|
}),
|
|
9411
9414
|
readOnly: false,
|
|
@@ -9417,11 +9420,13 @@ registerMcpTools({
|
|
|
9417
9420
|
const requestedId = optionalStringField(input, "id");
|
|
9418
9421
|
const readOnly = optionalBooleanField(input, "readOnly");
|
|
9419
9422
|
const allowedOrigins = optionalStringArrayField(input, "allowedOrigins");
|
|
9423
|
+
const keepVisible = optionalBooleanField(input, "keepVisible");
|
|
9420
9424
|
const browser = optionalStringField(input, "browser");
|
|
9421
9425
|
yield* ensureExtensionConnected({ relay: ctx.relay, waitForReconnect: true });
|
|
9422
9426
|
const session = yield* ctx.relay.sessionNew(requestedId, {
|
|
9423
9427
|
...readOnly ? { readOnly: true } : {},
|
|
9424
9428
|
...allowedOrigins ? { allowedOrigins } : {},
|
|
9429
|
+
...keepVisible ? { keepVisible: true } : {},
|
|
9425
9430
|
...browser ? { browser } : {}
|
|
9426
9431
|
});
|
|
9427
9432
|
ctx.establishCurrentSession(yield* ctx.caller, session.id);
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
editAgentConfig,
|
|
8
8
|
OPENCODE_CONFIG_NAMES,
|
|
9
9
|
configureMcp
|
|
10
|
-
} from "./main-
|
|
10
|
+
} from "./main-fak5r9je.mjs";
|
|
11
11
|
import {
|
|
12
12
|
legacyDataRoot,
|
|
13
13
|
legacyRoots,
|
|
14
14
|
legacyRuntime,
|
|
15
15
|
LEGACY_HANDOVER_GRACE_MS
|
|
16
16
|
} from "./main-pmfd055v.mjs";
|
|
17
|
-
import"./main-
|
|
17
|
+
import"./main-4vvyemrj.mjs";
|
|
18
18
|
import {
|
|
19
19
|
configRoot2,
|
|
20
20
|
dataRoot,
|
|
@@ -23,11 +23,10 @@ import {
|
|
|
23
23
|
binRoot,
|
|
24
24
|
binaryName,
|
|
25
25
|
devExtensionFolder
|
|
26
|
-
} from "./main-
|
|
26
|
+
} from "./main-6a10pzcy.mjs";
|
|
27
27
|
import"./main-tk4axre7.mjs";
|
|
28
|
-
import"./main-
|
|
29
|
-
import"./main-
|
|
30
|
-
import"./main-gg7f12gg.mjs";
|
|
28
|
+
import"./main-6yn76a8h.mjs";
|
|
29
|
+
import"./main-gffzw2p5.mjs";
|
|
31
30
|
|
|
32
31
|
// src/setup/migrate.ts
|
|
33
32
|
import fs from "node:fs";
|