@testmuai/kane-cli 0.10.0-rc.3 → 0.10.2
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-FIYDTZSI.js +2 -0
- package/dist/{ChromeProfilePicker-M4WXOB5O.js → ChromeProfilePicker-Q6FIGVYU.js} +1 -1
- package/dist/{CliFeedbackPrompt-6MJA7DF6.js → CliFeedbackPrompt-2NV2G65E.js} +1 -1
- package/dist/{CliUploadProgress-6NLS7XHH.js → CliUploadProgress-JZ5FXODE.js} +1 -1
- package/dist/{ConfigView-O4WKZ5PU.js → ConfigView-TZ4YINOE.js} +1 -1
- package/dist/EvidenceViewOffer-LKPN5BHX.js +2 -0
- package/dist/FolderPicker-H5K74PCH.js +2 -0
- package/dist/InfoBox-DNSOAK5L.js +2 -0
- package/dist/{LinksBox-DXP66H3H.js → LinksBox-32TZOANP.js} +1 -1
- package/dist/{ProfilesView-TWOY5PVC.js → ProfilesView-UC4MPM54.js} +1 -1
- package/dist/ProjectPicker-ZJ5RW6XL.js +2 -0
- package/dist/SaveSessionPrompt-F327WC7A.js +2 -0
- package/dist/SingleShotApp-OMLRYOSI.js +2 -0
- package/dist/{SummaryBox-IA2KS6GT.js → SummaryBox-XGFO5X76.js} +1 -1
- package/dist/TestMdRunView-ZZ77QTAQ.js +2 -0
- package/dist/TestrunEvidenceTable-G7MPF55X.js +2 -0
- package/dist/{WhoamiView-SNL75TEF.js → WhoamiView-4XIJXMTU.js} +1 -1
- package/dist/{app-download-UI4ABEIX.js → app-download-XEDO3EMV.js} +1 -1
- package/dist/{assurance-job-FFSSS4XV.js → assurance-job-MD65GQLC.js} +1 -1
- package/dist/{auth-7Z54TMQQ.js → auth-WBIEHHDS.js} +1 -1
- package/dist/{binary-THPLXCOD.js → binary-NVYLR36K.js} +1 -1
- package/dist/bind-H3ALI2NG.js +2 -0
- package/dist/bootstrap-JEVSVPQ2.js +2 -0
- package/dist/bridge-2UHJOVLX.js +2 -0
- package/dist/{catalog-MYPS2BXY.js → catalog-5UYBWA4W.js} +1 -1
- package/dist/catalog-client-VVKV4JKW.js +2 -0
- package/dist/{changelog-SU674BVE.js → changelog-FPWJXERY.js} +1 -1
- package/dist/chat-committer-ZKEKJA2R.js +2 -0
- package/dist/chat-controller-FXRJXUG3.js +2 -0
- package/dist/child-JHYENXE7.js +2 -0
- package/dist/chunk-226AGYHB.js +87 -0
- package/dist/{chunk-MNBGG4H3.js → chunk-23DKB2MT.js} +1 -1
- package/dist/{chunk-EECDDDSB.js → chunk-2COXO5LQ.js} +1 -1
- package/dist/{chunk-LUR7JFPP.js → chunk-2GEAKFAV.js} +1 -1
- package/dist/{chunk-7SY34IIL.js → chunk-2QKBXRLI.js} +1 -1
- package/dist/{chunk-AVSMXDTX.js → chunk-2ULYGALF.js} +1 -1
- package/dist/{chunk-JNSWKGTB.js → chunk-32HED7X2.js} +1 -1
- package/dist/{chunk-GRURFGBP.js → chunk-32MFECUA.js} +1 -1
- package/dist/{chunk-MYVKUJGS.js → chunk-35BG2EMW.js} +1 -1
- package/dist/{chunk-3GXN6VF6.js → chunk-3KY7HHQU.js} +1 -1
- package/dist/{chunk-7NPTL66J.js → chunk-3V4J65GN.js} +1 -1
- package/dist/{chunk-457Y5TEC.js → chunk-3YIA3DSL.js} +1 -1
- package/dist/{chunk-36N3EHW5.js → chunk-44SIFDNY.js} +1 -1
- package/dist/{chunk-MEKPGQAM.js → chunk-45NM23EQ.js} +2 -2
- package/dist/{chunk-I2MC6VVX.js → chunk-4C7WVQOD.js} +1 -1
- package/dist/{chunk-TU42YZOJ.js → chunk-4HARMERK.js} +1 -1
- package/dist/{chunk-ICLUC44J.js → chunk-4HYPMGDF.js} +1 -1
- package/dist/{chunk-7KX2BHKG.js → chunk-4KCYNP2K.js} +1 -1
- package/dist/{chunk-IJ2AHSWW.js → chunk-4LGQHTXM.js} +1 -1
- package/dist/{chunk-ETZMFRD6.js → chunk-4NEPHIAO.js} +1 -1
- package/dist/{chunk-3E4ZO73O.js → chunk-54NJJVG5.js} +1 -1
- package/dist/{chunk-734ORT6O.js → chunk-5F44KH3R.js} +1 -1
- package/dist/{chunk-E6KSRQXL.js → chunk-5F5IVART.js} +1 -1
- package/dist/{chunk-EBPRPNSA.js → chunk-5KJU4MG4.js} +1 -1
- package/dist/{chunk-JZP3Y4ZM.js → chunk-5MFPQYW3.js} +1 -1
- package/dist/{chunk-QENCC2ZS.js → chunk-5WLXAQ4H.js} +1 -1
- package/dist/{chunk-RFEON5GN.js → chunk-5XVWT6UK.js} +1 -1
- package/dist/{chunk-W4QSZNMB.js → chunk-6CS23F3E.js} +1 -1
- package/dist/{chunk-DZOYYWOW.js → chunk-6JUS2ULI.js} +1 -1
- package/dist/chunk-6K5BEEAJ.js +2 -0
- package/dist/{chunk-4QFTHUJA.js → chunk-6LEHGRRG.js} +1 -1
- package/dist/{chunk-LSDJOVWW.js → chunk-6SD4XTYC.js} +1 -1
- package/dist/{chunk-TW5AA5A7.js → chunk-6SWHEBPR.js} +1 -1
- package/dist/{chunk-URH4FX3H.js → chunk-6YBH3WUW.js} +1 -1
- package/dist/{chunk-ZAFJQ3SM.js → chunk-73HMW2WA.js} +1 -1
- package/dist/{chunk-NXAJBSIF.js → chunk-75FF7J5R.js} +1 -1
- package/dist/{chunk-P3JXJ4BW.js → chunk-7DLDADQR.js} +1 -1
- package/dist/{chunk-7NCJMWFX.js → chunk-7LYLJ75Z.js} +1 -1
- package/dist/chunk-7O2FIZB7.js +9 -0
- package/dist/chunk-7PCLHURF.js +101 -0
- package/dist/{chunk-PUVMC4PX.js → chunk-7V34ZMMS.js} +1 -1
- package/dist/{chunk-AEWNWAXW.js → chunk-7XJNYLQW.js} +2 -2
- package/dist/{chunk-WEIPY3CI.js → chunk-7ZR5CQY3.js} +1 -1
- package/dist/{chunk-2DYHAP4E.js → chunk-A474TUCE.js} +1 -1
- package/dist/chunk-A4ZV2SHL.js +5 -0
- package/dist/chunk-A7IMHUFY.js +27 -0
- package/dist/{chunk-XLEGGC4Y.js → chunk-ABMM37L2.js} +1 -1
- package/dist/{chunk-NIVFEACM.js → chunk-AUSLHNXQ.js} +1 -1
- package/dist/{chunk-YPFQ4UGF.js → chunk-B226SFOV.js} +1 -1
- package/dist/{chunk-DJC7NTLA.js → chunk-B57ZRHEQ.js} +1 -1
- package/dist/{chunk-CGITGJ3I.js → chunk-BHQIH2FE.js} +1 -1
- package/dist/{chunk-FWUPJORV.js → chunk-BJT6PZXL.js} +1 -1
- package/dist/{chunk-VX657KIK.js → chunk-C6P6YUCR.js} +1 -1
- package/dist/chunk-CB344EDO.js +2 -0
- package/dist/chunk-CCOD4GQJ.js +2 -0
- package/dist/{chunk-ZFM77AQU.js → chunk-CQDCNP7V.js} +1 -1
- package/dist/{chunk-VUFIL5VR.js → chunk-D4QXYAYA.js} +2 -2
- package/dist/{chunk-Y7E5L42F.js → chunk-DLP5S3TO.js} +1 -1
- package/dist/{chunk-35ECWCCK.js → chunk-DXIQVBMI.js} +1 -1
- package/dist/chunk-DXLZCJH5.js +7 -0
- package/dist/{chunk-OJ33Q6DU.js → chunk-E4GIGM5V.js} +1 -1
- package/dist/{chunk-I4WXALQR.js → chunk-EAWU2TOG.js} +1 -1
- package/dist/{chunk-ACMBMZDQ.js → chunk-EEOAU43D.js} +1 -1
- package/dist/{chunk-MYZHOBS4.js → chunk-EHB55V23.js} +1 -1
- package/dist/{chunk-UYDHOHSZ.js → chunk-ENRFXGID.js} +1 -1
- package/dist/{chunk-RTVHJ23A.js → chunk-ET5EK2CM.js} +1 -1
- package/dist/{chunk-EF47KRUK.js → chunk-EZMRWXRT.js} +1 -1
- package/dist/chunk-FAMQ4DHU.js +2 -0
- package/dist/{chunk-C2RUDJ46.js → chunk-FI2DVNRT.js} +1 -1
- package/dist/{chunk-AUJSC7PU.js → chunk-FNUGDPTS.js} +1 -1
- package/dist/{chunk-VLDCHFXF.js → chunk-FOLUB336.js} +1 -1
- package/dist/{chunk-NZ6AV2TA.js → chunk-FYPIF3BE.js} +1 -1
- package/dist/{chunk-HHW6MRU3.js → chunk-G4K3TP2I.js} +1 -1
- package/dist/{chunk-P2ZQDQDB.js → chunk-GAKBHNC4.js} +1 -1
- package/dist/{chunk-DPGOAFKF.js → chunk-GBQ4K25P.js} +1 -1
- package/dist/{chunk-O3HHTKZ5.js → chunk-GEZVC4S3.js} +1 -1
- package/dist/chunk-GJ7MO2FW.js +9 -0
- package/dist/{chunk-EZN7CF45.js → chunk-GJXO6FF7.js} +1 -1
- package/dist/{chunk-QDFY5GGO.js → chunk-GLM5UGTF.js} +1 -1
- package/dist/{chunk-HK62JVQM.js → chunk-GQARXS6F.js} +1 -1
- package/dist/{chunk-I4RVVBG3.js → chunk-GT3JDX5H.js} +1 -1
- package/dist/{chunk-YLXWAY7D.js → chunk-GZQAETB2.js} +1 -1
- package/dist/{chunk-7HMSMAUG.js → chunk-H4TIVILC.js} +5 -5
- package/dist/{chunk-VXGN3IV7.js → chunk-HG2ILWCE.js} +1 -1
- package/dist/{chunk-M43WH5DQ.js → chunk-HHOVANJ7.js} +1 -1
- package/dist/{chunk-CM4CHYSN.js → chunk-HM6LZ2KM.js} +1 -1
- package/dist/{chunk-QDXKEOKI.js → chunk-HNF3PWF3.js} +6 -6
- package/dist/{chunk-R7KXAISS.js → chunk-HVOXMCKE.js} +1 -1
- package/dist/{chunk-D7U2M26S.js → chunk-HWPWCCEV.js} +1 -1
- package/dist/{chunk-XRNQSXOM.js → chunk-HX5OLRKU.js} +2 -2
- package/dist/{chunk-4I7YN6YY.js → chunk-HYJVYYAZ.js} +2 -2
- package/dist/{chunk-CUXY6KQ2.js → chunk-I52NWH4U.js} +1 -1
- package/dist/{chunk-IGEAET7M.js → chunk-IB5WG5YY.js} +1 -1
- package/dist/{chunk-LAOTVZHV.js → chunk-IH73ZCBB.js} +1 -1
- package/dist/{chunk-TU7TVFBK.js → chunk-IT5JVCZN.js} +1 -1
- package/dist/{chunk-54XA5MZH.js → chunk-IZ66FKPC.js} +1 -1
- package/dist/{chunk-44B6THYK.js → chunk-JNPFEBUR.js} +1 -1
- package/dist/{chunk-RX6776AI.js → chunk-JTNEF5ZP.js} +1 -1
- package/dist/{chunk-QBYENBMB.js → chunk-JUVY6PHY.js} +1 -1
- package/dist/{chunk-5AKJPYUW.js → chunk-K4K2BGQC.js} +3 -3
- package/dist/{chunk-HJMCXSUJ.js → chunk-K75WIRI5.js} +1 -1
- package/dist/{chunk-FSYOTRMC.js → chunk-KKLCXRW6.js} +1 -1
- package/dist/{chunk-7YT4TTKL.js → chunk-KN7GZWKK.js} +1 -1
- package/dist/{chunk-ZTHYAHDN.js → chunk-L3BUPFAQ.js} +4 -4
- package/dist/{chunk-7XBNMOH4.js → chunk-LLQWEGXD.js} +1 -1
- package/dist/chunk-LTPOMMAB.js +2 -0
- package/dist/{chunk-CCP4X75B.js → chunk-LWCP4GLY.js} +1 -1
- package/dist/chunk-LXCTV75T.js +12 -0
- package/dist/{chunk-RDP7GWSY.js → chunk-LZGAFKYH.js} +1 -1
- package/dist/{chunk-3QICDXY5.js → chunk-LZPYIFHZ.js} +1 -1
- package/dist/{chunk-3OQW2GTA.js → chunk-M3TFOFUQ.js} +1 -1
- package/dist/{chunk-V7USCQWO.js → chunk-M7Y5GGVJ.js} +1 -1
- package/dist/{chunk-SMTBOSEJ.js → chunk-MEMXFTLD.js} +1 -1
- package/dist/{chunk-D756UWY2.js → chunk-MINDIQET.js} +1 -1
- package/dist/{chunk-ZTRRFG52.js → chunk-MP6NCJFE.js} +1 -1
- package/dist/{chunk-GXKY5A46.js → chunk-MSYRAPDK.js} +1 -1
- package/dist/{chunk-HJLMH7ZM.js → chunk-MUX2A37P.js} +1 -1
- package/dist/{chunk-YHFZFV3A.js → chunk-NCP54AIQ.js} +9 -9
- package/dist/{chunk-ZU4W2QGM.js → chunk-NVD2MXHQ.js} +1 -1
- package/dist/{chunk-FWDUVFS6.js → chunk-O2Y46A3G.js} +17 -17
- package/dist/{chunk-XZGEN4NU.js → chunk-O3TXAMFW.js} +1 -1
- package/dist/{chunk-YGRULEZY.js → chunk-O5KTMDTH.js} +1 -1
- package/dist/{chunk-PAWQ4AKN.js → chunk-OK6NLITG.js} +1 -1
- package/dist/{chunk-7AET4JKQ.js → chunk-OKA6FPJM.js} +1 -1
- package/dist/{chunk-3YTCKCBG.js → chunk-OVNTCBNS.js} +1 -1
- package/dist/{chunk-YQ5C6UDG.js → chunk-P4VFC6HO.js} +1 -1
- package/dist/{chunk-LQQNPMOD.js → chunk-PC22QRIY.js} +1 -1
- package/dist/{chunk-XQMWHPZI.js → chunk-PEUIHME2.js} +1 -1
- package/dist/{chunk-UEE3RZN4.js → chunk-PI7OXS62.js} +1 -1
- package/dist/{chunk-D7TKE7LK.js → chunk-POA336CU.js} +1 -1
- package/dist/{chunk-WZXPF3BI.js → chunk-PR5EGLEI.js} +1 -1
- package/dist/{chunk-YIKF4ERQ.js → chunk-PRBWZXFA.js} +2 -2
- package/dist/{chunk-XZYA7DNH.js → chunk-PVN64537.js} +1 -1
- package/dist/{chunk-VSVWNRI2.js → chunk-PWNYTIVA.js} +1 -1
- package/dist/chunk-Q4JV4U65.js +161 -0
- package/dist/{chunk-LUZBGTYB.js → chunk-Q5AKIQIE.js} +1 -1
- package/dist/{chunk-6EB5VRAN.js → chunk-QB77LRF4.js} +1 -1
- package/dist/{chunk-GQRU3B54.js → chunk-QUNIY6NN.js} +1 -1
- package/dist/{chunk-KODJVOCN.js → chunk-QVMXL675.js} +1 -1
- package/dist/{chunk-LCSJ7GOG.js → chunk-R6TFRAMZ.js} +1 -1
- package/dist/{chunk-4YW767UV.js → chunk-RAVAJZV2.js} +7 -7
- package/dist/{chunk-DDZLCAEO.js → chunk-RDAIOJCR.js} +1 -1
- package/dist/{chunk-RPRXRKKR.js → chunk-RQKMSNEU.js} +1 -1
- package/dist/{chunk-ECPFI75W.js → chunk-RRKYHUOD.js} +1 -1
- package/dist/{chunk-3RJHXOZH.js → chunk-S7XCOBYD.js} +1 -1
- package/dist/{chunk-Q3C6NDGI.js → chunk-SALZ6WSF.js} +1 -1
- package/dist/{chunk-ZFMRQ57Y.js → chunk-SIHX5FW5.js} +1 -1
- package/dist/{chunk-FIP5L6LV.js → chunk-SSOUYKVG.js} +1 -1
- package/dist/{chunk-TNORODUF.js → chunk-SVIIUKJ2.js} +1 -1
- package/dist/{chunk-7RWP4Y3H.js → chunk-T77LTLAD.js} +1 -1
- package/dist/{chunk-NLZZLANH.js → chunk-TAY7J5VS.js} +1 -1
- package/dist/chunk-TD6GCEIK.js +2 -0
- package/dist/{chunk-LKQFG4RW.js → chunk-TM6VLC6V.js} +1 -1
- package/dist/{chunk-YAW6JW6D.js → chunk-TMH4TPMB.js} +1 -1
- package/dist/{chunk-OFSDB7B4.js → chunk-TU2KPOW2.js} +2 -2
- package/dist/{chunk-3BSYOCSW.js → chunk-U2VYTVKV.js} +1 -1
- package/dist/{chunk-LIGTP3A3.js → chunk-UCVP7ZY4.js} +1 -1
- package/dist/{chunk-RHGW7B5Q.js → chunk-UICJ2KLJ.js} +1 -1
- package/dist/chunk-UJLULWSR.js +21 -0
- package/dist/{chunk-OCDBTAYS.js → chunk-UMNCM4RJ.js} +2 -2
- package/dist/{chunk-WOSANGV6.js → chunk-UWPG5MWM.js} +1 -1
- package/dist/{chunk-W6HZF56M.js → chunk-V3OZJO7Y.js} +1 -1
- package/dist/{chunk-3F5FMH76.js → chunk-VE4HLIGA.js} +1 -1
- package/dist/{chunk-RF37IJNN.js → chunk-W2HRX3DR.js} +1 -1
- package/dist/{chunk-NXRF7FFS.js → chunk-W54BX6HC.js} +1 -1
- package/dist/{chunk-IZ65ZPWY.js → chunk-W5HFUBXD.js} +1 -1
- package/dist/{chunk-HAW5WEKT.js → chunk-WEJR2V7R.js} +1 -1
- package/dist/{chunk-F5NHG7VB.js → chunk-X3A4QPA3.js} +1 -1
- package/dist/{chunk-AVI5H4UM.js → chunk-X52YIWGG.js} +1 -1
- package/dist/{chunk-72RC7JSA.js → chunk-X6FCXBXU.js} +1 -1
- package/dist/{chunk-PZA3BSOE.js → chunk-X7S7IGCV.js} +1 -1
- package/dist/{chunk-6DZX5HLZ.js → chunk-XCUF5AVM.js} +1 -1
- package/dist/{chunk-F22K3RRX.js → chunk-XHFU5TGS.js} +1 -1
- package/dist/chunk-XNXJXGVB.js +4 -0
- package/dist/{chunk-C62QWG4B.js → chunk-XZ6J3Y2W.js} +1 -1
- package/dist/{chunk-JGRXMTME.js → chunk-YDB72F4K.js} +1 -1
- package/dist/{chunk-7DFBOVUB.js → chunk-YJAQZMJT.js} +1 -1
- package/dist/chunk-YO6SNXBJ.js +2 -0
- package/dist/{chunk-AZLNLHUA.js → chunk-Z24SD2EJ.js} +1 -1
- package/dist/{chunk-HQ2E2XCU.js → chunk-Z36KVIRR.js} +1 -1
- package/dist/{chunk-WAOUE7MP.js → chunk-Z6SI7YNV.js} +1 -1
- package/dist/{chunk-6NFOH4AC.js → chunk-ZAQGIC33.js} +1 -1
- package/dist/{chunk-6UVIY56J.js → chunk-ZCL7XIVS.js} +1 -1
- package/dist/{chunk-UUJIGOEO.js → chunk-ZDCXWEQG.js} +1 -1
- package/dist/{chunk-SGPAM5DZ.js → chunk-ZDQYGLCZ.js} +1 -1
- package/dist/{chunk-42PALMW2.js → chunk-ZHAMVLQZ.js} +1 -1
- package/dist/{chunk-W7FLXW6Q.js → chunk-ZMWTRXFH.js} +1 -1
- package/dist/{chunk-KXHJMAZU.js → chunk-ZO3ZAMUU.js} +2 -2
- package/dist/{chunk-L5DALV5N.js → chunk-ZZZGTDYE.js} +1 -1
- package/dist/commands-R5AYK6XM.js +2 -0
- package/dist/{committer-JGY66PFM.js → committer-UO3B3S5Y.js} +1 -1
- package/dist/{config-754B73XK.js → config-YMHI3H3Y.js} +1 -1
- package/dist/cover-cmd-DVQIGFDY.js +2 -0
- package/dist/{credentials-F7DYLVWY.js → credentials-BCR73VGS.js} +1 -1
- package/dist/{deps-bundle-PW3WEQJ7.js → deps-bundle-6WLX44OA.js} +1 -1
- package/dist/{deps-resolve-SQYVN76L.js → deps-resolve-DSAKPZ3T.js} +1 -1
- package/dist/{design-chat-F3OEZPNJ.js → design-chat-YUI2JPO6.js} +1 -1
- package/dist/design-committer-7YIPFKMO.js +2 -0
- package/dist/design-headless-KIP6R7UV.js +2 -0
- package/dist/{design-remote-2BEGCVCX.js → design-remote-XMSHDDUX.js} +2 -2
- package/dist/device-env-K7J5NN66.js +2 -0
- package/dist/dispatch-BV6XMCN3.js +2 -0
- package/dist/{doctor-XY26Z35T.js → doctor-PGTNOMSP.js} +1 -1
- package/dist/{docx-convert-6IZO5P5K.js → docx-convert-DO5AQYD3.js} +1 -1
- package/dist/{dossier-NROC2MCY.js → dossier-5XKNAK6Q.js} +1 -1
- package/dist/evidence-RO3RDZXO.js +2 -0
- package/dist/evidence-presentation-LSFOZGLH.js +2 -0
- package/dist/evolve-cmd-U2ALVGMT.js +2 -0
- package/dist/evolve-remote-K2MCCVMM.js +2 -0
- package/dist/{exit-manager-EDHCETUN.js → exit-manager-EGWAZHCR.js} +1 -1
- package/dist/{explain-cmd-VYAANFFZ.js → explain-cmd-KNDORU2D.js} +1 -1
- package/dist/{explain-cmd-OP5I5W3O.js → explain-cmd-UWK5YVXG.js} +1 -1
- package/dist/explore-S2BGQUIF.js +2 -0
- package/dist/{explore-context-tty-RZ7D2TBV.js → explore-context-tty-WJHUSP3A.js} +1 -1
- package/dist/{explore-entry-EKXJ67BD.js → explore-entry-3EX2T3NS.js} +4 -4
- package/dist/{explore-live-2YVRAQZO.js → explore-live-TRY5A2ME.js} +1 -1
- package/dist/{explore-run-tty-D47FGPX7.js → explore-run-tty-ZV5XFKZA.js} +2 -2
- package/dist/{extract-bind-W2NET364.js → extract-bind-TXUBMK3T.js} +3 -3
- package/dist/extract-chat-VPYDGQKO.js +2 -0
- package/dist/{extract-cmd-FTFLETOP.js → extract-cmd-YUOYMVF5.js} +2 -2
- package/dist/extract-headless-UWTAPOET.js +2 -0
- package/dist/{feeder-NY45UFJK.js → feeder-NGWIPZ26.js} +1 -1
- package/dist/folder-flags-WV7UV3JG.js +2 -0
- package/dist/gaps-cmd-PFV3FZCM.js +3 -0
- package/dist/gate-7ALXLCNB.js +2 -0
- package/dist/gate-NB5CJMTN.js +2 -0
- package/dist/{generate-headless-RURIEKVS.js → generate-headless-KMBBZTLS.js} +2 -2
- package/dist/hold-passthrough-JGHWMYDM.js +2 -0
- package/dist/impact-cmd-PW33L5RF.js +11 -0
- package/dist/index.js +4150 -180
- package/dist/ingest-ZHHHBUXR.js +2 -0
- package/dist/{ingest-cmd-4G2AK4Y2.js → ingest-cmd-MXYILQLV.js} +3 -3
- package/dist/ingest-remote-2EEJP6ML.js +2 -0
- package/dist/install-7J34AYB6.js +2 -0
- package/dist/{interactive-bind-SI2ZS55Q.js → interactive-bind-FDWJUTI6.js} +4 -4
- package/dist/{interactive-remote-J56EWJGA.js → interactive-remote-O2Q2FNOH.js} +2 -2
- package/dist/lane-CNGO7LH5.js +2 -0
- package/dist/lattice-auth-TXNDLHM6.js +2 -0
- package/dist/{lifecycle-cmd-HJ37LTXE.js → lifecycle-cmd-GFHDBRXX.js} +1 -1
- package/dist/{list-cmd-6XL2FYLQ.js → list-cmd-RR75PMPE.js} +1 -1
- package/dist/list-commands-3QGZWJ5P.js +2 -0
- package/dist/{list-remote-LXPQNXYN.js → list-remote-AA3VSWOI.js} +1 -1
- package/dist/{locks-cmd-JJ2QNTNY.js → locks-cmd-AZKCSGHI.js} +1 -1
- package/dist/{logical-ids-RXAQJZ3T.js → logical-ids-74PLU3VR.js} +1 -1
- package/dist/login-flow-ZQ6UFTS2.js +2 -0
- package/dist/{maintenance-cmd-BXXHP36K.js → maintenance-cmd-OHGVARQ2.js} +1 -1
- package/dist/{mobile-prompts-CECJ5UY2.js → mobile-prompts-FZRKLLTN.js} +1 -1
- package/dist/{objective-variable-gate-3Z7DNVVC.js → objective-variable-gate-V5HHFOUS.js} +1 -1
- package/dist/{onboarding-PDVYMTY5.js → onboarding-NXGMV3VG.js} +1 -1
- package/dist/open-provider-XDJKT3W3.js +2 -0
- package/dist/pdf-convert-YB6PJFMI.js +2 -0
- package/dist/persist-recorded-session-INFN4JZT.js +3 -0
- package/dist/phase-seed-ZZSJME7M.js +2 -0
- package/dist/pipeline-MVZRI6YZ.js +2 -0
- package/dist/policy-commands-3YJ6YCDN.js +8 -0
- package/dist/prepare-target-DII5WZCX.js +2 -0
- package/dist/{pull-cmd-UPFQYUND.js → pull-cmd-XZN53XFZ.js} +1 -1
- package/dist/pull-route-R33BVADE.js +2 -0
- package/dist/readmodel-TRV4E3MW.js +2 -0
- package/dist/real-device-run-DGENHGUV.js +2 -0
- package/dist/{reconcile-cmd-JBH365JL.js → reconcile-cmd-KFPRCCJB.js} +4 -4
- package/dist/reconcile-deps-UDQBWSLE.js +2 -0
- package/dist/{reconcile-remote-BCX6SWFC.js → reconcile-remote-6WISFGRG.js} +2 -2
- package/dist/{recording-banner-YKBAL6UB.js → recording-banner-XOX2CDCF.js} +1 -1
- package/dist/registry-NV3EMDMK.js +2 -0
- package/dist/remote-entry-BCTFT643.js +2 -0
- package/dist/remote-mode-4HN27MD4.js +4 -0
- package/dist/{remote-words-YVB66R3F.js → remote-words-LFDYKIZ7.js} +1 -1
- package/dist/{require-project-folder-MLMEQJYP.js → require-project-folder-ZK4JJCDB.js} +1 -1
- package/dist/{resolve-run-intent-PC7TQZUL.js → resolve-run-intent-LYLVNNDZ.js} +1 -1
- package/dist/{resolver-EID34LQE.js → resolver-RMHGGYRP.js} +1 -1
- package/dist/revert-QKHPCRT6.js +2 -0
- package/dist/{review-cmd-EUHFLFMY.js → review-cmd-UGF2FC5Y.js} +1 -1
- package/dist/run-CSYGVV3D.js +2 -0
- package/dist/run-YUHHD54J.js +2 -0
- package/dist/{run-channel-63SVP5OI.js → run-channel-IIIYXOIW.js} +1 -1
- package/dist/run-remote-BGKQDAOA.js +2 -0
- package/dist/{run-startup-gate-YO66G6LS.js → run-startup-gate-4XE73OON.js} +1 -1
- package/dist/run-test-md-G6U3RU2Q.js +19 -0
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-CFV7FOIT.js → sessions-NH2EG7BP.js} +1 -1
- package/dist/{sessions-cmd-S7WZBUCN.js → sessions-cmd-CABAX7BO.js} +2 -2
- package/dist/{sessions-remote-IWHWIQ2T.js → sessions-remote-Y4FTZL7Y.js} +1 -1
- package/dist/{skill-installer-MAVQY6GW.js → skill-installer-FS2AV7GX.js} +1 -1
- package/dist/spawner-MQ4XEHIX.js +2 -0
- package/dist/{store-MSA7KASS.js → store-PLKJZTGC.js} +1 -1
- package/dist/store-choice-UAB6Z4AL.js +2 -0
- package/dist/store-guard-DUN2X3SR.js +2 -0
- package/dist/{store-site-KA2DNBGY.js → store-site-K5NHLI7D.js} +1 -1
- package/dist/stream-warnings-GM7YEOVG.js +2 -0
- package/dist/sync-cmd-AGTOGPYM.js +2 -0
- package/dist/{sync-setup-RBRDUV7Q.js → sync-setup-4KIY3PDO.js} +1 -1
- package/dist/tcg-generate-CUY4AZ2V.js +2 -0
- package/dist/{test-definition-VRI4YIYL.js → test-definition-53XNBEDE.js} +1 -1
- package/dist/testmd-actions-UD6PAWUX.js +2 -0
- package/dist/{testmd-sync-UPAA5UMD.js → testmd-sync-EEJ7GPLR.js} +1 -1
- package/dist/tms-client-XWCR7O7J.js +2 -0
- package/dist/token-refresh-K6PVBBFE.js +2 -0
- package/dist/{trust-gate-AT2XBWN4.js → trust-gate-674C2NZS.js} +1 -1
- package/dist/{turn-preflight-LHYLRL7G.js → turn-preflight-R4PU6NYY.js} +1 -1
- package/dist/{use-case-ref-NE4X4MZN.js → use-case-ref-44BPIP4N.js} +1 -1
- package/dist/{validate-basic-M5JHHNZA.js → validate-basic-3JZRZL45.js} +1 -1
- package/dist/{variable-receipt-BXSZO36E.js → variable-receipt-7PRKDTRJ.js} +1 -1
- package/dist/verdicts-PVB7TV5S.js +2 -0
- package/dist/{version-check-Q737BE65.js → version-check-IY3YSQIP.js} +1 -1
- package/dist/{view-cmd-XSNL5DGI.js → view-cmd-WUIGTRFX.js} +1 -1
- package/dist/{walk-session-SHGYLFRB.js → walk-session-EH7227WR.js} +1 -1
- package/dist/with-telemetry-7JMZUBUZ.js +2 -0
- package/package.json +17 -17
- package/dist/ChatSurface-6NZGMNHL.js +0 -2
- package/dist/EvidenceViewOffer-WIEWCZUP.js +0 -2
- package/dist/FolderPicker-AF7ZMV3M.js +0 -2
- package/dist/InfoBox-D7GGZJU4.js +0 -2
- package/dist/ProjectPicker-OBYHJJLU.js +0 -2
- package/dist/SaveSessionPrompt-7XSHS4NL.js +0 -2
- package/dist/SingleShotApp-XQUDR36R.js +0 -2
- package/dist/TestMdRunView-LS2QUFWR.js +0 -2
- package/dist/TestrunEvidenceTable-HNDVJDIF.js +0 -2
- package/dist/bind-4XWK3DG2.js +0 -2
- package/dist/bootstrap-6ACT4ALI.js +0 -2
- package/dist/bridge-T6QMYKED.js +0 -2
- package/dist/chat-committer-ZCSRJEUB.js +0 -2
- package/dist/chat-controller-XINCDH6Z.js +0 -2
- package/dist/child-G2GCW73X.js +0 -2
- package/dist/chunk-34R7BNZ2.js +0 -2
- package/dist/chunk-65VANXOF.js +0 -147
- package/dist/chunk-C6HI6Y3S.js +0 -2
- package/dist/chunk-D36V5OX6.js +0 -2
- package/dist/chunk-HCJ2N3XB.js +0 -12
- package/dist/chunk-IUQOG7Z5.js +0 -5
- package/dist/chunk-KF4DKXSS.js +0 -2
- package/dist/chunk-NC7D7GOM.js +0 -21
- package/dist/chunk-OGFU4YY4.js +0 -2
- package/dist/chunk-R4JUKTDO.js +0 -2
- package/dist/chunk-VZ4A6WMK.js +0 -97
- package/dist/chunk-W54OT2FU.js +0 -9
- package/dist/chunk-W72ACCFL.js +0 -27
- package/dist/chunk-WXJCJL5L.js +0 -7
- package/dist/cover-cmd-NBNZCR6C.js +0 -2
- package/dist/design-committer-TRYP3LOZ.js +0 -2
- package/dist/design-headless-OTHYOX3E.js +0 -2
- package/dist/device-env-CHFRRV6W.js +0 -2
- package/dist/dispatch-DVQ3H7EJ.js +0 -2
- package/dist/evidence-P6FFKC7B.js +0 -2
- package/dist/evidence-presentation-YYTIDCBS.js +0 -2
- package/dist/evolve-cmd-WWOB3QJR.js +0 -2
- package/dist/evolve-remote-WLVY3QID.js +0 -2
- package/dist/explore-K5YBGHK6.js +0 -2
- package/dist/extract-chat-M65NWGUK.js +0 -2
- package/dist/extract-headless-G6W6JQ27.js +0 -2
- package/dist/folder-flags-KKIH654K.js +0 -2
- package/dist/gaps-cmd-OIDDLRYL.js +0 -3
- package/dist/gate-7AKRPRMK.js +0 -2
- package/dist/gate-WISOUTHQ.js +0 -2
- package/dist/hold-passthrough-IOWPVB4W.js +0 -2
- package/dist/ingest-PDGS5ZTL.js +0 -2
- package/dist/ingest-remote-SSLUHQVG.js +0 -2
- package/dist/install-ZVBHPXGP.js +0 -2
- package/dist/lane-AQYRIW24.js +0 -2
- package/dist/lattice-auth-6FEVSR7E.js +0 -2
- package/dist/list-commands-5DCCKU3L.js +0 -2
- package/dist/login-flow-WEK3E476.js +0 -2
- package/dist/open-provider-OZAG6WZS.js +0 -2
- package/dist/pdf-convert-447ACUB3.js +0 -2
- package/dist/persist-recorded-session-A3ID7JFA.js +0 -3
- package/dist/phase-seed-LCJ4WSYV.js +0 -2
- package/dist/pipeline-GX3LKPI5.js +0 -2
- package/dist/prepare-target-FMT6QFHZ.js +0 -2
- package/dist/pull-route-FWBXJMR7.js +0 -2
- package/dist/readmodel-INMP6MNW.js +0 -2
- package/dist/real-device-run-X7JJWOIK.js +0 -2
- package/dist/reconcile-deps-TWJ3FTSU.js +0 -2
- package/dist/registry-VQC757MJ.js +0 -2
- package/dist/remote-entry-X6JMPC2K.js +0 -2
- package/dist/remote-mode-FDPA7EWG.js +0 -4
- package/dist/revert-FHOBLZWF.js +0 -2
- package/dist/run-5RQUCNYP.js +0 -2
- package/dist/run-PC5YO4AS.js +0 -2
- package/dist/run-remote-SJCRTL7O.js +0 -2
- package/dist/run-test-md-BLNBK4MH.js +0 -17
- package/dist/spawner-C7NLLM4F.js +0 -2
- package/dist/store-choice-3OJCV26J.js +0 -2
- package/dist/store-guard-OOSDLMEC.js +0 -2
- package/dist/stream-warnings-GEQKKJU7.js +0 -2
- package/dist/sync-cmd-RDFDMVKQ.js +0 -2
- package/dist/tcg-generate-KIECTZ2C.js +0 -2
- package/dist/testmd-actions-CMAG6HWI.js +0 -2
- package/dist/tms-client-NXAB6VJD.js +0 -2
- package/dist/token-refresh-KP3AYMYK.js +0 -2
- package/dist/verdicts-XK3GAUX3.js +0 -2
- package/dist/with-telemetry-PM2HVN2B.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as
|
|
2
|
+
import{a as n}from"./chunk-RQKMSNEU.js";import{a as i}from"./chunk-4C7WVQOD.js";import{c as o}from"./chunk-ZCRZFAOT.js";import{appendFileSync as c,mkdirSync as a,readFileSync as f,statSync as u,writeFileSync as m}from"fs";import{dirname as p}from"path";var d=64*1024;function I(r){let t=o(r,"runs");return s=>{try{if(a(p(t),{recursive:!0}),(u(t,{throwIfNoEntry:!1})?.size??0)>d){let e=f(t,"utf8");m(t,e.slice(e.indexOf(`
|
|
3
3
|
`,e.length/2)+1))}c(t,`${new Date().toISOString()} ${n()} ${s}
|
|
4
4
|
`)}catch{}}}var h=r=>{if(!(r instanceof i))return r instanceof Error?r.message:String(r);let t=r.requestId;return`${r.code}: ${r.message}${typeof t=="string"&&t?` (request ${t})`:""}`};export{I as a,h as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{a as X,c as oe}from"./chunk-ZMWTRXFH.js";import{b as ae}from"./chunk-I6S6DZ2E.js";import{a as ie,b as W,c as B,d as F,e as V,f as M,g as J,h as S}from"./chunk-LTPOMMAB.js";import{a as re}from"./chunk-HD6NR44L.js";import{M as L,R as ne,S as se,xb as P}from"./chunk-PI7OXS62.js";import{f as k,g as q}from"./chunk-KU3YHPWZ.js";import{d as Q,o as $}from"./chunk-HYJVYYAZ.js";function I(e,t){(e.err??e.out)(`error: ${t}`)}function Y(e,t){let n=e.nameOf.get(t);if(n)return n;for(let[i,r]of e.names)if(e.tipOf(r)===t)return i;return t}function fe(e,t){return{ucTip:t,display:Y(e,t),seamRef:e.nameOf.get(t)??t}}function ye(e,t){let n=e.resolve(t);if(!n)return{ok:!1,message:`unknown ref '${t}' \u2014 no test/scenario/ac/use-case by that id or cid`};let i=n.tip,r=e.nodeLabel.get(i);if(!r||!W.has(r))return{ok:!1,message:`'${t}' is a ${r??"missing node"} \u2014 evolve takes a test, scenario, acceptance criterion, or use-case`};let o=F(e,i,r);return!o||e.nodeLabel.get(o)!==k.USECASE?{ok:!1,message:`cannot resolve '${t}' to a parent use-case \u2014 its ${r} chain is broken`}:e.superseded.has(o)?{ok:!1,message:`use-case ${Y(e,o)} was removed \u2014 nothing to evolve`}:e.trust.get(o)==="archived"?{ok:!1,message:`use-case ${Y(e,o)} was archived \u2014 nothing to evolve`}:{ok:!0,target:fe(e,o)}}function We(e,t){return j(e,t)}function j(e,t){let n=[];for(let{cid:r}of e.byLabel(k.SCENARIO)){if(!B(e,r)||!e.edgesFrom(r).some(s=>s.type===q.BELONGS_TO&&e.tipOf(s.dst)===t))continue;let o=e.edgesInto(r).filter(s=>s.type===q.AUTOMATES&&B(e,s.src));if(o.length===0)n.push({scenario:r,test:null});else for(let s of o)n.push({scenario:r,test:s.src})}let i=new Map;for(let{cid:r}of e.byLabel(k.AC)){if(!B(e,r)||F(e,r,k.AC)!==t)continue;let o=e.edgesInto(r).filter(s=>s.type===q.VERIFIES&&B(e,s.src)).map(s=>s.src).sort();i.set(r,o)}return{pairs:n,verifies:i}}function be(e,t){let n=s=>`${s.scenario}\0${s.test??""}`,i=new Set(e.pairs.map(n)),r=new Set(t.pairs.map(n)),o=[];for(let[s,a]of e.verifies){let l=t.verifies.get(s);l&&(a.length===l.length&&a.every((d,_)=>d===l[_])||o.push({ac:s,before:a,after:l}))}return{superseded:e.pairs.filter(s=>!r.has(n(s))),minted:t.pairs.filter(s=>!i.has(n(s))),retained:t.pairs.filter(s=>i.has(n(s))),moves:o}}function we(e,t,n,i,r){let o=a=>t.nameOf.get(a)??a,s=a=>` - ${o(a.scenario)} \xB7 ${a.test?o(a.test):"(no test)"}`;e.out(`evolved: use-case ${n} \u2014 design record ${i.before} \u2192 ${i.after}`),e.out(` superseded ${r.superseded.length} pair(s)`);for(let a of r.superseded)e.out(s(a));e.out(` minted ${r.minted.length} pair(s)`);for(let a of r.minted)e.out(s(a));e.out(` retained ${r.retained.length} pair(s)`);for(let a of r.retained)e.out(s(a));if(r.moves.length===0)e.out(" verifies none moved");else{e.out(" verifies moved:");for(let a of r.moves){let l=d=>d.length>0?d.map(o).join(" + "):"(none)";e.out(` - ${o(a.ac)}: ${l(a.before)} \u2192 ${l(a.after)}`)}}}async function ge(e,t,n,i,r,o,s,a){let l=L(e),d=S(l,t.ucTip);if(!d)return o==="batch"?(i.out($().text("note.no_design_skipped",{use_case:t.display})),a?.({type:"evolve_skipped",use_case:t.display,reason:"no-design"}),{code:0,outcome:"no-design"}):(I(i,$().text("note.no_design",{use_case:t.display})),{code:2,outcome:"no-design"});let _=j(l,t.ucTip),v=[`evolve ${t.display}`,` re-designs use-case ${t.display}`,` affects ${_.pairs.length} pair(s)`,...n.because?[` because ${n.because}`]:[]];if(n.yes)for(let p of v)i.out(p);else{for(let c of v)i.out(c);let p=n.confirm?await n.confirm():await i.confirm(`proceed with the re-design of ${t.display}?`)?"proceed":"decline";if(p==="defer")return i.out(`deferred: the re-design of ${t.display} waits for an answer \u2014 nothing evolved`),{code:3,outcome:"deferred"};if(p==="decline")return i.out(o==="batch"?`skipped ${t.display}`:"declined \u2014 nothing evolved"),{code:0,outcome:"declined"}}let E=t.named?Ce(t.named):void 0,x=oe(e,l,t.ucTip,n.because,E),R=t.named?Re(l,t.named,t.display,n.because,t.ucTip):void 0,D=!1,O,h=p=>{p.type==="nothing_to_change"&&(D=!0,typeof p.note=="string"&&(O=p.note)),a?.(p)},y=await re(s,{verb:"evolve",subject:t.display},()=>r(t.seamRef,{yes:!!n.yes,...n.mode?{mode:n.mode}:{},...n.because?{because:n.because}:{},...x!==void 0?{changeDelta:x.change_delta,priorDesign:x.prior_design}:{},onChildEvent:h,...R?{statement:R}:{},...n.repin?{repinsKept:!0}:{}}),p=>({ok:p===0,exitCode:p}));if(y===3)return i.out($().text("note.design_paused",{use_case:t.display})),{code:y,outcome:"paused"};if(y!==0)return I(i,`design run for ${t.display} ended with exit code ${y} \u2014 no diff to report`),{code:y,outcome:"failed"};let u=L(e),b=u.tipOf(t.ucTip),w=S(u,b)?.seq,T={before:d.seq,after:w??"?"},A=be(_,j(u,b)),C=n.sourceChanged?{source_changed:n.sourceChanged}:{};if(D&&w===d.seq){let p=n.repin?_e(e,b,n.repin.by,i,t.display):void 0;return i.out(`unchanged: use-case ${t.display} \u2014 the design agent found nothing to change`),a?.({...ue(u,t.display,T,A),nothing_to_change:!0,...O?{note:O}:{},...p?{repinned:p}:{},...C}),ce(i,t.display,n.sourceChanged),{code:0,outcome:"unchanged"}}return we(i,u,t.display,T,A),a?.({...ue(u,t.display,T,A),...C}),ce(i,t.display,n.sourceChanged),{code:0,outcome:"evolved"}}function _e(e,t,n,i,r){let o=ie({store:e,graph:L(e),ucTip:t,by:n});if(o.errors){i.err?.(`the tests of ${r} couldn't be marked up to date: ${o.errors.map(a=>a.detail).join("; ")}`);return}let s=L(e);if(!(o.moved===0||V(s,t)))return{tests:H(s,t).total}}function ce(e,t,n){n&&e.out($().text("note.source_changed_after",{use_case:t,review:z(n)}))}var z=e=>e.next&&e.next.length>0?e.next.map(t=>t.cmd).join(" and "):null;function Ee(e,t){return n=>{let r=L(e).heads.get(n),o=r?[...e.recordsSince(null)].reverse().find(l=>l.source_head_moves?.[n]===r):void 0,s=o?e.tokenAt(o.seq):null,a=s?e.intentOf(s)?.args?.label:void 0;return{cmd:$().command("next.review_source",{source_id:n,from:typeof a=="string"?a:null,agent_mode:t})}}}function $e(e){let t=new Map,n=0;for(let{cid:r,state:o}of e.staleList()){if(o==="superseded")continue;let s=e.nodeLabel.get(r);if(!s||!W.has(s)||!B(e,r)||!P(e,r))continue;let a=F(e,r,s);!a||e.nodeLabel.get(a)!==k.USECASE||!B(e,a)||(n++,t.has(a)||t.set(a,fe(e,a)))}return{targets:[...t.values()].sort((r,o)=>r.display<o.display?-1:r.display>o.display?1:0),staleCount:n}}function xe(e,t,n){let i=e.map(s=>t(s,n)),r=i.flatMap(s=>s.cmd?[{cmd:s.cmd,why:"review its source's change"}]:[]),o=i.flatMap(s=>s.remedy?[s.remedy]:[]).join(`
|
|
3
3
|
`);return{...r.length>0?{next:r}:{},...o?{remedy:o}:{}}}var pe={[k.TEST]:"test",[k.SCENARIO]:"scenario",[k.AC]:"ac",[k.USECASE]:"usecase"},ve={test:"test",scenario:"scenario",ac:"acceptance criterion",usecase:"use-case"},de=120;function Oe(e,t){let n=e.resolve(t);if(!n)return null;let i=pe[e.nodeLabel.get(n.tip)??""];if(!i)return null;let r=e.getNode(n.tip)?.content??{},o=i==="ac"?r.text:r.title,s=typeof o=="string"?o.replace(/[\u0000-\u001f\u007f]+/g," ").trim():"",a=Array.from(s),l=a.length===0?void 0:a.length>de?`${a.slice(0,de-1).join("")}\u2026`:s,d=e.superseded.has(n.tip)?"removed":e.trust.get(n.tip)==="archived"?"archived":void 0;return{ref:e.nameOf.get(n.tip)??e.displayNameOf(n.tip)??t,label:i,...l?{title:l}:{},cid:n.tip,...d?{dead:d}:{}}}function Ce(e){if(!e.dead)return{ref:e.ref,label:e.label,...e.title?{title:e.title}:{}}}function ke(e,t,n){let i=[];for(let{cid:r,state:o}of e.staleList()){if(o==="superseded"||r===n)continue;let s=e.nodeLabel.get(r),a=pe[s??""];if(!s||!a||!B(e,r)||!P(e,r)||F(e,r,s)!==t)continue;let l=X(e,r);if(!l)continue;let d=e.nameOf.get(r)??e.displayNameOf(r)??r;i.push({display:d,text:`${ve[a]} ${d} \u2014 ${l}`})}return i.sort((r,o)=>r.display<o.display?-1:r.display>o.display?1:0),i[0]?.text??null}var Se=`Judge the scope yourself: change what this genuinely affects and leave the rest as designed.
|
|
4
4
|
If it is ambiguous what should change, ask before changing anything.`;function Re(e,t,n,i,r){let o=t.label==="usecase"?"":` in use-case ${n}`,s=[t.title?`"${t.title}"`:"",t.dead?`${t.dead} earlier`:""].filter(Boolean).join(", "),a=`[kane] evolve started on ${ve[t.label]} ${t.ref}${s?` (${s})`:""}${o}.`,l=i?.trim(),d=l||t.dead?void 0:X(e,t.cid),_=l?void 0:d??(r?ke(e,r,t.cid):null),v=l?`Because: ${l}`:_?`Stale: ${_}`:null;return[a,v,Se].filter(E=>E!==null).join(`
|
|
5
5
|
`)}function ue(e,t,n,i){let r=s=>e.nameOf.get(s)??s,o=s=>({scenario:r(s.scenario),test:s.test?r(s.test):null});return{type:"evolve_diff",use_case:t,generation:n,superseded:i.superseded.map(o),minted:i.minted.map(o),retained:i.retained.map(o),moves:i.moves.map(s=>({ac:r(s.ac),before:s.before.map(r),after:s.after.map(r)}))}}function H(e,t){let n=j(e,t).pairs.flatMap(r=>r.test!==null?[{test:r.test,scenario:r.scenario}]:[]);return{touched:n.filter(({test:r,scenario:o})=>P(e,r)||P(e,o)||e.edgesFrom(r).some(s=>s.type===q.VERIFIES&&P(e,s.dst))).length,total:n.length}}async function Ve(e,t,n){let{io:i,asks:r,runDesign:o,emit:s}=n,a=t.because,l=n.onChild??(s?De(s):void 0);i.out(`evolving ${t.ref??"stale use-cases"}: reading the graph\u2026`);let d=L(e),_=t.ref!==void 0?se(d,t.ref):null;if(_!==null)return I(i,_),2;let v=t.ref!==void 0?ne(d,t.ref):void 0,E="given"in r.blast?r.blast:null,x=n.words?.review??Ee(e,t.mode==="agent"),R=(c,f)=>xe(c,x,f),D=c=>{let{sources:f}=M(d,c.ucTip);return f.length>0?R(f,c.ucTip):void 0},O=(c,f)=>n.words?n.words.question(c,H(d,c.ucTip),a,v===void 0):le(c,f,a),h,y,u=[],b=()=>{for(let{target:c,review:f}of u)i.out($().text("note.source_changed_skipped",{use_case:c.display,review:z(f)})),s?.({type:"evolve_skipped",use_case:c.display,reason:"source_changed",...f})};if(v){let c=ye(d,v);if(!c.ok)return I(i,c.message),2;let f=M(d,c.target.ucTip);if(!a&&S(d,c.target.ucTip)&&J(f)){let m=R(f.sources,c.target.ucTip);return I(i,$().text("note.source_changed",{use_case:c.target.display,review:z(m)})),s?.({type:"evolve_skipped",use_case:c.target.display,reason:"source_changed",...m}),2}if(!a&&S(d,c.target.ucTip)&&!V(d,c.target.ucTip)){let m=r.because?await r.because(c.target.display):void 0;if(m!==null&&typeof m=="object")return i.out(`deferred: the reason to re-design ${c.target.display} waits for an answer \u2014 nothing evolved`),s?.({type:"evolve_paused",pending_because:c.target.display}),3;let N=m?.trim();if(!N)return I(i,$().text("note.nothing_changed",{ref:v})),2;a=N}let g=Oe(d,v);h=[{...c.target,ref:v,...g?{named:g}:{}}]}else{let{targets:c,staleCount:f}=$e(d);if(c.length===0){let g=E?Z(E,[]):null;return g?te(i,g):(s?.({type:"evolve_batch",stale_nodes:f,use_cases:0}),i.out("nothing stale \u2014 nothing to evolve"),0)}if(i.out(`from-stale: ${f} stale node(s) \u2192 ${c.length} use-case(s)`),u=c.flatMap(g=>{let m=M(d,g.ucTip);return S(d,g.ucTip)&&J(m)?[{target:g,review:R(m.sources,g.ucTip)}]:[]}),h=c.filter(g=>!u.some(m=>m.target.ucTip===g.ucTip)),y={stale_nodes:f,use_cases:h.length},h.length===0){let g=E?Z(E,[]):null;return g?te(i,g):(b(),s?.({type:"evolve_batch",...y}),0)}}let w={...a?{because:a}:{},...t.mode?{mode:t.mode}:{},...t.yes?{yes:!0}:{},repin:{by:n.by??{kind:"human",id:"operator"}}},T=c=>{a&&e.signals().append({ts:new Date().toISOString(),command:"evolve",id:c,verdict:"gap-resolved-evolve",polarity:"preference",by:n.by??{kind:"human",id:"operator"},target:c,reason:a})};if(E)return Te({store:e,graph:d,ref:v,targets:h,batch:y,opts:w,answered:E,io:i,runDesign:o,onChild:l,emit:s,signal:T,sayLeftOut:b,reviewFor:D,question:(c,f)=>n.words?n.words.question(c,H(d,c.ucTip),w.because,v===void 0):le(c,f,w.because),...n.words?{why:n.words.answerWhy}:{}});let A=r.blast.ask,C=c=>S(d,c.ucTip)?j(d,c.ucTip).pairs.length:0;y&&(b(),s?.({type:"evolve_batch",...y}));let p=[];for(let[c,f]of h.entries()){let g=C(f);S(d,f.ucTip)&&s?.(me(f,g,a));let m=()=>A(O(f,g),f.display),N=D(f),U=await ge(e,f,{...w,confirm:m,...N?{sourceChanged:N}:{}},i,o,v?"single":"batch",l,s);if(U.outcome==="evolved"&&T(v??f.display),U.outcome==="declined"&&s?.({type:"evolve_skipped",use_case:f.display,reason:"declined"}),U.outcome==="deferred"){let he=h.slice(c).filter(K=>S(d,K.ucTip));return s?.({type:"evolve_paused",pending_questions:he.map(K=>O(K,C(K))),deferred:f.display}),ee([...p,3])}if(v)return U.code;p.push(U.code)}return ee(p)}function Z(e,t){if(e.unreadable!==void 0)return e.unreadable;for(let[n,i]of e.given){if(!t.includes(n))return`${n} is not a question this run asks \u2014 addressable: ${t.length>0?t.join(", "):"(none)"}`;if(typeof i=="object")return`'${i.invalid}' is not a choice for ${n} \u2014 use 1 or proceed, 2 or decline`}return null}async function Te(e){let{store:t,graph:n,ref:i,targets:r,batch:o,opts:s,answered:a,io:l,runDesign:d,onChild:_,emit:v,signal:E}=e,x=[],R=[];for(let u of r){if(!S(n,u.ucTip)){if(i)return I(l,$().text("note.no_design",{use_case:u.display})),2;R.push(u);continue}x.push({target:u,pairs:j(n,u.ucTip).pairs.length})}let D=Z(a,x.map(u=>G(u.target)));if(D)return te(l,D);let O=a.given;o&&(e.sayLeftOut(),v?.({type:"evolve_batch",...o}));for(let u of R)l.out($().text("note.no_design_skipped",{use_case:u.display})),v?.({type:"evolve_skipped",use_case:u.display,reason:"no-design"});for(let u of x)v?.(me(u.target,u.pairs,s.because));let h=x.filter(u=>!O.has(G(u.target)));if(h.length>0){let u=$(),b=[...O.entries()].map(([g,m])=>({id:g,choice:m})),w={...i!==void 0?{ref:i}:{},...s.because?{because:s.because}:{}},T=u.command("next.answer_evolve",{...w,answers:b}),A=g=>({...w,answers:[...b,...h.map(m=>({id:G(m.target),choice:g}))]}),C=h.length===1?`use-case ${h[0].target.display}`:`${h.length} use-cases`,p=[...O.values()].filter(g=>g==="proceed").length,c=p>0?`; the ${p} use-case(s) already answered proceed still re-design`:"",f=[Q(u,"next.answer_evolve",A("proceed"),{why:e.why?e.why("proceed",C):`re-design ${C} now \u2014 supersedes what the change touches, spends design credits${c}`,...e.why?{}:{title:p>0?"Proceed with the remaining re-design":"Proceed with the re-design"}}),Q(u,"next.answer_evolve",A("decline"),{why:e.why?e.why("decline",C):`leave ${C} as designed${c}`,...e.why?{}:{title:p>0?"Decline the remaining question(s)":"Decline"}})].filter(g=>!("cmd"in g)||ae(g.cmd));return v?.({type:"evolve_paused",pending_questions:h.map(g=>e.question(g.target,g.pairs)),...T!==null?{resume:T}:{},next:f}),3}let y=[];for(let{target:u}of x){if(O.get(G(u))==="decline"){l.out(i?"declined \u2014 nothing evolved":`skipped ${u.display}`),v?.({type:"evolve_skipped",use_case:u.display,reason:"declined"});continue}let b=e.reviewFor(u),w=await ge(t,u,{...s,yes:!0,...b?{sourceChanged:b}:{}},l,d,i?"single":"batch",_,v);w.outcome==="evolved"&&E(i??u.display),y.push(w.code)}return ee(y)}function ee(e){let t=e.find(n=>n!==0&&n!==3);return t!==void 0?t:e.includes(3)?3:0}function te(e,t){return e.err?e.err(`error: ${t}`,"ANSWER_USAGE"):e.out(`error: ${t}`),2}function G(e){return`evolve:${e.display}`}function me(e,t,n){return{type:"evolve_target",...e.ref!==void 0?{ref:e.ref}:{},use_case:e.display,pairs:t,...n?{because:n}:{}}}function le(e,t,n){return{id:G(e),header:"Re-design?",text:`Re-design use-case ${e.display}? ${t} scenario/test pair(s) are affected${n?` \u2014 because: ${n}`:""}.`,risk:"med",rationale:"evolve re-designs the whole parent use-case: what the change touches is superseded, the rest is re-emitted verbatim; the run spends design credits",options:[{label:"proceed",detail:`re-design use-case ${e.display} now (${t} pair(s) affected)`},{label:"decline",detail:"leave the current design as it is"}],recommended_index:0,allow_free_text:!1}}function De(e){return t=>{t.kind==="start"?e({type:"child_start",child:"design",subject:t.subject}):t.kind==="end"&&e({type:"child_end",ok:t.ok,dur_s:t.durS,...t.exitCode!==void 0?{exit_code:t.exitCode}:{}})}}export{ye as a,We as b,ge as c,$e as d,xe as e,Oe as f,Se as g,Re as h,Ve as i,G as j};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{g as A,h as _}from"./chunk-
|
|
2
|
+
import{g as A,h as _}from"./chunk-PC22QRIY.js";import{b as N}from"./chunk-75FF7J5R.js";import{d as b,i as h}from"./chunk-Z7S3IWUX.js";import{a as F,c as x,e as k}from"./chunk-2XW33VOK.js";import{a as $,b as T,c as D,d as I,f as v,h as g,i as V,l as m,q as P,t as y,u as w}from"./chunk-A7RJQJNT.js";function E(e,n){return e.kind==="app_id"?!0:n==="emulator"?e.kind==="apk":e.kind==="zip"}function S(e){let n=e.deviceName,i=e.osVersion;return n!==void 0&&n.trim()===""||i!==void 0&&i.trim()===""?{ok:!1,message:"--device-name and --os-version cannot be empty."}:{ok:!0,...n!==void 0?{name:n.trim()}:{},...i!==void 0?{osVersion:i.trim()}:{}}}function C(e){return`--device-name needs an OS version \u2014 a bare name matches every runtime that ships it.
|
|
3
3
|
Provide one: ${e}`}function R(e,n,i){let t=_(e);return t?E(t,n)?null:n==="emulator"?`${i} cannot run on an emulator (needs an .apk, or an APP\u2026 id).`:`${i} cannot run on a simulator (needs a .zip of the .app bundle, or an APP\u2026 id).`:`${e}: ${A}`}function M(e){return D(e)?e:null}function O(e){return`--target must be one of ${$.join(", ")} (got "${e}")`}function L(e){let n=[];for(let[i,t]of[["--device-name",e.deviceName],["--os-version",e.osVersion],["--app",e.app]])t!==void 0&&n.push(`ignored ${i} ${t}: session target is desktop \u2014 set --target ${T.join("|")} to run on a device`);return n}function W(e){let{flags:n,saved:i}=e,t=[],a;if(n.target!==void 0){let r=M(n.target);if(!r)return{kind:"invalid",message:O(n.target)};a=r}else{let r=F(i?.tui_target,i?.default_target?.kind);if(r.kind==="choose-mobile")return{kind:"choose-mobile-kind"};a=r.kind==="unset"?"desktop":r.kind}if(a==="desktop")return t.push(...L(n)),{kind:"web",warnings:t};if(v(a))return B(a,n,i,t);if(!e.host.supported)return{kind:"invalid",message:e.host.reason??"this machine cannot run mobile targets."};let s=[],o,d,c=S(n);if(!c.ok)return{kind:"invalid",message:c.message};let p=i?.default_target&&i.default_target.kind===a?b(i.default_target):void 0;if(c.name!==void 0||c.osVersion!==void 0){let r=c.name??p?.name,l=c.osVersion??p?.osVersion;if(l===void 0)return{kind:"invalid",message:C("--os-version <version>, or save one (kane-cli config set-os-version)")};d={...r!==void 0?{name:r}:{},osVersion:l},o={value:r?`${r} (${l})`:`any device on ${l}`,source:"flag"}}else if(i?.default_target&&i.default_target.kind===a&&(b(i.default_target)!==void 0||i.default_target.id!==void 0))o={value:h(i.default_target)??"(saved device)",source:"saved"};else{if(i?.default_target&&i.default_target.kind!==a&&(b(i.default_target)!==void 0||i.default_target.id!==void 0))return{kind:"invalid",message:`Your saved device '${h(i.default_target)}' is ${i.default_target.kind==="simulator"?"a simulator":"an emulator"}, but this run targets ${a==="simulator"?"a simulator":"an emulator"}. Pass --device-name and --os-version, or update your config (set-target, set-device-name, set-os-version).`};s.push("device")}let u;if(n.app!==void 0){let r=R(n.app,a,`--app ${n.app}`);if(r)return{kind:"invalid",message:r};u={value:n.app,source:"flag"}}else{let r=i?.default_app,l=r?_(r):null;l&&E(l,a)&&i?.default_target?.kind===a?u={value:r,source:"saved"}:s.push("app")}return{kind:"mobile",target:a,...d?{deviceSelector:d}:{},...o?{device:o}:{},...u?{app:u}:{},missing:s,warnings:t}}function K(e,n,i){let t=e.trim();return N(t)||y(n,t)?null:`${i} cannot run on ${m(n)} \u2014 use ${w(n)} file, or an ${V(g(n))} app ID from \`kane-cli apps list --target ${n}\`.`}function j(e,n,i){let t=S(e);if(!t.ok)return{ok:!1,message:t.message};let a=(u,r)=>{if(u!==void 0)return{value:u,source:"flag"};let l=r?.trim();return l?{value:l,source:n.source}:void 0},s=a(t.name,n.device_name),o=a(t.osVersion,n.os_version),d=a(e.app,n.app),c=d?.source==="flag"?`--app ${d.value}`:d?.source==="file"?`the file's app: ${d?.value}`:`your saved app ${d?.value}`,p=d?K(d.value,i,c):null;return{ok:!0,...s?{deviceName:s}:{},...o?{osVersion:o}:{},...d?{app:d}:{},...p?{appProblem:p}:{}}}function Z(e,n,i){return v(e)?K(n,e,i):R(n,e,i)}function G(e,n,i){let t=j(e,n.target===i?{source:"file",device_name:n.device_name,os_version:n.os_version,app:n.app}:{source:"file"},i);if(!t.ok)return t;if(!t.app)return{ok:!1,message:`no app for this real-device test \u2014 add \`app: <path-to-build | AppId>\` to the file, or pass --app. See your uploads: kane-cli apps list --target ${i}`};if(t.appProblem)return{ok:!1,message:t.appProblem};let{deviceName:a,osVersion:s,app:o}=t;return{ok:!0,selection:{...a?{deviceName:a}:{},...s?{osVersion:s}:{},app:o}}}function B(e,n,i,t){let a=x(i,e),s=j(n,{source:"saved",device_name:a.deviceName,os_version:a.osVersion,app:a.app},e);if(!s.ok)return{kind:"invalid",message:s.message};if(s.appProblem&&s.app?.source==="flag")return{kind:"invalid",message:s.appProblem};let o=s.appProblem?void 0:s.app;return{kind:"real-device",target:e,platform:g(e),...s.deviceName?{deviceName:s.deviceName}:{},...s.osVersion?{osVersion:s.osVersion}:{},...o?{app:o}:{},missing:o?[]:["app"],warnings:s.appProblem?[...t,s.appProblem]:t}}function z(e){let n=[];for(let[i,t]of[["--device-name",e.deviceName],["--os-version",e.osVersion],["--app",e.app]])t!==void 0&&n.push(`ignored ${i} ${t}: a real-device run takes its device and app from the run's device config`);return n}function H(e){return`this run was given a device config (KANE_CLI_DEVICE_CONFIG), so it runs on a real device, but the test file ${e?`has \`target: ${e}\``:"has no `target:` (a web test)"} \u2014 only a \`target: android\` or \`target: ios\` test runs on a real device.`}function ee(e){let{flags:n,file:i}=e,t=[],a=I(i.target)?i.target:void 0,s;if(n.target!==void 0){let r=M(n.target);if(!r)return{kind:"invalid",message:O(n.target)};s=r;let l=a;l&&l!==s&&t.push(`--target ${s} overrides the file's \`target: ${l}\` \u2014 steps recorded on ${m(l)} may not replay here`)}else s=a??"desktop";if(v(s)){if(e.deviceConfig)return t.push(...z(n)),{kind:"real-device",platform:g(s),warnings:t};let r=G(n,i,s);return r.ok?{kind:"real-device",platform:g(s),selection:r.selection,warnings:t}:{kind:"invalid",message:r.message}}if(s!=="desktop"&&e.grid)return{kind:"invalid",message:`KANE_CLI_GRID is set, which works only for real-device tests (\`target: android\` / \`target: ios\`), and this test targets ${m(s)}. Unset KANE_CLI_GRID and try again.`};if(e.deviceConfig)return{kind:"invalid",message:H(i.target)};if(s==="desktop")return t.push(...L(n)),{kind:"web",warnings:t};let o=S(n);if(!o.ok)return{kind:"invalid",message:o.message};let d=o.name??(i.device_name?.trim()||void 0),c=o.osVersion??(i.os_version?.trim()||void 0);if(d!==void 0&&c===void 0)return{kind:"invalid",message:C("--os-version <version>, or os_version: in the test file")};let p=c!==void 0?{...d!==void 0?{name:d}:{},osVersion:c}:void 0;if(s==="simulator"&&p&&p.name===void 0&&t.push(`the file names no device_name \u2014 any simulator on ${c} may be used. Add device_name: to the file (or pass --device-name) to pin the device.`),n.app!==void 0){let r=R(n.app,s,`--app ${n.app}`);if(r)return{kind:"invalid",message:r}}else if(i.app){let r=R(i.app,s,`the file's app: ${i.app}`);if(r)return{kind:"invalid",message:r}}let u=n.app??(i.app||void 0);return{kind:"mobile",target:s,platform:g(s)??"",...u?{app:u}:{},...p?{deviceSelector:p}:{},...i.no_reset!==void 0?{noReset:i.no_reset}:{},warnings:t}}function ne(e){return e.target==="desktop"?"Running on: Desktop \xB7 Chrome":`Running on: ${k(e.target)} \xB7 ${e.deviceLabel} \xB7 ${e.appLabel}`}function f(e){return`</path/to/app${P(e)[0]} | AppId>`}function ie(e){return{type:"error",code:"APP_NOT_SET",message:`no app is set for this ${k(e).toLowerCase()} run`,remedy:`name the app under test with --app ${f(e)}, or for every run with kane-cli config set-app ${f(e)}`,next:[{cmd:`kane-cli apps list --target ${e} --agent`,why:"lists the builds you've uploaded, to name one with --app"}]}}function te(e,n){let i=k(e).toLowerCase();return n==="device"?[`session target is "${i}" but no device is set.`,` See devices: kane-cli devices list --target ${e}`,' Set one: kane-cli config set-device-name "<name>" && kane-cli config set-os-version "<version>"',' Or per-run: --device-name "<name>" --os-version "<version>"'].join(`
|
|
4
4
|
`):[`session target is "${i}" but no app is set.`,` Set one: kane-cli config set-app ${f(e)}`,` Or per-run: --app ${f(e)}`].join(`
|
|
5
5
|
`)}function se(e){return[`saved device "${e}" was not found on this machine.`," See devices: kane-cli devices list",' Set one: kane-cli config set-device-name "<name>" && kane-cli config set-os-version "<version>"'].join(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as we}from"./chunk-
|
|
3
|
-
`).some(l=>l.trim().length>0&&o.includes(l.trim()))}function Ae(t,e,n){let o=F(String(e.props.anchor));if(o?.kind!=="img-part")return!1;let d=(t.mediaOf(String(e.props.source_cid)).images??[]).find(l=>l.ref===o.ref),r=d?.blob;if(r===void 0)return!1;let s=t.mediaOf(n).images??[];if(s.some(l=>l.blob===r))return!0;let a=d?.appearance;return a!==void 0&&s.filter(l=>l.appearance===a).length===1}function Pe(t,e,n={}){let o=n.now??new Date,i=t.sessions(),d=[],r=0;for(let s of i.list())if(s.sid!==n.except){if(s.corrupt){r+=1;continue}try{let a=i.peek(s.sid);if(!a||Z(a,o))continue;let l=a.pending.proposals.some(m=>(m.content?._held?.source_id??null)===e),p=a.reconcile!=null&&e in a.read_basis&&B(t,a.reconcile.proposal_id).resolved!==!0;(l||p)&&d.push(a.sid)}catch{r+=1}}return{holders:d,corrupt:r}}async function at(t,e){let{holders:n,corrupt:o}=Pe(t,e.sourceId,{...e.now?{now:e.now}:{},...e.sessionId?{except:e.sessionId}:{}});if(o>0)return{kind:"unverifiable",corrupt:o};if(n.length>0)return{kind:"held",holders:n};if((await e.reingest(e.sourceId)).status==="unchanged")return{kind:"unchanged"};let d=G(t,e.sourceId);return d.kind==="ok"?{kind:"landed",changeContext:d.changeContext}:d}function $e(t,e,n){let o=t.getNode(e)?.content??{},i=t.getNode(n)?.content??{},r=[...new Set([...Object.keys(o),...Object.keys(i)])].sort().filter(s=>JSON.stringify(o[s])!==JSON.stringify(i[s]));return r.length>0?`updated: ${r.join(", ")}`:"updated"}function Ve(t,e,n,o,i,d,r){let s=new Set((r?.rows??[]).map(f=>f.matched_cid).filter(f=>!!f)),a=[];for(let[f,h]of n.superseded)h===null||f===h||e.superseded.has(f)||n.nodeLabel.get(f)===w.USECASE&&a.push({kind:"MODIFY",ref:k(n,f),old_cid:f,new_cid:h,summary:$e(n,f,h)});let l=d.map(f=>({kind:"ADD",ref:k(n,f),cid:f}));for(let f of r?.rows??[])f.kind==="MODIFY"&&f.matched_cid?a.push({kind:"MODIFY",ref:k(n,f.matched_cid),old_cid:f.matched_cid,new_cid:null,summary:`${f.why} (staged)`}):f.kind==="ADD"&&l.push({kind:"ADD",ref:f.title,cid:null});let p=[],m=V(t,n,i),g=new Map;for(let{cid:f}of n.byLabel(w.USECASE)){if(!N(n,f)||s.has(f))continue;let h=n.derivesInto(f),y=h.filter(c=>String(c.props.source_id)===o);if(y.length===0)continue;let S=j(n,f,o);S!==null&&!S.stale||y.some(c=>c.props.source_cid===i)||y.some(c=>{let _=String(c.props.anchor),x=F(_);return x?.kind==="img-whole"?!1:x?.kind==="img-part"?Ae(n,c,i):m!==null&&Ie(t,n,c,m,g)})||h.some(c=>{let _=String(c.props.source_id);if(_===o)return!1;let x=n.heads.get(_);return x!=null})||p.push({kind:"ARCHIVE",ref:k(n,f),cid:f,why:`evidence decayed: no quote from ${o} relocates into @${b(i)}, no other live source, no fresh evidence this run`,impact:Re(n,n.tipOf(f))})}let u=(f,h)=>f.ref<h.ref?-1:f.ref>h.ref?1:0;return[...a.sort(u),...l.sort(u),...p.sort(u)]}function lt(t,e,n,o,i){let d=e.rows.find(u=>u.temp_ref===n);if(!d)return{ok:!1,message:`held item ${n} missing from the plan artifact`};let r=d,s=E(t);if(r.matched_cid){let u=s.tipOf(r.matched_cid);if(s.superseded.get(u)===null)return{ok:!1,message:`use-case for "${r.title}" was retired meanwhile \u2014 nothing to update`};u!==r.matched_cid&&(r={...r,matched_cid:u,uc:{...r.uc,matches_existing:{cid:u}}})}let a=i?{edited:i}:"approve",l=De(t,s,{source_id:e.source_id,...e.staged_source_cid!==void 0?{staged_source_cid:e.staged_source_cid}:{},rows:[r]},new Map([[r.temp_ref,a]]),o);if(l.errors)return{ok:!1,message:l.errors.map(u=>`${u.code}: ${u.detail}`).join("; ")};let p=E(t),m=r.matched_cid?p.tipOf(r.matched_cid):l.record?.nodes.find(u=>u.label==="usecase")?.cid??l.record?.review[0]?.id;return{ok:!0,ref:m?k(p,m):r.title,kind:r.kind}}async function ut(t,e,n,o={}){let i=E(t);t.prefetch(fe(i,e),{token:null});let d=i.heads.get(e)??null,r=new Set(i.staleList().filter(c=>c.state==="stale").map(c=>c.cid)),s=await n.reingest(e);if(s.status==="unchanged"&&!o.resumeHeld&&!o.reextractUnchanged)return{source_id:e,changed:!1,head:{status:s.status,before:d,after:s.cid},note:`nothing to reconcile \u2014 ${e} is unchanged`,skipped_arms:ke,changeset:[],rows:[]};let a=o.resumeHeld?{minted:[],matched:[],held:o.resumeHeld}:await n.reextract(e),l=E(t),p=a.minted.map(c=>{let _=k(l,c);return{kind:"ADD",origin:"content-change",ref:_,reason:`new use-case extracted from ${e}`,provenance:`extraction commit \u2014 DERIVES ${e} @ ${b(s.cid)}`,action:`kane-cli design tests --use-case ${_}`}}),m=l.staleList().filter(c=>c.state==="stale"&&!r.has(c.cid)&&N(l,c.cid)).map(c=>c.cid),g=m.map(c=>{let _=k(l,c),x=xe.has(l.nodeLabel.get(c)??"");return{kind:"MODIFY",origin:"structural-stale",ref:_,reason:"stale (structural)",provenance:Se(l,c),action:x?`kane-cli maintain evolve ${_}`:`kane-cli design explain ${_}`}}),u=[],f=[];for(let c of a.held?.rows??[])if(c.kind==="ADD")u.push({kind:"ADD",origin:"content-change",ref:c.title,held_ref:c.temp_ref,reason:`${c.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${e} @ ${b(s.cid)}`,action:"approve to commit + design"});else{let _=c.matched_cid?l.tipOf(c.matched_cid):null,x=_?l.getNode(_)?.content.criteria??[]:[],J=(c.uc.updated?.criteria??[]).map(O=>typeof O=="string"?O:O.text),be=[...J.filter(O=>!x.includes(O)),...c.uc.updated?.criteria!==void 0?x.filter(O=>!J.includes(O)):[]],Q=_?Re(l,_,be):void 0;f.push({kind:"MODIFY",origin:"content-change",ref:c.matched_cid?k(l,c.matched_cid):c.title,held_ref:c.temp_ref,reason:`${c.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${e} @ ${b(s.cid)}`,action:"approve to commit the updated version (old\u2192new redirect)",...Q?{impact:Q}:{}})}let h=new Set;for(let c of[...a.minted,...a.matched])h.add(l.tipOf(c));for(let c of a.held?.rows??[])c.matched_cid&&h.add(l.tipOf(c.matched_cid));for(let c of m){let _=M(l,l.tipOf(c));_&&l.nodeLabel.get(_)===w.USECASE&&h.add(l.tipOf(_))}let y=[];for(let c of await pe(l,"design")){if(c.kind!=="no-verifies")continue;let _=l.resolve(c.ref);if(!_)continue;let x=M(l,_.tip);!x||!h.has(l.tipOf(x))||y.push({kind:"ADD",origin:"content-change",ref:c.ref,reason:c.why,provenance:`gaps engine (design) \u2014 uncovered AC of touched use-case ${k(l,x)}`,action:c.ready_command})}let S=[];for(let{cid:c}of l.byLabel(w.USECASE))N(l,c)&&l.stale(c)==="orphaned"&&S.push({kind:"REMOVE",ref:k(l,c),reason:"orphaned \u2014 no live source evidences this use-case",provenance:Se(l,c),action:"plan-only \u2014 REMOVE is not executed in this release"});let v=new Set,R=[...p.sort(L),...u.sort(L),...y.sort(L),...f.sort(L),...g.sort(L),...S.sort(L)].filter(c=>{let _=`${c.kind}\0${c.ref}`;return v.has(_)?!1:(v.add(_),!0)});return{source_id:e,changed:!0,head:{status:s.status,before:d,after:s.cid},note:Le,skipped_arms:ke,changeset:Ve(t,i,l,e,s.cid,a.minted,a.held),rows:R,...a.held?{held:a.held}:{}}}function ft(t,e){return async n=>{let{ingestFile:o}=await import("./ingest-PDGS5ZTL.js"),{convertPdf:i}=await import("./pdf-convert-447ACUB3.js"),{convertDocx:d}=await import("./docx-convert-6IZO5P5K.js"),r=await o({store:t,filePath:e,asId:n,converters:{pdf:i,docx:d}});return{status:r.status,cid:r.cid}}}function pt(t,e,n,o={}){return async i=>{let{ingestThroughPlugin:d}=await import("./lane-AQYRIW24.js"),r=await d({store:t,plugin:e,ref:n,named:o.named??!1,asId:i,...o.connect?{connect:o.connect}:{},...o.registry?{registry:o.registry}:{}});return{status:r.status,cid:r.cid}}}function gt(t,e,n,o,i){return async()=>{let r=(i??(await import("./dispatch-DVQ3H7EJ.js")).findProvider)(e);if(!r)throw new Error(`the remote re-ingest failed \u2014 no provider matches '${e}'`);let s=await r.ingest(e,void 0,{out:n.out,err:n.err,confirm:async()=>!0,isTTY:!1},t,{credentials:o});if(s.code!==0||!s.result)throw new Error("the remote re-ingest failed \u2014 fix the reported problem and re-run");return{status:s.result.status,cid:s.result.source_cid}}}function mt(t,e){return async n=>{let o=[],[{runExtract:i},{resolveAgentAuthEnv:d},{runAgent:r},{preflightTurn:s}]=await Promise.all([import("./run-5RQUCNYP.js"),import("./spawner-C7NLLM4F.js"),import("./bridge-T6QMYKED.js"),import("./turn-preflight-LHYLRL7G.js")]),a=await d(e.credentials),l=new Set(E(t).byLabel(w.USECASE).map(v=>v.cid)),p=U(t,n)??void 0,m=0,g=await i({mode:"override",source:n,...p?{changeContext:p}:{}},{agent:r,store:t,credentials:e.credentials,onIngestRefusal:e.onIngestRefusal,preflightTurn:()=>s(a),ask:async()=>[],review:async v=>{if(!e.stage)return new Map(v.map(c=>[c.temp_ref,{resolution:c.matches_existing&&c.changed?"edited":"skipped"}]));let R=new Map;for(let c of v){if(c.matches_existing&&!c.changed){R.set(c.temp_ref,{resolution:"skipped"});continue}o.push({kind:c.matches_existing?"MODIFY":"ADD",temp_ref:c.temp_ref,title:c.title,why:c.matches_existing?`updated: ${Object.keys(c.updated??{}).join(", ")||"content"}`:`newly extracted from ${n}`,...c.matches_existing?{matched_cid:c.matches_existing.cid,updated:c.updated}:{},uc:c}),R.set(c.temp_ref,{resolution:"rejected"})}return R},confirmStale:async()=>!1,out:v=>e.hostOut?.(v),progress:v=>e.hostProgress?.(v),emit:v=>{v.type==="commit"&&typeof v.assumed=="number"&&(m+=v.assumed),e.hostEmit?.(v)},isTTY:!1,auth:a});if(g!==0)throw new Error(`reconcile: re-extract of ${n} failed (exit ${g})`);let u=E(t),f=u.heads.get(n),h=[],y=[];if(typeof f=="string"){let v=new Set;for(let R of u.edgesFrom(f))R.type!==C.DERIVES||u.nodeLabel.get(R.dst)!==w.USECASE||v.has(R.dst)||(v.add(R.dst),!(e.stage&&u.trust.get(R.dst)==="archived")&&(l.has(R.dst)?y:h).push(R.dst))}let S=E(t).heads.get(n);return{minted:h,matched:y,defaultsTaken:m,...e.stage?{held:{source_id:n,...S!=null?{staged_source_cid:S}:{},rows:o}}:{}}}}var Ne=["title","description","summary","value"];function Ce(t,e){let n=[],o=e.updated;if(!o)return n;for(let r of Ne){let s=o[r];if(typeof s!="string"||s===t[r])continue;let a=t[r];typeof a=="string"&&a.length>0&&n.push({op:"-",field:r,text:a}),n.push({op:"+",field:r,text:s})}let i=(t.criteria??[]).map(String),d=o.criteria??[];if(d.length>0)if(d.some(r=>"op"in r))for(let r of d)r.op==="set"&&n.push({op:"+",field:"criteria",text:r.text}),r.op==="remove"&&n.push({op:"-",field:"criteria",text:r.text});else{let r=d.map(s=>s.text);for(let s of i)r.includes(s)||n.push({op:"-",field:"criteria",text:s});for(let s of r)i.includes(s)||n.push({op:"+",field:"criteria",text:s})}return n}function H(t){let e=t.filter(r=>r.field==="criteria"),n=e.filter(r=>r.op==="+").length,o=e.filter(r=>r.op==="-").length,i=[...new Set(t.filter(r=>r.field!=="criteria").map(r=>r.field))],d=[];return e.length>0&&d.push(`${e.length} criteria changed \xB7 +${n} \u2212${o}`),i.length>0&&d.push(`${i.join("/")} reworded`),d.join(" \xB7 ")||"no field changes"}var Ee={high:0,med:1,low:2};function Y(t,e){return e?t.displayNameOf(e)??`${e.slice(0,19)}\u2026`:"(new)"}function T(t,e){if(!e)return;let n=t.edgesInto(e).filter(o=>o.type===C.BELONGS_TO||o.type===C.SCOPED_TO);if(n.length!==0)return{stale:n.length,direct:n.slice(0,3).map(o=>Y(t,o.src))}}function Oe(t){return oe(t).map(e=>({...e.source_id!==void 0?{source_id:e.source_id}:{},anchor:e.anchor,quote:e.quote??""}))}function K(t,e){let n=ge(t),o=[];for(let i of n.updates){let d=e.resolve(i.matches_existing.cid),r=d?e.tipOf(d.cid):null,s=(r?e.getNode(r)?.content:void 0)??{},a=Ce(s,i);o.push({key:$("MODIFY",i.matches_existing.cid),kind:"MODIFY",...r?{ref:r}:{},display:Y(e,r),title:typeof s.title=="string"?s.title:i.title,changeLine:i.change_note??H(a),diff:a,diffSummary:a.length>4?H(a):null,...i.risk!==void 0?{risk:i.risk}:{},cites:Oe(i),...i.matches_existing?.reason!==void 0?{tier:i.matches_existing.reason}:{},...T(e,r)!==void 0?{impact:T(e,r)}:{},payload:i})}for(let i of n.adds)o.push({key:$("ADD",i.temp_ref),kind:"ADD",display:"(new)",title:i.title,changeLine:i.summary??i.title,diff:[],diffSummary:null,...i.risk!==void 0?{risk:i.risk}:{},cites:Oe(i),payload:i});for(let i of n.archives){let d=e.resolve(i.target),r=d?e.tipOf(d.cid):null,s=(r?e.getNode(r)?.content:void 0)??{};o.push({key:$("ARCHIVE",i.target),kind:"ARCHIVE",...r?{ref:r}:{},display:Y(e,r),title:typeof s.title=="string"?s.title:i.target,changeLine:i.reason,diff:[],diffSummary:null,...typeof s.risk=="string"?{risk:s.risk}:{},cites:[],reason:i.reason,basis:i.basis,...T(e,r)!==void 0?{impact:T(e,r)}:{}})}return o.sort((i,d)=>(Ee[i.risk??"low"]??2)-(Ee[d.risk??"low"]??2))}function q(t,e){return t.filter(n=>!(n.key in e)||e[n.key]?.pending!==void 0)}function Fe(t,e){if(e.kind==="ADD")return null;let n=e.ref?t.resolve(e.ref):null;return n?t.tipOf(n.cid):null}async function Lt(t){let{store:e,graph:n,card:o,verdict:i,by:d}=t,r=Fe(n,o);if(o.kind!=="ADD"&&(!r||(n.trust.get(r)??null)==="archived"))return{ok:!1,refusal:`its target ${o.display} was retired while the review was open \u2014 nothing landed`,code:"TARGET_RETIRED"};if(i==="reject")return t.signals?.({ref:o.display,verdict:"reject",...t.note?{reason:t.note}:{}}),{ok:!0,landed:"none",note:"nothing saved \u2014 rejections aren't remembered yet; it may be re-proposed"};if(i==="defer"){let u=je({store:e,card:o,note:t.note,changeBasis:t.changeBasis,tip:r,proposalId:t.proposalId,by:d});return u.ok?(t.signals?.({ref:o.display,verdict:"defer",...t.note?{reason:t.note}:{}}),{ok:!0,landed:"none",note:"gap recorded \u2014 visible in cover gaps until a later verdict resolves it"}):{ok:!1,refusal:u.refusal,code:"DEFER_GAP_INVALID"}}if(t.changeBasis?.to_cid){let u=n.resolve(t.changeBasis.source_id);if(!u)return{ok:!1,refusal:D().text("SOURCE_UNRESOLVED",{source_id:t.changeBasis.source_id}),code:"SOURCE_UNRESOLVED"};if(u.cid!==t.changeBasis.to_cid)return{ok:!1,refusal:D().text("SOURCE_MOVED",{source_id:t.changeBasis.source_id}),code:"SOURCE_MOVED"}}if(o.kind==="ARCHIVE"){let u=(t.proposal.archived??[]).filter(y=>{let S=n.resolve(y.target);return S!=null&&n.tipOf(S.cid)===r}),f=re({...t.proposal,archived:u},n);if(u.length===0||f.errors.length>0)return{ok:!1,refusal:f.errors.length>0?`${f.errors.map(y=>y.detail).join("; ")} \u2014 nothing landed; the card re-presents`:D().text("ARCHIVE_UNRESOLVED",{use_case:o.display}),code:f.errors[0]?.code??"ARCHIVE_UNRESOLVED"};let h;try{h=se({store:e,graph:n,verdicts:new Map([[r,{resolution:"rejected",...o.reason??t.note?{reason:o.reason??t.note}:{}}]]),by:d})}catch(y){if(y instanceof le)return{ok:!1,refusal:"concurrent activity kept moving the store \u2014 try the card again",code:"CONCURRENT_APPEND"};throw y}return h.errors?{ok:!1,refusal:h.errors.map(y=>y.detail).join("; "),code:h.errors[0]?.code??"VALIDATION"}:(t.signals?.({ref:o.display,verdict:"archive"}),I({store:e,graph:n,targetTip:r,resolvedBy:r,...t.changeBasis?{sourceId:t.changeBasis.source_id}:{},by:d}),{ok:!0,landed:"archived"})}let s=o.payload,a=o.kind==="MODIFY"&&r&&s.matches_existing&&r!==s.matches_existing.cid?{...s,matches_existing:{...s.matches_existing,cid:r}}:s,l={version:1,read_basis:n.latestHash,source:t.proposal.source,...t.proposal.sources?{sources:t.proposal.sources}:{},use_cases:[a]},p=await me(ye(e,t.sid??`card-${process.pid}`,t.probe),{verb:"maintain",ucTargets:r?[{ref:r}]:[],newBuCandidates:o.kind==="ADD"?[{tempRef:a.temp_ref,title:a.title,probeText:`${a.title} ${a.summary??""}`.trim()}]:[],sourcePins:[],readBasis:n.latestHash},u=>{let f=P({store:e,graph:u.graph,scope:u.scope,proposal:l,proposalId:`${t.proposalId}:${o.key}`,verdicts:new Map([[a.temp_ref,{resolution:"approved"}]]),by:d,autoName:!0,allowStaleBasis:!0,eventIds:u.eventIds("maintain",1),...t.sid?{sid:u.sid}:{},probeHits:u.probeHits,...t.matchUnreviewed?{matchUnreviewed:!0}:{}});return f.errors!==null?{errors:f.errors}:{result:f,record:f.record}});if(!p.ok||!("result"in p)){let u=!p.ok&&p.kind==="validation"?p.errors:null;return{ok:!1,refusal:u?u.map(h=>h.detail).join("; "):"concurrent activity kept moving the store \u2014 try the card again",code:u?u[0]?.code??"VALIDATION":"CONCURRENT_APPEND"}}t.signals?.({ref:o.display,verdict:"approve"});let m=p.result.record?.nodes.find(u=>u.label==="usecase")?.cid,g=o.kind==="MODIFY"?m??r??void 0:m;return o.kind==="MODIFY"&&r&&I({store:e,graph:n,targetTip:r,resolvedBy:m??r,...t.changeBasis?{sourceId:t.changeBasis.source_id}:{},by:d}),{ok:!0,landed:o.kind==="MODIFY"?"successor":"minted",...g?{offer:{kind:o.kind==="MODIFY"?"evolve":"design",target:g}}:{}}}function je(t){let{card:e,changeBasis:n}=t,o={kind:"reconcile_deferred",derived:!0,text:e.changeLine||e.title,...e.risk?{risk:e.risk}:{},...t.note?{risk_rationale:t.note}:{},...t.tip?{ref:e.display,uc:t.tip}:{},...n?{basis:{source_id:n.source_id,from_cid:n.from_cid??"",to_cid:n.to_cid??""}}:{},...t.proposalId?{proposal_id:t.proposalId}:{},...e.payload?.temp_ref?{temp_ref:e.payload.temp_ref}:{}};return ce({store:t.store,content:o,...t.tip?{annotates:t.tip}:{},by:t.by})}var z=Ge(),Ue=12e4,W=new Set;function Ft(t,e){let n=`${t}:${e}`;return W.add(n),{process:z,pid:process.pid,done:()=>W.delete(n)}}function Me(t,e,n,o,i){return o.process===z?W.has(`${t}:${e}`):X()||o.pid!==void 0&&!ae(o.pid)?!1:i-Date.parse(n.at)<Ue}function jt(t){return t?.pending?t.pending.process===z?"this session":"another session":null}function Be(t,e){for(let n of t.recordsSince(t.parse(e.after)))if(e.kind==="record"&&n.proposal_id===e.proposal_id||e.kind==="archive"&&n.review.some(o=>o.id===e.target&&o.resolution==="rejected")||e.kind==="gap"&&n.nodes.some(o=>{let i=o.content;return o.label==="gap"&&i.kind==="reconcile_deferred"&&i.proposal_id===e.proposal_id&&i.text===e.text}))return n;return null}function He(t,e){if(e.kind==="gap"||!e.closes)return;let n=E(t),o=n.tipOf(e.closes.target);I({store:t,graph:n,targetTip:o,resolvedBy:o,by:e.closes.by,...e.closes.source?{sourceId:e.closes.source}:{}})}function Ye(t,e,n){let{pending:o,...i}=t;if(e.kind!=="record")return i;let d=n.nodes.find(r=>r.label==="usecase")?.cid??e.offer.fallback;return d?{...i,offer:{kind:e.offer.kind,key:d,title:e.offer.title}}:i}function Gt(t,e){let n=e.replaces;if(!n)return;let o=t.proposals(),i=o.verdicts(e.proposal_id);if(i.seeded_from===n)return;let d=B(t,n),r=E(t),s=g=>{let u=o.read(g);return u?K(u,r):[]},a=s(e.proposal_id),l=new Map(s(n).map(g=>[g.key,g]));for(let[g,u]of Object.entries(d.verdicts)){if(u.pending)continue;let f=l.get(g),h=f?.kind==="ADD"?f.title.toLowerCase():null,S=(h!==null?a.find(v=>v.kind==="ADD"&&v.title.toLowerCase()===h):a.find(v=>v.key===g&&v.kind!=="ADD"))?.key??(a.some(v=>v.key===g)?`${g}@${n}`:g);S in i.verdicts||(i.verdicts[S]=u)}i.seeded_from=n;let p=q(a,i.verdicts).length;a.length>0&&p===0&&!Object.values(i.verdicts).some(g=>g.pending)&&(i.resolved=!0),o.saveVerdicts(e.proposal_id,i);let m=o.verdicts(n);m.steer&&(delete m.steer,o.saveVerdicts(n,m))}function B(t,e){let n=t.proposals(),o=n.verdicts(e),i=Date.now(),d=!1;for(let[r,s]of Object.entries(o.verdicts)){if(!s.pending)continue;let a=Be(t,s.pending);if(a)He(t,s.pending),o.verdicts[r]=Ye(s,s.pending,a);else{if(Me(e,r,s,s.pending,i))continue;delete o.verdicts[r]}d=!0}if(d){let r=n.read(e);(r?q(K(r,E(t)),o.verdicts).length:1)===0&&!Object.values(o.verdicts).some(a=>a.pending)&&(o.resolved=!0),n.saveVerdicts(e,o)}return o}export{Ft as a,jt as b,Gt as c,B as d,Pe as e,at as f,lt as g,ut as h,ft as i,pt as j,gt as k,mt as l,K as m,q as n,Fe as o,Lt as p};
|
|
2
|
+
import{b as we}from"./chunk-TM6VLC6V.js";import{a as he,b as ve,c as _e}from"./chunk-GEZVC4S3.js";import{a as ye}from"./chunk-SVIIUKJ2.js";import{a as V,b as G,e as U}from"./chunk-WEJR2V7R.js";import{a as $,b as ge}from"./chunk-73ZFOJOK.js";import{a as me}from"./chunk-EZMRWXRT.js";import{d as pe}from"./chunk-FOLUB336.js";import{e as fe}from"./chunk-XB6BJPDL.js";import{$ as ie,C as te,D as ne,G as re,M as E,Na as le,Y as oe,da as P,e as F,ea as se,ia as ce,ja as I,sa as de,sb as j,tb as ue,xa as ae}from"./chunk-PI7OXS62.js";import{f as w,g as C,i as ee}from"./chunk-KU3YHPWZ.js";import{e as Z}from"./chunk-G4K3TP2I.js";import{h as X,o as D}from"./chunk-HYJVYYAZ.js";import{randomUUID as Ge}from"crypto";function De(t,e,n,o,i){let d=n.rows.filter(g=>{let u=o.get(g.temp_ref);return u!==void 0&&u!=="reject"});if(d.length===0)return{record:null,errors:null};let r={version:1,read_basis:e.latestHash,source:{source_id:n.source_id,source_cid:e.heads.get(n.source_id)??""},use_cases:d.map(g=>g.uc)},s=new Map;for(let g of d){let u=o.get(g.temp_ref);typeof u=="object"?s.set(g.temp_ref,{resolution:"edited",edit:u.edited}):s.set(g.temp_ref,{resolution:g.uc.matches_existing&&g.uc.changed?"edited":"approved"})}let a=_e(r,e,n.staged_source_cid);if(a.errors!==null)return{record:null,errors:a.errors};let l=a.proposal,p=r.source.source_cid?V(t,e,r.source.source_cid):null;if(p!==null){l=ve(l,p);let g=ie(l,he(p),e);if(g.length>0)return{record:null,errors:[{code:"HELD_CITES_STALE",detail:D().text("HELD_CITES_STALE.moved",{})},...g]}}let m=`held-${(e.latestHash??"root").slice(-12)}-${d.length}`;return P({store:t,graph:e,proposal:l,proposalId:m,verdicts:s,by:i,autoName:!0})}function Re(t,e,n=[]){let o=we(t,e),i=new Set,d=[],r=p=>{!p||i.has(p)||(i.add(p),d.push(k(t,p)))};for(let p of o.pairs)r(p.scenario),r(p.test);for(let[p,m]of o.verifies){r(p);for(let g of m)r(g)}if(n.length===0)return{stale_refs:d};let s=p=>`${String(p.props.source_id)}\0${String(p.props.anchor)}`,a=new Set;for(let{cid:p}of t.byLabel(w.USECASE))if(t.tipOf(p)===e)for(let m of t.edgesInto(p)){if(m.type!==C.DERIVES)continue;let g=m.props.claim;typeof g=="string"&&n.includes(g)&&a.add(s(m))}if(a.size===0)return{stale_refs:d};let l=new Set;for(let[p,m]of o.verifies)if(t.edgesInto(p).some(u=>u.type===C.DERIVES&&a.has(s(u)))){l.add(k(t,p));for(let u of m)l.add(k(t,u))}return{stale_refs:d,...l.size>0?{direct_refs:[...l]}:{}}}var ke="this release plans changes only \u2014 blast-radius impact and drift meaning-checks are not measured, and REMOVE rows are never executed automatically",Le="suite untouched; graph updated";function N(t,e){return!t.superseded.has(e)&&t.trust.get(e)!=="archived"}function k(t,e,n=new Set){let o=t.nameOf.get(e);if(o!==void 0)return o;if(n.has(e))return e;n.add(e);for(let[i,d]of t.superseded){if(d!==e||de(i,e,s=>t.nodeLabel.get(s)))continue;let r=k(t,i,n);if(r!==i)return r}return e}function b(t){return String(t).slice(0,19)}function A(t,e,n){let o=t.edgesFrom(e).find(i=>i.type===n);return o?t.tipOf(o.dst):null}function M(t,e){let n=t.nodeLabel.get(e);if(n===w.USECASE)return e;if(n===w.SCENARIO)return A(t,e,C.BELONGS_TO);if(n===w.AC){let o=A(t,e,C.SCOPED_TO);return o?t.nodeLabel.get(o)===w.USECASE?o:A(t,o,C.BELONGS_TO):null}if(n===w.TEST){let o=A(t,e,C.AUTOMATES);return o?A(t,o,C.BELONGS_TO):null}return null}function Se(t,e){let n=[],o=new Map;for(let i of t.derivesInto(e))o.set(String(i.props.source_id),i);for(let[i,d]of o){let r=t.heads.get(i);if(r==null){n.push(`DERIVES pin ${i} @ ${b(d.props.source_cid)} \u2014 source retired`);continue}let s=j(t,e,i);if(s!==null){s.stale&&n.push(`DERIVES pin ${i} \u2014 ${ue(i,s)}`);continue}if(r!==d.props.source_cid){let a=t.convChains.get(i)?.chain;if(a&&a.includes(String(d.props.source_cid)))continue;n.push(`DERIVES pin ${i} @ ${b(d.props.source_cid)} \u2014 source head moved to ${b(r)}`)}}for(let i of t.edgesFrom(e))ee(i.type)?.pin?.comparesTo==="dst_tip"&&t.superseded.has(i.dst)&&n.push(`${i.type} pin \u2192 ${k(t,i.dst)} \u2014 target superseded`);return n.join("; ")||"structural pin broken"}var xe=new Set([w.USECASE,w.SCENARIO,w.AC,w.TEST]);function L(t,e){return t.ref<e.ref?-1:t.ref>e.ref?1:0}function Ie(t,e,n,o,i){let d=n.props.quote;if(typeof d=="string"&&d.length>0)return ne(d,o);let r=String(n.props.source_cid);i.has(r)||i.set(r,V(t,e,r));let s=i.get(r);if(s===null)return!1;let a=te(s,String(n.props.anchor));return a===null?!1:a.split(`
|
|
3
|
+
`).some(l=>l.trim().length>0&&o.includes(l.trim()))}function Ae(t,e,n){let o=F(String(e.props.anchor));if(o?.kind!=="img-part")return!1;let d=(t.mediaOf(String(e.props.source_cid)).images??[]).find(l=>l.ref===o.ref),r=d?.blob;if(r===void 0)return!1;let s=t.mediaOf(n).images??[];if(s.some(l=>l.blob===r))return!0;let a=d?.appearance;return a!==void 0&&s.filter(l=>l.appearance===a).length===1}function Pe(t,e,n={}){let o=n.now??new Date,i=t.sessions(),d=[],r=0;for(let s of i.list())if(s.sid!==n.except){if(s.corrupt){r+=1;continue}try{let a=i.peek(s.sid);if(!a||Z(a,o))continue;let l=a.pending.proposals.some(m=>(m.content?._held?.source_id??null)===e),p=a.reconcile!=null&&e in a.read_basis&&B(t,a.reconcile.proposal_id).resolved!==!0;(l||p)&&d.push(a.sid)}catch{r+=1}}return{holders:d,corrupt:r}}async function at(t,e){let{holders:n,corrupt:o}=Pe(t,e.sourceId,{...e.now?{now:e.now}:{},...e.sessionId?{except:e.sessionId}:{}});if(o>0)return{kind:"unverifiable",corrupt:o};if(n.length>0)return{kind:"held",holders:n};if((await e.reingest(e.sourceId)).status==="unchanged")return{kind:"unchanged"};let d=G(t,e.sourceId);return d.kind==="ok"?{kind:"landed",changeContext:d.changeContext}:d}function $e(t,e,n){let o=t.getNode(e)?.content??{},i=t.getNode(n)?.content??{},r=[...new Set([...Object.keys(o),...Object.keys(i)])].sort().filter(s=>JSON.stringify(o[s])!==JSON.stringify(i[s]));return r.length>0?`updated: ${r.join(", ")}`:"updated"}function Ve(t,e,n,o,i,d,r){let s=new Set((r?.rows??[]).map(f=>f.matched_cid).filter(f=>!!f)),a=[];for(let[f,h]of n.superseded)h===null||f===h||e.superseded.has(f)||n.nodeLabel.get(f)===w.USECASE&&a.push({kind:"MODIFY",ref:k(n,f),old_cid:f,new_cid:h,summary:$e(n,f,h)});let l=d.map(f=>({kind:"ADD",ref:k(n,f),cid:f}));for(let f of r?.rows??[])f.kind==="MODIFY"&&f.matched_cid?a.push({kind:"MODIFY",ref:k(n,f.matched_cid),old_cid:f.matched_cid,new_cid:null,summary:`${f.why} (staged)`}):f.kind==="ADD"&&l.push({kind:"ADD",ref:f.title,cid:null});let p=[],m=V(t,n,i),g=new Map;for(let{cid:f}of n.byLabel(w.USECASE)){if(!N(n,f)||s.has(f))continue;let h=n.derivesInto(f),y=h.filter(c=>String(c.props.source_id)===o);if(y.length===0)continue;let S=j(n,f,o);S!==null&&!S.stale||y.some(c=>c.props.source_cid===i)||y.some(c=>{let _=String(c.props.anchor),x=F(_);return x?.kind==="img-whole"?!1:x?.kind==="img-part"?Ae(n,c,i):m!==null&&Ie(t,n,c,m,g)})||h.some(c=>{let _=String(c.props.source_id);if(_===o)return!1;let x=n.heads.get(_);return x!=null})||p.push({kind:"ARCHIVE",ref:k(n,f),cid:f,why:`evidence decayed: no quote from ${o} relocates into @${b(i)}, no other live source, no fresh evidence this run`,impact:Re(n,n.tipOf(f))})}let u=(f,h)=>f.ref<h.ref?-1:f.ref>h.ref?1:0;return[...a.sort(u),...l.sort(u),...p.sort(u)]}function lt(t,e,n,o,i){let d=e.rows.find(u=>u.temp_ref===n);if(!d)return{ok:!1,message:`held item ${n} missing from the plan artifact`};let r=d,s=E(t);if(r.matched_cid){let u=s.tipOf(r.matched_cid);if(s.superseded.get(u)===null)return{ok:!1,message:`use-case for "${r.title}" was retired meanwhile \u2014 nothing to update`};u!==r.matched_cid&&(r={...r,matched_cid:u,uc:{...r.uc,matches_existing:{cid:u}}})}let a=i?{edited:i}:"approve",l=De(t,s,{source_id:e.source_id,...e.staged_source_cid!==void 0?{staged_source_cid:e.staged_source_cid}:{},rows:[r]},new Map([[r.temp_ref,a]]),o);if(l.errors)return{ok:!1,message:l.errors.map(u=>`${u.code}: ${u.detail}`).join("; ")};let p=E(t),m=r.matched_cid?p.tipOf(r.matched_cid):l.record?.nodes.find(u=>u.label==="usecase")?.cid??l.record?.review[0]?.id;return{ok:!0,ref:m?k(p,m):r.title,kind:r.kind}}async function ut(t,e,n,o={}){let i=E(t);t.prefetch(fe(i,e),{token:null});let d=i.heads.get(e)??null,r=new Set(i.staleList().filter(c=>c.state==="stale").map(c=>c.cid)),s=await n.reingest(e);if(s.status==="unchanged"&&!o.resumeHeld&&!o.reextractUnchanged)return{source_id:e,changed:!1,head:{status:s.status,before:d,after:s.cid},note:`nothing to reconcile \u2014 ${e} is unchanged`,skipped_arms:ke,changeset:[],rows:[]};let a=o.resumeHeld?{minted:[],matched:[],held:o.resumeHeld}:await n.reextract(e),l=E(t),p=a.minted.map(c=>{let _=k(l,c);return{kind:"ADD",origin:"content-change",ref:_,reason:`new use-case extracted from ${e}`,provenance:`extraction commit \u2014 DERIVES ${e} @ ${b(s.cid)}`,action:`kane-cli design tests --use-case ${_}`}}),m=l.staleList().filter(c=>c.state==="stale"&&!r.has(c.cid)&&N(l,c.cid)).map(c=>c.cid),g=m.map(c=>{let _=k(l,c),x=xe.has(l.nodeLabel.get(c)??"");return{kind:"MODIFY",origin:"structural-stale",ref:_,reason:"stale (structural)",provenance:Se(l,c),action:x?`kane-cli maintain evolve ${_}`:`kane-cli design explain ${_}`}}),u=[],f=[];for(let c of a.held?.rows??[])if(c.kind==="ADD")u.push({kind:"ADD",origin:"content-change",ref:c.title,held_ref:c.temp_ref,reason:`${c.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${e} @ ${b(s.cid)}`,action:"approve to commit + design"});else{let _=c.matched_cid?l.tipOf(c.matched_cid):null,x=_?l.getNode(_)?.content.criteria??[]:[],J=(c.uc.updated?.criteria??[]).map(O=>typeof O=="string"?O:O.text),be=[...J.filter(O=>!x.includes(O)),...c.uc.updated?.criteria!==void 0?x.filter(O=>!J.includes(O)):[]],Q=_?Re(l,_,be):void 0;f.push({kind:"MODIFY",origin:"content-change",ref:c.matched_cid?k(l,c.matched_cid):c.title,held_ref:c.temp_ref,reason:`${c.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${e} @ ${b(s.cid)}`,action:"approve to commit the updated version (old\u2192new redirect)",...Q?{impact:Q}:{}})}let h=new Set;for(let c of[...a.minted,...a.matched])h.add(l.tipOf(c));for(let c of a.held?.rows??[])c.matched_cid&&h.add(l.tipOf(c.matched_cid));for(let c of m){let _=M(l,l.tipOf(c));_&&l.nodeLabel.get(_)===w.USECASE&&h.add(l.tipOf(_))}let y=[];for(let c of await pe(l,"design")){if(c.kind!=="no-verifies")continue;let _=l.resolve(c.ref);if(!_)continue;let x=M(l,_.tip);!x||!h.has(l.tipOf(x))||y.push({kind:"ADD",origin:"content-change",ref:c.ref,reason:c.why,provenance:`gaps engine (design) \u2014 uncovered AC of touched use-case ${k(l,x)}`,action:c.ready_command})}let S=[];for(let{cid:c}of l.byLabel(w.USECASE))N(l,c)&&l.stale(c)==="orphaned"&&S.push({kind:"REMOVE",ref:k(l,c),reason:"orphaned \u2014 no live source evidences this use-case",provenance:Se(l,c),action:"plan-only \u2014 REMOVE is not executed in this release"});let v=new Set,R=[...p.sort(L),...u.sort(L),...y.sort(L),...f.sort(L),...g.sort(L),...S.sort(L)].filter(c=>{let _=`${c.kind}\0${c.ref}`;return v.has(_)?!1:(v.add(_),!0)});return{source_id:e,changed:!0,head:{status:s.status,before:d,after:s.cid},note:Le,skipped_arms:ke,changeset:Ve(t,i,l,e,s.cid,a.minted,a.held),rows:R,...a.held?{held:a.held}:{}}}function ft(t,e){return async n=>{let{ingestFile:o}=await import("./ingest-ZHHHBUXR.js"),{convertPdf:i}=await import("./pdf-convert-YB6PJFMI.js"),{convertDocx:d}=await import("./docx-convert-DO5AQYD3.js"),r=await o({store:t,filePath:e,asId:n,converters:{pdf:i,docx:d}});return{status:r.status,cid:r.cid}}}function pt(t,e,n,o={}){return async i=>{let{ingestThroughPlugin:d}=await import("./lane-CNGO7LH5.js"),r=await d({store:t,plugin:e,ref:n,named:o.named??!1,asId:i,...o.connect?{connect:o.connect}:{},...o.registry?{registry:o.registry}:{}});return{status:r.status,cid:r.cid}}}function gt(t,e,n,o,i){return async()=>{let r=(i??(await import("./dispatch-BV6XMCN3.js")).findProvider)(e);if(!r)throw new Error(`the remote re-ingest failed \u2014 no provider matches '${e}'`);let s=await r.ingest(e,void 0,{out:n.out,err:n.err,confirm:async()=>!0,isTTY:!1},t,{credentials:o});if(s.code!==0||!s.result)throw new Error("the remote re-ingest failed \u2014 fix the reported problem and re-run");return{status:s.result.status,cid:s.result.source_cid}}}function mt(t,e){return async n=>{let o=[],[{runExtract:i},{resolveAgentAuthEnv:d},{runAgent:r},{preflightTurn:s}]=await Promise.all([import("./run-YUHHD54J.js"),import("./spawner-MQ4XEHIX.js"),import("./bridge-2UHJOVLX.js"),import("./turn-preflight-R4PU6NYY.js")]),a=await d(e.credentials),l=new Set(E(t).byLabel(w.USECASE).map(v=>v.cid)),p=U(t,n)??void 0,m=0,g=await i({mode:"override",source:n,...p?{changeContext:p}:{}},{agent:r,store:t,credentials:e.credentials,onIngestRefusal:e.onIngestRefusal,preflightTurn:()=>s(a),ask:async()=>[],review:async v=>{if(!e.stage)return new Map(v.map(c=>[c.temp_ref,{resolution:c.matches_existing&&c.changed?"edited":"skipped"}]));let R=new Map;for(let c of v){if(c.matches_existing&&!c.changed){R.set(c.temp_ref,{resolution:"skipped"});continue}o.push({kind:c.matches_existing?"MODIFY":"ADD",temp_ref:c.temp_ref,title:c.title,why:c.matches_existing?`updated: ${Object.keys(c.updated??{}).join(", ")||"content"}`:`newly extracted from ${n}`,...c.matches_existing?{matched_cid:c.matches_existing.cid,updated:c.updated}:{},uc:c}),R.set(c.temp_ref,{resolution:"rejected"})}return R},confirmStale:async()=>!1,out:v=>e.hostOut?.(v),progress:v=>e.hostProgress?.(v),emit:v=>{v.type==="commit"&&typeof v.assumed=="number"&&(m+=v.assumed),e.hostEmit?.(v)},isTTY:!1,auth:a});if(g!==0)throw new Error(`reconcile: re-extract of ${n} failed (exit ${g})`);let u=E(t),f=u.heads.get(n),h=[],y=[];if(typeof f=="string"){let v=new Set;for(let R of u.edgesFrom(f))R.type!==C.DERIVES||u.nodeLabel.get(R.dst)!==w.USECASE||v.has(R.dst)||(v.add(R.dst),!(e.stage&&u.trust.get(R.dst)==="archived")&&(l.has(R.dst)?y:h).push(R.dst))}let S=E(t).heads.get(n);return{minted:h,matched:y,defaultsTaken:m,...e.stage?{held:{source_id:n,...S!=null?{staged_source_cid:S}:{},rows:o}}:{}}}}var Ne=["title","description","summary","value"];function Ce(t,e){let n=[],o=e.updated;if(!o)return n;for(let r of Ne){let s=o[r];if(typeof s!="string"||s===t[r])continue;let a=t[r];typeof a=="string"&&a.length>0&&n.push({op:"-",field:r,text:a}),n.push({op:"+",field:r,text:s})}let i=(t.criteria??[]).map(String),d=o.criteria??[];if(d.length>0)if(d.some(r=>"op"in r))for(let r of d)r.op==="set"&&n.push({op:"+",field:"criteria",text:r.text}),r.op==="remove"&&n.push({op:"-",field:"criteria",text:r.text});else{let r=d.map(s=>s.text);for(let s of i)r.includes(s)||n.push({op:"-",field:"criteria",text:s});for(let s of r)i.includes(s)||n.push({op:"+",field:"criteria",text:s})}return n}function H(t){let e=t.filter(r=>r.field==="criteria"),n=e.filter(r=>r.op==="+").length,o=e.filter(r=>r.op==="-").length,i=[...new Set(t.filter(r=>r.field!=="criteria").map(r=>r.field))],d=[];return e.length>0&&d.push(`${e.length} criteria changed \xB7 +${n} \u2212${o}`),i.length>0&&d.push(`${i.join("/")} reworded`),d.join(" \xB7 ")||"no field changes"}var Ee={high:0,med:1,low:2};function Y(t,e){return e?t.displayNameOf(e)??`${e.slice(0,19)}\u2026`:"(new)"}function T(t,e){if(!e)return;let n=t.edgesInto(e).filter(o=>o.type===C.BELONGS_TO||o.type===C.SCOPED_TO);if(n.length!==0)return{stale:n.length,direct:n.slice(0,3).map(o=>Y(t,o.src))}}function Oe(t){return oe(t).map(e=>({...e.source_id!==void 0?{source_id:e.source_id}:{},anchor:e.anchor,quote:e.quote??""}))}function K(t,e){let n=ge(t),o=[];for(let i of n.updates){let d=e.resolve(i.matches_existing.cid),r=d?e.tipOf(d.cid):null,s=(r?e.getNode(r)?.content:void 0)??{},a=Ce(s,i);o.push({key:$("MODIFY",i.matches_existing.cid),kind:"MODIFY",...r?{ref:r}:{},display:Y(e,r),title:typeof s.title=="string"?s.title:i.title,changeLine:i.change_note??H(a),diff:a,diffSummary:a.length>4?H(a):null,...i.risk!==void 0?{risk:i.risk}:{},cites:Oe(i),...i.matches_existing?.reason!==void 0?{tier:i.matches_existing.reason}:{},...T(e,r)!==void 0?{impact:T(e,r)}:{},payload:i})}for(let i of n.adds)o.push({key:$("ADD",i.temp_ref),kind:"ADD",display:"(new)",title:i.title,changeLine:i.summary??i.title,diff:[],diffSummary:null,...i.risk!==void 0?{risk:i.risk}:{},cites:Oe(i),payload:i});for(let i of n.archives){let d=e.resolve(i.target),r=d?e.tipOf(d.cid):null,s=(r?e.getNode(r)?.content:void 0)??{};o.push({key:$("ARCHIVE",i.target),kind:"ARCHIVE",...r?{ref:r}:{},display:Y(e,r),title:typeof s.title=="string"?s.title:i.target,changeLine:i.reason,diff:[],diffSummary:null,...typeof s.risk=="string"?{risk:s.risk}:{},cites:[],reason:i.reason,basis:i.basis,...T(e,r)!==void 0?{impact:T(e,r)}:{}})}return o.sort((i,d)=>(Ee[i.risk??"low"]??2)-(Ee[d.risk??"low"]??2))}function q(t,e){return t.filter(n=>!(n.key in e)||e[n.key]?.pending!==void 0)}function Fe(t,e){if(e.kind==="ADD")return null;let n=e.ref?t.resolve(e.ref):null;return n?t.tipOf(n.cid):null}async function Lt(t){let{store:e,graph:n,card:o,verdict:i,by:d}=t,r=Fe(n,o);if(o.kind!=="ADD"&&(!r||(n.trust.get(r)??null)==="archived"))return{ok:!1,refusal:`its target ${o.display} was retired while the review was open \u2014 nothing landed`,code:"TARGET_RETIRED"};if(i==="reject")return t.signals?.({ref:o.display,verdict:"reject",...t.note?{reason:t.note}:{}}),{ok:!0,landed:"none",note:"nothing saved \u2014 rejections aren't remembered yet; it may be re-proposed"};if(i==="defer"){let u=je({store:e,card:o,note:t.note,changeBasis:t.changeBasis,tip:r,proposalId:t.proposalId,by:d});return u.ok?(t.signals?.({ref:o.display,verdict:"defer",...t.note?{reason:t.note}:{}}),{ok:!0,landed:"none",note:"gap recorded \u2014 visible in cover gaps until a later verdict resolves it"}):{ok:!1,refusal:u.refusal,code:"DEFER_GAP_INVALID"}}if(t.changeBasis?.to_cid){let u=n.resolve(t.changeBasis.source_id);if(!u)return{ok:!1,refusal:D().text("SOURCE_UNRESOLVED",{source_id:t.changeBasis.source_id}),code:"SOURCE_UNRESOLVED"};if(u.cid!==t.changeBasis.to_cid)return{ok:!1,refusal:D().text("SOURCE_MOVED",{source_id:t.changeBasis.source_id}),code:"SOURCE_MOVED"}}if(o.kind==="ARCHIVE"){let u=(t.proposal.archived??[]).filter(y=>{let S=n.resolve(y.target);return S!=null&&n.tipOf(S.cid)===r}),f=re({...t.proposal,archived:u},n);if(u.length===0||f.errors.length>0)return{ok:!1,refusal:f.errors.length>0?`${f.errors.map(y=>y.detail).join("; ")} \u2014 nothing landed; the card re-presents`:D().text("ARCHIVE_UNRESOLVED",{use_case:o.display}),code:f.errors[0]?.code??"ARCHIVE_UNRESOLVED"};let h;try{h=se({store:e,graph:n,verdicts:new Map([[r,{resolution:"rejected",...o.reason??t.note?{reason:o.reason??t.note}:{}}]]),by:d})}catch(y){if(y instanceof le)return{ok:!1,refusal:"concurrent activity kept moving the store \u2014 try the card again",code:"CONCURRENT_APPEND"};throw y}return h.errors?{ok:!1,refusal:h.errors.map(y=>y.detail).join("; "),code:h.errors[0]?.code??"VALIDATION"}:(t.signals?.({ref:o.display,verdict:"archive"}),I({store:e,graph:n,targetTip:r,resolvedBy:r,...t.changeBasis?{sourceId:t.changeBasis.source_id}:{},by:d}),{ok:!0,landed:"archived"})}let s=o.payload,a=o.kind==="MODIFY"&&r&&s.matches_existing&&r!==s.matches_existing.cid?{...s,matches_existing:{...s.matches_existing,cid:r}}:s,l={version:1,read_basis:n.latestHash,source:t.proposal.source,...t.proposal.sources?{sources:t.proposal.sources}:{},use_cases:[a]},p=await me(ye(e,t.sid??`card-${process.pid}`,t.probe),{verb:"maintain",ucTargets:r?[{ref:r}]:[],newBuCandidates:o.kind==="ADD"?[{tempRef:a.temp_ref,title:a.title,probeText:`${a.title} ${a.summary??""}`.trim()}]:[],sourcePins:[],readBasis:n.latestHash},u=>{let f=P({store:e,graph:u.graph,scope:u.scope,proposal:l,proposalId:`${t.proposalId}:${o.key}`,verdicts:new Map([[a.temp_ref,{resolution:"approved"}]]),by:d,autoName:!0,allowStaleBasis:!0,eventIds:u.eventIds("maintain",1),...t.sid?{sid:u.sid}:{},probeHits:u.probeHits,...t.matchUnreviewed?{matchUnreviewed:!0}:{}});return f.errors!==null?{errors:f.errors}:{result:f,record:f.record}});if(!p.ok||!("result"in p)){let u=!p.ok&&p.kind==="validation"?p.errors:null;return{ok:!1,refusal:u?u.map(h=>h.detail).join("; "):"concurrent activity kept moving the store \u2014 try the card again",code:u?u[0]?.code??"VALIDATION":"CONCURRENT_APPEND"}}t.signals?.({ref:o.display,verdict:"approve"});let m=p.result.record?.nodes.find(u=>u.label==="usecase")?.cid,g=o.kind==="MODIFY"?m??r??void 0:m;return o.kind==="MODIFY"&&r&&I({store:e,graph:n,targetTip:r,resolvedBy:m??r,...t.changeBasis?{sourceId:t.changeBasis.source_id}:{},by:d}),{ok:!0,landed:o.kind==="MODIFY"?"successor":"minted",...g?{offer:{kind:o.kind==="MODIFY"?"evolve":"design",target:g}}:{}}}function je(t){let{card:e,changeBasis:n}=t,o={kind:"reconcile_deferred",derived:!0,text:e.changeLine||e.title,...e.risk?{risk:e.risk}:{},...t.note?{risk_rationale:t.note}:{},...t.tip?{ref:e.display,uc:t.tip}:{},...n?{basis:{source_id:n.source_id,from_cid:n.from_cid??"",to_cid:n.to_cid??""}}:{},...t.proposalId?{proposal_id:t.proposalId}:{},...e.payload?.temp_ref?{temp_ref:e.payload.temp_ref}:{}};return ce({store:t.store,content:o,...t.tip?{annotates:t.tip}:{},by:t.by})}var z=Ge(),Ue=12e4,W=new Set;function Ft(t,e){let n=`${t}:${e}`;return W.add(n),{process:z,pid:process.pid,done:()=>W.delete(n)}}function Me(t,e,n,o,i){return o.process===z?W.has(`${t}:${e}`):X()||o.pid!==void 0&&!ae(o.pid)?!1:i-Date.parse(n.at)<Ue}function jt(t){return t?.pending?t.pending.process===z?"this session":"another session":null}function Be(t,e){for(let n of t.recordsSince(t.parse(e.after)))if(e.kind==="record"&&n.proposal_id===e.proposal_id||e.kind==="archive"&&n.review.some(o=>o.id===e.target&&o.resolution==="rejected")||e.kind==="gap"&&n.nodes.some(o=>{let i=o.content;return o.label==="gap"&&i.kind==="reconcile_deferred"&&i.proposal_id===e.proposal_id&&i.text===e.text}))return n;return null}function He(t,e){if(e.kind==="gap"||!e.closes)return;let n=E(t),o=n.tipOf(e.closes.target);I({store:t,graph:n,targetTip:o,resolvedBy:o,by:e.closes.by,...e.closes.source?{sourceId:e.closes.source}:{}})}function Ye(t,e,n){let{pending:o,...i}=t;if(e.kind!=="record")return i;let d=n.nodes.find(r=>r.label==="usecase")?.cid??e.offer.fallback;return d?{...i,offer:{kind:e.offer.kind,key:d,title:e.offer.title}}:i}function Gt(t,e){let n=e.replaces;if(!n)return;let o=t.proposals(),i=o.verdicts(e.proposal_id);if(i.seeded_from===n)return;let d=B(t,n),r=E(t),s=g=>{let u=o.read(g);return u?K(u,r):[]},a=s(e.proposal_id),l=new Map(s(n).map(g=>[g.key,g]));for(let[g,u]of Object.entries(d.verdicts)){if(u.pending)continue;let f=l.get(g),h=f?.kind==="ADD"?f.title.toLowerCase():null,S=(h!==null?a.find(v=>v.kind==="ADD"&&v.title.toLowerCase()===h):a.find(v=>v.key===g&&v.kind!=="ADD"))?.key??(a.some(v=>v.key===g)?`${g}@${n}`:g);S in i.verdicts||(i.verdicts[S]=u)}i.seeded_from=n;let p=q(a,i.verdicts).length;a.length>0&&p===0&&!Object.values(i.verdicts).some(g=>g.pending)&&(i.resolved=!0),o.saveVerdicts(e.proposal_id,i);let m=o.verdicts(n);m.steer&&(delete m.steer,o.saveVerdicts(n,m))}function B(t,e){let n=t.proposals(),o=n.verdicts(e),i=Date.now(),d=!1;for(let[r,s]of Object.entries(o.verdicts)){if(!s.pending)continue;let a=Be(t,s.pending);if(a)He(t,s.pending),o.verdicts[r]=Ye(s,s.pending,a);else{if(Me(e,r,s,s.pending,i))continue;delete o.verdicts[r]}d=!0}if(d){let r=n.read(e);(r?q(K(r,E(t)),o.verdicts).length:1)===0&&!Object.values(o.verdicts).some(a=>a.pending)&&(o.resolved=!0),n.saveVerdicts(e,o)}return o}export{Ft as a,jt as b,Gt as c,B as d,Pe as e,at as f,lt as g,ut as h,ft as i,pt as j,gt as k,mt as l,K as m,q as n,Fe as o,Lt as p};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-4IEQNX7F.js";import{f as s}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-4IEQNX7F.js";import{f as s}from"./chunk-EHB55V23.js";import{existsSync as c,mkdirSync as l,readFileSync as f,renameSync as p,writeFileSync as m}from"fs";import{dirname as d,join as u}from"path";function x(n){return u(n,".testmuai","variables","assurance.json")}function S(n){for(let e of n.declarations){let o=s(e.name);if(o)throw new Error(`variable declaration refused: ${o}`)}let i={};if(c(n.file)){let e=a(f(n.file,"utf8"),n.file);e&&typeof e=="object"&&!Array.isArray(e)&&(i=e)}let r=[],t=[];for(let e of n.declarations){if(Object.hasOwn(i,e.name)||n.known?.has(e.name)){t.push(e.name);continue}i[e.name]={value:"",secret:!!e.secret,description:e.description},r.push(e.name)}if(r.length>0){l(d(n.file),{recursive:!0});let e=`${n.file}.tmp-${process.pid}-${Date.now()}`;m(e,JSON.stringify(i,null,2)+`
|
|
3
3
|
`),p(e,n.file)}return{written:r,skipped:t}}export{x as a,S as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-5Y2G4NC7.js";import{a as n}from"./chunk-HCBYKLMW.js";import{b as o}from"./chunk-33DWJV67.js";import{a as s}from"./chunk-6YGTRKDT.js";import{
|
|
2
|
+
import{a}from"./chunk-5Y2G4NC7.js";import{a as n}from"./chunk-HCBYKLMW.js";import{b as o}from"./chunk-33DWJV67.js";import{a as s}from"./chunk-6YGTRKDT.js";import{z as t}from"./chunk-FAMQ4DHU.js";import{e as r}from"./chunk-UR6MHSHU.js";var l=r(s(),1);var m=r(n(),1),i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function b({active:e=!0}){let[p,c]=(0,l.useState)(0);return a(()=>{c(f=>(f+1)%i.length)},e?80:null),(0,m.jsx)(o,{color:t.orange,children:e?i[p]:"\u25CF"})}export{b as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R,b as C,f as T,h as N,i as _,j as $,k,l as x,m as j,p as A,q as W}from"./chunk-
|
|
2
|
+
import{a as R,b as C,f as T,h as N,i as _,j as $,k,l as x,m as j,p as A,q as W}from"./chunk-H4TIVILC.js";import{a as p,e as E}from"./chunk-4C7WVQOD.js";var H=500;async function U(t,e){let l=e.now??(()=>new Date),u=e.sleep??(o=>new Promise(m=>setTimeout(m,o))),i=(await t.eventsAfter(0)).map(({seq:o,kind:m,at:S,body:y})=>({seq:o,kind:m,at:S,payload:y})),n=i.length,c=!1,s=null,h=[],d=()=>{for(let o of[...h]){if(s)o.reject(s);else if(n>=o.through)o.resolve();else continue;h.splice(h.indexOf(o),1)}},w=o=>{s=o,d(),e.onStopped(o)};async function r(){if(c||s)return;c=!0;let o=e.retryDeadlineMs??12e4,m=E(o,u,()=>l().getTime());for(;!s&&n<i.length;){let S=i.slice(n,n+H);try{await t.appendEvents(e.generation,S.map(({seq:y,kind:f,at:a,payload:g})=>({seq:y,kind:f,at:a,body:g}))),n+=S.length,m.reset(),e.imports?.answered(),d()}catch(y){let f=y instanceof p?y:new p(0,"UNREACHABLE",String(y));if(k(f)&&e.imports){if(await e.imports.wait())continue;w(x());break}if(!f.retryable){w(f);break}if(!await m.again()){w(new p(f.status,f.code,`the session's events were not stored within ${o/1e3} s: ${f.message}`,null,null,{},f.requestId));break}}}c=!1}return{append(o,m){let S={seq:i.length+1,kind:o,at:l().toISOString(),payload:m};return i.push(S),r(),S},since(o){return i.slice(Math.max(0,o))},lastSeq(){return i.length},halt(o){s||(s=o,d())},flush(){if(s)return Promise.reject(s);let o=i.length;return n>=o?Promise.resolve():new Promise((m,S)=>h.push({through:o,resolve:m,reject:S}))}}}function B(t,e){let l=e.now??(()=>new Date),u=e.sleep??(i=>new Promise(n=>setTimeout(n,i)));return{async save(i,n){if(i!==e.sessionId)throw new Error(`this host holds the token of session ${e.sessionId}; it cannot save session ${i}`);let{status:c,lastActivityAt:s}=n;await t.save({generation:e.generation,...s===void 0?{}:{lastActivityAt:s},...c===void 0?{}:{status:q(c)}})},async end(i,n){if(i!==e.sessionId)throw new Error(`this host holds the token of session ${e.sessionId}; it cannot end session ${i}`);let c=n.state==="complete"||n.state==="failed"?n.state:null;if(c===null)throw new Error(`session ${i}: ${n.state} is not an ending`);let s=e.endDeadlineMs??12e4,h=E(s,u,()=>l().getTime());for(;;)try{await t.save({generation:e.generation,status:q(n),ended:c,lastActivityAt:l().toISOString()});return}catch(d){let w=d instanceof p&&d.retryable&&!await h.again();if(!(d instanceof p)||!d.retryable||w){let r=w?new p(d.status,d.code,`the ending was not stored within ${s/1e3} s: ${d.message}`,null,null,{},d.requestId):d;throw r instanceof p&&e.onStopped?.(r),r}}}}}function q(t){let e=t.checkIn?{checkIn:"phase",...t.phase?{phase:t.phase}:{}}:{};return{state:t.state,panel:t.panel,error:t.error,...e}}var O=class extends Error{constructor(l,u){super(u);this.side=l;this.name="EngineFormsMismatch"}},Y=3e4,G=["main/history","save-state","session-side","ended"];async function Se(t){let e=t.testing??{},l={url:t.url,basicAuth:t.basicAuth,...e.fetch?{fetch:e.fetch}:{},...e.requestDeadlineMs?{requestDeadlineMs:e.requestDeadlineMs}:{}},u=T(l),i=async a=>{let g=E(e.retryDeadlineMs??12e4);for(;;)try{return await a()}catch(v){if(!(v instanceof p)||!v.retryable)throw v;let L=D=>t.onProgress({kind:"retry",attempt:g.attempt,nextInS:Math.ceil(D/1e3),giveUpAt:new Date(g.endsAt()??Date.now()).toISOString(),cause:A(v)});if(!await g.again(L))throw v}};t.onProgress({kind:"connect",step:"service"});let n=t.start.kind==="new"?await i(()=>u.createSession(t.start.body)):await i(()=>u.getSession(t.start.sessionId));if(n.ended!==null)throw new p(409,"SESSION_ENDED",`session ${n.sessionId} has ended (${n.ended}); start a new one`,null,null,{ended:n.ended});let c=$({...l,sessionId:n.sessionId,onBody:K(t.onProgress)});t.onProgress({kind:"connect",step:"session",sid:n.sessionId,...t.projectName!==void 0?{project:t.projectName}:{}});let s=await i(()=>c.claim()),h=G.filter(a=>!s.features?.includes(a));if(h.length>0)throw new O("service_older",`Lattice at ${t.url} does not serve ${h.join(", ")}; it is older than this kane-cli`);let d=s.engine;if(!d||1>d.forms||1<d.oldestRead){let a=d&&1<d.oldestRead?"cli_older":"service_older";throw new O(a,`Lattice at ${t.url} serves engine forms ${d?.oldestRead??"none"} to ${d?.forms??"none"}, and this kane-cli writes ${1}`)}let w=!1,r=null,o=a=>{if(w)return;w=!0,clearInterval(f);let g=a.code===_&&r!==null;t.onStopped(g?new p(a.status,V,`the lease lapsed while Lattice could not be reached: ${a.message}`,null,null,{},a.requestId):a)},m=e.leaseRenewMs??Y,S=e.retryDeadlineMs??12e4,y=0,f=setInterval(()=>{c.renewLease(s.generation).then(()=>{r=null,y=0},a=>{if(!(a instanceof p))return;if(J.has(a.code))return o(a);if(!a.retryable)return;let g=Date.now();r??=g;let v=r+S;if(g>=v)return o(new p(a.status,a.code,`Lattice did not take the lease for ${S/1e3} s: ${a.message}`,null,null,{},a.requestId));y+=1,t.onProgress({kind:"retry",attempt:y,nextInS:Math.ceil(m/1e3),giveUpAt:new Date(v).toISOString(),cause:A(a)})})},m);f.unref();try{let a=j(),g=e.retryDeadlineMs!==void 0?{retryDeadlineMs:e.retryDeadlineMs}:{},v=await U(c,{generation:s.generation,onStopped:o,imports:a,...g}),L=B(c,{sessionId:n.sessionId,generation:s.generation,onStopped:o}),D=W(c,{generation:s.generation,historyForms:d.forms,children:s.children,onStopped:o,log:v,imports:a,onRetry:P=>t.onProgress({kind:"retry",attempt:P.attempt,nextInS:Math.ceil(P.nextInMs/1e3),giveUpAt:new Date(P.giveUpAt).toISOString(),cause:P.cause}),...g}),M=await u.getSession(n.sessionId);return t.start.kind==="new"&&ee(u,M,t.onProgress,t.log??(()=>{})),{record:M,claim:s,client:c,person:u,storeCalls:D,log:v,state:L,release:()=>clearInterval(f)}}catch(a){throw clearInterval(f),a}}var V="CONNECTION_LOST",J=new Set([_,N,"SESSION_ENDED","PROJECT_NOT_MARKED"]);function K(t){let e=new Map;return(l,u,i)=>{let n=/\/main\/history/.test(l)?"history":/\/embeddings\?/.test(l)?"search":/\/scope\/drafts/.test(l)?"session":null;if(n===null)return;let c=i===null?0:Math.min(10,Math.floor(u*10/Math.max(i,1)));e.has(l)&&e.get(l)>=c||(e.set(l,c),t({kind:"load",part:n,done:u,total:i,unit:"bytes"}))}}var F=3e3,Q=4;async function z(t,e,l,u){if(!l.sourceId&&!l.useCase)return[];let i=await t.listSessions(e,l),n=i.find(c=>c.sessionId===u)?.userId??null;return Z(t,e,i.filter(c=>c.sessionId!==u),n)}function X(t,e){return t.mine!==void 0?t.mine?"you":"someone_else":e===null?null:t.userId===e?"you":"someone_else"}async function Z(t,e,l,u,i=Q){let n=l.filter(r=>R(r)!=="saved"&&R(r)!=="discarded"),c=async r=>{let o=(await t.counts(e,r.sessionId)).proposes,m=r.verb==="design"?C(o):o.useCases??0;return{sid:r.sessionId,owner:X(r,u),verb:r.verb,subject:r.useCase??r.sourceId,state:R(r),added:m,lastActivityAt:r.lastActivityAt??r.createdAt}},s=new Array(n.length),h=0,d=async()=>{for(let r=h++;r<n.length;r=h++)s[r]=await c(n[r])};await Promise.all(Array.from({length:Math.min(i,n.length)},d));let w=r=>Date.parse(r.lastActivityAt??"")||0;return s.sort((r,o)=>+(o.owner==="you")-+(r.owner==="you")||w(o)-w(r))}function ee(t,e,l,u){let i=!1,n=setTimeout(()=>i=!0,F);n.unref();let c={...e.sourceId?{sourceId:e.sourceId}:{},...e.useCase?{useCase:e.useCase}:{}};z(t,e.projectId,c,e.sessionId).then(s=>{clearTimeout(n),i?u(`the other open sessions on this subject answered after ${F/1e3} s, too late to show (${s.length} open)`):s.length>0&&l({kind:"overlap",sessions:s})},s=>{clearTimeout(n),u(`the other open sessions on this subject couldn't be read: ${s instanceof p?`${s.code}: ${s.message}`:s instanceof Error?s.message:String(s)}`)})}export{O as a,Se as b,X as c,Z as d};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{e as R}from"./chunk-ZCRZFAOT.js";import{a as O}from"./chunk-RZ4F3BHX.js";var C={ASR_CMD_START:"info",ASR_CMD_END:"info",ASR_AGENT_SPAWN:"info",ASR_WORK_ITEM_START:"info",ASR_WORK_ITEM_END:"info",ASR_PROPOSAL:"info",ASR_VALIDATE_FAILED:"warn",ASR_COMMIT:"info",ASR_SESSION_PAUSED:"info",ASR_SESSION_RESUMED:"info",ASR_SESSION_COMPLETE:"info",ASR_AGENT_EXIT:"warn",ASR_RECONCILE_PLAN:"info",ASR_RECONCILE_ROW_END:"info",ASR_HIGH_RISK_CI:"warn",ASR_INGEST:"info",ASR_EMBED_DEGRADED:"warn",ASR_CONTEXT_CLONED:"warn",ASR_ERROR:"error",ASR_CRASH:"error",ASR_FSCK_REPORT:"warn",ASR_IMPACT_TIMING:"info"},L={ASR_CMD_START:["source_count","resumed","applied_plan"],ASR_CMD_END:["exit_code","duration_ms","credits_total","work_items_total","work_items_failed"],ASR_AGENT_SPAWN:["tier","duration_ms"],ASR_WORK_ITEM_START:["work_item_index","work_item_count","source_kind"],ASR_WORK_ITEM_END:["work_item_index","work_item_count","outcome","duration_ms","error_domain","error_code"],ASR_PROPOSAL:["item_count","turn_index"],ASR_VALIDATE_FAILED:["error_code","count","turn_index"],ASR_COMMIT:["trusted","derived","archived","items","items_dropped","record_seq","phase","duration_ms"],ASR_SESSION_PAUSED:["pending_questions","pending_proposals"],ASR_SESSION_RESUMED:["resume_count","expired_session_id"],ASR_SESSION_COMPLETE:["duration_ms","credits_total"],ASR_AGENT_EXIT:["exit_code","signal"],ASR_RECONCILE_PLAN:["row_count","add_count","modify_count","archive_count"],ASR_RECONCILE_ROW_END:["row_index","kind","outcome","duration_ms"],ASR_HIGH_RISK_CI:["count"],ASR_INGEST:["work_item_index","work_item_count","format","bytes","media_facts"],ASR_EMBED_DEGRADED:["held"],ASR_CONTEXT_CLONED:[],ASR_ERROR:["error_domain","error_code","exit_code","turn_index","request_id"],ASR_CRASH:["error_domain","error_code","error_name"],ASR_FSCK_REPORT:["issue_count","records","pending","codes","issues","issues_truncated"],ASR_IMPACT_TIMING:["read_change_ms","read_project_ms","reads","agent_start_ms","turns","turn_ms_total","turn_ms_max","tool_calls","tool_ms_total","tool_bytes_total","review_ms","print_ms","total_ms","parts","use_cases","tests","use_cases_opened","tests_opened","cases_ms","cases_found","outcome"]},U=[[/^lattice_/,"lattice"],[/^refused_/,"refused"],[/^(auth_expired|401|preflight_auth|AUTH)/i,"auth"],[/^(credit_denied|402|CREDIT)/i,"credit"],[/^(stream_drop|read_timeout|connect_failed|dns|E(CONN|AI_AGAIN|TIMEDOUT)|network)/i,"network"],[/^(frame_parse|post_terminal_data|eof_without_terminal|turn_id_mismatch|binding_mismatch|schema_invalid|frame_too_large|protocol)/i,"protocol"],[/^(provider_error|http_5\d\d|turn_exhausted|adapter_integrity)/i,"provider"],[/^(STALE_BASIS|R\d+|validation|criteria)/i,"validation"],[/^(CHAIN_ERROR|DERIVED_(MISSING|DRIFT)|NODE_FILE_(MISSING|MISMATCH|CORRUPT)|CARDINALITY_VIOLATION|SUPERSEDE_(UNKNOWN_(OLD|NEW|ECID)|CYCLE)|DOUBLE_SUPERSEDE|NAME_UNKNOWN_TARGET|EDGE_CYCLE|UNKNOWN_(LABEL|FIELD|EDGE_TYPE|EDGE_PROP)|BAD_(CHECK|ENUM)|MISSING_(FIELD|SALIENT)|ILLEGAL_EDGE)$/,"graph"],[/^(BLOB_MISSING|SOURCE_UNKNOWN|SESSION_(LOCKED|EXPIRED|MISSING|LOCK_LOST)|NO_STORE|fsck|store)/i,"store"],[/^(usage|EX2|SOURCE_WITH_RESUME|HIGH_RISK_CI|bad_flag|no_tty)/i,"usage"],[/^exit_\d+_unattributed$/,"unattributed"],[/^agent_(crash|exit)/i,"agent_crash"]];function M(e){let t=(e||"unknown").slice(0,64);for(let[n,r]of U)if(n.test(t))return{error_domain:r,error_code:t};return{error_domain:"cli_crash",error_code:t}}import{randomBytes as w}from"crypto";var b=/^(uc|sc|ac|t|gap|sty)-\d+$/,K="0123456789abcdefghijklmnopqrstuvwxyz";function W(e){let t="",n=w(e);for(let r=0;r<e;r++)t+=K[n[r]%36];return t}function se(e=new Date){let t=(r,o)=>String(r).padStart(o,"0");return`as-${`${e.getUTCFullYear()}${t(e.getUTCMonth()+1,2)}${t(e.getUTCDate(),2)}T${t(e.getUTCHours(),2)}${t(e.getUTCMinutes(),2)}`}-${W(8)}`}var v=-1,S=0;function _e(e=new Date){let t=e.getTime(),n=w(10);t===v?S=S+1&4095:(v=t,S=(n[0]<<8|n[1])&4095);let r=Buffer.alloc(16);r.writeUIntBE(t,0,6),r[6]=112|S>>8,r[7]=S&255,r[8]=128|n[2]&63,n.copy(r,9,3,10);let o=r.toString("hex");return`${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}var B=64,k=128,$=/^[A-Za-z0-9._:@\/-]+$/,j={codes:512},H={ASR_FSCK_REPORT:["issues"]},X=20480,V=0;function q(e,t){if(typeof t=="number"&&Number.isFinite(t)||typeof t=="boolean")return t;if(typeof t!="string")return;let n=e.endsWith("_id")||e==="signal"?k:j[e]??B;if(!(t.length===0||t.length>n)&&$.test(t))return t}var P=e=>e!==void 0&&e.length>0&&e.length<=k&&$.test(e);function G(e,t,n={}){let r=L[t],o={};for(let s of r){let i=n[s];if(i==null)continue;if(H[t]?.includes(s)){if(typeof i!="string"||i.length===0)continue;let c=i.replace(/[\u0000-\u001F\u007F]/g,"");if(Buffer.byteLength(c,"utf8")>X)continue;o[s]=c;continue}if(s==="items"){let c=Array.isArray(i)?i.filter(p=>typeof p=="string"):[],u=c.filter(p=>b.test(p));u.length>0&&(o.items=u.slice(0,50).join(","));let E=c.length-u.length;E>0&&(o.items_dropped=E);continue}let a=q(s,i);a!==void 0&&(o[s]=a)}if(typeof n.error_code=="string"&&r.includes("error_code")){let{error_domain:s,error_code:i}=M(n.error_code);o.error_code=i,r.includes("error_domain")&&(o.error_domain=s)}return{level:C[t],event:t,message:t,session_id:e.session_id,operation_id:e.operation_id,...e.parent_operation_id?{parent_operation_id:e.parent_operation_id}:{},...e.agent_session_id?{agent_session_id:e.agent_session_id}:{},context_lineage_id:e.context_lineage_id??null,context_instance_id:e.context_instance_id??null,...P(e.lattice_session_id)?{lattice_session_id:e.lattice_session_id}:{},...P(e.project_id)?{project_id:e.project_id}:{},verb:e.verb,mode:e.mode,component:"kane-cli",seq:V++,event_time:new Date().toISOString(),context:o}}import _ from"fs";import A from"path";var z=500,Y=7,J=512*1024,Z=15*6e4;function I(e){if(e.length!==0)try{let t=R();_.mkdirSync(A.dirname(t),{recursive:!0});let n=e.map(o=>JSON.stringify(o)).join(`
|
|
3
|
+
`)+`
|
|
4
|
+
`;_.appendFileSync(t,n,{flag:"a",mode:384});let r=0;try{r=_.statSync(t).size}catch{r=0}r>J&&re()}catch{}}function Q(e){try{let t=A.dirname(e),n=A.basename(e);for(let r of _.readdirSync(t)){if(!r.startsWith(`${n}.claim-`)&&!r.startsWith(`${n}.prune-`))continue;let o=A.join(t,r),s=Number(r.slice(r.lastIndexOf("-")+1));if(s===process.pid)continue;let i=!1;if(Number.isFinite(s)&&s>0)try{process.kill(s,0),i=!0}catch{i=!1}let a=!i;if(i)try{a=Date.now()-_.statSync(o).mtimeMs>Z}catch{a=!1}if(a)try{let c=_.readFileSync(o,"utf8");c.trim()&&_.appendFileSync(e,c.endsWith(`
|
|
5
|
+
`)?c:c+`
|
|
6
|
+
`,{flag:"a",mode:384}),_.unlinkSync(o)}catch{}}}catch{}}function Se(e){ee(e).catch(()=>{})}function ee(e){return te(async t=>{try{return(await O(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok}catch{return!1}})}var F=Promise.resolve();function te(e){let t=F.then(()=>ne(e));return F=t.catch(()=>{}),t}async function ne(e){let t=R();Q(t);let n=`${t}.claim-${process.pid}`,r;try{_.renameSync(t,n),r=_.readFileSync(n,"utf8")}catch{return}let o=[];for(let s of r.split(`
|
|
7
|
+
`))if(s.trim())try{o.push(JSON.parse(s))}catch{}try{(o.length===0?!0:await e(o))?_.unlinkSync(n):(_.appendFileSync(t,r,{flag:"a",mode:384}),_.unlinkSync(n))}catch{try{_.appendFileSync(t,r,{flag:"a",mode:384}),_.unlinkSync(n)}catch{}}}function re(e=z,t=Y){try{let n=R(),r=`${n}.prune-${process.pid}`;_.renameSync(n,r);let s=_.readFileSync(r,"utf8").split(`
|
|
8
|
+
`).filter(u=>u.trim()),i=Date.now()-t*24*3600*1e3,c=s.filter(u=>{try{let E=JSON.parse(u),p=Date.parse(E.event_time??E.timestamp??"");return Number.isNaN(p)||p>=i}catch{return!1}}).slice(-e);c.length>0&&_.appendFileSync(n,c.join(`
|
|
9
|
+
`)+`
|
|
10
|
+
`,{flag:"a",mode:384}),_.unlinkSync(r)}catch{}}var f=null;function Ae(e){f=e}function Ie(){return f}var h=()=>!!process.env.KANE_DEV_MODE,d=[],T=!1,D=null,g=null,N=null,l=null,m=[];function ye(e){if(l=e,e&&m.length>0){let t=m;m=[];for(let n of t)try{e.log(n.level,n.event,n.message,n.context)}catch{}}}function Te(e,t,n,r){if(l){try{l.log(e,t,n,r)}catch{}return}m.push({level:e,event:t,message:n,context:r})}function Ne(){return l}function he(){return T}function De(e,t){d=d.filter(n=>n.name!==e),d.push({name:e,fn:t})}function xe(e){d=d.filter(t=>t.name!==e)}function Oe(e,t){let n=d.find(o=>o.name===e);if(!n)return;d=d.filter(o=>o.name!==e);let r=!0;try{n.fn()}catch(o){r=!1,process.stderr.write(`[exit-manager] cleanup(${e}) failed: ${o instanceof Error?o.message:String(o)}
|
|
11
|
+
`)}t&&r&&h()&&process.stderr.write(`[exit-manager] cleanup(${e}): ${t}
|
|
12
|
+
`)}async function Ce(e=1e3){let t=l;if(!(!t?.stopAndFlushOnce||!t.drainBuffer))try{let n=await t.stopAndFlushOnce(e);if(n!=="sent"&&n!=="empty"){let r=t.drainBuffer();r.length>0&&I(r)}}catch{}}function y(e,t,n=!1,r){if(T){process.exit(D??e);return}if(T=!0,D=e,n&&l)try{l.log("error","CRASH",t);let i=l.drainBuffer?.()??[];i.length>0&&I(i),l.shutdownSync()}catch{}if(n&&f&&e!==130&&e!==143)try{let i=/Uncaught exception:\s*([A-Za-z0-9_$]+)/.exec(t)?.[1]??"crash";I([G(f,"ASR_CRASH",{error_code:"cli_crash",error_name:i})])}catch{}let o=[...d].reverse(),s=[];for(let i of o)try{i.fn(),s.push(i.name)}catch(a){process.stderr.write(`[exit-manager] cleanup(${i.name}) failed: ${a instanceof Error?a.message:String(a)}
|
|
13
|
+
`)}if(d=[],h()&&(process.stderr.write(`[exit-manager] shutdown(${e}): ${t}
|
|
14
|
+
`),s.length>0&&process.stderr.write(`[exit-manager] cleaned up: ${s.join(", ")}
|
|
15
|
+
`)),n){if(N)try{N()}catch{}e===130||e===143||(process.stderr.write(`
|
|
16
|
+
kane-cli crashed: ${t}
|
|
17
|
+
`+(s.length>0?`Resources cleaned up (${s.join(", ")}).
|
|
18
|
+
`:"")),f&&process.stderr.write(`session: ${f.session_id} \u2014 share this id with support
|
|
19
|
+
`),r&&h()?process.stderr.write(`${r}
|
|
20
|
+
`):process.stderr.write(`(re-run with KANE_DEV_MODE=1 for the full stack)
|
|
21
|
+
`)),process.exit(e);return}if(g&&!n){g();return}process.exit(e)}function Le(e){g=e}function Me(){g=null}function ve(e){N=e}var x=!1;function we(){x||(x=!0,process.on("SIGINT",()=>{y(130,"Received SIGINT",!0)}),process.on("SIGTERM",()=>{y(143,"Received SIGTERM",!0)}),process.on("uncaughtException",e=>{y(1,`Uncaught exception: ${e.name}: ${e.message}`,!0,e.stack)}),process.on("unhandledRejection",e=>{y(1,`Unhandled rejection: ${String(e)}`,!0,e instanceof Error?e.stack:void 0)}))}function be(){d=[],T=!1,D=null,g=null,N=null,l=null,m=[],x=!1,f=null}export{se as a,_e as b,C as c,G as d,I as e,Se as f,ee as g,Ae as h,Ie as i,ye as j,Te as k,Ne as l,he as m,De as n,xe as o,Oe as p,Ce as q,y as r,Le as s,Me as t,ve as u,we as v,be as w};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{a as ae}from"./chunk-4NEPHIAO.js";import{b as ue}from"./chunk-ZUZ6QJRA.js";import{n as k,p as ce,q as de,r as pe,s as fe}from"./chunk-Z6SI7YNV.js";import{a as ge}from"./chunk-YDPTSDIJ.js";import{a as w,b as q}from"./chunk-KGNE5CIM.js";import{d as le}from"./chunk-3AGP2BVN.js";import{d as oe,f as se}from"./chunk-54NJJVG5.js";import{b as ie}from"./chunk-6JUS2ULI.js";import{a as re}from"./chunk-A474TUCE.js";import{a as te}from"./chunk-UCVP7ZY4.js";import{a as ne}from"./chunk-PVN64537.js";import{a as G}from"./chunk-FI2DVNRT.js";import{a as ee}from"./chunk-K75WIRI5.js";import{a as I}from"./chunk-HCBYKLMW.js";import{a as M,b as E}from"./chunk-33DWJV67.js";import{a as h}from"./chunk-FOJHSG5M.js";import{z as m}from"./chunk-FAMQ4DHU.js";import{e as Z}from"./chunk-UR6MHSHU.js";function j(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?e:`${t.toISOString().slice(0,16).replace("T"," ")} UTC`}function W(e){return e?e.code||e.message:""}function Y(e,t=Date.now()){if(!e)return"";let n=new Date(e).getTime();if(Number.isNaN(n))return e;let r=Math.floor(Math.max(0,t-n)/6e4);if(r<1)return"just now";if(r<60)return`${r}m`;let i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function v(e,t=Date.now()){let n=Y(e,t);return!n||n==="just now"||!/^\d/.test(n)?n:`${n} ago`}function R(e){return e?e.slice(0,8):""}function me(e){if(!e)return"";try{return new URL(e).host||e}catch{return e}}function P(e){return e?e.replace(/_/g," "):""}var Ue={user_off:"turned off",project_not_shared:"project not shared: share it in Test Manager",project_unknown:"the project's sharing could not be checked",not_configured:"assurance jobs are not set up on this service",mark_refused:"the first assurance job could not share the project: ask a Test Manager admin for permission to create test cases, then turn context off and on"};function A(e){return e==null?"":e==="end"?"run end":`cut ${e}`}function xe(e){return e?e.enabled?e.running?"on \xB7 job running":e.last_job_status?`on \xB7 last job ${e.last_job_status}`:"on":"off":""}function K(e){let t=e.off_reason?Ue[e.off_reason]??e.off_reason:"";return e.enabled&&t?`on, blocked: ${t}`:e.enabled?"on":t?`off (${t})`:"off"}var f=e=>h.hex(m.dim)(e);var _e=e=>h.hex(m.orange)(e),J=e=>h.hex(m.green)(e),be=e=>h.hex(m.amber)(e),D=e=>h.hex(m.red)(e);function Be(e=process.stdout.columns){return Math.max(60,(e&&e>0?e:140)-2)}function Fe(e,t,n,r){let i=e.map((s,l)=>Math.max(s.length,...t.map(d=>(d[l]??"").length),1)),o=e.length*3+1,a=i.reduce((s,l)=>s+l,0)+o-n;if(a<=0)return t;let u=Math.min(a,Math.max(0,i[r]-7));for(i[r]-=u,a-=u;a>0;){let s=-1;if(i.forEach((l,d)=>{l>Math.max(7,e[d].length)&&(s<0||l>i[s])&&(s=d)}),s<0)break;i[s]-=1,a-=1}let c=(s,l)=>s.length<=l?s:`${s.slice(0,Math.max(0,l-1))}\u2026`;return t.map(s=>s.map((l,d)=>c(l,i[d])))}function ye(e,t,n,r){let i=Be(r);return le(e,Fe(e,t,i,n),i,n).map((o,a)=>a===1?h.bold(o):o)}function b(e,t="",n="open"){return`${(n==="done"?J:n==="failed"?D:_e)(`\u25CF ${e}`)}${t?f(t):""}`}function we(e,t){return[D(`error: ${e}`),...t?[`next: ${t}`]:[]]}function Ve(e){return e.current_session?`\u25CF ${e.current_session.state}`:"idle"}function Ge(e,t){if(e.current_session)return`run ${R(e.current_session.run_id)} \xB7 ${Y(e.current_session.started_at,t)}`;let n=e.last_session;return n?[W(n.remark)||"stopped",v(n.ended_at??n.started_at,t)].filter(Boolean).join(" \xB7 "):"never run"}function qe(e,t={}){return(e.project_id?t[e.project_id]:void 0)||(e.name?e.name:"")||R(e.project_id??e.exploration_id)}function $e(e,t){if(!e.length)return[f(t.all?"no explorations":"no running explorations (--all lists every one)")];let n=t.now??Date.now(),r=e.some(a=>a.context),i=["project","app","state","last run",...r?["context"]:[]],o=e.map(a=>[qe(a,t.projects),me(a.target_url),Ve(a),Ge(a,n),...r?[xe(a.context)]:[]]);return[...ye(i,o,1,t.cols),f(`${e.length} exploration${e.length===1?"":"s"} \xB7 newest first${t.nextCursor?` \xB7 more: --cursor ${t.nextCursor}`:""} \xB7 kane-cli explore to open one`)]}function ke(e){return e.credits&&typeof e.credits.total=="number"?Math.round(e.credits.total).toLocaleString("en-US"):""}function je(e,t,n){if(!t.length)return[f(`exploration ${e} has no sessions yet`)];let r=n.now??Date.now(),i=t.map(o=>[R(o.run_id),o.state==="stopped"?"stopped":`\u25CF ${o.state}`,W(o.remark)||"\u2014",o.mode,o.leases===void 0?"":String(o.leases),o.findings===void 0?"":String(o.findings),ke(o),v(o.started_at,r)]);return[...ye(["run","state","remark","mode","leases","findings","credits","started"],i,2,n.cols),f(`${t.length} session${t.length===1?"":"s"} \xB7 --run <run-id> for one in full${n.nextCursor?` \xB7 more: --cursor ${n.nextCursor}`:""}`)]}function X(e,t=18){let n=e.filter(([,i])=>i),r=Math.max(t,...n.map(([i])=>i.length+2));return n.map(([i,o,a])=>` ${f(i.padEnd(r))}${a?a(o):o}`)}function Ee(e){return[h.bold(`run ${e.run_id}`),...X([["exploration",e.exploration_id],["session",`#${e.version}`],["state",e.state,e.state==="stopped"?void 0:_e],["remark",e.remark?`${e.remark.code}: ${e.remark.message}`:""],["stop reason",e.stop_reason??""],["mode",e.mode],["started",j(e.started_at)],["started by",e.started_by_user_id?`user ${e.started_by_user_id}`:""],["claimed",j(e.claimed_at)],["stop asked",j(e.stop_requested_at)],["stopped by",e.stopped_by_user_id?`user ${e.stopped_by_user_id}`:""],["ended",j(e.ended_at)],["leases",e.leases===void 0?"":String(e.leases)],["findings",e.findings===void 0?"":String(e.findings)],["credits",ke(e)],["job",e.hx_job_link??e.hx_job_id??""]])]}function Ce(e){let t=K(e);return e.enabled?e.off_reason?be(t):J(t):f(t)}function We(e,t){return e?t!=null&&e===t?" by you":` by user ${e}`:""}function he(e,t){let n=P(e),r=A(t);return n?!r||r===n?n:`${n} \xB7 ${r}`:r}function at(e){let t=Math.max(20,e.cols??process.stdout.columns??100);return[f("\u2500".repeat(t)),`${e.status}${e.meta.filter(Boolean).length?f(` \xB7 ${e.meta.filter(Boolean).join(" \xB7 ")}`):""}`,...e.tallies?.length?[f(e.tallies.join(" \xB7 "))]:[],f(e.keys.join(" \xB7 "))]}function Te(e){if(!e)return[];let t=(n,r,i)=>typeof n=="number"?`${n} ${n===1?r:i}`:"";return[t(e.junctions,"screen","screens"),t(e.flows,"flow","flows"),t(e.findings,"finding","findings")].filter(Boolean)}function ut(e,t={}){let n=e.last_job,r=e.running_job,i=[h.bold(`Assurance context${t.project?` \xB7 "${t.project}"`:""}`),...X([["state",K(e),()=>Ce(e)],["changed",e.changed_at?`${v(e.changed_at)}${We(e.changed_by_user_id,t.me)}`:""],["pending cut",e.pending_cut?`${A(e.pending_cut.cut)} (${P(e.pending_cut.trigger)})`:"none"],["running job",r?`${R(r.job_id)} \xB7 ${he(r.trigger,r.cut)}${r.status==="launching"?" \xB7 launching (HyperExecute has not answered yet)":""}${r.hx_job_link?` \xB7 ${r.hx_job_link}`:""}`:"none"]]),""],o=["",f(`sync now: kane-cli explore context sync ${e.exploration_id}`)];if(!n)return[...i,f("no assurance job has run yet"),...o];let a=n.use_cases?.added?.length??0,u=n.use_cases?.modified?.length??0,c=n.tests?.failed??[],s=n.status==="ok"||n.status==="noop"?J:n.status==="partial"?be:D;return[...i,h.bold("Last job"),...X([["status",n.status,s],["trigger \xB7 cut",he(n.trigger,n.cut)],["use cases",a||u?`${a} added \xB7 ${u} modified`:""],["tests",n.tests?`${n.tests.designed??0} designed \xB7 ${n.tests.saved??0} saved${c.length?` \xB7 failed: ${c.join(", ")}`:""}`:""],["held",n.held?.length?n.held.map(l=>`${l.ref} (${l.why})`).join("; "):""],["error",n.error?`${n.error.code}${n.error.message?`: ${n.error.message}`:""}`:"",D],["ended",v(n.ended_at)],["credits",typeof n.credits=="number"?String(n.credits):""],["job",n.hx_job_link??n.hx_job_id??n.job_id]]),...(n.attempt??1)>1?[f(" retry of a failed attempt; counts cover this attempt only")]:[],...o]}function lt(e,t){let n=A(t.cut)||"the newest cut",r=f(` status: kane-cli explore context status ${e}`);return t.state==="launched"?[b("assurance job launched",` \xB7 ${P(t.trigger)||"manual"} \xB7 ${n}`),...t.hx_job_link?[f(` job: ${t.hx_job_link}`)]:[],r]:t.state==="launching"?[b("assurance job launching",` \xB7 ${n} \xB7 HyperExecute has not answered yet`),r]:t.state==="pending"&&t.trigger==="run_end"?[b("the run-end job is waiting",` \xB7 a job is running${t.running_job_id?` (${t.running_job_id})`:""}`),f(" this sync was folded into it: the run-end job reads the whole run, so nothing else is queued"),r]:t.state==="pending"?[b(`assurance ${n} pending`,` \xB7 a job is running${t.running_job_id?` (${t.running_job_id})`:""}; this cut runs after it (a newer one replaces it)`),r]:t.state==="running"?[b(`a job is already running on ${n}`,t.job_id?` (${t.job_id})`:""),r]:t.state==="up_to_date"?[b("assurance context up to date",` \xB7 ${t.cut!==void 0&&t.cut!==null?`${A(t.cut)} already read`:"nothing new"}`,"done")]:[b(`assurance sync: ${t.state}`)]}function ct(e,t,n,r){return[b(`assurance context ${n}`,r?` \xB7 "${r}"`:` \xB7 exploration ${e}`,"done"),` ${f("now")} ${Ce(t)}`,...n==="off"?[f(" the next cut is skipped; nothing already saved is deleted"),f(` turn on: kane-cli explore context on ${e}`)]:[f(" the controller catches up from the newest ended run")]]}function z(){return{stdin:!!process.stdin.isTTY,stdout:!!process.stdout.isTTY}}function Se(e,t=z()){return!!e.agent||!t.stdin||!t.stdout}var Ye=ce;function ve(e){return e.option("--agent",Ye)}function Re(e){return{formatHelp(t,n){let r=n.padWidth(t,n),i=n.helpWidth||80,o=2,a=2,u=(p,y)=>{if(!y)return p;let _=r+a;return y.split(`
|
|
3
3
|
`).map((V,Oe)=>n.wrap(`${(Oe===0?p:"").padEnd(_)}${V}`,i-o,_)).join(`
|
|
4
4
|
`)},c=p=>p.join(`
|
|
5
5
|
`).replace(/^/gm," ".repeat(o)),s=[`Usage: ${n.commandUsage(t)}`,""],l=n.commandDescription(t);l&&(s=s.concat([n.wrap(l,i,0),""]));let d=n.visibleArguments(t).map(p=>u(n.argumentTerm(p),n.argumentDescription(p)));d.length&&(s=s.concat(["Arguments:",c(d),""]));let g=n.visibleOptions(t),$=new Set;for(let p of e){let y=p.flags.map(_=>g.find(V=>V.long===_)).filter(_=>!!_&&!$.has(_));if(y.length){for(let _ of y)$.add(_);s=s.concat([`${p.title}:`,c(y.map(_=>u(n.optionTerm(_),_.description))),""])}}let T=g.filter(p=>!$.has(p));T.length&&(s=s.concat(["Other options:",c(T.map(p=>u(n.optionTerm(p),p.description))),""]));let S=n.visibleCommands(t).map(p=>u(n.subcommandTerm(p),n.subcommandDescription(p)));return S.length&&(s=s.concat(["Commands:",c(S),""])),s.join(`
|
|
6
|
-
`)}}}var x=Z(I(),1);function Ke({explorationId:e,facts:t={},done:n}){return(0,x.jsxs)(M,{flexDirection:"column",marginTop:1,children:[(0,x.jsx)(ie,{head:t.project?`Delete "${t.project}"'s exploration?`:"Delete this exploration?",rows:[{label:"exploration",text:e},...t.map?[{label:"map",text:t.map}]:[],{label:"after",text:"the map stays on the service; no command shows it; the project can start a new one"}],minWidth:12}),(0,x.jsx)(M,{marginTop:1,children:(0,x.jsx)(ae,{message:t.project?`Delete "${t.project}"'s exploration?`:"Delete this exploration?",confirmLabel:"Yes, delete",onConfirm:()=>n(!0),onCancel:()=>n(!1)})})]})}async function Q(e,t={}){return await ge(n=>(0,x.jsx)(Ke,{explorationId:e,facts:t,done:n}))===!0}async function Ae(e,t,n={}){let{render:r}=await import("./build-5ZN47FAT.js"),i=Math.max(20,process.stderr.columns??100),o=(n.meta??[]).filter(Boolean),a=r((0,x.jsxs)(M,{flexDirection:"column",children:[(0,x.jsx)(E,{color:m.dim,children:"\u2500".repeat(i)}),(0,x.jsxs)(E,{children:[(0,x.jsx)(te,{active:!0}),(0,x.jsx)(E,{color:m.orange,children:` ${e}`}),o.length?(0,x.jsx)(E,{color:m.dim,children:` \xB7 ${o.join(" \xB7 ")}`}):null]}),n.keys?.length?(0,x.jsx)(E,{color:m.dim,children:n.keys.join(" \xB7 ")}):null]}),{stdout:process.stderr,exitOnCtrlC:!1});try{return await t()}finally{a.clear(),a.unmount()}}var He=e=>h.hex(m.dim)(e),Xe=e=>h.hex(m.green)(e),Ne=2500;async function Je(e,t,n=Ne){let r=[...new Set(t.filter(Boolean))];if(!r.length)return{};let{TmsClient:i}=await import("./tms-client-
|
|
6
|
+
`)}}}var x=Z(I(),1);function Ke({explorationId:e,facts:t={},done:n}){return(0,x.jsxs)(M,{flexDirection:"column",marginTop:1,children:[(0,x.jsx)(ie,{head:t.project?`Delete "${t.project}"'s exploration?`:"Delete this exploration?",rows:[{label:"exploration",text:e},...t.map?[{label:"map",text:t.map}]:[],{label:"after",text:"the map stays on the service; no command shows it; the project can start a new one"}],minWidth:12}),(0,x.jsx)(M,{marginTop:1,children:(0,x.jsx)(ae,{message:t.project?`Delete "${t.project}"'s exploration?`:"Delete this exploration?",confirmLabel:"Yes, delete",onConfirm:()=>n(!0),onCancel:()=>n(!1)})})]})}async function Q(e,t={}){return await ge(n=>(0,x.jsx)(Ke,{explorationId:e,facts:t,done:n}))===!0}async function Ae(e,t,n={}){let{render:r}=await import("./build-5ZN47FAT.js"),i=Math.max(20,process.stderr.columns??100),o=(n.meta??[]).filter(Boolean),a=r((0,x.jsxs)(M,{flexDirection:"column",children:[(0,x.jsx)(E,{color:m.dim,children:"\u2500".repeat(i)}),(0,x.jsxs)(E,{children:[(0,x.jsx)(te,{active:!0}),(0,x.jsx)(E,{color:m.orange,children:` ${e}`}),o.length?(0,x.jsx)(E,{color:m.dim,children:` \xB7 ${o.join(" \xB7 ")}`}):null]}),n.keys?.length?(0,x.jsx)(E,{color:m.dim,children:n.keys.join(" \xB7 ")}):null]}),{stdout:process.stderr,exitOnCtrlC:!1});try{return await t()}finally{a.clear(),a.unmount()}}var He=e=>h.hex(m.dim)(e),Xe=e=>h.hex(m.green)(e),Ne=2500;async function Je(e,t,n=Ne){let r=[...new Set(t.filter(Boolean))];if(!r.length)return{};let{TmsClient:i}=await import("./tms-client-XWCR7O7J.js"),o=new i(G(e.environment??"prod").tmsBaseUrl,e.basic.username,e.basic.access_key),a=async c=>{let s,l=new Promise(d=>{s=setTimeout(()=>d(null),n)});try{let d=await Promise.race([o.getProject(c).catch(()=>null),l]);return d&&d.name?[c,d.name]:null}finally{clearTimeout(s)}},u=await Promise.all(r.map(a));return Object.fromEntries(u.filter(c=>c!==null))}function Le(e,t){return e.projectNames?e.projectNames:e.out?async()=>({}):n=>Je(t,n)}async function H(e,t){let n=new ee,r=e.env??n.getDefaultEnv()??"prod";if(r!=="prod"&&r!=="stage")return{ok:!1,error:`invalid --env: ${String(r)}`};let i=G(r);try{let o=await re({creds:n,env:r,usernameFlag:e.username,accessKeyFlag:e.accessKey,log:()=>{}});return o.basicAuth?{ok:!0,controllerBaseUrl:i.controllerBaseUrl,basic:o.basicAuth,environment:r}:{ok:!1,error:`${t} needs Basic credentials (username + access key); none resolved`}}catch(o){return o instanceof ne&&o.code==="not_authenticated"?{ok:!1,error:"not authenticated: pass --username/--access-key or run 'kane-cli login'"}:{ok:!1,error:`auth resolution failed: ${o.message}`}}}function B(e,t,n){let r=e.io??z(),i=e.tty??!Se(n,r),o=e.out??(s=>{process.stdout.write(s+`
|
|
7
7
|
`)}),a=e.err??(s=>{process.stderr.write(s+`
|
|
8
8
|
`)}),u=i?null:oe("explore"),c=(s,l,d)=>(u?.emit({type:"done",status:l,exit_code:s,exploration_id:t,...d?{error:d}:{}}),s);return{tty:i,out:o,io:r,event:s=>{u?.emit(s)},ok:()=>c(0,"ok"),fail:(s,l=2,d)=>{if(u)se({type:"error",message:s});else for(let g of we(s,d))a(g);return c(l,"error",s)}}}function C(e){if(e instanceof w){let t=e.body&&typeof e.body.message=="string"?e.body.message:e.body&&typeof e.body.error=="string"?e.body.error:"";return t?`${e.code}: ${t}`:e.message}return e instanceof Error?e.message:String(e)}function F(e){return new q({baseUrl:e.controllerBaseUrl,auth:e.basic})}async function ze(e,t={}){let n=B(t,null,e),r=await H(e,"explore list");if(!r.ok)return n.fail(r.error);let i=!!e.all,o;try{o=await F(r).listExplorations({state:i?"all":"running",project:e.project,limit:e.limit,cursor:e.cursor})}catch(u){return n.fail(`could not list explorations: ${C(u)}`,u instanceof w&&u.status<500?2:1)}if(!n.tty)return n.event({type:"explore_list",explorations:o.explorations,next_cursor:o.next_cursor}),n.ok();let a=await Le(t,r)(o.explorations.filter(u=>!u.name).map(u=>u.project_id??""));for(let u of $e(o.explorations,{all:i,nextCursor:o.next_cursor,projects:a}))n.out(u);return n.ok()}var O=class extends Error{constructor(n){super("ambiguous run id");this.ids=n}},U=class extends Error{constructor(n,r){super("no run matches");this.searched=n;this.capped=r}},Qe=100,Ze=100;async function Ie(e,t,n={}){let r=B(n,e,t),i=await H(t,"explore sessions");if(!i.ok)return r.fail(i.error);let o=F(i),a=typeof t.run=="string"&&t.run?t.run:null;try{if(a){let c=async()=>{try{return await o.getSession(e,a)}catch(l){if(!(l instanceof w&&l.status===404)||a.length<8)throw l;let d=[],g,$=0,T=!1;for(let S=0;;S++){if(S===Ze){T=!0;break}let p=await o.listSessions(e,{limit:Qe,cursor:g});if($+=p.sessions.length,d.push(...p.sessions.map(y=>y.run_id).filter(y=>y.startsWith(a)&&y!==a)),!p.next_cursor)break;g=p.next_cursor}if(d.length>1)throw new O(d);if(d.length===0)throw new U($,T);return o.getSession(e,d[0])}},s;try{s=await c()}catch(l){if(l instanceof O)return r.fail(`--run ${a} matches ${l.ids.length} runs`,2,`give more of the id: ${l.ids.join(", ")}`);if(l instanceof U)return r.fail(`session ${a} of exploration ${e} not found: no run id is or starts with it (${l.capped?`searched the newest ${l.searched} runs`:`searched all ${l.searched} runs`})`,2,l.capped?"give the full run id (kane-cli explore sessions <id> lists them)":`kane-cli explore sessions ${e}`);throw l}if(!r.tty)r.event({type:"explore_session",session:s});else for(let l of Ee(s))r.out(l);return r.ok()}let u=await o.listSessions(e,{limit:t.limit,cursor:t.cursor});if(!r.tty)return r.event({type:"explore_sessions",exploration_id:e,sessions:u.sessions,next_cursor:u.next_cursor}),r.ok();for(let c of je(e,u.sessions,{nextCursor:u.next_cursor}))r.out(c);return r.ok()}catch(u){return u instanceof w&&u.status===404?r.fail(a?`session ${a} of exploration ${e} not found`:`exploration ${e} not found`):r.fail(`could not read the sessions: ${C(u)}`,1)}}async function et(e,t,n={}){let r=B(n,e,t);if(!t.yes){if(!r.tty)return r.fail(r.io.stdout?"explore delete needs --yes with --agent or a piped stdin":"explore delete needs --yes when stdout is not a terminal");if(!await(n.confirm??(async()=>{let u=await H(t,"explore delete");if(!u.ok)return Q(e,{});let c=await new q({baseUrl:u.controllerBaseUrl,auth:u.basic,timeoutMs:Ne}).viewSummary(e),s=typeof c?.project_id=="string"?c.project_id:"",l=s?await Le(n,u)([s]):{};return Q(e,{project:l[s]??(s?s.slice(0,8):void 0),map:Te(c?.counts).join(" \xB7 ")})}))(`Delete exploration ${e}? Its map stays on the service but no command shows it again. [y/N] `))return r.out(`exploration ${e} not deleted`),1}let i=await H(t,"explore delete");if(!i.ok)return r.fail(i.error);let o;try{o=await F(i).deleteExploration(e)}catch(a){return a instanceof w&&a.status===404?r.fail(`exploration ${e} not found (or already deleted)`):a instanceof w&&a.code==="RUN_ACTIVE"?r.fail(C(a),1):r.fail(`could not delete exploration ${e}: ${C(a)}`,1)}return r.tty?r.out(b(`exploration ${e} deleted`,o.deleted_at?` \xB7 ${j(o.deleted_at)}`:"","done")):r.event({type:"explore_deleted",exploration_id:o.exploration_id,deleted_at:o.deleted_at}),r.ok()}async function tt(e,t,n={}){let r=B(n,e,t),i=await H(t,"explore stop");if(!i.ok)return r.fail(i.error);let o=t.wait!==!1,a;try{let g=()=>F(i).stopExploration(e,o),$=["explore",e.slice(0,8),i.environment??""];a=r.tty&&!n.out?await Ae(o?"waiting for the run to end":"asking the run to stop",g,{meta:$,keys:["ctrl+c stop waiting (the stop stays)"]}):await g()}catch(g){return g instanceof w&&g.status===404?r.fail(`exploration ${e} not found`):g instanceof w&&g.code==="RUN_NOT_ACTIVE"?r.fail(C(g),1,`nothing is running; kane-cli explore sessions ${e} shows its runs`):r.fail(C(g),1)}let u=a.body,c=typeof u.run_id=="string"?u.run_id:"",s=typeof u.state=="string"?u.state:"",l=u.remark&&typeof u.remark=="object"?u.remark:null,d=s!=="stopped";return r.tty?d?(r.out(b(`stopping run ${c}`," \xB7 its leases finish, every delta is sent")),u.hx_abort&&r.out(`${Xe("\u2713 stop sent")} ${He("the HyperExecute job is told too")}`),r.out(He(` kane-cli explore sessions ${e} --run ${c} shows when it stopped`))):r.out(b(`run ${c} stopped: ${l?`${l.code}${l.message?` (${l.message})`:""}`:"stopped"}`,"","done")):r.event({type:"explore_stop",exploration_id:e,run_id:c,state:s,remark:l,stopping:d,...u.hx_abort?{hx_abort:u.hx_abort}:{}}),r.ok()}function Me(e){let t=Number(e);if(!Number.isInteger(t)||t<1||t>100)throw new ue("must be an integer 1-100");return t}function N(e){return ve(e).option("--env <name>",de).option("--username <user>",pe).option("--access-key <key>",fe)}function L(e,t,n){return e.configureHelp(Re([...t?[t]:[],{title:"Output",flags:["--agent","--help"]},{title:"Account",flags:["--env","--username","--access-key"]}])).addHelpText("after",`
|
|
9
9
|
Examples:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{j as f,xa as a}from"./chunk-
|
|
2
|
+
import{j as f,xa as a}from"./chunk-PI7OXS62.js";import{join as m}from"path";function Q(n,o){if(!f(o))throw new Error(`proposal id ${JSON.stringify(o)} is not a plain name (letters, digits, . _ - after a letter or digit)`);return m(n,"proposals",o,"proposal.json")}import{appendFileSync as g,readdirSync as l,readFileSync as u,rmSync as S,statSync as y}from"fs";import{join as t}from"path";import{randomBytes as E}from"crypto";var j="pending-facts.ndjson",h=/^pending-facts\.(\d+)-[0-9a-f]+\.ndjson$/,N=()=>`pending-facts.${process.pid}-${E(4).toString("hex")}.ndjson`;function v(n,o=1/0){let r=[];for(let i of l(n)){let s=h.exec(i);if(!s)continue;let e=Number(s[1]),c=Date.now()-y(t(n,i)).mtimeMs;if(e!==process.pid&&a(e)&&c<o){r.push(i);continue}let p=u(t(n,i),"utf8").split(`
|
|
3
3
|
`).filter(d=>d!=="");p.length>0&&g(t(n,j),p.join(`
|
|
4
4
|
`)+`
|
|
5
5
|
`),S(t(n,i))}return r}export{Q as a,j as b,h as c,N as d,v as e};
|
|
@@ -1,5 +1,5 @@
|
|
|
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-FI2DVNRT.js";import{a as p}from"./chunk-RZ4F3BHX.js";function f(e,t){if(e===t)return 0;if(e.length===0)return t.length;if(t.length===0)return e.length;let n=new Array(t.length+1),o=new Array(t.length+1);for(let r=0;r<=t.length;r++)n[r]=r;for(let r=1;r<=e.length;r++){o[0]=r;for(let i=1;i<=t.length;i++){let s=e[r-1]===t[i-1]?0:1;o[i]=Math.min(n[i]+1,o[i-1]+1,n[i-1]+s)}[n,o]=[o,n]}return n[t.length]}function C(e){let t=e.indexOf(".");return t>=0?e.slice(0,t):e}function l(e){return e.toLowerCase().replace(/\+/g,"plus").replace(/[^a-z0-9]/g,"")}function u(e){return e==="ios"?{os:"iOS",device:"simulator",target:"simulator"}:{os:"Android",device:"emulator",target:"emulator"}}var x=.4,y=3;function _(e,t,n){let o=l(t);if(o==="")return[];let r=Math.max(1,Math.round(o.length*x)),i=[];for(let s of e.devices){if(n&&!s.osVersions.includes(n))continue;let a=Math.min(f(o,l(s.name)),s.configName?f(o,l(s.configName)):1/0);a<=r&&i.push({device:s,score:a})}return i.sort((s,a)=>s.score-a.score||s.device.name.localeCompare(a.device.name)),i.slice(0,y).map(s=>s.device)}function w(e,t){let n=Number.parseFloat(t);if(!Number.isFinite(n))return e.osVersions[e.osVersions.length-1];let o,r=1/0;for(let i of e.osVersions){let s=Math.abs(Number.parseFloat(i)-n);Number.isFinite(s)&&s<r&&(r=s,o=i)}return o??e.osVersions[e.osVersions.length-1]}function D(e){return` See all devices: kane-cli devices list --target ${u(e).target} --remote`}function N(e,t){let n=l(t);return e.devices.find(o=>l(o.name)===n||o.configName!==void 0&&l(o.configName)===n)}function k(e,t){return e.runson?.[C(t)]}function G(e,t,n){let o=u(e.platform),r=N(e,t);if(!r){let i=_(e,t,n),s=i.length?` Did you mean: ${i.map(a=>`${a.name} (${a.osVersions.join(", ")})`).join(`
|
|
3
3
|
`)}
|
|
4
4
|
`:"";return{ok:!1,code:"device_not_found",detail:`no ${o.device} device named "${t}"`+(n&&i.length?` running ${o.os} ${n}`:"")+`.
|
|
5
5
|
${s}${D(e.platform)}`}}if(!r.osVersions.includes(n)){let i=w(r,n);return{ok:!1,code:"device_os_version_unsupported",detail:`${r.name} does not run ${o.os} ${n}.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{i as n}from"./chunk-XMPTFXPW.js";import{a,b as l}from"./chunk-
|
|
2
|
+
import{i as n}from"./chunk-XMPTFXPW.js";import{a,b as l}from"./chunk-W2HRX3DR.js";import{a as s}from"./chunk-PVN64537.js";import{Ha as t,f as o}from"./chunk-H4TIVILC.js";import{a as i}from"./chunk-4QTH7VYE.js";var d=null;function m(){return d??=a()}function w(){d=null}var x={...l,controller:m},c=e=>new n("CREDENTIALS_MISSING",e.message,e.remedy);async function u(){let e;try{e=await m()}catch(r){throw r instanceof s?c(t.credentialsMissing()):r}if(!e.basic)throw c(e.token?t.loginUnconfirmed():t.credentialsMissing());return e.basic}async function f(){let e=await u();return i(e.username,e.accessKey)}function R(e){return{project:async r=>o({url:e,basicAuth:await f()}).project(r)}}export{m as a,w as b,x as c,u as d,f as e,R as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as m}from"./chunk-
|
|
2
|
+
import{a as m}from"./chunk-PVN64537.js";import{e as y}from"./chunk-ZAQGIC33.js";import{b as d}from"./chunk-FI2DVNRT.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-YMHI3H3Y.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-JEVSVPQ2.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-BCR73VGS.js"),import("./token-refresh-K6PVBBFE.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-BCR73VGS.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{oa as f}from"./chunk-
|
|
2
|
+
import{oa as f}from"./chunk-PI7OXS62.js";import{f as p,g}from"./chunk-KU3YHPWZ.js";import{o as l}from"./chunk-HYJVYYAZ.js";function m(t){let e=(n,r)=>n===null?`"${t.ids.title(r)}"`:f(n);return[...t.awaiting.map(n=>`${e(t.ids.test(n.test),n.test)} checks ${e(t.ids.criterion(n.criterion),n.criterion)}, a criterion not approved yet`),...t.unchanged?[l().text("note.phase_unchanged",{})]:[]]}function y(t,e){return m({awaiting:t.awaitingApproval??[],unchanged:t.unchanged===!0,ids:e})}function O(t,e){return t.map(n=>({test:e.test(n.test)??e.title(n.test),criterion:e.criterion(n.criterion)??e.title(n.criterion)}))}function x(t,e,n={}){if(t.length===0)return null;let r=[...new Set(t.map(c=>c.criterion))],o=r.length===1?e.criterion(r[0]):null,a={tests:new Set(t.map(c=>c.test)).size,criteria:r.length};return n.command===!0?l().text("note.tests_await_approval_command",{...a,criterion:o}):l().text("note.tests_await_approval",{...a,criterion:o===null?null:f(o)})}function A(t,e){let n=new Map,r=t.resolve(e);if(!r)return n;let o=i=>!t.superseded.has(i)&&t.trust.get(i)!=="archived",a=new Set([r.cid,r.tip,t.tipOf(r.cid)]),c=new Set(t.byLabel(p.SCENARIO).filter(({cid:i})=>o(i)&&t.edgesFrom(i).some(s=>s.type===g.BELONGS_TO&&(a.has(s.dst)||a.has(t.tipOf(s.dst))))).map(({cid:i})=>i));for(let{cid:i}of t.byLabel(p.TEST)){if(!o(i))continue;let s=t.edgesFrom(i);if(s.some(d=>d.type===g.AUTOMATES&&c.has(t.tipOf(d.dst))))for(let d of s){if(d.type!==g.VERIFIES)continue;let u=t.tipOf(d.dst);(t.trust.get(u)??"derived")==="derived"&&n.set(u,(n.get(u)??new Set).add(i))}}return n}export{m as a,y as b,O as c,x as d,A as e};
|
|
@@ -1,3 +1,3 @@
|
|
|
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-GBQ4K25P.js";import{e as f}from"./chunk-ZAQGIC33.js";import{g}from"./chunk-HYJVYYAZ.js";import{readFileSync as T,writeFileSync as x,renameSync as _,mkdirSync as I}from"fs";import{dirname as F,join as P}from"path";var A=1,D=720*60*1e3;function p(e){return P(g().baseDir,"embeddings",`alias-${e}.json`)}function y(e,r=Date.now()){return e!==null&&r-e.fetchedAt<D}function E(e){try{let r=JSON.parse(T(e,"utf-8"));return r.wrapperVersion!==A||typeof r.purposes!="object"||r.purposes===null?null:{wrapperVersion:A,writtenByVersion:String(r.writtenByVersion??""),purposes:r.purposes}}catch{return null}}function v(e,r,s=p(e)){let i=E(s)?.purposes?.[r];return!i||typeof i.alias!="string"||typeof i.dims!="number"||typeof i.fetchedAt!="number"?null:{alias:i.alias,dims:i.dims,fetchedAt:i.fetchedAt}}function S(e,r,s,t=p(e)){try{I(F(t),{recursive:!0});let n=E(t)?.purposes??{};n[r]={alias:s.alias,dims:s.dims,fetchedAt:Date.now()};let a={wrapperVersion:A,writtenByVersion:g().version,purposes:n},o=`${t}.tmp`;x(o,JSON.stringify(a,null,2)+`
|
|
3
3
|
`),_(o,t)}catch(i){f(`[embed] Failed to save alias cache: ${i instanceof Error?i.message:String(i)}`,"EMBED_CACHE_WRITE_FAILED")}}async function M(e,r,s,t,i=100){let n=[...r.map((o,l)=>({text:o,query:l})),...s],a=new Array(r.length);for(let o=0;o<n.length;o+=i){let l=n.slice(o,o+i),{vectors:m}=await e(l.map(c=>c.text));l.forEach((c,u)=>{let b=Float32Array.from(m[u]);"query"in c?a[c.query]=b:t(c.cid,b)})}return a}var R=8e3,V=2e4;function B(e,r=process.env){let s=(e instanceof Error?e.message:String(e)).replace(/\b([a-z][a-z0-9+.-]*:\/\/)[^\s/@]+@/gi,"$1[redacted]@").replace(/(authorization\s*[:=])[^\r\n]+/gi,"$1 [redacted]");for(let t of[r.TESTMUAI_API_KEY,r.TESTMUAI_BASIC_AUTH])t&&(s=s.split(t).join("[redacted]"));return s}var d=class extends Error{};async function w(e,r,s){let t=AbortSignal.timeout(r);try{return await s(t)}catch(i){throw t.aborted?new d(`${e} timed out after ${r} ms`):i}}function U(e){return e.TESTMUAI_ENV==="stage"?"stage":"prod"}function C(e){let r=e.env??process.env,s=e.auth?.TESTMUAI_BASIC_AUTH||r.TESTMUAI_BASIC_AUTH;if(s)return{authorization:`Basic ${s}`};let t=e.auth?.TESTMUAI_API_KEY||r.TESTMUAI_API_KEY;return t?{authorization:`Bearer ${t}`}:{}}async function $(e,r={}){let s=r.env??process.env,t=U(s),i=r.aliasCacheFile??p(t),n=r.now??Date.now,a=v(t,e,i);if(y(a,n()))return{alias:a.alias,dims:a.dims};let l=`${h(s)}/assurance/embed/alias?purpose=${encodeURIComponent(e)}`,m=await w("embed alias resolve",r.timeoutMs??R,async c=>{let u=await(r.fetchImpl??fetch)(l,{method:"GET",headers:C(r),signal:c});if(!u.ok)throw new Error(`embed alias resolve failed: ${u.status}`);return await u.json()});return S(t,e,{alias:m.alias,dims:m.dims},i),{alias:m.alias,dims:m.dims}}async function H(e,r,s={}){let t=s.env??process.env,i=h(t);return w("embed",s.timeoutMs??V,async n=>{let a=await(s.fetchImpl??fetch)(`${i}/assurance/embed`,{method:"POST",headers:{...C(s),"content-type":"application/json"},body:JSON.stringify({purpose:e,input:r}),signal:n});if(!a.ok)throw new Error(`embed failed: ${a.status}`);return await a.json()})}function W(){let e=null,r={off:null,traced:!1,calls:t=>({resolveAlias:i=>s("alias",t,n=>$(i,n)),embed:(i,n)=>s("embed",t,a=>H(i,n,a))})};async function s(t,i,n){if(e)throw new d(`similarity search is off for this run: ${e.message}`);let a={};try{return a=await i(),await n(a)}catch(o){throw r.off??={call:t,reason:B(o,{...process.env,...a.auth??{}})},o instanceof d&&(e=o),o}}return r}function q(e,r){!e.off||e.traced||(e.traced=!0,r("similarity_off",e.off))}function Z(e,r,s,t){try{return e.vectors().read(r,s,t)}catch{return null}}function ee(e,r,s,t,i){try{e.vectors().write(r,s,t,i)}catch(n){f(`[embed] Failed to cache vector: ${n instanceof Error?n.message:String(n)}`,"EMBED_CACHE_WRITE_FAILED")}}function re(e,r,s,t){e.vectors().prefetch(r,s,t)}export{M as a,W as b,q as c,Z as d,ee as e,re as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as D,f as B}from"./chunk-ZHWU6L2G.js";import{M as S,sb as M,v as L}from"./chunk-
|
|
2
|
+
import{e as D,f as B}from"./chunk-ZHWU6L2G.js";import{M as S,sb as M,v as L}from"./chunk-PI7OXS62.js";import{c as E,n as O}from"./chunk-DBMW3VUN.js";import{f as y,g as _}from"./chunk-KU3YHPWZ.js";function $(i,r,e){let t=L(i,r,e);return t===null?null:t.toString("utf8")}var T=128*1024,A=64*1024;function j(i,r){let e=i.split(`
|
|
3
3
|
`),t=r.split(`
|
|
4
4
|
`),n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;let o=e.length,c=t.length;for(;o>n&&c>n&&e[o-1]===t[c-1];)o--,c--;if(o===n&&c===n)return"";let h=e.slice(n,o),g=t.slice(n,c),a=R(h,g,2e3),p=[];if(a===null)p.push(`@@ old L${n+1}-L${o} \u2192 new L${n+1}-L${c} @@`,...h.map(u=>`- ${u}`),...g.map(u=>`+ ${u}`));else{let u=a.map((s,b)=>s.op==="="?-1:b).filter(s=>s>=0),d=0;for(;d<u.length;){let s=d;for(;s+1<u.length&&u[s+1]-u[s]<=3;)s++;let b=Math.max(u[d]-1,0),m=Math.min(u[s]+1,a.length-1),f=a.slice(b,m+1),x=n+(f[0].ai??0)+1,w=n+(f[0].bi??0)+1,U=f.filter(v=>v.op!=="+").length,H=f.filter(v=>v.op!=="-").length;p.push(`@@ old L${x}-L${x+Math.max(U-1,0)} \u2192 new L${w}-L${w+Math.max(H-1,0)} @@`);for(let v of f)p.push(v.op==="="?` ${v.line}`:`${v.op} ${v.line}`);d=s+1}}return p.join(`
|
|
5
5
|
`)}function R(i,r,e){let t=i.length,n=r.length,o=Math.min(t+n,e),c=new Map([[1,0]]),h=[],g=!1;for(let u=0;u<=o&&!g;u++){h.push(new Map(c));for(let d=-u;d<=u;d+=2){let s=d===-u||d!==u&&(c.get(d-1)??0)<(c.get(d+1)??0)?c.get(d+1)??0:(c.get(d-1)??0)+1,b=s-d;for(;s<t&&b<n&&i[s]===r[b];)s++,b++;if(c.set(d,s),s>=t&&b>=n){g=!0;break}}}if(!g)return null;let l=t,a=n,p=[];for(let u=h.length-1;u>0;u--){let d=h[u],s=l-a,b=s===-u||s!==u&&(d.get(s-1)??0)<(d.get(s+1)??0)?s+1:s-1,m=d.get(b)??0,f=m-b;for(;l>m&&a>f;)p.push({op:"=",line:i[l-1],ai:l-1,bi:a-1}),l--,a--;u>0&&(l===m?(p.push({op:"+",line:r[a-1],ai:l,bi:a-1}),a--):(p.push({op:"-",line:i[l-1],ai:l-1,bi:a}),l--))}for(;l>0&&a>0;)p.push({op:"=",line:i[l-1],ai:l-1,bi:a-1}),l--,a--;for(;l>0;)p.push({op:"-",line:i[l-1],ai:l-1,bi:0}),l--;for(;a>0;)p.push({op:"+",line:r[a-1],ai:0,bi:a-1}),a--;return p.reverse()}function F(i){let r=Buffer.byteLength(i,"utf8");if(r<=T+A)return{diff:i,truncated:!1};let e=Buffer.from(i,"utf8"),t=T;for(;t>0&&(e[t]&192)===128;)t--;let n=r-A;for(;n<r&&(e[n]&192)===128;)n++;let o=e.subarray(0,t).toString("utf8"),c=e.subarray(n).toString("utf8");return{diff:`${o}
|