@henryqw/pi-herdr-done 0.5.1 → 0.5.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/README.md CHANGED
@@ -34,17 +34,3 @@ The parent pull runs only when this session ran in a linked worktree with a non-
34
34
  Tabs in the current Herdr workspace close automatically. When a tab from another workspace still uses the current checkout, `/done` refuses and lists it by name; use `/done --force` to remove the checkout regardless. Command requires Pi running inside Herdr with `HERDR_ENV=1`, `HERDR_WORKSPACE_ID`, and `HERDR_TAB_ID` set.
35
35
 
36
36
  Dirty worktrees make `/done` fail. Commit or discard changes, or use `/done --force` to explicitly delete them.
37
-
38
- ## Remove
39
-
40
- ```bash
41
- pi remove npm:@henryqw/pi-herdr-done
42
- ```
43
-
44
- ## Development
45
-
46
- ```bash
47
- npm test --workspace @henryqw/pi-herdr-done
48
- npm run typecheck --workspace @henryqw/pi-herdr-done
49
- npm run pack:check --workspace @henryqw/pi-herdr-done
50
- ```
@@ -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.3",
4
4
  "description": "Close and remove the current Herdr worktree from Pi.",
5
5
  "keywords": [
6
6
  "pi-package",