pwragent 1.3.14 → 1.3.15

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.
@@ -23653,8 +23653,31 @@ function buildDirectoryRows(params) {
23653
23653
  return params.snapshot.directories.map((directory) => {
23654
23654
  const memberThreads = directoryMemberThreads(directory, params.threadsByLegacyKey);
23655
23655
  const parentOf = directoryParentResolver(memberThreads, params.parentCandidates);
23656
- const rootThreads = memberThreads.filter((thread) => !parentOf(thread));
23656
+ const rootThreads = [];
23657
+ const children = /* @__PURE__ */ new Map();
23658
+ for (const thread of memberThreads) {
23659
+ const parent = parentOf(thread);
23660
+ if (!parent) {
23661
+ rootThreads.push(thread);
23662
+ } else {
23663
+ const key = identityKey(parent);
23664
+ const siblings = children.get(key) ?? [];
23665
+ siblings.push(thread);
23666
+ children.set(key, siblings);
23667
+ }
23668
+ }
23657
23669
  const pinnedRootCount = rootThreads.filter((thread) => thread.pinnedRank).length;
23670
+ const pending = rootThreads.filter((thread) => !thread.pinnedRank);
23671
+ const visited = /* @__PURE__ */ new Set();
23672
+ let unpinnedThreadCount = 0;
23673
+ while (pending.length) {
23674
+ const thread = pending.pop();
23675
+ const key = threadKey(thread);
23676
+ if (visited.has(key)) continue;
23677
+ visited.add(key);
23678
+ if (isOrdinaryThread(thread)) unpinnedThreadCount += 1;
23679
+ for (const child of children.get(key) ?? []) pending.push(child);
23680
+ }
23658
23681
  const gitStatus = projectDirectoryGitStatus(directory);
23659
23682
  const repositoryKey = directory.gitStatus?.originRepository ?? directory.repositoryKey;
23660
23683
  const repositoryKeys = directory.gitStatus?.remoteRepositories?.length ? directory.gitStatus.remoteRepositories : directory.repositoryKeys;
@@ -23669,6 +23692,7 @@ function buildDirectoryRows(params) {
23669
23692
  counts: countsForThreads(memberThreads),
23670
23693
  pinnedRootCount,
23671
23694
  unpinnedRootCount: rootThreads.length - pinnedRootCount,
23695
+ unpinnedThreadCount,
23672
23696
  ...directory.latestUpdatedAt !== void 0 ? { latestUpdatedAt: directory.latestUpdatedAt } : {},
23673
23697
  ...directory.pinnedRank ? { pinnedRank: directory.pinnedRank } : {},
23674
23698
  ...directory.directoryThreadsCollapsed !== void 0 ? { directoryThreadsCollapsed: directory.directoryThreadsCollapsed } : {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pwragent",
3
- "version": "1.3.14",
3
+ "version": "1.3.15",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Experimental headless PwrAgent daemon and command-line client.",
@@ -64,7 +64,7 @@
64
64
  "node-pty"
65
65
  ],
66
66
  "pwragentRelease": {
67
- "tag": "v1.3.14",
68
- "commit": "83e5f182822aa59fb38cf9f86fad806e3027a007"
67
+ "tag": "v1.3.15",
68
+ "commit": "bea7442e08c8eecf09926b8956e898efb72569b8"
69
69
  }
70
70
  }