pi-gsd 1.11.2 → 1.11.4
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.
|
@@ -19,8 +19,10 @@
|
|
|
19
19
|
import { execSync } from "node:child_process";
|
|
20
20
|
import {
|
|
21
21
|
existsSync,
|
|
22
|
+
lstatSync,
|
|
22
23
|
mkdirSync,
|
|
23
24
|
readFileSync,
|
|
25
|
+
rmSync,
|
|
24
26
|
statSync,
|
|
25
27
|
symlinkSync,
|
|
26
28
|
writeFileSync,
|
|
@@ -38,7 +40,20 @@ import type { ContextUsage, ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
|
38
40
|
const ensureHarnessSymlink = (cwd: string): void => {
|
|
39
41
|
try {
|
|
40
42
|
const dest = join(cwd, ".pi", "gsd");
|
|
41
|
-
|
|
43
|
+
// If dest exists, verify it's a valid symlink with files inside.
|
|
44
|
+
// A stale real directory (from old build or worktree) must be replaced.
|
|
45
|
+
if (existsSync(dest)) {
|
|
46
|
+
try {
|
|
47
|
+
const stat = statSync(dest);
|
|
48
|
+
if (stat.isSymbolicLink?.() || lstatSync(dest).isSymbolicLink()) return; // valid symlink, done
|
|
49
|
+
// Real directory — check if it has the expected files
|
|
50
|
+
if (existsSync(join(dest, "workflows", "execute-phase.md"))) return; // looks complete
|
|
51
|
+
// Stale/incomplete directory — remove and replace with symlink
|
|
52
|
+
rmSync(dest, { recursive: true, force: true });
|
|
53
|
+
} catch {
|
|
54
|
+
return; // can't inspect, leave it
|
|
55
|
+
}
|
|
56
|
+
}
|
|
42
57
|
|
|
43
58
|
// Walk up from this extension file to the package root:
|
|
44
59
|
// <pkg>/.gsd/extensions/pi-gsd-hooks.ts → <pkg>
|
|
@@ -95,7 +110,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
95
110
|
|
|
96
111
|
// Fallback lookup: package harness root via this extension file's location
|
|
97
112
|
// <pkg>/.gsd/extensions/pi-gsd-hooks.ts → <pkg>/.gsd/harnesses/pi/get-shit-done
|
|
98
|
-
const
|
|
113
|
+
const extFile = typeof __filename !== "undefined" ? __filename : "";
|
|
114
|
+
const pkgHarness = extFile ? join(dirname(extFile), "..", "harnesses", "pi", "get-shit-done") : "";
|
|
99
115
|
|
|
100
116
|
const failed: string[] = [];
|
|
101
117
|
let transformed = text;
|