@opencode/browse 0.0.17-dev.181 → 0.0.17-dev.183
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-1bdh4p0a.mjs → cli-n67t50qs.mjs} +18 -16
- package/dist/cli.mjs +12 -12
- package/dist/{helpers-bbaa1vjs.mjs → helpers-jj42z7rm.mjs} +1 -1
- package/dist/{legacy-runtime-yjsm0xpg.mjs → legacy-runtime-tne3461e.mjs} +6 -6
- package/dist/{main-qccyxwg8.mjs → main-1nnqhn1v.mjs} +2 -2
- package/dist/{main-32bwyqja.mjs → main-254jbd9y.mjs} +3 -3
- package/dist/{main-pq962g72.mjs → main-650pqeq5.mjs} +2 -2
- package/dist/main-70nwvs6t.mjs +4 -0
- package/dist/{main-q4typx7c.mjs → main-aj4grz5c.mjs} +2 -2
- package/dist/{main-tk2thty0.mjs → main-ans6rqv0.mjs} +4 -4
- package/dist/{main-sfxkq31s.mjs → main-b830e27p.mjs} +2 -2
- package/dist/{main-tg0r67xj.mjs → main-f1fdks8n.mjs} +2 -2
- package/dist/{main-rvn834gn.mjs → main-h3sgxdjn.mjs} +2 -2
- package/dist/{main-bt237ys7.mjs → main-jt4h0g8x.mjs} +3 -1
- package/dist/{main-rb7dermc.mjs → main-k39ype39.mjs} +3 -3
- package/dist/{main-6qfvnjxc.mjs → main-xnp01wxw.mjs} +2 -2
- package/dist/{main-reh7k0hv.mjs → main-zgawp964.mjs} +6 -5
- package/dist/{mcp-rjpmt73q.mjs → mcp-9sch561m.mjs} +15 -9
- package/dist/{migrate-hggn66v2.mjs → migrate-dwpc3854.mjs} +5 -5
- package/dist/{relay-fm6q9hnx.mjs → relay-q62xjvg0.mjs} +59 -15
- package/dist/{runtime-update-vdw1eajx.mjs → runtime-update-797qc0w9.mjs} +6 -6
- package/dist/{setup-wyrpwq4c.mjs → setup-31sys1aq.mjs} +21 -14
- package/dist/{skill-text-7bqtc16a.mjs → skill-text-1rg5b5np.mjs} +12 -0
- package/dist/{supervisor-nbce8yhg.mjs → supervisor-ratepwa5.mjs} +5 -5
- package/dist/{update-be8dfw51.mjs → update-7mb87vfx.mjs} +3 -3
- package/dist/{version-6j8cdg2k.mjs → version-144ecn73.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +12 -0
- package/dist/main-d5ke1bpm.mjs +0 -4
|
@@ -25,7 +25,7 @@ import"./main-pmfd055v.mjs";
|
|
|
25
25
|
import {
|
|
26
26
|
opencodeBrowserVersion2,
|
|
27
27
|
opencodeBrowserBuildId2
|
|
28
|
-
} from "./main-
|
|
28
|
+
} from "./main-70nwvs6t.mjs";
|
|
29
29
|
import {
|
|
30
30
|
configRoot2,
|
|
31
31
|
dataRoot,
|
|
@@ -40,11 +40,11 @@ import {
|
|
|
40
40
|
extensionProtocolVersion,
|
|
41
41
|
extensionProtocolAdvice,
|
|
42
42
|
autoUpdateStatus
|
|
43
|
-
} from "./main-
|
|
43
|
+
} from "./main-k39ype39.mjs";
|
|
44
44
|
import {
|
|
45
45
|
defaultPort2,
|
|
46
46
|
isValidSessionId2
|
|
47
|
-
} from "./main-
|
|
47
|
+
} from "./main-jt4h0g8x.mjs";
|
|
48
48
|
import {
|
|
49
49
|
option,
|
|
50
50
|
String2,
|
|
@@ -63,31 +63,31 @@ import {
|
|
|
63
63
|
ensureExtensionConnected,
|
|
64
64
|
stoppedRelayStatus,
|
|
65
65
|
statusCollections
|
|
66
|
-
} from "./main-
|
|
66
|
+
} from "./main-zgawp964.mjs";
|
|
67
67
|
import {
|
|
68
68
|
updateJson2,
|
|
69
69
|
formatUpdateNotice2,
|
|
70
70
|
updateNotice2
|
|
71
|
-
} from "./main-
|
|
71
|
+
} from "./main-1nnqhn1v.mjs";
|
|
72
72
|
import {
|
|
73
73
|
settingKeys,
|
|
74
74
|
formatSettings,
|
|
75
75
|
ensureSessionExists
|
|
76
|
-
} from "./main-
|
|
76
|
+
} from "./main-b830e27p.mjs";
|
|
77
77
|
import {
|
|
78
78
|
addSecret,
|
|
79
79
|
listSecrets,
|
|
80
80
|
removeSecret
|
|
81
|
-
} from "./main-
|
|
81
|
+
} from "./main-f1fdks8n.mjs";
|
|
82
82
|
import {
|
|
83
83
|
defaultJournalBaseDir,
|
|
84
84
|
readJournalEntries,
|
|
85
85
|
formatJournalEntry
|
|
86
|
-
} from "./main-
|
|
87
|
-
import"./main-
|
|
86
|
+
} from "./main-xnp01wxw.mjs";
|
|
87
|
+
import"./main-h3sgxdjn.mjs";
|
|
88
88
|
import {
|
|
89
89
|
endpointForPort
|
|
90
|
-
} from "./main-
|
|
90
|
+
} from "./main-aj4grz5c.mjs";
|
|
91
91
|
import {
|
|
92
92
|
taggedEnum,
|
|
93
93
|
is2,
|
|
@@ -5858,7 +5858,7 @@ var status = make("status", {
|
|
|
5858
5858
|
}
|
|
5859
5859
|
})).pipe(withDescription4("Show relay, extension, and target status"));
|
|
5860
5860
|
var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
|
|
5861
|
-
const { runMcpServer } = yield* promise(() => import("./mcp-
|
|
5861
|
+
const { runMcpServer } = yield* promise(() => import("./mcp-9sch561m.mjs"));
|
|
5862
5862
|
yield* runMcpServer;
|
|
5863
5863
|
})).pipe(withDescription4("Run the browse MCP server over stdio"));
|
|
5864
5864
|
registerCliCommand(400, () => tabs);
|
|
@@ -5879,7 +5879,7 @@ registerCliCommand(810, ({ packageRoot }) => make("doctor", {
|
|
|
5879
5879
|
}
|
|
5880
5880
|
})).pipe(withDescription4("Diagnose the local browse install and runtime")));
|
|
5881
5881
|
registerCliCommand(820, () => make("skill", {}, fn("Cli.skill")(function* () {
|
|
5882
|
-
const { skillText } = yield* promise(() => import("./skill-text-
|
|
5882
|
+
const { skillText } = yield* promise(() => import("./skill-text-1rg5b5np.mjs"));
|
|
5883
5883
|
yield* log(skillText.trimEnd());
|
|
5884
5884
|
})).pipe(withDescription4("Print the browse agent skill text")));
|
|
5885
5885
|
registerCliCommand(900, () => mcp);
|
|
@@ -6306,12 +6306,12 @@ registerCliCommand(710, () => flightRecorder);
|
|
|
6306
6306
|
|
|
6307
6307
|
// src/cli/relay.ts
|
|
6308
6308
|
var serve = make("serve", {}, fn("Cli.serve")(function* () {
|
|
6309
|
-
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-
|
|
6309
|
+
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-q62xjvg0.mjs"), import("./helpers-jj42z7rm.mjs")]));
|
|
6310
6310
|
const port = process.env.OPENCODE_BROWSER_PORT === undefined ? undefined : yield* portConfig;
|
|
6311
6311
|
const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
|
|
6312
6312
|
yield* scoped(gen(function* () {
|
|
6313
6313
|
const relay = yield* startRelay({ ...port === undefined ? {} : { port }, additionalExtensionOrigins });
|
|
6314
|
-
yield* promise(() => import("./legacy-runtime-
|
|
6314
|
+
yield* promise(() => import("./legacy-runtime-tne3461e.mjs").then((module) => module.commitLegacyTakeover()));
|
|
6315
6315
|
yield* log(`browse relay listening at ${relay.url}`);
|
|
6316
6316
|
yield* log(`browse connects automatically while the browser runs. Run \`${cliCommand("status")}\` to check.`);
|
|
6317
6317
|
yield* never;
|
|
@@ -6488,8 +6488,9 @@ var sessionNew = make("new", {
|
|
|
6488
6488
|
name: String7("name").pipe(optional3, withDescription2("Optional lowercase session id")),
|
|
6489
6489
|
readOnly: Boolean4("read-only").pipe(withDefault2(false), withDescription3("Create a read-only session: adopt a tab the user has lent you, then snapshot, screenshot and read it; CDP input, navigation, new pages and cookie writes are refused")),
|
|
6490
6490
|
allowOrigin: String8("allow-origin").pipe(atLeast2(0), withDescription3("Only let this session's tabs load these hosts or origins (repeatable or comma-separated): example.com, *.example.com, https://app.example.com, http://localhost:3000")),
|
|
6491
|
-
browser: String8("browser").pipe(optional4, withDescription3("Open this session's tabs in the connected browser with this id or name (browse status --json lists them); omit for the default browser"))
|
|
6492
|
-
|
|
6491
|
+
browser: String8("browser").pipe(optional4, withDescription3("Open this session's tabs in the connected browser with this id or name (browse status --json lists them); omit for the default browser")),
|
|
6492
|
+
keepVisible: Boolean4("keep-visible").pipe(withDefault2(false), withDescription3("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; tabs you lent it are never kept)"))
|
|
6493
|
+
}, fn("Cli.sessionNew")(function* ({ name, readOnly, allowOrigin, browser, keepVisible }) {
|
|
6493
6494
|
const relay = yield* Service;
|
|
6494
6495
|
yield* ensureCliRelay();
|
|
6495
6496
|
const store = yield* Service3;
|
|
@@ -6497,6 +6498,7 @@ var sessionNew = make("new", {
|
|
|
6497
6498
|
const result = yield* relay.sessionNew(getOrUndefined(name), {
|
|
6498
6499
|
...readOnly ? { readOnly: true } : {},
|
|
6499
6500
|
...allowOrigin.length > 0 ? { allowedOrigins: allowOrigin } : {},
|
|
6501
|
+
...keepVisible ? { keepVisible: true } : {},
|
|
6500
6502
|
...browserValue ? { browser: browserValue } : {}
|
|
6501
6503
|
});
|
|
6502
6504
|
yield* store.write(result.id);
|
package/dist/cli.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
|
|
9
9
|
// src/main.ts
|
|
10
10
|
import path from "node:path";
|
|
11
|
-
var embeddedVersion = "0.0.17-dev.
|
|
11
|
+
var embeddedVersion = "0.0.17-dev.183";
|
|
12
12
|
var setupCommands = new Set(["install", "uninstall", "extension", "pair", "set"]);
|
|
13
13
|
var command = process.argv[2];
|
|
14
14
|
var args = process.argv.slice(3);
|
|
@@ -18,26 +18,26 @@ var options = separator === -1 ? args : args.slice(0, separator);
|
|
|
18
18
|
var askedForHelp = command === "--help" || command === "-h" || options.some((arg) => arg === "--help" || arg === "-h");
|
|
19
19
|
var preCliHelp = askedForHelp && (command === "update" || command !== undefined && setupCommands.has(command));
|
|
20
20
|
var oldRuntime = legacyRuntime();
|
|
21
|
-
var takingOver = command === "serve" && !askedForHelp && legacyRuntimeActive(oldRuntime) && await import("./legacy-runtime-
|
|
21
|
+
var takingOver = command === "serve" && !askedForHelp && legacyRuntimeActive(oldRuntime) && await import("./legacy-runtime-tne3461e.mjs").then((module) => module.prepareLegacyTakeover(oldRuntime)).catch(() => false);
|
|
22
22
|
if (!takingOver)
|
|
23
23
|
settleLegacyHome(process.env, oldRuntime);
|
|
24
24
|
if (command !== "--version" && command !== "-v" && !askedForHelp && !takingOver && !process.env.OPENCODE_BROWSER_HOME && legacyRootsLeft()) {
|
|
25
25
|
try {
|
|
26
|
-
const { migrateLegacy } = await import("./migrate-
|
|
26
|
+
const { migrateLegacy } = await import("./migrate-dwpc3854.mjs");
|
|
27
27
|
migrateLegacy();
|
|
28
28
|
} catch {}
|
|
29
29
|
}
|
|
30
30
|
if (command === "--version" || command === "-v") {
|
|
31
|
-
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-
|
|
31
|
+
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-144ecn73.mjs")).opencodeBrowserVersion;
|
|
32
32
|
process.stdout.write(`${opencodeBrowserVersion}
|
|
33
33
|
`);
|
|
34
|
-
} else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-
|
|
35
|
-
const { runBinaryMcp } = await import("./supervisor-
|
|
34
|
+
} else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-ratepwa5.mjs")).supervisesMcp()) {
|
|
35
|
+
const { runBinaryMcp } = await import("./supervisor-ratepwa5.mjs");
|
|
36
36
|
await runBinaryMcp(process.argv.slice(3));
|
|
37
37
|
} else if (invokedAs === "opencode-browser-mcp" || command === "mcp" && process.argv.length === 3) {
|
|
38
38
|
const { NodeRuntime } = await import("./index-gjq7chrk.mjs");
|
|
39
39
|
const { defaultTeardown } = await import("./Runtime-xss8qan1.mjs");
|
|
40
|
-
const { runMcpServer } = await import("./mcp-
|
|
40
|
+
const { runMcpServer } = await import("./mcp-9sch561m.mjs");
|
|
41
41
|
let stdinGone = false;
|
|
42
42
|
const onStdinGone = () => {
|
|
43
43
|
stdinGone = true;
|
|
@@ -59,13 +59,13 @@ if (command === "--version" || command === "-v") {
|
|
|
59
59
|
})
|
|
60
60
|
}));
|
|
61
61
|
} else if (command === "self-update" || command === "runtime-switch") {
|
|
62
|
-
const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-
|
|
62
|
+
const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-797qc0w9.mjs");
|
|
63
63
|
await (command === "self-update" ? runSelfUpdate : runRuntimeSwitch)(process.argv.slice(3));
|
|
64
64
|
} else if (command === "update" && !askedForHelp) {
|
|
65
|
-
const { runUpdateCommand } = await import("./update-
|
|
65
|
+
const { runUpdateCommand } = await import("./update-7mb87vfx.mjs");
|
|
66
66
|
await runUpdateCommand(process.argv.slice(3));
|
|
67
67
|
} else if (command && setupCommands.has(command) && !askedForHelp) {
|
|
68
|
-
const { runSetup } = await import("./setup-
|
|
68
|
+
const { runSetup } = await import("./setup-31sys1aq.mjs");
|
|
69
69
|
await runSetup(command, process.argv.slice(3));
|
|
70
70
|
} else {
|
|
71
71
|
if (preCliHelp || !command || command === "--help" || command === "-h") {
|
|
@@ -102,9 +102,9 @@ executable in ~/.local/bin (or $XDG_BIN_HOME).
|
|
|
102
102
|
`);
|
|
103
103
|
}
|
|
104
104
|
if (command === "status" && !askedForHelp && !process.argv.includes("--json")) {
|
|
105
|
-
const { printSetupStatus } = await import("./setup-
|
|
105
|
+
const { printSetupStatus } = await import("./setup-31sys1aq.mjs");
|
|
106
106
|
printSetupStatus();
|
|
107
107
|
}
|
|
108
|
-
const { runCli } = await import("./cli-
|
|
108
|
+
const { runCli } = await import("./cli-n67t50qs.mjs");
|
|
109
109
|
runCli(preCliHelp ? ["--help"] : undefined);
|
|
110
110
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-jt4h0g8x.mjs";
|
|
2
2
|
import {
|
|
3
3
|
installerBinaryPath,
|
|
4
4
|
compiledBinary,
|
|
5
5
|
channelOf,
|
|
6
6
|
installedRuntime2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-k39ype39.mjs";
|
|
8
8
|
import {
|
|
9
9
|
legacyRuntimeActive,
|
|
10
10
|
insidePath,
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
} from "./main-pmfd055v.mjs";
|
|
13
13
|
import {
|
|
14
14
|
opencodeBrowserVersion2
|
|
15
|
-
} from "./main-
|
|
15
|
+
} from "./main-70nwvs6t.mjs";
|
|
16
16
|
import {
|
|
17
17
|
relayPortPinned,
|
|
18
18
|
resolveRelayPort,
|
|
19
19
|
probeRelayPort
|
|
20
|
-
} from "./main-
|
|
20
|
+
} from "./main-aj4grz5c.mjs";
|
|
21
21
|
|
|
22
22
|
// src/setup/legacy-runtime.ts
|
|
23
23
|
import fs from "node:fs";
|
|
@@ -50,7 +50,7 @@ async function prepareLegacyTakeover(legacy, options = {}) {
|
|
|
50
50
|
return false;
|
|
51
51
|
}
|
|
52
52
|
const home = options.home ?? os.homedir();
|
|
53
|
-
const { copyLegacyData } = await import("./migrate-
|
|
53
|
+
const { copyLegacyData } = await import("./migrate-dwpc3854.mjs");
|
|
54
54
|
delete env.OPENCODE_BROWSER_HOME;
|
|
55
55
|
copyLegacyData(home);
|
|
56
56
|
pending = { legacy, install, home };
|
|
@@ -64,7 +64,7 @@ async function commitLegacyTakeover(now = Date.now()) {
|
|
|
64
64
|
try {
|
|
65
65
|
if (!adoptLegacyRuntime(legacy, install, now))
|
|
66
66
|
return false;
|
|
67
|
-
const { migrateLegacy } = await import("./migrate-
|
|
67
|
+
const { migrateLegacy } = await import("./migrate-dwpc3854.mjs");
|
|
68
68
|
migrateLegacy(home, now);
|
|
69
69
|
return true;
|
|
70
70
|
} catch {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
installedRuntime2,
|
|
8
8
|
autoUpdateStatus,
|
|
9
9
|
updateAvailable
|
|
10
|
-
} from "./main-
|
|
10
|
+
} from "./main-k39ype39.mjs";
|
|
11
11
|
|
|
12
12
|
// src/update.ts
|
|
13
13
|
import { execFile, spawnSync } from "node:child_process";
|
|
@@ -313,7 +313,7 @@ function runUpdate(args, deps) {
|
|
|
313
313
|
async function runUpdateCommand2(args) {
|
|
314
314
|
const log = (line) => process.stdout.write(line + `
|
|
315
315
|
`);
|
|
316
|
-
const { runInstalledUpdate } = await import("./runtime-update-
|
|
316
|
+
const { runInstalledUpdate } = await import("./runtime-update-797qc0w9.mjs");
|
|
317
317
|
if (await runInstalledUpdate(args))
|
|
318
318
|
return;
|
|
319
319
|
if (compiledBinary()) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePrivateJsonFileSync
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-jt4h0g8x.mjs";
|
|
4
4
|
import {
|
|
5
5
|
bundledPairingCodeTtlMs,
|
|
6
6
|
mintPairingCode,
|
|
7
7
|
writeExtensionPairing
|
|
8
|
-
} from "./main-
|
|
8
|
+
} from "./main-650pqeq5.mjs";
|
|
9
9
|
import {
|
|
10
10
|
configRoot2,
|
|
11
11
|
cacheRoot,
|
|
12
12
|
devExtensionUrl,
|
|
13
13
|
devExtensionFolder
|
|
14
|
-
} from "./main-
|
|
14
|
+
} from "./main-k39ype39.mjs";
|
|
15
15
|
|
|
16
16
|
// src/setup/dev-extension.ts
|
|
17
17
|
import { createHash } from "node:crypto";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePrivateJsonFileSync
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-jt4h0g8x.mjs";
|
|
4
4
|
import {
|
|
5
5
|
dataRoot,
|
|
6
6
|
stateRoot
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-k39ype39.mjs";
|
|
8
8
|
|
|
9
9
|
// src/relay/browser-pairing.ts
|
|
10
10
|
import crypto from "node:crypto";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePrivateJsonFileSync,
|
|
3
3
|
defaultPort2
|
|
4
|
-
} from "./main-
|
|
4
|
+
} from "./main-jt4h0g8x.mjs";
|
|
5
5
|
import {
|
|
6
6
|
stateRoot
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-k39ype39.mjs";
|
|
8
8
|
|
|
9
9
|
// src/relay/port.ts
|
|
10
10
|
import fs from "node:fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-70nwvs6t.mjs";
|
|
4
4
|
import {
|
|
5
5
|
configRoot2,
|
|
6
6
|
dataRoot,
|
|
@@ -22,16 +22,16 @@ import {
|
|
|
22
22
|
npmGlobalRoot,
|
|
23
23
|
installedVersion,
|
|
24
24
|
runCommand
|
|
25
|
-
} from "./main-
|
|
25
|
+
} from "./main-k39ype39.mjs";
|
|
26
26
|
import {
|
|
27
27
|
writeStdout
|
|
28
28
|
} from "./main-tk4axre7.mjs";
|
|
29
29
|
import {
|
|
30
30
|
defaultPort2
|
|
31
|
-
} from "./main-
|
|
31
|
+
} from "./main-jt4h0g8x.mjs";
|
|
32
32
|
import {
|
|
33
33
|
formatPairingCode
|
|
34
|
-
} from "./main-
|
|
34
|
+
} from "./main-650pqeq5.mjs";
|
|
35
35
|
import {
|
|
36
36
|
__toESM,
|
|
37
37
|
__commonJS,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cliCommand
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-k39ype39.mjs";
|
|
4
4
|
import {
|
|
5
5
|
SessionDeleted,
|
|
6
6
|
ExecuteLogEntry,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
parseTargetSelection2,
|
|
16
16
|
getObject2,
|
|
17
17
|
getString2
|
|
18
|
-
} from "./main-
|
|
18
|
+
} from "./main-jt4h0g8x.mjs";
|
|
19
19
|
import {
|
|
20
20
|
isStream,
|
|
21
21
|
provideContext
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isNodeError,
|
|
3
3
|
writeJsonFileAtomically
|
|
4
|
-
} from "./main-
|
|
4
|
+
} from "./main-jt4h0g8x.mjs";
|
|
5
5
|
import {
|
|
6
6
|
decodeUnknownEffect2,
|
|
7
7
|
decodeUnknownSync,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
import {
|
|
51
51
|
dataRoot,
|
|
52
52
|
cliCommand
|
|
53
|
-
} from "./main-
|
|
53
|
+
} from "./main-k39ype39.mjs";
|
|
54
54
|
|
|
55
55
|
// node_modules/effect/dist/Semaphore.js
|
|
56
56
|
var makeUnsafe = (permits) => new SemaphoreImpl(permits);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unpackedExtensionId,
|
|
3
3
|
parseJsonObject
|
|
4
|
-
} from "./main-
|
|
4
|
+
} from "./main-k39ype39.mjs";
|
|
5
5
|
import {
|
|
6
6
|
decodeUnknownOption,
|
|
7
7
|
optionalKey,
|
|
@@ -110,6 +110,7 @@ var SessionSummary = Struct({
|
|
|
110
110
|
stateKeys: ArraySchema(String3),
|
|
111
111
|
readOnly: optionalKey(Boolean3),
|
|
112
112
|
allowedOrigins: optionalKey(ArraySchema(String3)),
|
|
113
|
+
keepVisible: optionalKey(Boolean3),
|
|
113
114
|
browser: optionalKey(String3)
|
|
114
115
|
});
|
|
115
116
|
var ExecuteSessionSummary = SessionSummary.pipe(fieldsAssign({
|
|
@@ -162,6 +163,7 @@ var SessionNewRequest = Struct({
|
|
|
162
163
|
id: optionalKey(String3),
|
|
163
164
|
readOnly: optionalKey(Boolean3),
|
|
164
165
|
allowedOrigins: optionalKey(ArraySchema(String3)),
|
|
166
|
+
keepVisible: optionalKey(Boolean3),
|
|
165
167
|
browser: optionalKey(String3)
|
|
166
168
|
});
|
|
167
169
|
var SessionEnsureRequest = Struct({
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./main-pmfd055v.mjs";
|
|
5
5
|
import {
|
|
6
6
|
opencodeBrowserVersion2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-70nwvs6t.mjs";
|
|
8
8
|
|
|
9
9
|
// src/paths.ts
|
|
10
10
|
import fs from "node:fs";
|
|
@@ -114,7 +114,7 @@ function cliInstall() {
|
|
|
114
114
|
return { kind: "binary", binary: installedBinary() ?? process.execPath, pathEnv: process.env.PATH };
|
|
115
115
|
if (fromCheckout())
|
|
116
116
|
return { kind: "checkout", bundle: path.join(packageRoot(), "dist", "cli.mjs") };
|
|
117
|
-
return { kind: "npm", version: "0.0.17-dev.
|
|
117
|
+
return { kind: "npm", version: "0.0.17-dev.183", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
|
|
118
118
|
}
|
|
119
119
|
function cliPrefix(install = cliInstall()) {
|
|
120
120
|
if (install.kind === "binary") {
|
|
@@ -136,7 +136,7 @@ function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjh
|
|
|
136
136
|
return id ? { id } : {};
|
|
137
137
|
}
|
|
138
138
|
var RELEASE_SERVICE = "https://anoma.ly/release";
|
|
139
|
-
function devExtension(baked = { file: "browse-extension-0.0.17-dev.
|
|
139
|
+
function devExtension(baked = { file: "browse-extension-0.0.17-dev.183.zip", sha256: "c01fd42b8192ed9a08171e2f8d9b3e2d2c8d6282ddd7429caa9dcdc2e7317e97", size: 187301 }) {
|
|
140
140
|
return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
|
|
141
141
|
}
|
|
142
142
|
var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
compareVersions,
|
|
11
11
|
installedRuntime2,
|
|
12
12
|
installedVersion
|
|
13
|
-
} from "./main-
|
|
13
|
+
} from "./main-k39ype39.mjs";
|
|
14
14
|
import {
|
|
15
15
|
ensurePrivateDirectorySync,
|
|
16
16
|
SessionContainer,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
RelayErrorCode,
|
|
44
44
|
ErrorEnvelope,
|
|
45
45
|
defaultPort2
|
|
46
|
-
} from "./main-
|
|
46
|
+
} from "./main-jt4h0g8x.mjs";
|
|
47
47
|
import {
|
|
48
48
|
get,
|
|
49
49
|
post,
|
|
@@ -54,10 +54,10 @@ import {
|
|
|
54
54
|
} from "./main-jeta10c6.mjs";
|
|
55
55
|
import {
|
|
56
56
|
opencodeBrowserBuildId2
|
|
57
|
-
} from "./main-
|
|
57
|
+
} from "./main-70nwvs6t.mjs";
|
|
58
58
|
import {
|
|
59
59
|
relayAuthorization
|
|
60
|
-
} from "./main-
|
|
60
|
+
} from "./main-h3sgxdjn.mjs";
|
|
61
61
|
import {
|
|
62
62
|
endpointForPort,
|
|
63
63
|
configuredRelayPort,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
readRelayState,
|
|
66
66
|
processAlive,
|
|
67
67
|
resolveRelayPort
|
|
68
|
-
} from "./main-
|
|
68
|
+
} from "./main-aj4grz5c.mjs";
|
|
69
69
|
import {
|
|
70
70
|
Pointer,
|
|
71
71
|
passthrough,
|
|
@@ -667,6 +667,7 @@ var make3 = fn("RelayClient.make")(function* (options) {
|
|
|
667
667
|
...id ? { id } : {},
|
|
668
668
|
...options?.readOnly ? { readOnly: true } : {},
|
|
669
669
|
...options?.allowedOrigins && options.allowedOrigins.length > 0 ? { allowedOrigins: [...options.allowedOrigins] } : {},
|
|
670
|
+
...options?.keepVisible ? { keepVisible: true } : {},
|
|
670
671
|
...options?.browser ? { browser: options.browser } : {}
|
|
671
672
|
}, SessionContainer).pipe(map6((container) => container.session)),
|
|
672
673
|
sessionAllowlist: (id, allowedOrigins) => postJson("/cli/session/allowlist", { id, allowedOrigins: [...allowedOrigins] }, SessionContainer).pipe(map6((container) => container.session)),
|
|
@@ -46,11 +46,11 @@ import {
|
|
|
46
46
|
import"./main-pmfd055v.mjs";
|
|
47
47
|
import {
|
|
48
48
|
opencodeBrowserVersion2
|
|
49
|
-
} from "./main-
|
|
49
|
+
} from "./main-70nwvs6t.mjs";
|
|
50
50
|
import {
|
|
51
51
|
cliCommand,
|
|
52
52
|
autoUpdateStatus
|
|
53
|
-
} from "./main-
|
|
53
|
+
} from "./main-k39ype39.mjs";
|
|
54
54
|
import {
|
|
55
55
|
SessionContainer,
|
|
56
56
|
SessionsContainer,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
AuthRunResponse,
|
|
62
62
|
TabsCleanupResponse,
|
|
63
63
|
getObject2
|
|
64
|
-
} from "./main-
|
|
64
|
+
} from "./main-jt4h0g8x.mjs";
|
|
65
65
|
import {
|
|
66
66
|
option,
|
|
67
67
|
String2,
|
|
@@ -71,11 +71,11 @@ import {
|
|
|
71
71
|
relayBuildProblem,
|
|
72
72
|
ensureRelay,
|
|
73
73
|
ensureExtensionConnected
|
|
74
|
-
} from "./main-
|
|
74
|
+
} from "./main-zgawp964.mjs";
|
|
75
75
|
import {
|
|
76
76
|
updateJson2,
|
|
77
77
|
createUpdateWatcher2
|
|
78
|
-
} from "./main-
|
|
78
|
+
} from "./main-1nnqhn1v.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-b830e27p.mjs";
|
|
160
160
|
import {
|
|
161
161
|
makeUnsafe,
|
|
162
162
|
make3,
|
|
163
163
|
listSecrets
|
|
164
|
-
} from "./main-
|
|
164
|
+
} from "./main-f1fdks8n.mjs";
|
|
165
165
|
import {
|
|
166
166
|
Clock,
|
|
167
167
|
type,
|
|
@@ -176,8 +176,8 @@ import {
|
|
|
176
176
|
orElse,
|
|
177
177
|
exhaustive
|
|
178
178
|
} from "./main-akpa411k.mjs";
|
|
179
|
-
import"./main-
|
|
180
|
-
import"./main-
|
|
179
|
+
import"./main-h3sgxdjn.mjs";
|
|
180
|
+
import"./main-aj4grz5c.mjs";
|
|
181
181
|
import {
|
|
182
182
|
Class,
|
|
183
183
|
taggedEnum,
|
|
@@ -9405,6 +9405,10 @@ registerMcpTools({
|
|
|
9405
9405
|
type: "array",
|
|
9406
9406
|
items: { type: "string" },
|
|
9407
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."
|
|
9408
9412
|
}
|
|
9409
9413
|
}),
|
|
9410
9414
|
readOnly: false,
|
|
@@ -9416,11 +9420,13 @@ registerMcpTools({
|
|
|
9416
9420
|
const requestedId = optionalStringField(input, "id");
|
|
9417
9421
|
const readOnly = optionalBooleanField(input, "readOnly");
|
|
9418
9422
|
const allowedOrigins = optionalStringArrayField(input, "allowedOrigins");
|
|
9423
|
+
const keepVisible = optionalBooleanField(input, "keepVisible");
|
|
9419
9424
|
const browser = optionalStringField(input, "browser");
|
|
9420
9425
|
yield* ensureExtensionConnected({ relay: ctx.relay, waitForReconnect: true });
|
|
9421
9426
|
const session = yield* ctx.relay.sessionNew(requestedId, {
|
|
9422
9427
|
...readOnly ? { readOnly: true } : {},
|
|
9423
9428
|
...allowedOrigins ? { allowedOrigins } : {},
|
|
9429
|
+
...keepVisible ? { keepVisible: true } : {},
|
|
9424
9430
|
...browser ? { browser } : {}
|
|
9425
9431
|
});
|
|
9426
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-ans6rqv0.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-70nwvs6t.mjs";
|
|
18
18
|
import {
|
|
19
19
|
configRoot2,
|
|
20
20
|
dataRoot,
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
binRoot,
|
|
24
24
|
binaryName,
|
|
25
25
|
devExtensionFolder
|
|
26
|
-
} from "./main-
|
|
26
|
+
} from "./main-k39ype39.mjs";
|
|
27
27
|
import"./main-tk4axre7.mjs";
|
|
28
|
-
import"./main-
|
|
29
|
-
import"./main-
|
|
28
|
+
import"./main-jt4h0g8x.mjs";
|
|
29
|
+
import"./main-650pqeq5.mjs";
|
|
30
30
|
|
|
31
31
|
// src/setup/migrate.ts
|
|
32
32
|
import fs from "node:fs";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
opencodeBrowserVersion2,
|
|
6
6
|
opencodeBrowserBuildId2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-70nwvs6t.mjs";
|
|
8
8
|
import {
|
|
9
9
|
defaultRoots,
|
|
10
10
|
configRoot2,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
setStoredMode,
|
|
42
42
|
autoUpdateStatus,
|
|
43
43
|
createAutoUpdater
|
|
44
|
-
} from "./main-
|
|
44
|
+
} from "./main-k39ype39.mjs";
|
|
45
45
|
import {
|
|
46
46
|
isNodeError,
|
|
47
47
|
isUnsupportedDirectorySyncError,
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
isRestrictedTarget2,
|
|
96
96
|
isRestrictedUrl2,
|
|
97
97
|
dataUrlDocument2
|
|
98
|
-
} from "./main-
|
|
98
|
+
} from "./main-jt4h0g8x.mjs";
|
|
99
99
|
import {
|
|
100
100
|
context,
|
|
101
101
|
pendingPairingCodeKeys,
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
pairingSessionKey,
|
|
114
114
|
sessionProof,
|
|
115
115
|
wrapToken
|
|
116
|
-
} from "./main-
|
|
116
|
+
} from "./main-650pqeq5.mjs";
|
|
117
117
|
import {
|
|
118
118
|
makeUnsafe,
|
|
119
119
|
terminateChildProcess,
|
|
@@ -136,16 +136,16 @@ import {
|
|
|
136
136
|
checkNavigationUrl,
|
|
137
137
|
readSecret,
|
|
138
138
|
secretText
|
|
139
|
-
} from "./main-
|
|
139
|
+
} from "./main-f1fdks8n.mjs";
|
|
140
140
|
import {
|
|
141
141
|
defaultJournalBaseDir,
|
|
142
142
|
makeJournalEntry,
|
|
143
143
|
appendJournalEntry,
|
|
144
144
|
startJournalRetention
|
|
145
|
-
} from "./main-
|
|
145
|
+
} from "./main-xnp01wxw.mjs";
|
|
146
146
|
import {
|
|
147
147
|
createUpdateWatcher2
|
|
148
|
-
} from "./main-
|
|
148
|
+
} from "./main-1nnqhn1v.mjs";
|
|
149
149
|
import {
|
|
150
150
|
SettingsInputError,
|
|
151
151
|
parseSettingChanges,
|
|
@@ -153,13 +153,13 @@ import {
|
|
|
153
153
|
settingsToExtension,
|
|
154
154
|
describeSettings,
|
|
155
155
|
describeChanges
|
|
156
|
-
} from "./main-
|
|
156
|
+
} from "./main-b830e27p.mjs";
|
|
157
157
|
import {
|
|
158
158
|
relayHostname,
|
|
159
159
|
isLocalPeer,
|
|
160
160
|
installedDevExtension,
|
|
161
161
|
syncDevExtension
|
|
162
|
-
} from "./main-
|
|
162
|
+
} from "./main-254jbd9y.mjs";
|
|
163
163
|
import {
|
|
164
164
|
currentTimeMillis,
|
|
165
165
|
value,
|
|
@@ -176,13 +176,13 @@ import {
|
|
|
176
176
|
Boolean2,
|
|
177
177
|
appendManagedRelayProcessLog,
|
|
178
178
|
relayLog
|
|
179
|
-
} from "./main-
|
|
179
|
+
} from "./main-zgawp964.mjs";
|
|
180
180
|
import {
|
|
181
181
|
relayTokenQueryParam,
|
|
182
182
|
relayToken,
|
|
183
183
|
secretsEqual,
|
|
184
184
|
ensurePrivateDirectory
|
|
185
|
-
} from "./main-
|
|
185
|
+
} from "./main-h3sgxdjn.mjs";
|
|
186
186
|
import {
|
|
187
187
|
join,
|
|
188
188
|
interrupt,
|
|
@@ -195,7 +195,7 @@ import {
|
|
|
195
195
|
writeRelayState,
|
|
196
196
|
removeRelayState,
|
|
197
197
|
chooseRelayPort
|
|
198
|
-
} from "./main-
|
|
198
|
+
} from "./main-aj4grz5c.mjs";
|
|
199
199
|
import {
|
|
200
200
|
taggedEnum,
|
|
201
201
|
is2,
|
|
@@ -13415,6 +13415,7 @@ function sessionSummary(session) {
|
|
|
13415
13415
|
stateKeys: status.stateKeys,
|
|
13416
13416
|
...session.readOnly ? { readOnly: true } : {},
|
|
13417
13417
|
...session.allowedOrigins ? { allowedOrigins: [...session.allowedOrigins] } : {},
|
|
13418
|
+
...session.keepVisible ? { keepVisible: true } : {},
|
|
13418
13419
|
...session.browser ? { browser: session.browser.id } : {}
|
|
13419
13420
|
};
|
|
13420
13421
|
}
|
|
@@ -13432,6 +13433,7 @@ function persistedSession(session) {
|
|
|
13432
13433
|
updatedAt: session.updatedAt,
|
|
13433
13434
|
readOnly: session.readOnly,
|
|
13434
13435
|
...session.allowedOrigins ? { allowedOrigins: [...session.allowedOrigins] } : {},
|
|
13436
|
+
...session.keepVisible ? { keepVisible: true } : {},
|
|
13435
13437
|
...session.browser ? { browser: session.browser.id, ...session.browser.key ? { browserKey: session.browser.key } : {} } : {},
|
|
13436
13438
|
...target ? { target } : {},
|
|
13437
13439
|
...session.clientPid === undefined ? {} : { clientPid: session.clientPid }
|
|
@@ -13715,6 +13717,8 @@ function cleanupSettledAdoption(context, session, created, previousTarget, previ
|
|
|
13715
13717
|
});
|
|
13716
13718
|
if (session.allowedOrigins)
|
|
13717
13719
|
replacement.allowedOrigins = session.allowedOrigins;
|
|
13720
|
+
if (session.keepVisible)
|
|
13721
|
+
replacement.keepVisible = true;
|
|
13718
13722
|
if (session.browser)
|
|
13719
13723
|
replacement.browser = session.browser;
|
|
13720
13724
|
context.sessions.set(session.id, replacement);
|
|
@@ -13958,6 +13962,8 @@ class OpenCodeBrowserSessions {
|
|
|
13958
13962
|
});
|
|
13959
13963
|
if (entry.allowedOrigins && entry.allowedOrigins.length > 0)
|
|
13960
13964
|
session.allowedOrigins = entry.allowedOrigins;
|
|
13965
|
+
if (entry.keepVisible === true)
|
|
13966
|
+
session.keepVisible = true;
|
|
13961
13967
|
if (entry.browser)
|
|
13962
13968
|
session.browser = { id: entry.browser, ...entry.browserKey ? { key: entry.browserKey } : {} };
|
|
13963
13969
|
if (entry.target)
|
|
@@ -14003,6 +14009,8 @@ class OpenCodeBrowserSessions {
|
|
|
14003
14009
|
const session = this.createOpenCodeBrowserSession(sessionId, options?.readOnly === true);
|
|
14004
14010
|
if (options?.allowedOrigins && options.allowedOrigins.length > 0)
|
|
14005
14011
|
session.allowedOrigins = options.allowedOrigins;
|
|
14012
|
+
if (options?.keepVisible === true)
|
|
14013
|
+
session.keepVisible = true;
|
|
14006
14014
|
if (browser)
|
|
14007
14015
|
session.browser = browser;
|
|
14008
14016
|
this.sessions.set(sessionId, session);
|
|
@@ -14070,6 +14078,9 @@ class OpenCodeBrowserSessions {
|
|
|
14070
14078
|
return sessionSummary(session);
|
|
14071
14079
|
});
|
|
14072
14080
|
}
|
|
14081
|
+
keepsTabsVisible(id) {
|
|
14082
|
+
return this.sessions.get(id)?.keepVisible === true;
|
|
14083
|
+
}
|
|
14073
14084
|
isExecuting(id) {
|
|
14074
14085
|
return this.executing.has(id);
|
|
14075
14086
|
}
|
|
@@ -14217,6 +14228,8 @@ class OpenCodeBrowserSessions {
|
|
|
14217
14228
|
const session = manager.createOpenCodeBrowserSession(id, existing.readOnly);
|
|
14218
14229
|
if (existing.allowedOrigins)
|
|
14219
14230
|
session.allowedOrigins = existing.allowedOrigins;
|
|
14231
|
+
if (existing.keepVisible)
|
|
14232
|
+
session.keepVisible = true;
|
|
14220
14233
|
if (existing.browser)
|
|
14221
14234
|
session.browser = existing.browser;
|
|
14222
14235
|
if (existing.clientPid !== undefined)
|
|
@@ -14227,6 +14240,13 @@ class OpenCodeBrowserSessions {
|
|
|
14227
14240
|
}));
|
|
14228
14241
|
yield* manager.releaseSessionTargetOwnership(existing);
|
|
14229
14242
|
yield* manager.closeOpenCodeBrowserSession(existing);
|
|
14243
|
+
yield* sync2(() => {
|
|
14244
|
+
try {
|
|
14245
|
+
manager.hooks.onSessionDeleted?.(id);
|
|
14246
|
+
} catch (error) {
|
|
14247
|
+
console.error("Session reset hook failed", error);
|
|
14248
|
+
}
|
|
14249
|
+
});
|
|
14230
14250
|
return sessionSummary(session);
|
|
14231
14251
|
})));
|
|
14232
14252
|
return { session, ...stopped ? { stopped } : {} };
|
|
@@ -15684,6 +15704,7 @@ function handleCliRequest(options) {
|
|
|
15684
15704
|
const session = yield* options.sessions.create(optionalSessionId2(request.id), {
|
|
15685
15705
|
readOnly: request.readOnly === true,
|
|
15686
15706
|
...allowedOrigins ? { allowedOrigins } : {},
|
|
15707
|
+
...request.keepVisible === true ? { keepVisible: true } : {},
|
|
15687
15708
|
...request.browser ? { browser: request.browser } : {}
|
|
15688
15709
|
});
|
|
15689
15710
|
noteClient(options.request, options.sessions, session.id);
|
|
@@ -18388,6 +18409,9 @@ function createRelaySettingsSync(options) {
|
|
|
18388
18409
|
var attachedBadge = { text: "ON", color: "#7c3aed", title: "Detach from browse" };
|
|
18389
18410
|
var executingBadge = { text: "RUN", color: "#f59e0b", title: "browse is running a script. Click to stop it and take this tab back." };
|
|
18390
18411
|
var waitingBadge = (message) => ({ text: "WAIT", color: "#2563eb", title: `browse is waiting for you: ${message} Click here when you're done.` });
|
|
18412
|
+
function keepsTabVisible(sessionId, keepVisible, target) {
|
|
18413
|
+
return keepVisible && target?.owner === "relay" && target.opencodeBrowserSessionId === sessionId;
|
|
18414
|
+
}
|
|
18391
18415
|
function createTabPresentation(options) {
|
|
18392
18416
|
const {
|
|
18393
18417
|
registry,
|
|
@@ -18579,7 +18603,10 @@ function createTabPresentation(options) {
|
|
|
18579
18603
|
}
|
|
18580
18604
|
activeHandoffTabs.delete(sessionId);
|
|
18581
18605
|
}
|
|
18582
|
-
return executing ? void_3 : tabActivity.finish(sessionId);
|
|
18606
|
+
return executing ? void_3 : tabActivity.finish(sessionId, { keep: (tabId) => keepsVisible(sessionId, tabId) });
|
|
18607
|
+
}
|
|
18608
|
+
function keepsVisible(sessionId, tabId) {
|
|
18609
|
+
return keepsTabVisible(sessionId, getSessions().keepsTabsVisible(sessionId), registry.tabTargets.get(tabId));
|
|
18583
18610
|
}
|
|
18584
18611
|
function handleToolbarClick(tabId) {
|
|
18585
18612
|
const sessions = getSessions();
|
|
@@ -19111,6 +19138,7 @@ var PersistedSession = Struct({
|
|
|
19111
19138
|
updatedAt: String3,
|
|
19112
19139
|
readOnly: Boolean3,
|
|
19113
19140
|
allowedOrigins: optionalKey(ArraySchema(String3)),
|
|
19141
|
+
keepVisible: optionalKey(Boolean3),
|
|
19114
19142
|
browser: optionalKey(String3),
|
|
19115
19143
|
browserKey: optionalKey(String3),
|
|
19116
19144
|
target: optionalKey(Struct({
|
|
@@ -19389,12 +19417,27 @@ class TabActivity {
|
|
|
19389
19417
|
this.focusedBy.set(tabId, owners);
|
|
19390
19418
|
}));
|
|
19391
19419
|
}
|
|
19392
|
-
finish(sessionId) {
|
|
19420
|
+
finish(sessionId, options = {}) {
|
|
19393
19421
|
return this.focusLock.withPermit(gen({ self: this }, function* () {
|
|
19394
19422
|
for (const [tabId, owners] of this.focusedBy) {
|
|
19395
|
-
if (!owners.
|
|
19423
|
+
if (!owners.has(sessionId))
|
|
19396
19424
|
continue;
|
|
19397
19425
|
this.touch(tabId);
|
|
19426
|
+
if (options.keep?.(tabId) === true)
|
|
19427
|
+
continue;
|
|
19428
|
+
owners.delete(sessionId);
|
|
19429
|
+
if (owners.size > 0)
|
|
19430
|
+
continue;
|
|
19431
|
+
this.focusedBy.delete(tabId);
|
|
19432
|
+
yield* this.setFocus(tabId, false).pipe(ignore);
|
|
19433
|
+
}
|
|
19434
|
+
}));
|
|
19435
|
+
}
|
|
19436
|
+
release(sessionId) {
|
|
19437
|
+
return this.focusLock.withPermit(gen({ self: this }, function* () {
|
|
19438
|
+
for (const [tabId, owners] of this.focusedBy) {
|
|
19439
|
+
if (!owners.delete(sessionId))
|
|
19440
|
+
continue;
|
|
19398
19441
|
if (owners.size > 0)
|
|
19399
19442
|
continue;
|
|
19400
19443
|
this.focusedBy.delete(tabId);
|
|
@@ -19641,6 +19684,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
19641
19684
|
}),
|
|
19642
19685
|
onSessionDeleted: (sessionId) => {
|
|
19643
19686
|
deviceMetricsOverrides.take(sessionId);
|
|
19687
|
+
runPromise(ignore(tabActivity.release(sessionId))).catch(() => {});
|
|
19644
19688
|
},
|
|
19645
19689
|
onExecuteRecord: (record) => {
|
|
19646
19690
|
const entry = makeJournalEntry({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import"./main-9frwnsnf.mjs";
|
|
2
2
|
import"./main-pmfd055v.mjs";
|
|
3
|
-
import"./main-
|
|
3
|
+
import"./main-70nwvs6t.mjs";
|
|
4
4
|
import {
|
|
5
5
|
cliCommand,
|
|
6
6
|
installCommand,
|
|
@@ -18,17 +18,17 @@ import {
|
|
|
18
18
|
registryUrl,
|
|
19
19
|
fetchPublished,
|
|
20
20
|
runInstaller
|
|
21
|
-
} from "./main-
|
|
22
|
-
import"./main-
|
|
21
|
+
} from "./main-k39ype39.mjs";
|
|
22
|
+
import"./main-jt4h0g8x.mjs";
|
|
23
23
|
import"./main-jeta10c6.mjs";
|
|
24
24
|
import {
|
|
25
25
|
Service,
|
|
26
26
|
layerFetch,
|
|
27
27
|
restartRelay,
|
|
28
28
|
startManagedRelay
|
|
29
|
-
} from "./main-
|
|
30
|
-
import"./main-
|
|
31
|
-
import"./main-
|
|
29
|
+
} from "./main-zgawp964.mjs";
|
|
30
|
+
import"./main-h3sgxdjn.mjs";
|
|
31
|
+
import"./main-aj4grz5c.mjs";
|
|
32
32
|
import {
|
|
33
33
|
succeed6,
|
|
34
34
|
gen,
|
|
@@ -63,11 +63,11 @@ import {
|
|
|
63
63
|
installRuntime,
|
|
64
64
|
installedRuntime,
|
|
65
65
|
manualMcpEntry
|
|
66
|
-
} from "./main-
|
|
66
|
+
} from "./main-ans6rqv0.mjs";
|
|
67
67
|
import"./main-pmfd055v.mjs";
|
|
68
68
|
import {
|
|
69
69
|
opencodeBrowserBuildId2
|
|
70
|
-
} from "./main-
|
|
70
|
+
} from "./main-70nwvs6t.mjs";
|
|
71
71
|
import {
|
|
72
72
|
installedBinaryPath,
|
|
73
73
|
installerBinaryPath,
|
|
@@ -87,10 +87,10 @@ import {
|
|
|
87
87
|
autoUpdateStatus,
|
|
88
88
|
describeAutoUpdate,
|
|
89
89
|
runCommand
|
|
90
|
-
} from "./main-
|
|
90
|
+
} from "./main-k39ype39.mjs";
|
|
91
91
|
import {
|
|
92
92
|
defaultPort2
|
|
93
|
-
} from "./main-
|
|
93
|
+
} from "./main-jt4h0g8x.mjs";
|
|
94
94
|
import {
|
|
95
95
|
pairingCodeTtlMs,
|
|
96
96
|
bundledPairingCodeTtlMs,
|
|
@@ -103,20 +103,20 @@ import {
|
|
|
103
103
|
revokeBrowserToken,
|
|
104
104
|
legacyPairingCode,
|
|
105
105
|
removeLegacyPairingCode
|
|
106
|
-
} from "./main-
|
|
106
|
+
} from "./main-650pqeq5.mjs";
|
|
107
107
|
import"./main-tk4axre7.mjs";
|
|
108
108
|
import {
|
|
109
109
|
defaultSiteSecretsDir
|
|
110
|
-
} from "./main-
|
|
110
|
+
} from "./main-f1fdks8n.mjs";
|
|
111
111
|
import {
|
|
112
112
|
parseHostname,
|
|
113
113
|
readRelayConfig,
|
|
114
114
|
writeRelayConfig,
|
|
115
115
|
syncDevExtension
|
|
116
|
-
} from "./main-
|
|
116
|
+
} from "./main-254jbd9y.mjs";
|
|
117
117
|
import {
|
|
118
118
|
relayAuthorization
|
|
119
|
-
} from "./main-
|
|
119
|
+
} from "./main-h3sgxdjn.mjs";
|
|
120
120
|
import {
|
|
121
121
|
endpointForPort,
|
|
122
122
|
configuredRelayPort,
|
|
@@ -125,7 +125,7 @@ import {
|
|
|
125
125
|
verifiedRelay,
|
|
126
126
|
verifiedRelayEndpoint,
|
|
127
127
|
liveRelayPort
|
|
128
|
-
} from "./main-
|
|
128
|
+
} from "./main-aj4grz5c.mjs";
|
|
129
129
|
|
|
130
130
|
// src/setup.ts
|
|
131
131
|
import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync } from "node:fs";
|
|
@@ -700,11 +700,18 @@ async function stopInstalledRelay() {
|
|
|
700
700
|
if (!response.ok || !(await response.json()).stopping)
|
|
701
701
|
throw new Error("The running relay refused shutdown. Stop it manually, then run uninstall again.");
|
|
702
702
|
for (let n = 0;n < 100; n++) {
|
|
703
|
-
const current = await probe()
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
throw
|
|
703
|
+
const current = await probe().catch((error) => {
|
|
704
|
+
const e = error;
|
|
705
|
+
if (["ECONNRESET", "ConnectionClosed"].includes(e.cause?.code ?? e.code ?? ""))
|
|
706
|
+
return "stopping";
|
|
707
|
+
throw error;
|
|
708
|
+
});
|
|
709
|
+
if (current !== "stopping") {
|
|
710
|
+
if (!current)
|
|
711
|
+
return;
|
|
712
|
+
if (current.instanceId !== relay.instanceId)
|
|
713
|
+
throw new Error("Another relay started during uninstall; no files were removed.");
|
|
714
|
+
}
|
|
708
715
|
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
709
716
|
}
|
|
710
717
|
throw new Error("The relay is still stopping. Run uninstall again once it exits.");
|
|
@@ -50,6 +50,18 @@ keeps working. Popups (\`window.open\`, \`target=_blank\`) are ordinary pages of
|
|
|
50
50
|
your session: use \`page.waitForEvent("popup")\` or \`context.waitForEvent("page")\`.
|
|
51
51
|
\`page.close()\` only releases a tab the user lent you.
|
|
52
52
|
|
|
53
|
+
Pages see your tabs hidden and unfocused between calls; only while an \`execute\`
|
|
54
|
+
runs on a tab does browse emulate focus on it. If a site pauses, disconnects or
|
|
55
|
+
logs out when hidden, create the session with \`--keep-visible\` (\`keepVisible:
|
|
56
|
+
true\` on \`session_new\`): the tabs that session opened itself stay visible and
|
|
57
|
+
focused to the page between calls. Pages can notice. It never raises or focuses
|
|
58
|
+
the window, tabs the user lent the session are not kept, and it is released when
|
|
59
|
+
the session is deleted or reset or the tab closes.
|
|
60
|
+
|
|
61
|
+
\`\`\`bash
|
|
62
|
+
browse session new live --keep-visible
|
|
63
|
+
\`\`\`
|
|
64
|
+
|
|
53
65
|
To work in a tab the user already has open, ask them to click the browse toolbar
|
|
54
66
|
button on it (the badge shows ON). Select it for one execute, or adopt it for
|
|
55
67
|
sticky reuse:
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-jt4h0g8x.mjs";
|
|
2
2
|
import {
|
|
3
3
|
entrySpawnCommand,
|
|
4
4
|
installedRuntime2,
|
|
5
5
|
installedVersion
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-k39ype39.mjs";
|
|
7
7
|
import"./main-pmfd055v.mjs";
|
|
8
|
-
import"./main-
|
|
8
|
+
import"./main-70nwvs6t.mjs";
|
|
9
9
|
import {
|
|
10
10
|
endpointForPort,
|
|
11
11
|
resolveRelayPort
|
|
12
|
-
} from "./main-
|
|
12
|
+
} from "./main-aj4grz5c.mjs";
|
|
13
13
|
|
|
14
14
|
// src/mcp/supervisor.ts
|
|
15
15
|
import { spawn } from "node:child_process";
|
|
@@ -40,7 +40,7 @@ async function runBinaryMcp(args) {
|
|
|
40
40
|
const runtime = installedRuntime2();
|
|
41
41
|
if (!runtime || runtime.kind === "npx") {
|
|
42
42
|
process.env[directEnvironmentVariable] = "1";
|
|
43
|
-
const { runCli } = await import("./cli-
|
|
43
|
+
const { runCli } = await import("./cli-n67t50qs.mjs");
|
|
44
44
|
return runCli();
|
|
45
45
|
}
|
|
46
46
|
const REPLAY = `opencode-browser-shim-initialize-${randomUUID()}`;
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
updateNotice2,
|
|
5
5
|
createUpdateWatcher2,
|
|
6
6
|
runUpdateCommand2
|
|
7
|
-
} from "./main-
|
|
8
|
-
import"./main-
|
|
7
|
+
} from "./main-1nnqhn1v.mjs";
|
|
8
|
+
import"./main-k39ype39.mjs";
|
|
9
9
|
import"./main-pmfd055v.mjs";
|
|
10
|
-
import"./main-
|
|
10
|
+
import"./main-70nwvs6t.mjs";
|
|
11
11
|
export {
|
|
12
12
|
createUpdateWatcher2 as createUpdateWatcher,
|
|
13
13
|
formatUpdateNotice2 as formatUpdateNotice,
|
package/package.json
CHANGED
package/skills/browse/SKILL.md
CHANGED
|
@@ -49,6 +49,18 @@ keeps working. Popups (`window.open`, `target=_blank`) are ordinary pages of
|
|
|
49
49
|
your session: use `page.waitForEvent("popup")` or `context.waitForEvent("page")`.
|
|
50
50
|
`page.close()` only releases a tab the user lent you.
|
|
51
51
|
|
|
52
|
+
Pages see your tabs hidden and unfocused between calls; only while an `execute`
|
|
53
|
+
runs on a tab does browse emulate focus on it. If a site pauses, disconnects or
|
|
54
|
+
logs out when hidden, create the session with `--keep-visible` (`keepVisible:
|
|
55
|
+
true` on `session_new`): the tabs that session opened itself stay visible and
|
|
56
|
+
focused to the page between calls. Pages can notice. It never raises or focuses
|
|
57
|
+
the window, tabs the user lent the session are not kept, and it is released when
|
|
58
|
+
the session is deleted or reset or the tab closes.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
browse session new live --keep-visible
|
|
62
|
+
```
|
|
63
|
+
|
|
52
64
|
To work in a tab the user already has open, ask them to click the browse toolbar
|
|
53
65
|
button on it (the badge shows ON). Select it for one execute, or adopt it for
|
|
54
66
|
sticky reuse:
|
package/dist/main-d5ke1bpm.mjs
DELETED