waterplane 0.1.6 → 0.1.14

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 (656) hide show
  1. package/CHANGELOG.md +146 -1
  2. package/README.md +47 -24
  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 +60 -5
  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 +215 -0
  10. package/node_modules/@waterplane/shared/dist/alwaysonwords.js.map +1 -0
  11. package/node_modules/@waterplane/shared/dist/assess/sasswords.js +4 -0
  12. package/node_modules/@waterplane/shared/dist/assess/sasswords.js.map +1 -1
  13. package/node_modules/@waterplane/shared/dist/autocompact.js +3 -2
  14. package/node_modules/@waterplane/shared/dist/autocompact.js.map +1 -1
  15. package/node_modules/@waterplane/shared/dist/backendsources.d.ts +11 -1
  16. package/node_modules/@waterplane/shared/dist/backendsources.js.map +1 -1
  17. package/node_modules/@waterplane/shared/dist/branchmode.d.ts +33 -0
  18. package/node_modules/@waterplane/shared/dist/branchmode.js +88 -0
  19. package/node_modules/@waterplane/shared/dist/branchmode.js.map +1 -0
  20. package/node_modules/@waterplane/shared/dist/budget.d.ts +7 -1
  21. package/node_modules/@waterplane/shared/dist/budget.js +11 -3
  22. package/node_modules/@waterplane/shared/dist/budget.js.map +1 -1
  23. package/node_modules/@waterplane/shared/dist/buildstamp.d.ts +37 -0
  24. package/node_modules/@waterplane/shared/dist/buildstamp.js +95 -0
  25. package/node_modules/@waterplane/shared/dist/buildstamp.js.map +1 -0
  26. package/node_modules/@waterplane/shared/dist/burn.d.ts +16 -1
  27. package/node_modules/@waterplane/shared/dist/burn.js +30 -0
  28. package/node_modules/@waterplane/shared/dist/burn.js.map +1 -1
  29. package/node_modules/@waterplane/shared/dist/calday.d.ts +4 -0
  30. package/node_modules/@waterplane/shared/dist/calday.js +25 -0
  31. package/node_modules/@waterplane/shared/dist/calday.js.map +1 -0
  32. package/node_modules/@waterplane/shared/dist/changebrief.d.ts +77 -0
  33. package/node_modules/@waterplane/shared/dist/changebrief.js +70 -0
  34. package/node_modules/@waterplane/shared/dist/changebrief.js.map +1 -0
  35. package/node_modules/@waterplane/shared/dist/clihealth/healthrecord.js +1 -0
  36. package/node_modules/@waterplane/shared/dist/clihealth/healthrecord.js.map +1 -1
  37. package/node_modules/@waterplane/shared/dist/costwindow.d.ts +24 -5
  38. package/node_modules/@waterplane/shared/dist/costwindow.js +35 -15
  39. package/node_modules/@waterplane/shared/dist/costwindow.js.map +1 -1
  40. package/node_modules/@waterplane/shared/dist/desktopfiles.d.ts +100 -0
  41. package/node_modules/@waterplane/shared/dist/desktopfiles.js +192 -0
  42. package/node_modules/@waterplane/shared/dist/desktopfiles.js.map +1 -0
  43. package/node_modules/@waterplane/shared/dist/exposure.d.ts +175 -0
  44. package/node_modules/@waterplane/shared/dist/exposure.js +357 -0
  45. package/node_modules/@waterplane/shared/dist/exposure.js.map +1 -0
  46. package/node_modules/@waterplane/shared/dist/exposurepush.d.ts +60 -0
  47. package/node_modules/@waterplane/shared/dist/exposurepush.js +103 -0
  48. package/node_modules/@waterplane/shared/dist/exposurepush.js.map +1 -0
  49. package/node_modules/@waterplane/shared/dist/healthindex/commits.d.ts +26 -0
  50. package/node_modules/@waterplane/shared/dist/healthindex/commits.js +57 -0
  51. package/node_modules/@waterplane/shared/dist/healthindex/commits.js.map +1 -0
  52. package/node_modules/@waterplane/shared/dist/healthindex/move.d.ts +25 -0
  53. package/node_modules/@waterplane/shared/dist/healthindex/move.js +79 -0
  54. package/node_modules/@waterplane/shared/dist/healthindex/move.js.map +1 -0
  55. package/node_modules/@waterplane/shared/dist/healthindex/readings.d.ts +53 -0
  56. package/node_modules/@waterplane/shared/dist/healthindex/readings.js +154 -0
  57. package/node_modules/@waterplane/shared/dist/healthindex/readings.js.map +1 -0
  58. package/node_modules/@waterplane/shared/dist/healthindex/repoindex.d.ts +41 -0
  59. package/node_modules/@waterplane/shared/dist/healthindex/repoindex.js +19 -0
  60. package/node_modules/@waterplane/shared/dist/healthindex/repoindex.js.map +1 -0
  61. package/node_modules/@waterplane/shared/dist/healthindex/score.d.ts +26 -0
  62. package/node_modules/@waterplane/shared/dist/healthindex/score.js +156 -0
  63. package/node_modules/@waterplane/shared/dist/healthindex/score.js.map +1 -0
  64. package/node_modules/@waterplane/shared/dist/healthindex/types.d.ts +206 -0
  65. package/node_modules/@waterplane/shared/dist/healthindex/types.js +58 -0
  66. package/node_modules/@waterplane/shared/dist/healthindex/types.js.map +1 -0
  67. package/node_modules/@waterplane/shared/dist/healthindex/vs.d.ts +26 -0
  68. package/node_modules/@waterplane/shared/dist/healthindex/vs.js +38 -0
  69. package/node_modules/@waterplane/shared/dist/healthindex/vs.js.map +1 -0
  70. package/node_modules/@waterplane/shared/dist/healthindex/words.d.ts +28 -0
  71. package/node_modules/@waterplane/shared/dist/healthindex/words.js +124 -0
  72. package/node_modules/@waterplane/shared/dist/healthindex/words.js.map +1 -0
  73. package/node_modules/@waterplane/shared/dist/healthindex.d.ts +15 -411
  74. package/node_modules/@waterplane/shared/dist/healthindex.js +8 -602
  75. package/node_modules/@waterplane/shared/dist/healthindex.js.map +1 -1
  76. package/node_modules/@waterplane/shared/dist/hints.js +15 -0
  77. package/node_modules/@waterplane/shared/dist/hints.js.map +1 -1
  78. package/node_modules/@waterplane/shared/dist/index.d.ts +37 -0
  79. package/node_modules/@waterplane/shared/dist/index.js +37 -0
  80. package/node_modules/@waterplane/shared/dist/index.js.map +1 -1
  81. package/node_modules/@waterplane/shared/dist/intent/clean.d.ts +87 -0
  82. package/node_modules/@waterplane/shared/dist/intent/clean.js +51 -3
  83. package/node_modules/@waterplane/shared/dist/intent/clean.js.map +1 -1
  84. package/node_modules/@waterplane/shared/dist/intent/kind.d.ts +40 -1
  85. package/node_modules/@waterplane/shared/dist/intent/kind.js +36 -3
  86. package/node_modules/@waterplane/shared/dist/intent/kind.js.map +1 -1
  87. package/node_modules/@waterplane/shared/dist/intent/types.d.ts +13 -0
  88. package/node_modules/@waterplane/shared/dist/intent/types.js.map +1 -1
  89. package/node_modules/@waterplane/shared/dist/intent/verdict.js +9 -16
  90. package/node_modules/@waterplane/shared/dist/intent/verdict.js.map +1 -1
  91. package/node_modules/@waterplane/shared/dist/intent/words.js +5 -0
  92. package/node_modules/@waterplane/shared/dist/intent/words.js.map +1 -1
  93. package/node_modules/@waterplane/shared/dist/intent.d.ts +2 -2
  94. package/node_modules/@waterplane/shared/dist/intent.js +2 -2
  95. package/node_modules/@waterplane/shared/dist/intent.js.map +1 -1
  96. package/node_modules/@waterplane/shared/dist/launchmodes.d.ts +2 -0
  97. package/node_modules/@waterplane/shared/dist/launchmodes.js +12 -0
  98. package/node_modules/@waterplane/shared/dist/launchmodes.js.map +1 -1
  99. package/node_modules/@waterplane/shared/dist/ledgerspan.d.ts +106 -0
  100. package/node_modules/@waterplane/shared/dist/ledgerspan.js +196 -0
  101. package/node_modules/@waterplane/shared/dist/ledgerspan.js.map +1 -0
  102. package/node_modules/@waterplane/shared/dist/naming.d.ts +3 -1
  103. package/node_modules/@waterplane/shared/dist/naming.js +6 -2
  104. package/node_modules/@waterplane/shared/dist/naming.js.map +1 -1
  105. package/node_modules/@waterplane/shared/dist/netfuse.d.ts +5 -0
  106. package/node_modules/@waterplane/shared/dist/netfuse.js +6 -1
  107. package/node_modules/@waterplane/shared/dist/netfuse.js.map +1 -1
  108. package/node_modules/@waterplane/shared/dist/netretry.d.ts +78 -0
  109. package/node_modules/@waterplane/shared/dist/netretry.js +85 -0
  110. package/node_modules/@waterplane/shared/dist/netretry.js.map +1 -0
  111. package/node_modules/@waterplane/shared/dist/netretrycfg.d.ts +12 -0
  112. package/node_modules/@waterplane/shared/dist/netretrycfg.js +27 -0
  113. package/node_modules/@waterplane/shared/dist/netretrycfg.js.map +1 -0
  114. package/node_modules/@waterplane/shared/dist/nodemin.d.ts +6 -4
  115. package/node_modules/@waterplane/shared/dist/nodemin.js +6 -4
  116. package/node_modules/@waterplane/shared/dist/nodemin.js.map +1 -1
  117. package/node_modules/@waterplane/shared/dist/optins.d.ts +35 -1
  118. package/node_modules/@waterplane/shared/dist/optins.js +39 -1
  119. package/node_modules/@waterplane/shared/dist/optins.js.map +1 -1
  120. package/node_modules/@waterplane/shared/dist/pairing.js +4 -0
  121. package/node_modules/@waterplane/shared/dist/pairing.js.map +1 -1
  122. package/node_modules/@waterplane/shared/dist/passive.js +3 -0
  123. package/node_modules/@waterplane/shared/dist/passive.js.map +1 -1
  124. package/node_modules/@waterplane/shared/dist/plugin/api.d.ts +394 -0
  125. package/node_modules/@waterplane/shared/dist/plugin/api.js +2 -0
  126. package/node_modules/@waterplane/shared/dist/plugin/api.js.map +1 -0
  127. package/node_modules/@waterplane/shared/dist/plugin/backend.d.ts +197 -0
  128. package/node_modules/@waterplane/shared/dist/plugin/backend.js +9 -0
  129. package/node_modules/@waterplane/shared/dist/plugin/backend.js.map +1 -0
  130. package/node_modules/@waterplane/shared/dist/plugin/manifest.d.ts +160 -0
  131. package/node_modules/@waterplane/shared/dist/plugin/manifest.js +98 -0
  132. package/node_modules/@waterplane/shared/dist/plugin/manifest.js.map +1 -0
  133. package/node_modules/@waterplane/shared/dist/plugin/module.d.ts +98 -0
  134. package/node_modules/@waterplane/shared/dist/plugin/module.js +13 -0
  135. package/node_modules/@waterplane/shared/dist/plugin/module.js.map +1 -0
  136. package/node_modules/@waterplane/shared/dist/plugin/version.d.ts +66 -0
  137. package/node_modules/@waterplane/shared/dist/plugin/version.js +86 -0
  138. package/node_modules/@waterplane/shared/dist/plugin/version.js.map +1 -0
  139. package/node_modules/@waterplane/shared/dist/plugin.d.ts +5 -867
  140. package/node_modules/@waterplane/shared/dist/plugin.js +27 -186
  141. package/node_modules/@waterplane/shared/dist/plugin.js.map +1 -1
  142. package/node_modules/@waterplane/shared/dist/pluginlaunch.d.ts +7 -0
  143. package/node_modules/@waterplane/shared/dist/prview.d.ts +23 -0
  144. package/node_modules/@waterplane/shared/dist/prview.js +107 -0
  145. package/node_modules/@waterplane/shared/dist/prview.js.map +1 -0
  146. package/node_modules/@waterplane/shared/dist/queue/queueserial.d.ts +11 -2
  147. package/node_modules/@waterplane/shared/dist/queue/queueserial.js +13 -4
  148. package/node_modules/@waterplane/shared/dist/queue/queueserial.js.map +1 -1
  149. package/node_modules/@waterplane/shared/dist/queue/queuewords.js +1 -0
  150. package/node_modules/@waterplane/shared/dist/queue/queuewords.js.map +1 -1
  151. package/node_modules/@waterplane/shared/dist/repohealth.d.ts +4 -0
  152. package/node_modules/@waterplane/shared/dist/repohealth.js.map +1 -1
  153. package/node_modules/@waterplane/shared/dist/repotwins.d.ts +31 -0
  154. package/node_modules/@waterplane/shared/dist/repotwins.js +52 -0
  155. package/node_modules/@waterplane/shared/dist/repotwins.js.map +1 -0
  156. package/node_modules/@waterplane/shared/dist/requirements.js +4 -1
  157. package/node_modules/@waterplane/shared/dist/requirements.js.map +1 -1
  158. package/node_modules/@waterplane/shared/dist/schedule/schedaction.d.ts +29 -0
  159. package/node_modules/@waterplane/shared/dist/schedule/schedaction.js +22 -0
  160. package/node_modules/@waterplane/shared/dist/schedule/schedaction.js.map +1 -1
  161. package/node_modules/@waterplane/shared/dist/schedule/schedclean.js +26 -0
  162. package/node_modules/@waterplane/shared/dist/schedule/schedclean.js.map +1 -1
  163. package/node_modules/@waterplane/shared/dist/schedule/schedhorizon.d.ts +1 -0
  164. package/node_modules/@waterplane/shared/dist/schedule/schedhorizon.js +1 -0
  165. package/node_modules/@waterplane/shared/dist/schedule/schedhorizon.js.map +1 -1
  166. package/node_modules/@waterplane/shared/dist/schedule.d.ts +1 -1
  167. package/node_modules/@waterplane/shared/dist/schedule.js +1 -1
  168. package/node_modules/@waterplane/shared/dist/schedule.js.map +1 -1
  169. package/node_modules/@waterplane/shared/dist/sessionbudget.d.ts +34 -7
  170. package/node_modules/@waterplane/shared/dist/sessionbudget.js +59 -21
  171. package/node_modules/@waterplane/shared/dist/sessionbudget.js.map +1 -1
  172. package/node_modules/@waterplane/shared/dist/sweep.d.ts +2 -1
  173. package/node_modules/@waterplane/shared/dist/sweep.js +2 -1
  174. package/node_modules/@waterplane/shared/dist/sweep.js.map +1 -1
  175. package/node_modules/@waterplane/shared/dist/tokens.d.ts +4 -3
  176. package/node_modules/@waterplane/shared/dist/tokens.js +9 -7
  177. package/node_modules/@waterplane/shared/dist/tokens.js.map +1 -1
  178. package/node_modules/@waterplane/shared/dist/weekburn.d.ts +144 -0
  179. package/node_modules/@waterplane/shared/dist/weekburn.js +250 -0
  180. package/node_modules/@waterplane/shared/dist/weekburn.js.map +1 -0
  181. package/node_modules/@waterplane/shared/dist/wire/alwayson.d.ts +64 -0
  182. package/node_modules/@waterplane/shared/dist/wire/alwayson.js +7 -0
  183. package/node_modules/@waterplane/shared/dist/wire/alwayson.js.map +1 -0
  184. package/node_modules/@waterplane/shared/dist/wire/backend.d.ts +4 -0
  185. package/node_modules/@waterplane/shared/dist/wire/backendtokens.d.ts +6 -0
  186. package/node_modules/@waterplane/shared/dist/wire/backendtokens.js +0 -9
  187. package/node_modules/@waterplane/shared/dist/wire/backendtokens.js.map +1 -1
  188. package/node_modules/@waterplane/shared/dist/wire/costwindow.d.ts +25 -0
  189. package/node_modules/@waterplane/shared/dist/wire/messages/clienthost.d.ts +15 -1
  190. package/node_modules/@waterplane/shared/dist/wire/messages/clientsession.d.ts +24 -0
  191. package/node_modules/@waterplane/shared/dist/wire/messages/hosttools.d.ts +12 -2
  192. package/node_modules/@waterplane/shared/dist/wire/notify.d.ts +194 -1
  193. package/node_modules/@waterplane/shared/dist/wire/notify.js +139 -1
  194. package/node_modules/@waterplane/shared/dist/wire/notify.js.map +1 -1
  195. package/node_modules/@waterplane/shared/dist/wire/pullrequest.d.ts +42 -0
  196. package/node_modules/@waterplane/shared/dist/wire/pullrequest.js +2 -0
  197. package/node_modules/@waterplane/shared/dist/wire/pullrequest.js.map +1 -0
  198. package/node_modules/@waterplane/shared/dist/wire/repo.d.ts +131 -0
  199. package/node_modules/@waterplane/shared/dist/wire/repo.js +8 -3
  200. package/node_modules/@waterplane/shared/dist/wire/repo.js.map +1 -1
  201. package/node_modules/@waterplane/shared/dist/wire/sent.d.ts +3 -1
  202. package/node_modules/@waterplane/shared/dist/wire/session/contextspark.d.ts +7 -0
  203. package/node_modules/@waterplane/shared/dist/wire/session/info.d.ts +4 -1
  204. package/node_modules/@waterplane/shared/dist/wire/session/launch.d.ts +36 -0
  205. package/node_modules/@waterplane/shared/dist/wire/session.d.ts +1 -1
  206. package/node_modules/@waterplane/shared/dist/wire/telemetry.d.ts +30 -0
  207. package/node_modules/@waterplane/shared/dist/wire/work.d.ts +13 -0
  208. package/node_modules/@waterplane/shared/dist/wire/work.js.map +1 -1
  209. package/node_modules/@waterplane/shared/dist/wordof.d.ts +11 -0
  210. package/node_modules/@waterplane/shared/dist/wordof.js +14 -0
  211. package/node_modules/@waterplane/shared/dist/wordof.js.map +1 -0
  212. package/npm-shrinkwrap.json +3 -3
  213. package/package.json +2 -2
  214. package/packages/extensions/scorecard/waterplane-plugin.json +10 -0
  215. package/packages/host/dist/agentexposure.d.ts +13 -0
  216. package/packages/host/dist/agentexposure.js +90 -0
  217. package/packages/host/dist/agentexposure.js.map +1 -0
  218. package/packages/host/dist/agentintents.js +7 -8
  219. package/packages/host/dist/agentintents.js.map +1 -1
  220. package/packages/host/dist/agentwatch.d.ts +3 -7
  221. package/packages/host/dist/agentwatch.js.map +1 -1
  222. package/packages/host/dist/alwayson.d.ts +18 -0
  223. package/packages/host/dist/alwayson.js +159 -0
  224. package/packages/host/dist/alwayson.js.map +1 -0
  225. package/packages/host/dist/answergate.d.ts +3 -7
  226. package/packages/host/dist/answergate.js.map +1 -1
  227. package/packages/host/dist/attentionstore.d.ts +94 -0
  228. package/packages/host/dist/attentionstore.js +232 -0
  229. package/packages/host/dist/attentionstore.js.map +1 -0
  230. package/packages/host/dist/backends/claude-sources.d.ts +2 -0
  231. package/packages/host/dist/backends/claude-sources.js +12 -0
  232. package/packages/host/dist/backends/claude-sources.js.map +1 -1
  233. package/packages/host/dist/backends/claude.js +3 -2
  234. package/packages/host/dist/backends/claude.js.map +1 -1
  235. package/packages/host/dist/backends/derive.js +1 -0
  236. package/packages/host/dist/backends/derive.js.map +1 -1
  237. package/packages/host/dist/backends/overhead.d.ts +7 -5
  238. package/packages/host/dist/backends/overhead.js +15 -13
  239. package/packages/host/dist/backends/overhead.js.map +1 -1
  240. package/packages/host/dist/backends/registry.js +4 -1
  241. package/packages/host/dist/backends/registry.js.map +1 -1
  242. package/packages/host/dist/backends/types.d.ts +2 -0
  243. package/packages/host/dist/besidespend.d.ts +22 -0
  244. package/packages/host/dist/besidespend.js +65 -0
  245. package/packages/host/dist/besidespend.js.map +1 -0
  246. package/packages/host/dist/boxkit.d.ts +19 -0
  247. package/packages/host/dist/boxkit.js +38 -0
  248. package/packages/host/dist/boxkit.js.map +1 -0
  249. package/packages/host/dist/branchrules.d.ts +14 -0
  250. package/packages/host/dist/branchrules.js +47 -0
  251. package/packages/host/dist/branchrules.js.map +1 -0
  252. package/packages/host/dist/budget.d.ts +3 -2
  253. package/packages/host/dist/budget.js +5 -3
  254. package/packages/host/dist/budget.js.map +1 -1
  255. package/packages/host/dist/builds.d.ts +31 -1
  256. package/packages/host/dist/builds.js +55 -3
  257. package/packages/host/dist/builds.js.map +1 -1
  258. package/packages/host/dist/buildversions.d.ts +2 -0
  259. package/packages/host/dist/buildversions.js +36 -0
  260. package/packages/host/dist/buildversions.js.map +1 -0
  261. package/packages/host/dist/burnwatch.d.ts +23 -11
  262. package/packages/host/dist/burnwatch.js +57 -3
  263. package/packages/host/dist/burnwatch.js.map +1 -1
  264. package/packages/host/dist/changebrief.d.ts +37 -0
  265. package/packages/host/dist/changebrief.js +157 -0
  266. package/packages/host/dist/changebrief.js.map +1 -0
  267. package/packages/host/dist/cli/index.js +1 -1
  268. package/packages/host/dist/cli/index.js.map +1 -1
  269. package/packages/host/dist/clihealth.d.ts +2 -0
  270. package/packages/host/dist/clihealth.js +11 -2
  271. package/packages/host/dist/clihealth.js.map +1 -1
  272. package/packages/host/dist/compliance.d.ts +5 -1
  273. package/packages/host/dist/compliance.js +70 -31
  274. package/packages/host/dist/compliance.js.map +1 -1
  275. package/packages/host/dist/composer.d.ts +3 -1
  276. package/packages/host/dist/composer.js +3 -1
  277. package/packages/host/dist/composer.js.map +1 -1
  278. package/packages/host/dist/context.js +29 -4
  279. package/packages/host/dist/context.js.map +1 -1
  280. package/packages/host/dist/convlog.d.ts +1 -1
  281. package/packages/host/dist/convlog.js +1 -1
  282. package/packages/host/dist/costwindow.d.ts +25 -0
  283. package/packages/host/dist/costwindow.js +63 -1
  284. package/packages/host/dist/costwindow.js.map +1 -1
  285. package/packages/host/dist/ctxlog/ctxagents.js +16 -25
  286. package/packages/host/dist/ctxlog/ctxagents.js.map +1 -1
  287. package/packages/host/dist/ctxlog/ctxcursor.d.ts +36 -1
  288. package/packages/host/dist/ctxlog/ctxcursor.js +96 -2
  289. package/packages/host/dist/ctxlog/ctxcursor.js.map +1 -1
  290. package/packages/host/dist/ctxlog/ctxproject.js +2 -1
  291. package/packages/host/dist/ctxlog/ctxproject.js.map +1 -1
  292. package/packages/host/dist/ctxlog/ctxupdate.js +30 -24
  293. package/packages/host/dist/ctxlog/ctxupdate.js.map +1 -1
  294. package/packages/host/dist/ctxlog/usagerecord.d.ts +28 -0
  295. package/packages/host/dist/ctxlog/usagerecord.js +81 -0
  296. package/packages/host/dist/ctxlog/usagerecord.js.map +1 -0
  297. package/packages/host/dist/diskwatch.d.ts +4 -6
  298. package/packages/host/dist/diskwatch.js +3 -1
  299. package/packages/host/dist/diskwatch.js.map +1 -1
  300. package/packages/host/dist/eraseen.d.ts +6 -0
  301. package/packages/host/dist/eraseen.js +100 -0
  302. package/packages/host/dist/eraseen.js.map +1 -0
  303. package/packages/host/dist/explainjob.d.ts +24 -0
  304. package/packages/host/dist/explainjob.js +80 -0
  305. package/packages/host/dist/explainjob.js.map +1 -0
  306. package/packages/host/dist/exposure.d.ts +56 -0
  307. package/packages/host/dist/exposure.js +371 -0
  308. package/packages/host/dist/exposure.js.map +1 -0
  309. package/packages/host/dist/exposurepush.d.ts +28 -0
  310. package/packages/host/dist/exposurepush.js +136 -0
  311. package/packages/host/dist/exposurepush.js.map +1 -0
  312. package/packages/host/dist/exposurerun.d.ts +18 -0
  313. package/packages/host/dist/exposurerun.js +126 -0
  314. package/packages/host/dist/exposurerun.js.map +1 -0
  315. package/packages/host/dist/exposurewatch.d.ts +29 -0
  316. package/packages/host/dist/exposurewatch.js +127 -0
  317. package/packages/host/dist/exposurewatch.js.map +1 -0
  318. package/packages/host/dist/extensions/scorecard/host/engine.d.mts +54 -0
  319. package/packages/host/dist/extensions/scorecard/host/engine.mjs +303 -0
  320. package/packages/host/dist/extensions/scorecard/host/engine.mjs.map +1 -0
  321. package/packages/host/dist/extensions/scorecard/host/gitslug.d.mts +5 -0
  322. package/packages/host/dist/extensions/scorecard/host/gitslug.mjs +45 -0
  323. package/packages/host/dist/extensions/scorecard/host/gitslug.mjs.map +1 -0
  324. package/packages/host/dist/extensions/scorecard/host/index.d.mts +15 -0
  325. package/packages/host/dist/extensions/scorecard/host/index.mjs +47 -0
  326. package/packages/host/dist/extensions/scorecard/host/index.mjs.map +1 -0
  327. package/packages/host/dist/extensions/scorecard/host/store.d.mts +12 -0
  328. package/packages/host/dist/extensions/scorecard/host/store.mjs +91 -0
  329. package/packages/host/dist/extensions/scorecard/host/store.mjs.map +1 -0
  330. package/packages/host/dist/extensions/scorecard/shared/logic.d.mts +42 -0
  331. package/packages/host/dist/extensions/scorecard/shared/logic.mjs +170 -0
  332. package/packages/host/dist/extensions/scorecard/shared/logic.mjs.map +1 -0
  333. package/packages/host/dist/extensions/scorecard/shared/wire.d.mts +140 -0
  334. package/packages/host/dist/extensions/scorecard/shared/wire.mjs +29 -0
  335. package/packages/host/dist/extensions/scorecard/shared/wire.mjs.map +1 -0
  336. package/packages/host/dist/files.d.ts +14 -12
  337. package/packages/host/dist/files.js +64 -94
  338. package/packages/host/dist/files.js.map +1 -1
  339. package/packages/host/dist/forge/github.d.ts +3 -0
  340. package/packages/host/dist/forge/github.js +96 -0
  341. package/packages/host/dist/forge/github.js.map +1 -0
  342. package/packages/host/dist/forge/index.d.ts +14 -0
  343. package/packages/host/dist/forge/index.js +32 -0
  344. package/packages/host/dist/forge/index.js.map +1 -0
  345. package/packages/host/dist/forge/types.d.ts +58 -0
  346. package/packages/host/dist/forge/types.js +2 -0
  347. package/packages/host/dist/forge/types.js.map +1 -0
  348. package/packages/host/dist/git.d.ts +41 -16
  349. package/packages/host/dist/git.js +162 -101
  350. package/packages/host/dist/git.js.map +1 -1
  351. package/packages/host/dist/gitnotify.d.ts +54 -0
  352. package/packages/host/dist/gitnotify.js +167 -0
  353. package/packages/host/dist/gitnotify.js.map +1 -0
  354. package/packages/host/dist/healthwatch.d.ts +2 -1
  355. package/packages/host/dist/healthwatch.js +4 -2
  356. package/packages/host/dist/healthwatch.js.map +1 -1
  357. package/packages/host/dist/hoststore.js +2 -2
  358. package/packages/host/dist/hoststore.js.map +1 -1
  359. package/packages/host/dist/intents/adapters.js +68 -19
  360. package/packages/host/dist/intents/adapters.js.map +1 -1
  361. package/packages/host/dist/intents/clock.d.ts +6 -3
  362. package/packages/host/dist/intents/clock.js +19 -5
  363. package/packages/host/dist/intents/clock.js.map +1 -1
  364. package/packages/host/dist/intents/contract.d.ts +15 -5
  365. package/packages/host/dist/intents/contract.js.map +1 -1
  366. package/packages/host/dist/intents/disk.d.ts +16 -0
  367. package/packages/host/dist/intents/disk.js +26 -1
  368. package/packages/host/dist/intents/disk.js.map +1 -1
  369. package/packages/host/dist/intents/fire.js +7 -1
  370. package/packages/host/dist/intents/fire.js.map +1 -1
  371. package/packages/host/dist/intents/ladder.js +3 -1
  372. package/packages/host/dist/intents/ladder.js.map +1 -1
  373. package/packages/host/dist/intents/manager.d.ts +3 -3
  374. package/packages/host/dist/intents/manager.js +2 -2
  375. package/packages/host/dist/intents/manager.js.map +1 -1
  376. package/packages/host/dist/intents/watch.d.ts +27 -3
  377. package/packages/host/dist/intents/watch.js +70 -9
  378. package/packages/host/dist/intents/watch.js.map +1 -1
  379. package/packages/host/dist/intents/write.d.ts +28 -1
  380. package/packages/host/dist/intents/write.js +87 -2
  381. package/packages/host/dist/intents/write.js.map +1 -1
  382. package/packages/host/dist/localcistatus.d.ts +22 -0
  383. package/packages/host/dist/localcistatus.js +105 -0
  384. package/packages/host/dist/localcistatus.js.map +1 -0
  385. package/packages/host/dist/main.js +45 -12
  386. package/packages/host/dist/main.js.map +1 -1
  387. package/packages/host/dist/net.d.ts +2 -0
  388. package/packages/host/dist/net.js +11 -2
  389. package/packages/host/dist/net.js.map +1 -1
  390. package/packages/host/dist/netlog.d.ts +40 -0
  391. package/packages/host/dist/netlog.js +165 -0
  392. package/packages/host/dist/netlog.js.map +1 -0
  393. package/packages/host/dist/netretrycfg.d.ts +7 -0
  394. package/packages/host/dist/netretrycfg.js +51 -0
  395. package/packages/host/dist/netretrycfg.js.map +1 -0
  396. package/packages/host/dist/notifyprefs.d.ts +6 -2
  397. package/packages/host/dist/notifyprefs.js +20 -5
  398. package/packages/host/dist/notifyprefs.js.map +1 -1
  399. package/packages/host/dist/notifytypes.d.ts +63 -0
  400. package/packages/host/dist/notifytypes.js +2 -0
  401. package/packages/host/dist/notifytypes.js.map +1 -0
  402. package/packages/host/dist/opendeliveries.js +24 -0
  403. package/packages/host/dist/opendeliveries.js.map +1 -1
  404. package/packages/host/dist/optins.d.ts +28 -1
  405. package/packages/host/dist/optins.js +96 -4
  406. package/packages/host/dist/optins.js.map +1 -1
  407. package/packages/host/dist/peers/agentpeer.js +1 -1
  408. package/packages/host/dist/peers/agentpeer.js.map +1 -1
  409. package/packages/host/dist/peers/jobs.d.ts +2 -4
  410. package/packages/host/dist/peers/jobs.js +6 -1
  411. package/packages/host/dist/peers/jobs.js.map +1 -1
  412. package/packages/host/dist/periodspend.d.ts +22 -3
  413. package/packages/host/dist/periodspend.js +44 -4
  414. package/packages/host/dist/periodspend.js.map +1 -1
  415. package/packages/host/dist/plugins/pluginapi.js +40 -10
  416. package/packages/host/dist/plugins/pluginapi.js.map +1 -1
  417. package/packages/host/dist/plugins/pluginregistry.d.ts +3 -8
  418. package/packages/host/dist/plugins/pluginregistry.js +1 -1
  419. package/packages/host/dist/plugins/pluginregistry.js.map +1 -1
  420. package/packages/host/dist/plugins/plugintoolkit/sessionof.d.ts +47 -0
  421. package/packages/host/dist/plugins/plugintoolkit/sessionof.js +136 -0
  422. package/packages/host/dist/plugins/plugintoolkit/sessionof.js.map +1 -0
  423. package/packages/host/dist/prmergestore.d.ts +31 -0
  424. package/packages/host/dist/prmergestore.js +106 -0
  425. package/packages/host/dist/prmergestore.js.map +1 -0
  426. package/packages/host/dist/protectmain.d.ts +35 -0
  427. package/packages/host/dist/protectmain.js +73 -0
  428. package/packages/host/dist/protectmain.js.map +1 -0
  429. package/packages/host/dist/prpush.d.ts +38 -0
  430. package/packages/host/dist/prpush.js +351 -0
  431. package/packages/host/dist/prpush.js.map +1 -0
  432. package/packages/host/dist/prs.d.ts +118 -0
  433. package/packages/host/dist/prs.js +681 -0
  434. package/packages/host/dist/prs.js.map +1 -0
  435. package/packages/host/dist/push.d.ts +85 -1
  436. package/packages/host/dist/push.js +238 -8
  437. package/packages/host/dist/push.js.map +1 -1
  438. package/packages/host/dist/pushlanded.d.ts +29 -0
  439. package/packages/host/dist/pushlanded.js +61 -0
  440. package/packages/host/dist/pushlanded.js.map +1 -0
  441. package/packages/host/dist/pushreach.d.ts +9 -0
  442. package/packages/host/dist/pushreach.js +102 -0
  443. package/packages/host/dist/pushreach.js.map +1 -0
  444. package/packages/host/dist/pushverdict.d.ts +42 -0
  445. package/packages/host/dist/pushverdict.js +110 -0
  446. package/packages/host/dist/pushverdict.js.map +1 -0
  447. package/packages/host/dist/render.d.ts +57 -0
  448. package/packages/host/dist/render.js +57 -39
  449. package/packages/host/dist/render.js.map +1 -1
  450. package/packages/host/dist/repohealth.js +5 -2
  451. package/packages/host/dist/repohealth.js.map +1 -1
  452. package/packages/host/dist/repohealthapproval.d.ts +3 -0
  453. package/packages/host/dist/repohealthapproval.js +92 -2
  454. package/packages/host/dist/repohealthapproval.js.map +1 -1
  455. package/packages/host/dist/repos.d.ts +7 -1
  456. package/packages/host/dist/repos.js +30 -3
  457. package/packages/host/dist/repos.js.map +1 -1
  458. package/packages/host/dist/reposkill.d.ts +8 -5
  459. package/packages/host/dist/reposkill.js +16 -11
  460. package/packages/host/dist/reposkill.js.map +1 -1
  461. package/packages/host/dist/reposkilltext.d.ts +8 -1
  462. package/packages/host/dist/reposkilltext.js +85 -12
  463. package/packages/host/dist/reposkilltext.js.map +1 -1
  464. package/packages/host/dist/routes/apigitspend.d.ts +2 -0
  465. package/packages/host/dist/routes/apigitspend.js +40 -0
  466. package/packages/host/dist/routes/apigitspend.js.map +1 -0
  467. package/packages/host/dist/routes/apihost.js +17 -0
  468. package/packages/host/dist/routes/apihost.js.map +1 -1
  469. package/packages/host/dist/routes/apiprs.d.ts +2 -0
  470. package/packages/host/dist/routes/apiprs.js +47 -0
  471. package/packages/host/dist/routes/apiprs.js.map +1 -0
  472. package/packages/host/dist/routes/apirepofiles.js +13 -1
  473. package/packages/host/dist/routes/apirepofiles.js.map +1 -1
  474. package/packages/host/dist/routes/apirepowork.d.ts +6 -0
  475. package/packages/host/dist/routes/apirepowork.js +42 -33
  476. package/packages/host/dist/routes/apirepowork.js.map +1 -1
  477. package/packages/host/dist/routes/apiroutes.js +2 -1
  478. package/packages/host/dist/routes/apiroutes.js.map +1 -1
  479. package/packages/host/dist/routes/apisession.js +24 -0
  480. package/packages/host/dist/routes/apisession.js.map +1 -1
  481. package/packages/host/dist/routes/apistats.js +12 -7
  482. package/packages/host/dist/routes/apistats.js.map +1 -1
  483. package/packages/host/dist/routes/apisystem.js +23 -1
  484. package/packages/host/dist/routes/apisystem.js.map +1 -1
  485. package/packages/host/dist/routes/apitable.d.ts +10 -0
  486. package/packages/host/dist/routes/apitable.js.map +1 -1
  487. package/packages/host/dist/routes/apiweekburn.d.ts +2 -0
  488. package/packages/host/dist/routes/apiweekburn.js +30 -0
  489. package/packages/host/dist/routes/apiweekburn.js.map +1 -0
  490. package/packages/host/dist/routes/session.js +10 -0
  491. package/packages/host/dist/routes/session.js.map +1 -1
  492. package/packages/host/dist/routes/system.js +34 -6
  493. package/packages/host/dist/routes/system.js.map +1 -1
  494. package/packages/host/dist/routes/types.d.ts +29 -21
  495. package/packages/host/dist/routes/work/workbuild.js +3 -2
  496. package/packages/host/dist/routes/work/workbuild.js.map +1 -1
  497. package/packages/host/dist/routes/work/workintent.js +6 -2
  498. package/packages/host/dist/routes/work/workintent.js.map +1 -1
  499. package/packages/host/dist/routes/work/workschedule.js +33 -3
  500. package/packages/host/dist/routes/work/workschedule.js.map +1 -1
  501. package/packages/host/dist/screenlog.d.ts +20 -0
  502. package/packages/host/dist/screenlog.js +40 -0
  503. package/packages/host/dist/screenlog.js.map +1 -1
  504. package/packages/host/dist/server/billingwire.d.ts +3 -1
  505. package/packages/host/dist/server/billingwire.js +4 -2
  506. package/packages/host/dist/server/billingwire.js.map +1 -1
  507. package/packages/host/dist/server/clients.d.ts +14 -24
  508. package/packages/host/dist/server/clients.js +81 -11
  509. package/packages/host/dist/server/clients.js.map +1 -1
  510. package/packages/host/dist/server/ctx.d.ts +2 -0
  511. package/packages/host/dist/server/ctxseal.d.ts +1 -1
  512. package/packages/host/dist/server/ctxseal.js +6 -6
  513. package/packages/host/dist/server/ctxseal.js.map +1 -1
  514. package/packages/host/dist/server/deliveries.js +4 -2
  515. package/packages/host/dist/server/deliveries.js.map +1 -1
  516. package/packages/host/dist/server/http.js +2 -2
  517. package/packages/host/dist/server/http.js.map +1 -1
  518. package/packages/host/dist/server/intentDeps.js +13 -6
  519. package/packages/host/dist/server/intentDeps.js.map +1 -1
  520. package/packages/host/dist/server/intentEvents.js +9 -4
  521. package/packages/host/dist/server/intentEvents.js.map +1 -1
  522. package/packages/host/dist/server/scan.js +23 -1
  523. package/packages/host/dist/server/scan.js.map +1 -1
  524. package/packages/host/dist/server/sessionEvents.js +40 -15
  525. package/packages/host/dist/server/sessionEvents.js.map +1 -1
  526. package/packages/host/dist/server/shutdown.d.ts +3 -1
  527. package/packages/host/dist/server/shutdown.js +9 -1
  528. package/packages/host/dist/server/shutdown.js.map +1 -1
  529. package/packages/host/dist/sessionbudget.d.ts +2 -0
  530. package/packages/host/dist/sessionbudget.js +17 -6
  531. package/packages/host/dist/sessionbudget.js.map +1 -1
  532. package/packages/host/dist/sessions/agentpoll.d.ts +42 -0
  533. package/packages/host/dist/sessions/agentpoll.js +193 -0
  534. package/packages/host/dist/sessions/agentpoll.js.map +1 -0
  535. package/packages/host/dist/sessions/apiretry.d.ts +106 -0
  536. package/packages/host/dist/sessions/apiretry.js +387 -0
  537. package/packages/host/dist/sessions/apiretry.js.map +1 -0
  538. package/packages/host/dist/sessions/askwatch.d.ts +62 -0
  539. package/packages/host/dist/sessions/askwatch.js +169 -0
  540. package/packages/host/dist/sessions/askwatch.js.map +1 -0
  541. package/packages/host/dist/sessions/boxes.d.ts +2 -23
  542. package/packages/host/dist/sessions/boxes.js +10 -664
  543. package/packages/host/dist/sessions/boxes.js.map +1 -1
  544. package/packages/host/dist/sessions/boxread.d.ts +47 -0
  545. package/packages/host/dist/sessions/boxread.js +628 -0
  546. package/packages/host/dist/sessions/boxread.js.map +1 -0
  547. package/packages/host/dist/sessions/core.d.ts +22 -1
  548. package/packages/host/dist/sessions/ctxseries.js +3 -0
  549. package/packages/host/dist/sessions/ctxseries.js.map +1 -1
  550. package/packages/host/dist/sessions/drive.d.ts +20 -6
  551. package/packages/host/dist/sessions/drive.js +45 -12
  552. package/packages/host/dist/sessions/drive.js.map +1 -1
  553. package/packages/host/dist/sessions/endsession.d.ts +11 -0
  554. package/packages/host/dist/sessions/endsession.js +71 -0
  555. package/packages/host/dist/sessions/endsession.js.map +1 -0
  556. package/packages/host/dist/sessions/haltall.d.ts +14 -0
  557. package/packages/host/dist/sessions/haltall.js +32 -1
  558. package/packages/host/dist/sessions/haltall.js.map +1 -1
  559. package/packages/host/dist/sessions/knobs.d.ts +11 -0
  560. package/packages/host/dist/sessions/knobs.js +12 -0
  561. package/packages/host/dist/sessions/knobs.js.map +1 -1
  562. package/packages/host/dist/sessions/record.js +7 -2
  563. package/packages/host/dist/sessions/record.js.map +1 -1
  564. package/packages/host/dist/sessions/resume.d.ts +17 -0
  565. package/packages/host/dist/sessions/resume.js +65 -11
  566. package/packages/host/dist/sessions/resume.js.map +1 -1
  567. package/packages/host/dist/sessions/roster.js +3 -0
  568. package/packages/host/dist/sessions/roster.js.map +1 -1
  569. package/packages/host/dist/sessions/sidechannel.d.ts +1 -1
  570. package/packages/host/dist/sessions/sidechannel.js +2 -2
  571. package/packages/host/dist/sessions/tmux.js +21 -2
  572. package/packages/host/dist/sessions/tmux.js.map +1 -1
  573. package/packages/host/dist/sessions/turn.d.ts +15 -58
  574. package/packages/host/dist/sessions/turn.js +19 -358
  575. package/packages/host/dist/sessions/turn.js.map +1 -1
  576. package/packages/host/dist/sessions.d.ts +10 -7
  577. package/packages/host/dist/sessions.js +31 -79
  578. package/packages/host/dist/sessions.js.map +1 -1
  579. package/packages/host/dist/settle.d.ts +30 -2
  580. package/packages/host/dist/settle.js +94 -49
  581. package/packages/host/dist/settle.js.map +1 -1
  582. package/packages/host/dist/setupprefs.d.ts +26 -1
  583. package/packages/host/dist/setupprefs.js +49 -1
  584. package/packages/host/dist/setupprefs.js.map +1 -1
  585. package/packages/host/dist/setupwatch.d.ts +10 -8
  586. package/packages/host/dist/setupwatch.js +19 -16
  587. package/packages/host/dist/setupwatch.js.map +1 -1
  588. package/packages/host/dist/sidecar/sidecarname.d.ts +2 -0
  589. package/packages/host/dist/sidecar/sidecarname.js +5 -1
  590. package/packages/host/dist/sidecar/sidecarname.js.map +1 -1
  591. package/packages/host/dist/sidecar/sidecarroute.d.ts +1 -1
  592. package/packages/host/dist/sidecar/sidecarroute.js +5 -0
  593. package/packages/host/dist/sidecar/sidecarroute.js.map +1 -1
  594. package/packages/host/dist/sidecar.d.ts +1 -1
  595. package/packages/host/dist/sidecar.js +1 -1
  596. package/packages/host/dist/sidecar.js.map +1 -1
  597. package/packages/host/dist/tokenscan.d.ts +4 -4
  598. package/packages/host/dist/tokenscan.js +18 -37
  599. package/packages/host/dist/tokenscan.js.map +1 -1
  600. package/packages/host/dist/tokenstats.js +16 -18
  601. package/packages/host/dist/tokenstats.js.map +1 -1
  602. package/packages/host/dist/transcript/transcriptparse.js +17 -26
  603. package/packages/host/dist/transcript/transcriptparse.js.map +1 -1
  604. package/packages/host/dist/transcript/transcriptturns.d.ts +29 -0
  605. package/packages/host/dist/transcript/transcriptturns.js +27 -0
  606. package/packages/host/dist/transcript/transcriptturns.js.map +1 -1
  607. package/packages/host/dist/transcript.d.ts +1 -1
  608. package/packages/host/dist/transcript.js +1 -1
  609. package/packages/host/dist/transcript.js.map +1 -1
  610. package/packages/host/dist/usagesources.d.ts +1 -1
  611. package/packages/host/dist/usagesources.js +7 -2
  612. package/packages/host/dist/usagesources.js.map +1 -1
  613. package/packages/host/dist/visualskill.js +2 -2
  614. package/packages/host/dist/weekburn.d.ts +79 -0
  615. package/packages/host/dist/weekburn.js +276 -0
  616. package/packages/host/dist/weekburn.js.map +1 -0
  617. package/packages/host/dist/worktreeleftover.d.ts +9 -0
  618. package/packages/host/dist/worktreeleftover.js +17 -1
  619. package/packages/host/dist/worktreeleftover.js.map +1 -1
  620. package/packages/web/dist/assets/demo-DsZGy-MC.js +24 -0
  621. package/packages/web/dist/assets/icons-eqlvjswV.js +1 -0
  622. package/packages/web/dist/assets/index-GHwJuQb3.js +169 -0
  623. package/packages/web/dist/assets/index-VzDSZwwH.css +1 -0
  624. package/packages/web/dist/assets/shared-BWk5jXWb.js +49 -0
  625. package/packages/web/dist/assets/sheets-Dj-0m0DB.js +232 -0
  626. package/packages/web/dist/assets/{sheets-Bjv2L-cG.css → sheets-DoUhPGK0.css} +1 -1
  627. package/packages/web/dist/build-id.txt +1 -1
  628. package/packages/web/dist/buildstamp.json +1 -0
  629. package/packages/web/dist/index.html +7 -7
  630. package/packages/web/dist/sw.js +18 -3
  631. package/release.json +7 -4
  632. package/scripts/windows/wsl-setup.sh +10 -1
  633. package/tools/repohealth/constants.mjs +21 -1
  634. package/tools/repohealth/fixture.json +493 -30
  635. package/tools/repohealth/lang/typescript-resolve.mjs +354 -0
  636. package/tools/repohealth/metrics/graph.mjs +258 -0
  637. package/tools/repohealth/metrics/size.mjs +1 -1
  638. package/tools/repohealth/own.mjs +4 -4
  639. package/tools/repohealth/packs/c.mjs +4 -0
  640. package/tools/repohealth/packs/common.mjs +4 -0
  641. package/tools/repohealth/packs/dart.mjs +4 -0
  642. package/tools/repohealth/packs/kotlin.mjs +8 -0
  643. package/tools/repohealth/packs/python.mjs +8 -0
  644. package/tools/repohealth/packs/shell.mjs +4 -0
  645. package/tools/repohealth/packs/typescript.mjs +278 -7
  646. package/tools/repohealth/readings.mjs +39 -0
  647. package/tools/repohealth/series.mjs +1 -0
  648. package/tools/repohealth/snapshot.mjs +14 -0
  649. package/tools/repohealth/types.mjs +12 -0
  650. package/tools/repohealth.mjs +2 -0
  651. package/packages/web/dist/assets/demo-CXlqlYE4.js +0 -23
  652. package/packages/web/dist/assets/icons-BbqDBVjw.js +0 -1
  653. package/packages/web/dist/assets/index-CgPoyb3Y.css +0 -1
  654. package/packages/web/dist/assets/index-D5JKj8DK.js +0 -169
  655. package/packages/web/dist/assets/shared-eyaskl5l.js +0 -47
  656. package/packages/web/dist/assets/sheets-BzzL2re1.js +0 -204
@@ -0,0 +1,57 @@
1
+ import { isoWeekOf, centralOf } from "./readings.js";
2
+ import { healthRowScore } from "./score.js";
3
+ /** Thin to ~`max`: each ISO week's LAST point stays; `ceil(n/max)`-long runs keep their min and max index. At most 2*max + weeks. */
4
+ export function thinCommitPoints(points, max) {
5
+ if (points.length <= max)
6
+ return [...points];
7
+ const keep = new Set();
8
+ const lastOfWeek = new Map();
9
+ points.forEach((p, i) => lastOfWeek.set(p.week, i));
10
+ for (const i of lastOfWeek.values())
11
+ keep.add(i);
12
+ const run = Math.ceil(points.length / Math.max(1, max));
13
+ for (let a = 0; a < points.length; a += run) {
14
+ let lo = a, hi = a;
15
+ const end = Math.min(points.length, a + run);
16
+ for (let i = a; i < end; i++) {
17
+ if (points[i].index < points[lo].index)
18
+ lo = i;
19
+ if (points[i].index > points[hi].index)
20
+ hi = i;
21
+ }
22
+ keep.add(lo);
23
+ keep.add(hi);
24
+ }
25
+ return [...keep].sort((x, y) => x - y).map((i) => points[i]);
26
+ }
27
+ /** Every scorable row as a commit point, thinned to about `max`; `null` when no row scores. */
28
+ export function healthIndexCommits(rows, contextWarnChars, max = 240) {
29
+ const sorted = rows.filter((r) => r && typeof r.ts === "number").sort((a, b) => a.ts - b.ts);
30
+ const all = [];
31
+ let prev = null;
32
+ for (const row of sorted) {
33
+ const week = isoWeekOf(row.day);
34
+ const s = week ? healthRowScore(row, contextWarnChars) : null;
35
+ if (!week || !s)
36
+ continue;
37
+ const prereg = typeof row.prereg === "string" ? row.prereg : null;
38
+ const central = centralOf(row).fp;
39
+ all.push({
40
+ sha7: typeof row.sha === "string" ? row.sha.slice(0, 7) : "",
41
+ day: row.day, ts: row.ts, week, index: s.index, mean: s.mean, cappedBy: s.cappedBy,
42
+ gap: prev !== null && (prev.prereg !== prereg || prev.central !== central),
43
+ });
44
+ prev = { prereg, central };
45
+ }
46
+ if (all.length === 0)
47
+ return null;
48
+ const points = thinCommitPoints(all, max);
49
+ return { points, total: all.length, thinned: points.length < all.length };
50
+ }
51
+ /** `absent` = an older host (no key), `none` = the host looked and nothing scores, else `present`. */
52
+ export function healthCommitsAvailability(view) {
53
+ if (!view || view.commits === undefined)
54
+ return "absent";
55
+ return view.commits && view.commits.points.length > 0 ? "present" : "none";
56
+ }
57
+ //# sourceMappingURL=commits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commits.js","sourceRoot":"","sources":["../../src/healthindex/commits.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAqB5C,qIAAqI;AACrI,MAAM,UAAU,gBAAgB,CAAC,MAAoC,EAAE,GAAW;IAChF,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG;QAAE,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC7C,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACpD,KAAK,MAAM,CAAC,IAAI,UAAU,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACjD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACxD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC;QAC5C,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QACnB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,CAAC,CA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M,UAAU,yBAAyB,CAAC,IAAgE;IACxG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IACzD,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AAC7E,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { type HealthIndexPoint } from "./types.js";
2
+ export interface HealthMove {
3
+ kind: "drop" | "rise" | null;
4
+ horizon: "week" | "month" | null;
5
+ /** Index points the horizon moved (latest − then); null when there is no comparable move to state. */
6
+ delta: number | null;
7
+ reason: string;
8
+ }
9
+ export interface HealthMoveOpts {
10
+ minWeeks?: number;
11
+ minMonthWindows?: number;
12
+ lowPct?: number;
13
+ highPct?: number;
14
+ minPoints?: number;
15
+ }
16
+ /**
17
+ * Whether the latest move is unusual for THIS repo: the week's link against
18
+ * the distribution of every earlier link, then (only if the week says nothing)
19
+ * the last four weeks against every earlier rolling four-week change. Both
20
+ * need the percentile AND a minimum number of points, so a dead-flat series
21
+ * cannot call a 0.1-point wobble a drop. Under `HEALTH_INDEX_MIN_WEEKS` links
22
+ * of history there is no distribution to stand on: `kind: null`, with why.
23
+ */
24
+ export declare function assessHealthMove(points: readonly HealthIndexPoint[], opts?: HealthMoveOpts): HealthMove;
25
+ /** Plain names for an entry's move: [0] when its metric rose (its score fell), [1] when it fell. */
@@ -0,0 +1,79 @@
1
+ // healthindex/move: The move detector: a drop or rise called only against the series' own past. Barrel: ../healthindex.ts (read the header there).
2
+ import { HEALTH_INDEX_MIN_WEEKS, HEALTH_INDEX_MIN_MONTH_WINDOWS, HEALTH_INDEX_MONTH_WEEKS, HEALTH_INDEX_LOW_PCT, HEALTH_INDEX_HIGH_PCT, HEALTH_INDEX_MIN_POINTS } from "./types.js";
3
+ /** Linear-interpolated percentile (0–100) of a non-empty list. */
4
+ function percentile(xs, p) {
5
+ const s = [...xs].sort((a, b) => a - b);
6
+ const pos = (p / 100) * (s.length - 1);
7
+ const lo = Math.floor(pos);
8
+ const hi = Math.ceil(pos);
9
+ return s[lo] + (s[hi] - s[lo]) * (pos - lo);
10
+ }
11
+ /**
12
+ * Whether the latest move is unusual for THIS repo: the week's link against
13
+ * the distribution of every earlier link, then (only if the week says nothing)
14
+ * the last four weeks against every earlier rolling four-week change. Both
15
+ * need the percentile AND a minimum number of points, so a dead-flat series
16
+ * cannot call a 0.1-point wobble a drop. Under `HEALTH_INDEX_MIN_WEEKS` links
17
+ * of history there is no distribution to stand on: `kind: null`, with why.
18
+ */
19
+ export function assessHealthMove(points, opts = {}) {
20
+ const minWeeks = opts.minWeeks ?? HEALTH_INDEX_MIN_WEEKS;
21
+ const minMonth = opts.minMonthWindows ?? HEALTH_INDEX_MIN_MONTH_WINDOWS;
22
+ const lowPct = opts.lowPct ?? HEALTH_INDEX_LOW_PCT;
23
+ const highPct = opts.highPct ?? HEALTH_INDEX_HIGH_PCT;
24
+ const minPts = opts.minPoints ?? HEALTH_INDEX_MIN_POINTS;
25
+ const none = (reason, horizon = null, delta = null) => ({ kind: null, horizon, delta, reason });
26
+ const last = points[points.length - 1];
27
+ if (!last)
28
+ return none("no index yet");
29
+ const links = points.filter((p) => p.lnLink !== null);
30
+ if (links.length < minWeeks) {
31
+ return none(`${links.length} weekly link${links.length === 1 ? "" : "s"} so far; a move is called after ${minWeeks}`);
32
+ }
33
+ // Week: only when the latest point IS a link — a carried week moved nothing.
34
+ if (last.lnLink !== null) {
35
+ const prior = links.slice(0, -1).map((p) => p.lnLink);
36
+ const prevIndex = points[points.length - 2].index;
37
+ const delta = last.index - prevIndex;
38
+ if (last.lnLink < percentile(prior, lowPct) && -delta >= minPts) {
39
+ return { kind: "drop", horizon: "week", delta, reason: `the latest week's link sits below the ${lowPct}th percentile of ${prior.length} earlier weeks` };
40
+ }
41
+ if (last.lnLink > percentile(prior, highPct) && delta >= minPts) {
42
+ return { kind: "rise", horizon: "week", delta, reason: `the latest week's link sits above the ${highPct}th percentile of ${prior.length} earlier weeks` };
43
+ }
44
+ }
45
+ // Month: ln(index_t / index_{t-4}) against every earlier rolling window.
46
+ const W = HEALTH_INDEX_MONTH_WEEKS;
47
+ const t = points.length - 1;
48
+ if (t < W)
49
+ return none("too few weeks for a four-week reading");
50
+ // A window that spans a `gap` point compares two scores measured under
51
+ // different definitions: it is not a move. Skipped as history, and when the
52
+ // current window is one, no month move is called at all.
53
+ const spansGap = (j) => {
54
+ for (let k = j - W + 1; k <= j; k++)
55
+ if (points[k].gap)
56
+ return true;
57
+ return false;
58
+ };
59
+ if (spansGap(t))
60
+ return none("the last four weeks span a change of definition, so there is no month move to compare");
61
+ const windows = [];
62
+ for (let j = W; j < t; j++)
63
+ if (!spansGap(j))
64
+ windows.push(Math.log(points[j].index / points[j - W].index));
65
+ const monthDelta = last.index - points[t - W].index;
66
+ if (windows.length < minMonth) {
67
+ return none(`${windows.length} earlier four-week window${windows.length === 1 ? "" : "s"}; a month move is called after ${minMonth}`);
68
+ }
69
+ const ln = Math.log(last.index / points[t - W].index);
70
+ if (ln < percentile(windows, lowPct) && -monthDelta >= minPts) {
71
+ return { kind: "drop", horizon: "month", delta: monthDelta, reason: `the last four weeks sit below the ${lowPct}th percentile of ${windows.length} earlier four-week windows` };
72
+ }
73
+ if (ln > percentile(windows, highPct) && monthDelta >= minPts) {
74
+ return { kind: "rise", horizon: "month", delta: monthDelta, reason: `the last four weeks sit above the ${highPct}th percentile of ${windows.length} earlier four-week windows` };
75
+ }
76
+ return none("within this repo's usual range", null, last.lnLink !== null ? last.index - points[t - 1].index : null);
77
+ }
78
+ /** Plain names for an entry's move: [0] when its metric rose (its score fell), [1] when it fell. */
79
+ //# sourceMappingURL=move.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move.js","sourceRoot":"","sources":["../../src/healthindex/move.ts"],"names":[],"mappings":"AAAA,mJAAmJ;AACnJ,OAAO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riesRow } from "./types.js";
2
+ /** `100 · min(1, good / value)`; a value at or under 0 is 100. */
3
+ export declare function healthScore(value: number, good: number): number;
4
+ /** The Monday (UTC) of the ISO week holding `day` (`YYYY-MM-DD`), or null for a malformed day. */
5
+ export declare function isoWeekOf(day: string): string | null;
6
+ /** The last row (greatest `ts`) of each ISO week, oldest week first. */
7
+ export declare function healthWeeks(rows: readonly HealthSeriesRow[]): {
8
+ week: string;
9
+ row: HealthSeriesRow;
10
+ }[];
11
+ /** The good line of the context entry for a repo's warn line (null = the default). */
12
+ export declare function healthContextGood(contextWarnChars: number | null): number;
13
+ /** One week's readings: the five values (size's is `lineMean`), plus size's longest file. */
14
+ export interface HealthEntryReadings {
15
+ values: Partial<Record<HealthEntry, number>>;
16
+ /** The longest file, read beside `lineMean`; absent where size is. */
17
+ max?: {
18
+ value: number;
19
+ path: string | null;
20
+ };
21
+ }
22
+ /**
23
+ * One week's values, raw (no epsilon, no floor — `min(1, good/value)` is
24
+ * finite for any value ≥ 0); an entry is absent where its reading is.
25
+ *
26
+ * - `size` is `lineMean` and needs `max` beside it; either missing ⇒ absent.
27
+ * - `untested` is a SHARE: `untested.count / classics.files` — the source-file
28
+ * count of the same tree, which counts test files too, so the share is a
29
+ * floor. A share and not the count, so a repo that grows does not read as
30
+ * slipping just for having more modules.
31
+ * - `hatches` is UNEXPLAINED escapes per kLOC where the row classified them
32
+ * (engine 2026-10-16a on); every occurrence on an older row.
33
+ * - `context` is `claudeMdChars + descChars`; `descChars` null (no counted
34
+ * skills) counts as 0 descriptions.
35
+ */
36
+ export declare function healthEntryReadings(row: HealthSeriesRow): HealthEntryReadings;
37
+ /** The five values alone — `healthEntryReadings(row).values`. The warn line is not read here any more (scores read it). */
38
+ export declare function healthEntryValues(row: HealthSeriesRow, _contextWarnChars?: number | null): Partial<Record<HealthEntry, number>>;
39
+ /**
40
+ * What the repo applied on this row: its fingerprint and which entries it
41
+ * disabled or overrode. An entry both disabled and overridden reads disabled
42
+ * (the engine never writes both; a hand-edited row must not count twice).
43
+ */
44
+ export declare function centralOf(row: HealthSeriesRow): {
45
+ fp: string;
46
+ disabled: HealthEntry[];
47
+ overridden: HealthEntry[];
48
+ };
49
+ export declare const DAY_MS = 86400000;
50
+ export declare function treeOf(row: HealthSeriesRow): {
51
+ files: number;
52
+ loc: number;
53
+ } | null;
@@ -0,0 +1,154 @@
1
+ // healthindex/readings: Rows to readings: ISO weeks, the per-entry values, the repo `central` override. Barrel: ../healthindex.ts (read the header there).
2
+ import { HEALTH_ENTRIES, HEALTH_CONTEXT_GOOD_SHARE, HEALTH_INDEX_DEFAULT_WARN_CHARS, HEALTH_NO_CLAUDE_MD } from "./types.js";
3
+ const posFinite = (v) => typeof v === "number" && Number.isFinite(v) && v > 0;
4
+ const nonNegFinite = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0;
5
+ /** `100 · min(1, good / value)`; a value at or under 0 is 100. */
6
+ export function healthScore(value, good) {
7
+ return value <= 0 ? 100 : 100 * Math.min(1, good / value);
8
+ }
9
+ /** The Monday (UTC) of the ISO week holding `day` (`YYYY-MM-DD`), or null for a malformed day. */
10
+ export function isoWeekOf(day) {
11
+ if (typeof day !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(day))
12
+ return null;
13
+ const t = Date.parse(`${day}T00:00:00Z`);
14
+ if (!Number.isFinite(t) || new Date(t).toISOString().slice(0, 10) !== day)
15
+ return null;
16
+ const dow = (new Date(t).getUTCDay() + 6) % 7; // Monday = 0
17
+ return new Date(t - dow * 86_400_000).toISOString().slice(0, 10);
18
+ }
19
+ /** The last row (greatest `ts`) of each ISO week, oldest week first. */
20
+ export function healthWeeks(rows) {
21
+ const byWeek = new Map();
22
+ for (const r of rows) {
23
+ if (!r || typeof r.ts !== "number")
24
+ continue;
25
+ const week = isoWeekOf(r.day);
26
+ if (!week)
27
+ continue;
28
+ const prev = byWeek.get(week);
29
+ if (!prev || r.ts >= prev.ts)
30
+ byWeek.set(week, r);
31
+ }
32
+ return [...byWeek.entries()].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)).map(([week, row]) => ({ week, row }));
33
+ }
34
+ /** The good line of the context entry for a repo's warn line (null = the default). */
35
+ export function healthContextGood(contextWarnChars) {
36
+ return HEALTH_CONTEXT_GOOD_SHARE * (posFinite(contextWarnChars) ? contextWarnChars : HEALTH_INDEX_DEFAULT_WARN_CHARS);
37
+ }
38
+ /**
39
+ * One week's values, raw (no epsilon, no floor — `min(1, good/value)` is
40
+ * finite for any value ≥ 0); an entry is absent where its reading is.
41
+ *
42
+ * - `size` is `lineMean` and needs `max` beside it; either missing ⇒ absent.
43
+ * - `untested` is a SHARE: `untested.count / classics.files` — the source-file
44
+ * count of the same tree, which counts test files too, so the share is a
45
+ * floor. A share and not the count, so a repo that grows does not read as
46
+ * slipping just for having more modules.
47
+ * - `hatches` is UNEXPLAINED escapes per kLOC where the row classified them
48
+ * (engine 2026-10-16a on); every occurrence on an older row.
49
+ * - `context` is `claudeMdChars + descChars`; `descChars` null (no counted
50
+ * skills) counts as 0 descriptions.
51
+ */
52
+ export function healthEntryReadings(row) {
53
+ const values = {};
54
+ let max;
55
+ const sz = row.size?.value;
56
+ // `max` is read on its own: an override REPLACES lineMean and keeps the
57
+ // engine's max, so it must not depend on the engine's lineMean being there.
58
+ // Where `max` is absent size is absent on BOTH paths (an override cannot
59
+ // invent the longest file); where only lineMean is absent, size is absent
60
+ // without an override and the override's value stands with the engine's max.
61
+ // A `max` left without a size value is dropped at the end.
62
+ if (sz && nonNegFinite(sz.max)) {
63
+ max = { value: sz.max, path: typeof sz.maxPath === "string" && sz.maxPath ? sz.maxPath : null };
64
+ }
65
+ if (sz && nonNegFinite(sz.lineMean) && max)
66
+ values.size = sz.lineMean;
67
+ const rate = row.retouch?.value?.rate;
68
+ if (nonNegFinite(rate))
69
+ values.retouch = rate;
70
+ const h = row.hatches;
71
+ const loc = row.classics?.value?.loc;
72
+ if (h?.value && typeof h.value === "object" && posFinite(loc)) {
73
+ let total = 0;
74
+ let ok = true;
75
+ if (h.split && typeof h.split === "object") {
76
+ if (nonNegFinite(h.split.unexplained))
77
+ total = h.split.unexplained;
78
+ else
79
+ ok = false;
80
+ }
81
+ else {
82
+ for (const v of Object.values(h.value)) {
83
+ if (!nonNegFinite(v)) {
84
+ ok = false;
85
+ break;
86
+ }
87
+ total += v;
88
+ }
89
+ }
90
+ if (ok)
91
+ values.hatches = total / (loc / 1000);
92
+ }
93
+ const ctx = row.context?.value;
94
+ const md = ctx?.claudeMdChars;
95
+ const desc = ctx?.descChars;
96
+ // No CLAUDE.md is nothing the repo loads every turn: 0, on the engine's exact words (its skills go unmeasured then).
97
+ if (!ctx && row.context?.reason === HEALTH_NO_CLAUDE_MD)
98
+ values.context = 0;
99
+ else if (nonNegFinite(md) && (desc === null || desc === undefined || nonNegFinite(desc)))
100
+ values.context = md + (typeof desc === "number" ? desc : 0);
101
+ const list = row.untested?.value;
102
+ const files = row.classics?.value?.files;
103
+ if (Array.isArray(list) && posFinite(files) && list.length <= files) {
104
+ values.untested = list.length / files;
105
+ }
106
+ // The repo's own say (`central`): a disabled entry is not in the basket at
107
+ // all; an override REPLACES the engine's value (for size, `lineMean` — the
108
+ // longest file stays measured), and a failed override is absent — never the
109
+ // engine's number standing in for the repo's.
110
+ const c = centralOf(row);
111
+ for (const e of c.disabled) {
112
+ delete values[e];
113
+ if (e === "size")
114
+ max = undefined;
115
+ }
116
+ for (const e of c.overridden) {
117
+ delete values[e];
118
+ const v = row.central?.override?.[e]?.value;
119
+ if (!nonNegFinite(v))
120
+ continue;
121
+ if (e === "size" && !max)
122
+ continue;
123
+ values[e] = v;
124
+ }
125
+ if (values.size === undefined)
126
+ max = undefined;
127
+ return max ? { values, max } : { values };
128
+ }
129
+ /** The five values alone — `healthEntryReadings(row).values`. The warn line is not read here any more (scores read it). */
130
+ export function healthEntryValues(row, _contextWarnChars) {
131
+ return healthEntryReadings(row).values;
132
+ }
133
+ const isEntry = (k) => HEALTH_ENTRIES.includes(k);
134
+ /**
135
+ * What the repo applied on this row: its fingerprint and which entries it
136
+ * disabled or overrode. An entry both disabled and overridden reads disabled
137
+ * (the engine never writes both; a hand-edited row must not count twice).
138
+ */
139
+ export function centralOf(row) {
140
+ const c = row.central;
141
+ if (!c || typeof c !== "object")
142
+ return { fp: "", disabled: [], overridden: [] };
143
+ const fp = typeof c.fp === "string" ? c.fp : "";
144
+ const keysOf = (o) => o && typeof o === "object" ? Object.keys(o).filter(isEntry) : [];
145
+ const disabled = HEALTH_ENTRIES.filter((e) => keysOf(c.disabled).includes(e));
146
+ const overridden = HEALTH_ENTRIES.filter((e) => keysOf(c.override).includes(e) && !disabled.includes(e));
147
+ return { fp, disabled, overridden };
148
+ }
149
+ export const DAY_MS = 86_400_000;
150
+ export function treeOf(row) {
151
+ const v = row.classics?.value;
152
+ return v && nonNegFinite(v.files) && nonNegFinite(v.loc) ? { files: v.files, loc: v.loc } : null;
153
+ }
154
+ //# sourceMappingURL=readings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readings.js","sourceRoot":"","sources":["../../src/healthindex/readings.ts"],"names":[],"mappings":"AAAA,2JAA2J;AAC3J,OAAO,EAAE,cAAc,EAAoB,yBAAyB,EAAE,+BAA+B,EAAE,mBAAmB,EAAwB,MAAM,YAAY,CAAC;AAErK,MAAM,SAAS,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpG,MAAM,YAAY,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAExG,kEAAkE;AAClE,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,IAAY;IACrD,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,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,EAAE,CAC3C,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACzG,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AACtC,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC;AAEjC,MAAM,UAAU,MAAM,CAAC,GAAoB;IACzC,MAAM,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;IAC9B,OAAO,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACnG,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { type HealthEntry, type HealthIndexSeries } from "./types.js";
2
+ import { type HealthCommitSeries } from "./commits.js";
3
+ import { type HealthMove } from "./move.js";
4
+ import { type HealthWords } from "./words.js";
5
+ export interface RepoHealthIndex {
6
+ /** The latest headline score, 0–100. */
7
+ value: number;
8
+ /** The latest week's move in score points; null on a gap week or the first scored week. */
9
+ deltaWeek: number | null;
10
+ /** The latest week's Monday. */
11
+ week: string;
12
+ move: "drop" | "rise" | null;
13
+ /** The mean before the cap, so `healthCapWords` can be said from this summary alone. */
14
+ mean?: number;
15
+ /** The entry holding the score down when the cap set it, else null. */
16
+ cappedBy?: HealthEntry | null;
17
+ /** The worst alert level on the latest week; null when nothing is under the warn line. */
18
+ alert?: "warn" | "severe" | null;
19
+ /** That worst alert's sentence; null with it. */
20
+ alertText?: string | null;
21
+ }
22
+ /** The wire summary for one repo, or null where there is no index (the field stays ABSENT, never 0). */
23
+ export declare function repoHealthIndexOf(series: HealthIndexSeries | null, move?: HealthMove | null): RepoHealthIndex | null;
24
+ /**
25
+ * `GET /api/repos/:id/healthindex` — the whole scored series for the phone's
26
+ * chart (the latest point carries the alerts and `cappedBy`), the called move
27
+ * and its words. `series: null` + `reason` when there is no series file or no
28
+ * scored week yet; never a made-up number.
29
+ */
30
+ export interface HealthIndexResponse {
31
+ series: HealthIndexSeries | null;
32
+ move: HealthMove | null;
33
+ words: HealthWords | null;
34
+ /** ISO time of the last weekly refresh this host ran for the repo, if any. */
35
+ lastRefresh: string | null;
36
+ reason?: string;
37
+ /** Context per request by ISO week (`healthspend.ts`); absent with no ledger (older host; VS Code before its first log scan). */
38
+ spend?: import("../healthspend.js").HealthSpendWeek[];
39
+ /** Scored commits, thinned. ABSENT only on an older host; null = no row scores (or no series). */
40
+ commits?: HealthCommitSeries | null;
41
+ }
@@ -0,0 +1,19 @@
1
+ /** The wire summary for one repo, or null where there is no index (the field stays ABSENT, never 0). */
2
+ export function repoHealthIndexOf(series, move) {
3
+ const pts = series?.points;
4
+ const last = pts?.[pts.length - 1];
5
+ if (!pts || !last)
6
+ return null;
7
+ const prev = pts[pts.length - 2];
8
+ return {
9
+ value: last.index,
10
+ deltaWeek: last.lnLink !== null && prev ? last.index - prev.index : null,
11
+ week: last.week,
12
+ move: move?.kind ?? null,
13
+ mean: last.mean,
14
+ cappedBy: last.cappedBy,
15
+ alert: last.alerts[0]?.level ?? null,
16
+ alertText: last.alerts[0]?.text ?? null,
17
+ };
18
+ }
19
+ //# sourceMappingURL=repoindex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repoindex.js","sourceRoot":"","sources":["../../src/healthindex/repoindex.ts"],"names":[],"mappings":"AA2BA,wGAAwG;AACxG,MAAM,UAAU,iBAAiB,CAAC,MAAgC,EAAE,IAAwB;IAC1F,MAAM,GAAG,GAAG,MAAM,EAAE,MAAM,CAAC;IAC3B,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACnC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/B,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjC,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,SAAS,EAAE,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QACxE,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI;QACxB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,IAAI;QACpC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,IAAI;KACxC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type HealthEntry, type HealthSeriesRow, type HealthIndexSeries } from "./types.js";
2
+ /** Plain names for an entry, as the cap sentence names it. */
3
+ export declare const HEALTH_ENTRY_LABEL: Record<HealthEntry, string>;
4
+ /**
5
+ * The cap, said once: `null` when the cap did not set the number. The worst
6
+ * entry's score is derived (`value − HEALTH_SCORE_CAP_GAP`), so the wire
7
+ * summary can be worded from its three fields alone.
8
+ */
9
+ export declare function healthCapWords(s: {
10
+ value: number;
11
+ mean: number;
12
+ cappedBy: HealthEntry | null;
13
+ }): string | null;
14
+ /**
15
+ * The scored series. `null` when no week has every enabled entry — no score
16
+ * is no series, never a number nobody measured.
17
+ */
18
+ export declare function healthIndex(rows: readonly HealthSeriesRow[], contextWarnChars: number | null): HealthIndexSeries | null;
19
+ /** One row by the SAME formula a week uses (`scoreWeek`); null when an enabled entry is absent. */
20
+ export declare function healthRowScore(row: HealthSeriesRow, contextWarnChars: number | null): {
21
+ index: number;
22
+ mean: number;
23
+ scores: Partial<Record<HealthEntry, number>>;
24
+ cappedBy: HealthEntry | null;
25
+ } | null;
26
+ /** One scored commit (a series row) for the phone's commits axis. No lnLink, contributions or move. */