@narumitw/pi-worktree 0.46.0 → 0.49.0

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/command.ts +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-worktree",
3
- "version": "0.46.0",
3
+ "version": "0.49.0",
4
4
  "description": "Pi extension for safe interactive Git worktree management and workspace switching.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -43,6 +43,6 @@
43
43
  "directory": "extensions/pi-worktree"
44
44
  },
45
45
  "dependencies": {
46
- "@narumitw/pi-tui-kit": "^0.40.0"
46
+ "@narumitw/pi-tui-kit": "^0.46.0"
47
47
  }
48
48
  }
package/src/command.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { resolve } from "node:path";
3
3
  import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
4
- import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
5
4
  import {
6
5
  addWorktree,
7
6
  administrativeHistoryOids,
@@ -84,6 +83,8 @@ export function registerWorktreeCommand(
84
83
  const root = settings.get();
85
84
  const warning = root.warning ? " — settings warning" : "";
86
85
  const owner = getMenuOwner();
86
+ const { defineMenu, runMenu } = await import("@narumitw/pi-tui-kit");
87
+ if (owner.signal.aborted || !owner.isCurrent()) return;
87
88
  const runFlow = async (flow: () => Promise<void>) => {
88
89
  try {
89
90
  await flow();
@@ -646,6 +647,8 @@ async function selectWorktree(
646
647
  ctx.ui.notify("No eligible worktrees are available for this action.", "info");
647
648
  return undefined;
648
649
  }
650
+ const { defineMenu, runMenu } = await import("@narumitw/pi-tui-kit");
651
+ if (signal?.aborted || ctx.signal?.aborted) return undefined;
649
652
  let selected: WorktreeRecord | undefined;
650
653
  const menu = defineMenu<undefined, "worktrees", "choose", ExtensionCommandContext>({
651
654
  start: "worktrees",