parawatch 0.3.4 → 0.3.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.
- package/dist/adapters/claudeCode.js +14 -1
- package/package.json +1 -1
|
@@ -29,6 +29,14 @@ function toolSummary(b) {
|
|
|
29
29
|
return short ? `${b.name}: ${oneLine(short, 80)}` : String(b.name ?? "tool");
|
|
30
30
|
}
|
|
31
31
|
/** A prompt the human (or parent agent) typed, not a tool result or system notice. */
|
|
32
|
+
/** What Claude Code writes as a user record when the human stops a turn (or its parent was stopped). */
|
|
33
|
+
const INTERRUPTED = /^\[Request interrupted by user\b/;
|
|
34
|
+
function isInterrupt(rec) {
|
|
35
|
+
if (rec.type !== "user")
|
|
36
|
+
return false;
|
|
37
|
+
const text = blocks(rec).filter((b) => b.type === "text").map((b) => b.text ?? "").join("\n").trim();
|
|
38
|
+
return INTERRUPTED.test(text);
|
|
39
|
+
}
|
|
32
40
|
function promptText(rec) {
|
|
33
41
|
if (rec.type !== "user" || rec.isMeta === true)
|
|
34
42
|
return undefined;
|
|
@@ -38,7 +46,7 @@ function promptText(rec) {
|
|
|
38
46
|
if (bs.some((b) => b.type === "tool_result"))
|
|
39
47
|
return undefined;
|
|
40
48
|
const text = bs.filter((b) => b.type === "text").map((b) => b.text ?? "").join("\n").trim();
|
|
41
|
-
if (!text || text.startsWith("<"))
|
|
49
|
+
if (!text || text.startsWith("<") || INTERRUPTED.test(text))
|
|
42
50
|
return undefined;
|
|
43
51
|
return text;
|
|
44
52
|
}
|
|
@@ -245,6 +253,11 @@ export function readClaudeTail(recs, kind) {
|
|
|
245
253
|
out.action = "thinking";
|
|
246
254
|
}
|
|
247
255
|
}
|
|
256
|
+
else if (isInterrupt(lastConv)) {
|
|
257
|
+
// the turn was stopped and nothing came after: a session waits for the human, a subagent is over
|
|
258
|
+
out.state = kind === "subagent" ? "done" : "idle";
|
|
259
|
+
out.action = "interrupted";
|
|
260
|
+
}
|
|
248
261
|
else {
|
|
249
262
|
out.state = "working";
|
|
250
263
|
const result = bs.find((b) => b.type === "tool_result");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parawatch",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "A control tower for people running many AI coding agents in parallel: see what is running, what needs you, and wake the right agent when you answer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|