@howaboua/pi-shepherdr 0.2.3 → 0.2.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.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/ask-answer.ts +17 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @howaboua/pi-shepherdr
|
|
2
2
|
|
|
3
|
+
## 0.2.4
|
|
4
|
+
|
|
5
|
+
- Fixed agent answers being refused when prompt or footer text contains "Review". Shepherdr now reads the complete outer Ask panel, including nested text editors, and refuses incomplete captures without sending input.
|
|
6
|
+
|
|
3
7
|
## 0.2.3
|
|
4
8
|
|
|
5
9
|
- Fixed context continuity, voice replies, and patch preservation.
|
package/package.json
CHANGED
package/src/ask-answer.ts
CHANGED
|
@@ -172,9 +172,23 @@ async function screen(
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
function askFrame(value: string): string {
|
|
175
|
-
const lines = value.split("\n");
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
const lines = value.split("\n").map((line) => line.trimEnd());
|
|
176
|
+
// Ask's outer rules start at column zero. Nested editors are indented.
|
|
177
|
+
// Require the tab row so a clipped opening cannot borrow a transcript rule.
|
|
178
|
+
const start = lines.findLastIndex(
|
|
179
|
+
(line, index) =>
|
|
180
|
+
/^─+$/.test(line) &&
|
|
181
|
+
/^ +[□■] 1(?: +[□■] \d+)* +(?:Review|Resume)(?: +Agent continues while you decide)?$/.test(
|
|
182
|
+
lines[index + 1] ?? "",
|
|
183
|
+
),
|
|
184
|
+
);
|
|
185
|
+
if (start < 0) return "";
|
|
186
|
+
const end = lines.findIndex(
|
|
187
|
+
(line, index) => index > start && /^─+$/.test(line),
|
|
188
|
+
);
|
|
189
|
+
return end < 0 || lines[end] !== lines[start]
|
|
190
|
+
? ""
|
|
191
|
+
: lines.slice(start + 1, end).join("\n");
|
|
178
192
|
}
|
|
179
193
|
|
|
180
194
|
function inspectAskScreen(
|