@signalridge/pi-worktree 1.4.1 → 1.4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.2
4
+ ### Patch Changes
5
+
6
+ - e939fa0: Fix Pi 0.85.1 tool-approval argument forwarding, ambient-auth and credential-specific model routing, and cross-platform workspace session validation.
7
+
3
8
  ## 1.4.1
4
9
  ### Patch Changes
5
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalridge/pi-worktree",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Pi extension for safe interactive Git worktree management and workspace switching.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/session.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { existsSync, writeFileSync } from "node:fs";
2
+ import { resolve as normalizeTargetPath } from "node:path";
2
3
  import type { ExtensionCommandContext, SessionEntry } from "@earendil-works/pi-coding-agent";
3
4
  import { SessionManager } from "@earendil-works/pi-coding-agent";
4
5
  import { stripTerminalControls } from "./git.js";
@@ -67,6 +68,14 @@ export function createTargetSession(ctx: ExtensionCommandContext, targetPath: st
67
68
  return writeTargetSession(targetPath, [], undefined, null);
68
69
  }
69
70
 
71
+ export function sessionCwdMatches(
72
+ actual: string,
73
+ expected: string,
74
+ resolvePath: (path: string) => string = normalizeTargetPath,
75
+ ): boolean {
76
+ return resolvePath(actual) === resolvePath(expected);
77
+ }
78
+
70
79
  function writeTargetSession(
71
80
  targetPath: string,
72
81
  entries: readonly SessionEntry[],
@@ -84,7 +93,7 @@ function writeTargetSession(
84
93
  mode: 0o600,
85
94
  });
86
95
  const verified = SessionManager.open(targetFile);
87
- if (verified.getCwd() !== targetPath || verified.getLeafId() !== expectedLeaf) {
96
+ if (!sessionCwdMatches(verified.getCwd(), targetPath) || verified.getLeafId() !== expectedLeaf) {
88
97
  throw new Error("Pi could not verify the target session cwd and active branch.");
89
98
  }
90
99
  return targetFile;