yg-team-cli 2.4.7 → 2.4.9

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/README.md CHANGED
@@ -34,6 +34,22 @@
34
34
 
35
35
  ### 2026-02-03 - Bug 修复
36
36
 
37
+ **v2.4.9** - 修复 Claude 调用卡住问题
38
+ - **修复**: `claude.ts` 中使用 `input` 选项通过 stdin 传递 prompt
39
+ - **问题**: v2.4.8 将整个 prompt 作为命令行参数传递,导致大型 prompt 处理异常
40
+
41
+ **v2.4.8** - 修复 add-feature 命令 Listr 进度显示和 AI_MEMORY 更新问题
42
+ - **修复**: `claude.ts` 中 `prompt` 和 `chat` 方法使用 `-p` 参数以 print 模式运行
43
+ - **修复**: stdio 从 `inherit` 改为 `pipe`,正确捕获 Claude 输出
44
+ - **修复**: 添加 5 分钟超时和 10MB buffer 限制
45
+ - **影响**: 解决了 Listr 任务进度卡在"调用 Claude 生成 spec"的问题
46
+
47
+ **v2.4.7** - 修复 AI_MEMORY 功能清单更新
48
+ - **修复**: `add-feature.ts` 中 `updateAiMemory` 函数逻辑重写
49
+ - **修复**: 使用精确的段落定位在"功能清单"表格中插入新行
50
+ - **修复**: 添加功能名称格式化(`sso_pre_test` → `Sso Pre Test`)
51
+ - **修复**: Shell 脚本 `team-cli` 使用 awk 替代 sed 解决 macOS 兼容性问题
52
+
37
53
  **v2.4.4** - 修复 breakdown 命令日志变量未正确插值
38
54
  - **提交**: `c873ea5`
39
55
  - **修复**: `breakdown.ts` 中 `ctx.selectedFile` 变量未正确插值
package/dist/cli.js CHANGED
@@ -194,7 +194,7 @@ var init_logger = __esm({
194
194
  import fs from "fs-extra";
195
195
  import path2 from "path";
196
196
  import { glob } from "glob";
197
- var FileUtils, StringUtils2, DateUtils, GitUtils, SpecUtils;
197
+ var FileUtils, StringUtils, DateUtils, GitUtils, SpecUtils;
198
198
  var init_utils = __esm({
199
199
  "src/lib/utils.ts"() {
200
200
  "use strict";
@@ -271,7 +271,7 @@ var init_utils = __esm({
271
271
  return path2.dirname(new URL(url).pathname);
272
272
  }
273
273
  };
274
- StringUtils2 = class {
274
+ StringUtils = class {
275
275
  /**
276
276
  * 转换为 kebab-case
277
277
  */
@@ -447,6 +447,7 @@ var init_claude = __esm({
447
447
  init_logger();
448
448
  init_utils();
449
449
  ClaudeAI = class {
450
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
450
451
  verbose;
451
452
  constructor(verbose = false) {
452
453
  this.verbose = verbose;
@@ -514,8 +515,13 @@ ${promptText}`;
514
515
  }
515
516
  }
516
517
  await fs2.writeFile(tempFile, finalPrompt, "utf-8");
517
- const result = await execa("claude", ["--dangerously-skip-permissions", tempFile], {
518
- stdio: "inherit"
518
+ const result = await execa("claude", ["-p"], {
519
+ input: finalPrompt,
520
+ // 通过 stdin 传递 prompt
521
+ timeout: options?.timeout || 3e5,
522
+ // 5 分钟超时
523
+ maxBuffer: 1024 * 1024 * 10
524
+ // 10MB buffer
519
525
  });
520
526
  return result.stdout || "";
521
527
  } finally {
@@ -540,24 +546,17 @@ ${promptText}`;
540
546
  * 发送对话(支持上下文)
541
547
  */
542
548
  async chat(messages, options) {
543
- const tempDir = os.tmpdir();
544
- const tempFile = path3.join(tempDir, `team-cli-prompt-${Date.now()}.txt`);
545
- try {
546
- const fullPrompt = messages.map((msg) => {
547
- const role = msg.role === "system" ? "\u7CFB\u7EDF\u6307\u4EE4" : `${msg.role === "user" ? "\u7528\u6237" : "\u52A9\u624B"}`;
548
- return `[${role}]: ${msg.content}`;
549
- }).join("\n\n");
550
- await fs2.writeFile(tempFile, fullPrompt, "utf-8");
551
- const result = await execa("claude", ["--dangerously-skip-permissions", tempFile], {
552
- stdio: "inherit"
553
- });
554
- return result.stdout || "";
555
- } finally {
556
- try {
557
- await fs2.remove(tempFile);
558
- } catch {
559
- }
560
- }
549
+ const fullPrompt = messages.map((msg) => {
550
+ const role = msg.role === "system" ? "\u7CFB\u7EDF\u6307\u4EE4" : `${msg.role === "user" ? "\u7528\u6237" : "\u52A9\u624B"}`;
551
+ return `[${role}]: ${msg.content}`;
552
+ }).join("\n\n");
553
+ const result = await execa("claude", ["-p"], {
554
+ input: fullPrompt,
555
+ // 通过 stdin 传递 prompt
556
+ timeout: options?.timeout || 3e5,
557
+ maxBuffer: 1024 * 1024 * 10
558
+ });
559
+ return result.stdout || "";
561
560
  }
562
561
  /**
563
562
  * 分析代码
@@ -2329,7 +2328,7 @@ var init_init = __esm({
2329
2328
  ]);
2330
2329
  projectName = answers.projectName;
2331
2330
  }
2332
- if (!StringUtils2.validateProjectName(projectName)) {
2331
+ if (!StringUtils.validateProjectName(projectName)) {
2333
2332
  logger.error("\u9879\u76EE\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u8FDE\u5B57\u7B26");
2334
2333
  process.exit(1);
2335
2334
  }
@@ -3671,7 +3670,7 @@ var init_add_feature = __esm({
3671
3670
  logger.info("\u8BF7\u5B89\u88C5 Claude CLI: npm install -g @anthropic-ai/claude-code");
3672
3671
  process.exit(1);
3673
3672
  }
3674
- const featureSlug = StringUtils2.toKebabCase(featureName);
3673
+ const featureSlug = StringUtils.toKebabCase(featureName);
3675
3674
  const specFile = path10.join("docs/specs", `${featureSlug}.md`);
3676
3675
  const specExists = await FileUtils.exists(specFile);
3677
3676
  if (specExists) {