oh-pi 0.1.64 → 0.1.65
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/package.json
CHANGED
|
@@ -218,8 +218,18 @@ export default function antColonyExtension(pi: ExtensionAPI) {
|
|
|
218
218
|
});
|
|
219
219
|
throttledRender();
|
|
220
220
|
},
|
|
221
|
-
onAntDone(ant) {
|
|
221
|
+
onAntDone(ant, task) {
|
|
222
222
|
colony.antStreams.delete(ant.id);
|
|
223
|
+
// 每个任务完成时注入一句话到主进程
|
|
224
|
+
const m = colony.state?.metrics;
|
|
225
|
+
const icon = ant.status === "done" ? "✓" : "✗";
|
|
226
|
+
const progress = m ? `${m.tasksDone}/${m.tasksTotal}` : "";
|
|
227
|
+
const cost = m ? formatCost(m.totalCost) : "";
|
|
228
|
+
pi.sendMessage({
|
|
229
|
+
customType: "ant-colony-progress",
|
|
230
|
+
content: `[COLONY_SIGNAL:TASK_DONE] 🐜 ${icon} ${task.title.slice(0, 60)} (${progress}, ${cost})`,
|
|
231
|
+
display: false,
|
|
232
|
+
}, { triggerTurn: false, deliverAs: "followUp" });
|
|
223
233
|
throttledRender();
|
|
224
234
|
},
|
|
225
235
|
onAntStream(event: AntStreamEvent) {
|