aigroup-workflow 1.1.2 → 1.1.3

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.
@@ -88,19 +88,22 @@ export async function multiSelect(message, choices) {
88
88
  return ` ${C.dim}↑↓ 移动${C.reset} ${C.dim}空格 选择${C.reset} ${C.dim}a 全选/取消${C.reset} ${C.dim}回车 确认${C.reset}`
89
89
  }
90
90
 
91
+ // 总行数 = 选项行 + 提示行
92
+ const totalLines = choices.length + 1
93
+
91
94
  function render(isFirst) {
92
95
  if (!isFirst) {
93
- // 回到列表顶部重绘
94
- process.stdout.write(`\x1b[${choices.length + 1}A\x1b[0J`)
96
+ // 光标在提示行末尾,先回到行首,再回退所有行,清除下方
97
+ process.stdout.write(`\r\x1b[${totalLines}A\x1b[0J`)
95
98
  }
96
99
  for (const [i, c] of choices.entries()) {
97
- console.log(renderLine(c, i))
100
+ process.stdout.write(renderLine(c, i) + '\n')
98
101
  }
99
102
  process.stdout.write(renderHint())
100
103
  }
101
104
 
102
- // 首次绘制
103
- console.log(`\n ${C.cyan}?${C.reset} ${C.bold}${message}${C.reset} ${C.dim}(空格选择, 回车确认)${C.reset}`)
105
+ // 标题行
106
+ process.stdout.write(`\n ${C.cyan}?${C.reset} ${C.bold}${message}${C.reset} ${C.dim}(空格选择, 回车确认)${C.reset}\n`)
104
107
  process.stdout.write(C.hideCursor)
105
108
  render(true)
106
109
 
@@ -185,18 +188,20 @@ export async function select(message, choices) {
185
188
  return ` ${C.dim}↑↓ 移动${C.reset} ${C.dim}回车 选择${C.reset}`
186
189
  }
187
190
 
191
+ const totalLines = choices.length + 1
192
+
188
193
  function render(isFirst) {
189
194
  if (!isFirst) {
190
- process.stdout.write(`\x1b[${choices.length + 1}A\x1b[0J`)
195
+ process.stdout.write(`\r\x1b[${totalLines}A\x1b[0J`)
191
196
  }
192
197
  for (const [i, c] of choices.entries()) {
193
- console.log(renderLine(c, i))
198
+ process.stdout.write(renderLine(c, i) + '\n')
194
199
  }
195
200
  process.stdout.write(renderHint())
196
201
  }
197
202
 
198
- // 首次绘制
199
- console.log(`\n ${C.cyan}?${C.reset} ${C.bold}${message}${C.reset}`)
203
+ // 标题行
204
+ process.stdout.write(`\n ${C.cyan}?${C.reset} ${C.bold}${message}${C.reset}\n`)
200
205
  process.stdout.write(C.hideCursor)
201
206
  render(true)
202
207
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aigroup-workflow",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "AI 团队协作框架 — 通过角色派遣、工作流管道和 Harness 传感器驱动 AI 协作开发",
5
5
  "type": "module",
6
6
  "bin": {