shadok-ai 0.6.4 → 0.7.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.6.4",
3
+ "version": "0.7.0",
4
4
  "main": "dist/session.js",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test test/*.ts .claude/skills/shadok-ai-agents/test/*.test.mjs context/*/test/*.test.mjs",
@@ -40,6 +40,21 @@ export function extractLiveText(screen) {
40
40
  // - running tool: "⏺ Running 1 shell command" / "⏺ Ran 1 shell command".
41
41
  // Without this, the tool line showed up as a text preview.
42
42
  if (/^[\w.-]+\(/.test(head) || /^(Running|Ran)\b/i.test(head)) return "";
43
+ // Is the next non-empty line after `idx` a "⎿" (tool-result marker)? If so, the
44
+ // line at `idx` is a running tool's STATUS ("Sleeping for 6 seconds\n ⎿ $ sleep
45
+ // 6"), not assistant text. Claude Code flips that status line's leading bullet
46
+ // on and off between redraws, so read as text it made the preview oscillate
47
+ // between the tool status and the real block above it — and glued the status
48
+ // onto the text when the bullet was absent.
49
+ const nextIsToolDetail = (idx) => {
50
+ for (let k = idx + 1; k < lines.length; k++) {
51
+ const t = lines[k].trim();
52
+ if (t === "") continue;
53
+ return t.startsWith("⎿");
54
+ }
55
+ return false;
56
+ };
57
+ if (nextIsToolDetail(start)) return ""; // the head itself is a tool status
43
58
 
44
59
  const parts = [head];
45
60
  const isToolLine = (t) => t.startsWith("⎿") || /^(Ran|Running)\b/.test(t);
@@ -61,6 +76,7 @@ export function extractLiveText(screen) {
61
76
  if (!l.startsWith(" ")) break; // unindented → the end (spinner, box, next block)
62
77
  const t = l.trim();
63
78
  if (isToolLine(t)) break; // a tool's sub-line
79
+ if (nextIsToolDetail(i)) break; // an indented tool STATUS ("… \n ⎿ $ cmd") — stop before it
64
80
  parts.push(t);
65
81
  }
66
82
  return parts.join(" ");