charness 0.0.0-stage → 3.0.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 (988) hide show
  1. package/.env.example +88 -0
  2. package/DEVELOPMENT.md +110 -0
  3. package/LICENSE +21 -0
  4. package/MIGRATION_1_TO_2.md +24 -0
  5. package/README.md +1024 -2
  6. package/dist/accessControl.d.ts +71 -0
  7. package/dist/accessControl.d.ts.map +1 -0
  8. package/dist/accessControl.js +108 -0
  9. package/dist/accessControl.js.map +1 -0
  10. package/dist/adapters/adapterEventRouting.d.ts +51 -0
  11. package/dist/adapters/adapterEventRouting.d.ts.map +1 -0
  12. package/dist/adapters/adapterEventRouting.js +74 -0
  13. package/dist/adapters/adapterEventRouting.js.map +1 -0
  14. package/dist/adapters/adapterNames.d.ts +19 -0
  15. package/dist/adapters/adapterNames.d.ts.map +1 -0
  16. package/dist/adapters/adapterNames.js +25 -0
  17. package/dist/adapters/adapterNames.js.map +1 -0
  18. package/dist/adapters/claudeCliAdapter.d.ts +1336 -0
  19. package/dist/adapters/claudeCliAdapter.d.ts.map +1 -0
  20. package/dist/adapters/claudeCliAdapter.js +4204 -0
  21. package/dist/adapters/claudeCliAdapter.js.map +1 -0
  22. package/dist/adapters/claudeJsonStreamAdapter.d.ts +548 -0
  23. package/dist/adapters/claudeJsonStreamAdapter.d.ts.map +1 -0
  24. package/dist/adapters/claudeJsonStreamAdapter.js +1810 -0
  25. package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -0
  26. package/dist/adapters/claudePlatformFlags.d.ts +35 -0
  27. package/dist/adapters/claudePlatformFlags.d.ts.map +1 -0
  28. package/dist/adapters/claudePlatformFlags.js +46 -0
  29. package/dist/adapters/claudePlatformFlags.js.map +1 -0
  30. package/dist/adapters/createAdapter.d.ts +252 -0
  31. package/dist/adapters/createAdapter.d.ts.map +1 -0
  32. package/dist/adapters/createAdapter.js +475 -0
  33. package/dist/adapters/createAdapter.js.map +1 -0
  34. package/dist/adapters/openCodeAdapter.d.ts +1446 -0
  35. package/dist/adapters/openCodeAdapter.d.ts.map +1 -0
  36. package/dist/adapters/openCodeAdapter.js +4540 -0
  37. package/dist/adapters/openCodeAdapter.js.map +1 -0
  38. package/dist/adapters/sessionLaunchDefaults.d.ts +28 -0
  39. package/dist/adapters/sessionLaunchDefaults.d.ts.map +1 -0
  40. package/dist/adapters/sessionLaunchDefaults.js +15 -0
  41. package/dist/adapters/sessionLaunchDefaults.js.map +1 -0
  42. package/dist/adapters/terminalAdapter.d.ts +68 -0
  43. package/dist/adapters/terminalAdapter.d.ts.map +1 -0
  44. package/dist/adapters/terminalAdapter.js +371 -0
  45. package/dist/adapters/terminalAdapter.js.map +1 -0
  46. package/dist/agentLogin/agentLogin.d.ts +31 -0
  47. package/dist/agentLogin/agentLogin.d.ts.map +1 -0
  48. package/dist/agentLogin/agentLogin.js +493 -0
  49. package/dist/agentLogin/agentLogin.js.map +1 -0
  50. package/dist/agentTrigger.d.ts +28 -0
  51. package/dist/agentTrigger.d.ts.map +1 -0
  52. package/dist/agentTrigger.js +53 -0
  53. package/dist/agentTrigger.js.map +1 -0
  54. package/dist/apiErrorRetry.d.ts +209 -0
  55. package/dist/apiErrorRetry.d.ts.map +1 -0
  56. package/dist/apiErrorRetry.js +351 -0
  57. package/dist/apiErrorRetry.js.map +1 -0
  58. package/dist/apiRetryKick.d.ts +148 -0
  59. package/dist/apiRetryKick.d.ts.map +1 -0
  60. package/dist/apiRetryKick.js +158 -0
  61. package/dist/apiRetryKick.js.map +1 -0
  62. package/dist/bootClassifier.d.ts +46 -0
  63. package/dist/bootClassifier.d.ts.map +1 -0
  64. package/dist/bootClassifier.js +43 -0
  65. package/dist/bootClassifier.js.map +1 -0
  66. package/dist/bot.d.ts +207 -0
  67. package/dist/bot.d.ts.map +1 -0
  68. package/dist/bot.js +10611 -0
  69. package/dist/bot.js.map +1 -0
  70. package/dist/botFileStorage.d.ts +60 -0
  71. package/dist/botFileStorage.d.ts.map +1 -0
  72. package/dist/botFileStorage.js +205 -0
  73. package/dist/botFileStorage.js.map +1 -0
  74. package/dist/cli/applyDnsFix.d.ts +7 -0
  75. package/dist/cli/applyDnsFix.d.ts.map +1 -0
  76. package/dist/cli/applyDnsFix.js +46 -0
  77. package/dist/cli/applyDnsFix.js.map +1 -0
  78. package/dist/cli/bot.d.ts +27 -0
  79. package/dist/cli/bot.d.ts.map +1 -0
  80. package/dist/cli/bot.js +98 -0
  81. package/dist/cli/bot.js.map +1 -0
  82. package/dist/cli/botEntry.d.ts +3 -0
  83. package/dist/cli/botEntry.d.ts.map +1 -0
  84. package/dist/cli/botEntry.js +11 -0
  85. package/dist/cli/botEntry.js.map +1 -0
  86. package/dist/cli/connectorGuards.d.ts +31 -0
  87. package/dist/cli/connectorGuards.d.ts.map +1 -0
  88. package/dist/cli/connectorGuards.js +159 -0
  89. package/dist/cli/connectorGuards.js.map +1 -0
  90. package/dist/cli/envLoader.d.ts +34 -0
  91. package/dist/cli/envLoader.d.ts.map +1 -0
  92. package/dist/cli/envLoader.js +132 -0
  93. package/dist/cli/envLoader.js.map +1 -0
  94. package/dist/cli/hot.d.ts +82 -0
  95. package/dist/cli/hot.d.ts.map +1 -0
  96. package/dist/cli/hot.js +323 -0
  97. package/dist/cli/hot.js.map +1 -0
  98. package/dist/cli.d.ts +3 -0
  99. package/dist/cli.d.ts.map +1 -0
  100. package/dist/cli.js +130 -0
  101. package/dist/cli.js.map +1 -0
  102. package/dist/connectors/jira/adf.d.ts +72 -0
  103. package/dist/connectors/jira/adf.d.ts.map +1 -0
  104. package/dist/connectors/jira/adf.js +407 -0
  105. package/dist/connectors/jira/adf.js.map +1 -0
  106. package/dist/connectors/jira/agentBinaries.d.ts +14 -0
  107. package/dist/connectors/jira/agentBinaries.d.ts.map +1 -0
  108. package/dist/connectors/jira/agentBinaries.js +75 -0
  109. package/dist/connectors/jira/agentBinaries.js.map +1 -0
  110. package/dist/connectors/jira/answerSink.d.ts +52 -0
  111. package/dist/connectors/jira/answerSink.d.ts.map +1 -0
  112. package/dist/connectors/jira/answerSink.js +220 -0
  113. package/dist/connectors/jira/answerSink.js.map +1 -0
  114. package/dist/connectors/jira/attachmentDownload.d.ts +41 -0
  115. package/dist/connectors/jira/attachmentDownload.d.ts.map +1 -0
  116. package/dist/connectors/jira/attachmentDownload.js +92 -0
  117. package/dist/connectors/jira/attachmentDownload.js.map +1 -0
  118. package/dist/connectors/jira/attachmentTool.d.ts +43 -0
  119. package/dist/connectors/jira/attachmentTool.d.ts.map +1 -0
  120. package/dist/connectors/jira/attachmentTool.js +150 -0
  121. package/dist/connectors/jira/attachmentTool.js.map +1 -0
  122. package/dist/connectors/jira/client.d.ts +490 -0
  123. package/dist/connectors/jira/client.d.ts.map +1 -0
  124. package/dist/connectors/jira/client.js +453 -0
  125. package/dist/connectors/jira/client.js.map +1 -0
  126. package/dist/connectors/jira/config.d.ts +117 -0
  127. package/dist/connectors/jira/config.d.ts.map +1 -0
  128. package/dist/connectors/jira/config.js +350 -0
  129. package/dist/connectors/jira/config.js.map +1 -0
  130. package/dist/connectors/jira/configFile.d.ts +10 -0
  131. package/dist/connectors/jira/configFile.d.ts.map +1 -0
  132. package/dist/connectors/jira/configFile.js +50 -0
  133. package/dist/connectors/jira/configFile.js.map +1 -0
  134. package/dist/connectors/jira/connector.d.ts +68 -0
  135. package/dist/connectors/jira/connector.d.ts.map +1 -0
  136. package/dist/connectors/jira/connector.js +257 -0
  137. package/dist/connectors/jira/connector.js.map +1 -0
  138. package/dist/connectors/jira/contextLedger.d.ts +59 -0
  139. package/dist/connectors/jira/contextLedger.d.ts.map +1 -0
  140. package/dist/connectors/jira/contextLedger.js +194 -0
  141. package/dist/connectors/jira/contextLedger.js.map +1 -0
  142. package/dist/connectors/jira/contextPreamble.d.ts +18 -0
  143. package/dist/connectors/jira/contextPreamble.d.ts.map +1 -0
  144. package/dist/connectors/jira/contextPreamble.js +31 -0
  145. package/dist/connectors/jira/contextPreamble.js.map +1 -0
  146. package/dist/connectors/jira/inbound.d.ts +132 -0
  147. package/dist/connectors/jira/inbound.d.ts.map +1 -0
  148. package/dist/connectors/jira/inbound.js +316 -0
  149. package/dist/connectors/jira/inbound.js.map +1 -0
  150. package/dist/connectors/jira/issueBlocks.d.ts +51 -0
  151. package/dist/connectors/jira/issueBlocks.d.ts.map +1 -0
  152. package/dist/connectors/jira/issueBlocks.js +182 -0
  153. package/dist/connectors/jira/issueBlocks.js.map +1 -0
  154. package/dist/connectors/jira/issueContext.d.ts +25 -0
  155. package/dist/connectors/jira/issueContext.d.ts.map +1 -0
  156. package/dist/connectors/jira/issueContext.js +53 -0
  157. package/dist/connectors/jira/issueContext.js.map +1 -0
  158. package/dist/connectors/jira/issueDelta.d.ts +35 -0
  159. package/dist/connectors/jira/issueDelta.d.ts.map +1 -0
  160. package/dist/connectors/jira/issueDelta.js +50 -0
  161. package/dist/connectors/jira/issueDelta.js.map +1 -0
  162. package/dist/connectors/jira/mediaPlaceholders.d.ts +20 -0
  163. package/dist/connectors/jira/mediaPlaceholders.d.ts.map +1 -0
  164. package/dist/connectors/jira/mediaPlaceholders.js +92 -0
  165. package/dist/connectors/jira/mediaPlaceholders.js.map +1 -0
  166. package/dist/connectors/jira/outbound.d.ts +6 -0
  167. package/dist/connectors/jira/outbound.d.ts.map +1 -0
  168. package/dist/connectors/jira/outbound.js +38 -0
  169. package/dist/connectors/jira/outbound.js.map +1 -0
  170. package/dist/connectors/jira/prompt.d.ts +37 -0
  171. package/dist/connectors/jira/prompt.d.ts.map +1 -0
  172. package/dist/connectors/jira/prompt.js +99 -0
  173. package/dist/connectors/jira/prompt.js.map +1 -0
  174. package/dist/connectors/jira/promptSpill.d.ts +50 -0
  175. package/dist/connectors/jira/promptSpill.d.ts.map +1 -0
  176. package/dist/connectors/jira/promptSpill.js +157 -0
  177. package/dist/connectors/jira/promptSpill.js.map +1 -0
  178. package/dist/connectors/jira/promptText.d.ts +7 -0
  179. package/dist/connectors/jira/promptText.d.ts.map +1 -0
  180. package/dist/connectors/jira/promptText.js +26 -0
  181. package/dist/connectors/jira/promptText.js.map +1 -0
  182. package/dist/connectors/jira/sessionKeyCodec.d.ts +16 -0
  183. package/dist/connectors/jira/sessionKeyCodec.d.ts.map +1 -0
  184. package/dist/connectors/jira/sessionKeyCodec.js +101 -0
  185. package/dist/connectors/jira/sessionKeyCodec.js.map +1 -0
  186. package/dist/connectors/jira/trigger.d.ts +50 -0
  187. package/dist/connectors/jira/trigger.d.ts.map +1 -0
  188. package/dist/connectors/jira/trigger.js +93 -0
  189. package/dist/connectors/jira/trigger.js.map +1 -0
  190. package/dist/connectors/jira/triggerLog.d.ts +51 -0
  191. package/dist/connectors/jira/triggerLog.d.ts.map +1 -0
  192. package/dist/connectors/jira/triggerLog.js +78 -0
  193. package/dist/connectors/jira/triggerLog.js.map +1 -0
  194. package/dist/connectors/jira/unconfirmedPosts.d.ts +58 -0
  195. package/dist/connectors/jira/unconfirmedPosts.d.ts.map +1 -0
  196. package/dist/connectors/jira/unconfirmedPosts.js +105 -0
  197. package/dist/connectors/jira/unconfirmedPosts.js.map +1 -0
  198. package/dist/connectors/telegram/answerSink.d.ts +46 -0
  199. package/dist/connectors/telegram/answerSink.d.ts.map +1 -0
  200. package/dist/connectors/telegram/answerSink.js +71 -0
  201. package/dist/connectors/telegram/answerSink.js.map +1 -0
  202. package/dist/connectors/telegram/commands/autoContinueLimits.d.ts +31 -0
  203. package/dist/connectors/telegram/commands/autoContinueLimits.d.ts.map +1 -0
  204. package/dist/connectors/telegram/commands/autoContinueLimits.js +142 -0
  205. package/dist/connectors/telegram/commands/autoContinueLimits.js.map +1 -0
  206. package/dist/connectors/telegram/commands/botCore.d.ts +46 -0
  207. package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -0
  208. package/dist/connectors/telegram/commands/botCore.js +3 -0
  209. package/dist/connectors/telegram/commands/botCore.js.map +1 -0
  210. package/dist/connectors/telegram/commands/callbackMessage.d.ts +12 -0
  211. package/dist/connectors/telegram/commands/callbackMessage.d.ts.map +1 -0
  212. package/dist/connectors/telegram/commands/callbackMessage.js +13 -0
  213. package/dist/connectors/telegram/commands/callbackMessage.js.map +1 -0
  214. package/dist/connectors/telegram/commands/compaction.d.ts +47 -0
  215. package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -0
  216. package/dist/connectors/telegram/commands/compaction.js +868 -0
  217. package/dist/connectors/telegram/commands/compaction.js.map +1 -0
  218. package/dist/connectors/telegram/commands/displayModes.d.ts +13 -0
  219. package/dist/connectors/telegram/commands/displayModes.d.ts.map +1 -0
  220. package/dist/connectors/telegram/commands/displayModes.js +335 -0
  221. package/dist/connectors/telegram/commands/displayModes.js.map +1 -0
  222. package/dist/connectors/telegram/commands/modelProviders.d.ts +95 -0
  223. package/dist/connectors/telegram/commands/modelProviders.d.ts.map +1 -0
  224. package/dist/connectors/telegram/commands/modelProviders.js +841 -0
  225. package/dist/connectors/telegram/commands/modelProviders.js.map +1 -0
  226. package/dist/connectors/telegram/commands/reminders.d.ts +54 -0
  227. package/dist/connectors/telegram/commands/reminders.d.ts.map +1 -0
  228. package/dist/connectors/telegram/commands/reminders.js +624 -0
  229. package/dist/connectors/telegram/commands/reminders.js.map +1 -0
  230. package/dist/connectors/telegram/fileIntake.d.ts +166 -0
  231. package/dist/connectors/telegram/fileIntake.d.ts.map +1 -0
  232. package/dist/connectors/telegram/fileIntake.js +304 -0
  233. package/dist/connectors/telegram/fileIntake.js.map +1 -0
  234. package/dist/connectors/telegram/fileSendGateway.d.ts +57 -0
  235. package/dist/connectors/telegram/fileSendGateway.d.ts.map +1 -0
  236. package/dist/connectors/telegram/fileSendGateway.js +221 -0
  237. package/dist/connectors/telegram/fileSendGateway.js.map +1 -0
  238. package/dist/connectors/telegram/foreignKeyFallbacks.d.ts +52 -0
  239. package/dist/connectors/telegram/foreignKeyFallbacks.d.ts.map +1 -0
  240. package/dist/connectors/telegram/foreignKeyFallbacks.js +71 -0
  241. package/dist/connectors/telegram/foreignKeyFallbacks.js.map +1 -0
  242. package/dist/connectors/telegram/inbound.d.ts +131 -0
  243. package/dist/connectors/telegram/inbound.d.ts.map +1 -0
  244. package/dist/connectors/telegram/inbound.js +278 -0
  245. package/dist/connectors/telegram/inbound.js.map +1 -0
  246. package/dist/connectors/telegram/languagePicker.d.ts +32 -0
  247. package/dist/connectors/telegram/languagePicker.d.ts.map +1 -0
  248. package/dist/connectors/telegram/languagePicker.js +55 -0
  249. package/dist/connectors/telegram/languagePicker.js.map +1 -0
  250. package/dist/connectors/telegram/messageSplit.d.ts +62 -0
  251. package/dist/connectors/telegram/messageSplit.d.ts.map +1 -0
  252. package/dist/connectors/telegram/messageSplit.js +119 -0
  253. package/dist/connectors/telegram/messageSplit.js.map +1 -0
  254. package/dist/connectors/telegram/outbound.d.ts +62 -0
  255. package/dist/connectors/telegram/outbound.d.ts.map +1 -0
  256. package/dist/connectors/telegram/outbound.js +116 -0
  257. package/dist/connectors/telegram/outbound.js.map +1 -0
  258. package/dist/connectors/telegram/output/createOutputTransport.d.ts +34 -0
  259. package/dist/connectors/telegram/output/createOutputTransport.d.ts.map +1 -0
  260. package/dist/connectors/telegram/output/createOutputTransport.js +77 -0
  261. package/dist/connectors/telegram/output/createOutputTransport.js.map +1 -0
  262. package/dist/connectors/telegram/output/dmOutputTransport.d.ts +47 -0
  263. package/dist/connectors/telegram/output/dmOutputTransport.d.ts.map +1 -0
  264. package/dist/connectors/telegram/output/dmOutputTransport.js +412 -0
  265. package/dist/connectors/telegram/output/dmOutputTransport.js.map +1 -0
  266. package/dist/connectors/telegram/outputBacklogGlue.d.ts +38 -0
  267. package/dist/connectors/telegram/outputBacklogGlue.d.ts.map +1 -0
  268. package/dist/connectors/telegram/outputBacklogGlue.js +49 -0
  269. package/dist/connectors/telegram/outputBacklogGlue.js.map +1 -0
  270. package/dist/connectors/telegram/outputFlushPlan.d.ts +93 -0
  271. package/dist/connectors/telegram/outputFlushPlan.d.ts.map +1 -0
  272. package/dist/connectors/telegram/outputFlushPlan.js +120 -0
  273. package/dist/connectors/telegram/outputFlushPlan.js.map +1 -0
  274. package/dist/connectors/telegram/questionKeyboards.d.ts +30 -0
  275. package/dist/connectors/telegram/questionKeyboards.d.ts.map +1 -0
  276. package/dist/connectors/telegram/questionKeyboards.js +37 -0
  277. package/dist/connectors/telegram/questionKeyboards.js.map +1 -0
  278. package/dist/connectors/telegram/renderAgentHtml.d.ts +27 -0
  279. package/dist/connectors/telegram/renderAgentHtml.d.ts.map +1 -0
  280. package/dist/connectors/telegram/renderAgentHtml.js +97 -0
  281. package/dist/connectors/telegram/renderAgentHtml.js.map +1 -0
  282. package/dist/connectors/telegram/sessionKeyCodec.d.ts +28 -0
  283. package/dist/connectors/telegram/sessionKeyCodec.d.ts.map +1 -0
  284. package/dist/connectors/telegram/sessionKeyCodec.js +107 -0
  285. package/dist/connectors/telegram/sessionKeyCodec.js.map +1 -0
  286. package/dist/connectors/telegram/telegramCallGuard.d.ts +19 -0
  287. package/dist/connectors/telegram/telegramCallGuard.d.ts.map +1 -0
  288. package/dist/connectors/telegram/telegramCallGuard.js +35 -0
  289. package/dist/connectors/telegram/telegramCallGuard.js.map +1 -0
  290. package/dist/connectors/telegram/timezonePicker.d.ts +85 -0
  291. package/dist/connectors/telegram/timezonePicker.d.ts.map +1 -0
  292. package/dist/connectors/telegram/timezonePicker.js +142 -0
  293. package/dist/connectors/telegram/timezonePicker.js.map +1 -0
  294. package/dist/connectors/telegram/updateDispatcher.d.ts +85 -0
  295. package/dist/connectors/telegram/updateDispatcher.d.ts.map +1 -0
  296. package/dist/connectors/telegram/updateDispatcher.js +159 -0
  297. package/dist/connectors/telegram/updateDispatcher.js.map +1 -0
  298. package/dist/connectors/test/connector.d.ts +52 -0
  299. package/dist/connectors/test/connector.d.ts.map +1 -0
  300. package/dist/connectors/test/connector.js +143 -0
  301. package/dist/connectors/test/connector.js.map +1 -0
  302. package/dist/connectors/test/sessionKeyCodec.d.ts +25 -0
  303. package/dist/connectors/test/sessionKeyCodec.d.ts.map +1 -0
  304. package/dist/connectors/test/sessionKeyCodec.js +50 -0
  305. package/dist/connectors/test/sessionKeyCodec.js.map +1 -0
  306. package/dist/diagLog.d.ts +6 -0
  307. package/dist/diagLog.d.ts.map +1 -0
  308. package/dist/diagLog.js +58 -0
  309. package/dist/diagLog.js.map +1 -0
  310. package/dist/effortLevels.d.ts +68 -0
  311. package/dist/effortLevels.d.ts.map +1 -0
  312. package/dist/effortLevels.js +114 -0
  313. package/dist/effortLevels.js.map +1 -0
  314. package/dist/folderName.d.ts +42 -0
  315. package/dist/folderName.d.ts.map +1 -0
  316. package/dist/folderName.js +51 -0
  317. package/dist/folderName.js.map +1 -0
  318. package/dist/i18n/de.d.ts +2 -0
  319. package/dist/i18n/de.d.ts.map +1 -0
  320. package/dist/i18n/de.js +537 -0
  321. package/dist/i18n/de.js.map +1 -0
  322. package/dist/i18n/en.d.ts +7 -0
  323. package/dist/i18n/en.d.ts.map +1 -0
  324. package/dist/i18n/en.js +566 -0
  325. package/dist/i18n/en.js.map +1 -0
  326. package/dist/i18n/es.d.ts +2 -0
  327. package/dist/i18n/es.d.ts.map +1 -0
  328. package/dist/i18n/es.js +537 -0
  329. package/dist/i18n/es.js.map +1 -0
  330. package/dist/i18n/fr.d.ts +2 -0
  331. package/dist/i18n/fr.d.ts.map +1 -0
  332. package/dist/i18n/fr.js +537 -0
  333. package/dist/i18n/fr.js.map +1 -0
  334. package/dist/i18n/hi.d.ts +2 -0
  335. package/dist/i18n/hi.d.ts.map +1 -0
  336. package/dist/i18n/hi.js +537 -0
  337. package/dist/i18n/hi.js.map +1 -0
  338. package/dist/i18n/ja.d.ts +2 -0
  339. package/dist/i18n/ja.d.ts.map +1 -0
  340. package/dist/i18n/ja.js +537 -0
  341. package/dist/i18n/ja.js.map +1 -0
  342. package/dist/i18n/ka.d.ts +2 -0
  343. package/dist/i18n/ka.d.ts.map +1 -0
  344. package/dist/i18n/ka.js +537 -0
  345. package/dist/i18n/ka.js.map +1 -0
  346. package/dist/i18n/pt.d.ts +2 -0
  347. package/dist/i18n/pt.d.ts.map +1 -0
  348. package/dist/i18n/pt.js +537 -0
  349. package/dist/i18n/pt.js.map +1 -0
  350. package/dist/i18n/ru.d.ts +6 -0
  351. package/dist/i18n/ru.d.ts.map +1 -0
  352. package/dist/i18n/ru.js +540 -0
  353. package/dist/i18n/ru.js.map +1 -0
  354. package/dist/i18n/uk.d.ts +8 -0
  355. package/dist/i18n/uk.d.ts.map +1 -0
  356. package/dist/i18n/uk.js +542 -0
  357. package/dist/i18n/uk.js.map +1 -0
  358. package/dist/i18n/uz.d.ts +2 -0
  359. package/dist/i18n/uz.d.ts.map +1 -0
  360. package/dist/i18n/uz.js +537 -0
  361. package/dist/i18n/uz.js.map +1 -0
  362. package/dist/i18n/zh.d.ts +2 -0
  363. package/dist/i18n/zh.d.ts.map +1 -0
  364. package/dist/i18n/zh.js +537 -0
  365. package/dist/i18n/zh.js.map +1 -0
  366. package/dist/i18n.d.ts +115 -0
  367. package/dist/i18n.d.ts.map +1 -0
  368. package/dist/i18n.js +233 -0
  369. package/dist/i18n.js.map +1 -0
  370. package/dist/index.d.ts +3 -0
  371. package/dist/index.d.ts.map +1 -0
  372. package/dist/index.js +10 -0
  373. package/dist/index.js.map +1 -0
  374. package/dist/installManager.d.ts +99 -0
  375. package/dist/installManager.d.ts.map +1 -0
  376. package/dist/installManager.js +943 -0
  377. package/dist/installManager.js.map +1 -0
  378. package/dist/instanceLock.d.ts +161 -0
  379. package/dist/instanceLock.d.ts.map +1 -0
  380. package/dist/instanceLock.js +388 -0
  381. package/dist/instanceLock.js.map +1 -0
  382. package/dist/mcpConfig.d.ts +76 -0
  383. package/dist/mcpConfig.d.ts.map +1 -0
  384. package/dist/mcpConfig.js +270 -0
  385. package/dist/mcpConfig.js.map +1 -0
  386. package/dist/openCodeOpenQuestion.d.ts +44 -0
  387. package/dist/openCodeOpenQuestion.d.ts.map +1 -0
  388. package/dist/openCodeOpenQuestion.js +64 -0
  389. package/dist/openCodeOpenQuestion.js.map +1 -0
  390. package/dist/openCodeQuestionFlow.d.ts +105 -0
  391. package/dist/openCodeQuestionFlow.d.ts.map +1 -0
  392. package/dist/openCodeQuestionFlow.js +143 -0
  393. package/dist/openCodeQuestionFlow.js.map +1 -0
  394. package/dist/openCodeSessionRouting.d.ts +133 -0
  395. package/dist/openCodeSessionRouting.d.ts.map +1 -0
  396. package/dist/openCodeSessionRouting.js +253 -0
  397. package/dist/openCodeSessionRouting.js.map +1 -0
  398. package/dist/openCodeSessionTitle.d.ts +50 -0
  399. package/dist/openCodeSessionTitle.d.ts.map +1 -0
  400. package/dist/openCodeSessionTitle.js +84 -0
  401. package/dist/openCodeSessionTitle.js.map +1 -0
  402. package/dist/outputTrace.d.ts +108 -0
  403. package/dist/outputTrace.d.ts.map +1 -0
  404. package/dist/outputTrace.js +430 -0
  405. package/dist/outputTrace.js.map +1 -0
  406. package/dist/pendingQuestionRepost.d.ts +47 -0
  407. package/dist/pendingQuestionRepost.d.ts.map +1 -0
  408. package/dist/pendingQuestionRepost.js +29 -0
  409. package/dist/pendingQuestionRepost.js.map +1 -0
  410. package/dist/pinnedStatus.d.ts +52 -0
  411. package/dist/pinnedStatus.d.ts.map +1 -0
  412. package/dist/pinnedStatus.js +36 -0
  413. package/dist/pinnedStatus.js.map +1 -0
  414. package/dist/platform/answerSink.d.ts +93 -0
  415. package/dist/platform/answerSink.d.ts.map +1 -0
  416. package/dist/platform/answerSink.js +31 -0
  417. package/dist/platform/answerSink.js.map +1 -0
  418. package/dist/platform/capabilityFallback.d.ts +39 -0
  419. package/dist/platform/capabilityFallback.d.ts.map +1 -0
  420. package/dist/platform/capabilityFallback.js +55 -0
  421. package/dist/platform/capabilityFallback.js.map +1 -0
  422. package/dist/platform/commandRouter.d.ts +51 -0
  423. package/dist/platform/commandRouter.d.ts.map +1 -0
  424. package/dist/platform/commandRouter.js +53 -0
  425. package/dist/platform/commandRouter.js.map +1 -0
  426. package/dist/platform/connectorSet.d.ts +39 -0
  427. package/dist/platform/connectorSet.d.ts.map +1 -0
  428. package/dist/platform/connectorSet.js +55 -0
  429. package/dist/platform/connectorSet.js.map +1 -0
  430. package/dist/platform/inbound.d.ts +147 -0
  431. package/dist/platform/inbound.d.ts.map +1 -0
  432. package/dist/platform/inbound.js +18 -0
  433. package/dist/platform/inbound.js.map +1 -0
  434. package/dist/platform/outbound.d.ts +225 -0
  435. package/dist/platform/outbound.d.ts.map +1 -0
  436. package/dist/platform/outbound.js +30 -0
  437. package/dist/platform/outbound.js.map +1 -0
  438. package/dist/platform/unservedStateGuard.d.ts +27 -0
  439. package/dist/platform/unservedStateGuard.d.ts.map +1 -0
  440. package/dist/platform/unservedStateGuard.js +42 -0
  441. package/dist/platform/unservedStateGuard.js.map +1 -0
  442. package/dist/postToSession.d.ts +94 -0
  443. package/dist/postToSession.d.ts.map +1 -0
  444. package/dist/postToSession.js +56 -0
  445. package/dist/postToSession.js.map +1 -0
  446. package/dist/progressLine.d.ts +180 -0
  447. package/dist/progressLine.d.ts.map +1 -0
  448. package/dist/progressLine.js +293 -0
  449. package/dist/progressLine.js.map +1 -0
  450. package/dist/rateLimiter.d.ts +246 -0
  451. package/dist/rateLimiter.d.ts.map +1 -0
  452. package/dist/rateLimiter.js +555 -0
  453. package/dist/rateLimiter.js.map +1 -0
  454. package/dist/requests/answerRequest.d.ts +57 -0
  455. package/dist/requests/answerRequest.d.ts.map +1 -0
  456. package/dist/requests/answerRequest.js +96 -0
  457. package/dist/requests/answerRequest.js.map +1 -0
  458. package/dist/requests/answerTail.d.ts +83 -0
  459. package/dist/requests/answerTail.d.ts.map +1 -0
  460. package/dist/requests/answerTail.js +102 -0
  461. package/dist/requests/answerTail.js.map +1 -0
  462. package/dist/requests/limitWaitAnswer.d.ts +87 -0
  463. package/dist/requests/limitWaitAnswer.d.ts.map +1 -0
  464. package/dist/requests/limitWaitAnswer.js +83 -0
  465. package/dist/requests/limitWaitAnswer.js.map +1 -0
  466. package/dist/requests/requestGroup.d.ts +44 -0
  467. package/dist/requests/requestGroup.d.ts.map +1 -0
  468. package/dist/requests/requestGroup.js +63 -0
  469. package/dist/requests/requestGroup.js.map +1 -0
  470. package/dist/requests/requestHeader.d.ts +70 -0
  471. package/dist/requests/requestHeader.d.ts.map +1 -0
  472. package/dist/requests/requestHeader.js +83 -0
  473. package/dist/requests/requestHeader.js.map +1 -0
  474. package/dist/requests/requestLedger.d.ts +217 -0
  475. package/dist/requests/requestLedger.d.ts.map +1 -0
  476. package/dist/requests/requestLedger.js +468 -0
  477. package/dist/requests/requestLedger.js.map +1 -0
  478. package/dist/requests/sessionTurnProbe.d.ts +52 -0
  479. package/dist/requests/sessionTurnProbe.d.ts.map +1 -0
  480. package/dist/requests/sessionTurnProbe.js +29 -0
  481. package/dist/requests/sessionTurnProbe.js.map +1 -0
  482. package/dist/requests/types.d.ts +181 -0
  483. package/dist/requests/types.d.ts.map +1 -0
  484. package/dist/requests/types.js +9 -0
  485. package/dist/requests/types.js.map +1 -0
  486. package/dist/requests/wakeUpEngine.d.ts +160 -0
  487. package/dist/requests/wakeUpEngine.d.ts.map +1 -0
  488. package/dist/requests/wakeUpEngine.js +399 -0
  489. package/dist/requests/wakeUpEngine.js.map +1 -0
  490. package/dist/requests/wakeUpRules.d.ts +151 -0
  491. package/dist/requests/wakeUpRules.d.ts.map +1 -0
  492. package/dist/requests/wakeUpRules.js +167 -0
  493. package/dist/requests/wakeUpRules.js.map +1 -0
  494. package/dist/resumeContext.d.ts +87 -0
  495. package/dist/resumeContext.d.ts.map +1 -0
  496. package/dist/resumeContext.js +114 -0
  497. package/dist/resumeContext.js.map +1 -0
  498. package/dist/scheduler/checkRun.d.ts +95 -0
  499. package/dist/scheduler/checkRun.d.ts.map +1 -0
  500. package/dist/scheduler/checkRun.js +172 -0
  501. package/dist/scheduler/checkRun.js.map +1 -0
  502. package/dist/scheduler/delivery.d.ts +99 -0
  503. package/dist/scheduler/delivery.d.ts.map +1 -0
  504. package/dist/scheduler/delivery.js +212 -0
  505. package/dist/scheduler/delivery.js.map +1 -0
  506. package/dist/scheduler/deliveryKind.d.ts +29 -0
  507. package/dist/scheduler/deliveryKind.d.ts.map +1 -0
  508. package/dist/scheduler/deliveryKind.js +39 -0
  509. package/dist/scheduler/deliveryKind.js.map +1 -0
  510. package/dist/scheduler/directoryThreads.d.ts +19 -0
  511. package/dist/scheduler/directoryThreads.d.ts.map +1 -0
  512. package/dist/scheduler/directoryThreads.js +28 -0
  513. package/dist/scheduler/directoryThreads.js.map +1 -0
  514. package/dist/scheduler/engine.d.ts +77 -0
  515. package/dist/scheduler/engine.d.ts.map +1 -0
  516. package/dist/scheduler/engine.js +337 -0
  517. package/dist/scheduler/engine.js.map +1 -0
  518. package/dist/scheduler/injection.d.ts +102 -0
  519. package/dist/scheduler/injection.d.ts.map +1 -0
  520. package/dist/scheduler/injection.js +122 -0
  521. package/dist/scheduler/injection.js.map +1 -0
  522. package/dist/scheduler/mcpBoot.d.ts +65 -0
  523. package/dist/scheduler/mcpBoot.d.ts.map +1 -0
  524. package/dist/scheduler/mcpBoot.js +60 -0
  525. package/dist/scheduler/mcpBoot.js.map +1 -0
  526. package/dist/scheduler/mcpSurface.d.ts +355 -0
  527. package/dist/scheduler/mcpSurface.d.ts.map +1 -0
  528. package/dist/scheduler/mcpSurface.js +1257 -0
  529. package/dist/scheduler/mcpSurface.js.map +1 -0
  530. package/dist/scheduler/rebindResume.d.ts +27 -0
  531. package/dist/scheduler/rebindResume.d.ts.map +1 -0
  532. package/dist/scheduler/rebindResume.js +17 -0
  533. package/dist/scheduler/rebindResume.js.map +1 -0
  534. package/dist/scheduler/recurrence.d.ts +58 -0
  535. package/dist/scheduler/recurrence.d.ts.map +1 -0
  536. package/dist/scheduler/recurrence.js +210 -0
  537. package/dist/scheduler/recurrence.js.map +1 -0
  538. package/dist/scheduler/runLedger.d.ts +59 -0
  539. package/dist/scheduler/runLedger.d.ts.map +1 -0
  540. package/dist/scheduler/runLedger.js +54 -0
  541. package/dist/scheduler/runLedger.js.map +1 -0
  542. package/dist/scheduler/store.d.ts +97 -0
  543. package/dist/scheduler/store.d.ts.map +1 -0
  544. package/dist/scheduler/store.js +124 -0
  545. package/dist/scheduler/store.js.map +1 -0
  546. package/dist/scheduler/timezoneRecompute.d.ts +61 -0
  547. package/dist/scheduler/timezoneRecompute.d.ts.map +1 -0
  548. package/dist/scheduler/timezoneRecompute.js +46 -0
  549. package/dist/scheduler/timezoneRecompute.js.map +1 -0
  550. package/dist/scheduler/types.d.ts +139 -0
  551. package/dist/scheduler/types.d.ts.map +1 -0
  552. package/dist/scheduler/types.js +8 -0
  553. package/dist/scheduler/types.js.map +1 -0
  554. package/dist/sendErrorClassifier.d.ts +45 -0
  555. package/dist/sendErrorClassifier.d.ts.map +1 -0
  556. package/dist/sendErrorClassifier.js +65 -0
  557. package/dist/sendErrorClassifier.js.map +1 -0
  558. package/dist/sessionKey.d.ts +136 -0
  559. package/dist/sessionKey.d.ts.map +1 -0
  560. package/dist/sessionKey.js +153 -0
  561. package/dist/sessionKey.js.map +1 -0
  562. package/dist/sessionPick.d.ts +42 -0
  563. package/dist/sessionPick.d.ts.map +1 -0
  564. package/dist/sessionPick.js +39 -0
  565. package/dist/sessionPick.js.map +1 -0
  566. package/dist/shutdown.d.ts +126 -0
  567. package/dist/shutdown.d.ts.map +1 -0
  568. package/dist/shutdown.js +164 -0
  569. package/dist/shutdown.js.map +1 -0
  570. package/dist/startupPromptBuffer.d.ts +85 -0
  571. package/dist/startupPromptBuffer.d.ts.map +1 -0
  572. package/dist/startupPromptBuffer.js +123 -0
  573. package/dist/startupPromptBuffer.js.map +1 -0
  574. package/dist/state.d.ts +1245 -0
  575. package/dist/state.d.ts.map +1 -0
  576. package/dist/state.js +1830 -0
  577. package/dist/state.js.map +1 -0
  578. package/dist/threadContextPreamble.d.ts +89 -0
  579. package/dist/threadContextPreamble.d.ts.map +1 -0
  580. package/dist/threadContextPreamble.js +102 -0
  581. package/dist/threadContextPreamble.js.map +1 -0
  582. package/dist/threadRouting.d.ts +164 -0
  583. package/dist/threadRouting.d.ts.map +1 -0
  584. package/dist/threadRouting.js +182 -0
  585. package/dist/threadRouting.js.map +1 -0
  586. package/dist/types.d.ts +1015 -0
  587. package/dist/types.d.ts.map +1 -0
  588. package/dist/types.js +3 -0
  589. package/dist/types.js.map +1 -0
  590. package/dist/utils/abortableFifo.d.ts +10 -0
  591. package/dist/utils/abortableFifo.d.ts.map +1 -0
  592. package/dist/utils/abortableFifo.js +55 -0
  593. package/dist/utils/abortableFifo.js.map +1 -0
  594. package/dist/utils/adoptedToolList.d.ts +27 -0
  595. package/dist/utils/adoptedToolList.d.ts.map +1 -0
  596. package/dist/utils/adoptedToolList.js +22 -0
  597. package/dist/utils/adoptedToolList.js.map +1 -0
  598. package/dist/utils/agentEnvironment.d.ts +42 -0
  599. package/dist/utils/agentEnvironment.d.ts.map +1 -0
  600. package/dist/utils/agentEnvironment.js +122 -0
  601. package/dist/utils/agentEnvironment.js.map +1 -0
  602. package/dist/utils/ansiClean.d.ts +11 -0
  603. package/dist/utils/ansiClean.d.ts.map +1 -0
  604. package/dist/utils/ansiClean.js +139 -0
  605. package/dist/utils/ansiClean.js.map +1 -0
  606. package/dist/utils/autoContinueOnLimit.d.ts +49 -0
  607. package/dist/utils/autoContinueOnLimit.d.ts.map +1 -0
  608. package/dist/utils/autoContinueOnLimit.js +69 -0
  609. package/dist/utils/autoContinueOnLimit.js.map +1 -0
  610. package/dist/utils/canonicalPathContainment.d.ts +7 -0
  611. package/dist/utils/canonicalPathContainment.d.ts.map +1 -0
  612. package/dist/utils/canonicalPathContainment.js +48 -0
  613. package/dist/utils/canonicalPathContainment.js.map +1 -0
  614. package/dist/utils/claudeAuthLogin.d.ts +71 -0
  615. package/dist/utils/claudeAuthLogin.d.ts.map +1 -0
  616. package/dist/utils/claudeAuthLogin.js +93 -0
  617. package/dist/utils/claudeAuthLogin.js.map +1 -0
  618. package/dist/utils/claudeChunkClassifier.d.ts +97 -0
  619. package/dist/utils/claudeChunkClassifier.d.ts.map +1 -0
  620. package/dist/utils/claudeChunkClassifier.js +254 -0
  621. package/dist/utils/claudeChunkClassifier.js.map +1 -0
  622. package/dist/utils/claudeCodeVersion.d.ts +31 -0
  623. package/dist/utils/claudeCodeVersion.d.ts.map +1 -0
  624. package/dist/utils/claudeCodeVersion.js +62 -0
  625. package/dist/utils/claudeCodeVersion.js.map +1 -0
  626. package/dist/utils/claudeCompactHook.d.ts +64 -0
  627. package/dist/utils/claudeCompactHook.d.ts.map +1 -0
  628. package/dist/utils/claudeCompactHook.js +98 -0
  629. package/dist/utils/claudeCompactHook.js.map +1 -0
  630. package/dist/utils/claudeLivenessAction.d.ts +208 -0
  631. package/dist/utils/claudeLivenessAction.d.ts.map +1 -0
  632. package/dist/utils/claudeLivenessAction.js +135 -0
  633. package/dist/utils/claudeLivenessAction.js.map +1 -0
  634. package/dist/utils/claudeMcpHeal.d.ts +92 -0
  635. package/dist/utils/claudeMcpHeal.d.ts.map +1 -0
  636. package/dist/utils/claudeMcpHeal.js +91 -0
  637. package/dist/utils/claudeMcpHeal.js.map +1 -0
  638. package/dist/utils/claudeRelayRouting.d.ts +86 -0
  639. package/dist/utils/claudeRelayRouting.d.ts.map +1 -0
  640. package/dist/utils/claudeRelayRouting.js +159 -0
  641. package/dist/utils/claudeRelayRouting.js.map +1 -0
  642. package/dist/utils/claudeRuntimeInfo.d.ts +26 -0
  643. package/dist/utils/claudeRuntimeInfo.d.ts.map +1 -0
  644. package/dist/utils/claudeRuntimeInfo.js +151 -0
  645. package/dist/utils/claudeRuntimeInfo.js.map +1 -0
  646. package/dist/utils/claudeScrapeShapes.d.ts +256 -0
  647. package/dist/utils/claudeScrapeShapes.d.ts.map +1 -0
  648. package/dist/utils/claudeScrapeShapes.js +290 -0
  649. package/dist/utils/claudeScrapeShapes.js.map +1 -0
  650. package/dist/utils/claudeSessionTitle.d.ts +27 -0
  651. package/dist/utils/claudeSessionTitle.d.ts.map +1 -0
  652. package/dist/utils/claudeSessionTitle.js +90 -0
  653. package/dist/utils/claudeSessionTitle.js.map +1 -0
  654. package/dist/utils/claudeStreamJson.d.ts +202 -0
  655. package/dist/utils/claudeStreamJson.d.ts.map +1 -0
  656. package/dist/utils/claudeStreamJson.js +351 -0
  657. package/dist/utils/claudeStreamJson.js.map +1 -0
  658. package/dist/utils/claudeSubagentTail.d.ts +93 -0
  659. package/dist/utils/claudeSubagentTail.d.ts.map +1 -0
  660. package/dist/utils/claudeSubagentTail.js +136 -0
  661. package/dist/utils/claudeSubagentTail.js.map +1 -0
  662. package/dist/utils/clearThreadOutputQueues.d.ts +43 -0
  663. package/dist/utils/clearThreadOutputQueues.d.ts.map +1 -0
  664. package/dist/utils/clearThreadOutputQueues.js +39 -0
  665. package/dist/utils/clearThreadOutputQueues.js.map +1 -0
  666. package/dist/utils/compactCommandRoute.d.ts +45 -0
  667. package/dist/utils/compactCommandRoute.d.ts.map +1 -0
  668. package/dist/utils/compactCommandRoute.js +36 -0
  669. package/dist/utils/compactCommandRoute.js.map +1 -0
  670. package/dist/utils/compactOnIdle.d.ts +329 -0
  671. package/dist/utils/compactOnIdle.d.ts.map +1 -0
  672. package/dist/utils/compactOnIdle.js +379 -0
  673. package/dist/utils/compactOnIdle.js.map +1 -0
  674. package/dist/utils/consoleFileTap.d.ts +51 -0
  675. package/dist/utils/consoleFileTap.d.ts.map +1 -0
  676. package/dist/utils/consoleFileTap.js +86 -0
  677. package/dist/utils/consoleFileTap.js.map +1 -0
  678. package/dist/utils/displayVerbosity.d.ts +44 -0
  679. package/dist/utils/displayVerbosity.d.ts.map +1 -0
  680. package/dist/utils/displayVerbosity.js +75 -0
  681. package/dist/utils/displayVerbosity.js.map +1 -0
  682. package/dist/utils/download.d.ts +72 -0
  683. package/dist/utils/download.d.ts.map +1 -0
  684. package/dist/utils/download.js +216 -0
  685. package/dist/utils/download.js.map +1 -0
  686. package/dist/utils/draftFinalize.d.ts +110 -0
  687. package/dist/utils/draftFinalize.d.ts.map +1 -0
  688. package/dist/utils/draftFinalize.js +100 -0
  689. package/dist/utils/draftFinalize.js.map +1 -0
  690. package/dist/utils/draftId.d.ts +36 -0
  691. package/dist/utils/draftId.d.ts.map +1 -0
  692. package/dist/utils/draftId.js +46 -0
  693. package/dist/utils/draftId.js.map +1 -0
  694. package/dist/utils/draftPacer.d.ts +72 -0
  695. package/dist/utils/draftPacer.d.ts.map +1 -0
  696. package/dist/utils/draftPacer.js +53 -0
  697. package/dist/utils/draftPacer.js.map +1 -0
  698. package/dist/utils/effortStartupKeystroke.d.ts +20 -0
  699. package/dist/utils/effortStartupKeystroke.d.ts.map +1 -0
  700. package/dist/utils/effortStartupKeystroke.js +28 -0
  701. package/dist/utils/effortStartupKeystroke.js.map +1 -0
  702. package/dist/utils/ensureSessionPlan.d.ts +70 -0
  703. package/dist/utils/ensureSessionPlan.d.ts.map +1 -0
  704. package/dist/utils/ensureSessionPlan.js +54 -0
  705. package/dist/utils/ensureSessionPlan.js.map +1 -0
  706. package/dist/utils/fileSendPlan.d.ts +217 -0
  707. package/dist/utils/fileSendPlan.d.ts.map +1 -0
  708. package/dist/utils/fileSendPlan.js +291 -0
  709. package/dist/utils/fileSendPlan.js.map +1 -0
  710. package/dist/utils/fileSendService.d.ts +94 -0
  711. package/dist/utils/fileSendService.d.ts.map +1 -0
  712. package/dist/utils/fileSendService.js +387 -0
  713. package/dist/utils/fileSendService.js.map +1 -0
  714. package/dist/utils/groupFinalizePlan.d.ts +38 -0
  715. package/dist/utils/groupFinalizePlan.d.ts.map +1 -0
  716. package/dist/utils/groupFinalizePlan.js +35 -0
  717. package/dist/utils/groupFinalizePlan.js.map +1 -0
  718. package/dist/utils/identicalOutputGuard.d.ts +83 -0
  719. package/dist/utils/identicalOutputGuard.d.ts.map +1 -0
  720. package/dist/utils/identicalOutputGuard.js +99 -0
  721. package/dist/utils/identicalOutputGuard.js.map +1 -0
  722. package/dist/utils/isoTimestamp.d.ts +16 -0
  723. package/dist/utils/isoTimestamp.d.ts.map +1 -0
  724. package/dist/utils/isoTimestamp.js +34 -0
  725. package/dist/utils/isoTimestamp.js.map +1 -0
  726. package/dist/utils/jsonStreamBusyWatchdog.d.ts +130 -0
  727. package/dist/utils/jsonStreamBusyWatchdog.d.ts.map +1 -0
  728. package/dist/utils/jsonStreamBusyWatchdog.js +122 -0
  729. package/dist/utils/jsonStreamBusyWatchdog.js.map +1 -0
  730. package/dist/utils/jsonStreamHost.d.ts +227 -0
  731. package/dist/utils/jsonStreamHost.d.ts.map +1 -0
  732. package/dist/utils/jsonStreamHost.js +417 -0
  733. package/dist/utils/jsonStreamHost.js.map +1 -0
  734. package/dist/utils/keyedTransitionQueue.d.ts +18 -0
  735. package/dist/utils/keyedTransitionQueue.d.ts.map +1 -0
  736. package/dist/utils/keyedTransitionQueue.js +34 -0
  737. package/dist/utils/keyedTransitionQueue.js.map +1 -0
  738. package/dist/utils/limitEpisodeRecovery.d.ts +92 -0
  739. package/dist/utils/limitEpisodeRecovery.d.ts.map +1 -0
  740. package/dist/utils/limitEpisodeRecovery.js +133 -0
  741. package/dist/utils/limitEpisodeRecovery.js.map +1 -0
  742. package/dist/utils/limitHeldPromptQueue.d.ts +48 -0
  743. package/dist/utils/limitHeldPromptQueue.d.ts.map +1 -0
  744. package/dist/utils/limitHeldPromptQueue.js +59 -0
  745. package/dist/utils/limitHeldPromptQueue.js.map +1 -0
  746. package/dist/utils/limitHeldPrompts.d.ts +58 -0
  747. package/dist/utils/limitHeldPrompts.d.ts.map +1 -0
  748. package/dist/utils/limitHeldPrompts.js +65 -0
  749. package/dist/utils/limitHeldPrompts.js.map +1 -0
  750. package/dist/utils/linkPreviewSuppression.d.ts +18 -0
  751. package/dist/utils/linkPreviewSuppression.d.ts.map +1 -0
  752. package/dist/utils/linkPreviewSuppression.js +37 -0
  753. package/dist/utils/linkPreviewSuppression.js.map +1 -0
  754. package/dist/utils/localClock.d.ts +15 -0
  755. package/dist/utils/localClock.d.ts.map +1 -0
  756. package/dist/utils/localClock.js +29 -0
  757. package/dist/utils/localClock.js.map +1 -0
  758. package/dist/utils/markdownTableRender.d.ts +83 -0
  759. package/dist/utils/markdownTableRender.d.ts.map +1 -0
  760. package/dist/utils/markdownTableRender.js +298 -0
  761. package/dist/utils/markdownTableRender.js.map +1 -0
  762. package/dist/utils/mediaGroupCollector.d.ts +51 -0
  763. package/dist/utils/mediaGroupCollector.d.ts.map +1 -0
  764. package/dist/utils/mediaGroupCollector.js +90 -0
  765. package/dist/utils/mediaGroupCollector.js.map +1 -0
  766. package/dist/utils/messageSendService.d.ts +136 -0
  767. package/dist/utils/messageSendService.d.ts.map +1 -0
  768. package/dist/utils/messageSendService.js +165 -0
  769. package/dist/utils/messageSendService.js.map +1 -0
  770. package/dist/utils/minutesOverride.d.ts +7 -0
  771. package/dist/utils/minutesOverride.d.ts.map +1 -0
  772. package/dist/utils/minutesOverride.js +16 -0
  773. package/dist/utils/minutesOverride.js.map +1 -0
  774. package/dist/utils/modelPickerPlan.d.ts +119 -0
  775. package/dist/utils/modelPickerPlan.d.ts.map +1 -0
  776. package/dist/utils/modelPickerPlan.js +171 -0
  777. package/dist/utils/modelPickerPlan.js.map +1 -0
  778. package/dist/utils/modelSetReplyDecision.d.ts +67 -0
  779. package/dist/utils/modelSetReplyDecision.d.ts.map +1 -0
  780. package/dist/utils/modelSetReplyDecision.js +27 -0
  781. package/dist/utils/modelSetReplyDecision.js.map +1 -0
  782. package/dist/utils/openCodeAuthLogin.d.ts +181 -0
  783. package/dist/utils/openCodeAuthLogin.d.ts.map +1 -0
  784. package/dist/utils/openCodeAuthLogin.js +393 -0
  785. package/dist/utils/openCodeAuthLogin.js.map +1 -0
  786. package/dist/utils/openCodeCompactPlugin.d.ts +81 -0
  787. package/dist/utils/openCodeCompactPlugin.d.ts.map +1 -0
  788. package/dist/utils/openCodeCompactPlugin.js +146 -0
  789. package/dist/utils/openCodeCompactPlugin.js.map +1 -0
  790. package/dist/utils/openCodeTurnActivity.d.ts +67 -0
  791. package/dist/utils/openCodeTurnActivity.d.ts.map +1 -0
  792. package/dist/utils/openCodeTurnActivity.js +27 -0
  793. package/dist/utils/openCodeTurnActivity.js.map +1 -0
  794. package/dist/utils/outputDebounce.d.ts +24 -0
  795. package/dist/utils/outputDebounce.d.ts.map +1 -0
  796. package/dist/utils/outputDebounce.js +30 -0
  797. package/dist/utils/outputDebounce.js.map +1 -0
  798. package/dist/utils/outputFlushTiming.d.ts +54 -0
  799. package/dist/utils/outputFlushTiming.d.ts.map +1 -0
  800. package/dist/utils/outputFlushTiming.js +48 -0
  801. package/dist/utils/outputFlushTiming.js.map +1 -0
  802. package/dist/utils/paginateList.d.ts +25 -0
  803. package/dist/utils/paginateList.d.ts.map +1 -0
  804. package/dist/utils/paginateList.js +32 -0
  805. package/dist/utils/paginateList.js.map +1 -0
  806. package/dist/utils/paneDiff.d.ts +55 -0
  807. package/dist/utils/paneDiff.d.ts.map +1 -0
  808. package/dist/utils/paneDiff.js +88 -0
  809. package/dist/utils/paneDiff.js.map +1 -0
  810. package/dist/utils/paneResizeGuard.d.ts +69 -0
  811. package/dist/utils/paneResizeGuard.d.ts.map +1 -0
  812. package/dist/utils/paneResizeGuard.js +91 -0
  813. package/dist/utils/paneResizeGuard.js.map +1 -0
  814. package/dist/utils/persistAdapterSessionIds.d.ts +39 -0
  815. package/dist/utils/persistAdapterSessionIds.d.ts.map +1 -0
  816. package/dist/utils/persistAdapterSessionIds.js +28 -0
  817. package/dist/utils/persistAdapterSessionIds.js.map +1 -0
  818. package/dist/utils/pinnedBannerSkipDecision.d.ts +44 -0
  819. package/dist/utils/pinnedBannerSkipDecision.d.ts.map +1 -0
  820. package/dist/utils/pinnedBannerSkipDecision.js +20 -0
  821. package/dist/utils/pinnedBannerSkipDecision.js.map +1 -0
  822. package/dist/utils/pollBackoff.d.ts +45 -0
  823. package/dist/utils/pollBackoff.d.ts.map +1 -0
  824. package/dist/utils/pollBackoff.js +44 -0
  825. package/dist/utils/pollBackoff.js.map +1 -0
  826. package/dist/utils/promptDelivery.d.ts +46 -0
  827. package/dist/utils/promptDelivery.d.ts.map +1 -0
  828. package/dist/utils/promptDelivery.js +49 -0
  829. package/dist/utils/promptDelivery.js.map +1 -0
  830. package/dist/utils/providerDisconnectPlan.d.ts +82 -0
  831. package/dist/utils/providerDisconnectPlan.d.ts.map +1 -0
  832. package/dist/utils/providerDisconnectPlan.js +110 -0
  833. package/dist/utils/providerDisconnectPlan.js.map +1 -0
  834. package/dist/utils/rateLimitLog.d.ts +48 -0
  835. package/dist/utils/rateLimitLog.d.ts.map +1 -0
  836. package/dist/utils/rateLimitLog.js +43 -0
  837. package/dist/utils/rateLimitLog.js.map +1 -0
  838. package/dist/utils/recentRelayWindow.d.ts +165 -0
  839. package/dist/utils/recentRelayWindow.d.ts.map +1 -0
  840. package/dist/utils/recentRelayWindow.js +284 -0
  841. package/dist/utils/recentRelayWindow.js.map +1 -0
  842. package/dist/utils/recvPreviewRedaction.d.ts +23 -0
  843. package/dist/utils/recvPreviewRedaction.d.ts.map +1 -0
  844. package/dist/utils/recvPreviewRedaction.js +39 -0
  845. package/dist/utils/recvPreviewRedaction.js.map +1 -0
  846. package/dist/utils/reminderFlow.d.ts +148 -0
  847. package/dist/utils/reminderFlow.d.ts.map +1 -0
  848. package/dist/utils/reminderFlow.js +122 -0
  849. package/dist/utils/reminderFlow.js.map +1 -0
  850. package/dist/utils/reminderScheduleText.d.ts +87 -0
  851. package/dist/utils/reminderScheduleText.d.ts.map +1 -0
  852. package/dist/utils/reminderScheduleText.js +135 -0
  853. package/dist/utils/reminderScheduleText.js.map +1 -0
  854. package/dist/utils/reminderWizard.d.ts +710 -0
  855. package/dist/utils/reminderWizard.d.ts.map +1 -0
  856. package/dist/utils/reminderWizard.js +1164 -0
  857. package/dist/utils/reminderWizard.js.map +1 -0
  858. package/dist/utils/replyQuote.d.ts +111 -0
  859. package/dist/utils/replyQuote.d.ts.map +1 -0
  860. package/dist/utils/replyQuote.js +122 -0
  861. package/dist/utils/replyQuote.js.map +1 -0
  862. package/dist/utils/resolveBinary.d.ts +25 -0
  863. package/dist/utils/resolveBinary.d.ts.map +1 -0
  864. package/dist/utils/resolveBinary.js +99 -0
  865. package/dist/utils/resolveBinary.js.map +1 -0
  866. package/dist/utils/retryAfterHeader.d.ts +7 -0
  867. package/dist/utils/retryAfterHeader.d.ts.map +1 -0
  868. package/dist/utils/retryAfterHeader.js +17 -0
  869. package/dist/utils/retryAfterHeader.js.map +1 -0
  870. package/dist/utils/rotatingJsonlFile.d.ts +40 -0
  871. package/dist/utils/rotatingJsonlFile.d.ts.map +1 -0
  872. package/dist/utils/rotatingJsonlFile.js +106 -0
  873. package/dist/utils/rotatingJsonlFile.js.map +1 -0
  874. package/dist/utils/rotatingLogFile.d.ts +25 -0
  875. package/dist/utils/rotatingLogFile.d.ts.map +1 -0
  876. package/dist/utils/rotatingLogFile.js +74 -0
  877. package/dist/utils/rotatingLogFile.js.map +1 -0
  878. package/dist/utils/sendRateTracker.d.ts +59 -0
  879. package/dist/utils/sendRateTracker.d.ts.map +1 -0
  880. package/dist/utils/sendRateTracker.js +144 -0
  881. package/dist/utils/sendRateTracker.js.map +1 -0
  882. package/dist/utils/serialQueue.d.ts +5 -0
  883. package/dist/utils/serialQueue.d.ts.map +1 -0
  884. package/dist/utils/serialQueue.js +14 -0
  885. package/dist/utils/serialQueue.js.map +1 -0
  886. package/dist/utils/sseStreamLifecycle.d.ts +32 -0
  887. package/dist/utils/sseStreamLifecycle.d.ts.map +1 -0
  888. package/dist/utils/sseStreamLifecycle.js +41 -0
  889. package/dist/utils/sseStreamLifecycle.js.map +1 -0
  890. package/dist/utils/startupReadiness.d.ts +119 -0
  891. package/dist/utils/startupReadiness.d.ts.map +1 -0
  892. package/dist/utils/startupReadiness.js +148 -0
  893. package/dist/utils/startupReadiness.js.map +1 -0
  894. package/dist/utils/statusFlushDecision.d.ts +18 -0
  895. package/dist/utils/statusFlushDecision.d.ts.map +1 -0
  896. package/dist/utils/statusFlushDecision.js +53 -0
  897. package/dist/utils/statusFlushDecision.js.map +1 -0
  898. package/dist/utils/subagentRender.d.ts +52 -0
  899. package/dist/utils/subagentRender.d.ts.map +1 -0
  900. package/dist/utils/subagentRender.js +66 -0
  901. package/dist/utils/subagentRender.js.map +1 -0
  902. package/dist/utils/subagentStatusRender.d.ts +90 -0
  903. package/dist/utils/subagentStatusRender.d.ts.map +1 -0
  904. package/dist/utils/subagentStatusRender.js +124 -0
  905. package/dist/utils/subagentStatusRender.js.map +1 -0
  906. package/dist/utils/telegramError.d.ts +2 -0
  907. package/dist/utils/telegramError.d.ts.map +1 -0
  908. package/dist/utils/telegramError.js +16 -0
  909. package/dist/utils/telegramError.js.map +1 -0
  910. package/dist/utils/terminalEmitPlan.d.ts +74 -0
  911. package/dist/utils/terminalEmitPlan.d.ts.map +1 -0
  912. package/dist/utils/terminalEmitPlan.js +86 -0
  913. package/dist/utils/terminalEmitPlan.js.map +1 -0
  914. package/dist/utils/thinkingRender.d.ts +74 -0
  915. package/dist/utils/thinkingRender.d.ts.map +1 -0
  916. package/dist/utils/thinkingRender.js +85 -0
  917. package/dist/utils/thinkingRender.js.map +1 -0
  918. package/dist/utils/threadStatusReport.d.ts +55 -0
  919. package/dist/utils/threadStatusReport.d.ts.map +1 -0
  920. package/dist/utils/threadStatusReport.js +65 -0
  921. package/dist/utils/threadStatusReport.js.map +1 -0
  922. package/dist/utils/threadToggle.d.ts +29 -0
  923. package/dist/utils/threadToggle.d.ts.map +1 -0
  924. package/dist/utils/threadToggle.js +39 -0
  925. package/dist/utils/threadToggle.js.map +1 -0
  926. package/dist/utils/timezone.d.ts +125 -0
  927. package/dist/utils/timezone.d.ts.map +1 -0
  928. package/dist/utils/timezone.js +278 -0
  929. package/dist/utils/timezone.js.map +1 -0
  930. package/dist/utils/tmuxExec.d.ts +61 -0
  931. package/dist/utils/tmuxExec.d.ts.map +1 -0
  932. package/dist/utils/tmuxExec.js +109 -0
  933. package/dist/utils/tmuxExec.js.map +1 -0
  934. package/dist/utils/tmuxSessionName.d.ts +34 -0
  935. package/dist/utils/tmuxSessionName.d.ts.map +1 -0
  936. package/dist/utils/tmuxSessionName.js +51 -0
  937. package/dist/utils/tmuxSessionName.js.map +1 -0
  938. package/dist/utils/toolResultRender.d.ts +61 -0
  939. package/dist/utils/toolResultRender.d.ts.map +1 -0
  940. package/dist/utils/toolResultRender.js +62 -0
  941. package/dist/utils/toolResultRender.js.map +1 -0
  942. package/dist/utils/topicRequest.d.ts +61 -0
  943. package/dist/utils/topicRequest.d.ts.map +1 -0
  944. package/dist/utils/topicRequest.js +68 -0
  945. package/dist/utils/topicRequest.js.map +1 -0
  946. package/dist/utils/topicView.d.ts +55 -0
  947. package/dist/utils/topicView.d.ts.map +1 -0
  948. package/dist/utils/topicView.js +56 -0
  949. package/dist/utils/topicView.js.map +1 -0
  950. package/dist/utils/transcribeAudio.d.ts +89 -0
  951. package/dist/utils/transcribeAudio.d.ts.map +1 -0
  952. package/dist/utils/transcribeAudio.js +249 -0
  953. package/dist/utils/transcribeAudio.js.map +1 -0
  954. package/dist/utils/transientFrames.d.ts +52 -0
  955. package/dist/utils/transientFrames.d.ts.map +1 -0
  956. package/dist/utils/transientFrames.js +41 -0
  957. package/dist/utils/transientFrames.js.map +1 -0
  958. package/dist/utils/typingActive.d.ts +35 -0
  959. package/dist/utils/typingActive.d.ts.map +1 -0
  960. package/dist/utils/typingActive.js +22 -0
  961. package/dist/utils/typingActive.js.map +1 -0
  962. package/dist/utils/typingLoopBackstop.d.ts +64 -0
  963. package/dist/utils/typingLoopBackstop.d.ts.map +1 -0
  964. package/dist/utils/typingLoopBackstop.js +68 -0
  965. package/dist/utils/typingLoopBackstop.js.map +1 -0
  966. package/dist/utils/verbosityRender.d.ts +18 -0
  967. package/dist/utils/verbosityRender.d.ts.map +1 -0
  968. package/dist/utils/verbosityRender.js +17 -0
  969. package/dist/utils/verbosityRender.js.map +1 -0
  970. package/dist/utils/wedgeRecovery.d.ts +57 -0
  971. package/dist/utils/wedgeRecovery.d.ts.map +1 -0
  972. package/dist/utils/wedgeRecovery.js +24 -0
  973. package/dist/utils/wedgeRecovery.js.map +1 -0
  974. package/dist/utils.d.ts +30 -0
  975. package/dist/utils.d.ts.map +1 -0
  976. package/dist/utils.js +61 -0
  977. package/dist/utils.js.map +1 -0
  978. package/dist/validation.d.ts +113 -0
  979. package/dist/validation.d.ts.map +1 -0
  980. package/dist/validation.js +226 -0
  981. package/dist/validation.js.map +1 -0
  982. package/dist/voiceQueue.d.ts +7 -0
  983. package/dist/voiceQueue.d.ts.map +1 -0
  984. package/dist/voiceQueue.js +33 -0
  985. package/dist/voiceQueue.js.map +1 -0
  986. package/examples/.env.example +17 -0
  987. package/examples/docker-compose.yml +36 -0
  988. package/package.json +83 -4
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /**
3
+ * @description The Claude Code version gate for the json-stream lifecycle
4
+ * (plan 2026-10-04-claude-process-lifecycle, L-D10). A process may be stopped
5
+ * automatically (idle stop, per-turn stop) ONLY when its CLI reports the
6
+ * `system/background_tasks_changed` list — verified on 2.1.287 and never seen
7
+ * before it. Without that list a stop could kill background work (a background
8
+ * Bash, a Monitor, a background sub-agent): stdin EOF kills them ~5 s later
9
+ * (probe 2026-10-04). An unknown version (no `claude_code_version` on `init`)
10
+ * is treated as too old.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.minAutoStopClaudeCodeVersion = void 0;
14
+ exports.compareClaudeCodeVersions = compareClaudeCodeVersions;
15
+ exports.checkIsClaudeAutoStopSupported = checkIsClaudeAutoStopSupported;
16
+ exports.getPerTurnRefusedVersion = getPerTurnRefusedVersion;
17
+ /** The first Claude Code version whose stream-json reports the background-task list. */
18
+ exports.minAutoStopClaudeCodeVersion = '2.1.287';
19
+ const versionRe = /^(\d+)\.(\d+)\.(\d+)/;
20
+ /** Parse `major.minor.patch` (a trailing pre-release / build suffix is ignored); `null` for anything else. */
21
+ function parseClaudeCodeVersion(version) {
22
+ const match = versionRe.exec(version.trim());
23
+ if (!match)
24
+ return null;
25
+ return [Number(match[1]), Number(match[2]), Number(match[3])];
26
+ }
27
+ /**
28
+ * @description Compare two `major.minor.patch` versions numerically (so `2.1.300`
29
+ * sorts after `2.1.287`, which a string compare gets wrong). Returns a negative
30
+ * number, zero, or a positive number like `Array.prototype.sort` expects; `null`
31
+ * when either side does not parse.
32
+ */
33
+ function compareClaudeCodeVersions(left, right) {
34
+ const leftParts = parseClaudeCodeVersion(left);
35
+ const rightParts = parseClaudeCodeVersion(right);
36
+ if (!leftParts || !rightParts)
37
+ return null;
38
+ for (let index = 0; index < leftParts.length; index += 1) {
39
+ if (leftParts[index] !== rightParts[index])
40
+ return leftParts[index] - rightParts[index];
41
+ }
42
+ return 0;
43
+ }
44
+ /** Whether a process reporting `version` may be auto-stopped (L-D10); `null` / unparseable → `false`. */
45
+ function checkIsClaudeAutoStopSupported(version) {
46
+ if (version === null)
47
+ return false;
48
+ const comparison = compareClaudeCodeVersions(version, exports.minAutoStopClaudeCodeVersion);
49
+ return comparison !== null && comparison >= 0;
50
+ }
51
+ /**
52
+ * @description The version a switch of a conversation to the per-turn lifecycle
53
+ * is REFUSED on (L-D10, narrowed): its last known Claude Code version — from the
54
+ * live process or the persisted tail record — when that is below the gate;
55
+ * `null` when the switch is allowed. An unknown version allows it: the refusal is
56
+ * only decidable once a version is known, and the stop gate keeps an unknown or
57
+ * old process alive anyway.
58
+ */
59
+ function getPerTurnRefusedVersion(lastKnownVersion) {
60
+ return lastKnownVersion !== null && !checkIsClaudeAutoStopSupported(lastKnownVersion) ? lastKnownVersion : null;
61
+ }
62
+ //# sourceMappingURL=claudeCodeVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claudeCodeVersion.js","sourceRoot":"","sources":["../../src/utils/claudeCodeVersion.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAoBH,8DAQC;AAGD,wEAIC;AAUD,4DAEC;AA7CD,wFAAwF;AAC3E,QAAA,4BAA4B,GAAG,SAAS,CAAC;AAEtD,MAAM,SAAS,GAAG,sBAAsB,CAAC;AAEzC,8GAA8G;AAC9G,SAAS,sBAAsB,CAAC,OAAe;IAC7C,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7C,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC;AAED;;;;;GAKG;AACH,SAAgB,yBAAyB,CAAC,IAAY,EAAE,KAAa;IACnE,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IACjD,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAC3C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACzD,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,yGAAyG;AACzG,SAAgB,8BAA8B,CAAC,OAAsB;IACnE,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACnC,MAAM,UAAU,GAAG,yBAAyB,CAAC,OAAO,EAAE,oCAA4B,CAAC,CAAC;IACpF,OAAO,UAAU,KAAK,IAAI,IAAI,UAAU,IAAI,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,wBAAwB,CAAC,gBAA+B;IACtE,OAAO,gBAAgB,KAAK,IAAI,IAAI,CAAC,8BAA8B,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC;AAClH,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @description The `PreCompact` hook the bot hands every Claude session it starts,
3
+ * so the compaction Claude runs ON ITS OWN when the context overflows gets the
4
+ * same summary guidance as a bot-issued one.
5
+ *
6
+ * WHY this exists: a bot-issued compaction carries its instruction as
7
+ * `/compact <instruction>`, but the overflow-triggered (auto) compaction is started
8
+ * by the CLI itself and has no argument the bot could fill. It summarised with the
9
+ * default prompt: the loaded skills were not named, and the continuing session
10
+ * silently stopped following them. Claude Code runs `PreCompact` hooks before
11
+ * EVERY compaction (`trigger` `auto` and `manual`) and appends a hook's stdout to
12
+ * that compaction's custom instructions — measured on v2.1.289: an
13
+ * overflow-triggered compaction's summary opened with the line the hook printed.
14
+ * The hook rides `--settings <file>`, which is merged with the user's own settings
15
+ * and never writes to them.
16
+ *
17
+ * A bot-issued compaction already carries the same text, so the hook prints
18
+ * nothing when the compaction's `custom_instructions` (part of the JSON the hook
19
+ * reads on stdin) already contain the skills guidance — otherwise the model would
20
+ * get the instruction twice.
21
+ */
22
+ /**
23
+ * Name of the hook settings file inside `DATA_DIR`. ONE file shared by every
24
+ * session: its content is the same for all of them, and a session that outlives
25
+ * the bot (json-stream) must never find it deleted under it.
26
+ */
27
+ export declare const claudeCompactHookSettingsFileName = "claude-compact-hook.json";
28
+ /**
29
+ * @description The instruction the hook adds to a compaction the bot did not
30
+ * issue: D3 + the loaded-skills guidance. No closing section — that one exists for
31
+ * the bot's own idle-compaction report, which an overflow compaction never feeds.
32
+ */
33
+ export declare function getHookCompactionInstruction(): string;
34
+ /**
35
+ * @description Build the hook's shell command: print `instruction` unless the
36
+ * hook's stdin (the `PreCompact` input JSON) already contains `alreadySentMarker`.
37
+ * The marker is matched as a fixed string against the raw JSON, so it must be text
38
+ * JSON leaves unescaped — the caller passes the skills guidance, and a test pins
39
+ * that it qualifies.
40
+ */
41
+ export declare function buildPreCompactHookCommand(input: {
42
+ instruction: string;
43
+ alreadySentMarker: string;
44
+ }): string;
45
+ /** The `--settings` payload: one `PreCompact` command hook, no matcher (auto AND manual). */
46
+ export declare function buildClaudeCompactHookSettings(command: string): {
47
+ hooks: {
48
+ PreCompact: Array<{
49
+ hooks: Array<{
50
+ type: 'command';
51
+ command: string;
52
+ }>;
53
+ }>;
54
+ };
55
+ };
56
+ /**
57
+ * @description Write the hook settings file and return the `--settings <path>`
58
+ * argument pair for a Claude launch. Rewritten on every launch (atomic rename, so
59
+ * a concurrently starting session never reads a half-written file) so a changed
60
+ * guidance reaches the next session. A write failure returns `[]` and only logs:
61
+ * the hook improves a summary, it must never stop an agent from starting.
62
+ */
63
+ export declare function prepareClaudeCompactHookFlags(dataDir: string): string[];
64
+ //# sourceMappingURL=claudeCompactHook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claudeCompactHook.d.ts","sourceRoot":"","sources":["../../src/utils/claudeCompactHook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAWH;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,6BAA6B,CAAC;AAE5E;;;;GAIG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAOrD;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,GAAG,MAAM,CAET;AAED,6FAA6F;AAC7F,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG;IAC/D,KAAK,EAAE;QAAE,UAAU,EAAE,KAAK,CAAC;YAAE,KAAK,EAAE,KAAK,CAAC;gBAAE,IAAI,EAAE,SAAS,CAAC;gBAAC,OAAO,EAAE,MAAM,CAAA;aAAE,CAAC,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;CACtF,CAEA;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAiBvE"}
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ /**
3
+ * @description The `PreCompact` hook the bot hands every Claude session it starts,
4
+ * so the compaction Claude runs ON ITS OWN when the context overflows gets the
5
+ * same summary guidance as a bot-issued one.
6
+ *
7
+ * WHY this exists: a bot-issued compaction carries its instruction as
8
+ * `/compact <instruction>`, but the overflow-triggered (auto) compaction is started
9
+ * by the CLI itself and has no argument the bot could fill. It summarised with the
10
+ * default prompt: the loaded skills were not named, and the continuing session
11
+ * silently stopped following them. Claude Code runs `PreCompact` hooks before
12
+ * EVERY compaction (`trigger` `auto` and `manual`) and appends a hook's stdout to
13
+ * that compaction's custom instructions — measured on v2.1.289: an
14
+ * overflow-triggered compaction's summary opened with the line the hook printed.
15
+ * The hook rides `--settings <file>`, which is merged with the user's own settings
16
+ * and never writes to them.
17
+ *
18
+ * A bot-issued compaction already carries the same text, so the hook prints
19
+ * nothing when the compaction's `custom_instructions` (part of the JSON the hook
20
+ * reads on stdin) already contain the skills guidance — otherwise the model would
21
+ * get the instruction twice.
22
+ */
23
+ var __importDefault = (this && this.__importDefault) || function (mod) {
24
+ return (mod && mod.__esModule) ? mod : { "default": mod };
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.claudeCompactHookSettingsFileName = void 0;
28
+ exports.getHookCompactionInstruction = getHookCompactionInstruction;
29
+ exports.buildPreCompactHookCommand = buildPreCompactHookCommand;
30
+ exports.buildClaudeCompactHookSettings = buildClaudeCompactHookSettings;
31
+ exports.prepareClaudeCompactHookFlags = prepareClaudeCompactHookFlags;
32
+ const fs_1 = __importDefault(require("fs"));
33
+ const path_1 = __importDefault(require("path"));
34
+ const compactOnIdle_1 = require("./compactOnIdle");
35
+ const tmuxExec_1 = require("./tmuxExec");
36
+ /**
37
+ * Name of the hook settings file inside `DATA_DIR`. ONE file shared by every
38
+ * session: its content is the same for all of them, and a session that outlives
39
+ * the bot (json-stream) must never find it deleted under it.
40
+ */
41
+ exports.claudeCompactHookSettingsFileName = 'claude-compact-hook.json';
42
+ /**
43
+ * @description The instruction the hook adds to a compaction the bot did not
44
+ * issue: D3 + the loaded-skills guidance. No closing section — that one exists for
45
+ * the bot's own idle-compaction report, which an overflow compaction never feeds.
46
+ */
47
+ function getHookCompactionInstruction() {
48
+ return (0, compactOnIdle_1.buildCompactionInstruction)({
49
+ bakesSummaryGuidance: false,
50
+ summaryGuidance: compactOnIdle_1.compactionSummaryGuidance,
51
+ bakesSkillsGuidance: false,
52
+ skillsGuidance: compactOnIdle_1.compactionSkillsGuidance,
53
+ }) ?? '';
54
+ }
55
+ /**
56
+ * @description Build the hook's shell command: print `instruction` unless the
57
+ * hook's stdin (the `PreCompact` input JSON) already contains `alreadySentMarker`.
58
+ * The marker is matched as a fixed string against the raw JSON, so it must be text
59
+ * JSON leaves unescaped — the caller passes the skills guidance, and a test pins
60
+ * that it qualifies.
61
+ */
62
+ function buildPreCompactHookCommand(input) {
63
+ return `grep -qF -e ${(0, tmuxExec_1.shellSingleQuote)(input.alreadySentMarker)} || printf '%s\\n' ${(0, tmuxExec_1.shellSingleQuote)(input.instruction)}`;
64
+ }
65
+ /** The `--settings` payload: one `PreCompact` command hook, no matcher (auto AND manual). */
66
+ function buildClaudeCompactHookSettings(command) {
67
+ return { hooks: { PreCompact: [{ hooks: [{ type: 'command', command }] }] } };
68
+ }
69
+ /**
70
+ * @description Write the hook settings file and return the `--settings <path>`
71
+ * argument pair for a Claude launch. Rewritten on every launch (atomic rename, so
72
+ * a concurrently starting session never reads a half-written file) so a changed
73
+ * guidance reaches the next session. A write failure returns `[]` and only logs:
74
+ * the hook improves a summary, it must never stop an agent from starting.
75
+ */
76
+ function prepareClaudeCompactHookFlags(dataDir) {
77
+ const settingsPath = path_1.default.join(dataDir, exports.claudeCompactHookSettingsFileName);
78
+ const command = buildPreCompactHookCommand({
79
+ instruction: getHookCompactionInstruction(),
80
+ alreadySentMarker: compactOnIdle_1.compactionSkillsGuidance,
81
+ });
82
+ const tmpPath = `${settingsPath}.${process.pid}.${Date.now()}.tmp`;
83
+ try {
84
+ fs_1.default.mkdirSync(dataDir, { recursive: true });
85
+ fs_1.default.writeFileSync(tmpPath, JSON.stringify(buildClaudeCompactHookSettings(command)));
86
+ fs_1.default.renameSync(tmpPath, settingsPath);
87
+ }
88
+ catch (e) {
89
+ console.warn(`[compact-hook] cannot write ${settingsPath}:`, e);
90
+ try {
91
+ fs_1.default.unlinkSync(tmpPath);
92
+ }
93
+ catch { /* never written */ }
94
+ return [];
95
+ }
96
+ return ['--settings', settingsPath];
97
+ }
98
+ //# sourceMappingURL=claudeCompactHook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claudeCompactHook.js","sourceRoot":"","sources":["../../src/utils/claudeCompactHook.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;AAuBH,oEAOC;AASD,gEAKC;AAGD,wEAIC;AASD,sEAiBC;AA3ED,4CAAoB;AACpB,gDAAwB;AACxB,mDAIyB;AACzB,yCAA8C;AAE9C;;;;GAIG;AACU,QAAA,iCAAiC,GAAG,0BAA0B,CAAC;AAE5E;;;;GAIG;AACH,SAAgB,4BAA4B;IAC1C,OAAO,IAAA,0CAA0B,EAAC;QAChC,oBAAoB,EAAE,KAAK;QAC3B,eAAe,EAAE,yCAAyB;QAC1C,mBAAmB,EAAE,KAAK;QAC1B,cAAc,EAAE,wCAAwB;KACzC,CAAC,IAAI,EAAE,CAAC;AACX,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,0BAA0B,CAAC,KAG1C;IACC,OAAO,eAAe,IAAA,2BAAgB,EAAC,KAAK,CAAC,iBAAiB,CAAC,sBAAsB,IAAA,2BAAgB,EAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;AAC7H,CAAC;AAED,6FAA6F;AAC7F,SAAgB,8BAA8B,CAAC,OAAe;IAG5D,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AAChF,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,6BAA6B,CAAC,OAAe;IAC3D,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,yCAAiC,CAAC,CAAC;IAC3E,MAAM,OAAO,GAAG,0BAA0B,CAAC;QACzC,WAAW,EAAE,4BAA4B,EAAE;QAC3C,iBAAiB,EAAE,wCAAwB;KAC5C,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,GAAG,YAAY,IAAI,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC;IACnE,IAAI,CAAC;QACH,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACnF,YAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,+BAA+B,YAAY,GAAG,EAAE,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC;YAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAC7D,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,208 @@
1
+ /**
2
+ * @description Pure decision for the Claude per-thread liveness loop: given the
3
+ * session's current busy state, whether a rolling status frame is on screen,
4
+ * whether real output is actively streaming, and whether this tick crossed a
5
+ * busy→idle edge, decide what the loop should do with the status frame.
6
+ *
7
+ * Why a separate machine (not folded into the status coalescer): the live bug
8
+ * (#11) is that a busy Claude session can show NOTHING in Telegram — the frame
9
+ * is emitted only opportunistically when a spinner line happens to be scraped,
10
+ * and `handleAgentOutput` DELETES it on every real output chunk. So while the
11
+ * agent keeps working after some output (or thinks quietly during the poll
12
+ * backoff) the topic looks idle/hung. The fix drives the frame off the cheap,
13
+ * reliable `checkIsBusy` footer signal instead of the scrape, and this pure
14
+ * function is the single owner of the create/tick/delete decision so the loop
15
+ * and `handleAgentOutput` can't thrash (delete→instant-recreate flicker / a
16
+ * 429 storm of editMessageText).
17
+ *
18
+ * Extracted from `bot.ts` so the rule is unit-testable without the
19
+ * Telegraf / tmux machinery (same pattern as `statusFlushDecision.ts`).
20
+ *
21
+ * @name ClaudeLivenessAction
22
+ *
23
+ * (S1/S2 — working-status un-freeze + pane-static idle removal, plan
24
+ * `2026-06-29-claude-working-status-liveness-and-idle-removal.md`: this module
25
+ * also owns {@link buildClaudeLivenessFrameText} — the frame text carries a live
26
+ * elapsed `m:ss` so a glyph-only tick is no longer the ONLY change the dedup
27
+ * strips — and {@link checkShouldForceIdleRemoval} — the 30s pane-static net.)
28
+ * @description
29
+ * - `create` — busy, no frame on screen, output not streaming: send a fresh
30
+ * activity frame to the bottom of the topic (THE bug — recreate after an
31
+ * output chunk deleted it while work continues).
32
+ * - `tick` — busy, frame already present, output not streaming: re-edit it
33
+ * so it reads as alive during a quiet thinking stretch / poll backoff.
34
+ * - `delete` — the session went idle (busy→idle edge or simply not busy) and a
35
+ * frame is still on screen: remove it (idle-only removal).
36
+ * - `noop` — nothing to do: output is actively streaming (let it own the
37
+ * message — don't fight it), or the session is idle with no frame.
38
+ */
39
+ export type ClaudeLivenessAction = 'create' | 'tick' | 'delete' | 'noop';
40
+ export interface ClaudeLivenessActionInput {
41
+ /** Is the Claude session mid-turn right now (`adapter.checkIsBusy`)? */
42
+ isBusy: boolean;
43
+ /** Is a rolling status frame currently on screen for this thread? */
44
+ hasStatusFrame: boolean;
45
+ /** Is real agent output actively streaming (queued / debouncing / sending)? */
46
+ isOutputStreaming: boolean;
47
+ /**
48
+ * Did this tick observe a busy→idle edge? Folds into the same removal as
49
+ * `!isBusy`; kept explicit so a caller that tracks the edge (and tests) can
50
+ * assert the transition removes the frame even if a later poll flips busy
51
+ * back on.
52
+ */
53
+ idleTransition: boolean;
54
+ /**
55
+ * Idle-removal latch (S2): a previous tick force-removed the frame because
56
+ * the scraped pane went static for ≥ the idle threshold, so the agent is
57
+ * treated as idle until the next prompt re-arms activity. While latched the
58
+ * loop must NEVER `create`/`tick` a fresh working frame (it would resurrect
59
+ * the very status the 30s net just removed); a stray frame is cleaned up.
60
+ * Cleared on a new prompt / the next fresh liveness arm.
61
+ */
62
+ isSuppressed: boolean;
63
+ }
64
+ /**
65
+ * @description Decide what the Claude liveness loop should do this tick.
66
+ *
67
+ * Priority order matters:
68
+ * 1. Streaming output wins — never edit/delete the frame while output owns the
69
+ * message (anti-thrash with `handleAgentOutput`'s delete-on-output).
70
+ * 2. Idle (edge or steady) with a frame still up → `delete` (idle-only removal;
71
+ * a false-idle would reintroduce the gap, a false-busy a stuck spinner, so
72
+ * the caller anchors `isBusy` to the footer signal that drops on idle).
73
+ * 3. Busy without a frame → `create` (the bug).
74
+ * 4. Busy with a frame → `tick` (keep it visibly alive).
75
+ * 5. Otherwise (idle, no frame) → `noop`.
76
+ */
77
+ export declare function getClaudeLivenessAction(input: ClaudeLivenessActionInput): ClaudeLivenessAction;
78
+ /**
79
+ * @description Whether the liveness loop may STOP after this tick. Kept separate
80
+ * from the create/tick/delete action because the stop decision must ALSO weigh
81
+ * the status COALESCER: `sendStatusFrame` stores `statusMessageId` only AFTER its
82
+ * network await, so a frame create can still be in flight on a tick that reads
83
+ * `hasStatusFrame === false`. Stopping then strands the just-sent frame with no
84
+ * loop left to delete it on idle — an orphan that lingers until the next message
85
+ * (live 2026-06-29: a hung "☁️ thinking …" whose final frame landed exactly as
86
+ * the agent went idle, so the idle tick saw no frame, stopped, and the send then
87
+ * resurrected one with nothing watching it).
88
+ *
89
+ * Stop ONLY when idle, no frame tracked, AND the coalescer is fully drained
90
+ * (nothing in flight, queued, or deferred behind a 429 cooldown). While any of
91
+ * those hold, keep ticking: the pending send lands, the next idle tick deletes
92
+ * the frame, and the loop then stops cleanly.
93
+ *
94
+ * S2 busy-onset arming grace: when the loop is armed by a freshly-forwarded
95
+ * prompt (not by a scrape emit), Claude has not flipped its footer busy signal
96
+ * yet, so the first tick reads idle. Without the grace the loop would self-stop
97
+ * immediately (idle, no frame, nothing pending) and never show a working frame
98
+ * for a long quiet think. While `withinArmingGrace`, NEVER stop — keep ticking
99
+ * until Claude goes busy (normal flow takes over) or the grace expires (then the
100
+ * idle stop applies as usual).
101
+ */
102
+ export declare function getClaudeLivenessShouldStop(input: {
103
+ isBusy: boolean;
104
+ hasStatusFrame: boolean;
105
+ statusSendPending: boolean;
106
+ withinArmingGrace: boolean;
107
+ }): boolean;
108
+ /**
109
+ * @description Resolve what `sendStatusFrame` must do with a status message it
110
+ * just CREATED (a brand-new Telegram message id, from the no-existing-frame
111
+ * branch), once the create's `await` resolves.
112
+ *
113
+ * The bug this guards (#11 follow-up — orphaned/duplicate spinner frames): the
114
+ * status-frame lifecycle mutates `statusMessageId` across `await` boundaries
115
+ * from THREE concurrent paths — the liveness tick (`create`/`tick`), the scraped
116
+ * status coalescer, and `handleAgentOutput`'s delete-on-output. `sendStatusFrame`
117
+ * reads `statusMessageId` at entry but only writes the new id back AFTER its
118
+ * network `await`. If a `deleteStatusMessage` runs during that window it sees a
119
+ * still-`null` id (or a stale one), deletes nothing of the in-flight message, and
120
+ * the create then resurrects `statusMessageId` pointing at a message nothing will
121
+ * ever remove → an orphan left on screen after idle, and a second `create` (the
122
+ * next glyph tick) spawning a SEPARATE message instead of editing the one frame.
123
+ *
124
+ * Fix: a monotonic per-thread `generation`, bumped on every `deleteStatusMessage`.
125
+ * `sendStatusFrame` captures the generation before creating, and feeds it here
126
+ * with the generation observed after the `await`:
127
+ * - unchanged → `store` : safe to record the new id as the single tracked frame.
128
+ * - changed → `discard` : a delete (idle / output-supersede) landed mid-create;
129
+ * the new message is already orphaned — delete it, DON'T store its id.
130
+ *
131
+ * Pure + tiny so the invariant ("delete during an in-flight create wins, no
132
+ * orphan, single tracked id") is unit-testable without the Telegraf/tmux stack.
133
+ */
134
+ export type StatusFrameStoreDecision = 'store' | 'discard';
135
+ export declare function getStatusFrameStoreDecision(generationAtCreateStart: number, generationNow: number): StatusFrameStoreDecision;
136
+ /**
137
+ * @description Decide whether the liveness loop should RE-RENDER+SEND the
138
+ * working-status frame on this tick (S3 — cooldown-scaled throttle).
139
+ *
140
+ * Mirrors the relay output debounce ({@link ./outputFlushTiming.ts}): the 1s
141
+ * idle-CHECK tick must not turn into a per-second `editMessageText`, so a `tick`
142
+ * (frame already on screen) only re-sends after the throttle window. The window
143
+ * is the LONGER of the base refresh floor and the live remaining 429 cooldown —
144
+ * so while the chat is throttling, the status frame coalesces into one larger,
145
+ * later edit instead of piling more requests onto the storm (the status frame was
146
+ * ~half the 429-storm traffic, live 2026-06-29). A `create` (no frame yet) always
147
+ * sends so the indicator appears immediately, regardless of cooldown.
148
+ *
149
+ * Pure so the cadence rule is unit-testable without the Telegraf/tmux stack.
150
+ */
151
+ export declare function checkShouldSendLivenessFrame(input: {
152
+ /** Is this a `create` (no frame on screen yet)? Then always send. */
153
+ isCreate: boolean;
154
+ /** Ms since the loop last sent the frame. */
155
+ msSinceLastSent: number;
156
+ /** Base refresh floor (`claudeWorkingStatusRefreshMs`). */
157
+ refreshMs: number;
158
+ /** Live remaining 429 cooldown for the chat, ms (0 when not limited). */
159
+ remainingCooldownMs: number;
160
+ }): boolean;
161
+ /**
162
+ * @description Build the Claude working-status frame text (S1 un-freeze).
163
+ *
164
+ * Root cause of the freeze: the loop rotated a leading spinner glyph each tick
165
+ * to look alive, but `getStatusFlushAction` STRIPS that lead glyph before its
166
+ * dedup compare — so when the scraped activity line had no ticking tail (a
167
+ * generic tool / "working…" indicator), the only thing changing was the part
168
+ * the dedup removed → every tick `skip`ped → the frame sat static for minutes,
169
+ * indistinguishable from a hung agent.
170
+ *
171
+ * Fix: append a live elapsed `m:ss` tail (reusing the shared {@link formatElapsed}
172
+ * the sub-agent status uses) anchored at `workingSince`. The elapsed advances
173
+ * every second and is NOT stripped by `stripLeadingSpinnerGlyph`, so a re-render
174
+ * a few seconds later differs after the glyph strip → the coalescer `send`s it →
175
+ * the frame visibly ticks. Prefers the scraped activity word (e.g. "Clauding…",
176
+ * lead glyph swapped for our rotating one) over `fallbackText` (a neutral
177
+ * localized "working…"). `workingSince === null` ⇒ no tail (defensive; the loop
178
+ * always sets it on a fresh turn).
179
+ */
180
+ export declare function buildClaudeLivenessFrameText(input: {
181
+ /** Rotating heartbeat glyph for this tick (from `CLAUDE_LIVENESS_GLYPHS`). */
182
+ glyph: string;
183
+ /** Latest scraped activity line, or null when none has been seen this turn. */
184
+ activityText: string | null;
185
+ /** Already-localized neutral fallback (i18n `agent.workingIndicator`). */
186
+ fallbackText: string;
187
+ /** Epoch ms the current busy turn started, or null when not tracking. */
188
+ workingSince: number | null;
189
+ /** Now, epoch ms — the elapsed base for `m:ss`. */
190
+ nowMs: number;
191
+ }): string;
192
+ /**
193
+ * @description S2 hard anti-hang net: should the liveness loop FORCE-remove the
194
+ * working-status frame because the scraped TUI pane has gone static for too long?
195
+ *
196
+ * The frame is normally removed on the busy→idle edge (`getClaudeLivenessAction`
197
+ * `delete`), but that anchors on Claude's footer busy signal, which can wrongly
198
+ * stay "busy" after a turn ends — leaving a working status hanging for minutes
199
+ * (live 2026-06-29). A genuinely working agent keeps the pane changing every
200
+ * second (animated spinner + the TUI's own elapsed timer), so a pane that has
201
+ * NOT changed for `idlePaneThresholdMs` is idle regardless of the footer: remove
202
+ * the frame and stop the loop. `null` age (no live session) never triggers it.
203
+ */
204
+ export declare function checkShouldForceIdleRemoval(input: {
205
+ msSincePaneChange: number | null;
206
+ idlePaneThresholdMs: number;
207
+ }): boolean;
208
+ //# sourceMappingURL=claudeLivenessAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claudeLivenessAction.d.ts","sourceRoot":"","sources":["../../src/utils/claudeLivenessAction.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEzE,MAAM,WAAW,yBAAyB;IACxC,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAC;IAChB,qEAAqE;IACrE,cAAc,EAAE,OAAO,CAAC;IACxB,+EAA+E;IAC/E,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB;;;;;;;OAOG;IACH,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,yBAAyB,GAAG,oBAAoB,CAU9F;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;CAC5B,GAAG,OAAO,CAGV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,SAAS,CAAC;AAE3D,wBAAgB,2BAA2B,CACzC,uBAAuB,EAAE,MAAM,EAC/B,aAAa,EAAE,MAAM,GACpB,wBAAwB,CAE1B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,qEAAqE;IACrE,QAAQ,EAAE,OAAO,CAAC;IAClB,6CAA6C;IAC7C,eAAe,EAAE,MAAM,CAAC;IACxB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,mBAAmB,EAAE,MAAM,CAAC;CAC7B,GAAG,OAAO,CAGV;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAUT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,mBAAmB,EAAE,MAAM,CAAC;CAC7B,GAAG,OAAO,CAGV"}
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getClaudeLivenessAction = getClaudeLivenessAction;
4
+ exports.getClaudeLivenessShouldStop = getClaudeLivenessShouldStop;
5
+ exports.getStatusFrameStoreDecision = getStatusFrameStoreDecision;
6
+ exports.checkShouldSendLivenessFrame = checkShouldSendLivenessFrame;
7
+ exports.buildClaudeLivenessFrameText = buildClaudeLivenessFrameText;
8
+ exports.checkShouldForceIdleRemoval = checkShouldForceIdleRemoval;
9
+ const claudeScrapeShapes_1 = require("./claudeScrapeShapes");
10
+ const subagentStatusRender_1 = require("./subagentStatusRender");
11
+ /**
12
+ * @description Decide what the Claude liveness loop should do this tick.
13
+ *
14
+ * Priority order matters:
15
+ * 1. Streaming output wins — never edit/delete the frame while output owns the
16
+ * message (anti-thrash with `handleAgentOutput`'s delete-on-output).
17
+ * 2. Idle (edge or steady) with a frame still up → `delete` (idle-only removal;
18
+ * a false-idle would reintroduce the gap, a false-busy a stuck spinner, so
19
+ * the caller anchors `isBusy` to the footer signal that drops on idle).
20
+ * 3. Busy without a frame → `create` (the bug).
21
+ * 4. Busy with a frame → `tick` (keep it visibly alive).
22
+ * 5. Otherwise (idle, no frame) → `noop`.
23
+ */
24
+ function getClaudeLivenessAction(input) {
25
+ if (input.isOutputStreaming)
26
+ return 'noop';
27
+ if (!input.isBusy || input.idleTransition) {
28
+ return input.hasStatusFrame ? 'delete' : 'noop';
29
+ }
30
+ // Idle-removal latch (S2): the pane went static ≥ threshold this turn, so the
31
+ // agent is treated as idle until the next prompt. Never create/tick a fresh
32
+ // working frame while latched; clean up a stray one if it somehow exists.
33
+ if (input.isSuppressed)
34
+ return input.hasStatusFrame ? 'delete' : 'noop';
35
+ return input.hasStatusFrame ? 'tick' : 'create';
36
+ }
37
+ /**
38
+ * @description Whether the liveness loop may STOP after this tick. Kept separate
39
+ * from the create/tick/delete action because the stop decision must ALSO weigh
40
+ * the status COALESCER: `sendStatusFrame` stores `statusMessageId` only AFTER its
41
+ * network await, so a frame create can still be in flight on a tick that reads
42
+ * `hasStatusFrame === false`. Stopping then strands the just-sent frame with no
43
+ * loop left to delete it on idle — an orphan that lingers until the next message
44
+ * (live 2026-06-29: a hung "☁️ thinking …" whose final frame landed exactly as
45
+ * the agent went idle, so the idle tick saw no frame, stopped, and the send then
46
+ * resurrected one with nothing watching it).
47
+ *
48
+ * Stop ONLY when idle, no frame tracked, AND the coalescer is fully drained
49
+ * (nothing in flight, queued, or deferred behind a 429 cooldown). While any of
50
+ * those hold, keep ticking: the pending send lands, the next idle tick deletes
51
+ * the frame, and the loop then stops cleanly.
52
+ *
53
+ * S2 busy-onset arming grace: when the loop is armed by a freshly-forwarded
54
+ * prompt (not by a scrape emit), Claude has not flipped its footer busy signal
55
+ * yet, so the first tick reads idle. Without the grace the loop would self-stop
56
+ * immediately (idle, no frame, nothing pending) and never show a working frame
57
+ * for a long quiet think. While `withinArmingGrace`, NEVER stop — keep ticking
58
+ * until Claude goes busy (normal flow takes over) or the grace expires (then the
59
+ * idle stop applies as usual).
60
+ */
61
+ function getClaudeLivenessShouldStop(input) {
62
+ if (input.withinArmingGrace)
63
+ return false;
64
+ return !input.isBusy && !input.hasStatusFrame && !input.statusSendPending;
65
+ }
66
+ function getStatusFrameStoreDecision(generationAtCreateStart, generationNow) {
67
+ return generationAtCreateStart === generationNow ? 'store' : 'discard';
68
+ }
69
+ /**
70
+ * @description Decide whether the liveness loop should RE-RENDER+SEND the
71
+ * working-status frame on this tick (S3 — cooldown-scaled throttle).
72
+ *
73
+ * Mirrors the relay output debounce ({@link ./outputFlushTiming.ts}): the 1s
74
+ * idle-CHECK tick must not turn into a per-second `editMessageText`, so a `tick`
75
+ * (frame already on screen) only re-sends after the throttle window. The window
76
+ * is the LONGER of the base refresh floor and the live remaining 429 cooldown —
77
+ * so while the chat is throttling, the status frame coalesces into one larger,
78
+ * later edit instead of piling more requests onto the storm (the status frame was
79
+ * ~half the 429-storm traffic, live 2026-06-29). A `create` (no frame yet) always
80
+ * sends so the indicator appears immediately, regardless of cooldown.
81
+ *
82
+ * Pure so the cadence rule is unit-testable without the Telegraf/tmux stack.
83
+ */
84
+ function checkShouldSendLivenessFrame(input) {
85
+ if (input.isCreate)
86
+ return true;
87
+ return input.msSinceLastSent >= Math.max(input.refreshMs, input.remainingCooldownMs);
88
+ }
89
+ /**
90
+ * @description Build the Claude working-status frame text (S1 un-freeze).
91
+ *
92
+ * Root cause of the freeze: the loop rotated a leading spinner glyph each tick
93
+ * to look alive, but `getStatusFlushAction` STRIPS that lead glyph before its
94
+ * dedup compare — so when the scraped activity line had no ticking tail (a
95
+ * generic tool / "working…" indicator), the only thing changing was the part
96
+ * the dedup removed → every tick `skip`ped → the frame sat static for minutes,
97
+ * indistinguishable from a hung agent.
98
+ *
99
+ * Fix: append a live elapsed `m:ss` tail (reusing the shared {@link formatElapsed}
100
+ * the sub-agent status uses) anchored at `workingSince`. The elapsed advances
101
+ * every second and is NOT stripped by `stripLeadingSpinnerGlyph`, so a re-render
102
+ * a few seconds later differs after the glyph strip → the coalescer `send`s it →
103
+ * the frame visibly ticks. Prefers the scraped activity word (e.g. "Clauding…",
104
+ * lead glyph swapped for our rotating one) over `fallbackText` (a neutral
105
+ * localized "working…"). `workingSince === null` ⇒ no tail (defensive; the loop
106
+ * always sets it on a fresh turn).
107
+ */
108
+ function buildClaudeLivenessFrameText(input) {
109
+ const elapsedSuffix = input.workingSince === null ? '' : ` · ${(0, subagentStatusRender_1.formatElapsed)(input.nowMs - input.workingSince)}`;
110
+ const activity = input.activityText?.trim();
111
+ if (activity) {
112
+ // Swap the scrape's own leading spinner glyph for our rotating one so the
113
+ // heartbeat shows while preserving the activity word + any scraped tail.
114
+ return `${input.glyph} ${(0, claudeScrapeShapes_1.stripLeadingSpinnerGlyph)(activity)}${elapsedSuffix}`;
115
+ }
116
+ return `${input.fallbackText}${elapsedSuffix}`;
117
+ }
118
+ /**
119
+ * @description S2 hard anti-hang net: should the liveness loop FORCE-remove the
120
+ * working-status frame because the scraped TUI pane has gone static for too long?
121
+ *
122
+ * The frame is normally removed on the busy→idle edge (`getClaudeLivenessAction`
123
+ * `delete`), but that anchors on Claude's footer busy signal, which can wrongly
124
+ * stay "busy" after a turn ends — leaving a working status hanging for minutes
125
+ * (live 2026-06-29). A genuinely working agent keeps the pane changing every
126
+ * second (animated spinner + the TUI's own elapsed timer), so a pane that has
127
+ * NOT changed for `idlePaneThresholdMs` is idle regardless of the footer: remove
128
+ * the frame and stop the loop. `null` age (no live session) never triggers it.
129
+ */
130
+ function checkShouldForceIdleRemoval(input) {
131
+ if (input.msSincePaneChange === null)
132
+ return false;
133
+ return input.msSincePaneChange >= input.idlePaneThresholdMs;
134
+ }
135
+ //# sourceMappingURL=claudeLivenessAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claudeLivenessAction.js","sourceRoot":"","sources":["../../src/utils/claudeLivenessAction.ts"],"names":[],"mappings":";;AAiFA,0DAUC;AA0BD,kEAQC;AA8BD,kEAKC;AAiBD,oEAYC;AAqBD,oEAqBC;AAcD,kEAMC;AA3PD,6DAAgE;AAChE,iEAAuD;AAmEvD;;;;;;;;;;;;GAYG;AACH,SAAgB,uBAAuB,CAAC,KAAgC;IACtE,IAAI,KAAK,CAAC,iBAAiB;QAAE,OAAO,MAAM,CAAC;IAC3C,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IAClD,CAAC;IACD,8EAA8E;IAC9E,4EAA4E;IAC5E,0EAA0E;IAC1E,IAAI,KAAK,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IACxE,OAAO,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;AAClD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAgB,2BAA2B,CAAC,KAK3C;IACC,IAAI,KAAK,CAAC,iBAAiB;QAAE,OAAO,KAAK,CAAC;IAC1C,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC;AAC5E,CAAC;AA8BD,SAAgB,2BAA2B,CACzC,uBAA+B,EAC/B,aAAqB;IAErB,OAAO,uBAAuB,KAAK,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACzE,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,4BAA4B,CAAC,KAS5C;IACC,IAAI,KAAK,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,KAAK,CAAC,eAAe,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;AACvF,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,4BAA4B,CAAC,KAW5C;IACC,MAAM,aAAa,GACjB,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,IAAA,oCAAa,EAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;IAC7F,MAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC;IAC5C,IAAI,QAAQ,EAAE,CAAC;QACb,0EAA0E;QAC1E,yEAAyE;QACzE,OAAO,GAAG,KAAK,CAAC,KAAK,IAAI,IAAA,6CAAwB,EAAC,QAAQ,CAAC,GAAG,aAAa,EAAE,CAAC;IAChF,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,YAAY,GAAG,aAAa,EAAE,CAAC;AACjD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,2BAA2B,CAAC,KAG3C;IACC,IAAI,KAAK,CAAC,iBAAiB,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACnD,OAAO,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,mBAAmB,CAAC;AAC9D,CAAC"}