switchroom 0.21.7 → 0.21.9

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.
Files changed (59) hide show
  1. package/bin/tmp-reaper.sh +234 -0
  2. package/dist/agent-scheduler/index.js +1 -1
  3. package/dist/auth-broker/index.js +2 -2
  4. package/dist/cli/notion-write-pretool.mjs +1 -1
  5. package/dist/cli/switchroom.js +3520 -2782
  6. package/dist/host-control/main.js +177 -13
  7. package/dist/vault/approvals/kernel-server.js +2 -2
  8. package/dist/vault/broker/server.js +2 -2
  9. package/package.json +6 -5
  10. package/profiles/_base/start.sh.hbs +115 -0
  11. package/profiles/_shared/local-time.md.hbs +6 -0
  12. package/profiles/default/CLAUDE.md.hbs +0 -12
  13. package/skills/switchroom-architecture/telegram.md +12 -10
  14. package/skills/switchroom-cli/SKILL.md +1 -1
  15. package/telegram-plugin/README.md +3 -1
  16. package/telegram-plugin/dist/gateway/gateway.js +1164 -547
  17. package/telegram-plugin/format.ts +12 -4
  18. package/telegram-plugin/gateway/agent-process-liveness.ts +558 -0
  19. package/telegram-plugin/gateway/approval-hold.ts +32 -1
  20. package/telegram-plugin/gateway/approval-outcome-sources.ts +274 -0
  21. package/telegram-plugin/gateway/bridge-dead-watchdog.ts +21 -9
  22. package/telegram-plugin/gateway/callback-query-handlers.ts +87 -15
  23. package/telegram-plugin/gateway/eval-case-proposal-inbound-builders.ts +197 -0
  24. package/telegram-plugin/gateway/gateway.ts +12 -10
  25. package/telegram-plugin/gateway/pending-inbound-buffer.ts +167 -11
  26. package/telegram-plugin/gateway/self-improve-proposal-wiring.test.ts +333 -0
  27. package/telegram-plugin/gateway/self-improve-proposal-wiring.ts +152 -3
  28. package/telegram-plugin/gateway/subagent-handback-marker.ts +19 -0
  29. package/telegram-plugin/package.json +1 -1
  30. package/telegram-plugin/render/code-segments.ts +38 -4
  31. package/telegram-plugin/render/dollar-math-guard.ts +16 -1
  32. package/telegram-plugin/render/ir.ts +53 -3
  33. package/telegram-plugin/render/parse.ts +73 -14
  34. package/telegram-plugin/render/render.ts +53 -15
  35. package/telegram-plugin/render/unsupported-token-guard.ts +45 -80
  36. package/telegram-plugin/rich-send.ts +22 -7
  37. package/telegram-plugin/shared/bot-runtime.ts +3 -2
  38. package/telegram-plugin/telegraph.ts +6 -4
  39. package/telegram-plugin/tests/agent-process-liveness.test.ts +406 -0
  40. package/telegram-plugin/tests/approval-hold-record.test.ts +21 -8
  41. package/telegram-plugin/tests/boot-resume-gateway-only-respawn.test.ts +752 -0
  42. package/telegram-plugin/tests/boot-resume-guard-wiring.test.ts +203 -0
  43. package/telegram-plugin/tests/callback-query-handlers.test.ts +143 -1
  44. package/telegram-plugin/tests/eval-case-proposal-inbound-builders.test.ts +144 -0
  45. package/telegram-plugin/tests/grammy-rich-message-types.test.ts +199 -0
  46. package/telegram-plugin/tests/hermes-messages-paging.test.ts +149 -0
  47. package/telegram-plugin/tests/hermes-session-search.test.ts +146 -0
  48. package/telegram-plugin/tests/pending-inbound-buffer.test.ts +443 -2
  49. package/telegram-plugin/tests/render/dollar-math-guard.test.ts +43 -0
  50. package/telegram-plugin/tests/render/guard-composition.test.ts +102 -0
  51. package/telegram-plugin/tests/render/parse.test.ts +30 -5
  52. package/telegram-plugin/tests/render/render.test.ts +9 -4
  53. package/telegram-plugin/tests/render/rich-render.test.ts +46 -5
  54. package/telegram-plugin/tests/render/tg-entity.test.ts +242 -0
  55. package/telegram-plugin/tests/render/unsupported-token-guard.test.ts +66 -66
  56. package/telegram-plugin/tests/sent-text-capture.test.ts +3 -3
  57. package/telegram-plugin/tests/subagent-handback-marker.test.ts +14 -0
  58. package/telegram-plugin/tests/telegraph.test.ts +1 -1
  59. package/telegram-plugin/uat/scenarios/jtbd-rich-formatting-render-dm.test.ts +17 -8
@@ -6,7 +6,7 @@ Switchroom ships an enhanced `switchroom-telegram` MCP plugin that replaces the
6
6
 
7
7
  | Tool | What it does |
8
8
  |------|-------------|
9
- | `reply` | Send text, photos, or documents — the single final-answer tool. Chunks anything over Telegram's 4096-char limit. Supports threading, topic routing, file attachments. |
9
+ | `reply` | Send text, photos, or documents — the single final-answer tool. Chunks anything over the 32768-char rich-message cap (4096 applies only to plain-text degradations). Supports threading, topic routing, file attachments. |
10
10
  | `react` | Add emoji reactions to messages (Telegram whitelist: 👍 👎 ❤️ 🔥 👀 🎉 etc). |
11
11
  | `edit_message` | Update a previously sent message. Edits are silent (no push notification). |
12
12
  | `delete_message` | Remove a bot-sent message (48h Telegram API limit). |
@@ -40,18 +40,20 @@ History survives process restarts and session resets.
40
40
  For long tasks you do not need to narrate progress by editing a message. The
41
41
  plugin renders an event-driven progress card (Plan → Run → Done with live tool
42
42
  bullets, elapsed time, and status emoji) for free while the turn is in-flight.
43
- Send the final answer once, with `reply` — it chunks anything over Telegram's
44
- 4096-char limit. For an explicit mid-turn check-in use `progress_update`.
43
+ Send the final answer once, with `reply` — it chunks anything over the
44
+ 32768-char rich-message cap (4096 applies only to plain-text degradations).
45
+ For an explicit mid-turn check-in use `progress_update`.
45
46
 
46
47
  ## Formatting
47
48
 
48
- Markdown is auto-converted to Telegram HTML:
49
- - `**bold**` → `<b>bold</b>`
50
- - `` `code` `` → `<code>code</code>`
51
- - ` ```blocks``` ` → `<pre><code>...</code></pre>`
52
- - Smart chunking preserves tag balance across Telegram's 4096-char limit
53
-
54
- Formats: `html` (default), `markdownv2`, `text`
49
+ Every outbound message is sent as raw GFM markdown via the Bot API 10.1
50
+ rich-message path (`sendRichMessage` / `editMessageText({ markdown })`) —
51
+ Telegram parses the markdown server-side. There is no markdown→HTML
52
+ conversion and no `parse_mode` on this path. Smart chunking
53
+ (`splitMarkdownChunks`) splits anything over the 32768-char rich cap without
54
+ bisecting code fences or table rows; bodies that degrade to plain text fall
55
+ back to the legacy 4096-char cap. See
56
+ `reference/telegram-formatting-guide.md` for the full vocabulary.
55
57
 
56
58
  ## Access control
57
59
 
@@ -294,7 +294,7 @@ The `switchroom-telegram` plugin is an enhanced fork of the official Telegram MC
294
294
 
295
295
  | Tool | Purpose |
296
296
  |---|---|
297
- | `reply` | Send a text/photo message — the single final-answer tool; chunks anything over Telegram's 4096-char limit. Optional `reply_to` for threaded quotes |
297
+ | `reply` | Send a text/photo message — the single final-answer tool; chunks anything over the 32768-char rich-message cap (4096 applies only to plain-text degradations). Optional `reply_to` for threaded quotes |
298
298
  | `react` | Emoji reaction on an inbound or outbound message |
299
299
  | `edit_message` | Modify an earlier bot message's text |
300
300
  | `delete_message` | Remove an earlier bot message |
@@ -204,7 +204,9 @@ For long tasks the model does **not** need to narrate progress or drive a
204
204
  streaming message itself. The plugin renders an event-driven progress card
205
205
  (Plan → Run → Done with live tool bullets, elapsed time, and status emoji)
206
206
  for free while the turn is in-flight. Send the final answer once, with
207
- `reply` — it chunks anything over Telegram's 4096-char limit. (The retired
207
+ `reply` — it chunks anything over the rich-message wire cap of 32768 chars
208
+ (`RICH_MESSAGE_MAX_CHARS` in `format.ts`; the legacy 4096 cap applies only to
209
+ plain-text degradations). (The retired
208
210
  `stream_reply` tool was a redundant, worse alias of `reply`; the internal
209
211
  progress-card streaming that drove it is preserved and is what renders the
210
212
  live card.)