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,148 @@
1
+ import { type SessionKey } from './sessionKey';
2
+ import type { UsageLimitWait } from './requests/limitWaitAnswer';
3
+ import type { BufferedPromptSettled } from './startupPromptBuffer';
4
+ import type { PromptDelivery } from './utils/promptDelivery';
5
+ import type { AgentApiErrorClass, ApiRetryState } from './types';
6
+ /**
7
+ * The retry kick and the boot restore of the API-error auto-retry (plan S4–S6),
8
+ * lifted out of `bot.ts` behind injected ports so the whole lifecycle — arm, fire,
9
+ * restart — runs in a test. `apiErrorRetry.ts` holds the pure decisions and
10
+ * `bot.ts` still arms and cancels a retry; this file owns what happens when its
11
+ * timer fires and when the bot comes back up.
12
+ */
13
+ /**
14
+ * Catch-up delay for a retry whose `fireAt` is already in the past at boot.
15
+ * Small (not zero) so the kick is armed via `setTimeout` instead of firing
16
+ * synchronously in the adopt tick — a freshly-adopted Claude pane may still be
17
+ * repainting, and the Enter-verification in `sendInput` covers the residual race.
18
+ */
19
+ export declare const apiRetryCatchUpDelayMs = 5000;
20
+ /**
21
+ * @description One thread's live armed-retry timer + bookkeeping. The persisted
22
+ * twin lives in `state.json` (`ApiRetryState`); this in-memory entry additionally
23
+ * holds the actual `NodeJS.Timeout` (not serialisable) and `firedAt` (set when
24
+ * the timer fires) so `decideRetryAction` can tell a same-episode recurrence
25
+ * (escalate) from a fresh one (reset to attempt 1).
26
+ */
27
+ export interface ApiRetryTimerEntry {
28
+ /** The armed timer, or `null` once it has fired (record kept until outcome known). */
29
+ timer: NodeJS.Timeout | null;
30
+ /** 1-based attempt the current/last timer was armed for. */
31
+ attempt: number;
32
+ /** Error class that armed it. */
33
+ kind: AgentApiErrorClass['kind'];
34
+ /** Epoch ms when the timer fired, or `null` while still pending. */
35
+ firedAt: number | null;
36
+ /** Epoch ms the timer is due (mirrors the persisted `fireAt`). It IDENTIFIES the
37
+ * episode for the «skip once» button, whose stale keyboard must never cancel a
38
+ * later one. */
39
+ fireAt: number;
40
+ /** How a usage-limit wait ends, for the limit answer of a request opened during it.
41
+ * Absent for a record re-armed at boot (`state.json` keeps only the instant). */
42
+ limitWait?: UsageLimitWait;
43
+ }
44
+ /** What the kick needs to know of {@link ensureAgentSession}'s answer. */
45
+ export type ApiRetryEnsureOutcome = {
46
+ ok: true;
47
+ } | {
48
+ ok: false;
49
+ reason: string;
50
+ message: string;
51
+ };
52
+ /** A message the kick posts into a topic (Telegram only — a tracker issue has no topic, R6). */
53
+ export type ApiRetryTopicNotice = {
54
+ kind: 'noSession';
55
+ message: string;
56
+ } | {
57
+ kind: 'resuming';
58
+ retryKind: AgentApiErrorClass['kind'];
59
+ };
60
+ /**
61
+ * @name ApiRetryKickDeps
62
+ * @description The ports of {@link runApiRetryKick}: `entries` and `kicksInFlight`
63
+ * are the bot's own retry map and in-flight set (the wake-up probe reads the set);
64
+ * everything else acts on the world — the session, the topic, the request ledger.
65
+ */
66
+ export interface ApiRetryKickDeps {
67
+ entries: Map<string, ApiRetryTimerEntry>;
68
+ /** Threads whose timer fired and whose "continue" nudge is not handed over yet. */
69
+ kicksInFlight: Set<string>;
70
+ now: () => number;
71
+ /** A session to nudge: the conversation's own, resumed when it sleeps (R26 for every platform, L-D4). */
72
+ ensureSession: (key: SessionKey) => Promise<ApiRetryEnsureOutcome>;
73
+ postTopicNotice: (key: SessionKey, notice: ApiRetryTopicNotice) => void;
74
+ /** The nudge, or the open request's own prompt the agent never took in (R21). */
75
+ getResumeMessage: (key: SessionKey, retryKind: AgentApiErrorClass['kind']) => {
76
+ text: string;
77
+ isRequestPrompt: boolean;
78
+ };
79
+ /** Through the startup buffer when another caller's start is still under way; a `buffered` nudge
80
+ * tells `onBufferedSettled` how its wait ended. */
81
+ deliverNudge: (key: SessionKey, text: string, onBufferedSettled: BufferedPromptSettled) => Promise<PromptDelivery>;
82
+ trackContinuation: (key: SessionKey, options: {
83
+ isCountersReset: boolean;
84
+ isRequestPrompt: boolean;
85
+ }) => Promise<void>;
86
+ /** Drop the retry's saved twin (`state.json`). */
87
+ clearSavedRetry: (key: SessionKey) => void;
88
+ }
89
+ /**
90
+ * @description The retry kick (timer callback): make sure a session is up (after
91
+ * an OpenCode `session.error` it still is, so `ensureSession` is a no-op and the
92
+ * nudge lands in the SAME live session — context intact; a sleeping session is
93
+ * resumed by its id, and only one with nothing to resume is started fresh via the
94
+ * thread's last adapter), tell the topic we're resuming, then hand over a neutral
95
+ * "continue" nudge. With no session to resume
96
+ * the topic gets the reason instead and nothing is forwarded.
97
+ *
98
+ * The saved record means ARMED, so once the kick has run its course — the nudge
99
+ * forwarded to the session, no session to nudge, or a delivery that threw — the saved
100
+ * twin goes: left behind, every restart would restore it as armed and fire the kick
101
+ * again (a second "resuming" notice, a second nudge into the topic or the issue's
102
+ * session). A nudge that only waits in the startup buffer behind another caller's
103
+ * session start has NOT run its course: the buffer is in memory, a restart loses it,
104
+ * and a fresh spawn lays the session log out anew, so the boot recovery finds no error
105
+ * to resume from either — the saved record is the only thing that fires it again. It
106
+ * stays until the buffer settles the nudge: `replayed` (handed to the session — a
107
+ * failed forward counts, as a direct delivery that threw does) or `dropped` (the start
108
+ * failed, or the session is not up when the window closes — the same as "no session to
109
+ * nudge": the starter reported the failure, an open request is left to the wake-up
110
+ * engine, and a record kept for a start that failed would only fire the kick again at
111
+ * the next restart).
112
+ *
113
+ * It goes only if `entries` still holds THIS entry: a recurrence armed meanwhile (a
114
+ * newer entry and its own saved record) or a cancel / give-up (entry gone, record
115
+ * already cleared) must not be undone by an older kick. The in-memory entry itself is
116
+ * intentionally KEPT after firing (timer nulled, `firedAt` stamped): a recurrence
117
+ * within the grace window re-arms at attempt+1 — that memory is not persisted.
118
+ */
119
+ export declare function runApiRetryKick(deps: ApiRetryKickDeps, key: SessionKey): Promise<void>;
120
+ /**
121
+ * @name ApiRetryRestoreDeps
122
+ * @description The ports of {@link restoreApiRetryTimers}: the bot's retry map,
123
+ * a clock, the served-platform filter and what a due timer does.
124
+ */
125
+ export interface ApiRetryRestoreDeps {
126
+ entries: Map<string, ApiRetryTimerEntry>;
127
+ now: () => number;
128
+ isServed: (key: SessionKey) => boolean;
129
+ /** A due timer: run the kick for `key`. */
130
+ fire: (key: SessionKey) => void;
131
+ }
132
+ /**
133
+ * @description Re-arm persisted API-error retries (S6) so a pending kick —
134
+ * especially a multi-hour usage-limit wait — survives a bot restart. The caller
135
+ * runs it AFTER the sessions are reattached, so each kick lands in a live session.
136
+ *
137
+ * For each record we re-populate `entries` and arm one unref'd timer at
138
+ * `fireAt - now` (clamped to `maxTimeoutMs`). A `fireAt` already in the past fires
139
+ * ONE catch-up after {@link apiRetryCatchUpDelayMs}. The arm notice is NOT re-posted
140
+ * (the user saw it before the restart); the `↻ resuming` notice fires when the
141
+ * timer fires.
142
+ *
143
+ * A retry of a platform this instance does not serve is neither armed nor dropped
144
+ * (Jira plan J3b, R10): its kick would start that conversation's session here,
145
+ * under this instance's environment and tmux server. Returns how many were re-armed.
146
+ */
147
+ export declare function restoreApiRetryTimers(deps: ApiRetryRestoreDeps, records: Readonly<Record<string, ApiRetryState>>): number;
148
+ //# sourceMappingURL=apiRetryKick.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiRetryKick.d.ts","sourceRoot":"","sources":["../src/apiRetryKick.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAA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C;IAC3C,IAAI,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,GAAG,MAAM,CA4BzH"}
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.apiRetryCatchUpDelayMs = void 0;
4
+ exports.runApiRetryKick = runApiRetryKick;
5
+ exports.restoreApiRetryTimers = restoreApiRetryTimers;
6
+ const sessionKey_1 = require("./sessionKey");
7
+ const sessionKeyCodec_1 = require("./connectors/telegram/sessionKeyCodec");
8
+ const engine_1 = require("./scheduler/engine");
9
+ /**
10
+ * The retry kick and the boot restore of the API-error auto-retry (plan S4–S6),
11
+ * lifted out of `bot.ts` behind injected ports so the whole lifecycle — arm, fire,
12
+ * restart — runs in a test. `apiErrorRetry.ts` holds the pure decisions and
13
+ * `bot.ts` still arms and cancels a retry; this file owns what happens when its
14
+ * timer fires and when the bot comes back up.
15
+ */
16
+ /**
17
+ * Catch-up delay for a retry whose `fireAt` is already in the past at boot.
18
+ * Small (not zero) so the kick is armed via `setTimeout` instead of firing
19
+ * synchronously in the adopt tick — a freshly-adopted Claude pane may still be
20
+ * repainting, and the Enter-verification in `sendInput` covers the residual race.
21
+ */
22
+ exports.apiRetryCatchUpDelayMs = 5_000;
23
+ /**
24
+ * @description The retry kick (timer callback): make sure a session is up (after
25
+ * an OpenCode `session.error` it still is, so `ensureSession` is a no-op and the
26
+ * nudge lands in the SAME live session — context intact; a sleeping session is
27
+ * resumed by its id, and only one with nothing to resume is started fresh via the
28
+ * thread's last adapter), tell the topic we're resuming, then hand over a neutral
29
+ * "continue" nudge. With no session to resume
30
+ * the topic gets the reason instead and nothing is forwarded.
31
+ *
32
+ * The saved record means ARMED, so once the kick has run its course — the nudge
33
+ * forwarded to the session, no session to nudge, or a delivery that threw — the saved
34
+ * twin goes: left behind, every restart would restore it as armed and fire the kick
35
+ * again (a second "resuming" notice, a second nudge into the topic or the issue's
36
+ * session). A nudge that only waits in the startup buffer behind another caller's
37
+ * session start has NOT run its course: the buffer is in memory, a restart loses it,
38
+ * and a fresh spawn lays the session log out anew, so the boot recovery finds no error
39
+ * to resume from either — the saved record is the only thing that fires it again. It
40
+ * stays until the buffer settles the nudge: `replayed` (handed to the session — a
41
+ * failed forward counts, as a direct delivery that threw does) or `dropped` (the start
42
+ * failed, or the session is not up when the window closes — the same as "no session to
43
+ * nudge": the starter reported the failure, an open request is left to the wake-up
44
+ * engine, and a record kept for a start that failed would only fire the kick again at
45
+ * the next restart).
46
+ *
47
+ * It goes only if `entries` still holds THIS entry: a recurrence armed meanwhile (a
48
+ * newer entry and its own saved record) or a cancel / give-up (entry gone, record
49
+ * already cleared) must not be undone by an older kick. The in-memory entry itself is
50
+ * intentionally KEPT after firing (timer nulled, `firedAt` stamped): a recurrence
51
+ * within the grace window re-arms at attempt+1 — that memory is not persisted.
52
+ */
53
+ async function runApiRetryKick(deps, key) {
54
+ const k = (0, sessionKey_1.keyToString)(key);
55
+ const entry = deps.entries.get(k);
56
+ if (!entry)
57
+ return;
58
+ // Claimed in the same tick the retry stops being armed (see `kicksInFlight`).
59
+ deps.kicksInFlight.add(k);
60
+ entry.timer = null;
61
+ entry.firedAt = deps.now();
62
+ const clearSavedRetryIfLive = () => {
63
+ if (deps.entries.get(k) === entry)
64
+ deps.clearSavedRetry(key);
65
+ };
66
+ let isNudgeBuffered = false;
67
+ try {
68
+ // R26: the conversation the limit interrupted is the one resumed — the ensure brings a sleeping
69
+ // session back by its id, for a topic as for a tracker issue (a fresh session would not know the work).
70
+ const ensured = await deps.ensureSession(key);
71
+ if (!ensured.ok) {
72
+ // No session to nudge (unbound, no adapter, a start that failed): a forward would hit a dead adapter, and
73
+ // watching a turn that never started would only mislead the wake-ups. The open request, if any, stays
74
+ // open for the wake-up engine (its backstop / retries); what was held stays held for the next session.
75
+ console.warn(`[apiRetry] not resuming ${k}: no session (${ensured.reason}); an open request is left to the wake-up engine`);
76
+ // A topic is told why nothing resumed — it waits for the operator's next message now (R6: not a tracker issue).
77
+ if ((0, sessionKeyCodec_1.checkIsTelegramKey)(key))
78
+ deps.postTopicNotice(key, { kind: 'noSession', message: ensured.message });
79
+ return;
80
+ }
81
+ // Announced only once there is a session to resume: a pinned "resuming" over a start that failed would
82
+ // read as work under way. The notices are topic messages (a pin among them): a tracker issue hears about
83
+ // the wait from the request's own answer, and has no topic for the rest (R6).
84
+ if ((0, sessionKeyCodec_1.checkIsTelegramKey)(key))
85
+ deps.postTopicNotice(key, { kind: 'resuming', retryKind: entry.kind });
86
+ // The nudge is NOT a request: the open request (if any) continues under it. A
87
+ // request whose prompt never reached the agent — the wait held it (R23) — gets
88
+ // that prompt instead (R21). Prompts held during the wait ride whichever it is.
89
+ const resume = deps.getResumeMessage(key, entry.kind);
90
+ const delivery = await deps.deliverNudge(key, resume.text, (outcome) => {
91
+ if (outcome === 'dropped') {
92
+ console.warn(`[apiRetry] nudge for ${k} dropped: the session did not come up; the retry is spent and an open request is left to the wake-up engine`);
93
+ }
94
+ clearSavedRetryIfLive();
95
+ });
96
+ isNudgeBuffered = delivery === 'buffered';
97
+ await deps.trackContinuation(key, {
98
+ isCountersReset: entry.kind === 'usageLimit',
99
+ isRequestPrompt: resume.isRequestPrompt,
100
+ });
101
+ }
102
+ catch (e) {
103
+ console.error('[apiRetry] kick failed:', e instanceof Error ? e.message : e);
104
+ }
105
+ finally {
106
+ deps.kicksInFlight.delete(k);
107
+ // A buffered nudge keeps the record: the buffer's settle callback clears it.
108
+ if (!isNudgeBuffered)
109
+ clearSavedRetryIfLive();
110
+ }
111
+ }
112
+ /**
113
+ * @description Re-arm persisted API-error retries (S6) so a pending kick —
114
+ * especially a multi-hour usage-limit wait — survives a bot restart. The caller
115
+ * runs it AFTER the sessions are reattached, so each kick lands in a live session.
116
+ *
117
+ * For each record we re-populate `entries` and arm one unref'd timer at
118
+ * `fireAt - now` (clamped to `maxTimeoutMs`). A `fireAt` already in the past fires
119
+ * ONE catch-up after {@link apiRetryCatchUpDelayMs}. The arm notice is NOT re-posted
120
+ * (the user saw it before the restart); the `↻ resuming` notice fires when the
121
+ * timer fires.
122
+ *
123
+ * A retry of a platform this instance does not serve is neither armed nor dropped
124
+ * (Jira plan J3b, R10): its kick would start that conversation's session here,
125
+ * under this instance's environment and tmux server. Returns how many were re-armed.
126
+ */
127
+ function restoreApiRetryTimers(deps, records) {
128
+ let restored = 0;
129
+ for (const [keyStr, record] of Object.entries(records)) {
130
+ let key;
131
+ try {
132
+ key = (0, sessionKey_1.keyFromString)(keyStr);
133
+ }
134
+ catch {
135
+ // Hand-edited / corrupt key (can't come from `keyToString`): skip it,
136
+ // keep booting. Tolerated-and-skipped, like restorePendingQuestions.
137
+ continue;
138
+ }
139
+ if (!deps.isServed(key))
140
+ continue;
141
+ const dueInMs = record.fireAt - deps.now();
142
+ const delayMs = dueInMs > 0 ? Math.min(dueInMs, engine_1.maxTimeoutMs) : exports.apiRetryCatchUpDelayMs;
143
+ const timer = setTimeout(() => {
144
+ deps.fire(key);
145
+ }, delayMs);
146
+ timer.unref?.();
147
+ deps.entries.set(keyStr, {
148
+ timer,
149
+ attempt: record.attempt,
150
+ kind: record.kind,
151
+ firedAt: null,
152
+ fireAt: record.fireAt,
153
+ });
154
+ restored += 1;
155
+ }
156
+ return restored;
157
+ }
158
+ //# sourceMappingURL=apiRetryKick.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiRetryKick.js","sourceRoot":"","sources":["../src/apiRetryKick.ts"],"names":[],"mappings":";;;AA+GA,0CAqDC;AA8BD,sDA4BC;AA9ND,6CAA2E;AAC3E,2EAA2E;AAC3E,+CAAkD;AAMlD;;;;;;GAMG;AAEH;;;;;GAKG;AACU,QAAA,sBAAsB,GAAG,KAAK,CAAC;AA2D5C;;;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jB,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,IAAI,GAAe,CAAC;QACpB,IAAI,CAAC;YACH,GAAG,GAAG,IAAA,0BAAa,EAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;QAAC,MAAM,CAAC;YACP,sEAAsE;YACtE,qEAAqE;YACrE,SAAS;QACX,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,SAAS;QAClC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC3C,MAAM,OAAO,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,qBAAY,CAAC,CAAC,CAAC,CAAC,8BAAsB,CAAC;QACvF,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,EAAE,OAAO,CAAC,CAAC;QACZ,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE;YACvB,KAAK;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QACH,QAAQ,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @description Pure helper that decides whether a fresh `startBot()` call is
3
+ * a **hot reload** (nodemon swapped the process; agents and Telegram
4
+ * backlog should be treated as still-connected) or a **cold start** (the
5
+ * bot was actually down — reconnect notices are appropriate; stale
6
+ * Telegram backlog should be dropped).
7
+ *
8
+ * Decision is based on the gap between `now` and the last persisted
9
+ * heartbeat stamp (`StateStore.getDowntimeMs`):
10
+ *
11
+ * - unknown (no stamp at all) → cold start.
12
+ * Fresh install or a pre-heartbeat state file. Conservative default —
13
+ * "I don't know how long I was down, assume long".
14
+ * - `< HOT_RELOAD_THRESHOLD_MS` → hot reload.
15
+ * Old PID exited and new PID started within the threshold — basically
16
+ * a nodemon swap or a `kill -HUP` followed by an immediate respawn.
17
+ * - `≥ threshold` → cold start.
18
+ * Operator manually stopped the bot and restarted it later; stale
19
+ * pending updates are probably no longer interesting.
20
+ *
21
+ * The threshold is generous (60s) so an unusually slow tsc build during a
22
+ * hot reload still classifies correctly. Tightening it later is safe;
23
+ * loosening would only widen the window where we'd quietly resubscribe to
24
+ * a long-dead session.
25
+ */
26
+ /** Cap (ms) below which a boot is treated as a hot reload, not a cold start. */
27
+ export declare const HOT_RELOAD_THRESHOLD_MS = 60000;
28
+ export interface BootClassification {
29
+ /** True iff the gap since the last heartbeat is below the threshold. */
30
+ isHotReload: boolean;
31
+ /**
32
+ * Whether `bot.launch({ dropPendingUpdates: ... })` should drop the
33
+ * Telegram backlog. Inverse of {@link isHotReload}: hot reload keeps
34
+ * messages typed during the ~1s reload gap so they reach the live
35
+ * agents; cold start discards stale updates that piled up while the bot
36
+ * was actually down.
37
+ */
38
+ dropPendingUpdates: boolean;
39
+ }
40
+ /**
41
+ * @description Map a measured downtime (in ms, or `null` for unknown) to
42
+ * the boot-mode flags consumed by `startBot()`. Pure / synchronous — easy
43
+ * to unit-test without touching state or telegraf.
44
+ */
45
+ export declare function classifyBoot(downtimeMs: number | null, thresholdMs?: number): BootClassification;
46
+ //# sourceMappingURL=bootClassifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootClassifier.d.ts","sourceRoot":"","sources":["../src/bootClassifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,gFAAgF;AAChF,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAE9C,MAAM,WAAW,kBAAkB;IACjC,wEAAwE;IACxE,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,WAAW,GAAE,MAAgC,GAC5C,kBAAkB,CAKpB"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ /**
3
+ * @description Pure helper that decides whether a fresh `startBot()` call is
4
+ * a **hot reload** (nodemon swapped the process; agents and Telegram
5
+ * backlog should be treated as still-connected) or a **cold start** (the
6
+ * bot was actually down — reconnect notices are appropriate; stale
7
+ * Telegram backlog should be dropped).
8
+ *
9
+ * Decision is based on the gap between `now` and the last persisted
10
+ * heartbeat stamp (`StateStore.getDowntimeMs`):
11
+ *
12
+ * - unknown (no stamp at all) → cold start.
13
+ * Fresh install or a pre-heartbeat state file. Conservative default —
14
+ * "I don't know how long I was down, assume long".
15
+ * - `< HOT_RELOAD_THRESHOLD_MS` → hot reload.
16
+ * Old PID exited and new PID started within the threshold — basically
17
+ * a nodemon swap or a `kill -HUP` followed by an immediate respawn.
18
+ * - `≥ threshold` → cold start.
19
+ * Operator manually stopped the bot and restarted it later; stale
20
+ * pending updates are probably no longer interesting.
21
+ *
22
+ * The threshold is generous (60s) so an unusually slow tsc build during a
23
+ * hot reload still classifies correctly. Tightening it later is safe;
24
+ * loosening would only widen the window where we'd quietly resubscribe to
25
+ * a long-dead session.
26
+ */
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.HOT_RELOAD_THRESHOLD_MS = void 0;
29
+ exports.classifyBoot = classifyBoot;
30
+ /** Cap (ms) below which a boot is treated as a hot reload, not a cold start. */
31
+ exports.HOT_RELOAD_THRESHOLD_MS = 60_000;
32
+ /**
33
+ * @description Map a measured downtime (in ms, or `null` for unknown) to
34
+ * the boot-mode flags consumed by `startBot()`. Pure / synchronous — easy
35
+ * to unit-test without touching state or telegraf.
36
+ */
37
+ function classifyBoot(downtimeMs, thresholdMs = exports.HOT_RELOAD_THRESHOLD_MS) {
38
+ if (downtimeMs === null || downtimeMs >= thresholdMs) {
39
+ return { isHotReload: false, dropPendingUpdates: true };
40
+ }
41
+ return { isHotReload: true, dropPendingUpdates: false };
42
+ }
43
+ //# sourceMappingURL=bootClassifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootClassifier.js","sourceRoot":"","sources":["../src/bootClassifier.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;AAuBH,oCAQC;AA7BD,gFAAgF;AACnE,QAAA,uBAAuB,GAAG,MAAM,CAAC;AAe9C;;;;GAIG;AACH,SAAgB,YAAY,CAC1B,UAAyB,EACzB,cAAsB,+BAAuB;IAE7C,IAAI,UAAU,KAAK,IAAI,IAAI,UAAU,IAAI,WAAW,EAAE,CAAC;QACrD,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;IAC1D,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;AAC1D,CAAC"}
package/dist/bot.d.ts ADDED
@@ -0,0 +1,207 @@
1
+ import { Markup } from 'telegraf';
2
+ import type { Message } from 'telegraf/typings/core/types/typegram';
3
+ import type { AgentAdapter, SeenWatermark } from './types';
4
+ import type { SessionKey } from './sessionKey';
5
+ import './connectors/jira/sessionKeyCodec';
6
+ import type { InboundCommand } from './platform/inbound';
7
+ import type { InlineKeyboardMarkup } from 'telegraf/typings/core/types/typegram';
8
+ import type { CommandContext } from './connectors/telegram/commands/botCore';
9
+ /**
10
+ * @description The Telegram connector's inbound side: the membership lookup the
11
+ * access policy needs, and the normalization step that hands the core
12
+ * platform-neutral events.
13
+ */
14
+ declare const telegramInbound: import("./connectors/telegram/inbound").TelegramConnectorInbound;
15
+ export declare function buildBindKeyboard(subdirs: readonly string[], page?: number, pageSize?: number, isBound?: boolean): Markup.Markup<InlineKeyboardMarkup>;
16
+ export declare function getStartReadyMessage(adapter: AgentAdapter, subdir: string, args: string | undefined, model: string | null, effort: string | null): string;
17
+ /**
18
+ * @name EnsureAgentSessionResult
19
+ * @description Outcome of {@link ensureAgentSession}. `ok` means a session is
20
+ * ready to receive prompts NOW — either it was already active, it is in its
21
+ * async startup window (prompts get buffered + replayed on ready), or it was
22
+ * just started. `message` is the localized text the caller MAY surface (the
23
+ * `agent.ready` notice on a fresh start, empty when nothing user-facing
24
+ * happened). On failure, `reason` distinguishes a missing binding (`unbound`),
25
+ * a bound topic that has never picked an agent and none was supplied
26
+ * (`no-adapter` — refuse rather than silently launch a default), and a start
27
+ * that threw (`start-failed`); `message` carries the matching localized text.
28
+ */
29
+ export type EnsureAgentSessionResult = {
30
+ ok: true;
31
+ message: string;
32
+ isFresh: boolean;
33
+ } | {
34
+ ok: false;
35
+ reason: EnsureAgentSessionFailureReason;
36
+ message: string;
37
+ };
38
+ /**
39
+ * `unbound` / `no-adapter` / `start-failed` as before; `nothing-to-resume` and
40
+ * `resume-failed` only for a resume-only caller (no fresh start allowed).
41
+ */
42
+ export type EnsureAgentSessionFailureReason = 'unbound' | 'no-adapter' | 'start-failed' | 'nothing-to-resume' | 'resume-failed';
43
+ /**
44
+ * @name EnsureAgentSessionOptions
45
+ * @description Tuning for {@link ensureAgentSession}.
46
+ * - `preferredAdapterName` — an EXPLICIT user choice that outranks every
47
+ * resolved name (the natural-language-start path passes the matched
48
+ * `/claude` vs `/opencode` adapter here).
49
+ * - `fallbackAdapterName` — the LAST resort when nothing else resolves (the
50
+ * scheduler passes a job's `lastAdapterName` snapshot for a start after a
51
+ * rebind, where the thread has no live or persisted adapter). When it too is
52
+ * absent and nothing resolved, `ensureAgentSession` fails with `no-adapter`
53
+ * rather than silently launching a default backend.
54
+ * - `args` — forwarded to `startAgentSession` (e.g. the natural-language
55
+ * start phrase's trailing args).
56
+ */
57
+ export interface EnsureAgentSessionOptions {
58
+ preferredAdapterName?: string;
59
+ fallbackAdapterName?: string;
60
+ args?: string;
61
+ /**
62
+ * Resume a sleeping session but never start a fresh one — a wake-up reminder or
63
+ * a topic's retry has nothing to say to a session that does not know the work.
64
+ */
65
+ isResumeOnly?: boolean;
66
+ }
67
+ /**
68
+ * @description True iff the neutral router owns `name`, i.e. a `/name` message
69
+ * is claimed by the routed-command trigger instead of falling through.
70
+ *
71
+ * Exported so the fall-through contract can be asserted against the REAL
72
+ * registration table: `pair` must stay OFF it (it is a raw `bot.command` that
73
+ * has to run in a not-yet-paired group, which authorisation would reject).
74
+ */
75
+ export declare function checkIsRoutedCommand(name: string): boolean;
76
+ /**
77
+ * @description Collaborators of {@link handleRoutedCommandMessage}, injected so
78
+ * the trigger's guard ORDER is provable without a live Telegraf instance, a
79
+ * paired group or an admin-cache round trip.
80
+ */
81
+ export interface RoutedCommandTriggerDeps<TContext> {
82
+ /** Telegraf's own command recognition, re-implemented in `getTelegramCommand`. */
83
+ getCommand: (message: Message.TextMessage) => InboundCommand | null;
84
+ /** Is the name on the neutral router's table? `false` ⇒ fall through. */
85
+ checkIsRegistered: (name: string) => boolean;
86
+ /** Resolve + gate the sender. `null` ⇒ not allowed here: drop, no fall-through. */
87
+ authorise: (ctx: TContext) => Promise<SessionKey | null>;
88
+ /** Clear the single-purpose input modes an earlier command armed. */
89
+ exitPendingInputModes: (key: SessionKey, messageText: string) => Promise<void>;
90
+ /** Reset the compact-on-idle watchdog (F2) — any command is thread activity. */
91
+ noteActivity: (key: SessionKey) => void;
92
+ /** Normalize through the connector and hand the event to the core's router. */
93
+ deliverInbound: (ctx: TContext, key: SessionKey) => Promise<void>;
94
+ }
95
+ /**
96
+ * @description The single Telegram trigger for every routed command, replacing
97
+ * the per-command `bot.command(...)` registrations.
98
+ *
99
+ * Recognition is telegraf's own rule, re-implemented in
100
+ * {@link getTelegramCommand}, so WHICH messages count as commands is unchanged
101
+ * — including `/name@otherbot` falling through.
102
+ *
103
+ * The guard ORDER is load-bearing in both directions and is what this function
104
+ * exists (separately from its `bot.on` registration) to make testable:
105
+ * - an unrouted name calls `next()` BEFORE authorisation, so a raw
106
+ * `bot.command` further down the middleware chain — `/pair`, which must work
107
+ * in a group the bot is not paired with yet — still receives it;
108
+ * - a rejected sender returns WITHOUT `next()`, so the update stops at the
109
+ * first gate that refused it. The generic text handler below re-authorises,
110
+ * so a stray `next()` would not actually leak the command; it would spend a
111
+ * second admin-cache round trip and log the same refusal twice, which is how
112
+ * a real leak would be missed in the noise.
113
+ */
114
+ export declare function handleRoutedCommandMessage<TContext extends {
115
+ message: Message.TextMessage;
116
+ }>(ctx: TContext, next: () => Promise<void>, deps: RoutedCommandTriggerDeps<TContext>): Promise<void>;
117
+ /**
118
+ * @description Hand a routed command to the connector for normalization.
119
+ *
120
+ * Normalization goes through the connector rather than a second inline
121
+ * `getInboundEvent` call so exactly one place decides what lands on the event.
122
+ *
123
+ * The event's `raw` is the telegraf CONTEXT, not `ctx.message` — load-bearing,
124
+ * and it shipped wrong once (fixed in `c9b1da4`): the not-yet-relocated command
125
+ * handlers read Telegram fields off the context, so one reading
126
+ * `ctx.message.message_id` finds `undefined` when `raw` is the bare message.
127
+ * `ConnectorInbound.deliver` types `raw` as `unknown`, so only a test can hold
128
+ * this line honest.
129
+ */
130
+ export declare function deliverRoutedCommand<TContext extends {
131
+ message: Message.TextMessage;
132
+ }>(ctx: TContext, key: SessionKey): Promise<void>;
133
+ /**
134
+ * Registered at the position the first command used to occupy, so middleware
135
+ * order relative to `bot.command('pair')` and the text handler is preserved.
136
+ */
137
+ export declare const routedCommandTriggerDeps: RoutedCommandTriggerDeps<CommandContext>;
138
+ /** The connector the routed-command trigger and the core's dispatcher share. */
139
+ export { telegramInbound };
140
+ export declare const COMMANDS_MENU: {
141
+ command: string;
142
+ description: string;
143
+ }[];
144
+ /**
145
+ * @description Post the silent-reattach recap for one thread after a successful
146
+ * re-adopt: how many AGENT messages were produced while the bot was down (vs the
147
+ * persisted watermark) plus the last few turns. The anti-spam gate
148
+ * ({@link checkShouldPostReattachRecap}) lives in the recap module: post when
149
+ * `missedCount > 0` (real missed output, ANY boot mode) OR — only on a COLD start
150
+ * (`isColdStart`) — the watermark-unknown fallback. The fallback is cold-start
151
+ * gated precisely so a watermark-less session (first run after ship, pruned
152
+ * transcript) does NOT re-spam every active topic on every hot rebuild.
153
+ *
154
+ * Adapters without `getReattachRecap` (Terminal) are skipped. Best-effort: a
155
+ * read/format failure logs and posts nothing — it never blocks the reattach
156
+ * scan or crashes boot.
157
+ *
158
+ * `watermark` is the PRE-adopt snapshot read by the caller BEFORE `adopt/resume`
159
+ * (S1-wiring): the concurrent live-advance (Claude's idle-poll tracker / OpenCode's
160
+ * `session.idle`) starts running the instant the session polls, so re-reading the
161
+ * watermark here could see it already moved to the tail and silently suppress a
162
+ * genuine recap. Taking the snapshot before adopt freezes the recap baseline.
163
+ *
164
+ * Idempotency: after the recap is computed the persisted watermark is ALWAYS
165
+ * advanced to the session's current head (`recap.headWatermark`) — whether or not
166
+ * a recap posted, and even on `missedCount === 0` — so the same gap can never
167
+ * re-report on the next reattach. Skipped only when the head is unknown (the
168
+ * record read failed) → retry on the next reattach. The collaborators are
169
+ * injectable (`deps`) so the orchestration is unit-testable; production uses the
170
+ * real {@link replyToThread} / {@link StateStore.setSeenWatermark}.
171
+ */
172
+ interface PostReattachRecapDeps {
173
+ reply: (key: SessionKey, text: string) => Promise<unknown>;
174
+ advanceWatermark: (key: SessionKey, watermark: SeenWatermark) => void;
175
+ }
176
+ export declare function postReattachRecap(key: SessionKey, adapter: Pick<AgentAdapter, 'getReattachRecap'>, workDir: string, sessionId: string, watermark: SeenWatermark | null, isColdStart: boolean, deps?: PostReattachRecapDeps): Promise<void>;
177
+ /**
178
+ * @description Injected collaborators for {@link reconcileTransientFrames}, so the
179
+ * boot reconciliation is unit-testable without a live Telegram client or
180
+ * StateStore (mirrors the `deps` seam {@link postReattachRecap} uses). Defaults
181
+ * wire the real bot client + the persist choke point.
182
+ */
183
+ export interface ReconcileTransientFramesDeps {
184
+ /** Best-effort delete of one Telegram message (Telegraf resolves `true`). */
185
+ deleteMessage: (chatId: number, messageId: number) => Promise<boolean>;
186
+ /** Re-sync disk to the thread's LIVE in-memory frame ids after the stale deletes. */
187
+ persistFrames: (key: SessionKey) => void;
188
+ }
189
+ /**
190
+ * @description Delete transient status frames left on screen by an UNGRACEFUL
191
+ * exit (crash / SIGKILL — the graceful shutdown sweep never ran), so a
192
+ * "✽ working…" / thinking / sub-agent frame doesn't stick forever in a topic
193
+ * (S2, the crash safety net behind S1). Deletes every id in the `orphaned`
194
+ * snapshot best-effort (swallowing "message not found" / too-old). The snapshot
195
+ * MUST be captured BEFORE reattach (see {@link startBot}): a reattached
196
+ * session's frame setters persist the fresh in-memory state and would clobber
197
+ * the live persisted set first. Every snapshot id is stale by definition (the
198
+ * fresh process holds no handle to it; a still-busy reattached session repaints
199
+ * its OWN fresh frame), so deleting is always safe. After deleting, re-persist
200
+ * the CURRENT live frame ids per thread so disk reflects post-reattach truth
201
+ * (the repainted frame's id, or empty) instead of the consumed stale ids. A
202
+ * graceful exit already cleared the set in its sweep, so this is normally a
203
+ * no-op.
204
+ */
205
+ export declare function reconcileTransientFrames(orphaned: Record<string, number[]>, deps?: ReconcileTransientFramesDeps): number;
206
+ export declare function startBot(): Promise<void>;
207
+ //# sourceMappingURL=bot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../src/bot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAsC,MAAM,UAAU,CAAC;AAEhF,OAAO,KAAK,EAAU,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAkC5E,OAAO,KAAK,EAAE,YAAY,EAAuI,aAAa,EAAuD,MAAM,SAAS,CAAC;AACrP,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,cAAc,CAAC;AAW3D,OAAO,mCAAmC,CAA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