nolzu 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/LICENSE +105 -0
  2. package/README.md +24 -7
  3. package/build/client/_app/immutable/assets/0.SPD4wYkc.css +1 -0
  4. package/build/client/_app/immutable/assets/1.BRilEoOO.css +1 -0
  5. package/build/client/_app/immutable/assets/10.DwLiBGDj.css +1 -0
  6. package/build/client/_app/immutable/assets/11.D_TtWT3D.css +1 -0
  7. package/build/client/_app/immutable/assets/12.CSVGmtUY.css +1 -0
  8. package/build/client/_app/immutable/assets/13.qTa7IHbg.css +1 -0
  9. package/build/client/_app/immutable/assets/19.CbCFXKb8.css +1 -0
  10. package/build/client/_app/immutable/assets/2.CfHhgI77.css +1 -0
  11. package/build/client/_app/immutable/assets/20.C5CSZhyT.css +1 -0
  12. package/build/client/_app/immutable/assets/21.BBpYkZcc.css +1 -0
  13. package/build/client/_app/immutable/assets/22.C9RgY9kl.css +1 -0
  14. package/build/client/_app/immutable/assets/23.B6Dp9RJO.css +1 -0
  15. package/build/client/_app/immutable/assets/24.C7g2abUW.css +1 -0
  16. package/build/client/_app/immutable/assets/26.DTMI6ROV.css +1 -0
  17. package/build/client/_app/immutable/assets/27.AxXMpDkB.css +1 -0
  18. package/build/client/_app/immutable/assets/28.939ac-98.css +1 -0
  19. package/build/client/_app/immutable/assets/3.3lqex1t-.css +1 -0
  20. package/build/client/_app/immutable/assets/4.C52MzO_d.css +1 -0
  21. package/build/client/_app/immutable/assets/5.CsfJAwvS.css +1 -0
  22. package/build/client/_app/immutable/assets/8.ByspUp-s.css +1 -0
  23. package/build/client/_app/immutable/assets/9.BCSFZmce.css +1 -0
  24. package/build/client/_app/immutable/assets/Banner.DDqfpWLD.css +1 -0
  25. package/build/client/_app/immutable/assets/BoardOff.mpX08-Be.css +1 -0
  26. package/build/client/_app/immutable/assets/Button.BlwsEgUc.css +1 -0
  27. package/build/client/_app/immutable/assets/Chip.qAAa6_e5.css +1 -0
  28. package/build/client/_app/immutable/assets/Dialog.D5Ln60a8.css +1 -0
  29. package/build/client/_app/immutable/assets/FeaturePanels.DZ_Mth5M.css +1 -0
  30. package/build/client/_app/immutable/assets/FolderBrowser.DBmRWDCH.css +1 -0
  31. package/build/client/_app/immutable/assets/Geist-Variable.Bj2R_7yk.woff2 +0 -0
  32. package/build/client/_app/immutable/assets/GeistMono-Variable.Dispecij.woff2 +0 -0
  33. package/build/client/_app/immutable/assets/HelpTip.DF6T9nns.css +1 -0
  34. package/build/client/_app/immutable/assets/InfoBox.CpavOykF.css +1 -0
  35. package/build/client/_app/immutable/assets/KeyCaps.D2t-lY-8.css +1 -0
  36. package/build/client/_app/immutable/assets/LogLine.Bu4feLn5.css +1 -0
  37. package/build/client/_app/immutable/assets/Markdown.DI6AtWAc.css +1 -0
  38. package/build/client/_app/immutable/assets/ModelPicker.DQzj7Nj8.css +1 -0
  39. package/build/client/_app/immutable/assets/OptionButtons.BYiyOXOE.css +1 -0
  40. package/build/client/_app/immutable/assets/PeekPanel.DzMdHoqg.css +1 -0
  41. package/build/client/_app/immutable/assets/ScoutPage.CVIiLy5c.css +1 -0
  42. package/build/client/_app/immutable/assets/SetupSteps.B6pZP1Bk.css +1 -0
  43. package/build/client/_app/immutable/assets/Skeleton.BC-1_U5d.css +1 -0
  44. package/build/client/_app/immutable/assets/SlotsMeter.Dq7GGYlD.css +1 -0
  45. package/build/client/_app/immutable/assets/StartConfirm.DxNN2AOb.css +1 -0
  46. package/build/client/_app/immutable/assets/StatePill.CGWFVUUg.css +1 -0
  47. package/build/client/_app/immutable/assets/Streamed.DpZ6wgO2.css +1 -0
  48. package/build/client/_app/immutable/assets/card-pulls.C5uGMuAh.css +1 -0
  49. package/build/client/_app/immutable/assets/next-step.CKg1w06J.css +1 -0
  50. package/build/client/_app/immutable/chunks/-B5EclhK.js +1 -0
  51. package/build/client/_app/immutable/chunks/-Q3zApAy.js +1 -0
  52. package/build/client/_app/immutable/chunks/6-hwN_Ik.js +3 -0
  53. package/build/client/_app/immutable/chunks/B16UF4PA.js +11 -0
  54. package/build/client/_app/immutable/chunks/B1V3h1VF.js +1 -0
  55. package/build/client/_app/immutable/chunks/B2d2Mkuz.js +68 -0
  56. package/build/client/_app/immutable/chunks/B2yzhiEa.js +1 -0
  57. package/build/client/_app/immutable/chunks/B5zDDQUU.js +2 -0
  58. package/build/client/_app/immutable/chunks/B8DHSiWf.js +1 -0
  59. package/build/client/_app/immutable/chunks/B8z33EzI.js +1 -0
  60. package/build/client/_app/immutable/chunks/BCRkrH6c.js +1 -0
  61. package/build/client/_app/immutable/chunks/BCScjOxu.js +1 -0
  62. package/build/client/_app/immutable/chunks/BMUQtCEC.js +1 -0
  63. package/build/client/_app/immutable/chunks/BNnfkvZM.js +1 -0
  64. package/build/client/_app/immutable/chunks/BelWyZaW.js +1 -0
  65. package/build/client/_app/immutable/chunks/BhZpqODT.js +1 -0
  66. package/build/client/_app/immutable/chunks/Bjy-W4x2.js +81 -0
  67. package/build/client/_app/immutable/chunks/BmafI-Bs.js +1 -0
  68. package/build/client/_app/immutable/chunks/BvRk9kiK.js +0 -0
  69. package/build/client/_app/immutable/chunks/C4i6bdQg.js +1 -0
  70. package/build/client/_app/immutable/chunks/C8u5TyIB.js +1 -0
  71. package/build/client/_app/immutable/chunks/CFs2xhoy.js +1 -0
  72. package/build/client/_app/immutable/chunks/CIm2DioU.js +1 -0
  73. package/build/client/_app/immutable/chunks/CONqGBXC.js +1 -0
  74. package/build/client/_app/immutable/chunks/CSOz40qO.js +1 -0
  75. package/build/client/_app/immutable/chunks/CXxuD1ef.js +3 -0
  76. package/build/client/_app/immutable/chunks/CarrGsZA.js +2 -0
  77. package/build/client/_app/immutable/chunks/CdrmTD44.js +1 -0
  78. package/build/client/_app/immutable/chunks/CfJRH9gh.js +2 -0
  79. package/build/client/_app/immutable/chunks/Ci7C9Cki.js +1 -0
  80. package/build/client/_app/immutable/chunks/CkOTL1vK.js +1 -0
  81. package/build/client/_app/immutable/chunks/CngTtGc_.js +1 -0
  82. package/build/client/_app/immutable/chunks/Cp3A1zR8.js +1 -0
  83. package/build/client/_app/immutable/chunks/CwtMnwNL.js +3 -0
  84. package/build/client/_app/immutable/chunks/Cy7f_oXg.js +1 -0
  85. package/build/client/_app/immutable/chunks/D-wwLm5t.js +1 -0
  86. package/build/client/_app/immutable/chunks/D2imbgaf.js +1 -0
  87. package/build/client/_app/immutable/chunks/D32mip60.js +1 -0
  88. package/build/client/_app/immutable/chunks/D46Vk19W.js +1 -0
  89. package/build/client/_app/immutable/chunks/DCUUgo-6.js +1 -0
  90. package/build/client/_app/immutable/chunks/DFjnjJjy.js +1 -0
  91. package/build/client/_app/immutable/chunks/DHMbSbMg.js +1 -0
  92. package/build/client/_app/immutable/chunks/DJOFx2wx.js +1 -0
  93. package/build/client/_app/immutable/chunks/DV4tvxHp.js +3 -0
  94. package/build/client/_app/immutable/chunks/DXk_5YEw.js +1 -0
  95. package/build/client/_app/immutable/chunks/DjgnRLJt.js +1 -0
  96. package/build/client/_app/immutable/chunks/DlWlQ_vP.js +1 -0
  97. package/build/client/_app/immutable/chunks/DpIAei2y.js +2 -0
  98. package/build/client/_app/immutable/chunks/Dt-HX3Vu.js +1 -0
  99. package/build/client/_app/immutable/chunks/DuSthUWX.js +1 -0
  100. package/build/client/_app/immutable/chunks/Ecfl8TOn.js +2 -0
  101. package/build/client/_app/immutable/chunks/ITHE99Aa.js +1 -0
  102. package/build/client/_app/immutable/chunks/Khdge0KS.js +1 -0
  103. package/build/client/_app/immutable/chunks/LMEKNlm0.js +1 -0
  104. package/build/client/_app/immutable/chunks/OnIeaiuO.js +1 -0
  105. package/build/client/_app/immutable/chunks/VFQLu55q.js +1 -0
  106. package/build/client/_app/immutable/chunks/ZsUxKnQw.js +1 -0
  107. package/build/client/_app/immutable/chunks/aWP8DVhV.js +1 -0
  108. package/build/client/_app/immutable/chunks/bB04Xp1f.js +1 -0
  109. package/build/client/_app/immutable/chunks/eylBqhv8.js +3 -0
  110. package/build/client/_app/immutable/chunks/hx0ssLL_.js +2 -0
  111. package/build/client/_app/immutable/chunks/mumDj17t.js +1 -0
  112. package/build/client/_app/immutable/chunks/pZYp3_TE.js +1 -0
  113. package/build/client/_app/immutable/chunks/tImwjqWn.js +1 -0
  114. package/build/client/_app/immutable/chunks/uBIymjUX.js +1 -0
  115. package/build/client/_app/immutable/chunks/xihTtKlq.js +1 -0
  116. package/build/client/_app/immutable/entry/app.DVZ1wE36.js +2 -0
  117. package/build/client/_app/immutable/entry/start.DluCc61B.js +1 -0
  118. package/build/client/_app/immutable/nodes/0.CwNFevXf.js +1 -0
  119. package/build/client/_app/immutable/nodes/1.BR6FYiC-.js +1 -0
  120. package/build/client/_app/immutable/nodes/10.wNwBFtom.js +2 -0
  121. package/build/client/_app/immutable/nodes/11.DpoIbMNF.js +2 -0
  122. package/build/client/_app/immutable/nodes/12.CWdUJ8l3.js +2 -0
  123. package/build/client/_app/immutable/nodes/13.CZ2uTvNS.js +1 -0
  124. package/build/client/_app/immutable/nodes/14.CzgyXuvL.js +1 -0
  125. package/build/client/_app/immutable/nodes/15.CzgyXuvL.js +1 -0
  126. package/build/client/_app/immutable/nodes/16.odL9eB2N.js +1 -0
  127. package/build/client/_app/immutable/nodes/17.B-RnUeVU.js +1 -0
  128. package/build/client/_app/immutable/nodes/18.BLYKxyq2.js +1 -0
  129. package/build/client/_app/immutable/nodes/19.CgyFfPqF.js +3 -0
  130. package/build/client/_app/immutable/nodes/2.CCWT41Qr.js +1 -0
  131. package/build/client/_app/immutable/nodes/20.BBk5-krg.js +1 -0
  132. package/build/client/_app/immutable/nodes/21.CJoU3s1A.js +2 -0
  133. package/build/client/_app/immutable/nodes/22.CoRvPh8m.js +1 -0
  134. package/build/client/_app/immutable/nodes/23.zXO3NjnM.js +3 -0
  135. package/build/client/_app/immutable/nodes/24.CmO27TED.js +1 -0
  136. package/build/client/_app/immutable/nodes/26.TVKNr_xX.js +18 -0
  137. package/build/client/_app/immutable/nodes/27.RojtGU_o.js +1 -0
  138. package/build/client/_app/immutable/nodes/28.CVTdeeSI.js +2 -0
  139. package/build/client/_app/immutable/nodes/3.Cgib7Vi6.js +1 -0
  140. package/build/client/_app/immutable/nodes/4.CnMwOCec.js +1 -0
  141. package/build/client/_app/immutable/nodes/5.-NqYtQj_.js +1 -0
  142. package/build/client/_app/immutable/nodes/6.D5xk-UBM.js +1 -0
  143. package/build/client/_app/immutable/nodes/7.IL4b-DII.js +1 -0
  144. package/build/client/_app/immutable/nodes/8.DJrguHjO.js +11 -0
  145. package/build/client/_app/immutable/nodes/9.DTUSzWiK.js +1 -0
  146. package/build/client/_app/version.json +1 -0
  147. package/build/client/favicon.svg +7 -0
  148. package/build/env.js +70 -0
  149. package/build/handler.js +26 -0
  150. package/build/index.js +149 -0
  151. package/build/server/chunks/chunks/Banner.js-D4mtxUfF.js +17 -0
  152. package/build/server/chunks/chunks/BoardOff.js-Dg5-LoR3.js +1627 -0
  153. package/build/server/chunks/chunks/Button.js-Buh9rnpu.js +43 -0
  154. package/build/server/chunks/chunks/Chip.js-xZ7vFkHx.js +12 -0
  155. package/build/server/chunks/chunks/Dialog.js-CGpwdpM-.js +60 -0
  156. package/build/server/chunks/chunks/FeaturePanels.js-B2sKozgF.js +84 -0
  157. package/build/server/chunks/chunks/FolderBrowser.js-DUHFhDaX.js +28 -0
  158. package/build/server/chunks/chunks/HelpTip.js-CzemvmjC.js +19 -0
  159. package/build/server/chunks/chunks/InfoBox.js-BJiVzZgw.js +10 -0
  160. package/build/server/chunks/chunks/KeyCaps.js-BMI2Hrh2.js +37 -0
  161. package/build/server/chunks/chunks/LogLine.js-2b7uX__H.js +35 -0
  162. package/build/server/chunks/chunks/Markdown.js-Clud88KU.js +4233 -0
  163. package/build/server/chunks/chunks/ModelPicker.js-FuBgyKIA.js +141 -0
  164. package/build/server/chunks/chunks/OptionButtons.js-LQKrAwUX.js +28 -0
  165. package/build/server/chunks/chunks/PeekPanel.js-aZ-r_v3N.js +375 -0
  166. package/build/server/chunks/chunks/ScoutPage.js-2DcNia96.js +733 -0
  167. package/build/server/chunks/chunks/SetupSteps.js-D7TAF7xa.js +66 -0
  168. package/build/server/chunks/chunks/Skeleton.js-diCP2sd5.js +30 -0
  169. package/build/server/chunks/chunks/SlotsMeter.js-BV_sAGf5.js +18 -0
  170. package/build/server/chunks/chunks/StartConfirm.js-CzEdFtbO.js +124 -0
  171. package/build/server/chunks/chunks/StatePill.js-CM7-HXNM.js +27 -0
  172. package/build/server/chunks/chunks/Streamed.js-_NgwNMMs.js +43 -0
  173. package/build/server/chunks/chunks/_page.server.js-BaGoctEY.js +1419 -0
  174. package/build/server/chunks/chunks/activity.js-CSoPUQLq.js +84 -0
  175. package/build/server/chunks/chunks/add-repo.js-DtHEobfm.js +305 -0
  176. package/build/server/chunks/chunks/app-header.js-CCflgeEQ.js +13 -0
  177. package/build/server/chunks/chunks/app.js-CuPn8jtk.js +12 -0
  178. package/build/server/chunks/chunks/bin.js-Cyb2cYLc.js +58 -0
  179. package/build/server/chunks/chunks/board-keys.js-CW3qw-MC.js +32 -0
  180. package/build/server/chunks/chunks/board-page.js-D0tdsE9J.js +860 -0
  181. package/build/server/chunks/chunks/board.js-BxL3CjB1.js +203 -0
  182. package/build/server/chunks/chunks/browser-test.js-DJEpOoVz.js +170 -0
  183. package/build/server/chunks/chunks/card-pulls.js-d_uGmBB3.js +229 -0
  184. package/build/server/chunks/chunks/card-repos.js-QaMCxiyV.js +59 -0
  185. package/build/server/chunks/chunks/chain-store.js-D42m8DUo.js +91 -0
  186. package/build/server/chunks/chunks/chain.js-CJFRywIC.js +52 -0
  187. package/build/server/chunks/chunks/changes.js-D8ITRMgU.js +513 -0
  188. package/build/server/chunks/chunks/checkout.js-Ys5L_gA4.js +319 -0
  189. package/build/server/chunks/chunks/client.js-B7jIMDuS.js +68 -0
  190. package/build/server/chunks/chunks/clipboard.js-qXskOBim.js +12 -0
  191. package/build/server/chunks/chunks/cloud-status.js-hy-9zUVX.js +95 -0
  192. package/build/server/chunks/chunks/coach.js-BhNB14rV.js +296 -0
  193. package/build/server/chunks/chunks/comments.js-1nWJQptB.js +311 -0
  194. package/build/server/chunks/chunks/commit-message.js-CMcNZUZw.js +8 -0
  195. package/build/server/chunks/chunks/create-card.js-DKtprMG6.js +498 -0
  196. package/build/server/chunks/chunks/db.js-pqoVpAzG.js +80 -0
  197. package/build/server/chunks/chunks/diff-comments.js-BSCuay_U.js +95 -0
  198. package/build/server/chunks/chunks/discussion.js-rJ5OMfvX.js +355 -0
  199. package/build/server/chunks/chunks/display.js-Bf-vGQ7Q.js +61 -0
  200. package/build/server/chunks/chunks/elapsed.js-DikkNhaD.js +27 -0
  201. package/build/server/chunks/chunks/engine.js-DS5zUwsE.js +115 -0
  202. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
  203. package/build/server/chunks/chunks/estimate.js-BHTYVTaQ.js +2484 -0
  204. package/build/server/chunks/chunks/evidence-timeline.js-Dk0dTZIy.js +253 -0
  205. package/build/server/chunks/chunks/evidence.js-CT3tWdbB.js +257 -0
  206. package/build/server/chunks/chunks/exports.js-Hn-WQRMB.js +150 -0
  207. package/build/server/chunks/chunks/features.svelte.js-DNsFmFZb.js +10 -0
  208. package/build/server/chunks/chunks/files.js-V46lE0-6.js +46 -0
  209. package/build/server/chunks/chunks/filter.js-CsmCtJMd.js +11 -0
  210. package/build/server/chunks/chunks/forms.js-03E8qnFz.js +35 -0
  211. package/build/server/chunks/chunks/gate.js-Cbqo8Yy0.js +82 -0
  212. package/build/server/chunks/chunks/getting-started.js-DKbHofN5.js +55 -0
  213. package/build/server/chunks/chunks/git.js-l43vBHqs.js +16 -0
  214. package/build/server/chunks/chunks/home-path.js-BXgrl3TP.js +11 -0
  215. package/build/server/chunks/chunks/hub-link.js-B5kjLyyd.js +1532 -0
  216. package/build/server/chunks/chunks/internal.js-DaSBO6jY.js +1239 -0
  217. package/build/server/chunks/chunks/internal2.js-D6AKyUgY.js +27 -0
  218. package/build/server/chunks/chunks/knowledge-page.js-D2ALB3v9.js +292 -0
  219. package/build/server/chunks/chunks/knowledge-revert.js-2eyN9Lcb.js +109 -0
  220. package/build/server/chunks/chunks/knowledge.js--eAgdzNx.js +394 -0
  221. package/build/server/chunks/chunks/last-board.js-BemeiK3t.js +23 -0
  222. package/build/server/chunks/chunks/log.js-R2zUph6T.js +228 -0
  223. package/build/server/chunks/chunks/loop.js-D3guWKLp.js +4038 -0
  224. package/build/server/chunks/chunks/loop2.js-B_Qd2m4y.js +67 -0
  225. package/build/server/chunks/chunks/navigation.js-DQJMz-SM.js +2 -0
  226. package/build/server/chunks/chunks/new-project.js-DNcr9JpB.js +305 -0
  227. package/build/server/chunks/chunks/next-step.js-B8Kl0Iv9.js +522 -0
  228. package/build/server/chunks/chunks/node.js-Bz2jT5wt.js +3381 -0
  229. package/build/server/chunks/chunks/now-live.svelte.js-hIaDgjJ3.js +13 -0
  230. package/build/server/chunks/chunks/now-snapshot.js-zGKLIzox.js +207 -0
  231. package/build/server/chunks/chunks/now.js-Dfm-o0Ha.js +765 -0
  232. package/build/server/chunks/chunks/onboard.js-LBqPOxyU.js +1525 -0
  233. package/build/server/chunks/chunks/ordinal.js-Bm_9QEBD.js +12 -0
  234. package/build/server/chunks/chunks/overview.js-C32iHkXD.js +1108 -0
  235. package/build/server/chunks/chunks/page-keys.svelte.js-D8vXA_8Z.js +14 -0
  236. package/build/server/chunks/chunks/patch.js-Bl7vwsUj.js +62 -0
  237. package/build/server/chunks/chunks/paths.js-DVRjNYFW.js +19 -0
  238. package/build/server/chunks/chunks/peek.js-D9sSjT9t.js +95 -0
  239. package/build/server/chunks/chunks/plan.js-DFq5ntMM.js +143 -0
  240. package/build/server/chunks/chunks/project-files-notice.js-CcqcBgUP.js +19 -0
  241. package/build/server/chunks/chunks/project-files.js-DTC4jUxy.js +52 -0
  242. package/build/server/chunks/chunks/project-folder.js-CoKgPiM0.js +22 -0
  243. package/build/server/chunks/chunks/projects.js-bw2V11od.js +989 -0
  244. package/build/server/chunks/chunks/prs.js-CLfImauu.js +118 -0
  245. package/build/server/chunks/chunks/publish.js-D2vWpIJU.js +195 -0
  246. package/build/server/chunks/chunks/pull-list.js-BCIBJdyz.js +691 -0
  247. package/build/server/chunks/chunks/qa-ask.svelte.js-8Hf1JWW2.js +47 -0
  248. package/build/server/chunks/chunks/qa-setup.js-DFOEcNxH.js +1241 -0
  249. package/build/server/chunks/chunks/quiet.js-1GKY40Ay.js +104 -0
  250. package/build/server/chunks/chunks/rail.js-BePBwOqZ.js +135 -0
  251. package/build/server/chunks/chunks/review.js-MPqnq9Gy.js +98 -0
  252. package/build/server/chunks/chunks/routing.js-B8s1QwSP.js +265 -0
  253. package/build/server/chunks/chunks/run-log.js-CnN2jOcg.js +94 -0
  254. package/build/server/chunks/chunks/run.js-COSejjLl.js +34 -0
  255. package/build/server/chunks/chunks/scout-findings.js-CqJti10a.js +940 -0
  256. package/build/server/chunks/chunks/scout.js-Bm7wQLX2.js +62 -0
  257. package/build/server/chunks/chunks/sentinels.js-BXvpnzr3.js +13 -0
  258. package/build/server/chunks/chunks/server.js-BR0D07DR.js +3803 -0
  259. package/build/server/chunks/chunks/settings-sections.js-V70W7BkZ.js +103 -0
  260. package/build/server/chunks/chunks/shared.js-BgfCUZUJ.js +776 -0
  261. package/build/server/chunks/chunks/sign-in.js-O-pBhi19.js +14 -0
  262. package/build/server/chunks/chunks/snapshot.js-BekzL_He.js +38 -0
  263. package/build/server/chunks/chunks/spend.js-BabnR69T.js +63 -0
  264. package/build/server/chunks/chunks/src.js-Cm8RAH_q.js +609 -0
  265. package/build/server/chunks/chunks/src2.js-CV8tsClO.js +1186 -0
  266. package/build/server/chunks/chunks/src3.js-h9tTEbVb.js +11222 -0
  267. package/build/server/chunks/chunks/stack.js-CMWXhMZS.js +13 -0
  268. package/build/server/chunks/chunks/standup.js-D-qBnMx4.js +103 -0
  269. package/build/server/chunks/chunks/state.js-BTDrgu7s.js +71 -0
  270. package/build/server/chunks/chunks/stream.js-D6r6iqjD.js +66 -0
  271. package/build/server/chunks/chunks/terms.js-DPZztSEn.js +88 -0
  272. package/build/server/chunks/chunks/ticket-system.js-Dj9R3XJw.js +147 -0
  273. package/build/server/chunks/chunks/ticket.js-6sj-2ZEM.js +110 -0
  274. package/build/server/chunks/chunks/timesheet.js-DfhIokoE.js +212 -0
  275. package/build/server/chunks/chunks/timesheet2.js-Cu95ddl3.js +84 -0
  276. package/build/server/chunks/chunks/to-workspace.js-DiOJP59J.js +308 -0
  277. package/build/server/chunks/chunks/toast-stack.svelte.js-CXIg3_KT.js +10 -0
  278. package/build/server/chunks/chunks/uneval.js-VnZcgzZr.js +488 -0
  279. package/build/server/chunks/chunks/utils.js-DQTBh7_6.js +1006 -0
  280. package/build/server/chunks/chunks/when-said.js-0F9asAma.js +35 -0
  281. package/build/server/chunks/chunks/workspace.js-BBdJRon9.js +212 -0
  282. package/build/server/chunks/entries/endpoints/api/board/_server.ts.js-BlYC_lpV.js +69 -0
  283. package/build/server/chunks/entries/endpoints/api/board/minimize/_server.ts.js-Wddt9YPR.js +68 -0
  284. package/build/server/chunks/entries/endpoints/api/board/move/_server.ts.js-BwZpCKx0.js +68 -0
  285. package/build/server/chunks/entries/endpoints/api/board/promote/_server.ts.js-Cw6kvkMq.js +68 -0
  286. package/build/server/chunks/entries/endpoints/api/board/pulls/_server.ts.js-DFhpbiMo.js +71 -0
  287. package/build/server/chunks/entries/endpoints/api/board/stop/_server.ts.js-D5eylDMw.js +68 -0
  288. package/build/server/chunks/entries/endpoints/api/card/_key_/answer/_server.ts.js-CG8xh52y.js +68 -0
  289. package/build/server/chunks/entries/endpoints/api/card/_key_/branch/_server.ts.js-a5_P9voA.js +40 -0
  290. package/build/server/chunks/entries/endpoints/api/card/_key_/chain/_server.ts.js-tJvQy6RK.js +70 -0
  291. package/build/server/chunks/entries/endpoints/api/card/_key_/checkouts/_server.ts.js-B2_gx6vF.js +41 -0
  292. package/build/server/chunks/entries/endpoints/api/card/_key_/choice/_server.ts.js-pmAdIQkK.js +34 -0
  293. package/build/server/chunks/entries/endpoints/api/card/_key_/comments/_id_/_server.ts.js-C5NxGWw3.js +68 -0
  294. package/build/server/chunks/entries/endpoints/api/card/_key_/comments/_server.ts.js-0rw7UNv8.js +64 -0
  295. package/build/server/chunks/entries/endpoints/api/card/_key_/commit/_server.ts.js-_yXWCOlQ.js +68 -0
  296. package/build/server/chunks/entries/endpoints/api/card/_key_/commit-diff/_server.ts.js-CRPV3z-g.js +61 -0
  297. package/build/server/chunks/entries/endpoints/api/card/_key_/commit-message/_server.ts.js-CO9mD3u6.js +82 -0
  298. package/build/server/chunks/entries/endpoints/api/card/_key_/context/_server.ts.js-7kzrigFz.js +42 -0
  299. package/build/server/chunks/entries/endpoints/api/card/_key_/delete/_server.ts.js-DH0nO9wG.js +516 -0
  300. package/build/server/chunks/entries/endpoints/api/card/_key_/file/_server.ts.js-D80SvJDi.js +35 -0
  301. package/build/server/chunks/entries/endpoints/api/card/_key_/files/_...path_/_server.ts.js-GxFjb2H0.js +34 -0
  302. package/build/server/chunks/entries/endpoints/api/card/_key_/fix/_server.ts.js-B-HAB050.js +68 -0
  303. package/build/server/chunks/entries/endpoints/api/card/_key_/knowledge/_server.ts.js-D4fN-j7X.js +81 -0
  304. package/build/server/chunks/entries/endpoints/api/card/_key_/link/_other_/_server.ts.js-C00pQDCu.js +42 -0
  305. package/build/server/chunks/entries/endpoints/api/card/_key_/log/_server.ts.js-BXW_tG-I.js +32 -0
  306. package/build/server/chunks/entries/endpoints/api/card/_key_/log/raw/_server.ts.js-pT8StZGR.js +32 -0
  307. package/build/server/chunks/entries/endpoints/api/card/_key_/message/_server.ts.js-ZMno2Hu6.js +68 -0
  308. package/build/server/chunks/entries/endpoints/api/card/_key_/models/_server.ts.js-DEZVpqO3.js +73 -0
  309. package/build/server/chunks/entries/endpoints/api/card/_key_/patch/_server.ts.js-BxfLi-Zs.js +61 -0
  310. package/build/server/chunks/entries/endpoints/api/card/_key_/peek/_server.ts.js-CsTKWIP_.js +169 -0
  311. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/_server.ts.js-CsOeAXkf.js +53 -0
  312. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/comments/_server.ts.js-DZ2XHOhF.js +71 -0
  313. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/discuss/_server.ts.js-CO8eM0e8.js +72 -0
  314. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/discussions/_server.ts.js-Lp7l0Yqv.js +71 -0
  315. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/fix/_server.ts.js-CeIhjpQ4.js +68 -0
  316. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/fix-all/_server.ts.js-D-DKoCpQ.js +68 -0
  317. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/links/_server.ts.js-B_q3jUP3.js +72 -0
  318. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/qa/_server.ts.js-BulVcJY9.js +68 -0
  319. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/seen/_server.ts.js-Z06A6MS1.js +71 -0
  320. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/triage/_server.ts.js-qADU4URF.js +68 -0
  321. package/build/server/chunks/entries/endpoints/api/card/_key_/pull/_server.ts.js-CHnTH9WK.js +58 -0
  322. package/build/server/chunks/entries/endpoints/api/card/_key_/push/_server.ts.js-BPdPwPo2.js +83 -0
  323. package/build/server/chunks/entries/endpoints/api/card/_key_/repos/_server.ts.js-Bjqa3Uoo.js +73 -0
  324. package/build/server/chunks/entries/endpoints/api/card/_key_/research/_server.ts.js-DzQjoHOZ.js +138 -0
  325. package/build/server/chunks/entries/endpoints/api/card/_key_/retry/_server.ts.js-CAodrXqd.js +68 -0
  326. package/build/server/chunks/entries/endpoints/api/card/_key_/send-back/_server.ts.js-CmJSnvTx.js +68 -0
  327. package/build/server/chunks/entries/endpoints/api/card/_key_/stack/_server.ts.js-DjI8S94J.js +82 -0
  328. package/build/server/chunks/entries/endpoints/api/card/_key_/tasks/_server.ts.js-BzX_nNJk.js +71 -0
  329. package/build/server/chunks/entries/endpoints/api/card/_key_/thread/_server.ts.js-Dn36Guxk.js +33 -0
  330. package/build/server/chunks/entries/endpoints/api/cards/_server.ts.js-DPMOBsvp.js +77 -0
  331. package/build/server/chunks/entries/endpoints/api/cards/context/_server.ts.js-D6y-g2O-.js +52 -0
  332. package/build/server/chunks/entries/endpoints/api/cards/next/_server.ts.js-C2se67rf.js +55 -0
  333. package/build/server/chunks/entries/endpoints/api/chain/_server.ts.js-DKO5Q8GV.js +70 -0
  334. package/build/server/chunks/entries/endpoints/api/clones/_server.ts.js-Bgcc_Beg.js +56 -0
  335. package/build/server/chunks/entries/endpoints/api/current-project/_server.ts.js-DZCtSlXs.js +81 -0
  336. package/build/server/chunks/entries/endpoints/api/evidence/timesheet/_server.ts.js-xJwzSrcl.js +32 -0
  337. package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-BdcE7k8S.js +83 -0
  338. package/build/server/chunks/entries/endpoints/api/gh/_server.ts.js-CGvM8fn7.js +66 -0
  339. package/build/server/chunks/entries/endpoints/api/gh/name/_server.ts.js-CHh3tAu7.js +36 -0
  340. package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-DLUfrHo6.js +22 -0
  341. package/build/server/chunks/entries/endpoints/api/login-item/_server.ts.js-Cya7S7W6.js +77 -0
  342. package/build/server/chunks/entries/endpoints/api/notes/_server.ts.js-DaUFVqSM.js +26 -0
  343. package/build/server/chunks/entries/endpoints/api/notifications/_server.ts.js-DK6NFnII.js +76 -0
  344. package/build/server/chunks/entries/endpoints/api/now/_server.ts.js-xW0jeJdy.js +83 -0
  345. package/build/server/chunks/entries/endpoints/api/package/entry/_server.ts.js-DQyZanpo.js +35 -0
  346. package/build/server/chunks/entries/endpoints/api/projects/_server.ts.js-CzXJTj_l.js +58 -0
  347. package/build/server/chunks/entries/endpoints/api/qa-setup/_server.ts.js-DujrYbEP.js +76 -0
  348. package/build/server/chunks/entries/endpoints/api/remove-check/_server.ts.js-1KAi9LDi.js +58 -0
  349. package/build/server/chunks/entries/endpoints/api/setup/_server.ts.js-D0MKtjR7.js +69 -0
  350. package/build/server/chunks/entries/endpoints/api/tickets/jira/_server.ts.js-Z2LdOr5l.js +39 -0
  351. package/build/server/chunks/entries/endpoints/api/tickets/read/_server.ts.js-BziHtc8Y.js +68 -0
  352. package/build/server/chunks/entries/endpoints/api/tools/_server.ts.js-oyvq8i1y.js +30 -0
  353. package/build/server/chunks/entries/endpoints/api/workspace/_server.ts.js-CMGBL5cX.js +58 -0
  354. package/build/server/chunks/entries/endpoints/api/workspace/commit/_server.ts.js-BZQQJ1YG.js +66 -0
  355. package/build/server/chunks/entries/endpoints/api/workspace/patch/_server.ts.js-xrjgHECx.js +64 -0
  356. package/build/server/chunks/entries/endpoints/api/workspace/push/_server.ts.js-CTdia7Uz.js +66 -0
  357. package/build/server/chunks/entries/hooks.server.js-B0jE-ELC.js +211 -0
  358. package/build/server/chunks/entries/pages/_error.svelte.js-DPcKI5sX.js +25 -0
  359. package/build/server/chunks/entries/pages/_layout.server.ts.js-Jj3i2Th9.js +134 -0
  360. package/build/server/chunks/entries/pages/_layout.svelte.js-Cu3ghN80.js +1251 -0
  361. package/build/server/chunks/entries/pages/_page.svelte.js-DEYydBCm.js +662 -0
  362. package/build/server/chunks/entries/pages/accept/_page.server.ts.js-BF7MrA5s.js +29 -0
  363. package/build/server/chunks/entries/pages/accept/_page.svelte.js-8yPsedd-.js +54 -0
  364. package/build/server/chunks/entries/pages/b/_board_/_page.svelte.js-S9acLF3f.js +68 -0
  365. package/build/server/chunks/entries/pages/b/_board_/_page.ts.js-BcKdG_Tp.js +21 -0
  366. package/build/server/chunks/entries/pages/b/research/_page.svelte.js-FW6Hw9g5.js +68 -0
  367. package/build/server/chunks/entries/pages/b/research/_page.ts.js-Ds2AjFFK.js +13 -0
  368. package/build/server/chunks/entries/pages/evidence/_page.server.ts.js-uwu2X7bA.js +1382 -0
  369. package/build/server/chunks/entries/pages/evidence/_page.svelte.js-DBCjiT59.js +594 -0
  370. package/build/server/chunks/entries/pages/f/_...path_/_page.svelte.js-DxwJaJzh.js +58 -0
  371. package/build/server/chunks/entries/pages/knowledge/_page.server.ts.js-BAUvFEcM.js +80 -0
  372. package/build/server/chunks/entries/pages/knowledge/_page.svelte.js-D9117gHM.js +732 -0
  373. package/build/server/chunks/entries/pages/new/_page.server.ts.js-BNCQQpyw.js +110 -0
  374. package/build/server/chunks/entries/pages/new/_page.svelte.js-Ben8-N_h.js +503 -0
  375. package/build/server/chunks/entries/pages/new/idea/_page.server.ts.js-jssA29y3.js +46 -0
  376. package/build/server/chunks/entries/pages/new/idea/_page.svelte.js-XoKspqAc.js +210 -0
  377. package/build/server/chunks/entries/pages/new/task/_page.server.ts.js-CmZgfvyt.js +66 -0
  378. package/build/server/chunks/entries/pages/new/task/_page.svelte.js-BKpERKvm.js +169 -0
  379. package/build/server/chunks/entries/pages/onboard/_page.server.ts.js-pmc_pXvs.js +12 -0
  380. package/build/server/chunks/entries/pages/onboard/_page.svelte.js-C7LNK-ba.js +5 -0
  381. package/build/server/chunks/entries/pages/projects/_page.server.ts.js-BEhLRfJ_.js +12 -0
  382. package/build/server/chunks/entries/pages/projects/_page.svelte.js-OraOjsyb.js +5 -0
  383. package/build/server/chunks/entries/pages/scout/_page.server.ts.js-hQYnMHwY.js +10 -0
  384. package/build/server/chunks/entries/pages/scout/_page.svelte.js-7q4d044Z.js +40 -0
  385. package/build/server/chunks/entries/pages/scout/f/_id_/_page.server.ts.js-BN4TnSpB.js +22 -0
  386. package/build/server/chunks/entries/pages/scout/f/_id_/_page.svelte.js-GzpLhARi.js +40 -0
  387. package/build/server/chunks/entries/pages/settings/_layout.server.ts.js-B5LgqMMT.js +12 -0
  388. package/build/server/chunks/entries/pages/settings/_layout.svelte.js-CSCpV6qA.js +81 -0
  389. package/build/server/chunks/entries/pages/settings/_page.svelte.js-DNpsNFo0.js +25 -0
  390. package/build/server/chunks/entries/pages/settings/_section_/_page.server.ts.js-nRDEV3i_.js +348 -0
  391. package/build/server/chunks/entries/pages/settings/_section_/_page.svelte.js-BihUf-nY.js +1052 -0
  392. package/build/server/chunks/entries/pages/settings/integrations/_page.server.ts.js-BTuRpg8m.js +58 -0
  393. package/build/server/chunks/entries/pages/settings/integrations/_page.svelte.js-C8i8ZmZR.js +161 -0
  394. package/build/server/chunks/entries/pages/settings/mcp/_page.server.ts.js-TFISfO1a.js +925 -0
  395. package/build/server/chunks/entries/pages/settings/mcp/_page.svelte.js-D1X0TNOm.js +433 -0
  396. package/build/server/chunks/entries/pages/settings/phases/_page.server.ts.js-CgK7MTZf.js +48 -0
  397. package/build/server/chunks/entries/pages/settings/phases/_page.svelte.js-u-sTQ-ue.js +80 -0
  398. package/build/server/chunks/entries/pages/settings/project/_page.server.ts.js-CCnk9WbO.js +363 -0
  399. package/build/server/chunks/entries/pages/settings/project/_page.svelte.js-MxvNqYlQ.js +1269 -0
  400. package/build/server/chunks/entries/pages/settings/wall/_page.server.ts.js-Bt5siY_N.js +12 -0
  401. package/build/server/chunks/entries/pages/settings/wall/_page.svelte.js-CMR4zSAt.js +43 -0
  402. package/build/server/chunks/entries/pages/t/_key_/_layout.server.ts.js-W6YPvOCA.js +124 -0
  403. package/build/server/chunks/entries/pages/t/_key_/_layout.svelte.js-CK0PiWsz.js +543 -0
  404. package/build/server/chunks/entries/pages/t/_key_/_page.server.ts.js-CdB7v0WX.js +15 -0
  405. package/build/server/chunks/entries/pages/t/_key_/_tab_/_page.server.ts.js-Bksaje8R.js +75 -0
  406. package/build/server/chunks/entries/pages/t/_key_/_tab_/_page.svelte.js-9OQ2eQxu.js +4607 -0
  407. package/build/server/chunks/entries/pages/team/_page.svelte.js-BdUSXC04.js +18 -0
  408. package/build/server/chunks/entries/pages/team/_page.ts.js-DfhJmoZI.js +20 -0
  409. package/build/server/chunks/entries/pages/workspace/_page.svelte.js-DLaWe23r.js +579 -0
  410. package/build/server/chunks/handler-Dlwmumt5.js +1735 -0
  411. package/build/server/chunks/index.js-BX0fZD5G.js +3701 -0
  412. package/build/server/chunks/manifest.js-B2Of6Dj7.js +761 -0
  413. package/build/server/chunks/nodes/0.js-DSzhdY0D.js +87 -0
  414. package/build/server/chunks/nodes/1.js-j4osL1br.js +9 -0
  415. package/build/server/chunks/nodes/10.js-jkvevEFY.js +75 -0
  416. package/build/server/chunks/nodes/11.js-plyiDP2n.js +72 -0
  417. package/build/server/chunks/nodes/12.js-DwtvDAyM.js +78 -0
  418. package/build/server/chunks/nodes/13.js-BpxwqFh4.js +72 -0
  419. package/build/server/chunks/nodes/14.js-B5iNIKGy.js +15 -0
  420. package/build/server/chunks/nodes/15.js-CXCAqUsG.js +15 -0
  421. package/build/server/chunks/nodes/16.js-oxkLEH0n.js +76 -0
  422. package/build/server/chunks/nodes/17.js-B-ZJEo9K.js +76 -0
  423. package/build/server/chunks/nodes/18.js-C0OUCEux.js +9 -0
  424. package/build/server/chunks/nodes/19.js-M8EAQJdW.js +76 -0
  425. package/build/server/chunks/nodes/2.js-ZedduK-3.js +33 -0
  426. package/build/server/chunks/nodes/20.js-BHvsLNjD.js +72 -0
  427. package/build/server/chunks/nodes/21.js-eOaW4si1.js +76 -0
  428. package/build/server/chunks/nodes/22.js-CbJ6tQSs.js +38 -0
  429. package/build/server/chunks/nodes/23.js-DXk8ejlx.js +81 -0
  430. package/build/server/chunks/nodes/24.js-C4qGJc4X.js +33 -0
  431. package/build/server/chunks/nodes/25.js-Cal8uT5V.js +21 -0
  432. package/build/server/chunks/nodes/26.js-Cp5jBcrN.js +80 -0
  433. package/build/server/chunks/nodes/27.js-Do55o_cb.js +17 -0
  434. package/build/server/chunks/nodes/28.js-SNz3QVix.js +9 -0
  435. package/build/server/chunks/nodes/3.js-DyivQ5dN.js +75 -0
  436. package/build/server/chunks/nodes/4.js-BGgTTQFR.js +9 -0
  437. package/build/server/chunks/nodes/5.js-DQYA2BBI.js +31 -0
  438. package/build/server/chunks/nodes/6.js-BVTi2KFL.js +24 -0
  439. package/build/server/chunks/nodes/7.js-CnprIn3p.js +12 -0
  440. package/build/server/chunks/nodes/8.js-Bdicn369.js +50 -0
  441. package/build/server/chunks/nodes/9.js-DVclPGXf.js +9 -0
  442. package/build/shims.js +33 -0
  443. package/dist/THIRD-PARTY-NOTICES.md +659 -0
  444. package/dist/detect-BmI_gskA.js +585 -0
  445. package/dist/fonts/OFL.txt +92 -0
  446. package/dist/nolzu.js +48 -0
  447. package/dist/package-vezZOzhD.js +181 -0
  448. package/dist/shared/finish.md +110 -0
  449. package/dist/shared/knowledge.md +72 -0
  450. package/dist/shared/verdict.md +42 -0
  451. package/dist/skills/.gitkeep +0 -0
  452. package/dist/skills/nolzu-architecture/SKILL.md +140 -0
  453. package/dist/skills/nolzu-architecture/finish.md +110 -0
  454. package/dist/skills/nolzu-assess/SKILL.md +99 -0
  455. package/dist/skills/nolzu-assess/finish.md +110 -0
  456. package/dist/skills/nolzu-design/SKILL.md +115 -0
  457. package/dist/skills/nolzu-design/finish.md +110 -0
  458. package/dist/skills/nolzu-feedback/SKILL.md +107 -0
  459. package/dist/skills/nolzu-feedback/finish.md +110 -0
  460. package/dist/skills/nolzu-implement/SKILL.md +138 -0
  461. package/dist/skills/nolzu-implement/finish.md +110 -0
  462. package/dist/skills/nolzu-investigate/SKILL.md +139 -0
  463. package/dist/skills/nolzu-investigate/finish.md +110 -0
  464. package/dist/skills/nolzu-learn-repo/SKILL.md +115 -0
  465. package/dist/skills/nolzu-learn-repo/finish.md +110 -0
  466. package/dist/skills/nolzu-learn-repo/knowledge.md +72 -0
  467. package/dist/skills/nolzu-optimize/SKILL.md +82 -0
  468. package/dist/skills/nolzu-optimize/finish.md +110 -0
  469. package/dist/skills/nolzu-optimize/knowledge.md +72 -0
  470. package/dist/skills/nolzu-orient/SKILL.md +115 -0
  471. package/dist/skills/nolzu-orient/finish.md +110 -0
  472. package/dist/skills/nolzu-orient/knowledge.md +72 -0
  473. package/dist/skills/nolzu-plan/SKILL.md +165 -0
  474. package/dist/skills/nolzu-plan/finish.md +110 -0
  475. package/dist/skills/nolzu-pr-review/SKILL.md +150 -0
  476. package/dist/skills/nolzu-pr-review/finish.md +110 -0
  477. package/dist/skills/nolzu-qa/SKILL.md +177 -0
  478. package/dist/skills/nolzu-qa/finish.md +110 -0
  479. package/dist/skills/nolzu-qa/verdict.md +42 -0
  480. package/dist/skills/nolzu-refine/SKILL.md +145 -0
  481. package/dist/skills/nolzu-refine/finish.md +110 -0
  482. package/dist/skills/nolzu-research/SKILL.md +140 -0
  483. package/dist/skills/nolzu-research/finish.md +110 -0
  484. package/dist/skills/nolzu-wrapup/SKILL.md +126 -0
  485. package/dist/skills/nolzu-wrapup/finish.md +110 -0
  486. package/dist/skills/nolzu-wrapup/knowledge.md +72 -0
  487. package/dist/src-BG8LaXLS.js +723 -0
  488. package/dist/src-DPfcvRqs.js +4 -0
  489. package/dist/start-ItZOcBtM.js +362 -0
  490. package/package.json +49 -9
  491. package/bin/nolzu.js +0 -8
@@ -0,0 +1,1419 @@
1
+ import { c as engineName } from './engine.js-DS5zUwsE.js';
2
+ import { s as shows } from './display.js-Bf-vGQ7Q.js';
3
+ import { a as formatDuration, f as formatCost } from './spend.js-BabnR69T.js';
4
+ import { r as resolveDataDir, g as getSetting, bc as checkSearchSource, bd as checkSentrySource, be as checkTicketSource, Q as scoutSources, _ as scoutSource, ay as scoutFinding, bf as ticketPlan, c as cardRuns, Z as ENDED, bg as visible, bh as fingerprint, bi as fetchTickets } from './node.js-Bz2jT5wt.js';
5
+ import './src.js-Cm8RAH_q.js';
6
+ import './src2.js-CV8tsClO.js';
7
+ import { a as assessKey, b as scoutSecretName } from './scout.js-Bm7wQLX2.js';
8
+ import { l as loop } from './loop.js-D3guWKLp.js';
9
+ import { Q as createKeychain, R as runKeychain, m as readCardFile, ak as ghRunner, ap as githubIssues, bA as gitlabIssues, bB as glabRunner, bC as jiraIssues, ah as jiraCall, bD as linearIssues, bE as linearCall } from './src3.js-h9tTEbVb.js';
10
+ import { c as cardFolder } from './files.js-V46lE0-6.js';
11
+ import { t as sendToHub } from './hub-link.js-B5kjLyyd.js';
12
+ import { a as database } from './db.js-pqoVpAzG.js';
13
+ import { c as currentDisplay, l as localCloud } from './evidence.js-CT3tWdbB.js';
14
+ import { a as remoteOwner } from './create-card.js-DKtprMG6.js';
15
+ import { a as saveScoutSchedule, S as SCHEDULE_FEATURE, c as checkFirstPaste, b as checkScoutSource, d as answerStart, m as muteScoutFinding, e as checkedSentence, f as count, g as SOURCE_FORMS, h as asked, i as sourceSettings, j as sourceEntry, k as saveScoutSource, l as markScoutSeen, s as scoutFindingsFor, n as scoutFor, o as scoutRow, p as assessing, q as cardsOnBoard, r as sourceSecret, t as scoutEntry } from './scout-findings.js-CqJti10a.js';
16
+ import { A as fail } from './utils.js-DQTBh7_6.js';
17
+ import { existsSync } from 'node:fs';
18
+ import { join } from 'node:path';
19
+
20
+ //#region ../../packages/core/src/scout-search.ts
21
+ var SEARCH = "search";
22
+ /**
23
+ * The field the cursor and the order are read from.
24
+ *
25
+ * `@timestamp` in both products: it is what a data stream, ECS and the Logstash template all write,
26
+ * and what every dashboard sorts by. An index that names it something else is the ceiling of this
27
+ * source, and `sort` carries `unmapped_type` so such an index is answered rather than refused.
28
+ */
29
+ var SEARCH_TIME_FIELD = "@timestamp";
30
+ /**
31
+ * Where the line is looked for, in order.
32
+ *
33
+ * Neither product promises a field name, so one has to be chosen. A list in order, because the first
34
+ * four names cover what a collector writes: `message` is ECS and the Logstash default, `msg` is what
35
+ * the common structured loggers write, `log` is what Docker's json-file driver writes, and
36
+ * `error.message` is where ECS puts the text of an exception.
37
+ *
38
+ * A field a person names on the form loses because that field would be asked of every source, and
39
+ * most of them are the plain case that needs no answer, while a person who does need it has to go
40
+ * and read their own mapping first. The whole document as the line loses because it carries every
41
+ * field that varies by machine: a host name, a pod name and a container id are words, not numbers,
42
+ * so `normalize` keeps them and one event becomes one finding per pod. It is still the fallback
43
+ * below, because a source that finds nothing at all is worse than one whose findings are wide.
44
+ */
45
+ var MESSAGE_FIELDS = [
46
+ "message",
47
+ "msg",
48
+ "log",
49
+ "error.message"
50
+ ];
51
+ var LEVEL_FIELDS = [
52
+ "log.level",
53
+ "level",
54
+ "severity"
55
+ ];
56
+ /**
57
+ * What the finding says about where it happens.
58
+ *
59
+ * The service and nothing else. It is part of the fingerprint, so every candidate had to be one that
60
+ * does not change under the same event: a host or a pod name would give a finding per machine, and
61
+ * `_index` would give one per day on an index that rolls daily. Empty where the document names no
62
+ * service, which is honest: the finding then says nothing about where instead of something wrong.
63
+ */
64
+ var SERVICE_FIELDS = ["service.name", "service"];
65
+ var FIELD_CAP = 40;
66
+ var VALUE_CAP = 200;
67
+ var SECRET_FIELD = /^(proxy-)?authorization$|^(set-)?cookie$|^x-api-key$|^api[_-]?key$|^(access|refresh|id)[_-]?token$|^token$|^password$|^passwd$|^secret$|^credentials?$|^session$/i;
68
+ var REASON_CAP = 200;
69
+ /**
70
+ * One field of `_source`, under either of the two ways a mapping may hold it.
71
+ *
72
+ * `{"service.name":"api"}` and `{"service":{"name":"api"}}` are the same field to both products, and
73
+ * which one arrives depends on the collector. Reading only one of them would leave half of real
74
+ * indices with no service and no level.
75
+ */
76
+ function raw(source, path) {
77
+ const flat = source[path];
78
+ if (flat !== void 0) return flat;
79
+ let held = source;
80
+ for (const part of path.split(".")) {
81
+ if (typeof held !== "object" || held === null || Array.isArray(held)) return void 0;
82
+ held = held[part];
83
+ }
84
+ return held;
85
+ }
86
+ /**
87
+ * The same field, printed.
88
+ *
89
+ * A number and a boolean are printed and not dropped, because a level is often a number: one common
90
+ * structured logger writes `level: 30` and a syslog shipper writes `severity: 3`. Dropped, they left
91
+ * `errorType` empty, and an error and a warning carrying the same words then folded into one finding,
92
+ * which is the over-grouping half of the trade this file exists to get right. The number stays a
93
+ * number in the sentence: which number is which level is the logger's own table, and guessing it
94
+ * would name the wrong level on the other logger.
95
+ */
96
+ function at(source, path) {
97
+ const value = raw(source, path);
98
+ if (typeof value === "string") return visible(value);
99
+ return typeof value === "number" || typeof value === "boolean" ? String(value) : "";
100
+ }
101
+ var firstOf = (source, paths) => {
102
+ for (const path of paths) {
103
+ const value = at(source, path);
104
+ if (value.trim() !== "") return value;
105
+ }
106
+ return "";
107
+ };
108
+ var secret$1 = (name) => SECRET_FIELD.test(name.split(".").at(-1) ?? name);
109
+ /**
110
+ * The whole document as the line, for a document no known field describes.
111
+ *
112
+ * Field by field, so two occurrences of one event keep the same fields whatever their numbers are
113
+ * long. Every field a person may need is here except the ones that hold a credential, and those are
114
+ * dropped rather than cut: a source form cannot promise what reaches the database if this line copies
115
+ * a header in.
116
+ */
117
+ function whole(document) {
118
+ const parts = [];
119
+ for (const [name, value] of Object.entries(document)) {
120
+ if (parts.length === FIELD_CAP) break;
121
+ if (secret$1(name) || value === void 0) continue;
122
+ const text = typeof value === "string" ? value : JSON.stringify(value, (key, held) => secret$1(key) ? void 0 : held);
123
+ if (text.trim() === "" || text === "{}" || text === "null") continue;
124
+ parts.push(`${name}: ${text.slice(0, VALUE_CAP)}`);
125
+ }
126
+ return parts.join(" ");
127
+ }
128
+ var EPOCH_SECONDS = 1e11;
129
+ var TIME_MAX = 864e13;
130
+ var CLOCK_GRACE_MS = 3e5;
131
+ /**
132
+ * The timestamp of one hit, as a string the cursor can be.
133
+ *
134
+ * A number is a documented date too: a `date` field takes `epoch_millis`, and several loggers write
135
+ * that instead of a string. Read as nothing it left the cursor null for good, and then every check
136
+ * asked for the newest page again and added its lines to the same findings, so the occurrence count
137
+ * became a count of presses.
138
+ */
139
+ function stampOf(document) {
140
+ const value = raw(document, SEARCH_TIME_FIELD);
141
+ if (typeof value === "string") return value;
142
+ if (typeof value !== "number" || !Number.isFinite(value)) return "";
143
+ const ms = Math.abs(value) < EPOCH_SECONDS ? value * 1e3 : value;
144
+ return Math.abs(ms) <= TIME_MAX ? new Date(ms).toISOString() : "";
145
+ }
146
+ /**
147
+ * What an index may be called.
148
+ *
149
+ * Both products allow letters, digits and `_ . + -`, a `*` in a pattern and a comma between two
150
+ * names. The check is here because this string goes into a path: without it an index of `../_cluster`
151
+ * would post to another endpoint of the cluster, and a name with a space would fail somewhere far
152
+ * from the form that collected it.
153
+ */
154
+ var INDEX_NAME = /^[a-zA-Z0-9_.*,+-]+$/;
155
+ var ONLY_DOTS = /^\.+$/;
156
+ /**
157
+ * The query one check sends.
158
+ *
159
+ * Oldest first, which is the part worth reading twice. Newest first with a ceiling would move the
160
+ * cursor to the newest line of the page and leave everything older than the page behind for good.
161
+ * Oldest first moves the cursor only as far as the page reached, so a burst larger than the ceiling
162
+ * is read by the checks that follow and nothing is lost.
163
+ *
164
+ * The first check has no cursor and so no lower bound, and there newest first is what a person
165
+ * wants: what is happening now, not the oldest lines the index still holds. `fetchSearch` puts that
166
+ * page back into time order before it makes items, so a finding's first line is its oldest.
167
+ */
168
+ function searchRequest(index, query, cursor) {
169
+ if (!INDEX_NAME.test(index) || index.split(",").some((one) => ONLY_DOTS.test(one))) throw new Error(`"${index}" is not an index name. Open the source on the Scout page and write it the way the cluster spells it, such as logs-* or logs-app.`);
170
+ const filter = [];
171
+ if (query.trim() !== "") filter.push({ query_string: { query } });
172
+ if (cursor !== null) filter.push({ range: { [SEARCH_TIME_FIELD]: { gt: cursor } } });
173
+ return {
174
+ path: `/${index}/_search`,
175
+ body: JSON.stringify({
176
+ size: 500,
177
+ sort: [{ [SEARCH_TIME_FIELD]: {
178
+ order: cursor === null ? "desc" : "asc",
179
+ unmapped_type: "date"
180
+ } }],
181
+ query: filter.length === 0 ? { match_all: {} } : { bool: { filter } }
182
+ })
183
+ };
184
+ }
185
+ /**
186
+ * The cluster's own words about a query it refused.
187
+ *
188
+ * The body and never the request: the key travels in a header, so nothing the cluster echoes back
189
+ * here can hold it, while the query it echoes is what a person needs in order to fix theirs.
190
+ */
191
+ function reason(body) {
192
+ try {
193
+ const error = JSON.parse(body).error;
194
+ const said = typeof error === "string" ? error : typeof error === "object" && error !== null ? error.reason : void 0;
195
+ return typeof said === "string" && said !== "" ? `The cluster said: ${said.slice(0, REASON_CAP)}` : "";
196
+ } catch {
197
+ return "";
198
+ }
199
+ }
200
+ /**
201
+ * Why this answer cannot be read, as a sentence with a next step in it, or null when it can.
202
+ *
203
+ * Every one of these is a state a person meets on their first try, and each needs its own next step:
204
+ * a wrong key, a key with no rights, an index that is not there, a query the cluster will not parse,
205
+ * and a proxy or a login page answering instead of the cluster.
206
+ */
207
+ function refuse(answer) {
208
+ if ((answer.contentType.includes("text/html") || /^\s*</.test(answer.body)) && answer.status < 500) return "The cluster address answered a web page and not JSON, so something other than the cluster is answering: a proxy, or a login page. Open the source on the Scout page and check the cluster address and its port.";
209
+ if (answer.status === 401) return "The cluster refused the API key (401). Open the source on the Scout page, paste a key that is still valid, and save it.";
210
+ if (answer.status === 403) return "The API key may not read that index (403). Give the key read rights on the index, or name an index it may read, in the source on the Scout page.";
211
+ if (answer.status === 404) return "The cluster has no index by that name (404). Open the source on the Scout page and write the index the way the cluster spells it, such as logs-*.";
212
+ if (answer.status === 400) return `The cluster refused the query (400). Open the source on the Scout page and fix the query. ${reason(answer.body)}`.trim();
213
+ if (answer.status !== 200) return `The cluster answered ${answer.status}, so nothing was read. Check that the cluster is up and that the address in the source on the Scout page names it. ${reason(answer.body)}`.trim();
214
+ return null;
215
+ }
216
+ var SHAPE = "The answer is not what a search answers with. Nolzu reads hits.hits out of it, and this answer has no such list. Check that the cluster address names an Elasticsearch or OpenSearch cluster.";
217
+ var NO_DOCUMENT = "The cluster answered lines, and not one of them carried a document. A proxy that drops _source, or a saved query that asks for none, does that. Nothing was read and the marker did not move. Check the cluster address and the query in the source on the Scout page.";
218
+ /**
219
+ * Why a 200 may not be read, for the two answers that carry only part of the index.
220
+ *
221
+ * A search can time out inside the cluster, and a shard can be unassigned while a node restarts, and
222
+ * both come back as a 200 with the hits of the shards that did answer. Stamping the cursor on the
223
+ * newest of those lines would step over every line the missing shard held, for good, and the screen
224
+ * would say the check worked. So it is refused and the cursor stays where it was: the person presses
225
+ * again, which costs a page read twice and loses nothing.
226
+ */
227
+ function partial(parsed) {
228
+ const held = typeof parsed === "object" && parsed !== null ? parsed : {};
229
+ const failed = typeof held._shards?.failed === "number" ? held._shards.failed : 0;
230
+ if (failed > 0) return `The cluster could not search ${failed === 1 ? "one of its shards" : `${failed} of its shards`}, so the answer holds only part of the lines. Nothing was read and the marker did not move. Check that the cluster is healthy and press Check now again.`;
231
+ if (held.timed_out === true) return "The search timed out inside the cluster, so the answer holds only part of the lines. Nothing was read and the marker did not move. Press Check now again, or narrow the query in the source on the Scout page.";
232
+ return null;
233
+ }
234
+ /**
235
+ * One answer, as the occurrences in it.
236
+ *
237
+ * Takes the answer and not a socket, so the whole of it is testable with no cluster and no network.
238
+ * Every refusal is thrown with a sentence a person can act on, because the check next door writes
239
+ * exactly that sentence onto the source and the settings screen shows it until the next check works.
240
+ *
241
+ * The cursor is the newest timestamp the answer carried, and it only ever moves forward and never
242
+ * into the future. A search source has a real cursor, unlike a pasted one: a query can ask for lines
243
+ * newer than a time, so a second check does not report every line again. An answer whose lines carry
244
+ * no `@timestamp` at all leaves the cursor where it was, and then every check reads the same lines
245
+ * again. That costs no second finding, because the fingerprint folds them onto the one they already
246
+ * made, but the occurrence count grows on every check. It is the ceiling of an index that does not
247
+ * use `@timestamp`, and it is the same ceiling a machine whose clock runs behind its writers meets.
248
+ */
249
+ function fetchSearch(answer, cursor) {
250
+ const said = refuse(answer);
251
+ if (said !== null) throw new Error(said);
252
+ let parsed;
253
+ try {
254
+ parsed = JSON.parse(answer.body);
255
+ } catch {
256
+ throw new Error("The cluster answered something that is not JSON. Check that the cluster address names an Elasticsearch or OpenSearch cluster.");
257
+ }
258
+ const half = partial(parsed);
259
+ if (half !== null) throw new Error(half);
260
+ const hits = typeof parsed === "object" && parsed !== null ? parsed.hits?.hits : void 0;
261
+ if (!Array.isArray(hits)) throw new Error(SHAPE);
262
+ const items = [];
263
+ let skipped = 0;
264
+ let newest = cursor;
265
+ let newestAt = cursor === null ? -Infinity : Date.parse(cursor);
266
+ if (Number.isNaN(newestAt)) newestAt = -Infinity;
267
+ const ceiling = Date.now() + CLOCK_GRACE_MS;
268
+ for (const hit of hits) {
269
+ const holds = typeof hit === "object" && hit !== null ? hit._source : void 0;
270
+ if (typeof holds !== "object" || holds === null || Array.isArray(holds)) {
271
+ skipped += 1;
272
+ continue;
273
+ }
274
+ const document = holds;
275
+ const message = firstOf(document, MESSAGE_FIELDS) || visible(whole(document));
276
+ if (message.trim() === "") {
277
+ skipped += 1;
278
+ continue;
279
+ }
280
+ items.push({
281
+ sourceKind: SEARCH,
282
+ errorType: firstOf(document, LEVEL_FIELDS).toLowerCase(),
283
+ message,
284
+ location: firstOf(document, SERVICE_FIELDS)
285
+ });
286
+ const stamp = stampOf(document);
287
+ const ms = Date.parse(stamp);
288
+ if (!Number.isNaN(ms) && ms > newestAt && ms <= ceiling) {
289
+ newestAt = ms;
290
+ newest = stamp;
291
+ }
292
+ }
293
+ if (cursor === null) items.reverse();
294
+ if (items.length === 0 && skipped > 0) throw new Error(NO_DOCUMENT);
295
+ return {
296
+ items,
297
+ cursor: newest
298
+ };
299
+ }
300
+ //#endregion
301
+ //#region ../../packages/core/src/scout-sentry.ts
302
+ var SENTRY = "sentry";
303
+ var SEPARATOR = " ";
304
+ var PAIR = ":";
305
+ /**
306
+ * How many totals the cursor keeps.
307
+ *
308
+ * Carried totals never expire on their own, so without a ceiling the cursor grows by a page on every
309
+ * check, and `migrations.ts` promises the column is short text and not a blob. Over six times the page
310
+ * `apps/local` asks for, so a project has to have held that many issues before anything is dropped.
311
+ */
312
+ var MAX_PAIRS = 200;
313
+ function reported(cursor) {
314
+ const seen = /* @__PURE__ */ new Map();
315
+ for (const pair of (cursor ?? "").split(SEPARATOR)) {
316
+ const at = pair.lastIndexOf(PAIR);
317
+ if (at <= 0) continue;
318
+ const count = Number(pair.slice(at + 1));
319
+ if (Number.isInteger(count) && count >= 0) seen.set(pair.slice(0, at), count);
320
+ }
321
+ return seen;
322
+ }
323
+ /**
324
+ * One answered page of issues, as the occurrences behind it.
325
+ *
326
+ * An issue whose count has not moved since the last check carries nothing: the check met the same
327
+ * events again, and both lists on the Scout screen are ordered by when a finding was last seen, so
328
+ * reporting it would push an issue nobody has hit to the top of the screen on every press.
329
+ *
330
+ * An issue met for the first time always carries at least one occurrence, even where the answer says
331
+ * zero. An issue exists in Sentry because an event made it, so a count of zero is a field this
332
+ * version read wrong, and reporting nothing would hide the issue whole. The cursor then keeps the one
333
+ * occurrence that was reported and not the zero, or the finding would stay one ahead of Sentry.
334
+ *
335
+ * A count that went down carries nothing either. Sentry can merge or delete events, and taking the
336
+ * difference away would leave the finding claiming fewer occurrences than a person already read on it.
337
+ */
338
+ function fetchSentry(issues, cursor) {
339
+ const before = reported(cursor);
340
+ const groups = [];
341
+ const answered = /* @__PURE__ */ new Map();
342
+ for (const issue of issues) {
343
+ const total = Number.isInteger(issue.count) && issue.count > 0 ? issue.count : 0;
344
+ const last = before.get(issue.id);
345
+ const count = last === void 0 ? Math.max(total, 1) : total - last;
346
+ answered.set(issue.id, Math.max(total, last ?? count));
347
+ if (count <= 0) continue;
348
+ const item = {
349
+ sourceKind: SENTRY,
350
+ errorType: issue.level,
351
+ message: [issue.title === "" ? issue.shortId : issue.title, issue.permalink].filter((part) => part !== "").join("\n"),
352
+ location: issue.culprit,
353
+ sourceId: issue.id
354
+ };
355
+ groups.push({
356
+ fingerprint: fingerprint(item),
357
+ count,
358
+ first: item,
359
+ last: item
360
+ });
361
+ }
362
+ const older = [...before].filter(([id]) => !answered.has(id)).slice(0, Math.max(MAX_PAIRS - answered.size, 0));
363
+ const pairs = [...answered, ...older].map(([id, total]) => `${id}${PAIR}${total}`).sort();
364
+ return {
365
+ groups,
366
+ cursor: pairs.length === 0 ? null : pairs.join(SEPARATOR)
367
+ };
368
+ }
369
+ //#endregion
370
+ //#region ../../packages/runner/src/sentry.ts
371
+ /**
372
+ * The Sentry adapter, over the issues endpoint of the Sentry API.
373
+ *
374
+ * NOT RECORDED. Every field name, path and header below is written from Sentry's own documentation and
375
+ * not from an answer this project has read, because Nolzu has not called the real Sentry API yet.
376
+ * `sentry.test.ts` names what a first real call has to confirm. Until then treat a Sentry finding as
377
+ * unverified.
378
+ *
379
+ * Read-only, the rule for every Scout source: one GET, and nothing here resolves, assigns or comments
380
+ * on an issue.
381
+ */
382
+ var SENTRY_ORIGIN = "https://sentry.io";
383
+ var SLUG = /^(?!\.+$)[A-Za-z0-9._-]+$/;
384
+ var MAX_PAGE$1 = 100;
385
+ /**
386
+ * The path that lists a project's issues.
387
+ *
388
+ * `query` is spelled out rather than left to the endpoint's default, because a resolved issue is work
389
+ * somebody has already finished and a finding for it would be noise. No time window is asked for: what
390
+ * `statsPeriod` filters on this endpoint is not something this project has measured, and a wrong guess
391
+ * would quietly hide issues.
392
+ */
393
+ var sentryIssuesPath = (org, project, limit) => `/api/0/projects/${org}/${project}/issues/?${new URLSearchParams({
394
+ query: "is:unresolved",
395
+ limit: String(Math.min(Math.max(limit, 1), MAX_PAGE$1))
396
+ })}`;
397
+ function asCount(value) {
398
+ const many = typeof value === "string" ? Number(value) : value;
399
+ return typeof many === "number" && Number.isInteger(many) && many >= 0 ? many : 0;
400
+ }
401
+ var asText = (value) => typeof value === "string" ? value : "";
402
+ var asId = (value) => Number.isInteger(value) ? String(value) : asText(value);
403
+ /**
404
+ * One row of the answer, or null when it is not an issue this adapter can key.
405
+ *
406
+ * The id is the fingerprint of the finding, so a row without a usable one is dropped rather than
407
+ * guessed at: a finding under a made-up id can never be merged with the real issue again. No
408
+ * whitespace in it either, because the cursor keeps these ids in a list separated by spaces.
409
+ */
410
+ function sentryIssueFrom(row) {
411
+ if (typeof row !== "object" || row === null) return null;
412
+ const one = row;
413
+ const id = asId(one.id).trim();
414
+ if (id === "" || /\s/.test(id)) return null;
415
+ return {
416
+ id,
417
+ shortId: asText(one.shortId),
418
+ title: asText(one.title),
419
+ culprit: asText(one.culprit),
420
+ level: asText(one.level),
421
+ count: asCount(one.count),
422
+ permalink: asText(one.permalink)
423
+ };
424
+ }
425
+ /**
426
+ * The issues in one answer.
427
+ *
428
+ * A body that is not an array of rows is refused and never read as an empty list. A proxy page, a
429
+ * refusal shaped as an object and a truncated answer all carry no rows, and an empty list would read
430
+ * as a project whose errors are all resolved, which is the one thing Scout may not claim by mistake.
431
+ */
432
+ function readSentryIssues(body) {
433
+ let rows;
434
+ try {
435
+ rows = JSON.parse(body);
436
+ } catch {
437
+ throw new Error(unreadable(body));
438
+ }
439
+ if (!Array.isArray(rows)) throw new Error("Sentry answered the issue list with something that is not a list of issues, so nothing was read. Check the organization and the project in the source on the Scout page.");
440
+ const issues = rows.flatMap((row) => sentryIssueFrom(row) ?? []);
441
+ if (issues.length === 0 && rows.length > 0) throw new Error(`Sentry answered ${rows.length === 1 ? "one issue" : `${rows.length} issues`} and Nolzu could read an id on none of them, so nothing was read. The project is not clear of errors, Nolzu is reading the answer wrongly.`);
442
+ return issues;
443
+ }
444
+ var unreadable = (body) => isHtml(body) ? `Something on the network answered for ${SENTRY_ORIGIN} with a web page instead of data, so nothing was read. Check whether a proxy or a sign-in page sits in front of Sentry on this machine.` : "Sentry answered with something Nolzu could not read, so nothing was read. Try the check again, and look at the Sentry status page if it keeps happening.";
445
+ var isHtml = (body) => body.trimStart().startsWith("<");
446
+ /**
447
+ * How long Sentry asked the caller to wait, in whole seconds, or null when the answer named nothing.
448
+ *
449
+ * `retry-after` is read and `x-sentry-rate-limit-reset` is not, because the reset header is a moment
450
+ * in epoch seconds and turning that into a wait needs this machine's clock to agree with Sentry's.
451
+ */
452
+ function retryAfter(headers) {
453
+ const said = Object.entries(headers).find(([name]) => name.toLowerCase() === "retry-after")?.[1] ?? "";
454
+ const seconds = Number(said.trim());
455
+ return said.trim() !== "" && Number.isFinite(seconds) && seconds > 0 ? Math.ceil(seconds) : null;
456
+ }
457
+ /**
458
+ * What a refused call tells the person to do next.
459
+ *
460
+ * Each status gets its own sentence, because the fix behind each is a different one: a new token, a
461
+ * scope on the token, a wait, or a name on the form. A status with no sentence of its own says what it
462
+ * was, so a person has something to search for.
463
+ */
464
+ function sentryRefused(answer) {
465
+ if (isHtml(answer.body)) return unreadable(answer.body);
466
+ if (answer.status === 401) return "Sentry refused the Auth token, so nothing was read. Make a new token in Sentry with project:read and event:read, then paste it into this source on the Scout page.";
467
+ if (answer.status === 403) return "Sentry took the Auth token and refused the call, so nothing was read. The token needs project:read and event:read on this project. Check its scopes in Sentry, then paste a new token into this source.";
468
+ if (answer.status === 429) {
469
+ const wait = retryAfter(answer.headers);
470
+ return wait === null ? "Sentry is rate limiting this Auth token, so nothing was read. Wait a few minutes and check again." : `Sentry is rate limiting this Auth token, so nothing was read. Wait ${wait} seconds and check again.`;
471
+ }
472
+ if (answer.status === 404) return "Sentry does not have that project, so nothing was read. Check the organization and the project in the source on the Scout page against the address of the project in Sentry.";
473
+ return `Sentry answered ${answer.status} and read nothing. Try the check again, and look at the Sentry status page if it keeps happening.`;
474
+ }
475
+ /** The real call, with the Auth token from the OS keychain in the one header that carries it. */
476
+ function sentryCall(token, fetcher = fetch) {
477
+ const origin = new URL(SENTRY_ORIGIN);
478
+ return async (path, signal) => {
479
+ let answer;
480
+ let body;
481
+ try {
482
+ answer = await fetcher(new URL(path, origin).toString(), {
483
+ headers: {
484
+ authorization: `Bearer ${token}`,
485
+ accept: "application/json"
486
+ },
487
+ signal
488
+ });
489
+ body = await answer.text();
490
+ } catch {
491
+ throw new Error(signal.aborted ? `Sentry did not answer in time, so nothing was read from ${origin.host}.` : `Nolzu could not reach ${origin.host}. Check the network, then try the check again.`);
492
+ }
493
+ const headers = {};
494
+ answer.headers.forEach((value, name) => {
495
+ headers[name.toLowerCase()] = value;
496
+ });
497
+ return {
498
+ status: answer.status,
499
+ headers,
500
+ body
501
+ };
502
+ };
503
+ }
504
+ /**
505
+ * The unresolved issues of one project.
506
+ *
507
+ * One page and no paging. The caller's limit is the bound on how many findings one press can open, and
508
+ * a person who presses a button does not expect a backlog of a thousand rows on the Scout screen.
509
+ */
510
+ async function sentryIssues(call, org, project, limit, signal) {
511
+ if (!SLUG.test(org) || !SLUG.test(project)) throw new Error(`${org}/${project} is not a Sentry organization and project. Open the source on the Scout page and write each as it appears in the address of the project in Sentry.`);
512
+ const answer = await call(sentryIssuesPath(org, project, limit), signal);
513
+ if (answer.status !== 200) throw new Error(sentryRefused(answer));
514
+ return readSentryIssues(answer.body);
515
+ }
516
+ //#endregion
517
+ //#region ../../packages/runner/src/tickets/github-ci.ts
518
+ /**
519
+ * The failed CI runs of a repository's default branch, through `gh`.
520
+ *
521
+ * NOT RECORDED. Every field name below is written from the REST API's shape and not from an answer
522
+ * this project has read, because reading one would be a call to GitHub. The test beside this file
523
+ * says what a first real recording has to confirm. Until then treat a CI finding as unverified.
524
+ *
525
+ * Read-only, the same way `github.ts` is: `-X GET` on every call, because `gh api` with a `-f` field
526
+ * defaults to POST.
527
+ */
528
+ var NAME = /^[A-Za-z0-9._-]+$/;
529
+ var MAX_PAGE = 100;
530
+ /** The repository's default branch, or null when the answer did not name one. */
531
+ function defaultBranch(stdout) {
532
+ try {
533
+ const body = JSON.parse(stdout);
534
+ return typeof body.default_branch === "string" && body.default_branch !== "" ? body.default_branch : null;
535
+ } catch {
536
+ return null;
537
+ }
538
+ }
539
+ /**
540
+ * The failed runs in one answer.
541
+ *
542
+ * `conclusion` is asserted here as well as asked for in the query. The filter is the server's and
543
+ * this is ours: a run that came back with any other conclusion is dropped, so a passing run can
544
+ * never become a finding because a query field was spelled wrong or was ignored.
545
+ *
546
+ * A body with no `workflow_runs` is a refusal and not an empty list. A rate limited or unauthorised
547
+ * `gh api` prints readable JSON with no rows in it, and an empty list would read as a repository
548
+ * whose CI is green.
549
+ */
550
+ function readRuns(repo, branch, stdout) {
551
+ let body;
552
+ try {
553
+ body = JSON.parse(stdout);
554
+ } catch {
555
+ throw new Error(`GitHub answered the CI runs of ${repo} with something Nolzu could not read. Run gh api repos/${repo}/actions/runs in a terminal to see what it says.`);
556
+ }
557
+ if (!Array.isArray(body.workflow_runs)) throw new Error(`GitHub did not list the CI runs of ${repo}. Check that the repository name is right and that gh may read its Actions.`);
558
+ const found = [];
559
+ for (const row of body.workflow_runs) {
560
+ if (row.conclusion !== "failure") continue;
561
+ if (typeof row.id !== "number" || !Number.isInteger(row.id)) continue;
562
+ if (typeof row.head_branch === "string" && row.head_branch !== branch) continue;
563
+ found.push({
564
+ repo,
565
+ workflow: typeof row.name === "string" && row.name !== "" ? row.name : "CI",
566
+ branch,
567
+ id: row.id
568
+ });
569
+ }
570
+ return found;
571
+ }
572
+ /**
573
+ * Two calls: which branch is the default one, then its failed runs.
574
+ *
575
+ * The branch is asked for rather than taken from the project's own git remote, because a source can
576
+ * watch a repository this machine has no clone of.
577
+ */
578
+ async function failedRuns(run, owner, repo, limit, signal) {
579
+ if (!NAME.test(owner) || !NAME.test(repo)) throw new Error(`${owner}/${repo} is not a repository name. Write it as owner/repo, such as acme/app.`);
580
+ const slug = `${owner}/${repo}`;
581
+ const branch = defaultBranch((await run([
582
+ "api",
583
+ "-X",
584
+ "GET",
585
+ `repos/${slug}`
586
+ ], signal)).stdout);
587
+ if (branch === null) throw new Error(`GitHub did not name the default branch of ${slug}. Check the repository name in the source on the Scout page, and that your gh login may read it.`);
588
+ return readRuns(slug, branch, (await run([
589
+ "api",
590
+ "-X",
591
+ "GET",
592
+ `repos/${slug}/actions/runs`,
593
+ "-f",
594
+ `branch=${branch}`,
595
+ "-f",
596
+ "status=failure",
597
+ "-F",
598
+ `per_page=${Math.min(limit, MAX_PAGE)}`
599
+ ], signal)).stdout);
600
+ }
601
+ //#endregion
602
+ //#region src/lib/scout-assess.ts
603
+ var PARTS = [
604
+ {
605
+ field: "evidence",
606
+ heading: "The evidence"
607
+ },
608
+ {
609
+ field: "cause",
610
+ heading: "The likely cause"
611
+ },
612
+ {
613
+ field: "proposal",
614
+ heading: "The proposal"
615
+ },
616
+ {
617
+ field: "effort",
618
+ heading: "The effort"
619
+ },
620
+ {
621
+ field: "risks",
622
+ heading: "The risks"
623
+ }
624
+ ];
625
+ /**
626
+ * The assessment a run wrote, or the reason it cannot be read.
627
+ *
628
+ * All five parts or none of them. Half an assessment reads as an answer while it is missing the very
629
+ * part a person decides on, so a file with a section missing or empty is refused with a sentence
630
+ * naming that section, and nothing is kept.
631
+ */
632
+ function readAssessment(text) {
633
+ const sections = /* @__PURE__ */ new Map();
634
+ let heading = null;
635
+ let body = [];
636
+ const close = () => {
637
+ if (heading !== null) sections.set(heading, body.join("\n").trim());
638
+ body = [];
639
+ };
640
+ for (const line of text.split("\n")) {
641
+ const match = /^#{1,6}\s+(.+?)\s*$/.exec(line);
642
+ if (match === null) {
643
+ body.push(line);
644
+ continue;
645
+ }
646
+ close();
647
+ heading = (match[1] ?? "").toLowerCase();
648
+ }
649
+ close();
650
+ const parts = {};
651
+ for (const part of PARTS) {
652
+ const found = sections.get(part.heading.toLowerCase());
653
+ if (found === void 0) return {
654
+ ok: false,
655
+ problem: `The assessment has no "${part.heading}" section, so there is nothing to read under it. Start the assessment again.`
656
+ };
657
+ if (found === "") return {
658
+ ok: false,
659
+ problem: `The "${part.heading}" section of the assessment is empty, so it answers nothing. Start the assessment again.`
660
+ };
661
+ parts[part.field] = found;
662
+ }
663
+ return {
664
+ ok: true,
665
+ parts
666
+ };
667
+ }
668
+ PARTS.map((part) => part.heading);
669
+ /**
670
+ * Start an assessment of one finding.
671
+ *
672
+ * A sentence and never a throw, the way Dismiss and Unmute answer on this screen: the finding may
673
+ * have gone with its source in another tab, and the person still has to read why their button did
674
+ * nothing.
675
+ */
676
+ function answerAssess(live, form) {
677
+ const typed = (form.get("id")?.toString() ?? "").trim();
678
+ if (!/^\d+$/.test(typed)) return {
679
+ ok: false,
680
+ message: "That button posted no finding id. Load the Scout screen again and press it once more."
681
+ };
682
+ try {
683
+ if (!live.assess(Number(typed))) return {
684
+ ok: false,
685
+ message: `The assessment of finding ${typed} did not start, so nothing was read. Try it again.`
686
+ };
687
+ return {
688
+ ok: true,
689
+ message: `An assessment of finding ${typed} is running. It reads and writes what it found, and changes nothing.`
690
+ };
691
+ } catch (error) {
692
+ return {
693
+ ok: false,
694
+ message: error.message
695
+ };
696
+ }
697
+ }
698
+ //#endregion
699
+ //#region src/lib/scout-actions.ts
700
+ /**
701
+ * The four writers the Scout screens post to, in one place.
702
+ *
703
+ * The findings list and one finding's own page offer the same buttons on the same finding, so they
704
+ * post to one set of actions. Two copies would let the answer a person reads depend on which screen
705
+ * the button was on.
706
+ */
707
+ var said = (answer, did) => answer.ok ? {
708
+ did,
709
+ said: answer.message
710
+ } : fail(400, {
711
+ did,
712
+ problem: answer.message
713
+ });
714
+ var toldLoop = (answer) => {
715
+ if (answer.ok) loop().changed();
716
+ return answer;
717
+ };
718
+ var scoutActions = {
719
+ dismiss: async ({ request }) => said(toldLoop(muteScoutFinding(database(), await request.formData(), true)), "dismiss"),
720
+ unmute: async ({ request }) => said(toldLoop(muteScoutFinding(database(), await request.formData(), false)), "unmute"),
721
+ assess: async ({ request }) => said(answerAssess(loop(), await request.formData()), "assess"),
722
+ start: async ({ request }) => said(answerStart(loop(), await request.formData()), "start")
723
+ };
724
+ //#endregion
725
+ //#region src/lib/scout-search.ts
726
+ /**
727
+ * The one call the log query source makes, and the API key that goes with it.
728
+ *
729
+ * The adapter in `@nolzu/core` is pure and holds the whole shape of the request and the answer. This
730
+ * file is the socket and the keychain, which that package may not have, and nothing more.
731
+ *
732
+ * Nothing here was measured either. No cluster answered this machine, so the header below is the
733
+ * documented one: an API key for Elasticsearch, and basic auth for a plain OpenSearch.
734
+ */
735
+ var READ_TIMEOUT_MS$2 = 3e4;
736
+ /**
737
+ * The cluster address a person typed, as an origin.
738
+ *
739
+ * https everywhere but this machine. The key goes into a header, so http would put it on the wire in
740
+ * the clear, and a cluster on localhost is the one case where there is no wire. A user name or a
741
+ * password in the address is refused rather than used, because the credential belongs in the keychain.
742
+ * Nothing the person typed is echoed back: a mistyped address can hold the password they meant to
743
+ * keep out of it, and this sentence is written into sqlite and shown on the Scout page.
744
+ *
745
+ * ponytail: an address with a path is refused and not shortened. Dropping the path sent the query to
746
+ * the wrong place and the 404 that came back blamed the index, which is the one field that was right.
747
+ * Carrying the path as a prefix is the upgrade, and it is worth making when somebody runs a cluster
748
+ * behind a proxy at one.
749
+ */
750
+ function clusterOrigin(value) {
751
+ let url;
752
+ try {
753
+ url = new URL(value.trim());
754
+ } catch {
755
+ throw new Error("That is not a cluster address. Open the source on the Scout page and write it as https://logs.example.com:9200.");
756
+ }
757
+ if (url.protocol !== "https:" && url.protocol !== "http:") throw new Error("A cluster address starts with https. Open the source on the Scout page and write it as https://logs.example.com:9200.");
758
+ if (url.username !== "" || url.password !== "") throw new Error("A cluster address carries no user name and no password. The API key goes into the keychain.");
759
+ const here = url.hostname === "localhost" || url.hostname === "127.0.0.1" || url.hostname === "[::1]";
760
+ if (url.protocol !== "https:" && !here) throw new Error("A cluster address starts with https, so the API key is never sent in the clear. http is allowed for a cluster on this machine only.");
761
+ if (url.pathname !== "/" || url.search !== "" || url.hash !== "") throw new Error("A cluster address is the host and the port, with nothing after them. Open the source on the Scout page and write it as https://logs.example.com:9200.");
762
+ return new URL(url.origin);
763
+ }
764
+ /**
765
+ * The credential, as one Authorization header.
766
+ *
767
+ * Elasticsearch takes `ApiKey` and an encoded key. A plain OpenSearch takes basic auth, so a key
768
+ * typed as `user:password` is read that way: an encoded Elasticsearch key is base64 and can hold no
769
+ * colon, which is what makes the two cases tell themselves apart with no second field on the form.
770
+ * A key that already names its own scheme is passed on as it is, which is the way out for a cluster
771
+ * that wants something else.
772
+ */
773
+ function clusterAuth(key) {
774
+ const typed = key.trim();
775
+ if (/^(ApiKey|Basic|Bearer) /i.test(typed)) return typed;
776
+ if (typed.includes(":")) return `Basic ${Buffer.from(typed, "utf8").toString("base64")}`;
777
+ return `ApiKey ${typed}`;
778
+ }
779
+ /**
780
+ * One log query, read and folded into items.
781
+ *
782
+ * The address and the index are checked before the keychain, because both checks cost nothing and a
783
+ * keychain read can put an OS password dialog in front of the person. A typo in the index should not
784
+ * cost them that.
785
+ */
786
+ async function read$2(source, keychain, seams) {
787
+ const origin = clusterOrigin(source.config.endpoint ?? "");
788
+ const request = searchRequest(source.config.index ?? "", source.config.query ?? "", source.cursor);
789
+ const key = await sourceSecret(keychain, source);
790
+ if (key === null || key.trim() === "") throw new Error(`There is no API key for "${source.label}" in this machine's keychain under ${scoutEntry(sourceEntry(source) ?? "")}. Open the source on the Scout page, paste the key, and save it.`);
791
+ const signal = AbortSignal.timeout(seams.timeoutMs ?? READ_TIMEOUT_MS$2);
792
+ const fetcher = seams.fetcher ?? ((url, init) => fetch(url, init));
793
+ let answer;
794
+ let body;
795
+ try {
796
+ answer = await fetcher(new URL(request.path, origin).toString(), {
797
+ method: "POST",
798
+ headers: {
799
+ authorization: clusterAuth(key),
800
+ "content-type": "application/json",
801
+ accept: "application/json"
802
+ },
803
+ body: request.body,
804
+ signal
805
+ });
806
+ body = await answer.text();
807
+ } catch {
808
+ throw new Error(signal.aborted ? `The cluster at ${origin.host} did not answer in time, so nothing was read. Try again, or narrow the query in the source on the Scout page.` : `Nolzu could not reach ${origin.host}. Check the cluster address in the source on the Scout page, and the network.`);
809
+ }
810
+ return fetchSearch({
811
+ status: answer.status,
812
+ contentType: (answer.headers.get("content-type") ?? "").toLowerCase(),
813
+ body
814
+ }, source.cursor);
815
+ }
816
+ /**
817
+ * How many log lines the source can read, for "Test the connection". The same request as a first
818
+ * check, with nothing stored.
819
+ */
820
+ async function logsReadable(source, keychain, seams = {}) {
821
+ return count((await read$2(source, keychain, seams)).items.length, "log line", "log lines");
822
+ }
823
+ /**
824
+ * Check one log query source with what its cluster answers.
825
+ *
826
+ * Its own action, the way the ticket query has one: the keychain is needed here and may not be built
827
+ * on the path that renders the Scout page, because a keychain call can put an OS password dialog
828
+ * in front of the person who only opened a page.
829
+ */
830
+ async function checkLogQuery(db, keychain, form, seams = {}) {
831
+ const id = Number(form.get("id")?.toString() ?? "");
832
+ const answer = await checkSearchSource(db, id, (source) => read$2(source, keychain, seams));
833
+ if (answer.error !== null) return {
834
+ ok: false,
835
+ checked: null,
836
+ message: answer.error
837
+ };
838
+ if (answer.added === 0 && answer.met === 0 && answer.muted === 0) return {
839
+ ok: true,
840
+ checked: "Checked. The cluster answered no line this source has not read already.",
841
+ message: null
842
+ };
843
+ return {
844
+ ok: true,
845
+ checked: checkedSentence(answer),
846
+ message: null
847
+ };
848
+ }
849
+ //#endregion
850
+ //#region src/lib/scout-sentry.ts
851
+ var READ_TIMEOUT_MS$1 = 3e4;
852
+ /**
853
+ * The unresolved issues of one Sentry project.
854
+ *
855
+ * The keychain read comes after the two settings are checked, because those checks cost nothing and a
856
+ * keychain read can put an OS password dialog in front of the person.
857
+ *
858
+ * The rows come back as they are and the fold into groups happens at the call, because the sentence the
859
+ * button prints has to know how many issues the answer carried and the fold no longer says.
860
+ */
861
+ async function read$1(source, keychain, seams) {
862
+ const org = source.config.org ?? "";
863
+ const project = source.config.project ?? "";
864
+ if (org === "" || project === "") throw new Error(`The source "${source.label}" is missing its organization or its project. Open the source on the Scout page and write both as they appear in the address of the project in Sentry.`);
865
+ const token = await sourceSecret(keychain, source);
866
+ if (token === null) throw new Error(`There is no Auth token for "${source.label}" in this machine's keychain under ${scoutEntry(sourceEntry(source) ?? "")}. Open the source on the Scout page, paste the token, and save it.`);
867
+ const signal = AbortSignal.timeout(READ_TIMEOUT_MS$1);
868
+ return sentryIssues(sentryCall(token, seams.fetcher), org, project, 30, signal);
869
+ }
870
+ /**
871
+ * How many issues the source can read, for "Test the connection". The same read as a check, with
872
+ * nothing stored.
873
+ */
874
+ async function sentryReadable(source, keychain, seams = {}) {
875
+ return count((await read$1(source, keychain, seams)).length, "issue", "issues");
876
+ }
877
+ /**
878
+ * Check one Sentry source with what Sentry answers.
879
+ *
880
+ * Its own action and not a word on the paste check, because that one takes a database and a post and
881
+ * nothing else: a keychain handed in there would let opening the Scout page ask for a keychain
882
+ * password. Here a person pressed a button, so a keychain read may happen.
883
+ */
884
+ async function checkSentryIssues(db, keychain, form, seams = {}) {
885
+ const id = Number(form.get("id")?.toString() ?? "");
886
+ let carried = 0;
887
+ const answer = await checkSentrySource(db, id, async (source) => {
888
+ const issues = await read$1(source, keychain, seams);
889
+ carried = issues.length;
890
+ return fetchSentry(issues, source.cursor);
891
+ });
892
+ if (answer.error !== null) return {
893
+ ok: false,
894
+ checked: null,
895
+ message: answer.error
896
+ };
897
+ if (answer.added === 0 && answer.met === 0 && answer.muted === 0) return {
898
+ ok: true,
899
+ checked: carried === 0 ? "Checked. Sentry answered no unresolved issue for this project." : "Checked. Sentry counted no new events on the issues this source has already reported.",
900
+ message: null
901
+ };
902
+ return {
903
+ ok: true,
904
+ checked: checkedSentence(answer),
905
+ message: null
906
+ };
907
+ }
908
+ //#endregion
909
+ //#region src/lib/scout-tickets.ts
910
+ var READ_TIMEOUT_MS = 3e4;
911
+ /**
912
+ * The token or the key of one source, from this source's own keychain entry.
913
+ *
914
+ * Its own entry and not one name for the whole account, so two sources can hold two credentials.
915
+ * `jiraFromKeychain` reads the account-wide name, which is why it is not used here.
916
+ */
917
+ async function secret(source, keychain, word) {
918
+ const held = await sourceSecret(keychain, source);
919
+ if (held === null) throw new Error(`There is no API ${word} for "${source.label}" in this machine's keychain under ${scoutEntry(sourceEntry(source) ?? "")}. Open the source on the Scout page, paste the ${word}, and save it.`);
920
+ return held;
921
+ }
922
+ /**
923
+ * The plan, asked of the system it names.
924
+ *
925
+ * Only the calls are here. What to ask is `ticketPlan` in `@nolzu/core`, which also refuses a
926
+ * repository, a site address or a teams field a person mistyped, so nothing below runs for one.
927
+ */
928
+ async function ask(plan, source, keychain, seams, signal) {
929
+ if (plan.system === "github") {
930
+ const run = seams.run ?? ghRunner();
931
+ return {
932
+ tickets: await githubIssues({
933
+ run,
934
+ defaultOwner: null
935
+ }).search(plan.query, signal),
936
+ runs: await failedRuns(run, plan.owner, plan.repo, plan.ciLimit, signal)
937
+ };
938
+ }
939
+ if (plan.system === "gitlab") return {
940
+ tickets: await gitlabIssues(seams.glab ?? glabRunner(), plan.project, plan.terms, plan.limit, signal),
941
+ runs: []
942
+ };
943
+ if (plan.system === "jira") return {
944
+ tickets: await jiraIssues(jiraCall(plan.site, await secret(source, keychain, "token"), seams.fetcher)).search(plan.query, signal),
945
+ runs: []
946
+ };
947
+ /**
948
+ * The Linear half: the open tickets of the teams the person named.
949
+ *
950
+ * NOT RECORDED. No call to Linear has been made from this project, so treat what a Linear source
951
+ * reports as unverified until somebody records one real answer. `linear.test.ts` names what that
952
+ * first call has to confirm.
953
+ */
954
+ if (plan.system === "linear") return {
955
+ tickets: await linearIssues(linearCall(await secret(source, keychain, "key"), seams.linear)).search(plan.query, signal),
956
+ runs: []
957
+ };
958
+ throw new Error(`A ticket source of the kind ${String(plan)} is one this build cannot read.`);
959
+ }
960
+ /**
961
+ * One ticket query, read and folded into items.
962
+ *
963
+ * Every call is made here and none of it inside the transaction the check opens next. Neither Jira nor
964
+ * Linear has CI to report, which is why only the GitHub branch asks for runs.
965
+ */
966
+ async function read(source, keychain, seams) {
967
+ const { tickets, runs } = await ask(ticketPlan(source.config), source, keychain, seams, AbortSignal.timeout(READ_TIMEOUT_MS));
968
+ return fetchTickets(tickets, runs, source.cursor);
969
+ }
970
+ /**
971
+ * How many tickets the source can read, and failed CI runs for GitHub, for "Test the connection". The
972
+ * same calls as a check, with nothing stored.
973
+ */
974
+ async function ticketsReadable(source, keychain, seams = {}) {
975
+ const plan = ticketPlan(source.config);
976
+ const { tickets, runs } = await ask(plan, source, keychain, seams, AbortSignal.timeout(READ_TIMEOUT_MS));
977
+ const read = count(tickets.length, "ticket", "tickets");
978
+ return plan.system === "github" ? `${read} and ${count(runs.length, "failed CI run", "failed CI runs")}` : read;
979
+ }
980
+ /**
981
+ * Check one ticket query source with what its system answers.
982
+ *
983
+ * Its own action and not a word on the paste check, because that one takes a database and a post and
984
+ * nothing else: a keychain handed in there would let opening the Scout page ask for a keychain
985
+ * password. Here a person pressed a button, so a keychain read may happen, and it happens for a Jira
986
+ * or a Linear source only. A GitHub source stores no token at all, so nothing here touches the
987
+ * keychain for one.
988
+ */
989
+ async function checkTicketQuery(db, keychain, form, seams = {}) {
990
+ const id = Number(form.get("id")?.toString() ?? "");
991
+ const answer = await checkTicketSource(db, id, (source) => read(source, keychain, seams));
992
+ if (answer.error !== null) return {
993
+ ok: false,
994
+ checked: null,
995
+ message: answer.error
996
+ };
997
+ if (answer.added === 0 && answer.met === 0 && answer.muted === 0) return {
998
+ ok: true,
999
+ checked: "Checked. The query answered nothing this source has not reported already.",
1000
+ message: null
1001
+ };
1002
+ return {
1003
+ ok: true,
1004
+ checked: checkedSentence(answer),
1005
+ message: null
1006
+ };
1007
+ }
1008
+ //#endregion
1009
+ //#region src/lib/scout-check-all.ts
1010
+ var CHECKS = {
1011
+ tickets: checkTicketQuery,
1012
+ sentry: checkSentryIssues,
1013
+ search: checkLogQuery
1014
+ };
1015
+ var readable = (one) => one.enabled && one.kind !== "paste";
1016
+ /**
1017
+ * One source's own check, the one its Check now button posts to, or null for a pasted text source,
1018
+ * whose text comes with the press of its own box. "Add and check now" reads a new source with it.
1019
+ */
1020
+ async function checkSource(db, keychain, source, checks = CHECKS) {
1021
+ if (source.kind === "paste") return null;
1022
+ const form = new FormData();
1023
+ form.set("id", String(source.id));
1024
+ return checks[source.kind](db, keychain, form);
1025
+ }
1026
+ /**
1027
+ * Add, save or remove a source, then read a new one once when the dialog's "Add and check now" asked
1028
+ * for it with `check=now`. Any other poster never sets off a check. Pasted text is only added, because
1029
+ * it has no text yet.
1030
+ */
1031
+ async function saveAndCheck(db, keychain, form, hub, checks = CHECKS) {
1032
+ const answer = await saveScoutSource(db, keychain, form, hub);
1033
+ const added = !answer.ok || answer.id === void 0 || form.get("check") !== "now" ? null : scoutSource(db, answer.id);
1034
+ return {
1035
+ answer,
1036
+ checked: added === null ? null : await checkSource(db, keychain, added, checks)
1037
+ };
1038
+ }
1039
+ /**
1040
+ * Check all sources: every source that is on and that a press can read, each through its own check.
1041
+ *
1042
+ * Only a press calls this, from the Scout page or the palette. Nothing checks on a timer.
1043
+ *
1044
+ * ponytail: one source after the other, so two keychain prompts never stack and the database sees one
1045
+ * writer at a time. Read them side by side if a project with many slow sources waits too long.
1046
+ */
1047
+ async function checkAllSources(db, keychain, checks = CHECKS) {
1048
+ const sources = scoutSources(db);
1049
+ const read = sources.filter(readable);
1050
+ if (sources.length === 0) return {
1051
+ ok: false,
1052
+ said: "There is no source to check yet. Add one first.",
1053
+ failed: []
1054
+ };
1055
+ if (read.length === 0) return {
1056
+ ok: false,
1057
+ said: "No source here can be checked in one press. A pasted text source takes its text in its own box, and a source that is turned off is not checked.",
1058
+ failed: []
1059
+ };
1060
+ const findings = () => db.prepare("SELECT count(*) AS n FROM scout_findings").get().n;
1061
+ const before = findings();
1062
+ const failed = [];
1063
+ for (const source of read) {
1064
+ const answer = await checkSource(db, keychain, source, checks);
1065
+ if (answer !== null && !answer.ok) failed.push(`${source.label}: ${answer.message ?? "the check failed."}`);
1066
+ }
1067
+ const checked = read.length - failed.length;
1068
+ if (checked === 0) return {
1069
+ ok: false,
1070
+ said: "No source could be read.",
1071
+ failed
1072
+ };
1073
+ const added = findings() - before;
1074
+ const pasted = sources.some((one) => one.enabled && one.kind === "paste") ? " A pasted text source takes its text in its own box, so it was left out." : "";
1075
+ return {
1076
+ ok: true,
1077
+ said: `Checked ${count(checked, "source", "sources")}. ${added === 0 ? "No new finding" : count(added, "new finding", "new findings")}.${pasted}`,
1078
+ failed
1079
+ };
1080
+ }
1081
+ //#endregion
1082
+ //#region src/lib/scout-connection.ts
1083
+ var PROBES = {
1084
+ tickets: (source, keychain) => ticketsReadable(source, keychain),
1085
+ sentry: (source, keychain) => sentryReadable(source, keychain),
1086
+ search: (source, keychain) => logsReadable(source, keychain)
1087
+ };
1088
+ var refused = (message) => ({
1089
+ ok: false,
1090
+ readable: null,
1091
+ where: null,
1092
+ took: null,
1093
+ message
1094
+ });
1095
+ var whereOf = (form, config) => form.kind === "sentry" ? `${config.org ?? ""}/${config.project ?? ""}` : config[form.fields[0]?.name ?? ""] ?? "";
1096
+ /**
1097
+ * Test the connection: one read with the form as the dialog holds it, before anything is stored.
1098
+ *
1099
+ * No database is handed in, so the read cannot use a saved row: the settings come from the form, and so
1100
+ * does the token when one was typed. With the token field left empty, as on a source that is open, the
1101
+ * one entry the form names is read, or the old `scout-<id>` one of an older source. The keychain handed
1102
+ * to the read answers for that entry alone and refuses every write, so the test moves nothing and
1103
+ * stores nothing. The cursor is empty, so the read is the newest page a first check would read.
1104
+ */
1105
+ async function testConnection(keychain, form, probes = PROBES, clock = () => performance.now()) {
1106
+ const chosen = SOURCE_FORMS.find((one) => one.id === asked(form, "form"));
1107
+ if (chosen === void 0) return refused(`There is no source ${asked(form, "form")}. Pick one of the kinds on the list.`);
1108
+ if (chosen.kind === "paste") return refused("A pasted text source has nothing to connect to. Paste a log into it and press Check now.");
1109
+ const read = sourceSettings(chosen, form);
1110
+ if ("message" in read) return refused(read.message);
1111
+ const id = Number(asked(form, "id"));
1112
+ const source = {
1113
+ id: Number.isInteger(id) && id > 0 ? id : 0,
1114
+ kind: chosen.kind,
1115
+ label: asked(form, "label") || chosen.label,
1116
+ config: read.config,
1117
+ enabled: true,
1118
+ createCards: false,
1119
+ autoAssess: false,
1120
+ scheduleMinutes: 0,
1121
+ notify: false,
1122
+ cursor: null,
1123
+ lastChecked: null,
1124
+ lastError: null
1125
+ };
1126
+ const typed = asked(form, "secret");
1127
+ if (chosen.secret !== null && typed === "" && source.id === 0) return refused(`Paste the ${chosen.secret} first, so the test has something to connect with.`);
1128
+ const name = sourceEntry(source);
1129
+ const nothing = () => Promise.reject(/* @__PURE__ */ new Error("A test of the connection stores nothing."));
1130
+ const held = {
1131
+ read: async (asking) => {
1132
+ if (asking !== name) return null;
1133
+ if (typed !== "") return typed;
1134
+ return await keychain.read(asking) ?? await keychain.read(scoutSecretName(source.id));
1135
+ },
1136
+ write: nothing,
1137
+ remove: nothing
1138
+ };
1139
+ const start = clock();
1140
+ try {
1141
+ return {
1142
+ ok: true,
1143
+ readable: `${await probes[chosen.kind](source, held)} readable`,
1144
+ where: whereOf(chosen, read.config),
1145
+ took: `${((clock() - start) / 1e3).toFixed(1)}s`,
1146
+ message: null
1147
+ };
1148
+ } catch (error) {
1149
+ return refused(error instanceof Error ? error.message : "The read failed and gave no reason.");
1150
+ }
1151
+ }
1152
+ //#endregion
1153
+ //#region src/lib/scout-detail.ts
1154
+ var ASSESSMENT_FILE = "assess/assessment.md";
1155
+ /**
1156
+ * The assessment of one finding, read back off disk.
1157
+ *
1158
+ * No file is the normal case before the first run, so it reads as a state and not as a problem.
1159
+ * Anything else is the reader's own sentence, about a file that is there and cannot be shown.
1160
+ */
1161
+ function assessmentOf(db, one, env) {
1162
+ const key = assessKey(one.id);
1163
+ const dir = cardFolder(db, key, env);
1164
+ if (dir === null) return {
1165
+ assessment: null,
1166
+ note: {
1167
+ text: `The run folder of finding ${one.id} has no name this app can read, so its assessment cannot be found.`,
1168
+ refused: true
1169
+ }
1170
+ };
1171
+ const runs = cardRuns(db, key);
1172
+ const going = runs.some((run) => run.state === null || !ENDED.includes(run.state));
1173
+ if (!existsSync(join(dir, ASSESSMENT_FILE))) return {
1174
+ assessment: null,
1175
+ note: {
1176
+ text: runs.length === 0 ? "No assessment has been written for this finding." : going ? "An assessment of this finding was started. What it found shows here once it has been written." : "An assessment of this finding was started and ended without writing anything.",
1177
+ refused: false
1178
+ }
1179
+ };
1180
+ const read = readCardFile(dir, ASSESSMENT_FILE);
1181
+ if (!read.ok) return {
1182
+ assessment: null,
1183
+ note: {
1184
+ text: read.reason,
1185
+ refused: true
1186
+ }
1187
+ };
1188
+ const found = readAssessment(read.bytes.toString("utf8"));
1189
+ if (!found.ok) return {
1190
+ assessment: null,
1191
+ note: {
1192
+ text: found.problem,
1193
+ refused: true
1194
+ }
1195
+ };
1196
+ return {
1197
+ assessment: found.parts,
1198
+ note: going ? {
1199
+ text: "A new assessment of this finding is running. What is below is the round before it.",
1200
+ refused: false
1201
+ } : null
1202
+ };
1203
+ }
1204
+ /**
1205
+ * The newest completed assessment run, in the words the Assessment heading prints.
1206
+ *
1207
+ * Completed and not the newest, because a run that is going has written nothing yet and the parts on
1208
+ * the page are the round before it. A part the run never reported is left out, and a cost nobody
1209
+ * reported is never $0.00.
1210
+ */
1211
+ function runLine(db, one) {
1212
+ const run = cardRuns(db, assessKey(one.id)).findLast((each) => each.state === "complete");
1213
+ if (run === void 0) return null;
1214
+ return `read-only run, ${[
1215
+ engineName(run.engine),
1216
+ run.model,
1217
+ run.durationMs === null ? null : formatDuration(run.durationMs),
1218
+ run.costUsd === null ? null : formatCost(run.costUsd)
1219
+ ].filter((part) => part !== null).join(" · ")}`;
1220
+ }
1221
+ /**
1222
+ * One finding by the id in its address.
1223
+ *
1224
+ * A word, or a number no finding has, is a page that is not there. Both answer the same sentence,
1225
+ * the way the ticket page answers for a key no card has: an empty screen would read as one that
1226
+ * broke, and a redirect to the list would hide that the address was wrong.
1227
+ */
1228
+ function scoutFindingDetail(db, asked, env = process.env) {
1229
+ const typed = (asked ?? "").trim();
1230
+ const isNumber = /^[1-9]\d*$/.test(typed);
1231
+ const gone = {
1232
+ ok: false,
1233
+ status: 404,
1234
+ message: `There is no finding ${isNumber ? typed : JSON.stringify(typed)} here. Check the address, or open the Scout screen to see what Scout found.`
1235
+ };
1236
+ if (!isNumber) return gone;
1237
+ const one = scoutFinding(db, Number(typed));
1238
+ if (one === null) return gone;
1239
+ return {
1240
+ ok: true,
1241
+ detail: {
1242
+ row: scoutRow(one, scoutSource(db, one.sourceId)?.label ?? "", cardsOnBoard(db, [one]), assessing(db).has(assessKey(one.id))),
1243
+ ...assessmentOf(db, one, env),
1244
+ run: runLine(db, one),
1245
+ canDismiss: one.status !== "dismissed",
1246
+ canUnmute: one.status === "dismissed"
1247
+ }
1248
+ };
1249
+ }
1250
+ //#endregion
1251
+ //#region src/lib/scout-page.ts
1252
+ /**
1253
+ * What both Scout addresses draw: the findings, the sources they come from, and the finding on show.
1254
+ * `/scout` shows the one seen last, and `/scout/f/<id>` its own, which that route reads first.
1255
+ *
1256
+ * Rows only: a source's token is in the OS keychain, and reading it here would ask the person for
1257
+ * their keychain password every time they open this screen.
1258
+ *
1259
+ * Opening Scout moves the seen marker, and the loop's change report carries that to the rail's dot on
1260
+ * every open page. Only when it moved, so a visit with nothing new wakes no stream.
1261
+ *
1262
+ * The first visit names the owner of the project's GitHub remote on the GitHub card. That is one git
1263
+ * call, so it goes as a promise the page does not wait for, and only while there is no source.
1264
+ */
1265
+ function scoutPage(finding) {
1266
+ const db = database();
1267
+ if (markScoutSeen(db)) loop().changed();
1268
+ const findings = scoutFindingsFor(db);
1269
+ const first = findings.rows[0];
1270
+ const read = (id) => {
1271
+ const found = scoutFindingDetail(db, String(id));
1272
+ return found.ok ? found.detail : null;
1273
+ };
1274
+ const scout = scoutFor(db);
1275
+ return {
1276
+ findings,
1277
+ scout,
1278
+ githubOwner: scout.rows.length === 0 ? remoteOwner(db) : Promise.resolve(null),
1279
+ finding: finding ?? (first === void 0 ? null : read(first.id))
1280
+ };
1281
+ }
1282
+ //#endregion
1283
+ //#region src/routes/scout/+page.server.ts
1284
+ var load = () => scoutPage();
1285
+ var hubDeps = () => ({
1286
+ projectId: getSetting(database(), "projectId"),
1287
+ send: (schedule) => sendToHub("scout.schedule", schedule, loop().project)
1288
+ });
1289
+ var afterCheck = (answer) => {
1290
+ if (answer.ok) loop().changed();
1291
+ return answer;
1292
+ };
1293
+ var actions = {
1294
+ ...scoutActions,
1295
+ scout: async ({ request }) => {
1296
+ const keychain = createKeychain(process.platform, runKeychain, resolveDataDir(process.env));
1297
+ const { answer, checked } = await saveAndCheck(database(), keychain, await request.formData(), hubDeps());
1298
+ if (!answer.ok) return fail(400, {
1299
+ field: answer.did,
1300
+ message: answer.message
1301
+ });
1302
+ if (checked === null) return {
1303
+ field: answer.did,
1304
+ saved: true
1305
+ };
1306
+ afterCheck(checked);
1307
+ return {
1308
+ field: answer.did,
1309
+ saved: true,
1310
+ checked: checked.checked,
1311
+ message: checked.message
1312
+ };
1313
+ },
1314
+ test: async ({ request }) => {
1315
+ const answer = await testConnection(createKeychain(process.platform, runKeychain, resolveDataDir(process.env)), await request.formData());
1316
+ return answer.ok ? {
1317
+ field: "test",
1318
+ readable: answer.readable ?? "",
1319
+ where: answer.where ?? "",
1320
+ took: answer.took ?? ""
1321
+ } : fail(400, {
1322
+ field: "test",
1323
+ message: answer.message
1324
+ });
1325
+ },
1326
+ check: async ({ request }) => {
1327
+ const answer = afterCheck(checkScoutSource(database(), await request.formData()));
1328
+ return answer.ok ? {
1329
+ field: "check",
1330
+ checked: answer.checked,
1331
+ saved: true
1332
+ } : fail(400, {
1333
+ field: "check",
1334
+ message: answer.message
1335
+ });
1336
+ },
1337
+ firstPaste: async ({ request }) => {
1338
+ const answer = afterCheck(checkFirstPaste(database(), await request.formData()));
1339
+ return answer.ok ? {
1340
+ field: "check",
1341
+ checked: answer.checked,
1342
+ saved: true
1343
+ } : fail(400, {
1344
+ field: "check",
1345
+ message: answer.message
1346
+ });
1347
+ },
1348
+ checkAll: async () => {
1349
+ const answer = await checkAllSources(database(), createKeychain(process.platform, runKeychain, resolveDataDir(process.env)));
1350
+ if (answer.ok) loop().changed();
1351
+ return answer.ok ? {
1352
+ field: "checkAll",
1353
+ checked: answer.said,
1354
+ failed: answer.failed,
1355
+ saved: true
1356
+ } : fail(400, {
1357
+ field: "checkAll",
1358
+ message: answer.said,
1359
+ failed: answer.failed
1360
+ });
1361
+ },
1362
+ checkTickets: async ({ request }) => {
1363
+ const answer = afterCheck(await checkTicketQuery(database(), createKeychain(process.platform, runKeychain, resolveDataDir(process.env)), await request.formData()));
1364
+ return answer.ok ? {
1365
+ field: "check",
1366
+ checked: answer.checked,
1367
+ saved: true
1368
+ } : fail(400, {
1369
+ field: "check",
1370
+ message: answer.message
1371
+ });
1372
+ },
1373
+ checkSentry: async ({ request }) => {
1374
+ const answer = afterCheck(await checkSentryIssues(database(), createKeychain(process.platform, runKeychain, resolveDataDir(process.env)), await request.formData()));
1375
+ return answer.ok ? {
1376
+ field: "check",
1377
+ checked: answer.checked,
1378
+ saved: true
1379
+ } : fail(400, {
1380
+ field: "check",
1381
+ message: answer.message
1382
+ });
1383
+ },
1384
+ checkLogs: async ({ request }) => {
1385
+ const answer = afterCheck(await checkLogQuery(database(), createKeychain(process.platform, runKeychain, resolveDataDir(process.env)), await request.formData()));
1386
+ return answer.ok ? {
1387
+ field: "check",
1388
+ checked: answer.checked,
1389
+ saved: true
1390
+ } : fail(400, {
1391
+ field: "check",
1392
+ message: answer.message
1393
+ });
1394
+ },
1395
+ /**
1396
+ * One source's schedule, stored here and sent to the hub.
1397
+ *
1398
+ * Its own action and not a word on `scout`: a label edit has no business putting a frame on the
1399
+ * socket, and the plan is asked here alone. The document is read again rather than taken from the
1400
+ * load, because a post is not a page load and the screen is not what may decide this.
1401
+ */
1402
+ schedule: async ({ request }) => {
1403
+ const display = await currentDisplay(localCloud());
1404
+ const answer = saveScoutSchedule(database(), await request.formData(), {
1405
+ ...hubDeps(),
1406
+ allowed: shows(display, SCHEDULE_FEATURE)
1407
+ });
1408
+ return answer.ok ? {
1409
+ field: answer.did,
1410
+ saved: true
1411
+ } : fail(400, {
1412
+ field: answer.did,
1413
+ message: answer.message
1414
+ });
1415
+ }
1416
+ };
1417
+
1418
+ export { actions as a, scoutPage as b, load as l, scoutFindingDetail as s };
1419
+ //# sourceMappingURL=_page.server.js-BaGoctEY.js.map