@a1hvdy/cc-openclaw 0.26.5 → 0.27.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.
Files changed (448) hide show
  1. package/dist/src/channels/adapter.js +0 -1
  2. package/dist/src/channels/telegram-mirror/askuser.js +21 -8
  3. package/dist/src/channels/telegram-mirror/burst-accumulator.js +0 -1
  4. package/dist/src/channels/telegram-mirror/callback-mapping.js +0 -1
  5. package/dist/src/channels/telegram-mirror/card-renderer.js +113 -21
  6. package/dist/src/channels/telegram-mirror/card-state.js +0 -1
  7. package/dist/src/channels/telegram-mirror/commands.js +0 -1
  8. package/dist/src/channels/telegram-mirror/compose-buffer.js +0 -1
  9. package/dist/src/channels/telegram-mirror/cost-views.js +0 -1
  10. package/dist/src/channels/telegram-mirror/failure/callback-data-overflow.js +0 -1
  11. package/dist/src/channels/telegram-mirror/failure/gateway-down.js +0 -1
  12. package/dist/src/channels/telegram-mirror/failure/in-flight-conflict.js +0 -1
  13. package/dist/src/channels/telegram-mirror/failure/index.js +0 -1
  14. package/dist/src/channels/telegram-mirror/failure/model-5xx.js +0 -1
  15. package/dist/src/channels/telegram-mirror/failure/network-blip.js +0 -1
  16. package/dist/src/channels/telegram-mirror/failure/pool-exhausted-fallback.js +0 -1
  17. package/dist/src/channels/telegram-mirror/failure/rate-limit.js +0 -1
  18. package/dist/src/channels/telegram-mirror/failure/returning-after-24h.js +0 -1
  19. package/dist/src/channels/telegram-mirror/failure/types.js +0 -1
  20. package/dist/src/channels/telegram-mirror/inbound-handler.js +0 -1
  21. package/dist/src/channels/telegram-mirror/index.js +0 -1
  22. package/dist/src/channels/telegram-mirror/plan-attachment.js +0 -1
  23. package/dist/src/channels/telegram-mirror/quota-reader.js +0 -1
  24. package/dist/src/channels/telegram-mirror/sessions-keyboard.js +0 -1
  25. package/dist/src/channels/telegram-mirror/soak-log.js +0 -1
  26. package/dist/src/channels/telegram-mirror/state-machine.d.ts +12 -2
  27. package/dist/src/channels/telegram-mirror/state-machine.js +36 -2
  28. package/dist/src/channels/telegram-mirror/status-line.js +0 -1
  29. package/dist/src/channels/telegram-mirror/sync-commands.js +0 -1
  30. package/dist/src/channels/telegram-mirror/threshold-watcher.js +0 -1
  31. package/dist/src/channels/telegram-mirror/turn-bridge.d.ts +17 -0
  32. package/dist/src/channels/telegram-mirror/turn-bridge.js +70 -2
  33. package/dist/src/cli/checks/bridge-wiring.js +0 -1
  34. package/dist/src/cli/checks/config-schema.js +0 -1
  35. package/dist/src/cli/checks/critical-openclaw-json-keys.js +0 -1
  36. package/dist/src/cli/checks/install-path.js +0 -1
  37. package/dist/src/cli/checks/patch-scaffold.js +0 -1
  38. package/dist/src/cli/doctor.js +0 -1
  39. package/dist/src/cli/index.js +0 -1
  40. package/dist/src/cli/migrate.js +0 -1
  41. package/dist/src/command-router/cc-handler.js +0 -1
  42. package/dist/src/command-router/index.js +0 -1
  43. package/dist/src/command-router/launch-policy.js +0 -1
  44. package/dist/src/command-router/resume-policy.js +0 -1
  45. package/dist/src/command-router/turn-formatter.js +0 -1
  46. package/dist/src/config/drift-detector.js +0 -1
  47. package/dist/src/config/loader.js +0 -1
  48. package/dist/src/config/schema.js +0 -1
  49. package/dist/src/constants.js +0 -1
  50. package/dist/src/council/build-agent-prompt.js +0 -1
  51. package/dist/src/council/cleanup-worktrees.js +0 -1
  52. package/dist/src/council/consensus.js +0 -1
  53. package/dist/src/council/council.js +0 -1
  54. package/dist/src/council/index.js +0 -1
  55. package/dist/src/council/system-prompt.js +0 -1
  56. package/dist/src/council/write-worktree-claude-md.js +0 -1
  57. package/dist/src/engines/base-oneshot-session.js +0 -1
  58. package/dist/src/engines/heartbeat-guard.js +0 -1
  59. package/dist/src/engines/index.js +0 -1
  60. package/dist/src/engines/persistent-codex-session.js +0 -1
  61. package/dist/src/engines/persistent-cursor-session.js +0 -1
  62. package/dist/src/engines/persistent-custom-session.js +0 -1
  63. package/dist/src/engines/persistent-gemini-session.js +0 -1
  64. package/dist/src/engines/persistent-session.js +30 -1
  65. package/dist/src/engines/resolve-bin.js +0 -1
  66. package/dist/src/engines/subprocess-pool.js +0 -1
  67. package/dist/src/health/handler.js +0 -1
  68. package/dist/src/health/index.js +0 -1
  69. package/dist/src/health/metrics.js +0 -1
  70. package/dist/src/index.js +0 -1
  71. package/dist/src/lib/auto-recovery.js +0 -1
  72. package/dist/src/lib/cache-parity.js +0 -1
  73. package/dist/src/lib/circuit-breaker.js +0 -1
  74. package/dist/src/lib/config-service.js +0 -1
  75. package/dist/src/lib/config.js +0 -1
  76. package/dist/src/lib/cost-rollup.js +0 -1
  77. package/dist/src/lib/debounce.js +0 -1
  78. package/dist/src/lib/debug-tap.js +0 -1
  79. package/dist/src/lib/domain-error.js +0 -1
  80. package/dist/src/lib/drift-detector.js +0 -1
  81. package/dist/src/lib/env-overrides.js +0 -1
  82. package/dist/src/lib/error-formatter.js +0 -1
  83. package/dist/src/lib/error-renderer.js +0 -1
  84. package/dist/src/lib/heartbeat-config.js +0 -1
  85. package/dist/src/lib/heartbeat-workaround.js +0 -1
  86. package/dist/src/lib/html-render.d.ts +43 -0
  87. package/dist/src/lib/html-render.js +110 -0
  88. package/dist/src/lib/http-agent.js +0 -1
  89. package/dist/src/lib/index.js +0 -1
  90. package/dist/src/lib/json-array.js +0 -1
  91. package/dist/src/lib/markdown-to-mdv2.js +0 -1
  92. package/dist/src/lib/markdown-v2.js +0 -1
  93. package/dist/src/lib/perf/async-compact.js +0 -1
  94. package/dist/src/lib/perf/direct-sdk.js +0 -1
  95. package/dist/src/lib/perf/haiku-route.js +0 -1
  96. package/dist/src/lib/perf/predictive-continuation.js +0 -1
  97. package/dist/src/lib/perf/read-batch.js +0 -1
  98. package/dist/src/lib/perf/skill-list-collapse.js +0 -1
  99. package/dist/src/lib/perf/speculative-bubble.js +0 -1
  100. package/dist/src/lib/perf/typing-prefetch.js +0 -1
  101. package/dist/src/lib/register-guard.js +0 -1
  102. package/dist/src/lib/req-shape-log.js +0 -1
  103. package/dist/src/lib/safe-upstream-probes.js +0 -1
  104. package/dist/src/lib/session-registry.js +0 -1
  105. package/dist/src/lib/spawn-async.js +0 -1
  106. package/dist/src/lib/stale-pid-files.js +0 -1
  107. package/dist/src/lib/status-tee-reader.js +0 -1
  108. package/dist/src/lib/sysprompt-strip.js +0 -1
  109. package/dist/src/lib/telegram-bot-api.js +2 -3
  110. package/dist/src/lib/telemetry.js +0 -1
  111. package/dist/src/lib/test-mode.js +0 -1
  112. package/dist/src/lib/trajectory.js +0 -1
  113. package/dist/src/lib/vendor-paths.js +0 -1
  114. package/dist/src/lifecycle/boot.js +0 -1
  115. package/dist/src/lifecycle/patch-manifest.js +0 -1
  116. package/dist/src/lifecycle/phase-import-upstream.js +0 -1
  117. package/dist/src/lifecycle/phase-install-patches.js +0 -1
  118. package/dist/src/lifecycle/phase-schedule-jobs.js +0 -1
  119. package/dist/src/lifecycle/phase-start-server.js +0 -1
  120. package/dist/src/lifecycle/phase-validate-config.js +0 -1
  121. package/dist/src/lifecycle/phase-validate-upstream.js +0 -1
  122. package/dist/src/lifecycle/phase-wire-handlers.js +0 -1
  123. package/dist/src/lifecycle/safe-restart.js +0 -1
  124. package/dist/src/logger.js +0 -1
  125. package/dist/src/mcp/bridge.js +0 -1
  126. package/dist/src/mcp/index.js +0 -1
  127. package/dist/src/models.js +0 -1
  128. package/dist/src/observability/event-bus.js +0 -1
  129. package/dist/src/observability/get-event-bus.js +0 -1
  130. package/dist/src/observability/observability-service.js +0 -1
  131. package/dist/src/observability/perf-telemetry.js +0 -1
  132. package/dist/src/observability/subscribers/metrics.js +0 -1
  133. package/dist/src/observability/subscribers/session-capture.js +0 -1
  134. package/dist/src/openai-compat/bridges/allowlist.js +0 -1
  135. package/dist/src/openai-compat/bridges/factory.js +0 -1
  136. package/dist/src/openai-compat/bridges/media-bridge.js +0 -1
  137. package/dist/src/openai-compat/bridges/openclaw-api-shim.js +0 -1
  138. package/dist/src/openai-compat/bridges/openclaw-native-tools.js +0 -1
  139. package/dist/src/openai-compat/bridges/openclaw-tool-registry.js +0 -1
  140. package/dist/src/openai-compat/bridges/tts-media-bridge.js +0 -1
  141. package/dist/src/openai-compat/cli-stream-parser.js +0 -1
  142. package/dist/src/openai-compat/index.js +0 -1
  143. package/dist/src/openai-compat/message-extractor.js +0 -1
  144. package/dist/src/openai-compat/mode-flags.js +0 -1
  145. package/dist/src/openai-compat/non-streaming-handler.js +13 -3
  146. package/dist/src/openai-compat/openai-chunk-types.js +0 -1
  147. package/dist/src/openai-compat/openai-compat.js +0 -1
  148. package/dist/src/openai-compat/openai-types.js +0 -1
  149. package/dist/src/openai-compat/parse-route-body.js +0 -1
  150. package/dist/src/openai-compat/prompts.js +0 -1
  151. package/dist/src/openai-compat/response-formatter.js +0 -1
  152. package/dist/src/openai-compat/session-key-resolver.js +0 -1
  153. package/dist/src/openai-compat/skill-resolver.js +0 -1
  154. package/dist/src/openai-compat/sse-translator.js +0 -1
  155. package/dist/src/openai-compat/status-reporter.js +0 -1
  156. package/dist/src/openai-compat/streaming-handler.js +16 -3
  157. package/dist/src/openai-compat/tool-calls-parser.js +0 -1
  158. package/dist/src/openai-compat/tool-results-serializer.js +0 -1
  159. package/dist/src/openai-compat/tts-rule.js +0 -1
  160. package/dist/src/openai-compat/voice-recovery.js +0 -1
  161. package/dist/src/patches/cache-parity-registry.js +0 -1
  162. package/dist/src/patches/claude-md-injection.js +0 -1
  163. package/dist/src/patches/cwd-redirect.js +0 -1
  164. package/dist/src/patches/embedded-server-route.js +0 -1
  165. package/dist/src/patches/pricing-overrides.js +0 -1
  166. package/dist/src/patches/resume-registry-restore.js +0 -1
  167. package/dist/src/patches/session-pid-tracking.js +0 -1
  168. package/dist/src/patches/sysprompt-strip.js +0 -1
  169. package/dist/src/patches/tools-restoration.js +0 -1
  170. package/dist/src/persistence/migration-v0.js +0 -1
  171. package/dist/src/persistence/session-registry.js +0 -1
  172. package/dist/src/persistence/snapshot.js +0 -1
  173. package/dist/src/persistence/wal.js +0 -1
  174. package/dist/src/proxy/anthropic-adapter.js +0 -1
  175. package/dist/src/proxy/handler.js +0 -1
  176. package/dist/src/proxy/index.js +0 -1
  177. package/dist/src/proxy/schema-cleaner.js +0 -1
  178. package/dist/src/proxy/thought-cache.js +0 -1
  179. package/dist/src/session/embedded-server.js +0 -1
  180. package/dist/src/session/inbox-manager.js +0 -1
  181. package/dist/src/session/index.js +0 -1
  182. package/dist/src/session/persisted-sessions.js +0 -1
  183. package/dist/src/session/session-manager.js +0 -1
  184. package/dist/src/session/watchdogs.js +0 -1
  185. package/dist/src/session-bootstrap/boot-self-heal.js +0 -1
  186. package/dist/src/session-bootstrap/cwd-patch.js +0 -1
  187. package/dist/src/session-bootstrap/index.js +0 -1
  188. package/dist/src/session-bootstrap/resume-registry.js +0 -1
  189. package/dist/src/session-bootstrap/session-hygiene.js +0 -1
  190. package/dist/src/session-bootstrap/sysprompt-strip.js +0 -1
  191. package/dist/src/session-bootstrap/think-conflict-resolver.js +0 -1
  192. package/dist/src/types/index.js +0 -1
  193. package/dist/src/types/route.js +0 -1
  194. package/dist/src/types/runtime-config.js +0 -1
  195. package/dist/src/types/session.js +0 -1
  196. package/dist/src/types/sse.js +0 -1
  197. package/dist/src/types/tool-bridge.js +0 -1
  198. package/dist/src/types/upstream.js +0 -1
  199. package/dist/src/types.js +0 -1
  200. package/dist/src/validation.js +0 -1
  201. package/package.json +1 -1
  202. package/dist/src/channels/adapter.js.map +0 -1
  203. package/dist/src/channels/telegram/card-renderer.d.ts +0 -80
  204. package/dist/src/channels/telegram/card-renderer.js +0 -169
  205. package/dist/src/channels/telegram/card-renderer.js.map +0 -1
  206. package/dist/src/channels/telegram/completion-summary.d.ts +0 -21
  207. package/dist/src/channels/telegram/completion-summary.js +0 -218
  208. package/dist/src/channels/telegram/completion-summary.js.map +0 -1
  209. package/dist/src/channels/telegram/edit-cadence.d.ts +0 -37
  210. package/dist/src/channels/telegram/edit-cadence.js +0 -50
  211. package/dist/src/channels/telegram/edit-cadence.js.map +0 -1
  212. package/dist/src/channels/telegram/error-renderer.d.ts +0 -29
  213. package/dist/src/channels/telegram/error-renderer.js +0 -133
  214. package/dist/src/channels/telegram/error-renderer.js.map +0 -1
  215. package/dist/src/channels/telegram/event-reducer.d.ts +0 -33
  216. package/dist/src/channels/telegram/event-reducer.js +0 -647
  217. package/dist/src/channels/telegram/event-reducer.js.map +0 -1
  218. package/dist/src/channels/telegram/format-helpers.d.ts +0 -20
  219. package/dist/src/channels/telegram/format-helpers.js +0 -34
  220. package/dist/src/channels/telegram/format-helpers.js.map +0 -1
  221. package/dist/src/channels/telegram/index.d.ts +0 -13
  222. package/dist/src/channels/telegram/index.js +0 -14
  223. package/dist/src/channels/telegram/index.js.map +0 -1
  224. package/dist/src/channels/telegram/injector.d.ts +0 -53
  225. package/dist/src/channels/telegram/injector.js +0 -271
  226. package/dist/src/channels/telegram/injector.js.map +0 -1
  227. package/dist/src/channels/telegram/insight-formatter.d.ts +0 -36
  228. package/dist/src/channels/telegram/insight-formatter.js +0 -36
  229. package/dist/src/channels/telegram/insight-formatter.js.map +0 -1
  230. package/dist/src/channels/telegram/live-card.d.ts +0 -185
  231. package/dist/src/channels/telegram/live-card.js +0 -868
  232. package/dist/src/channels/telegram/live-card.js.map +0 -1
  233. package/dist/src/channels/telegram/logger.d.ts +0 -10
  234. package/dist/src/channels/telegram/logger.js +0 -13
  235. package/dist/src/channels/telegram/logger.js.map +0 -1
  236. package/dist/src/channels/telegram/result-preview.d.ts +0 -12
  237. package/dist/src/channels/telegram/result-preview.js +0 -48
  238. package/dist/src/channels/telegram/result-preview.js.map +0 -1
  239. package/dist/src/channels/telegram/speculative-bubble.d.ts +0 -33
  240. package/dist/src/channels/telegram/speculative-bubble.js +0 -42
  241. package/dist/src/channels/telegram/speculative-bubble.js.map +0 -1
  242. package/dist/src/channels/telegram/state-machine.d.ts +0 -22
  243. package/dist/src/channels/telegram/state-machine.js +0 -72
  244. package/dist/src/channels/telegram/state-machine.js.map +0 -1
  245. package/dist/src/channels/telegram/throttle-controller.d.ts +0 -88
  246. package/dist/src/channels/telegram/throttle-controller.js +0 -203
  247. package/dist/src/channels/telegram/throttle-controller.js.map +0 -1
  248. package/dist/src/channels/telegram/tool-tracker.d.ts +0 -149
  249. package/dist/src/channels/telegram/tool-tracker.js +0 -578
  250. package/dist/src/channels/telegram/tool-tracker.js.map +0 -1
  251. package/dist/src/channels/telegram-mirror/askuser.js.map +0 -1
  252. package/dist/src/channels/telegram-mirror/burst-accumulator.js.map +0 -1
  253. package/dist/src/channels/telegram-mirror/callback-mapping.js.map +0 -1
  254. package/dist/src/channels/telegram-mirror/card-renderer.js.map +0 -1
  255. package/dist/src/channels/telegram-mirror/card-state.js.map +0 -1
  256. package/dist/src/channels/telegram-mirror/commands.js.map +0 -1
  257. package/dist/src/channels/telegram-mirror/compose-buffer.js.map +0 -1
  258. package/dist/src/channels/telegram-mirror/cost-views.js.map +0 -1
  259. package/dist/src/channels/telegram-mirror/failure/callback-data-overflow.js.map +0 -1
  260. package/dist/src/channels/telegram-mirror/failure/gateway-down.js.map +0 -1
  261. package/dist/src/channels/telegram-mirror/failure/in-flight-conflict.js.map +0 -1
  262. package/dist/src/channels/telegram-mirror/failure/index.js.map +0 -1
  263. package/dist/src/channels/telegram-mirror/failure/model-5xx.js.map +0 -1
  264. package/dist/src/channels/telegram-mirror/failure/network-blip.js.map +0 -1
  265. package/dist/src/channels/telegram-mirror/failure/pool-exhausted-fallback.js.map +0 -1
  266. package/dist/src/channels/telegram-mirror/failure/rate-limit.js.map +0 -1
  267. package/dist/src/channels/telegram-mirror/failure/returning-after-24h.js.map +0 -1
  268. package/dist/src/channels/telegram-mirror/failure/types.js.map +0 -1
  269. package/dist/src/channels/telegram-mirror/inbound-handler.js.map +0 -1
  270. package/dist/src/channels/telegram-mirror/index.js.map +0 -1
  271. package/dist/src/channels/telegram-mirror/plan-attachment.js.map +0 -1
  272. package/dist/src/channels/telegram-mirror/quota-reader.js.map +0 -1
  273. package/dist/src/channels/telegram-mirror/sessions-keyboard.js.map +0 -1
  274. package/dist/src/channels/telegram-mirror/soak-log.js.map +0 -1
  275. package/dist/src/channels/telegram-mirror/state-machine.js.map +0 -1
  276. package/dist/src/channels/telegram-mirror/status-line.js.map +0 -1
  277. package/dist/src/channels/telegram-mirror/sync-commands.js.map +0 -1
  278. package/dist/src/channels/telegram-mirror/threshold-watcher.js.map +0 -1
  279. package/dist/src/channels/telegram-mirror/turn-bridge.js.map +0 -1
  280. package/dist/src/cli/checks/bridge-wiring.js.map +0 -1
  281. package/dist/src/cli/checks/config-schema.js.map +0 -1
  282. package/dist/src/cli/checks/critical-openclaw-json-keys.js.map +0 -1
  283. package/dist/src/cli/checks/install-path.js.map +0 -1
  284. package/dist/src/cli/checks/patch-scaffold.js.map +0 -1
  285. package/dist/src/cli/doctor.js.map +0 -1
  286. package/dist/src/cli/index.js.map +0 -1
  287. package/dist/src/cli/migrate.js.map +0 -1
  288. package/dist/src/command-router/cc-handler.js.map +0 -1
  289. package/dist/src/command-router/index.js.map +0 -1
  290. package/dist/src/command-router/launch-policy.js.map +0 -1
  291. package/dist/src/command-router/resume-policy.js.map +0 -1
  292. package/dist/src/command-router/turn-formatter.js.map +0 -1
  293. package/dist/src/config/drift-detector.js.map +0 -1
  294. package/dist/src/config/loader.js.map +0 -1
  295. package/dist/src/config/schema.js.map +0 -1
  296. package/dist/src/constants.js.map +0 -1
  297. package/dist/src/council/build-agent-prompt.js.map +0 -1
  298. package/dist/src/council/cleanup-worktrees.js.map +0 -1
  299. package/dist/src/council/consensus.js.map +0 -1
  300. package/dist/src/council/council.js.map +0 -1
  301. package/dist/src/council/index.js.map +0 -1
  302. package/dist/src/council/system-prompt.js.map +0 -1
  303. package/dist/src/council/write-worktree-claude-md.js.map +0 -1
  304. package/dist/src/engines/base-oneshot-session.js.map +0 -1
  305. package/dist/src/engines/heartbeat-guard.js.map +0 -1
  306. package/dist/src/engines/index.js.map +0 -1
  307. package/dist/src/engines/persistent-codex-session.js.map +0 -1
  308. package/dist/src/engines/persistent-cursor-session.js.map +0 -1
  309. package/dist/src/engines/persistent-custom-session.js.map +0 -1
  310. package/dist/src/engines/persistent-gemini-session.js.map +0 -1
  311. package/dist/src/engines/persistent-session.js.map +0 -1
  312. package/dist/src/engines/resolve-bin.js.map +0 -1
  313. package/dist/src/engines/subprocess-pool.js.map +0 -1
  314. package/dist/src/health/handler.js.map +0 -1
  315. package/dist/src/health/index.js.map +0 -1
  316. package/dist/src/health/metrics.js.map +0 -1
  317. package/dist/src/index.js.map +0 -1
  318. package/dist/src/lib/auto-recovery.js.map +0 -1
  319. package/dist/src/lib/cache-parity.js.map +0 -1
  320. package/dist/src/lib/circuit-breaker.js.map +0 -1
  321. package/dist/src/lib/config-service.js.map +0 -1
  322. package/dist/src/lib/config.js.map +0 -1
  323. package/dist/src/lib/cost-rollup.js.map +0 -1
  324. package/dist/src/lib/debounce.js.map +0 -1
  325. package/dist/src/lib/debug-tap.js.map +0 -1
  326. package/dist/src/lib/domain-error.js.map +0 -1
  327. package/dist/src/lib/drift-detector.js.map +0 -1
  328. package/dist/src/lib/env-overrides.js.map +0 -1
  329. package/dist/src/lib/error-formatter.js.map +0 -1
  330. package/dist/src/lib/error-renderer.js.map +0 -1
  331. package/dist/src/lib/heartbeat-config.js.map +0 -1
  332. package/dist/src/lib/heartbeat-workaround.js.map +0 -1
  333. package/dist/src/lib/http-agent.js.map +0 -1
  334. package/dist/src/lib/index.js.map +0 -1
  335. package/dist/src/lib/json-array.js.map +0 -1
  336. package/dist/src/lib/markdown-to-mdv2.js.map +0 -1
  337. package/dist/src/lib/markdown-v2.js.map +0 -1
  338. package/dist/src/lib/perf/async-compact.js.map +0 -1
  339. package/dist/src/lib/perf/direct-sdk.js.map +0 -1
  340. package/dist/src/lib/perf/haiku-route.js.map +0 -1
  341. package/dist/src/lib/perf/predictive-continuation.js.map +0 -1
  342. package/dist/src/lib/perf/read-batch.js.map +0 -1
  343. package/dist/src/lib/perf/skill-list-collapse.js.map +0 -1
  344. package/dist/src/lib/perf/speculative-bubble.js.map +0 -1
  345. package/dist/src/lib/perf/typing-prefetch.js.map +0 -1
  346. package/dist/src/lib/register-guard.js.map +0 -1
  347. package/dist/src/lib/req-shape-log.js.map +0 -1
  348. package/dist/src/lib/safe-upstream-probes.js.map +0 -1
  349. package/dist/src/lib/session-registry.js.map +0 -1
  350. package/dist/src/lib/spawn-async.js.map +0 -1
  351. package/dist/src/lib/stale-pid-files.js.map +0 -1
  352. package/dist/src/lib/status-tee-reader.js.map +0 -1
  353. package/dist/src/lib/sysprompt-strip.js.map +0 -1
  354. package/dist/src/lib/telegram-bot-api.js.map +0 -1
  355. package/dist/src/lib/telemetry.js.map +0 -1
  356. package/dist/src/lib/test-mode.js.map +0 -1
  357. package/dist/src/lib/trajectory.js.map +0 -1
  358. package/dist/src/lib/vendor-paths.js.map +0 -1
  359. package/dist/src/lifecycle/boot.js.map +0 -1
  360. package/dist/src/lifecycle/patch-manifest.js.map +0 -1
  361. package/dist/src/lifecycle/phase-import-upstream.js.map +0 -1
  362. package/dist/src/lifecycle/phase-install-patches.js.map +0 -1
  363. package/dist/src/lifecycle/phase-schedule-jobs.js.map +0 -1
  364. package/dist/src/lifecycle/phase-start-server.js.map +0 -1
  365. package/dist/src/lifecycle/phase-validate-config.js.map +0 -1
  366. package/dist/src/lifecycle/phase-validate-upstream.js.map +0 -1
  367. package/dist/src/lifecycle/phase-wire-handlers.js.map +0 -1
  368. package/dist/src/lifecycle/safe-restart.js.map +0 -1
  369. package/dist/src/logger.js.map +0 -1
  370. package/dist/src/mcp/bridge.js.map +0 -1
  371. package/dist/src/mcp/index.js.map +0 -1
  372. package/dist/src/models.js.map +0 -1
  373. package/dist/src/observability/event-bus.js.map +0 -1
  374. package/dist/src/observability/get-event-bus.js.map +0 -1
  375. package/dist/src/observability/observability-service.js.map +0 -1
  376. package/dist/src/observability/perf-telemetry.js.map +0 -1
  377. package/dist/src/observability/subscribers/metrics.js.map +0 -1
  378. package/dist/src/observability/subscribers/session-capture.js.map +0 -1
  379. package/dist/src/openai-compat/bridges/allowlist.js.map +0 -1
  380. package/dist/src/openai-compat/bridges/factory.js.map +0 -1
  381. package/dist/src/openai-compat/bridges/media-bridge.js.map +0 -1
  382. package/dist/src/openai-compat/bridges/openclaw-api-shim.js.map +0 -1
  383. package/dist/src/openai-compat/bridges/openclaw-native-tools.js.map +0 -1
  384. package/dist/src/openai-compat/bridges/openclaw-tool-registry.js.map +0 -1
  385. package/dist/src/openai-compat/bridges/tts-media-bridge.js.map +0 -1
  386. package/dist/src/openai-compat/cli-stream-parser.js.map +0 -1
  387. package/dist/src/openai-compat/index.js.map +0 -1
  388. package/dist/src/openai-compat/message-extractor.js.map +0 -1
  389. package/dist/src/openai-compat/mode-flags.js.map +0 -1
  390. package/dist/src/openai-compat/non-streaming-handler.js.map +0 -1
  391. package/dist/src/openai-compat/openai-chunk-types.js.map +0 -1
  392. package/dist/src/openai-compat/openai-compat.js.map +0 -1
  393. package/dist/src/openai-compat/openai-types.js.map +0 -1
  394. package/dist/src/openai-compat/parse-route-body.js.map +0 -1
  395. package/dist/src/openai-compat/prompts.js.map +0 -1
  396. package/dist/src/openai-compat/response-formatter.js.map +0 -1
  397. package/dist/src/openai-compat/session-key-resolver.js.map +0 -1
  398. package/dist/src/openai-compat/skill-resolver.js.map +0 -1
  399. package/dist/src/openai-compat/sse-translator.js.map +0 -1
  400. package/dist/src/openai-compat/status-reporter.js.map +0 -1
  401. package/dist/src/openai-compat/streaming-handler.js.map +0 -1
  402. package/dist/src/openai-compat/tool-calls-parser.js.map +0 -1
  403. package/dist/src/openai-compat/tool-results-serializer.js.map +0 -1
  404. package/dist/src/openai-compat/tts-rule.js.map +0 -1
  405. package/dist/src/openai-compat/voice-recovery.js.map +0 -1
  406. package/dist/src/patches/cache-parity-registry.js.map +0 -1
  407. package/dist/src/patches/claude-md-injection.js.map +0 -1
  408. package/dist/src/patches/cwd-redirect.js.map +0 -1
  409. package/dist/src/patches/embedded-server-route.js.map +0 -1
  410. package/dist/src/patches/pricing-overrides.js.map +0 -1
  411. package/dist/src/patches/resume-registry-restore.js.map +0 -1
  412. package/dist/src/patches/session-pid-tracking.js.map +0 -1
  413. package/dist/src/patches/sysprompt-strip.js.map +0 -1
  414. package/dist/src/patches/sysprompt-strip.spec.d.ts +0 -33
  415. package/dist/src/patches/sysprompt-strip.spec.js +0 -53
  416. package/dist/src/patches/sysprompt-strip.spec.js.map +0 -1
  417. package/dist/src/patches/tools-restoration.js.map +0 -1
  418. package/dist/src/persistence/migration-v0.js.map +0 -1
  419. package/dist/src/persistence/session-registry.js.map +0 -1
  420. package/dist/src/persistence/snapshot.js.map +0 -1
  421. package/dist/src/persistence/wal.js.map +0 -1
  422. package/dist/src/proxy/anthropic-adapter.js.map +0 -1
  423. package/dist/src/proxy/handler.js.map +0 -1
  424. package/dist/src/proxy/index.js.map +0 -1
  425. package/dist/src/proxy/schema-cleaner.js.map +0 -1
  426. package/dist/src/proxy/thought-cache.js.map +0 -1
  427. package/dist/src/session/embedded-server.js.map +0 -1
  428. package/dist/src/session/inbox-manager.js.map +0 -1
  429. package/dist/src/session/index.js.map +0 -1
  430. package/dist/src/session/persisted-sessions.js.map +0 -1
  431. package/dist/src/session/session-manager.js.map +0 -1
  432. package/dist/src/session/watchdogs.js.map +0 -1
  433. package/dist/src/session-bootstrap/boot-self-heal.js.map +0 -1
  434. package/dist/src/session-bootstrap/cwd-patch.js.map +0 -1
  435. package/dist/src/session-bootstrap/index.js.map +0 -1
  436. package/dist/src/session-bootstrap/resume-registry.js.map +0 -1
  437. package/dist/src/session-bootstrap/session-hygiene.js.map +0 -1
  438. package/dist/src/session-bootstrap/sysprompt-strip.js.map +0 -1
  439. package/dist/src/session-bootstrap/think-conflict-resolver.js.map +0 -1
  440. package/dist/src/types/index.js.map +0 -1
  441. package/dist/src/types/route.js.map +0 -1
  442. package/dist/src/types/runtime-config.js.map +0 -1
  443. package/dist/src/types/session.js.map +0 -1
  444. package/dist/src/types/sse.js.map +0 -1
  445. package/dist/src/types/tool-bridge.js.map +0 -1
  446. package/dist/src/types/upstream.js.map +0 -1
  447. package/dist/src/types.js.map +0 -1
  448. package/dist/src/validation.js.map +0 -1
@@ -35,4 +35,3 @@
35
35
  export function registerChannelAdapter(api, adapter) {
36
36
  adapter.register(api);
37
37
  }
38
- //# sourceMappingURL=adapter.js.map
@@ -22,6 +22,7 @@
22
22
  */
23
23
  import { CallbackMap } from './callback-mapping.js';
24
24
  import { sendTg, editTg, telegramApi } from '../../lib/telegram-bot-api.js';
25
+ import { escapeHtml } from '../../lib/html-render.js';
25
26
  /** Namespace prefix for callback_data so api.registerInteractiveHandler routes
26
27
  * taps here. Matched at the first ':' by the gateway (must be [A-Za-z0-9._-]+). */
27
28
  export const ASKUSER_NS = 'ccmirror';
@@ -74,21 +75,34 @@ export function parseFirstQuestion(input) {
74
75
  function shortQid() {
75
76
  return Math.random().toString(36).slice(2, 8);
76
77
  }
78
+ /**
79
+ * v0.27.0 M3 — render the question body as organized Telegram HTML (bold header,
80
+ * numbered options with italic descriptions). All dynamic text is HTML-escaped
81
+ * (the send path uses parse_mode HTML since M1, so a stray < in a question would
82
+ * otherwise break the message). Mirrors the CLI's clean option layout.
83
+ */
77
84
  function bodyText(s) {
78
- const lines = [`❓ ${s.header}`, s.question];
79
- // v0.26.4 polish — list options with their descriptions in the body (buttons
80
- // only show the label, so descriptions would otherwise be lost).
85
+ const lines = [`❓ <b>${escapeHtml(s.header)}</b>`, escapeHtml(s.question)];
86
+ // List options with their descriptions in the body (buttons only show the
87
+ // label, so descriptions would otherwise be lost).
81
88
  const described = s.options.filter((o) => o.description);
82
89
  if (described.length > 0) {
83
90
  lines.push('');
84
91
  s.options.forEach((o, i) => {
85
- lines.push(o.description ? `${i + 1}. ${o.label} — ${o.description}` : `${i + 1}. ${o.label}`);
92
+ const n = `<b>${i + 1}.</b>`;
93
+ lines.push(o.description
94
+ ? `${n} ${escapeHtml(o.label)} — <i>${escapeHtml(o.description)}</i>`
95
+ : `${n} ${escapeHtml(o.label)}`);
86
96
  });
87
97
  }
88
98
  if (s.multiSelect)
89
- lines.push('', '(select one or more, then Submit)');
99
+ lines.push('', '<i>(select one or more, then Submit)</i>');
90
100
  return lines.join('\n');
91
101
  }
102
+ /** v0.27.0 M3 — HTML-safe "you chose" confirmation shown after a tap. */
103
+ function chosenText(s, chosen) {
104
+ return `❓ <b>${escapeHtml(s.header)}</b>\n${escapeHtml(s.question)}\n\n✓ You chose: <b>${escapeHtml(chosen)}</b>`;
105
+ }
92
106
  /** Build the inline keyboard for a question. callback_data is
93
107
  * `ccmirror:<CallbackMap id>` so the gateway routes taps to our handler. */
94
108
  function buildKeyboard(qid, s) {
@@ -216,7 +230,7 @@ export async function handleTap(ctx, api) {
216
230
  if (payload.kind === 'opt' && !s.multiSelect) {
217
231
  const label = s.options[payload.idx]?.label ?? '';
218
232
  await answerCb(ctx, `Selected: ${label}`);
219
- await editQ(s, `❓ ${s.header}\n${s.question}\n\n✓ You chose: ${label}`);
233
+ await editQ(s, chosenText(s, label));
220
234
  injectAnswer(api, ctx, label);
221
235
  _questions.delete(payload.qid);
222
236
  return;
@@ -237,7 +251,7 @@ export async function handleTap(ctx, api) {
237
251
  return;
238
252
  }
239
253
  await answerCb(ctx, `Submitted ${labels.length}`);
240
- await editQ(s, `❓ ${s.header}\n${s.question}\n\n✓ You chose: ${labels.join(', ')}`);
254
+ await editQ(s, chosenText(s, labels.join(', ')));
241
255
  injectAnswer(api, ctx, labels.join(', '));
242
256
  _questions.delete(payload.qid);
243
257
  return;
@@ -271,4 +285,3 @@ export function _resetAskUserForTests() {
271
285
  export function _pendingCount() {
272
286
  return _questions.size;
273
287
  }
274
- //# sourceMappingURL=askuser.js.map
@@ -127,4 +127,3 @@ export class BurstAccumulator {
127
127
  return session.pending.map((p) => p.text).join(this.separator);
128
128
  }
129
129
  }
130
- //# sourceMappingURL=burst-accumulator.js.map
@@ -96,4 +96,3 @@ export class CallbackMap {
96
96
  return base36.padStart(this.idLength, '0').slice(0, this.idLength);
97
97
  }
98
98
  }
99
- //# sourceMappingURL=callback-mapping.js.map
@@ -14,6 +14,18 @@
14
14
  * Tests live at tests/channels/telegram-mirror/m2-render-pipeline.test.ts.
15
15
  */
16
16
  import { renderStatusLine, renderMeters, renderTodos } from './status-line.js';
17
+ import { escapeHtml, code, pre, markdownToHtml } from '../../lib/html-render.js';
18
+ // v0.27.0 M1 — the card renders as Telegram HTML (parse_mode: 'HTML'), not
19
+ // MarkdownV2. HTML only needs `& < >` escaped (no per-char backslash litter)
20
+ // and supports <pre><code class="language-…"> + <blockquote> for true
21
+ // CLI-fidelity. escapeHtml / code() / markdownToHtml come from lib/html-render.
22
+ /** Last path segment (basename) — keeps tool lines short and CLI-like, e.g.
23
+ * "/home/a1/kris-kitchen/components/ShoppingList.tsx" → "ShoppingList.tsx". */
24
+ function basename(p) {
25
+ const cleaned = p.replace(/\/+$/, '');
26
+ const idx = cleaned.lastIndexOf('/');
27
+ return idx >= 0 ? cleaned.slice(idx + 1) : cleaned;
28
+ }
17
29
  /**
18
30
  * Glyph picked per tool-call status. Mirrors terminal "running / done /
19
31
  * errored" iconography that A1 already reads in the live Claude Code TUI.
@@ -28,25 +40,78 @@ function toolGlyph(tc) {
28
40
  /**
29
41
  * Render the input argument summary for a tool call. Kept tight — full
30
42
  * input is in the result; the mirror line is meant to read at a glance.
43
+ * Returns RAW (unescaped) text; the caller wraps it in a code span.
44
+ *
45
+ * v0.26.5: collapse embedded whitespace/newlines to single spaces (a
46
+ * multi-line Bash command used to spill across several card rows), prefer the
47
+ * basename for file paths (shorter + CLI-like), and truncate with a single "…".
31
48
  */
32
49
  function toolInputSummary(tc) {
33
50
  const input = tc.input;
34
51
  if (!input || typeof input !== 'object')
35
52
  return '';
36
- // Prefer common single-field shapes used by Bash/Read/Edit/Write.
37
- const single = typeof input.command === 'string'
53
+ // Prefer common single-field shapes used by Bash/Read/Edit/Write/Grep/Glob.
54
+ const raw = typeof input.command === 'string'
38
55
  ? input.command
39
56
  : typeof input.file_path === 'string'
40
- ? input.file_path
57
+ ? basename(input.file_path)
41
58
  : typeof input.path === 'string'
42
- ? input.path
43
- : typeof input.url === 'string'
44
- ? input.url
45
- : '';
46
- if (single) {
47
- return single.length > 60 ? single.slice(0, 57) + '...' : single;
59
+ ? basename(input.path)
60
+ : typeof input.pattern === 'string'
61
+ ? input.pattern
62
+ : typeof input.url === 'string'
63
+ ? input.url
64
+ : '';
65
+ if (!raw)
66
+ return '';
67
+ const collapsed = raw.replace(/\s+/g, ' ').trim();
68
+ return collapsed.length > 48 ? collapsed.slice(0, 47) + '…' : collapsed;
69
+ }
70
+ /**
71
+ * v0.27.0 M2 — coerce a tool's RESULT payload to display text. Claude delivers
72
+ * tool_result content as a string OR an array of `{type:'text',text}` blocks
73
+ * (via the persistent-session user-message extraction). Returns trimmed text, or
74
+ * '' when there's nothing real to show (no-fake-data — never stringify objects).
75
+ */
76
+ function toolResultText(tc) {
77
+ const r = tc.result;
78
+ if (r == null)
79
+ return '';
80
+ let s = '';
81
+ if (typeof r === 'string') {
82
+ s = r;
83
+ }
84
+ else if (Array.isArray(r)) {
85
+ s = r
86
+ .map((b) => {
87
+ if (typeof b === 'string')
88
+ return b;
89
+ if (b && typeof b === 'object' && typeof b.text === 'string') {
90
+ return b.text;
91
+ }
92
+ return '';
93
+ })
94
+ .join('');
95
+ }
96
+ return s.trim();
97
+ }
98
+ /**
99
+ * v0.27.0 M2 — truncate result text for the card: at most RESULT_MAX_LINES lines
100
+ * and RESULT_MAX_CHARS chars, with a trailing "…" when cut. Keeps the card
101
+ * readable (Telegram's 4096-char message cap) while still surfacing tool output
102
+ * the way the CLI shows it inline.
103
+ */
104
+ const RESULT_MAX_LINES = 3;
105
+ const RESULT_MAX_CHARS = 200;
106
+ function truncateResult(s) {
107
+ const lines = s.split('\n');
108
+ let cut = lines.length > RESULT_MAX_LINES;
109
+ let out = lines.slice(0, RESULT_MAX_LINES).join('\n');
110
+ if (out.length > RESULT_MAX_CHARS) {
111
+ out = out.slice(0, RESULT_MAX_CHARS);
112
+ cut = true;
48
113
  }
49
- return '';
114
+ return cut ? out.replace(/\s+$/, '') + '\n…' : out;
50
115
  }
51
116
  /**
52
117
  * Format one tool-call line for inclusion in the rendered card body.
@@ -87,8 +152,11 @@ export function toolIcon(name) {
87
152
  export function renderToolLine(tc) {
88
153
  const glyph = toolGlyph(tc);
89
154
  const icon = toolIcon(tc.name);
155
+ // Status glyph + emoji are HTML-safe; the tool name is HTML-escaped and the
156
+ // input detail rides in a <code> span (v0.27.0 M1 HTML styling).
157
+ const name = escapeHtml(tc.name);
90
158
  const summary = toolInputSummary(tc);
91
- return summary ? `${glyph} ${icon} ${tc.name} · ${summary}` : `${glyph} ${icon} ${tc.name}`;
159
+ return summary ? `${glyph} ${icon} ${name} · ${code(summary)}` : `${glyph} ${icon} ${name}`;
92
160
  }
93
161
  /**
94
162
  * Render the thinking block (M6). Each line of the thinking text is
@@ -100,8 +168,14 @@ export function renderThinkingBlock(thinkingText) {
100
168
  const trimmed = thinkingText.trim();
101
169
  if (trimmed.length === 0)
102
170
  return '';
103
- const lines = trimmed.split('\n');
104
- return ['💭 Thinking', ...lines.map((l) => `> ${l}`)].join('\n');
171
+ // v0.27.0 M1 — Telegram HTML <blockquote> renders the reasoning as a single
172
+ // indented quote (terminal-style), distinct from the assistant text. Content
173
+ // is HTML-escaped; newlines are preserved inside the blockquote.
174
+ const body = trimmed
175
+ .split('\n')
176
+ .map((l) => escapeHtml(l))
177
+ .join('\n');
178
+ return `💭 Thinking\n<blockquote>${body}</blockquote>`;
105
179
  }
106
180
  /**
107
181
  * Render the full turn into a Telegram-safe message body. The mirror keeps
@@ -133,30 +207,46 @@ export function renderTurn(turn, meta) {
133
207
  // handler calls setCardMeta(), the status line appears on the next repaint.
134
208
  if (meta) {
135
209
  const status = renderStatusLine(turn, meta);
210
+ // v0.27.0 M1 — bold the status line (the card header) via HTML <b>. Content
211
+ // HTML-escaped first ( & < > only — model/version dots & brackets are safe).
136
212
  if (status)
137
- lines.push(status);
213
+ lines.push(`<b>${escapeHtml(status)}</b>`);
138
214
  // v0.26.2 M2 — meter row (context % + quota % + reset). Same no-fake-data
139
- // gating: omitted unless real values are present.
215
+ // gating: omitted unless real values are present. HTML-escaped for safety.
140
216
  const meters = renderMeters(meta);
141
217
  if (meters)
142
- lines.push(meters);
218
+ lines.push(escapeHtml(meters));
143
219
  // v0.26.4 styling — divider between the status/telemetry block and the
144
- // activity block (only when a status block was actually rendered).
220
+ // activity block (only when a status block was actually rendered). The
221
+ // heavy-bar glyph is not HTML-significant, so it needs no escaping.
145
222
  if (lines.length > 0)
146
223
  lines.push('━━━━━━━━━━━━');
147
224
  }
148
- const header = turn.state === 'done' ? '✓ Done' : '▶ Working';
225
+ // Turn-status header. v0.27.0 M4 a failed turn shows "❌ <reason>" so it
226
+ // never dies as an eternal "…"; reason is HTML-escaped (it's an error message).
227
+ const header = turn.state === 'failed'
228
+ ? `❌ ${escapeHtml(turn.failReason ?? 'Turn failed')}`
229
+ : turn.state === 'done'
230
+ ? '✓ Done'
231
+ : '▶ Working';
149
232
  lines.push(header);
150
233
  if (turn.toolCalls.length > 0) {
151
234
  for (const tc of turn.toolCalls) {
152
235
  lines.push(renderToolLine(tc));
236
+ // v0.27.0 M2 — surface the tool's RESULT as a truncated <pre><code> block
237
+ // under its line (CLI-style inline output), when there's real text.
238
+ const resultText = toolResultText(tc);
239
+ if (resultText)
240
+ lines.push(pre(truncateResult(resultText)));
153
241
  }
154
242
  }
155
243
  // v0.26.2 M4 — todo checklist (real data from the agent's TodoWrite calls).
244
+ // Escaped as a block (glyphs are safe; content + the "+N more" plus sign are
245
+ // not, so the whole block goes through the escaper).
156
246
  const todoBlock = renderTodos(meta);
157
247
  if (todoBlock) {
158
248
  lines.push('');
159
- lines.push(todoBlock);
249
+ lines.push(escapeHtml(todoBlock));
160
250
  }
161
251
  // Defensive default — Turn.thinkingText is required by the interface, but
162
252
  // some test helpers and pre-M6 fixtures construct Turn-shaped objects
@@ -169,7 +259,10 @@ export function renderTurn(turn, meta) {
169
259
  const text = turn.assistantText.trim();
170
260
  if (text.length > 0) {
171
261
  lines.push('');
172
- lines.push(text);
262
+ // v0.27.0 M1 — render the model's markdown as Telegram HTML with structure
263
+ // preserved (**bold**→<b>, `code`→<code>, ```bash fences→<pre><code
264
+ // class="language-bash">). HTML-escapes all remaining content (& < >).
265
+ lines.push(markdownToHtml(text));
173
266
  }
174
267
  return lines.join('\n');
175
268
  }
@@ -185,4 +278,3 @@ export function planRenderAction(turn, knownMessageId) {
185
278
  }
186
279
  return { type: 'edit', chatId: turn.chatId, text, messageId: knownMessageId };
187
280
  }
188
- //# sourceMappingURL=card-renderer.js.map
@@ -46,4 +46,3 @@ export const cardState = _g[CARD_STATE_KEY] ?? (_g[CARD_STATE_KEY] = new Map());
46
46
  export function cardStateDebug() {
47
47
  return `cards=${cardState.size}`;
48
48
  }
49
- //# sourceMappingURL=card-state.js.map
@@ -386,4 +386,3 @@ export function dispatchCommand(parsed, ctxBase) {
386
386
  return undefined;
387
387
  return handler({ ...ctxBase, args: parsed.args });
388
388
  }
389
- //# sourceMappingURL=commands.js.map
@@ -107,4 +107,3 @@ export class ComposeBuffer {
107
107
  return this.now() - session.startedAt > this.timeoutMs;
108
108
  }
109
109
  }
110
- //# sourceMappingURL=compose-buffer.js.map
@@ -118,4 +118,3 @@ export function createStatusTeeQuotaReader(reader = readStatusTeeQuotaSnapshot)
118
118
  },
119
119
  };
120
120
  }
121
- //# sourceMappingURL=cost-views.js.map
@@ -27,4 +27,3 @@ export const handle = (ctx, info) => {
27
27
  },
28
28
  ];
29
29
  };
30
- //# sourceMappingURL=callback-data-overflow.js.map
@@ -24,4 +24,3 @@ export const handle = (ctx, info) => {
24
24
  ];
25
25
  return actions;
26
26
  };
27
- //# sourceMappingURL=gateway-down.js.map
@@ -24,4 +24,3 @@ export const handle = (ctx, info) => {
24
24
  },
25
25
  ];
26
26
  };
27
- //# sourceMappingURL=in-flight-conflict.js.map
@@ -32,4 +32,3 @@ export const FAILURE_MODULES = [
32
32
  * to fire a handler by name.
33
33
  */
34
34
  export const FAILURE_BY_MODE = Object.fromEntries(FAILURE_MODULES.map((m) => [m.META.mode, m]));
35
- //# sourceMappingURL=index.js.map
@@ -21,4 +21,3 @@ export const handle = (ctx, info) => {
21
21
  },
22
22
  ];
23
23
  };
24
- //# sourceMappingURL=model-5xx.js.map
@@ -22,4 +22,3 @@ export const handle = (ctx, info) => {
22
22
  },
23
23
  ];
24
24
  };
25
- //# sourceMappingURL=network-blip.js.map
@@ -21,4 +21,3 @@ export const handle = (ctx, info) => {
21
21
  },
22
22
  ];
23
23
  };
24
- //# sourceMappingURL=pool-exhausted-fallback.js.map
@@ -23,4 +23,3 @@ export const handle = (ctx, info) => {
23
23
  },
24
24
  ];
25
25
  };
26
- //# sourceMappingURL=rate-limit.js.map
@@ -30,4 +30,3 @@ export const handle = (ctx, info) => {
30
30
  },
31
31
  ];
32
32
  };
33
- //# sourceMappingURL=returning-after-24h.js.map
@@ -6,4 +6,3 @@
6
6
  * shared types so the 8 handler modules stay tight (each ~30-50 lines).
7
7
  */
8
8
  export {};
9
- //# sourceMappingURL=types.js.map
@@ -484,4 +484,3 @@ export function registerInboundHandler(api, state = createHandlerState()) {
484
484
  process.stderr.write(`${PLUGIN_TAG} subscribed to before_dispatch — ${MIRROR_COMMANDS.size} commands armed.\n`);
485
485
  return state;
486
486
  }
487
- //# sourceMappingURL=inbound-handler.js.map
@@ -89,4 +89,3 @@ export function register(api) {
89
89
  }
90
90
  });
91
91
  }
92
- //# sourceMappingURL=index.js.map
@@ -135,4 +135,3 @@ export class RejectFeedbackTracker {
135
135
  export function formatApprovePayload(planId) {
136
136
  return `<plan approved: ${planId}>`;
137
137
  }
138
- //# sourceMappingURL=plan-attachment.js.map
@@ -26,4 +26,3 @@ export const stubQuotaReader = {
26
26
  };
27
27
  },
28
28
  };
29
- //# sourceMappingURL=quota-reader.js.map
@@ -110,4 +110,3 @@ export function assertCallbackDataBudget(keyboard) {
110
110
  }
111
111
  }
112
112
  }
113
- //# sourceMappingURL=sessions-keyboard.js.map
@@ -133,4 +133,3 @@ export class SoakLogger {
133
133
  return out;
134
134
  }
135
135
  }
136
- //# sourceMappingURL=soak-log.js.map
@@ -38,7 +38,7 @@ export interface StreamEvent {
38
38
  error?: unknown;
39
39
  result?: string;
40
40
  }
41
- export type TurnState = 'working' | 'done';
41
+ export type TurnState = 'working' | 'done' | 'failed';
42
42
  export interface ToolCallRecord {
43
43
  /** Tool name (e.g. "Bash", "Read", "Edit"). */
44
44
  name: string;
@@ -58,8 +58,11 @@ export interface Turn {
58
58
  state: TurnState;
59
59
  /** Monotonic timestamp (Date.now()) when the turn started. */
60
60
  startedAt: number;
61
- /** Set when the turn transitions to 'done'. */
61
+ /** Set when the turn transitions to 'done' or 'failed'. */
62
62
  endedAt?: number;
63
+ /** Set when the turn transitions to 'failed' (M4) — a short failure reason
64
+ * surfaced on the card so a turn never dies as an eternal "…". */
65
+ failReason?: string;
63
66
  /** Tool calls observed during the turn, in arrival order. */
64
67
  toolCalls: ToolCallRecord[];
65
68
  /** Accumulated assistant text (concatenation of text events). */
@@ -90,6 +93,13 @@ export declare class TurnStateMachine {
90
93
  * endedAt. Returns the finalized turn, or undefined if no turn was active.
91
94
  */
92
95
  end(chatId: string, now?: number): Turn | undefined;
96
+ /**
97
+ * Fail the active turn for chatId (M4). Transitions state to 'failed', stamps
98
+ * endedAt, and records a short reason so renderTurn can show "❌ <reason>"
99
+ * instead of leaving the card frozen at "…". Returns the failed turn, or
100
+ * undefined if no turn was active.
101
+ */
102
+ fail(chatId: string, reason: string, now?: number): Turn | undefined;
93
103
  /**
94
104
  * Returns the active or most-recently-ended turn for chatId.
95
105
  */
@@ -52,10 +52,30 @@ export class TurnStateMachine {
52
52
  if (turn.state !== 'working')
53
53
  return turn;
54
54
  if (event.type === 'tool_use') {
55
+ const id = event.id ?? event.tool_use_id ?? '';
56
+ // Dedup by tool-use id. claude.exe emits each tool_use TWICE — once at
57
+ // `content_block_start` with empty input, then again in the aggregate
58
+ // `assistant` message with the fully-assembled input. Both fires carry
59
+ // the same block id. Without this guard the card shows every tool twice
60
+ // (a bare line + a detailed line), doubles the 🔧 count, and the
61
+ // tool_result `.find()` below resolves only the FIRST record so the
62
+ // detailed line never flips … → ✓. Merge the richer payload into the
63
+ // existing record instead of pushing a duplicate.
64
+ if (id) {
65
+ const existing = turn.toolCalls.find((tc) => tc.toolUseId === id);
66
+ if (existing) {
67
+ const incoming = event.tool?.input;
68
+ if (incoming && Object.keys(incoming).length > 0)
69
+ existing.input = incoming;
70
+ if (existing.name === 'Unknown' && event.tool?.name)
71
+ existing.name = event.tool.name;
72
+ return turn;
73
+ }
74
+ }
55
75
  turn.toolCalls.push({
56
76
  name: event.tool?.name ?? 'Unknown',
57
77
  input: event.tool?.input ?? {},
58
- toolUseId: event.id ?? event.tool_use_id ?? '',
78
+ toolUseId: id,
59
79
  });
60
80
  return turn;
61
81
  }
@@ -100,6 +120,21 @@ export class TurnStateMachine {
100
120
  turn.endedAt = now;
101
121
  return turn;
102
122
  }
123
+ /**
124
+ * Fail the active turn for chatId (M4). Transitions state to 'failed', stamps
125
+ * endedAt, and records a short reason so renderTurn can show "❌ <reason>"
126
+ * instead of leaving the card frozen at "…". Returns the failed turn, or
127
+ * undefined if no turn was active.
128
+ */
129
+ fail(chatId, reason, now = Date.now()) {
130
+ const turn = this.turns.get(chatId);
131
+ if (!turn)
132
+ return undefined;
133
+ turn.state = 'failed';
134
+ turn.failReason = reason;
135
+ turn.endedAt = now;
136
+ return turn;
137
+ }
103
138
  /**
104
139
  * Returns the active or most-recently-ended turn for chatId.
105
140
  */
@@ -114,4 +149,3 @@ export class TurnStateMachine {
114
149
  this.turns.delete(chatId);
115
150
  }
116
151
  }
117
- //# sourceMappingURL=state-machine.js.map
@@ -165,4 +165,3 @@ export function renderTodos(meta) {
165
165
  lines.push(` +${todos.length - TODO_MAX} more`);
166
166
  return lines.join('\n');
167
167
  }
168
- //# sourceMappingURL=status-line.js.map
@@ -48,4 +48,3 @@ export async function syncMyCommands(opts) {
48
48
  export function _resetSyncedForTests() {
49
49
  synced = false;
50
50
  }
51
- //# sourceMappingURL=sync-commands.js.map
@@ -74,4 +74,3 @@ export class ThresholdWatcher {
74
74
  return this.thresholds;
75
75
  }
76
76
  }
77
- //# sourceMappingURL=threshold-watcher.js.map
@@ -80,6 +80,23 @@ export declare function pushAssistantText(text: string): void;
80
80
  * finalizes ALL active cards (one at a time in practice).
81
81
  */
82
82
  export declare function finalizeActiveCards(): Promise<void>;
83
+ /**
84
+ * Map a caught error to a short, user-readable card reason (v0.27.0 M4). Keeps
85
+ * the "❌ <reason>" header concise and classifies the common cc-openclaw-side
86
+ * failures (its own watchdog kill / dead subprocess / timeout) rather than
87
+ * dumping a raw stack.
88
+ */
89
+ export declare function classifyFailure(err: unknown): string;
90
+ /**
91
+ * Fail every active card (v0.27.0 M4). Called from the openai-compat handlers'
92
+ * catch path when cc-openclaw's OWN turn errors — its subprocess died, its
93
+ * stalled-session watchdog SIGTERMed it, or the model call threw/timed out. The
94
+ * card flips to "❌ <reason>" instead of being left as an eternal "…" (or worse,
95
+ * finalized to a misleading "✓ Done"). Scoped to cc-openclaw's own vantage; the
96
+ * gateway's recovery=none stalls that never throw here are out of M4's reach.
97
+ * Best-effort: a fail-render failure must not mask the original error.
98
+ */
99
+ export declare function failActiveCards(reason: string): Promise<void>;
83
100
  /**
84
101
  * Test-only — reset module-level repaint state. Card state lives in
85
102
  * card-state.ts so import that and clear directly if your test needs it.