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,170 @@
1
+ /**
2
+ * The scorecard's pure logic, shared by the host half and (for the remedy prompt) the phone:
3
+ * GitHub remote → slug, the API reply → checks, failing / accepted, the words of the setup row and
4
+ * the remedy prompt. No node imports.
5
+ */
6
+ import { BUILT_IN_ACCEPTS, SLUG_RE } from "./wire.mjs";
7
+ const DETAIL_LINES = 20;
8
+ const DETAIL_CHARS = 300;
9
+ /** GitHub `owner/name` of a remote URL (https, scp-style, ssh://, git://), or null for any other host. */
10
+ export function githubSlug(url) {
11
+ const m = /^(?:(?:https?|ssh|git|git\+ssh):\/\/)?(?:[^@/\s]+@)?(?:www\.)?github\.com(?::\d+)?[:/]+([^/\s]+)\/([^/\s]+?)(?:\.git)?\/?$/i.exec(url.trim());
12
+ if (!m)
13
+ return null;
14
+ const slug = `${m[1]}/${m[2]}`;
15
+ return isUsableSlug(slug) ? slug : null;
16
+ }
17
+ /** SLUG_RE plus the two names GitHub's regex shape admits but no repo can have ("." and ".."). */
18
+ export function isUsableSlug(s) {
19
+ if (!SLUG_RE.test(s))
20
+ return false;
21
+ const name = s.slice(s.indexOf("/") + 1);
22
+ return name !== "." && name !== "..";
23
+ }
24
+ /** Check names come off the network: only OWN keys count, so `constructor` / `__proto__` are ordinary names. */
25
+ export const own = (o, k) => (o && Object.hasOwn(o, k) ? o[k] : undefined);
26
+ export const builtInAccept = (name) => own(BUILT_IN_ACCEPTS, name);
27
+ /** The slug a git `config` text names: remote `origin` if it is GitHub, else the first GitHub remote. */
28
+ export function slugFromConfig(text) {
29
+ const remotes = [];
30
+ let cur = null;
31
+ for (const raw of text.split(/\r?\n/)) {
32
+ const line = raw.trim();
33
+ const sec = /^\[\s*remote\s+"([^"]+)"\s*\]$/i.exec(line);
34
+ if (sec) {
35
+ cur = sec[1];
36
+ continue;
37
+ }
38
+ if (line.startsWith("[")) {
39
+ cur = null;
40
+ continue;
41
+ }
42
+ const kv = /^url\s*=\s*(.+)$/i.exec(line);
43
+ if (kv && cur !== null)
44
+ remotes.push({ name: cur, url: kv[1].trim() });
45
+ }
46
+ const gh = remotes.map((r) => ({ name: r.name, slug: githubSlug(r.url) })).filter((r) => r.slug);
47
+ return (gh.find((r) => r.name === "origin") ?? gh[0])?.slug ?? null;
48
+ }
49
+ /** Failing = it loses points: 0 <= score < 10. -1 (inconclusive) never fails. */
50
+ export const isFailing = (score) => score >= 0 && score < 10;
51
+ export const viewerUrl = (slug) => `https://scorecard.dev/viewer/?uri=github.com/${slug}`;
52
+ const MAX_CHECKS = 40;
53
+ const NAME_MAX = 100;
54
+ const REASON_CAP = 500;
55
+ const SHORT_CAP = 300;
56
+ const URL_CAP = 300;
57
+ const clip = (v, n) => (v.length > n ? v.slice(0, n - 1) + "…" : v);
58
+ const str = (v) => (typeof v === "string" ? v : null);
59
+ /** The API reply, defensively. A wrong shape is `{ ok:false, reason }` — never an invented number. */
60
+ export function parseReply(d) {
61
+ const o = d;
62
+ if (!o || typeof o !== "object" || Array.isArray(o))
63
+ return { ok: false, reason: "the Scorecard reply was not a JSON object" };
64
+ const score = o.score;
65
+ if (typeof score !== "number" || !Number.isFinite(score))
66
+ return { ok: false, reason: "the Scorecard reply has no aggregate score" };
67
+ if (score < 0 || score > 10)
68
+ return { ok: false, reason: `the Scorecard reply's score (${score}) is outside 0–10` };
69
+ if (!Array.isArray(o.checks))
70
+ return { ok: false, reason: "the Scorecard reply has no list of checks" };
71
+ const checks = [];
72
+ for (const c of o.checks) {
73
+ if (checks.length >= MAX_CHECKS)
74
+ break;
75
+ const r = c;
76
+ if (!r || typeof r !== "object" || typeof r.name !== "string" || !r.name || typeof r.score !== "number" || !Number.isFinite(r.score))
77
+ continue;
78
+ const doc = r.documentation;
79
+ const details = Array.isArray(r.details)
80
+ ? r.details.filter((x) => typeof x === "string").slice(0, DETAIL_LINES).map((x) => (x.length > DETAIL_CHARS ? x.slice(0, DETAIL_CHARS - 1) + "…" : x))
81
+ : [];
82
+ checks.push({
83
+ name: clip(r.name, NAME_MAX),
84
+ score: r.score,
85
+ reason: clip(str(r.reason) ?? "", REASON_CAP),
86
+ details,
87
+ docUrl: doc && typeof doc === "object" ? clip(str(doc.url) ?? "", URL_CAP) || null : null,
88
+ short: doc && typeof doc === "object" ? clip(str(doc.short) ?? "", SHORT_CAP) : "",
89
+ });
90
+ }
91
+ if (!checks.length)
92
+ return { ok: false, reason: "the Scorecard reply lists no readable check" };
93
+ const repo = o.repo;
94
+ const sc = o.scorecard;
95
+ const value = { score, checks };
96
+ const date = str(o.date);
97
+ if (date)
98
+ value.date = date;
99
+ const commit = repo && typeof repo === "object" ? str(repo.commit) : null;
100
+ if (commit)
101
+ value.commit = commit;
102
+ const ver = sc && typeof sc === "object" ? str(sc.version) : null;
103
+ if (ver)
104
+ value.scorecardVersion = ver;
105
+ return { ok: true, value };
106
+ }
107
+ /** A person's accept holds while the check's score has not fallen below the score it was accepted at. */
108
+ export const acceptHolds = (a, score) => a.builtIn === true || a.score === undefined || score >= a.score;
109
+ /** The sheet's checks: each with `failing` and its accept (built-in first, else the person's, unless lapsed). */
110
+ export function checkViews(checks, person = {}) {
111
+ return checks.map((c) => {
112
+ const v = { ...c, failing: isFailing(c.score) };
113
+ if (!v.failing)
114
+ return v;
115
+ const built = builtInAccept(c.name);
116
+ if (built)
117
+ v.accepted = { reason: built, builtIn: true };
118
+ else {
119
+ const p = own(person, c.name);
120
+ if (p && acceptHolds(p, c.score))
121
+ v.accepted = p;
122
+ }
123
+ return v;
124
+ });
125
+ }
126
+ export const openCount = (checks) => checks.filter((c) => c.failing && !c.accepted).length;
127
+ const plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
128
+ /** The setup row's detail for a scored repo, e.g. "6/10 — 3 failing checks (A, B, C); 3 accepted". */
129
+ export function scoredDetail(score, checks) {
130
+ const open = checks.filter((c) => c.failing && !c.accepted);
131
+ const accepted = checks.filter((c) => c.failing && c.accepted).length;
132
+ if (!open.length)
133
+ return `${score}/10 — no failing check left${accepted ? ` (${accepted} accepted)` : ""}`;
134
+ const names = open.length > 6 ? `${open.slice(0, 6).map((c) => c.name).join(", ")}, …` : open.map((c) => c.name).join(", ");
135
+ return `${score}/10 — ${plural(open.length, "failing check")} (${names})${accepted ? `; ${accepted} accepted` : ""}`;
136
+ }
137
+ const HINTS = {
138
+ "Pinned-Dependencies": "Pin every GitHub Action by its full commit SHA, with the version as a trailing comment (`uses: actions/checkout@<40-hex-sha> # v4.2.2`); pin Docker base images by digest and install steps by hash or lockfile. Add Dependabot (`.github/dependabot.yml`, ecosystem `github-actions`) so the pins keep getting updated.",
139
+ "Token-Permissions": "Give every workflow a top-level `permissions: read-all` (or `contents: read`) and grant write scopes only on the single job that needs them.",
140
+ "Branch-Protection": "Needs a minimal ruleset on the default branch that blocks force-push and deletion. That takes repo admin in GitHub settings: do NOT run it yourself. Give the person the `gh api` command (a repository ruleset, or `PUT /repos/{owner}/{repo}/branches/{branch}/protection`) to run, and explain what it changes.",
141
+ "Signed-Releases": "Sign or attest the release assets (build-provenance attestation with `actions/attest-build-provenance`, or sigstore/cosign signatures uploaded next to each release asset).",
142
+ "SAST": "Add a CodeQL workflow (`github/codeql-action`) that runs on pull requests and pushes to the default branch.",
143
+ "Security-Policy": "Add a SECURITY.md saying how to report a vulnerability privately and what to expect in reply.",
144
+ "Binary-Artifacts": "Remove committed binaries (jars, executables, archives) or, where one must stay, say why it is there and where it comes from.",
145
+ "Dependency-Update-Tool": "Add `.github/dependabot.yml` (or a Renovate config) covering every ecosystem the repo uses, including `github-actions`.",
146
+ "Vulnerabilities": "Fix or upgrade the dependencies the details list; where an advisory cannot apply, document it in an osv-scanner config (`osv-scanner.toml` ignore with a reason).",
147
+ "Maintained": "Scored from recent commit and issue activity on the repo's age; usually only time fixes it. Say so rather than inventing activity.",
148
+ "CII-Best-Practices": "Needs a project page at bestpractices.dev, which only the maintainer can create and fill in; tell the person what it asks for.",
149
+ "License": "Add a recognised license file (LICENSE or COPYING) at the repo root with an OSI-approved license text.",
150
+ "Packaging": "Publish through a recognised packaging workflow (e.g. a GitHub Actions workflow that runs the registry's publish step); say which registry fits this repo.",
151
+ "CI-Tests": "Make sure pull requests run the test suite in CI and that the run is visible as a check.",
152
+ "Webhooks": "Webhooks must carry a secret; that is set in GitHub settings by a repo admin, so tell the person which webhook lacks one.",
153
+ };
154
+ /** The prompt a person taps to send the agent after one failing check. Pure; the phone may quote it. */
155
+ export function remedyPrompt(slug, c) {
156
+ const lines = [
157
+ `The public OpenSSF Scorecard for github.com/${slug} gives the check "${c.name}" ${c.score}/10.`,
158
+ `Reason: ${c.reason || "(none given)"}`,
159
+ ];
160
+ if (c.details.length)
161
+ lines.push("Details:", ...c.details.map((d) => `- ${d}`));
162
+ if (c.docUrl)
163
+ lines.push(`Documentation: ${c.docUrl}`);
164
+ const hint = own(HINTS, c.name);
165
+ if (hint)
166
+ lines.push("", `What usually fixes it: ${hint}`);
167
+ lines.push("", `Raise this one check in this repo. Change only what "${c.name}" needs, commit, and say plainly what you could not fix (and why, for example that it needs a repo admin or a person's account).`);
168
+ return lines.join("\n");
169
+ }
170
+ //# sourceMappingURL=logic.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logic.mjs","sourceRoot":"","sources":["../../../../../extensions/scorecard/shared/logic.mts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAqD,MAAM,YAAY,CAAC;AAE1G,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB,0GAA0G;AAC1G,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,MAAM,CAAC,GAAG,6HAA6H,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACzJ,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CA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KAAmK;IACtL,YAAY,EAAE,oIAAoI;IAClJ,oBAAoB,EAAE,gIAAgI;IACtJ,SAAS,EAAE,wGAAwG;IACnH,WAAW,EAAE,4JAA4J;IACzK,UAAU,EAAE,0FAA0F;IACtG,UAAU,EAAE,2HAA2H;CACxI,CAAC;AAEF,wGAAwG;AACxG,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,CAAa;IACtD,MAAM,KAAK,GAAG;QACZ,+CAA+C,IAAI,qBAAqB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,MAAM;QAChG,WAAW,CAAC,CAAC,MAAM,IAAI,cAAc,EAAE;KACxC,CAAC;IACF,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IAChF,IAAI,CAAC,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,0BAA0B,IAAI,EAAE,CAAC,CAAC;IAC3D,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,wDAAwD,CAAC,CAAC,IAAI,kIAAkI,CAAC,CAAC;IACjN,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,140 @@
1
+ /**
2
+ * The scorecard extension's wire: what the phone may ask the host half, typed once for both ends.
3
+ * Pure, no node imports — the host compiles it (`tsconfig.extensions.json`), the phone bundles it.
4
+ *
5
+ * The reading is the public OpenSSF Scorecard API (`api.securityscorecards.dev`) for the repo's
6
+ * GitHub remote: no credential, no model call. A repo with no GitHub remote, a private one, or one
7
+ * the API has not scored gets NO score — `absent` says why in a sentence, never a 0.
8
+ *
9
+ * Transport: the generic plugin channel on the one socket. Phone → host is `plugin.call`; host →
10
+ * phone is ONE tiny push, `changed` (`{ at, slug }`), after which the phone reads that repo again.
11
+ */
12
+ /** One Scorecard check as the API scored it. */
13
+ export interface ScoreCheck {
14
+ /** The API's check name, verbatim ("Pinned-Dependencies"). */
15
+ name: string;
16
+ /** 0–10; -1 = inconclusive / not applicable (the API's own value) — never failing. */
17
+ score: number;
18
+ /** The API's one-line reason ("dependency not pinned by hash detected -- score normalized to 6"). */
19
+ reason: string;
20
+ /** The API's details lines, capped by the host (≤ 20 lines, each ≤ 300 chars). */
21
+ details: string[];
22
+ /** The check's documentation page (the API's `documentation.url`), or null. */
23
+ docUrl: string | null;
24
+ /** The API's short description (`documentation.short`), or "". */
25
+ short: string;
26
+ }
27
+ /** Why a check that loses points is not counted: a person's reason, or one shipped built in. */
28
+ export interface ScoreAccept {
29
+ reason: string;
30
+ /** ISO time the accept was made (built-in: absent). */
31
+ at?: string;
32
+ /** The check's score when accepted. The accept lapses when the score later falls BELOW it. */
33
+ score?: number;
34
+ /** Shipped with waterplane (solo-unfixable), not typed by anyone; cannot be withdrawn. */
35
+ builtIn?: true;
36
+ }
37
+ /** A check as the sheet draws it: the reading plus whether it counts. */
38
+ export interface CheckView extends ScoreCheck {
39
+ /** 0 <= score < 10. */
40
+ failing: boolean;
41
+ /** Present when a failing check is accepted (and the accept has not lapsed). */
42
+ accepted?: ScoreAccept;
43
+ }
44
+ export interface ScoreView {
45
+ /** Repo id (the phone's `RepoTarget.id`) this answers for. */
46
+ repo: string;
47
+ /** `owner/name` on github.com that is scored, or null when the repo has no GitHub remote and none is set. */
48
+ slug: string | null;
49
+ /** Where `slug` came from: the `origin` remote (else the first GitHub remote), or a person's
50
+ * "scored as" (a private repo published through a public mirror — this repo's own case). */
51
+ slugFrom: "remote" | "set" | null;
52
+ /** The aggregate 0–10 as the API gives it, or null with `absent`. */
53
+ score: number | null;
54
+ /** Why there is no score, in a sentence ("private repo — Scorecard scores public repos only"). */
55
+ absent?: string;
56
+ /** The API's run date (ISO) and scored commit, when scored. */
57
+ date?: string;
58
+ commit?: string;
59
+ scorecardVersion?: string;
60
+ /** Every check, API order. Empty when absent. */
61
+ checks: CheckView[];
62
+ /** How many checks are failing and not accepted — the chip's number, and exactly what its tap opens. */
63
+ open: number;
64
+ /** When the host read the API (ms epoch), or null when it never has. */
65
+ readAt: number | null;
66
+ /** True when the repo is private and this reading was scored on the desktop with the scorecard CLI
67
+ * (not the public score); `date` is when. No `viewerUrl` then. */
68
+ local?: true;
69
+ /** The badge / public viewer page for the slug, when scored. */
70
+ viewerUrl?: string;
71
+ /** A sentence about something the host could not use (the accepts file does not parse, so no
72
+ * person's accept counts and none can be written). Shown on the sheet; absent when all is well. */
73
+ problem?: string;
74
+ }
75
+ /** Built-in accepts: checks a solo maintainer cannot pass. Keyed by the API's check name. */
76
+ export declare const BUILT_IN_ACCEPTS: Readonly<Record<string, string>>;
77
+ /** A read is reused this long before the host asks the API again. */
78
+ export declare const SCORE_FRESH_MS: number;
79
+ /** Whether a slug is public (unauthenticated GitHub API) is reused this long — 60 requests/hour per IP. */
80
+ export declare const VISIBILITY_FRESH_MS: number;
81
+ export declare const PUSH_CHANGED = "changed";
82
+ /** The setup row's check id. */
83
+ export declare const CHECK_ID = "scorecard";
84
+ /** A GitHub `owner/name`, as GitHub allows them. */
85
+ export declare const SLUG_RE: RegExp;
86
+ /** Longest accept reason the host keeps. */
87
+ export declare const REASON_MAX = 500;
88
+ export type ScorecardMethods = {
89
+ /** The cached view; starts a read in the background when stale (a `changed` push follows). */
90
+ read: {
91
+ args: {
92
+ repo: string;
93
+ };
94
+ result: ScoreView;
95
+ };
96
+ /** Read the API now, past the cache. */
97
+ refresh: {
98
+ args: {
99
+ repo: string;
100
+ };
101
+ result: ScoreView;
102
+ };
103
+ /** Accept a failing check with a reason (non-empty, ≤ REASON_MAX). */
104
+ accept: {
105
+ args: {
106
+ repo: string;
107
+ check: string;
108
+ reason: string;
109
+ };
110
+ result: ScoreView;
111
+ };
112
+ /** Withdraw a person's accept (a built-in one is refused in words). */
113
+ unaccept: {
114
+ args: {
115
+ repo: string;
116
+ check: string;
117
+ };
118
+ result: ScoreView;
119
+ };
120
+ /** Score this repo as another public `owner/name` (a mirror), or null to go back to the remote. */
121
+ scoredAs: {
122
+ args: {
123
+ repo: string;
124
+ slug: string | null;
125
+ };
126
+ result: ScoreView;
127
+ };
128
+ /** Put the check's remedy prompt in the repo's backlog — waits for a tap, never fires. */
129
+ remedy: {
130
+ args: {
131
+ repo: string;
132
+ check: string;
133
+ };
134
+ result: {
135
+ intentId: string;
136
+ existing: boolean;
137
+ state?: string;
138
+ };
139
+ };
140
+ };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The scorecard extension's wire: what the phone may ask the host half, typed once for both ends.
3
+ * Pure, no node imports — the host compiles it (`tsconfig.extensions.json`), the phone bundles it.
4
+ *
5
+ * The reading is the public OpenSSF Scorecard API (`api.securityscorecards.dev`) for the repo's
6
+ * GitHub remote: no credential, no model call. A repo with no GitHub remote, a private one, or one
7
+ * the API has not scored gets NO score — `absent` says why in a sentence, never a 0.
8
+ *
9
+ * Transport: the generic plugin channel on the one socket. Phone → host is `plugin.call`; host →
10
+ * phone is ONE tiny push, `changed` (`{ at, slug }`), after which the phone reads that repo again.
11
+ */
12
+ /** Built-in accepts: checks a solo maintainer cannot pass. Keyed by the API's check name. */
13
+ export const BUILT_IN_ACCEPTS = {
14
+ "Code-Review": "Solo maintainer: needs a second person approving changes; self-merged pull requests do not count.",
15
+ "Contributors": "Solo maintainer: needs contributors from several organisations.",
16
+ "Fuzzing": "No fuzzing integration (OSS-Fuzz, ClusterFuzzLite) for this project; accepted for a solo project.",
17
+ };
18
+ /** A read is reused this long before the host asks the API again. */
19
+ export const SCORE_FRESH_MS = 6 * 60 * 60_000;
20
+ /** Whether a slug is public (unauthenticated GitHub API) is reused this long — 60 requests/hour per IP. */
21
+ export const VISIBILITY_FRESH_MS = 24 * 60 * 60_000;
22
+ export const PUSH_CHANGED = "changed";
23
+ /** The setup row's check id. */
24
+ export const CHECK_ID = "scorecard";
25
+ /** A GitHub `owner/name`, as GitHub allows them. */
26
+ export const SLUG_RE = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9._-]{1,100}$/;
27
+ /** Longest accept reason the host keeps. */
28
+ export const REASON_MAX = 500;
29
+ //# sourceMappingURL=wire.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wire.mjs","sourceRoot":"","sources":["../../../../../extensions/scorecard/shared/wire.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAqEH,6FAA6F;AAC7F,MAAM,CAAC,MAAM,gBAAgB,GAAqC;IAChE,aAAa,EAAE,mGAAmG;IAClH,cAAc,EAAE,iEAAiE;IACjF,SAAS,EAAE,mGAAmG;CAC/G,CAAC;AAEF,qEAAqE;AACrE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;AAC9C,2GAA2G;AAC3G,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AACtC,gCAAgC;AAChC,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAC;AACpC,oDAAoD;AACpD,MAAM,CAAC,MAAM,OAAO,GAAG,4DAA4D,CAAC;AACpF,4CAA4C;AAC5C,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAC"}
@@ -133,12 +133,8 @@ export declare function statInTree(worktree: string, relPath: string, opts?: Tre
133
133
  mtime: number;
134
134
  } | null;
135
135
  export declare function readInTree(worktree: string, relPath: string, opts?: TreeReadOpts): Buffer | null;
136
- /**
137
- * Walk a worktree (or just the outbox) for viewable artifacts, newest first.
138
- * `scope`: "outbox" = the outbox dirs in OUTBOX_SUBDIRS (.claude/outbox + .outbox),
139
- * else the whole tree minus SKIP_DIRS and the inbox.
140
- */
141
- export declare function discoverArtifacts(worktree: string, opts?: {
136
+ /** Options both artifact walks take. */
137
+ export interface ArtifactWalkOpts {
142
138
  scope?: "repo" | "outbox";
143
139
  sinceSeconds?: number;
144
140
  limit?: number;
@@ -148,19 +144,25 @@ export declare function discoverArtifacts(worktree: string, opts?: {
148
144
  kind?: ArtifactKind;
149
145
  /** Include the .claude/inbox dir in a "repo" scope walk (search wants it). */
150
146
  includeInbox?: boolean;
151
- }): {
147
+ }
148
+ /**
149
+ * Walk a worktree (or just the outbox) for viewable artifacts, newest first.
150
+ * `scope`: "outbox" = the outbox dirs in OUTBOX_SUBDIRS (.claude/outbox + .outbox),
151
+ * else the whole tree minus SKIP_DIRS and the inbox. Blocks the loop for the
152
+ * whole walk — its callers are outbox-scope; a repo-scope caller wants
153
+ * `discoverArtifactsAsync`.
154
+ */
155
+ export declare function discoverArtifacts(worktree: string, opts?: ArtifactWalkOpts): {
152
156
  files: FileEntry[];
153
157
  truncated: boolean;
154
158
  };
155
159
  /**
156
160
  * `discoverArtifacts` without holding the event loop: the same walk, the same filters, the same
157
161
  * answer — for every REPO-scope caller (the cross-repo search, a session's image and auto-pull
158
- * baselines). The sync walk `stat`s every entry of the whole tree in one go; on WSL reading a
159
- * Windows drive (9P, ~20 ms a call, far worse while `git status` runs) one search over 36 repos
160
- * froze the host for minutes. Here an entry's kind comes from the directory listing and only a
161
- * symlink or a file the filter wants is `stat`ed, every call awaited.
162
+ * baselines). On WSL reading a Windows drive one search over 36 repos walked synchronously froze
163
+ * the host for minutes; here every disk call is awaited.
162
164
  */
163
- export declare function discoverArtifactsAsync(worktree: string, opts?: Parameters<typeof discoverArtifacts>[1]): Promise<{
165
+ export declare function discoverArtifactsAsync(worktree: string, opts?: ArtifactWalkOpts): Promise<{
164
166
  files: FileEntry[];
165
167
  truncated: boolean;
166
168
  }>;
@@ -484,11 +484,15 @@ export function readInTree(worktree, relPath, opts = {}) {
484
484
  }
485
485
  }
486
486
  /**
487
- * Walk a worktree (or just the outbox) for viewable artifacts, newest first.
488
- * `scope`: "outbox" = the outbox dirs in OUTBOX_SUBDIRS (.claude/outbox + .outbox),
489
- * else the whole tree minus SKIP_DIRS and the inbox.
487
+ * The artifact walk, ONCE — `discoverArtifacts` drives it with sync calls and
488
+ * `discoverArtifactsAsync` with awaited ones, so the walk, its filters and its
489
+ * containment rule cannot drift apart. It never touches the disk itself: each
490
+ * `yield` is a question (`readdir` → `Dirent[]`, `stat` → stats, `null` on
491
+ * failure). An entry's kind comes from the directory listing; only a symlink or
492
+ * a file the filter wants is `stat`ed — on WSL reading a Windows drive (9P,
493
+ * ~20 ms a call) a `stat` of every entry froze the host for minutes.
490
494
  */
491
- export function discoverArtifacts(worktree, opts = {}) {
495
+ function* artifactWalk(worktree, opts) {
492
496
  const scope = opts.scope ?? "repo";
493
497
  const limit = Math.min(opts.limit ?? 300, 1000);
494
498
  const cutoff = opts.sinceSeconds ? Date.now() - opts.sinceSeconds * 1000 : 0;
@@ -508,118 +512,41 @@ export function discoverArtifacts(worktree, opts = {}) {
508
512
  const nestedFull = join(root, NESTED_WORKTREES);
509
513
  while (stack.length) {
510
514
  const dir = stack.pop();
511
- let entries;
512
- try {
513
- entries = readdirSync(dir);
514
- }
515
- catch {
515
+ const entries = (yield { readdir: dir });
516
+ if (!entries)
516
517
  continue;
517
- }
518
- for (const name of entries) {
519
- const full = join(dir, name);
520
- let st;
521
- try {
522
- // A link that leaves the worktree is neither walked nor listed: a committed
523
- // `docs/home -> ~` would otherwise list every picture under the home directory.
524
- if (lstatSync(full).isSymbolicLink() && containedReal(root, relative(root, full)) === null)
525
- continue;
526
- st = statSync(full);
527
- }
528
- catch {
529
- continue;
530
- }
531
- if (st.isDirectory()) {
532
- if (SKIP_DIRS.has(name))
533
- continue;
534
- if (scope === "repo" && !opts.includeInbox && full === inboxFull)
535
- continue; // inbox is phone→repo
536
- if (full === nestedFull)
537
- continue; // other checkouts, not this tree's files
538
- stack.push(full);
539
- }
540
- else if (st.isFile() && allow.has(extname(name).toLowerCase())) {
541
- if (cutoff && st.mtimeMs < cutoff)
542
- continue;
543
- if (q && !name.toLowerCase().includes(q))
544
- continue;
545
- out.push({ name, relPath: relative(root, full).split(sep).join("/"), size: st.size, mtime: st.mtimeMs, ctime: birthMs(st) });
546
- }
547
- }
548
- }
549
- out.sort((a, b) => b.mtime - a.mtime);
550
- const truncated = out.length > limit;
551
- return { files: out.slice(0, limit), truncated };
552
- }
553
- /**
554
- * `discoverArtifacts` without holding the event loop: the same walk, the same filters, the same
555
- * answer — for every REPO-scope caller (the cross-repo search, a session's image and auto-pull
556
- * baselines). The sync walk `stat`s every entry of the whole tree in one go; on WSL reading a
557
- * Windows drive (9P, ~20 ms a call, far worse while `git status` runs) one search over 36 repos
558
- * froze the host for minutes. Here an entry's kind comes from the directory listing and only a
559
- * symlink or a file the filter wants is `stat`ed, every call awaited.
560
- */
561
- export async function discoverArtifactsAsync(worktree, opts = {}) {
562
- const scope = opts.scope ?? "repo";
563
- const limit = Math.min(opts.limit ?? 300, 1000);
564
- const cutoff = opts.sinceSeconds ? Date.now() - opts.sinceSeconds * 1000 : 0;
565
- const allow = kindExt(opts.kind, scope);
566
- const q = opts.query?.trim().toLowerCase() || "";
567
- const root = resolve(worktree);
568
- const starts = scope === "outbox"
569
- ? OUTBOX_SUBDIRS.map((sub) => transportDir(worktree, sub)).filter((d) => d !== null && existsSync(d))
570
- : (existsSync(root) ? [root] : []);
571
- if (!starts.length)
572
- return { files: [], truncated: false };
573
- const out = [];
574
- const stack = [...starts];
575
- const inboxFull = inboxDir(worktree);
576
- const nestedFull = join(root, NESTED_WORKTREES);
577
- while (stack.length) {
578
- const dir = stack.pop();
579
- let entries;
580
- try {
581
- entries = await readdirAsync(dir, { withFileTypes: true });
582
- }
583
- catch {
584
- continue;
585
- }
586
518
  for (const e of entries) {
587
519
  const name = e.name;
588
520
  const full = join(dir, name);
589
521
  let isDir = e.isDirectory();
590
522
  let isFile = e.isFile();
591
523
  if (e.isSymbolicLink()) {
592
- // Followed like the sync walk — only while its target stays in the worktree.
524
+ // A link that leaves the worktree is neither walked nor listed: a committed
525
+ // `docs/home -> ~` would otherwise list every picture under the home directory.
526
+ // One that stays inside is followed.
593
527
  if (containedReal(root, relative(root, full)) === null)
594
528
  continue;
595
- try {
596
- const st = await statAsync(full);
597
- isDir = st.isDirectory();
598
- isFile = st.isFile();
599
- }
600
- catch {
529
+ const st = (yield { stat: full });
530
+ if (!st)
601
531
  continue;
602
- }
532
+ isDir = st.isDirectory();
533
+ isFile = st.isFile();
603
534
  }
604
535
  if (isDir) {
605
536
  if (SKIP_DIRS.has(name))
606
537
  continue;
607
538
  if (scope === "repo" && !opts.includeInbox && full === inboxFull)
608
- continue;
539
+ continue; // inbox is phone→repo
609
540
  if (full === nestedFull)
610
- continue;
541
+ continue; // other checkouts, not this tree's files
611
542
  stack.push(full);
612
543
  }
613
544
  else if (isFile && allow.has(extname(name).toLowerCase())) {
614
545
  if (q && !name.toLowerCase().includes(q))
615
546
  continue;
616
- let st;
617
- try {
618
- st = await statAsync(full);
619
- }
620
- catch {
547
+ const st = (yield { stat: full });
548
+ if (!st)
621
549
  continue;
622
- }
623
550
  if (cutoff && st.mtimeMs < cutoff)
624
551
  continue;
625
552
  out.push({ name, relPath: relative(root, full).split(sep).join("/"), size: st.size, mtime: st.mtimeMs, ctime: birthMs(st) });
@@ -630,6 +557,49 @@ export async function discoverArtifactsAsync(worktree, opts = {}) {
630
557
  const truncated = out.length > limit;
631
558
  return { files: out.slice(0, limit), truncated };
632
559
  }
560
+ function answerSync(ask) {
561
+ try {
562
+ return "readdir" in ask ? readdirSync(ask.readdir, { withFileTypes: true }) : statSync(ask.stat);
563
+ }
564
+ catch {
565
+ return null;
566
+ }
567
+ }
568
+ async function answerAsync(ask) {
569
+ try {
570
+ return "readdir" in ask ? await readdirAsync(ask.readdir, { withFileTypes: true }) : await statAsync(ask.stat);
571
+ }
572
+ catch {
573
+ return null;
574
+ }
575
+ }
576
+ /**
577
+ * Walk a worktree (or just the outbox) for viewable artifacts, newest first.
578
+ * `scope`: "outbox" = the outbox dirs in OUTBOX_SUBDIRS (.claude/outbox + .outbox),
579
+ * else the whole tree minus SKIP_DIRS and the inbox. Blocks the loop for the
580
+ * whole walk — its callers are outbox-scope; a repo-scope caller wants
581
+ * `discoverArtifactsAsync`.
582
+ */
583
+ export function discoverArtifacts(worktree, opts = {}) {
584
+ const walk = artifactWalk(worktree, opts);
585
+ let step = walk.next();
586
+ while (!step.done)
587
+ step = walk.next(answerSync(step.value));
588
+ return step.value;
589
+ }
590
+ /**
591
+ * `discoverArtifacts` without holding the event loop: the same walk, the same filters, the same
592
+ * answer — for every REPO-scope caller (the cross-repo search, a session's image and auto-pull
593
+ * baselines). On WSL reading a Windows drive one search over 36 repos walked synchronously froze
594
+ * the host for minutes; here every disk call is awaited.
595
+ */
596
+ export async function discoverArtifactsAsync(worktree, opts = {}) {
597
+ const walk = artifactWalk(worktree, opts);
598
+ let step = walk.next();
599
+ while (!step.done)
600
+ step = walk.next(await answerAsync(step.value));
601
+ return step.value;
602
+ }
633
603
  /**
634
604
  * Every file in a transport directory — **not** the gallery's viewable subset.
635
605
  *