pi-crew 0.3.1 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-crew",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Pi extension for coordinated AI teams, workflows, worktrees, and async task orchestration",
5
5
  "author": "baphuongna",
6
6
  "license": "MIT",
@@ -88,6 +88,7 @@
88
88
  "@mariozechner/pi-agent-core": "^0.65.0",
89
89
  "@mariozechner/pi-ai": "^0.65.0",
90
90
  "@mariozechner/pi-coding-agent": "^0.65.0",
91
+ "@mariozechner/pi-tui": "^0.65.0",
91
92
  "esbuild": "^0.28.0",
92
93
  "typescript": "^5.9.3"
93
94
  },
@@ -459,6 +459,7 @@ export function registerPiTeams(pi: ExtensionAPI): void {
459
459
  if (manifest) void import("../state/event-log.ts").then(({ appendEventFireAndForget }) => appendEventFireAndForget(manifest.eventsPath, event as Parameters<typeof appendEventFireAndForget>[1]));
460
460
  };
461
461
  registry.waitForAll = async (runId: string) => {
462
+ // LAZY: state-store only needed for post-completion polling (waitForAll) and sync hasRunning check; avoid at startup.
462
463
  const { loadRunManifestById } = await import("../state/state-store.ts");
463
464
  const check = (): boolean => {
464
465
  const loaded = loadRunManifestById(currentCtx?.cwd ?? process.cwd(), runId);
@@ -470,6 +471,7 @@ export function registerPiTeams(pi: ExtensionAPI): void {
470
471
  registry.hasRunning = (runId: string) => {
471
472
  const manifest = manifestCacheForRegistry.get(runId);
472
473
  if (!manifest) return false;
474
+ // LAZY: state-store only needed in hasRunning; avoid at startup.
473
475
  const { loadRunManifestById } = require("../state/state-store.ts");
474
476
  const loaded = loadRunManifestById(currentCtx?.cwd ?? process.cwd(), runId);
475
477
  if (!loaded) return false;
@@ -69,11 +69,18 @@ const HOOK_TIMEOUT_MS = 30_000;
69
69
  export function isAllowedHookPath(hookPath: string): boolean {
70
70
  if (!hookPath || hookPath.trim().length === 0) return false;
71
71
  if (!path.isAbsolute(hookPath)) {
72
- const normalized = path.normalize(hookPath);
72
+ // Use path.posix.normalize to ensure forward-slash normalization on all platforms.
73
+ // On Windows, path.normalize converts .hooks/hook.sh to .hooks\hook.sh (backslash),
74
+ // breaking the startsWith(".hooks/") check. path.posix.normalize always uses /.
75
+ const normalized = path.posix.normalize(hookPath);
73
76
  return normalized === ".hooks" || normalized.startsWith(".hooks/");
74
77
  }
75
- const homeHooks = path.join(process.env.HOME ?? "", "", ".pi", "hooks");
76
- return hookPath === homeHooks || hookPath.startsWith(homeHooks + path.sep);
78
+ // Normalize to forward slashes for consistent cross-platform comparison.
79
+ // e.g., "C:\\Users\\runner\\.pi\\hooks\\hook.sh" matches
80
+ // "C:\\Users\\runner\\.pi\\hooks/hook.sh" from path.join.
81
+ const normalizedHookPath = hookPath.replace(/\\/g, "/");
82
+ const homeHooksNormalized = (process.env.HOME ?? "").replace(/\\/g, "/") + "/.pi/hooks";
83
+ return normalizedHookPath === homeHooksNormalized || normalizedHookPath.startsWith(homeHooksNormalized + "/");
77
84
  }
78
85
 
79
86
  /**