shadok-ai 0.3.88 → 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.
@@ -5,8 +5,8 @@ description: Schedule recurring prompts (monitoring, reporting, watching) for th
5
5
 
6
6
  # shadok-scheduler
7
7
 
8
- Turn a natural-language request like *"surveille le budget Google Ads chaque matin
9
- et alerte-moi si un plafond est dépassé"* into a token-efficient scheduled job on
8
+ Turn a natural-language request like *"watch the Google Ads budget every morning
9
+ and alert me when a cap is exceeded"* into a token-efficient scheduled job on
10
10
  **this channel**.
11
11
 
12
12
  Only works inside a shadok-ai channel — it needs `SHADOK_SESSION_ID` and
@@ -84,14 +84,14 @@ An interval (`every:30m`) is a duration, so it has no timezone.
84
84
  node scripts/schedule.mjs add \
85
85
  --schedule daily:09:00 \
86
86
  --check "python3 $HOME/.claude/skills/google-ads/scripts/check_budget.py" \
87
- --prompt "Le monitoring a détecté une anomalie budget Google Ads. Rédige une alerte claire et actionnable pour l'équipe."
87
+ --prompt "The monitoring detected a Google Ads budget anomaly. Write a clear, actionable alert for the team."
88
88
  ```
89
89
 
90
90
  ### Example — plain recurring report (runs every time)
91
91
 
92
92
  ```
93
93
  node scripts/schedule.mjs add --schedule daily:18:00 \
94
- --prompt "Fais le point de la journée sur le compte et poste un court résumé."
94
+ --prompt "Review the day on the account and post a short summary."
95
95
  ```
96
96
 
97
97
  After creating a schedule, confirm to the user in plain language: what it watches,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.3.88",
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".