@cnbcool/cnb-api-generate 2.7.5 → 2.7.6

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.
@@ -84,12 +84,9 @@ function flattenToolOptions(toolInfo) {
84
84
  ? (0, clean_array_desc_1.cleanArrayDesc)((0, trim_summary_1.trimSummary)(prop.description || ''))
85
85
  : (0, trim_summary_1.trimSummary)(prop.description || '');
86
86
  const arrayHint = isArray ? ' (可多次传入)' : '';
87
- const fileRefHint = !isArray && prop.type === 'string' && key === 'body'
88
- ? ' (支持 @file 引用)'
89
- : '';
90
87
  const desc = isRequired
91
- ? `[必填] ${rawDesc}${arrayHint}${fileRefHint}`
92
- : `${rawDesc}${arrayHint}${fileRefHint}`;
88
+ ? `[必填] ${rawDesc}${arrayHint}`
89
+ : `${rawDesc}${arrayHint}`;
93
90
  const opt = {
94
91
  optKey,
95
92
  valuePlaceholder,
@@ -1,5 +1,5 @@
1
1
  import { helpData } from './help-data';
2
- import { tryParseJSON, tryReadFileRef } from './parsers';
2
+ import { tryParseJSON } from './parsers';
3
3
  import { buildNestedFieldMap } from '../utils/build-nested-field-map';
4
4
  import type { NestedFieldMapping } from '../utils/build-nested-field-map';
5
5
  import { restoreOriginalKeys } from '../utils/restore-original-keys';
@@ -182,8 +182,7 @@ export function formatParams(
182
182
  } else if (bodyProps[key].type === 'string') {
183
183
  // schema 定义为 string 类型时,保持原始字符串,不做 JSON 解析
184
184
  // 避免纯数字字符串(如 "123")被转为 number
185
- // 支持 @file 语法:从文件读取长文本内容(避免 shell 长参数截断)
186
- formatted.data[key] = tryReadFileRef(value as string);
185
+ formatted.data[key] = value;
187
186
  } else {
188
187
  formatted.data[key] = tryParseJSON(value as string);
189
188
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnbcool/cnb-api-generate",
3
- "version": "2.7.5",
3
+ "version": "2.7.6",
4
4
  "main": "./built/index.js",
5
5
  "module": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -16,7 +16,6 @@ description: CNB 平台交互命令,支持仓库、Issue、PR、流水线、
16
16
  - **参数自动识别**:快捷命令中的 Issue/PR 编号会自动从环境变量识别,无需额外传递。
17
17
  - **默认仅需摘要**:默认会精简响应输出结果,只返回核心字段。添加 `--verbose` 输出完整数据。
18
18
  - **单引号传参**:传递多行文本参数时,使用单引号可防止命令注入攻击,并减少不必要的转义。
19
- - **长文本传参**:当 `--body` 内容超过 3 行或包含复杂格式时,**必须**先将内容写入临时文件,再用 `--body @/tmp/comment.md` 文件引用方式传递,避免 shell 参数截断或转义问题。
20
19
  - **快捷命令适用范围**: 快捷命令只能操作当前仓库的当前 Issue/PR,跨仓库或跨编号操作请参考 `更多 API`。
21
20
  - **npc提及和召唤的区别**: 评论中直接 @npc 会召唤 npc 干活,如果只提及不召唤,应该去掉 `@` 符号,或使用反引号包裹 `@npc`。
22
21