hitloop 0.0.0-stage → 0.1.1

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 (469) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +218 -2
  3. package/dist/agent.js +318 -0
  4. package/dist/cli.js +897 -0
  5. package/dist/client/assets/app.css +1 -0
  6. package/dist/client/assets/chunks/abap-EINPUMCJ.js +1 -0
  7. package/dist/client/assets/chunks/abnfDiagram-S7VZAUFO-W2CM2W6D.js +1 -0
  8. package/dist/client/assets/chunks/actionscript-3-O776AQUO.js +1 -0
  9. package/dist/client/assets/chunks/ada-WLOTXRTV.js +1 -0
  10. package/dist/client/assets/chunks/ahk-EF37A2DY.js +1 -0
  11. package/dist/client/assets/chunks/ahk2-FH4K3CKT.js +1 -0
  12. package/dist/client/assets/chunks/angular-html-ZALQFV2H.js +1 -0
  13. package/dist/client/assets/chunks/angular-ts-4IWMF7QO.js +1 -0
  14. package/dist/client/assets/chunks/apache-44AYOEWM.js +1 -0
  15. package/dist/client/assets/chunks/apex-XRYPID42.js +1 -0
  16. package/dist/client/assets/chunks/apl-5HBALFOI.js +1 -0
  17. package/dist/client/assets/chunks/applescript-2DZEHZEC.js +1 -0
  18. package/dist/client/assets/chunks/ara-ZGZQBLXL.js +1 -0
  19. package/dist/client/assets/chunks/architecture-WOLXFQ4H-EJGENNRL.js +1 -0
  20. package/dist/client/assets/chunks/architectureDiagram-YGSQEFNW-2VHWSKO6.js +36 -0
  21. package/dist/client/assets/chunks/asciidoc-GSQAKCPO.js +1 -0
  22. package/dist/client/assets/chunks/asm-BFURM5BK.js +1 -0
  23. package/dist/client/assets/chunks/astro-VJORWDZJ.js +1 -0
  24. package/dist/client/assets/chunks/awk-BSHTWXXX.js +1 -0
  25. package/dist/client/assets/chunks/ballerina-HAOQJ4B2.js +1 -0
  26. package/dist/client/assets/chunks/bat-OSH45EOF.js +1 -0
  27. package/dist/client/assets/chunks/beancount-RBATIHOV.js +1 -0
  28. package/dist/client/assets/chunks/berry-CZUIOUM4.js +1 -0
  29. package/dist/client/assets/chunks/bibtex-KCL2UWHE.js +1 -0
  30. package/dist/client/assets/chunks/bicep-SZJZB3SG.js +1 -0
  31. package/dist/client/assets/chunks/bird2-XBF5YQQV.js +1 -0
  32. package/dist/client/assets/chunks/blade-Q24LEVFC.js +1 -0
  33. package/dist/client/assets/chunks/blockDiagram-APKKGZFW-53LXSOOT.js +140 -0
  34. package/dist/client/assets/chunks/bpmnIcons-APHXDYXF-FMBRQNTY.js +1 -0
  35. package/dist/client/assets/chunks/bsl-TI44NWFB.js +1 -0
  36. package/dist/client/assets/chunks/c-NLHY4Y4N.js +1 -0
  37. package/dist/client/assets/chunks/c3-BUTEM6PO.js +1 -0
  38. package/dist/client/assets/chunks/c4Diagram-KJ2TOQU5-O53G4GQH.js +38 -0
  39. package/dist/client/assets/chunks/cadence-JIRTEU64.js +1 -0
  40. package/dist/client/assets/chunks/cairo-3W6NVDNW.js +1 -0
  41. package/dist/client/assets/chunks/chapel-BPBJ2E7K.js +1 -0
  42. package/dist/client/assets/chunks/chunk-25KVF5ZE.js +1 -0
  43. package/dist/client/assets/chunks/chunk-2CJKSQOI.js +1 -0
  44. package/dist/client/assets/chunks/chunk-2QIJRTWR.js +1 -0
  45. package/dist/client/assets/chunks/chunk-2ZCRJZGF.js +2 -0
  46. package/dist/client/assets/chunks/chunk-3ILNDZNY.js +213 -0
  47. package/dist/client/assets/chunks/chunk-3M2OOQ7S.js +1 -0
  48. package/dist/client/assets/chunks/chunk-3M57NTNK.js +1 -0
  49. package/dist/client/assets/chunks/chunk-3MR6DCZJ.js +1 -0
  50. package/dist/client/assets/chunks/chunk-3WGHS7F7.js +1 -0
  51. package/dist/client/assets/chunks/chunk-4JK75V33.js +1 -0
  52. package/dist/client/assets/chunks/chunk-4NXNVEWK.js +1 -0
  53. package/dist/client/assets/chunks/chunk-4RNNBDFQ.js +1 -0
  54. package/dist/client/assets/chunks/chunk-4T4NVH7V.js +1 -0
  55. package/dist/client/assets/chunks/chunk-4TFFBC35.js +1 -0
  56. package/dist/client/assets/chunks/chunk-4WYBE67P.js +1 -0
  57. package/dist/client/assets/chunks/chunk-56ITEUFA.js +1 -0
  58. package/dist/client/assets/chunks/chunk-5DXRE7IH.js +1 -0
  59. package/dist/client/assets/chunks/chunk-5IMADCNU.js +1 -0
  60. package/dist/client/assets/chunks/chunk-5XZPGKN4.js +1 -0
  61. package/dist/client/assets/chunks/chunk-6O32UKSP.js +1 -0
  62. package/dist/client/assets/chunks/chunk-7BAEB64Q.js +1 -0
  63. package/dist/client/assets/chunks/chunk-7FMWBHZO.js +1 -0
  64. package/dist/client/assets/chunks/chunk-7GFDITUT.js +1 -0
  65. package/dist/client/assets/chunks/chunk-7H4MLBHI.js +1 -0
  66. package/dist/client/assets/chunks/chunk-7OJ4MEEB.js +1 -0
  67. package/dist/client/assets/chunks/chunk-7RSEISFE.js +1 -0
  68. package/dist/client/assets/chunks/chunk-7YNZZQVT.js +1 -0
  69. package/dist/client/assets/chunks/chunk-AB7TIL2G.js +1 -0
  70. package/dist/client/assets/chunks/chunk-ADDF76FL.js +1 -0
  71. package/dist/client/assets/chunks/chunk-AF6UTCD4.js +321 -0
  72. package/dist/client/assets/chunks/chunk-AJ2K6ASU.js +1 -0
  73. package/dist/client/assets/chunks/chunk-AUBAENQZ.js +1 -0
  74. package/dist/client/assets/chunks/chunk-BJEYVZ65.js +1 -0
  75. package/dist/client/assets/chunks/chunk-BLRM6LXA.js +1 -0
  76. package/dist/client/assets/chunks/chunk-BOCTYCDZ.js +1 -0
  77. package/dist/client/assets/chunks/chunk-BU4VRYN7.js +1 -0
  78. package/dist/client/assets/chunks/chunk-CALYHV7D.js +1 -0
  79. package/dist/client/assets/chunks/chunk-CF4W3RZ4.js +1 -0
  80. package/dist/client/assets/chunks/chunk-DCZ2OBSL.js +1 -0
  81. package/dist/client/assets/chunks/chunk-DUFPBTHD.js +1 -0
  82. package/dist/client/assets/chunks/chunk-DUICIQBC.js +88 -0
  83. package/dist/client/assets/chunks/chunk-EH2N475V.js +1 -0
  84. package/dist/client/assets/chunks/chunk-EHLLNPZT.js +1 -0
  85. package/dist/client/assets/chunks/chunk-EIBFAW37.js +1 -0
  86. package/dist/client/assets/chunks/chunk-EO3ER3GN.js +1 -0
  87. package/dist/client/assets/chunks/chunk-FH24BIIA.js +1 -0
  88. package/dist/client/assets/chunks/chunk-FNOXGAL5.js +2 -0
  89. package/dist/client/assets/chunks/chunk-FTY6WLQF.js +3 -0
  90. package/dist/client/assets/chunks/chunk-FZFME6UK.js +1 -0
  91. package/dist/client/assets/chunks/chunk-FZJZZYYO.js +1 -0
  92. package/dist/client/assets/chunks/chunk-G4Z6L7OO.js +1 -0
  93. package/dist/client/assets/chunks/chunk-GNCEAN2B.js +1 -0
  94. package/dist/client/assets/chunks/chunk-GQJIKV3T.js +1 -0
  95. package/dist/client/assets/chunks/chunk-GUMNOKT2.js +1 -0
  96. package/dist/client/assets/chunks/chunk-GXRORAF3.js +1 -0
  97. package/dist/client/assets/chunks/chunk-H36ABDKY.js +1 -0
  98. package/dist/client/assets/chunks/chunk-HAR5NYVW.js +1 -0
  99. package/dist/client/assets/chunks/chunk-HIGPS4L2.js +1 -0
  100. package/dist/client/assets/chunks/chunk-HMOBGTME.js +1 -0
  101. package/dist/client/assets/chunks/chunk-HNO6SQ7M.js +1 -0
  102. package/dist/client/assets/chunks/chunk-HYVZ3GYN.js +1 -0
  103. package/dist/client/assets/chunks/chunk-I6TGFOQS.js +1 -0
  104. package/dist/client/assets/chunks/chunk-IHIOJK7I.js +1 -0
  105. package/dist/client/assets/chunks/chunk-IHJNUMSC.js +1 -0
  106. package/dist/client/assets/chunks/chunk-IP7PB2OC.js +1 -0
  107. package/dist/client/assets/chunks/chunk-ISDTMH2Y.js +1 -0
  108. package/dist/client/assets/chunks/chunk-J65M2LNT.js +1 -0
  109. package/dist/client/assets/chunks/chunk-JCWYZ7X2.js +62 -0
  110. package/dist/client/assets/chunks/chunk-JENWYTLI.js +1 -0
  111. package/dist/client/assets/chunks/chunk-JJ6YWJQS.js +1 -0
  112. package/dist/client/assets/chunks/chunk-JMUVGGX7.js +32 -0
  113. package/dist/client/assets/chunks/chunk-JNQUFMM4.js +1 -0
  114. package/dist/client/assets/chunks/chunk-JPTECOAL.js +1 -0
  115. package/dist/client/assets/chunks/chunk-JZNK4LKS.js +1 -0
  116. package/dist/client/assets/chunks/chunk-KPNXJBIW.js +1 -0
  117. package/dist/client/assets/chunks/chunk-KZO2GZL7.js +1 -0
  118. package/dist/client/assets/chunks/chunk-L2REESOQ.js +1 -0
  119. package/dist/client/assets/chunks/chunk-LJPJXR7R.js +1 -0
  120. package/dist/client/assets/chunks/chunk-LOEZMLCI.js +1 -0
  121. package/dist/client/assets/chunks/chunk-MLYC6FSE.js +1 -0
  122. package/dist/client/assets/chunks/chunk-MMDGEZYU.js +1 -0
  123. package/dist/client/assets/chunks/chunk-MYXE7CGE.js +1 -0
  124. package/dist/client/assets/chunks/chunk-NBH7YOBD.js +15 -0
  125. package/dist/client/assets/chunks/chunk-NCOVM3YF.js +1 -0
  126. package/dist/client/assets/chunks/chunk-NCWOBVU7.js +1 -0
  127. package/dist/client/assets/chunks/chunk-NLRIHHEH.js +1 -0
  128. package/dist/client/assets/chunks/chunk-NUPEOYK6.js +1 -0
  129. package/dist/client/assets/chunks/chunk-O4MVOA7X.js +1 -0
  130. package/dist/client/assets/chunks/chunk-OBHQQZ4H.js +1 -0
  131. package/dist/client/assets/chunks/chunk-OKPNJIIR.js +1 -0
  132. package/dist/client/assets/chunks/chunk-OLMPB57R.js +1 -0
  133. package/dist/client/assets/chunks/chunk-P2FYOAEV.js +1 -0
  134. package/dist/client/assets/chunks/chunk-PI3SNP4C.js +1 -0
  135. package/dist/client/assets/chunks/chunk-PRDTEROB.js +1 -0
  136. package/dist/client/assets/chunks/chunk-PZELHD2H.js +136 -0
  137. package/dist/client/assets/chunks/chunk-QR2Q34LM.js +1 -0
  138. package/dist/client/assets/chunks/chunk-R4GIXL6S.js +1 -0
  139. package/dist/client/assets/chunks/chunk-RORF4F5V.js +1 -0
  140. package/dist/client/assets/chunks/chunk-S73BYTLL.js +1 -0
  141. package/dist/client/assets/chunks/chunk-SFC5MRYR.js +1 -0
  142. package/dist/client/assets/chunks/chunk-SVM2H22K.js +2 -0
  143. package/dist/client/assets/chunks/chunk-SZ6UCGVD.js +1 -0
  144. package/dist/client/assets/chunks/chunk-SZYM6GIJ.js +127 -0
  145. package/dist/client/assets/chunks/chunk-TT5KJZKM.js +1 -0
  146. package/dist/client/assets/chunks/chunk-UFBKUYNH.js +1 -0
  147. package/dist/client/assets/chunks/chunk-UL57AD4T.js +1 -0
  148. package/dist/client/assets/chunks/chunk-UNEI7LMM.js +1 -0
  149. package/dist/client/assets/chunks/chunk-VNQBBFIY.js +1 -0
  150. package/dist/client/assets/chunks/chunk-WGVITPII.js +1 -0
  151. package/dist/client/assets/chunks/chunk-WRA6KJHX.js +10 -0
  152. package/dist/client/assets/chunks/chunk-WS5EHW43.js +1 -0
  153. package/dist/client/assets/chunks/chunk-XE6SLBBE.js +3 -0
  154. package/dist/client/assets/chunks/chunk-XF5T2P7U.js +72 -0
  155. package/dist/client/assets/chunks/chunk-XFRY5WKO.js +1 -0
  156. package/dist/client/assets/chunks/chunk-XWYV4OPA.js +1 -0
  157. package/dist/client/assets/chunks/chunk-YCE5ECKY.js +1 -0
  158. package/dist/client/assets/chunks/chunk-YIN5CSIF.js +1 -0
  159. package/dist/client/assets/chunks/chunk-YLFUX6XH.js +1 -0
  160. package/dist/client/assets/chunks/chunk-YNXJICZM.js +1 -0
  161. package/dist/client/assets/chunks/chunk-YOHF7NGD.js +1 -0
  162. package/dist/client/assets/chunks/chunk-YORIST7Z.js +1 -0
  163. package/dist/client/assets/chunks/chunk-YUL7CG4R.js +1 -0
  164. package/dist/client/assets/chunks/chunk-YUN7JSFJ.js +2 -0
  165. package/dist/client/assets/chunks/chunk-YZ7D2IT7.js +1 -0
  166. package/dist/client/assets/chunks/chunk-Z7LAPMFJ.js +1 -0
  167. package/dist/client/assets/chunks/chunk-ZE325LPC.js +1 -0
  168. package/dist/client/assets/chunks/chunk-ZN7TN6PO.js +1 -0
  169. package/dist/client/assets/chunks/chunk-ZST3EVPO.js +1 -0
  170. package/dist/client/assets/chunks/chunk-ZZHMDDZN.js +1 -0
  171. package/dist/client/assets/chunks/clarity-RKRYQ7WF.js +1 -0
  172. package/dist/client/assets/chunks/classDiagram-v2-L25IHNXF-Y67HVDZV.js +217 -0
  173. package/dist/client/assets/chunks/clojure-2X2DQECJ.js +1 -0
  174. package/dist/client/assets/chunks/cmake-LH5524XE.js +1 -0
  175. package/dist/client/assets/chunks/cobol-7DALQF3W.js +1 -0
  176. package/dist/client/assets/chunks/codeowners-52SZU5P5.js +1 -0
  177. package/dist/client/assets/chunks/codeql-EISH3KUP.js +1 -0
  178. package/dist/client/assets/chunks/coffee-VAWSGA7Y.js +1 -0
  179. package/dist/client/assets/chunks/common-lisp-4MVK2AN6.js +1 -0
  180. package/dist/client/assets/chunks/coq-4VRYZRZV.js +1 -0
  181. package/dist/client/assets/chunks/core-BRBMZSD2.js +12 -0
  182. package/dist/client/assets/chunks/cose-bilkent-JH36ORCC-BIOOHSAA.js +1 -0
  183. package/dist/client/assets/chunks/cpp-RFECMSKD.js +1 -0
  184. package/dist/client/assets/chunks/crystal-ZBGGFAOI.js +1 -0
  185. package/dist/client/assets/chunks/csharp-BZDPMKKW.js +1 -0
  186. package/dist/client/assets/chunks/css-3WWGM6UD.js +1 -0
  187. package/dist/client/assets/chunks/csv-AB4GNWSB.js +1 -0
  188. package/dist/client/assets/chunks/cue-2E46MZP2.js +1 -0
  189. package/dist/client/assets/chunks/cynefin-EF2NZ3EQ-TLFQLWUN.js +1 -0
  190. package/dist/client/assets/chunks/cynefinDiagram-L36ESFBY-FLPXCSSG.js +62 -0
  191. package/dist/client/assets/chunks/cypher-HR3ILFOL.js +1 -0
  192. package/dist/client/assets/chunks/d-TARSZPOL.js +1 -0
  193. package/dist/client/assets/chunks/dagre-SPEB5RXH-7EGEINJ2.js +4 -0
  194. package/dist/client/assets/chunks/dart-SALLJHVI.js +1 -0
  195. package/dist/client/assets/chunks/dax-WYMRGMXC.js +1 -0
  196. package/dist/client/assets/chunks/desktop-ND5CGLLJ.js +1 -0
  197. package/dist/client/assets/chunks/diagram-3B7GL73J-6USY4HZX.js +200 -0
  198. package/dist/client/assets/chunks/diagram-DNEMPZML-BNSOC4VW.js +24 -0
  199. package/dist/client/assets/chunks/diagram-L3MUGCDN-5V5FZYIG.js +41 -0
  200. package/dist/client/assets/chunks/diagram-LA4NIPWU-25VLY2CO.js +24 -0
  201. package/dist/client/assets/chunks/diagram-MHCOC4E2-G2LFP3JU.js +3 -0
  202. package/dist/client/assets/chunks/diagram-XPFHEONP-E6HBBIBV.js +30 -0
  203. package/dist/client/assets/chunks/diff-PWYGPM7B.js +1 -0
  204. package/dist/client/assets/chunks/docker-A4D7DT7W.js +1 -0
  205. package/dist/client/assets/chunks/dotenv-VWQWV2DY.js +1 -0
  206. package/dist/client/assets/chunks/dream-maker-M5YDQS35.js +1 -0
  207. package/dist/client/assets/chunks/ebnfDiagram-UZSYDL2S-BMXXZZPI.js +1 -0
  208. package/dist/client/assets/chunks/edge-3QXIDJHI.js +1 -0
  209. package/dist/client/assets/chunks/elixir-3OX2UHIZ.js +1 -0
  210. package/dist/client/assets/chunks/elk-XV6XMXQE-IPR65FON.js +27 -0
  211. package/dist/client/assets/chunks/elm-CTS65NCT.js +1 -0
  212. package/dist/client/assets/chunks/emacs-lisp-HHS2IDO7.js +1 -0
  213. package/dist/client/assets/chunks/engine-javascript-DNHSF67B.js +141 -0
  214. package/dist/client/assets/chunks/erDiagram-EYBAPDEH-3GEHFWHG.js +99 -0
  215. package/dist/client/assets/chunks/erb-ICYWK6HS.js +1 -0
  216. package/dist/client/assets/chunks/erlang-BDQPNCKX.js +1 -0
  217. package/dist/client/assets/chunks/eventmodeling-K75KTNOO-B27BJTZL.js +1 -0
  218. package/dist/client/assets/chunks/fennel-4ONBA2PH.js +1 -0
  219. package/dist/client/assets/chunks/fish-ATLPBZSD.js +1 -0
  220. package/dist/client/assets/chunks/flowDiagram-MALGAFMO-5PCLR4AE.js +1 -0
  221. package/dist/client/assets/chunks/fluent-GGMONBVW.js +1 -0
  222. package/dist/client/assets/chunks/fortran-fixed-form-5MSBDRWQ.js +1 -0
  223. package/dist/client/assets/chunks/fortran-free-form-TT3RBL75.js +1 -0
  224. package/dist/client/assets/chunks/fsharp-PAGHNW4O.js +1 -0
  225. package/dist/client/assets/chunks/ganttDiagram-23REXITY-VE5MVBTO.js +292 -0
  226. package/dist/client/assets/chunks/gdresource-5OTP326D.js +1 -0
  227. package/dist/client/assets/chunks/gdscript-VPWHSCLF.js +1 -0
  228. package/dist/client/assets/chunks/gdshader-FYLPXFE5.js +1 -0
  229. package/dist/client/assets/chunks/genie-UYMEEMA2.js +1 -0
  230. package/dist/client/assets/chunks/gherkin-SU7D5DMY.js +1 -0
  231. package/dist/client/assets/chunks/git-commit-5CF5QAG7.js +1 -0
  232. package/dist/client/assets/chunks/git-rebase-X72BAUZI.js +1 -0
  233. package/dist/client/assets/chunks/gitGraph-VSP46ZUC-J6CJ5YZF.js +1 -0
  234. package/dist/client/assets/chunks/gitGraphDiagram-STJD7YCW-7YJGT6ZP.js +106 -0
  235. package/dist/client/assets/chunks/gleam-LR42YRKO.js +1 -0
  236. package/dist/client/assets/chunks/glimmer-js-JPF67FJU.js +1 -0
  237. package/dist/client/assets/chunks/glimmer-ts-BYPAVIZT.js +1 -0
  238. package/dist/client/assets/chunks/glsl-GTGUULBN.js +1 -0
  239. package/dist/client/assets/chunks/gn-NMDQA4K3.js +1 -0
  240. package/dist/client/assets/chunks/gnuplot-UUAMYBCZ.js +1 -0
  241. package/dist/client/assets/chunks/go-4RERSTNP.js +1 -0
  242. package/dist/client/assets/chunks/graphql-5A6RK6YF.js +1 -0
  243. package/dist/client/assets/chunks/groovy-O7BJONCU.js +1 -0
  244. package/dist/client/assets/chunks/hack-7QGTNPDP.js +1 -0
  245. package/dist/client/assets/chunks/haml-ON5GAWN4.js +1 -0
  246. package/dist/client/assets/chunks/handlebars-6UOQSUBP.js +1 -0
  247. package/dist/client/assets/chunks/haskell-OIZXZ26Y.js +1 -0
  248. package/dist/client/assets/chunks/haxe-7FFVS4FO.js +1 -0
  249. package/dist/client/assets/chunks/hcl-XFUFQJHV.js +1 -0
  250. package/dist/client/assets/chunks/hjson-QDBHMTD5.js +1 -0
  251. package/dist/client/assets/chunks/hlsl-4LP25FFN.js +1 -0
  252. package/dist/client/assets/chunks/html-7RNQXAAV.js +1 -0
  253. package/dist/client/assets/chunks/html-derivative-ESOY72Q2.js +1 -0
  254. package/dist/client/assets/chunks/http-SAD4PMBD.js +1 -0
  255. package/dist/client/assets/chunks/hurl-ZSJJXPQH.js +1 -0
  256. package/dist/client/assets/chunks/hxml-HJCC37RK.js +1 -0
  257. package/dist/client/assets/chunks/hy-CLDE3P4K.js +1 -0
  258. package/dist/client/assets/chunks/imba-REB34U5V.js +1 -0
  259. package/dist/client/assets/chunks/info-OHQRW6UA-EQQKXR77.js +1 -0
  260. package/dist/client/assets/chunks/infoDiagram-KBXO4MBG-F6KGZCGS.js +2 -0
  261. package/dist/client/assets/chunks/ini-PDFEMGRA.js +1 -0
  262. package/dist/client/assets/chunks/ishikawaDiagram-M35NCXHK-5D6ZOZ34.js +70 -0
  263. package/dist/client/assets/chunks/java-KB6XENAD.js +1 -0
  264. package/dist/client/assets/chunks/javascript-3JX5T423.js +1 -0
  265. package/dist/client/assets/chunks/jinja-V4UNU6K4.js +1 -0
  266. package/dist/client/assets/chunks/jison-KH5XNLJP.js +1 -0
  267. package/dist/client/assets/chunks/journeyDiagram-OPLOXDXO-ANDOJZKW.js +139 -0
  268. package/dist/client/assets/chunks/json-HPXFRRPY.js +1 -0
  269. package/dist/client/assets/chunks/json5-LJM6TXWM.js +1 -0
  270. package/dist/client/assets/chunks/jsonc-UZWRU3JV.js +1 -0
  271. package/dist/client/assets/chunks/jsonl-RFZD5UN4.js +1 -0
  272. package/dist/client/assets/chunks/jsonnet-GFZABBL6.js +1 -0
  273. package/dist/client/assets/chunks/jssm-2YIGBISJ.js +1 -0
  274. package/dist/client/assets/chunks/jsx-KLV2ZWUT.js +1 -0
  275. package/dist/client/assets/chunks/julia-3TZDIPPO.js +1 -0
  276. package/dist/client/assets/chunks/just-UHCONBQS.js +1 -0
  277. package/dist/client/assets/chunks/kanban-definition-BZKZHSQY-GF5I5NVD.js +89 -0
  278. package/dist/client/assets/chunks/katex-PIN72PQZ.js +257 -0
  279. package/dist/client/assets/chunks/kdl-DARTFOCL.js +1 -0
  280. package/dist/client/assets/chunks/kotlin-7KT5DW6Y.js +1 -0
  281. package/dist/client/assets/chunks/kusto-EKYXZTC5.js +1 -0
  282. package/dist/client/assets/chunks/langs-GO3UQR4H.js +1 -0
  283. package/dist/client/assets/chunks/latex-T57MIHR5.js +1 -0
  284. package/dist/client/assets/chunks/lean-5QVPRMV6.js +1 -0
  285. package/dist/client/assets/chunks/less-K6QEH5TN.js +1 -0
  286. package/dist/client/assets/chunks/liquid-3LCNNEIV.js +1 -0
  287. package/dist/client/assets/chunks/llvm-O32ZIVRF.js +1 -0
  288. package/dist/client/assets/chunks/log-C4YPJ5BB.js +1 -0
  289. package/dist/client/assets/chunks/logo-JPMO43A6.js +1 -0
  290. package/dist/client/assets/chunks/lua-YKVSOG7K.js +1 -0
  291. package/dist/client/assets/chunks/luau-K4EECYSO.js +1 -0
  292. package/dist/client/assets/chunks/make-VHSYMHHW.js +1 -0
  293. package/dist/client/assets/chunks/markdown-GC5J46H4.js +1 -0
  294. package/dist/client/assets/chunks/marko-U45YFADC.js +1 -0
  295. package/dist/client/assets/chunks/matlab-AMOKC4LU.js +1 -0
  296. package/dist/client/assets/chunks/mdc-DIGA2UXP.js +1 -0
  297. package/dist/client/assets/chunks/mdx-BZUGCKQA.js +1 -0
  298. package/dist/client/assets/chunks/mermaid-WHDP6ZPA.js +1 -0
  299. package/dist/client/assets/chunks/mermaid.core-SQMPMUDN.js +10 -0
  300. package/dist/client/assets/chunks/mindmap-definition-I2QAS2VK-4NH5S56C.js +98 -0
  301. package/dist/client/assets/chunks/mipsasm-2S4CUGQV.js +1 -0
  302. package/dist/client/assets/chunks/mojo-ZOL2PNKT.js +1 -0
  303. package/dist/client/assets/chunks/moonbit-U3BDAIFE.js +1 -0
  304. package/dist/client/assets/chunks/move-YSXALBWA.js +1 -0
  305. package/dist/client/assets/chunks/narrat-DHFIAUJH.js +1 -0
  306. package/dist/client/assets/chunks/nextflow-ESAKNTI3.js +1 -0
  307. package/dist/client/assets/chunks/nextflow-groovy-FKDSPJUI.js +1 -0
  308. package/dist/client/assets/chunks/nginx-XYAYERLO.js +1 -0
  309. package/dist/client/assets/chunks/nim-XOWBVFDH.js +1 -0
  310. package/dist/client/assets/chunks/nix-RVSTQSHC.js +1 -0
  311. package/dist/client/assets/chunks/nsis-KMDUKQRL.js +1 -0
  312. package/dist/client/assets/chunks/nushell-SKJHHZ7U.js +1 -0
  313. package/dist/client/assets/chunks/objective-c-3B3KXQ7Q.js +1 -0
  314. package/dist/client/assets/chunks/objective-cpp-6JDULPJS.js +1 -0
  315. package/dist/client/assets/chunks/ocaml-TMRFXBVO.js +1 -0
  316. package/dist/client/assets/chunks/odin-IN3PLCK7.js +1 -0
  317. package/dist/client/assets/chunks/openscad-P52IKPNH.js +1 -0
  318. package/dist/client/assets/chunks/org-N3SJ2PIA.js +1 -0
  319. package/dist/client/assets/chunks/packet-JDAUHWVQ-4SWIKSKP.js +1 -0
  320. package/dist/client/assets/chunks/pascal-T7CUWCQ4.js +1 -0
  321. package/dist/client/assets/chunks/pegDiagram-FD4XPPHP-WDKZSEGN.js +1 -0
  322. package/dist/client/assets/chunks/perl-LCZ4KODH.js +1 -0
  323. package/dist/client/assets/chunks/php-4XHMBVR5.js +1 -0
  324. package/dist/client/assets/chunks/pie-XZMESJXO-PSSWOWGV.js +1 -0
  325. package/dist/client/assets/chunks/pieDiagram-J4AKIIQI-BDW5I5ON.js +39 -0
  326. package/dist/client/assets/chunks/pkl-OACG5B67.js +1 -0
  327. package/dist/client/assets/chunks/plsql-7E5C7CJX.js +1 -0
  328. package/dist/client/assets/chunks/po-ZSREFRRP.js +1 -0
  329. package/dist/client/assets/chunks/polar-4GBINVA7.js +1 -0
  330. package/dist/client/assets/chunks/postcss-B7RPVGFW.js +1 -0
  331. package/dist/client/assets/chunks/powerquery-6UFMTY4G.js +1 -0
  332. package/dist/client/assets/chunks/powershell-3STRPCNT.js +1 -0
  333. package/dist/client/assets/chunks/prisma-4TPSPIZ5.js +1 -0
  334. package/dist/client/assets/chunks/prolog-HEAYPKQW.js +1 -0
  335. package/dist/client/assets/chunks/proto-Y3Y3VKXM.js +1 -0
  336. package/dist/client/assets/chunks/pug-7PBPMG3M.js +1 -0
  337. package/dist/client/assets/chunks/puppet-FR35R4OI.js +1 -0
  338. package/dist/client/assets/chunks/purescript-OUHXQAOW.js +1 -0
  339. package/dist/client/assets/chunks/python-SNDG7FNU.js +1 -0
  340. package/dist/client/assets/chunks/qml-UVIOSWP4.js +1 -0
  341. package/dist/client/assets/chunks/qmldir-6JGUNYL5.js +1 -0
  342. package/dist/client/assets/chunks/qss-ZCC466IZ.js +1 -0
  343. package/dist/client/assets/chunks/quadrantDiagram-XTYBLID2-5VKXWVJ6.js +7 -0
  344. package/dist/client/assets/chunks/r-4XW4O3ZF.js +1 -0
  345. package/dist/client/assets/chunks/racket-YJAYXOOG.js +1 -0
  346. package/dist/client/assets/chunks/radar-ABXABTNO-3AXZCEY2.js +1 -0
  347. package/dist/client/assets/chunks/railroad-I3PHUGI6-2PLXYPOT.js +1 -0
  348. package/dist/client/assets/chunks/railroad-abnf-LNEFI6M7-M4DGICQX.js +1 -0
  349. package/dist/client/assets/chunks/railroad-ebnf-DWYD2UWJ-UEIHQMSZ.js +1 -0
  350. package/dist/client/assets/chunks/railroad-peg-JR7BVNR7-I7VLIBXM.js +1 -0
  351. package/dist/client/assets/chunks/railroadDiagram-MRQ6NCDL-Y6IYWEFL.js +1 -0
  352. package/dist/client/assets/chunks/raku-63NEL5JK.js +1 -0
  353. package/dist/client/assets/chunks/razor-J3CJP523.js +1 -0
  354. package/dist/client/assets/chunks/rbs-6GQLT7NW.js +1 -0
  355. package/dist/client/assets/chunks/reg-6Q3OEC2C.js +1 -0
  356. package/dist/client/assets/chunks/regexp-LPIMILT3.js +1 -0
  357. package/dist/client/assets/chunks/rel-TOQGUTHB.js +1 -0
  358. package/dist/client/assets/chunks/requirementDiagram-Y7LWUY3S-CIWXVVWJ.js +84 -0
  359. package/dist/client/assets/chunks/riscv-UELGBOXE.js +1 -0
  360. package/dist/client/assets/chunks/ron-FW7LCJJH.js +1 -0
  361. package/dist/client/assets/chunks/rosmsg-O63VHE3L.js +1 -0
  362. package/dist/client/assets/chunks/rst-3WJXGLA7.js +1 -0
  363. package/dist/client/assets/chunks/ruby-7S7L6JTH.js +1 -0
  364. package/dist/client/assets/chunks/rust-LIK4HRRI.js +1 -0
  365. package/dist/client/assets/chunks/sankeyDiagram-WGJFYUXA-OGNQPX5V.js +40 -0
  366. package/dist/client/assets/chunks/sas-FHDPZ2JH.js +1 -0
  367. package/dist/client/assets/chunks/sass-UI4HW2FN.js +1 -0
  368. package/dist/client/assets/chunks/scala-KN7RQSUJ.js +1 -0
  369. package/dist/client/assets/chunks/scheme-5R527YZ5.js +1 -0
  370. package/dist/client/assets/chunks/scss-KZ6DRE4A.js +1 -0
  371. package/dist/client/assets/chunks/sdbl-FHOCL5SL.js +1 -0
  372. package/dist/client/assets/chunks/sequenceDiagram-5NDRBG5M-QX2V24ZU.js +169 -0
  373. package/dist/client/assets/chunks/shaderlab-2TLHUS2H.js +1 -0
  374. package/dist/client/assets/chunks/shellscript-PIB6ZBDM.js +1 -0
  375. package/dist/client/assets/chunks/shellsession-5KL7NFNN.js +1 -0
  376. package/dist/client/assets/chunks/sizeCapture-INFHLROL-LCS2PIHM.js +1 -0
  377. package/dist/client/assets/chunks/smalltalk-JFLFU247.js +1 -0
  378. package/dist/client/assets/chunks/smithy-HONEXZAM.js +1 -0
  379. package/dist/client/assets/chunks/solidity-SJ3INJFZ.js +1 -0
  380. package/dist/client/assets/chunks/soy-ND4SWTM2.js +1 -0
  381. package/dist/client/assets/chunks/sparql-YB2JQBZD.js +1 -0
  382. package/dist/client/assets/chunks/splunk-UXIDDAWL.js +1 -0
  383. package/dist/client/assets/chunks/sql-K6OMG7SQ.js +1 -0
  384. package/dist/client/assets/chunks/ssh-config-I7KJY3KQ.js +1 -0
  385. package/dist/client/assets/chunks/stata-DNZ3DTFJ.js +1 -0
  386. package/dist/client/assets/chunks/stateDiagram-v2-FJ4FJNEA-LVAUWF3A.js +291 -0
  387. package/dist/client/assets/chunks/stylus-GWPR6IQY.js +1 -0
  388. package/dist/client/assets/chunks/surrealql-KQNHBWLC.js +1 -0
  389. package/dist/client/assets/chunks/svelte-YQKF25S4.js +1 -0
  390. package/dist/client/assets/chunks/swift-ZCIZUJXA.js +1 -0
  391. package/dist/client/assets/chunks/swimlanes-UMQ2AFYF-B3RQOARQ.js +1 -0
  392. package/dist/client/assets/chunks/swimlanesDiagram-OMPLPG4O-JOE33EOV.js +8 -0
  393. package/dist/client/assets/chunks/system-verilog-Y7E6FIO3.js +1 -0
  394. package/dist/client/assets/chunks/systemd-WHC7NBZP.js +1 -0
  395. package/dist/client/assets/chunks/talonscript-WC7SODAH.js +1 -0
  396. package/dist/client/assets/chunks/tasl-QHY2GTCB.js +1 -0
  397. package/dist/client/assets/chunks/tcl-VAMIL5PJ.js +1 -0
  398. package/dist/client/assets/chunks/temml-ISNSX3VV.js +96 -0
  399. package/dist/client/assets/chunks/templ-B3BHKWV4.js +1 -0
  400. package/dist/client/assets/chunks/terraform-Q4UEK6FK.js +1 -0
  401. package/dist/client/assets/chunks/tex-63OWCYAB.js +1 -0
  402. package/dist/client/assets/chunks/timeline-definition-SEUHKTQE-FDFTVAJG.js +120 -0
  403. package/dist/client/assets/chunks/toml-7Z4IPGES.js +1 -0
  404. package/dist/client/assets/chunks/treeView-D4JQ5SDB-ABSGRAGI.js +1 -0
  405. package/dist/client/assets/chunks/treemap-SAJKECNS-MYX2CBJN.js +1 -0
  406. package/dist/client/assets/chunks/ts-tags-DT62HE52.js +1 -0
  407. package/dist/client/assets/chunks/tsv-RTXHWADP.js +1 -0
  408. package/dist/client/assets/chunks/tsx-UANUBOC7.js +1 -0
  409. package/dist/client/assets/chunks/turtle-QVOUNUUL.js +1 -0
  410. package/dist/client/assets/chunks/twig-ZPC4BPDA.js +1 -0
  411. package/dist/client/assets/chunks/typescript-WGWKIMMW.js +1 -0
  412. package/dist/client/assets/chunks/typespec-TYCVR32J.js +1 -0
  413. package/dist/client/assets/chunks/typst-PIBFYUO6.js +1 -0
  414. package/dist/client/assets/chunks/usecaseDiagram-AFA6YXN4-KW7ADINR.js +370 -0
  415. package/dist/client/assets/chunks/v-3ERNWBSP.js +1 -0
  416. package/dist/client/assets/chunks/vala-UCBCT2GS.js +1 -0
  417. package/dist/client/assets/chunks/vb-DGI3VTPA.js +1 -0
  418. package/dist/client/assets/chunks/vennDiagram-NNMJR3RB-RDGLGOGM.js +34 -0
  419. package/dist/client/assets/chunks/verilog-G72NZROS.js +1 -0
  420. package/dist/client/assets/chunks/vhdl-PYGA77XE.js +1 -0
  421. package/dist/client/assets/chunks/viml-OOC5B5UU.js +1 -0
  422. package/dist/client/assets/chunks/vue-GTNHIOPG.js +1 -0
  423. package/dist/client/assets/chunks/vue-html-DKAMJV55.js +1 -0
  424. package/dist/client/assets/chunks/vue-vine-WTM5HREV.js +1 -0
  425. package/dist/client/assets/chunks/vyper-RHYEHOJM.js +1 -0
  426. package/dist/client/assets/chunks/wardley-7MLQ67FV-QJL2HSBT.js +1 -0
  427. package/dist/client/assets/chunks/wardleyDiagram-S7YFUSEH-A4XX3UJR.js +78 -0
  428. package/dist/client/assets/chunks/wasm-ZMM2Z5XV.js +1 -0
  429. package/dist/client/assets/chunks/wenyan-HF5UTKSJ.js +1 -0
  430. package/dist/client/assets/chunks/wgsl-O7D7OPO7.js +1 -0
  431. package/dist/client/assets/chunks/wikitext-T7BSWSKQ.js +1 -0
  432. package/dist/client/assets/chunks/wit-TKCHPPT6.js +1 -0
  433. package/dist/client/assets/chunks/wolfram-7MN66A7N.js +1 -0
  434. package/dist/client/assets/chunks/xml-NLTLAWOD.js +1 -0
  435. package/dist/client/assets/chunks/xsl-NZ4ECK3P.js +1 -0
  436. package/dist/client/assets/chunks/xychartDiagram-GGNKY7IX-OXJILWHR.js +7 -0
  437. package/dist/client/assets/chunks/yaml-HRJLEV3V.js +1 -0
  438. package/dist/client/assets/chunks/zenscript-4LLRSLPI.js +1 -0
  439. package/dist/client/assets/chunks/zig-Y7MUQFUO.js +1 -0
  440. package/dist/client/assets/icon.svg +1 -0
  441. package/dist/client/assets/main.js +254 -0
  442. package/dist/client/index.html +59 -0
  443. package/dist/diff.js +119 -0
  444. package/dist/fs/files.js +233 -0
  445. package/dist/fs/git.js +369 -0
  446. package/dist/fs/glob.js +89 -0
  447. package/dist/fs/notes.js +368 -0
  448. package/dist/fs/search.js +136 -0
  449. package/dist/fs/watch.js +69 -0
  450. package/dist/fs/zip.js +100 -0
  451. package/dist/hooks.js +65 -0
  452. package/dist/http.js +81 -0
  453. package/dist/hub/atomic.js +77 -0
  454. package/dist/hub/notify.js +239 -0
  455. package/dist/hub/registry.js +219 -0
  456. package/dist/mcp.js +500 -0
  457. package/dist/q/agent.js +215 -0
  458. package/dist/q/model.js +633 -0
  459. package/dist/q/schema.js +133 -0
  460. package/dist/q/store.js +413 -0
  461. package/dist/r/model.js +323 -0
  462. package/dist/r/schema.js +53 -0
  463. package/dist/r/store.js +489 -0
  464. package/dist/server.js +246 -0
  465. package/dist/settings.js +30 -0
  466. package/dist/workspace.js +639 -0
  467. package/package.json +73 -4
  468. package/schema/questions.schema.json +1670 -0
  469. package/schema/reviews.schema.json +151 -0
@@ -0,0 +1,368 @@
1
+ // Notes from the human to the agent: on a file, on lines of it, on an area of a picture, or on nothing in particular
2
+ // ("look at the login flow"), with photos if they like. Kept in .hitl/notes/notes.json, with NOTES.md beside it
3
+ // written for an agent to work through. (These are folderview's review comments, grown up.)
4
+ //
5
+ // Several processes write here (the page through the hub, an agent through the MCP server or the CLI), so every change
6
+ // re-reads the file under a lock, changes it, and writes it back atomically. Each change gets a number (seq), so an
7
+ // agent can read just what's new.
8
+ import fs from 'node:fs';
9
+ import path from 'node:path';
10
+ import crypto from 'node:crypto';
11
+ import { withLock, writeAtomic } from '../hub/atomic.js';
12
+ const QUOTE_LINES = 12;
13
+ const PHOTO = /^data:image\/(png|jpeg|webp|gif|heic|avif);base64,([A-Za-z0-9+/=]+)$/;
14
+ export class Notes {
15
+ dir;
16
+ root;
17
+ jsonPath;
18
+ mdPath;
19
+ comments = [];
20
+ seq = 0;
21
+ readSeq = 0;
22
+ lastWritten = '';
23
+ listeners = new Set();
24
+ watcher;
25
+ constructor(dir, root) {
26
+ this.dir = dir;
27
+ this.root = root;
28
+ this.jsonPath = path.join(dir, 'notes.json');
29
+ this.mdPath = path.join(dir, 'NOTES.md');
30
+ this.load();
31
+ }
32
+ onChange(fn) {
33
+ this.listeners.add(fn);
34
+ return () => this.listeners.delete(fn);
35
+ }
36
+ /** watch notes.json for edits from outside (an agent resolving a note) */
37
+ watch() {
38
+ if (this.watcher)
39
+ return;
40
+ const start = () => {
41
+ try {
42
+ this.watcher = fs.watch(this.dir, (_e, name) => {
43
+ if (name && String(name) !== 'notes.json')
44
+ return;
45
+ setTimeout(() => this.reloadIfChanged(), 60);
46
+ });
47
+ this.watcher.on('error', () => undefined);
48
+ }
49
+ catch {
50
+ this.watcher = undefined;
51
+ }
52
+ };
53
+ if (fs.existsSync(this.dir))
54
+ start();
55
+ else {
56
+ const t = setInterval(() => {
57
+ if (fs.existsSync(this.dir)) {
58
+ clearInterval(t);
59
+ start();
60
+ this.reloadIfChanged();
61
+ }
62
+ }, 2000);
63
+ t.unref();
64
+ }
65
+ }
66
+ close() {
67
+ this.watcher?.close();
68
+ }
69
+ reloadIfChanged() {
70
+ let text;
71
+ try {
72
+ text = fs.readFileSync(this.jsonPath, 'utf8');
73
+ }
74
+ catch {
75
+ text = '';
76
+ }
77
+ if (text === this.lastWritten)
78
+ return;
79
+ this.load();
80
+ this.writeMarkdown();
81
+ this.emit();
82
+ }
83
+ emit() {
84
+ for (const fn of this.listeners)
85
+ fn();
86
+ }
87
+ load() {
88
+ try {
89
+ const text = fs.readFileSync(this.jsonPath, 'utf8');
90
+ this.lastWritten = text;
91
+ const data = JSON.parse(text);
92
+ this.comments = Array.isArray(data.comments) ? data.comments.filter(isComment) : [];
93
+ this.seq = typeof data.seq === 'number' ? data.seq : this.comments.length;
94
+ this.readSeq = typeof data.readSeq === 'number' ? data.readSeq : 0;
95
+ }
96
+ catch {
97
+ // no file yet, or a half-written hand edit: keep what we had
98
+ }
99
+ }
100
+ /** re-read, change, write: safe with other processes writing too */
101
+ change(fn) {
102
+ fs.mkdirSync(this.dir, { recursive: true });
103
+ return withLock(this.jsonPath, () => {
104
+ this.load();
105
+ const r = fn();
106
+ this.save();
107
+ return r;
108
+ });
109
+ }
110
+ all() {
111
+ return this.comments;
112
+ }
113
+ /** the change number now, and what the agent has read up to */
114
+ marks() {
115
+ this.load();
116
+ return { seq: this.seq, readSeq: this.readSeq };
117
+ }
118
+ /** notes and human replies since the agent last read */
119
+ unread() {
120
+ let n = 0;
121
+ for (const c of this.comments) {
122
+ if (c.author !== 'agent' && (c.seq ?? 0) > this.readSeq)
123
+ n++;
124
+ for (const r of c.replies ?? [])
125
+ if (r.from !== 'agent' && r.author !== 'agent' && (r.seq ?? 0) > this.readSeq)
126
+ n++;
127
+ }
128
+ return n;
129
+ }
130
+ markRead(upTo) {
131
+ this.change(() => {
132
+ this.readSeq = Math.max(this.readSeq, Math.min(upTo ?? this.seq, this.seq));
133
+ });
134
+ }
135
+ add(input) {
136
+ return this.change(() => {
137
+ const c = {
138
+ id: crypto.randomBytes(4).toString('hex'),
139
+ path: input.path,
140
+ body: input.body.trim(),
141
+ author: input.author || 'reviewer',
142
+ status: 'open',
143
+ createdAt: new Date().toISOString(),
144
+ seq: ++this.seq,
145
+ };
146
+ if (input.line && input.path) {
147
+ c.line = input.line;
148
+ if (input.endLine && input.endLine > input.line)
149
+ c.endLine = input.endLine;
150
+ const quote = this.quote(input.path, input.line, c.endLine ?? input.line);
151
+ if (quote !== undefined)
152
+ c.quote = quote;
153
+ }
154
+ if (input.area)
155
+ c.area = input.area;
156
+ if (input.strokes?.length)
157
+ c.strokes = input.strokes;
158
+ if (input.snapshot) {
159
+ fs.mkdirSync(path.join(this.dir, 'images'), { recursive: true });
160
+ c.image = `images/${c.id}.png`;
161
+ fs.writeFileSync(path.join(this.dir, c.image), input.snapshot);
162
+ }
163
+ const photos = [];
164
+ for (const p of (input.photos ?? []).slice(0, 8)) {
165
+ const m = PHOTO.exec(p);
166
+ if (!m)
167
+ continue;
168
+ const buf = Buffer.from(m[2] ?? '', 'base64');
169
+ if (buf.length > 12 * 1048576)
170
+ continue;
171
+ fs.mkdirSync(path.join(this.dir, 'photos'), { recursive: true });
172
+ const rel = `photos/${c.id}-${photos.length + 1}.${m[1] === 'jpeg' ? 'jpg' : m[1]}`;
173
+ fs.writeFileSync(path.join(this.dir, rel), buf);
174
+ photos.push(rel);
175
+ }
176
+ if (photos.length)
177
+ c.photos = photos;
178
+ if (input.commit)
179
+ c.commit = input.commit;
180
+ this.comments.push(c);
181
+ return c;
182
+ });
183
+ }
184
+ update(id, patch) {
185
+ return this.change(() => {
186
+ const c = this.comments.find((x) => x.id === id);
187
+ if (!c)
188
+ return undefined;
189
+ if (typeof patch.body === 'string' && patch.body.trim()) {
190
+ c.body = patch.body.trim();
191
+ c.seq = ++this.seq;
192
+ }
193
+ if (patch.status === 'open' || patch.status === 'resolved') {
194
+ c.status = patch.status;
195
+ this.seq++;
196
+ }
197
+ c.updatedAt = new Date().toISOString();
198
+ return c;
199
+ });
200
+ }
201
+ reply(id, author, body, from = 'owner') {
202
+ return this.change(() => {
203
+ const c = this.comments.find((x) => x.id === id);
204
+ if (!c || !body.trim())
205
+ return undefined;
206
+ (c.replies ??= []).push({ id: crypto.randomBytes(3).toString('hex'), author: author || 'reviewer', from, body: body.trim(), at: new Date().toISOString(), seq: ++this.seq });
207
+ c.updatedAt = new Date().toISOString();
208
+ return c;
209
+ });
210
+ }
211
+ /** The agent resolved these notes, saying what it did. */
212
+ resolve(ids, note, status = 'resolved') {
213
+ return this.change(() => {
214
+ const done = [];
215
+ for (const id of ids) {
216
+ const c = this.comments.find((x) => x.id === id);
217
+ if (!c)
218
+ continue;
219
+ c.status = status;
220
+ if (note.trim())
221
+ (c.replies ??= []).push({ id: crypto.randomBytes(3).toString('hex'), author: 'agent', from: 'agent', body: note.trim(), at: new Date().toISOString(), seq: ++this.seq });
222
+ else
223
+ this.seq++;
224
+ c.updatedAt = new Date().toISOString();
225
+ done.push(id);
226
+ }
227
+ return done;
228
+ });
229
+ }
230
+ remove(id) {
231
+ return this.change(() => {
232
+ const gone = this.comments.find((c) => c.id === id);
233
+ if (!gone)
234
+ return false;
235
+ this.comments = this.comments.filter((c) => c.id !== id);
236
+ this.dropFiles(gone);
237
+ this.seq++;
238
+ return true;
239
+ });
240
+ }
241
+ clearResolved() {
242
+ return this.change(() => {
243
+ const n = this.comments.length;
244
+ for (const c of this.comments)
245
+ if (c.status === 'resolved')
246
+ this.dropFiles(c);
247
+ this.comments = this.comments.filter((c) => c.status !== 'resolved');
248
+ this.seq++;
249
+ return n - this.comments.length;
250
+ });
251
+ }
252
+ /** a note's marked-up picture or photo, as a path inside the notes folder (or undefined) */
253
+ filePath(id, which) {
254
+ const c = this.comments.find((x) => x.id === id);
255
+ const rel = which === 'image' ? c?.image : c?.photos?.find((p) => p.endsWith('/' + which) || p === 'photos/' + which);
256
+ if (!rel || !/^(images|photos)\/[0-9a-f]+(-\d+)?\.(png|jpg|webp|gif|heic|avif)$/.test(rel))
257
+ return undefined;
258
+ const abs = path.join(this.dir, rel);
259
+ return fs.existsSync(abs) ? abs : undefined;
260
+ }
261
+ dropFiles(c) {
262
+ for (const rel of [c.image, ...(c.photos ?? [])])
263
+ if (rel && /^(images|photos)\/[0-9a-f]+(-\d+)?\.[a-z]+$/.test(rel))
264
+ fs.rmSync(path.join(this.dir, rel), { force: true });
265
+ }
266
+ quote(rel, from, to) {
267
+ try {
268
+ const abs = path.join(this.root, rel);
269
+ if (fs.statSync(abs).size > 5_000_000)
270
+ return undefined;
271
+ const lines = fs.readFileSync(abs, 'utf8').split('\n');
272
+ const end = Math.min(to, from + QUOTE_LINES - 1);
273
+ const got = lines.slice(from - 1, end).map((l) => l.replace(/\r$/, ''));
274
+ if (!got.length)
275
+ return undefined;
276
+ return got.join('\n') + (to > end ? '\n…' : '');
277
+ }
278
+ catch {
279
+ return undefined;
280
+ }
281
+ }
282
+ save() {
283
+ fs.mkdirSync(this.dir, { recursive: true });
284
+ const sorted = [...this.comments].sort((a, b) => a.path.localeCompare(b.path) || (a.line ?? 0) - (b.line ?? 0) || a.createdAt.localeCompare(b.createdAt));
285
+ const text = JSON.stringify({ version: 1, seq: this.seq, readSeq: this.readSeq, comments: sorted }, null, 2) + '\n';
286
+ writeAtomic(this.jsonPath, text);
287
+ this.lastWritten = text;
288
+ this.writeMarkdown();
289
+ this.emit();
290
+ }
291
+ writeMarkdown() {
292
+ try {
293
+ fs.mkdirSync(this.dir, { recursive: true });
294
+ writeAtomic(this.mdPath, toMarkdown(this.comments, path.relative(this.root, this.jsonPath).split(path.sep).join('/')));
295
+ }
296
+ catch {
297
+ // the folder went away; the next save makes it again
298
+ }
299
+ }
300
+ }
301
+ /** What to tell an agent: where the notes are, and how to answer them. */
302
+ export function agentPrompt(mdRel) {
303
+ return (`Read ${mdRel}: notes from me on files in this project (path:line, the quoted code, and what I said), on areas of pictures, or on nothing in particular. ` +
304
+ `Work through each open note: make the change it asks for, then resolve it with a short reply saying what you did (\`npx hitloop resolve <id> --note "…"\`, or the resolve tool). ` +
305
+ `If you can't or shouldn't act on one, leave it open and reply with why. (\`npx hitloop news\` shows what's new.)`);
306
+ }
307
+ export function toMarkdown(comments, jsonRel, { openOnly = false } = {}) {
308
+ const open = comments.filter((c) => c.status === 'open');
309
+ const done = openOnly ? [] : comments.filter((c) => c.status === 'resolved');
310
+ const out = [
311
+ '# Notes from the human',
312
+ '',
313
+ openOnly ? `${open.length} open` : `${open.length} open · ${done.length} resolved · updated ${new Date().toISOString()}`,
314
+ '',
315
+ '<!-- Written by hitl. Do not edit this file: it is made from ' + jsonRel + '. -->',
316
+ '',
317
+ '## How to work through these (for an agent)',
318
+ '',
319
+ '- Each note is on a file, on lines of it (`path:line`), on an area of a picture (marked by hand; `images/<id>.png` beside this file shows the marks), or on nothing in particular. Paths are relative to the project.',
320
+ '- The quoted code is what the lines said when the note was left; the file may have moved on since, so find the code, not just the line number.',
321
+ '- When a note is dealt with, resolve it with a reply saying what you did: `npx hitloop resolve <id> --note "Done: …"` (or the MCP tool `resolve`). The human sees it live.',
322
+ '- Leave notes you could not act on open, with a reply that says why (`npx hitloop reply <id> "…"`).',
323
+ '',
324
+ ];
325
+ const section = (title, list) => {
326
+ if (!list.length)
327
+ return;
328
+ out.push(`## ${title}`, '');
329
+ let file;
330
+ for (const c of list) {
331
+ if (c.path !== file) {
332
+ file = c.path;
333
+ out.push(`### ${file || '(not about a particular file)'}`, '');
334
+ }
335
+ const where = !c.path ? 'note' : c.line ? `${c.path}:${c.line}${c.endLine ? '-' + c.endLine : ''}` : c.area ? `${c.path} (marked area)` : `${c.path} (whole file)`;
336
+ out.push(`#### \`${where}\` — ${c.author}${c.commit ? ` @ ${c.commit}` : ''} · id \`${c.id}\``, '');
337
+ if (c.quote)
338
+ out.push('```' + langOf(c.path), c.quote, '```', '');
339
+ if (c.area)
340
+ out.push(`Marked area: x ${c.area.x}, y ${c.area.y}, ${c.area.w} × ${c.area.h} px of the picture.` + (c.image ? ` The marks are drawn on a copy: ${c.image} (beside this file).` : ''), '');
341
+ if (c.image)
342
+ out.push(`![The marked area](${c.image})`, '');
343
+ for (const p of c.photos ?? [])
344
+ out.push(`![A photo](${p})`, '');
345
+ out.push(c.body, '');
346
+ for (const r of c.replies ?? [])
347
+ out.push(`> **${r.author}**: ${r.body.replace(/\n/g, '\n> ')}`, '');
348
+ }
349
+ };
350
+ const order = (a, b) => a.path.localeCompare(b.path) || (a.line ?? 0) - (b.line ?? 0);
351
+ section('Open', [...open].sort(order));
352
+ section('Resolved', [...done].sort(order));
353
+ if (!comments.length)
354
+ out.push('No notes yet.', '');
355
+ else if (openOnly && !open.length)
356
+ out.push('No open notes.', '');
357
+ return out.join('\n');
358
+ }
359
+ function langOf(p) {
360
+ const ext = p.slice(p.lastIndexOf('.') + 1).toLowerCase();
361
+ return /^[a-z0-9]{1,8}$/.test(ext) && p.includes('.') ? ext : '';
362
+ }
363
+ function isComment(x) {
364
+ if (!x || typeof x !== 'object')
365
+ return false;
366
+ const c = x;
367
+ return typeof c.id === 'string' && typeof c.path === 'string' && typeof c.body === 'string' && (c.status === 'open' || c.status === 'resolved');
368
+ }
@@ -0,0 +1,136 @@
1
+ // The file list (for quick open and name search) and full-text search across it.
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import { isHidden, walk } from './files.js';
5
+ import { pathFilter } from './glob.js';
6
+ const MAX_FILE = 2 * 1024 * 1024;
7
+ const MAX_MATCHES = 3000;
8
+ const MAX_PER_FILE = 200;
9
+ const LINE_CAP = 400;
10
+ export class FileIndex {
11
+ scope;
12
+ git;
13
+ maxFile;
14
+ cached;
15
+ constructor(scope, git, maxFile = MAX_FILE) {
16
+ this.scope = scope;
17
+ this.git = git;
18
+ this.maxFile = maxFile;
19
+ }
20
+ invalidate() {
21
+ this.cached = undefined;
22
+ }
23
+ async files() {
24
+ if (this.cached && Date.now() - this.cached.at < 30_000)
25
+ return this.cached.files;
26
+ let files;
27
+ if (this.git)
28
+ files = await this.git.files().catch(() => undefined);
29
+ files ??= walk(this.scope);
30
+ files = files.filter((f) => !f.split('/').some((p) => isHidden(this.scope, p)) && !this.scope.excluded(f) && fs.existsSync(path.join(this.scope.root, f)));
31
+ this.cached = { at: Date.now(), files };
32
+ return files;
33
+ }
34
+ async search(query) {
35
+ const t0 = Date.now();
36
+ const result = { files: [], total: 0, truncated: false, searched: 0, ms: 0 };
37
+ let re;
38
+ try {
39
+ re = makeRegex(query);
40
+ }
41
+ catch (e) {
42
+ return { ...result, error: e instanceof Error ? e.message : String(e) };
43
+ }
44
+ const prefix = query.scope.replace(/^\/+|\/+$/g, '');
45
+ const filter = pathFilter(query.include);
46
+ const all = (await this.files()).filter((f) => (!prefix || f.startsWith(prefix + '/')) && filter(f));
47
+ // in git, git grep says which files can match; only those are read (names are still checked on every file)
48
+ const maybe = this.git ? await this.git.grepFiles(query.q, { regex: query.regex, caseSensitive: query.caseSensitive, word: query.word }) : undefined;
49
+ // read many files at once (each read is mostly waiting on the disk), keep the results in path order
50
+ const found = new Array(all.length);
51
+ let next = 0;
52
+ const worker = async () => {
53
+ while (next < all.length && result.total < MAX_MATCHES) {
54
+ const idx = next++;
55
+ const file = all[idx] ?? '';
56
+ const hits = { path: file, matches: [] };
57
+ re.lastIndex = 0;
58
+ if (re.test(file.slice(file.lastIndexOf('/') + 1)))
59
+ hits.name = true;
60
+ const text = maybe && !maybe.has(file) ? undefined : await readText(path.join(this.scope.root, file), this.maxFile);
61
+ if (maybe && !maybe.has(file))
62
+ result.searched++;
63
+ if (text !== undefined) {
64
+ result.searched++;
65
+ const lines = text.split('\n');
66
+ for (let i = 0; i < lines.length && hits.matches.length < MAX_PER_FILE; i++) {
67
+ const line = (lines[i] ?? '').replace(/\r$/, '');
68
+ const ranges = hitsIn(re, line);
69
+ if (ranges.length)
70
+ hits.matches.push(clip(i + 1, line, ranges));
71
+ }
72
+ }
73
+ if (hits.matches.length || hits.name) {
74
+ found[idx] = hits;
75
+ result.total += hits.matches.length || 1;
76
+ }
77
+ }
78
+ };
79
+ await Promise.all(Array.from({ length: 48 }, worker));
80
+ result.truncated = next < all.length;
81
+ result.files = found.filter((f) => f !== undefined);
82
+ result.ms = Date.now() - t0;
83
+ return result;
84
+ }
85
+ }
86
+ function makeRegex(q) {
87
+ let src = q.regex ? q.q : q.q.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
88
+ if (q.word)
89
+ src = `\\b(?:${src})\\b`;
90
+ const re = new RegExp(src, q.caseSensitive ? 'g' : 'gi');
91
+ if (re.test(''))
92
+ throw new Error('That pattern matches nothing at all (an empty match).');
93
+ return re;
94
+ }
95
+ function hitsIn(re, line) {
96
+ const out = [];
97
+ re.lastIndex = 0;
98
+ let m;
99
+ while ((m = re.exec(line)) && out.length < 50) {
100
+ if (m[0] === '') {
101
+ re.lastIndex++;
102
+ continue;
103
+ }
104
+ out.push([m.index, m.index + m[0].length]);
105
+ }
106
+ return out;
107
+ }
108
+ /** long lines are cut around the first hit so the result stays readable */
109
+ function clip(line, text, hits) {
110
+ if (text.length <= LINE_CAP)
111
+ return { line, text, hits };
112
+ const first = hits[0]?.[0] ?? 0;
113
+ const start = Math.max(0, first - 80);
114
+ const end = Math.min(text.length, start + LINE_CAP);
115
+ const lead = start > 0 ? '…' : '';
116
+ const shift = start - lead.length;
117
+ return {
118
+ line,
119
+ text: lead + text.slice(start, end) + (end < text.length ? '…' : ''),
120
+ hits: hits.filter(([a, b]) => a >= start && b <= end).map(([a, b]) => [a - shift, b - shift]),
121
+ };
122
+ }
123
+ async function readText(abs, max) {
124
+ try {
125
+ const st = await fs.promises.stat(abs);
126
+ if (!st.isFile() || st.size > max)
127
+ return undefined;
128
+ const buf = await fs.promises.readFile(abs);
129
+ if (buf.subarray(0, 8192).includes(0))
130
+ return undefined; // binary
131
+ return buf.toString('utf8');
132
+ }
133
+ catch {
134
+ return undefined;
135
+ }
136
+ }
@@ -0,0 +1,69 @@
1
+ // Live reload: watches the folder and tells open pages which folders changed (and when git's state may have).
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import { NOISE } from './files.js';
5
+ export function watchTree(root, gitDir, onBatch) {
6
+ let folders = new Set(), files = new Set(), git = false;
7
+ let timer;
8
+ const flush = () => {
9
+ timer = undefined;
10
+ const b = { folders: [...folders], files: [...files], git };
11
+ folders = new Set();
12
+ files = new Set();
13
+ git = false;
14
+ onBatch(b);
15
+ };
16
+ const bump = () => {
17
+ timer ??= setTimeout(flush, 250);
18
+ };
19
+ const closers = [];
20
+ try {
21
+ const w = fs.watch(root, { recursive: true }, (_event, name) => {
22
+ if (!name)
23
+ return bump();
24
+ const rel = String(name).split(path.sep).join('/');
25
+ const parts = rel.split('/');
26
+ if (parts[0] === '.git') {
27
+ // the index, HEAD and refs say git's view moved; objects and logs are noise
28
+ if (/^\.git\/(index|HEAD|refs\/|packed-refs|MERGE_HEAD)/.test(rel)) {
29
+ git = true;
30
+ bump();
31
+ }
32
+ return;
33
+ }
34
+ if (parts.some((p) => NOISE.has(p)))
35
+ return;
36
+ files.add(rel);
37
+ folders.add(parts.slice(0, -1).join('/'));
38
+ git = true; // a working-tree edit changes git status too
39
+ bump();
40
+ });
41
+ w.on('error', () => undefined);
42
+ closers.push(() => w.close());
43
+ }
44
+ catch {
45
+ // recursive watching isn't available here: no live reload, the page still works on refresh
46
+ }
47
+ // a served subfolder of a repo: .git is elsewhere, watch it on its own
48
+ if (gitDir && !gitDir.startsWith(root + path.sep)) {
49
+ try {
50
+ const w = fs.watch(gitDir, (_e, name) => {
51
+ if (name && /^(index|HEAD|packed-refs)$/.test(String(name))) {
52
+ git = true;
53
+ bump();
54
+ }
55
+ });
56
+ w.on('error', () => undefined);
57
+ closers.push(() => w.close());
58
+ }
59
+ catch {
60
+ // fine without it
61
+ }
62
+ }
63
+ return () => {
64
+ for (const c of closers)
65
+ c();
66
+ if (timer)
67
+ clearTimeout(timer);
68
+ };
69
+ }
package/dist/fs/zip.js ADDED
@@ -0,0 +1,100 @@
1
+ // A folder as a .zip, streamed: each file deflated (or stored, when that's smaller), no dependencies.
2
+ // Plain ZIP (not ZIP64): up to 65,535 files and under 4 GB, which is checked before anything is sent.
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
+ import zlib from 'node:zlib';
6
+ const TABLE = (() => {
7
+ const t = new Uint32Array(256);
8
+ for (let n = 0; n < 256; n++) {
9
+ let c = n;
10
+ for (let k = 0; k < 8; k++)
11
+ c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
12
+ t[n] = c >>> 0;
13
+ }
14
+ return t;
15
+ })();
16
+ export function crc32(buf) {
17
+ const native = zlib.crc32;
18
+ if (native)
19
+ return native(buf) >>> 0;
20
+ let c = 0xffffffff;
21
+ for (const b of buf)
22
+ c = (TABLE[(c ^ b) & 0xff] ?? 0) ^ (c >>> 8);
23
+ return (c ^ 0xffffffff) >>> 0;
24
+ }
25
+ export const ZIP_LIMITS = { files: 65_535, bytes: 2 * 1024 * 1024 * 1024 };
26
+ function dosTime(d) {
27
+ const time = (d.getHours() << 11) | (d.getMinutes() << 5) | Math.floor(d.getSeconds() / 2);
28
+ const date = (Math.max(0, d.getFullYear() - 1980) << 9) | ((d.getMonth() + 1) << 5) | d.getDate();
29
+ return [time, date];
30
+ }
31
+ /** Write a zip of the given files (absolute path → name inside the zip) to out. */
32
+ export async function writeZip(out, files) {
33
+ const central = [];
34
+ let offset = 0;
35
+ const write = (b) => new Promise((resolve, reject) => {
36
+ offset += b.length;
37
+ if (out.write(b))
38
+ resolve();
39
+ else {
40
+ out.once('drain', resolve);
41
+ out.once('error', reject);
42
+ }
43
+ });
44
+ for (const f of files) {
45
+ let data, st;
46
+ try {
47
+ st = await fs.promises.stat(f.abs);
48
+ data = await fs.promises.readFile(f.abs);
49
+ }
50
+ catch {
51
+ continue; // gone since it was listed
52
+ }
53
+ const crc = crc32(data);
54
+ const deflated = zlib.deflateRawSync(data, { level: 6 });
55
+ const store = deflated.length >= data.length;
56
+ const body = store ? data : deflated;
57
+ const name = Buffer.from(f.name, 'utf8');
58
+ const [time, date] = dosTime(st.mtime);
59
+ const local = Buffer.alloc(30);
60
+ local.writeUInt32LE(0x04034b50, 0);
61
+ local.writeUInt16LE(20, 4);
62
+ local.writeUInt16LE(0x0800, 6); // names are UTF-8
63
+ local.writeUInt16LE(store ? 0 : 8, 8);
64
+ local.writeUInt16LE(time, 10);
65
+ local.writeUInt16LE(date, 12);
66
+ local.writeUInt32LE(crc, 14);
67
+ local.writeUInt32LE(body.length, 18);
68
+ local.writeUInt32LE(data.length, 22);
69
+ local.writeUInt16LE(name.length, 26);
70
+ const at = offset;
71
+ await write(Buffer.concat([local, name]));
72
+ await write(body);
73
+ const cen = Buffer.alloc(46);
74
+ cen.writeUInt32LE(0x02014b50, 0);
75
+ cen.writeUInt16LE(20, 4);
76
+ cen.writeUInt16LE(20, 6);
77
+ cen.writeUInt16LE(0x0800, 8);
78
+ cen.writeUInt16LE(store ? 0 : 8, 10);
79
+ cen.writeUInt16LE(time, 12);
80
+ cen.writeUInt16LE(date, 14);
81
+ cen.writeUInt32LE(crc, 16);
82
+ cen.writeUInt32LE(body.length, 20);
83
+ cen.writeUInt32LE(data.length, 24);
84
+ cen.writeUInt16LE(name.length, 28);
85
+ cen.writeUInt32LE(at, 42);
86
+ central.push(Buffer.concat([cen, name]));
87
+ }
88
+ const start = offset;
89
+ const dir = Buffer.concat(central);
90
+ await write(dir);
91
+ const end = Buffer.alloc(22);
92
+ end.writeUInt32LE(0x06054b50, 0);
93
+ end.writeUInt16LE(central.length, 8);
94
+ end.writeUInt16LE(central.length, 10);
95
+ end.writeUInt32LE(dir.length, 12);
96
+ end.writeUInt32LE(start, 16);
97
+ await write(end);
98
+ }
99
+ /** A zip-safe name for a root-relative path inside a folder being zipped. */
100
+ export const entryName = (folderName, rel) => path.posix.join(folderName, rel);