@code4bug/jarvis-agent 1.3.7 → 1.3.8

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.
@@ -26,3 +26,5 @@ export declare const DEFAULT_AGENT_EMOJI = ">";
26
26
  /** 当前激活的智能体名称 — 启动时从 ~/.jarvis/agent.json 读取,运行时可切换 */
27
27
  export declare function getDefaultAgent(): string;
28
28
  export declare function getAppName(): string;
29
+ /** 启动欢迎词,跟随当前激活智能体与本机用户名 */
30
+ export declare function getStartupWelcomeMessage(): string;
@@ -80,3 +80,16 @@ export function getAppName() {
80
80
  return 'Jarvis';
81
81
  }
82
82
  }
83
+ /** 启动欢迎词,跟随当前激活智能体与本机用户名 */
84
+ export function getStartupWelcomeMessage() {
85
+ const agentName = getAppName();
86
+ const userName = os.userInfo().username || '朋友';
87
+ const templates = [
88
+ `${agentName}:欢迎你,${userName}。我已经准备好了,输入 /help 查看命令,输入 ? 查看快捷键。`,
89
+ `${agentName}:你好,${userName}。今天想先处理什么?输入 /help 看命令,输入 ? 看快捷键。`,
90
+ `${agentName}:${userName},欢迎回来。需要我继续当前工作,还是开启一个新任务?`,
91
+ `${agentName}:已就绪,${userName}。你可以直接描述需求,也可以先用 /help 或 ? 看可用操作。`,
92
+ `${agentName}:见到你了,${userName}。命令在 /help,快捷键在 ?,我们可以直接开始。`,
93
+ ];
94
+ return templates[Math.floor(Math.random() * templates.length)];
95
+ }
@@ -13,7 +13,7 @@ import { useStreamThrottle } from '../hooks/useStreamThrottle.js';
13
13
  import { useSlashMenu } from '../hooks/useSlashMenu.js';
14
14
  import { executeSlashCommand } from './slashCommands.js';
15
15
  import { QueryEngine } from '../core/QueryEngine.js';
16
- import { HIDE_WELCOME_AFTER_INPUT } from '../config/constants.js';
16
+ import { HIDE_WELCOME_AFTER_INPUT, getStartupWelcomeMessage } from '../config/constants.js';
17
17
  import { generateAgentHint } from '../core/hint.js';
18
18
  import { subscribeAgentCount, getActiveAgentCount } from '../core/spawnRegistry.js';
19
19
  import { logError, logInfo, logWarn } from '../core/logger.js';
@@ -133,6 +133,13 @@ export default function REPL() {
133
133
  logError('ui.hint.init_failed', err);
134
134
  console.error('[hint] 初始化提示失败:', err);
135
135
  });
136
+ setMessages((prev) => (prev.length > 0 ? prev : [{
137
+ id: `startup-welcome-${Date.now()}`,
138
+ type: 'system',
139
+ status: 'success',
140
+ content: getStartupWelcomeMessage(),
141
+ timestamp: Date.now(),
142
+ }]));
136
143
  logInfo('ui.repl.mounted');
137
144
  return () => {
138
145
  logInfo('ui.repl.unmounted');
@@ -26,8 +26,9 @@ function buildProfilePrompt(userInput, existingProfile) {
26
26
  '请严格按下面结构输出:',
27
27
  '# 用户画像',
28
28
  '## 基本信息',
29
- '- 职业:',
29
+ '- 姓名:',
30
30
  '- 年龄阶段:',
31
+ '- 职业:',
31
32
  '- 所在地区:',
32
33
  '- 语言偏好:',
33
34
  '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code4bug/jarvis-agent",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "基于 React + TypeScript + Ink 构建的命令行智能体交互界面",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",