@testmuai/kane-cli 0.10.0-rc.1 → 0.10.0
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-XUV3EQPZ.js +2 -0
- package/dist/{ChromeProfilePicker-CRKQEFYD.js → ChromeProfilePicker-FWPUDKD6.js} +1 -1
- package/dist/{CliFeedbackPrompt-M7BMWLKK.js → CliFeedbackPrompt-D5L2DO6A.js} +1 -1
- package/dist/{CliUploadProgress-OP7DXMC2.js → CliUploadProgress-HQX57WE6.js} +1 -1
- package/dist/{ConfigView-XI74BCCH.js → ConfigView-DGQXKEON.js} +1 -1
- package/dist/EvidenceViewOffer-EIANIYN7.js +2 -0
- package/dist/FolderPicker-XOA7FTHF.js +2 -0
- package/dist/InfoBox-OBH7SUGC.js +2 -0
- package/dist/{LinksBox-PNSESNCU.js → LinksBox-WZ4RAMSH.js} +1 -1
- package/dist/{ProfilesView-PYDZZHKO.js → ProfilesView-AGRNPGSW.js} +1 -1
- package/dist/ProjectPicker-6KRLKV4U.js +2 -0
- package/dist/SaveSessionPrompt-J2OPDEOO.js +2 -0
- package/dist/SingleShotApp-QI4B2TSL.js +2 -0
- package/dist/{SummaryBox-FALOODAQ.js → SummaryBox-XQJUZBAN.js} +1 -1
- package/dist/TestMdRunView-I4MV54FB.js +2 -0
- package/dist/TestrunEvidenceTable-WEIUSW3E.js +2 -0
- package/dist/{WhoamiView-6WXGRANY.js → WhoamiView-JQCURK2M.js} +1 -1
- package/dist/{app-download-RXVZB6MM.js → app-download-OU6AGH2X.js} +1 -1
- package/dist/{assurance-job-C3TXZGLL.js → assurance-job-ZI3L6I4F.js} +1 -1
- package/dist/{binary-DJCDMGPX.js → binary-S5YL5GJD.js} +1 -1
- package/dist/bind-LIV72SEZ.js +2 -0
- package/dist/bootstrap-3V6TOO6I.js +2 -0
- package/dist/{bridge-T6QMYKED.js → bridge-SDEP7Y33.js} +1 -1
- package/dist/{catalog-RRQF4TCA.js → catalog-I3PC6LT6.js} +1 -1
- package/dist/catalog-client-WKYG3JN6.js +2 -0
- package/dist/{changelog-GBEVIUFJ.js → changelog-IHNWFYWY.js} +1 -1
- package/dist/chat-committer-FM5NG46O.js +2 -0
- package/dist/{chat-controller-XINCDH6Z.js → chat-controller-FWFQVZTB.js} +1 -1
- package/dist/child-H2YSDFCG.js +2 -0
- package/dist/{chunk-QDFY5GGO.js → chunk-252GEI3H.js} +1 -1
- package/dist/{chunk-TNORODUF.js → chunk-2B75UL7Y.js} +1 -1
- package/dist/{chunk-B2HXPGIZ.js → chunk-2EVP636F.js} +17 -17
- package/dist/{chunk-7XBNMOH4.js → chunk-2GE5X2A5.js} +1 -1
- package/dist/{chunk-NWBLYMH7.js → chunk-2L3A5NKZ.js} +1 -1
- package/dist/{chunk-2OOFURWD.js → chunk-2N75WO7Y.js} +1 -1
- package/dist/{chunk-LRXBJTD4.js → chunk-2PZKMT3I.js} +1 -1
- package/dist/{chunk-N3TCNZSX.js → chunk-2SY2NCOP.js} +1 -1
- package/dist/{chunk-Q3C6NDGI.js → chunk-32Y6QVFG.js} +1 -1
- package/dist/{chunk-QS5ZJFGF.js → chunk-3OVFKUXV.js} +1 -1
- package/dist/{chunk-DHQ4SQWA.js → chunk-3T2TYDPT.js} +1 -1
- package/dist/{chunk-RG372DON.js → chunk-3UHPVQLU.js} +1 -1
- package/dist/{chunk-WYSZ6TPW.js → chunk-3ZPEQDXZ.js} +10 -9
- package/dist/{chunk-XJ7HCXKW.js → chunk-436FZ4KG.js} +1 -1
- package/dist/{chunk-6U7ID777.js → chunk-4523YDTG.js} +1 -1
- package/dist/{chunk-T7H4LBFK.js → chunk-45URQUAK.js} +1 -1
- package/dist/{chunk-4D5PC6QE.js → chunk-4BUEOKFV.js} +1 -1
- package/dist/{chunk-MII3JOO3.js → chunk-4JWJH6TB.js} +1 -1
- package/dist/{chunk-WEM3MOAL.js → chunk-4MNSP4EO.js} +1 -1
- package/dist/{chunk-ZFMRQ57Y.js → chunk-4NUSW4A2.js} +1 -1
- package/dist/{chunk-FSYOTRMC.js → chunk-4R4YUOVY.js} +1 -1
- package/dist/{chunk-T4AVLJCW.js → chunk-4SJAOAYY.js} +1 -1
- package/dist/{chunk-SMTBOSEJ.js → chunk-52VCA4K2.js} +1 -1
- package/dist/{chunk-672CQECV.js → chunk-567D5ZTO.js} +7 -7
- package/dist/{chunk-M6MBMRFR.js → chunk-5IO5ZC4S.js} +1 -1
- package/dist/{chunk-LSDJOVWW.js → chunk-5R3ODQHH.js} +1 -1
- package/dist/{chunk-I2KOGINW.js → chunk-5T6II7VN.js} +1 -1
- package/dist/{chunk-DDJNYQBH.js → chunk-65BG6GAE.js} +1 -1
- package/dist/{chunk-S53AQU7R.js → chunk-6DZ7LVOG.js} +1 -1
- package/dist/chunk-6K5BEEAJ.js +2 -0
- package/dist/{chunk-42PALMW2.js → chunk-6TNLITJO.js} +1 -1
- package/dist/{chunk-A6TJOZ24.js → chunk-7C4IEL5V.js} +1 -1
- package/dist/{chunk-PUVMC4PX.js → chunk-7V34ZMMS.js} +1 -1
- package/dist/{chunk-SONMD3W5.js → chunk-7ZJWUWSN.js} +1 -1
- package/dist/{chunk-OVNRRI4E.js → chunk-A3TCFSCK.js} +1 -1
- package/dist/{chunk-BJJUKB5K.js → chunk-A4BB6GLN.js} +1 -1
- package/dist/{chunk-V7S6S5W3.js → chunk-AG5XJWEV.js} +1 -1
- package/dist/{chunk-VYHT2IET.js → chunk-AGXAJ2II.js} +1 -1
- package/dist/{chunk-6UVIY56J.js → chunk-AIGQCMGY.js} +1 -1
- package/dist/{chunk-RX6776AI.js → chunk-AU26ZZTX.js} +1 -1
- package/dist/{chunk-OEWYXCTA.js → chunk-AUBSLPJZ.js} +1 -1
- package/dist/{chunk-6LIC2R22.js → chunk-B2WFW74J.js} +1 -1
- package/dist/{chunk-NXRF7FFS.js → chunk-B7JLM3IX.js} +1 -1
- package/dist/{chunk-QNLVC5ZB.js → chunk-BRVIK3BU.js} +1 -1
- package/dist/{chunk-WI7K6VKQ.js → chunk-BY2B4YJN.js} +1 -1
- package/dist/{chunk-DNGOT65K.js → chunk-CBVHP7JB.js} +1 -1
- package/dist/{chunk-ZFM77AQU.js → chunk-CJE7PKRV.js} +1 -1
- package/dist/{chunk-AA674WLL.js → chunk-CJQUVHHS.js} +1 -1
- package/dist/{chunk-OFSDB7B4.js → chunk-COJINPOK.js} +2 -2
- package/dist/{chunk-IBBD36FQ.js → chunk-D6CS62O7.js} +1 -1
- package/dist/{chunk-252FWF2G.js → chunk-DBTMKBHU.js} +1 -1
- package/dist/{chunk-QCKA665H.js → chunk-DHYGCHKB.js} +1 -1
- package/dist/{chunk-TW63WWEN.js → chunk-DTYT6KBO.js} +1 -1
- package/dist/{chunk-QHRUBG7J.js → chunk-EC5IP5HZ.js} +1 -1
- package/dist/{chunk-35ECWCCK.js → chunk-EH43VWVR.js} +1 -1
- package/dist/{chunk-HQ2E2XCU.js → chunk-ENG2UTMX.js} +1 -1
- package/dist/{chunk-BZVNI44O.js → chunk-EPJ5SJL2.js} +2 -2
- package/dist/{chunk-F3U6T4YD.js → chunk-EQWMOGLO.js} +9 -9
- package/dist/{chunk-OF7WPCTQ.js → chunk-EVZLINBN.js} +1 -1
- package/dist/{chunk-44B6THYK.js → chunk-EX6ORR7P.js} +1 -1
- package/dist/{chunk-UAWWLLTI.js → chunk-FBQ7PQJV.js} +1 -1
- package/dist/{chunk-UALJTPSA.js → chunk-FLOQ5NZL.js} +2 -2
- package/dist/{chunk-LCSJ7GOG.js → chunk-FPPVNF53.js} +1 -1
- package/dist/{chunk-5BUIIFLC.js → chunk-FPVGA6XT.js} +1 -1
- package/dist/{chunk-IXW7FOGX.js → chunk-FVYIV36L.js} +1 -1
- package/dist/chunk-FYCD765R.js +161 -0
- package/dist/{chunk-AVI5H4UM.js → chunk-G2KTWFMU.js} +1 -1
- package/dist/{chunk-CPBBYNL7.js → chunk-G3CYFCSR.js} +1 -1
- package/dist/{chunk-JNSWKGTB.js → chunk-G3J4XY3Z.js} +1 -1
- package/dist/{chunk-IMDMRJQ6.js → chunk-GET4DINR.js} +2 -2
- package/dist/{chunk-54XA5MZH.js → chunk-GGS3ATPB.js} +1 -1
- package/dist/{chunk-MGNRNLBE.js → chunk-GGV336P5.js} +1 -1
- package/dist/{chunk-OQ5G773E.js → chunk-GI2JPIX5.js} +1 -1
- package/dist/{chunk-HAW5WEKT.js → chunk-GRO6DLN3.js} +1 -1
- package/dist/{chunk-LRS5MGBY.js → chunk-GXMD23XB.js} +1 -1
- package/dist/chunk-GYDJO32R.js +2 -0
- package/dist/{chunk-W7FLXW6Q.js → chunk-H4KPNGY4.js} +1 -1
- package/dist/{chunk-Y4T4SLDO.js → chunk-HBVHIEPB.js} +1 -1
- package/dist/{chunk-EF47KRUK.js → chunk-HGVM2OZU.js} +1 -1
- package/dist/{chunk-DD5TULWQ.js → chunk-HMQ5M4JJ.js} +1 -1
- package/dist/{chunk-ZTHYAHDN.js → chunk-I2VU2DTS.js} +1 -1
- package/dist/{chunk-7NCJMWFX.js → chunk-J4LQAT5P.js} +1 -1
- package/dist/{chunk-ZZP5SHUV.js → chunk-JCSVBD4F.js} +1 -1
- package/dist/{chunk-57MDWTON.js → chunk-JFBEHCJN.js} +1 -1
- package/dist/{chunk-JQSLUGD4.js → chunk-JGLADDRH.js} +1 -1
- package/dist/{chunk-JPYW6U4D.js → chunk-JOCEZK2M.js} +1 -1
- package/dist/{chunk-7LKCWO2R.js → chunk-JQ7ZZQXC.js} +3 -3
- package/dist/{chunk-QQ4TKLWP.js → chunk-JRSEAXFE.js} +1 -1
- package/dist/{chunk-2IZRPMZN.js → chunk-JSLKCCD2.js} +1 -1
- package/dist/{chunk-H3HHSTEK.js → chunk-JT6WLJSV.js} +1 -1
- package/dist/{chunk-4LPX2OLV.js → chunk-JTJ7IPNI.js} +1 -1
- package/dist/{chunk-2NFS4KE4.js → chunk-JX5NVKTV.js} +1 -1
- package/dist/{chunk-6NWT2TEJ.js → chunk-K2PLULJD.js} +1 -1
- package/dist/{chunk-SWMTXMKB.js → chunk-K3OSK6PB.js} +1 -1
- package/dist/{chunk-3GXN6VF6.js → chunk-KDR662D2.js} +1 -1
- package/dist/{chunk-NLZZLANH.js → chunk-KRRZCY7U.js} +1 -1
- package/dist/{chunk-NDEI7R4K.js → chunk-LHQUCRCH.js} +1 -1
- package/dist/{chunk-WOSANGV6.js → chunk-LNHBZEDC.js} +1 -1
- package/dist/{chunk-PZA3BSOE.js → chunk-LXM7VHYN.js} +1 -1
- package/dist/{chunk-LNNWCBPQ.js → chunk-MHB6DMKZ.js} +1 -1
- package/dist/{chunk-NFRA64NU.js → chunk-MJKRJGER.js} +1 -1
- package/dist/{chunk-BVO4C5F2.js → chunk-MKPDF26Q.js} +1 -1
- package/dist/{chunk-VLDCHFXF.js → chunk-MPEIMWQI.js} +1 -1
- package/dist/{chunk-YIKF4ERQ.js → chunk-MW2WNYJO.js} +2 -2
- package/dist/{chunk-MYVKUJGS.js → chunk-N3KTLWJL.js} +1 -1
- package/dist/{chunk-XIPKSXRQ.js → chunk-NJCN6LP5.js} +6 -6
- package/dist/{chunk-2S3W2JT3.js → chunk-NOFJXCYP.js} +1 -1
- package/dist/{chunk-3UVSAAES.js → chunk-NTXFPNAP.js} +1 -1
- package/dist/{chunk-RW3Z2HMB.js → chunk-ONZ2CSTZ.js} +1 -1
- package/dist/{chunk-UYDHOHSZ.js → chunk-OR2B6T3B.js} +1 -1
- package/dist/{chunk-UUJIGOEO.js → chunk-ORNVIEUA.js} +1 -1
- package/dist/{chunk-R7KXAISS.js → chunk-P2LDAW3C.js} +1 -1
- package/dist/{chunk-T3HEJASG.js → chunk-PBWYQR5I.js} +1 -1
- package/dist/{chunk-O3HHTKZ5.js → chunk-PCDIEYV6.js} +1 -1
- package/dist/{chunk-EZN7CF45.js → chunk-PL3SG3M2.js} +1 -1
- package/dist/{chunk-SA6IKFFD.js → chunk-PQXYHI5W.js} +1 -1
- package/dist/{chunk-JD52IXON.js → chunk-PTISAIZW.js} +1 -1
- package/dist/{chunk-XZYA7DNH.js → chunk-PVN64537.js} +1 -1
- package/dist/{chunk-GZFLJORM.js → chunk-QECTIQAC.js} +1 -1
- package/dist/chunk-QMOGBKJM.js +2 -0
- package/dist/{chunk-L4UVUFL6.js → chunk-QQI6N3FO.js} +1 -1
- package/dist/{chunk-7RWP4Y3H.js → chunk-QVP4FSKT.js} +1 -1
- package/dist/{chunk-2SWSVJUP.js → chunk-QWZJ5QDO.js} +2 -2
- package/dist/{chunk-RX47NRSM.js → chunk-RARD6TC6.js} +1 -1
- package/dist/chunk-RDH3E25Q.js +27 -0
- package/dist/{chunk-AZLNLHUA.js → chunk-RLOJH5O6.js} +1 -1
- package/dist/{chunk-RPRXRKKR.js → chunk-RQKMSNEU.js} +1 -1
- package/dist/{chunk-R4JUKTDO.js → chunk-SB6P5EQH.js} +1 -1
- package/dist/{chunk-V5JGXOV7.js → chunk-SBR6D6GS.js} +1 -1
- package/dist/{chunk-W3OVSDBN.js → chunk-TLOYTGVT.js} +5 -5
- package/dist/{chunk-OZNBTSW5.js → chunk-TZVPDGJD.js} +1 -1
- package/dist/{chunk-D756UWY2.js → chunk-U7NRZBB5.js} +1 -1
- package/dist/{chunk-72RC7JSA.js → chunk-UEPJ26X2.js} +1 -1
- package/dist/chunk-UJLULWSR.js +21 -0
- package/dist/{chunk-7RPKHKA3.js → chunk-ULGBK4NS.js} +1 -1
- package/dist/{chunk-VQLH63X7.js → chunk-UNWPBMVM.js} +1 -1
- package/dist/chunk-URAYFJGM.js +87 -0
- package/dist/{chunk-FIP5L6LV.js → chunk-USJ3LUAL.js} +1 -1
- package/dist/chunk-UUWSULIM.js +101 -0
- package/dist/chunk-UX2CDUPE.js +9 -0
- package/dist/{chunk-AIXJYMSP.js → chunk-VA3BSIUQ.js} +1 -1
- package/dist/chunk-VQZOKTJ2.js +12 -0
- package/dist/{chunk-VG44B5JD.js → chunk-VVCZRCRD.js} +1 -1
- package/dist/{chunk-XBEYWXPV.js → chunk-VZA7BPCK.js} +1 -1
- package/dist/{chunk-NQTYWHPB.js → chunk-W3NWHWK2.js} +1 -1
- package/dist/{chunk-E6KSRQXL.js → chunk-WERIGVOH.js} +1 -1
- package/dist/{chunk-7EXDYXXD.js → chunk-WKZLK57W.js} +1 -1
- package/dist/{chunk-I5NSJBOZ.js → chunk-WQR2GYP7.js} +1 -1
- package/dist/{chunk-OAKYUBD3.js → chunk-WX4VGH5Q.js} +1 -1
- package/dist/{chunk-OJ33Q6DU.js → chunk-WZLDFEWR.js} +1 -1
- package/dist/{chunk-HFJSP4KD.js → chunk-X3J4CC27.js} +1 -1
- package/dist/chunk-XLQ4F6BI.js +9 -0
- package/dist/{chunk-D4FFXCX6.js → chunk-XMALVGH7.js} +2 -2
- package/dist/{chunk-AJQZ3ST5.js → chunk-Y3YULFCK.js} +1 -1
- package/dist/{chunk-RFIIM33J.js → chunk-YGMQXS2J.js} +1 -1
- package/dist/{chunk-RDP7GWSY.js → chunk-YH4VZVHJ.js} +1 -1
- package/dist/{chunk-ENL4XTQ2.js → chunk-YI4ESDAX.js} +1 -1
- package/dist/{chunk-K45BKGB5.js → chunk-YKL5H4K6.js} +1 -1
- package/dist/{chunk-74W4AOT2.js → chunk-YKOEABP2.js} +1 -1
- package/dist/{chunk-P7MSVLAH.js → chunk-YYVBE6W2.js} +1 -1
- package/dist/{chunk-432ZOE42.js → chunk-Z5BFCTHI.js} +2 -2
- package/dist/{chunk-UEE3RZN4.js → chunk-Z777GGHB.js} +1 -1
- package/dist/{chunk-FFL55I2M.js → chunk-ZGQM6KWN.js} +1 -1
- package/dist/{chunk-T6K2MEWP.js → chunk-ZI3X7DI2.js} +1 -1
- package/dist/{chunk-NWD54VV5.js → chunk-ZKPY3AXW.js} +1 -1
- package/dist/chunk-ZRDX2ARO.js +4 -0
- package/dist/{chunk-MNBGG4H3.js → chunk-ZTAZ2R5Z.js} +1 -1
- package/dist/{chunk-LKQFG4RW.js → chunk-ZY65IZJR.js} +1 -1
- package/dist/{chunk-LWJRSUE2.js → chunk-ZZNQIFFI.js} +1 -1
- package/dist/commands-QOORPTSI.js +2 -0
- package/dist/{committer-JGY66PFM.js → committer-26UZDYSA.js} +1 -1
- package/dist/{config-5ZOALGKE.js → config-B472DZSR.js} +1 -1
- package/dist/{cover-cmd-UA2SVIZZ.js → cover-cmd-3VO6QC5Y.js} +1 -1
- package/dist/{credentials-MRG452Y6.js → credentials-TLT3RQOO.js} +1 -1
- package/dist/{deps-bundle-FWINW4XM.js → deps-bundle-CMTIWBS5.js} +1 -1
- package/dist/{deps-resolve-IET4KIBO.js → deps-resolve-XLFZK74A.js} +1 -1
- package/dist/{design-chat-MM5PJD2N.js → design-chat-I7X3QDDY.js} +1 -1
- package/dist/design-committer-Y7R56RFZ.js +2 -0
- package/dist/design-headless-HUQOXLZB.js +2 -0
- package/dist/{design-remote-SPVRIY2H.js → design-remote-UDC5FP45.js} +2 -2
- package/dist/device-env-MMGISNHN.js +2 -0
- package/dist/dispatch-P2445PUU.js +2 -0
- package/dist/{doctor-VAX2BWQF.js → doctor-UHFCIM4B.js} +1 -1
- package/dist/{docx-convert-6IZO5P5K.js → docx-convert-N4KMLLKO.js} +1 -1
- package/dist/{dossier-NROC2MCY.js → dossier-6KMKEIXV.js} +1 -1
- package/dist/evidence-M3JTOJNL.js +2 -0
- package/dist/{evidence-presentation-YYTIDCBS.js → evidence-presentation-DV3DRB4S.js} +1 -1
- package/dist/evolve-cmd-K3JXACMN.js +2 -0
- package/dist/{evolve-remote-BGHULJTL.js → evolve-remote-CUDVV2O2.js} +1 -1
- package/dist/{exit-manager-EDHCETUN.js → exit-manager-EGWAZHCR.js} +1 -1
- package/dist/{explain-cmd-WOBGS6KX.js → explain-cmd-235TY7QX.js} +1 -1
- package/dist/{explain-cmd-VYAANFFZ.js → explain-cmd-R67B4YR3.js} +1 -1
- package/dist/explore-UDD5FHXW.js +2 -0
- package/dist/{explore-context-tty-JTZVZFOE.js → explore-context-tty-YXEFT32U.js} +1 -1
- package/dist/{explore-entry-5OGNLFAU.js → explore-entry-V6L5FSP4.js} +4 -4
- package/dist/{explore-live-2XZHUYFS.js → explore-live-N5VBLBUI.js} +1 -1
- package/dist/{explore-run-tty-LGTIK2NA.js → explore-run-tty-ZZQ33GNA.js} +2 -2
- package/dist/{extract-bind-NM2BBK4I.js → extract-bind-BTINHHE5.js} +3 -3
- package/dist/{extract-chat-HLQMJJIC.js → extract-chat-ABZ5S7UU.js} +1 -1
- package/dist/{extract-cmd-T2TSAC3N.js → extract-cmd-45OZETCM.js} +2 -2
- package/dist/extract-headless-ALEFAMVS.js +2 -0
- package/dist/{feeder-NY45UFJK.js → feeder-L55TH2NC.js} +1 -1
- package/dist/folder-flags-HTKJCXKB.js +2 -0
- package/dist/{gaps-cmd-PTSKPTF7.js → gaps-cmd-ROGQWK5X.js} +1 -1
- package/dist/{gate-WISOUTHQ.js → gate-QA5J7UZA.js} +1 -1
- package/dist/gate-XFFFX5ZF.js +2 -0
- package/dist/{generate-headless-JYZP6VXZ.js → generate-headless-DAH3HHRQ.js} +2 -2
- package/dist/hold-passthrough-K5PP26CP.js +2 -0
- package/dist/impact-cmd-3VFJAKYK.js +11 -0
- package/dist/index.js +171 -165
- package/dist/ingest-S5R736ZV.js +2 -0
- package/dist/{ingest-cmd-LHCBMO4Z.js → ingest-cmd-YSEH5EPU.js} +3 -3
- package/dist/ingest-remote-C6AP2Q7E.js +2 -0
- package/dist/install-B26Y2NU4.js +2 -0
- package/dist/{interactive-bind-5EJQUGKI.js → interactive-bind-P3GTFIZM.js} +4 -4
- package/dist/{interactive-remote-D77ULJGL.js → interactive-remote-PBRQHTAF.js} +2 -2
- package/dist/lane-7IEAE6AC.js +2 -0
- package/dist/lattice-auth-7EL4ET3P.js +2 -0
- package/dist/{lifecycle-cmd-7SM6UCMH.js → lifecycle-cmd-PUNFWKV5.js} +1 -1
- package/dist/{list-cmd-Z6FZXMFU.js → list-cmd-RD7YBF4S.js} +1 -1
- package/dist/list-commands-UZELZAB3.js +2 -0
- package/dist/{list-remote-WOPOC6KK.js → list-remote-KGKXPCQA.js} +1 -1
- package/dist/{locks-cmd-JJ2QNTNY.js → locks-cmd-LXZ6I4QG.js} +1 -1
- package/dist/{logical-ids-RXAQJZ3T.js → logical-ids-D5PFYY4C.js} +1 -1
- package/dist/login-flow-CHLGQGHK.js +2 -0
- package/dist/{maintenance-cmd-VRTGZVRE.js → maintenance-cmd-WRWBCP3R.js} +1 -1
- package/dist/{mobile-prompts-KNAHU64X.js → mobile-prompts-Z7NQHRGP.js} +1 -1
- package/dist/{onboarding-LGT6PMDZ.js → onboarding-ZP4XDYEO.js} +1 -1
- package/dist/{open-provider-OZAG6WZS.js → open-provider-U26BBVUE.js} +1 -1
- package/dist/pdf-convert-LMKOKLXT.js +2 -0
- package/dist/{persist-recorded-session-BX7II5P7.js → persist-recorded-session-4IRYG5CJ.js} +1 -1
- package/dist/phase-seed-2H6OXZXT.js +2 -0
- package/dist/pipeline-U7D25NST.js +2 -0
- package/dist/policy-commands-TY6WOR73.js +8 -0
- package/dist/prepare-target-EVL2QSXA.js +2 -0
- package/dist/{pull-cmd-6AL2WYHB.js → pull-cmd-QJQANBAW.js} +1 -1
- package/dist/pull-route-AIOTLA3D.js +2 -0
- package/dist/{readmodel-INMP6MNW.js → readmodel-KXCFPL2M.js} +1 -1
- package/dist/real-device-run-QODMDUXF.js +2 -0
- package/dist/{reconcile-cmd-R6H37SQR.js → reconcile-cmd-IJTQAJZX.js} +4 -4
- package/dist/reconcile-deps-2CTIFXDR.js +2 -0
- package/dist/{reconcile-remote-GWDV5CUT.js → reconcile-remote-23D6SXXT.js} +2 -2
- package/dist/{recording-banner-ACC67Q2U.js → recording-banner-MNRMMEX4.js} +1 -1
- package/dist/registry-MZYBLEW2.js +2 -0
- package/dist/remote-entry-DW2J56N4.js +2 -0
- package/dist/remote-mode-AFNCN6EE.js +4 -0
- package/dist/{remote-words-45USLRVN.js → remote-words-RCNFI2TQ.js} +1 -1
- package/dist/{require-project-folder-A3UDRELU.js → require-project-folder-7UH43GHI.js} +1 -1
- package/dist/{resolve-run-intent-ZGPSUBXV.js → resolve-run-intent-XEWFYMGN.js} +1 -1
- package/dist/{resolver-IPM6R7U4.js → resolver-QMPX6RBR.js} +1 -1
- package/dist/{revert-FHOBLZWF.js → revert-37346WLE.js} +1 -1
- package/dist/{review-cmd-NNT5C5RZ.js → review-cmd-2OECKNL5.js} +1 -1
- package/dist/run-JWOHNWA3.js +2 -0
- package/dist/run-QFJ6ZRVD.js +2 -0
- package/dist/run-remote-66QTUQ2M.js +2 -0
- package/dist/{run-startup-gate-NKRMKYBB.js → run-startup-gate-USQFSW47.js} +1 -1
- package/dist/run-test-md-7DRWCSQE.js +19 -0
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-cmd-GYMETJHG.js → sessions-cmd-LQ2LZQOC.js} +2 -2
- package/dist/{sessions-remote-GI7GOBMH.js → sessions-remote-H7CQST42.js} +1 -1
- package/dist/{skill-installer-3QAVQGDH.js → skill-installer-LKYY6XFJ.js} +1 -1
- package/dist/{store-X6XPFSKF.js → store-KM5MG3XB.js} +1 -1
- package/dist/store-choice-4J2NN6OQ.js +2 -0
- package/dist/store-guard-34GG2TW2.js +2 -0
- package/dist/{store-site-KA2DNBGY.js → store-site-ZSFINU6C.js} +1 -1
- package/dist/stream-warnings-N4KVVWXV.js +2 -0
- package/dist/sync-cmd-3CHSWWWW.js +2 -0
- package/dist/{sync-setup-5NUCH6N3.js → sync-setup-QQXYO6R4.js} +1 -1
- package/dist/tcg-generate-IPD5FQUW.js +2 -0
- package/dist/{test-definition-VRI4YIYL.js → test-definition-53XNBEDE.js} +1 -1
- package/dist/testmd-actions-V7P7BMKE.js +2 -0
- package/dist/{testmd-sync-ACKCIOL3.js → testmd-sync-PQ4GFKHB.js} +1 -1
- package/dist/tms-client-XWCR7O7J.js +2 -0
- package/dist/token-refresh-LR33BKAB.js +2 -0
- package/dist/{use-case-ref-NE4X4MZN.js → use-case-ref-NA3IXGQW.js} +1 -1
- package/dist/{validate-basic-RE2WLIGQ.js → validate-basic-3DX3MMC7.js} +1 -1
- package/dist/verdicts-7GKZEDHV.js +2 -0
- package/dist/{version-check-4FJVZP3K.js → version-check-OV6AOVED.js} +1 -1
- package/dist/{view-cmd-N47BQZPD.js → view-cmd-QDKBBNIU.js} +1 -1
- package/dist/{walk-session-DA7QWXSW.js → walk-session-BAYYPIKN.js} +1 -1
- package/dist/with-telemetry-62LW4VFI.js +2 -0
- package/package.json +12 -12
- package/dist/ChatSurface-VPD5G67Q.js +0 -2
- package/dist/EvidenceViewOffer-HAAK6DS5.js +0 -2
- package/dist/FolderPicker-W5S6RFCP.js +0 -2
- package/dist/InfoBox-OWUEHV2D.js +0 -2
- package/dist/ProjectPicker-BGFCUGT5.js +0 -2
- package/dist/SaveSessionPrompt-SUJE54GS.js +0 -2
- package/dist/SingleShotApp-4TDXZEUA.js +0 -2
- package/dist/TestMdRunView-4GPRWHEU.js +0 -2
- package/dist/TestrunEvidenceTable-OBVQJ6IO.js +0 -2
- package/dist/bind-XVO4CQYV.js +0 -2
- package/dist/bootstrap-TY5RANJ7.js +0 -2
- package/dist/chat-committer-ZCSRJEUB.js +0 -2
- package/dist/child-G2GCW73X.js +0 -2
- package/dist/chunk-2OSFI33O.js +0 -97
- package/dist/chunk-65VANXOF.js +0 -147
- package/dist/chunk-C6HI6Y3S.js +0 -2
- package/dist/chunk-EXFDIVNI.js +0 -9
- package/dist/chunk-I6OQISK4.js +0 -2
- package/dist/chunk-MZOIHUVX.js +0 -27
- package/dist/chunk-NC7D7GOM.js +0 -21
- package/dist/chunk-QTZBVDPR.js +0 -12
- package/dist/chunk-SLKYD44Y.js +0 -2
- package/dist/design-committer-TRYP3LOZ.js +0 -2
- package/dist/design-headless-FZONCKHW.js +0 -2
- package/dist/device-env-LXJ65AVF.js +0 -2
- package/dist/dispatch-DVQ3H7EJ.js +0 -2
- package/dist/evidence-LVVK7ROT.js +0 -2
- package/dist/evolve-cmd-AGRKG7T3.js +0 -2
- package/dist/explore-LOKNOVNP.js +0 -2
- package/dist/extract-headless-OQTQ3FJK.js +0 -2
- package/dist/folder-flags-WXUR6OPJ.js +0 -2
- package/dist/gate-P57VP4E5.js +0 -2
- package/dist/hold-passthrough-IOWPVB4W.js +0 -2
- package/dist/ingest-PDGS5ZTL.js +0 -2
- package/dist/ingest-remote-D5TO5JQP.js +0 -2
- package/dist/install-Z6K2D2VY.js +0 -2
- package/dist/lane-AQYRIW24.js +0 -2
- package/dist/lattice-auth-74XGF77Y.js +0 -2
- package/dist/list-commands-CZYZ7GIG.js +0 -2
- package/dist/login-flow-2FZEOVHM.js +0 -2
- package/dist/pdf-convert-447ACUB3.js +0 -2
- package/dist/phase-seed-LCJ4WSYV.js +0 -2
- package/dist/pipeline-IXVTVRS5.js +0 -2
- package/dist/prepare-target-ULMKVKMC.js +0 -2
- package/dist/pull-route-TTVARJMV.js +0 -2
- package/dist/real-device-run-2LFS5WE2.js +0 -2
- package/dist/reconcile-deps-TWJ3FTSU.js +0 -2
- package/dist/registry-6IJYQXQC.js +0 -2
- package/dist/remote-entry-YL7O2NJQ.js +0 -2
- package/dist/remote-mode-7G6PLJCW.js +0 -4
- package/dist/run-5RQUCNYP.js +0 -2
- package/dist/run-PC5YO4AS.js +0 -2
- package/dist/run-remote-3AYYVPKX.js +0 -2
- package/dist/run-test-md-HE6DUWQR.js +0 -17
- package/dist/store-choice-RT73HAI7.js +0 -2
- package/dist/store-guard-SNWKLHQV.js +0 -2
- package/dist/stream-warnings-GEQKKJU7.js +0 -2
- package/dist/sync-cmd-NBPPDG3B.js +0 -2
- package/dist/tcg-generate-Z23CUISY.js +0 -2
- package/dist/testmd-actions-GH5BW5V5.js +0 -2
- package/dist/tms-client-NXAB6VJD.js +0 -2
- package/dist/token-refresh-4UCYAG6A.js +0 -2
- package/dist/verdicts-XK3GAUX3.js +0 -2
- package/dist/with-telemetry-7V4LY2BG.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{Ea as L,Ua as U}from"./chunk-
|
|
2
|
+
import{Ea as L,Ua as U}from"./chunk-Z777GGHB.js";import{a as E}from"./chunk-7DFBOVUB.js";var x="ckpt/1";var B="checkpoints",m="base.json",y=t=>`delta-${t}.json`,w=t=>`full-${t}.json`,re=["turn","ask","final"],se=["extract","design","walk"];function d(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function D(t){return Array.isArray(t)&&t.every(r=>typeof r=="string")}function K(t){let r=[],e=(n,i)=>{n||r.push(i)};if(!d(t))return{ok:!1,errors:["record: not an object"]};e(t.schema===x,`schema: expected "${x}"`);let s=t.kind;if(s==="base")e(typeof t.sid=="string"&&t.sid.length>0,"base.sid: non-empty string"),e(typeof t.verb=="string"&&se.includes(t.verb),"base.verb: extract|design|walk"),e(typeof t.mode=="string","base.mode: string"),e(typeof t.created_at=="string","base.created_at: string"),e(d(t.run_config),"base.run_config: object"),d(t.run_config)&&e(!("resume"in t.run_config),"base.run_config: must not carry `resume`"),e(typeof t.conv_source=="string",'base.conv_source: string ("" when absent)'),e(typeof t.store_watermark=="string"||t.store_watermark===null,"base.store_watermark: string | null (null = genesis)");else if(s==="delta"||s==="full"){e(typeof t.sid=="string"&&t.sid.length>0,"delta.sid: non-empty string"),e(Number.isInteger(t.seq)&&t.seq>=1,"delta.seq: integer \u2265 1"),e(Number.isInteger(t.turn_id),"delta.turn_id: integer"),e(typeof t.at=="string"&&re.includes(t.at),"delta.at: turn|ask|final"),e(typeof t.ts=="string","delta.ts: string");let n=t.agent;if(d(n)){e(Number.isInteger(n.agent_state_schema),"agent.agent_state_schema: integer"),e(Array.isArray(n.delta_items),"agent.delta_items: array"),e(d(n.binding),"agent.binding: object");let o=n.usage_total;e(d(o)&&typeof o.input_tokens=="number"&&typeof o.output_tokens=="number"&&typeof o.credits=="number","agent.usage_total: {input_tokens, output_tokens, credits} numbers"),n.base_fingerprint!==void 0&&e(typeof n.base_fingerprint=="string","agent.base_fingerprint: string when present"),s==="full"&&e(typeof n.base_fingerprint=="string","full: agent.base_fingerprint required")}else r.push("delta.agent: object");let i=t.kane;if(d(i)){e(D(i.applied_events),"kane.applied_events: string[]"),e(D(i.held_receipts),"kane.held_receipts: string[]");let o=i.pending;e(d(o)&&Array.isArray(o.questions)&&Array.isArray(o.proposals),"kane.pending: {questions[], proposals[]}"),e(Array.isArray(i.parent_asks),"kane.parent_asks: array"),e(d(i.read_basis),"kane.read_basis: object");let p=i.corpus_cursor;if(e(d(p)&&D(p.remaining),"kane.corpus_cursor: {remaining: string[]}"),e(typeof i.store_watermark=="string"||i.store_watermark===null,"kane.store_watermark: string | null (null = genesis)"),i.awaits!==void 0){let a=i.awaits;e(d(i.awaits)&&typeof a.call=="string"&&(typeof a.event_id=="string"||typeof a.event_prefix=="string"),"kane.awaits: {call, event_id | event_prefix}")}i.ingest_registry!==void 0&&e(Array.isArray(i.ingest_registry)&&i.ingest_registry.every(a=>d(a)&&typeof a.ref=="string"&&typeof a.entered_at=="string"),"kane.ingest_registry: [{ref, entered_at, consumed?}]"),i.sent_unread!==void 0&&e(D(i.sent_unread),"kane.sent_unread: string[]"),i.ingest_schedule!==void 0&&e(Array.isArray(i.ingest_schedule)&&i.ingest_schedule.every(a=>d(a)&&typeof a.source_id=="string"&&typeof a.cid=="string"&&["pending","done","skipped"].includes(String(a.status))),"kane.ingest_schedule: [{source_id, cid, status}]")}else r.push("delta.kane: object")}else r.push('kind: expected "base" | "delta" | "full"');return{ok:r.length===0,errors:r}}import{readFileSync as ke}from"fs";import{join as _e}from"path";import{closeSync as N,linkSync as ie,mkdirSync as G,openSync as I,readFileSync as oe,readdirSync as Y,renameSync as ae,rmSync as F,statSync as ce,writeFileSync as M}from"fs";import{join as j}from"path";function pe(t,r){let e=j(t,"sessions",r,B),s=n=>j(e,n);return{read:n=>{try{return oe(s(n),"utf8")}catch(i){if(i.code==="ENOENT")return null;throw i}},list:()=>{try{return Y(e)}catch{return[]}},write:(n,i)=>{G(e,{recursive:!0}),le(s(n),i,e)},writeIfAbsent:(n,i)=>(G(e,{recursive:!0}),de(s(n),i,e)),remove:n=>F(s(n),{force:!0}),bytes:()=>fe(e)}}function le(t,r,e){let s=`${t}.tmp-${process.pid}`,n=I(s,"w");try{M(n,r,{mode:384}),E(n)}finally{N(n)}ae(s,t);try{let i=I(e,"r");E(i),N(i)}catch{}}var ue=new Set(["EPERM","ENOTSUP","EXDEV"]);function de(t,r,e){let s=`${t}.tmp-${process.pid}`,n=I(s,"w");try{M(n,r,{mode:384}),E(n)}finally{N(n)}try{ie(s,t)}catch(i){let o=i.code??"";if(o==="EEXIST")return!1;if(!ue.has(o))throw i;if(!ge(t,r))return!1}finally{F(s,{force:!0})}try{let i=I(e,"r");E(i),N(i)}catch{}return!0}function ge(t,r){let e;try{e=I(t,"wx")}catch(n){if(n.code==="EEXIST")return!1;throw n}let s=!1;try{M(e,r),E(e),s=!0}finally{N(e),s||F(t,{force:!0})}return!0}function fe(t){let r=0;try{for(let e of Y(t))try{r+=ce(j(t,e)).size}catch{}}catch{return 0}return r}var me=3,$e=600*1e3,h=class extends Error{constructor(e,s){super(`${e}: ${s}`);this.code=e}},S=class extends Error{constructor(r){super(`CHECKPOINT_WRITE: ${r}`)}},V=class extends S{},he=(t,r)=>_e(t,"sessions",r,"state.json"),Ce=new Set,J=new Set;function W(t,r,e){for(let s of Ce)try{s(t,r,e)}catch{}}var be=new Set;function De(t,r=new Date){for(let e of be)try{e(t,r)}catch{}}function He(t,r){let e=JSON.stringify(r)+`
|
|
3
3
|
`;t.writeIfAbsent(m,e)||ye(t.read(m))||(t.remove(m),t.writeIfAbsent(m,e))}function ye(t){if(t===null)return!1;try{return JSON.parse(t),!0}catch{return!1}}function Z(t,r){let e;try{e=JSON.parse(r)}catch(n){throw new h("CHECKPOINT_CORRUPT",`${t}: ${n.message}`)}let s=K(e);if(!s.ok)throw new h("CHECKPOINT_CORRUPT",`${t}: ${s.errors.join("; ")}`);return e}function X(t,r){let e=t.read(r);if(e===null)throw new h("CHECKPOINT_MISSING",`${r} is not in the chain`);return Z(r,e)}function ee(t){let r=[],e=[];for(let s of t.list()){let n=/^delta-(\d+)\.json$/.exec(s);n&&r.push(Number(n[1]));let i=/^full-(\d+)\.json$/.exec(s);i&&e.push(Number(i[1]))}return r.sort((s,n)=>s-n),e.sort((s,n)=>s-n),{deltas:r,fulls:e}}function Be(t,r){try{return JSON.parse(ke(he(t,r),"utf8")).checkpoint??null}catch{return null}}function te(t,r,e){let s=[],n,i=0;if(e.full_seq!==null){let a=X(t,w(e.full_seq));s.push(a),n=a.agent.base_fingerprint,i=e.full_seq}let o;for(let a=i+1;a<=e.seq;a++)try{let u=X(t,y(a));s.push(u),!n&&u.agent.base_fingerprint&&(n=u.agent.base_fingerprint)}catch(u){if(u instanceof h&&u.code==="CHECKPOINT_CORRUPT"){o={resumableAt:a-1,turnsLost:e.seq-(a-1)};break}throw u}if(s.length===0)throw new h("CHECKPOINT_CORRUPT",`${r}: pointer names seq ${e.seq} but no chain records exist`);return{items:s.flatMap(a=>a.agent.delta_items),last:s[s.length-1],base_fingerprint:n,fallback:o}}function Ke(t,r,e,s,n){let i=performance.now(),o=r.state.sid,p=r.state.checkpoint;if(p){if(e.seq<p.seq)throw new S(`seq regression: got ${e.seq}, pointer at ${p.seq} (${o})`);if(e.seq===p.seq){if(e.turn_id===p.turn_id&&e.at===p.at)return p;throw new S(`seq regression: seq ${e.seq} re-used with different metadata (turn ${e.turn_id}/${p.turn_id}, at ${e.at}/${p.at}) (${o})`)}}let a=(n?.now??(()=>new Date))(),u=a.toISOString(),l={schema:x,kind:"delta",sid:o,seq:e.seq,turn_id:e.turn_id,at:e.at,ts:u,agent:{agent_state_schema:e.agent_state_schema,delta_items:e.delta_items,binding:e.binding,usage_total:e.usage_total,...e.base_fingerprint!==void 0?{base_fingerprint:e.base_fingerprint}:{}},kane:s},A=Math.max(1,n?.retries??me),g=JSON.stringify(l)+`
|
|
4
4
|
`,C=!1;Buffer.byteLength(g)>524288&&!J.has(o)&&(J.add(o),C=!0,n?.onSoftCap?.("note: this session's checkpoints are getting large \u2014 long pasted inputs are kept verbatim; consider ingesting big documents as sources instead"));let v=!1,q;for(let f=0;f<A&&!v;f++)try{t.write(y(e.seq),g),v=!0}catch(k){q=k}if(!v)throw new S(`delta-${e.seq} write failed after ${A} attempts: ${q?.message??"unknown"} (${o})`);let _=p?.full_seq??null,P=t.bytes()>67108864;if(e.seq%25===0||P){let f=[],k=e.base_fingerprint;if(p){let R=te(t,o,p);f=R.items,k=k??R.base_fingerprint}if(f=[...f,...e.delta_items],!k)throw new S(`compaction at seq ${e.seq}: no base_fingerprint anywhere in the chain (${o})`);let c={...l,kind:"full",agent:{...l.agent,delta_items:f,base_fingerprint:k}};t.write(w(e.seq),JSON.stringify(c)+`
|
|
5
5
|
`),_=e.seq}let b={seq:e.seq,turn_id:e.turn_id,at:e.at,ts:u,full_seq:_};if(r.save({checkpoint:b}),_===e.seq){let{deltas:f,fulls:k}=ee(t);for(let c of f)c<=_&&t.remove(y(c));for(let c of k)c<_&&t.remove(w(c))}let T=t.bytes();if(P&&T>67108864)throw W(o,b,a),new V(`session ${o} checkpoint dir is ${Math.round(T/(1024*1024))}MB (cap ${Math.round(67108864/(1024*1024))}MB) even after compaction \u2014 pausing; resume in a fresh session or trim the conversation`);return W(o,b,a),n?.onStat?.({sid:o,seq:e.seq,persist_ms:performance.now()-i,bytes:Buffer.byteLength(g),dir_bytes:T,compacted:_===e.seq,soft_warned:C}),b}function je(t,r,e){let s=t.read(m);if(s===null)throw new h("CHECKPOINT_MISSING",`${r}: no ${m} \u2014 not a checkpoint session`);let n=Z(m,s),i=p=>{let{deltas:a,fulls:u}=ee(t);if(!p){let g=[...a.map(y),...u.map(w)];return{base:n,agent:null,kane:null,pointer:null,orphans:g}}let l=te(t,r,p),A=[...a.filter(g=>g>p.seq).map(y),...u.filter(g=>g>p.seq).map(w)];return{base:n,agent:{delta_items:l.items,binding:l.last.agent.binding,base_fingerprint:l.base_fingerprint,agent_state_schema:l.last.agent.agent_state_schema,...l.last.agent.usage_total?{usage_total:l.last.agent.usage_total}:{}},kane:l.last.kane,pointer:p,orphans:A,...l.fallback?{fallback:l.fallback}:{}}},o=e();try{return i(o)}catch(p){if(!(p instanceof h&&p.code==="CHECKPOINT_MISSING"))throw p;return i(e())}}function Fe(t,r){let e=[];for(let s of U(t).records)if(s.sid===r)for(let n of s.event_ids??[])e.push(n);return e}function Me(t,r,e,s,n){let i=n.verb??"extract",o=t.parse(e.store_watermark),p=o===null?null:t.resolveToken(o);if(o!==null&&p===null)throw new L(`watermark not in chain: ${e.store_watermark} names no record in this store (rebuilt or foreign?) \u2014 re-ground the session or abandon it`);let a=t.recordsSince(o),u=p===null?0:t.sessions().recordCount(r,p.seq),l=new Map;for(let c of a)c.sid===r&&l.set(c.seq,++u);let A=c=>l.get(c.seq)??0,g=new Set(e.applied_events),C=0,v=[];for(let c of a){if(typeof c.sid!="string"){C+=1;continue}if(c.sid===r){if((c.event_ids??[]).length===0){C+=1;continue}v.push(c)}}C>0&&n.onNote?.(`reconcile: skipped ${C} store record(s) not attributable to this session (pre-sid grace)`);let q=n.ownActors??["extract-agent","design-agent","owner"],_=[],P=[];for(let c of v){if(n.resent!==void 0&&(c.event_ids??[]).includes(n.resent))continue;let R=(c.event_ids??[]).filter(ne=>!g.has(ne));if(R.length===0)continue;P.push(...R);let O;try{O=n.composeReceipt(c,s,{verb:i,commitN:A(c),...n.ucRef?{ucRef:n.ucRef}:{},...n.typedBlockers?{typedBlockers:!0}:{},...n.ignoreGaps?.size?{ignoreGaps:n.ignoreGaps}:{}}).text}catch{O=`commit ${R[0]} at ${c.ts} \u2014 details unavailable (graph moved since)`}let $=c.review?.[0]?.by;$?.id&&!q.includes($.id)&&(O+=`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as O}from"./chunk-QSCXXNC2.js";import{b as
|
|
2
|
+
import{a as O}from"./chunk-QSCXXNC2.js";import{a as k,b as P}from"./chunk-6PIIUAZF.js";import{b as A}from"./chunk-VO66KP2W.js";import{n as L}from"./chunk-HHW6MRU3.js";import{a as b,b as R,c as x,d as y,e as T,g as I,h as f}from"./chunk-UJLULWSR.js";import{d as w,g as p}from"./chunk-ZCRZFAOT.js";import{a as v}from"./chunk-RZ4F3BHX.js";import{a as m,i as S}from"./chunk-QMOGBKJM.js";var h=class{config;buffer=[];stepBuffer=new Map;flushTimer=null;currentRunIndex=null;stopped=!1;_inFlightFlush=null;_stoppingFast=!1;_droppedBatches=0;_droppedEntries=0;constructor(e){this.config=e}start(){if(this.flushTimer)return;let e=this.config.flushIntervalMs??5e3;this.flushTimer=setInterval(()=>{this.flush().catch(()=>{})},e),this.flushTimer.unref&&this.flushTimer.unref()}setRunIndex(e){this.currentRunIndex=e}log(e,t,n,s={}){if(this.stopped)return;let o=this.buildEntry(e,t,n,s);this.buffer.push(o)}logStep(e,t,n,s={}){if(this.stopped)return;let o=this.buildEntry("debug",t,n,s);o.run_index=e,this.stepBuffer.has(e)||this.stepBuffer.set(e,[]),this.stepBuffer.get(e).push(o)}escalate(e){let t=this.stepBuffer.get(e);t&&t.length>0&&this.buffer.push(...t),this.stepBuffer.delete(e)}discardSteps(e){this.stepBuffer.delete(e)}async flush(){if(this.buffer.length===0)return;let e=this._flushBody();this._inFlightFlush=e;try{await e}finally{this._inFlightFlush===e&&(this._inFlightFlush=null)}}async _flushBody(){let e=this.buffer.splice(0),t=null;try{t=await this.config.getToken()}catch{this.buffer.unshift(...e);return}let n={"Content-Type":"application/json"};t&&(n.Authorization=`Bearer ${t}`);let s=JSON.stringify(e);for(let o=0;o<3;o++){try{let l=new AbortController,a=setTimeout(()=>l.abort(),1e4),c=await v(this.config.proxyUrl,{method:"POST",headers:n,body:s,signal:l.signal});if(clearTimeout(a),c.ok)return}catch{}if(this._stoppingFast){this.buffer.unshift(...e);return}o<2&&await new Promise(l=>setTimeout(l,1e3*Math.pow(2,o)))}this._droppedBatches++,this._droppedEntries+=e.length}async flushOnce(e){if(this.buffer.length===0)return"empty";let t=this.buffer.splice(0),n=Date.now()+e,s=!1,o,l=null;try{l=await Promise.race([this.config.getToken(),new Promise(d=>{o=setTimeout(()=>{s=!0,d(null)},e),o.unref&&o.unref()})])}catch{l=null}finally{o&&clearTimeout(o)}let a=n-Date.now();if(s||a<=0)return this.buffer.unshift(...t),"timeout";let c={"Content-Type":"application/json"};l&&(c.Authorization=`Bearer ${l}`);try{let d=new AbortController,u=setTimeout(()=>d.abort(),a);u.unref&&u.unref();let r=await v(this.config.proxyUrl,{method:"POST",headers:c,body:JSON.stringify(t),signal:d.signal});return clearTimeout(u),r.ok?"sent":(this.buffer.unshift(...t),"failed")}catch{return this.buffer.unshift(...t),Date.now()>=n?"timeout":"failed"}}async stopAndFlushOnce(e){let t=Date.now()+e;this._stoppingFast=!0,this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null);let n=this._inFlightFlush;if(n){let o;await Promise.race([n.catch(()=>{}),new Promise(l=>{o=setTimeout(l,e),o.unref&&o.unref()})]),o&&clearTimeout(o)}if(this.buffer.length===0)return"empty";let s=t-Date.now();if(s<=0)return"timeout";try{return await this.flushOnce(s)}catch{return"failed"}}drainBuffer(){return this.buffer.splice(0)}get droppedBatches(){return this._droppedBatches}get droppedEntries(){return this._droppedEntries}async shutdown(){this._droppedBatches>0&&this.log("warn","LOG_DROPS",`Dropped ${this._droppedEntries} entries in ${this._droppedBatches} batches`,{dropped_batches:this._droppedBatches,dropped_entries:this._droppedEntries}),this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),await this.flush()}shutdownSync(){this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null)}get bufferSize(){return this.buffer.length}stepBufferSize(e){return this.stepBuffer.get(e)?.length??0}buildEntry(e,t,n,s){return{hostname:"kane-cli",service:"kane-cli",ddsource:"kane-cli",ddtags:`version:${this.config.device.cli_version}`,level:e,event:t,message:n,session_id:this.config.sessionId,run_index:t.startsWith("tcg_")?null:this.currentRunIndex,identity:this.config.identity,device:this.config.device,context:s,timestamp:new Date().toISOString()}}};import{platform as $,arch as V}from"os";import M from"fs";import B from"fs";import U from"path";var F=1e3,_=0,j=new Set([130,3]),g=class i{ids;logger;opts;ended=!1;createdAt=Date.now();errorState;constructor(e,t={emitted:!1}){this.ids=e.envelope,this.logger=e.logger,this.opts=e,this.errorState=t}get enabled(){return this.logger!==null}event(e,t={}){if(!this.logger)return;e==="ASR_ERROR"&&(this.errorState.emitted=!0);let n=y(this.ids,e,t);this.logger.log(x[e],e,e,C(n))}error(e,t={}){this.logger&&(this.logger.escalate(_),this.event("ASR_ERROR",{...t,error_code:e}))}child(e,t){return new i({...this.opts,envelope:{...this.ids,operation_id:t,parent_operation_id:this.ids.operation_id,verb:"design"}},this.errorState)}async lateBindContext(e){if(!(!this.logger||this.ids.context_instance_id))try{let{ensureStoreIds:t}=await import("./store-id-YZ5WKJ25.js"),{ids:n,cloned:s}=t(e,p());this.ids.context_lineage_id=n.context_lineage_id,this.ids.context_instance_id=n.context_instance_id,s&&this.event("ASR_CONTEXT_CLONED")}catch{}}spoolError(e,t={}){this.logger&&(this.event("ASR_ERROR",{...t,error_code:e}),T(this.logger.drainBuffer()))}agentSession(e){this.ids.agent_session_id=e}spawnEnv(){if(!this.opts.telemetryEnabled)return{};let e={TESTMUAI_USER_SESSION_ID:this.ids.session_id,TESTMUAI_OPERATION_ID:this.ids.operation_id,TESTMUAI_CLIENT_VERSION:this.opts.clientVersion,TESTMUAI_TELEMETRY_PROXY_URL:this.opts.proxyUrl};return this.ids.context_instance_id&&(e.TESTMUAI_CONTEXT_INSTANCE_ID=this.ids.context_instance_id),e}traceTee(){return e=>{if(!this.logger)return;let t=typeof e.kind=="string"?e.kind.slice(0,64):"trace",n={...C(y(this.ids,"ASR_CMD_START",{})),trace_kind:t};typeof e.code=="string"&&(n.trace_code=e.code.slice(0,64)),delete n.event,this.logger.logStep(_,`trace_${t}`,t,n)}}wireTrace(e,t,n){if(!this.logger)return;n&&this.agentSession(n);let s=t&&typeof t=="object"?t:{};switch(e){case"spawn":this.event("ASR_AGENT_SPAWN",{tier:s.tier});break;case"session_paused":this.event("ASR_SESSION_PAUSED",s);break;case"commit":this.event("ASR_COMMIT",s);break;case"design_phase_committed":this.event("ASR_COMMIT",{phase:s.phase,duration_ms:s.ms});break;default:this.traceTee()({kind:e,code:typeof s.code=="string"?s.code:void 0})}}banner(){return`session: ${this.ids.session_id}`}supportFooter(){return`if this keeps failing, share this id with support: ${this.ids.session_id}`}async end(e){if(!this.ended){if(this.ended=!0,e.duration_ms===void 0&&(e={...e,duration_ms:Date.now()-this.createdAt}),this.logger)if(e.exit_code===0?this.logger.discardSteps(_):this.logger.escalate(_),e.exit_code>0&&!j.has(e.exit_code)&&!this.errorState.emitted&&this.event("ASR_ERROR",{error_code:e.exit_code===2?"usage_exit_unattributed":`exit_${e.exit_code}_unattributed`,exit_code:e.exit_code}),this.event("ASR_CMD_END",e),this.opts.longSession)await this.logger.shutdown();else{let t=await this.logger.flushOnce(F);(t==="failed"||t==="timeout")&&T(this.logger.drainBuffer())}this.logger&&this.writeManifestLine(e.exit_code),f(null)}}writeManifestLine(e){try{let t=w(this.ids.context_instance_id??null);B.mkdirSync(U.dirname(t),{recursive:!0});let n={ts:new Date().toISOString(),session_id:this.ids.session_id,operation_id:this.ids.operation_id,agent_session_id:this.ids.agent_session_id,verb:this.ids.verb,mode:this.ids.mode,exit_code:e};B.appendFileSync(t,JSON.stringify(n)+`
|
|
3
3
|
`,{flag:"a",mode:384})}catch{}}};function C(i){let e={event:i.event,session_id:i.session_id,operation_id:i.operation_id,verb:i.verb,mode:i.mode,component:i.component,seq:i.seq,context_lineage_id:i.context_lineage_id,context_instance_id:i.context_instance_id};i.parent_operation_id&&(e.parent_operation_id=i.parent_operation_id),i.agent_session_id&&(e.agent_session_id=i.agent_session_id),i.lattice_session_id&&(e.lattice_session_id=i.lattice_session_id),i.project_id&&(e.project_id=i.project_id);for(let[t,n]of Object.entries(i.context))e[t]=n;return e}import{isMainThread as X}from"worker_threads";var E=()=>process.env.KANE_TELEMETRY_URL||S;function Y(){return process.env.TESTMUAI_BASE_URL?"custom":process.env.TESTMUAI_ENV==="stage"?"stage":"prod"}function z(){return process.env.KANE_TELEMETRY!=="0"&&(!process.env.VITEST||process.env.KANE_TELEMETRY==="1")}function me(i){let e=z(),t=i.env??Y(),n=i.sessionId??null;if(!n&&i.resumeSid&&i.contextRoot)try{let r=L(i.contextRoot,i.resumeSid);r?.user_session_id&&(n=r.user_session_id)}catch{}if(!n&&i.applyPlanPath)try{let r=JSON.parse(M.readFileSync(i.applyPlanPath,"utf8"));r.telemetry?.user_session_id&&(n=r.telemetry.user_session_id)}catch{}let s=i.sessionId===void 0?n!==null:i.resumeSid!==void 0;n||(n=b());let o=null,l=null,a=!1;if(i.contextRoot&&M.existsSync(i.contextRoot))if(i.write&&e){let r=P(i.contextRoot,p());o=r.ids.context_lineage_id,l=r.ids.context_instance_id,a=r.cloned}else{let r=k(i.contextRoot);o=r?.context_lineage_id??null,l=r?.context_instance_id??null}let c={session_id:n,operation_id:R(),context_lineage_id:o,context_instance_id:l,...i.remote?{lattice_session_id:i.remote.sessionId,project_id:i.remote.projectId}:{},verb:i.verb,mode:i.mode,component:"kane-cli"},d=null;if(e){let r=A(t),N={org_id:r.org_id??"",user_id:r.user_id??"",machine_id:r.machine_id,email:null,email_domain:"",user_type:r.user_type??"unknown",env:r.env,plan:r.plan??"unknown"},D=i.mode==="interactive"||i.mode==="cli"?"cli":"agent";d=new h({proxyUrl:E(),sessionId:n,identity:N,device:{cli_version:m,platform:$(),arch:V(),host_agent:O(),invocation_mode:D},getToken:async()=>null}),i.longSession&&d.start()}let u=new g({envelope:c,logger:d,longSession:!!i.longSession,proxyUrl:E(),clientVersion:`kane-cli/${m}`,telemetryEnabled:e});return e&&!i.errorsOnly&&(f(c),u.event("ASR_CMD_START",{resumed:s,applied_plan:!!i.applyPlanPath}),a&&u.event("ASR_CONTEXT_CLONED"),X&&I(E()).catch(()=>{})),u}export{h as a,F as b,E as c,Y as d,z as e,me as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as ae}from"./chunk-MMBBQ4OZ.js";import{j as R}from"./chunk-
|
|
2
|
+
import{a as ae}from"./chunk-MMBBQ4OZ.js";import{j as R}from"./chunk-XMALVGH7.js";import{c as ie,e as ne,i as re,j as K}from"./chunk-Z7S3IWUX.js";import{d as $,e as oe}from"./chunk-4JOD47QI.js";import{a as se}from"./chunk-RZ4F3BHX.js";import{spawn as ze}from"child_process";import{closeSync as Xe,existsSync as Ge,mkdirSync as We,openSync as Ye,readFileSync as Ze,rmSync as Qe}from"fs";import{homedir as ge}from"os";import{dirname as X,join as S}from"path";import{access as Re,mkdir as de,readFile as Le}from"fs/promises";import{homedir as Ce}from"os";import{arch as Fe,platform as Be}from"process";import{join as M}from"path";var Ue=35,qe="google_apis",Ve="KaneCLI_Pixel_API35",He="KaneAI_Pixel_API35";function Ht(t){return t===He?Ve:t}var je=1;function Ke(t,e){return t==="darwin"&&e==="arm64"?"arm64-v8a":"x86_64"}function Je(){return{home:Ce(),os:Be,arch:Fe}}async function le(t){try{return await Re(t),!0}catch{return!1}}var J=class{deps;constructor(e={}){this.deps={...Je(),...e}}paths(){let e=M(this.deps.home,".testmuai","kaneai","mobile"),r=M(e,"android-sdk");return{root:r,emulatorDir:M(r,"emulator"),systemImageDir:M(r,"system-images",`android-${Ue}`,qe,Ke(this.deps.os,this.deps.arch)),avdHome:M(e,"avd"),manifest:M(r,"sdk-manifest.json")}}environment(){let e=this.paths();return{ANDROID_HOME:e.root,ANDROID_SDK_ROOT:e.root,ANDROID_AVD_HOME:e.avdHome}}async ensureSdkRootMarkers(){let e=this.paths().root;await de(M(e,"platforms"),{recursive:!0}),await de(M(e,"platform-tools"),{recursive:!0})}async status(){let e=this.paths(),r=null;try{r=JSON.parse(await Le(e.manifest,"utf8"))}catch{}if(!r||r.schemaVersion!==je)return{emulator:!1,systemImage:!1};let o=this.deps.os==="win32"?"emulator.exe":"emulator";return{emulator:!!r.components.emulator&&await le(M(e.emulatorDir,o)),systemImage:!!r.components.systemImage&&await le(M(e.systemImageDir,"system.img"))}}},ue;function B(){return ue??=new J,ue}var G="android",et="http://127.0.0.1:4723/status",tt=2e3,z=(()=>{let t=Number(process.env.KANE_CLI_EMULATOR_BOOT_TIMEOUT_MS);return Number.isFinite(t)&&t>=3e4?t:3e5})(),it=1e3,nt=3e5;var rt=5,ce="Run `kane-cli doctor --target emulator --install` to install the managed Appium tree.",st={device:"ready",unauthorized:"unauthorized",offline:"offline"};function ot(t){let e={};for(let r of t){let o=r.indexOf(":");o<=0||(e[r.slice(0,o)]=r.slice(o+1))}return e}function at(t){let e=[];for(let r of t.split(`
|
|
3
3
|
`)){let o=r.trim();if(!o||o.startsWith("*"))continue;let u=o.toLowerCase();if(u.startsWith("list of devices")||u.startsWith("adb server"))continue;let g=o.split(/\s+/),p=g[0],w=g[1];if(!p||!w)continue;let v=ot(g.slice(2)),x=/^(localhost|127\.0\.0\.1):\d{1,5}$/.test(p),P=/^[A-Za-z0-9._-]+:\d{1,5}$/.test(p),C=/^sdk_/.test(v.product??"")||/^sdk_/.test(v.model??"")||/^emu/.test(v.device??"");if(!p.startsWith("emulator-")&&!x&&!(P&&C))continue;let l=v.model?v.model.replace(/_/g," "):void 0;e.push({platform:G,kind:"emulator",id:p,displayName:l??p,state:st[w]??"offline"})}return e}function me(t){let e=[];for(let r of t.split(`
|
|
4
4
|
`)){let o=r.trim();o&&/^[A-Za-z0-9._-]+$/.test(o)&&(e.includes(o)||e.push(o))}return e}function dt(t){for(let e of t.split(`
|
|
5
5
|
`)){let r=e.trim();if(!(!r||r==="OK"))return r}}function lt(t){let e=/^Version\s+(\S+)/m.exec(t);return e?.[1]?e[1].split("-")[0]:/Android Debug Bridge version\s+(\S+)/.exec(t)?.[1]}function ut(t){let e=[];for(let r of t.split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as c}from"./chunk-5D7ENQTQ.js";import{a as w}from"./chunk-2XW33VOK.js";import{d as h,h as g}from"./chunk-A7RJQJNT.js";import{c as b,j as v}from"./chunk-
|
|
2
|
+
import{b as c}from"./chunk-5D7ENQTQ.js";import{a as w}from"./chunk-2XW33VOK.js";import{d as h,h as g}from"./chunk-A7RJQJNT.js";import{c as b,j as v}from"./chunk-QMOGBKJM.js";import{readFileSync as C,writeFileSync as k,mkdirSync as x,existsSync as T}from"fs";import{dirname as S}from"path";var f={window_size:{width:1920,height:1080},chrome_profile_path:"",default_url:v,model:"v16-alpha",project_id:null,project_name:null,folder_id:null,folder_name:null,mode:"testing",assertion_mode:"dom",network_ws:!1,network_sse:!1,bug_detection:"off",assertion_failure_mode:"stop",final_validation:!1,code_export:{enabled:!0,language:"python",skip_validation:!0},generate:{scenario_limit:2,per_scenario_limit:3,memory_enabled:!1},last_seen_version:"",hints_enabled:!0},I=f;function E(r){let{mobile:e,...o}=r,t={...o};delete t.target,delete t.device,delete t.device_name,delete t.os_version,delete t.app;let n=e??{};n.tui_target&&(t.target=n.tui_target);let s=n.default_target?.name?.trim(),l=n.default_target?.os_version?.trim();if(s||l)s&&(t.device_name=s),l&&(t.os_version=l);else{let i=n.default_target?.id?.trim();i&&(t.device=i)}n.default_app&&(t.app=n.default_app);let a={};n.no_reset!==void 0&&(a.no_reset=n.no_reset),n.appium_url!==void 0&&(a.appium_url=n.appium_url);for(let i of c)n[i]!==void 0&&(a[i]=n[i]);return Object.keys(a).length>0&&(t.mobile=a),t}function R(r){let e=r.mobile??{},o=typeof r.target=="string"?r.target:void 0,t=typeof r.device=="string"&&r.device.trim()!==""?r.device.trim():void 0,n=d=>typeof d=="string"&&d.trim()!==""?d.trim():void 0,s=n(r.device_name),l=n(r.os_version),a=typeof r.app=="string"&&r.app!==""?r.app:void 0,i={},_=o??e.tui_target;_&&(i.tui_target=_);let p=w(_,void 0).kind,u=h(p)?p:null;u&&(s||l)?i.default_target={platform:g(u),kind:u,...s?{name:s}:{},...l?{os_version:l}:{}}:u&&t?i.default_target={platform:g(u),kind:u,id:t}:(e.default_target?.id?.trim()||e.default_target?.name?.trim())&&(i.default_target=e.default_target);let m=a??e.default_app;m&&(i.default_app=m),e.no_reset!==void 0&&(i.no_reset=e.no_reset),e.appium_url!==void 0&&(i.appium_url=e.appium_url);for(let d of c)e[d]!==void 0&&(i[d]=e[d]);return Object.keys(i).length>0?i:void 0}var y=class{constructor(e=b){this.path=e}exists(){return T(this.path)}load(){try{let e=C(this.path,"utf-8"),o=JSON.parse(e),t=R(o),{target:n,device:s,app:l,...a}=o;return{...f,...a,...t?{mobile:t}:{},code_export:{...f.code_export,...o.code_export??{}},generate:{...f.generate,...o.generate??{}}}}catch{return{...f,code_export:{...f.code_export},generate:{...f.generate}}}}write(e){try{x(S(this.path),{recursive:!0}),k(this.path,JSON.stringify(E(e),null,2)+`
|
|
3
3
|
`)}catch(o){let t=o instanceof Error?o.message:String(o);process.stderr.write(`[config] Failed to save config: ${t}
|
|
4
4
|
`)}}set(e,o){let t=this.load();t[e]=o,this.write(t)}save(e){this.write({...this.load(),...e})}getMobile(){return this.load().mobile??{}}setMobile(e){let o={...this.getMobile()};for(let t of Object.keys(e)){let n=e[t];n===void 0?delete o[t]:o[t]=n}this.set("mobile",Object.keys(o).length>0?o:void 0)}writeRaw(e){this.write(e)}};export{I as a,y as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as t}from"./chunk-
|
|
2
|
+
import{b as t}from"./chunk-QMOGBKJM.js";import{join as i}from"path";function e(n=t){return i(n,"plugins")}function g(n,r=t){return i(e(r),n)}function c(n,r,o=t){return i(g(n,o),r)}function f(n,r=t){return i(g(n,r),"current")}function x(n,r=t){return i(g(n,r),"config.json")}function l(n,r=t){return i(g(n,r),".jobs")}function s(n=t){return i(n,"bin")}function h(n=t){return i(s(n),"hyperexecute")}export{e as a,g as b,c,f as d,x as e,l as f,s as g,h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{H as T,L as F,Qa as B,r as x}from"./chunk-
|
|
2
|
+
import{H as T,L as F,Qa as B,r as x}from"./chunk-Z777GGHB.js";function q(h){let{store:j,graph:f,seq:r,by:i}=h,c=j.recordsSince(null),v=c.map(B);if(!Number.isInteger(r)||r<1||r>c.length)return{record:null,warnings:[],errors:[{code:"UNKNOWN_SEQ",detail:`no record ${r} (chain has ${c.length})`}]};let d=c[r-1],p=c.slice(0,r-1),a=h.reason??`revert of record ${r}`,n=[],l=[],g=[],m=[],w={},C=new Set(d.nodes.map(e=>e.cid)),k=new Map;for(let e of c)for(let t of e.edges)k.has(t.ecid)||k.set(t.ecid,t);let N=e=>c.slice(r).some(t=>t.supersessions.some(s=>s.kind==="edge"&&s.ecid===e)),$=new Set,y=new Set;for(let e of d.nodes){if(f.superseded.has(e.cid)){$.add(e.cid),n.push(`${e.cid} was already superseded after record ${r} \u2014 left as is`);continue}y.add(e.cid),l.push({kind:"node",old:e.cid,new:null,reason:a,by:i})}let _=new Set;for(let e of d.edges){if(f.superseded.has(e.ecid)){n.push(`edge ${e.ecid} was already retracted after record ${r} \u2014 left as is`);continue}if(($.has(e.src)||$.has(e.dst))&&!y.has(e.src)&&!y.has(e.dst)){n.push(`edge ${e.ecid} was minted with a kept node \u2014 left as is`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i}),_.add(e.ecid)}let R=new Set;for(let e of d.supersessions){if(e.kind!=="node")continue;if(c.slice(r).some(s=>s.supersessions.some(o=>o.kind==="node"&&o.old===e.old))){n.push(`supersession of ${e.old.slice(0,19)} was changed again after record ${r} \u2014 later state kept`);continue}let t;for(let s of p)for(let o of s.supersessions)o.kind==="node"&&o.old===e.old&&(t=o.new===o.old?void 0:o.new);t===void 0?(l.push({kind:"node",old:e.old,new:e.old,reason:a,by:i}),R.add(e.old)):l.push({kind:"node",old:e.old,new:t,reason:a,by:i})}for(let e of d.supersessions)if(!(e.kind!=="edge"||!e.revoke)){if(N(e.ecid)){n.push(`edge ${e.ecid} was touched again after record ${r} \u2014 later state kept`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i}),_.add(e.ecid)}let E=[];for(let e of d.supersessions){if(e.kind!=="edge"||e.revoke)continue;if(N(e.ecid)){n.push(`edge ${e.ecid} was touched again after record ${r} \u2014 later state kept`);continue}let t=!1;for(let H of p)for(let b of H.supersessions)b.kind==="edge"&&b.ecid===e.ecid&&(t=!b.revoke);if(t){n.push(`edge ${e.ecid} was already retracted before record ${r} \u2014 left retracted`);continue}let s=k.get(e.ecid);if(!s){n.push(`edge ${e.ecid} is unknown to the chain \u2014 left retracted`);continue}if(f.superseded.has(s.src)&&!R.has(s.src)){n.push(`edge ${e.ecid} would revive from a superseded source \u2014 left retracted`);continue}let o=f.tipOf(s.dst);if(f.superseded.has(o)&&!R.has(o)){n.push(`edge ${e.ecid} would point at a retired destination \u2014 left retracted`);continue}let u=T(f,{type:s.type,src:s.src,dst:s.dst},{pending:E,retracted:_},`revert revive ${s.type}`);if(u){n.push(`edge ${e.ecid} left retracted \u2014 reviving it would double an occupied slot (${u.detail})`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i,revoke:!0}),E.push({src:s.src,dst:s.dst,type:s.type})}let S=c.slice(r);for(let e of Object.keys(d.source_head_moves)){if(S.some(s=>e in s.source_head_moves)){n.push(`head of ${e} was moved again after record ${r} \u2014 later state kept`);continue}let t=null;for(let s of p)e in s.source_head_moves&&(t=s.source_head_moves[e]);w[e]=t}let O=new Set;for(let e of d.review){if(O.has(e.id)||C.has(e.id))continue;if(O.add(e.id),S.some(o=>o.review.some(u=>u.id===e.id))){n.push(`trust of ${e.id.slice(0,19)} was reviewed again after record ${r} \u2014 later state kept`);continue}let t=null,s=null;for(let o of p)for(let u of o.review)u.id===e.id&&(t=u.resolution==="reset"?null:u.resolution,s=u.reason);t==="approved"||t==="edited"?g.push({id:e.id,kind:"review-item",resolution:"approved",edit:null,reason:a,by:i}):t==="rejected"?g.push({id:e.id,kind:"review-item",resolution:"rejected",edit:null,reason:s??a,by:i}):g.push({id:e.id,kind:"review-item",resolution:"reset",edit:null,reason:a,by:i})}for(let e of d.names??[]){if(S.some(s=>(s.names??[]).some(o=>o.slug===e.slug))){n.push(`slug "${e.slug}" was reassigned after record ${r} \u2014 later state kept`);continue}let t;for(let s of p)for(let o of s.names??[])o.slug===e.slug&&(t=o.cid);t!==void 0?m.push({cid:t,slug:e.slug,by:i}):n.push(`slug "${e.slug}" was first assigned by record ${r} \u2014 unassignment unsupported, reassign manually`)}return l.length===0&&g.length===0&&m.length===0&&Object.keys(w).length===0?{record:null,warnings:n,errors:[{code:"NOTHING_TO_REVERT",detail:`record ${r} left no compensable facts`}]}:(d.extraction_of&&n.push(`extraction cache for ${d.extraction_of.slice(0,19)} stays \u2014 re-extract with --force`),{record:F(j,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:g,supersessions:l,...m.length>0?{names:m}:{},source_head_moves:w},{graph:f,expectPrev:v[v.length-1]??null,intent:{v:1,verb:"revert",args:x({seq:r,reason:h.reason??null,by:i}),pins:{target:{seq:r,hash:v[r-1]}}},provenance:h.provenance}).record,warnings:n,errors:null})}export{q as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as ue,c as fe}from"./chunk-
|
|
2
|
+
import{a as ue,c as fe}from"./chunk-B2WFW74J.js";import{a as ae}from"./chunk-7ZJWUWSN.js";import{k as re,l as oe}from"./chunk-VQZOKTJ2.js";import{a as C,b as k}from"./chunk-KRRZCY7U.js";import{c as de,d as ce,f as le}from"./chunk-JGLADDRH.js";import{B as A,Ba as ie,Ha as f,M as K,T as H,V as x,W as q,X as O,Z as B,ba as G,fa as z,ga as J,ia as Q,ja as V,ka as X,ma as Y,na as Z,pa as P,qa as ee,ra as ne,s as W,ua as te,va as se,y as D,z as U}from"./chunk-TLOYTGVT.js";import{a as S}from"./chunk-RQKMSNEU.js";import{a as w}from"./chunk-I2MC6VVX.js";import{oa as L}from"./chunk-Z777GGHB.js";import{a as p}from"./chunk-FOJHSG5M.js";import{z as I}from"./chunk-QMOGBKJM.js";var ve={usecase:"use_case",scenario:"scenario",test:"test",ac:"acceptance_criterion",source:"source"},b={use_case:"the use case",scenario:"the scenario",test:"the test",acceptance_criterion:"the acceptance criterion",source:"the document"};async function pe(e,n,s,i=()=>{}){let r=e,t=r?.entity;if(typeof t!="string"||t==="")return null;let c=async d=>{if(typeof d!="string")return null;try{let a=await n.mainNode(s,d),o=ve[a.label];if(!o)return null;let l=o==="acceptance_criterion"?a.content.text:a.content.title;return{kind:o,id:a.name,title:typeof l=="string"&&l!==""?l:null}}catch(a){return i(`the conflict's node couldn't be read, so the save's refusal names nothing: ${k(a)}`),null}};if(r?.kind==="source")return{kind:"source",id:t,title:typeof r.fileName=="string"&&r.fileName!==""?r.fileName:null};if(r?.kind==="edge"){let[d,a]=r.ends?await Promise.all([c(r.ends.from),c(r.ends.to)]):[null,null];return d||a?{kind:"link",from:d,to:a}:null}if(r?.kind==="node"||t.startsWith("sha256:"))return c(t);try{return(await n.sources(s)).some(d=>d.sourceId===t)?{kind:"source",id:t,title:null}:null}catch(d){return i(`the project's sources couldn't be read, so the save's refusal names nothing: ${k(d)}`),null}}function $(e){if(e.kind==="source")return e.title?`${b.source} "${e.title}"`:"a document this session reads";let n=e.id?L(e.id):null;return e.kind==="acceptance_criterion"&&n?`${b[e.kind]} ${n}`:e.title?`${b[e.kind]} "${e.title}"`:n?`${b[e.kind]} ${n}`:b[e.kind]}function me(e,n,s,i=[]){return{code:"PROJECT_CHANGED",message:`not saved \u2014 another save also changed ${e.kind!=="link"?$(e):e.from&&e.to?`the link between ${$(e.from)} and ${$(e.to)}`:`a link to ${$(e.from??e.to)}`}`,detail:`this session can't be saved now, so ${Z(n)} won't reach the project`,remedy:V(s,i)}}function ke(e){let n=le(e);return n!==null?de(n,S()):ce("save",S())}async function ge(e,n){if(n.verb!=="evolve")return{notUpdated:[],stillStale:0,repins:new Map};let s=await e.sessionLog?.().catch(()=>[])??[],i=s.filter(t=>t.kind==="evolve_not_updated").at(-1)?.body,r=t=>Array.isArray(t)?t.filter(c=>typeof c=="string"):[];return{notUpdated:r(i?.use_cases),stillStale:r(i?.still_stale).length,repins:q(s)}}function _(e,n){let s=n==="agent"?" --mode agent":"";return e.verb==="evolve"?`kane-cli maintain evolve ${e.useCase??"--from-stale"}${s}`:e.verb==="design"&&e.useCase?`kane-cli design tests --use-case ${e.useCase}${s}`:`kane-cli context extract${s}`}async function Ke(e){let n={...e,trace:e.trace??ke(e.sid)},s=n.mode==="agent",i=n.print??(c=>{process.stdout.write(`${c}
|
|
3
3
|
`)}),r=(c,d)=>(n.trace.line("save_refused",{sid:n.sid,...c.code?{code:c.code}:{},exit:d}),s?n.emit({type:"error",code:c.code,message:c.message,...A(c)}):(re(c),i("")),d),t=!1;try{return await be(n,s,i,r,()=>t=!0)}catch(c){return c instanceof w&&c.retryable?r(t?f.saveUnconfirmed():f.noConnectionToSave(),2):r(f.assuranceOffOr(c,n.projectName,f.saveFailed("your work is")),1)}}async function be(e,n,s,i,r){let t;try{t=await e.person.getSession(e.sid)}catch(u){if(u instanceof w&&u.code==="NOT_FOUND")return i(f.noSuchSession(e.sid),2);throw u}if(t.ended==="failed")return i(f.sessionFailed(e.sid),2);if(t.ended!=="complete")return i(f.notFinished(e.sid,P(t.verb==="design"||t.verb==="evolve"?"design":"extract",e.sid,n)),2);if(t.scope?.state==="finalized")return T(e,t,{},n,s,i,r,!0);let c=await G(e.person,e.projectId,e.sid);if(!z(c,(t.scope?.position??t.basePosition)>t.basePosition))return await e.person.discard(e.sid,t.generation).catch(()=>{}),n?e.onProgress({kind:"save",sid:e.sid,phase:"saved",landed:0}):s(f.nothingToSave),0;let{notUpdated:d,repins:a}=await ge(e,t),o=O(x(t.verb,c),a);if(e.trace?.line("save_check",{sid:e.sid,verb:t.verb,counts:c}),n)return e.onProgress({kind:"save",sid:e.sid,phase:"check",project:e.projectName,counts:c,...d.length>0?{notUpdated:d}:{},...o.replaces?{replaces:o.replaces}:{},...o.keeps?{keeps:o.keeps}:{}}),e.yes?T(e,t,c,n,s,i,r):i(f.confirmRequired(e.sid),2);let l=(await e.person.project(e.projectId))?.mainPosition??null,g=l!==null&&l>t.basePosition;for(let u of ye(e.projectName,o,g))s(u);s("");let m=e.yes||await e.confirm("save this session? (y/N)");return e.yes||s(""),m?T(e,t,c,n,s,i,r):(s(`not saved \u2014 your work is kept in session ${e.sid}`),0)}function ye(e,n,s){return[p.bold(`save this session to "${e}"`),...J(n,s).map(([i,r])=>`${p.dim(` ${i.padEnd(10)}`)}${r}`)]}function we(e,n="",s=process.stdout.columns,i=null,r=null){let t=[];if(e.receipt!==null&&t.push(`${n}${p.green(`\u2714 ${e.receipt}`)}`),i?.line&&t.push(`${n}${p.dim(i.line)}`),i?.replacedHead&&i.replaced){t.push(`${n}${p.dim(i.replacedHead)}`);for(let d of i.replaced){if(t.push(`${n}${p.dim(` ${d.file}`)}`),d.by.length===0)continue;let a=` replaced by ${d.by.length===1?d.by[0]:`${d.by.slice(0,-1).join(", ")} and ${d.by[d.by.length-1]}`}`;!s||n.length+a.length<=s?t.push(`${n}${p.dim(a)}`):d.by.forEach((o,l)=>t.push(`${n}${p.dim(l===0?` replaced by ${o}`:` and ${o}`)}`))}}if(i?.needed){let d=[...D(i.needed,{cwd:process.cwd(),tests:i.needed.tests,indent:0,...s?{columns:s-n.length}:{}}),...U(i.needed.noStartPage,{indent:0})];for(let a of d)t.push(`${n}${p.dim(a)}`)}let c=Re(e.lines,i?.lines??[],r);if(c.length>0){t.push("");let d=a=>s&&!a.startsWith(" kane-cli ")?oe(a,s):a;for(let a of c)t.push(a.tone==="warning"?p.hex(I.amber)(d(a.text)):a.tone==="detail"?p.dim(a.command?$e(a.text,s):a.text):d(a.text));(e.support||i?.support)&&t.push(`if this keeps failing, share this id with support: ${W(e.support?"refused_TEST_MANAGER":"refused_TEST_FILES")}`)}return t}function $e(e,n){let s=e.indexOf("run: kane-cli ");if(!n||e.length<=n||s<0)return e;let i=e.match(/^ */)[0];return`${e.slice(0,s+4)}
|
|
4
4
|
${i} ${e.slice(s+5)}`}function Re(e,n,s){if(n.length===0)return e;if(e.length===0)return n;let i=c=>c.text.startsWith("next: "),r=e.findIndex(i),t=n.findIndex(i);return s!==null&&r>=0&&t>=0?[...e.slice(0,r),...n.slice(0,t),{text:s,tone:"plain"},...e.slice(r+1),...n.slice(t+2)]:[...e,{text:"",tone:"plain"},...n]}async function T(e,n,s,i,r,t,c,d=!1){e.onProgress({kind:"save",sid:e.sid,phase:"saving"}),d&&!i&&r(f.savedBefore);let a=o=>{i||r(d?`finishing test cases in Test Manager\u2026 ${o}`:`saving\u2026 ${o}`)};try{c();let o=await e.person.land(e.sid,n.generation),l=n.verb==="design"||n.verb==="reconcile"||n.verb==="evolve"?await fe({person:e.person,projectId:n.projectId,landing:o,cwd:process.cwd()}):null,g=o.testManager?.notCovered?.length?await ue({person:e.person,projectId:n.projectId,landing:o}):void 0;e.trace?.line("save_landed",Ne(e.sid,o,l));let m=B(s),{stillStale:u,repins:R}=await ge(e,n),{changes:M,approves:j,archives:E,removes:F}=s,v=O(x(n.verb,s),R);if(e.onProgress({kind:"save",sid:e.sid,phase:"saved",landed:o.landed,...m>0?{heldChanges:m}:{},...M?{changes:M}:{},...j?{approves:j}:{},...E?{archives:E}:{},...F?{removes:F}:{},...v.replaces?{replaces:v.replaces}:{},...v.keeps?{keeps:v.keeps}:{},...s.uncounted?{uncounted:s.uncounted}:{},...o.testManager!==void 0?{testManager:o.testManager}:{},...g?{sessionUseCases:[...g]}:{},...l!==null?{testFiles:l}:{},...u>0?{stillStale:u}:{}}),!i){let y=ne(o.testManager,e.sid,e.projectName,g,ee(l)),N=l===null?null:te(l,e.sid,d,{testManager:o.testManager});if(d){let h=y.receipt===null&&y.lines.length===0;a(o.testManager?.error?"stopped":h?"nothing left to do":"done"),(y.receipt!==null||N?.line)&&r("")}else{a("saved"),r("");let h=H(v);r(p.green(`\u2714 saved to "${e.projectName}"${h?` \u2014 ${h}`:""}`));for(let he of K(v))r(p.dim(` ${he}`))}for(let h of we(y,"",void 0,N,se(o.testManager,N,e.projectName)))r(h);if(u>0)for(let h of ie.stillOutOfDate(u))r(h);r("")}return 0}catch(o){if(!(o instanceof w))throw o;if(o.retryable)return a("failed"),i||r(""),t(f.saveUnconfirmed(),2);if(o.code==="SESSION_NOT_FINISHED")return a("failed"),i||r(""),t(f.notFinished(e.sid,P(n.verb==="design"||n.verb==="evolve"?"design":"extract",e.sid,i)),2);if(o.code==="SCOPE_BEHIND_HEAD"){let g={kind:"save",sid:e.sid,phase:"behind"},m=await pe(o.extra.conflict,e.person,e.projectId,C("remote-save")),u=Y(n);if(i){let R=u.length>0?{cmd:`${X(u)} --mode agent`,why:"start again from the latest, adding this session's documents again"}:{cmd:_(n,e.mode),why:"start again from the latest"};return e.emit({...ae(g),...m?{conflict:m}:{},next:[R]}),2}return e.onProgress(g),a("failed"),r(""),t(m?me(m,s,_(n,e.mode),u):f.projectChanged(e.projectName,s,_(n,e.mode),u),2)}let l=o.code==="SCOPE_RECORD_REFUSED";return l&&C("remote-save")(`session ${e.sid}: the save was refused: ${k(o)}`),e.onProgress({kind:"save",sid:e.sid,phase:"failed",reason:"not_accepted",...l?{code:"SCOPE_RECORD_REFUSED"}:{}}),i?1:(a("failed"),r(""),t(f.saveFailed(Q(s)),1))}}function Ne(e,n,s){return{sid:e,landed:n.landed,...n.testManager!==void 0?{test_manager:n.testManager===null?null:{error:n.testManager.error??null}}:{},...s!==null?{test_files:s==="unread"?"unread":{written:s.wrote.length,refused:s.refused.length}}:{}}}export{pe as a,me as b,ke as c,Ke as d,we as e,Ne as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as f,d as l}from"./chunk-
|
|
2
|
+
import{b as f,d as l}from"./chunk-2N75WO7Y.js";import{a as p}from"./chunk-TZXXJWHA.js";function d(t,e,o){return{id:`${t}.internal`,label:e,required:!0,status:"fail",detail:o instanceof Error?o.message:String(o)}}async function k(t,e={}){let o=p();if(!o.supported)return{sections:[{platform:"host",checks:[{id:"host.platform",label:"host",required:!0,status:"fail",detail:o.reason}]}]};let n=t?f().filter(r=>r.toLowerCase()===t.toLowerCase()):f(),{managedDeps:i}=await import("./deps-bundle-CMTIWBS5.js"),s=n.flatMap(r=>r==="android"?["emulator"]:r==="ios"?["simulator"]:[]);await Promise.allSettled(s.map(r=>i().warmResolveCache(r)));let c=[];for(let r of n){let u=l(r);if(!u)continue;let a;try{a=await u.checks(e)}catch(h){a=[d(r,"toolchain check",h)]}c.push({platform:r,checks:a})}return{sections:c}}function m(t){return t==="pass"?"\u2713":t==="fail"?"\u2717":"\u2139"}function x(t){return t.charAt(0).toUpperCase()+t.slice(1)}function C(t){let e=[];if(t.sections.length===0)return"No mobile platforms are supported on this host.";for(let o of t.sections){e.length>0&&e.push(""),e.push(`${x(o.platform)} toolchain`);let n=o.checks.filter(s=>s.status!=="info"),i=new Set;for(let s of n){let c=s.detail?` \u2014 ${s.detail}`:"";if(e.push(` ${m(s.status)} ${s.label}${c}`),s.status==="fail"&&s.fixText&&!i.has(s.fixText)){i.add(s.fixText);for(let r of s.fixText.split(`
|
|
3
3
|
`))e.push(` fix: ${r}`)}}}return e.join(`
|
|
4
4
|
`)}function w(t){return t.sections.length===0?!0:t.sections.every(e=>e.checks.some(o=>o.required&&o.status==="fail"&&!o.fixedByBundle))}function b(t){for(let e of t.sections)for(let o of e.checks)if(o.required&&o.status!=="pass")return 2;return 0}export{k as a,C as b,w as c,b as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as l}from"./chunk-WD52ZNQY.js";import{b as i,d as p,e as f,g,h as u}from"./chunk-77ZZQJLX.js";import{b as d}from"./chunk-
|
|
2
|
+
import{b as l}from"./chunk-WD52ZNQY.js";import{b as i,d as p,e as f,g,h as u}from"./chunk-77ZZQJLX.js";import{b as d}from"./chunk-2PZKMT3I.js";import{existsSync as t,mkdirSync as w,readFileSync as S,renameSync as y,writeFileSync as D}from"fs";import{join as j}from"path";function O(r){l(i(r));let a=i(r);if(!t(a))return;let s=j(a,"meta.json"),n=f(r);if(t(s)&&!t(n))try{w(p(r),{recursive:!0}),y(s,n)}catch(e){process.stderr.write(`warn: meta.json migration failed: ${e.message}
|
|
3
3
|
`)}let c=u(r);if(t(c)){let e="python";try{let o=new d().load();o.code_export?.language&&(e=o.code_export.language)}catch{}let m=g(r,"playwright",e);if(!t(m))try{y(c,m)}catch(o){process.stderr.write(`warn: generated-code migration failed: ${o.message}
|
|
4
4
|
`)}}if(t(n))try{let e=JSON.parse(S(n,"utf8"));"md5sum"in e&&(delete e.md5sum,D(n,JSON.stringify(e,null,2)+`
|
|
5
5
|
`,"utf8"))}catch(e){process.stderr.write(`warn: meta.json md5sum strip failed: ${e.message}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as D}from"./chunk-KGNE5CIM.js";import{a as ue,b as te,d as ce,e as R,k as de}from"./chunk-
|
|
3
|
-
next: ${
|
|
2
|
+
import{a as D}from"./chunk-KGNE5CIM.js";import{a as ue,b as te,d as ce,e as R,k as de}from"./chunk-JCSVBD4F.js";import{mkdirSync as Be,writeFileSync as Ae}from"fs";import{join as X}from"path";var ve="start LT with --env ht-stage|ht-prod --tunnelName <name>; see kane-cli explore run --help";function me(t){if(/either tunnel is not running or disconnected/i.test(t))return`remote browser: no running LT tunnel found for this run (HPS: either tunnel is not running or disconnected)
|
|
3
|
+
next: ${ve}`;let e=/WebSocket error: \S*\/kane-cli\S* (5\d\d)\b/.exec(t)?.[1];if(e){let r=Ee(t);return`remote browser: HPS answered HTTP ${e} to the connect${r?` (HPS: ${r})`:""} (on a tunnel run: the tunnel service failed); run again, and report it to the platform team if it persists`}return null}function Ee(t){let e=t.split(`
|
|
4
|
+
`).slice(1).find(i=>i.trim()&&!/^Call log:/.test(i.trim())&&!/^\s*-\s*</.test(i));if(!e)return null;let r=e.trim();try{let i=JSON.parse(r),s=i?.value?.message??i?.message;typeof s=="string"&&s.trim()&&(r=s.trim())}catch{}return r=r.replace(/\b(?:wss?|https?):\/\/\S+/g,"<url>"),r.length>300?r.slice(0,300)+"\u2026":r}var Se={baseMs:500,maxMs:3e4},W=class{o;backoff;sleep;nextSeq;draining=null;stopDeadline=null;wake=null;_state="open";_refusal=null;_fatal=null;_committedThisRun=0;constructor(e){this.o=e,this.backoff=e.backoff??Se,this.sleep=e.sleep??(r=>new Promise(i=>setTimeout(i,r))),this.nextSeq=Math.max(e.firstSeq,e.queue.lastParked+1)}get state(){return this._state}get refusal(){return this._refusal}get fatal(){return this._fatal}get pendingCount(){return this.o.queue.pendingCount}get committedThisRun(){return this._committedThisRun}get lastCommitted(){return this.o.queue.lastCommitted}enqueue(e){return e.run_id!==this.o.runId?{ok:!1,code:"RUN_MISMATCH",reason:`delta ${e.seq} names run ${e.run_id}, this run is ${this.o.runId}`}:!Number.isInteger(e.seq)||e.seq!==this.nextSeq?{ok:!1,code:"SEQUENCE_LOCAL",reason:`expected seq ${this.nextSeq} for run ${this.o.runId}, received ${String(e.seq)}`}:(this.o.queue.append(e),this.nextSeq=e.seq+1,this.kick(),{ok:!0})}kick(){this._state==="open"&&(this.draining||(this.draining=this.drainLoop().catch(e=>(this.markFatal(this.o.queue.pending()[0]?.seq??-1,"LOCAL_IO",e instanceof Error?e.message:String(e)),"stopped")).then(e=>{this.draining=null,e==="empty"&&this._state==="open"&&this.o.queue.pendingCount>0&&this.kick()})))}async flush(e){if(this.stopDeadline=Date.now()+e,this.kick(),this.wake){let r=this.wake;this.wake=null,r()}for(;this.draining;)await this.draining;return this.o.queue.pendingCount}async drainLoop(){let e=0;for(;this._state==="open";){let r=this.o.queue.pending()[0];if(!r)return"empty";let i=this.o.queue.refused(r.seq);if(i)return this.refuse(r.seq,i.code,`previously refused: ${i.reason}`,!1),"stopped";let s=await this.o.client.commitDelta(this.o.explorationId,this.o.runId,r);switch(s.kind){case"committed":e=0,this.o.queue.markCommitted(r.seq),this._committedThisRun++,this.o.onAck?.(r.seq);break;case"refused":return this.refuse(r.seq,s.code,s.reason,!0),"stopped";case"fatal":return this.markFatal(r.seq,s.code,s.reason),"stopped";case"transient":{e++;let a=Math.min(this.backoff.maxMs,this.backoff.baseMs*2**(e-1));if(this.stopDeadline!==null&&Date.now()+a>this.stopDeadline)return"deadline";this.o.onRetry?.(r.seq,e,s.reason,a),await this.interruptibleSleep(a);break}}}return"stopped"}markFatal(e,r,i){this._state="fatal",this._fatal={seq:e,code:r,reason:i},this.o.onFatal?.(e,r,i)}refuse(e,r,i,s){s&&this.o.queue.markRefused(e,r,i,{controller_wire:this.o.controllerWire,client_wire:ue}),this._state="refused",this._refusal={seq:e,code:r,reason:i},this.o.onRefused?.(e,r,i)}async interruptibleSleep(e){await Promise.race([this.sleep(e),new Promise(r=>{this.wake=r})]),this.wake=null}};import{appendFileSync as Ce,closeSync as $e,existsSync as Pe,fsyncSync as Te,mkdirSync as Ie,openSync as De,readFileSync as Me}from"fs";import{dirname as Oe,join as Le}from"path";var Fe="pending-deltas.ndjson",Q=class{path;deltas=new Map;committed=new Set;refusedBySeq=new Map;tornTail=!1;constructor(e){this.path=Le(e,Fe),this.load()}append(e){let r=this.deltas.get(e.seq);if(r){if(JSON.stringify(r)===JSON.stringify(e))return;throw new Error(`pending queue already holds a different delta for seq ${e.seq}`)}this.write({op:"delta",seq:e.seq,delta:e}),this.deltas.set(e.seq,e)}markCommitted(e){this.committed.has(e)||(this.write({op:"committed",seq:e}),this.committed.add(e))}markRefused(e,r,i,s={}){let a={...s.controller_wire?{controller_wire:s.controller_wire}:{},...s.client_wire?{client_wire:s.client_wire}:{}};this.write({op:"refused",seq:e,code:r,reason:i,...a}),this.refusedBySeq.set(e,{seq:e,code:r,reason:i,...a})}pending(){return[...this.deltas.entries()].filter(([e])=>!this.committed.has(e)).sort(([e],[r])=>e-r).map(([,e])=>e)}get pendingCount(){return this.pending().length}get lastCommitted(){let e=0;for(let r of this.committed)e=Math.max(e,r);return e}get lastParked(){let e=0;for(let r of this.deltas.keys())e=Math.max(e,r);return e}refused(e){return this.refusedBySeq.get(e)}load(){if(!Pe(this.path))return;let e=Me(this.path,"utf8");this.tornTail=e.length>0&&!e.endsWith(`
|
|
4
5
|
`);let r=e.split(`
|
|
5
|
-
`);for(let i of r){let s=i.trim();if(!s)continue;let a;try{a=JSON.parse(s)}catch{continue}if(!(!a||typeof a.seq!="number")){if(a.op==="delta"&&a.delta)this.deltas.set(a.seq,a.delta);else if(a.op==="committed")this.committed.add(a.seq);else if(a.op==="refused"){let{op:h,...m}=a;this.refusedBySeq.set(a.seq,m)}}}}write(e){
|
|
6
|
-
`:"";
|
|
7
|
-
`),this.tornTail=!1;try{let i=
|
|
6
|
+
`);for(let i of r){let s=i.trim();if(!s)continue;let a;try{a=JSON.parse(s)}catch{continue}if(!(!a||typeof a.seq!="number")){if(a.op==="delta"&&a.delta)this.deltas.set(a.seq,a.delta);else if(a.op==="committed")this.committed.add(a.seq);else if(a.op==="refused"){let{op:h,...m}=a;this.refusedBySeq.set(a.seq,m)}}}}write(e){Ie(Oe(this.path),{recursive:!0});let r=this.tornTail?`
|
|
7
|
+
`:"";Ce(this.path,r+JSON.stringify(e)+`
|
|
8
|
+
`),this.tornTail=!1;try{let i=De(this.path,"r+");try{Te(i)}finally{$e(i)}}catch{}}};function H(t){return t.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function fe(t){return new Set([...H(t.name),...H(t.heading??""),...H(t.url_pattern)])}function pe(t){let e=t.heading&&t.heading!==t.name?`, heading "${t.heading}"`:"";return`"${t.name}" (${t.url_pattern}${e}, id ${t.id})`}function Ne(t,e,r=e){let i=e.filter(m=>m.id!==t.id),s=r.filter(m=>m.id!==t.id),a=(m,p)=>m.trim().toLowerCase()===p.trim().toLowerCase(),h=m=>!i.some(p=>a(p.name,m)||a(p.heading??"",m));if(t.name.trim()&&h(t.name))return t.name.trim();if(t.heading?.trim()&&h(t.heading))return t.heading.trim();for(let m=Math.min(12,t.id.length);m<t.id.length;m++){let p=t.id.slice(0,m);if(!s.some(g=>g.id.startsWith(p)))return p}return t.id}function he(t,e,r={}){let i=t.trim();if(!i)return{ok:!1,error:'--focus needs a screen name, e.g. --focus "Projects"'};let s=e.filter(l=>!r[l.id]||r[l.id]===l.id),a=s.filter(l=>l.id===i||i.length>=8&&l.id.startsWith(i));if(a.length===1)return{ok:!0,junction:a[0]};let h=s.filter(l=>!l.exit),m=h.filter(l=>[l.name,l.heading??""].some(d=>d.trim().toLowerCase()===i.toLowerCase()));if(m.length===1)return{ok:!0,junction:m[0]};let p=H(i),g=h.filter(l=>{let d=fe(l);return p.every(S=>d.has(S))});if(g.length===1)return{ok:!0,junction:g[0]};if(g.length>1){let l=g.map(d=>` ${pe(d)} \u2192 --focus "${Ne(d,g,s)}"`).join(`
|
|
8
9
|
`);return{ok:!1,error:`--focus "${i}" matches ${g.length} screens; name one:
|
|
9
10
|
${l}`}}let M=h.map(l=>({j:l,n:p.filter(d=>fe(l).has(d)).length})).filter(l=>l.n>0).sort((l,d)=>d.n-l.n).slice(0,5).map(l=>` ${pe(l.j)}`);return{ok:!1,error:`--focus "${i}" matches no screen on this exploration's map`+(M.length?`; closest:
|
|
10
11
|
${M.join(`
|
|
11
|
-
`)}`:"")}}function ge(t){let e=t.projection??t,i=(Array.isArray(e.junctions)?e.junctions:[]).filter(a=>typeof a.id=="string").map(a=>({id:a.id,name:String(a.name??""),url_pattern:String(a.url_pattern??""),...typeof a.heading=="string"&&a.heading?{heading:a.heading}:{},...Array.isArray(a.variants)&&a.variants.some(h=>typeof h=="string"&&h.startsWith("exit:"))?{exit:!0}:{}})),s=e.aliases&&typeof e.aliases=="object"?e.aliases:{};return{junctions:i,aliases:s}}var
|
|
12
|
-
`);try{for await(let n of w.events){let o=n;switch(o.type){case"ready":J||(J=!0,clearTimeout(Z),F(JSON.stringify({command:"run",run_id:d,kind:"explore",exploration_id:s,url:t.url,prompt:t.context?.prompt??t.prompt,...t.context?.deps?{deps:t.context.deps}:{},policy:t.policy,attempt:1,sessions:Math.max(1,t.maxParallel??1),...t.maxLeases!==void 0?{max_leases:t.maxLeases}:{},...t.slowBudgets&&Object.keys(t.slowBudgets).length?{slow_budgets:t.slowBudgets}:{},...t.recheck===!1?{recheck:!1}:{},...t.variables&&Object.keys(t.variables).length?{variables:t.variables}:{},...t.denyNames?.length?{deny_names:t.denyNames}:{},...t.allowedDomains?.length?{allowed_domains:t.allowedDomains}:{},...t.allowPosts?.length?{allow_posts:t.allowPosts}:{},...t.depthCaps&&Object.keys(t.depthCaps).length?{thresholds:{depth_caps:t.depthCaps}}:{},...p?{focus:{junction_id:p.id,name:p.name}}:{},max_parallel:Math.max(1,t.maxParallel??1),width:t.width,height:t.height,evidence_dir:
|
|
12
|
+
`)}`:"")}}function ge(t){let e=t.projection??t,i=(Array.isArray(e.junctions)?e.junctions:[]).filter(a=>typeof a.id=="string").map(a=>({id:a.id,name:String(a.name??""),url_pattern:String(a.url_pattern??""),...typeof a.heading=="string"&&a.heading?{heading:a.heading}:{},...Array.isArray(a.variants)&&a.variants.some(h=>typeof h=="string"&&h.startsWith("exit:"))?{exit:!0}:{}})),s=e.aliases&&typeof e.aliases=="object"?e.aliases:{};return{junctions:i,aliases:s}}var Je=1e3,U=2;function re(t){return t.code==="completed"||t.code==="budget"?0:t.code.startsWith("failed:")?1:3}function lt(t){return t.remark&&!t.remark.code.startsWith("failed:")?0:t.exitCode}function we(t,e,r){if(t&&typeof t=="object"&&typeof t.code=="string")return t;let i=ce.includes(e)?e:"runner_error";return R(i,r)}function ut(t){return{type:"done",state:t.state,remark:t.remark,exit_code:t.exitCode,exploration_id:t.explorationId??null,run_id:t.runId??null,committed:t.committed??0,pending:t.pending??0,last_seq:t.lastSeq??0,stop_reason:t.stopReason??null,complete:t.complete??!1,...t.runDir?{run_dir:t.runDir}:{},...t.error?{error:t.error}:{}}}function je(t,e){return X(t,"explorations",e)}function We(t,e,r){return X(je(t,e),"runs",r)}var Qe="this exploration service predates --no-context (it does not take context_enabled): run without --no-context, then turn it off with kane-cli explore context off <exploration-id>";function He(t){let e=t instanceof Error?t.message:String(t);return/unknown field\W+context_enabled/.test(e)&&(!(t instanceof D)||t.status===400)}function Ue(t){let e=t instanceof Error?t.message:String(t);return/unknown field\W+policy/.test(e)&&(!(t instanceof D)||t.status===400)}async function ct(t,e){let r={state:null,remark:null,exitCode:U,explorationId:t.explorationId??null,runId:null,runDir:null,committed:0,pending:0,lastSeq:0,stopReason:null,complete:!1},i=(n,o=U,u=null)=>(r.error=n,r.exitCode=o,u&&(r.state="stopped",r.remark=u),e.emit({type:"error",message:n}),r),s=t.explorationId,a;try{a=await e.client.wireVersion()}catch(n){return i(`could not reach the exploration service: ${b(n)}`)}let h=te(a);if(h)return i(h);if(t.claimRunId&&!s)return i("--claim-run needs --exploration-id (the exploration the queued run belongs to)");let m=n=>{e.emit({type:"warning",message:`exploration ${n} already exists; its assurance context is unchanged \u2014 use \`kane-cli explore context off ${n}\``})};if(s&&t.contextEnabled===!1&&m(s),!s)try{s=(await e.client.createExploration({project_id:t.projectId??null,target_url:t.url,prompt:t.prompt,policy:t.policy,...t.allowedDomains?.length?{allowed_domains:t.allowedDomains}:{},...t.contextEnabled===!1?{context_enabled:!1}:{}})).id,e.emit({type:"exploration_created",exploration_id:s,policy:t.policy})}catch(n){let o=n instanceof D&&n.code==="EXPLORATION_EXISTS"&&typeof n.body?.exploration_id=="string"?n.body.exploration_id:null;if(!o)return t.contextEnabled===!1&&He(n)?i(Qe):i(`could not create the exploration: ${b(n)}`);s=o,t.contextEnabled===!1&&m(o)}r.explorationId=s;let p=null;if(t.focus!==void 0){if(!t.explorationId)return i("--focus needs --exploration-id: it names a screen of an existing exploration's map");let n;try{n=await e.client.queryMap(s)}catch(x){return i(`--focus: could not read the exploration's map: ${b(x)}`)}let{junctions:o,aliases:u}=ge(n),f=he(t.focus,o,u);if(!f.ok)return i(f.error);p=f.junction,e.emit({type:"focus_resolved",junction_id:p.id,name:p.name,url_pattern:p.url_pattern})}let g=null,M=(n,o,u,f)=>new W({client:e.client,queue:n,explorationId:s,runId:o,firstSeq:u,backoff:e.backoff,sleep:e.sleep,controllerWire:a,onAck:x=>{e.emit({type:"delta_committed",seq:x}),f&&y("delta_ack",{seq:x,committed:!0})},onRefused:(x,P,T)=>{e.emit({type:"commit_refused",seq:x,code:P,reason:T}),f&&y("commit_refused",{seq:x,reason:`${P}: ${T}`})},onFatal:(x,P,T)=>{e.emit({type:"commit_failed",seq:x,code:P,reason:T})},onRetry:(x,P,T,qe)=>{e.emit({type:"commit_retry",seq:x,attempt:P,reason:T,wait_ms:qe})}}),l;try{let n={...t.claimRunId?{run_id:t.claimRunId}:t.requested?{requested:t.requested}:{},...t.claimRunId?{}:{policy:t.policy},sessions:Math.max(1,t.maxParallel??1),client_release:t.clientRelease};try{l=await e.client.startRun(s,n)}catch(o){if(!(n.policy&&Ue(o)))throw o;let{policy:u,...f}=n;l=await e.client.startRun(s,f)}}catch(n){let o=n instanceof D?` (${n.code})`:"";return i(`could not start the run${o}: ${b(n)}`)}let d=l.run_id,S=te(l.wire_version);if(S){try{await e.client.endRun(s,d,{remark:R("controller_outdated",S),stop_reason:"controller_outdated",last_seq:l.next_seq-1,complete:!1,totals:{},unacked:0})}catch{}return r.runId=d,i(S,U,R("controller_outdated",S))}r.runId=d;let C=We(e.baseDir,s,d);r.runDir=C,Be(C,{recursive:!0}),g=new Q(C);let O=Math.max(l.next_seq,g.lastCommitted+1),ke={...l.projection,last_seq:O-1},ne=X(C,"starting-projection.json");Ae(ne,JSON.stringify(ke)),e.onLiveRun?.({explorationId:s,runId:d,liveToken:l.live_token??null}),e.emit({type:"explore_run_started",exploration_id:s,run_id:d,...l.version!==void 0?{version:l.version}:{},next_seq:O,run_dir:C,policy:t.policy});let L,oe=e.browserAcquireTimeoutMs??6e4;try{L=await ye(e.acquireBrowser(0),oe,`worker 0's browser was not ready within ${Math.round(oe/1e3)}s`)}catch(n){try{await e.client.endRun(s,d,{remark:R("no_browsers",`worker 0's browser could not be opened: ${b(n)}`),stop_reason:"no_browsers",last_seq:O-1,complete:!1,totals:{},unacked:0})}catch{}return r.stopReason="no_browsers",i(`could not open worker 0's browser: ${b(n)}`,1,R("no_browsers",`worker 0's browser could not be opened: ${b(n)}`))}let w;try{w=e.spawnRunner(d)}catch(n){try{L.release()}catch{}return i(`could not spawn the runner: ${b(n)}`)}let F=n=>{try{w.child.stdin?.write(n)}catch{}};function y(n,o){F(de(n,o))}e.frameLink?.({start:n=>y("frames_start",{worker_index:n}),stop:n=>y("frames_stop",{worker_index:n})});let k=M(g,d,O,!0),N=0,ie=-1/0,xe=e.now??(()=>Date.now()),_e=e.onInterrupt?.(()=>{let n=xe();if(!(n-ie<Je))if(ie=n,N++,N===1&&!J){e.emit({type:"explore_control",control:"stop"}),ae=!0,e.releaseBrowsersOnInterrupt&&z();try{w.child.kill("SIGTERM")}catch{}}else if(N===1)e.emit({type:"explore_control",control:"stop"}),e.releaseBrowsersOnInterrupt&&z(),y("stop",e.releaseBrowsersOnInterrupt?{browsers_released:!0}:{});else if(N===2)e.emit({type:"warning",message:"the run is stopping cleanly (its leases finish, every delta is sent); press Ctrl-C again to kill it now"});else{V=!0,e.emit({type:"warning",message:"killing the runner: deltas not yet committed are lost"}),e.releaseBrowsersOnInterrupt&&z();try{w.child.kill("SIGKILL")}catch{}}}),se=Math.max(1,t.maxParallel??1),_=new Map([[0,L]]),G=1,I=Promise.resolve(),K=!1,z=()=>{K=!0;for(let[n,o]of _){try{o.release()}catch{}_.delete(n)}},be=n=>{I=I.then(async()=>{if(K){y("browser_failed",{worker_index:n,reason:"the run was interrupted: no new browser is opened while it stops"});return}if(_.has(n)){y("browser_failed",{worker_index:n,reason:`worker ${n} already holds a browser`});return}if(_.size>=se){y("browser_failed",{worker_index:n,reason:`--max-parallel ${se} reached: workers ${[..._.keys()].join(", ")} hold every browser`});return}try{let o=await ye(e.acquireBrowser(n),e.browserAcquireTimeoutMs??6e4,`browser for worker ${n} was not ready within ${Math.round((e.browserAcquireTimeoutMs??6e4)/1e3)}s`);if(K){try{o.release()}catch{}y("browser_failed",{worker_index:n,reason:"the run was interrupted: no new browser is opened while it stops"});return}_.set(n,o),G=Math.max(G,_.size),y("browser_ready",{worker_index:n,cdp_endpoint:o.cdpEndpoint})}catch(o){y("browser_failed",{worker_index:n,reason:b(o)})}})},Re=n=>{I=I.then(()=>{let o=_.get(n);if(o){try{o.release()}catch{}_.delete(n)}})},B=!1,$=null,c=null,q=null,A=null,J=!1,ae=!1,V=!1,Y=!1,Z=setTimeout(()=>{if(!J){q=q??`the runner did not become ready within ${e.readyTimeoutMs??12e4}ms`;try{w.child.kill("SIGTERM")}catch{}}},e.readyTimeoutMs??12e4);Z.unref?.(),F(JSON.stringify({command:"start",session_id:d,cdp_endpoint:L.cdpEndpoint,username:t.auth.username,access_key:t.auth.access_key,headless:t.headless,width:t.width,height:t.height,disable_ask_user:!0})+`
|
|
13
|
+
`);try{for await(let n of w.events){let o=n;switch(o.type){case"ready":J||(J=!0,clearTimeout(Z),F(JSON.stringify({command:"run",run_id:d,kind:"explore",exploration_id:s,url:t.url,prompt:t.context?.prompt??t.prompt,...t.context?.deps?{deps:t.context.deps}:{},policy:t.policy,attempt:1,sessions:Math.max(1,t.maxParallel??1),...t.maxLeases!==void 0?{max_leases:t.maxLeases}:{},...t.slowBudgets&&Object.keys(t.slowBudgets).length?{slow_budgets:t.slowBudgets}:{},...t.recheck===!1?{recheck:!1}:{},...t.variables&&Object.keys(t.variables).length?{variables:t.variables}:{},...t.denyNames?.length?{deny_names:t.denyNames}:{},...t.allowedDomains?.length?{allowed_domains:t.allowedDomains}:{},...t.allowPosts?.length?{allow_posts:t.allowPosts}:{},...t.depthCaps&&Object.keys(t.depthCaps).length?{thresholds:{depth_caps:t.depthCaps}}:{},...p?{focus:{junction_id:p.id,name:p.name}}:{},max_parallel:Math.max(1,t.maxParallel??1),width:t.width,height:t.height,evidence_dir:X(C,"evidence"),starting_projection:ne})+`
|
|
13
14
|
`));break;case"explore_frame":{let u=Number(o.worker_index);Number.isInteger(u)&&typeof o.data=="string"&&e.onFrame?.(u,o.data),y("frames_ack",{worker_index:u});break}case"browser_request":be(Number(o.worker_index));break;case"browser_release":Re(Number(o.worker_index)),e.emit(o);break;case"map_delta":{let u=o.delta;if(!u||typeof u!="object"){e.emit({type:"error",message:"map_delta without a delta"});break}if(Y)break;e.emit({type:"map_delta",seq:u.seq,attempt:u.attempt,lease_id:u.lease_id});let f=k.enqueue(u);f.ok||(Y=!0,e.emit({type:"commit_refused",seq:u.seq,code:f.code,reason:f.reason}),y("commit_refused",{seq:u.seq,reason:`${f.code}: ${f.reason}`}));break}case"explore_end":c=o,c.credits&&!r.credits&&(r.credits=c.credits),c.focus&&!r.focus&&(r.focus=c.focus),c.refused&&(r.refused=c.refused),c.parallelism&&!r.parallelism&&(r.parallelism=c.parallelism),e.emit(o);break;case"error":A=typeof o.message=="string"?o.message:JSON.stringify(o),q=me(A)??A,e.emit({type:"runner_error",message:q});break;case"done":B=!0,$=o,o.teardown&&typeof o.teardown=="object"&&(r.teardown=o.teardown),o.credits&&typeof o.credits=="object"&&(r.credits=o.credits),typeof o.credits_consumed=="number"&&(r.creditsConsumed=o.credits_consumed),o.focus&&typeof o.focus=="object"&&(r.focus=o.focus),typeof o.refused=="string"&&o.refused&&(r.refused=o.refused),o.parallelism&&typeof o.parallelism=="object"&&(r.parallelism=o.parallelism);break;default:e.emit(o)}if(B)break}}finally{clearTimeout(Z),_e?.(),e.frameLink?.(null)}F(JSON.stringify({command:"shutdown"})+`
|
|
14
|
-
`);try{w.child.stdin?.end()}catch{}if(await Promise.race([w.exited,new Promise(n=>setTimeout(n,e.runnerExitTimeoutMs??1e4).unref?.())]),w.getExitCode()===null&&w.getExitSignal()===null)try{w.child.kill("SIGTERM")}catch{}await I;for(let[n,o]of _){try{o.release()}catch{}_.delete(n)}r.peakParallel=G;let
|
|
15
|
-
${o}`:""}${x}; a new run continues from the map`,
|
|
15
|
+
`);try{w.child.stdin?.end()}catch{}if(await Promise.race([w.exited,new Promise(n=>setTimeout(n,e.runnerExitTimeoutMs??1e4).unref?.())]),w.getExitCode()===null&&w.getExitSignal()===null)try{w.child.kill("SIGTERM")}catch{}await I;for(let[n,o]of _){try{o.release()}catch{}_.delete(n)}r.peakParallel=G;let v=await k.flush(V?Math.min(1e3,e.drainTimeoutMs??1e3):e.drainTimeoutMs??6e4);r.committed=k.committedThisRun,r.pending=v,r.lastSeq=g.lastCommitted,r.stopReason=c?.stop_reason??null,r.complete=!!c?.complete&&v===0;let E=async(n,o)=>{try{return await e.client.endRun(s,d,{remark:n,stop_reason:o,last_seq:g.lastCommitted,complete:n.code==="completed"&&!!c?.complete,totals:c?.totals??{},unacked:c?.unacked??0,...c?.credits?{credits:c.credits}:{},...c?.audit_notes?.length?{audit_notes:c.audit_notes}:{},...c?.focus?{focus:c.focus}:{}}),null}catch(u){return b(u)}};if(k.state==="refused"||Y){let n=k.refusal?`seq ${k.refusal.seq} refused: ${k.refusal.code}: ${k.refusal.reason}`:"a delta broke the run's sequence and was refused locally",o=R("commit_refused",n),u=await E(o,"commit_refused");return r.stopReason="commit_refused",i(`${n}${u?` (ending the run also failed: ${u})`:""}; queue kept in ${g.path}`,1,o)}if(V){let n={code:"user_stop",message:"killed by the user"},o=await E(n,"killed");return r.stopReason="killed",o?i(`killed, but ending the run failed: ${o}`,3,n):(r.state="stopped",r.remark=n,r.exitCode=re(n),v>0&&(r.error=`${v} delta(s) were not committed and are lost with this run`),r)}if(k.state==="fatal"||v>0){let n=k.state==="fatal"&&k.fatal?`committing stopped: ${k.fatal.code}: ${k.fatal.reason}; `:"",o=R("commit_failed",`${v} delta(s) could not be committed`),u=await E(o,"commit_failed");return r.stopReason="commit_failed",i(`${n}${v} delta(s) could not be committed and are lost with this run (the queue stays in ${g.path}); a new run continues from the map${u?` (ending the run also failed: ${u})`:""}`,1,o)}if(B&&!c&&$&&$.success===!1&&typeof $.stop_reason=="string"){let n=$.stop_reason,o=q??`the runner refused the run: ${n}`,u=we($.remark,n,o),f=await E(u,n);return r.stopReason=n,i(`${o}${f?` (ending the run also failed: ${f})`:""}`,1,u)}if(ae&&!c){let n={code:"user_stop",message:"stopped with Ctrl-C before it explored"},o=await E(n,"stopped");return r.stopReason="stopped",o?i(`stopped before exploring, but ending the run failed: ${o}`,1,n):(r.state="stopped",r.remark=n,r.exitCode=re(n),r)}if(!B||!c){let n=q??`the runner exited (code=${w.getExitCode()}, signal=${w.getExitSignal()??"none"}) before explore_end`,o=q!==null&&q!==A?"":w.getStderr().slice(-500),u=R("runner_error",n),f=await E(u,"runner_exited"),x=f?` (ending it failed: ${f})`:" (the run is ended)";return i(`${n}${o?`
|
|
16
|
+
${o}`:""}${x}; a new run continues from the map`,U,u)}let ee=c.stop_reason,j=we(c.remark,ee,`the runner ended the run (${ee}) without a remark`),le=await E(j,ee);return le?i(`every delta is committed but ending the run failed: ${le}`,1,j):(r.state="stopped",r.remark=j,r.exitCode=re(j),c.refused&&(r.error=c.refused,e.emit({type:"error",message:c.refused})),r)}function ye(t,e,r){return new Promise((i,s)=>{let a=setTimeout(()=>s(new Error(r)),e);a.unref?.(),t.then(h=>{clearTimeout(a),i(h)},h=>{clearTimeout(a),s(h)})})}function b(t){return t instanceof Error?t.message:String(t)}export{re as a,lt as b,ut as c,Qe as d,He as e,ct as f};
|
|
@@ -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-TLOYTGVT.js";import{a as p,e as E}from"./chunk-I2MC6VVX.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as y}from"./chunk-
|
|
2
|
+
import{a as y}from"./chunk-GGV336P5.js";import{createServer as b}from"http";import{createReadStream as C,promises as S}from"fs";import{randomBytes as R}from"crypto";var u="127.0.0.1";function A(n,e){if(!n)return null;let o=/^bytes=(\d*)-(\d*)$/.exec(n.trim());if(!o)return null;let[,a,r]=o;if(a===""&&r==="")return null;if(a===""){let i=Number(r);return i===0||e===0?"unsatisfiable":{start:Math.max(0,e-i),end:e-1}}let t=Number(a);if(t>=e)return"unsatisfiable";let c=r===""?e-1:Math.min(Number(r),e-1);return c<t?null:{start:t,end:c}}async function I(n){let e=R(16).toString("hex"),o=b((r,t)=>{H(r,t,n,e).catch(()=>t.destroy())});await new Promise((r,t)=>{o.once("error",t),o.listen(n.port??0,u,()=>{o.removeListener("error",t),r()})});let a=o.address().port;return{port:a,urlFor:r=>`http://${u}:${a}/${e}/${encodeURIComponent(r)}`,close:()=>new Promise(r=>{o.close(()=>r()),o.closeAllConnections()})}}async function H(n,e,o,a){let r=n.url??"/",t=s=>{try{o.log?.("warn","EVIDENCE_SERVE_DENIED",{reason:s,path:r})}catch{}};if(n.headers.host!==`${u}:${n.socket.localPort}`){t("host_mismatch"),e.writeHead(403).end();return}let c=n.headers.origin;if(c!==void 0&&!o.allowedOrigins.includes(c)){t("origin_denied"),e.writeHead(403).end();return}let i=c?{"Access-Control-Allow-Origin":c,Vary:"Origin","Access-Control-Expose-Headers":"Content-Range, Content-Length"}:{};if(n.method==="OPTIONS"){let s={...i,"Access-Control-Allow-Methods":"GET, HEAD, OPTIONS","Access-Control-Allow-Headers":"range","Access-Control-Max-Age":"86400"};n.headers["access-control-request-private-network"]==="true"&&(s["Access-Control-Allow-Private-Network"]="true"),e.writeHead(204,s).end();return}if(n.method!=="GET"&&n.method!=="HEAD"){e.writeHead(405,i).end();return}let v;try{let s=new URL(n.url??"/",`http://${u}`).pathname.split("/");if(s.length!==3||s[1]!==a){t("bad_token"),e.writeHead(404,i).end();return}v=decodeURIComponent(s[2])}catch{t("not_found"),e.writeHead(404,i).end();return}let g=o.packs.get(v);if(!g){t("not_found"),e.writeHead(404,i).end();return}let d;try{let s=await S.stat(g);if(!s.isFile())throw new Error("not a file");d=s.size}catch{t("not_found"),e.writeHead(404,i).end();return}let h={...i,"Accept-Ranges":"bytes","Content-Type":"application/zip","Cache-Control":"no-store"};if(n.method==="HEAD"){e.writeHead(200,{...h,"Content-Length":String(d)}).end();return}let l=A(n.headers.range,d);if(l==="unsatisfiable"){t("unsatisfiable"),e.writeHead(416,{...i,"Content-Range":`bytes */${d}`}).end();return}let[m,p,w]=l===null?[0,d-1,200]:[l.start,l.end,206],E={...h,"Content-Length":String(p-m+1)};if(w===206&&(E["Content-Range"]=`bytes ${m}-${p}/${d}`),e.writeHead(w,E),d===0){e.end();return}let f=C(g,{start:m,end:p});f.on("error",()=>e.destroy()),e.on("close",()=>f.destroy()),f.pipe(e)}function O(n,e){return(e??y(n).evidenceViewerUrl).replace(/\/+$/,"")}function k(n,e){return`${e}/?pack=${encodeURIComponent(n)}`}function P(n){return`evidence: view locally with \`kane-cli evidence serve ${n}\``}export{A as a,I as b,O as c,k as d,P as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b}from"./chunk-
|
|
2
|
+
import{a as b}from"./chunk-A3TCFSCK.js";import{a as L}from"./chunk-HCBYKLMW.js";import{a as d,b as c,i as A}from"./chunk-33DWJV67.js";import{a as D}from"./chunk-6YGTRKDT.js";import{m as u,z as o}from"./chunk-QMOGBKJM.js";import{e as h}from"./chunk-UR6MHSHU.js";var x=h(D(),1);import{readdirSync as N,mkdirSync as B,statSync as k}from"fs";import{join as P}from"path";var r=h(L(),1);function O(n){try{return N(n).filter(l=>{try{return k(P(n,l)).isDirectory()}catch{return!1}})}catch{return[]}}function E(n,l,f,v){return{name:n,path:l,label:n,isActive:v}}function H({currentPath:n,onSelect:l,onCancel:f}){let s=O(u).map(i=>{let e=P(u,i);return E(i,e,n,e===n)}),p=!n,R=s.length+2,[a,C]=(0,x.useState)(()=>{if(p)return 0;let i=s.findIndex(e=>e.isActive);return i>=0?i+1:0}),[T,I]=(0,x.useState)(!1),[S,g]=(0,x.useState)("");return A((i,e)=>{if(T){if(e.escape){I(!1),g("");return}if(e.return){let t=S.trim();if(t){let m=P(u,t);B(m,{recursive:!0}),l(m),f()}return}if(e.backspace||e.delete){g(t=>t.slice(0,-1));return}i&&!e.ctrl&&!e.meta&&g(t=>t+i);return}if(e.escape){f();return}if(e.upArrow){C(t=>Math.max(0,t-1));return}if(e.downArrow){C(t=>Math.min(R-1,t+1));return}if(e.return){if(a===0){p||l(""),f();return}if(a===s.length+1){B(u,{recursive:!0}),I(!0),g("");return}let t=s[a-1];t&&!t.isActive&&l(t.path),f();return}}),T?(0,r.jsxs)(d,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,r.jsx)(c,{color:o.orange,bold:!0,children:"Chrome Profile \u203A New"}),(0,r.jsxs)(d,{marginTop:1,children:[(0,r.jsx)(c,{color:o.secondary,children:"Name: "}),(0,r.jsx)(c,{children:S}),(0,r.jsx)(c,{color:o.dim,children:"\u2588"})]}),(0,r.jsx)(b,{bindings:[{keys:"\u21B5",label:"create"}],escBackLabel:"back"})]}):(0,r.jsxs)(d,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,r.jsx)(c,{color:o.orange,bold:!0,children:"Chrome Profile"}),(0,r.jsxs)(d,{flexDirection:"column",marginTop:1,children:[(0,r.jsxs)(c,{color:p?o.green:a===0?o.orange:o.dim,children:[a===0?"\u276F ":" ","Use temporary (no profile)",p?" \u25CF active":""]}),s.map((i,e)=>{let m=e+1===a,w=m?"\u276F ":" ",y=i.isActive?o.green:m?o.orange:void 0;return(0,r.jsxs)(c,{color:y,children:[w,i.label,i.isActive?" \u25CF active":""]},i.name)}),(0,r.jsxs)(c,{color:a===s.length+1?o.orange:o.dim,children:[a===s.length+1?"\u276F ":" ","+ Create new"]})]}),(0,r.jsx)(b,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}export{O as a,E as b,H as c};
|
|
@@ -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-A3TCFSCK.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a,b as r,i as u}from"./chunk-33DWJV67.js";import{a as b}from"./chunk-6YGTRKDT.js";import{z as t}from"./chunk-QMOGBKJM.js";import{e as n}from"./chunk-UR6MHSHU.js";var c=n(b(),1);var e=n(p(),1);function R({onSubmit:l}){let[o,f]=(0,c.useState)(0),s=(0,c.useRef)(!1);return u((x,i)=>{s.current||(i.leftArrow||i.rightArrow?f(d=>d===0?1:0):i.return?(s.current=!0,l(o===0?"positive":"negative")):i.escape&&(s.current=!0,l(null)))}),(0,e.jsxs)(a,{flexDirection:"column",marginTop:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(r,{color:t.secondary,children:"Rate this session: "}),(0,e.jsx)(r,{color:o===0?t.orange:t.dim,children:o===0?"[ \u{1F44D} ]":" \u{1F44D} "}),(0,e.jsx)(r,{children:" "}),(0,e.jsx)(r,{color:o===1?t.orange:t.dim,children:o===1?"[ \u{1F44E} ]":" \u{1F44E} "})]}),(0,e.jsx)(m,{bindings:[{keys:"\u2190/\u2192",label:"select"},{keys:"\u21B5",label:"submit"}],escBackLabel:"skip"})]})}export{R as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{f as y,h as z,j as U}from"./chunk-JGRXMTME.js";import{b as N,c as O,e as S,f as D,j as T}from"./chunk-77ZZQJLX.js";import{a as Y}from"./chunk-JIRNI5TB.js";import{a as M}from"./chunk-UTM7D4PI.js";import{a as R}from"./chunk-FCD3NYOM.js";import{a as F}from"./chunk-B7ZX5HEN.js";import{a as A}from"./chunk-
|
|
2
|
+
import{f as y,h as z,j as U}from"./chunk-JGRXMTME.js";import{b as N,c as O,e as S,f as D,j as T}from"./chunk-77ZZQJLX.js";import{a as Y}from"./chunk-JIRNI5TB.js";import{a as M}from"./chunk-UTM7D4PI.js";import{a as R}from"./chunk-FCD3NYOM.js";import{a as F}from"./chunk-B7ZX5HEN.js";import{a as A}from"./chunk-QMOGBKJM.js";import{e as $}from"./chunk-UR6MHSHU.js";var C=$(Y(),1);import{existsSync as k,readFileSync as I,readdirSync as J,statSync as K}from"fs";import{dirname as H,isAbsolute as V,join as h,relative as P,resolve as Z,sep as _}from"path";import{createHash as q}from"crypto";var b="testmd-bundle.json",u=class extends Error{constructor(t){super(t),this.name="BundleUsageError"}},B=e=>e.split(_).join("/");function v(e){if(!k(e))return[];let t=[];for(let s of J(e).sort()){let r=h(e,s);K(r).isDirectory()?t.push(...v(r)):t.push(r)}return t}function G(e){let t=e.map(r=>H(r).split(_)),s=t[0];for(let r of t.slice(1)){let i=0;for(;i<s.length&&i<r.length&&s[i]===r[i];)i++;s=s.slice(0,i)}return s.join(_)||_}function Q(e){for(let t of e){let s=F(t,I(t,"utf8"));for(let r of s.steps)if(r.body.kind==="import_ref"&&V(r.body.path))throw new u(`bundle sync: absolute @import is not portable after unzip: ${t} step ${r.index} (@import ${r.body.path})`)}}function j(e,t={}){let s=Z(e),r=S(s),i=y(s);if(!i?.commit_id||!i?.test_id)throw new u(`bundle sync: ${s} is not authored \u2014 run \`kane-cli testmd run\` first (output-<stem>/.internal/meta.json needs commit_id + test_id)`);let l;try{l=U(s)}catch(n){throw n instanceof z?new u(`bundle sync: ${n.message}`):n}let a=[s];for(let n of l.steps)for(let c of n.trace.slice(1))a.includes(c.file)||a.push(c.file);Q(a);let o=[],d=[];for(let n of l.unitFiles){if(n.file===s)continue;let c=N(n.file);o.includes(c)||o.push(c),n.kind==="module"&&d.push(S(n.file))}let m=[...a],p=n=>{k(n)&&m.push(n)};p(O(s)),m.push(r),p(D(s)),m.push(...v(T(s)));for(let n of o)p(h(n,"Result.md")),m.push(...v(h(n,".internal","steps")));for(let n of d)p(n);let f=G(m);if(k(h(f,b)))throw new u(`bundle sync: a real file named ${b} exists at the zip root (${f}) \u2014 it would collide with the generated manifest`);let x=m.map(n=>{let c=n===r&&t.identityOverride?Buffer.from(JSON.stringify({...JSON.parse(I(n,"utf8")),commit_id:t.identityOverride.commit_id},null,2)+`
|
|
3
3
|
`):void 0,E=c??I(n);return{abs:n,rel:B(P(f,n)),sha256:q("sha256").update(E).digest("hex"),bytes:E.length,...c?{contents:c}:{}}}).sort((n,c)=>n.rel<c.rel?-1:1),w=B(P(f,s)),L={schema_version:2,entry:w,commit_id:t.identityOverride?.commit_id??i.commit_id,test_id:i.test_id,testcase_id:i.testcase_id??null,project_id:i.project_id??null,folder_id:i.folder_id??null,org_id:i.org_id??null,created_at:new Date().toISOString(),producer:{name:"kane-cli",version:A},files:x.map(n=>({path:n.rel,sha256:n.sha256,bytes:n.bytes})),units:l.unitFiles.filter(n=>n.file!==s).map(n=>({path:B(P(f,n.file)),kind:n.kind}))};return{zipRoot:f,entry:w,files:x,manifest:L}}var g=e=>e instanceof Error?e.message:String(e);function W(e){return new Promise((t,s)=>{let r=(0,C.default)("zip",{zlib:{level:6}}),i=[];r.on("data",l=>i.push(l)),r.on("error",s),r.on("end",()=>t(Buffer.concat(i))),r.append(JSON.stringify(e.manifest,null,2)+`
|
|
4
4
|
`,{name:b});for(let l of e.files)l.contents?r.append(l.contents,{name:l.rel}):r.file(l.abs,{name:l.rel});r.finalize()})}async function X(e){let{plan:t,controller:s,testId:r,sessionId:i,commitId:l}=e,a;try{a=await W(t)}catch(d){return{ok:!1,stage:"zip",error:g(d)}}let o;try{let d={key:"testmd",content_type:"application/zip",filename:`${l}-testmd.zip`},p=(await s.getPresignedUrls(r,i,[d])).urls?.testmd?.upload_url;if(!p)return{ok:!1,stage:"presign",error:"presign response missing testmd upload_url"};o=p}catch(d){return{ok:!1,stage:"presign",error:g(d)}}try{await M(o,a,"application/zip")}catch(d){return{ok:!1,stage:"upload",error:g(d)}}return{ok:!0,bytes:a.length}}async function ee(e){let t;try{t=j(e.sourcePath,{identityOverride:e.identityOverride})}catch(s){return s instanceof u?{ok:!1,stage:"collect",error:s.message}:{ok:!1,stage:"collect",error:g(s)}}return X({...e,plan:t})}function ge(e){return e.shouldUploadPipeline&&e.uploadSucceeded&&!!e.metaCommitId&&!!e.metaTestId}function te(e){return e.persisted?e.uploadSucceeded?e.local?"local":e.hasBasicAuth?!e.metaCommitId||!e.metaTestId?"not_authored":null:"no_auth":"upload_failed":"not_persisted"}async function ye(e){let t=e.recordedTestPath??null,s=t?y(t):null,r=te({persisted:!!t,uploadSucceeded:e.uploadSucceeded,local:e.local,hasBasicAuth:!!e.basicAuth,metaCommitId:s?.commit_id,metaTestId:s?.test_id});if(r)return e.log("info","BUNDLE_SYNC_SKIPPED","testmd bundle sync skipped",{reason:r,...t?{path:t}:{}}),{skipped:r};let i=s.commit_id,l=s.test_id,a=o=>{try{e.onAgentEvent?.(o)}catch{}};try{let o=await(e.syncFn??ee)({sourcePath:t,testId:l,sessionId:e.sessionId,commitId:i,controller:new R(e.controllerBaseUrl,{username:e.basicAuth.username,accessKey:e.basicAuth.access_key})});return o.ok?(e.log("info","BUNDLE_SYNC_OK","testmd bundle pushed",{commit_id:i,path:t,bytes:o.bytes}),a({type:"test_md_bundle_sync",status:"ok",commit_id:i,path:t,bytes:o.bytes})):(e.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync failed",{commit_id:i,path:t,stage:o.stage,error:o.error}),a({type:"test_md_bundle_sync",status:"failed",commit_id:i,path:t,stage:o.stage})),o}catch(o){let d=g(o);return e.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync threw",{commit_id:i,path:t,error:d}),a({type:"test_md_bundle_sync",status:"failed",commit_id:i,path:t,stage:"upload"}),{ok:!1,stage:"upload",error:d}}}export{j as a,W as b,X as c,ee as d,ge as e,te as f,ye as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as B,c as S,d as T}from"./chunk-
|
|
2
|
+
import{b as B,c as S,d as T}from"./chunk-4523YDTG.js";import{c as g}from"./chunk-RFHMDQXZ.js";import{a as E}from"./chunk-WQR2GYP7.js";import{a as h}from"./chunk-HCBYKLMW.js";import{a as i,b as c,c as w,i as x}from"./chunk-33DWJV67.js";import{a as L}from"./chunk-6YGTRKDT.js";import{z as n}from"./chunk-QMOGBKJM.js";import{e as u}from"./chunk-UR6MHSHU.js";var l=u(L(),1);var r=u(h(),1);function y(e){return new Map(e.map((o,s)=>[`${s}-${o.label}`,o.packPath]))}async function H(e){let o=e.deps?.viewerBase??S(e.env),s=e.deps?.startServer??B,a=e.deps?.openUrl??(m=>g(m).then(()=>{})),t=y(e.rows),d;try{d=await s({packs:t,allowedOrigins:[new URL(o).origin]});let m=d,D=async p=>{let v=[...t.keys()][p];await a(T(m.urlFor(v),o))};if(e.deps?.hold){await e.deps.hold();return}await new Promise(p=>{let v=w(l.default.createElement(P,{rows:e.rows,onOpen:D,onDone:()=>{v.unmount(),p()}}),{stdout:process.stderr,exitOnCtrlC:!1})})}finally{await d?.close()}}function I(e){return e==="passed"?n.green:e==="failed"||e==="broken"||e==="cancelled"?n.red:n.dim}var b=40,R=9,k=20;function f(e,o){return e.length>o?e.slice(0,o-1)+"\u2026":e.padEnd(o)}function O({row:e,selected:o}){let s=e.testId??e.commitId??"";return(0,r.jsxs)(i,{children:[(0,r.jsx)(i,{width:2,flexShrink:0,children:(0,r.jsx)(c,{color:n.orange,children:o?"\u25B8":" "})}),(0,r.jsx)(i,{width:2,flexShrink:0,children:(0,r.jsx)(c,{color:e.kind==="execution"?n.orange:n.muted,children:e.kind==="execution"?"\u25CF":"\u25CB"})}),(0,r.jsx)(i,{width:b,flexShrink:0,children:(0,r.jsx)(c,{color:o?n.orange:void 0,bold:o,wrap:"truncate-end",children:f(e.label,b)})}),(0,r.jsx)(i,{width:R,flexShrink:0,children:(0,r.jsx)(c,{color:I(e.status),bold:o,wrap:"truncate-end",children:f(e.status,R)})}),(0,r.jsx)(i,{width:k,flexShrink:0,children:(0,r.jsx)(c,{color:n.dim,wrap:"truncate-end",children:f(s,k)})})]})}function P(e){let[o,s]=(0,l.useState)(0);return x((a,t)=>{t.upArrow?s(d=>Math.max(0,d-1)):t.downArrow?s(d=>Math.min(e.rows.length-1,d+1)):t.return||a==="o"?e.onOpen(o):(a==="q"||t.escape)&&e.onDone()}),(0,r.jsx)(E,{title:"Evidence",borderColor:n.muted,children:(0,r.jsxs)(i,{flexDirection:"column",children:[e.rows.map((a,t)=>(0,r.jsx)(O,{row:a,selected:t===o},t)),(0,r.jsx)(i,{marginTop:1,children:(0,r.jsx)(c,{color:n.dim,children:"\u2191/\u2193 move \xB7 enter/o open \xB7 q quit"})})]})})}export{y as a,H as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as F}from"./chunk-2RUSXQ3O.js";import{a as k}from"./chunk-FWGUISUG.js";import{b as $}from"./chunk-
|
|
2
|
+
import{a as F}from"./chunk-2RUSXQ3O.js";import{a as k}from"./chunk-FWGUISUG.js";import{b as $}from"./chunk-CJE7PKRV.js";import{deflateSync as Y}from"zlib";function j(n,s){let e=Buffer.alloc(4);e.writeUInt32BE(s.length);let o=Buffer.concat([Buffer.from(n,"latin1"),s]),i=Buffer.alloc(4);return i.writeUInt32BE(F(o)),Buffer.concat([e,o,i])}var G={1:0,3:2,4:6};function N(n,s){let{width:e,height:o,channels:i}=s;if(n.byteLength!==e*o*i)throw new Error(`pngEncode: raw length ${n.byteLength} != ${e}x${o}x${i}`);let d=Buffer.alloc(13);d.writeUInt32BE(e,0),d.writeUInt32BE(o,4),d[8]=8,d[9]=G[i];let t=e*i,a=Buffer.alloc(o*(t+1));for(let f=0;f<o;f++)a[f*(t+1)]=0,n.copy(a,f*(t+1)+1,f*t,(f+1)*t);return Buffer.concat([Buffer.from([137,80,78,71,13,10,26,10]),j("IHDR",d),j("IDAT",Y(a)),j("IEND",Buffer.alloc(0))])}var U=64,X=16,J=12e6,V=6e6,K=5e3,W=3e4,H="",_=class extends Error{constructor(e,o){super(`${e}: ${o}`);this.code=e}};async function q(n,s,e){let o=n.objs.has(s)?n.objs:n.commonObjs.has(s)?n.commonObjs:null;if(o)try{return o.get(s)??null}catch{return null}if(e.remainingMs<=0)return null;let i=s.startsWith("g_")?n.commonObjs:n.objs,d,t=Date.now();try{return await Promise.race([new Promise(a=>{try{i.get(s,f=>a(f??null))}catch{a(null)}}),new Promise(a=>{d=setTimeout(()=>a(null),Math.min(K,e.remainingMs))})])}finally{clearTimeout(d),e.remainingMs-=Date.now()-t}}async function z(){let n=await import("pdfjs-dist/legacy/build/pdf.mjs");return n.default??n}async function oe(n,s){let e=await z();H=e.version;let o={remainingMs:s?.resolveBudgetMs??W},i,d=e.getDocument({data:new Uint8Array(n),isEvalSupported:!1,verbosity:0});try{i=await d.promise}catch(t){throw t.name==="PasswordException"?new _("PDF_ENCRYPTED","password-protected \u2014 decrypt and re-ingest"):new _("PDF_UNREADABLE",String(t.message??t))}try{let t=[],a=[],f=new Map,D=[],T=new Map,R=0,A=0;for(let u=1;u<=i.numPages;u++){let O=await i.getPage(u);t.push(`[page ${u}]`);let C=await O.getTextContent(),c="",E=null;for(let m of C.items){if(typeof m!="object"||m===null||!("str"in m))continue;let p=m,P=Math.round(p.transform[5]);E!==null&&P!==E&&c.trim()!==""&&(t.push(c.trimEnd()),c=""),c!==""&&!c.endsWith(" ")&&p.str!==""&&!p.str.startsWith(" ")&&P===E&&(c+=" "),c+=p.str,A+=p.str.trim().length,E=P,p.hasEOL&&c.trim()!==""&&(t.push(c.trimEnd()),c="",E=null)}c.trim()!==""&&t.push(c.trimEnd());let B=await O.getOperatorList(),M=0;for(let m=0;m<B.fnArray.length;m++){let p=B.fnArray[m]===e.OPS.paintImageXObject,P=B.fnArray[m]===e.OPS.paintInlineImageXObject;if(!p&&!P)continue;M+=1;let h=`p${u}-${M}`,l=(v,L,w,S)=>{a.push({ref:h,page:u,media_type:"image/png",...L?{blob:L}:{},...S?{appearance:S}:{},delivery:v,...w?{duplicate_of:w}:{}}),t.push(v==="duplicate"&&w?`[img#${h}: image on page ${u} \u2014 same as img#${w}; cite img#${w}]`:`[img#${h} omitted: ${v}]`)};if(P){l("unsupported-image-kind");continue}let r=await q(O,B.argsArray[m][0],o);if(!r?.data||!r.width||!r.height){l("undecodable");continue}let I;if(r.kind===e.ImageKind.RGB_24BPP)I=3;else if(r.kind===e.ImageKind.RGBA_32BPP)I=4;else{l("unsupported-image-kind");continue}let y;try{y=N(Buffer.from(r.data.buffer,r.data.byteOffset,r.data.byteLength),{width:r.width,height:r.height,channels:I})}catch{l("undecodable");continue}let g=$(y);f.set(g,y);let b=k(Buffer.from(r.data.buffer,r.data.byteOffset,r.data.byteLength),{width:r.width,height:r.height,channels:I});if(r.width<U||r.height<U){l("below-dimension-floor",g,void 0,b);continue}let x=T.get(g);if(x!==void 0){l("duplicate",g,x,b);continue}if(y.byteLength>V){l("image-too-large",g,void 0,b);continue}if(R+y.byteLength>J){l("vision-byte-budget-reached",g,void 0,b);continue}if(D.length>=X){l("image-cap-reached",g,void 0,b);continue}T.set(g,h),R+=y.byteLength,D.push(h),a.push({ref:h,page:u,media_type:"image/png",blob:g,appearance:b,delivery:"selected"}),t.push(`[img#${h}: image on page ${u}]`)}}if(A===0&&i.numPages>0)throw new _("PDF_NO_TEXT_LAYER","no extractable text \u2014 image-only or scanned pdfs are not supported yet");return{projection:t.join(`
|
|
3
3
|
`)+`
|
|
4
4
|
`,inventory:a,blobs:f,delivered:D,pages:i.numPages,converter:{name:"pdfjs-dist",version:e.version,policy:"v1"}}}finally{await d.destroy().catch(()=>{})}}export{U as a,X as b,J as c,V as d,H as e,_ as f,oe as g};
|