hitloop 0.0.0-stage → 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 (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
package/dist/mcp.js ADDED
@@ -0,0 +1,500 @@
1
+ // `hitl mcp`: an MCP server on stdio (JSON-RPC, one message per line). Tools for an agent to ask the human questions,
2
+ // show things for review, ask for approval, and read what the human said, a little at a time. No SDK: the protocol
3
+ // needed here is small, and npx starts it quickly.
4
+ import path from 'node:path';
5
+ import readline from 'node:readline';
6
+ import { spawnSync } from 'node:child_process';
7
+ import { StoreError } from './hub/atomic.js';
8
+ import { describeSet, readAnswers, FILTERS } from './q/agent.js';
9
+ import { decisionsText, news, openProject, overviewText, readFeedback, readNotes, waitFor, REVIEW_FILTERS, WAITS } from './agent.js';
10
+ import { ensureHub, links, register, keyed, projects, runningHub } from './hub/registry.js';
11
+ import { questionSchema, sectionSchema, blockSchema, conditionSchema } from './q/schema.js';
12
+ import { itemSchema } from './r/schema.js';
13
+ import { version } from './server.js';
14
+ export const INSTRUCTIONS = `hitl (Human In The Loop) puts things in front of the user on their phone or computer, and saves what they say in the project (.hitl/). Use it instead of chat when:
15
+ - you have more than about 4 questions, or questions that need thought or pictures: add_questions (one set per topic), each with options, one recommended, and why it matters; mark the ones you can't go on without as blocking.
16
+ - you want the user to look at or review something: show (mode "review" asks a verdict per item; "show" is just to look). Items can be project files (whole, lines, or changes since a git revision), raw code/text/markdown/JSON, diffs, pictures (with a before for before/after), diagrams, HTML mockups, links. Each call makes its own review: it never replaces another's.
17
+ - you need a yes or no before doing something (a deploy, deleting data, spending money): approve. It waits, then tells you approved or refused.
18
+ Then give the user the link from the result (get_link gives it again). Keep working on what doesn't depend on the answer. To wait, prefer running \`npx hitloop wait --any\` (or \`--done <id>\`) in the background: it exits, and wakes you, when the user has said something. The wait tool blocks for at most a few minutes.
19
+ Read only what's new with news: answers, verdicts, comments on lines and marked picture areas, and notes the user wrote on files (or anywhere). Apply them, then ack (answers and verdicts) or resolve (comments and notes) with a short note the user sees. Put the user's words into docs word for word. decisions searches what they decided before: check it before asking again.
20
+ Say who's asking with "from" (your session's name or branch). The hitl CLI does all of this too, plus serving and setup: \`npx hitloop --help\` lists every command and option; check it instead of guessing.`;
21
+ const folderProp = { folder: { type: 'string', description: 'The project folder (default: the folder the MCP server started in)' } };
22
+ const setProp = { set: { type: 'string', description: 'The question set id: letters, digits, . _ - (its file is .hitl/questions/<set>.json)' } };
23
+ const reviewProp = { review: { type: 'string', description: 'The review id (from show or approve)' } };
24
+ const fromProp = { from: { type: 'string', description: "Who's asking: your session's name, the branch, the tool (shown to the user)" } };
25
+ const idsProp = { ids: { type: 'array', items: { type: 'string' } } };
26
+ const projectOf = (args) => openProject(path.resolve(typeof args['folder'] === 'string' && args['folder'] ? args['folder'] : process.cwd()));
27
+ const str = (v) => (typeof v === 'string' ? v : '');
28
+ const strList = (v) => (Array.isArray(v) ? v.map(String) : typeof v === 'string' && v ? [v] : []);
29
+ const need = (v, what) => {
30
+ const s = str(v);
31
+ if (!s)
32
+ throw new StoreError(`Which ${what}? Pass "${what}".`);
33
+ return s;
34
+ };
35
+ let branchCache = {};
36
+ /** who's asking, when the agent doesn't say: HITL_FROM, else the git branch */
37
+ export function defaultFrom(root) {
38
+ if (process.env['HITL_FROM'])
39
+ return process.env['HITL_FROM'];
40
+ if (!(root in branchCache)) {
41
+ const r = spawnSync('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd: root, encoding: 'utf8', windowsHide: true, timeout: 5000 });
42
+ branchCache = { ...branchCache, [root]: r.status === 0 && r.stdout.trim() && r.stdout.trim() !== 'HEAD' ? `branch ${r.stdout.trim()}` : '' };
43
+ }
44
+ return branchCache[root] ?? '';
45
+ }
46
+ /** The hub's links to a place in the project (the hub is started if needed, and knows the project). */
47
+ export async function linkFor(root, where = '', start = true) {
48
+ register(root);
49
+ const hub = start ? await ensureHub() : await runningHub();
50
+ if (!hub)
51
+ return 'The hitl server is not running (get_link starts it).';
52
+ const key = keyed(projects()).find((p) => path.resolve(p.root).toLowerCase() === path.resolve(root).toLowerCase())?.key ?? '';
53
+ const hash = key ? `#/p/${encodeURIComponent(key)}${where}` : '';
54
+ const all = links(hub.port, hub.host, hub.token, hash, hub.base);
55
+ return ['Links for the user (the first is this computer; the others work from a phone on the same network or Tailscale):', ...all.map((l) => ' ' + l)].join('\n');
56
+ }
57
+ function problems(n) {
58
+ const out = [];
59
+ if (n.errors.length)
60
+ out.push('Errors:', ...n.errors.map((e) => ' ' + e));
61
+ if (n.warnings.length)
62
+ out.push('Warnings:', ...n.warnings.slice(0, 20).map((e) => ' ' + e));
63
+ return out.join('\n');
64
+ }
65
+ const clampTimeout = (v, dflt) => Math.min(900, Math.max(1, typeof v === 'number' ? v : dflt)) * 1000;
66
+ const tools = [
67
+ // ── everything ──
68
+ {
69
+ name: 'news',
70
+ description: "Everything the user said since you last read, across every question set, review and note: answers, verdicts, comments (on lines, on marked areas of pictures, with photos), and notes they wrote on files. Compact, one line each. Reading marks it read unless peek. Start here.",
71
+ inputSchema: { type: 'object', properties: { peek: { type: 'boolean', description: "Don't mark it read" }, ...idsProp, ...folderProp } },
72
+ run: async (a) => news(projectOf(a), { peek: a['peek'] === true, ids: strList(a['ids']) }).text,
73
+ },
74
+ {
75
+ name: 'status',
76
+ description: "What's in this project: every review and question set with its counts, and the notes. Cheap: nothing is marked read.",
77
+ inputSchema: { type: 'object', properties: { ...folderProp } },
78
+ run: async (a) => {
79
+ const p = projectOf(a);
80
+ const hub = await runningHub();
81
+ return [overviewText(p), hub ? '\n' + (await linkFor(p.root, '', false)).split('\n').slice(0, 3).join('\n') : ''].join('');
82
+ },
83
+ },
84
+ {
85
+ name: 'wait',
86
+ description: 'Block until the user has said something: until "any" (anything new; the default), "done" (these reviews have an overall verdict or approval / these question sets are all answered), "all" (every item has a verdict / every question answered), or "blocking" (the blocking questions are answered). ids narrows it to some reviews or question sets ("notes" for notes). Waits at most timeout_seconds (default 240, max 900); settle_seconds waits for a pause. For longer waits run `npx hitloop wait --any` in the background instead. Returns the news when it ends.',
87
+ inputSchema: { type: 'object', properties: { until: { enum: [...WAITS] }, ...idsProp, timeout_seconds: { type: 'number' }, settle_seconds: { type: 'number' }, ...folderProp } },
88
+ run: async (a, signal) => {
89
+ const p = projectOf(a);
90
+ const until = WAITS.includes(str(a['until'])) ? str(a['until']) : 'any';
91
+ const timeout = clampTimeout(a['timeout_seconds'], 240);
92
+ const settle = Math.max(0, typeof a['settle_seconds'] === 'number' ? a['settle_seconds'] : until === 'any' ? 20 : 0) * 1000;
93
+ const ok = await waitFor(p, { until, ids: strList(a['ids']), timeoutMs: timeout, settleMs: settle, signal });
94
+ return (ok ? 'Done waiting.\n' : `Still waiting after ${Math.round(timeout / 1000)} s.\n`) + news(p, { ids: strList(a['ids']) }).text;
95
+ },
96
+ },
97
+ {
98
+ name: 'get_link',
99
+ description: 'Links to the project (or one review or question set) on the shared hitl server, which this starts if needed. Give these to the user.',
100
+ inputSchema: { type: 'object', properties: { review: { type: 'string' }, set: { type: 'string' }, ...folderProp } },
101
+ run: async (a) => linkFor(projectOf(a).root, str(a['review']) ? `/r/${encodeURIComponent(str(a['review']))}` : str(a['set']) ? `/q/${encodeURIComponent(str(a['set']))}` : ''),
102
+ },
103
+ {
104
+ name: 'decisions',
105
+ description: 'What the user decided before: every answer, verdict and approval, newest first. q narrows it by words (all must match). Check this before asking something again.',
106
+ inputSchema: { type: 'object', properties: { q: { type: 'string' }, limit: { type: 'integer' }, ...folderProp } },
107
+ run: async (a) => decisionsText(projectOf(a), { q: str(a['q']), limit: typeof a['limit'] === 'number' ? a['limit'] : 60 }),
108
+ },
109
+ // ── reviews ──
110
+ {
111
+ name: 'show',
112
+ description: 'Put things in front of the user: files, code, text, diffs, pictures, diagrams, mockups, links. mode "review" (the default) asks for a verdict on each item (looks good / needs changes / no) and lets them comment on lines and mark areas of pictures; mode "show" is just to look. Each call makes a new review (its own file: it never replaces another) unless "to" names one to add to. Returns its id and the link to send.',
113
+ inputSchema: {
114
+ type: 'object',
115
+ required: ['items'],
116
+ properties: {
117
+ title: { type: 'string', description: 'What this is, short ("Login screen, round 2")' },
118
+ intro: { type: 'string', description: 'Markdown at the top: what you did and what you want from them' },
119
+ mode: { enum: ['review', 'show'] },
120
+ items: { type: 'array', items: itemSchema, minItems: 1 },
121
+ to: { type: 'string', description: 'Add these items to this review instead of making a new one' },
122
+ ...fromProp,
123
+ ...folderProp,
124
+ },
125
+ },
126
+ run: async (a) => {
127
+ const p = projectOf(a);
128
+ const items = Array.isArray(a['items']) ? a['items'] : [];
129
+ if (!items.length)
130
+ throw new StoreError('Nothing to show: pass items');
131
+ const from = str(a['from']) || defaultFrom(p.root);
132
+ const to = str(a['to']);
133
+ if (to) {
134
+ const r = p.reviews.addItems(to, items, { ...(str(a['title']) ? { title: str(a['title']) } : {}), ...(str(a['intro']) ? { intro: str(a['intro']) } : {}) });
135
+ return [`Added ${r.ids.length} item${r.ids.length === 1 ? '' : 's'} to "${to}": ${r.ids.join(', ')}`, problems(r.normalised), await linkFor(p.root, `/r/${encodeURIComponent(to)}`)].filter(Boolean).join('\n');
136
+ }
137
+ const mode = a['mode'] === 'show' ? 'show' : 'review';
138
+ const r = p.reviews.create({ title: str(a['title']) || 'Review', ...(str(a['intro']) ? { intro: str(a['intro']) } : {}), mode, ...(from ? { from } : {}) }, items);
139
+ return [
140
+ `Made ${mode === 'show' ? 'a showing' : 'a review'} "${r.id}" with ${r.ids.length} item${r.ids.length === 1 ? '' : 's'}: ${r.ids.join(', ')}`,
141
+ problems(r.normalised),
142
+ await linkFor(p.root, `/r/${encodeURIComponent(r.id)}`),
143
+ `Read what they say with news (or get_feedback review "${r.id}"); wait with \`npx hitloop wait --done ${r.id}\` in the background.`,
144
+ ]
145
+ .filter(Boolean)
146
+ .join('\n');
147
+ },
148
+ },
149
+ {
150
+ name: 'approve',
151
+ description: 'Ask the user for a yes or no before you do something (deploy, delete, spend, send). Shows the question, your details and any items, notifies their phone, and waits up to timeout_seconds (default 120, max 900) for the answer. Returns APPROVED, REFUSED or "changes asked for" with their note; if they haven\'t answered yet, says so: then wait with `npx hitloop wait --done <id>` in the background, or check with get_feedback.',
152
+ inputSchema: {
153
+ type: 'object',
154
+ required: ['question'],
155
+ properties: {
156
+ question: { type: 'string', description: 'What you want to do, as a yes/no question ("Deploy 2.4.0 to production?")' },
157
+ details: { type: 'string', description: 'Markdown: what will happen, what could go wrong, how to undo it' },
158
+ items: { type: 'array', items: itemSchema, description: 'Things to look at first (a diff, a plan, a screenshot)' },
159
+ timeout_seconds: { type: 'number' },
160
+ ...fromProp,
161
+ ...folderProp,
162
+ },
163
+ },
164
+ run: async (a, signal) => {
165
+ const p = projectOf(a);
166
+ const from = str(a['from']) || defaultFrom(p.root);
167
+ const items = Array.isArray(a['items']) ? a['items'] : [];
168
+ const r = p.reviews.create({ title: need(a['question'], 'question'), ...(str(a['details']) ? { intro: str(a['details']) } : {}), mode: 'approve', ...(from ? { from } : {}) }, items);
169
+ const link = await linkFor(p.root, `/r/${encodeURIComponent(r.id)}`);
170
+ const ok = await waitFor(p, { until: 'done', ids: [r.id], timeoutMs: clampTimeout(a['timeout_seconds'], 120), signal });
171
+ const fb = p.reviews.feedback(r.id);
172
+ if (!ok || !fb.overall)
173
+ return [`Asked "${r.id}"; no answer yet.`, link, `Wait for it: \`npx hitloop wait --done ${r.id}\` (in the background), then get_feedback review "${r.id}".`].join('\n');
174
+ const v = fb.overall.verdict;
175
+ p.reviews.markRead(r.id);
176
+ return `${v === 'ok' ? 'APPROVED' : v === 'no' ? 'REFUSED' : 'NOT YET: changes asked for'}${fb.overall.note ? ` — "${fb.overall.note}"` : ''} (${r.id})`;
177
+ },
178
+ },
179
+ {
180
+ name: 'get_feedback',
181
+ description: 'The user\'s feedback on one review: verdicts, comments (with lines, marked areas, photos) and replies. filter: new (the default; marks it read unless peek), all, open (comments still open).',
182
+ inputSchema: { type: 'object', required: ['review'], properties: { ...reviewProp, filter: { enum: [...REVIEW_FILTERS] }, peek: { type: 'boolean' }, format: { enum: ['text', 'json'] }, ...folderProp } },
183
+ run: async (a) => {
184
+ const r = readFeedback(projectOf(a).reviews, need(a['review'], 'review'), { filter: REVIEW_FILTERS.includes(str(a['filter'])) ? str(a['filter']) : 'new', peek: a['peek'] === true });
185
+ return a['format'] === 'json' ? JSON.stringify(r.data, null, 1) : r.text;
186
+ },
187
+ },
188
+ {
189
+ name: 'update_item',
190
+ description: 'Change an item in a review: the fields in "changes" replace the item\'s own (null removes one). A changed item\'s earlier verdict is flagged as given to an earlier version. A file item is snapshotted again.',
191
+ inputSchema: { type: 'object', required: ['review', 'id', 'changes'], properties: { ...reviewProp, id: { type: 'string' }, changes: { type: 'object' }, ...folderProp } },
192
+ run: async (a) => {
193
+ const n = projectOf(a).reviews.updateItem(need(a['review'], 'review'), need(a['id'], 'id'), a['changes'] ?? {});
194
+ return [`Updated ${str(a['id'])}.`, problems(n)].filter(Boolean).join('\n');
195
+ },
196
+ },
197
+ {
198
+ name: 'remove_items',
199
+ description: 'Remove items from a review (their feedback stays in the answers file).',
200
+ inputSchema: { type: 'object', required: ['review', 'ids'], properties: { ...reviewProp, ...idsProp, ...folderProp } },
201
+ run: async (a) => {
202
+ const removed = projectOf(a).reviews.removeItems(need(a['review'], 'review'), strList(a['ids']));
203
+ return removed.length ? `Removed ${removed.join(', ')}.` : 'None of those ids are in the review.';
204
+ },
205
+ },
206
+ {
207
+ name: 'update_review',
208
+ description: "Change a review's title, intro or mode, or close it (closed ones drop to the bottom of the user's list) and reopen it.",
209
+ inputSchema: { type: 'object', required: ['review'], properties: { ...reviewProp, title: { type: 'string' }, intro: { type: 'string' }, mode: { enum: ['review', 'show', 'approve'] }, status: { enum: ['open', 'closed'] }, ...folderProp } },
210
+ run: async (a) => {
211
+ const patch = {};
212
+ for (const k of ['title', 'intro', 'mode', 'status'])
213
+ if (typeof a[k] === 'string')
214
+ patch[k] = a[k];
215
+ const n = projectOf(a).reviews.update(need(a['review'], 'review'), patch);
216
+ return [`Saved review "${str(a['review'])}".`, problems(n)].filter(Boolean).join('\n');
217
+ },
218
+ },
219
+ {
220
+ name: 'ack',
221
+ description: 'Mark answers (set + ids: question ids) or review verdicts (review + ids: item ids) as dealt with, with a short note the user sees under each (e.g. "fixed in src/x.ts").',
222
+ inputSchema: { type: 'object', required: ['ids', 'note'], properties: { ...setProp, ...reviewProp, ...idsProp, note: { type: 'string' }, ...folderProp } },
223
+ run: async (a) => {
224
+ const p = projectOf(a);
225
+ const ids = strList(a['ids']);
226
+ const note = str(a['note']);
227
+ if (str(a['review'])) {
228
+ const done = p.reviews.ack(str(a['review']), ids, note);
229
+ return done.length ? `Marked ${done.length} done: ${done.join(', ')}` : 'None of those items have verdicts.';
230
+ }
231
+ const done = p.questions.ack(need(a['set'], 'set'), ids, note);
232
+ return done.length ? `Marked ${done.length} applied: ${done.join(', ')}` : 'None of those questions have answers.';
233
+ },
234
+ },
235
+ {
236
+ name: 'resolve',
237
+ description: 'Resolve the user\'s comments (review + ids: comment ids like c12) or notes (no review; ids: note ids from news), with a note saying what you did; the user sees it. reopen: true opens them again.',
238
+ inputSchema: { type: 'object', required: ['ids'], properties: { ...reviewProp, ...idsProp, note: { type: 'string' }, reopen: { type: 'boolean' }, ...folderProp } },
239
+ run: async (a) => {
240
+ const p = projectOf(a);
241
+ const ids = strList(a['ids']);
242
+ const status = a['reopen'] === true ? 'open' : 'resolved';
243
+ const done = str(a['review']) ? p.reviews.setStatus(str(a['review']), ids, status, 'agent', str(a['note'])) : p.notes.resolve(ids, str(a['note']), status);
244
+ return done.length ? `${status === 'open' ? 'Reopened' : 'Resolved'} ${done.join(', ')}.` : 'None of those ids were found.';
245
+ },
246
+ },
247
+ {
248
+ name: 'reply',
249
+ description: "Write to the user: on a question's thread (set + id), on a review comment (review + comment), on a review as a whole or one item (review + item; a new comment from you), or on a note (note). They see it there.",
250
+ inputSchema: {
251
+ type: 'object',
252
+ required: ['message'],
253
+ properties: { ...setProp, id: { type: 'string', description: 'The question id' }, ...reviewProp, comment: { type: 'string' }, item: { type: 'string' }, note: { type: 'string', description: 'A note id' }, message: { type: 'string', description: 'Markdown' }, ...folderProp },
254
+ },
255
+ run: async (a) => {
256
+ const p = projectOf(a);
257
+ const msg = need(a['message'], 'message');
258
+ if (str(a['note'])) {
259
+ const c = p.notes.reply(str(a['note']), 'agent', msg, 'agent');
260
+ if (!c)
261
+ throw new StoreError(`No note "${str(a['note'])}"`);
262
+ return `Replied on note ${str(a['note'])}.`;
263
+ }
264
+ if (str(a['review'])) {
265
+ if (str(a['comment'])) {
266
+ p.reviews.reply(str(a['review']), str(a['comment']), 'agent', msg);
267
+ return `Replied on ${str(a['comment'])}.`;
268
+ }
269
+ const c = p.reviews.comment(str(a['review']), { item: str(a['item']), body: msg }, 'agent');
270
+ return `Wrote ${c.id} on ${str(a['item']) || 'the review'}.`;
271
+ }
272
+ p.questions.message(need(a['set'], 'set'), need(a['id'], 'id'), 'agent', msg);
273
+ return `Replied on ${str(a['id'])}.`;
274
+ },
275
+ },
276
+ {
277
+ name: 'notes',
278
+ description: 'Notes the user wrote on files, lines, picture areas or nothing in particular. filter: new (the default; marks them read), open, all. (news includes new ones too.)',
279
+ inputSchema: { type: 'object', properties: { filter: { enum: ['new', 'open', 'all'] }, peek: { type: 'boolean' }, ...folderProp } },
280
+ run: async (a) => {
281
+ const f = ['new', 'open', 'all'].includes(str(a['filter'])) ? str(a['filter']) : 'new';
282
+ const r = readNotes(projectOf(a).notes, { filter: f, peek: a['peek'] === true });
283
+ return r.count ? `${r.count} note${r.count === 1 ? '' : 's'} (${f}):\n${r.text}` : f === 'new' ? 'No new notes.' : `No ${f} notes.`;
284
+ },
285
+ },
286
+ // ── questions (questionme) ──
287
+ {
288
+ name: 'add_questions',
289
+ description: 'Add questions to a set (the set and section are made if needed). Returns the ids, any problems, and the link to send the user. Questions are validated: a bad one is rejected with the reason.',
290
+ inputSchema: {
291
+ type: 'object',
292
+ required: ['set', 'questions'],
293
+ properties: {
294
+ ...setProp,
295
+ title: { type: 'string', description: "The set's title, when it's new" },
296
+ section: { oneOf: [{ type: 'string', description: 'An existing section id' }, { ...sectionSchema, description: 'A section (made if new): id, title, intro, content, hidden, showIf' }] },
297
+ before: { type: 'string', description: 'Insert before this question id (default: at the end of the section)' },
298
+ questions: { type: 'array', items: questionSchema, minItems: 1 },
299
+ ...fromProp,
300
+ ...folderProp,
301
+ },
302
+ },
303
+ run: async (a) => {
304
+ const p = projectOf(a);
305
+ const set = need(a['set'], 'set');
306
+ if (p.reviews.has(set))
307
+ throw new StoreError(`"${set}" is a review's id; pick another set id`);
308
+ const qs = Array.isArray(a['questions']) ? a['questions'] : [];
309
+ if (!qs.length)
310
+ throw new StoreError('No questions given');
311
+ const section = a['section'] && typeof a['section'] === 'object' ? a['section'] : str(a['section']) || undefined;
312
+ const from = str(a['from']) || defaultFrom(p.root);
313
+ const { ids, normalised } = p.questions.addQuestions(set, qs, section, { title: str(a['title']) || undefined, before: str(a['before']) || undefined, from });
314
+ return [`Added ${ids.length} question${ids.length === 1 ? '' : 's'} to "${set}": ${ids.join(', ')}`, problems(normalised), await linkFor(p.root, `/q/${encodeURIComponent(set)}`)].filter(Boolean).join('\n');
315
+ },
316
+ },
317
+ {
318
+ name: 'update_question',
319
+ description: 'Change a question: the fields in "changes" replace the question\'s own (null removes a field; options are replaced whole). If the question text, type or options change, an earlier answer is flagged "changed" for the user to look at again.',
320
+ inputSchema: { type: 'object', required: ['set', 'id', 'changes'], properties: { ...setProp, id: { type: 'string' }, changes: { type: 'object', description: 'Question fields (see add_questions)' }, ...folderProp } },
321
+ run: async (a) => {
322
+ const n = projectOf(a).questions.updateQuestion(need(a['set'], 'set'), str(a['id']), a['changes'] ?? {});
323
+ return [`Updated ${str(a['id'])}.`, problems(n)].filter(Boolean).join('\n');
324
+ },
325
+ },
326
+ {
327
+ name: 'remove_questions',
328
+ description: 'Remove questions from a set. Their answers stay in the answers file, listed as answers to removed questions.',
329
+ inputSchema: { type: 'object', required: ['set', 'ids'], properties: { ...setProp, ...idsProp, ...folderProp } },
330
+ run: async (a) => {
331
+ const removed = projectOf(a).questions.removeQuestions(need(a['set'], 'set'), strList(a['ids']));
332
+ return removed.length ? `Removed ${removed.join(', ')}.` : 'None of those ids are in the set.';
333
+ },
334
+ },
335
+ {
336
+ name: 'update_set',
337
+ description: "Make a question set, or change its title, intro, content or status (closed sets drop to the bottom of the user's list).",
338
+ inputSchema: {
339
+ type: 'object',
340
+ required: ['set'],
341
+ properties: { ...setProp, title: { type: 'string' }, intro: { type: 'string', description: 'Markdown at the top of the set' }, content: { oneOf: [blockSchema, { type: 'array', items: blockSchema }] }, status: { enum: ['open', 'closed'] }, ...folderProp },
342
+ },
343
+ run: async (a) => {
344
+ const p = projectOf(a);
345
+ const set = need(a['set'], 'set');
346
+ const patch = {};
347
+ if (typeof a['title'] === 'string')
348
+ patch.title = a['title'];
349
+ if (typeof a['intro'] === 'string')
350
+ patch.intro = a['intro'];
351
+ if (a['content'] !== undefined)
352
+ patch.content = a['content'];
353
+ if (a['status'] === 'open' || a['status'] === 'closed')
354
+ patch.status = a['status'];
355
+ const n = p.questions.updateSet(set, patch, true);
356
+ return [`Saved set "${set}".`, problems(n)].filter(Boolean).join('\n');
357
+ },
358
+ },
359
+ {
360
+ name: 'update_section',
361
+ description: "Make a section, or change its title, intro, content, hidden or showIf (null removes a field). Its questions aren't touched.",
362
+ inputSchema: {
363
+ type: 'object',
364
+ required: ['set', 'id'],
365
+ properties: { ...setProp, id: { type: 'string' }, title: { type: 'string' }, intro: { type: 'string' }, content: { oneOf: [blockSchema, { type: 'array', items: blockSchema }] }, hidden: { type: 'boolean' }, showIf: conditionSchema, ...folderProp },
366
+ },
367
+ run: async (a) => {
368
+ const patch = {};
369
+ for (const k of ['title', 'intro', 'content', 'hidden', 'showIf'])
370
+ if (k in a)
371
+ patch[k] = a[k];
372
+ const n = projectOf(a).questions.updateSection(need(a['set'], 'set'), str(a['id']), patch);
373
+ return [`Saved section "${str(a['id'])}".`, problems(n)].filter(Boolean).join('\n');
374
+ },
375
+ },
376
+ {
377
+ name: 'show_set',
378
+ description: "A set's questions, one line each with their state (open, answered, later, hidden, changed). full: true adds options. Page with limit/offset.",
379
+ inputSchema: { type: 'object', required: ['set'], properties: { ...setProp, section: { type: 'string' }, ...idsProp, full: { type: 'boolean' }, limit: { type: 'integer' }, offset: { type: 'integer' }, ...folderProp } },
380
+ run: async (a) => describeSet(projectOf(a).questions, need(a['set'], 'set'), {
381
+ section: str(a['section']) || undefined,
382
+ ids: strList(a['ids']),
383
+ full: a['full'] === true,
384
+ limit: typeof a['limit'] === 'number' ? a['limit'] : undefined,
385
+ offset: typeof a['offset'] === 'number' ? a['offset'] : undefined,
386
+ }),
387
+ },
388
+ {
389
+ name: 'get_answers',
390
+ description: 'Read one set\'s answers, compactly: "id (question): answer — note" per line. filter: new (the default: answers and messages since you last read; marks them read unless peek), all, unacked, changed (answered before the question changed), blocking, open (still to answer, with recommendations). Page with limit/offset. format: "json" for full records. (news covers every set at once.)',
391
+ inputSchema: {
392
+ type: 'object',
393
+ required: ['set'],
394
+ properties: {
395
+ ...setProp,
396
+ filter: { enum: [...FILTERS] },
397
+ ...idsProp,
398
+ section: { type: 'string' },
399
+ limit: { type: 'integer', description: 'Default 100' },
400
+ offset: { type: 'integer' },
401
+ peek: { type: 'boolean', description: "Don't mark new answers read" },
402
+ questions: { enum: ['none', 'short', 'full'], description: 'How much of each question to repeat (default short)' },
403
+ format: { enum: ['text', 'json'] },
404
+ ...folderProp,
405
+ },
406
+ },
407
+ run: async (a) => {
408
+ const r = readAnswers(projectOf(a).questions, need(a['set'], 'set'), {
409
+ filter: FILTERS.includes(str(a['filter'])) ? str(a['filter']) : 'new',
410
+ ids: strList(a['ids']),
411
+ section: str(a['section']) || undefined,
412
+ limit: typeof a['limit'] === 'number' ? a['limit'] : undefined,
413
+ offset: typeof a['offset'] === 'number' ? a['offset'] : undefined,
414
+ peek: a['peek'] === true,
415
+ questions: ['none', 'short', 'full'].includes(str(a['questions'])) ? str(a['questions']) : undefined,
416
+ });
417
+ return a['format'] === 'json' ? JSON.stringify(r.data, null, 1) : r.text;
418
+ },
419
+ },
420
+ ];
421
+ const PROTOCOLS = ['2025-06-18', '2025-03-26', '2024-11-05'];
422
+ export function serveMcp(input = process.stdin, output = process.stdout) {
423
+ const send = (msg) => output.write(JSON.stringify(msg) + '\n');
424
+ const running = new Map();
425
+ const rl = readline.createInterface({ input, crlfDelay: Infinity });
426
+ const handle = async (msg) => {
427
+ const id = msg['id'];
428
+ const method = str(msg['method']);
429
+ const params = msg['params'] ?? {};
430
+ const reply = (result) => id !== undefined && send({ jsonrpc: '2.0', id, result });
431
+ const fail = (code, message) => id !== undefined && send({ jsonrpc: '2.0', id, error: { code, message } });
432
+ switch (method) {
433
+ case 'initialize': {
434
+ const asked = str(params['protocolVersion']);
435
+ return reply({
436
+ protocolVersion: PROTOCOLS.includes(asked) ? asked : PROTOCOLS[0],
437
+ capabilities: { tools: { listChanged: false } },
438
+ serverInfo: { name: 'hitl', title: 'hitl — Human In The Loop', version },
439
+ instructions: INSTRUCTIONS,
440
+ });
441
+ }
442
+ case 'ping':
443
+ return reply({});
444
+ case 'tools/list':
445
+ return reply({ tools: tools.map(({ name, description, inputSchema }) => ({ name, description, inputSchema })) });
446
+ case 'tools/call': {
447
+ const tool = tools.find((t) => t.name === params['name']);
448
+ if (!tool)
449
+ return fail(-32602, `Unknown tool ${str(params['name'])}`);
450
+ const ctl = new AbortController();
451
+ if (id !== undefined)
452
+ running.set(id, ctl);
453
+ try {
454
+ const text = await tool.run(params['arguments'] ?? {}, ctl.signal);
455
+ return reply({ content: [{ type: 'text', text }] });
456
+ }
457
+ catch (e) {
458
+ return reply({ content: [{ type: 'text', text: e instanceof Error ? e.message : String(e) }], isError: true });
459
+ }
460
+ finally {
461
+ if (id !== undefined)
462
+ running.delete(id);
463
+ }
464
+ }
465
+ case 'notifications/cancelled': {
466
+ const rid = params['requestId'];
467
+ if (rid !== undefined)
468
+ running.get(rid)?.abort();
469
+ return;
470
+ }
471
+ default:
472
+ if (method.startsWith('notifications/'))
473
+ return;
474
+ return fail(-32601, `Method not found: ${method}`);
475
+ }
476
+ };
477
+ return new Promise((resolve) => {
478
+ rl.on('line', (line) => {
479
+ if (!line.trim())
480
+ return;
481
+ let msg;
482
+ try {
483
+ msg = JSON.parse(line);
484
+ }
485
+ catch {
486
+ send({ jsonrpc: '2.0', id: null, error: { code: -32700, message: 'Parse error' } });
487
+ return;
488
+ }
489
+ const list = Array.isArray(msg) ? msg : [msg];
490
+ for (const m of list)
491
+ if (m && typeof m === 'object')
492
+ void handle(m);
493
+ });
494
+ rl.on('close', () => {
495
+ for (const c of running.values())
496
+ c.abort();
497
+ resolve();
498
+ });
499
+ });
500
+ }