ai-project-manage-cli 6.0.23 → 6.0.25
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 +19 -9
- package/package.json +1 -1
- package/template/AGENTS.md +1 -1
package/dist/index.js
CHANGED
|
@@ -107,8 +107,8 @@ function sessionRulePath(sessionId, apmRoot) {
|
|
|
107
107
|
function sessionTaskPath(sessionId, apmRoot) {
|
|
108
108
|
return join2(sessionDir(sessionId, apmRoot), "TASK.md");
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
return join2(sessionDir(sessionId, apmRoot), "
|
|
110
|
+
function sessionTodoPath(sessionId, apmRoot) {
|
|
111
|
+
return join2(sessionDir(sessionId, apmRoot), "TODO.md");
|
|
112
112
|
}
|
|
113
113
|
function sessionYamlPath(sessionId, apmRoot) {
|
|
114
114
|
return join2(sessionDir(sessionId, apmRoot), "session.yaml");
|
|
@@ -631,7 +631,7 @@ async function runPull(sessionId, apmRoot) {
|
|
|
631
631
|
detail.task.description ?? "",
|
|
632
632
|
"utf8"
|
|
633
633
|
);
|
|
634
|
-
writeFileSync4(
|
|
634
|
+
writeFileSync4(sessionTodoPath(trimmedId, apmRoot), detail.todo ?? "", "utf8");
|
|
635
635
|
for (const doc of documents) {
|
|
636
636
|
const fileName = documentLocalFileName(doc.name);
|
|
637
637
|
writeFileSync4(join5(docsDir, fileName), doc.content ?? "", "utf8");
|
|
@@ -640,7 +640,7 @@ async function runPull(sessionId, apmRoot) {
|
|
|
640
640
|
{
|
|
641
641
|
name: detail.title,
|
|
642
642
|
task: "./TASK.md",
|
|
643
|
-
|
|
643
|
+
todo: "./TODO.md",
|
|
644
644
|
rule: "./RULE.md",
|
|
645
645
|
members: members.map((m) => ({
|
|
646
646
|
name: m.displayName,
|
|
@@ -1219,7 +1219,8 @@ function createThrottledCursorMessageLogSync(cfg, ctx, onError) {
|
|
|
1219
1219
|
let lastRunAt = 0;
|
|
1220
1220
|
let timer;
|
|
1221
1221
|
let latestSession;
|
|
1222
|
-
|
|
1222
|
+
let syncChain = Promise.resolve();
|
|
1223
|
+
const syncDirtyEventsOnce = async (session) => {
|
|
1223
1224
|
const events = session.getDirtyEvents();
|
|
1224
1225
|
if (events.length === 0) {
|
|
1225
1226
|
return;
|
|
@@ -1232,6 +1233,14 @@ function createThrottledCursorMessageLogSync(cfg, ctx, onError) {
|
|
|
1232
1233
|
onError(err);
|
|
1233
1234
|
}
|
|
1234
1235
|
};
|
|
1236
|
+
const drainDirtyEvents = async (session) => {
|
|
1237
|
+
while (session.getDirtyEvents().length > 0) {
|
|
1238
|
+
await syncDirtyEventsOnce(session);
|
|
1239
|
+
}
|
|
1240
|
+
};
|
|
1241
|
+
const enqueueSync = (session) => {
|
|
1242
|
+
syncChain = syncChain.then(() => drainDirtyEvents(session));
|
|
1243
|
+
};
|
|
1235
1244
|
return {
|
|
1236
1245
|
schedule(session) {
|
|
1237
1246
|
latestSession = session;
|
|
@@ -1242,7 +1251,7 @@ function createThrottledCursorMessageLogSync(cfg, ctx, onError) {
|
|
|
1242
1251
|
clearTimeout(timer);
|
|
1243
1252
|
timer = void 0;
|
|
1244
1253
|
}
|
|
1245
|
-
|
|
1254
|
+
enqueueSync(session);
|
|
1246
1255
|
return;
|
|
1247
1256
|
}
|
|
1248
1257
|
if (timer) {
|
|
@@ -1250,7 +1259,7 @@ function createThrottledCursorMessageLogSync(cfg, ctx, onError) {
|
|
|
1250
1259
|
}
|
|
1251
1260
|
timer = setTimeout(() => {
|
|
1252
1261
|
timer = void 0;
|
|
1253
|
-
|
|
1262
|
+
enqueueSync(latestSession);
|
|
1254
1263
|
}, CURSOR_MESSAGE_LOG_SYNC_INTERVAL_MS - elapsed);
|
|
1255
1264
|
},
|
|
1256
1265
|
async flush(session) {
|
|
@@ -1259,7 +1268,8 @@ function createThrottledCursorMessageLogSync(cfg, ctx, onError) {
|
|
|
1259
1268
|
clearTimeout(timer);
|
|
1260
1269
|
timer = void 0;
|
|
1261
1270
|
}
|
|
1262
|
-
await
|
|
1271
|
+
await syncChain;
|
|
1272
|
+
await drainDirtyEvents(session);
|
|
1263
1273
|
}
|
|
1264
1274
|
};
|
|
1265
1275
|
}
|
|
@@ -2466,7 +2476,7 @@ function buildProgram() {
|
|
|
2466
2476
|
await runUpdateSkills();
|
|
2467
2477
|
});
|
|
2468
2478
|
program.command("pull").description(
|
|
2469
|
-
"\u62C9\u53D6\u6C9F\u901A\u7FA4\u6570\u636E\u5230 .apm/sessions/<sessionId>/\uFF08session.yaml\u3001RULE.md\u3001TASK.md\
|
|
2479
|
+
"\u62C9\u53D6\u6C9F\u901A\u7FA4\u6570\u636E\u5230 .apm/sessions/<sessionId>/\uFF08session.yaml\u3001RULE.md\u3001TASK.md\u3001TODO.md\u3001docs\u3001attachments\uFF09"
|
|
2470
2480
|
).argument("<sessionId>", "\u6C9F\u901A\u7FA4 ID").action(async (sessionId) => {
|
|
2471
2481
|
await runPull(sessionId);
|
|
2472
2482
|
});
|
package/package.json
CHANGED
package/template/AGENTS.md
CHANGED
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
- 群文档: `docs/xxxx.md`,当需要相关上下文可以在这里查找,按需阅读
|
|
23
23
|
- 附件列表: `attachments/*`,当有文档中提及附件时,从这里查找
|
|
24
24
|
- 协作规则: `RULE.md`,在这里可以看到不同成员的协作规则,从而找其他成员协助你一起解决问题,按需阅读
|
|
25
|
-
-
|
|
25
|
+
- 协作 TODO: `TODO.md`,跨轮次任务清单(待办与已完成项),按需阅读
|
|
26
26
|
- 历史消息记录: `message.xml`,历史消息列表,数据量很大,按需阅读
|
|
27
27
|
- 初始目标: `TASK.md`,最初的目标,不一定具体,团队成员会有人负责让这个任务变得具体,仅供参考。如果你是相关的角色,则你需要先读取这个目标,然后规划接下来的动作。
|