@buda-ai/connector 0.1.14 → 0.1.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.
Files changed (2) hide show
  1. package/dist/cli.js +11 -4
  2. package/package.json +1 -1
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.14",
520
+ version: "0.1.15",
521
521
  private: false,
522
522
  type: "module",
523
523
  publishConfig: {
@@ -2411,6 +2411,13 @@ import path6 from "path";
2411
2411
  import { promisify } from "util";
2412
2412
  var execFileAsync = promisify(execFile);
2413
2413
  var RUNTIME_INSTALL_TIMEOUT_MS = 5 * 6e4;
2414
+ var resolveBundledNodePlacement = (sourceRoot, sourceNode, pathApi = path6) => {
2415
+ const relativeNode = pathApi.relative(sourceRoot, sourceNode);
2416
+ return {
2417
+ copyNode: relativeNode.startsWith("..") || pathApi.isAbsolute(relativeNode),
2418
+ relativeNode
2419
+ };
2420
+ };
2414
2421
  var exists = async (filePath) => access(filePath).then(() => true).catch(() => false);
2415
2422
  var runtimeRoot = () => process.env.BUDA_CONNECTOR_RUNTIME_ROOT || path6.join(homedir3(), ".buda", "runtime");
2416
2423
  var runtimePlatformKey = `${process.platform}-${process.arch}-node${process.versions.modules}`;
@@ -2482,10 +2489,10 @@ var installFromBundledRuntime = async (directory, sourceRoot) => {
2482
2489
  if (relativeEntrypoint.startsWith("..") || path6.isAbsolute(relativeEntrypoint)) {
2483
2490
  throw new Error("Bundled Connector entrypoint must be inside its runtime root");
2484
2491
  }
2485
- const relativeNode = path6.relative(sourceRoot, sourceNode);
2492
+ const { copyNode, relativeNode } = resolveBundledNodePlacement(sourceRoot, sourceNode);
2486
2493
  const entrypoint = path6.join(directory, relativeEntrypoint);
2487
- const nodeExecutable = relativeNode.startsWith("..") ? path6.join(directory, "node", path6.basename(sourceNode)) : path6.join(directory, relativeNode);
2488
- if (relativeNode.startsWith("..")) {
2494
+ const nodeExecutable = copyNode ? path6.join(directory, "node", path6.basename(sourceNode)) : path6.join(directory, relativeNode);
2495
+ if (copyNode) {
2489
2496
  await mkdir5(path6.dirname(nodeExecutable), { recursive: true });
2490
2497
  await cp(sourceNode, nodeExecutable, { force: true });
2491
2498
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buda-ai/connector",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "publishConfig": {