eser 4.1.37 → 4.1.39

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 (293) hide show
  1. package/chunks/add-V7YYHLFH.js +8 -0
  2. package/chunks/{anthropic-2MXDKLNX.js → anthropic-QBGNUIP3.js} +1 -1
  3. package/chunks/approve-HVIH2A3C.js +2 -0
  4. package/chunks/ask-PMB64QWG.js +3 -0
  5. package/chunks/block-JSK5CJPO.js +2 -0
  6. package/chunks/browser-JGBNWUEQ.js +2 -0
  7. package/chunks/{build-EJLFNB4I.js → build-HUKFUVPB.js} +2 -2
  8. package/chunks/bun-HIMXX54I.js +2 -0
  9. package/chunks/changelog-gen-JV3EHOMV.js +10 -0
  10. package/chunks/{chunk-GJ4LCA6D.js → chunk-2KKLYXSA.js} +1 -1
  11. package/chunks/{chunk-JYNHFD6B.js → chunk-2XNFZXHY.js} +1 -1
  12. package/chunks/{chunk-2EVWKUN6.js → chunk-3AA3RXKD.js} +1 -1
  13. package/chunks/{chunk-CUIMSX4V.js → chunk-3IZX4OZ7.js} +1 -1
  14. package/chunks/{chunk-KPWEJXPI.js → chunk-3QF3I2RD.js} +1 -1
  15. package/chunks/{chunk-K6H7JTIH.js → chunk-4EHAL3NK.js} +1 -1
  16. package/chunks/chunk-4FGLERUG.js +2 -0
  17. package/chunks/{chunk-IDMI5OBK.js → chunk-4QDEJUAF.js} +1 -1
  18. package/chunks/{chunk-4MVO4LD5.js → chunk-5224ZYEW.js} +1 -1
  19. package/chunks/{chunk-LCG4SK6K.js → chunk-5DWJ7WEE.js} +1 -1
  20. package/chunks/chunk-5WJ6AUNY.js +2 -0
  21. package/chunks/chunk-6E6JUBFH.js +2 -0
  22. package/chunks/chunk-7UASU4NU.js +10 -0
  23. package/chunks/chunk-A3JJKZ4C.js +4 -0
  24. package/chunks/chunk-A3MZV73T.js +32 -0
  25. package/chunks/chunk-A6K5L4SG.js +3 -0
  26. package/chunks/{chunk-YVIGHK4H.js → chunk-AHKNU2JM.js} +1 -1
  27. package/chunks/{chunk-BCPCQHDL.js → chunk-BBOEAL63.js} +1 -1
  28. package/chunks/chunk-BQT5RJZB.js +2 -0
  29. package/chunks/{chunk-EBCQCAQ7.js → chunk-BWDCKK63.js} +1 -1
  30. package/chunks/{chunk-FORPNESQ.js → chunk-CMSPX2RN.js} +1 -1
  31. package/chunks/{chunk-H4SPMUT6.js → chunk-DKFL6XPX.js} +1 -1
  32. package/chunks/{chunk-HVLKXRPA.js → chunk-DWLFTRZS.js} +1 -1
  33. package/chunks/{chunk-PVPMHMKP.js → chunk-ECY4MUD3.js} +1 -1
  34. package/chunks/{chunk-IIIMOOFE.js → chunk-EGMYM4TM.js} +1 -1
  35. package/chunks/{chunk-I4C675WP.js → chunk-F35K7YVH.js} +1 -1
  36. package/chunks/{chunk-IZONBJSX.js → chunk-F5HQDZLN.js} +1 -1
  37. package/chunks/{chunk-A6RDYP6R.js → chunk-FFWPJP7A.js} +1 -1
  38. package/chunks/chunk-H2O5G3XB.js +2 -0
  39. package/chunks/{chunk-Y53YTL4C.js → chunk-HLKFDKLZ.js} +1 -1
  40. package/chunks/{chunk-SOBOSRJB.js → chunk-HP5W5XT6.js} +1 -1
  41. package/chunks/{chunk-BP3IFAPO.js → chunk-HTJLIAH4.js} +1 -1
  42. package/chunks/{chunk-7BFBOLLC.js → chunk-HVTJ5LVU.js} +1 -1
  43. package/chunks/chunk-HZ2ALFWG.js +66 -0
  44. package/chunks/{chunk-YQVWAWMO.js → chunk-ILROPD5P.js} +1 -1
  45. package/chunks/{chunk-LKF6GBNU.js → chunk-ISQIZSXN.js} +1 -1
  46. package/chunks/chunk-JI536JLJ.js +2 -0
  47. package/chunks/{chunk-UJPVEQX7.js → chunk-K2MKYDPY.js} +1 -1
  48. package/chunks/{chunk-T2DRBZ4X.js → chunk-KEOTIPA6.js} +1 -1
  49. package/chunks/chunk-L2E2H7YT.js +2 -0
  50. package/chunks/chunk-L7UCWRDZ.js +3 -0
  51. package/chunks/{chunk-4WQGB7NO.js → chunk-LBMJGMDD.js} +1 -1
  52. package/chunks/{chunk-2VEVVX6U.js → chunk-LFNUSULJ.js} +1 -1
  53. package/chunks/{chunk-5GGGQJ4P.js → chunk-MBCPGD5L.js} +1 -1
  54. package/chunks/chunk-MEZCXQAX.js +2 -0
  55. package/chunks/{chunk-B6EATLKL.js → chunk-MOY4CXAZ.js} +2 -2
  56. package/chunks/{chunk-P2DMLPKI.js → chunk-MQ4EMT35.js} +1 -1
  57. package/chunks/chunk-NEHZOG23.js +7 -0
  58. package/chunks/{chunk-QZ44TAIY.js → chunk-NJUIBCQR.js} +1 -1
  59. package/chunks/{chunk-5MWX3POX.js → chunk-NZRU3N6C.js} +1 -1
  60. package/chunks/{chunk-N2VBT43E.js → chunk-O2TA7OHJ.js} +1 -1
  61. package/chunks/{chunk-ER4ZWF4Y.js → chunk-OAFB4A6D.js} +1 -1
  62. package/chunks/chunk-OAT2D23A.js +2 -0
  63. package/chunks/{chunk-3QIPK7NI.js → chunk-OPPOHKNZ.js} +1 -1
  64. package/chunks/{chunk-ZNGLZECE.js → chunk-OWV223WQ.js} +1 -1
  65. package/chunks/{chunk-3BEX5FYF.js → chunk-P2MUEKFT.js} +1 -1
  66. package/chunks/{chunk-455V3AE5.js → chunk-P72TUTYK.js} +1 -1
  67. package/chunks/{chunk-Q2KSOC32.js → chunk-PPSDIDOI.js} +1 -1
  68. package/chunks/chunk-PXCM4FHO.js +2 -0
  69. package/chunks/{chunk-KVTG56GS.js → chunk-QFFGKP3M.js} +1 -1
  70. package/chunks/{chunk-PZNCE6QK.js → chunk-QXATB6Z5.js} +1 -1
  71. package/chunks/chunk-RGUPFAEE.js +68 -0
  72. package/chunks/{chunk-SP43S32B.js → chunk-RVJZFWN7.js} +1 -1
  73. package/chunks/{chunk-B5IPHVXT.js → chunk-SBAXURB7.js} +1 -1
  74. package/chunks/{chunk-7NUMDHE2.js → chunk-T4WKRBQZ.js} +1 -1
  75. package/chunks/{chunk-UJ6LH5FY.js → chunk-TEOMM3RD.js} +1 -1
  76. package/chunks/{chunk-QOX7VSID.js → chunk-TLVGNOK3.js} +1 -1
  77. package/chunks/{chunk-HYT26FYU.js → chunk-U5Q5MC74.js} +1 -1
  78. package/chunks/chunk-ULNEO3RY.js +4 -0
  79. package/chunks/{chunk-MXGRYONZ.js → chunk-UMKCOU3N.js} +1 -1
  80. package/chunks/{chunk-536RBSFU.js → chunk-UQ2BC7UA.js} +1 -1
  81. package/chunks/{chunk-HVOPUZOM.js → chunk-VIQLCQOI.js} +1 -1
  82. package/chunks/chunk-VWQLQJVX.js +2 -0
  83. package/chunks/{chunk-CKNA5LIK.js → chunk-WAEXOK7L.js} +1 -1
  84. package/chunks/{chunk-NP723K5L.js → chunk-WILZ4OR2.js} +1 -1
  85. package/chunks/chunk-WJKE6XHF.js +2 -0
  86. package/chunks/{chunk-KQE6FMKW.js → chunk-XYUJCTPP.js} +1 -1
  87. package/chunks/{chunk-P2TABZ4A.js → chunk-YEWODYET.js} +1 -1
  88. package/chunks/{chunk-3SXTMY75.js → chunk-YVN2NZL4.js} +1 -1
  89. package/chunks/{chunk-GBM3TZFD.js → chunk-ZC4F4MYU.js} +1 -1
  90. package/chunks/{chunk-KBFKBL6A.js → chunk-ZWMJQZQF.js} +1 -1
  91. package/chunks/claude-code-ELUDT5TV.js +2 -0
  92. package/chunks/{clone-H3UAEVVP.js → clone-YEBQK7CG.js} +1 -1
  93. package/chunks/cmd-2DAVTVOF.js +2 -0
  94. package/chunks/{commitmsg-7XZGGERO.js → commitmsg-FQ3IZ3TH.js} +2 -2
  95. package/chunks/concern-TIGYH5DX.js +2 -0
  96. package/chunks/deno-XQHOVHKR.js +2 -0
  97. package/chunks/dev-BNGJJR2O.js +4 -0
  98. package/chunks/dist-QVOR7USR.js +13 -0
  99. package/chunks/done-GGPPHJW2.js +2 -0
  100. package/chunks/file-tools-shared-KBTCO2FV.js +2 -0
  101. package/chunks/{gemini-F4KLO5VU.js → gemini-43AWJEWI.js} +1 -1
  102. package/chunks/gh-Q7VEABJS.js +4 -0
  103. package/chunks/gh-contributors-4KGARSNL.js +12 -0
  104. package/chunks/init-45ODFAV3.js +2 -0
  105. package/chunks/{init-J4IHOVZL.js → init-RV7K5JC4.js} +3 -3
  106. package/chunks/{install-KNZDCGIB.js → install-6XIQS5E7.js} +2 -2
  107. package/chunks/invoke-hook-Q3NMJXDO.js +11 -0
  108. package/chunks/kiro-NZ7LM6HA.js +2 -0
  109. package/chunks/list-BOLPKAEY.js +2 -0
  110. package/chunks/{list-N4ZKDFW7.js → list-NYLFIF2U.js} +1 -1
  111. package/chunks/list-UQMPOF5Y.js +2 -0
  112. package/chunks/load-config-G4DHKB5K.js +2 -0
  113. package/chunks/{main-HJQEBLLN.js → main-236QYA7G.js} +2 -2
  114. package/chunks/manifest-3VJ4O6HR.js +2 -0
  115. package/chunks/{mod-4ILLF5PK.js → mod-5JT4O5L3.js} +1 -1
  116. package/chunks/mod-BQJDMCYC.js +2 -0
  117. package/chunks/mod-DXA25A4J.js +2 -0
  118. package/chunks/mod-EWLBSEHA.js +2 -0
  119. package/chunks/mod-GSWVSC2C.js +28 -0
  120. package/chunks/mod-IHYN4TEM.js +3 -0
  121. package/chunks/mod-IXVUQHXS.js +2 -0
  122. package/chunks/mod-P4AVZJNK.js +2 -0
  123. package/chunks/mod-PZSJGUM7.js +2 -0
  124. package/chunks/mod-QWYXFGRG.js +2 -0
  125. package/chunks/{mod-OS3BCM2G.js → mod-SXL6PDQM.js} +1 -1
  126. package/chunks/mod-YH5Z6G4Q.js +2 -0
  127. package/chunks/multipart-parser-SSRHOBFH.js +3 -0
  128. package/chunks/{new-BOGCXTIY.js → new-U5U4E6HR.js} +1 -1
  129. package/chunks/next-AQ4TIEL7.js +9 -0
  130. package/chunks/node-IN5OQP4N.js +68 -0
  131. package/chunks/node-ZGM6SXXI.js +2 -0
  132. package/chunks/ollama-LHWMXMLY.js +2 -0
  133. package/chunks/openai-2KONKHWL.js +2 -0
  134. package/chunks/openai-IRQY5SCR.js +24 -0
  135. package/chunks/opencode-24O2MW3L.js +2 -0
  136. package/chunks/purge-RM6OD5PV.js +5 -0
  137. package/chunks/recipe-applier-TTZEZGSC.js +2 -0
  138. package/chunks/registry-fetcher-SPENFEOH.js +2 -0
  139. package/chunks/release-UEX6YK4K.js +9 -0
  140. package/chunks/release-notes-GA7CTA54.js +4 -0
  141. package/chunks/release-tag-VJWBXG5G.js +2 -0
  142. package/chunks/reset-WHYTPTFB.js +2 -0
  143. package/chunks/rule-ZQOGLQQI.js +3 -0
  144. package/chunks/run-IX74MQTI.js +4 -0
  145. package/chunks/run-L35K3KRF.js +5 -0
  146. package/chunks/scripts-VI2TKQOH.js +2 -0
  147. package/chunks/sdk-L2SQCWYV.js +41 -0
  148. package/chunks/serve-AVVEYGQB.js +4 -0
  149. package/chunks/{server-KNWQV2HW.js → server-R347ON4B.js} +1 -1
  150. package/chunks/spec-KMKZDLV2.js +2 -0
  151. package/chunks/src-6SFGTAGT.js +4 -0
  152. package/chunks/status-MLX4O37A.js +2 -0
  153. package/chunks/sync-PB4KWB3R.js +2 -0
  154. package/chunks/system-BXJ2LV5O.js +2 -0
  155. package/chunks/system-YLXVXRXW.js +2 -0
  156. package/chunks/{unstable_chmod-GDQI7NKH.js → unstable_chmod-2W47KJY3.js} +1 -1
  157. package/chunks/update-522VXIKX.js +6 -0
  158. package/chunks/validate-bom-JCMRVAUT.js +2 -0
  159. package/chunks/validate-case-conflict-WZQCMKSZ.js +2 -0
  160. package/chunks/validate-circular-deps-7R4F2YDV.js +2 -0
  161. package/chunks/validate-commit-msg-PH7Y3JEI.js +2 -0
  162. package/chunks/validate-docs-WCIOHNYP.js +2 -0
  163. package/chunks/validate-eof-KRYQLTFQ.js +2 -0
  164. package/chunks/validate-export-names-OCQ2XSY6.js +2 -0
  165. package/chunks/validate-filenames-46O7FCXF.js +2 -0
  166. package/chunks/validate-json-3EZ2L64H.js +2 -0
  167. package/chunks/validate-large-files-7YX6MSOB.js +2 -0
  168. package/chunks/validate-licenses-OC7JRVAH.js +2 -0
  169. package/chunks/validate-line-endings-2DM5UGCJ.js +2 -0
  170. package/chunks/validate-merge-conflict-UDMWYMJ5.js +2 -0
  171. package/chunks/validate-mod-exports-W24IV367.js +2 -0
  172. package/chunks/validate-package-configs-3Y55ZLUY.js +2 -0
  173. package/chunks/validate-secrets-66VXCCUF.js +2 -0
  174. package/chunks/validate-shebangs-AMEAHVLB.js +2 -0
  175. package/chunks/validate-submodules-DYCE27WK.js +2 -0
  176. package/chunks/validate-symlinks-QN744GUH.js +2 -0
  177. package/chunks/validate-toml-5K2XNHAE.js +2 -0
  178. package/chunks/validate-trailing-whitespace-QYWHHIAK.js +2 -0
  179. package/chunks/validate-yaml-VGKLHEAQ.js +2 -0
  180. package/chunks/versions-FYALONNL.js +2 -0
  181. package/chunks/{vertexai-EXTYPVHK.js → vertexai-2F2A3VTE.js} +1 -1
  182. package/chunks/watch-P56QT3Q2.js +9 -0
  183. package/chunks/workerd-LOWXXQEU.js +2 -0
  184. package/eser.js +1 -1
  185. package/package.json +1 -1
  186. package/chunks/add-5SDE43IH.js +0 -8
  187. package/chunks/approve-DNKMQSPX.js +0 -2
  188. package/chunks/ask-L3N6REQI.js +0 -3
  189. package/chunks/block-GRKMCTGR.js +0 -2
  190. package/chunks/browser-SG2DBNGS.js +0 -2
  191. package/chunks/bun-3AACRJXG.js +0 -2
  192. package/chunks/changelog-gen-MX6L2Z24.js +0 -10
  193. package/chunks/chunk-25FUVC3C.js +0 -13
  194. package/chunks/chunk-2HBVIH7V.js +0 -3
  195. package/chunks/chunk-32HV3K27.js +0 -2
  196. package/chunks/chunk-46ZWBKIW.js +0 -2
  197. package/chunks/chunk-4DOMGQOO.js +0 -2
  198. package/chunks/chunk-6FNHSIZJ.js +0 -2
  199. package/chunks/chunk-CBGABZ5E.js +0 -2
  200. package/chunks/chunk-CDPSH56U.js +0 -2
  201. package/chunks/chunk-CZS6DCUY.js +0 -61
  202. package/chunks/chunk-DAK2I7UC.js +0 -2
  203. package/chunks/chunk-DTO2YJWZ.js +0 -2
  204. package/chunks/chunk-DYRTLYTU.js +0 -3
  205. package/chunks/chunk-G6NAG2EK.js +0 -2
  206. package/chunks/chunk-JOTAKQMZ.js +0 -2
  207. package/chunks/chunk-MRCBHVSB.js +0 -2
  208. package/chunks/chunk-PE2TDUXD.js +0 -19
  209. package/chunks/chunk-RGUETQSC.js +0 -4
  210. package/chunks/chunk-STI6DX7K.js +0 -2
  211. package/chunks/chunk-STTKPXTW.js +0 -2
  212. package/chunks/chunk-TFPT4BDY.js +0 -15
  213. package/chunks/chunk-V3WALAAO.js +0 -4
  214. package/chunks/chunk-VD5ZJBSR.js +0 -7
  215. package/chunks/chunk-W3RVRCUB.js +0 -2
  216. package/chunks/chunk-Y4ARZGGL.js +0 -2
  217. package/chunks/claude-code-VUBEU7RR.js +0 -2
  218. package/chunks/concern-T2NW35XI.js +0 -2
  219. package/chunks/deno-7BSPHDRG.js +0 -2
  220. package/chunks/dev-PTMXZEVC.js +0 -4
  221. package/chunks/done-RZD34AZF.js +0 -2
  222. package/chunks/file-tools-shared-G36OYF5S.js +0 -2
  223. package/chunks/fileFromPath-MB3IRZVW.js +0 -7
  224. package/chunks/gh-L25JQWOY.js +0 -5
  225. package/chunks/gh-contributors-E7IZ2LFS.js +0 -12
  226. package/chunks/init-J46SBNIS.js +0 -2
  227. package/chunks/invoke-hook-YTLAPETS.js +0 -10
  228. package/chunks/kiro-HQLXD6ZU.js +0 -2
  229. package/chunks/list-5TGTYMAU.js +0 -2
  230. package/chunks/list-PY3A762R.js +0 -2
  231. package/chunks/load-config-FTQMJVEW.js +0 -2
  232. package/chunks/manifest-NF2EK757.js +0 -2
  233. package/chunks/mod-FEGQZ3ZY.js +0 -2
  234. package/chunks/mod-GY6YJWVP.js +0 -2
  235. package/chunks/mod-HKYPZOU7.js +0 -2
  236. package/chunks/mod-JI2A2546.js +0 -2
  237. package/chunks/mod-JZNE2HH6.js +0 -2
  238. package/chunks/mod-MLRQFSBE.js +0 -2
  239. package/chunks/mod-NCF6OSXO.js +0 -2
  240. package/chunks/mod-PFWQZF3T.js +0 -28
  241. package/chunks/mod-W3DBWTCY.js +0 -11
  242. package/chunks/mod-YX3JRMSI.js +0 -2
  243. package/chunks/next-HAAR572Z.js +0 -4
  244. package/chunks/node-KCQF6QQA.js +0 -60
  245. package/chunks/node-MFKYO4CY.js +0 -2
  246. package/chunks/ollama-36F5QAOO.js +0 -2
  247. package/chunks/openai-EU5TJZ5T.js +0 -2
  248. package/chunks/openai-IKXRJYI3.js +0 -20
  249. package/chunks/opencode-7J3JDC44.js +0 -2
  250. package/chunks/purge-7QJOGWHM.js +0 -5
  251. package/chunks/recipe-applier-6QZYAZ57.js +0 -2
  252. package/chunks/registry-fetcher-76ISLGRR.js +0 -2
  253. package/chunks/release-J3PVDROM.js +0 -9
  254. package/chunks/release-notes-AARDYXYA.js +0 -4
  255. package/chunks/release-tag-H2YWUXRU.js +0 -2
  256. package/chunks/reset-WSJ47SUR.js +0 -2
  257. package/chunks/rule-J4FRRKOE.js +0 -3
  258. package/chunks/run-K6PMBZEQ.js +0 -4
  259. package/chunks/run-RGEZUAPM.js +0 -5
  260. package/chunks/scripts-JK6W2MCO.js +0 -2
  261. package/chunks/sdk-MXV452BR.js +0 -19
  262. package/chunks/serve-XVAIQ37L.js +0 -4
  263. package/chunks/spec-KTBVG2EX.js +0 -2
  264. package/chunks/status-3C2T6QAE.js +0 -2
  265. package/chunks/sync-WLEELRJW.js +0 -2
  266. package/chunks/system-GTHT75OL.js +0 -2
  267. package/chunks/system-WTPEDJU6.js +0 -2
  268. package/chunks/update-4C4WNXCE.js +0 -6
  269. package/chunks/validate-bom-QVE5HNBO.js +0 -2
  270. package/chunks/validate-case-conflict-XFS3URQN.js +0 -2
  271. package/chunks/validate-circular-deps-BMPAT3PF.js +0 -2
  272. package/chunks/validate-commit-msg-BPESCI7P.js +0 -2
  273. package/chunks/validate-docs-ITL4L6KY.js +0 -2
  274. package/chunks/validate-eof-DTFV74VL.js +0 -2
  275. package/chunks/validate-export-names-HLOH7D73.js +0 -2
  276. package/chunks/validate-filenames-J4RTDEBD.js +0 -2
  277. package/chunks/validate-json-KMODGNSU.js +0 -2
  278. package/chunks/validate-large-files-X5YF7D7T.js +0 -2
  279. package/chunks/validate-licenses-OZ7DXQTY.js +0 -2
  280. package/chunks/validate-line-endings-PFF6QJ3W.js +0 -2
  281. package/chunks/validate-merge-conflict-KB2X6QLW.js +0 -2
  282. package/chunks/validate-mod-exports-VHK2NVKI.js +0 -2
  283. package/chunks/validate-package-configs-ZNCAIYRO.js +0 -2
  284. package/chunks/validate-secrets-RM6DMZVG.js +0 -2
  285. package/chunks/validate-shebangs-WC66D7RK.js +0 -2
  286. package/chunks/validate-submodules-SPAXASAG.js +0 -2
  287. package/chunks/validate-symlinks-4LOWK2MQ.js +0 -2
  288. package/chunks/validate-toml-SG4IITMN.js +0 -2
  289. package/chunks/validate-trailing-whitespace-GRE2PJ6T.js +0 -2
  290. package/chunks/validate-yaml-RA22QNW6.js +0 -2
  291. package/chunks/versions-ODYWYT7U.js +0 -2
  292. package/chunks/watch-NEFCEWP5.js +0 -9
  293. package/chunks/workerd-VVSAKLDZ.js +0 -2
@@ -0,0 +1,8 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as N,b as x,c as H}from"./chunk-HP5W5XT6.js";import{f as C}from"./chunk-F35K7YVH.js";import{a as E,d as $}from"./chunk-P2MUEKFT.js";import{k as S}from"./chunk-TEOMM3RD.js";import{f as b,h,k as I}from"./chunk-ZC4F4MYU.js";import{d as o,f as k,g,h as A,k as y}from"./chunk-YVN2NZL4.js";import{a as v}from"./chunk-MG65QJY6.js";import{a as d,b as c,c as R}from"./chunk-FFWPJP7A.js";import{i as w}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var _=r=>E(async e=>{try{let t=await S(r.registrySource,{verbose:r.verbose,local:r.local}),s=t.recipes.find(n=>n.name===r.recipeName);if(s===void 0)return c({_tag:"RecipeNotFound",message:`Recipe '${r.recipeName}' not found. Run \`eser kit list\` to see available recipes.`});let a=await N(r.cwd),i=x(s,a);for(let n of i.warnings)e.out.writeln(A(`Warning: ${n}`));let l=await C(r.recipeName,t.recipes,{cwd:r.cwd,registryUrl:t.registryUrl,force:r.force,skipExisting:r.skipExisting,dryRun:r.dryRun,verbose:r.verbose,variables:r.variables}),m=0,p=0;for(let n of l.recipes)m+=n.result.written.length,p+=n.result.skipped.length;e.out.writeln(g(`\u2713 Added ${m} file(s)`)),l.recipes.length>1&&e.out.writeln(o(` Applied ${l.recipes.length} recipes (including dependencies)`)),p>0&&e.out.writeln(o(` Skipped ${p} existing file(s)`));let f=l.recipes.find(n=>n.name===r.recipeName);if(f!==void 0)for(let n of f.result.written)e.out.writeln(` \u2192 ${n}`);let u;if(!r.noInstall&&!r.dryRun&&i.instructions.length>0){e.out.writeln(o(`
3
+ Installing dependencies...`)),u=await H(i.instructions,r.cwd,{verbose:r.verbose});for(let n of u)n.success?e.out.writeln(g(` \u2713 ${n.command}`)):e.out.writeln(k(` \u2717 ${n.command}: ${n.error}`))}else if(i.instructions.length>0){e.out.writeln(o(`
4
+ Dependencies (run manually):`));for(let n of i.instructions)e.out.writeln(o(` ${n}`))}return d({recipe:s,chainResult:l,depInfo:i,installResults:u})}catch(t){let s=t instanceof Error?t.message:String(t);return c({_tag:"ApplyError",message:s})}});var j=r=>{let e={};for(let t of r){let[s,...a]=String(t).split("=");s!==void 0&&s!==""&&(e[s]=a.join("="))}return e},B=async r=>{let e=v(r??[],{string:["registry","var"],boolean:["dry-run","force","skip-existing","verbose","local","no-install"],collect:["var"]}),t=e._[0],s=b({renderer:I.ansi(),sink:h.stdout()});if(t===void 0)return s.writeln("Usage: eser kit add <recipe> [--registry <url>] [--dry-run] [--var key=value]"),s.writeln(),s.writeln("Run ",o("`eser kit list`")," to see available recipes."),await s.close(),d(void 0);let a=e["dry-run"]===!0;a?s.writeln(y(`
5
+ Dry run: ${t}
6
+ `)):s.writeln(y(`
7
+ Adding ${t}...
8
+ `));let i=await $(_({recipeName:t,cwd:w.process.cwd(),registrySource:e.registry,local:e.local===!0,dryRun:a,force:e.force===!0,skipExisting:e["skip-existing"]===!0,verbose:e.verbose===!0,noInstall:e["no-install"]===!0,variables:j(e.var)}),{out:s});return await s.close(),R(i)?d(void 0):c({exitCode:1})};export{B as main};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-Q2KSOC32.js";import"./chunk-BNQAZLIQ.js";import"./chunk-J7YTWK67.js";import"./chunk-G6NAG2EK.js";export{a as AnthropicModel,b as anthropicFactory};
2
+ import{a,b}from"./chunk-PPSDIDOI.js";import"./chunk-BNQAZLIQ.js";import"./chunk-J7YTWK67.js";import"./chunk-5WJ6AUNY.js";export{a as AnthropicModel,b as anthropicFactory};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as R}from"./chunk-A3JJKZ4C.js";import"./chunk-4QDEJUAF.js";import{a as P,d as D}from"./chunk-MQ4EMT35.js";import{e as y,g as C}from"./chunk-JI536JLJ.js";import{e as v,f as h,g as o,l as S,p as g}from"./chunk-NEHZOG23.js";import{c as n}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{f as w,h as f,k as u}from"./chunk-ZC4F4MYU.js";import{c as t,d,f as m,g as p,k as i}from"./chunk-YVN2NZL4.js";import{a as c}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var $=async E=>{let s=w({renderer:u.ansi(),sink:f.stdout()}),a=l.process.cwd(),A=h(E),e=await v(a,A),F=await S(a);if(e.phase==="SPEC_DRAFT"){if(e.classification===null&&e.spec!==null){let _=(await g(a)).filter(b=>F?.concerns.includes(b.id)??!1);try{await R(a,e,_)}catch{}}let r=C(e);await o(a,r),r.spec!==null&&(await P(a,r.spec,"approved"),await D(a,r.spec,"approved")),s.writeln(p("\u2714")," Spec approved. Phase: ",i("SPEC_APPROVED")),s.writeln("When ready, run ",t(`${n('next --answer="start"')}`)," to begin execution.")}else if(e.phase==="DISCOVERY_REVIEW"){let r=y(e);await o(a,r),s.writeln(p("\u2714")," Discovery answers approved. Phase: ",i("SPEC_DRAFT")),s.writeln("Review the spec and run ",t(n("approve"))," again to approve.")}else e.phase==="DISCOVERY"&&e.discovery.completed?(s.writeln(d("Discovery complete. Spec draft already generated.")),s.writeln("Review the spec and run ",t(n("approve"))," again when in SPEC_DRAFT phase.")):s.writeln(m(`Cannot approve in phase: ${e.phase}`));return await s.close(),c(void 0)};export{$ as main};
@@ -0,0 +1,3 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as _,b as $}from"./chunk-GE3LJ6QM.js";import{a as F}from"./chunk-BNQAZLIQ.js";import{d as x,f as v,g as I,h as y,k as P}from"./chunk-ZC4F4MYU.js";import{d as O,e as L,g as R}from"./chunk-5DWJ7WEE.js";import{a as T}from"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import{d as S}from"./chunk-ECY4MUD3.js";import{a as C,b as g}from"./chunk-FFWPJP7A.js";import{i as m}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var k=(e,t,n)=>{let i=e.streamText(t,n);return{name:`ai-text/${e.provider}/${e.modelId}`,readable:new ReadableStream({async start(o){try{for await(let s of i)s.kind==="content_delta"&&o.enqueue(x(s.textDelta));o.close()}catch(s){o.error(s)}}})}};var Y={cc:"claude-code",ol:"ollama",oc:"opencode",oai:"openai",ant:"anthropic",gem:"gemini",vtx:"vertexai"},q={"claude-code":"Claude Code",ollama:"Ollama",opencode:"OpenCode",kiro:"Kiro",anthropic:"Anthropic API",openai:"OpenAI API",gemini:"Gemini API",vertexai:"Vertex AI"},H=e=>Y[e]??e,K=async e=>{if(e){let t=m.process.stderr.getWriter(),n=v({renderer:P.ansi(),sink:y.writable(new WritableStream({async write(i){await t.write(new TextEncoder().encode(String(i.data)))},close(){t.releaseLock()}}))});await O.configure({sinks:{stderr:R.getOutputSink(n)},loggers:[{category:["ai"],lowestLevel:T.Debug,sinks:["stderr"]}]})}return L.getLogger(["ai","ask"])},M=async e=>{await e.info("Auto-detecting AI provider...");try{if(await S`which claude`.noThrow().code()===0)return await e.info("Claude Code detected."),"claude-code"}catch{}try{if((await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok)return await e.info("Ollama detected at localhost:11434."),"ollama"}catch{}try{if(await S`which opencode`.noThrow().code()===0)return await e.info("OpenCode detected."),"opencode"}catch{}if(m.capabilities.env){if(m.env.has("ANTHROPIC_API_KEY"))return await e.info("Anthropic API key detected."),"anthropic";if(m.env.has("OPENAI_API_KEY"))return await e.info("OpenAI API key detected."),"openai"}throw new Error("No AI provider detected. Install claude, ollama, or set ANTHROPIC_API_KEY / OPENAI_API_KEY.")},U=async e=>{switch(e){case"claude-code":return(await import("./claude-code-ELUDT5TV.js")).claudeCodeFactory;case"ollama":return(await import("./ollama-LHWMXMLY.js")).ollamaFactory;case"opencode":return(await import("./opencode-24O2MW3L.js")).openCodeFactory;case"kiro":return(await import("./kiro-NZ7LM6HA.js")).kiroFactory;case"anthropic":return(await import("./anthropic-QBGNUIP3.js")).anthropicFactory;case"openai":return(await import("./openai-2KONKHWL.js")).openaiFactory;case"gemini":return(await import("./gemini-43AWJEWI.js")).geminiFactory;case"vertexai":return(await import("./vertexai-2F2A3VTE.js")).vertexaiFactory;default:throw new Error(`Unknown provider: ${e}`)}},le=async e=>{let t=e??[],n=null,i=null,o=null,s=!1,p=!1,A=[],a=0;for(;a<t.length;){let r=t[a];if(r==="-p"||r==="--provider"){n=t[a+1]??null,a+=2;continue}if(r==="-m"||r==="--model"){i=t[a+1]??null,a+=2;continue}if(r==="--max-tokens"){let c=t[a+1];c!==void 0&&(o=Number(c)),a+=2;continue}if(r==="--json"){s=!0,a+=1;continue}if(r==="-v"||r==="--verbose"){p=!0,a+=1;continue}r.startsWith("-")||A.push(r),a+=1}let f=A.join(" ");if(f.length===0)return g({message:'Usage: ai ask "your prompt" [-p provider] [-m model] [--verbose]',exitCode:1});let d=await K(p);try{let r=n!==null?H(n):await M(d),c=q[r]??r,E=i??z(r);await d.info(`Using ${c} (${E})`);let N=await U(r),w=new _({factories:[N]});await w.addModel("default",{provider:r,model:E});let h=w.getDefault();if(h===null)return g({message:"Failed to initialize model",exitCode:1});let b=[F("user",f)];if(await d.info(`Sending prompt (${f.length} chars)...`),s){let u=await h.generateText({messages:b,maxTokens:o??void 0});await d.info(`Response received (${$(u).length} chars)`);let l=v({sink:y.stdout()});l.writeln(JSON.stringify(u,null,2)),await l.close()}else{let u=k(h,{messages:b,maxTokens:o??void 0});await I().from(u).to(V()).run();let l=m.process.stdout.getWriter();await l.write(new TextEncoder().encode(`
3
+ `)),l.releaseLock()}return await w.close(),C(void 0)}catch(r){let c=r instanceof Error?r.message:String(r);return await d.error(c),p&&r instanceof Error&&r.cause!==void 0&&await d.debug(`Cause: ${String(r.cause)}`),g({message:c,exitCode:1})}},j=12,G=e=>new Promise(t=>setTimeout(t,e)),V=(e=j)=>{let t=new TextEncoder;return{name:"typewriter",writable:new WritableStream({async write(n){let i=String(n.data),o=m.process.stdout.getWriter();for(let s of i)await o.write(t.encode(s)),await G(e);o.releaseLock()}})}},z=e=>{switch(e){case"claude-code":return"claude-sonnet-4-20250514";case"ollama":return"llama3";case"opencode":return"default";case"kiro":return"default";case"anthropic":return"claude-sonnet-4-20250514";case"openai":return"gpt-4o";case"gemini":return"gemini-2.0-flash";case"vertexai":return"gemini-2.0-flash";default:return"default"}};export{le as main};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{i as S}from"./chunk-JI536JLJ.js";import{e as w,f as h,g}from"./chunk-NEHZOG23.js";import{c as k}from"./chunk-OAT2D23A.js";import"./chunk-2XNFZXHY.js";import{f as d,h as f,k as u}from"./chunk-ZC4F4MYU.js";import{c as l,d as p,f as c,h as m}from"./chunk-YVN2NZL4.js";import{a as n,b as i}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var j=async t=>{let e=d({renderer:u.ansi(),sink:f.stdout()}),r=a.process.cwd(),b=h(t),o=(t??[]).filter(x=>!x.startsWith("--spec=")).join(" ")||"No reason given",s=await w(r,b);if(s.phase!=="EXECUTING")return e.writeln(c(`Cannot block in phase: ${s.phase}`)),await e.close(),i({exitCode:1});let v=S(s,o);return await g(r,v),e.writeln(m("\u26A0")," Spec blocked: ",p(o)),e.writeln("Resolve with: ",l(`${k('next --answer="resolution"')}`)),await e.close(),n(void 0)};export{j as main};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{f as e,u as s,v as t,w as r,x as a}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var o={fs:!1,fsSync:!1,exec:!1,process:!1,env:!1,stdin:!1,stdout:!1,kv:!1},c=()=>({name:"browser",version:globalThis.navigator?.userAgent??"unknown",capabilities:o,fs:s("browser"),path:e,exec:t("browser"),env:a(),process:r("browser")});export{o as BROWSER_CAPABILITIES,c as createBrowserRuntime};
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{f as d,h as g,k as m}from"./chunk-GBM3TZFD.js";import{b as c,d as L,h as C,k as u}from"./chunk-3SXTMY75.js";import"./chunk-PWLF3WXM.js";import{a as v}from"./chunk-PZNCE6QK.js";import"./chunk-MG65QJY6.js";import{a as y}from"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var V=["trace","debug","info","warn","error","fatal"],N=async x=>{let{flags:o}=v(x??[],[{name:"out-dir",type:"string",default:"dist",description:"Output directory"},{name:"clean",type:"boolean",description:"Clean output first"},{name:"no-minify",type:"boolean",description:"Disable minification"},{name:"analyze",type:"boolean",description:"Analyze bundle size"},{name:"log-level",type:"string",default:"info",description:"Log level"}]),t=d({renderer:m.ansi(),sink:g.stdout()});t.writeln(u(`
2
+ import{f as d,h as g,k as m}from"./chunk-ZC4F4MYU.js";import{b as c,d as L,h as C,k as u}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as v}from"./chunk-QXATB6Z5.js";import"./chunk-MG65QJY6.js";import{a as y}from"./chunk-FFWPJP7A.js";import"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var V=["trace","debug","info","warn","error","fatal"],N=async x=>{let{flags:o}=v(x??[],[{name:"out-dir",type:"string",default:"dist",description:"Output directory"},{name:"clean",type:"boolean",description:"Clean output first"},{name:"no-minify",type:"boolean",description:"Disable minification"},{name:"analyze",type:"boolean",description:"Analyze bundle size"},{name:"log-level",type:"string",default:"info",description:"Log level"}]),t=d({renderer:m.ansi(),sink:g.stdout()});t.writeln(u(`
3
3
  \u{1F4E6} Building for production...
4
- `));let e=await import("./mod-4ILLF5PK.js"),{runtime:n}=await import("./mod-MLRQFSBE.js"),i=n.process.cwd(),p=o["out-dir"],S=!o["no-minify"],h=o.clean,k=o.analyze,f=o["log-level"]??"info",b=V.includes(f.toLowerCase())?f.toLowerCase():"info",z={trace:e.Severities.Trace,debug:e.Severities.Debug,info:e.Severities.Info,warn:e.Severities.Warning,error:e.Severities.Error,fatal:e.Severities.Critical},D=d({renderer:m.ansi(),sink:g.stdout()});await e.config.configure({sinks:{console:e.sinks.getOutputSink(D)},loggers:[{category:["laroux-bundler"],lowestLevel:z[b],sinks:["console"]}]});let[{build:A,createBuildContext:E},{loadConfig:O},{reactPlugin:B},{createTailwindPlugin:P}]=await Promise.all([import("./system-WTPEDJU6.js"),import("./load-config-FTQMJVEW.js"),import("./mod-OS3BCM2G.js"),import("./mod-JZNE2HH6.js")]),T=e.logger.getLogger(["laroux-bundler","cli"]),s=await O(i),r={projectRoot:i,srcDir:n.path.resolve(i,s.srcDir),distDir:n.path.resolve(i,p),logLevel:b,fonts:s.fonts,images:s.images,cssModuleTypes:s.cssModuleTypes,noCssModuleAutoReference:s.noCssModuleAutoReference,browserShims:s.browserShims,serverExternals:s.build.serverExternals,build:{...s.build,minify:S}};if(h)try{await n.fs.remove(r.distDir,{recursive:!0}),T.debug(`Cleaned ${r.distDir}`)}catch{}let R=P({globalCssPath:n.path.resolve(i,"src/app/styles/global.css")}),j=E(r,{framework:B,css:R,bundlerBackend:"rolldown"});if(await A(j),await e.config.reset(),k){t.writeln(u(`
4
+ `));let e=await import("./mod-5JT4O5L3.js"),{runtime:n}=await import("./mod-DXA25A4J.js"),i=n.process.cwd(),p=o["out-dir"],S=!o["no-minify"],h=o.clean,k=o.analyze,f=o["log-level"]??"info",b=V.includes(f.toLowerCase())?f.toLowerCase():"info",z={trace:e.Severities.Trace,debug:e.Severities.Debug,info:e.Severities.Info,warn:e.Severities.Warning,error:e.Severities.Error,fatal:e.Severities.Critical},D=d({renderer:m.ansi(),sink:g.stdout()});await e.config.configure({sinks:{console:e.sinks.getOutputSink(D)},loggers:[{category:["laroux-bundler"],lowestLevel:z[b],sinks:["console"]}]});let[{build:A,createBuildContext:E},{loadConfig:O},{reactPlugin:B},{createTailwindPlugin:P}]=await Promise.all([import("./system-BXJ2LV5O.js"),import("./load-config-G4DHKB5K.js"),import("./mod-SXL6PDQM.js"),import("./mod-EWLBSEHA.js")]),T=e.logger.getLogger(["laroux-bundler","cli"]),s=await O(i),r={projectRoot:i,srcDir:n.path.resolve(i,s.srcDir),distDir:n.path.resolve(i,p),logLevel:b,fonts:s.fonts,images:s.images,cssModuleTypes:s.cssModuleTypes,noCssModuleAutoReference:s.noCssModuleAutoReference,browserShims:s.browserShims,serverExternals:s.build.serverExternals,build:{...s.build,minify:S}};if(h)try{await n.fs.remove(r.distDir,{recursive:!0}),T.debug(`Cleaned ${r.distDir}`)}catch{}let R=P({globalCssPath:n.path.resolve(i,"src/app/styles/global.css")}),j=E(r,{framework:B,css:R,bundlerBackend:"rolldown"});if(await A(j),await e.config.reset(),k){t.writeln(u(`
5
5
  \u{1F4CA} Bundle Analysis:
6
6
  `));try{let M=`${p}/client/manifest.json`,$=await n.fs.readTextFile(M),w=JSON.parse($);t.writeln(c("Chunks:"));for(let[a,l]of Object.entries(w.files)){let I=(l.size/1024).toFixed(2);t.writeln(c(` ${a.padEnd(30)} ${I.padStart(8)} KB`))}let F=Object.values(w.files).reduce((a,l)=>a+l.size,0);t.writeln(L(`
7
7
  Total: ${(F/1024).toFixed(2)} KB`))}catch{t.writeln(C("Could not analyze build (manifest.json not found)"))}}return await t.close(),y(void 0)};export{N as main};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as m,b as h,c as g,d as S}from"./chunk-VWQLQJVX.js";import{s as l,t as p}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var y={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!1},u=async i=>{if(!i)return new Uint8Array(0);let n=[],t=i.getReader();try{for(;;){let{done:e,value:s}=await t.read();if(e)break;n.push(s)}}finally{t.releaseLock()}let a=n.reduce((e,s)=>e+s.length,0),o=new Uint8Array(a),d=0;for(let e of n)o.set(e,d),d+=e.length;return o},P=async(i,n=[],t)=>{let[a,o,d]=l(t),e=Bun.spawn([i,...n],{cwd:t?.cwd,env:t?.env,stdin:a,stdout:o,stderr:d}),[s,r,c]=await Promise.all([e.exited,u(e.stdout),u(e.stderr)]);return{success:s===0,code:s,stdout:r,stderr:c}},b=(i,n=[],t)=>{let[a,o,d]=l(t),e=Bun.spawn([i,...n],{cwd:t?.cwd,env:t?.env,stdin:a,stdout:o,stderr:d}),s=e.exited.then(r=>({success:r===0,code:r,signal:void 0}));return{pid:e.pid,stdin:e.stdin,stdout:e.stdout,stderr:e.stderr,status:s,output:async()=>{let[r,c,w]=await Promise.all([s,u(e.stdout),u(e.stderr)]);return{success:r.success,code:r.code,stdout:c,stderr:w}},kill:r=>{e.kill(r)}}},A=()=>({name:"bun",version:Bun.version,capabilities:y,fs:m(),path:h(),exec:p(P,b),env:g(),process:S()});export{y as BUN_CAPABILITIES,A as createBunRuntime};
@@ -0,0 +1,10 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as R,b as A}from"./chunk-HTJLIAH4.js";import{a as w}from"./chunk-L7UCWRDZ.js";import"./chunk-A6K5L4SG.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as x}from"./chunk-LFNUSULJ.js";import{a as y,c as v}from"./chunk-4FGLERUG.js";import{l as m}from"./chunk-H2O5G3XB.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-VAIRJES2.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as h}from"./chunk-P2MUEKFT.js";import"./chunk-ZC4F4MYU.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-ECY4MUD3.js";import{a as C}from"./chunk-MG65QJY6.js";import{g as u}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{j as p}from"./chunk-WJKE6XHF.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var{ctx:f,output:q}=y(),$={feat:"Added",fix:"Fixed",refactor:"Changed",perf:"Changed",docs:"Changed",revert:"Removed"},E=new Set(["chore","ci","test"]),S=/^(\w+)(?:\(([^)]+)\))?!?:\s{1,5}(.+)$/,T=/\s{0,100}\(take\s{1,100}[IVXLCDM\d]+\)\s{0,100}\.?$/i,G=(t,o)=>{let n=t.match(S);if(n!==null)return{type:n[1].toLowerCase(),scope:n[2],message:n[3].trim(),hash:o}},O=t=>t.replace(T,"").trim(),N=t=>{let o=[];for(let n of t){let e=G(n.subject,n.hash);e!==void 0&&o.push(e)}return o},I=t=>{let o=new Set,n=[];for(let e of t){let s=O(e.message),a=s.replace(/[.\s]{1,20}$/,"").toLowerCase(),l=`${e.type}:${a}`;o.has(l)||(o.add(l),n.push({...e,message:s}))}return n},P=t=>{let o=new Map;for(let n of t){if(E.has(n.type))continue;let e=$[n.type];if(e===void 0)continue;let s=o.get(e);s!==void 0?s.push(n):o.set(e,[n])}return o},M=t=>t.scope!==void 0?`- **${t.scope}:** ${t.message}`:`- ${t.message}`,b=(t,o)=>{let n=P(o);if(n.size===0){let l=new Date().toISOString().split("T")[0];return`## ${t} - ${l}
3
+
4
+ _Maintenance release._`}let e=new Date().toISOString().split("T")[0],s=[`## ${t} - ${e}`],a=["Added","Changed","Fixed","Removed"];for(let l of a){let r=n.get(l);if(!(r===void 0||r.length===0)){s.push("",`### ${l}`,"");for(let d of r)s.push(M(d))}}return s.join(`
5
+ `)},k=(t,o,n)=>{let e=t.split(`
6
+ `);if(n!==void 0){let r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=new RegExp(`^##\\s+${r}\\b`),i=e.findIndex(g=>d.test(g));if(i!==-1){let g=e.length;for(let c=i+1;c<e.length;c++)if(/^##\s+/.test(e[c])){g=c;break}return e.splice(i,g-i,o),e.join(`
7
+ `)}}let s=e.findIndex(r=>/^##\s+\[Unreleased\]/i.test(r));if(s===-1){let r=e.findIndex((i,g)=>g>0&&i.startsWith("## ")),d=r===-1?e.length:r;return e.splice(d,0,"",o,""),e.join(`
8
+ `)}let a=-1;for(let r=s+1;r<e.length;r++)if(/^##\s+/.test(e[r])){a=r;break}let l=a===-1?e.length:a;return e.splice(l,0,o,""),e.join(`
9
+ `)},L=async(t={})=>{let{root:o=".",dryRun:n=!1}=t,e=await w({root:o});if(e===void 0||e==="")throw new Error("VERSION file is missing or empty.");let s;try{s=await R()}catch{throw new Error("No git tags found. Create an initial tag first (e.g., git tag v0.0.0).")}let a=await A(s,"HEAD");if(a.length===0)throw new Error(`No commits found since ${s}. Nothing to release.`);let l=N(a),r=I(l),d=b(e,r);if(!n){let i=p.runtime.path.join(o,"CHANGELOG.md"),g;try{g=await p.runtime.fs.readTextFile(i)}catch{throw new Error(`CHANGELOG.md not found at ${i}. Create one first.`)}let c=k(g,d,e);await p.runtime.fs.writeTextFile(i,c)}return{version:e,commitCount:a.length,entryCount:r.filter(i=>!E.has(i.type)).length,content:d,dryRun:n}},F=t=>h.fromPromise(()=>L(t)),H=t=>u.ok({dryRun:t.flags["dry-run"]===!0}),j=t=>{if(u.isFail(t)){let n=t.error instanceof Error?t.error.message:String(t.error);return m.error(f,n),u.fail({exitCode:1})}let{value:o}=t;return o.dryRun?(m.warn(f,"[DRY RUN] Generated changelog preview:"),m.info(f,`
10
+ ${o.content}`)):m.success(f,`Added ${o.entryCount} entries to CHANGELOG.md for v${o.version}`),u.ok(void 0)},_=x.createTrigger({handler:F,adaptInput:H,adaptOutput:j}),J=async t=>{let o=C(t??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),n=v("changelog-gen",o);return await _(n)};export{I as deduplicateCommits,L as generateChangelog,F as generateChangelogHandler,b as generateChangelogSection,P as groupBySection,_ as handleCli,k as insertIntoChangelog,J as main,G as parseConventionalCommit,N as parseConventionalCommits,O as stripTakeSuffix};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as b,b as w,d as F,f as D}from"./chunk-DYRTLYTU.js";import{a as C}from"./chunk-2VEVVX6U.js";import{a as h}from"./chunk-4DOMGQOO.js";import{f as R}from"./chunk-3BEX5FYF.js";import{b as l,f as m,g as k,h as A,i as g}from"./chunk-3SXTMY75.js";import{g as d}from"./chunk-A6RDYP6R.js";var x=(e,r)=>{let o={},t=e.length;for(let s=0;s<t;s++){let n=e[s],a=r(n);o[a]===void 0?o[a]=[n]:o[a].push(n)}return o};var u=h(),P=(e,r)=>e===r?!0:typeof e!=typeof r||typeof e!="object"||e===null||r===null?!1:JSON.stringify(e)===JSON.stringify(r),O=(e,r)=>e[r],j=e=>e.startsWith("npm:@jsr/"),B=e=>{let r=e.slice(9),o=r.indexOf("__");if(o===-1)throw new Error(`Invalid npm JSR format: ${e}`);let t=r.slice(0,o),s=r.slice(o+2),n=s.indexOf("@"),a,p;return n===-1?(a=s,p=""):(a=s.slice(0,n),p=s.slice(n)),`jsr:@${t}/${a}${p}`},_=(e,r)=>j(r)?B(r):r.startsWith("npm:")?r:`npm:${e}@${r}`,S=e=>e==="workspace:*"||e.startsWith("workspace:"),M=(e,r,o)=>{let t=[],s=r.dependencies??{},n=r.devDependencies??{},a={...s,...n},p=o.imports??{};for(let[y,c]of Object.entries(a)){if(S(c))continue;let f=_(y,c),i=p[y];i===void 0?t.push({packageName:e,dependencyName:y,issue:"missing_in_deno",expected:f}):i!==f&&t.push({packageName:e,dependencyName:y,issue:"version_mismatch",expected:f,actual:i})}for(let[y,c]of Object.entries(p))a[y]===void 0&&t.push({packageName:e,dependencyName:y,issue:"missing_in_package",actual:p[y]});return t},G=async(e,r)=>{let o=[],t=[],s=await w({baseDir:e,includeFiles:[b.DenoJson,b.PackageJson]}),n=s._loadedFiles.find(c=>c.fileType===b.DenoJson),a=s._loadedFiles.find(c=>c.fileType===b.PackageJson);if(n===void 0||a===void 0)return{inconsistencies:[],dependencyInconsistencies:[]};let p=["name","version","exports"];for(let c of p){let f=O(n.content,c),i=O(a.content,c);f===void 0||i===void 0||P(f,i)||o.push({packageName:r,field:c,denoValue:f,packageValue:i})}let y=M(r,a.content,n.content);return t.push(...y),{inconsistencies:o,dependencyInconsistencies:t}},K=async(e={})=>{let{root:r=".",failFast:o=!1}=e,[t,s]=await D(r),n=[],a=[],p=0;for(let c of s){let f=F(c.config);try{let i=await G(f,c.name);if(p++,i.inconsistencies.length>0&&n.push(...i.inconsistencies),i.dependencyInconsistencies.length>0&&a.push(...i.dependencyInconsistencies),o&&(i.inconsistencies.length>0||i.dependencyInconsistencies.length>0))return{isConsistent:!1,inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}}catch{continue}}return{isConsistent:!(n.length>0||a.length>0),inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}},v=e=>typeof e=="string"?`"${e}"`:JSON.stringify(e,null,2),H=e=>{switch(e.issue){case"missing_in_deno":return`Missing in deno.json imports. Expected: ${e.expected}`;case"missing_in_package":return`Extra in deno.json imports (not in package.json): ${e.actual}`;case"version_mismatch":return`Version mismatch. Expected: ${e.expected}, Actual: ${e.actual}`}},L=e=>R.fromPromise(()=>K(e)),$=e=>d.ok({root:"."}),N=e=>{if(d.isFail(e))return u.writeln(m("\u2717"),l(" "+String(e.error))),d.fail({exitCode:1});let{value:r}=e;if(u.writeln(g("\u2139"),l(` Checked ${r.packagesChecked} packages.`)),!r.isConsistent){if(r.inconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.inconsistencies.length} field inconsistencies:`));let o=x(r.inconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.field} mismatch:`)),u.writeln(g("\u2139"),l(` deno.json: ${v(n.denoValue)}`)),u.writeln(g("\u2139"),l(` package.json: ${v(n.packageValue)}`))}}if(r.dependencyInconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.dependencyInconsistencies.length} dependency inconsistencies:`));let o=x(r.dependencyInconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.dependencyName}:`)),u.writeln(g("\u2139"),l(` ${H(n)}`))}}return d.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All package configs are consistent.")),d.ok(void 0)},J=C.createTrigger({handler:L,adaptInput:$,adaptOutput:N}),qn=async e=>await J({command:"validate-package-configs",args:[],flags:{}});export{K as a,L as b,J as c,qn as d};
2
+ import{a as b,b as w,d as F,f as D}from"./chunk-A6K5L4SG.js";import{a as C}from"./chunk-LFNUSULJ.js";import{b as h}from"./chunk-4FGLERUG.js";import{f as R}from"./chunk-P2MUEKFT.js";import{b as l,f as m,g as k,h as A,i as g}from"./chunk-YVN2NZL4.js";import{g as d}from"./chunk-FFWPJP7A.js";var x=(e,r)=>{let o={},t=e.length;for(let s=0;s<t;s++){let n=e[s],a=r(n);o[a]===void 0?o[a]=[n]:o[a].push(n)}return o};var u=h(),P=(e,r)=>e===r?!0:typeof e!=typeof r||typeof e!="object"||e===null||r===null?!1:JSON.stringify(e)===JSON.stringify(r),O=(e,r)=>e[r],j=e=>e.startsWith("npm:@jsr/"),B=e=>{let r=e.slice(9),o=r.indexOf("__");if(o===-1)throw new Error(`Invalid npm JSR format: ${e}`);let t=r.slice(0,o),s=r.slice(o+2),n=s.indexOf("@"),a,p;return n===-1?(a=s,p=""):(a=s.slice(0,n),p=s.slice(n)),`jsr:@${t}/${a}${p}`},_=(e,r)=>j(r)?B(r):r.startsWith("npm:")?r:`npm:${e}@${r}`,S=e=>e==="workspace:*"||e.startsWith("workspace:"),M=(e,r,o)=>{let t=[],s=r.dependencies??{},n=r.devDependencies??{},a={...s,...n},p=o.imports??{};for(let[y,c]of Object.entries(a)){if(S(c))continue;let f=_(y,c),i=p[y];i===void 0?t.push({packageName:e,dependencyName:y,issue:"missing_in_deno",expected:f}):i!==f&&t.push({packageName:e,dependencyName:y,issue:"version_mismatch",expected:f,actual:i})}for(let[y,c]of Object.entries(p))a[y]===void 0&&t.push({packageName:e,dependencyName:y,issue:"missing_in_package",actual:p[y]});return t},G=async(e,r)=>{let o=[],t=[],s=await w({baseDir:e,includeFiles:[b.DenoJson,b.PackageJson]}),n=s._loadedFiles.find(c=>c.fileType===b.DenoJson),a=s._loadedFiles.find(c=>c.fileType===b.PackageJson);if(n===void 0||a===void 0)return{inconsistencies:[],dependencyInconsistencies:[]};let p=["name","version","exports"];for(let c of p){let f=O(n.content,c),i=O(a.content,c);f===void 0||i===void 0||P(f,i)||o.push({packageName:r,field:c,denoValue:f,packageValue:i})}let y=M(r,a.content,n.content);return t.push(...y),{inconsistencies:o,dependencyInconsistencies:t}},K=async(e={})=>{let{root:r=".",failFast:o=!1}=e,[t,s]=await D(r),n=[],a=[],p=0;for(let c of s){let f=F(c.config);try{let i=await G(f,c.name);if(p++,i.inconsistencies.length>0&&n.push(...i.inconsistencies),i.dependencyInconsistencies.length>0&&a.push(...i.dependencyInconsistencies),o&&(i.inconsistencies.length>0||i.dependencyInconsistencies.length>0))return{isConsistent:!1,inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}}catch{continue}}return{isConsistent:!(n.length>0||a.length>0),inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}},v=e=>typeof e=="string"?`"${e}"`:JSON.stringify(e,null,2),H=e=>{switch(e.issue){case"missing_in_deno":return`Missing in deno.json imports. Expected: ${e.expected}`;case"missing_in_package":return`Extra in deno.json imports (not in package.json): ${e.actual}`;case"version_mismatch":return`Version mismatch. Expected: ${e.expected}, Actual: ${e.actual}`}},L=e=>R.fromPromise(()=>K(e)),$=e=>d.ok({root:"."}),N=e=>{if(d.isFail(e))return u.writeln(m("\u2717"),l(" "+String(e.error))),d.fail({exitCode:1});let{value:r}=e;if(u.writeln(g("\u2139"),l(` Checked ${r.packagesChecked} packages.`)),!r.isConsistent){if(r.inconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.inconsistencies.length} field inconsistencies:`));let o=x(r.inconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.field} mismatch:`)),u.writeln(g("\u2139"),l(` deno.json: ${v(n.denoValue)}`)),u.writeln(g("\u2139"),l(` package.json: ${v(n.packageValue)}`))}}if(r.dependencyInconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.dependencyInconsistencies.length} dependency inconsistencies:`));let o=x(r.dependencyInconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.dependencyName}:`)),u.writeln(g("\u2139"),l(` ${H(n)}`))}}return d.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All package configs are consistent.")),d.ok(void 0)},J=C.createTrigger({handler:L,adaptInput:$,adaptOutput:N}),qn=async e=>await J({command:"validate-package-configs",args:[],flags:{}});export{K as a,L as b,J as c,qn as d};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as We,c as y}from"./chunk-G6NAG2EK.js";var q=y(P=>{"use strict";var Jt=Symbol.for("yaml.alias"),Oi=Symbol.for("yaml.document"),He=Symbol.for("yaml.map"),Li=Symbol.for("yaml.pair"),Qt=Symbol.for("yaml.scalar"),xe=Symbol.for("yaml.seq"),F=Symbol.for("yaml.node.type"),pa=s=>!!s&&typeof s=="object"&&s[F]===Jt,ma=s=>!!s&&typeof s=="object"&&s[F]===Oi,ya=s=>!!s&&typeof s=="object"&&s[F]===He,ga=s=>!!s&&typeof s=="object"&&s[F]===Li,Ei=s=>!!s&&typeof s=="object"&&s[F]===Qt,ba=s=>!!s&&typeof s=="object"&&s[F]===xe;function Ti(s){if(s&&typeof s=="object")switch(s[F]){case He:case xe:return!0}return!1}function Sa(s){if(s&&typeof s=="object")switch(s[F]){case Jt:case He:case Qt:case xe:return!0}return!1}var wa=s=>(Ei(s)||Ti(s))&&!!s.anchor;P.ALIAS=Jt;P.DOC=Oi;P.MAP=He;P.NODE_TYPE=F;P.PAIR=Li;P.SCALAR=Qt;P.SEQ=xe;P.hasAnchor=wa;P.isAlias=pa;P.isCollection=Ti;P.isDocument=ma;P.isMap=ya;P.isNode=Sa;P.isPair=ga;P.isScalar=Ei;P.isSeq=ba});var ge=y(Gt=>{"use strict";var I=q(),M=Symbol("break visit"),Ci=Symbol("skip children"),K=Symbol("remove node");function Xe(s,e){let t=Ii(e);I.isDocument(s)?ae(null,s.contents,t,Object.freeze([s]))===K&&(s.contents=null):ae(null,s,t,Object.freeze([]))}Xe.BREAK=M;Xe.SKIP=Ci;Xe.REMOVE=K;function ae(s,e,t,i){let n=Pi(s,e,t,i);if(I.isNode(n)||I.isPair(n))return Mi(s,i,n),ae(s,n,t,i);if(typeof n!="symbol"){if(I.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let a=ae(r,e.items[r],t,i);if(typeof a=="number")r=a-1;else{if(a===M)return M;a===K&&(e.items.splice(r,1),r-=1)}}}else if(I.isPair(e)){i=Object.freeze(i.concat(e));let r=ae("key",e.key,t,i);if(r===M)return M;r===K&&(e.key=null);let a=ae("value",e.value,t,i);if(a===M)return M;a===K&&(e.value=null)}}return n}async function ze(s,e){let t=Ii(e);I.isDocument(s)?await oe(null,s.contents,t,Object.freeze([s]))===K&&(s.contents=null):await oe(null,s,t,Object.freeze([]))}ze.BREAK=M;ze.SKIP=Ci;ze.REMOVE=K;async function oe(s,e,t,i){let n=await Pi(s,e,t,i);if(I.isNode(n)||I.isPair(n))return Mi(s,i,n),oe(s,n,t,i);if(typeof n!="symbol"){if(I.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let a=await oe(r,e.items[r],t,i);if(typeof a=="number")r=a-1;else{if(a===M)return M;a===K&&(e.items.splice(r,1),r-=1)}}}else if(I.isPair(e)){i=Object.freeze(i.concat(e));let r=await oe("key",e.key,t,i);if(r===M)return M;r===K&&(e.key=null);let a=await oe("value",e.value,t,i);if(a===M)return M;a===K&&(e.value=null)}}return n}function Ii(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function Pi(s,e,t,i){if(typeof t=="function")return t(s,e,i);if(I.isMap(e))return t.Map?.(s,e,i);if(I.isSeq(e))return t.Seq?.(s,e,i);if(I.isPair(e))return t.Pair?.(s,e,i);if(I.isScalar(e))return t.Scalar?.(s,e,i);if(I.isAlias(e))return t.Alias?.(s,e,i)}function Mi(s,e,t){let i=e[e.length-1];if(I.isCollection(i))i.items[s]=t;else if(I.isPair(i))s==="key"?i.key=t:i.value=t;else if(I.isDocument(i))i.contents=t;else{let n=I.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}Gt.visit=Xe;Gt.visitAsync=ze});var Wt=y($i=>{"use strict";var _i=q(),va=ge(),ka={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Na=s=>s.replace(/[!,[\]{}]/g,e=>ka[e]),be=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[r,a]=i;return this.tags[r]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=i;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let a=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,a),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let r=this.tags[i];if(r)try{return r+decodeURIComponent(n)}catch(a){return t(String(a)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+Na(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&_i.isNode(e.contents)){let r={};va.visit(e.contents,(a,o)=>{_i.isNode(o)&&o.tag&&(r[o.tag]=!0)}),n=Object.keys(r)}else n=[];for(let[r,a]of i)r==="!!"&&a==="tag:yaml.org,2002:"||(!e||n.some(o=>o.startsWith(a)))&&t.push(`%TAG ${r} ${a}`);return t.join(`
2
+ import{a as We,c as y}from"./chunk-5WJ6AUNY.js";var q=y(P=>{"use strict";var Jt=Symbol.for("yaml.alias"),Oi=Symbol.for("yaml.document"),He=Symbol.for("yaml.map"),Li=Symbol.for("yaml.pair"),Qt=Symbol.for("yaml.scalar"),xe=Symbol.for("yaml.seq"),F=Symbol.for("yaml.node.type"),pa=s=>!!s&&typeof s=="object"&&s[F]===Jt,ma=s=>!!s&&typeof s=="object"&&s[F]===Oi,ya=s=>!!s&&typeof s=="object"&&s[F]===He,ga=s=>!!s&&typeof s=="object"&&s[F]===Li,Ei=s=>!!s&&typeof s=="object"&&s[F]===Qt,ba=s=>!!s&&typeof s=="object"&&s[F]===xe;function Ti(s){if(s&&typeof s=="object")switch(s[F]){case He:case xe:return!0}return!1}function Sa(s){if(s&&typeof s=="object")switch(s[F]){case Jt:case He:case Qt:case xe:return!0}return!1}var wa=s=>(Ei(s)||Ti(s))&&!!s.anchor;P.ALIAS=Jt;P.DOC=Oi;P.MAP=He;P.NODE_TYPE=F;P.PAIR=Li;P.SCALAR=Qt;P.SEQ=xe;P.hasAnchor=wa;P.isAlias=pa;P.isCollection=Ti;P.isDocument=ma;P.isMap=ya;P.isNode=Sa;P.isPair=ga;P.isScalar=Ei;P.isSeq=ba});var ge=y(Gt=>{"use strict";var I=q(),M=Symbol("break visit"),Ci=Symbol("skip children"),K=Symbol("remove node");function Xe(s,e){let t=Ii(e);I.isDocument(s)?ae(null,s.contents,t,Object.freeze([s]))===K&&(s.contents=null):ae(null,s,t,Object.freeze([]))}Xe.BREAK=M;Xe.SKIP=Ci;Xe.REMOVE=K;function ae(s,e,t,i){let n=Pi(s,e,t,i);if(I.isNode(n)||I.isPair(n))return Mi(s,i,n),ae(s,n,t,i);if(typeof n!="symbol"){if(I.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let a=ae(r,e.items[r],t,i);if(typeof a=="number")r=a-1;else{if(a===M)return M;a===K&&(e.items.splice(r,1),r-=1)}}}else if(I.isPair(e)){i=Object.freeze(i.concat(e));let r=ae("key",e.key,t,i);if(r===M)return M;r===K&&(e.key=null);let a=ae("value",e.value,t,i);if(a===M)return M;a===K&&(e.value=null)}}return n}async function ze(s,e){let t=Ii(e);I.isDocument(s)?await oe(null,s.contents,t,Object.freeze([s]))===K&&(s.contents=null):await oe(null,s,t,Object.freeze([]))}ze.BREAK=M;ze.SKIP=Ci;ze.REMOVE=K;async function oe(s,e,t,i){let n=await Pi(s,e,t,i);if(I.isNode(n)||I.isPair(n))return Mi(s,i,n),oe(s,n,t,i);if(typeof n!="symbol"){if(I.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let a=await oe(r,e.items[r],t,i);if(typeof a=="number")r=a-1;else{if(a===M)return M;a===K&&(e.items.splice(r,1),r-=1)}}}else if(I.isPair(e)){i=Object.freeze(i.concat(e));let r=await oe("key",e.key,t,i);if(r===M)return M;r===K&&(e.key=null);let a=await oe("value",e.value,t,i);if(a===M)return M;a===K&&(e.value=null)}}return n}function Ii(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function Pi(s,e,t,i){if(typeof t=="function")return t(s,e,i);if(I.isMap(e))return t.Map?.(s,e,i);if(I.isSeq(e))return t.Seq?.(s,e,i);if(I.isPair(e))return t.Pair?.(s,e,i);if(I.isScalar(e))return t.Scalar?.(s,e,i);if(I.isAlias(e))return t.Alias?.(s,e,i)}function Mi(s,e,t){let i=e[e.length-1];if(I.isCollection(i))i.items[s]=t;else if(I.isPair(i))s==="key"?i.key=t:i.value=t;else if(I.isDocument(i))i.contents=t;else{let n=I.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}Gt.visit=Xe;Gt.visitAsync=ze});var Wt=y($i=>{"use strict";var _i=q(),va=ge(),ka={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Na=s=>s.replace(/[!,[\]{}]/g,e=>ka[e]),be=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[r,a]=i;return this.tags[r]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=i;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let a=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,a),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let r=this.tags[i];if(r)try{return r+decodeURIComponent(n)}catch(a){return t(String(a)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+Na(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&_i.isNode(e.contents)){let r={};va.visit(e.contents,(a,o)=>{_i.isNode(o)&&o.tag&&(r[o.tag]=!0)}),n=Object.keys(r)}else n=[];for(let[r,a]of i)r==="!!"&&a==="tag:yaml.org,2002:"||(!e||n.some(o=>o.startsWith(a)))&&t.push(`%TAG ${r} ${a}`);return t.join(`
3
3
  `)}};be.defaultYaml={explicit:!1,version:"1.2"};be.defaultTags={"!!":"tag:yaml.org,2002:"};$i.Directives=be});var Ze=y(Se=>{"use strict";var Di=q(),Aa=ge();function qa(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Bi(s){let e=new Set;return Aa.visit(s,{Value(t,i){i.anchor&&e.add(i.anchor)}}),e}function Ki(s,e){for(let t=1;;++t){let i=`${s}${t}`;if(!e.has(i))return i}}function Oa(s,e){let t=[],i=new Map,n=null;return{onAnchor:r=>{t.push(r),n??(n=Bi(s));let a=Ki(e,n);return n.add(a),a},setAnchors:()=>{for(let r of t){let a=i.get(r);if(typeof a=="object"&&a.anchor&&(Di.isScalar(a.node)||Di.isCollection(a.node)))a.node.anchor=a.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=r,o}}},sourceObjects:i}}Se.anchorIsValid=qa;Se.anchorNames=Bi;Se.createNodeAnchors=Oa;Se.findNewAnchor=Ki});var Ht=y(ji=>{"use strict";function we(s,e,t,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let a=i[n],o=we(s,i,String(n),a);o===void 0?delete i[n]:o!==a&&(i[n]=o)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=we(s,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=we(s,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=we(s,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}return s.call(e,t,i)}ji.applyReviver=we});var Y=y(Ri=>{"use strict";var La=q();function Fi(s,e,t){if(Array.isArray(s))return s.map((i,n)=>Fi(i,String(n),t));if(s&&typeof s.toJSON=="function"){if(!t||!La.hasAnchor(s))return s.toJSON(e,t);let i={aliasCount:0,count:1,res:void 0};t.anchors.set(s,i),t.onCreate=r=>{i.res=r,delete t.onCreate};let n=s.toJSON(e,t);return t.onCreate&&t.onCreate(n),n}return typeof s=="bigint"&&!t?.keep?Number(s):s}Ri.toJS=Fi});var et=y(Yi=>{"use strict";var Ea=Ht(),Ui=q(),Ta=Y(),xt=class{constructor(e){Object.defineProperty(this,Ui.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:i,onAnchor:n,reviver:r}={}){if(!Ui.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},o=Ta.toJS(this,"",a);if(typeof n=="function")for(let{count:l,res:c}of a.anchors.values())n(c,l);return typeof r=="function"?Ea.applyReviver(r,{"":o},"",o):o}};Yi.NodeBase=xt});var ve=y(Vi=>{"use strict";var Ca=Ze(),Ia=ge(),le=q(),Pa=et(),Ma=Y(),Xt=class extends Pa.NodeBase{constructor(e){super(le.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],Ia.visit(e,{Node:(r,a)=>{(le.isAlias(a)||le.hasAnchor(a))&&i.push(a)}}),t&&(t.aliasResolveCache=i));let n;for(let r of i){if(r===this)break;r.anchor===this.source&&(n=r)}return n}toJSON(e,t){if(!t)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:r}=t,a=this.resolve(n,t);if(!a){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=i.get(a);if(o||(Ma.toJS(a,null,t),o=i.get(a)),o?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=tt(n,a,i)),o.count*o.aliasCount>r)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(e,t,i){let n=`*${this.source}`;if(e){if(Ca.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${n} `}return n}};function tt(s,e,t){if(le.isAlias(e)){let i=e.resolve(s),n=t&&i&&t.get(i);return n?n.count*n.aliasCount:0}else if(le.isCollection(e)){let i=0;for(let n of e.items){let r=tt(s,n,t);r>i&&(i=r)}return i}else if(le.isPair(e)){let i=tt(s,e.key,t),n=tt(s,e.value,t);return Math.max(i,n)}return 1}Vi.Alias=Xt});var E=y(zt=>{"use strict";var _a=q(),$a=et(),Da=Y(),Ba=s=>!s||typeof s!="function"&&typeof s!="object",V=class extends $a.NodeBase{constructor(e){super(_a.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:Da.toJS(this.value,e,t)}toString(){return String(this.value)}};V.BLOCK_FOLDED="BLOCK_FOLDED";V.BLOCK_LITERAL="BLOCK_LITERAL";V.PLAIN="PLAIN";V.QUOTE_DOUBLE="QUOTE_DOUBLE";V.QUOTE_SINGLE="QUOTE_SINGLE";zt.Scalar=V;zt.isScalarValue=Ba});var ke=y(Qi=>{"use strict";var Ka=ve(),Z=q(),Ji=E(),ja="tag:yaml.org,2002:";function Fa(s,e,t){if(e){let i=t.filter(r=>r.tag===e),n=i.find(r=>!r.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return t.find(i=>i.identify?.(s)&&!i.format)}function Ra(s,e,t){if(Z.isDocument(s)&&(s=s.contents),Z.isNode(s))return s;if(Z.isPair(s)){let f=t.schema[Z.MAP].createNode?.(t.schema,null,t);return f.items.push(s),f}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:r,schema:a,sourceObjects:o}=t,l;if(i&&s&&typeof s=="object"){if(l=o.get(s),l)return l.anchor??(l.anchor=n(s)),new Ka.Alias(l.anchor);l={anchor:null,node:null},o.set(s,l)}e?.startsWith("!!")&&(e=ja+e.slice(2));let c=Fa(s,e,a.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let f=new Ji.Scalar(s);return l&&(l.node=f),f}c=s instanceof Map?a[Z.MAP]:Symbol.iterator in Object(s)?a[Z.SEQ]:a[Z.MAP]}r&&(r(c),delete t.onTagObj);let d=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new Ji.Scalar(s);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}Qi.createNode=Ra});var it=y(st=>{"use strict";var Ua=ke(),j=q(),Ya=et();function Zt(s,e,t){let i=t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let a=[];a[r]=i,i=a}else i=new Map([[r,i]])}return Ua.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Gi=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,es=class extends Ya.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(i=>j.isNode(i)||j.isPair(i)?i.clone(e):i),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Gi(e))this.add(t);else{let[i,...n]=e,r=this.get(i,!0);if(j.isCollection(r))r.addIn(n,t);else if(r===void 0&&this.schema)this.set(i,Zt(this.schema,n,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[t,...i]=e;if(i.length===0)return this.delete(t);let n=this.get(t,!0);if(j.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${i}`)}getIn(e,t){let[i,...n]=e,r=this.get(i,!0);return n.length===0?!t&&j.isScalar(r)?r.value:r:j.isCollection(r)?r.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!j.isPair(t))return!1;let i=t.value;return i==null||e&&j.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[t,...i]=e;if(i.length===0)return this.has(t);let n=this.get(t,!0);return j.isCollection(n)?n.hasIn(i):!1}setIn(e,t){let[i,...n]=e;if(n.length===0)this.set(i,t);else{let r=this.get(i,!0);if(j.isCollection(r))r.setIn(n,t);else if(r===void 0&&this.schema)this.set(i,Zt(this.schema,n,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};st.Collection=es;st.collectionFromPath=Zt;st.isEmptyPath=Gi});var Ne=y(nt=>{"use strict";var Va=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function ts(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var Ja=(s,e,t)=>s.endsWith(`
4
4
  `)?ts(t,e):t.includes(`
5
5
  `)?`
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{t as l}from"./chunk-MRCBHVSB.js";var F=s=>{if(s===void 0)return"json";for(let n of s)if(n==="-o"||n.startsWith("--output")){let t=s.indexOf(n);if(n.includes("="))return x(n.split("=")[1]??"json");let i=s[t+1];if(i!==void 0&&!i.startsWith("-"))return x(i)}return"json"},O=s=>{if(s===void 0)return[];let n=[],t=!1;for(let i=0;i<s.length;i++){if(t){t=!1;continue}let o=s[i];if(!o.startsWith("--output=")){if(o==="-o"||o==="--output"){t=!0;continue}n.push(o)}}return n},x=s=>{let n=s.toLowerCase();return n==="md"||n==="markdown"?"markdown":n==="text"||n==="txt"||n==="plain"?"text":"json"},e=(s,n)=>s[n],$=s=>JSON.stringify(s,null,2),w=s=>{let n=s,t=[],i=e(n,"phase");i!==void 0&&(t.push(`# noskills \u2014 ${i}`),t.push(""));let o=e(n,"instruction");o!==void 0&&(t.push("## Instruction"),t.push(""),t.push(o),t.push(""));let a=e(n,"questions");if(a!==void 0&&a.length>0)for(let r of a){if(t.push(`## Question: ${r.id}`),t.push(""),t.push(`> ${r.text}`),r.extras!==void 0&&r.extras.length>0){t.push(""),t.push("Also consider:");for(let m of r.extras)t.push(`- ${m}`)}t.push("")}let h=e(n,"statusReport");if(h!==void 0){t.push("## Acceptance Criteria"),t.push("");for(let r of h.criteria)t.push(`- [ ] ${r}`);t.push("")}let p=e(n,"previousIterationDebt");if(p!==void 0){t.push(`## Debt (from iteration ${p.fromIteration})`),t.push(""),t.push(`> ${p.note}`),t.push("");for(let r of p.items)t.push(`- ${r}`);t.push("")}e(n,"verificationFailed")===!0&&(t.push("## Verification FAILED"),t.push(""),t.push("```"),t.push(String(e(n,"verificationOutput")??"")),t.push("```"),t.push(""));let c=e(n,"behavioral");if(c!==void 0){t.push("## Behavioral"),t.push(""),t.push(`**Tone:** ${c.tone}`),t.push("");for(let r of c.rules)t.push(`- ${r}`);c.urgency!==void 0&&(t.push(""),t.push(`**Urgency:** ${c.urgency}`)),t.push("")}let f=e(n,"meta");f!==void 0&&(t.push("---"),t.push(""),t.push(`*${f.resumeHint}*`),t.push(""));let d=e(n,"transition");if(d!==void 0){t.push("## Next Steps"),t.push("");for(let[r,m]of Object.entries(d))r!=="iteration"&&t.push(`- **${r}:** \`${m}\``);t.push("")}let u=e(n,"summary");u!==void 0&&(t.push("## Summary"),t.push(""),t.push(`- Spec: ${u.spec}`),t.push(`- Iterations: ${u.iterations}`),t.push(`- Decisions: ${u.decisionsCount}`),t.push(""));let g=e(n,"clearContext");return g!==void 0&&(t.push("---"),t.push(""),t.push(`**Action required:** ${g.reason}`),t.push("")),t.join(`
2
+ import{i as l}from"./chunk-WJKE6XHF.js";var F=s=>{if(s===void 0)return"json";for(let n of s)if(n==="-o"||n.startsWith("--output")){let t=s.indexOf(n);if(n.includes("="))return x(n.split("=")[1]??"json");let i=s[t+1];if(i!==void 0&&!i.startsWith("-"))return x(i)}return"json"},O=s=>{if(s===void 0)return[];let n=[],t=!1;for(let i=0;i<s.length;i++){if(t){t=!1;continue}let o=s[i];if(!o.startsWith("--output=")){if(o==="-o"||o==="--output"){t=!0;continue}n.push(o)}}return n},x=s=>{let n=s.toLowerCase();return n==="md"||n==="markdown"?"markdown":n==="text"||n==="txt"||n==="plain"?"text":"json"},e=(s,n)=>s[n],$=s=>JSON.stringify(s,null,2),w=s=>{let n=s,t=[],i=e(n,"phase");i!==void 0&&(t.push(`# noskills \u2014 ${i}`),t.push(""));let o=e(n,"instruction");o!==void 0&&(t.push("## Instruction"),t.push(""),t.push(o),t.push(""));let a=e(n,"questions");if(a!==void 0&&a.length>0)for(let r of a){if(t.push(`## Question: ${r.id}`),t.push(""),t.push(`> ${r.text}`),r.extras!==void 0&&r.extras.length>0){t.push(""),t.push("Also consider:");for(let m of r.extras)t.push(`- ${m}`)}t.push("")}let h=e(n,"statusReport");if(h!==void 0){t.push("## Acceptance Criteria"),t.push("");for(let r of h.criteria)t.push(`- [ ] ${r}`);t.push("")}let p=e(n,"previousIterationDebt");if(p!==void 0){t.push(`## Debt (from iteration ${p.fromIteration})`),t.push(""),t.push(`> ${p.note}`),t.push("");for(let r of p.items)t.push(`- ${r}`);t.push("")}e(n,"verificationFailed")===!0&&(t.push("## Verification FAILED"),t.push(""),t.push("```"),t.push(String(e(n,"verificationOutput")??"")),t.push("```"),t.push(""));let c=e(n,"behavioral");if(c!==void 0){t.push("## Behavioral"),t.push(""),t.push(`**Tone:** ${c.tone}`),t.push("");for(let r of c.rules)t.push(`- ${r}`);c.urgency!==void 0&&(t.push(""),t.push(`**Urgency:** ${c.urgency}`)),t.push("")}let f=e(n,"meta");f!==void 0&&(t.push("---"),t.push(""),t.push(`*${f.resumeHint}*`),t.push(""));let d=e(n,"transition");if(d!==void 0){t.push("## Next Steps"),t.push("");for(let[r,m]of Object.entries(d))r!=="iteration"&&t.push(`- **${r}:** \`${m}\``);t.push("")}let u=e(n,"summary");u!==void 0&&(t.push("## Summary"),t.push(""),t.push(`- Spec: ${u.spec}`),t.push(`- Iterations: ${u.iterations}`),t.push(`- Decisions: ${u.decisionsCount}`),t.push(""));let g=e(n,"clearContext");return g!==void 0&&(t.push("---"),t.push(""),t.push(`**Action required:** ${g.reason}`),t.push("")),t.join(`
3
3
  `)},k=s=>{let n=s,t=[],i=e(n,"phase");i!==void 0&&t.push(`[${i}]`);let o=e(n,"instruction");o!==void 0&&t.push(o);let a=e(n,"questions");if(a!==void 0&&a.length>0){for(let u of a)if(t.push(""),t.push(`Question [${u.id}]: ${u.text}`),u.extras!==void 0)for(let g of u.extras)t.push(` - ${g}`)}let h=e(n,"statusReport");if(h!==void 0){t.push(""),t.push("Criteria:");for(let u of h.criteria)t.push(` - ${u}`)}let p=e(n,"previousIterationDebt");if(p!==void 0){t.push(""),t.push(p.note);for(let u of p.items)t.push(` - ${u}`)}e(n,"verificationFailed")===!0&&(t.push(""),t.push(`Verification failed: ${String(e(n,"verificationOutput")??"").slice(0,200)}`));let c=e(n,"meta");c!==void 0&&(t.push(""),t.push(c.resumeHint));let f=e(n,"summary");f!==void 0&&t.push(`Spec: ${f.spec}, Iterations: ${f.iterations}, Decisions: ${f.decisionsCount}`);let d=e(n,"clearContext");return d!==void 0&&(t.push(""),t.push(d.reason)),t.join(`
4
4
  `)},b=(s,n)=>{switch(n){case"markdown":return w(s);case"text":return k(s);default:return $(s)}},v=async(s,n)=>{let t=b(s,n),i=new TextEncoder,o=l.process.stdout.getWriter();await o.write(i.encode(t+`
5
5
  `)),o.releaseLock()};export{F as a,O as b,b as c,v as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as c}from"./chunk-NBA6EFWU.js";import{t as u}from"./chunk-MRCBHVSB.js";var n=e=>{let a=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${a}$`)};async function*f(e,a,s){let o=u.fs.walk(e,{includeDirs:!1,includeFiles:!0,exts:c,skip:[s]});for await(let r of o){let t=u.path.relative(e,r.path);a!==void 0&&!n(a).test(t)||(yield t)}}var F=new RegExp("[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]"),A=new RegExp("[\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65]");export{f as a};
2
+ import{b as c}from"./chunk-NBA6EFWU.js";import{i as u}from"./chunk-WJKE6XHF.js";var n=e=>{let a=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${a}$`)};async function*f(e,a,s){let o=u.fs.walk(e,{includeDirs:!1,includeFiles:!0,exts:c,skip:[s]});for await(let r of o){let t=u.path.relative(e,r.path);a!==void 0&&!n(a).test(t)||(yield t)}}var F=new RegExp("[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]"),A=new RegExp("[\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65]");export{f as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as $}from"./chunk-CUIMSX4V.js";import{e as x}from"./chunk-LCG4SK6K.js";import{t as c}from"./chunk-MRCBHVSB.js";import{Scanner as ie}from"@tailwindcss/oxide";import{compile as j}from"tailwindcss";async function L(e,s){if(e.startsWith(".")||e.startsWith("/")){let r=c.path.resolve(s,e),n=await c.fs.readTextFile(r);return{path:r,content:n,base:c.path.dirname(r)}}let t=s;for(;t!=="/"&&t!=="";){let r=c.path.resolve(t,"node_modules",e);try{let n=await c.fs.readTextFile(r);return{path:r,content:n,base:c.path.dirname(r)}}catch{if(!e.endsWith(".css")){let a=`${r}.css`;try{let o=await c.fs.readTextFile(a);return{path:a,content:o,base:c.path.dirname(a)}}catch{}}let n=c.path.resolve(t,"node_modules",e,"index.css");try{let a=await c.fs.readTextFile(n);return{path:n,content:a,base:c.path.dirname(n)}}catch{t=c.path.dirname(t)}}}let l=c.path.resolve(s,e),i=await c.fs.readTextFile(l);return{path:l,content:i,base:c.path.dirname(l)}}async function w(e,s){let t=await j(e,{base:s.base,loadStylesheet:L}),l=s.candidates??[];return t.build(l)}function v(e,s){return w(e,{base:s,candidates:[]})}var R=["theme","base","properties"],P=[/^\.(flex|grid|block|inline|hidden)/,/^\.(items-|justify-|gap-|space-)/,/^\.(w-|h-|min-h-|max-w-)/,/^\.(p-|px-|py-|pt-|pb-|pl-|pr-)/,/^\.(m-|mx-|my-|mt-|mb-|ml-|mr-)/,/^\.(text-|font-|leading-)/,/^\.(bg-|border-)/,/^\.(from-|via-|to-)/,/^\.(container|wrapper)/,/^\.(rounded|shadow)/,/^\.(overflow-)/,/^\.(sm:|md:|lg:|xl:)/],B=[/--tw-gradient/,/--tw-rotate/,/--tw-scale/,/--tw-skew/,/--tw-translate/,/--tw-shadow/,/--tw-ring/,/--tw-blur/,/--tw-brightness/];function N(){return{criticalLayers:R,aboveFoldPatterns:P,forceInclude:[],forceExclude:[]}}var b=x.getLogger(["laroux-bundler","critical-page-css"]);function W(e,s){let t=s;for(;t<e.length&&e[t]!=="{";)t++;if(t>=e.length)return null;let l=t+1,i=1;for(t++;t<e.length&&i>0;)e[t]==="{"?i++:e[t]==="}"&&i--,t++;return{innerContent:e.slice(l,t-1).trim(),end:t}}function V(e){let s=[],t="@keyframes",l=0;for(;l<e.length;){let i=e.indexOf(t,l);if(i===-1)break;let r=i+t.length;for(;r<e.length&&/\s/.test(e[r]??"");)r++;let n=r;for(;n<e.length&&e[n]!=="{"&&!/\s/.test(e[n]??"");)n++;let a=e.slice(r,n),o=n;for(;o<e.length&&e[o]!=="{";)o++;if(o>=e.length){l=e.length;break}let g=1,u=o+1;for(;u<e.length&&g>0;)e[u]==="{"?g++:e[u]==="}"&&g--,u++;let d=e.slice(i,u);s.push({name:a,block:d}),l=u}return s}function Z(e){let s=new Map,t=new Map,l=new Map,i=/@layer\s+([a-zA-Z_-][a-zA-Z0-9_-]*)\s*[{;]/g,r;for(;(r=i.exec(e))!==null;){let n=r[1];if(n===void 0||r[0].endsWith(";"))continue;let a=W(e,r.index+r[0].length-1);a&&(t.has(n)||(t.set(n,[]),l.set(n,{start:r.index,end:a.end})),t.get(n).push(a.innerContent),l.get(n).end=a.end)}for(let[n,a]of t){let o=a.join(`
2
+ import{a as $}from"./chunk-3IZX4OZ7.js";import{e as x}from"./chunk-5DWJ7WEE.js";import{i as c}from"./chunk-WJKE6XHF.js";import{Scanner as ie}from"@tailwindcss/oxide";import{compile as j}from"tailwindcss";async function L(e,s){if(e.startsWith(".")||e.startsWith("/")){let r=c.path.resolve(s,e),n=await c.fs.readTextFile(r);return{path:r,content:n,base:c.path.dirname(r)}}let t=s;for(;t!=="/"&&t!=="";){let r=c.path.resolve(t,"node_modules",e);try{let n=await c.fs.readTextFile(r);return{path:r,content:n,base:c.path.dirname(r)}}catch{if(!e.endsWith(".css")){let a=`${r}.css`;try{let o=await c.fs.readTextFile(a);return{path:a,content:o,base:c.path.dirname(a)}}catch{}}let n=c.path.resolve(t,"node_modules",e,"index.css");try{let a=await c.fs.readTextFile(n);return{path:n,content:a,base:c.path.dirname(n)}}catch{t=c.path.dirname(t)}}}let l=c.path.resolve(s,e),i=await c.fs.readTextFile(l);return{path:l,content:i,base:c.path.dirname(l)}}async function w(e,s){let t=await j(e,{base:s.base,loadStylesheet:L}),l=s.candidates??[];return t.build(l)}function v(e,s){return w(e,{base:s,candidates:[]})}var R=["theme","base","properties"],P=[/^\.(flex|grid|block|inline|hidden)/,/^\.(items-|justify-|gap-|space-)/,/^\.(w-|h-|min-h-|max-w-)/,/^\.(p-|px-|py-|pt-|pb-|pl-|pr-)/,/^\.(m-|mx-|my-|mt-|mb-|ml-|mr-)/,/^\.(text-|font-|leading-)/,/^\.(bg-|border-)/,/^\.(from-|via-|to-)/,/^\.(container|wrapper)/,/^\.(rounded|shadow)/,/^\.(overflow-)/,/^\.(sm:|md:|lg:|xl:)/],B=[/--tw-gradient/,/--tw-rotate/,/--tw-scale/,/--tw-skew/,/--tw-translate/,/--tw-shadow/,/--tw-ring/,/--tw-blur/,/--tw-brightness/];function N(){return{criticalLayers:R,aboveFoldPatterns:P,forceInclude:[],forceExclude:[]}}var b=x.getLogger(["laroux-bundler","critical-page-css"]);function W(e,s){let t=s;for(;t<e.length&&e[t]!=="{";)t++;if(t>=e.length)return null;let l=t+1,i=1;for(t++;t<e.length&&i>0;)e[t]==="{"?i++:e[t]==="}"&&i--,t++;return{innerContent:e.slice(l,t-1).trim(),end:t}}function V(e){let s=[],t="@keyframes",l=0;for(;l<e.length;){let i=e.indexOf(t,l);if(i===-1)break;let r=i+t.length;for(;r<e.length&&/\s/.test(e[r]??"");)r++;let n=r;for(;n<e.length&&e[n]!=="{"&&!/\s/.test(e[n]??"");)n++;let a=e.slice(r,n),o=n;for(;o<e.length&&e[o]!=="{";)o++;if(o>=e.length){l=e.length;break}let g=1,u=o+1;for(;u<e.length&&g>0;)e[u]==="{"?g++:e[u]==="}"&&g--,u++;let d=e.slice(i,u);s.push({name:a,block:d}),l=u}return s}function Z(e){let s=new Map,t=new Map,l=new Map,i=/@layer\s+([a-zA-Z_-][a-zA-Z0-9_-]*)\s*[{;]/g,r;for(;(r=i.exec(e))!==null;){let n=r[1];if(n===void 0||r[0].endsWith(";"))continue;let a=W(e,r.index+r[0].length-1);a&&(t.has(n)||(t.set(n,[]),l.set(n,{start:r.index,end:a.end})),t.get(n).push(a.innerContent),l.get(n).end=a.end)}for(let[n,a]of t){let o=a.join(`
3
3
  `),g=l.get(n);s.set(n,{block:`@layer ${n} {
4
4
  ${o}
5
5
  }`,start:g.start,end:g.end})}return s}function Y(e){let s=[],t=0;for(;t<e.length;){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)break;let l=t;for(;t<e.length&&e[t]!=="{";)t++;if(t>=e.length)break;let i=e.slice(l,t).trim();if(!i){t++;continue}let r=1;for(t++;t<e.length&&r>0;)e[t]==="{"?r++:e[t]==="}"&&r--,t++;let n=e.slice(l,t);i.startsWith("@media")||i.startsWith("@supports")?s.push({selector:"@media",full:n}):i&&!i.startsWith("@")&&s.push({selector:i,full:n})}return s}function H(e,s){let t=e.match(/\.([a-zA-Z_-][a-zA-Z0-9_\-\\:/.[\]]*)/g);if(t)for(let r of t){let n=r.substring(1);if(n=n.replace(/\\/g,""),n=n.split(":")[0]??"",n&&new RegExp(`class=["'][^"']*\\b${q(n)}\\b`,"i").test(s))return!0}let l=e.match(/^([a-zA-Z][a-zA-Z0-9-]*)/);if(l&&l[1]){let r=l[1].toLowerCase();if(new RegExp(`<${r}[\\s>]`,"i").test(s))return!0}let i=e.match(/#([a-zA-Z_-][a-zA-Z0-9_-]*)/g);if(i)for(let r of i){let n=r.substring(1);if(new RegExp(`id=["']${n}["']`,"i").test(s))return!0}return!1}function q(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function z(e,s){return s.some(t=>typeof t=="string"?e.includes(t):t.test(e))}function K(e){return P.some(s=>s.test(e))}function k(e){let{html:s,css:t,forceInclude:l=[],forceExclude:i=[]}=e;b.debug("Extracting critical page CSS (Tailwind v4 aware)...");let r=[],n=[],a=0,o=0,g=t.match(/^\/\*![\s\S]*?\*\//);g&&r.push(g[0]);let u=t.match(/@layer\s+[\w,-]{1,200}(?:\s+[\w,-]{1,50})*\s*;/);u&&r.push(u[0]);let d=/@property\s+--[\w-]+\s*\{[^}]{0,5000}\}/g,f=t.match(d)??[];f.length>0&&(r.push(f.join(`
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as o}from"./chunk-RGUETQSC.js";import{a as l}from"./chunk-JYNHFD6B.js";import{e as n}from"./chunk-G6NAG2EK.js";var i=n(l(),1);var a=o({name:"validate-yaml",description:"Validate YAML syntax",canFix:!1,stacks:[],defaults:{},extensions:["yml","yaml"],checkFile(e,r){if(r===void 0)return[];try{return i.parse(r),[]}catch(t){let s=t instanceof Error?t.message:"invalid YAML";return[{path:e.path,message:s}]}}}),d=a.run,u=a.validator,f=a.main;export{a,d as b,u as c,f as d};
2
+ import{a as o}from"./chunk-ULNEO3RY.js";import{a as l}from"./chunk-2XNFZXHY.js";import{e as n}from"./chunk-5WJ6AUNY.js";var i=n(l(),1);var a=o({name:"validate-yaml",description:"Validate YAML syntax",canFix:!1,stacks:[],defaults:{},extensions:["yml","yaml"],checkFile(e,r){if(r===void 0)return[];try{return i.parse(r),[]}catch(t){let s=t instanceof Error?t.message:"invalid YAML";return[{path:e.path,message:s}]}}}),d=a.run,u=a.validator,f=a.main;export{a,d as b,u as c,f as d};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{b as a}from"./chunk-H2O5G3XB.js";import{f as i,h as o,k as n}from"./chunk-ZC4F4MYU.js";import{i as r}from"./chunk-WJKE6XHF.js";var C=()=>{let t=r.process.isTerminal("stdout")?"interactive":"non-interactive",e=a({interaction:t});return{ctx:e,output:e.output}},d=()=>i({renderer:n.ansi(),sink:o.stdout()}),x=(s,t)=>({command:s,args:t._??[],flags:Object.fromEntries(Object.entries(t).filter(([e])=>e!=="_"))});export{C as a,d as b,x as c};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{t as c}from"./chunk-MRCBHVSB.js";var f=async(n,r)=>{let e=`${n}/.eser/specs/${r}/spec.md`,t;try{t=await c.fs.readTextFile(e)}catch{return null}return d(r,t)},d=(n,r)=>{let e=[],t=[],o=[],i="";for(let l of r.split(`
2
+ import{i as c}from"./chunk-WJKE6XHF.js";var f=async(n,r)=>{let e=`${n}/.eser/specs/${r}/spec.md`,t;try{t=await c.fs.readTextFile(e)}catch{return null}return d(r,t)},d=(n,r)=>{let e=[],t=[],o=[],i="";for(let l of r.split(`
3
3
  `)){let s=l.trim();if(s.startsWith("## ")){i=s.slice(3).trim().toLowerCase();continue}if(i.startsWith("tasks")){let a=s.match(/^-\s*\[[ x]\]\s*(task-\d+):\s*(.+)$/i);a!==null&&e.push({id:a[1],title:a[2].trim()})}i.startsWith("out of scope")&&s.startsWith("- ")&&t.push(s.slice(2).trim()),i.startsWith("verification")&&s.startsWith("- ")&&o.push(s.slice(2).trim())}return{name:n,tasks:e,outOfScope:t,verification:o}},u=(n,r)=>{let e=new Set(r);for(let t of n)if(!e.has(t.id))return t;return null};export{f as a,d as b,u as c};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as e}from"./chunk-KVTG56GS.js";var i=new e({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-L3N6REQI.js")},list:{description:"List available AI providers",load:()=>import("./list-5TGTYMAU.js")}}});export{i as a};
2
+ import{a as e}from"./chunk-QFFGKP3M.js";var i=new e({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-PMB64QWG.js")},list:{description:"List available AI providers",load:()=>import("./list-UQMPOF5Y.js")}}});export{i as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as u,b as Z}from"./chunk-7DPLGQHN.js";import{b as P,c as G,d as B,f as _,g as _e,h as Re,j as Fe,k as Q,l as ke}from"./chunk-3SXTMY75.js";import{d as h}from"./chunk-G6NAG2EK.js";var Ne={};h(Ne,{createLogRecord:()=>ee,isCategory:()=>Ee,isLogRecord:()=>At});var Ee=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"),At=e=>{if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.message=="string"&&t.datetime instanceof Date&&typeof t.severity=="number"&&Ee(t.category)&&typeof t.properties=="object"&&typeof t.context=="object"},ee=e=>({rawMessage:e.rawMessage??e.message,args:e.args??[],datetime:e.datetime??new Date,properties:e.properties??{},context:e.context??{},...e});var Oe={};h(Oe,{categoriesEqual:()=>_t,categoryKey:()=>C,categoryToString:()=>T,extendCategory:()=>R,findMatchingConfigs:()=>te,getCommonAncestor:()=>Ft,getParentCategory:()=>Rt,isAncestor:()=>Pt,isDescendant:()=>Ie,isDescendantOrSelf:()=>j,matchesPattern:()=>V,normalizeCategory:()=>f});var f=e=>typeof e=="string"?e.split(".").filter(Boolean):e,T=(e,t=".")=>e.join(t),C=e=>e.join("\0"),Ie=(e,t)=>e.length<=t.length?!1:t.every((r,n)=>e[n]===r),j=(e,t)=>e.length<t.length?!1:t.every((r,n)=>e[n]===r),Pt=(e,t)=>Ie(t,e),_t=(e,t)=>e.length!==t.length?!1:e.every((r,n)=>r===t[n]),te=(e,t)=>{let r=[];for(let n of t.values()){let i=f(n.category);j(e,i)&&r.push(n)}return r.sort((n,i)=>{let o=f(n.category).length;return f(i.category).length-o}),r},Rt=e=>e.length<=1?null:e.slice(0,-1),R=(e,t)=>{let r=typeof t=="string"?[t]:t;return[...e,...r]},Ft=(e,t)=>{let r=[],n=Math.min(e.length,t.length);for(let i=0;i<n&&e[i]===t[i];i++)r.push(e[i]);return r},V=(e,t)=>{let r=0,n=0;for(;n<t.length&&r<e.length;){let i=t[n];if(i==="**"){if(n===t.length-1)return!0;for(let o=r;o<=e.length;o++)if(V(e.slice(o),t.slice(n+1)))return!0;return!1}if(i==="*"||i===e[r])r++,n++;else return!1}for(;n<t.length&&t[n]==="**";)n++;return r===e.length&&n===t.length};var Ke={};h(Ke,{configure:()=>Dt,configureSync:()=>Gt,getEffectiveConfig:()=>ge,getFilterNames:()=>Xt,getLoggerCategories:()=>Ut,getRegistryState:()=>Ot,getSinkNames:()=>Kt,isConfigured:()=>Mt,registerFilter:()=>Vt,registerLogger:()=>$t,registerLoggerCacheClear:()=>se,registerSink:()=>Bt,reset:()=>ze,resetSync:()=>$e,unregisterFilter:()=>zt,unregisterSink:()=>jt});var je={};h(je,{applyPrefixToCategory:()=>ie,clearDefaultStorages:()=>X,createCategoryPrefixScope:()=>It,createContextScope:()=>Nt,getCategoryPrefix:()=>Be,getCategoryPrefixStorage:()=>ne,getContext:()=>oe,getContextStorage:()=>re,setCategoryPrefixStorage:()=>K,setContextStorage:()=>F,withCategoryPrefix:()=>Ge,withContext:()=>E});var z,$,kt=()=>{if(z===void 0)try{let e=globalThis.AsyncLocalStorage??globalThis.require?.("async_hooks")?.AsyncLocalStorage;e&&(z=new e)}catch{}return z},Et=()=>{if($===void 0)try{let e=globalThis.AsyncLocalStorage??globalThis.require?.("async_hooks")?.AsyncLocalStorage;e&&($=new e)}catch{}return $},Me,De,F=e=>{Me=e},K=e=>{De=e},X=()=>{z=void 0,$=void 0},re=()=>Me??kt(),ne=()=>De??Et(),E=(e,t)=>{let r=re();if(!r)return t();let i={...r.getStore()??{},...e};return r.run(i,t)},oe=()=>{let e=re();return e?e.getStore()??{}:{}},Ge=(e,t)=>{let r=ne(),n=f(e);if(!r)return t();let i=r.getStore()??[],o=R(i,n);return r.run(o,t)},Be=()=>{let e=ne();return e?e.getStore()??[]:[]},ie=e=>{let t=Be();return t.length===0?e:R(t,e)},Nt=e=>t=>E(e,t),It=e=>t=>Ge(e,t);var ae=null,se=e=>{ae=e},l=null,d=new Map,Ot=()=>l,Mt=()=>l!==null,Dt=async e=>{(e.reset||l===null)&&await ze(),l={sinks:new Map(Object.entries(e.sinks)),filters:new Map(Object.entries(e.filters??{})),loggers:new Map,contextLocalStorage:e.contextLocalStorage};for(let t of e.loggers){let r=f(t.category),n=C(r);l.loggers.set(n,{...t,category:r})}e.contextLocalStorage&&F(e.contextLocalStorage),d.clear()},Gt=e=>{(e.reset||l===null)&&$e(),l={sinks:new Map(Object.entries(e.sinks)),filters:new Map(Object.entries(e.filters??{})),loggers:new Map,contextLocalStorage:e.contextLocalStorage};for(let t of e.loggers){let r=f(t.category),n=C(r);l.loggers.set(n,{...t,category:r})}e.contextLocalStorage&&F(e.contextLocalStorage),d.clear()},ze=async()=>{if(l)for(let e of l.sinks.values()){let t=e;typeof t.dispose=="function"?await t.dispose():typeof t[Symbol.asyncDispose]=="function"&&await t[Symbol.asyncDispose]()}l=null,d.clear(),ae?.(),F(void 0),K(void 0),X()},$e=()=>{if(l)for(let e of l.sinks.values()){let t=e;typeof t.disposeSync=="function"?t.disposeSync():typeof t[Symbol.dispose]=="function"&&t[Symbol.dispose]()}l=null,d.clear(),ae?.(),F(void 0),K(void 0),X()},ge=e=>{let t=C(e),r=d.get(t);if(r)return r;let n={sinks:[],filters:[],lowestLevel:u.Info};if(!l)return n;let i=te(e,l.loggers),o=new Set,a=new Set,s=!1;for(let g of i){if(g.sinks&&g.sinks.length>0){g.parentSinks==="override"&&o.clear();for(let c of g.sinks)o.add(c)}if(g.filters)for(let c of g.filters)a.add(c);!s&&g.lowestLevel!==void 0&&(n.lowestLevel=g.lowestLevel,s=!0)}for(let g of o){let c=l.sinks.get(g);c&&n.sinks.push(c)}for(let g of a){let c=l.filters.get(g);c&&n.filters.push(c)}return d.set(t,n),n},Bt=(e,t)=>{if(!l)throw new Error("Logging not configured. Call configure() first.");l.sinks.set(e,t),d.clear()},jt=e=>{l&&(l.sinks.delete(e),d.clear())},Vt=(e,t)=>{if(!l)throw new Error("Logging not configured. Call configure() first.");l.filters.set(e,t),d.clear()},zt=e=>{l&&(l.filters.delete(e),d.clear())},$t=e=>{if(!l)throw new Error("Logging not configured. Call configure() first.");let t=f(e.category),r=C(t);l.loggers.set(r,{...e,category:t}),d.clear()},Kt=()=>l?Array.from(l.sinks.keys()):[],Xt=()=>l?Array.from(l.filters.keys()):[],Ut=()=>l?Array.from(l.loggers.values()).map(e=>f(e.category)):[];var Ue={};h(Ue,{DEFAULT_LEVEL:()=>Wt,Logger:()=>N,clearLoggerCache:()=>Xe,current:()=>Jt,getLogger:()=>Yt});var Wt=u.Info,N=class e{category;parent;#e;#t=null;constructor(t,r=null,n={}){this.category=f(t),this.parent=r,this.#e=n}#r(){return this.#t===null&&(this.#t=ge(this.category)),this.#t}getChild(t){let r=R(this.category,f(t));return new e(r,this,this.#e)}with(t){return new e(this.category,this.parent,{...this.#e,...t})}get loggerName(){return T(this.category)}asString(t,r=!1){return typeof t=="string"?r?`"${t}"`:t:t===null||typeof t=="number"||typeof t=="bigint"||typeof t=="boolean"||typeof t>"u"||typeof t=="symbol"?String(t):t instanceof Error?t.stack:t!==null&&typeof t=="object"?Array.isArray(t)?JSON.stringify(t):`{${Object.entries(t).map(([n,i])=>`"${n}":${this.asString(i,!0)}`).join(",")}}`:"undefined"}async log(t,r,...n){let i=this.#r();if(t<i.lowestLevel)return r instanceof Function?void 0:r;let o,a;r instanceof Function?(o=r(),a=this.asString(o)):a=this.asString(r);let s=oe(),g=ee({message:a,rawMessage:a,args:n,datetime:new Date,severity:t,category:this.category,properties:this.#e,context:s});for(let c of i.filters)if(!c(g))return r instanceof Function?o:r;return i.sinks.length>0&&await Promise.all(i.sinks.map(c=>c(g))),r instanceof Function?o:r}debug(t,...r){return this.log(u.Debug,t,...r)}info(t,...r){return this.log(u.Info,t,...r)}warn(t,...r){return this.log(u.Warning,t,...r)}error(t,...r){return this.log(u.Error,t,...r)}critical(t,...r){return this.log(u.Critical,t,...r)}emergency(t,...r){return this.log(u.Emergency,t,...r)}alert(t,...r){return this.log(u.Alert,t,...r)}notice(t,...r){return this.log(u.Notice,t,...r)}trace(t,...r){return this.log(u.Trace,t,...r)}},ce=new Map,Yt=e=>{let t=ie(f(e)),r=C(t),n=ce.get(r);return n||(n=new N(t),ce.set(r,n)),n},Xe=()=>{ce.clear()};se(Xe);var Jt=new N(["default"]);var He={};h(He,{fingersCrossedSink:()=>ir,getBufferedSink:()=>or,getOutputSink:()=>rr,getRecordCollectorSink:()=>qe,getTestSink:()=>ar,withFilter:()=>nr});var Je={};h(Je,{jsonFormatter:()=>Qt,jsonLinesFormatter:()=>er,spanFormatter:()=>le,textFormatter:()=>Zt});var ue={[u.Trace]:"TRCE",[u.Debug]:"DBUG",[u.Info]:"INFO",[u.Notice]:"NOTC",[u.Warning]:"WARN",[u.Error]:"ERRO",[u.Critical]:"CRIT",[u.Alert]:"ALRT",[u.Emergency]:"EMRG"},qt=e=>e.length>1?e:e[0],We=(e,t)=>{if(t==="none")return"";if(typeof t=="function")return t(e);let r=e.toISOString(),n=r.slice(0,10),i=r.slice(11,19),o=r.slice(19);switch(t){case"rfc3339":return r;case"date-time-timezone":case void 0:return`${n} ${i}${o}`;case"date-time":return`${n} ${i}`;case"time-timezone":return`${i}${o}`;case"time":return i;case"date":return n}},Ht=e=>{try{return JSON.stringify(e)}catch{return String(e)}},Ye=(e,t)=>{let r={...t,...e},n=Object.entries(r);return n.length===0?"":" "+n.map(([i,o])=>{let a=typeof o=="string"?o:Ht(o);return`${i}=${a}`}).join(" ")},Qt=e=>{let t={level:Z[e.severity],datetime:e.datetime.getTime(),category:T(e.category),message:e.message};e.args.length>0&&(t.args=qt(e.args));let r={...e.context,...e.properties};return Object.keys(r).length>0&&(t.properties=r),`${JSON.stringify(t)}
2
+ import{a as u,b as Z}from"./chunk-7DPLGQHN.js";import{b as P,c as G,d as B,f as _,g as _e,h as Re,j as Fe,k as Q,l as ke}from"./chunk-YVN2NZL4.js";import{d as h}from"./chunk-5WJ6AUNY.js";var Ne={};h(Ne,{createLogRecord:()=>ee,isCategory:()=>Ee,isLogRecord:()=>At});var Ee=e=>Array.isArray(e)&&e.every(t=>typeof t=="string"),At=e=>{if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.message=="string"&&t.datetime instanceof Date&&typeof t.severity=="number"&&Ee(t.category)&&typeof t.properties=="object"&&typeof t.context=="object"},ee=e=>({rawMessage:e.rawMessage??e.message,args:e.args??[],datetime:e.datetime??new Date,properties:e.properties??{},context:e.context??{},...e});var Oe={};h(Oe,{categoriesEqual:()=>_t,categoryKey:()=>C,categoryToString:()=>T,extendCategory:()=>R,findMatchingConfigs:()=>te,getCommonAncestor:()=>Ft,getParentCategory:()=>Rt,isAncestor:()=>Pt,isDescendant:()=>Ie,isDescendantOrSelf:()=>j,matchesPattern:()=>V,normalizeCategory:()=>f});var f=e=>typeof e=="string"?e.split(".").filter(Boolean):e,T=(e,t=".")=>e.join(t),C=e=>e.join("\0"),Ie=(e,t)=>e.length<=t.length?!1:t.every((r,n)=>e[n]===r),j=(e,t)=>e.length<t.length?!1:t.every((r,n)=>e[n]===r),Pt=(e,t)=>Ie(t,e),_t=(e,t)=>e.length!==t.length?!1:e.every((r,n)=>r===t[n]),te=(e,t)=>{let r=[];for(let n of t.values()){let i=f(n.category);j(e,i)&&r.push(n)}return r.sort((n,i)=>{let o=f(n.category).length;return f(i.category).length-o}),r},Rt=e=>e.length<=1?null:e.slice(0,-1),R=(e,t)=>{let r=typeof t=="string"?[t]:t;return[...e,...r]},Ft=(e,t)=>{let r=[],n=Math.min(e.length,t.length);for(let i=0;i<n&&e[i]===t[i];i++)r.push(e[i]);return r},V=(e,t)=>{let r=0,n=0;for(;n<t.length&&r<e.length;){let i=t[n];if(i==="**"){if(n===t.length-1)return!0;for(let o=r;o<=e.length;o++)if(V(e.slice(o),t.slice(n+1)))return!0;return!1}if(i==="*"||i===e[r])r++,n++;else return!1}for(;n<t.length&&t[n]==="**";)n++;return r===e.length&&n===t.length};var Ke={};h(Ke,{configure:()=>Dt,configureSync:()=>Gt,getEffectiveConfig:()=>ge,getFilterNames:()=>Xt,getLoggerCategories:()=>Ut,getRegistryState:()=>Ot,getSinkNames:()=>Kt,isConfigured:()=>Mt,registerFilter:()=>Vt,registerLogger:()=>$t,registerLoggerCacheClear:()=>se,registerSink:()=>Bt,reset:()=>ze,resetSync:()=>$e,unregisterFilter:()=>zt,unregisterSink:()=>jt});var je={};h(je,{applyPrefixToCategory:()=>ie,clearDefaultStorages:()=>X,createCategoryPrefixScope:()=>It,createContextScope:()=>Nt,getCategoryPrefix:()=>Be,getCategoryPrefixStorage:()=>ne,getContext:()=>oe,getContextStorage:()=>re,setCategoryPrefixStorage:()=>K,setContextStorage:()=>F,withCategoryPrefix:()=>Ge,withContext:()=>E});var z,$,kt=()=>{if(z===void 0)try{let e=globalThis.AsyncLocalStorage??globalThis.require?.("async_hooks")?.AsyncLocalStorage;e&&(z=new e)}catch{}return z},Et=()=>{if($===void 0)try{let e=globalThis.AsyncLocalStorage??globalThis.require?.("async_hooks")?.AsyncLocalStorage;e&&($=new e)}catch{}return $},Me,De,F=e=>{Me=e},K=e=>{De=e},X=()=>{z=void 0,$=void 0},re=()=>Me??kt(),ne=()=>De??Et(),E=(e,t)=>{let r=re();if(!r)return t();let i={...r.getStore()??{},...e};return r.run(i,t)},oe=()=>{let e=re();return e?e.getStore()??{}:{}},Ge=(e,t)=>{let r=ne(),n=f(e);if(!r)return t();let i=r.getStore()??[],o=R(i,n);return r.run(o,t)},Be=()=>{let e=ne();return e?e.getStore()??[]:[]},ie=e=>{let t=Be();return t.length===0?e:R(t,e)},Nt=e=>t=>E(e,t),It=e=>t=>Ge(e,t);var ae=null,se=e=>{ae=e},l=null,d=new Map,Ot=()=>l,Mt=()=>l!==null,Dt=async e=>{(e.reset||l===null)&&await ze(),l={sinks:new Map(Object.entries(e.sinks)),filters:new Map(Object.entries(e.filters??{})),loggers:new Map,contextLocalStorage:e.contextLocalStorage};for(let t of e.loggers){let r=f(t.category),n=C(r);l.loggers.set(n,{...t,category:r})}e.contextLocalStorage&&F(e.contextLocalStorage),d.clear()},Gt=e=>{(e.reset||l===null)&&$e(),l={sinks:new Map(Object.entries(e.sinks)),filters:new Map(Object.entries(e.filters??{})),loggers:new Map,contextLocalStorage:e.contextLocalStorage};for(let t of e.loggers){let r=f(t.category),n=C(r);l.loggers.set(n,{...t,category:r})}e.contextLocalStorage&&F(e.contextLocalStorage),d.clear()},ze=async()=>{if(l)for(let e of l.sinks.values()){let t=e;typeof t.dispose=="function"?await t.dispose():typeof t[Symbol.asyncDispose]=="function"&&await t[Symbol.asyncDispose]()}l=null,d.clear(),ae?.(),F(void 0),K(void 0),X()},$e=()=>{if(l)for(let e of l.sinks.values()){let t=e;typeof t.disposeSync=="function"?t.disposeSync():typeof t[Symbol.dispose]=="function"&&t[Symbol.dispose]()}l=null,d.clear(),ae?.(),F(void 0),K(void 0),X()},ge=e=>{let t=C(e),r=d.get(t);if(r)return r;let n={sinks:[],filters:[],lowestLevel:u.Info};if(!l)return n;let i=te(e,l.loggers),o=new Set,a=new Set,s=!1;for(let g of i){if(g.sinks&&g.sinks.length>0){g.parentSinks==="override"&&o.clear();for(let c of g.sinks)o.add(c)}if(g.filters)for(let c of g.filters)a.add(c);!s&&g.lowestLevel!==void 0&&(n.lowestLevel=g.lowestLevel,s=!0)}for(let g of o){let c=l.sinks.get(g);c&&n.sinks.push(c)}for(let g of a){let c=l.filters.get(g);c&&n.filters.push(c)}return d.set(t,n),n},Bt=(e,t)=>{if(!l)throw new Error("Logging not configured. Call configure() first.");l.sinks.set(e,t),d.clear()},jt=e=>{l&&(l.sinks.delete(e),d.clear())},Vt=(e,t)=>{if(!l)throw new Error("Logging not configured. Call configure() first.");l.filters.set(e,t),d.clear()},zt=e=>{l&&(l.filters.delete(e),d.clear())},$t=e=>{if(!l)throw new Error("Logging not configured. Call configure() first.");let t=f(e.category),r=C(t);l.loggers.set(r,{...e,category:t}),d.clear()},Kt=()=>l?Array.from(l.sinks.keys()):[],Xt=()=>l?Array.from(l.filters.keys()):[],Ut=()=>l?Array.from(l.loggers.values()).map(e=>f(e.category)):[];var Ue={};h(Ue,{DEFAULT_LEVEL:()=>Wt,Logger:()=>N,clearLoggerCache:()=>Xe,current:()=>Jt,getLogger:()=>Yt});var Wt=u.Info,N=class e{category;parent;#e;#t=null;constructor(t,r=null,n={}){this.category=f(t),this.parent=r,this.#e=n}#r(){return this.#t===null&&(this.#t=ge(this.category)),this.#t}getChild(t){let r=R(this.category,f(t));return new e(r,this,this.#e)}with(t){return new e(this.category,this.parent,{...this.#e,...t})}get loggerName(){return T(this.category)}asString(t,r=!1){return typeof t=="string"?r?`"${t}"`:t:t===null||typeof t=="number"||typeof t=="bigint"||typeof t=="boolean"||typeof t>"u"||typeof t=="symbol"?String(t):t instanceof Error?t.stack:t!==null&&typeof t=="object"?Array.isArray(t)?JSON.stringify(t):`{${Object.entries(t).map(([n,i])=>`"${n}":${this.asString(i,!0)}`).join(",")}}`:"undefined"}async log(t,r,...n){let i=this.#r();if(t<i.lowestLevel)return r instanceof Function?void 0:r;let o,a;r instanceof Function?(o=r(),a=this.asString(o)):a=this.asString(r);let s=oe(),g=ee({message:a,rawMessage:a,args:n,datetime:new Date,severity:t,category:this.category,properties:this.#e,context:s});for(let c of i.filters)if(!c(g))return r instanceof Function?o:r;return i.sinks.length>0&&await Promise.all(i.sinks.map(c=>c(g))),r instanceof Function?o:r}debug(t,...r){return this.log(u.Debug,t,...r)}info(t,...r){return this.log(u.Info,t,...r)}warn(t,...r){return this.log(u.Warning,t,...r)}error(t,...r){return this.log(u.Error,t,...r)}critical(t,...r){return this.log(u.Critical,t,...r)}emergency(t,...r){return this.log(u.Emergency,t,...r)}alert(t,...r){return this.log(u.Alert,t,...r)}notice(t,...r){return this.log(u.Notice,t,...r)}trace(t,...r){return this.log(u.Trace,t,...r)}},ce=new Map,Yt=e=>{let t=ie(f(e)),r=C(t),n=ce.get(r);return n||(n=new N(t),ce.set(r,n)),n},Xe=()=>{ce.clear()};se(Xe);var Jt=new N(["default"]);var He={};h(He,{fingersCrossedSink:()=>ir,getBufferedSink:()=>or,getOutputSink:()=>rr,getRecordCollectorSink:()=>qe,getTestSink:()=>ar,withFilter:()=>nr});var Je={};h(Je,{jsonFormatter:()=>Qt,jsonLinesFormatter:()=>er,spanFormatter:()=>le,textFormatter:()=>Zt});var ue={[u.Trace]:"TRCE",[u.Debug]:"DBUG",[u.Info]:"INFO",[u.Notice]:"NOTC",[u.Warning]:"WARN",[u.Error]:"ERRO",[u.Critical]:"CRIT",[u.Alert]:"ALRT",[u.Emergency]:"EMRG"},qt=e=>e.length>1?e:e[0],We=(e,t)=>{if(t==="none")return"";if(typeof t=="function")return t(e);let r=e.toISOString(),n=r.slice(0,10),i=r.slice(11,19),o=r.slice(19);switch(t){case"rfc3339":return r;case"date-time-timezone":case void 0:return`${n} ${i}${o}`;case"date-time":return`${n} ${i}`;case"time-timezone":return`${i}${o}`;case"time":return i;case"date":return n}},Ht=e=>{try{return JSON.stringify(e)}catch{return String(e)}},Ye=(e,t)=>{let r={...t,...e},n=Object.entries(r);return n.length===0?"":" "+n.map(([i,o])=>{let a=typeof o=="string"?o:Ht(o);return`${i}=${a}`}).join(" ")},Qt=e=>{let t={level:Z[e.severity],datetime:e.datetime.getTime(),category:T(e.category),message:e.message};e.args.length>0&&(t.args=qt(e.args));let r={...e.context,...e.properties};return Object.keys(r).length>0&&(t.properties=r),`${JSON.stringify(t)}
3
3
  `},Zt=(e={})=>{let{timestamp:t="date-time-timezone",categorySeparator:r=".",includeLevel:n=!0,includeCategory:i=!0}=e;return o=>{let a=[],s=We(o.datetime,t);s&&a.push(s),n&&a.push(ue[o.severity]??"????"),i&&o.category.length>0&&a.push(`[${T(o.category,r)}]`),a.push(o.message);let g=Ye(o.properties,o.context);return`${a.join(" ")}${g}
4
4
  `}},er=e=>JSON.stringify({ts:e.datetime.getTime(),lvl:ue[e.severity],cat:T(e.category),msg:e.message,...e.args.length>0?{args:e.args}:{},...e.context,...e.properties})+`
5
5
  `,tr=(e,t)=>{switch(e){case u.Trace:return B(Fe(t));case u.Debug:return ke(t);case u.Info:return _e(t);case u.Notice:return Q(t);case u.Warning:return Re(t);case u.Error:return _(t);case u.Critical:return G(_(t));case u.Alert:return G(_(t));case u.Emergency:return G(_(t));default:return P(t)}},le=e=>{let t=We(e.datetime,"date-time-timezone"),r=ue[e.severity]??"????",n=e.category.length>0?T(e.category):"",i=Ye(e.properties,e.context),o=[];return t&&o.push(B(t),P(" ")),o.push(tr(e.severity,r),P(" ")),n&&o.push(Q(`[${n}]`),P(" ")),e.severity>=u.Error?o.push(_(e.message)):o.push(P(e.message)),i.trim()&&o.push(P(" "),B(i.trim())),o};var rr=(e,t)=>{let r=t?.formatter??le;return n=>{let i=r(n);e.writeln(...i)}},nr=(e,t)=>r=>{if(t(r))return e(r)},or=(e,t={})=>{let{maxSize:r=100,flushIntervalMs:n=5e3}=t,i=[],o=null,a=async()=>{if(i.length===0)return;let c=i;i=[],o&&(clearTimeout(o),o=null),await Promise.all(c.map(y=>e(y)))},s=()=>{o===null&&(o=setTimeout(()=>{o=null,a().catch(()=>{})},n))},g=async c=>{i.push(c),i.length>=r?await a():s()};return g.flush=a,g},ir=(e,t={})=>{let{triggerLevel:r=17,maxBufferSize:n=1e3}=t,i=[],o=!1,a=async()=>{let c=i;i=[],o=!0,await Promise.all(c.map(y=>e(y)))},s=()=>{i=[],o=!1},g=async c=>{if(o){await e(c);return}if(c.severity>=r){i.push(c),await a();return}i.push(c),i.length>n&&i.shift()};return g.flush=a,g.clear=s,g},qe=()=>{let e=[];return{sink:r=>{e.push(r)},records:e}},ar=qe;var Qe={};h(Qe,{anyFilter:()=>mr,combineFilters:()=>yr,getCategoryFilter:()=>gr,getCategoryPatternFilter:()=>cr,getLevelFilter:()=>sr,getMessageFilter:()=>fr,getMessageRegexFilter:()=>pr,getPropertyFilter:()=>ur,getPropertyValueFilter:()=>lr,getRateLimitFilter:()=>hr,getSamplingFilter:()=>Sr,notFilter:()=>dr,passAllFilter:()=>xr,rejectAllFilter:()=>vr});var sr=e=>t=>t.severity>=e,gr=e=>{let t=f(e);return r=>j(r.category,t)},cr=e=>{let t=f(e);return r=>V(r.category,t)},ur=e=>t=>e in t.properties||e in t.context,lr=(e,t)=>r=>{let n=r.properties[e]??r.context[e];return t(n)},fr=(e,t=!1)=>r=>t?r.message.includes(e):r.message.toLowerCase().includes(e.toLowerCase()),pr=e=>t=>e.test(t.message),yr=(...e)=>t=>e.every(r=>r(t)),mr=(...e)=>t=>e.some(r=>r(t)),dr=e=>t=>!e(t),xr=e=>!0,vr=e=>!1,hr=(e,t)=>{if(e<=0||!Number.isInteger(e))throw new Error("maxRecords must be a positive integer");if(t<=0||!Number.isFinite(t))throw new Error("windowMs must be a positive number");let r=0,n=Date.now();return i=>{let o=Date.now();return o-n>=t&&(n=o,r=0),r>=e?!1:(r++,!0)}},Sr=e=>{if(e<=0||!Number.isFinite(e))throw new Error("sampleRate must be a positive number");return t=>Math.random()<1/e};var bt={};h(bt,{SpanStatusCode:()=>m,context:()=>ve,createTracer:()=>Kr,propagation:()=>Ce,recordSpanError:()=>be,trace:()=>k,traceOperation:()=>Ur,tracer:()=>we,withSpan:()=>wt,withSpanSync:()=>Xr});var Ze=typeof globalThis=="object"?globalThis:global;var S="1.9.0";var et=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Tr(e){var t=new Set([e]),r=new Set,n=e.match(et);if(!n)return function(){return!1};var i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(i.prerelease!=null)return function(g){return g===e};function o(s){return r.add(s),!1}function a(s){return t.add(s),!0}return function(g){if(t.has(g))return!0;if(r.has(g))return!1;var c=g.match(et);if(!c)return o(g);var y={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};return y.prerelease!=null||i.major!==y.major?o(g):i.major===0?i.minor===y.minor&&i.patch<=y.patch?a(g):o(g):i.minor<=y.minor?a(g):o(g)}}var tt=Tr(S);var Cr=S.split(".")[0],I=Symbol.for("opentelemetry.js.api."+Cr),O=Ze;function L(e,t,r,n){var i;n===void 0&&(n=!1);var o=O[I]=(i=O[I])!==null&&i!==void 0?i:{version:S};if(!n&&o[e]){var a=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(a.stack||a.message),!1}if(o.version!==S){var a=new Error("@opentelemetry/api: Registration of version v"+o.version+" for "+e+" does not match previously registered API v"+S);return r.error(a.stack||a.message),!1}return o[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+S+"."),!0}function x(e){var t,r,n=(t=O[I])===null||t===void 0?void 0:t.version;if(!(!n||!tt(n)))return(r=O[I])===null||r===void 0?void 0:r[e]}function w(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+S+".");var r=O[I];r&&delete r[e]}var Lr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},wr=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},rt=function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return M("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return M("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return M("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return M("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return M("verbose",this._namespace,t)},e}();function M(e,t,r){var n=x("diag");if(n)return r.unshift(t),n[e].apply(n,wr([],Lr(r),!1))}var p;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(p||(p={}));function nt(e,t){e<p.NONE?e=p.NONE:e>p.ALL&&(e=p.ALL),t=t||{};function r(n,i){var o=t[n];return typeof o=="function"&&e>=i?o.bind(t):function(){}}return{error:r("error",p.ERROR),warn:r("warn",p.WARN),info:r("info",p.INFO),debug:r("debug",p.DEBUG),verbose:r("verbose",p.VERBOSE)}}var br=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Ar=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},Pr="diag",v=function(){function e(){function t(i){return function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=x("diag");if(s)return s[i].apply(s,Ar([],br(o),!1))}}var r=this,n=function(i,o){var a,s,g;if(o===void 0&&(o={logLevel:p.INFO}),i===r){var c=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((a=c.stack)!==null&&a!==void 0?a:c.message),!1}typeof o=="number"&&(o={logLevel:o});var y=x("diag"),Ae=nt((s=o.logLevel)!==null&&s!==void 0?s:p.INFO,i);if(y&&!o.suppressOverrideMessage){var Pe=(g=new Error().stack)!==null&&g!==void 0?g:"<failed to generate stacktrace>";y.warn("Current logger will be overwritten from "+Pe),Ae.warn("Current logger will overwrite one already registered from "+Pe)}return L("diag",Ae,r,!0)};r.setLogger=n,r.disable=function(){w(Pr,r)},r.createComponentLogger=function(i){return new rt(i)},r.verbose=t("verbose"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();var _r=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Rr=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ot=function(){function e(t){this._entries=t?new Map(t):new Map}return e.prototype.getEntry=function(t){var r=this._entries.get(t);if(r)return Object.assign({},r)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(t){var r=_r(t,2),n=r[0],i=r[1];return[n,i]})},e.prototype.setEntry=function(t,r){var n=new e(this._entries);return n._entries.set(t,r),n},e.prototype.removeEntry=function(t){var r=new e(this._entries);return r._entries.delete(t),r},e.prototype.removeEntries=function(){for(var t,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=new e(this._entries);try{for(var a=Rr(n),s=a.next();!s.done;s=a.next()){var g=s.value;o._entries.delete(g)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},e.prototype.clear=function(){return new e},e}();var An=v.instance();function it(e){return e===void 0&&(e={}),new ot(new Map(Object.entries(e)))}function U(e){return Symbol.for(e)}var Fr=function(){function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,i){var o=new e(r._currentContext);return o._currentContext.set(n,i),o},r.deleteValue=function(n){var i=new e(r._currentContext);return i._currentContext.delete(n),i}}return e}(),at=new Fr;var st={get:function(e,t){if(e!=null)return e[t]},keys:function(e){return e==null?[]:Object.keys(e)}},gt={set:function(e,t,r){e!=null&&(e[t]=r)}};var kr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Er=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},ct=function(){function e(){}return e.prototype.active=function(){return at},e.prototype.with=function(t,r,n){for(var i=[],o=3;o<arguments.length;o++)i[o-3]=arguments[o];return r.call.apply(r,Er([n],kr(i),!1))},e.prototype.bind=function(t,r){return r},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}();var Nr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o},Ir=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},fe="context",Or=new ct,b=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return L(fe,t,v.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,r,n){for(var i,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return(i=this._getContextManager()).with.apply(i,Ir([t,r,n],Nr(o),!1))},e.prototype.bind=function(t,r){return this._getContextManager().bind(t,r)},e.prototype._getContextManager=function(){return x(fe)||Or},e.prototype.disable=function(){this._getContextManager().disable(),w(fe,v.instance())},e}();var W;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(W||(W={}));var pe="0000000000000000",ye="00000000000000000000000000000000",ut={traceId:ye,spanId:pe,traceFlags:W.NONE};var A=function(){function e(t){t===void 0&&(t=ut),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,r){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,r){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,r){},e}();var me=U("OpenTelemetry Context Key SPAN");function Y(e){return e.getValue(me)||void 0}function lt(){return Y(b.getInstance().active())}function D(e,t){return e.setValue(me,t)}function ft(e){return e.deleteValue(me)}function pt(e,t){return D(e,new A(t))}function J(e){var t;return(t=Y(e))===null||t===void 0?void 0:t.spanContext()}var Mr=/^([0-9a-f]{32})$/i,Dr=/^[0-9a-f]{16}$/i;function Gr(e){return Mr.test(e)&&e!==ye}function Br(e){return Dr.test(e)&&e!==pe}function q(e){return Gr(e.traceId)&&Br(e.spanId)}function yt(e){return new A(e)}var de=b.getInstance(),H=function(){function e(){}return e.prototype.startSpan=function(t,r,n){n===void 0&&(n=de.active());var i=!!r?.root;if(i)return new A;var o=n&&J(n);return jr(o)&&q(o)?new A(o):new A},e.prototype.startActiveSpan=function(t,r,n,i){var o,a,s;if(!(arguments.length<2)){arguments.length===2?s=r:arguments.length===3?(o=r,s=n):(o=r,a=n,s=i);var g=a??de.active(),c=this.startSpan(t,o,g),y=D(g,c);return de.with(y,s,void 0,c)}},e}();function jr(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var Vr=new H,mt=function(){function e(t,r,n,i){this._provider=t,this.name=r,this.version=n,this.options=i}return e.prototype.startSpan=function(t,r,n){return this._getTracer().startSpan(t,r,n)},e.prototype.startActiveSpan=function(t,r,n,i){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Vr},e}();var dt=function(){function e(){}return e.prototype.getTracer=function(t,r,n){return new H},e}();var zr=new dt,xe=function(){function e(){}return e.prototype.getTracer=function(t,r,n){var i;return(i=this.getDelegateTracer(t,r,n))!==null&&i!==void 0?i:new mt(this,t,r,n)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:zr},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,r,n){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getTracer(t,r,n)},e}();var m;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(m||(m={}));var ve=b.getInstance();var xt=function(){function e(){}return e.prototype.inject=function(t,r){},e.prototype.extract=function(t,r){return t},e.prototype.fields=function(){return[]},e}();var he=U("OpenTelemetry Baggage Key");function Se(e){return e.getValue(he)||void 0}function vt(){return Se(b.getInstance().active())}function ht(e,t){return e.setValue(he,t)}function St(e){return e.deleteValue(he)}var Te="propagation",$r=new xt,Tt=function(){function e(){this.createBaggage=it,this.getBaggage=Se,this.getActiveBaggage=vt,this.setBaggage=ht,this.deleteBaggage=St}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(t){return L(Te,t,v.instance())},e.prototype.inject=function(t,r,n){return n===void 0&&(n=gt),this._getGlobalPropagator().inject(t,r,n)},e.prototype.extract=function(t,r,n){return n===void 0&&(n=st),this._getGlobalPropagator().extract(t,r,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){w(Te,v.instance())},e.prototype._getGlobalPropagator=function(){return x(Te)||$r},e}();var Ce=Tt.getInstance();var Le="trace",Ct=function(){function e(){this._proxyTracerProvider=new xe,this.wrapSpanContext=yt,this.isSpanContextValid=q,this.deleteSpan=ft,this.getSpan=Y,this.getActiveSpan=lt,this.getSpanContext=J,this.setSpan=D,this.setSpanContext=pt}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var r=L(Le,this._proxyTracerProvider,v.instance());return r&&this._proxyTracerProvider.setDelegate(t),r},e.prototype.getTracerProvider=function(){return x(Le)||this._proxyTracerProvider},e.prototype.getTracer=function(t,r){return this.getTracerProvider().getTracer(t,r)},e.prototype.disable=function(){w(Le,v.instance()),this._proxyTracerProvider=new xe},e}();var k=Ct.getInstance();var we=k.getTracer("@eser/logging"),be=(e,t)=>{t instanceof Error?(e.recordException(t),e.setStatus({code:m.ERROR,message:t.message})):e.setStatus({code:m.ERROR,message:String(t)})},Kr=(e,t)=>k.getTracer(e,t),Lt=e=>{let t=e.spanContext();return t?{traceId:t.traceId,spanId:t.spanId,traceFlags:t.traceFlags}:null},wt=async(e,t)=>{let r=we.startSpan(e);try{let n=Lt(r);if(n){let o=await E(n,()=>t(r));return r.setStatus({code:m.OK}),o}let i=await t(r);return r.setStatus({code:m.OK}),i}catch(n){throw be(r,n),n}finally{r.end()}},Xr=(e,t)=>{let r=we.startSpan(e);try{let n=Lt(r);if(n){let o=E(n,()=>t(r));return r.setStatus({code:m.OK}),o}let i=t(r);return r.setStatus({code:m.OK}),i}catch(n){throw be(r,n),n}finally{r.end()}},Ur=(e,t)=>wt(e,t);export{Ne as a,Oe as b,je as c,Ke as d,Ue as e,Je as f,He as g,Qe as h,bt as i};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(a&&(b=a(a=0)),b);var o=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),p=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var q=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d,q as e};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{f as s,u as o,v as i,w as a}from"./chunk-BQT5RJZB.js";var c={fs:!1,fsSync:!1,exec:!1,process:!1,env:!0,stdin:!1,stdout:!1,kv:!0},t=new Map,u=()=>({get(e){return t.get(e)},set(e,n){t.set(e,n)},delete(e){t.delete(e)},has(e){return t.has(e)},toObject(){return Object.fromEntries(t)}}),l=e=>{for(let[n,r]of Object.entries(e))r!=null&&r.constructor===String&&t.set(n,r)},f=()=>{t.clear()},m=()=>({name:"workerd",version:"unknown",capabilities:c,fs:o("workerd"),path:s,exec:i("workerd"),env:u(),process:a("workerd")});export{c as a,l as b,f as c,m as d};
@@ -0,0 +1,10 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as S,c as R,d as x,e as O}from"./chunk-OCPEFZBJ.js";import{c as A}from"./chunk-OAT2D23A.js";var T=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],C=e=>T.map(s=>({...s,extras:R(e,s.id)}));var P=e=>{let s=new Set(e.map(t=>t.questionId));return T.every(t=>s.has(t.id))};var n=e=>A(e),_="NEVER run git write commands (commit, add, push, checkout, stash, reset, merge, rebase, cherry-pick). Git is read-only for agents. The user controls git. You may read: git log, git diff, git status, git show, git blame.",U=(e,s,t,a)=>{let c=e.execution.iteration>=s,p="You are a senior engineer and a scrum master who takes pride in honest reporting. Your reputation depends on accuracy, not speed. You are responsible for others' toil, and you are a perfect example of a servant leader. When reporting progress: if something is NOT implemented, say so \u2014 don't hide it. If partially done, say 'partially done: [what works] / [what doesn't]'. If untested, say 'implemented but untested'. NEVER say 'done' for something you haven't verified yourself. Underpromise \u2014 4 of 6 done means '4 of 6 done, 2 remaining', not 'almost done'.",i="Never skip steps or make decisions without asking the user. If you think something can be skipped or inferred, ask first. Explicit > Clever.",f="At every decision point (discovery questions, classification, spec approval, expansion proposals, architectural decisions, rule promotion), you MUST use AskUserQuestion to get the user's input. You MUST NOT make decisions, infer preferences, or assume the user's intent. If you're unsure whether something is a decision point, it is \u2014 ask.",l="At every decision point where you present options to the user, share your recommendation BEFORE asking. Say what you think and why, then ask if the user agrees. Format: 'I'd recommend X because [reason]. Agree, or would you prefer Y?' The user always has the final word, but you save them cognitive load by proposing first.",o=t?[p,i,f,l]:[_,p,i,f,l],u=a?.outOfScope??[];switch(e.phase){case"IDLE":return{rules:[...o,"When interactiveOptions are present, pass them DIRECTLY as the `options` array in AskUserQuestion \u2014 they are already in the correct {label, description} format. You MUST also provide a `header` field (max 12 chars, e.g. 'Action') and a `question` field. When the user picks an option, look up its label in the `commandMap` object to find the command to execute.","For availableConcerns: use AskUserQuestion with multiSelect:true. AskUserQuestion supports max 4 options per question and max 4 questions per call. If there are more than 4 concerns, split them across two questions within the same AskUserQuestion call (e.g., first 3 in question 1, remaining in question 2). NEVER silently drop concerns \u2014 present ALL available concerns to the user, even if it requires multiple questions.","Do not take action without the user choosing an option first.","When the user wants to create a new spec, they can provide anything: a one-line description, a full task list, meeting notes, a kanban card, a customer email, or a detailed requirements document. Accept whatever format they provide. If it's long, summarize it into a spec title for the slug but preserve the full text as context for discovery.","After running spec new, ask the user if they want full discovery, quick discovery, or skip to spec draft. Full discovery: pre-scan, premise challenge, 6 questions, expansions, architecture, error map, synthesis. Quick discovery: only questions relevant to active concerns, skip expansions and error map. Skip to spec draft: classification \u2192 approve \u2192 execute. Never skip discovery without asking."],tone:"Welcoming. Present choices, then wait."};case"DISCOVERY":return{modeOverride:"You are in plan mode. Behave exactly as you would in Claude Code's native plan mode. Do not attempt to create, edit, or write any files. Do not run any shell commands that modify state. You can read files and run read-only commands to understand the codebase. Your ONLY job right now is to have a thorough conversation with the user \u2014 ask probing questions, challenge vague answers, explore alternatives, understand the problem deeply. The quality of everything that follows depends on this conversation.",rules:[...o,"You MUST ask each discovery question using AskUserQuestion tool. You MUST NOT answer questions yourself or infer answers from the spec description. You MUST NOT submit discovery answers without the user explicitly providing each answer through AskUserQuestion. Each question \u2192 one AskUserQuestion call \u2192 user answers \u2192 next question. If the user already gave a detailed description in spec new, you may PRE-FILL suggested answers as option descriptions in AskUserQuestion \u2014 but the user must still confirm or override each one. If the user provided a fully formed plan, you may skip Phase 2 (questions) but you MUST still run premise challenge and alternatives. Never skip premise challenge.","DO NOT create, edit, or write any files.","DO NOT run shell commands that modify state.","You MAY read files and run read-only commands (cat, ls, grep, git log, git diff).","BEFORE asking any discovery questions, conduct a pre-discovery codebase scan: read the project README, CLAUDE.md, and any design docs; check the last 20 git commits (git log --oneline -20); look for TODO files, open issue references, and existing specs; scan the directory structure to understand the project shape. Then present a brief 'Pre-discovery audit' summary: stack detected, recent work themes, open TODOs, existing specs. This gives you CONTEXT to ask INFORMED questions, not blind ones.","After the pre-discovery codebase scan and BEFORE starting questions, ask the user: 'What kind of discovery do you need? A) Explore scope \u2014 I'll help expand, find opportunities, think bigger. B) Technical depth \u2014 I'll focus on architecture, error handling, implementation strategy. C) Validate my plan \u2014 I already know what I want, challenge my assumptions. D) Ship fast \u2014 minimal scope, cut the fat, get to tasks quickly.' Adapt your discovery emphasis accordingly: Explore \u2192 heavy on expansion proposals and dream state; Technical \u2192 heavy on architectural decisions and error/rescue map; Validate \u2192 heavy on premise challenge and pushback; Ship fast \u2192 minimal questions, skip expansions, go direct to classification and tasks.","Before starting discovery questions, challenge the user's initial spec description against what you learned from the codebase scan. Look for: hidden complexity they haven't mentioned, conflicts with existing code, scope that's bigger or smaller than they think, existing modules that overlap with what they're asking for. Share your observations and ask clarifying follow-ups, then proceed to questions.","When asking discovery questions, use your codebase knowledge to offer concrete options alongside the open-ended question. For example, instead of just 'What does the user do today?' present: 'Based on the codebase, I see three likely scenarios: A) ... B) ... C) ... D) Something else \u2014 describe it. Which is closest?' The user can always pick 'something else' but concrete options speed up the conversation and force specificity.","Ask one question at a time using your interactive question tool.","Push back on vague answers \u2014 you will be the one executing this spec, vague answers make your job harder.","When the user gives a short answer, follow up: 'Can you be more specific?'","After collecting discovery answers, synthesize a CURRENT STATE \u2192 THIS SPEC \u2192 6-MONTH IDEAL vision before generating the spec. Show three columns: where the project is now, what this spec achieves, and where it could go in 6 months. Note: 'This spec moves you from column 1 to column 2. Column 3 is out of scope but worth knowing \u2014 every decision in this spec should keep column 3 possible.' This helps the user see if the scope is right.","When you spot expansion opportunities during discovery (from codebase scan, TODOs, concern requirements, synergies with the current plan), present each as a numbered proposal (1/N, 2/N...). Every proposal MUST include: clear description of WHAT and WHY (how it connects to the current plan); effort estimate as S/M/L/XL with human time and CC time estimates (e.g., 'S (human: ~1 day / CC: ~15 min)' \u2014 not just 'small'); risk assessment as Low/Low-Med/Med/Med-High/High naming the specific risk factor; completeness delta showing X/10 without this and Y/10 with this. Every proposal gets three options: A) Add to scope B) Defer to future spec C) Skip \u2014 not interested, plus 'Chat about this' and 'Skip remaining proposals' escape hatches.","After discovery questions and expansion proposals, identify architectural decisions that must be resolved before implementation. These are decisions where choosing A vs B changes the shape of multiple tasks, the data model, the API surface, or system boundaries. Present each as a concrete technical question with options, a RECOMMENDATION with reasoning, and completeness scores. Show how each option affects downstream work (e.g., 'If you choose B, tasks 3 and 4 need a job queue setup step added'). Only surface decisions that BLOCK implementation \u2014 not preferences or nice-to-haves. If the user says 'I don't know yet', mark it as a risk: 'UNRESOLVED: [decision] TBD. Tasks X-Y may change.' Never allow implementation to start with unresolved architectural decisions \u2014 flag them prominently in the spec.","Before finalizing, map error and rescue paths for every significant codepath in the planned work. Create a table: codepath | what can go wrong | how it's handled. Identify CRITICAL GAPS \u2014 failure modes that the plan doesn't address. Present each critical gap as a decision with options, a recommendation, and completeness scores, just like architectural decisions. Resolved gaps become tasks or acceptance criteria. Unresolved gaps become risk flags. Think like an SRE reviewing a design doc \u2014 what fails at 3am?","After all discovery questions, expansion proposals, architectural decisions, and error mapping are complete, present a DISCOVERY SUMMARY for the user to review: intent, ambition, reversibility, impact, verification, out of scope, the dream state table (current \u2192 this spec \u2192 future), accepted/deferred/skipped expansions, resolved architectural decisions, and the error/rescue map. Ask for confirmation before generating the spec. This is the last chance to catch misunderstandings.","Once you have a substantive answer for each question, collect all answers and submit them together in a single `noskills next --answer` call as a JSON object."],tone:"Curious interviewer who has a stake in the answers and comes PREPARED. You've read the codebase before asking. Challenge assumptions, offer concrete options, think about architecture and failure modes. Think deeply before asking each question."};case"DISCOVERY_REVIEW":return{modeOverride:"You are in plan mode. Do not create, edit, or write any files. Present the discovery answers to the user for review and confirmation.",rules:[...o,"DO NOT create, edit, or write any files.","Present ALL discovery answers to the user clearly, one by one.","Use AskUserQuestion to ask: 'Are these answers correct, or would you like to revise any?'","If the user approves, run the approve command.","If the user wants to revise, collect their corrections and submit them.","You MUST NOT approve on behalf of the user. The user must explicitly confirm."],tone:"Careful reviewer. The user must confirm every answer."};case"SPEC_DRAFT":return{modeOverride:"You are in plan mode. Behave exactly as you would in Claude Code's native plan mode. Do not attempt to create, edit, or write any files. Your job is to review the generated spec with the user \u2014 identify gaps, suggest improvements, check if tasks are concrete enough to execute.",rules:[...o,"DO NOT create, edit, or write any files.","Read the spec and present a summary to the user.","Flag any tasks that are too vague to execute.","Flag any missing acceptance criteria.","Ask the user if they want to refine before approving.","When presenting classification options, use AskUserQuestion with multiSelect:true. Do NOT infer classification yourself.","If you identify issues in the spec (vague tasks, irrelevant sections, missing acceptance criteria), submit a refinement via: `"+n(`next --answer='{"refinement":"task-1: Add upload endpoint, task-2: Add validation middleware, task-3: Write integration tests"}'`)+"`. The spec will be updated and you can review again."],tone:"Thoughtful reviewer preparing to hand off to an implementer."};case"SPEC_APPROVED":return{rules:[...o,"The spec is approved but execution has not started.","Do not start coding until the user triggers execution.","If the user wants changes, they must reset and re-spec.","Before starting execution, show the spec summary to the user and ask for final confirmation via AskUserQuestion."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let h=[...o,"Do not explore the codebase beyond what the current task requires.","Do not refactor, improve, or modify code outside this task's scope.","Do not add features, tests, or documentation not specified in the spec.","If you need to read files to understand context, timebox it \u2014 then write code.","The deliverable is working code, not a plan or analysis.","Complete the task, then report progress. The user handles git.",`When you receive a task from noskills next, do NOT execute it yourself. Spawn the noskills-executor sub-agent using the Agent tool. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. When the sub-agent completes, review its results briefly, then report to noskills via \`${n(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}\`. You are the orchestrator \u2014 the sub-agent is the implementer.`,"If the sub-agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the sub-agent failure in your next status report so it can be investigated.","After the noskills-executor sub-agent completes a task, spawn a noskills-verifier sub-agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.",`After spawning sub-agents, ALWAYS present a dispatch table showing the FULL pipeline \u2014 not just executors, but also verification and test steps:
3
+
4
+ | Step | Agent | Files | Tasks | Est. Time |
5
+ |------|-------|-------|-------|-----------|
6
+ | 1. Implement | noskills-executor | purge.ts | Tasks 1-6 | ~3 min |
7
+ | 2. Verify | noskills-verifier | purge.ts (read-only) | Validate ACs | ~1 min |
8
+ | 3. Write tests | noskills-executor | purge.test.ts | Task 7 | ~2 min |
9
+
10
+ When agents complete, update with actual time and status (Done / Failed / Found N issues). The user should see the complete plan upfront.`,"The agent that writes implementation code must NOT write tests for that code. Spawn a SEPARATE sub-agent for test writing. This prevents the implementer from writing tests that only confirm what it already knows. The test writer reads the code fresh and tests what it actually does, not what the implementer intended.","When deciding how to split work across sub-agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused sub-agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks.",`When you discover a pattern, receive a correction, or identify a recurring preference from the user, ask: 'Should this be a permanent rule for this project, or just for this task?' If permanent, run: \`${n('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`];e.execution.lastVerification?.passed===!1&&h.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let r={rules:h,tone:"Direct. No preamble. Start coding immediately.",outOfScope:u.length>0?u:void 0};return c?{...r,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:r}case"BLOCKED":return{rules:[...o,"Present the decision to the user exactly as described.","Do not suggest a preferred option unless the user asks for your opinion.","After the user decides, relay the answer immediately. Do not elaborate."],tone:"Brief. The user is making a decision, not having a discussion."};case"DONE":return{rules:[...o,"Report the completion summary. Do not start new work.","If the user wants to continue, they start a new spec."],tone:"Concise. Celebrate briefly, then stop."};default:return{rules:[...o,`Run \`${n("next")}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},$=5*60*1e3,F=(e,s)=>{let t;switch(e.phase){case"IDLE":t=`No active spec. Start one with: \`${n("spec new")}\``;break;case"DISCOVERY":t=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;break;case"DISCOVERY_REVIEW":t=`Discovery answers ready for review. ${e.discovery.answers.length} answers collected. Waiting for user confirmation.`;break;case"SPEC_DRAFT":t=`Spec draft ready for review at ${e.specState.path}. Waiting for approval.`;break;case"SPEC_APPROVED":t=`Spec "${e.spec}" is approved. Waiting to start execution.`;break;case"EXECUTING":t=e.execution.lastProgress!==null?`Executing "${e.spec}", iteration ${e.execution.iteration}. Last progress: ${e.execution.lastProgress}. Continue with the current task.`:`Executing "${e.spec}", iteration ${e.execution.iteration}. Start the first task.`;break;case"BLOCKED":t=`Execution blocked: ${e.execution.lastProgress}. Ask the user to resolve.`;break;case"DONE":t=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:t=`Run \`${n("next")}\` to get started.`}return{protocol:`Run \`${n('next --answer="..."')}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:s.map(a=>a.id),resumeHint:t}},B=e=>{if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let s=new Date(e.lastCalledAt).getTime();if(Date.now()-s>$)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},ee=(e,s,t,a,c,p,i)=>{let f=F(e,s),l=a?.maxIterationsBeforeRestart??15,o=a?.allowGit??!1,u=U(e,l,o,c),h=B(e),r;switch(e.phase){case"IDLE":r=N(s,S,t.length,i);break;case"DISCOVERY":r=V(e,s,t);break;case"DISCOVERY_REVIEW":r=M(e,s);break;case"SPEC_DRAFT":r=Q(e);break;case"SPEC_APPROVED":r=j(e);break;case"EXECUTING":r=H(e,s,t,l,c,p);break;case"BLOCKED":r=K(e);break;case"DONE":r=z(e);break;default:r=N(s,S,t.length,i)}let d={...r,meta:f,behavioral:u};h!==void 0&&(d={...d,protocolGuide:h});let y=Y(e,s,i);if(y.length>0){let E=y.map(({label:w,description:D})=>({label:w,description:D})),v={};for(let w of y)v[w.label]=w.command;d={...d,interactiveOptions:E,commandMap:v}}return d},Y=(e,s,t)=>{switch(e.phase){case"IDLE":{let a=[],p=(t?.existingSpecs??[]).filter(i=>i.phase!=="DONE");s.length===0&&a.push({label:"Add concerns (Recommended)",description:"Shape how discovery and specs work by adding project concerns",command:n("concern add <id> [<id2> ...]")}),a.push({label:"Start a new spec",description:"Begin discovery questions for a new feature",command:n('spec new "description"')});for(let i of p.slice(0,2))a.push({label:`Continue: ${i.name} (${i.phase})`,description:i.detail??`Iteration ${i.iteration}`,command:n(`spec switch ${i.name}`)});return s.length>0&&a.push({label:"Edit concerns",description:`Currently: ${s.map(i=>i.id).join(", ")}`,command:n("concern list")}),a.slice(0,4)}case"DISCOVERY_REVIEW":return[{label:"Approve all answers",description:"Answers look correct \u2014 generate the spec",command:n('next --answer="approve"')},{label:"Revise answers",description:"Correct one or more discovery answers",command:n(`next --answer='{"revise":{...}}'`)}];case"SPEC_DRAFT":return[{label:"Approve spec",description:"Review looks good \u2014 approve and move to execution",command:n("approve")},{label:"Refine spec",description:"Submit refinements to improve tasks or sections",command:n(`next --answer='{"refinement":"..."}'`)},{label:"Start over",description:"Reset the spec and start fresh",command:n("reset")}];case"SPEC_APPROVED":return[{label:"Start execution",description:"Begin working through the spec tasks",command:n('next --answer="start"')},{label:"Reset",description:"Discard this spec and start over",command:n("reset")}];case"EXECUTING":return[];case"BLOCKED":return[{label:"Resolve block",description:"Provide a resolution to unblock execution",command:n('next --answer="resolution"')},{label:"Reset spec",description:"Abandon this spec and start over",command:n("reset")}];case"DONE":return[{label:"New spec",description:"Start a new feature spec",command:n('spec new "description"')},{label:"Check status",description:"Review completed spec summary",command:n("status")}];default:return[]}},W="noskills is a state-machine orchestrator that acts as a scrum master for both you and your agent \u2014 keeping work focused, decisions in your hands, and tokens efficient.",N=(e,s,t,a)=>({phase:"IDLE",instruction:"Present the welcome dashboard and interactive options to the user. Show existing specs if any, then present choices. IMPORTANT: Present ALL available concerns to the user \u2014 never truncate the list. Split across multiple AskUserQuestion calls if needed.",welcome:W,existingSpecs:a?.existingSpecs??[],availableConcerns:s.map(c=>({id:c.id,description:c.description})),activeConcerns:e.map(c=>c.id),activeRulesCount:a?.rulesCount??t,hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),V=(e,s,t)=>{let a=C(s),c=e.discovery.answers.length,p=P(e.discovery.answers),i=e.discovery.audience==="agent";if(p)return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${n("approve")}\``,questions:[],answeredCount:c,context:{rules:t,concernReminders:[]},transition:{onComplete:n("approve")}};if(i){let o=e.discovery.currentQuestion,u=a[o];if(u===void 0)return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${n("approve")}\``,questions:[],answeredCount:c,context:{rules:t,concernReminders:[]},transition:{onComplete:n("approve")}};let h={id:u.id,text:u.text,concerns:[...u.concerns],extras:u.extras.map(r=>r.text)};return{phase:"DISCOVERY",instruction:`Ask this question to the user using AskUserQuestion. Submit the answer with: \`${n('next --agent --answer="<answer>"')}\``,questions:[h],answeredCount:c,currentQuestion:o,totalQuestions:a.length,context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n('next --agent --answer="<answer>"')}`}}}let f=new Set(e.discovery.answers.map(o=>o.questionId));return{phase:"DISCOVERY",instruction:"Conduct a thorough discovery conversation. FIRST: perform a pre-discovery codebase scan (README, CLAUDE.md, recent git log, TODOs, directory structure) and present a brief audit summary. THEN: challenge the user's spec description against your findings. THEN: ask the discovery questions one at a time, offering concrete options based on codebase knowledge. AFTER questions: present a dream state table (current \u2192 this spec \u2192 future), scored expansion proposals, architectural decisions, and an error/rescue map. FINALLY: present a complete discovery synthesis for user confirmation before submitting answers as a JSON object.",questions:a.filter(o=>!f.has(o.id)).map(o=>({id:o.id,text:o.text,concerns:[...o.concerns],extras:o.extras.map(u=>u.text)})),answeredCount:c,context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n(`next --answer='{"status_quo":"...","ambition":"...",...}'`)}`}}},M=(e,s)=>{let t=C(s);return{phase:"DISCOVERY_REVIEW",instruction:"Present ALL discovery answers to the user for review. The user must confirm or correct each answer before the spec can be generated. Use AskUserQuestion to ask for confirmation.",answers:e.discovery.answers.map(c=>{let p=t.find(i=>i.id===c.questionId);return{questionId:c.questionId,question:p?.text??c.questionId,answer:c.answer}}),transition:{onApprove:n('next --answer="approve"'),onRevise:n(`next --answer='{"revise":{"status_quo":"corrected answer"}}'`)}}},Q=e=>e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${n(`next --answer='{"involvesWebUI":false,"involvesCLI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesWebUI",label:"Web/Mobile UI \u2014 layouts, responsive design, visual components"},{id:"involvesCLI",label:"CLI/Terminal UI \u2014 spinners, progress bars, interactive prompts"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+n(`next --answer='{"involvesWebUI":true,"involvesCLI":false,"involvesPublicAPI":false,...}'`)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:n("approve")}},j=e=>({phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${n('next --answer="start"')}`}}),G=(e,s)=>{if(s===null)return!1;let t=e.toLowerCase();return t.includes("mobile")||t.includes("layout")||t.includes("interaction design")?s.involvesWebUI:t.includes("ui state")||t.includes("skeleton ui")?s.involvesWebUI||s.involvesCLI:t.includes("api doc")||t.includes("public api")?s.involvesPublicAPI:t.includes("migration")||t.includes("backward compat")||t.includes("deprecat")?s.involvesMigration:t.includes("audit trail")||t.includes("access control")||t.includes("data handling")||t.includes("data retention")?s.involvesDataHandling:!0},X=(e,s,t,a,c,p,i,f)=>{let l=[],o=new Set(f??[]),u=0,h=()=>`ac-${++u}`;if(a!==null)for(let r of a.items)o.has(r.id)||l.push({id:r.id,text:`[DEBT from iteration ${r.since}] ${r.text}`});if(s&&l.push({id:h(),text:`[FAILED] Tests \u2014 fix this first: ${t.slice(0,200)}`}),p!=null)for(let r of p.verification){let d=h();o.has(d)||l.push({id:d,text:r})}for(let r of e)if(r.acceptanceCriteria!==void 0&&r.acceptanceCriteria.length>0)for(let d of r.acceptanceCriteria){if(!G(d,c))continue;let y=h();o.has(y)||l.push({id:y,text:`(${r.id}) ${d}`})}if(i!==void 0)for(let r of i){let d=h();o.has(d)||l.push({id:d,text:`(folder: ${r.folder}) ${r.rule}`})}return l},H=(e,s,t,a,c,p)=>{let i=O(s),f=e.execution.iteration>=a,l=e.execution.lastVerification?.passed===!1,o=e.execution.lastVerification?.output??"",u=c?.tasks??[],h=e.execution.completedTasks??[],r=new Set(h),d=u.find(m=>!r.has(m.id))??null,y=d!==null?{id:d.id,title:d.title,totalTasks:u.length,completedTasks:h.length}:void 0;if(e.execution.awaitingStatusReport){let m=X(s,l,o,e.execution.debt,e.classification,c,p,e.execution.naItems),k={phase:"EXECUTING",instruction:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:m,reportFormat:{completed:"list item IDs you finished (e.g., ['debt-1', 'ac-3']) with evidence",remaining:"list item IDs not yet done",blocked:"list item IDs that need a decision from the user",na:"(optional) list item IDs that are not applicable to this task \u2014 they will be removed from future criteria",newIssues:"(optional) list NEW issues discovered during implementation \u2014 free text, will be assigned debt IDs automatically"}}};return l&&(k={...k,verificationFailed:!0,verificationOutput:o.slice(0,2e3)}),k}let E=(e.execution.lastProgress??"").includes("Task not accepted"),v=e.execution.debt?.items??[],w=e.execution.debt?.unaddressedIterations??0,D=y!==void 0?`Execute task ${y.id}: ${y.title} (${y.completedTasks}/${y.totalTasks} completed)`:"All tasks completed. Run `"+n("done")+"` to finish.",I;if(l)I="Verification FAILED. Fix the failing tests before continuing.";else if(E&&v.length>0){let m=w>=3?` These items have been outstanding for ${w} iterations.`:"";I=`Task not accepted \u2014 ${v.length} remaining item(s) must be addressed before this task can be completed.${m} Address them, then submit a new status report.`}else I=D;let g={phase:"EXECUTING",instruction:I,task:y,context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n('next --answer="..."')}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration}};if(E&&v.length>0&&(g={...g,taskRejected:!0,rejectionReason:`${v.length} remaining item(s) must be addressed.`,rejectionRemaining:v.map(m=>m.text)}),e.execution.debt!==null&&e.execution.debt.items.length>0){let m=e.execution.debt.unaddressedIterations??0,k=m>=3?`URGENT: These items have been unaddressed for ${m} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";g={...g,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:k}}}if(l){let m=o.slice(0,2e3);g={...g,verificationFailed:!0,verificationOutput:m}}i.length>0&&(g={...g,concernTensions:i}),f&&(g={...g,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${n("next")}\` to resume - your progress is saved.`});let b=[...e.decisions].reverse().find(m=>!m.promoted);return b!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(g={...g,promotePrompt:{decisionId:b.id,question:b.question,choice:b.choice,prompt:`You just resolved a decision: "${b.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${n(`rule add "${b.choice}"`)}\``}}),g},K=e=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${n('next --answer="..."')}`}}),z=e=>({phase:"DONE",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length}});export{T as a,C as b,P as c,ee as d};
@@ -0,0 +1,4 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{b as f}from"./chunk-4QDEJUAF.js";import{c as h}from"./chunk-NEHZOG23.js";import{i as d}from"./chunk-WJKE6XHF.js";var m=l=>{let i=l.split(/\n/).flatMap(t=>t.trim().length>0?[t.trim()]:[]);return i.length>1?i:l.split(/\.\s+|;\s+/).map(t=>t.trim()).filter(t=>t.length>5)},w=(l,i=[])=>{let t=[],r=l.find(e=>e.questionId==="ambition");if(r!==void 0){let e=r.answer,a=e.match(/10[- ]?star[:\s]+(.+)/i),p=a!==null?a[1].trim():e,u=p.split(/\n/).map(n=>n.trim()).filter(n=>n.length>0),s;u.length>1?s=u.map(n=>n.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(n=>n.length>3):s=p.split(/\.\s+/).map(n=>n.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(n=>n.length>3);for(let n of s){let c=n.replace(/^(the|a|an|with|plus|also)\s+/i,"").trim();c=c.replace(/^(the\s+)?(target|goal|objective)[:\s]+/i,"").trim(),c=c.charAt(0).toUpperCase()+c.slice(1),c=c.replace(/[.\u2026]+$/,"").trim();let v=/^[A-Z][a-z]+\s/.test(c)&&/^(Add|Create|Build|Implement|Set up|Configure|Enable|Update|Remove|Refactor|Extract|Fix|Write|Design|Integrate|Support|Replace|Migrate)\s/i.test(c);c.length>100&&!v&&(c=`Implement ${c.charAt(0).toLowerCase()}${c.slice(1)}`,c.length>140&&(c=c.slice(0,137)+"...")),c.length>3&&t.push(c)}}let o=l.find(e=>e.questionId==="verification");if(o!==void 0){let e=o.answer.split(/\n/).map(a=>a.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(a=>a.length>0);for(let a of e)t.push(a)}for(let e of i){let a=e.choice.toLowerCase();if(a.includes("accepted")||a.includes("add to scope")){let p=e.question.replace(/^should\s+(we|i)\s+/i,"").replace(/\?+$/,"").trim(),u=p.charAt(0).toUpperCase()+p.slice(1);t.push(u)}}return t.length===0&&t.push("_Tasks need to be defined before execution. Add tasks manually or run discovery with more detail._"),t},S=(l,i)=>{let t={};if(i===null){for(let r of l.specSections)t[r]=!1;return t}for(let r of l.specSections){let o=r.toLowerCase();o.includes("design")||o.includes("mobile")||o.includes("layout")||o.includes("interaction")?t[r]=i.involvesWebUI:o.includes("contributor")||o.includes("public api")||o.includes("api surface")?t[r]=i.involvesPublicAPI:o.includes("migration")||o.includes("deprecation")||o.includes("backward")||o.includes("compatibility")?t[r]=i.involvesMigration:o.includes("audit")||o.includes("access control")||o.includes("data handling")?t[r]=i.involvesDataHandling:t[r]=!0}return t},g=(l,i,t,r,o)=>{let e=[];e.push(`# Spec: ${l}`),e.push(""),e.push("## Status: draft"),e.push(""),t.length>0&&(e.push(`## Concerns: ${t.map(s=>s.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let s of i)e.push(`### ${s.questionId}`),e.push(""),e.push(s.answer),e.push("");for(let s of t)if(s.specSections.length>0){let n=S(s,o??null);for(let c of s.specSections)n[c]!==!1&&(e.push(`## ${c} (${s.id})`),e.push(""),e.push("_To be addressed during execution._"),e.push(""))}if(r.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let s=0;s<r.length;s++){let n=r[s];e.push(`| ${s+1} | ${n.question} | ${n.choice} | ${n.promoted?"yes":"no"} |`)}e.push("")}let a=i.find(s=>s.questionId==="scope_boundary");if(a!==void 0){e.push("## Out of Scope"),e.push("");let s=m(a.answer);for(let n of s)e.push(`- ${n}`);e.push("")}let p=w(i,r);e.push("## Tasks"),e.push("");for(let s=0;s<p.length;s++)e.push(`- [ ] task-${s+1}: ${p[s]}`);e.push("");let u=i.find(s=>s.questionId==="verification");if(e.push("## Verification"),e.push(""),u!==void 0){let s=m(u.answer);for(let n of s)e.push(`- ${n}`)}else e.push("_To be defined._");return e.push(""),e.join(`
3
+ `)};var D=async(l,i,t)=>{if(i.spec===null)throw new Error("No active spec");let r=`${l}/${h.specDir(i.spec)}`,o=`${l}/${h.specFile(i.spec)}`;await d.fs.mkdir(r,{recursive:!0});let e=g(i.spec,i.discovery.answers,t,i.decisions,i.classification);await d.fs.writeTextFile(o,e);let a=f(i.spec,e),p=`${r}/progress.json`,u={spec:i.spec,status:"draft",tasks:a.tasks.map(s=>({id:s.id,title:s.title,status:"pending"})),decisions:i.decisions.map(s=>({question:s.question,choice:s.choice,promoted:s.promoted})),debt:[],updatedAt:new Date().toISOString()};return await d.fs.writeTextFile(p,JSON.stringify(u,null,2)+`
4
+ `),o};export{D as a};