@josfox/jos 4.0.0 → 4.0.2
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/bin/jos +22 -3
- package/package.json +3 -2
package/bin/jos
CHANGED
|
@@ -65,12 +65,31 @@ if (!cmd) {
|
|
|
65
65
|
process.exit(0);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
// Look for command in multiple locations (priority order)
|
|
69
|
+
const PKG_COMMANDS = path.join(__dirname, '..', 'src', 'commands'); // npm package
|
|
70
|
+
const USER_COMMANDS = path.join(JOS_HOME, 'commands'); // user installed
|
|
71
|
+
|
|
72
|
+
function findCommand(name) {
|
|
73
|
+
// 1. Check user's ~/.jos/commands first (allows overrides)
|
|
74
|
+
const userPath = path.join(USER_COMMANDS, name, 'index.js');
|
|
75
|
+
if (fs.existsSync(userPath)) return userPath;
|
|
76
|
+
|
|
77
|
+
// 2. Check npm package src/commands
|
|
78
|
+
const pkgPath = path.join(PKG_COMMANDS, `${name}.js`);
|
|
79
|
+
if (fs.existsSync(pkgPath)) return pkgPath;
|
|
80
|
+
|
|
81
|
+
// 3. Check npm package src/ directly (for serve.js)
|
|
82
|
+
const srcPath = path.join(__dirname, '..', 'src', `${name}.js`);
|
|
83
|
+
if (fs.existsSync(srcPath)) return srcPath;
|
|
84
|
+
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const cmdPath = findCommand(cmd);
|
|
89
|
+
if (!cmdPath) {
|
|
70
90
|
const color = randomAurora();
|
|
71
91
|
console.log(`\n${color} ✖${C.reset} ${C.white}Unknown command:${C.reset} ${C.cyan}${rawCmd}${C.reset}`);
|
|
72
92
|
console.log(`${C.dim} Try: ${C.cyan}jos --help${C.reset}${C.dim} to see available commands${C.reset}\n`);
|
|
73
93
|
process.exit(1);
|
|
74
94
|
}
|
|
75
95
|
require(cmdPath).execute(process.argv.slice(3), JOS_HOME);
|
|
76
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@josfox/jos",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Stoic kernel for AI agent orchestration. Zero dependencies. Offline first.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "JOS Open Solutions Foundation",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"zero-dependencies"
|
|
22
22
|
],
|
|
23
23
|
"bin": {
|
|
24
|
-
"jos": "bin/jos"
|
|
24
|
+
"jos": "bin/jos",
|
|
25
|
+
"josfox": "bin/jos"
|
|
25
26
|
},
|
|
26
27
|
"files": [
|
|
27
28
|
"bin/",
|