@testmuai/kane-cli 0.8.6 → 0.8.7

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 (247) hide show
  1. package/dist/{ChatSurface-S2P7WMBI.js → ChatSurface-3PEXML4X.js} +1 -1
  2. package/dist/{ChromeProfilePicker-7DTJK2QW.js → ChromeProfilePicker-E3CZ52RH.js} +1 -1
  3. package/dist/{CliFeedbackPrompt-Y3OYZX54.js → CliFeedbackPrompt-BEVZRLQA.js} +1 -1
  4. package/dist/{CliUploadProgress-I3N5WDNJ.js → CliUploadProgress-V2FLLVR6.js} +1 -1
  5. package/dist/ConfigView-ZOGKVFQT.js +2 -0
  6. package/dist/EvidenceViewOffer-KWX27WNZ.js +2 -0
  7. package/dist/FolderPicker-EIKQSSF6.js +2 -0
  8. package/dist/{InfoBox-QBXPPMM2.js → InfoBox-4TNE7QMG.js} +1 -1
  9. package/dist/{LinksBox-L24KON4U.js → LinksBox-TXO5X5UD.js} +1 -1
  10. package/dist/{ProfilesView-H6XCTIXI.js → ProfilesView-S4YPEZEF.js} +1 -1
  11. package/dist/{ProjectPicker-F6JGF2B3.js → ProjectPicker-LWFX2QT2.js} +1 -1
  12. package/dist/{SaveSessionPrompt-QGO65DZN.js → SaveSessionPrompt-MJTCIQIZ.js} +1 -1
  13. package/dist/SingleShotApp-5LCIH6DQ.js +2 -0
  14. package/dist/{SummaryBox-OZIZQY4B.js → SummaryBox-UIVK3QDR.js} +1 -1
  15. package/dist/TestMdRunView-RE5GX5QX.js +2 -0
  16. package/dist/{TestrunEvidenceTable-A7WTTKTV.js → TestrunEvidenceTable-GYGVNCYW.js} +1 -1
  17. package/dist/{WhoamiView-EB5AV27X.js → WhoamiView-NRGMMLL4.js} +1 -1
  18. package/dist/{app-download-SQ4RDY3E.js → app-download-HTQOD3YF.js} +1 -1
  19. package/dist/{auth-TW24FZQF.js → auth-5URO2XJU.js} +1 -1
  20. package/dist/{binary-5LMQJ3CZ.js → binary-2U4YTTFS.js} +1 -1
  21. package/dist/{bind-SJ6DOVQ4.js → bind-NO4TMSHJ.js} +3 -3
  22. package/dist/{bootstrap-BTEXO6HX.js → bootstrap-UOEW3VZM.js} +1 -1
  23. package/dist/bridge-P2EBLXPY.js +2 -0
  24. package/dist/{changelog-JLSLSA3Y.js → changelog-7BPYLUDK.js} +1 -1
  25. package/dist/chat-committer-GUK6IBCL.js +2 -0
  26. package/dist/{chat-controller-R4THYYPU.js → chat-controller-6GUUMUVP.js} +1 -1
  27. package/dist/{chunk-IWM5EZC3.js → chunk-2RO2BWCZ.js} +2 -2
  28. package/dist/chunk-3BY7MX3D.js +8 -0
  29. package/dist/{chunk-USI2WMAK.js → chunk-3IM5QGVV.js} +1 -1
  30. package/dist/{chunk-PT7V5WDQ.js → chunk-3YKNJIVB.js} +1 -1
  31. package/dist/{chunk-TKYJTXWL.js → chunk-44PZPNXJ.js} +1 -1
  32. package/dist/{chunk-FYS5VIOG.js → chunk-46HYKID6.js} +2 -2
  33. package/dist/{chunk-E5S4BASB.js → chunk-4EFDEDTL.js} +1 -1
  34. package/dist/chunk-5ZV64NAG.js +5 -0
  35. package/dist/{chunk-QISE272H.js → chunk-6AUSG5SB.js} +1 -1
  36. package/dist/{chunk-ATWDQCDA.js → chunk-6YVVTYVO.js} +1 -1
  37. package/dist/{chunk-GC5U55MW.js → chunk-72J4V3DA.js} +1 -1
  38. package/dist/{chunk-ZLSWHCWO.js → chunk-76ILJPZF.js} +1 -1
  39. package/dist/{chunk-3UUPP5W3.js → chunk-7CU5EBC6.js} +1 -1
  40. package/dist/{chunk-KLTKEGDH.js → chunk-7EFG27IZ.js} +4 -4
  41. package/dist/{chunk-JCD6FP7A.js → chunk-7UCICMK7.js} +3 -3
  42. package/dist/{chunk-JN44V63O.js → chunk-7VAE7WXF.js} +2 -2
  43. package/dist/{chunk-TDS6LG6T.js → chunk-A66ZGHO2.js} +1 -1
  44. package/dist/chunk-AJXOJF2X.js +4 -0
  45. package/dist/{chunk-TZFT7R7B.js → chunk-AUERMBX5.js} +1 -1
  46. package/dist/{chunk-4NSP2NPT.js → chunk-B27X3C2E.js} +1 -1
  47. package/dist/chunk-B2KXIFZD.js +2 -0
  48. package/dist/{chunk-WMQJBEQP.js → chunk-BISBPWN3.js} +1 -1
  49. package/dist/{chunk-GELPKSLC.js → chunk-BPHQNTUD.js} +1 -1
  50. package/dist/{chunk-JFAFKHDX.js → chunk-BZAGVBCX.js} +1 -1
  51. package/dist/{chunk-2DCNCH32.js → chunk-C4OVX65Q.js} +1 -1
  52. package/dist/{chunk-SQGBFCFO.js → chunk-C5ZIKKIB.js} +1 -1
  53. package/dist/{chunk-DZCG7FFP.js → chunk-C765HUXU.js} +1 -1
  54. package/dist/{chunk-KQ2MYMOS.js → chunk-DJC6MLO4.js} +1 -1
  55. package/dist/{chunk-2R7KL7YG.js → chunk-DMOZM22N.js} +1 -1
  56. package/dist/{chunk-D4SRHIJ5.js → chunk-DSNB7EI6.js} +1 -1
  57. package/dist/{chunk-TQKIE7AX.js → chunk-DTBKKC2R.js} +1 -1
  58. package/dist/chunk-E5C3HUIY.js +2 -0
  59. package/dist/chunk-E5Q5CDOX.js +2 -0
  60. package/dist/{chunk-VOBXYDJW.js → chunk-E6AF53HZ.js} +42 -43
  61. package/dist/chunk-EU5ZH334.js +2 -0
  62. package/dist/{chunk-GFKCTYCA.js → chunk-F43KOMVB.js} +1 -1
  63. package/dist/{chunk-ZRKPZLLG.js → chunk-F7RR24BL.js} +1 -1
  64. package/dist/{chunk-MKSTP2XN.js → chunk-FVKLNQ4T.js} +2 -2
  65. package/dist/{chunk-ZGBSGZZM.js → chunk-GAO6ZMCT.js} +1 -1
  66. package/dist/chunk-GDB2V6QA.js +21 -0
  67. package/dist/{chunk-RX5TZZNQ.js → chunk-GJ6RJVXH.js} +1 -1
  68. package/dist/{chunk-XJILZ2WN.js → chunk-GYTZLUFV.js} +1 -1
  69. package/dist/{chunk-OYJBABRV.js → chunk-HAGJA7KG.js} +1 -1
  70. package/dist/{chunk-7KORP5FF.js → chunk-HEWWWMUN.js} +1 -1
  71. package/dist/{chunk-SQC4P2Q7.js → chunk-HHQ67JCU.js} +1 -1
  72. package/dist/chunk-HL4UXOHV.js +2 -0
  73. package/dist/{chunk-DUAXZYAD.js → chunk-HLXOYLZV.js} +3 -3
  74. package/dist/{chunk-Z35BUPZT.js → chunk-HO3T5LJH.js} +1 -1
  75. package/dist/{chunk-FJYDEWOA.js → chunk-IJABR5SX.js} +1 -1
  76. package/dist/chunk-ILKSL4PI.js +4 -0
  77. package/dist/{chunk-YZ45OEH3.js → chunk-IQBKCLLR.js} +1 -1
  78. package/dist/{chunk-KDXQNLVV.js → chunk-IRPAWAK7.js} +2 -2
  79. package/dist/{chunk-3LEVCW6R.js → chunk-K7VX6YIT.js} +1 -1
  80. package/dist/{chunk-7VZCXW74.js → chunk-LOMPRMG3.js} +1 -1
  81. package/dist/{chunk-5COGCNED.js → chunk-LRZXVDPY.js} +1 -1
  82. package/dist/chunk-LWZ7EIXX.js +2 -0
  83. package/dist/{chunk-YEQVJWEF.js → chunk-MROHDW4W.js} +1 -1
  84. package/dist/{chunk-OFW3ZVTP.js → chunk-N2N5T5JN.js} +1 -1
  85. package/dist/{chunk-TYI4MLFJ.js → chunk-NM6PEYED.js} +1 -1
  86. package/dist/{chunk-RZLD7TPG.js → chunk-NQFAZM2D.js} +1 -1
  87. package/dist/{chunk-EXERQHXV.js → chunk-OADHU5HL.js} +1 -1
  88. package/dist/{chunk-S66MCU2Y.js → chunk-OHD4CZXT.js} +1 -1
  89. package/dist/{chunk-SS5TOK2J.js → chunk-P4JUY54O.js} +1 -1
  90. package/dist/chunk-Q3S5EKX5.js +21 -0
  91. package/dist/{chunk-AFPHLUQ5.js → chunk-Q4CTSXDM.js} +1 -1
  92. package/dist/{chunk-A44G533S.js → chunk-QQ67Z4IW.js} +1 -1
  93. package/dist/{chunk-NT3UETTV.js → chunk-QZB7CBRO.js} +1 -1
  94. package/dist/{chunk-FUNKVREV.js → chunk-R2JRQD4I.js} +1 -1
  95. package/dist/{chunk-CLGC7VEO.js → chunk-SWXEBLKX.js} +1 -1
  96. package/dist/{chunk-IGJIDN4U.js → chunk-SZTUZZEA.js} +1 -1
  97. package/dist/{chunk-RDNKYRKY.js → chunk-T3DVIDBA.js} +1 -1
  98. package/dist/{chunk-B4Q6FMIP.js → chunk-T4LAHU57.js} +3 -3
  99. package/dist/{chunk-XY325HDJ.js → chunk-TKQSIKMR.js} +1 -1
  100. package/dist/{chunk-BN6AHQL7.js → chunk-TMFFHGCT.js} +4 -4
  101. package/dist/{chunk-FMUCZWS3.js → chunk-U35Y7SGB.js} +1 -1
  102. package/dist/{chunk-V444REBC.js → chunk-UASEGQ7B.js} +1 -1
  103. package/dist/{chunk-INK66XQS.js → chunk-UFYIQ4E3.js} +1 -1
  104. package/dist/chunk-UOLERTKE.js +2 -0
  105. package/dist/{chunk-VMCSRLRC.js → chunk-VHA7UNDW.js} +1 -1
  106. package/dist/{chunk-P3RKXL3V.js → chunk-VMRP44MN.js} +1 -1
  107. package/dist/{chunk-4ONGF4NT.js → chunk-VOXDZS4N.js} +1 -1
  108. package/dist/{chunk-6KPPGMO2.js → chunk-WNHLKDOT.js} +1 -1
  109. package/dist/chunk-X7R2JWOJ.js +4 -0
  110. package/dist/chunk-XAQ3Y63J.js +21 -0
  111. package/dist/chunk-YC2TFACE.js +5 -0
  112. package/dist/{chunk-AWD56KGX.js → chunk-YC6HYBLN.js} +1 -1
  113. package/dist/{chunk-AO3PBE2V.js → chunk-YDEK2FJQ.js} +1 -1
  114. package/dist/chunk-YGVY63PE.js +20 -0
  115. package/dist/chunk-YKYZKBMH.js +26 -0
  116. package/dist/{chunk-C4WTZSX4.js → chunk-YYSWJU6H.js} +1 -1
  117. package/dist/{chunk-VRVFPMCR.js → chunk-Z3EEMIVV.js} +1 -1
  118. package/dist/{chunk-YHTYPTDD.js → chunk-Z7HUW3L4.js} +1 -1
  119. package/dist/chunk-Z7S3IWUX.js +2 -0
  120. package/dist/{chunk-CLLQQPBZ.js → chunk-ZFRWVWUR.js} +1 -1
  121. package/dist/{chunk-DN3E6RT6.js → chunk-ZH2ROVHE.js} +2 -2
  122. package/dist/committer-JC6BIBNR.js +2 -0
  123. package/dist/{config-6TQIMTNB.js → config-XNDP425N.js} +1 -1
  124. package/dist/cover-cmd-HREOYWWD.js +3 -0
  125. package/dist/{credentials-ZSNM4BTD.js → credentials-ZTBWB3LK.js} +1 -1
  126. package/dist/{deps-bundle-D2ZC2SPT.js → deps-bundle-OHCYH5KL.js} +1 -1
  127. package/dist/{deps-resolve-VRBMFUTX.js → deps-resolve-K2NX2W3K.js} +1 -1
  128. package/dist/design-committer-IIHKNEYF.js +2 -0
  129. package/dist/device-ref-LAZWPRQN.js +2 -0
  130. package/dist/dispatch-JZWIFKRB.js +2 -0
  131. package/dist/doctor-XXOGVMAI.js +2 -0
  132. package/dist/dossier-2M62K2PA.js +3 -0
  133. package/dist/evidence-FN2SQB6Z.js +2 -0
  134. package/dist/evolve-cmd-WQB7E2B5.js +2 -0
  135. package/dist/{explain-UAAQWHYR.js → explain-AOZNHWMB.js} +1 -1
  136. package/dist/{explain-cmd-2TKO7GRW.js → explain-cmd-2SCD5T6U.js} +1 -1
  137. package/dist/{explain-cmd-EX24XKD6.js → explain-cmd-7VTWRROR.js} +1 -1
  138. package/dist/{extract-bind-TJ2STXV5.js → extract-bind-3YXY7ZU2.js} +3 -3
  139. package/dist/{extract-cmd-FLOYO6HL.js → extract-cmd-WGXEJ54C.js} +2 -2
  140. package/dist/{feeder-C3TOJPKK.js → feeder-GVZSWX6Q.js} +1 -1
  141. package/dist/gaps-cmd-MFZ52DC7.js +3 -0
  142. package/dist/{generate-headless-DBT4MKQT.js → generate-headless-PCNAJ2LS.js} +2 -2
  143. package/dist/index.js +137 -131
  144. package/dist/ingest-TTSDUMH5.js +2 -0
  145. package/dist/ingest-cmd-D2MD6EAK.js +2 -0
  146. package/dist/install-RHINEFR5.js +2 -0
  147. package/dist/{interactive-bind-7UDJY4CF.js → interactive-bind-ZFMG2JIX.js} +4 -4
  148. package/dist/lifecycle-cmd-5FRGYY3M.js +2 -0
  149. package/dist/list-cmd-DD4WYJSH.js +3 -0
  150. package/dist/{list-commands-DA4ZXOPJ.js → list-commands-64THS67Y.js} +1 -1
  151. package/dist/logical-ids-U2OUMYCP.js +2 -0
  152. package/dist/login-flow-B5J6JXQN.js +2 -0
  153. package/dist/{maintenance-cmd-6XSVO6FO.js → maintenance-cmd-7V44VGL4.js} +1 -1
  154. package/dist/{mobile-prompts-JS7GPVKS.js → mobile-prompts-RITBS32L.js} +1 -1
  155. package/dist/{persist-recorded-session-LE3LGFOS.js → persist-recorded-session-Z5SCYWXR.js} +1 -1
  156. package/dist/phase-seed-ATH337WF.js +2 -0
  157. package/dist/pipeline-HMFLLUZJ.js +2 -0
  158. package/dist/prepare-target-HOEFIKXN.js +2 -0
  159. package/dist/readmodel-UZETCXV6.js +2 -0
  160. package/dist/reconcile-cmd-Q7CBNPRX.js +2 -0
  161. package/dist/reconcile-deps-XEUZHUQX.js +4 -0
  162. package/dist/reconcile-engine-ES2INERY.js +2 -0
  163. package/dist/{recording-banner-YMKWR3M3.js → recording-banner-NLS7K2RV.js} +1 -1
  164. package/dist/records-XWF6KDQH.js +2 -0
  165. package/dist/registry-E5RSXYQJ.js +2 -0
  166. package/dist/{require-project-folder-3KS7KTME.js → require-project-folder-V4F74R4A.js} +1 -1
  167. package/dist/resolve-run-intent-WSOCGJUN.js +2 -0
  168. package/dist/{resolver-V5VP5FLT.js → resolver-7EAM4A6O.js} +1 -1
  169. package/dist/revert-2UCOMQ4J.js +2 -0
  170. package/dist/review-cmd-VN6VGUWJ.js +4 -0
  171. package/dist/run-45ODACZR.js +2 -0
  172. package/dist/run-ZYARNPAS.js +2 -0
  173. package/dist/{run-test-md-FO2RNNOD.js → run-test-md-CPGKD3DD.js} +2 -2
  174. package/dist/{sessions-cmd-ZZIZN2VB.js → sessions-cmd-ME7NM6ES.js} +1 -1
  175. package/dist/{skill-installer-W4TT5MST.js → skill-installer-WEV2M32J.js} +1 -1
  176. package/dist/{spawner-ZSYJQGQW.js → spawner-GG6YQB4A.js} +1 -1
  177. package/dist/{structured-answers-5EY2AZN7.js → structured-answers-2WOTULBQ.js} +1 -1
  178. package/dist/tcg-generate-DASCY23M.js +2 -0
  179. package/dist/{testmd-actions-NPILETCQ.js → testmd-actions-X6HEL5NH.js} +1 -1
  180. package/dist/token-refresh-ZTQFC3Q3.js +2 -0
  181. package/dist/{validate-basic-727KRHX6.js → validate-basic-QJL4DCKY.js} +1 -1
  182. package/dist/verdicts-CRNN765C.js +2 -0
  183. package/dist/{version-check-A2JQYRI2.js → version-check-KONSQ4M3.js} +1 -1
  184. package/dist/{view-cmd-KPJTP4DI.js → view-cmd-ZSMU4I4J.js} +1 -1
  185. package/dist/walk-session-X2N4XHLU.js +2 -0
  186. package/dist/{with-telemetry-HSD6CXDS.js → with-telemetry-Y6MVROKX.js} +1 -1
  187. package/package.json +11 -11
  188. package/dist/ConfigView-EOYCKYJS.js +0 -2
  189. package/dist/EvidenceViewOffer-AQ3KB3EN.js +0 -2
  190. package/dist/FolderPicker-RCHRYYC4.js +0 -2
  191. package/dist/SingleShotApp-AY3XFEYT.js +0 -2
  192. package/dist/TestMdRunView-RPW4MIJA.js +0 -2
  193. package/dist/bridge-GQJ35GTL.js +0 -2
  194. package/dist/chat-committer-ZWWCLJFD.js +0 -2
  195. package/dist/chunk-3Q6WAK6P.js +0 -2
  196. package/dist/chunk-B5QGIUJA.js +0 -26
  197. package/dist/chunk-BRTARADN.js +0 -4
  198. package/dist/chunk-CZUOGGUK.js +0 -2
  199. package/dist/chunk-DEZ7CXGM.js +0 -21
  200. package/dist/chunk-ESC7AOCX.js +0 -2
  201. package/dist/chunk-LN7233E2.js +0 -20
  202. package/dist/chunk-LQQXPY5B.js +0 -4
  203. package/dist/chunk-Q4V2GK5U.js +0 -2
  204. package/dist/chunk-QBG7XEGQ.js +0 -15
  205. package/dist/chunk-QQAAPFIR.js +0 -2
  206. package/dist/chunk-R5T4RLF5.js +0 -2
  207. package/dist/chunk-SORVX3KI.js +0 -7
  208. package/dist/chunk-TH47OOBV.js +0 -4
  209. package/dist/chunk-TRJUD3XJ.js +0 -5
  210. package/dist/chunk-VAYBKR76.js +0 -4
  211. package/dist/chunk-XQFITNA3.js +0 -2
  212. package/dist/chunk-ZSXDZI56.js +0 -20
  213. package/dist/committer-SWEWEYNX.js +0 -2
  214. package/dist/cover-cmd-7JILZJUK.js +0 -3
  215. package/dist/design-committer-VYT6NU3T.js +0 -2
  216. package/dist/dispatch-2PBSJ7YW.js +0 -2
  217. package/dist/doctor-OWRRDA4Z.js +0 -2
  218. package/dist/dossier-KTLTGT2X.js +0 -3
  219. package/dist/evidence-NDAKCCHQ.js +0 -2
  220. package/dist/evolve-cmd-DIA5EWUT.js +0 -2
  221. package/dist/gaps-cmd-3ZX3PZF4.js +0 -3
  222. package/dist/ingest-JO5NJENZ.js +0 -2
  223. package/dist/ingest-cmd-T6HM3AHK.js +0 -2
  224. package/dist/install-NIVU4XVS.js +0 -2
  225. package/dist/lifecycle-cmd-O2324GN6.js +0 -2
  226. package/dist/list-cmd-N4KMA34H.js +0 -3
  227. package/dist/logical-ids-TEBCQJGO.js +0 -2
  228. package/dist/login-flow-NHBJVDW6.js +0 -2
  229. package/dist/phase-seed-DIRETNU6.js +0 -2
  230. package/dist/pipeline-MTAZDCZR.js +0 -2
  231. package/dist/prepare-target-YK2DLDWB.js +0 -2
  232. package/dist/readmodel-XOYGGQ3S.js +0 -2
  233. package/dist/reconcile-cmd-CYRYVS5B.js +0 -2
  234. package/dist/reconcile-deps-FYXRAMF2.js +0 -4
  235. package/dist/reconcile-engine-6AT6EVGS.js +0 -2
  236. package/dist/records-IOZTZUZV.js +0 -2
  237. package/dist/registry-V45ZQ6Q5.js +0 -2
  238. package/dist/resolve-run-intent-W32G6WM6.js +0 -2
  239. package/dist/revert-NQ7GEVSE.js +0 -2
  240. package/dist/review-cmd-DQRKQUMG.js +0 -4
  241. package/dist/run-26IR3CKX.js +0 -2
  242. package/dist/run-5IYI2TJI.js +0 -2
  243. package/dist/tcg-generate-ONLV5GXG.js +0 -2
  244. package/dist/token-refresh-G2CSTY4B.js +0 -2
  245. package/dist/types-O23GN2YM.js +0 -2
  246. package/dist/verdicts-TDJLJJ3F.js +0 -2
  247. package/dist/walk-session-HB3OOWVR.js +0 -2
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{d as Y,f as q,h as H}from"./chunk-SQC4P2Q7.js";import{a as O,b as j,c as z}from"./chunk-FMUCZWS3.js";import{d as B,f as R}from"./chunk-LN7233E2.js";import{b as _,c as N,j as M}from"./chunk-DN3E6RT6.js";import{a as L}from"./chunk-TZXXJWHA.js";import{m as b}from"./chunk-56PAQAX5.js";import{a as G,b as C,c as K}from"./chunk-XY325HDJ.js";import{h as J}from"./chunk-TAOHYWEO.js";import{a as F,b as $}from"./chunk-Q4V2GK5U.js";import{b as E}from"./chunk-OFW3ZVTP.js";import{createHash as be}from"crypto";import{readdir as Ce,stat as Te}from"fs/promises";import{basename as f,extname as Ie,join as Ae,relative as ke}from"path";import{createHash as de}from"crypto";import{createReadStream as le}from"fs";import{mkdir as ce,readFile as ue,rename as fe,writeFile as ge}from"fs/promises";import{dirname as me,join as he}from"path";var we=60,ve=5;function V(){return{entries:[]}}function X(){return he(E,"mobile","app-cache.json")}async function T(e){let r=de("sha256");for await(let t of le(e))r.update(t);return r.digest("hex")}function ye(){return{readFile:e=>ue(e,"utf8"),writeFile:async(e,r)=>{await ce(me(e),{recursive:!0});let t=`${e}.tmp`;await ge(t,r),await fe(t,e)},hashFile:T,now:()=>new Date}}function I(e){if(!e)return;let r=/\/(\d{4})\/(\d{2})\/(\d{2})\//.exec(e);if(!r)return;let[,t,a,s]=r,n=new Date(`${t}-${a}-${s}T00:00:00Z`);return Number.isNaN(n.getTime())?void 0:n.toISOString()}function Pe(e,r){if(!e.storedAt)return!0;let t=new Date(e.storedAt).getTime();return Number.isNaN(t)?!0:(r.getTime()-t)/864e5>=we-ve}var u=class{deps;constructor(r={}){this.deps={...ye(),...r}}async read(){try{let r=JSON.parse(await this.deps.readFile(X()));if(!r||typeof r!="object")return V();let t=r;return{entries:Array.isArray(t.entries)?t.entries:[]}}catch{return V()}}async write(r){await this.deps.writeFile(X(),JSON.stringify(r,null,2))}async hashOf(r){return this.deps.hashFile(r)}async lookup(r){return(await this.read()).entries.find(a=>a.sha256===r.sha256&&a.env===r.env&&a.orgId===r.orgId&&a.type===r.type)}async remember(r){let t=await this.read();t.entries=[...t.entries.filter(a=>!(a.sha256===r.sha256&&a.env===r.env&&a.orgId===r.orgId&&a.type===r.type)),r],await this.write(t)}async forget(r){let t=await this.read(),a=t.entries.length;t.entries=t.entries.filter(s=>!(s.sha256===r.sha256&&s.env===r.env&&s.orgId===r.orgId&&s.type===r.type)),t.entries.length!==a&&await this.write(t)}isNearExpiry(r){return Pe(r,this.deps.now())}};var Z={emulator:[".apk"],simulator:[".zip"]};function Q(e){return e.skipped===!0}function De(e,r){let t=Ie(e).toLowerCase();return t===".ipa"?`${f(e)} is a device build \u2014 .ipa is not accepted for ${r} runs.`:Z[r].includes(t)?null:`${f(e)} cannot be uploaded for a ${r} run \u2014 expected one of ${Z[r].join(", ")}.`}async function A(e,r){if(!(await Te(e)).isDirectory())return r.hashOf(e);let a=[],s=async i=>{for(let o of await Ce(i,{withFileTypes:!0})){let p=Ae(i,o.name);o.isDirectory()?await s(p):o.isFile()&&a.push(p)}};await s(e),a.sort();let n=be("sha256");for(let i of a)n.update(ke(e,i)),n.update("\0"),n.update(await T(i)),n.update("\0");return n.digest("hex")}async function W(e){let r=De(e.path,e.type);if(r)return{skipped:!0,reason:r};let t=e.cache??new u,a=e.client??new J(e.baseUrl,{...e.auth,orgId:e.orgId}),s;try{s=await A(e.path,t)}catch(o){return{skipped:!0,reason:`could not read ${f(e.path)}: ${o.message}`}}let n={sha256:s,env:e.env,orgId:e.orgId,type:e.type},i=await t.lookup(n);if(i){if(await a.liveness(i.appId)!=="gone")return{appId:i.appId,...i.appUrl?{appUrl:i.appUrl}:{},fromCache:!0};e.onProgress?.(`${i.appId} is no longer in the cloud \u2014 uploading again`),await t.forget(n)}try{e.onProgress?.(`uploading ${f(e.path)}\u2026`);let o=await a.upload(e.path,e.type);return await t.remember({sha256:s,env:e.env,orgId:e.orgId,type:e.type,appId:o.appId,...o.appUrl?{appUrl:o.appUrl}:{},...I(o.url)?{storedAt:I(o.url)}:{},sourcePath:e.path}),e.onProgress?.(o.cached?`${f(e.path)} already in the cloud (${o.appId})`:`${f(e.path)} uploaded (${o.appId})`),{appId:o.appId,...o.appUrl?{appUrl:o.appUrl}:{},fromCache:!1}}catch(o){return{skipped:!0,reason:o.message}}}function h(e){return`${e.platform}|${F(e)}`}var g=new Map,ee=new Set;function re(e){return ee.has(h(e))}function We(e,r,t){r.state==="stopped"&&(g.has(h(r))||ae(e,r,t))}async function te(e,r,t){let a=g.get(h(r));return a?(t?.(`waiting for ${r.displayName} to finish booting\u2026`),a):ae(e,r,t)}function ae(e,r,t){let a=h(r),s=e.prepare(r,t);g.set(a,s),r.state==="stopped"&&s.then(()=>ee.add(a),()=>{});let n=()=>{g.get(a)===s&&g.delete(a)};return s.then(n,n),s.catch(()=>{}),s}import{basename as xe}from"path";import{spawnSync as Ue}from"child_process";async function Se(e,r,t){if(!e.teardownPlan||!t.appPackage&&!t.shutdown)return;let a;try{a=await e.teardownPlan(r,t)}catch{return}a.length!==0&&b(`device:${r.id}`,()=>{Y({udid:r.id,displayName:r.displayName});for(let s of a)try{Ue(s.file,s.args,{timeout:3e4,stdio:"ignore"})}catch{}})}var oe={emulator:[".apk"],simulator:[".zip"]};async function Ee(e,r,t,a){if(e.kind==="package")return e;if(e.kind==="app_id"){let s=r.cloudUpload;if(!s)throw new Error(`${e.value} is an app id, which needs an account to download it. Log in, or pass a path to a local build instead.`);let n=await K({appId:e.value,baseUrl:s.baseUrl,auth:s.auth,...oe[t]?{accepts:oe[t]}:{},...a?{onProgress:a}:{}}),i=D(n.path);if(!i||i.kind==="app_id")throw new Error(`${n.name} is not a build this CLI can install (from ${e.value}).`);return i}try{let s=new u,n=await A(e.value,s),i=new G;await i.find(n)||a?.(`copying ${xe(e.value)} into the local app store\u2026`);let p=await i.put({key:n,sourcePath:e.value,source:"local"});return{...e,value:p.path}}catch{return e}}function Fe(e){b(`appium:${e}`,()=>{H({deviceClass:e,owner:process.pid})})}var k=class extends Error{constructor(r){super(r),this.name="MobileHostUnsupportedError"}},w=class extends Error{constructor(t,a){super(t);this.doctorText=a;this.name="MobilePreflightError"}};async function $e(e,r,t){let a=t.cloudUpload,s=await W({path:e,type:r,env:a.env,orgId:a.orgId,userId:a.userId,auth:a.auth,baseUrl:a.baseUrl,...t.onProgress?{onProgress:t.onProgress}:{}});if(Q(s)){t.onProgress?.(`app not uploaded \u2014 ${s.reason}`);return}return s.appId}var _e="app must be a build (.apk for an emulator, .zip of the .app bundle for a simulator) or an app id from your cloud uploads \u2014 a package id names something already installed on one device, so it cannot be uploaded, exported as code, or run anywhere else.",se=/\.(apk|zip)$/i;function D(e){let r=e.trim();if(C(r))return{kind:"app_id",value:r};let t=se.exec(r)?.[1]?.toLowerCase();return t?{kind:t,value:r}:null}function Ne(e){return!!e&&(se.test(e)||C(e.trim()))}function Me(e){return e.filter(r=>r.required&&r.status==="fail")}function Be(e,r){return!!r&&e.platform===r.platform&&e.kind===r.kind&&(e.id===r.id||e.virtualName===r.id)}async function mr(e){let r=L();if(!r.supported)throw new k(r.reason);let t=e.appiumUrl??e.defaults?.appium_url,a=!!(e.agent||!e.interactive),s=M();a&&e.platform?.toLowerCase()!=="ios"&&((await s.status("emulator")).installed||await s.ensure("emulator",{automatic:!0,onProgress:e.onProgress}));let n=await O(e.platform,{appiumUrl:t});if(z(n)){let d=n.sections.flatMap(P=>Me(P.checks)).map(P=>P.label).join(", ");throw new w(`Mobile toolchain not ready (${d}). Run \`kane-cli doctor --target ${e.platform?.toLowerCase()==="ios"?"simulator":e.platform?.toLowerCase()==="android"?"emulator":"<emulator|simulator>"}\` for details.`,j(n))}let i=await R({device:e.device,platform:e.platform,defaultTarget:e.defaults?.default_target,interactive:e.interactive}),o;if(i.ok)o=i.target;else if(i.reason==="needs-picker"&&e.pickTarget){let d=await e.pickTarget(i.candidates);if(!d)throw new Error("Target selection cancelled");o=d}else throw new Error(i.message);let p=B(o.platform);if(!p)throw new Error(`No provider for platform "${o.platform}"`);let l=_(o);if(!l)throw new Error(`No managed dependencies serve ${o.platform} ${o.kind} targets yet.`);try{await s.ensure(l,{automatic:a,onProgress:e.onProgress})}catch(d){throw d instanceof N?new w(d.message,d.message):d}let ie=o.state!=="ready"||re(o);o=await te(p,o,e.onProgress);let ne=await q(l,{...t?{appiumUrl:t}:{},device:{udid:o.id,displayName:o.displayName},onProgress:e.onProgress});Fe(l);let x=Be(o,e.defaults?.default_target)?e.defaults?.default_app:void 0,m=e.app??(Ne(x)?x:void 0);if(e.app&&!D(e.app))throw new Error(`${e.app}: ${_e}`);let c=m?D(m):null,U=c?await Ee(c,e,l,e.onProgress):null,v=U?await p.ensureApp(o,U,e.onProgress):void 0,y=c?.kind==="app_id"?c.value:e.cloudUpload&&c&&m?await $e(c.value,l,e):void 0;await Se(p,o,{shutdown:ie,...v?{appPackage:v}:{}});let pe=$(o,v,{noReset:e.noReset??e.defaults?.no_reset,appiumUrl:ne.url,autoGrantPermissions:e.defaults?.auto_grant_permissions,autoAcceptAlerts:e.defaults?.auto_accept_alerts}),S=y??m;return{device:pe,target:o,provider:p,...y?{appId:y}:{},...S?{appRef:S}:{}}}export{We as a,te as b,k as c,w as d,_e as e,D as f,Ne as g,mr as h};
@@ -1,20 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as p,c as d}from"./chunk-VZ7KXRXB.js";import{b as f}from"./chunk-IAHKTEET.js";var m=new Set(["delta","state-transition"]),b=/^capture baseline:/i;function g(e){return typeof e=="string"?e:e.text}function h(e){return typeof e=="object"&&e.baseline===!0||b.test(g(e).trim())}function v(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"derived"in e}function S(e,r){if(e.check_prose)return e.check_prose;let n=r.find(i=>i.ref===e.check.verified_against),t=n?.text?` \u2014 the stated promise: ${n.text}`:"",o=String(e.check.operand??e.check.within??e.check.metric??"");return e.check.kind==="forbidden-presence"?`Confirm '${o}' does NOT appear (forbidden-presence)${t}`:`Confirm ${e.check.kind} check: ${o} (${e.check.operator})${t}`}var y=/^## Step \d+ — assert\s*$/;function B(e,r){if(r.length===0)return e;let n=e.split(`
3
- `);for(let t=n.length-1;t>=0;t--){if(/^## Step \d+ — assert @verifies /.test(n[t]))return e;if(y.test(n[t]))return n[t]=`${n[t].trimEnd()} @verifies ${r.join(", ")}`,n.join(`
4
- `)}return e}function C(e,r){return r.size===0?e:e.split(`
5
- `).map(n=>{let t=n.match(/^@import\s+(\S+)\s*$/);if(t&&r.has(t[1]))return`@import ${r.get(t[1])}`;let o=n.match(/^## Import: (\S+)\s*$/);return o&&r.has(o[1])?`## Import: ${r.get(o[1])}`:n}).join(`
6
- `)}function D(e,r,n){if(m.has(e.check.kind)&&!e.steps.some(h))throw new Error(`emitTestMd: check kind '${e.check.kind}' needs a baseline-capture step before the action (a step starting 'capture baseline: <metric>' or { baseline: true }) \u2014 the validator should have caught this`);let t=[`# ${e.title}`,""];r.intent&&t.push(`> ${r.intent}`,"");for(let u of e.reuses??[])t.push(`## Import: ${u}`,"",`@import ${u}`,"");let o=[],i=0;for(let u of e.steps){i++;let a=g(u).trim();t.push(`## Step ${i}`,"",a,""),o.push({step:i,objective:a,...h(u)?{baseline:!0}:{}})}i++;let s=S(e,n),c=e.check.expected_mode??(v(e.check.operand)?"runtime-derived":"inferred");t.push(`## Step ${i} \u2014 assert`,"",s,""),o.push({step:i,objective:s,check:{kind:e.check.kind,operator:e.check.operator,...e.check.operand!==void 0?{operand:e.check.operand}:{},...m.has(e.check.kind)?{baseline:e.check.baseline??null}:{},...e.check.within!==void 0?{within:e.check.within}:{},...e.check.metric!==void 0?{metric:e.check.metric}:{},...e.check.threshold!==void 0?{threshold:e.check.threshold}:{},...e.check.unit!==void 0?{unit:e.check.unit}:{},verified_against:e.check.verified_against,expected_mode:c,review_required:e.check.review_required??c==="runtime-derived"}});let l=d({title:e.title,...r.title?{scenario:r.title}:{},objectives:o},{sortKeys:!0,lineWidth:-1});return{test_md:t.join(`
7
- `),objectives_yaml:l}}function G(e){let n=e.replace(/\r\n/g,`
8
- `).split(`
9
- `).map(i=>i.replace(/[ \t]+$/,""));if(n[0]?.trim()==="---"){let i=n.slice(1).findIndex(s=>s.trim()==="---");if(i>=0){let s=p(n.slice(1,i+1).join(`
10
- `))??{},c="assurance"in s;delete s.assurance,Object.keys(s).length===0&&c?n=n.slice(i+2):n=["---",...d(s,{sortKeys:!0,lineWidth:-1}).trimEnd().split(`
11
- `),"---",...n.slice(i+2)]}}let t=[];for(let i of n)i===""&&t[t.length-1]===""||t.push(i);for(;t[0]==="";)t.shift();for(;t[t.length-1]==="";)t.pop();let o=t.join(`
12
- `)+`
13
- `;return"sha256:"+f(Buffer.from("assurance.testdef\0"+o,"utf8"))}import{existsSync as $,readFileSync as E}from"fs";import{dirname as w,isAbsolute as I,resolve as j}from"path";var k=/^@import\s+(\S+)\s*$/;function _(e){let r=new Set;for(let n=0;n<e.length;n++)if(k.test(e[n].trim()))for(let t=n-1;t>=0;t--){let o=e[t].trim();if(o!==""){o==="```"&&r.add(n);break}}return r}function R(e,r,n=new Set,t=0){if(t>10)return e;let o=e.split(`
14
- `),i=_(o);return o.map((s,c)=>{let l=k.exec(s.trim());if(!l||i.has(c))return s;let u=r(l[1]);if(!u||n.has(u.cycleKey))return s;let a=new Set(n);return a.add(u.cycleKey),R(u.body.trimEnd(),u.next,a,t+1)}).join(`
15
- `)}function A(e){return r=>{let n=e.resolve(r);if(!n)return null;let t=e.getNode(n.tip)?.content.test_md_blob;return t?{body:t,cycleKey:n.tip,next:A(e)}:null}}function K(e,r){return n=>{let t=I(n)?n:j(e,n);if(!$(t))return null;let o=E(t,"utf8"),i=T(o);return!i||!r.resolve(i)?null:{body:M(o),cycleKey:t,next:K(w(t),r)}}}function L(e){let r=x(e);if(!r)return null;let n=/^assurance:\s*$[\s\S]*?^\s+id:\s*(\S+)\s*$/m.exec(r.text);if(!n)return null;let t=/^assurance:\s*$[\s\S]*?^\s+base:\s*(\S+)\s*$/m.exec(r.text);return{id:n[1],...t?{base:t[1]}:{}}}function T(e){return L(e)?.id??null}function x(e){let r=e.split(`
16
- `);if(r[0]?.trim()!=="---")return null;for(let n=1;n<r.length;n++)if(r[n].trim()==="---")return{text:r.slice(1,n).join(`
17
- `),endLine:n};return null}function M(e){let r=x(e);if(!r)return e;let n=e.split(`
18
- `),t=n.slice(1,r.endLine),o=[],i=!1;for(let c of t){if(/^assurance:\s*$/.test(c)||/^assurance:\s*\{/.test(c)){i=!0;continue}i&&/^\s+\S/.test(c)||(i=!1,o.push(c))}let s=n.slice(r.endLine+1).join(`
19
- `);return o.every(c=>c.trim()==="")?s:["---",...o,"---",s].join(`
20
- `)}export{v as a,B as b,C as c,D as d,G as e,k as f,_ as g,R as h,A as i,K as j,L as k,M as l};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{e as b,f as c,g as d,h as e,i as f,j as g,k as h,l as i,m as j,n as k,o as l,p as m,q as n,r as o,s as p,t as q,u as r}from"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import{h as a}from"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";export{b as SLUG_RE,c as checkAcyclic,d as checkCardinality,e as citesOf,q as commitDeferGap,o as commitNames,n as commitPairMerge,l as commitProposal,p as commitRetire,m as commitReviewFacts,f as criteriaShape,i as mintEventId,j as nextEventIds,a as recordsSince,r as resolveDeferGaps,k as resolveLivingTip,g as validateCriterionOps,h as validateProposal};
@@ -1,3 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as O}from"./chunk-DYW5C6II.js";import{a as g,b as S,d as G}from"./chunk-OS4VSIHT.js";import"./chunk-5DT7PIGB.js";import{e as w,f as $}from"./chunk-5GUD3CIH.js";import{d as x}from"./chunk-XWKUZJCP.js";import{e as k}from"./chunk-EHN5HTUD.js";import"./chunk-CH273NAE.js";import{b}from"./chunk-VZ7KXRXB.js";import{A as R}from"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";import{basename as h}from"path";import{statSync as A}from"fs";function C(t,e){if(!t)return 1;let o=t.resolve(e);return!o||o.superseded?1:t.getNode(o.tip)?.content.risk==="high"?3:1}function D(t,e){return t.usecases.map(o=>{let s=o.acceptance_criteria??[],a=s.filter(n=>(n.covered_by??[]).length>0),l=s.filter(n=>n.execution==="passed"),i=s.filter(n=>n.execution==="failed"),u=s.filter(n=>n.execution==="blocked"),d=0,m=0;for(let n of s){let f=C(e,n.id);d+=f,n.execution==="passed"&&(m+=f)}let r=d===0?0:Math.round(100*m/d),p=a.length===0?"uncovered":s.length===l.length?"covered":u.length>0&&i.length===0?"blocked":"partial";return{id:o.id,title:o.title,status:p,pct:r,acs:{total:s.length,covered:a.length,passed:l.length,failed:i.length,blocked:u.length},stale:s.filter(n=>n.fresh==="stale").map(n=>n.id)}})}async function P(t){let e=await w(t);return e.length===0?null:e.map(o=>({p:o,m:A(o).mtimeMs})).sort((o,s)=>s.m-o.m)[0].p}var N={covered:"\u2714",partial:"\u25D0",uncovered:"\u2716",blocked:"\u23F8"};function _(t){let e=Math.round(t/10);return"\u2588".repeat(e)+"\u2591".repeat(10-e)}async function I(t,e=G(),o=process.cwd()){if(t.mode!==void 0&&t.mode!=="agent"&&t.mode!=="ci"&&t.mode!=="interactive")return g(e,`--mode must be interactive | agent | ci, got '${t.mode}'`),2;if(t.mode==="agent"||t.mode==="ci"){let{makeHeadlessIO:r,agentRefusal:p}=await import("./headless-io-66RG5NN5.js"),n=r("ndjson","cover",{stdout:c=>e.out(c.replace(/\n$/,"")),stderr:c=>(e.err??e.out)(c.replace(/\n$/,""))}),f=[],v=[],j={out:c=>f.push(c),err:c=>v.push(c),confirm:async()=>!1,isTTY:!1};if(await I({...t,json:!0,mode:void 0},j,o)!==0)return p(n,v.join("; ")||"cover refused");let y=JSON.parse(f.join(`
3
- `));return n.event({type:"coverage",...y}),n.done(0,void 0,M(y.completeness??[]))}let s=S(o,e);if(!s)return 2;let a=t.from?await $(t.from,o):await P(o);if(!a)return g(e,t.from?`no evidence pack at '${t.from}'`:"no evidence pack in .testmuai/evidence \u2014 run a test first, or pass --from <pack>"),2;let l=await k(a,"coverage/usecases.yaml");if(l==null)return g(e,`${h(a)} carries no coverage/usecases.yaml \u2014 the pack predates coverage or its project had no .context at seal time`),2;let i=b(l);if(!i||!Array.isArray(i.usecases))return g(e,`${h(a)}: coverage/usecases.yaml is not a usecases document`),2;let u=R(s),d=D(i,u),m=await x(u,"design");if(t.json)return e.out(JSON.stringify({pack:a,depth:d,completeness:m},null,2)),0;e.out(`coverage \u2014 ${h(a)}`),e.out(""),e.out("depth (proven by the pack):");for(let r of d){let p=r.stale.length?` \xB7 ${r.stale.length} stale`:"";e.out(` ${N[r.status]} ${_(r.pct)} ${String(r.pct).padStart(3)}% ${r.id} \u2014 ${r.status} (${r.acs.passed}/${r.acs.total} ACs proven${r.acs.failed?`, ${r.acs.failed} failed`:""}${r.acs.blocked?`, ${r.acs.blocked} blocked`:""})${p}`)}e.out(""),e.out("completeness (live graph):"),m.length===0&&e.out(" no design gaps \u2014 every AC verified, every use-case scenarioed");for(let r of m)e.out(` [${r.risk}] ${r.tag} ${r.ref} \u2014 ${r.why}`),e.out(` \u2192 ${r.ready_command}`);return 0}function M(t){return t.filter(e=>e.ready_command.startsWith("kane-cli ")&&O(e.ready_command)).slice(0,4).map(e=>({cmd:e.ready_command,why:e.why}))}export{I as coverCommand,M as coverNext,D as depthRows};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-3Q6WAK6P.js";import"./chunk-AFPHLUQ5.js";import"./chunk-BB2W35TW.js";import"./chunk-DNNZ353O.js";import"./chunk-NVGBE2DR.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";export{a as captureForceScope,b as commitDesign,c as designPhaseLadder};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d}from"./chunk-BN6AHQL7.js";import"./chunk-2UIHS2FH.js";import"./chunk-YKTYVJBN.js";import"./chunk-2DCNCH32.js";import"./chunk-DNNZ353O.js";import"./chunk-Q2F5QB2W.js";import"./chunk-N2P4MI32.js";import"./chunk-NVGBE2DR.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{b as REMOTE_PROVIDERS,d as findProvider,a as landingReceipt,c as looksLikeUrl};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d}from"./chunk-FMUCZWS3.js";import"./chunk-LN7233E2.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-DN3E6RT6.js";import"./chunk-MSGW4JDG.js";import"./chunk-TZXXJWHA.js";import"./chunk-4JOD47QI.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{d as doctorExitCode,c as doctorPreflightBlocked,b as renderDoctorText,a as runDoctor};
@@ -1,3 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as u}from"./chunk-CLGC7VEO.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";var q=i=>`cite ${i.source_id??"?"} ${i.anchor??""}${i.quote?` \u2014 "${i.quote}"`:""}`;function I(i,_){let l=i.resolve(_);if(!l)return null;let c=l.tip,y=i.nodeLabel.get(c);if(!y)return null;let h=i.getNode(c);if(!h)return null;let s=h.content,f=i.displayNameOf(c)??_,d=[],o=(e,t,n=!1)=>{d.push({text:`${e.padEnd(12)} ${t}`,dim:n})},L=i.trust.get(c)??"derived";o("status",`${L}${i.superseded.has(c)?" \xB7 superseded":""}`,!0);let k=typeof s.risk=="string"?s.risk:null;k&&o("risk",k);for(let[e,t]of[["title",null],["description","description"],["value","value"],["summary","summary"],["statement","statement"],["text","text"],["intent","intent"],["case_type","case type"],["technique_notes","technique"],["kind","kind"],["change_note","change"]]){if(!t)continue;let n=s[e];typeof n=="string"&&n&&o(t,n)}let p=[];{let e=l.cid,t=new Set;for(;!t.has(e);){t.add(e),p.push(e);let n=i.superseded.get(e);if(typeof n!="string")break;e=n}}let g=p.flatMap(e=>i.edgesInto(e)).filter(e=>e.type==="DERIVES"),x=e=>{if(!e.source_cid||!e.anchor)return;let t=/^L(\d+)-L(\d+)$/.exec(e.anchor);if(!t)return;let n=i.getNode(e.source_cid)?.content?.text_blob;if(typeof n!="string")return;let r=n.split(`
3
- `).slice(Number(t[1])-1,Number(t[2])).join(" ").trim();return r?r.length>120?`${r.slice(0,119)}\u2026`:r:void 0},m=new Map,b=new Set;for(let e of g){let t=e.props;if(!t.claim)continue;let n=`${t.claim}|${t.source_id??"?"}|${t.source_cid??"?"}|${t.anchor??"?"}`;if(b.has(n))continue;b.add(n);let r=m.get(t.claim)??[];r.push({source_id:t.source_id,anchor:t.anchor,quote:x(t)}),m.set(t.claim,r)}let D=Array.isArray(s.criteria)?s.criteria:[];for(let[e,t]of D.entries()){o(e===0?"criteria":"",`${e+1}. ${t}`);for(let n of m.get(t)??[])d.push({text:` ${q(n)}`,dim:!0})}let v=g.find(e=>!e.props.claim);if(v){let e=v.props;d.push({text:` ${q({...e,quote:x(e)})}`,dim:!0})}let a=s.check;a?.kind&&o("check",`${a.kind}${a.verified_against?` vs ${u(String(a.verified_against))}`:""}`);let $=s.expected_answer;$?.operator&&o("expects",`${$.operator} \xB7 ${String($.operand??"")}`);let S=new Set,w=!0;for(let e of g){let t=e.props,n=`${t.source_id??"?"}@${t.source_cid??e.src}`;S.has(n)||(S.add(n),o(w?"provenance":"",`${t.source_id??"?"} @ ${String(t.source_cid??e.src).slice(7,15)}`,!0),w=!1)}let N=p.flatMap(e=>i.edgesFrom(e)).filter(e=>e.type==="depends_on");for(let[e,t]of N.entries()){let n=String(i.getNode(i.tipOf(t.dst))?.content?.title??""),r=i.displayNameOf(t.dst);o(e===0?"depends on":"",`${r?u(r):t.dst.slice(0,12)}${n?` ${n}`:""}`)}return{id:u(f),rawId:f,title:String(s.title??s.text??s.statement??f),label:y,lines:d}}export{I as buildDossier};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{A as L,C as M,D as N,E as O,F as P,G as Q,K as R,L as S,M as T,N as U,O as _,Q as $,R as aa,S as ba,T as ca,U as da,V as ea,W as fa,X as ga,Y as ha,Z as ia,a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as t,j as u,k as v,l as w,m as x,n as y,o as z,p as A,q as B,r as C,s as D,t as E,u as F,v as G,w as H,x as I,y as J,z as K}from"./chunk-QBG7XEGQ.js";import"./chunk-5DBK6QNS.js";import{a as V,b as W,c as X,d as Y,e as Z}from"./chunk-RZLD7TPG.js";import{a as n,b as o,c as p,e as q,f as r,g as s}from"./chunk-5GUD3CIH.js";import"./chunk-XWKUZJCP.js";import"./chunk-ZSXDZI56.js";import{a as k,b as l,c as m}from"./chunk-EHN5HTUD.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-VZ7KXRXB.js";import{a,f as b}from"./chunk-P7YZ3PU3.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-SQC4P2Q7.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-DN3E6RT6.js";import"./chunk-MSGW4JDG.js";import"./chunk-4JOD47QI.js";import"./chunk-OYJBABRV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{P as EvidenceSession,C as appendExecutionPointer,M as assembleExecutionEnv,b as buildEnvironment,j as buildEvidenceRunConfig,i as buildExternalId,z as buildLogsMetaYaml,y as buildResultYaml,t as buildRunYaml,O as createCdpBrowserCapture,u as createRunningPack,v as createRunningPackRoot,H as declareLogsFromDir,J as diagnostics,x as discardPack,ba as ensureAuteurExecution,N as fetchCdpBrowserString,L as finalizeEvidencePack,U as finalizeInlineEvidence,K as finalizeMemberTestLogs,da as flattenAuteurLeafIds,ca as flattenAuteurLeaves,T as inlineEvidenceBlock,q as listPacks,p as newExecutionId,a as normalizeOs,S as noteInlineSpawn,$ as offerEvidenceView,o as packPath,I as packTestLogsDir,V as parseRange,D as readExecutionPointers,ia as readPackLeafIds,ha as readPackLeaves,s as recoverStore,fa as remapReplayActionIds,r as resolvePack,ga as resolveReplayResultSteps,F as rollupTestStatus,aa as runEvidenceMerge,_ as runEvidenceServe,E as runEvidenceValidate,Q as runStartupRecovery,l as sealPack,w as sealPackById,Z as serveHint,f as shortHash,e as slugify,W as startEvidenceLocalServer,R as startInlineEvidence,n as storeDir,m as sweepStore,ea as synthesizeSkippedTail,h as testIdForInline,g as testIdForTestmd,k as validatePack,c as verdictFromResultCode,X as viewerBaseFor,Y as viewerUrlFor,d as worstOf,G as worstResultCode,B as writeLogsMeta,A as writeResult};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g}from"./chunk-7VZCXW74.js";import"./chunk-OS4VSIHT.js";import"./chunk-TRJUD3XJ.js";import"./chunk-JZ26R6UL.js";import"./chunk-UJZZDPDY.js";import"./chunk-JFAFKHDX.js";import"./chunk-DNNZ353O.js";import"./chunk-5DT7PIGB.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";export{b as designStateOf,g as evolveCommand,c as evolveOneUc,f as liveRunDesignForUc,a as resolveParentUc,e as runEvolveCommand,d as staleTargets};
@@ -1,3 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as M,b as se,d as re}from"./chunk-OS4VSIHT.js";import{a as te,b as ne}from"./chunk-V444REBC.js";import"./chunk-5DT7PIGB.js";import{a as H,b as q,c as Q,d as X,e as Z,f as ee}from"./chunk-5DBK6QNS.js";import{f as Y}from"./chunk-5GUD3CIH.js";import{a as O,b as F,c as G,d as z}from"./chunk-XWKUZJCP.js";import"./chunk-ZSXDZI56.js";import"./chunk-EHN5HTUD.js";import"./chunk-CH273NAE.js";import"./chunk-VZ7KXRXB.js";import{A as V}from"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import{d as E,e as U}from"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";function ge(e,t){return e.length===0?"not_run":Q(e,t).verified?"proven":q(e,t).some(r=>r.verdict==="failed")?"failing":"blocked"}function oe(e,t){let s=null;for(let{cid:g}of e.byLabel(E.TEST))for(let o of e.execHistory(g))(!s||String(o.started_at)>s.started_at)&&(s={execution_id:String(o.execution_id),started_at:String(o.started_at)});if(!s)return null;let r=H[t],a=ee(e),l=X(a).aspects[t],x={},d={},m=0,h=0,T=0;for(let g of a.usecases){let o=[];for(let b of g.acceptance_criteria){let f=b.executions??[],p=ge(f,r);o.push(p),p==="failing"?m++:p==="blocked"?h++:p==="not_run"&&T++;let y=[],c;if(p==="failing"){let n=null;for(let u of b.covered_by){let v=e.execHistory(u).map(S=>({verdict:String(S.per_ac?.find(R=>R.ac_ref===b.id)?.verdict??S.verdict),oracle_mode:String(S.oracle_mode),ts:String(S.started_at),execution_id:String(S.execution_id)})).filter(S=>r.counted_verdicts.includes(S.verdict)&&r.accepted_oracle_modes.includes(S.oracle_mode)),$=v[v.length-1];$?.verdict==="failed"&&(y.push(u),(!n||$.ts>n.ts)&&(n={ts:$.ts,execution_id:$.execution_id}))}c=n?.execution_id}else p==="blocked"&&(c=f[f.length-1]?.execution_id);x[b.id]={state:p,viaTests:y,...c?{executionId:c}:{}}}let i=o.some(b=>b!=="not_run"),_=l.usecases[g.id],k=i?_.status==="covered"?"proven":_.status==="partial"?"partial":o.includes("failing")?"failing":o.includes("blocked")?"blocked":"not_run":"not_run";d[g.id]={pct:_.pct,status:k}}return{aspect:t,pct:l.summary.coverage_pct,acs_proven:l.summary.acs_verified,failing:m,blocked:h,not_run:T,latest_run:s,perUc:d,perAc:x,config:{...r,source:"graph_execution_facts",denominator:"current_live_acs"}}}var me=["failing","blocked","needs-refresh","needs-tests","needs-scenarios","happy-only","possible-duplicate","not-yet-run"],he={failing:"failing",blocked:"blocked","needs-refresh":"needs refresh","needs-tests":"needs tests","needs-scenarios":"needs scenarios","happy-only":"happy path only","possible-duplicate":"possible duplicate","not-yet-run":"not yet run"},C={high:0,med:1,low:2};function D(e,t){let s=/^(.*?)(\d+)$/.exec(e),r=/^(.*?)(\d+)$/.exec(t);return s&&r&&s[1]===r[1]?Number(s[2])-Number(r[2]):e<t?-1:e>t?1:0}function I(e){if(!e||/^sha256:/.test(e))return"(unnamed)";let t=/^(uc|ac|sc|t)-(\d+)$/.exec(e);return t?`${t[1].toUpperCase()}-${t[2]}`:e}function ve(e,t=5){let s=e.trim().split(/\s+/);return s.slice(0,t).join(" ")+(s.length>t?"\u2026":"")}function be(e,t){let s=e.resolve(t),r=s?e.getNode(e.tipOf(s.cid))?.content:null;return String(r?.title??r?.text??"")}function ie(e,t){let s=e.resolve(t);return{id:s?e.displayNameOf(e.tipOf(s.cid))??e.displayNameOf(s.cid):null,title:ve(be(e,t),8)}}function ye(e,t){let s=e.resolve(t);if(!s)return null;let r=e.tipOf(s.cid);if(!O(e,r))return null;let a=e.nodeLabel.get(r);if(a===E.USECASE)return r;if(a===E.AC)return G(e,r);if(a===E.TEST){let l=e.edgesFrom(r).find(d=>d.type===U.VERIFIES&&O(e,d.dst));if(l)return G(e,l.dst);let x=e.edgesFrom(r).find(d=>d.type===U.AUTOMATES&&O(e,d.dst));if(x){let d=e.edgesFrom(x.dst).find(m=>m.type===U.BELONGS_TO&&O(e,m.dst));return d?d.dst:null}}return null}function L(e){if(e.tag==="reuse-candidate"&&e.stage==="design")return"possible-duplicate";switch(e.kind){case"no-verifies":return"needs-tests";case"zero-scenario":return"needs-scenarios";case"happy-only":return"happy-only";case"stale-ac":case"stale-test":return"needs-refresh";case"execution-failed":return"failing";case"execution-blocked":return"blocked";case"covered-not-run":return"not-yet-run";default:return"other"}}function xe(e,t){let s=e.resolve(t),r=s?e.getNode(e.tipOf(s.cid))?.content.risk:null;return r==="high"||r==="med"||r==="low"?r:"med"}function ae(e,t,s,r,a){let l=a.servePaths??new Map,x=e.byLabel(E.USECASE).filter(({cid:o})=>O(e,o)),d=new Map(x.map(o=>[o.cid,o])),m=new Map(x.map(({cid:o})=>[o,[]])),h=[];for(let o of t){if(o.stage!=="design")continue;let i={...o,...ie(e,o.ref)},_=ye(e,o.ref),k=_?m.get(_):void 0;k&&L(o)!=="other"?k.push(i):h.push(i)}let T=new Map(x.map(({cid:o})=>[o,{total:0,designed:0}]));for(let{cid:o}of e.byLabel(E.AC)){if(!O(e,o))continue;let i=G(e,o),_=i?T.get(i):void 0;if(!_)continue;_.total++;let k=F(e,o);if(k&&_.designed++,!r)continue;let b=e.nameOf.get(o)??o,f=r.perAc[b];if(!f)continue;let{id:p,title:y}=ie(e,b),c={ref:e.displayNameOf(o)??o,id:p,title:y,risk:xe(e,b),stage:"cover"},n=m.get(i);f.state==="failing"?n.push({...c,kind:"execution-failed",tag:"evolve",why:"covering test failed against this AC",ready_command:f.executionId&&l.has(f.executionId)?`kane-cli evidence serve ${l.get(f.executionId)}`:"kane-cli testrun run",via_tests:f.viaTests,...f.executionId?{execution_id:f.executionId}:{},...f.executionId&&l.has(f.executionId)?{servePath:l.get(f.executionId)}:{},...a.testFiles?{viaFiles:f.viaTests.map(u=>a.testFiles.get(u)??null)}:{}}):f.state==="blocked"?n.push({...c,kind:"execution-blocked",tag:"reuse-candidate",why:"the formula could count no run \u2014 broken/skipped or an unaccepted oracle",ready_command:f.executionId&&l.has(f.executionId)?`kane-cli evidence serve ${l.get(f.executionId)}`:"kane-cli testrun run",...f.executionId?{execution_id:f.executionId}:{},...f.executionId&&l.has(f.executionId)?{servePath:l.get(f.executionId)}:{}}):f.state==="not_run"&&k&&n.push({...c,kind:"covered-not-run",tag:"reuse-candidate",why:"a covering test exists but has not run yet",ready_command:"kane-cli testrun run"})}let g=[];for(let{cid:o,content:i}of x){let _=e.displayNameOf(o)??o,k=e.nameOf.get(o)??o,b=s.perUc[_]??{pct:0,status:"undesigned",staleAcs:0},f=r?r.perUc[k]??{pct:0,status:"not_run"}:null,p=r!==null&&(f===null||f.status==="not_run"),y=T.get(o),c=m.get(o)??[],n=new Set(c.filter(v=>L(v)==="needs-refresh").map(v=>v.ref)),u=[];for(let v of me){let $=c.filter(R=>L(R)===v);if(v==="needs-tests"&&($=$.filter(R=>!n.has(R.ref))),$.length===0)continue;$.sort((R,w)=>(C[R.risk]??3)-(C[w.risk]??3)||D(R.ref,w.ref));let S=v==="failing"||v==="blocked"||$.length<=2||new Set($.map(R=>R.ready_command)).size>1;u.push({key:v,label:he[v],...v==="needs-refresh"?{suffix:"source moved since these were designed"}:{},rows:$,...S?{}:{rosterCommand:$[0].ready_command}})}g.push({slug:_,title:String(i.title??""),risk:String(i.risk??""),des:b,prov:f,provAbsent:p,acTotal:y.total,acDesigned:y.designed,groups:u})}return g.sort((o,i)=>(C[o.risk]??3)-(C[i.risk]??3)||D(o.slug,i.slug)),h.sort((o,i)=>(C[o.risk]??3)-(C[i.risk]??3)||D(o.ref,i.ref)),{stage:a.stage,aspect:a.aspect,top:a.top,dc:s,pa:r,ucs:g,other:h}}function N(e,t){let s=Math.round(e/100*t);return"\u2588".repeat(s)+"\u2591".repeat(t-s)}function W(e,t){return e==="all"||t.stage===e}function B(e,t){return e.length<=t?e:t<=1?e.slice(0,t):e.slice(0,t-1)+"\u2026"}var _e={failing:"failing",blocked:"blocked","needs-refresh":"stale","needs-tests":"needs test","needs-scenarios":"no scenario","happy-only":"happy only","possible-duplicate":"duplicate?","not-yet-run":"to run"},ke=["failing","blocked","needs-refresh","needs-tests","needs-scenarios","happy-only","possible-duplicate"];function le(e,t){let s=Date.parse(e);if(Number.isNaN(s))return e;let r=Math.max(0,Math.floor((t-s)/1e3));return r<60?"just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function $e(e,t){return(t.get("failing")??[]).length?0:(t.get("blocked")??[]).length?1:(t.get("needs-tests")??[]).length||(t.get("needs-scenarios")??[]).length?2:(t.get("needs-refresh")??[]).length?3:(t.get("not-yet-run")??[]).length>0||e.provAbsent?4:5}function ue(e,t){let s=new Map;for(let g of t.groups)g.rows.length&&s.set(g.key,g.rows);let r=new Map;for(let g of t.groups){let o=g.rows.filter(i=>W(e.stage,i));o.length&&r.set(g.key,o)}let a=[],l=[],x=[],d=new Set;for(let g of ke){let o=r.get(g);if(o){for(let i of o){let _=g==="failing"&&i.via_tests?.length?` \xB7 via ${i.via_tests.map(k=>I(k)).join(", ")}`:"";a.push({id:i.ref===t.slug?"\u2014":I(i.id??i.ref),cls:_e[g],risk:i.ref===t.slug?"\u2014":i.risk,title:(i.ref===t.slug?i.why:i.title)+_})}if(g==="failing"||g==="blocked")for(let i of o)i.servePath&&d.add(`kane-cli evidence serve ${i.servePath}`);for(let i of o)i.ready_command&&!i.ready_command.startsWith("kane-cli evidence serve")&&i.ready_command!=="kane-cli testrun run"&&d.add(i.ready_command)}}let m=[...d].sort((g,o)=>Number(o.startsWith("kane-cli evidence serve"))-Number(g.startsWith("kane-cli evidence serve")));l.push(...m.map(g=>`\u21B3 ${g}`));let h=s.get("not-yet-run")??[],T=e.pa===null?t.acDesigned:h.length;return e.pa!==null&&T>0&&x.push(`${T} to run`),{uc:t,rows:a,spans:l,tails:x,toRun:T,severity:$e(t,s)}}function de(e,t){let{dc:s,pa:r}=e,a=Math.max(80,Math.min(t.width,100)),l=n=>t.color?`\x1B[2m${n}\x1B[22m`:n,x=t.now??Date.now(),d=[],m=r?.latest_run?`last run ${le(r.latest_run.started_at,x)}`:"no runs yet";d.push(`coverage \u2014 designed \xD7 proven \xB7 ${e.aspect} \xB7 ${m}`),d.push(""),d.push(P(`designed ${String(s.pct).padStart(3)}% ${N(s.pct,10)} ${s.acs_designed} ACs have a verifying test`,t.color)),r?d.push(P(`proven ${String(r.pct).padStart(3)}% ${N(r.pct,10)} ${r.acs_proven} \xB7 ${r.failing} failing \xB7 ${r.blocked} blocked \xB7 ${r.not_run} not yet run`,t.color)):d.push("proven \u2014 no runs recorded yet \xB7 run tests, then re-run"),d.push("");let h=e.ucs.map(n=>ue(e,n));h.sort((n,u)=>n.severity-u.severity||D(n.uc.slug,u.uc.slug));let T=h.some(n=>n.rows.length||n.spans.length||n.tails.length||r!==null&&n.toRun>0),g=n=>{let[u,v]=n.split("/").map(Number);return v>0&&u===v};if(!T&&g(s.acs_designed)&&(r===null||g(r.acs_proven))){let n=e.ucs.length,u=`use-case${n===1?"":"s"}`;return d.push(r?`no gaps \u2014 all ${n} ${u} designed and proven`:`no gaps \u2014 all ${n} ${u} designed \xB7 nothing run yet`),d.push(l("inspect a use-case: kane-cli cover gaps <uc-id>")),d}let o=(n,u)=>n.groups.filter(v=>u.includes(v.key)).reduce((v,$)=>v+$.rows.length,0),i=h.map(n=>({band:n,failing:o(n.uc,["failing"]),blocked:o(n.uc,["blocked"]),stale:o(n.uc,["needs-refresh"]),design:o(n.uc,["needs-tests","needs-scenarios"]),run:n.toRun})),_=[];i.some(n=>n.failing)&&_.push({hdr:"FAILING",get:n=>n.failing}),i.some(n=>n.blocked)&&_.push({hdr:"BLOCKED",get:n=>n.blocked}),i.some(n=>n.stale)&&_.push({hdr:"STALE",get:n=>n.stale}),i.some(n=>n.design)&&_.push({hdr:"TO DESIGN",get:n=>n.design}),i.some(n=>n.run)&&_.push({hdr:"TO RUN",get:n=>n.run}),a<100&&(_.length=0);let k=Math.min(16,Math.max(4,...h.map(n=>I(n.uc.slug).length))),b=15,f=_.map(n=>n.hdr.length+2),p=a-k-2-3-b-3-b-f.reduce((n,u)=>n+u,0)-2,y=n=>n.padStart(Math.floor((b+n.length)/2)).padEnd(b),c=`${" ".repeat(k+2)}${"USE CASE".padEnd(p+3)}${y("DESIGNED")} ${y("PROVEN")}`+_.map((n,u)=>n.hdr.padStart(f[u])).join("");d.push(l(c.trimEnd().slice(0,a)));for(let n of i){let u=n.band.uc,v=`${String(u.des.pct).padStart(3)}% ${N(u.des.pct,10)}`,$=r===null||u.provAbsent?we("no runs",b,t.color):`${String(u.prov?.pct??0).padStart(3)}% ${N(u.prov?.pct??0,10)}`,S=_.map((w,j)=>String(w.get(n)||"\u2014").padStart(f[j])).join(""),R=`${B(I(u.slug),k).padEnd(k)} ${B(u.title,p).padEnd(p)} ${v} ${$}${S}`;d.push(P(R,t.color))}return d.push(""),d.push(l("inspect a use-case: kane-cli cover gaps <uc-id>")),d}function we(e,t,s){let r=e.padStart(Math.floor((t+e.length)/2)).padEnd(t);return s?`\x1B[2m${r}\x1B[22m`:r}function P(e,t){return t?e.replace(/(\s*\d+%) (█*)(░*)/g,(s,r,a,l)=>{let x=Number(r.trim().replace("%","")),d=x===100?"\x1B[32m":"\x1B[33m";return`${x===0?"\x1B[31m":d}${r}\x1B[39m ${d}${a}\x1B[39m\x1B[2m${l}\x1B[22m`}):e}function pe(e,t,s,r){let{pa:a}=e,l=Math.max(80,Math.min(r.width,100)),x=p=>r.color?`\x1B[2m${p}\x1B[22m`:p,d=r.now??Date.now(),m=[],h=e.ucs.find(p=>p.slug===t),T=a?.latest_run?`last run ${le(a.latest_run.started_at,d)}`:"no runs yet";m.push(`${I(t)} \xB7 ${h?.title??""} \u2014 risk ${h?.risk??"\u2014"} \xB7 ${e.aspect} \xB7 ${T}`.slice(0,l)),m.push("");let g=h?ue(e,h):null;if(h&&g){m.push(P(`designed ${String(h.des.pct).padStart(3)}% ${N(h.des.pct,10)} ${h.acDesigned}/${h.acTotal} ACs have a verifying test`,r.color));let p=g.tails.length?` \xB7 ${g.tails.join(" \xB7 ")}`:"";a===null||h.provAbsent?m.push(`proven \u2014 no runs yet${p}`):m.push(P(`proven ${String(h.prov?.pct??0).padStart(3)}% ${N(h.prov?.pct??0,10)} ${p.replace(/^ · /,"")}`,r.color)),m.push("")}let o=Math.min(16,Math.max(5,...s.map(p=>I(p.id).length))),i=10,_=5,k=l-o-2-i-2-_-2;m.push(x(`${" ".repeat(o+2)}${"STATE".padEnd(i+2)}${"RISK".padEnd(_+2)}ACCEPTANCE CRITERION`));let b=p=>{if(!r.color)return p;let y=p.trim(),c=y.startsWith("proven")?"\x1B[32m":y==="failing"||y==="needs test"?"\x1B[31m":y==="blocked"||y==="stale"?"\x1B[33m":"\x1B[2m",n=c==="\x1B[2m"?"\x1B[22m":"\x1B[39m";return p.replace(y,`${c}${y}${n}`)};for(let p of s){let c=(p.text+(p.via?` \xB7 via ${p.via}`:"")).split(/\s+/),n=[],u="";for(let v of c)u&&u.length+1+v.length>k?(n.push(u),u=v):u=u?`${u} ${v}`:v;u&&n.push(u),n.forEach((v,$)=>{$===0?m.push(`${B(I(p.id),o).padEnd(o)} ${b(p.state.padEnd(i))} ${p.risk.padEnd(_)} ${v}`):m.push(`${" ".repeat(o+2+i+2+_+2)}${v}`)})}let f=[];if(h&&g){for(let y of g.spans){let c=y.replace(/^↳ /,"");if(c.startsWith("kane-cli evidence serve")){let n=s.filter(u=>u.state==="blocked"||u.state==="failing").map(u=>I(u.id)).join(" \xB7 ");f.push({label:"see why",cmd:c,...n?{note:`(explains ${n})`}:{}})}else f.push({label:"design",cmd:c})}let p=s.filter(y=>y.state==="to run").length;if(p>0){let c=s.some(n=>n.state==="failing")?"(review evidence first \u2014 a re-run may heal over failures)":f.some(n=>n.label==="see why")?`(${p} ACs never executed \u2014 see why first)`:`(${p} ACs never executed)`;f.push({label:"first run",cmd:"kane-cli testrun run",note:c})}}if(f.length){m.push(""),m.push("next");let p=Math.max(...f.map(c=>c.label.length))+2,y=c=>r.color?`\x1B[36m${c}\x1B[39m`:c;for(let c of f){let n=` ${c.label.padEnd(p)}`;if(n.length+c.cmd.length>l){let u=c.cmd.lastIndexOf(" ",l-n.length),v=u>0?c.cmd.slice(0,u):c.cmd.slice(0,l-n.length),$=u>0?c.cmd.slice(u+1):c.cmd.slice(l-n.length);m.push(`${n}${y(v)}`),m.push(`${" ".repeat(n.length)}${y($)}`),c.note&&m.push(x(`${" ".repeat(n.length)}${c.note}`))}else c.note&&n.length+c.cmd.length+3+c.note.length<=l?m.push(`${n}${y(c.cmd)} ${x(c.note)}`):(m.push(`${n}${y(c.cmd)}`),c.note&&m.push(x(`${" ".repeat(n.length)}${c.note}`)))}}return m.push(""),m.push(x("all use-cases: kane-cli cover gaps")),m}function K(e){let{dc:t,pa:s}=e,r=a=>e.top!==void 0?a.slice(0,e.top):a;return{stage:e.stage,rollup_version:1,design_completeness:{pct:t.pct,acs_designed:t.acs_designed,usecases_complete:t.usecases_complete,ucs_needing_scenarios:t.ucs_needing_scenarios,config:t.config},...s?{proven:{aspect:s.aspect,pct:s.pct,acs_proven:s.acs_proven,failing:s.failing,blocked:s.blocked,not_run:s.not_run,latest_run:s.latest_run,config:s.config}}:{},usecases:e.ucs.map(a=>({id:/^sha256:/.test(a.slug)?null:a.slug,title:a.title,risk:a.risk,design_completeness:{pct:a.des.pct,status:a.des.status},stale_acs:a.des.staleAcs,...s?{proven:a.prov??{pct:0,status:"not_run"}}:{},pending:r(a.groups.flatMap(l=>l.rows).filter(l=>W(e.stage,l))).map(ce)})),other:e.other.filter(a=>W(e.stage,a)).map(ce)}}function ce(e){let{servePath:t,viaFiles:s,meta:r,...a}=e;return{...a}}async function Te(e,t,s=re(),r=process.cwd()){if(t.mode!==void 0&&t.mode!=="agent"&&t.mode!=="ci"&&t.mode!=="interactive")return M(s,`--mode must be interactive | agent | ci, got '${t.mode}'`),2;if(t.mode==="agent"||t.mode==="ci"){let{makeHeadlessIO:k,agentRefusal:b}=await import("./headless-io-66RG5NN5.js"),{parsesAgainstGrammar:f}=await import("./next-TRSKMBO5.js"),p=k("ndjson","gaps",{stdout:w=>s.out(w.replace(/\n$/,"")),stderr:w=>(s.err??s.out)(w.replace(/\n$/,""))}),y=[],c=[],n={out:w=>y.push(w),err:w=>c.push(w),confirm:async()=>!1,isTTY:!1};if(await Te(e,{...t,json:!0,mode:void 0},n,r)!==0)return b(p,c.join("; ")||"cover gaps refused");let v=JSON.parse(y.join(`
3
- `));p.event({type:"gaps",...v});let $=[],S=new Set,R=(w,j)=>{if(Array.isArray(w)){for(let A of w)R(A,j);return}if(w&&typeof w=="object"){let A=w,J=typeof A.why=="string"?A.why:j;typeof A.ready_command=="string"&&A.ready_command.startsWith("kane-cli ")&&f(A.ready_command)&&!S.has(A.ready_command)&&(S.add(A.ready_command),$.push({cmd:A.ready_command,why:J||"close the gap"}));for(let fe of Object.values(A))R(fe,J)}};return R(v,"close the gap"),p.done(0,void 0,$.slice(0,4))}let a=t.stage??"all";if(a!=="design"&&a!=="cover"&&a!=="all")return M(s,`--stage must be design | cover | all, got '${a}'`),2;if(t.top!==void 0&&(!Number.isInteger(t.top)||t.top<1))return M(s,"--top must be a positive integer"),2;let l=t.rollup??"lenient";if(l!=="lenient"&&l!=="strict")return M(s,`--rollup must be lenient | strict, got '${l}'`),2;let x=se(r,s);if(!x)return 2;let d=V(x),m=Z(d),h=oe(d,l),T=await z(d,"design"),g=new Map;if(h)for(let k of Object.values(h.perAc)){if(!k.executionId||g.has(k.executionId))continue;let b=await Y(k.executionId,r);b&&g.set(k.executionId,Re(b,r))}let o=new Map;for(let[k,b]of ne(te(r)))b.length===1&&o.set(k,b[0].split("/").pop());let i=ae(d,T,m,h,{stage:a,top:t.top,aspect:l,servePaths:g,testFiles:o});if(e!==void 0){let k=d.resolve(e),b=k?d.tipOf(k.cid):null;if(!b||d.nodeLabel.get(b)!==E.USECASE||!O(d,b))return M(s,`no use-case '${e}' in the graph`),2;let f=d.displayNameOf(b)??b;if(t.json){let c=K(i);return s.out(JSON.stringify({...c,usecases:c.usecases.filter(n=>n.id===f),other:[]},null,2)),0}let p=Se(d,b,h,o),y=s.isTTY&&process.stdout.columns?process.stdout.columns:100;for(let c of pe(i,f,p,{width:y,color:s.isTTY}))s.out(c);return 0}if(t.json)return s.out(JSON.stringify(K(i),null,2)),0;if(m.usecases_complete==="0/0")return s.out("nothing to measure yet \u2014 no live use-cases in the graph"),0;let _=s.isTTY&&process.stdout.columns?process.stdout.columns:100;for(let k of de(i,{width:_,color:s.isTTY}))s.out(k);return 0}function Re(e,t){let s=t.endsWith("/")?t:t+"/";return e.startsWith(s)?e.slice(s.length):e}function Se(e,t,s,r){let a=[];for(let{cid:l,content:x}of e.byLabel(E.AC)){if(!O(e,l)||G(e,l)!==t)continue;let d=F(e,l),m=e.nameOf.get(l)??l,h=s?.perAc[m],T=e.stale(l)!=="fresh",g=d?h?.state==="proven"?"proven \u2713":h?.state==="failing"?"failing":h?.state==="blocked"?"blocked":T?"stale":"to run":"needs test",o=h?.state==="failing"&&h.viaTests.length?h.viaTests.map(i=>`${I(i)}${r.get(i)?` ${r.get(i)}`:""}`).join(", "):void 0;a.push({id:e.displayNameOf(l)??l,state:g,risk:String(x.risk??""),text:String(x.text??x.title??""),...o?{via:o}:{}})}return a.sort((l,x)=>D(l.id,x.id)),a}export{Te as gapsCommand};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{i as a,j as b,k as c,l as d,m as e}from"./chunk-2DCNCH32.js";import"./chunk-DNNZ353O.js";import"./chunk-Q2F5QB2W.js";import"./chunk-NVGBE2DR.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";export{a as compositePayloadBytes,e as ingestBytes,d as ingestFile,b as slugFromFilename,c as versionBaseOf};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-IWM5EZC3.js";import"./chunk-KRKGZ2ZW.js";import"./chunk-BN6AHQL7.js";import"./chunk-2UIHS2FH.js";import"./chunk-YKTYVJBN.js";import"./chunk-2DCNCH32.js";import"./chunk-DNNZ353O.js";import"./chunk-Q2F5QB2W.js";import"./chunk-R7QAS6LZ.js";import"./chunk-BKHXPBWN.js";import"./chunk-N2P4MI32.js";import"./chunk-5DT7PIGB.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-MSGW4JDG.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{c as ingestCommand,b as runIngestCommand,a as runIngestWithResults};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as a}from"./chunk-TQKIE7AX.js";import"./chunk-YEQVJWEF.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{a as installPlugin};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as l,b as a,c as f,d as m}from"./chunk-OS4VSIHT.js";import"./chunk-5DT7PIGB.js";import"./chunk-CH273NAE.js";import{A as c,r as y,s as b,y as v}from"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";var g={kind:"human",id:process.env.USER??"operator"},C=/^(UNKNOWN_|BAD_|INVALID_|MALFORMED_|NOT_|SLUG_TAKEN|ALREADY_|SUPERSEDED_)/;function w(e){return e.every(r=>C.test(r.code))?2:1}function p(e,r){for(let n of r)l(e,`${n.code}: ${n.detail}`);return w(r)}async function E(e,r,n,o=process.cwd()){let t=a(o,n);if(!t||!await f(n,`retire source ${e} (head \u2192 null + tombstone record)`,r.yes))return 2;let i=c(t),s=b({contextDir:t,graph:i,sourceId:e,reason:r.reason,by:g});return s.errors?p(n,s.errors):(n.out(`retired ${e} (record ${s.record.seq}) \u2014 its use-cases stay until no live source evidences them`),0)}async function _(e,r,n,o=process.cwd()){let t=a(o,n);if(!t)return 2;if(v.test(r))return l(n,`"${r}" is in the reserved sequential-id namespace (assigned at mint) \u2014 pick a descriptive name`),2;let i=c(t),s=y({contextDir:t,graph:i,assignments:[{ref:e,slug:r}],by:g});return s.errors?p(n,s.errors):(n.out(`named ${s.record.names[0].cid} as "${r}" (record ${s.record.seq})`),0)}async function x(e,r,n,o=process.cwd()){let t=a(o,n);if(!t)return 2;let i=Number(e);if(!await f(n,`revert record ${i} via a compensation record`,r.yes))return 2;let s=c(t),{commitRevert:$}=await import("./revert-NQ7GEVSE.js"),d=$({contextDir:t,graph:s,seq:i,reason:r.reason,by:g});for(let h of d.warnings)n.out(`note: ${h}`);if(d.errors)return p(n,d.errors);let u=d.record;return n.out(`reverted record ${i} via compensation record ${u.seq}: ${u.supersessions.length} supersession(s), ${u.review.length} trust restoration(s), ${Object.keys(u.source_head_moves).length} head move(s) \u2014 history unchanged, effects inverted`),0}async function P(e,r){return E(e,r,m())}async function R(e,r){return _(e,r,m())}async function k(e={},r=process.cwd()){return D(e,m(),r)}async function D(e,r,n=process.cwd()){let o=a(n,r);if(!o||!await f(r,"assign logical ids to every live unnamed node (one commit record)",e.yes))return 2;let{backfillLogicalIds:t}=await import("./logical-ids-TEBCQJGO.js"),i=c(o),s=t(o,i);return s.errors?p(r,s.errors):(r.out(s.assigned===0?"backfill: every live node already has a logical id":`backfill: assigned ${s.assigned} logical id(s) (record ${s.record.seq})`),0)}async function q(e,r){return x(e,r,m())}export{k as nameBackfillCommand,R as nameCommand,P as retireCommand,q as revertCommand,D as runNameBackfillCommand,_ as runNameCommand,E as runRetireCommand,x as runRevertCommand};
@@ -1,3 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as m}from"./chunk-OS4VSIHT.js";import"./chunk-5DT7PIGB.js";import"./chunk-CH273NAE.js";import{A as g}from"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import{d as s}from"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";var h=[s.SOURCE,s.USECASE,s.SCENARIO,s.AC,s.TEST,s.GAP];function b(n,e){if(n===s.SOURCE)return String(e.source_id??"");let l=e.question?.header,o=e.title??e.text??l??e.kind??"";return String(o)}function E(n,e){if(n.length<=e)return n;let l=n.slice(0,e-1),o=l.lastIndexOf(" ");return`${(o>e*.6?l.slice(0,o):l).trimEnd()}\u2026`}var p=58;async function O(n,e,l=process.cwd()){let o=m(l,e);if(!o)return 2;let a=g(o),i=[...a.nodeLabel.entries()].filter(([t])=>n.all||!a.superseded.has(t)).map(([t,r])=>{let u=a.getNode(t)?.content??{},f=a.trust.get(t)??(r===s.SOURCE?"-":"derived");return{id:r===s.SOURCE?String(u.source_id??""):a.nameOf.get(t)??t.slice(0,19),cid:t,label:r,title:b(r,u),trust:f,fresh:f==="archived"?"-":a.stale(t)}});if(n.type&&(i=i.filter(t=>t.label===n.type)),n.inferred&&(i=i.filter(t=>t.trust==="derived")),n.stale&&(i=i.filter(t=>t.fresh!=="fresh")),!n.all){let t=new Map;for(let r of i)t.set(`${r.label}:${r.id}`,r);i=[...t.values()]}let c=t=>{let r=h.indexOf(t);return r===-1?h.length:r};if(i.sort((t,r)=>c(t.label)-c(r.label)||t.title.localeCompare(r.title)),n.json){for(let t of i)e.out(JSON.stringify(t));return 0}if(i.length===0)return e.out("(no matching nodes)"),0;e.out("trust \xB7 fresh \xB7 title \xB7 id");let d=null;for(let t of i){if(t.label!==d){d=t.label;let u=i.filter(f=>f.label===t.label).length;e.out(""),e.out(`\u2500\u2500 ${t.label} \xB7 ${u} \u2500\u2500`)}let r=E(t.title||"(untitled)",p);e.out(` ${t.trust.padEnd(8)} ${t.fresh.padEnd(6)} ${r.padEnd(p)} ${t.id}`)}{let{heldArchiveScan:t}=await import("./feeder-C3TOJPKK.js"),r=t(o,a).live.size;r>0&&(e.out(""),e.out(`${r} held archive(s) awaiting confirmation \u2014 kane-cli context review walks them (or --allow-archive --because applies headlessly)`))}return 0}async function C(n){return O(n,{out:e=>process.stdout.write(e+`
3
- `),confirm:async()=>!1,isTTY:!!process.stdout.isTTY})}export{E as capWord,C as listCommand,O as runListCommand,b as titleOf};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{r as d,w as f,x as m}from"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";var y=Object.keys(f).filter(n=>n!=="source");function b(n,t,u={kind:"system",id:"logical-id-backfill"}){let l=new Set(t.names.keys()),r=[];for(let c of y)for(let{cid:s,content:e}of t.byLabel(c)){if(t.superseded.has(s)||t.nameOf.has(s))continue;let a=typeof e.title=="string"&&e.title||typeof e.intent=="string"&&e.intent||typeof e.statement=="string"&&e.statement||typeof e.text=="string"&&e.text||"",i=a?m(c,a,g=>l.has(g)):null;i&&(l.add(i),r.push({ref:s,slug:i}))}if(r.length===0)return{record:null,errors:null,assigned:0};let o=d({contextDir:n,graph:t,assignments:r,by:u});return o.errors?{record:null,errors:o.errors,assigned:0}:{record:o.record,errors:null,assigned:r.length}}export{b as backfillLogicalIds};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-ZRKPZLLG.js";import"./chunk-RFHMDQXZ.js";import"./chunk-FUNKVREV.js";import"./chunk-OYJBABRV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-ZLSWHCWO.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{a as LoginFlow};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as p}from"./chunk-TRJUD3XJ.js";import{c}from"./chunk-3Q6WAK6P.js";import"./chunk-AFPHLUQ5.js";import{a as g}from"./chunk-BB2W35TW.js";import"./chunk-DNNZ353O.js";import"./chunk-NVGBE2DR.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import{d}from"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";var u=["grounding","acs","scenarios","wiring","tests"];function l(i,r,o){let s=r.resolve(o);if(s===null)return[];let n=g(r,s.cid),a=c(d(i).records,n),e=a.reduce((t,m)=>Math.max(t,m.generation),0);return a.filter(t=>t.generation===e)}function E(i,r,o,s){let n=u;if(!n.includes(s))return{ok:!1,code:"UNKNOWN_PHASE",message:`--phase must be one of ${n.join(" | ")}, got '${s}'`,valid:[...n]};let a=new Set(l(i,r,o).map(t=>t.phase)),e=n.slice(0,n.indexOf(s)).filter(t=>t!=="grounding"&&!a.has(t));return e.length===0?{ok:!0,phase:s}:{ok:!1,code:"PHASE_ORDER",message:`--phase ${s} needs ${e.join(" + ")} committed first (nothing recorded for ${e.join(", ")})`,missing:e,earliest:e[0]}}function y(i,r,o,s){let n=l(i,r,o),a=r.resolve(o);if(a===null)return{priorDesign:void 0,phaseLadder:n};let e=p(r,a.tip);return{priorDesign:e.scenarios.length===0&&e.tests.length===0&&e.acs.length===0?void 0:e,phaseLadder:n}}function R(i,r,o){return`kane-cli design tests --use-case ${i} --phase ${r}${o?" --mode agent":""}`}export{u as PHASE_ORDER,y as buildPhaseSeed,E as checkPhaseEntry,R as phaseEntryCmd,l as phaseLadderFor};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-JCD6FP7A.js";import"./chunk-2YQ6TW77.js";import"./chunk-QBG7XEGQ.js";import"./chunk-5DBK6QNS.js";import"./chunk-RZLD7TPG.js";import"./chunk-5GUD3CIH.js";import"./chunk-XWKUZJCP.js";import"./chunk-ZSXDZI56.js";import"./chunk-EHN5HTUD.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-VZ7KXRXB.js";import"./chunk-P7YZ3PU3.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-SQC4P2Q7.js";import"./chunk-BPMSNGXQ.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-DN3E6RT6.js";import"./chunk-MSGW4JDG.js";import"./chunk-4JOD47QI.js";import"./chunk-OYJBABRV.js";import"./chunk-DPUV6OSP.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{c as UploadPipeline,b as packPresignEntry,a as readPackForUpload};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as a,d as b,e as c,f as d,g as e,h as f}from"./chunk-XQFITNA3.js";import"./chunk-SQC4P2Q7.js";import"./chunk-FMUCZWS3.js";import"./chunk-LN7233E2.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-DN3E6RT6.js";import"./chunk-MSGW4JDG.js";import"./chunk-TZXXJWHA.js";import"./chunk-56PAQAX5.js";import"./chunk-5EOX4MEY.js";import"./chunk-XY325HDJ.js";import"./chunk-TAOHYWEO.js";import"./chunk-Q4V2GK5U.js";import"./chunk-4JOD47QI.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{a as MobileHostUnsupportedError,b as MobilePreflightError,c as PACKAGE_ID_REJECTED,e as isInstallablePath,f as prepareTarget,d as toAppSpec};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{A as a,B as b,C as c}from"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";export{a as openGraph,b as staleForEvolve,c as supersessionChainOf};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f}from"./chunk-B4Q6FMIP.js";import"./chunk-JN44V63O.js";import"./chunk-7VZCXW74.js";import"./chunk-OS4VSIHT.js";import"./chunk-TRJUD3XJ.js";import"./chunk-AFPHLUQ5.js";import"./chunk-JZ26R6UL.js";import"./chunk-6J5T5FEY.js";import"./chunk-UJZZDPDY.js";import"./chunk-CLGC7VEO.js";import"./chunk-W5TTF7GB.js";import"./chunk-JFAFKHDX.js";import"./chunk-BN6AHQL7.js";import"./chunk-2UIHS2FH.js";import"./chunk-YKTYVJBN.js";import"./chunk-2DCNCH32.js";import"./chunk-DNNZ353O.js";import"./chunk-Q2F5QB2W.js";import"./chunk-N2P4MI32.js";import"./chunk-5DT7PIGB.js";import"./chunk-XWKUZJCP.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{c as childModeFor,d as emitWalkSignal,f as reconcileCommand,a as resolveReconcileMode,e as runReconcileCommand,b as validateReconcileInputs};
@@ -1,4 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{d as q}from"./chunk-B4Q6FMIP.js";import{j as K}from"./chunk-JN44V63O.js";import"./chunk-7VZCXW74.js";import"./chunk-OS4VSIHT.js";import"./chunk-TRJUD3XJ.js";import{a as J}from"./chunk-GC5U55MW.js";import"./chunk-AFPHLUQ5.js";import"./chunk-JZ26R6UL.js";import"./chunk-6J5T5FEY.js";import"./chunk-UJZZDPDY.js";import"./chunk-CLGC7VEO.js";import{a as b,b as Y}from"./chunk-ZMNJBUAO.js";import"./chunk-W5TTF7GB.js";import"./chunk-I7TIGB7K.js";import{a as W}from"./chunk-EXERQHXV.js";import"./chunk-BB2W35TW.js";import"./chunk-JFAFKHDX.js";import"./chunk-BN6AHQL7.js";import"./chunk-2UIHS2FH.js";import"./chunk-YKTYVJBN.js";import"./chunk-2DCNCH32.js";import"./chunk-DNNZ353O.js";import"./chunk-Q2F5QB2W.js";import"./chunk-N2P4MI32.js";import"./chunk-5DT7PIGB.js";import"./chunk-XWKUZJCP.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import{e as P}from"./chunk-IDX3TOPY.js";import{A as D,d as V,h as G,o as M,p as H,t as U,u as F}from"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import{b as E}from"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import{e as A}from"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";import{existsSync as te,mkdirSync as re,readFileSync as N,readdirSync as ne,renameSync as ie,rmSync as le,writeFileSync as oe}from"fs";import{join as v}from"path";var ae=["title","description","summary","value"];function Q(e,t){let s=[],o=t.updated;if(!o)return s;for(let r of ae){let p=o[r];if(typeof p!="string"||p===e[r])continue;let g=e[r];typeof g=="string"&&g.length>0&&s.push({op:"-",field:r,text:g}),s.push({op:"+",field:r,text:p})}let i=(e.criteria??[]).map(String),u=o.criteria??[];if(u.length>0)if(u.some(r=>"op"in r))for(let r of u)r.op==="set"&&s.push({op:"+",field:"criteria",text:r.text}),r.op==="remove"&&s.push({op:"-",field:"criteria",text:r.text});else{let r=u.map(p=>p.text);for(let p of i)r.includes(p)||s.push({op:"-",field:"criteria",text:p});for(let p of r)i.includes(p)||s.push({op:"+",field:"criteria",text:p})}return s}function $(e){let t=e.filter(r=>r.field==="criteria"),s=t.filter(r=>r.op==="+").length,o=t.filter(r=>r.op==="-").length,i=[...new Set(e.filter(r=>r.field!=="criteria").map(r=>r.field))],u=[];return t.length>0&&u.push(`${t.length} criteria changed \xB7 +${s} \u2212${o}`),i.length>0&&u.push(`${i.join("/")} reworded`),u.join(" \xB7 ")||"no field changes"}var z={high:0,med:1,low:2};function B(e,t){return t?e.nameOf.get(t)??`${t.slice(0,19)}\u2026`:"(new)"}function O(e,t){if(!t)return;let s=e.edgesInto(t).filter(o=>o.type===A.BELONGS_TO||o.type===A.SCOPED_TO);if(s.length!==0)return{stale:s.length,direct:s.slice(0,3).map(o=>B(e,o.src))}}function X(e){return G(e).map(t=>({...t.source_id!==void 0?{source_id:t.source_id}:{},anchor:t.anchor,quote:t.quote??""}))}function S(e,t){let s=Y(e),o=[];for(let i of s.updates){let u=t.resolve(i.matches_existing.cid),r=u?t.tipOf(u.cid):null,p=(r?t.getNode(r)?.content:void 0)??{},g=Q(p,i);o.push({key:b("MODIFY",i.matches_existing.cid),kind:"MODIFY",...r?{ref:r}:{},display:B(t,r),title:typeof p.title=="string"?p.title:i.title,changeLine:i.change_note??$(g),diff:g,diffSummary:g.length>4?$(g):null,...i.risk!==void 0?{risk:i.risk}:{},cites:X(i),...i.matches_existing?.reason!==void 0?{tier:i.matches_existing.reason}:{},...O(t,r)!==void 0?{impact:O(t,r)}:{},payload:i})}for(let i of s.adds)o.push({key:b("ADD",i.temp_ref),kind:"ADD",display:"(new)",title:i.title,changeLine:i.summary??i.title,diff:[],diffSummary:null,...i.risk!==void 0?{risk:i.risk}:{},cites:X(i),payload:i});for(let i of s.archives){let u=t.resolve(i.target),r=u?t.tipOf(u.cid):null,p=(r?t.getNode(r)?.content:void 0)??{};o.push({key:b("ARCHIVE",i.target),kind:"ARCHIVE",...r?{ref:r}:{},display:B(t,r),title:typeof p.title=="string"?p.title:i.target,changeLine:i.reason,diff:[],diffSummary:null,...typeof p.risk=="string"?{risk:p.risk}:{},cites:[],reason:i.reason,basis:i.basis,...O(t,r)!==void 0?{impact:O(t,r)}:{}})}return o.sort((i,u)=>(z[i.risk??"low"]??2)-(z[u.risk??"low"]??2))}function j(e,t){return e.filter(s=>!(s.key in t))}async function Z(e){let{contextDir:t,graph:s,card:o,verdict:i,by:u}=e,r=null;if(o.kind!=="ADD"){let n=o.ref?s.resolve(o.ref):null;if(r=n?s.tipOf(n.cid):null,!r||(s.trust.get(r)??null)==="archived")return{ok:!1,refusal:`its target ${o.display} was retired while the review was open \u2014 nothing landed`}}if(i==="reject")return e.signals?.({ref:o.display,verdict:"reject",...e.note?{reason:e.note}:{}}),{ok:!0,landed:"none",note:"nothing saved \u2014 rejections aren't remembered yet; it may be re-proposed"};if(i==="defer"){let n=de({contextDir:t,card:o,note:e.note,changeBasis:e.changeBasis,tip:r,proposalId:e.proposalId});return n.ok?(e.signals?.({ref:o.display,verdict:"defer",...e.note?{reason:e.note}:{}}),{ok:!0,landed:"none",note:"gap recorded \u2014 visible in cover gaps until a later verdict resolves it"}):{ok:!1,refusal:n.refusal}}if(e.changeBasis?.to_cid){let n=s.resolve(e.changeBasis.source_id);if(!n)return{ok:!1,refusal:`the source ${e.changeBasis.source_id} no longer resolves \u2014 cannot verify this changeset is current; re-run maintain reconcile`};if(n.cid!==e.changeBasis.to_cid)return{ok:!1,refusal:`the source ${e.changeBasis.source_id} moved again while this review was open \u2014 re-run maintain reconcile to refresh the changeset`}}if(o.kind==="ARCHIVE"){let n=(e.proposal.archived??[]).filter(c=>{let y=s.resolve(c.target);return y!=null&&s.tipOf(y.cid)===r}),l=V({...e.proposal,archived:n},s);if(n.length===0||l.errors.length>0)return{ok:!1,refusal:l.errors.length>0?`${l.errors.map(c=>c.detail).join("; ")} \u2014 nothing landed; the card re-presents`:`its archive op no longer resolves to ${o.display} \u2014 re-run maintain reconcile`};let h;try{h=H({contextDir:t,graph:s,verdicts:new Map([[r,{resolution:"rejected",...o.reason??e.note?{reason:o.reason??e.note}:{}}]]),by:u})}catch(c){if(c instanceof E)return{ok:!1,refusal:"concurrent activity kept moving the store \u2014 try the card again"};throw c}return h.errors?{ok:!1,refusal:h.errors.map(c=>c.detail).join("; ")}:(e.signals?.({ref:o.display,verdict:"archive"}),F({contextDir:t,graph:s,targetTip:r,resolvedBy:r,...e.changeBasis?{sourceId:e.changeBasis.source_id}:{},by:u}),{ok:!0,landed:"archived"})}let p=o.payload,g=o.kind==="MODIFY"&&r&&p.matches_existing&&r!==p.matches_existing.cid?{...p,matches_existing:{...p.matches_existing,cid:r}}:p,R={version:1,read_basis:s.latestHash,source:e.proposal.source,...e.proposal.sources?{sources:e.proposal.sources}:{},use_cases:[g]},a=await W(J(t,e.sid??`card-${process.pid}`),{verb:"maintain",ucTargets:r?[{ref:r}]:[],newBuCandidates:o.kind==="ADD"?[{tempRef:g.temp_ref,title:g.title,probeText:`${g.title} ${g.summary??""}`.trim()}]:[],sourcePins:[],readBasis:s.latestHash},n=>{let l=M({contextDir:t,graph:n.graph,proposal:R,proposalId:`${e.proposalId}:${o.key}`,verdicts:new Map([[g.temp_ref,{resolution:"approved"}]]),by:u,autoName:!0,allowStaleBasis:!0,eventIds:n.eventIds("maintain",1),...e.sid?{sid:n.sid}:{},probeHits:n.probeHits});return l.errors!==null?{errors:l.errors}:{result:l,record:l.record}});if(!a.ok||!("result"in a))return{ok:!1,refusal:!a.ok&&a.kind==="validation"?a.errors.map(l=>l.detail).join("; "):"concurrent activity kept moving the store \u2014 try the card again"};e.signals?.({ref:o.display,verdict:"approve"});let d=a.result.record?.nodes.find(n=>n.label==="usecase")?.cid,f=o.kind==="MODIFY"?d??r??void 0:d;return o.kind==="MODIFY"&&r&&F({contextDir:t,graph:s,targetTip:r,resolvedBy:d??r,...e.changeBasis?{sourceId:e.changeBasis.source_id}:{},by:u}),{ok:!0,landed:o.kind==="MODIFY"?"successor":"minted",...f?{offer:{kind:o.kind==="MODIFY"?"evolve":"design",target:f}}:{}}}function de(e){let{card:t,changeBasis:s}=e,o={kind:"reconcile_deferred",derived:!0,text:t.changeLine||t.title,...t.risk?{risk:t.risk}:{},...e.note?{risk_rationale:e.note}:{},...e.tip?{ref:t.display,uc:e.tip}:{},...s?{basis:{source_id:s.source_id,from_cid:s.from_cid??"",to_cid:s.to_cid??""}}:{},...e.proposalId?{proposal_id:e.proposalId}:{},...t.payload?.temp_ref?{temp_ref:t.payload.temp_ref}:{}};return U({contextDir:e.contextDir,content:o,...e.tip?{annotates:e.tip}:{}})}function se(e,t){return v(e,"proposals",t,"verdicts.json")}function C(e,t){try{return JSON.parse(N(se(e,t),"utf8"))}catch{return{verdicts:{}}}}function ee(e,t,s){let o=v(e,"proposals",t);re(o,{recursive:!0});let i=v(o,`.verdicts.${process.pid}.tmp`);oe(i,JSON.stringify(s,null,2)+`
3
- `),ie(i,se(e,t))}function T(e,t){try{return JSON.parse(N(v(e,"proposals",t,"proposal.json"),"utf8"))}catch{return null}}function L(e,t){let s=v(e,"sessions");if(!te(s))return null;for(let o of ne(s)){let i;try{i=P(e,o)}catch{continue}if(!i?.reconcile||new Date(i.expires_at).getTime()<=Date.now()||C(e,i.reconcile.proposal_id).resolved)continue;let r=i.change_basis?.source_id??Object.keys(i.read_basis)[0]??"";if(!(t!==void 0&&r!==t))return{sid:i.sid,proposalId:i.reconcile.proposal_id,source:r,...i.change_basis?{changeBasis:{source_id:i.change_basis.source_id,to_cid:i.change_basis.new_head}}:{}}}return null}var fe=80;function pe(e){return{kind:e.kind,ref:e.display,title:e.kind==="ADD"?e.title:`${e.display} \xB7 ${e.title}`,why:e.changeLine,origin:"content-change",...e.tier!==void 0?{tier:e.tier}:{},...e.diffSummary==null&&e.diff.length>0?{diff:e.diff}:{},...e.diffSummary!=null?{diffSummary:e.diffSummary,viewDiff:!0}:{},...e.cites.length>0?{citeLines:e.cites.map(t=>`cite ${t.source_id??"conversation"} ${t.anchor} \u2014 "${t.quote.slice(0,fe)}"`)}:{},...e.impact?{impact:{stale_refs:Array(e.impact.stale).fill("\xB7"),...e.impact.direct.length>0?{direct_refs:e.impact.direct}:{}}}:{}}}function Be(e){let t=e.contextDir,s=e.changeContext?.source_id,o=new Map;e.changeContext&&o.set(e.changeContext.source_id,e.changeContext.old_head);let i=a=>{let d=o.get(a);if(d)return d;try{let f=K(t,a);return f&&o.set(a,f.old_head),f?.old_head}catch{return}},u=v(t,"proposals",".reconcile-steer-carry.json"),r=()=>{try{return JSON.parse(N(u,"utf8"))}catch{return null}},p=(a,d,f)=>{let n=r();if(!n||n.source!==f)return d;let l=C(t,a),h=!1;for(let c of d)(n.keys.includes(c.key)||c.kind==="ADD"&&n.addTitles.includes(c.title.toLowerCase()))&&!(c.key in l.verdicts)&&(l.verdicts[c.key]={verdict:"steer",at:new Date().toISOString()},h=!0);h&&ee(t,a,l);try{le(u)}catch{}return d},g=(a,d)=>{let f=T(t,a);if(!f)return[];let n=p(a,S(f,D(t)),d),l=C(t,a);return j(n,l.verdicts)},R=()=>{let a=v(t,"sessions");if(!te(a))return null;for(let d of ne(a)){let f;try{f=P(t,d)}catch{continue}if(!f||new Date(f.expires_at).getTime()<=Date.now())continue;let n=(f.ingest_schedule??[]).filter(l=>l.status==="skipped"&&(l.note??"").includes("review"));if(n.length>0)return{source:n[0].source_id,count:n.length}}return null};return{pending(){let a=L(t,s);if(a){let f=g(a.proposalId,a.source).length;return f>0?{source:a.source,count:f,kind:"cards"}:null}let d=R();return d?{source:d.source,count:d.count,kind:"needs-run"}:null},loadCards(){let a=L(t,s);if(!a)return[];let d=g(a.proposalId,a.source),f=d.filter(n=>n.kind==="ADD"||n.ref!=null);for(let n of d.filter(l=>l.kind!=="ADD"&&l.ref==null))e.note?.(`dropped: [${n.kind}] ${n.title} \u2014 its target was retired while the review was open; nothing lands`);return f.map(n=>({key:n.key,card:pe(n),viewLines:n.diff}))},noteSteer(){let a=L(t,s);if(!a)return;let d=T(t,a.proposalId);if(!d)return;let f=C(t,a.proposalId),n=S(d,D(t)).filter(c=>c.key in f.verdicts),l={source:a.source,keys:n.map(c=>c.key),addTitles:n.filter(c=>c.kind==="ADD").map(c=>c.title.toLowerCase())},h=`${u}.${process.pid}.tmp`;re(v(t,"proposals"),{recursive:!0}),oe(h,JSON.stringify(l,null,2)+`
4
- `),ie(h,u)},async applyVerdict(a,d,f){let n=L(t,s);if(!n)return{ok:!1,refusal:"the held changeset is gone \u2014 nothing to verdict"};let l=T(t,n.proposalId);if(!l)return{ok:!1,refusal:`proposal ${n.proposalId} is unreadable \u2014 re-run maintain reconcile`};if(a in C(t,n.proposalId).verdicts)return{ok:!1,refusal:"that change was already verdicted (another surface?) \u2014 refresh the review"};let h=D(t),c=S(l,h).find(x=>x.key===a);if(!c)return{ok:!1,refusal:"that change no longer builds a card \u2014 the set may have moved; re-open the review"};let y=i(n.source),I=n.changeBasis?{source_id:n.changeBasis.source_id,...y?{from_cid:y}:{},...n.changeBasis.to_cid?{to_cid:n.changeBasis.to_cid}:{}}:void 0,m=await Z({contextDir:t,graph:h,proposal:l,proposalId:n.proposalId,card:c,verdict:d,...f?{note:f}:{},by:{kind:"human",id:"owner"},sid:n.sid,...I?{changeBasis:I}:{},signals:x=>q(t,x.ref,x.verdict,x.reason)});if(!m.ok)return{ok:!1,refusal:m.refusal};let k=C(t,n.proposalId);return k.verdicts[a]={verdict:d,...f?{note:f}:{},at:new Date().toISOString()},j(S(l,D(t)),k.verdicts).length===0&&(k.resolved=!0),ee(t,n.proposalId,k),{ok:!0,line:`${d==="approve"?c.kind==="ARCHIVE"?"retired":"approved":d==="reject"?"rejected":"deferred"} change \xB7 [${c.kind}] ${c.display}${c.kind==="ADD"?"":` ${c.title}`} (you)`,...m.note?{note:m.note}:{},...m.offer&&m.offer.target?{offer:{kind:m.offer.kind,key:m.offer.target,title:c.kind==="ADD"?c.title:c.display}}:{}}},async startReview(a){let d=e.runPostureChild??(async(l,h)=>{let[{runExtract:c},{runAgent:y},{resolveAgentAuthEnv:I},{preflightTurn:m}]=await Promise.all([import("./run-5IYI2TJI.js"),import("./bridge-GQJ35GTL.js"),import("./spawner-ZSYJQGQW.js"),import("./turn-preflight-JGYT7LXP.js")]),k=await I();return c({mode:"override",posture:"reconcile",source:l,changeContext:h},{contextDir:t,agent:y,preflightTurn:()=>m(k),ask:async _=>_.map(w=>({id:w.id,selected_index:w.recommended_index,free_text:null})),review:async _=>new Map(_.map(w=>[w.temp_ref,{resolution:"skipped"}])),confirmStale:async()=>!0,out:_=>e.note?.(_),progress:()=>{},isTTY:!1,auth:k})}),{buildChangeContext:f}=await import("./reconcile-engine-6AT6EVGS.js"),n=f(t,a);return n?(o.set(a,n.old_head),d(a,n)):(e.note?.(`no change context for ${a} \u2014 nothing to review`),2)}}}export{Be as makeReconcileDeps,C as readVerdictLedger,pe as toWalkCard};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-JN44V63O.js";import"./chunk-7VZCXW74.js";import"./chunk-OS4VSIHT.js";import"./chunk-TRJUD3XJ.js";import"./chunk-AFPHLUQ5.js";import"./chunk-JZ26R6UL.js";import"./chunk-UJZZDPDY.js";import"./chunk-JFAFKHDX.js";import"./chunk-DNNZ353O.js";import"./chunk-5DT7PIGB.js";import"./chunk-XWKUZJCP.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";export{g as EVOLVABLE,d as RECONCILE_NOTE_CHANGED,c as RECONCILE_SKIPPED_ARMS,j as buildChangeContext,l as buildReconcilePlan,i as capDiff,a as commitHeldRows,k as commitOneHeldRow,e as isLive,h as lineDiff,o as liveReextractSeam,m as liveReingestSeam,n as liveRemoteReingestSeam,f as parentUc,b as rowImpactOf};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";export{c as AppendBusyError,b as AppendCasError,a as ChainError,i as appendRecord,j as appendRecordRaw,f as latestHash,d as readRecords,g as readRecordsFrom,e as readTail,h as recordsSince};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as a,c as b,d as c,e as d,f as e}from"./chunk-LN7233E2.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-DN3E6RT6.js";import"./chunk-MSGW4JDG.js";import"./chunk-4JOD47QI.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{d as discoverAll,a as knownPlatforms,c as providerFor,b as registeredPlatforms,e as resolveTarget};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d,e,f,g,h}from"./chunk-SORVX3KI.js";import"./chunk-XQFITNA3.js";import"./chunk-SQC4P2Q7.js";import"./chunk-FMUCZWS3.js";import"./chunk-LN7233E2.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-DN3E6RT6.js";import"./chunk-MSGW4JDG.js";import"./chunk-TZXXJWHA.js";import"./chunk-56PAQAX5.js";import"./chunk-5EOX4MEY.js";import"./chunk-XY325HDJ.js";import"./chunk-TAOHYWEO.js";import"./chunk-Q4V2GK5U.js";import"./chunk-4JOD47QI.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{h as CHOOSE_MOBILE_KIND_MESSAGE,a as appSuitsTarget,d as formatRunningOn,e as missingPieceMessage,b as resolveRunIntent,c as resolveTestmdIntent,g as staleAppMessage,f as staleDeviceMessage};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{d as _,i as k}from"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";function j(w){let{contextDir:v,graph:y,seq:r,by:d}=w,{records:l,hashes:$}=_(v);if(!Number.isInteger(r)||r<1||r>l.length)return{record:null,warnings:[],errors:[{code:"UNKNOWN_SEQ",detail:`no record ${r} (chain has ${l.length})`}]};let i=l[r-1],p=l.slice(0,r-1),c=w.reason??`revert of record ${r}`,t=[],u=[],f=[],g=[],m={},b=new Set(i.nodes.map(e=>e.cid));for(let e of i.nodes){if(y.superseded.has(e.cid)){t.push(`${e.cid} was already superseded after record ${r} \u2014 left as is`);continue}u.push({kind:"node",old:e.cid,new:null,reason:c,by:d})}for(let e of i.supersessions){if(e.kind==="edge"){t.push(`edge retraction ${e.ecid} cannot be auto-restored \u2014 re-extract to re-evidence`);continue}if(l.slice(r).some(n=>n.supersessions.some(s=>s.kind==="node"&&s.old===e.old))){t.push(`supersession of ${e.old.slice(0,19)} was changed again after record ${r} \u2014 later state kept`);continue}let o;for(let n of p)for(let s of n.supersessions)s.kind==="node"&&s.old===e.old&&(o=s.new===s.old?void 0:s.new);o===void 0?u.push({kind:"node",old:e.old,new:e.old,reason:c,by:d}):u.push({kind:"node",old:e.old,new:o,reason:c,by:d})}let h=l.slice(r);for(let e of Object.keys(i.source_head_moves)){if(h.some(n=>e in n.source_head_moves)){t.push(`head of ${e} was moved again after record ${r} \u2014 later state kept`);continue}let o=null;for(let n of p)e in n.source_head_moves&&(o=n.source_head_moves[e]);m[e]=o}let R=new Set;for(let e of i.review){if(R.has(e.id)||b.has(e.id))continue;if(R.add(e.id),h.some(s=>s.review.some(a=>a.id===e.id))){t.push(`trust of ${e.id.slice(0,19)} was reviewed again after record ${r} \u2014 later state kept`);continue}let o=null,n=null;for(let s of p)for(let a of s.review)a.id===e.id&&(o=a.resolution==="reset"?null:a.resolution,n=a.reason);o==="approved"||o==="edited"?f.push({id:e.id,kind:"review-item",resolution:"approved",edit:null,reason:c,by:d}):o==="rejected"?f.push({id:e.id,kind:"review-item",resolution:"rejected",edit:null,reason:n??c,by:d}):f.push({id:e.id,kind:"review-item",resolution:"reset",edit:null,reason:c,by:d})}for(let e of i.names??[]){if(h.some(n=>(n.names??[]).some(s=>s.slug===e.slug))){t.push(`slug "${e.slug}" was reassigned after record ${r} \u2014 later state kept`);continue}let o;for(let n of p)for(let s of n.names??[])s.slug===e.slug&&(o=s.cid);o!==void 0?g.push({cid:o,slug:e.slug,by:d}):t.push(`slug "${e.slug}" was first assigned by record ${r} \u2014 unassignment unsupported, reassign manually`)}return u.length===0&&f.length===0&&g.length===0&&Object.keys(m).length===0?{record:null,warnings:t,errors:[{code:"NOTHING_TO_REVERT",detail:`record ${r} left no compensable facts`}]}:(i.extraction_of&&t.push(`extraction cache for ${i.extraction_of.slice(0,19)} stays \u2014 re-extract with --force`),{record:k(v,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:f,supersessions:u,...g.length>0?{names:g}:{},source_head_moves:m},{expectPrev:$[$.length-1]??null}).record,warnings:t,errors:null})}export{j as commitRevert};
@@ -1,4 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as x}from"./chunk-OS4VSIHT.js";import"./chunk-5DT7PIGB.js";import"./chunk-CH273NAE.js";import{A as O,p as V}from"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import{d as N}from"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";import{readFileSync as M}from"fs";var P=new Set(["derived","skipped","archived","drift"]),q={kind:"human",id:process.env.USER??"operator"};function $(r,t){return r.nameOf.get(t)??t.slice(0,19)}function A(r,t){let o=r.getNode(t)?.content??{},h=r.derivesInto(t)[0]?.props.anchor;return{cid:t,uc:{temp_ref:t,title:String(o.title??o.text??""),summary:o.summary!==void 0?String(o.summary):void 0,risk:String(o.risk??"med"),cite:{anchor:typeof h=="string"?h:"\u2014",quote:""},depends_on_hint:[],matches_existing:null}}}function G(r,t){let o=new Set,{records:h}=N(r);for(let i of h){if(i.proposal_id==null)continue;let u=new Set(i.review.map(e=>e.id));for(let e of i.nodes)u.has(e.cid)||o.add(e.cid)}for(let i of[...o])(t.trust.get(i)!=="derived"||t.superseded.has(i))&&o.delete(i);return o}var U=new Set(["approved","edited","rejected","skipped","supersede"]);function D(r){let t;try{t=JSON.parse(r)}catch(i){return{errors:[`not valid JSON: ${i instanceof Error?i.message:String(i)}`]}}if(!Array.isArray(t))return{errors:['expected a top-level array of {"ref", "resolution", ...} entries']};let o=[],h=[];return t.forEach((i,u)=>{if(i==null||typeof i!="object"||Array.isArray(i)){o.push(`[${u}]: not an object`);return}let e=i;(typeof e.ref!="string"||!e.ref.trim())&&o.push(`[${u}]: "ref" (slug or cid) is required`),(typeof e.resolution!="string"||!U.has(e.resolution))&&o.push(`[${u}]: "resolution" must be one of approved | edited | rejected | skipped | supersede`),e.resolution==="supersede"&&(typeof e.supersede_target!="string"||!e.supersede_target.trim())&&o.push(`[${u}]: resolution "supersede" requires "supersede_target" (slug or cid)`),e.edit!==void 0&&(e.edit==null||typeof e.edit!="object"||Array.isArray(e.edit))&&o.push(`[${u}]: "edit" must be an object ({title?, summary?, risk?})`),o.length===0&&h.push(e)}),o.length>0?{errors:o}:{entries:h}}async function Q(r,t,o,h=process.cwd()){let i=r.queue??"derived";if(!P.has(i))return t.out(`unknown queue ${i} \u2014 one of: derived | skipped | archived | drift`),2;if(r.mode!=null&&r.mode!=="agent"&&r.mode!=="ci")return(t.err??t.out)(`error: review --mode must be agent | ci, got '${r.mode}'`),2;r.mode==="agent"&&(r={...r,json:!0});let u=x(h,t);if(!u)return 2;let e=O(u),m=n=>(t.err??t.out)(n);if(r.allowArchive&&!r.because?.trim())return m('error: --allow-archive requires --because "<reason>" (the audit trail on the record)'),2;if(r.mode==="ci"&&r.allowArchive)return m("error: ci mode never archives \u2014 nothing committed"),2;if((r.approve?.length??0)>0||(r.skip?.length??0)>0||(r.defer?.length??0)>0){if(r.verdicts)return m("error: --approve/--skip/--defer and --verdicts are mutually exclusive"),2;let n=new Map,c=[];for(let d of r.approve??[]){let f=e.resolve(d),g=f&&!e.superseded.has(f.tip)?f.tip:null;if(!g){c.push(`${d}: names nothing in the graph`);continue}n.set(g,{resolution:"approved"})}for(let d of[...r.skip??[],...r.defer??[]])e.resolve(d)||c.push(`${d}: names nothing in the graph`);if(c.length>0){for(let d of c)m(`error: ${d}`);return m("error: nothing committed (structured verdicts are atomic \u2014 fix every offender and re-run)"),2}if(n.size===0)return t.out("nothing changed \u2014 every ref was skipped/deferred"),0;let l=V({contextDir:u,graph:e,verdicts:n,by:q});if(l.errors){for(let d of l.errors)m(`${d.code}: ${d.detail}`);return 1}return t.out(`review: committed record ${l.record.seq} \u2014 ${n.size} approved`),0}if(r.verdicts){let n=s=>(t.err??t.out)(s),c;try{c=M(r.verdicts,"utf8")}catch{return n(`error: cannot read verdicts file ${r.verdicts}`),2}let l=D(c);if("errors"in l){for(let s of l.errors)n(`error: --verdicts ${r.verdicts}: ${s}`);return 2}let d=new Set([...e.trust.entries()].filter(([s,a])=>(a==="derived"||a==="archived")&&!e.superseded.has(s)).map(([s])=>s)),f=new Map,g=[];for(let s of l.entries){let a=e.resolve(s.ref),p=a&&!e.superseded.has(a.tip)?a.tip:null;if(!p){g.push(`${s.ref}: names nothing in the graph`);continue}if(!d.has(p)){g.push(`${s.ref}: not in a review queue (trust: ${e.trust.get(p)??"?"})`);continue}if(f.has(p)){g.push(`${s.ref}: duplicate \u2014 an earlier entry already resolves to this node (${$(e,p)})`);continue}f.set(p,{resolution:s.resolution,...s.reason?{reason:s.reason}:{},...s.edit?{edit:s.edit}:{},...s.supersede_target?{supersedeTarget:s.supersede_target}:{}})}if(g.length>0){for(let s of g)n(`error: --verdicts: ${s}`);return n("error: nothing committed (the verdicts file is atomic \u2014 fix every offender and re-run)"),2}let y=[...f.entries()].filter(([,s])=>s.resolution==="rejected"||s.resolution==="supersede");if(y.length>0&&r.mode==="ci")return n(`error: ci mode never archives \u2014 ${y.length} retiring verdict(s) (rejected/supersede) present, nothing committed`),2;if(y.length>0&&r.allowArchive){let{archiveImpact:s}=await import("./feeder-C3TOJPKK.js");for(let[a,p]of y){let R=p.resolution==="supersede"?(()=>{let j=p.supersedeTarget?e.resolve(p.supersedeTarget):null;return j&&!e.superseded.has(j.tip)?j.tip:null})():a;if(R===null)continue;let C=s(e,R),I=p.resolution==="supersede"?`supersede (retires ${$(e,R)})`:`archive ${$(e,R)}`;n(`${I}: ${C.design_children} design child(ren) affected`)}for(let[,a]of y)a.reason||(a.reason=r.because)}let E=y.length>0&&!r.allowArchive,S=V({contextDir:u,graph:e,verdicts:f,by:q,...E?{holdArchives:!0}:{}});if(S.errors){if(S.errors[0]?.code==="NO_VERDICTS")return n("nothing changed \u2014 every item was skipped"),0;for(let s of S.errors)n(`${s.code}: ${s.detail}`);return 1}E&&t.out(`${y.length} archive(s) held for interactive confirmation (re-run with --allow-archive --because "<reason>" to apply headlessly)`);let _=new Map;for(let s of f.values())_.set(s.resolution,(_.get(s.resolution)??0)+1);if(r.json)for(let[s,a]of f.entries())t.out(JSON.stringify({ref:$(e,s),cid:s,resolution:a.resolution}));else{let s=[..._.entries()].map(([a,p])=>`${p} ${a}`).join(", ");t.out(`review: committed record ${S.record.seq} \u2014 ${s}`)}return 0}if(i==="drift"){let n=e.staleList().filter(({state:c})=>c!=="superseded").map(({cid:c,state:l})=>({ref:$(e,c),cid:c,state:l,title:String(e.getNode(c)?.content.title??e.getNode(c)?.content.source_id??""),pinned_sources:[...new Set(e.derivesInto(c).map(d=>String(d.props.source_id)))]}));if(r.json){for(let c of n)t.out(JSON.stringify(c));return 0}if(n.length===0)return t.out("drift queue is empty \u2014 every node's evidence matches the current source snapshots"),0;t.out(`${n.length} item(s) whose evidence changed (re-extract the source to re-approve):`);for(let c of n)t.out(` [${c.state}] ${c.ref} \xB7 ${c.title} \xB7 sources: ${c.pinned_sources.join(", ")||"\u2014"}`);return 0}if(!t.isTTY)return t.out("review: verdict queues need a TTY (drift listing works anywhere, or pass --verdicts <file.json>)"),2;let v,w;if(i==="archived")v=[...e.trust.entries()].filter(([n,c])=>c==="archived"&&!e.superseded.has(n)).map(([n])=>A(e,n)),w="skipped";else{let n=G(u,e),c=[...e.trust.entries()].filter(([d,f])=>f==="derived"&&!e.superseded.has(d)).map(([d])=>d),l=i==="skipped"?c.filter(d=>n.has(d)):c;l.sort((d,f)=>Number(n.has(f))-Number(n.has(d))),v=l.map(d=>A(e,d)),w="skipped"}if(v.length===0)return t.out(`${i} queue is empty`),0;t.out(`${v.length} node(s) in the ${i} queue \u2014 approve promotes, reject ${i==="archived"?"re-archives":"archives"}, edit mints a new version, skip leaves it for later`);let T=await o(v,e,w),k=V({contextDir:u,graph:e,verdicts:T,by:q});if(k.errors){if(k.errors[0]?.code==="NO_VERDICTS")return t.out("nothing changed \u2014 every item was skipped"),0;for(let n of k.errors)t.out(`${n.code}: ${n.detail}`);return 1}let b=k.record;return t.out(`committed record ${b.seq}: ${b.review.length} review fact(s), ${b.supersessions.length} supersession(s), ${b.nodes.length} new version(s)`),0}async function F(r,t,o){let[{render:h},i,{ReviewChecklist:u}]=await Promise.all([import("./build-JIKYOZUH.js"),import("./react-QWOAB3TB.js"),import("./ui-JEJGTURD.js")]),e=i.default??i;return new Promise(m=>{let v=h(e.createElement(u,{items:r.map(w=>({uc:w.uc})),defaultResolution:o,onSubmit:w=>{v.unmount(),m(w)}}))})}async function B(r){let{bothTTY:t}=await import("./headless-io-66RG5NN5.js");return Q(r,{out:o=>process.stdout.write(o+`
3
- `),err:o=>process.stderr.write(o+`
4
- `),confirm:async()=>!1,isTTY:t()},F)}export{D as parseVerdictsFile,B as reviewCommand,Q as runReviewCommand};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-KLTKEGDH.js";import"./chunk-ZKSN2SJ7.js";import"./chunk-3Q6WAK6P.js";import"./chunk-AFPHLUQ5.js";import"./chunk-JZ26R6UL.js";import"./chunk-ATWDQCDA.js";import"./chunk-IWM5EZC3.js";import"./chunk-ZGBSGZZM.js";import"./chunk-EXERQHXV.js";import"./chunk-BB2W35TW.js";import"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-JFAFKHDX.js";import"./chunk-6KPPGMO2.js";import"./chunk-KRKGZ2ZW.js";import"./chunk-AWD56KGX.js";import"./chunk-BN6AHQL7.js";import"./chunk-2UIHS2FH.js";import"./chunk-YKTYVJBN.js";import"./chunk-GFKCTYCA.js";import"./chunk-IMR64OCZ.js";import"./chunk-427OQS2N.js";import"./chunk-2DCNCH32.js";import"./chunk-DNNZ353O.js";import"./chunk-Q2F5QB2W.js";import"./chunk-R7QAS6LZ.js";import"./chunk-BKHXPBWN.js";import"./chunk-N2P4MI32.js";import"./chunk-V444REBC.js";import"./chunk-5DT7PIGB.js";import"./chunk-ZSXDZI56.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-VZ7KXRXB.js";import"./chunk-IDX3TOPY.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-MSGW4JDG.js";import"./chunk-5EOX4MEY.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{a as runDesign};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as b,b as c,c as d,d as e,e as f,f as g,g as h}from"./chunk-YZ45OEH3.js";import"./chunk-ZMNJBUAO.js";import"./chunk-W5TTF7GB.js";import"./chunk-I7TIGB7K.js";import{d as a}from"./chunk-ATWDQCDA.js";import"./chunk-IWM5EZC3.js";import"./chunk-ZGBSGZZM.js";import"./chunk-EXERQHXV.js";import"./chunk-BB2W35TW.js";import"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-JFAFKHDX.js";import"./chunk-6KPPGMO2.js";import"./chunk-KRKGZ2ZW.js";import"./chunk-TKYJTXWL.js";import"./chunk-AWD56KGX.js";import"./chunk-BN6AHQL7.js";import"./chunk-2UIHS2FH.js";import"./chunk-YKTYVJBN.js";import"./chunk-GFKCTYCA.js";import"./chunk-IMR64OCZ.js";import"./chunk-427OQS2N.js";import"./chunk-2DCNCH32.js";import"./chunk-DNNZ353O.js";import"./chunk-Q2F5QB2W.js";import"./chunk-R7QAS6LZ.js";import"./chunk-BKHXPBWN.js";import"./chunk-N2P4MI32.js";import"./chunk-5DT7PIGB.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-IDX3TOPY.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-MSGW4JDG.js";import"./chunk-5EOX4MEY.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{g as dedupPreFlags,c as deliveredImagesWire,e as displaySourceName,b as extractProtocolCtx,a as resolveAnswers,h as runExtract,d as sessionSourceRef,f as sourceBanner};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{f as a}from"./chunk-B5QGIUJA.js";import"./chunk-3MSXQU2C.js";import"./chunk-QQAAPFIR.js";import"./chunk-YHTYPTDD.js";import"./chunk-SS5TOK2J.js";import"./chunk-3LEVCW6R.js";import"./chunk-VOBXYDJW.js";import"./chunk-MKSTP2XN.js";import"./chunk-KDXQNLVV.js";import"./chunk-PT7V5WDQ.js";import"./chunk-GELPKSLC.js";import"./chunk-TYI4MLFJ.js";import"./chunk-DEZ7CXGM.js";import"./chunk-DZCG7FFP.js";import"./chunk-C4WTZSX4.js";import"./chunk-EKCGZXZE.js";import"./chunk-S3DAAAE5.js";import"./chunk-SORVX3KI.js";import"./chunk-JCD6FP7A.js";import"./chunk-2YQ6TW77.js";import"./chunk-5DT7PIGB.js";import"./chunk-INK66XQS.js";import"./chunk-QBG7XEGQ.js";import"./chunk-5DBK6QNS.js";import"./chunk-RZLD7TPG.js";import"./chunk-5GUD3CIH.js";import"./chunk-XWKUZJCP.js";import"./chunk-ZSXDZI56.js";import"./chunk-EHN5HTUD.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-FJYDEWOA.js";import"./chunk-CLLQQPBZ.js";import"./chunk-A44G533S.js";import"./chunk-VZ7KXRXB.js";import"./chunk-P3RKXL3V.js";import"./chunk-XJILZ2WN.js";import"./chunk-USI2WMAK.js";import"./chunk-P7YZ3PU3.js";import"./chunk-TDPWFYTJ.js";import"./chunk-BRTARADN.js";import"./chunk-3UUPP5W3.js";import"./chunk-RX5TZZNQ.js";import"./chunk-5Y2G4NC7.js";import"./chunk-R5T4RLF5.js";import"./chunk-2YEHV2CX.js";import"./chunk-SQGBFCFO.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-XQFITNA3.js";import"./chunk-SQC4P2Q7.js";import"./chunk-TZFT7R7B.js";import"./chunk-QISE272H.js";import"./chunk-YCCUBQY4.js";import"./chunk-CZUOGGUK.js";import"./chunk-4ONGF4NT.js";import"./chunk-BPMSNGXQ.js";import"./chunk-VE3SUJMA.js";import"./chunk-ZRKPZLLG.js";import"./chunk-RFHMDQXZ.js";import"./chunk-FMUCZWS3.js";import"./chunk-LN7233E2.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-DN3E6RT6.js";import"./chunk-MSGW4JDG.js";import"./chunk-TZXXJWHA.js";import"./chunk-56PAQAX5.js";import"./chunk-5EOX4MEY.js";import"./chunk-XY325HDJ.js";import"./chunk-TAOHYWEO.js";import"./chunk-VMCSRLRC.js";import"./chunk-KQ2MYMOS.js";import"./chunk-AO3PBE2V.js";import"./chunk-Q4V2GK5U.js";import"./chunk-4JOD47QI.js";import"./chunk-5COGCNED.js";import"./chunk-FUNKVREV.js";import"./chunk-OYJBABRV.js";import"./chunk-DPUV6OSP.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-E47GFYXA.js";import"./chunk-EYOCNMUM.js";import"./chunk-ZLSWHCWO.js";import"./chunk-NT3UETTV.js";import"./chunk-RDNKYRKY.js";import"./chunk-OFW3ZVTP.js";import{a as o}from"./chunk-DFS4RMVP.js";import{a as t}from"./chunk-HCBYKLMW.js";import{c as n}from"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import{e as r}from"./chunk-UR6MHSHU.js";var e=r(t(),1);async function p(i){let c=i.scenarioLimit!==void 0||i.perScenarioLimit!==void 0?{scenarioLimit:i.scenarioLimit,perScenarioLimit:i.perScenarioLimit}:void 0,{waitUntilExit:m}=n((0,e.jsx)(o,{children:(0,e.jsx)(a,{initialChatMode:"generate",initialObjective:i.objective,initialGenerateLimits:c})}),{exitOnCtrlC:!1});await m()}export{p as runGenerate};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-5COGCNED.js";import"./chunk-FUNKVREV.js";import"./chunk-OYJBABRV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{a as refreshOAuthToken};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-Q4V2GK5U.js";import"./chunk-UR6MHSHU.js";export{b as buildDeviceConfig,a as stableTargetId};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-GC5U55MW.js";import"./chunk-I7TIGB7K.js";import"./chunk-EXERQHXV.js";import"./chunk-BB2W35TW.js";import"./chunk-YKTYVJBN.js";import"./chunk-DNNZ353O.js";import"./chunk-NVGBE2DR.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{b as requiresBecause,a as reviewProtocolCtx,c as submitReview};
@@ -1,2 +0,0 @@
1
- import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as ke}from"./chunk-VRVFPMCR.js";import{k as he}from"./chunk-JN44V63O.js";import{a as ne,c as ie,d as ve}from"./chunk-7VZCXW74.js";import"./chunk-OS4VSIHT.js";import"./chunk-TRJUD3XJ.js";import{a as J}from"./chunk-A2SQD2AY.js";import"./chunk-AFPHLUQ5.js";import"./chunk-JZ26R6UL.js";import{b as Z,c as re,d as de,e as ue,f as K,h as G,i as me,k as fe,m as pe,n as ge}from"./chunk-2R7KL7YG.js";import{a as ee,b as te}from"./chunk-UJZZDPDY.js";import{a as N}from"./chunk-CLGC7VEO.js";import"./chunk-RKXHVP2Z.js";import"./chunk-JFAFKHDX.js";import"./chunk-GFKCTYCA.js";import"./chunk-DNNZ353O.js";import"./chunk-5DT7PIGB.js";import"./chunk-XWKUZJCP.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-5Y2G4NC7.js";import{A as V}from"./chunk-TH47OOBV.js";import{b as le}from"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import{i as ce}from"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import{a as se}from"./chunk-YCCUBQY4.js";import{x as h}from"./chunk-OFW3ZVTP.js";import{a as Y}from"./chunk-HCBYKLMW.js";import{a as F,b as x,k as ae}from"./chunk-C44QQJR4.js";import{a as We}from"./chunk-6YGTRKDT.js";import{e as U}from"./chunk-UR6MHSHU.js";var S=U(We(),1);function be(t,g,k){let{ref:D,reason:I,by:T}=k;if(!I||I.trim().length===0)return{record:null,errors:[{code:"REASON_REQUIRED",detail:"archiving a node needs a reason \u2014 it becomes the tombstone's provenance"}]};let C=g.resolve(D);if(!C)return{record:null,errors:[{code:"UNKNOWN_REF",detail:`no node '${D}' in the graph`}]};let l=g.tipOf(C.cid);if(g.superseded.has(l))return{record:null,errors:[{code:"ALREADY_ARCHIVED",detail:`${D} is already superseded at its tip (${l.slice(0,19)}\u2026)`}]};let b=ce(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[{kind:"node",old:l,new:null,reason:I,by:T}],source_head_moves:{}},{expectPrev:g.latestHash});return le(t),{record:b.record,errors:null}}function we(t){let g=t.by??{kind:"human",id:process.env.USER??"operator"},k=t.mode==="interactive"?"override":t.mode,D=k==="override"?{note:"override \xB7 auto-answers, won't ask"}:{},I=(r,i)=>ee(t.onChild,{verb:"design",subject:r,...D,fixCmd:`kane-cli design tests --use-case ${r}`},i,d=>({ok:d===0,exitCode:d})),T=(r,i,d)=>ee(t.onChild,{verb:"evolve",subject:r,...D,fixCmd:`kane-cli maintain evolve ${i}`},d,a=>({ok:a.outcome==="evolved",exitCode:a.code})),C={out:()=>{},err:()=>{},isTTY:!1,confirm:async()=>!0},l={applied:0,committed:0,retired:0,skipped:0,deferred:0,failed:0},b=new Map;for(let r of t.planRows)if(r.held_ref&&t.held){let i=t.held.rows.find(a=>a.temp_ref===r.held_ref);if(!i)continue;let d={kind:i.kind,ref:i.temp_ref,title:i.title,why:i.why,origin:"content-change",...r.impact?{impact:r.impact}:{}};b.set(d.ref,{card:d,source:"held",heldRef:i.temp_ref})}else if(r.kind==="MODIFY"){let i={kind:"MODIFY",ref:r.ref,title:r.ref,why:`${r.reason}: ${r.provenance}`,origin:r.origin??"structural-stale",...r.impact?{impact:r.impact}:{}};b.set(i.ref,{card:i,source:"row",row:r})}else if(r.kind==="ADD"){let i={kind:"ADD",ref:r.ref,title:r.ref,why:r.reason,origin:r.origin??"content-change"};b.set(i.ref,{card:i,source:"row",row:r})}for(let r of t.archive){if(r.kind!=="ARCHIVE")continue;let i={kind:"ARCHIVE",ref:r.ref,title:r.ref,why:r.why,provenance:r.why,...r.impact?{impact:r.impact}:{}};b.set(i.ref,{card:i,source:"archive",row:r})}for(let r of t.reviewFeeder?.()??[]){if(b.has(r.ref))continue;let i={kind:r.kind==="MODIFY_HELD"?"MODIFY":r.kind,ref:r.ref,title:r.title,why:r.why,...r.impact?{impact:r.impact}:{},...r.pair?{pair:r.pair}:{},...r.held?{held:!0}:{},...r.kind==="MODIFY_HELD"?{heldPayload:!0}:{}};b.set(i.ref,{card:i,source:"review",reviewCard:r})}let y=r=>(l.failed++,{outcome:"failed",detail:r});return{cards:()=>[...b.values()].map(r=>r.card),async submit(r,i){let d=b.get(r);if(!d)return y(`no card ${r}`);if(d.source==="review"){if(d.reviewCard.kind==="PAIR"&&i.v==="approve")return y(`${r} is a PAIR card \u2014 approve is not in its grammar (merge / keep both / defer); words ride a defer note`);let{submitReview:s}=await import("./verdicts-TDJLJJ3F.js"),w=i.v==="approve"?{v:"approve"}:i.v==="archive"?{v:"archive",because:i.because??""}:i.v==="skip"&&d.reviewCard.kind==="MODIFY_HELD"?{v:"keep_current"}:i.v==="defer"||i.v==="skip"?{v:"defer"}:i.v==="merge"?{v:"merge"}:{v:"keep_both"},v=await s({contextDir:t.contextDir,signals:o=>t.signals({ref:o.ref,verdict:o.verdict,...o.reason?{reason:o.reason}:{}})},d.reviewCard,w,g);return v.outcome==="failed"?(l.failed++,v):v.outcome==="deferred"?(l.deferred++,i.v==="defer"&&i.note?(t.signals({ref:r,verdict:"deferred-with-note",reason:i.note}),{...v,detail:`steering noted: "${i.note}" \u2014 decide ${d.reviewCard.kind==="PAIR"?"merge / keep both":"the verdict"} when it re-offers`}):v):v.outcome==="retired"?(l.retired++,v):v.outcome==="committed"?(l.committed++,v):(l.applied++,v)}if(i.v==="merge"||i.v==="keep_both")return y(`${r} is a ${d.card.kind} card \u2014 ${i.v} applies to review cards only`);if(i.v==="skip")return l.skipped++,t.signals({ref:r,verdict:"gap-dismissed"}),{outcome:"skipped"};if(i.v==="defer")return l.deferred++,i.note?(t.signals({ref:r,verdict:"deferred-with-note",reason:i.note}),{outcome:"deferred",detail:`steering noted: "${i.note}"`}):{outcome:"deferred"};if(i.v==="archive"){if(d.source!=="archive")return y(`${r} is not an ARCHIVE card`);let s=V(t.contextDir),w=s.resolve(d.row.ref);if(w&&s.superseded.has(s.tipOf(w.cid)))return l.skipped++,{outcome:"skipped",detail:"already retired \u2014 nothing to do"};let v=be(t.contextDir,V(t.contextDir),{ref:d.row.ref,reason:`reconcile retire: ${d.row.why}`,by:g});return v.errors?y(v.errors.map(o=>`${o.code}: ${o.detail}`).join("; ")):(l.retired++,t.signals({ref:r,verdict:"gap-resolved-archive",reason:d.row.why}),{outcome:"retired"})}if(d.source==="archive")return y(`${r} takes archive/skip/defer, not approve`);if(d.source==="held"){let s=he(t.contextDir,t.held,d.heldRef,g,i.edits);if(!s.ok)return y(s.message);if(s.kind==="ADD"){let w=await I(s.ref,()=>t.runDesign(s.ref,{yes:!0,mode:k,...i.steering?{because:i.steering}:{}}));return w!==0?(l.failed++,{outcome:"failed",landed:!0,detail:`committed ${s.ref}, but its design run exited ${w} \u2014 finish with kane-cli design tests --use-case ${s.ref}`}):(l.applied++,t.signals({ref:r,verdict:"gap-resolved-create",...i.steering?{reason:i.steering}:{}}),{outcome:"applied",detail:s.ref})}if(i.steering){let w=V(t.contextDir),v=ne(w,s.ref);if(!v.ok)return l.committed++,{outcome:"committed",detail:`committed ${s.ref}, but steering could not resolve it (${v.message}) \u2014 steer via kane-cli maintain evolve ${s.ref}`};let o=await T(v.target.display,s.ref,()=>ie(t.contextDir,v.target,{yes:!0,mode:k,because:i.steering},C,t.runDesign,"batch"));if(o.outcome==="no-design"){let c=await I(v.target.seamRef,()=>t.runDesign(v.target.seamRef,{yes:!0,mode:k,because:i.steering}));return c!==0?(l.failed++,{outcome:"failed",landed:!0,detail:`committed ${s.ref}, but its steered design run exited ${c} \u2014 finish with kane-cli design tests --use-case ${v.target.seamRef}`}):(l.applied++,t.signals({ref:r,verdict:"gap-resolved-create",reason:i.steering}),{outcome:"applied",detail:s.ref})}return o.outcome==="failed"||o.outcome==="paused"?(l.failed++,{outcome:"failed",landed:!0,detail:`committed ${s.ref}, but the steering evolve ${o.outcome} (exit ${o.code}) \u2014 finish with kane-cli maintain evolve ${s.ref}`}):o.outcome==="declined"?(l.committed++,{outcome:"committed",detail:`committed ${s.ref} \u2014 the steering evolve was declined; re-run kane-cli maintain evolve ${s.ref}`}):(l.applied++,t.signals({ref:r,verdict:"gap-resolved-evolve",reason:i.steering}),{outcome:"applied",detail:s.ref})}return l.committed++,t.signals({ref:r,verdict:"gap-resolved-evolve"}),{outcome:"committed",detail:s.ref}}let a=V(t.contextDir),u=ne(a,d.row.ref);if(!u.ok)return y(u.message);if(d.card.kind==="ADD"){let s=await I(u.target.seamRef,()=>t.runDesign(u.target.seamRef,{yes:!0,mode:k}));return s!==0?y(`design run exited ${s}`):(l.applied++,t.signals({ref:r,verdict:"gap-resolved-create"}),{outcome:"applied"})}let A=await T(u.target.display,d.row.ref,()=>ie(t.contextDir,u.target,{yes:!0,mode:k,...i.steering?{because:i.steering}:{}},C,t.runDesign,"batch"));return A.outcome==="evolved"?(l.applied++,t.signals({ref:r,verdict:"gap-resolved-evolve",...i.steering?{reason:i.steering}:{}}),{outcome:"applied"}):A.outcome==="failed"||A.outcome==="paused"?y(`evolve ${A.outcome} (exit ${A.code})`):(l.skipped++,{outcome:"skipped",detail:A.outcome})},summary:()=>({...l})}}var j=U(Y(),1);function q({mark:t,markColor:g,color:k,indent:D=2,reserve:I=0,children:T}){let{stdout:C}=ae(),l=(C?.columns??80)-I,b=D+t.length+1;return(0,j.jsxs)(F,{children:[(0,j.jsx)(F,{width:b,flexShrink:0,children:(0,j.jsx)(x,{color:g,children:`${" ".repeat(D)}${t}`})}),(0,j.jsx)(F,{width:Math.max(20,l-b),children:(0,j.jsx)(x,{color:k,children:T})})]})}var p=U(Y(),1);function ye(t){return t.landed?"committed":t.outcome}var Ee={applied:{mark:"\u2714",color:"green"},committed:{mark:"\u2714",color:"green"},retired:{mark:"\u2714",color:"green"},skipped:{mark:"\xB7",color:"dim"},deferred:{mark:"\u2013",color:"dim"},failed:{mark:"\u2717",color:"red"}};function Pe(t){return t.v==="archive"?"Retiring\u2026":t.v==="approve"&&t.steering?"Approving with your changes \u2014 committing, then re-designing\u2026":"Applying \u2014 committing\u2026"}function Oe({controller:t,cards:g,note:k,markOutcome:D,routeChat:I,listEvolveTargets:T,barSubject:C,meta:l,resumeCmd:b,activeChild:y,onFinish:r,onCtrlC:i,pauseRef:d}){let[a,u]=(0,S.useState)(g.length>0?{at:"card",idx:0,sel:0,editor:null}:{at:"done-panel",sel:0}),A=(0,S.useRef)(0),s=(0,S.useRef)(a);s.current=a;let w=(0,S.useRef)([]),[,v]=(0,S.useState)(0),o=a.at==="busy"||a.at==="evolving";(0,S.useEffect)(()=>{if(!o)return;let e=setInterval(()=>v(n=>n+1),120);return()=>clearInterval(e)},[o]);let c=()=>{let e=t.summary();return`${e.applied+e.committed} applied \xB7 ${e.retired} retired \xB7 ${e.skipped} skipped \xB7 ${e.deferred} deferred`+(e.failed>0?` \xB7 ${e.failed} failed`:"")},O=()=>({state:"complete",facts:[c()]}),R=()=>({state:"walk-paused",reason:"ctrl+c",facts:[c(),"every verdict so far is committed \u2014 re-run the same reconcile command to continue"],...b?{resume:b}:{}}),$=()=>r(A.current,O()),W=(0,S.useRef)(!1),P=()=>{r(3,R())},E=()=>{if(W.current)return;W.current=!0;let e=s.current;if(e.at==="busy"||e.at==="evolving"){k((0,p.jsx)(x,{color:h.dim,children:"finishing the current item, then pausing\u2026"}));return}if(e.at==="done-panel"||e.at==="picker"||e.at==="why"||e.at==="view"){$();return}P()};d&&(d.current=E);let _=a.at==="card"||a.at==="busy"?g[a.idx]:null,M=()=>[{key:"finish",label:"finish"},...T?[{key:"evolve",label:"evolve another use-case\u2026"}]:[],...w.current.length>0?[{key:"view",label:"view what changed"}]:[]],H=()=>{let e=T?.()??[];if(e.length===0){k((0,p.jsx)(x,{color:h.dim,children:"nothing is stale \u2014 no evolve targets right now"})),u({at:"done-panel",sel:0});return}u({at:"picker",items:e,sel:0})},xe=e=>{let n=e+1;n<g.length?u({at:"card",idx:n,sel:0,editor:null}):u({at:"done-panel",sel:0})},Q=(0,S.useRef)(!1),L=(e,n)=>{if(Q.current)return;Q.current=!0;let m=g[e];u({at:"busy",idx:e,label:Pe(n),startedAt:Date.now()}),t.submit(m.ref,n).catch(f=>({outcome:"failed",detail:f instanceof Error?f.message:String(f)})).then(f=>{let B=Ee[f.outcome]??{mark:"\xB7",color:"dim"},Te=f.outcome!=="failed"&&f.outcome!=="skipped"&&f.outcome!=="deferred"&&m.impact&&"stale_refs"in m.impact&&m.impact.stale_refs.length>0?` \xB7 ${m.impact.stale_refs.length} item(s) now stale`:"",oe=`${f.outcome} [${m.kind}] ${N(m.title)}${f.detail?` \u2014 ${N(f.detail)}`:""}${Te}`;if(w.current.push({mark:B.mark,color:B.color,line:oe}),k((0,p.jsx)(q,{mark:B.mark,markColor:B.color==="green"?h.green:B.color==="red"?h.red:h.dim,color:B.color==="dim"?h.dim:void 0,children:oe})),f.outcome==="failed"&&(A.current=A.current===0?1:A.current),D(m.ref,ye(f)),Q.current=!1,W.current){P();return}xe(e)})},Ce=(e,n)=>{u({at:"evolving",title:e.title,startedAt:Date.now()}),I(`${e.key} ${n}`).catch(m=>`\u2717 evolve failed: ${m instanceof Error?m.message:String(m)}`).then(m=>{let f=m.startsWith("\u2713");if(w.current.push({mark:f?"\u2714":"\u2717",color:f?"green":"red",line:m.replace(/^[✓✗]\s*/,"")}),k((0,p.jsx)(q,{mark:f?"\u2714":"\u2717",markColor:f?h.green:h.red,children:m.replace(/^[✓✗]\s*/,"")})),W.current){$();return}u({at:"done-panel",sel:0})})},Re=(0,S.useMemo)(()=>({isFocused:()=>{let e=s.current;return e.at==="card"&&e.editor===null||e.at==="done-panel"||e.at==="picker"||e.at==="view"},onMove:e=>{u(n=>{if(n.at==="card"){let m=g[n.idx],f=G(m)??K(m).length-1;return{...n,sel:Math.max(0,Math.min(f,n.sel+e))}}return n.at==="done-panel"?{...n,sel:Math.max(0,Math.min(M().length-1,n.sel+e))}:n.at==="picker"?{...n,sel:Math.max(0,Math.min(n.items.length-1,n.sel+e))}:n})},onSelect:()=>{let e=s.current;if(e.at==="card"){let n=g[e.idx],m=G(n);if(m!==null&&e.sel===m){u({...e,editor:"",editorIntent:"steer"});return}let f=K(n)[e.sel];if(f?.v==="archive"&&n.kind==="REVIEW"){u({...e,editor:"",editorIntent:"because"});return}f&&L(e.idx,{v:f.v});return}if(e.at==="done-panel"){let n=M()[e.sel];n?.key==="finish"?$():n?.key==="evolve"?H():n?.key==="view"&&u({at:"view"});return}if(e.at==="picker"){let n=e.items[e.sel];n&&u({at:"why",item:n,text:""});return}},onDigit:e=>{let n=s.current;if(n.at==="card"){let m=g[n.idx],f=K(m)[e-1];if(f?.v==="archive"&&m.kind==="REVIEW"){u({...n,editor:"",editorIntent:"because"});return}f&&L(n.idx,{v:f.v});return}n.at==="done-panel"&&e-1<M().length&&u({...n,sel:e-1}),n.at==="picker"&&e-1<n.items.length&&u({...n,sel:e-1})},onType:e=>{u(n=>n.at!=="card"||G(g[n.idx])===null?n:{...n,editor:(n.editor??"")+e,editorIntent:n.editorIntent??"steer"})},isMulti:()=>!1,onSpace:()=>{},onBack:()=>{let e=s.current;(e.at==="picker"||e.at==="view")&&u({at:"done-panel",sel:0})}}),[g]);(0,S.useEffect)(()=>{a.at==="done"&&$()},[a.at]);let $e=e=>Math.floor((Date.now()-e)/1e3),X=y?.current??null,De=a.at==="card"?{kind:"card",n:a.idx+1,m:g.length}:a.at==="busy"?X?{kind:"child-working",step:re(a.label)}:{kind:"working",step:re(a.label),elapsedS:$e(a.startedAt)}:a.at==="evolving"?{kind:"child-working",step:`evolving ${a.title}`}:{kind:"idle"},Se=a.at==="card"||a.at==="busy"?g.length-a.idx:0,Me=a.at==="done-panel"||a.at==="picker"||a.at==="why"||a.at==="view",Ie=[...a.at==="card"?a.editor!==null?["\u23CE submit","esc back"]:ge(g[a.idx]).keys:a.at==="done-panel"?pe(M(),{escBack:!1}).keys:a.at==="picker"?["\u2191\u2193 select","\u23CE confirm","esc back"]:a.at==="why"?["\u23CE submit","esc back"]:a.at==="view"?["esc back"]:[],"ctrl+c exit"],z=l??{verb:"reconcile",sid:"",env:""},Ae=`view \xB7 this run's changes \xB7 ${w.current.length}`;return(0,p.jsxs)(F,{flexDirection:"column",children:[(0,p.jsx)(ue,{onToggleThinking:()=>{},onCtrlC:()=>{i(),E()},panel:Re}),a.at==="card"&&_?(0,p.jsx)(me,{card:_,position:{n:a.idx+1,of:g.length},sel:a.sel,focused:a.editor===null,editorIntent:a.editorIntent??"steer",freeText:a.editor!==null?{value:a.editor,onChange:e=>u(n=>n.at==="card"?{...n,editor:e}:n),onSubmit:e=>{let n=s.current;if(n.at!=="card")return;let m=e.trim();if(!m){u({...n,editor:null,editorIntent:void 0});return}let f=g[n.idx];n.editorIntent==="because"?L(n.idx,{v:"archive",because:m}):f.kind==="PAIR"?L(n.idx,{v:"defer",note:m}):L(n.idx,{v:"approve",steering:m})},onCancel:()=>u(e=>e.at==="card"?{...e,editor:null,editorIntent:void 0}:e)}:null}):null,a.at==="done-panel"?(0,p.jsx)(Z,{headline:(()=>{let e=t.summary();return`reconcile done \u2014 ${e.applied+e.committed} applied \xB7 ${e.retired} retired \xB7 ${e.skipped} skipped \xB7 ${e.deferred} deferred${e.failed>0?` \xB7 ${e.failed} failed`:""}`})(),rows:M(),sel:a.sel,focused:!0}):null,a.at==="picker"?(0,p.jsx)(Z,{ask:!0,headline:"evolve which use-case?",rows:a.items.map(e=>({key:e.key,label:e.title,detail:e.badge})),sel:a.sel,focused:!0}):null,a.at==="why"?(0,p.jsxs)(F,{flexDirection:"column",borderStyle:"round",borderColor:h.assuranceAccent,paddingX:1,children:[(0,p.jsxs)(F,{children:[(0,p.jsxs)(x,{children:[(0,p.jsx)(x,{color:h.assuranceAccent,children:"\u25B8"})," ",(0,p.jsx)(x,{color:h.dim,children:"\u270E "})]}),(0,p.jsx)(se,{value:a.text,onChange:e=>u(n=>n.at==="why"?{...n,text:e}:n),onSubmit:e=>{let n=s.current;n.at==="why"&&(e.trim()?Ce(n.item,e.trim()):u({at:"picker",items:[n.item],sel:0}))},onCancel:()=>{s.current.at==="why"&&H()},placeholder:`what should change about ${a.item.title}?`})]}),(0,p.jsx)(x,{color:h.muted,children:" \u23CE submit \xB7 esc back"})]}):null,a.at==="view"?(0,p.jsxs)(F,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,p.jsx)(x,{bold:!0,color:h.assuranceAccent,children:Ae}),(0,p.jsx)(x,{children:" "}),w.current.map((e,n)=>(0,p.jsx)(q,{mark:e.mark,markColor:e.color==="green"?h.green:e.color==="red"?h.red:h.dim,color:e.color==="dim"?h.dim:void 0,indent:0,reserve:0,children:e.line},`vc-${n}`))]}):null,(0,p.jsx)(de,{status:De,meta:{...z,...C??z.subject?{subject:C??z.subject}:{}},tallies:fe(t.summary(),Se),keys:Ie,child:a.at==="evolving"?{verb:"evolve"}:X?{verb:X.verb}:void 0})]})}async function ut(t){let g={current:null},k=o=>{g.current?.append(o)},D=null,I=async(o,c)=>{let[{runDesign:O},{resolveAgentAuthEnv:R},{runAgent:$},{preflightTurn:W}]=await Promise.all([import("./run-26IR3CKX.js"),import("./spawner-ZSYJQGQW.js"),import("./bridge-GQJ35GTL.js"),import("./turn-preflight-JGYT7LXP.js")]);D??=await R();let P=D;return O({useCase:o,force:!0,mode:c.mode??"override",...c.because?{because:c.because}:{},...c.changeDelta!==void 0?{changeDelta:c.changeDelta}:{},...c.priorDesign!==void 0?{priorDesign:c.priorDesign}:{}},{contextDir:t.dir,agent:$,preflightTurn:()=>W(P),ask:async()=>[],out:()=>{},progress:()=>{},isTTY:!1,auth:P})},T=t.runDesign??I,C={current:null},l="",b=o=>{if(o.kind==="start")C.current={verb:o.verb},l=o.subject,k((0,p.jsxs)(x,{color:h.assuranceAccent,children:[`\u25CF ${te(o.verb).ing} ${N(o.subject)}`,o.note?(0,p.jsx)(x,{color:h.dim,children:` ${o.note}`}):null]}));else if(o.kind==="end"){let c=C.current?.verb??"design";C.current=null,k(o.ok?(0,p.jsx)(x,{color:h.green,children:`\u25CF ${te(c).ed} ${N(l)} \u2014 ${o.durS}s`}):(0,p.jsx)(x,{color:h.red,children:`\u25CF ${c} failed \u2014 ${o.exitCode!=null?`exited ${o.exitCode}`:"error"}${o.fixCmd?` \xB7 ${o.fixCmd}`:""}`}))}},y=we({contextDir:t.dir,held:t.held,archive:t.archive,planRows:t.rows,runDesign:T,mode:"interactive",signals:t.signals,onChild:b,reviewFeeder:()=>{try{return ke({contextDir:t.dir},V(t.dir))}catch{return[]}}}),r=new Set(t.rows.filter(o=>o.applied!==void 0).map(o=>o.held_ref??o.ref)),i=y.cards().filter(o=>!r.has(o.ref)&&!(o.kind==="ARCHIVE"&&t.archiveState?.[o.ref]!==void 0)),d=o=>t.rows.findIndex(c=>(c.held_ref??c.ref)===o),a=(o,c)=>{try{if(i.find($=>$.ref===o)?.kind==="ARCHIVE"){c==="retired"?t.markA?.(o,"retired"):c==="skipped"&&t.markA?.(o,"skipped");return}let R=d(o);if(R<0)return;c==="applied"||c==="committed"?t.mark?.(R,"approved"):c==="skipped"&&t.mark?.(R,"skipped")}catch{}},u=async o=>{let[{openGraph:c},{resolveParentUc:O,evolveOneUc:R}]=await Promise.all([import("./readmodel-XOYGGQ3S.js"),import("./evolve-cmd-DIA5EWUT.js")]),[$,...W]=o.split(/\s+/),P=c(t.dir),E=O(P,$);if(!E.ok)return`couldn't resolve '${$}' \u2014 start with a use-case id (uc-\u2026): ${E.message}`;if(W.length===0)return`say what to change: \`${$} <your words>\` \u2014 the words become the redesign's change delta`;let _=W.join(" "),M={out:()=>{},err:()=>{},isTTY:!1,confirm:async()=>!0},H=await R(t.dir,E.target,{yes:!0,mode:"override",because:_},M,T,"batch");return H.outcome==="evolved"?(t.signals({ref:E.target.display,verdict:"gap-resolved-evolve",reason:_}),`\u2713 redesigned ${E.target.display} \u2014 "${_}"`):`\u2717 evolve ${H.outcome} for ${E.target.display} (exit ${H.code})`},A=t.listEvolveTargets??(()=>{let o=V(t.dir);return ve(o).targets.map(c=>({key:c.display,title:c.display,badge:"stale"}))});if(t.script){let o=0;for(let c of i){let O=await t.script(c),R=await y.submit(c.ref,O);R.outcome==="failed"&&o===0&&(o=1),a(c.ref,ye(R))}return o}let[{render:s},{ScrollbackProvider:w},{ScrollbackTap:v}]=await Promise.all([import("./build-JIKYOZUH.js"),import("./scrollback-JLPJR25X.js"),import("./ScrollbackTap-Q3IOKNMS.js")]);return new Promise(o=>{let c=!1,O=(_,M)=>{c||(c=!0,(async()=>{process.removeListener("SIGINT",P),await g.current?.flush();try{E.unmount()}catch{}M&&J(M),o(_)})())},R=0,$={current:null},W=()=>{if(R+=1,R>=2){if(c)return;c=!0,process.removeListener("SIGINT",P);try{E.unmount()}catch{}J({state:"interrupted",reason:"ctrl+c \xD72",facts:["forced quit \u2014 every committed verdict is safe in the store"]}),o(130)}},P=()=>{W(),$.current?.()};process.on("SIGINT",P);let E=s((0,p.jsxs)(w,{children:[(0,p.jsx)(v,{into:g}),(0,p.jsx)(Oe,{controller:y,cards:i,note:k,markOutcome:a,routeChat:u,listEvolveTargets:A,barSubject:t.barSubject,meta:t.meta,resumeCmd:t.resumeCmd,activeChild:C,onFinish:O,onCtrlC:W,pauseRef:$})]}),{exitOnCtrlC:!1})})}export{Oe as WalkSessionSurface,ye as outcomeToMark,ut as runWalkSession};