workplace-pua-cli 0.4.1 → 0.7.1

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 (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +512 -243
  3. package/dist/commands/chat-new-imports.js +2 -0
  4. package/dist/commands/config.js +14 -6
  5. package/dist/commands/email.js +301 -0
  6. package/dist/commands/interview.js +660 -0
  7. package/dist/commands/jargon.js +153 -0
  8. package/dist/commands/meeting-room.js +384 -0
  9. package/dist/commands/meeting.js +323 -0
  10. package/dist/commands/weekly.js +302 -0
  11. package/dist/index.js +29 -7
  12. package/dist/prompts/hr.js +126 -0
  13. package/dist/prompts/index.js +82 -1
  14. package/dist/prompts/intern.js +126 -0
  15. package/dist/prompts/interview-prompts.js +286 -0
  16. package/dist/prompts/meeting-prompts.js +229 -0
  17. package/dist/prompts/pm.js +123 -0
  18. package/dist/prompts/techlead.js +126 -0
  19. package/dist/utils/box.js +141 -0
  20. package/dist/utils/meeting-utils.js +194 -0
  21. package/dist/utils/resume-parser.js +122 -0
  22. package/dist/utils/stream.js +97 -13
  23. package/dist/utils/theme.js +177 -0
  24. package/package.json +73 -52
  25. package/.env.example +0 -4
  26. package/.eslintrc.json +0 -21
  27. package/.prettierrc.json +0 -9
  28. package/CHANGELOG.md +0 -113
  29. package/docs/OPTIMIZATION.md +0 -772
  30. package/docs/TECHNICAL_PRINCIPLES.md +0 -663
  31. package/sample/1.png +0 -0
  32. package/sample/2.png +0 -0
  33. package/screenshots/chat-dialogue.png +0 -0
  34. package/screenshots/chat-mode.png +0 -0
  35. package/src/__tests__/config/settings.test.ts +0 -48
  36. package/src/__tests__/prompts/boss.test.ts +0 -35
  37. package/src/commands/chat.ts +0 -328
  38. package/src/commands/config.ts +0 -283
  39. package/src/commands/prompt.ts +0 -154
  40. package/src/config/providers.ts +0 -109
  41. package/src/config/session-storage.ts +0 -94
  42. package/src/config/settings.ts +0 -194
  43. package/src/config/storage.ts +0 -150
  44. package/src/history/session.ts +0 -141
  45. package/src/index.ts +0 -164
  46. package/src/llm/base.ts +0 -55
  47. package/src/llm/factory.ts +0 -24
  48. package/src/llm/openai.ts +0 -113
  49. package/src/llm/zhipu.ts +0 -101
  50. package/src/prompts/boss.ts +0 -43
  51. package/src/prompts/employee.ts +0 -43
  52. package/src/prompts/index.ts +0 -3
  53. package/src/utils/formatter.ts +0 -104
  54. package/src/utils/logger.ts +0 -31
  55. package/src/utils/stream.ts +0 -76
  56. package/tsconfig.json +0 -20
  57. package/vitest.config.ts +0 -18
@@ -5,25 +5,75 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.StreamPrinter = void 0;
7
7
  const chalk_1 = __importDefault(require("chalk"));
8
+ const BOX_WIDTH = 50;
9
+ /**
10
+ * 计算字符串的终端显示宽度(CJK 字符算 2 宽度)
11
+ */
12
+ function displayWidth(str) {
13
+ let width = 0;
14
+ for (const char of str) {
15
+ const code = char.codePointAt(0) || 0;
16
+ if ((code >= 0x4E00 && code <= 0x9FFF) ||
17
+ (code >= 0x3000 && code <= 0x303F) ||
18
+ (code >= 0xFF00 && code <= 0xFFEF) ||
19
+ (code >= 0x3400 && code <= 0x4DBF) ||
20
+ (code >= 0xF900 && code <= 0xFAFF) ||
21
+ (code >= 0x20000 && code <= 0x2FA1F)) {
22
+ width += 2;
23
+ }
24
+ else {
25
+ width += 1;
26
+ }
27
+ }
28
+ return width;
29
+ }
30
+ /**
31
+ * 用空格填充到指定显示宽度
32
+ */
33
+ function padToWidth(str, targetWidth) {
34
+ const currentWidth = displayWidth(str);
35
+ const padding = Math.max(0, targetWidth - currentWidth);
36
+ return str + ' '.repeat(padding);
37
+ }
38
+ /**
39
+ * 角色标签映射
40
+ */
41
+ const ROLE_LABELS = {
42
+ boss: '老板',
43
+ employee: '员工',
44
+ pm: '产品经理',
45
+ hr: 'HR',
46
+ techlead: '技术主管',
47
+ intern: '实习生',
48
+ };
49
+ /**
50
+ * 角色颜色映射
51
+ */
52
+ const ROLE_COLOR_FNS = {
53
+ boss: chalk_1.default.red.bold,
54
+ employee: chalk_1.default.yellow.bold,
55
+ pm: chalk_1.default.cyan.bold,
56
+ hr: chalk_1.default.magenta.bold,
57
+ techlead: chalk_1.default.blue.bold,
58
+ intern: chalk_1.default.green.bold,
59
+ };
8
60
  class StreamPrinter {
9
61
  roleColor;
10
62
  buffer = '';
11
- currentLine = '';
63
+ currentRoleColor;
12
64
  constructor(roleColor = chalk_1.default.green) {
13
65
  this.roleColor = roleColor;
66
+ this.currentRoleColor = roleColor;
14
67
  }
15
68
  /**
16
69
  * Print a streaming chunk to the terminal
17
70
  */
18
71
  printChunk(chunk) {
19
72
  if (chunk.content) {
20
- // Accumulate content for smoother display
21
73
  this.buffer += chunk.content;
22
- // Print directly for real-time effect
23
74
  process.stdout.write(chunk.content);
24
75
  }
25
76
  if (chunk.done) {
26
- // Add newline when done
27
77
  process.stdout.write('\n');
28
78
  }
29
79
  }
@@ -34,27 +84,37 @@ class StreamPrinter {
34
84
  console.log(this.roleColor(message));
35
85
  }
36
86
  /**
37
- * Print user input
87
+ * Print user input with box
38
88
  */
39
89
  printUserInput(input) {
40
- console.log(chalk_1.default.gray('┌─────────────────────────────────────'));
41
- console.log(chalk_1.default.gray('│ 你:'), input);
42
- console.log(chalk_1.default.gray('└─────────────────────────────────────'));
90
+ const innerWidth = BOX_WIDTH - 4;
91
+ const lines = wrapByWidth(input, innerWidth);
92
+ console.log(chalk_1.default.gray(`┌${''.repeat(BOX_WIDTH - 2)}┐`));
93
+ console.log(chalk_1.default.gray('│') + ' 你: ' + padToWidth(lines[0] || '', innerWidth - 4) + chalk_1.default.gray(' │'));
94
+ for (let i = 1; i < lines.length; i++) {
95
+ console.log(chalk_1.default.gray('│') + ' ' + padToWidth(lines[i], innerWidth - 4) + chalk_1.default.gray(' │'));
96
+ }
97
+ console.log(chalk_1.default.gray(`└${'─'.repeat(BOX_WIDTH - 2)}┘`));
43
98
  }
44
99
  /**
45
- * Print assistant response header
100
+ * Print assistant response header (supports all 6 roles)
46
101
  */
47
102
  printResponseHeader(role) {
48
- const roleLabel = role === 'boss' ? '老板' : '员工';
49
- const color = role === 'boss' ? chalk_1.default.red.bold : chalk_1.default.yellow.bold;
103
+ const roleLabel = ROLE_LABELS[role] || role;
104
+ const colorFn = ROLE_COLOR_FNS[role] || chalk_1.default.white.bold;
105
+ const headerText = `─ ${roleLabel} `;
106
+ const headerDisplayWidth = displayWidth(headerText);
107
+ const remaining = Math.max(0, BOX_WIDTH - 2 - headerDisplayWidth);
108
+ // Store role color for footer
109
+ this.currentRoleColor = colorFn;
50
110
  console.log();
51
- console.log(color(`┌─ ${roleLabel} ─────────────────────────────`));
111
+ console.log(colorFn(`┌${headerText}${'─'.repeat(remaining)}┐`));
52
112
  }
53
113
  /**
54
114
  * Print assistant response footer
55
115
  */
56
116
  printResponseFooter() {
57
- console.log(chalk_1.default.gray('└─────────────────────────────────────'));
117
+ console.log(this.currentRoleColor(`└${''.repeat(BOX_WIDTH - 2)}┘`));
58
118
  console.log();
59
119
  }
60
120
  /**
@@ -72,3 +132,27 @@ class StreamPrinter {
72
132
  }
73
133
  }
74
134
  exports.StreamPrinter = StreamPrinter;
135
+ /**
136
+ * 按显示宽度换行文本
137
+ */
138
+ function wrapByWidth(text, maxWidth) {
139
+ const lines = [];
140
+ let current = '';
141
+ let currentWidth = 0;
142
+ for (const char of text) {
143
+ const charWidth = displayWidth(char);
144
+ if (currentWidth + charWidth > maxWidth) {
145
+ lines.push(current);
146
+ current = char;
147
+ currentWidth = charWidth;
148
+ }
149
+ else {
150
+ current += char;
151
+ currentWidth += charWidth;
152
+ }
153
+ }
154
+ if (current.length > 0) {
155
+ lines.push(current);
156
+ }
157
+ return lines.length > 0 ? lines : [''];
158
+ }
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ /**
3
+ * 颜色主题系统
4
+ * 功能:提供多种颜色主题和动态切换能力
5
+ */
6
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.themeManager = exports.ThemeManager = exports.THEMES = void 0;
11
+ exports.setTheme = setTheme;
12
+ exports.applyTheme = applyTheme;
13
+ exports.listThemes = listThemes;
14
+ const chalk_1 = __importDefault(require("chalk"));
15
+ /**
16
+ * 预定义主题
17
+ */
18
+ exports.THEMES = {
19
+ default: {
20
+ name: '默认',
21
+ description: '标准亮色主题',
22
+ colors: {
23
+ primary: 'cyan',
24
+ secondary: 'white',
25
+ accent: 'gray',
26
+ border: 'cyan',
27
+ text: 'white'
28
+ }
29
+ },
30
+ dark: {
31
+ name: '暗色',
32
+ description: '适合夜间使用的深色主题',
33
+ colors: {
34
+ primary: 'gray',
35
+ secondary: 'white',
36
+ accent: 'dim',
37
+ border: 'gray',
38
+ text: 'white'
39
+ }
40
+ },
41
+ colorful: {
42
+ name: '多彩',
43
+ description: '鲜艳多彩的主题',
44
+ colors: {
45
+ primary: 'magenta',
46
+ secondary: 'white',
47
+ accent: 'yellow',
48
+ border: 'gray',
49
+ text: 'white'
50
+ }
51
+ },
52
+ minimal: {
53
+ name: '极简',
54
+ description: '极简黑白风格',
55
+ colors: {
56
+ primary: 'white',
57
+ secondary: 'gray',
58
+ accent: 'gray',
59
+ border: 'gray',
60
+ text: 'white'
61
+ }
62
+ }
63
+ };
64
+ /**
65
+ * 主题管理器
66
+ */
67
+ class ThemeManager {
68
+ currentTheme = exports.THEMES.default;
69
+ /**
70
+ * 设置主题
71
+ */
72
+ setTheme(themeName) {
73
+ const theme = exports.THEMES[themeName];
74
+ if (!theme) {
75
+ console.warn(`未找到主题: ${themeName},使用默认主题`);
76
+ this.currentTheme = exports.THEMES.default;
77
+ return;
78
+ }
79
+ this.currentTheme = theme;
80
+ console.log(`✓ 已切换到主题: ${chalk_1.default.bold(theme.name)} (${theme.description})`);
81
+ }
82
+ /**
83
+ * 获取当前主题
84
+ */
85
+ getCurrentTheme() {
86
+ return this.currentTheme;
87
+ }
88
+ /**
89
+ * 应用主题到文本
90
+ */
91
+ applyTheme(text) {
92
+ const theme = this.getCurrentTheme();
93
+ return chalk_1.default[theme.colors.primary](text);
94
+ }
95
+ /**
96
+ * 应用主题到边框
97
+ */
98
+ applyToBorder(text) {
99
+ const theme = this.getCurrentTheme();
100
+ return chalk_1.default[theme.colors.border](text);
101
+ }
102
+ /**
103
+ * 应用主题到标题
104
+ */
105
+ applyToTitle(text) {
106
+ const theme = this.getCurrentTheme();
107
+ return chalk_1.default[theme.colors.primary](text);
108
+ }
109
+ /**
110
+ * 应用主题到成功信息
111
+ */
112
+ applyToSuccess(text) {
113
+ return chalk_1.default.green(text);
114
+ }
115
+ /**
116
+ * 应用主题到警告信息
117
+ */
118
+ applyToWarning(text) {
119
+ return chalk_1.default.yellow(text);
120
+ }
121
+ /**
122
+ * 应用主题到错误信息
123
+ */
124
+ applyToError(text) {
125
+ return chalk_1.default.red(text);
126
+ }
127
+ /**
128
+ * 应用主题到次要文本
129
+ */
130
+ applyToSecondary(text) {
131
+ const theme = this.getCurrentTheme();
132
+ return chalk_1.default[theme.colors.secondary](text);
133
+ }
134
+ /**
135
+ * 列出所有可用主题
136
+ */
137
+ listThemes() {
138
+ console.log();
139
+ console.log(chalk_1.default.cyan.bold('╔════════════════════════════════════════════╗'));
140
+ console.log(chalk_1.default.cyan('║') + ' ' + chalk_1.default.bold.white('可用颜色主题') + ' ' + chalk_1.default.cyan('║'));
141
+ console.log(chalk_1.default.cyan('╠══════════════════════════════════════════════╣'));
142
+ console.log(chalk_1.default.cyan('║') + ' ' + ' ' + chalk_1.default.cyan('║'));
143
+ console.log(chalk_1.default.cyan('║') + chalk_1.default.bold.white('1. default') + ' ' + chalk_1.default.gray(' - ') + chalk_1.default.gray(exports.THEMES.default.description) + ' '.padEnd(31) + chalk_1.default.cyan('║'));
144
+ console.log(chalk_1.default.cyan('║') + ' ' + ' ' + chalk_1.default.cyan('║'));
145
+ console.log(chalk_1.default.cyan('║') + ' ' + ' ' + chalk_1.default.cyan('║'));
146
+ console.log(chalk_1.default.cyan('║') + chalk_1.default.bold.white('2. dark') + ' ' + chalk_1.default.gray(' - ') + chalk_1.default.gray(exports.THEMES.dark.description) + ' '.padEnd(31) + chalk_1.default.cyan('║'));
147
+ console.log(chalk_1.default.cyan('║') + ' ' + ' ' + chalk_1.default.cyan('║'));
148
+ console.log(chalk_1.default.cyan('║') + chalk_1.default.bold.white('3. colorful') + ' ' + chalk_1.default.gray(' - ') + chalk_1.default.gray(exports.THEMES.colorful.description) + ' '.padEnd(31) + chalk_1.default.cyan('║'));
149
+ console.log(chalk_1.default.cyan('║') + ' ' + ' ' + chalk_1.default.cyan('║'));
150
+ console.log(chalk_1.default.cyan('║') + chalk_1.default.bold.white('4. minimal') + ' ' + chalk_1.default.gray(' - ') + chalk_1.default.gray(exports.THEMES.minimal.description) + ' '.padEnd(31) + chalk_1.default.cyan('║'));
151
+ console.log(chalk_1.default.cyan('║') + ' ' + ' ' + chalk_1.default.cyan('║'));
152
+ console.log(chalk_1.default.cyan('╚══════════════════════════════════════════════╝'));
153
+ console.log();
154
+ console.log(chalk_1.default.gray('使用 pua chat --theme <主题名> 来切换主题'));
155
+ }
156
+ }
157
+ exports.ThemeManager = ThemeManager;
158
+ // 主题管理器单例
159
+ exports.themeManager = new ThemeManager();
160
+ /**
161
+ * 切换主题
162
+ */
163
+ function setTheme(themeName) {
164
+ exports.themeManager.setTheme(themeName);
165
+ }
166
+ /**
167
+ * 应用主题
168
+ */
169
+ function applyTheme(text) {
170
+ return exports.themeManager.applyTheme(text);
171
+ }
172
+ /**
173
+ * 列出所有主题
174
+ */
175
+ function listThemes() {
176
+ exports.themeManager.listThemes();
177
+ }
package/package.json CHANGED
@@ -1,52 +1,73 @@
1
- {
2
- "name": "workplace-pua-cli",
3
- "version": "0.4.1",
4
- "description": "A fun AI CLI tool for workplace role-play with boss/employee personas",
5
- "main": "dist/index.js",
6
- "bin": {
7
- "pua": "./bin/pua"
8
- },
9
- "scripts": {
10
- "build": "tsc",
11
- "dev": "ts-node src/index.ts",
12
- "start": "node dist/index.js",
13
- "watch": "tsc --watch",
14
- "test": "vitest run",
15
- "test:coverage": "vitest run --coverage",
16
- "test:ui": "vitest --ui",
17
- "lint": "eslint src --ext .ts",
18
- "lint:fix": "eslint src --ext .ts --fix",
19
- "format": "prettier --write \"src/**/*.ts\"",
20
- "format:check": "prettier --check \"src/**/*.ts\"",
21
- "type-check": "tsc --noEmit"
22
- },
23
- "keywords": [
24
- "cli",
25
- "ai",
26
- "glm",
27
- "zhipu",
28
- "pua"
29
- ],
30
- "author": "",
31
- "license": "MIT",
32
- "engines": {
33
- "node": ">=20.0.0"
34
- },
35
- "dependencies": {
36
- "@inquirer/prompts": "^8.2.0",
37
- "chalk": "^5.3.0",
38
- "commander": "^12.1.0",
39
- "dotenv": "^16.4.5",
40
- "ora": "^8.1.0",
41
- "zhipuai-sdk-nodejs-v4": "^0.1.12"
42
- },
43
- "devDependencies": {
44
- "@types/node": "^20.17.6",
45
- "@vitest/ui": "^2.0.0",
46
- "eslint": "^9.15.0",
47
- "prettier": "^3.3.0",
48
- "ts-node": "^10.9.2",
49
- "typescript": "^5.7.2",
50
- "vitest": "^2.0.0"
51
- }
52
- }
1
+ {
2
+ "name": "workplace-pua-cli",
3
+ "version": "0.7.1",
4
+ "description": "A fun AI CLI tool for workplace role-play with 6 personas (boss, employee, pm, hr, techlead, intern)",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "pua": "./bin/pua"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "dev": "ts-node src/index.ts",
12
+ "start": "node dist/index.js",
13
+ "watch": "tsc --watch",
14
+ "test": "vitest run",
15
+ "test:coverage": "vitest run --coverage",
16
+ "test:ui": "vitest --ui",
17
+ "lint": "eslint src --ext .ts",
18
+ "lint:fix": "eslint src --ext .ts --fix",
19
+ "format": "prettier --write \"src/**/*.ts\"",
20
+ "format:check": "prettier --check \"src/**/*.ts\"",
21
+ "type-check": "tsc --noEmit"
22
+ },
23
+ "keywords": [
24
+ "cli",
25
+ "ai",
26
+ "glm",
27
+ "zhipu",
28
+ "pua",
29
+ "workplace",
30
+ "roleplay",
31
+ "interview",
32
+ "meeting",
33
+ "chatbot",
34
+ "simulation"
35
+ ],
36
+ "author": "ava-agent",
37
+ "license": "MIT",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/ava-agent/pua-cli.git"
41
+ },
42
+ "homepage": "https://pua-cli.vercel.app",
43
+ "bugs": {
44
+ "url": "https://github.com/ava-agent/pua-cli/issues"
45
+ },
46
+ "files": [
47
+ "bin",
48
+ "dist",
49
+ "README.md",
50
+ "LICENSE"
51
+ ],
52
+ "engines": {
53
+ "node": ">=18.0.0"
54
+ },
55
+ "dependencies": {
56
+ "@inquirer/prompts": "^8.2.0",
57
+ "chalk": "^5.3.0",
58
+ "commander": "^12.1.0",
59
+ "dotenv": "^16.4.5",
60
+ "ora": "^8.1.0",
61
+ "pdf-parse": "^2.4.5",
62
+ "zhipuai-sdk-nodejs-v4": "^0.1.12"
63
+ },
64
+ "devDependencies": {
65
+ "@types/node": "^20.17.6",
66
+ "@vitest/ui": "^2.0.0",
67
+ "eslint": "^9.15.0",
68
+ "prettier": "^3.3.0",
69
+ "ts-node": "^10.9.2",
70
+ "typescript": "^5.7.2",
71
+ "vitest": "^2.0.0"
72
+ }
73
+ }
package/.env.example DELETED
@@ -1,4 +0,0 @@
1
- # 智谱 AI API Key
2
- # 获取方式:访问 https://bigmodel.cn/ 注册并获取 API Key
3
- # 新用户可获得 2000 万免费 tokens
4
- ZHIPUAI_API_KEY=your-api-key-here
package/.eslintrc.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "extends": [
3
- "eslint:recommended",
4
- "plugin:@typescript-eslint/recommended"
5
- ],
6
- "parser": "@typescript-eslint/parser",
7
- "parserOptions": {
8
- "ecmaVersion": 2022,
9
- "sourceType": "module",
10
- "project": "./tsconfig.json"
11
- },
12
- "plugins": ["@typescript-eslint"],
13
- "rules": {
14
- "no-console": "off",
15
- "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
16
- "@typescript-eslint/explicit-function-return-type": "off",
17
- "@typescript-eslint/no-explicit-any": "warn",
18
- "no-undef": "off"
19
- },
20
- "ignorePatterns": ["dist/", "node_modules/"]
21
- }
package/.prettierrc.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "semi": true,
3
- "trailingComma": "all",
4
- "singleQuote": true,
5
- "printWidth": 100,
6
- "tabWidth": 2,
7
- "arrowParens": "always",
8
- "endOfLine": "lf"
9
- }
package/CHANGELOG.md DELETED
@@ -1,113 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to PUA CLI will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
-
7
- ## [0.4.1] - 2025-02-12
8
-
9
- ### Changed
10
- - **Package name**: renamed from `pua-cli` to `workplace-pua-cli` to avoid naming conflict
11
- - **Installation**: Updated README with npm installation instructions
12
-
13
- ## [0.4.0] - 2025-02-12 - MVP Edition
14
-
15
- ### Added
16
- - **完整测试框架** - Vitest 配置和基础测试文件
17
- - **代码质量工具** - ESLint 和 Prettier 配置
18
- - **输出格式增强** - 支持 text/markdown/json 三种格式
19
- - **会话持久化** - SessionStorage 文件会话保存/加载
20
- - **会话管理命令** - /save、/sessions、/load 等命令
21
- - **优化方案文档** - 7 大优化方案的完整技术文档
22
- - **技术文档更新** - 添加优化方案参考链接
23
-
24
- ### Changed
25
- - **Dependencies**: 更新项目依赖
26
- - 添加 vitest@^2.0.0
27
- - 添加 eslint@^9.15.0
28
- - 添加 prettier@^3.3.0
29
- - 移除 @vitest/ui 类型引用
30
- - TypeScript strict 模式改为 false(提升兼容性)
31
-
32
- - **DevDependencies**: 更新开发依赖
33
- - typescript@^5.7.2
34
-
35
- - **New Files**:
36
- - `src/__tests__/` - 测试文件目录
37
- - `src/utils/formatter.ts` - 输出格式化器
38
- - `src/config/session-storage.ts` - 会话持久化
39
- - `.eslintrc.json` - ESLint 配置
40
- - `.prettierrc.json` - Prettier 配置
41
- - `vitest.config.ts` - Vitest 配置
42
- - `docs/OPTIMIZATION.md` - 优化方案文档
43
- - `CHANGELOG.md` - 本文件
44
-
45
- - **Updated Files**:
46
- - `package.json` - 新增脚本和版本更新
47
- - `README.md` - 添加优化方案链接
48
- - `src/index.ts` - 更新导入路径
49
- - `src/commands/chat.ts` - 添加会话命令
50
- - `src/commands/prompt.ts` - 添加 format 选项
51
- - `tsconfig.json` - 关闭 strict 和 declaration
52
-
53
- ### Fixed
54
- - 修复输出格式化器中的 `format` 方法名冲突
55
- - 修复会话存储中的 Omit 类型使用
56
- - 移除重复的命令处理代码
57
-
58
- ### Technical Details
59
- - **测试框架**: Vitest 2.0.0 with V8 coverage provider
60
- - **代码质量**: ESLint 9.15.0 + Prettier 3.3.0
61
- - **TypeScript**: 5.7.2 with strict: false for better compatibility
62
- - **输出格式**: 三种格式支持(text/markdown/json)
63
- - **会话管理**: 文件系统持久化,支持保存/加载/列出
64
-
65
- ### Contributors
66
- - @ava-agent (Claude Opus 4.6)
67
-
68
- ### Downloads
69
- - N/A (CLI 工具,本地安装)
70
-
71
- ---
72
-
73
- ## [0.3.0] - 2025-02-11 - Testing & Quality Edition
74
-
75
- ### Added
76
- - 基础测试框架 (Vitest)
77
- - 代码质量工具 (ESLint + Prettier)
78
- - 会话管理命令 (/save, /sessions, /load)
79
- - 输出格式支持 (--format)
80
-
81
- ### Changed
82
- - **Dependencies**:
83
- - 添加 vitest、eslint、prettier
84
- - **DevDependencies**: 更新测试类型
85
- - **New Files**:
86
- - 测试文件
87
- - 配置文件
88
- - 工具函数
89
-
90
- ### Fixed
91
- - 导入路径修复
92
- - 类型定义完善
93
-
94
- ### Contributors
95
- - @ava-agent
96
-
97
- ---
98
-
99
- ## [0.2.0] - 2025-02-09 - Initial Release
100
-
101
- ### Added
102
- - 首次公开版本
103
- - CLI 框架 (Commander.js)
104
- - 多 Provider 支持 (智谱 AI、OpenAI)
105
- - 交互式聊天模式
106
- - 单次提示模式
107
- - 流式输出 (SSE)
108
- - 会话历史管理
109
- - 配置管理系统
110
- - 老板/员工角色提示词
111
-
112
- ### Contributors
113
- - @ava-agent