@baimingtao/lbs-agent 1.1.0 → 1.2.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/lbs.js CHANGED
@@ -72,21 +72,20 @@ function paint(text, ...colors) {
72
72
 
73
73
  // ── ASCII Logo ─────────────────────────────────────────────────
74
74
 
75
- const LOGO = String.raw`
76
- ${paint('██╗', C.gold)} ${paint('██╗', C.gold)}${paint('███████╗', C.cyan)}${paint('██████╗', C.cyan)} ${paint('██╗', C.gold)} ${paint('██╗', C.gold)}${paint('███████╗', C.cyan)}${paint('███████╗', C.cyan)}
77
- ${paint('██║', C.gold)} ${paint('██║', C.gold)}${paint('██╔════╝', C.cyan)}${paint('██╔══██╗', C.cyan)}${paint('████╗', C.gold)} ${paint('████║', C.gold)}${paint('██╔════╝', C.cyan)}${paint('██╔════╝', C.cyan)}
78
- ${paint('███████║', C.cyan)}${paint('█████╗', C.cyan)} ${paint('██████╔╝', C.cyan)}${paint('██╔████╔██║', C.gold)}${paint('█████╗', C.cyan)} ${paint('███████╗', C.gold)}${paint('█████╗', C.cyan)}
79
- ${paint('██╔══██║', C.cyan)}${paint('██╔══╝', C.cyan)} ${paint('██╔══██╗', C.cyan)}${paint('██║╚██╔╝██║', C.gold)}${paint('██╔══╝', C.cyan)} ${paint('╚════██║', C.gold)}${paint('╚════╝', C.cyan)}
80
- ${paint('██║', C.gold)} ${paint('██║', C.gold)}${paint('███████╗', C.cyan)}${paint('██║', C.gold)} ${paint('██║', C.gold)}${paint('██║', C.gold)} ${paint('╚═╝', C.gold)} ${paint('██║', C.gold)}${paint('███████╗', C.gold)}${paint('███████║', C.cyan)} ${paint('██║', C.gold)} ${paint('██║', C.gold)}${paint('╚██████╔╝', C.gold)}
81
- ${paint('╚═╝', C.gold)} ${paint('╚═╝', C.gold)}${paint('╚══════╝', C.dim)}${paint('╚═╝', C.gold)} ${paint('╚═╝', C.gold)}${paint('╚═╝', C.gold)} ${paint('╚═╝', C.gold)}${paint('╚══════╝', C.dim)}${paint('╚══════╝', C.dim)} ${paint('╚═╝', C.gold)} ${paint('╚═╝', C.gold)} ${paint('╚═════╝', C.dim)}
82
- `;
75
+ const LOGO = [
76
+ '',
77
+ ' ' + paint('╔══╗', C.gold) + ' ' + paint('╔═══╗', C.cyan) + ' ' + paint('╔═════╗', C.cyan),
78
+ ' ' + paint('║ ║', C.gold) + ' ' + paint('║ ║', C.cyan) + ' ' + paint('║ ╔═╝', C.cyan),
79
+ ' ' + paint('╠══╣', C.gold) + ' ' + paint('╠═══╣', C.cyan) + ' ' + paint('║ ╚═╗', C.cyan),
80
+ ' ' + paint(' ', C.gold) + ' ' + paint('║ ║', C.cyan) + ' ' + paint('╚═════╝', C.cyan),
81
+ ' ' + paint('╚══╝', C.gold) + ' ' + paint('╚═══╝', C.cyan) + ' ' + paint('AGENT', C.dim),
82
+ '',
83
+ ].join('\n');
83
84
 
84
85
  function printBanner() {
85
86
  const pkg = JSON.parse(fs.readFileSync(path.join(PKG_ROOT, 'package.json'), 'utf-8'));
86
- console.log();
87
87
  console.log(LOGO);
88
- console.log(paint(` LBS Agent v${pkg.version}`, C.bold, C.gold));
89
- console.log(paint(` Leaving Blank Space Agent — 多 Agent 编排框架`, C.dim));
88
+ console.log(paint(' v' + pkg.version, C.bold, C.gold) + paint(' Leaving Blank Space Agent', C.dim));
90
89
  console.log();
91
90
  }
92
91
 
@@ -25,12 +25,15 @@ from config.config import AppConfig
25
25
  from interfaces.cli._impl.commands.common import project_root
26
26
 
27
27
 
28
- BANNER = """\033[1;36m
29
- ╔══════════════════════════════════════════════════════════════╗
30
- LBS Agent — Interactive Chat Mode
31
- 内建命令: /help /exit /new /clear /status /model /agent
32
- 输入 / 开头是命令;其他内容发送给当前 agent
33
- ╚══════════════════════════════════════════════════════════════╝\033[0m"""
28
+ BANNER = """\033[1;38;2;255;191;0m
29
+ \033[1;36m╔══╗\033[0m \033[1;36m╔═══╗\033[0m \033[1;36m╔═════╗\033[0m
30
+ \033[1;36m║\033[0m \033[1;36m ║\033[0m \033[1;36m║ ╔═╝\033[0m
31
+ \033[1;36m╠══╣\033[0m \033[1;36m╠═══╣\033[0m \033[1;36m ╚═╗\033[0m
32
+ \033[1;36m║\033[0m \033[1;36m ║\033[0m \033[1;36m╚═════╝\033[0m
33
+ \033[1;36m╚══╝\033[0m \033[1;36m╚═══╝\033[0m \033[2mAGENT\033[0m
34
+ \033[0m
35
+ \033[2mInteractive Chat · /help for commands · /exit to quit\033[0m
36
+ """
34
37
 
35
38
 
36
39
  @dataclass
@@ -62,7 +65,9 @@ def _resolve_agent(config: AppConfig) -> str:
62
65
 
63
66
  def _print_turn_header(state: ChatState) -> None:
64
67
  """每次 turn 的 header(agent + turn 编号)。"""
65
- print(f"\n\033[1;33m[{state.agent_name} • turn {state.turn_count}]\033[0m ", end="", flush=True)
68
+ agent_label = f"\033[1;36m{state.agent_name}\033[0m"
69
+ turn_label = f"\033[2mturn {state.turn_count}\033[0m"
70
+ print(f"\n{agent_label} {turn_label} \033[2m›\033[0m ", end="", flush=True)
66
71
 
67
72
 
68
73
  def _print_help() -> None:
@@ -126,15 +131,18 @@ def _cmd_history(state: ChatState, n: int = 5) -> None:
126
131
 
127
132
  def _cmd_status(state: ChatState) -> None:
128
133
  elapsed = int(time.time() - state.started_at)
129
- print(f"""
130
- \033[1;36mSession 状态:\033[0m
131
- session_id : {state.session_id or '(未保存)'}
132
- agent : {state.agent_name}
133
- provider : {state.provider_name or '(默认)'}
134
- model : {state.model_name or '(默认)'}
135
- turns : {state.turn_count}
136
- elapsed : {elapsed}s
137
- """)
134
+ rows = [
135
+ ("session", state.session_id or "\033[2m(unsaved)\033[0m"),
136
+ ("agent", state.agent_name),
137
+ ("provider", state.provider_name or "\033[2m(default)\033[0m"),
138
+ ("model", state.model_name or "\033[2m(default)\033[0m"),
139
+ ("turns", str(state.turn_count)),
140
+ ("elapsed", f"{elapsed}s"),
141
+ ]
142
+ print()
143
+ for label, val in rows:
144
+ print(f" \033[2m{label:9}\033[0m │ {val}")
145
+ print()
138
146
 
139
147
 
140
148
  def _handle_command(state: ChatState, line: str) -> bool:
@@ -207,20 +215,21 @@ def _run_turn(state: ChatState, user_input: str) -> None:
207
215
  # 显示结果
208
216
  if result.success:
209
217
  content = (result.content or "").strip()
210
- print(f"\n\033[1;32m{content}\033[0m")
218
+ print(f"\n\033[1;37m{content}\033[0m")
211
219
  else:
212
220
  err = result.error or "(无错误信息)"
213
- print(f"\n\033[1;31m✗ 失败: {err[:300]}\033[0m")
214
- print(f"\033[2m 耗时: {elapsed:.1f}s | 迭代: {result.iterations} | 工具: {result.total_tool_calls}\033[0m")
221
+ print(f"\n\033[1;31m✗ {err[:300]}\033[0m")
222
+ # 状态行
223
+ print(f"\033[2m {elapsed:.1f}s │ iter {result.iterations} │ tools {result.total_tool_calls}\033[0m")
215
224
  # 保存 session_id(Orchestrator 内部会创建/复用)
216
225
  if not state.session_id:
217
226
  state.session_id = result.session_id if hasattr(result, "session_id") and result.session_id else f"chat-{int(state.started_at)}"
218
227
  except KeyboardInterrupt:
219
- print("\n\033[1;33m(已中断)\033[0m")
228
+ print("\n\033[1;33m ⏸ 已中断\033[0m")
220
229
  except Exception as e:
221
230
  elapsed = time.time() - t0
222
- print(f"\n\033[1;31m✗ 异常: {type(e).__name__}: {str(e)[:200]}\033[0m")
223
- print(f"\033[2m 耗时: {elapsed:.1f}s\033[0m")
231
+ print(f"\n\033[1;31m ✗ {type(e).__name__}: {str(e)[:200]}\033[0m")
232
+ print(f"\033[2m {elapsed:.1f}s\033[0m")
224
233
 
225
234
 
226
235
  def cmd_chat(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baimingtao/lbs-agent",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },