@byfriends/agent-core 0.2.2 → 0.2.3
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.mjs +5 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1679,13 +1679,18 @@ var BackgroundProcessManager = class {
|
|
|
1679
1679
|
* restart. Active-only mode never shows ghosts (they're terminal).
|
|
1680
1680
|
*/
|
|
1681
1681
|
list(activeOnly = true, limit) {
|
|
1682
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1682
1683
|
const result = [];
|
|
1683
1684
|
for (const entry of this.processes.values()) {
|
|
1684
1685
|
if (activeOnly && TERMINAL_STATUSES.has(entry.status)) continue;
|
|
1686
|
+
if (seen.has(entry.taskId)) continue;
|
|
1687
|
+
seen.add(entry.taskId);
|
|
1685
1688
|
result.push(this.toInfo(entry));
|
|
1686
1689
|
if (limit !== void 0 && result.length >= limit) return result;
|
|
1687
1690
|
}
|
|
1688
1691
|
if (!activeOnly) for (const ghost of this.ghosts.values()) {
|
|
1692
|
+
if (seen.has(ghost.taskId)) continue;
|
|
1693
|
+
seen.add(ghost.taskId);
|
|
1689
1694
|
result.push(ghost);
|
|
1690
1695
|
if (limit !== void 0 && result.length >= limit) return result;
|
|
1691
1696
|
}
|