Skip to content

Commit 719ff96

Browse files
resolver changes
1 parent 0f38e1d commit 719ff96

File tree

4 files changed

+23
-72
lines changed

4 files changed

+23
-72
lines changed

bun.lock

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,7 +3443,7 @@
34433443

34443444
"rimraf": ["[email protected]", "", { "dependencies": { "glob": "^11.0.0", "package-json-from-dist": "^1.0.0" }, "bin": { "rimraf": "dist/esm/bin.mjs" } }, "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A=="],
34453445

3446-
"ripemd160": ["[email protected].2", "", { "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1" } }, "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA=="],
3446+
"ripemd160": ["[email protected].1", "", { "dependencies": { "hash-base": "^2.0.0", "inherits": "^2.0.1" } }, "sha512-J7f4wutN8mdbV08MJnXibYpCOPHR+yzy+iQ/AsjMv2j8cLavQ8VGagDFUwwTAdF8FmRKVeNpbTTEwNHCW1g94w=="],
34473447

34483448
"rollup": ["[email protected]", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.50.0", "@rollup/rollup-android-arm64": "4.50.0", "@rollup/rollup-darwin-arm64": "4.50.0", "@rollup/rollup-darwin-x64": "4.50.0", "@rollup/rollup-freebsd-arm64": "4.50.0", "@rollup/rollup-freebsd-x64": "4.50.0", "@rollup/rollup-linux-arm-gnueabihf": "4.50.0", "@rollup/rollup-linux-arm-musleabihf": "4.50.0", "@rollup/rollup-linux-arm64-gnu": "4.50.0", "@rollup/rollup-linux-arm64-musl": "4.50.0", "@rollup/rollup-linux-loongarch64-gnu": "4.50.0", "@rollup/rollup-linux-ppc64-gnu": "4.50.0", "@rollup/rollup-linux-riscv64-gnu": "4.50.0", "@rollup/rollup-linux-riscv64-musl": "4.50.0", "@rollup/rollup-linux-s390x-gnu": "4.50.0", "@rollup/rollup-linux-x64-gnu": "4.50.0", "@rollup/rollup-linux-x64-musl": "4.50.0", "@rollup/rollup-openharmony-arm64": "4.50.0", "@rollup/rollup-win32-arm64-msvc": "4.50.0", "@rollup/rollup-win32-ia32-msvc": "4.50.0", "@rollup/rollup-win32-x64-msvc": "4.50.0", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-/Zl4D8zPifNmyGzJS+3kVoyXeDeT/GrsJM94sACNg9RtUE0hrHa1bNPtRSrfHTMH5HjRzce6K7rlTh3Khiw+pw=="],
34493449

@@ -4563,7 +4563,7 @@
45634563

45644564
"npm-registry-fetch/npm-package-arg": ["[email protected]", "", { "dependencies": { "hosted-git-info": "^6.0.0", "proc-log": "^3.0.0", "semver": "^7.3.5", "validate-npm-package-name": "^5.0.0" } }, "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA=="],
45654565

4566-
"nx/chalk": ["[email protected].0", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A=="],
4566+
"nx/chalk": ["[email protected].2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
45674567

45684568
"nx/cli-cursor": ["[email protected]", "", { "dependencies": { "restore-cursor": "^3.1.0" } }, "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw=="],
45694569

@@ -4609,8 +4609,6 @@
46094609

46104610
"pbkdf2/create-hash": ["[email protected]", "", { "dependencies": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", "ripemd160": "^2.0.0", "sha.js": "^2.4.0" } }, "sha512-snRpch/kwQhcdlnZKYanNF1m0RDlrCdSKQaH87w1FCFPVPNCQ/Il9QJKAX2jVBZddRdaHBMC+zXa9Gw9tmkNUA=="],
46114611

4612-
"pbkdf2/ripemd160": ["[email protected]", "", { "dependencies": { "hash-base": "^2.0.0", "inherits": "^2.0.1" } }, "sha512-J7f4wutN8mdbV08MJnXibYpCOPHR+yzy+iQ/AsjMv2j8cLavQ8VGagDFUwwTAdF8FmRKVeNpbTTEwNHCW1g94w=="],
4613-
46144612
"pino-pretty/dateformat": ["[email protected]", "", {}, "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA=="],
46154613

46164614
"pino-pretty/strip-json-comments": ["[email protected]", "", {}, "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw=="],
@@ -4669,6 +4667,8 @@
46694667

46704668
"restore-cursor/signal-exit": ["[email protected]", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="],
46714669

4670+
"ripemd160/hash-base": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.1" } }, "sha512-0TROgQ1/SxE6KmxWSvXHvRj90/Xo1JvZShofnYF+f6ZsGtR4eES7WfrQzPalmyagfKZCXpVnitiRebZulWsbiw=="],
4671+
46724672
"rpc-websockets/@types/uuid": ["@types/[email protected]", "", {}, "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw=="],
46734673

46744674
"rpc-websockets/@types/ws": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="],
@@ -4921,7 +4921,7 @@
49214921

49224922
"@nrwl/tao/nx/@nx/nx-win32-x64-msvc": ["@nx/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-//JntLrN3L7WL/WgP3D0FE34caYTPcG/GIMBguC9w7YDyTlEikLgLbobjdCPz+2f9OWGvIZbJgGmtHNjnETM/g=="],
49234923

4924-
"@nrwl/tao/nx/chalk": ["[email protected].0", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A=="],
4924+
"@nrwl/tao/nx/chalk": ["[email protected].2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
49254925

49264926
"@nrwl/tao/nx/cli-cursor": ["[email protected]", "", { "dependencies": { "restore-cursor": "^3.1.0" } }, "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw=="],
49274927

@@ -5209,10 +5209,6 @@
52095209

52105210
"pacote/sigstore/@sigstore/tuf": ["@sigstore/[email protected]", "", { "dependencies": { "@sigstore/protobuf-specs": "^0.3.2", "tuf-js": "^2.2.1" } }, "sha512-44vtsveTPUpqhm9NCrbU8CWLe3Vck2HO1PNLw7RIajbB7xhtn5RBPm1VNSCMwqGYHhDsBJG8gDF0q4lgydsJvw=="],
52115211

5212-
"pbkdf2/create-hash/ripemd160": ["[email protected]", "", { "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1" } }, "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA=="],
5213-
5214-
"pbkdf2/ripemd160/hash-base": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.1" } }, "sha512-0TROgQ1/SxE6KmxWSvXHvRj90/Xo1JvZShofnYF+f6ZsGtR4eES7WfrQzPalmyagfKZCXpVnitiRebZulWsbiw=="],
5215-
52165212
"pkg-dir/find-up/locate-path": ["[email protected]", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="],
52175213

52185214
"promzard/read/mute-stream": ["[email protected]", "", {}, "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA=="],
@@ -5485,8 +5481,6 @@
54855481

54865482
"npm-registry-fetch/npm-package-arg/hosted-git-info/lru-cache": ["[email protected]", "", {}, "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA=="],
54875483

5488-
"nx/ora/log-symbols/chalk": ["[email protected]", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
5489-
54905484
"nx/ora/log-symbols/is-unicode-supported": ["[email protected]", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="],
54915485

54925486
"pacote/npm-package-arg/hosted-git-info/lru-cache": ["[email protected]", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="],
@@ -5561,8 +5555,6 @@
55615555

55625556
"@lerna/create/rimraf/glob/path-scurry/minipass": ["[email protected]", "", {}, "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw=="],
55635557

5564-
"@nrwl/tao/nx/ora/log-symbols/chalk": ["[email protected]", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
5565-
55665558
"@nrwl/tao/nx/ora/log-symbols/is-unicode-supported": ["[email protected]", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="],
55675559

55685560
"lerna/rimraf/glob/minimatch/brace-expansion": ["[email protected]", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="],
@@ -5583,8 +5575,6 @@
55835575

55845576
"meow/read-pkg-up/read-pkg/normalize-package-data/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver" } }, "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g=="],
55855577

5586-
"nx/ora/log-symbols/chalk/supports-color": ["[email protected]", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
5587-
55885578
"pacote/npm-packlist/ignore-walk/minimatch/brace-expansion": ["[email protected]", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="],
55895579

55905580
"pacote/read-package-json/glob/minimatch/brace-expansion": ["[email protected]", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="],
@@ -5609,8 +5599,6 @@
56095599

56105600
"@cypress/vite-dev-server/node-html-parser/css-select/domutils/dom-serializer/entities": ["[email protected]", "", {}, "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A=="],
56115601

5612-
"@nrwl/tao/nx/ora/log-symbols/chalk/supports-color": ["[email protected]", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
5613-
56145602
"meow/read-pkg-up/find-up/locate-path/p-locate/p-limit": ["[email protected]", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="],
56155603

56165604
"pacote/sigstore/@sigstore/tuf/tuf-js/@tufjs/models/@tufjs/canonical-json": ["@tufjs/[email protected]", "", {}, "sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA=="],

packages/cli/build.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bun
22
/**
33
* Build script for @elizaos/cli using standardized build utilities
4-
*
4+
*
55
* Note: version.json is generated during build from package.json
66
* This ensures it always has the current version after lerna bump
77
*/
@@ -52,14 +52,14 @@ const run = createBuildRunner({
5252
},
5353
onBuildComplete: async (success) => {
5454
if (success) {
55-
// Copy templates, migration guides, and package.json to dist
55+
// Copy templates, migration guides, and package.json to dist
5656
console.log('\nCopying assets...');
5757
await copyAssets([
5858
{ from: './templates', to: './dist/templates' },
5959
{ from: './package.json', to: './dist/package.json' }, // Include package.json in dist
6060
{ from: '../docs/docs/plugins/migration/claude-code', to: './dist/migration-guides' },
6161
]);
62-
62+
6363
// Create a version file in dist to ensure version is available at runtime
6464
// This is created from the same package.json that was just copied
6565
const versionFilePath = path.resolve(process.cwd(), 'dist/version.json');

packages/cli/src/utils/display-banner.ts

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { existsSync, readFileSync } from 'node:fs';
44
import path, { dirname } from 'node:path';
55
import { fileURLToPath } from 'node:url';
6-
import os from 'node:os';
6+
// import os from 'node:os';
77
import { bunExecSimple } from './bun-exec';
88
import { UserEnvironment } from './user-environment';
99

@@ -13,32 +13,8 @@ export function isRunningFromNodeModules(): boolean {
1313
return __filename.includes('node_modules');
1414
}
1515

16-
/**
17-
* Helper to find global node_modules paths for various package managers
18-
*/
19-
function getGlobalNodeModulesPaths(): string[] {
20-
const paths = [];
21-
22-
// Bun global install location
23-
if (process.env.BUN_INSTALL) {
24-
paths.push(path.join(process.env.BUN_INSTALL, 'install/global/node_modules'));
25-
}
26-
27-
// NPM global paths
28-
if (process.env.PREFIX) {
29-
paths.push(path.join(process.env.PREFIX, 'lib/node_modules'));
30-
}
31-
32-
// Common locations
33-
paths.push(
34-
path.join(os.homedir(), '.bun/install/global/node_modules'),
35-
path.join(os.homedir(), '.npm/global/node_modules'),
36-
'/usr/local/lib/node_modules',
37-
'/usr/lib/node_modules'
38-
);
39-
40-
return paths;
41-
}
16+
// Removed global path scanning utility to avoid relying on environment-specific
17+
// globals and to prevent accidental embedding of CI paths in builds.
4218

4319
// Function to get the package version
4420
// --- Utility: Get local CLI version from package.json ---
@@ -78,34 +54,20 @@ export function getVersion(): string {
7854
}
7955
}
8056

81-
// 4. Try to find package.json in various locations
82-
// __filename and __dirname already defined above
83-
84-
const possiblePaths = [
85-
// Try dist/package.json first (for published package)
57+
// 4. Try to find package.json relative to dist (published package)
58+
const relativeCandidates = [
8659
path.resolve(__dirname, 'package.json'),
8760
path.resolve(__dirname, '../package.json'),
88-
path.resolve(__dirname, '../../package.json'),
89-
// For NPM global install
90-
path.resolve(__dirname, '../../../package.json'),
9161
];
92-
93-
// Also check global node_modules paths
94-
const globalPaths = getGlobalNodeModulesPaths();
95-
for (const globalPath of globalPaths) {
96-
possiblePaths.push(path.join(globalPath, '@elizaos/cli/package.json'));
97-
possiblePaths.push(path.join(globalPath, '@elizaos/cli/dist/package.json'));
98-
}
99-
100-
for (const packageJsonPath of possiblePaths) {
101-
if (existsSync(packageJsonPath)) {
62+
for (const candidate of relativeCandidates) {
63+
if (existsSync(candidate)) {
10264
try {
103-
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
104-
if (packageJson.name === '@elizaos/cli' && packageJson.version) {
105-
return packageJson.version;
65+
const pkg = JSON.parse(readFileSync(candidate, 'utf-8'));
66+
if (pkg?.name === '@elizaos/cli' && pkg.version) {
67+
return pkg.version as string;
10668
}
107-
} catch (error) {
108-
// Continue to next path - don't log errors as this is expected
69+
} catch {
70+
// continue
10971
}
11072
}
11173
}

packages/cli/src/utils/user-environment.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ export class UserEnvironment {
103103
};
104104
}
105105

106-
// Prefer resolving the installed CLI package.json via Node's resolver
106+
// Prefer resolving the installed CLI package.json via Node's resolver (with dynamic spec)
107107
try {
108108
const req = createRequire(import.meta.url);
109-
const pkgPath = req.resolve('@elizaos/cli/package.json');
109+
const pkgSpec = '@elizaos' + '/cli/package.json';
110+
const pkgPath = req.resolve(pkgSpec);
110111
if (existsSync(pkgPath)) {
111112
const pkgJson = JSON.parse(await fs.readFile(pkgPath, 'utf-8'));
112113
if (pkgJson?.name === '@elizaos/cli') {

0 commit comments

Comments
 (0)