charness 3.10.0 → 3.12.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 (477) hide show
  1. package/CHANGELOG.md +171 -0
  2. package/DEVELOPMENT.md +3 -3
  3. package/README.md +3 -2
  4. package/SETUP.md +6 -5
  5. package/agent-plugin/README.md +15 -6
  6. package/agent-plugin/skills/charness-delegate-claude/SKILL.md +23 -13
  7. package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +10 -6
  8. package/agent-plugin/skills/charness-delivery-loop/SKILL.md +92 -0
  9. package/agent-plugin/skills/charness-orchestration/SKILL.md +116 -0
  10. package/dist/adapters/openCodeAdapter.d.ts +15 -0
  11. package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
  12. package/dist/adapters/openCodeAdapter.js +48 -4
  13. package/dist/adapters/openCodeAdapter.js.map +1 -1
  14. package/dist/agentLogin/agentLogin.d.ts +11 -0
  15. package/dist/agentLogin/agentLogin.d.ts.map +1 -1
  16. package/dist/agentLogin/agentLogin.js +18 -6
  17. package/dist/agentLogin/agentLogin.js.map +1 -1
  18. package/dist/apiErrorRetry.d.ts +5 -0
  19. package/dist/apiErrorRetry.d.ts.map +1 -1
  20. package/dist/apiErrorRetry.js +3 -3
  21. package/dist/apiErrorRetry.js.map +1 -1
  22. package/dist/bot.d.ts.map +1 -1
  23. package/dist/bot.js +331 -152
  24. package/dist/bot.js.map +1 -1
  25. package/dist/cli/claudeProfiles.d.ts +5 -2
  26. package/dist/cli/claudeProfiles.d.ts.map +1 -1
  27. package/dist/cli/claudeProfiles.js +43 -20
  28. package/dist/cli/claudeProfiles.js.map +1 -1
  29. package/dist/cli/claudeProfilesCredit.d.ts +49 -0
  30. package/dist/cli/claudeProfilesCredit.d.ts.map +1 -0
  31. package/dist/cli/claudeProfilesCredit.js +160 -0
  32. package/dist/cli/claudeProfilesCredit.js.map +1 -0
  33. package/dist/cli/flagValue.d.ts +10 -0
  34. package/dist/cli/flagValue.d.ts.map +1 -0
  35. package/dist/cli/flagValue.js +17 -0
  36. package/dist/cli/flagValue.js.map +1 -0
  37. package/dist/connectors/telegram/commands/botCore.d.ts +1 -0
  38. package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
  39. package/dist/connectors/telegram/commands/botSkills.js +1 -1
  40. package/dist/connectors/telegram/commands/claudeAccounts.d.ts +6 -1
  41. package/dist/connectors/telegram/commands/claudeAccounts.d.ts.map +1 -1
  42. package/dist/connectors/telegram/commands/claudeAccounts.js +12 -9
  43. package/dist/connectors/telegram/commands/claudeAccounts.js.map +1 -1
  44. package/dist/connectors/telegram/commands/compaction.d.ts +11 -0
  45. package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -1
  46. package/dist/connectors/telegram/commands/compaction.js +208 -22
  47. package/dist/connectors/telegram/commands/compaction.js.map +1 -1
  48. package/dist/connectors/telegram/commands/runners.d.ts +5 -1
  49. package/dist/connectors/telegram/commands/runners.d.ts.map +1 -1
  50. package/dist/connectors/telegram/commands/runners.js +151 -30
  51. package/dist/connectors/telegram/commands/runners.js.map +1 -1
  52. package/dist/connectors/telegram/foldedMessage.d.ts +24 -0
  53. package/dist/connectors/telegram/foldedMessage.d.ts.map +1 -0
  54. package/dist/connectors/telegram/foldedMessage.js +39 -0
  55. package/dist/connectors/telegram/foldedMessage.js.map +1 -0
  56. package/dist/connectors/telegram/inbound.d.ts +24 -1
  57. package/dist/connectors/telegram/inbound.d.ts.map +1 -1
  58. package/dist/connectors/telegram/inbound.js +77 -1
  59. package/dist/connectors/telegram/inbound.js.map +1 -1
  60. package/dist/connectors/telegram/renderAgentHtml.d.ts +15 -0
  61. package/dist/connectors/telegram/renderAgentHtml.d.ts.map +1 -1
  62. package/dist/connectors/telegram/renderAgentHtml.js +11 -1
  63. package/dist/connectors/telegram/renderAgentHtml.js.map +1 -1
  64. package/dist/connectors/telegram/runnerPairingMessages.d.ts +2 -7
  65. package/dist/connectors/telegram/runnerPairingMessages.d.ts.map +1 -1
  66. package/dist/connectors/telegram/runnerPairingMessages.js +5 -19
  67. package/dist/connectors/telegram/runnerPairingMessages.js.map +1 -1
  68. package/dist/connectors/telegram/unpinMessages.d.ts +12 -0
  69. package/dist/connectors/telegram/unpinMessages.d.ts.map +1 -0
  70. package/dist/connectors/telegram/unpinMessages.js +44 -0
  71. package/dist/connectors/telegram/unpinMessages.js.map +1 -0
  72. package/dist/i18n/de.d.ts.map +1 -1
  73. package/dist/i18n/de.js +63 -11
  74. package/dist/i18n/de.js.map +1 -1
  75. package/dist/i18n/en.d.ts.map +1 -1
  76. package/dist/i18n/en.js +63 -11
  77. package/dist/i18n/en.js.map +1 -1
  78. package/dist/i18n/es.d.ts.map +1 -1
  79. package/dist/i18n/es.js +63 -11
  80. package/dist/i18n/es.js.map +1 -1
  81. package/dist/i18n/fr.d.ts.map +1 -1
  82. package/dist/i18n/fr.js +63 -11
  83. package/dist/i18n/fr.js.map +1 -1
  84. package/dist/i18n/hi.d.ts.map +1 -1
  85. package/dist/i18n/hi.js +63 -11
  86. package/dist/i18n/hi.js.map +1 -1
  87. package/dist/i18n/ja.d.ts.map +1 -1
  88. package/dist/i18n/ja.js +63 -11
  89. package/dist/i18n/ja.js.map +1 -1
  90. package/dist/i18n/ka.d.ts.map +1 -1
  91. package/dist/i18n/ka.js +63 -11
  92. package/dist/i18n/ka.js.map +1 -1
  93. package/dist/i18n/pt.d.ts.map +1 -1
  94. package/dist/i18n/pt.js +63 -11
  95. package/dist/i18n/pt.js.map +1 -1
  96. package/dist/i18n/ru.d.ts.map +1 -1
  97. package/dist/i18n/ru.js +63 -11
  98. package/dist/i18n/ru.js.map +1 -1
  99. package/dist/i18n/uk.d.ts.map +1 -1
  100. package/dist/i18n/uk.js +63 -11
  101. package/dist/i18n/uk.js.map +1 -1
  102. package/dist/i18n/uz.d.ts.map +1 -1
  103. package/dist/i18n/uz.js +63 -11
  104. package/dist/i18n/uz.js.map +1 -1
  105. package/dist/i18n/zh.d.ts.map +1 -1
  106. package/dist/i18n/zh.js +63 -11
  107. package/dist/i18n/zh.js.map +1 -1
  108. package/dist/installManager.d.ts.map +1 -1
  109. package/dist/installManager.js +3 -0
  110. package/dist/installManager.js.map +1 -1
  111. package/dist/instanceLock.d.ts.map +1 -1
  112. package/dist/instanceLock.js +2 -1
  113. package/dist/instanceLock.js.map +1 -1
  114. package/dist/outputTrace.d.ts +6 -0
  115. package/dist/outputTrace.d.ts.map +1 -1
  116. package/dist/outputTrace.js +13 -0
  117. package/dist/outputTrace.js.map +1 -1
  118. package/dist/platform/outbound.d.ts +14 -1
  119. package/dist/platform/outbound.d.ts.map +1 -1
  120. package/dist/platform/outbound.js.map +1 -1
  121. package/dist/remoteRun/cleanReport.d.ts +45 -0
  122. package/dist/remoteRun/cleanReport.d.ts.map +1 -0
  123. package/dist/remoteRun/cleanReport.js +84 -0
  124. package/dist/remoteRun/cleanReport.js.map +1 -0
  125. package/dist/remoteRun/cliArgs.d.ts +18 -0
  126. package/dist/remoteRun/cliArgs.d.ts.map +1 -1
  127. package/dist/remoteRun/cliArgs.js +100 -4
  128. package/dist/remoteRun/cliArgs.js.map +1 -1
  129. package/dist/remoteRun/commands.d.ts +30 -1
  130. package/dist/remoteRun/commands.d.ts.map +1 -1
  131. package/dist/remoteRun/commands.js +84 -9
  132. package/dist/remoteRun/commands.js.map +1 -1
  133. package/dist/remoteRun/exitCodes.d.ts +5 -0
  134. package/dist/remoteRun/exitCodes.d.ts.map +1 -1
  135. package/dist/remoteRun/exitCodes.js +6 -1
  136. package/dist/remoteRun/exitCodes.js.map +1 -1
  137. package/dist/remoteRun/foreground.d.ts +6 -0
  138. package/dist/remoteRun/foreground.d.ts.map +1 -1
  139. package/dist/remoteRun/foreground.js +13 -1
  140. package/dist/remoteRun/foreground.js.map +1 -1
  141. package/dist/remoteRun/interrupts.d.ts.map +1 -1
  142. package/dist/remoteRun/interrupts.js +2 -2
  143. package/dist/remoteRun/interrupts.js.map +1 -1
  144. package/dist/remoteRun/jobFiles.d.ts +6 -1
  145. package/dist/remoteRun/jobFiles.d.ts.map +1 -1
  146. package/dist/remoteRun/jobFiles.js +14 -0
  147. package/dist/remoteRun/jobFiles.js.map +1 -1
  148. package/dist/remoteRun/jobId.d.ts +5 -0
  149. package/dist/remoteRun/jobId.d.ts.map +1 -1
  150. package/dist/remoteRun/jobId.js +10 -0
  151. package/dist/remoteRun/jobId.js.map +1 -1
  152. package/dist/remoteRun/jobState.d.ts.map +1 -1
  153. package/dist/remoteRun/jobState.js +3 -2
  154. package/dist/remoteRun/jobState.js.map +1 -1
  155. package/dist/remoteRun/pairedRunners.d.ts +1 -1
  156. package/dist/remoteRun/pairedRunners.d.ts.map +1 -1
  157. package/dist/remoteRun/pairedRunners.js +4 -0
  158. package/dist/remoteRun/pairedRunners.js.map +1 -1
  159. package/dist/remoteRun/pathPatterns.d.ts +1 -1
  160. package/dist/remoteRun/pathPatterns.js +1 -1
  161. package/dist/remoteRun/probe.d.ts +58 -5
  162. package/dist/remoteRun/probe.d.ts.map +1 -1
  163. package/dist/remoteRun/probe.js +107 -11
  164. package/dist/remoteRun/probe.js.map +1 -1
  165. package/dist/remoteRun/probeTiming.d.ts +15 -0
  166. package/dist/remoteRun/probeTiming.d.ts.map +1 -0
  167. package/dist/remoteRun/probeTiming.js +23 -0
  168. package/dist/remoteRun/probeTiming.js.map +1 -0
  169. package/dist/remoteRun/project.d.ts +5 -0
  170. package/dist/remoteRun/project.d.ts.map +1 -1
  171. package/dist/remoteRun/project.js +10 -0
  172. package/dist/remoteRun/project.js.map +1 -1
  173. package/dist/remoteRun/projectConfig.d.ts +8 -1
  174. package/dist/remoteRun/projectConfig.d.ts.map +1 -1
  175. package/dist/remoteRun/projectConfig.js +18 -5
  176. package/dist/remoteRun/projectConfig.js.map +1 -1
  177. package/dist/remoteRun/pruneReport.d.ts +48 -0
  178. package/dist/remoteRun/pruneReport.d.ts.map +1 -0
  179. package/dist/remoteRun/pruneReport.js +80 -0
  180. package/dist/remoteRun/pruneReport.js.map +1 -0
  181. package/dist/remoteRun/remoteRunCli.d.ts +1 -1
  182. package/dist/remoteRun/remoteRunCli.d.ts.map +1 -1
  183. package/dist/remoteRun/remoteRunCli.js +20 -0
  184. package/dist/remoteRun/remoteRunCli.js.map +1 -1
  185. package/dist/remoteRun/runnerClient.d.ts +10 -0
  186. package/dist/remoteRun/runnerClient.d.ts.map +1 -1
  187. package/dist/remoteRun/runnerClient.js +19 -5
  188. package/dist/remoteRun/runnerClient.js.map +1 -1
  189. package/dist/remoteRun/runnerWait.d.ts.map +1 -1
  190. package/dist/remoteRun/runnerWait.js +2 -1
  191. package/dist/remoteRun/runnerWait.js.map +1 -1
  192. package/dist/remoteRun/runners.d.ts +48 -7
  193. package/dist/remoteRun/runners.d.ts.map +1 -1
  194. package/dist/remoteRun/runners.js +105 -40
  195. package/dist/remoteRun/runners.js.map +1 -1
  196. package/dist/remoteRun/runnersConfig.d.ts +24 -0
  197. package/dist/remoteRun/runnersConfig.d.ts.map +1 -1
  198. package/dist/remoteRun/runnersConfig.js +29 -2
  199. package/dist/remoteRun/runnersConfig.js.map +1 -1
  200. package/dist/remoteRun/ssh.d.ts +3 -3
  201. package/dist/remoteRun/ssh.d.ts.map +1 -1
  202. package/dist/remoteRun/ssh.js +19 -5
  203. package/dist/remoteRun/ssh.js.map +1 -1
  204. package/dist/remoteRun/submit.d.ts +1 -1
  205. package/dist/remoteRun/submit.d.ts.map +1 -1
  206. package/dist/remoteRun/submit.js +30 -2
  207. package/dist/remoteRun/submit.js.map +1 -1
  208. package/dist/runnerUtility/adminService.d.ts.map +1 -1
  209. package/dist/runnerUtility/adminService.js +5 -5
  210. package/dist/runnerUtility/adminService.js.map +1 -1
  211. package/dist/runnerUtility/appInstall.d.ts +9 -0
  212. package/dist/runnerUtility/appInstall.d.ts.map +1 -1
  213. package/dist/runnerUtility/appInstall.js +12 -2
  214. package/dist/runnerUtility/appInstall.js.map +1 -1
  215. package/dist/runnerUtility/execEnv.d.ts +1 -1
  216. package/dist/runnerUtility/execEnv.d.ts.map +1 -1
  217. package/dist/runnerUtility/execEnv.js +23 -5
  218. package/dist/runnerUtility/execEnv.js.map +1 -1
  219. package/dist/runnerUtility/guiAgentHeal.d.ts +3 -3
  220. package/dist/runnerUtility/guiAgentHeal.d.ts.map +1 -1
  221. package/dist/runnerUtility/guiAgentHeal.js +6 -4
  222. package/dist/runnerUtility/guiAgentHeal.js.map +1 -1
  223. package/dist/runnerUtility/homeFolders.d.ts +1 -0
  224. package/dist/runnerUtility/homeFolders.d.ts.map +1 -1
  225. package/dist/runnerUtility/homeFolders.js +2 -1
  226. package/dist/runnerUtility/homeFolders.js.map +1 -1
  227. package/dist/runnerUtility/iosCheck.d.ts +2 -0
  228. package/dist/runnerUtility/iosCheck.d.ts.map +1 -1
  229. package/dist/runnerUtility/iosCheck.js +12 -3
  230. package/dist/runnerUtility/iosCheck.js.map +1 -1
  231. package/dist/runnerUtility/isolatedCommand.d.ts +0 -2
  232. package/dist/runnerUtility/isolatedCommand.d.ts.map +1 -1
  233. package/dist/runnerUtility/isolatedCommand.js +4 -11
  234. package/dist/runnerUtility/isolatedCommand.js.map +1 -1
  235. package/dist/runnerUtility/keepAwake.d.ts +47 -10
  236. package/dist/runnerUtility/keepAwake.d.ts.map +1 -1
  237. package/dist/runnerUtility/keepAwake.js +108 -31
  238. package/dist/runnerUtility/keepAwake.js.map +1 -1
  239. package/dist/runnerUtility/launcher.d.ts +4 -0
  240. package/dist/runnerUtility/launcher.d.ts.map +1 -1
  241. package/dist/runnerUtility/launcher.js +31 -13
  242. package/dist/runnerUtility/launcher.js.map +1 -1
  243. package/dist/runnerUtility/linkLoop.d.ts +4 -0
  244. package/dist/runnerUtility/linkLoop.d.ts.map +1 -1
  245. package/dist/runnerUtility/linkLoop.js +15 -6
  246. package/dist/runnerUtility/linkLoop.js.map +1 -1
  247. package/dist/runnerUtility/managedNode.d.ts +84 -0
  248. package/dist/runnerUtility/managedNode.d.ts.map +1 -0
  249. package/dist/runnerUtility/managedNode.js +165 -0
  250. package/dist/runnerUtility/managedNode.js.map +1 -0
  251. package/dist/runnerUtility/nodeOnPath.d.ts +10 -0
  252. package/dist/runnerUtility/nodeOnPath.d.ts.map +1 -0
  253. package/dist/runnerUtility/nodeOnPath.js +49 -0
  254. package/dist/runnerUtility/nodeOnPath.js.map +1 -0
  255. package/dist/runnerUtility/nodeUpkeep.d.ts +140 -0
  256. package/dist/runnerUtility/nodeUpkeep.d.ts.map +1 -0
  257. package/dist/runnerUtility/nodeUpkeep.js +348 -0
  258. package/dist/runnerUtility/nodeUpkeep.js.map +1 -0
  259. package/dist/runnerUtility/nodeUpkeepTiming.d.ts +14 -0
  260. package/dist/runnerUtility/nodeUpkeepTiming.d.ts.map +1 -0
  261. package/dist/runnerUtility/nodeUpkeepTiming.js +21 -0
  262. package/dist/runnerUtility/nodeUpkeepTiming.js.map +1 -0
  263. package/dist/runnerUtility/packageManagerShims.d.ts +10 -0
  264. package/dist/runnerUtility/packageManagerShims.d.ts.map +1 -1
  265. package/dist/runnerUtility/packageManagerShims.js +67 -3
  266. package/dist/runnerUtility/packageManagerShims.js.map +1 -1
  267. package/dist/runnerUtility/pueueDaemon.d.ts +73 -8
  268. package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -1
  269. package/dist/runnerUtility/pueueDaemon.js +90 -15
  270. package/dist/runnerUtility/pueueDaemon.js.map +1 -1
  271. package/dist/runnerUtility/runnerCommands.d.ts +7 -1
  272. package/dist/runnerUtility/runnerCommands.d.ts.map +1 -1
  273. package/dist/runnerUtility/runnerCommands.js +119 -16
  274. package/dist/runnerUtility/runnerCommands.js.map +1 -1
  275. package/dist/runnerUtility/runnerHome.d.ts +34 -0
  276. package/dist/runnerUtility/runnerHome.d.ts.map +1 -1
  277. package/dist/runnerUtility/runnerHome.js +17 -3
  278. package/dist/runnerUtility/runnerHome.js.map +1 -1
  279. package/dist/runnerUtility/serviceCommon.d.ts +2 -0
  280. package/dist/runnerUtility/serviceCommon.d.ts.map +1 -1
  281. package/dist/runnerUtility/serviceCommon.js +3 -1
  282. package/dist/runnerUtility/serviceCommon.js.map +1 -1
  283. package/dist/runnerUtility/serviceManager.d.ts.map +1 -1
  284. package/dist/runnerUtility/serviceManager.js +7 -2
  285. package/dist/runnerUtility/serviceManager.js.map +1 -1
  286. package/dist/runnerUtility/simctlGuard.d.ts +38 -0
  287. package/dist/runnerUtility/simctlGuard.d.ts.map +1 -0
  288. package/dist/runnerUtility/simctlGuard.js +166 -0
  289. package/dist/runnerUtility/simctlGuard.js.map +1 -0
  290. package/dist/runners/bootstrapLine.d.ts +3 -4
  291. package/dist/runners/bootstrapLine.d.ts.map +1 -1
  292. package/dist/runners/bootstrapLine.js +108 -83
  293. package/dist/runners/bootstrapLine.js.map +1 -1
  294. package/dist/runners/hubPackage.d.ts +1 -1
  295. package/dist/runners/hubPackage.d.ts.map +1 -1
  296. package/dist/runners/hubPackage.js +5 -6
  297. package/dist/runners/hubPackage.js.map +1 -1
  298. package/dist/runners/hubPairing.d.ts +19 -0
  299. package/dist/runners/hubPairing.d.ts.map +1 -1
  300. package/dist/runners/hubPairing.js +38 -0
  301. package/dist/runners/hubPairing.js.map +1 -1
  302. package/dist/runners/hubRegistry.d.ts +8 -0
  303. package/dist/runners/hubRegistry.d.ts.map +1 -1
  304. package/dist/runners/hubRegistry.js +6 -0
  305. package/dist/runners/hubRegistry.js.map +1 -1
  306. package/dist/runners/pairCode.d.ts +34 -3
  307. package/dist/runners/pairCode.d.ts.map +1 -1
  308. package/dist/runners/pairCode.js +65 -13
  309. package/dist/runners/pairCode.js.map +1 -1
  310. package/dist/runners/runnerGroups.d.ts +22 -0
  311. package/dist/runners/runnerGroups.d.ts.map +1 -0
  312. package/dist/runners/runnerGroups.js +41 -0
  313. package/dist/runners/runnerGroups.js.map +1 -0
  314. package/dist/runners/runnersCli.d.ts +5 -2
  315. package/dist/runners/runnersCli.d.ts.map +1 -1
  316. package/dist/runners/runnersCli.js +59 -9
  317. package/dist/runners/runnersCli.js.map +1 -1
  318. package/dist/runners/runnersList.d.ts +1 -1
  319. package/dist/runners/runnersList.d.ts.map +1 -1
  320. package/dist/runners/runnersList.js +3 -1
  321. package/dist/runners/runnersList.js.map +1 -1
  322. package/dist/runners/runnersOverview.d.ts.map +1 -1
  323. package/dist/runners/runnersOverview.js +8 -4
  324. package/dist/runners/runnersOverview.js.map +1 -1
  325. package/dist/scheduler/checkRun.d.ts +9 -10
  326. package/dist/scheduler/checkRun.d.ts.map +1 -1
  327. package/dist/scheduler/checkRun.js +8 -16
  328. package/dist/scheduler/checkRun.js.map +1 -1
  329. package/dist/scheduler/checkStatus.d.ts +4 -5
  330. package/dist/scheduler/checkStatus.d.ts.map +1 -1
  331. package/dist/scheduler/checkStatus.js +11 -15
  332. package/dist/scheduler/checkStatus.js.map +1 -1
  333. package/dist/scheduler/delivery.d.ts +80 -37
  334. package/dist/scheduler/delivery.d.ts.map +1 -1
  335. package/dist/scheduler/delivery.js +121 -68
  336. package/dist/scheduler/delivery.js.map +1 -1
  337. package/dist/scheduler/mcpSurface.d.ts +13 -5
  338. package/dist/scheduler/mcpSurface.d.ts.map +1 -1
  339. package/dist/scheduler/mcpSurface.js +84 -34
  340. package/dist/scheduler/mcpSurface.js.map +1 -1
  341. package/dist/scheduler/recurrence.d.ts +32 -0
  342. package/dist/scheduler/recurrence.d.ts.map +1 -1
  343. package/dist/scheduler/recurrence.js +56 -18
  344. package/dist/scheduler/recurrence.js.map +1 -1
  345. package/dist/scheduler/scheduleText.d.ts +7 -0
  346. package/dist/scheduler/scheduleText.d.ts.map +1 -0
  347. package/dist/scheduler/scheduleText.js +55 -0
  348. package/dist/scheduler/scheduleText.js.map +1 -0
  349. package/dist/scheduler/store.d.ts +8 -2
  350. package/dist/scheduler/store.d.ts.map +1 -1
  351. package/dist/scheduler/store.js +25 -4
  352. package/dist/scheduler/store.js.map +1 -1
  353. package/dist/scheduler/types.d.ts +4 -10
  354. package/dist/scheduler/types.d.ts.map +1 -1
  355. package/dist/scheduler/workerWatch.d.ts +49 -11
  356. package/dist/scheduler/workerWatch.d.ts.map +1 -1
  357. package/dist/scheduler/workerWatch.js +57 -13
  358. package/dist/scheduler/workerWatch.js.map +1 -1
  359. package/dist/state.d.ts +95 -2
  360. package/dist/state.d.ts.map +1 -1
  361. package/dist/state.js +145 -7
  362. package/dist/state.js.map +1 -1
  363. package/dist/testTimings.d.ts +6 -2
  364. package/dist/testTimings.d.ts.map +1 -1
  365. package/dist/testTimings.js +12 -1
  366. package/dist/testTimings.js.map +1 -1
  367. package/dist/types.d.ts +2 -1
  368. package/dist/types.d.ts.map +1 -1
  369. package/dist/utils/agentPlugin.d.ts +2 -1
  370. package/dist/utils/agentPlugin.d.ts.map +1 -1
  371. package/dist/utils/agentPlugin.js +2 -1
  372. package/dist/utils/agentPlugin.js.map +1 -1
  373. package/dist/utils/botSkills.d.ts +1 -1
  374. package/dist/utils/claudeApiAgentStop.d.ts +64 -0
  375. package/dist/utils/claudeApiAgentStop.d.ts.map +1 -0
  376. package/dist/utils/claudeApiAgentStop.js +85 -0
  377. package/dist/utils/claudeApiAgentStop.js.map +1 -0
  378. package/dist/utils/claudeApiCredit.d.ts +168 -0
  379. package/dist/utils/claudeApiCredit.d.ts.map +1 -0
  380. package/dist/utils/claudeApiCredit.js +260 -0
  381. package/dist/utils/claudeApiCredit.js.map +1 -0
  382. package/dist/utils/claudeApiCreditRecheck.d.ts +120 -0
  383. package/dist/utils/claudeApiCreditRecheck.d.ts.map +1 -0
  384. package/dist/utils/claudeApiCreditRecheck.js +173 -0
  385. package/dist/utils/claudeApiCreditRecheck.js.map +1 -0
  386. package/dist/utils/claudeCompactHook.d.ts +18 -10
  387. package/dist/utils/claudeCompactHook.d.ts.map +1 -1
  388. package/dist/utils/claudeCompactHook.js +35 -14
  389. package/dist/utils/claudeCompactHook.js.map +1 -1
  390. package/dist/utils/claudeProfileUsageLines.d.ts +13 -1
  391. package/dist/utils/claudeProfileUsageLines.d.ts.map +1 -1
  392. package/dist/utils/claudeProfileUsageLines.js +75 -4
  393. package/dist/utils/claudeProfileUsageLines.js.map +1 -1
  394. package/dist/utils/claudeProfileUsageViews.d.ts +46 -0
  395. package/dist/utils/claudeProfileUsageViews.d.ts.map +1 -0
  396. package/dist/utils/claudeProfileUsageViews.js +114 -0
  397. package/dist/utils/claudeProfileUsageViews.js.map +1 -0
  398. package/dist/utils/claudeProfiles.d.ts +15 -0
  399. package/dist/utils/claudeProfiles.d.ts.map +1 -1
  400. package/dist/utils/claudeProfiles.js +54 -0
  401. package/dist/utils/claudeProfiles.js.map +1 -1
  402. package/dist/utils/claudeUsage.d.ts +97 -36
  403. package/dist/utils/claudeUsage.d.ts.map +1 -1
  404. package/dist/utils/claudeUsage.js +142 -61
  405. package/dist/utils/claudeUsage.js.map +1 -1
  406. package/dist/utils/claudeUsageRefresher.d.ts +27 -3
  407. package/dist/utils/claudeUsageRefresher.d.ts.map +1 -1
  408. package/dist/utils/claudeUsageRefresher.js +113 -14
  409. package/dist/utils/claudeUsageRefresher.js.map +1 -1
  410. package/dist/utils/compactOnIdle.d.ts +140 -15
  411. package/dist/utils/compactOnIdle.d.ts.map +1 -1
  412. package/dist/utils/compactOnIdle.js +209 -23
  413. package/dist/utils/compactOnIdle.js.map +1 -1
  414. package/dist/utils/compactSelfReviewFlags.d.ts +50 -0
  415. package/dist/utils/compactSelfReviewFlags.d.ts.map +1 -0
  416. package/dist/utils/compactSelfReviewFlags.js +120 -0
  417. package/dist/utils/compactSelfReviewFlags.js.map +1 -0
  418. package/dist/utils/fallbackChain.d.ts +18 -7
  419. package/dist/utils/fallbackChain.d.ts.map +1 -1
  420. package/dist/utils/fallbackChain.js +28 -12
  421. package/dist/utils/fallbackChain.js.map +1 -1
  422. package/dist/utils/forwardedMark.d.ts +54 -0
  423. package/dist/utils/forwardedMark.d.ts.map +1 -0
  424. package/dist/utils/forwardedMark.js +80 -0
  425. package/dist/utils/forwardedMark.js.map +1 -0
  426. package/dist/utils/limitHeldPrompts.d.ts +8 -2
  427. package/dist/utils/limitHeldPrompts.d.ts.map +1 -1
  428. package/dist/utils/limitHeldPrompts.js +11 -4
  429. package/dist/utils/limitHeldPrompts.js.map +1 -1
  430. package/dist/utils/messageContext.d.ts +54 -0
  431. package/dist/utils/messageContext.d.ts.map +1 -0
  432. package/dist/utils/messageContext.js +58 -0
  433. package/dist/utils/messageContext.js.map +1 -0
  434. package/dist/utils/openCodeCompactPlugin.d.ts +28 -7
  435. package/dist/utils/openCodeCompactPlugin.d.ts.map +1 -1
  436. package/dist/utils/openCodeCompactPlugin.js +80 -15
  437. package/dist/utils/openCodeCompactPlugin.js.map +1 -1
  438. package/dist/utils/openCodeUsage.d.ts +10 -3
  439. package/dist/utils/openCodeUsage.d.ts.map +1 -1
  440. package/dist/utils/openCodeUsage.js +19 -5
  441. package/dist/utils/openCodeUsage.js.map +1 -1
  442. package/dist/utils/replyQuote.d.ts +11 -26
  443. package/dist/utils/replyQuote.d.ts.map +1 -1
  444. package/dist/utils/replyQuote.js +9 -31
  445. package/dist/utils/replyQuote.js.map +1 -1
  446. package/dist/utils/runnersScreenPlan.d.ts +51 -20
  447. package/dist/utils/runnersScreenPlan.d.ts.map +1 -1
  448. package/dist/utils/runnersScreenPlan.js +143 -28
  449. package/dist/utils/runnersScreenPlan.js.map +1 -1
  450. package/dist/utils/streamedCompactionSummary.d.ts +65 -0
  451. package/dist/utils/streamedCompactionSummary.d.ts.map +1 -0
  452. package/dist/utils/streamedCompactionSummary.js +108 -0
  453. package/dist/utils/streamedCompactionSummary.js.map +1 -0
  454. package/dist/utils/stripControlCharacters.d.ts +8 -0
  455. package/dist/utils/stripControlCharacters.d.ts.map +1 -0
  456. package/dist/utils/stripControlCharacters.js +16 -0
  457. package/dist/utils/stripControlCharacters.js.map +1 -0
  458. package/dist/utils/telegramError.d.ts +6 -0
  459. package/dist/utils/telegramError.d.ts.map +1 -1
  460. package/dist/utils/telegramError.js +30 -0
  461. package/dist/utils/telegramError.js.map +1 -1
  462. package/dist/utils/topicRequest.d.ts +13 -0
  463. package/dist/utils/topicRequest.d.ts.map +1 -1
  464. package/dist/utils/topicRequest.js +10 -0
  465. package/dist/utils/topicRequest.js.map +1 -1
  466. package/dist/utils/usageRefreshBudget.d.ts.map +1 -1
  467. package/dist/utils/usageRefreshBudget.js +4 -10
  468. package/dist/utils/usageRefreshBudget.js.map +1 -1
  469. package/dist/utils/waitUpTo.d.ts +8 -0
  470. package/dist/utils/waitUpTo.d.ts.map +1 -0
  471. package/dist/utils/waitUpTo.js +20 -0
  472. package/dist/utils/waitUpTo.js.map +1 -0
  473. package/package.json +2 -2
  474. package/remoteRun/ensureNode.sh +288 -0
  475. package/remoteRun/runner.sh +2252 -115
  476. package/agent-plugin/skills/charness-manager/SKILL.md +0 -156
  477. package/remoteRun/pickNode.sh +0 -65
@@ -9,7 +9,7 @@
9
9
  * default prompt: the loaded skills were not named and no next-steps checklist
10
10
  * closed the summary, so the continuing session silently stopped following those
11
11
  * skills. The hook adds the resume guidance (`compactionResumeGuidance`: the skills
12
- * to load again, then that checklist). Claude Code runs `PreCompact` hooks before
12
+ * to load again, the self-review section the bot posts to the topic, then that checklist). Claude Code runs `PreCompact` hooks before
13
13
  * EVERY compaction (`trigger` `auto` and `manual`) and appends a hook's stdout to
14
14
  * that compaction's custom instructions — measured on v2.1.289: an
15
15
  * overflow-triggered compaction's summary opened with the line the hook printed.
@@ -18,8 +18,13 @@
18
18
  *
19
19
  * A bot-issued compaction already carries the same text, so the hook prints
20
20
  * nothing when the compaction's `custom_instructions` (part of the JSON the hook
21
- * reads on stdin) already contain the resume guidance (the loaded skills and the
22
- * next-steps checklist) — otherwise the model would get the instruction twice.
21
+ * reads on stdin) already contain the resume guidance both variants share (the
22
+ * loaded skills and the next-steps checklist) — otherwise the model would get the
23
+ * instruction twice.
24
+ *
25
+ * The self-review section is the part `/compact_self_review` switches: the hook runs inside the agent's process, long after
26
+ * the bot started it, so it looks for the flag the bot keeps for the session (`utils/compactSelfReviewFlags.ts`, named by the
27
+ * `session_id` of its stdin) and prints the instruction without the section request while the flag exists.
23
28
  *
24
29
  * The same launch settings carry the shared todo lists' `PostToolUse` hook
25
30
  * (`todos/midTurn.ts`): it prints the session's inbox — the project board's
@@ -33,21 +38,24 @@
33
38
  export declare const claudeCompactHookSettingsFileName = "claude-compact-hook.json";
34
39
  /**
35
40
  * @description The instruction the hook adds to a compaction the bot did not
36
- * issue: D3 + the resume guidance. No closing section — that one exists for the
41
+ * issue: D3 + the resume guidance, with the self-review section while `/compact_self_review` is on for the session's topic
42
+ * and without it while off. No closing section — that one exists for the
37
43
  * bot's own idle-compaction report, which an overflow compaction never feeds; the
38
44
  * checklist then ends the summary itself.
39
45
  */
40
- export declare function getHookCompactionInstruction(): string;
46
+ export declare function getHookCompactionInstruction(isWithInstructionGaps: boolean): string;
41
47
  /**
42
- * @description Build the hook's shell command: print `instruction` unless the
43
- * hook's stdin (the `PreCompact` input JSON) already contains `alreadySentMarker`.
44
- * The marker is matched as a fixed string against the raw JSON, so it must be text
45
- * JSON leaves unescaped — the caller passes the resume guidance, and a test pins
46
- * that it qualifies.
48
+ * @description Build the hook's shell command: print nothing when the hook's stdin (the `PreCompact` input JSON) already
49
+ * contains `alreadySentMarker`; otherwise print `instructionWithoutGaps` when a flag named after the input's `session_id`
50
+ * exists in `offFlagDir` (the topic's `/compact_self_review` is off, `utils/compactSelfReviewFlags.ts`) and `instruction` when it
51
+ * does not. The marker is matched as a fixed string against the raw JSON, so it must be text JSON leaves unescaped — the
52
+ * caller passes the resume guidance both variants share, and a test pins that it qualifies.
47
53
  */
48
54
  export declare function buildPreCompactHookCommand(input: {
49
55
  instruction: string;
56
+ instructionWithoutGaps: string;
50
57
  alreadySentMarker: string;
58
+ offFlagDir: string;
51
59
  }): string;
52
60
  /** One command hook with no matcher (every compaction, every tool). */
53
61
  type CommandHookGroups = Array<{
@@ -1 +1 @@
1
- {"version":3,"file":"claudeCompactHook.d.ts","sourceRoot":"","sources":["../../src/utils/claudeCompactHook.ts"],"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sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAQT;AAED,uEAAuE;AACvE,KAAK,iBAAiB,GAAG,KAAK,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAEvF;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG;IACpG,KAAK,EAAE;QAAE,UAAU,EAAE,iBAAiB,CAAC;QAAC,WAAW,EAAE,iBAAiB,CAAA;KAAE,CAAC;CAC1E,CAOA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,MAAM,GAAG,IAAW,GAAG,MAAM,EAAE,CAiBxG"}
@@ -10,7 +10,7 @@
10
10
  * default prompt: the loaded skills were not named and no next-steps checklist
11
11
  * closed the summary, so the continuing session silently stopped following those
12
12
  * skills. The hook adds the resume guidance (`compactionResumeGuidance`: the skills
13
- * to load again, then that checklist). Claude Code runs `PreCompact` hooks before
13
+ * to load again, the self-review section the bot posts to the topic, then that checklist). Claude Code runs `PreCompact` hooks before
14
14
  * EVERY compaction (`trigger` `auto` and `manual`) and appends a hook's stdout to
15
15
  * that compaction's custom instructions — measured on v2.1.289: an
16
16
  * overflow-triggered compaction's summary opened with the line the hook printed.
@@ -19,8 +19,13 @@
19
19
  *
20
20
  * A bot-issued compaction already carries the same text, so the hook prints
21
21
  * nothing when the compaction's `custom_instructions` (part of the JSON the hook
22
- * reads on stdin) already contain the resume guidance (the loaded skills and the
23
- * next-steps checklist) — otherwise the model would get the instruction twice.
22
+ * reads on stdin) already contain the resume guidance both variants share (the
23
+ * loaded skills and the next-steps checklist) — otherwise the model would get the
24
+ * instruction twice.
25
+ *
26
+ * The self-review section is the part `/compact_self_review` switches: the hook runs inside the agent's process, long after
27
+ * the bot started it, so it looks for the flag the bot keeps for the session (`utils/compactSelfReviewFlags.ts`, named by the
28
+ * `session_id` of its stdin) and prints the instruction without the section request while the flag exists.
24
29
  *
25
30
  * The same launch settings carry the shared todo lists' `PostToolUse` hook
26
31
  * (`todos/midTurn.ts`): it prints the session's inbox — the project board's
@@ -38,6 +43,7 @@ exports.prepareClaudeCompactHookFlags = prepareClaudeCompactHookFlags;
38
43
  const fs_1 = __importDefault(require("fs"));
39
44
  const path_1 = __importDefault(require("path"));
40
45
  const compactOnIdle_1 = require("./compactOnIdle");
46
+ const compactSelfReviewFlags_1 = require("./compactSelfReviewFlags");
41
47
  const tmuxExec_1 = require("./tmuxExec");
42
48
  const claudeProfiles_1 = require("./claudeProfiles");
43
49
  const claudeApiKeyHelper_1 = require("./claudeApiKeyHelper");
@@ -50,27 +56,40 @@ const midTurn_1 = require("../todos/midTurn");
50
56
  exports.claudeCompactHookSettingsFileName = 'claude-compact-hook.json';
51
57
  /**
52
58
  * @description The instruction the hook adds to a compaction the bot did not
53
- * issue: D3 + the resume guidance. No closing section — that one exists for the
59
+ * issue: D3 + the resume guidance, with the self-review section while `/compact_self_review` is on for the session's topic
60
+ * and without it while off. No closing section — that one exists for the
54
61
  * bot's own idle-compaction report, which an overflow compaction never feeds; the
55
62
  * checklist then ends the summary itself.
56
63
  */
57
- function getHookCompactionInstruction() {
64
+ function getHookCompactionInstruction(isWithInstructionGaps) {
58
65
  return (0, compactOnIdle_1.buildCompactionInstruction)({
59
66
  bakesSummaryGuidance: false,
60
67
  summaryGuidance: compactOnIdle_1.compactionSummaryGuidance,
61
68
  bakesResumeGuidance: false,
62
- resumeGuidance: compactOnIdle_1.compactionResumeGuidance,
69
+ resumeGuidance: (0, compactOnIdle_1.getCompactionResumeGuidance)(isWithInstructionGaps),
63
70
  }) ?? '';
64
71
  }
65
72
  /**
66
- * @description Build the hook's shell command: print `instruction` unless the
67
- * hook's stdin (the `PreCompact` input JSON) already contains `alreadySentMarker`.
68
- * The marker is matched as a fixed string against the raw JSON, so it must be text
69
- * JSON leaves unescaped — the caller passes the resume guidance, and a test pins
70
- * that it qualifies.
73
+ * The shell that reads the session id out of the hook's stdin JSON (`session_id`, which is what the bot named the flag
74
+ * after) and empties it unless it is made of the characters a flag name may hold: the text comes from outside the bot and
75
+ * must never take the path out of the flag folder.
76
+ */
77
+ const readSessionIdFromHookInputShell = `sed -n 's/.*"session_id" *: *"\\([^"]*\\)".*/\\1/p'`;
78
+ /**
79
+ * @description Build the hook's shell command: print nothing when the hook's stdin (the `PreCompact` input JSON) already
80
+ * contains `alreadySentMarker`; otherwise print `instructionWithoutGaps` when a flag named after the input's `session_id`
81
+ * exists in `offFlagDir` (the topic's `/compact_self_review` is off, `utils/compactSelfReviewFlags.ts`) and `instruction` when it
82
+ * does not. The marker is matched as a fixed string against the raw JSON, so it must be text JSON leaves unescaped — the
83
+ * caller passes the resume guidance both variants share, and a test pins that it qualifies.
71
84
  */
72
85
  function buildPreCompactHookCommand(input) {
73
- return `grep -qF -e ${(0, tmuxExec_1.shellSingleQuote)(input.alreadySentMarker)} || printf '%s\\n' ${(0, tmuxExec_1.shellSingleQuote)(input.instruction)}`;
86
+ return [
87
+ 'input=$(cat)',
88
+ `if printf '%s' "$input" | grep -qF -e ${(0, tmuxExec_1.shellSingleQuote)(input.alreadySentMarker)}; then exit 0; fi`,
89
+ `session=$(printf '%s' "$input" | ${readSessionIdFromHookInputShell})`,
90
+ `case "$session" in ''|*[!A-Za-z0-9_-]*) session= ;; esac`,
91
+ `if [ -n "$session" ] && [ -e ${(0, tmuxExec_1.shellSingleQuote)(input.offFlagDir)}/"$session" ]; then printf '%s\\n' ${(0, tmuxExec_1.shellSingleQuote)(input.instructionWithoutGaps)}; else printf '%s\\n' ${(0, tmuxExec_1.shellSingleQuote)(input.instruction)}; fi`,
92
+ ].join('; ');
74
93
  }
75
94
  /**
76
95
  * @description The `--settings` payload: the `PreCompact` command hook (auto AND manual compactions) and the shared
@@ -100,8 +119,10 @@ function buildClaudeLaunchHookSettings(commands) {
100
119
  function prepareClaudeCompactHookFlags(dataDir, configDir = null) {
101
120
  const hookSettings = buildClaudeLaunchHookSettings({
102
121
  preCompact: buildPreCompactHookCommand({
103
- instruction: getHookCompactionInstruction(),
104
- alreadySentMarker: compactOnIdle_1.compactionResumeGuidance,
122
+ instruction: getHookCompactionInstruction(true),
123
+ instructionWithoutGaps: getHookCompactionInstruction(false),
124
+ alreadySentMarker: compactOnIdle_1.compactionResumeGuidanceWithoutGaps,
125
+ offFlagDir: (0, compactSelfReviewFlags_1.getClaudeCompactSelfReviewOffDir)(dataDir),
105
126
  }),
106
127
  postToolUse: (0, midTurn_1.buildTodoInboxHookCommand)((0, midTurn_1.getTodoInboxDir)(dataDir)),
107
128
  });
@@ -1 +1 @@
1
- {"version":3,"file":"claudeCompactHook.js","sourceRoot":"","sources":["../../src/utils/claudeCompactHook.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;AA2BH,oEAOC;AASD,gEAKC;AAUD,sEASC;AAcD,sEAeC;AA9FD,4CAAoB;AACpB,gDAAwB;AACxB,mDAIyB;AACzB,yCAA8C;AAC9C,qDAAoG;AACpG,6DAAuE;AACvE,8CAA8E;AAE9E;;;;GAIG;AACU,QAAA,iCAAiC,GAAG,0BAA0B,CAAC;AAE5E;;;;;GAKG;AACH,SAAgB,4BAA4B;IAC1C,OAAO,IAAA,0CAA0B,EAAC;QAChC,oBAAoB,EAAE,KAAK;QAC3B,eAAe,EAAE,yCAAyB;QAC1C,mBAAmB,EAAE,KAAK;QAC1B,cAAc,EAAE,wCAAwB;KACzC,CAAC,IAAI,EAAE,CAAC;AACX,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,0BAA0B,CAAC,KAG1C;IACC,OAAO,eAAe,IAAA,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,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC;IACnE,IAAI,CAAC;QACH,YAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvC,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACrE,YAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,+BAA+B,YAAY,GAAG,EAAE,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC;YAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -1,23 +1,35 @@
1
1
  import type { ClaudeProfileBilling } from './claudeProfiles';
2
2
  import { type ClaudeApiSpend } from './claudeApiSpend';
3
+ import { type ClaudeApiCreditAnchor, type ClaudeApiCreditSpend } from './claudeApiCredit';
3
4
  import { type ClaudeUsageSnapshot } from './claudeUsage';
4
5
  /**
5
6
  * What the lines read of a profile: its usage snapshot, limit mark, billing and used-up-credits mark (a state record and
6
7
  * a usage view both fit).
7
8
  */
8
9
  export interface ClaudeProfileUsageSource {
10
+ /** The profile's name: the expired-credit line names the command that sets the new figure for it. */
11
+ name?: string;
9
12
  usage?: ClaudeUsageSnapshot;
10
13
  limitedUntil?: string | null;
11
14
  billing?: ClaudeProfileBilling | null;
12
15
  creditExhaustedAt?: string | null;
13
16
  apiSpend?: ClaudeApiSpend;
17
+ /** The operator's Console figure (`utils/claudeApiCredit.ts`): an account billed to API credits shows its estimate. */
18
+ creditAnchor?: ClaudeApiCreditAnchor;
19
+ creditSpend?: ClaudeApiCreditSpend;
20
+ /** When the bot detected that the used-up credit was back (the credit period starts there). */
21
+ creditRenewedAt?: string;
22
+ /** The refusal the operator acted on: the account is usable again, the renewal still awaited. */
23
+ creditUnconfirmedSince?: string;
14
24
  }
15
25
  /**
16
26
  * @description The profile's usage as display lines: the windows as `used% 🔄 reset` — 5h and weekly always (`—`
17
27
  * for one the snapshot lacks), Fable only when the account HAS that window (a corporate seat has none: nothing
18
28
  * is written about it) — `(stale)` when the last poll could not refresh, and the limit mark while it holds, the
19
29
  * reset instant in `timezone`, and the used-up-credits mark while it holds. An account billed to API credits has no
20
- * windows (its row already says it pays per use): what it spent through the bot, and that mark. The lines carry the
30
+ * windows (its row already says it pays per use): what it spent through the bot and the one credit line
31
+ * (`utils/claudeApiCredit.ts`: the spend of the credit period, the operator's figure when there is one, and the «probably
32
+ * used up» sign in place of the plain used-up mark). The lines carry the
21
33
  * locale's own indentation (they hang under a row); empty for an account with nothing to show.
22
34
  */
23
35
  export declare function formatClaudeProfileUsageLines(source: ClaudeProfileUsageSource | undefined, timezone: string, nowMs: number): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"claudeProfileUsageLines.d.ts","sourceRoot":"","sources":["../../src/utils/claudeProfileUsageLines.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAkC,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,eAAe,CAAC;AAEvB;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACtC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,cAAc,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,CAAC,EAAE,MAAM,CAAC;CACjC;AAUD;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,wBAAwB,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAuBrI;AA6ED,oHAAoH;AACpH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAEhJ"}
@@ -8,7 +8,10 @@ exports.formatClaudeApiSpendWords = formatClaudeApiSpendWords;
8
8
  */
9
9
  const i18n_1 = require("../i18n");
10
10
  const claudeApiSpend_1 = require("./claudeApiSpend");
11
+ const claudeApiCredit_1 = require("./claudeApiCredit");
11
12
  const claudeUsage_1 = require("./claudeUsage");
13
+ /** What the expired-credit line names when the source carries no profile name (a placeholder the operator replaces). */
14
+ const unknownProfileName = '<profile>';
12
15
  /** The localised words of a relative reset («🔄 in 2h»). */
13
16
  function getRelativeResetWords() {
14
17
  return { pattern: (0, i18n_1.t)('usage.resetIn'), day: (0, i18n_1.t)('usage.unitDay'), hour: (0, i18n_1.t)('usage.unitHour'), minute: (0, i18n_1.t)('usage.unitMinute') };
@@ -18,7 +21,9 @@ function getRelativeResetWords() {
18
21
  * for one the snapshot lacks), Fable only when the account HAS that window (a corporate seat has none: nothing
19
22
  * is written about it) — `(stale)` when the last poll could not refresh, and the limit mark while it holds, the
20
23
  * reset instant in `timezone`, and the used-up-credits mark while it holds. An account billed to API credits has no
21
- * windows (its row already says it pays per use): what it spent through the bot, and that mark. The lines carry the
24
+ * windows (its row already says it pays per use): what it spent through the bot and the one credit line
25
+ * (`utils/claudeApiCredit.ts`: the spend of the credit period, the operator's figure when there is one, and the «probably
26
+ * used up» sign in place of the plain used-up mark). The lines carry the
22
27
  * locale's own indentation (they hang under a row); empty for an account with nothing to show.
23
28
  */
24
29
  function formatClaudeProfileUsageLines(source, timezone, nowMs) {
@@ -47,15 +52,81 @@ function formatClaudeProfileUsageLines(source, timezone, nowMs) {
47
52
  lines.push((0, i18n_1.t)('account.row.creditExhausted'));
48
53
  return lines;
49
54
  }
50
- /** The lines of an account billed to API credits: its spend through the bot, and the used-up mark while it holds. */
55
+ /**
56
+ * The lines of an account billed to API credits: its spend through the bot, and the one credit line
57
+ * (`formatClaudeApiCreditLine`) that tells how the credit stands when the spend line does not already — it also carries the
58
+ * «probably used up» sign, so this account has no separate used-up line.
59
+ */
51
60
  function formatApiBillingLines(source, timezone, nowMs) {
52
61
  const lines = [];
53
62
  if (source.apiSpend)
54
63
  lines.push((0, i18n_1.t)('account.row.apiSpend', formatClaudeApiSpendWords(source.apiSpend, timezone, nowMs)));
55
- if (source.creditExhaustedAt)
56
- lines.push((0, i18n_1.t)('account.row.creditExhausted'));
64
+ const credit = (0, claudeApiCredit_1.getClaudeApiCreditEstimate)({
65
+ anchor: source.creditAnchor,
66
+ renewedAt: source.creditRenewedAt,
67
+ spend: source.creditSpend,
68
+ apiSpend: source.apiSpend,
69
+ creditExhaustedAt: source.creditExhaustedAt,
70
+ creditUnconfirmedSince: source.creditUnconfirmedSince,
71
+ nowMs,
72
+ });
73
+ const creditLine = credit ? formatClaudeApiCreditLine(credit, source.name ?? unknownProfileName, timezone, nowMs) : null;
74
+ if (creditLine !== null)
75
+ lines.push(creditLine);
57
76
  return lines;
58
77
  }
78
+ /**
79
+ * The expiry day as a date: `15.11` (the year when it is not this one), like every other date of these lines. The day is
80
+ * a plain calendar day, so it is read in UTC — no zone shifts it.
81
+ */
82
+ function formatCreditExpiryDay(expiresOn, nowMs) {
83
+ return (0, claudeApiSpend_1.formatSpendSinceDay)(`${expiresOn}T00:00:00Z`, 'UTC', nowMs);
84
+ }
85
+ /**
86
+ * @description The one line of the bonus API credit (`utils/claudeApiCredit.ts`), `null` when the «💳» spend line above it
87
+ * already says everything (no figure, no renewal, nothing refused: both would show the same total from the same day):
88
+ * • a figure from the operator: `🎁 API credit ≈ $61.20 of $200.00 · $6.51 spent via the bot since 07.11 · expires 15.11`
89
+ * (the grant and the expiry only when they were given) — the period differs from the «💳» lifetime total, so both show;
90
+ * • after a renewal the bot detected: `🎁 API credit renewed ≈ 08.11 · ≈ $199.75 of $200.00 · $0.25 spent via the bot ·
91
+ * check expiry in Console › Billing` on the last given grant, or only `renewed ≈ 08.11 · $0.25 spent since` without one;
92
+ * • after a refusal for the balance: `🎁 API credit probably used up · $6.51 spent since 07.11 — top it up, then pick the account
93
+ * again` — «probably»: the bot cannot be sure, and the daily recheck ends it by itself — or just `probably used up` when the
94
+ * «💳» line carries the spend; the tail is what the old used-up line told, so a topped-up balance is picked again at once;
95
+ * • after a refusal the operator acted on (picked the account again): `refused 07.11 — the next turn that goes through shows
96
+ * it is back` — no claim of «used up» and no stale remainder;
97
+ * • past the expiry day the operator gave: `expired`, with the command that sets the new figure.
98
+ * The «≈» and «via the bot» say what the figures are: the bot's own count, not the Console's balance.
99
+ */
100
+ function formatClaudeApiCreditLine(credit, profileName, timezone, nowMs) {
101
+ if (credit.status === 'expired')
102
+ return (0, i18n_1.t)('account.row.apiCreditExpired', { day: formatCreditExpiryDay(credit.expiresOn, nowMs), name: profileName });
103
+ const spent = (0, claudeApiSpend_1.formatUsd)(credit.spentUsd);
104
+ const since = credit.since === null ? '' : (0, claudeApiSpend_1.formatSpendSinceDay)(credit.since, timezone, nowMs);
105
+ const isPeriodOfItsOwn = credit.basis === 'anchor' || credit.basis === 'renewal';
106
+ if (credit.status === 'probablyUsedUp') {
107
+ // The old used-up line told what to do; this one still does (the refusal notice in the topic says it once and scrolls away).
108
+ const pickAgain = (0, i18n_1.t)('account.row.apiCreditPickAgain');
109
+ return (isPeriodOfItsOwn ? (0, i18n_1.t)('account.row.apiCreditProbablyUsedUp', { spent, since }) : (0, i18n_1.t)('account.row.apiCreditProbablyUsedUpBare')) + pickAgain;
110
+ }
111
+ if (credit.status === 'unconfirmed') {
112
+ return (0, i18n_1.t)('account.row.apiCreditUnconfirmed', { day: credit.unconfirmedSince === null ? '' : (0, claudeApiSpend_1.formatSpendSinceDay)(credit.unconfirmedSince, timezone, nowMs) });
113
+ }
114
+ if (credit.basis === 'anchor' && credit.leftUsd !== null) {
115
+ return (0, i18n_1.t)('account.row.apiCredit', {
116
+ left: (0, claudeApiSpend_1.formatUsd)(credit.leftUsd),
117
+ grant: credit.grantUsd === null ? '' : (0, i18n_1.t)('account.row.apiCreditGrant', { grant: (0, claudeApiSpend_1.formatUsd)(credit.grantUsd) }),
118
+ spent,
119
+ since,
120
+ expires: credit.expiresOn === null ? '' : (0, i18n_1.t)('account.row.apiCreditExpires', { day: formatCreditExpiryDay(credit.expiresOn, nowMs) }),
121
+ });
122
+ }
123
+ if (credit.basis === 'renewal') {
124
+ return credit.leftUsd !== null && credit.grantUsd !== null
125
+ ? (0, i18n_1.t)('account.row.apiCreditRenewedEstimate', { since, left: (0, claudeApiSpend_1.formatUsd)(credit.leftUsd), grant: (0, claudeApiSpend_1.formatUsd)(credit.grantUsd), spent })
126
+ : (0, i18n_1.t)('account.row.apiCreditRenewed', { since, spent });
127
+ }
128
+ return null;
129
+ }
59
130
  /** The placeholders every spend text fills: `total`, `since` (the day, in `timezone`), `last` (the last turn's). */
60
131
  function formatClaudeApiSpendWords(spend, timezone, nowMs) {
61
132
  return { total: (0, claudeApiSpend_1.formatUsd)(spend.totalUsd), since: (0, claudeApiSpend_1.formatSpendSinceDay)(spend.since, timezone, nowMs), last: (0, claudeApiSpend_1.formatUsd)(spend.lastTurnUsd) };
@@ -1 +1 @@
1
- {"version":3,"file":"claudeProfileUsageLines.js","sourceRoot":"","sources":["../../src/utils/claudeProfileUsageLines.ts"],"names":[],"mappings":";;AAyCA,sEAuBC;AAWD,8DAEC;AA7ED;;;GAGG;AACH,kCAA4B;AAE5B,qDAAuF;AACvF,+CAOuB;AAc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AgB,yBAAyB,CAAC,KAAqB,EAAE,QAAgB,EAAE,KAAa;IAC9F,OAAO,EAAE,KAAK,EAAE,IAAA,0BAAS,EAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAA,oCAAmB,EAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE,IAAA,0BAAS,EAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;AAC5I,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @description The views of the Claude profiles as the screens, the ranking and the report read them: a profile's record
3
+ * (usage, marks, spend) plus the operator's credit figure (`utils/claudeApiCredit.ts`), and the credit fields of a report
4
+ * entry that the bot's estimate fills for an API account.
5
+ *
6
+ * WHY this is not in `claudeUsage.ts`: that module is loaded by the connector guards, which run before any env file is read and
7
+ * may load only their own small module set (`connectorGuards.test.ts`); the credit module reads a file and pulls its schema
8
+ * library. The types stay in `claudeUsage.ts`; whatever needs the credit estimate lives here, imported by the bot and the CLI.
9
+ */
10
+ import type { ClaudeProfileRecord } from '../state';
11
+ import { type ClaudeApiCreditAnchor, type ClaudeApiCreditAnchors } from './claudeApiCredit';
12
+ import { type ClaudeLaunchPickOptions, type ClaudeProfilesReport, type ClaudeProfileUsageView } from './claudeUsage';
13
+ /** @description One profile's view: its record's usage, marks and spend, plus the operator's credit figure (what `/accounts` and `/limits` render). */
14
+ export declare function buildClaudeProfileUsageView(input: {
15
+ dataDir: string;
16
+ name: string;
17
+ /** The profile's record; `undefined` for a name nothing was recorded for. */
18
+ record: ClaudeProfileRecord | undefined;
19
+ /** The operator's credit figure for it (`readClaudeApiCreditAnchors`); `undefined` = none given. */
20
+ creditAnchor?: ClaudeApiCreditAnchor;
21
+ }): ClaudeProfileUsageView;
22
+ /**
23
+ * @description The ranking's view of every profile off the registry: `default` (its hidden record, when the
24
+ * bot has written one) first, then the added profiles in creation order. Shared by the bot (live state) and
25
+ * the CLI (`state.json` read directly).
26
+ */
27
+ export declare function buildClaudeProfileUsageViews(input: {
28
+ dataDir: string;
29
+ /** Every record, the hidden `default` one included (`StateStore.getClaudeProfileInfo` / the raw file). */
30
+ records: Readonly<Record<string, ClaudeProfileRecord>>;
31
+ /** The operator's credit figures by profile name (`readClaudeApiCreditAnchors`); none = none given. */
32
+ creditAnchors?: ClaudeApiCreditAnchors;
33
+ }): ClaudeProfileUsageView[];
34
+ /**
35
+ * @description `report` with the credit fields of every API account filled from its view (`views`, as the report was built from
36
+ * them): `buildClaudeProfilesReport` leaves them empty. Entries keep their order; an entry without a view keeps its empty fields.
37
+ */
38
+ export declare function addClaudeApiCreditToReport(report: ClaudeProfilesReport, views: readonly ClaudeProfileUsageView[], nowMs: number): ClaudeProfilesReport;
39
+ /**
40
+ * @description THE report an agent, the CLI or any other reader of the credit gets: {@link buildClaudeProfilesReport} (the
41
+ * launch pick, the windows) with the credit fields of the API accounts filled from their views. `claude_profiles` (the bot) and
42
+ * `charness claude-profiles` (the CLI) both call exactly this, so the CLI's end-to-end run proves the code the MCP tool runs —
43
+ * never assemble "build + fill" by hand at a call site.
44
+ */
45
+ export declare function buildClaudeProfilesCreditReport(views: readonly ClaudeProfileUsageView[], model: string | null, nowMs: number, options?: ClaudeLaunchPickOptions): ClaudeProfilesReport;
46
+ //# sourceMappingURL=claudeProfileUsageViews.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claudeProfileUsageViews.d.ts","sourceRoot":"","sources":["../../src/utils/claudeProfileUsageViews.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAiE,KAAK,qBAAqB,EAAE,KAAK,sBAAsB,EAAgC,MAAM,mBAAmB,CAAC;AACzL,OAAO,EAA6B,KAAK,uBAAuB,EAAiC,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE/K,uJAAuJ;AACvJ,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACxC,oGAAoG;IACpG,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC,GAAG,sBAAsB,CAqBzB;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,0GAA0G;IAC1G,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACvD,uGAAuG;IACvG,aAAa,CAAC,EAAE,sBAAsB,CAAC;CACxC,GAAG,sBAAsB,EAAE,CAS3B;AAwCD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,oBAAoB,EAAE,KAAK,EAAE,SAAS,sBAAsB,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,oBAAoB,CAQtJ;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,SAAS,sBAAsB,EAAE,EACxC,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,uBAA4B,GACpC,oBAAoB,CAGtB"}
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ /**
3
+ * @description The views of the Claude profiles as the screens, the ranking and the report read them: a profile's record
4
+ * (usage, marks, spend) plus the operator's credit figure (`utils/claudeApiCredit.ts`), and the credit fields of a report
5
+ * entry that the bot's estimate fills for an API account.
6
+ *
7
+ * WHY this is not in `claudeUsage.ts`: that module is loaded by the connector guards, which run before any env file is read and
8
+ * may load only their own small module set (`connectorGuards.test.ts`); the credit module reads a file and pulls its schema
9
+ * library. The types stay in `claudeUsage.ts`; whatever needs the credit estimate lives here, imported by the bot and the CLI.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.buildClaudeProfileUsageView = buildClaudeProfileUsageView;
13
+ exports.buildClaudeProfileUsageViews = buildClaudeProfileUsageViews;
14
+ exports.addClaudeApiCreditToReport = addClaudeApiCreditToReport;
15
+ exports.buildClaudeProfilesCreditReport = buildClaudeProfilesCreditReport;
16
+ const claudeProfiles_1 = require("./claudeProfiles");
17
+ const claudeApiCredit_1 = require("./claudeApiCredit");
18
+ const claudeUsage_1 = require("./claudeUsage");
19
+ /** @description One profile's view: its record's usage, marks and spend, plus the operator's credit figure (what `/accounts` and `/limits` render). */
20
+ function buildClaudeProfileUsageView(input) {
21
+ const { name, record, creditAnchor } = input;
22
+ return {
23
+ name,
24
+ configDir: (0, claudeProfiles_1.resolveClaudeProfileDir)(input.dataDir, name),
25
+ loggedIn: record?.loggedIn,
26
+ email: record?.email ?? null,
27
+ subscriptionType: record?.subscriptionType ?? null,
28
+ usage: record?.usage,
29
+ limitedUntil: record?.limitedUntil ?? null,
30
+ ...(record?.agentHoldUntil ? { agentHoldUntil: record.agentHoldUntil } : {}),
31
+ billing: record?.billing ?? null,
32
+ // A figure the operator gave after the refusal ends the mark (the bot clears the stored one when it reads the figures; a
33
+ // reader of `state.json` alone, the command line, must see the same).
34
+ creditExhaustedAt: record?.creditExhaustedAt && (!creditAnchor || (0, claudeApiCredit_1.checkIsClaudeApiCreditMarkCurrent)(record.creditExhaustedAt, creditAnchor.anchoredAt)) ? record.creditExhaustedAt : null,
35
+ ...(record?.creditUnconfirmedSince && (!creditAnchor || (0, claudeApiCredit_1.checkIsClaudeApiCreditMarkCurrent)(record.creditUnconfirmedSince, creditAnchor.anchoredAt)) ? { creditUnconfirmedSince: record.creditUnconfirmedSince } : {}),
36
+ ...(record?.apiSpend ? { apiSpend: record.apiSpend } : {}),
37
+ ...(creditAnchor ? { creditAnchor } : {}),
38
+ ...(record?.creditSpend ? { creditSpend: record.creditSpend } : {}),
39
+ ...(record?.creditRenewedAt ? { creditRenewedAt: record.creditRenewedAt } : {}),
40
+ };
41
+ }
42
+ /**
43
+ * @description The ranking's view of every profile off the registry: `default` (its hidden record, when the
44
+ * bot has written one) first, then the added profiles in creation order. Shared by the bot (live state) and
45
+ * the CLI (`state.json` read directly).
46
+ */
47
+ function buildClaudeProfileUsageViews(input) {
48
+ // A `default` the operator signed out through /accounts stays out of every ranking until it is signed in again.
49
+ const isDefaultRemoved = input.records.default?.isRemoved === true;
50
+ const toView = (name, record) => buildClaudeProfileUsageView({ dataDir: input.dataDir, name, record, creditAnchor: input.creditAnchors?.[name] });
51
+ const added = Object.entries(input.records)
52
+ .filter(([name]) => name !== 'default')
53
+ .sort(([, a], [, b]) => a.createdAt.localeCompare(b.createdAt));
54
+ return [...(isDefaultRemoved ? [] : [toView('default', input.records.default)]), ...added.map(([name, record]) => toView(name, record))];
55
+ }
56
+ /** What the bot can tell of an API account's credit now; `null` for any other account and when it knows nothing worth a line. */
57
+ function getClaudeProfileCreditEstimate(profile, nowMs) {
58
+ return profile.billing === 'api'
59
+ ? (0, claudeApiCredit_1.getClaudeApiCreditEstimate)({
60
+ anchor: profile.creditAnchor,
61
+ renewedAt: profile.creditRenewedAt,
62
+ spend: profile.creditSpend,
63
+ apiSpend: profile.apiSpend,
64
+ creditExhaustedAt: profile.creditExhaustedAt,
65
+ creditUnconfirmedSince: profile.creditUnconfirmedSince,
66
+ nowMs,
67
+ })
68
+ : null;
69
+ }
70
+ /** The credit fields of a report entry: the bot's estimate for an API account, empty for any other. */
71
+ function getClaudeProfileReportCredit(profile, nowMs) {
72
+ const estimate = getClaudeProfileCreditEstimate(profile, nowMs);
73
+ return {
74
+ // Nothing counted yet (no figure, no renewal, no turn) is no count, not a count of zero.
75
+ spentUsd: estimate && estimate.basis !== 'none' ? estimate.spentUsd : null,
76
+ remainingEstimateUsd: estimate?.leftUsd ?? null,
77
+ expiresOn: estimate?.expiresOn ?? null,
78
+ // From the refusal itself, not from the line: an expired credit with a pending refusal is still refused.
79
+ probablyUsedUp: estimate?.isProbablyUsedUp ?? false,
80
+ renewedAt: estimate?.renewedAt ?? null,
81
+ };
82
+ }
83
+ /**
84
+ * The API accounts whose credit has run out by the operator's own expiry day (`status: 'expired'`): the launch pick leaves them
85
+ * out of its API-first step — the report would show `remainingEstimateUsd: 0` next to them. `claudeUsage.ts` cannot load the
86
+ * credit module, so this is worked out here and handed to the pick.
87
+ */
88
+ function listExpiredApiProfileNames(views, nowMs) {
89
+ return new Set(views.filter((view) => getClaudeProfileCreditEstimate(view, nowMs)?.status === 'expired').map((view) => view.name));
90
+ }
91
+ /**
92
+ * @description `report` with the credit fields of every API account filled from its view (`views`, as the report was built from
93
+ * them): `buildClaudeProfilesReport` leaves them empty. Entries keep their order; an entry without a view keeps its empty fields.
94
+ */
95
+ function addClaudeApiCreditToReport(report, views, nowMs) {
96
+ return {
97
+ ...report,
98
+ profiles: report.profiles.map((entry) => {
99
+ const view = views.find((candidate) => candidate.name === entry.name);
100
+ return view === undefined ? entry : { ...entry, ...getClaudeProfileReportCredit(view, nowMs) };
101
+ }),
102
+ };
103
+ }
104
+ /**
105
+ * @description THE report an agent, the CLI or any other reader of the credit gets: {@link buildClaudeProfilesReport} (the
106
+ * launch pick, the windows) with the credit fields of the API accounts filled from their views. `claude_profiles` (the bot) and
107
+ * `charness claude-profiles` (the CLI) both call exactly this, so the CLI's end-to-end run proves the code the MCP tool runs —
108
+ * never assemble "build + fill" by hand at a call site.
109
+ */
110
+ function buildClaudeProfilesCreditReport(views, model, nowMs, options = {}) {
111
+ const expiredApiNames = listExpiredApiProfileNames(views, nowMs);
112
+ return addClaudeApiCreditToReport((0, claudeUsage_1.buildClaudeProfilesReport)(views, model, nowMs, { ...options, expiredApiNames }), views, nowMs);
113
+ }
114
+ //# sourceMappingURL=claudeProfileUsageViews.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claudeProfileUsageViews.js","sourceRoot":"","sources":["../../src/utils/claudeProfileUsageViews.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAQH,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,0BAA0B,CAAC,KAAwC,EAAE,KAAa;IACzF,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,8BAA8B,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACrI,CAAC;AAED;;;GAGG;AACH,SAAgB,0BAA0B,CAAC,MAA4B,EAAE,KAAwC,EAAE,KAAa;IAC9H,OAAO;QACL,GAAG,MAAM;QACT,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAA4B,EAAE;YAChE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC;YACtE,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,4BAA4B,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QACjG,CAAC,CAAC;KACH,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,+BAA+B,CAC7C,KAAwC,EACxC,KAAoB,EACpB,KAAa,EACb,UAAmC,EAAE;IAErC,MAAM,eAAe,GAAG,0BAA0B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACjE,OAAO,0BAA0B,CAAC,IAAA,uCAAyB,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACnI,CAAC"}
@@ -142,6 +142,21 @@ export declare function checkIsAnthropicSecretLike(text: string): boolean;
142
142
  export declare function extractAnthropicApiKey(text: string): string | null;
143
143
  /** The key file of a profile directory. */
144
144
  export declare function resolveClaudeProfileApiKeyFile(configDir: string): string;
145
+ /**
146
+ * @description The API key an ADDED profile's own sessions use, read to make ONE direct request on its behalf (the daily
147
+ * credit recheck): the pasted key file, else the key a Console login stored in the profile's `.claude.json`. `null` when the
148
+ * directory holds neither, or what it holds does not look like an API key. The caller puts it in a request header and
149
+ * nowhere else — it is never logged, echoed or stored.
150
+ */
151
+ export declare function readClaudeProfileApiKey(configDir: string): string | null;
152
+ /**
153
+ * @description The API key of the `default` profile (`~/.claude`, when it is billed to API credits), `null` unless its sessions
154
+ * run on the key a Console login left in the home `.claude.json` (`primaryApiKey`; `isConsoleLoginKey`, from the auth probe):
155
+ * the CLI prefers an `apiKeyHelper` or a variable over that key, and a stale `primaryApiKey` left by an earlier login would be
156
+ * asked on a key the sessions do not use. The bot never writes a pasted key for the default. Same rules as
157
+ * {@link readClaudeProfileApiKey}.
158
+ */
159
+ export declare function readDefaultClaudeProfileApiKey(isConsoleLoginKey: boolean, homeDir?: string): string | null;
145
160
  /** Whether the profile directory holds a pasted key (`null` = `~/.claude`, which never does: the bot writes none there). */
146
161
  export declare function checkHasClaudeProfileApiKey(configDir: string | null): boolean;
147
162
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"claudeProfiles.d.ts","sourceRoot":"","sources":["../../src/utils/claudeProfiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAMH,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAElD,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,6DAA8D,CAAC;AACtG,eAAO,MAAM,kCAAkC,wBAAyB,CAAC;AAEzE,iGAAiG;AACjG,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAG7C,wHAAwH;AACxH,eAAO,MAAM,2BAA2B,UAAU,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,6BAA6B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