@testmuai/kane-cli 0.9.0 → 0.10.0-rc.3
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-6NZGMNHL.js +2 -0
- package/dist/ChromeProfilePicker-M4WXOB5O.js +2 -0
- package/dist/CliFeedbackPrompt-6MJA7DF6.js +2 -0
- package/dist/CliUploadProgress-6NLS7XHH.js +2 -0
- package/dist/ConfigView-O4WKZ5PU.js +2 -0
- package/dist/EvidenceViewOffer-WIEWCZUP.js +2 -0
- package/dist/FolderPicker-AF7ZMV3M.js +2 -0
- package/dist/InfoBox-D7GGZJU4.js +2 -0
- package/dist/LinksBox-DXP66H3H.js +2 -0
- package/dist/ProfilesView-TWOY5PVC.js +2 -0
- package/dist/ProjectPicker-OBYHJJLU.js +2 -0
- package/dist/SaveSessionPrompt-7XSHS4NL.js +2 -0
- package/dist/ScrollbackTap-4SPXGFMU.js +2 -0
- package/dist/SingleShotApp-XQUDR36R.js +2 -0
- package/dist/SummaryBox-IA2KS6GT.js +2 -0
- package/dist/TestMdRunView-LS2QUFWR.js +2 -0
- package/dist/TestrunEvidenceTable-HNDVJDIF.js +2 -0
- package/dist/WhoamiView-SNL75TEF.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-UI4ABEIX.js +2 -0
- package/dist/assurance-job-FFSSS4XV.js +7 -0
- package/dist/auth-7Z54TMQQ.js +2 -0
- package/dist/{binary-LVHXED3O.js → binary-THPLXCOD.js} +1 -1
- package/dist/bind-4XWK3DG2.js +2 -0
- package/dist/bootstrap-6ACT4ALI.js +2 -0
- package/dist/bridge-T6QMYKED.js +2 -0
- package/dist/build-5ZN47FAT.js +2 -0
- package/dist/catalog-MYPS2BXY.js +2 -0
- package/dist/{changelog-N5AZHXOS.js → changelog-SU674BVE.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-2DYHAP4E.js +2 -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-OHOJSADN.js → chunk-36N3EHW5.js} +1 -1
- package/dist/chunk-3BSYOCSW.js +3 -0
- package/dist/chunk-3E4ZO73O.js +6 -0
- package/dist/chunk-3F5FMH76.js +2 -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-3OQW2GTA.js +2 -0
- package/dist/chunk-3QICDXY5.js +5 -0
- package/dist/chunk-3RJHXOZH.js +3 -0
- package/dist/{chunk-Q5RDCSYM.js → chunk-3YTCKCBG.js} +1 -1
- package/dist/chunk-42PALMW2.js +4 -0
- package/dist/chunk-44B6THYK.js +2 -0
- package/dist/chunk-457Y5TEC.js +19 -0
- package/dist/chunk-47WQBG5I.js +6 -0
- package/dist/chunk-4I7YN6YY.js +3 -0
- package/dist/chunk-4IEQNX7F.js +2 -0
- package/dist/chunk-4LTHDJ3D.js +2 -0
- package/dist/chunk-4QFTHUJA.js +34 -0
- package/dist/chunk-4QTH7VYE.js +2 -0
- package/dist/chunk-4YW767UV.js +47 -0
- package/dist/chunk-54XA5MZH.js +2 -0
- package/dist/chunk-5AKJPYUW.js +11 -0
- 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-J3BGYSMD.js → chunk-6DZX5HLZ.js} +8 -8
- package/dist/{chunk-YBAVDT3G.js → chunk-6EB5VRAN.js} +1 -1
- package/dist/chunk-6NFOH4AC.js +4 -0
- package/dist/chunk-6PIIUAZF.js +3 -0
- package/dist/chunk-6UVIY56J.js +2 -0
- package/dist/chunk-72KYMWQ5.js +2 -0
- package/dist/chunk-72RC7JSA.js +21 -0
- package/dist/chunk-734ORT6O.js +4 -0
- package/dist/chunk-77ZZQJLX.js +2 -0
- package/dist/chunk-7AET4JKQ.js +2 -0
- package/dist/chunk-7DFBOVUB.js +2 -0
- package/dist/chunk-7HMSMAUG.js +29 -0
- package/dist/chunk-7HO4NX5W.js +1 -0
- package/dist/chunk-7KX2BHKG.js +2 -0
- package/dist/{chunk-ULGZPRKU.js → chunk-7NCJMWFX.js} +1 -1
- package/dist/chunk-7NPTL66J.js +2 -0
- package/dist/chunk-7RWP4Y3H.js +2 -0
- package/dist/{chunk-PCKIANML.js → chunk-7SY34IIL.js} +1 -1
- package/dist/chunk-7V4BQSSV.js +2 -0
- package/dist/chunk-7XBNMOH4.js +6 -0
- package/dist/{chunk-SOCHN2PY.js → chunk-7YT4TTKL.js} +1 -1
- package/dist/{chunk-C25M2J5Q.js → chunk-ACMBMZDQ.js} +1 -1
- package/dist/chunk-AEWNWAXW.js +18 -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-AVSMXDTX.js +2 -0
- package/dist/chunk-AZLNLHUA.js +4 -0
- package/dist/{chunk-HGFWIBVF.js → chunk-B7ZX5HEN.js} +5 -5
- package/dist/{chunk-66MOZKD2.js → chunk-BSRSXYDZ.js} +1 -1
- package/dist/chunk-BWXLZS5O.js +2 -0
- package/dist/chunk-BY65QAAN.js +4 -0
- package/dist/chunk-C2RUDJ46.js +2 -0
- package/dist/chunk-C5Z7MQE6.js +2 -0
- package/dist/{chunk-WDMUPK6I.js → chunk-C62QWG4B.js} +1 -1
- package/dist/chunk-C6HI6Y3S.js +2 -0
- package/dist/chunk-CB4ARIHR.js +2 -0
- package/dist/{chunk-7WXMV3O3.js → chunk-CCP4X75B.js} +1 -1
- package/dist/chunk-CGITGJ3I.js +4 -0
- package/dist/chunk-CM4CHYSN.js +2 -0
- package/dist/{chunk-ZXY4P76I.js → chunk-CUXY6KQ2.js} +1 -1
- package/dist/chunk-D36V5OX6.js +2 -0
- package/dist/chunk-D756UWY2.js +6 -0
- package/dist/chunk-D7TKE7LK.js +2 -0
- package/dist/{chunk-UWXDURAB.js → chunk-D7U2M26S.js} +1 -1
- package/dist/chunk-DBMW3VUN.js +4 -0
- package/dist/chunk-DDZLCAEO.js +5 -0
- package/dist/chunk-DJC7NTLA.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-DZOYYWOW.js +2 -0
- package/dist/chunk-E6KSRQXL.js +8 -0
- package/dist/chunk-EBPRPNSA.js +2 -0
- package/dist/chunk-ECPFI75W.js +5 -0
- package/dist/chunk-EECDDDSB.js +3 -0
- package/dist/chunk-EF47KRUK.js +2 -0
- package/dist/chunk-ETZMFRD6.js +2 -0
- package/dist/chunk-EZN7CF45.js +4 -0
- package/dist/{chunk-CNUCP6DK.js → chunk-F22K3RRX.js} +1 -1
- package/dist/{chunk-WRSIKZ2V.js → chunk-F5NHG7VB.js} +1 -1
- package/dist/{chunk-DHJSM5DT.js → chunk-FCD3NYOM.js} +1 -1
- package/dist/chunk-FIP5L6LV.js +9 -0
- package/dist/chunk-FOJHSG5M.js +6 -0
- package/dist/chunk-FSYOTRMC.js +2 -0
- package/dist/chunk-FWDUVFS6.js +26 -0
- package/dist/chunk-FWUPJORV.js +6 -0
- package/dist/chunk-GFLB2SHW.js +2 -0
- package/dist/chunk-GMTHZUZ3.js +2 -0
- package/dist/chunk-GQRU3B54.js +1397 -0
- package/dist/chunk-GRURFGBP.js +2 -0
- package/dist/chunk-GXKY5A46.js +9 -0
- package/dist/chunk-HAW5WEKT.js +13 -0
- package/dist/chunk-HCJ2N3XB.js +12 -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-YWYORBY3.js → chunk-HJMCXSUJ.js} +1 -1
- package/dist/chunk-HK62JVQM.js +3 -0
- package/dist/{chunk-5GUD3CIH.js → chunk-HQ2E2XCU.js} +1 -1
- package/dist/chunk-I2MC6VVX.js +2 -0
- package/dist/chunk-I4RVVBG3.js +10 -0
- package/dist/chunk-I4WXALQR.js +2 -0
- package/dist/chunk-ICLUC44J.js +2 -0
- package/dist/{chunk-6HU5M2DS.js → chunk-IGEAET7M.js} +1 -1
- package/dist/{chunk-GCISXCDU.js → chunk-IINZZ4BZ.js} +1 -1
- package/dist/chunk-IJ2AHSWW.js +2 -0
- package/dist/{chunk-CSNJPD2J.js → chunk-IUQOG7Z5.js} +3 -3
- package/dist/chunk-IZ65ZPWY.js +3 -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-JZP3Y4ZM.js +2 -0
- package/dist/chunk-KF4DKXSS.js +2 -0
- package/dist/chunk-KGNE5CIM.js +2 -0
- package/dist/chunk-KM3YCIDV.js +3 -0
- package/dist/{chunk-HAYV4D2I.js → chunk-KODJVOCN.js} +1 -1
- package/dist/chunk-KU3YHPWZ.js +2 -0
- package/dist/{chunk-M3UAZTDK.js → chunk-KXHJMAZU.js} +2 -2
- package/dist/chunk-L5DALV5N.js +2 -0
- package/dist/chunk-LAOTVZHV.js +6 -0
- package/dist/chunk-LCSJ7GOG.js +2 -0
- package/dist/{chunk-DWMESHFI.js → chunk-LIGTP3A3.js} +1 -1
- package/dist/chunk-LKQFG4RW.js +5 -0
- package/dist/{chunk-EBLXHOE3.js → chunk-LQQNPMOD.js} +1 -1
- package/dist/chunk-LSDJOVWW.js +6 -0
- package/dist/{chunk-C6S2RPZA.js → chunk-LUR7JFPP.js} +1 -1
- package/dist/chunk-LUZBGTYB.js +2 -0
- package/dist/chunk-LX2I4JEH.js +2 -0
- package/dist/{chunk-7GAHJZLH.js → chunk-M43WH5DQ.js} +1 -1
- package/dist/chunk-MEKPGQAM.js +21 -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-NC7D7GOM.js +21 -0
- package/dist/chunk-NIVFEACM.js +2 -0
- package/dist/chunk-NLZZLANH.js +4 -0
- package/dist/{chunk-XT7XA4DN.js → chunk-NXAJBSIF.js} +1 -1
- package/dist/chunk-NXRF7FFS.js +2 -0
- package/dist/chunk-NZ6AV2TA.js +4 -0
- package/dist/chunk-O3HHTKZ5.js +6 -0
- package/dist/chunk-OCDBTAYS.js +12 -0
- package/dist/chunk-OFSDB7B4.js +3 -0
- package/dist/{chunk-Q5CINJYL.js → chunk-OGFU4YY4.js} +1 -1
- package/dist/chunk-OJ33Q6DU.js +2 -0
- package/dist/chunk-P2ZQDQDB.js +2 -0
- package/dist/{chunk-KXEE6VCA.js → chunk-P3JXJ4BW.js} +1 -1
- package/dist/chunk-PAWQ4AKN.js +2 -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-QBYENBMB.js +2 -0
- package/dist/chunk-QDFY5GGO.js +5 -0
- package/dist/chunk-QDXKEOKI.js +16 -0
- package/dist/{chunk-6VY62QC2.js → chunk-QENCC2ZS.js} +1 -1
- package/dist/chunk-QI5RZ7LL.js +2 -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-RF37IJNN.js +2 -0
- package/dist/{chunk-KWEOLPBJ.js → chunk-RFEON5GN.js} +1 -1
- package/dist/chunk-RHGW7B5Q.js +2 -0
- package/dist/chunk-RPRXRKKR.js +2 -0
- package/dist/{chunk-EOA6YPES.js → chunk-RTVHJ23A.js} +4 -4
- package/dist/chunk-RTVWQK7I.js +2 -0
- package/dist/chunk-RX6776AI.js +5 -0
- package/dist/{chunk-F7NSSQYZ.js → chunk-SGPAM5DZ.js} +1 -1
- package/dist/chunk-SMTBOSEJ.js +2 -0
- package/dist/chunk-SMXABALN.js +2 -0
- package/dist/{chunk-TM7VRLWS.js → chunk-SXRHKXSE.js} +1 -1
- package/dist/chunk-TNORODUF.js +2 -0
- package/dist/chunk-TU42YZOJ.js +6 -0
- package/dist/chunk-TU7TVFBK.js +2 -0
- package/dist/chunk-TW5AA5A7.js +8 -0
- package/dist/chunk-UEE3RZN4.js +14 -0
- package/dist/chunk-URH4FX3H.js +2 -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-4BZOG6PE.js → chunk-V7USCQWO.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-VRIZDOO5.js +2 -0
- package/dist/{chunk-DOOI2JBD.js → chunk-VSVWNRI2.js} +1 -1
- package/dist/chunk-VUFIL5VR.js +6 -0
- package/dist/chunk-VX657KIK.js +2 -0
- package/dist/chunk-VXGN3IV7.js +2 -0
- package/dist/chunk-VZ4A6WMK.js +97 -0
- package/dist/chunk-VZJ6LUXX.js +2 -0
- package/dist/{chunk-RWSOZPJQ.js → chunk-W4QSZNMB.js} +1 -1
- package/dist/chunk-W54OT2FU.js +9 -0
- package/dist/{chunk-BL3SJDCG.js → chunk-W6HZF56M.js} +1 -1
- package/dist/chunk-W72ACCFL.js +27 -0
- package/dist/chunk-W7FLXW6Q.js +5 -0
- package/dist/chunk-WAOUE7MP.js +9 -0
- package/dist/chunk-WEIPY3CI.js +16 -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-K3IQEL7R.js → chunk-WXJCJL5L.js} +1 -1
- package/dist/chunk-WZXPF3BI.js +2 -0
- package/dist/chunk-XB6BJPDL.js +2 -0
- package/dist/{chunk-4FHK4LKQ.js → chunk-XLEGGC4Y.js} +1 -1
- package/dist/chunk-XMPTFXPW.js +5 -0
- package/dist/chunk-XQMWHPZI.js +3 -0
- package/dist/{chunk-75MMTNPB.js → chunk-XRNQSXOM.js} +2 -2
- package/dist/{chunk-2PKME4VT.js → chunk-XZGEN4NU.js} +4 -4
- package/dist/chunk-XZYA7DNH.js +2 -0
- package/dist/{chunk-OIUV3ISA.js → chunk-Y6Y6RAY4.js} +1 -1
- package/dist/chunk-Y7E5L42F.js +3 -0
- package/dist/{chunk-GFBAK7WQ.js → chunk-YAW6JW6D.js} +7 -7
- package/dist/chunk-YDPTSDIJ.js +2 -0
- package/dist/chunk-YDSGXB25.js +2 -0
- package/dist/chunk-YGRULEZY.js +2 -0
- package/dist/chunk-YHFZFV3A.js +22 -0
- package/dist/chunk-YIKF4ERQ.js +375 -0
- package/dist/chunk-YLXWAY7D.js +2 -0
- package/dist/{chunk-UA2QDAWT.js → chunk-YPFQ4UGF.js} +1 -1
- package/dist/{chunk-4CYBXJIA.js → chunk-YQ5C6UDG.js} +1 -1
- package/dist/chunk-Z55KBMYV.js +2 -0
- package/dist/chunk-ZAFJQ3SM.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-X2A6CC6B.js → chunk-ZTRRFG52.js} +1 -1
- package/dist/chunk-ZU4W2QGM.js +3 -0
- package/dist/committer-JGY66PFM.js +2 -0
- package/dist/config-754B73XK.js +2 -0
- package/dist/controller-client-PB3AZAGG.js +2 -0
- package/dist/cover-cmd-NBNZCR6C.js +2 -0
- package/dist/{credentials-QD32Y7K7.js → credentials-F7DYLVWY.js} +1 -1
- package/dist/{deps-bundle-OI7JJ22L.js → deps-bundle-PW3WEQJ7.js} +1 -1
- package/dist/{deps-resolve-ZOALDS6H.js → deps-resolve-SQYVN76L.js} +1 -1
- package/dist/descriptor-7T32VRMB.js +2 -0
- package/dist/design-chat-F3OEZPNJ.js +2 -0
- package/dist/design-committer-TRYP3LOZ.js +2 -0
- package/dist/design-headless-OTHYOX3E.js +2 -0
- package/dist/design-remote-2BEGCVCX.js +3 -0
- package/dist/device-env-CHFRRV6W.js +2 -0
- package/dist/dispatch-DVQ3H7EJ.js +2 -0
- package/dist/doctor-XY26Z35T.js +2 -0
- package/dist/docx-convert-6IZO5P5K.js +2 -0
- package/dist/{dossier-7HVC6BNK.js → dossier-NROC2MCY.js} +1 -1
- package/dist/evidence-P6FFKC7B.js +2 -0
- package/dist/evidence-presentation-YYTIDCBS.js +2 -0
- package/dist/evolve-cmd-WWOB3QJR.js +2 -0
- package/dist/evolve-remote-WLVY3QID.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-OP5I5W3O.js +12 -0
- package/dist/explain-cmd-VYAANFFZ.js +4 -0
- package/dist/explore-K5YBGHK6.js +2 -0
- package/dist/explore-context-tty-RZ7D2TBV.js +2 -0
- package/dist/explore-entry-EKXJ67BD.js +6 -0
- package/dist/explore-live-2YVRAQZO.js +5 -0
- package/dist/explore-run-tty-D47FGPX7.js +5 -0
- package/dist/extract-bind-W2NET364.js +14 -0
- package/dist/extract-chat-M65NWGUK.js +2 -0
- package/dist/extract-cmd-FTFLETOP.js +6 -0
- package/dist/extract-headless-G6W6JQ27.js +2 -0
- package/dist/feeder-NY45UFJK.js +2 -0
- package/dist/folder-flags-KKIH654K.js +2 -0
- package/dist/gaps-cmd-OIDDLRYL.js +3 -0
- package/dist/gate-7AKRPRMK.js +2 -0
- package/dist/gate-WISOUTHQ.js +2 -0
- package/dist/{generate-headless-6WMJYNI6.js → generate-headless-RURIEKVS.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-4G2AK4Y2.js +8 -0
- package/dist/ingest-remote-SSLUHQVG.js +2 -0
- package/dist/ink-screen-RZ7QDIUI.js +2 -0
- package/dist/install-ZVBHPXGP.js +2 -0
- package/dist/interactive-bind-SI2ZS55Q.js +26 -0
- package/dist/interactive-remote-J56EWJGA.js +65 -0
- package/dist/interrupt-guard-QETBPINI.js +2 -0
- package/dist/lane-AQYRIW24.js +2 -0
- package/dist/lattice-auth-6FEVSR7E.js +2 -0
- package/dist/lifecycle-cmd-HJ37LTXE.js +2 -0
- package/dist/list-cmd-6XL2FYLQ.js +3 -0
- package/dist/list-commands-5DCCKU3L.js +2 -0
- package/dist/list-remote-LXPQNXYN.js +15 -0
- package/dist/locks-cmd-JJ2QNTNY.js +2 -0
- package/dist/logical-ids-RXAQJZ3T.js +2 -0
- package/dist/login-flow-WEK3E476.js +2 -0
- package/dist/maintenance-cmd-BXXHP36K.js +2 -0
- package/dist/mobile-prompts-CECJ5UY2.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-PDVYMTY5.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-A3ID7JFA.js +3 -0
- package/dist/phase-seed-LCJ4WSYV.js +2 -0
- package/dist/pipeline-GX3LKPI5.js +2 -0
- package/dist/prepare-target-FMT6QFHZ.js +2 -0
- package/dist/pull-cmd-UPFQYUND.js +2 -0
- package/dist/pull-route-FWBXJMR7.js +2 -0
- package/dist/readmodel-INMP6MNW.js +2 -0
- package/dist/real-device-run-X7JJWOIK.js +2 -0
- package/dist/reconcile-cmd-JBH365JL.js +5 -0
- package/dist/reconcile-deps-TWJ3FTSU.js +2 -0
- package/dist/reconcile-remote-BCX6SWFC.js +13 -0
- package/dist/recording-banner-YKBAL6UB.js +2 -0
- package/dist/registry-VQC757MJ.js +2 -0
- package/dist/remote-entry-X6JMPC2K.js +2 -0
- package/dist/remote-mode-FDPA7EWG.js +4 -0
- package/dist/remote-words-YVB66R3F.js +2 -0
- package/dist/require-project-folder-MLMEQJYP.js +2 -0
- package/dist/resolve-run-intent-PC7TQZUL.js +2 -0
- package/dist/resolver-EID34LQE.js +2 -0
- package/dist/revert-FHOBLZWF.js +2 -0
- package/dist/review-cmd-EUHFLFMY.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-SJCRTL7O.js +2 -0
- package/dist/run-startup-gate-YO66G6LS.js +2 -0
- package/dist/run-test-md-BLNBK4MH.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-S7WZBUCN.js +26 -0
- package/dist/sessions-remote-IWHWIQ2T.js +3 -0
- package/dist/shell-arg-FN3MT5U7.js +2 -0
- package/dist/{skill-installer-32YYMM4N.js → skill-installer-MAVQY6GW.js} +1 -1
- package/dist/spawner-C7NLLM4F.js +2 -0
- package/dist/store-MSA7KASS.js +2 -0
- package/dist/store-choice-3OJCV26J.js +2 -0
- package/dist/store-guard-OOSDLMEC.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-RDFDMVKQ.js +2 -0
- package/dist/sync-setup-RBRDUV7Q.js +2 -0
- package/dist/{sync-setup-ui-RC727VK6.js → sync-setup-ui-XITPGSO4.js} +2 -2
- package/dist/tcg-generate-KIECTZ2C.js +2 -0
- package/dist/test-definition-VRI4YIYL.js +2 -0
- package/dist/testmd-actions-CMAG6HWI.js +2 -0
- package/dist/testmd-sync-UPAA5UMD.js +2 -0
- package/dist/tms-client-NXAB6VJD.js +2 -0
- package/dist/token-refresh-KP3AYMYK.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-M5JHHNZA.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-Q737BE65.js +2 -0
- package/dist/{view-cmd-3WHG6MVB.js → view-cmd-XSNL5DGI.js} +4 -3
- package/dist/walk-session-SHGYLFRB.js +2 -0
- package/dist/with-telemetry-PM2HVN2B.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
|
+
var i=new Set,c=[];function g(){let e=new Set;for(let t of i){e.add(t);let o=JSON.stringify(t).slice(1,-1);e.add(o),e.add(encodeURIComponent(t)),e.add(encodeURIComponent(t).replace(/%20/g,"+")),e.add(Buffer.from(t,"utf8").toString("base64"))}let n=[...i];for(let t of n)for(let o of n)t!==o&&e.add(Buffer.from(`${t}:${o}`,"utf8").toString("base64"));c=[...e].filter(t=>t.length>=4).sort((t,o)=>o.length-t.length)}function T(e){let n=!1;for(let t of e)typeof t!="string"||t.length<4||i.has(t)||(i.add(t),n=!0);n&&g()}function p(e){if(c.length===0||!e)return e;let n=e;for(let t of c)n.includes(t)&&(n=n.split(t).join("***"));return n}var m=/\.(json|ndjson|har|log|txt|yaml|yml|md|html|js|ts|py|csv|xml)$/i,E=64*1024*1024;async function S(e){if(c.length===0)return[];let{promises:n}=await import("fs"),{join:t}=await import("path"),o=[],a=async f=>{let l;try{l=await n.readdir(f,{withFileTypes:!0})}catch{return}for(let s of l){let r=t(f,s.name);if(s.isDirectory()){await a(r);continue}if(!(!s.isFile()||!m.test(s.name)))try{if((await n.stat(r)).size>E)continue;let d=await n.readFile(r,"utf8"),u=p(d);u!==d&&(await n.writeFile(r,u),o.push(r))}catch{}}};return await a(e),o}export{T as a,p as b,S as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as V,e as W,f as Q}from"./chunk-3JLEDSG5.js";import{d as I,j as T}from"./chunk-7XBNMOH4.js";import{Ea as $,M as y}from"./chunk-UEE3RZN4.js";import{d as N}from"./chunk-KU3YHPWZ.js";import{d as h,m as S}from"./chunk-4I7YN6YY.js";function B(e,n,t){let i=S();return e===void 0||e===n?null:e==="extract"||e==="design"?{code:"WRONG_VERB",message:i.text("WRONG_VERB",{sid:t,verb:e}),next:[h(i,"next.resume_session",{verb:e,sid:t},{why:`this session belongs to a ${e} run`})]}:{code:"WRONG_VERB",message:`error: session ${t} belongs to a ${e} run \u2014 this command cannot resume it`,next:[]}}function X(e){return P(e)!==null}function P(e){let n=e,t=K(n);if(t<0)return null;let i=n[t].data?.tool_calls??[],r=i.map(o=>o.id),a=n.slice(t+1);if(r.length===0||a.some(o=>o?.kind!=="tool_result"))return null;let s=new Set(a.map(o=>o.data?.tool_call_id));if(!r.every(o=>s.has(o)))return null;let c=a.find(o=>o.data?.status==="ok"&&o.data?.payload?.accepted===!0);if(!c)return null;let _=i.find(o=>o.id===c.data?.tool_call_id),w=_?.arguments;return{name:typeof _?.name=="string"?_.name:"",arguments:w!==null&&typeof w=="object"?w:{}}}function Y(e){let n=e,t=K(n);if(t<0)return!1;let i=n.slice(t+1);if(i.some(s=>s?.kind!=="tool_result"))return!1;let r=new Set(i.map(s=>s.data?.tool_call_id)),a=(n[t].data?.tool_calls??[]).filter(s=>!r.has(s.id));return a.length===1&&a[0].name==="ask_user"}function K(e){for(let n=e.length-1;n>=0;n--)if(e[n]?.kind==="assistant_turn")return n;return-1}function ce(e){return{id:e.id,text:e.question,risk:["high","med","low"].includes(e.risk)?e.risk:"med",rationale:e.rationale,options:e.options.map(n=>({label:n.label,detail:n.description??""})),recommended_index:e.recommendedOptionIndex,allow_free_text:e.allowFreeText,kind:e.kind,consequence:e.consequence,evidence_count:e.evidence_count,multi_select:e.multiSelect}}function G(e){return{id:e.id,header:e.kind??"question",question:e.text,kind:e.kind??"clarify",multiSelect:e.multi_select??!1,options:e.options.map((n,t)=>({id:`o${t}`,label:n.label,description:n.detail||void 0})),recommendedOptionIndex:e.recommended_index,risk:e.risk,rationale:e.rationale,consequence:e.consequence??"",evidence_count:e.evidence_count,allowFreeText:e.allow_free_text}}function de(e,n,t){let i=n.pending.questions.map(G),r=W(e.state.pending.answers).filter(a=>n.pending.questions.some(s=>s.id===a.id&&Q(a,s)));e.save({agent_state:n.agent_state,pending:{questions:i,proposals:n.pending.proposals??[],...r.length>0?{answers:r}:{}},assumed:n.assumed.map(a=>({questionId:a.question_id,optionId:a.option_id,flagged:!0,eventId:`assumed:${n.sid}:${a.question_id}`}))}),t?.(),e.release(),I(e.state.sid)}function pe(e,n,t,i){if(t.name.startsWith("finalize"))return{call:t.name,event_id:`${e}:ckpt:${i}`};let r=t.arguments.ops;return Array.isArray(r)&&r.length>0&&n?{call:t.name,event_prefix:`chatop:${n}:s${i}:`}:null}function ge(e,n,t){if(!t)return!0;let i=y(e).appliedEvents;if(t.event_id!==void 0)return i.has(t.event_id)||n.includes(t.event_id);let r=t.event_prefix??"";for(let a of i)if(a.startsWith(r))return!0;return n.some(a=>a.startsWith(r))}function fe(e){return`the agent's last ${e==="finalize_design"?"design phase was":e.startsWith("finalize")?"proposal was":"changes were"} not saved before the session stopped \u2014 it is sent again`}function me(e){return e===1?"your last message was sent again":`your last ${e} messages were sent again`}function U(e,n,t){return t?.call!=="finalize_design"||t.event_id===void 0?!1:y(e).appliedEvents.has(t.event_id)&&!n.includes(t.event_id)}function _e(){return"the agent's last design phase was saved before the session stopped, but not all of its files \u2014 it is sent again to write them"}function he(e){return{persist(n,t){let i=e.seqBase(),r={seq:n.seq+i,turn_id:n.turn_id,at:n.at,agent_state_schema:n.agent_state_schema,delta_items:n.delta_items,binding:n.binding,usage_total:n.usage_total,...n.base_fingerprint!==void 0?{base_fingerprint:n.base_fingerprint}:{}},a={applied_events:[...new Set([...e.handle.state.applied_events,...e.store.sessions().appliedEvents(e.handle.state.sid)])].sort(),held_receipts:e.peekHeldReceipts?.()??[],pending:{questions:n.at!=="turn"?(n.pending_questions??[]).map(G):[],proposals:e.stagedProposals?.()??[]},parent_asks:[],read_basis:e.readBasis(),corpus_cursor:e.corpusCursor(),store_watermark:e.store.serialize(e.store.head()),...(()=>{let s=n.at==="turn"&&e.awaits?P(n.delta_items):null,c=s?e.awaits(s,r.seq):null;return c?{awaits:c}:{}})(),...t?.sentUnread?.length?{sent_unread:[...t.sentUnread]}:{},...(()=>{let s=e.ingestRegistry?e.ingestRegistry():e.handle.state.ingest_registry??[],c=e.ingestSchedule?e.ingestSchedule():e.handle.state.ingest_schedule??[];return{...s.length?{ingest_registry:s}:{},...c.length?{ingest_schedule:c}:{}}})()};return e.store.sessions().persistCheckpoint(e.handle,r,a,{...e.onSoftCap?{onSoftCap:e.onSoftCap}:{},...e.onStat?{onStat:e.onStat}:{},...e.now?{now:e.now}:{}})}}}function D(e,n){return!e.checkpoint&&!n&&e.agent_state.items.length===0}var m=class extends Error{constructor(t,i,r=[]){super(`${t}: ${i}`);this.code=t;this.next=r}};function we(e){return[...new Set(["extract-agent","design-agent","owner",...e?[e.id]:[]])]}async function ke(e,n,t,i={}){let r=i.deps??{},a=S(),s=e.sessions().resume(n);try{let c=s.state.checkpoint??null,_=e.sessions().hasBase(n),w=!c&&s.state.agent_state.items.length>0;if(D(s.state,_))throw new m("SESSION_KEPT_NOTHING",`session ${n} kept nothing to resume \u2014 no checkpoint, no base and no agent snapshot; start the run again`);if(!c&&!_||w)throw new m("SESSION_V1",a.text("SESSION_V1",{sid:n}),[h(a,"next.abandon_session",{sid:n},{why:"abandon the pre-checkpoint session, then start a fresh run"})]);!c&&_&&r.onWarn?.(a.text("note.chain_recovered",{sid:n}));let o=e.sessions().loadCheckpoint(n);o.orphans.length>0&&e.sessions().gcOrphans(n,o.orphans),o.fallback&&r.onWarn?.(a.text("note.chain_truncated",{sid:n,at:o.fallback.resumableAt,lost:o.fallback.turnsLost}));let u=o.base;if(i.verb){let l=B(u.verb,i.verb,n);if(l)throw new m("WRONG_VERB",l.message,l.next)}if(i.useCase!==void 0&&i.useCase!==u.use_case&&!await(r.confirmRetarget?.(u.use_case,i.useCase)??!1))throw new m("RESUME_RETARGET_DECLINED",u.use_case?`session ${n} was designing ${u.use_case}; resuming onto ${i.useCase} needs an explicit retarget`:`session ${n} has no recorded use-case; adopting ${i.useCase} needs an explicit retarget`,u.use_case?[h(a,"next.resume_session",{verb:"design",sid:n},{why:`continue on ${u.use_case} (the session's own subject)`})]:[]);let g=o.kane,R=[],j=g?.read_basis??Object.fromEntries(Object.entries(s.state.read_basis));for(let[l,d]of Object.entries(j)){let p=t.heads.get(l)??null;p!==d&&R.push({subject:l,pinned:d,live:p})}u.uc_tip!==void 0&&r.liveUcTip!==void 0&&r.liveUcTip!==u.uc_tip&&R.push({subject:u.use_case??"use-case",pinned:u.uc_tip,live:r.liveUcTip}),r.locks?.reacquire?.(n);let v={...u.run_config,checkpoints:!0};delete v.resume;let x;if(o.pointer===null||o.agent===null)x=v;else{if(!o.agent.base_fingerprint)throw new m("CHECKPOINT_PROTOCOL",`session ${n}: chain carries no base fingerprint \u2014 cannot attest the seed rebuild`);x={...v,resend_open_ask:!0,resume:{schema:2,binding:o.agent.binding,base_fingerprint:o.agent.base_fingerprint,delta_items:o.agent.delta_items,last_seq:o.pointer.seq}}}let C=g?.pending.questions??[],E=l=>{let d=`resolveq:${n}:${l}`,p=`assumed:${n}:${l}`;return t.appliedEvents.has(d)||t.appliedEvents.has(p)||s.isApplied(d)||s.isApplied(p)},H=g&&C.length>0?C.filter(l=>!E(l.id)):s.state.pending.questions.filter(l=>!E(l.id)),A={redeliverReceipts:[],recommit:[]},k,b;if(g){let l={...g,applied_events:[...new Set([...g.applied_events,...s.state.applied_events])].sort()},d=u.verb==="design"&&U(e,l.applied_events,g.awaits)?g.awaits?.event_id:void 0,p;try{p=T(e,n,l,t,{...d?{resent:d}:{},verb:u.verb==="design"?"design":"extract",...u.use_case?{ucRef:u.use_case}:{},...N(String(o.agent?.binding?.template_version??""))>=8?{typedBlockers:!0}:{},...s.state.force_scope?.length?{ignoreGaps:new Set(s.state.force_scope)}:{},composeReceipt:(f,q,L)=>V(f,q,L),onNote:r.onWarn,...r.ownActors?{ownActors:r.ownActors}:{}})}catch(f){throw f instanceof $?new m("CHECKPOINT_PROTOCOL",`store reconciliation refused: ${f.message}`,[h(a,"next.abandon_session",{sid:n},{why:"abandon the session if the store was rebuilt"})]):f}A={redeliverReceipts:p.redeliverReceipts,recommit:p.recommit},b=p.prunedPending;let O=g.pending.proposals??[];k=(O.length>0?O:s.state.pending.proposals).filter(f=>!(typeof f.event_id=="string"&&t.appliedEvents.has(f.event_id))),(p.newlyApplied.length>0||p.prunedPending.length>0)&&s.reconcileSave({appliedEvents:p.newlyApplied,heldReceipts:[...s.state.held_receipts??[],...p.redeliverReceipts],pending:{questions:s.state.pending.questions,proposals:k,...s.state.pending.answers?.length?{answers:s.state.pending.answers}:{}}})}else{let l=s.state.pending.proposals;b=l.filter(d=>typeof d.event_id=="string"&&t.appliedEvents.has(d.event_id)),k=l.filter(d=>!(typeof d.event_id=="string"&&t.appliedEvents.has(d.event_id)))}return{kind:"v2",handle:s,base:u,view:o,kane:g,spawnConfig:x,drift:R,reconcile:A,questions:H,represent:k,prunedPending:b}}catch(c){throw s.release(),c}}export{B as a,X as b,P as c,Y as d,ce as e,de as f,pe as g,ge as h,fe as i,me as j,U as k,_e as l,he as m,D as n,m as o,we as p,ke as q};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as $}from"./chunk-MMBBQ4OZ.js";import{j as h}from"./chunk-
|
|
2
|
+
import{a as $}from"./chunk-MMBBQ4OZ.js";import{j as h}from"./chunk-XRNQSXOM.js";import{a as w}from"./chunk-RZ4F3BHX.js";import{b as v}from"./chunk-D36V5OX6.js";import{spawn as V,spawnSync as _}from"child_process";import{createServer as K}from"net";import{mkdirSync as g,openSync as W,readFileSync as I,renameSync as j,rmSync as x,statSync as Y,writeFileSync as M}from"fs";import{readFile as q}from"fs/promises";import{dirname as l,join as y}from"path";var G=[4723,4724,4725,4726,4727,4728,4729,4730],X={emulator:4750,simulator:4790},z=40,E=2e3,D=3e4,T=500,Ce=["emulator","simulator"];function Q(e){return y(v,"mobile",`appium-server-${e}.log`)}function m(){return y(v,"mobile","appium-servers.json")}function Z(){return y(v,"mobile","appium-servers.lock")}var ee=1e4,re=50;function C(e){let r=Z();try{g(l(r),{recursive:!0})}catch{return e()}let n=!1;for(let o=0;o<re;o++)try{g(r),n=!0;break}catch{try{Date.now()-Y(r).mtimeMs>ee&&x(r,{recursive:!0,force:!0})}catch{}ne(10)}try{return e()}finally{if(n)try{x(r,{recursive:!0,force:!0})}catch{}}}function ne(e){try{Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)}catch{}}function te(){try{let e=JSON.parse(I(m(),"utf8"));return Array.isArray(e)?e:[]}catch{return[]}}function oe(e){let r=m();g(l(r),{recursive:!0});let n=`${r}.tmp`;M(n,JSON.stringify(e,null,2)),j(n,r)}function se(e,r,n){return`Another mobile session is already running${n?` on ${n}`:""}. Wait for it to finish, or close the terminal running it.`}var A=class extends Error{constructor(n,o){super(n);this.port=o;this.name="DeviceBusyError"}};function ie(e){return w(e,{signal:AbortSignal.timeout(E)}).then(r=>r.ok,()=>!1)}async function ae(e,r){try{return(await w(`http://127.0.0.1:${e}/session/${r}`,{method:"DELETE",signal:AbortSignal.timeout(E)})).ok}catch{return!1}}function R(e){let r=e?.value;return Array.isArray(r)?r.map(n=>{let o=n??{},t=o.capabilities??o;return{...typeof o.id=="string"?{id:o.id}:{},caps:t}}):[]}async function ue(e){try{let r=await w(`http://127.0.0.1:${e}/sessions`,{signal:AbortSignal.timeout(E)});return r.ok?R(await r.json()):[]}catch{return[]}}var ce=["udid","appium:udid","deviceUDID","appium:deviceUDID","deviceName","appium:deviceName"];function L(){let e=r=>{try{let n=_("curl",["-s","--noproxy","*","--max-time","2",...r],{encoding:"utf8",timeout:5e3});return{ok:n.status===0,stdout:n.stdout??""}}catch{return{ok:!1,stdout:""}}};return{readState:()=>{try{let r=JSON.parse(I(m(),"utf8"));return Array.isArray(r)?r:[]}catch{return[]}},alive:b,getJson:r=>{let n=e([r]);if(n.ok)try{return JSON.parse(n.stdout)}catch{return}},del:r=>{let n=e(["-o","/dev/null","-w","%{http_code}","-X","DELETE",r]);return n.ok&&/^2\d\d$/.test(n.stdout.trim())}}}function Le(e,r={}){let n={...L(),...r},o=0;try{for(let t of n.readState()){if(!n.alive(t.pid))continue;let i=R(n.getJson(`http://127.0.0.1:${t.port}/sessions`));for(let s of i)s.id&&de(s.caps,e.udid,e.displayName)&&n.del(`http://127.0.0.1:${t.port}/session/${s.id}`)&&(o+=1)}}catch{}return o}function de(e,r,n){let o=[r,n].filter(t=>!!t).map(t=>t.toLowerCase());for(let t of ce){let i=e[t];if(typeof i=="string"&&o.includes(i.toLowerCase()))return!0}return!1}function pe(e,r,n){let o=W(n.logPath,"a"),t=V(e,r,{stdio:["ignore",o,o],detached:!0,env:{...process.env,...n.env}});return t.unref(),t.pid}async function le(e,r){for(let n=e;n<e+r;n++)if(await new Promise(t=>{let i=K();i.once("error",()=>t(!1)),i.once("listening",()=>i.close(()=>t(!0))),i.listen(n)}))return n;throw new Error(`No free port for the managed Appium server in ${e}-${e+r-1}.`)}function b(e){try{return process.kill(e,0),!0}catch{return!1}}function P(e){try{let r=_("ps",["-o","comm=","-p",String(e)],{encoding:"utf8",timeout:2e3});if(r.status!==0)return!1;let n=r.stdout.trim().toLowerCase();return n===""?!0:n.includes("node")||n.includes("kane")}catch{return!0}}function k(e){try{process.kill(e)}catch{}}async function me(){try{let e=JSON.parse(await q(m(),"utf8"));return Array.isArray(e)?e:[]}catch{return[]}}async function fe(e){let r=process.pid,n=e.filter(o=>o.owner===r);C(()=>{let o=[];for(let t of te())t.owner!==r&&(Se(t)?o.push(t):b(t.pid)&&k(t.pid));oe([...o,...n])})}function Se(e){return e.owner===void 0?!1:b(e.owner)&&P(e.owner)}function ve(){return{probe:ie,sessions:ue,deleteSession:ae,spawn:pe,freePort:le,alive:b,kill:k,readState:me,writeState:fe,owner:process.pid,depsEnv:e=>h().environment(e),bundleVersion:async e=>(await h().status(e)).version,nodeBinary:process.execPath,env:process.env,os:process.platform,now:()=>Date.now(),sleep:e=>new Promise(r=>setTimeout(r,e))}}function we(e,r,n){if(!e.platformToolsDir)return{};let o=n==="win32"?";":":",t=$(r),i=t?.root??l(e.platformToolsDir),s=t?.platformToolsDir??e.platformToolsDir;return{ANDROID_HOME:i,ANDROID_SDK_ROOT:i,PATH:r.PATH?`${s}${o}${r.PATH}`:s}}async function ge(e){let r=await e.readState(),n=[],o=[];for(let t of r)t.owner!==void 0&&e.alive(t.owner)&&(e.ownerIsOurs??P)(t.owner)?n.push(t):o.push(t);for(let t of o){let i=e.ownerIsOurs??P;e.alive(t.pid)&&i(t.pid)&&e.kill(t.pid)}return o.length>0&&await e.writeState(n),n}async function Je(e,r={}){if(r.appiumUrl)return{result:"external",url:r.appiumUrl};let n={...ve(),...r.deps},o=await ge(n),t=o.filter(a=>a.owner===n.owner),i=new Set(t.map(a=>a.port)),s=new Set(o.map(a=>a.port));if(r.device){let a=await ye(n,s,i,e);if(a!==null)throw new A(se(r.device,a.port,a.device),a.port)}let c=await n.bundleVersion(e),u=t.find(a=>a.deviceClass===e&&(a.bundleVersion??c)===c);if(u&&await n.probe(`http://127.0.0.1:${u.port}/status`))return{result:"reused",url:`http://127.0.0.1:${u.port}`};for(let a of t.filter(S=>S.deviceClass===e&&S!==u))n.kill(a.pid);u&&n.kill(u.pid);let d=await n.depsEnv(e);if(!d.appiumHome)throw new Error(`The managed dependencies for the ${e} class are not installed.
|
|
3
3
|
Run \`kane-cli doctor --target ${e} --install\` to install them, or pass --appium-url for an external server.`);let p=await n.freePort(X[e],z),O=`http://127.0.0.1:${p}`,J=l(d.appiumHome),U=y(J,"appium","node_modules","appium","index.js"),N=Q(e);r.onProgress?.(`starting the managed Appium server (${e}, port ${p})\u2026`);let f=n.spawn(n.nodeBinary,[U,"--port",String(p),"--allow-insecure=uiautomator2:adb_shell"],{env:{APPIUM_HOME:d.appiumHome,...we(d,n.env,n.os)},logPath:N}),B=n.now()+D,F=Math.ceil(D/T)+1;for(let a=0;a<F&&n.now()<B;a++)if(await n.sleep(T),await n.probe(`${O}/status`)){if(f!==void 0){let S=t.filter(H=>H.deviceClass!==e);await n.writeState([...S,{port:p,pid:f,owner:n.owner,deviceClass:e,...c?{bundleVersion:c}:{},startedAt:new Date(n.now()).toISOString()}])}return r.onProgress?.("Appium server ready"),{result:"started",url:O}}throw f!==void 0&&n.kill(f),new Error(`The managed Appium server (${e}) did not answer on ${p} within ${D/1e3}s.
|
|
4
4
|
Check its log: ${N}`)}async function ye(e,r=[],n=[],o){let t=new Set(n),i=new Set([...G,...r]);for(let s of i)if(!t.has(s))for(let c of await e.sessions(s)){if(!c.id)continue;if(o){let d=be(c.caps);if(d&&d!==o)continue}let u=De(c.caps);return{port:s,...u?{device:u}:{}}}return null}function be(e){let r=t=>{let i=e[t];return typeof i=="string"?i.toLowerCase():""},n=r("platformName")||r("appium:platformName");if(n.includes("ios"))return"simulator";if(n.includes("android"))return"emulator";let o=r("appium:automationName")||r("automationName");if(o.includes("xcuitest"))return"simulator";if(o.includes("uiautomator"))return"emulator"}var he=["appium:deviceName","deviceName","appium:udid","udid","appium:deviceUDID","deviceUDID"];function De(e){for(let r of he){let n=e[r];if(typeof n=="string"&&n.trim())return n}}function Ue(e={}){let r={...L(),kill:k,writeState:Ae,...e.deps};try{let n=r.readState(),o=e.owner??process.pid,t=n.filter(s=>s.owner===o&&(!e.deviceClass||s.deviceClass===e.deviceClass));for(let s of t){if(!r.alive(s.pid))continue;let c=R(r.getJson(`http://127.0.0.1:${s.port}/sessions`));for(let u of c)u.id&&r.del(`http://127.0.0.1:${s.port}/session/${u.id}`);r.kill(s.pid)}let i=new Set(t.map(s=>`${s.port}:${s.pid}`));C(()=>{r.writeState(r.readState().filter(s=>!i.has(`${s.port}:${s.pid}`)))})}catch{}}function Ae(e){try{let r=m();g(l(r),{recursive:!0}),M(r,JSON.stringify(e,null,2))}catch{}}export{Ce as a,Q as b,se as c,Le as d,ve as e,Je as f,ye as g,Ue as h};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-4IEQNX7F.js";import{f as s}from"./chunk-MYZHOBS4.js";import{existsSync as c,mkdirSync as l,readFileSync as f,renameSync as p,writeFileSync as m}from"fs";import{dirname as d,join as u}from"path";function x(n){return u(n,".testmuai","variables","assurance.json")}function S(n){for(let e of n.declarations){let o=s(e.name);if(o)throw new Error(`variable declaration refused: ${o}`)}let i={};if(c(n.file)){let e=a(f(n.file,"utf8"),n.file);e&&typeof e=="object"&&!Array.isArray(e)&&(i=e)}let r=[],t=[];for(let e of n.declarations){if(Object.hasOwn(i,e.name)||n.known?.has(e.name)){t.push(e.name);continue}i[e.name]={value:"",secret:!!e.secret,description:e.description},r.push(e.name)}if(r.length>0){l(d(n.file),{recursive:!0});let e=`${n.file}.tmp-${process.pid}-${Date.now()}`;m(e,JSON.stringify(i,null,2)+`
|
|
3
|
+
`),p(e,n.file)}return{written:r,skipped:t}}export{x as a,S as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as v}from"./chunk-34R7BNZ2.js";import{a as S}from"./chunk-QSCXXNC2.js";import{n as g}from"./chunk-NC7D7GOM.js";import{a as u,b as d}from"./chunk-D36V5OX6.js";import{existsSync as P}from"fs";import{join as T}from"path";import{mkdirSync as b,rmSync as h,writeFileSync as k}from"fs";import{join as E,resolve as A}from"path";import{join as w}from"path";function m(){return process.env.KANE_CLI_WIRE_BASE_DIR||d}function J(e){return w(m(),"sessions",`testrun-${e}`)}function y(e=m()){return E(e,"sessions","active")}function _(e,r){return E(y(r),`${e}.json`)}function x(e){let r=e.pid??process.pid,n=_(r,e.baseDir);try{b(y(e.baseDir),{recursive:!0}),k(n,JSON.stringify({pid:r,cwd:process.cwd(),surface:e.surface,session_dir:A(e.sessionDir),started:new Date().toISOString(),cli_version:u,host_agent:S()},null,2)+`
|
|
3
|
+
`)}catch{}return n}function f(e=process.pid,r){try{h(_(e,r),{force:!0})}catch{}}var R={run:"run_end",testmd:"test_md_done",testrun:"testrun_done",explore:"done"};import{appendFileSync as I,mkdirSync as N}from"fs";import{dirname as O}from"path";function D(e){let r=!1;return{path:e,append(n){try{r||(N(O(e),{recursive:!0}),r=!0),I(e,n+`
|
|
4
|
+
`)}catch{}}}}function W(e,r=()=>new Date){let{v:n,ts:c,...i}=e;return{...i,v:1,ts:typeof c=="string"?c:r().toISOString()}}function V(e){let r=e.stdout??(t=>{process.stdout.write(t)}),n=R[e.surface],c=!1,i=null,o=null,p=[],l=()=>{if(!(o||!i||!P(i))){o=D(T(i,"events.ndjson"));for(let t of p)o.append(t);p=[];try{e.onAttach?.(i)}catch{}}};return{emit(t){if(c)return;let a=v(JSON.stringify(W(t,e.now)));r(a+`
|
|
5
|
+
`),l(),o?o.append(a):p.push(a),t.type===n&&(c=!0,p=[])},attachSessionDir(t){i=t,l()},setTerminal(t){n=t},get logPath(){return o?o.path:null}}}var s=null;function j(e){return r=>{x({surface:e,sessionDir:r}),g("wire-active-run",()=>f()),process.once("exit",()=>f())}}function se(e,r){return s=V({surface:e,cliVersion:u,onAttach:r??j(e)}),s.emit({type:"stream_start",cli_version:u,surface:e,pid:process.pid}),s}function ce(){return s}function ue(e){if(s){s.emit(e);return}process.stdout.write(JSON.stringify(W(e))+`
|
|
6
|
+
`)}export{J as a,D as b,W as c,se as d,ce as e,ue as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{i as n}from"./chunk-XMPTFXPW.js";import{a,b as l}from"./chunk-RF37IJNN.js";import{a as s}from"./chunk-XZYA7DNH.js";import{Ha as t,f as o}from"./chunk-7HMSMAUG.js";import{a as i}from"./chunk-4QTH7VYE.js";var d=null;function m(){return d??=a()}function w(){d=null}var x={...l,controller:m},c=e=>new n("CREDENTIALS_MISSING",e.message,e.remedy);async function u(){let e;try{e=await m()}catch(r){throw r instanceof s?c(t.credentialsMissing()):r}if(!e.basic)throw c(e.token?t.loginUnconfirmed():t.credentialsMissing());return e.basic}async function f(){let e=await u();return i(e.username,e.accessKey)}function R(e){return{project:async r=>o({url:e,basicAuth:await f()}).project(r)}}export{m as a,w as b,x as c,u as d,f as e,R as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as i}from"./chunk-4QTH7VYE.js";import{a}from"./chunk-RZ4F3BHX.js";var c=class{constructor(r,e){this.baseUrl=r;typeof e=="string"?this.authHeader=`Bearer ${e}`:this.authHeader=i(e.username,e.accessKey)}authHeader;headers(){return{Authorization:this.authHeader,"Content-Type":"application/json",Accept:"application/json"}}async request(r,e,n,u){let s=new AbortController,o=setTimeout(()=>s.abort(),3e4);try{let t=await a(`${this.baseUrl}${e}`,{method:r,headers:{...this.headers(),...u},...n!==void 0?{body:JSON.stringify(n)}:{},signal:s.signal});if(clearTimeout(o),!t.ok){let d=await t.text();throw new Error(`${r} ${e} failed: ${t.status} ${d}`)}return(t.headers.get("content-type")??"").includes("application/json")?await t.json():await t.text()}catch(t){throw clearTimeout(o),t instanceof DOMException&&t.name==="AbortError"?new Error(`${r} ${e} timed out after 30s`):t}}};export{c as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{ta as u}from"./chunk-UEE3RZN4.js";import{m as c}from"./chunk-4I7YN6YY.js";function a(e,r){let n=u(e.superseded,i=>e.nodeLabel.get(i)),t=r,o=new Set;for(;n.has(t)&&!o.has(t);)o.add(t),t=n.get(t);return t}function d(e,r){let n=e.resolve(r);if(n===null)return null;let t=e.designGenerationOf.get(a(e,n.cid));if(t===void 0)return null;let o=e.tipOf(n.cid),i=!e.superseded.has(o);return{gen:t.gen,live:i,minted_at_seq:t.seq}}function _(e,r,n){let t=e.resolve(r);if(t===null)return{error:{code:"UNKNOWN_REF",detail:`'${r}' names no use-case in this context`}};let o=a(e,t.cid),i=e.designGenerationOf.get(o);if(i===void 0)return{uc_root:o,next_gen:1,expected_prev_gen:null,...n.because?{because:n.because}:{}};let s=d(e,r);return s!==null&&s.live&&!n.force?{error:{code:"GENERATION_LIVE",detail:c().text("GENERATION_LIVE",{use_case:r,gen:i.gen})}}:s!==null&&s.live&&n.force&&!n.because?{error:{code:"MISSING_BECAUSE",detail:`superseding the live generation of ${r} requires --because <reason>`}}:{uc_root:o,next_gen:i.gen+1,expected_prev_gen:i.gen,...n.because?{because:n.because}:{}}}function f(e,r){let n=e.designGenerationOf.get(r.uc_root)?.gen??null;return n!==r.expected_prev_gen?{code:"GENERATION_MOVED",detail:`design generation of ${r.uc_root.slice(0,12)} moved (expected ${String(r.expected_prev_gen)}, found ${String(n)}) \u2014 another session finalized; re-open and re-ground`}:null}function p(e,r,n){return{uc_root:e.uc_root,uc_cid:r,generation:e.next_gen,supersedes_generation:e.expected_prev_gen,...e.because?{because:e.because}:{},by:n}}export{a,d as b,_ as c,f as d,p as e};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{e as x}from"./chunk-KU3YHPWZ.js";var h=12,G=6e3;function p(e,n){return e.byLabel(n).filter(({cid:i})=>!e.superseded.has(i)&&e.trust.get(i)!=="archived")}function b(e,n,i){return e.displayNameOf(n)??String(i.title??i.text??n)}function O(e,n,i={}){let c=p(e,"scenario"),d=null;if(n){let t=e.resolve(n);if(t){d=new Set([t.cid,t.tip,e.tipOf(t.cid)]);let o=d;c=c.filter(({cid:g})=>e.edgesFrom(g).some(l=>l.type==="belongs_to"&&(o.has(l.dst)||o.has(e.tipOf(l.dst)))))}}let s=new Set;for(let{cid:t}of c)s.add(t),s.add(e.tipOf(t));let m=p(e,"test").filter(({cid:t})=>!n||e.edgesFrom(t).some(o=>o.type==="automates"&&(s.has(o.dst)||s.has(e.tipOf(o.dst))))),a=new Set;for(let t of m)for(let o of e.edgesFrom(t.cid))o.type==="automates"&&a.add(e.tipOf(o.dst));let v=i.typedBlockers===!0&&d!==null,r=new Set,f=[];for(let t of v?p(e,"gap"):[]){if(!x.has(String(t.content.kind??""))||i.ignoreGaps?.has(t.cid))continue;let o=typeof t.content.uc=="string"?t.content.uc:null;if(d&&o&&!d.has(o)&&!d.has(e.tipOf(o)))continue;let g=t.content.ref,l=typeof g=="string"&&g?e.resolve(g):null,R=l&&(s.has(l.cid)||s.has(e.tipOf(l.cid)));if(!l||!R){if(String(t.content.kind)==="budget-evicted"&&!l)continue;let k=t.content.question?.header;f.push(`${typeof k=="string"?k:b(e,t.cid,t.content)} (ref ${typeof g=="string"&&g?g:"missing"})`);continue}r.add(l.cid),r.add(e.tipOf(l.cid))}let y=t=>a.has(t)||a.has(e.tipOf(t)),_=t=>r.has(t)||r.has(e.tipOf(t)),$=c.filter(({cid:t})=>!y(t)&&!_(t)).map(({cid:t,content:o})=>b(e,t,o)),A=c.filter(({cid:t})=>!y(t)&&_(t)).map(({cid:t,content:o})=>b(e,t,o));return{live_scenarios:c.length,live_tests:m.length,missing:$,blocked:A,unresolved_blockers:f}}function u(e){return e.length<=h?e.join(", "):`${e.slice(0,h).join(", ")} +${e.length-h} more`}function S(e,n){let i=e.committed.length===0?"committed: nothing new":`committed: ${u(e.committed.map(r=>r.temp_ref?`${r.temp_ref} \u2192 ${r.logical_id??r.cid}`:r.logical_id??r.cid))}`,c=[];e.reused&&c.push(`reused: ${e.reused}`),e.rejected?.length&&c.push(`rejected: ${u(e.rejected.map(r=>`${r.ref} (${r.reason})`))}`),e.warnings?.length&&c.push(`warnings: ${u(e.warnings)}`);let d=[`RECEIPT (commit ${e.commitN}, ${e.phase})`,i,...c],s,m;if(e.verb==="design"){s=O(n,e.ucRef,{typedBlockers:e.typedBlockers===!0,...e.ignoreGaps?{ignoreGaps:e.ignoreGaps}:{}}),d.push(`parity: ${s.live_scenarios} scenario(s) live \xB7 ${s.live_tests} test(s) live`+(s.blocked.length?` \xB7 blocked by a typed gap: ${u(s.blocked)}`:"")+(s.missing.length?` \xB7 missing tests: ${u(s.missing)}`:"")+(s.unresolved_blockers.length?` \xB7 blocker gap(s) naming no live scenario of this use-case: ${u(s.unresolved_blockers)}`:""));let r=e.typedBlockers?" A path with no web- or mobile-observable surface gets no test: emit one `unmeasurable` gap whose `ref` is that scenario's id instead.":"",f=s.unresolved_blockers.length?` ${s.unresolved_blockers.length} blocker gap(s) name no live scenario of this use-case and account for nothing.`:"";m=s.missing.length>0?`next: emit tests for the ${s.missing.length} scenario(s) listed \u2014 1:1, strict.${r} Never re-emit committed items; reference them by the ids above.`+f:s.blocked.length?`next: every live scenario has a test or a typed blocker (${s.blocked.length} blocked). Address open gaps, or finish.`+f:"next: every live scenario has a test. Address open gaps, or finish."+f}else{let r=p(n,"usecase").length;d.push(`parity: ${r} use-case(s) live`),m="next: refine via chat ops using the ids above. Never re-emit committed items."}d.push(m);let a=d.join(`
|
|
3
|
+
`);for(;Buffer.byteLength(a,"utf8")>G;)a=a.slice(0,Math.floor(a.length*.9))+"\u2026";let v={type:"receipt",verb:e.verb,commit_n:e.commitN,phase:e.phase,committed:e.committed,reused:e.reused??0,rejected:e.rejected??[],warnings:e.streamWarnings??e.warnings??[],...s?{parity:{live_scenarios:s.live_scenarios,live_tests:s.live_tests,missing:s.missing,blocked:s.blocked,unresolved_blockers:s.unresolved_blockers}}:{}};return{text:a,event:v}}function P(e,n,i){try{let c=e.design_of?"design":e.proposal_id!==null?"proposal":e.conv?"chat":"commit",d=e.nodes.map(m=>{let a=n.displayNameOf(m.cid);return{cid:m.cid,...a!==null?{logical_id:a}:{}}}),s=S({verb:i.verb,commitN:i.commitN,phase:c,committed:d,...i.ucRef?{ucRef:i.ucRef}:{},...i.typedBlockers?{typedBlockers:!0}:{},...i.ignoreGaps?.size?{ignoreGaps:i.ignoreGaps}:{}},n);return{text:s.text+`
|
|
4
|
+
(recomputed against the current graph)`,event:{...s.event,recomputed_at_resume:!0}}}catch{let c=e.event_ids?.[0]??`seq ${e.seq}`,d=e.review[0]?.by?.id??e.sid??"unknown",s=`commit ${c} by ${d} at ${e.ts} \u2014 details unavailable (graph moved since)`;return{text:s,event:{type:"receipt",verb:i.verb,commit_n:i.commitN,phase:"recovered",recomputed_at_resume:!0,degraded:!0,message:s}}}}import{createHash as j}from"crypto";function w(e){let n=JSON.stringify([e.text,e.options.map(i=>[i.label,i.detail??""])]);return"sha256:"+j("sha256").update(n).digest("hex")}function I(e,n){return{id:n.id,selected_index:n.selected_index,free_text:n.free_text,digest:w(e)}}function N(e){return e.selected_index===null&&(e.free_text??"").trim()===""}function C(e){return(e??[]).filter(n=>!N(n))}function L(e,n){return e!==void 0&&e.digest===w(n)}function F(e){return{id:e.id,selected_index:e.selected_index,free_text:e.free_text}}export{S as a,P as b,w as c,I as d,C as e,L as f,F as g};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as m}from"./chunk-HCBYKLMW.js";import{a as o,b as i}from"./chunk-33DWJV67.js";import{y as e}from"./chunk-D36V5OX6.js";import{e as d}from"./chunk-UR6MHSHU.js";var r=d(m(),1),s={default:e.muted,error:e.red,success:e.green,info:e.orange,warning:e.orange};function h({title:t,titleColor:a,borderColor:l,variant:n="default",children:c,width:u,paddingX:x=2,paddingY:g=0,marginBottom:f=0}){let p=l??s[n],B=a??(n==="default"?e.orange:s[n]);return(0,r.jsxs)(o,{flexDirection:"column",marginBottom:f,children:[t&&(0,r.jsx)(o,{marginBottom:0,children:(0,r.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,r.jsx)(o,{borderStyle:"round",borderColor:p,flexDirection:"column",paddingX:x,paddingY:g,width:u,children:c})]})}function k({label:t,value:a,labelColor:l=e.dim,valueColor:n,labelWidth:c=14}){return(0,r.jsxs)(o,{children:[(0,r.jsx)(o,{width:c,flexShrink:0,children:(0,r.jsx)(i,{color:l,children:t})}),(0,r.jsx)(o,{flexShrink:1,children:(0,r.jsx)(i,{color:n,wrap:"wrap",children:a})})]})}function I({label:t}){return(0,r.jsx)(o,{marginTop:1,marginBottom:0,children:(0,r.jsx)(i,{bold:!0,children:t})})}export{h as a,k as b,I as c};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as d,e as l}from"./chunk-4I7YN6YY.js";var h=e=>`'${e.replace(/'/g,"'\\''")}'`,u=e=>e!==void 0?` --mode ${e}`:"",s=({verb:e,sid:t,mode:n})=>e==="design"?`kane-cli design tests --resume ${t}${u(n)}`:`kane-cli context extract --resume ${t}${u(n)}`,g=({ref:e,because:t,answers:n})=>`kane-cli maintain evolve ${e??"--from-stale"}${t?` --because ${h(t)}`:""} --mode agent`+n.map(i=>` --answer ${i.id}=${i.choice==="proceed"?1:2}`).join(""),r=e=>`kane-cli context extract --resume ${e}`,$=e=>/^[\w@%+=:,./-]+$/.test(e)?e:h(e),a=e=>e?`to review its source's change, run: ${e}`:"review its source's change with kane-cli maintain reconcile first",o="re-run kane-cli maintain reconcile to re-stage",c=e=>`retire it first (kane-cli context retire ${e}) or ingest under a different id with --as`,_=d({commands:{"next.resume_session":s,"next.resume_with_message":e=>`${s(e)} --message "<your words>"`,"next.resume_child":({sid:e})=>`kane-cli design tests --resume ${e}`,"next.design_use_case":({use_case:e,force:t})=>`kane-cli design tests --use-case ${e}${t?" --force":""}`,"next.review_use_case":({use_case:e})=>`kane-cli context review --approve ${e}`,"next.design_unreviewed":({use_case:e})=>`kane-cli design tests --use-case ${e} --mode agent --allow-unreviewed`,"next.view_design":({use_case:e})=>`kane-cli context view ${e}`,"next.evolve_design":({use_case:e})=>`kane-cli maintain evolve ${e}`,"next.redesign":({use_case:e})=>`kane-cli design tests --use-case ${e} --force --mode agent`,"next.design_phase":({use_case:e,phase:t,agent_mode:n})=>`kane-cli design tests --use-case ${e} --phase ${t}${n?" --mode agent":""}`,"next.answer_evolve":g,"next.abandon_session":({sid:e})=>`kane-cli context sessions clean ${e}`,"next.review_held_changeset":()=>"kane-cli maintain reconcile --apply","next.show_session":({sid:e})=>`kane-cli context sessions show ${e}`,"next.review_source":({source_id:e,from:t,agent_mode:n})=>t===null?null:`kane-cli maintain reconcile --from ${$(t)}${/^https?:\/\//.test(t)?"":` --source-id ${e}`}${n?" --mode agent":""}`},texts:{...l,"note.paused":e=>e.verb==="design"?`paused \u2014 resume with: ${s(e)}`:`paused: session ${e.sid} saved \u2014 resume with: ${s(e)}`,"note.crashed":e=>`agent crashed \u2014 session ${e.sid} is resumable at checkpoint seq ${e.seq} (at most the in-flight turn lost); resume with: ${s(e)}`,"note.model_unavailable_kept":e=>`the model service did not answer (${e.detail}) \u2014 session ${e.sid} is kept; resume with: ${s(e)}`,"note.model_retry":({seconds:e})=>`the model service is not answering; trying again in ${e}s`,"note.already_extracted":({source_id:e})=>`${e} already extracted \u2014 skipped (--force re-runs it)`,"note.conversation_source_skipped":({source_id:e})=>`skipped ${e} \u2014 conversation source; extract it explicitly with --source ${e}`,"note.reconcile_plan_pending":({source_id:e,pending:t,path:n})=>`note: a reconcile plan for ${e} is pending (${t} item(s)) \u2014 resume with \`kane-cli maintain reconcile --apply ${n}\``,"note.nothing_to_extract":({sources:e,count:t})=>`extract: nothing to do \u2014 ${e} ${t===1?"is":"are all"} already extracted at the current snapshot (--force to re-run)`,"note.only_conversation_sources":()=>"extract: nothing to do \u2014 only conversation sources here (extract one explicitly with --source <id>)","note.all_extracted":()=>"extract: nothing to do \u2014 every ingested source is already extracted","note.changeset_held_for_review":({held:e})=>`paused: ${e} held change(s) await your verdicts \u2014 review them in a terminal: kane-cli maintain reconcile --apply`,"note.held_for_review":({sid:e,mode:t,held:n})=>`paused: ${n} held item(s) await review \u2014 resume with: ${s({verb:"extract",sid:e,mode:t})}`,"note.session_kept":e=>`session ${e.sid} kept its last checkpoint (seq ${e.seq}, ${e.ts}) \u2014 resume with: ${s(e)}`,"note.assumed_defaults":({sid:e,count:t})=>`note: ${t} default(s) were assumed while you were away \u2014 kane-cli context sessions show ${e} lists them`,"note.landed_changed":({source_id:e})=>`note: ${e} changed after it was added \u2014 skipping its extraction this run; re-run kane-cli context extract to pick up the newer version`,"note.landed_older_queued":({source_id:e})=>`note: an older version of ${e} is already queued this run \u2014 the newly landed version is not extracted; re-run kane-cli context extract to pick it up`,"note.reingest_binary":({source_id:e,kind:t})=>`skipping ${e}: binary ${t} ingested before image support \u2014 re-ingest it (kane-cli context ingest) to extract from it`,"note.schedule_refused":()=>"this run holds items for review, so its extraction is not scheduled \u2014 kane-cli context extract runs it after the review","note.not_reached":()=>"run ended before its turn \u2014 kane-cli context extract runs it","note.nothing_committed":({source_id:e,remaining:t})=>`done \u2014 nothing committed for ${e} (no finalize before the session ended)`+(t>0?`; stopping here \u2014 ${t} remaining source(s) not extracted (re-run kane-cli context extract to continue)`:""),"note.landed_not_extracted":({count:e,sources:t})=>`note: ${e} source(s) landed this session (${t}) were not extracted \u2014 the session ended first; kane-cli context extract runs them`,"note.evidence_not_attached":({count:e})=>`note: ${e} unchanged match(es) target unreviewed (or no-longer-resolving) item(s) \u2014 evidence not attached (bless them with kane-cli context review; a later reconcile attaches)`,"note.sources_failed":({failed:e,total:t,sources:n})=>`${e} of ${t} source(s) failed \u2014 re-run kane-cli context extract to retry (${n})`,"note.already_designed":({use_case:e,version:t})=>`'${e}' is already designed @ v${t} \u2014 current; use --force to redesign`,"note.design_stale":({use_case:e,designed:t,current:n})=>`'${e}' was designed @ ${t} \u2014 the use-case is now @ v${n} (STALE); use --force to redesign`,"note.view_design":({use_case:e})=>`view the existing design: kane-cli context view ${e}`,"note.evolve_first":({use_case:e})=>`refresh it first: kane-cli maintain evolve ${e}`,"note.nothing_executed":()=>"nothing executed \u2014 list use-cases: kane-cli context list","note.tests_await_approval_command":({tests:e,criteria:t,criterion:n})=>{let i=e===1?"1 test checks":`${e} tests check`;return t===1&&n!==null?`note: ${i} a criterion not approved yet; to approve it, run:
|
|
3
|
+
kane-cli context review --approve ${n}`:`note: ${i} criteria not approved yet; to approve them, run:
|
|
4
|
+
kane-cli context review`},"note.links_await_approval":({count:e})=>`warning: ${e} test link(s) refer to items still awaiting approval \u2014 saved anyway; review and approve those items in chat or via kane-cli context review`,"note.no_design_skipped":({use_case:e})=>`note: ${e} has no design output \u2014 nothing to evolve; run kane-cli design tests --use-case ${e} first`,"note.no_design":({use_case:e})=>`nothing to evolve \u2014 run kane-cli design tests --use-case ${e} first (no design output)`,"note.design_paused":({use_case:e})=>`design session for ${e} paused \u2014 resume with \`kane-cli design tests --resume\`, then re-run evolve for the diff`,"note.nothing_changed":({ref:e})=>`nothing changed underneath ${e} \u2014 its sources and requirements are current; use --because "<reason>" to re-design anyway`,"note.source_changed_skipped":({use_case:e,review:t})=>`${e} is left out: it's out of date because its source changed \u2014 ${a(t)}`,"note.source_changed":({use_case:e,review:t})=>`${e} is out of date because its source changed, and an update can't change that \u2014 ${a(t)}`,"note.source_changed_after":({use_case:e,review:t})=>`${e} is still out of date because its source changed \u2014 ${a(t)}`,"note.checkpoint_not_saved":({error:e,chain_unverified:t})=>`warning: couldn't save the session checkpoint \u2014 ${e}; asking the agent to pause`+(t?". The store's record chain fails verification \u2014 run kane-cli context fsck to diagnose.":""),"note.held_no_event_id":({sid:e})=>`this held row has no durable event id \u2014 resume the owner to drop it: ${r(e)}`,"note.held_no_provenance":({sid:e})=>`this held row carries no committable provenance \u2014 resume the owner to apply it: ${r(e)}`,"note.held_no_citable_text":({sid:e,source_id:t,source_cid:n})=>`the pinned source ${t} (${n.slice(0,19)}) has no citable text to verify this held row against \u2014 resume the owner: ${r(e)}`,"note.held_unverified":({sid:e,errors:t})=>`held provenance does not verify against the pinned source (${t}) \u2014 resume the owner: ${r(e)}`,"note.controller_unreachable":({base:e,error:t})=>`error: cannot reach the controller at ${e} (${t})
|
|
5
|
+
hint: check your network connection and login (kane-cli whoami)`,"note.assurance_unsupported":()=>"error: this environment does not support assurance sessions yet (404) \u2014 update kane-cli, or contact support if the problem persists","note.credentials_rejected":({env:e})=>`error: your credentials were rejected (401) \u2014 run kane-cli login (active environment: ${e})`,"note.key_recycled":({source_id:e,what:t})=>`source '${e}' was ingested from a different ${t} that used this key \u2014 the key was recycled; ${c(e)}`,"note.kind_taken":({source_id:e,backing:t,kind:n})=>`source '${e}' is already backed by ${t}, not ${n} \u2014 ${c(e)}`,"note.site_moved":({source_id:e,previous:t,site:n})=>`source '${e}' was ingested from ${t}, but this read serves ${n} \u2014 ${c(e)}`,"note.web_url_changed":({source_id:e,previous:t})=>`source '${e}' was ingested from ${t} \u2014 re-run on a TTY to adopt the new URL as its next version, or ingest under a different id with --as`,"note.web_id_taken":({url:e})=>`skipped ${e} \u2014 ingest under a different id with --as to keep both pages`,"note.web_login":()=>"your credentials were rejected \u2014 run `kane-cli login` and retry","note.web_projection_unknown":({kind:e})=>`unknown web projection kind '${e}' \u2014 update kane-cli to read this source`,LIS_AUTH:()=>"credentials rejected \u2014 run `kane-cli login` and retry",MULTI_SOURCE_RESUME:({sid:e,sources:t})=>`error: session ${e} spans ${t} sources \u2014 multi-source resume isn't supported yet; committed work is preserved (re-run kane-cli context extract for anything remaining)`,CHANGE_BASIS_MOVED:({source_id:e,sid:t})=>`error: ${e} moved while this reconcile extraction was paused \u2014 its recorded change context no longer matches; re-run kane-cli maintain reconcile against the current file (session ${t} is defunct and can be ignored)`,PROPOSAL_UNREADABLE:({proposal:e})=>`proposal ${e} is unreadable \u2014 re-run maintain reconcile`,SOURCE_UNRESOLVED:({source_id:e})=>`the source ${e} no longer resolves \u2014 cannot verify this changeset is current; re-run maintain reconcile`,SOURCE_MOVED:({source_id:e})=>`the source ${e} moved again while this review was open \u2014 re-run maintain reconcile to refresh the changeset`,ARCHIVE_UNRESOLVED:({use_case:e})=>`its archive op no longer resolves to ${e} \u2014 re-run maintain reconcile`,POSTURE_IN_CHAT:({sid:e})=>`error: session ${e} is a held reconcile review \u2014 resumed in the chat its changes would commit without verdicts; review its cards with kane-cli maintain reconcile --apply`,SOURCE_MISSING:({sid:e,sources:t})=>`error: resumed session's paused source (${t}) is no longer in the corpus \u2014 restore/re-ingest it and re-run --resume ${e}, or discard with: kane-cli context sessions clean ${e}`,BLOB_MISSING:({source_id:e})=>`error: ${e}: its stored content is missing \u2014 re-ingest the file (kane-cli context ingest <file>) [BLOB_MISSING]`,"AGENT_FAILED.invalid_proposal":({source_id:e})=>`error: the agent could not produce a valid proposal for ${e} \u2014 re-run kane-cli context extract to retry`,UC_UNREVIEWED:({use_case:e})=>`${e} is unreviewed \u2014 approve it first, or pass --allow-unreviewed`,"UC_UNREVIEWED.merge_target":({temp_ref:e,target:t})=>`${e}: merge target ${t} is unreviewed (derived) \u2014 bless it first (kane-cli context review) and re-propose the merge`,UC_HELD:({use_case:e,owner_sid:t,stopped:n})=>`design: ${e} is being designed by another session`+(n?` \u2014 that session looks stopped; resume it with kane-cli design tests --resume ${t??"<session>"}`:"")+" \u2014 pick another use-case (kane-cli design tests) or wait for it to finish",GENERATION_LIVE:({use_case:e,gen:t})=>`${e} already has a live design generation (gen ${t}) \u2014 pass --force with --because to supersede it`,MESSAGE_TOO_LARGE:({bytes:e,max:t})=>`error: the opening statement is ${e} bytes and the agent takes at most ${t} per message (it would drop it silently) \u2014 pass a shorter --because (it replaces the generated stale reason)`,REASON_TOO_LARGE:()=>"nothing was started: that reason is too long; run it again with a sentence or two",SESSION_V1:({sid:e})=>`session ${e} predates durable checkpoints \u2014 this build cannot resume it; abandon it with kane-cli context sessions clean ${e} and start a fresh run (committed work is untouched)`,WRONG_VERB:({sid:e,verb:t})=>`error: session ${e} is a ${t} session \u2014 resume it with ${s({verb:t,sid:e})}`,"HELD_CITES_STALE.moved":()=>`the source moved after this plan staged \u2014 its quotes no longer verify against the current head; ${o}`,"HELD_CITES_STALE.predates_images":({where:e,anchor:t})=>`${e}: this plan predates image-part staging \u2014 ${t} cannot be verified against the version it staged under; ${o}`,"HELD_CITES_STALE.no_image":({where:e,anchor:t})=>`${e}: ${t} names no decodable image of the staged version \u2014 ${o}`,"HELD_CITES_STALE.image_moved":({where:e,anchor:t,gone:n})=>`${e}: the image behind ${t} is ${n?"no longer in":"ambiguous in"} the current head \u2014 ${o}`}});export{_ as a};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as At,b as Ct,d as Ot,f as Tt,t as Mt,u as jt}from"./chunk-DDZLCAEO.js";import{b as It}from"./chunk-CM4CHYSN.js";import{b as _t,d as Rt}from"./chunk-RHGW7B5Q.js";import{k as yt}from"./chunk-HCJ2N3XB.js";import{a as ht,b as U}from"./chunk-NLZZLANH.js";import{c as gt}from"./chunk-3F5FMH76.js";import{c as vt,h as wt}from"./chunk-ZU4W2QGM.js";import{a as Wt}from"./chunk-HIUAUZNL.js";import{g as Pt,h as Re,j as Et}from"./chunk-457Y5TEC.js";import{c as Dt,d as $t,e as Ut}from"./chunk-EECDDDSB.js";import{d as xt}from"./chunk-7NPTL66J.js";import{g as Nt}from"./chunk-42PALMW2.js";import{f as bt}from"./chunk-KF4DKXSS.js";import{k as St}from"./chunk-ZTHYAHDN.js";import{c as kt}from"./chunk-DPGOAFKF.js";import{B as ct,D as ut,Da as mt,Ha as P,W as _e,ba as pt,f as re,fa as ft,h as rt,i as st,n as k,o as dt,pa as ie,r as Se,t as z,u as se,v as oe,w as lt}from"./chunk-7HMSMAUG.js";import{a as ot,b as it,d as at}from"./chunk-GFLB2SHW.js";import{a as ne}from"./chunk-I2MC6VVX.js";import{a as ke}from"./chunk-RPRXRKKR.js";import{d as et}from"./chunk-DJC7NTLA.js";import{oa as nt}from"./chunk-UEE3RZN4.js";import{b as tt}from"./chunk-6NFOH4AC.js";import{c as Ze}from"./chunk-ZCRZFAOT.js";import{a as Ye}from"./chunk-D36V5OX6.js";import{appendFileSync as tn,mkdirSync as nn,mkdtempSync as rn,rmSync as sn}from"fs";import{tmpdir as on}from"os";import{dirname as an,join as dn}from"path";import{MessageChannel as ln,Worker as cn}from"worker_threads";var Ft=["submit","submitAnswer","submitFreeText","submitAnswerWithText","toggleOption","confirmMulti","goWithRecommendations","ingestAttach","continueParked","completeSession","requestPause","finalizeForExit","note","ledger"],xn=[...Ft,"state","subscribe","multiSelection","canIngest","senderAlive","aliasOf","explainLines","ask","approveAdded"];function Lt(e,s){let n=s.state,o=s.view,i=new Set,l=[];e.on("message",m=>{if(m.type==="approved")return void l.shift()?.(m.go);if(m.type==="mirror"){n=m.state,o=m.view;for(let g of[...i])g()}});let f=(m,g)=>e.postMessage({type:"controller",member:m,args:g});return{...Object.fromEntries(Ft.map(m=>[m,(...g)=>{f(m,g)}])),get state(){return n},subscribe(m){return i.add(m),()=>i.delete(m)},goWithRecommendations(){return f("goWithRecommendations",[]),{picks:""}},async ingestAttach(m){f("ingestAttach",[m])},approveAdded(){return new Promise(m=>{l.push(m),f("approveAdded",[])})},multiSelection:m=>o.multi[m]??[],canIngest:()=>o.canIngest,senderAlive:()=>o.senderAlive,aliasOf:m=>o.aliases[m],explainLines:()=>null,ask:async()=>{throw new Error("a remote session's questions are asked on its session thread")}}}var Xt=e=>e.added===0?"":e.verb==="design"?`${e.added} added`:`${e.added} ${e.added===1?"use-case":"use-cases"} added`;function On(e,s,n){let o=e.length,i=s.title?`"${s.title}"`:nt(s.id);return[{text:` ${o} other ${o===1?"session is":"sessions are"} open on ${i} \u2014 you can still go ahead`},...Ie(e,n,4)]}function Ie(e,s,n){let o=" ".repeat(n),i=[];for(let l of e){let f=l.owner===null?"":(l.owner==="you"?"yours":"someone else").padEnd(15),j=[Mt[l.state]??l.state,jt(l.lastActivityAt,s),Xt(l)].filter(Boolean);i.push({text:`${o}${f}${j.join(" \xB7 ")}`,dim:!0}),l.owner!=="someone_else"&&(l.state==="ready_to_save"?i.push({text:`${o} save: kane-cli context sessions save ${l.sid}`,dim:!0}):l.state==="paused"&&i.push({text:`${o} resume: ${ie(l.verb==="design"||l.verb==="evolve"?"design":"extract",l.sid,!1)}`,dim:!0}))}return i}var ae=2e3,qt=2*ae,Yt=16;async function $n(e){let s=await xe(e);return s===null?null:s.length===0?P.nothingNewRead.map(n=>({text:n})):[{text:P.nothingNewInSession},...Ie(s,e.now,2)]}function Bt(e){if(e.length===0)return{type:"nothing_new",reason:"every_source_read",next:[{cmd:"kane-cli context ingest <files> --mode agent",why:"add more sources"}]};let s=e.filter(n=>n.owner!=="someone_else").flatMap(n=>n.state==="paused"?[{cmd:`kane-cli context extract --resume ${n.sid} --mode agent`,why:"resume your session"}]:n.state==="ready_to_save"?[{cmd:`kane-cli context sessions save ${n.sid} --yes --mode agent`,why:"save your session"}]:[]);return{type:"nothing_new",reason:"sources_in_a_session",open_sessions:e.map(({sid:n,owner:o,state:i,added:l})=>({sid:n,owner:o,state:i,added:l})),...s.length>0?{next:s}:{}}}async function xe(e){let s,n=new Promise(o=>{s=setTimeout(()=>{e.log?.(`the sources weren't read within ${e.budgetMs??qt} ms; the extract goes on`),o(null)},e.budgetMs??qt)});try{return await Promise.race([Zt(e),n])}catch(o){return e.log?.(`the sources weren't read: ${U(o)}; the extract goes on`),null}finally{clearTimeout(s)}}async function Zt(e){let[s,n]=await Promise.all([e.person.sources(e.projectId),e.person.listSessions(e.projectId)]),o=s.filter(l=>l.head!==null&&!l.sourceId.startsWith(Nt));if(o.length===0||o.some(l=>l.completeness?.sourceCid!==l.head))return null;let i=n.filter(l=>l.verb==="extract");return Rt(e.person,e.projectId,i,e.me,Math.min(Yt,Math.max(1,i.length)))}var Pe=class extends Error{constructor(){super("stopped while the file went up")}},de=class extends Error{constructor(n,o,i){super(n.message);this.refusal=n;this.exit=o;this.detail=i}};async function Sr(){let e=await bt(gt);return{auth:e,preflight:await kt(e)}}var un=500,le=5e3,Ht=6e4,pn=250;function fn(e){let s=e.now-e.pressedAt;if(s>=Ht)return"force";let n=e.saving>0?0:e.now-Math.max(e.quietSince,e.pressedAt);return n>=le?"force":{wait:Math.min(le-n,Ht-s)}}var mn=new Set([k.appendDraft,k.vectorsWrite,k.putBlob,k.chainWrite,k.chainWriteIfAbsent,k.chainRemove,k.filesWrite,k.statePut,k.acknowledge,k.registerChild,k.sideSave]);function gn(){return import.meta.url.endsWith(".ts")?new URL("./session-worker.boot.mjs",import.meta.url):new URL("./session-worker.js",import.meta.url)}function hn(e,s){if(e!=="ingested"||s===null||typeof s!="object")return{kind:e};let n=s,o={kind:e};for(let i of["source_id","status","behind","unread","cursor"])n[i]!==void 0&&(o[i]=n[i]);return o}function vn(e,s){let n=Ze(`remote-${e}`,s);return o=>{try{nn(an(n),{recursive:!0}),tn(n,`${new Date().toISOString()} ${o}
|
|
3
|
+
`)}catch{}}}var w=U;async function wn(e,s,n,o){let i,l;try{[i,l]=await Promise.all([pt(e.person,s,n),e.person.getSession(n)])}catch(f){return o(`the session that added nothing was not discarded: ${w(f)}`),!0}if(ft(i,(l.scope?.position??l.basePosition)>l.basePosition))return!0;try{await e.person.discard(n,e.claim.generation)}catch(f){o(`the session that added nothing was not discarded: ${w(f)}`)}return!1}function yn(e,s){return e===0&&s>0?1:e}async function _r(e){let s={trace:Dt(null,"")},n=1;Se({projectId:e.choice.projectId});try{return n=await bn(e,s),n}finally{s.trace.line("run_end",{code:n}),await lt()}}async function bn(e,s){let n=e.testing??{},o=null,i=new Set,l=r=>{if(r.type!=="session_paused"||e.verb!=="extract"||i.size<2)return r;let{resume:a,held_review:y,next:Y,...$}=r,Z=Ot(e.ingest?.map(ee=>ee.path??ee.file),A?.record??null),G=A?.record.sessionId??String(r.sid);return{...$,sid:G,...Tt(G,Z)}},f=r=>{let a=e.io?At(r,Date.now(),{sourceId:A?.record.sourceId??null,mode:e.mode}):null;a&&e.io.event(l(a)),e.onProgress(o!==null&&r.kind==="load"?{kind:"reading",file:o}:r)},j=e.start.kind==="resume"?e.start.sessionId:null,N=null,m=null,g=null,Ee=!1,ce=null,Ae=[],W=!1,ue=!1,pe=null,fe=!1,A=null,u=n.diagnostics??(()=>{}),C=(r,a={})=>{e.io?e.io.event({type:"error",code:r.code,message:r.message,...ct(r),...r.heldBy?{held_by:ut(r.heldBy)}:{},...r.notAdded?{not_added:r.notAdded}:{},...a}):e.onRefusal?e.onRefusal(r):yt(r)},Gt=r=>{if(!g){if(g=r,e.onEnding?.(),u(`the session's writer was stopped: ${U(r)}`),z(se(r),oe(r)),m?.close(P.stepRefused),r.code==="PROJECT_NOT_MARKED")Ee=!0;else if(r.code==="SESSION_ENDED"||r.code==="SCOPE_NOT_OPEN")pe=r;else{let a=r.code===rt?"resumed_elsewhere":r.code===st?"computer_slept":"connection_lost";W&&a==="connection_lost"?ue=!0:f({kind:"paused",reason:a,sid:A?.record.sessionId??j??""})}setTimeout(()=>{N?.terminate()},le).unref()}},E=!1,S=!1,me=0,ge=new Set,D=0,Ce=!1,J=!1,Oe=()=>{},Kt=new Promise(r=>Oe=r),Te=()=>{E=!0,N?.postMessage({type:"stop"})},Me=()=>{},je=new Promise(r=>Me=r),he=()=>{s.trace.line("run_forced",{}),S=!0,Me(),J&&Oe();let r=N;r?.postMessage({type:"kill"}),setTimeout(()=>{r?.terminate()},pn).unref()},ve=0,Ne=r=>{let a=()=>{if(S||Ce)return;let y=fn({now:Date.now(),pressedAt:r,saving:me+ge.size,quietSince:D});if(y==="force")return he();setTimeout(a,Math.max(50,y.wait)).unref()};setTimeout(a,le).unref()},We=()=>{if(ve+=1,s.trace.line("stop_asked",{by:"ctrl_c",press:ve}),J||ve>1)return he();Te(),Ne(Date.now())};e.onControls?.({pause:()=>{s.trace.line("stop_asked",{by:"pause"}),E=!0,Ne(Date.now())},force:he});let _=!1,De=null,$e=0;if(e.mode==="agent"&&e.io&&e.verb==="extract"&&e.start.kind==="new"&&!e.start.body.sourceId&&!e.run.force&&!e.ingest){let r=await xe({person:re({url:e.choice.latticeUrl,basicAuth:e.basicAuth,requestDeadlineMs:ae,...n.fetch?{fetch:n.fetch}:{}}),projectId:e.choice.projectId,me:vt(process.cwd()),now:Date.now(),log:n.diagnostics??ht("nothing-new")});if(r!==null)return e.io.event(Bt(r)),0}let F=e.io?await tt({event:r=>e.io.event(r)},e.check):await e.check();if(!F.preflight.ok){let{cause:r,final:a}=F.preflight;return u(`the controller's check refused the run: ${F.preflight.message}`),C(P.preflight(r??(a?"rejected":"unreachable")),{final:a}),2}if(S)return 130;let Vt=e.signals?process.listeners("SIGINT"):[],Q=!1,Ue=()=>{!e.signals||Q||(Q=!0,process.removeAllListeners("SIGINT"),process.on("SIGINT",We))},L=()=>{if(Q){Q=!1,process.removeListener("SIGINT",We);for(let r of Vt)process.on("SIGINT",r)}},q=null,X=[];if(e.ingest){Ue();try{for(let a of e.ingest){if(!a.fetch)continue;if(await Promise.race([a.fetch(f).then(()=>!0),je.then(()=>null)])===null||S||E)return L(),130}let r=[];for(let a of e.ingest){if(a.deferred){r.push(null);continue}let y=await Promise.race([a.upload(f,()=>E||S),je.then(()=>null)]);if(y===null||S)return L(),130;r.push(y)}q=r}catch(r){if(L(),r instanceof Pe)return 130;if(!(r instanceof de))throw r;return u(`the upload was refused: ${r.detail??r.message}`),C(r.refusal),r.exit}}try{A=await _t({url:e.choice.latticeUrl,basicAuth:e.basicAuth,start:e.start,...e.choice.projectName?{projectName:e.choice.projectName}:{},onProgress:f,onStopped:Gt,log:r=>u(r),testing:{...n.fetch?{fetch:n.fetch}:{},...n.leaseRenewMs!==void 0?{leaseRenewMs:n.leaseRenewMs}:{},...n.retryDeadlineMs!==void 0?{retryDeadlineMs:n.retryDeadlineMs}:{}}})}catch(r){L(),e.choice.onboarded&&r instanceof ne&&(r.code==="MARK_REFUSED"||r.code==="PROJECT_NOT_MARKED")&&wt(process.cwd());let a=await Rn(r,{latticeUrl:e.choice.latticeUrl,projectId:e.choice.projectId,basicAuth:e.basicAuth,sessionId:j,useCase:e.run.useCase,log:$=>u($),...n.fetch?{fetch:n.fetch}:{}}),{exit:y,...Y}=It(r,e.choice,j,e.verb==="reconcile"?void 0:{verb:e.verb,...(e.verb==="design"||e.verb==="evolve")&&e.run.useCase?{useCase:e.run.useCase}:{},...a!==void 0?{title:a}:{},...e.mode==="agent"?{agent:!0}:{}});return u(`the session could not be opened: ${w(r)}`),r instanceof ne&&z(se(r),oe(r)),C(Y),y}let c=A,p=c.record.sessionId;Se({latticeSessionId:p,projectId:e.choice.projectId});let Fe=e.start.kind==="resume"&&c.record.verb==="reconcile"&&c.record.sourceId!==null,B=Fe?_n({...c.record,sourceId:c.record.sourceId}):null;Fe&&e.io?.retag?.("reconcile");let H=e.start.kind==="resume"&&c.record.verb==="evolve";H&&e.io?.retag?.("evolve");let Le=H?Sn(c.log.since(0)):void 0;if(H)for(let[r,a]of _e(c.log.since(0)))e.onRepinned?.(r,a);n.diagnostics||(u=vn(e.verb,p)),s.trace=$t(e.traceVerb??e.verb,ke()),s.trace.path&&Ut(p,s.trace.path),s.trace.line("run_open",{sid:p,verb:e.verb,start:e.start.kind,mode:e.mode??"interactive",cli_version:Ye,env:et(),project_id:e.choice.projectId});{let r=u;u=a=>{r(a),s.trace.line("diag",{line:a})}}let qe=rn(dn(on(),"kane-remote-session-")),we=[],Be=!1;Ue();let He=async()=>{if(!(!e.ingest||q===null))for(let[r,a]of e.ingest.entries())X[r]||(X[r]=!0,await a.cancel(p).catch(y=>u(`the upload's cancel was not posted: ${w(y)}`)))},ye=()=>(e.start.kind==="new"?c.person.discard(p,c.claim.generation):c.person.setStatus(p,"paused")).then(()=>{},r=>u(`the unstarted session was not put away: ${w(r)}`)),Ge=async()=>(await c.person.setStatus(p,"paused").catch(r=>u(`the pause was not recorded: ${w(r)}`)),f({kind:"not_ended",sid:p,project:e.choice.projectName}),1),Ke=async()=>{let r=await c.person.getSession(p).then(y=>y.scope?.state,()=>null);return f({kind:"ended",reason:r==="finalized"?"saved_elsewhere":r==="discarded"?"discarded_elsewhere":"ended_elsewhere",sid:p}),0},zt=async()=>{let r=await c.client.sessionState().catch(a=>(u(`the session's state couldn't be read: ${w(a)}`),null));return r===null||typeof r.completed_at!="string"?null:r.ended?.ended==="failed"?"failed":"complete"};try{if(S)return await He(),await ye(),130;try{e.onOpened?.(c.record,d=>u(d))}catch(d){u(`the folder's project link could not be updated: ${w(d)}`)}let r=e.start.kind==="resume"?await zt():null;if(r!==null){J=!0,W=!0;try{await c.state.end(p,{state:r,panel:null,error:null,checkIn:!1,phase:null,child:null,pausing:!1})}catch(d){return u(`the ending was not recorded: ${w(d)}`),pe?await Ke():g&&!ue?3:await Ge()}return r==="failed"?(C(P.sessionFailed(p)),2):(f({kind:"finished_before",sid:p}),0)}let a=0,y=async(d,b)=>{let T=mn.has(d),v=String(b?.childId??"");d===k.chainWrite&&/^(delta|full)-\d+\.json$/.test(String(b?.name))&&ge.add(v),T&&(me+=1,D=Date.now());let R=d===k.appendDraft,K;R&&(a+=1,e.onWrites?.(a),K=setTimeout(()=>f({kind:"write",pending:a}),300));try{return await c.storeCalls(d,b)}catch(I){throw u(`${d} was refused: ${w(I)}`),I instanceof ot?I:(z(se(I),oe(I)),I instanceof dt&&!g&&(fe=!0,e.onEnding?.()),it(new Error(P.stepRefused),I))}finally{d===k.acknowledge&&ge.delete(v),T&&(me-=1,D=Date.now()),R&&(clearTimeout(K),a-=1,e.onWrites?.(a),a===0&&f({kind:"write",pending:0}))}},{port1:Y,port2:$}=new ln,Z=new SharedArrayBuffer(4);m=at({port:Y,signal:Z},y);let G=H||e.verb==="evolve"?await kn(re({url:e.choice.latticeUrl,basicAuth:e.basicAuth,requestDeadlineMs:ae,...n.fetch?{fetch:n.fetch}:{}}),e.choice.projectId,u):void 0,ee={verb:B?"reconcile":H?"evolve":e.verb,traceVerb:e.traceVerb??e.verb,mode:e.mode,sessionId:p,fresh:e.start.kind==="new",generation:c.claim.generation,projectDir:process.cwd(),projectName:e.choice.projectName,projectId:e.choice.projectId,sideDir:qe,bridge:{port:$,signal:Z},lastEventSeq:c.log.lastSeq(),run:e.start.kind==="resume"?{...e.run,resume:p,...Le!==void 0?{kept:Le,...c.record.useCase?{useCase:c.record.useCase}:{}}:{}}:e.run,...e.start.kind==="resume"&&e.verb==="extract"?{landed:[...new Set((c.record.uploads??[]).filter(d=>d.outcome!=="refused").map(d=>d.sourceId))]}:{},auth:F.auth,preflight:F.preflight,supportId:ke(),...n.agent||n.remoteDeps||n.sourcePlugins||n.refuseCard?{testing:{...n.agent?{agent:n.agent}:{},...n.remoteDeps?{remoteDeps:n.remoteDeps}:{},...n.sourcePlugins?{sourcePlugins:n.sourcePlugins}:{},...n.refuseCard?{refuseCard:n.refuseCard}:{}}}:{},...e.ingest&&q?{ingest:e.ingest.map((d,b)=>({bytes:new Uint8Array(d.bytes),file:d.file,sourceId:d.sourceId,fingerprint:q[b]?.fingerprint??"",then:d.then,...d.remote?{remote:d.remote}:{},...d.plugin?{plugin:d.plugin}:{}}))}:{},...B?{review:B}:{},...G?{origins:G}:{}},Ve=()=>e.io?.event({type:"error",message:P.runStopped(e.verb)}),O=await new Promise(d=>{let b=!1,T=t=>{b||(b=!0,d(t))},v;try{v=new cn(n.workerUrl??gn(),{workerData:ee,transferList:[$]})}catch(t){return u(`the session thread could not start: ${w(t)}`),Ve(),T(1)}N=v,E&&v.postMessage({type:"stop"});let R=e.ingest?.[0],K=R?.remote?Pt({...R.remote,address:R.remote.origin.url},Re(R.remote.provider,R.remote.origin.url,R.sourceId)):void 0,I=B??(e.verb==="reconcile"&&R?{sourceId:R.sourceId,file:R.path??R.file,...K?{page:K}:{}}:null);if(e.onReview&&I){let t=Wt(v),x={source:I.sourceId,file:I.file,...I.page?{page:I.page}:{}};e.onReview(t,x);let h=!1;v.on("message",V=>{if(h||V.type!=="reviewMirror"||!V.review.named)return;h=!0;let M=xt(x,V.review.named);M&&e.onReview(t,M)})}e.ingest&&(o=e.ingest[0].file,f({kind:"reading",file:o})),n.terminateOnHold?.then(()=>v.terminate());let Qe=!0,Xe=!1;v.on("message",t=>{if(t.type==="mirror"&&E&&t.state.nestedAgent===!0&&(D=Date.now()),t.type==="mirror"&&!Xe)Xe=!0,e.onController?.(Lt(v,{state:t.state,view:t.view}));else if(t.type==="event"){if(E&&t.event.child_id!==void 0&&(D=Date.now()),(fe||g)&&t.event.type==="error")return u(`after the run paused: ${String(t.event.message??"")}`);if(e.start.kind==="resume"&&t.event.type==="error"&&mt.has(String(t.event.code??"")))return ce=String(t.event.code),u(`the resume was refused: ${String(t.event.message??"")}`);if(t.event.type==="held"&&e.onHeld?.(Number(t.event.count)||0),t.event.type==="session_complete"&&e.mode==="agent"||(t.event.type==="source_start"&&i.add(String(t.event.source_id)),t.event.type==="child_start"?we.push({child:t.event.child,at:Date.now()}):t.event.type==="child_end"?we.pop():t.event.type==="session_paused"&&t.event.child_id===void 0&&(Be=!0),t.event.type==="run_start"&&t.event.child_id!==void 0))return;e.io?.event(l(t.event.type==="run_start"?{type:"run_start",session:p}:t.event.type==="session_paused"&&t.event.held!==void 0?{...t.event,reason:"held_back"}:t.event.type==="held"&&t.event.reason==="embed_degraded"?{...t.event,reason:"duplicate_check_reduced"}:t.event.type==="held"&&t.event.reason==="reconcile"?{...t.event,reason:"review"}:t.event)),(Qe&&n.stopAfterFirstEvent||!E&&t.event.type===n.stopAtEvent)&&Te(),Qe=!1}else if(t.type==="summary")e.onSummary?.(t.facts);else if(t.type==="notUpdated")e.onNotUpdated?.(t.useCases,t.titles,t.stillStale);else if(t.type==="unstarted")_=!0;else if(t.type==="needed")Ae=t.needed.noStartPage.map(({test:x})=>({test:x})),e.onNeeded?.({needed:t.needed,tests:t.tests});else if(t.type==="preMount")(e.onPreMount?e.onPreMount(t.question):Promise.resolve({go:!1,code:2})).then(x=>{!x.go&&t.question.kind!=="evolve-entry"&&t.question.kind!=="lines"&&(_=!0),v.postMessage({type:"preMountAnswer",answer:x})});else if(t.type==="ingestFetched"){let x=e.ingest[t.index];x.bytes=Buffer.from(t.bytes),x.upload(f,()=>E||S).then(h=>{q[t.index]=h,v.postMessage({type:"ingestUploaded",index:t.index,ok:!0,fingerprint:h.fingerprint})},h=>{h instanceof de?(u(`the upload was refused: ${h.detail??h.message}`),C(h.refusal),De=h.exit):u(`the fetched item's upload failed: ${w(h)}`),X[t.index]=!0,_=!0,v.postMessage({type:"ingestUploaded",index:t.index,ok:!1})})}else if(t.type==="ingestOutcome"){let{type:x,index:h,...V}=t;X[h]=!0,e.ingest[h].result(V,p,u).then(M=>{M?e.ingest[h+1]&&(o=e.ingest[h+1].file,f({kind:"reading",file:o})):(_=!0,o=null),v.postMessage({type:"ingestGo",index:h,go:M})},M=>{u(`the upload's result was not posted: ${w(M)}`),_=!0,v.postMessage({type:"ingestGo",index:h,go:!1})})}else if(t.type==="ingested")o=null,e.verb==="reconcile"&&t.status==="unchanged"&&!t.behind&&!t.unread&&(_=!0),e.ingest?.[t.index]?.onAdded?.(t.status,p,{...t.duplicateOf?{duplicateOf:t.duplicateOf}:{},...t.attachments?{attachments:t.attachments}:{},...t.behind?{behind:t.behind}:{},...t.unread?{unread:!0}:{}});else if(t.type==="ingestUnwritten")o=null,_=!0,e.ingest?.[t.index]?.onUnwritten?.(p);else if(t.type==="sessionEvent"){E&&t.payload.child_id!==void 0&&(D=Date.now()),c.log.append(t.kind,t.payload),s.trace.line("session_event",hn(t.kind,t.payload));for(let[x,h]of _e([t]))e.onRepinned?.(x,h)}else t.type==="itemsFailed"?$e+=t.count:t.type==="out"?e.io?.out(t.line):t.type==="log"?u(t.line):t.type==="done"&&T(De??t.code)}),v.on("error",t=>{u(`the session thread failed: ${t instanceof Error&&t.stack?t.stack:w(t)}`),z("thread_crash"),Ve(),T(1)}),v.on("exit",()=>{s.trace.line("thread_exit",{stopped:g!==null,forced:S}),T(g?3:S?130:1)})});J=!0;let ze=e.ingest?.[0]?.then==="pause";W=O===0&&!_&&!ze;let te=O!==0||_,Jt=fe&&!g&&!S&&O!==0&&!_,be=!1,Qt=async()=>{await He(),_?(await c.log.flush().catch(()=>{}),await ye()):O!==0&&!g&&await c.person.setStatus(p,"paused").catch(d=>u(`the pause was not recorded: ${w(d)}`)),await c.log.flush(),!g&&O===0&&!_&&(ze?await c.person.setStatus(p,"paused"):await c.state.end(p,{state:"complete",panel:null,error:null,checkIn:!1,phase:null,child:null,pausing:!1}),te=!0),be=!0};await Promise.race([Qt().catch(d=>u(`the run's ending was not recorded: ${w(d)}`)),Kt]);let Je=!0;if(e.mode==="agent"&&be&&W&&te&&!g&&!S&&(Je=await wn(c,e.choice.projectId,p,u)),S&&!be&&!g){let d=_?ye():c.person.setStatus(p,"paused").catch(b=>u(`the pause was not recorded: ${w(b)}`));await Promise.race([d,new Promise(b=>setTimeout(b,un).unref())])}if(Ee)return C(P.assuranceOff(e.choice.projectName)),2;if(ce!==null)return C(P.resumeUnreadable(ce,p,e.verb==="design"?"design":"extract",c.record.useCase)),2;if(pe)return await Ke();if(S){if(e.mode!=="agent"||g||_)return 130;if(Be)return 3;for(let b of we.splice(0).reverse())e.io?.event({type:"child_end",child:b.child,ok:!1,dur_s:Math.max(1,Math.round((Date.now()-b.at)/1e3)),exit_code:3});let d=ie(e.verb==="design"&&!B?"design":"extract",p,!0);return e.io?.event(l({type:"session_paused",sid:p,...c.record.sourceId?{source_id:c.record.sourceId}:{},mode:"agent",resume:d,expires_at:null,pending_questions:[],next:[{cmd:d,why:"resume"}]})),3}return ue||W&&!te&&!g?await Ge():g?3:Jt?(f({kind:"paused",reason:"not_accepted",sid:p}),3):te?(e.mode==="agent"&&W&&O===0&&e.io?.event(Ct(p,Je,{sourceId:A?.record.sourceId??null,noStartPage:Ae})),yn(O,$e)):(f({kind:"paused",reason:"connection_lost",sid:p}),3)}finally{Ce=!0,L(),c.release(),m?.close("the session ended"),await N?.terminate(),sn(qe,{recursive:!0,force:!0})}}async function kn(e,s,n){try{return Object.fromEntries((await e.sources(s)).map(o=>[o.sourceId,o.origin?.url??null]))}catch(o){return n(`the project's sources were not read: ${w(o)}`),{}}}function Sn(e){let s=e.filter(i=>i.kind==="evolve_answers").at(-1)?.payload,n=s?.request;if(!n||!Array.isArray(s?.answers))return"unread";let o=s.answers.flatMap(i=>typeof i.id=="string"&&(i.choice==="proceed"||i.choice==="decline")?[{id:i.id,choice:i.choice}]:[]);return{request:{...typeof n.ref=="string"?{ref:n.ref}:{},fromStale:n.fromStale===!0,...typeof n.because=="string"?{because:n.because}:{}},answers:o}}function _n(e){let s=[...e.uploads??[]].reverse().find(n=>n.sourceId===e.sourceId&&n.outcome!=="refused"&&(n.filename||n.originUrl));if(s&&!s.filename&&s.originUrl){let n=s.originUrl,o=St(n)?.name??"web";return{sourceId:e.sourceId,file:n,page:Et(o,n,void 0,Re(o,n,e.sourceId))}}return{sourceId:e.sourceId,file:s?.filename??"<file>"}}async function Rn(e,s){if(!(e instanceof ne)||e.code!=="SESSION_CLASH")return;let n=e.extra.heldBy;if(n?.verb!=="design"&&n?.verb!=="evolve")return;let o=re({url:s.latticeUrl,basicAuth:s.basicAuth,...s.fetch?{fetch:s.fetch}:{}});try{if(s.sessionId!==null)return(await o.getSession(s.sessionId)).useCaseTitle??null;if(!s.useCase)return null;let i=(await o.mainNode(s.projectId,s.useCase)).content.title;return typeof i=="string"&&i!==""?i:null}catch(i){return s.log(`the use case's title couldn't be read for the lock's words, so they name its id: ${U(i)}`),null}}export{On as a,ae as b,$n as c,Pe as d,de as e,Sr as f,fn as g,mn as h,hn as i,yn as j,_r as k};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as B}from"./chunk-S3DAAAE5.js";import{a as g}from"./chunk-
|
|
2
|
+
import{b as B}from"./chunk-S3DAAAE5.js";import{a as g}from"./chunk-F22K3RRX.js";import{a as w}from"./chunk-HCBYKLMW.js";import{a as x,b as t,c as h,i as P,j as S}from"./chunk-33DWJV67.js";import{a as C}from"./chunk-6YGTRKDT.js";import{y as s}from"./chunk-D36V5OX6.js";import{e as T}from"./chunk-UR6MHSHU.js";var o=T(C(),1);var e=T(w(),1);function D({defaultName:i,onSubmit:c}){let[d,p]=(0,o.useState)("confirm"),[f,a]=(0,o.useState)(""),[m,u]=(0,o.useState)(null),l=(0,o.useMemo)(()=>f.trim()||i,[f,i]);return P((n,r)=>{if(d==="confirm"){if(n==="y"||n==="Y"){a(i),p("name");return}if(n==="n"||n==="N"||r.escape||r.ctrl&&n==="c"){c(null);return}if(r.return){c(i);return}return}if(r.return){if(!B(l)){u(`name "${l}" is invalid; allowed: letters, digits, underscore, hyphen`);return}c(l);return}if(r.escape||r.ctrl&&n==="c"){c(null);return}if(r.backspace||r.delete){a(v=>v.slice(0,-1)),u(null);return}n&&!r.ctrl&&!r.meta&&(a(v=>v+n),u(null))}),d==="confirm"?(0,e.jsx)(g,{title:"Save session?",titleColor:"#ff9500",rows:[{label:"name",value:(0,e.jsx)(t,{color:s.orange,children:i})}],footer:(0,e.jsxs)(x,{flexDirection:"column",children:[(0,e.jsx)(t,{color:s.dim,children:"enter \u2014 save with this name"}),(0,e.jsx)(t,{color:s.dim,children:"Y \u2014 edit name"}),(0,e.jsx)(t,{color:s.dim,children:"N/esc \u2014 discard session"})]})}):(0,e.jsx)(g,{title:"Save session?",titleColor:"#ff9500",rows:[{label:"name",value:(0,e.jsxs)(x,{children:[(0,e.jsx)(t,{color:s.orange,children:f}),(0,e.jsx)(t,{inverse:!0,children:" "})]})}],footer:(0,e.jsxs)(x,{flexDirection:"column",children:[m&&(0,e.jsx)(t,{color:s.red,children:m}),(0,e.jsx)(t,{color:s.dim,children:"enter \u2014 save \xB7 esc \u2014 discard"})]})})}function V(){return new Date().toISOString().slice(0,19).replace(/:/g,"-")}async function Y(i){return new Promise(c=>{function d(){let{exit:a}=S(),[m,u]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{if(m){let l=setTimeout(()=>a(),50);return()=>clearTimeout(l)}},[m,a]),(0,e.jsx)(D,{defaultName:i,onSubmit:l=>{c(l),u(!0)}})}let{waitUntilExit:p,unmount:f}=h((0,e.jsx)(d,{}),{stdout:process.stderr,exitOnCtrlC:!1});p().then(()=>{try{f()}catch{}})})}export{D as a,V as b,Y as c};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{L as _,a as b,c as x,r as S,x as k,y as O}from"./chunk-UEE3RZN4.js";import{f as v,h as C}from"./chunk-KU3YHPWZ.js";var F=e=>`conv#turn=${e}`,$=(e,r)=>`${e}:turn:${r}`,N=/^(.+):turn:(\d+)$/,G=e=>N.test(e);function P(e){return e.flatMap(r=>{let t=r;return t.kind==="user_message"&&typeof t.data?.message_id=="string"?[t.data.message_id]:[]})}function L(e,r,t,n,o=[]){let a=e.parse(t);if(a!==null&&e.resolveToken(a)===null)return[];let m=new Set(P(n)),s=new Set;for(let i of e.recordsSince(a))i.conv?.source_id===r&&i.conv.turn>=1&&s.add(i.conv.turn);for(let i of o){let c=N.exec(i);c&&c[1]===r&&s.add(Number(c[2]))}if(s.size===0)return[];let d=e.headOf(r,{token:null}),l=typeof d=="string"?e.getNode(d,{token:null})?.content?.blob:void 0,f=typeof l=="string"?e.getBlob(l)?.toString("utf8")??"":"",p=[];for(let i of[...s].sort((c,u)=>c-u)){let c=$(r,i),u=m.has(c)?null:y(f,i);u?.speaker==="person"&&p.push({message_id:c,text:u.text})}return p}function y(e,r){for(let t of e.split(`
|
|
3
|
+
`))if(t.trim())try{let n=JSON.parse(t);if(n.turn===r){let o=n.speaker==="person"||n.speaker==="agent"||n.speaker==="kane"?n.speaker:null;return{text:k(n.text).text,speaker:o}}}catch{}return null}function H(e,r){return y(e,r)?.text??null}var E={format:"conversation",media_type:"text/x-conversation",anchors_supported:["#turn="]},V="su-conv-";function J(e){let{store:r,graph:t,sessionStamp:n}=e,o=`${V}${n}`,a=t.heads.get(o);if(typeof a=="string")return{record:null,errors:[{code:"CONV_SOURCE_EXISTS",detail:`${o} already exists \u2014 resume it`}],sourceId:o,cid:a};let m=r.putBlob(Buffer.from("","utf8")),s=x(o,m),d=C("source",s);if(d.length>0)return{record:null,errors:d.map(p=>({code:p.code,detail:p.detail})),sourceId:o,cid:""};let l=b("source",s);return{record:_(r,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:l,label:v.SOURCE,content:s}],edges:[],review:[],supersessions:[],source_head_moves:{[o]:l},media:{[o]:E},conv:{source_id:o,turn:0,append_of:null}},{graph:t,scope:{sourcePins:[{source_id:o}]},expectPrev:t.latestHash,intent:{v:1,verb:"conv-mint",args:S({sessionStamp:n,by:e.by}),pins:{}},provenance:e.provenance}).record,errors:null,sourceId:o,cid:l}}function X(e){let{store:r,graph:t,sourceId:n,force:o}=e,{text:a,replaced:m}=k(e.text),s=t.heads.get(n),d=t.convChains.get(n);if(typeof s!="string"||!d)return{record:null,errors:[{code:"CONV_SOURCE_MISSING",detail:`${n} is not a live conversation source`}]};let f=t.getNode(s)?.content?.blob;if(typeof f!="string")return{record:null,errors:[{code:"CONV_SOURCE_MISSING",detail:`${n} head node unreadable`}]};let p=r.getBlob(f)?.toString("utf8")??"",i=d.turns,c=i>0?y(p,i):null;if(!o&&c!==null&&c.text===a&&c.speaker===(e.speaker??null))return{record:null,errors:null,turn:i,cid:s,idempotent:!0};let u=i+1,I=e.speaker?{turn:u,text:a,speaker:e.speaker}:{turn:u,text:a},T=`${p}${JSON.stringify(I)}
|
|
4
|
+
`,w=r.putBlob(Buffer.from(T,"utf8")),h=x(n,w),g=b("source",h),R=_(r,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:g,label:v.SOURCE,content:h}],edges:[],review:[],supersessions:[],source_head_moves:{[n]:g},media:{[n]:E},conv:{source_id:n,turn:u,append_of:s}},{graph:t,scope:{sourcePins:[{source_id:n}]},expectPrev:t.latestHash,intent:{v:1,verb:"conv-turn",args:S({sourceId:n,text:a,force:o??!1,by:e.by,...e.speaker?{speaker:e.speaker}:{}}),pins:{append_of:s}},provenance:e.provenance}),B=m>0?{warnings:[O(n,m)]}:{};return{record:R.record,errors:null,turn:u,cid:g,idempotent:!1,...B}}export{F as a,$ as b,G as c,P as d,L as e,H as f,V as g,J as h,X as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as g}from"./chunk-W7FLXW6Q.js";import{g as d}from"./chunk-D756UWY2.js";import{a as c}from"./chunk-3GXN6VF6.js";var p=["grounding","acs","scenarios","wiring","tests"];function P(i){let t=p.filter(e=>e!=="grounding"),n=0;for(let e of i)n=Math.max(n,t.indexOf(e)+1);return n}var x={acs:"acceptance criteria",scenarios:"scenarios",wiring:"acceptance criteria + exercises",tests:"tests + gaps"};function l(i,t,n){let e=t.resolve(n);if(e===null)return[];let s=c(t,e.cid),a=d(i.recordsSince(null),s),r=a.reduce((o,m)=>Math.max(o,m.generation),0);return a.filter(o=>o.generation===r)}function S(i,t,n,e){let s=p;if(!s.includes(e))return{ok:!1,code:"UNKNOWN_PHASE",message:`--phase must be one of ${s.join(" | ")}, got '${e}'`,valid:[...s]};let a=new Set(l(i,t,n).map(o=>o.phase)),r=s.slice(0,s.indexOf(e)).filter(o=>o!=="grounding"&&!a.has(o));return r.length===0?{ok:!0,phase:e}:{ok:!1,code:"PHASE_ORDER",message:`--phase ${e} needs ${r.join(" + ")} committed first (nothing recorded for ${r.join(", ")})`,missing:r,earliest:r[0]}}function E(i,t,n,e){let s=l(i,t,n),a=t.resolve(n);if(a===null)return{priorDesign:void 0,phaseLadder:s};let r=g(t,a.tip);return{priorDesign:r.scenarios.length===0&&r.tests.length===0&&r.acs.length===0?void 0:r,phaseLadder:s}}export{p as a,P as b,x as c,l as d,S as e,E as f};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as E}from"./chunk-7NPTL66J.js";import{a as A,b as I,c as L,d as p,e as N,f as O,g as R,m as T}from"./chunk-ZTHYAHDN.js";import{Fa as f,ka as c}from"./chunk-7HMSMAUG.js";var h="https://integrations.lambdatest.com",m=" kane-cli context ingest <file>";function $(e){try{let n=new URL(e);return`${n.hostname}${n.pathname==="/"?"":n.pathname}`}catch{return e}}function D(e){switch(e.provider){case"web":return`the page ${e.display}`;case"jira":return`Jira issue ${e.display}`;case"confluence":return e.title?`Confluence page "${e.title}"`:`Confluence page ${e.display.split("/").at(-1)}`;case"linear":return`Linear issue ${e.display}`;case"linear-doc":return e.display.startsWith("document ")?`Linear ${e.display}`:`Linear document "${e.display}"`;default:return e.display}}function U(e,n){let t=C(e,n),i={jira:"Jira issue",confluence:"Confluence page",linear:"Linear issue","linear-doc":"Linear document"}[e];return i&&t!==n?`${i} ${t}`:t}function C(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?L(n)?.pageId??n:e==="linear"?p(n)?.key??n:e==="linear-doc"?N(n)?.slugId??n:$(n)}var k=(e,n)=>e==="web"?`the page ${$(n)}`:U(e,n);function z(e){if(!e?.url)return null;let n=e.kind==="url"?"web":e.kind==="linear"?p(e.url)?"linear":"linear-doc":e.kind;return["web","jira","confluence","linear","linear-doc"].includes(n)?k(n,e.url):null}var x=e=>e.provider==="confluence"?e.title??e.display.split("/").at(-1):e.display;function P(e,n){let t={reading:e.provider==="web"?e.display:D(e),address:e.address,...n?{as:n}:{}};return e.provider==="confluence"&&!e.title?{...t,shown:`Confluence page ${e.display.split("/").at(-1)}`,bare:!0}:e.provider==="linear-doc"&&e.display.startsWith("document ")?{...t,shown:`Linear ${e.display}`,bare:!0}:{...t,shown:x(e)}}function q(e,n,t){return T(e)?.sourceIdFor(n)===t?void 0:t}function Q(e,n){try{let t=I(e,n)?.title;return typeof t=="string"&&t.length>0?t:void 0}catch{return}}function X(e,n,t,i){let s=C(e,n),d=e==="linear-doc"?t??`document ${s}`:s;return P({provider:e,display:d,...t?{title:t}:{},address:n},i)}var Z=e=>`with ${e.delivered+e.omitted} attachments: ${e.delivered} of its images added, ${e.omitted} left out`,ee=(e,n,t=!1)=>`the same ${t?"file":"text"} as "${e}", already in "${n}"`;function y(e,n){return e==="jira"?A(n)?.issueKey??n:e==="confluence"?`the Confluence page ${L(n)?.pageId??n}`:e==="linear"?p(n)?.key??n:e==="linear-doc"?`the Linear document ${N(n)?.slugId??n}`:`the page ${$(n)}`}var w=e=>e==="jira"?"Jira":e==="confluence"?"Confluence":e.startsWith("linear")?"Linear":"the web",S=e=>e.startsWith("linear")?"Linear":"Atlassian",b=e=>O(e)?.workspace??R(e)?.workspace??"<workspace>",G={invalid_url:"INVALID_URL",target_disallowed:"ADDRESS_NOT_ALLOWED",page_not_found:"PAGE_NOT_FOUND",page_access_blocked:"PAGE_BLOCKED",page_paywalled:"PAGE_PAYWALLED",unsupported_content_type:"NOT_A_PAGE",page_too_large:"PAGE_TOO_LARGE",page_timeout:"PAGE_TIMEOUT",scrape_unavailable:"PAGES_UNAVAILABLE",scrape_rate_limited:"PAGES_UNAVAILABLE",internal_error:"PAGES_UNAVAILABLE",malformed_response:"PAGES_UNAVAILABLE",credit_denied:"OUT_OF_CREDITS",auth_rejected:"CREDENTIALS_REJECTED",route_missing:"PAGES_NOT_AVAILABLE",transport_unreachable:"CONNECTION_FAILED",LIS_AUTH:"CREDENTIALS_REJECTED",JIRA_NOT_CONNECTED:"NO_CONNECTION",JIRA_ISSUE_UNAVAILABLE:"ITEM_UNAVAILABLE",LIS_UNAVAILABLE:"INTEGRATION_UNAVAILABLE",LIS_SETUP:"INTEGRATION_SETUP",LIS_FORBIDDEN:"NO_ACCESS",LIS_RATE_LIMITED:"INTEGRATION_BUSY"};function ne(e,n,t){let i=G[t.code]??t.code,s=y(e,n),d=w(e),a=(u,o,g=!1)=>({code:i,message:u,remedy:o,...g?{support:!0}:{}});switch(i){case"INVALID_URL":return a(`${n} isn't a valid public web address, so nothing was added`,"check the address, then run the command again");case"ADDRESS_NOT_ALLOWED":return a(`${n} can't be fetched: it isn't an allowed public web page, so nothing was added`,`use a public page's address, or save the page as a file and add the file:
|
|
3
|
+
${m}`);case"PAGE_NOT_FOUND":return a(`${s} couldn't be found, so nothing was added`,"check that the address is right and the page still exists, then run the command again");case"PAGE_BLOCKED":return a(`${s} refused automated access, so nothing was added`,`use a version of the page anyone can open, or save it as a file and add the file:
|
|
4
|
+
${m}`);case"PAGE_PAYWALLED":return a(`${s} is behind a paywall or a sign-in, so nothing was added`,`use a copy anyone can open, or save it as a file and add the file:
|
|
5
|
+
${m}`);case"NOT_A_PAGE":return a(`${$(n)} isn't a web page, so nothing was added`,`download the document, then add the file:
|
|
6
|
+
${m}`);case"PAGE_TOO_LARGE":return v(e,n,"","");case"PAGE_TIMEOUT":return a(`${s} took too long to load, so nothing was added`,"run the command again later");case"PAGES_UNAVAILABLE":return a("web pages can't be fetched right now, so nothing was added","run the command again later");case"OUT_OF_CREDITS":return a(`${s} couldn't be added: your organization is out of credits`,"to see your organization's credits, run: kane-cli balance");case"CREDENTIALS_REJECTED":return a(`your login was refused, so ${s} couldn't be read and nothing was added`,`log in again, then run the command again:
|
|
7
|
+
kane-cli login`);case"PAGES_NOT_AVAILABLE":return a("adding web pages isn't available here yet, so nothing was added",`save the page as a file, then add the file:
|
|
8
|
+
${m}`);case"CONNECTION_FAILED":return a(`${s} couldn't be fetched: kane-cli couldn't connect, so nothing was added`,"check your connection, then run the command again");case"NO_CONNECTION":return a(`${s} can't be read: your account has no ${S(e)} connection yet, so nothing was added`,`connect ${d} at ${h}, then run the command again`);case"NO_COMMENTS_ACCESS":return a(`${s} can't be read: your Atlassian connection can't read comments yet, so nothing was added`,`sync the connection again at ${h}, then run the command again`);case"PROJECT_NOT_SELECTED":{let u=t.facts?.project??"";return a(`${s} can't be read: your Jira connection doesn't read the project ${u}, so nothing was added`,`add ${u} to the connection at ${h}, then run the command again`)}case"NO_CONFLUENCE_ACCESS":return a(`${s} can't be read: your Atlassian connection has no Confluence access, so nothing was added`,`connect again with Confluence at ${h}, then run the command again`);case"NO_ISSUE_ACCESS":return a(`${s} can't be read: your Linear connection can't read issues or their comments yet, so nothing was added`,`sync the connection again at ${h}, then run the command again`);case"NO_DOCUMENT_ACCESS":return a(`${s} can't be read: your Linear connection can't read documents yet, so nothing was added`,`sync the connection again at ${h}, then run the command again`);case"LINEAR_PAGE":return a("that Linear page isn't an issue or a document, so nothing was added",`add its issues or documents one by one, for example:
|
|
9
|
+
kane-cli context ingest https://linear.app/${b(n)}/issue/ENG-42`);case"LINEAR_LINK_MALFORMED":return a("that Linear address is incomplete, so nothing was added",`use the full address, for example:
|
|
10
|
+
kane-cli context ingest https://linear.app/${b(n)}/issue/ENG-42`);case"ITEM_UNAVAILABLE":return a(`${s} couldn't be found, or you don't have access to it, so nothing was added`,`check the address and your access in ${d}, then run the command again`);case"INTEGRATION_UNAVAILABLE":return a(`${d} can't be reached right now, so nothing was added`,"run the command again later");case"ATTACHMENT_TOO_LARGE":return a(`an attachment of ${s} is too large to add, so nothing was added`,`remove or shrink it in ${d}, then run the command again`);case"INTEGRATION_SETUP":return a(`your ${S(e)} connection needs syncing again, so nothing was added`,`sync it at ${h}, then run the command again`);case"NO_ACCESS":return a(`you don't have access to ${s}, so nothing was added`,`ask for access in ${d}, then run the command again`);case"INTEGRATION_BUSY":return a(`${d} is busy right now, so nothing was added`,"wait a moment, then run the command again");default:return{code:"FETCH_FAILED",message:`${s} couldn't be fetched, so nothing was added`,remedy:"run the command again",support:!0}}}function v(e,n,t,i){if(e==="web")return{code:"PAGE_TOO_LARGE",message:`${y(e,n)} has too much text to add as one source, so nothing was added`,remedy:"use a narrower page, or trim it, then run the command again"};let s=e==="jira"?"trim its description or attachments in Jira":e==="confluence"?"trim the page in Confluence":e==="linear"?"trim the issue in Linear":"trim the document in Linear",d=t&&i?` (${t}; the limit is ${i})`:"";return{code:"FETCH_FAILED",message:`${y(e,n)} is too large to add${d}, so nothing was added`,remedy:`${s}, then run the command again`}}var F={web:"a web page",jira:"a Jira issue",confluence:"a Confluence page",linear:"a Linear issue","linear-doc":"a Linear document"},B={web:{kind:"a web page",noun:"page"},jira:{kind:"a Jira issue",noun:"issue"},confluence:{kind:"a Confluence page",noun:"page"},linear:{kind:"a Linear issue",noun:"issue"},"linear-doc":{kind:"a Linear document",noun:"document"}};function te(e,n,t,i){let s=t.facts?.id??"",{kind:d,noun:a}=B[e]??{kind:"a source",noun:"source"},u=`${c([n])} --as ${f(t.facts?.freeId??`${s}-2`)}`,o=`to add this ${a} as a source of its own, run:
|
|
11
|
+
${u}`,g=[{cmd:u,why:"add it as a source of its own"}];switch(t.code){case"SITE_MOVED":return{code:"SITE_MOVED",message:`"${s}" in "${i}" came from another ${w(e)} site, so this ${a} can't be its new version, and nothing was added`,remedy:o,next:g};case"KIND_MISMATCH":{let l=F[t.facts?.heldKind??""]??"a file";return{code:"KIND_MISMATCH",message:`"${s}" in "${i}" is ${l}, not ${d}, so this ${a} can't be its new version, and nothing was added`,remedy:o,next:g}}case"WEB_URL_CHANGED":return{code:"WEB_URL_CHANGED",message:`"${s}" in "${i}" was added from another address, ${$(t.facts?.previous??"")}, so nothing was added`,remedy:o,next:g};case"UUID_MOVED":if(t.facts?.holder){let l=t.facts.holder,_=`${c([n])} --as ${f(l)}`;return{code:"UUID_MOVED",message:`this ${w(e)} ${a} is already in "${i}" as "${l}" (its key changed), so nothing was added`,remedy:`to add this read as its new version, run:
|
|
12
|
+
${_}`,next:[{cmd:_,why:"add it as its new version"}]}}return{code:"UUID_MOVED",message:`"${s}" in "${i}" came from another ${w(e)} ${a} with the same key, so this ${a} can't be its new version, and nothing was added`,remedy:o,next:g};default:return{code:t.code,message:`"${s}" in "${i}" came from another ${w(e)} ${a} with the same key, so this ${a} can't be its new version, and nothing was added`,remedy:o,next:g}}}function ae(e){let n=`${e} isn't a file or a web address, so nothing was added`,t=e.slice(e.indexOf(":")+1),i=e.slice(0,e.indexOf(":")).toLowerCase();return i==="jira"?{code:"UNSUPPORTED_URL",message:n,remedy:`for a Jira issue, add its address, for example:
|
|
13
|
+
kane-cli context ingest https://<your site>/browse/${t}`}:i==="confluence"?{code:"UNSUPPORTED_URL",message:n,remedy:`for a Confluence page, add its address, for example:
|
|
14
|
+
kane-cli context ingest https://<your site>/wiki/spaces/<space>/pages/${t}`}:i==="linear"?{code:"UNSUPPORTED_URL",message:n,remedy:`for a Linear issue, add its address, for example:
|
|
15
|
+
kane-cli context ingest https://linear.app/<workspace>/issue/${t}`}:{code:"UNSUPPORTED_URL",message:n,remedy:"add a file, or the item's full web address, then run the command again"}}var se=e=>({code:"AS_SINGLE_SOURCE",message:"--as names one source, so it takes one file or address at a time, and nothing was added",remedy:`to add each as a source of its own, run it without --as:
|
|
16
|
+
${c(e)}`,next:[{cmd:c(e),why:"add each as a source of its own"}]});function ie(e,n,t,i={}){let{reviews:s=[],link:d=!1,firstTwin:a=!0}=i,u=r=>r.length>2?`${r.slice(0,-1).join(", ")} and ${r.at(-1)}`:`${r[0]} and ${r[1]}`,[o,g]=e,l=s.length===0?"":s.length===1?`, then ${s[0].name} on its own to review what changed`:", then each new version on its own";return{code:"SAME_SOURCE_ID",message:e.length>2?`${e.length} sets of sources would each share an id (${u(e.map(r=>`"${r.id}"`))}), so nothing was added`:`${u(o.names)} would ${o.names.length>2?"all":"both"} be added as "${o.id}"${g?`, and ${u(g.names)} as "${g.id}"`:""}, so nothing was added`,remedy:[`add them one at a time, the second under another id${l}:`,...n.length>0?[` ${c(n)}`]:[],...t.map(r=>` ${c([r.ref])} --as ${r.as===null?"<another id>":f(r.as)}`),...s.map(r=>` ${c([r.ref])}`)].join(`
|
|
17
|
+
`),...t.every(r=>r.as!==null)&&!d?{next:[...n.length>0?[{cmd:c(n),why:a?"add the first":"add the others"}]:[],...t.map(r=>({cmd:`${c([r.ref])} --as ${f(r.as)}`,why:`add the ${M[r.place??2]??"next"} under another id`})),...s.map(r=>({cmd:c([r.ref]),why:`review what changed in ${E(r.id)}`}))]}:{}}}var M={2:"second",3:"third",4:"fourth",5:"fifth"};function oe(e,n,t){let i=e[0],s=e.length===1?`${i.name} on its own`:"each new version on its own",d=o=>o.length>2?`${o.slice(0,-1).join(", ")} and ${o.at(-1)}`:o.join(" and "),a=e.some(o=>o.shown!==void 0);return{code:"NEW_VERSION_ALONE",message:e.length===1?i.shown!==void 0?`${i.name} is already in "${t}", and its new version is reviewed on its own, so nothing was added`:`${i.name} is a new version of "${i.id}", and a new version is reviewed on its own, so nothing was added`:e.length===2&&!a?`${e[0].name} and ${e[1].name} are new versions of "${e[0].id}" and "${e[1].id}", and a new version is reviewed on its own, so nothing was added`:`${e.length} of these sources are new versions (${d(e.map(o=>E(o.shown??o.id)))}), and each is reviewed on its own, so nothing was added`,remedy:[n.length>0?`add the others first, then ${s} to review what changed:`:`add ${s} to review what changed:`,...n.length>0?[` ${c(n)}`]:[],...e.map(o=>` ${c([o.ref])}`)].join(`
|
|
18
|
+
`),next:[...n.length>0?[{cmd:c(n),why:"add the others"}]:[],...e.map(o=>({cmd:c([o.ref]),why:`review what changed in ${E(o.shown??o.id)}`}))]}}var re=e=>`${e.length>1?`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`:e[0]} ${e.length>1?"weren't":"wasn't"} added either: one command adds all its sources, or none`,de=e=>({code:"LINKS_NOT_TAKEN",message:`"${e}" can't take links yet, so nothing was added`,remedy:`save the page as a file, then add the file:
|
|
19
|
+
${m}`});export{D as a,U as b,C as c,k as d,z as e,x as f,P as g,q as h,Q as i,X as j,Z as k,ee as l,ne as m,v as n,te as o,ae as p,se as q,ie as r,oe as s,re as t,de as u};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{closeSync as $,existsSync as _,mkdirSync as d,openSync as k,readFileSync as u,readdirSync as m,renameSync as w,rmSync as f,writeFileSync as y}from"fs";import{basename as S,join as c}from"path";var a=class extends Error{constructor(e,t){super(`${e}: ${t}`);this.code=e}},p=r=>c(r,"reconcile","plans");function g(r,n){let e=`${r}.tmp-${process.pid}`;y(e,n,{mode:384}),w(e,r)}function x(r,n){let e=p(r);d(e,{recursive:!0});let t=c(e,`${n.created}-${n.source_id}.json`);return g(t,JSON.stringify(n,null,2)+`
|
|
3
|
+
`),t}function P(r,n){let e=n;if(e===void 0){let o=p(r),l=[];try{l=m(o).filter(A=>A.endsWith(".json")).sort()}catch{}if(l.length===0)return{error:`no stored plans under ${o} \u2014 run reconcile --plan first`};e=c(o,l[l.length-1])}if(!_(e))return{error:`no such plan file: ${e}`};let t;try{t=u(e,"utf8")}catch(o){return{error:`cannot read plan ${e}: ${o instanceof Error?o.message:String(o)}`}}let i;try{i=JSON.parse(t)}catch(o){return{error:`corrupted plan ${e}: ${o instanceof Error?o.message:String(o)}`}}let s=i?.version;return s===1?{error:`plan predates the vocabulary change \u2014 recompute with --from <file> --source-id <id> (${e})`}:s!==2?{error:`unsupported plan version ${String(s)} in ${e} (expected 2)`}:Array.isArray(i.rows)?{plan:i,path:e}:{error:`not a reconcile plan \u2014 ${e} has no rows[] (hand-edited?)`}}function v(r){let n=r.archive_state??{};return(r.changeset??[]).filter(e=>e.kind==="ARCHIVE"&&n[e.ref]===void 0).map(e=>e.ref)}function b(r,n,e){let t=P("",r);if("error"in t)throw new a("PLAN_UNREADABLE",t.error);let i=t.plan,s=i.archive_state??{};if(s[n]!==void 0)throw new a("ROW_ALREADY_APPLIED",`archive ${n} already ${s[n].outcome}`);s[n]={at:new Date().toISOString(),outcome:e},i.archive_state=s,g(r,JSON.stringify(i,null,2)+`
|
|
4
|
+
`)}function D(r,n){let e=c(p(r),"superseded");d(e,{recursive:!0});let t=c(e,S(n));return w(n,t),t}function E(r,n){let e=p(r),t=[];try{t=m(e).filter(i=>i.endsWith(`-${n}.json`)).sort()}catch{}return t.length===0?null:P(r,c(e,t[t.length-1]))}function O(r,n){let e=E(r,n);if(e===null||"error"in e)return null;let t=e.plan.rows.filter(i=>i.applied===void 0).length+v(e.plan).length;return t>0?{path:e.path,created:e.plan.created,pending:t}:null}function W(r,n,e){let t;try{t=JSON.parse(u(r,"utf8"))}catch(s){throw new a("PLAN_UNREADABLE",`${r}: ${s instanceof Error?s.message:String(s)}`)}let i=t.rows?.[n];if(!i)throw new a("ROW_MISSING",`${r} has no row ${n}`);if(i.applied)throw new a("ROW_ALREADY_APPLIED",`row ${n} of ${r} was already applied (${i.applied.outcome} at ${i.applied.at})`);i.applied={at:new Date().toISOString(),outcome:e},g(r,JSON.stringify(t,null,2)+`
|
|
5
|
+
`)}function I(r){let n=p(r);d(n,{recursive:!0});let e=c(n,".walk-lock");for(let t=0;t<2;t++)try{let i=k(e,"wx");return y(i,`${process.pid}
|
|
6
|
+
`),$(i),()=>{try{f(e)}catch{}}}catch(i){if(i.code!=="EEXIST")throw i;let s=h(e);if(!Number.isFinite(s)){let l=Date.now()+50;for(;Date.now()<l;);s=h(e)}if(Number.isFinite(s)&&L(s))throw new a("WALK_LOCKED",`another reconciliation is already running (pid ${s}) \u2014 wait for it to finish; if it appears stuck, stop that process before retrying`);try{f(e)}catch{}}throw new a("WALK_LOCKED",`could not take the walk lock at ${c(n,".walk-lock")}`)}function h(r){try{return parseInt(u(r,"utf8").trim(),10)}catch{return NaN}}function L(r){try{return process.kill(r,0),!0}catch{return!1}}export{x as a,P as b,v as c,b as d,D as e,E as f,O as g,W as h,I as i};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
function l(e){return{command:(t,n)=>e.commands[t](n),text:(t,n)=>e.texts[t](n)}}function $(e,t,n){let s=n?(i,a)=>n[i](a):e.header;return{command:e.command,text:(i,a)=>{let u=t[i];return u?u(a):e.text(i,a)},...s?{header:s}:{}}}function w(e,t){let n=e.command("next.resume_session",t),s=e.command("next.resume_with_message",t);return{...n!==null?{resume:n}:{},...s!==null?{resumeMessage:s}:{}}}function x(e,t,n,s){let i=e.command(t,n);return i!==null?{cmd:i,...s}:{code:t,facts:n,...s}}import{getEnvironmentData as v,setEnvironmentData as f}from"worker_threads";var d=(e,t)=>e?`${e} ${t}${e>1?"s":""}`:null,p={"chat.added_use_cases":({minted:e,matched:t})=>e===0&&t>0?`all ${t} matched existing \u2014 nothing new to save`:`saved ${e} use-case${e===1?"":"s"} as drafts`+(t>0?` \xB7 ${t} matched existing`:""),"chat.added_design":({acs:e,scenarios:t,tests:n,gaps:s})=>`saved ${[d(e,"AC"),d(t,"scenario"),d(n,"test"),d(s,"gap")].filter(Boolean).join(" \xB7 ")||"judgements/wiring"} as drafts`,"chat.proposal_refused":()=>"proposal failed validation \u2014 nothing landed","chat.commit_failed":()=>"commit failed \u2014 nothing landed","chat.approved":({count:e})=>`${e} change${e===1?"":"s"} applied`,"chat.stales":({count:e})=>`stales ${e}`,"chat.held_degraded":({held:e})=>`held ${e} item(s) for review \u2014 semantic dedup ran degraded (embeddings unavailable); nothing saved this turn`,"chat.child_back":({drafts:e})=>`${e} draft${e===1?"":"s"} saved`,"chat.refine_hint":()=>'chat to refine ("looks good" approves; /done finishes)',"chat.repair_sent":()=>"that couldn't be saved as it was \u2014 the agent is fixing it","chat.updates_held":({count:e})=>`${e} update(s) held for review`,"note.dedup_reduced":()=>"note: duplicate detection is running in a reduced mode this run \u2014 new items will be held for your review instead of committed","note.chain_recovered":({sid:e})=>`session ${e}: checkpoint chain present with no pointer \u2014 recovering from the chain`,"note.chain_truncated":({sid:e,at:t,lost:n})=>`session ${e}: chain truncated to checkpoint ${t} \u2014 ${n} turn(s) lost to a corrupt record`,"note.turns_unrecorded":({detail:e})=>`this chat's turns are not being saved to its conversation (${e}) \u2014 your messages still reach the agent, but a resume cannot send them again`,"note.receipt_unbuilt":({detail:e})=>`a saved change's receipt for the agent could not be built (${e}) \u2014 the change is saved, but the agent is not told what it saved`,"note.tests_await_approval":({tests:e,criteria:t,criterion:n})=>{let s=e===1?"1 test checks":`${e} tests check`;return t===1&&n!==null?`note: ${s} a criterion not approved yet \u2014 say "approve ${n}"`:`note: ${s} criteria not approved yet \u2014 say "approve the criteria"`},"note.phase_unchanged":()=>"this phase matched what's already there \u2014 nothing new added","warning.variables_unwritten":({message:e})=>`warning: the design was saved, but its variable stubs could not be written (${e})`};var r=()=>null,c=e=>`resume session ${e}, which holds it`,h="review the current version again",g="retire it first, or add this under another id",m=l({commands:{"next.resume_session":r,"next.resume_with_message":r,"next.resume_child":r,"next.design_use_case":r,"next.review_use_case":r,"next.design_unreviewed":r,"next.view_design":r,"next.evolve_design":r,"next.redesign":r,"next.design_phase":r,"next.answer_evolve":r,"next.abandon_session":r,"next.review_held_changeset":r,"next.show_session":r,"next.review_source":r},texts:{...p,"note.paused":({sid:e})=>`paused: session ${e} saved and can be resumed`,"note.crashed":({sid:e,seq:t})=>`agent crashed \u2014 session ${e} can be resumed from its checkpoint ${t} (at most the in-flight turn lost)`,"note.model_unavailable_kept":({sid:e,detail:t})=>`the model service did not answer (${t}) \u2014 session ${e} is kept and can be resumed once it answers`,"note.model_retry":({seconds:e})=>`the model service is not answering; trying again in ${e}s`,"note.held_for_review":({sid:e,held:t})=>`paused: ${t} held item(s) await review in session ${e}`,"note.already_extracted":({source_id:e})=>`${e} already extracted \u2014 skipped`,"note.conversation_source_skipped":({source_id:e})=>`skipped ${e} \u2014 a conversation source is extracted only when it is named`,"note.reconcile_plan_pending":({source_id:e,pending:t})=>`note: a reconcile plan for ${e} is pending (${t} item(s))`,"note.nothing_to_extract":({sources:e,count:t})=>`extract: nothing to do \u2014 ${e} ${t===1?"is":"are all"} already extracted at the current snapshot`,"note.only_conversation_sources":()=>"extract: nothing to do \u2014 only conversation sources here, and each is extracted only when it is named","note.all_extracted":()=>"extract: nothing to do \u2014 every ingested source is already extracted","note.changeset_held_for_review":({sid:e,held:t})=>`paused: ${t} held change(s) await your verdicts in session ${e}`,"note.session_kept":({sid:e,seq:t,ts:n})=>`session ${e} kept its last checkpoint (seq ${t}, ${n}) and can be resumed`,"note.assumed_defaults":({sid:e,count:t})=>`note: ${t} default(s) were assumed while you were away \u2014 session ${e} lists them`,"note.landed_changed":({source_id:e})=>`note: ${e} changed after it was added \u2014 skipping its extraction this run; extract it again to pick up the newer version`,"note.landed_older_queued":({source_id:e})=>`note: an older version of ${e} is already queued this run \u2014 the newly landed version is not extracted; extract it again to pick it up`,"note.reingest_binary":({source_id:e,kind:t})=>`skipping ${e}: binary ${t} ingested before image support \u2014 add it again to extract from it`,"note.schedule_refused":()=>"this run holds items for review, so its extraction is not scheduled \u2014 it runs after the review","note.not_reached":()=>"run ended before its turn \u2014 extracting again runs it","note.nothing_committed":({source_id:e,remaining:t})=>`done \u2014 nothing committed for ${e} (no finalize before the session ended)`+(t>0?`; stopping here \u2014 ${t} remaining source(s) not extracted (extract them again to continue)`:""),"note.landed_not_extracted":({count:e,sources:t})=>`note: ${e} source(s) landed this session (${t}) were not extracted \u2014 the session ended first; extracting again runs them`,"note.evidence_not_attached":({count:e})=>`note: ${e} unchanged match(es) target unreviewed (or no-longer-resolving) item(s) \u2014 evidence not attached (review them; a later reconcile attaches)`,"note.sources_failed":({failed:e,total:t,sources:n})=>`${e} of ${t} source(s) failed \u2014 extract them again to retry (${n})`,"note.already_designed":({use_case:e,version:t})=>`'${e}' is already designed @ v${t} \u2014 current; redesign it to replace that design`,"note.design_stale":({use_case:e,designed:t,current:n})=>`'${e}' was designed @ ${t} \u2014 the use-case is now @ v${n} (STALE); evolve or redesign it`,"note.view_design":({use_case:e})=>`view the existing design of ${e}`,"note.evolve_first":({use_case:e})=>`refresh it first: evolve ${e}`,"note.nothing_executed":()=>"nothing executed","note.tests_await_approval_command":({tests:e,criteria:t,criterion:n})=>{let s=e===1?"1 test checks":`${e} tests check`;return t===1&&n!==null?`note: ${s} a criterion not approved yet; approve ${n}`:`note: ${s} criteria not approved yet; approve them`},"note.links_await_approval":({count:e})=>`warning: ${e} test link(s) refer to items still awaiting approval \u2014 saved anyway; review and approve those items`,"note.no_design_skipped":({use_case:e})=>`note: ${e} has no design output \u2014 nothing to evolve; design it first`,"note.no_design":({use_case:e})=>`nothing to evolve \u2014 design ${e} first (no design output)`,"note.design_paused":({use_case:e})=>`design session for ${e} paused \u2014 resume it, then evolve again for the diff`,"note.nothing_changed":({ref:e})=>`nothing changed underneath ${e} \u2014 its sources and requirements are current; give a reason to re-design anyway`,"note.source_changed_skipped":({use_case:e})=>`${e} is left out: it's out of date because its source changed \u2014 review its source's change first`,"note.source_changed":({use_case:e})=>`${e} is out of date because its source changed, and an update can't change that \u2014 review its source's change first`,"note.source_changed_after":({use_case:e})=>`${e} is still out of date because its source changed \u2014 review its source's change`,"note.checkpoint_not_saved":({error:e,chain_unverified:t})=>`warning: couldn't save the session checkpoint \u2014 ${e}; asking the agent to pause`+(t?". The store's record chain fails verification.":""),"note.held_no_event_id":({sid:e})=>`this held row has no durable event id \u2014 ${c(e)}, to drop it`,"note.held_no_provenance":({sid:e})=>`this held row carries no committable provenance \u2014 ${c(e)}, to apply it`,"note.held_no_citable_text":({sid:e,source_id:t,source_cid:n})=>`the pinned source ${t} (${n.slice(0,19)}) has no citable text to verify this held row against \u2014 ${c(e)}`,"note.held_unverified":({sid:e,errors:t})=>`held provenance does not verify against the pinned source (${t}) \u2014 ${c(e)}`,"note.controller_unreachable":({base:e,error:t})=>`error: cannot reach the controller at ${e} (${t})
|
|
3
|
+
hint: check the network connection and the sign-in`,"note.assurance_unsupported":()=>"error: this environment does not support assurance sessions yet (404) \u2014 contact support if the problem persists","note.credentials_rejected":({env:e})=>`error: your credentials were rejected (401) \u2014 sign in again (active environment: ${e})`,"note.key_recycled":({source_id:e,what:t})=>`source '${e}' was ingested from a different ${t} that used this key \u2014 the key was recycled; ${g}`,"note.kind_taken":({source_id:e,backing:t,kind:n})=>`source '${e}' is already backed by ${t}, not ${n} \u2014 ${g}`,"note.site_moved":({source_id:e,previous:t,site:n})=>`source '${e}' was ingested from ${t}, but this read serves ${n} \u2014 ${g}`,"note.web_url_changed":({source_id:e,previous:t})=>`source '${e}' was ingested from ${t} \u2014 adopt the new URL as its next version, or add it under another id`,"note.web_id_taken":({url:e})=>`skipped ${e} \u2014 add it under another id to keep both pages`,"note.web_login":()=>"your credentials were rejected \u2014 sign in again and retry","note.web_projection_unknown":({kind:e})=>`unknown web projection kind '${e}' \u2014 this source needs a newer engine to read it`,LIS_AUTH:()=>"credentials rejected \u2014 sign in again and retry",MULTI_SOURCE_RESUME:({sid:e,sources:t})=>`error: session ${e} spans ${t} sources \u2014 multi-source resume isn't supported yet; committed work is preserved (extract anything remaining again)`,CHANGE_BASIS_MOVED:({source_id:e,sid:t})=>`error: ${e} moved while this reconcile extraction was paused \u2014 its recorded change context no longer matches; review the current version instead (session ${t} is defunct and can be ignored)`,PROPOSAL_UNREADABLE:({proposal:e})=>`proposal ${e} is unreadable \u2014 review the source's changes again`,SOURCE_UNRESOLVED:({source_id:e})=>`the source ${e} no longer resolves \u2014 cannot verify this changeset is current; review the source's changes again`,SOURCE_MOVED:({source_id:e})=>`the source ${e} moved again while this review was open \u2014 review its changes again to refresh the changeset`,ARCHIVE_UNRESOLVED:({use_case:e})=>`its archive op no longer resolves to ${e} \u2014 review the source's changes again`,POSTURE_IN_CHAT:({sid:e})=>`error: session ${e} is a held reconcile review \u2014 resumed in the chat its changes would commit without verdicts; give its cards their verdicts in the review`,SOURCE_MISSING:({sid:e,sources:t})=>`error: resumed session's paused source (${t}) is no longer in the corpus \u2014 add it again and resume session ${e}, or abandon that session`,BLOB_MISSING:({source_id:e})=>`error: ${e}: its stored content is missing \u2014 add the file again [BLOB_MISSING]`,"AGENT_FAILED.invalid_proposal":({source_id:e})=>`error: the agent could not produce a valid proposal for ${e} \u2014 extract it again to retry`,UC_UNREVIEWED:({use_case:e})=>`${e} is unreviewed \u2014 approve it first, or design it unreviewed`,"UC_UNREVIEWED.merge_target":({temp_ref:e,target:t})=>`${e}: merge target ${t} is unreviewed (derived) \u2014 approve it first and re-propose the merge`,UC_HELD:({use_case:e,owner_sid:t,stopped:n})=>`design: ${e} is being designed by another session`+(n?` \u2014 that session looks stopped; resume session ${t??"<session>"}`:"")+" \u2014 pick another use-case or wait for it to finish",GENERATION_LIVE:({use_case:e,gen:t})=>`${e} already has a live design generation (gen ${t}) \u2014 redesign it, with a reason, to supersede it`,MESSAGE_TOO_LARGE:({bytes:e,max:t})=>`error: the opening statement is ${e} bytes and the agent takes at most ${t} per message (it would drop it silently) \u2014 give a shorter reason (it replaces the generated stale reason)`,REASON_TOO_LARGE:()=>"nothing was started: that reason is too long; run it again with a sentence or two",SESSION_V1:({sid:e})=>`session ${e} predates durable checkpoints \u2014 this build cannot resume it; abandon it and start a fresh run (committed work is untouched)`,WRONG_VERB:({sid:e,verb:t})=>`error: session ${e} is a ${t} session \u2014 resume it as one`,"HELD_CITES_STALE.moved":()=>`the source moved after this plan staged \u2014 its quotes no longer verify against the current head; ${h}`,"HELD_CITES_STALE.predates_images":({where:e,anchor:t})=>`${e}: this plan predates image-part staging \u2014 ${t} cannot be verified against the version it staged under; ${h}`,"HELD_CITES_STALE.no_image":({where:e,anchor:t})=>`${e}: ${t} names no decodable image of the staged version \u2014 ${h}`,"HELD_CITES_STALE.image_moved":({where:e,anchor:t,gone:n})=>`${e}: the image behind ${t} is ${n?"no longer in":"ambiguous in"} the current head \u2014 ${h}`}});var _="kane-context:flushToDisk",o=null;function U(e){o=e,e.flushToDisk!==void 0&&f(_,e.flushToDisk)}function A(){if(!o)throw new Error("engine config not set; the host must call setEngineConfig before any engine call");return o}function I(){return o?.writersFenced===!0}function L(){return(o?.flushToDisk??v(_))!==!1}function O(){return o?.warn}function W(){return o?.userSessionId?.()??null}function H(){return o?.version??null}function D(){return o?.wording??m}export{l as a,$ as b,w as c,x as d,p as e,U as f,A as g,I as h,L as i,O as j,W as k,H as l,D as m};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as b}from"./chunk-ZHWU6L2G.js";import{e as g,g as d,n as m,r as h}from"./chunk-DBMW3VUN.js";function x(i,o,a){let y=i.tipOf(a),p=i.derivesInto(y).filter(t=>Array.isArray(t.props.units)&&typeof t.props.source_id=="string");if(p.length===0)return[];let l=new Map;for(let t of p)l.set(String(t.props.source_id),[...l.get(String(t.props.source_id))??[],t]);let c=new Map;for(let[t,n]of l){let r=i.heads.get(t),e=typeof r=="string"?g(r,s=>i.mediaOf(s)?.plugin):null;c.set(t,e===null?new Set(n.flatMap(s=>s.props.units)):new Set(d(n,e).failing))}let u=new Map,C=t=>{let n=u.get(t);if(n===void 0){let r=i.mediaOf(t)?.plugin?.index,e=r===void 0?null:m(o(r));n=new Map((e?.units??[]).flatMap(s=>{let f=b(s.label);return f!==null?[[s.id,f]]:[]})),u.set(t,n)}return n};return p.map(t=>{let n=String(t.props.source_id),r=String(t.props.source_cid);return{source_id:n,version:r,anchor:String(t.props.anchor),units:t.props.units.map(e=>({id:e,label:C(r).get(e)??null,fresh:!c.get(n).has(e)}))}})}function I(i){return`${i.source_id} ${i.anchor}: ${i.units.map(o=>`${o.id}${(a=>a!==null?` ${a}`:"")(h(o.label))}${o.fresh?"":" (stale)"}`).join(", ")}`}export{x as a,I as b};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{c as A,d as C}from"./chunk-FWUPJORV.js";import{e as x}from"./chunk-5D7ENQTQ.js";import{b,e as R}from"./chunk-7YT4TTKL.js";import{f as D,h as S,l as E}from"./chunk-W6HZF56M.js";import{b as I,c as _,g as N,h as k}from"./chunk-Y6Y6RAY4.js";import{b as h}from"./chunk-NXAJBSIF.js";import{a as v}from"./chunk-C2RUDJ46.js";import{h as y}from"./chunk-A7RJQJNT.js";import{mkdirSync as H,writeFileSync as q}from"fs";import{join as z}from"path";function P(e,t=process.env){return t.KANE_MOBILE_APP_BASE_URL||v(e).mobileAppBaseUrl}var J="device-config.json",$=new WeakMap;function G(e,t){let r=$.get(e)??new Map;$.set(e,r);let o=JSON.stringify([t.path,t.type,t.env,t.orgId]),i=r.get(o);if(i)return i;let n=e(t).finally(()=>r.delete(o));return r.set(o,n),n}function T(e){return e.startsWith("lt://")?e:`lt://${e}`}async function X(e,t){let r=await E(e.env,e.platform,{...e.selection.deviceName?{deviceName:e.selection.deviceName.value}:{},...e.selection.osVersion?{osVersion:e.selection.osVersion.value}:{}},t);if(r.kind==="unchecked"&&e.onWarning?.(`${r.reason} \u2014 the run continues, but the device and OS version are not checked before the session is requested.`),r.kind==="refused")throw new Error(r.detail)}async function Y(e,t){let r=e.selection.app.value.trim();if(h(r))return T(r);let o=e.credentials;if(!o?.orgId)throw new Error(`${r} has to be uploaded before it can run on a real device, but your account's org id was not found. Run kane-cli login, or set app: to an app ID from \`kane-cli apps list --target ${e.platform}\`.`);let i=await G(t,{path:r,type:e.platform,env:e.env,orgId:o.orgId,userId:o.userId??"",auth:{username:o.username,accessKey:o.accessKey,orgId:o.orgId},baseUrl:P(e.env),...e.onProgress?{onProgress:e.onProgress}:{}});if(b(i))throw new Error(`could not upload ${r} for this real-device run: ${i.reason}`);return T(i.appUrl??i.appId)}async function U(e,t={}){if(!e.credentials)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.");await X(e,t.fetchCatalog??S);let r=await Y(e,t.upload??R),{deviceName:o,osVersion:i}=e.selection,n={platform_name:e.platform,device_name:o?.value??D,...i?{platform_version:i.value}:{},app:r,...e.testName?{test_name:e.testName}:{},...e.tcId?{"tms.tc_id":e.tcId}:{},...e.capabilities},s=z(e.outDir,J);return H(e.outDir,{recursive:!0}),q(s,`${JSON.stringify(n,null,2)}
|
|
3
|
+
`),{device:{platform:e.platform,target:e.platform,device_config_path:s},...o?{deviceName:o.value}:{},...i?{osVersion:i.value}:{},app:r}}import{createServer as Q}from"http";import{randomBytes as Z}from"crypto";import{spawn as ee}from"child_process";import{mkdtempSync as re,readdirSync as te,readFileSync as oe,rmSync as ie,writeFileSync as ne}from"fs";import{tmpdir as W}from"os";import{join as w}from"path";function M(e,t,r,o){let i=Buffer.from(`${o.username}:${o.accessKey}`).toString("base64"),n=new URLSearchParams({session:r,auth:i});return t==="ios"&&n.set("mode","webrtc"),`${e.replace(/\/+$/,"")}/?${n.toString()}`}function V(e){return e.replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`)}function ae(e){return`<!doctype html>
|
|
4
|
+
<html lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<title>${V(e.title)}</title>
|
|
9
|
+
<style>
|
|
10
|
+
html, body { margin: 0; height: 100%; background: #111; font-family: system-ui, sans-serif; }
|
|
11
|
+
iframe { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; }
|
|
12
|
+
#guard { position: fixed; inset: 0; cursor: not-allowed; background: transparent; }
|
|
13
|
+
#badge, #ended { position: fixed; left: 50%; transform: translateX(-50%); padding: 6px 12px;
|
|
14
|
+
border-radius: 999px; font-size: 13px; color: #fff; background: rgba(0, 0, 0, 0.7); }
|
|
15
|
+
#badge { bottom: 16px; }
|
|
16
|
+
#ended { top: 16px; display: none; background: #b42318; }
|
|
17
|
+
</style>
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<iframe src="${V(e.streamUrl)}" allow="autoplay; fullscreen"></iframe>
|
|
21
|
+
${e.viewOnly?'<div id="guard"></div>':""}
|
|
22
|
+
<div id="badge">View only \u2014 the test is driving this device</div>
|
|
23
|
+
<div id="ended">The session ended</div>
|
|
24
|
+
<script>
|
|
25
|
+
// kane-cli answers while the run lives; once it stops, say so.
|
|
26
|
+
setInterval(() => {
|
|
27
|
+
fetch(location.pathname + "/alive", { cache: "no-store" })
|
|
28
|
+
.then((r) => { if (!r.ok) throw new Error(); })
|
|
29
|
+
.catch(() => { document.getElementById("ended").style.display = "block"; });
|
|
30
|
+
}, 3000);
|
|
31
|
+
</script>
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
34
|
+
`}async function O(e){let t=`/${Z(16).toString("hex")}`,r=ae(e),o=Q((s,a)=>{if(s.url===t){a.writeHead(200,{"content-type":"text/html; charset=utf-8","cache-control":"no-store"}),a.end(r);return}if(s.url===`${t}/alive`){a.writeHead(204),a.end();return}a.writeHead(404),a.end()});await new Promise((s,a)=>{o.once("error",a),o.listen(0,"127.0.0.1",()=>s())}),o.unref();let i=o.address();return{url:`http://127.0.0.1:${typeof i=="object"&&i?i.port:0}${t}`,close:()=>o.close()}}function B(e){let r=e?.width,o=e?.height;return!r||!o?{width:400,height:820}:{width:Math.min(1200,Math.max(320,Math.round(820*r/o))),height:820}}function se(e,t,r){return[`--app=${e}`,`--user-data-dir=${t}`,`--window-size=${r.width},${r.height}`,"--no-first-run","--no-default-browser-check","--autoplay-policy=no-user-gesture-required"]}var ce=3e3;async function j(e,t,r=ce){if(!C())throw new Error("Google Chrome is not installed (or set KANE_CLI_CHROME_PATH).");le();let o=re(w(W(),L));ne(w(o,F),String(process.pid));let i=ee(A(),se(e,o,t),{stdio:"ignore",detached:process.platform!=="win32"});i.unref();let n=()=>K(o);await new Promise((u,g)=>{let c=setTimeout(()=>{i.off("error",d),i.off("exit",f),u()},r);c.unref();function d(l){clearTimeout(c),n(),g(new Error(`Chrome did not start: ${l.message}`))}function f(l,m){clearTimeout(c),n(),g(new Error(`Chrome quit as it opened (${m??`exit code ${l}`}).`))}i.once("error",d),i.once("exit",f)}),i.on("error",()=>{}),i.once("exit",n);let s=()=>p();process.once("exit",s);let a=!1;function p(){if(!a){a=!0,process.off("exit",s);try{i.pid&&process.platform!=="win32"?process.kill(-i.pid):i.kill()}catch{}n()}}return p}var L="kane-device-view-",F="kane-cli.pid";function K(e){try{ie(e,{recursive:!0,force:!0,maxRetries:3,retryDelay:100})}catch{}}function de(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}function le(e=W()){let t;try{t=te(e).filter(r=>r.startsWith(L))}catch{return}for(let r of t){let o=w(e,r),i=NaN;try{i=Number(oe(w(o,F),"utf8"))}catch{}Number.isInteger(i)&&i>0&&de(i)||K(o)}}function We(e){return e.flag===!1||e.mobile?.device_stream===!1?"off":e.interactive?"open":"off"}function me(e){let t=e.basicAuth;if(!t)return;let r=e.resolvedCreds;return{username:t.username,accessKey:t.access_key,...r?.org_id?{orgId:String(r.org_id)}:{},...r?.user_id?{userId:String(r.user_id)}:{}}}async function Me(e){let t=me(e.auth),r=e.selection?await U({platform:e.target,selection:e.selection,env:e.env,outDir:e.sessionDir,...t?{credentials:t}:{},testName:e.testName,...e.tcId?{tcId:e.tcId}:{},capabilities:x(e.mobile,e.target),onProgress:e.write,onWarning:c=>e.write(`warning: ${c}`)}):I({platform:e.target,hasCredentials:!!t});e.write(_(e.target));let o=r.app?.replace(/^lt:\/\//,""),i=k(e.target,r.app,e.write),n,s,a=!1,p=!1,u=()=>{p=!0,s?.(),n?.close()},g=c=>{let d=c.type==="run_start"&&!c.child_id?c.environment?.device:void 0,f=d?.session_id;if(a||!f||!t||(e.stream??"off")==="off")return;a=!0;let l=N(d);O({streamUrl:M(v(e.env).deviceStreamUrl,y(e.target),f,t),title:l?`${l} \u2014 live`:"Real device \u2014 live",viewOnly:e.target==="android"}).then(async m=>{n=m,s=await(e.openWindow??j)(m.url,B(d)),p?u():e.write("Showing the device in its own window.")}).catch(m=>{n?.close(),e.write(`note: no live view of the device \u2014 ${m.message}`)})};return{device:r.device,...r.deviceName?{deviceName:r.deviceName}:{},...r.osVersion?{osVersion:r.osVersion}:{},...r.app?{app:r.app}:{},...h(o)?{appId:o}:{},announce:c=>{i(c),g(c)},stopStream:u}}var pe="infra_error.device_lost";function Oe(e){return e?.reason_code===pe}export{P as a,We as b,me as c,Me as d,Oe as e};
|