charness 3.6.1 → 3.8.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 (828) hide show
  1. package/CHANGELOG.md +297 -0
  2. package/DEVELOPMENT.md +35 -5
  3. package/MIGRATION_RENAME_TO_CHARNESS.md +3 -2
  4. package/README.md +84 -782
  5. package/SETUP.md +48 -10
  6. package/agent-plugin/.claude-plugin/plugin.json +7 -0
  7. package/agent-plugin/README.md +35 -0
  8. package/agent-plugin/skills/charness-delegate-claude/SKILL.md +85 -0
  9. package/agent-plugin/skills/charness-delegate-claude/summarize-events.py +90 -0
  10. package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +68 -0
  11. package/agent-plugin/skills/charness-manager/SKILL.md +152 -0
  12. package/dist/adapters/adapterNames.d.ts +6 -0
  13. package/dist/adapters/adapterNames.d.ts.map +1 -1
  14. package/dist/adapters/adapterNames.js +8 -2
  15. package/dist/adapters/adapterNames.js.map +1 -1
  16. package/dist/adapters/claudeCliAdapter.d.ts +8 -0
  17. package/dist/adapters/claudeCliAdapter.d.ts.map +1 -1
  18. package/dist/adapters/claudeCliAdapter.js +42 -5
  19. package/dist/adapters/claudeCliAdapter.js.map +1 -1
  20. package/dist/adapters/claudeJsonStreamAdapter.d.ts +10 -9
  21. package/dist/adapters/claudeJsonStreamAdapter.d.ts.map +1 -1
  22. package/dist/adapters/claudeJsonStreamAdapter.js +53 -55
  23. package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
  24. package/dist/adapters/createAdapter.d.ts +8 -0
  25. package/dist/adapters/createAdapter.d.ts.map +1 -1
  26. package/dist/adapters/createAdapter.js +14 -2
  27. package/dist/adapters/createAdapter.js.map +1 -1
  28. package/dist/adapters/openCodeAdapter.d.ts +43 -6
  29. package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
  30. package/dist/adapters/openCodeAdapter.js +97 -7
  31. package/dist/adapters/openCodeAdapter.js.map +1 -1
  32. package/dist/agentLogin/agentLogin.d.ts +1 -1
  33. package/dist/agentLogin/agentLogin.d.ts.map +1 -1
  34. package/dist/apiRetryKick.d.ts +4 -3
  35. package/dist/apiRetryKick.d.ts.map +1 -1
  36. package/dist/apiRetryKick.js +16 -9
  37. package/dist/apiRetryKick.js.map +1 -1
  38. package/dist/bot.d.ts.map +1 -1
  39. package/dist/bot.js +1360 -387
  40. package/dist/bot.js.map +1 -1
  41. package/dist/cli/claudeProfiles.d.ts +11 -6
  42. package/dist/cli/claudeProfiles.d.ts.map +1 -1
  43. package/dist/cli/claudeProfiles.js +50 -22
  44. package/dist/cli/claudeProfiles.js.map +1 -1
  45. package/dist/cli/hot.d.ts +5 -0
  46. package/dist/cli/hot.d.ts.map +1 -1
  47. package/dist/cli/hot.js +71 -25
  48. package/dist/cli/hot.js.map +1 -1
  49. package/dist/cli/tscWatchGuard.d.ts +95 -0
  50. package/dist/cli/tscWatchGuard.d.ts.map +1 -0
  51. package/dist/cli/tscWatchGuard.js +295 -0
  52. package/dist/cli/tscWatchGuard.js.map +1 -0
  53. package/dist/cli.js +55 -1
  54. package/dist/cli.js.map +1 -1
  55. package/dist/configDirFile.d.ts +7 -3
  56. package/dist/configDirFile.d.ts.map +1 -1
  57. package/dist/configDirFile.js +12 -5
  58. package/dist/configDirFile.js.map +1 -1
  59. package/dist/connectors/jira/answerSink.d.ts +10 -0
  60. package/dist/connectors/jira/answerSink.d.ts.map +1 -1
  61. package/dist/connectors/jira/answerSink.js +13 -0
  62. package/dist/connectors/jira/answerSink.js.map +1 -1
  63. package/dist/connectors/jira/config.d.ts +2 -0
  64. package/dist/connectors/jira/config.d.ts.map +1 -1
  65. package/dist/connectors/jira/config.js +9 -1
  66. package/dist/connectors/jira/config.js.map +1 -1
  67. package/dist/connectors/jira/connector.d.ts +11 -1
  68. package/dist/connectors/jira/connector.d.ts.map +1 -1
  69. package/dist/connectors/jira/connector.js +7 -0
  70. package/dist/connectors/jira/connector.js.map +1 -1
  71. package/dist/connectors/jira/inbound.d.ts +27 -4
  72. package/dist/connectors/jira/inbound.d.ts.map +1 -1
  73. package/dist/connectors/jira/inbound.js +69 -8
  74. package/dist/connectors/jira/inbound.js.map +1 -1
  75. package/dist/connectors/jira/issueBlocks.d.ts +5 -0
  76. package/dist/connectors/jira/issueBlocks.d.ts.map +1 -1
  77. package/dist/connectors/jira/issueBlocks.js +11 -0
  78. package/dist/connectors/jira/issueBlocks.js.map +1 -1
  79. package/dist/connectors/telegram/bindPicker.d.ts +5 -0
  80. package/dist/connectors/telegram/bindPicker.d.ts.map +1 -1
  81. package/dist/connectors/telegram/bindPicker.js +18 -1
  82. package/dist/connectors/telegram/bindPicker.js.map +1 -1
  83. package/dist/connectors/telegram/bindPickerClaims.d.ts +46 -0
  84. package/dist/connectors/telegram/bindPickerClaims.d.ts.map +1 -0
  85. package/dist/connectors/telegram/bindPickerClaims.js +83 -0
  86. package/dist/connectors/telegram/bindPickerClaims.js.map +1 -0
  87. package/dist/connectors/telegram/bindSweep.d.ts +32 -0
  88. package/dist/connectors/telegram/bindSweep.d.ts.map +1 -0
  89. package/dist/connectors/telegram/bindSweep.js +47 -0
  90. package/dist/connectors/telegram/bindSweep.js.map +1 -0
  91. package/dist/connectors/telegram/bindingWelcome.d.ts +23 -0
  92. package/dist/connectors/telegram/bindingWelcome.d.ts.map +1 -0
  93. package/dist/connectors/telegram/bindingWelcome.js +26 -0
  94. package/dist/connectors/telegram/bindingWelcome.js.map +1 -0
  95. package/dist/connectors/telegram/botApiConnection.d.ts +74 -0
  96. package/dist/connectors/telegram/botApiConnection.d.ts.map +1 -0
  97. package/dist/connectors/telegram/botApiConnection.js +201 -0
  98. package/dist/connectors/telegram/botApiConnection.js.map +1 -0
  99. package/dist/connectors/telegram/commands/botCore.d.ts +13 -3
  100. package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
  101. package/dist/connectors/telegram/commands/botSkills.d.ts +21 -0
  102. package/dist/connectors/telegram/commands/botSkills.d.ts.map +1 -0
  103. package/dist/connectors/telegram/commands/botSkills.js +133 -0
  104. package/dist/connectors/telegram/commands/botSkills.js.map +1 -0
  105. package/dist/connectors/telegram/commands/callbackMessage.d.ts +5 -0
  106. package/dist/connectors/telegram/commands/callbackMessage.d.ts.map +1 -1
  107. package/dist/connectors/telegram/commands/callbackMessage.js +9 -0
  108. package/dist/connectors/telegram/commands/callbackMessage.js.map +1 -1
  109. package/dist/connectors/telegram/commands/compaction.d.ts +65 -3
  110. package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -1
  111. package/dist/connectors/telegram/commands/compaction.js +512 -94
  112. package/dist/connectors/telegram/commands/compaction.js.map +1 -1
  113. package/dist/connectors/telegram/commands/displayModes.d.ts +1 -1
  114. package/dist/connectors/telegram/commands/displayModes.d.ts.map +1 -1
  115. package/dist/connectors/telegram/commands/displayModes.js +6 -18
  116. package/dist/connectors/telegram/commands/displayModes.js.map +1 -1
  117. package/dist/connectors/telegram/commands/fallbackChain.js +5 -5
  118. package/dist/connectors/telegram/commands/fallbackChain.js.map +1 -1
  119. package/dist/connectors/telegram/commands/reminders.d.ts +1 -1
  120. package/dist/connectors/telegram/commands/reminders.d.ts.map +1 -1
  121. package/dist/connectors/telegram/commands/reminders.js +4 -15
  122. package/dist/connectors/telegram/commands/reminders.js.map +1 -1
  123. package/dist/connectors/telegram/commands/runners.d.ts +52 -0
  124. package/dist/connectors/telegram/commands/runners.d.ts.map +1 -0
  125. package/dist/connectors/telegram/commands/runners.js +486 -0
  126. package/dist/connectors/telegram/commands/runners.js.map +1 -0
  127. package/dist/connectors/telegram/commands/selfUpdate.d.ts.map +1 -1
  128. package/dist/connectors/telegram/commands/selfUpdate.js +1 -11
  129. package/dist/connectors/telegram/commands/selfUpdate.js.map +1 -1
  130. package/dist/connectors/telegram/commands/taskAgents.d.ts +22 -0
  131. package/dist/connectors/telegram/commands/taskAgents.d.ts.map +1 -0
  132. package/dist/connectors/telegram/commands/taskAgents.js +104 -0
  133. package/dist/connectors/telegram/commands/taskAgents.js.map +1 -0
  134. package/dist/connectors/telegram/commands/todo.d.ts +82 -0
  135. package/dist/connectors/telegram/commands/todo.d.ts.map +1 -0
  136. package/dist/connectors/telegram/commands/todo.js +384 -0
  137. package/dist/connectors/telegram/commands/todo.js.map +1 -0
  138. package/dist/connectors/telegram/commands/topicCommand.d.ts +6 -2
  139. package/dist/connectors/telegram/commands/topicCommand.d.ts.map +1 -1
  140. package/dist/connectors/telegram/commands/topicCommand.js +6 -9
  141. package/dist/connectors/telegram/commands/topicCommand.js.map +1 -1
  142. package/dist/connectors/telegram/openBindMessages.d.ts +45 -0
  143. package/dist/connectors/telegram/openBindMessages.d.ts.map +1 -0
  144. package/dist/connectors/telegram/openBindMessages.js +67 -0
  145. package/dist/connectors/telegram/openBindMessages.js.map +1 -0
  146. package/dist/connectors/telegram/outputFlushPlan.d.ts +49 -0
  147. package/dist/connectors/telegram/outputFlushPlan.d.ts.map +1 -1
  148. package/dist/connectors/telegram/outputFlushPlan.js +46 -0
  149. package/dist/connectors/telegram/outputFlushPlan.js.map +1 -1
  150. package/dist/connectors/telegram/pendingTopicName.d.ts +26 -0
  151. package/dist/connectors/telegram/pendingTopicName.d.ts.map +1 -0
  152. package/dist/connectors/telegram/pendingTopicName.js +27 -0
  153. package/dist/connectors/telegram/pendingTopicName.js.map +1 -0
  154. package/dist/connectors/telegram/runnerPairingMessages.d.ts +27 -0
  155. package/dist/connectors/telegram/runnerPairingMessages.d.ts.map +1 -0
  156. package/dist/connectors/telegram/runnerPairingMessages.js +105 -0
  157. package/dist/connectors/telegram/runnerPairingMessages.js.map +1 -0
  158. package/dist/connectors/test/connector.d.ts.map +1 -1
  159. package/dist/connectors/test/connector.js +6 -1
  160. package/dist/connectors/test/connector.js.map +1 -1
  161. package/dist/i18n/de.d.ts.map +1 -1
  162. package/dist/i18n/de.js +148 -7
  163. package/dist/i18n/de.js.map +1 -1
  164. package/dist/i18n/en.d.ts.map +1 -1
  165. package/dist/i18n/en.js +148 -7
  166. package/dist/i18n/en.js.map +1 -1
  167. package/dist/i18n/es.d.ts.map +1 -1
  168. package/dist/i18n/es.js +148 -7
  169. package/dist/i18n/es.js.map +1 -1
  170. package/dist/i18n/fr.d.ts.map +1 -1
  171. package/dist/i18n/fr.js +148 -7
  172. package/dist/i18n/fr.js.map +1 -1
  173. package/dist/i18n/hi.d.ts.map +1 -1
  174. package/dist/i18n/hi.js +148 -7
  175. package/dist/i18n/hi.js.map +1 -1
  176. package/dist/i18n/ja.d.ts.map +1 -1
  177. package/dist/i18n/ja.js +148 -7
  178. package/dist/i18n/ja.js.map +1 -1
  179. package/dist/i18n/ka.d.ts.map +1 -1
  180. package/dist/i18n/ka.js +148 -7
  181. package/dist/i18n/ka.js.map +1 -1
  182. package/dist/i18n/pt.d.ts.map +1 -1
  183. package/dist/i18n/pt.js +148 -7
  184. package/dist/i18n/pt.js.map +1 -1
  185. package/dist/i18n/ru.d.ts.map +1 -1
  186. package/dist/i18n/ru.js +148 -7
  187. package/dist/i18n/ru.js.map +1 -1
  188. package/dist/i18n/uk.d.ts.map +1 -1
  189. package/dist/i18n/uk.js +148 -7
  190. package/dist/i18n/uk.js.map +1 -1
  191. package/dist/i18n/uz.d.ts.map +1 -1
  192. package/dist/i18n/uz.js +148 -7
  193. package/dist/i18n/uz.js.map +1 -1
  194. package/dist/i18n/zh.d.ts.map +1 -1
  195. package/dist/i18n/zh.js +148 -7
  196. package/dist/i18n/zh.js.map +1 -1
  197. package/dist/i18n.d.ts +1 -1
  198. package/dist/i18n.js +1 -1
  199. package/dist/installManager.d.ts +70 -1
  200. package/dist/installManager.d.ts.map +1 -1
  201. package/dist/installManager.js +125 -13
  202. package/dist/installManager.js.map +1 -1
  203. package/dist/instanceSettings.d.ts +50 -1
  204. package/dist/instanceSettings.d.ts.map +1 -1
  205. package/dist/instanceSettings.js +119 -26
  206. package/dist/instanceSettings.js.map +1 -1
  207. package/dist/openCodeQuestionFlow.d.ts +30 -0
  208. package/dist/openCodeQuestionFlow.d.ts.map +1 -1
  209. package/dist/openCodeQuestionFlow.js +43 -0
  210. package/dist/openCodeQuestionFlow.js.map +1 -1
  211. package/dist/outputTrace.d.ts +6 -0
  212. package/dist/outputTrace.d.ts.map +1 -1
  213. package/dist/outputTrace.js +24 -1
  214. package/dist/outputTrace.js.map +1 -1
  215. package/dist/postToSession.d.ts +20 -5
  216. package/dist/postToSession.d.ts.map +1 -1
  217. package/dist/postToSession.js +38 -7
  218. package/dist/postToSession.js.map +1 -1
  219. package/dist/remoteRun/cliArgs.d.ts +75 -0
  220. package/dist/remoteRun/cliArgs.d.ts.map +1 -0
  221. package/dist/remoteRun/cliArgs.js +206 -0
  222. package/dist/remoteRun/cliArgs.js.map +1 -0
  223. package/dist/remoteRun/commands.d.ts +77 -0
  224. package/dist/remoteRun/commands.d.ts.map +1 -0
  225. package/dist/remoteRun/commands.js +327 -0
  226. package/dist/remoteRun/commands.js.map +1 -0
  227. package/dist/remoteRun/depsPlan.d.ts +16 -0
  228. package/dist/remoteRun/depsPlan.d.ts.map +1 -0
  229. package/dist/remoteRun/depsPlan.js +82 -0
  230. package/dist/remoteRun/depsPlan.js.map +1 -0
  231. package/dist/remoteRun/exitCodes.d.ts +34 -0
  232. package/dist/remoteRun/exitCodes.d.ts.map +1 -0
  233. package/dist/remoteRun/exitCodes.js +38 -0
  234. package/dist/remoteRun/exitCodes.js.map +1 -0
  235. package/dist/remoteRun/foreground.d.ts +29 -0
  236. package/dist/remoteRun/foreground.d.ts.map +1 -0
  237. package/dist/remoteRun/foreground.js +159 -0
  238. package/dist/remoteRun/foreground.js.map +1 -0
  239. package/dist/remoteRun/interrupts.d.ts +27 -0
  240. package/dist/remoteRun/interrupts.d.ts.map +1 -0
  241. package/dist/remoteRun/interrupts.js +78 -0
  242. package/dist/remoteRun/interrupts.js.map +1 -0
  243. package/dist/remoteRun/jobFiles.d.ts +31 -0
  244. package/dist/remoteRun/jobFiles.d.ts.map +1 -0
  245. package/dist/remoteRun/jobFiles.js +84 -0
  246. package/dist/remoteRun/jobFiles.js.map +1 -0
  247. package/dist/remoteRun/jobFormat.d.ts +16 -0
  248. package/dist/remoteRun/jobFormat.d.ts.map +1 -0
  249. package/dist/remoteRun/jobFormat.js +130 -0
  250. package/dist/remoteRun/jobFormat.js.map +1 -0
  251. package/dist/remoteRun/jobId.d.ts +15 -0
  252. package/dist/remoteRun/jobId.d.ts.map +1 -0
  253. package/dist/remoteRun/jobId.js +85 -0
  254. package/dist/remoteRun/jobId.js.map +1 -0
  255. package/dist/remoteRun/jobMeta.d.ts +18 -0
  256. package/dist/remoteRun/jobMeta.d.ts.map +1 -0
  257. package/dist/remoteRun/jobMeta.js +33 -0
  258. package/dist/remoteRun/jobMeta.js.map +1 -0
  259. package/dist/remoteRun/jobQuery.d.ts +12 -0
  260. package/dist/remoteRun/jobQuery.d.ts.map +1 -0
  261. package/dist/remoteRun/jobQuery.js +22 -0
  262. package/dist/remoteRun/jobQuery.js.map +1 -0
  263. package/dist/remoteRun/jobRecords.d.ts +22 -0
  264. package/dist/remoteRun/jobRecords.d.ts.map +1 -0
  265. package/dist/remoteRun/jobRecords.js +145 -0
  266. package/dist/remoteRun/jobRecords.js.map +1 -0
  267. package/dist/remoteRun/jobState.d.ts +62 -0
  268. package/dist/remoteRun/jobState.d.ts.map +1 -0
  269. package/dist/remoteRun/jobState.js +132 -0
  270. package/dist/remoteRun/jobState.js.map +1 -0
  271. package/dist/remoteRun/leaseTiming.d.ts +18 -0
  272. package/dist/remoteRun/leaseTiming.d.ts.map +1 -0
  273. package/dist/remoteRun/leaseTiming.js +43 -0
  274. package/dist/remoteRun/leaseTiming.js.map +1 -0
  275. package/dist/remoteRun/output.d.ts +37 -0
  276. package/dist/remoteRun/output.d.ts.map +1 -0
  277. package/dist/remoteRun/output.js +127 -0
  278. package/dist/remoteRun/output.js.map +1 -0
  279. package/dist/remoteRun/pairedRunners.d.ts +51 -0
  280. package/dist/remoteRun/pairedRunners.d.ts.map +1 -0
  281. package/dist/remoteRun/pairedRunners.js +165 -0
  282. package/dist/remoteRun/pairedRunners.js.map +1 -0
  283. package/dist/remoteRun/pathPatterns.d.ts +33 -0
  284. package/dist/remoteRun/pathPatterns.d.ts.map +1 -0
  285. package/dist/remoteRun/pathPatterns.js +115 -0
  286. package/dist/remoteRun/pathPatterns.js.map +1 -0
  287. package/dist/remoteRun/probe.d.ts +78 -0
  288. package/dist/remoteRun/probe.d.ts.map +1 -0
  289. package/dist/remoteRun/probe.js +157 -0
  290. package/dist/remoteRun/probe.js.map +1 -0
  291. package/dist/remoteRun/project.d.ts +26 -0
  292. package/dist/remoteRun/project.d.ts.map +1 -0
  293. package/dist/remoteRun/project.js +159 -0
  294. package/dist/remoteRun/project.js.map +1 -0
  295. package/dist/remoteRun/projectConfig.d.ts +38 -0
  296. package/dist/remoteRun/projectConfig.d.ts.map +1 -0
  297. package/dist/remoteRun/projectConfig.js +87 -0
  298. package/dist/remoteRun/projectConfig.js.map +1 -0
  299. package/dist/remoteRun/remoteRunCli.d.ts +22 -0
  300. package/dist/remoteRun/remoteRunCli.d.ts.map +1 -0
  301. package/dist/remoteRun/remoteRunCli.js +119 -0
  302. package/dist/remoteRun/remoteRunCli.js.map +1 -0
  303. package/dist/remoteRun/remoteRunError.d.ts +14 -0
  304. package/dist/remoteRun/remoteRunError.d.ts.map +1 -0
  305. package/dist/remoteRun/remoteRunError.js +28 -0
  306. package/dist/remoteRun/remoteRunError.js.map +1 -0
  307. package/dist/remoteRun/rsync.d.ts +17 -0
  308. package/dist/remoteRun/rsync.d.ts.map +1 -0
  309. package/dist/remoteRun/rsync.js +39 -0
  310. package/dist/remoteRun/rsync.js.map +1 -0
  311. package/dist/remoteRun/runnerClient.d.ts +52 -0
  312. package/dist/remoteRun/runnerClient.d.ts.map +1 -0
  313. package/dist/remoteRun/runnerClient.js +143 -0
  314. package/dist/remoteRun/runnerClient.js.map +1 -0
  315. package/dist/remoteRun/runnerSummary.d.ts +24 -0
  316. package/dist/remoteRun/runnerSummary.d.ts.map +1 -0
  317. package/dist/remoteRun/runnerSummary.js +86 -0
  318. package/dist/remoteRun/runnerSummary.js.map +1 -0
  319. package/dist/remoteRun/runnerWait.d.ts +68 -0
  320. package/dist/remoteRun/runnerWait.d.ts.map +1 -0
  321. package/dist/remoteRun/runnerWait.js +137 -0
  322. package/dist/remoteRun/runnerWait.js.map +1 -0
  323. package/dist/remoteRun/runnerWaitTiming.d.ts +16 -0
  324. package/dist/remoteRun/runnerWaitTiming.d.ts.map +1 -0
  325. package/dist/remoteRun/runnerWaitTiming.js +37 -0
  326. package/dist/remoteRun/runnerWaitTiming.js.map +1 -0
  327. package/dist/remoteRun/runners.d.ts +57 -0
  328. package/dist/remoteRun/runners.d.ts.map +1 -0
  329. package/dist/remoteRun/runners.js +209 -0
  330. package/dist/remoteRun/runners.js.map +1 -0
  331. package/dist/remoteRun/runnersCatalog.d.ts +14 -0
  332. package/dist/remoteRun/runnersCatalog.d.ts.map +1 -0
  333. package/dist/remoteRun/runnersCatalog.js +68 -0
  334. package/dist/remoteRun/runnersCatalog.js.map +1 -0
  335. package/dist/remoteRun/runnersConfig.d.ts +53 -0
  336. package/dist/remoteRun/runnersConfig.d.ts.map +1 -0
  337. package/dist/remoteRun/runnersConfig.js +109 -0
  338. package/dist/remoteRun/runnersConfig.js.map +1 -0
  339. package/dist/remoteRun/safeCopy.d.ts +31 -0
  340. package/dist/remoteRun/safeCopy.d.ts.map +1 -0
  341. package/dist/remoteRun/safeCopy.js +137 -0
  342. package/dist/remoteRun/safeCopy.js.map +1 -0
  343. package/dist/remoteRun/sendPlan.d.ts +67 -0
  344. package/dist/remoteRun/sendPlan.d.ts.map +1 -0
  345. package/dist/remoteRun/sendPlan.js +139 -0
  346. package/dist/remoteRun/sendPlan.js.map +1 -0
  347. package/dist/remoteRun/ssh.d.ts +82 -0
  348. package/dist/remoteRun/ssh.d.ts.map +1 -0
  349. package/dist/remoteRun/ssh.js +236 -0
  350. package/dist/remoteRun/ssh.js.map +1 -0
  351. package/dist/remoteRun/submit.d.ts +29 -0
  352. package/dist/remoteRun/submit.d.ts.map +1 -0
  353. package/dist/remoteRun/submit.js +142 -0
  354. package/dist/remoteRun/submit.js.map +1 -0
  355. package/dist/requests/answerRequest.d.ts +5 -0
  356. package/dist/requests/answerRequest.d.ts.map +1 -1
  357. package/dist/requests/answerRequest.js +16 -1
  358. package/dist/requests/answerRequest.js.map +1 -1
  359. package/dist/requests/requestLedger.d.ts +13 -0
  360. package/dist/requests/requestLedger.d.ts.map +1 -1
  361. package/dist/requests/requestLedger.js +9 -0
  362. package/dist/requests/requestLedger.js.map +1 -1
  363. package/dist/requests/topicRequestSettle.d.ts +30 -0
  364. package/dist/requests/topicRequestSettle.d.ts.map +1 -0
  365. package/dist/requests/topicRequestSettle.js +23 -0
  366. package/dist/requests/topicRequestSettle.js.map +1 -0
  367. package/dist/requests/wakeUpEngine.d.ts +4 -0
  368. package/dist/requests/wakeUpEngine.d.ts.map +1 -1
  369. package/dist/requests/wakeUpEngine.js +5 -1
  370. package/dist/requests/wakeUpEngine.js.map +1 -1
  371. package/dist/runnerUtility/adminCheck.d.ts +11 -0
  372. package/dist/runnerUtility/adminCheck.d.ts.map +1 -0
  373. package/dist/runnerUtility/adminCheck.js +68 -0
  374. package/dist/runnerUtility/adminCheck.js.map +1 -0
  375. package/dist/runnerUtility/appInstall.d.ts +25 -0
  376. package/dist/runnerUtility/appInstall.d.ts.map +1 -0
  377. package/dist/runnerUtility/appInstall.js +147 -0
  378. package/dist/runnerUtility/appInstall.js.map +1 -0
  379. package/dist/runnerUtility/appUpdate.d.ts +39 -0
  380. package/dist/runnerUtility/appUpdate.d.ts.map +1 -0
  381. package/dist/runnerUtility/appUpdate.js +90 -0
  382. package/dist/runnerUtility/appUpdate.js.map +1 -0
  383. package/dist/runnerUtility/execEnv.d.ts +21 -0
  384. package/dist/runnerUtility/execEnv.d.ts.map +1 -0
  385. package/dist/runnerUtility/execEnv.js +109 -0
  386. package/dist/runnerUtility/execEnv.js.map +1 -0
  387. package/dist/runnerUtility/execSession.d.ts +13 -0
  388. package/dist/runnerUtility/execSession.d.ts.map +1 -0
  389. package/dist/runnerUtility/execSession.js +58 -0
  390. package/dist/runnerUtility/execSession.js.map +1 -0
  391. package/dist/runnerUtility/hubClient.d.ts +30 -0
  392. package/dist/runnerUtility/hubClient.d.ts.map +1 -0
  393. package/dist/runnerUtility/hubClient.js +127 -0
  394. package/dist/runnerUtility/hubClient.js.map +1 -0
  395. package/dist/runnerUtility/injectStream.d.ts +9 -0
  396. package/dist/runnerUtility/injectStream.d.ts.map +1 -0
  397. package/dist/runnerUtility/injectStream.js +12 -0
  398. package/dist/runnerUtility/injectStream.js.map +1 -0
  399. package/dist/runnerUtility/iosCheck.d.ts +62 -0
  400. package/dist/runnerUtility/iosCheck.d.ts.map +1 -0
  401. package/dist/runnerUtility/iosCheck.js +200 -0
  402. package/dist/runnerUtility/iosCheck.js.map +1 -0
  403. package/dist/runnerUtility/launcher.d.ts +5 -0
  404. package/dist/runnerUtility/launcher.d.ts.map +1 -0
  405. package/dist/runnerUtility/launcher.js +85 -0
  406. package/dist/runnerUtility/launcher.js.map +1 -0
  407. package/dist/runnerUtility/linkLoop.d.ts +47 -0
  408. package/dist/runnerUtility/linkLoop.d.ts.map +1 -0
  409. package/dist/runnerUtility/linkLoop.js +281 -0
  410. package/dist/runnerUtility/linkLoop.js.map +1 -0
  411. package/dist/runnerUtility/localLinkStop.d.ts +23 -0
  412. package/dist/runnerUtility/localLinkStop.d.ts.map +1 -0
  413. package/dist/runnerUtility/localLinkStop.js +79 -0
  414. package/dist/runnerUtility/localLinkStop.js.map +1 -0
  415. package/dist/runnerUtility/machineReport.d.ts +39 -0
  416. package/dist/runnerUtility/machineReport.d.ts.map +1 -0
  417. package/dist/runnerUtility/machineReport.js +161 -0
  418. package/dist/runnerUtility/machineReport.js.map +1 -0
  419. package/dist/runnerUtility/packageId.d.ts +5 -0
  420. package/dist/runnerUtility/packageId.d.ts.map +1 -0
  421. package/dist/runnerUtility/packageId.js +64 -0
  422. package/dist/runnerUtility/packageId.js.map +1 -0
  423. package/dist/runnerUtility/pairingRecovery.d.ts +31 -0
  424. package/dist/runnerUtility/pairingRecovery.d.ts.map +1 -0
  425. package/dist/runnerUtility/pairingRecovery.js +24 -0
  426. package/dist/runnerUtility/pairingRecovery.js.map +1 -0
  427. package/dist/runnerUtility/pueueDaemon.d.ts +36 -0
  428. package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -0
  429. package/dist/runnerUtility/pueueDaemon.js +165 -0
  430. package/dist/runnerUtility/pueueDaemon.js.map +1 -0
  431. package/dist/runnerUtility/runnerCli.d.ts +18 -0
  432. package/dist/runnerUtility/runnerCli.d.ts.map +1 -0
  433. package/dist/runnerUtility/runnerCli.js +184 -0
  434. package/dist/runnerUtility/runnerCli.js.map +1 -0
  435. package/dist/runnerUtility/runnerCommands.d.ts +67 -0
  436. package/dist/runnerUtility/runnerCommands.d.ts.map +1 -0
  437. package/dist/runnerUtility/runnerCommands.js +418 -0
  438. package/dist/runnerUtility/runnerCommands.js.map +1 -0
  439. package/dist/runnerUtility/runnerConfig.d.ts +63 -0
  440. package/dist/runnerUtility/runnerConfig.d.ts.map +1 -0
  441. package/dist/runnerUtility/runnerConfig.js +153 -0
  442. package/dist/runnerUtility/runnerConfig.js.map +1 -0
  443. package/dist/runnerUtility/runnerFlags.d.ts +9 -0
  444. package/dist/runnerUtility/runnerFlags.d.ts.map +1 -0
  445. package/dist/runnerUtility/runnerFlags.js +53 -0
  446. package/dist/runnerUtility/runnerFlags.js.map +1 -0
  447. package/dist/runnerUtility/runnerHome.d.ts +30 -0
  448. package/dist/runnerUtility/runnerHome.d.ts.map +1 -0
  449. package/dist/runnerUtility/runnerHome.js +82 -0
  450. package/dist/runnerUtility/runnerHome.js.map +1 -0
  451. package/dist/runnerUtility/runnerKeys.d.ts +11 -0
  452. package/dist/runnerUtility/runnerKeys.d.ts.map +1 -0
  453. package/dist/runnerUtility/runnerKeys.js +80 -0
  454. package/dist/runnerUtility/runnerKeys.js.map +1 -0
  455. package/dist/runnerUtility/runnerServers.d.ts +40 -0
  456. package/dist/runnerUtility/runnerServers.d.ts.map +1 -0
  457. package/dist/runnerUtility/runnerServers.js +79 -0
  458. package/dist/runnerUtility/runnerServers.js.map +1 -0
  459. package/dist/runnerUtility/serviceManager.d.ts +54 -0
  460. package/dist/runnerUtility/serviceManager.d.ts.map +1 -0
  461. package/dist/runnerUtility/serviceManager.js +413 -0
  462. package/dist/runnerUtility/serviceManager.js.map +1 -0
  463. package/dist/runnerUtility/serviceUnits.d.ts +36 -0
  464. package/dist/runnerUtility/serviceUnits.d.ts.map +1 -0
  465. package/dist/runnerUtility/serviceUnits.js +169 -0
  466. package/dist/runnerUtility/serviceUnits.js.map +1 -0
  467. package/dist/runnerUtility/toolInstall.d.ts +95 -0
  468. package/dist/runnerUtility/toolInstall.d.ts.map +1 -0
  469. package/dist/runnerUtility/toolInstall.js +232 -0
  470. package/dist/runnerUtility/toolInstall.js.map +1 -0
  471. package/dist/runnerUtility/versionPollTiming.d.ts +16 -0
  472. package/dist/runnerUtility/versionPollTiming.d.ts.map +1 -0
  473. package/dist/runnerUtility/versionPollTiming.js +36 -0
  474. package/dist/runnerUtility/versionPollTiming.js.map +1 -0
  475. package/dist/runners/authorizedKeys.d.ts +52 -0
  476. package/dist/runners/authorizedKeys.d.ts.map +1 -0
  477. package/dist/runners/authorizedKeys.js +153 -0
  478. package/dist/runners/authorizedKeys.js.map +1 -0
  479. package/dist/runners/bootstrapLine.d.ts +4 -0
  480. package/dist/runners/bootstrapLine.d.ts.map +1 -0
  481. package/dist/runners/bootstrapLine.js +69 -0
  482. package/dist/runners/bootstrapLine.js.map +1 -0
  483. package/dist/runners/gate.d.ts +41 -0
  484. package/dist/runners/gate.d.ts.map +1 -0
  485. package/dist/runners/gate.js +216 -0
  486. package/dist/runners/gate.js.map +1 -0
  487. package/dist/runners/gateLink.d.ts +26 -0
  488. package/dist/runners/gateLink.d.ts.map +1 -0
  489. package/dist/runners/gateLink.js +240 -0
  490. package/dist/runners/gateLink.js.map +1 -0
  491. package/dist/runners/gateProtocol.d.ts +98 -0
  492. package/dist/runners/gateProtocol.d.ts.map +1 -0
  493. package/dist/runners/gateProtocol.js +149 -0
  494. package/dist/runners/gateProtocol.js.map +1 -0
  495. package/dist/runners/gateWrapper.d.ts +6 -0
  496. package/dist/runners/gateWrapper.d.ts.map +1 -0
  497. package/dist/runners/gateWrapper.js +70 -0
  498. package/dist/runners/gateWrapper.js.map +1 -0
  499. package/dist/runners/hubAddress.d.ts +33 -0
  500. package/dist/runners/hubAddress.d.ts.map +1 -0
  501. package/dist/runners/hubAddress.js +88 -0
  502. package/dist/runners/hubAddress.js.map +1 -0
  503. package/dist/runners/hubAddressCandidates.d.ts +16 -0
  504. package/dist/runners/hubAddressCandidates.d.ts.map +1 -0
  505. package/dist/runners/hubAddressCandidates.js +96 -0
  506. package/dist/runners/hubAddressCandidates.js.map +1 -0
  507. package/dist/runners/hubIds.d.ts +16 -0
  508. package/dist/runners/hubIds.d.ts.map +1 -0
  509. package/dist/runners/hubIds.js +25 -0
  510. package/dist/runners/hubIds.js.map +1 -0
  511. package/dist/runners/hubKey.d.ts +6 -0
  512. package/dist/runners/hubKey.d.ts.map +1 -0
  513. package/dist/runners/hubKey.js +78 -0
  514. package/dist/runners/hubKey.js.map +1 -0
  515. package/dist/runners/hubLock.d.ts +7 -0
  516. package/dist/runners/hubLock.d.ts.map +1 -0
  517. package/dist/runners/hubLock.js +230 -0
  518. package/dist/runners/hubLock.js.map +1 -0
  519. package/dist/runners/hubPackage.d.ts +23 -0
  520. package/dist/runners/hubPackage.d.ts.map +1 -0
  521. package/dist/runners/hubPackage.js +184 -0
  522. package/dist/runners/hubPackage.js.map +1 -0
  523. package/dist/runners/hubPairing.d.ts +63 -0
  524. package/dist/runners/hubPairing.d.ts.map +1 -0
  525. package/dist/runners/hubPairing.js +261 -0
  526. package/dist/runners/hubPairing.js.map +1 -0
  527. package/dist/runners/hubPaths.d.ts +38 -0
  528. package/dist/runners/hubPaths.d.ts.map +1 -0
  529. package/dist/runners/hubPaths.js +94 -0
  530. package/dist/runners/hubPaths.js.map +1 -0
  531. package/dist/runners/hubRegistry.d.ts +112 -0
  532. package/dist/runners/hubRegistry.d.ts.map +1 -0
  533. package/dist/runners/hubRegistry.js +210 -0
  534. package/dist/runners/hubRegistry.js.map +1 -0
  535. package/dist/runners/linkControl.d.ts +27 -0
  536. package/dist/runners/linkControl.d.ts.map +1 -0
  537. package/dist/runners/linkControl.js +124 -0
  538. package/dist/runners/linkControl.js.map +1 -0
  539. package/dist/runners/pairCode.d.ts +30 -0
  540. package/dist/runners/pairCode.d.ts.map +1 -0
  541. package/dist/runners/pairCode.js +46 -0
  542. package/dist/runners/pairCode.js.map +1 -0
  543. package/dist/runners/pairingTiming.d.ts +18 -0
  544. package/dist/runners/pairingTiming.d.ts.map +1 -0
  545. package/dist/runners/pairingTiming.js +42 -0
  546. package/dist/runners/pairingTiming.js.map +1 -0
  547. package/dist/runners/runnerProxy.d.ts +9 -0
  548. package/dist/runners/runnerProxy.d.ts.map +1 -0
  549. package/dist/runners/runnerProxy.js +67 -0
  550. package/dist/runners/runnerProxy.js.map +1 -0
  551. package/dist/runners/runnerRemoval.d.ts +21 -0
  552. package/dist/runners/runnerRemoval.d.ts.map +1 -0
  553. package/dist/runners/runnerRemoval.js +82 -0
  554. package/dist/runners/runnerRemoval.js.map +1 -0
  555. package/dist/runners/runnersCli.d.ts +16 -0
  556. package/dist/runners/runnersCli.d.ts.map +1 -0
  557. package/dist/runners/runnersCli.js +214 -0
  558. package/dist/runners/runnersCli.js.map +1 -0
  559. package/dist/runners/runnersList.d.ts +17 -0
  560. package/dist/runners/runnersList.d.ts.map +1 -0
  561. package/dist/runners/runnersList.js +49 -0
  562. package/dist/runners/runnersList.js.map +1 -0
  563. package/dist/runners/runnersOverview.d.ts +20 -0
  564. package/dist/runners/runnersOverview.d.ts.map +1 -0
  565. package/dist/runners/runnersOverview.js +55 -0
  566. package/dist/runners/runnersOverview.js.map +1 -0
  567. package/dist/runners/sshKeys.d.ts +26 -0
  568. package/dist/runners/sshKeys.d.ts.map +1 -0
  569. package/dist/runners/sshKeys.js +60 -0
  570. package/dist/runners/sshKeys.js.map +1 -0
  571. package/dist/runners/tarArchive.d.ts +20 -0
  572. package/dist/runners/tarArchive.d.ts.map +1 -0
  573. package/dist/runners/tarArchive.js +70 -0
  574. package/dist/runners/tarArchive.js.map +1 -0
  575. package/dist/scheduler/delivery.d.ts +2 -0
  576. package/dist/scheduler/delivery.d.ts.map +1 -1
  577. package/dist/scheduler/delivery.js +8 -4
  578. package/dist/scheduler/delivery.js.map +1 -1
  579. package/dist/scheduler/mcpSurface.d.ts +65 -10
  580. package/dist/scheduler/mcpSurface.d.ts.map +1 -1
  581. package/dist/scheduler/mcpSurface.js +319 -89
  582. package/dist/scheduler/mcpSurface.js.map +1 -1
  583. package/dist/scheduler/recurrence.d.ts +5 -0
  584. package/dist/scheduler/recurrence.d.ts.map +1 -1
  585. package/dist/scheduler/recurrence.js +12 -2
  586. package/dist/scheduler/recurrence.js.map +1 -1
  587. package/dist/scheduler/strictToolInput.d.ts +45 -0
  588. package/dist/scheduler/strictToolInput.d.ts.map +1 -0
  589. package/dist/scheduler/strictToolInput.js +155 -0
  590. package/dist/scheduler/strictToolInput.js.map +1 -0
  591. package/dist/scheduler/types.d.ts +5 -0
  592. package/dist/scheduler/types.d.ts.map +1 -1
  593. package/dist/scheduler/workerWatch.d.ts +23 -0
  594. package/dist/scheduler/workerWatch.d.ts.map +1 -0
  595. package/dist/scheduler/workerWatch.js +26 -0
  596. package/dist/scheduler/workerWatch.js.map +1 -0
  597. package/dist/selfUpdate/emittedSource.d.ts +11 -0
  598. package/dist/selfUpdate/emittedSource.d.ts.map +1 -0
  599. package/dist/selfUpdate/emittedSource.js +24 -0
  600. package/dist/selfUpdate/emittedSource.js.map +1 -0
  601. package/dist/selfUpdate/gitSource.d.ts +0 -6
  602. package/dist/selfUpdate/gitSource.d.ts.map +1 -1
  603. package/dist/selfUpdate/gitSource.js +2 -18
  604. package/dist/selfUpdate/gitSource.js.map +1 -1
  605. package/dist/selfUpdate/selfCheck.js +2 -2
  606. package/dist/selfUpdate/selfCheck.js.map +1 -1
  607. package/dist/selfUpdate/updatePending.d.ts +1 -1
  608. package/dist/sendErrorClassifier.d.ts +10 -0
  609. package/dist/sendErrorClassifier.d.ts.map +1 -1
  610. package/dist/sendErrorClassifier.js +22 -0
  611. package/dist/sendErrorClassifier.js.map +1 -1
  612. package/dist/state.d.ts +78 -7
  613. package/dist/state.d.ts.map +1 -1
  614. package/dist/state.js +125 -8
  615. package/dist/state.js.map +1 -1
  616. package/dist/stateFile.d.ts +9 -0
  617. package/dist/stateFile.d.ts.map +1 -0
  618. package/dist/stateFile.js +57 -0
  619. package/dist/stateFile.js.map +1 -0
  620. package/dist/stt/sttInstall.d.ts +7 -3
  621. package/dist/stt/sttInstall.d.ts.map +1 -1
  622. package/dist/stt/sttInstall.js +8 -4
  623. package/dist/stt/sttInstall.js.map +1 -1
  624. package/dist/stt/sttSettings.d.ts +2 -1
  625. package/dist/stt/sttSettings.d.ts.map +1 -1
  626. package/dist/stt/sttSettings.js +3 -2
  627. package/dist/stt/sttSettings.js.map +1 -1
  628. package/dist/stt/transcribeChain.js +2 -0
  629. package/dist/stt/transcribeChain.js.map +1 -1
  630. package/dist/testTimings.d.ts +16 -3
  631. package/dist/testTimings.d.ts.map +1 -1
  632. package/dist/testTimings.js +35 -2
  633. package/dist/testTimings.js.map +1 -1
  634. package/dist/todos/board.d.ts +83 -0
  635. package/dist/todos/board.d.ts.map +1 -0
  636. package/dist/todos/board.js +227 -0
  637. package/dist/todos/board.js.map +1 -0
  638. package/dist/todos/format.d.ts +33 -0
  639. package/dist/todos/format.d.ts.map +1 -0
  640. package/dist/todos/format.js +90 -0
  641. package/dist/todos/format.js.map +1 -0
  642. package/dist/todos/merge.d.ts +46 -0
  643. package/dist/todos/merge.d.ts.map +1 -0
  644. package/dist/todos/merge.js +137 -0
  645. package/dist/todos/merge.js.map +1 -0
  646. package/dist/todos/midTurn.d.ts +75 -0
  647. package/dist/todos/midTurn.d.ts.map +1 -0
  648. package/dist/todos/midTurn.js +214 -0
  649. package/dist/todos/midTurn.js.map +1 -0
  650. package/dist/todos/nag.d.ts +85 -0
  651. package/dist/todos/nag.d.ts.map +1 -0
  652. package/dist/todos/nag.js +103 -0
  653. package/dist/todos/nag.js.map +1 -0
  654. package/dist/todos/order.d.ts +25 -0
  655. package/dist/todos/order.d.ts.map +1 -0
  656. package/dist/todos/order.js +61 -0
  657. package/dist/todos/order.js.map +1 -0
  658. package/dist/todos/projects.d.ts +102 -0
  659. package/dist/todos/projects.d.ts.map +1 -0
  660. package/dist/todos/projects.js +342 -0
  661. package/dist/todos/projects.js.map +1 -0
  662. package/dist/todos/registry.d.ts +64 -0
  663. package/dist/todos/registry.d.ts.map +1 -0
  664. package/dist/todos/registry.js +116 -0
  665. package/dist/todos/registry.js.map +1 -0
  666. package/dist/todos/reminderEngine.d.ts +78 -0
  667. package/dist/todos/reminderEngine.d.ts.map +1 -0
  668. package/dist/todos/reminderEngine.js +162 -0
  669. package/dist/todos/reminderEngine.js.map +1 -0
  670. package/dist/todos/store.d.ts +34 -0
  671. package/dist/todos/store.d.ts.map +1 -0
  672. package/dist/todos/store.js +208 -0
  673. package/dist/todos/store.js.map +1 -0
  674. package/dist/todos/tools.d.ts +26 -0
  675. package/dist/todos/tools.d.ts.map +1 -0
  676. package/dist/todos/tools.js +25 -0
  677. package/dist/todos/tools.js.map +1 -0
  678. package/dist/todos/types.d.ts +85 -0
  679. package/dist/todos/types.d.ts.map +1 -0
  680. package/dist/todos/types.js +30 -0
  681. package/dist/todos/types.js.map +1 -0
  682. package/dist/trackers/taskAgentLimit.d.ts +58 -0
  683. package/dist/trackers/taskAgentLimit.d.ts.map +1 -0
  684. package/dist/trackers/taskAgentLimit.js +62 -0
  685. package/dist/trackers/taskAgentLimit.js.map +1 -0
  686. package/dist/trackers/taskAgentSlots.d.ts +109 -0
  687. package/dist/trackers/taskAgentSlots.d.ts.map +1 -0
  688. package/dist/trackers/taskAgentSlots.js +227 -0
  689. package/dist/trackers/taskAgentSlots.js.map +1 -0
  690. package/dist/trackers/types.d.ts +14 -0
  691. package/dist/trackers/types.d.ts.map +1 -0
  692. package/dist/trackers/types.js +3 -0
  693. package/dist/trackers/types.js.map +1 -0
  694. package/dist/types.d.ts +80 -4
  695. package/dist/types.d.ts.map +1 -1
  696. package/dist/utils/adoptReplayGate.d.ts +16 -0
  697. package/dist/utils/adoptReplayGate.d.ts.map +1 -0
  698. package/dist/utils/adoptReplayGate.js +35 -0
  699. package/dist/utils/adoptReplayGate.js.map +1 -0
  700. package/dist/utils/agentEnvironment.d.ts +6 -2
  701. package/dist/utils/agentEnvironment.d.ts.map +1 -1
  702. package/dist/utils/agentEnvironment.js +13 -2
  703. package/dist/utils/agentEnvironment.js.map +1 -1
  704. package/dist/utils/agentPlugin.d.ts +113 -0
  705. package/dist/utils/agentPlugin.d.ts.map +1 -0
  706. package/dist/utils/agentPlugin.js +192 -0
  707. package/dist/utils/agentPlugin.js.map +1 -0
  708. package/dist/utils/autoContinueOnLimit.d.ts +7 -4
  709. package/dist/utils/autoContinueOnLimit.d.ts.map +1 -1
  710. package/dist/utils/autoContinueOnLimit.js +8 -5
  711. package/dist/utils/autoContinueOnLimit.js.map +1 -1
  712. package/dist/utils/botSkills.d.ts +62 -0
  713. package/dist/utils/botSkills.d.ts.map +1 -0
  714. package/dist/utils/botSkills.js +53 -0
  715. package/dist/utils/botSkills.js.map +1 -0
  716. package/dist/utils/botSkillsSetting.d.ts +7 -0
  717. package/dist/utils/botSkillsSetting.d.ts.map +1 -0
  718. package/dist/utils/botSkillsSetting.js +9 -0
  719. package/dist/utils/botSkillsSetting.js.map +1 -0
  720. package/dist/utils/claudeCodeVersion.d.ts +7 -0
  721. package/dist/utils/claudeCodeVersion.d.ts.map +1 -1
  722. package/dist/utils/claudeCodeVersion.js +14 -1
  723. package/dist/utils/claudeCodeVersion.js.map +1 -1
  724. package/dist/utils/claudeCompactHook.d.ts +33 -15
  725. package/dist/utils/claudeCompactHook.d.ts.map +1 -1
  726. package/dist/utils/claudeCompactHook.js +36 -17
  727. package/dist/utils/claudeCompactHook.js.map +1 -1
  728. package/dist/utils/claudeCompactSummary.d.ts +15 -0
  729. package/dist/utils/claudeCompactSummary.d.ts.map +1 -0
  730. package/dist/utils/claudeCompactSummary.js +96 -0
  731. package/dist/utils/claudeCompactSummary.js.map +1 -0
  732. package/dist/utils/claudeLimitSwitch.d.ts +11 -9
  733. package/dist/utils/claudeLimitSwitch.d.ts.map +1 -1
  734. package/dist/utils/claudeLimitSwitch.js +18 -16
  735. package/dist/utils/claudeLimitSwitch.js.map +1 -1
  736. package/dist/utils/claudeProfiles.d.ts +5 -0
  737. package/dist/utils/claudeProfiles.d.ts.map +1 -1
  738. package/dist/utils/claudeProfiles.js +14 -0
  739. package/dist/utils/claudeProfiles.js.map +1 -1
  740. package/dist/utils/claudeSessionTitle.d.ts +2 -1
  741. package/dist/utils/claudeSessionTitle.d.ts.map +1 -1
  742. package/dist/utils/claudeSessionTitle.js +14 -14
  743. package/dist/utils/claudeSessionTitle.js.map +1 -1
  744. package/dist/utils/claudeUsage.d.ts +95 -15
  745. package/dist/utils/claudeUsage.d.ts.map +1 -1
  746. package/dist/utils/claudeUsage.js +241 -41
  747. package/dist/utils/claudeUsage.js.map +1 -1
  748. package/dist/utils/claudeUsageRefresher.d.ts +10 -0
  749. package/dist/utils/claudeUsageRefresher.d.ts.map +1 -1
  750. package/dist/utils/claudeUsageRefresher.js +11 -0
  751. package/dist/utils/claudeUsageRefresher.js.map +1 -1
  752. package/dist/utils/claudeUserEntry.d.ts +50 -0
  753. package/dist/utils/claudeUserEntry.d.ts.map +1 -0
  754. package/dist/utils/claudeUserEntry.js +120 -0
  755. package/dist/utils/claudeUserEntry.js.map +1 -0
  756. package/dist/utils/clearThreadOutputQueues.d.ts +4 -3
  757. package/dist/utils/clearThreadOutputQueues.d.ts.map +1 -1
  758. package/dist/utils/clearThreadOutputQueues.js +1 -1
  759. package/dist/utils/clearThreadOutputQueues.js.map +1 -1
  760. package/dist/utils/compactOnIdle.d.ts +33 -13
  761. package/dist/utils/compactOnIdle.d.ts.map +1 -1
  762. package/dist/utils/compactOnIdle.js +35 -15
  763. package/dist/utils/compactOnIdle.js.map +1 -1
  764. package/dist/utils/fallbackBridge.d.ts +5 -0
  765. package/dist/utils/fallbackBridge.d.ts.map +1 -1
  766. package/dist/utils/fallbackBridge.js +19 -3
  767. package/dist/utils/fallbackBridge.js.map +1 -1
  768. package/dist/utils/fallbackChain.d.ts +9 -3
  769. package/dist/utils/fallbackChain.d.ts.map +1 -1
  770. package/dist/utils/fallbackChain.js +21 -3
  771. package/dist/utils/fallbackChain.js.map +1 -1
  772. package/dist/utils/fileSendPlan.d.ts +6 -0
  773. package/dist/utils/fileSendPlan.d.ts.map +1 -1
  774. package/dist/utils/fileSendPlan.js +11 -0
  775. package/dist/utils/fileSendPlan.js.map +1 -1
  776. package/dist/utils/fileSendService.d.ts +7 -1
  777. package/dist/utils/fileSendService.d.ts.map +1 -1
  778. package/dist/utils/fileSendService.js +6 -2
  779. package/dist/utils/fileSendService.js.map +1 -1
  780. package/dist/utils/groupFinalizePlan.d.ts +8 -10
  781. package/dist/utils/groupFinalizePlan.d.ts.map +1 -1
  782. package/dist/utils/groupFinalizePlan.js +8 -12
  783. package/dist/utils/groupFinalizePlan.js.map +1 -1
  784. package/dist/utils/jsonStreamHost.d.ts +13 -0
  785. package/dist/utils/jsonStreamHost.d.ts.map +1 -1
  786. package/dist/utils/jsonStreamHost.js +13 -0
  787. package/dist/utils/jsonStreamHost.js.map +1 -1
  788. package/dist/utils/messageSendService.d.ts +5 -3
  789. package/dist/utils/messageSendService.d.ts.map +1 -1
  790. package/dist/utils/messageSendService.js +12 -5
  791. package/dist/utils/messageSendService.js.map +1 -1
  792. package/dist/utils/openCodeCompactPlugin.d.ts +39 -14
  793. package/dist/utils/openCodeCompactPlugin.d.ts.map +1 -1
  794. package/dist/utils/openCodeCompactPlugin.js +106 -38
  795. package/dist/utils/openCodeCompactPlugin.js.map +1 -1
  796. package/dist/utils/promptDelivery.d.ts +29 -12
  797. package/dist/utils/promptDelivery.d.ts.map +1 -1
  798. package/dist/utils/promptDelivery.js +13 -5
  799. package/dist/utils/promptDelivery.js.map +1 -1
  800. package/dist/utils/runnersScreenPlan.d.ts +130 -0
  801. package/dist/utils/runnersScreenPlan.d.ts.map +1 -0
  802. package/dist/utils/runnersScreenPlan.js +257 -0
  803. package/dist/utils/runnersScreenPlan.js.map +1 -0
  804. package/dist/utils/sentKindsSummary.d.ts +10 -0
  805. package/dist/utils/sentKindsSummary.d.ts.map +1 -0
  806. package/dist/utils/sentKindsSummary.js +18 -0
  807. package/dist/utils/sentKindsSummary.js.map +1 -0
  808. package/dist/utils/telegramError.d.ts +6 -0
  809. package/dist/utils/telegramError.d.ts.map +1 -1
  810. package/dist/utils/telegramError.js +12 -0
  811. package/dist/utils/telegramError.js.map +1 -1
  812. package/dist/utils/topicView.d.ts +1 -1
  813. package/dist/utils/topicView.js +1 -1
  814. package/dist/utils/transcribeAudio.d.ts +10 -0
  815. package/dist/utils/transcribeAudio.d.ts.map +1 -1
  816. package/dist/utils/transcribeAudio.js +22 -3
  817. package/dist/utils/transcribeAudio.js.map +1 -1
  818. package/dist/utils/transcriptErrorTime.d.ts +8 -0
  819. package/dist/utils/transcriptErrorTime.d.ts.map +1 -0
  820. package/dist/utils/transcriptErrorTime.js +56 -0
  821. package/dist/utils/transcriptErrorTime.js.map +1 -0
  822. package/dist/utils/wedgeRecovery.d.ts +2 -0
  823. package/dist/utils/wedgeRecovery.d.ts.map +1 -1
  824. package/dist/utils/wedgeRecovery.js +1 -1
  825. package/dist/utils/wedgeRecovery.js.map +1 -1
  826. package/package.json +15 -4
  827. package/remoteRun/runner.sh +1317 -0
  828. package/stt/gigaam_sidecar.py +555 -50
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.answerReplyToCommentIdsMaxCount = exports.schedulerMcpPendingCancellationMax = exports.schedulerMcpPendingCancellationTtlMs = exports.schedulerMcpBindRetryDelayMs = exports.schedulerMcpBindRetryCount = exports.legacySchedulerMcpClientIdHeader = exports.schedulerMcpClientIdHeader = exports.schedulerMcpPath = exports.defaultSchedulerMcpPort = void 0;
3
+ exports.answerReplyToCommentIdsMaxCount = exports.claudeCodeInstructionsMaxLength = exports.schedulerMcpPendingCancellationMax = exports.schedulerMcpPendingCancellationTtlMs = exports.schedulerMcpBindRetryDelayMs = exports.schedulerMcpBindRetryCount = exports.legacySchedulerMcpClientIdHeader = exports.schedulerMcpClientIdHeader = exports.schedulerMcpPath = exports.defaultSchedulerMcpPort = void 0;
4
4
  exports.buildMcpServerInstructions = buildMcpServerInstructions;
5
5
  exports.getSchedulerMcpPort = getSchedulerMcpPort;
6
6
  exports.resolveSchedulerMcpPort = resolveSchedulerMcpPort;
@@ -12,6 +12,7 @@ exports.verifySchedulerMcpToken = verifySchedulerMcpToken;
12
12
  exports.extractBearerToken = extractBearerToken;
13
13
  exports.buildBotMcpToolDigest = buildBotMcpToolDigest;
14
14
  exports.getBotMcpToolDigest = getBotMcpToolDigest;
15
+ exports.getBotMcpToolDefinitions = getBotMcpToolDefinitions;
15
16
  exports.resolveTargetThreadKey = resolveTargetThreadKey;
16
17
  exports.buildSpecFromCreateArgs = buildSpecFromCreateArgs;
17
18
  exports.checkIsConversationInScope = checkIsConversationInScope;
@@ -23,17 +24,25 @@ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
23
24
  const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/server/streamableHttp.js");
24
25
  const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
25
26
  const zod_1 = require("zod");
27
+ const adapterNames_1 = require("../adapters/adapterNames");
26
28
  const sessionKey_1 = require("../sessionKey");
29
+ const botSkills_1 = require("../utils/botSkills");
30
+ const claudeProfiles_1 = require("../utils/claudeProfiles");
31
+ const claudeUsage_1 = require("../utils/claudeUsage");
27
32
  const isoTimestamp_1 = require("../utils/isoTimestamp");
28
33
  const messageSendService_1 = require("../utils/messageSendService");
29
34
  const utils_1 = require("../utils");
30
35
  const checkRun_1 = require("./checkRun");
31
36
  const deliveryKind_1 = require("./deliveryKind");
37
+ const workerWatch_1 = require("./workerWatch");
32
38
  const recurrence_1 = require("./recurrence");
39
+ const strictToolInput_1 = require("./strictToolInput");
33
40
  const store_1 = require("./store");
34
41
  const legacyNames_1 = require("../legacyNames");
35
42
  const answerRequest_1 = require("../requests/answerRequest");
36
43
  const answerStyle_1 = require("../requests/answerStyle");
44
+ const registry_1 = require("../todos/registry");
45
+ const types_1 = require("../todos/types");
37
46
  /**
38
47
  * @description The bot-owned MCP server exposes the agent-facing tools —
39
48
  * `schedule_create`, `schedule_list`, `schedule_cancel`, `send_file_to_user`,
@@ -106,28 +115,82 @@ const schedulerMcpClientIdPattern = /^[A-Za-z0-9._:-]+$/;
106
115
  /** Server identity reported in the MCP `initialize` handshake. */
107
116
  const mcpServerName = 'telegram-bot-scheduler';
108
117
  const mcpServerVersion = '1.0.0';
118
+ /** The skill an orchestrating agent loads in a bot session, as each CLI names it. */
119
+ const managerSkillInstruction = 'load the `charness-manager` skill (Claude Code lists it as `charness:charness-manager`) and follow it instead of any other manager skill';
109
120
  /** The instruction bullets that hold on every platform (the two platform-neutral tools). */
110
- const compactConversationInstruction = '• The user EXPLICITLY asks to compact/shrink/summarize this conversation\'s context → compact_conversation. Only on an explicit request, never on your own judgement.';
111
- const answerRequestInstruction = '• A message carries a "[Request <id> · from: …]" header → answer it through answer_request with that id: kind "final" with the full result at the end of your turn, "question" when you need the requester before you can go on (their reply arrives as a new request), "progress" for an interim note. You may call it several times; only question/final close the request. ' +
121
+ const compactConversationInstruction = '• The user EXPLICITLY asks to compact/shrink/summarize this conversation\'s context → compact_conversation. Never on your own judgement.';
122
+ const answerRequestInstruction = '• A message carries a "[Request <id> · from: …]" header → answer it through answer_request with that id: kind "final" with the full result at the end of your turn, "question" when you need the requester before you can go on (their reply arrives as a new request), "progress" for an interim note. Only question/final close the request. ' +
112
123
  answerStyle_1.answerStyleInstruction;
113
- const claudeProfilesInstruction = '• Before you start a child `claude` process (a detached worker, reviewer, planner) → claude_profiles with the model you will launch: it lists the signed-in Claude accounts with their usage windows and names the one with the most headroom (`recommended`). Launch the child with `CLAUDE_CONFIG_DIR=<its configDir>` in its environment (nothing when configDir is null); without it the child inherits YOUR account and drains the same limits.';
114
- const telegramInstructions = `This MCP lets the agent act on its own Telegram topic.
124
+ /** The shared todo registry's bullet (D7) — Telegram topics and Jira issues publish alike. */
125
+ const todoInstruction = '• BEFORE you start any task (fixes you found yourself included: a failing test, a leak) → todo_update adds it as inWork, naming the area (files, tests). Check the returned board for overlap with other agents. Take the queue top-down; mark items done / dropped at once. A ticket you create in a tracker gets an item with its key in `ref`.';
126
+ /** The `charness remote-run` bullet — present only while a runner is paired or listed in `runners.json`, for Telegram topics and tracker issues alike. The CLI's own `--help` has the job commands. */
127
+ const remoteRunInstruction = '• Heavy work (test suite, build, e2e run) → send it to a runner, not this machine: `charness remote-run runners` lists them and what each can do; `charness remote-run [--needs android|ios|docker|playwright] <command>` runs it in a copy of this project and returns its output and exit code (edit files only here). Longer than your tool timeout: `charness remote-run --bg <command>`, then `charness remote-run wait <id>` in the background; `charness remote-run --help` lists the rest.';
128
+ /**
129
+ * Claude Code cuts a server's connect-time `instructions` that are longer than this: whatever comes last is lost, silently. The Telegram
130
+ * text is within a few hundred characters of it before the remote-run bullet, so the runner lines are fitted to the room that is left.
131
+ */
132
+ exports.claudeCodeInstructionsMaxLength = 4096;
133
+ /**
134
+ * The remote-run bullet with one line per runner under it (`mac — macOS 15.1, android, playwright`: the name, the OS, what it could do when
135
+ * last probed): the first `shownCount` runners, and «… and N more» for the rest. The lines are a snapshot taken at connect; `charness
136
+ * remote-run runners` has the live state. `shownCount` 0 gives the bullet alone.
137
+ */
138
+ function buildRemoteRunInstruction(runnerLines, shownCount) {
139
+ if (shownCount === 0)
140
+ return remoteRunInstruction;
141
+ const hiddenCount = runnerLines.length - shownCount;
142
+ return [
143
+ remoteRunInstruction,
144
+ ' Runners, as last seen:',
145
+ ...runnerLines.slice(0, shownCount).map((line) => ` – ${line}`),
146
+ ...(hiddenCount > 0 ? [` – … and ${hiddenCount} more`] : []),
147
+ ].join('\n');
148
+ }
149
+ const orchestrationInstructionHead = '• You orchestrate detached workers (a `claude -p` / `opencode run` builder, reviewer, researcher) →';
150
+ /** What the worker-watch recipe says once a tool is named: shared by both wordings of the Telegram bullet. */
151
+ const workerWatchRecipeText = `its description has the recipe (checkCommand, cron, \`${workerWatch_1.workerWatchPinArgument}\`); never \`kill -0\` alone: it never fires on a hung worker.`;
152
+ /**
153
+ * The orchestration bullet of a conversation on a tracker, which has no scheduling tools: only the manager-skill hint, so
154
+ * with the bot's skills off (`/bot_skills`) there is nothing left of it and `null` drops it.
155
+ */
156
+ function buildTrackerOrchestrationInstruction(isBotSkillsEnabled) {
157
+ return isBotSkillsEnabled ? `${orchestrationInstructionHead} ${managerSkillInstruction}.` : null;
158
+ }
159
+ /** The orchestration bullet of a Telegram topic: the manager-skill hint (dropped with the skills off) and the worker-watch recipe, which is a tool fact and stays. */
160
+ function buildTelegramOrchestrationInstruction(isBotSkillsEnabled) {
161
+ return isBotSkillsEnabled
162
+ ? `${orchestrationInstructionHead} ${managerSkillInstruction}. Watch EACH worker with schedule_create — ${workerWatchRecipeText}`
163
+ : `${orchestrationInstructionHead} schedule_create to watch EACH worker — ${workerWatchRecipeText}`;
164
+ }
165
+ const claudeProfilesInstruction = '• Before you start or resume a child `claude` process (worker, reviewer, planner) → claude_profiles with the model you will launch, and start the child under the account it names (`CLAUDE_CONFIG_DIR=<configDir>`): without it the child inherits YOUR account and drains the same limits. The tool description has the rest (resuming, `recommended: null`).';
166
+ /** @description Which optional tools `deps` offers. */
167
+ function getOptionalBotTools(deps) {
168
+ return {
169
+ isJiraAttachmentToolOffered: deps.fetchJiraAttachment !== undefined,
170
+ isTodoToolOffered: deps.todos !== undefined,
171
+ remoteRunRunnerLines: deps.getRemoteRunRunnerLines?.() ?? [],
172
+ };
173
+ }
174
+ function buildTelegramInstructions(isTodoToolOffered, remoteRunInstructionText, isBotSkillsEnabled) {
175
+ return `This MCP lets the agent act on its own Telegram topic.
115
176
 
116
177
  When to use it:
117
- • The user asks to run/finish a plan or task LATER ("in 2h", "tomorrow 9am", "every weekday") → schedule_create. Put the work in \`prompt\`; the future run is a fresh session with no memory of this chat. Not CronCreate / ScheduleWakeup for anything that must happen: they live only in your process, which the bot stops after a long idle stretch, and die with it.
118
- • You produced a file/chart/screenshot/video to deliver → send_file_to_user. Videos MUST be H.264 .mp4 sent as video (never as_file/document, never .webm/.mov — those render as GIFs or don't play); transcode first if needed (the tool description has the ffmpeg recipe).
119
- • You want to deliver SEVERAL discrete messages (each as its own Telegram message, e.g. a per-item news digest) → send_messages_to_user. Each item can optionally attach ONE file/photo/video (text becomes its caption).
178
+ • The user asks to run/finish a plan or task LATER ("in 2h", "tomorrow 9am", "every weekday") → schedule_create. Put the work in \`prompt\`; the future run is a fresh session with no memory of this chat. Not CronCreate / ScheduleWakeup for anything that must happen: they die with your process, which the bot stops after a long idle stretch.
179
+ • You produced a file/chart/screenshot/video to deliver → send_file_to_user. Videos MUST be H.264 .mp4 sent as video (never as_file/document or .webm/.mov — those render as GIFs or don't play); transcode first if needed (recipe in the tool description).
180
+ • You want to deliver SEVERAL discrete messages (each its own message, e.g. a per-item news digest) → send_messages_to_user; an item may attach ONE file (the text becomes its caption).
120
181
  ${compactConversationInstruction}
121
- • You need to review or remove scheduled jobs → schedule_list / schedule_cancel.
122
- • You need a watchdog — keep an eye on a service, process, build, deploy, disk, URL… → schedule_create with \`checkCommand\` (cron). The bot runs the command in this folder on schedule, stays silent while it exits 0, and on the first failure pins an alert and wakes you with \`prompt\` + the exit code and output tail. Checks survive bot restarts and crashes. NEVER build your own watcher (a background loop, nohup, a sleep loop, a tmux pane, a shell crontab): it dies with your session or a restart and then fails silently.
123
- ${answerRequestInstruction} The requester may not see your plain text, so anything they must read goes through answer_request. Your plain text is relayed into the topic too, so after answer_request end the turn WITHOUT a plain-text recap of what you answered — it would show up twice.
124
- ${claudeProfilesInstruction}
182
+ ${isTodoToolOffered ? `${todoInstruction}\n` : ''}• You need to review or remove scheduled jobs → schedule_list / schedule_cancel.
183
+ • You need a watchdog — keep an eye on a service, build, deploy, disk, URL… → schedule_create with \`checkCommand\` (cron): the bot runs it in this folder, stays silent while it exits 0, and on the first failure pins an alert and wakes you with \`prompt\` + the exit code and output tail. Checks survive restarts and crashes. NEVER build your own watcher (background loop, nohup, sleep loop, tmux pane, shell crontab): it dies with your session or a restart, silently.
184
+ ${buildTelegramOrchestrationInstruction(isBotSkillsEnabled)}
185
+ ${answerRequestInstruction} The requester may not see your plain text: anything they must read goes through answer_request — yet your plain text is relayed into the topic too, so end the turn WITHOUT a recap of what you answered (it would show twice).
186
+ ${claudeProfilesInstruction}${remoteRunInstructionText === null ? '' : `\n${remoteRunInstructionText}`}
125
187
 
126
- Each tool's own description has the exact argument recipe (one-shot vs cron vs N-times, checks).`;
188
+ Tool descriptions hold the argument recipes.`;
189
+ }
127
190
  /** What a Jira session's instructions add: the tool that reaches the issue's original files (C10). */
128
191
  const jiraAttachmentInstruction = '• The issue lists a file (an attachment id in the attachments list, or in a placeholder such as "[image: shot.png — attachment 10234]") you need to look at → jira_get_attachment with that id; it saves the original file and returns its path.';
129
192
  /** For a conversation on a tracker: the requester sees nothing but the answers; `extraInstructions` name the platform's own tools. */
130
- function buildTrackerInstructions(extraInstructions) {
193
+ function buildTrackerInstructions(extraInstructions, isBotSkillsEnabled) {
131
194
  return `This MCP connects the agent to the conversation that asked for its work.
132
195
 
133
196
  When to use it:
@@ -136,12 +199,11 @@ ${[
136
199
  ...extraInstructions,
137
200
  compactConversationInstruction,
138
201
  claudeProfilesInstruction,
139
- ].join('\n')}
202
+ buildTrackerOrchestrationInstruction(isBotSkillsEnabled),
203
+ ].filter((instruction) => instruction !== null).join('\n')}
140
204
 
141
205
  Each tool's own description has the exact argument recipe.`;
142
206
  }
143
- const neutralInstructions = buildTrackerInstructions([]);
144
- const jiraInstructions = buildTrackerInstructions([jiraAttachmentInstruction]);
145
207
  /**
146
208
  * Connect-time `instructions` returned in the MCP `initialize` handshake — a
147
209
  * short, high-level pointer the client surfaces to the agent BEFORE any call.
@@ -151,12 +213,33 @@ const jiraInstructions = buildTrackerInstructions([jiraAttachmentInstruction]);
151
213
  *
152
214
  * @description The connect-time instructions for a session of `platform`: only
153
215
  * a Telegram session has the scheduling and send-to-topic tools, so only its
154
- * instructions name them (Jira connector plan J2, D18).
216
+ * instructions name them (Jira connector plan J2, D18); an optional tool is named
217
+ * only where it is offered. With the bot's skills off for the session
218
+ * (`isBotSkillsEnabled`, `/bot_skills`) the orchestration bullet no longer tells it to load `charness-manager`.
155
219
  */
156
- function buildMcpServerInstructions(platform, isJiraAttachmentToolOffered = false) {
157
- if (platform === 'telegram')
158
- return telegramInstructions;
159
- return platform === 'jira' && isJiraAttachmentToolOffered ? jiraInstructions : neutralInstructions;
220
+ function buildMcpServerInstructions(platform, offered, isBotSkillsEnabled) {
221
+ const render = (remoteRunInstructionText) => {
222
+ if (platform === 'telegram')
223
+ return buildTelegramInstructions(offered.isTodoToolOffered, remoteRunInstructionText, isBotSkillsEnabled);
224
+ const remoteRunInstructions = remoteRunInstructionText === null ? [] : [remoteRunInstructionText];
225
+ if (platform !== 'jira')
226
+ return buildTrackerInstructions(remoteRunInstructions, isBotSkillsEnabled);
227
+ return buildTrackerInstructions([
228
+ ...(offered.isJiraAttachmentToolOffered ? [jiraAttachmentInstruction] : []),
229
+ ...(offered.isTodoToolOffered ? [todoInstruction] : []),
230
+ ...remoteRunInstructions,
231
+ ], isBotSkillsEnabled);
232
+ };
233
+ const runnerCount = offered.remoteRunRunnerLines.length;
234
+ if (runnerCount === 0)
235
+ return render(null);
236
+ // As many runners as the room under Claude Code's cap leaves; the bullet itself always stays (its `runners` command is the full list).
237
+ for (let shownCount = runnerCount; shownCount > 0; shownCount -= 1) {
238
+ const text = render(buildRemoteRunInstruction(offered.remoteRunRunnerLines, shownCount));
239
+ if (text.length <= exports.claudeCodeInstructionsMaxLength)
240
+ return text;
241
+ }
242
+ return render(buildRemoteRunInstruction(offered.remoteRunRunnerLines, 0));
160
243
  }
161
244
  /** Max characters of a free-text job name / prompt accepted by a tool (defensive bound). */
162
245
  const maxNameLength = 200;
@@ -298,15 +381,22 @@ const digestScope = { kind: 'dir', directory: '' };
298
381
  * a tool added, renamed, re-described or re-shaped changes it and nothing else
299
382
  * has to be kept in step by hand.
300
383
  */
301
- function getBotMcpToolDigest(deps, platform) {
384
+ function getBotMcpToolDigest(deps, platform, isBotSkillsEnabled) {
385
+ return buildBotMcpToolDigest(buildMcpServerInstructions(platform, getOptionalBotTools(deps), isBotSkillsEnabled), getBotMcpToolDefinitions(deps, platform));
386
+ }
387
+ /**
388
+ * @description The tool definitions a session of `platform` gets, recorded from the SAME registration the request
389
+ * path runs (never a handler): what the digest hashes, and what a test reads the tools' names and descriptions from.
390
+ */
391
+ function getBotMcpToolDefinitions(deps, platform) {
302
392
  const definitions = [];
303
393
  const recorder = {
304
394
  registerTool: (name, config) => {
305
- definitions.push({ name, title: config.title, description: config.description, inputKeys: Object.keys(config.inputSchema ?? {}).sort() });
395
+ definitions.push({ name, title: config.title, description: config.description, inputKeys: Object.keys(config.inputSchema.shape).sort() });
306
396
  },
307
397
  };
308
398
  registerBotTools(recorder, deps, digestScope, platform, undefined);
309
- return buildBotMcpToolDigest(buildMcpServerInstructions(platform, deps.fetchJiraAttachment !== undefined), definitions);
399
+ return definitions;
310
400
  }
311
401
  /**
312
402
  * @description Resolve the single thread a tool call targets, from its scope and
@@ -356,6 +446,11 @@ function resolveTargetThreadKey(scope, suppliedThreadKey, getThreadsForDirectory
356
446
  return { ok: true, threadKey: suppliedThreadKey };
357
447
  }
358
448
  // ─── tool input schemas + spec building ──────────────────────────────
449
+ /** The optional target thread every topic-scoped tool takes (a `dir:` scope with several bound threads needs it). */
450
+ const threadKeyArgSchema = zod_1.z
451
+ .string()
452
+ .optional()
453
+ .describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.');
359
454
  const scheduleCreateShape = {
360
455
  name: zod_1.z.string().min(1).max(maxNameLength).describe('Short human name for the job (shown in announcements/lists).'),
361
456
  cron: zod_1.z
@@ -396,7 +491,7 @@ const scheduleCreateShape = {
396
491
  'non-zero exit or timeout pins an alert in the topic and wakes you with `prompt` plus the exit ' +
397
492
  'code and output tail; later failures stay silent until a run passes again (the topic is told). ' +
398
493
  'Keep it a quick probe, e.g. `systemctl --user is-active myapp`, `curl -fsS -m 10 http://127.0.0.1:8080/health`, ' +
399
- '`test $(df --output=pcent / | tail -1 | tr -dc 0-9) -lt 90`.'),
494
+ '`test $(df --output=pcent / | tail -1 | tr -dc 0-9) -lt 90`; a detached worker: the recipe in the tool description.'),
400
495
  checkTimeoutSeconds: zod_1.z
401
496
  .number()
402
497
  .int()
@@ -409,24 +504,18 @@ const scheduleCreateShape = {
409
504
  .boolean()
410
505
  .optional()
411
506
  .describe('Pin the fire announcement silently (no member notification). Default false = notify all.'),
412
- threadKey: zod_1.z
413
- .string()
414
- .optional()
415
- .describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.'),
507
+ threadKey: threadKeyArgSchema,
416
508
  };
509
+ const scheduleCreateInput = (0, strictToolInput_1.createStrictToolInput)(scheduleCreateShape);
417
510
  const scheduleListShape = {
418
- threadKey: zod_1.z
419
- .string()
420
- .optional()
421
- .describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.'),
511
+ threadKey: threadKeyArgSchema,
422
512
  };
513
+ const scheduleListInput = (0, strictToolInput_1.createStrictToolInput)(scheduleListShape);
423
514
  const scheduleCancelShape = {
424
515
  id: zod_1.z.string().min(1).describe('The schedule id to cancel (from schedule_list).'),
425
- threadKey: zod_1.z
426
- .string()
427
- .optional()
428
- .describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.'),
516
+ threadKey: threadKeyArgSchema,
429
517
  };
518
+ const scheduleCancelInput = (0, strictToolInput_1.createStrictToolInput)(scheduleCancelShape);
430
519
  /**
431
520
  * Coerces an ARRAY tool argument into an actual array before validation. Some
432
521
  * MCP bridges (observed: Claude-agent harnesses AND OpenCode) serialize an array
@@ -466,19 +555,18 @@ const sendFileShape = {
466
555
  .boolean()
467
556
  .optional()
468
557
  .describe('Explicitly force sendDocument (original quality, no inline preview), including for MP4s that use sendVideo by default.'),
469
- threadKey: zod_1.z
470
- .string()
471
- .optional()
472
- .describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.'),
558
+ threadKey: threadKeyArgSchema,
473
559
  };
560
+ const sendFileInput = (0, strictToolInput_1.createStrictToolInput)(sendFileShape);
474
561
  /**
475
562
  * One batch item: EITHER a plain non-empty string (text-only message,
476
563
  * backward-compatible with the original string-array tool) OR an object that may
477
- * carry a text body, an attachment `path`, or both. The `.refine` rejects an
478
- * all-empty object so a stray `{}` never posts nothing.
564
+ * carry a text body, an attachment `path`, or both. The object is CLOSED: an
565
+ * agent that writes `filePath` for `path` must be told, not silently sent as a
566
+ * text-only message. The `.refine` rejects an all-empty object so a stray `{}`
567
+ * never posts nothing.
479
568
  */
480
- const sendMessageItemObjectSchema = zod_1.z
481
- .object({
569
+ const sendMessageItemObjectSchema = (0, strictToolInput_1.createStrictToolInput)({
482
570
  text: zod_1.z
483
571
  .string()
484
572
  .optional()
@@ -494,12 +582,11 @@ const sendMessageItemObjectSchema = zod_1.z
494
582
  .boolean()
495
583
  .optional()
496
584
  .describe('Force sendDocument for THIS attachment (original quality, no inline preview), including for MP4s.'),
497
- })
498
- .refine((item) => (item.text?.trim().length ?? 0) > 0 || (item.path?.trim().length ?? 0) > 0, { message: 'each message object must set a non-empty text or path' });
585
+ }).refine((item) => (item.text?.trim().length ?? 0) > 0 || (item.path?.trim().length ?? 0) > 0, { message: 'each message object must set a non-empty text or path' });
499
586
  const sendMessageShape = {
500
587
  messages: zod_1.z
501
588
  .preprocess(coerceJsonArrayArg, zod_1.z
502
- .array(zod_1.z.union([zod_1.z.string().min(1), sendMessageItemObjectSchema]))
589
+ .array(zod_1.z.union([zod_1.z.string().min(1), sendMessageItemObjectSchema], { error: strictToolInput_1.getUnknownKeysMessageOfUnion }))
503
590
  .min(1)
504
591
  .max(messageSendService_1.maxDiscreteMessages))
505
592
  .describe(`1..${messageSendService_1.maxDiscreteMessages} items; EACH item is posted as its OWN separate Telegram message, in order (never ` +
@@ -512,11 +599,9 @@ const sendMessageShape = {
512
599
  'Use this when you deliberately want several distinct messages (e.g. a per-item news digest: one message ' +
513
600
  'per headline). Do NOT also print the same content as your normal reply, or it posts twice. Text supports ' +
514
601
  'the usual markdown (links, bold); an over-long text item is split automatically.'),
515
- threadKey: zod_1.z
516
- .string()
517
- .optional()
518
- .describe('Target thread "<chatId>:<threadId>". Required when a directory scope has more than one bound thread.'),
602
+ threadKey: threadKeyArgSchema,
519
603
  };
604
+ const sendMessageInput = (0, strictToolInput_1.createStrictToolInput)(sendMessageShape);
520
605
  /**
521
606
  * The three valid call shapes, appended to structural errors so a bad first call
522
607
  * teaches the corrected next call (the model spirals when an error says only what
@@ -629,8 +714,13 @@ function registerSchedulerTools(server, deps, scope) {
629
714
  'with a cron — the bot runs it in this folder and wakes you only when it starts failing. This is ' +
630
715
  'the ONLY reliable watcher: it survives bot restarts and crashes. Never build your own (a ' +
631
716
  'background loop, nohup, a sleep loop, a tmux pane, a shell crontab) — it dies with your session ' +
632
- 'or a restart and then fails silently.',
633
- inputSchema: scheduleCreateShape,
717
+ 'or a restart and then fails silently.\n\n' +
718
+ `A DETACHED WORKER you launched (a \`claude -p\` / \`opencode run\` process): cron \`${workerWatch_1.workerWatchCheckCron}\`, ` +
719
+ `\`${workerWatch_1.workerWatchPinArgument}\`, checkCommand \`${workerWatch_1.workerWatchCheckCommand}\` with its PID and run dir — it fails when ` +
720
+ 'the worker exits OR nothing in its run dir changed for 45 min, so the first failure is also the "worker finished" ' +
721
+ 'signal (hence the silent pin: a normal finish must not notify the user). Never `kill -0` alone: it stays green ' +
722
+ 'while a worker hangs. One check per worker run; schedule_cancel it once its wake is handled.',
723
+ inputSchema: scheduleCreateInput,
634
724
  }, async (args) => {
635
725
  const resolved = resolveTargetThreadKey(scope, args.threadKey, deps.getThreadsForDirectory);
636
726
  if (!resolved.ok)
@@ -678,7 +768,7 @@ function registerSchedulerTools(server, deps, scope) {
678
768
  server.registerTool('schedule_list', {
679
769
  title: 'List scheduled prompts',
680
770
  description: 'List the scheduled prompts for this topic (id, name, schedule, next run, paused flag).',
681
- inputSchema: scheduleListShape,
771
+ inputSchema: scheduleListInput,
682
772
  }, async (args) => {
683
773
  const resolved = resolveTargetThreadKey(scope, args.threadKey, deps.getThreadsForDirectory);
684
774
  if (!resolved.ok)
@@ -706,8 +796,10 @@ function registerSchedulerTools(server, deps, scope) {
706
796
  });
707
797
  server.registerTool('schedule_cancel', {
708
798
  title: 'Cancel a scheduled prompt',
709
- description: 'Cancel (delete) a scheduled prompt by its id. Only schedules owned by this topic can be cancelled.',
710
- inputSchema: scheduleCancelShape,
799
+ description: 'Cancel (delete) a scheduled prompt by its id. Only schedules owned by this topic can be cancelled. Cancelling a ' +
800
+ 'watchdog check also unpins the alerts it pinned — cancel a worker watch once its wake is handled, so a finished ' +
801
+ 'worker leaves no pinned alert behind.',
802
+ inputSchema: scheduleCancelInput,
711
803
  }, async (args) => {
712
804
  const resolved = resolveTargetThreadKey(scope, args.threadKey, deps.getThreadsForDirectory);
713
805
  if (!resolved.ok)
@@ -723,7 +815,11 @@ function registerSchedulerTools(server, deps, scope) {
723
815
  }
724
816
  await deps.store.removeSchedule(args.id);
725
817
  deps.disarmJob(args.id);
726
- return textResult(`Cancelled "${record.name}" (id: ${record.id}).`);
818
+ const alertPins = record.alertPinMessageIds ?? [];
819
+ if (alertPins.length === 0)
820
+ return textResult(`Cancelled "${record.name}" (id: ${record.id}).`);
821
+ await deps.unpinMessages(record.threadKey, alertPins);
822
+ return textResult(`Cancelled "${record.name}" (id: ${record.id}); its ${alertPins.length} pinned alert(s) unpinned.`);
727
823
  });
728
824
  }
729
825
  /**
@@ -750,7 +846,7 @@ function registerFileSendTool(server, deps, scope, requestSignal) {
750
846
  'the whole album documents — which turns its MP4s into GIFs, so send videos in their own call. ' +
751
847
  'If a send fails, say so and give the file\'s path in your reply, then go on with the work — never stop over it. ' +
752
848
  'Caption is optional (trimmed to 1024 chars; on the first album item).',
753
- inputSchema: sendFileShape,
849
+ inputSchema: sendFileInput,
754
850
  }, async (args, extra) => {
755
851
  const signal = requestSignal
756
852
  ? AbortSignal.any([extra.signal, requestSignal])
@@ -797,7 +893,7 @@ function registerMessageSendTool(server, deps, scope, requestSignal) {
797
893
  'items; an over-long text item is split automatically. Note: this does NOT replace your normal single ' +
798
894
  'reply — only reach for it when multiple discrete messages are wanted, and do not also print the same ' +
799
895
  'content as your reply text (that would post it twice).',
800
- inputSchema: sendMessageShape,
896
+ inputSchema: sendMessageInput,
801
897
  }, async (args, extra) => {
802
898
  const signal = requestSignal
803
899
  ? AbortSignal.any([extra.signal, requestSignal])
@@ -843,12 +939,12 @@ function registerCompactConversationTool(server, deps, scope) {
843
939
  'never to "clean up". It does NOT compact mid-turn: it arms compaction and returns immediately; the ' +
844
940
  'bot runs the real compaction the moment this turn finishes. There is nothing for you to do ' +
845
941
  'afterwards — do not call it again for the same request.',
846
- inputSchema: {
942
+ inputSchema: (0, strictToolInput_1.createStrictToolInput)({
847
943
  reason: zod_1.z
848
944
  .string()
849
945
  .optional()
850
946
  .describe('Optional short note on why the user asked to compact (for the bot log only).'),
851
- },
947
+ }),
852
948
  }, async (args) => {
853
949
  // A surviving session may call this before boot re-attached it.
854
950
  await deps.whenSessionsRestored();
@@ -861,6 +957,95 @@ function registerCompactConversationTool(server, deps, scope) {
861
957
  return outcome.ok ? textResult(outcome.message) : errorResult(outcome.message);
862
958
  });
863
959
  }
960
+ /** The most items one `todo_update` call may name, and the longest `order` — a stand-up list is a few items (D1). */
961
+ const todoUpdateMaxItems = 30;
962
+ const todoOrderMaxIds = 100;
963
+ const todoItemPatchSchema = (0, strictToolInput_1.createStrictToolInput)({
964
+ id: zod_1.z
965
+ .string()
966
+ .trim()
967
+ .regex(/^t\d+$/)
968
+ .optional()
969
+ .describe('The item to change ("t3", from your list). Leave it out to ADD a new item.'),
970
+ title: zod_1.z
971
+ .string()
972
+ .max(types_1.todoTitleMaxLength)
973
+ .optional()
974
+ .describe('Task-sized and concrete: name the area (files, tests). Required for a new item.'),
975
+ status: zod_1.z
976
+ .enum(types_1.todoStatuses)
977
+ .optional()
978
+ .describe('queued (default for a new item) · inWork (you are on it) · done · dropped (will not be done — the way to remove an item).'),
979
+ note: zod_1.z.string().max(types_1.todoNoteMaxLength).optional().describe('A short note other agents should know (what is left, a blocker). An empty note removes it.'),
980
+ ref: zod_1.z
981
+ .string()
982
+ .max(types_1.todoRefMaxLength)
983
+ .optional()
984
+ .describe('A tracker key / id / link the item stands for, e.g. the bug ticket you just created. An empty ref removes it.'),
985
+ position: zod_1.z.enum(types_1.todoPositions).optional().describe('Put the item first or last among the open ones (a new item goes last by default).'),
986
+ });
987
+ const todoUpdateShape = {
988
+ items: zod_1.z
989
+ .preprocess(coerceJsonArrayArg, zod_1.z.array(todoItemPatchSchema).max(todoUpdateMaxItems))
990
+ .optional()
991
+ .describe('Items to add (no id) or change (id + only the fields that change). Nothing disappears by omission: set status dropped to remove one.'),
992
+ order: zod_1.z
993
+ .preprocess(coerceJsonArrayArg, zod_1.z.array(zod_1.z.string().trim().min(1)).max(todoOrderMaxIds))
994
+ .optional()
995
+ .describe('Open item ids in the wanted queue order; the ones left out keep their relative order after them.'),
996
+ threadKey: threadKeyArgSchema,
997
+ };
998
+ const todoUpdateInput = (0, strictToolInput_1.createStrictToolInput)(todoUpdateShape);
999
+ const todoReadShape = {
1000
+ scope: zod_1.z
1001
+ .enum(registry_1.todoReadScopes)
1002
+ .optional()
1003
+ .describe('own (default): your list · project: the whole board of the project\'s other topics (what they work on now).'),
1004
+ includeHistory: zod_1.z.boolean().optional().describe(`With scope own: also list older closed items (done / dropped), up to ${registry_1.todoHistoryMaxItems}.`),
1005
+ threadKey: threadKeyArgSchema,
1006
+ };
1007
+ const todoReadInput = (0, strictToolInput_1.createStrictToolInput)(todoReadShape);
1008
+ /**
1009
+ * @description Register `todo_update` / `todo_read` (shared todo registry D3–D5): the published list of the
1010
+ * conversation the token names — never another one; the rules live in `todos/registry.ts`.
1011
+ */
1012
+ function registerTodoTools(server, deps, todos, scope) {
1013
+ server.registerTool('todo_update', {
1014
+ title: 'Update your published todo list',
1015
+ description: 'Publish what you are doing so the agents in the project\'s other topics see it and never fix the same thing ' +
1016
+ 'unknowingly (and you see theirs). Stand-up level: a few task-sized items, never micro-steps (those stay in ' +
1017
+ 'your own todo tool). Add an item as inWork BEFORE you start any task, self-found fixes included (a failing ' +
1018
+ 'test, a leak), naming the area concretely; mark it done / dropped as soon as it is. An UPSERT: an item ' +
1019
+ 'without id is new; with an id only the fields given change. A call with no items and no order confirms the ' +
1020
+ 'list is still accurate. The result is your list and what changed in the project\'s other topics since you last saw them.',
1021
+ inputSchema: todoUpdateInput,
1022
+ }, async (args) => {
1023
+ const resolved = resolveTargetThreadKey(scope, args.threadKey, deps.getThreadsForDirectory);
1024
+ if (!resolved.ok)
1025
+ return errorResult(resolved.error);
1026
+ const outcome = await todos.update(resolved.threadKey, {
1027
+ ...(args.items === undefined ? {} : { items: args.items }),
1028
+ ...(args.order === undefined ? {} : { order: args.order }),
1029
+ });
1030
+ return outcome.ok ? textResult(outcome.message) : errorResult(outcome.error);
1031
+ });
1032
+ server.registerTool('todo_read', {
1033
+ title: 'Read your published todo list',
1034
+ description: 'Your published todo list (in work, the queue in order, recently done) and what changed in the project\'s other ' +
1035
+ 'topics since you last saw them; with includeHistory also your older closed items; with scope project the whole board ' +
1036
+ 'of the other topics.',
1037
+ inputSchema: todoReadInput,
1038
+ }, async (args) => {
1039
+ const resolved = resolveTargetThreadKey(scope, args.threadKey, deps.getThreadsForDirectory);
1040
+ if (!resolved.ok)
1041
+ return errorResult(resolved.error);
1042
+ const outcome = await todos.read(resolved.threadKey, {
1043
+ ...(args.scope === undefined ? {} : { scope: args.scope }),
1044
+ ...(args.includeHistory === undefined ? {} : { includeHistory: args.includeHistory }),
1045
+ });
1046
+ return outcome.ok ? textResult(outcome.message) : errorResult(outcome.error);
1047
+ });
1048
+ }
864
1049
  /**
865
1050
  * `jira_get_attachment`: the issue is the conversation this session's token names — never an argument —
866
1051
  * so a file of any other issue cannot be asked for, however the id got into the agent's head.
@@ -873,9 +1058,9 @@ function registerJiraAttachmentTool(server, deps, fetchJiraAttachment, scope) {
873
1058
  '"[image: shot.png — attachment 10234]". There is no size limit. What you do with the file is up to ' +
874
1059
  'you: view an image with your file-reading tool, take frames or the audio of a video with ffmpeg ' +
875
1060
  '(when it is on your PATH). Only this issue\'s own attachments can be fetched.',
876
- inputSchema: {
1061
+ inputSchema: (0, strictToolInput_1.createStrictToolInput)({
877
1062
  attachmentId: zod_1.z.string().min(1).describe('The attachment id, e.g. "10234" from "[image: shot.png — attachment 10234]".'),
878
- },
1063
+ }),
879
1064
  }, async (args) => {
880
1065
  await deps.whenSessionsRestored();
881
1066
  const resolved = resolveTargetThreadKey(scope, undefined, deps.getThreadsForDirectory);
@@ -917,6 +1102,7 @@ const answerRequestShape = {
917
1102
  .max(answerRequest_1.answerBodyMaxLength)
918
1103
  .describe(`The answer itself, in Markdown. The requester does not see your other output. ${answerStyle_1.answerStyleInstruction}`),
919
1104
  };
1105
+ const answerRequestInput = (0, strictToolInput_1.createStrictToolInput)(answerRequestShape);
920
1106
  /** `answer_request` in a Jira session: the same, and the comments the answer replies to. */
921
1107
  const jiraAnswerRequestShape = {
922
1108
  ...answerRequestShape,
@@ -927,6 +1113,7 @@ const jiraAnswerRequestShape = {
927
1113
  .describe('Ids of the issue\'s comments this answer replies to, e.g. ["10240"]. The bot mentions each comment\'s ' +
928
1114
  'author at the top of your answer so they are notified. Only comments you were shown in this conversation count.'),
929
1115
  };
1116
+ const jiraAnswerRequestInput = (0, strictToolInput_1.createStrictToolInput)(jiraAnswerRequestShape);
930
1117
  /**
931
1118
  * @description Register `answer_request` (request/answer core S3): the agent's
932
1119
  * answer to a request, delivered to the surface the request came from. The
@@ -956,9 +1143,9 @@ function registerAnswerRequestTool(server, deps, scope, platform) {
956
1143
  };
957
1144
  // The reply field names a tracker's comments: only a Jira session is offered it.
958
1145
  if (platform === 'jira')
959
- server.registerTool('answer_request', { ...definition, inputSchema: jiraAnswerRequestShape }, handle);
1146
+ server.registerTool('answer_request', { ...definition, inputSchema: jiraAnswerRequestInput }, handle);
960
1147
  else
961
- server.registerTool('answer_request', { ...definition, inputSchema: answerRequestShape }, handle);
1148
+ server.registerTool('answer_request', { ...definition, inputSchema: answerRequestInput }, handle);
962
1149
  }
963
1150
  /**
964
1151
  * @description Correlate stateless MCP requests with cancellation notifications.
@@ -1058,6 +1245,20 @@ function createSchedulerMcpCancellationLifecycle(options = {}) {
1058
1245
  }
1059
1246
  return { registerRequest, cancelRequest };
1060
1247
  }
1248
+ /**
1249
+ * @description Whether the bot's skills are on for the conversations a scope reaches (`utils/botSkills.ts`). A `thread:`
1250
+ * scope is one conversation. A `dir:` scope is the OpenCode registration of a folder — ONE per folder and server run, read
1251
+ * at connect — so it serves the folder's OpenCode topics alone (a Claude topic bound to the same folder has its own
1252
+ * `thread:` scope) and keeps the manager hint while any of them has the skills on; a folder with no OpenCode topic gets the
1253
+ * instance value.
1254
+ */
1255
+ function checkIsBotSkillsEnabledForScope(deps, scope) {
1256
+ const threadKeys = scope.kind === 'thread'
1257
+ ? [scope.threadKey]
1258
+ : deps.getThreadsForDirectory(scope.directory).filter((threadKey) => deps.getThreadAdapterName(threadKey) === adapterNames_1.openCodeAdapterName);
1259
+ const keys = threadKeys.map(sessionKey_1.tryKeyFromString).filter((key) => key !== null);
1260
+ return keys.length === 0 ? (0, botSkills_1.checkIsBotSkillsEnabled)(null) : keys.some((key) => (0, botSkills_1.checkIsBotSkillsEnabled)(key));
1261
+ }
1061
1262
  /**
1062
1263
  * @description Build a fresh {@link McpServer} for one request, registering the
1063
1264
  * scope-bound scheduler tools plus the `send_file_to_user` tool. The SDK binds one server
@@ -1066,7 +1267,7 @@ function createSchedulerMcpCancellationLifecycle(options = {}) {
1066
1267
  */
1067
1268
  function buildRequestServer(deps, scope, requestSignal) {
1068
1269
  const platform = getSchedulerScopePlatform(scope);
1069
- const server = new mcp_js_1.McpServer({ name: mcpServerName, version: mcpServerVersion }, { instructions: buildMcpServerInstructions(platform, deps.fetchJiraAttachment !== undefined) });
1270
+ const server = new mcp_js_1.McpServer({ name: mcpServerName, version: mcpServerVersion }, { instructions: buildMcpServerInstructions(platform, getOptionalBotTools(deps), checkIsBotSkillsEnabledForScope(deps, scope)) });
1070
1271
  registerBotTools(server, deps, scope, platform, requestSignal);
1071
1272
  return server;
1072
1273
  }
@@ -1082,10 +1283,22 @@ function registerBotTools(server, deps, scope, platform, requestSignal) {
1082
1283
  if (platform === 'jira' && deps.fetchJiraAttachment)
1083
1284
  registerJiraAttachmentTool(server, deps, deps.fetchJiraAttachment, scope);
1084
1285
  registerCompactConversationTool(server, deps, scope);
1286
+ // A published list belongs to a conversation of a platform that has one (D54): a topic or a Jira issue.
1287
+ if (deps.todos && (platform === 'telegram' || platform === 'jira'))
1288
+ registerTodoTools(server, deps, deps.todos, scope);
1085
1289
  registerAnswerRequestTool(server, deps, scope, platform);
1086
1290
  if (deps.listClaudeProfiles)
1087
1291
  registerClaudeProfilesTool(server, deps.listClaudeProfiles);
1088
1292
  }
1293
+ /** The first line of the `claude_profiles` answer: the pick with how to launch it and why, or that nothing is usable and when something is. */
1294
+ function buildClaudeProfilesVerdict(report, currentProfile) {
1295
+ const outcome = (0, claudeUsage_1.describeClaudeLaunchOutcome)(report, currentProfile);
1296
+ if (report.recommended === null)
1297
+ return outcome;
1298
+ const dir = report.profiles.find((profile) => profile.name === report.recommended)?.configDir ?? null;
1299
+ const launch = dir === null ? 'default profile, set no CLAUDE_CONFIG_DIR' : `CLAUDE_CONFIG_DIR=${dir}`;
1300
+ return `recommended: ${report.recommended} → ${launch} (${outcome})`;
1301
+ }
1089
1302
  /**
1090
1303
  * `claude_profiles`: which Claude account a child process should run on. Reads the bot's per-profile usage
1091
1304
  * cache (refreshed on demand by the port); touches no conversation, so it needs no scope resolution. The
@@ -1095,31 +1308,43 @@ function registerClaudeProfilesTool(server, listClaudeProfiles) {
1095
1308
  server.registerTool('claude_profiles', {
1096
1309
  title: 'Claude accounts and their usage',
1097
1310
  description: 'The Claude account profiles signed in on this host, each with its usage windows — session (5 h), weekly ' +
1098
- '(all models) and weekly Fable — as percent used + reset instant, and `recommended`: the profile with the most ' +
1099
- 'headroom for the model you pass (the session window and the shared weekly window bound every model, Fable ' +
1100
- 'included; Fable also drains its own weekly window; signed-out and limited profiles are skipped). An account with ' +
1101
- '`billing: "api"` pays per request from a Claude Console balance: it has no windows and is NEVER recommended — do ' +
1102
- 'not launch a child on it unless the operator asked you to. Call it BEFORE ' +
1103
- 'launching a child `claude` and start the child with CLAUDE_CONFIG_DIR=<configDir> in its environment — ' +
1104
- 'configDir null means the default profile: set nothing. Without the variable the child inherits the account ' +
1105
- 'of this very session.',
1106
- inputSchema: {
1311
+ '(all models) and weekly Fable — as percent used + reset instant, and `recommended`: the account a process of ' +
1312
+ 'the model you pass should run on. A NEW agent (omit `currentProfile`) goes to the usable account whose weekly ' +
1313
+ 'limit resets SOONEST — what burns soonest is spent first; an account whose five-hour window is at 90 % or more ' +
1314
+ 'is skipped until it resets. A session you RESUME (pass `currentProfile`, the profile it last ran on) stays on ' +
1315
+ 'it unless that account is signed out, limited or at 100 % on a window the model drains; when it broke off on a ' +
1316
+ 'usage limit pass `isStoppedByLimit: true` and resume the SAME session at once on the answer. The session ' +
1317
+ 'window and the shared weekly window bound every model, Fable included; Fable also drains its own weekly ' +
1318
+ 'window; signed-out, limited and operator-switched-off accounts are skipped. An account with `billing: "api"` ' +
1319
+ 'pays per request from a Claude Console balance: it has no windows and is NEVER picked for a new agent — do ' +
1320
+ 'not launch a child on it unless the operator asked you to. `recommended: null` means nothing is usable now: ' +
1321
+ '`nextAvailable` names the account and instant that frees up first — schedule ONE resume at that time instead ' +
1322
+ 'of retrying; when `nextAvailable` is null too, tell the user and retry once in about 30 minutes. Call it BEFORE launching or resuming a child `claude` and start the child with ' +
1323
+ 'CLAUDE_CONFIG_DIR=<configDir> in its environment — configDir null means the default profile: set nothing. ' +
1324
+ 'Without the variable the child inherits the account of this very session.',
1325
+ inputSchema: (0, strictToolInput_1.createStrictToolInput)({
1107
1326
  model: zod_1.z
1108
1327
  .string()
1109
1328
  .max(64)
1110
1329
  .optional()
1111
1330
  .describe('The model the child will run (e.g. "fable", "opus", "sonnet"); decides whether the Fable weekly window counts besides the shared ones. Omit for the shared windows.'),
1112
- },
1331
+ currentProfile: zod_1.z
1332
+ .string()
1333
+ .max(claudeProfiles_1.claudeProfileNameMaxLength)
1334
+ .optional()
1335
+ .describe('The profile the session you RESUME last ran on (the `name` you recorded at its launch); omit for a new agent.'),
1336
+ isStoppedByLimit: zod_1.z
1337
+ .boolean()
1338
+ .optional()
1339
+ .describe('The resumed session broke off on a usage limit of `currentProfile`: that account is left out of this answer. Needs `currentProfile`.'),
1340
+ }),
1113
1341
  }, async (args) => {
1114
- const report = await listClaudeProfiles(args.model?.trim() || null);
1115
- const verdict = report.recommended === null
1116
- ? 'No eligible subscription profile: every signed-in one is limited or at 100 % on a relevant window (an account billed to API credits is never recommended).'
1117
- : (() => {
1118
- const entry = report.profiles.find((profile) => profile.name === report.recommended);
1119
- const dir = entry?.configDir ?? null;
1120
- return `recommended: ${report.recommended} → ${dir === null ? 'default profile, set no CLAUDE_CONFIG_DIR' : `CLAUDE_CONFIG_DIR=${dir}`}`;
1121
- })();
1122
- return textResult(`${verdict}\n${JSON.stringify(report, null, 1)}`);
1342
+ const currentProfile = args.currentProfile?.trim() || null;
1343
+ if (args.isStoppedByLimit === true && currentProfile === null) {
1344
+ return errorResult('isStoppedByLimit needs currentProfile — the profile the session that hit the limit last ran on.');
1345
+ }
1346
+ const report = await listClaudeProfiles({ model: args.model?.trim() || null, currentProfile, isStoppedByLimit: args.isStoppedByLimit === true });
1347
+ return textResult(`${buildClaudeProfilesVerdict(report, currentProfile)}\n${JSON.stringify(report, null, 1)}`);
1123
1348
  });
1124
1349
  }
1125
1350
  /** Read the whole request body into a string (the SDK wants the parsed JSON body). */
@@ -1229,7 +1454,12 @@ function createSchedulerMcpServer(deps) {
1229
1454
  void server.close();
1230
1455
  });
1231
1456
  await server.connect(transport);
1232
- await transport.handleRequest(req, res, parsedBody);
1457
+ // The SDK refuses a call's input before any tool code runs, so the refusal is reported from inside the handling.
1458
+ const toolCall = types_js_1.CallToolRequestSchema.safeParse(parsedBody);
1459
+ const handleRequest = () => transport.handleRequest(req, res, parsedBody);
1460
+ await (toolCall.success && deps.logDiagnostic
1461
+ ? (0, strictToolInput_1.runWithRefusalLogging)({ toolName: toolCall.data.params.name, log: deps.logDiagnostic }, handleRequest)
1462
+ : handleRequest());
1233
1463
  }
1234
1464
  function start() {
1235
1465
  return new Promise((resolve, reject) => {
@@ -1323,7 +1553,7 @@ function createSchedulerMcpServer(deps) {
1323
1553
  return {
1324
1554
  start,
1325
1555
  stop,
1326
- getToolDigest: (platform) => getBotMcpToolDigest(deps, platform),
1556
+ getToolDigest: (platform, isBotSkillsEnabled) => getBotMcpToolDigest(deps, platform, isBotSkillsEnabled),
1327
1557
  get port() {
1328
1558
  return boundPort;
1329
1559
  },