@buda-ai/connector 0.1.19 → 0.1.21
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.js +29 -3
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -517,7 +517,7 @@ import path2 from "path";
|
|
|
517
517
|
// package.json
|
|
518
518
|
var package_default = {
|
|
519
519
|
name: "@buda-ai/connector",
|
|
520
|
-
version: "0.1.
|
|
520
|
+
version: "0.1.21",
|
|
521
521
|
private: false,
|
|
522
522
|
type: "module",
|
|
523
523
|
publishConfig: {
|
|
@@ -544,7 +544,7 @@ var package_default = {
|
|
|
544
544
|
"lint:err": "biome format . --write && biome check . --write --diagnostic-level=error"
|
|
545
545
|
},
|
|
546
546
|
dependencies: {
|
|
547
|
-
"@bunny-agent/daemon": "0.9.
|
|
547
|
+
"@bunny-agent/daemon": "0.9.55",
|
|
548
548
|
"@clack/prompts": "^1.0.0",
|
|
549
549
|
"playwright-core": "^1.52.0",
|
|
550
550
|
ws: "^8.21.0"
|
|
@@ -2438,6 +2438,26 @@ var renameStagedRuntime = async (source, destination, options = {}) => {
|
|
|
2438
2438
|
}
|
|
2439
2439
|
};
|
|
2440
2440
|
var exists = async (filePath) => access(filePath).then(() => true).catch(() => false);
|
|
2441
|
+
var resolveNpmInvocation = async (options = {}) => {
|
|
2442
|
+
const platform4 = options.platform ?? process.platform;
|
|
2443
|
+
if (platform4 !== "win32") return { argsPrefix: [], executable: "npm" };
|
|
2444
|
+
const nodeExecutable = options.nodeExecutable ?? process.execPath;
|
|
2445
|
+
const pathApi = options.pathApi ?? path6;
|
|
2446
|
+
const pathExists = options.pathExists ?? exists;
|
|
2447
|
+
const candidates = [
|
|
2448
|
+
options.npmExecPath ?? process.env.npm_execpath,
|
|
2449
|
+
pathApi.join(pathApi.dirname(nodeExecutable), "node_modules", "npm", "bin", "npm-cli.js")
|
|
2450
|
+
];
|
|
2451
|
+
for (const candidate of candidates) {
|
|
2452
|
+
if (!candidate || pathApi.basename(candidate).toLowerCase() !== "npm-cli.js") continue;
|
|
2453
|
+
if (await pathExists(candidate)) {
|
|
2454
|
+
return { argsPrefix: [candidate], executable: nodeExecutable };
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
throw new Error(
|
|
2458
|
+
`Unable to locate npm-cli.js for the stable Connector runtime installation (node=${JSON.stringify(nodeExecutable)}, npm_execpath=${JSON.stringify(options.npmExecPath ?? process.env.npm_execpath ?? "")})`
|
|
2459
|
+
);
|
|
2460
|
+
};
|
|
2441
2461
|
var runtimeRoot = () => process.env.BUDA_CONNECTOR_RUNTIME_ROOT || path6.join(homedir3(), ".buda", "runtime");
|
|
2442
2462
|
var runtimePlatformKey = `${process.platform}-${process.arch}-node${process.versions.modules}`;
|
|
2443
2463
|
var versionDirectory = () => path6.join(runtimeRoot(), runtimePlatformKey, CONNECTOR_RUNTIME_VERSION);
|
|
@@ -2471,9 +2491,11 @@ var validateRuntime = async (runtime) => {
|
|
|
2471
2491
|
};
|
|
2472
2492
|
var installFromNpm = async (directory) => {
|
|
2473
2493
|
await mkdir5(directory, { recursive: true, mode: 448 });
|
|
2494
|
+
const npm = await resolveNpmInvocation();
|
|
2474
2495
|
await execFileAsync(
|
|
2475
|
-
|
|
2496
|
+
npm.executable,
|
|
2476
2497
|
[
|
|
2498
|
+
...npm.argsPrefix,
|
|
2477
2499
|
"install",
|
|
2478
2500
|
"--ignore-scripts=false",
|
|
2479
2501
|
"--no-audit",
|
|
@@ -5797,6 +5819,10 @@ async function runConnectorDaemon(launchConfig, options = {}) {
|
|
|
5797
5819
|
process.once("SIGINT", () => void shutdown());
|
|
5798
5820
|
process.once("SIGTERM", () => void shutdown());
|
|
5799
5821
|
} catch (error) {
|
|
5822
|
+
await writeLog(
|
|
5823
|
+
"error",
|
|
5824
|
+
`daemon startup failed: ${error instanceof Error ? error.stack || error.message : String(error)}`
|
|
5825
|
+
).catch(() => void 0);
|
|
5800
5826
|
if (bunnyDaemon) await stopEmbeddedBunnyDaemon(bunnyDaemon);
|
|
5801
5827
|
await daemonLock.release();
|
|
5802
5828
|
await restoreConsole?.();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buda-ai/connector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"lint:err": "biome format . --write && biome check . --write --diagnostic-level=error"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@bunny-agent/daemon": "0.9.
|
|
30
|
+
"@bunny-agent/daemon": "0.9.55",
|
|
31
31
|
"@clack/prompts": "^1.0.0",
|
|
32
32
|
"playwright-core": "^1.52.0",
|
|
33
33
|
"ws": "^8.21.0"
|