@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howaboua/pi-shepherdr",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Persistent blocking and asynchronous Pi agents through Herdr.",
5
5
  "type": "module",
6
6
  "license": "MIT",
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
- const review = lines.map((line) => line.includes("Review")).lastIndexOf(true);
177
- return (review >= 0 ? lines.slice(review) : lines.slice(-30)).join("\n");
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(