uxos 0.0.22 → 0.0.24

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.
Files changed (3) hide show
  1. package/README.md +45 -1
  2. package/cli.js +71 -0
  3. package/package.json +4 -2
package/README.md CHANGED
@@ -4,12 +4,46 @@ UXOS - 设计效率助手:一个由 AI 驱动的、具有引导式工作流的
4
4
 
5
5
  ## 安装方法
6
6
 
7
- 在 CodeBuddy 的 AI 助手中输入以下指令:
7
+ **推荐方式(始终使用最新版本)**:
8
+
9
+ ```bash
10
+ npx uxos@latest
11
+ ```
12
+
13
+ **方法一:通过 AI 助手安装**
14
+
15
+ 在 CodeBuddy 的 AI 助手中输入:
8
16
 
9
17
  ```
10
18
  帮我安装 npx uxos
11
19
  ```
12
20
 
21
+ **方法二:命令行安装(推荐)**
22
+
23
+ ```bash
24
+ # 推荐:明确指定 @latest 确保使用最新版本
25
+ npx uxos@latest
26
+
27
+ # 或指定具体版本号
28
+ npx uxos@0.0.23
29
+ ```
30
+
31
+ ### ⚠️ 如果遇到旧版本问题
32
+
33
+ 如果之前安装过 uxos 并遇到错误,请运行:
34
+
35
+ ```bash
36
+ # 1. 卸载全局安装(如果有)
37
+ npm uninstall -g uxos
38
+
39
+ # 2. 清除缓存
40
+ npm cache clean --force
41
+ rm -rf ~/.npm/_npx
42
+
43
+ # 3. 使用最新版本
44
+ npx uxos@latest
45
+ ```
46
+
13
47
  然后跟随 AI 助手的指引即可完成安装。
14
48
 
15
49
  ## 使用说明
@@ -33,6 +67,16 @@ UXOS - 设计效率助手:一个由 AI 驱动的、具有引导式工作流的
33
67
 
34
68
  ### 如何查看已安装的版本?
35
69
 
70
+ **方式一:命令行查看**
71
+
72
+ ```bash
73
+ npx uxos --version
74
+ # 或
75
+ npx uxos -v
76
+ ```
77
+
78
+ **方式二:通过 AI 助手查看**
79
+
36
80
  在 AI 助手中输入:
37
81
  ```
38
82
  查看 uxos 版本
package/cli.js CHANGED
@@ -2,9 +2,48 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
+ const { execSync } = require('child_process');
6
+
7
+ // Read version from package.json
8
+ const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'));
9
+ const VERSION = packageJson.version;
5
10
 
6
11
  const UXOS_SRC_DIR = path.join(__dirname, '_uxos');
7
12
 
13
+ // Check if running the latest version
14
+ function checkForLatestVersion() {
15
+ try {
16
+ const latestVersion = execSync('npm view uxos version', { encoding: 'utf8', timeout: 3000 }).trim();
17
+
18
+ if (latestVersion !== VERSION) {
19
+ console.log(`
20
+ ╔═══════════════════════════════════════════════════════════╗
21
+ ║ ⚠️ VERSION WARNING ║
22
+ ╚═══════════════════════════════════════════════════════════╝
23
+
24
+ You are running uxos@${VERSION}
25
+ The latest version is: uxos@${latestVersion}
26
+
27
+ Please run the following to use the latest version:
28
+
29
+ npm uninstall -g uxos
30
+ npm cache clean --force
31
+ rm -rf ~/.npm/_npx
32
+ npx uxos@latest
33
+
34
+ Or simply use:
35
+
36
+ npx uxos@${latestVersion}
37
+
38
+ `);
39
+ process.exit(1);
40
+ }
41
+ } catch (error) {
42
+ // If we can't check (no internet, etc.), continue anyway
43
+ console.log('⚠️ Unable to check for updates (network issue?)');
44
+ }
45
+ }
46
+
8
47
  function createDirectory(dir) {
9
48
  if (!fs.existsSync(dir)) {
10
49
  fs.mkdirSync(dir, { recursive: true });
@@ -42,9 +81,41 @@ function copyDirectory(src, dest) {
42
81
  }
43
82
 
44
83
  function main() {
84
+ // Check for --version flag
85
+ if (process.argv.includes('--version') || process.argv.includes('-v')) {
86
+ console.log(VERSION);
87
+ return;
88
+ }
89
+
90
+ // Check if we're running the latest version
91
+ checkForLatestVersion();
92
+
93
+ // Check for old version structure and warn user
94
+ const oldWorkflowsDir = path.join(__dirname, 'workflows');
95
+ const oldTemplatesDir = path.join(__dirname, 'templates');
96
+ if (fs.existsSync(oldWorkflowsDir) || fs.existsSync(oldTemplatesDir)) {
97
+ console.log(`
98
+ ╔═══════════════════════════════════════════════════════════╗
99
+ ║ ⚠️ OLD VERSION STRUCTURE DETECTED ║
100
+ ╚═══════════════════════════════════════════════════════════╝
101
+
102
+ This appears to be an old version (0.0.21 or earlier).
103
+
104
+ Please uninstall and reinstall:
105
+
106
+ npm uninstall -g uxos
107
+ npm cache clean --force
108
+ rm -rf ~/.npm/_npx
109
+ npx uxos@latest
110
+
111
+ `);
112
+ process.exit(1);
113
+ }
114
+
45
115
  console.log(`
46
116
  ═══════════════════════════════════════════════════════════
47
117
  UXOS INSTALLER
118
+ Version: ${VERSION}
48
119
  ═══════════════════════════════════════════════════════════
49
120
 
50
121
  Installing UXOS workflow system...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uxos",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "description": "UXOS - Design Efficiency Assistant: A guided workflow system for AI-powered design collaboration",
5
5
  "main": "cli.js",
6
6
  "bin": {
@@ -16,7 +16,8 @@
16
16
  "ai-assistant",
17
17
  "productivity",
18
18
  "ux",
19
- "collaboration"
19
+ "collaboration",
20
+ "npx"
20
21
  ],
21
22
  "author": "UXOS Team",
22
23
  "license": "MIT",
@@ -28,6 +29,7 @@
28
29
  "engines": {
29
30
  "node": ">=14.0.0"
30
31
  },
32
+ "preferGlobal": false,
31
33
  "files": [
32
34
  "cli.js",
33
35
  "package.json",