@testmuai/kane-cli 0.6.2 → 0.6.4
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.
- package/dist/ChatSurface-VXYU6KFW.js +8 -0
- package/dist/{ChromeProfilePicker-XXNZLSCC.js → ChromeProfilePicker-QWTM7DK6.js} +1 -1
- package/dist/{CliFeedbackPrompt-FJF5INQO.js → CliFeedbackPrompt-6NVWMONO.js} +1 -1
- package/dist/{CliUploadProgress-5E3CCYPZ.js → CliUploadProgress-2YRQLECI.js} +1 -1
- package/dist/{ConfigView-TGVOKOUZ.js → ConfigView-I4R5M7BO.js} +1 -1
- package/dist/EvidenceViewOffer-54GEARRX.js +2 -0
- package/dist/{FolderPicker-T4JB4NNW.js → FolderPicker-5VWBYTAK.js} +1 -1
- package/dist/{HelpView-PSHKI7DD.js → HelpView-OJZW4XWX.js} +1 -1
- package/dist/{InfoBox-PXWJ6BIX.js → InfoBox-TGELGCBR.js} +1 -1
- package/dist/{LinksBox-IUOYRXYO.js → LinksBox-B5EBRY26.js} +1 -1
- package/dist/{ProfilesView-UK5XX5WP.js → ProfilesView-3SJRIBHQ.js} +1 -1
- package/dist/{ProjectPicker-3FE7UFXL.js → ProjectPicker-72HKMBEY.js} +1 -1
- package/dist/{SaveSessionPrompt-P7NF5FDA.js → SaveSessionPrompt-CK5SGNRO.js} +1 -1
- package/dist/SingleShotApp-AJBIWW74.js +2 -0
- package/dist/{SummaryBox-WVR4U3NN.js → SummaryBox-ABB7ST26.js} +1 -1
- package/dist/TestMdRunView-5PMLLLFT.js +2 -0
- package/dist/{WhoamiView-QVXJAVTC.js → WhoamiView-OF354UGC.js} +1 -1
- package/dist/bind-BWILBZGR.js +6 -0
- package/dist/{bridge-I6N3YPXI.js → bridge-LNDJS3HH.js} +1 -1
- package/dist/{changelog-HPSX3L7T.js → changelog-BWCEZQ23.js} +1 -1
- package/dist/{chat-committer-GHDZY5XF.js → chat-committer-ADJJTDUT.js} +1 -1
- package/dist/chat-controller-VAC57IEV.js +3 -0
- package/dist/{chunk-M6DX4ENH.js → chunk-2K4XOHVK.js} +1 -1
- package/dist/{chunk-KHDUQ33H.js → chunk-2PQXEEVY.js} +1 -1
- package/dist/{chunk-NNZV5RCE.js → chunk-3C5GMAM4.js} +1 -1
- package/dist/{chunk-VL2UA23Z.js → chunk-3HEPW6SN.js} +1 -1
- package/dist/{chunk-BKGJGPDN.js → chunk-3WJJ43MT.js} +1 -1
- package/dist/{chunk-4G4HPMR2.js → chunk-4MUHS3UL.js} +1 -1
- package/dist/{chunk-DEYHK6ZC.js → chunk-5CTMOJG4.js} +1 -1
- package/dist/{chunk-6UNTIXFW.js → chunk-5KSB5MOF.js} +1 -1
- package/dist/chunk-5YPBPZUR.js +2 -0
- package/dist/chunk-64LC36AF.js +2 -0
- package/dist/{chunk-HR7AGYV2.js → chunk-64QURIT6.js} +1 -1
- package/dist/{chunk-6XKJH5ZE.js → chunk-652FEDL4.js} +2 -2
- package/dist/{chunk-Z56AWGVY.js → chunk-6AYUSR7X.js} +1 -1
- package/dist/{chunk-VJUIW2ES.js → chunk-6GTOYTCQ.js} +1 -1
- package/dist/chunk-6LRKYF67.js +14 -0
- package/dist/{chunk-AE6SS34N.js → chunk-74RUSHIB.js} +1 -1
- package/dist/chunk-ACEODVSC.js +14 -0
- package/dist/{chunk-44QUA6GV.js → chunk-ADOXYGZE.js} +1 -1
- package/dist/chunk-ANIVHX3P.js +5 -0
- package/dist/{chunk-K2MKBBI4.js → chunk-AXABTFCD.js} +1 -1
- package/dist/{chunk-5ON7QQZO.js → chunk-BNN6ZDJW.js} +10 -10
- package/dist/{chunk-L4AUCQVO.js → chunk-BOO7YXAV.js} +1 -1
- package/dist/{chunk-OZODSY6H.js → chunk-BYUARJE7.js} +1 -1
- package/dist/{chunk-FYOCF7DY.js → chunk-CJJXT5DO.js} +1 -1
- package/dist/{chunk-S6GRW5ZA.js → chunk-CLTANA4L.js} +2 -2
- package/dist/{chunk-NEZ4G7XR.js → chunk-CT2I5KUM.js} +1 -1
- package/dist/{chunk-ZGH7T32S.js → chunk-CY5NDMO7.js} +1 -1
- package/dist/{chunk-YIOWO6WS.js → chunk-DNOBOZPO.js} +1 -1
- package/dist/chunk-DXK55KGR.js +9 -0
- package/dist/{chunk-IDDVO4UV.js → chunk-E3BO7OVR.js} +1 -1
- package/dist/chunk-EHN5HTUD.js +147 -0
- package/dist/{chunk-RGEAEAZB.js → chunk-FJTWJ243.js} +1 -1
- package/dist/{chunk-FOZVXYVG.js → chunk-FV4LLU3T.js} +1 -1
- package/dist/{chunk-CE664P73.js → chunk-GBBVP2JW.js} +1 -1
- package/dist/{chunk-AD46OCZ4.js → chunk-GRB66C5S.js} +1 -1
- package/dist/{chunk-22A2ECA2.js → chunk-GYW7LVVL.js} +1 -1
- package/dist/{chunk-QIE62H3J.js → chunk-HJGUEZLW.js} +1 -1
- package/dist/{chunk-XN7PPLFS.js → chunk-HNE4TDOZ.js} +1 -1
- package/dist/{chunk-2U5DZUC7.js → chunk-I2JUBAPU.js} +1 -1
- package/dist/chunk-IJPFAWBH.js +5 -0
- package/dist/{chunk-TJRBV2V2.js → chunk-IOTJZTHX.js} +3 -3
- package/dist/{chunk-OZM4UU5F.js → chunk-IRRGSC7B.js} +1 -1
- package/dist/{chunk-Z4K4AYEI.js → chunk-IXVR66NS.js} +1 -1
- package/dist/chunk-K5JGCJ2K.js +6 -0
- package/dist/{chunk-D5T4ARTB.js → chunk-MCQXRJGH.js} +1 -1
- package/dist/{chunk-DCYTRYR2.js → chunk-MK2G7VIF.js} +1 -1
- package/dist/{chunk-35SRW4KA.js → chunk-MVF4KRHA.js} +1 -1
- package/dist/{chunk-KGFISJFM.js → chunk-O66EU5UV.js} +1 -1
- package/dist/{chunk-LV5VRSPI.js → chunk-OB6CKLEL.js} +1 -1
- package/dist/{chunk-HUD7SPUF.js → chunk-OLXOZJ7X.js} +1 -1
- package/dist/{chunk-U3JB76QP.js → chunk-PICCLJSO.js} +1 -1
- package/dist/{chunk-PJSCM6JX.js → chunk-POI6DCP6.js} +1 -1
- package/dist/{chunk-D5DEWIAU.js → chunk-PYB2EXRE.js} +2 -2
- package/dist/{chunk-YSK535OI.js → chunk-QNNBNIR7.js} +3 -3
- package/dist/{chunk-B2CIHKXG.js → chunk-QZI43UNV.js} +1 -1
- package/dist/chunk-RE3BZVGE.js +3 -0
- package/dist/{chunk-LMJTY32X.js → chunk-RHNKYNNZ.js} +1 -1
- package/dist/{chunk-ZKYYZ5NO.js → chunk-RN4OSVTG.js} +2 -2
- package/dist/chunk-SJ2KQKOV.js +3 -0
- package/dist/{chunk-FU3OQXFH.js → chunk-STH6I3UB.js} +1 -1
- package/dist/{chunk-N62EM6JX.js → chunk-UZSG54OY.js} +1 -1
- package/dist/{chunk-EK2B2LZK.js → chunk-W36P7S5W.js} +1 -1
- package/dist/{chunk-Q6TVDG3X.js → chunk-WE57PD6K.js} +1 -1
- package/dist/{chunk-52VLJKIN.js → chunk-WFEGGQJ4.js} +1 -1
- package/dist/chunk-WIA7TPK3.js +2 -0
- package/dist/{chunk-LZKUF23A.js → chunk-WT3SMSY5.js} +1 -1
- package/dist/{chunk-KRFGAVYU.js → chunk-XUJ5EPVW.js} +1 -1
- package/dist/{chunk-4PIMEZJW.js → chunk-YI4XULHR.js} +3 -3
- package/dist/{chunk-MHQ6A2QZ.js → chunk-YMSN25DX.js} +1 -1
- package/dist/{chunk-B2PZAB7J.js → chunk-ZG2V2ODK.js} +1 -1
- package/dist/{chunk-GN3SZXZ5.js → chunk-ZQP3MCZW.js} +1 -1
- package/dist/{chunk-GIRXJOJI.js → chunk-ZZLR3O5A.js} +1 -1
- package/dist/{config-KD62VH3R.js → config-OJF53CHL.js} +1 -1
- package/dist/{cover-cmd-Y5L4O4Q3.js → cover-cmd-K3LCXHAQ.js} +1 -1
- package/dist/{credentials-NQNJR4E4.js → credentials-NLJHSVBY.js} +1 -1
- package/dist/descriptor-EHK3DRCZ.js +2 -0
- package/dist/{evidence-FFOI2H3N.js → evidence-UPOFW3XC.js} +1 -1
- package/dist/evolve-cmd-MVALOB3G.js +2 -0
- package/dist/explain-VFIZTHFN.js +2 -0
- package/dist/{explain-cmd-RIDEMDMY.js → explain-cmd-KV5YUXKB.js} +1 -1
- package/dist/{explain-cmd-55WRDIMW.js → explain-cmd-U367SD4N.js} +1 -1
- package/dist/{extract-bind-6UMILP4U.js → extract-bind-SSTKQGTV.js} +2 -2
- package/dist/{extract-cmd-MZR7PHGA.js → extract-cmd-GO4UV7ER.js} +2 -2
- package/dist/{gaps-cmd-P2DRK6FW.js → gaps-cmd-DTVDIOED.js} +1 -1
- package/dist/{gate-FACZRGOC.js → gate-B6C6KLFA.js} +1 -1
- package/dist/{generate-headless-XOBQS6RU.js → generate-headless-2HYMSVN5.js} +2 -2
- package/dist/{headless-io-GXHKDPHB.js → headless-io-PWW6YKH2.js} +1 -1
- package/dist/index.js +43 -43
- package/dist/ingest-C5ANIN7S.js +2 -0
- package/dist/ingest-cmd-LLC5CDQ5.js +3 -0
- package/dist/interactive-bind-Q5TQFQ6N.js +7 -0
- package/dist/{lifecycle-cmd-55NZL3UO.js → lifecycle-cmd-BXE5IMFN.js} +1 -1
- package/dist/{list-cmd-JB2ABACD.js → list-cmd-KBWPYJMV.js} +1 -1
- package/dist/{list-commands-PDTISP6T.js → list-commands-6WDXAECV.js} +1 -1
- package/dist/{logical-ids-ATVR6PF2.js → logical-ids-3Y6RX5C2.js} +1 -1
- package/dist/login-flow-XQMJFC4H.js +2 -0
- package/dist/{maintenance-cmd-E3HEEVQW.js → maintenance-cmd-VS3APIUN.js} +1 -1
- package/dist/{persist-recorded-session-5UNUINWF.js → persist-recorded-session-KHIMN4A3.js} +1 -1
- package/dist/pipeline-2HRAWT5U.js +2 -0
- package/dist/readmodel-XOGOELUP.js +2 -0
- package/dist/reconcile-cmd-DH4VV6PG.js +2 -0
- package/dist/{recording-banner-IWY3GS6N.js → recording-banner-SADVYNEP.js} +1 -1
- package/dist/{require-project-folder-PFIDA5ZH.js → require-project-folder-LP7V26IU.js} +1 -1
- package/dist/{revert-3TKLOYQA.js → revert-AQQ2VHRM.js} +1 -1
- package/dist/{review-cmd-RXPPC5GK.js → review-cmd-4WZUUOE4.js} +1 -1
- package/dist/run-RT2VMPTQ.js +2 -0
- package/dist/run-XAZMT7WO.js +2 -0
- package/dist/{run-test-md-7GONSVAM.js → run-test-md-ATB2HZRG.js} +2 -2
- package/dist/{skill-installer-YZP5DWWZ.js → skill-installer-DE2LSSKU.js} +1 -1
- package/dist/{spawner-YDYCSTZD.js → spawner-GOTVIFR5.js} +1 -1
- package/dist/tcg-generate-7PUXJ5R4.js +2 -0
- package/dist/{testmd-actions-7RNW76DN.js → testmd-actions-RYQHBX4K.js} +1 -1
- package/dist/token-refresh-F5KRV7ER.js +2 -0
- package/dist/{validate-basic-IQY5CRLP.js → validate-basic-6BQ2L7TT.js} +1 -1
- package/dist/{version-check-U5UBPVX4.js → version-check-YW3FUWDH.js} +1 -1
- package/dist/{view-cmd-QE2FS3GB.js → view-cmd-FRMQF76B.js} +1 -1
- package/dist/walk-session-O4TMVORI.js +2 -0
- package/package.json +7 -7
- package/dist/ChatSurface-HGP5EHZM.js +0 -9
- package/dist/EvidenceViewOffer-7O3RNBEE.js +0 -2
- package/dist/SingleShotApp-UIDA54GB.js +0 -2
- package/dist/TestMdRunView-OH4Y6YD6.js +0 -2
- package/dist/archive-committer-3NI773TP.js +0 -2
- package/dist/bind-SRZYTS4Q.js +0 -6
- package/dist/chat-controller-VKGECDTU.js +0 -3
- package/dist/chunk-DM2GL24Z.js +0 -3
- package/dist/chunk-FTD3B7QA.js +0 -2
- package/dist/chunk-GIGD4M7V.js +0 -5
- package/dist/chunk-HW7Z5S2M.js +0 -14
- package/dist/chunk-I2S6KNZW.js +0 -2
- package/dist/chunk-IACKIGPX.js +0 -2
- package/dist/chunk-NFOBDHZK.js +0 -147
- package/dist/chunk-WM5QHLAP.js +0 -9
- package/dist/chunk-X4QL2DAD.js +0 -5
- package/dist/chunk-YANCBRER.js +0 -3
- package/dist/descriptor-SL5A7RQE.js +0 -2
- package/dist/distill-cmd-EYCCCFL3.js +0 -2
- package/dist/evolve-cmd-PHQ6FHRI.js +0 -2
- package/dist/explain-JIXUWEFJ.js +0 -2
- package/dist/ingest-4CGBXC2L.js +0 -2
- package/dist/ingest-cmd-X7BWGIN7.js +0 -3
- package/dist/interactive-bind-5FWW3S53.js +0 -7
- package/dist/login-flow-IXPJHTL2.js +0 -2
- package/dist/pipeline-F4WTOZ3Y.js +0 -2
- package/dist/readmodel-MPTENJ2R.js +0 -2
- package/dist/reconcile-cmd-MNMWAZF3.js +0 -8
- package/dist/run-V2WMNHFK.js +0 -2
- package/dist/signals-cmd-LXHZQLXZ.js +0 -2
- package/dist/tcg-generate-ZRKSX2KC.js +0 -2
- package/dist/token-refresh-DH2L2IPP.js +0 -2
|
@@ -0,0 +1,8 @@
|
|
|
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-O66EU5UV.js";import{b as Te,d as Ce}from"./chunk-OB6CKLEL.js";import{a as be}from"./chunk-5Y2G4NC7.js";import{a as Se}from"./chunk-YCCUBQY4.js";import{a as $e}from"./chunk-IRRGSC7B.js";import{b as we}from"./chunk-DFS4RMVP.js";import"./chunk-XUJ5EPVW.js";import{x as s}from"./chunk-HJGUEZLW.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
|
+
`)){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
|
+
`),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
|
+
`),d-6,Ye),le=ce?ae.split(`
|
|
6
|
+
`).slice(-Lt):[];ie&&(q.current=ie.turnIndex);let tt=w?w.resolution.filter(c=>!c).length:0,ue;for(let c=se.length-1;c>=0;c--){let p=se[c];if(p.kind==="banner"&&!p.text.startsWith("kane")){ue=p.text;break}}let j=A.activity[A.activity.length-1],z=j?j.status==="decision"?j.label:Ie({name:j.name,status:j.status}):void 0,me=_==="streaming"||_==="working",[nt,rt]=(0,v.useState)(0);be(()=>rt(c=>c+1),me?120:null);let ot=e.state.busySince?Math.floor((Date.now()-e.state.busySince)/1e3):0,st=ce?"Writing\u2026":z?`${z.charAt(0).toUpperCase()}${z.slice(1)}\u2026`:e.state.workingLabel??(t==="design"?"Designing\u2026":"Thinking\u2026"),it=e.state.turns.some(c=>c.role==="agent"),[at,ct]=(0,v.useState)(0),[de,lt]=(0,v.useState)(!1),[pe,ut]=(0,v.useState)(null),H=(0,v.useRef)(0),ge=(0,v.useRef)(!1),fe=(0,v.useRef)(null),Q=c=>{H.current=c,ct(c)},xe=c=>{ge.current=c,lt(c)},U=c=>{fe.current=c,ut(c)},he=w&&w.cursor>=0?w.questions[w.cursor]:void 0,O=(0,v.useRef)(he);O.current=he;let J=(0,v.useRef)(w);J.current=w;let mt=w?`${w.questions[0]?.id??"b"}:${w.cursor}`:null;(0,v.useEffect)(()=>{if(U(null),O.current){xe(!0);let c=J.current?.resolution[J.current.cursor]?.selected_index;Q(c??O.current.recommended_index??0)}else xe(!1)},[mt]);let dt={isFocused:()=>ge.current&&O.current!=null&&fe.current==null,onMove:c=>{let p=O.current;if(!p)return;let T=p.allow_free_text?X(p):p.options.length-1;Q(Math.max(0,Math.min(T,H.current+c)))},onSelect:()=>{let c=O.current;if(c){if(c.allow_free_text&&H.current===X(c)){U("");return}e.submit(String(H.current+1))}},onDigit:c=>{let p=O.current;p&&c-1<p.options.length&&Q(c-1)},onType:c=>{let p=O.current;p?.allow_free_text&&(Q(X(p)),U(c))},onBack:()=>e.reopenQuestion()},pt=pe!=null?{value:pe,onChange:c=>U(c),onSubmit:c=>{U(null),c.trim()&&e.submit(c.trim())},onCancel:()=>U(null)}:null,gt=_==="streaming"&&!w||!!w&&de,ft=w?"answer in the panel above \u2014 \u2191/\u2193 + Enter, or just type your answer":Ot,Z=r??(()=>e.requestPause()),xt=c=>{let p=Ge(c);if("error"in p){o(p.error);return}let T=V(e.state.turns);if(T.entries.length===0){o("nothing proposed yet \u2014 the first turn is still coming");return}if(p.level==="detail"&&p.num>T.entries.length){o(`no item ${p.num} \u2014 the set has ${T.entries.length} item${T.entries.length===1?"":"s"}`);return}y(He(p,T))},ye=(0,S.jsx)(We,{verb:t,subject:ue,turn:q.current||void 0,pendingCount:tt,creditsTotal:e.state.credits?.total});if(a){let c=V(e.state.turns),p=c.entries.length;return(0,S.jsxs)(b,{flexDirection:"column",children:[(0,S.jsx)(ee,{onToggleThinking:()=>u(T=>!T),onCtrlC:Z,explorer:{isOpen:()=>h.current!==null,onClose:()=>{y(null),o("closed the explorer \u2014 your text didn't send, retype to chat"),setTimeout(()=>i(T=>T+1),0)},onMove:T=>y(h.current&&Y(h.current,{type:"move",delta:T},p)),onEnter:()=>y(h.current&&Y(h.current,{type:"enter"},p)),onBack:()=>{y(h.current&&Y(h.current,{type:"back"},p)),setTimeout(()=>i(T=>T+1),0)}}}),(0,S.jsx)(Qe,{items:c,state:a,verb:t}),(K??l)&&(K??l).split(`
|
|
7
|
+
`).map((T,L)=>(0,S.jsx)(n,{color:s.orange,children:T},`nt-${L}`)),ye]})}return(0,S.jsxs)(b,{flexDirection:"column",children:[(0,S.jsx)(ee,{onToggleThinking:()=>u(c=>!c),onCtrlC:Z,panel:dt}),Ze&&(0,S.jsx)(ke,{thinking:et.body,expanded:!0,thinkingDone:_!=="streaming",maxLines:Ye+1}),le.length>0&&(0,S.jsx)(b,{flexDirection:"column",children:le.map((c,p)=>(0,S.jsx)(n,{children:c},`st-${p}`))}),w&&(0,S.jsx)(De,{batch:w,sel:at,focused:de,freeText:pt}),N&&(0,S.jsx)(n,{color:"yellow",children:N.prompt}),(K??l)&&(K??l).split(`
|
|
8
|
+
`).map((c,p)=>(0,S.jsx)(n,{color:s.orange,children:c},`nt-${p}`)),me&&!w&&(0,S.jsxs)(n,{color:s.generateAccent,children:[`${ze[nt%ze.length]} ${st} `,(0,S.jsx)(n,{color:s.dim,children:`(${ot}s)`})]}),_==="idle"&&it&&!w&&!N&&(0,S.jsxs)(n,{color:s.generateAccent,children:["\u25CF your turn",(0,S.jsx)(n,{color:s.dim,children:Pt(t,e.state.checkpoint)})]}),_==="pausing"?(0,S.jsx)(n,{color:s.dim,children:"pausing \u2014 saving session\u2026 (ctrl+c again = force quit)"}):(0,S.jsx)(Ce,{history:F.current,placeholder:ft,accent:s.generateAccent,submitVerb:w?"answer":"send",submitEmpty:!!w||t==="design"&&e.state.checkpoint,inert:gt,commands:Xe,footerBindings:[{keys:"\u21B5",label:w?"answer":"send"},{keys:"\u2191\u2193",label:"history"},{keys:"ctrl+t",label:"thinking"},{keys:"ctrl+c",label:"exit"}],onSubmit:c=>{let p=c.trim();if(!p){w?e.submit(""):t==="design"&&e.state.checkpoint&&e.continueParked();return}if(o(null),p.startsWith("/")){let[T="",...L]=p.slice(1).split(/\s+/),M=L.join(" ");if(!T){o('type "/" then a command \u2014 /view, /explain, /pause, /done');return}switch(T.toLowerCase()){case"view":xt(M);return;case"explain":if(!M){o("usage: /explain <ref> \u2014 e.g. /explain guest-checkout");return}e.explainRef(M);return;case"pause":Z();return;case"done":case"exit":e.completeSession();return;default:o(`unknown command "/${T}" \u2014 try /view, /explain, /pause, /done`);return}}e.submit(p)}}),ye]})}export{En as ChatSurface,At as tailVisualRows,Pt as yourTurnTail};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-3WJJ43MT.js";import"./chunk-XUJ5EPVW.js";import"./chunk-HJGUEZLW.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-
|
|
2
|
+
import{a as r}from"./chunk-WT3SMSY5.js";import"./chunk-XUJ5EPVW.js";import"./chunk-HJGUEZLW.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-
|
|
2
|
+
import{a as P,b as g,c as f}from"./chunk-UZSG54OY.js";import"./chunk-2K4XOHVK.js";import"./chunk-5Y2G4NC7.js";import"./chunk-HJGUEZLW.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-
|
|
2
|
+
import{a as p,b as l,c as n}from"./chunk-IRRGSC7B.js";import{x as o}from"./chunk-HJGUEZLW.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-AXABTFCD.js";import"./chunk-RFHMDQXZ.js";import"./chunk-QNNBNIR7.js";import"./chunk-CJJXT5DO.js";import"./chunk-FJTWJ243.js";import"./chunk-BC7UVJJB.js";import"./chunk-2PQXEEVY.js";import"./chunk-EHN5HTUD.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-M5JQXOCE.js";import"./chunk-DNOBOZPO.js";import"./chunk-HJGUEZLW.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-
|
|
2
|
+
import{a,b}from"./chunk-STH6I3UB.js";import"./chunk-YCCUBQY4.js";import"./chunk-PICCLJSO.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-DNOBOZPO.js";import"./chunk-XUJ5EPVW.js";import"./chunk-HJGUEZLW.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,x as t}from"./chunk-
|
|
2
|
+
import{a as f,b as r,x as t}from"./chunk-HJGUEZLW.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-
|
|
2
|
+
import{a}from"./chunk-POI6DCP6.js";import"./chunk-IRRGSC7B.js";import"./chunk-HJGUEZLW.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-
|
|
2
|
+
import{a}from"./chunk-WFEGGQJ4.js";import"./chunk-HJGUEZLW.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-
|
|
2
|
+
import{a,b}from"./chunk-IXVR66NS.js";import"./chunk-XUJ5EPVW.js";import"./chunk-HJGUEZLW.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-
|
|
2
|
+
import{a,b}from"./chunk-YMSN25DX.js";import"./chunk-YCCUBQY4.js";import"./chunk-PICCLJSO.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-DNOBOZPO.js";import"./chunk-XUJ5EPVW.js";import"./chunk-HJGUEZLW.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-
|
|
2
|
+
import{a,b,c}from"./chunk-WE57PD6K.js";import"./chunk-S3DAAAE5.js";import"./chunk-POI6DCP6.js";import"./chunk-IRRGSC7B.js";import"./chunk-HJGUEZLW.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-CY5NDMO7.js";import"./chunk-3HEPW6SN.js";import"./chunk-OB6CKLEL.js";import"./chunk-I2JUBAPU.js";import"./chunk-W36P7S5W.js";import"./chunk-4MUHS3UL.js";import"./chunk-FPFOW6BS.js";import"./chunk-WAOCHXJ5.js";import"./chunk-L5LI2JF4.js";import"./chunk-YMSN25DX.js";import"./chunk-STH6I3UB.js";import"./chunk-YCCUBQY4.js";import"./chunk-PICCLJSO.js";import"./chunk-M5JQXOCE.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-DNOBOZPO.js";import"./chunk-VE3SUJMA.js";import"./chunk-BOO7YXAV.js";import"./chunk-XUJ5EPVW.js";import"./chunk-HJGUEZLW.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-
|
|
2
|
+
import{a,b,c,d}from"./chunk-ZQP3MCZW.js";import"./chunk-POI6DCP6.js";import"./chunk-IRRGSC7B.js";import"./chunk-HJGUEZLW.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-MK2G7VIF.js";import"./chunk-ADOXYGZE.js";import"./chunk-E3BO7OVR.js";import"./chunk-W36P7S5W.js";import"./chunk-2K4XOHVK.js";import"./chunk-5Y2G4NC7.js";import"./chunk-M5JQXOCE.js";import"./chunk-DNOBOZPO.js";import"./chunk-POI6DCP6.js";import"./chunk-IRRGSC7B.js";import"./chunk-DFS4RMVP.js";import"./chunk-HJGUEZLW.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-
|
|
2
|
+
import{a as b,b as r}from"./chunk-IRRGSC7B.js";import{x as o}from"./chunk-HJGUEZLW.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};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as p}from"./chunk-BNN6ZDJW.js";import"./chunk-KHU7C6EE.js";import"./chunk-3C5GMAM4.js";import"./chunk-DXK55KGR.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-HJGUEZLW.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
|
+
`),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
|
+
`),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-Q5TQFQ6N.js");return await o(a)}let{resolveAgentAuthEnv:s}=await import("./spawner-GOTVIFR5.js"),{runAgent:t}=await import("./bridge-LNDJS3HH.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
|
+
`);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-
|
|
2
|
+
import{a}from"./chunk-OLXOZJ7X.js";import"./chunk-CT2I5KUM.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,f as c}from"./chunk-
|
|
2
|
+
import{a as l}from"./chunk-RZ4F3BHX.js";import{c as i,f as c}from"./chunk-HJGUEZLW.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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-
|
|
2
|
+
import{a as V,c as ne}from"./chunk-JFAFKHDX.js";import{b as X,c as Z,d as ee}from"./chunk-WIA7TPK3.js";import"./chunk-QPZRHAYK.js";import{a as w,b as te}from"./chunk-6GTOYTCQ.js";import{a as oe}from"./chunk-427OQS2N.js";import{d as Q}from"./chunk-2PQXEEVY.js";import{a as z}from"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import{a as j,b as F}from"./chunk-ZZLR3O5A.js";import{e as W,g as Y}from"./chunk-ZG2V2ODK.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,3 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as K,b as X,c as Y,d as Z}from"./chunk-RE3BZVGE.js";import"./chunk-6PS65QFF.js";import{b as N,d as J}from"./chunk-6GTOYTCQ.js";import{d as V}from"./chunk-2PQXEEVY.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.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,x,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(!x.mint_gate.includes(h))throw new Error(`GATED_LABEL: cannot mint "${h}" (gate: ${x.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,x={}){let c=x.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,x.convSourceId)),ambiguous:u}}function ae(r,t){let x=r.trim();if(x==="")return{kind:"defaults"};if(/^defer$/i.test(x))return{kind:"defer-all"};let c=t.cursor,u=x,m=/^(\d+):\s*(.*)$/.exec(x);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=[],x=[],c=(i,h)=>{h.length!==0&&(x.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:x.join(" + ")||"design"}}function ke(r={}){let t={turns:[],thinking:X(),pending:null,confirm:null,status:"idle",ledger:[],activeTurn:null,stream:null,checkpoint:!1},x=e=>{let n=[],o=e.minted.map(g=>g.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;J({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 g=n.getNode(o)?.content?.blob,f=typeof g=="string"?V(r.contextDir,g)?.toString("utf8")??"":"";if(f)for(let v of e){if(v.kind!=="add"||v.convSourceId!==d)continue;let O=N(f,v.cite.turn);if(!(O!==null&&O.includes(v.cite.quote)))for(let S=s.turns;S>=1;S--){let L=N(f,S);if(L!==null&&L.includes(v.cite.quote)){v.cite={...v.cite,turn:S};break}}}},j=null,E=new Map,Q=new Map,B=null,k=()=>{R&&(clearTimeout(R),R=null);for(let e of c)e()},R=null,G=()=>{R||(R=setTimeout(()=>{R=null;for(let e of c)e()},80))},l=e=>{t.ledger.push(e)},D=null,A=!1,M=(e=!1)=>{D?l({kind:"agent",text:D}):e&&A&&l({kind:"note",text:'chat to refine ("looks good" approves; /done finishes)'}),D=null,A=!1},ne=()=>{D=null,A=!1},I=()=>{t.activeTurn&&(t.activeTurn=null)},W=(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,g)=>{let f=e.resolution[g];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],g=o.resolution[e];o.resolution[e]=n;let f=te(s);g?l({kind:"answer",receipt:{form:"changed",qNum:e+1,stub:f,choice:W(s,n),prev:g.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:W(s,n)}})},P=()=>{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())},z=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((g,f)=>{if(!n.resolution[f]){if(g.risk==="high"){s=!0;return}T(f,{form:"assumed",selected_index:g.recommended_index,free_text:null,choice:g.options[g.recommended_index]?.label??"?"})}}),s){n.cursor=n.questions.findIndex((g,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":P();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],g=o.indices[0];T(o.target,{form:"answered",selected_index:g,free_text:null,choice:s.options[g]?.label??String(g+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"}),k();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}),k()},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),k();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",k();return}for(t.notice=void 0,t.checkpoint=!1,M(),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}),k()},attachSender(e){i=e},attachOnCommitted(e){h=e},attachConversationSource(e){d=e},holdReceipt(e){a.push(e),t.checkpoint=!0,k()},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,k();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(),k()}},note(e){l({kind:"note",text:e}),k()},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}k()},ledger(e){(e.kind==="pause"||e.kind==="error"||e.kind==="summary")&&(I(),M()),(e.kind==="summary"||e.kind==="pause")&&(t.stream=null),l(e),e.kind==="commit"&&(e.ok?M(!0):ne()),k()},completeSession(){P(),i?.({type:"session_complete"}),t.status="idle",k()},requestPause(){P(),t.status="pausing";let e=i;Promise.resolve().then(()=>e?.({type:"pause"})),k()},ask(e){return t.pending=z(e),E=new Map(e.map((n,o)=>[n.id,o+1])),t.status="awaiting-input",k(),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"}}),k()},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"){G();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},G();return}case"progress":break;case"proposal":{u+=1,I(),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 g=o.get(s.temp_ref);g&&(s.matches_existing=g)}t.turns.push({role:"agent",turnIndex:u,items:n,text:e.narrative}),D=e.narrative??null,A=!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,I(),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(g=>de[g]??g).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,A=!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=z(e.questions),t.status="awaiting-input";break;case"chat_ops":{u+=1,I(),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??"",g=r.refreshGraph?.()??r.graph,f=p=>Q.get(p)??p,v=o.map(p=>{if(!p.target)return p;let y=f(p.target),w=p.expected_cid;if(w==null&&g){let H=g.resolve(y);H&&(w=g.tipOf(H.cid))}let $=p.payload?.redirect_to,q=$&&f($);return y===p.target&&w===p.expected_cid&&q===$?p:{...p,target:y,expected_cid:w,...q!==$?{payload:{...p.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(p){t.error=p instanceof Error?p.message:String(p),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:S,ambiguous:L}=O;if(L.length>0){let p=L[0];t.confirm={kind:"ambiguity-confirm",prompt:`did you mean edit or ${p.kinds.filter(y=>y!=="edit").join("/")} on ${p.target}?`},t.turns.push({role:"agent",turnIndex:u,text:s}),s&&l({kind:"agent",text:s});break}if(_(S),r.commitChatTurn&&S.length>0){let p=r.commitChatTurn({contextDir:r.contextDir??"",graph:r.refreshGraph?.()??r.graph,ops:S,by:r.by??{kind:"human",id:"owner"},...r.descriptor?.mint_gate?{mintable:r.descriptor.mint_gate}:{}});if(p.errors)t.error=p.errors.map(y=>y.detail).join("; "),t.turns.push({role:"agent",turnIndex:u,text:s}),l({kind:"commit",ok:!1,line:"commit failed \u2014 nothing landed",warnings:p.errors.map(y=>`${y.code}: ${y.detail}`)}),s&&l({kind:"agent",text:s});else{p.applied.length>0&&r.session?.markApplied(p.applied);let y=x(p);t.turns.push({role:"agent",turnIndex:u,text:s,narration:y}),l({kind:"commit",ok:!0,line:y});let w=r.refreshGraph?.();if(w&&h&&h(w),w)try{b+=1;let F=r.descriptor?.mint_gate?.includes("usecase")?"extract":"design",$=K({verb:F,commitN:b,phase:"chat",committed:p.minted.map(q=>({cid:q.cid,...q.slug?{logical_id:q.slug}:{}}))},w);a.push($.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":I(),M(),t.status="idle",i=null;break;case"error":I(),M(),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}k()}}}export{ke as makeChatController,ae as parseAnswerInput,te as questionStub};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-5Y2G4NC7.js";import{x as o}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-5Y2G4NC7.js";import{x as o}from"./chunk-HJGUEZLW.js";import{a as n}from"./chunk-HCBYKLMW.js";import{b as t}from"./chunk-C44QQJR4.js";import{a as s}from"./chunk-6YGTRKDT.js";import{e as r}from"./chunk-UR6MHSHU.js";var l=r(s(),1);var m=r(n(),1),i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function b({active:e=!0}){let[p,c]=(0,l.useState)(0);return a(()=>{c(f=>(f+1)%i.length)},e?80:null),(0,m.jsx)(t,{color:o.orange,children:e?i[p]:"\u25CF"})}export{b as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as o}from"./chunk-
|
|
2
|
+
import{b as o}from"./chunk-ZG2V2ODK.js";import{existsSync as c,mkdirSync as f,readFileSync as u,renameSync as l,writeFileSync as g}from"fs";import{dirname as p,join as a}from"path";function i(t,r){let n=r.startsWith("sha256:")?r.slice(7):r;return a(t,"blobs",n.slice(0,2),n.slice(2))}function B(t,r){return i(t,r)}function m(t){let r=Buffer.concat([Buffer.from("assurance.blob\0","utf8"),t]);return"sha256:"+o(r)}function d(t,r){let n=m(r),e=i(t,n);if(!c(e)){f(p(e),{recursive:!0});let s=`${e}.tmp-${process.pid}`;g(s,r),l(s,e)}return n}function S(t,r){let n=i(t,r);return c(n)?u(n):null}export{B as a,m as b,d as c,S as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as g}from"./chunk-
|
|
2
|
+
import{d as g}from"./chunk-5YPBPZUR.js";function $(s,n){let t=null;for(let[i,e]of s.designOf)i!==n&&s.tipOf(i)!==n||(t==null||e.seq>t.seq)&&(t={...e,designed_at_cid:i});return t}function v(s,n){let t=new Map;for(let[c,o]of s.superseded)o!=null&&t.set(o,c);let i=[n],e=n;for(;t.has(e);)e=t.get(e),i.unshift(e);return i}function h(s,n,t){let i=s.resolve(n);if(!i){let r=[...s.names.keys()].filter(m=>m.startsWith("uc-")).sort().slice(0,6);return{ok:!1,code:2,message:`unknown use-case '${n}' \u2014 no live node by that logical id or cid${r.length?` (known: ${r.join(", ")})`:""}`}}let e=i.tip;if(s.superseded.has(e)&&s.superseded.get(e)===null)return{ok:!1,code:2,message:`use-case '${n}' was removed (tombstoned) \u2014 nothing to design`};let c=s.nodeLabel.get(e);if(c!==g.USECASE)return{ok:!1,code:2,message:`'${n}' is a ${c??"missing node"}, not a use-case \u2014 design runs per use-case`};let o=s.nameOf.get(e)??s.nameOf.get(i.cid)??e.slice(0,19);if(s.trust.get(e)==="archived"){let r=s.archivedReason.get(e);return{ok:!1,code:2,message:`use-case '${o}' is archived${r?` (${r})`:""} \u2014 design runs only over live use-cases`}}let d=$(s,e);if(d==null||t)return{ok:!0};let a=v(s,e),l=a.length;if(d.designed_at_cid===e)return{ok:!1,code:2,message:`'${o}' is already designed @ v${l} \u2014 current; use --force to redesign`};let u=a.indexOf(d.designed_at_cid),f=u>=0?`v${u+1}`:"an earlier version";return{ok:!1,code:2,message:`'${o}' was designed @ ${f} \u2014 the use-case is now @ v${l} (STALE); use --force to redesign`}}export{$ as a,h as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as H}from"./chunk-
|
|
2
|
+
import{a as H}from"./chunk-W36P7S5W.js";import{a as q}from"./chunk-4MUHS3UL.js";import{a as j}from"./chunk-FPFOW6BS.js";import{a as V}from"./chunk-YCCUBQY4.js";import{a as Y}from"./chunk-DNOBOZPO.js";import{a as X}from"./chunk-VE3SUJMA.js";import{a as D}from"./chunk-XUJ5EPVW.js";import{x as r}from"./chunk-HJGUEZLW.js";import{a as z}from"./chunk-HCBYKLMW.js";import{a as d,b as l,i as $}from"./chunk-C44QQJR4.js";import{a as ne}from"./chunk-6YGTRKDT.js";import{e as G}from"./chunk-UR6MHSHU.js";var f=G(ne(),1);var e=G(z(),1);function re(s){let t=[{id:"method",label:"Auth method",options:[{label:"Basic Auth",value:"basic"},{label:"OAuth (browser)",value:"oauth"}]}];return s&&t.push({id:"env",label:"Environment",options:[{label:"prod",value:"prod"},{label:"stage",value:"stage"}]}),t.push({id:"profile",label:"Profile"}),t.push({id:"credentials",label:"Credentials"}),t}function ce({devMode:s,profiles:t,onBasicLogin:n,onOAuthLogin:o,onComplete:A,onCancel:p}){let v=re(s),[x,h]=(0,f.useState)(0),[m,S]=(0,f.useState)(0),[C,R]=(0,f.useState)({}),[c,g]=(0,f.useState)("select"),[N,b]=(0,f.useState)(""),[_,w]=(0,f.useState)("username"),[I,O]=(0,f.useState)(""),[k,B]=(0,f.useState)(null),[Q,F]=(0,f.useState)(null),P=v[x],K=C.method??"basic",E=C.env??"prod",M=(0,f.useCallback)(()=>{let i=t.filter(a=>a.env===E).map(a=>({label:`${a.profile} [${a.env}]`,value:a.profile}));return i.push({label:"+ Create new",value:"__new__"}),i},[t,E]),W=(0,f.useCallback)(()=>{x===0?p():(h(u=>u-1),S(0),g("select"),b(""),B(null))},[x,p]),U=(0,f.useCallback)(u=>{K==="basic"?(g("text-input"),w("username"),b("")):(g("waiting"),o(u,E).then(()=>{F(`Logged in via OAuth as ${u} [${E}]`),g("done")}).catch(i=>{B(i.message),g("error")}))},[K,E,o]),Z=(0,f.useCallback)(u=>{let i=u.trim();if(i){if(_==="profileName"){let a=i;R(T=>({...T,profile:a})),U(a);return}if(_==="username"){O(i),b(""),w("accessKey"),g("text-input-masked");return}if(_==="accessKey"){let a=C.profile??"default";g("waiting"),(async()=>{try{await n(a,E,I,i),F(`Logged in as ${a} [${E}] via basic auth`),g("done")}catch{B("Credentials not valid. Please use valid credentials."),O(""),b(""),w("username"),g("text-input")}})()}}},[_,C.profile,E,n,I,U]),ee=(0,f.useCallback)(u=>{b(u),k&&B(null)},[k]);$((u,i)=>{if(c==="done"){let T=C.profile??"default";A(T,E);return}if(c==="error"){p();return}if(c==="waiting"){i.escape&&p();return}if(c==="text-input"||c==="text-input-masked")return;if(i.escape){W();return}let a=P?.id==="profile"?M():P?.options??[];if(i.upArrow){S(T=>Math.max(0,T-1));return}if(i.downArrow){S(T=>Math.min(a.length-1,T+1));return}if(i.return&&a[m]){let T=a[m];if(P.id==="profile"){if(T.value==="__new__"){g("text-input"),w("profileName"),b("");return}R(y=>({...y,profile:T.value})),h(y=>y+1),S(0),U(T.value);return}R(y=>({...y,[P.id]:T.value})),h(y=>y+1),S(0)}});let L="Login";if(c==="done")return(0,e.jsxs)(d,{flexDirection:"column",borderStyle:"round",borderColor:r.green,paddingX:2,paddingY:1,children:[(0,e.jsxs)(l,{color:r.green,bold:!0,children:["\u2713 ",Q]}),(0,e.jsx)(d,{marginTop:1,children:(0,e.jsx)(l,{color:r.dim,children:"press any key"})})]});if(c==="error")return(0,e.jsxs)(d,{flexDirection:"column",borderStyle:"round",borderColor:r.red,paddingX:2,paddingY:1,children:[(0,e.jsx)(l,{color:r.red,bold:!0,children:"Login failed"}),(0,e.jsx)(d,{marginTop:1,children:(0,e.jsx)(l,{color:r.red,children:k})}),(0,e.jsx)(d,{marginTop:1,children:(0,e.jsx)(l,{color:r.dim,children:"press any key"})})]});if(c==="waiting")return(0,e.jsxs)(d,{flexDirection:"column",borderStyle:"round",borderColor:r.orange,paddingX:2,paddingY:1,children:[(0,e.jsxs)(l,{color:r.orange,bold:!0,children:[L," \u203A OAuth"]}),(0,e.jsx)(d,{marginTop:1,children:(0,e.jsx)(l,{color:r.secondary,children:"Opening browser for login..."})}),(0,e.jsx)(d,{marginTop:1,children:(0,e.jsx)(l,{color:r.orange,children:"Waiting for callback \u27F3"})}),(0,e.jsx)(D,{bindings:[],escBackLabel:"cancel"})]});if(c==="text-input"||c==="text-input-masked"){let u=_==="username"?"Username":_==="accessKey"?"Access Key":"Profile name",i=_==="username"||_==="accessKey"?`${L} \u203A Basic Auth`:`${L} \u203A New Profile`;return(0,e.jsxs)(d,{flexDirection:"column",borderStyle:"round",borderColor:r.orange,paddingX:2,paddingY:1,children:[k&&(_==="username"||_==="accessKey")&&(0,e.jsx)(d,{marginBottom:1,children:(0,e.jsxs)(l,{color:r.red,children:["\u2717 ",k]})}),(0,e.jsx)(l,{color:r.orange,bold:!0,children:i}),_==="accessKey"&&(0,e.jsxs)(d,{marginTop:1,children:[(0,e.jsx)(l,{color:r.secondary,children:"Username: "}),(0,e.jsx)(l,{children:I})]}),(0,e.jsxs)(d,{marginTop:1,children:[(0,e.jsxs)(l,{color:r.secondary,children:[u,": "]}),(0,e.jsx)(V,{value:N,onChange:ee,onSubmit:Z,onCancel:W,masked:c==="text-input-masked"})]}),(0,e.jsx)(D,{bindings:[{keys:"\u21B5",label:"confirm"}],escBackLabel:"back"})]})}let te=P?.id==="profile"?M():P?.options??[];return(0,e.jsxs)(d,{flexDirection:"column",borderStyle:"round",borderColor:r.orange,paddingX:2,paddingY:1,children:[(0,e.jsx)(l,{color:r.orange,bold:!0,children:L}),(0,e.jsx)(d,{marginTop:1,children:(0,e.jsxs)(l,{color:r.secondary,children:[P?.label,":"]})}),(0,e.jsx)(d,{flexDirection:"column",marginTop:1,children:te.map((u,i)=>{let a=i===m,T=a?"\u276F ":" ",y=u.value==="__new__"?r.green:a?r.orange:void 0;return(0,e.jsxs)(l,{color:y,children:[T,u.label]},u.value)})}),(0,e.jsx)(D,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}async function J(s,t,n,o){let A=s.loadBasicAuth(t,n),p=s.loadCredentials(t,n);if(!A&&!p)return o("info","STARTUP_GATE_NO_CREDS","Profile has no credentials",{profile:t,env:n}),{status:"needs_login",profile:t,env:n};let v=Y(n),x=async()=>s.loadCredentials(t,n)?.access_token??null,h=new j(v.controllerBaseUrl,x,A,o);o("info","STARTUP_GATE_VALIDATE","Validating credentials with controller",{profile:t,env:n,method:A?"basic":"oauth"});let m=await h.resolve(!0);if(m)return o("info","STARTUP_GATE_VALID","Credentials validated",{profile:t,env:n,username:m.username,org_id:m.org_id}),{status:"authenticated",result:{profile:t,env:n,credentials:p,basicAuth:A,tmsCreds:m,resolver:h}};if(!A&&p){let S=p.refresh_token,R=s.loadClient(t,n)?.client_id;if(S&&R){o("info","STARTUP_GATE_REFRESH","Attempting token refresh",{profile:t,env:n});try{let g=await new q(n).refreshToken(S,R);if(g.access_token){s.saveCredentials(t,n,{...p,...g,expires_at:Date.now()/1e3+(g.expires_in??3600)});let b=await h.resolve(!0);if(b)return o("info","STARTUP_GATE_REFRESH_OK","Token refreshed and validated",{profile:t,env:n,username:b.username}),{status:"authenticated",result:{profile:t,env:n,credentials:{...p,...g},basicAuth:null,tmsCreds:b,resolver:h}}}o("warn","STARTUP_GATE_REFRESH_INVALID","Refreshed token still invalid",{profile:t,env:n})}catch(c){o("warn","STARTUP_GATE_REFRESH_FAILED","Token refresh failed",{profile:t,env:n,error:c instanceof Error?c.message:String(c)})}}else o("info","STARTUP_GATE_NO_REFRESH","No refresh_token or client_id \u2014 login required",{profile:t,env:n})}return o("info","STARTUP_GATE_INVALID","Credentials invalid \u2014 login required",{profile:t,env:n}),{status:"needs_login",profile:t,env:n}}async function Te(s,t,n=new H){let o=s.listProfiles();if(t("info","STARTUP_GATE_START","Auth startup gate",{profile_count:o.length}),o.length===0)return t("info","STARTUP_GATE_NONE","No profiles found \u2014 login required"),{status:"needs_login"};if(o.length>1){let v=s.getActiveProfile(),x=s.getDefaultEnv();if(v&&o.some(m=>m.profile===v&&m.env===x)){t("info","STARTUP_GATE_TRY_ACTIVE","Multiple profiles \u2014 trying active first",{activeProfile:v,activeEnv:x});let m=await J(s,v,x,t);if(m.status==="authenticated")return m;t("info","STARTUP_GATE_ACTIVE_FAILED","Active profile invalid \u2014 showing picker",{activeProfile:v,activeEnv:x})}return t("info","STARTUP_GATE_MULTI","Multiple profiles \u2014 picker required",{profiles:o.map(h=>`${h.profile}/${h.env}`)}),{status:"needs_pick",profiles:o}}let{profile:A,env:p}=o[0];return s.setActiveProfile(A),s.setDefaultEnv(p),X(s,n,A,p),J(s,A,p,t)}export{ce as a,J as b,Te as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b}from"./chunk-
|
|
2
|
+
import{a as b}from"./chunk-XUJ5EPVW.js";import{m as d,x as o}from"./chunk-HJGUEZLW.js";import{a as L}from"./chunk-HCBYKLMW.js";import{a as u,b as c,i as A}from"./chunk-C44QQJR4.js";import{a as D}from"./chunk-6YGTRKDT.js";import{e as h}from"./chunk-UR6MHSHU.js";var x=h(D(),1);import{readdirSync as N,mkdirSync as B,statSync as k}from"fs";import{join as P}from"path";var r=h(L(),1);function O(n){try{return N(n).filter(l=>{try{return k(P(n,l)).isDirectory()}catch{return!1}})}catch{return[]}}function E(n,l,f,v){return{name:n,path:l,label:n,isActive:v}}function H({currentPath:n,onSelect:l,onCancel:f}){let s=O(d).map(i=>{let e=P(d,i);return E(i,e,n,e===n)}),p=!n,R=s.length+2,[a,C]=(0,x.useState)(()=>{if(p)return 0;let i=s.findIndex(e=>e.isActive);return i>=0?i+1:0}),[T,I]=(0,x.useState)(!1),[S,g]=(0,x.useState)("");return A((i,e)=>{if(T){if(e.escape){I(!1),g("");return}if(e.return){let t=S.trim();if(t){let m=P(d,t);B(m,{recursive:!0}),l(m),f()}return}if(e.backspace||e.delete){g(t=>t.slice(0,-1));return}i&&!e.ctrl&&!e.meta&&g(t=>t+i);return}if(e.escape){f();return}if(e.upArrow){C(t=>Math.max(0,t-1));return}if(e.downArrow){C(t=>Math.min(R-1,t+1));return}if(e.return){if(a===0){p||l(""),f();return}if(a===s.length+1){B(d,{recursive:!0}),I(!0),g("");return}let t=s[a-1];t&&!t.isActive&&l(t.path),f();return}}),T?(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,r.jsx)(c,{color:o.orange,bold:!0,children:"Chrome Profile \u203A New"}),(0,r.jsxs)(u,{marginTop:1,children:[(0,r.jsx)(c,{color:o.secondary,children:"Name: "}),(0,r.jsx)(c,{children:S}),(0,r.jsx)(c,{color:o.dim,children:"\u2588"})]}),(0,r.jsx)(b,{bindings:[{keys:"\u21B5",label:"create"}],escBackLabel:"back"})]}):(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,r.jsx)(c,{color:o.orange,bold:!0,children:"Chrome Profile"}),(0,r.jsxs)(u,{flexDirection:"column",marginTop:1,children:[(0,r.jsxs)(c,{color:p?o.green:a===0?o.orange:o.dim,children:[a===0?"\u276F ":" ","Use temporary (no profile)",p?" \u25CF active":""]}),s.map((i,e)=>{let m=e+1===a,w=m?"\u276F ":" ",y=i.isActive?o.green:m?o.orange:void 0;return(0,r.jsxs)(c,{color:y,children:[w,i.label,i.isActive?" \u25CF active":""]},i.name)}),(0,r.jsxs)(c,{color:a===s.length+1?o.orange:o.dim,children:[a===s.length+1?"\u276F ":" ","+ Create new"]})]}),(0,r.jsx)(b,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}export{O as a,E as b,H as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as n}from"./chunk-RZ4F3BHX.js";import{a as c}from"./chunk-
|
|
2
|
+
import{a as n}from"./chunk-RZ4F3BHX.js";import{a as c}from"./chunk-DNOBOZPO.js";import{u as s,v as a}from"./chunk-HJGUEZLW.js";import{createHash as h,randomBytes as g}from"crypto";var l=class{authBaseUrl;consentUrl;constructor(t="prod"){let e=c(t);this.authBaseUrl=e.authBaseUrl,this.consentUrl=e.consentUrl}static generatePkce(){let t=g(96).toString("base64url").slice(0,128),e=h("sha256").update(t).digest("base64url");return[t,e]}buildAuthorizationUrl(t,e,r,o){let i=new URLSearchParams({response_type:"code",client_id:t,redirect_uri:o,scope:a,code_challenge:e,code_challenge_method:"S256",state:r});return`${this.consentUrl}/oauth2?${i.toString()}`}async registerClient(t){let e=await n(`${this.authBaseUrl}/oauth2/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:s,redirect_uris:[t],grant_types:["authorization_code"],response_types:["code"],client_type:"public",application_type:"native"})});if(!e.ok)throw new Error(`DCR failed: ${e.status} ${await e.text()}`);return e.json()}async exchangeCode(t,e,r,o){let i=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"authorization_code",code:t,redirect_uri:o,client_id:e,code_verifier:r})});if(!i.ok)throw new Error(`Token exchange failed: ${i.status}`);return i.json()}async refreshToken(t,e){let r=await n(`${this.authBaseUrl}/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:t,client_id:e})});if(!r.ok)throw new Error(`Token refresh failed: ${r.status}`);return r.json()}async revokeToken(t,e,r="access_token"){await n(`${this.authBaseUrl}/oauth2/revoke`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,token_type_hint:r,client_id:e})})}async validateToken(t){let e=new AbortController,r=setTimeout(()=>e.abort(),1e4);try{let o=await n(`${this.authBaseUrl}/api/user`,{headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},signal:e.signal});return clearTimeout(r),o.ok}catch{return clearTimeout(r),!1}}};export{l as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b}from"./chunk-
|
|
2
|
+
import{a as b}from"./chunk-4MUHS3UL.js";import{c as k}from"./chunk-RFHMDQXZ.js";import{a as C}from"./chunk-BOO7YXAV.js";import{p as m,q as u,r as f,s as x,t as y}from"./chunk-HJGUEZLW.js";import{createServer as S}from"http";import{randomBytes as A}from"crypto";import{URL as L}from"url";var P=class{profile;environment;creds;oauth;constructor(r="default",o="prod",e){this.profile=r,this.environment=o,this.creds=e??new C,this.oauth=new b(o)}async login(){let{server:r,port:o}=await this.startCallbackServer(),e=y(o);try{let t=this.creds.loadClient(this.profile,this.environment),i=t?.redirect_uris;(!t||!i?.includes(e))&&(t=await this.oauth.registerClient(e),this.creds.saveClient(this.profile,this.environment,t));let c=t.client_id,[h,d]=b.generatePkce(),a=A(32).toString("hex"),n=this.oauth.buildAuthorizationUrl(c,d,a,e),l=await this.waitForCallback(r,o,n,a);if(!l)throw new Error("Login cancelled or timed out");let p=await this.oauth.exchangeCode(l,c,h,e),g={access_token:p.access_token,refresh_token:p.refresh_token,expires_at:Math.floor(Date.now()/1e3)+p.expires_in,scope:p.scope??"*"};return this.creds.saveCredentials(this.profile,this.environment,g),this.creds.setActiveProfile(this.profile),g}catch(t){throw r.close(),t}}startCallbackServer(){return new Promise((r,o)=>{let e=u,t=()=>{let i=S();i.on("error",c=>{c.code==="EADDRINUSE"&&e<f?(e++,t()):o(new Error(`Failed to start callback server: ${c.message}. Ports ${u}-${f} are all in use.`))}),i.listen(e,m,()=>{r({server:i,port:e})})};t()})}waitForCallback(r,o,e,t){return new Promise(i=>{let c=!1,h=setTimeout(()=>d(null),12e4),d=a=>{c||(c=!0,clearTimeout(h),r.close(),i(a))};r.on("request",(a,n)=>{let l=new L(a.url??"/",`http://${m}:${o}`);if(l.pathname!==x){n.writeHead(404),n.end();return}let p=l.searchParams.get("state"),g=l.searchParams.get("code");if(l.searchParams.get("error")){n.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),n.end(v({state:"error",title:"Login failed",message:"We couldn't complete the sign-in. You can close this tab and try again from your terminal."})),d(null);return}if(p!==t){n.writeHead(400,{"Content-Type":"text/html; charset=utf-8"}),n.end(v({state:"error",title:"Invalid state",message:"The sign-in response didn't match this session. Please return to your terminal and try again."})),d(null);return}n.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),n.end(v({state:"success",title:"You're signed in",message:"Head back to your terminal \u2014 KaneAI is ready when you are.",autoClose:!0})),d(g)}),k(e).catch(a=>{let n=a instanceof Error?a.message:String(a);process.stderr.write(`[auth] Could not open browser: ${n}
|
|
3
3
|
Please open this URL manually: ${e}
|
|
4
4
|
`)})})}};function v(s){let r=s.state==="success",o=r?"#22c55e":"#ef4444",e=r?"rgba(34, 197, 94, 0.12)":"rgba(239, 68, 68, 0.12)",t=r?'<svg viewBox="0 0 24 24" width="36" height="36" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7"/></svg>':'<svg viewBox="0 0 24 24" width="36" height="36" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>',i=s.autoClose?"<script>setTimeout(function(){try{window.close();}catch(e){}}, 1500);</script>":"";return`<!doctype html>
|
|
5
5
|
<html lang="en">
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
function l(r){let{isAgent:c,log:m}=r,a=r.stdout??process.stderr,s=r.stdin??process.stdin,p=t=>{c&&process.stdout.write(JSON.stringify(t)+`
|
|
3
|
-
`)};return{async runSteps(t){let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{TestMdRunView:i}=await import("./TestMdRunView-
|
|
3
|
+
`)};return{async runSteps(t){let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{TestMdRunView:i}=await import("./TestMdRunView-5PMLLLFT.js"),{ScrollbackProvider:n}=await import("./scrollback-JLPJR25X.js"),{waitUntilExit:d}=o(e.createElement(n,null,e.createElement(i,t)),{stdout:a,stdin:s,exitOnCtrlC:!1});await d()},async runUpload(t,e){let{renderUploadProgress:o}=await import("./CliUploadProgress-2YRQLECI.js");return await o(t,e)},async onSummary(t){try{let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{AutoExitSummaryBox:i}=await import("./SummaryBox-ABB7ST26.js"),{waitUntilExit:n}=o(e.createElement(i,{data:t}),{stdout:a,stdin:s});await n()}catch(e){m("warn","TEST_MD_SUMMARY_RENDER_FAILED","Summary box render failed",{error:String(e)})}},async onLinks(t){try{let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{LinksBox:i}=await import("./LinksBox-B5EBRY26.js"),{waitUntilExit:n}=o(e.createElement(i,t),{stdout:a,stdin:s});await n()}catch(e){m("warn","TEST_MD_LINKS_RENDER_FAILED","LinksBox render failed",{error:String(e)})}},onLockState(t){p({type:"test_md_lock_state",...t})},onRetryAttempt(t){p({type:"test_md_retry_attempt",...t})},onAgentEvent(t){p(t)}}}export{l as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
var l="assurance/context@1";var u={source:{hashed:["blob","source_id"],required:["blob","source_id"],enums:{}},usecase:{hashed:["actors","criteria","derived","description","risk","summary","title","value"],required:["derived","risk","title"],enums:{risk:["high","med","low"]}},scenario:{hashed:["case_type","derived","description","intent","parameters","tags","technique_notes","title"],required:["case_type","derived","intent","title"],enums:{case_type:["happy","negative","boundary","edge","security","a11y","perf","i18n"]}},ac:{hashed:["derived","expected_answer","kind","measurable","risk","text"],required:["derived","risk","text"],enums:{risk:["high","med","low"],kind:["presence","forbidden-presence","count","delta","state-transition","absolute","bound","propagation","latency","graded"]}},test:{hashed:["check","config","definitionId","derived","objectives_blob","surface_required","test_md_blob","title"],required:["definitionId","derived","title"],enums:{}},gap:{hashed:["derived","kind","question","ref","risk","risk_rationale","text","uc"],required:["derived","kind"],enums:{kind:["ambiguous","incomplete","contradictory","unmeasurable","missing-expected-result","budget-evicted","invariant-unexercised"],risk:["high","med","low"]}},stylenote:{hashed:["derived","learned_from_kind","statement","tags","text"],unhashed:["learned_from"],required:["derived","learned_from_kind","statement"],enums:{learned_from_kind:["edit","directed-edit","mistake","usage"]}}},f={DERIVES:{src:["source"],dst:["usecase","ac","scenario","test"],salient:["anchor","source_cid","source_id"],optionalSalient:["claim"],props:["anchor","claim","quote","source_cid","source_id"],pin:{comparesTo:"source_head"},cardinality:"many",acyclic:!1},belongs_to:{src:["scenario"],dst:["usecase"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"one-live-per-src",acyclic:!1},scoped_to:{src:["ac"],dst:["scenario","usecase"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"one-live-per-src",acyclic:!1},exercises:{src:["scenario"],dst:["ac"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"many",acyclic:!1},verifies:{src:["test"],dst:["ac"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"many",acyclic:!1},automates:{src:["test"],dst:["scenario"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"one-live-per-src-and-dst",acyclic:!1},depends_on:{src:["usecase","scenario"],dst:["usecase","scenario"],salient:[],props:["reason"],pin:{comparesTo:"dst_tip"},cardinality:"many",acyclic:!0},reuses:{src:["test"],dst:["test"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"many",acyclic:!0},annotates:{src:["gap","stylenote"],dst:["source","usecase","scenario","ac","test"],salient:[],props:["reason"],pin:{comparesTo:"dst_tip"},cardinality:"many",acyclic:!1}},E=["presence","forbidden-presence","count","delta","state-transition","absolute","bound","propagation","latency","graded"];var g={presence:{operators:["exists","forall"],baseline:"null",requires:[]},"forbidden-presence":{operators:["exists","forall"],baseline:"null",requires:[]},count:{operators:["equals","gte","lte"],baseline:"null",requires:[],operand_forms:["literal","derived"]},delta:{operators:["changed-by"],baseline:"required",requires:[]},"state-transition":{operators:["changed-by","equals"],baseline:"required",requires:[]},absolute:{operators:["equals","contains","gte","lte"],baseline:"null",requires:[]},bound:{operators:["gte","lte"],baseline:"null",requires:[]},propagation:{operators:["exists","equals"],baseline:"null",requires:[]},latency:{operators:["lte"],baseline:"null",requires:["within"]},graded:{operators:["gte"],baseline:"null",requires:["metric","threshold"]}},y=Object.freeze({SOURCE:"source",USECASE:"usecase",SCENARIO:"scenario",AC:"ac",TEST:"test",GAP:"gap",STYLENOTE:"stylenote"}),h=Object.freeze({DERIVES:"DERIVES",BELONGS_TO:"belongs_to",SCOPED_TO:"scoped_to",EXERCISES:"exercises",VERIFIES:"verifies",AUTOMATES:"automates",DEPENDS_ON:"depends_on",REUSES:"reuses",ANNOTATES:"annotates"});function c(n,s,i){let r=[],e=g[n];if(!e)return r.push({code:"BAD_CHECK",detail:`${i}.kind ${JSON.stringify(n)} not in ${E.join("|")}`}),r;let o=s.operator;o!==void 0&&!e.operators.includes(o)&&r.push({code:"BAD_CHECK",detail:`${i}: operator ${JSON.stringify(o)} illegal for kind "${String(n)}" (legal: ${e.operators.join("|")})`});for(let a of e.requires)(s[a]===void 0||s[a]===null||s[a]==="")&&r.push({code:"BAD_CHECK",detail:`${i}: kind "${String(n)}" requires "${a}"`});e.baseline==="null"&&s.baseline!==void 0&&s.baseline!==null&&r.push({code:"BAD_CHECK",detail:`${i}: kind "${String(n)}" must carry baseline null (only delta/state-transition have one)`});let t=s.operand;if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let a=Object.keys(t),d=t.derived;(!(e.operand_forms?.includes("derived")??!1)||a.length!==1||a[0]!=="derived"||typeof d!="string"||!d.trim())&&r.push({code:"BAD_CHECK",detail:`${i}: object operand is only the count derivation form {derived: "<how the runtime value is computed>"}`})}return r}function m(n,s){let i=u[n];if(!i)return[{code:"UNKNOWN_LABEL",detail:`unknown node label ${JSON.stringify(n)}`}];let r=[];for(let e of Object.keys(s))s[e]!==void 0&&!i.hashed.includes(e)&&!(i.unhashed??[]).includes(e)&&r.push({code:"UNKNOWN_FIELD",detail:`${n}.${e} is not in the ${l} schema`});for(let e of i.required)(s[e]===void 0||s[e]===null)&&r.push({code:"MISSING_FIELD",detail:`${n}.${e} is required`});for(let[e,o]of Object.entries(i.enums)){let t=s[e];t!==void 0&&!o.includes(t)&&r.push({code:"BAD_ENUM",detail:`${n}.${e} ${JSON.stringify(t)} not in ${o.join("|")}`})}if(n==="test"&&s.check&&typeof s.check=="object"){let e=s.check;r.push(...c(e.kind,e,"test.check"))}if(n==="ac"&&s.expected_answer&&typeof s.expected_answer=="object"){let e=s.expected_answer;r.push(...c(s.kind??e.kind,e,"ac.expected_answer"))}return r}function p(n){return f[n]}function S(n,s,i,r){let e=p(n);if(!e)return[{code:"UNKNOWN_EDGE_TYPE",detail:`unknown edge type ${JSON.stringify(n)}`}];let o=[];e.src.includes(s)||o.push({code:"ILLEGAL_EDGE",detail:`${n} src must be ${e.src.join("|")}, got ${s}`}),e.dst.includes(i)||o.push({code:"ILLEGAL_EDGE",detail:`${n} dst must be ${e.dst.join("|")}, got ${i}`}),n==="depends_on"&&s!==i&&o.push({code:"ILLEGAL_EDGE",detail:`depends_on links same-label nodes only, got ${s}\u2192${i}`});for(let t of e.salient)(r[t]===void 0||r[t]===null)&&o.push({code:"MISSING_SALIENT",detail:`${n}.props.${t} is salient (inside the ecid) and required`});for(let t of Object.keys(r))r[t]!==void 0&&(e.props.includes(t)||o.push({code:"UNKNOWN_EDGE_PROP",detail:`${n}.props.${t} is not in the ${l} schema`}));return o}function k(n,s){let i=u[n];if(!i)return s;let r={};for(let e of i.hashed)s[e]!==void 0&&(r[e]=s[e]);return r}function N(n,s){let i=p(n);if(!i)return s;let r={};for(let e of i.salient)s[e]!==void 0&&(r[e]=s[e]);for(let e of i.optionalSalient??[])s[e]!==void 0&&(r[e]=s[e]);return r}export{l as a,u as b,f as c,y as d,h as e,m as f,p as g,S as h,k as i,N as j};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{i as v}from"./chunk-C44QQJR4.js";import{a as w}from"./chunk-6YGTRKDT.js";import{e as m}from"./chunk-UR6MHSHU.js";var f=m(w(),1);function E({onToggleThinking:d,onCtrlC:a,explorer:e,panel:n}){let t=(0,f.useRef)(null),u=(0,f.useRef)(""),c=()=>{t.current&&clearTimeout(t.current),t.current=null,u.current=""};return(0,f.useEffect)(()=>c,[]),v((o,r)=>{if(r.ctrl&&o==="t"){d();return}if(r.ctrl&&o==="c"){a();return}if(!r.ctrl&&o.includes("")){a();return}if(!r.ctrl&&o.includes("")){d();return}if(e&&e.isOpen()){let i=()=>{t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{c(),e.onBack()},150)};if(t.current){if(r.upArrow||r.downArrow||r.return){c(),r.return?e.onEnter():e.onMove(r.upArrow?-1:1);return}if(u.current+=o,u.current==="["){i();return}let l=u.current;c();let s=/^\[([AB])/.exec(l);if(s){e.onMove(s[1]==="A"?-1:1);return}e.onBack();return}if(r.upArrow){e.onMove(-1);return}if(r.downArrow){e.onMove(1);return}if(r.return){e.onEnter();return}if(r.escape){u.current="",i();return}if(o.length>=2&&!r.ctrl&&!r.meta){e.onClose();return}return}if(n&&n.isFocused()){let i=()=>{t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{c(),n.onBack()},150)};if(t.current){if(r.upArrow||r.downArrow||r.return){c(),r.return?n.onSelect():n.onMove(r.upArrow?-1:1);return}if(u.current+=o,u.current==="["){i();return}let l=u.current;c();let s=/^\[([AB])/.exec(l);if(s){n.onMove(s[1]==="A"?-1:1);return}n.onBack();return}if(r.upArrow){n.onMove(-1);return}if(r.downArrow){n.onMove(1);return}if(r.return){n.onSelect();return}if(r.escape){u.current="",i();return}if(/^[1-9]$/.test(o)){n.onDigit(Number(o));return}if(o&&!r.ctrl&&!r.meta){n.onType(o);return}return}}),null}export{E as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as m}from"./chunk-2WVKOZ6W.js";import{a as g}from"./chunk-
|
|
2
|
+
import{a as m}from"./chunk-2WVKOZ6W.js";import{a as g}from"./chunk-DNOBOZPO.js";import{b as f,c as j}from"./chunk-VE3SUJMA.js";var _="KaneAI Generated",E="Untitled";async function p(e){let r=e.config.load(),d=new m(g(e.env).tmsBaseUrl,e.tmsCreds.username,e.tmsCreds.access_key),n=e.projectName??_,o=e.folderName??E,t=r.project_id??null,s=r.project_name??null;if(!t){let a=(await d.listProjects()).find(l=>l.name===n);if(a)t=a.project_id,s=a.name,e.log("info","ENSURE_PROJECT_FOUND","Found default project",{project_id:t,name:s});else{let l=await d.createProject(n);t=l.id,s=l.name,e.log("info","ENSURE_PROJECT_CREATED","Created default project",{project_id:t,name:s})}f(e.creds,e.config,e.profile,e.env,{projectId:t,projectName:s})}let c=r.folder_id??null,i=r.folder_name??null,u=!r.project_id;if(!c||u){let a=(await d.listFolders(t)).find(l=>l.name===o);if(a)c=a.id,i=a.name,e.log("info","ENSURE_FOLDER_FOUND","Found default folder",{folder_id:c,name:i});else{let l=await d.createFolder(t,o);c=l.id,i=l.name,e.log("info","ENSURE_FOLDER_CREATED","Created default folder",{folder_id:c,name:i})}f(e.creds,e.config,e.profile,e.env,{folderId:c,folderName:i})}return{projectId:t,projectName:s??n,folderId:c,folderName:i??o}}function A(e,r,d){let n=e.loadProfileConfig(r,d)??{};return{projectId:n.project_id??null,folderId:n.folder_id??null}}function N(e,r){return e.projectId===null||e.folderId===null||r===null?"needs-picker":r.project==="ok"&&r.folder==="ok"?"ok":r.project==="error"&&r.folder==="error"?"ok-tms-degraded":"needs-picker"}var k=(e,r)=>`error: profile "${e}" (${r}) has no project/folder configured AND no TMS credentials were available to auto-configure one.
|
|
3
3
|
|
|
4
4
|
discover IDs:
|
|
5
5
|
kane-cli projects list --search "<keyword>" --limit 10
|