@henryqw/pi-herdr-done 0.5.1 → 0.5.2

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.
@@ -64,15 +64,13 @@ export default function herdrDoneExtension(pi: ExtensionAPI): void {
64
64
  const listing = await herdr.json(["tab", "list"], { cwd: ctx.cwd });
65
65
  const tabs = (listing.result as { tabs?: TabEntry[] } | undefined)?.tabs;
66
66
  if (!Array.isArray(tabs)) throw new Error("herdr tab list returned no tabs.");
67
- const tabsById = new Map(tabs
68
- .filter((tab): tab is TabEntry & { tab_id: string } => typeof tab.tab_id === "string")
69
- .map((tab) => [tab.tab_id, tab]));
67
+ const validTabs = tabs.filter((tab): tab is TabEntry & { tab_id: string } => typeof tab.tab_id === "string");
68
+ const tabsById = new Map(validTabs.map((tab) => [tab.tab_id, tab]));
70
69
  if (tabsById.get(tabId)?.workspace_id !== workspaceId) {
71
70
  throw new Error(`Herdr tab ${tabId} does not belong to workspace ${workspaceId}.`);
72
71
  }
73
- siblingTabIds = tabs
74
- .filter((tab): tab is TabEntry & { tab_id: string } =>
75
- typeof tab.tab_id === "string" && tab.tab_id !== tabId && tab.workspace_id === workspaceId)
72
+ siblingTabIds = validTabs
73
+ .filter((tab) => tab.tab_id !== tabId && tab.workspace_id === workspaceId)
76
74
  .map((tab) => tab.tab_id);
77
75
  const blockers = dependentIds.filter((id) => tabsById.get(id)?.workspace_id !== workspaceId);
78
76
  if (blockers.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-herdr-done",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Close and remove the current Herdr worktree from Pi.",
5
5
  "keywords": [
6
6
  "pi-package",