@testmuai/kane-cli 0.6.6 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/dist/{ChatSurface-LV3KW6WN.js → ChatSurface-Y2M6HB2R.js} +1 -1
  2. package/dist/{ChromeProfilePicker-6PLUQ5TW.js → ChromeProfilePicker-IW3K43VC.js} +1 -1
  3. package/dist/{CliFeedbackPrompt-I4F56IVK.js → CliFeedbackPrompt-ZJ4LZGPK.js} +1 -1
  4. package/dist/{CliUploadProgress-ULRSPKY3.js → CliUploadProgress-SMPVN7Q6.js} +1 -1
  5. package/dist/{ConfigView-7NMYALEA.js → ConfigView-RTAGKZH4.js} +1 -1
  6. package/dist/EvidenceViewOffer-LHPIZUGQ.js +2 -0
  7. package/dist/{FolderPicker-4IOVDO2P.js → FolderPicker-QUY7LNVZ.js} +1 -1
  8. package/dist/{HelpView-SHMVMHNU.js → HelpView-47J2NZWJ.js} +1 -1
  9. package/dist/{InfoBox-W2LZVGQS.js → InfoBox-G63WZAMH.js} +1 -1
  10. package/dist/{LinksBox-ZS25VTBY.js → LinksBox-2HIHDT5K.js} +1 -1
  11. package/dist/{ProfilesView-XBBRIQ3U.js → ProfilesView-TUXQXPXJ.js} +1 -1
  12. package/dist/{ProjectPicker-AUN47FXS.js → ProjectPicker-VUABWG2P.js} +1 -1
  13. package/dist/{SaveSessionPrompt-Z2K225VN.js → SaveSessionPrompt-PNVGNLGO.js} +1 -1
  14. package/dist/SingleShotApp-BZV5CULT.js +2 -0
  15. package/dist/{SummaryBox-4T545XRB.js → SummaryBox-36MDDDYQ.js} +1 -1
  16. package/dist/TestMdRunView-A655PMEY.js +2 -0
  17. package/dist/{WhoamiView-GCVD35EX.js → WhoamiView-LHU6RGIY.js} +1 -1
  18. package/dist/{bind-JLMT57Q3.js → bind-E67W2DXG.js} +2 -2
  19. package/dist/{bridge-PDJEOSAJ.js → bridge-WVFTWHKP.js} +1 -1
  20. package/dist/{changelog-D65HWZDM.js → changelog-D4Y5QJIZ.js} +1 -1
  21. package/dist/chat-committer-WOTCC7L3.js +2 -0
  22. package/dist/chat-controller-MONWZKS7.js +4 -0
  23. package/dist/{chunk-HA5GE57Z.js → chunk-3CY3DZDH.js} +2 -2
  24. package/dist/{chunk-BLSZ4H5W.js → chunk-3GOZ7R4G.js} +3 -3
  25. package/dist/{chunk-AKHUNBQS.js → chunk-3NR6OTHL.js} +1 -1
  26. package/dist/{chunk-KI2DVQSA.js → chunk-5J3HQZNU.js} +1 -1
  27. package/dist/{chunk-5JJ245FW.js → chunk-6EC54ZHT.js} +1 -1
  28. package/dist/{chunk-WJGBXJT4.js → chunk-77PBBYRZ.js} +2 -2
  29. package/dist/{chunk-GYW7LVVL.js → chunk-7Z64BL5D.js} +1 -1
  30. package/dist/{chunk-MSPZOEFB.js → chunk-7ZMYAXES.js} +1 -1
  31. package/dist/{chunk-XQL53VB7.js → chunk-A2AZQ4PQ.js} +1 -1
  32. package/dist/{chunk-JU5KRCKD.js → chunk-AASBJJCU.js} +1 -1
  33. package/dist/{chunk-BV5QKFMJ.js → chunk-BBZBXSTP.js} +1 -1
  34. package/dist/chunk-CIFVUX3B.js +4 -0
  35. package/dist/chunk-CVOGP253.js +2 -0
  36. package/dist/{chunk-OFEOWKM3.js → chunk-DCWCANNS.js} +1 -1
  37. package/dist/{chunk-C42WWO7Y.js → chunk-DL5CXC64.js} +1 -1
  38. package/dist/chunk-DNNZ353O.js +4 -0
  39. package/dist/chunk-E4EHWO3J.js +4 -0
  40. package/dist/{chunk-24OFJ7SE.js → chunk-EDM6YACR.js} +1 -1
  41. package/dist/{chunk-HWA7WD44.js → chunk-FYSWQ4K7.js} +1 -1
  42. package/dist/{chunk-JTEY32TL.js → chunk-G5CYSC23.js} +1 -1
  43. package/dist/chunk-GAD6IBZ6.js +12 -0
  44. package/dist/chunk-GLVDOR5G.js +2 -0
  45. package/dist/chunk-I37UOX73.js +14 -0
  46. package/dist/chunk-IAHKTEET.js +2 -0
  47. package/dist/{chunk-LEQ2B3PR.js → chunk-IX34JIXK.js} +1 -1
  48. package/dist/{chunk-WWH7CW5R.js → chunk-IYTHPCQ2.js} +1 -1
  49. package/dist/chunk-JR37W7IJ.js +6 -0
  50. package/dist/{chunk-3Z3UIW5H.js → chunk-KVAALPTA.js} +1 -1
  51. package/dist/{chunk-ZZLR3O5A.js → chunk-L4JIMNKW.js} +1 -1
  52. package/dist/{chunk-S2C62SDY.js → chunk-LVWB6TB2.js} +1 -1
  53. package/dist/chunk-MBXWXBDM.js +4 -0
  54. package/dist/{chunk-24VYAMMK.js → chunk-MTG2LRGV.js} +1 -1
  55. package/dist/{chunk-D7L6UW5Z.js → chunk-NEHF4C6X.js} +1 -1
  56. package/dist/{chunk-6SGPN76K.js → chunk-NMKZHHB6.js} +1 -1
  57. package/dist/{chunk-KNCHEM6A.js → chunk-NMZATEKQ.js} +8 -8
  58. package/dist/{chunk-2PQXEEVY.js → chunk-NVGBE2DR.js} +1 -1
  59. package/dist/{chunk-JV356AYH.js → chunk-OPDJD7WS.js} +2 -2
  60. package/dist/{chunk-6GTOYTCQ.js → chunk-OSALXGD4.js} +1 -1
  61. package/dist/{chunk-RV2NXHIC.js → chunk-QG6LJCZG.js} +1 -1
  62. package/dist/{chunk-MCQXRJGH.js → chunk-QHFUDBQH.js} +1 -1
  63. package/dist/{chunk-EOLQUB4Q.js → chunk-QVJ7C4GW.js} +1 -1
  64. package/dist/{chunk-VBCE4U4B.js → chunk-QYTMD6NM.js} +1 -1
  65. package/dist/{chunk-6CZIEK6B.js → chunk-R7NNIQMH.js} +1 -1
  66. package/dist/{chunk-L26LU6TU.js → chunk-RBLZUDMZ.js} +2 -2
  67. package/dist/chunk-RGDQMKNJ.js +4 -0
  68. package/dist/{chunk-4SXD6XWV.js → chunk-RGQIBS32.js} +1 -1
  69. package/dist/{chunk-UZJ7MRBV.js → chunk-RWIHSR4H.js} +1 -1
  70. package/dist/{chunk-6XHAXAL2.js → chunk-SK2GVMTJ.js} +1 -1
  71. package/dist/{chunk-6NIV7AVZ.js → chunk-TADJIOHV.js} +1 -1
  72. package/dist/{chunk-EWTX7HSU.js → chunk-TSWGQKUK.js} +2 -2
  73. package/dist/{chunk-2BWRAY3Y.js → chunk-TTJ4XMWP.js} +1 -1
  74. package/dist/{chunk-LLS47HUA.js → chunk-UQVKNUYO.js} +1 -1
  75. package/dist/chunk-UZWOHCFX.js +4 -0
  76. package/dist/chunk-VLC24QVT.js +2 -0
  77. package/dist/{chunk-2WO7G2HO.js → chunk-WFQUDSKY.js} +1 -1
  78. package/dist/{chunk-LABIRPOT.js → chunk-WJG4ZPUH.js} +1 -1
  79. package/dist/{chunk-N6DO2LBH.js → chunk-X47VFBIV.js} +1 -1
  80. package/dist/{chunk-MY32TBBR.js → chunk-XUHVQ5VL.js} +1 -1
  81. package/dist/{chunk-JF7Q2I45.js → chunk-Y6HPW2OQ.js} +1 -1
  82. package/dist/{chunk-32GP7KTM.js → chunk-YB54MHKU.js} +1 -1
  83. package/dist/{chunk-RIMJDJWY.js → chunk-YTZUYCFZ.js} +1 -1
  84. package/dist/{chunk-4A6BLXQN.js → chunk-YZBLBPOE.js} +2 -2
  85. package/dist/{chunk-P4HW2NTZ.js → chunk-Z34XRBKQ.js} +1 -1
  86. package/dist/{chunk-FJTWJ243.js → chunk-ZPDM6FO7.js} +1 -1
  87. package/dist/{config-6PAZZ7CR.js → config-BZ7C5NU5.js} +1 -1
  88. package/dist/cover-cmd-DN5D6A3S.js +2 -0
  89. package/dist/{credentials-BJCIWQWA.js → credentials-BPJL6YIZ.js} +1 -1
  90. package/dist/{descriptor-EHK3DRCZ.js → descriptor-KXDJ4XYD.js} +1 -1
  91. package/dist/evidence-E5B24ZO6.js +2 -0
  92. package/dist/evolve-cmd-V7H4PLCX.js +2 -0
  93. package/dist/explain-VTRHEVUQ.js +2 -0
  94. package/dist/{explain-cmd-U367SD4N.js → explain-cmd-AG6ZDXV6.js} +1 -1
  95. package/dist/{explain-cmd-KV5YUXKB.js → explain-cmd-NZPC6537.js} +1 -1
  96. package/dist/{extract-bind-YS7C4KZ3.js → extract-bind-3QBBCWYE.js} +2 -2
  97. package/dist/{extract-cmd-Z4PMDIMZ.js → extract-cmd-4PGUDJMU.js} +1 -1
  98. package/dist/gaps-cmd-42LPHWFP.js +2 -0
  99. package/dist/{generate-headless-IWY32HC4.js → generate-headless-NZUDYIKJ.js} +2 -2
  100. package/dist/index.js +12 -12
  101. package/dist/ingest-GOKIMEP4.js +2 -0
  102. package/dist/ingest-cmd-BTYHVJ33.js +3 -0
  103. package/dist/{interactive-bind-ZIIJDRBU.js → interactive-bind-TKRWAPJU.js} +3 -3
  104. package/dist/lifecycle-cmd-E6AXODQD.js +2 -0
  105. package/dist/list-cmd-RJVLH2GR.js +3 -0
  106. package/dist/{list-commands-SSXJQGE7.js → list-commands-55RCFEOL.js} +1 -1
  107. package/dist/logical-ids-QZQRQ3TV.js +2 -0
  108. package/dist/login-flow-WNIHDQXF.js +2 -0
  109. package/dist/maintenance-cmd-UJG4LPWD.js +2 -0
  110. package/dist/pdf-convert-KYXI4FU4.js +2 -0
  111. package/dist/{persist-recorded-session-3AOYZJT2.js → persist-recorded-session-HK7JUONC.js} +1 -1
  112. package/dist/pipeline-FTLXJQRT.js +2 -0
  113. package/dist/readmodel-KTNI6QDC.js +2 -0
  114. package/dist/reconcile-cmd-5XC4AUSJ.js +2 -0
  115. package/dist/{recording-banner-KKEUWS3N.js → recording-banner-5IYX2KBV.js} +1 -1
  116. package/dist/{require-project-folder-NPTKR2AW.js → require-project-folder-J4Q4FRQ4.js} +1 -1
  117. package/dist/revert-FRXNIP5R.js +2 -0
  118. package/dist/review-cmd-XB2DCTMZ.js +4 -0
  119. package/dist/run-2RFR2ASQ.js +2 -0
  120. package/dist/run-3ZYJQBBC.js +2 -0
  121. package/dist/{run-test-md-QNC6KDMN.js → run-test-md-WN6BH3PC.js} +2 -2
  122. package/dist/{skill-installer-ULFNSE6X.js → skill-installer-4HYPUBNB.js} +1 -1
  123. package/dist/{spawner-DWONVIPI.js → spawner-VD6YFZ43.js} +1 -1
  124. package/dist/tcg-generate-77QKMB63.js +2 -0
  125. package/dist/{testmd-actions-S3ZNOZEK.js → testmd-actions-LT5FNIR6.js} +1 -1
  126. package/dist/token-refresh-PCOAZBKK.js +2 -0
  127. package/dist/{validate-basic-4OLDKIA2.js → validate-basic-XWGKC5VF.js} +1 -1
  128. package/dist/{version-check-UL4S6R4N.js → version-check-6FDTS6MK.js} +1 -1
  129. package/dist/{view-cmd-FRMQF76B.js → view-cmd-PCDG3FIC.js} +1 -1
  130. package/dist/walk-session-YS62CWX5.js +2 -0
  131. package/package.json +7 -6
  132. package/dist/EvidenceViewOffer-KQKPTMXA.js +0 -2
  133. package/dist/SingleShotApp-M7R5PW4X.js +0 -2
  134. package/dist/TestMdRunView-JXRXMACE.js +0 -2
  135. package/dist/chat-committer-ADJJTDUT.js +0 -2
  136. package/dist/chat-controller-VAC57IEV.js +0 -3
  137. package/dist/chunk-262ES67I.js +0 -14
  138. package/dist/chunk-4R2HOA7J.js +0 -14
  139. package/dist/chunk-6AYUSR7X.js +0 -2
  140. package/dist/chunk-74RUSHIB.js +0 -4
  141. package/dist/chunk-KYHXDJN4.js +0 -2
  142. package/dist/chunk-LURGFJEE.js +0 -6
  143. package/dist/chunk-QPZRHAYK.js +0 -4
  144. package/dist/chunk-SJ2KQKOV.js +0 -3
  145. package/dist/chunk-WIA7TPK3.js +0 -2
  146. package/dist/chunk-ZG2V2ODK.js +0 -4
  147. package/dist/cover-cmd-K3LCXHAQ.js +0 -2
  148. package/dist/evidence-7VE5EGEF.js +0 -2
  149. package/dist/evolve-cmd-RUGUWKAG.js +0 -2
  150. package/dist/explain-VFIZTHFN.js +0 -2
  151. package/dist/gaps-cmd-DTVDIOED.js +0 -2
  152. package/dist/ingest-C5ANIN7S.js +0 -2
  153. package/dist/ingest-cmd-LLC5CDQ5.js +0 -3
  154. package/dist/lifecycle-cmd-BXE5IMFN.js +0 -2
  155. package/dist/list-cmd-KBWPYJMV.js +0 -3
  156. package/dist/logical-ids-3Y6RX5C2.js +0 -2
  157. package/dist/login-flow-HRS6YACY.js +0 -2
  158. package/dist/maintenance-cmd-VS3APIUN.js +0 -2
  159. package/dist/pipeline-IZSODNCC.js +0 -2
  160. package/dist/readmodel-XOGOELUP.js +0 -2
  161. package/dist/reconcile-cmd-6HVZJFG3.js +0 -2
  162. package/dist/revert-AQQ2VHRM.js +0 -2
  163. package/dist/review-cmd-4WZUUOE4.js +0 -4
  164. package/dist/run-2A7M7EJK.js +0 -2
  165. package/dist/run-6AFY35QW.js +0 -2
  166. package/dist/tcg-generate-IHHPRVNG.js +0 -2
  167. package/dist/token-refresh-CFVOA62N.js +0 -2
  168. package/dist/walk-session-N3BP57HK.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as ee}from"./chunk-64LC36AF.js";import{a as Re,b as Ie}from"./chunk-6PS65QFF.js";import{a as ve,b as ke}from"./chunk-OFEOWKM3.js";import{b as Te,d as Ce}from"./chunk-6CZIEK6B.js";import{a as be}from"./chunk-5Y2G4NC7.js";import{a as Se}from"./chunk-YCCUBQY4.js";import{a as $e}from"./chunk-3Z3UIW5H.js";import{b as we}from"./chunk-DFS4RMVP.js";import"./chunk-4SXD6XWV.js";import{y as s}from"./chunk-6SGPN76K.js";import{a as B}from"./chunk-HCBYKLMW.js";import{a as b,b as n,k as W}from"./chunk-C44QQJR4.js";import{a as yt}from"./chunk-6YGTRKDT.js";import{e as R}from"./chunk-UR6MHSHU.js";var v=R(yt(),1);var $=R(B(),1),Be=3,Tt=60;function X(e){return e.options.length}var bt={high:{text:"\u203C high",color:s.red},med:{text:"med",color:"yellow"},low:{text:"low",color:s.dim}};function $t({batch:e,i:t}){let r=e.resolution[t],i=r.form==="deferred"?"\u2013 deferred (the agent keeps it)":`\u2713 ${r.form}: ${r.choice}${r.form==="assumed"?" (flagged)":" (you)"}`;return(0,$.jsx)(n,{color:s.dim,children:` ${i}`})}function wt({batch:e,i:t,sel:r,focused:i,freeText:m}){let u=e.questions[t],l=e.cursor===t,o=e.resolution[t],a=l?"\u203A":" ",f=bt[u.risk],h=y=>l&&i&&r===y?(0,$.jsx)(n,{color:s.generateAccent,children:"\u25B8"}):" ";return(0,$.jsxs)(b,{flexDirection:"column",children:[(0,$.jsxs)(n,{bold:l,children:[` ${t+1} ${a} ${u.text}`,f?(0,$.jsx)(n,{color:f.color,bold:!1,children:` ${f.text}`}):null]}),(0,$.jsx)(n,{color:s.muted,children:` ${u.rationale}`}),o&&!l?(0,$.jsx)($t,{batch:e,i:t}):(0,$.jsxs)(b,{flexDirection:"column",children:[u.multi_select?(0,$.jsx)(n,{color:s.dim,children:" note: multi-select not yet supported \u2014 pick the best single option"}):null,u.options.map((y,x)=>(0,$.jsxs)(n,{children:[" ",h(x),` ${x+1} ${y.label}`,x===u.recommended_index?(0,$.jsx)(n,{color:s.dim,children:" (recommended)"}):null,o?.selected_index===x?(0,$.jsx)(n,{color:s.dim,children:" (current)"}):null]},`o-${x}`)),u.allow_free_text&&l?m?(0,$.jsxs)(b,{children:[(0,$.jsxs)(n,{children:[" ",(0,$.jsx)(n,{color:s.generateAccent,children:"\u25B8"})," ",(0,$.jsx)(n,{color:s.dim,children:"\u270E "})]}),(0,$.jsx)(Se,{value:m.value,onChange:m.onChange,onSubmit:m.onSubmit,onCancel:m.onCancel,placeholder:"tell me what to do"})]}):(0,$.jsxs)(n,{children:[" ",h(u.options.length)," ",(0,$.jsx)(n,{color:s.dim,children:"\u270E tell me what to do"})]}):null]})]})}function De({batch:e,sel:t=0,focused:r=!1,freeText:i=null}){let{stdout:m}=W(),l=(m?.columns??80)<Tt,o=e.resolution.filter(I=>!I).length,a=Math.max(0,Math.min(e.cursor<0?0:e.cursor,e.questions.length-Be)),f=e.questions.slice(a,a+Be),h=a,y=e.questions.length-a-f.length,x=(0,$.jsxs)(b,{flexDirection:"column",children:[(0,$.jsx)(n,{bold:!0,color:s.generateAccent,children:`? the agent needs ${o===1?"one answer":`${o} answers`} before it can continue`}),h>0?(0,$.jsx)(n,{color:s.muted,children:` \u22EE ${h} above`}):null,f.map((I,d)=>(0,$.jsx)(wt,{batch:e,i:a+d,sel:t,focused:r,freeText:i},I.id)),y>0?(0,$.jsx)(n,{color:s.muted,children:` \u22EE ${y} more`}):null]});return l?x:(0,$.jsx)(b,{flexDirection:"column",borderStyle:"round",borderColor:s.generateAccent,paddingX:1,children:x})}var D=R(B(),1),Ee=60,Ct=e=>e.length<=Ee?e:`${e.slice(0,Ee-1)}\u2026`,St={high:s.red,med:"yellow"};function te({item:e}){return(0,D.jsxs)(b,{flexDirection:"column",marginLeft:2,children:[(e.cite??[]).map((t,r)=>(0,D.jsx)(n,{dimColor:!0,children:`cite ${t.anchor??"conv"} \u2014 "${t.quote??""}"`},`cite-${r}`)),(e.depends_on_hint??[]).length>0&&(0,D.jsx)(n,{dimColor:!0,children:`depends on: ${(e.depends_on_hint??[]).join(", ")}`}),Object.entries(e.extra??{}).map(([t,r])=>(0,D.jsx)(n,{dimColor:!0,children:`${t}: ${r}`},`extra-${t}`))]})}function G({heading:e,turn:t,items:r,expandedRef:i,total:m,compact:u,numbers:l,marks:o}){return(0,D.jsxs)(b,{flexDirection:"column",children:[(0,D.jsx)(n,{bold:!0,children:`${e} \xB7 turn ${t} \xB7 ${m??r.length} proposed`}),r.map((a,f)=>{let h=a.matches_existing,y=h?h.cid?h.archived?` \u2248 matches archived \u2014 previously rejected${h.reason?`: "${h.reason}"`:""}`:" \u2248 matches existing":" \u2248overlap":"",x=o?.[f]?" \xB7 updated":"",I=u?` ${l?.[f]??f+1} \xB7 ${a.title}`:` ${a.title}`,d=a.why?` \u2014 ${u?Ct(a.why):a.why}`:"";return(0,D.jsxs)(b,{flexDirection:"column",children:[(0,D.jsxs)(n,{children:[I,a.badge!==void 0?(0,D.jsx)(n,{color:St[a.badge]??s.dim,children:` ${a.badge}`}):null,d?(0,D.jsx)(n,{color:s.dim,children:d}):null,y?(0,D.jsx)(n,{color:h?.archived?"yellow":"magenta",children:y}):null,x?(0,D.jsx)(n,{color:s.dim,children:x}):null]}),i===a.temp_ref&&(0,D.jsx)(te,{item:a})]},a.temp_ref)})]})}var Le=R(B(),1),vt=e=>e.summary??e.description??"";function kt(e){return{temp_ref:e.temp_ref,title:e.title,badge:e.risk,why:vt(e),matches_existing:e.matches_existing?e.matches_existing:null,cite:e.cite??[],depends_on_hint:e.depends_on_hint??[]}}function _e({turn:e,items:t,expandedRef:r,total:i,compact:m,numbers:u,marks:l}){return(0,Le.jsx)(G,{heading:"use-cases",turn:e,items:t.map(kt),expandedRef:r,total:i,compact:m,numbers:u,marks:l})}var Rt={"use-case":"use-cases",ac:"ACs",scenario:"scenarios",test:"tests",gap:"gaps"},P=e=>Rt[e]??`${e}s`,Ae=e=>e==="ac"?"AC":e==="use-case"?"use-case":e,ne=e=>e.kind??"use-case",Oe=e=>`${ne(e)}:${e.temp_ref}`;function Pe(e){let t=e,r=t.badge??e.risk??null,i=t.why??e.summary??e.description??null;return JSON.stringify([e.title,r,i,t.extra??null,e.depends_on_hint??null])}function Me(e){return e.filter(t=>t.role==="agent"&&typeof t.turnIndex=="number"&&Array.isArray(t.items)&&t.items.length>0)}function V(e){let t=new Map,r=1;for(let u of Me(e)){let l=new Set;for(let o of u.items){let a=Oe(o);if(l.has(a))continue;l.add(a);let f=t.get(a);t.set(a,{num:f?.num??r++,ref:o.temp_ref,kind:ne(o),item:o,turnIndex:u.turnIndex,fingerprint:Pe(o)})}}let i=[...t.values()].sort((u,l)=>u.num-l.num),m=[];for(let u of i){let l=m.find(o=>o.kind===u.kind);l?l.count++:m.push({kind:u.kind,label:P(u.kind),count:1})}return{entries:i,byRef:t,counts:m}}function qe(e,t){let i=Me(e).find(d=>d.turnIndex===t);if(!i)return null;let m=e.filter(d=>d.role!=="agent"||typeof d.turnIndex!="number"||d.turnIndex<=t),u=V(m),l=V(e.filter(d=>d.role!=="agent"||typeof d.turnIndex!="number"||d.turnIndex<t)),o=[],a=new Map,f=new Map,h=new Map,y=new Set;for(let d of i.items){let k=Oe(d);if(y.has(k))continue;y.add(k);let q=l.byRef.get(k),F=d.changed===!0,A=u.byRef.get(k).num,_=ne(d);if(q&&!F&&q.fingerprint===Pe(d)){a.set(_,(a.get(_)??0)+1);continue}let w=!!q||F,N=w?h:f;N.set(_,(N.get(_)??0)+1),o.push({item:d,num:A,updated:w})}let x=[...a.entries()].map(([d,k])=>({label:P(d),count:k})),I=[...[...f.entries()].map(([d,k])=>`${k} new ${k===1?Ae(d):P(d)}`),...[...h.entries()].map(([d,k])=>`${k} updated ${k===1?Ae(d):P(d)}`)].join(" \xB7 ");return{fresh:o,unchanged:x,headerStats:I}}var E=R(B(),1);function Fe({turnIndex:e,fresh:t,headerStats:r,unchangedTotal:i}){let m=[];for(let l of t){let o=l.item.kind??"use-case",a=m.find(f=>f.kind===o);a?a.rows.push(l):m.push({kind:o,rows:[l]})}let u=`design \xB7 turn ${e} \u2014 ${r||"no new items"}${i>0?` (${i} unchanged)`:""}`;return(0,E.jsxs)(b,{flexDirection:"column",children:[(0,E.jsx)(n,{bold:!0,children:u}),m.map(({kind:l,rows:o})=>{let a=o.filter(y=>!y.updated).length,f=o.length-a,h=[...a>0?[`${a} new`]:[],...f>0?[`${f} updated`]:[]].join(" \xB7 ");return(0,E.jsxs)(b,{flexDirection:"column",children:[(0,E.jsx)(n,{color:s.dim,children:`${P(l).toLowerCase()} \xB7 ${h}`}),o.map(({item:y,num:x,updated:I})=>{let d=y;return(0,E.jsxs)(b,{flexDirection:"column",children:[(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{children:` ${x} \xB7 ${y.title}`}),d.badge?(0,E.jsx)(n,{color:s.dim,children:` \xB7 ${d.badge}`}):null,I?(0,E.jsx)(n,{color:s.dim,children:" \xB7 updated"}):null]}),d.why?(0,E.jsx)(n,{color:s.dim,children:` ${d.why}`}):null]},`${l}:${y.temp_ref}`)})]},l)})]})}var g=R(B(),1);function It(e){let t=e.form==="assumed"?" (flagged)":e.form==="deferred"?"":" (you)",r=e.note?` \u2014 ${e.note}`:"";return e.form==="deferred"?`\u21B3 deferred q${e.qNum} ${e.stub}${r}`:e.form==="changed"?`\u21B3 changed q${e.qNum} ${e.stub}: ${e.prev??"?"} \u2192 ${e.choice??"?"}${t}${r}`:`\u21B3 ${e.form} q${e.qNum} ${e.stub}: ${e.choice??"?"}${t}${r}`}function Ne({block:e,annotations:t}){switch(e.kind){case"banner":return(0,g.jsx)(n,{color:s.dim,children:` \u2500\u2500 ${e.text} \u2500\u2500`});case"user":return(0,g.jsxs)(b,{children:[(0,g.jsx)(n,{color:s.orange,children:"\u276F "}),(0,g.jsx)(n,{children:e.text})]});case"note":return(0,g.jsx)(n,{color:s.dim,children:` ${e.text}`});case"agent":return(0,g.jsx)(ve,{text:e.text});case"thinking":return(0,g.jsx)(n,{color:s.dim,children:` thought for ${(e.tookMs/1e3).toFixed(1)}s`});case"tool":return(0,g.jsx)(n,{color:s.dim,children:` ${Re({name:e.name,status:e.status==="ok"?"done":e.status,detail:e.detail})}`});case"usage":return(0,g.jsx)(n,{color:s.dim,children:` \xB7 ${e.credits.toFixed(1)} credits \u2014 total ${e.total.toFixed(1)}`});case"turn":{let r=t??null,i=r?r.fresh.map(o=>o.item):e.items,m=r?r.fresh.map(o=>o.num):void 0,u=r?r.fresh.map(o=>o.updated):void 0,l=i.some(o=>!!o.kind);return(0,g.jsxs)(b,{flexDirection:"column",marginLeft:2,children:[l?(0,g.jsx)(Fe,{turnIndex:e.turnIndex,fresh:r?r.fresh:i.map((o,a)=>({item:o,num:a+1,updated:!1})),headerStats:r?.headerStats??"",unchangedTotal:(r?.unchanged??[]).reduce((o,a)=>o+a.count,0)}):e.heading==="use-cases"?(0,g.jsx)(_e,{turn:e.turnIndex,items:i,expandedRef:null,compact:!0,total:i.length,numbers:m,marks:u}):(0,g.jsx)(G,{heading:e.heading,turn:e.turnIndex,items:i,expandedRef:null,compact:!0,total:i.length,numbers:m,marks:u}),r&&r.unchanged.length>0&&(0,g.jsx)(n,{color:s.dim,children:` \u22EE unchanged: ${r.unchanged.map(o=>`${o.count} ${o.label}`).join(" \xB7 ")} \u2014 /view to browse`})]})}case"answer":return(0,g.jsx)(n,{color:s.dim,children:It(e.receipt)});case"continued":return(0,g.jsx)(n,{color:s.dim,children:"\u21B3 continued"});case"commit":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{color:e.ok?s.green:s.red,children:` ${e.ok?"\u2714":"\u2717"} ${e.line}`}),(e.warnings??[]).map((r,i)=>(0,g.jsx)(n,{color:s.dim,children:` \u26A0 ${r}`},`w-${i}`))]});case"error":return(0,g.jsxs)($e,{variant:"error",paddingX:1,children:[(0,g.jsx)(n,{color:s.red,children:e.title}),e.detail.map((r,i)=>(0,g.jsx)(n,{color:s.dim,children:r},`d-${i}`))]});case"interrupted":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{color:s.red,children:"interrupted \u2014 session not saved"}),e.detail?(0,g.jsx)(n,{color:s.dim,children:e.detail}):null]});case"pause":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{children:`paused: session ${e.sid} saved`}),e.expires_at?(0,g.jsx)(n,{color:s.dim,children:`expires: ${e.expires_at}`}):null,(0,g.jsx)(n,{children:`resume: ${e.resume}`}),e.messageForm?(0,g.jsx)(n,{children:`or say something on the way in: ${e.messageForm}`}):null]});case"summary":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{bold:!0,children:"session summary"}),e.lines.map((r,i)=>(0,g.jsx)(n,{children:` ${r}`},`s-${i}`))]})}}var je=R(B(),1),re="ctrl+t thinking \xB7 ctrl+c exit";function Ue(e,t){if(e.length<=t)return e;if(t<=1)return"\u2026";let r=Math.ceil((t-1)/2),i=Math.floor((t-1)/2);return`${e.slice(0,r)}\u2026${i>0?e.slice(-i):""}`}function We({verb:e,subject:t,turn:r,pendingCount:i,creditsTotal:m}){let{stdout:u}=W(),l=u?.columns??80,o=[];o.push(e),r&&o.push(`turn ${r}`),m!==void 0&&o.push(`${m.toFixed(1)} cr`);let a=i?`[${i} pending]`:null,f=" \xB7 ",y=[...o,...a?[a]:[]].join(f).length,x,I=[...o,...t?[t]:[],...a?[a]:[],re].join(f);if(I.length<=l)x=I;else{let d=l-y-(t?f.length:0)-f.length-re.length;if(t&&d>=8)x=[...o,Ue(t,d),...a?[a]:[],re].join(f);else{let k=l-y-(t?f.length:0);x=[...o,...t&&k>=4?[Ue(t,k)]:[],...a?[a]:[]].join(f)}}return(0,je.jsx)(n,{color:s.dim,children:x})}var C=R(B(),1),oe=(e,t)=>Math.max(0,Math.min(t,e));function Y(e,t,r){switch(t.type){case"move":return{...e,cursor:oe(e.cursor+t.delta,Math.max(0,r-1))};case"enter":return e.level==="list"?{...e,level:"detail"}:e;case"back":return e.level==="detail"?{...e,level:"list"}:null}}var Ke={"use-case":"use-cases",ac:"acs",scenario:"scenarios",test:"tests",gap:"gaps"};function He(e,t){if(e.level==="detail")return{level:"detail",cursor:oe(e.num-1,Math.max(0,t.entries.length-1))};if(e.section){let r=t.entries.findIndex(i=>Ke[i.kind]===e.section);if(r>=0)return{level:"list",cursor:r}}return{level:"list",cursor:0}}function Bt(e){let t=[];for(let r of e.entries){let i=t.find(m=>m.kind===r.kind);i?i.entries.push(r):t.push({kind:r.kind,entries:[r]})}return t}var Ve=3;function Dt({items:e,cursor:t,verb:r}){let i=`view \xB7 ${r} so far \xB7 ${e.counts.map(u=>`${u.count} ${u.count===1?u.label.replace(/s$/,""):u.label}`).join(" \xB7 ")}`,m=e.entries[t];return(0,C.jsxs)(b,{flexDirection:"column",borderStyle:"round",borderColor:s.dim,paddingX:1,children:[(0,C.jsx)(n,{bold:!0,children:i}),Bt(e).map(({kind:u,entries:l})=>{let o=m?.kind===u,a=o?l.findIndex(x=>x.ref===m.ref):-1,f=o?oe(a-1,Math.max(0,l.length-Ve)):0,h=l.slice(f,f+(o?Ve:1)),y=l.length-h.length;return(0,C.jsxs)(b,{flexDirection:"column",children:[(0,C.jsx)(n,{color:s.dim,children:`${Ke[u]??P(u)} \xB7 ${l.length}`}),h.map(x=>{let I=o&&x.ref===m.ref,d=x.item.badge;return(0,C.jsxs)(n,{children:[(0,C.jsx)(n,{color:s.generateAccent,children:I?"\u203A ":" "}),(0,C.jsx)(n,{children:`${x.num} \xB7 ${x.item.title}`}),d?(0,C.jsx)(n,{color:s.dim,children:` \xB7 ${d}`}):null]},`${x.kind}:${x.ref}`)}),y>0&&(0,C.jsx)(n,{color:s.dim,children:` \u22EE ${y} more`})]},u)}),(0,C.jsx)(n,{color:s.dim,children:"\u2191\u2193 move \xB7 \u21B5 detail \xB7 esc back to chat"})]})}function Et({items:e,cursor:t}){let r=e.entries[t];if(!r)return(0,C.jsx)(n,{color:s.dim,children:"nothing to show"});let i=r.item;return(0,C.jsxs)(b,{flexDirection:"column",borderStyle:"round",borderColor:s.dim,paddingX:1,children:[(0,C.jsx)(n,{bold:!0,children:`view \xB7 ${r.kind} ${r.num} of ${e.entries.length}`}),(0,C.jsx)(n,{children:r.item.title}),i.badge?(0,C.jsx)(n,{color:s.dim,children:`kind: ${i.badge}`}):null,i.why?(0,C.jsx)(n,{color:s.dim,children:i.why}):null,(0,C.jsx)(te,{item:r.item}),(0,C.jsx)(n,{color:s.dim,children:"view-only \u2014 approvals happen in chat"}),(0,C.jsx)(n,{color:s.dim,children:"\u2191\u2193 prev/next \xB7 esc back to list"})]})}function Qe({items:e,state:t,verb:r}){return t.level==="list"?(0,C.jsx)(Dt,{items:e,cursor:t.cursor,verb:r}):(0,C.jsx)(Et,{items:e,cursor:t.cursor})}var Xe=[{name:"view",description:"browse the proposal set"},{name:"explain",description:"why a committed item exists"},{name:"pause",description:"save + exit (resumable)"},{name:"done",description:"finish the session"}],_t={"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 Ge(e){let t=(e??"").trim().toLowerCase();if(!t)return{level:"list"};if(/^\d+$/.test(t)){let i=parseInt(t,10);return i>=1?{level:"detail",num:i}:{error:"items are numbered from 1 \u2014 /view 1"}}let r=_t[t];return r?{level:"list",section:r}:{error:"try /view, /view <number>, or /view acs|scenarios|tests"}}var S=R(B(),1),Lt=6,Ye=12;function At(e,t,r){let i=Math.max(20,t),m=[];for(let l of e.split(`
2
+ import{a as ee}from"./chunk-64LC36AF.js";import{a as Re,b as Ie}from"./chunk-6PS65QFF.js";import{a as ve,b as ke}from"./chunk-DCWCANNS.js";import{b as Te,d as Ce}from"./chunk-R7NNIQMH.js";import{a as be}from"./chunk-5Y2G4NC7.js";import{a as Se}from"./chunk-YCCUBQY4.js";import{a as $e}from"./chunk-KVAALPTA.js";import{b as we}from"./chunk-DFS4RMVP.js";import"./chunk-RGQIBS32.js";import{y as s}from"./chunk-NMKZHHB6.js";import{a as B}from"./chunk-HCBYKLMW.js";import{a as b,b as n,k as W}from"./chunk-C44QQJR4.js";import{a as yt}from"./chunk-6YGTRKDT.js";import{e as R}from"./chunk-UR6MHSHU.js";var v=R(yt(),1);var $=R(B(),1),Be=3,Tt=60;function X(e){return e.options.length}var bt={high:{text:"\u203C high",color:s.red},med:{text:"med",color:"yellow"},low:{text:"low",color:s.dim}};function $t({batch:e,i:t}){let r=e.resolution[t],i=r.form==="deferred"?"\u2013 deferred (the agent keeps it)":`\u2713 ${r.form}: ${r.choice}${r.form==="assumed"?" (flagged)":" (you)"}`;return(0,$.jsx)(n,{color:s.dim,children:` ${i}`})}function wt({batch:e,i:t,sel:r,focused:i,freeText:m}){let u=e.questions[t],l=e.cursor===t,o=e.resolution[t],a=l?"\u203A":" ",f=bt[u.risk],h=y=>l&&i&&r===y?(0,$.jsx)(n,{color:s.generateAccent,children:"\u25B8"}):" ";return(0,$.jsxs)(b,{flexDirection:"column",children:[(0,$.jsxs)(n,{bold:l,children:[` ${t+1} ${a} ${u.text}`,f?(0,$.jsx)(n,{color:f.color,bold:!1,children:` ${f.text}`}):null]}),(0,$.jsx)(n,{color:s.muted,children:` ${u.rationale}`}),o&&!l?(0,$.jsx)($t,{batch:e,i:t}):(0,$.jsxs)(b,{flexDirection:"column",children:[u.multi_select?(0,$.jsx)(n,{color:s.dim,children:" note: multi-select not yet supported \u2014 pick the best single option"}):null,u.options.map((y,x)=>(0,$.jsxs)(n,{children:[" ",h(x),` ${x+1} ${y.label}`,x===u.recommended_index?(0,$.jsx)(n,{color:s.dim,children:" (recommended)"}):null,o?.selected_index===x?(0,$.jsx)(n,{color:s.dim,children:" (current)"}):null]},`o-${x}`)),u.allow_free_text&&l?m?(0,$.jsxs)(b,{children:[(0,$.jsxs)(n,{children:[" ",(0,$.jsx)(n,{color:s.generateAccent,children:"\u25B8"})," ",(0,$.jsx)(n,{color:s.dim,children:"\u270E "})]}),(0,$.jsx)(Se,{value:m.value,onChange:m.onChange,onSubmit:m.onSubmit,onCancel:m.onCancel,placeholder:"tell me what to do"})]}):(0,$.jsxs)(n,{children:[" ",h(u.options.length)," ",(0,$.jsx)(n,{color:s.dim,children:"\u270E tell me what to do"})]}):null]})]})}function De({batch:e,sel:t=0,focused:r=!1,freeText:i=null}){let{stdout:m}=W(),l=(m?.columns??80)<Tt,o=e.resolution.filter(I=>!I).length,a=Math.max(0,Math.min(e.cursor<0?0:e.cursor,e.questions.length-Be)),f=e.questions.slice(a,a+Be),h=a,y=e.questions.length-a-f.length,x=(0,$.jsxs)(b,{flexDirection:"column",children:[(0,$.jsx)(n,{bold:!0,color:s.generateAccent,children:`? the agent needs ${o===1?"one answer":`${o} answers`} before it can continue`}),h>0?(0,$.jsx)(n,{color:s.muted,children:` \u22EE ${h} above`}):null,f.map((I,d)=>(0,$.jsx)(wt,{batch:e,i:a+d,sel:t,focused:r,freeText:i},I.id)),y>0?(0,$.jsx)(n,{color:s.muted,children:` \u22EE ${y} more`}):null]});return l?x:(0,$.jsx)(b,{flexDirection:"column",borderStyle:"round",borderColor:s.generateAccent,paddingX:1,children:x})}var D=R(B(),1),Ee=60,Ct=e=>e.length<=Ee?e:`${e.slice(0,Ee-1)}\u2026`,St={high:s.red,med:"yellow"};function te({item:e}){return(0,D.jsxs)(b,{flexDirection:"column",marginLeft:2,children:[(e.cite??[]).map((t,r)=>(0,D.jsx)(n,{dimColor:!0,children:`cite ${t.anchor??"conv"} \u2014 "${t.quote??""}"`},`cite-${r}`)),(e.depends_on_hint??[]).length>0&&(0,D.jsx)(n,{dimColor:!0,children:`depends on: ${(e.depends_on_hint??[]).join(", ")}`}),Object.entries(e.extra??{}).map(([t,r])=>(0,D.jsx)(n,{dimColor:!0,children:`${t}: ${r}`},`extra-${t}`))]})}function G({heading:e,turn:t,items:r,expandedRef:i,total:m,compact:u,numbers:l,marks:o}){return(0,D.jsxs)(b,{flexDirection:"column",children:[(0,D.jsx)(n,{bold:!0,children:`${e} \xB7 turn ${t} \xB7 ${m??r.length} proposed`}),r.map((a,f)=>{let h=a.matches_existing,y=h?h.cid?h.archived?` \u2248 matches archived \u2014 previously rejected${h.reason?`: "${h.reason}"`:""}`:" \u2248 matches existing":" \u2248overlap":"",x=o?.[f]?" \xB7 updated":"",I=u?` ${l?.[f]??f+1} \xB7 ${a.title}`:` ${a.title}`,d=a.why?` \u2014 ${u?Ct(a.why):a.why}`:"";return(0,D.jsxs)(b,{flexDirection:"column",children:[(0,D.jsxs)(n,{children:[I,a.badge!==void 0?(0,D.jsx)(n,{color:St[a.badge]??s.dim,children:` ${a.badge}`}):null,d?(0,D.jsx)(n,{color:s.dim,children:d}):null,y?(0,D.jsx)(n,{color:h?.archived?"yellow":"magenta",children:y}):null,x?(0,D.jsx)(n,{color:s.dim,children:x}):null]}),i===a.temp_ref&&(0,D.jsx)(te,{item:a})]},a.temp_ref)})]})}var Le=R(B(),1),vt=e=>e.summary??e.description??"";function kt(e){return{temp_ref:e.temp_ref,title:e.title,badge:e.risk,why:vt(e),matches_existing:e.matches_existing?e.matches_existing:null,cite:e.cite??[],depends_on_hint:e.depends_on_hint??[]}}function _e({turn:e,items:t,expandedRef:r,total:i,compact:m,numbers:u,marks:l}){return(0,Le.jsx)(G,{heading:"use-cases",turn:e,items:t.map(kt),expandedRef:r,total:i,compact:m,numbers:u,marks:l})}var Rt={"use-case":"use-cases",ac:"ACs",scenario:"scenarios",test:"tests",gap:"gaps"},P=e=>Rt[e]??`${e}s`,Ae=e=>e==="ac"?"AC":e==="use-case"?"use-case":e,ne=e=>e.kind??"use-case",Oe=e=>`${ne(e)}:${e.temp_ref}`;function Pe(e){let t=e,r=t.badge??e.risk??null,i=t.why??e.summary??e.description??null;return JSON.stringify([e.title,r,i,t.extra??null,e.depends_on_hint??null])}function Me(e){return e.filter(t=>t.role==="agent"&&typeof t.turnIndex=="number"&&Array.isArray(t.items)&&t.items.length>0)}function V(e){let t=new Map,r=1;for(let u of Me(e)){let l=new Set;for(let o of u.items){let a=Oe(o);if(l.has(a))continue;l.add(a);let f=t.get(a);t.set(a,{num:f?.num??r++,ref:o.temp_ref,kind:ne(o),item:o,turnIndex:u.turnIndex,fingerprint:Pe(o)})}}let i=[...t.values()].sort((u,l)=>u.num-l.num),m=[];for(let u of i){let l=m.find(o=>o.kind===u.kind);l?l.count++:m.push({kind:u.kind,label:P(u.kind),count:1})}return{entries:i,byRef:t,counts:m}}function qe(e,t){let i=Me(e).find(d=>d.turnIndex===t);if(!i)return null;let m=e.filter(d=>d.role!=="agent"||typeof d.turnIndex!="number"||d.turnIndex<=t),u=V(m),l=V(e.filter(d=>d.role!=="agent"||typeof d.turnIndex!="number"||d.turnIndex<t)),o=[],a=new Map,f=new Map,h=new Map,y=new Set;for(let d of i.items){let k=Oe(d);if(y.has(k))continue;y.add(k);let q=l.byRef.get(k),F=d.changed===!0,A=u.byRef.get(k).num,_=ne(d);if(q&&!F&&q.fingerprint===Pe(d)){a.set(_,(a.get(_)??0)+1);continue}let w=!!q||F,N=w?h:f;N.set(_,(N.get(_)??0)+1),o.push({item:d,num:A,updated:w})}let x=[...a.entries()].map(([d,k])=>({label:P(d),count:k})),I=[...[...f.entries()].map(([d,k])=>`${k} new ${k===1?Ae(d):P(d)}`),...[...h.entries()].map(([d,k])=>`${k} updated ${k===1?Ae(d):P(d)}`)].join(" \xB7 ");return{fresh:o,unchanged:x,headerStats:I}}var E=R(B(),1);function Fe({turnIndex:e,fresh:t,headerStats:r,unchangedTotal:i}){let m=[];for(let l of t){let o=l.item.kind??"use-case",a=m.find(f=>f.kind===o);a?a.rows.push(l):m.push({kind:o,rows:[l]})}let u=`design \xB7 turn ${e} \u2014 ${r||"no new items"}${i>0?` (${i} unchanged)`:""}`;return(0,E.jsxs)(b,{flexDirection:"column",children:[(0,E.jsx)(n,{bold:!0,children:u}),m.map(({kind:l,rows:o})=>{let a=o.filter(y=>!y.updated).length,f=o.length-a,h=[...a>0?[`${a} new`]:[],...f>0?[`${f} updated`]:[]].join(" \xB7 ");return(0,E.jsxs)(b,{flexDirection:"column",children:[(0,E.jsx)(n,{color:s.dim,children:`${P(l).toLowerCase()} \xB7 ${h}`}),o.map(({item:y,num:x,updated:I})=>{let d=y;return(0,E.jsxs)(b,{flexDirection:"column",children:[(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{children:` ${x} \xB7 ${y.title}`}),d.badge?(0,E.jsx)(n,{color:s.dim,children:` \xB7 ${d.badge}`}):null,I?(0,E.jsx)(n,{color:s.dim,children:" \xB7 updated"}):null]}),d.why?(0,E.jsx)(n,{color:s.dim,children:` ${d.why}`}):null]},`${l}:${y.temp_ref}`)})]},l)})]})}var g=R(B(),1);function It(e){let t=e.form==="assumed"?" (flagged)":e.form==="deferred"?"":" (you)",r=e.note?` \u2014 ${e.note}`:"";return e.form==="deferred"?`\u21B3 deferred q${e.qNum} ${e.stub}${r}`:e.form==="changed"?`\u21B3 changed q${e.qNum} ${e.stub}: ${e.prev??"?"} \u2192 ${e.choice??"?"}${t}${r}`:`\u21B3 ${e.form} q${e.qNum} ${e.stub}: ${e.choice??"?"}${t}${r}`}function Ne({block:e,annotations:t}){switch(e.kind){case"banner":return(0,g.jsx)(n,{color:s.dim,children:` \u2500\u2500 ${e.text} \u2500\u2500`});case"user":return(0,g.jsxs)(b,{children:[(0,g.jsx)(n,{color:s.orange,children:"\u276F "}),(0,g.jsx)(n,{children:e.text})]});case"note":return(0,g.jsx)(n,{color:s.dim,children:` ${e.text}`});case"agent":return(0,g.jsx)(ve,{text:e.text});case"thinking":return(0,g.jsx)(n,{color:s.dim,children:` thought for ${(e.tookMs/1e3).toFixed(1)}s`});case"tool":return(0,g.jsx)(n,{color:s.dim,children:` ${Re({name:e.name,status:e.status==="ok"?"done":e.status,detail:e.detail})}`});case"usage":return(0,g.jsx)(n,{color:s.dim,children:` \xB7 ${e.credits.toFixed(1)} credits \u2014 total ${e.total.toFixed(1)}`});case"turn":{let r=t??null,i=r?r.fresh.map(o=>o.item):e.items,m=r?r.fresh.map(o=>o.num):void 0,u=r?r.fresh.map(o=>o.updated):void 0,l=i.some(o=>!!o.kind);return(0,g.jsxs)(b,{flexDirection:"column",marginLeft:2,children:[l?(0,g.jsx)(Fe,{turnIndex:e.turnIndex,fresh:r?r.fresh:i.map((o,a)=>({item:o,num:a+1,updated:!1})),headerStats:r?.headerStats??"",unchangedTotal:(r?.unchanged??[]).reduce((o,a)=>o+a.count,0)}):e.heading==="use-cases"?(0,g.jsx)(_e,{turn:e.turnIndex,items:i,expandedRef:null,compact:!0,total:i.length,numbers:m,marks:u}):(0,g.jsx)(G,{heading:e.heading,turn:e.turnIndex,items:i,expandedRef:null,compact:!0,total:i.length,numbers:m,marks:u}),r&&r.unchanged.length>0&&(0,g.jsx)(n,{color:s.dim,children:` \u22EE unchanged: ${r.unchanged.map(o=>`${o.count} ${o.label}`).join(" \xB7 ")} \u2014 /view to browse`})]})}case"answer":return(0,g.jsx)(n,{color:s.dim,children:It(e.receipt)});case"continued":return(0,g.jsx)(n,{color:s.dim,children:"\u21B3 continued"});case"commit":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{color:e.ok?s.green:s.red,children:` ${e.ok?"\u2714":"\u2717"} ${e.line}`}),(e.warnings??[]).map((r,i)=>(0,g.jsx)(n,{color:s.dim,children:` \u26A0 ${r}`},`w-${i}`))]});case"error":return(0,g.jsxs)($e,{variant:"error",paddingX:1,children:[(0,g.jsx)(n,{color:s.red,children:e.title}),e.detail.map((r,i)=>(0,g.jsx)(n,{color:s.dim,children:r},`d-${i}`))]});case"interrupted":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{color:s.red,children:"interrupted \u2014 session not saved"}),e.detail?(0,g.jsx)(n,{color:s.dim,children:e.detail}):null]});case"pause":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{children:`paused: session ${e.sid} saved`}),e.expires_at?(0,g.jsx)(n,{color:s.dim,children:`expires: ${e.expires_at}`}):null,(0,g.jsx)(n,{children:`resume: ${e.resume}`}),e.messageForm?(0,g.jsx)(n,{children:`or say something on the way in: ${e.messageForm}`}):null]});case"summary":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{bold:!0,children:"session summary"}),e.lines.map((r,i)=>(0,g.jsx)(n,{children:` ${r}`},`s-${i}`))]})}}var je=R(B(),1),re="ctrl+t thinking \xB7 ctrl+c exit";function Ue(e,t){if(e.length<=t)return e;if(t<=1)return"\u2026";let r=Math.ceil((t-1)/2),i=Math.floor((t-1)/2);return`${e.slice(0,r)}\u2026${i>0?e.slice(-i):""}`}function We({verb:e,subject:t,turn:r,pendingCount:i,creditsTotal:m}){let{stdout:u}=W(),l=u?.columns??80,o=[];o.push(e),r&&o.push(`turn ${r}`),m!==void 0&&o.push(`${m.toFixed(1)} cr`);let a=i?`[${i} pending]`:null,f=" \xB7 ",y=[...o,...a?[a]:[]].join(f).length,x,I=[...o,...t?[t]:[],...a?[a]:[],re].join(f);if(I.length<=l)x=I;else{let d=l-y-(t?f.length:0)-f.length-re.length;if(t&&d>=8)x=[...o,Ue(t,d),...a?[a]:[],re].join(f);else{let k=l-y-(t?f.length:0);x=[...o,...t&&k>=4?[Ue(t,k)]:[],...a?[a]:[]].join(f)}}return(0,je.jsx)(n,{color:s.dim,children:x})}var C=R(B(),1),oe=(e,t)=>Math.max(0,Math.min(t,e));function Y(e,t,r){switch(t.type){case"move":return{...e,cursor:oe(e.cursor+t.delta,Math.max(0,r-1))};case"enter":return e.level==="list"?{...e,level:"detail"}:e;case"back":return e.level==="detail"?{...e,level:"list"}:null}}var Ke={"use-case":"use-cases",ac:"acs",scenario:"scenarios",test:"tests",gap:"gaps"};function He(e,t){if(e.level==="detail")return{level:"detail",cursor:oe(e.num-1,Math.max(0,t.entries.length-1))};if(e.section){let r=t.entries.findIndex(i=>Ke[i.kind]===e.section);if(r>=0)return{level:"list",cursor:r}}return{level:"list",cursor:0}}function Bt(e){let t=[];for(let r of e.entries){let i=t.find(m=>m.kind===r.kind);i?i.entries.push(r):t.push({kind:r.kind,entries:[r]})}return t}var Ve=3;function Dt({items:e,cursor:t,verb:r}){let i=`view \xB7 ${r} so far \xB7 ${e.counts.map(u=>`${u.count} ${u.count===1?u.label.replace(/s$/,""):u.label}`).join(" \xB7 ")}`,m=e.entries[t];return(0,C.jsxs)(b,{flexDirection:"column",borderStyle:"round",borderColor:s.dim,paddingX:1,children:[(0,C.jsx)(n,{bold:!0,children:i}),Bt(e).map(({kind:u,entries:l})=>{let o=m?.kind===u,a=o?l.findIndex(x=>x.ref===m.ref):-1,f=o?oe(a-1,Math.max(0,l.length-Ve)):0,h=l.slice(f,f+(o?Ve:1)),y=l.length-h.length;return(0,C.jsxs)(b,{flexDirection:"column",children:[(0,C.jsx)(n,{color:s.dim,children:`${Ke[u]??P(u)} \xB7 ${l.length}`}),h.map(x=>{let I=o&&x.ref===m.ref,d=x.item.badge;return(0,C.jsxs)(n,{children:[(0,C.jsx)(n,{color:s.generateAccent,children:I?"\u203A ":" "}),(0,C.jsx)(n,{children:`${x.num} \xB7 ${x.item.title}`}),d?(0,C.jsx)(n,{color:s.dim,children:` \xB7 ${d}`}):null]},`${x.kind}:${x.ref}`)}),y>0&&(0,C.jsx)(n,{color:s.dim,children:` \u22EE ${y} more`})]},u)}),(0,C.jsx)(n,{color:s.dim,children:"\u2191\u2193 move \xB7 \u21B5 detail \xB7 esc back to chat"})]})}function Et({items:e,cursor:t}){let r=e.entries[t];if(!r)return(0,C.jsx)(n,{color:s.dim,children:"nothing to show"});let i=r.item;return(0,C.jsxs)(b,{flexDirection:"column",borderStyle:"round",borderColor:s.dim,paddingX:1,children:[(0,C.jsx)(n,{bold:!0,children:`view \xB7 ${r.kind} ${r.num} of ${e.entries.length}`}),(0,C.jsx)(n,{children:r.item.title}),i.badge?(0,C.jsx)(n,{color:s.dim,children:`kind: ${i.badge}`}):null,i.why?(0,C.jsx)(n,{color:s.dim,children:i.why}):null,(0,C.jsx)(te,{item:r.item}),(0,C.jsx)(n,{color:s.dim,children:"view-only \u2014 approvals happen in chat"}),(0,C.jsx)(n,{color:s.dim,children:"\u2191\u2193 prev/next \xB7 esc back to list"})]})}function Qe({items:e,state:t,verb:r}){return t.level==="list"?(0,C.jsx)(Dt,{items:e,cursor:t.cursor,verb:r}):(0,C.jsx)(Et,{items:e,cursor:t.cursor})}var Xe=[{name:"view",description:"browse the proposal set"},{name:"explain",description:"why a committed item exists"},{name:"pause",description:"save + exit (resumable)"},{name:"done",description:"finish the session"}],_t={"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 Ge(e){let t=(e??"").trim().toLowerCase();if(!t)return{level:"list"};if(/^\d+$/.test(t)){let i=parseInt(t,10);return i>=1?{level:"detail",num:i}:{error:"items are numbered from 1 \u2014 /view 1"}}let r=_t[t];return r?{level:"list",section:r}:{error:"try /view, /view <number>, or /view acs|scenarios|tests"}}var S=R(B(),1),Lt=6,Ye=12;function At(e,t,r){let i=Math.max(20,t),m=[];for(let l of e.split(`
3
3
  `)){if(l.length<=i){m.push(l);continue}let o="";for(let a of l.split(" "))o&&o.length+1+a.length>i?(m.push(o),o=a):o=o?`${o} ${a}`:a;m.push(o)}let u=Math.max(0,m.length-r);return{body:m.slice(-r).join(`
4
4
  `),hidden:u}}var Ot='chat with the agent \u2014 "/" for commands',ze=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function Pt(e,t){return t?" \u2014 Enter continues \xB7 or type to adjust":e==="design"?" \u2014 reply, or /done to finish":' \u2014 reply, "looks good" approves, /done finishes'}function En({controller:e,verb:t="extract",onCtrlC:r}){let[,i]=(0,v.useState)(0),[m,u]=(0,v.useState)(!1),[l,o]=(0,v.useState)(null),[a,f]=(0,v.useState)(null),h=(0,v.useRef)(null),y=c=>{h.current=c,f(c)},x=we(),{stdout:I}=W(),d=I?.columns??80,k=(0,v.useRef)(0),q=(0,v.useRef)(0),F=(0,v.useRef)(null);F.current||(F.current=new Te(null)),(0,v.useEffect)(()=>{let c=()=>{let T=e.state.ledger;for(let L=k.current;L<T.length;L++){let M=T[L],ht=M.kind==="turn"?qe(e.state.turns,M.turnIndex):void 0;x.append((0,S.jsx)(Ne,{block:M,annotations:ht},`lg-${L}`))}k.current=T.length};c();let p=e.subscribe(()=>{c();let T=e.state;h.current&&(T.pending||T.status==="pausing")&&(y(null),T.pending&&o("questions arrived \u2014 back to chat")),i(L=>L+1)});return i(T=>T+1),p},[e,x]);let{thinking:A,status:_,pending:w,confirm:N,ledger:se,activeTurn:ie,stream:Je,notice:K}=e.state,ae=(Je?.text??"").trimEnd(),ce=ae.length>0,Ze=m&&(A.liveThinking.length>0||A.thinkingLog.length>0),et=At(A.liveThinking||A.thinkingLog.map(c=>c.text).join(`
5
5
  `),d-6,Ye),le=ce?ae.split(`
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-LABIRPOT.js";import"./chunk-4SXD6XWV.js";import"./chunk-6SGPN76K.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-WJG4ZPUH.js";import"./chunk-RGQIBS32.js";import"./chunk-NMKZHHB6.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-S2C62SDY.js";import"./chunk-4SXD6XWV.js";import"./chunk-6SGPN76K.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-LVWB6TB2.js";import"./chunk-RGQIBS32.js";import"./chunk-NMKZHHB6.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-24VYAMMK.js";import"./chunk-2WO7G2HO.js";import"./chunk-5Y2G4NC7.js";import"./chunk-6SGPN76K.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-MTG2LRGV.js";import"./chunk-WFQUDSKY.js";import"./chunk-5Y2G4NC7.js";import"./chunk-NMKZHHB6.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 p,b as l,c as n}from"./chunk-3Z3UIW5H.js";import{y as o}from"./chunk-6SGPN76K.js";import{a as g}from"./chunk-HCBYKLMW.js";import{a,j as c}from"./chunk-C44QQJR4.js";import{a as R}from"./chunk-6YGTRKDT.js";import{e as t}from"./chunk-UR6MHSHU.js";var b=t(R(),1);var e=t(g(),1);function A({model:d,authLabel:v,profile:x,env:w,defaultUrl:u,projectId:r,projectName:s,folderId:i,folderName:f,windowSize:B,chromeProfile:C}){let h=r?s?`${s} (${r})`:r:"(none)",D=i?f?`${f} (${i})`:i:"(none)",{exit:m}=c();return(0,b.useEffect)(()=>{let P=setTimeout(()=>m(),50);return()=>clearTimeout(P)},[m]),(0,e.jsx)(a,{flexDirection:"column",children:(0,e.jsx)(p,{title:"Configuration",children:(0,e.jsxs)(a,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(n,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:v}),(0,e.jsx)(l,{label:" profile",value:x}),(0,e.jsx)(l,{label:" env",value:w}),(0,e.jsx)(n,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:u??"(none)",valueColor:u?o.orange:o.dim}),(0,e.jsx)(l,{label:" model",value:d}),(0,e.jsx)(l,{label:" window",value:B}),(0,e.jsx)(l,{label:" project",value:h}),(0,e.jsx)(l,{label:" folder",value:D}),(0,e.jsx)(n,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:C,valueColor:o.dim})]})})})}export{A as ConfigView};
2
+ import{a as p,b as l,c as n}from"./chunk-KVAALPTA.js";import{y as o}from"./chunk-NMKZHHB6.js";import{a as g}from"./chunk-HCBYKLMW.js";import{a,j as c}from"./chunk-C44QQJR4.js";import{a as R}from"./chunk-6YGTRKDT.js";import{e as t}from"./chunk-UR6MHSHU.js";var b=t(R(),1);var e=t(g(),1);function A({model:d,authLabel:v,profile:x,env:w,defaultUrl:u,projectId:r,projectName:s,folderId:i,folderName:f,windowSize:B,chromeProfile:C}){let h=r?s?`${s} (${r})`:r:"(none)",D=i?f?`${f} (${i})`:i:"(none)",{exit:m}=c();return(0,b.useEffect)(()=>{let P=setTimeout(()=>m(),50);return()=>clearTimeout(P)},[m]),(0,e.jsx)(a,{flexDirection:"column",children:(0,e.jsx)(p,{title:"Configuration",children:(0,e.jsxs)(a,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(n,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:v}),(0,e.jsx)(l,{label:" profile",value:x}),(0,e.jsx)(l,{label:" env",value:w}),(0,e.jsx)(n,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:u??"(none)",valueColor:u?o.orange:o.dim}),(0,e.jsx)(l,{label:" model",value:d}),(0,e.jsx)(l,{label:" window",value:B}),(0,e.jsx)(l,{label:" project",value:h}),(0,e.jsx)(l,{label:" folder",value:D}),(0,e.jsx)(n,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:C,valueColor:o.dim})]})})})}export{A as ConfigView};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a}from"./chunk-EDM6YACR.js";import"./chunk-RFHMDQXZ.js";import"./chunk-YZBLBPOE.js";import"./chunk-CJJXT5DO.js";import"./chunk-ZPDM6FO7.js";import"./chunk-BC7UVJJB.js";import"./chunk-NVGBE2DR.js";import"./chunk-EHN5HTUD.js";import"./chunk-L5LI2JF4.js";import"./chunk-QHFUDBQH.js";import"./chunk-RGDQMKNJ.js";import"./chunk-L4JIMNKW.js";import"./chunk-MBXWXBDM.js";import"./chunk-IAHKTEET.js";import"./chunk-5YPBPZUR.js";import"./chunk-M5JQXOCE.js";import"./chunk-3NR6OTHL.js";import"./chunk-NMKZHHB6.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as EvidenceViewOffer};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b}from"./chunk-N6DO2LBH.js";import"./chunk-YCCUBQY4.js";import"./chunk-MY32TBBR.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-AKHUNBQS.js";import"./chunk-4SXD6XWV.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as FolderPicker,a as formatFolderLine};
2
+ import{a,b}from"./chunk-X47VFBIV.js";import"./chunk-YCCUBQY4.js";import"./chunk-XUHVQ5VL.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-3NR6OTHL.js";import"./chunk-RGQIBS32.js";import"./chunk-NMKZHHB6.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 as f,b as r,y as t}from"./chunk-6SGPN76K.js";import{a as T}from"./chunk-HCBYKLMW.js";import{a as s,b as o,j as x,k as p}from"./chunk-C44QQJR4.js";import{a as v}from"./chunk-6YGTRKDT.js";import{e as h}from"./chunk-UR6MHSHU.js";var w=h(v(),1);var e=h(T(),1),b="https://www.testmuai.com/support/docs/kane-cli-introduction",S="https://github.com/LambdaTest/kane-cli/issues";function L(){let{exit:c}=x(),{stdout:a}=p(),l=a?.columns??80;return(0,w.useEffect)(()=>{let m=setTimeout(()=>c(),50);return()=>clearTimeout(m)},[c]),(0,e.jsxs)(s,{flexDirection:"column",children:[(0,e.jsxs)(s,{paddingX:1,paddingTop:1,flexDirection:"column",children:[(0,e.jsx)(o,{color:t.orange,bold:!0,children:r}),(0,e.jsxs)(s,{children:[(0,e.jsx)(o,{color:t.dim,children:"Browser automation powered by AI "}),(0,e.jsxs)(o,{color:t.muted,children:[" v",f]})]})]}),(0,e.jsx)(o,{children:" "}),(0,e.jsxs)(d,{title:"USAGE",children:[(0,e.jsx)(g,{cmd:`${r}`,desc:"Single-shot prompt (no args, TTY)"}),(0,e.jsx)(g,{cmd:`${r} --tui`,desc:"Full interactive TUI",highlight:!0}),(0,e.jsx)(g,{cmd:`${r} run "<objective>"`,desc:"Inline objective"}),(0,e.jsx)(g,{cmd:`${r} testmd run <path>.md`,desc:"Replay a saved *_test.md file"})]}),(0,e.jsxs)(d,{title:"HELP",children:[(0,e.jsx)(g,{cmd:`${r} --help`,desc:"Show this help (long form)"}),(0,e.jsx)(g,{cmd:`${r} -h`,desc:"Show this help (short form)"}),(0,e.jsx)(g,{cmd:`${r} help`,desc:"Show this help (subcommand form)"}),(0,e.jsxs)(s,{marginLeft:2,marginTop:0,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:["These are the only supported help invocations. Anything else (e.g. ",(0,e.jsx)(o,{color:t.orange,children:"-help"}),") is an unknown flag."]}),(0,e.jsxs)(o,{color:t.dim,children:["Terminal tab-completion is a shell feature; ",r," does not ship shell-completion scripts, so any flag your shell suggests is a generic guess \u2014 not from ",r,"."]})]})]}),(0,e.jsxs)(d,{title:"COMMANDS",children:[(0,e.jsx)(i,{cmd:"run",args:"<objective>",desc:"Run an objective (inline string)",highlight:!0}),(0,e.jsx)(i,{cmd:"testmd",args:"run|list|status|delete|export",desc:"Manage *_test.md files"}),(0,e.jsx)(i,{cmd:"testrun",args:"run",desc:"Run M *_test.md files as one sealed execution"}),(0,e.jsx)(i,{cmd:"login",desc:"Auth setup (interactive, --oauth, or --username)"}),(0,e.jsx)(i,{cmd:"logout",desc:"Revoke tokens + delete profile"}),(0,e.jsx)(i,{cmd:"whoami",desc:"Show authenticated identity"}),(0,e.jsx)(i,{cmd:"config",args:"show|set-mode|set-assertion-mode|\u2026",desc:"Chrome, run & generate settings"}),(0,e.jsx)(i,{cmd:"profiles",args:"list|switch|delete",desc:"Manage auth profiles"}),(0,e.jsx)(i,{cmd:"evidence",args:"validate|serve|merge",desc:"Validate, serve (viewer) or merge evidence packs"}),(0,e.jsx)(i,{cmd:"changelog",args:"[--all]",desc:"Show recent release notes"}),(0,e.jsx)(i,{cmd:"context",args:"ingest|extract|list|review|sessions|\u2026",desc:"Build & manage the assurance context store"}),(0,e.jsx)(i,{cmd:"design",args:"tests --use-case <ref>",desc:"Design tests from the context store"})]}),(0,e.jsxs)(d,{title:"TESTMD ACTIONS",children:[(0,e.jsx)(i,{cmd:"testmd run",args:"<path>",desc:"Replay a saved *_test.md file",highlight:!0}),(0,e.jsx)(i,{cmd:"testmd list",desc:"List *_test.md files in cwd (recursive)"}),(0,e.jsx)(i,{cmd:"testmd status",args:"<path>",desc:"Print local meta.json for a test"}),(0,e.jsx)(i,{cmd:"testmd delete",args:"<path>",desc:"Remove output-<stem>/ and the source file"}),(0,e.jsx)(i,{cmd:"testmd export",args:"<path> --language <py|js>",desc:"Generate standalone Playwright code"})]}),(0,e.jsxs)(d,{title:"RUN FLAGS",children:[(0,e.jsx)(n,{long:"--max-steps",arg:"<n>",desc:"Max agent steps (default: 30)"}),(0,e.jsx)(n,{long:"--timeout",arg:"<sec>",desc:"Kill run after N seconds"}),(0,e.jsx)(n,{long:"--headless",desc:"No visible browser window"}),(0,e.jsx)(n,{long:"--mode",arg:"<action|testing>",desc:"Run mode (default: testing)"}),(0,e.jsx)(n,{long:"--name",arg:"<name>",desc:"Persist session under this name"}),(0,e.jsx)(n,{long:"--variables",arg:"<json>",desc:"Inline variables as JSON"}),(0,e.jsx)(n,{long:"--variables-file",arg:"<path>",desc:"Load variables from file"}),(0,e.jsx)(n,{long:"--session-context",arg:"<json>",desc:"Prior runs context JSON"}),(0,e.jsx)(n,{long:"--global-context",arg:"<file>",desc:"Override global context markdown"}),(0,e.jsx)(n,{long:"--local-context",arg:"<file>",desc:"Override local context markdown"}),(0,e.jsx)(n,{long:"--ws-endpoint",arg:"<url>",desc:"Remote browser (LambdaTest)"}),(0,e.jsx)(n,{long:"--cdp-endpoint",arg:"<url>",desc:"Connect to existing Chrome CDP"}),(0,e.jsx)(n,{long:"--task-skills",desc:"Domain-specific task skills (experimental)"}),(0,e.jsx)(n,{long:"--code-export",desc:"Generate code export after upload"}),(0,e.jsx)(n,{long:"--code-language",arg:"<lang>",desc:"Code export language: python | javascript"}),(0,e.jsx)(n,{long:"--skip-code-validation",desc:"Skip post-codegen validation"}),(0,e.jsx)(n,{long:"--username",arg:"<user>",desc:"Basic auth (skip OAuth)"}),(0,e.jsx)(n,{long:"--access-key",arg:"<key>",desc:"Basic auth access key"}),(0,e.jsx)(n,{long:"--env",arg:"<name>",desc:"Environment (prod or stage)"}),(0,e.jsx)(n,{long:"--agent",desc:"NDJSON output (no UI)",highlight:!0})]}),(0,e.jsxs)(d,{title:"EXAMPLES",children:[(0,e.jsx)(u,{label:"Inline objective",cmd:`${r} run "Search for laptop"`}),(0,e.jsx)(u,{label:"Replay a saved test",cmd:`${r} testmd run smoke_test.md`}),(0,e.jsx)(u,{label:"Variables",cmd:`${r} run "Login as {{user}}" --variables '{"user":{"value":"alice"}}'`}),(0,e.jsx)(u,{label:"Agent mode (NDJSON)",cmd:`${r} run "Add to cart" --agent | jq .status`})]}),(0,e.jsx)(d,{title:"TEST FILES",children:(0,e.jsxs)(s,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:[(0,e.jsx)(o,{color:t.orange,children:"*_test.md"})," \u2014 markdown test files with YAML frontmatter and ",(0,e.jsx)(o,{color:t.orange,children:"## "}),"step headings."]}),(0,e.jsxs)(o,{color:t.dim,children:["Run with ",(0,e.jsxs)(o,{color:t.orange,children:[r," testmd run path/to/foo_test.md"]}),". (`.md` paths are not accepted by `",r," run`.)"]}),(0,e.jsxs)(o,{color:t.dim,children:["Sessions you run in TUI auto-save to ",(0,e.jsx)(o,{color:t.orange,children:"<cwd>/.testmuai/tests/<name>_test.md"})," (testing mode prompts on exit)."]})]})}),(0,e.jsxs)(s,{flexDirection:"column",marginTop:0,paddingX:1,children:[(0,e.jsx)(o,{color:t.muted,children:"\u2500".repeat(Math.min(l-2,70))}),(0,e.jsxs)(s,{gap:3,children:[(0,e.jsxs)(s,{children:[(0,e.jsx)(o,{color:t.dim,children:"Docs "}),(0,e.jsx)(o,{color:t.orange,underline:!0,children:b})]}),(0,e.jsxs)(s,{children:[(0,e.jsx)(o,{color:t.dim,children:"Bugs "}),(0,e.jsx)(o,{color:t.orange,underline:!0,children:S})]})]})]}),(0,e.jsx)(o,{children:" "})]})}function d({title:c,children:a}){return(0,e.jsxs)(s,{flexDirection:"column",marginBottom:1,children:[(0,e.jsx)(s,{marginLeft:1,children:(0,e.jsx)(o,{bold:!0,color:t.dim,children:c})}),a]})}function g({cmd:c,desc:a,highlight:l}){return(0,e.jsxs)(s,{marginLeft:2,children:[(0,e.jsxs)(s,{width:40,children:[(0,e.jsx)(o,{color:t.dim,children:"$ "}),(0,e.jsx)(o,{color:l?t.orange:t.orange,children:c})]}),(0,e.jsx)(o,{color:t.dim,children:a})]})}function i({cmd:c,args:a,desc:l,highlight:m}){return(0,e.jsxs)(s,{marginLeft:2,children:[(0,e.jsx)(s,{width:16,children:(0,e.jsx)(o,{color:m?t.orange:t.green,bold:!0,children:c})}),(0,e.jsx)(s,{width:32,children:a?(0,e.jsx)(o,{color:t.dim,children:a}):null}),(0,e.jsx)(o,{color:t.dim,children:l})]})}function n({long:c,arg:a,desc:l,highlight:m}){return(0,e.jsxs)(s,{marginLeft:2,children:[(0,e.jsxs)(s,{width:30,children:[(0,e.jsx)(o,{color:m?t.orange:t.orange,children:c}),a&&(0,e.jsxs)(o,{color:t.dim,children:[" ",a]})]}),(0,e.jsx)(o,{color:t.dim,children:l})]})}function u({label:c,cmd:a}){return(0,e.jsxs)(s,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:["# ",c]}),(0,e.jsxs)(o,{color:t.orange,children:["$ ",a]})]})}export{L as HelpView};
2
+ import{a as f,b as r,y as t}from"./chunk-NMKZHHB6.js";import{a as T}from"./chunk-HCBYKLMW.js";import{a as s,b as o,j as x,k as p}from"./chunk-C44QQJR4.js";import{a as v}from"./chunk-6YGTRKDT.js";import{e as h}from"./chunk-UR6MHSHU.js";var w=h(v(),1);var e=h(T(),1),b="https://www.testmuai.com/support/docs/kane-cli-introduction",S="https://github.com/LambdaTest/kane-cli/issues";function L(){let{exit:c}=x(),{stdout:a}=p(),l=a?.columns??80;return(0,w.useEffect)(()=>{let m=setTimeout(()=>c(),50);return()=>clearTimeout(m)},[c]),(0,e.jsxs)(s,{flexDirection:"column",children:[(0,e.jsxs)(s,{paddingX:1,paddingTop:1,flexDirection:"column",children:[(0,e.jsx)(o,{color:t.orange,bold:!0,children:r}),(0,e.jsxs)(s,{children:[(0,e.jsx)(o,{color:t.dim,children:"Browser automation powered by AI "}),(0,e.jsxs)(o,{color:t.muted,children:[" v",f]})]})]}),(0,e.jsx)(o,{children:" "}),(0,e.jsxs)(d,{title:"USAGE",children:[(0,e.jsx)(g,{cmd:`${r}`,desc:"Single-shot prompt (no args, TTY)"}),(0,e.jsx)(g,{cmd:`${r} --tui`,desc:"Full interactive TUI",highlight:!0}),(0,e.jsx)(g,{cmd:`${r} run "<objective>"`,desc:"Inline objective"}),(0,e.jsx)(g,{cmd:`${r} testmd run <path>.md`,desc:"Replay a saved *_test.md file"})]}),(0,e.jsxs)(d,{title:"HELP",children:[(0,e.jsx)(g,{cmd:`${r} --help`,desc:"Show this help (long form)"}),(0,e.jsx)(g,{cmd:`${r} -h`,desc:"Show this help (short form)"}),(0,e.jsx)(g,{cmd:`${r} help`,desc:"Show this help (subcommand form)"}),(0,e.jsxs)(s,{marginLeft:2,marginTop:0,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:["These are the only supported help invocations. Anything else (e.g. ",(0,e.jsx)(o,{color:t.orange,children:"-help"}),") is an unknown flag."]}),(0,e.jsxs)(o,{color:t.dim,children:["Terminal tab-completion is a shell feature; ",r," does not ship shell-completion scripts, so any flag your shell suggests is a generic guess \u2014 not from ",r,"."]})]})]}),(0,e.jsxs)(d,{title:"COMMANDS",children:[(0,e.jsx)(i,{cmd:"run",args:"<objective>",desc:"Run an objective (inline string)",highlight:!0}),(0,e.jsx)(i,{cmd:"testmd",args:"run|list|status|delete|export",desc:"Manage *_test.md files"}),(0,e.jsx)(i,{cmd:"testrun",args:"run",desc:"Run M *_test.md files as one sealed execution"}),(0,e.jsx)(i,{cmd:"login",desc:"Auth setup (interactive, --oauth, or --username)"}),(0,e.jsx)(i,{cmd:"logout",desc:"Revoke tokens + delete profile"}),(0,e.jsx)(i,{cmd:"whoami",desc:"Show authenticated identity"}),(0,e.jsx)(i,{cmd:"config",args:"show|set-mode|set-assertion-mode|\u2026",desc:"Chrome, run & generate settings"}),(0,e.jsx)(i,{cmd:"profiles",args:"list|switch|delete",desc:"Manage auth profiles"}),(0,e.jsx)(i,{cmd:"evidence",args:"validate|serve|merge",desc:"Validate, serve (viewer) or merge evidence packs"}),(0,e.jsx)(i,{cmd:"changelog",args:"[--all]",desc:"Show recent release notes"}),(0,e.jsx)(i,{cmd:"context",args:"ingest|extract|list|review|sessions|\u2026",desc:"Build & manage the assurance context store"}),(0,e.jsx)(i,{cmd:"design",args:"tests --use-case <ref>",desc:"Design tests from the context store"})]}),(0,e.jsxs)(d,{title:"TESTMD ACTIONS",children:[(0,e.jsx)(i,{cmd:"testmd run",args:"<path>",desc:"Replay a saved *_test.md file",highlight:!0}),(0,e.jsx)(i,{cmd:"testmd list",desc:"List *_test.md files in cwd (recursive)"}),(0,e.jsx)(i,{cmd:"testmd status",args:"<path>",desc:"Print local meta.json for a test"}),(0,e.jsx)(i,{cmd:"testmd delete",args:"<path>",desc:"Remove output-<stem>/ and the source file"}),(0,e.jsx)(i,{cmd:"testmd export",args:"<path> --language <py|js>",desc:"Generate standalone Playwright code"})]}),(0,e.jsxs)(d,{title:"RUN FLAGS",children:[(0,e.jsx)(n,{long:"--max-steps",arg:"<n>",desc:"Max agent steps (default: 30)"}),(0,e.jsx)(n,{long:"--timeout",arg:"<sec>",desc:"Kill run after N seconds"}),(0,e.jsx)(n,{long:"--headless",desc:"No visible browser window"}),(0,e.jsx)(n,{long:"--mode",arg:"<action|testing>",desc:"Run mode (default: testing)"}),(0,e.jsx)(n,{long:"--name",arg:"<name>",desc:"Persist session under this name"}),(0,e.jsx)(n,{long:"--variables",arg:"<json>",desc:"Inline variables as JSON"}),(0,e.jsx)(n,{long:"--variables-file",arg:"<path>",desc:"Load variables from file"}),(0,e.jsx)(n,{long:"--session-context",arg:"<json>",desc:"Prior runs context JSON"}),(0,e.jsx)(n,{long:"--global-context",arg:"<file>",desc:"Override global context markdown"}),(0,e.jsx)(n,{long:"--local-context",arg:"<file>",desc:"Override local context markdown"}),(0,e.jsx)(n,{long:"--ws-endpoint",arg:"<url>",desc:"Remote browser (LambdaTest)"}),(0,e.jsx)(n,{long:"--cdp-endpoint",arg:"<url>",desc:"Connect to existing Chrome CDP"}),(0,e.jsx)(n,{long:"--task-skills",desc:"Domain-specific task skills (experimental)"}),(0,e.jsx)(n,{long:"--code-export",desc:"Generate code export after upload"}),(0,e.jsx)(n,{long:"--code-language",arg:"<lang>",desc:"Code export language: python | javascript"}),(0,e.jsx)(n,{long:"--skip-code-validation",desc:"Skip post-codegen validation"}),(0,e.jsx)(n,{long:"--username",arg:"<user>",desc:"Basic auth (skip OAuth)"}),(0,e.jsx)(n,{long:"--access-key",arg:"<key>",desc:"Basic auth access key"}),(0,e.jsx)(n,{long:"--env",arg:"<name>",desc:"Environment (prod or stage)"}),(0,e.jsx)(n,{long:"--agent",desc:"NDJSON output (no UI)",highlight:!0})]}),(0,e.jsxs)(d,{title:"EXAMPLES",children:[(0,e.jsx)(u,{label:"Inline objective",cmd:`${r} run "Search for laptop"`}),(0,e.jsx)(u,{label:"Replay a saved test",cmd:`${r} testmd run smoke_test.md`}),(0,e.jsx)(u,{label:"Variables",cmd:`${r} run "Login as {{user}}" --variables '{"user":{"value":"alice"}}'`}),(0,e.jsx)(u,{label:"Agent mode (NDJSON)",cmd:`${r} run "Add to cart" --agent | jq .status`})]}),(0,e.jsx)(d,{title:"TEST FILES",children:(0,e.jsxs)(s,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:[(0,e.jsx)(o,{color:t.orange,children:"*_test.md"})," \u2014 markdown test files with YAML frontmatter and ",(0,e.jsx)(o,{color:t.orange,children:"## "}),"step headings."]}),(0,e.jsxs)(o,{color:t.dim,children:["Run with ",(0,e.jsxs)(o,{color:t.orange,children:[r," testmd run path/to/foo_test.md"]}),". (`.md` paths are not accepted by `",r," run`.)"]}),(0,e.jsxs)(o,{color:t.dim,children:["Sessions you run in TUI auto-save to ",(0,e.jsx)(o,{color:t.orange,children:"<cwd>/.testmuai/tests/<name>_test.md"})," (testing mode prompts on exit)."]})]})}),(0,e.jsxs)(s,{flexDirection:"column",marginTop:0,paddingX:1,children:[(0,e.jsx)(o,{color:t.muted,children:"\u2500".repeat(Math.min(l-2,70))}),(0,e.jsxs)(s,{gap:3,children:[(0,e.jsxs)(s,{children:[(0,e.jsx)(o,{color:t.dim,children:"Docs "}),(0,e.jsx)(o,{color:t.orange,underline:!0,children:b})]}),(0,e.jsxs)(s,{children:[(0,e.jsx)(o,{color:t.dim,children:"Bugs "}),(0,e.jsx)(o,{color:t.orange,underline:!0,children:S})]})]})]}),(0,e.jsx)(o,{children:" "})]})}function d({title:c,children:a}){return(0,e.jsxs)(s,{flexDirection:"column",marginBottom:1,children:[(0,e.jsx)(s,{marginLeft:1,children:(0,e.jsx)(o,{bold:!0,color:t.dim,children:c})}),a]})}function g({cmd:c,desc:a,highlight:l}){return(0,e.jsxs)(s,{marginLeft:2,children:[(0,e.jsxs)(s,{width:40,children:[(0,e.jsx)(o,{color:t.dim,children:"$ "}),(0,e.jsx)(o,{color:l?t.orange:t.orange,children:c})]}),(0,e.jsx)(o,{color:t.dim,children:a})]})}function i({cmd:c,args:a,desc:l,highlight:m}){return(0,e.jsxs)(s,{marginLeft:2,children:[(0,e.jsx)(s,{width:16,children:(0,e.jsx)(o,{color:m?t.orange:t.green,bold:!0,children:c})}),(0,e.jsx)(s,{width:32,children:a?(0,e.jsx)(o,{color:t.dim,children:a}):null}),(0,e.jsx)(o,{color:t.dim,children:l})]})}function n({long:c,arg:a,desc:l,highlight:m}){return(0,e.jsxs)(s,{marginLeft:2,children:[(0,e.jsxs)(s,{width:30,children:[(0,e.jsx)(o,{color:m?t.orange:t.orange,children:c}),a&&(0,e.jsxs)(o,{color:t.dim,children:[" ",a]})]}),(0,e.jsx)(o,{color:t.dim,children:l})]})}function u({label:c,cmd:a}){return(0,e.jsxs)(s,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:["# ",c]}),(0,e.jsxs)(o,{color:t.orange,children:["$ ",a]})]})}export{L as HelpView};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-6NIV7AVZ.js";import"./chunk-3Z3UIW5H.js";import"./chunk-6SGPN76K.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-TADJIOHV.js";import"./chunk-KVAALPTA.js";import"./chunk-NMKZHHB6.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-XQL53VB7.js";import"./chunk-6SGPN76K.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-A2AZQ4PQ.js";import"./chunk-NMKZHHB6.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-LEQ2B3PR.js";import"./chunk-4SXD6XWV.js";import"./chunk-6SGPN76K.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-IX34JIXK.js";import"./chunk-RGQIBS32.js";import"./chunk-NMKZHHB6.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-HWA7WD44.js";import"./chunk-YCCUBQY4.js";import"./chunk-MY32TBBR.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-AKHUNBQS.js";import"./chunk-4SXD6XWV.js";import"./chunk-6SGPN76K.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-FYSWQ4K7.js";import"./chunk-YCCUBQY4.js";import"./chunk-XUHVQ5VL.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-3NR6OTHL.js";import"./chunk-RGQIBS32.js";import"./chunk-NMKZHHB6.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-LLS47HUA.js";import"./chunk-S3DAAAE5.js";import"./chunk-6NIV7AVZ.js";import"./chunk-3Z3UIW5H.js";import"./chunk-6SGPN76K.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-UQVKNUYO.js";import"./chunk-S3DAAAE5.js";import"./chunk-TADJIOHV.js";import"./chunk-KVAALPTA.js";import"./chunk-NMKZHHB6.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-YTZUYCFZ.js";import"./chunk-Y6HPW2OQ.js";import"./chunk-R7NNIQMH.js";import"./chunk-SK2GVMTJ.js";import"./chunk-QYTMD6NM.js";import"./chunk-DL5CXC64.js";import"./chunk-FPFOW6BS.js";import"./chunk-WAOCHXJ5.js";import"./chunk-L5LI2JF4.js";import"./chunk-FYSWQ4K7.js";import"./chunk-X47VFBIV.js";import"./chunk-YCCUBQY4.js";import"./chunk-XUHVQ5VL.js";import"./chunk-M5JQXOCE.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-3NR6OTHL.js";import"./chunk-VE3SUJMA.js";import"./chunk-Z34XRBKQ.js";import"./chunk-RGQIBS32.js";import"./chunk-NMKZHHB6.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-RV2NXHIC.js";import"./chunk-6NIV7AVZ.js";import"./chunk-3Z3UIW5H.js";import"./chunk-6SGPN76K.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-QG6LJCZG.js";import"./chunk-TADJIOHV.js";import"./chunk-KVAALPTA.js";import"./chunk-NMKZHHB6.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-5J3HQZNU.js";import"./chunk-6EC54ZHT.js";import"./chunk-NEHF4C6X.js";import"./chunk-QYTMD6NM.js";import"./chunk-WFQUDSKY.js";import"./chunk-5Y2G4NC7.js";import"./chunk-M5JQXOCE.js";import"./chunk-3NR6OTHL.js";import"./chunk-TADJIOHV.js";import"./chunk-KVAALPTA.js";import"./chunk-DFS4RMVP.js";import"./chunk-NMKZHHB6.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 as b,b as r}from"./chunk-3Z3UIW5H.js";import{y as o}from"./chunk-6SGPN76K.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-KVAALPTA.js";import{y as o}from"./chunk-NMKZHHB6.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,6 +1,6 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as p}from"./chunk-WWH7CW5R.js";import"./chunk-KHU7C6EE.js";import"./chunk-3C5GMAM4.js";import"./chunk-KNCHEM6A.js";import"./chunk-FXPPQL4D.js";import"./chunk-RE3BZVGE.js";import"./chunk-6PS65QFF.js";import"./chunk-JFAFKHDX.js";import"./chunk-WIA7TPK3.js";import"./chunk-QPZRHAYK.js";import"./chunk-6GTOYTCQ.js";import"./chunk-YKTYVJBN.js";import"./chunk-6AYUSR7X.js";import"./chunk-427OQS2N.js";import"./chunk-FJTWJ243.js";import{a as u}from"./chunk-BC7UVJJB.js";import"./chunk-2PQXEEVY.js";import"./chunk-L5LI2JF4.js";import"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.js";import"./chunk-5YPBPZUR.js";import"./chunk-6SGPN76K.js";import"./chunk-UR6MHSHU.js";import{existsSync as D}from"fs";var b=new Set(["interactive","agent","ci","override"]);function E(e){return e.mode!=null&&!b.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,because:e.because,changeDelta:e.changeDelta,priorDesign:e.priorDesign}}async function A(e){let c=async(r,s)=>{if(process.stderr.write(r+`
2
+ import{a as p}from"./chunk-IYTHPCQ2.js";import"./chunk-KHU7C6EE.js";import"./chunk-3C5GMAM4.js";import"./chunk-NMZATEKQ.js";import"./chunk-FXPPQL4D.js";import"./chunk-RE3BZVGE.js";import"./chunk-6PS65QFF.js";import"./chunk-JFAFKHDX.js";import"./chunk-VLC24QVT.js";import"./chunk-CIFVUX3B.js";import"./chunk-OSALXGD4.js";import"./chunk-DNNZ353O.js";import"./chunk-YKTYVJBN.js";import"./chunk-CVOGP253.js";import"./chunk-427OQS2N.js";import"./chunk-ZPDM6FO7.js";import{a as u}from"./chunk-BC7UVJJB.js";import"./chunk-NVGBE2DR.js";import"./chunk-L5LI2JF4.js";import"./chunk-QHFUDBQH.js";import"./chunk-RGDQMKNJ.js";import"./chunk-L4JIMNKW.js";import"./chunk-MBXWXBDM.js";import"./chunk-IAHKTEET.js";import"./chunk-5YPBPZUR.js";import"./chunk-NMKZHHB6.js";import"./chunk-UR6MHSHU.js";import{existsSync as D}from"fs";var b=new Set(["interactive","agent","ci","override"]);function E(e){return e.mode!=null&&!b.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,because:e.because,changeDelta:e.changeDelta,priorDesign:e.priorDesign}}async function A(e){let c=async(r,s)=>{if(process.stderr.write(r+`
3
3
  `),e.mode!=="agent")return 2;let{makeHeadlessIO:t,agentRefusal:i}=await import("./headless-io-PWW6YKH2.js");return i(t("ndjson","design"),r,s)},d=E(e);if("error"in d)return c(d.error);let a=d;{let{validateResumeMessage:r}=await import("./headless-io-PWW6YKH2.js"),s=r(a,"design");if(s)return c(s)}if(!D(u(process.cwd())))return c("error: no context store here (run `kane-cli context ingest` + `kane-cli context extract` first)","NO_STORE");let n=null;try{if(!a.mode&&!process.stdin.isTTY)return process.stderr.write(`design: no TTY \u2014 pass an explicit --mode agent|ci|override to run headless
4
4
  `),2;let r=a.mode??"interactive";if(r==="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)
5
- `),2;let{bindDesignInteractive:o}=await import("./interactive-bind-ZIIJDRBU.js");return await o(a)}let{resolveAgentAuthEnv:s}=await import("./spawner-DWONVIPI.js"),{runAgent:t}=await import("./bridge-PDJEOSAJ.js"),{preflightTurn:i}=await import("./turn-preflight-JGYT7LXP.js"),{makeInterruptGuard:h}=await import("./interrupt-guard-UREUWNRL.js"),{baseUrlAdvisory:w}=await import("./turn-preflight-JGYT7LXP.js"),{makeHeadlessIO:T,resolveEncoding:v,guardedChannels:x}=await import("./headless-io-PWW6YKH2.js");n=T(v(r),"design");let m=await s(),l=w();l&&n.out(l);let g=h(t,o=>n.out(o)),f=x(n,()=>g.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let o=await p({...a,mode:r},{contextDir:u(process.cwd()),agent:g.agent,preflightTurn:()=>i(m),ask:async()=>[],out:f.out,emit:f.emit,progress:n.progress,isTTY:!1,auth:m});return g.interrupted()&&o!==3?(n.out("interrupted \u2014 no session saved"),n.done(130)):n.done(o)}finally{g.dispose()}}catch(r){let s=r instanceof Error?r.message:String(r);n?.event({type:"error",message:`error: design failed: ${s}`});let t=n?i=>n.out(i):i=>process.stderr.write(i+`
5
+ `),2;let{bindDesignInteractive:o}=await import("./interactive-bind-TKRWAPJU.js");return await o(a)}let{resolveAgentAuthEnv:s}=await import("./spawner-VD6YFZ43.js"),{runAgent:t}=await import("./bridge-WVFTWHKP.js"),{preflightTurn:i}=await import("./turn-preflight-JGYT7LXP.js"),{makeInterruptGuard:h}=await import("./interrupt-guard-UREUWNRL.js"),{baseUrlAdvisory:w}=await import("./turn-preflight-JGYT7LXP.js"),{makeHeadlessIO:T,resolveEncoding:v,guardedChannels:x}=await import("./headless-io-PWW6YKH2.js");n=T(v(r),"design");let m=await s(),l=w();l&&n.out(l);let g=h(t,o=>n.out(o)),f=x(n,()=>g.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let o=await p({...a,mode:r},{contextDir:u(process.cwd()),agent:g.agent,preflightTurn:()=>i(m),ask:async()=>[],out:f.out,emit:f.emit,progress:n.progress,isTTY:!1,auth:m});return g.interrupted()&&o!==3?(n.out("interrupted \u2014 no session saved"),n.done(130)):n.done(o)}finally{g.dispose()}}catch(r){let s=r instanceof Error?r.message:String(r);n?.event({type:"error",message:`error: design failed: ${s}`});let t=n?i=>n.out(i):i=>process.stderr.write(i+`
6
6
  `);return t(`error: design failed: ${s}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&r instanceof Error&&r.stack&&t(r.stack),t("hint: per-run trace logs live under .context/logs/ (design-*.log)"),n?n.done(1):1}}export{A as designTestsCommand};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-LURGFJEE.js";import"./chunk-KYHXDJN4.js";import"./chunk-UR6MHSHU.js";export{a as runAgent};
2
+ import{a}from"./chunk-JR37W7IJ.js";import"./chunk-GLVDOR5G.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{c as i,g as c}from"./chunk-6SGPN76K.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{c as i,g as c}from"./chunk-NMKZHHB6.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,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as V,c as ne}from"./chunk-JFAFKHDX.js";import{b as X,c as Z,d as ee}from"./chunk-VLC24QVT.js";import"./chunk-CIFVUX3B.js";import{a as w,b as te}from"./chunk-OSALXGD4.js";import{a as oe}from"./chunk-427OQS2N.js";import{d as Q}from"./chunk-NVGBE2DR.js";import{a as z}from"./chunk-QHFUDBQH.js";import"./chunk-RGDQMKNJ.js";import{a as j,b as F}from"./chunk-L4JIMNKW.js";import{c as W,e as Y}from"./chunk-MBXWXBDM.js";import"./chunk-IAHKTEET.js";import{e as L,f as A,g as J,h as x}from"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";var ce=new Set(["approve","edit","reject"]);function Ie(k){let{contextDir:f,graph:o,ops:se,by:l}=k,N=k.mintable??oe(),T=W(f);if(o.latestHash!==T)return{record:null,errors:[{code:"STALE_BASIS",detail:`graph opened at ${String(o.latestHash)} but chain head is ${String(T)} \u2014 re-open and retry`}]};let C=[],h=[],M=new Set;for(let e of se){if(o.appliedEvents.has(e.eventId)||M.has(e.eventId)){C.push(e.eventId);continue}M.add(e.eventId),h.push(e)}if(h.length===0)return{record:null,errors:null,applied:[],skipped:C,minted:[],staleDelta:[]};let s=[],$=[],y=[],m=[],I=[],O=[],_=[...k.judgements??[]],D=[],q=new Map,B=new Set,G=[],b=new Set,ie=new Set(N),H=new Set;for(let e of h){if(!ce.has(e.kind))continue;let n=e.target,t=o.resolve(n)?.cid??n;H.has(t)&&s.push({code:"MULTIPLE_TERMINAL_OPS",detail:`${n} has more than one terminal op in this turn \u2014 normalize latest-wins first`}),H.add(t)}let S=(e,n,t)=>{let d=o.resolve(n);if(!d)return s.push({code:"UNKNOWN_NODE",detail:`${e}: ${n} names nothing in the graph`}),null;let p=o.tipOf(d.cid);return p!==t||o.superseded.has(t)?(s.push({code:"EXPECTED_CID_MOVED",detail:`${e}: ${n} moved or was archived since it was displayed`,data:{tip:p}}),null):t};for(let e of h)if(e.kind==="approve"){let n=S("approve",e.target,e.expectedCid);n&&m.push({id:n,kind:"review-item",resolution:"approved",edit:null,reason:null,by:l})}else if(e.kind==="reject"){let n=S("reject",e.target,e.expectedCid);if(!n)continue;if(m.push({id:n,kind:"review-item",resolution:"rejected",edit:null,reason:e.reason,by:l}),e.redirectTo!==void 0){let t=o.resolve(e.redirectTo);if(!t||t.superseded){s.push({code:"UNKNOWN_NODE",detail:`reject.redirectTo: ${e.redirectTo} is not a live node`});continue}I.push({kind:"node",old:n,new:t.cid,reason:e.reason,by:l})}}else if(e.kind==="edit"){let n=S("edit",e.target,e.expectedCid);if(!n)continue;let t=o.getNode(n);if(!t){s.push({code:"UNKNOWN_NODE",detail:`edit: ${e.target} node file unreadable`});continue}let d={...t.content};for(let[r,g]of Object.entries(e.edit))g!==void 0&&(d[r]=g);if(typeof d.title=="string"&&!d.title.trim()){s.push({code:"EMPTY_TITLE",detail:`edit: ${e.target} edited title is empty`});continue}let p=A(t.label,d);if(p.length>0){for(let r of p)s.push({code:r.code,detail:`edit ${e.target}: ${r.detail}`});continue}let c=j(t.label,d);if(c===n){m.push({id:n,kind:"review-item",resolution:"approved",edit:null,reason:null,by:l});continue}$.push({cid:c,label:t.label,content:d}),I.push({kind:"node",old:n,new:c,reason:e.reason??"edited in chat",by:l}),m.push({id:c,kind:"review-item",resolution:"edited",edit:{...e.edit},reason:null,by:l})}else if(e.kind==="enhance"){if(!S("enhance",e.target,e.expectedCid))continue;for(let t of e.edges){let d=o.nodeLabel.get(t.src)??"(unknown)",p=o.nodeLabel.get(t.dst)??"(unknown)";for(let i of x(t.type,d,p,t.props))s.push({code:i.code,detail:`enhance ${e.target}: ${i.detail}`});let c=F(t.type,t.src,t.dst,t.props);if(o.edgesFrom(t.src).some(i=>i.ecid===c)||y.some(i=>i.ecid===c))continue;let r=Z(o,t.type,t.src,t.dst,G);r&&s.push(r);let g=ee(o,t.type,t.src,t.dst);g&&s.push(g);let a=J(t.type)?.cardinality;if(a==="one-live-per-src"||a==="one-live-per-src-and-dst"){let i=`${t.type}|${t.src}`;b.has(i)&&s.push({code:"CARDINALITY_VIOLATION",detail:`${t.type} from ${t.src}: two one-live edges in one turn`}),b.add(i)}if(a==="one-live-per-src-and-dst"){let i=`${t.type}|dst|${t.dst}`;b.has(i)&&s.push({code:"CARDINALITY_VIOLATION",detail:`${t.type} onto ${t.dst}: two one-live edges in one turn (strict 1:1)`}),b.add(i)}y.push({ecid:c,type:t.type,src:t.src,dst:t.dst,props:t.props}),G.push({src:t.src,dst:t.dst,type:t.type})}}else if(e.kind==="add"){if(!ie.has(e.label)){s.push({code:"GATED_LABEL",detail:`add: ${e.label} is not mintable in v1 (gate: ${N.join("|")})`,data:{gate:[...N]}});continue}let n=o.heads.get(e.convSourceId),t=o.convChains.get(e.convSourceId);if(typeof n!="string"||!t){s.push({code:"CONV_SOURCE_MISSING",detail:`add: ${e.convSourceId} is not a live conversation source`});continue}let d=o.getNode(n)?.content?.blob,p=typeof d=="string"?Q(f,d)?.toString("utf8")??"":"",c=te(p,e.cite.turn);if(c===null){s.push({code:"BAD_ANCHOR",detail:`add: ${w(e.cite.turn)} does not resolve in ${e.convSourceId}`});continue}if(!c.includes(e.cite.quote)){s.push({code:"QUOTE_MISMATCH",detail:`add: quote is not verbatim within ${w(e.cite.turn)}`});continue}let r={...e.content,derived:!0},g=A(e.label,r);if(g.length>0){for(let u of g)s.push({code:u.code,detail:`add: ${u.detail}`});continue}let a=j(e.label,r),i={source_id:e.convSourceId,source_cid:n,anchor:w(e.cite.turn),quote:e.cite.quote};for(let u of x(L.DERIVES,"source",e.label,i))s.push({code:u.code,detail:`add: ${u.detail}`});$.push({cid:a,label:e.label,content:r}),y.push({ecid:F("DERIVES",n,a,i),type:L.DERIVES,src:n,dst:a,props:i}),e.rationale&&_.push({about:a,rationale:e.rationale,by:l});let P=typeof r.title=="string"?r.title:typeof r.intent=="string"?r.intent:"",v=P?X(e.label,P,u=>B.has(u)||o.names.has(u)&&!o.superseded.has(o.names.get(u))):null;v!==null&&(B.add(v),O.push({cid:a,slug:v,by:l})),D.push({cid:a,...v!==null?{slug:v}:{}}),q.set(e.eventId,a)}if(s.length)return{record:null,errors:s};let U=new Date().toISOString();for(let e of h){if(e.kind==="add"){let n=q.get(e.eventId);n&&V(f,{ts:U,command:"extract-chat",id:n,verdict:"add",polarity:"preference",tag:e.label,by:l,event_id:e.eventId,target:n});continue}for(let n of ne(e,{ts:U,command:"extract-chat",by:l}))V(f,n)}let K=h.map(e=>e.eventId).sort(),re=Y(f,{ts:new Date().toISOString(),proposal_id:null,nodes:$,edges:y,review:m,supersessions:I,...O.length>0?{names:O}:{},..._.length>0?{judgements:_}:{},event_ids:K,source_head_moves:{}},{expectPrev:T}),R=z(f),E=new Set;for(let e of I)if(e.kind==="node"){E.add(e.old);for(let n of R.edgesInto(e.old))E.add(n.src)}for(let e of D)E.add(e.cid);let de=[...E].map(e=>({cid:e,state:R.stale(R.tipOf(e))})).filter(e=>e.state!=="fresh");return{record:re.record,errors:null,applied:K,skipped:C,minted:D,staleDelta:de}}export{Ie as commitChatTurn};
@@ -0,0 +1,4 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as J,b as X,c as Y,d as Z}from"./chunk-RE3BZVGE.js";import"./chunk-6PS65QFF.js";import{b as P,d as V}from"./chunk-OSALXGD4.js";import{d as K}from"./chunk-NVGBE2DR.js";import"./chunk-L4JIMNKW.js";import"./chunk-MBXWXBDM.js";import"./chunk-IAHKTEET.js";import"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";var re=new Set(["approve","edit","reject"]);function se(r,t){return`chatop:${t}:${r.target??"new"}:${r.op}:${r.seq}`}function oe(r,t,y,c){let u=se(r,t),m=r.payload;switch(r.op){case"approve":return{kind:"approve",target:r.target,expectedCid:r.expected_cid,eventId:u};case"edit":{let{reason:i,...h}=m;return{kind:"edit",target:r.target,expectedCid:r.expected_cid,edit:h,reason:i,eventId:u}}case"enhance":return{kind:"enhance",target:r.target,expectedCid:r.expected_cid,edges:m.edges??[],eventId:u};case"reject":return{kind:"reject",target:r.target,expectedCid:r.expected_cid,reason:m.reason??"",redirectTo:m.redirect_to,eventId:u};case"add":{let i=m.proposal_item??{},h=String(i.label??"");if(!y.mint_gate.includes(h))throw new Error(`GATED_LABEL: cannot mint "${h}" (gate: ${y.mint_gate.join(", ")})`);let d=i.cite??{},a=i.conv_source_id??c;if(!a||typeof d.turn!="number"||!d.quote)throw new Error("INVALID_ADD: a chat add requires a conversation cite {turn, quote} and conv_source_id");return{kind:"add",label:h,content:i.content??{},cite:{turn:d.turn,quote:d.quote},convSourceId:a,rationale:i.rationale,eventId:u}}}}function ee(r,t,y={}){let c=y.turn??0,u=[],m=[];for(let d of r)(d.op==="add"||d.op==="enhance")&&m.push(d);let i=new Map;for(let d of r){if(!re.has(d.op)||!d.target)continue;let a=i.get(d.target)??[];a.push(d),i.set(d.target,a)}for(let[d,a]of i){let b=Math.max(...a.map(_=>_.seq)),C=a.filter(_=>_.seq===b);if(C.length>1){u.push({target:d,seq:b,kinds:C.map(_=>_.op)});continue}m.push(C[0])}return{chatOps:m.sort((d,a)=>d.seq-a.seq).map(d=>oe(d,c,t,y.convSourceId)),ambiguous:u}}function ae(r,t){let y=r.trim();if(y==="")return{kind:"defaults"};if(/^defer$/i.test(y))return{kind:"defer-all"};let c=t.cursor,u=y,m=/^(\d+):\s*(.*)$/.exec(y);if(m){let a=Number(m[1]);if(a<1||a>t.questions.length)return{kind:"invalid",target:null,message:`no question ${a} \u2014 this batch has ${t.questions.length}`};if(c=a-1,u=m[2].trim(),!u)return{kind:"invalid",target:c,message:`say what to answer \u2014 e.g. \`${a}: yes\``}}if(c<0||c>=t.questions.length)return{kind:"invalid",target:null,message:"no pending question to answer"};let i=t.questions[c],h=/^"(.*)"$/.exec(u);if(h)return i.allow_free_text?{kind:"free",target:c,text:h[1]}:{kind:"invalid",target:c,message:`question ${c+1} takes an option (1-${i.options.length}) \u2014 free text isn't allowed here`};if(i.multi_select&&/^\d+(\s+\d+)+$/.test(u)){let a=u.split(/\s+/).map(Number);if(a.every(b=>b>=1&&b<=i.options.length))return{kind:"multi",target:c,indices:a.map(b=>b-1)}}if(/^\d+$/.test(u)){let a=Number(u);if(a>=1&&a<=i.options.length)return{kind:"option",target:c,index:a-1}}let d=i.options.findIndex(a=>a.label.toLowerCase()===u.toLowerCase());return d>=0?{kind:"option",target:c,index:d}:i.allow_free_text?{kind:"free",target:c,text:u}:{kind:"invalid",target:c,message:`question ${c+1} takes an option \u2014 type 1-${i.options.length} or an option name`}}function te(r){let t=r.text.replace(/\?+\s*$/,"");return t.length<=36?t:`${t.slice(0,33)}\u2026`}function ue(r){return r.use_cases??[]}var de={acs:"acceptance criteria",scenarios:"scenarios",tests:"tests",gaps:"gaps"};function ce(r){let t=[],y=[],c=(i,h)=>{h.length!==0&&(y.push(i),t.push(...h))},u=i=>typeof i=="string"&&/^[a-z]{1,4}\d{1,4}$/i.test(i)?i:null,m=i=>{let h=u(i.automates)??"1 scenario",d=i.verifies??[],a=d.map(u).filter(_=>_!==null).slice(0,2),b=d.length-a.length,C=a.length?`${a.join(" ")}${b>0?` +${b}`:""}`:`${d.length} ACs`;return`covers ${h} \xB7 verifies ${C}`};return c("acs",(r.acs??[]).map(i=>({temp_ref:i.temp_ref,title:i.text,kind:"ac",badge:String(i.kind),extra:{...i.expected_answer?{expects:`${String(i.expected_answer.operator??"")} \xB7 ${String(i.expected_answer.operand??"")}`}:{},"scoped to":i.scoped_to??"(use-case)"}}))),c("scenarios",(r.scenarios??[]).map(i=>({temp_ref:i.temp_ref,title:i.title,kind:"scenario",badge:i.case_type,why:i.intent,depends_on_hint:i.depends_on??[],extra:{technique:i.technique_notes}}))),c("tests",(r.tests??[]).map(i=>({temp_ref:i.temp_ref,title:i.title,kind:"test",why:m(i),depends_on_hint:i.reuses??[],extra:{automates:String(i.automates??"?"),verifies:(i.verifies??[]).join(", "),check:i.check?`${String(i.check.kind)} vs ${String(i.check.verified_against)}`:"?"}}))),c("gaps",(r.gaps??[]).map(i=>({temp_ref:i.temp_ref??i.ref??"?",title:String(i.question?.header??i.kind),kind:"gap",badge:i.kind,why:i.risk_rationale}))),{items:t,heading:y.join(" + ")||"design"}}function ke(r={}){let t={turns:[],thinking:X(),pending:null,confirm:null,status:"idle",ledger:[],activeTurn:null,stream:null,checkpoint:!1},y=e=>{let n=[],o=e.minted.map(p=>p.slug).filter(Boolean);o.length&&n.push(`added ${o.join(", ")}`);let s=e.applied.length-e.minted.length;return s>0&&n.push(`${s} change${s===1?"":"s"} applied`),e.staleDelta.length&&n.push(`stales ${e.staleDelta.length}`),n.join(" \xB7 ")||"no changes"},c=[];r.onRender&&c.push(r.onRender);let u=0,m=0,i=null,h=null,d=null,a=[],b=0,C=e=>{if(!(!d||!r.contextDir||!e.trim()))try{let n=r.refreshGraph?.()??r.graph;if(!n)return;V({contextDir:r.contextDir,graph:n,sourceId:d,text:e,by:r.by??{kind:"human",id:"owner"}})}catch{}},_=e=>{if(!d||!r.contextDir)return;let n=r.refreshGraph?.()??r.graph,o=n?.heads.get(d),s=n?.convChains.get(d);if(!n||typeof o!="string"||!s)return;let p=n.getNode(o)?.content?.blob,f=typeof p=="string"?K(r.contextDir,p)?.toString("utf8")??"":"";if(f)for(let v of e){if(v.kind!=="add"||v.convSourceId!==d)continue;let O=P(f,v.cite.turn);if(!(O!==null&&O.includes(v.cite.quote)))for(let $=s.turns;$>=1;$--){let L=P(f,$);if(L!==null&&L.includes(v.cite.quote)){v.cite={...v.cite,turn:$};break}}}},j=null,E=new Map,Q=new Map,B=null,x=()=>{I&&(clearTimeout(I),I=null);for(let e of c)e()},I=null,W=()=>{I||(I=setTimeout(()=>{I=null;for(let e of c)e()},80))},l=e=>{t.ledger.push(e)},D=null,M=!1,A=(e=!1)=>{D?l({kind:"agent",text:D}):e&&M&&l({kind:"note",text:'chat to refine ("looks good" approves; /done finishes)'}),D=null,M=!1},ne=()=>{D=null,M=!1},R=()=>{t.activeTurn&&(t.activeTurn=null)},G=(e,n)=>n.choice||(n.selected_index!=null?e.options[n.selected_index]?.label??"?":"?"),U=()=>{let e=t.pending;if(!e)return;if(!e.resolution.every(Boolean)){e.cursor=e.resolution.findIndex(s=>s===null);return}let n=e.questions.map((s,p)=>{let f=e.resolution[p];return f.form==="deferred"?{id:s.id,selected_index:null,free_text:null}:f.free_text!=null?{id:s.id,selected_index:null,free_text:f.free_text}:{id:s.id,selected_index:f.selected_index,free_text:null}});t.pending=null,t.status=t.status==="pausing"?"pausing":"streaming";let o=j;j=null,o?.(n)},T=(e,n)=>{let o=t.pending,s=o.questions[e],p=o.resolution[e];o.resolution[e]=n;let f=te(s);p?l({kind:"answer",receipt:{form:"changed",qNum:e+1,stub:f,choice:G(s,n),prev:p.choice}}):n.form==="deferred"?l({kind:"answer",receipt:{form:"deferred",qNum:e+1,stub:f}}):l({kind:"answer",receipt:{form:n.form,qNum:e+1,stub:f,choice:G(s,n)}})},N=()=>{let e=t.pending;e&&(e.questions.forEach((n,o)=>{e.resolution[o]||T(o,{form:"deferred",selected_index:null,free_text:null,choice:""})}),U())},F=e=>({questions:e,cursor:0,resolution:e.map(()=>null)}),ie=e=>{let n=t.pending;t.notice=void 0;let o=ae(e,n);switch(o.kind){case"invalid":t.notice=o.message;return;case"defaults":{let s=!1;if(n.questions.forEach((p,f)=>{if(!n.resolution[f]){if(p.risk==="high"){s=!0;return}T(f,{form:"assumed",selected_index:p.recommended_index,free_text:null,choice:p.options[p.recommended_index]?.label??"?"})}}),s){n.cursor=n.questions.findIndex((p,f)=>!n.resolution[f]),t.notice="high-risk questions need an explicit answer (or type 'defer' to leave them with the agent)";return}break}case"defer-all":N();return;case"option":{let s=n.questions[o.target];T(o.target,{form:"answered",selected_index:o.index,free_text:null,choice:s.options[o.index]?.label??String(o.index+1)});break}case"free":T(o.target,{form:"answered",selected_index:null,free_text:o.text,choice:o.text});break;case"multi":{let s=n.questions[o.target],p=o.indices[0];T(o.target,{form:"answered",selected_index:p,free_text:null,choice:s.options[p]?.label??String(p+1)}),t.notice="multi-select not yet supported end-to-end \u2014 sent your first choice";break}}U()};return{state:t,explainRef(e){if(!r.explain||!r.graph||r.contextDir===void 0){l({kind:"note",text:"explain isn't available here"}),x();return}let n=r.explain(r.contextDir,r.graph,e),o=n.target?[`${n.target.label} ${n.target.slug??n.target.cid.slice(0,19)}:`,...n.entries.map(s=>` [${s.kind}] ${s.rationale??s.detail}`)].join(`
3
+ `):`unknown ref: ${e}`;l({kind:"note",text:o}),x()},subscribe(e){return c.push(e),()=>{let n=c.indexOf(e);n>=0&&c.splice(n,1)}},submit(e){if(t.confirm&&(t.confirm=null),t.pending){ie(e),x();return}if(!i){t.turns.push({role:"user",text:e}),l({kind:"user",text:e}),t.notice="the agent isn't running \u2014 nothing sent",x();return}for(t.notice=void 0,t.checkpoint=!1,A(),t.turns.push({role:"user",text:e}),l({kind:"user",text:e}),C(e),t.status="streaming",t.busySince=Date.now(),t.error=void 0,m+=1;a.length>0;)m+=1,i({type:"user_message",message_id:`u${m}-receipt`,text:a.shift()});i({type:"user_message",message_id:`u${m}`,text:e}),x()},attachSender(e){i=e},attachOnCommitted(e){h=e},attachConversationSource(e){d=e},holdReceipt(e){a.push(e),t.checkpoint=!0,x()},drainHeldReceipts(){return a.splice(0,a.length)},reopenQuestion(){let e=t.pending;if(!e)return;let n=e.cursor<0?e.questions.length:e.cursor;for(let o=n-1;o>=0;o--)if(e.resolution[o]){e.cursor=o,x();return}},continueParked(){if(!(!i||a.length===0)){for(t.checkpoint=!1,l({kind:"continued"});a.length>0;)m+=1,i({type:"user_message",message_id:`u${m}-receipt`,text:a.shift()});m+=1,i({type:"user_message",message_id:`u${m}`,text:"continue"}),t.status="streaming",t.busySince=Date.now(),x()}},note(e){l({kind:"note",text:e}),x()},registerAliases(e){for(let n of e)Q.set(n.ref,n.cid)},setWorking(e){if(e!=null){if(t.status!=="idle"&&t.status!=="working")return;t.status==="idle"&&(t.busySince=Date.now()),t.status="working",t.workingLabel=e}else{if(t.status!=="working")return;t.status="idle",t.workingLabel=void 0}x()},ledger(e){(e.kind==="pause"||e.kind==="error"||e.kind==="summary")&&(R(),A()),(e.kind==="summary"||e.kind==="pause")&&(t.stream=null),l(e),e.kind==="commit"&&(e.ok?A(!0):ne()),x()},completeSession(){N(),i?.({type:"session_complete"}),t.status="idle",x()},requestPause(){N(),t.status="pausing";let e=i;Promise.resolve().then(()=>e?.({type:"pause"})),x()},ask(e){return t.pending=F(e),E=new Map(e.map((n,o)=>[n.id,o+1])),t.status="awaiting-input",x(),new Promise(n=>{j=n})},noteCoercion(e,n){l({kind:"answer",receipt:{form:"assumed",qNum:E.get(e.id)??0,stub:te(e),choice:n,note:"your typed answer couldn't be used here"}}),x()},onAgentEvent(e){switch(e.type){case"reasoning_delta":case"reasoning_done":case"tool_activity":case"decision_activity":{let n=t.thinking;if(t.thinking=Z(n,e),t.thinking!==n){if(e.type==="reasoning_done"&&e.present)l({kind:"thinking",tookMs:e.took_ms});else if(e.type==="tool_activity"&&e.status!=="started")l({kind:"tool",name:e.name,status:e.status==="done"?"ok":e.status,detail:e.detail});else if(e.type==="decision_activity"){let o=`\xB7 ${Y(e)}`,s=t.ledger[t.ledger.length-1];s&&s.kind==="note"&&s.text===o||l({kind:"note",text:o})}}if(e.type==="reasoning_delta"){W();return}break}case"usage":t.credits={turn:e.credits,total:e.total_credits};break;case"text_delta":{let n=B;if(n&&(e.turn_id<n.turn_id||e.turn_id===n.turn_id&&e.attempt<n.attempt))return;(!n||n.turn_id!==e.turn_id||n.attempt!==e.attempt)&&(B={turn_id:e.turn_id,attempt:e.attempt},t.stream={text:""}),t.stream={text:(t.stream?.text??"")+e.text},W();return}case"progress":break;case"proposal":{u+=1,R(),t.stream=null,t.busySince&&(l({kind:"note",text:`\u2713 done in ${Math.max(1,Math.round((Date.now()-t.busySince)/1e3))}s`}),t.busySince=void 0);let n=ue(e.proposal),o=r.dedupFlags?.(e.proposal);if(o)for(let s of n){let p=o.get(s.temp_ref);p&&(s.matches_existing=p)}t.turns.push({role:"agent",turnIndex:u,items:n,text:e.narrative}),D=e.narrative??null,M=!0,t.activeTurn={turnIndex:u,heading:"use-cases",items:n},l({kind:"turn",turnIndex:u,heading:"use-cases",items:n}),(t.status==="streaming"||t.status==="working")&&(t.status="idle"),t.workingLabel=void 0;break}case"design":{u+=1,R(),t.stream=null,t.busySince&&(l({kind:"note",text:`\u2713 done in ${Math.max(1,Math.round((Date.now()-t.busySince)/1e3))}s`}),t.busySince=void 0);let{items:n,heading:o}=ce(e.design),s=o.split(" + ").map(p=>de[p]??p).join(" + ");l({kind:"banner",text:`designing: ${s}`}),t.turns.push({role:"agent",turnIndex:u,items:n,itemsHeading:o,text:e.narrative}),D=e.narrative??null,M=!0,t.activeTurn={turnIndex:u,heading:o,items:n},l({kind:"turn",turnIndex:u,heading:o,items:n}),(t.status==="streaming"||t.status==="working")&&(t.status="idle"),t.workingLabel=void 0;break}case"ask_user":t.pending=F(e.questions),t.status="awaiting-input";break;case"chat_ops":{u+=1,R(),t.stream=null,t.status==="streaming"&&(t.status="idle");let n=e.chat_ops??e,o=Array.isArray(n.ops)?n.ops:[],s=n.text??e.text??"",p=r.refreshGraph?.()??r.graph,f=g=>Q.get(g)??g,v=o.map(g=>{if(!g.target)return g;let k=f(g.target),w=g.expected_cid;if(w==null&&p){let H=p.resolve(k);H&&(w=p.tipOf(H.cid))}let S=g.payload?.redirect_to,q=S&&f(S);return k===g.target&&w===g.expected_cid&&q===S?g:{...g,target:k,expected_cid:w,...q!==S?{payload:{...g.payload,redirect_to:q}}:{}}}),O;try{if(!Array.isArray(n.ops))throw new Error("the agent sent an unreadable change set (no ops array) \u2014 say it again in different words");O=ee(v,r.descriptor??{mint_gate:[]},{turn:u,...d?{convSourceId:d}:{}})}catch(g){t.error=g instanceof Error?g.message:String(g),t.turns.push({role:"agent",turnIndex:u,text:s,narration:t.error}),s&&l({kind:"agent",text:s}),l({kind:"error",title:t.error,detail:[]});break}let{chatOps:$,ambiguous:L}=O;if(L.length>0){let g=L[0];t.confirm={kind:"ambiguity-confirm",prompt:`did you mean edit or ${g.kinds.filter(k=>k!=="edit").join("/")} on ${g.target}?`},t.turns.push({role:"agent",turnIndex:u,text:s}),s&&l({kind:"agent",text:s});break}if(_($),r.commitChatTurn&&$.length>0){let g=r.commitChatTurn({contextDir:r.contextDir??"",graph:r.refreshGraph?.()??r.graph,ops:$,by:r.by??{kind:"human",id:"owner"},...r.descriptor?.mint_gate?{mintable:r.descriptor.mint_gate}:{}});if(g.errors)t.error=g.errors.map(k=>k.detail).join("; "),t.turns.push({role:"agent",turnIndex:u,text:s}),l({kind:"commit",ok:!1,line:"commit failed \u2014 nothing landed",warnings:g.errors.map(k=>`${k.code}: ${k.detail}`)}),a.push(["COMMIT FAILED (chat turn) \u2014 nothing landed; do not assume any of your last ops applied.",...g.errors.map(k=>`- ${k.code}: ${k.detail}`),...g.errors.some(k=>k.code==="UNKNOWN_FIELD")?["If you were changing citations or matched-existing content, that is proposal territory (approve/re-propose) \u2014 a chat edit can only replace a node's own schema fields."]:[]].join(`
4
+ `)),s&&l({kind:"agent",text:s});else{g.applied.length>0&&r.session?.markApplied(g.applied);let k=y(g);t.turns.push({role:"agent",turnIndex:u,text:s,narration:k}),l({kind:"commit",ok:!0,line:k});let w=r.refreshGraph?.();if(w&&h&&h(w),w)try{b+=1;let z=r.descriptor?.mint_gate?.includes("usecase")?"extract":"design",S=J({verb:z,commitN:b,phase:"chat",committed:g.minted.map(q=>({cid:q.cid,...q.slug?{logical_id:q.slug}:{}}))},w);a.push(S.text)}catch{}s&&l({kind:"agent",text:s})}}else t.turns.push({role:"agent",turnIndex:u,text:s}),s&&l({kind:"agent",text:s});C(s);break}case"done":case"session_complete":R(),A(),t.status="idle",i=null;break;case"error":R(),A(),t.stream=null,t.status="idle",t.error=e.message,i=null,l({kind:"error",title:e.message,detail:[]});break;case"session_paused":break;default:break}x()}}}export{ke as makeChatController,ae as parseAnswerInput,te as questionStub};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{c as sn}from"./chunk-GLS46X7N.js";import{c as Tt,d as Qr}from"./chunk-EWTX7HSU.js";import{d as Wr}from"./chunk-2YQ6TW77.js";import{a as Lt,b as Zr,c as et,d as tt,e as Xr,f as Dt,g as rn,h as nn}from"./chunk-RHNKYNNZ.js";import{a as Te,b as ne,e as _e,f as xt,k as Yr,p as he,q as Pt,t as Jr}from"./chunk-RKWJG3WW.js";import{b as Se}from"./chunk-6XHAXAL2.js";import{a as Ze,b as At}from"./chunk-5JJ245FW.js";import{a as Or,b as Et}from"./chunk-D7L6UW5Z.js";import{a as Le,b as en}from"./chunk-C5UNZ6ZY.js";import{c as tn}from"./chunk-S3DAAAE5.js";import{a as we}from"./chunk-WAOCHXJ5.js";import{B as jr,C as Fr,D as Nr,F as $r,G as Mr,I as Vr,J as Kr,K as Hr,X as qr,aa as Gr,ba as zr,j as Xe,x as Ur}from"./chunk-4A6BLXQN.js";import{a as Br}from"./chunk-BC7UVJJB.js";import{a as xr,c as kt,d as Ct,e as Qe,f as Pr,g as Tr}from"./chunk-M5JQXOCE.js";import{g as Lr,h as Dr}from"./chunk-2BWRAY3Y.js";import{a as Je}from"./chunk-2WVKOZ6W.js";import{a as We,b as Ar}from"./chunk-NLCCBXXV.js";import{a as M}from"./chunk-RZ4F3BHX.js";import{a as re}from"./chunk-AKHUNBQS.js";import{a as Cr}from"./chunk-E47GFYXA.js";import{a as ze,c as _t,j as Er,k as Ye,l as It,m as Rt}from"./chunk-6SGPN76K.js";import{join as le,basename as as}from"path";import{existsSync as Ro,readFileSync as cs}from"fs";function on(e,t){if(process.env.KANE_REPLAY_TRACE==="1")for(let r=0;r<e.steps.length;r++){let n=e.steps[r],s=t[r],o=" ".repeat(n.trace.length-1),i=`step ${n.flatIndex}`;s.kind==="replay"?process.stderr.write(`[replay-trace] ${o}${i}: REPLAY (would skip; v1 always authors)
2
+ import{c as sn}from"./chunk-GLS46X7N.js";import{c as Tt,d as Qr}from"./chunk-TSWGQKUK.js";import{d as Wr}from"./chunk-2YQ6TW77.js";import{a as Lt,b as Zr,c as et,d as tt,e as Xr,f as Dt,g as rn,h as nn}from"./chunk-RHNKYNNZ.js";import{a as Te,b as ne,e as _e,f as xt,k as Yr,p as he,q as Pt,t as Jr}from"./chunk-RKWJG3WW.js";import{b as Se}from"./chunk-SK2GVMTJ.js";import{a as Ze,b as At}from"./chunk-6EC54ZHT.js";import{a as Or,b as Et}from"./chunk-NEHF4C6X.js";import{a as Le,b as en}from"./chunk-C5UNZ6ZY.js";import{c as tn}from"./chunk-S3DAAAE5.js";import{a as we}from"./chunk-WAOCHXJ5.js";import{B as jr,C as Fr,D as Nr,F as $r,G as Mr,I as Vr,J as Kr,K as Hr,X as qr,aa as Gr,ba as zr,j as Xe,x as Ur}from"./chunk-YZBLBPOE.js";import{a as Br}from"./chunk-BC7UVJJB.js";import{a as xr,c as kt,d as Ct,e as Qe,f as Pr,g as Tr}from"./chunk-M5JQXOCE.js";import{g as Lr,h as Dr}from"./chunk-TTJ4XMWP.js";import{a as Je}from"./chunk-2WVKOZ6W.js";import{a as We,b as Ar}from"./chunk-NLCCBXXV.js";import{a as M}from"./chunk-RZ4F3BHX.js";import{a as re}from"./chunk-3NR6OTHL.js";import{a as Cr}from"./chunk-E47GFYXA.js";import{a as ze,c as _t,j as Er,k as Ye,l as It,m as Rt}from"./chunk-NMKZHHB6.js";import{join as le,basename as as}from"path";import{existsSync as Ro,readFileSync as cs}from"fs";function on(e,t){if(process.env.KANE_REPLAY_TRACE==="1")for(let r=0;r<e.steps.length;r++){let n=e.steps[r],s=t[r],o=" ".repeat(n.trace.length-1),i=`step ${n.flatIndex}`;s.kind==="replay"?process.stderr.write(`[replay-trace] ${o}${i}: REPLAY (would skip; v1 always authors)
3
3
  `):process.stderr.write(`[replay-trace] ${o}${i}: AUTHOR (${s.reason})
4
4
  `)}}function Ie(e){process.env.KANE_REPLAY_TRACE==="1"&&process.stderr.write(e)}function an(e,t){let r=e===0?"(none)":`0..${e-1}`,n=e>=t?"(none)":`${e}..${t-1}`;Ie(`[replay-trace] phase: replay ${r}, author ${n}
5
5
  `)}function ln(e,t){Ie(`[replay-trace] step ${e}: REPLAY ${t==="ok"?"OK":"FAILED"}
@@ -44,7 +44,7 @@ import{c as sn}from"./chunk-GLS46X7N.js";import{c as Tt,d as Qr}from"./chunk-EWT
44
44
  `);else if(_r&&(_||m.isFirstRun))process.stderr.write(`note: --no-evidence-publish has no effect on author/commit runs
45
45
  `);else if(Ir){let d=c.basicAuth,u=L,p=F,b=await ss({controller:new we(A.controllerBaseUrl,{username:d.username,accessKey:d.access_key}),tms:new Je(A.tmsBaseUrl,c.resolvedCreds?.username??d.username,c.resolvedCreds?.access_key??d.access_key),testId:m.testId,sessionId:l.sessionId,executionId:u.executionId,sealedPackPath:Z.pack,projectId:p});b.ok?l.log("info","EVIDENCE_INGESTED","Replay evidence uploaded and ingested",{execution_id:u.executionId,project_id:p}):(l.log("warn","EVIDENCE_PUBLISH_FAILED","Replay evidence publish failed",{execution_id:u.executionId,stage:b.stage,error:b.error}),process.stderr.write(` \u26A0 evidence publish failed (${b.stage}): ${b.error}
46
46
  `)),t.onAgentEvent({type:"test_md_evidence_ingest",status:b.ok?"ok":"failed",evidence_id:u.executionId,...b.ok?{}:{stage:b.stage}})}await Lo(n,m,l,z.outcomes,z.overallStatus,Ve,ge,oe.uploadResult,j,o,{resolvedAuth:c,tmsBaseUrl:A.tmsBaseUrl},_,J);try{let d=he(n);if(Qr({shouldUploadPipeline:He,uploadSucceeded:!!oe.uploadResult?.success,metaCommitId:d?.commit_id,metaTestId:d?.test_id})){let u=await Tt({sourcePath:n,testId:d.test_id,sessionId:l.sessionId,commitId:d.commit_id,controller:new we(A.controllerBaseUrl,{username:c.basicAuth.username,accessKey:c.basicAuth.access_key})});u.ok?l.log("info","BUNDLE_SYNC_OK","testmd bundle pushed",{commit_id:d.commit_id,bytes:u.bytes}):(l.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync failed",{commit_id:d.commit_id,stage:u.stage,error:u.error}),process.stderr.write(` \u26A0 bundle sync failed (${u.stage}): ${u.error}
47
- `)),t.onAgentEvent({type:"test_md_bundle_sync",status:u.ok?"ok":"failed",commit_id:d.commit_id,path:n,...u.ok?{bytes:u.bytes}:{stage:u.stage}})}}catch(d){l.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync threw",{error:d instanceof Error?d.message:String(d)})}if(He&&oe.uploadResult?.success)for(let d of m.unitLocks)try{let u=he(d.file);if(u?.commit_id!==l.sessionId||!u?.test_id)continue;let p=await Tt({sourcePath:d.file,testId:String(u.test_id),sessionId:l.sessionId,commitId:String(u.commit_id),controller:new we(A.controllerBaseUrl,{username:c.basicAuth.username,accessKey:c.basicAuth.access_key})});p.ok?l.log("info","BUNDLE_SYNC_OK","unit bundle pushed",{commit_id:u.commit_id,path:d.file,bytes:p.bytes}):l.log("warn","BUNDLE_SYNC_FAILED","unit bundle sync failed",{commit_id:u.commit_id,path:d.file,stage:p.stage,error:p.error}),t.onAgentEvent({type:"test_md_bundle_sync",status:p.ok?"ok":"failed",commit_id:u.commit_id,path:d.file,...p.ok?{bytes:p.bytes}:{stage:p.stage}})}catch(u){l.log("warn","BUNDLE_SYNC_FAILED","unit bundle sync threw",{path:d.file,error:u instanceof Error?u.message:String(u)})}let Rr=re(w),qe=oe.uploadResult?.testcaseId,Ge=qe&&oe.uploadResult?.shareId&&F?ot(Rr.testManagerUiUrl,F,qe,oe.uploadResult.shareId):void 0,Ss=a.unitFiles.filter(d=>d.file!==a.rootPath).map(d=>{let u=a.steps.filter(g=>g.owningFile===d.file),p=u.filter(g=>ce.has(g.flatIndex)).length,h=(d.kind==="test"?he(d.file):null)?.commit_id===l.sessionId;return{path:d.file,kind:d.kind,replayed:u.length-p,authored:p,committed:h,...h?{commit_id:l.sessionId}:{}}}),kr={overallStatus:z.overallStatus,durationS:ge,decisions:m.decisions,outcomes:z.outcomes,cancelled:J,retryTriggered:X,lockHeld:_,anyAuthorStepRan:D,isFirstRun:m.isFirstRun,wantsPush:o.push===!0,uploadResult:oe.uploadResult,shouldUploadArtifacts:ve,shouldReplaceLocalOutput:D&&!J,shouldCommit:(_||m.isFirstRun)&&!J&&z.overallStatus==="passed"&&!m.degradedReadonly,shareUrl:Ge,imports:Ss},{buildSummaryEvent:ws}=await import("./SummaryBox-4T545XRB.js");if(i?t.onAgentEvent(ws(kr)):await t.onSummary(kr),!i){let d=qe&&F?Ln(Rr.testManagerUiUrl,F,qe):void 0;await t.onLinks({recordedTestPath:n,outputDir:ne(n),shareableLink:Ge,testCaseLink:d,codeExportDir:oe.uploadResult?.codeExportDir})}if(ae.ownsLifecycle&&Z&&wr){let{offerEvidenceView:d}=await import("./evidence-7VE5EGEF.js");await d({packPath:Z.pack,env:w,isTTY:!i&&!J&&!!process.stdin.isTTY&&!!process.stderr.isTTY,log:u=>process.stderr.write(u+`
47
+ `)),t.onAgentEvent({type:"test_md_bundle_sync",status:u.ok?"ok":"failed",commit_id:d.commit_id,path:n,...u.ok?{bytes:u.bytes}:{stage:u.stage}})}}catch(d){l.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync threw",{error:d instanceof Error?d.message:String(d)})}if(He&&oe.uploadResult?.success)for(let d of m.unitLocks)try{let u=he(d.file);if(u?.commit_id!==l.sessionId||!u?.test_id)continue;let p=await Tt({sourcePath:d.file,testId:String(u.test_id),sessionId:l.sessionId,commitId:String(u.commit_id),controller:new we(A.controllerBaseUrl,{username:c.basicAuth.username,accessKey:c.basicAuth.access_key})});p.ok?l.log("info","BUNDLE_SYNC_OK","unit bundle pushed",{commit_id:u.commit_id,path:d.file,bytes:p.bytes}):l.log("warn","BUNDLE_SYNC_FAILED","unit bundle sync failed",{commit_id:u.commit_id,path:d.file,stage:p.stage,error:p.error}),t.onAgentEvent({type:"test_md_bundle_sync",status:p.ok?"ok":"failed",commit_id:u.commit_id,path:d.file,...p.ok?{bytes:p.bytes}:{stage:p.stage}})}catch(u){l.log("warn","BUNDLE_SYNC_FAILED","unit bundle sync threw",{path:d.file,error:u instanceof Error?u.message:String(u)})}let Rr=re(w),qe=oe.uploadResult?.testcaseId,Ge=qe&&oe.uploadResult?.shareId&&F?ot(Rr.testManagerUiUrl,F,qe,oe.uploadResult.shareId):void 0,Ss=a.unitFiles.filter(d=>d.file!==a.rootPath).map(d=>{let u=a.steps.filter(g=>g.owningFile===d.file),p=u.filter(g=>ce.has(g.flatIndex)).length,h=(d.kind==="test"?he(d.file):null)?.commit_id===l.sessionId;return{path:d.file,kind:d.kind,replayed:u.length-p,authored:p,committed:h,...h?{commit_id:l.sessionId}:{}}}),kr={overallStatus:z.overallStatus,durationS:ge,decisions:m.decisions,outcomes:z.outcomes,cancelled:J,retryTriggered:X,lockHeld:_,anyAuthorStepRan:D,isFirstRun:m.isFirstRun,wantsPush:o.push===!0,uploadResult:oe.uploadResult,shouldUploadArtifacts:ve,shouldReplaceLocalOutput:D&&!J,shouldCommit:(_||m.isFirstRun)&&!J&&z.overallStatus==="passed"&&!m.degradedReadonly,shareUrl:Ge,imports:Ss},{buildSummaryEvent:ws}=await import("./SummaryBox-36MDDDYQ.js");if(i?t.onAgentEvent(ws(kr)):await t.onSummary(kr),!i){let d=qe&&F?Ln(Rr.testManagerUiUrl,F,qe):void 0;await t.onLinks({recordedTestPath:n,outputDir:ne(n),shareableLink:Ge,testCaseLink:d,codeExportDir:oe.uploadResult?.codeExportDir})}if(ae.ownsLifecycle&&Z&&wr){let{offerEvidenceView:d}=await import("./evidence-E5B24ZO6.js");await d({packPath:Z.pack,env:w,isTTY:!i&&!J&&!!process.stdin.isTTY&&!!process.stderr.isTTY,log:u=>process.stderr.write(u+`
48
48
  `)})}return t.onAgentEvent({type:"test_md_done",overall_status:z.overallStatus,duration_s:ge,session_id:l.sessionId,...Ge?{share_url:Ge}:{}}),{overallStatus:z.overallStatus,exitCode:z.overallStatus==="passed"?0:1,outputDir:ne(n),durationS:ge,uploadResult:oe.uploadResult,anyAuthorStepRan:D,resultCode:Ur(Ke),...St.length?{pendingInvestigations:St}:{}}}function Ao(e,t){let r={...e,...t},n=Object.keys(r).length>0?Se(r,""):{variables:{},objective:"",keyMap:{}};return{raw:r,auteur:n.variables,auteurObjective:"",secretEntries:Object.entries(r).filter(([,s])=>s.secret),nonSecretEntries:Object.entries(r).filter(([,s])=>!s.secret)}}function Ce(e,t,r){let n={...e,...t??{}};if(Object.keys(n).length===0)return{raw:n,variables:{},objective:r};let s=Se(n,r);return{raw:n,variables:qn(s.variables,s.objective),objective:s.objective}}function xo(e,t,r){let n=Ce(e,t,r).variables;return Object.keys(n).length>0?n:void 0}function ls(e,t){let r=new Set(dt),n={...e};for(let[s,o]of Object.entries(t))r.has(s)||s!=="variables"&&o!==void 0&&e[s]===void 0&&(n[s]=o);return n}function Po(e,t){return e.length<=t?e:e.slice(0,t-1)+"\u2026"}async function To(e,t,r,n,s,o){let i=Zr(t);on(t,i);let f=_e(e),a=Ro(f)?JSON.parse(cs(f,"utf8")):null,c=a?.testcase_id,y=a?.test_id,w=a?.commit_id,A=r.push===!0,R=r.retry===!0||r.retryCount!==void 0,x=r.author===!0;A&&!c&&process.stderr.write(`[--push] no meta.json yet \u2014 flag is a no-op on first run
49
49
  `),x&&(c=void 0,y=void 0,w=void 0);let k=n.resolvedAuth.basicAuth;if(!k){let N=await n.resolvedAuth.resolver.resolve(!0);N?.username&&N?.access_key&&(k={username:N.username,access_key:N.access_key},n.resolvedAuth.basicAuth=k)}let C=!!k,l=!r.local&&C&&y!=null&&w!=null&&c!=null,H=l&&(et(i)||A);if(A&&!l)return process.stderr.write(`error: --push requires authenticated credentials for the lock API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.
50
50
  `),{resolved:t,decisions:i,testId:y,testcaseId:c,fromCommitId:w,newCommitId:null,isFirstRun:!1,hasAuth:C,canLock:l,lockAcquired:!1,unitLocks:[],degradedReadonly:!1,abort:{exitCode:2}};if(R&&!l)return process.stderr.write(`error: --retry requires authenticated credentials for the lock API. Run 'kane-cli login' (OAuth) or pass --username/--access-key inline.