waterplane 0.1.6 → 0.1.11

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 (496) hide show
  1. package/CHANGELOG.md +92 -1
  2. package/README.md +1 -1
  3. package/SECURITY.md +11 -3
  4. package/deploy/node-version +1 -1
  5. package/node_modules/@waterplane/shared/dist/agentfiles.d.ts +17 -0
  6. package/node_modules/@waterplane/shared/dist/agentfiles.js +58 -4
  7. package/node_modules/@waterplane/shared/dist/agentfiles.js.map +1 -1
  8. package/node_modules/@waterplane/shared/dist/alwaysonwords.d.ts +83 -0
  9. package/node_modules/@waterplane/shared/dist/alwaysonwords.js +209 -0
  10. package/node_modules/@waterplane/shared/dist/alwaysonwords.js.map +1 -0
  11. package/node_modules/@waterplane/shared/dist/autocompact.js +1 -1
  12. package/node_modules/@waterplane/shared/dist/autocompact.js.map +1 -1
  13. package/node_modules/@waterplane/shared/dist/backendsources.d.ts +11 -1
  14. package/node_modules/@waterplane/shared/dist/backendsources.js.map +1 -1
  15. package/node_modules/@waterplane/shared/dist/branchmode.d.ts +27 -0
  16. package/node_modules/@waterplane/shared/dist/branchmode.js +80 -0
  17. package/node_modules/@waterplane/shared/dist/branchmode.js.map +1 -0
  18. package/node_modules/@waterplane/shared/dist/buildstamp.d.ts +37 -0
  19. package/node_modules/@waterplane/shared/dist/buildstamp.js +95 -0
  20. package/node_modules/@waterplane/shared/dist/buildstamp.js.map +1 -0
  21. package/node_modules/@waterplane/shared/dist/burn.d.ts +16 -1
  22. package/node_modules/@waterplane/shared/dist/burn.js +30 -0
  23. package/node_modules/@waterplane/shared/dist/burn.js.map +1 -1
  24. package/node_modules/@waterplane/shared/dist/changebrief.d.ts +61 -0
  25. package/node_modules/@waterplane/shared/dist/changebrief.js +70 -0
  26. package/node_modules/@waterplane/shared/dist/changebrief.js.map +1 -0
  27. package/node_modules/@waterplane/shared/dist/desktopfiles.d.ts +100 -0
  28. package/node_modules/@waterplane/shared/dist/desktopfiles.js +192 -0
  29. package/node_modules/@waterplane/shared/dist/desktopfiles.js.map +1 -0
  30. package/node_modules/@waterplane/shared/dist/exposure.d.ts +175 -0
  31. package/node_modules/@waterplane/shared/dist/exposure.js +357 -0
  32. package/node_modules/@waterplane/shared/dist/exposure.js.map +1 -0
  33. package/node_modules/@waterplane/shared/dist/exposurepush.d.ts +60 -0
  34. package/node_modules/@waterplane/shared/dist/exposurepush.js +103 -0
  35. package/node_modules/@waterplane/shared/dist/exposurepush.js.map +1 -0
  36. package/node_modules/@waterplane/shared/dist/healthindex/commits.d.ts +26 -0
  37. package/node_modules/@waterplane/shared/dist/healthindex/commits.js +57 -0
  38. package/node_modules/@waterplane/shared/dist/healthindex/commits.js.map +1 -0
  39. package/node_modules/@waterplane/shared/dist/healthindex/move.d.ts +25 -0
  40. package/node_modules/@waterplane/shared/dist/healthindex/move.js +79 -0
  41. package/node_modules/@waterplane/shared/dist/healthindex/move.js.map +1 -0
  42. package/node_modules/@waterplane/shared/dist/healthindex/readings.d.ts +53 -0
  43. package/node_modules/@waterplane/shared/dist/healthindex/readings.js +154 -0
  44. package/node_modules/@waterplane/shared/dist/healthindex/readings.js.map +1 -0
  45. package/node_modules/@waterplane/shared/dist/healthindex/repoindex.d.ts +41 -0
  46. package/node_modules/@waterplane/shared/dist/healthindex/repoindex.js +19 -0
  47. package/node_modules/@waterplane/shared/dist/healthindex/repoindex.js.map +1 -0
  48. package/node_modules/@waterplane/shared/dist/healthindex/score.d.ts +26 -0
  49. package/node_modules/@waterplane/shared/dist/healthindex/score.js +154 -0
  50. package/node_modules/@waterplane/shared/dist/healthindex/score.js.map +1 -0
  51. package/node_modules/@waterplane/shared/dist/healthindex/types.d.ts +206 -0
  52. package/node_modules/@waterplane/shared/dist/healthindex/types.js +58 -0
  53. package/node_modules/@waterplane/shared/dist/healthindex/types.js.map +1 -0
  54. package/node_modules/@waterplane/shared/dist/healthindex/vs.d.ts +26 -0
  55. package/node_modules/@waterplane/shared/dist/healthindex/vs.js +38 -0
  56. package/node_modules/@waterplane/shared/dist/healthindex/vs.js.map +1 -0
  57. package/node_modules/@waterplane/shared/dist/healthindex/words.d.ts +28 -0
  58. package/node_modules/@waterplane/shared/dist/healthindex/words.js +69 -0
  59. package/node_modules/@waterplane/shared/dist/healthindex/words.js.map +1 -0
  60. package/node_modules/@waterplane/shared/dist/healthindex.d.ts +15 -411
  61. package/node_modules/@waterplane/shared/dist/healthindex.js +8 -602
  62. package/node_modules/@waterplane/shared/dist/healthindex.js.map +1 -1
  63. package/node_modules/@waterplane/shared/dist/hints.js +5 -0
  64. package/node_modules/@waterplane/shared/dist/hints.js.map +1 -1
  65. package/node_modules/@waterplane/shared/dist/index.d.ts +29 -0
  66. package/node_modules/@waterplane/shared/dist/index.js +29 -0
  67. package/node_modules/@waterplane/shared/dist/index.js.map +1 -1
  68. package/node_modules/@waterplane/shared/dist/intent/kind.d.ts +31 -1
  69. package/node_modules/@waterplane/shared/dist/intent/kind.js +27 -3
  70. package/node_modules/@waterplane/shared/dist/intent/kind.js.map +1 -1
  71. package/node_modules/@waterplane/shared/dist/intent.d.ts +1 -1
  72. package/node_modules/@waterplane/shared/dist/intent.js +1 -1
  73. package/node_modules/@waterplane/shared/dist/intent.js.map +1 -1
  74. package/node_modules/@waterplane/shared/dist/launchmodes.d.ts +2 -0
  75. package/node_modules/@waterplane/shared/dist/launchmodes.js +12 -0
  76. package/node_modules/@waterplane/shared/dist/launchmodes.js.map +1 -1
  77. package/node_modules/@waterplane/shared/dist/ledgerspan.d.ts +59 -0
  78. package/node_modules/@waterplane/shared/dist/ledgerspan.js +99 -0
  79. package/node_modules/@waterplane/shared/dist/ledgerspan.js.map +1 -0
  80. package/node_modules/@waterplane/shared/dist/netretry.d.ts +38 -0
  81. package/node_modules/@waterplane/shared/dist/netretry.js +31 -0
  82. package/node_modules/@waterplane/shared/dist/netretry.js.map +1 -0
  83. package/node_modules/@waterplane/shared/dist/netretrycfg.d.ts +12 -0
  84. package/node_modules/@waterplane/shared/dist/netretrycfg.js +27 -0
  85. package/node_modules/@waterplane/shared/dist/netretrycfg.js.map +1 -0
  86. package/node_modules/@waterplane/shared/dist/nodemin.d.ts +6 -4
  87. package/node_modules/@waterplane/shared/dist/nodemin.js +6 -4
  88. package/node_modules/@waterplane/shared/dist/nodemin.js.map +1 -1
  89. package/node_modules/@waterplane/shared/dist/optins.d.ts +35 -1
  90. package/node_modules/@waterplane/shared/dist/optins.js +39 -1
  91. package/node_modules/@waterplane/shared/dist/optins.js.map +1 -1
  92. package/node_modules/@waterplane/shared/dist/plugin/api.d.ts +364 -0
  93. package/node_modules/@waterplane/shared/dist/plugin/api.js +2 -0
  94. package/node_modules/@waterplane/shared/dist/plugin/api.js.map +1 -0
  95. package/node_modules/@waterplane/shared/dist/plugin/backend.d.ts +197 -0
  96. package/node_modules/@waterplane/shared/dist/plugin/backend.js +9 -0
  97. package/node_modules/@waterplane/shared/dist/plugin/backend.js.map +1 -0
  98. package/node_modules/@waterplane/shared/dist/plugin/manifest.d.ts +160 -0
  99. package/node_modules/@waterplane/shared/dist/plugin/manifest.js +98 -0
  100. package/node_modules/@waterplane/shared/dist/plugin/manifest.js.map +1 -0
  101. package/node_modules/@waterplane/shared/dist/plugin/module.d.ts +98 -0
  102. package/node_modules/@waterplane/shared/dist/plugin/module.js +13 -0
  103. package/node_modules/@waterplane/shared/dist/plugin/module.js.map +1 -0
  104. package/node_modules/@waterplane/shared/dist/plugin/version.d.ts +64 -0
  105. package/node_modules/@waterplane/shared/dist/plugin/version.js +84 -0
  106. package/node_modules/@waterplane/shared/dist/plugin/version.js.map +1 -0
  107. package/node_modules/@waterplane/shared/dist/plugin.d.ts +5 -867
  108. package/node_modules/@waterplane/shared/dist/plugin.js +27 -186
  109. package/node_modules/@waterplane/shared/dist/plugin.js.map +1 -1
  110. package/node_modules/@waterplane/shared/dist/pluginlaunch.d.ts +7 -0
  111. package/node_modules/@waterplane/shared/dist/prview.d.ts +23 -0
  112. package/node_modules/@waterplane/shared/dist/prview.js +107 -0
  113. package/node_modules/@waterplane/shared/dist/prview.js.map +1 -0
  114. package/node_modules/@waterplane/shared/dist/repohealth.d.ts +4 -0
  115. package/node_modules/@waterplane/shared/dist/repohealth.js.map +1 -1
  116. package/node_modules/@waterplane/shared/dist/schedule/schedaction.d.ts +29 -0
  117. package/node_modules/@waterplane/shared/dist/schedule/schedaction.js +22 -0
  118. package/node_modules/@waterplane/shared/dist/schedule/schedaction.js.map +1 -1
  119. package/node_modules/@waterplane/shared/dist/schedule/schedclean.js +26 -0
  120. package/node_modules/@waterplane/shared/dist/schedule/schedclean.js.map +1 -1
  121. package/node_modules/@waterplane/shared/dist/schedule.d.ts +1 -1
  122. package/node_modules/@waterplane/shared/dist/schedule.js +1 -1
  123. package/node_modules/@waterplane/shared/dist/schedule.js.map +1 -1
  124. package/node_modules/@waterplane/shared/dist/sessionbudget.d.ts +20 -5
  125. package/node_modules/@waterplane/shared/dist/sessionbudget.js +42 -16
  126. package/node_modules/@waterplane/shared/dist/sessionbudget.js.map +1 -1
  127. package/node_modules/@waterplane/shared/dist/weekburn.d.ts +114 -0
  128. package/node_modules/@waterplane/shared/dist/weekburn.js +205 -0
  129. package/node_modules/@waterplane/shared/dist/weekburn.js.map +1 -0
  130. package/node_modules/@waterplane/shared/dist/wire/alwayson.d.ts +64 -0
  131. package/node_modules/@waterplane/shared/dist/wire/alwayson.js +7 -0
  132. package/node_modules/@waterplane/shared/dist/wire/alwayson.js.map +1 -0
  133. package/node_modules/@waterplane/shared/dist/wire/backend.d.ts +4 -0
  134. package/node_modules/@waterplane/shared/dist/wire/backendtokens.d.ts +6 -0
  135. package/node_modules/@waterplane/shared/dist/wire/backendtokens.js +0 -9
  136. package/node_modules/@waterplane/shared/dist/wire/backendtokens.js.map +1 -1
  137. package/node_modules/@waterplane/shared/dist/wire/costwindow.d.ts +20 -0
  138. package/node_modules/@waterplane/shared/dist/wire/messages/clienthost.d.ts +15 -1
  139. package/node_modules/@waterplane/shared/dist/wire/messages/clientsession.d.ts +10 -0
  140. package/node_modules/@waterplane/shared/dist/wire/messages/hosttools.d.ts +12 -2
  141. package/node_modules/@waterplane/shared/dist/wire/notify.d.ts +129 -1
  142. package/node_modules/@waterplane/shared/dist/wire/notify.js +79 -1
  143. package/node_modules/@waterplane/shared/dist/wire/notify.js.map +1 -1
  144. package/node_modules/@waterplane/shared/dist/wire/pullrequest.d.ts +42 -0
  145. package/node_modules/@waterplane/shared/dist/wire/pullrequest.js +2 -0
  146. package/node_modules/@waterplane/shared/dist/wire/pullrequest.js.map +1 -0
  147. package/node_modules/@waterplane/shared/dist/wire/repo.d.ts +119 -0
  148. package/node_modules/@waterplane/shared/dist/wire/repo.js +8 -3
  149. package/node_modules/@waterplane/shared/dist/wire/repo.js.map +1 -1
  150. package/node_modules/@waterplane/shared/dist/wire/sent.d.ts +3 -1
  151. package/node_modules/@waterplane/shared/dist/wire/session/contextspark.d.ts +7 -0
  152. package/node_modules/@waterplane/shared/dist/wire/session/info.d.ts +4 -1
  153. package/node_modules/@waterplane/shared/dist/wire/session/launch.d.ts +25 -0
  154. package/node_modules/@waterplane/shared/dist/wire/session.d.ts +1 -1
  155. package/node_modules/@waterplane/shared/dist/wire/telemetry.d.ts +4 -0
  156. package/node_modules/@waterplane/shared/dist/wire/work.d.ts +13 -0
  157. package/node_modules/@waterplane/shared/dist/wire/work.js.map +1 -1
  158. package/npm-shrinkwrap.json +3 -3
  159. package/package.json +2 -2
  160. package/packages/extensions/scorecard/waterplane-plugin.json +10 -0
  161. package/packages/host/dist/agentexposure.d.ts +13 -0
  162. package/packages/host/dist/agentexposure.js +90 -0
  163. package/packages/host/dist/agentexposure.js.map +1 -0
  164. package/packages/host/dist/agentintents.js +2 -2
  165. package/packages/host/dist/agentintents.js.map +1 -1
  166. package/packages/host/dist/agentwatch.d.ts +3 -7
  167. package/packages/host/dist/agentwatch.js.map +1 -1
  168. package/packages/host/dist/alwayson.d.ts +18 -0
  169. package/packages/host/dist/alwayson.js +159 -0
  170. package/packages/host/dist/alwayson.js.map +1 -0
  171. package/packages/host/dist/answergate.d.ts +3 -7
  172. package/packages/host/dist/answergate.js.map +1 -1
  173. package/packages/host/dist/attentionstore.d.ts +61 -0
  174. package/packages/host/dist/attentionstore.js +162 -0
  175. package/packages/host/dist/attentionstore.js.map +1 -0
  176. package/packages/host/dist/backends/claude.js +1 -1
  177. package/packages/host/dist/backends/claude.js.map +1 -1
  178. package/packages/host/dist/backends/derive.js +1 -0
  179. package/packages/host/dist/backends/derive.js.map +1 -1
  180. package/packages/host/dist/backends/registry.js +4 -1
  181. package/packages/host/dist/backends/registry.js.map +1 -1
  182. package/packages/host/dist/backends/types.d.ts +2 -0
  183. package/packages/host/dist/besidespend.d.ts +22 -0
  184. package/packages/host/dist/besidespend.js +65 -0
  185. package/packages/host/dist/besidespend.js.map +1 -0
  186. package/packages/host/dist/boxkit.d.ts +19 -0
  187. package/packages/host/dist/boxkit.js +38 -0
  188. package/packages/host/dist/boxkit.js.map +1 -0
  189. package/packages/host/dist/branchrules.d.ts +14 -0
  190. package/packages/host/dist/branchrules.js +47 -0
  191. package/packages/host/dist/branchrules.js.map +1 -0
  192. package/packages/host/dist/builds.d.ts +31 -1
  193. package/packages/host/dist/builds.js +55 -3
  194. package/packages/host/dist/builds.js.map +1 -1
  195. package/packages/host/dist/buildversions.d.ts +2 -0
  196. package/packages/host/dist/buildversions.js +36 -0
  197. package/packages/host/dist/buildversions.js.map +1 -0
  198. package/packages/host/dist/burnwatch.d.ts +23 -11
  199. package/packages/host/dist/burnwatch.js +51 -2
  200. package/packages/host/dist/burnwatch.js.map +1 -1
  201. package/packages/host/dist/changebrief.d.ts +37 -0
  202. package/packages/host/dist/changebrief.js +157 -0
  203. package/packages/host/dist/changebrief.js.map +1 -0
  204. package/packages/host/dist/cli/index.js +1 -1
  205. package/packages/host/dist/cli/index.js.map +1 -1
  206. package/packages/host/dist/clihealth.d.ts +2 -0
  207. package/packages/host/dist/clihealth.js +11 -2
  208. package/packages/host/dist/clihealth.js.map +1 -1
  209. package/packages/host/dist/compliance.d.ts +5 -1
  210. package/packages/host/dist/compliance.js +70 -31
  211. package/packages/host/dist/compliance.js.map +1 -1
  212. package/packages/host/dist/composer.d.ts +3 -1
  213. package/packages/host/dist/composer.js +3 -1
  214. package/packages/host/dist/composer.js.map +1 -1
  215. package/packages/host/dist/ctxlog/ctxcursor.d.ts +36 -1
  216. package/packages/host/dist/ctxlog/ctxcursor.js +96 -2
  217. package/packages/host/dist/ctxlog/ctxcursor.js.map +1 -1
  218. package/packages/host/dist/ctxlog/ctxproject.js +2 -1
  219. package/packages/host/dist/ctxlog/ctxproject.js.map +1 -1
  220. package/packages/host/dist/ctxlog/ctxupdate.js +13 -2
  221. package/packages/host/dist/ctxlog/ctxupdate.js.map +1 -1
  222. package/packages/host/dist/diskwatch.d.ts +4 -6
  223. package/packages/host/dist/diskwatch.js +3 -1
  224. package/packages/host/dist/diskwatch.js.map +1 -1
  225. package/packages/host/dist/eraseen.d.ts +6 -0
  226. package/packages/host/dist/eraseen.js +100 -0
  227. package/packages/host/dist/eraseen.js.map +1 -0
  228. package/packages/host/dist/exposure.d.ts +56 -0
  229. package/packages/host/dist/exposure.js +371 -0
  230. package/packages/host/dist/exposure.js.map +1 -0
  231. package/packages/host/dist/exposurepush.d.ts +28 -0
  232. package/packages/host/dist/exposurepush.js +136 -0
  233. package/packages/host/dist/exposurepush.js.map +1 -0
  234. package/packages/host/dist/exposurerun.d.ts +18 -0
  235. package/packages/host/dist/exposurerun.js +126 -0
  236. package/packages/host/dist/exposurerun.js.map +1 -0
  237. package/packages/host/dist/exposurewatch.d.ts +29 -0
  238. package/packages/host/dist/exposurewatch.js +127 -0
  239. package/packages/host/dist/exposurewatch.js.map +1 -0
  240. package/packages/host/dist/extensions/scorecard/host/engine.d.mts +54 -0
  241. package/packages/host/dist/extensions/scorecard/host/engine.mjs +303 -0
  242. package/packages/host/dist/extensions/scorecard/host/engine.mjs.map +1 -0
  243. package/packages/host/dist/extensions/scorecard/host/gitslug.d.mts +5 -0
  244. package/packages/host/dist/extensions/scorecard/host/gitslug.mjs +45 -0
  245. package/packages/host/dist/extensions/scorecard/host/gitslug.mjs.map +1 -0
  246. package/packages/host/dist/extensions/scorecard/host/index.d.mts +15 -0
  247. package/packages/host/dist/extensions/scorecard/host/index.mjs +47 -0
  248. package/packages/host/dist/extensions/scorecard/host/index.mjs.map +1 -0
  249. package/packages/host/dist/extensions/scorecard/host/store.d.mts +12 -0
  250. package/packages/host/dist/extensions/scorecard/host/store.mjs +91 -0
  251. package/packages/host/dist/extensions/scorecard/host/store.mjs.map +1 -0
  252. package/packages/host/dist/extensions/scorecard/shared/logic.d.mts +42 -0
  253. package/packages/host/dist/extensions/scorecard/shared/logic.mjs +170 -0
  254. package/packages/host/dist/extensions/scorecard/shared/logic.mjs.map +1 -0
  255. package/packages/host/dist/extensions/scorecard/shared/wire.d.mts +140 -0
  256. package/packages/host/dist/extensions/scorecard/shared/wire.mjs +29 -0
  257. package/packages/host/dist/extensions/scorecard/shared/wire.mjs.map +1 -0
  258. package/packages/host/dist/forge/github.d.ts +3 -0
  259. package/packages/host/dist/forge/github.js +82 -0
  260. package/packages/host/dist/forge/github.js.map +1 -0
  261. package/packages/host/dist/forge/index.d.ts +14 -0
  262. package/packages/host/dist/forge/index.js +32 -0
  263. package/packages/host/dist/forge/index.js.map +1 -0
  264. package/packages/host/dist/forge/types.d.ts +52 -0
  265. package/packages/host/dist/forge/types.js +2 -0
  266. package/packages/host/dist/forge/types.js.map +1 -0
  267. package/packages/host/dist/git.d.ts +36 -3
  268. package/packages/host/dist/git.js +119 -41
  269. package/packages/host/dist/git.js.map +1 -1
  270. package/packages/host/dist/gitnotify.d.ts +24 -0
  271. package/packages/host/dist/gitnotify.js +60 -0
  272. package/packages/host/dist/gitnotify.js.map +1 -0
  273. package/packages/host/dist/healthwatch.d.ts +2 -1
  274. package/packages/host/dist/healthwatch.js +4 -2
  275. package/packages/host/dist/healthwatch.js.map +1 -1
  276. package/packages/host/dist/intents/adapters.js +45 -14
  277. package/packages/host/dist/intents/adapters.js.map +1 -1
  278. package/packages/host/dist/intents/contract.d.ts +4 -0
  279. package/packages/host/dist/intents/contract.js.map +1 -1
  280. package/packages/host/dist/intents/fire.js +7 -1
  281. package/packages/host/dist/intents/fire.js.map +1 -1
  282. package/packages/host/dist/intents/manager.d.ts +3 -3
  283. package/packages/host/dist/intents/manager.js +2 -2
  284. package/packages/host/dist/intents/manager.js.map +1 -1
  285. package/packages/host/dist/intents/watch.d.ts +10 -2
  286. package/packages/host/dist/intents/watch.js +27 -2
  287. package/packages/host/dist/intents/watch.js.map +1 -1
  288. package/packages/host/dist/localcistatus.d.ts +22 -0
  289. package/packages/host/dist/localcistatus.js +105 -0
  290. package/packages/host/dist/localcistatus.js.map +1 -0
  291. package/packages/host/dist/main.js +40 -10
  292. package/packages/host/dist/main.js.map +1 -1
  293. package/packages/host/dist/net.d.ts +2 -0
  294. package/packages/host/dist/net.js +11 -2
  295. package/packages/host/dist/net.js.map +1 -1
  296. package/packages/host/dist/netlog.d.ts +40 -0
  297. package/packages/host/dist/netlog.js +165 -0
  298. package/packages/host/dist/netlog.js.map +1 -0
  299. package/packages/host/dist/netretrycfg.d.ts +7 -0
  300. package/packages/host/dist/netretrycfg.js +51 -0
  301. package/packages/host/dist/netretrycfg.js.map +1 -0
  302. package/packages/host/dist/notifyprefs.d.ts +6 -2
  303. package/packages/host/dist/notifyprefs.js +20 -5
  304. package/packages/host/dist/notifyprefs.js.map +1 -1
  305. package/packages/host/dist/notifytypes.d.ts +58 -0
  306. package/packages/host/dist/notifytypes.js +2 -0
  307. package/packages/host/dist/notifytypes.js.map +1 -0
  308. package/packages/host/dist/opendeliveries.js +24 -0
  309. package/packages/host/dist/opendeliveries.js.map +1 -1
  310. package/packages/host/dist/optins.d.ts +28 -1
  311. package/packages/host/dist/optins.js +96 -4
  312. package/packages/host/dist/optins.js.map +1 -1
  313. package/packages/host/dist/peers/agentpeer.js +1 -1
  314. package/packages/host/dist/peers/agentpeer.js.map +1 -1
  315. package/packages/host/dist/peers/jobs.d.ts +2 -4
  316. package/packages/host/dist/peers/jobs.js +6 -1
  317. package/packages/host/dist/peers/jobs.js.map +1 -1
  318. package/packages/host/dist/plugins/pluginapi.js +2 -0
  319. package/packages/host/dist/plugins/pluginapi.js.map +1 -1
  320. package/packages/host/dist/plugins/pluginregistry.d.ts +3 -8
  321. package/packages/host/dist/plugins/pluginregistry.js +1 -1
  322. package/packages/host/dist/plugins/pluginregistry.js.map +1 -1
  323. package/packages/host/dist/protectmain.d.ts +35 -0
  324. package/packages/host/dist/protectmain.js +73 -0
  325. package/packages/host/dist/protectmain.js.map +1 -0
  326. package/packages/host/dist/prpush.d.ts +30 -0
  327. package/packages/host/dist/prpush.js +171 -0
  328. package/packages/host/dist/prpush.js.map +1 -0
  329. package/packages/host/dist/prs.d.ts +70 -0
  330. package/packages/host/dist/prs.js +328 -0
  331. package/packages/host/dist/prs.js.map +1 -0
  332. package/packages/host/dist/push.d.ts +19 -0
  333. package/packages/host/dist/push.js.map +1 -1
  334. package/packages/host/dist/render.d.ts +57 -0
  335. package/packages/host/dist/render.js +57 -39
  336. package/packages/host/dist/render.js.map +1 -1
  337. package/packages/host/dist/repohealth.js +5 -2
  338. package/packages/host/dist/repohealth.js.map +1 -1
  339. package/packages/host/dist/repohealthapproval.d.ts +3 -0
  340. package/packages/host/dist/repohealthapproval.js +92 -2
  341. package/packages/host/dist/repohealthapproval.js.map +1 -1
  342. package/packages/host/dist/repos.js +7 -1
  343. package/packages/host/dist/repos.js.map +1 -1
  344. package/packages/host/dist/reposkill.d.ts +8 -5
  345. package/packages/host/dist/reposkill.js +16 -11
  346. package/packages/host/dist/reposkill.js.map +1 -1
  347. package/packages/host/dist/reposkilltext.d.ts +8 -1
  348. package/packages/host/dist/reposkilltext.js +72 -3
  349. package/packages/host/dist/reposkilltext.js.map +1 -1
  350. package/packages/host/dist/routes/apihost.js +26 -2
  351. package/packages/host/dist/routes/apihost.js.map +1 -1
  352. package/packages/host/dist/routes/apiprs.d.ts +2 -0
  353. package/packages/host/dist/routes/apiprs.js +45 -0
  354. package/packages/host/dist/routes/apiprs.js.map +1 -0
  355. package/packages/host/dist/routes/apirepofiles.js +12 -1
  356. package/packages/host/dist/routes/apirepofiles.js.map +1 -1
  357. package/packages/host/dist/routes/apirepowork.js +48 -24
  358. package/packages/host/dist/routes/apirepowork.js.map +1 -1
  359. package/packages/host/dist/routes/apiroutes.js +2 -1
  360. package/packages/host/dist/routes/apiroutes.js.map +1 -1
  361. package/packages/host/dist/routes/apisession.js +24 -0
  362. package/packages/host/dist/routes/apisession.js.map +1 -1
  363. package/packages/host/dist/routes/apistats.js +12 -7
  364. package/packages/host/dist/routes/apistats.js.map +1 -1
  365. package/packages/host/dist/routes/apisystem.js +23 -1
  366. package/packages/host/dist/routes/apisystem.js.map +1 -1
  367. package/packages/host/dist/routes/apitable.d.ts +10 -0
  368. package/packages/host/dist/routes/apitable.js.map +1 -1
  369. package/packages/host/dist/routes/apiweekburn.d.ts +2 -0
  370. package/packages/host/dist/routes/apiweekburn.js +30 -0
  371. package/packages/host/dist/routes/apiweekburn.js.map +1 -0
  372. package/packages/host/dist/routes/session.js +4 -0
  373. package/packages/host/dist/routes/session.js.map +1 -1
  374. package/packages/host/dist/routes/system.js +33 -6
  375. package/packages/host/dist/routes/system.js.map +1 -1
  376. package/packages/host/dist/routes/types.d.ts +29 -21
  377. package/packages/host/dist/routes/work/workbuild.js +3 -2
  378. package/packages/host/dist/routes/work/workbuild.js.map +1 -1
  379. package/packages/host/dist/routes/work/workschedule.js +33 -3
  380. package/packages/host/dist/routes/work/workschedule.js.map +1 -1
  381. package/packages/host/dist/screenlog.d.ts +20 -0
  382. package/packages/host/dist/screenlog.js +40 -0
  383. package/packages/host/dist/screenlog.js.map +1 -1
  384. package/packages/host/dist/server/clients.d.ts +14 -24
  385. package/packages/host/dist/server/clients.js +77 -11
  386. package/packages/host/dist/server/clients.js.map +1 -1
  387. package/packages/host/dist/server/ctx.d.ts +2 -0
  388. package/packages/host/dist/server/ctxseal.d.ts +1 -1
  389. package/packages/host/dist/server/ctxseal.js +6 -6
  390. package/packages/host/dist/server/ctxseal.js.map +1 -1
  391. package/packages/host/dist/server/deliveries.js +4 -2
  392. package/packages/host/dist/server/deliveries.js.map +1 -1
  393. package/packages/host/dist/server/http.js +2 -2
  394. package/packages/host/dist/server/http.js.map +1 -1
  395. package/packages/host/dist/server/intentDeps.js +4 -1
  396. package/packages/host/dist/server/intentDeps.js.map +1 -1
  397. package/packages/host/dist/server/intentEvents.js +9 -4
  398. package/packages/host/dist/server/intentEvents.js.map +1 -1
  399. package/packages/host/dist/server/scan.js +23 -1
  400. package/packages/host/dist/server/scan.js.map +1 -1
  401. package/packages/host/dist/server/sessionEvents.js +37 -10
  402. package/packages/host/dist/server/sessionEvents.js.map +1 -1
  403. package/packages/host/dist/sessions/agentpoll.d.ts +31 -0
  404. package/packages/host/dist/sessions/agentpoll.js +176 -0
  405. package/packages/host/dist/sessions/agentpoll.js.map +1 -0
  406. package/packages/host/dist/sessions/apiretry.d.ts +59 -0
  407. package/packages/host/dist/sessions/apiretry.js +240 -0
  408. package/packages/host/dist/sessions/apiretry.js.map +1 -0
  409. package/packages/host/dist/sessions/askwatch.d.ts +62 -0
  410. package/packages/host/dist/sessions/askwatch.js +169 -0
  411. package/packages/host/dist/sessions/askwatch.js.map +1 -0
  412. package/packages/host/dist/sessions/boxes.d.ts +2 -23
  413. package/packages/host/dist/sessions/boxes.js +10 -664
  414. package/packages/host/dist/sessions/boxes.js.map +1 -1
  415. package/packages/host/dist/sessions/boxread.d.ts +47 -0
  416. package/packages/host/dist/sessions/boxread.js +628 -0
  417. package/packages/host/dist/sessions/boxread.js.map +1 -0
  418. package/packages/host/dist/sessions/core.d.ts +16 -1
  419. package/packages/host/dist/sessions/ctxseries.js +3 -0
  420. package/packages/host/dist/sessions/ctxseries.js.map +1 -1
  421. package/packages/host/dist/sessions/drive.d.ts +20 -6
  422. package/packages/host/dist/sessions/drive.js +43 -8
  423. package/packages/host/dist/sessions/drive.js.map +1 -1
  424. package/packages/host/dist/sessions/knobs.d.ts +8 -0
  425. package/packages/host/dist/sessions/knobs.js +9 -0
  426. package/packages/host/dist/sessions/knobs.js.map +1 -1
  427. package/packages/host/dist/sessions/record.js +7 -2
  428. package/packages/host/dist/sessions/record.js.map +1 -1
  429. package/packages/host/dist/sessions/resume.d.ts +17 -0
  430. package/packages/host/dist/sessions/resume.js +65 -11
  431. package/packages/host/dist/sessions/resume.js.map +1 -1
  432. package/packages/host/dist/sessions/roster.js +3 -0
  433. package/packages/host/dist/sessions/roster.js.map +1 -1
  434. package/packages/host/dist/sessions/sidechannel.d.ts +1 -1
  435. package/packages/host/dist/sessions/sidechannel.js +2 -2
  436. package/packages/host/dist/sessions/turn.d.ts +15 -58
  437. package/packages/host/dist/sessions/turn.js +17 -356
  438. package/packages/host/dist/sessions/turn.js.map +1 -1
  439. package/packages/host/dist/sessions.d.ts +7 -1
  440. package/packages/host/dist/sessions.js +22 -13
  441. package/packages/host/dist/sessions.js.map +1 -1
  442. package/packages/host/dist/settle.d.ts +6 -0
  443. package/packages/host/dist/settle.js +26 -21
  444. package/packages/host/dist/settle.js.map +1 -1
  445. package/packages/host/dist/setupprefs.d.ts +26 -1
  446. package/packages/host/dist/setupprefs.js +49 -1
  447. package/packages/host/dist/setupprefs.js.map +1 -1
  448. package/packages/host/dist/sidecar/sidecarname.d.ts +2 -0
  449. package/packages/host/dist/sidecar/sidecarname.js +5 -1
  450. package/packages/host/dist/sidecar/sidecarname.js.map +1 -1
  451. package/packages/host/dist/sidecar/sidecarroute.d.ts +1 -1
  452. package/packages/host/dist/sidecar/sidecarroute.js +5 -0
  453. package/packages/host/dist/sidecar/sidecarroute.js.map +1 -1
  454. package/packages/host/dist/sidecar.d.ts +1 -1
  455. package/packages/host/dist/sidecar.js +1 -1
  456. package/packages/host/dist/sidecar.js.map +1 -1
  457. package/packages/host/dist/tokenscan.d.ts +4 -0
  458. package/packages/host/dist/tokenscan.js +6 -1
  459. package/packages/host/dist/tokenscan.js.map +1 -1
  460. package/packages/host/dist/tokenstats.js +3 -1
  461. package/packages/host/dist/tokenstats.js.map +1 -1
  462. package/packages/host/dist/transcript/transcriptparse.js +6 -1
  463. package/packages/host/dist/transcript/transcriptparse.js.map +1 -1
  464. package/packages/host/dist/transcript/transcriptturns.d.ts +29 -0
  465. package/packages/host/dist/transcript/transcriptturns.js +27 -0
  466. package/packages/host/dist/transcript/transcriptturns.js.map +1 -1
  467. package/packages/host/dist/transcript.d.ts +1 -1
  468. package/packages/host/dist/transcript.js +1 -1
  469. package/packages/host/dist/transcript.js.map +1 -1
  470. package/packages/host/dist/usagesources.d.ts +1 -1
  471. package/packages/host/dist/usagesources.js +7 -2
  472. package/packages/host/dist/usagesources.js.map +1 -1
  473. package/packages/host/dist/weekburn.d.ts +75 -0
  474. package/packages/host/dist/weekburn.js +251 -0
  475. package/packages/host/dist/weekburn.js.map +1 -0
  476. package/packages/host/dist/worktreeleftover.d.ts +9 -0
  477. package/packages/host/dist/worktreeleftover.js +17 -1
  478. package/packages/host/dist/worktreeleftover.js.map +1 -1
  479. package/packages/web/dist/assets/demo-C1GHaeTv.js +23 -0
  480. package/packages/web/dist/assets/icons-DlcvcZoo.js +1 -0
  481. package/packages/web/dist/assets/index-BBc6xwDA.css +1 -0
  482. package/packages/web/dist/assets/index-DzQKnksZ.js +169 -0
  483. package/packages/web/dist/assets/shared-Cl34umPA.js +47 -0
  484. package/packages/web/dist/assets/{sheets-Bjv2L-cG.css → sheets-DoUhPGK0.css} +1 -1
  485. package/packages/web/dist/assets/sheets-_3_SvXAx.js +220 -0
  486. package/packages/web/dist/build-id.txt +1 -1
  487. package/packages/web/dist/buildstamp.json +1 -0
  488. package/packages/web/dist/index.html +7 -7
  489. package/packages/web/dist/sw.js +14 -3
  490. package/release.json +7 -4
  491. package/packages/web/dist/assets/demo-CXlqlYE4.js +0 -23
  492. package/packages/web/dist/assets/icons-BbqDBVjw.js +0 -1
  493. package/packages/web/dist/assets/index-CgPoyb3Y.css +0 -1
  494. package/packages/web/dist/assets/index-D5JKj8DK.js +0 -169
  495. package/packages/web/dist/assets/shared-eyaskl5l.js +0 -47
  496. package/packages/web/dist/assets/sheets-BzzL2re1.js +0 -204
@@ -0,0 +1,47 @@
1
+ var e=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function t(e){return e.kind===`window`?`window`:`clock`}function n(e){return e.kind!==`once`&&e.oneShot!==!0}function r(e,t,n,r,i){let a=n.tz||i,o=n.hours?a?{hours:n.hours,tz:a}:{hours:n.hours}:{};if(e===`clock`&&!t)return{kind:`once`,at:n.kind===`once`?n.at??r+36e5:r+36e5,offsetMin:0,...o};if(e===`clock`){let e=n.kind===`weekly`?n:void 0;return{kind:`weekly`,days:e?.days??[],hour:e?.hour??18,minute:e?.minute??0,tz:e?.tz||i,offsetMin:n.offsetMin??0,...t?{}:{oneShot:!0},...o}}let s=n.kind===`window`?n:void 0;return{kind:`window`,window:s?.window??`session`,...s?.periodId?{periodId:s.periodId}:{},edge:s?.edge??`before`,offsetMin:s?.offsetMin??Math.min(0,n.offsetMin??-60),...s?.minPctLeft==null?{}:{minPctLeft:s.minPctLeft},...s?.guardWindow?{guardWindow:s.guardWindow}:{},...t?{}:{oneShot:!0},...o}}function i(e,t){if(!t)return null;if(e.periodId){let n=t.periodResetAt?.[e.periodId];return typeof n==`number`&&n>0?n:null}let n=e.window===`weekly`?t.weeklyResetAt:t.sessionResetAt;return typeof n==`number`&&n>0?n:null}var a=e=>e.periodId??(e.window===`weekly`?`weekly`:`session`),o=e=>e.window===`weekly`?`weekly`:`session`;function s(e){return e.kind===`build`?`run build ${e.buildId}`:e.text}function c(e,t,n){return e.filter(e=>e.action.kind===`build`&&e.action.repoDir===t&&e.action.buildId===n)}function l(e,t){try{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),r={};for(let e of n.formatToParts(new Date(t)))e.type!==`literal`&&(r[e.type]=Number(e.value));return Date.UTC(r.year,r.month-1,r.day,r.hour,r.minute,r.second)-t}catch{return null}}function u(e,t,n,r,i,a){if(!a)return new Date(e,t,n,r,i,0,0).getTime();let o=Date.UTC(e,t,n,r,i,0),s=l(a,o);return s==null?new Date(e,t,n,r,i,0,0).getTime():(s=l(a,o-s)??s,o-s)}function d(e,t){let n=e?l(e,t):null,r=new Date(n==null?t:t+n);return n==null?{y:r.getFullYear(),mo:r.getMonth(),d:r.getDate()}:{y:r.getUTCFullYear(),mo:r.getUTCMonth(),d:r.getUTCDate()}}function f(e,t){let n=e?l(e,t):null,r=new Date(n==null?t:t+n);return n==null?r.getHours()*60+r.getMinutes():r.getUTCHours()*60+r.getUTCMinutes()}function p(e,t){let n=e.hours;if(!n)return!0;let r=f(e.tz||null,t);return n.from<=n.to?r>=n.from&&r<n.to:r>=n.from||r<n.to}function m(e,t){if(!e.hours||p(e,t))return t;let n=e.tz||null,{y:r,mo:i,d:a}=d(n,t),o=Math.floor(e.hours.from/60),s=e.hours.from%60;for(let e=0;e<=2;e++){let c=u(r,i,a+e,o,s,n);if(c>=t)return c}return null}function h(e){let t=e.hours;if(!t)return null;let n=e=>`${String(Math.floor(e/60)).padStart(2,`0`)}:${String(e%60).padStart(2,`0`)}`;return`${n(t.from)}–${n(t.to)}`}function g(e){return e.tz?` ${e.tz}`:` host clock`}function ee(e,t,n){let r=(e.offsetMin??0)*6e4;if(e.kind===`window`){let a=i(e,n);if(a==null)return null;let o=a+(e.edge===`after`?Math.max(0,r):r);return o>t?o:null}if(e.kind===`once`){let n=(e.at??0)+r;return n>t?n:null}let a=e.hour??0,o=e.minute??0,s=e.tz||null,c=e.days?.length?e.days:null,l=d(s,t);for(let e=-2;e<=9;e++){let n=new Date(Date.UTC(l.y,l.mo,l.d+e)).getUTCDay();if(c&&!c.includes(n))continue;let i=u(l.y,l.mo,l.d+e,a,o,s)+r;if(i>t)return i}return null}function te(e,t){return n(e.rule)||e.nextAt!=null?!1:e.rule.kind===`once`?ee(e.rule,t)===null:e.nextAt===void 0||e.enabled===!0?!1:e.lastOccurrence!=null}function ne(e,t){return!e.rule||!te({rule:e.rule,nextAt:e.nextAt,lastOccurrence:e.lastOccurrence,enabled:e.enabled},t)}var re=`that instant has passed and a one-off cannot be re-armed — run it now, edit it, or post it again`;function ie(e,t,n=120){let r=(e??``).trim();if(!r)return null;let i=(t??``).trim();return i&&(i.startsWith(r)||r.startsWith(i.slice(0,n)))?null:r}function ae(e){let t=Math.abs(e),n=Math.floor(t/60),r=t%60;return n&&r?`${n}h ${r}m`:n?`${n}h`:`${r}m`}function oe(e){return`${String(e.hour??0).padStart(2,`0`)}:${String(e.minute??0).padStart(2,`0`)}`}function se(t){let n=t.offsetMin??0,r=n<0?`, ${ae(n)} before`:n>0?`, ${ae(n)} after`:``,i=h(t),s=i?`, only ${i}`:``;if(t.kind===`once`){let e=t.at??0;return`once · ${new Date(e).toLocaleString(void 0,{weekday:`short`,day:`numeric`,month:`short`,hour:`2-digit`,minute:`2-digit`})}${r}${s}`}let c=t.oneShot===!0?`once · `:``;if(t.kind===`window`){let e=a(t),r=e===`weekly`?`the weekly window`:e===`session`?`the session window`:e===`rolling30d`?`the rolling 30 days`:`the ${e} period`,i=t.guardWindow&&t.guardWindow!==o(t)?t.guardWindow:void 0,l=i===`weekly`?`of the week `:i===`session`?`of the session window `:``,u=t.minPctLeft!=null&&(t.edge!==`after`||i)?`, only if ${t.minPctLeft}% ${l}is left${t.oneShot===!0?` — else the next reset`:``}`:``;return t.edge===`after`?`${c}${n>0?`${ae(n)} after ${r} resets`:`right after ${r} resets`}${u}${s}`:`${c}${n?ae(n):`0m`} before ${r} resets${u}${s}`}let l=t.oneShot===!0?`next`:`every`;return`${c}${t.days?.length?`${l} ${t.days.map(t=>e[t]??`?`).join(` `)}`:`${l} day`} · ${oe(t)}${t.tz?` ${t.tz}`:``}${r}${s}`}var ce=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0;function le(e){if(e===null)return[];if(!e||typeof e!=`object`||Array.isArray(e))return[`the session spend must be an object (or null for cannot say)`];let t=e,n=[];ce(t.at)||n.push("the session spend has no `at` (when it was read)");for(let e of[`tok`,`agentTok`,`usd`,`agentUsd`])t[e]!==void 0&&!ce(t[e])&&n.push(`spend.${e} is ${JSON.stringify(t[e])}; a stated figure is a finite number ≥ 0, and an unknown one is left out`);if(t.native!==void 0){let e=t.native;!e||typeof e!=`object`||Array.isArray(e)?n.push(`spend.native must be { amount, unit, agentAmount? }`):(ce(e.amount)||n.push(`spend.native.amount is ${JSON.stringify(e.amount)}; it must be a finite number ≥ 0`),typeof e.unit!=`string`||!e.unit.trim()?n.push(`spend.native.unit must name the unit (the backend's own word, never converted)`):/^\s*(usd|\$|dollars?)\s*$/i.test(e.unit)&&n.push("spend.native is for a unit that is not dollars; dollars the CLI states go in `usd`"),e.agentAmount!==void 0&&!ce(e.agentAmount)&&n.push(`spend.native.agentAmount is ${JSON.stringify(e.agentAmount)}; it must be a finite number ≥ 0`))}return n}function ue(e,t){try{let n={};for(let r of new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}).formatToParts(new Date(t)))r.type!==`literal`&&(n[r.type]=Number(r.value));return Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)-t}catch{return null}}function de(e,t,n,r,i,a){let o=Date.UTC(e,t,n,r,i,0),s=ue(a,o);if(s==null)return new Date(e,t,n,r,i,0,0).getTime();let c=o-s,l=o-(ue(a,c)??s),u=e=>{let t=ue(a,e);return t==null?null:e+t};return u(l)===o?l:u(c)===o?c:Math.max(c,l)}function fe(e,t){try{let n={};for(let r of new Intl.DateTimeFormat(`en-US`,{timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`}).formatToParts(new Date(t)))r.type!==`literal`&&(n[r.type]=Number(r.value));if(Number.isFinite(n.year)&&Number.isFinite(n.month)&&Number.isFinite(n.day))return{y:n.year,mo:n.month-1,d:n.day}}catch{}let n=new Date(t);return{y:n.getFullYear(),mo:n.getMonth(),d:n.getDate()}}var pe=`session`,me=`weekly`,he=36e5,ge=24*he;5*he,7*ge,30*ge;var _e=(e,t)=>new Date(Date.UTC(e,t+1,0)).getUTCDate();function ve(e,t){let n=new Date(Date.UTC(e,t,1));return{y:n.getUTCFullYear(),mo:n.getUTCMonth()}}function ye(e,t,n,r){let i=ve(e,t);return de(i.y,i.mo,Math.min(n,_e(i.y,i.mo)),0,0,r)}function be(e,t){let{y:n,mo:r,d:i}=fe(e.tz,t),a,o=0;if(e.cycle===`month`){let t=Math.min(31,Math.max(1,Math.trunc(e.anchorDay??1)));o=i>=Math.min(t,_e(n,r))?0:-1,a=i=>ye(n,r+o+i,t,e.tz)}else if(e.cycle===`week`){let t=(new Date(Date.UTC(n,r,i)).getUTCDay()-Math.min(6,Math.max(0,Math.trunc(e.startDow??0)))+7)%7;a=a=>de(n,r,i-t+7*a,0,0,e.tz)}else a=t=>de(n,r,i+t,0,0,e.tz);let s=0;for(let e=0;e<3&&t<a(s);e++)s--;for(let e=0;e<3&&t>=a(s+1);e++)s++;return{start:a(s),resetAt:a(s+1),active:!0}}function xe(e,t,n){if(e.kind===`calendar`)return be(e,t);if(e.kind===`span`)return t<e.from?{start:e.from,resetAt:e.to,active:!1}:t>=e.to?{start:e.from,resetAt:null,active:!1}:{start:e.from,resetAt:e.to,active:!0};if(!e.scraped)return{start:t-e.lenMs,resetAt:null,active:!0};let r=n?.resetAt,i=typeof r==`number`&&Number.isFinite(r)&&r>t?r:null;return{start:i==null?t-e.lenMs:i-e.lenMs,resetAt:i,active:!0}}function Se(e,t,n){return e.map(e=>({period:e,...xe(e,t,n?.[e.id])}))}var _=e=>typeof e==`number`&&Number.isFinite(e);function Ce(e,t,n,r){return!_(e)||!_(t)||!_(r)||!_(n)||n<=t?null:e*Math.min(1,Math.max(0,(r-t)/(n-t)))}function we(e,t,n,r){return!_(e)||!_(t)||!_(n)||!_(r)||n<=r?null:Math.max(0,e-t)/Math.max(1,(n-r)/ge)}function Te(e,t,n,r){if(!_(e)||!_(t)||!_(n)||!_(r)||n<=t)return null;let i=n-t,a=r-t;return a<i*.1||a>i?null:i/a*e}var Ee=15e5;function De(e){let t=[{periodId:pe,max:e.sessionMax,unit:`pct`}];e.weeklyMax!=null&&t.push({periodId:me,max:e.weeklyMax,unit:`pct`});for(let n of e.ceilings??[])n.periodId!==`session`&&n.periodId!==`weekly`&&t.push(n);return t}function Oe(e,t){return Ae(e,[...De(e).filter(e=>e.periodId!==t.periodId),t])}function ke(e,t){let n=De(e).filter(e=>e.periodId!==t);return Ae(e,t===`session`?[...n,{periodId:t,max:100,unit:`pct`}]:n)}function Ae(e,t){let n=t.find(e=>e.periodId===pe),r=t.find(e=>e.periodId===me);return{...e,ceilings:t,sessionMax:n?n.max:100,weeklyMax:r?r.max:null}}function je(e,t,n=!1){return`${n?`timed for right after the weekly reset, so it starts only while the new week is under`:`leftover from a week that has reset — it was let past that week's budget and did not start in time, so it runs only while this week is under`} ${e.max}% (${e.pct}% used)`+Fe(e.resetAt,t).replace(` — resumes`,` — next chance`)}function Me(e){return e===`rolling30d`?`rolling 30 days`:e===`weekly`?`weekly window`:!e||e===`session`?`session window`:e}var Ne=e=>e==null?`?`:`$${e>=100?Math.round(e):e.toFixed(2).replace(/\.00$/,``)}`;function Pe(e){if(e.unit===`usd`){let t=Me(e.which);if(e.state===`ok`)return e.pct==null?`under the usage budget`:`${Ne(e.pct)} spent this ${t} (budget ${Ne(e.max)})`;if(e.state===`over`)return`paused - ${Ne(e.pct)} spent this ${t}, over the ${Ne(e.max)} budget`}let t=e.which===`weekly`?`weekly`:`session`;switch(e.state){case`off`:return`usage budget is off`;case`unset`:return`usage budget is on, but no ceiling is set`;case`unknown`:return`usage could not be read — the budget is not holding anything back`;case`ok`:return e.pct==null?`under the usage budget`:`${e.pct}% of the ${t} window used (budget ${e.max}%)`;case`over`:return`paused — ${e.pct}% of the ${t} window used, over the ${e.max}% budget`}}function Fe(e,t){if(e==null||!Number.isFinite(e))return``;let n=new Date(e),r=n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});return n.toDateString()===new Date(t).toDateString()?` — resumes ${r}`:` — resumes ${n.toLocaleDateString([],{weekday:`short`})} ${r}`}var Ie=e=>({blocked:!0,state:`over`,which:e.which,pct:e.pct,max:e.max,resumeAt:e.resetAt,...e.unit?{unit:e.unit}:{}});function Le(e,t){return Pe(Ie(e))+Fe(e.resetAt,t)}function Re(e,t,n=e.which){return`lifted for this row at its time — it is timed before ${n===e.which?`that window`:`the ${n} window`} resets, and a ceiling only saves allowance for later in the window; there is no later · held only until then: ${Pe(Ie(e)).replace(/^paused — /,``)}`}function ze(e,t,n){return`${Le(e,n)} · exempt from the ${t} ceiling, not from this one`}var Be=54e5;function Ve(e,t,n){return n||e==null||!(e>0)||!Number.isFinite(t)?null:t-e>=Be}var He=`2026-10-09`,Ue=.1,We=1.25,Ge={"claude-fable-5-1":{input:10,output:50,cacheRead:.25},"claude-mythos-5-1":{input:10,output:50},"claude-fable-5":{input:10,output:50},"claude-mythos-5":{input:10,output:50},"claude-opus-5-5":{input:4,output:20,cacheRead:.2},"claude-opus-5":{input:5,output:25},"claude-opus-4-8":{input:5,output:25},"claude-opus-4-7":{input:5,output:25},"claude-opus-4-6":{input:5,output:25},"claude-opus-4-5":{input:5,output:25},"claude-sonnet-5-5":{input:2,output:10},"claude-sonnet-5":{input:2,output:10},"claude-sonnet-4-6":{input:3,output:15},"claude-sonnet-4-5":{input:3,output:15},"claude-haiku-5-5":{input:.1,output:.5},"claude-haiku-4-5":{input:1,output:5}};function Ke(e){if(!e)return null;let t=e.trim().toLowerCase();return!t||!t.startsWith(`claude-`)?null:(t=t.replace(/(\[1m\]|-1m)$/,``),t=t.replace(/-\d{8}$/,``),t)}function qe(e,t){let n=Ke(e);if(!n)return null;let r=Ge[n];if(!r)return null;let i=r.intro&&t&&t<=r.intro.until?r.intro:r;return i.cacheRead==null?{input:i.input,output:i.output}:{input:i.input,output:i.output,cacheRead:i.cacheRead}}function Je(e){return qe(e)!=null}function v(){return{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}function y(e,t){return e.input+=t.input,e.output+=t.output,e.cacheRead+=t.cacheRead,e.cacheWrite+=t.cacheWrite,e.total+=t.total,e}function Ye(e,t,n){let r=qe(t,n);if(!r)return null;let i=(e,t)=>e/1e6*t,a=Math.max(0,Math.min(e.cacheWrite1h,e.cacheWrite)),o=Math.max(0,e.cacheWrite-a),s=r.cacheRead??r.input*.1,c={input:i(e.input,r.input),output:i(e.output,r.output),cacheRead:i(e.cacheRead,s),cacheWrite:i(o,r.input*We)+i(a,r.input*2),total:0};return c.total=c.input+c.output+c.cacheRead+c.cacheWrite,c}function b(e){if(!Number.isFinite(e))return`—`;if(e===0)return`$0`;let t=Math.abs(e);return t<.01?`$${e.toFixed(4)}`:t<1e3?`$${e.toFixed(2)}`:`$${Math.round(e).toLocaleString()}`}function Xe(e){if(!Number.isFinite(e))return`—`;let t=Math.abs(e);return t>=1e3?`$${(e/1e3).toFixed(t>=1e4?0:1).replace(/\.0$/,``)}k`:t>=10?`$${Math.round(e)}`:t===0?`$0`:t<.01?`<$0.01`:`$${e.toFixed(2)}`}function Ze(e,t){if(t===`USD`)return b(e);if(!Number.isFinite(e))return`—`;if(e===0)return`0 ${t}`;let n=Math.abs(e);return`${n<.01?e.toFixed(4):n<1e3?e.toFixed(2):Math.round(e).toLocaleString()} ${t}`}function Qe(e){if(!e)return!1;let t=e.trim().toLowerCase();return t===`<synthetic>`||/(^|[./:@])(anthropic\.)?claude-/.test(t)}function $e(e){return e>=10?`${Math.round(e)}×`:`${(Math.round(e*10)/10).toFixed(1)}×`}function x(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(Math.round(e))}function et(e,t){let n=t!=null&&t>0?` — ${x(t)} of it in subagents`:``;return`This session has used ${x(e)} tokens so far${n}.`}function tt(e){return e!=null&&e>0?x(e):null}function nt(e){return e!=null&&Number.isFinite(e)&&e>0?Xe(e):null}function rt(e,t){return e==null||t==null||!Number.isFinite(e)||!(e>0)||!Number.isFinite(t)||t<5||t>100?null:e/t}function it(e,t){if(e==null||t==null||!(e>0)||!(t>0))return null;let n=e/t;return Number.isFinite(n)?n<.001?`<0.001% of week`:`≈${n<1?String(Number(n.toPrecision(1))):n<10?n.toFixed(1):String(Math.round(n))}% of week`:null}function at(e){let t=e=>e!=null&&Number.isFinite(e)&&e>0,n=t(e.agentsRunning)?e.agentsRunning:0,r=t(e.agentCostUsd)?e.agentCostUsd:0,i=t=>{let n=it(t,e.usdPerWeekPct);return n?` (${n})`:``},a=t(e.costUsd)?`${b(e.costUsd+r)} this prompt${n?` so far`:``}${i(e.costUsd+r)}`:null,o=n?`${n} subagent${n===1?``:`s`} still running`:null,s=a&&r?`${b(r)} of it in subagents${o?` · ${o}`:``}`:o,c=e.cumAgentCostUsd!=null&&Number.isFinite(e.cumAgentCostUsd),l=t(e.cumCostUsd)?e.cumCostUsd+(c?e.cumAgentCostUsd:0):0,u=l>0?`${b(l)} session so far${i(l)}`:null,d=t(e.ctxTok)?`${x(e.ctxTok)} context`:null;if(!a&&!u&&!d&&!s)return null;let f=!!e.agents&&a!=null&&!r&&!n,p=!!e.agentsSoFar&&u!=null&&!c,m=t(e.agentUnpricedTok)?`, ${x(e.agentUnpricedTok)} subagent tokens have no published rate`:``,h=typeof e.weekIncl==`string`&&e.weekIncl.trim()?` (${e.weekIncl.trim()})`:``,g=(a||u)&&it(1,e.usdPerWeekPct)?`; % of week estimated from this desktop's spend${h} against the weekly limit reading`:``;return{turn:a,agents:s,total:u,ctx:d,note:a||u?`API list price${f||p?`, subagents not included`:``}${m}${g}`:null}}function ot(e){if(!e)return null;let t=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:0,n=[[t(e.input),`in`],[t(e.output),`out`],[t(e.cacheRead),`cache read`],[t(e.cacheWrite),`cache write`]],r=n.reduce((e,[t])=>e+t,0);if(!(r>0))return null;let i=n.filter(([e])=>e>0).map(([e,t])=>`${x(e)} ${t}`).join(` · `);return`${x(r)} tokens — ${i}`}function st(e){if(!e||!(e.tok>0))return null;let t=`Next prompt re-reads ${x(e.tok)} of context`;return e.multiple==null||e.baseTok==null?`${t}.`:e.multiple<1.15?`${t} — about what a fresh session here starts with (${x(e.baseTok)}).`:`${t} — ${$e(e.multiple)} what a fresh session here starts with (${x(e.baseTok)}).`}var ct=`Why dollars on a subscription?`,lt=`Your plan's session and weekly limits don't count every token the same: on one model a cache read costs a hundredth of an output token. Adding tokens up treats them as equal, so the total says little about how much of your limit a prompt used. Pricing each kind at Anthropic's API list price weighs it by its own rate — the one number you can compare across prompts, sessions and models. It is not a bill.`,ut=`Why only the last prompt in the CLI view?`,dt=`The reader folds this card under every prompt — tap a line to open it, and scroll up for older ones. The CLI view has no scroll-back of its own to hang a card on, so it keeps only the last prompt's, pinned under the terminal at a fixed height: opening or updating it never resizes the screen, which would make the CLI redraw. Same figures, same card; the newest one remembers open or folded in both.`;function ft(e,t,n){let r=t!=null&&t>0?` — ${b(t)} of it in subagents`:``,i=n!=null&&n>0?` ${x(n)} tokens ran on a model with no published rate and are not in it.`:``;return`At list prices that is ${b(e)} so far${r} — an estimate of what the API would have charged, not what a subscription costs.${i}`}function pt(e,t,n=2){if(t==null||t<=0)return null;let r=e-t;if(r<=0)return null;let i=t*(n-Ue)/(Ue*r);if(!Number.isFinite(i))return null;let a=Math.max(1,Math.ceil(i));return a>24?null:a}function mt(e,t){return e==null||t!=null&&t<6?`fresh`:e>=9?`steep`:e>=5?`heavy`:e>=2.5?`warm`:`fresh`}function ht(e,t){return e==null||t==null||e<=0||t*2<=e?null:`Most of what this session spent — ${x(t)} of ${x(e)} — was its subagents, and compacting or a new session lowers only what the next turn here costs. Each agent re-reads its own growing window on every step, so agents with a narrower task that finish sooner are what brings that down.`}var gt=5e5;function _t(e,t,n,r=gt){return e==null||!(e>=r)||t!=null&&n!=null&&n-t>6e5?null:`A subagent is re-reading ${x(e)} on every step — agents with a narrower task that finish sooner cost less.`}function vt(e,t){return`A subagent${t?` (${t})`:``} was re-reading ${x(e)} of context on every step. If it is still running, stop it with TaskStop, keep what it already returned, and re-spawn the rest as narrower tasks: one work package per agent, model set explicitly, each briefed to return before about 200k of context. If it already finished, apply that to the next agents you spawn.`}function yt(e){let{tok:t,baseTok:n,turns:r,spentTok:i}=e,a=e.cacheCold??null,o=e.usageTok??null,s=e.agentTok??null,c=n!=null&&n>0&&t>0?t/n:null,l=mt(c,r),u=l===`fresh`?null:pt(t,n),d=o!=null&&o>0?` ${et(o,s)}`:i!=null&&i>0?` This conversation has carried ${x(i)} tokens in total.`:``,f=a?` Nothing has run here for hours: the cached prefix has very likely expired, so the next turn re-WRITES these ${x(t)} rather than re-reading them, which is the expensive direction by an order of magnitude.`:``,p=a?` Even a quick question pays that re-write first, so there is no cheap turn left here.`:` A quick question is still cheaper here.`;if(l===`fresh`){let e=n==null?`Each turn re-reads ${x(t)} of context. How that compares with a fresh session here is not known — this conversation's log is longer than the host reads in one go, so there is no first reading to measure against.`:`Each turn re-reads ${x(t)} of context — about what a fresh session in this repo costs.${d}`,a=n==null?f:``;return{level:l,tok:t,baseTok:n,multiple:c,breakEven:u,spentTok:i,usageTok:o,agentTok:s,turns:r,chip:null,note:e+a,advice:bt(a?`New work belongs in a fresh session; this window has to be paid for again before it can answer anything.`:null,ht(o,s))}}let m=$e(c);return{level:l,tok:t,baseTok:n,multiple:c,breakEven:u,spentTok:i,usageTok:o,agentTok:s,turns:r,chip:m,note:`Each turn re-reads ${x(t)} of context — ${m} what a fresh session in this repo costs (${x(n)}).${d}${f}`,advice:bt(u==null?l===`steep`?`New work that does not need what is already in this window would be markedly cheaper in a new session.${p}`:a?`New work that does not need what is already in this window would be cheaper in a new session.${p}`:null:`More than ${u} ${u===1?`turn`:`turns`} of work that does not need what is already in this window would be cheaper in a new session.${p}`,ht(o,s))}}function bt(e,t){return e&&t?`${e} ${t}`:e??t}function xt(e){return e?`Compacting is the other door: it keeps this conversation and re-reads a summary of it instead of all of it, so work that still needs what is here stays here. A new session keeps nothing.`:null}function St(e,t,n){return{baseTok:t?void 0:e[0]?.tok,...n==null?null:{turns:n},spentTok:e.reduce((e,t)=>e+t.tok,0)}}function Ct(e,t,n,r,i){if(!e.length)return null;let a=e[e.length-1].tok;if(!(a>0))return null;let o=St(e,t,n);return yt({tok:a,baseTok:o.baseTok??null,turns:o.turns??null,spentTok:o.spentTok,usageTok:r?.usageTok??null,agentTok:r?.agentTok??null,cacheCold:wt(i)})}function wt(e){return e?Ve(e.lastTurnAt,e.now,e.turnActive):null}function Tt(e,t){if(!e||!e.pts.length)return null;let n=e.pts[e.pts.length-1];return n>0?yt({tok:n,baseTok:e.baseTok??null,turns:e.turns??null,spentTok:e.spentTok??null,usageTok:e.usageTok??null,agentTok:e.agentTok??null,cacheCold:wt(t)}):null}function Et(e){let t=(e,t)=>{let n=(e??0)+(t??0);return n>0?n:null};return{count:e.auto.count+e.manual.count,manual:e.manual.count,unmeasured:e.unmeasured,shedTok:e.auto.shedTok+e.manual.shedTok,savedTok:e.auto.savedTok+e.manual.savedTok,savedUsd:t(e.auto.savedUsd,e.manual.savedUsd),rebuildTok:e.auto.rebuildTok+e.manual.rebuildTok,rebuildUsd:t(e.auto.rebuildUsd,e.manual.rebuildUsd)}}function Dt(e){let t=e.count;return t<=0?null:(t===1?e.manual===1?`One compaction, and you asked for it.`:`One compaction, the CLI's own.`:e.manual===0?`${t} compactions, none of them yours.`:e.manual===t?`${t} compactions, all of them yours.`:`${t} compactions — ${e.manual} you asked for, ${t-e.manual} the CLI's own.`)+(e.shedTok>0?` ${t===1?`It took`:`Together they took`} ${x(e.shedTok)} out of the window.`:``)}function Ot(e){return e.unmeasured<=0?null:`${e.unmeasured===1?`One more compaction is`:`${e.unmeasured} more compactions are`} in none of these figures — the log did not record both sides of the drop, so there is nothing to measure them from.`}function kt(e){let t=[];return e.savedTok>0&&t.push(`saved ${x(e.savedTok)}${e.savedUsd==null?``:` · ${b(e.savedUsd)}`}`),e.rebuildTok>0&&t.push(`cost ${x(e.rebuildTok)}${e.rebuildUsd==null?``:` · ${b(e.rebuildUsd)}`}`),t.length?t:[`nothing back yet`]}function At(e){if(e.savedTok<=0)return null;let t=e.savedUsd==null?``:`, worth ${b(e.savedUsd)} at list prices — the one figure here that was never actually spent`;return`Every request since has carried that much less: ${x(e.savedTok)} tokens not re-sent${t}.`}function jt(e){return e.count<=0||e.savedTok>0?null:`No turn has run since, so nothing has been saved back yet — the saving is what the next requests will not have to carry.`}function Mt(e){if(e.rebuildTok<=0)return null;let t=e.rebuildUsd==null?``:` (${b(e.rebuildUsd)})`;return`Rebuilding the window afterwards wrote ${x(e.rebuildTok)} tokens${t} — real spend, already counted in this session's total. The summarising request itself is not in the CLI's log, so it is in neither figure.`}function Nt(e){if(e.savedUsd==null||e.rebuildUsd==null||e.rebuildUsd<=0)return null;let t=e.savedUsd/e.rebuildUsd;return t>=1?`${$e(t)} what it cost.`:`That is ${b(e.rebuildUsd-e.savedUsd)} more than it has saved back so far.`}function Pt(e,t,n){if(!(e.savedTok>0)||!(e.shedTok>0)||!(n&&n>0)||!(t&&t>0))return null;let r=t+e.shedTok;return r<=n?null:`Uncompacted it would be carrying ${x(r)} — past the ${x(n)} window, so those turns could not have run at all.`}function Ft(){return`The saving prices those tokens as cache reads — the cheapest they could have been; a conversation resumed after the cache expired re-writes its window at up to twenty times that rate. The cost counts the whole first write after each boundary, part of which the next turn would have paid anyway. Both err against compacting looking worthwhile.`}function It(e,t){return e===`manual`?t===1?`you typed /compact`:`you typed /compact ${t}×`:t===1?`the CLI compacted`:`the CLI compacted ${t}×`}function Lt(e,t){if(!e||e.count<=0||e.tok<=0)return null;let n=e.count,r=t===`session`?`${n===1?`One turn`:`${n} turns`} here `:`${n===1?`One request`:`${n} requests`} across this desktop `,i=e.premiumUsd!=null&&e.premiumUsd>0?` That is ${b(e.premiumUsd)} more than re-reading them would have cost at list prices${e.usd!=null&&e.usd>0?`, out of ${b(e.usd)} for the writes themselves`:``}.`:``;return`${r}came back to a cache that had expired and re-WROTE ${x(e.tok)} tokens instead of re-reading them.${i}`}function S(){return{input:0,output:0,cacheRead:0,cacheWrite:0,cacheWrite1h:0,turns:0}}function C(e,t){return e.input+=t.input??0,e.output+=t.output??0,e.cacheRead+=t.cacheRead??0,e.cacheWrite+=t.cacheWrite??0,e.cacheWrite1h+=t.cacheWrite1h??0,e.turns+=t.turns??0,e}function w(e){return e.input+e.output+e.cacheRead+e.cacheWrite}var Rt=[{id:`input`,slot:0,name:`Input`,what:`Fresh prompt tokens — the part of each request that was not already in the cache. The smallest of the four by a wide margin, and the one closest to “what I typed”.`},{id:`output`,slot:1,name:`Output`,what:`Everything the model generated: replies, tool calls, thinking. The number that tracks how much work came back.`},{id:`cacheRead`,slot:2,name:`Cache read`,what:`Context served out of the prompt cache. Usually the overwhelming majority — every turn re-reads the whole conversation — which is why a single “tokens used” figure is mostly this.`},{id:`cacheWrite`,slot:3,name:`Cache write`,what:`Context written into the cache so later turns can read it back. Rises when a conversation grows or is compacted.`}];function zt(e){return{input:e[0],output:e[1],cacheRead:e[2],cacheWrite:e[3],cacheWrite1h:0,turns:1}}function Bt(e){let t=e.cacheRead+e.cacheWrite+e.input;return t>0?e.cacheRead/t*100:null}function Vt(e){return e.turns>0?w(e)/e.turns:null}var Ht=2e5;function Ut(e){if(e.cacheWrite<=0)return null;let t=Math.min(e.cacheWrite1h,e.cacheWrite);return((e.cacheWrite-t)*We+t*2)/e.cacheWrite/(1-Ue)}function Wt(e,t=`corpus`){let n=Bt(e);if(n==null)return null;let r=Ut(e),i=e.cacheWrite>0?e.cacheRead/e.cacheWrite:null,a=e.cacheRead+e.cacheWrite+e.input,o=e.turns>0?a/e.turns:null,s=o==null?null:o>=2e5?`heavy`:o>=1e5?`ordinary`:`lean`,c=i!=null&&r!=null&&i<r,l=c?`Cache reads are ${Math.round(n)}% of everything sent in, but each token written into the cache was read back only ${i.toFixed(1)}× — under the ${r.toFixed(1)}× a write has to earn back before it beats paying full input price. That is sessions ending or being invalidated before their context is re-read, not a context that is too big.`:i==null?`Cache reads are ${Math.round(n)}% of everything sent in. A cache read bills at a tenth of the input rate, so a high share is the cheap shape of the same traffic rather than a symptom.`:`Cache reads are ${Math.round(n)}% of everything sent in, and each token written into the cache was read back ${i>=10?Math.round(i):i.toFixed(1)}× — well past the ${r.toFixed(1)}× that makes a write worth writing. A high share is the cheap shape of this traffic, not a symptom: a cache read bills at a tenth of the input rate, and the only way to lower the share is to re-send the same context at full price.`,u=`the ~${T(Ht)} mark where this desktop's own logs found the spend concentrating (the conversations past 200k were 1.4% of them and 76% of every token)`,d=t===`session`?`A mean is not a ceiling: this is every request this conversation logged, the small early ones averaged in with whatever the window grew to. The curve above is where it actually went.`:`A mean is not a ceiling: the long conversations are averaged in with the short ones, and only the per-session reading on the context screen can name one.`;return{sharePct:n,reuse:i,payback:r,perTurnCtx:o,posture:s,cacheNote:l,contextNote:o==null?null:s===`heavy`?`The mean turn carried ${T(o)} of context — past ${u}. What makes a turn expensive is the size of the window, not the share of it served from cache. ${d}`:s===`ordinary`?`The mean turn carried ${T(o)} of context, just under ${u}. ${d}`:`The mean turn carried ${T(o)} of context, well under ${u}${t===`session`?``:` — long sessions are not the norm here`}. ${d}`,advice:t===`session`?null:c?`Worth a look at what ends sessions after a turn or two, or at anything rewriting the start of the prompt between turns.`:s===`heavy`?`The lever is the length of a conversation, not the cache: work that does not need what is already in the window is cheaper in a new session. The per-session reading on the context screen names the ones that grew.`:null}}function Gt(e,t,n=`repos`){let r=[...e].sort((e,t)=>w(t)-w(e));if(r.length<=t+1)return r;let i=r.slice(0,t),a=r.slice(t),o=n.replace(/s$/,``),s={key:`__other__`,label:`Other (${a.length} ${a.length===1?o:n})`,...S(),cost:v()};for(let e of a)C(s,e),y(s.cost,e.cost);return[...i,s]}function Kt(e){if(!Number.isFinite(e)||e<=0)return`0%`;let t=e*100;return t<1?`<1%`:t<100&&Math.round(t)===100?`>99%`:`${Math.round(t)}%`}function qt(e){let t=0;return e.map(e=>(t+=e.total,{...e,sum:t}))}function Jt(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,(n||1)-1,r||1).getTime()}function Yt(e){let[t,n,r]=e.slice(0,10).split(`-`).map(Number),i=Number(e.slice(11,13));return new Date(t,(n||1)-1,r||1,Number.isFinite(i)?i:0).getTime()}function T(e){if(!Number.isFinite(e))return`?`;let t=Math.abs(e),n=t>=1e9?[`B`,1e9]:t>=1e6?[`M`,1e6]:t>=1e3?[`k`,1e3]:null;if(!n)return String(Math.round(e));let r=e/n[1];return`${r.toFixed(+(Math.abs(r)<100)).replace(/\.0$/,``)}${n[0]}`}function Xt(e){return Math.round(e).toLocaleString()}var Zt=[`tok`,`usd`,`sessionPct`,`weeklyPct`,`native`],E=e=>e===`sessionPct`||e===`weeklyPct`;function Qt(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.unit!=`string`||!Zt.includes(t.unit))return null;let n=t.unit,r=t.max;if(typeof r!=`number`||!Number.isFinite(r)||!(r>0)||(n===`sessionPct`||n===`weeklyPct`)&&r>100)return null;let i={};if(n===`native`){let e=typeof t.nativeUnit==`string`?t.nativeUnit.trim():``;if(!e||e.length>32)return null;i={nativeUnit:e}}return t.hard===!0?{unit:n,max:r,interrupt:!0,hard:!0,...i}:{unit:n,max:r,interrupt:t.interrupt!==!1,...i}}function $t(e){let t={source:!0};return!e||le(e).length||(e.tok!=null&&(t.usageTok=e.tok+(e.agentTok??0),e.agentTok!=null&&(t.agentTok=e.agentTok)),e.usd!=null&&(t.costUsd=e.usd+(e.agentUsd??0),e.agentUsd!=null&&(t.agentCostUsd=e.agentUsd)),e.native&&(t.native={amount:e.native.amount,unit:e.native.unit,...e.native.agentAmount==null?{}:{agentAmount:e.native.agentAmount}})),t}function en(e){return e.sourceSpend?$t(e.sourceSpend):e.contextSpark??null}function tn(e,t,n,r,i){let a=e=>({value:null,agent:null,why:e});if(!t)return a(`noSpark`);if(e===`native`){let e=t.native;return!e||!i||e.unit.trim()!==i?a(`unstated`):{value:e.amount+(e.agentAmount??0),agent:e.agentAmount??null}}if(t.source&&E(e))return a(`notClaude`);if(e===`tok`)return t.usageTok==null?a(t.source?`unstated`:`noSpark`):{value:t.usageTok,agent:t.agentTok??null};if(t.costUsd==null)return a(t.source?`unstated`:`unpriced`);if(e===`usd`)return{value:t.costUsd,agent:t.agentCostUsd??null};if(!n)return a(`noReading`);if(r-n.checkedAt>15e5)return a(`stale`);let o=e===`sessionPct`?n.sessionUsdPerPct:n.weeklyUsdPerPct;return o==null||!(o>0)?a(`noCalibration`):{value:t.costUsd/o,agent:t.agentCostUsd==null?null:t.agentCostUsd/o}}function nn(e,t,n,r,i=!0){let a=tn(e.unit,t,n,r,e.nativeUnit),o={unit:e.unit,max:e.max,spent:a.value,agentShare:a.agent,...e.nativeUnit?{nativeUnit:e.nativeUnit}:{}};return a.value==null?{...o,state:`unknown`,why:a.why}:i?{...o,state:a.value>=e.max?`over`:`ok`}:{...o,state:`unknown`,why:`notRunning`}}function rn(e){return e.budget?.verdict.state===`over`}function an(e){return e<10?e.toFixed(1).replace(/\.0$/,``):String(Math.round(e))}function on(e){return Number.isInteger(e)?T(e):String(Math.round(e*10)/10)}function D(e,t,n){switch(e){case`tok`:return`${T(t)} tokens`;case`usd`:return b(t);case`native`:return`${on(t)} ${n??`of the backend's own unit`}`;default:return`≈${an(t)}% of ${e===`sessionPct`?`the 5-hour window`:`the week`}`}}function sn(e){switch(e.unit){case`tok`:return`≤ ${T(e.max)} tokens`;case`usd`:return`≤ ${b(e.max)}`;case`sessionPct`:return`≤ ${an(e.max)}% of this 5-hour window`;case`weeklyPct`:return`≤ ${an(e.max)}% of this week`;case`native`:return`≤ ${D(`native`,e.max,e.nativeUnit)}`}}function cn(e,t,n,r){let i=` — nothing is held`;switch(e){case`noSpark`:return`can't tell: this session has not logged a turn yet${i}`;case`unpriced`:return`can't tell: no list price covers this session's model${i}`;case`noReading`:return`can't tell: there is no usage reading to convert dollars into window percent${i}`;case`stale`:return t!=null&&t>0?`can't tell: the usage reading is ${Math.round(t/6e4)} min old${i}`:`can't tell: the usage reading is too old${i}`;case`noCalibration`:return`can't tell: this window has not run enough here to say what one percent costs${i}`;case`notRunning`:return`can't tell: the session is not running${i}`;case`unstated`:return`can't tell: this session's backend has not stated what it spent${n===`tok`?` in tokens`:n===`usd`?` in dollars`:n===`native`?` in ${r??`its own unit`}`:``}${i}`;case`notClaude`:return`can't tell: ${ln}, which this session's backend does not spend from${i}`}}var ln=`the 5-hour and weekly windows are claude's account`;function un(e){return`No ≈% of a window here: ${ln}, and ${e} does not spend from it.`}var dn=`≈, from this desktop's spend — other use of the account makes it read high`;function fn(e){if(e.state===`unknown`||e.spent==null)return cn(e.why??`noSpark`,void 0,e.unit,e.nativeUnit);let t=e.agentShare!=null&&e.agentShare>0?`, ${D(e.unit,e.agentShare,e.nativeUnit)} of it in subagents`:``,n=E(e.unit)?D(e.unit,e.max).replace(`≈`,``):D(e.unit,e.max,e.nativeUnit),r=E(e.unit)?` (${dn})`:``;return`${D(e.unit,e.spent,e.nativeUnit)} so far${t} — ${e.state===`over`?`over`:`within`} the ${n} budget${r}`}function pn(e){return e.hard?`Hard budget: queued and scheduled sends to this session are held, a send you make yourself asks you first, and every turn you did not send yourself is stopped with one Esc — until you raise or clear the budget.`:`Sends to this session are held until you raise or clear the budget — an explicit send, an answer to a question and an upload still go.`}function mn(e){let t=t=>{switch(e.unit){case`tok`:return T(t);case`usd`:return b(t);case`native`:return on(t);default:return`${E(e.unit)?`≈`:``}${an(t)}%`}},n=e.unit===`native`&&e.nativeUnit?` ${e.nativeUnit}`:``;return`${e.spent==null?`?`:t(e.spent)} / ${E(e.unit)?t(e.max).replace(`≈`,``):t(e.max)}${n}`}var hn=216e5,gn=[`low`,`medium`,`high`,`xhigh`,`max`],_n=[`default`,`plan`,`acceptEdits`,`auto`,`dontAsk`,`bypassPermissions`],vn=/^[\w.:/@[\]+-]{1,120}$/,yn=/^[\w.-]{1,64}$/;function bn(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n={},r=typeof t.model==`string`?t.model.trim():``;vn.test(r)&&(n.model=r),gn.includes(t.effort)&&(n.effort=t.effort),_n.includes(t.permissionMode)&&(n.permissionMode=t.permissionMode),t.remoteControlled===!0&&(n.remoteControlled=!0);let i=typeof t.backend==`string`?t.backend.trim():``;return yn.test(i)&&(n.backend=i),Object.keys(n).length?n:void 0}function xn(e){let t=e.trim();return!t||t.startsWith(`/`)||t.includes(`\\`)||t.includes(`\0`)?!1:!t.split(`/`).some(e=>e===`..`||e===`.`)}function Sn(e){let t=(e.missing?.length?e.missing:e.needs).map(e=>e.split(`/`).pop()||e);switch(e.state){case`waiting`:return t.length===1?`waiting for ${t[0]} to finish uploading`:`waiting for ${t.length} files to finish uploading`;case`opening`:return`opening the session…`;case`done`:return`opened`;case`canceled`:return e.reason||`called off`;default:return e.reason||`did not open`}}var O={name:`waterplane`,displayName:`waterplane`,slug:`waterplane`,envPrefix:`WATERPLANE_`,configDirName:`waterplane`,stateDirName:`.waterplane`,sharedDirName:`.waterplane-shared`,storagePrefix:`waterplane.`,cacheName:`waterplane-cache`,wsProtocol:`waterplane`,cookie:`waterplane_auth`,pairScheme:`waterplane`,launchdLabel:`dev.waterplane.host`,appId:`dev.waterplane.app`,tmuxServer:`waterplane`,pluginManifest:`waterplane-plugin.json`,skillName:`waterplane`,tagline:`The CLI wasn't built for your phone. waterplane lands it anyway.`,domain:`waterplane.dev`,githubOrg:`waterplane-dev`,promptAliases:[`WP`,`wp`],dictationTerms:[`waterplane`]},k=[{name:`USMC`,slug:`usmc`,envPrefix:`USMC_`,configDirName:`usmc`,stateDirName:`.usmc`,storagePrefix:`usmc.`,cacheName:`usmc-cache`,wsProtocol:`usmc`,cookie:`usmc_auth`,pairScheme:`usmc`,launchdLabel:`com.usmc.host`,appId:`dev.unsuck.amc`,tmuxServer:`usmc`,pluginManifest:`usmc-plugin.json`,skillName:`usmc`,words:[`usmc`,`unsuck`,`un-suck`]}];[...new Set([O.name.toLowerCase(),O.slug.toLowerCase(),...k.flatMap(e=>e.words)])];var A=e=>`${O.storagePrefix}${e}`,Cn=e=>`${O.envPrefix}${e}`,wn=`[${O.slug}]`,Tn=k.map(e=>e.stateDirName),En=e=>`${O.stateDirName}/${e}`,Dn=e=>`${O.sharedDirName}/${e}`,On=/^[A-Za-z][A-Za-z0-9_]{0,31}$/,kn=/\{\{\s*([A-Za-z][A-Za-z0-9_]{0,31})\s*\}\}/g,j=e=>typeof e==`string`?e:``;function M(e){return j(e).replace(/[\x00-\x1f\x7f]/g,` `).trim().slice(0,512)}function An(e){let t=e&&typeof e==`object`?e:{},n=j(t.id).trim();if(!On.test(n))return null;let r=Array.isArray(t.options)?t.options.map(M).filter(e=>!!e).slice(0,200):[],i=j(t.optionsCmd).trim().slice(0,500),a=t.kind===`choice`&&(r.length||i)?`choice`:`text`,o={id:n,kind:a},s=j(t.label).trim().slice(0,60);s&&(o.label=s),a===`choice`&&(r.length&&(o.options=r),i&&(o.optionsCmd=i));let c=M(t.default);c&&(o.default=c);let l=j(t.hint).trim().slice(0,200);return l&&(o.hint=l),o}function jn(e){if(!Array.isArray(e))return;let t=[],n=new Set;for(let r of e){if(t.length>=8)break;let e=An(r);e&&!n.has(e.id)&&(n.add(e.id),t.push(e))}return t.length?t:void 0}var Mn=/[;&|`$()<>\\"'\n\r]/;function Nn(e,t){return Fn(e).filter(e=>typeof t[e]==`string`&&Mn.test(t[e]))}function Pn(e){return e.length?`the value for ${e.map(e=>`“${e}”`).join(`, `)} contains a shell character (; & | \` $ ( ) < > \\ quotes) and would be run as part of the command — change it, or have the command read $${Ln(e[0])} instead`:``}function Fn(e){let t=[];for(let n of j(e).matchAll(kn))t.includes(n[1])||t.push(n[1]);return t}function In(e){let t=new Set((e.params??[]).map(e=>e.id));return[...Fn(e.cmd??``),...Fn(e.dir??``)].filter((e,n,r)=>r.indexOf(e)===n&&!t.has(e))}function Ln(e){return Cn(`PARAM_${e.toUpperCase()}`)}function Rn(e){return e.label||e.id}function zn(e,t){let n={},r=[];for(let i of e??[]){let e=M(t?.[i.id])||M(i.default);e?n[i.id]=e:r.push(i)}return{values:n,missing:r}}function Bn(e){let t=e.map(Rn);return t.length?`needs a value for ${t.length===1?`“${t[0]}”`:t.map(e=>`“${e}”`).join(`, `)}`:``}function Vn(e){return Object.entries(e??{}).filter(([,e])=>!!e).map(([e,t])=>`${e}=${t}`).join(` · `)}function Hn(e,t){let n=Vn(t);return n?`${e} · ${n}`:e}var Un=(e,t,n,r)=>{let i=Math.round(Number(e));return Number.isFinite(i)?Math.min(n,Math.max(t,i)):r};function Wn(e){if(!e||typeof e!=`object`)return;let t=e=>{let t=Math.round(Number(e));return Number.isFinite(t)&&t>=0&&t<=1439?t:-1},n=t(e.from),r=t(e.to);if(!(n<0||r<0||n===r))return{from:n,to:r}}function Gn(e){let t=e&&typeof e==`object`?e:{},n=Un(t.offsetMin??0,-1440,1440,0),r=Wn(t.hours),i=typeof t.tz==`string`&&t.tz.trim()&&l(t.tz.trim(),Date.now())!=null?t.tz.trim():void 0,a=r?i?{hours:r,tz:i}:{hours:r}:{};if(t.kind===`window`){let e=t.edge===`after`?`after`:`before`,r=t.minPctLeft,i=r==null||r===``?void 0:Un(r,0,100,0),o=t.window===`weekly`?`weekly`:`session`,s=(t.guardWindow===`weekly`||t.guardWindow===`session`)&&t.guardWindow!==o?t.guardWindow:void 0,c=i!=null&&(e===`before`||s!=null);return{kind:`window`,window:o,...typeof t.periodId==`string`&&t.periodId&&t.periodId!==`session`&&t.periodId!==`weekly`?{periodId:t.periodId}:{},edge:e,offsetMin:e===`before`?Math.min(0,n):Math.max(0,n),...c?{minPctLeft:i}:{},...s?{guardWindow:s}:{},...t.oneShot===!0?{oneShot:!0}:{},...a}}if(t.kind===`once`){let e=Number(t.at);return{kind:`once`,at:Number.isFinite(e)?e:0,offsetMin:n,...a}}let o=Array.isArray(t.days)?t.days.map(e=>Un(e,0,6,0)):[];return{kind:`weekly`,days:[...new Set(o)].sort((e,t)=>e-t),hour:Un(t.hour??9,0,23,9),minute:Un(t.minute??0,0,59,0),tz:i,offsetMin:n,...t.oneShot===!0?{oneShot:!0}:{},...a}}var Kn=36e5,qn={soon:`within the hour`,day:`in 24h`,twoDay:`in 2d`,week:`this week`,later:`later`,unarmed:`not armed`};function Jn(e,t){if(e==null)return`unarmed`;let n=e-t;return n<=Kn?`soon`:n<=24*Kn?`day`:n<=48*Kn?`twoDay`:n<=168*Kn?`week`:`later`}var Yn=[`soon`,`day`,`twoDay`,`week`,`later`,`unarmed`];function Xn(e){return Yn.find(t=>e[t]>0)??null}function Zn(e){let t=Yn.filter(e=>e!==`unarmed`).map(t=>({n:e[t],label:qn[t]})).filter(e=>e.n>0);if(!t.length)return e.unarmed>0?`${e.unarmed} ${qn.unarmed}`:null;let[n,r]=t;return r?`${n.n} ${n.label} · ${r.n} more ${r.label}`:`${n.n} ${n.label}`}var Qn=e=>new Date(e).toLocaleString(void 0,{weekday:`short`,day:`numeric`,month:`short`,hour:`2-digit`,minute:`2-digit`});function $n(e,t=Date.now()){let n=e-t;if(n<=0)return`due now`;let r=Math.round(n/6e4);if(r<60)return`in ${r}m`;let i=Math.floor(r/60),a=r%60;if(i<24)return`in ${i}h${a?` ${a}m`:``}`;let o=Math.floor(i/24),s=i%24;return`in ${o}d${s?` ${s}h`:``}`}function er(e,t){let n=e?`after “${e}”`:`after the item before it`;return t?`${n}, only if it worked`:n}function tr(e,t){return e.kind===`now`?`now`:e.kind===`idle`?`when it's free`:e.kind===`after`?er(e.title,e.onlyIfOk):t==null?e.rule.kind===`window`?`${se(e.rule)} — armed once the host reads the window`:`never — the time it resolves to has passed`:`${Qn(t)} · ${$n(t)}`}var nr=6e4,rr=864e5,ir=2e3,ar=6e4;function or(e){return Math.min(ar,ir*2**Math.max(0,e-1))}var sr=6e4,cr=3e5,lr=18e5;function ur(e){return Math.min(lr,cr*2**Math.max(0,e-1))}function dr(e){return!!e.stalled||!e.responded||!e.socketOpen}function fr(e,t,n){return e.map(e=>e.mode===`upload`&&e.status!==`failed`&&e.sessionId!==n&&e.upload&&t.includes(e.upload.relPath)?{...e,sessionId:n}:e)}function pr(e,t){return e.filter(e=>e.mode===`upload`&&e.status===`failed`&&e.upload&&t.includes(e.upload.relPath)).map(e=>e.upload.relPath)}function mr(e,t){let n=e.findIndex(e=>e.sessionId===t&&e.status===`queued`&&!e.answer);return n<0?e.length:n}function hr(e){return gr(e)!==null}function gr(e){return e.limitBlocked?`limit`:e.awaitingInput||e.promptKind&&e.promptKind!==`trust`?`awaitingAnswer`:e.turnActive?`sessionBusy`:null}function _r(e,t){let n=new Set(t.inflight??[]),r=new Set(t.busyLanes??[]),i=new Set(t.busySerial??[]),a=new Set(t.goneLanes??[]),o=[],s=[],c=[],l=[],u=(e,t)=>{l.push({ackId:e.ackId,sessionId:e.sessionId,reason:t})},d=new Set;for(let t of e)(t.status===`pending`||n.has(t.ackId))&&(d.add(t.sessionId),t.serial&&i.add(t.serial));for(let l of e){if(l.status!==`queued`)continue;if(n.has(l.ackId)){u(l,`inflight`);continue}if(l.pendingCreate){d.add(l.sessionId),u(l,`pendingCreate`);continue}if((l.mode??`input`)===`input`&&a.has(l.sessionId)&&!l.cwd){u(l,`sessionGone`);continue}if(l.holdUntilIdle&&r.has(l.sessionId)){d.add(l.sessionId),u(l,`held`);continue}let e=!!t.budgetBlocked&&!l.armed&&!l.answer&&l.mode!==`upload`,f=!!t.budgetHeldLanes?.has(l.sessionId)&&!l.armed&&!l.answer&&l.mode!==`upload`,p=!!l.serial&&i.has(l.serial);if(l.retryAt!=null&&l.retryAt>t.now){d.add(l.sessionId),u(l,`backoff`);continue}let m=l.firstTryAt==null?1/0:t.now-l.firstTryAt;(l.attempts??0)>=t.maxAttempts&&m>=(t.minTryMs??0)?c.push({ackId:l.ackId,reason:`delivery kept failing`}):e?(d.add(l.sessionId),u(l,`budget`)):f?(d.add(l.sessionId),u(l,`sessionBudget`)):p?(d.add(l.sessionId),u(l,`serial`)):d.has(l.sessionId)?u(l,`lane`):(d.add(l.sessionId),l.serial&&i.add(l.serial),l.holdUntilIdle&&s.push(l),o.push(l))}return{send:o,expire:c,release:s,blocked:l}}function vr(e,t,n,r,i){return e.map(e=>e.pendingCreate&&e.sessionId===t&&yr(e,i)?{...e,sessionId:n,pendingCreate:void 0,createAck:void 0,ts:r}:e)}function yr(e,t){return!t||!e.createAck||e.createAck===t}function br(e,t,n){return e.filter(e=>e.pendingCreate&&e.sessionId===t&&e.status===`queued`&&yr(e,n))}function xr(e,t){if(!t.length)return e.slice();let n=new Set(t.map(e=>e.ackId));return e.map(e=>n.has(e.ackId)?{...e,holdUntilIdle:void 0}:e)}function N(e){return`repo:${e}`}function Sr(e,t,n){let r=new Set;for(let t of e)t.running!==!1&&hr(t)&&r.add(N(t.cwd));let i=[];for(let a of t){let t=e.find(e=>e.id===a.sessionId);t&&t.turnStartedAt||n-a.at>=6e4||(r.add(a.group),i.push(a))}return{busy:r,watches:i}}function Cr(e,t){return(e.attempts??0)>0||e.armed?!0:t.autoSend&&!t.hold}function wr(e,t,n={}){let r=new Map,i=(e,t)=>{let n=r.get(e);n?t.sessionId&&n.some(e=>e.sessionId===t.sessionId)||n.push(t):r.set(e,[t])};for(let t of e){if(t.running===!1||n.automaticOnly&&!t.automatic)continue;let e=gr(t)??(n.automaticOnly&&t.asking?`awaitingAnswer`:null);e&&i(N(t.cwd),{sessionId:t.id,wall:e,...t.name?{name:t.name}:{}})}for(let n of t){let t=(n.sessionId?e.find(e=>e.id===n.sessionId):void 0)?.name||n.name;i(N(n.cwd),{...n.sessionId?{sessionId:n.sessionId}:{},wall:`starting`,...t?{name:t}:{}})}return r}var Tr=`one at a time in this repo — waiting for the session before it`,Er={sessionBusy:`working`,limit:`on a usage limit`,starting:`starting a queued job`},Dr=48,Or={awaitingAnswer:0,limit:1,sessionBusy:1,starting:2};function kr(e){if(e&&e.length)return[...e].sort((e,t)=>Or[e.wall]-Or[t.wall])[0]}function Ar(e){let t=kr(e);if(!e||!t)return Tr;let n=e.length>1?` +${e.length-1} more`:``;if(t.wall===`starting`&&!t.name&&!t.sessionId)return`one at a time in this repo — an automatic job is starting here${n}`;let r=(t.name??``).trim(),i=r.length>Dr?`${r.slice(0,47)}…`:r;return t.wall===`awaitingAnswer`?`one at a time in this repo — waiting for your answer in ${i?`'${i}'`:`the session before it`}${n}`:`one at a time in this repo — waiting for ${i?`'${i}'`:`another session`} (${Er[t.wall]})${n}`}function jr(e){switch(e){case`budget`:return`paused — the account is past your usage budget; it resumes when the window resets`;case`sessionBudget`:return`held — this session is over its own budget; raise or clear it to send`;case`sessionGone`:return`that session is gone — aim it at another session or at the repo's backlog`;case`gate`:return`queued — auto-send is off, tap Send now`;case`backoff`:return`a send just failed — retrying in a moment`;case`held`:return`held until the agent finishes this turn`;case`serial`:return Tr;case`pendingCreate`:return`waiting for its session to open`;case`lane`:return`another message for that session is going out first`;case`inflight`:return`a delivery for that session is already in flight`}}function Mr(e,t){if(!t.online)return`still offline — staying queued`;if(!t.queued||!e.length)return null;for(let n of[`gate`,`budget`,`sessionBudget`,`sessionGone`,`backoff`,`serial`,`held`,`pendingCreate`,`lane`,`inflight`])if(e.some(e=>e.reason===n))return n===`serial`&&t.serialText?t.serialText:jr(n);return null}function Nr(e){return e.status===`queued`&&e.mode!==`op`&&e.mode!==`upload`&&!e.answer}function Pr(e,t,n){return e.map(e=>{if(e.ackId!==t||!Nr(e))return e;let r=n.mode??(e.mode===`backlog`?`backlog`:`input`),i={...e,ackId:n.ackId,sessionId:n.sessionId,cwd:n.cwd,mode:r,attempts:0};return delete i.firstTryAt,r===`backlog`?(i.label=(e.text??``).slice(0,40),n.targetSessionId?i.targetSessionId=n.targetSessionId:delete i.targetSessionId):(delete i.label,delete i.fire,delete i.autoFire,delete i.targetSessionId),i})}function Fr(e,t,n){let r=e.findIndex(e=>e.ackId===t);if(r<0)return e.slice();let i=e[r],a=-1;for(let t=r+n;t>=0&&t<e.length;t+=n)if(e[t].sessionId===i.sessionId){a=t;break}if(a<0)return e.slice();let o=e.slice();return o[r]=o[a],o[a]=i,o}function P(e,t){return{kind:`wait`,reason:e,detail:Ir(e,t)}}function Ir(e,t){let n=t?.trim();if(n)return n;switch(e){case`offline`:return`still on this phone — it goes to the desktop the moment the link is back, in full, and nothing expires while it waits`;case`gate`:return`auto is off — run it by hand, or turn auto on`;case`budget`:return`paused — the account is past your usage budget; it resumes when the window resets`;case`sessionBudget`:return`held — this session is over its own budget; raise or clear it to let this go`;case`sessionBusy`:return`waiting — the session is working`;case`sessionGone`:return zr;case`awaitingAnswer`:return`waiting — the session is waiting for an answer`;case`limit`:return`the session is blocked on a usage limit — waiting for it to reopen`;case`filesMissing`:return`waiting for its files to finish uploading`;case`notYet`:return`not due yet`;case`serial`:return Tr;case`hostBusy`:return`waiting for the desktop to be free — something else is starting or running`;case`noSlot`:return`waiting for a free slot — every automatic session this desktop runs at a time is working`;case`localModel`:return`waiting for the local model — another local session is working, or the model is still loading`}}function Lr(e){return e.open.filter(e=>e.busy!==!1)}var Rr=[`offline`,`gate`,`budget`,`sessionBudget`,`sessionGone`,`limit`,`awaitingAnswer`,`notYet`,`filesMissing`,`serial`,`hostBusy`,`localModel`,`noSlot`,`sessionBusy`],zr=`that session is gone — aim it at another session, or at this repo's backlog`,Br=`every session this was aimed at is gone — aim it at this repo's backlog instead`,Vr=`another item is running in that session`,Hr=e=>e.map(e=>e.split(`/`).pop()||e);function Ur(e){let t=Hr(e);return t.length===1?`waiting for ${t[0]} to finish uploading`:`waiting for ${t.length} files to finish uploading`}function Wr(e){let t=Hr(e);return t.length===1?`${t[0]} never arrived — the words are still here; re-attach it and send again`:`${t.length} files never arrived (${t.slice(0,3).join(`, `)}${t.length>3?`, …`:``}) — the words are still here; re-attach and send again`}function Gr(e){return`not due yet — it fires at the time on this row`}function Kr(e,t){return`missed — more than ${t} min past its time, and it could not start in time`}function qr(e,t){return`missed — it was due and cleared to start, then waited ${Math.round(t/36e5)} h without ever getting a free moment (the grace you set was ${e} min)`}function Jr(e){let t=h(e);return t?`outside its hours (${t}${g(e)}) — runs when they open`:`outside the hours it may run — runs when they open`}function Yr(e,t,n,r){if(t===e)return!0;if(!n)return!1;let i=new Set([e]),a=t;for(;a;){if(i.has(a))return!0;if(r?.has(a))return!1;i.add(a),a=n.get(a)}return!1}var Xr=e=>e?`waits for “${e}” to finish`:`waits for the item before it to finish`,Zr=e=>e?`the item this waited for is gone (“${e}”) — nothing is going to release it; give it a time, or chain it to another`:`the item this waited for is gone — nothing is going to release it; give it a time, or chain it to another`,Qr=`the item it waited for failed, and this one was set to run only if that one succeeded`,$r=`the item it waited for was called off — nothing is going to release this; give it a time, or chain it to another`,ei=`these items are waiting on each other in a circle, so none of them can ever start — give one of them a time instead`,ti=e=>`missed — more than ${e} min since the item it waited for finished, and it could not start in time`,ni=e=>(e?`the item this waits for (“${e}”) is archived, so nothing is going to start it`:`the item this waits for is archived, so nothing is going to start it`)+` — bring it back to release this, or give this one a time`,ri=e=>(e?`the item this waited for (“${e}”) is a repeating rule, so it never finishes`:`the item this waited for is a repeating rule, so it never finishes`)+` — nothing is going to release this; give it a time, or chain it to one run of that work`;function ii(e,t){if(e.kind!==`window`||e.edge===`after`)return null;let n=(e.offsetMin??0)*6e4;return!(n<0)||!Number.isFinite(t)?null:{window:e.periodId??(e.window===`weekly`?`weekly`:`session`),from:t,until:t-n}}function ai(e){return e.trigger.kind===`at`?typeof e.nextAt==`number`?ii(e.trigger.rule,e.nextAt):null:e.budgetPass??null}function oi(e,t,n){if(si(e,n))return null;if(!t.budgetOver?.length)return t.budgetDetail??``;let r=ai(e),i=r?t.budgetOver.find(e=>e.which===r.window):void 0,a=r!=null&&(!i||i.resetAt!=null&&Math.abs(i.resetAt-r.until)<=3e5),o=a?Math.max(r.until,i?.resetAt??r.until):0;for(let e of t.budgetOver){let t=a&&(e.which===r.window||r.window===`weekly`&&e.which===`session`);if(!(t&&n>=r.from&&n<o))return t&&n<r.from?Re(e,n,r.window):r&&e.which!==r.window&&!t?ze(e,r.window,n):Le(e,n)}return null}function si(e,t){return e.pastBudget!=null&&t<e.pastBudget.until}function ci(e){if(!e||typeof e!=`object`)return;let t=e,n=t.until;if(typeof n!=`number`||!Number.isFinite(n))return;let r=typeof t.periodId==`string`&&t.periodId.trim()?t.periodId:void 0;return{until:n,...t.weekly===!0?{weekly:!0}:{},...r?{periodId:r}:{}}}function li(e,t){if(typeof e.leftoverOf==`number`)return e.leftoverOf;let n=ai(e);return n&&n.window===`weekly`&&t>=n.until?n.until:ui(e,t)}function ui(e,t){if(e.trigger.kind!==`at`||typeof e.nextAt!=`number`)return null;let n=e.trigger.rule;if(n.kind!==`window`||n.window!==`weekly`)return null;let r=(n.offsetMin??0)*6e4;if(n.edge!==`after`&&r<0)return null;let i=Math.max(0,r);if(i>18e6)return null;let a=e.nextAt-i;return t>=a?a:null}var di=`fanout`,fi=`fanout:fu:`,pi=`agent`,mi=e=>e.origin===pi,hi=e=>!!e.origin?.startsWith(`peer:`)&&e.origin.length>5,gi=e=>{if(e?.startsWith(`peer:`))return e.slice(5)||void 0},_i=`posted by an agent — edit or delete it like any other`,vi=`waits for your tap — nothing starts it by itself`,yi=new Set([`work`,`sweep`,`build`]);function bi(e){if(!e?.startsWith(`schedule:`))return;let t=e.slice(9);return t&&!yi.has(t)?t:void 0}var xi=e=>e.trigger.kind===`files`,Si=e=>!!e.groupId&&(e.origin===`fanout`||e.origin===`fanout:run`||(e.origin?.startsWith(`fanout:fu:`)??!1)),Ci=e=>e.trigger.kind===`at`&&!n(e.trigger.rule)&&e.payload.kind===`prompt`&&(e.target.kind===`repo`||e.target.kind===`session`)&&!Si(e),wi=e=>e.trigger.kind===`at`&&!Ci(e),Ti=`schedule:work`,Ei=e=>e.origin===`schedule:work`&&wi(e),Di=(e,t,n)=>JSON.stringify([e,t,+!!n]),Oi=e=>e.payload.kind===`build`&&!wi(e),ki=e=>e.payload.kind===`prompt`&&(e.trigger.kind===`now`||e.trigger.kind===`idle`||e.trigger.kind===`budget`||e.trigger.kind===`after`||Ci(e))&&(e.target.kind===`repo`||e.target.kind===`session`)&&!Si(e),Ai=e=>e.payload.kind===`assess`,ji=e=>e.payload.kind===`capture`;function Mi(e){return xi(e)?`launch`:wi(e)?`schedule`:Si(e)?`fanout`:Oi(e)?`build`:Ai(e)?`assess`:ji(e)?`capture`:ki(e)?`work`:`other`}var Ni=e=>e.target.kind===`repo`&&e.target.fresh===!0||Pi(e),Pi=e=>e.target.kind===`session`&&!!e.target.resumeConvId&&e.trigger.kind===`at`;function Fi(e,t){if(!Pi(e)||e.target.kind!==`session`)return null;let n=e.target.resumeConvId;return t.find(t=>t.running!==!1&&t.convId===n&&t.id!==e.target.sessionId)?.id??null}function Ii(e,t,n,r){let i=e=>({kind:`go`,sessionId:e,occurrence:n,late:r});switch(e.target.kind){case`shell`:return i();case`repos`:return e.target.dirs.filter(e=>t.knownDirs.has(e)).length?i():{kind:`fail`,detail:`none of the repos this was aimed at are still there — re-aim it at one that is`};case`sessions`:{let n=e.target.sessionIds.filter(e=>Ri(t,e));if(!n.length)return P(`sessionGone`,Br);for(let r of n){let n=Li(e,t,r);if(n)return n}return i()}case`session`:if(Pi(e)&&!Ri(t,e.target.sessionId)){let n=Fi(e,t.sessions);return n?Li(e,t,n)??i(n):i()}return Li(e,t,e.target.sessionId)??i(e.target.sessionId);case`repo`:return i()}}function Li(e,t,n){let r=Ri(t,n);if(!r)return P(`sessionGone`,zr);if(t.busySessions?.has(n)&&!e.interject&&e.state!==`starting`&&e.state!==`running`)return P(`sessionBusy`,Vr);if(t.budgetHeldSessions?.has(n))return P(`sessionBudget`);let i=gr(r);return i?P(i):null}function Ri(e,t){let n=e.sessions.find(e=>e.id===t);return n&&n.running!==!1?n:void 0}function zi(e,t,r){if(e.archived)return P(`gate`,`set aside — bring it back to let it run`);if(e.manual)return P(`gate`,vi);if(e.auto&&!e.pinned&&!t.autoFire)return P(`gate`);if(e.trigger.kind===`at`&&e.nextAt===null&&e.trigger.rule.kind===`weekly`&&n(e.trigger.rule))return P(`gate`,`this schedule is switched off — turn it back on and the next occurrence arms itself`);if(t.budgetBlocked&&e.auto){let n=oi(e,t,r);if(n!==null)return P(`budget`,n)}if(t.leftoverOver&&e.auto&&!si(e,r)&&li(e,r)!==null){let n=typeof e.leftoverOf!=`number`&&ui(e,r)!==null;return P(`budget`,je(t.leftoverOver,r,n))}let i,a,o;switch(e.trigger.kind){case`now`:case`idle`:break;case`budget`:if(t.budgetBlocked&&!si(e,r))return P(`budget`,t.budgetDetail);break;case`files`:{let n=e.trigger.needs.filter(e=>!t.present.has(e));if(!n.length)break;return r>=e.trigger.deadlineAt?{kind:`fail`,detail:Wr(n),missing:n}:{...P(`filesMissing`,Ur(n)),missing:n}}case`at`:{let t=e.trigger;if(t.rule.kind===`window`&&e.nextAt==null&&(n(t.rule)||e.lastOccurrence==null||e.nextAt===void 0))return P(`notYet`,`waiting for the first usage reading — the reset this tracks has not been read yet`);let s=typeof e.nextAt==`number`?e.nextAt:e.nextAt===null?null:ee(t.rule,e.lastOccurrence??e.createdAt-1);if(s==null)return{kind:`fail`,detail:`that instant has passed and this was a one-off — post it again if you still want it`};if(s>r)return P(`notYet`,Gr(s));if(!p(t.rule,r))return P(`notYet`,Jr(t.rule));let c=r-(m(t.rule,s)??s),l=Math.max(Math.max(0,t.graceMin)*6e4,nr),u=e.clearedOccurrence===s,d=u?Math.max(l,rr):l;if(c>d){let e=u?qr(t.graceMin,d):Kr(s,t.graceMin);return n(t.rule)?{...P(`notYet`,e),missedOccurrence:s}:{kind:`fail`,detail:e}}i=s,o=s,a=c>6e4||void 0;break}case`after`:{let n=e.trigger;if(Yr(e.id,n.id,t.chainWaits,t.settled))return{kind:`fail`,detail:ei};if(t.neverSettles?.has(n.id))return{kind:`fail`,detail:ri(n.title)};let i=t.settled?.get(n.id);if(!i)return t.setAside?.has(n.id)?P(`notYet`,ni(n.title)):t.knownIntents&&!t.knownIntents.has(n.id)?{kind:`fail`,detail:Zr(n.title)}:P(`notYet`,Xr(n.title));if(i.canceled)return{kind:`fail`,detail:$r};if(!i.ok&&n.onlyIfOk)return{kind:`fail`,detail:Qr};if(n.graceMin!=null){let t=r-i.at,a=Math.max(Math.max(0,n.graceMin)*6e4,nr),o=e.clearedOccurrence===i.at,s=o?Math.max(a,rr):a;if(t>s)return{kind:`fail`,detail:o?qr(n.graceMin,s):ti(n.graceMin)}}o=i.at;break}}let s=e=>e.kind===`wait`&&o!=null?{...e,clearedOccurrence:o}:e;if(e.serial&&t.busyCwds.has(N(e.cwd))){let n=t.serialHolders?.get(N(e.cwd)),r=kr(n),i=P(`serial`,n?.length?Ar(n):void 0);return s(r?.sessionId?{...i,holderSessionId:r.sessionId}:i)}return e.holdForHost&&t.hostBusy?s(P(`hostBusy`)):t.local&&t.local.rows.has(e.id)&&t.local.free<=0&&!(e.target.kind===`session`&&t.local.busy.has(e.target.sessionId))?s(P(`localModel`)):e.auto&&Ni(e)&&t.autoSlotsFree<=0?s(P(`noSlot`)):s(Ii(e,t,i,a))}var Bi=[`web`,`android`,`garmin`,`window`],Vi={w:390,h:844},Hi=[`bug`,`feature`,`enhancement`,`chore`],Ui=[`hand`,`assess`,`name`],Wi=`no kind`,Gi=[[`"`,`"`],[`'`,`'`],[`“`,`”`],[`‘`,`’`],["`","`"]];function Ki(e,t){if(typeof e!=`string`)return;let n=e.trim().replace(/\s+/g,` `);for(let[e,t]of Gi)if(n.length>=2&&n.startsWith(e)&&n.endsWith(t)){n=n.slice(1,-1).trim();break}if(n.endsWith(`.`)&&!n.endsWith(`..`)&&(n=n.slice(0,-1).trim()),!n)return;n.length>80&&(n=n.slice(0,80).trim());let r=(t??``).trim().replace(/\s+/g,` `);if(!(r&&r.startsWith(n)))return n}function qi(e){if(typeof e!=`string`)return;let t=e.trim().toLowerCase();return Hi.find(e=>e===t)}function Ji(e){if(typeof e!=`string`)return;let t=e.trim().toLowerCase();return Ui.find(e=>e===t)}function Yi(e){return ie(e.label,e.text,40)||(e.headline??``).trim()||null}function Xi(e){switch(e){case`bug`:return`bug`;case`feature`:return`feature`;case`enhancement`:return`enhancement`;case`chore`:return`chore`}}function Zi(e){if(typeof e!=`string`)return;let t=e.trim().replace(/\s+/g,` `);for(let[e,n]of Gi)if(t.length>=2&&t.startsWith(e)&&t.endsWith(n)){t=t.slice(1,-1).trim();break}if(t.endsWith(`.`)&&!t.endsWith(`..`)&&(t=t.slice(0,-1).trim()),!t||/[…]|\.\.\./.test(t))return;let n=t.split(` `).filter(Boolean).slice(0,4);for(;n.length>1&&n.join(` `).length>30;)n.pop();if(t=n.join(` `),!(!t||t.length>30))return t}var Qi=[`main`,`master`];function $i(e){return typeof e==`string`&&Qi.includes(e.trim().toLowerCase())}function ea(e){let t=(e.branch??``).trim();if(t&&!(e.isPrimary&&$i(t)))return t}function ta(e){let t=ea(e);return t?`${e.repoName} · ${t}`:e.repoName}function na(e){let t=typeof e==`string`?e.trim():``,n=t.lastIndexOf(` · `);return n<=0?t:$i(t.slice(n+3))?t.slice(0,n):t}function ra(e){return(e.tabTitle??``).trim()}function ia(e,t){let n=e=>(e??``).split(`
2
+ `)[0].trim();return ra(e)||n(t)||n(e.firstPrompt)||na(e.title)||void 0}function aa(e){let t=ra(e);return t?`${e.title} · ${t}`:e.title}var oa=[`done`,`obsolete`,`superseded`,`merged`,`wanted`,`unclear`];En(`assess-in.json`),En(`assess-out.json`),En(`plan.md`);function sa(e){if(!e||typeof e!=`object`)return;let t=e;if(!(t.kind!==`slot`||typeof t.key!=`string`||!t.key.trim()||t.key.length>200))return{kind:`slot`,key:t.key.trim()}}var ca=/\S+\.(?:png|jpe?g|gif|webp|bmp|heic|heif|svg)\b/gi,la=e=>e.replace(/^[([{'"`*]+/,``).replace(/[)\]}.,;:'"`*]+$/,``);function ua(e){let t=typeof e==`string`?e.match(ca):null;return t?[...new Set(t.map(la))]:[]}function da(e){switch(e){case`done`:return`already done`;case`obsolete`:return`no longer applies`;case`superseded`:return`covered by another item`;case`merged`:return`merged with others`;case`wanted`:return`still wanted`;case`unclear`:return`could not tell`}}function fa(e){switch(e){case`no-evidence`:return`left undecided: nothing was cited to back that up`;case`unknown-verdict`:return`left undecided: the verdict was not one this app knows`;case`duplicate`:return`left undecided: it was given more than one verdict`;case`unmentioned`:return`left undecided: the assessment did not mention it`;case`supersede-unknown`:return`left undecided: it points at an item that was not in the list`;case`supersede-self`:return`left undecided: it points at itself`;case`supersede-cycle`:return`left undecided: the chain of items it points at comes back round`;case`merge-conflict`:return`left undecided: more than one outcome claimed it`;case`merge-dropped`:return`left undecided: the merge it was part of did not stand`;case`merge-unknown`:return`left undecided: it names a merge that does not exist`}}function pa(e){let t=e.evidence?` — ${e.evidence}`:``;return e.downgraded?`${fa(e.downgraded)}${t}`:e.verdict===`superseded`&&e.supersededBy?`${da(`superseded`)} (${e.supersededBy})${t}`:`${da(e.verdict)}${t}`}function ma(e){let t={done:0,obsolete:0,superseded:0,merged:0,wanted:0,unclear:0};for(let n of e.rows)t[n.verdict]++;return t}function ha(e){let t=e=>!!e.headline||!!e.category;return e.rows.filter(t).length+e.merges.filter(t).length+e.news.filter(t).length}function ga(e){return`${e.ids.length===2?`these two`:`these ${e.ids.length}`} contradict each other — ${e.why}`}function _a(e){return`two jobs in one item: split into two, on the same clock${e.rationale?` — ${e.rationale}`:``}`}function va(e){return`This applies an order to ${e===1?`1 item`:`${e} items`}. Should it stay as you approved it?`}var ya=`keep this order`,ba=`leave it unmarked`;function xa(e){return e?`Marked as placed by you, the way a drag is — each row says so.`:`The order is written either way; these rows just do not say “placed by you”. Nothing re-sorts them on its own.`}function Sa(e){return`This run wrote a title or a kind for ${e===1?`1 item`:`${e} items`}. Should they go on the rows?`}var Ca=`write them`,wa=`leave the rows as they are`;function Ta(e){return e?`Written as the run's — a title or kind you typed yourself is never replaced, and you can edit or clear any of them on the row.`:`Nothing is titled. The suggestions stay on this sheet only.`}var F=e=>typeof e==`string`?e.trim():``,I=e=>{let t=Number(e);return Number.isFinite(t)&&t!==0?t:void 0},Ea=e=>{let t=Number(e);return e!=null&&e!==``&&Number.isFinite(t)?t:void 0};function Da(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.window!=`string`||!t.window.trim())return;let n=Number(t.from),r=Number(t.until);if(typeof t.from==`number`&&typeof t.until==`number`&&Number.isFinite(n)&&Number.isFinite(r)&&n<r)return{window:t.window,from:n,until:r}}var Oa=[`queued`,`blocked`,`starting`,`running`,`done`,`failed`,`canceled`],ka=new Set(Rr);function Aa(e,t){let n=e&&typeof e==`object`?e:{},r=F(n.id),i=F(n.cwd);if(!r||!i)return null;let a=Na(n.payload);if(!a)return null;let o=La(n.trigger,Number(n.createdAt)||t);if(!o)return null;let s=Pa(n.target);if(!s)return null;let c=Number(n.createdAt)||t,l=Oa.includes(n.state)?n.state:`queued`,u=l===`blocked`&&ka.has(n.blockReason)?n.blockReason:void 0,d=a.kind===`prompt`?a.steps[0]??``:``,f=Ji(n.headlineBy),p=f?Ki(n.headline,d):void 0,m=Ji(n.categoryBy),h=m?qi(n.category):void 0;return{id:r.slice(0,64),cwd:i,payload:a,target:s,trigger:o,serial:n.serial===!0||void 0,holdForHost:n.holdForHost===!0||void 0,pastBudget:ci(n.pastBudget),budgetPass:Da(n.budgetPass),leftoverOf:typeof n.leftoverOf==`number`&&Number.isFinite(n.leftoverOf)?n.leftoverOf:void 0,auto:n.auto===!0||void 0,pinned:n.pinned===!0||void 0,interject:n.interject===!0||void 0,resume:n.resume===!0||void 0,closeWhenDone:typeof n.closeWhenDone==`boolean`?n.closeWhenDone:void 0,flagWhenDone:n.flagWhenDone===!0||void 0,budget:Qt(n.budget)??void 0,archived:n.archived===!0||void 0,manual:n.manual===!0||void 0,order:Ea(n.order),handOrdered:n.handOrdered===!0||void 0,attempts:I(n.attempts),label:F(n.label).slice(0,80)||void 0,title:F(n.title).slice(0,200)||void 0,headline:p,headlineBy:p?f:void 0,category:h,categoryBy:h?m:void 0,cols:I(n.cols),rows:I(n.rows),launch:bn(n.launch),replaceSessionId:F(n.replaceSessionId)||void 0,state:l,blockReason:u,blockDetail:u?F(n.blockDetail)||Ir(u):void 0,blockSessionId:u===`serial`&&F(n.blockSessionId).slice(0,128)||void 0,createdAt:c,startedAt:I(n.startedAt),settledAt:I(n.settledAt),sessionId:F(n.sessionId)||void 0,result:n.result&&typeof n.result==`object`?n.result:void 0,requeues:ja(n.requeues),requeueCount:Ma(n.requeueCount),nextAt:n.nextAt===null?null:I(n.nextAt),lastOccurrence:I(n.lastOccurrence),clearedOccurrence:I(n.clearedOccurrence),missing:Array.isArray(n.missing)?n.missing.filter(e=>typeof e==`string`):void 0,dismissedAt:I(n.dismissedAt),followed:n.followed===!0||void 0,origin:F(n.origin).slice(0,40)||void 0,groupId:F(n.groupId).slice(0,64)||void 0}}function ja(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n,r=Number(e.at);!Number.isFinite(r)||r<=0||(e.by===`assess`||e.by===`hand`||e.by===`run`)&&t.push({at:r,by:e.by,runId:F(e.runId).slice(0,64)||void 0,result:e.result&&typeof e.result==`object`?e.result:void 0,clockDropped:e.clockDropped===!0||void 0})}if(t.length)return t.length>5?t.slice(-5):t}function Ma(e){let t=typeof e==`number`?e:NaN;return Number.isInteger(t)&&t>0?t:void 0}function Na(e){let t=e&&typeof e==`object`?e:{};if(t.kind===`capture`){let e=F(t.targetId);if(!e)return null;let n=Bi.includes(t.backend)?t.backend:void 0;return{kind:`capture`,targetId:e.slice(0,64),name:F(t.name).slice(0,120)||void 0,backend:n,watch:t.watch===!0||void 0}}if(t.kind===`build`){let e=F(t.buildId);if(!e)return null;let n;if(t.params&&typeof t.params==`object`){let e={};for(let[n,r]of Object.entries(t.params)){if(!/^[A-Za-z][A-Za-z0-9_]{0,31}$/.test(n))continue;let t=M(r);t&&(e[n]=t)}Object.keys(e).length&&(n=e)}return{kind:`build`,buildId:e.slice(0,64),name:F(t.name).slice(0,120)||void 0,cmd:typeof t.cmd==`string`?t.cmd:void 0,cwd:F(t.cwd)||void 0,params:n}}if(t.kind===`assess`){let e=Array.isArray(t.ids)?t.ids.filter(e=>typeof e==`string`&&!!e.trim()):[];if(!e.length)return{kind:`assess`};let n=sa(t.scope);return n?{kind:`assess`,ids:e,scope:n}:{kind:`assess`,ids:e}}if(t.kind!==`prompt`)return null;let n=Array.isArray(t.steps)?t.steps.filter(e=>typeof e==`string`&&!!e.trim()).slice(0,40):[];return n.length?{kind:`prompt`,steps:n}:null}function Pa(e){if(e==null)return Fa();if(typeof e!=`object`)return null;let t=e;switch(t.kind){case`session`:{let e=F(t.sessionId);if(!e)return null;let n=F(t.resumeConvId);return n?{kind:`session`,sessionId:e,resumeConvId:n}:{kind:`session`,sessionId:e}}case`repos`:{let e=[...new Set((Array.isArray(t.dirs)?t.dirs:[]).filter(e=>typeof e==`string`&&!!e.trim()).map(e=>e.trim()))].slice(0,60);return e.length?{kind:`repos`,dirs:e}:null}case`sessions`:{let e=[...new Set((Array.isArray(t.sessionIds)?t.sessionIds:[]).filter(e=>typeof e==`string`&&!!e.trim()).map(e=>e.trim()))].slice(0,60);return e.length?{kind:`sessions`,sessionIds:e}:null}case`shell`:return{kind:`shell`};case`repo`:return Fa();default:return t.kind===void 0?Fa():null}}var Fa=()=>({kind:`repo`,fresh:!0}),Ia=e=>e==null||e===``?NaN:Math.round(Number(e));function La(e,t){let n=e&&typeof e==`object`?e:{};switch(n.kind){case`now`:return{kind:`now`};case`idle`:return{kind:`idle`};case`budget`:return{kind:`budget`};case`at`:{let e=Gn(n.rule),t=Ia(n.graceMin);return{kind:`at`,rule:e,graceMin:Number.isFinite(t)?Math.min(10080,Math.max(0,t)):120,keepAfterRun:n.keepAfterRun===!0||void 0}}case`after`:{let e=F(n.id).slice(0,64);if(!e)return null;let t=Ia(n.graceMin);return{kind:`after`,id:e,onlyIfOk:n.onlyIfOk===!0||void 0,graceMin:Number.isFinite(t)?Math.min(10080,Math.max(0,t)):void 0,title:F(n.title).slice(0,200)||void 0}}case`files`:{let e=(Array.isArray(n.needs)?n.needs:[]).filter(e=>typeof e==`string`&&!!e.trim()&&xn(e)).map(e=>e.trim()).slice(0,20),r=Number(n.deadlineAt);return{kind:`files`,needs:e,deadlineAt:Number.isFinite(r)&&r>0?r:t+hn}}default:return null}}function Ra(e){return e.at?{id:e.id,rule:e.at.rule,nextAt:e.at.nextAt,waiting:!e.archived&&e.status===`queued`}:null}function za(e){if(!e||!e.waiting||!e.rule||n(e.rule))return null;let t=e.nextAt;if(typeof t!=`number`||!Number.isFinite(t))return null;if(e.rule.kind!==`window`)return{row:e,fire:t};let r=(e.rule.offsetMin??0)*6e4;return{row:e,fire:t,reset:t-(e.rule.edge===`after`?Math.max(0,r):r),period:e.rule.periodId??(e.rule.window===`weekly`?`weekly`:`session`)}}var Ba=(e,t,n,r)=>e-t||(n<r?-1:+(n>r));function Va(e){let t=new Map,n=[];e.forEach((e,r)=>{let i=za(e);i&&!t.has(e.id)&&(t.set(e.id,r),n.push(i))});let r=[],i=n.filter(e=>e.reset!=null).sort((e,t)=>Ba(e.reset,t.reset,e.row.id,t.row.id)),a=[...new Set(i.map(e=>e.period))].sort();for(let e of a){let t=null;for(let n of i)n.period===e&&((!t||n.reset-t.slot.at>3e5)&&(t={slot:{key:`reset:${e}:${n.reset}`,kind:`reset`,period:e,at:n.reset,ids:[]},fires:[]},r.push(t)),t.slot.ids.push(n.row.id),t.fires.push(n.fire))}let o=[],s=n.filter(e=>e.reset==null).sort((e,t)=>Ba(e.fire,t.fire,e.row.id,t.row.id));for(let e of s){let t=null,n=1/0;for(let i of r){let r=Math.min(Math.abs(e.fire-i.slot.at),...i.fires.map(t=>Math.abs(e.fire-t)));r<=3e5&&(r<n||r===n&&t&&Ba(i.slot.at,t.slot.at,i.slot.key,t.slot.key)<0)&&(t=i,n=r)}t?t.slot.ids.push(e.row.id):o.push(e)}let c=r.map(e=>e.slot),l=null;for(let e of o)(!l||e.fire-l.at>3e5)&&(l={key:`at:${e.fire}`,kind:`instant`,at:e.fire,ids:[]},c.push(l)),l.ids.push(e.row.id);for(let e of c)e.ids.sort((e,n)=>t.get(e)-t.get(n));return c.sort((e,t)=>Ba(e.at,t.at,e.key,t.key))}function Ha(e,t){return Va(e).find(e=>e.ids.includes(t))??null}function Ua(e,t){return Ha(e,t)?.ids.filter(e=>e!==t)??[]}function Wa(e){if(typeof e!=`string`)return null;let t=e.lastIndexOf(`:`),n=Number(e.slice(t+1));return t<0||!Number.isFinite(n)||!/^\d+$/.test(e.slice(t+1))?null:e.startsWith(`at:`)&&t===2?{kind:`instant`,at:n}:e.startsWith(`reset:`)&&t>6?{kind:`reset`,period:e.slice(6,t),at:n}:null}function Ga(e,t){let n=t===`reset`?`at this reset`:`at this time`;return e===1?`1 other runs ${n}`:`${e} others run ${n}`}function Ka(e){return e===`hand`?`flagged by you`:e===`launch`?`flagged when done, as you asked`:`flagged by the session`}function qa(e){let t=Ka(e.by);return e.by===`agent`&&e.reason?`${t}: ${e.reason}`:e.by===`launch`&&e.item?`${t} (${e.item})`:t}var Ja={on:!1,since:null,receipt:null},Ya=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function Xa(e){let t=[Ya(e.sessions,`session`)];e.sidecars&&t.push(Ya(e.sidecars,`background model run`));let n=e.processes?` (${Ya(e.processes,`process`,`processes`)}${e.forced?`, ${e.forced} forced`:``})`:``,r=e.held?` ${Ya(e.held,`waiting item`)} held.`:``;return`Stopped ${t.join(` and `)}${n}.${r} AI started outside ${O.displayName} and cloud sessions are not reached.`}O.pluginManifest.replace(/\.json$/,``);var Za=[`stable`,`preview`,`experimental`],Qa={stable:{label:`Stable`,meaning:`The author considers it ready for daily use`},preview:{label:`Preview`,meaning:`May break between versions`},experimental:{label:`Experimental`,meaning:`May not work`},unrated:{label:`Unrated`,meaning:`The plugin does not say`}};function $a(e){let t=e?.maturity,n=Za.includes(t)?t:`unrated`;return{level:n,...Qa[n]}}var eo=O.pluginManifest;k.map(e=>e.pluginManifest);function to(e,t){switch(e.kind){case`switch`:return typeof t==`boolean`?t:void 0;case`choice`:return typeof t==`string`&&e.options.some(e=>e.value===t)?t:void 0;case`number`:return typeof t==`number`&&Number.isFinite(t)&&t>=e.min&&t<=e.max?t:void 0;case`text`:return typeof t==`string`&&t.length<=2e4?t:void 0}}function no(e){let t=/^v?(\d+)\.(\d+)\.(\d+)/.exec(e??``);return t?[+t[1],+t[2],+t[3]]:null}function ro(e,t){let n=no(e),r=no(t);if(!n||!r)return!1;for(let e=0;e<3;e++)if(n[e]!==r[e])return r[e]>n[e];return!1}function io(e){let t=[];if(!e)return t;let n=e.self;n.latest&&ro(n.current,n.latest)&&(n.canApply||n.command)&&t.push({kind:`self`,current:n.current,latest:n.latest});for(let n of e.catalog){let e=n.installed,r=n.latest;if(!e||!r||e.source!==`manager`||n.problems.length>0)continue;let i;if(r.kind===`tag`){let t=no(e.ref),n=no(r.ref);i=!!e.ref&&r.ref!==e.ref&&(t&&n?ro(e.ref,r.ref):!0)}else i=!!r.commit&&!!e.commit&&r.commit!==e.commit;i&&t.push({kind:`plugin`,id:e.id,repo:n.repo,from:e.ref,to:r.ref})}return t}var ao=8192,oo=4096;function so(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.byteLength<12)return null;let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(n.getUint8(0)!==87||n.getUint8(1)!==1)return null;let r=n.getUint16(2,!0);return r===0?null:{streamId:r,seq:n.getUint32(4,!0),kind:n.getUint8(8),flags:n.getUint8(9),payload:t.subarray(12)}}function co(e){try{let t=JSON.stringify(e??null);return typeof t==`string`?new TextEncoder().encode(t).byteLength:-1}catch{return-1}}var lo=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=100;function uo(e){if(!e||!e.ok)return null;let t=[];if(lo(e.sessionPct)&&t.push({id:`session`,unit:`5h`,pct:e.sessionPct,resetAt:e.sessionResetAt??null}),lo(e.weeklyPct)&&t.push({id:`week`,unit:`wk`,pct:e.weeklyPct,resetAt:e.weeklyResetAt??null}),!t.length)return null;let n={source:`claude`,label:`Claude`,backend:`claude`,checkedAt:e.checkedAt,windows:t};return e.remembered&&(n.remembered=!0),n}function L(e){return lo(e.pct)?e.pct:typeof e.used==`number`&&typeof e.limit==`number`&&Number.isFinite(e.used)&&Number.isFinite(e.limit)&&e.limit>0&&e.used>=0?Math.min(100,Math.round(e.used/e.limit*100)):null}var R=e=>!!e.usd&&typeof e.usd.spentUsd==`number`&&Number.isFinite(e.usd.spentUsd);function fo(e,t=Date.now()){let n=e=>e!=null&&e<=t,r=e.windows.some(e=>n(e.resetAt)),i=!!e.usd&&n(e.usd.resetAt);if(!r&&!i)return e.windows.some(e=>L(e)!=null)||R(e)?e:null;let a={...e,windows:e.windows.filter(e=>!n(e.resetAt))};return i&&delete a.usd,a.windows.some(e=>L(e)!=null)||R(a)?a:null}function po(e){let t=null,n=-1;for(let r of e.windows){let e=L(r);e!=null&&e>n&&(t=r,n=e)}return t}function mo(e){return!R(e)||!e.usd||e.usd.capUsd==null||!(e.usd.capUsd>0)?null:Math.min(100,Math.round(e.usd.spentUsd/e.usd.capUsd*100))}function ho(e){let t=po(e),n=t?L(t):null,r=mo(e);return n==null?r:r==null?n:Math.max(n,r)}function go(e,t=80){let n=ho(e);return n!=null&&n>=t}var _o=e=>`$${e>=100?Math.round(e):e.toFixed(2)}`;function vo(e,t){let n=po(e),r=n?L(n):null;if(n&&r!=null)return{source:e.source,label:e.label,text:`${r}%`,unit:n.unit,hot:go(e,t),reading:e};if(R(e)&&e.usd){let n=mo(e);return{source:e.source,label:e.label,text:n==null?_o(e.usd.spentUsd):`${n}%`,unit:``,hot:go(e,t),reading:e}}return null}function yo(e,t=3,n=80){let r=new Set,i=[];for(let t of e??[]){if(!t||r.has(t.source))continue;let e=vo(t,n);e&&(r.add(t.source),i.push(e))}let a=e=>ho(e.reading)??-1;i.sort((e,t)=>e.source===`claude`?t.source===`claude`?0:-1:t.source===`claude`?1:a(t)-a(e)||e.label.localeCompare(t.label));let o=Math.max(1,Math.floor(t)),s=i.slice(0,o),c=i.slice(o).map(e=>e.label);return c.length&&(s[s.length-1]={...s[s.length-1],hidden:c}),{segments:s,hidden:c,total:i.length}}var bo=e=>String(e).padStart(2,`0`);function xo(e){let t=Math.max(0,Math.round(e/6e4));if(t<1)return`now`;if(t<60)return`${t}m`;let n=Math.floor(t/60);return n<24?t%60?`${n}h ${t%60}m`:`${n}h`:`${Math.floor(n/24)}d`}function So(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s ago`;let n=Math.round(t/60);if(n<60)return`${n}m ago`;let r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function Co(e,t){let n=new Date(e);return e-t<=72e6?`${bo(n.getHours())}:${bo(n.getMinutes())}`:n.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}var wo={session:`5-hour session`,week:`week`};function To(e,t=Date.now()){let n=[];for(let r of e.windows){let i=L(r);if(i==null)continue;let a=e.source===`claude`?wo[r.id]??r.id:r.id,o=typeof r.used==`number`&&typeof r.limit==`number`?` (${r.used} / ${r.limit}${r.unitName?` ${r.unitName}`:``})`:``,s=r.resetAt!=null&&r.resetAt>t?` · resets ${Co(r.resetAt,t)} (in ${xo(r.resetAt-t)})`:``;n.push(`${a} ${i}%${o}${s}`)}if(R(e)&&e.usd){let r=e.usd.capUsd!=null&&e.usd.capUsd>0?` of ${_o(e.usd.capUsd)}`:``,i=e.usd.resetAt!=null&&e.usd.resetAt>t?` · resets ${Co(e.usd.resetAt,t)} (in ${xo(e.usd.resetAt-t)})`:``;n.push(`${e.usd.label} ${_o(e.usd.spentUsd)}${r}${i}`)}let r=`${e.label} usage`,i=Number.isFinite(e.checkedAt)&&e.checkedAt>0?` · checked ${So(t-e.checkedAt)}${e.remembered?` (kept from before a restart)`:``}`:``;return`${r}${n.length?` — ${n.join(` · `)}`:``}${i}`}var Eo=[`prompt`,`approval`,`limit`,`burn`,`cli`,`disk`,`undelivered`,`backlog`,`followup`,`health`,`agent`,`artifact`,`image`,`plugin`,`autofire`,`idle`,`info`,`weekburn`,`git`,`exposure`],Do=[`idle`];function Oo(e,t){let n=e?.[t];return typeof n==`boolean`?n:!Do.includes(t)}var ko=[`prompt`,`approval`,`cli`,`disk`,`undelivered`,`followup`];function Ao(e,t,n){return n===`attention`||n===`info`?n:t===`failed`?`attention`:t===`ok`?`info`:ko.includes(e)?`attention`:`info`}function jo(e){return e.level===`attention`||e.level===`info`?e.level:Ao(e.kind)}function Mo(e){return jo(e)===`attention`&&!e.handled}function No(e){if(!e.startsWith(`notif:`))return null;try{let t=JSON.parse(e.slice(6));return!t||typeof t!=`object`||typeof t.id!=`string`||typeof t.title!=`string`||typeof t.kind!=`string`?null:{...t,body:typeof t.body==`string`?t.body:``,ts:typeof t.ts==`number`?t.ts:Date.now()}}catch{return null}}var Po={enabled:!1,scope:`outbox`,match:[],maxBytes:268435456,builds:!0,supersede:!0},Fo=e=>(/^\d{4}-\d{2}-\d{2}/.exec(String(e))??[String(e)])[0],Io=e=>e.by?.kind===`agent`?`agent session${e.by.repo?` in ${e.by.repo}`:``}`:`you`;function Lo(e){return e.state===`fixed`?`fixed${e.fixedIn?` in ${e.fixedIn}`:``}${e.commit?` (commit ${e.commit})`:``}, ${Io(e)}, ${Fo(e.at)}${e.note?`: ${e.note}`:``}`:`${e.state} \u2014 ${Io(e)}, ${Fo(e.at)}${e.note?`: ${e.note}`:``}`}var Ro=`exposure`,zo=e=>e.watch===!0||!!e.exposure||e.id===`exposure`;function Bo(e){return e.scope!==`host`&&e.status!==`pass`&&!e.advisory&&!e.ignored&&!e.accepted}function Vo(e){return e.scope!==`host`&&e.status!==`pass`&&!!e.advisory&&!e.ignored&&!e.accepted}var Ho=[`instructions`,`skill_listing`,`mcp_instructions`,`deferred_tools`,`agent_listing`,`hook_context`,`system_prompt`,`tool_schemas`];function Uo(e){let t=e=>e.split(`
3
+ `).map(e=>` ${e}`).join(`
4
+ `),n=e=>e?new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):``,r=[];for(let i of e.turns){let e=n(i.sentAt);r.push(`\u2500\u2500 #${i.n}${e?` \u00b7 ${e}`:``} \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`),i.prompt.trim()&&r.push(i.prompt.trim().split(`
5
+ `).map(e=>`> ${e}`).join(`
6
+ `));for(let e of i.blocks)if(e.kind===`screen`){if(!e.text.trim())continue;r.push(``,t(e.text.trimEnd()))}else if(e.kind===`text`||e.kind===`thinking`){if(!e.text.trim())continue;r.push(``,e.kind===`thinking`?`[thinking]\n${t(e.text.trim())}`:e.text.trim())}else r.push(``,`[${e.name}]${e.label?` ${e.label}`:``}${e.ok===!1?` — FAILED`:``}`),e.input&&r.push(t(e.input)),e.result?r.push(t(e.result+(e.resultTruncated?`
7
+ …(truncated)`:``))):e.omitted&&r.push(` (input and result not loaded — open the call in the reader first)`);r.push(``)}let i=r.join(`
8
+ `).replace(/\n{3,}/g,`
9
+
10
+ `).trim();return/[^\s\u2500]/.test(i)?i:``}function Wo(e){return JSON.stringify(e)}function Go(e){return JSON.parse(e)}var Ko={on:!0,warnPct:2,highPct:5,warnUsd:30,highUsd:75},qo=(e,t)=>typeof e==`number`&&Number.isFinite(e)&&e>0&&e<=t?e:null;function Jo(e){let t=e&&typeof e==`object`?e:{},n=Ko,r=qo(t.warnPct,100)??n.warnPct,i=qo(t.highPct,100)??n.highPct;i>r||(r=n.warnPct,i=n.highPct);let a=qo(t.warnUsd,1e6)??n.warnUsd,o=qo(t.highUsd,1e6)??n.highUsd;return o>a||(a=n.warnUsd,o=n.highUsd),{on:t.on!==!1,warnPct:r,highPct:i,warnUsd:a,highUsd:o}}var Yo=e=>`${Number(e.toPrecision(2))}%`;function Xo(e,t,n){if(!n.on||e==null||!Number.isFinite(e)||!(e>0))return null;if(t!=null&&Number.isFinite(t)&&t>0){let r=e/t,i=r>=n.highPct?`high`:r>=n.warnPct?`warn`:null;if(!i)return null;let a=i===`high`?n.highPct:n.warnPct;return{level:i,by:`week`,at:a,text:`This session has spent ≈${Yo(r)} of the week (${b(e)} at list prices) — past your ${i===`high`?`red`:`orange`} mark at ${Yo(a)}.`}}let r=e>=n.highUsd?`high`:e>=n.warnUsd?`warn`:null;if(!r)return null;let i=r===`high`?n.highUsd:n.warnUsd;return{level:r,by:`usd`,at:i,text:`This session has spent ${b(e)} at list prices — past your ${r===`high`?`red`:`orange`} mark at ${Xe(i)} (no weekly limit reading to measure it against).`}}var Zo=e=>typeof e==`number`&&Number.isFinite(e);function Qo(e,t){let n=e.firstSentAt;return Zo(n)?{...e,sentAt:t}:e}function $o(e,t){let n=e;return typeof n.ackId!=`string`||Zo(n.firstSentAt)?e:{...e,firstSentAt:t}}var es=[`/api`,`/ws`];function z(e){let t=(e||``).trim();if(!t)return null;let n=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(t)?t:`http://${t.replace(/^\/+/,``)}`,r;try{r=new URL(n)}catch{return null}if(r.protocol!==`http:`&&r.protocol!==`https:`||!r.hostname)return null;let i=r.hostname.toLowerCase(),a=i.includes(`:`)?`[${i.replace(/^\[|\]$/g,``)}]`:i,o=r.port||(r.protocol===`http:`?`8770`:``);return`${r.protocol}//${a}${o?`:${o}`:``}`}function ts(e){return!e.startsWith(`/`)||e.startsWith(`//`)?!1:es.some(t=>e===t||e.startsWith(`${t}/`)||e.startsWith(`${t}?`))}function ns(e,t){return!e||!ts(t)?t:`${e.replace(/\/+$/,``)}${t}`}function rs(e,t=`/ws`){if(!e)return null;let n=e.replace(/\/+$/,``);return n.startsWith(`https://`)?`wss://${n.slice(8)}${t}`:n.startsWith(`http://`)?`ws://${n.slice(7)}${t}`:null}var is=`legacy`,as=`abcdefghijklmnopqrstuvwxyz0123456789`,os=`${O.storagePrefix}h.`,ss=O.storagePrefix,cs=k.map(e=>e.storagePrefix),ls=e=>{let t=globalThis.crypto;if(!t?.getRandomValues)throw Error(`no crypto.getRandomValues in this runtime`);return t.getRandomValues(new Uint8Array(e))};function us(e,t,n=ls){let r=256-256%e.length,i=``;for(;i.length<t;)for(let a of n(t*2))if(!(a>=r)&&(i+=e[a%e.length],i.length===t))break;return i}function ds(e){return typeof e==`string`&&/^[a-z0-9]{4,16}$/.test(e)}function fs(e=[],t=ls){let n=new Set(e);for(;;){let e=us(as,8,t);if(!n.has(e)&&e!==`legacy`)return e}}function ps(e,t){if(typeof e!=`string`)return null;let n=e.replace(/[\u0000-\u001f\u007f]/g,` `).replace(/\s+/g,` `).trim();return n?[...n].slice(0,t).join(``).trim():null}function ms(e){return ps(e,40)}function hs(e){let t=e;try{t=new URL(e).hostname}catch{}return t=t.replace(/^\[|\]$/g,``),/^[0-9.]+$/.test(t)||t.includes(`:`)?t:t.split(`.`)[0]||t}function gs(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>=2&&t.startsWith(`"`)&&t.endsWith(`"`)&&(t=t.slice(1,-1)),!t||t===`<unknown ssid>`||/[\u0000-\u001f]/.test(t)?null:[...t].slice(0,64).join(``)}function _s(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=gs(n);if(e&&!t.includes(e)&&t.push(e),t.length>=16)break}return t}function vs(e){if(!e||typeof e!=`object`)return null;let t=e,n=typeof t.base==`string`?z(t.base):null;return n?{base:n,ssids:_s(t.ssids),auto:t.auto===!0}:null}function ys(e){if(!e||typeof e!=`object`)return null;let t=e;if(!ds(t.id))return null;let n=typeof t.base==`string`?z(t.base):null;if(!n)return null;let r={id:t.id,name:ms(t.name)??hs(n),base:n};t.legacy===!0&&(r.legacy=!0);let i=vs(t.lan);return i&&(r.lan=i),r}function bs(e){if(!Array.isArray(e))return[];let t=[],n=!1;for(let r of e){let e=ys(r);if(e&&!t.some(t=>t.id===e.id)&&(e.legacy&&(n&&delete e.legacy,n=!0),t.push(e),t.length>=32))break}return t}function xs(e){if(e==null)return null;try{let t=JSON.parse(e);return Array.isArray(t)?bs(t):null}catch{return null}}function Ss(e){return JSON.stringify(e)}function Cs(e){return!e||e.legacy?O.cacheName:`${O.cacheName}.${e.id}`}function ws(e){return k.map(t=>!e||e.legacy?t.cacheName:`${t.cacheName}.${e.id}`)}function Ts(e){let t={},n=xs(e.hosts);if(!n||n.length===0){let r=e.hostBase?z(e.hostBase):null;if(!r)return{hosts:n??[],activeId:null,writes:t};n=[{id:is,name:hs(r),base:r,legacy:!0}],t.hosts=Ss(n)}let r=n.find(t=>t.id===e.active)??n[0];return e.active!==r.id&&(t.active=r.id),e.hostBase!==r.base&&(t.hostBase=r.base),{hosts:n,activeId:r.id,writes:t}}function Es(e){return`${os}${e}.`}function Ds(e){return e.startsWith(os)}function Os(e,t){return Es(t)+e.slice(ss.length)}function ks(e,t){let n=Es(t);return e.startsWith(n)&&e.length>n.length?ss+e.slice(n.length):null}function As(e,t){return e.startsWith(ss)&&!Ds(e)&&!t(e)}function js(e,t,n,r){let i=[],a=e.filter(e=>As(e,t)),o=new Set(a),s=Es(n);for(let e of a)i.push({op:`copy`,from:e,to:Os(e,n)});if(n!==r&&a.length>0)for(let t of e){if(!t.startsWith(s))continue;let e=ks(t,n);e&&!o.has(e)&&i.push({op:`remove`,key:t})}if(n===r)return i;for(let e of a)i.push({op:`remove`,key:e});for(let n of e){let e=ks(n,r);e&&!t(e)&&i.push({op:`copy`,from:n,to:e})}return i}var Ms=1500;function B(e,t,n=null){return{route:`tailnet`,reason:e,sentence:t,next:n}}function Ns(e,t){return!!t&&!!e.lan&&e.lan.ssids.includes(t)}function Ps(e){let{host:t,net:n,probe:r,macVerified:i,lastFailure:a}=e,o=t.lan;if(!o)return B(`no-lan`,`Using the tailnet: no LAN address saved for this desktop.`);if(!o.auto)return B(`auto-off`,`Using the tailnet: switching to LAN automatically is off.`);if(!n)return B(`no-net`,`Using the tailnet: this phone did not report which network it is on.`);if(n.transport!==`wifi`)return B(`not-wifi`,`Using the tailnet: the phone is ${n.transport===`cellular`?`on mobile data`:n.transport===`none`?`offline`:`not on Wi-Fi`}.`);if(n.permission!==`granted`)return B(`no-permission`,`Using the tailnet: reading the Wi-Fi name needs the location permission.`);if(!n.ssid)return B(`no-ssid`,`Using the tailnet: the Wi-Fi name could not be read.`);if(!Ns(t,n.ssid))return B(`ssid-mismatch`,`Using the tailnet: "${n.ssid}" is not one of this desktop's saved networks.`);if(a&&(!r||r.at<=a.at))return B(`failed-recently`,`Using the tailnet: the LAN connection failed${a.reason?` (${a.reason})`:``}; it is tried again on the next network change or reconnect.`,`probe`);if(!r)return B(`probe-pending`,`Using the tailnet while ${o.base} is checked.`,`probe`);if(!r.ok)return B(`probe-failed`,`Using the tailnet: ${o.base} did not answer on "${n.ssid}".`);if(r.ms!=null&&r.ms>1500)return B(`probe-slow`,`Using the tailnet: ${o.base} took ${Math.round(r.ms)} ms, over the ${Ms} ms limit.`);if(i===null)return B(`mac-pending`,`Using the tailnet while ${o.base} proves it is this desktop.`,`verify`);if(!i)return B(`mac-failed`,`Using the tailnet: whatever answers at ${o.base} could not prove it is this desktop.`);let s=r.ms==null?``:` in ${Math.round(r.ms)} ms`;return{route:`lan`,reason:`lan-ok`,sentence:`Using LAN: on "${n.ssid}", ${o.base} answered${s} and proved it is this desktop.`,next:null}}function Fs(e,t){return`${e}\n${t}`}var Is=6e5,Ls=O.pairScheme,Rs=k.map(e=>e.pairScheme);function zs(e){if(typeof e!=`string`)return null;let t=e.replace(/[\s-]/g,``).toUpperCase();if(t.length!==8)return null;for(let e of t)if(!`23456789ABCDEFGHJKLMNPQRSTUVWXYZ`.includes(e))return null;return t}function Bs(e){return e.length===8?`${e.slice(0,4)}-${e.slice(4)}`:e}function Vs(e){if(typeof e!=`string`)return null;let t=[Ls,...Rs].map(e=>e.replace(/[^a-z0-9+.-]/gi,``)).join(`|`),n=RegExp(`^(?:${t})://pair/?\\?(.*)$`,`i`).exec(e.trim());if(!n)return null;let r;try{r=new URLSearchParams(n[1])}catch{return null}let i=z(r.get(`u`)??``),a=zs(r.get(`c`));return i&&a?{base:i,code:a}:null}function Hs(e){let t=/^\/pair\/([^/]+)(\/apk)?\/?$/.exec(e);if(!t)return null;let n;try{n=decodeURIComponent(t[1])}catch{return null}let r=zs(n);return r?{code:r,apk:!!t[2]}:null}function Us(e){if(typeof e!=`string`)return null;let t;try{t=new URL(e.trim())}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`)return null;let n=Hs(t.pathname);if(!n||n.apk)return null;let r=z(`${t.protocol}//${t.host}`);return r?{base:r,code:n.code}:null}function Ws(e){return Vs(e)??Us(e)}function Gs(e){switch(e){case`bad-request`:return`That is not a pairing code — it is 8 letters and digits.`;case`unknown`:return`The desktop does not know that code. Check it, or show a new QR.`;case`expired`:return`That code has expired (they last 10 minutes). Show a new QR on the paired phone.`;case`used`:return`That code was already used. Show a new QR on the paired phone.`;case`rate-limited`:return`Too many attempts. Wait a minute and try again.`;case`no-password`:return`This desktop has no password set, so it refuses pairing over the Wi-Fi. Pair over Tailscale instead.`}}function Ks(e){return typeof e==`string`&&/^[A-Za-z0-9_-]{6,64}$/.test(e)}function qs(e){return ps(e,40)}var Js=[`loopback`,`tailscale`,`lan`,`public`,`unknown`];function Ys(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:null}function Xs(e){if(!e||typeof e!=`object`)return null;let t=e;if(!Ks(t.id))return null;let n=qs(t.name),r=Ys(t.createdAt);if(!n||r==null)return null;let i=Ys(t.lastSeenAt)??r,a=Js.includes(t.lastKind)?t.lastKind:null,o={id:t.id,name:n,createdAt:r,lastSeenAt:i,lastKind:a};return t.current===!0&&(o.current=!0),t.scope===`passive`&&(o.scope=`passive`),o}function Zs(e){return[...e].sort((e,t)=>Number(!!t.current)-Number(!!e.current)||t.lastSeenAt-e.lastSeenAt)}function Qs(e){if(typeof e!=`string`)return null;let t=e.trim();return RegExp(`^[0-9]{4,12}$`).test(t)?t:null}function $s(e,t=0){switch(e){case`not-passive`:return`This device is not a passive device, so there is nothing to unlock.`;case`no-pin`:return`No unlock PIN is set on the desktop. Set one from a trusted phone: Settings › Connection › Passive devices.`;case`wrong-pin`:return`Wrong PIN.`;case`rate-limited`:return`Too many tries. Try again in ${Math.max(1,Math.ceil(t/60))} min.`;case`bad-request`:return`A PIN is 4–12 digits.`}}function ec(e){return/\.apk$/i.test(e.name)||/\.apk$/i.test(e.relPath)}function tc(e,t=Date.now()){if(!(e>t))return null;let n=new Date(e),r=e=>String(e).padStart(2,`0`);return`Unlocked until ${r(n.getHours())}:${r(n.getMinutes())}`}var nc=`Pairing a passive device switches on "require the password over Tailscale", so every device needs its own token on Tailscale too — sign in again on any browser that has none.`,rc=[`Bash(git push --force*)`,`Bash(git push -f*)`,`Bash(git push * --force*)`,`Bash(git push * -f*)`,`Bash(git push * main)`,`Bash(git push * main *)`,`Bash(git push * master)`,`Bash(git push * master *)`,`Bash(gcloud run deploy *)`,`Bash(gcloud app deploy *)`,`Bash(vercel --prod*)`,`Bash(vercel * --prod*)`,`Bash(fly deploy*)`,`Bash(gh release create*)`,`Bash(gh pr merge*)`,`Bash(npm publish*)`,`Bash(terraform apply*)`,`Bash(kubectl apply*)`],ic=[`claude`,`claude-local`,`claude-endpoint`],ac=/[\u0000-\u001f\u007f]/,oc=/^[A-Za-z][A-Za-z0-9_-]*(?:\(.+\))?$/;function sc(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||t.length>200||ac.test(t)||!oc.test(t)?null:t}function cc(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return`r${t.toString(36)}`}var lc=e=>e.replace(/\s+/g,` `).trim();function uc(e){return dc([e.kind,e.multi?`multi`:`single`,lc(e.question),...e.options.map(e=>`${e.index}\u0000${lc(e.label)}`),...e.nav?[`nav`]:[],...e.freeText?[`text`]:[]].join(``))}function dc(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t.toString(16).padStart(8,`0`)}var fc=1e3;function pc(e){if(typeof e!=`string`||!e.trim())return`the answer has no words in it`;if(e.length>1e3)return`the answer is ${e.length} characters, and a typed answer is at most ${fc}`;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n>=127&&n<160)return`the answer holds a control character (0x${n.toString(16).padStart(2,`0`)}) — a typed answer is one line of words`}return null}function mc(e,t){return!!e&&uc(e)===t}var hc=[A(`snippets`),A(`headerCmds`),A(`fanout.presets`),A(`toolbar`),A(`launch`),A(`launchAsk`),A(`spendWarn`),A(`pad`),A(`hiddenRepos`),A(`enterSends`),A(`dictate.terms`),A(`autoSend`),A(`updates.autoCheck`),A(`serialSessions`),A(`confirmQueue`),A(`confirmClose`),A(`readerTools`),A(`annKnobs`),A(`annTools`),A(`hints`),A(`repoColors`),A(`installAllow`),A(`backlog.closeWhenDone`),A(`local.maxSessions`),A(`agentWarn`),A(`agentWindowWarn`),A(`tabsShared.order`),A(`tabsShared.opens`)];A(`local.maxSessions`),A(`agentWindowWarn`);function gc(e){let t=(e??``).trim();if(!/^\d{1,7}$/.test(t))return gt;let n=Number(t);return n>=5e4&&n<=2e6?n:gt}A(`backlog.closeWhenDone`);function _c(e){return hc.includes(e)}var vc=[{id:`spectrum`,label:`Spectrum`,note:`Twelve hues round the whole circle, at least 28° apart.`,hues:[200,228,256,284,312,340,8,36,64,92,130,168]},{id:`cool`,label:`Cool`,note:`Green through violet — eight hues, nothing warmer than a jade.`,hues:[100,128,156,184,208,232,260,288]},{id:`warm`,label:`Warm`,note:`Magenta through amber — six hues, nothing colder than a gold.`,hues:[300,330,356,20,46,76]},{id:`cvd`,label:`Colour-blind safe`,note:`Six hues that survive simulated colour blindness — fewer colours, none confusable.`,hues:[204,30,178,348,60,248]}],yc=`spectrum`;function V(e){return vc.find(t=>t.id===e)??vc[0]}var bc={palette:yc,by:{}};function xc(e){return typeof e!=`number`||!Number.isFinite(e)?null:(Math.round(e)%360+360)%360}function Sc(e){let t=e&&typeof e==`object`?e:{},n=V(typeof t.palette==`string`?t.palette:void 0).id,r={},i=t.by&&typeof t.by==`object`?t.by:{};for(let[e,t]of Object.entries(i)){if(!e)continue;let n=xc(t);n!=null&&(r[e]=n)}return{palette:n,by:r}}function Cc(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return t}function wc(e,t){return t.hues[Cc(e)%t.hues.length]}function Tc(e,t){let n=t.by[e];return typeof n==`number`?n:wc(e,V(t.palette))}function Ec(e,t){return typeof t.by[e]==`number`}function Dc(e,t,n){let r={...e.by};if(n==null)delete r[t];else{let i=xc(n);if(i==null)return e;r[t]=i}return{...e,by:r}}function Oc(e,t){return{...e,palette:V(t).id}}function kc(e,t){let n=new Map,r=[];for(let i of e){let e=Tc(i,t),a=n.get(e);a?a.push(i):(n.set(e,[i]),r.push(e))}return r.map(e=>n.get(e)).filter(e=>e.length>1)}function Ac(e,t,n){let r=V(t.palette).hues,i=new Map;for(let r of e){if(r===n)continue;let e=Tc(r,t);i.set(e,(i.get(e)??0)+1)}let a=r[0],o=1/0;for(let e of r){let t=i.get(e)??0;t<o&&(a=e,o=t)}return a}function jc(e,t){let n=t,r=new Map;for(let t of e){let e=Tc(t,n);r.set(e,(r.get(e)??0)+1)}for(let i of e){if(Ec(i,t))continue;let a=Tc(i,n);if((r.get(a)??0)<=1)continue;let o=Ac(e,n,i);o!==a&&(r.set(a,(r.get(a)??1)-1),r.set(o,(r.get(o)??0)+1),n=Dc(n,i,o))}return n}var Mc={"queue.hold":{title:`Hold until the session can take it`,what:`Keeps this message in the queue until that session's turn has ended, no question box is open and it isn't blocked on a usage limit — then it goes on its own.`,when:`Text typed at a working agent lands in its composer mid-answer; text typed at an open question box answers the box instead of running. Holding avoids both. Exact for sessions that report turn boundaries, a guess from silence otherwise.`,confirm:!0},"queue.sendnow":{title:`Send it now, without waiting`,what:`Types the next queued message into this session immediately, instead of waiting for the turn to end. It drops the park on that message — and on anything queued AHEAD of it in the same session, because a session's queue is delivered in order and a held message behind it would hold this one too.`,when:`For when the turn has gone somewhere you did not expect and the follow-up is worth typing in mid-answer. It is refused, in words, when that session has a question box open or is blocked on a usage limit — prose typed into a dialog answers the dialog instead of running.`,confirm:!0},"queue.serial":{title:`Wait for this repo's other sessions`,what:`This row opens a session AND runs a prompt in it. With this on, it doesn't start until every other session in the same directory has finished its turn.`,when:`Several prompts queued for one repo would otherwise all open their own agent at once — one account's usage limit spent in parallel, nothing finished, and several agents editing the same files. Off means this one starts regardless. “Send this one now” also overrides it.`,confirm:!0},"queue.serialall":{title:`One session at a time per repo`,what:`The default for newly queued prompts that open a session: run them one after another within a repo, rather than all together.`,when:`Turn it off when you actually want the fan-out — usually you don't, because a fan-out belongs in separate worktrees, which this rule treats as separate repos anyway.`},"queue.retarget":{title:`Aim it at another session`,what:`Keeps the words, changes the destination — another live session, or a repo's backlog.`,when:`For when the session it was written for died, or the thought belongs to a different repo now. A fresh receipt id is minted, so it cannot collide with a verdict the host already recorded for the old one.`,confirm:!0},"queue.addprompt":{title:`Queue another prompt behind this one`,what:`This row OPENS a session. Prompts added here run inside it, one at a time — each delivered only after the one before has finished its turn.`,when:`Writing a plan with no link: “read the failing test” → “fix it” → “commit”. Queued as a chain rather than concatenated into one prompt.`,confirm:!0},"queue.restore":{title:`Put the text back in the message box`,what:`Takes it out of the queue and drops the words back into the composer, so you can rework them and send again.`,when:`Messages only. An action (fan out, run a build) and an answer to a question have no text worth pasting, so it is disabled for those.`},"queue.resend":{title:`Rewrite it and send it again`,what:`Opens the message in an editor, checks every file it names against the repo, the send queue and this phone, and sends it as a NEW message once you are happy with it.`,when:`For a send that gave up. Retrying re-sends the same words to the same place with the same attachments — which is exactly what already failed. By the time a link is back the words are often half wrong, and the photo behind them may have been dropped from the queue underneath, leaving text that points at a file nobody is sending.`,confirm:!0},"queue.sendone":{title:`Send this one now`,what:`Releases this message — and anything queued ahead of it for the SAME session, because one session is delivered strictly in order.`,when:`Other sessions stay held. If an attempt already failed, this is the retry.`},"queue.sendall":{title:`Send everything queued`,what:`Releases every message in the queue. Each session still takes them one at a time, in the order shown.`},"queue.retryall":{title:`Try every failed message again`,what:`Puts every message that gave up back in the queue with a fresh retry budget. Works with the link down — they go out when it is back.`,when:`A tunnel down for longer than a message is allowed to wait expires the whole backlog on the first reconnect, so the list is red all at once. Messages that were typed into a live session but never seen to submit are left out: re-sending one of those could type it twice, so it stays a per-message decision.`},"queue.remove":{title:`Discard this message`,what:`Drops it from the queue. It is never sent, and the text is gone unless you put it back in the message box first.`,danger:!0},"queue.more":{title:`The other actions`,what:`Reorder within this session, hold it until this session is free, aim it somewhere else, or put the text back in the box.`,when:`They live behind “⋯” because eight icons beside the message would leave no room to read the message.`},"queue.moveup":{title:`Move earlier`,what:`Sends it sooner within this session. Order only matters inside one session — different sessions are delivered at the same time.`},"queue.movedown":{title:`Move later`,what:`Sends it after the next one in this session.`},"compose.idle":{title:`Send when the agent is free`,what:`Queues the prompt and delivers it once this session's turn has ended — instead of typing it into a session that is mid-answer.`,when:`Same rule as the queue's hourglass. The plain send button delivers immediately, which is what you want when you are interrupting on purpose.`,confirm:!0},"compose.options":{title:`Where and when this goes`,what:`Opens the send sheet with what you have typed already in it: which session, a fresh session or a set of repos it is aimed at, and — in five answers — when it goes: now, when that session is free, at a time you pick, after another item finishes, or once its files have arrived. The button at the bottom always restates the whole decision before you press it.`,when:`Whenever “send” is not quite what you mean. The plain Send button stays one tap for the ordinary case; everything the old start, resend and schedule sheets used to ask lives here now, in the order you would ask it.`},"activity.open":{title:`Everything you have posted`,what:`One row per piece of work, for its whole life — waiting on this phone, held on the desktop, running, scheduled, finished, or failed. A row never disappears when its state changes; it changes what it says. Each one carries the repo its words were written for, so sending it again asks you nothing.`,when:`When you want to know what became of something. This replaces hunting through the queue, the backlog, the schedules and the network sheet for the same answer.`},"compose.cli":{title:`Type straight at the CLI`,what:`Turns the message box into a keyboard wired to the session: every key goes through as you press it, and the CLI echoes it on the screen above. Tap the terminal to bring the keyboard back up.`,when:`For driving the TUI — picking a file in /resume, walking a menu, answering a free-text box, typing “y”. Nothing is queued, confirmed or resent, so with the link down the keys are simply lost; a prompt you care about wants the normal send.`,confirm:!0},"toolbar:fork":{title:`Fork this conversation`,what:`Opens a SECOND session that continues this exact conversation from where it stands. The original keeps running and is untouched.`,when:`Trying a risky direction without losing the thread you already have.`,confirm:!0},"toolbar:companion":{title:`Companion shell`,what:`Opens a plain shell in this session's folder, as its own tab. It is temporary: closing this session closes the shell with it.`,when:`Running a command by hand next to the agent — a sudo step it asked for, a quick look at a log — without leaving a shell lying around afterwards.`},"toolbar:select":{title:`Copyable text`,what:`Dumps what is on the terminal screen into a plain text sheet you can select and copy. In reader view there is no terminal, so it dumps the conversation instead — from the offline cache, so it works with the link down.`,when:`A terminal grid fights text selection on a phone; this is the way out.`},"toolbar:clip":{title:`Send to the desktop clipboard`,what:`Puts this phone's clipboard contents onto the DESKTOP host's clipboard.`},"toolbar:shot":{title:`Screenshot the desktop`,what:`Captures the host's whole screen and shows it here.`},"toolbar:ctx":{title:`Context window`,what:`Runs /context in this session — how much of the model's window this conversation is using.`},"toolbar:usage":{title:`Cost`,what:`Runs /cost in this session.`},"toolbar:cpu":{title:`Desktop load`,what:`CPU and memory of the machine running the agent, as a toast.`},"toolbar:teleport":{title:`Teleport`,what:`Runs the CLI's /teleport command in this session.`},"toolbar:remote":{title:`Remote control`,what:`Runs the CLI's /remote-control command in this session.`},"toolbar:tasks":{title:`Tasks`,what:`Runs the CLI's /tasks command in this session.`},"toolbar:outline":{title:`Outline`,what:`A table of contents for this conversation: one row per prompt, with what it did and which files it touched. Tapping a row jumps there in the reader.`},"toolbar:sent":{title:`Sent commands`,what:`Everything this app typed into this session, when, whether the app or you decided it, and whether delivery actually worked.`,when:`Automation types through the same terminal a person does, so the scrollback alone cannot tell you who sent what.`},"toolbar:find":{title:`Find in this session`,what:`Searches the visible output, and separately the prompts recorded for this session.`},"toolbar:scrollback":{title:`Scrollback`,what:`Earlier terminal output, kept ON THIS DEVICE. Panning up in the terminal scrolls the agent's own screen and needs the connection; this reads the copy saved here, so it works with the tunnel down. Only as far back as this phone was watching.`},"toolbar:diff":{title:`Git`,what:`Status, diffs, staging, commit and push for this repo.`},"toolbar:files":{title:`Files`,what:`The gallery: what the agent has produced in this repo, and what you have sent it.`},"toolbar:browse":{title:`Browse the repo`,what:`The worktree as a folder tree — every file, not just the deliverables the gallery lists. Open one to read it, and edit it in place when that is quicker than asking.`,when:`A save carries the version you opened, so a file the agent rewrote in the meantime is refused rather than overwritten — and saving needs the link, since a write held until later would land on a file that has moved on.`},"toolbar:build":{title:`Builds`,what:`Named build commands for this repo, run WITHOUT a session — the way to still produce an APK while the agent is rate-limited.`},"toolbar:model":{title:`Model`,what:`Relaunches this session on a different model, resuming the same conversation.`},"limit.open":{title:`Sessions at the usage limit`,what:`Lists every session blocked on a usage limit, in the order the host will resume them — one at a time, not all at once.`,when:`A plan limit is an account fact, so sessions hit it as a group and all read the same reset time. This is where you say which one matters.`},"compose.later":{title:`Run it at a time you pick`,what:`Hands the prompt to the schedule editor instead of sending it. It runs in THIS repo's backlog at the time you set — once, or every week.`,when:`The prompt box still holds your text until you save the schedule, so cancelling loses nothing. A scheduled prompt is aimed at the repo, not at this session: session ids do not survive a host restart.`,confirm:!0},"fanout.schedule":{title:`Run this sweep later`,what:`Takes the repos and the prompt you just composed into a schedule — once at a time you pick, or every week.`,when:`For the sweep that should run while you are asleep, or two hours before your weekly usage window rolls over and the leftover quota evaporates.`},"schedule.runnow":{title:`Run it now`,what:`Fires the schedule immediately — the same sweep, off the clock.`,when:`It does NOT use up the next scheduled run: testing Thursday's sweep on Tuesday still leaves Thursday armed.`},"schedule.session":{title:`Open the session this ran in`,what:`Jumps to the session this occurrence used, so you can read what it actually did.`,when:`Only where there IS one session to go to — a fan-out ran in N of them, and that is the fan-out view's job.`},"schedule.buildrun":{title:`Open the run this rule last started`,what:`Opens the repo's builds on the run this build rule started most recently, with its log and outcome.`,when:`The card says how that run ended and when, so a failed nightly build is one tap from its log. Only shown once the rule has started a run.`},"schedule.backlogitems":{title:`The items this rule has written`,what:`Opens the Backlog on exactly the rows this schedule created, however many runs ago.`,when:`The other direction of the link a row already shows (“from the schedule …”). The number is the filter — a tap opens those rows and says what it is hiding, never the whole list. Rows written before this link existed do not count towards it.`},"schedule.skipnext":{title:`Skip the next run`,what:`Lets one armed occurrence go by; everything after it stays on the clock.`,when:`Different from pausing, and the difference is who has to remember: a pause waits for you to come back, a skip does not. Never offered on a one-off — skipping the one run it has would be deleting it.`},"schedule.toggle":{title:`Arm or disarm this schedule`,what:`Stops it running without deleting it, and arms it again later.`,when:`Re-arming computes the next run from now — a run missed while it was off is not caught up.`,confirm:!0},"schedule.edit":{title:`Edit the schedule`,what:`Change the time, the lead, the repos or the prompt. Saving replaces the same schedule rather than adding a second one.`},"schedule.remove":{title:`Delete this schedule`,what:`Removes it for good. Anything it already started keeps running.`,danger:!0},"limit.first":{title:`Resume this one first`,what:`Moves this session to the front of the resume queue. Otherwise the order is starred sessions first, then whichever has been blocked longest.`,when:`When the limit lifts, the first session through gets the fresh window. Marking two keeps the order you marked them in.`,confirm:!0},"limit.auto":{title:`Auto-continue for this session`,what:`Whether this session resumes by itself once the limit resets. Off takes it out of the queue entirely — it waits for you.`,when:`The way to say “these three, not that one” when everything is blocked on one limit.`},"limit.resumeone":{title:`Resume this one now`,what:`Stops waiting for the reset time and tries this session immediately, ahead of the queue.`,when:`Also the way past the hold-off after a failed resume — an explicit tap overrules the clock. If the limit really has not reset, the attempt is spent for nothing.`,confirm:!0},"limit.resumeall":{title:`Start the queue now`,what:`Stops waiting for the clock for every queued session. They still go one at a time, in the order shown.`,when:`For a reset time the banner got wrong, or a plan that was just upgraded.`},"limit.starredonly":{title:`Only starred sessions resume`,what:`Turns auto-continue on for the starred blocked sessions and off for the rest, in one tap.`,when:`When the limit resets into a window worth spending on two sessions rather than eleven.`,confirm:!0},"limit.mode":{title:`How many resume at once`,what:`One at a time, one per repo, or all at once. The first session always goes alone whatever this says: if it comes back still blocked, nothing else spends an attempt proving the same thing.`,when:`“One per repo” is the middle answer — two agents must not edit one checkout, but two worktrees are not each other's business. “All at once” spends the fresh window broadly.`},"term.fullscreen":{title:`Full screen`,what:`Hides the header, the status line and the toolbar and gives those rows to whatever you are reading — the same layout typing room gives you, without the keyboard taking half the screen. The Esc/Tab/arrow row stays, because with no keyboard it is the only way to answer the CLI. Tap again, or the menu button in the corner, to come back.`},"hdr.pair":{title:`Claude · Shell`,what:`The session and its companion shell, as two tabs: the lit one is on screen, a tap on the other switches. They appear once the menu's "companion shell" has opened one in this session's folder — temporary, it closes when the session does. Gone in full screen and while typing, with the rest of the header.`},"term.read":{title:`Reader / terminal`,what:`Swaps the whole view: the live CLI screen, or the scrollable, searchable transcript of the conversation. It sits here rather than on the header because full screen hides the header — and this is the control you want most in the layout you read a long turn in.`},"term.grip":{title:`Move these buttons`,what:`Drag the grip to move the whole group of terminal buttons anywhere inside the terminal, off a line it is hiding. The terminal itself is not resized, so the CLI does not redraw. Double-tap the grip to put the group back in its corner. Where you put it is remembered on this phone only.`},"term.modelwheel":{title:`Model · effort wheel`,what:`Picks model and effort on one wheel: a spoke per model, effort from low at the centre to max at the rim. A tap only selects — the sentence above the wheel says what Apply will do, and only a change the CLI cannot make live relaunches the session. The prompt cache belongs to one model, so a switch makes the next turn re-write the context; the line under the wheel prices it. The chips below choose which models are spokes.`},"term.zoom":{title:`Zoom this screen`,what:`How big the terminal — or, in the reader, the conversation — is drawn, on top of the app's text size. In the terminal, smaller is a BIGGER grid: the desktop resizes the session to the new columns and rows, so more of what the CLI prints fits on the phone. The two surfaces remember their own zoom. At either end of the range that button is simply not there, and the readout says which end.`},"limit.global":{title:`Auto-continue, globally`,what:`The master switch: whether any session resumes itself after a usage limit resets. Per-session settings override it.`},"toolbar:limit":{title:`Auto-continue`,what:`Whether this session resumes by itself once a usage limit resets. Tapping cycles: inherit the global setting → on → off.`},"toolbar:image":{title:`Attach a photo`,what:`Picks an image, uploads it into this repo's inbox and puts its path in the message box, so the prompt can point at it.`},"toolbar:file":{title:`Attach a file`,what:`Any kind — PDF, zip, audio, source. Uploaded into this repo's inbox with its path put in the message box.`},"toolbar:backlog":{title:`Backlog`,what:`This repo's waiting work: what is queued, what is running, and why anything queued has not started yet.`},"toolbar:history":{title:`History`,what:`The prompts recorded for this session — resend one, pin it as the overview label, or copy it.`},"toolbar:cmd":{title:`Slash commands`,what:`The CLI's built-in commands plus this repo's own, in a list you can tap instead of typing.`},"session.star":{title:`Star`,what:`Marks a session as one you are waiting on. A starred session that finishes a turn while you are elsewhere gets a “new” flag. Works with the link down — the star is kept on this phone and sent to the desktop when the connection is back.`},"session.followup":{title:`Flag for follow up`,what:`A one-shot mark that this session has something to come back and read. Opening the session does not clear it — only “Done — clear flag” does, here or on its Recently closed row, so it survives a restart, a close and a resume. A bulk close spares it, and the repo's flag count shows exactly the flagged ones.`,when:`Its colour says who set it: blue is you, by hand; purple is a launch you ticked “Flag for follow up when done” on, once it finished; teal is the session's own agent, with its one-line reason under the row.`},"session.bookmark":{title:`Bookmark`,what:`Marks the conversation as one you will want to look at again, with an optional one-line note. Closing the session is fine: Archive › Bookmarks lists this repo's bookmarked conversations, and read opens one read-only without starting the CLI.`,when:`Needs the desktop — with the link down a tap says so. Removing a bookmark that has a note asks a second tap, because the note goes with it.`},"session.context":{title:`Context window`,what:`How full this conversation's window has been over time, with a mark where it was compacted and a shaded band over every stretch the account refused to serve. Read off the CLI's own conversation log, which is dated — the badge beside it can only say where you are NOW.`,when:`The window size is not written to that log, so no ceiling is drawn unless the CLI has printed one on screen; the dashed line is then where a compaction was last seen to fire, which is a measurement rather than a setting.`},"session.pin":{title:`Pin a line`,what:`Replaces the session's second summary line with text you choose, so a long-lived session says what it is FOR rather than what it last did.`},"session.close.all":{title:`Close sessions`,what:`Opens a sheet over every listed session (or one repo's): tick facets — state, idle time, open time, what is still running underneath, unsent words, whether the conversation ever started, repo — to narrow which rows one tap ends. The conversations are kept and can be reopened later; the running processes are not — anything mid-turn is cut off where it stands, and a background shell under a closed session is stopped too, fully.`,when:`The list, not this device: every phone and tab loses the closed sessions together. Star a session to spare it by default — the sheet's own toggle can include it anyway.`,danger:!0},"session.close.stale":{title:`Idle for`,what:`Two facets, "idle for" and "open for", cut the close sheet's list by how long a session has gone quiet or how long it has existed — tick more than one edge (>1h, >6h, >1d, >3d) and they OR together; combine with another facet (state, underneath, …) and it ANDs.`,when:`"Idle" is measured from the last output, so a session paused on a question still counts as quiet by that clock — the sheet flags any row waiting on a box separately. A session with no readable activity record measures its quiet time only since the last desktop restart, and the sheet says so when that applies.`},"repo.hide":{title:`Hide this repo`,what:`Removes it from the launcher list on THIS device only. Nothing on disk changes; unhide it from Settings.`},"repo.focus":{title:`Focus this repo`,what:`Filters the whole launcher down to one repo. The header keeps an X to leave.`},"fanout.run":{title:`Fan out`,what:`Runs ONE prompt in every selected repo — a fresh session each, all at once.`,when:`The sweep that is otherwise N taps and N retypings (“/init everywhere”, “what did this cost this month?”). Each target is a real agent process, so pick the repos deliberately.`,confirm:!0},"fanout.followup":{title:`Follow up`,what:`Sends a second instruction into the sessions this run ALREADY opened.`,when:`It never spawns: a target whose session is gone is reported failed rather than restarted from scratch, because a fresh session would run “now commit that” against a repo that never did step one.`,confirm:!0},"backlog.fire":{title:`Run this item now`,what:`Starts it this second in a session of its own (or in the session it is aimed at) — skipping the queue: the budget, one at a time and wait until free.`,when:`For the one item you want now — it is the manual override, and one tap fires it past every hold. Several at once are several agents; if another agent is already working in this checkout, the row says so and the tap starts a second beside it.`,confirm:!0},"backlog.queuehere":{title:`When that session is free`,what:`Aims the item at the session on screen and marks it to fire on its own when that session is next idle — at the BOTTOM of that repo's queue, so tapping several items runs them in the order you tapped them.`,when:`For building a run of work against a session you are already driving. Tap it again to take the item back off; nothing is deleted either way.`},"backlog.refire":{title:`Run it again`,what:`Re-delivers an item that already ran, this second and in a session of its own — skipping the queue like fire. The agent sees the instruction a second time.`},"backlog.openholder":{title:`The session this item waits behind`,what:`Only one automatic job codes in a checkout at a time. This item is waiting for the one named here — working, on a usage limit, or with a question open that only you can answer. Opens that session.`,when:`When the row says it is waiting for your answer: answer it there and this item starts next. Fire skips the wait entirely.`},"backlog.runagain":{title:`Put it back in the queue`,what:`Puts a failed item back among the waiting ones, keeping its words, its place and the failure it had. It runs again in a new session of its own when its turn comes — one at a time in this repo, with auto taking it from there.`,when:`For work that failed for a reason that has passed. Nothing starts this second: “re-fire” beside it is the verb for that. The old failure stays on the row, so an item that keeps failing says so rather than looking new.`,confirm:!0},"backlog.name":{title:`Name these items`,what:`Reads the words of the items shown here — nothing else, no repo, no code — and writes each one a short title and a kind: bug, feature, enhancement or chore. It leaves out any item you titled yourself, and any it cannot name honestly stays without one.`,when:`For a list of long prompts that all look alike. One short call on the cheap model, so it costs little; it names only what is in the cut you are looking at, and running it again on the same rows changes nothing. A title it writes is yours to edit, and once you edit one nothing writes over it again.`},"backlog.done":{title:`Mark done`,what:`Closes the item off by hand, without running it.`},"gallery.pull":{title:`Download`,what:`Fetches the file to this phone through the resumable queue — the bytes survive a dead tunnel, a reload and the app being killed — and hands it to the phone's own Downloads by itself when it lands.`,when:`The same button everywhere: already fetching, a tap opens Downloads rather than starting a second copy; already here, it saves the file out again. Watch or pause it in Downloads.`,confirm:!0},"gallery.fullres":{title:`Full resolution`,what:`Re-fetches this image at its original size. The viewer shows a screen-sized copy by default, which is a fraction of the bytes.`},"pull.supersede":{title:`Keep only the newest`,what:`When a rebuild writes a new file of the same kind, the older queued one is dropped instead of being downloaded first.`,when:`An APK named with its build hash is a new file every build — without this an afternoon of builds queues five of them and the phone downloads all five to reach the one you wanted.`,confirm:!0},"pull.pause":{title:`Pause`,what:`Stops this download and KEEPS what has arrived. Resuming continues from that byte; it does not start over.`},"pull.retry":{title:`Retry`,what:`Tries again from the bytes already here.`},"pull.clearall":{title:`Clear the queue`,what:`Drops every download still waiting — the desktop's own queue and the ones asked for from this phone. Files already fully downloaded stay on the phone.`,danger:!0},"pull.auto":{title:`Auto-download`,what:`Whether files matching this repo's rule start downloading by themselves as soon as the agent produces them. A file YOU tapped is fetched whatever this says — the switch governs unattended work, not a person.`},"net.pulse":{title:`Connection strip`,what:`Live round-trip time to the desktop: a state dot, the last ~90 seconds as a graph, and the current number. Red marks are pings that got no answer at all — they are drawn rather than averaged in, because a link that loses one ping in four feels nothing like a slow one and only that one eats prompts. In the middle, how old what you are looking at is: while the link is down it counts up from the last thing the desktop actually said, and while it is up it is the age of the last full sync — the session list AND the repo listing, whichever is older. On the right, how much data this phone has moved: the down and up rates while something is actually transferring, and the running totals either way.`,when:`It only watches — a missed ping here never reconnects anything. Tap any part of it for that part's detail, or turn it off in Settings › Tools.`},"net.pulse.graph":{title:`Round trip`,what:`How long a ping to the desktop takes, drawn as the last ~30 probes. A second, dimmer number appears when the newest probe is far off the median, so one slow ping can't be the only figure on screen.`,when:`Tap for the window it is drawn from: last and median ping, how many probes are in it, and how many got no answer.`},"net.pulse.route":{title:`Route`,what:`How this phone reaches the desktop: LAN (its address on your Wi-Fi, used only after it proved it is this desktop) or the tailnet, the route that works anywhere.`,when:`Tap for the sentence saying why this route — the Wi-Fi name, the check that failed, or that a password is needed on the host before LAN can be used.`},"activity.group":{title:`One row per distinct message`,what:`Collapses rows that say the same thing into one strip: how many copies there are, how old the oldest is, and — the part that decides — whether one of those copies ALREADY RAN. Tap the chevron to see them all.`,when:`Always, on a long list. Unresolved sends are mostly repeated re-sends of the same few texts, because that is what a person does when the app says their prompt did not run.`},"activity.debris":{title:`Hide one-word replies`,what:`Hides “continue please”, “done?”, a bare /cost — words that mean nothing away from the screen they were typed on. Nothing is deleted; tap again to see them.`,when:`When you are reading a long failed list and want only the rows with a subject in them.`},"activity.bulkDismiss":{title:`File these away as dealt with`,what:`Marks the selected rows read-and-not-wanted. NOT a delete: they keep their words, their verdict and their buttons under the “dismissed” chip, and “bring back” returns them to the list.`,when:`After you have decided a batch is obsolete. It is what makes the list shrink.`,confirm:!0},"activity.bulkRefire":{title:`Send these again`,what:`Posts each selected row's words again in the repo they were written for — no picker, no retyping. Each one opens its own session when the desktop has room, and their old rows are filed away.`,when:`For the survivors of a triage pass: the ones that never ran and still make sense.`,confirm:!0},"net.pulse.sends":{title:`Sends that gave up`,what:`Prompts written on this phone that never made it into a session — the queue tried, ran out of tries, and stopped. Nothing ran, and nothing here retries itself. The words are kept: the queue row holds them for as long as it takes, and nothing retires it.`,when:`Tap for the list, with each one's words, what stopped it, and the repo it was written for — “send again” puts it back in that repo's backlog, with no picking and no retyping. This slot used to count unanswered PINGS; those are drawn in the graph instead, because a lost ping costs nothing and this does.`},"net.pulse.saved":{title:`Is it on the desktop yet?`,what:`The one reading on this strip that is about your words rather than the link. A green check means everything written on this phone — queued prompts, armed schedules, notes, settings — has reached the desktop and been stored there, so nothing is waiting on this device. A count instead means that many things are still only here; they go as soon as the link allows.`,when:`Look before putting the phone away. It stays blank until this phone has actually had something in flight, and it yields to the red slot when a send has given up — “all saved” beside “1 send stuck” would be a contradiction, and the red one is the one to believe.`},"net.pulse.when":{title:`How current this is`,what:`With the link down, how long since the desktop last said anything — the app keeps drawing from saved copies, and this is their age. With it up, how long since the last full refresh of both the session list and the repo listing; the older of the two is the one shown, because that is when everything on screen was last true.`,when:`Tap for the exact times, and for which half is still missing when it says it is syncing.`},"net.pulse.data":{title:`Data moved`,what:`How much this phone has downloaded and uploaded since the counter was last reset. A speed appears beside the arrow only while something is actually transferring, so no speed means nothing is moving.`,when:`Tap for the totals in full and for exactly what is and isn't counted.`},"hints.toggle":{title:`Explain mode`,what:`While it is on, tapping any button says what that button does instead of doing it. Tap it again to leave.`,when:`Long-pressing a button does the same thing one at a time, at any moment, without switching anything on.`},"schedule.spent":{title:`One-offs that have been and gone`,what:`A one-off schedule that has already fired — or that was missed — is not a schedule any more: there is no instant left for it to run at and it cannot be re-armed. So it stops being a row on this sheet and becomes a row in Activity, where every piece of posted work is kept for its whole life.`,when:`Tap to open exactly those rows in Activity, filtered — not the whole list for you to find them in. Run it now still works on one from there: the host revives a spent one-off and fires it.`},"localrt.bar":{title:`How hard this desktop is working`,what:`A live readout of the machine: CPU busy and its recent line, GPU busy, and memory available — amber when memory is tight. While a local model is loaded, that model takes the front of the strip: its name, the bytes it holds and their line. It watches — it never starts, stops or evicts anything.`,when:`A hosted model costs money on somebody's invoice; a local one costs this machine, and so does a build or twenty sessions — all invisible from a phone otherwise. Tap any reading for the full sheet; switch the strip off in Settings.`},"localrt.models":{title:`The models resident right now`,what:`Each model the runner is currently holding, with the bytes it occupies. Empty means the runner answered and is holding nothing, which is a different fact from the runner not answering at all — the strip words those two apart.`,when:`Tap for the full list: per-model size, how much of it is on the GPU, and when the runner intends to evict it.`},"localrt.graph":{title:`Held memory over the last few minutes`,what:`One mark per sample of the total bytes resident. A sample where the runner did not answer is drawn as its own full-height mark rather than averaged in or bridged over — those are a different kind of event, not a small number.`,when:`This is what a model being loaded or evicted looks like: a step, not a slope. It is the last hundred-odd samples, not a time axis — nothing is measured while the phone is in a pocket.`},"localrt.cpu":{title:`The desktop's CPU`,what:`How busy the machine is, from the operating system — not from the model. With no model loaded the strip leads with it, and the line beside it is the last few minutes of it. A local model generating text pins this; a model sitting loaded and idle does not.`,when:`Tap for the detail. Tokens per second is deliberately not shown anywhere here: nothing this app can read publishes it, and an estimate would be wrong in both directions that matter.`},"localrt.memory":{title:`Memory available on the desktop`,what:`What a new program could actually get, from the operating system — the file cache counts as available, because it is handed back on demand. It is the number a second local model would have to fit into. Amber when less than a tenth is left or the swap file is nearly full.`,when:`Good enough to warn on, nowhere near good enough to refuse work on, which is why nothing in this app ever blocks a launch over it.`},"localrt.agents":{title:`Agents running at once`,what:`Every session whose turn is running, plus every subagent running under any session on this desktop, added up. Amber past your warning mark, red past your limit — both set in Settings → Appearance (default 10 and 30). Crossing a mark on the way up also says so once.`,when:`Past a mark the strip shows itself even when it is switched off; its × hides it until the count passes your next mark. Tap for the count over time and which sessions hold the agents — a row opens that session. It only counts and colours: nothing here stops an agent or refuses a launch.`},"session.tabs":{title:`A session you have open`,what:`One tab per live session, coloured by its repo — the same colour that repo wears on the launcher's group header and down the side of every one of its rows, so a tab is recognised before it is read. The taller tab with a cap of colour on it is the one you are in. The mark beside the name is what that session is doing, in the launcher’s own five words and five colours: a turning ring while a turn is running, a red dot waiting on an answer from you, an orange one at the usage limit, a grey one with nothing left to do, and a red one on a process that has exited.`,when:`Tap to go straight there from wherever you are — everywhere else in the app the sessions are a column you scroll. The × closes that session and asks first; the conversation itself is kept either way. How many tabs fit, what order they sit in, and which colour each repo gets are all in Settings.`},"repohealth.size.p95":{title:`p95 file length`,what:`The length of the file at the 95th percentile: 95 out of 100 source files in the tree are shorter than this. Counted in lines, over the source set — whichever file kinds this repo's own detected languages count as source, minus their tests, minus build and vendor directories. The sheet names which languages it found.`,when:`A mean would be a number about the single biggest file and almost nothing else — one outsized file can carry a large share of every source line on its own. The p95 describes what a large file looks like with that kind of outlier already inside the 5% being ignored, so it moves when MANY files grow and barely twitches when one does. The tape at the foot of the sheet names the longest file and its length.`},"repohealth.retouch.rate":{title:`The re-touch rate`,what:`Over a trailing window of days, the share of file touches that were re-touches: the same file edited again soon after — soon in HOURS, or within a couple of commits that are also close in time — AND the later edit changes or removes lines the earlier one added. A touch that only adds lines near the last one (an append to a list or a registry) is not rework: it is counted apart and printed beside the rate, never in it. Sweep commits touching most of the tree are left out of both halves of the fraction. The touches it is a share of, and the three most re-touched files, are printed beside it. The exact window, hour and commit distance are pre-registered in the tool, not written down on this phone.`,when:`A file edited once and left alone is a decision that held; a file edited again two days later is one that did not. It is also the one number here that does not fall simply because more code was written, which is why the sheet plots it at all. Read it with its denominator: 1.00 over 6 touches and 0.69 over 36 are different claims.`},"repohealth.hatches.perKloc":{title:`Unexplained escape hatches per kLOC`,what:"How many places a rule was switched off WITHOUT a reason, per thousand source lines. Each detected language has its own marks — TypeScript's `as any` and `@ts-ignore`, Kotlin's `!!` and `@Suppress`, Python's `# type: ignore` and a bare `except:`. A mark that carries its reason (after it on the line, or in a comment directly above) is explained and counted apart; TODO and FIXME are reported apart too, and neither is in this number. All three counts are printed beside it. Counted as OCCURRENCES, so two on one line count twice.",when:`Per kLOC rather than raw, or it would mostly plot how fast the repo is growing. Whether any single hatch was the right call is a judgment and this tool never makes one: there is no threshold anywhere in it, and no colour on this number. Only the marks a detected language knows about are counted — the sheet lists which languages are active.`},"repohealth.context.claudeMdChars":{title:`CLAUDE.md, in characters`,what:`The size of this repo's CLAUDE.md at the commit that was measured. It is re-sent on every turn of every session in this repo, so it is paid per TURN, not per session.`,when:`The repo-setup sheet weighs the same file and can disagree with this: that row measures the WORKING TREE as it stands, this one the last commit. An uncommitted edit to CLAUDE.md is exactly the gap between them, and neither is corrected to match the other.`},"repohealth.context.descChars":{title:`The always-on skill descriptions`,what:`The one-line description of every skill this repo ships, added up. Descriptions are always in the window — that is how the agent knows a skill exists at all. Skill BODIES are loaded on demand and are not counted here.`,when:`Moving prose out of CLAUDE.md into a skill body takes it out of both numbers. Splitting one skill into six adds six descriptions, so a tidy-up that reads as a reduction can raise this half while lowering the other.`},"repohealth.context.skillCount":{title:`The count of skills`,what:`How many skills this repo ships at the commit that was measured — the same set the descriptions above are the descriptions OF, so the two can never describe different populations. It counts skills, not their size: a body is loaded on demand and weighs nothing here.`,when:`The one tile with no percentile and no arrow under it, and that is deliberate. A rise can be reference leaving CLAUDE.md for a skill that loads only when it is needed, and a rise can be one skill split finer than its subject divides — the count is identical either way, so the tool draws the shape and takes no position. Read it beside the other two: those move in opposite directions when reference is relocated, and this says how many pieces it landed in.`},"repohealth.untested.count":{title:`Modules no test reaches`,what:`Source modules that no test file names AND that no test reaches through imports — a test importing a module that imports this one, to any depth, by the import syntax of the detected language. A name has to carry at least one DIRECTORY segment, never a bare word on its own: a bare name is also ordinary prose, and matching it alone would mark most of the tree tested for no reason. The sentence under the tile adds the modules reached only through another module's imports, and what joined and left the list since the window opened.`,when:`A count and not a percentage, because a ratio rises when you add a tested feature and falls when you add an untested one, which mostly plots growth. Nobody can write a test for 27%; a list can be closed one line at a time. Reached means a test LOADS the module, never that its lines ran — and a module a test only reads as text counts as named without the modules it imports counting as reached. A language with no naming rule of its own sits outside this count rather than inside it, neither tested nor untested; one with a naming rule but no import rule is read on naming alone. In a language whose own tests sit beside what they test rather than importing it, a test that needs no import names nothing, so this count reads high there even where the tests do exercise the code.`},"repohealth.reading":{title:`The percentile and the arrow`,what:`Under every tile: where today's value sits among that series' own recent readings, and the direction of a straight line fitted through them. Too short a history and both are withheld, and the tile says so rather than guessing. How long the window is and how short is too short are the tool's, carried on the wire and printed in the caption under the tiles — this card does not keep a second copy to go stale.`,when:`The comparison is always a series against ITS OWN past — never another repo, never a target, and never a threshold. The arrow carries no colour because rising lines and rising escape hatches are opposite news and a hue would have to decide which.`},"repohealth.weight":{title:`Always-on weight over time`,what:`CLAUDE.md and the skill descriptions stacked, so the top edge is the total that every turn of every session re-sends. Zero-based, unlike the tiles above, because it is a quantity rather than a position.`,when:`A day where either half went unmeasured is a gap in BOTH bands, never a shortened top edge: the sum is the one mark a reader takes off this chart, and a total quietly short by an unknown amount would be read as a real drop.`},"repohealth.areas":{title:`What a change carries, per area`,what:`On the latest reading only. The hollow end is what an edit in that area usually carries — CLAUDE.md, every skill description, the area's router and the sub-skills that area's own files claim. The solid end is the same with every one of that area's skill bodies loaded.`,when:`Re-partitioning the skills moves the near end and cannot move the far one; deleting prose moves both. One scale across every row, zero at the left, so the areas are comparable to each other. This exists only in a repo that splits its skills into a router and sub-skills named after it; elsewhere there is nothing to draw here, and the repo-wide weight above still does.`},"repohealth.packages":{title:`Lines of source by group`,what:"Source lines per source group, stacked over the series, so the top edge is the whole tree. A group is a top-level slice the tool derives from where the files sit — `packages/web`, `app`, `service`, or `.` for files at the root — never an npm workspace list, so it draws the same way whatever this repo's package manager is, if it has one at all. That is why there is no separate total-lines curve beside it — one quantity, one mark.",when:`A colour follows a group by NAME and never by its size today, so one group overtaking another does not swap their bands and re-colour the whole history. A group with no files on a day that WAS measured is a zero, not a hole.`},"repohealth.types":{title:`Lines of source by file type`,what:`The same source lines the chart above stacks by group, cut by what the code is instead: one band per file extension the detected languages claim, with the language pack that claims it named beside it. The top edge is therefore the same total drawn twice — one quantity, two questions.`,when:`A group says which part of the tree grew; a type says what grew in it, and in a repo where one app is one language those two answers look identical until the day they are not. The chips above the chart are a filter: tapping types off redraws the stack over only those, and the caption then says how many types and how many lines the top edge is standing for.`},"repohealth.classics.files":{title:`Source files`,what:`How many source files live in the tree, over time — the source set the sheet's detected languages count, minus their tests, minus build and vendor directories. A size, not a reading: nothing compares it to anything, which is why no percentile and no arrow appears beside it.`,when:`It is part of what the percentiles above are percentiles OF. A position in a window means nothing without a feel for the magnitude being positioned.`},"repohealth.classics.deps":{title:`Production dependencies`,what:"Runtime dependencies declared in the manifests a detected language knows how to read — a `package.json`, a `requirements*.txt`, the `[project]` table of a `pyproject.toml` — added up across the tree. devDependencies are counted apart and never summed into this: one ships and is in the attack surface, the other is a build-time cost that can be swapped on a Tuesday.",when:"Some languages decline this on purpose rather than guess: a Gradle build script is a program and not a list, and a `pubspec.yaml` mixes shapes a plain count would misread — so where nothing in the tree is a manifest this tool knows how to read, the reading is ABSENT rather than zero. Absent means nobody counted, never that nothing is depended on. Where it does read, it moves in single steps and each step is a decision somebody made, which is what makes the shape of this curve readable at a glance in a way a line count is not."},"repohealth.table":{title:`The readings, as numbers`,what:`The tail of the series as a table — p95 file length, the longest file, file count, lines per group, dependencies — oldest first, the same direction the charts run. Its own caption says how many day-rows it shows and out of how many.`,when:`Two of the band colours sit under 3:1 contrast on a light screen, so the split has to be readable without them. And a crosshair answers for one day at a time: this is the only place on the sheet where a day can be held against the day beside it.`},"repohealth.longest":{title:`The longest file, over time`,what:`The length of the single longest source file at every reading, one hue per file. Where a different file takes the top spot the line changes hue and a ring marks the reading it happened on, joined to the old holder by a thin step. Drag across the curve for a day's length, file and commit; the legend lists each file that held the spot and for how many readings.`,when:`A tree whose biggest file only grows is one where every change keeps landing in the same place. A split shows up here as the curve dropping and a new name taking over; a file that is merely renamed shows up the same way, so the name is printed rather than inferred.`},"repohealth.classics.tape":{title:`The longest files`,what:`One bar per file for the longest source files in the tree, tallest first, drawn to scale against each other. Tap or drag across a bar to name its file under the chart, with an open button that shows the file itself; tap the same bar again to let go. The caption names how many were taken and out of how many.`,when:`This is the feel-for-the-magnitude picture the rest of the sheet is measured against: a shape, not a lookup. It is a slice of the tail, so its middle bar is not the repo's median file and no median is printed for it.`}};function Nc(e){return e.def?e.explain?`explain`:e.mode!==`first`||!e.def.confirm||e.seen?`act`:`explainThenAct`:`act`}var Pc=2e4,Fc=12e3,Ic=18e4,Lc=class extends Error{url;ms;constructor(e,t){super(`timed out after ${Math.round(t/1e3)}s`),this.name=`TimeoutError`,this.url=e,this.ms=t}};function Rc(e){if(e instanceof Lc||e instanceof TypeError)return!0;let t=String(e);return t.includes(`Failed to fetch`)||t.includes(`NetworkError`)||t.includes(`fetch failed`)}async function zc(e,t,n=Pc,r=fetch){let i=new AbortController,a=t?.signal,o=()=>i.abort();a&&(a.aborted?i.abort():a.addEventListener(`abort`,o,{once:!0}));let s=setTimeout(()=>i.abort(new Lc(e,n)),n);try{return await r(e,{...t,signal:i.signal})}catch(t){throw i.signal.aborted&&!a?.aborted?new Lc(e,n):t}finally{clearTimeout(s),a?.removeEventListener(`abort`,o)}}var Bc=12e3;function Vc(e,t,n=50){return e.push(t),e.length>n&&e.splice(0,e.length-n),e}function Hc(e){return e.fuseFired?`timeout`:e.ageMs>=12e3?e.answered?`late`:`failed`:null}var Uc=4e3,Wc=3,Gc=e=>e.trim()===``;function Kc(e=[],t=[]){return{archived:e,screen:t}}function qc(e,t){if(e.length===0)return 0;let n=t.findIndex(e=>!Gc(e));if(n<0)return 0;let r=t.slice(n,n+Wc);for(let t=0;t<e.length;t++){let n=!0,i=0;for(let a=0;a<r.length&&t+a<e.length;a++,i++)if(e[t+a]!==r[a]){n=!1;break}if(n&&i!==0)return t}return e.length}function Jc(e,t,n=Uc){let r=Qc(t);if(r.length===0||$c(e.screen,r))return e;let i=qc(e.screen,r);if(i===0)return{archived:e.archived,screen:r};if(i===e.screen.length){let t=Yc(e.screen,r);if(t!==null)return{archived:Xc(e.archived,r.slice(0,t)),screen:r}}let a=e.archived.concat(Qc(e.screen.slice(0,i)));return{archived:a.length>n?a.slice(a.length-n):a,screen:r}}function Yc(e,t){let n=e.findIndex(e=>!Gc(e));if(n<0)return null;let r=e.slice(n,n+Wc);for(let e=1;e+r.length<=t.length;e++)if(r.every((n,r)=>t[e+r]===n))return e;return null}function Xc(e,t){let n=Qc(t);for(let t=Math.min(n.length,e.length);t>0;t--){let r=!0;for(let i=0;i<t;i++)if(e[e.length-t+i]!==n[n.length-t+i]){r=!1;break}if(r)return e.slice(0,e.length-t)}return e}function Zc(e){return e.archived.concat(e.screen)}function Qc(e){let t=e.length;for(;t>0&&Gc(e[t-1]);)t--;return t===e.length?e:e.slice(0,t)}function $c(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function el(e,t){return e.kind!==`all`&&e.kind!==t.kind?!1:e.since==null||t.since!=null&&t.since<=e.since}function tl(e,t){let n=e.filter(e=>el(e,t));if(!n.length)return null;let r=e=>+(e.kind===t.kind&&e.since===t.since);return n.reduce((e,t)=>r(t)===r(e)?t.savedAt>e.savedAt?t:e:r(t)>r(e)?t:e)}function nl(e,t,n,r){let i=(t.query??``).trim().toLowerCase(),a=t.since==null?0:r-t.since*1e3;return e.filter(e=>t.kind===`image`&&!n(e.relPath)||t.kind===`doc`&&n(e.relPath)||a&&e.mtime<a?!1:!i||e.name.toLowerCase().includes(i))}function rl(e,t,n){return e===`all`?`all|${n??``}`:`${t??``}|${e}`}function il(e,t){return`${e}|${t.kind}|${t.since??`all`}`}var al=[`7d`,`30d`,`90d`,`365d`],ol={"7d":6048e5,"30d":2592e6,"90d":7776e6,"365d":31536e6},sl={"7d":`older than a week`,"30d":`older than 30 days`,"90d":`older than 90 days`,"365d":`older than a year`},cl={outbox:`outbox — what agents wrote for you`,inbox:`inbox — what this phone uploaded`};function ll(e,t,n){return n-e>ol[t]}function ul(e){let t=0;for(let n of e)t+=n.size;return{count:e.length,bytes:t}}function dl(e,t){let n={};for(let e of al)n[e]={count:0,bytes:0};for(let r of e)for(let e of al)ll(r.mtime,e,t)&&(n[e].count++,n[e].bytes+=r.size);return n}function fl(e,t,n){let r=e.filter(e=>ll(e.mtime,t,n)).sort((e,t)=>t.mtime-e.mtime),i=ul(r);return{rows:r,count:i.count,bytes:i.bytes,total:ul(e),oldestMtime:r.length?Math.min(...r.map(e=>e.mtime)):null}}function H(e){if(!Number.isFinite(e)||e<0)return`?`;if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`,`TB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n<10?n.toFixed(1):Math.round(n).toString()} ${t[r]}`}function pl(e){return e.count?`Delete ${e.count} file${e.count===1?``:`s`} · ${H(e.bytes)}`:`Nothing to delete`}function ml(e,t){let n=e.total.count-e.count,r=e.total.bytes-e.bytes;return e.total.count?e.count?n?`${n} newer file${n===1?``:`s`} stay (${H(r)}).`:`Everything here is ${sl[t]}. Nothing would be kept.`:`Nothing here is ${sl[t]} — all ${e.total.count} files stay (${H(e.total.bytes)}).`:`Nothing here.`}function hl(e){let t=[];return t.push(e.deleted?`Deleted ${e.deleted} file${e.deleted===1?``:`s`} · ${H(e.bytes)}.`:`Deleted nothing.`),e.missing.length&&t.push(`${e.missing.length} already gone.`),e.failed.length&&t.push(`${e.failed.length} could not be removed — still on disk.`),t.join(` `)}var gl={collect:!0,prune:!0,keep:3};function _l(e){return e.collect?e.prune?`collected into .claude/outbox with a versioned name · the newest ${e.keep} of each kept`:`collected into .claude/outbox with a versioned name · nothing is ever removed`:`builds are offered exactly where they land, under whatever name they have`}function vl(e){return/^\d+$/.test(e)||/^v\d+$/i.test(e)?!0:/^(?=.*\d)[0-9a-f]{6,}$/i.test(e)}var yl=/[-_. +~]+/;function bl(e){let t=e.replace(/\\/g,`/`),n=t.lastIndexOf(`/`),r=n>=0?t.slice(0,n+1):``,i=t.slice(n+1),a=i.lastIndexOf(`.`),o=a>0?i.slice(a).toLowerCase():``,s=(a>0?i.slice(0,a):i).replace(/_\d+$/,``).split(yl).filter(e=>e&&!vl(e));return s.length?`${r}${s.join(`-`).toLowerCase()}${o}`:`${r}${i.toLowerCase()}`}function xl(e,t,n,r=t){let i=new Set(t.map(bl)),a=new Set(r),o=new Map;for(let t of e){let e=bl(t.relPath);if(!i.has(e))continue;let n=o.get(e);n?n.push(t):o.set(e,[t])}let s=[];for(let e of o.values()){e.sort((e,t)=>t.mtime-e.mtime);for(let t of e.slice(Math.max(1,n)))a.has(t.relPath)||s.push(t)}return s}var Sl=[1,3,5],Cl={1:`keep only the newest of each`,3:`keep the newest 3 of each`,5:`keep the newest 5 of each`};function wl(e){let t=new Set;for(let n of e)t.add(bl(n.relPath));return t.size}function Tl(e,t){let n=new Map;for(let t of e)n.set(t.relPath,t);let r=xl(e.map(e=>({relPath:e.relPath,mtime:e.mtime})),e.map(e=>e.relPath),t,[]).map(e=>n.get(e.relPath)).filter(e=>!!e).sort((e,t)=>t.mtime-e.mtime),i=ul(r);return{rows:r,count:i.count,bytes:i.bytes,total:ul(e),oldestMtime:r.length?Math.min(...r.map(e=>e.mtime)):null}}function El(e){let t={};for(let n of Sl){let r=Tl(e,n);t[n]={count:r.count,bytes:r.bytes}}return t}function Dl(e,t,n){let r=e.total.count-e.count,i=e.total.bytes-e.bytes,a=`${n} build ${n===1?`family`:`families`}`;return e.total.count?e.count?`${r} file${r===1?``:`s`} stay (${H(i)}) — the newest ${t} of each of ${a}.`:`Nothing here is superseded — every one of the ${e.total.count} files is among the newest ${t} of its family (${a}).`:`Nothing here.`}function Ol(e){return e.count?`Delete ${e.count} superseded build${e.count===1?``:`s`} · ${H(e.bytes)}`:`Nothing superseded`}function kl(e){let t=e.repos.length,n=`${t} repo${t===1?``:`s`}`;return e.total?e.total.count?`${e.total.count} file${e.total.count===1?``:`s`} · ${H(e.total.bytes)} across ${n}.`:`${n}, and nothing in any transport directory.`:`${n}. Some directories could not be counted, so there is no total — the rows that answered are below.`}function Al(e){return e?e.count?`${e.count} · ${H(e.bytes)}`:`empty`:`not counted`}var jl={cache:`cache — re-made when it is next needed`,rollback:`migration leftover — a copy kept in case the upgrade was wrong`,ledger:`record — history, not a cache`,live:`in use — the daemon is reading this now`,unknown:`not in this app's catalogue`};function Ml(e){return e.filter(e=>!e.cant&&e.count>0)}function Nl(e){return e.count?e.bytes==null?`Clear ${e.label} · ${e.count}`:`Clear ${e.label} · ${e.count} · ${H(e.bytes)}`:`Nothing in ${e.label}`}function Pl(e,t){if(t.refused)return t.refused;let n=[];return n.push(t.deleted?`Cleared ${t.deleted} file${t.deleted===1?``:`s`} · ${H(t.bytes)} from ${e}.`:`${e} was already empty.`),t.failed&&n.push(`${t.failed} could not be removed — still on disk.`),n.join(` `)}function Fl(e){let t=e.indexOf(`/`);return t<0?e:e.slice(t+1)}function Il(e,t,n){if(!e.length||e.some(e=>e.name===t))return null;let r=e.reduce((e,t)=>e+t.size,0),i=e.map(e=>e.name).join(`, `),a=e=>`${(e/2**30).toFixed(1)} GB`;return`${i} ${e.length===1?`is`:`are`} already loaded (${a(r)} held, ${a(n)} free). Running a second local model at the same time may evict it, and every switch between them reloads from disk.`}var Ll=(e,t)=>e?t?{requests:e.requests+t.requests,promptTok:e.promptTok+t.promptTok,promptMs:e.promptMs+t.promptMs,cachedTok:e.cachedTok+t.cachedTok,genTok:e.genTok+t.genTok,genMs:e.genMs+t.genMs}:e:t?{...t}:void 0,Rl=(e,t)=>e?t?{requests:e.requests+t.requests,ms:e.ms+t.ms}:e:t?{...t}:void 0,zl=(e,t)=>e?t?{loads:e.loads+t.loads,ms:e.ms+t.ms}:e:t?{...t}:void 0,Bl=(e,t)=>{if(!e)return t?{...t}:void 0;if(!t)return e;let n=t.contextLength??e.contextLength;return{samples:e.samples+t.samples,sumBytes:e.sumBytes+t.sumBytes,peakBytes:Math.max(e.peakBytes,t.peakBytes),sumVram:e.sumVram+t.sumVram,peakVram:Math.max(e.peakVram,t.peakVram),residentMs:e.residentMs+t.residentMs,...n==null?{}:{contextLength:n}}},Vl=(e,t)=>{if(!e)return t?{...t}:void 0;if(!t)return e;let n=e.swapPeak==null?t.swapPeak:t.swapPeak==null?e.swapPeak:Math.max(e.swapPeak,t.swapPeak);return{samples:e.samples+t.samples,usedSum:e.usedSum+t.usedSum,usedPeak:Math.max(e.usedPeak,t.usedPeak),availMin:Math.min(e.availMin,t.availMin),totalBytes:Math.max(e.totalBytes,t.totalBytes),...n==null?{}:{swapPeak:n},source:t.source}};function Hl(e,t){if(!e)return t?{...t}:void 0;if(!t)return e;let n={...e};for(let[e,r]of Object.entries(t))n[e]=(n[e]??0)+r;return n}function Ul(e,t){let n={model:e.model},r=(e,t)=>{t!==void 0&&(n[e]=t)};return r(`compute`,Ll(e.compute,t.compute)),r(`timed`,Rl(e.timed,t.timed)),r(`untimed`,Rl(e.untimed,t.untimed)),r(`loads`,zl(e.loads,t.loads)),r(`byApi`,Hl(e.byApi,t.byApi)),r(`mem`,Bl(e.mem,t.mem)),r(`machine`,Vl(e.machine,t.machine)),n}function Wl(e,t){let n=new Map;for(let r of e)if(!(t&&r.day<t))for(let e of r.models){let t=n.get(e.model);n.set(e.model,Ul(t||{model:e.model},e))}return[...n.values()].sort((e,t)=>+(e.model===null)-(t.model===null)||Gl(t)-Gl(e)||(t.mem?.residentMs??0)-(e.mem?.residentMs??0)||String(e.model).localeCompare(String(t.model)))}function Gl(e){return e.compute?e.compute.promptMs+e.compute.genMs:0}function Kl(e){return(e.compute?.requests??0)+(e.untimed?.requests??0)}function ql(e,t){return!e||!t||e<=0||t<=0?null:e/(t/1e3)}function Jl(e,t){return t&&t>0&&e!=null?e/t:null}function Yl(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function Xl(e){if(!Number.isFinite(e)||e<0)return`?`;if(e<1e3)return`${Math.round(e)} ms`;let t=e/1e3;if(t<60)return`${t<10?t.toFixed(1):Math.round(t)} s`;let n=Math.floor(t/60);if(n<60)return`${n} min ${Math.round(t-n*60)} s`;let r=Math.floor(n/60);return`${r} h ${n-r*60} min`}function Zl(e,t){let n=[];return e.reachable===!1?n.push(`Ollama is not running — it did not answer on ${e.url}${e.lastSampleAt?` at ${t(e.lastSampleAt)}`:``}. Nothing is sampled until it does.`):e.reachable===null&&n.push(`Ollama has not been asked yet — the first sample is taken within ${Math.round(e.intervalMs/1e3)} s of the host starting.`),e.log.readable||n.push(`Server log not readable: ${e.log.reason} Compute time and tokens need it; memory is still sampled.`),!e.days.some(e=>e.models.some(e=>Kl(e)>0))&&e.log.readable&&n.push(`No request seen yet — the runner's log has recorded no completed request since ${t(e.since)}.`),n}function Ql(e){return e.launchModes??e.permissionModes}function $l(e,t,n){if(t===void 0)return null;let r=Ql(n);return r.includes(t)?null:`${e} cannot start in "${t}" mode${n.permissionModes.includes(t)?` (it can switch to it once running)`:``}; it starts in: ${r.join(`, `)||`no mode`}.`}function eu(e,t){return t.onHost?.includes(e)?`host`:t.sending.includes(e)?`sending`:t.kept.includes(e)?`kept`:t.dead[e]?`dead`:t.onHost===null?`unknown`:`missing`}function tu(e,t){return e.map(e=>{let n=eu(e,t);return n===`dead`?{relPath:e,state:n,why:t.dead[e]}:{relPath:e,state:n}})}function nu(e){return e.every(e=>e.state===`host`||e.state===`sending`)}function ru(e){let t={kept:0,dead:1,missing:2,unknown:3};return e.filter(e=>e.state in t).sort((e,n)=>t[e.state]-t[n.state])}function iu(e){return e.filter(e=>e.mode===`upload`&&e.upload&&e.status!==`failed`).map(e=>e.upload.relPath)}function au(e){return[...iu(e)].sort().join(`
11
+ `)}function ou(e){let t=Math.max(0,Math.ceil(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r?`${n}m ${r}s`:`${n}m`}function su(e,t){return e?e.state===`waiting`?`Network error — ${e.nextAt==null?`retry waiting`:`retrying in ${ou(e.nextAt-t)}`} (${e.attempt+1}/${e.max})${e.why?` · ${e.why}`:``}`:e.state===`sent`?`Network error — retried (${e.attempt}/${e.max}), waiting for the reply`:`Network error — stopped retrying${e.why?`: ${e.why}`:``}. Type to try again.`:null}function cu(e){return e.enabled&&!e.envOff}function lu(){return`Off on this desktop: ${Cn(`NET_RETRY`)}=0 is set in its environment, and that wins over this switch. Remove it there and restart the host to use the switch.`}function uu(e,t=!1){return t?`saved ${e?`on`:`off`} — still off on this desktop while its environment says so`:e?`network-error retry on`:`network-error retry off — pending retries cancelled`}var du=1.25,fu=(e,t,n)=>Math.min(n,Math.max(t,e));function pu(e){return e.map(e=>({w:Number.isFinite(e.w)&&e.w>0?e.w:1,h:Number.isFinite(e.h)&&e.h>0?e.h:1}))}function mu(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function hu(e){let t=pu(e);if(t.length<2)return 0;let n=t.reduce((e,t)=>e+(t.w+t.h)/2,0)/t.length;return fu(Math.round(n*.012),4,40)}function gu(e,t,n){let r=mu(e.map((e,t)=>({...e,i:t})),t).map(e=>{let t=Math.max(...e.map(e=>e.h)),r=e.map(e=>({i:e.i,w:e.w/e.h*t,h:t}));return{h:t,w:r.reduce((e,t)=>e+t.w,0)+n*(e.length-1),cells:r}}),i=Math.max(...r.map(e=>e.w)),a=r.reduce((e,t)=>e+t.h,0)+n*(r.length-1),o=[],s=0;for(let e of r){let t=(i-e.w)/2;for(let r of e.cells)o.push({i:r.i,x:t,y:s,w:r.w,h:r.h}),t+=r.w+n;s+=e.h+n}return{width:i,height:a,cells:o,rows:r.length}}function _u(e,t=0,n=du){let r=pu(e);if(r.length<2)return 1;let i=1,a=1/0;for(let e=1;e<=r.length;e++){let o=gu(r,e,t),s=o.width/o.height,c=e*o.rows-r.length,l=Math.abs(Math.log(s/n))+.05*(c/r.length);l<a-1e-9&&(a=l,i=e)}return i}function vu(e,t={}){let n=pu(e);if(!n.length)return{cols:0,rows:0,gap:0,width:0,height:0,scale:1,cells:[]};let r=Math.max(0,Math.round(t.gap??hu(n))),i=fu(Math.round(t.cols??_u(n,r,t.targetAspect)),1,n.length),a=gu(n,i,r),o=t.maxSide??4096,s=t.maxPixels??24e6,c=Math.min(1,o/Math.max(a.width,a.height),t.maxWidth&&t.maxWidth>0?t.maxWidth/a.width:1,Math.sqrt(s/(a.width*a.height))),l=Math.max(1,Math.round(a.width*c)),u=Math.max(1,Math.round(a.height*c)),d=a.cells.map(e=>{let t=Math.round(e.x*c),n=Math.round(e.y*c);return{i:e.i,x:t,y:n,w:Math.max(1,Math.min(Math.round(e.w*c),l-t)),h:Math.max(1,Math.min(Math.round(e.h*c),u-n))}});return{cols:i,rows:a.rows,gap:Math.round(r*c),width:l,height:u,scale:c,cells:d}}function yu(e,t){return e<=1?`single`:t===1?`stacked`:t>=e?`${e} across`:`${t} × ${Math.ceil(e/t)}`}function bu(e,t,n){return e<=1?``:`collage of ${e} panels ${t===1?`stacked top to bottom`:t>=e?`in one row, left to right`:`${t} per row, left to right then down`}${n?`, numbered 1-${e} in that order`:`, not numbered`}`}var xu=524288,Su=2592e6;function Cu(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function wu(e){let t;try{t=e?JSON.parse(e):null}catch{return{notes:[],tombs:[]}}if(!Array.isArray(t))return{notes:[],tombs:[]};let n=new Map,r=new Map;for(let e of t){if(!e||typeof e!=`object`)continue;let t=e;if(typeof t.id!=`string`||!t.id)continue;if(typeof t.text==`string`){let e=Array.isArray(t.steps)?t.steps.filter(e=>typeof e==`string`):[],r={id:t.id,text:t.text,ts:Cu(t.ts)??0};e.length&&(r.steps=e),typeof t.cwd==`string`&&t.cwd&&(r.cwd=t.cwd);let i=n.get(r.id);(!i||r.ts>i.ts)&&n.set(r.id,r);continue}let i=Cu(t.gone);if(i!==null){let e=r.get(t.id);(!e||i>e.gone)&&r.set(t.id,{id:t.id,gone:i})}}return{notes:[...n.values()],tombs:[...r.values()]}}function Tu(e){let t={id:e.id,text:e.text,ts:e.ts};return e.steps&&e.steps.length&&(t.steps=e.steps),e.cwd&&(t.cwd=e.cwd),t}function Eu(e){return JSON.stringify(Tu(e))}function Du(e){let t=[...e.notes].sort((e,t)=>t.ts-e.ts||(e.id<t.id?-1:+(e.id>t.id))),n=[...e.tombs].sort((e,t)=>t.gone-e.gone||(e.id<t.id?-1:+(e.id>t.id)));return JSON.stringify([...t.map(Tu),...n.map(e=>({id:e.id,gone:e.gone}))])}function Ou(e,t,n){let r=[...e.tombs,...t.tombs].filter(e=>e&&e.id&&Number.isFinite(e.gone)),i=[...e.notes,...t.notes].filter(e=>e&&e.id),a=0;for(let e of i)Number.isFinite(e.ts)&&e.ts>a&&(a=e.ts);for(let e of r)e.gone>a&&(a=e.gone);let o=a-Su,s=new Map;for(let e of r){if(e.gone<o)continue;let t=s.get(e.id);(!t||e.gone>t.gone)&&s.set(e.id,{id:e.id,gone:e.gone})}let c=new Map;for(let e of i){let t=c.get(e.id);t?(e.ts>t.ts||e.ts===t.ts&&Eu(e)>Eu(t))&&c.set(e.id,e):c.set(e.id,e)}let l=[];for(let e of c.values()){let t=s.get(e.id);t?t.gone>=e.ts||(s.delete(e.id),l.push(e)):l.push(e)}let u=[...s.values()].sort((e,t)=>t.gone-e.gone||(e.id<t.id?-1:+(e.id>t.id)));return u.length>400&&(u=u.slice(0,400)),{notes:l,tombs:u}}function ku(e,t,n){let r=new Set(t.filter(e=>typeof e==`string`&&e));if(!r.size)return e;let i=new Map(e.tombs.map(e=>[e.id,e]));for(let e of r){let t=i.get(e);(!t||n>t.gone)&&i.set(e,{id:e,gone:n})}return{notes:e.notes.filter(e=>!r.has(e.id)),tombs:[...i.values()]}}function Au(e,t){return{notes:e.notes.some(e=>e.id===t.id)?e.notes.map(e=>e.id===t.id?t:e):[t,...e.notes],tombs:e.tombs.filter(e=>e.id!==t.id)}}function ju(e,t,n){let r=Du(Ou(wu(t),wu(e),n));return{value:r,changed:r!==e}}var Mu=`Notes with no target yet — write them anywhere, offline included, and aim them later. A note that names a repo can be filed straight onto that repo's backlog. Sending or filing one uses the normal queue, so it survives a dead tunnel like anything else you type.`;function Nu(e,t){return`the pad is full (${e} notes, ${t} KB) — your text is still in the editor; send, file or clear a note first`}var Pu=`this phone's storage refused the note — your text is still in the editor; free some space, or send or clear a note first`;function Fu(e){return e===1?`one note that was kept on this phone is back on the pad`:`${e} notes that were kept on this phone are back on the pad`}var Iu=`kept your unfinished prompt — it is a note on the pad`,Lu=`the pad could not take your unfinished prompt, so it was left in the box — nothing was replaced`,Ru={label:`file it`,title:e=>`put it on ${e}'s backlog as it is — it waits there, nothing runs now`};function zu(e,t){return t?`filed offline — it reaches ${e}'s backlog when the link is back`:`filed — on ${e}'s backlog`}function Bu(e,t){if(!e.trim()||e===t)return null;let[n=``,...r]=e.split(`\f`);return r.length?{text:n,steps:r}:{text:n}}var Vu=e=>e==null||e===`subscription`||e===`unknown`,Hu={degradedMisses:2,brokenMisses:5,rateWindow:20,rateMinSamples:8,rateDegraded:.2,rateBroken:.5,rateMaxAgeMs:432e5,forgetMs:864e5},Uu=[{id:`prompt.box`,name:`Reading a question box off the screen`,means:`The choice-box detector. When it stops matching there is no error and no empty state — a live question simply never reaches the phone, and the session sits blocked in silence.`,capture:`line`,fallback:`the weaker “something is asking you something” flag`},{id:`prompt.submit`,name:`Placing the cursor on a multi-select Submit row`,means:`Where the answer keystroke goes on a checkbox box. Without it the app sends a bare Return, which toggles whatever row the cursor happens to be on instead of submitting.`,capture:`line`,fallback:`a bare Return`},{id:`askbox.enrich`,name:`Reading the CLI's own words for a question box`,means:`The full question and per-option descriptions, taken from the conversation log rather than the truncated screen. Without it the phone shows one-tap buttons whose explanation is nowhere on the device.`,capture:`shape`,fallback:`the labels as the terminal cut them`},{id:`limit.reset`,name:`Reading when a usage block ends`,means:`The reset instant parsed out of the CLI's own block notice. Without it a blocked session has no time to resume at and waits for a blind sweep instead.`,capture:`line`,fallback:`a periodic re-scan with no scheduled resume`,thresholds:{forgetMs:2592e6}},{id:`context.meter`,name:`Reading the context-window figure`,means:`The context badge. A miss hides a number rather than losing work, which is why it is the one signal here allowed to fail a few more times before it is worth a word.`,capture:`line`,thresholds:{degradedMisses:4,brokenMisses:10}},{id:`hook.pipe`,name:`The CLI's lifecycle hooks`,means:`The positive turn-boundary signal. Without it a session falls back to guessing from silence, so turn ends get mushy, the backlog's readiness is a timer, and auto-fire can land mid-task.`,capture:`shape`,fallback:`silence heuristics`},{id:`deliver.echo`,name:`Confirming a prompt reached the composer`,means:`The echo probe. When it stops finding text, deliveries come back unconfirmed — which is not a lost prompt but is reported to the user as one, and is the exact signal that ran at 22% for a week.`,capture:`shape`,fallback:`asking the conversation log later`,thresholds:{degradedMisses:5,brokenMisses:8}},{id:`deliver.submit`,name:`Confirming a submitted prompt started a turn`,means:`Proof the Return was not swallowed. When it fails the app says the text is sitting unsent in a composer — a specific, actionable claim that must not be made about a prompt that is running.`,capture:`shape`,fallback:`asking the conversation log later`,thresholds:{degradedMisses:5,brokenMisses:8}},{id:`transcript.jsonl`,name:`Reading the CLI's conversation log`,means:`The reader view, the archive titles, and the evidence that settles an unconfirmable delivery. This is the witness that is not a rendering; without it the app is back to believing screens.`,capture:`shape`,fallback:`our own record of what we typed`},{id:`slash.local`,name:`Delivering a TUI-local command`,means:`Commands that open a view instead of running a turn. Get the list wrong in either direction and the app either hammers Return into the view it just opened, or waits for a turn that never starts.`,capture:`line`}],Wu=new Map(Uu.map(e=>[e.id,e]));function Gu(e){return Wu.get(e)??{id:e,name:e,means:``,capture:`shape`}}function Ku(e){return{...Hu,...Wu.get(e)?.thresholds??{}}}function qu(){return{version:null,versionSeenAt:null,signals:{}}}function Ju(e,t){return{id:e,version:t,lastGoodAt:null,lastMissAt:null,misses:0,missStreakSince:null,window:[],totalGood:0,totalMiss:0}}var Yu=/\/(?:Users|home)\/[^/\s]+/g,Xu=/\b[\w.+-]+@[\w-]+\.[\w.-]+\b/g,Zu=/(\b[a-z][a-z0-9+.-]*:\/\/)[^\s/@]+@/gi,Qu=/\b(tokens?|secrets?|passwds?|passwords?|api[-_ ]?keys?|apikeys?|authorization|auth|bearer|cookies?|credentials?)\b\s*[:=]\s*(?:(?:bearer|basic|token|jwt)\s+)?\S+/gi,$u=/[A-Za-z0-9_+=-]{24,}/g;function ed(e,t=240){let n=td(e.replace(/\s+/g,` `).trim());return n.length>t?n.slice(0,t-1)+`…`:n}function td(e){let t=e.replace(Zu,`$1<redacted>@`);return t=t.replace(Qu,(e,t)=>`${t}=<redacted>`),t=t.replace(Xu,`<email>`),t=t.replace(Yu,`~`),t.replace($u,e=>`<redacted:${e.length}>`)}function U(e,t,n){let r={...Ku(e.id),...n??{}},i=Math.max(e.lastGoodAt??0,e.lastMissAt??0)||null,a=e.window.filter(e=>t-e.at<=r.rateMaxAgeMs),o=a.length,s=a.reduce((e,t)=>e+ +!t.ok,0),c=o>=r.rateMinSamples?s/o:null,l=o?a[0].at:null,u={misses:e.misses,samples:o,failed:s,rate:c};return i==null?{...u,verdict:`unknown`,because:`no-observations`,since:null}:t-i>r.forgetMs?{...u,verdict:`unknown`,because:`gone-quiet`,since:i}:e.misses>=r.brokenMisses?{...u,verdict:`broken`,because:`misses`,since:e.missStreakSince}:c!=null&&c>=r.rateBroken?{...u,verdict:`broken`,because:`rate`,since:l}:e.misses>=r.degradedMisses?{...u,verdict:`degraded`,because:`misses`,since:e.missStreakSince}:c!=null&&c>=r.rateDegraded?{...u,verdict:`degraded`,because:`rate`,since:l}:e.lastGoodAt!=null&&e.lastGoodAt>(e.clearedAt??-1/0)?{...u,verdict:`healthy`,because:`confirmed`,since:e.lastGoodAt}:{...u,verdict:`unknown`,because:`no-observations`,since:i}}function W(e){if(!Number.isFinite(e)||e<6e4)return`<1m`;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60);return n<48?`${n}h`:`${Math.floor(n/24)}d`}function nd(e,t){let n=Gu(e.id),r=U(e,t),i=e.sample?n.capture===`line`?` Last input: “${e.sample}”.`:` Last input: ${e.sample}.`:``,a=e.lastGoodAt==null?`never confirmed at all`:`last confirmed ${W(t-e.lastGoodAt)} ago`;switch(r.because){case`confirmed`:return`${n.name} is working — ${a}.`;case`no-observations`:return e.clearedAt==null?e.priorVersion?`${n.name} has not been checked since claude ${e.version??`?`} — its history was cleared when the CLI changed from ${e.priorVersion}.`:`${n.name} has not been checked yet.`:`${n.name}: you cleared its misses up to ${W(t-e.clearedAt)} ago, and it has not been seen working since — unknown until the next check.`;case`gone-quiet`:return`${n.name} has gone quiet — nothing observed for ${W(t-(r.since??t))}, so its state is unknown.`;case`misses`:return`${n.name} is ${r.verdict} — ${r.misses} misses in a row over the last ${W(t-(r.since??t))}, ${a}.${i}`;case`rate`:return`${n.name} is ${r.verdict} — ${r.failed} of the last ${r.samples} failed (${Math.round((r.rate??0)*100)}%) over the last ${W(t-(r.since??t))}, ${a}.${i}`}}function rd(e,t){return t!=null&&e.lastGoodAt!=null&&e.lastGoodAt>=t}function id(e,t){let n={broken:0,degraded:1,unknown:2,healthy:3};return Object.values(e.signals).filter(e=>U(e,t).verdict!==`healthy`).sort((e,r)=>n[U(e,t).verdict]-n[U(r,t).verdict])}function ad(e,t){let n=[],r=[],i=[],a=!1;for(let o of Object.values(e.signals)){let e=U(o,t).verdict;e===`broken`?n.push(o.id):e===`degraded`?r.push(o.id):e===`unknown`?i.push(o.id):a=!0}return{verdict:n.length?`broken`:r.length?`degraded`:a?`healthy`:`unknown`,broken:n,degraded:r,unknown:i,lines:id(e,t).filter(e=>U(e,t).verdict!==`unknown`).map(e=>nd(e,t)),version:e.version}}function od(e){let t=e??{},n=qu();n.version=typeof t.version==`string`&&t.version?t.version.slice(0,40):null,n.versionSeenAt=G(t.versionSeenAt),G(t.versionChangedAt)!=null&&(n.versionChangedAt=G(t.versionChangedAt));let r=t.signals??{};for(let e of Uu){let t=r[e.id];if(!t||typeof t!=`object`)continue;let i=Ku(e.id),a=Array.isArray(t.window)?t.window.filter(e=>!!e&&typeof e==`object`&&Number.isFinite(e.at)).map(e=>({at:Number(e.at),ok:e.ok===!0,...e.fallback?{fallback:!0}:{}})).slice(-i.rateWindow):[],o={id:e.id,version:typeof t.version==`string`&&t.version?t.version.slice(0,40):null,lastGoodAt:G(t.lastGoodAt),lastMissAt:G(t.lastMissAt),misses:Math.max(0,Math.min(9999,Math.round(Number(t.misses)||0))),missStreakSince:G(t.missStreakSince),window:a,totalGood:Math.max(0,Math.round(Number(t.totalGood)||0)),totalMiss:Math.max(0,Math.round(Number(t.totalMiss)||0))};G(t.lastFallbackAt)!=null&&(o.lastFallbackAt=G(t.lastFallbackAt)),typeof t.via==`string`&&t.via&&(o.via=t.via.slice(0,60)),typeof t.sample==`string`&&t.sample&&(o.sample=ed(t.sample)),G(t.sampleAt)!=null&&(o.sampleAt=G(t.sampleAt)),typeof t.priorVersion==`string`&&t.priorVersion&&(o.priorVersion=t.priorVersion.slice(0,40)),G(t.clearedAt)!=null&&(o.clearedAt=G(t.clearedAt)),t.priorVerdict&&[`healthy`,`degraded`,`broken`,`unknown`].includes(t.priorVerdict)&&(o.priorVerdict=t.priorVerdict),n.signals[e.id]=o}return n}function G(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:null}var sd=[2e5,1e6];sd[0],sd[sd.length-1];function cd(e,t){return!t||t<=0?null:e/t*100}function ld(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.floor(e):null}function ud(e,t){let n=ld(e),r=ld(t);if(n===null||r===null||r/n<.25)return null;let i=n-r,a=`${T(n)} window, ~${T(r)} of it used by the first request of the last session on this model (mostly Claude Code's own instructions and tools)`;return i<=0?`${a} — that is the whole window, so the runner will cut the prompt. Pick a model with a larger window.`:`${a} — ~${T(i)} is left for the conversation.`}var dd={maxChars:16e3,hardChars:4e4,maxSkills:30};function fd(e){if(e<1e3)return String(e);let t=e/1e3;if(t>=10)return`${Math.round(t)}k`;let n=Math.round(t*10)/10;return`${Number.isInteger(n)?n:n.toFixed(1)}k`}var pd=fd,md=fd;function hd(e,t,n){let r=e===`size`?`over the ${t}`:`past the ${t}`;return n===`repo`?`${r} you set for this repo`:n===`env`?`${r} you asked to be warned at`:`${r} default`}function gd(e,t=dd,n={}){let r=e.skills.reduce((e,t)=>e+t.descChars,0),i=Math.max(0,e.claudeMdChars)+r,a=e.skills.reduce((e,t)=>e+Math.max(0,t.bodyChars-t.descChars),0),o=Math.round(i/4),s=e.skills.length,c=i>=t.hardChars?`steep`:i>=t.maxChars||s>t.maxSkills?`heavy`:`lean`,l=a>0?` ${md(a)} more is in ${s} skill${s===1?``:`s`}, loaded only when needed.`:``;if(c===`lean`)return{verdict:c,alwaysOnChars:i,alwaysOnTokens:o,onDemandChars:a,skillCount:s,note:`Every turn here carries ${md(i)} chars of agent instructions (~${pd(o)} tokens).${l}`,advice:null};let u=i>=t.maxChars;return{verdict:c,alwaysOnChars:i,alwaysOnTokens:o,onDemandChars:a,skillCount:s,note:u?`Every turn here carries ${md(i)} chars of agent instructions (~${pd(o)} tokens), ${hd(`size`,md(t.maxChars),n.maxChars??`default`)}.${l}`:`${s} skills, ${hd(`skills`,String(t.maxSkills),n.maxSkills??`default`)} — their descriptions are loaded on every turn even when no skill is.${l}`,advice:u?`This is paid on every turn of every session and every subagent here. What has to stay is what is dangerous not to know before acting; reference belongs in a skill and reasoning in the docs. The “groom CLAUDE.md” fan-out preset does exactly that.`:`Descriptions are the always-on part of a skill. Merging near-duplicates, or shortening the descriptions of ones you rarely load, costs nothing on-demand.`}}var _d=/^["']?description["']?[ \t]*:[ \t]*/;function vd(e){let t=/^(?:[ \t]*\r?\n)*---[ \t]*\r?\n(?:([\s\S]*?)\r?\n)?---[ \t]*(?:\r?\n|$)/.exec(e.replace(/^\uFEFF/,``));return t?(t[1]??``).split(/\r?\n/):null}function yd(e){let t=vd(e);if(!t)return 0;let n=t.findIndex(e=>_d.test(e));if(n<0)return 0;let r=t[n].replace(_d,``).trim(),i=/^[>|][+-]?\d*$/.test(r)?[]:[r];for(let e=n+1;e<t.length&&!/^[A-Za-z_-]+:/.test(t[e]);e++)i.push(t[e].trim());return i.join(` `).trim().length}var bd={maxChars:{min:1e3,max:2e6},hardChars:{min:1e3,max:4e6},maxSkills:{min:1,max:500}};function xd(e,t){let n=bd[e],r=Number(t);return Number.isFinite(r)?Number.isInteger(r)?r<n.min?`${e} must be at least ${n.min}.`:r>n.max?`${e} must be at most ${n.max}.`:null:`${e} must be a whole number.`:`${e} must be a number.`}function Sd(e){return vd(e)}function Cd(e,t){let n=Sd(e);if(!n)return null;let r=n.findIndex(e=>RegExp(`^${t}:`).test(e));if(r<0)return null;let i=e=>e.trim().replace(/^['"]|['"]$/g,``).trim(),a=n[r].slice(t.length+1).trim();if(a)return(a.startsWith(`[`)?a.replace(/^\[|\]$/g,``):i(a)).split(`,`).map(i).filter(Boolean);let o=[];for(let e=r+1;e<n.length&&/^\s*-\s/.test(n[e]);e++)o.push(i(n[e].replace(/^\s*-\s/,``)));return o}var wd=new Set([`**`,`**/*`,`*`,`/**`,`./**`]);function Td(e){return e.some(e=>wd.has(e))?{kind:`always`}:{kind:`scoped`,globs:e}}function Ed(e,t){let n=Cd(e,`applyTo`),r=yd(e);return n&&n.length?[{readers:t,when:Td(n),chars:e.length}]:r>0?[{readers:t,when:{kind:`always`},chars:r},{readers:t,when:{kind:`on-demand`},chars:Math.max(0,e.length-r)}]:[{readers:t,when:{kind:`on-demand`},chars:e.length}]}function Dd(e,t){let n=Cd(e,`paths`);return[{readers:t,when:n&&n.length?Td(n):{kind:`always`},chars:e.length}]}function Od(e,t){let n=yd(e);return[{readers:t,when:{kind:`always`},chars:n},{readers:t,when:{kind:`on-demand`},chars:Math.max(0,e.length-n)}]}var kd=`imported by CLAUDE.local.md`;function Ad(e){return!(e.unsized||e.scope===`desktop`||e.kind===`subagent`||e.kind===`CLAUDE.local.md`||e.kind.endsWith(kd))}function jd(e){let t=[],n=0;for(let r of e){if(!Ad(r))continue;let e=r.parts.filter(e=>e.readers.includes(`claude`));if(e.length){if(r.kind===`skill`)t.push({name:r.path.split(`/`).slice(-2)[0],descChars:e[0].chars,bodyChars:e.reduce((e,t)=>e+t.chars,0)});else for(let t of e)t.when.kind===`always`&&(n+=t.chars)}}return{claudeMdChars:n,skills:t}}function Md(e,t){let n=e.replace(/\\/g,`/`),r=n.split(`/`).pop()??n,i,a;if([`CLAUDE.md`,`AGENTS.md`,`GEMINI.md`,`copilot-instructions.md`].includes(r))i=r===`copilot-instructions.md`?`Copilot instructions`:r,a=[{readers:[],when:{kind:`always`},chars:t.length}];else if(r===`SKILL.md`)i=`skill`,a=Od(t,[]);else if(r.endsWith(`.instructions.md`))i=`instructions`,a=Ed(t,[]);else if(/(^|\/)\.claude\/rules\/.+\.md$/.test(n))i=`rule`,a=Dd(t,[]);else if(/(^|\/)\.claude\/agents\/[^/]+\.md$/.test(n))i=`subagent`,a=Od(t,[]);else if(/(^|\/)\.claude\/commands\/.+\.md$/.test(n))i=`command`,a=Od(t,[]);else return null;let o={kind:i,chars:t.length,always:0,scoped:0,onDemand:0};for(let e of a)e.when.kind===`always`?o.always+=e.chars:e.when.kind===`scoped`?o.scoped+=e.chars:o.onDemand+=e.chars;return o}function Nd(e,t=String){let n=e=>`~${t(Math.round(e/4))} tokens`,r=`${n(e.chars)} · ${t(e.chars)} chars`;if(e.always===e.chars)return`${r}, all of it every turn`;let i=[];return e.always&&i.push(`${n(e.always)} every turn`),e.scoped&&i.push(`${n(e.scoped)} when a matching file is touched`),e.onDemand&&i.push(`${n(e.onDemand)} only when used`),i.length?`${r} (${i.join(`, `)})`:r}var K=e=>Math.round(e/4),q=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function Pd(e){return e.map(e=>{let t=[...new Set(e.parts.flatMap(e=>e.readers))],n=t=>e.unsized?null:e.parts.filter(e=>e.when.kind===t).reduce((e,t)=>e+t.chars,0),r={path:e.path,kind:e.kind,scope:e.scope??`repo`,readers:t,always:n(`always`),scoped:n(`scoped`),onDemand:n(`on-demand`),counted:Ad(e)&&t.includes(`claude`)};return e.unsized&&(r.unsized=e.unsized),e.off&&(r.off=e.off),r})}function Fd(e){let t=0,n=0,r=0,i=0;for(let a of e){if(a.unsized){a.unsized===`its tool schemas are sent by the server when it connects — not measurable from the file`?r++:i++;continue}let e=a.parts.filter(e=>e.readers.includes(`claude`)&&e.when.kind===`always`);e.length&&(n++,t+=e.reduce((e,t)=>e+t.chars,0))}return{chars:t,files:n,servers:r,other:i}}var Id=(e,t)=>(e.servers?` ${q(e.servers,`MCP server`)} ${t}add tool schemas nobody can size from here.`:``)+(e.other?` ${q(e.other,`more row`)} ${e.other===1?`has`:`have`} no size here; each says why.`:``);function Ld(e,t=T){let n=e.filter(e=>e.scope!==`desktop`),r=e.filter(e=>e.scope===`desktop`),i=[],a=Fd(n);if(a.files){let e=gd(jd(n)).alwaysOnChars,r=a.chars-e,o=r>0?`; the threshold row counts ${t(e)} of those (CLAUDE.md, its imports, rules, skill descriptions), the other ${t(r)} are listed beside it (CLAUDE.local.md, subagent descriptions)`:`; the threshold row counts all of them (CLAUDE.md, its imports, rules, skill descriptions)`;i.push(`Claude Code carries ~${t(K(a.chars))} tokens (${t(a.chars)} chars) from ${q(a.files,`repo file`)} on every turn${o}.${Id(a,``)}`)}else n.length&&i.push(`Claude Code carries nothing from this repo's files on every turn.${Id(a,``)}`);let o=Fd(r);return o.files?i.push(`This desktop adds ~${t(K(o.chars))} tokens (${t(o.chars)} chars) from ${q(o.files,`file`)} to every session, whatever the repo; the threshold row counts none of it.${Id(o,`of this desktop's `)}`):r.length&&(o.servers||o.other)&&i.push(Id(o,`of this desktop's `).trim()),i.join(` `)}var Rd=`~/.claude`;function zd(e,t=Rd){return e?e.startsWith(`~`)||e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)||e.startsWith(`\\\\`)?e:`${t.replace(/[\\/]+$/,``)}/${e}`:`not on disk`}var Bd=`everything else in the first request: your prompt, and whatever the harness sent that the log does not record (≈)`,Vd=`(undocumented record)`;function Hd(e){let t=e.count;switch(e.kind){case`instructions`:return`instruction files`;case`skill_listing`:return t==null?`skill listing`:`skill listing (${q(t,`skill`)})`;case`mcp_instructions`:return t==null?`MCP instructions`:`MCP instructions (${q(t,`server`)})`;case`deferred_tools`:return t==null?`deferred tool names`:`deferred tool names (${t})`;case`agent_listing`:return t==null?`subagent listing`:`subagent listing (${t})`;case`hook_context`:return t!=null&&t>1?`hook context (${t})`:`hook context`;case`system_prompt`:return`system prompt ${Vd}`;case`tool_schemas`:return`tool schemas ${Vd}`}}var Ud=(e,t)=>`~${t(K(e))} tokens · ${t(e)} chars`,Wd=e=>Math.round(e.parts.reduce((e,t)=>e+t.chars,0)/4);function Gd(e){if(e.firstRequestTok==null)return null;let t=e.firstRequestTok-Wd(e);return t>=0?t:null}var Kd=`The parts' estimate already exceeds the request, so the rest (your prompt among it) cannot be placed.`;function qd(e,t=T){let n=e=>Ho.indexOf(e),r=[...e.parts].sort((e,t)=>n(e.kind)-n(t.kind)).map(e=>{let n={key:e.kind,label:Hd(e),chars:e.chars,tok:K(e.chars),words:Ud(e.chars,t)};return e.files&&(n.files=e.files.map(e=>({label:`${e.path} · ${e.type}`,path:e.path,type:e.type,chars:e.chars,words:Ud(e.chars,t)}))),e.names&&(n.names=e.names),e.undocumented&&(n.undocumented=!0),n}),i=Gd(e);return i!=null&&r.push({key:`remainder`,label:Bd,chars:null,tok:i,words:`≈${t(i)} tokens`}),r}var Jd={instructions:`the instruction files`,skill_listing:`the skill listing`,mcp_instructions:`MCP instructions`,deferred_tools:`deferred tool names`,agent_listing:`the subagent listing`,hook_context:`hook context`,system_prompt:`the system prompt`,tool_schemas:`tool schemas`},Yd=e=>e.charAt(0).toUpperCase()+e.slice(1),Xd=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`;function Zd(e,t=T,n={}){let r=new Set(e.parts.map(e=>e.kind)),i=Ho.filter(e=>r.has(e)&&e!==`system_prompt`&&e!==`tool_schemas`),a=e.parts.filter(e=>!e.undocumented&&e.kind!==`system_prompt`&&e.kind!==`tool_schemas`).reduce((e,t)=>e+t.chars,0),o=(e.laterKinds??[]).filter(e=>e in Jd),s=o.length?` ${Yd(Xd(o.map(e=>Jd[e])))} changed later in the conversation; the change is not folded in.`:e.laterDeltas>0?` ${e.laterDeltas===1?`One kind`:`${e.laterDeltas} kinds`} of these changed later in the conversation; the change is not folded in.`:``;if(e.firstRequestTok==null)return`No request has been answered yet; these are the attachments the CLI has written so far (chars).${s}`;let c=[`The first request carried ${t(e.firstRequestTok)} tokens.`];i.length&&c.push(`About ${t(K(a))} of them (${t(a)} chars) are ${Xd(i.map(e=>Jd[e]))} the CLI attached;`);let l=[`system_prompt`,`tool_schemas`].filter(e=>r.has(e)),u=[`system_prompt`,`tool_schemas`].filter(e=>!r.has(e)).map(e=>Jd[e]);if(l.length){let n=l.map(n=>{let r=e.parts.filter(e=>e.kind===n).reduce((e,t)=>e+t.chars,0);return`${Jd[n]} at about ${t(K(r))} tokens (${t(r)} chars)`});c.push(`${i.length?`an`:`An`} undocumented record puts ${Xd(n)};`)}let d=c[c.length-1].endsWith(`;`);return Gd(e)==null?n.unplacedShown?d&&(c[c.length-1]=c[c.length-1].replace(/;$/,`.`)):c.push(d?Kd.replace(/^The/,`the`):Kd):c.push(`${d?`the`:`The`} rest is ${Xd([...u,`your prompt with what the harness added to it`])}.`),c.join(` `)+s}var Qd=`400k`,$d=[`200k`,`300k`,`400k`,`500k`,`700k`],ef=[`auto-compact`,`android-toolchain`,`signing-key`,`protect-main`,`era-seen`,`local-ci-status`];function tf(e){return`Install a JDK and the Android SDK into your home directory (${typeof e==`number`&&Number.isFinite(e)&&e>0?`about ${nf(e)} to download`:`the download size depends on what is already installed`}, no sudo) and accept the Android SDK licence: https://developer.android.com/studio/terms`}tf(null);function nf(e){let t=Math.max(10,Math.round(e/1048576/10)*10);return t>=1e3?`${(t/1024).toFixed(1)} GB`:`${t} MB`}var rf=`Creates an Android signing key on this desktop in <config dir>/keys/ (readable only by you, mode 600) and points this repo's gitignored keystore.properties at it. Back it up: lose it and installed apps can no longer be updated.`,af=`CLAUDE_CODE_AUTO_COMPACT_WINDOW`;function of(e){return e>=1e6?`${+(e/1e6).toFixed(2)}M`:e>=1e3?`${+(e/1e3).toFixed(1)}k`:String(e)}`${af}${O.displayName}`;var sf=[`waiting`,`running`,`done`,`failed`,`canceled`,`open`,`ended`];function cf(e){return`(${O.slug} opt-in: ${e})`}var lf=new Map([{id:`requirements`,title:`Requirements list`,pitch:`A list of what this repo is expected to do, rebuilt from your own prompts and commits, so an agent checks it before changing behaviour you rely on.`,cost:`Setting it up writes two files and spends nothing. Each later build is one paid run, and the setup checklist's row says when one is due.`,verb:`set it up`,action:{kind:`fix`,fix:`requirements`}},{id:`repo-health`,title:`Repo health series`,pitch:`Size, complexity, churn and test readings for this repo, measured weekly and drawn as a trend, so a slow slide shows up before it hurts.`,cost:`Spends no tokens: a local tool runs once a week while the desktop is up. The first measurement is a tap on the series screen.`,verb:`open the series`,action:{kind:`open`,to:`series`}},{id:`repo-health-own`,title:`Your own health readings`,pitch:`Numbers only this repo knows about itself (test count, bundle size, open TODOs), measured beside the standard ones in the same weekly series.`,cost:`One agent session to propose them. The readings themselves spend no tokens.`,verb:`propose readings`,action:{kind:`agent`},prompt:`Propose 2-4 repo-specific health readings for {repo}: numbers this repo knows about itself that a generic metric cannot (for example test count, bundle size, number of TODO/FIXME, count of skipped tests).
12
+
13
+ They are declared in \`{shared}/health.json\` as
14
+ { "readings": [ { "key": "testCount", "name": "Tests", "means": "one sentence", "better": "higher" | "lower", "unit": "tests", "run": ["node", "tools/health/testcount.mjs"] } ] }
15
+ \`run\` is an argv array (no shell), run from the repo root, and must print ONE JSON number or {"value": n} to stdout; anything else makes the reading absent.
16
+
17
+ Show me the readings you propose and the small scripts behind them before writing anything. Only declarations that are committed run, so after I agree, write the files and tell me to commit them.
18
+
19
+ {marker}`},{id:`security-review`,title:`Weekly security review`,pitch:`Every Monday a session reads the week's changes and dependency bumps and writes its findings to the outbox. It changes nothing; you decide what to fix.`,cost:`One Fable session a week, the most capable and most expensive model, picked on purpose. You can change the model, day and time before you save it, and each run's cost shows on its row.`,verb:`schedule it`,action:{kind:`schedule`,days:[1],hour:9,minute:0,graceMin:720,model:`fable`},prompt:`Weekly security review of {repo}. Read-only: change no file, commit nothing, push nothing.
20
+
21
+ 1. Read what changed since the last review (\`git log --since="8 days ago" --stat\`, then the diffs that touch auth, input handling, file paths, shell/process spawning, network listeners, secrets or dependencies).
22
+ 2. Check the dependency manifests and lockfiles for new or bumped packages, install scripts and known-vulnerable versions (\`npm audit --omit=dev\` or the ecosystem's equivalent, if it runs offline-safe).
23
+ 3. Look for secrets committed by accident (keys, tokens, .env files) in the changed files.
24
+
25
+ Write the findings to \`.claude/outbox/security-review-<YYYY-MM-DD>.md\`: each finding with severity (high/medium/low), the file and line, why it matters, and a proposed fix as words. If nothing was found, write that and what you checked. Do not fix anything — the person decides.
26
+
27
+ {marker}`},{id:`local-ci`,title:`Checks before every push`,pitch:`A git pre-push hook that runs this repo's tests and lint on your desktop, so a broken push is caught without paying for hosted CI minutes.`,cost:`One agent session to set it up. After that the hook runs locally and spends no tokens.`,verb:`set it up`,action:{kind:`agent`},prompt:`Set up a local pre-push check for {repo}, so tests and lint run on this desktop before every push instead of in hosted CI.
28
+
29
+ 1. Find the commands this repo already uses to lint, type-check and test (package.json scripts, Makefile, pyproject, CI config).
30
+ 2. Propose one pre-push hook: what it runs, in what order, roughly how long it takes. Keep it fast enough that people will not skip it; slow suites can be a separate command.
31
+ 3. Show me the hook before installing it. Prefer a committed hooks directory (\`git config core.hooksPath\`) so it survives a fresh clone, and say how to bypass it in an emergency.
32
+
33
+ Do not change the tests or the lint rules themselves.
34
+
35
+ {marker}`},{id:`npm-supply-chain`,title:`Safer npm installs`,pitch:`An .npmrc that stops dependencies running code at install time and waits a few days before taking a freshly published version, when most hijacked releases are caught.`,cost:`One short agent session. It spends nothing afterwards.`,verb:`set it up`,action:{kind:`agent`},prompt:"Harden npm installs in {repo} with a committed `.npmrc`:\n\n- `ignore-scripts=true`: no dependency runs code at install time. First list which dependencies have install scripts (preinstall/install/postinstall) and say, per one, whether it works without it (prebuilds) or needs a replacement step in our own build.\n- `min-release-age=7`: a version must be a week old before `npm install` picks it. Check the installed npm version supports it and say so if it does not.\n\nShow me the file and the list before writing. `npm ci` from the lockfile is unaffected; say that in a comment in the file.\n\n{marker}"},{id:`gcp-cleanup`,title:`Registry cleanup policy (GCP)`,pitch:`Cloud Run scales to zero; its Artifact Registry does not. One image per deploy piles up and bills as storage until a cleanup policy deletes the old ones.`,cost:`One agent session. The policy usually lowers the storage bill. The desktop cannot check it from here, so mark it done once it is set.`,verb:`set it up`,action:{kind:`agent`},prompt:`{repo} deploys to Google Cloud. Check its Artifact Registry repositories and set a cleanup policy so images stop piling up:
36
+
37
+ 1. List the registry repos this project deploys to and their size (\`gcloud artifacts repositories list\`, and describe each one).
38
+ 2. Propose a policy (keep the 5 most recent versions, delete older than 7 days) and show it with \`--dry-run\` first.
39
+ 3. Never delete the image the live Cloud Run revision serves; a keep-recent rule protects it. Name that digest.
40
+
41
+ Apply with \`--no-dry-run\` only after I agree. The size metric lags about 24h after a delete; say so.
42
+
43
+ {marker}`},{id:`screenshots`,title:`Screenshots of your app`,pitch:`Let an agent (and you, from the phone) capture this app's screens on the desktop and check them, instead of describing what it probably looks like.`,cost:`Setting up a capture target spends nothing. Each screenshot an agent looks at costs tokens on every later turn, and the checklist then offers the skill that keeps that cheap.`,verb:`open captures`,action:{kind:`open`,to:`capture`}},{id:`exposure-watch`,title:`Exposure watch`,pitch:`Once a day this desktop looks up what the outside world now says about this repo: published advisories on its dependencies, deprecations and, for a private repo, a local Scorecard run. Findings land under watch.`,cost:`Spends no tokens and makes no AI call: a daily job runs gh and npm audit-type lookups and, for a private repo, Scorecard locally. A tap only adds this repo to the list it reads.`,verb:`watch this repo`,action:{kind:`fix`,fix:`exposure-watch`}},{id:`local-ci-status`,title:`Report local checks to GitHub`,pitch:`This repo's rules require a local-ci status before a pull request can merge. After a push from this phone's push button, the desktop tells GitHub the checks passed. It is the honor system: the status says the pre-push hook did not fail the push, not that anyone verified the tests. It covers pushes from this phone's push button, not pushes an agent or a terminal makes.`,cost:`One GitHub API call after each push from the phone; no tokens.`,verb:`report it`,action:{kind:`fix`,fix:`local-ci-status`}}].map(e=>[e.id,e]));function uf(e){return lf.get(e)}function df(e,t){let n=lf.get(e);return n?.prompt?n.prompt.replaceAll(`{repo}`,t).replaceAll(`{marker}`,cf(e)).replaceAll(`{shared}`,O.sharedDirName).replaceAll(`{skill}`,O.skillName):null}function ff(e,t){let n=lf.get(e)?.action;return n?.kind===`schedule`?{kind:`weekly`,days:[...n.days],hour:n.hour,minute:n.minute,tz:t}:null}function pf(e){let t={offered:[],started:[],active:[],declined:[],unfit:[]};for(let n of e)lf.has(n.id)&&(n.choice===`declined`?t.declined.push(n):n.state===`on`||n.choice===`done`?t.active.push(n):n.relevant?n.sent||n.partial?t.started.push(n):t.offered.push(n):t.unfit.push(n));return t}function mf(e){return e.state===`on`?`on`:`marked done by you`}function hf(e,t){let n=e.map(e=>lf.get(e.id)).filter(e=>!!e);if(n.length===0)return null;let r=n.filter(e=>e.action.kind===`agent`||e.action.kind===`schedule`),i=n.filter(e=>e.action.kind===`fix`||e.action.kind===`open`),a=[`Walk me through the optional features ${O.displayName} offers for ${t}. Do NOT set any of them up in this session.`,``,`1. For each one below, look at the repo briefly and tell me in one or two lines whether it fits here and what it would take. Then ask me which ones I want, in ONE question.`,`2. For each one I pick, post its prompt (quoted below, unchanged) as its own new-session work item in this repo, using the ${O.skillName} skill's way of posting work for later. A schedule one is posted as a weekly schedule with the model named. Do not run them here.`,`3. Finish with a list of what you posted, and nothing else.`,``];for(let e of r){let n=e.action.kind===`schedule`?` — weekly, ${_f(e.action.days)} ${vf(e.action.hour)}:${vf(e.action.minute)}, model ${e.action.model}`:``;a.push(`## ${e.title}${n}`,e.pitch,e.cost,``,`Prompt:`,"```",df(e.id,t)??``,"```",``)}if(i.length){a.push(`These are a tap on the phone's Opt-ins screen, not something to post. Just say whether they fit:`);for(let e of i)a.push(`- ${e.title}: ${e.pitch}`)}return a.join(`
44
+ `).trimEnd()}var gf=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function _f(e){return e.length===0?`every day`:e.map(e=>gf[e]??`?`).join(`, `)}function vf(e){return String(e).padStart(2,`0`)}function yf(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.id!=`string`||typeof t.relevant!=`boolean`||t.state!==`on`&&t.state!==`off`&&t.state!==`unknown`)return null;let n={id:t.id,relevant:t.relevant,state:t.state,detail:typeof t.detail==`string`?t.detail:``};(t.choice===`declined`||t.choice===`done`)&&(n.choice=t.choice);let r=t.sent;return r&&typeof r==`object`&&typeof r.at==`number`&&Number.isFinite(r.at)&&r.at>0&&sf.includes(r.status)&&(n.sent={at:r.at,status:r.status}),t.partial===!0&&(n.partial=!0),n}var bf=e=>e.state===`done`?`done`:e.state===`failed`||e.state===`canceled`?`failed`:e.state===`running`?`running`:e.state===`starting`?`starting`:`pending`,xf=e=>e.split(`/`).filter(Boolean).pop()||e;function Sf(e,t=10){let n=new Map;for(let t of e){if(!Si(t))continue;let e=n.get(t.groupId)??[];e.push(t),n.set(t.groupId,e)}let r=[];for(let[t,i]of n){let n=e.find(e=>e.id===t),a=i.filter(e=>e.origin===di).sort((e,t)=>(e.order??e.createdAt)-(t.order??t.createdAt));if(!a.length&&!n)continue;let o=(n?.payload.kind===`prompt`?n.payload.steps[0]:void 0)??(a[0]?.payload.kind===`prompt`?a[0].payload.steps[0]:``),s=n?.createdAt??Math.min(...a.map(e=>e.createdAt)),c=e=>e.state===`done`||e.state===`failed`||e.state===`canceled`,l=i.some(e=>!c(e)),u=new Map;for(let e of i){if(!e.origin?.startsWith(`fanout:fu:`))continue;let t=e.origin.slice(fi.length);u.set(t,[...u.get(t)??[],e])}let d=[...u.values()].map(e=>({text:e[0].payload.kind===`prompt`?e[0].payload.steps[0]:``,at:Math.min(...e.map(e=>e.createdAt)),dirs:e.map(e=>e.cwd)})).sort((e,t)=>e.at-t.at);r.push({id:t,text:o,startedAt:s,finishedAt:l?void 0:Math.max(...i.map(e=>e.settledAt??e.createdAt)),targets:a.map(e=>({dir:e.cwd,title:e.title||xf(e.cwd),sessionId:e.sessionId,status:bf(e),error:e.state===`failed`||e.state===`canceled`?e.result?.detail:void 0})),followUps:d.length?d:void 0})}return r.sort((e,t)=>t.startedAt-e.startedAt).slice(0,t)}var Cf=36e5,wf=18e4;function Tf(e,t){return e==null||t==null||Math.abs(e-t)<=wf}function Ef(e,t,n=27e5){let r=e=>t===`session`?e.s:e.w,i=e=>t===`session`?e.sr:e.wr,a=[],o=null,s=null,c=null,l=null;for(let t of e){let e=r(t);if(e==null)continue;let u=i(t),d=l!=null&&u!=null&&!Tf(l,u),f=c!=null&&e<c-2,p=!!s&&(d||f),m=!!s&&t.t-s.t>n;!o||p||m?(o={pts:[],rolled:p},a.push(o),l=u):l??=u,o.pts.push({t:t.t,v:e,r:u}),s=t,c=e}return a}function Df(e,t){return Ef(e,t,1/0)}3*Cf,3*Cf;var Of=36e5;function kf(e){let t=new Date(e);return t.setMinutes(0,0,0),t.getTime()}function Af(e){return kf(e+Of/2)}function jf(e){return Yt(e)}var Mf=(e,t)=>t.cost.total-e.cost.total||w(t.totals)-w(e.totals);function Nf(e){let t=new Map;for(let n of e)for(let e of n??[]){let n=t.get(e.model)??{model:e.model,totals:S(),cost:v()};C(n.totals,e.totals),y(n.cost,e.cost),t.set(e.model,n)}return[...t.values()].sort((e,t)=>w(t.totals)-w(e.totals)||e.model.localeCompare(t.model))}function Pf(e,t){return(e.byHour??[]).some(e=>e.hour===t&&(e.tok>0||e.usd>0))}var Ff=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],If=e=>`${String(new Date(e).getHours()).padStart(2,`0`)}:00`;function Lf(e){let t=e.convos??[],n=new Map;for(let t of e.hours??[])n.set(t.hour,{hour:t.hour,t:t.t,usd:t.cost.total,tok:w(t.totals),byRepo:t.byRepo??[],convoIds:[],restConvos:Number.isFinite(t.restConvos)&&t.restConvos>0?t.restConvos:0});for(let e of t)for(let t of e.byHour??[])!n.has(t.hour)&&(t.tok>0||t.usd>0)&&n.set(t.hour,{hour:t.hour,t:jf(t.hour),usd:0,tok:0,byRepo:[],convoIds:[],restConvos:0});let r=new Set((e.hours??[]).map(e=>e.hour));for(let e of n.values())for(let n of t)if(Pf(n,e.hour)&&(e.convoIds.push(n.id),!r.has(e.hour)))for(let t of n.byHour)t.hour===e.hour&&(e.usd+=t.usd,e.tok+=t.tok);let i=[...n.values()].filter(e=>e.tok>0||e.usd>0||e.convoIds.length>0).sort((e,t)=>e.t-t.t||e.hour.localeCompare(t.hour)),a=e.rest??[],o=a.reduce((e,t)=>e+(t.count>0?t.count:0),0),s=Math.max(t.length+o,Number.isFinite(e.convosTotal)?e.convosTotal:0),c=e=>e==null?t.slice():t.filter(t=>Pf(t,e));return{buckets:i,convosIn:c,filterText:e=>{if(e==null)return null;let t=`${c(e).length} of ${s} ${s===1?`session`:`sessions`}`,r=n.get(e)?.t;return r==null?t:`${t} · ${Ff[new Date(r).getDay()]} ${If(r)}–${If(r+Of)}`},total:s,restText:e=>{if(e==null){if(o<=0)return null;let e=a.reduce((e,t)=>e+(Number.isFinite(t.cost?.total)?t.cost.total:0),0);return`${o} cheaper ${o===1?`session`:`sessions`} not listed${e>0?` · ${b(e)}`:``}`}let t=n.get(e)?.restConvos??0;return t>0?`${t} more ${t===1?`session`:`sessions`} in this hour ${t===1?`is`:`are`} not listed`:null}}}var Rf={fanout:`fan-out`,backlog:`backlog item`,schedule:`schedule`,agent:`agent`,resurrect:`resumed at reset`,hand:`by hand`,fork:`fork`,unrecorded:`no launch record`},zf=e=>e.launch?.runId||e.launch?.itemId||`c:${e.id}`,Bf=e=>e.launch?.runId||e.launch?.itemId||`rest:${e.repo}:${e.launch?.kind??`unrecorded`}`;function Vf(e,t){let n=e.trim().split(/\s+/).filter(Boolean);return n.length>t?`${n.slice(0,t).join(` `)}…`:n.join(` `)}var Hf=e=>e.title||`${e.label} · ${e.id.slice(0,8)}`,Uf=e=>`${e} ${e===1?`repo`:`repos`}`;function Wf(e,t=[]){let n=e.convos[0],r=e.convos.find(e=>e.launch?.label)?.launch?.label??t.find(e=>e.launch?.label)?.launch?.label;if(!n&&!r){let n=e.more,r=t[0]?.label;return`${n} more ${n===1?`session`:`sessions`}${r?` · ${r}`:``}`}return e.kind===`fanout`?`${r||Vf(e.convos.find(e=>e.title)?.title??``,6)||`fan-out`} · ${Uf(e.repos)}`:r&&(e.kind===`backlog`||e.kind===`schedule`||e.kind===`agent`)?e.repos>1?`${r} · ${Uf(e.repos)}`:r:n?Hf(n):r}function Gf(e,t){if(t.some(t=>t?.runId&&t.runId===e))return`fanout`;let n=t.map(e=>e?.kind).filter(e=>!!e);return n.find(e=>e!==`resurrect`)??n[0]??`unrecorded`}function Kf(e,t=[]){let n=new Map,r=e=>n.get(e)??n.set(e,{convos:[],rest:[]}).get(e);for(let t of e)r(zf(t)).convos.push(t);for(let e of t)e.count>0&&r(Bf(e)).rest.push(e);let i=[];for(let[e,t]of n){let n=t.convos.slice().sort(Mf),r=t.rest.slice().sort(Mf),a=S(),o=v(),s=S(),c=v(),l=null,u=null;for(let e of[...n,...r])C(a,e.totals),y(o,e.cost),C(s,e.agentTotals),y(c,e.agentCost),e.firstAt!=null&&(l=l==null?e.firstAt:Math.min(l,e.firstAt)),e.lastAt!=null&&(u=u==null?e.lastAt:Math.max(u,e.lastAt));let d={key:e,kind:Gf(e,[...n.map(e=>e.launch),...r.map(e=>e.launch)]),repos:new Set([...n.map(e=>e.repo),...r.map(e=>e.repo)]).size,convos:n,more:r.reduce((e,t)=>e+t.count,0),totals:a,cost:o,agentTotals:s,agentCost:c,firstAt:l,lastAt:u};i.push({...d,label:Wf(d,r)})}return i.sort((e,t)=>Mf(e,t)||e.key.localeCompare(t.key))}function qf(e,t=[]){let n=new Map,r=e=>n.get(e)??n.set(e,{convos:[],rest:[]}).get(e);for(let t of e)r(t.repo).convos.push(t);for(let e of t)e.count>0&&r(e.repo).rest.push(e);let i=[];for(let[e,t]of n){let n=t.convos.slice().sort(Mf),r=S(),a=v(),o=v();for(let e of[...n,...t.rest])C(r,e.totals),y(a,e.cost),y(o,e.agentCost);let s=n[0]?.label??t.rest[0]?.label??e,c=t.rest.reduce((e,t)=>e+t.count,0);i.push({repo:e,label:s,totals:r,cost:a,agentCost:o,convos:n,more:c,byModel:Nf([...n,...t.rest].map(e=>e.byModel))})}return i.sort((e,t)=>Mf(e,t)||e.repo.localeCompare(t.repo))}function Jf(e){return{key:e.repo,label:e.label,...e.totals,cost:{...e.cost},byModel:e.byModel}}var Yf=6*Of,Xf=.35,Zf=.4;function Qf(e){return!!e&&typeof e.usdPerPt==`number`}function $f(e,t,n){let r=Df(e??[],`week`).filter(e=>e.pts.length>=2);if(!r.length)return{why:`noSamples`};let i=r.filter(e=>e.pts[e.pts.length-1].t-e.pts[0].t>=Yf);if(!i.length)return{why:`shortStretches`};let a=i.filter(e=>e.pts[e.pts.length-1].v-e.pts[0].v>=5);if(!a.length)return{why:`smallDelta`};let o=a.map(e=>{let n=e.pts[0],r=e.pts[e.pts.length-1],i=kf(n.t),a=kf(r.t),o=0;for(let e of t??[])e.t>=i&&e.t<a&&Number.isFinite(e.cost?.total)&&(o+=e.cost.total);return{usd:o,dPts:r.v-n.v}}).filter(e=>e.usd>0);if(!o.length)return{why:`noCost`};if(o.length===1&&o[0].dPts<10)return{why:`smallDelta`};let s=o.reduce((e,t)=>e+t.usd,0),c=o.reduce((e,t)=>e+t.dPts,0),l=s/c;if(!(l>0)||!Number.isFinite(l))return{why:`noCost`};if(o.some(e=>Math.abs(e.usd/e.dPts/l-1)>.35))return{why:`unstable`};let u=n!=null&&Number.isFinite(n)&&n>0?n:null;return u!=null&&Math.abs(l/u-1)>.4?{why:`disagreesWithLevel`}:{usdPerPt:l,usd:s,dPts:c,stretches:o.length,levelUsdPerPt:u}}function ep(e,t){if(!Qf(t)||e==null||!Number.isFinite(e)||!(e>0)||!(t.usdPerPt>0)||!Number.isFinite(t.usdPerPt))return null;let n=e/t.usdPerPt;if(!Number.isFinite(n))return null;if(n<.05)return`<0.1 pt`;let r=Number(n.toPrecision(2));return r===1?`≈ 1 pt`:`≈ ${r} pts`}function tp(e){switch(e.why){case`noSamples`:return`Points can't be calibrated yet — there are not two weekly readings in this span to compare.`;case`shortStretches`:return`Points can't be calibrated yet — no run of weekly readings without a reset spans ${Yf/Of} hours.`;case`smallDelta`:return`Points can't be calibrated yet — the week has not climbed 5 points inside one stretch of readings (10 when there is only one).`;case`noCost`:return`Points can't be calibrated — this desktop's logs have no cost in the hours the weekly figure climbed.`;case`unstable`:return`Points are not shown — the dollars per point moved by more than ${Math.round(Xf*100)}% between stretches of readings, so no one figure is right.`;case`disagreesWithLevel`:return`Points are not shown — the climb-based rate and the per-reading rate disagree by more than ${Math.round(Zf*100)}%.`}}function np(e){let t=Ke(e)?.split(`-`)[1];return t?t.charAt(0).toUpperCase()+t.slice(1):null}function rp(e){let t=e.cost?.total;if(!(t>0)||!Number.isFinite(t)||!e.agentByModel?.length)return null;let n=new Map,r=0;for(let t of e.agentByModel){let e=t.cost?.total;if(!Number.isFinite(e)||e<=0)continue;r+=e;let i=np(t.model);i&&n.set(i,(n.get(i)??0)+e)}if(r>t*1.001)return null;let i=null;for(let e of n)(!i||e[1]>i[1])&&(i=e);if(!i)return null;let a=i[1]/t*100;return a<15?null:`${i[0]} subagents: ${Math.round(a)}% of this session's cost`}function ip(e){return(e??``).replace(/\s+/g,` `).trim().toLowerCase()}function ap(e,t){let n=e.filter(e=>e.finishedAt!=null).sort((e,t)=>t.startedAt-e.startedAt),r=ip(t);if(r){let e=n.find(e=>ip(e.text)===r);if(e)return e}return n[0]??null}function op(e){return e<1?String(Number(e.toPrecision(1))):e<10?e.toFixed(1):String(Math.round(e))}function sp(e){let{same:t,usd:n,weekPct:r,agentPct:i,repos:a}=e,o=a>0?Uf(a):null,s=t?`last similar run${o?` (${o})`:``}`:`last run (different prompt${o?`, ${o}`:``})`,c=r!=null&&Number.isFinite(r)&&r>0?` ≈ ${op(r)}% of week`:``,l=Number.isFinite(i)&&i>=0?`, ${Math.round(Math.min(100,i))}% subagents`:``;return`${s}: ${b(n)}${c}${l}`}function cp(e){let t=e=>Number.isInteger(e)?T(e):String(Math.round(e*10)/10);if(e.unit)return`${t(e.unit.amount)} ${e.unit.name}`;let n=Object.entries(e.kinds).filter(([,e])=>e>0).sort((e,t)=>t[1]-e[1]);return n.length?`${n.map(([e,t])=>`${T(t)} ${e}`).join(`, `)} tokens`:`nothing counted`}var lp=`Also on this desktop over this span — each its own account, not in the figure above`,up=[{id:`security`,label:`Security`,ask:`Security: anything touching sign-in, permissions, secrets or keys, input handling, file or network access, what is exposed and to whom, or new attack surface. Say plainly when nothing does.`},{id:`behavior`,label:`What changes for users`,ask:`Behaviour a user would notice: new or removed features, changed defaults, screens, wording, timing, notifications. Describe it as the user experiences it, not as code.`},{id:`deploy`,label:`Deployment needed`,ask:`Deployment: does any of this need a deploy or release before it takes effect, and of WHICH component — e.g. web app only, backend / server / cloud functions, a mobile, watch or desktop app that needs a store release, infrastructure or config, a database migration. Name the components from the paths. Say when nothing needs deploying (docs, tests, tooling only).`},{id:`data`,label:`Data & migrations`,ask:`Data: changes to stored data, schemas, file formats or migrations; anything irreversible or that touches existing users' data.`},{id:`breaking`,label:`Breaking changes`,ask:`Compatibility: changed APIs, config files, environment variables, CLI flags or URLs; whether older clients, devices or saved state keep working.`},{id:`deps`,label:`Dependencies & cost`,ask:`Dependencies and cost: packages added or upgraded, new external services, new paid API calls or anything that adds a running cost.`},{id:`surprises`,label:`Surprises`,ask:`Surprises: changes the commit messages do not mention, edits unrelated to the stated goal, debug leftovers, disabled or weakened checks and tests, TODOs left behind.`},{id:`check`,label:`What to check by hand`,ask:`Risk: how risky this is (low / medium / high, one reason), and a short list of things to try by hand afterwards. Say whether tests cover the change.`}],dp=up.map(e=>e.id);function fp(e){let t=new Set(Array.isArray(e)?e.filter(e=>typeof e==`string`):[]);return up.filter(e=>t.has(e.id)).map(e=>e.id)}var pp=/^[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]+$/,mp=/https?:\/\//g,hp=/[.,;:!?)\]}'"]+$/,gp=24;function _p(e,t){let n=e.slice(t),r=n.search(/\s/);return r===-1?n:n.slice(0,r)}function vp(e){let t=0;for(;t<e.length&&pp.test(e[t]);)t++;return t}function yp(e){return e.length-e.trimStart().length}function bp(e){let t=[],n=new Set,r=e.map(e=>e.replace(/\s+$/,``));for(let e=0;e<r.length;e++){mp.lastIndex=0;let i;for(;i=mp.exec(r[e]);){let a=i.index,o=_p(r[e],a),s=vp(o),c=o.slice(0,s),l=s<o.length-1&&pp.test(o[s+1]),u=!l&&a+c.length===r[e].length,d=c,f=1;if(u){let t=yp(r[e]),n=r[e].length,i=[],a=null;for(let o=e+1;o<r.length;o++){let e=r[o];if(yp(e)!==t)break;let s=e.slice(t);if(!s||/https?:\/\//.test(s))break;if(!pp.test(s)){let e=vp(s);e&&!/\s/.test(s)&&t+s.length===n&&(a=s.slice(0,e));break}i.push(s)}if(n>=gp){let e=0,r=!1;for(let a=0;a<i.length&&(r=t+i[a].length!==n,e=a+1,!r);a++);e&&(d+=i.slice(0,e).join(``),f=1+e),!r&&e===i.length&&a!==null&&(d+=a,f+=1,l=!0)}}l||(d=d.replace(hp,``)),d.length>i[0].length&&!n.has(d)&&(n.add(d),t.push(l?{url:d,line:e,lines:f,truncated:l}:{url:d,line:e,lines:f})),mp.lastIndex=a+o.length}}return t}function xp(e){return bp(e.split(`
45
+ `))}var Sp=new Set(`/usage./cost./stats./context./status./todos./help./release-notes./config./model./output-style./statusline./vim./terminal-setup./agents./mcp./hooks./permissions./sandbox./add-dir./resume./rewind./clear./export./memory./bashes./remote-control./ide./upgrade./bug./feedback./privacy-settings./login./logout./effort./fast./theme./color./keybindings./skills./plugin./version./diff./copy`.split(`.`));function Cp(e){return Sp.has(e.trim().split(/\s+/)[0]??``)}var wp=new Set([`/btw`]);function Tp(e){return wp.has(e.trim().split(/\s+/)[0]??``)}[O.stateDirName,...Tn];function Ep(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);return n.length?e.filter(e=>{let t=`${e.name} ${e.cmd} ${e.dir??``} ${e.source}`.toLowerCase();return n.every(e=>t.includes(e))}):e}function Dp(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.floor(e):void 0}function Op(e){let t=[];for(let n of e){if(n.install!==`installed`&&n.install!==`failed`||!n.pkg||!n.id)continue;let e={pullId:n.id,pkg:n.pkg,outcome:n.install};typeof n.installAuto==`boolean`&&(e.auto=n.installAuto),n.label&&(e.label=n.label),n.version&&(e.version=n.version);let r=Dp(n.code);r!==void 0&&(e.code=r),n.name&&(e.file=n.name),n.repo&&(e.repo=n.repo),n.installError&&(e.error=n.installError),n.installedAt&&(e.at=n.installedAt),t.push(e)}return t}function kp(e){return e.name||e.model||`device ${e.id.slice(0,6)}`}function Ap(e){return kp({id:e.deviceId,name:e.deviceName,model:e.deviceModel})}function jp(e){let t=e.label||e.pkg;return e.version?`${t} ${e.version}`:t}function Mp(e,t){let n=Ap(e),r=e.auto===void 0?``:e.auto?` by itself`:` on a tap`;return`${e.outcome===`installed`?`installed`:`failed to install`}${r} on ${n} · ${e.at===void 0?`reported ${t(e.reportedAt)}`:t(e.at)}${e.outcome===`failed`&&e.error?` — ${e.error}`:``}`}function Np(e){let t=e.entries.length;if(!t)return`Nothing has installed itself yet. An app on a phone's allow-list is logged here the moment a build lands on it.`;let n=e.devices.length,r=e.entries.filter(e=>e.outcome===`failed`).length,i=`${t} install${t===1?``:`s`} on ${n} device${n===1?``:`s`}`;return r?`${i} · ${r} failed.`:`${i}.`}function Pp(e,t){return e.filter(e=>(!t.deviceId||e.deviceId===t.deviceId)&&(!t.pkg||e.pkg===t.pkg))}`${O.stateDirName}`;var Fp=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Ip(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getDate()} ${Fp[t.getMonth()]} ${n(t.getHours())}:${n(t.getMinutes())}`}function Lp(e){let t=e.sha?`${e.sha}${e.dirty?` + edits`:``}`:e.dirty?`uncommitted edits`:``;return[e.version??``,t,Ip(e.at)].filter(Boolean).join(` · `)}var Rp=/^[^\r\n]{1,200}$/,zp=e=>typeof e==`string`&&Rp.test(e.trim())?e.trim():void 0;function Bp(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.at!=`number`||!Number.isFinite(t.at)||t.at<=0)return null;let n={at:t.at},r=zp(t.version),i=zp(t.sha);return r&&(n.version=r),i&&/^[0-9a-f]{4,40}$/i.test(i)&&(n.sha=i),t.dirty===!0&&(n.dirty=!0),n}var Vp=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)&&Math.floor(e)>=20&&Math.floor(t)>=12,Hp=e=>Math.min(e,160),Up=/\x1b\[[0-9;?]*[ -/]*[@-~]|\x1b[PX^_].*?\x1b\\|\x1b\][^\x07]*\x07/g,Wp=/^(?:\d+(?:\.\d+)?\s*(?:ms|s|m|h)\s*)+$/i,Gp=/\b(?:esc|ctrl\+|shift\+|tab)\b/i,Kp=/([A-Za-z][A-Za-z'-]*ing)\s*(?:…|\.\.\.)/g,qp=/([A-Za-z][A-Za-z'-]*ing(?:\s+[A-Za-z][A-Za-z'-]*){1,3})\s*(?:…|\.\.\.)/g,Jp=/^[▰▱▬█▓░▒⣿⠿\s]*[▰▱▬█▓░▒⣿⠿]{4,}[\s]*(\d{1,3})\s?%$/,Yp=/^\s*[◯◉○●◎⏺]\s+[A-Za-z][\w:-]*\s{2,}\S/,Xp=/(?:^|\s)\d+(?:\.\d+)?\s*[smh](?:\s+\d+\s*[sm])*\s+·\s+[↓↑]\s*[\d.,]+\s*[km]?\s+tokens?\s*$/i;function Zp(e){if(!e)return null;let t=e.replace(Up,``).split(/[\r\n]+/),n=e=>(e??``).replace(/[│┃|╭╮╰╯─]/g,` `).replace(/\s+/g,` `).trim(),r=null;for(let e=t.length-1;e>=0;e--){if(Yp.test(t[e]??``)||Xp.test(t[e]??``))continue;let i=n(t[e]);if(!i)continue;let a=[...i.matchAll(/\(([^()]*)\)/g)],o=a[a.length-1],s=o?i.slice(0,o.index):i,c=null,l=null,u=[];for(let e of(o?.[1]??``).split(`·`)){let t=e.trim();t&&!Gp.test(t)&&(!c&&Wp.test(t)?c=t:!l&&/tokens?\b/i.test(t)?l=t:u.push(t))}let d=Jp.exec(n(t[e+1]))?.[1]??Jp.exec(i.slice(i.search(/[▰▱▬█▓░▒⣿⠿]/)<0?i.length:i.search(/[▰▱▬█▓░▒⣿⠿]/)))?.[1]??null;d&&u.push(`${d}%`);let f=[...s.matchAll(Kp)],p=f.length||!(c||l||d)?[]:[...s.matchAll(qp)],m=f[f.length-1]??p[p.length-1];if(!m)continue;let h=`${m[1]}…`;if(!c&&!l&&!d){r??={phrase:h,elapsed:null,tokens:null,extra:[],text:h};continue}let g=[h,l,...u].filter(Boolean).join(` · `);return{phrase:h,elapsed:c,tokens:l,extra:u,text:g.length>140?`${g.slice(0,139)}…`:g}}return r}var Qp=/\bto scroll\b/i;function $p(e){return e?Qp.test(e.replace(Up,``).slice(-2e3)):!1}function em(e){if(e===`shift+tab`)return`\x1B[Z`;if(e===`ctrl+c`||e===`ctrl+g`)return null;let t=/^ctrl\+([a-z])$/.exec(e);return t?String.fromCharCode(t[1].charCodeAt(0)-96):/^[a-z0-9]$/.test(e)?e:null}function tm(e){if(e===`shift+tab`)return`⇧Tab`;let t=/^ctrl\+([a-z])$/.exec(e);return t?`^${t[1].toUpperCase()}`:e}var nm={up:`A`,down:`B`,right:`C`,left:`D`,home:`H`,end:`F`},rm={pgup:`5`,pgdn:`6`,delete:`3`},im={tab:` `,enter:`\r`,esc:`\x1B`,backspace:``,space:` `,up:`\x1B[A`,down:`\x1B[B`,right:`\x1B[C`,left:`\x1B[D`,home:`\x1B[H`,end:`\x1B[F`,pgup:`\x1B[5~`,pgdn:`\x1B[6~`,delete:`\x1B[3~`},am={"[":`\x1B`,"\\":``,"]":``,"^":``,_:``,"?":``,"@":`\0`," ":`\0`};function om(e,t){return[e.ctrl&&`ctrl`,e.alt&&`alt`,e.shift&&`shift`,t===` `?`space`:t].filter(Boolean).join(`+`)}function sm(e){return!!(e.ctrl||e.alt||e.shift)}function cm(e,t){let n=om(e,t),r=e=>({refused:`${n} has no terminal bytes — ${e}`});if(!t)return r(`no key`);if(t in nm||t in rm){if(!sm(e))return{bytes:im[t]};let n=1+ +!!e.shift+(e.alt?2:0)+(e.ctrl?4:0);return{bytes:t in nm?`\x1b[1;${n}${nm[t]}`:`\x1b[${rm[t]};${n}~`}}if(e.alt){let n=cm({ctrl:e.ctrl,shift:e.shift},t);return`bytes`in n?{bytes:`\x1b${n.bytes}`}:r(`refused`in n?n.refused.replace(/^.*? — /,``):``)}let i=t===`space`?` `:t;if(e.ctrl){if(e.shift&&t!==`tab`)return r(`a plain terminal sends the same byte as without shift`);if(t===`tab`)return r(`terminals send Tab for it`);if(t===`enter`)return r(`terminals send Return for it`);if(t===`backspace`)return{bytes:`\b`};if(t===`esc`)return r(`terminals send Esc for it`);if(i.length===1){let e=i.toLowerCase();if(/^[a-z]$/.test(e))return{bytes:String.fromCharCode(e.charCodeAt(0)-96)};if(i in am)return{bytes:am[i]};if(i===`-`)return{bytes:``}}return r(`ctrl combines only with a letter or [ \\ ] ^ _ ? @ space`)}return e.shift?t===`tab`?{bytes:`\x1B[Z`}:t===`enter`?r(`terminals send Return for it; Alt+Return is claude's newline`):t===`space`?{bytes:` `}:t in im?{bytes:im[t]}:i.length===1?{bytes:i.toUpperCase()}:r(`unknown key`):t in im?{bytes:im[t]}:i.length===1?{bytes:i}:r(`unknown key`)}var lm=16e3;lm*2;function um(e,t=lm){let n=e.length*2,r=new ArrayBuffer(44+n),i=new DataView(r),a=(e,t)=>{for(let n=0;n<t.length;n++)i.setUint8(e+n,t.charCodeAt(n))};return a(0,`RIFF`),i.setUint32(4,36+n,!0),a(8,`WAVE`),a(12,`fmt `),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,t,!0),i.setUint32(28,t*2,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0),a(36,`data`),i.setUint32(40,n,!0),new Int16Array(r,44).set(e),new Uint8Array(r)}function dm(e){let t=new Int16Array(e.length);for(let n=0;n<e.length;n++){let r=Math.max(-1,Math.min(1,e[n]));t[n]=r<0?r*32768:r*32767}return t}var fm=.25,pm=new Set(`af.am.ar.as.az.ba.be.bg.bn.bo.br.bs.ca.cs.cy.da.de.el.en.es.et.eu.fa.fi.fo.fr.gl.gu.ha.haw.he.hi.hr.ht.hu.hy.id.is.it.ja.jw.ka.kk.km.kn.ko.la.lb.ln.lo.lt.lv.mg.mi.mk.ml.mn.mr.ms.mt.my.ne.nl.nn.no.oc.pa.pl.ps.pt.ro.ru.sa.sd.si.sk.sl.sn.so.sq.sr.su.sv.sw.ta.te.tg.th.tk.tl.tr.tt.uk.ur.uz.vi.yi.yo.yue.zh`.split(`.`)),mm={nb:`no`,jv:`jw`,iw:`he`,in:`id`,ji:`yi`,fil:`tl`,cmn:`zh`,mo:`ro`};function hm(e){let t=(e||``).trim().toLowerCase();if(!t||t===`auto`)return`auto`;let n=t.split(/[-_]/)[0],r=mm[n]||n;return pm.has(r)?r:`auto`}var gm=`auto`,_m={en:`English`,de:`German`,fr:`French`,es:`Spanish`,it:`Italian`,nl:`Dutch`,pt:`Portuguese`,pl:`Polish`,ru:`Russian`,uk:`Ukrainian`,cs:`Czech`,sv:`Swedish`,da:`Danish`,no:`Norwegian`,fi:`Finnish`,tr:`Turkish`,el:`Greek`,he:`Hebrew`,ar:`Arabic`,hi:`Hindi`,ja:`Japanese`,ko:`Korean`,zh:`Chinese`},vm=[`en`,`de`];function ym(e){return e===`auto`?`auto — whichever is spoken`:_m[e]||e}function bm(e){return e===`auto`?`auto`:e.toUpperCase()}function xm(e){return e===`auto`?`dictation is read as whichever language is spoken — pick one to pin it`:`dictation is read as ${ym(e)} — anything else spoken is TRANSLATED into it`}function Sm(e){let t=Object.keys(_m).filter(e=>!vm.includes(e)),n=[gm,...vm,...t],r=hm(e);return r!==`auto`&&!n.includes(r)&&n.push(r),n.map(e=>({code:e,label:ym(e)}))}var Cm=[gm,`en`,`de`];function wm(e,t,n){let r=Sm(n),i=new Set(r.map(e=>e.code)),a=new Set((e||[]).map(e=>{let t=hm(e);return t===`auto`&&e.trim().toLowerCase()!==`auto`?``:t}).filter(e=>i.has(e)));if(!a.size)for(let e of Cm)i.has(e)&&a.add(e);let o=hm(t);return i.has(o)&&a.add(o),r.filter(e=>a.has(e.code))}function Tm(e,t){let n=t.trim();if(!n)return e;let r=e.replace(/\s*$/,``);return r?`${r} ${n}`:n}var Em=e=>e.replace(/\s+/g,` `).trim().slice(0,40).trim();function Dm(e){let t=[],n=new Map;for(let r of String(e||``).split(/\r?\n/)){let e=r.trim();if(!e||e.startsWith(`#`))continue;let i=e.indexOf(`:`),a=Em(i<0?e:e.slice(0,i));if(!a)continue;let o=i<0?[]:e.slice(i+1).split(`,`).map(Em).filter(Boolean),s=a.toLowerCase(),c=n.get(s);if(!c){if(t.length>=60)continue;c={term:a,heard:[]},n.set(s,c),t.push(c)}for(let e of o){if(c.heard.length>=8)break;e.toLowerCase()!==s&&(c.heard.some(t=>t.toLowerCase()===e.toLowerCase())||c.heard.push(e))}}return t}function Om(e){let t=String(e||``).split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`#`)),n=new Set(t.map(e=>Em(e.split(`:`)[0]).toLowerCase()).filter(Boolean));return Math.max(0,n.size-Dm(e).length)}function km(e){return e.map(e=>e.heard.length?`${e.term}: ${e.heard.join(`, `)}`:e.term).join(`
46
+ `)}var Am=`\\p{L}\\p{N}`,jm=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Mm(e){return e.length>=3&&/^\S+$/.test(e)&&(/\p{N}/u.test(e)||/\p{Lu}/u.test(e.slice(1)))}function Nm(e,t){if(!e||!t.length)return e;let n=[];for(let e of t){for(let t of e.heard){let r=t.split(` `).map(jm).join(`[\\s\\-]+`);n.push({re:RegExp(`(?<![${Am}])${r}(?![${Am}])`,`giu`),term:e.term,keep:()=>!1,len:t.length})}if(/^\S+$/.test(e.term)&&e.term.length>=2&&e.term.length<=16){let t=Array.from(e.term).map(jm).join(`[\\s.\\-]?`),r=Mm(e.term);n.push({re:RegExp(`(?<![${Am}])${t}(?![${Am}])`,`giu`),term:e.term,keep:t=>t===e.term||!/[\s.\-]/.test(t)&&!r,len:e.term.length})}}n.sort((e,t)=>t.len-e.len);let r=e;for(let e of n)r=r.replace(e.re,t=>e.keep(t)?t:e.term);return r}var Pm=`tools/repohealth.mjs`,Fm=`the repo-health engine`,Im=En(`repohealth.jsonl`),Lm=Dn(`health.json`);function Rm(e){return!e||typeof e.hasRepoHealth!=`boolean`?`unknown`:e.hasRepoHealth?`offered`:`absent`}function zm(e){return e===`absent`?`No repo-health engine on this desktop — neither this repo's own ${Pm} nor a bundled one was found, so there is nothing to read the history with.`:e===`unknown`?`This desktop is older than repo health and cannot say whether this repo has it.`:null}function Bm(e){return!e||!(`plot`in e)||e.plot===void 0?`unknown`:e.plot===null?`none`:`plotted`}function Vm(e,t){return e===`none`?typeof t==`string`&&t.length>0?t:`${Fm} read no series to plot here — refresh it to measure one.`:e===`unknown`?`This desktop is older than the repo-health plot and sent no series to draw.`:null}var Hm=e=>typeof e==`string`&&e.length>0;function Um(e){return e&&Hm(e.recut)?e.recut:null}var J=[`size`,`retouch`,`hatches`,`context`,`untested`],Wm={lineMean:500,max:1e3,retouch:.15,hatches:2,untested:.2},Gm=16e3,Km=e=>typeof e==`number`&&Number.isFinite(e)&&e>0,Y=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0;function qm(e,t){return e<=0?100:100*Math.min(1,t/e)}function Jm(e){if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let t=Date.parse(`${e}T00:00:00Z`);if(!Number.isFinite(t))return null;let n=(new Date(t).getUTCDay()+6)%7;return new Date(t-n*864e5).toISOString().slice(0,10)}function Ym(e){let t=new Map;for(let n of e){if(!n||typeof n.ts!=`number`)continue;let e=Jm(n.day);if(!e)continue;let r=t.get(e);(!r||n.ts>=r.ts)&&t.set(e,n)}return[...t.entries()].sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,t])=>({week:e,row:t}))}function Xm(e){return 1*(Km(e)?e:Gm)}function Zm(e){let t={},n,r=e.size?.value;r&&Y(r.max)&&(n={value:r.max,path:typeof r.maxPath==`string`&&r.maxPath?r.maxPath:null}),r&&Y(r.lineMean)&&n&&(t.size=r.lineMean);let i=e.retouch?.value?.rate;Y(i)&&(t.retouch=i);let a=e.hatches,o=e.classics?.value?.loc;if(a?.value&&typeof a.value==`object`&&Km(o)){let e=0,n=!0;if(a.split&&typeof a.split==`object`)Y(a.split.unexplained)?e=a.split.unexplained:n=!1;else for(let t of Object.values(a.value)){if(!Y(t)){n=!1;break}e+=t}n&&(t.hatches=e/(o/1e3))}let s=e.context?.value,c=s?.claudeMdChars,l=s?.descChars;!s&&e.context?.reason===`no CLAUDE.md at this commit`?t.context=0:Y(c)&&(l==null||Y(l))&&(t.context=c+(typeof l==`number`?l:0));let u=e.untested?.value,d=e.classics?.value?.files;Array.isArray(u)&&Km(d)&&u.length<=d&&(t.untested=u.length/d);let f=$m(e);for(let e of f.disabled)delete t[e],e===`size`&&(n=void 0);for(let r of f.overridden){delete t[r];let i=e.central?.override?.[r]?.value;Y(i)&&(r!==`size`||n)&&(t[r]=i)}return t.size===void 0&&(n=void 0),n?{values:t,max:n}:{values:t}}var Qm=e=>J.includes(e);function $m(e){let t=e.central;if(!t||typeof t!=`object`)return{fp:``,disabled:[],overridden:[]};let n=typeof t.fp==`string`?t.fp:``,r=e=>e&&typeof e==`object`?Object.keys(e).filter(Qm):[],i=J.filter(e=>r(t.disabled).includes(e));return{fp:n,disabled:i,overridden:J.filter(e=>r(t.override).includes(e)&&!i.includes(e))}}var eh=864e5;function th(e){let t=e.classics?.value;return t&&Y(t.files)&&Y(t.loc)?{files:t.files,loc:t.loc}:null}var nh=(e,t)=>Math.round((Date.parse(`${t}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/eh),X=e=>Math.round(e).toString().replace(/\B(?=(\d{3})+(?!\d))/g,`,`),rh=e=>`${Math.round(e*100)}%`,ih=e=>(Math.round(e*10)/10).toFixed(1),ah={size:`file length`,retouch:`re-touches`,hatches:`escape hatches`,context:`CLAUDE.md + skill descriptions`,untested:`untested modules`};function oh(e,t,n,r,i){return`${e}: ${(()=>{switch(t){case`max`:return`${i??`the longest file`} is ${X(n)} lines (good: under ${X(r)})`;case`lineMean`:return`the average line sits in a file of ${X(n)} lines (good: under ${X(r)})`;case`retouch`:return`${rh(n)} of recent file edits rework the edit before (good: under ${rh(r)})`;case`hatches`:return`${ih(n)} unexplained escape hatches per 1,000 lines (good: under ${ih(r)})`;case`context`:return`CLAUDE.md + skill descriptions are ${X(n)} chars (good: under ${X(r)})`;case`untested`:return`${rh(n)} of source files have no test reaching them (good: under ${rh(r)})`}})()}`}function sh(e,t,n,r,i){let a=qm(n,r);if(!(a<50))return null;let o=a<25?`severe`:`warn`,s=i??void 0;return{level:o,entry:e,subject:t,value:n,good:r,score:a,...s?{path:s}:{},text:oh(o,t,n,r,s)}}function ch(e){if(!e.cappedBy||!(e.value<e.mean))return null;let t=Math.round(e.value-30);return`Capped at ${Math.round(e.value)} by ${ah[e.cappedBy]} (${t} of 100): the entries average ${Math.round(e.mean)}, and the score stays within 30 of its worst entry.`}function lh(e,t,n){let r=J.filter(e=>!t.includes(e));if(r.length===0||r.some(t=>e.values[t]===void 0))return null;let i=Xm(n),a={},o=null,s=[];for(let t of r){let n=e.values[t];if(t===`size`){let t=e.max;o={lineMean:{value:n,score:qm(n,Wm.lineMean)},max:{value:t.value,score:qm(t.value,Wm.max),path:t.path}},a.size=Math.sqrt(o.lineMean.score*o.max.score);let r=sh(`size`,`lineMean`,n,Wm.lineMean),i=sh(`size`,`max`,t.value,Wm.max,t.path);r&&s.push(r),i&&s.push(i);continue}let r=t===`context`?i:Wm[t];a[t]=qm(n,r);let c=sh(t,t,n,r);c&&s.push(c)}let c=r.length,l=Math.exp(r.reduce((e,t)=>e+Math.log(a[t]),0)/c),u=r[0];for(let e of r)a[e]<a[u]&&(u=e);let d=a[u]+30,f=Math.min(l,d);return s.sort((e,t)=>e.score-t.score),{index:f,mean:l,scores:a,sizeParts:o,cappedBy:d<l?u:null,alerts:s,enabled:r}}function uh(e,t){let n=[];for(let{week:r,row:i}of Ym(e)){let e=$m(i),a=Zm(i),o=lh(a,e.disabled,t);if(!o)continue;let s=typeof i.prereg==`string`?i.prereg:null,c=n[n.length-1],l={week:r,index:o.index,mean:o.mean,scores:o.scores,sizeParts:o.sizeParts,cappedBy:o.cappedBy,alerts:o.alerts,values:a.values,prereg:s,central:e.fp,disabled:e.disabled,overridden:e.overridden,tree:th(i)};if(!c){n.push({...l,gap:!1,lnLink:null,comparable:0,contributions:{},spanDays:null});continue}let u=nh(c.week,r),d=c.prereg===s?c.central===e.fp?null:`central`:`prereg`;if(d){n.push({...l,gap:!0,lnLink:null,comparable:0,contributions:{},spanDays:u,gapReason:d});continue}let f=o.enabled.length,p={};for(let e of o.enabled){let t=c.scores[e],n=o.scores[e];t!==void 0&&n!==void 0&&(p[e]=c.mean*(Math.log(n)-Math.log(t))/f)}n.push({...l,gap:!1,lnLink:Math.log(o.index/c.index),comparable:f,contributions:p,spanDays:u})}return n.length===0?null:{baselineWeek:n[0].week,points:n}}function dh(e,t){let n=lh(Zm(e),$m(e).disabled,t);return n?{index:n.index,mean:n.mean,scores:n.scores,cappedBy:n.cappedBy}:null}function fh(e,t){if(e.length<=t)return[...e];let n=new Set,r=new Map;e.forEach((e,t)=>r.set(e.week,t));for(let e of r.values())n.add(e);let i=Math.ceil(e.length/Math.max(1,t));for(let t=0;t<e.length;t+=i){let r=t,a=t,o=Math.min(e.length,t+i);for(let n=t;n<o;n++)e[n].index<e[r].index&&(r=n),e[n].index>e[a].index&&(a=n);n.add(r),n.add(a)}return[...n].sort((e,t)=>e-t).map(t=>e[t])}function ph(e,t,n=240){let r=e.filter(e=>e&&typeof e.ts==`number`).sort((e,t)=>e.ts-t.ts),i=[],a=null;for(let e of r){let n=Jm(e.day),r=n?dh(e,t):null;if(!n||!r)continue;let o=typeof e.prereg==`string`?e.prereg:null,s=$m(e).fp;i.push({sha7:typeof e.sha==`string`?e.sha.slice(0,7):``,day:e.day,ts:e.ts,week:n,index:r.index,mean:r.mean,cappedBy:r.cappedBy,gap:a!==null&&(a.prereg!==o||a.central!==s)}),a={prereg:o,central:s}}if(i.length===0)return null;let o=fh(i,n);return{points:o,total:i.length,thinned:o.length<i.length}}function mh(e){return!e||e.commits===void 0?`absent`:e.commits&&e.commits.points.length>0?`present`:`none`}function hh(e,t=12,n=e.length-1){let r=e[n];if(!r||!(t>0)||!Number.isFinite(r.index))return null;let i=Date.parse(`${r.week}T00:00:00Z`),a=i-t*7*eh;for(let t=n-1;t>=0;t--){let n=Date.parse(`${e[t].week}T00:00:00Z`);if(n>a)continue;let o=e[t];return o.index>0?{ratio:r.index/o.index,delta:r.index-o.index,then:o,now:r,weeks:Math.round((i-n)/(7*eh))}:null}return null}function gh(e,t){let n=[...e].sort((e,t)=>e-t),r=t/100*(n.length-1),i=Math.floor(r),a=Math.ceil(r);return n[i]+(n[a]-n[i])*(r-i)}function _h(e,t={}){let n=t.minWeeks??8,r=t.minMonthWindows??4,i=t.lowPct??10,a=t.highPct??90,o=t.minPoints??2,s=(e,t=null,n=null)=>({kind:null,horizon:t,delta:n,reason:e}),c=e[e.length-1];if(!c)return s(`no index yet`);let l=e.filter(e=>e.lnLink!==null);if(l.length<n)return s(`${l.length} weekly link${l.length===1?``:`s`} so far; a move is called after ${n}`);if(c.lnLink!==null){let t=l.slice(0,-1).map(e=>e.lnLink),n=e[e.length-2].index,r=c.index-n;if(c.lnLink<gh(t,i)&&-r>=o)return{kind:`drop`,horizon:`week`,delta:r,reason:`the latest week's link sits below the ${i}th percentile of ${t.length} earlier weeks`};if(c.lnLink>gh(t,a)&&r>=o)return{kind:`rise`,horizon:`week`,delta:r,reason:`the latest week's link sits above the ${a}th percentile of ${t.length} earlier weeks`}}let u=e.length-1;if(u<4)return s(`too few weeks for a four-week reading`);let d=t=>{for(let n=t-4+1;n<=t;n++)if(e[n].gap)return!0;return!1};if(d(u))return s(`the last four weeks span a change of definition, so there is no month move to compare`);let f=[];for(let t=4;t<u;t++)d(t)||f.push(Math.log(e[t].index/e[t-4].index));let p=c.index-e[u-4].index;if(f.length<r)return s(`${f.length} earlier four-week window${f.length===1?``:`s`}; a month move is called after ${r}`);let m=Math.log(c.index/e[u-4].index);return m<gh(f,i)&&-p>=o?{kind:`drop`,horizon:`month`,delta:p,reason:`the last four weeks sit below the ${i}th percentile of ${f.length} earlier four-week windows`}:m>gh(f,a)&&p>=o?{kind:`rise`,horizon:`month`,delta:p,reason:`the last four weeks sit above the ${a}th percentile of ${f.length} earlier four-week windows`}:s(`within this repo's usual range`,null,c.lnLink===null?null:c.index-e[u-1].index)}var vh={size:[`files grew longer`,`files got shorter`],retouch:[`more re-touched files`,`fewer re-touched files`],hatches:[`more escape hatches`,`fewer escape hatches`],context:[`CLAUDE.md + skill descriptions grew`,`CLAUDE.md + skill descriptions shrank`],untested:[`more untested modules`,`fewer untested modules`]};function yh(e){let t=Math.round(e);return t===0?`±0`:t<0?`−${-t}`:`+${t}`}function bh(e,t){return t&&e===t?`this week`:`in the week of ${e}`}function xh(e,t,n){let r=e[e.length-1];if(!r||!t.kind||!t.horizon||t.delta===null)return null;let i=Math.round(r.index),a=t.horizon===`week`?1:4,o=n&&r.week===n,s=t.horizon===`week`?bh(r.week,n):o?`over four weeks`:`over the four weeks to ${r.week}`,c={};for(let t of e.slice(-a))for(let e of J){let n=t.contributions[e];n!==void 0&&(c[e]=(c[e]??0)+n)}let l=t.kind===`drop`?-1:1,u=J.filter(e=>(c[e]??0)*l>0).sort((e,t)=>Math.abs(c[t]??0)-Math.abs(c[e]??0)).slice(0,2).map(e=>`${vh[e][t.kind===`drop`?0:1]} (${yh(c[e]??0)})`),d=t.kind===`drop`?`slipped`:`rose`,f=Math.abs(Math.round(t.delta)),p=u.length?`The score ${d} ${f} point${f===1?``:`s`} ${s}: ${u.join(`, `)}.`:`The score ${d} ${f} point${f===1?``:`s`} ${s}.`;return{chip:`Health ${i} ${yh(t.delta)}`,title:`Health score ${i} (${yh(t.delta)} ${s})`,body:p}}function Sh(e,t){let n=e?.points,r=n?.[n.length-1];if(!n||!r)return null;let i=n[n.length-2];return{value:r.index,deltaWeek:r.lnLink!==null&&i?r.index-i.index:null,week:r.week,move:t?.kind??null,mean:r.mean,cappedBy:r.cappedBy,alert:r.alerts[0]?.level??null,alertText:r.alerts[0]?.text??null}}var Ch=[`requested`,`shipped`,`superseded`,`dropped`];function wh(e){let t=e.trim(),n=/^\d{4}-\d{2}-\d{2}/.exec(t)?.[0]??null,r=/session ([0-9a-f]{8})/.exec(t)?.[1]??null,i=/\(([^)]*)\)/.exec(t)?.[1]?.trim()??null;return{date:n,session:r,note:i&&!r?i:!n&&/^[0-9a-f]{8}$/.test(t)?t:null}}function Th(e,t){if(!e||!t)return 0;let n=e.split(`.`).map(e=>parseInt(e,10)||0),r=t.split(`.`).map(e=>parseInt(e,10)||0);for(let e=0;e<Math.max(n.length,r.length);e++){let t=(n[e]??0)-(r[e]??0);if(t)return t>0?1:-1}return 0}function Eh(e,t){return!e||!t?null:Th(t,e)>0?{running:e,installed:t}:null}function Dh(e,t){let n=`This session runs Claude ${e.running}; ${e.installed} is installed.`;if(!t.resumeId)return{text:n,cant:`its conversation id is not known yet, so a restart could not reopen the same conversation`};let r=[];t.turnActive&&r.push(`the turn that is running`);let i=t.agents??0;return i>0&&r.push(i===1?`1 background agent`:`${i} background agents`),t.shells&&r.push(`the background shells`),r.length?{text:n,loses:r.join(` and `)}:{text:n}}function Oh(e){return{title:`Restart on Claude ${e.installed} first?`,lines:[`This session still runs Claude ${e.running}; ${e.installed} is installed.`,`Restart, then send: the same conversation reopens on ${e.installed} and this message is its first prompt.`,`Send on ${e.running}: the message goes now and the bar above stays — this is not asked again for this version.`],confirmLabel:`Restart, then send`,cancelLabel:`Send on ${e.running}`}}var kh=6e5;function Ah(e,t,n=kh){return e.cpuMovedAt===void 0&&e.outputAt===void 0?`unknown`:e.workers===0?`waiting`:t-Math.max(e.cpuMovedAt??0,e.outputAt??0)<n?`working`:`quiet`}function jh(e){let t=Math.max(0,Math.round(e/1e3)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?r>0?`${n}d ${r}h`:`${n}d`:r>0?i>0?`${r}h ${i}m`:`${r}h`:i>0?`${i}m`:`${a}s`}var Mh=/pgrep\s+-f\s+(?:"([^"]*)"|'([^']*)')/g,Nh=/[$^.*+?()[\]{}|\\]/;function Ph(e){Mh.lastIndex=0;let t;for(;t=Mh.exec(e);){let e=t[1]??t[2]??``;if(e&&!Nh.test(e))return e}return null}function Fh(e,t){if(e.foreground)return`a command this turn is running`;let n=jh(t-e.startedAt);if(e.serverLike)return`long-running by design · ${n}`;if(e.selfMatch){let t=Ph(e.command);if(t)return`waits for "${t}" to end — its own command line matches that pattern, so this never ends`}let r=Ah(e,t);return r===`unknown`?`can't tell yet`:r===`working`?`running · ${n} · CPU moved ${jh(t-Math.max(e.cpuMovedAt??0,e.outputAt??0))} ago`:r===`waiting`?`waiting in a loop · ${n} · only sleeps between checks`:`quiet ${n} · no CPU and no output`}function Ih(e,t,n=kh){let r={working:0,waiting:0,quiet:0,unknown:0,foreground:0,total:0};for(let i of e)i.foreground?r.foreground++:(r[Ah(i,t,n)]++,r.total++);return r}function Lh(e){let t=e.total===1?`shell`:`shells`,n=`${e.total} ${t}`;if(!e.total)return n;let r=[`quiet`,`waiting`,`unknown`,`working`].find(t=>e[t]>0);if(!r)return n;let i=r===`working`?`running`:r;return e.total===1?`${n} · ${i}`:`${n} · ${e[r]} ${i}`}function Rh(e){return e.description?e.description:e.command.trim().split(/\s+/).slice(0,3).join(` `)||`shell`}function zh(e,t){if(!e.total)return``;let n=[],r=0;for(let e of t)e.foreground||(e.workers===0?r++:n.push(Rh(e)));r&&n.push(r===1?`1 wait loop`:`${r} wait loops`);let i=e.total===1?`background shell`:`background shells`;return`stops ${e.total} ${i}${n.length?` — ${n.join(`, `)}`:``}`}function Bh(e){let t=new Set(e.map(e=>e.id)),n=new Map;for(let r of e){if(!r.companionOf||r.companionOf===r.id||!t.has(r.companionOf))continue;let e=n.get(r.companionOf);e?e.push(r):n.set(r.companionOf,[r])}if(!n.size)return[...e];let r=new Set([...n.values()].flat().map(e=>e.id)),i=[],a=e=>{i.push(e);for(let t of n.get(e.id)??[])a(t)};for(let t of e)r.has(t.id)||a(t);if(i.length<e.length)for(let t of e)i.includes(t)||i.push(t);return i}function Vh(e,t){if(e.companionOf){let n=t.find(t=>t.id===e.companionOf);return n?{target:n,to:`cli`}:null}let n=t.filter(t=>t.companionOf===e.id);return n.length?{target:n.reduce((e,t)=>(t.createdAt??0)>(e.createdAt??0)?t:e),to:`shell`}:null}var Hh=A(`brand.migratedFrom`);function Uh(e){for(let t of k)if(t.storagePrefix!==O.storagePrefix&&e.startsWith(t.storagePrefix))return O.storagePrefix+e.slice(t.storagePrefix.length);return null}function Wh(e,t){if(e.getItem(Hh)!==null)return{ran:!1,copied:[],kept:[]};let n=[];for(let t=0;t<e.length;t++){let r=e.key(t);r!==null&&n.push(r)}let r=[],i=[];for(let t of k)if(t.storagePrefix!==O.storagePrefix)for(let a of n){if(!a.startsWith(t.storagePrefix))continue;let n=O.storagePrefix+a.slice(t.storagePrefix.length);if(e.getItem(n)!==null){i.push(a);continue}let o=e.getItem(a);o!==null&&(e.setItem(n,o),r.push([a,n]))}let a={from:k.map(e=>e.slug),at:t};return e.setItem(Hh,JSON.stringify(a)),{ran:!0,copied:r,kept:i}}`${O.slug}`;var Gh=/^[A-Za-z0-9][A-Za-z0-9_-]{0,31}$/;function Kh(e){if(typeof e!=`string`||!e.trim())return`no address given`;let t=/^([^:/\s]+):(\d{1,5})$/.exec(e.trim());if(!t)return`write the address as host:port`;let n=Number(t[2]);if(n<1||n>65535)return`the port must be 1-65535`;let r=t[1].toLowerCase(),i=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(r);if(i){let e=i.slice(1).map(Number);return e.some(e=>e>255)||i.slice(1).some(e=>e.length>1&&e.startsWith(`0`))?`not a valid IPv4 address`:e[0]===127&&e[1]===0&&e[2]===0&&e[3]===1||e[0]===100&&e[1]>=64&&e[1]<=127?null:`only a Tailscale address (100.64.0.0/10) or 127.0.0.1 may be a peer`}if(r.endsWith(`.ts.net`)){let e=r.split(`.`);return e.length>=4&&e.every(e=>/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(e))?null:`a MagicDNS name looks like <machine>.<tailnet>.ts.net`}return`only a Tailscale address (100.x or <machine>.<tailnet>.ts.net) or 127.0.0.1 may be a peer`}function qh(e,t){if(!e||typeof e.peer!=`string`||!e.peer)return``;let n={queued:`waiting on ${e.peer}`,waiting:`waiting on ${e.peer}`,running:`waiting on ${e.peer}`,limit:`${e.peer} is at its usage limit`,unreachable:`${e.peer} unreachable`,done:`${e.peer} has answered`,failed:`${e.peer}'s job failed`,refused:`${e.peer} refused the job`}[e.state];if(!n)return``;if(typeof t!=`number`||!Number.isFinite(t)||!Number.isFinite(e.since)||e.since<=0||t<e.since)return n;let r=Math.floor((t-e.since)/6e4);return`${n} · ${r<1?`just now`:r<60?`${r} min`:r<1440?`${Math.floor(r/60)} h`:`${Math.floor(r/1440)} d`}`}var Z=e=>typeof e==`number`&&Number.isFinite(e)&&e>0,Jh=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0;function Yh(e){if(typeof e!=`string`)return null;let t=Ke(e),n=t?t.replace(/^claude-/,``):e.trim().toLowerCase();return/^[a-z0-9][a-z0-9._/-]{0,47}$/.test(n)?n:null}function Xh(e){if(!e||typeof e!=`object`)return;let t=e,n={};Z(t.usd)&&(n.usd=t.usd);let r=t.tokens&&typeof t.tokens==`object`?t.tokens:null;r&&Jh(r.in)&&Jh(r.out)&&Jh(r.cacheRead)&&Jh(r.cacheWrite)&&r.in+r.out+r.cacheRead+r.cacheWrite>0&&(n.tokens={in:r.in,out:r.out,cacheRead:r.cacheRead,cacheWrite:r.cacheWrite});let i=Yh(t.model);return i&&(n.model=i),Z(t.durationMs)&&(n.durationMs=t.durationMs),Z(t.weekPct)&&t.weekPct<=100&&(n.weekPct=t.weekPct),Z(t.unpricedTok)&&(n.unpricedTok=t.unpricedTok),Object.keys(n).length?n:void 0}function Zh(e){if(!Z(e))return``;let t=Math.floor(e/6e4);if(t<1)return`<1 min`;if(t<60)return`${t} min`;if(t<1440){let e=Math.floor(t/60),n=t%60;return n?`${e} h ${n} min`:`${e} h`}let n=Math.floor(t/1440),r=Math.floor(t%1440/60);return r?`${n} d ${r} h`:`${n} d`}function Qh(e){return Z(e)?e<.001?`<0.001% of week`:`≈${e<1?String(Number(e.toPrecision(1))):e<10?e.toFixed(1):String(Math.round(e))}% of week`:``}function $h(e){if(!e)return[];let t=[];Z(e.usd)&&t.push(b(e.usd)),e.model&&t.push(e.model);let n=Zh(e.durationMs);return n&&t.push(n),t}var eg={queued:`queued there`,waiting:`waiting there`,running:`running`,limit:`at its usage limit`,unreachable:`unreachable`,done:`done`,failed:`failed`,refused:`refused`},tg=e=>eg[e]??``;function ng(e){if(!e||typeof e.peer!=`string`||!e.peer)return``;let t=tg(e.state);if(!t)return``;let n=typeof e.label==`string`&&e.label.trim()?e.label.trim():`a job`;return[`sent to ${e.peer}: ${n}`,t,...$h(e.cost)].join(` · `)}function rg(e,t){if(!t?.length)return null;let n=new Map,r=0;for(let e of t){let t=e.cost?.usd;Z(t)?n.set(e.peer,(n.get(e.peer)??0)+t):r++}if(!n.size)return null;let i=[...n].map(([e,t])=>({peer:e,usd:t})),a=i.map(e=>`${b(e.usd)} on ${e.peer}`).join(` + `);return{text:`${Z(e)?`${b(e)} here + `:``}${a}${Z(e)?``:` (this desktop's share is not priced)`}${r?` · ${r} peer job${r===1?``:`s`} not priced`:``}`,peerUsd:i.reduce((e,t)=>e+t.usd,0),byPeer:i,unpriced:r}}function ig(e,t,n){if(!e?.length||!Number.isFinite(t)||!Number.isFinite(n)||n<=t)return null;let r=new Map,i=0;for(let a of e){let e=a.cost?.usd;if(!Z(e))continue;let o=Z(a.endedAt)?a.endedAt:null;o!=null&&a.since>=t&&o<=n?r.set(a.peer,(r.get(a.peer)??0)+e):a.since<n&&(o==null||o>t)&&i++}if(!r.size)return null;let a=[...r].map(([e,t])=>({peer:e,usd:t}));return{usd:a.reduce((e,t)=>e+t.usd,0),byPeer:a,straddling:i,text:`incl. ${a.map(e=>`${b(e.usd)} on ${e.peer}`).join(` + `)}`}}function ag(e){if(!e||typeof e.from!=`string`||!e.from)return``;let t=e=>typeof e==`string`?e.replace(/\s+/g,` `).trim().slice(0,80):``;return[`job from ${e.from}`,t(e.askerLabel),t(e.label)].filter(Boolean).join(` · `)}var og={dark:{background:`#0b0d10`,foreground:`#d6dce5`},light:{background:`#fcfcfd`,foreground:`#1c2430`}},sg=`--bg.--panel.--sub.--raise.--well.--line.--pipe-bg.--fg.--muted.--dim.--ring.--accent.--ok.--dead.--warn.--star.--limit.--ask.--pair.--purple.--sched.--defer.--ctx-low.--fu-hand.--fu-launch.--fu-agent.--on-accent.--on-accent-strong.--on-accent-line.--on-dead.--on-ok.--on-limit.--on-star.--on-media.--accent-wash.--accent-tint.--accent-tint-hi.--accent-edge.--accent-edge-hi.--ok-wash.--ok-edge.--pick-fill.--pick-edge.--dead-wash.--dead-tint.--dead-edge.--dead-edge-hi.--warn-wash.--warn-tint.--warn-tint-hi.--warn-edge.--star-wash.--star-edge.--star-edge-hi.--limit-edge.--ask-wash.--ask-tint-hi.--ask-edge.--ctx-low-edge.--hover-soft.--hover.--hover-hi.--sheen.--panel-veil.--panel-veil-hi.--bg-veil.--float-edge.--scrim.--scrim-media.--scrim-label.--shadow.--shadow-soft.--media-bg.--paper.--chart-1.--chart-2.--chart-3.--chart-4.--ctx-series.--ctx-compact.--ctx-limit.--repo-veil.--repo-veil-on`.split(`.`),cg=[`--accent`,`--ok`,`--dead`,`--warn`,`--star`,`--limit`,`--ask`,`--pair`,`--fu-agent`],lg=new Set(sg),ug=new Set(cg),dg=[`dark`,`light`],fg=[`favicon`,`apple-touch`,`192`,`512`,`maskable`],pg=new Set(fg),mg=/^(?:[A-Za-z0-9_][A-Za-z0-9._-]*\/)*[A-Za-z0-9_][A-Za-z0-9._-]*\.(?:png|svg)$/,hg=e=>typeof e==`string`&&e.length<=200&&mg.test(e)&&!e.split(`/`).some(e=>e===`.`||e===`..`),gg=(e,t,n)=>Math.min(n,Math.max(t,e));function _g(e,t,n){t=gg(t,0,100)/100,n=gg(n,0,100)/100,e=(e%360+360)%360;let r=t*Math.min(n,1-n),i=t=>(t+e/30)%12,a=e=>n-r*Math.max(-1,Math.min(i(e)-3,Math.min(9-i(e),1)));return[a(0),a(8),a(4)].map(e=>Math.round(e*255))}var vg=String.raw`[+-]?(?:\d+\.?\d*|\.\d+)`,yg=new RegExp(String.raw`^(rgba?|hsla?)\(\s*(${vg})(%?)(?:\s*,\s*|\s+)(${vg})(%?)(?:\s*,\s*|\s+)(${vg})(%?)(?:\s*(?:,|\/)\s*(${vg})(%?))?\s*\)$`,`i`);function Q(e){if(typeof e!=`string`)return null;let t=e.trim(),n=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(t);if(n){let e=n[1];e.length<=4&&(e=[...e].map(e=>e+e).join(``));let t=t=>parseInt(e.slice(t,t+2),16);return{r:t(0),g:t(2),b:t(4),a:e.length===8?Math.round(t(6)/255*1e3)/1e3:1}}if(n=yg.exec(t),!n)return null;let r=n[1].toLowerCase(),i=n[8]===void 0?1:gg(Number(n[8])/(n[9]?100:1),0,1);if(r.startsWith(`rgb`)){let e=(e,t)=>Math.round(gg(t?Number(e)*255/100:Number(e),0,255));return{r:e(n[2],n[3]),g:e(n[4],n[5]),b:e(n[6],n[7]),a:i}}if(n[3]||!n[5]||!n[7])return null;let[a,o,s]=_g(Number(n[2]),Number(n[4]),Number(n[6]));return{r:a,g:o,b:s,a:i}}var bg=e=>e.toString(16).padStart(2,`0`),xg=e=>`#${bg(e.r)}${bg(e.g)}${bg(e.b)}`,Sg=e=>e.a>=1?xg(e):`rgb(${e.r} ${e.g} ${e.b} / ${Math.round(e.a*1e3)/1e3})`,$=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function Cg(e){let t=[],n={};if(!$(e))return e!=null&&t.push(`top level must be an object; nothing applied`),{overlay:n,notes:t};for(let n of Object.keys(e))n!==`displayName`&&n!==`colors`&&n!==`terminal`&&n!==`icons`&&!n.startsWith(`//`)&&t.push(`unknown key "${n}" ignored (allowed: displayName, colors, terminal, icons)`);if(e.displayName!==void 0){let r=typeof e.displayName==`string`?e.displayName.trim():``;!r||r.length>40||/[\u0000-\u001f\u007f]/.test(r)?t.push(`"displayName" must be 1–40 printable characters; ignored`):n.displayName=r}if(e.colors!==void 0){if(!$(e.colors))t.push(`"colors" must be an object of { dark, light }; ignored`);else for(let r of Object.keys(e.colors)){if(!dg.includes(r)){t.push(`"colors.${r}" ignored (allowed: dark, light)`);continue}let i=e.colors[r];if(!$(i)){t.push(`"colors.${r}" must be an object of token → colour; ignored`);continue}let a={};for(let[e,n]of Object.entries(i)){let i=e.startsWith(`--`)?e:`--${e}`;if(i===`--term-bg`){t.push(`"colors.${r}.${e}" ignored: set "terminal.${r}.background" instead (the grid and its frame are one colour)`);continue}if(!lg.has(i)){t.push(`"colors.${r}.${e}" ignored: not a colour token of this version`);continue}let o=Q(n);o?ug.has(i)&&o.a<1?t.push(`"colors.${r}.${e}" ignored: must be opaque (its tints are derived from it)`):a[i]=Sg(o):t.push(`"colors.${r}.${e}" ignored: ${JSON.stringify(n)} is not a colour (hex, rgb(), hsl())`)}Object.keys(a).length&&((n.colors??={})[r]=a)}}if(e.terminal!==void 0){if(!$(e.terminal))t.push(`"terminal" must be an object of { dark, light }; ignored`);else for(let r of Object.keys(e.terminal)){if(!dg.includes(r)){t.push(`"terminal.${r}" ignored (allowed: dark, light)`);continue}let i=e.terminal[r];if(!$(i)){t.push(`"terminal.${r}" must be an object of { background, foreground }; ignored`);continue}let a={};for(let[e,n]of Object.entries(i)){if(e!==`background`&&e!==`foreground`){t.push(`"terminal.${r}.${e}" ignored (allowed: background, foreground)`);continue}let i=Q(n);!i||i.a<1?t.push(`"terminal.${r}.${e}" ignored: ${JSON.stringify(n)} is not an opaque colour`):a[e]=xg(i)}Object.keys(a).length&&((n.terminal??={})[r]=a)}}if(e.icons!==void 0){if(!$(e.icons))t.push(`"icons" must be an object of slot → path; ignored`);else{let r={};for(let[n,i]of Object.entries(e.icons))pg.has(n)?hg(i)?r[n]=i:t.push(`"icons.${n}" ignored: ${JSON.stringify(i)} is not a .png/.svg path relative to the config dir`):t.push(`"icons.${n}" ignored (allowed: ${fg.join(`, `)})`);Object.keys(r).length&&(n.icons=r)}}return{overlay:n,notes:t}}var wg=e=>!e||e.displayName===void 0&&!e.colors&&!e.terminal&&!e.icons;function Tg(e,t){let n=t?.terminal?.[e];return!n||!n.background&&!n.foreground?og[e]:{...og[e],...n}}function Eg(e){if(!e)return``;let t=[];for(let n of dg){let r=[];for(let[t,i]of Object.entries(e.colors?.[n]??{})){if(!lg.has(t))continue;let e=Q(i);e&&(ug.has(t)?r.push(`${t}-rgb: ${e.r} ${e.g} ${e.b};`):r.push(`${t}: ${Sg(e)};`))}let i=e.terminal?.[n]?.background;if(i&&Q(i)&&r.push(`--term-bg: ${xg(Q(i))};`),!r.length)continue;let a=n===`light`?`html[data-theme="light"]`:`html:not([data-theme="light"])`;t.push(`${a} { ${r.join(` `)} }`)}return t.join(`
47
+ `)}function Dg(e,t){let n=Q(t?.colors?.[e]?.[`--bg`]);return n?xg(n):null}function Og(e){return e.pending||e.picked===`named`?!1:e.picked!==`chosen`||!e.rootExists}var kg=36e5;5*kg,336*kg,24*kg,24*kg,6*kg;export{Nm as $,Wa as $a,rt as $c,vs as $i,bu as $n,Ir as $o,Jc as $r,rn as $s,Af as $t,Eh as A,Eo as Aa,It as Ac,ic as Ai,p as Al,Ju as An,ra as Ao,Sl as Ar,Zn as As,jp as At,ph as B,L as Ba,dt as Bc,Zs as Bi,xu as Bn,Di as Bo,sl as Br,Pn as Bs,Of as Bt,Vh as C,Uo as Ca,Mt as Cc,jc as Ci,ie as Cl,bd as Cn,Hi as Co,Fl as Cr,er as Cs,Lp as Ct,Fh as D,zo as Da,Nt as Dc,pc as Di,ee as Dl,od as Dn,Zi as Do,Pl as Dr,qn as Ds,Mp as Dt,zh as E,Ro as Ea,jt as Ec,_c as Ei,ne as El,cd as En,Xi as Eo,Nl as Er,tr as Es,Pp as Et,Sh as F,Ao as Fa,gt as Fc,ec as Fi,t as Fl,Gu as Fn,Vi as Fo,Dl as Fr,Ln as Fs,up as Ft,Um as G,io as Ga,ft as Gc,Vs as Gi,zu as Gn,wi as Go,dl as Gr,A as Gs,Kf as Gt,ch as H,ao as Ha,lt as Hc,Bs as Hi,Pu as Hn,mi as Ho,H as Hr,k as Hs,rp as Ht,xh as I,yo as Ia,xt as Ic,Qs as Ii,n as Il,Vu as In,zi as Io,Tl as Ir,Rn as Is,dp as It,Pm as J,Za as Ja,at as Jc,Ps as Ji,wu as Jn,Ei as Jo,ul as Jr,Sn as Js,tp as Jt,Lm as K,eo as Ka,x as Kc,Ws as Ki,Nu as Kn,Ci as Ko,ml as Kr,Dn as Ks,ap as Kt,_h as L,uo as La,_t as Lc,$s as Li,i as Ll,Iu as Ln,_i as Lo,gl as Lr,zn as Ls,fp as Lt,Dh as M,Mo as Ma,Ot as Mc,cc as Mi,c as Ml,U as Mn,na as Mo,Ol as Mr,jn as Ms,Tp as Mt,Ch as N,No as Na,Pt as Nc,sc as Ni,e as Nl,rd as Nn,ia as No,wl as Nr,M as Ns,Cp as Nt,Lh as O,Lo as Oa,Et as Oc,uc as Oi,h as Ol,ad as On,Yi as Oo,Al as Or,Jn as Os,Np as Ot,wh as P,Oo as Pa,Tt as Pc,nc as Pi,r as Pl,Uu as Pn,Bi as Po,El as Pr,Bn as Ps,xp as Pt,zm as Q,qa as Qa,it as Qc,ks as Qi,yu as Qn,Lr as Qo,tl as Qr,mn as Qs,Lf as Qt,hh as R,fo as Ra,vt as Rc,tc as Ri,Lu as Rn,vi as Ro,_l as Rr,In as Rs,lp as Rt,Wh as S,Wo as Sa,Lt as Sc,Dc as Si,se as Sl,Nd as Sn,oa as So,Il as Sr,dr as Ss,Vp as St,Ah as T,Bo as Ta,Ft as Tc,gc as Ti,te as Tl,ud as Tn,ea as To,Ml as Tr,$n as Ts,kp as Tt,uh as U,so as Ua,ct as Uc,zs as Ui,ju as Un,ki as Uo,fl as Ur,Cn as Us,sp as Ut,ah as V,oo as Va,ut as Vc,Is as Vi,Mu as Vn,Mi as Vo,cl as Vr,O as Vs,Rf as Vt,Jm as W,co as Wa,nt as Wc,Gs as Wi,Bu as Wn,hi as Wo,pl as Wr,wn as Ws,ip as Wt,Bm as X,Ja as Xa,tt as Xc,os as Xi,Du as Xn,si as Xo,il as Xr,en as Xs,qf as Xt,Rm as Y,$a as Ya,ot as Yc,Fs as Yi,ku as Yn,bi as Yo,nl as Yr,dn as Ys,ep as Yt,Vm as Z,Xa as Za,et as Zc,cs as Zi,Au as Zn,Rr as Zo,rl as Zr,Qt as Zs,Jf as Zt,qh as _,Qo as _a,Vt as _c,Ec as _i,ke as _l,qd as _n,pa as _o,Wl as _r,mr as _s,em as _t,Eg as a,ms as aa,un as ac,Pc as ai,b as al,uf as an,Aa as ao,uu as ar,Sr as as,lm as at,Hh as b,Xo as ba,Gt as bc,Tc as bi,Se as bl,Ad as bn,fa as bo,Kl as br,or as bs,Zp as bt,Gh as c,Os as ca,C as cc,Lc as ci,Je as cl,hf as cn,ba as co,tu as cr,wr as cs,bm as ct,$h as d,js as da,qt as dc,Mc as di,v as dl,ef as dn,ma as do,au as dr,vr as ds,dm as dt,Cs as ea,pn as ec,Kc as ei,Ue as el,Ef as en,Ua as eo,hu as er,Nr as es,Om as et,Zh as f,Ss as fa,Jt as fc,Nc as fi,Ve as fl,rf as fn,ha as fo,$l as fr,br as fs,um as ft,rg as g,$o as ga,Yt as gc,Ac as gi,Oe as gl,Ld as gn,va as go,Yl as gr,fr as gs,sm as gt,tg as h,rs as ha,Kt as hc,Sc as hi,Pe as hl,Pd as hn,xa as ho,Xl as hr,gr as hs,om as ht,Tg as i,fs as ia,nn as ic,Vc as ii,Ze as il,pf as in,Va as io,lu as ir,Mr as is,fm as it,Oh as j,jo as ja,At as jc,rc as ji,s as jl,nd as jn,aa as jo,Cl as jr,Hn as js,Ep as jt,Ih as k,Po as ka,kt as kc,mc as ki,m as kl,W as kn,ta as ko,kl as kr,Xn as ks,Op as kt,Xh as l,xs as la,Bt as lc,Rc as li,Ke as ll,$d as ln,ya as lo,nu as lr,Ar as ls,wm as lt,ag as m,ns as ma,Xt as mc,vc as mi,De as ml,of as mn,Sa as mo,Gl as mr,hr as ms,cm as mt,Cg as n,ds as na,fn as nc,Bc as ni,y as nl,yf as nn,Ga as no,_u as nr,Pr as ns,km as nt,wg as o,gs as oa,tn as oc,Ic as oi,Xe as ol,df as on,wa as oo,su as or,Cr as os,Tm as ot,ng as p,z as pa,T as pc,bc as pi,Ee as pl,tf as pn,Ta as po,Ql as pr,_r as ps,hm as pt,Im as q,to as qa,st as qc,Ms as qi,Fu as qn,gi as qo,hl as qr,En as qs,$f as qt,Dg as r,ws as ra,cn as rc,Hc as ri,Ye as rl,mf as rn,Ra as ro,cu as rr,jr as rs,gm as rt,og as s,Es as sa,Rt as sc,Fc as si,Qe as sl,ff as sn,Ca as so,ru as sr,N as ss,Sm as st,Og as t,hs as ta,sn as tc,Zc as ti,He as tl,Sf as tn,Ha as to,vu as tr,Fr as ts,Dm as tt,Kh as u,Ts as ua,Wt as uc,zc as ui,qe as ul,Qd as un,ga as uo,iu as ur,xr as us,xm as ut,ig as v,Ko as va,zt as vc,V as vi,Ce as vl,Zd as vn,_a as vo,Zl as vr,pr as vs,tm as vt,Bh as w,Vo as wa,Dt as wc,hc as wi,re as wl,xd as wn,Wi as wo,jl as wr,Qn as ws,Bp as wt,Uh as x,Go as xa,S as xc,Oc as xi,Te as xl,Md as xn,ua as xo,ql as xr,ur as xs,Hp as xt,Qh as y,Jo as ya,w as yc,kc as yi,we as yl,zd as yn,da as yo,Jl as yr,sr as ys,$p as yt,mh as z,To as za,Ct as zc,Xs as zi,Ru as zn,Ti as zo,al as zr,Nn as zs,cp as zt};