switchroom 0.19.12 → 0.19.14

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 (26) hide show
  1. package/dist/cli/switchroom.js +1 -1
  2. package/dist/host-control/main.js +4 -2
  3. package/package.json +1 -1
  4. package/profiles/_base/cron-session.sh.hbs +5 -0
  5. package/profiles/_base/start.sh.hbs +11 -0
  6. package/telegram-plugin/dist/gateway/gateway.js +1402 -1032
  7. package/telegram-plugin/final-answer-detect.ts +23 -0
  8. package/telegram-plugin/gateway/gateway.ts +29 -36
  9. package/telegram-plugin/gateway/outbound-send-path.ts +115 -8
  10. package/telegram-plugin/gateway/outbox-sweep.ts +320 -0
  11. package/telegram-plugin/gateway/stream-render.ts +26 -50
  12. package/telegram-plugin/hooks/silent-end-interrupt-stop.mjs +120 -2
  13. package/telegram-plugin/hooks/silent-end-scan.mjs +311 -0
  14. package/telegram-plugin/outbox.ts +489 -0
  15. package/telegram-plugin/scripts/bun-test-ci.sh +91 -0
  16. package/telegram-plugin/temporal-normalize.ts +347 -0
  17. package/telegram-plugin/tests/gateway-outbound-redact.test.ts +22 -12
  18. package/telegram-plugin/tests/outbound-send-path.test.ts +191 -0
  19. package/telegram-plugin/tests/outbox-capture-scan.test.ts +222 -0
  20. package/telegram-plugin/tests/outbox-delivery.test.ts +278 -0
  21. package/telegram-plugin/tests/outbox-hook-capture.test.ts +112 -0
  22. package/telegram-plugin/tests/outbox-reply-then-recap-e2e.test.ts +600 -0
  23. package/telegram-plugin/tests/silent-end-interrupt-stop-integration.test.ts +68 -63
  24. package/telegram-plugin/tests/silent-end.test.ts +21 -28
  25. package/telegram-plugin/tests/temporal-normalize.test.ts +222 -0
  26. package/telegram-plugin/tests/turn-flush-safety.test.ts +23 -18
@@ -2120,7 +2120,7 @@ var init_esm = __esm(() => {
2120
2120
  });
2121
2121
 
2122
2122
  // src/build-info.ts
2123
- var VERSION = "0.19.12", COMMIT_SHA = "c2de527a";
2123
+ var VERSION = "0.19.14", COMMIT_SHA = "1f1f69f8";
2124
2124
 
2125
2125
  // src/cli/resolve-version.ts
2126
2126
  import { existsSync, readFileSync } from "node:fs";
@@ -26664,7 +26664,7 @@ import { existsSync as existsSync9, readFileSync as readFileSync7 } from "node:f
26664
26664
  import { dirname as dirname5, join as join7 } from "node:path";
26665
26665
 
26666
26666
  // src/build-info.ts
26667
- var VERSION = "0.19.12";
26667
+ var VERSION = "0.19.14";
26668
26668
 
26669
26669
  // src/cli/resolve-version.ts
26670
26670
  function readPackageVersion() {
@@ -30310,6 +30310,8 @@ class LogTailRolloutNarrator {
30310
30310
  return;
30311
30311
  st.lastAppliedSeq = seq;
30312
30312
  this.trackAgentProgress(st, phase);
30313
+ const doneNames = st.agents.filter((a) => a.status === "done").map((a) => a.name);
30314
+ const rolledSoFar = entry.rolled && entry.rolled.length > 0 ? entry.rolled : doneNames;
30313
30315
  st.render = {
30314
30316
  ...st.render,
30315
30317
  target: phase.target,
@@ -30317,7 +30319,7 @@ class LogTailRolloutNarrator {
30317
30319
  ...phase.n !== undefined ? { n: phase.n } : {},
30318
30320
  ...phase.m !== undefined ? { m: phase.m } : {},
30319
30321
  ...phase.agent !== undefined ? { agent: phase.agent } : {},
30320
- rolled: entry.rolled,
30322
+ rolled: rolledSoFar,
30321
30323
  agents: st.agents,
30322
30324
  requestId: entry.request_id,
30323
30325
  ...entry.prior_pin ? { fromVersion: entry.prior_pin } : {},
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "switchroom",
3
3
  "//version": "NOT the release version — source of truth is the git tag, resolved by scripts/build.mjs:resolveVersion() (see CLAUDE.md > Standard release process). This field is stale by design and only the Layer-4 dev/non-tag fallback for build.mjs + src/cli/resolve-version.ts; do NOT bump it expecting a release to pick it up. npm-pack tarball naming needs a real version — do that as an UNCOMMITTED pack-time bump (see release step 6), never a committed one.",
4
- "version": "0.19.12",
4
+ "version": "0.19.14",
5
5
  "description": "Run Claude Code 24/7 on your Claude Pro/Max subscription over Telegram. Open-source alternative to OpenClaw and NanoClaw — no API keys.",
6
6
  "type": "module",
7
7
  "bin": {
@@ -69,6 +69,11 @@ fi
69
69
  export SWITCHROOM_AGENT_NAME="$CRON_NAME"
70
70
  export CLAUDE_CONFIG_DIR="$CRON_CONFIG_DIR"
71
71
 
72
+ # Preserve pre-2.1.217 nested sub-agent behaviour for cron-fired sessions too.
73
+ # Normally inherited from start.sh's env; set here as a belt-and-braces default
74
+ # (honouring any value already in the env). See start.sh.hbs for rationale.
75
+ export CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH="${CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:-2}"
76
+
72
77
  # Defer the (now full) MCP schema set via tool-search so the cron session keeps
73
78
  # its low-context cost — the heavy servers load on demand; switchroom-telegram
74
79
  # + hindsight stay alwaysLoad. Normally inherited from start.sh's env; set here
@@ -532,6 +532,17 @@ export CLAUDE_CONFIG_DIR="{{agentDir}}/.claude"
532
532
  # Claude reads .credentials.json directly; the broker is the sole writer
533
533
  # of that file and updates it before claude's own refresh window opens.
534
534
  unset CLAUDE_CODE_OAUTH_TOKEN
535
+ # Claude Code 2.1.217 turned NESTED sub-agent spawning OFF by default: a
536
+ # sub-agent can no longer spawn its own sub-agent unless this env is set.
537
+ # The fleet relies on multi-level worker delegation (the main session
538
+ # dispatches @worker/@researcher, and a dispatched worker may in turn fan
539
+ # out its own sub-agents), so we restore the pre-2.1.217 behaviour. Depth 2
540
+ # = main → sub-agent → grandchild, which covers the one extra level the
541
+ # fleet actually uses; there is no evidence of deeper nesting, so we don't
542
+ # raise it further. (The companion 2.1.217 change — CLAUDE_CODE_MAX_
543
+ # CONCURRENT_SUBAGENTS defaulting to 20 — is already compatible: our fleet
544
+ # self-caps at 15 parallel sub-agents, so the 20 default is left untouched.)
545
+ export CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH="${CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH:-2}"
535
546
  export TELEGRAM_STATE_DIR="{{agentDir}}/telegram"
536
547
  # SWITCHROOM_AGENT_NAME is the canonical "which agent am I" identifier the
537
548
  # telegram-plugin reads to detect self-restart commands. We can't rely on