agent-yes 1.118.2 → 1.119.1
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/default.config.yaml +4 -0
- package/dist/SUPPORTED_CLIS-CwM5JV4y.js +8 -0
- package/dist/{SUPPORTED_CLIS-CNLy57hz.js → SUPPORTED_CLIS-DwPmzY8B.js} +2 -2
- package/dist/cli.js +3 -3
- package/dist/index.js +2 -2
- package/dist/{serve-DKpVuQyU.js → serve-Bd-6ZItj.js} +6 -6
- package/dist/{setup-BFiD3CAi.js → setup-DiRSdfeu.js} +2 -2
- package/dist/{share-BM-H85FE.js → share-B7J79Wq9.js} +54 -18
- package/dist/{subcommands-BLSPrqA1.js → subcommands-BC_0iPGS.js} +3 -3
- package/dist/{subcommands-CIrlUP1E.js → subcommands-BFHJ2AUQ.js} +1 -1
- package/dist/{ts-BUpRpKjH.js → ts-VrgyWwNH.js} +2 -2
- package/dist/{versionChecker-D-drPifS.js → versionChecker-BjZOppZJ.js} +2 -2
- package/package.json +1 -1
- package/ts/share.ts +66 -19
- package/ts/subcommands.ts +0 -0
- package/dist/SUPPORTED_CLIS-Bq_fBaXd.js +0 -8
package/default.config.yaml
CHANGED
|
@@ -23,10 +23,14 @@ clis:
|
|
|
23
23
|
flags: m
|
|
24
24
|
- pattern: '❯ ?1\. ?Dark mode ?✔'
|
|
25
25
|
flags: m
|
|
26
|
+
- pattern: '❯ ?1\. ?Auto \(match terminal\)'
|
|
27
|
+
flags: m
|
|
26
28
|
- pattern: '❯ ?1\. ?Yes'
|
|
27
29
|
flags: m
|
|
28
30
|
- pattern: '^.{0,4} ?1\. ?Dark mode ?✔'
|
|
29
31
|
flags: m
|
|
32
|
+
- pattern: '^.{0,4} ?1\. ?Auto \(match terminal\)'
|
|
33
|
+
flags: m
|
|
30
34
|
- pattern: '^.{0,4} ?1\. ?Yes'
|
|
31
35
|
flags: m
|
|
32
36
|
- pattern: Press Enter to continue
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./ts-VrgyWwNH.js";
|
|
2
|
+
import "./logger-B9h0djqx.js";
|
|
3
|
+
import "./versionChecker-BjZOppZJ.js";
|
|
4
|
+
import "./pidStore-B5vBu8Px.js";
|
|
5
|
+
import "./globalPidIndex-gZuTvTBs.js";
|
|
6
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DwPmzY8B.js";
|
|
7
|
+
|
|
8
|
+
export { SUPPORTED_CLIS };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { t as CLIS_CONFIG } from "./ts-VrgyWwNH.js";
|
|
2
2
|
|
|
3
3
|
//#region ts/SUPPORTED_CLIS.ts
|
|
4
4
|
const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
|
|
5
5
|
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SUPPORTED_CLIS as t };
|
|
8
|
-
//# sourceMappingURL=SUPPORTED_CLIS-
|
|
8
|
+
//# sourceMappingURL=SUPPORTED_CLIS-DwPmzY8B.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { n as logger } from "./logger-B9h0djqx.js";
|
|
3
|
-
import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-
|
|
3
|
+
import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-BjZOppZJ.js";
|
|
4
4
|
import { argv } from "process";
|
|
5
5
|
import { execFileSync, spawn } from "child_process";
|
|
6
6
|
import ms from "ms";
|
|
@@ -482,7 +482,7 @@ function buildRustArgs(argv, cliFromScript, supportedClis) {
|
|
|
482
482
|
{
|
|
483
483
|
const rawArg = process.argv[2];
|
|
484
484
|
const isHelpFlag = rawArg === "-h" || rawArg === "--help";
|
|
485
|
-
const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-
|
|
485
|
+
const { isSubcommand, runSubcommand, cmdHelp } = await import("./subcommands-BFHJ2AUQ.js");
|
|
486
486
|
if (isHelpFlag && process.argv.length === 3) {
|
|
487
487
|
cmdHelp();
|
|
488
488
|
process.exit(0);
|
|
@@ -515,7 +515,7 @@ if (config.useRust) {
|
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
517
|
if (rustBinary) {
|
|
518
|
-
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-
|
|
518
|
+
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-CwM5JV4y.js");
|
|
519
519
|
const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
|
|
520
520
|
if (config.verbose) {
|
|
521
521
|
console.log(`[rust] Using binary: ${rustBinary}`);
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-VrgyWwNH.js";
|
|
2
2
|
import "./logger-B9h0djqx.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-BjZOppZJ.js";
|
|
4
4
|
import "./pidStore-B5vBu8Px.js";
|
|
5
5
|
import "./globalPidIndex-gZuTvTBs.js";
|
|
6
6
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./ts-
|
|
1
|
+
import "./ts-VrgyWwNH.js";
|
|
2
2
|
import "./logger-B9h0djqx.js";
|
|
3
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
3
|
+
import { r as getInstalledPackage } from "./versionChecker-BjZOppZJ.js";
|
|
4
4
|
import "./pidStore-B5vBu8Px.js";
|
|
5
5
|
import "./globalPidIndex-gZuTvTBs.js";
|
|
6
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-
|
|
6
|
+
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-DwPmzY8B.js";
|
|
7
7
|
import "./remotes-BufkGk0e.js";
|
|
8
|
-
import { c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, m as snapshotStatus, r as controlCodeFromName, u as readNotes } from "./subcommands-
|
|
8
|
+
import { c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, m as snapshotStatus, r as controlCodeFromName, u as readNotes } from "./subcommands-BC_0iPGS.js";
|
|
9
9
|
import yargs from "yargs";
|
|
10
10
|
import { mkdir, open, readFile, writeFile } from "fs/promises";
|
|
11
11
|
import { homedir, hostname, userInfo } from "os";
|
|
@@ -820,7 +820,7 @@ Options:
|
|
|
820
820
|
const webrtcVal = argv.webrtc ?? argv.share;
|
|
821
821
|
const explicitUrl = typeof webrtcVal === "string" && webrtcVal.startsWith("webrtc://") ? webrtcVal : void 0;
|
|
822
822
|
try {
|
|
823
|
-
const { startShare, loadOrCreateShareRoom } = await import("./share-
|
|
823
|
+
const { startShare, loadOrCreateShareRoom } = await import("./share-B7J79Wq9.js");
|
|
824
824
|
const { link, close } = await startShare({
|
|
825
825
|
url: explicitUrl ?? await loadOrCreateShareRoom(),
|
|
826
826
|
localFetch: apiFetch,
|
|
@@ -851,4 +851,4 @@ Options:
|
|
|
851
851
|
|
|
852
852
|
//#endregion
|
|
853
853
|
export { cmdServe };
|
|
854
|
-
//# sourceMappingURL=serve-
|
|
854
|
+
//# sourceMappingURL=serve-Bd-6ZItj.js.map
|
|
@@ -69,7 +69,7 @@ async function cmdSetup(rest) {
|
|
|
69
69
|
if (!existsSync$1(abs)) process.stderr.write(` note: that directory doesn't exist yet — create it, or agents spawned there will fail\n`);
|
|
70
70
|
if (noShare) return 0;
|
|
71
71
|
process.stdout.write(`\nsharing this machine to agent-yes.com…\n`);
|
|
72
|
-
const { cmdServe } = await import("./serve-
|
|
72
|
+
const { cmdServe } = await import("./serve-Bd-6ZItj.js");
|
|
73
73
|
return cmdServe([
|
|
74
74
|
"install",
|
|
75
75
|
"--share",
|
|
@@ -79,4 +79,4 @@ async function cmdSetup(rest) {
|
|
|
79
79
|
|
|
80
80
|
//#endregion
|
|
81
81
|
export { cmdSetup };
|
|
82
|
-
//# sourceMappingURL=setup-
|
|
82
|
+
//# sourceMappingURL=setup-DiRSdfeu.js.map
|
|
@@ -31,27 +31,63 @@ function parseShareUrl(s) {
|
|
|
31
31
|
host: m[3]
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
+
async function linkFromBunCache() {
|
|
35
|
+
const { existsSync, symlinkSync, mkdirSync, readdirSync } = await import("fs");
|
|
36
|
+
const path = (await import("path")).default;
|
|
37
|
+
const { createRequire } = await import("module");
|
|
38
|
+
const require = createRequire(import.meta.url);
|
|
39
|
+
const pkg = path.dirname(require.resolve("node-datachannel/package.json"));
|
|
40
|
+
const bin = path.join(pkg, "build", "Release", "node_datachannel.node");
|
|
41
|
+
const cacheRoot = path.join((await import("os")).homedir(), ".bun", "install", "cache");
|
|
42
|
+
if (existsSync(bin) && existsSync(cacheRoot)) for (const d of readdirSync(cacheRoot)) {
|
|
43
|
+
if (!d.startsWith("node-datachannel@")) continue;
|
|
44
|
+
const dst = path.join(cacheRoot, d, "build", "Release");
|
|
45
|
+
mkdirSync(dst, { recursive: true });
|
|
46
|
+
const link = path.join(dst, "node_datachannel.node");
|
|
47
|
+
if (!existsSync(link)) symlinkSync(bin, link);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function ndPackageDir() {
|
|
51
|
+
try {
|
|
52
|
+
const path = (await import("path")).default;
|
|
53
|
+
const { createRequire } = await import("module");
|
|
54
|
+
const require = createRequire(import.meta.url);
|
|
55
|
+
return path.dirname(require.resolve("node-datachannel/package.json"));
|
|
56
|
+
} catch {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async function ensureAddon(ndDir) {
|
|
61
|
+
const { existsSync } = await import("fs");
|
|
62
|
+
const path = (await import("path")).default;
|
|
63
|
+
if (existsSync(path.join(ndDir, "build", "Release", "node_datachannel.node"))) return;
|
|
64
|
+
try {
|
|
65
|
+
const { createRequire } = await import("module");
|
|
66
|
+
const binJs = createRequire(import.meta.url).resolve("prebuild-install/bin.js", { paths: [ndDir] });
|
|
67
|
+
const { spawnSync } = await import("child_process");
|
|
68
|
+
process.stderr.write("fetching node-datachannel prebuilt binary (one-time)…\n");
|
|
69
|
+
spawnSync(process.execPath, [
|
|
70
|
+
binJs,
|
|
71
|
+
"-r",
|
|
72
|
+
"napi"
|
|
73
|
+
], {
|
|
74
|
+
cwd: ndDir,
|
|
75
|
+
stdio: "ignore"
|
|
76
|
+
});
|
|
77
|
+
} catch {}
|
|
78
|
+
}
|
|
34
79
|
async function importRTC() {
|
|
80
|
+
const ndDir = await ndPackageDir();
|
|
81
|
+
if (ndDir) await ensureAddon(ndDir);
|
|
35
82
|
try {
|
|
36
83
|
return (await import("node-datachannel/polyfill")).RTCPeerConnection;
|
|
37
|
-
} catch {
|
|
84
|
+
} catch (firstErr) {
|
|
85
|
+
await linkFromBunCache().catch(() => {});
|
|
38
86
|
try {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const pkg = path.dirname(require.resolve("node-datachannel/package.json"));
|
|
44
|
-
const bin = path.join(pkg, "build", "Release", "node_datachannel.node");
|
|
45
|
-
const cacheRoot = path.join((await import("os")).homedir(), ".bun", "install", "cache");
|
|
46
|
-
if (existsSync(bin) && existsSync(cacheRoot)) for (const d of readdirSync(cacheRoot)) {
|
|
47
|
-
if (!d.startsWith("node-datachannel@")) continue;
|
|
48
|
-
const dst = path.join(cacheRoot, d, "build", "Release");
|
|
49
|
-
mkdirSync(dst, { recursive: true });
|
|
50
|
-
const link = path.join(dst, "node_datachannel.node");
|
|
51
|
-
if (!existsSync(link)) symlinkSync(bin, link);
|
|
52
|
-
}
|
|
53
|
-
} catch {}
|
|
54
|
-
return (await import("node-datachannel/polyfill")).RTCPeerConnection;
|
|
87
|
+
return (await import("node-datachannel/polyfill")).RTCPeerConnection;
|
|
88
|
+
} catch {
|
|
89
|
+
throw firstErr;
|
|
90
|
+
}
|
|
55
91
|
}
|
|
56
92
|
}
|
|
57
93
|
/** Start the share bridge. Resolves once signaling is connected; runs until the
|
|
@@ -215,4 +251,4 @@ async function startShare(opts) {
|
|
|
215
251
|
|
|
216
252
|
//#endregion
|
|
217
253
|
export { loadOrCreateShareRoom, startShare };
|
|
218
|
-
//# sourceMappingURL=share-
|
|
254
|
+
//# sourceMappingURL=share-B7J79Wq9.js.map
|
|
@@ -231,11 +231,11 @@ async function runSubcommand(argv) {
|
|
|
231
231
|
case "restart": return await cmdRestart(rest);
|
|
232
232
|
case "note": return await cmdNote(rest);
|
|
233
233
|
case "serve": {
|
|
234
|
-
const { cmdServe } = await import("./serve-
|
|
234
|
+
const { cmdServe } = await import("./serve-Bd-6ZItj.js");
|
|
235
235
|
return cmdServe(rest);
|
|
236
236
|
}
|
|
237
237
|
case "setup": {
|
|
238
|
-
const { cmdSetup } = await import("./setup-
|
|
238
|
+
const { cmdSetup } = await import("./setup-DiRSdfeu.js");
|
|
239
239
|
return cmdSetup(rest);
|
|
240
240
|
}
|
|
241
241
|
case "remote": {
|
|
@@ -1680,4 +1680,4 @@ async function cmdStatus(rest) {
|
|
|
1680
1680
|
|
|
1681
1681
|
//#endregion
|
|
1682
1682
|
export { finalizedLines as a, listRecords as c, renderRawLog as d, resolveOne as f, writeToIpc as g, stopTipForCli as h, cursorAbs as i, matchKeyword as l, snapshotStatus as m, cmdHelp as n, isPidAlive as o, runSubcommand as p, controlCodeFromName as r, isSubcommand as s, GRACEFUL_EXIT_COMMANDS as t, readNotes as u };
|
|
1683
|
-
//# sourceMappingURL=subcommands-
|
|
1683
|
+
//# sourceMappingURL=subcommands-BC_0iPGS.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./logger-B9h0djqx.js";
|
|
2
2
|
import "./globalPidIndex-gZuTvTBs.js";
|
|
3
3
|
import "./remotes-BufkGk0e.js";
|
|
4
|
-
import { a as finalizedLines, c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, h as stopTipForCli, i as cursorAbs, l as matchKeyword, m as snapshotStatus, n as cmdHelp, o as isPidAlive, p as runSubcommand, r as controlCodeFromName, s as isSubcommand, t as GRACEFUL_EXIT_COMMANDS, u as readNotes } from "./subcommands-
|
|
4
|
+
import { a as finalizedLines, c as listRecords, d as renderRawLog, f as resolveOne, g as writeToIpc, h as stopTipForCli, i as cursorAbs, l as matchKeyword, m as snapshotStatus, n as cmdHelp, o as isPidAlive, p as runSubcommand, r as controlCodeFromName, s as isSubcommand, t as GRACEFUL_EXIT_COMMANDS, u as readNotes } from "./subcommands-BC_0iPGS.js";
|
|
5
5
|
|
|
6
6
|
export { cmdHelp, isSubcommand, runSubcommand };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as logger, t as addTransport } from "./logger-B9h0djqx.js";
|
|
2
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
2
|
+
import { r as getInstalledPackage } from "./versionChecker-BjZOppZJ.js";
|
|
3
3
|
import { t as agentYesHome } from "./agentYesHome-BvaUOzCV.js";
|
|
4
4
|
import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-CJxsoGdb.js";
|
|
5
5
|
import { t as PidStore } from "./pidStore-B5vBu8Px.js";
|
|
@@ -1715,4 +1715,4 @@ function sleep(ms) {
|
|
|
1715
1715
|
|
|
1716
1716
|
//#endregion
|
|
1717
1717
|
export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
|
|
1718
|
-
//# sourceMappingURL=ts-
|
|
1718
|
+
//# sourceMappingURL=ts-VrgyWwNH.js.map
|
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
|
|
|
7
7
|
|
|
8
8
|
//#region package.json
|
|
9
9
|
var name = "agent-yes";
|
|
10
|
-
var version = "1.
|
|
10
|
+
var version = "1.119.1";
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region ts/versionChecker.ts
|
|
@@ -221,4 +221,4 @@ async function displayVersion() {
|
|
|
221
221
|
|
|
222
222
|
//#endregion
|
|
223
223
|
export { versionString as i, displayVersion as n, getInstalledPackage as r, checkAndAutoUpdate as t };
|
|
224
|
-
//# sourceMappingURL=versionChecker-
|
|
224
|
+
//# sourceMappingURL=versionChecker-BjZOppZJ.js.map
|
package/package.json
CHANGED
package/ts/share.ts
CHANGED
|
@@ -60,31 +60,78 @@ function parseShareUrl(s: string): { room: string; token: string; host: string }
|
|
|
60
60
|
// from the global cache where the prebuilt .node isn't linked; this best-effort
|
|
61
61
|
// shim symlinks it in before we import. In a normal npm/bunx install the binary
|
|
62
62
|
// resolves from node_modules and the first import just works.
|
|
63
|
+
async function linkFromBunCache(): Promise<void> {
|
|
64
|
+
const { existsSync, symlinkSync, mkdirSync, readdirSync } = await import("fs");
|
|
65
|
+
const path = (await import("path")).default;
|
|
66
|
+
const { createRequire } = await import("module");
|
|
67
|
+
const require = createRequire(import.meta.url);
|
|
68
|
+
const pkg = path.dirname(require.resolve("node-datachannel/package.json"));
|
|
69
|
+
const bin = path.join(pkg, "build", "Release", "node_datachannel.node");
|
|
70
|
+
const cacheRoot = path.join((await import("os")).homedir(), ".bun", "install", "cache");
|
|
71
|
+
if (existsSync(bin) && existsSync(cacheRoot)) {
|
|
72
|
+
for (const d of readdirSync(cacheRoot)) {
|
|
73
|
+
if (!d.startsWith("node-datachannel@")) continue;
|
|
74
|
+
const dst = path.join(cacheRoot, d, "build", "Release");
|
|
75
|
+
mkdirSync(dst, { recursive: true });
|
|
76
|
+
const link = path.join(dst, "node_datachannel.node");
|
|
77
|
+
if (!existsSync(link)) symlinkSync(bin, link);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Resolve node-datachannel's package dir — where its loader expects the native
|
|
83
|
+
// addon at build/Release/node_datachannel.node. null if it can't be resolved.
|
|
84
|
+
async function ndPackageDir(): Promise<string | null> {
|
|
85
|
+
try {
|
|
86
|
+
const path = (await import("path")).default;
|
|
87
|
+
const { createRequire } = await import("module");
|
|
88
|
+
const require = createRequire(import.meta.url);
|
|
89
|
+
return path.dirname(require.resolve("node-datachannel/package.json"));
|
|
90
|
+
} catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// `bunx agent-yes` / `bun add -g agent-yes` skip node-datachannel's install
|
|
96
|
+
// script (bun only honors trustedDependencies from the *root* package, and there
|
|
97
|
+
// agent-yes is a dependency), so the prebuilt .node is never downloaded. Fetch it
|
|
98
|
+
// with the prebuild-install CLI from node-datachannel's own dependency tree — the
|
|
99
|
+
// exact `prebuild-install -r napi` its install script would have run. Must run
|
|
100
|
+
// BEFORE the first import: Bun caches a failed dynamic import, so downloading
|
|
101
|
+
// after a miss wouldn't take effect until the process restarts.
|
|
102
|
+
async function ensureAddon(ndDir: string): Promise<void> {
|
|
103
|
+
const { existsSync } = await import("fs");
|
|
104
|
+
const path = (await import("path")).default;
|
|
105
|
+
if (existsSync(path.join(ndDir, "build", "Release", "node_datachannel.node"))) return;
|
|
106
|
+
try {
|
|
107
|
+
const { createRequire } = await import("module");
|
|
108
|
+
const require = createRequire(import.meta.url);
|
|
109
|
+
const binJs = require.resolve("prebuild-install/bin.js", { paths: [ndDir] });
|
|
110
|
+
const { spawnSync } = await import("child_process");
|
|
111
|
+
process.stderr.write("fetching node-datachannel prebuilt binary (one-time)…\n");
|
|
112
|
+
// process.execPath is bun (or node) — both execute the prebuild-install CLI.
|
|
113
|
+
spawnSync(process.execPath, [binJs, "-r", "napi"], { cwd: ndDir, stdio: "ignore" });
|
|
114
|
+
} catch {
|
|
115
|
+
/* best effort — the import below surfaces a clear error if it's still missing */
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
63
119
|
async function importRTC(): Promise<any> {
|
|
120
|
+
// Ensure the native addon is on disk before the first import — a failed
|
|
121
|
+
// dynamic import is cached by Bun, so post-import healing can't recover it.
|
|
122
|
+
const ndDir = await ndPackageDir();
|
|
123
|
+
if (ndDir) await ensureAddon(ndDir);
|
|
64
124
|
try {
|
|
65
125
|
return (await import("node-datachannel/polyfill")).RTCPeerConnection;
|
|
66
|
-
} catch {
|
|
126
|
+
} catch (firstErr) {
|
|
127
|
+
// Fallback for linked/global installs: the binary lives in the resolved pkg
|
|
128
|
+
// but Bun's cache copy lacks it — symlink it across, then retry once.
|
|
129
|
+
await linkFromBunCache().catch(() => {});
|
|
67
130
|
try {
|
|
68
|
-
|
|
69
|
-
const path = (await import("path")).default;
|
|
70
|
-
const { createRequire } = await import("module");
|
|
71
|
-
const require = createRequire(import.meta.url);
|
|
72
|
-
const pkg = path.dirname(require.resolve("node-datachannel/package.json"));
|
|
73
|
-
const bin = path.join(pkg, "build", "Release", "node_datachannel.node");
|
|
74
|
-
const cacheRoot = path.join((await import("os")).homedir(), ".bun", "install", "cache");
|
|
75
|
-
if (existsSync(bin) && existsSync(cacheRoot)) {
|
|
76
|
-
for (const d of readdirSync(cacheRoot)) {
|
|
77
|
-
if (!d.startsWith("node-datachannel@")) continue;
|
|
78
|
-
const dst = path.join(cacheRoot, d, "build", "Release");
|
|
79
|
-
mkdirSync(dst, { recursive: true });
|
|
80
|
-
const link = path.join(dst, "node_datachannel.node");
|
|
81
|
-
if (!existsSync(link)) symlinkSync(bin, link);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
131
|
+
return (await import("node-datachannel/polyfill")).RTCPeerConnection;
|
|
84
132
|
} catch {
|
|
85
|
-
|
|
133
|
+
throw firstErr;
|
|
86
134
|
}
|
|
87
|
-
return (await import("node-datachannel/polyfill")).RTCPeerConnection;
|
|
88
135
|
}
|
|
89
136
|
}
|
|
90
137
|
|
package/ts/subcommands.ts
CHANGED
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import "./ts-BUpRpKjH.js";
|
|
2
|
-
import "./logger-B9h0djqx.js";
|
|
3
|
-
import "./versionChecker-D-drPifS.js";
|
|
4
|
-
import "./pidStore-B5vBu8Px.js";
|
|
5
|
-
import "./globalPidIndex-gZuTvTBs.js";
|
|
6
|
-
import { t as SUPPORTED_CLIS } from "./SUPPORTED_CLIS-CNLy57hz.js";
|
|
7
|
-
|
|
8
|
-
export { SUPPORTED_CLIS };
|