@testmuai/kane-cli 0.8.5 → 0.8.6

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 (163) hide show
  1. package/dist/{ChatSurface-HAIVTS4J.js → ChatSurface-S2P7WMBI.js} +1 -1
  2. package/dist/{ChromeProfilePicker-5ILSVC2K.js → ChromeProfilePicker-7DTJK2QW.js} +1 -1
  3. package/dist/{CliFeedbackPrompt-LFKEYMKP.js → CliFeedbackPrompt-Y3OYZX54.js} +1 -1
  4. package/dist/{CliUploadProgress-Y7ITY2I7.js → CliUploadProgress-I3N5WDNJ.js} +1 -1
  5. package/dist/{ConfigView-OECNNCXC.js → ConfigView-EOYCKYJS.js} +1 -1
  6. package/dist/{EvidenceViewOffer-FODRAS6Z.js → EvidenceViewOffer-AQ3KB3EN.js} +1 -1
  7. package/dist/FolderPicker-RCHRYYC4.js +2 -0
  8. package/dist/{InfoBox-HWMHNWPM.js → InfoBox-QBXPPMM2.js} +1 -1
  9. package/dist/{LinksBox-TAGYCFFO.js → LinksBox-L24KON4U.js} +1 -1
  10. package/dist/{ProfilesView-QJBR3RCM.js → ProfilesView-H6XCTIXI.js} +1 -1
  11. package/dist/{ProjectPicker-PP75ILZU.js → ProjectPicker-F6JGF2B3.js} +1 -1
  12. package/dist/{SaveSessionPrompt-UCRET3II.js → SaveSessionPrompt-QGO65DZN.js} +1 -1
  13. package/dist/SingleShotApp-AY3XFEYT.js +2 -0
  14. package/dist/{SummaryBox-SLM3OFS2.js → SummaryBox-OZIZQY4B.js} +1 -1
  15. package/dist/TestMdRunView-RPW4MIJA.js +2 -0
  16. package/dist/{TestrunEvidenceTable-PTIBYAXO.js → TestrunEvidenceTable-A7WTTKTV.js} +1 -1
  17. package/dist/{WhoamiView-WPHMNYUV.js → WhoamiView-EB5AV27X.js} +1 -1
  18. package/dist/{app-download-GYQYLGT3.js → app-download-SQ4RDY3E.js} +1 -1
  19. package/dist/{auth-3DLNMZC2.js → auth-TW24FZQF.js} +1 -1
  20. package/dist/{binary-XJ3RF3VO.js → binary-5LMQJ3CZ.js} +1 -1
  21. package/dist/{bind-2N4Q6YKH.js → bind-SJ6DOVQ4.js} +2 -2
  22. package/dist/{bootstrap-5IHKW5SE.js → bootstrap-BTEXO6HX.js} +1 -1
  23. package/dist/bridge-GQJ35GTL.js +2 -0
  24. package/dist/{changelog-WCCTI47M.js → changelog-JLSLSA3Y.js} +1 -1
  25. package/dist/chunk-2DCNCH32.js +4 -0
  26. package/dist/{chunk-PEI2566X.js → chunk-2R7KL7YG.js} +1 -1
  27. package/dist/{chunk-T3XDMR5B.js → chunk-3LEVCW6R.js} +1 -1
  28. package/dist/{chunk-NLECZCMZ.js → chunk-3UUPP5W3.js} +1 -1
  29. package/dist/{chunk-PCOSE5SW.js → chunk-4NSP2NPT.js} +1 -1
  30. package/dist/{chunk-FTZPWXF7.js → chunk-4ONGF4NT.js} +1 -1
  31. package/dist/{chunk-ZFZ7YXEU.js → chunk-5COGCNED.js} +1 -1
  32. package/dist/{chunk-DCUT3GJA.js → chunk-7VZCXW74.js} +1 -1
  33. package/dist/{chunk-CGYSFLM2.js → chunk-A44G533S.js} +1 -1
  34. package/dist/{chunk-ZIRMSWKS.js → chunk-AO3PBE2V.js} +1 -1
  35. package/dist/{chunk-AJPLHW4T.js → chunk-ATWDQCDA.js} +1 -1
  36. package/dist/{chunk-UX3KPYTI.js → chunk-AWD56KGX.js} +1 -1
  37. package/dist/{chunk-YFLKS4UV.js → chunk-B4Q6FMIP.js} +3 -3
  38. package/dist/chunk-B5QGIUJA.js +26 -0
  39. package/dist/chunk-BN6AHQL7.js +17 -0
  40. package/dist/chunk-BRTARADN.js +4 -0
  41. package/dist/{chunk-BAL7E4OH.js → chunk-C4WTZSX4.js} +1 -1
  42. package/dist/{chunk-TCK3QMKY.js → chunk-CLLQQPBZ.js} +1 -1
  43. package/dist/{chunk-LA2EMSHE.js → chunk-CZUOGGUK.js} +1 -1
  44. package/dist/{chunk-FRSHEJUS.js → chunk-D4SRHIJ5.js} +1 -1
  45. package/dist/{chunk-Z2T7E5HM.js → chunk-DN3E6RT6.js} +2 -2
  46. package/dist/{chunk-PUFJEU46.js → chunk-DZCG7FFP.js} +1 -1
  47. package/dist/{chunk-CNNJ4U2L.js → chunk-E5S4BASB.js} +1 -1
  48. package/dist/{chunk-HQWLSA5M.js → chunk-ESC7AOCX.js} +1 -1
  49. package/dist/{chunk-W27F2NWA.js → chunk-EXERQHXV.js} +1 -1
  50. package/dist/{chunk-PWYEOBXV.js → chunk-FJYDEWOA.js} +1 -1
  51. package/dist/{chunk-35EUIBYJ.js → chunk-FMUCZWS3.js} +1 -1
  52. package/dist/{chunk-PB3GADUD.js → chunk-FUNKVREV.js} +1 -1
  53. package/dist/{chunk-GZ4X53ZA.js → chunk-FYS5VIOG.js} +2 -2
  54. package/dist/{chunk-HFCDUFV3.js → chunk-GC5U55MW.js} +1 -1
  55. package/dist/{chunk-RY6TFVAX.js → chunk-GELPKSLC.js} +1 -1
  56. package/dist/{chunk-5S46D5AJ.js → chunk-IGJIDN4U.js} +1 -1
  57. package/dist/{chunk-K2QV7FGP.js → chunk-INK66XQS.js} +1 -1
  58. package/dist/{chunk-EFRJNPBZ.js → chunk-IWM5EZC3.js} +2 -2
  59. package/dist/chunk-JCD6FP7A.js +5 -0
  60. package/dist/{chunk-M335FQYJ.js → chunk-JN44V63O.js} +2 -2
  61. package/dist/{chunk-GYF4CH62.js → chunk-KDXQNLVV.js} +2 -2
  62. package/dist/{chunk-O3AY6JHJ.js → chunk-KLTKEGDH.js} +1 -1
  63. package/dist/{chunk-MJ56GUKS.js → chunk-KQ2MYMOS.js} +1 -1
  64. package/dist/chunk-LN7233E2.js +20 -0
  65. package/dist/{chunk-KWKUMBHS.js → chunk-MKSTP2XN.js} +2 -2
  66. package/dist/{chunk-NHOHQBIF.js → chunk-NT3UETTV.js} +1 -1
  67. package/dist/{chunk-CCUGKBIH.js → chunk-OFW3ZVTP.js} +1 -1
  68. package/dist/{chunk-WLOGO44E.js → chunk-OYJBABRV.js} +1 -1
  69. package/dist/{chunk-JJWQUQJ2.js → chunk-P3RKXL3V.js} +1 -1
  70. package/dist/{chunk-MUGMUKSZ.js → chunk-PT7V5WDQ.js} +1 -1
  71. package/dist/chunk-Q4V2GK5U.js +2 -0
  72. package/dist/{chunk-3AJ3QSF5.js → chunk-QBG7XEGQ.js} +2 -2
  73. package/dist/{chunk-E3BXNQYE.js → chunk-QISE272H.js} +1 -1
  74. package/dist/{chunk-G4AFOZKU.js → chunk-QQAAPFIR.js} +1 -1
  75. package/dist/{chunk-PQUMOFT5.js → chunk-RDNKYRKY.js} +1 -1
  76. package/dist/{chunk-5NSYHRDN.js → chunk-RX5TZZNQ.js} +1 -1
  77. package/dist/{chunk-TJZMYU2W.js → chunk-RZLD7TPG.js} +1 -1
  78. package/dist/{chunk-66BSTNLD.js → chunk-S66MCU2Y.js} +1 -1
  79. package/dist/{chunk-WYST42WI.js → chunk-SORVX3KI.js} +1 -1
  80. package/dist/{chunk-KX2GOJ4C.js → chunk-SQC4P2Q7.js} +1 -1
  81. package/dist/{chunk-JRQKUQWL.js → chunk-SQGBFCFO.js} +1 -1
  82. package/dist/{chunk-T5LKD2OB.js → chunk-SS5TOK2J.js} +1 -1
  83. package/dist/{chunk-DJ7T7BMV.js → chunk-TDS6LG6T.js} +1 -1
  84. package/dist/{chunk-7JUUNZQP.js → chunk-TKYJTXWL.js} +1 -1
  85. package/dist/{chunk-JN2DP4R2.js → chunk-TQKIE7AX.js} +1 -1
  86. package/dist/{chunk-K7UYWAZH.js → chunk-TZFT7R7B.js} +1 -1
  87. package/dist/{chunk-AMULIFC5.js → chunk-USI2WMAK.js} +1 -1
  88. package/dist/{chunk-NYSMQ7UY.js → chunk-VMCSRLRC.js} +1 -1
  89. package/dist/{chunk-7PADFQ5S.js → chunk-VOBXYDJW.js} +2 -2
  90. package/dist/{chunk-R7OGNE3W.js → chunk-WMQJBEQP.js} +1 -1
  91. package/dist/{chunk-OWTEHU6B.js → chunk-XJILZ2WN.js} +1 -1
  92. package/dist/{chunk-2K2BX23I.js → chunk-XQFITNA3.js} +1 -1
  93. package/dist/{chunk-4D3DNCQY.js → chunk-XY325HDJ.js} +1 -1
  94. package/dist/{chunk-Q6JHBDW2.js → chunk-YEQVJWEF.js} +1 -1
  95. package/dist/{chunk-6BTZ2Q4P.js → chunk-YHTYPTDD.js} +1 -1
  96. package/dist/{chunk-2WSOPZJU.js → chunk-YZ45OEH3.js} +1 -1
  97. package/dist/{chunk-BJHII5SD.js → chunk-Z35BUPZT.js} +1 -1
  98. package/dist/{chunk-4UMQDH52.js → chunk-ZLSWHCWO.js} +1 -1
  99. package/dist/{chunk-FDWEL5HR.js → chunk-ZRKPZLLG.js} +1 -1
  100. package/dist/{config-OKTAPFOT.js → config-6TQIMTNB.js} +1 -1
  101. package/dist/{credentials-SO3DSQEM.js → credentials-ZSNM4BTD.js} +1 -1
  102. package/dist/{deps-bundle-FRM65BQO.js → deps-bundle-D2ZC2SPT.js} +1 -1
  103. package/dist/{deps-resolve-RPZORKUN.js → deps-resolve-VRBMFUTX.js} +1 -1
  104. package/dist/{dispatch-OZRMWY25.js → dispatch-2PBSJ7YW.js} +1 -1
  105. package/dist/doctor-OWRRDA4Z.js +2 -0
  106. package/dist/{evidence-5AUZMKE3.js → evidence-NDAKCCHQ.js} +1 -1
  107. package/dist/{evolve-cmd-TWYJL4EG.js → evolve-cmd-DIA5EWUT.js} +1 -1
  108. package/dist/{extract-bind-EW7XUDLQ.js → extract-bind-TJ2STXV5.js} +2 -2
  109. package/dist/{extract-cmd-HOVGMBGM.js → extract-cmd-FLOYO6HL.js} +1 -1
  110. package/dist/{generate-headless-FYTJULPG.js → generate-headless-DBT4MKQT.js} +2 -2
  111. package/dist/index.js +69 -69
  112. package/dist/{ingest-4447MYLF.js → ingest-JO5NJENZ.js} +1 -1
  113. package/dist/{ingest-cmd-RJLTFNMN.js → ingest-cmd-T6HM3AHK.js} +1 -1
  114. package/dist/install-NIVU4XVS.js +2 -0
  115. package/dist/{interactive-bind-PSEYAL54.js → interactive-bind-7UDJY4CF.js} +3 -3
  116. package/dist/{list-commands-2SVSEAP6.js → list-commands-DA4ZXOPJ.js} +1 -1
  117. package/dist/login-flow-NHBJVDW6.js +2 -0
  118. package/dist/{mobile-prompts-T6HZ2YLY.js → mobile-prompts-JS7GPVKS.js} +1 -1
  119. package/dist/{persist-recorded-session-O2NCYTSD.js → persist-recorded-session-LE3LGFOS.js} +1 -1
  120. package/dist/pipeline-MTAZDCZR.js +2 -0
  121. package/dist/prepare-target-YK2DLDWB.js +2 -0
  122. package/dist/{reconcile-cmd-FU3JIHTO.js → reconcile-cmd-CYRYVS5B.js} +1 -1
  123. package/dist/{reconcile-deps-SUKZA2FL.js → reconcile-deps-FYXRAMF2.js} +2 -2
  124. package/dist/{reconcile-engine-ILL4M3NW.js → reconcile-engine-6AT6EVGS.js} +1 -1
  125. package/dist/{recording-banner-5VXVKCV4.js → recording-banner-YMKWR3M3.js} +1 -1
  126. package/dist/{registry-BKV3EDTK.js → registry-V45ZQ6Q5.js} +1 -1
  127. package/dist/{require-project-folder-2IO6IX5W.js → require-project-folder-3KS7KTME.js} +1 -1
  128. package/dist/resolve-run-intent-W32G6WM6.js +2 -0
  129. package/dist/{resolver-CBTWTZZR.js → resolver-V5VP5FLT.js} +1 -1
  130. package/dist/{run-EXIYK6PU.js → run-26IR3CKX.js} +1 -1
  131. package/dist/{run-R7GND73C.js → run-5IYI2TJI.js} +1 -1
  132. package/dist/{run-test-md-664ASWRQ.js → run-test-md-FO2RNNOD.js} +2 -2
  133. package/dist/{skill-installer-QLQK4JJE.js → skill-installer-W4TT5MST.js} +1 -1
  134. package/dist/{spawner-ANLF7OX3.js → spawner-ZSYJQGQW.js} +1 -1
  135. package/dist/tcg-generate-ONLV5GXG.js +2 -0
  136. package/dist/{testmd-actions-QZD3N4EH.js → testmd-actions-NPILETCQ.js} +1 -1
  137. package/dist/token-refresh-G2CSTY4B.js +2 -0
  138. package/dist/{types-VYEOJ6U2.js → types-O23GN2YM.js} +1 -1
  139. package/dist/{validate-basic-D7IJUFUQ.js → validate-basic-727KRHX6.js} +1 -1
  140. package/dist/{verdicts-EO5TZ5BW.js → verdicts-TDJLJJ3F.js} +1 -1
  141. package/dist/{version-check-JRLPWQ6T.js → version-check-A2JQYRI2.js} +1 -1
  142. package/dist/{walk-session-IODOH7QU.js → walk-session-HB3OOWVR.js} +1 -1
  143. package/dist/{with-telemetry-ASNQQBGP.js → with-telemetry-HSD6CXDS.js} +1 -1
  144. package/package.json +11 -11
  145. package/dist/FolderPicker-5U3RHHBE.js +0 -2
  146. package/dist/SingleShotApp-XWOPGLKZ.js +0 -2
  147. package/dist/TestMdRunView-6BY3IUH5.js +0 -2
  148. package/dist/bridge-LOBTHY3P.js +0 -2
  149. package/dist/chunk-6DTWVLSJ.js +0 -4
  150. package/dist/chunk-BG66IAO6.js +0 -19
  151. package/dist/chunk-BVKDHHPK.js +0 -5
  152. package/dist/chunk-KBMQGNKO.js +0 -26
  153. package/dist/chunk-UOMRMCMI.js +0 -2
  154. package/dist/chunk-VT2XNEOD.js +0 -10
  155. package/dist/chunk-X2FM67OM.js +0 -4
  156. package/dist/doctor-VWGEQYBB.js +0 -2
  157. package/dist/install-46S4VOZ4.js +0 -2
  158. package/dist/login-flow-U43QVFPH.js +0 -2
  159. package/dist/pipeline-BHEA7ODT.js +0 -2
  160. package/dist/prepare-target-27UN4KNO.js +0 -2
  161. package/dist/resolve-run-intent-ZML3HKG7.js +0 -2
  162. package/dist/tcg-generate-VBC5ODDI.js +0 -2
  163. package/dist/token-refresh-PIUX5OFA.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as wn,b as me,c as It,d as $n,e as Dt,g as rt,h as it,i as Cn,j as Rn,l as Sn,m as Bt,n as In}from"./chunk-PEI2566X.js";import{a as le,b as Oe,c as vn}from"./chunk-6J5T5FEY.js";import{b as Rt}from"./chunk-UJZZDPDY.js";import{a as yn}from"./chunk-CLGC7VEO.js";import{a as tt}from"./chunk-LQQXPY5B.js";import{a as nt,d as _e,e as Tn,f as St}from"./chunk-RKXHVP2Z.js";import{a as xn,b as kn,c as bn}from"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-6KPPGMO2.js";import{a as gn,b as hn,c as pn}from"./chunk-T3XDMR5B.js";import"./chunk-NVGBE2DR.js";import{a as dn}from"./chunk-5Y2G4NC7.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{a as et}from"./chunk-YCCUBQY4.js";import{a as mn}from"./chunk-PQUMOFT5.js";import{x as r}from"./chunk-CCUGKBIH.js";import{b as fn}from"./chunk-DFS4RMVP.js";import{a as Q}from"./chunk-HCBYKLMW.js";import{a as k,b as n,k as Ze}from"./chunk-C44QQJR4.js";import{a as Mr}from"./chunk-6YGTRKDT.js";import{e as V}from"./chunk-UR6MHSHU.js";var m=V(Mr(),1);var a=V(Q(),1),Ar=60,Lr=100;function Et(t,o){let l=t.options.length,u=l,g=t.multi_select?u++:null,x=t.allow_free_text?u++:null,f=o?u++:null;return{optionCount:l,doneIdx:g,freeIdx:x,batchIdx:f,maxSel:u-1}}var Or="\xA0",_r={high:{text:`\u203C${Or}high`,color:r.red},med:{text:"med",color:"yellow"},low:{text:"low",color:r.dim}};function Pr(t){let o=(t.header??t.text.split(/\s+/).slice(0,3).join(" ")).trim();return o.length>16?`${o.slice(0,15)}\u2026`:o}function qr(t,o,l){let u=p=>t[p].length+6,g=u(o),x=o,f=o;for(;;){let p=f+1<t.length?u(f+1):1/0,C=x-1>=0?u(x-1):1/0;if(p===1/0&&C===1/0)break;if(p<=C){if(g+p>l)break;g+=p,f+=1}else{if(g+C>l)break;g+=C,x-=1}}return{lo:x,hi:f}}function Dn({batch:t,qView:o,sel:l=0,focused:u=!1,freeText:g=null,optionText:x=null,attach:f=null,multiSelFor:p,childPrefix:C}){let{stdout:M}=Ze(),v=M?.columns??80,T=v<Ar,W=Math.min(v-1,Lr),$=Math.max(0,Math.min(t.questions.length-1,o??(t.cursor<0?0:t.cursor))),I=t.questions[$],N=t.resolution[$],L=t.resolution.filter(D=>!D).length,B=t.questions.length-L,P=tt(t),O=Et(I,P!==""),H=p?p($):[],K=_r[I.risk],re=D=>u&&l===D?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" ",S=`? ${C??""}the agent needs ${L===1?"one answer":`${L} answers`}`,$e=t.questions.length>1?` \xB7 ${$+1} of ${t.questions.length} \xB7 ${B} answered`:"",z=(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsxs)(n,{bold:!0,children:[I.text,K?(0,a.jsx)(n,{color:K.color,bold:!1,children:` ${K.text}`}):null]})}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:I.rationale})}),(0,a.jsx)(n,{children:" "}),I.options.map((D,w)=>{let X=u&&l===w;return x&&x.optionIndex===w?(0,a.jsx)(k,{flexDirection:"column",children:(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:`${w+1}. ${D.label}`}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:x.value,onChange:x.onChange,onSubmit:x.onSubmit,onCancel:x.onCancel,placeholder:D.detail||"type your answer"})]})},`o-${w}`):(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsxs)(n,{children:[re(w)," ",I.multi_select?(0,a.jsx)(n,{color:H.includes(w)?r.green:r.dim,children:H.includes(w)?"[x] ":"[ ] "}):null,(0,a.jsx)(n,{color:X?r.assuranceAccent:void 0,children:`${w+1}. ${D.label}`}),w===I.recommended_index?(0,a.jsx)(n,{color:r.dim,children:" (recommended)"}):null,N?.selected_index===w?(0,a.jsx)(n,{color:r.dim,children:" (current)"}):null]}),D.detail?(0,a.jsx)(k,{paddingLeft:5,children:(0,a.jsx)(n,{color:r.dim,children:D.detail})}):null]},`o-${w}`)}),I.multi_select&&O.doneIdx!=null?(0,a.jsxs)(n,{children:[re(O.doneIdx)," ",(0,a.jsx)(n,{color:r.green,children:"\u2714"}),(0,a.jsx)(n,{color:u&&l===O.doneIdx?r.assuranceAccent:void 0,children:" done \u2014 confirm selection"})]}):null,I.allow_free_text?(0,a.jsx)(n,{children:" "}):null,I.allow_free_text?g?(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.dim,children:"\u270E "})]}),(0,a.jsx)(et,{value:g.value,onChange:g.onChange,onSubmit:g.onSubmit,onCancel:g.onCancel,placeholder:"Tell me what to do"})]}):(0,a.jsxs)(n,{children:[O.freeIdx!=null?re(O.freeIdx):" "," ",(0,a.jsx)(n,{color:u&&O.freeIdx!=null&&l===O.freeIdx?r.assuranceAccent:r.dim,children:"\u270E Tell me what to do"})]}):null,f?(0,a.jsxs)(k,{flexDirection:"column",marginTop:1,children:[(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"@ attach a file or URL"}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:f.value,onChange:f.onChange,onSubmit:f.onSubmit,onCancel:f.onCancel,placeholder:"path or URL"})]}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:"the questions are set aside \u2014 the agent reads the source and re-asks what's still open"})})]}):null]}),j=P!==""?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n,{children:" "}),(0,a.jsxs)(n,{children:[u&&O.batchIdx!=null&&l===O.batchIdx?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" "," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"\xBB"}),(0,a.jsx)(n,{bold:!0,color:u&&O.batchIdx!=null&&l===O.batchIdx?r.assuranceAccent:void 0,children:" Go with recommendations"}),L>=5?(0,a.jsx)(n,{color:r.dim,children:` \u2014 resolves all ${L} open`}):null,(0,a.jsx)(n,{color:r.dim,children:" (tab)"})]})]}):null;if(T)return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsx)(n,{color:r.assuranceAccent,bold:!0,children:S}),t.questions.length>1?(0,a.jsx)(n,{color:r.dim,children:$e.replace(/^ · /,"")}):null,(0,a.jsx)(n,{children:" "}),z,j]});let h=t.questions.map(D=>Pr(D)),ce=t.questions.length>1?qr(h,$,W-8):null;return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsxs)(n,{color:r.assuranceAccent,children:[(0,a.jsx)(n,{bold:!0,children:S}),$e?(0,a.jsx)(n,{color:r.dim,children:$e}):null]}),ce?(0,a.jsx)(k,{marginTop:1,children:(0,a.jsxs)(n,{children:[ce.lo>0?(0,a.jsx)(n,{color:r.dim,children:"\u25C0 "}):" ",t.questions.slice(ce.lo,ce.hi+1).map((D,w)=>{let X=ce.lo+w,Pe=w>0?" ":"";return X===$?(0,a.jsxs)(n,{children:[Pe,(0,a.jsx)(n,{backgroundColor:r.assuranceAccent,color:"#0d1117",bold:!0,children:` ${h[X]} `})]},D.id):(0,a.jsxs)(n,{children:[Pe,t.resolution[X]?(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.green,children:"\u2713 "}),(0,a.jsx)(n,{color:r.dim,children:h[X]})]}):(0,a.jsx)(n,{color:r.dim,children:`\u25CB ${h[X]}`})]},D.id)}),ce.hi<t.questions.length-1?(0,a.jsx)(n,{color:r.dim,children:" \u25B6"}):null]})}):null,(0,a.jsx)(n,{children:" "}),z,j]})}var A=V(Q(),1),Bn={high:0,med:1,low:2},jr={high:r.red,med:"yellow",low:r.dim};function Fr(t){return t.map((o,l)=>({r:o,i:l})).sort((o,l)=>(Bn[o.r.risk??"zz"]??3)-(Bn[l.r.risk??"zz"]??3)||o.i-l.i).map(({r:o})=>o)}function En({rows:t,width:o=120,badgeHeader:l="risk"}){if(t.length===0)return null;let u=Fr(t),g=B=>B.staged||!B.id?"(staged)":yn(B.id),x=Math.max(2,...u.map(B=>g(B).length)),f=Math.max(l.length,...u.map(B=>(B.badge??"").length)),p=o>=84&&u.some(B=>B.summary),M=o-(p?13:10)-x-f,v=Math.max(...u.map(B=>Math.max(B.title.length,(B.marker??"").length)),5),T=Math.max(5,p?Math.min(v,Math.max(16,Math.floor(M*.5))):Math.min(v,M)),W=p?Math.max(7,M-T):0,$=(B,P,O,H)=>vn(B,P,O,H.map(K=>K.length)),I=(B,P,O,H)=>[Oe(le(B,x),x),Oe(le(P,T),T),Oe(le(O,f),f),...p?[Oe(le(H,W),W)]:[]],N=I("id","title",l,"summary"),L=[];L.push((0,A.jsx)(n,{color:r.dim,children:$("\u250C","\u252C","\u2510",N)},"t")),L.push((0,A.jsxs)(n,{children:[N.map((B,P)=>(0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:P===0?"\u2502 ":" \u2502 "}),(0,A.jsx)(n,{bold:!0,children:B})]},P)),(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},"h")),L.push((0,A.jsx)(n,{color:r.dim,children:$("\u251C","\u253C","\u2524",N)},"m"));for(let[B,P]of u.entries()){let O=I(g(P),le(P.title,T),le(P.badge??"",f),le(P.summary??"",W)),H=P.badgeColor??jr[P.badge??""]??r.dim;if(L.push((0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:"\u2502 "}),(0,A.jsx)(n,{color:r.assuranceAccent,children:O[0]}),(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[1],(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),(0,A.jsx)(n,{color:H,children:O[2]}),p?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[3]]}):null,(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},`r-${B}`)),P.marker){let K=I("",le(P.marker,T),"","");L.push((0,A.jsx)(n,{color:r.dim,children:`\u2502 ${K.join(" \u2502 ")} \u2502`},`mk-${B}`))}}return L.push((0,A.jsx)(n,{color:r.dim,children:$("\u2514","\u2534","\u2518",N)},"b")),(0,A.jsx)(A.Fragment,{children:L})}var y=V(Q(),1);function Wr(t){let o=t.form==="assumed"?" (assumed)":t.form==="deferred"?"":" (you)",l=t.note?` \u2014 ${t.note}`:"";return t.form==="deferred"?`\u21B3 deferred q${t.qNum} ${t.stub}${l}`:t.form==="changed"?`\u21B3 changed q${t.qNum} ${t.stub}: ${t.prev??"?"} \u2192 ${t.choice??"?"}${o}${l}`:`\u21B3 ${t.form} q${t.qNum} ${t.stub}: ${t.choice??"?"}${o}${l}`}var Vr=()=>(process.stdout?.columns??100)-12;function Mn({block:t,annotations:o}){let l=t.era??0,u=Nr(t,o??null);return l>0?(0,y.jsx)(k,{marginLeft:l*2,children:u}):u}function Nr(t,o){switch(t.kind){case"banner":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{bold:!0,color:r.assuranceAccent,children:` ${t.text}`})});case"user":return(0,y.jsxs)(k,{marginTop:1,children:[(0,y.jsx)(n,{color:r.orange,children:"\u276F "}),(0,y.jsx)(n,{children:t.text})]});case"note":return(0,y.jsx)(n,{color:r.dim,children:` ${t.text}`});case"agent":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(hn,{text:t.text,accent:r.assuranceAccent})});case"worked":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{color:r.dim,children:` \u2699 ${bn(t.durS,t.toolCalls,t.tools)}`})});case"usage":return(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.credits.toFixed(1)} credits \u2014 total ${t.total.toFixed(1)}`});case"turn":{let l=o,u=l?l.fresh:t.items.map((v,T)=>({item:v,num:T+1,updated:!1})),g={usecase:"risk","use-case":"risk",ac:"check",scenario:"kind",test:"check",gap:"severity",stylenote:"kind"},x=v=>v.kind??"use-case",f=new Map;for(let v of u){let T=v.item,W=x(v.item),$=T.risk==="high"||T.risk==="med"||T.risk==="low"?T.risk:void 0,I={id:T.logical_id??"",staged:!T.logical_id,title:T.title,badge:T.badge??T.risk??"",summary:T.why??T.summary??T.description??"",...$?{risk:$}:{},...v.updated?{marker:"\u21B3 changed"}:{}},N=f.get(W)??[];N.push(I),f.set(W,N)}let p=u.some(v=>!!v.item.kind),C=(l?.unchanged??[]).reduce((v,T)=>v+T.count,0),M=l?.headerStats?` \u2014 ${l.headerStats}${C>0?` (${C} unchanged)`:""}`:"";return(0,y.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(0,y.jsxs)(n,{bold:!0,children:[p?"design":t.heading,M?(0,y.jsx)(n,{bold:!1,color:r.dim,children:M}):null]}),[...f.entries()].map(([v,T])=>(0,y.jsxs)(k,{flexDirection:"column",children:[f.size>1?(0,y.jsx)(n,{color:r.dim,children:`${nt(v)} \xB7 ${T.length}`}):null,(0,y.jsx)(En,{rows:T,width:Vr(),badgeHeader:g[v]??"info"})]},v)),l&&l.unchanged.length>0&&(0,y.jsx)(n,{color:r.dim,children:` \u22EE unchanged: ${l.unchanged.map(v=>`${v.count} ${v.label}`).join(" \xB7 ")}`})]})}case"answer":return(0,y.jsx)(n,{color:r.dim,children:Wr(t.receipt)});case"continued":return(0,y.jsx)(n,{color:r.dim,children:"\u21B3 continued"});case"childOpen":{let{ing:l}=Rt(t.verb);return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsxs)(n,{color:r.assuranceAccent,children:[`\u25CF ${l} ${t.subject}`,t.sid?(0,y.jsx)(n,{color:r.dim,children:` \u2014 ${t.sid}`}):null,t.note?(0,y.jsx)(n,{color:r.dim,children:` ${t.note}`}):null]})})}case"childClose":{let{ed:l}=Rt(t.verb);if(!t.ok)return(0,y.jsxs)(n,{color:r.red,children:[`\u25CF ${t.verb} failed \u2014 ${t.exitCode!=null?`exited ${t.exitCode}`:"error"}`,t.fixCmd?(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.fixCmd}`}):null]});let u=[kn(t.durS),...t.results?[t.results]:[],...t.credits!==void 0?[`${t.credits.toFixed(1)} credits`]:[]].join(" \xB7 ");return(0,y.jsx)(n,{color:r.green,children:`\u25CF ${l} ${t.subject} \u2014 ${u}`})}case"childBack":return(0,y.jsx)(n,{color:r.dim,children:`back with ${t.parentVerb} \u2014 ${t.context}`});case"commit":return(0,y.jsxs)(k,{flexDirection:"column",children:[(0,y.jsx)(n,{color:t.ok?r.green:r.red,children:` ${t.ok?"\u2714":"\u2717"} ${t.line}`}),(t.warnings??[]).map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:` \u26A0 ${l}`},`w-${u}`))]});case"error":return(0,y.jsxs)(mn,{variant:"error",paddingX:1,children:[(0,y.jsx)(n,{color:r.red,children:t.title}),t.detail.map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:l},`d-${u}`))]})}}var Te=V(Q(),1);function An({item:t}){return(0,Te.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(t.cite??[]).map((o,l)=>(0,Te.jsx)(n,{dimColor:!0,children:`cite ${o.anchor??"conv"} \u2014 "${o.quote??""}"`},`cite-${l}`)),(t.depends_on_hint??[]).length>0&&(0,Te.jsx)(n,{dimColor:!0,children:`depends on: ${(t.depends_on_hint??[]).join(", ")}`}),Object.entries(t.extra??{}).map(([o,l])=>(0,Te.jsx)(n,{dimColor:!0,children:`${o}: ${l}`},`extra-${o}`))]})}var R=V(Q(),1),Mt=(t,o)=>Math.max(0,Math.min(o,t));function ot(t,o,l){switch(o.type){case"move":return t.level==="detail"?{...t,scroll:Math.max(0,(t.scroll??0)+o.delta)}:{...t,cursor:Mt(t.cursor+o.delta,Math.max(0,l-1))};case"enter":return t.level==="list"?{...t,level:"detail",scroll:0}:t;case"back":return t.level==="detail"?{...t,level:"list",scroll:0}:null}}var On={"use-case":"use-cases",ac:"acs",scenario:"scenarios",test:"tests",gap:"gaps"};function _n(t,o){if(t.level==="detail")return{level:"detail",cursor:Mt(t.num-1,Math.max(0,o.entries.length-1))};if(t.section){let l=o.entries.findIndex(u=>On[u.kind]===t.section);if(l>=0)return{level:"list",cursor:l}}return{level:"list",cursor:0}}function Kr(t){let o=[];for(let l of t.entries){let u=o.find(g=>g.kind===l.kind);u?u.entries.push(l):o.push({kind:l.kind,entries:[l]})}return o}var Ln=3;function Ur({items:t,cursor:o,verb:l,more:u}){let g=`view \xB7 ${l} so far \xB7 ${t.counts.map(f=>`${f.count} ${f.count===1?f.label.replace(/s$/,""):f.label}`).join(" \xB7 ")}`,x=t.entries[o];return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,color:r.assuranceAccent,children:g}),Kr(t).map(({kind:f,entries:p})=>{let C=x?.kind===f,M=C?p.findIndex($=>$.ref===x.ref):-1,v=C?Mt(M-1,Math.max(0,p.length-Ln)):0,T=p.slice(v,v+(C?Ln:1)),W=p.length-T.length;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{color:r.dim,children:`${On[f]??nt(f)} \xB7 ${p.length}`}),T.map($=>{let I=C&&$.ref===x.ref,N=$.item.badge;return(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:I?"\u203A ":" "}),(0,R.jsx)(n,{children:`${$.num} \xB7 ${$.item.title}`}),N?(0,R.jsx)(n,{color:r.dim,children:` \xB7 ${N}`}):null]},`${$.kind}:${$.ref}`)}),W>0&&(0,R.jsx)(n,{color:r.dim,children:` \u22EE ${W} more`})]},f)}),u?(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:o===t.entries.length?"\u203A ":" "}),(0,R.jsx)(n,{color:r.dim,children:`\u22EF show all \u2014 ${u.hidden} more from earlier turns`})]}):null]})}var st=14;function Qr({items:t,cursor:o,explain:l,grandTotal:u,dossier:g,scroll:x=0}){let f=t.entries[o];if(!f)return(0,R.jsx)(n,{color:r.dim,children:"nothing to show"});if(g){let C=Math.max(0,Math.min(x,Math.max(0,g.lines.length-st))),M=g.lines.slice(C,C+st);return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsxs)(n,{bold:!0,children:[`view \xB7 ${g.id}`,g.id.toLowerCase()!==g.rawId?(0,R.jsx)(n,{bold:!1,color:r.dim,children:` \xB7 ${g.rawId}`}):null]}),(0,R.jsx)(n,{bold:!0,children:g.title}),C>0?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${C} above`}):null,M.map((v,T)=>(0,R.jsx)(n,{color:v.dim?r.dim:void 0,children:v.text},`dl-${T}`)),g.lines.length>C+st?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${g.lines.length-C-st} more`}):null]})}let p=f.item;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,children:`view \xB7 ${f.kind} ${f.num} of ${u??t.entries.length}`}),(0,R.jsx)(n,{children:f.item.title}),p.badge?(0,R.jsx)(n,{color:r.dim,children:`kind: ${p.badge}`}):null,p.why?(0,R.jsx)(n,{color:r.dim,children:p.why}):null,(0,R.jsx)(An,{item:f.item}),l?.map((C,M)=>(0,R.jsx)(n,{color:r.dim,children:C},`ex-${M}`)),(0,R.jsx)(n,{color:r.dim,children:"view-only \u2014 approvals happen in chat"})]})}function Pn({items:t,state:o,verb:l,more:u,explain:g,grandTotal:x,dossier:f=null}){return o.level==="list"?(0,R.jsx)(Ur,{items:t,cursor:o.cursor,verb:l,more:u}):(0,R.jsx)(Qr,{items:t,cursor:o.cursor,explain:g,grandTotal:x,dossier:f,scroll:o.scroll??0})}var J=V(Q(),1),At=14;function Hr(t){let o=[],l=null;for(let u of t)u.field!==l&&(l=u.field,o.push({kind:"field",field:l})),o.push({kind:"line",field:l,line:u});return o}function qn({title:t,lines:o,offset:l=0}){let u=Hr(o),g=Math.max(0,Math.min(l,Math.max(0,u.length-At))),x=u.slice(g,g+At),f=g,p=Math.max(0,u.length-g-At),C=`view \xB7 diff \xB7 ${t} \xB7 current \u2192 proposed`;return(0,J.jsxs)(k,{flexDirection:"column",children:[(0,J.jsx)(n,{bold:!0,color:r.assuranceAccent,children:C}),f>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${f} above`})}):null,x.map((M,v)=>M.kind==="field"?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:M.field==="criteria"?"criteria":M.field})},`r-${g+v}`):(0,J.jsx)(k,{paddingLeft:4,children:(0,J.jsx)(n,{color:M.line.op==="-"?"red":"green",children:`${M.line.op==="-"?"\u2212":"+"} ${M.line.text}`})},`r-${g+v}`)),p>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${p} more`})}):null]})}var zr={"use-cases":"use-cases",usecases:"use-cases","use-case":"use-cases",acs:"acs",ac:"acs",scenarios:"scenarios",scenario:"scenarios",tests:"tests",test:"tests",gaps:"gaps",gap:"gaps"};function jn(t){let o=(t??"").trim().toLowerCase();if(!o)return{level:"list"};if(/^\d+$/.test(o)){let u=parseInt(o,10);return u>=1?{level:"detail",num:u}:{error:"items are numbered from 1 \u2014 /view 1"}}let l=zr[o];return l?{level:"list",section:l}:{error:"try /view, /view <number>, or /view acs|scenarios|tests"}}var E=V(Q(),1),Xr=6,Fn=12;function Gr(t,o,l){let u=Math.max(20,o),g=[];for(let f of t.split(`
2
+ import{a as wn,b as me,c as It,d as $n,e as Dt,g as rt,h as it,i as Cn,j as Rn,l as Sn,m as Bt,n as In}from"./chunk-2R7KL7YG.js";import{a as le,b as Oe,c as vn}from"./chunk-6J5T5FEY.js";import{b as Rt}from"./chunk-UJZZDPDY.js";import{a as yn}from"./chunk-CLGC7VEO.js";import{a as tt}from"./chunk-LQQXPY5B.js";import{a as nt,d as _e,e as Tn,f as St}from"./chunk-RKXHVP2Z.js";import{a as xn,b as kn,c as bn}from"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-6KPPGMO2.js";import{a as gn,b as hn,c as pn}from"./chunk-3LEVCW6R.js";import"./chunk-NVGBE2DR.js";import{a as dn}from"./chunk-5Y2G4NC7.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{a as et}from"./chunk-YCCUBQY4.js";import{a as mn}from"./chunk-RDNKYRKY.js";import{x as r}from"./chunk-OFW3ZVTP.js";import{b as fn}from"./chunk-DFS4RMVP.js";import{a as Q}from"./chunk-HCBYKLMW.js";import{a as k,b as n,k as Ze}from"./chunk-C44QQJR4.js";import{a as Mr}from"./chunk-6YGTRKDT.js";import{e as V}from"./chunk-UR6MHSHU.js";var m=V(Mr(),1);var a=V(Q(),1),Ar=60,Lr=100;function Et(t,o){let l=t.options.length,u=l,g=t.multi_select?u++:null,x=t.allow_free_text?u++:null,f=o?u++:null;return{optionCount:l,doneIdx:g,freeIdx:x,batchIdx:f,maxSel:u-1}}var Or="\xA0",_r={high:{text:`\u203C${Or}high`,color:r.red},med:{text:"med",color:"yellow"},low:{text:"low",color:r.dim}};function Pr(t){let o=(t.header??t.text.split(/\s+/).slice(0,3).join(" ")).trim();return o.length>16?`${o.slice(0,15)}\u2026`:o}function qr(t,o,l){let u=p=>t[p].length+6,g=u(o),x=o,f=o;for(;;){let p=f+1<t.length?u(f+1):1/0,C=x-1>=0?u(x-1):1/0;if(p===1/0&&C===1/0)break;if(p<=C){if(g+p>l)break;g+=p,f+=1}else{if(g+C>l)break;g+=C,x-=1}}return{lo:x,hi:f}}function Dn({batch:t,qView:o,sel:l=0,focused:u=!1,freeText:g=null,optionText:x=null,attach:f=null,multiSelFor:p,childPrefix:C}){let{stdout:M}=Ze(),v=M?.columns??80,T=v<Ar,W=Math.min(v-1,Lr),$=Math.max(0,Math.min(t.questions.length-1,o??(t.cursor<0?0:t.cursor))),I=t.questions[$],N=t.resolution[$],L=t.resolution.filter(D=>!D).length,B=t.questions.length-L,P=tt(t),O=Et(I,P!==""),H=p?p($):[],K=_r[I.risk],re=D=>u&&l===D?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" ",S=`? ${C??""}the agent needs ${L===1?"one answer":`${L} answers`}`,$e=t.questions.length>1?` \xB7 ${$+1} of ${t.questions.length} \xB7 ${B} answered`:"",z=(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsxs)(n,{bold:!0,children:[I.text,K?(0,a.jsx)(n,{color:K.color,bold:!1,children:` ${K.text}`}):null]})}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:I.rationale})}),(0,a.jsx)(n,{children:" "}),I.options.map((D,w)=>{let X=u&&l===w;return x&&x.optionIndex===w?(0,a.jsx)(k,{flexDirection:"column",children:(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:`${w+1}. ${D.label}`}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:x.value,onChange:x.onChange,onSubmit:x.onSubmit,onCancel:x.onCancel,placeholder:D.detail||"type your answer"})]})},`o-${w}`):(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsxs)(n,{children:[re(w)," ",I.multi_select?(0,a.jsx)(n,{color:H.includes(w)?r.green:r.dim,children:H.includes(w)?"[x] ":"[ ] "}):null,(0,a.jsx)(n,{color:X?r.assuranceAccent:void 0,children:`${w+1}. ${D.label}`}),w===I.recommended_index?(0,a.jsx)(n,{color:r.dim,children:" (recommended)"}):null,N?.selected_index===w?(0,a.jsx)(n,{color:r.dim,children:" (current)"}):null]}),D.detail?(0,a.jsx)(k,{paddingLeft:5,children:(0,a.jsx)(n,{color:r.dim,children:D.detail})}):null]},`o-${w}`)}),I.multi_select&&O.doneIdx!=null?(0,a.jsxs)(n,{children:[re(O.doneIdx)," ",(0,a.jsx)(n,{color:r.green,children:"\u2714"}),(0,a.jsx)(n,{color:u&&l===O.doneIdx?r.assuranceAccent:void 0,children:" done \u2014 confirm selection"})]}):null,I.allow_free_text?(0,a.jsx)(n,{children:" "}):null,I.allow_free_text?g?(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.dim,children:"\u270E "})]}),(0,a.jsx)(et,{value:g.value,onChange:g.onChange,onSubmit:g.onSubmit,onCancel:g.onCancel,placeholder:"Tell me what to do"})]}):(0,a.jsxs)(n,{children:[O.freeIdx!=null?re(O.freeIdx):" "," ",(0,a.jsx)(n,{color:u&&O.freeIdx!=null&&l===O.freeIdx?r.assuranceAccent:r.dim,children:"\u270E Tell me what to do"})]}):null,f?(0,a.jsxs)(k,{flexDirection:"column",marginTop:1,children:[(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"@ attach a file or URL"}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:f.value,onChange:f.onChange,onSubmit:f.onSubmit,onCancel:f.onCancel,placeholder:"path or URL"})]}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:"the questions are set aside \u2014 the agent reads the source and re-asks what's still open"})})]}):null]}),j=P!==""?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n,{children:" "}),(0,a.jsxs)(n,{children:[u&&O.batchIdx!=null&&l===O.batchIdx?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" "," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"\xBB"}),(0,a.jsx)(n,{bold:!0,color:u&&O.batchIdx!=null&&l===O.batchIdx?r.assuranceAccent:void 0,children:" Go with recommendations"}),L>=5?(0,a.jsx)(n,{color:r.dim,children:` \u2014 resolves all ${L} open`}):null,(0,a.jsx)(n,{color:r.dim,children:" (tab)"})]})]}):null;if(T)return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsx)(n,{color:r.assuranceAccent,bold:!0,children:S}),t.questions.length>1?(0,a.jsx)(n,{color:r.dim,children:$e.replace(/^ · /,"")}):null,(0,a.jsx)(n,{children:" "}),z,j]});let h=t.questions.map(D=>Pr(D)),ce=t.questions.length>1?qr(h,$,W-8):null;return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsxs)(n,{color:r.assuranceAccent,children:[(0,a.jsx)(n,{bold:!0,children:S}),$e?(0,a.jsx)(n,{color:r.dim,children:$e}):null]}),ce?(0,a.jsx)(k,{marginTop:1,children:(0,a.jsxs)(n,{children:[ce.lo>0?(0,a.jsx)(n,{color:r.dim,children:"\u25C0 "}):" ",t.questions.slice(ce.lo,ce.hi+1).map((D,w)=>{let X=ce.lo+w,Pe=w>0?" ":"";return X===$?(0,a.jsxs)(n,{children:[Pe,(0,a.jsx)(n,{backgroundColor:r.assuranceAccent,color:"#0d1117",bold:!0,children:` ${h[X]} `})]},D.id):(0,a.jsxs)(n,{children:[Pe,t.resolution[X]?(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.green,children:"\u2713 "}),(0,a.jsx)(n,{color:r.dim,children:h[X]})]}):(0,a.jsx)(n,{color:r.dim,children:`\u25CB ${h[X]}`})]},D.id)}),ce.hi<t.questions.length-1?(0,a.jsx)(n,{color:r.dim,children:" \u25B6"}):null]})}):null,(0,a.jsx)(n,{children:" "}),z,j]})}var A=V(Q(),1),Bn={high:0,med:1,low:2},jr={high:r.red,med:"yellow",low:r.dim};function Fr(t){return t.map((o,l)=>({r:o,i:l})).sort((o,l)=>(Bn[o.r.risk??"zz"]??3)-(Bn[l.r.risk??"zz"]??3)||o.i-l.i).map(({r:o})=>o)}function En({rows:t,width:o=120,badgeHeader:l="risk"}){if(t.length===0)return null;let u=Fr(t),g=B=>B.staged||!B.id?"(staged)":yn(B.id),x=Math.max(2,...u.map(B=>g(B).length)),f=Math.max(l.length,...u.map(B=>(B.badge??"").length)),p=o>=84&&u.some(B=>B.summary),M=o-(p?13:10)-x-f,v=Math.max(...u.map(B=>Math.max(B.title.length,(B.marker??"").length)),5),T=Math.max(5,p?Math.min(v,Math.max(16,Math.floor(M*.5))):Math.min(v,M)),W=p?Math.max(7,M-T):0,$=(B,P,O,H)=>vn(B,P,O,H.map(K=>K.length)),I=(B,P,O,H)=>[Oe(le(B,x),x),Oe(le(P,T),T),Oe(le(O,f),f),...p?[Oe(le(H,W),W)]:[]],N=I("id","title",l,"summary"),L=[];L.push((0,A.jsx)(n,{color:r.dim,children:$("\u250C","\u252C","\u2510",N)},"t")),L.push((0,A.jsxs)(n,{children:[N.map((B,P)=>(0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:P===0?"\u2502 ":" \u2502 "}),(0,A.jsx)(n,{bold:!0,children:B})]},P)),(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},"h")),L.push((0,A.jsx)(n,{color:r.dim,children:$("\u251C","\u253C","\u2524",N)},"m"));for(let[B,P]of u.entries()){let O=I(g(P),le(P.title,T),le(P.badge??"",f),le(P.summary??"",W)),H=P.badgeColor??jr[P.badge??""]??r.dim;if(L.push((0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:"\u2502 "}),(0,A.jsx)(n,{color:r.assuranceAccent,children:O[0]}),(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[1],(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),(0,A.jsx)(n,{color:H,children:O[2]}),p?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[3]]}):null,(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},`r-${B}`)),P.marker){let K=I("",le(P.marker,T),"","");L.push((0,A.jsx)(n,{color:r.dim,children:`\u2502 ${K.join(" \u2502 ")} \u2502`},`mk-${B}`))}}return L.push((0,A.jsx)(n,{color:r.dim,children:$("\u2514","\u2534","\u2518",N)},"b")),(0,A.jsx)(A.Fragment,{children:L})}var y=V(Q(),1);function Wr(t){let o=t.form==="assumed"?" (assumed)":t.form==="deferred"?"":" (you)",l=t.note?` \u2014 ${t.note}`:"";return t.form==="deferred"?`\u21B3 deferred q${t.qNum} ${t.stub}${l}`:t.form==="changed"?`\u21B3 changed q${t.qNum} ${t.stub}: ${t.prev??"?"} \u2192 ${t.choice??"?"}${o}${l}`:`\u21B3 ${t.form} q${t.qNum} ${t.stub}: ${t.choice??"?"}${o}${l}`}var Vr=()=>(process.stdout?.columns??100)-12;function Mn({block:t,annotations:o}){let l=t.era??0,u=Nr(t,o??null);return l>0?(0,y.jsx)(k,{marginLeft:l*2,children:u}):u}function Nr(t,o){switch(t.kind){case"banner":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{bold:!0,color:r.assuranceAccent,children:` ${t.text}`})});case"user":return(0,y.jsxs)(k,{marginTop:1,children:[(0,y.jsx)(n,{color:r.orange,children:"\u276F "}),(0,y.jsx)(n,{children:t.text})]});case"note":return(0,y.jsx)(n,{color:r.dim,children:` ${t.text}`});case"agent":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(hn,{text:t.text,accent:r.assuranceAccent})});case"worked":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{color:r.dim,children:` \u2699 ${bn(t.durS,t.toolCalls,t.tools)}`})});case"usage":return(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.credits.toFixed(1)} credits \u2014 total ${t.total.toFixed(1)}`});case"turn":{let l=o,u=l?l.fresh:t.items.map((v,T)=>({item:v,num:T+1,updated:!1})),g={usecase:"risk","use-case":"risk",ac:"check",scenario:"kind",test:"check",gap:"severity",stylenote:"kind"},x=v=>v.kind??"use-case",f=new Map;for(let v of u){let T=v.item,W=x(v.item),$=T.risk==="high"||T.risk==="med"||T.risk==="low"?T.risk:void 0,I={id:T.logical_id??"",staged:!T.logical_id,title:T.title,badge:T.badge??T.risk??"",summary:T.why??T.summary??T.description??"",...$?{risk:$}:{},...v.updated?{marker:"\u21B3 changed"}:{}},N=f.get(W)??[];N.push(I),f.set(W,N)}let p=u.some(v=>!!v.item.kind),C=(l?.unchanged??[]).reduce((v,T)=>v+T.count,0),M=l?.headerStats?` \u2014 ${l.headerStats}${C>0?` (${C} unchanged)`:""}`:"";return(0,y.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(0,y.jsxs)(n,{bold:!0,children:[p?"design":t.heading,M?(0,y.jsx)(n,{bold:!1,color:r.dim,children:M}):null]}),[...f.entries()].map(([v,T])=>(0,y.jsxs)(k,{flexDirection:"column",children:[f.size>1?(0,y.jsx)(n,{color:r.dim,children:`${nt(v)} \xB7 ${T.length}`}):null,(0,y.jsx)(En,{rows:T,width:Vr(),badgeHeader:g[v]??"info"})]},v)),l&&l.unchanged.length>0&&(0,y.jsx)(n,{color:r.dim,children:` \u22EE unchanged: ${l.unchanged.map(v=>`${v.count} ${v.label}`).join(" \xB7 ")}`})]})}case"answer":return(0,y.jsx)(n,{color:r.dim,children:Wr(t.receipt)});case"continued":return(0,y.jsx)(n,{color:r.dim,children:"\u21B3 continued"});case"childOpen":{let{ing:l}=Rt(t.verb);return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsxs)(n,{color:r.assuranceAccent,children:[`\u25CF ${l} ${t.subject}`,t.sid?(0,y.jsx)(n,{color:r.dim,children:` \u2014 ${t.sid}`}):null,t.note?(0,y.jsx)(n,{color:r.dim,children:` ${t.note}`}):null]})})}case"childClose":{let{ed:l}=Rt(t.verb);if(!t.ok)return(0,y.jsxs)(n,{color:r.red,children:[`\u25CF ${t.verb} failed \u2014 ${t.exitCode!=null?`exited ${t.exitCode}`:"error"}`,t.fixCmd?(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.fixCmd}`}):null]});let u=[kn(t.durS),...t.results?[t.results]:[],...t.credits!==void 0?[`${t.credits.toFixed(1)} credits`]:[]].join(" \xB7 ");return(0,y.jsx)(n,{color:r.green,children:`\u25CF ${l} ${t.subject} \u2014 ${u}`})}case"childBack":return(0,y.jsx)(n,{color:r.dim,children:`back with ${t.parentVerb} \u2014 ${t.context}`});case"commit":return(0,y.jsxs)(k,{flexDirection:"column",children:[(0,y.jsx)(n,{color:t.ok?r.green:r.red,children:` ${t.ok?"\u2714":"\u2717"} ${t.line}`}),(t.warnings??[]).map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:` \u26A0 ${l}`},`w-${u}`))]});case"error":return(0,y.jsxs)(mn,{variant:"error",paddingX:1,children:[(0,y.jsx)(n,{color:r.red,children:t.title}),t.detail.map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:l},`d-${u}`))]})}}var Te=V(Q(),1);function An({item:t}){return(0,Te.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(t.cite??[]).map((o,l)=>(0,Te.jsx)(n,{dimColor:!0,children:`cite ${o.anchor??"conv"} \u2014 "${o.quote??""}"`},`cite-${l}`)),(t.depends_on_hint??[]).length>0&&(0,Te.jsx)(n,{dimColor:!0,children:`depends on: ${(t.depends_on_hint??[]).join(", ")}`}),Object.entries(t.extra??{}).map(([o,l])=>(0,Te.jsx)(n,{dimColor:!0,children:`${o}: ${l}`},`extra-${o}`))]})}var R=V(Q(),1),Mt=(t,o)=>Math.max(0,Math.min(o,t));function ot(t,o,l){switch(o.type){case"move":return t.level==="detail"?{...t,scroll:Math.max(0,(t.scroll??0)+o.delta)}:{...t,cursor:Mt(t.cursor+o.delta,Math.max(0,l-1))};case"enter":return t.level==="list"?{...t,level:"detail",scroll:0}:t;case"back":return t.level==="detail"?{...t,level:"list",scroll:0}:null}}var On={"use-case":"use-cases",ac:"acs",scenario:"scenarios",test:"tests",gap:"gaps"};function _n(t,o){if(t.level==="detail")return{level:"detail",cursor:Mt(t.num-1,Math.max(0,o.entries.length-1))};if(t.section){let l=o.entries.findIndex(u=>On[u.kind]===t.section);if(l>=0)return{level:"list",cursor:l}}return{level:"list",cursor:0}}function Kr(t){let o=[];for(let l of t.entries){let u=o.find(g=>g.kind===l.kind);u?u.entries.push(l):o.push({kind:l.kind,entries:[l]})}return o}var Ln=3;function Ur({items:t,cursor:o,verb:l,more:u}){let g=`view \xB7 ${l} so far \xB7 ${t.counts.map(f=>`${f.count} ${f.count===1?f.label.replace(/s$/,""):f.label}`).join(" \xB7 ")}`,x=t.entries[o];return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,color:r.assuranceAccent,children:g}),Kr(t).map(({kind:f,entries:p})=>{let C=x?.kind===f,M=C?p.findIndex($=>$.ref===x.ref):-1,v=C?Mt(M-1,Math.max(0,p.length-Ln)):0,T=p.slice(v,v+(C?Ln:1)),W=p.length-T.length;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{color:r.dim,children:`${On[f]??nt(f)} \xB7 ${p.length}`}),T.map($=>{let I=C&&$.ref===x.ref,N=$.item.badge;return(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:I?"\u203A ":" "}),(0,R.jsx)(n,{children:`${$.num} \xB7 ${$.item.title}`}),N?(0,R.jsx)(n,{color:r.dim,children:` \xB7 ${N}`}):null]},`${$.kind}:${$.ref}`)}),W>0&&(0,R.jsx)(n,{color:r.dim,children:` \u22EE ${W} more`})]},f)}),u?(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:o===t.entries.length?"\u203A ":" "}),(0,R.jsx)(n,{color:r.dim,children:`\u22EF show all \u2014 ${u.hidden} more from earlier turns`})]}):null]})}var st=14;function Qr({items:t,cursor:o,explain:l,grandTotal:u,dossier:g,scroll:x=0}){let f=t.entries[o];if(!f)return(0,R.jsx)(n,{color:r.dim,children:"nothing to show"});if(g){let C=Math.max(0,Math.min(x,Math.max(0,g.lines.length-st))),M=g.lines.slice(C,C+st);return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsxs)(n,{bold:!0,children:[`view \xB7 ${g.id}`,g.id.toLowerCase()!==g.rawId?(0,R.jsx)(n,{bold:!1,color:r.dim,children:` \xB7 ${g.rawId}`}):null]}),(0,R.jsx)(n,{bold:!0,children:g.title}),C>0?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${C} above`}):null,M.map((v,T)=>(0,R.jsx)(n,{color:v.dim?r.dim:void 0,children:v.text},`dl-${T}`)),g.lines.length>C+st?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${g.lines.length-C-st} more`}):null]})}let p=f.item;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,children:`view \xB7 ${f.kind} ${f.num} of ${u??t.entries.length}`}),(0,R.jsx)(n,{children:f.item.title}),p.badge?(0,R.jsx)(n,{color:r.dim,children:`kind: ${p.badge}`}):null,p.why?(0,R.jsx)(n,{color:r.dim,children:p.why}):null,(0,R.jsx)(An,{item:f.item}),l?.map((C,M)=>(0,R.jsx)(n,{color:r.dim,children:C},`ex-${M}`)),(0,R.jsx)(n,{color:r.dim,children:"view-only \u2014 approvals happen in chat"})]})}function Pn({items:t,state:o,verb:l,more:u,explain:g,grandTotal:x,dossier:f=null}){return o.level==="list"?(0,R.jsx)(Ur,{items:t,cursor:o.cursor,verb:l,more:u}):(0,R.jsx)(Qr,{items:t,cursor:o.cursor,explain:g,grandTotal:x,dossier:f,scroll:o.scroll??0})}var J=V(Q(),1),At=14;function Hr(t){let o=[],l=null;for(let u of t)u.field!==l&&(l=u.field,o.push({kind:"field",field:l})),o.push({kind:"line",field:l,line:u});return o}function qn({title:t,lines:o,offset:l=0}){let u=Hr(o),g=Math.max(0,Math.min(l,Math.max(0,u.length-At))),x=u.slice(g,g+At),f=g,p=Math.max(0,u.length-g-At),C=`view \xB7 diff \xB7 ${t} \xB7 current \u2192 proposed`;return(0,J.jsxs)(k,{flexDirection:"column",children:[(0,J.jsx)(n,{bold:!0,color:r.assuranceAccent,children:C}),f>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${f} above`})}):null,x.map((M,v)=>M.kind==="field"?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:M.field==="criteria"?"criteria":M.field})},`r-${g+v}`):(0,J.jsx)(k,{paddingLeft:4,children:(0,J.jsx)(n,{color:M.line.op==="-"?"red":"green",children:`${M.line.op==="-"?"\u2212":"+"} ${M.line.text}`})},`r-${g+v}`)),p>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${p} more`})}):null]})}var zr={"use-cases":"use-cases",usecases:"use-cases","use-case":"use-cases",acs:"acs",ac:"acs",scenarios:"scenarios",scenario:"scenarios",tests:"tests",test:"tests",gaps:"gaps",gap:"gaps"};function jn(t){let o=(t??"").trim().toLowerCase();if(!o)return{level:"list"};if(/^\d+$/.test(o)){let u=parseInt(o,10);return u>=1?{level:"detail",num:u}:{error:"items are numbered from 1 \u2014 /view 1"}}let l=zr[o];return l?{level:"list",section:l}:{error:"try /view, /view <number>, or /view acs|scenarios|tests"}}var E=V(Q(),1),Xr=6,Fn=12;function Gr(t,o,l){let u=Math.max(20,o),g=[];for(let f of t.split(`
3
3
  `)){if(f.length<=u){g.push(f);continue}let p="";for(let C of f.split(" "))p&&p.length+1+C.length>u?(g.push(p),p=C):p=p?`${p} ${C}`:C;g.push(p)}let x=Math.max(0,g.length-l);return{body:g.slice(-l).join(`
4
4
  `),hidden:x}}function Wn(t){let o={key:"redesign",label:"re-design from scratch",detail:"replaces the current design"},l={key:"keep",label:"keep the existing design",detail:"back to the list"};return t.designed==="stale"?[{...o,detail:"the use-case changed since it was designed"},l]:[l,o]}function Xi({controller:t,verb:o="extract",onCtrlC:l,chain:u=null,inspect:g=null,reconcile:x=null,autoReview:f=!1,onReviewExit:p,meta:C=null}){let[,M]=(0,m.useState)(0),[v,T]=(0,m.useState)(!1),[W,$]=(0,m.useState)(null),[I,N]=(0,m.useState)(null),L=(0,m.useRef)(null),[B,P]=(0,m.useState)(null),O=(0,m.useRef)(null),H=e=>{O.current=e,P(e)},K=e=>{L.current=e,N(e),e===null&&H(null)},re=(0,m.useRef)([]),[S,$e]=(0,m.useState)(null),z=(0,m.useRef)(null),j=e=>{z.current=e,$e(e)},[h,ce]=(0,m.useState)(null),D=(0,m.useRef)(null),w=e=>{D.current=e,ce(e)},[X,Pe]=(0,m.useState)(null),Lt=(0,m.useRef)(null),he=e=>{Lt.current=e,Pe(e)},lt=(0,m.useRef)({approved:0,rejected:0,deferred:0}),Ce=(0,m.useRef)(!1),ae=(0,m.useRef)(null),Ot=fn(),{stdout:Vn}=Ze(),Nn=Vn?.columns??80,_t=(0,m.useRef)(0),ct=(0,m.useRef)(0);(0,m.useEffect)(()=>{let e=()=>{let i=t.state.ledger;for(let c=_t.current;c<i.length;c++){let d=i[c],b=d.kind==="turn"?Tn(t.state.turns,d.turnIndex):void 0;Ot.append((0,E.jsx)(Mn,{block:d,annotations:b},`lg-${c}`))}_t.current=i.length};e();let s=t.subscribe(()=>{e();let i=t.state;L.current&&(i.pending||i.status==="pausing")&&(K(null),i.pending&&$("questions arrived \u2014 back to chat")),M(c=>c+1)});return M(i=>i+1),s},[t,Ot]);let{thinking:ue,status:de,pending:_,confirm:qe,ledger:ie,activeTurn:Pt,stream:Kn,notice:je}=t.state,qt=(Kn?.text??"").trimEnd(),jt=qt.length>0,Un=v&&(ue.liveThinking.length>0||ue.thinkingLog.length>0),Qn=Gr(ue.liveThinking||ue.thinkingLog.map(e=>e.text).join(`
5
5
  `),Nn-6,Fn),Ft=jt?qt.split(`
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-MJ56GUKS.js";import"./chunk-ZIRMSWKS.js";import"./chunk-CCUGKBIH.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{c as ChromeProfilePicker,b as formatChromeProfileLine,a as listChromeProfiles};
2
+ import{a,b,c}from"./chunk-KQ2MYMOS.js";import"./chunk-AO3PBE2V.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{c as ChromeProfilePicker,b as formatChromeProfileLine,a as listChromeProfiles};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as r}from"./chunk-6BTZ2Q4P.js";import"./chunk-ZIRMSWKS.js";import"./chunk-CCUGKBIH.js";import"./chunk-HCBYKLMW.js";import{c as e}from"./chunk-C44QQJR4.js";import{a as i}from"./chunk-6YGTRKDT.js";import{e as m}from"./chunk-UR6MHSHU.js";var t=m(i(),1);async function d(){return new Promise(o=>{let c=e(t.default.createElement(r,{onSubmit:n=>{c.unmount(),o(n)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{d as renderFeedbackPrompt};
2
+ import{a as r}from"./chunk-YHTYPTDD.js";import"./chunk-AO3PBE2V.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import{c as e}from"./chunk-C44QQJR4.js";import{a as i}from"./chunk-6YGTRKDT.js";import{e as m}from"./chunk-UR6MHSHU.js";var t=m(i(),1);async function d(){return new Promise(o=>{let c=e(t.default.createElement(r,{onSubmit:n=>{c.unmount(),o(n)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{d as renderFeedbackPrompt};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as P,b as g,c as f}from"./chunk-NLECZCMZ.js";import"./chunk-5NSYHRDN.js";import"./chunk-5Y2G4NC7.js";import"./chunk-CCUGKBIH.js";import{a as c}from"./chunk-HCBYKLMW.js";import{c as d}from"./chunk-C44QQJR4.js";import{a as h}from"./chunk-6YGTRKDT.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(h(),1);var m=p(c(),1);function w({pipeline:t,buildShareUrl:r,onDone:o}){let[n,i]=(0,e.useState)(P()),[S,l]=(0,e.useState)("uploading"),[U,R]=(0,e.useState)(),[C,E]=(0,e.useState)();return(0,e.useEffect)(()=>{let x=t.config.onProgress;t.config.onProgress=(s,u,a)=>{x(s,u,a),i(y=>g(y,s,u,a))},t.execute().then(s=>{s.success?(R(r?.(s)),l("success")):(E(s.error),l("failed")),setTimeout(()=>o(s),1500)})},[]),(0,m.jsx)(f,{steps:n,status:S,testUrl:U,error:C})}async function O(t,r){return new Promise(o=>{let n=d(e.default.createElement(w,{pipeline:t,buildShareUrl:r,onDone:i=>{n.unmount(),o(i)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{O as renderUploadProgress};
2
+ import{a as P,b as g,c as f}from"./chunk-3UUPP5W3.js";import"./chunk-RX5TZZNQ.js";import"./chunk-5Y2G4NC7.js";import"./chunk-OFW3ZVTP.js";import{a as c}from"./chunk-HCBYKLMW.js";import{c as d}from"./chunk-C44QQJR4.js";import{a as h}from"./chunk-6YGTRKDT.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(h(),1);var m=p(c(),1);function w({pipeline:t,buildShareUrl:r,onDone:o}){let[n,i]=(0,e.useState)(P()),[S,l]=(0,e.useState)("uploading"),[U,R]=(0,e.useState)(),[C,E]=(0,e.useState)();return(0,e.useEffect)(()=>{let x=t.config.onProgress;t.config.onProgress=(s,u,a)=>{x(s,u,a),i(y=>g(y,s,u,a))},t.execute().then(s=>{s.success?(R(r?.(s)),l("success")):(E(s.error),l("failed")),setTimeout(()=>o(s),1500)})},[]),(0,m.jsx)(f,{steps:n,status:S,testUrl:U,error:C})}async function O(t,r){return new Promise(o=>{let n=d(e.default.createElement(w,{pipeline:t,buildShareUrl:r,onDone:i=>{n.unmount(),o(i)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{O as renderUploadProgress};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as b,b as l,c as n}from"./chunk-PQUMOFT5.js";import{x as o}from"./chunk-CCUGKBIH.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a as u,j as v}from"./chunk-C44QQJR4.js";import{a as S}from"./chunk-6YGTRKDT.js";import{e as a}from"./chunk-UR6MHSHU.js";var C=a(S(),1);var e=a(p(),1);function O({model:x,authLabel:w,profile:B,env:h,defaultUrl:s,projectId:i,projectName:d,folderId:t,folderName:f,windowSize:D,chromeProfile:P,target:r,deviceLabel:m,appLabel:g}){let R=i?d?`${d} (${i})`:i:"(none)",V=t?f?`${f} (${t})`:t:"(none)",{exit:c}=v();return(0,C.useEffect)(()=>{let $=setTimeout(()=>c(),50);return()=>clearTimeout($)},[c]),(0,e.jsx)(u,{flexDirection:"column",children:(0,e.jsx)(b,{title:"Configuration",children:(0,e.jsxs)(u,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(n,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:w}),(0,e.jsx)(l,{label:" profile",value:B}),(0,e.jsx)(l,{label:" env",value:h}),(0,e.jsx)(n,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:s??"(none)",valueColor:s?o.orange:o.dim}),(0,e.jsx)(l,{label:" model",value:x}),(0,e.jsx)(l,{label:" window",value:D}),(0,e.jsx)(l,{label:" project",value:R}),(0,e.jsx)(l,{label:" folder",value:V}),r!==void 0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" target",value:r}),r!=="desktop"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" device",value:m??"(not set)",valueColor:m?void 0:o.dim}),(0,e.jsx)(l,{label:" app",value:g??"(not set)",valueColor:g?void 0:o.dim})]})]}),(0,e.jsx)(n,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:P,valueColor:o.dim})]})})})}export{O as ConfigView};
2
+ import{a as b,b as l,c as n}from"./chunk-RDNKYRKY.js";import{x as o}from"./chunk-OFW3ZVTP.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a as u,j as v}from"./chunk-C44QQJR4.js";import{a as S}from"./chunk-6YGTRKDT.js";import{e as a}from"./chunk-UR6MHSHU.js";var C=a(S(),1);var e=a(p(),1);function O({model:x,authLabel:w,profile:B,env:h,defaultUrl:s,projectId:i,projectName:d,folderId:t,folderName:f,windowSize:D,chromeProfile:P,target:r,deviceLabel:m,appLabel:g}){let R=i?d?`${d} (${i})`:i:"(none)",V=t?f?`${f} (${t})`:t:"(none)",{exit:c}=v();return(0,C.useEffect)(()=>{let $=setTimeout(()=>c(),50);return()=>clearTimeout($)},[c]),(0,e.jsx)(u,{flexDirection:"column",children:(0,e.jsx)(b,{title:"Configuration",children:(0,e.jsxs)(u,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(n,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:w}),(0,e.jsx)(l,{label:" profile",value:B}),(0,e.jsx)(l,{label:" env",value:h}),(0,e.jsx)(n,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:s??"(none)",valueColor:s?o.orange:o.dim}),(0,e.jsx)(l,{label:" model",value:x}),(0,e.jsx)(l,{label:" window",value:D}),(0,e.jsx)(l,{label:" project",value:R}),(0,e.jsx)(l,{label:" folder",value:V}),r!==void 0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" target",value:r}),r!=="desktop"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" device",value:m??"(not set)",valueColor:m?void 0:o.dim}),(0,e.jsx)(l,{label:" app",value:g??"(not set)",valueColor:g?void 0:o.dim})]})]}),(0,e.jsx)(n,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:P,valueColor:o.dim})]})})})}export{O as ConfigView};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-K2QV7FGP.js";import"./chunk-3AJ3QSF5.js";import"./chunk-5DBK6QNS.js";import"./chunk-TJZMYU2W.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-KX2GOJ4C.js";import"./chunk-RFHMDQXZ.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-Z2T7E5HM.js";import"./chunk-MSGW4JDG.js";import"./chunk-56PAQAX5.js";import"./chunk-5EOX4MEY.js";import"./chunk-4JOD47QI.js";import"./chunk-WLOGO44E.js";import"./chunk-RZ4F3BHX.js";import"./chunk-CCUGKBIH.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as EvidenceViewOffer};
2
+ import{a}from"./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-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-RFHMDQXZ.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-DN3E6RT6.js";import"./chunk-MSGW4JDG.js";import"./chunk-56PAQAX5.js";import"./chunk-5EOX4MEY.js";import"./chunk-4JOD47QI.js";import"./chunk-OYJBABRV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as EvidenceViewOffer};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a,b}from"./chunk-QISE272H.js";import"./chunk-YCCUBQY4.js";import"./chunk-CZUOGGUK.js";import"./chunk-BPMSNGXQ.js";import"./chunk-AO3PBE2V.js";import"./chunk-OYJBABRV.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as FolderPicker,a as formatFolderLine};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-NHOHQBIF.js";import"./chunk-PQUMOFT5.js";import"./chunk-CCUGKBIH.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as InfoBox};
2
+ import{a}from"./chunk-NT3UETTV.js";import"./chunk-RDNKYRKY.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as InfoBox};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-BAL7E4OH.js";import"./chunk-CCUGKBIH.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as LinksBox};
2
+ import{a}from"./chunk-C4WTZSX4.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as LinksBox};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-NYSMQ7UY.js";import"./chunk-ZIRMSWKS.js";import"./chunk-CCUGKBIH.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
2
+ import{a,b}from"./chunk-VMCSRLRC.js";import"./chunk-AO3PBE2V.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-K7UYWAZH.js";import"./chunk-YCCUBQY4.js";import"./chunk-LA2EMSHE.js";import"./chunk-BPMSNGXQ.js";import"./chunk-ZIRMSWKS.js";import"./chunk-WLOGO44E.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-CCUGKBIH.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProjectPicker,a as formatProjectLine};
2
+ import{a,b}from"./chunk-TZFT7R7B.js";import"./chunk-YCCUBQY4.js";import"./chunk-CZUOGGUK.js";import"./chunk-BPMSNGXQ.js";import"./chunk-AO3PBE2V.js";import"./chunk-OYJBABRV.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProjectPicker,a as formatProjectLine};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-RY6TFVAX.js";import"./chunk-S3DAAAE5.js";import"./chunk-NHOHQBIF.js";import"./chunk-PQUMOFT5.js";import"./chunk-CCUGKBIH.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SaveSessionPrompt,b as defaultSessionTimestamp,c as renderSavePrompt};
2
+ import{a,b,c}from"./chunk-GELPKSLC.js";import"./chunk-S3DAAAE5.js";import"./chunk-NT3UETTV.js";import"./chunk-RDNKYRKY.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SaveSessionPrompt,b as defaultSessionTimestamp,c as renderSavePrompt};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a}from"./chunk-ESC7AOCX.js";import"./chunk-FJYDEWOA.js";import"./chunk-CLLQQPBZ.js";import"./chunk-A44G533S.js";import"./chunk-VZ7KXRXB.js";import"./chunk-TDPWFYTJ.js";import"./chunk-BRTARADN.js";import"./chunk-SQGBFCFO.js";import"./chunk-TZFT7R7B.js";import"./chunk-QISE272H.js";import"./chunk-YCCUBQY4.js";import"./chunk-CZUOGGUK.js";import"./chunk-BPMSNGXQ.js";import"./chunk-VE3SUJMA.js";import"./chunk-TZXXJWHA.js";import"./chunk-56PAQAX5.js";import"./chunk-5EOX4MEY.js";import"./chunk-XY325HDJ.js";import"./chunk-TAOHYWEO.js";import"./chunk-AO3PBE2V.js";import"./chunk-FUNKVREV.js";import"./chunk-OYJBABRV.js";import"./chunk-DPUV6OSP.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-ZLSWHCWO.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SingleShotApp};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c,d}from"./chunk-PUFJEU46.js";import"./chunk-NHOHQBIF.js";import"./chunk-PQUMOFT5.js";import"./chunk-CCUGKBIH.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{d as AutoExitSummaryBox,c as SummaryBox,b as buildSummaryEvent,a as buildSummaryRendered};
2
+ import{a,b,c,d}from"./chunk-DZCG7FFP.js";import"./chunk-NT3UETTV.js";import"./chunk-RDNKYRKY.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{d as AutoExitSummaryBox,c as SummaryBox,b as buildSummaryEvent,a as buildSummaryRendered};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{g as a}from"./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-RX5TZZNQ.js";import"./chunk-5Y2G4NC7.js";import"./chunk-LN7233E2.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-DN3E6RT6.js";import"./chunk-MSGW4JDG.js";import"./chunk-56PAQAX5.js";import"./chunk-5EOX4MEY.js";import"./chunk-4JOD47QI.js";import"./chunk-OYJBABRV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-NT3UETTV.js";import"./chunk-RDNKYRKY.js";import"./chunk-OFW3ZVTP.js";import"./chunk-DFS4RMVP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as TestMdRunView};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-R7OGNE3W.js";import"./chunk-TJZMYU2W.js";import"./chunk-RFHMDQXZ.js";import"./chunk-WLOGO44E.js";import"./chunk-PQUMOFT5.js";import"./chunk-CCUGKBIH.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as buildServeMap,b as renderTestrunEvidenceTable};
2
+ import{a,b}from"./chunk-WMQJBEQP.js";import"./chunk-RZLD7TPG.js";import"./chunk-RFHMDQXZ.js";import"./chunk-OYJBABRV.js";import"./chunk-RDNKYRKY.js";import"./chunk-OFW3ZVTP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as buildServeMap,b as renderTestrunEvidenceTable};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as b,b as r}from"./chunk-PQUMOFT5.js";import{x as o}from"./chunk-CCUGKBIH.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a as i,b as l,j as s}from"./chunk-C44QQJR4.js";import{a as T}from"./chunk-6YGTRKDT.js";import{e as a}from"./chunk-UR6MHSHU.js";var f=a(T(),1);var e=a(p(),1);function V({profile:g,env:v,authenticated:n,authMethod:h,username:c,tokenStatus:t,expiresAt:d,serverStatus:u,detail:m}){let{exit:x}=s();return(0,f.useEffect)(()=>{let B=setTimeout(()=>x(),50);return()=>clearTimeout(B)},[x]),(0,e.jsx)(i,{flexDirection:"column",children:(0,e.jsx)(b,{title:"Identity",variant:n?"success":"warning",children:(0,e.jsxs)(i,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(i,{children:u==="rejected"?(0,e.jsx)(l,{color:o.red,bold:!0,children:"\u2717 Not authenticated"}):u==="unreachable"?(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Couldn't verify"}):n?(0,e.jsx)(l,{color:o.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(i,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(r,{label:"Profile",value:g}),(0,e.jsx)(r,{label:"Environment",value:v}),(0,e.jsx)(r,{label:"Method",value:h}),c&&(0,e.jsx)(r,{label:"User",value:c}),t&&(0,e.jsx)(r,{label:"Token",value:t,valueColor:t==="valid"?o.green:t==="expired"?o.red:o.dim}),d&&(0,e.jsx)(r,{label:"Expires",value:d}),m&&(0,e.jsx)(r,{label:"Detail",value:m})]})]})})})}export{V as WhoamiView};
2
+ import{a as b,b as r}from"./chunk-RDNKYRKY.js";import{x as o}from"./chunk-OFW3ZVTP.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a as i,b as l,j as s}from"./chunk-C44QQJR4.js";import{a as T}from"./chunk-6YGTRKDT.js";import{e as a}from"./chunk-UR6MHSHU.js";var f=a(T(),1);var e=a(p(),1);function V({profile:g,env:v,authenticated:n,authMethod:h,username:c,tokenStatus:t,expiresAt:d,serverStatus:u,detail:m}){let{exit:x}=s();return(0,f.useEffect)(()=>{let B=setTimeout(()=>x(),50);return()=>clearTimeout(B)},[x]),(0,e.jsx)(i,{flexDirection:"column",children:(0,e.jsx)(b,{title:"Identity",variant:n?"success":"warning",children:(0,e.jsxs)(i,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(i,{children:u==="rejected"?(0,e.jsx)(l,{color:o.red,bold:!0,children:"\u2717 Not authenticated"}):u==="unreachable"?(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Couldn't verify"}):n?(0,e.jsx)(l,{color:o.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(i,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(r,{label:"Profile",value:g}),(0,e.jsx)(r,{label:"Environment",value:v}),(0,e.jsx)(r,{label:"Method",value:h}),c&&(0,e.jsx)(r,{label:"User",value:c}),t&&(0,e.jsx)(r,{label:"Token",value:t,valueColor:t==="valid"?o.green:t==="expired"?o.red:o.dim}),d&&(0,e.jsx)(r,{label:"Expires",value:d}),m&&(0,e.jsx)(r,{label:"Detail",value:m})]})]})})})}export{V as WhoamiView};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{b as a,c as b}from"./chunk-4D3DNCQY.js";import"./chunk-TAOHYWEO.js";import"./chunk-RZ4F3BHX.js";import"./chunk-CCUGKBIH.js";import"./chunk-UR6MHSHU.js";export{a as isAppId,b as resolveCloudApp};
2
+ import{b as a,c as b}from"./chunk-XY325HDJ.js";import"./chunk-TAOHYWEO.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{a as isAppId,b as resolveCloudApp};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import"./chunk-UR6MHSHU.js";async function i(e){try{let[{CredentialsManager:n},{AuthResolver:a},{getEnvironment:s}]=await Promise.all([import("./credentials-SO3DSQEM.js"),import("./resolver-CBTWTZZR.js"),import("./config-OKTAPFOT.js")]),t=new n,o=t.getActiveProfile()??"default",c=t.loadCredentials(o,e);if(typeof c?.access_token!="string")return null;let r=await new a(s(e).controllerBaseUrl,async()=>c.access_token,null).resolve();return typeof r?.username!="string"||!r.username||typeof r.access_key!="string"||!r.access_key?null:Buffer.from(`${r.username}:${r.access_key}`,"utf8").toString("base64")}catch{return null}}async function u(e={}){let n=e.env??process.env,s=await(e.resolveBase??(async()=>(await import("./spawner-ANLF7OX3.js")).resolveAgentAuthEnv()))();if(s.TESTMUAI_BASIC_AUTH||n.TESTMUAI_BASIC_AUTH)return s;let t=n.TESTMUAI_ENV==="stage"?"stage":"prod",o=await(e.exchange??i)(t);return o?{...s,TESTMUAI_BASIC_AUTH:o}:s}export{u as resolveLisAuthEnv};
2
+ import"./chunk-UR6MHSHU.js";async function i(e){try{let[{CredentialsManager:n},{AuthResolver:a},{getEnvironment:s}]=await Promise.all([import("./credentials-ZSNM4BTD.js"),import("./resolver-V5VP5FLT.js"),import("./config-6TQIMTNB.js")]),t=new n,o=t.getActiveProfile()??"default",c=t.loadCredentials(o,e);if(typeof c?.access_token!="string")return null;let r=await new a(s(e).controllerBaseUrl,async()=>c.access_token,null).resolve();return typeof r?.username!="string"||!r.username||typeof r.access_key!="string"||!r.access_key?null:Buffer.from(`${r.username}:${r.access_key}`,"utf8").toString("base64")}catch{return null}}async function u(e={}){let n=e.env??process.env,s=await(e.resolveBase??(async()=>(await import("./spawner-ZSYJQGQW.js")).resolveAgentAuthEnv()))();if(s.TESTMUAI_BASIC_AUTH||n.TESTMUAI_BASIC_AUTH)return s;let t=n.TESTMUAI_ENV==="stage"?"stage":"prod",o=await(e.exchange??i)(t);return o?{...s,TESTMUAI_BASIC_AUTH:o}:s}export{u as resolveLisAuthEnv};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-DJ7T7BMV.js";import"./chunk-Q6JHBDW2.js";import"./chunk-CCUGKBIH.js";import"./chunk-UR6MHSHU.js";export{b as ensureHyperexecuteBinary,a as hyperexecuteDownloadUrl};
2
+ import{a,b}from"./chunk-TDS6LG6T.js";import"./chunk-YEQVJWEF.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{b as ensureHyperexecuteBinary,a as hyperexecuteDownloadUrl};
@@ -1,12 +1,12 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as _}from"./chunk-O3AY6JHJ.js";import"./chunk-ZKSN2SJ7.js";import"./chunk-3Q6WAK6P.js";import"./chunk-AFPHLUQ5.js";import"./chunk-JZ26R6UL.js";import"./chunk-AJPLHW4T.js";import"./chunk-EFRJNPBZ.js";import"./chunk-ZGBSGZZM.js";import"./chunk-W27F2NWA.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-UX3KPYTI.js";import"./chunk-VT2XNEOD.js";import"./chunk-2UIHS2FH.js";import"./chunk-YKTYVJBN.js";import"./chunk-GFKCTYCA.js";import"./chunk-IMR64OCZ.js";import"./chunk-427OQS2N.js";import"./chunk-X2FM67OM.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{a as m}from"./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-CCUGKBIH.js";import"./chunk-UR6MHSHU.js";import{existsSync as O}from"fs";var P=new Set(["interactive","agent","ci","override"]);function H(e){return e.mode!=null&&!P.has(e.mode)?{error:`design: --mode must be interactive | agent | ci | override, got '${e.mode}'`}:e.strength!=null&&e.strength!=="pairwise"&&e.strength!=="3-wise"?{error:`design: --strength must be pairwise | 3-wise, got '${e.strength}'`}:e.max!=null&&(!Number.isInteger(e.max)||e.max<1)?{error:"design: --max must be a positive integer"}:!e.useCase&&!e.resume?{error:"design: --use-case is required (or --resume <sid> \u2014 the session remembers its use-case)"}:{useCase:e.useCase,max:e.max,strength:e.strength,mode:e.mode,force:e.force,resume:e.resume,plan:e.plan,message:e.message,phase:e.phase,allowUnreviewed:e.allowUnreviewed,because:e.because,changeDelta:e.changeDelta,priorDesign:e.priorDesign}}async function B(e){let p=async(t,r)=>{if(e.mode!=="agent")return process.stderr.write(t+`
2
+ import{a as _}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{a as m}from"./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";import{existsSync as O}from"fs";var P=new Set(["interactive","agent","ci","override"]);function H(e){return e.mode!=null&&!P.has(e.mode)?{error:`design: --mode must be interactive | agent | ci | override, got '${e.mode}'`}:e.strength!=null&&e.strength!=="pairwise"&&e.strength!=="3-wise"?{error:`design: --strength must be pairwise | 3-wise, got '${e.strength}'`}:e.max!=null&&(!Number.isInteger(e.max)||e.max<1)?{error:"design: --max must be a positive integer"}:!e.useCase&&!e.resume?{error:"design: --use-case is required (or --resume <sid> \u2014 the session remembers its use-case)"}:{useCase:e.useCase,max:e.max,strength:e.strength,mode:e.mode,force:e.force,resume:e.resume,plan:e.plan,message:e.message,phase:e.phase,allowUnreviewed:e.allowUnreviewed,because:e.because,changeDelta:e.changeDelta,priorDesign:e.priorDesign}}async function B(e){let p=async(t,r)=>{if(e.mode!=="agent")return process.stderr.write(t+`
3
3
  `),2;let{makeHeadlessIO:s,agentRefusal:d}=await import("./headless-io-66RG5NN5.js");return d(s("ndjson","design"),t,r)};if(e.mode!=null&&!["interactive","agent","ci","override"].includes(e.mode)){let{makeHeadlessIO:t,agentRefusal:r}=await import("./headless-io-66RG5NN5.js");return r(t("ndjson","design"),`design: --mode must be interactive | agent | ci | override, got '${e.mode}'`,"MODE_USAGE")}let T=H(e);if("error"in T)return p(T.error);let o=T;{let{validateResumeMessage:t}=await import("./headless-io-66RG5NN5.js"),r=t(o,"design");if(r)return p(r)}{let{gateStructuredFlags:t}=await import("./structured-answers-5EY2AZN7.js"),r=t(e,"design");if(r)return p(r,"STRUCTURED_FLAGS_USAGE")}if(!O(m(process.cwd())))return p("error: no context store here (run `kane-cli context ingest` + `kane-cli context extract` first)","NO_STORE");let y=!!o.resume;if(o.useCase&&o.resume&&!e.allowUnreviewed)try{let{peekSession:t}=await import("./sessions-GIEXOCE4.js"),r=t(m(process.cwd()),o.resume);y=!!(r&&r.use_case===o.useCase)}catch{y=!1}if(o.useCase&&!y&&!e.allowUnreviewed)try{let[{openGraph:t},{designEntryCheck:r}]=await Promise.all([import("./readmodel-XOYGGQ3S.js"),import("./trust-gate-EX7R2P4Y.js")]),s=r(t(m(process.cwd())),o.useCase);if(!s.ok&&(s.code==="UC_UNREVIEWED"||s.code==="UC_ARCHIVED"))if((o.mode??"interactive")==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY){let{createInterface:l}=await import("readline/promises"),c=l({input:process.stdin,output:process.stderr}),f=(await c.question(`design: ${s.detail}
4
4
  Design against it anyway? (y/N) `)).trim().toLowerCase();if(c.close(),f!=="y"&&f!=="yes")return process.stderr.write(`aborted \u2014 approve it first: ${s.reviewCmd}
5
5
  `),2}else if(e.mode==="agent"){let{makeHeadlessIO:l}=await import("./headless-io-66RG5NN5.js"),c=l("ndjson","design");return c.event({type:"error",code:s.code,message:`design: ${s.detail}`,next:[s.reviewCmd]}),c.event({type:"done",status:"refused",exit_code:2,next:[s.reviewCmd,`kane-cli design tests --use-case ${o.useCase} --mode agent --allow-unreviewed`]}),2}else return process.stderr.write(`design: ${s.detail} (${s.reviewCmd})
6
6
  `),2}catch(t){process.env.KANE_DEBUG&&process.stderr.write(`trust gate skipped: ${String(t)}
7
7
  `)}let i=null,x=null;try{if(!o.mode&&!process.stdin.isTTY)return process.stderr.write(`design: no TTY \u2014 pass an explicit --mode agent|ci|override to run headless
8
8
  `),2;let t=o.mode??"interactive";if(t==="interactive"){if(!process.stdin.isTTY||!process.stdout.isTTY)return process.stderr.write(`design: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
9
- `),2;let{bindDesignInteractive:n}=await import("./interactive-bind-PSEYAL54.js");return await n(o)}let{resolveAgentAuthEnv:r}=await import("./spawner-ANLF7OX3.js"),{runAgent:s}=await import("./bridge-LOBTHY3P.js"),{preflightTurn:d}=await import("./turn-preflight-JGYT7LXP.js"),{makeInterruptGuard:l}=await import("./interrupt-guard-UREUWNRL.js"),{baseUrlAdvisory:c}=await import("./turn-preflight-JGYT7LXP.js"),{makeHeadlessIO:f,resolveEncoding:D,guardedChannels:R}=await import("./headless-io-66RG5NN5.js"),{withStructuredNext:A,prepareStructuredResume:U}=await import("./structured-answers-5EY2AZN7.js");i=A(f(D(t),"design"));let{runWithChannel:$}=await import("./run-channel-RGH4WIQX.js"),w=i,I=D(t)==="ndjson"?n=>$({event:g=>w.event(g)},n):n=>n(),E=n=>{w.out(n),w.event({type:"note",text:n})},{telemetryBootstrap:N,telemetryEnvName:G}=await import("./bootstrap-5IHKW5SE.js"),u=N({verb:"design",mode:t,contextRoot:m(process.cwd()),env:G(),resumeSid:o.resume,write:!0,longSession:!0});x=n=>u.end(n);let a=U({opts:e,contextDir:m(process.cwd()),verb:"design"});if(a.kind==="refuse")return i.out(a.error),t==="agent"&&i.event({type:"error",message:a.error,code:a.code}),await u.end({exit_code:2}),t==="agent"?i.done(2,"refused"):2;let C;if(a.kind==="apply"){for(let n of a.notes)E(n);if(a.matchedQids.length>0){E(`applying ${a.matchedQids.length} structured answer(s) from --answer to the paused session's pending questions`);for(let n of a.matchedQids)i.event({type:"panel_resolved",id:n,by:"user",via:"flag"})}a.statement&&(C=[o.message,a.statement].filter(Boolean).join(`
9
+ `),2;let{bindDesignInteractive:n}=await import("./interactive-bind-7UDJY4CF.js");return await n(o)}let{resolveAgentAuthEnv:r}=await import("./spawner-ZSYJQGQW.js"),{runAgent:s}=await import("./bridge-GQJ35GTL.js"),{preflightTurn:d}=await import("./turn-preflight-JGYT7LXP.js"),{makeInterruptGuard:l}=await import("./interrupt-guard-UREUWNRL.js"),{baseUrlAdvisory:c}=await import("./turn-preflight-JGYT7LXP.js"),{makeHeadlessIO:f,resolveEncoding:D,guardedChannels:R}=await import("./headless-io-66RG5NN5.js"),{withStructuredNext:A,prepareStructuredResume:U}=await import("./structured-answers-5EY2AZN7.js");i=A(f(D(t),"design"));let{runWithChannel:$}=await import("./run-channel-RGH4WIQX.js"),w=i,I=D(t)==="ndjson"?n=>$({event:g=>w.event(g)},n):n=>n(),E=n=>{w.out(n),w.event({type:"note",text:n})},{telemetryBootstrap:N,telemetryEnvName:G}=await import("./bootstrap-BTEXO6HX.js"),u=N({verb:"design",mode:t,contextRoot:m(process.cwd()),env:G(),resumeSid:o.resume,write:!0,longSession:!0});x=n=>u.end(n);let a=U({opts:e,contextDir:m(process.cwd()),verb:"design"});if(a.kind==="refuse")return i.out(a.error),t==="agent"&&i.event({type:"error",message:a.error,code:a.code}),await u.end({exit_code:2}),t==="agent"?i.done(2,"refused"):2;let C;if(a.kind==="apply"){for(let n of a.notes)E(n);if(a.matchedQids.length>0){E(`applying ${a.matchedQids.length} structured answer(s) from --answer to the paused session's pending questions`);for(let n of a.matchedQids)i.event({type:"panel_resolved",id:n,by:"user",via:"flag"})}a.statement&&(C=[o.message,a.statement].filter(Boolean).join(`
10
10
 
11
11
  `))}let b=c();b&&E(b);let v=l(s,n=>i.out(n)),k=R(i,()=>v.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let n=t==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY?async h=>{let{createInterface:Y}=await import("readline/promises"),S=Y({input:process.stdin,output:process.stdout});try{return/^y(es)?$/i.test((await S.question(`${h} [y/N] `)).trim())}finally{S.close()}}:void 0,g=await I(async()=>{let h={...await r(),...u.spawnEnv()};return _({...o,mode:t,...C!==void 0?{message:C}:{},...n?{confirmRetarget:n}:{}},{contextDir:m(process.cwd()),agent:v.agent,preflightTurn:()=>d(h),ask:async()=>[],out:k.out,emit:k.emit,progress:w.progress,isTTY:!1,auth:h,telemetry:u})});return v.interrupted()&&g!==3?(i.out("interrupted \u2014 no session saved"),await u.end({exit_code:130}),i.done(130)):(g===1&&i.out(u.supportFooter()),await u.end({exit_code:g}),i.done(g))}finally{v.dispose()}}catch(t){x&&await x({exit_code:1}).catch(()=>{});let r=t instanceof Error?t.message:String(t);i?.event({type:"error",message:`error: design failed: ${r}`});let s=i?d=>i.out(d):d=>process.stderr.write(d+`
12
12
  `);return s(`error: design failed: ${r}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&t instanceof Error&&t.stack&&s(t.stack),s('hint: the full trace is in the file named on the "trace:" line at the start of this run'),i?i.done(1):1}}export{B as designTestsCommand};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-CNNJ4U2L.js";import"./chunk-R5T4RLF5.js";import"./chunk-KBM3XHAM.js";import"./chunk-2YEHV2CX.js";import"./chunk-IDX3TOPY.js";import"./chunk-BKM2LWU2.js";import"./chunk-56PAQAX5.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-CCUGKBIH.js";import"./chunk-UR6MHSHU.js";export{b as telemetryBootstrap,a as telemetryEnvName};
2
+ import{a,b}from"./chunk-E5S4BASB.js";import"./chunk-R5T4RLF5.js";import"./chunk-KBM3XHAM.js";import"./chunk-2YEHV2CX.js";import"./chunk-IDX3TOPY.js";import"./chunk-BKM2LWU2.js";import"./chunk-56PAQAX5.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{b as telemetryBootstrap,a as telemetryEnvName};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a}from"./chunk-IGJIDN4U.js";import"./chunk-TKYJTXWL.js";import"./chunk-AWD56KGX.js";import"./chunk-UD7KKHPW.js";import"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";export{a as runAgent};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as l}from"./chunk-RZ4F3BHX.js";import{b as i,f as c}from"./chunk-CCUGKBIH.js";import"./chunk-UR6MHSHU.js";import{readFileSync as u,writeFileSync as g,mkdirSync as d}from"fs";import{join as f}from"path";var h=f(i,"changelog-cache.json"),p=3600*1e3;function y(){try{let e=JSON.parse(u(h,"utf-8"));if(Date.now()-e.cachedAt<p)return e}catch{}return null}function m(e){try{d(i,{recursive:!0}),g(h,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function A(e){try{let t=y();if(t){let r=t.entries;return e?.all?r:r.slice(0,5)}let n=new AbortController,o=setTimeout(()=>n.abort(),5e3),a=await l(`${c}?per_page=30`,{headers:{Accept:"application/vnd.github+json"},signal:n.signal});if(clearTimeout(o),!a.ok)return[];let s=(await a.json()).map(r=>({version:r.tag_name.replace(/^v/,""),date:r.published_at?r.published_at.slice(0,10):"",body:r.body??""}));return m(s),e?.all?s:s.slice(0,5)}catch{return[]}}function v(e){if(e.length===0)return"Could not fetch changelog. Visit https://github.com/LambdaTest/kane-cli/releases";let t=["kane-cli Changelog","\u2500".repeat(40),""];for(let n of e){if(t.push(`v${n.version} (${n.date})`),n.body){let o=n.body.split(`
2
+ import{a as l}from"./chunk-RZ4F3BHX.js";import{b as i,f as c}from"./chunk-OFW3ZVTP.js";import"./chunk-UR6MHSHU.js";import{readFileSync as u,writeFileSync as g,mkdirSync as d}from"fs";import{join as f}from"path";var h=f(i,"changelog-cache.json"),p=3600*1e3;function y(){try{let e=JSON.parse(u(h,"utf-8"));if(Date.now()-e.cachedAt<p)return e}catch{}return null}function m(e){try{d(i,{recursive:!0}),g(h,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function A(e){try{let t=y();if(t){let r=t.entries;return e?.all?r:r.slice(0,5)}let n=new AbortController,o=setTimeout(()=>n.abort(),5e3),a=await l(`${c}?per_page=30`,{headers:{Accept:"application/vnd.github+json"},signal:n.signal});if(clearTimeout(o),!a.ok)return[];let s=(await a.json()).map(r=>({version:r.tag_name.replace(/^v/,""),date:r.published_at?r.published_at.slice(0,10):"",body:r.body??""}));return m(s),e?.all?s:s.slice(0,5)}catch{return[]}}function v(e){if(e.length===0)return"Could not fetch changelog. Visit https://github.com/LambdaTest/kane-cli/releases";let t=["kane-cli Changelog","\u2500".repeat(40),""];for(let n of e){if(t.push(`v${n.version} (${n.date})`),n.body){let o=n.body.split(`
3
3
  `).filter(a=>a.trim());for(let a of o)t.push(` ${a}`)}t.push("")}return t.join(`
4
4
  `)}export{A as fetchChangelog,v as formatChangelog};
@@ -0,0 +1,4 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{b as U}from"./chunk-DNNZ353O.js";import{a as G}from"./chunk-Q2F5QB2W.js";import{b as B,c as b}from"./chunk-NVGBE2DR.js";import{A as T}from"./chunk-TH47OOBV.js";import{a as L,c as F}from"./chunk-CUM23TLF.js";import{b as P,i as j}from"./chunk-DUAXZYAD.js";import{a as N,d as R,f as $}from"./chunk-WXHQYYD5.js";import{existsSync as re,mkdirSync as se,readFileSync as ae,writeFileSync as de}from"fs";import{basename as A,extname as H,join as le}from"path";var K=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function Z(e){return typeof e=="string"&&e!=="."&&e!==".."&&K.test(e)}function k(e){if(!Z(e))throw new Error(`unsafe logical_id: ${JSON.stringify(e)} \u2014 must match ${String(K)} (no path separators)`)}import{extname as q}from"path";var Q={kind:"jira",media_type:"application/x-kane-jira-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},ee={kind:"confluence",media_type:"application/x-kane-confluence-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},xe={kind:"web",media_type:"application/x-kane-web-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},te={kind:"linear",media_type:"application/x-kane-linear-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},ne={kind:"linear-doc",media_type:"application/x-kane-linear-doc-envelope",extensions:[],cite:"verbatim",maxBytes:2e6},z=[{kind:"text",media_type:"text/plain",extensions:[".txt"],cite:"verbatim",maxBytes:2e6},{kind:"markdown",media_type:"text/markdown",extensions:[".md",".markdown"],cite:"verbatim",maxBytes:2e6},{kind:"image",media_type:"image/png",extensions:[".png"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/jpeg",extensions:[".jpg",".jpeg"],cite:"anchor-only",maxBytes:5e6},{kind:"image",media_type:"image/webp",extensions:[".webp"],cite:"anchor-only",maxBytes:5e6},{kind:"text",media_type:"application/json",extensions:[".json"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/yaml",extensions:[".yaml",".yml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/toml",extensions:[".toml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"application/xml",extensions:[".xml"],cite:"verbatim",maxBytes:2e6},{kind:"text",media_type:"text/plain",extensions:[".log"],cite:"verbatim",maxBytes:2e6},{kind:"pdf",media_type:"application/pdf",extensions:[".pdf"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.subarray(0,5).toString("latin1")==="%PDF-"},{kind:"docx",media_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extensions:[".docx"],cite:"verbatim",maxBytes:25e6,sniff:e=>e.length>=4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,sniffFail:e=>e.length>=8&&e.subarray(0,8).equals(ie)?"DOCX_ENCRYPTED_OR_LEGACY: password-protected Office file (or a legacy .doc renamed .docx) \u2014 remove the password / save as .docx and re-ingest":void 0},Q,ee,te,ne],ie=Buffer.from([208,207,17,224,161,177,26,225]),M={pdf:"pdf",docx:"docx",jira:"jira",confluence:"confluence",web:"web",linear:"linear","linear-doc":"linearDoc"},ge=new Set(Object.keys(M));function J(e){let n=q(e).toLowerCase(),t=z.find(i=>i.extensions.includes(n));return t?{ok:!0,media:t}:{ok:!1,code:"UNSUPPORTED_MEDIA",allowlist:z.flatMap(i=>i.extensions)}}function v(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function ce(e,n,t){return G({source_id:e,source_cid:"sha256:".padEnd(71,"0"),doc_kind:n,numbered_text:U(t)})}var Y=2e3;function me(e){let t=A(e,H(e)).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[^a-z0-9]+/,"");return k(t),t}function Ce(e){let n=/^(.*?)[-_.]?v?\d+$/.exec(e);if(!n)return null;let t=(n[1]??"").replace(/[-_.]+$/,"");return t.length>0&&t!==e?t:null}function W(e){let n=le(e,"meta.json");re(n)||(se(e,{recursive:!0}),de(n,JSON.stringify({schema:N,canonicalizer:"v1"},null,2)+`
3
+ `))}async function Se(e){let{contextDir:n,filePath:t,asId:i,confirmSameSource:_,converters:w}=e;W(n);let o=ae(t),s=J(t);if(!s.ok)throw new Error(`${A(t)} is a file type kane can't ingest (${H(t)||"no extension"}) \u2014 supported: ${s.allowlist.join(" ")} [UNSUPPORTED_MEDIA]`);if(o.byteLength>s.media.maxBytes)throw new Error(`${A(t)} is too large \u2014 ${v(o.byteLength)}, the limit for ${s.media.media_type} is ${v(s.media.maxBytes)} [FILE_TOO_LARGE]`);if(s.media.sniff&&!s.media.sniff(o)){let m=s.media.sniffFail?.(o);throw new Error(m??`MEDIA_SNIFF_MISMATCH: ${t} does not look like ${s.media.media_type}`)}let c;return i!==void 0?(k(i),c=i):c=me(t),pe({contextDir:n,bytes:o,media:s.media,sourceId:c,label:t,confirmSameSource:_,converters:w})}async function pe(e){let{contextDir:n,bytes:t,media:i,confirmSameSource:_,converters:w}=e,o=e.sourceId,s=e.label??o;if(W(n),t.byteLength>i.maxBytes)throw new Error(`the content is too large \u2014 ${v(t.byteLength)}, the limit for ${i.media_type} is ${v(i.maxBytes)} [FILE_TOO_LARGE]`);let c=[],m=M[i.kind];if(i.cite==="verbatim"&&!m){try{new TextDecoder("utf-8",{fatal:!0}).decode(t)}catch{throw new Error(`ENCODING_UNSUPPORTED: ${s} is not valid UTF-8 \u2014 re-save it as UTF-8 and re-ingest`)}t.toString("utf8").split(`
4
+ `).some(f=>f.length>Y)&&c.push(`long line detected (> ${Y} chars) \u2014 anchors lose granularity; consider pretty-printing before ingest`)}let p=B(t),y=new Map,l=null,C=!1;for(let f=0;;f++){let g=T(n),u=g.heads.get(o),X=u!=null?g.getNode(u)?.content:void 0;if(u!=null&&X?.blob===p)return{status:"unchanged",source_id:o,cid:u,blob:p};if(u==null){for(let[r,x]of g.heads.entries())if(!(r===o||x==null)&&g.getNode(x)?.content.blob===p){let a;if(y.has(r)?a=y.get(r):f===0&&_?(a=await _(r),y.set(r,a)):(a=!1,y.set(r,a),f>0&&c.push(`same bytes already ingested as '${r}' \u2014 minted under '${o}' anyway (the twin appeared mid-commit; not prompted)`)),a)return{status:"unchanged",source_id:r,cid:x,blob:p};break}}if(l===null){let r={},x,a=null,S=null;if(m){let O=w?.[m];if(!O)throw new Error(`${m.toUpperCase()}_CONVERTER_MISSING: ${m} ingestion requires the converter \u2014 the command layer wires it`);let d=await O(t);a=Buffer.from(d.projection,"utf8");let D=ce(o,i.kind,a);if(D>4e5)throw new Error(`PROJECTION_TOO_LARGE: serialized source payload ${D} bytes > ${4e5} \u2014 split the document and re-ingest`);r={text_blob:B(a),...d.inventory.length>0?{images:d.inventory}:{},converter:d.converter},S=d.blobs,x={kind:i.kind,...d.pages!==void 0?{pages:d.pages}:{},delivered:d.delivered.length,omitted:d.inventory.length-d.delivered.length}}l={derived:r,composite:x,projBytes:a,derivedBlobs:S}}if(!C){if(b(n,t),l.projBytes!==null&&b(n,l.projBytes),l.derivedBlobs!==null)for(let[,r]of l.derivedBlobs)b(n,r);C=!0}let h=F(o,p),E=$("source",h);if(E.length>0)throw new Error(`source node fails ${E[0].code}: ${E[0].detail}`);let I=L("source",h);try{j(n,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:I,label:R.SOURCE,content:h}],edges:[],review:[],supersessions:[],media:{[o]:{format:i.kind,media_type:i.media_type,anchors_supported:m?["L-L","img#ref"]:i.cite==="verbatim"?["L-L"]:[],...l.derived}},...e.eventIds&&e.eventIds.length>0?{event_ids:e.eventIds}:{},source_head_moves:{[o]:I}},{expectPrev:g.latestHash})}catch(r){if(r instanceof P&&f<3)continue;throw r}return{status:u!=null?"versioned":"created",source_id:o,cid:I,blob:p,...c.length?{warnings:c}:{},...l.composite?{composite:l.composite}:{}}}}export{k as a,Q as b,ee as c,xe as d,te as e,ne as f,ge as g,J as h,ce as i,me as j,Ce as k,Se as l,pe as m};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as j}from"./chunk-CLGC7VEO.js";import{d as K}from"./chunk-RKXHVP2Z.js";import{a as L}from"./chunk-5Y2G4NC7.js";import{a as M}from"./chunk-YCCUBQY4.js";import{x as s}from"./chunk-CCUGKBIH.js";import{a as O}from"./chunk-HCBYKLMW.js";import{a as x,b as n,i as D,k as E}from"./chunk-C44QQJR4.js";import{a as I}from"./chunk-6YGTRKDT.js";import{e as y}from"./chunk-UR6MHSHU.js";var g=y(O(),1);function ee(e){let t=e.findIndex(r=>r.free);return t>=0?t:null}var q=60,Q=100;function te({headline:e,ask:t=!1,rows:r,sel:o,focused:d,freeText:c=null,freeTextNote:h,sublines:b=[]}){let{stdout:p}=E(),i=p?.columns??80,v=i<q,k=Math.min(i-1,Q),u=a=>d&&o===a?(0,g.jsx)(n,{color:s.assuranceAccent,children:"\u276F"}):" ",m=t?`? ${e}`:e,A=Math.max(4,k-3),S=b.map((a,w)=>(0,g.jsx)(n,{color:s.dim,children:` ${a.length>A?`${a.slice(0,A-1)}\u2026`:a}`},`sub-${w}`)),R=0,B=r.map((a,w)=>a.free?c?(0,g.jsxs)(x,{flexDirection:"column",children:[(0,g.jsxs)(x,{children:[(0,g.jsxs)(n,{children:[(0,g.jsx)(n,{color:s.assuranceAccent,children:"\u276F"})," ",(0,g.jsx)(n,{color:s.dim,children:"\u270E "})]}),(0,g.jsx)(M,{value:c.value,onChange:c.onChange,onSubmit:c.onSubmit,onCancel:c.onCancel,placeholder:a.label})]}),h?(0,g.jsx)(n,{color:s.muted,children:` ${h}`}):null]},a.key):(0,g.jsxs)(n,{children:[u(w)," ",(0,g.jsx)(n,{color:s.dim,children:`\u270E ${a.label}`})]},a.key):(R+=1,(0,g.jsxs)(n,{bold:d&&o===w,children:[u(w),` ${R}. ${a.label}`,a.detail?(0,g.jsx)(n,{color:s.dim,bold:!1,children:` \u2014 ${a.detail}`}):null]},a.key)));return v?(0,g.jsxs)(x,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,g.jsx)(n,{bold:!0,color:s.assuranceAccent,children:m}),S,B]}):(0,g.jsxs)(x,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,g.jsx)(n,{bold:!0,color:s.assuranceAccent,children:m}),S,(0,g.jsx)(n,{children:" "}),B]})}var H=y(I(),1);var $=y(O(),1),N=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function le(e){let t=e.replace(/…$/,"");return t&&t.charAt(0).toLowerCase()+t.slice(1)}function F(e,t){if(e.length<=t)return e;if(t<=1)return"\u2026";let r=Math.ceil((t-1)/2),o=Math.floor((t-1)/2);return`${e.slice(0,r)}\u2026${o>0?e.slice(-o):""}`}function ce({status:e,meta:t,tallies:r,keys:o,child:d,cols:c}){let{stdout:h}=E(),b=c??h?.columns??80,p=e.kind==="working"||e.kind==="child-working",[i,v]=(0,H.useState)(0);L(()=>v(f=>f+1),p?120:null);let k=N[i%N.length],u,m;switch(e.kind){case"working":u=`${k} ${e.step}${e.elapsedS!==void 0?` \xB7 ${e.elapsedS}s`:""}`,m=s.assuranceAccent;break;case"waiting":u=`\u25CF waiting on you${e.pending?` \u2014 ${e.pending} question${e.pending===1?"":"s"}`:""}`,m=s.amber;break;case"idle":u="\u25CF idle",m=s.assuranceAccent;break;case"card":u=`\u25CF card ${e.n} of ${e.m}`,m=s.amber;break;case"child-working":u=`${k} child: ${e.step}`,m=s.assuranceAccent;break;case"child-waiting":u="\u25CF child waiting on you",m=s.amber;break}let A=d?`${t.verb} \u25B8 ${d.verb}`:t.verb,S=d?.sid?t.sid?`${F(t.sid,14)} \u25B8 ${d.sid}`:d.sid:t.sid,R=t.env==="prod"?"":t.env,B=[A,S,R].filter(Boolean),a=" \xB7 ",w=u.length+a.length+B.join(a).length,C=t.subject;if(C){let f=b-w-a.length;C=f>=8?F(C,f):void 0}let _=[A,...C?[C]:[],S,R].filter(Boolean).join(a);return(0,$.jsxs)(x,{flexDirection:"column",children:[(0,$.jsx)(n,{color:s.muted,children:"\u2500".repeat(Math.max(1,b))}),(0,$.jsxs)(n,{children:[(0,$.jsx)(n,{color:m,children:u}),(0,$.jsx)(n,{color:s.dim,children:`${a}${_}`})]}),(0,$.jsx)(n,{color:s.dim,children:r.items.length>0?r.items.join(a):" "}),(0,$.jsx)(n,{color:s.muted,children:o.join(a)})]})}var P=y(I(),1);function ue({onToggleThinking:e,onCtrlC:t,explorer:r,panel:o}){let c=(0,P.useRef)(null),h=(0,P.useRef)(""),b=()=>{c.current&&clearTimeout(c.current),c.current=null,h.current=""};return(0,P.useEffect)(()=>b,[]),D((p,i)=>{if(i.ctrl&&p==="t"){e();return}if(i.ctrl&&p==="c"){t();return}if(!i.ctrl&&p.includes("")){t();return}if(!i.ctrl&&p.includes("")){e();return}if(r&&r.isOpen()){let v=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{b(),r.onBack()},150)};if(c.current){if(i.upArrow||i.downArrow||i.return){b(),i.return?r.onEnter():r.onMove(i.upArrow?-1:1);return}if(h.current+=p,h.current==="["){v();return}let k=h.current;b();let u=/^\[([ABCD])/.exec(k);if(u){(u[1]==="A"||u[1]==="B")&&r.onMove(u[1]==="A"?-1:1);return}r.onBack();return}if(i.upArrow){r.onMove(-1);return}if(i.downArrow){r.onMove(1);return}if(i.return){r.onEnter();return}if(i.escape){h.current="",v();return}return}if(o&&o.isFocused()){let v=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{b(),o.onBack()},150)};if(c.current){if(i.upArrow||i.downArrow||i.return||i.leftArrow||i.rightArrow){b(),i.return?o.onSelect():i.leftArrow?o.onLeft?.():i.rightArrow?o.onRight?.():o.onMove(i.upArrow?-1:1);return}if(h.current+=p,h.current==="["){v();return}let k=h.current;b();let u=/^\[([ABCD])/.exec(k);if(u){u[1]==="A"||u[1]==="B"?o.onMove(u[1]==="A"?-1:1):u[1]==="C"?o.onRight?.():o.onLeft?.();return}o.onBack();return}if(i.upArrow){o.onMove(-1);return}if(i.downArrow){o.onMove(1);return}if(i.leftArrow){o.onLeft?.();return}if(i.rightArrow){o.onRight?.();return}if(i.return){o.onSelect();return}if(i.escape){h.current="",v();return}if(/^[1-9]$/.test(p)){o.onDigit(Number(p));return}if(i.tab){o.onTab?.();return}if(p===" "&&o.isMulti()){o.onSpace();return}if(p&&!i.ctrl&&!i.meta){o.onType(p);return}return}}),null}var l=y(O(),1);function X(e){return e.kind==="REVIEW"?[{v:"approve",label:"approve",detail:"mark it reviewed and trusted"},{v:"archive",label:"archive",detail:"reject it \u2014 asks for a reason; impact shown above"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="PAIR"?[{v:"merge",label:"merge",detail:"duplicate \u2014 fold into the older item (it stays unreviewed)"},{v:"keep_both",label:"keep both",detail:"genuinely distinct \u2014 promote both"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="ARCHIVE"?[{v:"archive",label:"retire",detail:"hidden from now on; history is kept and it can be reverted"},{v:"skip",label:"skip",detail:"keep it \u2014 decided, never re-offered"},{v:"defer",label:"defer",detail:"not now \u2014 the plan re-offers it"}]:e.heldPayload?[{v:"approve",label:"approve update",detail:"commit the held payload \u2014 impact preview above"},{v:"skip",label:"keep current",detail:"drop the held payload (the owner's disk state stays untouched)"},{v:"defer",label:"defer",detail:"not now \u2014 stays held"}]:[{v:"approve",label:"approve",detail:e.kind==="ADD"?"commit + design it":"commit the updated version (old\u2192new redirect)"},{v:"skip",label:e.origin==="content-change"?"reject":"skip",detail:e.origin==="content-change"?"drop the staged proposal \u2014 nothing committed":"leave it as is"},{v:"defer",label:"defer",detail:"not now \u2014 the plan keeps it staged"}]}function V(e){let t=X(e);return e.viewDiff&&t.push({v:"view_diff",label:"view diff",detail:"full old \u2192 new"}),t}function W(e){return e.kind==="ARCHIVE"?null:V(e).length}var Y={ADD:{color:s.green??"green"},MODIFY:{color:"yellow"},ARCHIVE:{color:s.red},REVIEW:{color:"cyan"},PAIR:{color:"magenta"}},U=60;function be({card:e,position:t,sel:r=0,focused:o=!1,freeText:d=null,editorIntent:c="steer"}){let{stdout:h}=E(),b=h?.columns??80,p=b<U,i=V(e),v=W(e),k=Y[e.kind],u=f=>o&&r===f?(0,l.jsx)(n,{color:s.assuranceAccent,children:"\u276F"}):" ",m=e.impact,A=m&&"stale_refs"in m&&m.stale_refs.length>0?`${e.kind==="ARCHIVE"?"retiring leaves":"approving marks"} ${m.stale_refs.length} item(s) stale`+((m.direct_refs?.length??0)>0?` \u2014 ${m.direct_refs.length} directly touched: ${m.direct_refs.join(", ")}`:""):m&&"design_children"in m?`${e.kind==="REVIEW"?"archiving drops":"merging folds"} ${m.design_children} design child(ren)`:null,S=e.provenance&&e.provenance!==e.why?e.provenance:e.origin??null,R=[{label:"why",text:e.why},...S?[{label:"from",text:S,dimmer:!0}]:[],...e.tier?[{label:"match",text:e.tier,dimmer:!0}]:[],...A?[{label:"impact",text:A}]:[]],B=Math.max(...R.map(f=>f.label.length)),a="? reconcile",w=`item ${t.n} of ${t.of}`,C=(0,l.jsxs)(x,{flexDirection:"column",children:[(0,l.jsx)(x,{paddingLeft:2,children:(0,l.jsxs)(n,{bold:!0,children:[(0,l.jsx)(n,{color:k.color,children:`[${e.kind}]`}),` ${j(e.title)}`]})}),R.map((f,T)=>(0,l.jsx)(x,{paddingLeft:2,children:(0,l.jsxs)(n,{children:[(0,l.jsx)(n,{color:s.dim,children:`${f.label.padEnd(B)} `}),(0,l.jsx)(n,{color:f.dimmer?s.dim:void 0,children:f.text})]})},`f-${T}`)),e.diffSummary?(0,l.jsx)(x,{paddingLeft:2,children:(0,l.jsx)(n,{color:s.dim,children:e.diffSummary})}):(e.diff??[]).map((f,T)=>(0,l.jsx)(x,{paddingLeft:4,children:(0,l.jsx)(n,{color:f.op==="-"?"red":"green",children:`${f.op==="-"?"\u2212":"+"} ${f.field==="criteria"?"criterion":f.field}: ${f.text}`})},`d-${T}`)),(e.citeLines??[]).map((f,T)=>(0,l.jsx)(x,{paddingLeft:2,children:(0,l.jsx)(n,{color:s.dim,children:f})},`c-${T}`)),(0,l.jsx)(n,{children:" "}),i.map((f,T)=>(0,l.jsxs)(n,{children:[u(T),` ${T+1}. ${f.label}`,(0,l.jsx)(n,{color:s.dim,children:` \u2014 ${f.detail}`})]},`o-${T}`)),v!==null||d&&c==="because"?d?(0,l.jsxs)(x,{flexDirection:"column",children:[(0,l.jsxs)(x,{children:[(0,l.jsxs)(n,{children:[(0,l.jsx)(n,{color:s.assuranceAccent,children:"\u276F"})," ",(0,l.jsx)(n,{color:s.dim,children:"\u270E "})]}),(0,l.jsx)(M,{value:d.value,onChange:d.onChange,onSubmit:d.onSubmit,onCancel:d.onCancel,placeholder:c==="because"?"why archive it?":"say what to adjust"})]}),(0,l.jsx)(n,{color:s.muted,children:c==="because"?" submits as: archive \xB7 your reason goes on the record":e.kind==="PAIR"?" submits as: defer \xB7 your note parks with the card (it re-offers)":" submits as: approve \xB7 your words steer the re-design"})]}):v!==null?(0,l.jsxs)(n,{children:[u(v)," ",(0,l.jsx)(n,{color:s.dim,children:e.kind==="PAIR"?"\u270E defer with a note \u2014 say what you noticed":"\u270E approve with changes \u2014 say what to adjust"})]}):null:null]});if(p)return(0,l.jsxs)(x,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,l.jsx)(n,{bold:!0,color:s.assuranceAccent,children:a}),(0,l.jsx)(n,{color:s.dim,children:w}),C]});let _=Math.max(2,Math.min(b-1,100)-a.length-w.length);return(0,l.jsxs)(x,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,l.jsxs)(n,{children:[(0,l.jsx)(n,{bold:!0,color:s.assuranceAccent,children:a})," ".repeat(_),(0,l.jsx)(n,{color:s.dim,children:w})]}),(0,l.jsx)(n,{children:" "}),C]})}var z={"acceptance criteria":1,scenarios:2,"acceptance criteria + exercises":3,"tests + gaps":4};function we(e,t){let r=[],o=K(e.turns).entries.length;if(t==="design"){let c;for(let b=e.ledger.length-1;b>=0;b--){let p=e.ledger[b];if(p.kind==="banner"&&p.text.startsWith("designing: ")){c=p.text.slice(11);break}}let h=c?z[c]:void 0;h&&r.push(`phase ${h}/4`),o>0&&r.push(`${o} item${o===1?"":"s"} this session`)}else o>0&&r.push(`${o} saved as draft${o===1?"":"s"}`);let d=e.pending?e.pending.resolution.filter(c=>!c).length:0;return d>0&&r.push(`${d} question${d===1?"":"s"} pending`),e.credits&&r.push(`${e.credits.total.toFixed(1)} credits`),{items:r}}function ke(e,t){let r=[],o=e.applied+e.committed+e.retired;r.push(`${o} applied`),r.push(`${t} to decide`);let d=[];return e.skipped>0&&d.push(`${e.skipped} skipped`),e.deferred>0&&d.push(`${e.deferred} deferred`),e.failed>0&&d.push(`${e.failed} failed`),{items:[...r,...d]}}function Ae(e,t){let r=["\u2191\u2193 select","\u23CE confirm"];return e.multi_select&&r.push("space toggle"),t.batchCount>1&&r.push("\u2190 \u2192 questions"),(e.allow_free_text||e.options.some(o=>o.input===!0))&&r.push("\u270E type your own"),t.canAttach&&r.push("@ attach a file or URL"),t.escBack&&r.push("esc back"),{keys:r}}function Se(e,t){let r=["\u2191\u2193 select","\u23CE confirm"];return e.some(o=>o.free)&&r.push("\u270E type your own"),t.escBack&&r.push("esc back"),{keys:r}}function Re(e){let t=["\u2191\u2193 select","\u23CE confirm","1-9 verdict"];return W(e)!==null&&t.push("type = adjust"),t.push("esc \xB7 nothing to undo"),{keys:t}}export{ee as a,te as b,le as c,ce as d,ue as e,X as f,V as g,W as h,be as i,we as j,ke as k,Ae as l,Se as m,Re as n};
2
+ import{a as j}from"./chunk-CLGC7VEO.js";import{d as K}from"./chunk-RKXHVP2Z.js";import{a as L}from"./chunk-5Y2G4NC7.js";import{a as M}from"./chunk-YCCUBQY4.js";import{x as s}from"./chunk-OFW3ZVTP.js";import{a as O}from"./chunk-HCBYKLMW.js";import{a as x,b as n,i as D,k as E}from"./chunk-C44QQJR4.js";import{a as I}from"./chunk-6YGTRKDT.js";import{e as y}from"./chunk-UR6MHSHU.js";var g=y(O(),1);function ee(e){let t=e.findIndex(r=>r.free);return t>=0?t:null}var q=60,Q=100;function te({headline:e,ask:t=!1,rows:r,sel:o,focused:d,freeText:c=null,freeTextNote:h,sublines:b=[]}){let{stdout:p}=E(),i=p?.columns??80,v=i<q,k=Math.min(i-1,Q),u=a=>d&&o===a?(0,g.jsx)(n,{color:s.assuranceAccent,children:"\u276F"}):" ",m=t?`? ${e}`:e,A=Math.max(4,k-3),S=b.map((a,w)=>(0,g.jsx)(n,{color:s.dim,children:` ${a.length>A?`${a.slice(0,A-1)}\u2026`:a}`},`sub-${w}`)),R=0,B=r.map((a,w)=>a.free?c?(0,g.jsxs)(x,{flexDirection:"column",children:[(0,g.jsxs)(x,{children:[(0,g.jsxs)(n,{children:[(0,g.jsx)(n,{color:s.assuranceAccent,children:"\u276F"})," ",(0,g.jsx)(n,{color:s.dim,children:"\u270E "})]}),(0,g.jsx)(M,{value:c.value,onChange:c.onChange,onSubmit:c.onSubmit,onCancel:c.onCancel,placeholder:a.label})]}),h?(0,g.jsx)(n,{color:s.muted,children:` ${h}`}):null]},a.key):(0,g.jsxs)(n,{children:[u(w)," ",(0,g.jsx)(n,{color:s.dim,children:`\u270E ${a.label}`})]},a.key):(R+=1,(0,g.jsxs)(n,{bold:d&&o===w,children:[u(w),` ${R}. ${a.label}`,a.detail?(0,g.jsx)(n,{color:s.dim,bold:!1,children:` \u2014 ${a.detail}`}):null]},a.key)));return v?(0,g.jsxs)(x,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,g.jsx)(n,{bold:!0,color:s.assuranceAccent,children:m}),S,B]}):(0,g.jsxs)(x,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,g.jsx)(n,{bold:!0,color:s.assuranceAccent,children:m}),S,(0,g.jsx)(n,{children:" "}),B]})}var H=y(I(),1);var $=y(O(),1),N=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function le(e){let t=e.replace(/…$/,"");return t&&t.charAt(0).toLowerCase()+t.slice(1)}function F(e,t){if(e.length<=t)return e;if(t<=1)return"\u2026";let r=Math.ceil((t-1)/2),o=Math.floor((t-1)/2);return`${e.slice(0,r)}\u2026${o>0?e.slice(-o):""}`}function ce({status:e,meta:t,tallies:r,keys:o,child:d,cols:c}){let{stdout:h}=E(),b=c??h?.columns??80,p=e.kind==="working"||e.kind==="child-working",[i,v]=(0,H.useState)(0);L(()=>v(f=>f+1),p?120:null);let k=N[i%N.length],u,m;switch(e.kind){case"working":u=`${k} ${e.step}${e.elapsedS!==void 0?` \xB7 ${e.elapsedS}s`:""}`,m=s.assuranceAccent;break;case"waiting":u=`\u25CF waiting on you${e.pending?` \u2014 ${e.pending} question${e.pending===1?"":"s"}`:""}`,m=s.amber;break;case"idle":u="\u25CF idle",m=s.assuranceAccent;break;case"card":u=`\u25CF card ${e.n} of ${e.m}`,m=s.amber;break;case"child-working":u=`${k} child: ${e.step}`,m=s.assuranceAccent;break;case"child-waiting":u="\u25CF child waiting on you",m=s.amber;break}let A=d?`${t.verb} \u25B8 ${d.verb}`:t.verb,S=d?.sid?t.sid?`${F(t.sid,14)} \u25B8 ${d.sid}`:d.sid:t.sid,R=t.env==="prod"?"":t.env,B=[A,S,R].filter(Boolean),a=" \xB7 ",w=u.length+a.length+B.join(a).length,C=t.subject;if(C){let f=b-w-a.length;C=f>=8?F(C,f):void 0}let _=[A,...C?[C]:[],S,R].filter(Boolean).join(a);return(0,$.jsxs)(x,{flexDirection:"column",children:[(0,$.jsx)(n,{color:s.muted,children:"\u2500".repeat(Math.max(1,b))}),(0,$.jsxs)(n,{children:[(0,$.jsx)(n,{color:m,children:u}),(0,$.jsx)(n,{color:s.dim,children:`${a}${_}`})]}),(0,$.jsx)(n,{color:s.dim,children:r.items.length>0?r.items.join(a):" "}),(0,$.jsx)(n,{color:s.muted,children:o.join(a)})]})}var P=y(I(),1);function ue({onToggleThinking:e,onCtrlC:t,explorer:r,panel:o}){let c=(0,P.useRef)(null),h=(0,P.useRef)(""),b=()=>{c.current&&clearTimeout(c.current),c.current=null,h.current=""};return(0,P.useEffect)(()=>b,[]),D((p,i)=>{if(i.ctrl&&p==="t"){e();return}if(i.ctrl&&p==="c"){t();return}if(!i.ctrl&&p.includes("")){t();return}if(!i.ctrl&&p.includes("")){e();return}if(r&&r.isOpen()){let v=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{b(),r.onBack()},150)};if(c.current){if(i.upArrow||i.downArrow||i.return){b(),i.return?r.onEnter():r.onMove(i.upArrow?-1:1);return}if(h.current+=p,h.current==="["){v();return}let k=h.current;b();let u=/^\[([ABCD])/.exec(k);if(u){(u[1]==="A"||u[1]==="B")&&r.onMove(u[1]==="A"?-1:1);return}r.onBack();return}if(i.upArrow){r.onMove(-1);return}if(i.downArrow){r.onMove(1);return}if(i.return){r.onEnter();return}if(i.escape){h.current="",v();return}return}if(o&&o.isFocused()){let v=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{b(),o.onBack()},150)};if(c.current){if(i.upArrow||i.downArrow||i.return||i.leftArrow||i.rightArrow){b(),i.return?o.onSelect():i.leftArrow?o.onLeft?.():i.rightArrow?o.onRight?.():o.onMove(i.upArrow?-1:1);return}if(h.current+=p,h.current==="["){v();return}let k=h.current;b();let u=/^\[([ABCD])/.exec(k);if(u){u[1]==="A"||u[1]==="B"?o.onMove(u[1]==="A"?-1:1):u[1]==="C"?o.onRight?.():o.onLeft?.();return}o.onBack();return}if(i.upArrow){o.onMove(-1);return}if(i.downArrow){o.onMove(1);return}if(i.leftArrow){o.onLeft?.();return}if(i.rightArrow){o.onRight?.();return}if(i.return){o.onSelect();return}if(i.escape){h.current="",v();return}if(/^[1-9]$/.test(p)){o.onDigit(Number(p));return}if(i.tab){o.onTab?.();return}if(p===" "&&o.isMulti()){o.onSpace();return}if(p&&!i.ctrl&&!i.meta){o.onType(p);return}return}}),null}var l=y(O(),1);function X(e){return e.kind==="REVIEW"?[{v:"approve",label:"approve",detail:"mark it reviewed and trusted"},{v:"archive",label:"archive",detail:"reject it \u2014 asks for a reason; impact shown above"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="PAIR"?[{v:"merge",label:"merge",detail:"duplicate \u2014 fold into the older item (it stays unreviewed)"},{v:"keep_both",label:"keep both",detail:"genuinely distinct \u2014 promote both"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="ARCHIVE"?[{v:"archive",label:"retire",detail:"hidden from now on; history is kept and it can be reverted"},{v:"skip",label:"skip",detail:"keep it \u2014 decided, never re-offered"},{v:"defer",label:"defer",detail:"not now \u2014 the plan re-offers it"}]:e.heldPayload?[{v:"approve",label:"approve update",detail:"commit the held payload \u2014 impact preview above"},{v:"skip",label:"keep current",detail:"drop the held payload (the owner's disk state stays untouched)"},{v:"defer",label:"defer",detail:"not now \u2014 stays held"}]:[{v:"approve",label:"approve",detail:e.kind==="ADD"?"commit + design it":"commit the updated version (old\u2192new redirect)"},{v:"skip",label:e.origin==="content-change"?"reject":"skip",detail:e.origin==="content-change"?"drop the staged proposal \u2014 nothing committed":"leave it as is"},{v:"defer",label:"defer",detail:"not now \u2014 the plan keeps it staged"}]}function V(e){let t=X(e);return e.viewDiff&&t.push({v:"view_diff",label:"view diff",detail:"full old \u2192 new"}),t}function W(e){return e.kind==="ARCHIVE"?null:V(e).length}var Y={ADD:{color:s.green??"green"},MODIFY:{color:"yellow"},ARCHIVE:{color:s.red},REVIEW:{color:"cyan"},PAIR:{color:"magenta"}},U=60;function be({card:e,position:t,sel:r=0,focused:o=!1,freeText:d=null,editorIntent:c="steer"}){let{stdout:h}=E(),b=h?.columns??80,p=b<U,i=V(e),v=W(e),k=Y[e.kind],u=f=>o&&r===f?(0,l.jsx)(n,{color:s.assuranceAccent,children:"\u276F"}):" ",m=e.impact,A=m&&"stale_refs"in m&&m.stale_refs.length>0?`${e.kind==="ARCHIVE"?"retiring leaves":"approving marks"} ${m.stale_refs.length} item(s) stale`+((m.direct_refs?.length??0)>0?` \u2014 ${m.direct_refs.length} directly touched: ${m.direct_refs.join(", ")}`:""):m&&"design_children"in m?`${e.kind==="REVIEW"?"archiving drops":"merging folds"} ${m.design_children} design child(ren)`:null,S=e.provenance&&e.provenance!==e.why?e.provenance:e.origin??null,R=[{label:"why",text:e.why},...S?[{label:"from",text:S,dimmer:!0}]:[],...e.tier?[{label:"match",text:e.tier,dimmer:!0}]:[],...A?[{label:"impact",text:A}]:[]],B=Math.max(...R.map(f=>f.label.length)),a="? reconcile",w=`item ${t.n} of ${t.of}`,C=(0,l.jsxs)(x,{flexDirection:"column",children:[(0,l.jsx)(x,{paddingLeft:2,children:(0,l.jsxs)(n,{bold:!0,children:[(0,l.jsx)(n,{color:k.color,children:`[${e.kind}]`}),` ${j(e.title)}`]})}),R.map((f,T)=>(0,l.jsx)(x,{paddingLeft:2,children:(0,l.jsxs)(n,{children:[(0,l.jsx)(n,{color:s.dim,children:`${f.label.padEnd(B)} `}),(0,l.jsx)(n,{color:f.dimmer?s.dim:void 0,children:f.text})]})},`f-${T}`)),e.diffSummary?(0,l.jsx)(x,{paddingLeft:2,children:(0,l.jsx)(n,{color:s.dim,children:e.diffSummary})}):(e.diff??[]).map((f,T)=>(0,l.jsx)(x,{paddingLeft:4,children:(0,l.jsx)(n,{color:f.op==="-"?"red":"green",children:`${f.op==="-"?"\u2212":"+"} ${f.field==="criteria"?"criterion":f.field}: ${f.text}`})},`d-${T}`)),(e.citeLines??[]).map((f,T)=>(0,l.jsx)(x,{paddingLeft:2,children:(0,l.jsx)(n,{color:s.dim,children:f})},`c-${T}`)),(0,l.jsx)(n,{children:" "}),i.map((f,T)=>(0,l.jsxs)(n,{children:[u(T),` ${T+1}. ${f.label}`,(0,l.jsx)(n,{color:s.dim,children:` \u2014 ${f.detail}`})]},`o-${T}`)),v!==null||d&&c==="because"?d?(0,l.jsxs)(x,{flexDirection:"column",children:[(0,l.jsxs)(x,{children:[(0,l.jsxs)(n,{children:[(0,l.jsx)(n,{color:s.assuranceAccent,children:"\u276F"})," ",(0,l.jsx)(n,{color:s.dim,children:"\u270E "})]}),(0,l.jsx)(M,{value:d.value,onChange:d.onChange,onSubmit:d.onSubmit,onCancel:d.onCancel,placeholder:c==="because"?"why archive it?":"say what to adjust"})]}),(0,l.jsx)(n,{color:s.muted,children:c==="because"?" submits as: archive \xB7 your reason goes on the record":e.kind==="PAIR"?" submits as: defer \xB7 your note parks with the card (it re-offers)":" submits as: approve \xB7 your words steer the re-design"})]}):v!==null?(0,l.jsxs)(n,{children:[u(v)," ",(0,l.jsx)(n,{color:s.dim,children:e.kind==="PAIR"?"\u270E defer with a note \u2014 say what you noticed":"\u270E approve with changes \u2014 say what to adjust"})]}):null:null]});if(p)return(0,l.jsxs)(x,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,l.jsx)(n,{bold:!0,color:s.assuranceAccent,children:a}),(0,l.jsx)(n,{color:s.dim,children:w}),C]});let _=Math.max(2,Math.min(b-1,100)-a.length-w.length);return(0,l.jsxs)(x,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,l.jsxs)(n,{children:[(0,l.jsx)(n,{bold:!0,color:s.assuranceAccent,children:a})," ".repeat(_),(0,l.jsx)(n,{color:s.dim,children:w})]}),(0,l.jsx)(n,{children:" "}),C]})}var z={"acceptance criteria":1,scenarios:2,"acceptance criteria + exercises":3,"tests + gaps":4};function we(e,t){let r=[],o=K(e.turns).entries.length;if(t==="design"){let c;for(let b=e.ledger.length-1;b>=0;b--){let p=e.ledger[b];if(p.kind==="banner"&&p.text.startsWith("designing: ")){c=p.text.slice(11);break}}let h=c?z[c]:void 0;h&&r.push(`phase ${h}/4`),o>0&&r.push(`${o} item${o===1?"":"s"} this session`)}else o>0&&r.push(`${o} saved as draft${o===1?"":"s"}`);let d=e.pending?e.pending.resolution.filter(c=>!c).length:0;return d>0&&r.push(`${d} question${d===1?"":"s"} pending`),e.credits&&r.push(`${e.credits.total.toFixed(1)} credits`),{items:r}}function ke(e,t){let r=[],o=e.applied+e.committed+e.retired;r.push(`${o} applied`),r.push(`${t} to decide`);let d=[];return e.skipped>0&&d.push(`${e.skipped} skipped`),e.deferred>0&&d.push(`${e.deferred} deferred`),e.failed>0&&d.push(`${e.failed} failed`),{items:[...r,...d]}}function Ae(e,t){let r=["\u2191\u2193 select","\u23CE confirm"];return e.multi_select&&r.push("space toggle"),t.batchCount>1&&r.push("\u2190 \u2192 questions"),(e.allow_free_text||e.options.some(o=>o.input===!0))&&r.push("\u270E type your own"),t.canAttach&&r.push("@ attach a file or URL"),t.escBack&&r.push("esc back"),{keys:r}}function Se(e,t){let r=["\u2191\u2193 select","\u23CE confirm"];return e.some(o=>o.free)&&r.push("\u270E type your own"),t.escBack&&r.push("esc back"),{keys:r}}function Re(e){let t=["\u2191\u2193 select","\u23CE confirm","1-9 verdict"];return W(e)!==null&&t.push("type = adjust"),t.push("esc \xB7 nothing to undo"),{keys:t}}export{ee as a,te as b,le as c,ce as d,ue as e,X as f,V as g,W as h,be as i,we as j,ke as k,Ae as l,Se as m,Re as n};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as k}from"./chunk-PQUMOFT5.js";import{x as u}from"./chunk-CCUGKBIH.js";import{a as f}from"./chunk-HCBYKLMW.js";import{a as m,b as s,k as b}from"./chunk-C44QQJR4.js";import{e as p}from"./chunk-UR6MHSHU.js";function B(t){let e=t;return e=e.replace(/@TS\{([^}]+)\}/g,"@S{$1}"),e=e.replace(/@TS-(\d+)/g,(o,i)=>`@S${parseInt(i,10)}.C1`),e=e.replace(/@TS(\d+)/g,(o,i)=>`@S${parseInt(i,10)}`),e=e.replace(/\\n/g,`
2
+ import{a as k}from"./chunk-RDNKYRKY.js";import{x as u}from"./chunk-OFW3ZVTP.js";import{a as f}from"./chunk-HCBYKLMW.js";import{a as m,b as s,k as b}from"./chunk-C44QQJR4.js";import{e as p}from"./chunk-UR6MHSHU.js";function B(t){let e=t;return e=e.replace(/@TS\{([^}]+)\}/g,"@S{$1}"),e=e.replace(/@TS-(\d+)/g,(o,i)=>`@S${parseInt(i,10)}.C1`),e=e.replace(/@TS(\d+)/g,(o,i)=>`@S${parseInt(i,10)}`),e=e.replace(/\\n/g,`
3
3
  `),e}var c=p(f(),1),S=t=>t!==void 0&&/[A-Za-z0-9]/.test(t);function x(t){let e=[],o="",i=()=>{o&&(e.push({text:o}),o="")},d=(a,l,r)=>(a===0||!S(t[a-1]))&&(l+r>=t.length||!S(t[l+r])),n=0;for(;n<t.length;){let a=t.slice(n,n+2),l=t[n];if(a==="**"||a==="__"){let r=t.indexOf(a,n+2);if(r!==-1&&r>n+2&&(a==="**"||d(n,r,2))){i(),e.push({text:t.slice(n+2,r),bold:!0}),n=r+2;continue}}if(l==="`"){let r=t.indexOf("`",n+1);if(r!==-1&&r>n+1){i(),e.push({text:t.slice(n+1,r),code:!0}),n=r+1;continue}}if(l==="*"||l==="_"){let r=t.indexOf(l,n+1);if(r!==-1&&r>n+1&&(l==="*"||d(n,r,1))){i(),e.push({text:t.slice(n+1,r),italic:!0}),n=r+1;continue}}o+=l,n+=1}return i(),e.length===0&&e.push({text:""}),e}function h(t){return t.map((e,o)=>(0,c.jsx)(s,{bold:e.bold,italic:e.italic,color:e.code?u.dim:void 0,children:e.text},o))}function T(t){return t.split(`
4
4
  `).map(e=>{if(e.trim()==="")return{kind:"blank"};let o=e.match(/^\s*[-*+]\s+(.*)$/);if(o)return{kind:"bullet",segs:x(o[1])};let i=e.match(/^\s*(\d+)\.\s+(.*)$/);if(i)return{kind:"numbered",n:i[1],segs:x(i[2])};let d=e.match(/^#{1,6}\s+(.*)$/);return d?{kind:"heading",segs:x(d[1])}:{kind:"para",segs:x(e)}})}function R(t,e,o=""){switch(t.kind){case"blank":return(0,c.jsx)(s,{children:o||" "},e);case"heading":return(0,c.jsxs)(s,{bold:!0,children:[o,h(t.segs)]},e);case"bullet":return(0,c.jsx)(m,{marginLeft:1,children:(0,c.jsxs)(s,{children:[o,"\u2022 ",h(t.segs)]})},e);case"numbered":return(0,c.jsx)(m,{marginLeft:1,children:(0,c.jsxs)(s,{children:[o,`${t.n}. `,h(t.segs)]})},e);default:return(0,c.jsxs)(s,{children:[o,h(t.segs)]},e)}}function $({text:t,accent:e=u.generateAccent}){let o=T(B(t)),{stdout:i}=b(),d=i?.columns??80;return(0,c.jsxs)(m,{marginBottom:1,children:[(0,c.jsx)(m,{width:2,flexShrink:0,children:(0,c.jsx)(s,{color:e,children:"\u2503"})}),(0,c.jsx)(m,{flexDirection:"column",width:d-2,children:o.map((n,a)=>R(n,a))})]})}var g=p(f(),1),I=5;function C({thinking:t,expanded:e,thinkingDone:o,maxLines:i=I}){if(!e)return(0,g.jsxs)(m,{paddingX:1,children:[(0,g.jsx)(s,{color:u.dim,children:o?"\u2237 thinking complete ":"\u2237 thinking\u2026 "}),(0,g.jsx)(s,{color:u.muted,children:o?"(ctrl+t to view)":"(ctrl+t to show)"})]});let d=t.split(`
5
5
  `),n=Math.max(0,d.length-i),a=n>0?d.slice(-i).join(`
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as f}from"./chunk-5NSYHRDN.js";import{x as t}from"./chunk-CCUGKBIH.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a,b as n}from"./chunk-C44QQJR4.js";import{a as R}from"./chunk-6YGTRKDT.js";import{e as c}from"./chunk-UR6MHSHU.js";var p=c(R(),1);var e=c(x(),1);function v(){return[{name:"convert",label:"Converting session data",status:"pending"},{name:"zip",label:"Compressing artifacts",status:"pending"},{name:"presign",label:"Requesting upload URLs",status:"pending"},{name:"upload",label:"Uploading to KaneAI",status:"pending"},{name:"atomic_replace",label:"Replacing local output",status:"pending"},{name:"commit_lock",label:"Committing to TMS",status:"pending"},{name:"finalize",label:"Finalizing test case",status:"pending"},{name:"code_export",label:"Downloading test code",status:"pending"}]}function U(s,o,d,i){return s.map(l=>l.name===o?{...l,status:d,detail:i}:l)}function D(s){let o=s/1e3;if(o<60)return`${o.toFixed(1)}s`;let d=Math.floor(o/60),i=Math.round(o%60);return`${d}m ${i}s`}function w(s){let[o,d]=(0,p.useState)(0),i=p.default.useRef(Date.now());return(0,p.useEffect)(()=>{if(!s)return;i.current=Date.now();let l=setInterval(()=>{d(Date.now()-i.current)},100);return()=>clearInterval(l)},[s]),o}function h({steps:s,status:o,testUrl:d,error:i}){let l=w(o==="uploading");return o==="uploading"?(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.orange,children:"\u2601 "}),(0,e.jsx)(n,{color:t.orange,bold:!0,children:"Saving to KaneAI"}),(0,e.jsxs)(n,{color:t.dim,children:[" ",D(l)]})]}),(0,e.jsx)(a,{flexDirection:"column",marginTop:1,children:s.filter(r=>r.status!=="skipped"||r.detail).map((r,S,T)=>{let b=S===T.length-1?"\u2514\u2500":"\u251C\u2500",u=r.status==="done",m=r.status==="running",g=r.status==="failed",B=r.status==="skipped";return(0,e.jsxs)(a,{children:[(0,e.jsxs)(n,{color:t.dim,children:[" ",b," "]}),(0,e.jsx)(a,{width:3,children:m?(0,e.jsx)(f,{}):u?(0,e.jsx)(n,{color:t.green,children:"\u2713"}):g?(0,e.jsx)(n,{color:t.red,children:"\u2717"}):B?(0,e.jsx)(n,{color:t.muted,children:"\u2013"}):(0,e.jsx)(n,{color:t.muted,children:"\u25CB"})}),(0,e.jsx)(n,{color:u?t.dim:m?void 0:g?t.red:t.muted,children:r.label}),r.detail&&(0,e.jsxs)(n,{color:t.dim,children:[" ",r.detail]})]},r.name)})}),(0,e.jsx)(a,{marginTop:1,children:(0,e.jsx)(n,{color:t.muted,children:" press Ctrl+C twice to force exit"})})]}):o==="success"?(0,e.jsx)(e.Fragment,{}):(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.red,children:"\u2601 "}),(0,e.jsx)(n,{color:t.red,bold:!0,children:"Save failed"})]}),i&&(0,e.jsxs)(a,{marginTop:0,children:[(0,e.jsx)(n,{color:t.dim,children:" "}),(0,e.jsx)(n,{color:t.dim,children:i})]})]})}export{v as a,U as b,h as c};
2
+ import{a as f}from"./chunk-RX5TZZNQ.js";import{x as t}from"./chunk-OFW3ZVTP.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a,b as n}from"./chunk-C44QQJR4.js";import{a as R}from"./chunk-6YGTRKDT.js";import{e as c}from"./chunk-UR6MHSHU.js";var p=c(R(),1);var e=c(x(),1);function v(){return[{name:"convert",label:"Converting session data",status:"pending"},{name:"zip",label:"Compressing artifacts",status:"pending"},{name:"presign",label:"Requesting upload URLs",status:"pending"},{name:"upload",label:"Uploading to KaneAI",status:"pending"},{name:"atomic_replace",label:"Replacing local output",status:"pending"},{name:"commit_lock",label:"Committing to TMS",status:"pending"},{name:"finalize",label:"Finalizing test case",status:"pending"},{name:"code_export",label:"Downloading test code",status:"pending"}]}function U(s,o,d,i){return s.map(l=>l.name===o?{...l,status:d,detail:i}:l)}function D(s){let o=s/1e3;if(o<60)return`${o.toFixed(1)}s`;let d=Math.floor(o/60),i=Math.round(o%60);return`${d}m ${i}s`}function w(s){let[o,d]=(0,p.useState)(0),i=p.default.useRef(Date.now());return(0,p.useEffect)(()=>{if(!s)return;i.current=Date.now();let l=setInterval(()=>{d(Date.now()-i.current)},100);return()=>clearInterval(l)},[s]),o}function h({steps:s,status:o,testUrl:d,error:i}){let l=w(o==="uploading");return o==="uploading"?(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.orange,children:"\u2601 "}),(0,e.jsx)(n,{color:t.orange,bold:!0,children:"Saving to KaneAI"}),(0,e.jsxs)(n,{color:t.dim,children:[" ",D(l)]})]}),(0,e.jsx)(a,{flexDirection:"column",marginTop:1,children:s.filter(r=>r.status!=="skipped"||r.detail).map((r,S,T)=>{let b=S===T.length-1?"\u2514\u2500":"\u251C\u2500",u=r.status==="done",m=r.status==="running",g=r.status==="failed",B=r.status==="skipped";return(0,e.jsxs)(a,{children:[(0,e.jsxs)(n,{color:t.dim,children:[" ",b," "]}),(0,e.jsx)(a,{width:3,children:m?(0,e.jsx)(f,{}):u?(0,e.jsx)(n,{color:t.green,children:"\u2713"}):g?(0,e.jsx)(n,{color:t.red,children:"\u2717"}):B?(0,e.jsx)(n,{color:t.muted,children:"\u2013"}):(0,e.jsx)(n,{color:t.muted,children:"\u25CB"})}),(0,e.jsx)(n,{color:u?t.dim:m?void 0:g?t.red:t.muted,children:r.label}),r.detail&&(0,e.jsxs)(n,{color:t.dim,children:[" ",r.detail]})]},r.name)})}),(0,e.jsx)(a,{marginTop:1,children:(0,e.jsx)(n,{color:t.muted,children:" press Ctrl+C twice to force exit"})})]}):o==="success"?(0,e.jsx)(e.Fragment,{}):(0,e.jsxs)(a,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(n,{color:t.red,children:"\u2601 "}),(0,e.jsx)(n,{color:t.red,bold:!0,children:"Save failed"})]}),i&&(0,e.jsxs)(a,{marginTop:0,children:[(0,e.jsx)(n,{color:t.dim,children:" "}),(0,e.jsx)(n,{color:t.dim,children:i})]})]})}export{v as a,U as b,h as c};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
2
  function l(r){let{isAgent:m,log:d}=r,a=r.stdout??process.stderr,s=r.stdin??process.stdin,p=t=>{m&&process.stdout.write(JSON.stringify(t)+`
3
- `)};return{async runSteps(t){let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{TestMdRunView:i}=await import("./TestMdRunView-6BY3IUH5.js"),{ScrollbackProvider:n}=await import("./scrollback-JLPJR25X.js"),{waitUntilExit:c}=o(e.createElement(n,null,e.createElement(i,t)),{stdout:a,stdin:s,exitOnCtrlC:!1});await c()},async runUpload(t,e){let{renderUploadProgress:o}=await import("./CliUploadProgress-Y7ITY2I7.js");return await o(t,e)},async onSummary(t){try{let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{AutoExitSummaryBox:i}=await import("./SummaryBox-SLM3OFS2.js"),{waitUntilExit:n}=o(e.createElement(i,{data:t}),{stdout:a,stdin:s});await n()}catch(e){d("warn","TEST_MD_SUMMARY_RENDER_FAILED","Summary box render failed",{error:String(e)})}},async onLinks(t){try{let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{LinksBox:i}=await import("./LinksBox-TAGYCFFO.js"),{waitUntilExit:n}=o(e.createElement(i,t),{stdout:a,stdin:s});await n()}catch(e){d("warn","TEST_MD_LINKS_RENDER_FAILED","LinksBox render failed",{error:String(e)})}},onLockState(t){p({type:"test_md_lock_state",...t})},onAdaptiveHeal(t){p({type:"test_md_adaptive_heal",...t})},onAgentEvent(t){p(t)}}}export{l as a};
3
+ `)};return{async runSteps(t){let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{TestMdRunView:i}=await import("./TestMdRunView-RPW4MIJA.js"),{ScrollbackProvider:n}=await import("./scrollback-JLPJR25X.js"),{waitUntilExit:c}=o(e.createElement(n,null,e.createElement(i,t)),{stdout:a,stdin:s,exitOnCtrlC:!1});await c()},async runUpload(t,e){let{renderUploadProgress:o}=await import("./CliUploadProgress-I3N5WDNJ.js");return await o(t,e)},async onSummary(t){try{let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{AutoExitSummaryBox:i}=await import("./SummaryBox-OZIZQY4B.js"),{waitUntilExit:n}=o(e.createElement(i,{data:t}),{stdout:a,stdin:s});await n()}catch(e){d("warn","TEST_MD_SUMMARY_RENDER_FAILED","Summary box render failed",{error:String(e)})}},async onLinks(t){try{let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{LinksBox:i}=await import("./LinksBox-L24KON4U.js"),{waitUntilExit:n}=o(e.createElement(i,t),{stdout:a,stdin:s});await n()}catch(e){d("warn","TEST_MD_LINKS_RENDER_FAILED","LinksBox render failed",{error:String(e)})}},onLockState(t){p({type:"test_md_lock_state",...t})},onAdaptiveHeal(t){p({type:"test_md_adaptive_heal",...t})},onAgentEvent(t){p(t)}}}export{l as a};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as g}from"./chunk-BPMSNGXQ.js";import{b as f,c as j}from"./chunk-VE3SUJMA.js";import{a as m}from"./chunk-WLOGO44E.js";var _="KaneAI Generated",E="Untitled";async function p(e){let r=e.config.load(),d=new g(m(e.env).tmsBaseUrl,e.tmsCreds.username,e.tmsCreds.access_key),n=e.projectName??_,o=e.folderName??E,t=r.project_id??null,s=r.project_name??null;if(!t){let a=(await d.listProjects()).find(l=>l.name===n);if(a)t=a.project_id,s=a.name,e.log("info","ENSURE_PROJECT_FOUND","Found default project",{project_id:t,name:s});else{let l=await d.createProject(n);t=l.id,s=l.name,e.log("info","ENSURE_PROJECT_CREATED","Created default project",{project_id:t,name:s})}f(e.creds,e.config,e.profile,e.env,{projectId:t,projectName:s})}let c=r.folder_id??null,i=r.folder_name??null,u=!r.project_id;if(!c||u){let a=(await d.listFolders(t)).find(l=>l.name===o);if(a)c=a.id,i=a.name,e.log("info","ENSURE_FOLDER_FOUND","Found default folder",{folder_id:c,name:i});else{let l=await d.createFolder(t,o);c=l.id,i=l.name,e.log("info","ENSURE_FOLDER_CREATED","Created default folder",{folder_id:c,name:i})}f(e.creds,e.config,e.profile,e.env,{folderId:c,folderName:i})}return{projectId:t,projectName:s??n,folderId:c,folderName:i??o}}function A(e,r,d){let n=e.loadProfileConfig(r,d)??{};return{projectId:n.project_id??null,folderId:n.folder_id??null}}function N(e,r){return e.projectId===null||e.folderId===null||r===null?"needs-picker":r.project==="ok"&&r.folder==="ok"?"ok":r.project==="error"&&r.folder==="error"?"ok-tms-degraded":"needs-picker"}var k=(e,r)=>`error: profile "${e}" (${r}) has no project/folder configured AND no TMS credentials were available to auto-configure one.
2
+ import{a as g}from"./chunk-BPMSNGXQ.js";import{b as f,c as j}from"./chunk-VE3SUJMA.js";import{a as m}from"./chunk-OYJBABRV.js";var _="KaneAI Generated",E="Untitled";async function p(e){let r=e.config.load(),d=new g(m(e.env).tmsBaseUrl,e.tmsCreds.username,e.tmsCreds.access_key),n=e.projectName??_,o=e.folderName??E,t=r.project_id??null,s=r.project_name??null;if(!t){let a=(await d.listProjects()).find(l=>l.name===n);if(a)t=a.project_id,s=a.name,e.log("info","ENSURE_PROJECT_FOUND","Found default project",{project_id:t,name:s});else{let l=await d.createProject(n);t=l.id,s=l.name,e.log("info","ENSURE_PROJECT_CREATED","Created default project",{project_id:t,name:s})}f(e.creds,e.config,e.profile,e.env,{projectId:t,projectName:s})}let c=r.folder_id??null,i=r.folder_name??null,u=!r.project_id;if(!c||u){let a=(await d.listFolders(t)).find(l=>l.name===o);if(a)c=a.id,i=a.name,e.log("info","ENSURE_FOLDER_FOUND","Found default folder",{folder_id:c,name:i});else{let l=await d.createFolder(t,o);c=l.id,i=l.name,e.log("info","ENSURE_FOLDER_CREATED","Created default folder",{folder_id:c,name:i})}f(e.creds,e.config,e.profile,e.env,{folderId:c,folderName:i})}return{projectId:t,projectName:s??n,folderId:c,folderName:i??o}}function A(e,r,d){let n=e.loadProfileConfig(r,d)??{};return{projectId:n.project_id??null,folderId:n.folder_id??null}}function N(e,r){return e.projectId===null||e.folderId===null||r===null?"needs-picker":r.project==="ok"&&r.folder==="ok"?"ok":r.project==="error"&&r.folder==="error"?"ok-tms-degraded":"needs-picker"}var k=(e,r)=>`error: profile "${e}" (${r}) has no project/folder configured AND no TMS credentials were available to auto-configure one.
3
3
 
4
4
  discover IDs:
5
5
  kane-cli projects list --search "<keyword>" --limit 10
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as t}from"./chunk-PB3GADUD.js";async function l(e){let o=e.credentials.expires_at,i=e.thresholdSeconds??300;if(o-Date.now()/1e3>=i)return null;let r=e.creds.loadClient(e.profile,e.env);if(!r)return null;let n=await new t(e.env).refreshToken(e.credentials.refresh_token,r.client_id),s=Math.floor(Date.now()/1e3)+n.expires_in;return e.creds.saveCredentials(e.profile,e.env,{access_token:n.access_token,refresh_token:n.refresh_token,expires_at:s,scope:n.scope}),{accessToken:n.access_token,refreshToken:n.refresh_token,expiresAt:s,scope:n.scope}}export{l as a};
2
+ import{a as t}from"./chunk-FUNKVREV.js";async function l(e){let o=e.credentials.expires_at,i=e.thresholdSeconds??300;if(o-Date.now()/1e3>=i)return null;let r=e.creds.loadClient(e.profile,e.env);if(!r)return null;let n=await new t(e.env).refreshToken(e.credentials.refresh_token,r.client_id),s=Math.floor(Date.now()/1e3)+n.expires_in;return e.creds.saveCredentials(e.profile,e.env,{access_token:n.access_token,refresh_token:n.refresh_token,expires_at:s,scope:n.scope}),{accessToken:n.access_token,refreshToken:n.refresh_token,expiresAt:s,scope:n.scope}}export{l as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as v,b as A,d as G}from"./chunk-OS4VSIHT.js";import{b as x}from"./chunk-TRJUD3XJ.js";import{a as S}from"./chunk-JZ26R6UL.js";import{a as U,b as C}from"./chunk-UJZZDPDY.js";import{a as w}from"./chunk-JFAFKHDX.js";import{A as E,B as $}from"./chunk-TH47OOBV.js";import{d,e as m}from"./chunk-WXHQYYD5.js";var k=new Set([d.USECASE,d.SCENARIO,d.AC,d.TEST]);function b(e,t){return!e.superseded.has(t)&&e.trust.get(t)!=="archived"}function h(e,t,n){let s=e.edgesFrom(t).find(o=>o.type===n);return s?e.tipOf(s.dst):null}function O(e,t,n){if(n===d.USECASE)return t;if(n===d.SCENARIO)return h(e,t,m.BELONGS_TO);if(n===d.AC){let s=h(e,t,m.SCOPED_TO);return s?e.nodeLabel.get(s)===d.USECASE?s:h(e,s,m.BELONGS_TO):null}if(n===d.TEST){let s=h(e,t,m.AUTOMATES);return s?h(e,s,m.BELONGS_TO):null}return null}function L(e,t){let n=e.nameOf.get(t);if(n)return n;for(let[s,o]of e.names)if(e.tipOf(o)===t)return s;return t}function F(e,t){return{ucTip:t,display:L(e,t),seamRef:e.nameOf.get(t)??t}}function N(e,t){let n=e.resolve(t);if(!n)return{ok:!1,message:`unknown ref '${t}' \u2014 no test/scenario/ac/use-case by that id or cid`};let s=n.tip,o=e.nodeLabel.get(s);if(!o||!k.has(o))return{ok:!1,message:`'${t}' is a ${o??"missing node"} \u2014 evolve takes a test, scenario, acceptance criterion, or use-case`};let a=O(e,s,o);return!a||e.nodeLabel.get(a)!==d.USECASE?{ok:!1,message:`cannot resolve '${t}' to a parent use-case \u2014 its ${o} chain is broken`}:e.superseded.has(a)?{ok:!1,message:`use-case ${L(e,a)} was removed \u2014 nothing to evolve`}:{ok:!0,target:F(e,a)}}function Z(e,t){return D(e,t)}function D(e,t){let n=[];for(let{cid:o}of e.byLabel(d.SCENARIO)){if(!b(e,o)||!e.edgesFrom(o).some(r=>r.type===m.BELONGS_TO&&e.tipOf(r.dst)===t))continue;let a=e.edgesInto(o).filter(r=>r.type===m.AUTOMATES&&b(e,r.src));if(a.length===0)n.push({scenario:o,test:null});else for(let r of a)n.push({scenario:o,test:r.src})}let s=new Map;for(let{cid:o}of e.byLabel(d.AC)){if(!b(e,o)||O(e,o,d.AC)!==t)continue;let a=e.edgesInto(o).filter(r=>r.type===m.VERIFIES&&b(e,r.src)).map(r=>r.src).sort();s.set(o,a)}return{pairs:n,verifies:s}}function B(e,t){let n=r=>`${r.scenario}\0${r.test??""}`,s=new Set(e.pairs.map(n)),o=new Set(t.pairs.map(n)),a=[];for(let[r,i]of e.verifies){let u=t.verifies.get(r);u&&(i.length===u.length&&i.every((l,g)=>l===u[g])||a.push({ac:r,before:i,after:u}))}return{superseded:e.pairs.filter(r=>!o.has(n(r))),minted:t.pairs.filter(r=>!s.has(n(r))),retained:t.pairs.filter(r=>s.has(n(r))),moves:a}}function _(e,t,n,s,o){let a=i=>t.nameOf.get(i)??i,r=i=>` - ${a(i.scenario)} \xB7 ${i.test?a(i.test):"(no test)"}`;e.out(`evolved: use-case ${n} \u2014 design record ${s.before} \u2192 ${s.after}`),e.out(` superseded ${o.superseded.length} pair(s)`);for(let i of o.superseded)e.out(r(i));e.out(` minted ${o.minted.length} pair(s)`);for(let i of o.minted)e.out(r(i));e.out(` retained ${o.retained.length} pair(s)`);for(let i of o.retained)e.out(r(i));if(o.moves.length===0)e.out(" verifies none moved");else{e.out(" verifies moved:");for(let i of o.moves){let u=l=>l.length>0?l.map(a).join(" + "):"(none)";e.out(` - ${a(i.ac)}: ${u(i.before)} \u2192 ${u(i.after)}`)}}}async function R(e,t,n,s,o,a,r){let i=E(e),u=S(i,t.ucTip);if(!u)return a==="batch"?(s.out(`note: ${t.display} has no design output \u2014 nothing to evolve; run kane-cli design tests --use-case ${t.display} first`),{code:0,outcome:"no-design"}):(v(s,`nothing to evolve \u2014 run kane-cli design tests --use-case ${t.display} first (no design output)`),{code:2,outcome:"no-design"});let l=D(i,t.ucTip),g=[`evolve ${t.display}`,` re-designs use-case ${t.display}`,` affects ${l.pairs.length} pair(s)`,...n.because?[` because ${n.because}`]:[]];if(n.yes)for(let y of g)s.out(y);else{for(let I of g)s.out(I);if(!await s.confirm(`proceed with the re-design of ${t.display}?`))return s.out(a==="batch"?`skipped ${t.display}`:"declined \u2014 nothing evolved"),{code:0,outcome:"declined"}}let p=x(e,i,t.ucTip,n.because),c=await U(r,{verb:"evolve",subject:t.display},()=>o(t.seamRef,{yes:!!n.yes,...n.mode?{mode:n.mode}:{},...n.because?{because:n.because}:{},...p!==void 0?{changeDelta:p.change_delta,priorDesign:p.prior_design}:{}}),y=>({ok:y===0,exitCode:y}));if(c===3)return s.out(`design session for ${t.display} paused \u2014 resume with \`kane-cli design tests --resume\`, then re-run evolve for the diff`),{code:c,outcome:"paused"};if(c!==0)return v(s,`design run for ${t.display} ended with exit code ${c} \u2014 no diff to report`),{code:c,outcome:"failed"};let f=E(e),T=f.tipOf(t.ucTip),P=S(f,T)?.seq;return _(s,f,t.display,{before:u.seq,after:P??"?"},B(l,D(f,T))),{code:0,outcome:"evolved"}}function j(e){let t=new Map,n=0;for(let{cid:o,state:a}of e.staleList()){if(a==="superseded")continue;let r=e.nodeLabel.get(o);if(!r||!k.has(r)||!b(e,o)||!$(e,o))continue;let i=O(e,o,r);!i||e.nodeLabel.get(i)!==d.USECASE||e.superseded.has(i)||(n++,t.has(i)||t.set(i,F(e,i)))}return{targets:[...t.values()].sort((o,a)=>o.display<a.display?-1:o.display>a.display?1:0),staleCount:n}}function M(e,t){for(let{cid:n,state:s}of e.staleList()){if(s==="superseded")continue;let o=e.nodeLabel.get(n);if(!(!o||!k.has(o)||!b(e,n))&&$(e,n)&&O(e,n,o)===t)return!0}return!1}async function q(e,t,n,s={},o=process.cwd()){if(e&&t.fromStale)return v(n,"pass a <ref> OR --from-stale, not both"),2;if(!e&&!t.fromStale)return v(n,"evolve needs a <ref> or --from-stale"),2;let a=A(o,n);if(!a)return 2;let r=s.runDesignForUc??Y,i=s.onChild??(n.isTTY?V(n):void 0);n.out(`evolving ${e??"stale use-cases"}: reading the graph\u2026`);let u=E(a),l,g=null;if(e){let c=N(u,e);if(!c.ok)return v(n,c.message),2;if(!t.because&&S(u,c.target.ucTip)&&!M(u,c.target.ucTip))return v(n,`nothing changed underneath ${e} \u2014 its sources and requirements are current; use --because "<reason>" to re-design anyway`),2;l=[c.target]}else{let{targets:c,staleCount:f}=j(u);if(c.length===0)return n.out("nothing stale \u2014 nothing to evolve"),0;g=`from-stale: ${f} stale node(s) \u2192 ${c.length} use-case(s)`,l=c}if(!t.yes&&!n.isTTY)return v(n,"evolve needs a TTY \u2014 the blast-radius confirm is the point; headless evolution rides `kane-cli maintain reconcile`"),2;if(g&&n.out(g),e){let c=await R(a,l[0],t,n,r,"single",i);return c.outcome==="evolved"&&t.because&&w(a,{ts:new Date().toISOString(),command:"evolve",id:e,verdict:"gap-resolved-evolve",polarity:"preference",by:{kind:"human",id:process.env.USER??"operator"},target:e,reason:t.because}),c.code}let p=0;for(let c of l){let{code:f}=await R(a,c,t,n,r,"batch",i);f!==0&&p===0&&(p=f)}return p}function V(e){let t="",n="evolve";return s=>{s.kind==="start"?(t=s.subject,n=s.verb,e.out(`\u25CF ${C(s.verb).ing} ${s.subject}`)):s.kind==="end"&&e.out(s.ok?`\u25CF ${C(n).ed} ${t} \u2014 ${s.durS}s`:`\u25CF ${n} failed \u2014 ${s.exitCode!=null?`exited ${s.exitCode}`:"error"}${s.fixCmd?` \xB7 ${s.fixCmd}`:""}`)}}var Y=async(e,t)=>{let{designTestsCommand:n}=await import("./bind-2N4Q6YKH.js"),s=()=>n({useCase:e,force:!0,...t.mode?{mode:t.mode}:t.yes?{mode:"override"}:{},...t.because?{because:t.because}:{},...t.changeDelta!==void 0?{changeDelta:t.changeDelta}:{},...t.priorDesign!==void 0?{priorDesign:t.priorDesign}:{}});if(t.mode!=="agent")return s();let o=process.stdout.write;process.stdout.write=((...a)=>!0);try{return await s()}finally{process.stdout.write=o}};async function ee(e,t){return q(e,t,G(),{})}export{N as a,Z as b,R as c,j as d,q as e,Y as f,ee as g};
2
+ import{a as v,b as A,d as G}from"./chunk-OS4VSIHT.js";import{b as x}from"./chunk-TRJUD3XJ.js";import{a as S}from"./chunk-JZ26R6UL.js";import{a as U,b as C}from"./chunk-UJZZDPDY.js";import{a as w}from"./chunk-JFAFKHDX.js";import{A as E,B as $}from"./chunk-TH47OOBV.js";import{d,e as m}from"./chunk-WXHQYYD5.js";var k=new Set([d.USECASE,d.SCENARIO,d.AC,d.TEST]);function b(e,t){return!e.superseded.has(t)&&e.trust.get(t)!=="archived"}function h(e,t,n){let s=e.edgesFrom(t).find(o=>o.type===n);return s?e.tipOf(s.dst):null}function O(e,t,n){if(n===d.USECASE)return t;if(n===d.SCENARIO)return h(e,t,m.BELONGS_TO);if(n===d.AC){let s=h(e,t,m.SCOPED_TO);return s?e.nodeLabel.get(s)===d.USECASE?s:h(e,s,m.BELONGS_TO):null}if(n===d.TEST){let s=h(e,t,m.AUTOMATES);return s?h(e,s,m.BELONGS_TO):null}return null}function L(e,t){let n=e.nameOf.get(t);if(n)return n;for(let[s,o]of e.names)if(e.tipOf(o)===t)return s;return t}function F(e,t){return{ucTip:t,display:L(e,t),seamRef:e.nameOf.get(t)??t}}function N(e,t){let n=e.resolve(t);if(!n)return{ok:!1,message:`unknown ref '${t}' \u2014 no test/scenario/ac/use-case by that id or cid`};let s=n.tip,o=e.nodeLabel.get(s);if(!o||!k.has(o))return{ok:!1,message:`'${t}' is a ${o??"missing node"} \u2014 evolve takes a test, scenario, acceptance criterion, or use-case`};let a=O(e,s,o);return!a||e.nodeLabel.get(a)!==d.USECASE?{ok:!1,message:`cannot resolve '${t}' to a parent use-case \u2014 its ${o} chain is broken`}:e.superseded.has(a)?{ok:!1,message:`use-case ${L(e,a)} was removed \u2014 nothing to evolve`}:{ok:!0,target:F(e,a)}}function Z(e,t){return D(e,t)}function D(e,t){let n=[];for(let{cid:o}of e.byLabel(d.SCENARIO)){if(!b(e,o)||!e.edgesFrom(o).some(r=>r.type===m.BELONGS_TO&&e.tipOf(r.dst)===t))continue;let a=e.edgesInto(o).filter(r=>r.type===m.AUTOMATES&&b(e,r.src));if(a.length===0)n.push({scenario:o,test:null});else for(let r of a)n.push({scenario:o,test:r.src})}let s=new Map;for(let{cid:o}of e.byLabel(d.AC)){if(!b(e,o)||O(e,o,d.AC)!==t)continue;let a=e.edgesInto(o).filter(r=>r.type===m.VERIFIES&&b(e,r.src)).map(r=>r.src).sort();s.set(o,a)}return{pairs:n,verifies:s}}function B(e,t){let n=r=>`${r.scenario}\0${r.test??""}`,s=new Set(e.pairs.map(n)),o=new Set(t.pairs.map(n)),a=[];for(let[r,i]of e.verifies){let u=t.verifies.get(r);u&&(i.length===u.length&&i.every((l,g)=>l===u[g])||a.push({ac:r,before:i,after:u}))}return{superseded:e.pairs.filter(r=>!o.has(n(r))),minted:t.pairs.filter(r=>!s.has(n(r))),retained:t.pairs.filter(r=>s.has(n(r))),moves:a}}function _(e,t,n,s,o){let a=i=>t.nameOf.get(i)??i,r=i=>` - ${a(i.scenario)} \xB7 ${i.test?a(i.test):"(no test)"}`;e.out(`evolved: use-case ${n} \u2014 design record ${s.before} \u2192 ${s.after}`),e.out(` superseded ${o.superseded.length} pair(s)`);for(let i of o.superseded)e.out(r(i));e.out(` minted ${o.minted.length} pair(s)`);for(let i of o.minted)e.out(r(i));e.out(` retained ${o.retained.length} pair(s)`);for(let i of o.retained)e.out(r(i));if(o.moves.length===0)e.out(" verifies none moved");else{e.out(" verifies moved:");for(let i of o.moves){let u=l=>l.length>0?l.map(a).join(" + "):"(none)";e.out(` - ${a(i.ac)}: ${u(i.before)} \u2192 ${u(i.after)}`)}}}async function R(e,t,n,s,o,a,r){let i=E(e),u=S(i,t.ucTip);if(!u)return a==="batch"?(s.out(`note: ${t.display} has no design output \u2014 nothing to evolve; run kane-cli design tests --use-case ${t.display} first`),{code:0,outcome:"no-design"}):(v(s,`nothing to evolve \u2014 run kane-cli design tests --use-case ${t.display} first (no design output)`),{code:2,outcome:"no-design"});let l=D(i,t.ucTip),g=[`evolve ${t.display}`,` re-designs use-case ${t.display}`,` affects ${l.pairs.length} pair(s)`,...n.because?[` because ${n.because}`]:[]];if(n.yes)for(let y of g)s.out(y);else{for(let I of g)s.out(I);if(!await s.confirm(`proceed with the re-design of ${t.display}?`))return s.out(a==="batch"?`skipped ${t.display}`:"declined \u2014 nothing evolved"),{code:0,outcome:"declined"}}let p=x(e,i,t.ucTip,n.because),c=await U(r,{verb:"evolve",subject:t.display},()=>o(t.seamRef,{yes:!!n.yes,...n.mode?{mode:n.mode}:{},...n.because?{because:n.because}:{},...p!==void 0?{changeDelta:p.change_delta,priorDesign:p.prior_design}:{}}),y=>({ok:y===0,exitCode:y}));if(c===3)return s.out(`design session for ${t.display} paused \u2014 resume with \`kane-cli design tests --resume\`, then re-run evolve for the diff`),{code:c,outcome:"paused"};if(c!==0)return v(s,`design run for ${t.display} ended with exit code ${c} \u2014 no diff to report`),{code:c,outcome:"failed"};let f=E(e),T=f.tipOf(t.ucTip),P=S(f,T)?.seq;return _(s,f,t.display,{before:u.seq,after:P??"?"},B(l,D(f,T))),{code:0,outcome:"evolved"}}function j(e){let t=new Map,n=0;for(let{cid:o,state:a}of e.staleList()){if(a==="superseded")continue;let r=e.nodeLabel.get(o);if(!r||!k.has(r)||!b(e,o)||!$(e,o))continue;let i=O(e,o,r);!i||e.nodeLabel.get(i)!==d.USECASE||e.superseded.has(i)||(n++,t.has(i)||t.set(i,F(e,i)))}return{targets:[...t.values()].sort((o,a)=>o.display<a.display?-1:o.display>a.display?1:0),staleCount:n}}function M(e,t){for(let{cid:n,state:s}of e.staleList()){if(s==="superseded")continue;let o=e.nodeLabel.get(n);if(!(!o||!k.has(o)||!b(e,n))&&$(e,n)&&O(e,n,o)===t)return!0}return!1}async function q(e,t,n,s={},o=process.cwd()){if(e&&t.fromStale)return v(n,"pass a <ref> OR --from-stale, not both"),2;if(!e&&!t.fromStale)return v(n,"evolve needs a <ref> or --from-stale"),2;let a=A(o,n);if(!a)return 2;let r=s.runDesignForUc??Y,i=s.onChild??(n.isTTY?V(n):void 0);n.out(`evolving ${e??"stale use-cases"}: reading the graph\u2026`);let u=E(a),l,g=null;if(e){let c=N(u,e);if(!c.ok)return v(n,c.message),2;if(!t.because&&S(u,c.target.ucTip)&&!M(u,c.target.ucTip))return v(n,`nothing changed underneath ${e} \u2014 its sources and requirements are current; use --because "<reason>" to re-design anyway`),2;l=[c.target]}else{let{targets:c,staleCount:f}=j(u);if(c.length===0)return n.out("nothing stale \u2014 nothing to evolve"),0;g=`from-stale: ${f} stale node(s) \u2192 ${c.length} use-case(s)`,l=c}if(!t.yes&&!n.isTTY)return v(n,"evolve needs a TTY \u2014 the blast-radius confirm is the point; headless evolution rides `kane-cli maintain reconcile`"),2;if(g&&n.out(g),e){let c=await R(a,l[0],t,n,r,"single",i);return c.outcome==="evolved"&&t.because&&w(a,{ts:new Date().toISOString(),command:"evolve",id:e,verdict:"gap-resolved-evolve",polarity:"preference",by:{kind:"human",id:process.env.USER??"operator"},target:e,reason:t.because}),c.code}let p=0;for(let c of l){let{code:f}=await R(a,c,t,n,r,"batch",i);f!==0&&p===0&&(p=f)}return p}function V(e){let t="",n="evolve";return s=>{s.kind==="start"?(t=s.subject,n=s.verb,e.out(`\u25CF ${C(s.verb).ing} ${s.subject}`)):s.kind==="end"&&e.out(s.ok?`\u25CF ${C(n).ed} ${t} \u2014 ${s.durS}s`:`\u25CF ${n} failed \u2014 ${s.exitCode!=null?`exited ${s.exitCode}`:"error"}${s.fixCmd?` \xB7 ${s.fixCmd}`:""}`)}}var Y=async(e,t)=>{let{designTestsCommand:n}=await import("./bind-SJ6DOVQ4.js"),s=()=>n({useCase:e,force:!0,...t.mode?{mode:t.mode}:t.yes?{mode:"override"}:{},...t.because?{because:t.because}:{},...t.changeDelta!==void 0?{changeDelta:t.changeDelta}:{},...t.priorDesign!==void 0?{priorDesign:t.priorDesign}:{}});if(t.mode!=="agent")return s();let o=process.stdout.write;process.stdout.write=((...a)=>!0);try{return await s()}finally{process.stdout.write=o}};async function ee(e,t){return q(e,t,G(),{})}export{N as a,Z as b,R as c,j as d,q as e,Y as f,ee as g};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as m}from"./chunk-VZ7KXRXB.js";import{a as _}from"./chunk-TDPWFYTJ.js";import{b as h}from"./chunk-CCUGKBIH.js";import{randomUUID as F}from"crypto";import{mkdirSync as A,writeFileSync as v,appendFileSync as O,existsSync as b}from"fs";import{join as u}from"path";import{writeFileSync as x,mkdirSync as I,existsSync as j}from"fs";import{join as p,relative as L}from"path";function f(n){let t=Object.keys(n.frontmatter).length>0?m(n.frontmatter).trimEnd():"",s=["---"];return t&&s.push(t),s.push("---",""),s.push(`# ${n.heading}`,""),n.steps.forEach((i,r)=>{s.push(`## Step ${r+1}`,i,"")}),s.join(`
2
+ import{c as m}from"./chunk-VZ7KXRXB.js";import{a as _}from"./chunk-TDPWFYTJ.js";import{b as h}from"./chunk-OFW3ZVTP.js";import{randomUUID as F}from"crypto";import{mkdirSync as A,writeFileSync as v,appendFileSync as O,existsSync as b}from"fs";import{join as u}from"path";import{writeFileSync as x,mkdirSync as I,existsSync as j}from"fs";import{join as p,relative as L}from"path";function f(n){let t=Object.keys(n.frontmatter).length>0?m(n.frontmatter).trimEnd():"",s=["---"];return t&&s.push(t),s.push("---",""),s.push(`# ${n.heading}`,""),n.steps.forEach((i,r)=>{s.push(`## Step ${r+1}`,i,"")}),s.join(`
3
3
  `)}function T(n,e){let t={},s={},i=e;for(let[r,l]of Object.entries(n)){if(r.startsWith("global.")||r.startsWith("secrets.user.")||r.startsWith("environment.")){let o=r.startsWith("secrets.user.");t[r]={value:l.value,secret:o,syntax:`{{${r}}}`,type:o?"secret":r.startsWith("environment.")?"environment":"global"},s[r]=r;continue}if(l.secret){let o=`secrets.user.${r}`;t[o]={value:l.value,secret:!0,syntax:`{{secrets.user.${r}}}`,type:"secret"},s[r]=o,i=i.replaceAll(`{{${r}}}`,`{{secrets.user.${r}}}`)}else{let o=`global.${r}`;t[o]={value:l.value,secret:!1,syntax:`{{global.${r}}}`,type:"global"},s[r]=o,i=i.replaceAll(`{{${r}}}`,`{{global.${r}}}`)}}return{variables:t,objective:i,keyMap:s}}var w=/\{\{\s*(?:global|secrets\.user|environment)\.([^{}]+?)\s*\}\}/g;function c(n){return typeof n!="string"||!n.includes("{{")?n:n.replace(w,"{{$1}}")}function d(n){if(typeof n=="string")return c(n);if(Array.isArray(n))return n.map(e=>d(e));if(n&&typeof n=="object"){let e={};for(let[t,s]of Object.entries(n))e[t]=d(s);return e}return n}var N=new Set(["username","access_key","oauth","profile","project_id","folder_id"]),$=new Set(["model","env"]),g=class{constructor(e){this.opts=e}objectives=[];flushed=!1;lastWrittenPath=null;lastCollisionSuffixed=!1;appendObjective(e){this.objectives.push(e)}flush(){if(this.flushed||(this.flushed=!0,this.objectives.length===0))return;let e=this.opts.getName();if(!e)return;let t=p(this.opts.cwd,".testmuai","tests");try{I(t,{recursive:!0})}catch(a){process.stderr.write(`
4
4
  \u26A0 Failed to create ${L(this.opts.cwd,t)}/
5
5
  ${a.message}
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{x as n}from"./chunk-CCUGKBIH.js";import{a as s}from"./chunk-HCBYKLMW.js";import{a,b as i}from"./chunk-C44QQJR4.js";import{e as r}from"./chunk-UR6MHSHU.js";var o=r(s(),1);function g({bindings:c,suppressEscBack:p=!1,escBackLabel:m="back to chat"}){let e=c.map(t=>`${t.keys} ${t.label}`);return p||e.push(`esc \xB7 ${m}`),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(i,{color:n.dim,children:e.join(" \xB7 ")})})}export{g as a};
2
+ import{x as n}from"./chunk-OFW3ZVTP.js";import{a as s}from"./chunk-HCBYKLMW.js";import{a,b as i}from"./chunk-C44QQJR4.js";import{e as r}from"./chunk-UR6MHSHU.js";var o=r(s(),1);function g({bindings:c,suppressEscBack:p=!1,escBackLabel:m="back to chat"}){let e=c.map(t=>`${t.keys} ${t.label}`);return p||e.push(`esc \xB7 ${m}`),(0,o.jsx)(a,{marginTop:1,children:(0,o.jsx)(i,{color:n.dim,children:e.join(" \xB7 ")})})}export{g as a};