shadok-ai 0.3.89 → 0.3.90

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.3.89",
3
+ "version": "0.3.90",
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",
@@ -6,25 +6,35 @@
6
6
  // .jsonl transcript only writes a text block once FINISHED; the screen shows it
7
7
  // as it is typed → the only token-granular source.
8
8
  //
9
- // An assistant text block = a " <prose>" line (U+23FA + space) at column 0,
10
- // followed by continuations indented by 2 spaces. A tool_use renders as
11
- // " Name(args)"; a tool result renders as " ⎿ …".
9
+ // An assistant text block = a "<bullet> <prose>" line at column 0, followed by
10
+ // continuations indented by 2 spaces. A tool_use renders as
11
+ // "<bullet> Name(args)"; a tool result renders as " ⎿ …".
12
+ //
13
+ // TWO bullets, and both are load-bearing: Claude Code used "⏺" (U+23FA) and
14
+ // switched to "●" (U+25CF) in 2.1. Matching only one makes `extractLiveText`
15
+ // find nothing at all — the web live preview goes dark with no error anywhere,
16
+ // on every session running that version. Support for "●" was added once,
17
+ // removed by a translation pass that also deleted its tests (so CI stayed
18
+ // green), and restored here. Do not "simplify" this back to a single marker.
12
19
 
13
- const MARKER = "⏺ "; // " "
20
+ const MARKERS = ["⏺ ", " "];
21
+ const markerOf = (line) => MARKERS.find((m) => line.startsWith(m)) ?? null;
14
22
 
15
23
  /** The last visible assistant text block, unwrapped; "" otherwise. */
16
24
  export function extractLiveText(screen) {
17
25
  if (typeof screen !== "string" || !screen) return "";
18
26
  const lines = screen.split("\n");
19
27
 
20
- // Find the last "⏺ " block marker at column 0.
28
+ // Find the last block marker at column 0, whichever bullet it uses.
21
29
  let start = -1;
30
+ let marker = null;
22
31
  for (let i = lines.length - 1; i >= 0; i--) {
23
- if (lines[i].startsWith(MARKER)) { start = i; break; }
32
+ const m = markerOf(lines[i]);
33
+ if (m) { start = i; marker = m; break; }
24
34
  }
25
35
  if (start < 0) return "";
26
36
 
27
- const head = lines[start].slice(MARKER.length).trim();
37
+ const head = lines[start].slice(marker.length).trim();
28
38
  // Exclude TOOL lines (not assistant text):
29
39
  // - tool_use : "⏺ Name(...)" — an identifier glued to a parenthesis;
30
40
  // - running tool: "⏺ Running 1 shell command" / "⏺ Ran 1 shell command".