ai-project-manage-cli 3.0.21 → 3.0.23
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/dist/index.js
CHANGED
|
@@ -146,7 +146,7 @@ var requestConfig = {
|
|
|
146
146
|
|
|
147
147
|
// src/api/client.ts
|
|
148
148
|
function createApmApiClient(cfg) {
|
|
149
|
-
const baseURL = `${cfg.baseUrl.trim().replace(/\/+$/, "")}/api`;
|
|
149
|
+
const baseURL = `${cfg.baseUrl.trim().replace(/\/+$/, "")}/api/v1`;
|
|
150
150
|
return createApiClient(requestConfig, {
|
|
151
151
|
baseURL,
|
|
152
152
|
getToken: () => cfg.token || void 0,
|
|
@@ -241,6 +241,12 @@ import { appendFileSync } from "fs";
|
|
|
241
241
|
import { resolve as resolve2 } from "path";
|
|
242
242
|
var EventSession = class {
|
|
243
243
|
events = [];
|
|
244
|
+
constructor(prompt) {
|
|
245
|
+
this.events.push({
|
|
246
|
+
type: "input",
|
|
247
|
+
content: prompt
|
|
248
|
+
});
|
|
249
|
+
}
|
|
244
250
|
addEvent(event) {
|
|
245
251
|
const latestEvent = this.events[this.events.length - 1];
|
|
246
252
|
const formatedEvent = this.formatEvent(event);
|
|
@@ -330,17 +336,26 @@ var EventSession = class {
|
|
|
330
336
|
this.events.forEach((event) => {
|
|
331
337
|
const type = event.type;
|
|
332
338
|
const content = (function(type2) {
|
|
333
|
-
if (type2 === "
|
|
334
|
-
return `##
|
|
339
|
+
if (type2 === "input") {
|
|
340
|
+
return `## \u7528\u6237\u8F93\u5165
|
|
341
|
+
|
|
342
|
+
${event.content}
|
|
343
|
+
`;
|
|
344
|
+
}
|
|
345
|
+
if (type2 === "assistant") {
|
|
346
|
+
return `## \u6A21\u578B\u8F93\u51FA
|
|
347
|
+
|
|
348
|
+
${event.content}
|
|
349
|
+
`;
|
|
350
|
+
}
|
|
351
|
+
if (type2 === "thinking") {
|
|
352
|
+
return `## \u6A21\u578B\u601D\u8003
|
|
335
353
|
|
|
336
354
|
${event.content}
|
|
337
355
|
`;
|
|
338
356
|
}
|
|
339
357
|
if (type2 === "tool_call") {
|
|
340
|
-
return
|
|
341
|
-
### \u53C2\u6570
|
|
342
|
-
\`\`\`json
|
|
343
|
-
` + JSON.stringify(event.args, null, 2) + "\n```\n### \u7ED3\u679C\n```json\n" + JSON.stringify(event.result, null, 2) + "\n```\n";
|
|
358
|
+
return "````toolcall\n" + JSON.stringify(event, null, 2) + "\n````\n";
|
|
344
359
|
}
|
|
345
360
|
return `## \u672A\u77E5\u4E8B\u4EF6\uFF1A${type2}
|
|
346
361
|
|
|
@@ -647,7 +662,7 @@ function runConnect(opts) {
|
|
|
647
662
|
agentId: agent.agentId
|
|
648
663
|
});
|
|
649
664
|
let IN_PROGRESS = false;
|
|
650
|
-
const session = new EventSession();
|
|
665
|
+
const session = new EventSession(payload.prompt);
|
|
651
666
|
const run = await agent.send(payload.prompt);
|
|
652
667
|
for await (const event of run.stream()) {
|
|
653
668
|
if (!IN_PROGRESS) {
|
package/package.json
CHANGED
|
@@ -22,7 +22,8 @@ description: 根据需求 ID 读取工作项 prd.md 与 reviews.xml,按「修
|
|
|
22
22
|
### 步骤 1:读取 `prd.md` 与 `reviews.xml`
|
|
23
23
|
|
|
24
24
|
1. 使用 **Read** 读取 **`.apm/workitems/<需求ID>/prd.md`**。
|
|
25
|
-
2.
|
|
25
|
+
2. 当PRD涉及到图片链接时,自动下载对应的图片,存放在 `.apm/workitems/<需求ID>/images/<对应图片名称>.png`,并理解图片内容
|
|
26
|
+
3. 使用 **Read** 读取 **`.apm/workitems/<需求ID>/reviews.xml`**。
|
|
26
27
|
|
|
27
28
|
**失败与缺省:**
|
|
28
29
|
|
|
@@ -18,18 +18,20 @@ description: 结合本仓库上下文对需求做结构化评审,只有当用
|
|
|
18
18
|
5. **澄清优先但不泛问**:不阻塞落地则不提问;不问可推断的琐碎问题。
|
|
19
19
|
6. **隐性知识沉淀可执行**:对用户单独输出的每条沉淀建议应能回答「在仓库里补什么、能消除哪类隐性歧义」;若本次未发现值得沉淀的差异点,仍须给出一句结论(例如「未发现与通用假设显著偏离、需单独成文的隐性规则」)。
|
|
20
20
|
|
|
21
|
-
|
|
22
21
|
## 执行步骤
|
|
23
22
|
|
|
24
23
|
### 步骤 1:读取 `prd.md`
|
|
25
24
|
|
|
26
25
|
1. 使用 **Read** 读取 `.apm/workitems/<需求ID>/prd.md`。
|
|
27
|
-
2.
|
|
26
|
+
2. 当 PRD 涉及到图片链接时,自动下载对应的图片,存放在 `.apm/workitems/<需求ID>/images/<对应图片名称>.png`,并理解图片内容
|
|
27
|
+
3. 若 Read **失败**(文件不存在或无法读取):本步骤记为失败,**终止**,不执行步骤 2、3。
|
|
28
28
|
|
|
29
29
|
### 步骤 2:读代码
|
|
30
|
+
|
|
30
31
|
阅读仓库源码以及 `.apm/product-capability-inventory` 中与需求相关的条目;不展开无关模块代码。
|
|
31
32
|
|
|
32
33
|
### 步骤 3:评审
|
|
34
|
+
|
|
33
35
|
1. **拆条**:多条诉求时拆成 `### 需求点 1..N`,每条独立走完「业务合理性(可选)→ 问题 或 可行性(+风险)」逻辑。
|
|
34
36
|
|
|
35
37
|
2. **成文(仅评审模板)**:按 `output-template.md` 拼出写入 comment 的 Markdown(顶格可加 `### 评审人` + 当前模型名);**不含**「隐性知识沉淀」段落;
|
|
@@ -48,8 +50,8 @@ description: 结合本仓库上下文对需求做结构化评审,只有当用
|
|
|
48
50
|
|
|
49
51
|
建议表头:
|
|
50
52
|
|
|
51
|
-
| 步骤
|
|
52
|
-
|
|
53
|
-
| 1. 读取 prd.md
|
|
53
|
+
| 步骤 | 结果 | 说明 |
|
|
54
|
+
| ----------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| 1. 读取 prd.md | 成功 / 失败 | 例如实际读取路径;失败时写错误原因 |
|
|
54
56
|
| 2. 评审与 comment | 成功 / 失败 | 临时文件路径(已删可写「已清理」);`apm comment` 退出情况或 API 返回摘要;**建议**注明本轮评审立场(仅前台 / 仅后台 / 全栈) |
|
|
55
|
-
| 3. 清理临时文件
|
|
57
|
+
| 3. 清理临时文件 | 成功 / 失败 | — |
|