@nuphus/nuphus-desktop 0.1.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/README.md +39 -0
- package/bin/nuphus.js +77 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Nuphus Desktop
|
|
2
|
+
|
|
3
|
+
Nuphus - 协同共生桌面助手(AI 智慧协作伙伴)。
|
|
4
|
+
|
|
5
|
+
`npm` 一键安装:自动选择对应平台的二进制(win32-x64 / macOS arm64 / linux-x64),
|
|
6
|
+
无需手动下载安装包。
|
|
7
|
+
|
|
8
|
+
## 安装
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# 全局安装(提供 nuphus 命令)
|
|
12
|
+
npm install -g @nuphus/nuphus-desktop
|
|
13
|
+
|
|
14
|
+
# 或免安装体验
|
|
15
|
+
npx @nuphus/nuphus-desktop
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 启动
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
nuphus
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 支持平台
|
|
25
|
+
|
|
26
|
+
| 平台 | 架构 | 二进制子包 |
|
|
27
|
+
|------|------|-----------|
|
|
28
|
+
| Windows | x64 | `@nuphus/nuphus-desktop-win32-x64` |
|
|
29
|
+
| macOS | arm64 (Apple Silicon) | `@nuphus/nuphus-desktop-osx-arm64` |
|
|
30
|
+
| Linux | x64 | `@nuphus/nuphus-desktop-linux-x64` |
|
|
31
|
+
|
|
32
|
+
## 说明
|
|
33
|
+
|
|
34
|
+
- 首次安装体积较大(桌面应用含本地模型),请耐心等待。
|
|
35
|
+
- 需要完整安装包(msi / dmg / deb)请前往 [GitHub Releases](https://github.com/mrpulor-gh/nuphus/releases)。
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
Apache-2.0
|
package/bin/nuphus.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Nuphus 桌面应用启动器(npm 一键安装入口)
|
|
4
|
+
*
|
|
5
|
+
* 通过 optionalDependencies 自动选择对应平台的二进制子包:
|
|
6
|
+
* win32-x64 -> @nuphus/nuphus-desktop-win32-x64 (nuphus.exe)
|
|
7
|
+
* darwin-arm64-> @nuphus/nuphus-desktop-osx-arm64 (Nuphus.app)
|
|
8
|
+
* linux-x64 -> @nuphus/nuphus-desktop-linux-x64 (nuphus)
|
|
9
|
+
*/
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
const { spawn } = require('child_process');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
|
|
16
|
+
const PLATFORM_MAP = {
|
|
17
|
+
'win32-x64': {
|
|
18
|
+
pkg: 'nuphus-desktop-win32-x64',
|
|
19
|
+
binary: 'nuphus.exe',
|
|
20
|
+
},
|
|
21
|
+
'darwin-arm64': {
|
|
22
|
+
pkg: 'nuphus-desktop-osx-arm64',
|
|
23
|
+
app: 'Nuphus.app',
|
|
24
|
+
},
|
|
25
|
+
'linux-x64': {
|
|
26
|
+
pkg: 'nuphus-desktop-linux-x64',
|
|
27
|
+
binary: 'nuphus',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function resolveVendorDir() {
|
|
32
|
+
const key = `${process.platform}-${process.arch}`;
|
|
33
|
+
const spec = PLATFORM_MAP[key];
|
|
34
|
+
if (!spec) {
|
|
35
|
+
console.error(`[nuphus] 暂不支持该平台/架构: ${key}`);
|
|
36
|
+
console.error(' 当前支持: win32-x64 / darwin-arm64 / linux-x64');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
// 主包位于 node_modules/@nuphus/nuphus-desktop/,平台子包与其同级
|
|
40
|
+
// __dirname = <node_modules>/@nuphus/nuphus-desktop/bin
|
|
41
|
+
const vendor = path.join(__dirname, '..', '..', '@nuphus', spec.pkg);
|
|
42
|
+
if (!fs.existsSync(vendor)) {
|
|
43
|
+
console.error(`[nuphus] 未找到平台包: ${spec.pkg}`);
|
|
44
|
+
console.error(' 请确认安装完整(npm install -g @nuphus/nuphus-desktop)或重装。');
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
return { vendor, spec };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function main() {
|
|
51
|
+
const { vendor, spec } = resolveVendorDir();
|
|
52
|
+
|
|
53
|
+
let cmd;
|
|
54
|
+
let args = [];
|
|
55
|
+
if (process.platform === 'darwin') {
|
|
56
|
+
// macOS: open -a Nuphus.app(正确的应用启动方式)
|
|
57
|
+
cmd = 'open';
|
|
58
|
+
args = ['-a', path.join(vendor, spec.app)];
|
|
59
|
+
} else {
|
|
60
|
+
cmd = path.join(vendor, spec.binary);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const child = spawn(cmd, args, {
|
|
64
|
+
stdio: 'ignore',
|
|
65
|
+
detached: process.platform !== 'win32',
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
child.on('error', (err) => {
|
|
69
|
+
console.error(`[nuphus] 启动失败: ${err.message}`);
|
|
70
|
+
process.exit(1);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
child.unref();
|
|
74
|
+
console.log(`[nuphus] 正在启动 Nuphus 桌面应用…`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nuphus/nuphus-desktop",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Nuphus - 协同共生桌面助手。npm 一键安装:自动选择对应平台二进制(win32-x64 / macOS arm64 / linux-x64)。",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"nuphus": "bin/nuphus.js"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/mrpulor-gh/nuphus.git"
|
|
12
|
+
},
|
|
13
|
+
"optionalDependencies": {
|
|
14
|
+
"@nuphus/nuphus-desktop-win32-x64": "0.1.2",
|
|
15
|
+
"@nuphus/nuphus-desktop-osx-arm64": "0.1.2",
|
|
16
|
+
"@nuphus/nuphus-desktop-linux-x64": "0.1.2"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=16"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"nuphus",
|
|
23
|
+
"desktop",
|
|
24
|
+
"assistant",
|
|
25
|
+
"automation",
|
|
26
|
+
"ai"
|
|
27
|
+
],
|
|
28
|
+
"files": [
|
|
29
|
+
"bin/",
|
|
30
|
+
"README.md"
|
|
31
|
+
]
|
|
32
|
+
}
|