@testmuai/kane-cli 0.9.0 → 0.10.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatSurface-VPD5G67Q.js +2 -0
- package/dist/ChromeProfilePicker-CRKQEFYD.js +2 -0
- package/dist/CliFeedbackPrompt-M7BMWLKK.js +2 -0
- package/dist/CliUploadProgress-OP7DXMC2.js +2 -0
- package/dist/ConfigView-XI74BCCH.js +2 -0
- package/dist/EvidenceViewOffer-HAAK6DS5.js +2 -0
- package/dist/FolderPicker-W5S6RFCP.js +2 -0
- package/dist/InfoBox-OWUEHV2D.js +2 -0
- package/dist/LinksBox-PNSESNCU.js +2 -0
- package/dist/ProfilesView-PYDZZHKO.js +2 -0
- package/dist/ProjectPicker-BGFCUGT5.js +2 -0
- package/dist/SaveSessionPrompt-SUJE54GS.js +2 -0
- package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
- package/dist/SingleShotApp-4TDXZEUA.js +2 -0
- package/dist/SummaryBox-FALOODAQ.js +2 -0
- package/dist/TestMdRunView-4GPRWHEU.js +2 -0
- package/dist/TestrunEvidenceTable-OBVQJ6IO.js +2 -0
- package/dist/WhoamiView-6WXGRANY.js +2 -0
- package/dist/{agent-parse-2MLJOJTH.js → agent-parse-CAS45UKA.js} +1 -1
- package/dist/app-client-U2YYF65L.js +2 -0
- package/dist/app-download-RXVZB6MM.js +2 -0
- package/dist/assurance-job-C3TXZGLL.js +7 -0
- package/dist/auth-7Z54TMQQ.js +2 -0
- package/dist/{binary-LVHXED3O.js → binary-DJCDMGPX.js} +1 -1
- package/dist/bind-XVO4CQYV.js +2 -0
- package/dist/bootstrap-TY5RANJ7.js +2 -0
- package/dist/bridge-T6QMYKED.js +2 -0
- package/dist/build-5ZN47FAT.js +2 -0
- package/dist/catalog-RRQF4TCA.js +2 -0
- package/dist/{changelog-N5AZHXOS.js → changelog-GBEVIUFJ.js} +1 -1
- package/dist/chat-committer-ZCSRJEUB.js +2 -0
- package/dist/chat-controller-XINCDH6Z.js +2 -0
- package/dist/child-G2GCW73X.js +2 -0
- package/dist/chunk-22PIMG52.js +2 -0
- package/dist/chunk-252FWF2G.js +19 -0
- package/dist/{chunk-UWXDURAB.js → chunk-2IZRPMZN.js} +1 -1
- package/dist/{chunk-X2A6CC6B.js → chunk-2NFS4KE4.js} +1 -1
- package/dist/{chunk-ZXY4P76I.js → chunk-2OOFURWD.js} +1 -1
- package/dist/chunk-2OSFI33O.js +97 -0
- package/dist/{chunk-CSNJPD2J.js → chunk-2S3W2JT3.js} +3 -3
- package/dist/chunk-2SWSVJUP.js +12 -0
- package/dist/chunk-2TVPA3LL.js +2 -0
- package/dist/{chunk-FMUV6UCX.js → chunk-2XW33VOK.js} +1 -1
- package/dist/chunk-33DWJV67.js +235 -0
- package/dist/chunk-34R7BNZ2.js +2 -0
- package/dist/chunk-35ECWCCK.js +2 -0
- package/dist/chunk-3BSYOCSW.js +3 -0
- package/dist/chunk-3G2LSTK5.js +2 -0
- package/dist/chunk-3GXN6VF6.js +2 -0
- package/dist/chunk-3JLEDSG5.js +4 -0
- package/dist/chunk-3QICDXY5.js +5 -0
- package/dist/chunk-3UVSAAES.js +10 -0
- package/dist/chunk-42PALMW2.js +4 -0
- package/dist/chunk-432ZOE42.js +21 -0
- package/dist/chunk-44B6THYK.js +2 -0
- package/dist/chunk-47WQBG5I.js +6 -0
- package/dist/{chunk-DOOI2JBD.js → chunk-4D5PC6QE.js} +1 -1
- package/dist/chunk-4I7YN6YY.js +3 -0
- package/dist/chunk-4IEQNX7F.js +2 -0
- package/dist/{chunk-KXEE6VCA.js → chunk-4LPX2OLV.js} +1 -1
- package/dist/chunk-4LTHDJ3D.js +2 -0
- package/dist/chunk-4QTH7VYE.js +2 -0
- package/dist/chunk-54XA5MZH.js +2 -0
- package/dist/chunk-57MDWTON.js +2 -0
- package/dist/{chunk-CNUCP6DK.js → chunk-5BUIIFLC.js} +1 -1
- package/dist/{chunk-AKE2CTV6.js → chunk-5D7ENQTQ.js} +1 -1
- package/dist/chunk-63EKRZKI.js +2 -0
- package/dist/{chunk-EHN5HTUD.js → chunk-65VANXOF.js} +51 -51
- package/dist/chunk-672CQECV.js +47 -0
- package/dist/chunk-6LIC2R22.js +3 -0
- package/dist/chunk-6NFOH4AC.js +4 -0
- package/dist/chunk-6NWT2TEJ.js +2 -0
- package/dist/chunk-6PIIUAZF.js +3 -0
- package/dist/{chunk-4CYBXJIA.js → chunk-6U7ID777.js} +1 -1
- package/dist/chunk-6UVIY56J.js +2 -0
- package/dist/chunk-72KYMWQ5.js +2 -0
- package/dist/chunk-72RC7JSA.js +21 -0
- package/dist/chunk-74W4AOT2.js +2 -0
- package/dist/chunk-77ZZQJLX.js +2 -0
- package/dist/chunk-7DFBOVUB.js +2 -0
- package/dist/chunk-7EXDYXXD.js +2 -0
- package/dist/chunk-7HO4NX5W.js +1 -0
- package/dist/chunk-7KX2BHKG.js +2 -0
- package/dist/chunk-7LKCWO2R.js +11 -0
- package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
- package/dist/{chunk-EBLXHOE3.js → chunk-7RPKHKA3.js} +1 -1
- package/dist/chunk-7RWP4Y3H.js +2 -0
- package/dist/chunk-7V4BQSSV.js +2 -0
- package/dist/chunk-7XBNMOH4.js +6 -0
- package/dist/chunk-A6TJOZ24.js +2 -0
- package/dist/chunk-AA674WLL.js +2 -0
- package/dist/chunk-AIXJYMSP.js +9 -0
- package/dist/chunk-AJQZ3ST5.js +8 -0
- package/dist/chunk-AQ2OG2EF.js +2 -0
- package/dist/chunk-AUJSC7PU.js +4 -0
- package/dist/chunk-AVI5H4UM.js +13 -0
- package/dist/chunk-AZLNLHUA.js +4 -0
- package/dist/chunk-B2HXPGIZ.js +26 -0
- package/dist/{chunk-HGFWIBVF.js → chunk-B7ZX5HEN.js} +5 -5
- package/dist/{chunk-WRSIKZ2V.js → chunk-BJJUKB5K.js} +1 -1
- package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
- package/dist/{chunk-4BZOG6PE.js → chunk-BVO4C5F2.js} +1 -1
- package/dist/chunk-BWXLZS5O.js +2 -0
- package/dist/chunk-BY65QAAN.js +4 -0
- package/dist/chunk-BZVNI44O.js +6 -0
- package/dist/chunk-C5Z7MQE6.js +2 -0
- package/dist/chunk-C6HI6Y3S.js +2 -0
- package/dist/chunk-CB4ARIHR.js +2 -0
- package/dist/{chunk-C25M2J5Q.js → chunk-CPBBYNL7.js} +1 -1
- package/dist/{chunk-75MMTNPB.js → chunk-D4FFXCX6.js} +2 -2
- package/dist/chunk-D756UWY2.js +6 -0
- package/dist/chunk-DBMW3VUN.js +4 -0
- package/dist/chunk-DD5TULWQ.js +34 -0
- package/dist/{chunk-Q5RDCSYM.js → chunk-DDJNYQBH.js} +1 -1
- package/dist/{chunk-6HU5M2DS.js → chunk-DHQ4SQWA.js} +1 -1
- package/dist/chunk-DNGOT65K.js +3 -0
- package/dist/chunk-DPGOAFKF.js +2 -0
- package/dist/chunk-DREQ3RAA.js +2 -0
- package/dist/chunk-DTUPEKEO.js +2 -0
- package/dist/chunk-E6KSRQXL.js +8 -0
- package/dist/chunk-EF47KRUK.js +2 -0
- package/dist/chunk-ENL4XTQ2.js +2 -0
- package/dist/chunk-EXFDIVNI.js +9 -0
- package/dist/chunk-EZN7CF45.js +4 -0
- package/dist/chunk-F3U6T4YD.js +22 -0
- package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
- package/dist/chunk-FFL55I2M.js +2 -0
- package/dist/chunk-FIP5L6LV.js +9 -0
- package/dist/chunk-FOJHSG5M.js +6 -0
- package/dist/chunk-FSYOTRMC.js +2 -0
- package/dist/chunk-GFLB2SHW.js +2 -0
- package/dist/chunk-GMTHZUZ3.js +2 -0
- package/dist/chunk-GRURFGBP.js +2 -0
- package/dist/chunk-GZFLJORM.js +2 -0
- package/dist/{chunk-EOA6YPES.js → chunk-H3HHSTEK.js} +4 -4
- package/dist/chunk-HAW5WEKT.js +13 -0
- package/dist/chunk-HFJSP4KD.js +2 -0
- package/dist/chunk-HHW6MRU3.js +6 -0
- package/dist/chunk-HIUAUZNL.js +2 -0
- package/dist/chunk-HJLMH7ZM.js +2 -0
- package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
- package/dist/{chunk-K3IQEL7R.js → chunk-I2KOGINW.js} +1 -1
- package/dist/chunk-I2MC6VVX.js +2 -0
- package/dist/chunk-I5NSJBOZ.js +2 -0
- package/dist/chunk-I6OQISK4.js +2 -0
- package/dist/chunk-IBBD36FQ.js +2 -0
- package/dist/{chunk-GCISXCDU.js → chunk-IINZZ4BZ.js} +1 -1
- package/dist/{chunk-M3UAZTDK.js → chunk-IMDMRJQ6.js} +2 -2
- package/dist/chunk-IXW7FOGX.js +2 -0
- package/dist/chunk-IZ65ZPWY.js +3 -0
- package/dist/chunk-JD52IXON.js +9 -0
- package/dist/chunk-JGRXMTME.js +15 -0
- package/dist/{chunk-NBXYL2JT.js → chunk-JIRNI5TB.js} +7 -7
- package/dist/chunk-JNSWKGTB.js +2 -0
- package/dist/chunk-JPYW6U4D.js +2 -0
- package/dist/chunk-JQSLUGD4.js +3 -0
- package/dist/{chunk-GFBAK7WQ.js → chunk-K45BKGB5.js} +7 -7
- package/dist/chunk-KF4DKXSS.js +2 -0
- package/dist/chunk-KGNE5CIM.js +2 -0
- package/dist/chunk-KM3YCIDV.js +3 -0
- package/dist/chunk-KU3YHPWZ.js +2 -0
- package/dist/chunk-L4UVUFL6.js +3 -0
- package/dist/chunk-LCSJ7GOG.js +2 -0
- package/dist/chunk-LKQFG4RW.js +5 -0
- package/dist/chunk-LNNWCBPQ.js +2 -0
- package/dist/chunk-LRS5MGBY.js +3 -0
- package/dist/chunk-LRXBJTD4.js +4 -0
- package/dist/chunk-LSDJOVWW.js +6 -0
- package/dist/chunk-LWJRSUE2.js +2 -0
- package/dist/chunk-LX2I4JEH.js +2 -0
- package/dist/{chunk-RWSOZPJQ.js → chunk-M6MBMRFR.js} +1 -1
- package/dist/chunk-MGNRNLBE.js +2 -0
- package/dist/chunk-MII3JOO3.js +4 -0
- package/dist/chunk-MNBGG4H3.js +16 -0
- package/dist/chunk-MYVKUJGS.js +2 -0
- package/dist/chunk-MYZHOBS4.js +2 -0
- package/dist/chunk-MZOIHUVX.js +27 -0
- package/dist/{chunk-7GAHJZLH.js → chunk-N3TCNZSX.js} +1 -1
- package/dist/chunk-NC7D7GOM.js +21 -0
- package/dist/{chunk-HAYV4D2I.js → chunk-NDEI7R4K.js} +1 -1
- package/dist/{chunk-BL3SJDCG.js → chunk-NFRA64NU.js} +1 -1
- package/dist/chunk-NLZZLANH.js +4 -0
- package/dist/{chunk-DWMESHFI.js → chunk-NQTYWHPB.js} +1 -1
- package/dist/chunk-NWBLYMH7.js +3 -0
- package/dist/chunk-NWD54VV5.js +2 -0
- package/dist/chunk-NXRF7FFS.js +2 -0
- package/dist/chunk-O3HHTKZ5.js +6 -0
- package/dist/{chunk-F7NSSQYZ.js → chunk-OAKYUBD3.js} +1 -1
- package/dist/{chunk-7WXMV3O3.js → chunk-OEWYXCTA.js} +1 -1
- package/dist/{chunk-4FHK4LKQ.js → chunk-OF7WPCTQ.js} +1 -1
- package/dist/chunk-OFSDB7B4.js +3 -0
- package/dist/chunk-OJ33Q6DU.js +2 -0
- package/dist/chunk-OQ5G773E.js +2 -0
- package/dist/chunk-OVNRRI4E.js +2 -0
- package/dist/{chunk-C6S2RPZA.js → chunk-OZNBTSW5.js} +1 -1
- package/dist/chunk-P2ZQDQDB.js +2 -0
- package/dist/chunk-P7MSVLAH.js +6 -0
- package/dist/chunk-PUVMC4PX.js +26 -0
- package/dist/{chunk-SEEEGDVK.js → chunk-PZA3BSOE.js} +1 -1
- package/dist/chunk-Q3C6NDGI.js +2 -0
- package/dist/chunk-QCKA665H.js +2 -0
- package/dist/chunk-QDFY5GGO.js +5 -0
- package/dist/{chunk-YBAVDT3G.js → chunk-QHRUBG7J.js} +1 -1
- package/dist/chunk-QI5RZ7LL.js +2 -0
- package/dist/chunk-QNLVC5ZB.js +2 -0
- package/dist/{chunk-WDMUPK6I.js → chunk-QQ4TKLWP.js} +1 -1
- package/dist/chunk-QS5ZJFGF.js +4 -0
- package/dist/chunk-QTZBVDPR.js +12 -0
- package/dist/chunk-QXQ7KVEN.js +2 -0
- package/dist/chunk-R4JUKTDO.js +2 -0
- package/dist/chunk-R7KXAISS.js +12 -0
- package/dist/chunk-RDP7GWSY.js +2 -0
- package/dist/chunk-REKHAN53.js +5 -0
- package/dist/{chunk-KWEOLPBJ.js → chunk-RFEON5GN.js} +1 -1
- package/dist/{chunk-SOCHN2PY.js → chunk-RFIIM33J.js} +1 -1
- package/dist/chunk-RG372DON.js +6 -0
- package/dist/chunk-RPRXRKKR.js +2 -0
- package/dist/chunk-RTVWQK7I.js +2 -0
- package/dist/{chunk-2PKME4VT.js → chunk-RW3Z2HMB.js} +4 -4
- package/dist/chunk-RX47NRSM.js +2 -0
- package/dist/chunk-RX6776AI.js +5 -0
- package/dist/chunk-S53AQU7R.js +6 -0
- package/dist/{chunk-XT7XA4DN.js → chunk-SA6IKFFD.js} +1 -1
- package/dist/{chunk-Q5CINJYL.js → chunk-SLKYD44Y.js} +1 -1
- package/dist/chunk-SMTBOSEJ.js +2 -0
- package/dist/chunk-SMXABALN.js +2 -0
- package/dist/chunk-SONMD3W5.js +5 -0
- package/dist/chunk-SWMTXMKB.js +2 -0
- package/dist/{chunk-TM7VRLWS.js → chunk-SXRHKXSE.js} +1 -1
- package/dist/chunk-T3HEJASG.js +5 -0
- package/dist/chunk-T4AVLJCW.js +6 -0
- package/dist/{chunk-6VY62QC2.js → chunk-T6K2MEWP.js} +1 -1
- package/dist/{chunk-PCKIANML.js → chunk-T7H4LBFK.js} +1 -1
- package/dist/chunk-TNORODUF.js +2 -0
- package/dist/chunk-TW63WWEN.js +2 -0
- package/dist/chunk-UALJTPSA.js +18 -0
- package/dist/chunk-UAWWLLTI.js +2 -0
- package/dist/chunk-UEE3RZN4.js +14 -0
- package/dist/chunk-UTM7D4PI.js +2 -0
- package/dist/chunk-UUJIGOEO.js +2 -0
- package/dist/chunk-UYDHOHSZ.js +2 -0
- package/dist/chunk-V5JGXOV7.js +2 -0
- package/dist/chunk-V7S6S5W3.js +2 -0
- package/dist/{chunk-OHOJSADN.js → chunk-VG44B5JD.js} +1 -1
- package/dist/chunk-VJGWVBZR.js +1 -0
- package/dist/chunk-VLDCHFXF.js +2 -0
- package/dist/chunk-VO66KP2W.js +2 -0
- package/dist/{chunk-J3BGYSMD.js → chunk-VQLH63X7.js} +8 -8
- package/dist/chunk-VRIZDOO5.js +2 -0
- package/dist/chunk-VYHT2IET.js +1397 -0
- package/dist/chunk-VZJ6LUXX.js +2 -0
- package/dist/chunk-W3OVSDBN.js +29 -0
- package/dist/chunk-W7FLXW6Q.js +5 -0
- package/dist/{chunk-UA2QDAWT.js → chunk-WEM3MOAL.js} +1 -1
- package/dist/chunk-WI7K6VKQ.js +2 -0
- package/dist/chunk-WMGKUERB.js +6 -0
- package/dist/{chunk-DFS4RMVP.js → chunk-WN5VKKJ3.js} +1 -1
- package/dist/chunk-WOSANGV6.js +5 -0
- package/dist/chunk-WYSZ6TPW.js +15 -0
- package/dist/chunk-XB6BJPDL.js +2 -0
- package/dist/{chunk-YWYORBY3.js → chunk-XBEYWXPV.js} +1 -1
- package/dist/chunk-XIPKSXRQ.js +16 -0
- package/dist/chunk-XJ7HCXKW.js +2 -0
- package/dist/chunk-XMPTFXPW.js +5 -0
- package/dist/chunk-XZYA7DNH.js +2 -0
- package/dist/chunk-Y4T4SLDO.js +2 -0
- package/dist/{chunk-OIUV3ISA.js → chunk-Y6Y6RAY4.js} +1 -1
- package/dist/chunk-YDPTSDIJ.js +2 -0
- package/dist/chunk-YDSGXB25.js +2 -0
- package/dist/chunk-YIKF4ERQ.js +375 -0
- package/dist/chunk-Z55KBMYV.js +2 -0
- package/dist/chunk-ZCRZFAOT.js +2 -0
- package/dist/chunk-ZFM77AQU.js +2 -0
- package/dist/{chunk-Q6F23V7L.js → chunk-ZFMRQ57Y.js} +1 -1
- package/dist/chunk-ZHWU6L2G.js +5 -0
- package/dist/chunk-ZTHYAHDN.js +17 -0
- package/dist/chunk-ZZP5SHUV.js +3 -0
- package/dist/committer-JGY66PFM.js +2 -0
- package/dist/config-5ZOALGKE.js +2 -0
- package/dist/controller-client-PB3AZAGG.js +2 -0
- package/dist/cover-cmd-UA2SVIZZ.js +2 -0
- package/dist/{credentials-QD32Y7K7.js → credentials-MRG452Y6.js} +1 -1
- package/dist/{deps-bundle-OI7JJ22L.js → deps-bundle-FWINW4XM.js} +1 -1
- package/dist/{deps-resolve-ZOALDS6H.js → deps-resolve-IET4KIBO.js} +1 -1
- package/dist/descriptor-7T32VRMB.js +2 -0
- package/dist/design-chat-MM5PJD2N.js +2 -0
- package/dist/design-committer-TRYP3LOZ.js +2 -0
- package/dist/design-headless-FZONCKHW.js +2 -0
- package/dist/design-remote-SPVRIY2H.js +3 -0
- package/dist/device-env-LXJ65AVF.js +2 -0
- package/dist/dispatch-DVQ3H7EJ.js +2 -0
- package/dist/doctor-VAX2BWQF.js +2 -0
- package/dist/docx-convert-6IZO5P5K.js +2 -0
- package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
- package/dist/evidence-LVVK7ROT.js +2 -0
- package/dist/evidence-presentation-YYTIDCBS.js +2 -0
- package/dist/evolve-cmd-AGRKG7T3.js +2 -0
- package/dist/evolve-remote-BGHULJTL.js +2 -0
- package/dist/{exit-manager-ZLDO54S4.js → exit-manager-EDHCETUN.js} +1 -1
- package/dist/explain-DGJ5T6V5.js +2 -0
- package/dist/explain-cmd-VYAANFFZ.js +4 -0
- package/dist/explain-cmd-WOBGS6KX.js +12 -0
- package/dist/explore-LOKNOVNP.js +2 -0
- package/dist/explore-context-tty-JTZVZFOE.js +2 -0
- package/dist/explore-entry-5OGNLFAU.js +6 -0
- package/dist/explore-live-2XZHUYFS.js +5 -0
- package/dist/explore-run-tty-LGTIK2NA.js +5 -0
- package/dist/extract-bind-NM2BBK4I.js +14 -0
- package/dist/extract-chat-HLQMJJIC.js +2 -0
- package/dist/extract-cmd-T2TSAC3N.js +6 -0
- package/dist/extract-headless-OQTQ3FJK.js +2 -0
- package/dist/feeder-NY45UFJK.js +2 -0
- package/dist/folder-flags-WXUR6OPJ.js +2 -0
- package/dist/gaps-cmd-PTSKPTF7.js +3 -0
- package/dist/gate-P57VP4E5.js +2 -0
- package/dist/gate-WISOUTHQ.js +2 -0
- package/dist/{generate-headless-6WMJYNI6.js → generate-headless-JYZP6VXZ.js} +3 -3
- package/dist/headless-io-FFM5T6KL.js +2 -0
- package/dist/hold-passthrough-IOWPVB4W.js +2 -0
- package/dist/identity-HL5CJJXR.js +2 -0
- package/dist/index.js +178 -160
- package/dist/ingest-PDGS5ZTL.js +2 -0
- package/dist/ingest-cmd-LHCBMO4Z.js +8 -0
- package/dist/ingest-remote-D5TO5JQP.js +2 -0
- package/dist/ink-screen-RZ7QDIUI.js +2 -0
- package/dist/install-Z6K2D2VY.js +2 -0
- package/dist/interactive-bind-5EJQUGKI.js +26 -0
- package/dist/interactive-remote-D77ULJGL.js +65 -0
- package/dist/interrupt-guard-QETBPINI.js +2 -0
- package/dist/lane-AQYRIW24.js +2 -0
- package/dist/lattice-auth-74XGF77Y.js +2 -0
- package/dist/lifecycle-cmd-7SM6UCMH.js +2 -0
- package/dist/list-cmd-Z6FZXMFU.js +3 -0
- package/dist/list-commands-CZYZ7GIG.js +2 -0
- package/dist/list-remote-WOPOC6KK.js +15 -0
- package/dist/locks-cmd-JJ2QNTNY.js +2 -0
- package/dist/logical-ids-RXAQJZ3T.js +2 -0
- package/dist/login-flow-2FZEOVHM.js +2 -0
- package/dist/maintenance-cmd-VRTGZVRE.js +2 -0
- package/dist/mobile-prompts-KNAHU64X.js +2 -0
- package/dist/{next-KZXH4UA4.js → next-O6SUSX3R.js} +1 -1
- package/dist/{objective-variable-gate-CG2KK5UX.js → objective-variable-gate-3Z7DNVVC.js} +1 -1
- package/dist/onboarding-LGT6PMDZ.js +5 -0
- package/dist/open-provider-OZAG6WZS.js +2 -0
- package/dist/{paths-JCYX6UWL.js → paths-UMIX3RJF.js} +1 -1
- package/dist/pdf-convert-447ACUB3.js +2 -0
- package/dist/persist-recorded-session-BX7II5P7.js +3 -0
- package/dist/phase-seed-LCJ4WSYV.js +2 -0
- package/dist/pipeline-IXVTVRS5.js +2 -0
- package/dist/prepare-target-ULMKVKMC.js +2 -0
- package/dist/pull-cmd-6AL2WYHB.js +2 -0
- package/dist/pull-route-TTVARJMV.js +2 -0
- package/dist/readmodel-INMP6MNW.js +2 -0
- package/dist/real-device-run-2LFS5WE2.js +2 -0
- package/dist/reconcile-cmd-R6H37SQR.js +5 -0
- package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
- package/dist/reconcile-remote-GWDV5CUT.js +13 -0
- package/dist/recording-banner-ACC67Q2U.js +2 -0
- package/dist/registry-6IJYQXQC.js +2 -0
- package/dist/remote-entry-YL7O2NJQ.js +2 -0
- package/dist/remote-mode-7G6PLJCW.js +4 -0
- package/dist/remote-words-45USLRVN.js +2 -0
- package/dist/require-project-folder-A3UDRELU.js +2 -0
- package/dist/resolve-run-intent-ZGPSUBXV.js +2 -0
- package/dist/resolver-IPM6R7U4.js +2 -0
- package/dist/revert-FHOBLZWF.js +2 -0
- package/dist/review-cmd-NNT5C5RZ.js +5 -0
- package/dist/run-5RQUCNYP.js +2 -0
- package/dist/run-PC5YO4AS.js +2 -0
- package/dist/run-channel-63SVP5OI.js +2 -0
- package/dist/run-remote-3AYYVPKX.js +2 -0
- package/dist/run-startup-gate-NKRMKYBB.js +2 -0
- package/dist/run-test-md-HE6DUWQR.js +17 -0
- package/dist/scrollback-GGNBDFQV.js +2 -0
- package/dist/session-target-DD53UXO7.js +2 -0
- package/dist/session-worker.js +12 -0
- package/dist/sessions-CFV7FOIT.js +2 -0
- package/dist/sessions-cmd-GYMETJHG.js +26 -0
- package/dist/sessions-remote-GI7GOBMH.js +3 -0
- package/dist/shell-arg-FN3MT5U7.js +2 -0
- package/dist/{skill-installer-32YYMM4N.js → skill-installer-3QAVQGDH.js} +1 -1
- package/dist/spawner-C7NLLM4F.js +2 -0
- package/dist/store-X6XPFSKF.js +2 -0
- package/dist/store-choice-RT73HAI7.js +2 -0
- package/dist/store-guard-SNWKLHQV.js +2 -0
- package/dist/store-id-YZ5WKJ25.js +2 -0
- package/dist/store-site-KA2DNBGY.js +2 -0
- package/dist/stream-warnings-GEQKKJU7.js +2 -0
- package/dist/structured-answers-EQ2AP3F7.js +2 -0
- package/dist/sync-cmd-NBPPDG3B.js +2 -0
- package/dist/sync-setup-5NUCH6N3.js +2 -0
- package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
- package/dist/tcg-generate-Z23CUISY.js +2 -0
- package/dist/test-definition-VRI4YIYL.js +2 -0
- package/dist/testmd-actions-GH5BW5V5.js +2 -0
- package/dist/testmd-sync-ACKCIOL3.js +2 -0
- package/dist/tms-client-NXAB6VJD.js +2 -0
- package/dist/token-refresh-4UCYAG6A.js +2 -0
- package/dist/trust-gate-AT2XBWN4.js +2 -0
- package/dist/turn-preflight-LHYLRL7G.js +2 -0
- package/dist/ui-SNV3FD2G.js +4 -0
- package/dist/use-case-ref-NE4X4MZN.js +2 -0
- package/dist/validate-basic-RE2WLIGQ.js +2 -0
- package/dist/{variable-receipt-YWNS24TH.js → variable-receipt-BXSZO36E.js} +1 -1
- package/dist/verdicts-XK3GAUX3.js +2 -0
- package/dist/version-check-4FJVZP3K.js +2 -0
- package/dist/{view-cmd-3WHG6MVB.js → view-cmd-N47BQZPD.js} +4 -3
- package/dist/walk-session-DA7QWXSW.js +2 -0
- package/dist/with-telemetry-7V4LY2BG.js +2 -0
- package/package.json +11 -11
- package/dist/ChatSurface-FJPK3XEJ.js +0 -8
- package/dist/ChromeProfilePicker-7DUDJTE2.js +0 -2
- package/dist/CliFeedbackPrompt-ZZPYC6OS.js +0 -2
- package/dist/CliUploadProgress-WQYKIBAR.js +0 -2
- package/dist/ConfigView-KXNOODDW.js +0 -2
- package/dist/EvidenceViewOffer-BTBVPBZX.js +0 -2
- package/dist/FolderPicker-H4YEX5LV.js +0 -2
- package/dist/InfoBox-DTM7X24Z.js +0 -2
- package/dist/LinksBox-KFG3FVOT.js +0 -2
- package/dist/ProfilesView-KBZHT4KL.js +0 -2
- package/dist/ProjectPicker-OARWULNN.js +0 -2
- package/dist/SaveSessionPrompt-37SMU5MC.js +0 -2
- package/dist/ScrollbackTap-QHJOFYMC.js +0 -2
- package/dist/SingleShotApp-UYCAW65Y.js +0 -2
- package/dist/SummaryBox-6RB5DSAH.js +0 -2
- package/dist/TestMdRunView-ZMOII3PL.js +0 -2
- package/dist/TestrunEvidenceTable-3UP2EYIV.js +0 -2
- package/dist/WhoamiView-MC62GERR.js +0 -2
- package/dist/app-client-PQFJAB63.js +0 -2
- package/dist/app-download-P6YXWSVQ.js +0 -2
- package/dist/auth-LXW4OFKF.js +0 -2
- package/dist/bind-ZYESQSCJ.js +0 -15
- package/dist/bootstrap-DI4UGMH3.js +0 -2
- package/dist/bridge-7J3JE3JS.js +0 -2
- package/dist/build-JIKYOZUH.js +0 -2
- package/dist/catalog-LLME3744.js +0 -2
- package/dist/chat-committer-6D7AQI6Z.js +0 -2
- package/dist/chat-controller-UJQ6Z4RE.js +0 -2
- package/dist/chunk-243ZJHT6.js +0 -4
- package/dist/chunk-2KVECC36.js +0 -2
- package/dist/chunk-2YEHV2CX.js +0 -2
- package/dist/chunk-3MCPTVJX.js +0 -2
- package/dist/chunk-3UI5VTQS.js +0 -4
- package/dist/chunk-3VAU3PNU.js +0 -2
- package/dist/chunk-3YIZG7WZ.js +0 -3
- package/dist/chunk-4Y2WH77W.js +0 -2
- package/dist/chunk-5EOX4MEY.js +0 -2
- package/dist/chunk-5HMN74RZ.js +0 -9
- package/dist/chunk-5LJRZI7S.js +0 -6
- package/dist/chunk-5RCS2LIQ.js +0 -26
- package/dist/chunk-5TQFOPJV.js +0 -2
- package/dist/chunk-5ZFOKYFB.js +0 -5
- package/dist/chunk-63DYVWNX.js +0 -2
- package/dist/chunk-6MD7SR7D.js +0 -9
- package/dist/chunk-7N6OCHPC.js +0 -7
- package/dist/chunk-A2SQD2AY.js +0 -4
- package/dist/chunk-AACQE24F.js +0 -2
- package/dist/chunk-AHFIRHSP.js +0 -18
- package/dist/chunk-AJT34ESA.js +0 -38
- package/dist/chunk-AUMJ4RVA.js +0 -21
- package/dist/chunk-AXTPNZPX.js +0 -2
- package/dist/chunk-BB2W35TW.js +0 -2
- package/dist/chunk-BKM2LWU2.js +0 -3
- package/dist/chunk-BUPRL2TE.js +0 -2
- package/dist/chunk-C44QQJR4.js +0 -239
- package/dist/chunk-CW3RHKLA.js +0 -5
- package/dist/chunk-D6E6KRVX.js +0 -2
- package/dist/chunk-DTRKTBCE.js +0 -17
- package/dist/chunk-DTRSYWZE.js +0 -2
- package/dist/chunk-EVFFDODK.js +0 -5
- package/dist/chunk-F2OBORCG.js +0 -2
- package/dist/chunk-FQNQVC5O.js +0 -5
- package/dist/chunk-FY7TCYPK.js +0 -6
- package/dist/chunk-GTVQYT3D.js +0 -35
- package/dist/chunk-HG5LLZBU.js +0 -2
- package/dist/chunk-I7TIGB7K.js +0 -2
- package/dist/chunk-IICT4VOU.js +0 -2
- package/dist/chunk-ILDHE4P4.js +0 -6
- package/dist/chunk-IPXKUYUK.js +0 -2
- package/dist/chunk-JQY5HRZ4.js +0 -15
- package/dist/chunk-JX6BFEDO.js +0 -4
- package/dist/chunk-K2UJYY2U.js +0 -2
- package/dist/chunk-KBM3XHAM.js +0 -2
- package/dist/chunk-KDNNMU7Q.js +0 -4
- package/dist/chunk-KJQNAOOE.js +0 -6
- package/dist/chunk-LH4IPANP.js +0 -2
- package/dist/chunk-LLG7NEGX.js +0 -6
- package/dist/chunk-LSDWPG6C.js +0 -2
- package/dist/chunk-MSGW4JDG.js +0 -2
- package/dist/chunk-NJ4BXZBX.js +0 -2
- package/dist/chunk-NLCCBXXV.js +0 -2
- package/dist/chunk-NMSZ7G6P.js +0 -2
- package/dist/chunk-OC6H6BYI.js +0 -6
- package/dist/chunk-OJAXOOZ5.js +0 -8
- package/dist/chunk-OMNLAGQC.js +0 -29
- package/dist/chunk-OOCCUUR2.js +0 -2
- package/dist/chunk-OXC6O5O7.js +0 -2
- package/dist/chunk-OZQDD2EX.js +0 -94
- package/dist/chunk-PEDINHVU.js +0 -2
- package/dist/chunk-PNUAP3RY.js +0 -8
- package/dist/chunk-Q2F5QB2W.js +0 -2
- package/dist/chunk-Q4YYAN6E.js +0 -2
- package/dist/chunk-Q6AHSGOE.js +0 -5
- package/dist/chunk-QAB3Y5FQ.js +0 -4
- package/dist/chunk-RDHWNSDP.js +0 -7
- package/dist/chunk-RKXHVP2Z.js +0 -2
- package/dist/chunk-RRY5IXOB.js +0 -2
- package/dist/chunk-RSSOJ3L2.js +0 -21
- package/dist/chunk-RTSBKCZY.js +0 -16
- package/dist/chunk-SID4X77D.js +0 -370
- package/dist/chunk-SRTKRHYI.js +0 -12
- package/dist/chunk-T2ONUKTL.js +0 -5
- package/dist/chunk-U6OTFMIT.js +0 -4
- package/dist/chunk-UD7KKHPW.js +0 -5
- package/dist/chunk-USOYXCZ4.js +0 -2
- package/dist/chunk-USY7VAO6.js +0 -2
- package/dist/chunk-V4B5QA3U.js +0 -4
- package/dist/chunk-VBS33P2C.js +0 -2
- package/dist/chunk-VHW7BMZQ.js +0 -2
- package/dist/chunk-VIO7CCFW.js +0 -5
- package/dist/chunk-VORWZLS3.js +0 -9
- package/dist/chunk-VVOKM2VO.js +0 -2
- package/dist/chunk-W5TTF7GB.js +0 -6
- package/dist/chunk-WESMQEPO.js +0 -2
- package/dist/chunk-WMI4P76K.js +0 -27
- package/dist/chunk-WNOC6MQC.js +0 -2
- package/dist/chunk-WVHMPIDQ.js +0 -2
- package/dist/chunk-XBX643ZD.js +0 -2
- package/dist/chunk-XKHWWKJZ.js +0 -3
- package/dist/chunk-XLSOQLVT.js +0 -2
- package/dist/chunk-Y3ZYN6AK.js +0 -4
- package/dist/chunk-YCCUBQY4.js +0 -2
- package/dist/chunk-YKTYVJBN.js +0 -3
- package/dist/chunk-YLQHY4A7.js +0 -2
- package/dist/chunk-Z7IGTVJW.js +0 -2
- package/dist/chunk-ZC2CKWLB.js +0 -2
- package/dist/chunk-ZER3FZSZ.js +0 -22
- package/dist/chunk-ZJYT72BA.js +0 -9
- package/dist/chunk-ZKSN2SJ7.js +0 -2
- package/dist/chunk-ZLWURCJ7.js +0 -2
- package/dist/committer-2QPBANRD.js +0 -2
- package/dist/config-YGTHSGQN.js +0 -2
- package/dist/controller-client-ZF5IXRUV.js +0 -2
- package/dist/cover-cmd-6RO366CC.js +0 -3
- package/dist/descriptor-3JJUOHBM.js +0 -2
- package/dist/design-committer-D44GSUXY.js +0 -2
- package/dist/device-env-DXDJJMTL.js +0 -2
- package/dist/dispatch-7EWWQRQ5.js +0 -2
- package/dist/doctor-TPYPEEUL.js +0 -2
- package/dist/docx-convert-SQRTF7XS.js +0 -2
- package/dist/evidence-NPFTBGDF.js +0 -2
- package/dist/evidence-presentation-XF23B7F2.js +0 -2
- package/dist/evolve-cmd-VGVXV6XW.js +0 -2
- package/dist/explain-NEFBUX5G.js +0 -2
- package/dist/explain-cmd-GOP5TE63.js +0 -9
- package/dist/explain-cmd-M7IX2YNB.js +0 -3
- package/dist/extract-bind-CKIRLXAJ.js +0 -14
- package/dist/extract-cmd-3EWLSPGS.js +0 -5
- package/dist/feeder-66TUPB2R.js +0 -2
- package/dist/gaps-cmd-WVC5GXQC.js +0 -3
- package/dist/gate-OYRDJMF6.js +0 -2
- package/dist/headless-io-75HUMWZB.js +0 -2
- package/dist/identity-ADZ4PAJF.js +0 -2
- package/dist/ingest-OSNNM3DH.js +0 -2
- package/dist/ingest-cmd-AECK5T4H.js +0 -2
- package/dist/install-ZV3KJZV4.js +0 -2
- package/dist/interactive-bind-IYS6KDOH.js +0 -26
- package/dist/interrupt-guard-UREUWNRL.js +0 -2
- package/dist/lifecycle-cmd-XCSBELFQ.js +0 -2
- package/dist/list-cmd-S4DSN2ET.js +0 -3
- package/dist/list-commands-GLNGHPDU.js +0 -2
- package/dist/locks-cmd-67OHQZNV.js +0 -2
- package/dist/logical-ids-GLVM2SVR.js +0 -2
- package/dist/login-flow-ASUUU7SO.js +0 -2
- package/dist/maintenance-cmd-K5KXRIFL.js +0 -2
- package/dist/mobile-prompts-ZUZTA3RV.js +0 -2
- package/dist/open-provider-YIBB77FE.js +0 -2
- package/dist/pdf-convert-RLXSXFWN.js +0 -2
- package/dist/persist-recorded-session-EWV56TSZ.js +0 -3
- package/dist/phase-seed-MKHEWUN6.js +0 -2
- package/dist/pipeline-LAWACB2O.js +0 -2
- package/dist/prepare-target-WGPCZKLE.js +0 -2
- package/dist/readmodel-FVLRQWZ7.js +0 -2
- package/dist/real-device-run-MDLFKFVQ.js +0 -2
- package/dist/reconcile-cmd-XFM2ZXUJ.js +0 -2
- package/dist/reconcile-deps-V5VLDPYT.js +0 -4
- package/dist/reconcile-engine-VZBTMPUK.js +0 -2
- package/dist/recording-banner-CJHRPHHF.js +0 -2
- package/dist/records-LMCVKPE5.js +0 -2
- package/dist/registry-3JXQFZEG.js +0 -2
- package/dist/require-project-folder-SE5GVCYJ.js +0 -2
- package/dist/resolve-run-intent-DD4MB6UD.js +0 -2
- package/dist/resolver-TLO4SRWV.js +0 -2
- package/dist/revert-NOUECRW4.js +0 -2
- package/dist/review-cmd-7EOYQMPE.js +0 -5
- package/dist/run-EHUNJPW6.js +0 -2
- package/dist/run-OTMPUQSH.js +0 -2
- package/dist/run-channel-RGH4WIQX.js +0 -2
- package/dist/run-test-md-KBDEHGXJ.js +0 -17
- package/dist/scrollback-JLPJR25X.js +0 -2
- package/dist/session-items-2ATN7VXG.js +0 -2
- package/dist/session-target-UMNASXI7.js +0 -2
- package/dist/sessions-NH7WQWMX.js +0 -2
- package/dist/sessions-cmd-M3SECFKQ.js +0 -25
- package/dist/spawner-DPT2RLAO.js +0 -2
- package/dist/store-guard-U32JE6JJ.js +0 -2
- package/dist/store-id-EOSGEKVK.js +0 -2
- package/dist/structured-answers-ZI2B6JJE.js +0 -2
- package/dist/sync-cmd-3EP7LZGL.js +0 -2
- package/dist/sync-setup-SWTBVQEV.js +0 -2
- package/dist/tcg-generate-KXU7E2GF.js +0 -2
- package/dist/testmd-actions-PEWCPQ5R.js +0 -2
- package/dist/testmd-sync-ZWFQWZ2X.js +0 -2
- package/dist/tms-client-KU6HCA23.js +0 -2
- package/dist/token-refresh-QD3OCGJJ.js +0 -2
- package/dist/trust-gate-EX7R2P4Y.js +0 -2
- package/dist/turn-preflight-JGYT7LXP.js +0 -2
- package/dist/ui-JEJGTURD.js +0 -4
- package/dist/validate-basic-AAIXSAWH.js +0 -2
- package/dist/verdicts-LAB5BGCC.js +0 -2
- package/dist/version-check-EHOLX3YH.js +0 -2
- package/dist/walk-session-XP4KYFKO.js +0 -2
- package/dist/with-telemetry-FJMJQDCM.js +0 -2
- /package/dist/{chunk-BKHXPBWN.js → chunk-2RUSXQ3O.js} +0 -0
- /package/dist/{chunk-6J5T5FEY.js → chunk-3AGP2BVN.js} +0 -0
- /package/dist/{chunk-CH273NAE.js → chunk-73Y6T2UK.js} +0 -0
- /package/dist/{chunk-ZMNJBUAO.js → chunk-73ZFOJOK.js} +0 -0
- /package/dist/{chunk-NOL7MNZH.js → chunk-A7RJQJNT.js} +0 -0
- /package/dist/{chunk-N2P4MI32.js → chunk-FWGUISUG.js} +0 -0
- /package/dist/{chunk-UJZZDPDY.js → chunk-HD6NR44L.js} +0 -0
- /package/dist/{chunk-LDPLJFCV.js → chunk-I6S6DZ2E.js} +0 -0
- /package/dist/{chunk-427OQS2N.js → chunk-LD5B3QFW.js} +0 -0
- /package/dist/{chunk-2UIHS2FH.js → chunk-PGESS7BW.js} +0 -0
- /package/dist/{chunk-BZAGVBCX.js → chunk-ZCIWQHCO.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
function n(e){return e.type!=="error"&&e.type!=="gate_refused"||typeof e.code!="string"||typeof e.final!="boolean"?null:{code:e.code,final:e.final}}function r(e){return{code:"MODEL_UNAVAILABLE",detail:e.code,message:e.message,final:!1}}function o(e){return e==="SESSION_EXPIRED"||e==="WRONG_VERB"}export{n as a,r as b,o as c};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as Ee,b as te}from"./chunk-GFLB2SHW.js";import{a as ee}from"./chunk-2TVPA3LL.js";import{c as G}from"./chunk-22PIMG52.js";import{a as v,b as be,d as B,e as Te}from"./chunk-I2MC6VVX.js";import{a as z}from"./chunk-RPRXRKKR.js";import{a as M}from"./chunk-QXQ7KVEN.js";import{a as Se}from"./chunk-57MDWTON.js";import{b as we,c as ye,d as Re,e as Z,f as $e}from"./chunk-NWBLYMH7.js";import{na as ve,oa as P}from"./chunk-UEE3RZN4.js";import{g as fe}from"./chunk-NC7D7GOM.js";import{basename as wt,relative as ce}from"path";function Vt(e){return e.scope?.state==="finalized"?"saved":e.scope?.state==="discarded"?"discarded":e.ended==="complete"?"ready_to_save":e.ended==="failed"||e.status==="failed"?"failed":e.status==="paused"||e.status==="needs_attention"?"paused":"running"}var ne=["useCases","criteria","scenarios","tests","openQuestions","sources","styleNotes"],H=new Set(["sources","styleNotes"]);function xe(e){return ne.reduce((t,n)=>t+(H.has(n)?0:e[n]??0),0)}var nt=new Set(["NO_CASE","CASE_BROKEN","TEST_FILE_STALE","CASE_ARCHIVED"]),D=e=>typeof e=="string"?e:null;function st(e){let t=e.extra;switch(e.code){case"CASE_BROKEN":return{code:"CASE_BROKEN",session:D(t.session),caseId:D(t.caseId)??"",reason:t.reason==="moved"?"moved":"deleted"};case"CASE_ARCHIVED":return{code:"CASE_ARCHIVED",caseId:D(t.caseId)??"",internalId:D(t.internalId)??""};default:return{code:e.code,session:D(t.session),useCase:D(t.useCase)}}}function Jt(e){return(Array.isArray(e.nodes)?e.nodes:[]).filter(n=>typeof n.cid=="string"&&typeof n.label=="string").map(n=>({cid:n.cid,label:n.label,content:typeof n.content=="object"&&n.content!==null?n.content:{}}))}function qt(e){return(Array.isArray(e.names)?e.names:[]).filter(n=>typeof n.cid=="string"&&typeof n.slug=="string").map(n=>({cid:n.cid,slug:n.slug}))}function Kt(e){return(Array.isArray(e.supersessions)?e.supersessions:[]).filter(n=>n.kind==="node"&&typeof n.old=="string").map(n=>({old:n.old,new:typeof n.new=="string"?n.new:null}))}function Yt(e){let{request:t,exchange:n}=B(e),o=(s,r)=>`/v1/projects/${encodeURIComponent(s)}/uploads/${r}`,d=s=>`/v1/sessions/${encodeURIComponent(s)}`,a=async(s,r=null)=>{let l=[],m=r;do{let c=await t("GET",`${s}${m===null?"":`&after=${encodeURIComponent(m)}`}`);l.push(...c.items),m=c.next}while(m!==null);return l},i=async(s,r)=>{let l=await t("GET",`/v1/projects/${encodeURIComponent(s)}/sessions/${encodeURIComponent(r)}`),{proposes:m,heldChanges:c,changes:p,approves:u,archives:g,removes:w,chatTurns:h,uncounted:f}=l.drafts;return{proposes:m,heldChanges:c??0,changes:p??{},approves:u??{},archives:g??{},removes:w??{},chatTurns:h??0,uncounted:typeof f=="number"?f:null}};return{async*projects(){for(let s=1;s!==null;){let r=await t("GET",`/v1/projects?page=${s}`);r.items.length>0&&(yield r.items.map(({projectId:l,name:m,marked:c})=>({projectId:l,name:m,marked:c}))),s=r.next}},async project(s){let l=(await t("GET",`/v1/projects?projectId=${encodeURIComponent(s)}`)).items.find(m=>m.projectId===s);return l===void 0?null:{projectId:s,marked:l.marked===!0,mainPosition:l.context?.mainPosition??null}},async testCase(s,r,l){try{let m=await t("GET",`/v1/projects/${encodeURIComponent(s)}/tests/${encodeURIComponent(r)}/case?base=${encodeURIComponent(l)}`),{test:c,scenario:p,useCase:u,caseId:g,internalId:w,title:h,current:f,counts:$,canAttach:S}=m;return{linked:{test:c,scenario:p,useCase:u,caseId:g,internalId:w,title:h,current:f,counts:$,canAttach:S}}}catch(m){if(m instanceof v&&m.status===409&&nt.has(m.code))return{refused:st(m)};throw m}},async createSession(s){return(await t("POST","/v1/sessions",s)).session},async sources(s){let r=[],l=null;do{let m=`limit=1000${l===null?"":`&after=${encodeURIComponent(l)}`}`,c=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/sources?${m}`);r.push(...c.items.map(({sourceId:p,head:u,completeness:g,origin:w,media:h})=>({sourceId:p,head:u,completeness:g,...w!==void 0?{origin:w}:{},...h!==void 0?{media:h}:{}}))),l=c.next}while(l!==null);return r},async mainRecord(s,r){let l=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/positions/${r}`);return{position:l.position,record:l.record}},async mainNode(s,r){let l=await t("GET",`/v1/internal/projects/${encodeURIComponent(s)}/nodes/${encodeURIComponent(r)}`);return{cid:l.cid,name:l.name,label:l.label,content:l.content??{},supersededBy:l.supersededBy??null,edgesOut:(l.edgesOut??[]).map(({type:m,dst:c,other:p})=>({type:m,dst:c,other:p??null}))}},nodes:(s,r)=>a(`/v1/internal/projects/${encodeURIComponent(s)}/nodes?label=${encodeURIComponent(r)}&limit=1000`),async testsWithContent(s){let r=`/v1/internal/projects/${encodeURIComponent(s)}/nodes?label=test&content=1&limit=200`,l;try{l=await t("GET",r)}catch(c){if(c instanceof v&&c.status===400&&c.code==="BAD_REQUEST"&&c.message.includes('Unrecognized key: "content"'))return null;throw c}let m=l.next===null?[]:await a(r,l.next);return[...l.items,...m].map(c=>({...c,content:c.content??{}}))},edges:(s,r)=>a(`/v1/internal/projects/${encodeURIComponent(s)}/edges?type=${encodeURIComponent(r)}&limit=1000`),stale:s=>a(`/v1/internal/projects/${encodeURIComponent(s)}/stale?limit=1000`),async listSessions(s,r={}){let l=[],m=null,c=`${r.sourceId?`&sourceId=${encodeURIComponent(r.sourceId)}`:""}${r.useCase?`&useCase=${encodeURIComponent(r.useCase)}`:""}`;do{let p=`projectId=${encodeURIComponent(s)}${c}${m===null?"":`&after=${encodeURIComponent(m)}`}`,u=await t("GET",`/v1/sessions?${p}`);l.push(...u.items),m=u.next}while(m!==null);return l},getSession:s=>t("GET",d(s)),setStatus:(s,r)=>t("PATCH",d(s),{status:r}),land:(s,r)=>t("POST",`${d(s)}/land`,{generation:r}),discard:(s,r)=>t("POST",`${d(s)}/discard`,r===void 0?{}:{generation:r}),proposes:async(s,r)=>(await i(s,r)).proposes,counts:i,openUpload:(s,r)=>t("POST",`/v1/projects/${encodeURIComponent(s)}/uploads`,r),putUpload:async(s,r,l,m)=>{let{response:c,bytes:p}=await n("PUT",s,l,{headers:r,route:"PUT upload",...m?{onSend:m}:{}}),u=c.headers.get("etag");if(p.length>0)try{let g=JSON.parse(p.toString("utf8"));typeof g.etag=="string"&&(u=g.etag)}catch{}if(!u)throw new v(c.status,"BAD_RESPONSE","the upload's store answered no etag");return{etag:u}},completeUpload:(s,r,l)=>t("POST",`${o(s,r)}/complete`,{etag:l}),getUpload:(s,r)=>t("GET",o(s,r)),uploadResult:(s,r,l)=>t("POST",`${o(s,r)}/result`,l),async projectCoverage(s){let{state:r,doc:l}=await t("GET",`/v1/projects/${encodeURIComponent(s)}/coverage`);return{state:r,doc:l}},async coverageRun(s,r){return{pack:(await t("POST",`/v1/projects/${encodeURIComponent(s)}/coverage/run`,r)).pack}}}}import{isMainThread as lt}from"worker_threads";import{createHash as dt}from"crypto";function se(e){return e instanceof Error?e.message:String(e)}var ke="SUPERSEDED_WRITER",en="LEASE_LAPSED";function tn(e){let t=`/v1/sessions/${encodeURIComponent(e.sessionId)}/host`,{exchange:n,request:o}=B(e),d=i=>i===null?"limit=1000":`after=${encodeURIComponent(i)}&limit=1000`,a=i=>i===void 0?t:`${t}/children/${encodeURIComponent(i)}`;return{claim:()=>o("POST",`${t}/claim`,{forms:1}),session:()=>o("GET",t),renewLease:i=>o("POST",`${t}/lease`,{generation:i}),save:i=>o("PATCH",t,i),checkpointRows:i=>o("GET",`${a(i)}/checkpoints`,void 0,!0),async readCheckpointRow(i,s){return(await o("GET",`${a(s)}/checkpoints/${i}`,void 0,!0)).text},async writeCheckpointRow(i,s,r,{ifAbsent:l=!1,childId:m}={}){let c=`${a(m)}/checkpoints/${s}${l?"?ifAbsent=true":""}`;return(await o("PUT",c,{generation:i,text:r})).stored},async removeCheckpointRow(i,s,r){await o("DELETE",`${a(r)}/checkpoints/${s}?generation=${i}`)},registerChild:(i,s,r)=>o("POST",`${t}/children`,{generation:i,childId:s,...r?{useCase:r}:{}}),async sessionSide(){return(await o("GET",`${t}/side`)).text},async putSessionSide(i,s){await o("PUT",`${t}/side`,{generation:i,text:s})},saveChildPointer:(i,s,r,l)=>o("PATCH",a(s),{generation:i,checkpoint:r,state:l}),async sessionState(i){let{text:s}=await o("GET",`${a(i)}/state`);return s===null?null:JSON.parse(s)},async putSessionState(i,s,r){await o("PUT",`${a(r)}/state`,{generation:i,text:JSON.stringify(s)})},scope:()=>o("GET",`${t}/scope`),draftsPage:i=>o("GET",`${t}/scope/drafts?${d(i)}`,void 0,!0),appendDraft:(i,s)=>o("POST",`${t}/scope/drafts`,{generation:i,...s}),mainNodes:(i,s)=>o("POST",`${t}/main/nodes`,{position:i,cids:s}),async mainHistory(){let{response:i,bytes:s}=await n("GET",`${t}/main/history`,void 0,{headers:{"accept-encoding":"gzip"},bulk:!0}),r=Number(i.headers.get("lattice-history-position")),l=i.headers.get("lattice-history-hash");if(!Number.isInteger(r)||r<0||!l)throw new v(i.status,"UNEXPECTED_ANSWER",`GET ${t}/main/history answered without its Lattice-History-Position and Lattice-History-Hash headers`);return{position:r,hash:l,forms:be(i,"lattice-history-forms"),json:s}},async getBlob(i){try{return(await n("GET",`${t}/blobs/${encodeURIComponent(i)}`,void 0,{bulk:!0})).bytes}catch(s){if(s instanceof v&&s.code==="NOT_FOUND")return null;throw s}},putBlob:(i,s)=>o("PUT",`${t}/blobs?generation=${i}`,s),async files(i){return(await o("GET",`${t}/files?prefix=${encodeURIComponent(i)}`)).items},async readFile(i){try{let{response:s,bytes:r}=await n("GET",`${t}/file?name=${encodeURIComponent(i)}`,void 0,{bulk:!0}),l=Number(s.headers.get("lattice-file-version"));if(!Number.isInteger(l)||l<1)throw new v(s.status,"UNEXPECTED_ANSWER",`GET ${t}/file answered ${i} without a Lattice-File-Version header`);return{text:r.toString("utf8"),version:l}}catch(s){if(s instanceof v&&s.code==="NOT_FOUND")return null;throw s}},async embeddings(i,s){let r=`alias=${encodeURIComponent(i)}&purpose=${encodeURIComponent(s)}`,{bytes:l}=await n("GET",`${t}/embeddings?${r}`,void 0,{headers:{"accept-encoding":"gzip"},bulk:!0});return JSON.parse(l.toString("utf8"))},putEmbeddings:(i,s)=>o("POST",`${t}/embeddings`,{generation:i,...s}),putFile:(i,s,r,l)=>o("PUT",`${t}/file?name=${encodeURIComponent(s)}&generation=${i}&version=${r}`,l),appendEvents:(i,s)=>o("POST",`${t}/events`,{generation:i,events:s}),async eventsAfter(i){let s=[],r=null;do{let l=r===null?`after=${i}&limit=1000`:`after=${encodeURIComponent(r)}&limit=1000`,m=await o("GET",`${t}/events?${l}`);s.push(...m.items),r=m.next}while(r!==null);return s}}}var re="the session cannot go on: the project's context is being imported; it is served once an import of it completes",ot=5*6e4,Ce=2e3,it=15e3;function _e(e){return e instanceof v&&e.code==="CONTEXT_IMPORTING"}function Ie(){return new v(409,"CONTEXT_IMPORTING",re)}function on(e={}){let t=e.sleep??(a=>new Promise(i=>setTimeout(i,a))),n=e.budgetMs??ot,o=0,d=Ce;return{async wait(){let a=n-o;if(a<=0)return!1;let i=Math.min(d,a);return await t(i),o+=i,d=Math.min(d*2,it),!0},answered(){o=0,d=Ce}}}var R={scope:"store.scope",mainNodes:"store.mainNodes",mainNodesAhead:"store.mainNodesAhead",mainHistory:"store.mainHistory",drafts:"store.drafts",appendDraft:"store.appendDraft",vectorsRead:"store.vectorsRead",vectorsWrite:"store.vectorsWrite",getBlob:"store.getBlob",putBlob:"store.putBlob",chainRead:"chain.read",chainList:"chain.list",chainWrite:"chain.write",chainWriteIfAbsent:"chain.writeIfAbsent",chainRemove:"chain.remove",filesRead:"files.read",filesList:"files.list",filesWrite:"files.write",pointer:"session.pointer",stateGet:"session.stateGet",statePut:"session.statePut",acknowledge:"session.acknowledge",registerChild:"session.registerChild",children:"session.children",sideGet:"session.sideGet",sideSave:"session.sideSave"};var Pe=3e4,L=class extends Error{constructor(n,o,d,a=null){super(`Lattice refused ${n} (${o}): ${d}`);this.op=n;this.code=o;this.requestId=a;this.name="StepRefusedError"}};function ct(e){return e.status!==0?"not_ready":/no answer within/.test(e.message)?"timeout":"unreachable"}var Oe=new Set([ke,"SESSION_ENDED","PROJECT_NOT_MARKED"]);function fn(e,t){let n=t.sleep??(c=>new Promise(p=>setTimeout(p,c))),o=t.retryDeadlineMs??12e4,d=new Map((t.children??[]).map(c=>[c.childId,c.checkpoint?.pointer??null]));async function a(c,p){let u=Te(o,n,t.now);for(;;)try{let g=await p();return t.imports?.answered(),g}catch(g){if(!(g instanceof v))throw g;if(_e(g)&&t.imports){if(await t.imports.wait())continue;throw t.onStopped?.(Ie()),te(new Error(`Lattice refused ${c}: ${re}`),g)}if(Oe.has(g.code)&&t.onStopped?.(g),!g.retryable)throw new L(c,g.code,g.message,g.requestId);let w=h=>t.onRetry?.({op:c,attempt:u.attempt,nextInMs:h,giveUpAt:u.endsAt()??0,cause:ct(g)});if(!await u.again(w))throw t.onStopped?.(new v(g.status,g.code,`Lattice did not take ${c} within ${o/1e3} s: ${g.message}`,null,null,{},g.requestId)),te(new Error(`Lattice refused ${c} (${g.code}, still after ${o/1e3} s): ${g.message}`),g)}}async function i(c,p){try{return await p()}catch(u){throw u instanceof v?(Oe.has(u.code)&&t.onStopped?.(u),new L(c,u.code,u.message,u.requestId)):u}}async function s(c,p){let u=R.acknowledge,g=t.log;if(!g)throw new Error("the checkpoint barrier needs the session log, and this host gave it none");let w=Date.now()+Pe;for(;g.lastSeq()<c.eventSeq;){if(Date.now()>w)throw new Error(`the session log reached event ${g.lastSeq()}, not ${c.eventSeq}, within ${Pe/1e3} s; the checkpoint is not acknowledged`);await n(5)}await ut(g.flush(),o),await a(u,()=>e.writeCheckpointRow(t.generation,`side-${c.pointer.seq}.json`,JSON.stringify(c.side),{childId:p}));let h={pointer:c.pointer,covers:{eventSeq:c.eventSeq,scope:c.scope}},f=JSON.stringify(c.state);p===void 0?await a(u,()=>e.save({generation:t.generation,checkpoint:h,state:f})):d.set(p,(await a(u,()=>e.saveChildPointer(t.generation,p,h,f))).checkpoint.pointer)}async function r(){let c=await a(R.mainHistory,()=>e.mainHistory()),p=dt("sha256").update(c.json).digest("hex");if(p!==c.hash)throw new Error(`main's history from Lattice hashes to ${p}, not to ${c.hash}, the hash Lattice gave for it`);if(t.historyForms!==void 0&&c.forms!==t.historyForms){let u=`main's history pack was built at engine forms ${c.forms??"none named"}, not at ${t.historyForms}, the forms of the Lattice that took this host's claim: another Lattice served it`;throw t.onStopped?.(new v(409,"HISTORY_FORMS_MISMATCH",u)),new Error(u)}return c.json.toString("utf8")}let l=new Map,m=c=>`${Number(c.position)}:${c.cids.join(",")}`;return async(c,p)=>{let u=p??{},g=u.after??null,w=typeof u.childId=="string"?u.childId:void 0;switch(c){case R.scope:return await a(c,()=>e.scope());case R.mainHistory:return{json:await r()};case R.mainNodesAhead:{let h=e.mainNodes(Number(u.position),u.cids);return h.catch(()=>{}),l.set(m(u),h),null}case R.mainNodes:{let h=l.get(m(u));if(l.delete(m(u)),h)try{return await h}catch{}return await a(c,()=>e.mainNodes(Number(u.position),u.cids))}case R.drafts:return await a(c,()=>e.draftsPage(g));case R.appendDraft:{let h={eventId:u.eventId??null,record:u.record??null,envelope:u.envelope??null};return await a(c,()=>e.appendDraft(t.generation,h))}case R.filesRead:return(await a(c,()=>e.readFile(W(u.name))))?.text??null;case R.filesList:{let h=`${W(u.folder)}/`;return(await a(c,()=>e.files(h))).map($=>$.name.slice(h.length)).filter($=>!$.includes("/"))}case R.filesWrite:{if(!String(u.name).startsWith("rationale/"))throw new Error(`the host writes only test rationales; ${W(u.name)} is a configuration file, written by an operator`);try{return await a(c,()=>e.putFile(t.generation,W(u.name),0,Buffer.from(String(u.text),"utf8"))),{written:!0}}catch(h){if(/\(FILE_CHANGED\)/.test(se(h)))return{written:!1,message:se(h)};throw h}}case R.vectorsRead:return await i(c,()=>e.embeddings(String(u.alias),String(u.purpose)));case R.vectorsWrite:{let h={alias:String(u.alias),purpose:String(u.purpose),dims:Number(u.dims),vectors:u.vectors??{}};return await i(c,()=>e.putEmbeddings(t.generation,h))}case R.getBlob:{let h=await a(c,()=>e.getBlob(String(u.fingerprint)));return{bytes:h===null?null:h.toString("base64")}}case R.putBlob:return await a(c,()=>e.putBlob(t.generation,Buffer.from(String(u.bytes),"base64")));case R.chainRead:return await a(c,()=>e.readCheckpointRow(String(u.name),w));case R.chainList:return await a(c,()=>e.checkpointRows(w));case R.chainWrite:return await a(c,()=>e.writeCheckpointRow(t.generation,String(u.name),String(u.text),{childId:w})),null;case R.chainWriteIfAbsent:return await a(c,()=>e.writeCheckpointRow(t.generation,String(u.name),String(u.text),{ifAbsent:!0,childId:w}));case R.chainRemove:return await a(c,()=>e.removeCheckpointRow(t.generation,String(u.name),w)),null;case R.pointer:return w!==void 0?d.get(w)??null:(await a(c,()=>e.session())).checkpoint?.pointer??null;case R.stateGet:return await a(c,()=>e.sessionState(w));case R.statePut:return await a(c,()=>e.putSessionState(t.generation,u.state??null,w)),null;case R.acknowledge:return await s(u,w),null;case R.children:return[...(t.children??[]).map(h=>h.childId)];case R.sideGet:return await a(c,()=>e.sessionSide());case R.sideSave:return await a(c,()=>e.putSessionSide(t.generation,String(u.text))),{saved:!0};case R.registerChild:{let h=typeof u.useCase=="string"?u.useCase:void 0,f=await a(c,async()=>{try{return await e.registerChild(t.generation,String(u.childId),h)}catch($){throw $ instanceof v&&$.code==="SESSION_CLASH"?new Ee($.message,$.code,{heldBy:$.extra.heldBy??null},$.requestId):$}});return d.set(f.childId,f.checkpoint?.pointer??null),null}default:throw new Error(`the session thread asked for ${c}, which the main thread does not answer`)}}}function W(e){return`design/${String(e)}`}async function ut(e,t){let n,o=new Promise((d,a)=>{n=setTimeout(()=>a(new Error(`the session's events were not stored within ${t/1e3} s; the checkpoint is not acknowledged`)),t)});try{await Promise.race([e,o])}finally{clearTimeout(n)}}var x={verb:"remote",mode:"interactive"},oe=null,Ne=new Set;function Tn(e){x={...x,...e}}function V(e,t){return Ae(e,t),z()}function Ae(e,t){if(!(!Z()||Ne.has(e))){Ne.add(e);try{oe??=$e({verb:x.verb,mode:x.mode,contextRoot:null,env:Re(),sessionId:z(),errorsOnly:!0}),Object.assign(oe.ids,{...x.projectId?{project_id:x.projectId}:{},...x.latticeSessionId?{lattice_session_id:x.latticeSessionId}:{}}),oe.spoolError(e,t?{request_id:t}:{})}catch{}}}function gt(e){return e instanceof v||e instanceof L?`lattice_${e.code}`:"cli_crash"}function mt(e){let t=e?.requestId;return typeof t=="string"&&t?t:null}async function ht(){!Z()||!lt||await Promise.race([fe(ye()).catch(()=>{}),new Promise(e=>setTimeout(e,we).unref())])}async function xn(e,t){return e instanceof v&&Ae(gt(e),mt(e)),await ht(),t}import{isAbsolute as pt,relative as Le}from"path";var k=e=>" ".repeat(e);function ft(e){return e.length<2?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}var J=e=>e===1?"this test runs":"these tests run";function De(e,t,n){if(n===void 0||t+e.length<=n)return[k(t)+e];let o=[],d="";for(let a of e.split(" "))d&&t+d.length+1+a.length>n?(o.push(k(t)+d),d=a):d=d?`${d} ${a}`:a;return[...o,k(t)+d]}function _n(e,t){let n=e.variables.length;if(n===0)return[];let o=n===1?`\u2692 1 variable needs a value before ${J(t.tests)}; fill it in:`:`\u2692 ${n} variables need values before ${J(t.tests)}; fill them in:`,d=[k(t.indent)+o,k(t.indent+4)+(Le(t.cwd,e.file)||e.file)],a=e.variables.filter(i=>i.start_page).map(i=>i.name);return a.length===1?d.push(...De(`${a[0]} is the page ${t.tests===1?"it starts":"they start"} on`,t.indent+4,t.columns)):a.length>1&&d.push(...De(`${ft(a)} are the pages they start on`,t.indent+4,t.columns)),d}function Ue(e,t){let n=t.cwd??process.cwd(),o=s=>pt(s)&&Le(n,s)||s,d=e.length;if(d===0)return[];let a=d===1?"\u2692 1 test has no start page yet, so it can't run as it is:":`\u2692 ${d} tests have no start page yet, so they can't run as they are:`,i=d===1?"name the page in its first step, or run it with --url <the page>":"name the page in each one's first step, or run them with --url <the page>";return[k(t.indent)+a,...e.map(s=>k(t.indent+4)+(s.file?o(s.file):`${s.test} ${s.title}`)),k(t.indent+4)+i]}function je(e,t){let n=e.variables.length,o=e.noStartPage.length;return[...n===0?[]:[n===1?`1 variable needs a value before ${J(t.tests)}`:`${n} variables need values before ${J(t.tests)}`],...o===0?[]:[o===1?"1 test has no start page yet":`${o} tests have no start page yet`]]}function Bn(e,t="--mode agent"){if(!e.next)return e.remedy?{remedy:e.remedy}:{};let n=(e.remedy??"").split(`
|
|
3
|
+
`).filter(o=>!/^\s+kane-cli /.test(o)).join(" ").replace(/(, run)?:$/,"").replace(/[,;]\s*(then\s+)?run:\s*kane-cli\b.*$/,"").trim();return{...n?{remedy:n}:{},next:e.next.map(o=>({cmd:`${o.cmd} ${t}`,why:o.why}))}}function Gn(e){let t=e;return!t||typeof t.sessionId!="string"||typeof t.verb!="string"?null:{sessionId:t.sessionId,verb:t.verb,useCase:typeof t.useCase=="string"?t.useCase:null,mine:t.mine===!0,status:typeof t.status=="string"?t.status:"running"}}var Hn=e=>({sid:e.sessionId,verb:e.verb,use_case:e.useCase,mine:e.mine,status:e.status}),yt={useCases:["use-case","use-cases"],criteria:["acceptance criterion","acceptance criteria"],scenarios:["scenario","scenarios"],tests:["test","tests"],openQuestions:["open question","open questions"],sources:["source","sources"],styleNotes:["style note","style notes"]},ue=ne.map(e=>[e,...yt[e]]),X=(e,t=H)=>{let n=ue.filter(([d])=>(e[d]??0)>0),o=n.filter(([d])=>!t.has(d));return o.length>0?o:n},Rt=new Set(["styleNotes"]),le=e=>e?ue.filter(([t])=>(e[t]??0)>0).map(([t,n,o])=>`${e[t]} ${e[t]===1?n:o}`):[];function $t(e){let t=o=>o?I(X(o).map(([d,a,i])=>`${o[d]} ${o[d]===1?a:i}`)):"",n=[[t(e),"added"],...Ve.map(({key:o,done:d})=>[t(e[o]),o==="changes"?"changed":d])].filter(([o])=>o!=="").map(([o,d])=>`${o} ${d}`);return N(e)>0&&n.push(Ke(N(e))),n.length>0?n.join(", "):null}function Wn(e){let t=$t(e.counts),n=[G(e.durS),...t?[t]:[],...e.credits!==void 0?[`${e.credits.toFixed(1)} credits`]:[]].join(" \xB7 "),o=e.title?`"${e.title}"`:P(e.id??"");return t||(e.counts.uncounted??0)>0?`\u25CF updated ${o} \u2014 ${n}`:`\u25CF nothing changed in ${o} \u2014 ${n}`}function Vn(e){let t=e.title?`"${e.title}"`:P(e.id??""),n=[G(e.durS),`${e.tests} ${e.tests===1?"test":"tests"}`,...e.credits!==void 0?[`${e.credits.toFixed(1)} credits`]:[]];return`\u25CF designed ${t} \u2014 ${n.join(" \xB7 ")}`}function Jn(e){return`\u25CF finished ${e.title?`"${e.title}"`:P(e.id??"")} \u2014 ${[G(e.durS),...e.credits!==void 0?[`${e.credits.toFixed(1)} credits`]:[]].join(" \xB7 ")}`}var I=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`,Ve=[{key:"changes",row:"updates",done:"updated",saving:"updates"},{key:"approves",row:"approves",done:"approved",saving:"approves"},{key:"archives",row:"archives",done:"archived",saving:"archives"},{key:"replaces",row:"replaces",done:"replaced",saving:"replaces"},{key:"removes",row:"removes",done:"removed",saving:"removes"}],Q=e=>Ve.filter(({key:t})=>j(e[t])),Je=e=>Q(e).length>0,ge=e=>e===1?"1 test":`${e} tests`,vt=e=>[...Q(e).map(({key:t,done:n})=>`${I(le(e[t]))} ${n}`),...e.keeps?[`${ge(e.keeps)} marked up to date`]:[]],qn=e=>[...Q(e).map(({key:t,saving:n})=>`saving it ${n} ${I(le(e[t]))}${t==="removes"?" from the project":""}`),...e.keeps?[`saving it marks ${ge(e.keeps)} up to date`]:[]],Kn=e=>[...vt(e),...N(e)>0?[Ye(N(e))]:[]],Yn=e=>ue.reduce((t,[n])=>t+(H.has(n)?0:e.changes?.[n]??0),0),Xn=e=>xe(e),bt=e=>F(e)!==""||j(e.changes)||j(e.approves)||j(e.archives),St="this session's work",Qn=e=>F(e)?"throw away what this session added":me(e)?"throw away this session's chat":"throw away this session's work",zn="already discarded \u2014 nothing was saved",Zn=e=>bt(e)?"your team can see it now":me(e)?Et:xt(e)?St:"",Et="this session's chat";function es(e,t){let n=t.removes;if(e==="extract"||!n||!((n.scenarios??0)>0||(n.tests??0)>0))return t;let o={...(n.scenarios??0)>0?{scenarios:n.scenarios}:{},...(n.tests??0)>0?{tests:n.tests}:{}},{scenarios:d,tests:a,...i}=n,{removes:s,...r}=t;return{...r,replaces:o,...j(i)?{removes:i}:{}}}function ts(e){let t=new Map;for(let n of e){if(n.kind!=="evolve_diff")continue;let o=n.payload??n.body;if(typeof o?.use_case!="string")continue;let d=o.repinned?.tests;typeof d=="number"&&d>0?t.set(o.use_case,d):t.delete(o.use_case)}return t}function ns(e,t){let n=[...t.values()].reduce((i,s)=>i+s,0);if(n===0)return e;let o=Math.max(0,(e.uncounted??0)-t.size),{uncounted:d,...a}=e;return{...a,keeps:n,...o>0?{uncounted:o}:{}}}var Tt=["changes","approves","archives","removes"],N=e=>e.heldChanges??0,j=e=>Object.values(e??{}).some(t=>(t??0)>0),qe=e=>!(e.adds??F(e))&&!Je(e)&&N(e)===0&&(e.keeps??0)===0,me=e=>qe(e)&&(e.chatTurns??0)>0&&(e.uncounted??0)===0,xt=e=>qe(e)&&!me(e);async function ss(e,t,n){let o=await e.counts(t,n),{proposes:d,heldChanges:a,chatTurns:i,uncounted:s}=o;return{...d,...a>0?{heldChanges:a}:{},...Object.fromEntries(Tt.flatMap(r=>j(o[r])?[[r,o[r]]]:[])),...i&&i>0?{chatTurns:i}:{},...typeof s=="number"?{exact:!0}:{},...typeof s=="number"&&s>0?{uncounted:s}:{}}}function Ke(e){return e===1?"1 change to an existing use-case":`${e} changes to existing use-cases`}function Ye(e){return`${Ke(e)}, saved but not applied`}var kt=e=>F(e)!==""||Je(e)||N(e)>0||(e.keeps??0)>0||(e.chatTurns??0)>0||(e.uncounted??0)>0,rs=(e,t)=>e.exact?kt(e):t;function os(e,t){let n=F(e),o=N(e),d=[];n&&d.push(["adds",n]);for(let{key:s,row:r}of Q(e))d.push([r,le(e[s]).join(", ")]);e.keeps&&d.push(["keeps",`${ge(e.keeps)}, marked up to date`]),o>0&&d.push(["held",Ye(o)]);let a=(e.chatTurns??0)>0;((e.uncounted??0)>0||!e.exact&&d.length===0&&!a)&&d.push(["other","work not counted here"]),a&&d.push(["chat","saved with the session; your team can read it"]),d.push(["project",t?"changed since this session started":"no changes since this session started"]);let i=s=>(s?.scenarios??0)+(s?.tests??0);return i(e)+i(e.changes)>0&&d.push(["then","its test cases are created or updated in Test Manager"]),d}function F(e){return X(e,Rt).map(([t,n,o])=>`${e[t]} ${e[t]===1?n:o}`).join(", ")}function is(e){let t=X(e);if(t.length!==1)return"your work is";let[n,o,d]=t[0];return e[n]===1?`your ${o} is`:`your ${e[n]} ${d} are`}function Ct(e,t=[]){return t.length>0?`start a new session from the latest project, adding this session's documents again; run:
|
|
4
|
+
${Xe(t)}`:`${e.startsWith("kane-cli design tests")?"to design it again from the latest project":"to start a new session from the latest project"}, run:
|
|
5
|
+
${e}`}var Xe=e=>`kane-cli context ingest ${e.map(Y).join(" ")}`;function as(e,t){return e.length>0?[...new Set(e)]:_t(t)}function _t(e){return[...new Set((e.uploads??[]).filter(t=>t.outcome==="created"&&t.filename).map(t=>t.filename))]}function It(e){let t=X(e);if(t.length!==1)return"its work";let[n,o,d]=t[0];return e[n]===1?`its ${o}`:`its ${e[n]} ${d}`}function ds(e){return e.replace(/\s*\([^()]*→[^()]*\)/g,"")}function cs(e,t,n){return`kane-cli ${e==="design"?"design tests":"context extract"} --resume ${t}${n?" --mode agent":""}`}var Me=e=>`updating kane-cli won't help \u2014 share this id with support: ${V(`refused_${e}`)}`,q="in a folder linked to a shared project",U="check the file, then run the command again",ie=e=>[`${e} has more inside it than kane-cli can read`,"save a smaller copy, or a PDF of it, then run the command again"],Pt={PDF_ENCRYPTED:e=>[`${e} is password-protected`,"remove the password, then run the command again"],PDF_NO_TEXT_LAYER:e=>[`${e} has no text to read; scanned PDFs aren't supported yet`,"use a PDF with text in it, then run the command again"],PDF_UNREADABLE:e=>[`${e} can't be read as a PDF`,U],DOCX_UNREADABLE:e=>[`${e} can't be read as a Word document`,U],DOCX_NOT_WORDPROCESSING:e=>[`${e} can't be read as a Word document`,U],DOCX_NO_TEXT:e=>[`${e} has no text to add`,U],DOCX_ENCRYPTED_OR_LEGACY:e=>[`${e} is password-protected or in the old Word format`,"save it as a .docx without a password, then run the command again"],DOCX_PART_TOO_LARGE:ie,DOCX_TOO_MANY_PARTS:ie,DOCX_BOMB:ie,SOURCE_ID_OWNED:e=>[`${e} can't become a version of that source: a source plugin reads it`,"add it under another id with --as <id>, then run the command again"]},Ot={changed_both_sides:"it was changed in Test Manager too; choose there which steps to keep",not_pushable:"its steps can't be changed from here; change them in Test Manager",archived:"it's archived in Test Manager; restore it there first",busy:"a test run is using it; wait until the run ends",not_accepted:"Test Manager has different steps for it; choose there which to keep"},O=e=>`${e} ${e===1?"test case":"test cases"}`,Fe={test_on_older_version:"it changed after its test was designed",test_unreadable:"its test can't be read",test_has_no_steps:"its test has no steps"},Qe=e=>ve.test(e)?e.toLowerCase():e,ze=e=>Object.hasOwn(Fe,e)?Fe[e]:void 0,Ze=e=>e.useCase&&ze(e.reason)!==void 0&&e.reason!=="test_unreadable"?Qe(e.useCase):null;function us(e){if(!e||e==="unread")return;let t=new Map([...e.wrote,...e.unchanged??[]].map(n=>[n.id.toLowerCase(),n.path]));for(let n of e.refused)n.file&&t.set(n.id.toLowerCase(),n.file);return n=>t.get(n.toLowerCase())}var de=e=>e.reason==="test_unreadable";function Nt(e,t){let n=ze(e.reason);if(n===void 0)return[{text:" it can't be sent to Test Manager yet",tone:"detail"}];if(e.reason==="test_unreadable"){let d=t?.(e.test);return[{text:` ${n}${d?`: ${pe(d)}`:""}`,tone:"detail"}]}let o=Ze(e);return o===null?[{text:` ${n}`,tone:"detail"}]:[{text:` ${n}; to design its tests again, run:`,tone:"detail"},{text:` kane-cli design tests --use-case ${o}`,tone:"detail",command:!0}]}var K=(e,t)=>t===void 0||typeof e.useCase!="string"||t.has(Qe(e.useCase));function At(e,t,n){let o=e===1,d=`to see ${o?"its use-case":"their use-cases"}, run: kane-cli context list --stale`,a=o?"1 scenario of another use-case":`${e} scenarios of other use-cases`;return n?[{text:` ${a} ${o?"isn't":"aren't"} in Test Manager either`,tone:"detail"},{text:` ${d}`,tone:"detail"}]:[{text:`${a} in ${y(t)} ${o?"isn't":"aren't"} in Test Manager`,tone:"detail"},{text:` ${d}`,tone:"detail"}]}var C="some test cases may not be there yet";function he(e,t){switch(e){case"TEST_MANAGER_TIMEOUT":return{why:`Test Manager took too long, so ${C}`,lead:`Test Manager took too long; ${C}`,next:"to finish them (nothing is saved twice), run:",remedy:!1,support:!1,agentCode:"TEST_MANAGER_TIMED_OUT"};case"FORGE_UNAVAILABLE":return{why:`Test Manager couldn't be reached, so ${C}`,lead:`Test Manager couldn't be reached; ${C}`,next:"to finish them (nothing is saved twice), run:",remedy:!1,support:!0,agentCode:"TEST_MANAGER_UNREACHABLE"};case"FORGE_REFUSED":return{why:`Test Manager refused your account, so ${C}`,lead:`Test Manager refused your account; ${C}`,next:"ask a Test Manager admin to grant your account access, then run:",remedy:!0,support:!1,agentCode:"PROJECT_NO_ACCESS"};case"PROJECT_NOT_MARKED":return{why:`assurance is now off for "${t}", so ${C}`,lead:`assurance is now off for "${t}"; ${C}`,next:"to try them again later (nothing is saved twice), run:",remedy:!0,support:!1,agentCode:"ASSURANCE_OFF"};default:return{why:"some test cases couldn't be created or updated in Test Manager",lead:"some test cases couldn't be created or updated in Test Manager",next:"to try them again (nothing is saved twice), run:",remedy:!1,support:!0,agentCode:"TEST_MANAGER_FAILED"}}}function ls(e,t,n,o,d){let a={receipt:null,summary:null,lines:[],support:!1};if(!e)return a;let{made:i,updated:s,waiting:r,error:l}=e,m=e.nextRun??[],c=e.notCovered??[],p=c.filter(b=>K(b,o)),u=c.length-p.length;if(i===0&&s===0&&r===0&&l===null&&m.length===0&&c.length===0)return a;let g=i>0&&s>0?`${O(i)} created and ${s} updated in Test Manager`:i>0?`${O(i)} created in Test Manager`:s>0?`${O(s)} updated in Test Manager`:null,w={text:` kane-cli context sessions save ${t}`,tone:"plain"},h=b=>b===1?"wasn't":"weren't",f=[];if(m.length>0){let b=m.length===1;f.push({text:`${O(m.length)} in Test Manager ${b?"updates on its":"update on their"} next kane-cli run:`,tone:"plain"});for(let A of m)f.push({text:` "${A.title}"`,tone:"detail"});(r>0||l!==null||c.length>0)&&f.push({text:"",tone:"plain"})}if(r>0){f.push({text:`warning: ${O(r)} in Test Manager ${h(r)} updated`,tone:"warning"});for(let b of e.waitingOn)f.push({text:` "${b.title}"`,tone:"detail"},{text:` ${Ot[b.reason]}`,tone:"detail"})}if(p.length>0){let b=p.length;f.push({text:`warning: ${b} ${b===1?"scenario wasn't":"scenarios weren't"} sent to Test Manager`,tone:"warning"});for(let A of p)f.push({text:` "${A.title}"`,tone:"detail"},...Nt(A,d))}u>0&&f.push(...At(u,n,p.length>0));let $=l===null?null:he(l.code,n);$&&f.push({text:`warning: the session was saved, but ${$.why}`,tone:"warning"});let S=$?$.remedy||r===0?$.next:"then, to finish them (nothing is saved twice), run:":r>0?`then, to update ${r===1?"it":"them"} (nothing is saved twice), run:`:null;S!==null&&f.push({text:`next: ${S}`,tone:"plain"},w);let E=[];if(g!==null&&E.push(g),r>0&&E.push(g!==null?`${r} ${h(r)} updated yet`:`${O(r)} in Test Manager ${h(r)} updated yet`),p.length>0){let b=p.length;E.push(`${E.length>0?b:`${b} ${b===1?"scenario":"scenarios"}`} ${b===1?"wasn't":"weren't"} sent to Test Manager`)}return $&&E.push(E.length>0?"some may not be there yet":$.lead),{receipt:g,summary:E.length>0?E.join("; "):null,...m.length>0?{nextRunSummary:`${O(m.length)} ${m.length===1?"updates on its":"update on their"} next kane-cli run`}:{},lines:f,support:($?.support??!1)||p.some(de)}}function gs(e,t,n,o){if(!e)return;let d=e.notCovered??[],a=[...new Set(d.flatMap(s=>{let r=K(s,n)?Ze(s):null;return r===null?[]:[r]}))],i=[...e.error!==null?[{cmd:`kane-cli context sessions save ${t} --mode agent`,why:"finishes the test cases that may not be there yet"}]:[],...a.map(s=>({cmd:`kane-cli design tests --use-case ${s} --force --mode agent`,why:"designs the use case's tests again, so its scenarios reach Test Manager"}))];return{total:e.total,created:e.made,updated:e.updated,already_there:e.linked,waiting:e.waiting,waiting_on:e.waitingOn.map(({scenario:s,title:r,reason:l})=>({scenario:s,title:r,reason:l})),next_run:(e.nextRun??[]).map(({scenario:s,title:r})=>({scenario:s,title:r})),...d.length>0?{not_covered:d.map(s=>{let r=de(s)?o?.(s.test):void 0;return{scenario:s.scenario,title:s.title,test:s.test,reason:s.reason,in_session:K(s,n),...r?{file:pe(r)}:{}}})}:{},...e.error!==null?{error:he(e.error.code,"").agentCode}:{},...d.some(s=>K(s,n)&&de(s))?{support_id:V("refused_TEST_UNREADABLE")}:{},...i.length>0?{next:i}:{}}}var Be=new Set(["duplicate","unwritable"]),et=e=>Be.has(e.kind)||e.kind==="import"&&e.via!==void 0&&Be.has(e.via),Dt=new Set(["unreadable","unresolved"]);function Lt(e,t){return!e||e.variables.length===0&&e.noStartPage.length===0?{}:{needed:{...e,tests:t},neededFacts:je(e,{tests:t})}}function Ut(e){if(!e||e.length===0)return{};let t=e.length===1?"1 test file here was replaced and won't run any more":`${e.length} test files here were replaced and won't run any more`;return{replacedHead:`\u2692 ${t}:`,replaced:e.map(n=>({file:ce(process.cwd(),n.file)||n.file,by:n.replacedBy.map(o=>wt(o))})),replacedSummary:t}}function jt(e){return e!=null&&e.error===null}var tt=(e,t)=>{if(!jt(t)||t.waitingOn.length>0)return[];let n=new Set((t.notCovered??[]).map(o=>o.test.toLowerCase()));return e.filter(o=>o.file&&!n.has(o.id.toLowerCase()))},pe=e=>M(ce(process.cwd(),e)||e);function ms(e,t,n,o={}){let d={text:` kane-cli context sessions save ${t}`,tone:"plain"};if(e==="unread")return{line:null,lines:[{text:"warning: the session was saved, but its test files couldn't be written here",tone:"warning"},{text:"next: to write them (nothing is saved twice), run:",tone:"plain"},d],support:!0,summary:"its test files aren't written here yet",kept:null,again:"all"};let a=e.wrote.length,i=e.refused.length,s=a+(e.unchanged?.length??0),r=s+i,l=e.saved?new Set(e.saved):null,m=l?e.wrote.filter(S=>!l.has(S.id)).length:0,c=S=>`${m} ${m===1?"test":"tests"} ${S?"it imports":"they import"}`,p=a===0?null:n||i===0&&s>a?`\u2692 wrote ${a===1?"1 test file that was":`${a} test files that were`} missing or out of date here`:i>0?`\u2692 wrote ${a} of the ${r} test files`:m>0?`\u2692 wrote ${a} test files, for ${a-m===1?`the saved test and ${c(!0)}`:`${a-m} saved tests and ${c(!1)}`}`:a===1?"\u2692 wrote 1 test file, for the saved test":`\u2692 wrote ${a} test files, one for each saved test`,u={...Ut(e.replaced),...Lt(e.needed,e.saved?.length??r)};if(i===0)return{line:p,lines:[],support:!1,summary:null,kept:null,again:0,...u};let w=[{text:`warning: ${i===r?`${i===1?"1 test file wasn't":`${i} test files weren't`} written`:`${i} of the ${r} test files ${i===1?"wasn't":"weren't"} written`}`,tone:"warning"}];for(let S of e.refused)w.push({text:S.title?` "${S.title}"`:" a test with no title",tone:"detail"},{text:` ${ee(S)}`,tone:"detail"});let h=e.refused.filter(et).length;h>0&&w.push({text:`next: then, to write ${h===1?"it":"them"} (nothing is saved twice), run:`,tone:"plain"},d);let f=e.refused.filter(S=>S.kind==="edited");if(f.length>0){let S=f.length===1,E=tt(f,o.testManager);if(E.length>0){w.push({text:E.length===1?"next: to send your edit to its test case in Test Manager, run:":"next: to send your edits to their test cases in Test Manager, run:",tone:"plain"});for(let A of E)w.push({text:` kane-cli testmd run ${pe(A.file)}`,tone:"plain"})}let b=`${E.length>0?"or, to":"next: to"} get the project's ${S?"version, move it":"versions, move them"} out of this folder`;h>0?w.push({text:`${b} and save again`,tone:"plain"}):w.push({text:`${b}, then run:`,tone:"plain"},d)}let $=i-f.length;return{line:p,lines:w,support:e.refused.some(S=>Dt.has(S.kind)),summary:s>0?`${s} of the ${r} test files written here`:$===0?null:f.length>0?`${$} of the ${r} test files ${$===1?"isn't":"aren't"} written here yet`:r===1?"its test file isn't written here yet":"its test files aren't written here yet",kept:f.length===0?null:f.length>1?`${f.length} test files here keep your edits`:r===1?"its test file here keeps your edit":"1 test file here keeps your edit",again:h,...u}}function hs(e,t,n){if(!e||!t||t.again===0)return null;let o=`write ${t.again===1?"the test file":"the test files"}`;return e.error!==null?he(e.error.code,n).remedy?null:`next: to finish them and ${o} (nothing is saved twice), run:`:e.waiting>0?`next: then, to update ${e.waiting===1?"the test case":"the test cases"} and ${o} (nothing is saved twice), run:`:null}function ps(e,t,n={}){let o=`kane-cli context sessions save ${t} --mode agent`;if(e==="unread")return{written:[],refused:[],error:"TEST_FILES_NOT_WRITTEN",next:[{cmd:o,why:"writes the test files here"}]};let d=e.refused.some(et),a=e.refused.filter(r=>r.kind==="edited"),i=a.length===0?"":a.length===1?", and the project's version of a kept file once it's moved out of its folder":", and the project's version of the kept files once they're moved out of their folder",s=[...d?[{cmd:o,why:`writes the test files not written here${i}`}]:[],...tt(a,n.testManager).map(r=>({cmd:`kane-cli testmd run ${M(r.file)} --agent`,why:"sends your edit to its test case in Test Manager"})),...a.length>0&&!d?[{cmd:o,why:"writes the project's version, once the file is moved out of its folder"}]:[]];return{written:e.wrote.map(r=>r.path),refused:e.refused.map(r=>({test:r.id,title:r.title,reason:ee(r),...r.kind==="edited"&&r.file?{file:r.file}:{}})),...e.replaced?.length?{replaced:e.replaced.map(r=>({test:r.test,file:r.file,replaced_by:r.replacedBy}))}:{},...e.needed?.variables.length?{variables_needed:{file:e.needed.file,variables:e.needed.variables}}:{},...e.needed?.noStartPage.length?{no_start_page:e.needed.noStartPage.map(r=>({test:r.test,...r.file?{file:r.file}:{}}))}:{},...s.length>0?{next:s}:{}}}var Mt={ac:"an acceptance criterion",scenario:"a scenario",test:"a test",gap:"an open question",source:"a source",stylenote:"a style note"},T=(e,t)=>e?`"${e}"`:P(t),Ge=(e,t,n)=>`${e} ${e===1?t:n}`,fs={trusted:"approved",derived:"proposed",archived:"archived"},ws={yes:"yes",source_changed:"no: its source changed",source_removed:"no: its source was removed",tests_out_of_date:"no: its tests are out of date",designed_from_changed:"no: what it was designed from changed",archived:"-"},ys={source_changed:"its source changed",source_removed:"its source was removed",tests_out_of_date:"changed after its tests were designed"},y=e=>e?`"${e}"`:"this session's project",_=(e,t)=>`kane-cli design tests --use-case ${e}${t}`,ae=e=>e?"its source's change was put off in an earlier review; to take it up":"to review its source's change",He=e=>e.split(`
|
|
6
|
+
`).map(t=>({text:` ${t.trim()}`,dim:!0})),Rs={nothingChanged:(e,t)=>({code:"NOTHING_CHANGED",message:`${T(e,t)} hasn't changed since its tests were designed`,remedy:`to design them again anyway, run:
|
|
7
|
+
${_(t,"")}`,next:[{cmd:_(t," --mode agent"),why:"designs its tests again anyway"}]}),noTests:(e,t)=>({code:"NO_TESTS_YET",message:`${T(e,t)} has no tests yet, so there's nothing to update`,remedy:`to design them, run:
|
|
8
|
+
${_(t,"")}`,next:[{cmd:_(t," --mode agent"),why:"designs its tests"}]}),unreviewed:(e,t)=>({code:"UC_UNREVIEWED",message:We.unapproved(e,t,!0).message,remedy:`to design its tests again anyway, run:
|
|
9
|
+
${_(t," --allow-unreviewed")}`,next:[{cmd:_(t," --force --allow-unreviewed --mode agent"),why:"designs its tests again anyway"}]}),archived:(e,t,n)=>({code:"UC_ARCHIVED",message:We.archived(e,t,n).message}),unknownRef:(e,t)=>({message:`${y(t)} has no ${Ft[Bt(e)]??"item"} ${e}`}),ambiguousRef:(e,t)=>({message:`${e} names more than one item in ${y(t)}; run the command again with more of its id`}),notInUseCase:e=>({message:`${e} isn't part of a use case whose tests can be updated`}),held:(e,t,n)=>[{text:` \u2717 the tests of "${t}" can't be updated now: ${e?"you're designing them in another session":"someone else is designing them"}`},{text:" to update them later, run:",dim:!0},{text:` kane-cli maintain evolve ${n}`,dim:!0}],later:e=>[{text:"next: to update them later, run:"},{text:` kane-cli maintain evolve ${e}`}],changedCount:e=>e===1?"1 use-case changed after its tests were designed":`${e} use-cases changed after their tests were designed`,cantUpdate:(e,t)=>[{text:` \u2717 the tests of "${e}" can't be updated: it isn't approved yet`},{text:" to design its tests again anyway, run:",dim:!0},{text:` kane-cli design tests --use-case ${t} --allow-unreviewed`,dim:!0}],upToDate:e=>`everything in ${y(e)} is up to date, so there's nothing to update`,resumingBatch:(e,t)=>`\u25CF resuming the update of ${e===1?"1 use-case":`${e} use-cases`} \u2014 ${t} updated, ${e-t} to go`,resumingOne:(e,t,n)=>`\u25CF resuming the update of "${e}" \u2014 ${t} of ${n} phases done`,upToDateNow:e=>({text:` "${e}" is up to date now, so it's left out`,dim:!0}),upToDateNothing:e=>({text:` "${e}" is up to date now, so there's nothing to update`,dim:!0}),moreAnswers:e=>e===1?"1 more use-case needs your answer before the update goes on":`${e} more use-cases need your answers before the update goes on`,stillOutOfDate:e=>[e===1?"next: 1 use-case still isn't up to date; to update it, run:":`next: ${e} use-cases still aren't up to date; to update them, run:`," kane-cli maintain evolve --from-stale"],nothingToSave:"nothing to save \u2014 this session changed nothing",notYet:e=>`${I(e.map(t=>`"${t}"`))} ${e.length===1?"wasn't":"weren't"} updated`,notUpdatedNext:e=>[`next: to update ${e.length===1?"the use-case":`the ${e.length} use-cases`} this didn't, run:`,...e.map(t=>` kane-cli maintain evolve ${t}`)],notUpdated:e=>I(e.map(t=>`"${t}"`)),reviewSource:(e,t,n=!1)=>e!==null?`${ae(n)}, run:
|
|
10
|
+
${e}`:`${ae(n)}, run this with that source's file:
|
|
11
|
+
kane-cli maintain reconcile --from <file> --source-id ${t}`,reviewSourceAgent:(e=!1)=>ae(e),sourceChanged:(e,t,n)=>({message:`${T(e,t)} is out of date because its source changed, and an update can't change that`,...n}),leftOutSourceChanged:(e,t,n)=>[{text:`${T(e,t)} is left out: it's out of date because its source changed`},...He(n)],stillSourceChanged:e=>He(e),listNext:(e,t)=>[`next: for ${P(e)} "${t}", run:`,` kane-cli maintain evolve ${e}`],listAgentNext:e=>[{cmd:`kane-cli maintain evolve ${e} --mode agent`,why:"update its tests"}]},Ft={uc:"use case",sc:"scenario",ac:"acceptance criterion",t:"test",gap:"open question",sty:"style note"},Bt=e=>/^([a-z]+)-\d+$/i.exec(e)?.[1]?.toLowerCase()??"",We={unapproved:(e,t,n)=>({code:"UC_UNREVIEWED",message:`${T(e,t)} isn't approved yet`,next:{lead:"to design its tests anyway, run:",cmd:_(t,`${n?" --mode agent":""} --allow-unreviewed`),why:"designs its tests though it isn't approved yet"}}),archived:(e,t,n)=>({code:"UC_ARCHIVED",message:`${T(e,t)} is archived in ${y(n)}, so its tests can't be designed`}),designed:(e,t,n)=>({message:n?`${T(e,t)} changed after its tests were designed; --force designs them again, replacing the ones it has`:`${T(e,t)} already has tests; --force designs them again, replacing the ones it has`,next:{lead:"to design them again, run:",cmd:_(t," --force --mode agent"),why:"designs its tests again, replacing the ones it has"},...n?{more:[{cmd:`kane-cli maintain evolve ${t} --mode agent`,why:"updates only the tests its change touches"}]}:{}}),wallUpdate:e=>`next: to update only what its change touches, run:
|
|
12
|
+
kane-cli maintain evolve ${e}`,wallHead:(e,t,n,o=2)=>n?`${T(e,t)} changed after its ${o===1?"test was":"tests were"} designed`:`${T(e,t)} already has ${o===1?"a test":"tests"}`,wallAgain:e=>e===1?" 1. design it again \u2014 replaces it if it no longer fits; you'll be asked why":` 1. design them again \u2014 ${e>0?"replaces any that no longer fit; ":""}you'll be asked why`,wallStop:" 2. stop here \u2014 nothing is started",wallWhy:e=>e===1?"why design it again? ":"why design them again? ",wallStopped:"nothing was started",wallNoReason:"nothing was started: designing them again needs a reason",unknown:(e,t,n)=>({message:`${y(t)} has no use case ${e}`,...n.length>0?{next:{lead:`its use cases include ${I(n)}; run the command again with one of them`}}:{}}),removed:(e,t)=>({message:`${e} was removed from ${y(t)}, so it has no tests to design`}),notUseCase:(e,t)=>{let n=t!==void 0?Mt[t]:void 0;return{message:n?`${e} is ${n}, not a use case`:`${e} isn't a use case`}}},Gt=new Set(["CHECKPOINT_PROTOCOL","SESSION_KEPT_NOTHING","SESSION_MISSING"]),$s=e=>{let t=/^error: ([A-Z_]+): /.exec(e)?.[1];return t!==void 0&&Gt.has(t)},Y=e=>{let t=e.startsWith("-")?`./${e}`:e;return/^[A-Za-z0-9_./:@%+=,\\-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`};function vs(e,t){let n=g=>e.tests.filter(w=>w.outcome===g).length,[o,d,a,i]=[n("new"),n("updated"),n("unchanged"),n("kept")],s=o+d+a,r=[],l=[o?`${o} new`:"",d?`${d} updated`:"",a?`${a} already up to date`:""].filter(Boolean);s>0&&r.push(`\u2713 "${t.project}": ${s} test${s===1?"":"s"} here \u2014 ${l.join(", ")}`);for(let g of e.tests)g.outcome==="new"?r.push(` new ${g.file}${g.imported?" (a test above uses it)":""}`):g.outcome==="updated"?r.push(` updated ${g.file}`):g.outcome==="kept"?r.push(` kept ${g.file} \u2014 you changed it here`):g.outcome==="replaced"&&r.push(` replaced ${g.file} \u2014 your changes were replaced with the project's`);let m=e.tests.filter(g=>g.outcome==="not_written");if(m.length>0){r.push(`warning: ${m.length===1?"1 test file wasn't":`${m.length} test files weren't`} written`);for(let g of m)r.push(g.title?` "${g.title}"`:" a test with no title",` ${g.reason??""}`)}let c=e.tests.filter(g=>g.outcome!=="not_written"&&g.file!==void 0).length,p=e.tests.filter(g=>g.outcome!=="not_written"&&g.firstRun).length;p===1?r.push("1 of these tests hasn't run in this folder yet: its first run writes its steps in a real browser, which takes a few minutes and uses more credits; later runs replay it"):p>1&&r.push(`${p} of these tests haven't run in this folder yet: the first run of each writes its steps in a real browser, which takes a few minutes and uses more credits; later runs replay them`);let u=e.needed;if(u&&u.variables.length>0){let g=u.variables.length,w=c===1?"this test runs":"these tests run";r.push(`\u2692 ${g===1?"1 variable needs a value":`${g} variables need values`} before ${w}: ${I(u.variables.map(f=>f.name))}`),r.push(` add ${g===1?"it":"them"} to ${ce(t.cwd,u.file)||u.file}`);let h=u.variables.filter(f=>f.start_page).map(f=>f.name);h.length===1?r.push(` ${h[0]} is the page ${c===1?"it starts":"they start"} on`):h.length>1&&r.push(` ${I(h)} are the pages they start on`)}return u&&u.noStartPage.length>0&&r.push(...Ue(u.noStartPage,{indent:0,cwd:t.cwd})),c>0&&r.push(`next: to run ${c===1?"it":"them"}, run:`," kane-cli testrun run"),i>0&&r.push(`next: to replace ${i===1?"it":"them"} with the project's ${i===1?"version":"versions"}, run:`,` kane-cli context pull --overwrite${t.useCase?` --use-case ${t.useCase}`:""}`),r}var Ht={savedBefore:"this session was already saved",pullLocationLinked:e=>({code:"PULL_LOCATION_LINKED",message:`this folder takes its tests from "${e}", not from a location`,remedy:`to bring the project's tests here, run:
|
|
13
|
+
kane-cli context pull`}),pullFlagsMixed:()=>({code:"PULL_FLAGS_MIXED",message:"--project, --use-case and --overwrite bring a shared project's tests; a location name, --rebase, --yes and --answer take work from a location",remedy:"use one or the other"}),pullFlagsLinkedOnly:()=>({code:"PULL_FLAGS_LINKED_ONLY",message:"--use-case and --overwrite work in a folder linked to a shared project",remedy:`to take the new work shared at a location, run:
|
|
14
|
+
kane-cli context pull [name]`}),useCaseUnknown:(e,t)=>({code:"USE_CASE_UNKNOWN",message:`"${e}" has no use-case ${t}`,remedy:`to see its use-cases, run:
|
|
15
|
+
kane-cli context list`}),pullFailed:e=>({code:"PULL_FAILED",message:`the tests of "${e}" couldn't be read, so none was written`,remedy:`to try again, run:
|
|
16
|
+
kane-cli context pull`,support:!0}),noTestsYet:e=>[`"${e}" has no tests yet`,"next: to see which use-cases need tests designed, run:"," kane-cli cover"],notYet:e=>({code:"REMOTE_UNSUPPORTED",message:`kane-cli ${e} isn't available yet ${q}`,remedy:"run it in a folder that isn't linked to a project"}),sessionsLocalOnly:e=>({code:"REMOTE_UNSUPPORTED",message:`kane-cli context sessions ${e} isn't available yet ${q}`,remedy:"to see this project's sessions, run: kane-cli context sessions"}),overrideWithProject:e=>({code:"REMOTE_UNSUPPORTED",message:"--mode override isn't available yet with a shared project",remedy:`to use this folder's own context instead, run:
|
|
17
|
+
kane-cli context ingest ${e.map(Y).join(" ")} --local --mode override`}),answerNeedsResume:()=>({code:"STRUCTURED_FLAGS_USAGE",message:"--answer needs --resume: it answers a paused session's questions",remedy:"to see this project's sessions, run: kane-cli context sessions"}),answerAgentOnly:(e,t)=>({code:"STRUCTURED_FLAGS_USAGE",message:"--answer works with --mode agent only",remedy:`to answer in the session instead, run: kane-cli ${e} --resume ${M(t)}`}),answerParse:e=>({code:"STRUCTURED_FLAGS_USAGE",message:e}),fromContextNotYet:(e,t,n=[])=>{let o=`--from-context isn't available yet ${q}`;if(t===null)return{code:"REMOTE_UNSUPPORTED",message:o,remedy:"name the test files instead, for example: kane-cli testrun run .testmuai/tests/<file>_test.md"};let d=e.length===1&&t.length===1?`${e[0]}'s test file`:"their test files",a=`kane-cli testrun run ${[...t,...n].map(M).join(" ")}`;return{code:"REMOTE_UNSUPPORTED",message:o,remedy:`to run ${d}, run:
|
|
18
|
+
${a}`,next:[{cmd:a,why:`runs ${d}`}]}},optionNotYet:e=>({code:"REMOTE_UNSUPPORTED",message:`${e} isn't available yet ${q}`,remedy:"run it in a folder that isn't linked to a project"}),reviewVersionAdded:(e,t)=>`added ${e} to this session \u2014 a new version of "${t}"`,reviewPageAdded:e=>`added ${e} to this session \u2014 its new version`,reviewWaits:(e,t)=>`added a new version of ${e} to session ${t}, not saved yet`,reviewResume:e=>`review: kane-cli context extract --resume ${e}`,nothingToReview:(e,t)=>`${e} is already in ${y(t)}, unchanged, so there's nothing to review`,reviewBehind:(e,t,n)=>`${e} is already in ${y(t)}, but ${n===1?"1 use-case was":`${n} use-cases were`} made from an older version of it`,reviewUnread:(e,t)=>`${e} is already in ${y(t)}, but its current version adds what no use-case was made from yet`,reconcileSourceMissing:e=>{let t=`kane-cli context ingest ${Y(e.path)}`,n=e.removed?"to add it again as a new source":"to add it as a new source",o=`to see the sources ${y(e.project)} holds, run:`;return{code:e.removed?"SOURCE_REMOVED":"SOURCE_UNKNOWN",message:e.removed?`"${e.source}" was removed from ${y(e.project)}, so there's nothing to compare ${e.file} with`:`"${e.source}" isn't in ${y(e.project)} yet, so there's nothing to compare ${e.file} with`,remedy:e.agent?`${n}, run: ${t} --mode agent; or, ${o} kane-cli context list --type source --mode agent`:`${n}, run:
|
|
19
|
+
${t}
|
|
20
|
+
or, ${o}
|
|
21
|
+
kane-cli context list --type source`}},reconcileOriginUnknown:(e,t)=>({code:"SOURCE_ORIGIN_UNKNOWN",message:`this folder holds no record of the file source '${e}' was read from`,remedy:t?`pass the file: kane-cli maintain reconcile --from <file> --source-id ${e} --mode agent`:`pass the file:
|
|
22
|
+
kane-cli maintain reconcile --from <file> --source-id ${e}`}),reconcileRefUnrouted:(e,t,n,o)=>({code:"SOURCE_REF_UNROUTED",message:`source '${e}' was read by plugin ${t} from '${n}', which this build routes to ${o===null?"no plugin":`plugin ${o}`}`,remedy:`reconcile it with a build whose plugin ${t} claims that reference`}),reconcileRefOtherId:(e,t,n,o)=>({code:"SOURCE_ID_MISMATCH",message:`--source-id '${e}' does not match the source plugin ${t} reads '${n}' as, '${o}'`,remedy:`re-run with --source-id ${o}`}),reconcileNeeds:(e,t)=>({code:"REMOTE_UNSUPPORTED",message:"kane-cli maintain reconcile needs --from <file> and --source-id <id>",remedy:t?`to see the sources ${y(e)} holds, run: kane-cli context list --type source --mode agent`:`to see the sources ${y(e)} holds, run:
|
|
23
|
+
kane-cli context list --type source`}),listHeadline:(e,t)=>{let n=(d,a,i)=>d===void 0?null:Ge(d,t.proposed?`proposed ${a}`:a,t.proposed?`proposed ${i}`:i),o=[t.sources!==void 0?Ge(t.sources,"source","sources"):null,n(t.useCases,"use-case","use-cases"),n(t.scenarios,"scenario","scenarios"),n(t.tests,"test","tests")].filter(d=>d!==null);return`${y(e)} holds ${o.length>1?`${o.slice(0,-1).join(", ")} and ${o[o.length-1]}`:o[0]??""}`},listStaleHeadline:(e,t,n)=>n===1?`the 1 use-case in ${y(e)} isn't up to date`:`${t} of the ${n} use-cases in ${y(e)} ${t===1?"isn't":"aren't"} up to date`,listNothing:(e,t)=>t?`everything in ${y(e)} is up to date`:`nothing in ${y(e)} matches`,listReadFailed:()=>({code:"LIST_FAILED",message:"couldn't load this project's list",remedy:"run the command again",support:!0}),coverComputing:e=>`coverage: ${y(e)} is still working it out; run the command again in a moment`,coverReadFailed:e=>({code:"COVERAGE_FAILED",message:`couldn't load ${y(e)}'s coverage`,remedy:"run the command again",support:!0}),assuranceOff:e=>({code:"ASSURANCE_OFF",message:`assurance isn't available for ${y(e)}`,remedy:"run the command in a folder that isn't linked to a project"}),noAccess:e=>({code:"PROJECT_NO_ACCESS",message:e===""?"you don't have access to this session's project":`you don't have access to "${e}", the project this folder is linked to`,remedy:"ask a Test Manager admin to grant your account access, then run the command again"}),bothStores:e=>({code:"BOTH_STORES",message:`this folder has its own context store and is also linked to ${e===null?"a project":`"${e}"`}`,remedy:"to work locally, remove .testmuai/assurance.json; to work in the project, move the context store (.context) out of this folder"}),linkUnreadable:()=>({code:"PROJECT_FILE_UNREADABLE",message:"this folder's link to its project could not be read",remedy:"remove .testmuai/assurance.json, then choose the project again with: kane-cli context extract"}),markRefused:(e,t)=>({code:"PERMISSION_REQUIRED",message:`you can't start the first session in ${y(e)}: it needs permission to create test cases`,remedy:t?"ask a Test Manager admin for that permission, or run the command again and pick another project":"ask a Test Manager admin for that permission, or someone who has it to start the first session; then run the command again"}),confirmRequired:e=>({code:"CONFIRM_REQUIRED",message:"refusing to save this session without --yes (no terminal to confirm)",remedy:"add --yes",...e?{next:[{cmd:`kane-cli context sessions save ${e} --yes`,why:"save it to the project"}]}:{}}),noConnectionAtStart:()=>({code:"CONNECTION_FAILED",message:"couldn't connect for 2 minutes, so nothing was started",remedy:"check your connection, then run the command again",support:!0}),folderFlagsBoth:()=>({code:"FOLDER_USAGE",message:"--project and --local can't be used together",remedy:"use one: --project <id> to share this folder's work, or --local to keep it here"}),folderFlagWithResume:e=>({code:"FOLDER_USAGE",message:`${e} can't be used with --resume; a session stays where it started`,remedy:`run it again without ${e}`}),projectIdUnknown:(e,t)=>({code:"PROJECT_NO_ACCESS",message:`you don't have a project with the id "${e}"`,remedy:t?"to find a project's id, run: kane-cli projects list --search <name> --agent":`to find a project's id, run:
|
|
24
|
+
kane-cli projects list --search <name>`}),projectFileUnwritable:e=>({code:"PROJECT_FILE_UNWRITABLE",message:"this folder's link to its project could not be written",remedy:e?"move the file named .testmuai out of this folder, then run the command again":"check that you can write to this folder, then run the command again"}),folderWorksLocally:()=>({code:"FOLDER_CHOSEN",message:"this folder works locally, so --project can't link it to a project",remedy:"run it without --project; to share instead, move the context store (.context) out of this folder first"}),folderLinkedElsewhere:e=>({code:"FOLDER_CHOSEN",message:`this folder is linked to ${y(e)}, not to the project given`,remedy:"run it without --project; to link it to another project, remove .testmuai/assurance.json first"}),folderLinkedNotLocal:e=>({code:"FOLDER_CHOSEN",message:`this folder is linked to ${y(e)}, so --local can't keep it local`,remedy:"run it without --local; to work locally, remove .testmuai/assurance.json first"}),noConnection:()=>({code:"CONNECTION_FAILED",message:"couldn't connect, so nothing was started",remedy:"check your connection, then run the command again",support:!0}),credentialsMissing:()=>({code:"CREDENTIALS_MISSING",message:"you're not logged in",remedy:"in a terminal, log in with: kane-cli login"}),loginUnconfirmed:()=>({code:"CREDENTIALS_MISSING",message:"couldn't confirm your login for shared projects",remedy:"run the command again; if this keeps failing, log in with your username and access key: kane-cli login --username <user> --access-key <key>"}),credentialsRejected:()=>({code:"CREDENTIALS_REJECTED",message:"your credentials were rejected",remedy:"in a terminal, log in again with: kane-cli login"}),noSuchSession:e=>({code:"SESSION_NOT_FOUND",message:`no session ${e} of yours`,remedy:"to see your sessions, run: kane-cli context sessions"}),sessionFinished:e=>({code:"SESSION_FINISHED",message:`session ${e} is finished, so it can't be resumed`,remedy:`to save what it added, run: kane-cli context sessions save ${e}`,next:[{cmd:`kane-cli context sessions save ${e} --yes`,why:"save what it added"}]}),sessionFailed:e=>({code:"SESSION_FAILED",message:`session ${e} ended with an error, so it can't be resumed or saved`,remedy:"start a new session with: kane-cli context extract",support:!0}),resumeUnreadable:(e,t,n,o)=>({code:e,message:`session ${t} can't be resumed, because its last step can't be read`,remedy:`start a new session with: ${n==="design"&&o?`kane-cli design tests --use-case ${o}`:"kane-cli context extract"}`,support:!0}),reviewOnlyFiles:(e,t,n)=>{let o=`${Xe([e])}${n?` --as ${Y(n)}`:""}`;return{code:"REMOTE_UNSUPPORTED",message:"--from takes only a file yet in a folder linked to a shared project",remedy:t?`to add the page's new version, run: ${o} --mode agent`:`to add the page's new version, run:
|
|
25
|
+
${o}`}},ingestTooLarge:(e,t,n)=>({code:"FILE_TOO_LARGE",message:`${e} is too large \u2014 ${t}; the limit is ${n}`,remedy:"use a smaller file, then run the command again"}),ingestUnsupported:e=>({code:"UNSUPPORTED_MEDIA",message:e,remedy:"use one of those file types, then run the command again"}),ingestTextTooLarge:e=>({code:"PROJECTION_TOO_LARGE",message:`${e}'s text is too large to add`,remedy:"shorten the document, then run the command again"}),ingestUnreadable:(e,t)=>({code:e,message:t,remedy:"check the file, then run the command again"}),conversionRefused:(e,t)=>{let n=Pt[t]?.(e);return n?{code:t,message:n[0],remedy:n[1]}:{code:t,message:`${e} couldn't be added`,remedy:U,support:!0}},ingestBadSourceId:e=>({code:"BAD_SOURCE_ID",message:`${e} isn't a source id: use letters, digits, ".", "_" or "-", and start with a letter or digit`,remedy:"pick another id, then run the command again"}),ingestNoFile:e=>({code:"FILE_NOT_FOUND",message:`there's no file at ${e}`,remedy:"check the path, then run the command again"}),ingestNotItsType:(e,t)=>({code:"MEDIA_SNIFF_MISMATCH",message:`${e}'s content doesn't match its .${t} name`,remedy:U}),ingestCantOpen:e=>({code:"FILE_UNREADABLE",message:`${e} can't be read`,remedy:"check that you can open the file, then run the command again"}),ingestNoSourceId:e=>({code:"BAD_SOURCE_ID",message:`${e} can't be added: its name needs at least one letter a-z or digit`,remedy:"rename the file, then run the command again"}),uploadStalled:e=>({code:"UPLOAD_STALLED",message:`the upload of ${e} stopped, so nothing was added`,remedy:"check your connection, then run the command again",support:!0}),uploadDropped:e=>({code:"CONNECTION_FAILED",message:`the connection dropped while uploading ${e}, so nothing was added`,remedy:"check your connection, then run the command again"}),uploadExpired:e=>({code:"UPLOAD_EXPIRED",message:`the upload of ${e} took too long, so nothing was added`,remedy:"run the command again"}),uploadNotTaken:e=>({code:"UPLOAD_NOT_TAKEN",message:`the shared project couldn't take ${e}, so nothing was added`,remedy:"run the command again",support:!0}),resultRefused:e=>({code:"RESULT_REFUSED",message:`the shared project didn't take ${e}, so nothing was added`,remedy:"run the command again",support:!0}),alreadySaved:()=>({code:"ALREADY_SAVED",message:"this session was already saved, so there's nothing to discard"}),savedOrDiscarded:()=>({code:"ALREADY_ENDED",message:"this session was already saved or discarded; there's nothing to discard"}),goingOnElsewhere:e=>({code:"SESSION_ELSEWHERE",message:"this session goes on in another terminal, so it can't be discarded now",remedy:`stop it there, or wait 3 minutes if that terminal was closed; then run: kane-cli context sessions discard ${e}`,next:[{cmd:`kane-cli context sessions discard ${e} --yes`,why:"throw away what this session added"}]}),discardFailed:()=>({code:"DISCARD_FAILED",message:"couldn't discard this session, so it's kept as it is",remedy:"run the command again",support:!0}),discardUnconfirmed:()=>({code:"CONNECTION_FAILED",message:"the connection dropped during the discard, so it couldn't be confirmed",remedy:"check your connection, then run the command again; it's safe to repeat",support:!0}),confirmDiscardRequired:e=>({code:"CONFIRM_REQUIRED",message:"refusing to discard this session without --yes (no terminal to confirm)",remedy:"add --yes",...e?{next:[{cmd:`kane-cli context sessions discard ${e} --yes`,why:"throw away what this session added"}]}:{}}),notFinished:(e,t)=>({code:"SESSION_NOT_FINISHED",message:`session ${e} isn't finished yet, and only a finished session can be saved`,remedy:`resume it and finish it first: ${t}`}),versionCliOlder:()=>({code:"VERSION_MISMATCH",message:"this version of kane-cli is too old to work with shared projects",remedy:`to update kane-cli, run: ${Se()}`}),versionServiceOlder:()=>({code:"VERSION_MISMATCH",message:"shared projects don't support this version of kane-cli yet",remedy:Me("VERSION_MISMATCH")}),openFailed:()=>({code:"SESSION_OPEN_FAILED",message:"the session couldn't be opened",remedy:"run the command again",support:!0}),projectBusy:e=>{let t=y(e.project),n=e.held,o=e.useCase??n.useCase,d=e.title?`"${e.title}"`:o?P(o):"this use case",a=e.agent?"wait for it to finish, then run the command again":`wait for it to finish, then run the command again; to see the project's sessions, run:
|
|
26
|
+
kane-cli context sessions`,i=l=>e.agent?`to go on with it here (the other terminal then stops), run: ${l} --mode agent`:`to go on with it here (the other terminal then stops), run:
|
|
27
|
+
${l}`,s=n.verb==="design"||n.verb==="evolve",r=s?n.mine?`you're already designing tests for ${d} in another session`:`someone else is designing tests for ${d} right now`:`${n.mine?e.verb==="extract"?"your other":"your":"someone else's"} extract is ${n.status==="queued"?"about to start":"running"} in ${t}`;return e.resume?{code:"PROJECT_BUSY",message:`${r}, so this session can't go on yet; it stays as it was`,remedy:"wait for it to finish, then run the command again",heldBy:n}:s?n.mine?{code:"PROJECT_BUSY",message:r,remedy:i(`kane-cli design tests --resume ${n.sessionId}`),heldBy:n}:{code:"PROJECT_BUSY",message:`${r}, so this design can't start`,remedy:a,heldBy:n}:e.verb==="design"?{code:"PROJECT_BUSY",message:`${r}, so a design can't start until it finishes`,remedy:a,heldBy:n}:n.mine?{code:"PROJECT_BUSY",message:`${r}, so this one can't start`,remedy:i(`kane-cli context extract --resume ${n.sessionId}`),heldBy:n}:{code:"PROJECT_BUSY",message:`${r}, so this one can't start`,remedy:a,heldBy:n}},nothingNewInSession:"nothing new to extract: every source is already in a session",nothingNewRead:["nothing new to extract: every source is already read","next: to add more, run:"," kane-cli context ingest <files>"],testCaseMissing:e=>({ownLine:!0,code:"TEST_CASE_MISSING",message:"this test isn't in Test Manager yet, so it can't run",remedy:e?`save the session that designed it, then run the test again; to save the session (nothing is saved twice), run: kane-cli context sessions save ${e}`:"save the session that designed it, then run the test again; to find it, run: kane-cli context sessions"}),testCaseGone:e=>({ownLine:!0,code:"TEST_CASE_GONE",message:"this test's test case was deleted or moved to another project in Test Manager, so it can't run",remedy:e?`save the session that designed it, then run the test again; to save the session (it makes a new test case), run: kane-cli context sessions save ${e}`:"save the session that designed it, then run the test again; to find it, run: kane-cli context sessions"}),testCaseArchived:()=>({code:"TEST_CASE_ARCHIVED",message:"this test's test case is archived in Test Manager, so it can't run",remedy:"restore it in Test Manager, then run the test again"}),testNotInProject:(e,t)=>({ownLine:!0,code:"TEST_NOT_IN_PROJECT",message:`this test isn't in ${y(e)}, and the session that designed it can't be saved anymore`,remedy:t?`design the test again, then save that session; to start, run: kane-cli design tests --use-case ${t}`:"find its use case on the project's page in Test Manager, then design the test again and save it; to start, run: kane-cli design tests --use-case <use-case>"}),testProjectHasNoWork:e=>({ownLine:!0,code:"TEST_NOT_IN_PROJECT",message:`this test isn't in ${y(e)}, which has no use cases or tests yet`,remedy:"run it in the folder linked to the project it was designed in; or, to start this project's work, run: kane-cli context ingest <files>"}),testManagerOutdated:()=>({code:"TEST_MANAGER_OUTDATED",message:"Test Manager can't add this test's runs to its test case yet, so the run didn't start",remedy:"run the test again once Test Manager is updated",support:!0}),testManagerMadeItsOwn:()=>({code:"TEST_MANAGER_OUTDATED",message:"Test Manager made a test case of its own for this run instead of using this test's, so the run stopped",remedy:"you can delete that test case in Test Manager; run the test again once Test Manager is updated",support:!0}),testRunNotSaved:(e,t,n)=>({ownLine:!0,code:"TEST_RUN_NOT_SAVED",message:`Test Manager couldn't save this run, so ${e??"its test case"} doesn't have it yet; the test itself ${t?"passed":"failed"}`,remedy:`the test's next run tries again; to try now, run: kane-cli testmd run ${n}`,support:!0}),remoteKaneNotPublished:()=>({code:"REMOTE_KANE_NOT_PUBLISHED",message:"tests linked to Test Manager need a published kane-cli on the grid, and this one isn't, so nothing was sent",remedy:`run the command with kane-cli installed from npm, or add one of these:
|
|
28
|
+
--kane-version <version> a published version for the grid to install
|
|
29
|
+
--kane-dist <dir> this build, sent with the tests`}),dispatchStopped:e=>`error: ${e} ${e===1?"test":"tests"} can't run yet, so nothing was sent to the grid`,dispatchNext:e=>`next: then run the command again, or leave ${e===1?"it":"them"} out with --match or --tags`,dispatchTestManagerOutdated:()=>({code:"TEST_MANAGER_OUTDATED",message:"Test Manager can't add these tests' runs to their test cases yet, so nothing was sent to the grid",remedy:"run the command again once Test Manager is updated",support:!0}),dispatchProjectHasNoWork:e=>({ownLine:!0,code:"TEST_NOT_IN_PROJECT",message:`these tests aren't in ${y(e)}, which has no use cases or tests yet, so nothing was sent to the grid`,remedy:"run them in the folder linked to the project they were designed in; or, to start this project's work, run: kane-cli context ingest <files>"}),testCaseAttachFailed:()=>({code:"TEST_CASE_ATTACH_FAILED",message:"Test Manager couldn't add this test to its test case, so the run didn't start",remedy:"run the test again",support:!0}),preflight:e=>{switch(e){case"unreachable":return{code:"PREFLIGHT",message:"couldn't connect, so nothing was started",remedy:"check your connection, then run the command again",support:!0};case"login_unchecked":return{code:"PREFLIGHT",message:"couldn't confirm your login, so nothing was started",remedy:"run the command again; if this keeps failing, in a terminal, log in again with: kane-cli login",support:!0};case"rejected":return{code:"PREFLIGHT",message:"your credentials were rejected",remedy:"in a terminal, log in again with: kane-cli login"};case"unsupported":return{code:"PREFLIGHT",message:"assurance sessions aren't available here yet, so nothing was started",remedy:Me("PREFLIGHT")}}},nothingToSave:"nothing to save \u2014 this session added nothing",assuranceOffOr:(e,t,n)=>e?.code==="PROJECT_NOT_MARKED"?Ht.assuranceOff(t):n,projectChanged:(e,t,n,o=[])=>({code:"PROJECT_CHANGED",message:`not saved \u2014 "${e}" changed after this session started`,detail:`this session can't be saved now, so ${It(t)} won't reach the project`,remedy:Ct(n,o)}),saveFailed:e=>({code:"SAVE_FAILED",message:`not saved \u2014 something in this session can't be saved to the project; ${e} still in this session`,remedy:`saving again won't help \u2014 share this id with support: ${V("refused_SAVE_FAILED")}`}),listFailed:()=>({code:"LIST_FAILED",message:"couldn't load this project's sessions",remedy:"run the command again",support:!0}),noConnectionToSave:()=>({code:"CONNECTION_FAILED",message:"couldn't connect, so nothing was saved",remedy:"check your connection, then run the command again",support:!0}),saveUnconfirmed:()=>({code:"CONNECTION_FAILED",message:"the connection dropped during the save, so it couldn't be confirmed",remedy:"check your connection, then run the command again; nothing is saved twice",support:!0}),stepRefused:"the shared project didn't take this step; the work so far is kept in the session",runStopped:e=>`${e==="reconcile"?"the review":e==="evolve"?"the update":e} stopped before it finished; the work so far is kept in the session`};export{Vt as a,xe as b,Jt as c,qt as d,Kt as e,Yt as f,se as g,ke as h,en as i,tn as j,_e as k,Ie as l,on as m,R as n,L as o,ct as p,fn as q,Tn as r,V as s,Ae as t,gt as u,mt as v,ht as w,xn as x,_n as y,Ue as z,je as A,Bn as B,Gn as C,Hn as D,$t as E,Wn as F,Vn as G,Jn as H,I,Je as J,vt as K,qn as L,Kn as M,Yn as N,Xn as O,bt as P,St as Q,Qn as R,zn as S,Zn as T,Et as U,es as V,ts as W,ns as X,Tt as Y,N as Z,j as _,me as $,xt as aa,ss as ba,Ke as ca,Ye as da,kt as ea,rs as fa,os as ga,F as ha,is as ia,Ct as ja,Xe as ka,as as la,_t as ma,It as na,ds as oa,cs as pa,us as qa,ls as ra,gs as sa,jt as ta,ms as ua,hs as va,ps as wa,fs as xa,ws as ya,ys as za,y as Aa,Rs as Ba,We as Ca,Gt as Da,$s as Ea,Y as Fa,vs as Ga,Ht as Ha};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{h as N}from"./chunk-R4JUKTDO.js";import{C as k,M as C,O as R,R as v,sa as G,sb as D,ub as I,v as b}from"./chunk-UEE3RZN4.js";import{f as w,g as _}from"./chunk-KU3YHPWZ.js";var l=(e,t,i=new Set)=>{let n=e.nameOf.get(t);if(n!==void 0)return n;if(i.has(t))return t;i.add(t);for(let[o,s]of e.superseded){if(s!==t||G(o,t,c=>e.nodeLabel.get(c)))continue;let u=l(e,o,i);if(u!==o)return u}return t};function F(e,t){let i=e.stale(t);if(i==="fresh")return;if(i==="orphaned")return"orphaned \u2014 no live source evidences this item";let n=[],o=new Map;for(let s of e.derivesInto(t))o.set(String(s.props.source_id),s);for(let[s,u]of o){let c=e.heads.get(s);if(c==null)continue;let g=D(e,t,s);if(g!==null){g.stale&&n.push(`DERIVES pin ${s} broke \u2014 ${I(s,g)}`);continue}if(c===u.props.source_cid)continue;let S=e.convChains.get(s)?.chain;S&&S.includes(String(u.props.source_cid))||n.push(`DERIVES pin ${s}@${String(u.props.source_cid).slice(0,19)} broke \u2014 the source head moved`)}for(let s of e.edgesFrom(t)){if(s.type===_.DERIVES||!e.superseded.has(s.dst))continue;let u=e.tipOf(s.dst);if(e.superseded.has(u)){n.push(`${s.type} pin \u2192 ${l(e,s.dst)} \u2014 target retired`);continue}let c=P(e,s.dst,u);n.push(c.length>0?`${l(e,s.dst)} updated: ${c.map(g=>g.field).join(", ")}`:`${s.type} pin \u2192 ${l(e,s.dst)} \u2014 target superseded`)}return n.length>0?n.join("; "):"stale \u2014 a pinned dependency moved"}function P(e,t,i){let n=e.getNode(t)?.content??{},o=e.getNode(i)?.content??{},s=c=>c===void 0?"":Array.isArray(c)?c.map(String).join(" \xB7 "):typeof c=="object"?JSON.stringify(c):String(c),u=[];for(let c of[...new Set([...Object.keys(n),...Object.keys(o)])].sort())JSON.stringify(n[c])!==JSON.stringify(o[c])&&u.push({field:c,old:s(n[c]),new:s(o[c])});return u}function L(e,t){let i=[];for(let{cid:n}of e.byLabel(w.SCENARIO))e.superseded.has(n)||e.edgesFrom(n).some(o=>o.type===_.BELONGS_TO&&e.tipOf(o.dst)===t)&&i.push(n);return i}function j(e,t){let i=[],n=[],o=[],s=[],u=[],c=[],g=L(e,t),S=new Set(g),p=(d,f)=>{let r=F(e,f);return r===void 0?d:{...d,stale:!0,stale_reason:r}};for(let d of g){let f=e.getNode(d)?.content??{};i.push(p({ref:l(e,d),title:String(f.title??""),case_type:String(f.case_type??""),intent:String(f.intent??"")},d));for(let r of e.edgesInto(d)){if(r.type!==_.AUTOMATES||e.superseded.has(r.src))continue;let a=e.getNode(r.src)?.content??{},y=e.edgesFrom(r.src).filter(m=>m.type===_.VERIFIES&&!e.superseded.has(m.dst)).map(m=>l(e,m.dst));n.push(p({ref:l(e,r.src),title:String(a.title??""),automates:l(e,d),check:a.check,verifies:y,...typeof a.target=="string"?{target:a.target}:{},...typeof a.app=="string"?{app:a.app}:{}},r.src)),u.push(r.src)}for(let r of e.edgesFrom(d))r.type!==_.EXERCISES||e.superseded.has(r.dst)||s.push({scenario:l(e,d),ac:l(e,r.dst)})}for(let{cid:d}of e.byLabel(w.AC)){if(e.superseded.has(d))continue;let f=e.edgesFrom(d).find(x=>x.type===_.SCOPED_TO);if(!f)continue;let r=e.tipOf(f.dst),a=e.superseded.has(r)&&e.nodeLabel.get(r)===w.SCENARIO&&e.edgesFrom(r).some(x=>x.type===_.BELONGS_TO&&e.tipOf(x.dst)===t);if(!(r===t||S.has(r)||a))continue;let m=e.getNode(d)?.content??{},O={ref:l(e,d),text:String(m.text??""),kind:String(m.kind??""),scope:r===t?"use-case":l(e,r)};o.push(a?{...O,stale:!0,stale_reason:`orphaned: its scenario ${l(e,r)} was retired \u2014 re-scope it (scoped_to_repoints) to a live scenario or the use case if it still holds; a redesign retires it with its scenario otherwise`}:p(O,d)),c.push(d)}let E=[],h=new Set;for(let d of[t,...g,...u,...c])for(let f of e.retractedEdgesTouching(d))h.has(f.ecid)||(h.add(f.ecid),E.push({type:f.type,src:l(e,f.src),dst:l(e,f.dst),at:f.retraction.at,...f.retraction.reason?{reason:f.retraction.reason}:{}}));return{scenarios:i,tests:n,acs:o,exercises:s,retracted_edges:E}}function $(e,t,i){let n=b(e,t,i);return n===null?null:n.toString("utf8")}function A(e,t){let i=t.split(`
|
|
3
|
+
`).map(o=>o.replace(/^\d+\| /,"")),n=[];for(let o of e.split(`
|
|
4
|
+
`)){let s=o.trim();if(s.length===0)continue;let u=i.find(c=>c.includes(s));u!==void 0&&!n.includes(u.trim())&&n.push(u.trim())}return n.length>0?n.join(`
|
|
5
|
+
`):{removed:!0}}function T(e,t,i,n,o){let s=o?{requested:o}:{};if(n!==void 0&&n.trim().length>0)return{kind:"user-directive",text:n.trim(),...s};let u=[i,...j(t,i).acs.map(p=>t.resolve(p.ref)?.tip??"")].filter(Boolean),c=[],g=new Set;for(let p of u){let E=new Map;for(let d of R(t,p))for(let f of t.derivesInto(d))E.set(String(f.props.source_id),f);let h=(d,f,r)=>{let a=String(f.props.anchor),y=`${d}\0${a}`;if(g.has(y)||a==="img#whole")return;g.add(y);let m=$(e,t,String(f.props.source_cid)),O=m===null?null:k(m,a);if(O===null)return;let x=$(e,t,r);c.push({source_id:d,anchor:a,old_anchor_text:O,new_anchor_text:x===null?{removed:!0}:A(O,x)})};for(let[d,f]of E){let r=t.heads.get(d);if(r==null)continue;let a=D(t,p,d);if(a!==null){for(let y of a.failed)y.props.source_cid!==r&&h(d,y,r);continue}r!==f.props.source_cid&&h(d,f,r)}}let S;for(let[p,E]of t.superseded){if(E!==i||t.nodeLabel.get(p)!==w.USECASE)continue;let h=P(t,p,i);h.length>0&&(S=h);break}return{kind:"source-change",changes:c,...S?{uc_updated:S}:{},...s}}function U(e,t,i,n,o){let s=j(t,i);if(s.scenarios.length===0&&s.tests.length===0&&s.acs.length===0)return;let u=T(e,t,i,n,o);if(!(!o&&u.kind==="source-change"&&u.changes.length===0&&!u.uc_updated))return{prior_design:s,change_delta:u}}function K(e,t){if(!t.force||t.resume||!t.useCase||t.priorDesign!==void 0||t.changeDelta!==void 0)return t;let i=C(e),n=i.resolve(v(i,t.useCase));if(!n||i.nodeLabel.get(n.tip)!==w.USECASE||N(i,n.tip)===null)return t;let o=U(e,i,n.tip);return o?{...t,priorDesign:o.prior_design,changeDelta:o.change_delta}:t}export{F as a,j as b,U as c,K as d};
|
|
@@ -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-6U7ID777.js";import{c as g}from"./chunk-RFHMDQXZ.js";import{a as E}from"./chunk-I5NSJBOZ.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{y as n}from"./chunk-I6OQISK4.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{r as i,s as u}from"./chunk-NC7D7GOM.js";async function d(e){if(!e.isInteractive)return{recovered:!1};if(f(e.creds,e.authOnly===!0))return{recovered:!1};let{SingleShotApp:a}=await import("./SingleShotApp-4TDXZEUA.js"),{ScrollbackProvider:t}=await import("./scrollback-GGNBDFQV.js"),{render:r}=await import("./build-5ZN47FAT.js"),o=await import("./react-QWOAB3TB.js"),n={current:null},l={current:!1},{waitUntilExit:c,unmount:s}=r(o.default.createElement(t,null,o.default.createElement(a,{resultRef:n,mode:"login",loginCompleteRef:l,...e.authOnly?{authOnly:!0}:{}})),{exitOnCtrlC:!1});u(()=>s()),await c();try{process.stdin.setRawMode?.(!1)}catch{}return process.stdout.write("\x1B[?25h"),l.current?{recovered:!0}:e.onCancel==="return"?{recovered:!1,cancelled:!0}:(i(0,"Startup gate cancelled"),{recovered:!1})}function f(e,a=!1){let t=e.getActiveProfile(),r=e.getDefaultEnv();if(!t||!!!(e.loadBasicAuth(t,r)||e.loadCredentials(t,r)))return!1;if(a)return!0;let n=e.loadProfileConfig(t,r)??{};return!!n.project_id&&!!n.folder_id}export{d as a,f as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as s}from"./chunk-KU3YHPWZ.js";import{existsSync as y,mkdirSync as N,writeFileSync as G}from"fs";import{dirname as O,join as C}from"path";import{spawnSync as l}from"child_process";import{appendFileSync as m,existsSync as i,readFileSync as u}from"fs";import{dirname as f,join as a}from"path";var p="# kane-cli context store: shared through a location, never merged with git",d=".context/",h=new Set([".context",".context/","/.context","/.context/"]);function g(e,t={}){let n=t.env??process.env;if(n.KANE_CONTEXT_GITIGNORE==="0")return{outcome:"skipped"};try{if(!x(e))return{outcome:"not-a-repo"};let r=a(e,".gitignore");if(E(r))return{outcome:"already",path:r};if((t.checkIgnore??(o=>I(o,n)))(e)===!0)return{outcome:"already"};let c="";if(i(r)){let o=u(r);o.length>0&&o[o.length-1]!==10&&(c=`
|
|
3
|
+
`)}return m(r,`${c}${p}
|
|
4
|
+
${d}
|
|
5
|
+
`),{outcome:"added",path:r}}catch(r){return{outcome:"failed",reason:r instanceof Error?r.message:String(r)}}}function x(e){let t=e;for(;;){if(i(a(t,".git")))return!0;let n=f(t);if(n===t)return!1;t=n}}function E(e){return i(e)?u(e,"utf8").split(/\r?\n/).some(t=>h.has(t.trim())):!1}function I(e,t){let n=l("git",["-C",e,"check-ignore","-q",".context"],{env:{...t,GIT_TERMINAL_PROMPT:"0"},stdio:"ignore",timeout:5e3});return n.error||n.status===null?null:n.status===0?!0:n.status===1?!1:null}function L(e){let t=C(e,"meta.json");return y(t)?{created:!1}:(N(e,{recursive:!0}),G(t,JSON.stringify({schema:s,canonicalizer:"v1"},null,2)+`
|
|
6
|
+
`),{created:!0,gitignore:g(O(e))})}export{g as a,L as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R}from"./chunk-HCBYKLMW.js";import{a as h,d as k}from"./chunk-
|
|
2
|
+
import{a as R}from"./chunk-HCBYKLMW.js";import{a as h,d as k}from"./chunk-33DWJV67.js";import{a as A}from"./chunk-6YGTRKDT.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(A(),1);var a=p(R(),1),g=(0,e.createContext)(null),T=250;function C({children:d}){let[s,x]=(0,e.useState)([]),m=(0,e.useRef)(0),f=(0,e.useRef)([]),c=(0,e.useRef)(null),u=(0,e.useRef)(new Map),b=(0,e.useRef)(0),S=(0,e.useRef)(0);(0,e.useEffect)(()=>{for(let r=S.current;r<s.length;r++){let i=s[r];b.current=i.seq;let t=u.current.get(i.seq);if(t){u.current.delete(i.seq);for(let n of t)n()}}S.current=s.length},[s]),(0,e.useEffect)(()=>()=>{c.current&&clearTimeout(c.current)},[]);let P=(0,e.useMemo)(()=>{let r=()=>{c.current&&(clearTimeout(c.current),c.current=null);let t=f.current;t.length!==0&&(f.current=[],x(n=>[...n,...t]))},i=()=>{c.current||(c.current=setTimeout(()=>{c.current=null,r()},0))};return{append:(t,n)=>{let o=++m.current;if(n){let l=u.current.get(o)??[];l.push(n),u.current.set(o,l)}f.current.push({id:`sb-${o}`,seq:o,content:t}),i()},flush:()=>{r();let t=m.current;return t===0||b.current>=t?Promise.resolve():new Promise(n=>{let o=!1,l=()=>{o||(o=!0,clearTimeout(q),n())},q=setTimeout(l,T),v=u.current.get(t)??[];v.push(l),u.current.set(t,v)})}}},[]);return(0,a.jsxs)(g.Provider,{value:P,children:[s.length>0&&(0,a.jsx)(k,{items:s,children:r=>(0,a.jsx)(h,{children:r.content},r.id)}),d]})}function I(){let d=(0,e.useContext)(g);if(!d)throw new Error("useScrollback must be used within a ScrollbackProvider. Wrap this Ink render() root in <ScrollbackProvider>. Never render <Static> directly \u2014 push via append().");return d}export{C as a,I as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{j as f,xa as a}from"./chunk-UEE3RZN4.js";import{join as m}from"path";function Q(n,o){if(!f(o))throw new Error(`proposal id ${JSON.stringify(o)} is not a plain name (letters, digits, . _ - after a letter or digit)`);return m(n,"proposals",o,"proposal.json")}import{appendFileSync as g,readdirSync as l,readFileSync as u,rmSync as S,statSync as y}from"fs";import{join as t}from"path";import{randomBytes as E}from"crypto";var j="pending-facts.ndjson",h=/^pending-facts\.(\d+)-[0-9a-f]+\.ndjson$/,N=()=>`pending-facts.${process.pid}-${E(4).toString("hex")}.ndjson`;function v(n,o=1/0){let r=[];for(let i of l(n)){let s=h.exec(i);if(!s)continue;let e=Number(s[1]),c=Date.now()-y(t(n,i)).mtimeMs;if(e!==process.pid&&a(e)&&c<o){r.push(i);continue}let p=u(t(n,i),"utf8").split(`
|
|
3
|
+
`).filter(d=>d!=="");p.length>0&&g(t(n,j),p.join(`
|
|
4
|
+
`)+`
|
|
5
|
+
`),S(t(n,i))}return r}export{Q as a,j as b,h as c,N as d,v as e};
|
|
@@ -0,0 +1,15 @@
|
|
|
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-ZZP5SHUV.js";import{mkdirSync as Ne,writeFileSync as Be}from"fs";import{join as H}from"path";var Ee="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: ${Ee}`;let e=/WebSocket error: \S*\/kane-cli\S* (5\d\d)\b/.exec(t)?.[1];return e?`remote browser: HPS answered HTTP ${e} to the connect (on a tunnel run: the tunnel service failed); run again, and report it to the platform team if it persists`:null}var ve={baseMs:500,maxMs:3e4},j=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??ve,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 Se,closeSync as Ce,existsSync as $e,fsyncSync as Pe,mkdirSync as Te,openSync as Ie,readFileSync as De}from"fs";import{dirname as Me,join as Oe}from"path";var Le="pending-deltas.ndjson",Q=class{path;deltas=new Map;committed=new Set;refusedBySeq=new Map;tornTail=!1;constructor(e){this.path=Oe(e,Le),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(!$e(this.path))return;let e=De(this.path,"utf8");this.tornTail=e.length>0&&!e.endsWith(`
|
|
4
|
+
`);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){Te(Me(this.path),{recursive:!0});let r=this.tornTail?`
|
|
6
|
+
`:"";Se(this.path,r+JSON.stringify(e)+`
|
|
7
|
+
`),this.tornTail=!1;try{let i=Ie(this.path,"r+");try{Pe(i)}finally{Ce(i)}}catch{}}};function U(t){return t.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function fe(t){return new Set([...U(t.name),...U(t.heading??""),...U(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 Fe(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=U(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 "${Fe(d,g,s)}"`).join(`
|
|
8
|
+
`);return{ok:!1,error:`--focus "${i}" matches ${g.length} screens; name one:
|
|
9
|
+
${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
|
+
${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 Ae=1e3,X=2;function re(t){return t.code==="completed"||t.code==="budget"?0:t.code.startsWith("failed:")?1:3}function at(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 lt(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 H(t,"explorations",e)}function We(t,e,r){return H(Je(t,e),"runs",r)}var je="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 Qe(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 ut(t,e){let r={state:null,remark:null,exitCode:X,explorationId:t.explorationId??null,runId:null,runDir:null,committed:0,pending:0,lastSeq:0,stopReason:null,complete:!1},i=(n,o=X,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&&Qe(n)?i(je):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 j({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,X,R("controller_outdated",S))}r.runId=d;let C=We(e.baseDir,s,d);r.runDir=C,Ne(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=H(C,"starting-projection.json");Be(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<Ae))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})+`
|
|
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:H(C,"evidence"),starting_projection:ne})+`
|
|
13
|
+
`));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 E=await k.flush(V?Math.min(1e3,e.drainTimeoutMs??1e3):e.drainTimeoutMs??6e4);r.committed=k.committedThisRun,r.pending=E,r.lastSeq=g.lastCommitted,r.stopReason=c?.stop_reason??null,r.complete=!!c?.complete&&E===0;let v=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 v(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 v(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),E>0&&(r.error=`${E} delta(s) were not committed and are lost with this run`),r)}if(k.state==="fatal"||E>0){let n=k.state==="fatal"&&k.fatal?`committing stopped: ${k.fatal.code}: ${k.fatal.reason}; `:"",o=R("commit_failed",`${E} delta(s) could not be committed`),u=await v(o,"commit_failed");return r.stopReason="commit_failed",i(`${n}${E} 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 v(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 v(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 v(u,"runner_exited"),x=f?` (ending it failed: ${f})`:" (the run is ended)";return i(`${n}${o?`
|
|
15
|
+
${o}`:""}${x}; a new run continues from the map`,X,u)}let ee=c.stop_reason,W=we(c.remark,ee,`the runner ended the run (${ee}) without a remark`),le=await v(W,ee);return le?i(`every delta is committed but ending the run failed: ${le}`,1,W):(r.state="stopped",r.remark=W,r.exitCode=re(W),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,at as b,lt as c,je as d,Qe as e,ut as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{f as r}from"./chunk-KU3YHPWZ.js";var f=[r.SCENARIO,r.AC,r.TEST];function s(o){let t=o.byLabel(r.USECASE).map(e=>e.cid).filter(e=>!o.superseded.has(e)).sort();return{usecases:t,nodes:new Set(t),footprint:{edges:[],usecases:t,sources:[...o.heads.keys()].sort(),names:[...o.names.keys()].sort(),generation:null}}}function c(o,t,e){let n=o.resolve(e)?.tip;if(n!==void 0){t.add(n);for(let d of o.edgesFrom(n))t.add(d.dst);for(let d of o.edgesInto(n))t.add(d.src)}}var i=o=>({...o.footprint,nodes:[...o.nodes].sort()});function u(o){return i(s(o))}function a(o,t){let e=s(o);return c(o,e.nodes,t),i(e)}function F(o){let t=s(o);for(let[e,n]of o.trust)n==="derived"&&!o.superseded.has(e)&&t.nodes.add(e);return i(t)}function m(o){let t=s(o);for(let e of f)for(let n of o.byLabel(e))o.superseded.has(n.cid)||t.nodes.add(n.cid);return i(t)}function l(o,t){let e=s(o),n=o.heads.get(t);return n&&c(o,e.nodes,n),i(e)}export{u as a,a as b,F as c,m as d,l as e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as g}from"./chunk-
|
|
2
|
+
import{b as g}from"./chunk-I6OQISK4.js";import{readFileSync as o,writeFileSync as h,mkdirSync as u,readdirSync as a,unlinkSync as s,existsSync as l,chmodSync as f}from"fs";import{join as n,dirname as P}from"path";var d=class{baseDir;profilesDir;configFile;constructor(t=g){this.baseDir=t,this.profilesDir=n(t,"profiles"),this.configFile=n(t,"config.json")}readConfig(){try{return JSON.parse(o(this.configFile,"utf-8"))}catch{return{}}}writeConfig(t){u(this.baseDir,{recursive:!0,mode:448}),h(this.configFile,JSON.stringify(t,null,2)+`
|
|
3
3
|
`),f(this.configFile,384)}getActiveProfile(){return this.readConfig().active_profile??null}setActiveProfile(t){let i=this.readConfig();i.active_profile=t,this.writeConfig(i)}getDefaultEnv(){return this.readConfig().default_env??"prod"}setDefaultEnv(t){let i=this.readConfig();i.default_env=t,this.writeConfig(i)}credentialsPath(t,i){return n(this.profilesDir,t,i,"credentials")}clientPath(t,i){return n(this.profilesDir,t,i,"client.json")}basicAuthPath(t,i){return n(this.profilesDir,t,i,"basic-auth")}profileConfigPath(t,i){return n(this.profilesDir,t,i,"profile-config.json")}saveProfileConfig(t,i,r){let e=this.loadProfileConfig(t,i)??{};this.writeSecure(this.profileConfigPath(t,i),{...e,...r})}loadProfileConfig(t,i){try{return JSON.parse(o(this.profileConfigPath(t,i),"utf-8"))}catch{return null}}writeSecure(t,i){try{u(P(t),{recursive:!0,mode:448}),h(t,JSON.stringify(i,null,2)+`
|
|
4
4
|
`),f(t,384)}catch(r){let e=r instanceof Error?r.message:String(r);process.stderr.write(`[auth] Failed to save credentials: ${e}
|
|
5
5
|
`)}}saveCredentials(t,i,r){this.writeSecure(this.credentialsPath(t,i),r)}loadCredentials(t,i){try{return JSON.parse(o(this.credentialsPath(t,i),"utf-8"))}catch{return null}}saveClient(t,i,r){this.writeSecure(this.clientPath(t,i),r)}loadClient(t,i){try{return JSON.parse(o(this.clientPath(t,i),"utf-8"))}catch{return null}}getActiveCredentials(){let t=this.getActiveProfile();if(!t)return{credentials:null,profile:null,env:null};let i=this.getDefaultEnv();return{credentials:this.loadCredentials(t,i),profile:t,env:i}}saveBasicAuth(t,i,r){this.writeSecure(this.basicAuthPath(t,i),r)}loadBasicAuth(t,i){try{return JSON.parse(o(this.basicAuthPath(t,i),"utf-8"))}catch{return null}}deleteBasicAuth(t,i){try{s(this.basicAuthPath(t,i))}catch{}}resolveAuth(){let t=this.getActiveProfile();if(!t)return null;let i=this.getDefaultEnv(),r=this.loadBasicAuth(t,i);return r?{method:"basic",...r,profile:t,env:i}:this.loadCredentials(t,i)?{method:"oauth",profile:t,env:i}:null}listProfiles(){let t=[];try{for(let i of a(this.profilesDir)){let r=n(this.profilesDir,i);try{for(let e of a(r)){let c=n(r,e),v=l(n(c,"credentials")),p=l(n(c,"client.json")),y=l(n(c,"basic-auth"));(v||p||y)&&t.push({profile:i,env:e})}}catch{}}}catch{}return t}deleteProfile(t,i){try{s(this.credentialsPath(t,i))}catch{}if(this.getActiveProfile()===t){let r=this.readConfig();delete r.active_profile,this.writeConfig(r)}}deleteProfileFull(t,i){if(i){try{s(this.credentialsPath(t,i))}catch{}try{s(this.clientPath(t,i))}catch{}try{s(this.basicAuthPath(t,i))}catch{}try{s(this.profileConfigPath(t,i))}catch{}}else try{let r=n(this.profilesDir,t);for(let e of a(r)){try{s(n(r,e,"credentials"))}catch{}try{s(n(r,e,"client.json"))}catch{}try{s(n(r,e,"basic-auth"))}catch{}try{s(n(r,e,"profile-config.json"))}catch{}}}catch{}}};export{d as a};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{S as G,T as I,U as O,V as _}from"./chunk-432ZOE42.js";import{a as S}from"./chunk-R7KXAISS.js";import{a as u}from"./chunk-73Y6T2UK.js";import{Ia as N}from"./chunk-UEE3RZN4.js";import{existsSync as M}from"fs";var q=new Set(["interactive","agent","ci","override"]);function B(t){return t.mode!=null&&!q.has(t.mode)?{error:`design: --mode must be interactive | agent | ci | override, got '${t.mode}'`}:t.strength!=null&&t.strength!=="pairwise"&&t.strength!=="3-wise"?{error:`design: --strength must be pairwise | 3-wise, got '${t.strength}'`}:t.max!=null&&(!Number.isInteger(t.max)||t.max<1)?{error:"design: --max must be a positive integer"}:!t.useCase&&!t.resume?{error:"design: --use-case is required (or --resume <sid> \u2014 the session remembers its use-case)"}:{useCase:t.useCase,max:t.max,strength:t.strength,mode:t.mode,force:t.force,resume:t.resume,plan:t.plan,message:t.message,phase:t.phase,allowUnreviewed:t.allowUnreviewed,because:t.because,changeDelta:t.changeDelta,priorDesign:t.priorDesign,...t.repinsKept?{repinsKept:!0}:{},statement:t.statement}}async function Z(t){let p=async(e,r)=>{if(t.mode!=="agent")return process.stderr.write(e+`
|
|
3
|
+
`),2;let{makeHeadlessIO:i,agentRefusal:d}=await import("./headless-io-FFM5T6KL.js");return d(i("ndjson","design"),e,r)};if(t.mode!=null&&!["interactive","agent","ci","override"].includes(t.mode)){let{makeHeadlessIO:e,agentRefusal:r}=await import("./headless-io-FFM5T6KL.js");return r(e("ndjson","design"),`design: --mode must be interactive | agent | ci | override, got '${t.mode}'`,"MODE_USAGE")}let l=t.json===!0;{let{jsonModeRefusal:e}=await import("./headless-io-FFM5T6KL.js"),r=e("design",t.mode,l);if(r!==null)return process.stderr.write(`${r}
|
|
4
|
+
`),2}let h=B(t);if("error"in h)return p(h.error);let s=h;if(s.useCase?.startsWith("sha256:"))try{let[{openGraph:e},{expandUseCaseRef:r}]=await Promise.all([import("./readmodel-INMP6MNW.js"),import("./use-case-ref-NE4X4MZN.js")]);s.useCase=r(e(u(process.cwd())),s.useCase)}catch{}{let{validateResumeMessage:e}=await import("./headless-io-FFM5T6KL.js"),r=e(s,"design");if(r)return p(r)}{let{gateStructuredFlags:e}=await import("./structured-answers-EQ2AP3F7.js"),r=e(t,"design");if(r)return p(r,"STRUCTURED_FLAGS_USAGE")}if(!M(u(process.cwd())))return p("error: no context store here (run `kane-cli context ingest` + `kane-cli context extract` first)","NO_STORE");{let e=O(u(process.cwd()));if(e){if(t.mode!=="agent")return p(`error: ${e.text}
|
|
5
|
+
next: ${e.remedy}`,e.code);let{makeHeadlessIO:r}=await import("./headless-io-FFM5T6KL.js"),i=r("ndjson","design");return i.event(_(e)),i.done(2,"refused")}}if(s.useCase&&!t.allowUnreviewed)try{let[{openGraph:e},{consentCanStart:r,designEntryGate:i},{peekSession:d}]=await Promise.all([import("./readmodel-INMP6MNW.js"),import("./trust-gate-AT2XBWN4.js"),import("./sessions-CFV7FOIT.js")]),y;try{y=s.resume?d(u(process.cwd()),s.resume)?.use_case:void 0}catch{y=void 0}let o=i(e(u(process.cwd())),{useCase:s.useCase,resuming:!!s.resume,sessionUseCase:y});if(o){let b=r(o),T=s.mode??"interactive";if(b&&T==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY){let{createInterface:x}=await import("readline/promises"),m=x({input:process.stdin,output:process.stderr}),g=(await m.question(`design: ${o.detail}
|
|
6
|
+
Design against it anyway? (y/N) `)).trim().toLowerCase();if(m.close(),g!=="y"&&g!=="yes")return process.stderr.write(`aborted \u2014 approve it first: ${o.reviewCmd}
|
|
7
|
+
`),2;s.allowUnreviewed=!0}else if(t.mode==="agent"){let{makeHeadlessIO:x}=await import("./headless-io-FFM5T6KL.js"),m=x("ndjson","design");m.event({type:"error",code:o.code,message:`design: ${o.detail}`,next:[o.reviewCmd]});let g=`kane-cli design tests --use-case ${s.useCase} --mode agent --allow-unreviewed`;return m.event({type:"done",status:"refused",exit_code:2,next:b?[o.reviewCmd,g]:[o.reviewCmd]}),2}else return process.stderr.write(`design: ${o.detail} (${o.reviewCmd})
|
|
8
|
+
`),2}}catch(e){process.env.KANE_DEBUG&&process.stderr.write(`trust gate skipped: ${String(e)}
|
|
9
|
+
`)}let n=null,f=null;try{if(!s.mode&&!process.stdin.isTTY)return process.stderr.write(`design: no TTY \u2014 pass an explicit --mode agent|ci|override to run headless
|
|
10
|
+
`),2;let e=s.mode??"interactive";if(e==="interactive"){if(!process.stdin.isTTY||!process.stdout.isTTY)return process.stderr.write(`design: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
11
|
+
`),2;let{bindDesignInteractive:a}=await import("./interactive-bind-5EJQUGKI.js");return await a(s)}let{runAgent:r}=await import("./bridge-T6QMYKED.js"),{makeInterruptGuard:i}=await import("./interrupt-guard-QETBPINI.js"),{baseUrlAdvisory:d}=await import("./turn-preflight-LHYLRL7G.js"),{makeHeadlessIO:y,resolveEncoding:o,guardedChannels:b}=await import("./headless-io-FFM5T6KL.js"),{withStructuredNext:T,prepareStructuredResume:x}=await import("./structured-answers-EQ2AP3F7.js");n=T(y(o(e,l),"design"));let m=await G(u(process.cwd()));m&&(o(e,l)==="ndjson"?n.event(I(m)):n.progress(m.text));let g=n,k=a=>{g.out(a),g.event({type:"note",text:a})},{telemetryBootstrap:Y,telemetryEnvName:H}=await import("./bootstrap-TY5RANJ7.js"),v=Y({verb:"design",mode:e,contextRoot:u(process.cwd()),env:H(),resumeSid:s.resume,write:!0,longSession:!0});f=a=>v.end(a);let c=x({opts:t,reader:S(u(process.cwd())).sessions(),verb:"design"});if(c.kind==="refuse")return n.out(c.error),e==="agent"&&n.event({type:"error",message:c.error,code:c.code}),await v.end({exit_code:2}),e==="agent"?n.done(2,"refused"):2;let D;if(c.kind==="apply"){for(let a of c.notes)k(a);if(c.matchedQids.length>0){k(`applying ${c.matchedQids.length} structured answer(s) from --answer to the paused session's pending questions`);for(let a of c.matchedQids)n.event({type:"panel_resolved",id:a,by:"user",via:"flag"})}c.statement&&(D=[s.message,c.statement].filter(Boolean).join(`
|
|
12
|
+
|
|
13
|
+
`))}let R=d();R&&k(R);let C=i(r,a=>n.out(a)),j=b(n,()=>C.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let a=e==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY?async E=>{let{createInterface:L}=await import("readline/promises"),A=L({input:process.stdin,output:process.stdout});try{return/^y(es)?$/i.test((await A.question(`${E} [y/N] `)).trim())}finally{A.close()}}:void 0,{headlessDesign:P}=await import("./design-headless-FZONCKHW.js"),{localSite:K}=await import("./store-site-KA2DNBGY.js"),$=u(process.cwd()),w=await P({...s,mode:e,...D!==void 0?{message:D}:{},...a?{confirmRetarget:a}:{}},K($,S($)),{out:j.out,emit:E=>{t.onEvent?.(E),j.emit(E)},progress:g.progress,channel:o(e,l)==="ndjson"},{agent:C.agent,telemetry:v});if(C.interrupted()&&w!==3)return n.out("interrupted \u2014 no session saved"),await v.end({exit_code:130}),n.done(130);if(w===1&&n.out(v.supportFooter()),await v.end({exit_code:w}),w!==0)return n.done(w);let U=await z($,s.useCase,s.resume);return U.length>0?n.done(w,void 0,U):n.done(w)}finally{C.dispose()}}catch(e){if(e instanceof N)return f&&await f({exit_code:2}).catch(()=>{}),n?(n.event(_({code:e.code,text:e.message,remedy:e.remedy})),n.done(2,"refused")):(process.stderr.write(`error: ${e.message}
|
|
14
|
+
next: ${e.remedy}
|
|
15
|
+
`),2);f&&await f({exit_code:1}).catch(()=>{});let r=e instanceof Error?e.message:String(e);n?.event({type:"error",message:`error: design failed: ${r}`});let i=n?d=>n.out(d):d=>process.stderr.write(d+`
|
|
16
|
+
`);return i(`error: design failed: ${r}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&e instanceof Error&&e.stack&&i(e.stack),i('hint: the full trace is in the file named on the "trace:" line at the start of this run'),n?n.done(1):1}}async function z(t,p,l){try{let[{openGraph:h},{peekSession:s},{awaitingOfUseCase:n},{shellArg:f}]=await Promise.all([import("./readmodel-INMP6MNW.js"),import("./sessions-CFV7FOIT.js"),import("./stream-warnings-GEQKKJU7.js"),import("./shell-arg-FN3MT5U7.js")]),e=p??(l?s(t,l)?.use_case:void 0);if(!e)return[];let r=h(t);return[...n(r,e)].map(([i,d])=>({cmd:`kane-cli context review --approve ${f(r.displayNameOf(i)??i.slice(0,19))} --mode agent`,why:`approves the criterion ${d.size===1?"1 test checks":`${d.size} tests check`}`}))}catch{return[]}}export{B as a,Z as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
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-W3OVSDBN.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};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
var p=1;function f(e,t=!1){return e==="agent"||t&&(e==="override"||e==="ci")?"ndjson":"human"}function m(e,t,n){return!n||t==="override"||t==="ci"?null:`${e}: --json ${t==="agent"?"--mode agent writes NDJSON already":"it needs --mode override or --mode ci"}`}function v(){return!!(process.stdin.isTTY&&process.stdout.isTTY)}var g=/^(∷ |· |→ |✓ |✗ |… )/;function c(e){return e===0?"complete":e===2?"refused":e===3?"paused":e===130?"interrupted":"error"}function x(e,t,n={stdout:r=>process.stdout.write(r),stderr:r=>process.stderr.write(r)}){let r=!1,i=s=>{if(e!=="ndjson"||r)return;s.type==="done"&&(r=!0);let{type:u,...o}=s;n.stdout(JSON.stringify({type:u,v:1,verb:t,...o})+`
|
|
3
|
+
`)};return{encoding:e,out:e==="ndjson"?()=>{}:s=>n.stdout(s+`
|
|
4
|
+
`),progress:e==="ndjson"?()=>{}:s=>n.stderr(s.replace(g,"").replace(/…$/,"")+`
|
|
5
|
+
`),event:i,done:(s,u,o,d)=>(i({type:"done",status:u??c(s),exit_code:s,...d,...o!==void 0&&o.length>0?{next:o}:{}}),s),retag:s=>{t=s}}}var l=8*1024;function E(e,t){return e.message==null?null:e.message.trim()?e.resume?Buffer.byteLength(e.message,"utf8")>l?`${t==="extract"?"extract":"design"}: --message is over 8KB \u2014 the agent would silently drop it; shorten the statement`:null:`${t==="extract"?"extract":"design"}: --message only rides a resume \u2014 pair it with --resume <sid> (a fresh run takes its direction from the sources)`:`${t==="extract"?"extract":"design"}: --message is empty \u2014 say what you want the agent to know`}function y(e,t,n,r){return e.event({type:"error",message:t,...n?{code:n}:{},...r?{remedy:r}:{}}),e.done(2,"refused")}var a=class extends Error{constructor(n,r,i){super(r);this.code=n;this.remedy=i}};function S(e,t,n){return{out:r=>{t()&&n.test(r)||e.out(r)},emit:r=>{t()&&r.type==="error"&&n.test(String(r.message??""))||e.event(r)}}}export{p as a,f as b,m as c,v as d,x as e,l as f,E as g,y as h,a as i,S as j};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{g as f}from"./chunk-47WQBG5I.js";import{a as l}from"./chunk-KM3YCIDV.js";import{i as u}from"./chunk-AVI5H4UM.js";import{a as c}from"./chunk-JQSLUGD4.js";import{f as s}from"./chunk-KF4DKXSS.js";import{c as p}from"./chunk-DPGOAFKF.js";import{b as i}from"./chunk-SWMTXMKB.js";async function E(n,o,e,t){let m=async()=>{let r=t.auth??{...await s(i),...t.telemetry?.spawnEnv()??{}};return u(e.sid!==void 0&&n.resume===void 0?{...n,sessionId:e.sid}:n,{store:o.store,pendingReconcilePlan:a=>o.dir===null?null:f(o.dir,a),agent:t.agent,tracePath:c,credentials:i,onIngestRefusal:l,preflightTurn:t.preflightTurn??(()=>p(r)),ask:async()=>[],review:async a=>new Map(a.map(d=>[d.temp_ref,{resolution:"skipped"}])),confirmStale:async()=>!1,out:e.out,...e.note?{note:e.note}:{},emit:e.emit,progress:e.progress,isTTY:!1,auth:r,...t.telemetry?{telemetry:t.telemetry}:{},...t.probe?{probe:t.probe}:{},...t.matchUnreviewed?{matchUnreviewed:!0}:{},...e.onSummary?{onSummary:e.onSummary}:{}})};if(!e.channel)return m();let{runWithChannel:g}=await import("./run-channel-63SVP5OI.js");return g({event:r=>e.emit(r)},m)}export{E as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{h as c,i as d}from"./chunk-
|
|
2
|
+
import{h as c,i as d}from"./chunk-A7RJQJNT.js";import{readFileSync as l}from"fs";import{resolve as p}from"path";var i="KANE_CLI_DEVICE_CONFIG";function w(e=process.env){return(e[i]??"").trim()!==""}function v(e=process.env){let r=(e[i]??"").trim();if(!r)throw new Error(`a real-device run needs ${i} to name the run's device-config.json, and it is not set.`);let t=p(r),n;try{n=JSON.parse(l(t,"utf8"))}catch(o){throw new Error(`${i}: cannot read the device config at ${t}: ${o.message}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new Error(`${i}: ${t} is not a device config object.`);return{path:t,entry:n}}function s(e){if(typeof e=="number")return String(e);if(typeof e=="string")return e.trim()||void 0}function N(e,r=process.env){let{path:t,entry:n}=v(r),o=s(n.platform_name)?.toLowerCase();if(o!==e.platform)throw new Error(`${i}: ${t} describes ${o?`a "${o}" device`:"no platform_name"}, but the test file's target is ${e.platform}.`);if(!e.hasCredentials)throw new Error("a real-device run needs your TestMu AI username and access key, and none were found. Run kane-cli login, or pass --username and --access-key.");let a=s(n.device_name),f=s(n.platform_version),u=s(n.app);return{device:{platform:e.platform,target:e.platform,device_config_path:t},...a?{deviceName:a}:{},...f?{osVersion:f}:{},...u?{app:u}:{}}}function _(e){return`Connecting to a real ${d(c(e))} device\u2026`}function h(e){let r=e.deviceName??"any device";return e.osVersion?`${r} (${e.osVersion})`:r}function m(e){return/[*?^$[\]{}|\\]/.test(e)}function g(e){return e?.name&&!m(e.name)?e.name:void 0}function D(e){return g(e)||e?.model}function R(e,r,t){let n=D(r),o=r?.os_version?`${d(c(e))} ${r.os_version}`:void 0,a=t?`App ${t.replace(/^lt:\/\//,"")}`:void 0;return`Running on: ${["Real device",n,o,a].filter(Boolean).join(" \xB7 ")}`}function C(e,r,t){let n=!1;return o=>{n||o.type!=="run_start"||o.child_id||(n=!0,t(R(e,o.environment?.device,r)))}}export{w as a,N as b,_ as c,h as d,m as e,g as f,D as g,C as h};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
async function a(n){let{render:e}=await import("./build-5ZN47FAT.js");return await new Promise(t=>{let{unmount:r,waitUntilExit:o}=e(n(u=>{r(),t(u)}),{stdout:process.stderr,exitOnCtrlC:!0});o().then(()=>t(null)).catch(()=>t(null))})}export{a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as i}from"./chunk-REKHAN53.js";function s(n){if(n.optionIndex===0)return"proceed";if(n.optionIndex===1)return"decline";if(n.optionIndex!==void 0)return null;let e=(n.freeText??"").trim().toLowerCase();return e==="proceed"||e==="yes"||e==="y"?"proceed":e==="decline"||e==="no"||e==="n"?"decline":null}function c(n){let e=new Map;if(!n||n.length===0)return{given:e};let r=i({answer:n});if(!r.ok)return{given:e,unreadable:r.error};for(let t of r.value?.answers??[]){let o=s(t);e.set(t.target,o??{invalid:t.optionIndex!==void 0?String(t.optionIndex+1):t.freeText??""})}return{given:e}}export{c as a};
|