pi-gsd 1.11.5 → 1.11.6
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.
|
@@ -101,17 +101,25 @@ export default function (pi: ExtensionAPI) {
|
|
|
101
101
|
// contents programmatically. Zero tool calls, provider-agnostic.
|
|
102
102
|
// Missing files → red error + action:"handled" skips the LLM entirely.
|
|
103
103
|
pi.on("input", async (event, ctx) => {
|
|
104
|
-
|
|
104
|
+
ctx.ui.notify(`[GSD:input] FIRED. source=${event.source} text.len=${event.text?.length ?? "undef"} text.start=${JSON.stringify((event.text ?? "").slice(0, 120))}`, "info");
|
|
105
|
+
|
|
106
|
+
if (event.source === "extension") {
|
|
107
|
+
ctx.ui.notify("[GSD:input] SKIP: source=extension", "info");
|
|
108
|
+
return { action: "continue" };
|
|
109
|
+
}
|
|
105
110
|
|
|
106
111
|
const text = event.text;
|
|
107
112
|
const fileRefPattern = /@(\.pi\/gsd\/[^\s]+|\.planning\/[^\s]+)/g;
|
|
108
113
|
const refs = [...text.matchAll(fileRefPattern)];
|
|
114
|
+
ctx.ui.notify(`[GSD:input] refs found: ${refs.length}. Matches: ${refs.map(m => m[0]).join(", ") || "NONE"}`, "info");
|
|
115
|
+
|
|
109
116
|
if (refs.length === 0) return { action: "continue" };
|
|
110
117
|
|
|
111
|
-
// Fallback lookup: package harness root via this extension file's location
|
|
112
|
-
// <pkg>/.gsd/extensions/pi-gsd-hooks.ts → <pkg>/.gsd/harnesses/pi/get-shit-done
|
|
113
118
|
const extFile = typeof __filename !== "undefined" ? __filename : "";
|
|
119
|
+
ctx.ui.notify(`[GSD:input] __filename=${extFile || "UNDEFINED"}`, "info");
|
|
114
120
|
const pkgHarness = extFile ? join(dirname(extFile), "..", "harnesses", "pi", "get-shit-done") : "";
|
|
121
|
+
ctx.ui.notify(`[GSD:input] pkgHarness=${pkgHarness || "EMPTY"} exists=${pkgHarness ? existsSync(pkgHarness) : false}`, "info");
|
|
122
|
+
ctx.ui.notify(`[GSD:input] cwd=${ctx.cwd}`, "info");
|
|
115
123
|
|
|
116
124
|
const failed: string[] = [];
|
|
117
125
|
let transformed = text;
|
|
@@ -120,25 +128,27 @@ export default function (pi: ExtensionAPI) {
|
|
|
120
128
|
const relPath = match[1];
|
|
121
129
|
const subPath = relPath.replace(/^\.pi\/gsd\//, "");
|
|
122
130
|
|
|
123
|
-
// Lookup order:
|
|
124
|
-
// 1. Project symlink: <cwd>/.pi/gsd/<subPath>
|
|
125
|
-
// 2. Package harness: <pkg>/.gsd/harnesses/pi/get-shit-done/<subPath>
|
|
126
131
|
const candidates = [
|
|
127
132
|
join(ctx.cwd, relPath),
|
|
128
133
|
...(relPath.startsWith(".pi/gsd/") ? [join(pkgHarness, subPath)] : []),
|
|
129
134
|
];
|
|
135
|
+
ctx.ui.notify(`[GSD:input] ref=${relPath} candidates=${JSON.stringify(candidates)} exists=${candidates.map(c => existsSync(c))}`, "info");
|
|
130
136
|
|
|
131
137
|
let fileContent: string | null = null;
|
|
132
138
|
for (const candidate of candidates) {
|
|
133
139
|
try {
|
|
134
140
|
if (existsSync(candidate)) {
|
|
135
141
|
fileContent = readFileSync(candidate, "utf8");
|
|
142
|
+
ctx.ui.notify(`[GSD:input] FOUND ${candidate} (${fileContent.length} bytes)`, "info");
|
|
136
143
|
break;
|
|
137
144
|
}
|
|
138
|
-
} catch {
|
|
145
|
+
} catch (e) {
|
|
146
|
+
ctx.ui.notify(`[GSD:input] ERROR reading ${candidate}: ${e}`, "error");
|
|
147
|
+
}
|
|
139
148
|
}
|
|
140
149
|
|
|
141
150
|
if (fileContent === null) {
|
|
151
|
+
ctx.ui.notify(`[GSD:input] FAILED: ${relPath} — no candidate found`, "error");
|
|
142
152
|
failed.push(relPath);
|
|
143
153
|
} else {
|
|
144
154
|
transformed = transformed.replace(match[0], fileContent);
|