@lotagate/cli 0.1.3 → 0.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotagate/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Enterprise-grade terminal client for LotaGate AI agents.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -69,12 +69,12 @@
69
69
  "tiktoken": "^1.0.22"
70
70
  },
71
71
  "optionalDependencies": {
72
- "@lotagate/cli-native-linux-arm64-gnu": "0.1.3",
73
- "@lotagate/cli-native-linux-x64-gnu": "0.1.3",
74
- "@lotagate/cli-native-macos-arm64": "0.1.3",
75
- "@lotagate/cli-native-macos-x64": "0.1.3",
76
- "@lotagate/cli-native-windows-arm64": "0.1.3",
77
- "@lotagate/cli-native-windows-x64": "0.1.3"
72
+ "@lotagate/cli-native-linux-arm64-gnu": "0.1.4",
73
+ "@lotagate/cli-native-linux-x64-gnu": "0.1.4",
74
+ "@lotagate/cli-native-macos-arm64": "0.1.4",
75
+ "@lotagate/cli-native-macos-x64": "0.1.4",
76
+ "@lotagate/cli-native-windows-arm64": "0.1.4",
77
+ "@lotagate/cli-native-windows-x64": "0.1.4"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@eslint/js": "9.39.5",
@@ -13,8 +13,19 @@ if (existsSync(resolve(packageRoot, '.git'))) process.exit(0);
13
13
  if (target === undefined) await installNodeFallback();
14
14
  else await installNativeTarget(target);
15
15
 
16
+ function findInstalledNativePackageRoot(packageName) {
17
+ const segments = packageName.split('/');
18
+ for (let current = packageRoot; ; current = dirname(current)) {
19
+ const candidate = resolve(current, 'node_modules', ...segments);
20
+ if (existsSync(resolve(candidate, 'package.json'))) return candidate;
21
+ const parent = dirname(current);
22
+ if (parent === current) break;
23
+ }
24
+ return resolve(packageRoot, 'node_modules', ...segments);
25
+ }
26
+
16
27
  async function installNativeTarget(nativeTarget) {
17
- const nativePackageRoot = resolve(packageRoot, 'node_modules', ...nativeTarget.packageName.split('/'));
28
+ const nativePackageRoot = findInstalledNativePackageRoot(nativeTarget.packageName);
18
29
  const source = resolve(nativePackageRoot, 'bin', nativeTarget.binaryName);
19
30
  const destination = resolve(packageRoot, 'bin', nativeTarget.binaryName);
20
31
  const metadataFile = resolve(nativePackageRoot, 'package.json');