9routerx 0.0.0-stage → 1.0.0
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/launcher.js +34 -0
- package/package.json +32 -4
- package/README.md +0 -3
package/bin/launcher.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
const { platform, arch } = process;
|
|
4
|
+
const map = {
|
|
5
|
+
win32: { x64: 'win32-x64', arm64: 'win32-arm64' },
|
|
6
|
+
linux: { x64: 'linux-x64', arm64: 'linux-arm64' },
|
|
7
|
+
darwin: { x64: 'darwin-x64', arm64: 'darwin-arm64' },
|
|
8
|
+
};
|
|
9
|
+
const t = (map[platform] || {})[arch];
|
|
10
|
+
if (!t) {
|
|
11
|
+
console.error('9RouterX: unsupported platform ' + platform + '/' + arch);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
const pkg = '@yanstd888/9routerx-' + t;
|
|
15
|
+
const ext = platform === 'win32' ? '.exe' : '';
|
|
16
|
+
let bin;
|
|
17
|
+
try {
|
|
18
|
+
const root = require.resolve(pkg + '/package.json');
|
|
19
|
+
bin = require('path').join(require('path').dirname(root), 'bin', '9routerx' + ext);
|
|
20
|
+
} catch (err) {
|
|
21
|
+
console.error('9RouterX: the platform binary package ' + pkg + ' was not installed (' + (err.code || err.message) + ').');
|
|
22
|
+
console.error('Reinstall with: npm i -g 9routerx');
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
const { spawnSync } = require('child_process');
|
|
26
|
+
const r = spawnSync(bin, process.argv.slice(2), {
|
|
27
|
+
stdio: 'inherit',
|
|
28
|
+
env: Object.assign({}, process.env, { '9ROUTERX_NPM_INSTALL': '1' }),
|
|
29
|
+
});
|
|
30
|
+
if (r.error) {
|
|
31
|
+
console.error('9RouterX: failed to launch ' + bin + ' (' + r.error.message + ').');
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
process.exit(r.status === null ? 1 : r.status);
|
package/package.json
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "9routerx",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "9RouterX — 9R Next Go Generation: local AI gateway (installs the right platform binary)",
|
|
5
|
+
"bin": {
|
|
6
|
+
"9routerx": "bin/launcher.js"
|
|
7
|
+
},
|
|
8
|
+
"optionalDependencies": {
|
|
9
|
+
"@yanstd888/9routerx-win32-x64": "1.0.0",
|
|
10
|
+
"@yanstd888/9routerx-linux-x64": "1.0.0",
|
|
11
|
+
"@yanstd888/9routerx-linux-arm64": "1.0.0",
|
|
12
|
+
"@yanstd888/9routerx-darwin-x64": "1.0.0",
|
|
13
|
+
"@yanstd888/9routerx-darwin-arm64": "1.0.0"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/yanstd888/9routerx.git"
|
|
19
|
+
},
|
|
20
|
+
"author": "Muhammad Dian (yanstd888)",
|
|
21
|
+
"keywords": [
|
|
22
|
+
"ai",
|
|
23
|
+
"gateway",
|
|
24
|
+
"router",
|
|
25
|
+
"llm",
|
|
26
|
+
"proxy"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/README.md
DELETED