@opencode/browse 0.0.9-dev.45 → 0.0.9-dev.49
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-1axmqf5f.mjs → cli-yrjyft4m.mjs} +9 -9
- package/dist/cli.mjs +11 -11
- package/dist/{helpers-x0mdc2h7.mjs → helpers-8bew9zx6.mjs} +2 -2
- package/dist/{main-eq8azpcr.mjs → main-10xd16tq.mjs} +2 -2
- package/dist/{main-f3110h98.mjs → main-30jfvc54.mjs} +3 -3
- package/dist/{main-g7x150rr.mjs → main-6wbv6r89.mjs} +1 -1
- package/dist/{main-j9exvqsv.mjs → main-82n18wqt.mjs} +4 -4
- package/dist/main-9n6hhjy2.mjs +4 -0
- package/dist/{main-hagb30y1.mjs → main-cctvx210.mjs} +28 -15
- package/dist/{main-kwjx5cn8.mjs → main-mdvkc05f.mjs} +3 -3
- package/dist/{main-69f94pjr.mjs → main-x4n2ygmq.mjs} +2 -2
- package/dist/{mcp-skassm7k.mjs → mcp-mb6w6k32.mjs} +9 -9
- package/dist/{relay-f0tznjhj.mjs → relay-y0s3q0ww.mjs} +8 -8
- package/dist/{runtime-update-r9a9qzdb.mjs → runtime-update-y96cb23k.mjs} +7 -5
- package/dist/{setup-nt5te3bz.mjs → setup-k9ej74b8.mjs} +58 -17
- package/dist/{supervisor-tbmhxhdm.mjs → supervisor-etb7z5ey.mjs} +3 -3
- package/dist/{update-06e39wzj.mjs → update-bqbd38e8.mjs} +3 -3
- package/dist/{version-mteqsrdd.mjs → version-rc3q2c66.mjs} +1 -1
- package/package.json +1 -1
- package/dist/main-dthvgrkn.mjs +0 -4
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
import {
|
|
106
106
|
opencodeBrowserVersion2,
|
|
107
107
|
opencodeBrowserBuildId2
|
|
108
|
-
} from "./main-
|
|
108
|
+
} from "./main-9n6hhjy2.mjs";
|
|
109
109
|
import {
|
|
110
110
|
dataRoot,
|
|
111
111
|
fromCheckout,
|
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
devExtension,
|
|
116
116
|
installCommand,
|
|
117
117
|
autoUpdateStatus
|
|
118
|
-
} from "./main-
|
|
118
|
+
} from "./main-cctvx210.mjs";
|
|
119
119
|
import {
|
|
120
120
|
extensionProtocolVersion,
|
|
121
121
|
extensionProtocolAdvice
|
|
@@ -141,13 +141,13 @@ import {
|
|
|
141
141
|
ensureExtensionConnected,
|
|
142
142
|
stoppedRelayStatus,
|
|
143
143
|
statusCollections
|
|
144
|
-
} from "./main-
|
|
145
|
-
import"./main-
|
|
144
|
+
} from "./main-mdvkc05f.mjs";
|
|
145
|
+
import"./main-6wbv6r89.mjs";
|
|
146
146
|
import {
|
|
147
147
|
updateJson2,
|
|
148
148
|
formatUpdateNotice2,
|
|
149
149
|
updateNotice2
|
|
150
|
-
} from "./main-
|
|
150
|
+
} from "./main-10xd16tq.mjs";
|
|
151
151
|
import {
|
|
152
152
|
settingKeys,
|
|
153
153
|
formatSettings,
|
|
@@ -155,12 +155,12 @@ import {
|
|
|
155
155
|
addSecret,
|
|
156
156
|
listSecrets,
|
|
157
157
|
removeSecret
|
|
158
|
-
} from "./main-
|
|
158
|
+
} from "./main-82n18wqt.mjs";
|
|
159
159
|
import {
|
|
160
160
|
defaultJournalBaseDir,
|
|
161
161
|
readJournalEntries,
|
|
162
162
|
formatJournalEntry
|
|
163
|
-
} from "./main-
|
|
163
|
+
} from "./main-30jfvc54.mjs";
|
|
164
164
|
import {
|
|
165
165
|
pipeArguments,
|
|
166
166
|
dual,
|
|
@@ -5855,7 +5855,7 @@ var status = make("status", {
|
|
|
5855
5855
|
}
|
|
5856
5856
|
})).pipe(withDescription4("Show relay, extension, and target status"));
|
|
5857
5857
|
var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
|
|
5858
|
-
const { runMcpServer } = yield* promise(() => import("./mcp-
|
|
5858
|
+
const { runMcpServer } = yield* promise(() => import("./mcp-mb6w6k32.mjs"));
|
|
5859
5859
|
yield* runMcpServer;
|
|
5860
5860
|
})).pipe(withDescription4("Run the browse MCP server over stdio"));
|
|
5861
5861
|
registerCliCommand(400, () => tabs);
|
|
@@ -6303,7 +6303,7 @@ registerCliCommand(710, () => flightRecorder);
|
|
|
6303
6303
|
|
|
6304
6304
|
// src/cli/relay.ts
|
|
6305
6305
|
var serve = make("serve", {}, fn("Cli.serve")(function* () {
|
|
6306
|
-
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-
|
|
6306
|
+
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-y0s3q0ww.mjs"), import("./helpers-8bew9zx6.mjs")]));
|
|
6307
6307
|
const port = yield* portConfig;
|
|
6308
6308
|
const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
|
|
6309
6309
|
yield* scoped(gen(function* () {
|
package/dist/cli.mjs
CHANGED
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
// src/main.ts
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
var embeddedVersion = "0.0.9-dev.
|
|
5
|
+
var embeddedVersion = "0.0.9-dev.49";
|
|
6
6
|
var setupCommands = new Set(["install", "uninstall", "extension", "pair", "rollback", "set"]);
|
|
7
7
|
var command = process.argv[2];
|
|
8
8
|
var invokedAs = path.basename(process.argv[1] ?? "");
|
|
9
9
|
if (command === "--version" || command === "-v") {
|
|
10
|
-
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-
|
|
10
|
+
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-rc3q2c66.mjs")).opencodeBrowserVersion;
|
|
11
11
|
process.stdout.write(`${opencodeBrowserVersion}
|
|
12
12
|
`);
|
|
13
|
+
} else if (command === "mcp" && globalThis.__OPENCODE_BROWSER_COMPILED__ && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1") {
|
|
14
|
+
const { runBinaryMcp } = await import("./supervisor-etb7z5ey.mjs");
|
|
15
|
+
await runBinaryMcp(process.argv.slice(3));
|
|
13
16
|
} else if (invokedAs === "opencode-browser-mcp" || command === "mcp" && process.argv.length === 3) {
|
|
14
17
|
const { NodeRuntime } = await import("./index-8v65jg3n.mjs");
|
|
15
|
-
const { runMcpServer } = await import("./mcp-
|
|
18
|
+
const { runMcpServer } = await import("./mcp-mb6w6k32.mjs");
|
|
16
19
|
runMcpServer.pipe(NodeRuntime.runMain);
|
|
17
|
-
} else if (command === "mcp" && globalThis.__OPENCODE_BROWSER_COMPILED__ && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1") {
|
|
18
|
-
const { runBinaryMcp } = await import("./supervisor-tbmhxhdm.mjs");
|
|
19
|
-
await runBinaryMcp(process.argv.slice(3));
|
|
20
20
|
} else if (command === "runtime-install" || command === "runtime-switch") {
|
|
21
|
-
const { runRuntimeInstall, runRuntimeSwitch } = await import("./runtime-update-
|
|
21
|
+
const { runRuntimeInstall, runRuntimeSwitch } = await import("./runtime-update-y96cb23k.mjs");
|
|
22
22
|
await (command === "runtime-install" ? runRuntimeInstall : runRuntimeSwitch)(process.argv.slice(3));
|
|
23
23
|
} else if (command === "update") {
|
|
24
|
-
const { runUpdateCommand } = await import("./update-
|
|
24
|
+
const { runUpdateCommand } = await import("./update-bqbd38e8.mjs");
|
|
25
25
|
await runUpdateCommand(process.argv.slice(3));
|
|
26
26
|
} else if (command && setupCommands.has(command)) {
|
|
27
|
-
const { runSetup } = await import("./setup-
|
|
27
|
+
const { runSetup } = await import("./setup-k9ej74b8.mjs");
|
|
28
28
|
await runSetup(command, process.argv.slice(3));
|
|
29
29
|
} else {
|
|
30
30
|
if (!command || command === "--help" || command === "-h") {
|
|
@@ -59,9 +59,9 @@ if (command === "--version" || command === "-v") {
|
|
|
59
59
|
`);
|
|
60
60
|
}
|
|
61
61
|
if (command === "status" && !process.argv.includes("--json")) {
|
|
62
|
-
const { printSetupStatus } = await import("./setup-
|
|
62
|
+
const { printSetupStatus } = await import("./setup-k9ej74b8.mjs");
|
|
63
63
|
printSetupStatus();
|
|
64
64
|
}
|
|
65
|
-
const { runCli } = await import("./cli-
|
|
65
|
+
const { runCli } = await import("./cli-yrjyft4m.mjs");
|
|
66
66
|
runCli();
|
|
67
67
|
}
|
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
isRestrictedTarget2,
|
|
32
32
|
isRestrictedUrl2,
|
|
33
33
|
dataUrlDocument2
|
|
34
|
-
} from "./main-
|
|
35
|
-
import"./main-
|
|
34
|
+
} from "./main-mdvkc05f.mjs";
|
|
35
|
+
import"./main-6wbv6r89.mjs";
|
|
36
36
|
import"./main-3gthmkzw.mjs";
|
|
37
37
|
export {
|
|
38
38
|
HttpRouteError2 as HttpRouteError,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
compareVersions,
|
|
7
7
|
npmRuntime,
|
|
8
8
|
autoUpdateStatus
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-cctvx210.mjs";
|
|
10
10
|
import {
|
|
11
11
|
unpackedReloadAdvice
|
|
12
12
|
} from "./main-3gthmkzw.mjs";
|
|
@@ -315,7 +315,7 @@ function runUpdate(args, deps) {
|
|
|
315
315
|
async function runUpdateCommand2(args) {
|
|
316
316
|
const log = (line) => process.stdout.write(line + `
|
|
317
317
|
`);
|
|
318
|
-
const { runNpmUpdate } = await import("./runtime-update-
|
|
318
|
+
const { runNpmUpdate } = await import("./runtime-update-y96cb23k.mjs");
|
|
319
319
|
if (await runNpmUpdate(args))
|
|
320
320
|
return;
|
|
321
321
|
if (compiledBinary()) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isNodeError
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-6wbv6r89.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isValidSessionId2
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-mdvkc05f.mjs";
|
|
7
7
|
import {
|
|
8
8
|
isSome,
|
|
9
9
|
decodeUnknownOption,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./main-ta3yc4kx.mjs";
|
|
18
18
|
import {
|
|
19
19
|
dataRoot
|
|
20
|
-
} from "./main-
|
|
20
|
+
} from "./main-cctvx210.mjs";
|
|
21
21
|
|
|
22
22
|
// src/session-manager/journal.ts
|
|
23
23
|
import fs from "node:fs";
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
parseTargetSelection2,
|
|
3
3
|
getObject2,
|
|
4
4
|
getString2
|
|
5
|
-
} from "./main-
|
|
5
|
+
} from "./main-mdvkc05f.mjs";
|
|
6
6
|
import {
|
|
7
7
|
isNodeError,
|
|
8
8
|
writeJsonFileAtomically
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-6wbv6r89.mjs";
|
|
10
10
|
import {
|
|
11
11
|
getStackTraceLimit,
|
|
12
12
|
setStackTraceLimit,
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
import {
|
|
106
106
|
dataRoot,
|
|
107
107
|
cliCommand
|
|
108
|
-
} from "./main-
|
|
108
|
+
} from "./main-cctvx210.mjs";
|
|
109
109
|
import {
|
|
110
110
|
pipeArguments,
|
|
111
111
|
identity,
|
|
@@ -2723,4 +2723,4 @@ function secretText(secret) {
|
|
|
2723
2723
|
return secret.kind === "totp" ? totpCode(secret.value) : secret.value;
|
|
2724
2724
|
}
|
|
2725
2725
|
|
|
2726
|
-
export { makeUnsafe, make, isStreamSchema, getStreamSchemas, ClientAbort, ServerClient, make2, exitSchema, isWrapper, make3, Implementation, ClientCapabilities, INVALID_REQUEST_ERROR_CODE, METHOD_NOT_FOUND_ERROR_CODE, INVALID_PARAMS_ERROR_CODE, INTERNAL_ERROR_CODE, HEADER_MISMATCH_ERROR_CODE, ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, McpError, Ping, Initialize, CancelledNotification, ProgressNotification, ResourceListChangedNotification, ResourceUpdatedNotification, Prompt, TextContent, PromptListChangedNotification, Tool, CallToolResult, ToolListChangedNotification, LoggingLevel, LoggingMessageNotification, CreateMessage, ListRootsResult, ListRoots, Elicit, McpReverseOperationUnsupported, McpReverseOperationError, McpRequestContext, McpServerClient, McpServerClientMiddleware, ServerNotificationRpcs, EnabledWhen,
|
|
2726
|
+
export { makeUnsafe, make, settingKeys, settingSpecs, securityVariables, SettingsInputError, parseSettingChanges, settingsFromExtension, settingsToExtension, describeSettings, describeChanges, formatSettings, isStreamSchema, getStreamSchemas, ClientAbort, ServerClient, make2, exitSchema, isWrapper, make3, Implementation, ClientCapabilities, INVALID_REQUEST_ERROR_CODE, METHOD_NOT_FOUND_ERROR_CODE, INVALID_PARAMS_ERROR_CODE, INTERNAL_ERROR_CODE, HEADER_MISMATCH_ERROR_CODE, ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, McpError, Ping, Initialize, CancelledNotification, ProgressNotification, ResourceListChangedNotification, ResourceUpdatedNotification, Prompt, TextContent, PromptListChangedNotification, Tool, CallToolResult, ToolListChangedNotification, LoggingLevel, LoggingMessageNotification, CreateMessage, ListRootsResult, ListRoots, Elicit, McpReverseOperationUnsupported, McpReverseOperationError, McpRequestContext, McpServerClient, McpServerClientMiddleware, ServerNotificationRpcs, EnabledWhen, browsersNote2, mcpUpdateNote2, objectSchema, emptyInputSchema, sessionSchemaProperty, sessionAliasSchemaProperty, sessionOnlyInputSchema, ensureSessionExists, parseExecuteArguments, parseAdoptArguments, requiredStringField, optionalStringField, optionalBooleanField, optionalPositiveIntegerField, optionalStringArrayField, requireObject, toolResultForValue2, mcpErrorMessage2, toolResult, terminateChildProcess, SecretCollector, looksLikeTokenSegment, AuthProfileError, read, readOptional, withLock, write, status, run, OriginPatternError, parseOriginPatterns, normalizeOriginPatterns, isPrivateAddress, explicitlyAllowsHost, checkUrl, checkNavigationUrl, readSecret, addSecret, listSecrets, removeSecret, secretText };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-9n6hhjy2.mjs";
|
|
4
4
|
|
|
5
5
|
// src/update/auto-update.ts
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
@@ -70,7 +70,7 @@ function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjh
|
|
|
70
70
|
return id ? { id } : {};
|
|
71
71
|
}
|
|
72
72
|
var RELEASE_SERVICE = "https://anoma.ly/release";
|
|
73
|
-
function devExtension(baked = { file: "browse-extension-0.0.9-dev.
|
|
73
|
+
function devExtension(baked = { file: "browse-extension-0.0.9-dev.49.zip", sha256: "cca343535840019936f57ed737087d5ec5ba15193e8fa110b940aaec9051c46c", size: 184270 }) {
|
|
74
74
|
return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
|
|
75
75
|
}
|
|
76
76
|
var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
|
|
@@ -269,6 +269,9 @@ async function registryUrl(run = runCommand, env = process.env) {
|
|
|
269
269
|
const configured = override || (compiledBinary() ? "" : (await run("npm", ["config", "get", "registry"], { timeoutMs: 15000 })).stdout.trim());
|
|
270
270
|
return /^https?:\/\//.test(configured) ? configured.replace(/\/+$/, "") : DEFAULT_REGISTRY;
|
|
271
271
|
}
|
|
272
|
+
|
|
273
|
+
class InstallVerificationError extends Error {
|
|
274
|
+
}
|
|
272
275
|
async function fetchPublished(options) {
|
|
273
276
|
const request = options.fetch ?? fetch;
|
|
274
277
|
const name = options.packageName ?? updatePackage();
|
|
@@ -329,24 +332,27 @@ async function installVersion(options) {
|
|
|
329
332
|
else {
|
|
330
333
|
const args = ["install", "--prefix", temporary, "--no-audit", "--no-fund", "--ignore-scripts", "--loglevel=error", ...options.registry ? [`--registry=${options.registry}`] : [], spec];
|
|
331
334
|
const npm = await run("npm", args, { timeoutMs: 10 * 60000 });
|
|
332
|
-
if (npm.status !== 0)
|
|
333
|
-
|
|
334
|
-
`
|
|
335
|
+
if (npm.status !== 0) {
|
|
336
|
+
const output = npm.stderr || npm.stdout;
|
|
337
|
+
const message = `npm install ${spec} failed: ${output.trim().split(`
|
|
338
|
+
`).slice(-3).join(" ")}`;
|
|
339
|
+
throw /\bEINTEGRITY\b/.test(output) ? new InstallVerificationError(message) : new Error(message);
|
|
340
|
+
}
|
|
335
341
|
}
|
|
336
342
|
const installed = readJson(path2.join(temporary, "node_modules", "@opencode", "browse", "package.json"))?.version;
|
|
337
343
|
if (!installed)
|
|
338
|
-
throw new
|
|
344
|
+
throw new InstallVerificationError(`npm install ${spec} didn't install ${PACKAGE_NAME}`);
|
|
339
345
|
if (options.spec === undefined && installed !== options.version)
|
|
340
|
-
throw new
|
|
346
|
+
throw new InstallVerificationError(`npm installed ${installed}, not ${options.version}`);
|
|
341
347
|
if (options.integrity) {
|
|
342
348
|
const locked = readJson(path2.join(temporary, "package-lock.json"))?.packages?.["node_modules/@opencode/browse"];
|
|
343
349
|
if (locked?.integrity !== options.integrity)
|
|
344
|
-
throw new
|
|
350
|
+
throw new InstallVerificationError(`${PACKAGE_NAME}@${installed} installed with integrity ${locked?.integrity ?? "unknown"}, not the registry's ${options.integrity}`);
|
|
345
351
|
}
|
|
346
352
|
const entry = path2.join(temporary, "node_modules", "@opencode", "browse", "dist", "cli.mjs");
|
|
347
353
|
const reported = await run(options.node ?? process.execPath, [entry, "--version"], { timeoutMs: 30000, env: { ...process.env, OPENCODE_BROWSER_AUTOSTART: "0" } });
|
|
348
354
|
if (reported.status !== 0 || reported.stdout.trim() !== installed)
|
|
349
|
-
throw new
|
|
355
|
+
throw new InstallVerificationError(`${PACKAGE_NAME}@${installed} didn't run: \`--version\` printed ${JSON.stringify(reported.stdout.trim() || reported.stderr.trim()).slice(0, 200)}`);
|
|
350
356
|
const target = versionDirectory(layout, installed);
|
|
351
357
|
rmSync(target, { recursive: true, force: true });
|
|
352
358
|
renameSync(temporary, target);
|
|
@@ -379,16 +385,16 @@ async function installBinaryVersion(options) {
|
|
|
379
385
|
const tgz = new Uint8Array(await response.arrayBuffer());
|
|
380
386
|
const actual = `sha512-${createHash("sha512").update(tgz).digest("base64")}`;
|
|
381
387
|
if (actual !== integrity)
|
|
382
|
-
throw new
|
|
388
|
+
throw new InstallVerificationError(`${name}@${options.version} downloaded with integrity ${actual}, not the registry's ${integrity}`);
|
|
383
389
|
const executable = tarFile(tgz, `package/bin/${binaryName()}`);
|
|
384
390
|
if (!executable)
|
|
385
|
-
throw new
|
|
391
|
+
throw new InstallVerificationError(`${name}@${options.version} has no bin/${binaryName()}`);
|
|
386
392
|
writeFileSync(file, executable);
|
|
387
393
|
}
|
|
388
394
|
chmodSync(file, 493);
|
|
389
395
|
const reported = await run(file, ["--version"], { timeoutMs: 30000, env: { ...process.env, OPENCODE_BROWSER_AUTOSTART: "0" } });
|
|
390
396
|
if (reported.status !== 0 || reported.stdout.trim() !== expected)
|
|
391
|
-
throw new
|
|
397
|
+
throw new InstallVerificationError(`browse ${expected} didn't run: \`--version\` printed ${JSON.stringify(reported.stdout.trim() || reported.stderr.trim()).slice(0, 200)}`);
|
|
392
398
|
const target = versionDirectory(layout, expected);
|
|
393
399
|
rmSync(target, { recursive: true, force: true });
|
|
394
400
|
renameSync(temporary, target);
|
|
@@ -705,8 +711,15 @@ function createAutoUpdater(deps) {
|
|
|
705
711
|
deps.log("autoupdate.installer_gone", { version: installing.version });
|
|
706
712
|
}
|
|
707
713
|
if (state.pending !== wanted) {
|
|
708
|
-
if (state.lastError?.version === wanted
|
|
709
|
-
|
|
714
|
+
if (state.lastError?.version === wanted) {
|
|
715
|
+
const failure = state.lastError;
|
|
716
|
+
const attempts = failure.attempts ?? 1;
|
|
717
|
+
const backoff = (attempts <= 1 ? 15 : attempts === 2 ? 60 : 240) * 60000;
|
|
718
|
+
const delay = failure.verification ? checkIntervalMs : Math.min(backoff, checkIntervalMs);
|
|
719
|
+
const age = now() - Date.parse(failure.at);
|
|
720
|
+
if (age >= 0 && age < delay)
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
710
723
|
deps.log("autoupdate.installing", { version: wanted });
|
|
711
724
|
const pid = spawnChild(["runtime-install", wanted, ...state.integrity ? ["--integrity", state.integrity] : []], (code) => {
|
|
712
725
|
deps.log(code === 0 ? "autoupdate.installed" : "autoupdate.install_failed", { version: wanted, code });
|
|
@@ -769,4 +782,4 @@ function spawnRuntimeChild(layout, entry, args, onExit, env = process.env) {
|
|
|
769
782
|
}
|
|
770
783
|
}
|
|
771
784
|
|
|
772
|
-
export { dataRoot, oldStoreMarker, fromCheckout, compiledBinary, binaryPackage, scriptEntry, entryCommand, runningEntry, checkoutRoot, cliCommand, PUBLIC_STORE_ID, storeConfig, devExtension, devExtensionUrl, devExtensionFolder, storeUrl, installCommand, autoUpdateModes, runtimeLayout, versionEntry, channelOf, UPDATE_VERSION, compareVersions, readCurrent, writeCurrent, updateState, npmRuntime, autoUpdateOverride, storedMode, effectiveMode, setStoredMode, autoUpdateStatus, describeAutoUpdate, registryUrl, fetchPublished, installVersion, pruneVersions, switchVersion, createAutoUpdater };
|
|
785
|
+
export { dataRoot, oldStoreMarker, fromCheckout, compiledBinary, binaryPackage, scriptEntry, entryCommand, runningEntry, checkoutRoot, cliCommand, PUBLIC_STORE_ID, storeConfig, devExtension, devExtensionUrl, devExtensionFolder, storeUrl, installCommand, autoUpdateModes, runtimeLayout, versionEntry, channelOf, UPDATE_VERSION, compareVersions, readCurrent, writeCurrent, updateState, npmRuntime, autoUpdateOverride, storedMode, effectiveMode, setStoredMode, autoUpdateStatus, describeAutoUpdate, registryUrl, InstallVerificationError, fetchPublished, installVersion, pruneVersions, switchVersion, createAutoUpdater };
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./main-3gthmkzw.mjs";
|
|
7
7
|
import {
|
|
8
8
|
relayAuthorization
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-6wbv6r89.mjs";
|
|
10
10
|
import {
|
|
11
11
|
assignProperty,
|
|
12
12
|
PipeInspectableProto,
|
|
@@ -103,14 +103,14 @@ import {
|
|
|
103
103
|
} from "./main-ta3yc4kx.mjs";
|
|
104
104
|
import {
|
|
105
105
|
opencodeBrowserBuildId2
|
|
106
|
-
} from "./main-
|
|
106
|
+
} from "./main-9n6hhjy2.mjs";
|
|
107
107
|
import {
|
|
108
108
|
compiledBinary,
|
|
109
109
|
scriptEntry,
|
|
110
110
|
cliCommand,
|
|
111
111
|
installCommand,
|
|
112
112
|
npmRuntime
|
|
113
|
-
} from "./main-
|
|
113
|
+
} from "./main-cctvx210.mjs";
|
|
114
114
|
import {
|
|
115
115
|
dual,
|
|
116
116
|
memoize,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePrivateJsonFileSync
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-6wbv6r89.mjs";
|
|
4
4
|
import {
|
|
5
5
|
dataRoot,
|
|
6
6
|
devExtensionUrl,
|
|
7
7
|
devExtensionFolder
|
|
8
|
-
} from "./main-
|
|
8
|
+
} from "./main-cctvx210.mjs";
|
|
9
9
|
|
|
10
10
|
// src/relay/browser-pairing.ts
|
|
11
11
|
import crypto from "node:crypto";
|
|
@@ -258,10 +258,10 @@ import {
|
|
|
258
258
|
} from "./main-ta3yc4kx.mjs";
|
|
259
259
|
import {
|
|
260
260
|
opencodeBrowserVersion2
|
|
261
|
-
} from "./main-
|
|
261
|
+
} from "./main-9n6hhjy2.mjs";
|
|
262
262
|
import {
|
|
263
263
|
autoUpdateStatus
|
|
264
|
-
} from "./main-
|
|
264
|
+
} from "./main-cctvx210.mjs";
|
|
265
265
|
import"./main-3gthmkzw.mjs";
|
|
266
266
|
import {
|
|
267
267
|
option,
|
|
@@ -272,15 +272,18 @@ import {
|
|
|
272
272
|
relayBuildProblem,
|
|
273
273
|
ensureRelay,
|
|
274
274
|
ensureExtensionConnected
|
|
275
|
-
} from "./main-
|
|
276
|
-
import"./main-
|
|
275
|
+
} from "./main-mdvkc05f.mjs";
|
|
276
|
+
import"./main-6wbv6r89.mjs";
|
|
277
277
|
import {
|
|
278
278
|
updateJson2,
|
|
279
279
|
createUpdateWatcher2
|
|
280
|
-
} from "./main-
|
|
280
|
+
} from "./main-10xd16tq.mjs";
|
|
281
281
|
import {
|
|
282
282
|
makeUnsafe,
|
|
283
283
|
make,
|
|
284
|
+
settingKeys,
|
|
285
|
+
settingSpecs,
|
|
286
|
+
securityVariables,
|
|
284
287
|
isStreamSchema,
|
|
285
288
|
getStreamSchemas,
|
|
286
289
|
ClientAbort,
|
|
@@ -327,9 +330,6 @@ import {
|
|
|
327
330
|
McpServerClientMiddleware,
|
|
328
331
|
ServerNotificationRpcs,
|
|
329
332
|
EnabledWhen,
|
|
330
|
-
settingKeys,
|
|
331
|
-
settingSpecs,
|
|
332
|
-
securityVariables,
|
|
333
333
|
browsersNote2,
|
|
334
334
|
mcpUpdateNote2,
|
|
335
335
|
objectSchema,
|
|
@@ -350,7 +350,7 @@ import {
|
|
|
350
350
|
mcpErrorMessage2,
|
|
351
351
|
toolResult,
|
|
352
352
|
listSecrets
|
|
353
|
-
} from "./main-
|
|
353
|
+
} from "./main-82n18wqt.mjs";
|
|
354
354
|
import {
|
|
355
355
|
Clock,
|
|
356
356
|
type,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2,
|
|
3
3
|
opencodeBrowserBuildId2
|
|
4
|
-
} from "./main-
|
|
4
|
+
} from "./main-9n6hhjy2.mjs";
|
|
5
5
|
import {
|
|
6
6
|
dataRoot,
|
|
7
7
|
oldStoreMarker,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
setStoredMode,
|
|
20
20
|
autoUpdateStatus,
|
|
21
21
|
createAutoUpdater
|
|
22
|
-
} from "./main-
|
|
22
|
+
} from "./main-cctvx210.mjs";
|
|
23
23
|
import {
|
|
24
24
|
extensionProtocolVersion,
|
|
25
25
|
minExtensionProtocolVersion,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
relayToken,
|
|
44
44
|
secretsEqual,
|
|
45
45
|
ensurePrivateDirectory
|
|
46
|
-
} from "./main-
|
|
46
|
+
} from "./main-6wbv6r89.mjs";
|
|
47
47
|
import {
|
|
48
48
|
withDefault,
|
|
49
49
|
option,
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
isRestrictedTarget2,
|
|
98
98
|
isRestrictedUrl2,
|
|
99
99
|
dataUrlDocument2
|
|
100
|
-
} from "./main-
|
|
100
|
+
} from "./main-mdvkc05f.mjs";
|
|
101
101
|
import {
|
|
102
102
|
relayHostname,
|
|
103
103
|
isLocalPeer,
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
wrapToken,
|
|
120
120
|
installedDevExtension,
|
|
121
121
|
syncDevExtension
|
|
122
|
-
} from "./main-
|
|
122
|
+
} from "./main-x4n2ygmq.mjs";
|
|
123
123
|
import {
|
|
124
124
|
makeUnsafe,
|
|
125
125
|
SettingsInputError,
|
|
@@ -147,16 +147,16 @@ import {
|
|
|
147
147
|
checkNavigationUrl,
|
|
148
148
|
readSecret,
|
|
149
149
|
secretText
|
|
150
|
-
} from "./main-
|
|
150
|
+
} from "./main-82n18wqt.mjs";
|
|
151
151
|
import {
|
|
152
152
|
defaultJournalBaseDir,
|
|
153
153
|
makeJournalEntry,
|
|
154
154
|
appendJournalEntry,
|
|
155
155
|
startJournalRetention
|
|
156
|
-
} from "./main-
|
|
156
|
+
} from "./main-30jfvc54.mjs";
|
|
157
157
|
import {
|
|
158
158
|
createUpdateWatcher2
|
|
159
|
-
} from "./main-
|
|
159
|
+
} from "./main-10xd16tq.mjs";
|
|
160
160
|
import {
|
|
161
161
|
isNone,
|
|
162
162
|
isSome,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-9n6hhjy2.mjs";
|
|
2
2
|
import {
|
|
3
3
|
cliCommand,
|
|
4
4
|
installCommand,
|
|
@@ -13,19 +13,20 @@ import {
|
|
|
13
13
|
npmRuntime,
|
|
14
14
|
effectiveMode,
|
|
15
15
|
registryUrl,
|
|
16
|
+
InstallVerificationError,
|
|
16
17
|
fetchPublished,
|
|
17
18
|
installVersion,
|
|
18
19
|
pruneVersions,
|
|
19
20
|
switchVersion
|
|
20
|
-
} from "./main-
|
|
21
|
+
} from "./main-cctvx210.mjs";
|
|
21
22
|
import"./main-3gthmkzw.mjs";
|
|
22
23
|
import {
|
|
23
24
|
Service,
|
|
24
25
|
layerFetch,
|
|
25
26
|
restartRelay,
|
|
26
27
|
startManagedRelay
|
|
27
|
-
} from "./main-
|
|
28
|
-
import"./main-
|
|
28
|
+
} from "./main-mdvkc05f.mjs";
|
|
29
|
+
import"./main-6wbv6r89.mjs";
|
|
29
30
|
import {
|
|
30
31
|
succeed6,
|
|
31
32
|
suspend2,
|
|
@@ -171,7 +172,8 @@ async function runRuntimeInstall(args) {
|
|
|
171
172
|
} catch (error) {
|
|
172
173
|
updateState(layout, ({ installing, ...state }) => {
|
|
173
174
|
const still = clear(installing);
|
|
174
|
-
|
|
175
|
+
const attempts = 1 + (state.lastError?.version === version ? state.lastError.attempts ?? 1 : 0);
|
|
176
|
+
return { ...state, ...still ? { installing: still } : {}, lastError: { message: error.message, at: new Date().toISOString(), version, attempts, verification: error instanceof InstallVerificationError } };
|
|
175
177
|
});
|
|
176
178
|
log(`${new Date().toISOString()} install of ${version} failed: ${error.message}`);
|
|
177
179
|
process.exitCode = 1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-9n6hhjy2.mjs";
|
|
4
4
|
import {
|
|
5
5
|
dataRoot,
|
|
6
6
|
oldStoreMarker,
|
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
installVersion,
|
|
26
26
|
pruneVersions,
|
|
27
27
|
switchVersion
|
|
28
|
-
} from "./main-
|
|
28
|
+
} from "./main-cctvx210.mjs";
|
|
29
29
|
import {
|
|
30
30
|
relayAuthorization
|
|
31
|
-
} from "./main-
|
|
31
|
+
} from "./main-6wbv6r89.mjs";
|
|
32
32
|
import {
|
|
33
33
|
parseHostname,
|
|
34
34
|
readRelayConfig,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
legacyPairingCode,
|
|
46
46
|
removeLegacyPairingCode,
|
|
47
47
|
syncDevExtension
|
|
48
|
-
} from "./main-
|
|
48
|
+
} from "./main-x4n2ygmq.mjs";
|
|
49
49
|
import {
|
|
50
50
|
unpackedExtensionId,
|
|
51
51
|
extensionProtocolSkew,
|
|
@@ -11200,17 +11200,28 @@ function addToPath() {
|
|
|
11200
11200
|
if ((process.env.PATH ?? "").split(path4.delimiter).some((entry) => path4.resolve(entry) === dir))
|
|
11201
11201
|
return;
|
|
11202
11202
|
if (process.platform === "win32") {
|
|
11203
|
-
|
|
11204
|
-
const done = spawnSync3("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", script], { stdio: "ignore" });
|
|
11205
|
-
return done.status === 0 ? "Windows user PATH" : undefined;
|
|
11203
|
+
return editWindowsPath(dir, "add") ? "Windows user PATH" : undefined;
|
|
11206
11204
|
}
|
|
11207
|
-
const { candidates, line } = shellPath(dir);
|
|
11205
|
+
const { candidates, line, legacyLine } = shellPath(dir);
|
|
11208
11206
|
const file = candidates.find((candidate) => existsSync3(candidate)) ?? candidates[0];
|
|
11209
11207
|
try {
|
|
11210
11208
|
const text = existsSync3(file) ? readFileSync3(file, "utf8") : "";
|
|
11211
11209
|
if (text.split(`
|
|
11212
11210
|
`).includes(line))
|
|
11213
11211
|
return;
|
|
11212
|
+
if (text.includes(`
|
|
11213
|
+
# browse
|
|
11214
|
+
${legacyLine}
|
|
11215
|
+
`)) {
|
|
11216
|
+
writeFileSync(file, text.replace(`
|
|
11217
|
+
# browse
|
|
11218
|
+
${legacyLine}
|
|
11219
|
+
`, () => `
|
|
11220
|
+
# browse
|
|
11221
|
+
${line}
|
|
11222
|
+
`));
|
|
11223
|
+
return file;
|
|
11224
|
+
}
|
|
11214
11225
|
mkdirSync(path4.dirname(file), { recursive: true });
|
|
11215
11226
|
writeFileSync(file, `${text && !text.endsWith(`
|
|
11216
11227
|
`) ? `
|
|
@@ -11224,30 +11235,60 @@ ${line}
|
|
|
11224
11235
|
return;
|
|
11225
11236
|
}
|
|
11226
11237
|
}
|
|
11238
|
+
function editWindowsPath(dir, action) {
|
|
11239
|
+
const script = `
|
|
11240
|
+
$ErrorActionPreference = 'Stop'
|
|
11241
|
+
$key = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey('Environment', $true)
|
|
11242
|
+
$raw = $key.GetValue('Path', $null, 'DoNotExpandEnvironmentNames')
|
|
11243
|
+
$kind = if ($null -eq $raw) { 'ExpandString' } else { $key.GetValueKind('Path') }
|
|
11244
|
+
$parts = $raw -split ';'
|
|
11245
|
+
$dir = $env:BROWSE_PATH_ENTRY
|
|
11246
|
+
${action === "add" ? `if ($parts -contains $dir) { exit 0 }; $new = if ($raw) { "$raw;$dir" } else { $dir }` : `if ($parts -notcontains $dir) { exit 0 }; $new = ($parts -ne $dir) -join ';'`}
|
|
11247
|
+
$key.SetValue('Path', $new, [Microsoft.Win32.RegistryValueKind]$kind)
|
|
11248
|
+
$key.Close()
|
|
11249
|
+
# Notify Explorer so new shells see the change, as SetEnvironmentVariable(User) did.
|
|
11250
|
+
Add-Type -Namespace Browse -Name Env -MemberDefinition '[DllImport("user32.dll", CharSet=CharSet.Unicode)] public static extern IntPtr SendMessageTimeout(IntPtr hwnd, uint msg, UIntPtr w, string l, uint flags, uint ms, out UIntPtr result);'
|
|
11251
|
+
$result = [UIntPtr]::Zero
|
|
11252
|
+
[void][Browse.Env]::SendMessageTimeout([IntPtr]65535, 26, [UIntPtr]::Zero, 'Environment', 2, 500, [ref]$result)
|
|
11253
|
+
Write-Output 'changed'`;
|
|
11254
|
+
const done = spawnSync3("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", script], {
|
|
11255
|
+
env: { ...process.env, BROWSE_PATH_ENTRY: dir },
|
|
11256
|
+
windowsHide: true,
|
|
11257
|
+
encoding: "utf8"
|
|
11258
|
+
});
|
|
11259
|
+
if (done.status !== 0)
|
|
11260
|
+
log2(`! Couldn't ${action === "add" ? "add browse to" : "remove browse from"} your Windows user PATH: ${dir}`);
|
|
11261
|
+
return done.status === 0 && done.stdout.trim() === "changed";
|
|
11262
|
+
}
|
|
11227
11263
|
function shellPath(dir) {
|
|
11228
11264
|
const shell = path4.basename(process.env.SHELL ?? "sh");
|
|
11229
11265
|
const zdot = process.env.ZDOTDIR ?? home;
|
|
11230
11266
|
const candidates = shell === "fish" ? [path4.join(configRoot, "fish", "config.fish")] : shell === "zsh" ? [path4.join(zdot, ".zshrc"), path4.join(zdot, ".zshenv"), path4.join(configRoot, "zsh", ".zshrc")] : shell === "bash" ? [path4.join(home, ".bashrc"), path4.join(home, ".bash_profile"), path4.join(home, ".profile")] : [path4.join(home, ".profile")];
|
|
11231
|
-
|
|
11267
|
+
const fish = shell === "fish";
|
|
11268
|
+
const quoted = `'${(fish ? dir.replaceAll("\\", "\\\\") : dir).replaceAll("'", "'\\''")}'`;
|
|
11269
|
+
return { candidates, line: fish ? `fish_add_path ${quoted}` : `export PATH=${quoted}:"$PATH"`, legacyLine: fish ? `fish_add_path ${dir}` : `export PATH=${dir}:$PATH` };
|
|
11232
11270
|
}
|
|
11233
11271
|
function removeBinaryInstall(binary) {
|
|
11234
11272
|
const dir = path4.dirname(binary);
|
|
11235
11273
|
if (process.platform === "win32") {
|
|
11236
|
-
|
|
11237
|
-
spawnSync3("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", script], { stdio: "ignore" });
|
|
11274
|
+
editWindowsPath(dir, "remove");
|
|
11238
11275
|
} else {
|
|
11239
|
-
const { candidates, line } = shellPath(dir);
|
|
11276
|
+
const { candidates, line, legacyLine } = shellPath(dir);
|
|
11240
11277
|
for (const file of candidates) {
|
|
11241
11278
|
const text = readFileOr(file, "");
|
|
11242
|
-
const
|
|
11279
|
+
for (const entry of [line, legacyLine]) {
|
|
11280
|
+
const block = `
|
|
11243
11281
|
# browse
|
|
11244
|
-
${
|
|
11282
|
+
${entry}
|
|
11245
11283
|
`;
|
|
11246
|
-
|
|
11247
|
-
|
|
11284
|
+
if (text.includes(block)) {
|
|
11285
|
+
writeFileSync(file, text.replace(`
|
|
11248
11286
|
${block}`, `
|
|
11249
11287
|
`).replace(block, `
|
|
11250
11288
|
`));
|
|
11289
|
+
break;
|
|
11290
|
+
}
|
|
11291
|
+
}
|
|
11251
11292
|
}
|
|
11252
11293
|
}
|
|
11253
11294
|
try {
|
|
@@ -12051,7 +12092,7 @@ async function runSetup(command, args) {
|
|
|
12051
12092
|
if (command === "set")
|
|
12052
12093
|
return set(args);
|
|
12053
12094
|
if (command === "rollback") {
|
|
12054
|
-
const { runRollback } = await import("./runtime-update-
|
|
12095
|
+
const { runRollback } = await import("./runtime-update-y96cb23k.mjs");
|
|
12055
12096
|
return runRollback(args);
|
|
12056
12097
|
}
|
|
12057
12098
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-9n6hhjy2.mjs";
|
|
2
2
|
import {
|
|
3
3
|
versionEntry,
|
|
4
4
|
readCurrent,
|
|
5
5
|
npmRuntime
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-cctvx210.mjs";
|
|
7
7
|
|
|
8
8
|
// src/mcp/supervisor.ts
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
@@ -14,7 +14,7 @@ async function runBinaryMcp(args) {
|
|
|
14
14
|
const runtime = npmRuntime();
|
|
15
15
|
if (!runtime) {
|
|
16
16
|
process.env[directEnvironmentVariable] = "1";
|
|
17
|
-
const { runCli } = await import("./cli-
|
|
17
|
+
const { runCli } = await import("./cli-yrjyft4m.mjs");
|
|
18
18
|
return runCli();
|
|
19
19
|
}
|
|
20
20
|
const { layout } = runtime;
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
updateNotice2,
|
|
5
5
|
createUpdateWatcher2,
|
|
6
6
|
runUpdateCommand2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-10xd16tq.mjs";
|
|
8
|
+
import"./main-cctvx210.mjs";
|
|
9
|
+
import"./main-9n6hhjy2.mjs";
|
|
8
10
|
import"./main-3gthmkzw.mjs";
|
|
9
|
-
import"./main-hagb30y1.mjs";
|
|
10
|
-
import"./main-dthvgrkn.mjs";
|
|
11
11
|
export {
|
|
12
12
|
createUpdateWatcher2 as createUpdateWatcher,
|
|
13
13
|
formatUpdateNotice2 as formatUpdateNotice,
|
package/package.json
CHANGED
package/dist/main-dthvgrkn.mjs
DELETED