@testmuai/kane-cli 0.8.23 → 0.10.0-rc.1
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-VPD5G67Q.js +2 -0
- package/dist/ChromeProfilePicker-CRKQEFYD.js +2 -0
- package/dist/CliFeedbackPrompt-M7BMWLKK.js +2 -0
- package/dist/CliUploadProgress-OP7DXMC2.js +2 -0
- package/dist/ConfigView-XI74BCCH.js +2 -0
- package/dist/EvidenceViewOffer-HAAK6DS5.js +2 -0
- package/dist/FolderPicker-W5S6RFCP.js +2 -0
- package/dist/InfoBox-OWUEHV2D.js +2 -0
- package/dist/LinksBox-PNSESNCU.js +2 -0
- package/dist/ProfilesView-PYDZZHKO.js +2 -0
- package/dist/ProjectPicker-BGFCUGT5.js +2 -0
- package/dist/SaveSessionPrompt-SUJE54GS.js +2 -0
- package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
- package/dist/SingleShotApp-4TDXZEUA.js +2 -0
- package/dist/SummaryBox-FALOODAQ.js +2 -0
- package/dist/TestMdRunView-4GPRWHEU.js +2 -0
- package/dist/TestrunEvidenceTable-OBVQJ6IO.js +2 -0
- package/dist/WhoamiView-6WXGRANY.js +2 -0
- package/dist/{agent-parse-2MLJOJTH.js → agent-parse-CAS45UKA.js} +1 -1
- package/dist/app-client-U2YYF65L.js +2 -0
- package/dist/app-download-RXVZB6MM.js +2 -0
- package/dist/assurance-job-C3TXZGLL.js +7 -0
- package/dist/auth-7Z54TMQQ.js +2 -0
- package/dist/{binary-MOJTQGUV.js → binary-DJCDMGPX.js} +1 -1
- package/dist/bind-XVO4CQYV.js +2 -0
- package/dist/bootstrap-TY5RANJ7.js +2 -0
- package/dist/bridge-T6QMYKED.js +2 -0
- package/dist/build-5ZN47FAT.js +2 -0
- package/dist/catalog-RRQF4TCA.js +2 -0
- package/dist/{changelog-2N6HKKKQ.js → changelog-GBEVIUFJ.js} +1 -1
- package/dist/chat-committer-ZCSRJEUB.js +2 -0
- package/dist/chat-controller-XINCDH6Z.js +2 -0
- package/dist/child-G2GCW73X.js +2 -0
- package/dist/chunk-22PIMG52.js +2 -0
- package/dist/chunk-252FWF2G.js +19 -0
- package/dist/{chunk-AT3RME5W.js → chunk-2IZRPMZN.js} +1 -1
- package/dist/chunk-2NFS4KE4.js +2 -0
- package/dist/{chunk-LHUW5QDT.js → chunk-2OOFURWD.js} +1 -1
- package/dist/chunk-2OSFI33O.js +97 -0
- package/dist/chunk-2S3W2JT3.js +5 -0
- package/dist/chunk-2SWSVJUP.js +12 -0
- package/dist/chunk-2TVPA3LL.js +2 -0
- package/dist/chunk-2XW33VOK.js +2 -0
- package/dist/chunk-33DWJV67.js +235 -0
- package/dist/chunk-34R7BNZ2.js +2 -0
- package/dist/chunk-35ECWCCK.js +2 -0
- package/dist/chunk-3BSYOCSW.js +3 -0
- package/dist/chunk-3G2LSTK5.js +2 -0
- package/dist/chunk-3GXN6VF6.js +2 -0
- package/dist/chunk-3JLEDSG5.js +4 -0
- package/dist/chunk-3QICDXY5.js +5 -0
- package/dist/chunk-3UVSAAES.js +10 -0
- package/dist/chunk-42PALMW2.js +4 -0
- package/dist/chunk-432ZOE42.js +21 -0
- package/dist/chunk-44B6THYK.js +2 -0
- package/dist/chunk-47WQBG5I.js +6 -0
- package/dist/{chunk-J2FJ62K4.js → chunk-4D5PC6QE.js} +1 -1
- package/dist/chunk-4I7YN6YY.js +3 -0
- package/dist/chunk-4IEQNX7F.js +2 -0
- package/dist/{chunk-SYJXTB4J.js → chunk-4LPX2OLV.js} +1 -1
- package/dist/chunk-4LTHDJ3D.js +2 -0
- package/dist/chunk-4QTH7VYE.js +2 -0
- package/dist/chunk-54XA5MZH.js +2 -0
- package/dist/chunk-57MDWTON.js +2 -0
- package/dist/{chunk-3C32LVLX.js → chunk-5BUIIFLC.js} +1 -1
- package/dist/chunk-5D7ENQTQ.js +2 -0
- package/dist/chunk-63EKRZKI.js +2 -0
- package/dist/{chunk-EHN5HTUD.js → chunk-65VANXOF.js} +51 -51
- package/dist/chunk-672CQECV.js +47 -0
- package/dist/chunk-6LIC2R22.js +3 -0
- package/dist/chunk-6NFOH4AC.js +4 -0
- package/dist/chunk-6NWT2TEJ.js +2 -0
- package/dist/chunk-6PIIUAZF.js +3 -0
- package/dist/{chunk-MBJHS653.js → chunk-6U7ID777.js} +1 -1
- package/dist/chunk-6UVIY56J.js +2 -0
- package/dist/chunk-72KYMWQ5.js +2 -0
- package/dist/chunk-72RC7JSA.js +21 -0
- package/dist/chunk-74W4AOT2.js +2 -0
- package/dist/chunk-77ZZQJLX.js +2 -0
- package/dist/chunk-7DFBOVUB.js +2 -0
- package/dist/chunk-7EXDYXXD.js +2 -0
- package/dist/chunk-7HO4NX5W.js +1 -0
- package/dist/chunk-7KX2BHKG.js +2 -0
- package/dist/chunk-7LKCWO2R.js +11 -0
- package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
- package/dist/chunk-7RPKHKA3.js +2 -0
- package/dist/chunk-7RWP4Y3H.js +2 -0
- package/dist/chunk-7V4BQSSV.js +2 -0
- package/dist/chunk-7XBNMOH4.js +6 -0
- package/dist/chunk-A6TJOZ24.js +2 -0
- package/dist/chunk-A7RJQJNT.js +2 -0
- package/dist/chunk-AA674WLL.js +2 -0
- package/dist/chunk-AIXJYMSP.js +9 -0
- package/dist/chunk-AJQZ3ST5.js +8 -0
- package/dist/chunk-AQ2OG2EF.js +2 -0
- package/dist/chunk-AUJSC7PU.js +4 -0
- package/dist/chunk-AVI5H4UM.js +13 -0
- package/dist/chunk-AZLNLHUA.js +4 -0
- package/dist/chunk-B2HXPGIZ.js +26 -0
- package/dist/chunk-B7ZX5HEN.js +8 -0
- package/dist/{chunk-XQQHSC7G.js → chunk-BJJUKB5K.js} +1 -1
- package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
- package/dist/{chunk-TONFENRW.js → chunk-BVO4C5F2.js} +1 -1
- package/dist/chunk-BWXLZS5O.js +2 -0
- package/dist/chunk-BY65QAAN.js +4 -0
- package/dist/chunk-BZVNI44O.js +6 -0
- package/dist/chunk-C5Z7MQE6.js +2 -0
- package/dist/chunk-C6HI6Y3S.js +2 -0
- package/dist/chunk-CB4ARIHR.js +2 -0
- package/dist/chunk-CPBBYNL7.js +4 -0
- package/dist/{chunk-GFNCGN5V.js → chunk-D4FFXCX6.js} +2 -2
- package/dist/chunk-D756UWY2.js +6 -0
- package/dist/chunk-DBMW3VUN.js +4 -0
- package/dist/chunk-DD5TULWQ.js +34 -0
- package/dist/{chunk-SY4T44VC.js → chunk-DDJNYQBH.js} +1 -1
- package/dist/{chunk-KJIDMW6N.js → chunk-DHQ4SQWA.js} +1 -1
- package/dist/chunk-DNGOT65K.js +3 -0
- package/dist/chunk-DPGOAFKF.js +2 -0
- package/dist/chunk-DREQ3RAA.js +2 -0
- package/dist/chunk-DTUPEKEO.js +2 -0
- package/dist/chunk-E6KSRQXL.js +8 -0
- package/dist/chunk-EF47KRUK.js +2 -0
- package/dist/chunk-ENL4XTQ2.js +2 -0
- package/dist/chunk-EXFDIVNI.js +9 -0
- package/dist/chunk-EZN7CF45.js +4 -0
- package/dist/chunk-F3U6T4YD.js +22 -0
- package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
- package/dist/chunk-FFL55I2M.js +2 -0
- package/dist/chunk-FIP5L6LV.js +9 -0
- package/dist/chunk-FOJHSG5M.js +6 -0
- package/dist/chunk-FSYOTRMC.js +2 -0
- package/dist/chunk-GFLB2SHW.js +2 -0
- package/dist/chunk-GMTHZUZ3.js +2 -0
- package/dist/chunk-GRURFGBP.js +2 -0
- package/dist/chunk-GZFLJORM.js +2 -0
- package/dist/{chunk-PXHN7SFG.js → chunk-H3HHSTEK.js} +4 -4
- package/dist/chunk-HAW5WEKT.js +13 -0
- package/dist/chunk-HFJSP4KD.js +2 -0
- package/dist/chunk-HHW6MRU3.js +6 -0
- package/dist/chunk-HIUAUZNL.js +2 -0
- package/dist/chunk-HJLMH7ZM.js +2 -0
- package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
- package/dist/chunk-I2KOGINW.js +7 -0
- package/dist/chunk-I2MC6VVX.js +2 -0
- package/dist/chunk-I5NSJBOZ.js +2 -0
- package/dist/chunk-I6OQISK4.js +2 -0
- package/dist/chunk-IBBD36FQ.js +2 -0
- package/dist/chunk-IINZZ4BZ.js +2 -0
- package/dist/{chunk-UYI4WPNQ.js → chunk-IMDMRJQ6.js} +2 -2
- package/dist/chunk-IXW7FOGX.js +2 -0
- package/dist/chunk-IZ65ZPWY.js +3 -0
- package/dist/chunk-JD52IXON.js +9 -0
- package/dist/chunk-JGRXMTME.js +15 -0
- package/dist/{chunk-NBXYL2JT.js → chunk-JIRNI5TB.js} +7 -7
- package/dist/chunk-JNSWKGTB.js +2 -0
- package/dist/chunk-JPYW6U4D.js +2 -0
- package/dist/chunk-JQSLUGD4.js +3 -0
- package/dist/chunk-K45BKGB5.js +8 -0
- package/dist/chunk-KF4DKXSS.js +2 -0
- package/dist/chunk-KGNE5CIM.js +2 -0
- package/dist/chunk-KM3YCIDV.js +3 -0
- package/dist/chunk-KU3YHPWZ.js +2 -0
- package/dist/chunk-L4UVUFL6.js +3 -0
- package/dist/chunk-LCSJ7GOG.js +2 -0
- package/dist/chunk-LKQFG4RW.js +5 -0
- package/dist/chunk-LNNWCBPQ.js +2 -0
- package/dist/chunk-LRS5MGBY.js +3 -0
- package/dist/chunk-LRXBJTD4.js +4 -0
- package/dist/chunk-LSDJOVWW.js +6 -0
- package/dist/chunk-LWJRSUE2.js +2 -0
- package/dist/chunk-LX2I4JEH.js +2 -0
- package/dist/{chunk-K6VDRR3H.js → chunk-M6MBMRFR.js} +1 -1
- package/dist/chunk-MGNRNLBE.js +2 -0
- package/dist/chunk-MII3JOO3.js +4 -0
- package/dist/chunk-MNBGG4H3.js +16 -0
- package/dist/chunk-MYVKUJGS.js +2 -0
- package/dist/chunk-MYZHOBS4.js +2 -0
- package/dist/chunk-MZOIHUVX.js +27 -0
- package/dist/{chunk-OFRYEWZE.js → chunk-N3TCNZSX.js} +1 -1
- package/dist/chunk-NC7D7GOM.js +21 -0
- package/dist/{chunk-CLQP3DHT.js → chunk-NDEI7R4K.js} +1 -1
- package/dist/chunk-NFRA64NU.js +10 -0
- package/dist/chunk-NLZZLANH.js +4 -0
- package/dist/{chunk-5HOHXV2K.js → chunk-NQTYWHPB.js} +1 -1
- package/dist/chunk-NWBLYMH7.js +3 -0
- package/dist/chunk-NWD54VV5.js +2 -0
- package/dist/chunk-NXRF7FFS.js +2 -0
- package/dist/chunk-O3HHTKZ5.js +6 -0
- package/dist/{chunk-FPFS6OSR.js → chunk-OAKYUBD3.js} +1 -1
- package/dist/chunk-OEWYXCTA.js +7 -0
- package/dist/{chunk-BASTDR3M.js → chunk-OF7WPCTQ.js} +1 -1
- package/dist/chunk-OFSDB7B4.js +3 -0
- package/dist/chunk-OJ33Q6DU.js +2 -0
- package/dist/chunk-OQ5G773E.js +2 -0
- package/dist/chunk-OVNRRI4E.js +2 -0
- package/dist/{chunk-RAARDC2O.js → chunk-OZNBTSW5.js} +1 -1
- package/dist/chunk-P2ZQDQDB.js +2 -0
- package/dist/chunk-P7MSVLAH.js +6 -0
- package/dist/chunk-PUVMC4PX.js +26 -0
- package/dist/{chunk-SEEEGDVK.js → chunk-PZA3BSOE.js} +1 -1
- package/dist/chunk-Q3C6NDGI.js +2 -0
- package/dist/chunk-QCKA665H.js +2 -0
- package/dist/chunk-QDFY5GGO.js +5 -0
- package/dist/chunk-QHRUBG7J.js +2 -0
- package/dist/chunk-QI5RZ7LL.js +2 -0
- package/dist/chunk-QNLVC5ZB.js +2 -0
- package/dist/{chunk-DSKJ6J7Y.js → chunk-QQ4TKLWP.js} +1 -1
- package/dist/chunk-QS5ZJFGF.js +4 -0
- package/dist/chunk-QTZBVDPR.js +12 -0
- package/dist/chunk-QXQ7KVEN.js +2 -0
- package/dist/chunk-R4JUKTDO.js +2 -0
- package/dist/chunk-R7KXAISS.js +12 -0
- package/dist/chunk-RDP7GWSY.js +2 -0
- package/dist/chunk-REKHAN53.js +5 -0
- package/dist/{chunk-5RHR4DMF.js → chunk-RFEON5GN.js} +1 -1
- package/dist/chunk-RFIIM33J.js +2 -0
- package/dist/chunk-RG372DON.js +6 -0
- package/dist/chunk-RPRXRKKR.js +2 -0
- package/dist/chunk-RTVWQK7I.js +2 -0
- package/dist/chunk-RW3Z2HMB.js +7 -0
- package/dist/chunk-RX47NRSM.js +2 -0
- package/dist/chunk-RX6776AI.js +5 -0
- package/dist/chunk-S53AQU7R.js +6 -0
- package/dist/{chunk-HJX5PQRD.js → chunk-SA6IKFFD.js} +1 -1
- package/dist/{chunk-2MEQTHNI.js → chunk-SLKYD44Y.js} +1 -1
- package/dist/chunk-SMTBOSEJ.js +2 -0
- package/dist/chunk-SMXABALN.js +2 -0
- package/dist/chunk-SONMD3W5.js +5 -0
- package/dist/chunk-SWMTXMKB.js +2 -0
- package/dist/chunk-SXRHKXSE.js +2 -0
- package/dist/chunk-T3HEJASG.js +5 -0
- package/dist/chunk-T4AVLJCW.js +6 -0
- package/dist/{chunk-J6TBTWW7.js → chunk-T6K2MEWP.js} +1 -1
- package/dist/{chunk-D6BULK7E.js → chunk-T7H4LBFK.js} +1 -1
- package/dist/chunk-TNORODUF.js +2 -0
- package/dist/chunk-TW63WWEN.js +2 -0
- package/dist/chunk-UALJTPSA.js +18 -0
- package/dist/chunk-UAWWLLTI.js +2 -0
- package/dist/chunk-UEE3RZN4.js +14 -0
- package/dist/chunk-UTM7D4PI.js +2 -0
- package/dist/chunk-UUJIGOEO.js +2 -0
- package/dist/chunk-UYDHOHSZ.js +2 -0
- package/dist/chunk-V5JGXOV7.js +2 -0
- package/dist/chunk-V7S6S5W3.js +2 -0
- package/dist/{chunk-HBSYBL6J.js → chunk-VG44B5JD.js} +1 -1
- package/dist/chunk-VJGWVBZR.js +1 -0
- package/dist/chunk-VLDCHFXF.js +2 -0
- package/dist/chunk-VO66KP2W.js +2 -0
- package/dist/{chunk-D4XR7EEQ.js → chunk-VQLH63X7.js} +14 -12
- package/dist/chunk-VRIZDOO5.js +2 -0
- package/dist/chunk-VYHT2IET.js +1397 -0
- package/dist/chunk-VZJ6LUXX.js +2 -0
- package/dist/chunk-W3OVSDBN.js +29 -0
- package/dist/chunk-W7FLXW6Q.js +5 -0
- package/dist/{chunk-IEW7AW64.js → chunk-WEM3MOAL.js} +1 -1
- package/dist/chunk-WI7K6VKQ.js +2 -0
- package/dist/chunk-WMGKUERB.js +6 -0
- package/dist/{chunk-DFS4RMVP.js → chunk-WN5VKKJ3.js} +1 -1
- package/dist/chunk-WOSANGV6.js +5 -0
- package/dist/chunk-WYSZ6TPW.js +15 -0
- package/dist/chunk-XB6BJPDL.js +2 -0
- package/dist/{chunk-5ESGUPSR.js → chunk-XBEYWXPV.js} +1 -1
- package/dist/chunk-XIPKSXRQ.js +16 -0
- package/dist/chunk-XJ7HCXKW.js +2 -0
- package/dist/chunk-XMPTFXPW.js +5 -0
- package/dist/chunk-XZYA7DNH.js +2 -0
- package/dist/chunk-Y4T4SLDO.js +2 -0
- package/dist/chunk-Y6Y6RAY4.js +2 -0
- package/dist/chunk-YDPTSDIJ.js +2 -0
- package/dist/chunk-YDSGXB25.js +2 -0
- package/dist/chunk-YIKF4ERQ.js +375 -0
- package/dist/chunk-Z55KBMYV.js +2 -0
- package/dist/chunk-ZCRZFAOT.js +2 -0
- package/dist/chunk-ZFM77AQU.js +2 -0
- package/dist/{chunk-Q6F23V7L.js → chunk-ZFMRQ57Y.js} +1 -1
- package/dist/chunk-ZHWU6L2G.js +5 -0
- package/dist/chunk-ZTHYAHDN.js +17 -0
- package/dist/chunk-ZZP5SHUV.js +3 -0
- package/dist/committer-JGY66PFM.js +2 -0
- package/dist/config-5ZOALGKE.js +2 -0
- package/dist/controller-client-PB3AZAGG.js +2 -0
- package/dist/cover-cmd-UA2SVIZZ.js +2 -0
- package/dist/{credentials-PSQWWFGD.js → credentials-MRG452Y6.js} +1 -1
- package/dist/{deps-bundle-PPOQHJTB.js → deps-bundle-FWINW4XM.js} +1 -1
- package/dist/{deps-resolve-AX6ZAKLH.js → deps-resolve-IET4KIBO.js} +1 -1
- package/dist/descriptor-7T32VRMB.js +2 -0
- package/dist/design-chat-MM5PJD2N.js +2 -0
- package/dist/design-committer-TRYP3LOZ.js +2 -0
- package/dist/design-headless-FZONCKHW.js +2 -0
- package/dist/design-remote-SPVRIY2H.js +3 -0
- package/dist/device-env-LXJ65AVF.js +2 -0
- package/dist/dispatch-DVQ3H7EJ.js +2 -0
- package/dist/doctor-VAX2BWQF.js +2 -0
- package/dist/docx-convert-6IZO5P5K.js +2 -0
- package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
- package/dist/evidence-LVVK7ROT.js +2 -0
- package/dist/evidence-presentation-YYTIDCBS.js +2 -0
- package/dist/evolve-cmd-AGRKG7T3.js +2 -0
- package/dist/evolve-remote-BGHULJTL.js +2 -0
- package/dist/{exit-manager-ZLDO54S4.js → exit-manager-EDHCETUN.js} +1 -1
- package/dist/explain-DGJ5T6V5.js +2 -0
- package/dist/explain-cmd-VYAANFFZ.js +4 -0
- package/dist/explain-cmd-WOBGS6KX.js +12 -0
- package/dist/explore-LOKNOVNP.js +2 -0
- package/dist/explore-context-tty-JTZVZFOE.js +2 -0
- package/dist/explore-entry-5OGNLFAU.js +6 -0
- package/dist/explore-live-2XZHUYFS.js +5 -0
- package/dist/explore-run-tty-LGTIK2NA.js +5 -0
- package/dist/extract-bind-NM2BBK4I.js +14 -0
- package/dist/extract-chat-HLQMJJIC.js +2 -0
- package/dist/extract-cmd-T2TSAC3N.js +6 -0
- package/dist/extract-headless-OQTQ3FJK.js +2 -0
- package/dist/feeder-NY45UFJK.js +2 -0
- package/dist/folder-flags-WXUR6OPJ.js +2 -0
- package/dist/gaps-cmd-PTSKPTF7.js +3 -0
- package/dist/gate-P57VP4E5.js +2 -0
- package/dist/gate-WISOUTHQ.js +2 -0
- package/dist/{generate-headless-TEDHS3F2.js → generate-headless-JYZP6VXZ.js} +3 -3
- package/dist/headless-io-FFM5T6KL.js +2 -0
- package/dist/hold-passthrough-IOWPVB4W.js +2 -0
- package/dist/identity-HL5CJJXR.js +2 -0
- package/dist/index.js +194 -175
- package/dist/ingest-PDGS5ZTL.js +2 -0
- package/dist/ingest-cmd-LHCBMO4Z.js +8 -0
- package/dist/ingest-remote-D5TO5JQP.js +2 -0
- package/dist/ink-screen-RZ7QDIUI.js +2 -0
- package/dist/install-Z6K2D2VY.js +2 -0
- package/dist/interactive-bind-5EJQUGKI.js +26 -0
- package/dist/interactive-remote-D77ULJGL.js +65 -0
- package/dist/interrupt-guard-QETBPINI.js +2 -0
- package/dist/lane-AQYRIW24.js +2 -0
- package/dist/lattice-auth-74XGF77Y.js +2 -0
- package/dist/lifecycle-cmd-7SM6UCMH.js +2 -0
- package/dist/list-cmd-Z6FZXMFU.js +3 -0
- package/dist/list-commands-CZYZ7GIG.js +2 -0
- package/dist/list-remote-WOPOC6KK.js +15 -0
- package/dist/locks-cmd-JJ2QNTNY.js +2 -0
- package/dist/logical-ids-RXAQJZ3T.js +2 -0
- package/dist/login-flow-2FZEOVHM.js +2 -0
- package/dist/maintenance-cmd-VRTGZVRE.js +2 -0
- package/dist/mobile-prompts-KNAHU64X.js +2 -0
- package/dist/{next-KZXH4UA4.js → next-O6SUSX3R.js} +1 -1
- package/dist/{objective-variable-gate-JALOH6SL.js → objective-variable-gate-3Z7DNVVC.js} +1 -1
- package/dist/onboarding-LGT6PMDZ.js +5 -0
- package/dist/open-provider-OZAG6WZS.js +2 -0
- package/dist/{paths-JCYX6UWL.js → paths-UMIX3RJF.js} +1 -1
- package/dist/pdf-convert-447ACUB3.js +2 -0
- package/dist/persist-recorded-session-BX7II5P7.js +3 -0
- package/dist/phase-seed-LCJ4WSYV.js +2 -0
- package/dist/pipeline-IXVTVRS5.js +2 -0
- package/dist/prepare-target-ULMKVKMC.js +2 -0
- package/dist/pull-cmd-6AL2WYHB.js +2 -0
- package/dist/pull-route-TTVARJMV.js +2 -0
- package/dist/readmodel-INMP6MNW.js +2 -0
- package/dist/real-device-run-2LFS5WE2.js +2 -0
- package/dist/reconcile-cmd-R6H37SQR.js +5 -0
- package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
- package/dist/reconcile-remote-GWDV5CUT.js +13 -0
- package/dist/recording-banner-ACC67Q2U.js +2 -0
- package/dist/registry-6IJYQXQC.js +2 -0
- package/dist/remote-entry-YL7O2NJQ.js +2 -0
- package/dist/remote-mode-7G6PLJCW.js +4 -0
- package/dist/remote-words-45USLRVN.js +2 -0
- package/dist/require-project-folder-A3UDRELU.js +2 -0
- package/dist/resolve-run-intent-ZGPSUBXV.js +2 -0
- package/dist/resolver-IPM6R7U4.js +2 -0
- package/dist/revert-FHOBLZWF.js +2 -0
- package/dist/review-cmd-NNT5C5RZ.js +5 -0
- package/dist/run-5RQUCNYP.js +2 -0
- package/dist/run-PC5YO4AS.js +2 -0
- package/dist/run-channel-63SVP5OI.js +2 -0
- package/dist/run-remote-3AYYVPKX.js +2 -0
- package/dist/run-startup-gate-NKRMKYBB.js +2 -0
- package/dist/run-test-md-HE6DUWQR.js +17 -0
- package/dist/scrollback-GGNBDFQV.js +2 -0
- package/dist/session-target-DD53UXO7.js +2 -0
- package/dist/session-worker.js +12 -0
- package/dist/sessions-CFV7FOIT.js +2 -0
- package/dist/sessions-cmd-GYMETJHG.js +26 -0
- package/dist/sessions-remote-GI7GOBMH.js +3 -0
- package/dist/shell-arg-FN3MT5U7.js +2 -0
- package/dist/{skill-installer-T2IOCPET.js → skill-installer-3QAVQGDH.js} +1 -1
- package/dist/spawner-C7NLLM4F.js +2 -0
- package/dist/store-X6XPFSKF.js +2 -0
- package/dist/store-choice-RT73HAI7.js +2 -0
- package/dist/store-guard-SNWKLHQV.js +2 -0
- package/dist/store-id-YZ5WKJ25.js +2 -0
- package/dist/store-site-KA2DNBGY.js +2 -0
- package/dist/stream-warnings-GEQKKJU7.js +2 -0
- package/dist/structured-answers-EQ2AP3F7.js +2 -0
- package/dist/sync-cmd-NBPPDG3B.js +2 -0
- package/dist/sync-setup-5NUCH6N3.js +2 -0
- package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
- package/dist/tcg-generate-Z23CUISY.js +2 -0
- package/dist/test-definition-VRI4YIYL.js +2 -0
- package/dist/testmd-actions-GH5BW5V5.js +2 -0
- package/dist/testmd-sync-ACKCIOL3.js +2 -0
- package/dist/tms-client-NXAB6VJD.js +2 -0
- package/dist/token-refresh-4UCYAG6A.js +2 -0
- package/dist/trust-gate-AT2XBWN4.js +2 -0
- package/dist/turn-preflight-LHYLRL7G.js +2 -0
- package/dist/ui-SNV3FD2G.js +4 -0
- package/dist/use-case-ref-NE4X4MZN.js +2 -0
- package/dist/validate-basic-RE2WLIGQ.js +2 -0
- package/dist/{variable-receipt-F55CSW5Z.js → variable-receipt-BXSZO36E.js} +1 -1
- package/dist/verdicts-XK3GAUX3.js +2 -0
- package/dist/version-check-4FJVZP3K.js +2 -0
- package/dist/{view-cmd-ELDKYRMZ.js → view-cmd-N47BQZPD.js} +4 -3
- package/dist/walk-session-DA7QWXSW.js +2 -0
- package/dist/with-telemetry-7V4LY2BG.js +2 -0
- package/package.json +11 -11
- package/dist/ChatSurface-GBZX4LWL.js +0 -8
- package/dist/ChromeProfilePicker-UONX2UVC.js +0 -2
- package/dist/CliFeedbackPrompt-6BJCNRNG.js +0 -2
- package/dist/CliUploadProgress-K4Z22DSY.js +0 -2
- package/dist/ConfigView-BB22G7JO.js +0 -2
- package/dist/EvidenceViewOffer-25IQF3TX.js +0 -2
- package/dist/FolderPicker-65JFR2NW.js +0 -2
- package/dist/InfoBox-OU5PLRIL.js +0 -2
- package/dist/LinksBox-DH7TSUXW.js +0 -2
- package/dist/ProfilesView-MGJKBOF5.js +0 -2
- package/dist/ProjectPicker-YFV6K77F.js +0 -2
- package/dist/SaveSessionPrompt-64QKQB6B.js +0 -2
- package/dist/ScrollbackTap-QHJOFYMC.js +0 -2
- package/dist/SingleShotApp-VYKUCRVW.js +0 -2
- package/dist/SummaryBox-DGS3LVRF.js +0 -2
- package/dist/TestMdRunView-LKAITAA4.js +0 -2
- package/dist/TestrunEvidenceTable-PHBAB4XQ.js +0 -2
- package/dist/WhoamiView-6HWPYN6Y.js +0 -2
- package/dist/app-client-ZCCNE3RV.js +0 -2
- package/dist/app-download-SQ2LYYL7.js +0 -2
- package/dist/auth-NWBIFCB7.js +0 -2
- package/dist/bind-S3IQTPNN.js +0 -15
- package/dist/bootstrap-RCV7PNMQ.js +0 -2
- package/dist/bridge-O7ENTV4K.js +0 -2
- package/dist/build-JIKYOZUH.js +0 -2
- package/dist/chat-committer-6D7AQI6Z.js +0 -2
- package/dist/chat-controller-UJQ6Z4RE.js +0 -2
- package/dist/chunk-2A7OQRAD.js +0 -17
- package/dist/chunk-2FH4HJYB.js +0 -5
- package/dist/chunk-2KVECC36.js +0 -2
- package/dist/chunk-2YEHV2CX.js +0 -2
- package/dist/chunk-3OKX64UR.js +0 -2
- package/dist/chunk-3UI5VTQS.js +0 -4
- package/dist/chunk-3UMVRJX3.js +0 -6
- package/dist/chunk-3VAU3PNU.js +0 -2
- package/dist/chunk-5EOX4MEY.js +0 -2
- package/dist/chunk-5LJRZI7S.js +0 -6
- package/dist/chunk-5UHY3PTQ.js +0 -3
- package/dist/chunk-5ZFOKYFB.js +0 -5
- package/dist/chunk-63DYVWNX.js +0 -2
- package/dist/chunk-6YZ3VP3E.js +0 -2
- package/dist/chunk-7KRY26OF.js +0 -4
- package/dist/chunk-7N6OCHPC.js +0 -7
- package/dist/chunk-A2SQD2AY.js +0 -4
- package/dist/chunk-AACQE24F.js +0 -2
- package/dist/chunk-AGDPEZXT.js +0 -4
- package/dist/chunk-AIK7BAME.js +0 -8
- package/dist/chunk-ATYXPCM6.js +0 -6
- package/dist/chunk-AXTPNZPX.js +0 -2
- package/dist/chunk-BB2W35TW.js +0 -2
- package/dist/chunk-BKM2LWU2.js +0 -3
- package/dist/chunk-BL5QHONU.js +0 -2
- package/dist/chunk-C44QQJR4.js +0 -239
- package/dist/chunk-C7NWWGLT.js +0 -6
- package/dist/chunk-CAJZQQ3G.js +0 -3
- package/dist/chunk-CSVPZ33X.js +0 -2
- package/dist/chunk-CXF6AZWY.js +0 -2
- package/dist/chunk-D6E6KRVX.js +0 -2
- package/dist/chunk-D7WG7SRA.js +0 -2
- package/dist/chunk-DDHGEJJP.js +0 -2
- package/dist/chunk-DUYRCVI5.js +0 -2
- package/dist/chunk-DWHF5HUD.js +0 -2
- package/dist/chunk-EM3PU2YW.js +0 -2
- package/dist/chunk-EVFFDODK.js +0 -5
- package/dist/chunk-EYOCNMUM.js +0 -2
- package/dist/chunk-F2OBORCG.js +0 -2
- package/dist/chunk-FMBPUXWL.js +0 -8
- package/dist/chunk-FORNRNHU.js +0 -2
- package/dist/chunk-FQJOWUEN.js +0 -2
- package/dist/chunk-FQNQVC5O.js +0 -5
- package/dist/chunk-FY7TCYPK.js +0 -6
- package/dist/chunk-HJGVM6TS.js +0 -370
- package/dist/chunk-HPHETGRE.js +0 -2
- package/dist/chunk-I7TIGB7K.js +0 -2
- package/dist/chunk-IGHK2ENL.js +0 -2
- package/dist/chunk-IICT4VOU.js +0 -2
- package/dist/chunk-IIDBLJ5A.js +0 -18
- package/dist/chunk-JFZA4UON.js +0 -9
- package/dist/chunk-K2UJYY2U.js +0 -2
- package/dist/chunk-KBM3XHAM.js +0 -2
- package/dist/chunk-KDNNMU7Q.js +0 -4
- package/dist/chunk-KJQNAOOE.js +0 -6
- package/dist/chunk-LF42V6P6.js +0 -7
- package/dist/chunk-LNFU4JZ7.js +0 -2
- package/dist/chunk-LNSBC32V.js +0 -2
- package/dist/chunk-LSDWPG6C.js +0 -2
- package/dist/chunk-MKMJOMLX.js +0 -8
- package/dist/chunk-MKQ7ZRDW.js +0 -2
- package/dist/chunk-MSGW4JDG.js +0 -2
- package/dist/chunk-MV3Q335C.js +0 -7
- package/dist/chunk-MWIE6LOZ.js +0 -4
- package/dist/chunk-MZ7W4WLF.js +0 -4
- package/dist/chunk-NIFJJX6N.js +0 -12
- package/dist/chunk-NJ4BXZBX.js +0 -2
- package/dist/chunk-NLCCBXXV.js +0 -2
- package/dist/chunk-ODU2JSMA.js +0 -8
- package/dist/chunk-OYKRCDT4.js +0 -15
- package/dist/chunk-Q2F5QB2W.js +0 -2
- package/dist/chunk-Q4YYAN6E.js +0 -2
- package/dist/chunk-Q6AHSGOE.js +0 -5
- package/dist/chunk-QAG67DUT.js +0 -2
- package/dist/chunk-QGXVQIN5.js +0 -27
- package/dist/chunk-QQCEP3QP.js +0 -2
- package/dist/chunk-QU7P7B3W.js +0 -4
- package/dist/chunk-RAPV3BTA.js +0 -98
- package/dist/chunk-RD72POF2.js +0 -2
- package/dist/chunk-RDHWNSDP.js +0 -7
- package/dist/chunk-RGRFL7XG.js +0 -29
- package/dist/chunk-RKXHVP2Z.js +0 -2
- package/dist/chunk-RMVASIVL.js +0 -35
- package/dist/chunk-RRY5IXOB.js +0 -2
- package/dist/chunk-RSSOJ3L2.js +0 -21
- package/dist/chunk-SB2SKN34.js +0 -2
- package/dist/chunk-SFFDVF3J.js +0 -9
- package/dist/chunk-T2ONUKTL.js +0 -5
- package/dist/chunk-TAOHYWEO.js +0 -2
- package/dist/chunk-U6OTFMIT.js +0 -4
- package/dist/chunk-UD7KKHPW.js +0 -5
- package/dist/chunk-UF4MU2AZ.js +0 -22
- package/dist/chunk-UQSVO7TY.js +0 -9
- package/dist/chunk-URWWROLS.js +0 -9
- package/dist/chunk-V4B5QA3U.js +0 -4
- package/dist/chunk-VACHFCNC.js +0 -21
- package/dist/chunk-VAN7ECN6.js +0 -2
- package/dist/chunk-VIO7CCFW.js +0 -5
- package/dist/chunk-VOYMN2WQ.js +0 -5
- package/dist/chunk-VVOKM2VO.js +0 -2
- package/dist/chunk-W5TTF7GB.js +0 -6
- package/dist/chunk-WESMQEPO.js +0 -2
- package/dist/chunk-WICJY6KL.js +0 -6
- package/dist/chunk-WJR2FU7S.js +0 -16
- package/dist/chunk-WVHMPIDQ.js +0 -2
- package/dist/chunk-X4NUVVCJ.js +0 -26
- package/dist/chunk-XLSOQLVT.js +0 -2
- package/dist/chunk-YCCUBQY4.js +0 -2
- package/dist/chunk-YFQGOOF7.js +0 -2
- package/dist/chunk-YI3H2UIB.js +0 -2
- package/dist/chunk-YKTYVJBN.js +0 -3
- package/dist/chunk-YLQHY4A7.js +0 -2
- package/dist/chunk-ZIHG6EKH.js +0 -2
- package/dist/chunk-ZKSN2SJ7.js +0 -2
- package/dist/chunk-ZLWURCJ7.js +0 -2
- package/dist/committer-2QPBANRD.js +0 -2
- package/dist/config-7E4NS553.js +0 -2
- package/dist/controller-client-ZF5IXRUV.js +0 -2
- package/dist/cover-cmd-6KZX46S2.js +0 -3
- package/dist/descriptor-3JJUOHBM.js +0 -2
- package/dist/design-committer-D44GSUXY.js +0 -2
- package/dist/device-env-TZQDB5T3.js +0 -2
- package/dist/dispatch-KMWEDMKE.js +0 -2
- package/dist/doctor-XDF3MA4W.js +0 -2
- package/dist/docx-convert-SQRTF7XS.js +0 -2
- package/dist/evidence-EUIDOVOR.js +0 -2
- package/dist/evidence-presentation-XF23B7F2.js +0 -2
- package/dist/evolve-cmd-QVTGTCJ5.js +0 -2
- package/dist/explain-NEFBUX5G.js +0 -2
- package/dist/explain-cmd-36SVSHU7.js +0 -9
- package/dist/explain-cmd-JAOHSI4F.js +0 -3
- package/dist/extract-bind-PLMSZKLZ.js +0 -14
- package/dist/extract-cmd-RJBHPPF3.js +0 -5
- package/dist/feeder-66TUPB2R.js +0 -2
- package/dist/gaps-cmd-3WZPDDYS.js +0 -3
- package/dist/gate-OYRDJMF6.js +0 -2
- package/dist/headless-io-75HUMWZB.js +0 -2
- package/dist/identity-ADZ4PAJF.js +0 -2
- package/dist/ingest-OSNNM3DH.js +0 -2
- package/dist/ingest-cmd-JDIOPJBN.js +0 -2
- package/dist/install-Y3VKFBK3.js +0 -2
- package/dist/interactive-bind-XUMKEGAN.js +0 -26
- package/dist/interrupt-guard-UREUWNRL.js +0 -2
- package/dist/lifecycle-cmd-FBDRFIOE.js +0 -2
- package/dist/list-cmd-TFUACRAM.js +0 -3
- package/dist/list-commands-OHIQFJGQ.js +0 -2
- package/dist/locks-cmd-67OHQZNV.js +0 -2
- package/dist/logical-ids-GLVM2SVR.js +0 -2
- package/dist/login-flow-OHNKSVYZ.js +0 -2
- package/dist/maintenance-cmd-7OSUIDL4.js +0 -2
- package/dist/mobile-prompts-DEVUZRG3.js +0 -2
- package/dist/open-provider-746LLSEO.js +0 -2
- package/dist/pdf-convert-RLXSXFWN.js +0 -2
- package/dist/persist-recorded-session-GPP6UKN6.js +0 -3
- package/dist/phase-seed-MKHEWUN6.js +0 -2
- package/dist/pipeline-QPTPZVUJ.js +0 -2
- package/dist/prepare-target-N7QRNYOS.js +0 -2
- package/dist/readmodel-FVLRQWZ7.js +0 -2
- package/dist/reconcile-cmd-SMGLHMLF.js +0 -2
- package/dist/reconcile-deps-DVIJK5UZ.js +0 -4
- package/dist/reconcile-engine-KL2J5SNQ.js +0 -2
- package/dist/recording-banner-TCFFB6KE.js +0 -2
- package/dist/records-LMCVKPE5.js +0 -2
- package/dist/registry-BFFA4YJK.js +0 -2
- package/dist/require-project-folder-2224ZMJ5.js +0 -2
- package/dist/resolve-run-intent-HFXGEOYK.js +0 -2
- package/dist/resolver-GJR2Z7JY.js +0 -2
- package/dist/revert-NOUECRW4.js +0 -2
- package/dist/review-cmd-CQE6SBZA.js +0 -5
- package/dist/run-BXKWDJFJ.js +0 -2
- package/dist/run-HSP2MZPU.js +0 -2
- package/dist/run-channel-RGH4WIQX.js +0 -2
- package/dist/run-test-md-2ELPAASM.js +0 -17
- package/dist/scrollback-JLPJR25X.js +0 -2
- package/dist/session-items-2ATN7VXG.js +0 -2
- package/dist/session-target-UWROGOCY.js +0 -2
- package/dist/sessions-NH7WQWMX.js +0 -2
- package/dist/sessions-cmd-IV25N2L7.js +0 -25
- package/dist/spawner-HQM2757J.js +0 -2
- package/dist/store-guard-NAW26EEQ.js +0 -2
- package/dist/store-id-EOSGEKVK.js +0 -2
- package/dist/structured-answers-ZI2B6JJE.js +0 -2
- package/dist/sync-cmd-Q6ZYEVWI.js +0 -2
- package/dist/sync-setup-CA362C5S.js +0 -2
- package/dist/tcg-generate-CDB2N5LD.js +0 -2
- package/dist/testmd-actions-BDWDE2TG.js +0 -2
- package/dist/testmd-sync-EPTUVJYJ.js +0 -2
- package/dist/tms-client-KU6HCA23.js +0 -2
- package/dist/token-refresh-TKBOHXSD.js +0 -2
- package/dist/trust-gate-EX7R2P4Y.js +0 -2
- package/dist/turn-preflight-JGYT7LXP.js +0 -2
- package/dist/ui-JEJGTURD.js +0 -4
- package/dist/validate-basic-V7R4RH5M.js +0 -2
- package/dist/verdicts-7IUZFXB4.js +0 -2
- package/dist/version-check-PUUSB7AY.js +0 -2
- package/dist/walk-session-EGIMA4VG.js +0 -2
- package/dist/with-telemetry-LRWWBISP.js +0 -2
- /package/dist/{chunk-BKHXPBWN.js → chunk-2RUSXQ3O.js} +0 -0
- /package/dist/{chunk-6J5T5FEY.js → chunk-3AGP2BVN.js} +0 -0
- /package/dist/{chunk-CH273NAE.js → chunk-73Y6T2UK.js} +0 -0
- /package/dist/{chunk-ZMNJBUAO.js → chunk-73ZFOJOK.js} +0 -0
- /package/dist/{chunk-N2P4MI32.js → chunk-FWGUISUG.js} +0 -0
- /package/dist/{chunk-UJZZDPDY.js → chunk-HD6NR44L.js} +0 -0
- /package/dist/{chunk-LDPLJFCV.js → chunk-I6S6DZ2E.js} +0 -0
- /package/dist/{chunk-427OQS2N.js → chunk-LD5B3QFW.js} +0 -0
- /package/dist/{chunk-2UIHS2FH.js → chunk-PGESS7BW.js} +0 -0
- /package/dist/{chunk-BZAGVBCX.js → chunk-ZCIWQHCO.js} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as ne}from"./chunk-WMGKUERB.js";import{a as y,b as ie,c as oe,d as le,e as ae}from"./chunk-WOSANGV6.js";import{a as F,b as x,c as D,d as ee,f as re,h as de,i as pe}from"./chunk-EZN7CF45.js";import{a as se,d as te}from"./chunk-ZCIWQHCO.js";import{a as X,c as Y,d as Z}from"./chunk-ZFM77AQU.js";import{Ba as B,Ea as v,Ja as Q,Pa as w,Va as U,Xa as $,Ya as O,Za as b,_a as G,ab as J,fb as H,i as _,jb as z,kb as W,mb as R,nb as K,ob as T,t as I}from"./chunk-UEE3RZN4.js";import{a as C}from"./chunk-7DFBOVUB.js";import{existsSync as Se,readFileSync as Ee}from"fs";import{join as Me}from"path";import{mkdirSync as be,readFileSync as Re,renameSync as Fe,writeFileSync as Ae}from"fs";import{dirname as A,join as M}from"path";function E(r,o){be(A(r),{recursive:!0});let s=M(A(r),`.${process.pid}.tmp`);Ae(s,o),Fe(s,r)}function ue(r){try{return JSON.parse(Re(r,"utf8"))}catch{return null}}function ce(r){let o=s=>M(A(y(r,s)),"verdicts.json");return{read:s=>ue(y(r,s)),write:(s,i)=>E(y(r,s),JSON.stringify(i,null,2)+`
|
|
3
|
+
`),writeReview:(s,i)=>E(M(A(y(r,s)),"review.json"),JSON.stringify(i,null,2)+`
|
|
4
|
+
`),verdicts:s=>ue(o(s))??{verdicts:{}},saveVerdicts:(s,i)=>E(o(s),JSON.stringify(i,null,2)+`
|
|
5
|
+
`)}}import{appendFileSync as fe,closeSync as qe,existsSync as V,openSync as Pe,readdirSync as Oe,readFileSync as ge,renameSync as Te,writeFileSync as he}from"fs";import{join as q}from"path";var me=".pending-facts.bad";function ye(r){let o=q(r,ie);return{quarantinePath:q(r,me),park:(s,i)=>{let l=null;try{l=w(r,{deadlineMs:i.deadlineMs})}catch{l=null}try{if(l)return fe(o,s+`
|
|
6
|
+
`),{where:o,sideFile:!1};let u=q(r,le()),c=Pe(u,"wx");try{he(c,s+`
|
|
7
|
+
`),C(c)}finally{qe(c)}return H(r),{where:u,sideFile:!0}}finally{l?.()}},snapshot:s=>{if(!V(o)&&!Oe(r).some(u=>oe.test(u)))return{lines:[]};let i=Q(r);if(i)return{fenced:i.id};let l=w(r,{deadlineMs:s.deadlineMs});try{return ae(r),{lines:(V(o)?ge(o,"utf8"):"").split(`
|
|
8
|
+
`).filter(c=>c.trim()!=="")}}finally{l()}},settle:(s,i,l)=>{let u=w(r,{deadlineMs:l.deadlineMs});try{let k=(V(o)?ge(o,"utf8"):"").split(`
|
|
9
|
+
`).filter(p=>p.trim()!==""),m=i.filter(p=>k.includes(p.parent)).map(p=>p.line);m.length>0&&fe(q(r,me),m.map(p=>p+`
|
|
10
|
+
`).join(""));let h=k.filter(p=>!s.has(p)),P=`${o}.tmp.${process.pid}`;he(P,h.length>0?h.join(`
|
|
11
|
+
`)+`
|
|
12
|
+
`:""),Te(P,o)}finally{u()}}}}var S=r=>({hash:r}),d=r=>r.hash,Ve=4;function lr(r){let o=null,s=()=>o??=F(T(r)),i=new Map,l=null,u=null,c=null,k=pe(r),m=()=>new Map(b(r,0,null).hashes.map((e,n)=>[e,n+1])),h=e=>{l??=m();let n=l.get(e);return n!==void 0?n:(l=m(),l.get(e)??null)},ke=ee(e=>{if(e.token===null)return s();let n=d(e.token);if(n===s().index.applied.hash)return s();let t=i.get(n);if(t)return i.delete(n),i.set(n,t),t;let{records:a,hashes:g}=b(r,0,null);l=new Map(g.map((ve,we)=>[ve,we+1]));let f=l.get(n);if(f===void 0)throw new v(`store token ${n} is not in this chain`);let L=W();R(r,L,a.slice(0,f),g.slice(0,f),{writeNodeFiles:!1});let j=F(L);return i.set(n,j),i.size>Ve&&i.delete(i.keys().next().value),j},e=>{let n=z(r,e);if(!Se(n))throw new v(`derived node file missing for ${e} \u2014 run kane-cli context rebuild`);return JSON.parse(Ee(n,"utf8"))}),N=()=>{let e=s(),n=U(r),t=e.index.applied;if(!(n===null?t.seq===0:n.seq===t.seq&&n.hash===t.hash)){if(n!==null&&n.seq>t.seq&&(t.seq===0||O(r,t.seq)===t.hash)){let a=t.seq,g=b(r,a,t.hash);R(r,e.index,g.records,g.hashes),x(e);for(let f=0;f<g.hashes.length;f++)l?.set(g.hashes[f],a+f+1);return}o=F(T(r)),i.clear(),l=null}};return{...ke,prefetch:()=>{},append:(e,n)=>{N(),_(s().index,e);let t=J(r,e,{expectPrev:n.basis===null?null:d(n.basis),intent:n.intent,...n.provenance?{provenance:n.provenance}:{},...n.busyRetry?{busyRetry:n.busyRetry}:{}});l?.set(t.hash,t.seq);try{let a=s();R(r,a.index,[t.record],[t.hash]),K(r,a.index),D(a,t.record)}catch(a){return o=null,{token:S(t.hash),record:t.record,warnings:[`committed, but the derived index refresh failed (${a instanceof Error?a.message:String(a)}): read state rebuilds on the next open`]}}return{token:S(t.hash),record:t.record}},head:()=>{N();let e=s().index.applied;return e.seq>0&&e.hash?S(e.hash):null},resolveToken:e=>{let n=h(d(e));return n===null?null:{seq:n,hash:d(e)}},serialize:e=>e===null?null:d(e),parse:e=>e===null?null:S(e),sameToken:(e,n)=>e===null||n===null?e===n:d(e)===d(n),recordsSince:e=>{let n=e===null?0:h(d(e));if(n===null)throw new v(`store token ${d(e)} is not in this chain`);return G(r,{seq:n,hash:e===null?null:d(e)}).records},tokenAt:e=>{let n=O(r,e);return n===null||n===$?null:S(n)},intentOf:e=>h(d(e))===null?null:I(r,d(e)),getBlob:e=>Z(r,e),putBlob:e=>Y(r,e),blobPath:e=>X(r,e),logFile:e=>Me(r,"logs",e),vectors:()=>k,proposals:()=>c??=ce(r),parkedFacts:()=>ye(r),designFiles:()=>de(r),signals:()=>({append:e=>se(r,e),snapshot:e=>te(r,e)}),sessions:()=>u??=re(r),locks:(e,n)=>B(r,e,n),exists:()=>Se(r),ensure:()=>ne(r),dirOrThrow:()=>r}}export{lr as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as h}from"./chunk-LX2I4JEH.js";import{c as u}from"./chunk-XB6BJPDL.js";import{oa as f}from"./chunk-UEE3RZN4.js";import{f as p}from"./chunk-KU3YHPWZ.js";function g(o,n){let t=o.recordsSince(null),i=new Set;for(let e of t)for(let r of e.review)r.resolution!=="pending"&&i.add(r.id);let s=[],c=new Set;for(let e=t.length-1;e>=0;e--)for(let r of t[e].dedup_hits??[]){if(r.new_cid===void 0)continue;let a=`${r.new_cid}|${r.candidate_cid}`;c.has(a)||(c.add(a),!i.has(r.new_cid)&&(n.superseded.has(r.new_cid)||n.superseded.has(r.candidate_cid)||n.trust.get(r.new_cid)==="derived"&&s.push({new_cid:r.new_cid,candidate_cid:r.candidate_cid,score:r.score,scorer:r.scorer})))}return s}var d=(o,n)=>o.displayNameOf(n)??n.slice(0,19);function w(o,n){return{design_children:o.edgesInto(n).filter(i=>(i.type==="belongs_to"||i.type==="scoped_to")&&!o.superseded.has(i.src)).length}}function v(o,n){let t=o.recordsSince(null),i=new Set,s=new Map;for(let e of t)for(let r of e.review)r.kind==="pending_archive"?s.set(r.id,r.reason):r.resolution!=="pending"&&i.add(r.id);let c=new Map;for(let[e,r]of s)n.superseded.has(e)||n.trust.get(e)!=="derived"||i.has(e)||c.set(e,r);return{all:s,live:c}}function R(o,n){o.store.prefetch(u(n),{token:null});let t=[],i=new Set;for(let e of g(o.store,n)){i.add(e.new_cid);let r=e.scorer==="lexical_fallback"?" (lexical fallback \u2014 the probe ran degraded)":"";t.push({kind:"PAIR",ref:d(n,e.new_cid),title:String(n.getNode(e.new_cid)?.content.title??e.new_cid.slice(0,12)),why:`possible duplicate of ${d(n,e.candidate_cid)} \u2014 score ${e.score}${r}`,pair:{candidate_cid:e.candidate_cid,candidate_ref:d(n,e.candidate_cid),score:e.score,scorer:e.scorer}})}let{all:s,live:c}=v(o.store,n);for(let[e,r]of c)t.push({kind:"REVIEW",ref:d(n,e),title:String(n.getNode(e)?.content.title??e.slice(0,12)),why:`archive held for interactive confirmation${r?` \u2014 ${r}`:""}`,held:!0,impact:w(n,e)});for(let e of y(o.store))t.push({kind:"MODIFY_HELD",ref:`${e.sid}:${e.tempRef}`,title:String(e.content.title??e.tempRef),why:`${e.rationale} \u2014 held by paused/dead session ${e.sid}`,heldPayload:e});for(let{cid:e,content:r}of n.byLabel(p.USECASE)){if(n.superseded.has(e)||n.trust.get(e)!=="derived"||i.has(e)||s.has(e))continue;let{sources:a,missing:l}=h(n,e),m=l.length===0?"":`; CITE_MISSING: ${l.map(_=>f(d(n,_))).join(", ")} cite nothing of ${a.join(", ")}`;t.push({kind:"REVIEW",ref:d(n,e),title:String(r.title??e.slice(0,12)),why:`unreviewed \u2014 approve, archive, or defer${m}`,impact:w(n,e)})}return t}function $(o,n){let t={REVIEW:0,PAIR:0,MODIFY_HELD:0};for(let i of R(o,n))t[i.kind]++;return t}function y(o){let n=[],t=o.sessions();for(let{sid:i}of t.list()){if(t.isLive(i))continue;let s=[],c=!1;try{let r=t.loadCheckpoint(i).kane;r?.pending?.proposals?.length&&(s=r.pending.proposals,c=!0)}catch{c=!1}if(!c)try{let e=t.peek(i);if(!e)continue;s=(e.pending?.proposals??[]).map(r=>({...r}))}catch{continue}for(let e of s)n.push({sid:i,tempRef:String(e.tempRef??e.temp_ref??"held"),...typeof e.event_id=="string"?{event_id:e.event_id}:{},label:String(e.label??"usecase"),content:e.content??{},rationale:String(e.rationale??"held payload")})}return n}export{w as a,v as b,R as c,$ as d};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
function g(e){return(e.answer?.length??0)>0||(e.approve?.length??0)>0||(e.skip?.length??0)>0||(e.defer?.length??0)>0}function m(e){if(!g(e))return{ok:!0,value:null};let r=[],o=new Set;for(let a of e.answer??[]){let u=a.indexOf("="),c=u>0?a.slice(0,u).trim():"",t=u>0?a.slice(u+1):"";if(!c||!t)return{ok:!1,error:`--answer needs <id>=<option-number-or-text>, got '${a}'`};if(o.has(c))return{ok:!1,error:`--answer target '${c}' given twice \u2014 one answer per id`};if(o.add(c),/^\d+$/.test(t.trim())){let p=Number(t.trim());if(p<1)return{ok:!1,error:`--answer option numbers are 1-based (got '${c}=${t.trim()}')`};r.push({target:c,optionIndex:p-1})}else r.push({target:c,freeText:t})}let d=a=>[...new Set((a??[]).map(u=>u.trim()).filter(Boolean))],n=d(e.approve),i=d(e.skip),s=d(e.defer);for(let[a,u]of[n,i,s].entries())for(let c of u)if([n,i,s].some((p,f)=>f!==a&&p.includes(c)))return{ok:!1,error:`handle '${c}' appears in more than one of --approve/--skip/--defer`};return{ok:!0,value:{answers:r,approve:n,skip:i,defer:s}}}function $(e,r){if(!g(e))return null;let o=r==="extract"?"extract":"design",d=m(e);return d.ok?e.resume?e.mode!=="agent"?`${o}: --answer/--approve/--skip/--defer are the structured agent-mode resume surface \u2014 add --mode agent (interactively, just answer in the session)`:null:`${o}: --answer/--approve/--skip/--defer address a paused session's pending panels \u2014 pair them with --resume <sid>`:`${o}: ${d.error}`}function S(e,r){if(e.archetype==="pause-card")return null;if(e.archetype==="walk-card"){let n=e.body.card??{},i=new Set([e.id]);for(let s of["temp_ref","ref","cid"]){let a=n[s];typeof a=="string"&&a&&i.add(a)}for(let[s,a]of[["approve",r.approve],["skip",r.skip],["defer",r.defer]]){let u=a.find(c=>i.has(c));if(u)return{kind:"verdict",panelId:e.id,ref:u,v:s}}return null}if(e.archetype==="ask"){let n=e.body.questions??[];for(let i=0;i<n.length;i++){let s=r.answers.find(a=>a.target===n[i].id||a.target===e.id);if(s)return s.optionIndex!==void 0?s.optionIndex<0||s.optionIndex>=(n[i].options?.length??0)?null:{kind:"answer",panelId:e.id,qIndex:i,optionIndex:s.optionIndex}:{kind:"answer",panelId:e.id,qIndex:i,freeText:s.freeText??""}}return null}let o=r.answers.find(n=>n.target===e.id);if(!o)return null;let d=e.body.options;return o.optionIndex!==void 0?!Array.isArray(d)||o.optionIndex<0||o.optionIndex>=d.length?null:{kind:"answer",panelId:e.id,qIndex:0,optionIndex:o.optionIndex}:{kind:"answer",panelId:e.id,qIndex:0,freeText:o.freeText??""}}function k(e,r){let o=e.peek(r);if(!o)return null;let d=o.pending.questions;try{let s=e.loadCheckpoint(r).kane?.pending.questions??[];s.length>0&&(d=s)}catch{}let n=new Set([...o.applied_events??[],...e.appliedEvents(r)]),i=s=>n.has(`resolveq:${r}:${s}`)||n.has(`assumed:${r}:${s}`);return{questions:d.filter(s=>!i(s.id)),panels:[],appliedEvents:[...n]}}function x(e){let r=e.questions.map(a=>a.id),o=[],d=[],n=[];for(let a of e.panels){if(n.push(a.id),a.archetype==="ask")for(let u of a.body.questions??[])o.push(u.id);if(a.archetype==="walk-card"){let u=a.body.card??{};for(let c of["temp_ref","ref","cid"]){let t=u[c];typeof t=="string"&&t&&d.push(t)}}}let i=(a,u)=>u.length>0?`${a}: ${u.join(", ")}`:null,s=[i("questions",[...new Set([...r,...o])]),i("panels",n),i("verdict handles",d)].filter(a=>a!==null);return s.length>0?`addressable pending ids \u2014 ${s.join(" \xB7 ")}`:"this session has NO pending panels or questions"}function h(e,r,o,d){let n=[],i=new Map(r.questions.map(t=>[t.id,t])),s=new Map(r.panels.map(t=>[t.id,t])),a=new Map,u=new Set;for(let t of r.panels){if(t.archetype==="ask")for(let p of t.body.questions??[])a.set(p.id,p);if(t.archetype==="walk-card"){let p=t.body.card??{};u.add(t.id);for(let f of["temp_ref","ref","cid"]){let l=p[f];typeof l=="string"&&l&&u.add(l)}}}let c=()=>{let t=r.questions[0],p=t?` --answer ${t.id}=${t.recommendedOptionIndex+1}`:"";return`try: ${d}${p}`};for(let t of e.answers){let p=i.get(t.target)??a.get(t.target);if(p){let l=p.options?.length??0;if(t.optionIndex!==void 0&&(t.optionIndex<0||t.optionIndex>=l))return{ok:!1,error:`error: --answer ${t.target}=${t.optionIndex+1} is out of range \u2014 '${t.target}' has ${l} option(s) (numbers are 1-based)`};continue}let f=s.get(t.target);if(f){let l=f.body.options;if(t.optionIndex!==void 0&&Array.isArray(l)&&(t.optionIndex<0||t.optionIndex>=l.length))return{ok:!1,error:`error: --answer ${t.target}=${t.optionIndex+1} is out of range \u2014 the panel has ${l.length} option(s) (numbers are 1-based)`};continue}if(r.appliedEvents.includes(`resolveq:${o}:${t.target}`)||r.appliedEvents.includes(`assumed:${o}:${t.target}`)){n.push(`note: '${t.target}' was already answered \u2014 --answer ${t.target}=\u2026 is a no-op`);continue}return{ok:!1,error:`error: unknown --answer target '${t.target}' \u2014 ${x(r)}
|
|
3
|
+
${c()}`}}for(let[t,p]of[["--approve",e.approve],["--skip",e.skip],["--defer",e.defer]])for(let f of p){if(u.has(f))continue;let l=u.size>0?`addressable verdict handles: ${[...u].join(", ")}`:"this session has NO pending walk/review cards";return{ok:!1,error:`error: unknown ${t} handle '${f}' \u2014 ${l}
|
|
4
|
+
${c()}`}}return{ok:!0,notes:n}}function w(e,r){let o=[],d=[];for(let n of e){let i=r.answers.find(a=>a.target===n.id);if(!i)continue;d.push(n.id);let s=i.optionIndex!==void 0?n.options[i.optionIndex]?.label??`option ${i.optionIndex+1}`:i.freeText??"";o.push(`- ${n.question} [${n.id}] \u2192 ${s}`)}return o.length===0?{statement:null,matchedQids:[]}:{statement:["Structured resume answers (applied via --answer flags \u2014 these ARE the human's decisions; do not re-ask them):",...o].join(`
|
|
5
|
+
`),matchedQids:d}}var y=/^kane-cli (context extract|design tests) --resume [A-Za-z0-9][A-Za-z0-9._-]*( --mode (agent|interactive|ci|override))?( --answer \S+=\d+)*$/;function v(e){try{let r=typeof e.resume=="string"?e.resume:null;if(!r)return[];let o=[{cmd:r,why:"resume the paused session",title:"Resume the session"}],d=Array.isArray(e.pending_questions)?e.pending_questions.filter(n=>n&&typeof n.id=="string"&&!/\s/.test(n.id)):[];if(d.length>0){let n=d.map(s=>{let a=typeof s.recommended_index=="number"&&s.recommended_index>=0?s.recommended_index:0;return` --answer ${s.id}=${a+1}`}).join(""),i=`${r}${n}`;y.test(i)&&o.push({cmd:i,why:`answer the ${d.length} pending question(s) non-interactively \u2014 --answer <question-id>=<option number (1-based) or free text>, repeatable; shown with each question's recommended option`,title:"Answer via structured flags"})}return o}catch{return[]}}function b(e,r={}){let o=null,d=null;return{encoding:e.encoding,...e.retag?{retag:e.retag}:{},out:e.out,progress:e.progress,event:n=>{let i=n.next;if(n.type==="error"&&n.code==="NOTHING_SAVED"&&Array.isArray(i)&&(d=i),n.type==="session_paused"&&r.atQuestionsOnly&&(o=null),n.type==="session_paused"&&Array.isArray(i)&&!r.atQuestionsOnly&&(o=i),n.type==="session_paused"&&!("next"in n)&&typeof n.resume=="string"){let s=v(n);if(s.length>(r.atQuestionsOnly?1:0)){o=s,e.event({...n,next:s});return}}e.event(n)},done:(n,i,s,a)=>e.done(n,i,s??(n===3&&o?o:n!==0&&d?d:void 0),a)}}function I(e,r){return e==="design"?`kane-cli design tests --resume ${r} --mode agent`:`kane-cli context extract --resume ${r} --mode agent`}function A(e){let r=m(e.opts);if(!r.ok)return{kind:"refuse",error:`error: ${r.error}`,code:"STRUCTURED_FLAGS_USAGE"};if(!r.value)return{kind:"none"};let o=e.opts.resume;if(!o)return{kind:"refuse",error:"error: structured resume flags need --resume <sid>",code:"STRUCTURED_FLAGS_USAGE"};let d=k(e.reader,o);if(!d)return{kind:"none"};let n=h(r.value,d,o,I(e.verb,o));if(!n.ok)return{kind:"refuse",error:n.error,code:"STRUCTURED_TARGET_UNKNOWN"};let{statement:i,matchedQids:s}=w(d.questions,r.value);return{kind:"apply",answers:r.value,statement:i,matchedQids:s,notes:n.notes}}export{g as a,m as b,$ as c,S as d,k as e,h as f,w as g,y as h,v as i,b as j,I as k,A as l};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as p}from"./chunk-
|
|
2
|
+
import{a as p}from"./chunk-GRURFGBP.js";import{a as g}from"./chunk-MYZHOBS4.js";import{existsSync as f}from"fs";import{isAbsolute as m,join as d,relative as v}from"path";function c(t){let n=f(d(t,".context"))?"assurance.json":"variables.json";return d(".testmuai","variables",n)}function h(t,n){if(!m(t))return t;let e=v(n,t);return e.startsWith("..")?t:e}function w(t,n){let e=t.used_by;if(e.length===0||e.every(s=>s.file===p))return"";if(n===void 0||!e.every(s=>s.file===n))return e.map(s=>`${s.file} step ${s.step}`).join(" \xB7 ");let a=[...new Set(e.map(s=>s.step))].sort((s,i)=>s-i);return a.length===1?`step ${a[0]}`:`steps ${a.join(", ")}`}function b(t,n){let e=new Map,a=new Map,s={header:"Not in any variables file",rows:[],declare:!0};for(let i of t){if(i.reason==="not_a_dataset_column"){let l=i.dataset??"",u=a.get(l);u||(u={header:`Not a column of dataset ${l}`.trimEnd(),rows:[],declare:!1},a.set(l,u)),u.rows.push(i);continue}if(i.reason!=="value_missing"){s.rows.push(i);continue}let r=h(i.file??c(n),n),o=e.get(r);o||(o={header:r===g?"Waiting for a value passed with --variables":`Waiting for a value in ${r}`,rows:[],declare:!1},e.set(r,o)),o.rows.push(i)}return[...e.values(),...a.values(),...s.rows.length>0?[s]:[]]}function $(t,n){let e=c(n);if(f(d(n,e)))return["",` Add ${t.length===1?"it":"them"} to ${e}`];let a=t.map(r=>`${JSON.stringify(r.name)}:`),s=Math.max(...a.map(r=>r.length))+1,i=a.map((r,o)=>` ${r.padEnd(s)}{ "value": "" }${o<a.length-1?",":""}`);return["",` Create ${e}:`,""," {",...i," }"]}function _(t,n){let e=t.length,a=`warning: ${e} variable${e===1?" has":"s have"} no value`,s=Math.max(...t.map(r=>r.name.length),8)+2,i=b(t,n.cwd).map(r=>{let o=[` ${r.header}`];for(let l of r.rows)o.push(` ${l.name.padEnd(s)}${w(l,n.entryFile)}`.trimEnd());return r.declare&&o.push(...$(r.rows,n.cwd)),o.join(`
|
|
3
3
|
`)});return`${a}
|
|
4
4
|
|
|
5
5
|
${i.join(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{h as I}from"./chunk-SXRHKXSE.js";import{f as c,h as w,i as y,l,q as f,t as A}from"./chunk-A7RJQJNT.js";import{b as m}from"./chunk-I6OQISK4.js";import{createHash as U}from"crypto";import{createReadStream as F}from"fs";import{mkdir as x,readFile as P,rename as $,writeFile as D}from"fs/promises";import{dirname as b,join as E}from"path";var k=60,S=5;function C(){return{entries:[]}}function v(){return E(m,"mobile","app-cache.json")}async function h(e){let r=U("sha256");for await(let t of F(e))r.update(t);return r.digest("hex")}function N(){return{readFile:e=>P(e,"utf8"),writeFile:async(e,r)=>{await x(b(e),{recursive:!0});let t=`${e}.tmp`;await D(t,r),await $(t,e)},hashFile:h,now:()=>new Date}}function g(e){if(!e)return;let r=/\/(\d{4})\/(\d{2})\/(\d{2})\//.exec(e);if(!r)return;let[,t,a,i]=r,o=new Date(`${t}-${a}-${i}T00:00:00Z`);return Number.isNaN(o.getTime())?void 0:o.toISOString()}function O(e,r){if(!e.storedAt)return!0;let t=new Date(e.storedAt).getTime();return Number.isNaN(t)?!0:(r.getTime()-t)/864e5>=k-S}var d=class{deps;constructor(r={}){this.deps={...N(),...r}}async read(){try{let r=JSON.parse(await this.deps.readFile(v()));if(!r||typeof r!="object")return C();let t=r;return{entries:Array.isArray(t.entries)?t.entries:[]}}catch{return C()}}async write(r){await this.deps.writeFile(v(),JSON.stringify(r,null,2))}async hashOf(r){return this.deps.hashFile(r)}async lookup(r){return(await this.read()).entries.find(a=>a.sha256===r.sha256&&a.env===r.env&&a.orgId===r.orgId&&a.type===r.type)}async remember(r){let t=await this.read();t.entries=[...t.entries.filter(a=>!(a.sha256===r.sha256&&a.env===r.env&&a.orgId===r.orgId&&a.type===r.type)),r],await this.write(t)}async forget(r){let t=await this.read(),a=t.entries.length;t.entries=t.entries.filter(i=>!(i.sha256===r.sha256&&i.env===r.env&&i.orgId===r.orgId&&i.type===r.type)),t.entries.length!==a&&await this.write(t)}isNearExpiry(r){return O(r,this.deps.now())}};import{createHash as j}from"crypto";import{readdir as T,stat as _}from"fs/promises";import{basename as p,extname as B,join as R,relative as Y}from"path";function ae(e){return e.skipped===!0}function H(e,r){return A(r,e)?null:B(e).toLowerCase()===".ipa"&&!c(r)?`${p(e)} is a device build \u2014 .ipa is not accepted for ${r} runs.`:c(r)?`${p(e)} is not an ${y(w(r))} build \u2014 ${l(r)} takes ${f(r).join(" or ")}.`:`${p(e)} cannot be uploaded for ${l(r)} \u2014 expected one of ${f(r).join(", ")}.`}async function J(e,r){if(!(await _(e)).isDirectory())return r.hashOf(e);let a=[],i=async n=>{for(let s of await T(n,{withFileTypes:!0})){let u=R(n,s.name);s.isDirectory()?await i(u):s.isFile()&&a.push(u)}};await i(e),a.sort();let o=j("sha256");for(let n of a)o.update(Y(e,n)),o.update("\0"),o.update(await h(n)),o.update("\0");return o.digest("hex")}async function se(e){let r=H(e.path,e.type);if(r)return{skipped:!0,reason:r};let t=e.cache??new d,a=e.client??new I(e.baseUrl,{...e.auth,orgId:e.orgId}),i;try{i=await J(e.path,t)}catch(s){return{skipped:!0,reason:`could not read ${p(e.path)}: ${s.message}`}}let o={sha256:i,env:e.env,orgId:e.orgId,type:e.type},n=await t.lookup(o);if(n){if(await a.liveness(n.appId)!=="gone")return{appId:n.appId,...n.appUrl?{appUrl:n.appUrl}:{},fromCache:!0};e.onProgress?.(`${n.appId} is no longer in the cloud \u2014 uploading again`),await t.forget(o)}try{e.onProgress?.(`uploading ${p(e.path)}\u2026`);let s=await a.upload(e.path,e.type);return await t.remember({sha256:i,env:e.env,orgId:e.orgId,type:e.type,appId:s.appId,...s.appUrl?{appUrl:s.appUrl}:{},...g(s.url)?{storedAt:g(s.url)}:{},sourcePath:e.path}),e.onProgress?.(s.cached?`${p(e.path)} already in the cloud (${s.appId})`:`${p(e.path)} uploaded (${s.appId})`),{appId:s.appId,...s.appUrl?{appUrl:s.appUrl}:{},fromCache:!1}}catch(s){return{skipped:!0,reason:s.message}}}export{d as a,ae as b,H as c,J as d,se as e};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as l}from"./chunk-WD52ZNQY.js";import{b as i,d as p,e as f,g,h as u}from"./chunk-77ZZQJLX.js";import{b as d}from"./chunk-LRXBJTD4.js";import{existsSync as t,mkdirSync as w,readFileSync as S,renameSync as y,writeFileSync as D}from"fs";import{join as j}from"path";function O(r){l(i(r));let a=i(r);if(!t(a))return;let s=j(a,"meta.json"),n=f(r);if(t(s)&&!t(n))try{w(p(r),{recursive:!0}),y(s,n)}catch(e){process.stderr.write(`warn: meta.json migration failed: ${e.message}
|
|
3
|
+
`)}let c=u(r);if(t(c)){let e="python";try{let o=new d().load();o.code_export?.language&&(e=o.code_export.language)}catch{}let m=g(r,"playwright",e);if(!t(m))try{y(c,m)}catch(o){process.stderr.write(`warn: generated-code migration failed: ${o.message}
|
|
4
|
+
`)}}if(t(n))try{let e=JSON.parse(S(n,"utf8"));"md5sum"in e&&(delete e.md5sum,D(n,JSON.stringify(e,null,2)+`
|
|
5
|
+
`,"utf8"))}catch(e){process.stderr.write(`warn: meta.json md5sum strip failed: ${e.message}
|
|
6
|
+
`)}}export{O as a};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as te,b as E,d as ne,e as se}from"./chunk-JGRXMTME.js";import{b as X,c as v,e as W,i as Y,j as Z,k as ee}from"./chunk-77ZZQJLX.js";import{e as z}from"./chunk-65VANXOF.js";import{a as Q}from"./chunk-B7ZX5HEN.js";import{d as q}from"./chunk-I6OQISK4.js";import{copyFileSync as Re,cpSync as xe,existsSync as P,mkdirSync as Ie,readFileSync as ze,readdirSync as ke,rmSync as Qe,writeFileSync as Xe}from"fs";import{dirname as Ye,isAbsolute as Ze,join as x,relative as et,resolve as tt}from"path";import{writeFileSync as ve,mkdirSync as Pe,readFileSync as je}from"fs";import{dirname as De,basename as re}from"path";function oe(e){let t=e.outPath??v(e.sourcePath);Pe(De(t),{recursive:!0});let n=[];n.push("---"),n.push(`test: ../${re(e.sourcePath)}`),n.push(`status: ${e.overallStatus}`),n.push(`started: ${e.startedISO}`),n.push(`duration_s: ${e.durationS}`),n.push(`session_id: ${e.sessionId}`),n.push("---",""),n.push(`# ${e.title??re(e.sourcePath)} \u2014 Result`,"");for(let r=0;r<e.rootSteps.length;r++){let o=e.rootSteps[r],s=e.outcomes.find(d=>d.rootStepIndex===r+1);if(n.push($e(o,s)),s?.stepMd5&&n.push(`md5: ${s.stepMd5}`),s?.status==="failed"&&s.reason&&n.push(`Reason: ${s.reason}`),s?.softFailures?.length)for(let d of s.softFailures){let a=d.reason?`: ${d.reason}`:"";n.push(`\u26A0 optional sub-step ${d.subStepIndex} failed${a}`)}o.body.kind==="objective"&&s?.status!=="skipped"&&n.push(o.body.text),n.push("")}return ve(t,n.join(`
|
|
3
|
+
`),"utf8"),t}function $e(e,t){if(!t)return`## ${e.heading} (no outcome)`;let n=t.duration_s!=null?`${t.duration_s}s`:"\u2014";if(t.status==="skipped")return`## ${e.heading} \u23ED skipped`;let r=t.softFailed?" (optional)":"";if(t.refKind&&t.status==="passed"){let o=t.helperResultRelPath?` \u2192 ${t.helperResultRelPath}`:"";return`## ${e.heading} \u2713 passed (via @${t.refKind} ${t.refLabel} \u2014 ${t.inlinedCount} inlined steps, ${n}${o})`}if(t.refKind&&t.status==="failed"){let o=t.failedSubStepIndex&&t.failedSubStepIndex.length>0?` \u2014 at sub-step ${t.failedSubStepIndex.join(" \u2192 sub-step ")}`:"",s=t.helperResultRelPath?` \u2192 ${t.helperResultRelPath}`:"";return`## ${e.heading} \u2717 failed${r} (via @${t.refKind} ${t.refLabel}${o}, ${n}${s})`}return t.status==="passed"?`## ${e.heading} \u2713 passed (${n})`:`## ${e.heading} \u2717 failed${r} (${n})`}var Fe=/^##\s+(.+?)\s+(✓ passed|✗ failed(?:\s+\(optional\))?|⏭ skipped)(?:\s+\((.*)\))?\s*$/,Oe=/via\s+@\w+\s+(\S+).*?(?:→\s+(\S+))?\s*$/,_e=/^md5:\s+([a-f0-9]{32})\s*$/;function ie(e,t){for(let n=t;n<e.length&&!/^##\s/.test(e[n]);n++){if(e[n].trim()==="")continue;let r=_e.exec(e[n]);return r?r[1]:null}return null}function D(e){let n=je(e,"utf8").split(`
|
|
4
|
+
`),r="passed";if(n[0]?.trim()==="---")for(let s=1;s<n.length&&n[s].trim()!=="---";s++){let d=/^status:\s+(passed|failed|interrupted)\s*$/.exec(n[s]);d&&(r=d[1])}let o=[];for(let s=0;s<n.length;s++){let d=Fe.exec(n[s]);if(!d)continue;let a=d[1],i=d[2],u=d[3]??"",f=i.startsWith("\u2713")?"passed":i.startsWith("\u23ED")?"skipped":"failed";if(/via\s+@/.test(u)){let m=Oe.exec(u),w=m?.[1]??"",I=m?.[2]??null;o.push({kind:"import",heading:a,status:f,md5:ie(n,s+1),importPath:w,helperResultRelPath:I})}else o.push({kind:"objective",heading:a,status:f,md5:ie(n,s+1)})}return{overallStatus:r,steps:o}}import{copyFileSync as ae,existsSync as H,mkdirSync as Ae,writeFileSync as de,promises as dt}from"fs";import{join as $,dirname as le,basename as Te}from"path";async function pe(e){for(let t=0;t<e.totalRunDirs;t++){let n=e.runIndex+t,r=$(e.sessionDir,"runs",String(n)),o=$(e.stagingStepDir,"flows",String(t));Ae(o,{recursive:!0});let s=$(o,"actions.ndjson");if(e.packTestDir){let i=$(e.packTestDir,"logs",`${n}-actions.ndjson`);if(H(i)){ae(i,s);continue}let u=le(le(e.packTestDir)),f=Te(e.packTestDir),S=H(u)?await z(u,`tests/${f}/logs/${n}-actions.ndjson`).catch(()=>null):null;de(s,S??"");continue}let d=[$(r,"run-test","actions.ndjson"),$(r,"actions.ndjson")],a=!1;for(let i of d)if(H(i)){ae(i,s),a=!0;break}a||de(s,"")}}import{existsSync as ue,readFileSync as fe,readdirSync as Ne}from"fs";import{join as F}from"path";function Ee(e){if(e.action_type!=="upload_files")return null;let t=e.action_params?.media;if(!t||typeof t!="object")return null;let n=a=>typeof t[a]=="string"?t[a]:"",r=n("media_id"),o=n("name"),s=n("media_url");if(!r||!o||!s)return null;let d=n("type")||"doc";return{media_id:r,name:o,media_url:s,type:d,alias:n("alias")}}function Le(e){let t=e.action_params?.file_paths,n=Array.isArray(t)?t[0]:t;return typeof n=="string"&&n.length>0?n:null}function Ue(e){let t={};for(let[n,r]of Object.entries(e??{}))t[n]={...r,refs:[...r.refs??[]]};return t}function Ke(e,t){if(!t)return!1;let n=t.endsWith("/")?t:t+"/";return e.startsWith(n)}function ce(e,t,n,r={}){let o=Ue(e);for(let s of t){let d=Ee(s);if(!d)continue;let a=o[d.media_id]??={name:d.name,media_url:d.media_url,type:d.type,refs:[],recorded_at:n,...d.alias?{alias:d.alias}:{}};a.recorded_at=n;let i=Le(s);if(!(!i||Ke(i,r.ignoreAliasUnder))){for(let[u,f]of Object.entries(o))u!==d.media_id&&(f.refs=f.refs.filter(S=>S!==i));a.refs.includes(i)||a.refs.push(i)}}return o}function ut(e){let t=e?.media;if(!t||typeof t!="object")return[];let n=[];for(let[r,o]of Object.entries(t)){if(!r||!o||typeof o!="object")continue;let s=o;typeof s.name!="string"||!s.name||typeof s.media_url!="string"||!s.media_url||n.push({media_id:r,name:s.name,media_url:s.media_url,type:typeof s.type=="string"&&s.type?s.type:"doc",refs:Array.isArray(s.refs)?s.refs.filter(d=>typeof d=="string"&&d.length>0):[],...typeof s.alias=="string"&&s.alias?{alias:s.alias}:{}})}return n}function Ce(e){let t=[];for(let n of e){let r;try{r=fe(n,"utf8")}catch{continue}for(let o of r.split(`
|
|
5
|
+
`)){let s=o.trim();if(s)try{let d=JSON.parse(s);d&&typeof d=="object"&&t.push(d)}catch{}}}return t}function V(e){try{return Ne(e,{withFileTypes:!0}).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,n)=>t.localeCompare(n,void 0,{numeric:!0}))}catch{return[]}}function St(e){if(!e)return[];let t=[];for(let n of V(F(e,"runs")))for(let r of[F(e,"runs",n,"run-test","actions.ndjson"),F(e,"runs",n,"actions.ndjson")])if(ue(r)){t.push(r);break}return t}function me(e){let t=[],n=F(e,".internal","steps");for(let r of V(n)){let o=F(n,r,"flows");for(let s of V(o)){let d=F(o,s,"actions.ndjson");ue(d)&&t.push(d)}}return t}function We(e){try{let n=JSON.parse(fe(e,"utf8"))?.media;return n&&typeof n=="object"?n:void 0}catch{return}}function ge(e){let t=We(e.priorMetaPath),n=Ce(e.recordFiles),r=ce(t,n,e.now??new Date().toISOString(),{ignoreAliasUnder:e.ignoreAliasUnder??q});return Object.keys(r).length>0?r:void 0}import{existsSync as L,readdirSync as He}from"fs";import{dirname as Ve,join as O,basename as B}from"path";function wt(e,t){let n=[];return e.steps.forEach((r,o)=>{let s=t[o];r.block||!r.replayOnly||!s||s.kind!=="author"||n.push({flatIndex:r.flatIndex,file:r.owningFile,heading:r.trace[r.trace.length-1].heading,kind:r.replayOnly,reason:s.reason})}),n}function vt(e){let t=[],n=new Set,r=new Map;function o(i){if(r.has(i))return r.get(i);let u=v(i),f=L(u)?D(u):null;return r.set(i,f),f}let s=new Map;function d(i){if(s.has(i))return s.get(i);let u=O(i,"Result.md"),f=L(u)?D(u):null;return s.set(i,f),f}function a(i){for(let u=1;u<i.trace.length;u++){let f=i.trace[u-1],S=o(f.file);if(!S)continue;let m=S.steps[f.stepIndex-1];if(m){if(m.kind!=="import")return{kind:"author",reason:"structure-mismatch"};if(B(m.importPath)!==B(i.trace[u].file))return{kind:"author",reason:"structure-mismatch"};if(m.md5!=null&&m.md5!==f.rowMd5)return{kind:"author",reason:"structure-mismatch"}}}return null}for(let i of e.steps){let u=i.trace[i.trace.length-1].stepIndex,f=i.replayOnly;if(i.block){let g=o(i.owningFile)?.steps[u-1],j=i.controlFlow!==void 0,T=g?.kind==="objective"&&g.status==="skipped";if(j||T){t.push({kind:"replay",recordingDir:"",flowCount:0,unrecorded:!0,...f?{replayOnly:f}:{}});continue}}let S=n.has(i.owningFile);for(let g=0;g<i.trace.length-1&&!S;g++)n.has(i.trace[g].file)&&(S=!0);if(S&&!f){t.push({kind:"author",reason:o(i.owningFile)===null?"no-result-md":"downstream-of-divergence"});continue}let m=a(i);if(m){for(let g=0;g<i.trace.length;g++)n.add(i.trace[g].file);if(!f){t.push(m);continue}}let w=o(i.owningFile),I;if(w===null&&i.trace.length>1){let g=J(i.trace);I=he(i,d(g),u,g)}else I=he(i,w,u);if(f&&I.kind==="replay"&&(I={...I,replayOnly:f}),t.push(I),I.kind==="author"){n.add(i.owningFile);for(let g=0;g<i.trace.length-1;g++)n.add(i.trace[g].file)}}return t}function he(e,t,n,r=null){if(!t)return{kind:"author",reason:"no-result-md"};let o=t.steps[n-1];if(!o)return{kind:"author",reason:"no-result-md"};if(o.kind!=="objective")return{kind:"author",reason:"structure-mismatch"};if(o.status!=="passed")return{kind:"author",reason:"recorded-failed"};let s=E(e);if(s!==o.md5)return{kind:"author",reason:"md5-mismatch"};let d=r===null?ee(e.owningFile,n,s.slice(0,8)):O(r,".internal","steps",`${n}-${s.slice(0,8)}`),a=Be(d);return a===0?{kind:"author",reason:"missing-recording"}:{kind:"replay",recordingDir:d,flowCount:a}}function Be(e){let t=O(e,"flows");if(!L(t))return 0;let n;try{n=He(t,{withFileTypes:!0}).filter(o=>o.isDirectory()&&/^\d+$/.test(o.name)).map(o=>parseInt(o.name,10))}catch{return 0}if(n.length===0)return 0;let r=Math.max(...n);for(let o=0;o<=r;o++)if(!L(O(t,String(o),"actions.ndjson")))return 0;return r+1}function Pt(e){return e.some(t=>t.kind==="author")}function jt(e){for(let t=0;t<e.length;t++)if(e[t].kind==="author")return t;return e.length}function J(e){let t=s=>{let d=B(s);return d.endsWith("_test.md")?d.slice(0,-8):d.endsWith(".md")?d.slice(0,-3):d},n=t(e[0].file),r=t(e[e.length-1].file),o=e.slice(0,-1).map(s=>String(s.stepIndex));return O(Ve(e[e.length-1].file),`helper-output-${r}-${n}-${o.join("-")}`)}function Dt(e){return Array.from({length:e.flowCount},(t,n)=>O(e.recordingDir,"flows",String(n),"actions.ndjson"))}import{existsSync as ye,mkdirSync as Je,rmSync as Ge,cpSync as qe}from"fs";function Se(e,t){ye(e)&&(ye(t)&&Ge(t,{recursive:!0,force:!0}),Je(t,{recursive:!0}),qe(e,t,{recursive:!0}))}async function Vt(e){let t=new Map;for(let a of e.stepRunRecords)t.set(a.testmdStepIndex,a);let n=e.authoredFlatIdx??new Set,r=[],o=[],s=new Map,d=a=>{if(s.has(a))return s.get(a);let i=x(a,"Result.md"),u=P(i)?D(i):null;return s.set(a,u),u};for(let a of e.resolvedTest.unitFiles){let i=a.file===e.resolvedTest.rootPath,u=Q(a.file,ze(a.file,"utf8")),f=v(a.file),S=P(f)?D(f):null,m=[],w=[],I=[],g=[];if(!i)for(let p of e.resolvedTest.steps){if(p.owningFile!==a.file||p.trace.length<2)continue;let l=J(p.trace);g.includes(l)||g.push(l)}let j=p=>{if(S!==null)return null;for(let l of g){let M=d(l)?.steps[p-1];if(M)return{row:M,dir:l}}return null},T=[],U=!1,G=!1,K=!1,N=!1;for(let p of u.steps){let l=p.index,c=S?.steps[l-1];if(p.body.kind==="objective"){let h=e.resolvedTest.steps.filter(y=>y.owningFile===a.file&&y.trace[y.trace.length-1].stepIndex===l&&t.has(y.flatIndex)),R=h.length>0?h[h.length-1]:null;if(R){U=!0,n.has(R.flatIndex)&&(G=!0);let y=E(R),k;i?k=e.outcomes.find(we=>we.rootStepIndex===l)??{rootStepIndex:l,status:"skipped"}:k={rootStepIndex:l,status:be(R,e.outcomes)},k.status==="failed"&&(K=!0),k.stepMd5==null&&(k.stepMd5=y),m.push(k),w.push({stepIndex:l,md5:y,rec:t.get(R.flatIndex)}),(!c||c.kind!=="objective"||c.status!==k.status||k.status==="passed"&&c.md5!==y)&&(N=!0)}else if(c&&c.kind==="objective")m.push({rootStepIndex:l,status:c.status,...c.md5?{stepMd5:c.md5}:{}}),I.push(l);else if(!i&&j(l)?.row.kind==="objective"){let y=j(l),k=y.row;m.push({rootStepIndex:l,status:k.status,...k.md5?{stepMd5:k.md5}:{}}),T.push({psIdx:l,dir:y.dir})}else i?m.push(e.outcomes.find(y=>y.rootStepIndex===l)??{rootStepIndex:l,status:"skipped"}):m.push({rootStepIndex:l,status:"skipped"});continue}let M=Ze(p.body.path)?p.body.path:tt(Ye(a.file),p.body.path),_=te({path:p.body.path,bindings:p.body.bindings,optional:p.optional??!1}),C=et(X(a.file),v(M)),A=e.resolvedTest.steps.filter(h=>h.trace.some((R,y)=>y<h.trace.length-1&&R.file===a.file&&R.stepIndex===l)&&t.has(h.flatIndex));if(A.length>0){U=!0;let h;if(i)h=e.outcomes.find(R=>R.rootStepIndex===l)??{rootStepIndex:l,status:"passed",refKind:"import",refLabel:p.body.path};else{let R=A.some(y=>be(y,e.outcomes)==="failed");h={rootStepIndex:l,status:R?"failed":"passed",refKind:"import",refLabel:p.body.path,inlinedCount:A.length}}h.status==="failed"&&(K=!0),h.stepMd5==null&&(h.stepMd5=_),h.helperResultRelPath==null&&(h.helperResultRelPath=C),m.push(h),(!c||c.kind!=="import"||c.status!==h.status||c.md5!==_)&&(N=!0)}else if(c&&c.kind==="import")m.push({rootStepIndex:l,status:c.status,refKind:"import",refLabel:c.importPath,...c.md5?{stepMd5:c.md5}:{},...c.helperResultRelPath?{helperResultRelPath:c.helperResultRelPath}:{}});else if(!i&&j(l)?.row.kind==="import"){let h=j(l).row;m.push({rootStepIndex:l,status:h.status,refKind:"import",refLabel:p.body.path})}else i?m.push(e.outcomes.find(h=>h.rootStepIndex===l)??{rootStepIndex:l,status:"skipped",refKind:"import",refLabel:p.body.path}):m.push({rootStepIndex:l,status:"skipped",refKind:"import",refLabel:p.body.path})}if(!(i||U&&(G||K||S===null||N)))continue;r.push(a.file);let b=Y(a.file);Ie(x(b,".internal"),{recursive:!0});for(let p of w){let l=x(b,".internal","steps",`${p.stepIndex}-${p.md5.slice(0,8)}`);Ie(l,{recursive:!0}),await pe({sessionDir:e.sessionDir,runIndex:p.rec.runIndex,totalRunDirs:p.rec.totalRunDirs,stagingStepDir:l,packTestDir:e.packTestDir})}if(I.length>0){let p=Z(a.file);if(P(p))for(let l of ke(p)){let c=parseInt(l.split("-")[0]??"",10);!Number.isNaN(c)&&I.includes(c)&&xe(x(p,l),x(b,".internal","steps",l),{recursive:!0})}}for(let p of T){let l=x(p.dir,".internal","steps");if(P(l))for(let c of ke(l))parseInt(c.split("-")[0]??"",10)===p.psIdx&&xe(x(l,c),x(b,".internal","steps",c),{recursive:!0})}let Me=m.some(p=>p.status==="failed");if(oe({sourcePath:a.file,title:u.title,rootSteps:u.steps,outcomes:m,overallStatus:i?e.overallStatus:Me?"failed":"passed",startedISO:e.startedISO,durationS:i?e.durationS:0,sessionId:e.sessionId,outPath:x(b,"Result.md")}),i){let p={};e.commitId&&(p.commit_id=e.commitId),e.tmsIds.testId&&(p.test_id=e.tmsIds.testId),e.tmsIds.testcaseId&&(p.testcase_id=e.tmsIds.testcaseId),e.tmsIds.projectId&&(p.project_id=e.tmsIds.projectId),e.tmsIds.folderId&&(p.folder_id=e.tmsIds.folderId),e.tmsIds.orgId&&(p.org_id=e.tmsIds.orgId),e.tmsIds.sessionName&&(p.session_name=e.tmsIds.sessionName);let l=ge({priorMetaPath:W(a.file),recordFiles:me(b)});l&&(p.media=l);let c=ne(a.file);c&&(p.tc_id=c);let M=se(a.file);M&&(p.environment_id=M),Xe(x(b,".internal","meta.json"),JSON.stringify(p,null,2)+`
|
|
6
|
+
`,"utf8");let _=x(e.sessionDir,"execution.json");if(P(_))try{Re(_,x(b,".internal","execution.json"))}catch{}if(e.codeExportDir){let C=e.codeExportLanguage??"python",A=e.codeExportFramework??"playwright",h=x(b,`${A}-${C}-code`);try{Se(e.codeExportDir,h)}catch(R){process.stderr.write(`warn: codegen copy failed: ${R.message}
|
|
7
|
+
`)}}}else if(a.kind==="test"||a.kind==="module"){let p=W(a.file);if(P(p))try{Re(p,x(b,".internal","meta.json"))}catch{}}!i&&g.length>0&&m.every(l=>l.status!=="skipped")&&o.push({unitFile:a.file,dirs:g.filter(l=>P(l))})}return{changedUnitFiles:r,legacySweep:o}}function Bt(e){for(let t of e)try{Qe(t,{recursive:!0,force:!0})}catch{}}function be(e,t){let n=e.trace[0].stepIndex,r=t.find(a=>a.rootStepIndex===n);if(!r)return"skipped";if(r.status==="passed")return"passed";if(r.status==="skipped")return"skipped";let o=e.trace.slice(1).map(a=>a.stepIndex),s=r.failedSubStepIndex??[],d=Math.min(o.length,s.length);for(let a=0;a<d;a++)if(o[a]!==s[a])return o[a]<s[a]?"passed":"skipped";return o.length===s.length?"failed":o.length<s.length?"passed":"skipped"}export{oe as a,wt as b,vt as c,Pt as d,jt as e,Dt as f,ut as g,St as h,ge as i,Se as j,Vt as k,Bt as l};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as B}from"./chunk-5Y2G4NC7.js";import{a as T}from"./chunk-HCBYKLMW.js";import{a as S,b as l,k as w}from"./chunk-33DWJV67.js";import{a as J}from"./chunk-6YGTRKDT.js";import{y as o}from"./chunk-I6OQISK4.js";import{e as k}from"./chunk-UR6MHSHU.js";var y=k(J(),1);var r=k(T(),1),v=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function H(e){let n=e.replace(/…$/,"");return n&&n.charAt(0).toLowerCase()+n.slice(1)}function j(e,n){if(e.length<=n)return e;if(n<=1)return"\u2026";let p=Math.ceil((n-1)/2),b=Math.floor((n-1)/2);return`${e.slice(0,p)}\u2026${b>0?e.slice(-b):""}`}function K({status:e,meta:n,tallies:p,keys:b,child:d,cols:C,remote:A=!1,gapAbove:M=!1,accent:u=o.assuranceAccent}){let{stdout:R}=w(),m=C??R?.columns??80,L=e.kind==="working"||e.kind==="child-working",[E,O]=(0,y.useState)(0);B(()=>O(a=>a+1),L?120:null);let $=v[E%v.length],i,s;switch(e.kind){case"working":i=`${$} ${e.step}${e.elapsedS!==void 0?` \xB7 ${e.elapsedS}s`:""}`,s=u;break;case"waiting":i=`\u25CF waiting on you${e.pending?` \u2014 ${e.pending} question${e.pending===1?"":"s"}`:e.label?` \u2014 ${e.label}`:""}`,s=o.amber;break;case"retrying":i=`\u25CF ${e.text}`,s=o.amber;break;case"idle":i="\u25CF idle",s=u;break;case"card":i=`\u25CF card ${e.n} of ${e.m}`,s=o.amber;break;case"child-working":i=`${$} child: ${e.step}`,s=u;break;case"child-waiting":i="\u25CF child waiting on you",s=o.amber;break}let f=d?`${n.verb} \u25B8 ${d.verb}`:n.verb,F=d?.sid?n.sid?`${j(n.sid,14)} \u25B8 ${d.sid}`:d.sid:n.sid,h=n.env==="prod"?"":n.env,t=" \xB7 ",P=16,x=a=>i.length+t.length+[f,a,h].filter(Boolean).join(t).length,c=F,I=m-x(c)-t.length;A&&c&&(n.subject?I<Math.min(n.subject.length,P):x(c)>m)&&(c="");let N=[f,c,h].filter(Boolean),q=i.length+t.length+N.join(t).length,g=n.subject;if(g){let a=m-q-t.length;g=a>=8?j(g,a):void 0}let D=[f,...g?[g]:[],c,h].filter(Boolean).join(t);return(0,r.jsxs)(S,{flexDirection:"column",marginTop:M?1:0,children:[(0,r.jsx)(l,{color:o.muted,children:"\u2500".repeat(Math.max(1,m))}),(0,r.jsxs)(l,{children:[(0,r.jsx)(l,{color:s,children:i}),(0,r.jsx)(l,{color:o.dim,children:`${t}${D}`})]}),(0,r.jsx)(l,{color:o.dim,children:p.items.length>0?p.items.join(t):" "}),(0,r.jsx)(l,{color:o.muted,children:b.join(t)})]})}export{H as a,K as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{c as Oe}from"./chunk-BWXLZS5O.js";import{a as De,b as Me}from"./chunk-63EKRZKI.js";import{a as qe,c as Ne}from"./chunk-3JLEDSG5.js";import{b as $e,f as de,i as Ee}from"./chunk-42PALMW2.js";import{A as Ae,D as ae,na as Ie,z as Te}from"./chunk-UEE3RZN4.js";import{d as Re}from"./chunk-KU3YHPWZ.js";import{m as $}from"./chunk-4I7YN6YY.js";var Qe=new Set(["approve","edit","reject"]),Le=new Set(["approve","edit","reject","add","enhance","retract"]);function Fe(i,t){return t?`chatop:${t}:${i}`:`chatop:${i}`}function Ue(i,t,y,w){let k=`${t}:${i.target??"new"}:${i.op}:${i.seq}`,l=i.payload;switch(i.op){case"approve":return{kind:"approve",target:i.target,expectedCid:i.expected_cid,eventId:k};case"edit":{let{reason:C,...a}=l;return{kind:"edit",target:i.target,expectedCid:i.expected_cid,edit:a,reason:C,eventId:k}}case"enhance":return{kind:"enhance",target:i.target,expectedCid:i.expected_cid,edges:l.edges??[],eventId:k};case"retract":{let C=typeof l.reason=="string"?l.reason.trim():"";if(!C)throw new Error("INVALID_RETRACT: a retract needs a non-empty reason");let a=l.edge_ecid!==void 0&&l.edge_ecid!==null,d=l.edge!==void 0&&l.edge!==null;if(a&&d)throw new Error("INVALID_RETRACT: both edge_ecid and edge were sent \u2014 give exactly one");if(!a&&!d)throw new Error("INVALID_RETRACT: neither edge {type, dst, src?} (display refs) nor edge_ecid was sent \u2014 give exactly one");let g={kind:"retract",target:i.target,expectedCid:i.expected_cid,reason:C};if(a){if(typeof l.edge_ecid!="string"||!l.edge_ecid)throw new Error("INVALID_RETRACT: edge_ecid must be a non-empty string");return{...g,edgeEcid:l.edge_ecid,eventId:`${t}:${i.target}:retract:e:${l.edge_ecid}:${i.seq}`}}let f=l.edge;if(typeof f!="object"||typeof f.type!="string"||!f.type||typeof f.dst!="string"||!f.dst)throw new Error("INVALID_RETRACT: edge needs {type, dst} (src optional), all display refs");if(f.src!==void 0&&f.src!==null&&(typeof f.src!="string"||!f.src))throw new Error("INVALID_RETRACT: edge.src, when given, must be a non-empty display ref");let v=typeof f.src=="string"?f.src:void 0;return{...g,edgeRef:{type:f.type,dst:f.dst,...v!==void 0?{src:v}:{}},eventId:`${t}:${i.target}:retract:t:${f.type}:${f.dst}:${v??"-"}:${i.seq}`}}case"reject":return{kind:"reject",target:i.target,expectedCid:i.expected_cid,reason:l.reason??"",redirectTo:l.redirect_to,eventId:k};case"add":{let C=l.proposal_item??{},a=String(C.label??"");if(!y.mint_gate.includes(a))throw new Error(`GATED_LABEL: cannot mint "${a}" (gate: ${y.mint_gate.join(", ")})`);let d=C.cite??{},g=C.conv_source_id??w;if(!g||typeof d.turn!="number"||!d.quote)throw new Error("INVALID_ADD: a chat add requires a conversation cite {turn, quote} and conv_source_id");let f=C.content,v=f&&typeof f=="object"&&!Array.isArray(f)&&Object.keys(f).length>0?f:null,A=new Set(["label","cite","conv_source_id","content","rationale","edges"]),S=v??Object.fromEntries(Object.entries(C).filter(([N])=>!A.has(N)));return{kind:"add",label:a,content:S,cite:{turn:d.turn,quote:d.quote},convSourceId:g,rationale:C.rationale,eventId:k}}}}function je(i,t,y={}){let w=y.turn??0,k=[],l=[];for(let[d,g]of i.entries()){let f=Te(g,`ops[${d}]`);if(f!==null)throw new Error(`NUL_IN_TEXT: ${Ae(f)}`)}for(let d of i){if(!Le.has(d.op))throw new Error(`UNKNOWN_OP: "${d.op}" is not a chat op (accepted: ${[...Le].join(", ")})`);if(d.op!=="add"&&!d.target)throw new Error(`MISSING_TARGET: a ${d.op} op needs a target ref`)}for(let d of i)(d.op==="add"||d.op==="enhance"||d.op==="retract")&&l.push(d);let C=new Map;for(let d of i){if(!Qe.has(d.op)||!d.target)continue;let g=C.get(d.target)??[];g.push(d),C.set(d.target,g)}for(let[d,g]of C){let f=Math.max(...g.map(A=>A.seq)),v=g.filter(A=>A.seq===f);if(v.length>1){k.push({target:d,seq:f,kinds:v.map(A=>A.op)});continue}l.push(v[0])}return{chatOps:l.sort((d,g)=>d.seq-g.seq).map(d=>Ue(d,y.prefix??Fe(w,y.session),t,y.convSourceId)),ambiguous:k}}function Pe(i,t){return i.map(y=>{let w=y.data?.tip;if(y.code!=="EXPECTED_CID_MOVED"||typeof w!="string")return{code:y.code};let k=t?.getNode(w)?.content??{},l=typeof k.title=="string"?k.title:typeof k.text=="string"?k.text:void 0,C=t?.displayNameOf(w)??(typeof y.data?.target=="string"?y.data.target:void 0);return{code:y.code,moved:y.data?.moved===!0,...C?{ref:C}:{},...l?{title:l}:{}}})}function He(i){let t=[];return i.questions.forEach((y,w)=>{if(i.resolution[w])return;let k=y.recommended_index!=null?y.options[y.recommended_index]?.label:void 0;k!=null&&t.push(y.risk==="high"?`${B(k)} \u203C`:B(k))}),t.length>3?`${t.slice(0,3).join(" \xB7 ")} \xB7 +${t.length-3} more`:t.join(" \xB7 ")}function B(i){return i.replace(/\s*\(recommended\)\s*$/i,"")}function Be(i){let t=i.text.replace(/\?+\s*$/,"");return t.length<=36?t:`${t.slice(0,33)}\u2026`}function ze(i,t){let y=new Set;for(let w=t;w&&!y.has(w);w=i.superseded.get(w)){if(i.trust.get(w)==="archived")return!0;y.add(w)}return!1}function Ve(i){return i.use_cases??[]}var Ke={acs:"acceptance criteria",scenarios:"scenarios",exercises:"exercises",tests:"tests",gaps:"gaps"};function Xe(i){let t=[],y=[],w=(a,d)=>{d.length!==0&&(y.push(a),t.push(...d))},k=a=>typeof a=="string"&&/^[a-z]{1,4}\d{1,4}$/i.test(a)?a:null,l=a=>{let d=k(a.automates)??"1 scenario",g=a.verifies??[],f=g.map(k).filter(S=>S!==null).slice(0,2),v=g.length-f.length,A=f.length?`${f.join(" ")}${v>0?` +${v}`:""}`:`${g.length} ACs`;return`covers ${d} \xB7 verifies ${A}`};w("acs",(i.acs??[]).map(a=>({temp_ref:a.temp_ref,title:a.text,kind:"ac",badge:String(a.kind),extra:{...a.expected_answer?{expects:`${String(a.expected_answer.operator??"")} \xB7 ${String(a.expected_answer.operand??"")}`}:{},"scoped to":a.scoped_to??"(use-case)"}}))),w("scenarios",(i.scenarios??[]).map(a=>({temp_ref:a.temp_ref,title:a.title,kind:"scenario",badge:a.case_type,why:a.intent,depends_on_hint:a.depends_on??[],extra:{technique:a.technique_notes}}))),w("exercises",(i.exercises??[]).map(a=>({temp_ref:k(a.scenario)??"wiring",title:`${k(a.scenario)??"scenario"} exercises ${k(a.ac)??"1 AC"}`,kind:"exercise",badge:"wires",why:a.rationale}))),w("tests",(i.tests??[]).map(a=>({temp_ref:a.temp_ref,title:a.title,kind:"test",why:l(a),depends_on_hint:a.reuses??[],extra:{automates:String(a.automates??"?"),verifies:(a.verifies??[]).join(", "),check:a.check?`${String(a.check.kind)} vs ${String(a.check.verified_against)}`:"?"}})));let C={high:"high",medium:"med",med:"med",low:"low"};return w("gaps",(i.gaps??[]).map(a=>{let d=a.question??{};return{temp_ref:a.temp_ref??a.ref??"?",title:String(d.header??a.kind),kind:"gap",badge:C[String(a.risk??"").trim().toLowerCase()]??"",why:d.prompt??d.text??"",question:String(d.prompt??d.text??d.header??""),rationale:String(a.risk_rationale??"")}})),{items:t,heading:y.join(" + ")||"design"}}function ut(i={}){let t={turns:[],thinking:De(),pending:null,confirm:null,status:"idle",ledger:[],activeTurn:null,stream:null,checkpoint:!1},y=e=>{let n=[],r=e.minted.map(u=>u.slug).filter(Boolean);r.length&&n.push(`added ${r.join(", ")}`);let s=e.applied.length-e.minted.length;s>0&&n.push(`${s} change${s===1?"":"s"} applied`);let o=e.staleDelta.length?$().text("chat.stales",{count:e.staleDelta.length}):"";return o&&n.push(o),n.join(" \xB7 ")||"no changes"},w=(e,n)=>{let r=i.refreshGraph?.()??i.graph;return!r?.nodeLabel||n.applied.length===0||n.minted.length>0||n.staleDelta.length>0?!1:e.every(s=>{if(s.kind!=="approve"||!s.target)return!1;let o=r.resolve(s.target);return o!==null&&r.nodeLabel.get(r.tipOf(o.cid))==="usecase"})},k=[];i.onRender&&k.push(i.onRender);let l=0,C=new Map,a=e=>{let n=C.get(e);if(n===void 0){let r=`chatop:${e}:`;n=0;for(let s of(i.refreshGraph?.()??i.graph)?.appliedEvents??[]){if(!s.startsWith(r))continue;let o=Number(s.slice(r.length).split(":")[0]);Number.isInteger(o)&&o>n&&(n=o)}C.set(e,n)}return n},d=0,g=null,f=null,v=null,A=null,S=[],N=null,ee=!1,G=0,te=null,M=null,ne=0,ue=0,le=!1,ce=!1,ge=e=>(le||(le=!0,m({kind:"note",text:$().text("note.turns_unrecorded",{detail:e})}),p()),null),pe=(e,n)=>{if(!v||!i.store||!e.trim())return null;try{let r=i.refreshGraph?.()??i.graph;if(!r)return null;let s=Ee({store:i.store,graph:r,sourceId:v,text:e,speaker:n,by:i.by??{kind:"human",id:"owner"}});return s.errors?ge(s.errors.map(o=>o.detail).join("; ")):s.record!==null?$e(v,s.turn):null}catch(r){return ge(r instanceof Error?r.message:String(r))}},Ge=e=>{if(!v||!i.store)return;let n=i.refreshGraph?.()??i.graph,r=n?.heads.get(v),s=n?.convChains.get(v);if(!n||typeof r!="string"||!s)return;let o=n.getNode(r)?.content?.blob,u=typeof o=="string"?i.store.getBlob(o)?.toString("utf8")??"":"";if(u)for(let h of e){if(h.kind!=="add"||h.convSourceId!==v)continue;let _=de(u,h.cite.turn);if(!(_!==null&&ae(h.cite.quote,_)))for(let R=s.turns;R>=1;R--){let b=de(u,R);if(b!==null&&ae(h.cite.quote,b)){h.cite={...h.cite,turn:R};break}}}},T={startedAt:null,thinkMs:0,toolCalls:0,tools:new Map},W=()=>{T.startedAt??=Date.now()},D=()=>{if(T.toolCalls>0){let e=T.startedAt!=null?Math.max(1,Math.round((Date.now()-T.startedAt)/1e3)):Math.max(1,Math.round(T.thinkMs/1e3));m({kind:"worked",durS:e,toolCalls:T.toolCalls,tools:[...T.tools.entries()].map(([n,r])=>({name:n,n:r}))})}T.startedAt=null,T.thinkMs=0,T.toolCalls=0,T.tools.clear()},Q=null,re=new Map,fe=e=>JSON.stringify([e.id,e.text,e.options.map(n=>n.label)]),F=null,me=new Map,ie=new Map,U=new Map,he=null,p=()=>{H&&(clearTimeout(H),H=null),ke();for(let e of k)e()},ke=()=>{G>0&&g!=null&&g!==te?t.nestedAgent=!0:delete t.nestedAgent},H=null,be=()=>{H||(H=setTimeout(()=>{H=null,ke();for(let e of k)e()},80))},Y=0,m=e=>{e.kind==="childClose"&&Y>0&&(Y-=1),Y>0&&e.kind!=="childOpen"&&e.kind!=="childBack"&&(e.era=Y),e.kind==="childOpen"&&(Y+=1),t.ledger.push(e)},z=null,Z=!1,se=0,V=(e=!1)=>{if(z)m({kind:"agent",text:z});else if(e&&Z){let r=([...t.turns].reverse().find(s=>s.role==="agent")?.items??[]).filter(s=>!s.matches_existing).length;m({kind:"note",text:$().text("chat.refine_hint",{added:r,held:se})})}z=null,Z=!1,se=0,delete t.committing},We=()=>{z=null,Z=!1,delete t.committing},E=null,oe=(e,n=!1,r)=>{if(!E)return;if(e)for(let o of E.items){let u=e.get(o.temp_ref);u&&(o.logical_id=u)}if(r)for(let o of E.items)r.has(o.temp_ref)&&(o.sessionAdded=!0);let s=E.items.filter(o=>o.kind==="test");if(s.length>0){let o;try{o=i.refreshGraph?.()??i.graph}catch{o=i.graph}let u=h=>{if(Ie.test(h))return h;let _=e?.get(h);if(_)return _;let R=h.startsWith("sha256:")?h:U.get(h);return(R?o?.displayNameOf(R):null)??null};for(let h of s){let _=h.extra??{},R=_.verifies?_.verifies.split(", "):[];h.links={covers:_.automates&&_.automates!=="?"?u(_.automates):null,verifies:R.map(u).filter(b=>b!==null),verifiesTotal:R.length}}}if(n)for(let o of E.items)o.logical_id||(o.held=!0);m({kind:"turn",...E}),E=null},ye=()=>{let e=i.refreshGraph?.()??i.graph;if(!i.commitChatTurn||!e?.trust)return!0;let n=[];for(let{item:b}of Oe(t.turns).entries){if(!b.logical_id||b.turnedDown||b.matches_existing||(b.kind??"use-case")!=="use-case")continue;let I=e.names?.get(b.logical_id)??U.get(b.temp_ref);if(!I)continue;let c=e.tipOf(I);e.trust.get(c)==="derived"&&!n.includes(c)&&n.push(c)}let r=new Set(i.addedBefore?.()??[]);for(let b of r){let I=e.tipOf(b);r.has(I)&&e.trust.get(I)==="derived"&&!n.includes(I)&&n.push(I)}if(n.length===0)return!0;l+=1;let s=v||i.session?.state?.sid,o=l+(s?a(s):0),u=s?`chatop:${s}:${o}`:`chatop:${o}`,h=n.map((b,I)=>({kind:"approve",target:b,expectedCid:b,eventId:`${u}:${b}:approve:${I}`})),_;try{_=i.commitChatTurn({graph:e,ops:h,by:i.by??{kind:"human",id:"owner"},...i.descriptor?.mint_gate?{mintable:i.descriptor.mint_gate}:{},...i.session?.state?.sid?{sid:i.session.state.sid}:{}})}catch(b){_={record:null,errors:[{code:"COMMIT_THREW",detail:b instanceof Error?b.message:String(b)}]}}if(_.errors)return t.error=_.errors.map(b=>b.detail).join("; "),m({kind:"commit",ok:!1,line:$().text("chat.commit_failed",{}),warnings:_.errors.map(b=>`${b.code}: ${b.detail}`),refused:Pe(_.errors,e),person:!0}),p(),!1;_.applied.length>0&&i.session?.markApplied(_.applied),m({kind:"commit",ok:!0,line:$().text("chat.approved",{count:_.applied.length})});let R=i.refreshGraph?.();return R&&f&&f(R),xe(R??i.graph),!0},xe=e=>{if(!(!e?.trust||!e.superseded))for(let n of t.turns)for(let r of n.items??[]){let s=r.logical_id&&e.names?.get(r.logical_id)||U.get(r.temp_ref);s&&(ze(e,s)?r.turnedDown=!0:delete r.turnedDown)}},q=()=>{oe(),delete t.committing,t.activeTurn&&(t.activeTurn=null)},ve=(e,n)=>{let r=n.selected_index!=null?e.options[n.selected_index]?.label:void 0;return n.choice||(r!=null?B(r):"?")},K=()=>{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,o)=>{let u=e.resolution[o];return u.form==="deferred"?{id:s.id,selected_index:null,free_text:null}:{id:s.id,selected_index:u.selected_index,free_text:u.free_text}});t.pending=null,t.status=t.status==="pausing"?"pausing":"streaming",t.status==="streaming"&&(t.busySince=Date.now());let r=Q;Q=null,r?.(n)},L=(e,n)=>{let r=t.pending,s=r.questions[e],o=r.resolution[e];r.resolution[e]=n;let u=Be(s);o?m({kind:"answer",receipt:{form:"changed",qNum:e+1,stub:u,choice:ve(s,n),prev:o.choice}}):n.form==="deferred"?m({kind:"answer",receipt:{form:"deferred",qNum:e+1,stub:u}}):m({kind:"answer",receipt:{form:n.form,qNum:e+1,stub:u,choice:ve(s,n)}})},we=()=>{let e=t.pending;e&&(e.questions.forEach((n,r)=>{e.resolution[r]||L(r,{form:"deferred",selected_index:null,free_text:null,choice:""})}),K())},X=new Map,_e=e=>{X.clear();let n={high:0,med:1,low:2};return e=e.map((r,s)=>({q:r,i:s})).sort((r,s)=>(n[r.q.risk]??3)-(n[s.q.risk]??3)||r.i-s.i).map(({q:r})=>r),{questions:e,cursor:0,resolution:e.map(()=>null)}},Ce=(e,n)=>{if(t.confirm&&(t.confirm=null),t.pending)return;let r=n==="kane"?{kind:"note",text:$().text("chat.repair_sent",{})}:{kind:"user",text:e};if(!g){t.turns.push({role:"user",text:e}),m(r),t.notice="the agent isn't running \u2014 nothing sent",p();return}t.notice=void 0,ee=!1,t.checkpoint=!1,delete t.resumedParked,V(),t.turns.push({role:"user",text:e}),m(r);let s=pe(e,n);for(t.status="streaming",t.busySince=Date.now(),W(),t.error=void 0,d+=1;S.length>0;)d+=1,g({type:"user_message",message_id:`u${d}-receipt`,text:S.shift()},{by:"kane",receipt:!0});g({type:"user_message",message_id:s??`u${d}`,text:e},{by:n}),p()};return{state:t,explainLines(e){if(!i.explain||!i.graph||!i.store)return null;let n=i.explain(i.store,i.graph,e);return n.target?[`${n.target.label} ${n.target.slug??n.target.cid.slice(0,19)}:`,...n.entries.map(r=>` [${r.kind}] ${r.rationale??r.detail}`)]:null},explainRef(e){if(!i.explain||!i.graph||!i.store){m({kind:"note",text:"explain isn't available here"}),p();return}let n=i.explain(i.store,i.graph,e),r=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}`;m({kind:"note",text:r}),p()},subscribe(e){return k.push(e),()=>{let n=k.indexOf(e);n>=0&&k.splice(n,1)}},submit(e){Ce(e,"person")},repair(e){Ce(e,"kane")},attachSender(e){let n=g;return g=e,()=>{g=n}},attachOnCommitted(e){f=e},attachConversationSource(e){v=e},opIdPrefix(e){A=e},attachSession(e){i.session=e},enterNested(e){if(G+=1,G>1)return()=>{G-=1};let n={checkpoint:t.checkpoint,receipts:S.splice(0,S.length)};te=g,M=t.credits?.total??0,t.checkpoint=!1,t.status==="idle"&&(t.status="working",t.workingLabel=e,t.busySince=Date.now()),p();let r=!1;return()=>{r||(r=!0,G-=1,te=null,M!==null&&(ne+=Math.max(0,(t.credits?.total??M)-M)),M=null,S.splice(0,S.length,...n.receipts),t.checkpoint=n.checkpoint,t.status==="working"&&(t.status="idle",t.workingLabel=void 0,t.busySince=void 0),p())}},holdReceipt(e,n){S.push(e),n?.checkIn!==!1&&(t.checkpoint=!0),p()},drainHeldReceipts(){return S.splice(0,S.length)},peekHeldReceipts(){return[...S]},submitAnswer(e,n){let r=t.pending,s=r?.questions[e],o=s?.options[n]?.label;!r||!s||o==null||(L(e,{form:"answered",selected_index:n,free_text:null,choice:B(o)}),K(),p())},submitFreeText(e,n){let r=t.pending,s=r?.questions[e],o=n.trim();!r||!s||!o||(L(e,{form:"answered",selected_index:null,free_text:o,choice:o}),K(),p())},deferBatch(e){let n=t.pending;if(!n||!Q)return;n.questions.forEach((s,o)=>{let u=n.resolution[o];u&&u.form==="answered"&&re.set(fe(s),u)}),t.pending=null,t.status=t.status==="pausing"?"pausing":"streaming",t.status==="streaming"&&(t.busySince=Date.now()),m({kind:"note",text:`questions set aside \u2014 source ${e.source_id} landed; the agent reads it next`});let r=Q;Q=null,r({deferred:!0,ingested:e}),p()},submitAnswerWithText(e,n,r){let s=t.pending,o=s?.questions[e],u=o?.options[n]?.label;if(!s||!o||u==null)return;let h=r.trim();L(e,{form:"answered",selected_index:n,free_text:h||null,choice:h?`${B(u)} \u2014 ${h}`:B(u)}),K(),p()},toggleOption(e,n){let r=t.pending?.questions[e];if(!r||r.options[n]==null)return;let s=X.get(e)??new Set;s.has(n)?s.delete(n):s.add(n),X.set(e,s),p()},multiSelection(e){return[...X.get(e)??[]].sort((n,r)=>n-r)},confirmMulti(e){let n=t.pending,r=n?.questions[e];if(!n||!r)return;let s=[...X.get(e)??[]].sort((u,h)=>u-h).map(u=>r.options[u]?.label).filter(u=>u!=null);if(s.length===0)return;X.delete(e);let o=s.join(", ");L(e,{form:"answered",selected_index:null,free_text:o,choice:o}),K(),p()},goWithRecommendations(){let e=t.pending;if(!e)return{picks:""};let n=He(e),r=null;return e.questions.forEach((s,o)=>{if(e.resolution[o])return;let u=s.recommended_index,h=u!=null?s.options[u]?.label:void 0;if(h==null){r===null&&(r=o);return}L(o,{form:"assumed",selected_index:u,free_text:null,choice:B(h)})}),r!==null?(e.cursor=r,p(),{blocked:r}):(K(),p(),{picks:n})},reopenQuestion(){let e=t.pending;if(!e)return;let n=e.cursor<0?e.questions.length:e.cursor;for(let r=n-1;r>=0;r--)if(e.resolution[r]){e.cursor=r,p();return}},continueParked(){if(g&&!(G>0&&g===te)){for(t.checkpoint=!1,m({kind:"continued"});S.length>0;)d+=1,g({type:"user_message",message_id:`u${d}-receipt`,text:S.shift()},{by:"kane",receipt:!0});d+=1,g({type:"user_message",message_id:`u${d}`,text:"continue"},{by:"person",continued:!0}),t.status="streaming",t.busySince=Date.now(),W(),p()}},note(e){m({kind:"note",text:e}),p()},finalizeForExit(){q(),D(),V(),t.stream=null,p()},aliasOf(e){return U.get(e)},guardOps(e){return N=e,ee=!1,()=>{N===e&&(N=null)}},registerAliases(e,n){for(let r of e)U.set(r.ref,r.cid);if(n?.unchanged){E=null,p();return}oe(new Map(e.filter(r=>r.id).map(r=>[r.ref,r.id])),!1,new Set(e.filter(r=>r.own).map(r=>r.ref))),p()},endUnstartedTurn(){t.status!=="streaming"&&t.status!=="working"||(t.status="idle",t.workingLabel=void 0,t.busySince=void 0,p())},answersHeld(e){ie=new Map(e.map(n=>[n.id,n.digest]))},resumedParked(){t.status="idle",t.workingLabel=void 0,t.busySince=void 0,t.resumedParked=!0,p()},restoreCheckIn(){let e=i.resumedCheckIn?.()??null;e!==null&&(t.resumed=e,t.checkpoint=!0,p())},setWorking(e){if(e!=null){if(t.status!=="idle"&&t.status!=="working")return;t.status==="idle"&&(t.busySince=Date.now()),W(),t.status="working",t.workingLabel=e}else{if(t.status!=="working")return;t.status="idle",t.workingLabel=void 0,t.busySince=void 0}p()},narrated(e,n){q(),t.stream=null,t.busySince=void 0,D(),n&&m(n),e&&m({kind:"agent",text:e}),(t.status==="streaming"||t.status==="working")&&(t.status="idle"),t.workingLabel=void 0,p()},ledger(e){if(e.kind==="commit"&&(oe(void 0,e.held===!0),se+=e.heldChanges??0),e.kind==="error"&&(q(),D(),V()),e.kind==="commit"&&(e.notes!==void 0||e.quiet)){let{notes:n,quiet:r,...s}=e;m(r?{kind:"note",text:s.line}:s);for(let o of n??[])m({kind:"note",text:o})}else m(e);e.kind==="commit"&&(e.ok?V(!0):We()),p()},senderAlive(){return g!=null},approveAdded(){let e=ye();return p(),e},completeSession(e){e?.approveAdded&&!ye()||(we(),g?.({type:"session_complete"}),t.status="idle",t.busySince=void 0,p())},requestPause(){we(),t.status="pausing",t.busySince=void 0;let e=g;Promise.resolve().then(()=>e?.({type:"pause"})),p()},ask(e){t.pending=_e(e),me=new Map(e.map((r,s)=>[r.id,s+1])),t.status="awaiting-input",t.busySince=void 0;let n=new Promise(r=>{Q=r});if(re.size>0){let r=0;e.forEach((s,o)=>{let u=fe(s),h=re.get(u);h&&(re.delete(u),L(o,{...h}),r+=1)}),r>0&&m({kind:"note",text:`your earlier answer${r>1?"s are":" is"} pre-filled \u2014 press enter to send, or pick a different answer`})}return p(),n},attachIngest(e){let n=F;return F=e,()=>{F===e&&(F=n)}},canIngest(){return F!==null},async ingestAttach(e){let n=F,r=e.trim();if(!n||!r)return;let s;try{s=await n(r)}catch(o){s={ok:!1,error:o instanceof Error?o.message:String(o)}}s.ok||(m({kind:"note",text:s.error??"the source could not be ingested"}),p())},noteCoercion(e,n){m({kind:"answer",receipt:{form:"assumed",qNum:me.get(e.id)??0,stub:Be(e),choice:n,note:"your typed answer couldn't be used here"}}),p()},nothingCommitted(){t.committing&&(delete t.committing,p())},creditsCarriedIn(e){e<=0||(t.credits={turn:t.credits?.turn??0,total:(t.credits?.total??0)+e},ne+=e,p())},creditsSoFar(e,n){if(!(e<=0)){if(M!==null){t.credits={turn:0,total:M+e},p();return}t.credits||(t.credits={turn:0,total:e},n!==void 0&&n>0&&(ne=n),p())}},onAgentEvent(e){switch(e.type){case"reasoning_delta":case"reasoning_done":case"tool_activity":case"decision_activity":{let n=t.thinking;if(t.thinking=Me(n,e),t.thinking!==n&&(e.type==="reasoning_done"&&e.present?(W(),T.thinkMs+=e.took_ms):e.type==="tool_activity"&&e.status!=="started"&&(W(),T.toolCalls+=1,T.tools.set(e.name,(T.tools.get(e.name)??0)+1))),e.type==="reasoning_delta"){be();return}break}case"usage":t.credits={turn:e.credits,total:(M??ne)+e.total_credits};break;case"text_delta":{let n=he;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)&&(he={turn_id:e.turn_id,attempt:e.attempt},t.stream={text:""}),t.stream={text:(t.stream?.text??"")+e.text},be();return}case"progress":break;case"proposal":{l+=1,q(),t.stream=null,t.busySince=void 0,D();let n=Ve(e.proposal),r=i.dedupFlags?.(e.proposal);if(r)for(let o of n){let u=r.get(o.temp_ref);u&&(o.matches_existing=u)}let s=i.refreshGraph?.()??i.graph;if(s)for(let o of n){let u=o.matches_existing?.cid,h=typeof u=="string"?s.displayNameOf(u):null;h&&(o.matched_id=h)}t.turns.push({role:"agent",turnIndex:l,items:n,text:e.narrative}),z=e.narrative??null,Z=!0,t.committing=!0,t.activeTurn={turnIndex:l,heading:"use-cases",items:n},E={turnIndex:l,heading:"use-cases",items:n},(t.status==="streaming"||t.status==="working")&&(t.status="idle"),t.workingLabel=void 0;break}case"design":{l+=1,q(),t.stream=null,t.busySince=void 0,D();let{items:n,heading:r}=Xe(e.design),s=e.design.phase==="wiring"?"acceptance criteria + exercises":r.split(" + ").map(o=>Ke[o]??o).join(" + ");m({kind:"banner",text:`designing: ${s}`}),t.turns.push({role:"agent",turnIndex:l,items:n,itemsHeading:r,text:e.narrative}),z=e.narrative??null,Z=!0,t.committing=!0,t.activeTurn={turnIndex:l,heading:r,items:n},E={turnIndex:l,heading:r,items:n},(t.status==="streaming"||t.status==="working")&&(t.status="idle"),t.workingLabel=void 0;break}case"ask_user":if(D(),e.questions.length>0&&e.questions.every(n=>ie.get(n.id)===Ne(n))){for(let n of e.questions)ie.delete(n.id);break}t.pending=_e(e.questions),t.status="awaiting-input",t.busySince=void 0;break;case"chat_ops":{l+=1,q(),D(),t.stream=null,(t.status==="streaming"||t.status==="working")&&(t.status="idle",t.busySince=void 0,t.workingLabel=void 0);let n=e.chat_ops??e,r=Array.isArray(n.ops)?n.ops:[],s=n.text??e.text??"",o=i.refreshGraph?.()??i.graph,u=c=>U.get(c)??c,h=r.map(c=>{if(!c.target)return c;let x=u(c.target),O=c.expected_cid;if(O==null&&o){let Se=o.resolve(x);Se&&(O=o.tipOf(Se.cid))}let j=c.payload?.redirect_to,P=j&&u(j);return x===c.target&&O===c.expected_cid&&P===j?c:{...c,target:x,expected_cid:O,...P!==j?{payload:{...c.payload,redirect_to:P}}:{}}}),_;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");let c=v||i.session?.state?.sid,x=A;A=null,_=je(h,i.descriptor??{mint_gate:[]},{turn:l+(c?a(c):0),...c?{session:c}:{},...x?{prefix:x}:{},...v?{convSourceId:v}:{}})}catch(c){t.error=c instanceof Error?c.message:String(c),t.turns.push({role:"agent",turnIndex:l,text:s,narration:t.error}),s&&m({kind:"agent",text:s}),m({kind:"error",title:t.error,detail:[]}),S.push(`OPS REJECTED (did not compile) \u2014 nothing landed; do not assume any of your last ops applied.
|
|
4
|
+
- `+t.error);break}let{chatOps:R,ambiguous:b}=_;if(b.length>0){let c=b[0];t.confirm={kind:"ambiguity-confirm",prompt:`did you mean edit or ${c.kinds.filter(x=>x!=="edit").join("/")} on ${c.target}?`},t.turns.push({role:"agent",turnIndex:l,text:s}),s&&m({kind:"agent",text:s});break}Ge(R);let I=R.length>0&&N?N(R):null;if(I){if(t.turns.push({role:"agent",turnIndex:l,text:s}),S.push(I),g&&!ee)for(ee=!0,t.status="streaming",t.busySince=Date.now(),W();S.length>0;)d+=1,g({type:"user_message",message_id:`u${d}-receipt`,text:S.shift()},{by:"kane",receipt:!0});break}if(i.commitChatTurn&&R.length>0){let c;try{c=i.commitChatTurn({graph:i.refreshGraph?.()??i.graph,ops:R,by:i.by??{kind:"human",id:"owner"},...i.descriptor?.mint_gate?{mintable:i.descriptor.mint_gate}:{},...i.session?.state?.sid?{sid:i.session.state.sid}:{}})}catch(x){c={record:null,errors:[{code:"COMMIT_THREW",detail:x instanceof Error?x.message:String(x)}]}}if(c.errors)t.error=c.errors.map(x=>x.detail).join("; "),t.turns.push({role:"agent",turnIndex:l,text:s}),m({kind:"commit",ok:!1,line:$().text("chat.commit_failed",{}),warnings:c.errors.map(x=>`${x.code}: ${x.detail}`),refused:Pe(c.errors,o)}),S.push(["COMMIT FAILED (chat turn) \u2014 nothing landed; do not assume any of your last ops applied.",...c.errors.map(x=>`- ${x.code}: ${x.detail}${x.code==="EXPECTED_CID_MOVED"&&typeof x.data?.tip=="string"?`; its current cid is ${x.data.tip}`:""}`),...c.errors.some(x=>x.code==="UNKNOWN_FIELD")?["If you were changing citations or matched-existing content, that is proposal territory (approve/re-propose) \u2014 a chat edit can only replace a node's own schema fields."]:[]].join(`
|
|
5
|
+
`)),s&&m({kind:"agent",text:s});else{c.applied.length>0&&i.session?.markApplied(c.applied);let x=w(R,c)?$().text("chat.approved",{count:c.applied.length}):y(c);t.turns.push({role:"agent",turnIndex:l,text:s,narration:x}),m({kind:"commit",ok:!0,line:x});let O=i.refreshGraph?.();if(O&&f&&f(O),xe(O??i.graph),O)try{ue+=1;let J=i.descriptor?.mint_gate?.includes("usecase")?"extract":"design",j=qe({verb:J,commitN:ue,phase:"chat",committed:c.minted.map(P=>({cid:P.cid,...P.slug?{logical_id:P.slug}:{}})),...Re(i.templateVersion?.()??null)>=8?{typedBlockers:!0,...i.ucRef?{ucRef:i.ucRef}:{}}:{},...(i.pendingForceScope?.()??[]).length?{ignoreGaps:new Set(i.pendingForceScope())}:{}},O);S.push(j.text)}catch(J){ce||(ce=!0,m({kind:"note",text:$().text("note.receipt_unbuilt",{detail:J instanceof Error?J.message:String(J)})}))}s&&m({kind:"agent",text:s})}}else t.turns.push({role:"agent",turnIndex:l,text:s}),s&&m({kind:"agent",text:s});pe(s,"agent");break}case"done":case"session_complete":q(),D(),V(),t.status="idle",t.busySince=void 0,g=null;break;case"error":q(),D(),V(),t.stream=null,t.status="idle",t.busySince=void 0,t.error=e.message,g=null,m({kind:"error",title:e.message,detail:[]});break;case"session_paused":break;case"turn_retry":m({kind:"note",text:$().text("note.model_retry",{seconds:Math.round(e.wait_s)})});break;default:break}p()}}}export{He as a,B as b,Be as c,ut as d};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{c as g,d as u}from"./chunk-DNGOT65K.js";import{a as f}from"./chunk-72KYMWQ5.js";import{readFileSync as E}from"fs";var p=/\{\{\s*([A-Za-z_][A-Za-z0-9_.]*)\s*\}\}/g;function h(a){let e=[];for(let o of a){let r=o.trim();if(r){if(r.startsWith("@")){let n=r.slice(1).trim(),t;try{t=E(n,"utf8")}catch(l){throw new Error(`--deps @${n}: ${l.message}`)}let s=t.trim();s&&e.push(s);continue}e.push(r)}}return e.join(`
|
|
3
|
+
|
|
4
|
+
`)}function y(a,e){let o=a.prompt.trim(),r=a.deps.trim(),n=[["--prompt",o],["--deps",r]];if(!n.some(([,i])=>p.test(i)))return p.lastIndex=0,{prompt:o,deps:r,variables:{},secretNames:[]};p.lastIndex=0;let t=u({objective:[o,r].join(`
|
|
5
|
+
`),globalDir:e.globalDir,localDir:e.localDir,file:e.file,inline:e.inline,onLoadError:e.onLoadError});for(let[i,x]of n)for(let v of x.matchAll(p)){let c=v[1],b=c.replace(/^(global\.|secrets\.user\.)/,"");if(!(c in t.raw)&&!(b in t.raw))return{error:`${i} uses {{${c}}} but no variable "${b}" is defined (variables files, --variables-file or --variables)`}}let s=o?f(t.raw,o).objective:"",l=r?f(t.raw,r).objective:"",m=g(t.auteur,[s,l].join(`
|
|
6
|
+
`)),d=Object.entries(m).filter(([,i])=>i.secret).map(([i])=>i);return{prompt:s,deps:l,variables:m,secretNames:d}}export{h as a,y as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{h as w}from"./chunk-
|
|
2
|
+
import{h as w}from"./chunk-SXRHKXSE.js";import{a as h}from"./chunk-RZ4F3BHX.js";import{b as f}from"./chunk-I6OQISK4.js";import{mkdtemp as O,rm as $}from"fs/promises";import{createWriteStream as R}from"fs";import{Readable as U}from"stream";import{pipeline as F}from"stream/promises";import{tmpdir as T}from"os";import{basename as z,join as A}from"path";import{access as x,cp as P,mkdir as g,readdir as y,readFile as S,rename as I,rm as k,stat as b,writeFile as v}from"fs/promises";import{basename as D,join as d}from"path";function u(){return d(f,"mobile","apps")}function m(){return d(u(),"index.json")}function C(){return{readIndex:async()=>{try{let e=JSON.parse(await S(m(),"utf8"));return{apps:Array.isArray(e.apps)?e.apps:[]}}catch{return{apps:[]}}},writeIndex:async r=>{await g(u(),{recursive:!0});let e=`${m()}.tmp`;await v(e,JSON.stringify(r,null,2)),await I(e,m())},exists:async r=>{try{return await x(r),!0}catch{return!1}},copy:(r,e)=>P(r,e,{recursive:!0,force:!0}),remove:r=>k(r,{recursive:!0,force:!0}),sizeOf:async r=>{try{return(await b(r)).size}catch{return}},now:()=>new Date}}var c=class{deps;constructor(e={}){this.deps={...C(),...e}}async list(){let{apps:e}=await this.deps.readIndex();return[...e].sort((t,s)=>s.lastUsedAt.localeCompare(t.lastUsedAt))}async find(e){return(await this.deps.readIndex()).apps.find(t=>t.key===e)}async put(e){let t=await this.deps.readIndex(),s=t.apps.find(n=>n.key===e.key),a=this.deps.now().toISOString();if(s&&await this.deps.exists(s.path))return s.lastUsedAt=a,await this.deps.writeIndex(t),s;s&&(t.apps=t.apps.filter(n=>n.key!==e.key));let l=D(e.name??e.sourcePath),o=d(u(),e.key),p=d(o,l);await g(o,{recursive:!0}),await this.deps.copy(e.sourcePath,p);let i={key:e.key,path:p,name:l,source:e.source,...e.source==="local"?{originPath:e.sourcePath}:{},addedAt:a,lastUsedAt:a,...await this.deps.sizeOf(p).then(n=>n?{bytes:n}:{})};return t.apps=[...t.apps.filter(n=>n.key!==e.key),i],await this.deps.writeIndex(t),i}async exists(e){if(await this.deps.sizeOf(e.path)!==void 0)return!0;try{return await y(e.path),!0}catch{return!1}}async forget(e){let t=await this.deps.readIndex(),s=t.apps.find(a=>a.key===e);s&&(await this.deps.remove(s.path),t.apps=t.apps.filter(a=>a.key!==e),await this.deps.writeIndex(t))}async prune(){let e=await this.deps.readIndex(),t=[];for(let s of e.apps)if(await this.deps.sizeOf(s.path)!==void 0)t.push(s);else try{await y(s.path),t.push(s)}catch{}return t.length!==e.apps.length&&await this.deps.writeIndex({apps:t}),t}};var E=30*6e4,j=/^APP\d{6,}$/;function Y(r){return!!r&&j.test(r.trim())}function _(){return{store:new c,client:(r,e)=>new w(r,e),fetchToFile:async(r,e)=>{let t=await h(r,{method:"GET",signal:AbortSignal.timeout(E)});if(!t.ok)throw new Error(`Downloading the app failed: ${t.status} ${t.statusText}`);if(!t.body)throw new Error("Downloading the app failed: empty response body");await F(U.fromWeb(t.body),R(e))}}}async function Z(r,e={}){let t={..._(),...e},s=r.appId.trim(),a=await t.store.find(s);if(a&&await t.store.exists(a))return r.onProgress?.(`using the copy of ${a.name} already on this machine`),await t.store.put({key:s,sourcePath:a.path,source:"cloud",name:a.name}),{path:a.path,name:a.name,fromStore:!0};r.onProgress?.(`looking up ${s}\u2026`);let o=await t.client(r.baseUrl,r.auth).details(s);if(r.accepts&&!r.accepts.some(i=>o.name.toLowerCase().endsWith(i)))throw new Error(`${o.name} cannot run on this device \u2014 expected ${r.accepts.join(" or ")}.`);r.onProgress?.(`downloading ${o.name} \u2014 this can take a while, please wait\u2026`);let p=await O(A(T(),"kane-app-dl-"));try{let i=A(p,z(o.name));await t.fetchToFile(o.url,i);let n=await t.store.put({key:s,sourcePath:i,source:"cloud",name:o.name});return r.onProgress?.(`${o.name} is ready`),{path:n.path,name:n.name,fromStore:!1,details:o}}finally{await $(p,{recursive:!0,force:!0})}}export{c as a,Y as b,Z as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{f as d}from"./chunk-
|
|
2
|
+
import{f as d}from"./chunk-P7MSVLAH.js";function w(r){let{isAgent:c,log:m}=r,a=r.stdout??process.stderr,s=r.stdin??process.stdin,p=t=>{c&&d(t)};return{async runSteps(t){let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-5ZN47FAT.js"),{TestMdRunView:i}=await import("./TestMdRunView-4GPRWHEU.js"),{ScrollbackProvider:n}=await import("./scrollback-GGNBDFQV.js"),{waitUntilExit:l}=o(e.createElement(n,null,e.createElement(i,t)),{stdout:a,stdin:s,exitOnCtrlC:!1});await l()},async runUpload(t,e){let{renderUploadProgress:o}=await import("./CliUploadProgress-OP7DXMC2.js");return await o(t,e)},async onSummary(t){try{let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-5ZN47FAT.js"),{AutoExitSummaryBox:i}=await import("./SummaryBox-FALOODAQ.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-5ZN47FAT.js"),{LinksBox:i}=await import("./LinksBox-PNSESNCU.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})},onAdaptiveHeal(t){p({type:"test_md_adaptive_heal",...t})},onAgentEvent(t){p(t)}}}export{w as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as h,c as j}from"./chunk-VLDCHFXF.js";import{f as m,g as y}from"./chunk-KU3YHPWZ.js";import{q as H}from"./chunk-PUVMC4PX.js";function E(e,t){let n=/^(.*?)(\d+)$/.exec(e),r=/^(.*?)(\d+)$/.exec(t);return n&&r&&n[1]===r[1]?Number(n[2])-Number(r[2]):e<t?-1:e>t?1:0}var R=(e,t)=>e.nameOf.get(t)??t,k=(e,t)=>!e.superseded.has(t);function de(e,t,n=r=>k(e,r)){return e.byLabel(m.SCENARIO).filter(({cid:r})=>n(r)).filter(({cid:r})=>e.edgesFrom(r).some(i=>i.type===y.BELONGS_TO&&e.tipOf(i.dst)===t)).map(({cid:r})=>r)}function ue(e,t,n=R){let r=e.tipOf(t),i=e.getNode(t)?.content??{},d=e.derivesInto(r).filter(o=>!e.superseded.has(o.ecid)),a=[...new Set(d.map(o=>String(o.props?.source_id??"")).filter(Boolean))].sort(),f=a.map(o=>{let p=e.heads.get(o);if(typeof p!="string")return{id:o};let l=e.getNode(p)?.content.blob;return{id:o,media_type:e.mediaOf(p).media_type,...typeof l=="string"?{cid:l}:{}}}),c=d[0],x=new Map;for(let o of d)o.props?.source_id&&o.props?.source_cid&&x.set(String(o.props.source_id),String(o.props.source_cid));let S=a.filter(o=>{let p=e.heads.get(o),l=x.get(o);return p!=null&&l!==void 0&&p!==l}).sort(),b=e.edgesFrom(t).filter(o=>o.type===y.DEPENDS_ON&&!e.superseded.has(o.ecid)).map(o=>q(e,o.dst,n)).filter(o=>o!==null).sort();return{id:n(e,t),title:String(i.title??""),...i.description||i.summary?{description:String(i.description??i.summary)}:{},...Array.isArray(i.actors)&&i.actors.length?{actors:i.actors.map(String)}:{},...i.value?{value:String(i.value)}:{},risk:String(i.risk??""),status:e.trust.get(t)==="trusted"?"approved":"draft",sources:f,...S.length?{stale_sources:S}:{},...b.length?{depends_on:b}:{},...c?{provenance:{derived_from:`${String(c.props?.source_id??"")}#${String(c.props?.anchor??"")}`}}:{}}}function fe(e,t,n=i=>k(e,i),r=R){let i=e.getNode(t)?.content??{},d=e.edgesFrom(t).filter(a=>a.type===y.EXERCISES&&!e.superseded.has(a.ecid)&&n(e.tipOf(a.dst))).map(a=>r(e,e.tipOf(a.dst))).sort();return{id:r(e,t),case_type:String(i.case_type??""),intent:String(i.intent??""),exercises:d}}function pe(e){if(!e.kind&&!e.expected_answer)return{};let t=e.expected_answer??{};return{expected_answer:{...e.kind?{kind:String(e.kind)}:{},statement:String(e.text??""),...t.operator!==void 0?{operator:t.operator}:{},...t.operand!==void 0?{operand:t.operand}:{}}}}function L(e,t,n,r){return t?.find(i=>i.ac_cid&&n?e.tipOf(i.ac_cid)===e.tipOf(n):i.ac_ref===r)?.verdict}function le(e){return e.byLabel(m.GAP).filter(({cid:t})=>k(e,t)&&e.trust.get(t)!=="archived").map(({cid:t,content:n})=>({ref:R(e,t),kind:String(n.kind??""),...n.risk?{risk:String(n.risk)}:{},...n.question?{question:B(n.question)}:{}})).sort((t,n)=>t.ref<n.ref?-1:1)}function B(e){if(typeof e=="string")return e;let t=e?.header;return typeof t=="string"?t:""}function q(e,t,n=R){let r=e.tipOf(t);return e.nodeLabel.get(r)!==m.USECASE||!k(e,r)?null:n(e,r)}var A=Object.freeze({high:1.25,med:1,low:.75,unknown:1}),be=Object.freeze({proven:"proven",partial:"partial",failing:"failing",not_run:"not run",not_designed:"not designed",no_criteria:"no criteria"});function ve(e){return e.usecases.total-e.usecases.not_designed-e.usecases.no_criteria}var we=(e,t)=>{let n=e.getNode(t)?.content;return typeof n?.test_md_blob=="string"&&n.test_md_blob!==""?H(e,n.test_md_blob):typeof n?.definitionId=="string"?n.definitionId:null};function he(e){return t=>e.execHistory(t).filter(n=>!n.drift_flag&&e.tipOf(n.about)===n.about)}function z(e){let t=[],n=0;for(let{cid:r}of e.byLabel(m.USECASE))h(e,r)&&(e.stale(r)==="orphaned"?n++:t.push(r));return{inScope:t,orphaned:n}}function K(e,t){let n=new Map([...t].map(r=>[r,[]]));for(let{cid:r}of e.byLabel(m.AC)){if(!h(e,r))continue;let i=j(e,r);i!==null&&n.get(i)?.push(r)}return n}function J(e){return e==="high"||e==="med"||e==="low"?A[e]:A.unknown}var I=(e,t)=>e.displayNameOf(t)??t;function X(e,t){let n=new Set;for(let r of e.edgesInto(t)){if(r.type!==y.VERIFIES||e.superseded.has(r.ecid))continue;let i=e.tipOf(r.src);h(e,i)&&n.add(i)}return[...n]}function Y(e,t,n,r,i){let d=I(e,n),a=[];for(let f of r)for(let c of t(f))i!==void 0&&!i.has(c.execution_id)||a.push({verdict:String(L(e,c.per_ac,n,d)??c.verdict),at:String(c.started_at),executionId:String(c.execution_id),manual:c.manual===!0,fact:c});return a}var P={failed:3,broken:2,skipped:1,passed:0};function Q(e,t){if(e.at!==t.at)return e.at>t.at;let n=P[e.verdict]??0,r=P[t.verdict]??0;return n!==r?n>r:e.executionId>t.executionId}function $(e){let t;for(let n of e)(t===void 0||Q(n,t))&&(t=n);return t}function Z(e,t){let n=new Map;for(let i of e.derivesInto(t)){if(e.superseded.has(i.ecid))continue;let d=i.props?.source_id,a=i.props?.source_cid;typeof d=="string"&&typeof a=="string"&&n.set(d,a)}let r=[];for(let[i,d]of n){let a=e.heads.get(i);a==null||a===d||e.convChains.get(i)?.chain.includes(d)||r.push(i)}return r}function ee(e){let t=[];for(let[n,r]of e.heads){if(r===null||e.convChains.has(n))continue;let i=e.extractionCompleteness.get(n);(!i||i.completeness!=="complete"||i.source_cid!==r)&&t.push(n)}return t.sort()}function te(e){return e.length===0?"no_criteria":e.some(t=>t!=="not_designed")?e.every(t=>t==="proven")?"proven":e.includes("failing")?"failing":e.includes("proven")?"partial":"not_run":"not_designed"}function Re(e){let{graph:t,runs:n,thisRun:r}=e,{inScope:i,orphaned:d}=z(t),a=K(t,new Set(i)),f={},c=[],x=new Set,S=!1;for(let s of i){let u=I(t,s),N=t.getNode(s)?.content??{},G=String(N.risk??""),_=[],D=new Set,F=!1;for(let g of a.get(s)??[]){let W=I(t,g),T=X(t,g),C=Y(t,n,g,T,r),v=$(C.filter(w=>w.verdict==="passed"||w.verdict==="failed")),V=T.length===0?"not_designed":v===void 0?"not_run":v.verdict==="passed"?"proven":"failing",O=r===void 0?void 0:$(C);v&&(S=!0),O&&(F=!0);for(let w of C)w.manual&&D.add(w.executionId);_.push(V),f[W]={state:V,uc:u,...v?{deciding_run:v.executionId}:{},...O?{this_run:O.verdict}:{}}}let U=Z(t,s);for(let g of U)x.add(g);let M=_.filter(g=>g==="proven").length;c.push({id:u,title:String(N.title??""),risk:G,weight:J(G),state:te(_),pct:_.length===0?0:M/_.length*100,criteria:_.length,proven:M,manual_runs:D.size,stale:U.length>0,...F?{this_run:!0}:{}})}c.sort((s,u)=>E(s.id,u.id));let b=c.reduce((s,u)=>s+u.weight,0),o={total:c.length,proven:0,partial:0,failing:0,not_run:0,not_designed:0,no_criteria:0};for(let s of c)o[s.state]++;let p=Object.keys(f).sort(E),l=s=>f[s].this_run==="passed"||f[s].this_run==="failed"?f[s].this_run:void 0;return{coverage_version:2,scope:r===void 0?"project":"run",config:{rule:"newest_counted_verdict",weighting:e.weighting??"risk",weights:A},pct:b===0?0:c.reduce((s,u)=>s+u.weight*u.pct,0)/b,...r===void 0&&!S?{note:"nothing_run_yet"}:{},usecases:o,criteria:{total:c.reduce((s,u)=>s+u.criteria,0),proven:c.reduce((s,u)=>s+u.proven,0)},perUc:c,perAc:f,flags:{stale_sources:x.size,sources_not_fully_extracted:ee(t),orphaned_usecases:d},...r===void 0?{}:{this_run:{usecases:c.filter(s=>s.this_run).map(s=>s.id),criteria_passed:p.filter(s=>l(s)==="passed"),criteria_failed:p.filter(s=>l(s)==="failed")}}}}export{E as a,de as b,ue as c,fe as d,pe as e,le as f,A as g,be as h,ve as i,we as j,he as k,z as l,K as m,I as n,X as o,Y as p,$ as q,Re as r};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as m}from"./chunk-HCBYKLMW.js";import{a as p,b as f,i as d,k as x}from"./chunk-33DWJV67.js";import{a as b}from"./chunk-6YGTRKDT.js";import{e as u}from"./chunk-UR6MHSHU.js";var n=u(b(),1);var w=u(m(),1),A=40,v=(0,n.createContext)(null);function T({children:r}){let t=(0,n.useRef)({listeners:new Set,frames:{current:0}}).current,{stdout:e}=x();(0,n.useLayoutEffect)(()=>{let l=e.write;return e.write=((...a)=>(t.frames.current+=1,l.apply(e,a))),()=>{e.write=l}},[e,t]);let i=(0,n.useCallback)((l,a)=>{for(let s of[...t.listeners])s.frameAfter!==null&&t.frames.current<=s.frameAfter&&Date.now()-s.drawnAt<A||s.handler.current(l,a)},[t]);return d(i),(0,w.jsx)(v.Provider,{value:t,children:r})}function y(r,t={}){let e=(0,n.useContext)(v),i=t.isActive!==!1;d(r,{isActive:e===null&&i});let l=(0,n.useRef)(r),a=(0,n.useRef)(null);e!==null&&a.current===null&&(a.current=e.frames.current),(0,n.useLayoutEffect)(()=>{l.current=r}),(0,n.useLayoutEffect)(()=>{if(e===null||!i)return;let s={handler:l,frameAfter:t.fromFrame?a.current:null,drawnAt:Date.now()};return e.listeners.add(s),()=>{e.listeners.delete(s)}},[e,i,t.fromFrame])}var o=u(m(),1);function C({value:r,onChange:t,onSubmit:e,onCancel:i,placeholder:l,masked:a}){return y((s,c)=>{if(c.return){e?.(r);return}if(c.escape){i?.();return}if(c.backspace||c.delete){t(r.slice(0,-1));return}c.tab||c.ctrl||c.meta||s&&t(r+s)}),(0,o.jsx)(R,{value:r,placeholder:l,masked:a})}function R({value:r,placeholder:t,masked:e}){let i=e?"\u2022".repeat(r.length):r;return(0,o.jsx)(p,{children:r.length===0&&t?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(f,{inverse:!0,children:" "}),(0,o.jsx)(f,{dimColor:!0,children:t})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(f,{children:i}),(0,o.jsx)(f,{inverse:!0,children:" "})]})})}export{T as a,y as b,C as c,R as d};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{c as K}from"./chunk-XJ7HCXKW.js";import{b as U}from"./chunk-NLZZLANH.js";import{b as W}from"./chunk-FFL55I2M.js";import{a as S}from"./chunk-3QICDXY5.js";import{$,Aa as v,I as C,K as _,L as b,N as E,O as P,Q as p,U as h,Y as f,Z as F,a as j,aa as O,ba as N,ca as A,da as M,ka as y,ma as D,pa as c,qa as I,sa as L,wa as T}from"./chunk-W3OVSDBN.js";import{oa as R}from"./chunk-UEE3RZN4.js";import{a as g}from"./chunk-FOJHSG5M.js";var G={history:"project",search:"project_ready",session:"project_ready"},B={useCases:"use_cases",criteria:"acceptance_criteria",scenarios:"scenarios",tests:"tests",openQuestions:"open_questions",sources:"sources",styleNotes:"style_notes"},V=(e,t)=>t===null||t<=0?null:Math.min(100,Math.floor(e*100/t)),Y=e=>e.startsWith("design-")||e.startsWith("evolve-")?"design":"extract",q=e=>({cmd:`kane-cli context sessions save ${e} --yes --mode agent`,why:"save it to the project"});function de(e,t=Date.now(),s={}){switch(e.kind){case"connect":return e.step==="service"?{type:"remote_connect",step:"connect"}:{type:"remote_connect",step:"open_session",...e.sid!==void 0?{sid:e.sid}:{},...e.project!==void 0?{project:e.project}:{}};case"load":return{type:"remote_load",part:G[e.part],percent:V(e.done,e.total)};case"write":return null;case"retry":return{type:"remote_retry",attempt:e.attempt,next_in_s:e.nextInS,give_up_in_s:Math.max(0,Math.round((Date.parse(e.giveUpAt)-t)/1e3)),cause:e.cause};case"upload":return{type:"remote_upload",file:e.file,percent:V(e.sentBytes,e.totalBytes)};case"reading":return null;case"fetching":return{type:"remote_fetch",ref:e.ref,provider:e.provider};case"paused":{if(e.reason==="ctrl_c")return null;let n=S.command("next.resume_session",{verb:Y(e.sid),sid:e.sid,mode:"agent"});return{type:"session_paused",sid:e.sid,...s.sourceId?{source_id:s.sourceId}:{},...s.mode?{mode:s.mode}:{},reason:e.reason,resume:n,expires_at:null,pending_questions:[],...(e.reason==="connection_lost"||e.reason==="not_accepted")&&n!==null?{next:[{cmd:n,why:"resume"}]}:{}}}case"save":{let n=a=>Object.fromEntries(Object.entries(a).flatMap(([l,d])=>l in B&&typeof d=="number"?[[B[l],d]]:[])),r=e.counts?n(e.counts):void 0,o=e.heldChanges??(e.counts?F(e.counts):0),i=Object.fromEntries(f.flatMap(a=>{let l=e[a]??e.counts?.[a],d=l?n(l):{};return Object.values(d).some(x=>x>0)?[[a,d]]:[]}));return{type:"session_save",phase:e.phase,sid:e.sid,...e.project!==void 0?{project:e.project}:{},...r!==void 0?{adds:r}:{},...e.notUpdated!==void 0&&e.notUpdated.length>0?{not_updated:e.notUpdated}:{},...i,...o>0?{held_changes:o}:{},...e.replaces?{replaces:n(e.replaces)}:{},...e.keeps?{marks_up_to_date:{tests:e.keeps}}:{},...(e.uncounted??e.counts?.uncounted??0)>0?{other_work:!0}:{},...e.landed!==void 0?{saved:e.landed}:{},...(()=>{let a=L(e.testManager,e.sid,e.sessionUseCases?new Set(e.sessionUseCases):void 0,I(e.testFiles));return a?{test_manager:a}:{}})(),...e.testFiles!==void 0?{test_files:T(e.testFiles,e.sid,{testManager:e.testManager})}:{},...e.reason!==void 0?{reason:e.reason}:{},...e.code!==void 0?{code:e.code}:{},...e.stillStale?{next:[{cmd:"kane-cli maintain evolve --from-stale --mode agent",why:"update the use-cases still out of date"}]}:{}}}case"overlap":return{type:"remote_overlap",sessions:e.sessions.map(n=>({sid:n.sid,owner:n.owner,state:n.state,added:n.added,...n.owner!=="someone_else"&&n.state==="paused"?{next:[{cmd:c(n.verb==="design"||n.verb==="evolve"?"design":"extract",n.sid,!0),why:"goes on with that session where it stopped"}]}:{}}))};case"ended":return{type:"session_ended",sid:e.sid,reason:e.reason};case"not_ended":{let n=S.command("next.resume_session",{verb:Y(e.sid),sid:e.sid,mode:"agent"});return{type:"error",code:"SESSION_NOT_ENDED",message:`${v(e.project)} didn't take this session's last step; the work is safe in the session`,...n!==null?{next:[{cmd:n,why:"ends the session, so it can be saved"}]}:{}}}case"finished_before":return{type:"session_complete",sid:e.sid,...s.sourceId?{source_id:s.sourceId}:{},next:[q(e.sid)]}}}function ce(e,t,s={}){return{type:"session_complete",sid:e,...s.sourceId?{source_id:s.sourceId}:{},...s.noStartPage?.length?{no_start_page:s.noStartPage}:{},...t?{next:[q(e),{cmd:`kane-cli context sessions discard ${e} --yes --mode agent`,why:"throw away what this session added"}]}:{}}}var J=e=>e.notUpdated?[`not updated: ${e.notUpdated}`]:[],k={connection_lost:"lost connection",computer_slept:"this computer slept for over 2 minutes",resumed_elsewhere:"resumed in another terminal",not_accepted:"something couldn't be added to this session",ctrl_c:"ctrl+c",model_unavailable:"the model service did not answer",unexpected:"stopped unexpectedly"},w=e=>e.added===0?[]:[e.verb==="extract"?`${e.added} use-case${e.added===1?"":"s"} added, not saved yet`:`${e.added} added, not saved yet`],u=e=>e.credits?[e.credits]:[],m=e=>e.tracePath?{tracePath:e.tracePath}:{};function pe(e){let t=c(e.verb,e.sid,!1),s=e.reason==="resumed_elsewhere"?["this session goes on in the other terminal; your work is safe",...w(e),"to bring it back here, resume it (the other terminal then stops)",...u(e)]:["your work is safe \u2014 resume it from any machine",...w(e),...u(e)];return{state:"paused",reason:k[e.reason],facts:s,resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}function he(e,t){if(e)return{kind:"ingest",refs:e};let s=[...new Set((t?.uploads??[]).filter(r=>r.outcome==="created"&&!r.filename).map(r=>r.sourceId))],n=t?D(t):[];return n.length+s.length>0?{kind:"resumed",files:n,unnamed:s}:{kind:"extract"}}var H=e=>`discard: kane-cli context sessions discard ${e}`;function fe(e){let t=e.again,s=t.kind==="extract"?[H(e.sid),"then start again: kane-cli context extract"]:["start again with the same sources:",...t.kind==="ingest"?[` ${y(t.refs)}`]:t.files.length>0?[` ${y(t.files)}`]:[],...t.kind==="resumed"?t.unnamed.map(n=>` ${g.dim(`${t.files.length>0?"and ":""}the source "${n}", added again by its address`)}`):[],H(e.sid)];return{state:"paused",reason:e.reason==="held_back"?"the duplicate check couldn't run fully":k[e.reason],facts:[`this session read ${e.sources} sources, so it can't be resumed or saved`,...e.added>0?[`its ${e.added} use-case${e.added===1?"":"s"} won't reach the project`]:[],...s,...u(e)],...m(e)}}function ye(e,t){let s={cmd:`kane-cli context sessions discard ${e} --yes --mode agent`,why:"throw away this session"};if(t.kind==="extract")return{next:[s,{cmd:"kane-cli context extract --mode agent",why:"start again"}]};let n=t.kind==="ingest"?t.refs:t.files;return{next:[...n.length>0?[{cmd:`${y(n)} --mode agent`,why:"start again"}]:[],s],...t.kind==="resumed"&&t.unnamed.length>0?{not_named:[...t.unnamed]}:{}}}var ve=e=>e.filter(t=>t.kind==="header"&&t.source!==void 0).length;function xe(e){let t=c(e.verb,e.sid,!1);return{state:"paused",reason:"the duplicate check couldn't run fully",facts:[e.added>0?"what was added is safe \u2014 resume it from any machine":"nothing was added yet \u2014 resume it from any machine",...w(e),`${e.held} use-case${e.held===1?"":"s"} held back, not added`,...u(e)],resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}var X=e=>e.verb==="evolve"&&e.replaces?`designing its ${e.replaces===1?"test":`${e.replaces} tests`} again didn't finish`:"designing its tests didn't finish";function Se(e){let t=c("extract",e.sid,!1),s=a=>a===1?"1 change":`${a} changes`,n=[...(e.replaced?.scenarios??0)>0?[e.replaced.scenarios===1?"1 scenario":`${e.replaced.scenarios} scenarios`]:[],...(e.replaced?.tests??0)>0?[e.replaced.tests===1?"1 test":`${e.replaced.tests} tests`]:[]],r=n.length>0?`, ${n.join(" and ")} replaced`:"",o=[e.decided>0?"what you decided is safe \u2014 resume it from any machine":"nothing was decided yet \u2014 resume it from any machine",...e.approved>0?[`${s(e.approved)} approved${r}, not saved yet`]:[],...e.unfinished?[X(e.unfinished)]:[],...e.left>0?[`${s(e.left)} not reviewed yet`]:[],...u(e)];return{state:"paused",reason:e.unfinished||e.left===0?k[e.why??"ctrl_c"]:`${s(e.left)} from ${W(e.source)} ${e.left===1?"isn't":"aren't"} reviewed yet`,facts:o,resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}function _e(e){let[t,...s]=e.how==="saved"?["saved from another terminal",`saved to "${e.projectName}" from another terminal`]:e.how==="discarded"?["discarded from another terminal",`discarded from another terminal \u2014 nothing was saved to "${e.projectName}"`]:["ended in another terminal","this session ended in another terminal, so it stops here","to see your sessions, run: kane-cli context sessions"];return{state:"complete",reason:t,facts:[...s,...u(e)],...m(e)}}function Q(e){let t=[e.adds,e.heldChanges?A(e.heldChanges):""].filter(Boolean);return t.length>0?C(t):$({...e,adds:e.adds})?h:p}function be(e,t){let n=`${e===h||e===p||e.startsWith("1 ")&&!e.includes(", ")&&!e.includes(" and ")?"it's":"they're"} thrown away`;return t===void 0?`${n}, and this can't be undone`:`${n}; nothing reaches "${t}", and this can't be undone`}function $e(e){let{heldChanges:t,chatTurns:s,uncounted:n}=e;return{heldChanges:t,chatTurns:s,uncounted:n,...Object.fromEntries(f.map(r=>[r,e[r]])),...e.replaces?{replaces:e.replaces}:{},...e.keeps?{keeps:e.keeps}:{}}}function we(e){return{state:"complete",reason:"not saved yet",facts:[`not saved yet: ${e.changed??Q(e)}`,...e.changed?[]:b(e),...J(e),...e.needed??[],"kept as it is until you save or discard it",`save: kane-cli context sessions save ${e.sid}`,`discard: kane-cli context sessions discard ${e.sid}`,...u(e)],...m(e)}}function ke(e){return{state:"complete",reason:"not saved yet",facts:[`not saved yet: ${Q(e)}`,...b(e),`${v(e.projectName)} didn't take this session's last step; your work is safe`,`save: ${c(e.verb,e.sid,!1)}`,...u(e)],...m(e)}}var z=(e,t)=>e||($({...t,adds:e})?h:O({...t,adds:e})?p:"");function Re(e){let t=z(e.adds,e);return{state:"complete",reason:"saved",facts:[`saved to "${e.projectName}"${t?`: ${t}`:""}`,..._(e),...e.heldChanges?[M(e.heldChanges)]:[],...J(e),...e.testManager?[e.testManager]:[],...e.testManagerNextRun?[e.testManagerNextRun]:[],...e.testFiles?[e.testFiles]:[],...e.testFilesKept?[e.testFilesKept]:[],...e.testFilesReplaced?[e.testFilesReplaced]:[],...e.testFilesNeeded??[],...u(e)],...m(e)}}var je=e=>_(e);function Ce(e,t,s={}){let n=z(t,s);return`\u2714 saved to "${e}"${n?` \u2014 ${n}`:""}`}function Ee(e,t){return e?.facts.find(s=>s.startsWith("credits used:"))??(t?`credits used: ${t.total.toFixed(1)}`:null)}var Z=4;function ee(e,t){let s=e.map(r=>({sid:r.sessionId,verb:r.verb,subject:r.useCase??r.sourceId,title:(r.useCase?r.useCaseTitle:r.sourceTitle)??null,state:j(r),added:null,last_activity_at:r.lastActivityAt??r.createdAt,owner:K(r,t)})),n=r=>Date.parse(r.last_activity_at??"")||0;return s.sort((r,o)=>+(o.owner==="you")-+(r.owner==="you")||n(o)-n(r))}var te={reconcile:"review"},se={ready_to_save:"ready to save",paused:"paused",running:"running",saved:"saved",discarded:"discarded",failed:"ended with an error"};function ne(e,t){let s=Date.parse(e??"");if(Number.isNaN(s))return"";let n=Math.floor((t-s)/6e4);if(n<1)return"just now";if(n<60)return`${n} min ago`;let r=new Date(s),o=a=>a.toDateString(),i=`${String(r.getHours()).padStart(2,"0")}:${String(r.getMinutes()).padStart(2,"0")}`;return o(r)===o(new Date(t))?`${Math.floor(n/60)} h ago`:o(r)===o(new Date(t-864e5))?`yesterday ${i}`:`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")} ${i}`}function re(e,t){return e.length===0?["no open sessions"]:e.flatMap(s=>{let n=s.title?`"${s.title}"`:s.subject&&R(s.subject),r=[...s.added?[`${s.added} added`]:[],...s.updated?[`${s.updated} updated`]:[]],o=[te[s.verb]??s.verb,...n?[n]:[],se[s.state],...r,ne(s.last_activity_at,t),...s.owner==="someone_else"?["someone else"]:[]],i=`${s.sid} ${o.filter(Boolean).join(" \xB7 ")}`;return s.owner==="someone_else"?[i]:s.state==="ready_to_save"?[i,g.dim(` save: kane-cli context sessions save ${s.sid}`)]:s.state==="paused"?[i,g.dim(` resume: ${c(s.verb==="design"||s.verb==="evolve"?"design":"extract",s.sid,!1)}`)]:[i]})}async function Ie(e){let t=await e.person.listSessions(e.projectId),s=await ae(e.person,e.projectId,ee(t,e.me).filter(n=>n.state!=="saved"&&n.state!=="discarded"),e.log??(()=>{}));return e.out(e.json?JSON.stringify(s)+`
|
|
3
|
+
`:re(s,Date.now()).join(`
|
|
4
|
+
`)+`
|
|
5
|
+
`),0}async function ae(e,t,s,n){let r=s.map(a=>({...a})),o=0,i=async()=>{for(let a=o++;a<r.length;a=o++){let l=r[a].sid,d=await N(e,t,l).catch(x=>(n(`${l}'s count couldn't be read: ${U(x)}`),null));r[a].added=d?P(d):null,d&&(r[a].updated=E(d))}};return await Promise.all(Array.from({length:Math.min(Z,r.length)},i)),r}export{de as a,ce as b,pe as c,he as d,fe as e,ye as f,ve as g,xe as h,Se as i,_e as j,Q as k,be as l,$e as m,we as n,ke as o,Re as p,je as q,Ce as r,Ee as s,se as t,ne as u,Ie as v};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as m}from"./chunk-XZYA7DNH.js";import{e as y}from"./chunk-6NFOH4AC.js";import{b as d}from"./chunk-MGNRNLBE.js";function g(t={}){let a=t.readStore??C,s=t.readLis??w;return{async controller(){let e=await a();return{token:e.token,...e.basic?{basic:e.basic}:{}}},async lis(){return s()}}}var A=()=>C(!0),_=g(),P=8e3;function f(){return y("warn: session auth may expire during long runs \u2014 if that happens, run `kane-cli login` and retry","AUTH_EXCHANGE_FAILED"),null}async function h(t,a,s=!1){try{let[{getEnvironment:e},{ControllerClient:r}]=await Promise.all([import("./config-5ZOALGKE.js"),import("./controller-client-PB3AZAGG.js")]),o=new r(e(t).controllerBaseUrl,a),i;try{let n=await Promise.race([o.getTmsCredentials().catch(()=>null),new Promise(c=>{i=setTimeout(()=>c(null),P)})]);if(typeof n?.username!="string"||!n.username||typeof n.access_key!="string"||!n.access_key)return s?null:f();try{let[{refreshIdentitySnapshot:c},{telemetryEnvName:u}]=await Promise.all([import("./identity-HL5CJJXR.js"),import("./bootstrap-TY5RANJ7.js")]);await c(u(),n)}catch{}return{username:n.username,accessKey:n.access_key}}finally{clearTimeout(i)}}catch{return s?null:f()}}var l=null;function E(t){l=t===null?null:{username:t.username,accessKey:t.accessKey}}async function C(t=!1){if(l!==null)return{token:null,basic:{...l}};let[{CredentialsManager:a},{refreshOAuthToken:s}]=await Promise.all([import("./credentials-MRG452Y6.js"),import("./token-refresh-4UCYAG6A.js")]),e=new a,r=d(),o=e.getActiveProfile()??"default",i=e.loadBasicAuth(o,r);if(i)return{token:null,basic:{username:i.username,accessKey:i.access_key}};let n=e.loadCredentials(o,r);if(!n)throw new m("Not authenticated \u2014 no credentials found","not_authenticated");try{await s({creds:e,profile:o,env:r,credentials:n})}catch{}let c=e.loadCredentials(o,r)??n;if(typeof c.access_token!="string")throw new m("Not authenticated \u2014 no credentials found","not_authenticated");let u=c.access_token,p=await h(r,u,t);return{token:u,...p?{basic:p}:{}}}async function w(){if(l!==null)return{basic:Buffer.from(`${l.username}:${l.accessKey}`,"utf8").toString("base64")};let{CredentialsManager:t}=await import("./credentials-MRG452Y6.js"),a=new t,s=d(),e=a.loadCredentials(a.getActiveProfile()??"default",s);if(typeof e?.access_token!="string")return{};let r=await h(s,e.access_token,!0);return r?{basic:Buffer.from(`${r.username}:${r.accessKey}`,"utf8").toString("base64")}:{}}export{A as a,_ as b,E as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as f}from"./chunk-RZ4F3BHX.js";import{f as g}from"./chunk-A7RJQJNT.js";import{openAsBlob as A}from"fs";import{basename as b}from"path";var c={emulator:{product:"app-testing",type:"emulator",source:"web-client"},simulator:{product:"app-testing",type:"simulator",source:"web-client"},android:{product:"app-testing",type:"android",source:"web-client"},ios:{product:"app-testing",type:"ios",source:"web-client"}},m={emulator:"application/vnd.android.package-archive",simulator:"application/zip",android:"application/vnd.android.package-archive",ios:"application/zip"},k=30*6e4,u=3e4;function _(n){let t=n??{},e=Array.isArray(t.data)?t.data:[],r=[];for(let a of e){let i=a??{},d=typeof i.app_id=="string"?i.app_id:void 0;d&&r.push({appId:d,name:typeof i.name=="string"&&i.name.trim()!==""?i.name:d,...typeof i.package=="string"?{packageName:i.package}:{},...typeof i.updated_at=="string"?{updatedAt:i.updated_at}:{}})}let s=t.metaData??{},o=typeof s.total=="number"?s.total:typeof s.total=="string"&&Number.isFinite(Number(s.total))?Number(s.total):r.length;return{apps:r,total:o}}function $(){return{fileBody:n=>A(n),request:f}}function R(n){if(!n||typeof n!="object")return null;let t=n,e=typeof t.app_id=="string"?t.app_id:void 0;return e?{appId:e,...typeof t.app_url=="string"?{appUrl:t.app_url}:{},...typeof t.url=="string"?{url:t.url}:{},cached:t.cached===!0,...typeof t.name=="string"?{name:t.name}:{}}:null}function T(n){if(!n||typeof n!="object")return null;let t=n,e=typeof t.app_id=="string"?t.app_id:void 0,r=typeof t.download_url=="string"&&t.download_url!==""?t.download_url:void 0;if(!e||!r)return null;let s=typeof t.app_name=="string"&&t.app_name.trim()!==""?t.app_name:`${e}.bin`;return{appId:e,name:s,url:r,...typeof t.package=="string"?{packageName:t.package}:{},...typeof t.type=="string"?{type:t.type}:{}}}function U(n){if(!n||typeof n!="object")return null;let t=n,e=typeof t.app_id=="string"?t.app_id:void 0,r=a=>typeof t[a]=="string"&&t[a]!==""?t[a]:void 0,s=r("cf_url")??r("cf_ap_url")??r("url");if(!e||!s)return null;let o=typeof t.name=="string"&&t.name.trim()!==""?t.name:`${e}.bin`;return{appId:e,name:o,url:s,...typeof t.package=="string"?{packageName:t.package}:{},...typeof t.type=="string"?{type:t.type}:{}}}function S(n){let t=n?.cause,e=t instanceof Error?t.message:typeof t=="string"?t:void 0,r=n instanceof Error?n.message:String(n);return e&&e!==r?`${r} (${e})`:r}var p=class extends Error{constructor(e,r){super(e);this.status=r;this.name="AppUploadError"}};async function l(n){let t=await n.text();try{let e=JSON.parse(t);return e.message??e.error??t}catch{return t||`app service returned ${n.status}`}}var h=20,y=100,w=class{constructor(t,e,r={}){this.baseUrl=t;this.auth=e;this.deps={...$(),...r}}deps;headers(){return{Authorization:`Basic ${Buffer.from(`${this.auth.username}:${this.auth.accessKey}`).toString("base64")}`,Accept:"application/json"}}async upload(t,e,r={}){let s=b(t);if(!this.auth.orgId||!Number.isFinite(Number(this.auth.orgId)))throw new p(`Could not register ${s}: this account's org id is required to record an upload.`);let o=await this.uploadTarget(s,e);r.onProgress?.(`uploading ${s}\u2026`);let a=await this.deps.request(o.uploadUrl,{method:"PUT",headers:{"Content-Type":m[e]},body:await this.deps.fileBody(t),signal:r.signal??AbortSignal.timeout(k)});if(!a.ok)throw new p(`Uploading ${s} failed: ${a.status} ${await a.text()}`,a.status);let i=o.uploadUrl.split("?")[0];return this.register(s,e,i)}async uploadTarget(t,e){let r=c[e],s=new URLSearchParams({key:t,contentType:m[e],product:r.product}),o=await this.deps.request(`${this.baseUrl}/app/get-upload-url?${s.toString()}`,{method:"GET",headers:this.headers(),signal:AbortSignal.timeout(u)});if(!o.ok)throw new p(`Could not start the upload of ${t}: ${await l(o)}`,o.status);let a=await o.json();if(!a.uploadURL)throw new p(`Could not start the upload of ${t}: no upload url.`);return{key:a.Key??"",uploadUrl:a.uploadURL}}async register(t,e,r){let s=Number(this.auth.orgId),o=c[e],a=await this.deps.request(`${this.baseUrl}/app/url`,{method:"POST",headers:{...this.headers(),"Content-Type":"application/json"},body:JSON.stringify({name:t,source:o.source,type:o.type,org_id:s,url:r,product:o.product}),signal:AbortSignal.timeout(u)});if(!a.ok)throw new p(`Could not register ${t}: ${await l(a)}`,a.status);let i=R(await a.json());if(!i)throw new p(`Registering ${t} returned no app id.`);return i}async list(t){let e=t.limit??h;e<=0&&(e=h),e>y&&(e=y);let r=t.offset!==void 0&&t.offset>0?t.offset:0,s=new URLSearchParams({limit:String(e),offset:String(r),type:c[t.type].type,level:g(t.type)?"org":"user",searchtxt:t.search??""}),o=`${this.baseUrl}/app/list?${s.toString()}`,a;try{a=await this.deps.request(o,{method:"GET",headers:this.headers(),signal:AbortSignal.timeout(u)})}catch(i){throw new p(S(i))}if(!a.ok)throw new p(`Could not list your uploads: ${await l(a)}`,a.status);return _(await a.json())}async details(t){let e=await this.deps.request(`${this.baseUrl}/app/${encodeURIComponent(t)}/download?format=url`,{method:"GET",headers:this.headers(),signal:AbortSignal.timeout(u)});if(e.ok){let o=T(await e.json());if(o)return o}else if(e.status!==404)throw new p(`${t}: ${await l(e)}`,e.status);let r=await this.deps.request(`${this.baseUrl}/app/${encodeURIComponent(t)}/url`,{method:"GET",headers:this.headers(),signal:AbortSignal.timeout(u)});if(!r.ok)throw new p(`${t}: ${await l(r)}`,r.status);let s=U(await r.json());if(!s)throw new p(`${t} returned no download url.`);return s}async liveness(t){try{return await this.details(t),"alive"}catch(e){let r=e instanceof p?e.status:void 0;return r!==void 0&&r>=400&&r<500?"gone":"unknown"}}};export{m as a,_ as b,R as c,T as d,U as e,S as f,p as g,w as h};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as o,e as p}from"./chunk-XMPTFXPW.js";import{a as m}from"./chunk-RPRXRKKR.js";import{d,f as c}from"./chunk-NWBLYMH7.js";import{Ia as a}from"./chunk-UEE3RZN4.js";import{resolve as l}from"path";async function g(s,w,t={}){let r=c({verb:s,mode:"cli",contextRoot:l(process.cwd(),".context"),env:d(),write:t.write,sessionId:m()}),n=()=>{o(t.mode??"")!=="ndjson"&&process.stderr.write(r.supportFooter()+`
|
|
3
|
+
`)};try{let e=await w(r);return t.write&&e===0&&await r.lateBindContext(l(process.cwd(),".context")),e===1&&n(),await r.end({exit_code:e}),e}catch(e){if(e instanceof a){if(o(t.mode??"")==="ndjson"){let i=p("ndjson",t.streamVerb??s,{stdout:y=>process.stdout.write(y),stderr:()=>{}});i.event({type:"sync_error",code:e.code,detail:e.message,remedy:e.remedy}),i.done(2,"refused")}else process.stderr.write(`error: ${e.message}
|
|
4
|
+
next: ${e.remedy}
|
|
5
|
+
`);return r.error("rebase_open"),await r.end({exit_code:2}),2}throw r.error("cli_crash"),n(),await r.end({exit_code:1}),e}}export{g as a};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{l as E}from"./chunk-NC7D7GOM.js";import{a as x}from"./chunk-RZ4F3BHX.js";import{k as _,l as A}from"./chunk-I6OQISK4.js";import{spawn as S,spawnSync as T}from"child_process";import{existsSync as y,mkdirSync as I,readFileSync as M,writeFileSync as v}from"fs";import{createConnection as G}from"net";import{homedir as m,platform as h}from"os";import{join as i}from"path";var H=new Set(["1","true","yes"]),f=class extends Error{constructor(o){super(o),this.name="ChromeNotFoundError"}};function ie(e){return e instanceof f?e.message:`Chrome failed: ${e instanceof Error?e.message:String(e)}`}var w={darwin:["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",i(m(),"Applications/Google Chrome.app/Contents/MacOS/Google Chrome"),"/Applications/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing",i(m(),"Applications/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing"),"/Applications/Chromium.app/Contents/MacOS/Chromium"],linux:["/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/usr/bin/google-chrome-for-testing","/usr/local/bin/google-chrome-for-testing",i(m(),"chrome-for-testing/chrome-linux64/chrome"),"/usr/bin/chromium","/usr/bin/chromium-browser","/snap/bin/chromium"],win32:["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",i(m(),"AppData\\Local\\Google\\Chrome\\Application\\chrome.exe"),"C:\\chrome-for-testing\\chrome-win64\\chrome.exe",i(m(),"AppData\\Local\\chrome-for-testing\\chrome-win64\\chrome.exe"),i(m(),"AppData\\Local\\kane-chrome\\chrome.exe")]};function L(){let e=process.env.KANE_CLI_CHROME_PATH?.trim();return e||void 0}function N(){let e=L();if(e)return e;let o=h(),r=w[o]??w.linux;for(let t of r)if(y(t))return t;return o==="win32"?"chrome.exe":"google-chrome"}function $(){let e=L();if(e)return y(e);let o=h();if((w[o]??w.linux).some(s=>y(s)))return!0;let t=o==="win32"?"chrome.exe":"google-chrome",n=o==="win32"?"where":"which";try{return T(n,[t],{stdio:"ignore"}).status===0}catch{return!1}}function F(){let e=h();return e==="darwin"?["Google Chrome is required but was not found at any standard path.","","Install via Homebrew (recommended):"," brew install --cask google-chrome","","Or download:"," https://www.google.com/chrome/","","Then re-run your command. Set KANE_CLI_CHROME_PATH=/path/to/chrome","to point at a non-standard install."].join(`
|
|
3
|
+
`):e==="linux"?["Google Chrome is required but was not found at /usr/bin/google-chrome.","(amd64 / x86_64 only \u2014 Google does not ship Chrome for Linux ARM.)","","Debian / Ubuntu (any version):"," wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"," sudo apt install -y ./google-chrome-stable_current_amd64.deb","","Fedora / RHEL / AlmaLinux / Rocky:"," sudo dnf install -y https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm","","Then re-run your command. Set KANE_CLI_CHROME_PATH=/path/to/chrome","to point at a non-standard install."].join(`
|
|
4
|
+
`):e==="win32"?["Google Chrome is required but was not found in Program Files or AppData.","","Install via winget (Windows 10 1809+):"," winget install --id Google.Chrome -e --silent","","Or download:"," https://www.google.com/chrome/","","Then re-run your command. Set KANE_CLI_CHROME_PATH=C:\\path\\to\\chrome.exe","to point at a non-standard install."].join(`
|
|
5
|
+
`):["Google Chrome is required.","Install from https://www.google.com/chrome/","(Note: no official Chrome builds for BSD or Alpine/musl Linux.)"].join(`
|
|
6
|
+
`)}var K=["DownloadBubble","DownloadBubbleV2","PasswordLeakDetection"],U={credentials_enable_service:!1,profile:{password_manager_enabled:!1,password_manager_leak_detection:!1}};function O(e,o){let r={...e};for(let[t,n]of Object.entries(o)){let s=r[t];n&&typeof n=="object"&&!Array.isArray(n)&&s&&typeof s=="object"&&!Array.isArray(s)?r[t]=O(s,n):r[t]=n}return r}function j(e){try{let o=i(e,"Default"),r=i(o,"Preferences"),t={},n=null;try{n=M(r,"utf8")}catch{n=null}if(n!==null){let s=JSON.parse(n);if(!s||typeof s!="object"||Array.isArray(s))return;t=s}I(o,{recursive:!0}),v(r,JSON.stringify(O(t,U)))}catch{}}function B(e){let o=h(),r=[`--remote-debugging-port=${e.port}`,`--user-data-dir=${e.userDataDir}`,`--window-size=${e.width},${e.height}`,"--no-first-run","--no-default-browser-check","--disable-blink-features=AutomationControlled",`--disable-features=${K.join(",")}`,"--safebrowsing-disable-download-protection","--disable-popup-blocking","--disable-notifications","--disable-infobars","--disable-translate","--disable-prompt-on-repost","--disable-background-networking","--disable-client-side-phishing-detection","--disable-default-apps","--disable-hang-monitor","--disable-sync","--metrics-recording-only","--safebrowsing-disable-auto-update","--disable-backgrounding-occluded-windows","--disable-background-timer-throttling","--test-type=webdriver","--allow-pre-commit-input","--enable-logging","--v=1"];return o==="linux"&&(r.push("--no-sandbox"),r.push("--disable-dev-shm-usage"),r.push("--password-store=basic")),o==="darwin"&&r.push("--use-mock-keychain"),e.headless&&r.push("--headless=new"),r}function q(e){return new Promise(o=>{let r=G({port:e,host:"127.0.0.1"});r.setTimeout(1e3),r.on("connect",()=>{r.destroy(),o(!0)}),r.on("timeout",()=>{r.destroy(),o(!1)}),r.on("error",()=>{r.destroy(),o(!1)})})}async function W(){for(let e=_;e<=A;e++)if(!await q(e))return e;throw new Error(`All CDP ports ${_}-${A} are in use. Close other Chrome instances.`)}var d=class extends Error{constructor(o){super(o),this.name="CdpReadinessError"}};async function J(e,o){let r=Date.now(),t=`http://127.0.0.1:${e}/json/version`;for(;Date.now()-r<o;){try{if((await x(t)).ok)return`http://127.0.0.1:${e}`}catch{}await new Promise(n=>setTimeout(n,200))}throw new d(`Chrome CDP not ready after ${o}ms on port ${e}`)}var Y=3e4,z=2;function R(e,o,r){let t=process.env[e];if(t==null||t.trim()==="")return o;let n=Number(t);return!Number.isInteger(n)||n<r?o:n}function V(e){return Math.min(500*e,3e3)}function D(e,o){try{if(e.pid)if(o==="win32")S("taskkill",["/pid",String(e.pid),"/T","/F"],{stdio:"ignore"});else try{process.kill(-e.pid,"SIGKILL")}catch{e.kill("SIGKILL")}else e.kill("SIGKILL")}catch{}}async function ae(e){let o=process.env.KANE_CLI_SKIP_BROWSER_DOWNLOAD;if(!(o!=null&&H.has(o.toLowerCase()))&&!$())throw E()?.log("error","CHROME_NOT_FOUND","Startup gate: Chrome unavailable at standard system paths",{platform:process.platform,kane_cli_chrome_path:process.env.KANE_CLI_CHROME_PATH??null,skip_browser_download:process.env.KANE_CLI_SKIP_BROWSER_DOWNLOAD??null}),new f(F());let t=h(),n=N(),s=R("KANE_CLI_CDP_TIMEOUT_MS",Y,1),g=R("KANE_CLI_CDP_RETRIES",z,0)+1,k;for(let a=1;a<=g;a++){let p=await W();j(e.userDataDir);let P=B({port:p,...e});e.startUrl&&P.push(e.startUrl);let c=S(n,P,{stdio:"ignore",detached:!0});c.unref();try{let l=await new Promise((b,C)=>{c.on("error",u=>{C(new Error(`Failed to launch Chrome: ${u.message}. Is Chrome installed at ${n}?`))}),c.on("close",u=>{u!==null&&u!==0&&C(new d(`Chrome exited during startup with code ${u}`))}),J(p,s).then(b,C)});return{process:c,port:p,cdpEndpoint:l,kill(){D(c,t)}}}catch(l){if(k=l,!(l instanceof d))throw l;D(c,t),E()?.log("warn","CHROME_CDP_LAUNCH_RETRY",`Chrome CDP launch attempt ${a}/${g} failed`,{attempt:a,max_attempts:g,port:p,timeout_ms:s,headless:e.headless??!1,error:l.message}),a<g&&await new Promise(b=>setTimeout(b,V(a)))}}throw k??new Error("Chrome launch failed after retries")}export{f as a,ie as b,N as c,$ as d,ae as e};
|
|
@@ -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-OVNRRI4E.js";import{a as A}from"./chunk-HCBYKLMW.js";import{a as c,b as f,i as P}from"./chunk-33DWJV67.js";import{a as B}from"./chunk-6YGTRKDT.js";import{y as l}from"./chunk-I6OQISK4.js";import{e as x}from"./chunk-UR6MHSHU.js";var L=x(B(),1);var n=x(A(),1);function S(r,d,s,u,m){let p=s==="basic"&&u?`basic (${u})`:s,i=20,a=`${r} [${d}]`,g="\xB7".repeat(Math.max(2,i-a.length+3));return{label:`${a} ${g} ${p}`,profile:r,env:d,isActive:m}}function M({creds:r,onSwitch:d,onCancel:s}){let u=r.listProfiles(),m=r.getActiveProfile(),p=r.getDefaultEnv(),i=u.map(e=>{let o=r.loadBasicAuth(e.profile,e.env),t=r.loadCredentials(e.profile,e.env)!==null,v=o?"basic":t?"oauth":"none",b=o?o.username:null,w=e.profile===m&&e.env===p;return S(e.profile,e.env,v,b,w)}),[a,g]=(0,L.useState)(()=>{let e=i.findIndex(o=>o.isActive);return e>=0?e:0});return P((e,o)=>{if(o.escape){s();return}if(o.upArrow){g(t=>Math.max(0,t-1));return}if(o.downArrow){g(t=>Math.min(i.length-1,t+1));return}if(o.return&&i[a]){let t=i[a];t.isActive||d(t.profile,t.env),s();return}}),i.length===0?(0,n.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:l.orange,paddingX:2,paddingY:1,children:[(0,n.jsx)(f,{color:l.orange,bold:!0,children:"Profiles"}),(0,n.jsx)(c,{marginTop:1,children:(0,n.jsx)(f,{color:l.dim,children:"No profiles \u2014 use Login to create one"})}),(0,n.jsx)(h,{bindings:[],escBackLabel:"back"})]}):(0,n.jsxs)(c,{flexDirection:"column",borderStyle:"round",borderColor:l.orange,paddingX:2,paddingY:1,children:[(0,n.jsx)(f,{color:l.orange,bold:!0,children:"Profiles"}),(0,n.jsx)(c,{flexDirection:"column",marginTop:1,children:i.map((e,o)=>{let t=o===a,v=t?"\u276F ":" ",b=e.isActive?l.green:t?l.orange:void 0;return(0,n.jsxs)(f,{color:b,children:[v,e.label,e.isActive?" \u25CF active":""]},`${e.profile}-${e.env}`)})}),(0,n.jsx)(h,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"switch"}],escBackLabel:"back"})]})}export{S as a,M as b};
|
|
@@ -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-OVNRRI4E.js";import{a as L}from"./chunk-HCBYKLMW.js";import{a as d,b as c,i as A}from"./chunk-33DWJV67.js";import{a as D}from"./chunk-6YGTRKDT.js";import{m as u,y as o}from"./chunk-I6OQISK4.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(u).map(i=>{let e=P(u,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(u,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(u,{recursive:!0}),I(!0),g("");return}let t=s[a-1];t&&!t.isActive&&l(t.path),f();return}}),T?(0,r.jsxs)(d,{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)(d,{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)(d,{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)(d,{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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as j}from"./chunk-HJLMH7ZM.js";import{b as g,d as C,e as q,f as I}from"./chunk-IZ65ZPWY.js";import{a as V}from"./chunk-EF47KRUK.js";import{B as k,F as S,M as R,ea as h,fa as P,v as b}from"./chunk-UEE3RZN4.js";import{m as v}from"./chunk-4I7YN6YY.js";function M(t,e,s,p=g()){return{store:t,rootSid:e,locks:t.locks(e),probe:s??j(t,{...p.calls(()=>({})),readVector:(i,u,n)=>C(t,i,u,n),writeVector:(i,u,n,r)=>q(t,i,u,n,r),prefetchVectors:(i,u,n)=>I(t,i,u,n)})}}var O=new WeakMap;function B(t){let e=O.get(t);return e||O.set(t,e=g()),e}var Y=new Set(["archive"]);async function U(t,e,s,p){let i=R(t.store);if(s.v==="defer")return{outcome:"deferred"};if(e.kind==="MODIFY_HELD"){if(!e.heldPayload)return{outcome:"failed",detail:`${e.ref} carries no held payload`};let r=e.heldPayload;if(s.v==="keep_current"){if(!r.event_id)return{outcome:"failed",detail:v().text("note.held_no_event_id",{sid:r.sid})};let{commitChatTurn:o}=await import("./chat-committer-ZCSRJEUB.js"),m=o({store:t.store,graph:i,ops:[{kind:"resolve_question",questionId:`drop-held:${r.sid}:${r.tempRef}`,resolution:"deferred",eventId:r.event_id}],by:p});return m.errors?{outcome:"failed",detail:m.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"held-dropped"}),{outcome:"committed",detail:"held payload dropped (recorded) \u2014 the owner's resume will not re-present it"})}if(s.v==="approve"){let o=r.content._held??null;if(!o?.source_id||!o.source_cid||!o.anchor||!o.quote)return{outcome:"failed",detail:v().text("note.held_no_provenance",{sid:r.sid})};{let a=i.mediaOf(o.source_cid),f=b(t.store,i,o.source_cid),w=a.format==="image"?null:f?k(f):null;if(a.format!=="image"&&w===null)return{outcome:"failed",detail:v().text("note.held_no_citable_text",{sid:r.sid,source_id:o.source_id,source_cid:o.source_cid})};let $=S(a,{anchor:o.anchor,quote:o.quote},w);if($.length>0)return{outcome:"failed",detail:v().text("note.held_unverified",{sid:r.sid,errors:$.map(y=>`${y.code}: ${y.detail}`).join("; ")})}}let{commitProposal:m}=await import("./committer-JGY66PFM.js"),{_held:d,...c}=r.content,D={version:1,read_basis:i.latestHash,source:{source_id:o.source_id,source_cid:o.source_cid},use_cases:[{temp_ref:r.tempRef,title:String(c.title??r.tempRef),...c.summary!==void 0?{summary:c.summary}:{},risk:String(c.risk??"med"),cite:{anchor:o.anchor,quote:o.quote},depends_on_hint:[],matches_existing:null}]},l=await V(M(t.store,t.rootSid??`review-${process.pid}`,void 0,B(t)),{verb:"maintain",ucTargets:[],newBuCandidates:[{tempRef:r.tempRef,title:String(c.title??r.tempRef),probeText:`${String(c.title??"")} ${String(c.summary??"")}`.trim()}],sourcePins:[{source_id:o.source_id,source_cid:o.source_cid}],readBasis:i.latestHash,...r.event_id?{eventIds:[r.event_id]}:{}},a=>{let f=m({store:t.store,graph:a.graph,scope:a.scope,proposal:D,proposalId:null,verdicts:new Map([[r.tempRef,{resolution:"skipped"}]]),by:p,autoName:!0,allowStaleBasis:!0,eventIds:r.event_id?[r.event_id]:a.eventIds("maintain",1),sid:a.sid,probeHits:a.probeHits});return f.errors!==null?{errors:f.errors}:{result:f,record:f.record}}),_=l.ok&&"result"in l?l.result:{record:null,errors:l.ok?null:l.kind==="validation"?l.errors:[{code:l.kind==="contended"?l.err.code:"UNSETTLED",detail:l.kind==="contended"?`held by ${l.err.holder?.owner_sid??"another session"}`:"concurrent activity kept moving the store"}]};return _.errors?{outcome:"failed",detail:_.errors.map(a=>`${a.code}: ${a.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"held-applied"}),{outcome:"committed",detail:`held payload committed (derived) by ${p.id}`})}return{outcome:"failed",detail:`verdict ${s.v} does not apply to a MODIFY_HELD card`}}let u=i.resolve(e.ref);if(!u)return{outcome:"failed",detail:`${e.ref} names nothing in the graph`};let n=i.tipOf(u.cid);if(s.v==="archive"){if(!s.because||!s.because.trim())return{outcome:"failed",detail:"archive requires --because (a reason the record keeps)"};let r=h({store:t.store,graph:i,verdicts:new Map([[n,{resolution:"rejected",reason:s.because}]]),by:p});return r.errors?{outcome:"failed",detail:r.errors.map(o=>`${o.code}: ${o.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"archived",reason:s.because}),{outcome:"retired"})}if(s.v==="approve"){let r=h({store:t.store,graph:i,verdicts:new Map([[n,{resolution:"approved"}]]),by:p});return r.errors?{outcome:"failed",detail:r.errors.map(o=>`${o.code}: ${o.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"approved"}),{outcome:"applied"})}if(s.v==="merge"||s.v==="keep_both"){if(e.kind!=="PAIR"||!e.pair)return{outcome:"failed",detail:`${e.ref} is not a PAIR card`};let r=i.resolve(e.pair.candidate_cid);if(!r)return{outcome:"failed",detail:`pair candidate ${e.pair.candidate_ref} names nothing`};let o=i.tipOf(r.cid);if(s.v==="merge"){let d=P({store:t.store,graph:i,survivor:o,merged:n,reason:`pair merge: duplicate of ${e.pair.candidate_ref} (score ${e.pair.score})`,by:p});return d.errors?{outcome:"failed",detail:d.errors.map(c=>`${c.code}: ${c.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"pair-merged",reason:e.pair.candidate_ref}),{outcome:"committed",detail:`merged into ${e.pair.candidate_ref} \u2014 survivor stays derived`})}let m=h({store:t.store,graph:i,verdicts:new Map([[n,{resolution:"approved"}],[o,{resolution:"approved"}]]),by:p});return m.errors?{outcome:"failed",detail:m.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"pair-kept-both",reason:e.pair.candidate_ref}),{outcome:"applied",detail:"both promoted as distinct"})}return{outcome:"failed",detail:`verdict ${s.v} does not apply to a ${e.kind} card`}}export{M as a,B as b,Y as c,U as d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as s}from"./chunk-HCBYKLMW.js";import{a as m,b as o}from"./chunk-33DWJV67.js";import{y as i}from"./chunk-I6OQISK4.js";import{e as x}from"./chunk-UR6MHSHU.js";var t=x(s(),1);function d({label:r,text:c,accent:a,color:n,width:l=15}){return(0,t.jsxs)(o,{children:[(0,t.jsx)(o,{color:i.dim,children:` ${r.padEnd(l)}`}),(0,t.jsx)(o,{color:n??(a?i.assuranceAccent:void 0),children:c})]})}function u({head:r,rows:c,minWidth:a=15}){let n=c.filter(e=>e.text),l=Math.max(a,...n.map(e=>e.label.length+2));return(0,t.jsxs)(m,{flexDirection:"column",children:[r?(0,t.jsx)(o,{bold:!0,children:r}):null,n.map((e,p)=>(0,t.jsx)(d,{label:e.label,text:e.text,color:e.color,width:l},p))]})}export{d as a,u as b};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b,c as R}from"./chunk-72KYMWQ5.js";import{a as y}from"./chunk-TDPWFYTJ.js";import{b as v}from"./chunk-34R7BNZ2.js";import{c as S}from"./chunk-VZ7KXRXB.js";import{a as f}from"./chunk-RZ4F3BHX.js";import{b as _}from"./chunk-I6OQISK4.js";import{randomUUID as U}from"crypto";import{mkdirSync as P,writeFileSync as g,appendFileSync as G,existsSync as h,readFileSync as B}from"fs";import{join as d}from"path";import{writeFileSync as E,mkdirSync as A,existsSync as L}from"fs";import{join as c,relative as j}from"path";function I(r){let t=Object.keys(r.frontmatter).length>0?S(r.frontmatter).trimEnd():"",s=["---"];return t&&s.push(t),s.push("---",""),s.push(`# ${r.heading}`,""),r.steps.forEach((n,o)=>{s.push(`## Step ${o+1}`,n,"")}),s.join(`
|
|
3
|
+
`)}var T=new Set(["username","access_key","oauth","profile","project_id","folder_id"]),D=new Set(["model","env"]),u=class{constructor(e){this.opts=e}objectives=[];flushed=!1;lastWrittenPath=null;lastCollisionSuffixed=!1;appendObjective(e){this.objectives.push(e)}flush(){if(this.flushed||(this.flushed=!0,this.objectives.length===0))return;let e=this.opts.getName();if(!e)return;let t=c(this.opts.cwd,".testmuai","tests");try{A(t,{recursive:!0})}catch(a){process.stderr.write(`
|
|
4
|
+
\u26A0 Failed to create ${j(this.opts.cwd,t)}/
|
|
5
|
+
${a.message}
|
|
6
|
+
Your test recording was NOT saved.
|
|
7
|
+
|
|
8
|
+
`);return}let s=c(t,`${e}_test.md`),n=2,o=!1;for(;L(s);)s=c(t,`${e}-${n}_test.md`),n++,o=!0;let i=R(F(this.opts.getResolvedGlobal())),l=I({frontmatter:i,heading:`Session: ${e}`,steps:this.objectives.map(b)});try{E(s,l,"utf8")}catch(a){process.stderr.write(`
|
|
9
|
+
\u26A0 Failed to save your test recording.
|
|
10
|
+
${a.message}
|
|
11
|
+
Path: ${s}
|
|
12
|
+
|
|
13
|
+
`);return}this.lastWrittenPath=s,this.lastCollisionSuffixed=o}};function F(r){let e={};for(let[t,s]of Object.entries(r))T.has(t)||D.has(t)||(e[t]=s);return e}var O="kaneCliSessionCompleted",k={prod:"https://test-backend.lambdatest.com/api/analytics/event",stage:"https://stage-test-backend.lambdatestinternal.com/api/analytics/event"};function $(r,e=process.env){return e.KANE_ANALYTICS_API_URL||k[r]}var p=class{constructor(e,t=3e3){this.endpoint=e;this.timeoutMs=t}async sendSessionCompleted(e,t){let s=new AbortController,n=setTimeout(()=>s.abort(),this.timeoutMs);try{let o=await f(this.endpoint,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({userId:e,event:O,data:t}),signal:s.signal});return{ok:o.ok,status:o.status}}catch{return{ok:!1,status:null}}finally{clearTimeout(n)}}};async function m(r,e,t){return new p($(r)).sendSessionCompleted(e,t)}function M(r){let e=Math.max(0,(Date.parse(r.completedAt)-Date.parse(r.startedAt))/1e3);return{referenceId:r.referenceId,startedAt:r.startedAt,completedAt:r.completedAt,durationSeconds:Math.round(Math.max(0,r.durationSeconds??e)*1e3)/1e3,creditsConsumed:Number.isFinite(r.creditsConsumed)?Math.max(0,r.creditsConsumed):0,runType:r.runType,target:r.target}}function ee(r){let e=r.find(t=>t.mobile);return e?e.platform==="ios"?"simulator":"emulator":"desktop"}async function C(r,e=m){if(process.env.KANE_CLI_MODE==="hyperexecute"||!Number.isInteger(r.userId)||r.userId<=0||!r.data.referenceId||r.runsCompleted<=0)return;let t=M(r.data),s=await e(r.env,r.userId,t).catch(()=>({ok:!1,status:null}));r.log?.(s.ok?"info":"warn",s.ok?"CRM_EVENT_SENT":"CRM_EVENT_FAILED",s.ok?"CRM event delivered":"CRM event delivery failed",{event:"kaneCliSessionCompleted",reference_id:r.data.referenceId,status_code:s.status})}var J=d(_,"sessions"),x=class{sessionId;sessionDir;runs=[];_flows=[];_nextIndex=0;_started=!1;_testId=null;_testcaseId=null;_projectId=null;_orgId=null;_userName=null;_userEmail=null;_uploadStatus="pending";_uploadAttempts=0;_uploadError=null;_firstObjective=null;_firstUrl=null;_auteurVariables={};_screenshotSas=null;_model="";_environment="";_profile=null;_plan=null;_startedAt="";_remoteLogger=null;_earlyLogBuffer=[];_recorder=null;_resolvedGlobal={};_sessionName=null;_recordingEnabled=!0;_stepRunRecords=[];_completionUserId=null;_completionMetadata=null;_completionReporter;_reportCompletion;_completionReported=!1;constructor(e){this.sessionId=U();let t=e?.baseDir?d(e.baseDir,"sessions"):J;this.sessionDir=d(t,this.sessionId),this._completionReporter=e?.reporter??((s,n)=>m(this._environment==="stage"?"stage":"prod",s,n)),this._reportCompletion=e?.report!==!1}setCompletionIdentity(e){Number.isInteger(e)&&e>0&&(this._completionUserId=e)}setCompletionMetadata(e){this._completionMetadata??=e}async reportCompletedSession(e){if(this.recordCreditsConsumed(e.creditsConsumed),e.runsCompleted<=0||this._completionReported||!this._reportCompletion||this._completionUserId===null||this._completionMetadata===null||!this._startedAt)return;this._completionReported=!0;let t=e.completedAt??new Date().toISOString();await C({env:this._environment==="stage"?"stage":"prod",userId:this._completionUserId,runsCompleted:e.runsCompleted,data:{referenceId:this.sessionId,startedAt:this._startedAt,completedAt:t,durationSeconds:e.durationSeconds,creditsConsumed:e.creditsConsumed,...this._completionMetadata},log:(s,n,o,i)=>this.log(s,n,o,i)},(s,n,o)=>this._completionReporter(n,o))}recordCreditsConsumed(e){let t=d(this.sessionDir,"session.json");if(h(t))try{let s=JSON.parse(B(t,"utf8"));s.credits_consumed=Number.isFinite(e)?Math.max(0,e):0,g(t,JSON.stringify(s,null,2)+`
|
|
14
|
+
`)}catch{}}setResolvedGlobal(e){this._resolvedGlobal={...this._resolvedGlobal,...e}}setSessionName(e){this._sessionName=e}get sessionName(){return this._sessionName}setRecordingEnabled(e){this._recordingEnabled=e}get recorder(){return this._recorder}flushRecorder(){try{this._recorder?.flush()}catch(e){process.stderr.write(`[recorder] flush failed: ${e.message}
|
|
15
|
+
`)}}start(e){if(!this._started){this._started=!0,this._model=e.model,this._environment=e.environment,this._profile=e.profile,this._startedAt=new Date().toISOString();try{P(this.sessionDir,{recursive:!0}),this._recorder=new u({cwd:process.cwd(),getResolvedGlobal:()=>this._resolvedGlobal,getName:()=>this._sessionName});let t={session_id:this.sessionId,started_at:this._startedAt,model:e.model,environment:e.environment,profile:e.profile,plan:this._plan,objectives:[],runs:[],status:"in_progress"};g(d(this.sessionDir,"session.json"),JSON.stringify(t,null,2)+`
|
|
16
|
+
`)}catch{}this._log(`SESSION START session_id=${this.sessionId}`),this._log(`CONFIG model=${e.model} env=${e.environment} profile=${e.profile}`),this._earlyLogBuffer.push({level:"info",event:"SESSION_START",message:"Session started",context:{session_id:this.sessionId}},{level:"info",event:"CONFIG",message:"Session config",context:{model:e.model,environment:e.environment,profile:e.profile}})}}setPlan(e){this._plan=e;let t={level:"info",event:"SESSION_INFO",message:"Session info",context:{session_id:this.sessionId,plan:e??null}};this._remoteLogger?this._remoteLogger.log(t.level,t.event,t.message,t.context):this._earlyLogBuffer.push(t)}get plan(){return this._plan}get apMode(){return y()??"v2"}setRemoteLogger(e){this._remoteLogger=e;for(let t of this._earlyLogBuffer)e.log(t.level,t.event,t.message,t.context);this._earlyLogBuffer=[]}get hasRemoteLogger(){return this._remoteLogger!==null}setAuteurVariables(e){Object.assign(this._auteurVariables,e)}get auteurVariables(){return this._auteurVariables}setScreenshotSas(e){this._screenshotSas=e}get screenshotSas(){return this._screenshotSas}get screenshotBaseUrl(){return this._screenshotSas?`${this._screenshotSas.base_url}/${this._screenshotSas.container}`:""}get startedAt(){return this._startedAt||new Date().toISOString()}log(e,t,s,n){if(t===void 0){this._log(e);let l=e.indexOf(" "),a=l>0?e.slice(0,l):e,w=l>0?e.slice(l+1):"",N=/fail|error/i.test(e)?"error":"info";this._remoteLogger?.log(N,a,w||e);return}let o=e,i=s;this._log(`${t} ${i}`,n),this._remoteLogger?.log(o,t,i,n)}logStep(e,t,s){this._log(`${e} ${t}`,s);let n=this._nextIndex>0?this._nextIndex-1:0;this._remoteLogger?.logStep(n,e,t,s)}logCommand(e){this._log(`COMMAND ${e}`)}logRunStart(e,t,s){this._log(`RUN ${e} START objective="${t.slice(0,100)}" url=${s}`),this._remoteLogger?.setRunIndex(e),this._remoteLogger?.log("info","RUN_START",`Run ${e} started`,{run_index:e,objective:t,url:s})}logRunEnd(e,t,s,n,o){let i=(s??0).toFixed(1),l=(n??"").slice(0,100),a=o==null||o===""||Number.isNaN(Number(o))?null:Number(o);this._log(`RUN ${e} END status=${t} duration=${i}s summary="${l}"`,a!=null?{result_code:a}:void 0),this._remoteLogger?.log("info","RUN_END",`Run ${e} ended`,{run_index:e,status:t,duration:s??0,summary:n??"",result_code:a}),t!=="failed"&&t!=="error"&&this._remoteLogger?.discardSteps(e)}escalateRun(e){this._remoteLogger?.escalate(e)}logChromeLaunch(e,t){this._log(`CHROME LAUNCH port=${e} endpoint=${t}`),this._remoteLogger?.log("info","CHROME_LAUNCH","Chrome launched",{port:e,cdp_endpoint:t})}async finish(e="complete"){let t=new Date().toISOString();this._log(`SESSION END status=${e} total_runs=${this.runs.length}`),this._remoteLogger?.log("info","SESSION_END","Session ended",{status:e,total_runs:this.runs.length}),await this._remoteLogger?.shutdown();let s={session_id:this.sessionId,started_at:this._startedAt,ended_at:t,model:this._model,environment:this._environment,profile:this._profile,plan:this._plan,status:e,total_runs:this.runs.length,test_id:this._testId,testcase_id:this._testcaseId,commit_id:this.sessionId,project_id:this._projectId,upload_status:this._uploadStatus,upload_attempts:this._uploadAttempts,last_upload_attempt:this._uploadAttempts>0?new Date().toISOString():null,upload_error:this._uploadError,runs:this.runs.map(n=>({index:n.index,objective:n.objective,status:n.status,summary:n.summary,run_dir:n.run_dir}))};if(h(this.sessionDir)&&g(d(this.sessionDir,"session.json"),JSON.stringify(s,null,2)+`
|
|
17
|
+
`),this.flushRecorder(),this._recorder=null,this._flows.length>0){let n=this._flows.reduce((o,i)=>o+(Number.isFinite(i.creditsConsumed)?i.creditsConsumed??0:0),0);await this.reportCompletedSession({runsCompleted:this._flows.length,completedAt:t,creditsConsumed:n})}}nextRunIndex(){return this._nextIndex}addRunResult(e,t){this.runs.push(e),this._nextIndex+=t??1,this._recordingEnabled&&this._recorder?.appendObjective(e.objective)}getContext(){return{prior_runs:this.runs.map(e=>({index:e.index,objective:e.objective,summary:e.summary,status:e.status,memory:e.context.memory,variables:e.context.variables,pointer:e.context.pointer}))}}addFlow(e){let t={...e,index:this._flows.length+1};return this._flows.push(t),t}getFlows(){return[...this._flows]}getFlow(e){return this._flows.find(t=>t.index===e)}clearFlows(){this._flows=[]}recordStepRun(e){this._stepRunRecords.push(e)}getStepRunRecords(){return[...this._stepRunRecords]}getRunsAsStepRecords(){return this.runs.map((e,t)=>({testmdStepIndex:t+1,runIndex:e.index,totalRunDirs:e.run_dirs?.length??1}))}snapshot(){return{runsLen:this.runs.length,nextRunIndex:this._nextIndex,stepRunRecordsLen:this._stepRunRecords.length}}rollback(e){this.runs.length=e.runsLen,this._nextIndex=e.nextRunIndex,this._stepRunRecords.length=e.stepRunRecordsLen}setTestId(e){this._testId=e}get testId(){return this._testId}setTestcaseId(e){this._testcaseId=e}get testcaseId(){return this._testcaseId}setProjectId(e){this._projectId=e}setOrgId(e){this._orgId=e}get orgId(){return this._orgId}setUserIdentity(e,t){e&&(this._userName=e),t&&(this._userEmail=t)}get userName(){return this._userName}get userEmail(){return this._userEmail}setFirstRun(e,t){this._firstObjective||(this._firstObjective=e,this._firstUrl=t)}get firstObjective(){return this._firstObjective}get firstUrl(){return this._firstUrl}getRunDirs(){let e=[];for(let t of this.runs)t.run_dirs&&t.run_dirs.length>0?e.push(...t.run_dirs):t.run_dir&&e.push(t.run_dir);return e}getRunObjectives(){let e=[];for(let t of this.runs)t.flow_objectives&&t.flow_objectives.length>0?e.push(...t.flow_objectives):e.push(t.objective);return e}getRunMetadata(){let e=[];for(let t of this.runs)if(t.perFlowMetadata&&t.perFlowMetadata.length>0)e.push(...t.perFlowMetadata);else{let s={resultCode:t.resultCode,reasonCode:t.reasonCode,errorMessage:t.status==="failed"?t.summary??null:null,summary:t.summary,oneLiner:t.oneLiner},n=t.run_dirs?.length??1;for(let o=0;o<n;o++)e.push(s)}return e}setUploadStatus(e,t){this._uploadStatus=e,this._uploadAttempts+=1,this._uploadError=t??null}_log(e,t){if(!(!this._started||!h(this.sessionDir)))try{let s=new Date().toISOString().slice(0,19).replace("T"," "),n=d(this.sessionDir,"tui.log"),o=t&&Object.keys(t).length>0?` ${JSON.stringify(t)}`:"";G(n,v(`[${s}] ${e}${o}
|
|
18
|
+
`))}catch{}}};export{I as a,ee as b,C as c,x as d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{e as k,f as l}from"./chunk-Y6Y6RAY4.js";import{b as p}from"./chunk-SA6IKFFD.js";import{a as f}from"./chunk-MGNRNLBE.js";import{a as d}from"./chunk-RZ4F3BHX.js";import{promises as g}from"fs";import{basename as _,join as w}from"path";var D=3e3,S="/deviceSkin";function b(e){return e.replace(/\([^)]*\)/g," ").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||void 0}function v(e){if(e.model){let r=b(e.model);return r?`real-${r}`:void 0}let n=e.name?.trim();return n&&!k(n)?n:void 0}function y(e){let n=e?.data?.skin,r=typeof n?.skin_url=="string"?n.skin_url.trim():"",t=n?.skin_data??{},i=u=>typeof u=="number"&&Number.isFinite(u)?u:void 0,s=i(t.width),o=i(t.height);if(!r||!s||!o)return;let m={width:s,height:o};for(let u of["top","right","bottom","left","radius"]){let c=i(t[u]);c!==void 0&&(m[u]=c)}return{skin_url:r,skin_data:m}}var a=new Map;async function h(e,n,r={}){let t=`${f(e).lrmaaBaseUrl}${S}/${encodeURIComponent(n)}`;if(a.has(t))return a.get(t);try{let i=await(r.request??d)(t,{method:"GET",signal:AbortSignal.timeout(D)});if(!i.ok)return;let s=y(await i.json());return a.set(t,s),s}catch{return}}function A(e){let n=(e??"").trim().replace(/^lt:\/\//i,"").trim();if(n)return(p(n)?n:_(n))||void 0}async function P(e){try{let n=w(e,"steps"),r=(await g.readdir(n,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,i)=>(parseInt(t,10)||0)-(parseInt(i,10)||0));for(let t of r)try{let i=await g.readFile(w(n,t,"step.json"),"utf8"),o=JSON.parse(i).basis?.window;if(Array.isArray(o)&&o.length===2&&Number.isFinite(Number(o[0]))&&Number.isFinite(Number(o[1]))&&Number(o[0])>0&&Number(o[1])>0)return`${Math.round(Number(o[0]))}x${Math.round(Number(o[1]))}`}catch{}return}catch{return}}async function T(e,n,r){if(!e.native_platform||!n.environment)return e;let t=v({model:n.deviceModel,name:l(n.runnerEnvironment?.device)});if(!t)return e;let i=await h(n.environment,t,r);return i?{...e,skin_url:i.skin_url,skin_data:i.skin_data}:e}export{v as a,h as b,A as c,P as d,T as e};
|