@opencode/browse 0.0.15-dev.97 → 0.0.15
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/{Undici-88kyhfpm.mjs → Undici-mxpvn7gy.mjs} +1 -1
- package/dist/{cli-t7r3wnv8.mjs → cli-xke2d25m.mjs} +139 -135
- package/dist/cli.mjs +17 -16
- package/dist/{helpers-j683tr91.mjs → helpers-tsvynww5.mjs} +4 -2
- package/dist/{index-yzz55kxm.mjs → index-6gkr235e.mjs} +1 -1
- package/dist/{main-8fkq5dgw.mjs → main-3esbykhb.mjs} +4 -4
- package/dist/{main-r62eef6t.mjs → main-70y5racc.mjs} +2 -2
- package/dist/main-7y3pj4rc.mjs +1694 -0
- package/dist/{main-7n3prtjk.mjs → main-9kxgkcse.mjs} +2 -2
- package/dist/main-9t2s5ptx.mjs +5405 -0
- package/dist/{main-vgzr4689.mjs → main-azpzpy0x.mjs} +1 -1
- package/dist/main-ckssvk4c.mjs +18 -0
- package/dist/{main-d0vkm24t.mjs → main-crssg4wd.mjs} +25 -11
- package/dist/{main-b3w2ntyc.mjs → main-d79nrcqc.mjs} +67 -58
- package/dist/{main-8z9d979q.mjs → main-er120rjm.mjs} +2 -2
- package/dist/{main-yf9xhpn4.mjs → main-ken6azcs.mjs} +2 -2
- package/dist/main-m05te79v.mjs +1255 -0
- package/dist/{main-fed0em2f.mjs → main-rycc0g05.mjs} +3 -3
- package/dist/{main-azv7pxzm.mjs → main-sfb6r1ye.mjs} +2 -2
- package/dist/{main-y22dyw2e.mjs → main-w9h0wtxs.mjs} +57 -10
- package/dist/main-xkbs0qyx.mjs +4 -0
- package/dist/{main-csnx585b.mjs → main-yf5j8g79.mjs} +2800 -8017
- package/dist/{mcp-fvd77dd5.mjs → mcp-qzkz0rbx.mjs} +418 -414
- package/dist/{migrate-mbbpx6fe.mjs → migrate-bcea81cv.mjs} +11 -14
- package/dist/{relay-gm2rz6ag.mjs → relay-pc2ke2t2.mjs} +1489 -473
- package/dist/{runtime-update-yr9prapz.mjs → runtime-update-jaxftsqk.mjs} +7 -6
- package/dist/{setup-wq76tmbx.mjs → setup-cpr4psvg.mjs} +30 -20
- package/dist/{skill-text-x30agn5m.mjs → skill-text-v0etv8b7.mjs} +26 -8
- package/dist/{supervisor-e5k91ga8.mjs → supervisor-recc7rne.mjs} +5 -5
- package/dist/{update-mk60neam.mjs → update-0vgwjjha.mjs} +3 -3
- package/dist/{version-hwm41j2w.mjs → version-67w7t6ce.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +26 -8
- package/dist/main-afz4wktv.mjs +0 -4
- package/dist/main-e0wy6qvy.mjs +0 -2924
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePrivateJsonFileSync
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-azpzpy0x.mjs";
|
|
4
4
|
import {
|
|
5
5
|
bundledPairingCodeTtlMs,
|
|
6
6
|
mintPairingCode,
|
|
7
7
|
writeExtensionPairing
|
|
8
|
-
} from "./main-
|
|
8
|
+
} from "./main-9kxgkcse.mjs";
|
|
9
9
|
import {
|
|
10
10
|
configRoot2,
|
|
11
11
|
cacheRoot,
|
|
12
12
|
devExtensionUrl,
|
|
13
13
|
devExtensionFolder
|
|
14
|
-
} from "./main-
|
|
14
|
+
} from "./main-w9h0wtxs.mjs";
|
|
15
15
|
|
|
16
16
|
// src/setup/dev-extension.ts
|
|
17
17
|
import { createHash } from "node:crypto";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
installedRuntime2,
|
|
7
7
|
autoUpdateStatus,
|
|
8
8
|
updateAvailable
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-w9h0wtxs.mjs";
|
|
10
10
|
import {
|
|
11
11
|
unpackedReloadAdvice
|
|
12
12
|
} from "./main-mrew6jy8.mjs";
|
|
@@ -315,7 +315,7 @@ function runUpdate(args, deps) {
|
|
|
315
315
|
async function runUpdateCommand2(args) {
|
|
316
316
|
const log = (line) => process.stdout.write(line + `
|
|
317
317
|
`);
|
|
318
|
-
const { runInstalledUpdate } = await import("./runtime-update-
|
|
318
|
+
const { runInstalledUpdate } = await import("./runtime-update-jaxftsqk.mjs");
|
|
319
319
|
if (await runInstalledUpdate(args))
|
|
320
320
|
return;
|
|
321
321
|
if (compiledBinary()) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-xkbs0qyx.mjs";
|
|
4
4
|
|
|
5
5
|
// src/paths.ts
|
|
6
6
|
import fs from "node:fs";
|
|
@@ -15,6 +15,14 @@ var xdgRoot = (variable, fallback, home) => {
|
|
|
15
15
|
function defaultConfigRoot(home = os.homedir()) {
|
|
16
16
|
return xdgRoot("XDG_CONFIG_HOME", ".config", home);
|
|
17
17
|
}
|
|
18
|
+
function defaultRoots(home = os.homedir()) {
|
|
19
|
+
return {
|
|
20
|
+
config: defaultConfigRoot(home),
|
|
21
|
+
data: xdgRoot("XDG_DATA_HOME", ".local/share", home),
|
|
22
|
+
state: xdgRoot("XDG_STATE_HOME", ".local/state", home),
|
|
23
|
+
cache: xdgRoot("XDG_CACHE_HOME", ".cache", home)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
18
26
|
function configRoot2(home = os.homedir()) {
|
|
19
27
|
return override(home) ?? defaultConfigRoot(home);
|
|
20
28
|
}
|
|
@@ -49,6 +57,45 @@ var binaryPackage = () => globalThis.__OPENCODE_BROWSER_TARGET__ ? `@opencode/br
|
|
|
49
57
|
var binaryName = (platform = process.platform) => platform === "win32" ? "browse.exe" : "browse";
|
|
50
58
|
var scriptEntry = (entry) => /\.[cm]?[jt]s$/.test(entry);
|
|
51
59
|
var entryCommand = (entry, node = process.execPath) => scriptEntry(entry) ? [node, entry] : [entry];
|
|
60
|
+
var windowsShellShim = (entry, pathModule) => /\.(cmd|bat)$/i.test(entry) || pathModule.extname(entry) === "" && !pathModule.isAbsolute(entry) && !/[\\/]/.test(entry);
|
|
61
|
+
var npxEntry = (entry) => /(^|\/)_npx\//.test(entry.replaceAll("\\", "/"));
|
|
62
|
+
function resolveWindowsShim(entry, node = process.execPath, options = {}) {
|
|
63
|
+
const pathModule = options.pathModule ?? path.win32;
|
|
64
|
+
const exists = options.existsSync ?? fs.existsSync;
|
|
65
|
+
if (!windowsShellShim(entry, pathModule))
|
|
66
|
+
return;
|
|
67
|
+
const shimmed = /\.(cmd|bat)$/i.test(entry);
|
|
68
|
+
const withFolder = shimmed && (pathModule.isAbsolute(entry) || /[\\/]/.test(entry));
|
|
69
|
+
const directories = withFolder ? [pathModule.dirname(entry)] : (options.env ?? process.env).PATH?.split(";").map((directory) => directory.trim().replace(/^"(.*)"$/, "$1")).filter(Boolean) ?? [];
|
|
70
|
+
for (const directory of directories) {
|
|
71
|
+
if (!shimmed) {
|
|
72
|
+
const executable = pathModule.join(directory, `${entry}.exe`);
|
|
73
|
+
if (exists(executable))
|
|
74
|
+
return [executable];
|
|
75
|
+
}
|
|
76
|
+
const shim = withFolder ? entry : pathModule.join(directory, shimmed ? entry : `${entry}.cmd`);
|
|
77
|
+
if (!exists(shim))
|
|
78
|
+
continue;
|
|
79
|
+
const script = pathModule.join(directory, "node_modules", "@opencode", "browse", "dist", "cli.mjs");
|
|
80
|
+
if (exists(script))
|
|
81
|
+
return [node, script];
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
function entrySpawnCommand(entry, node = process.execPath, options = {}) {
|
|
86
|
+
if (scriptEntry(entry))
|
|
87
|
+
return [node, entry];
|
|
88
|
+
const pathModule = options.pathModule ?? path.win32;
|
|
89
|
+
if ((options.platform ?? process.platform) !== "win32" || !windowsShellShim(entry, pathModule))
|
|
90
|
+
return [entry];
|
|
91
|
+
const resolved = resolveWindowsShim(entry, node, options);
|
|
92
|
+
if (resolved)
|
|
93
|
+
return resolved;
|
|
94
|
+
const running = options.running ?? runningEntry();
|
|
95
|
+
const compiled = options.compiled ?? compiledBinary();
|
|
96
|
+
const checkout = options.checkout ?? fromCheckout();
|
|
97
|
+
return !compiled && !checkout && scriptEntry(running) && !npxEntry(running) ? [node, running] : [entry];
|
|
98
|
+
}
|
|
52
99
|
function installedBinary() {
|
|
53
100
|
const binary = installedBinaryPath();
|
|
54
101
|
return fs.existsSync(binary) ? binary : undefined;
|
|
@@ -63,7 +110,7 @@ function cliInstall() {
|
|
|
63
110
|
return { kind: "binary", binary: installedBinary() ?? process.execPath, pathEnv: process.env.PATH };
|
|
64
111
|
if (fromCheckout())
|
|
65
112
|
return { kind: "checkout", bundle: path.join(packageRoot(), "dist", "cli.mjs") };
|
|
66
|
-
return { kind: "npm", version: "0.0.15
|
|
113
|
+
return { kind: "npm", version: "0.0.15", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
|
|
67
114
|
}
|
|
68
115
|
function cliPrefix(install = cliInstall()) {
|
|
69
116
|
if (install.kind === "binary") {
|
|
@@ -85,7 +132,7 @@ function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjh
|
|
|
85
132
|
return id ? { id } : {};
|
|
86
133
|
}
|
|
87
134
|
var RELEASE_SERVICE = "https://anoma.ly/release";
|
|
88
|
-
function devExtension(baked =
|
|
135
|
+
function devExtension(baked = undefined) {
|
|
89
136
|
return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
|
|
90
137
|
}
|
|
91
138
|
var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
|
|
@@ -313,8 +360,6 @@ function rolloutBucket(root = stateRoot()) {
|
|
|
313
360
|
var PACKAGE_NAME = "@opencode/browse";
|
|
314
361
|
var HOUR_MS = 60 * 60 * 1000;
|
|
315
362
|
var DEFAULT_REGISTRY = "https://registry.npmjs.org";
|
|
316
|
-
var INSTALL_SCRIPT = "https://opencode.ai/browse/install";
|
|
317
|
-
var INSTALL_SCRIPT_WINDOWS = "https://opencode.ai/browse/install.ps1";
|
|
318
363
|
var autoUpdateModes = ["on", "notify", "off"];
|
|
319
364
|
var UPDATE_VERSION = /^(\d+)\.(\d+)\.(\d+)(?:-(dev|beta)\.(\d+)(?:\.(\d+))?)?$/;
|
|
320
365
|
var channelOf = (version) => version.includes("-dev.") ? "dev" : version.includes("-beta.") ? "beta" : "latest";
|
|
@@ -521,12 +566,14 @@ async function runInstaller(options) {
|
|
|
521
566
|
throw new Error(`npm install -g ${spec} left ${version}, not the requested ${options.version}`);
|
|
522
567
|
return version;
|
|
523
568
|
}
|
|
524
|
-
const
|
|
525
|
-
const script = existsSync(
|
|
569
|
+
const override = env.OPENCODE_BROWSER_INSTALL_SCRIPT;
|
|
570
|
+
const script = override ? existsSync(override) ? readFileSync2(override, "utf8") : await (options.fetch ?? fetch)(override, { signal: AbortSignal.timeout(60000) }).then(async (response) => {
|
|
526
571
|
if (!response.ok)
|
|
527
572
|
throw new Error(`couldn't download the installer (${response.status})`);
|
|
528
573
|
return response.text();
|
|
529
|
-
});
|
|
574
|
+
}) : options.installer ?? globalThis.__OPENCODE_BROWSER_INSTALLER__;
|
|
575
|
+
if (!script)
|
|
576
|
+
throw new Error("this build has no installer to run; install browse again with the install script");
|
|
530
577
|
const directory = mkdtempSync(path3.join(os2.tmpdir(), "browse-install-"));
|
|
531
578
|
const file = path3.join(directory, platform === "win32" ? "install.ps1" : "install");
|
|
532
579
|
const args = [...options.version ? ["--version", options.version] : options.channel ? ["--channel", options.channel] : [], "--no-setup"];
|
|
@@ -705,7 +752,7 @@ function spawnRuntimeChild(runtime, args, onExit, env = process.env) {
|
|
|
705
752
|
mkdirSync2(directory, { recursive: true, mode: 448 });
|
|
706
753
|
const log = openSync(path3.join(directory, "auto-update.log"), "a", 384);
|
|
707
754
|
try {
|
|
708
|
-
const [file, ...prefix] =
|
|
755
|
+
const [file, ...prefix] = entrySpawnCommand(runtime.entry);
|
|
709
756
|
const child = spawn(file, [...prefix, ...args], { detached: true, stdio: ["ignore", log, log], env: rest });
|
|
710
757
|
child.on("error", () => onExit(null));
|
|
711
758
|
child.on("exit", (code) => onExit(code));
|
|
@@ -719,4 +766,4 @@ function spawnRuntimeChild(runtime, args, onExit, env = process.env) {
|
|
|
719
766
|
}
|
|
720
767
|
}
|
|
721
768
|
|
|
722
|
-
export { configRoot2, dataRoot, stateRoot, cacheRoot, binRoot, installedBinaryPath, installerBinaryPath, defaultSettingsPath, oldStoreMarker, fromCheckout, compiledBinary, binaryPackage, binaryName, scriptEntry, entryCommand, runningEntry, checkoutRoot, cliCommand, PUBLIC_STORE_ID, storeConfig, devExtension, devExtensionUrl, devExtensionFolder, storeUrl, installCommand, runningServiceTarget, releaseChannel, checkRelease, autoUpdateModes, UPDATE_VERSION, channelOf, compareVersions, installedRuntime2, installedVersion, updateState, autoUpdateOverride, storedMode, effectiveMode, setStoredMode, autoUpdateStatus, describeAutoUpdate, updateAvailable, runCommand, registryUrl, fetchPublished, runInstaller, createAutoUpdater };
|
|
769
|
+
export { defaultRoots, configRoot2, dataRoot, stateRoot, cacheRoot, binRoot, installedBinaryPath, installerBinaryPath, defaultSettingsPath, oldStoreMarker, fromCheckout, compiledBinary, binaryPackage, binaryName, scriptEntry, entryCommand, resolveWindowsShim, entrySpawnCommand, runningEntry, checkoutRoot, cliCommand, PUBLIC_STORE_ID, storeConfig, devExtension, devExtensionUrl, devExtensionFolder, storeUrl, installCommand, runningServiceTarget, releaseChannel, checkRelease, autoUpdateModes, UPDATE_VERSION, channelOf, compareVersions, installedRuntime2, installedVersion, updateState, autoUpdateOverride, storedMode, effectiveMode, setStoredMode, autoUpdateStatus, describeAutoUpdate, updateAvailable, runCommand, registryUrl, fetchPublished, runInstaller, createAutoUpdater };
|