@testmuai/kane-cli 0.8.15 → 0.8.17
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-2GPR4S7I.js → ChatSurface-X2HLVN2I.js} +1 -1
- package/dist/{ChromeProfilePicker-XAZGCJKR.js → ChromeProfilePicker-YU7HL6Z5.js} +1 -1
- package/dist/{CliFeedbackPrompt-4SILDU7S.js → CliFeedbackPrompt-7FEEVGCU.js} +1 -1
- package/dist/{CliUploadProgress-OAQBY55Y.js → CliUploadProgress-OTVPBGW4.js} +1 -1
- package/dist/{ConfigView-FDBMJC26.js → ConfigView-UKHUASHL.js} +1 -1
- package/dist/EvidenceViewOffer-LIPGXO23.js +2 -0
- package/dist/FolderPicker-OTQYRAYC.js +2 -0
- package/dist/{InfoBox-ZPUBB7J4.js → InfoBox-2TYT2ROK.js} +1 -1
- package/dist/{LinksBox-MNNNOH23.js → LinksBox-7AS6D7MX.js} +1 -1
- package/dist/{ProfilesView-GY5QCIT3.js → ProfilesView-F4MFHZ7Y.js} +1 -1
- package/dist/{ProjectPicker-UCHMCNFV.js → ProjectPicker-QLGZM35L.js} +1 -1
- package/dist/{SaveSessionPrompt-ATVHKAHN.js → SaveSessionPrompt-T4MS76FY.js} +1 -1
- package/dist/SingleShotApp-4CDTAF3H.js +2 -0
- package/dist/{SummaryBox-2DTNE25L.js → SummaryBox-IX32QPWM.js} +1 -1
- package/dist/TestMdRunView-MRMY3RW5.js +2 -0
- package/dist/{TestrunEvidenceTable-6UE5EMON.js → TestrunEvidenceTable-OK2HAENB.js} +1 -1
- package/dist/{WhoamiView-TFCHIOW5.js → WhoamiView-AHMNIIXZ.js} +1 -1
- package/dist/{app-download-N7MLJQ42.js → app-download-CF4JLXWV.js} +1 -1
- package/dist/{auth-IQPCVCZK.js → auth-D4BDPJPR.js} +1 -1
- package/dist/{binary-VML7EGV4.js → binary-NWVJK542.js} +1 -1
- package/dist/{bind-YV6V5AI6.js → bind-LWN72YES.js} +4 -4
- package/dist/bootstrap-63FBDEEU.js +2 -0
- package/dist/bridge-UMXGHAJF.js +2 -0
- package/dist/{changelog-CJFWGRIL.js → changelog-GIZLIFMN.js} +1 -1
- package/dist/chat-committer-6D7AQI6Z.js +2 -0
- package/dist/chat-controller-UJQ6Z4RE.js +2 -0
- package/dist/{chunk-ZCSEBT2W.js → chunk-233MYVFS.js} +1 -1
- package/dist/{chunk-JGAMMOUC.js → chunk-2LCWGWYC.js} +1 -1
- package/dist/{chunk-D6GBOFK5.js → chunk-2LKNUXRN.js} +1 -1
- package/dist/{chunk-LJGAXIDU.js → chunk-2STKZSVF.js} +1 -1
- package/dist/chunk-3UI5VTQS.js +4 -0
- package/dist/{chunk-3D5MKSG3.js → chunk-3UIZVDOF.js} +1 -1
- package/dist/chunk-3VAU3PNU.js +2 -0
- package/dist/{chunk-A557OSRS.js → chunk-3YBT4UGQ.js} +1 -1
- package/dist/{chunk-FXO7JKMZ.js → chunk-47QKRIPY.js} +3 -3
- package/dist/{chunk-EJXBKCNF.js → chunk-4ASBXR6Q.js} +1 -1
- package/dist/{chunk-5HTSKF5K.js → chunk-4OQ7GEIA.js} +1 -1
- package/dist/{chunk-OWGFFJKK.js → chunk-4PWAODKJ.js} +1 -1
- package/dist/{chunk-MLYNVJNH.js → chunk-5HDM7GDO.js} +1 -1
- package/dist/{chunk-M36MOFJW.js → chunk-5LSPHA3P.js} +5 -5
- package/dist/chunk-5MKY3WMF.js +3 -0
- package/dist/{chunk-IAHOLH5W.js → chunk-5UHM7CKR.js} +1 -1
- package/dist/{chunk-XXE7W5AV.js → chunk-5X7JIGG7.js} +1 -1
- package/dist/{chunk-KALEPJAV.js → chunk-5ZU7S4E7.js} +2 -2
- package/dist/{chunk-RQILLYSP.js → chunk-637S3COE.js} +1 -1
- package/dist/{chunk-GX3FPJUG.js → chunk-63DYVWNX.js} +1 -1
- package/dist/chunk-64TO3MD7.js +93 -0
- package/dist/{chunk-UHSNUUX3.js → chunk-6CYF7Q5W.js} +2 -2
- package/dist/{chunk-4TMQTSIO.js → chunk-6OKOMKYR.js} +1 -1
- package/dist/{chunk-NLEA6NPU.js → chunk-75SSVUGS.js} +1 -1
- package/dist/{chunk-AHXOKBVE.js → chunk-7N6OCHPC.js} +1 -1
- package/dist/chunk-7U7HOEZO.js +2 -0
- package/dist/{chunk-7O54QURK.js → chunk-AACQE24F.js} +1 -1
- package/dist/{chunk-DMT3W26F.js → chunk-AG2MVCNK.js} +1 -1
- package/dist/chunk-AH4QWIYU.js +7 -0
- package/dist/{chunk-GZ65ZA4C.js → chunk-AIR2WVXM.js} +1 -1
- package/dist/{chunk-OGDAWNFY.js → chunk-AW34ZNNO.js} +1 -1
- package/dist/chunk-B6NU3SNG.js +368 -0
- package/dist/{chunk-Z3YYMZHT.js → chunk-BNZQKQOE.js} +1 -1
- package/dist/{chunk-T4R26WER.js → chunk-CCNPXTC6.js} +2 -2
- package/dist/{chunk-YAAQER2L.js → chunk-CCW3VQIY.js} +1 -1
- package/dist/{chunk-GSDXZS4U.js → chunk-D2F5T3NX.js} +1 -1
- package/dist/{chunk-JQW2QFSX.js → chunk-D6E6KRVX.js} +1 -1
- package/dist/chunk-D7WG7SRA.js +2 -0
- package/dist/{chunk-HLCETZ73.js → chunk-DFK5QYB5.js} +1 -1
- package/dist/{chunk-WFBJNVMQ.js → chunk-DQRVB5EU.js} +1 -1
- package/dist/{chunk-Z73ZYROU.js → chunk-DT2LIX5S.js} +1 -1
- package/dist/{chunk-AYJ2YZP5.js → chunk-E6X5BVXC.js} +1 -1
- package/dist/{chunk-SHSXOYKT.js → chunk-EIMHIZKF.js} +1 -1
- package/dist/chunk-EVFFDODK.js +5 -0
- package/dist/{chunk-3IXEARDX.js → chunk-F2OBORCG.js} +1 -1
- package/dist/chunk-FY7TCYPK.js +6 -0
- package/dist/{chunk-QXRT6HSV.js → chunk-GBXF4JE6.js} +1 -1
- package/dist/{chunk-YKYKOV6U.js → chunk-GIC56KI3.js} +1 -1
- package/dist/{chunk-OFWJBOGT.js → chunk-GT6Y2SEY.js} +2 -2
- package/dist/{chunk-XUJXGE42.js → chunk-HLUOLWEJ.js} +1 -1
- package/dist/{chunk-O3XBIURC.js → chunk-HS7OIRGU.js} +1 -1
- package/dist/{chunk-JCMHB4KH.js → chunk-I6RTGDZ7.js} +1 -1
- package/dist/{chunk-YZVR7ESF.js → chunk-ICFJVEEA.js} +1 -1
- package/dist/{chunk-JVEZBJJ7.js → chunk-IDLJHKJX.js} +1 -1
- package/dist/{chunk-N3CVR4Z2.js → chunk-IGI4T3VC.js} +1 -1
- package/dist/{chunk-TEHZUSUY.js → chunk-IHD2WXKT.js} +1 -1
- package/dist/{chunk-NUJVYAI4.js → chunk-IHUF6UP4.js} +1 -1
- package/dist/chunk-IICT4VOU.js +2 -0
- package/dist/{chunk-TVELOH5A.js → chunk-IKB2JKMA.js} +1 -1
- package/dist/{chunk-SWTJMTBY.js → chunk-IPQAKIJO.js} +1 -1
- package/dist/{chunk-7X4R6464.js → chunk-IZ3PYWUL.js} +1 -1
- package/dist/{chunk-CNPIJFZM.js → chunk-JGCB4OUP.js} +1 -1
- package/dist/chunk-JPOYZCTX.js +2 -0
- package/dist/chunk-JQ64X2TO.js +2 -0
- package/dist/{chunk-NWNG5UWD.js → chunk-JWOPRJIO.js} +1 -1
- package/dist/{chunk-R7QMZBBH.js → chunk-JWPBLVPW.js} +1 -1
- package/dist/chunk-K2UJYY2U.js +2 -0
- package/dist/{chunk-ALCE5RLK.js → chunk-KDNNMU7Q.js} +1 -1
- package/dist/chunk-KJQNAOOE.js +6 -0
- package/dist/{chunk-6DHEOPXX.js → chunk-KMF2PPJ5.js} +1 -1
- package/dist/{chunk-XSUJJB7Z.js → chunk-KQCGBDPM.js} +1 -1
- package/dist/{chunk-EFTRH35G.js → chunk-KRI5NSGQ.js} +1 -1
- package/dist/{chunk-EDQZIEPJ.js → chunk-KWANVHJX.js} +1 -1
- package/dist/{chunk-JFUFWICY.js → chunk-KX5IV5FL.js} +2 -2
- package/dist/{chunk-UZIMYV5U.js → chunk-L2SJRAK4.js} +1 -1
- package/dist/chunk-L45HDSJ7.js +15 -0
- package/dist/{chunk-Q77QO3PC.js → chunk-LO47W2DO.js} +4 -4
- package/dist/chunk-LSDWPG6C.js +2 -0
- package/dist/{chunk-74FHTDEE.js → chunk-MDM2LJFN.js} +1 -1
- package/dist/{chunk-QVLYK5JL.js → chunk-MTCLFYNH.js} +1 -1
- package/dist/{chunk-BMVE73M7.js → chunk-N55U4S4W.js} +1 -1
- package/dist/chunk-NFLQWKFR.js +8 -0
- package/dist/{chunk-OPL2MIQG.js → chunk-NJ4BXZBX.js} +1 -1
- package/dist/{chunk-3GELV4IN.js → chunk-OCWS5YVO.js} +14 -14
- package/dist/{chunk-HYTBEPC2.js → chunk-PHR2OSWD.js} +1 -1
- package/dist/{chunk-TU6IMGWO.js → chunk-Q4YYAN6E.js} +1 -1
- package/dist/{chunk-55YDTPB7.js → chunk-Q6F23V7L.js} +1 -1
- package/dist/chunk-QSCXXNC2.js +2 -0
- package/dist/{chunk-YGMUNNKH.js → chunk-RBFCGUR3.js} +1 -1
- package/dist/{chunk-3N6IAVD5.js → chunk-RDHWNSDP.js} +1 -1
- package/dist/{chunk-JL3L6KOG.js → chunk-RGJIGNB3.js} +1 -1
- package/dist/{chunk-TCAHDVII.js → chunk-RRY5IXOB.js} +1 -1
- package/dist/{chunk-6L5RV62W.js → chunk-RSXCS474.js} +1 -1
- package/dist/{chunk-DMCEGMGB.js → chunk-SDJNWR4D.js} +1 -1
- package/dist/{chunk-YCH7H7JX.js → chunk-SEEEGDVK.js} +1 -1
- package/dist/{chunk-7EGIX6Y4.js → chunk-TISVRTL7.js} +3 -3
- package/dist/{chunk-6GLFQHSW.js → chunk-TMOSERKN.js} +2 -2
- package/dist/{chunk-VOTIGXQ4.js → chunk-U2LDPUDZ.js} +1 -1
- package/dist/chunk-U6OTFMIT.js +4 -0
- package/dist/{chunk-2WRBCTNM.js → chunk-UQNRUAES.js} +1 -1
- package/dist/{chunk-ZEVU2OT3.js → chunk-UTIP6SMW.js} +1 -1
- package/dist/chunk-UUYYTJG2.js +6 -0
- package/dist/{chunk-ZKCCG3GK.js → chunk-UXJZUGKL.js} +1 -1
- package/dist/{chunk-52WM3XYO.js → chunk-V4B5QA3U.js} +1 -1
- package/dist/chunk-VIO7CCFW.js +5 -0
- package/dist/{chunk-EPE2ELDH.js → chunk-VIYV6NIW.js} +1 -1
- package/dist/{chunk-IE3OO5GI.js → chunk-VVOKM2VO.js} +1 -1
- package/dist/chunk-WC54SZUO.js +5 -0
- package/dist/{chunk-7WDPU33M.js → chunk-WDK5ETMA.js} +1 -1
- package/dist/chunk-WESMQEPO.js +2 -0
- package/dist/{chunk-RI4ILZZC.js → chunk-WKIYI6MB.js} +1 -1
- package/dist/{chunk-KZG4E5RM.js → chunk-WVHMPIDQ.js} +1 -1
- package/dist/chunk-XLSOQLVT.js +2 -0
- package/dist/chunk-YOVKKZVZ.js +2 -0
- package/dist/chunk-ZLWURCJ7.js +2 -0
- package/dist/{chunk-WNB2IYHY.js → chunk-ZQ6KWTJ2.js} +1 -1
- package/dist/chunk-ZRRBZUDJ.js +18 -0
- package/dist/committer-2QPBANRD.js +2 -0
- package/dist/{config-UGCWZGH5.js → config-WKLEWUPU.js} +1 -1
- package/dist/cover-cmd-7TSQJFGM.js +3 -0
- package/dist/{credentials-GWLYYRTL.js → credentials-FLY3ZXVX.js} +1 -1
- package/dist/{deps-bundle-VNGC2UG6.js → deps-bundle-CAKK3EO5.js} +1 -1
- package/dist/{deps-resolve-YLCEU6I7.js → deps-resolve-MSLEFPVD.js} +1 -1
- package/dist/descriptor-3JJUOHBM.js +2 -0
- package/dist/design-committer-D44GSUXY.js +2 -0
- package/dist/dispatch-SXS276ZT.js +2 -0
- package/dist/{doctor-B4Z6RPKQ.js → doctor-EZPQTFJM.js} +1 -1
- package/dist/{docx-convert-WPZS6OIC.js → docx-convert-SQRTF7XS.js} +1 -1
- package/dist/{dossier-UGJMYYAB.js → dossier-7HVC6BNK.js} +1 -1
- package/dist/evidence-GUOURW6F.js +2 -0
- package/dist/evolve-cmd-LJJFOXXP.js +2 -0
- package/dist/{explain-H5HJEDEF.js → explain-NEFBUX5G.js} +1 -1
- package/dist/{explain-cmd-XVE6Z67Q.js → explain-cmd-5LLIJKM2.js} +1 -1
- package/dist/{explain-cmd-R45I5MT7.js → explain-cmd-ENSJNQK7.js} +1 -1
- package/dist/{extract-bind-7IDQS4QP.js → extract-bind-CGU6WVS7.js} +3 -3
- package/dist/{extract-cmd-KIEOBRIT.js → extract-cmd-7N7CCGN6.js} +2 -2
- package/dist/feeder-66TUPB2R.js +2 -0
- package/dist/gaps-cmd-BNUGDF5N.js +3 -0
- package/dist/{gate-E3BLIUEA.js → gate-OYRDJMF6.js} +1 -1
- package/dist/{generate-headless-XGRIDD6O.js → generate-headless-7TJYESUU.js} +2 -2
- package/dist/index.js +162 -165
- package/dist/ingest-OSNNM3DH.js +2 -0
- package/dist/ingest-cmd-B4T5CW5R.js +2 -0
- package/dist/install-6KJ2MZX3.js +2 -0
- package/dist/interactive-bind-HUZDSGFX.js +26 -0
- package/dist/lifecycle-cmd-GIVLSUPE.js +2 -0
- package/dist/list-cmd-KEKKQDUF.js +3 -0
- package/dist/{list-commands-VRRCVWKO.js → list-commands-SMBBT5CY.js} +1 -1
- package/dist/logical-ids-GLVM2SVR.js +2 -0
- package/dist/login-flow-5ZIG7JXT.js +2 -0
- package/dist/maintenance-cmd-MLQ3IRFV.js +2 -0
- package/dist/{mobile-prompts-CMIVWDHQ.js → mobile-prompts-EEPPPA6S.js} +1 -1
- package/dist/{objective-variable-gate-EEYJ6B3X.js → objective-variable-gate-AEBWIGH7.js} +1 -1
- package/dist/open-provider-OTZ37JB6.js +2 -0
- package/dist/{pdf-convert-5H4HQNN3.js → pdf-convert-RLXSXFWN.js} +1 -1
- package/dist/{persist-recorded-session-JXL5E53A.js → persist-recorded-session-IRWGMXGI.js} +1 -1
- package/dist/phase-seed-H7KXNQO6.js +2 -0
- package/dist/pipeline-OV3TWKSZ.js +2 -0
- package/dist/prepare-target-35OI7XBL.js +2 -0
- package/dist/readmodel-FVLRQWZ7.js +2 -0
- package/dist/reconcile-cmd-NBBDE7DJ.js +2 -0
- package/dist/reconcile-deps-DJNIY7TP.js +4 -0
- package/dist/reconcile-engine-Z2XKUCQ7.js +2 -0
- package/dist/recording-banner-GCR6A46M.js +2 -0
- package/dist/{records-TJJJWBUD.js → records-LMCVKPE5.js} +1 -1
- package/dist/registry-V3ULHPLM.js +2 -0
- package/dist/{require-project-folder-SKEZMSN7.js → require-project-folder-YBB5T3OE.js} +1 -1
- package/dist/{resolve-run-intent-THC3EPAX.js → resolve-run-intent-XGZN6OQ6.js} +1 -1
- package/dist/{resolver-2NUNLK7N.js → resolver-WNV53IOL.js} +1 -1
- package/dist/revert-NOUECRW4.js +2 -0
- package/dist/review-cmd-ZXTLZ4GE.js +5 -0
- package/dist/run-YWKZGZVL.js +2 -0
- package/dist/run-YZP2PTNW.js +2 -0
- package/dist/run-test-md-N43FRXB6.js +17 -0
- package/dist/{sessions-cmd-DV442ZCY.js → sessions-cmd-IV25N2L7.js} +1 -1
- package/dist/skill-installer-G7Z5ZDAQ.js +3 -0
- package/dist/{spawner-7FUA3JXA.js → spawner-ABB7B5CQ.js} +1 -1
- package/dist/store-guard-YIQQF4LC.js +2 -0
- package/dist/{structured-answers-NADW6D44.js → structured-answers-3C2DCFFF.js} +1 -1
- package/dist/sync-cmd-4AKHO5EG.js +2 -0
- package/dist/sync-setup-E7UV25KK.js +2 -0
- package/dist/tcg-generate-XJN5OMIJ.js +2 -0
- package/dist/testmd-actions-WFDWYEAU.js +2 -0
- package/dist/{testmd-sync-HYZI6NRM.js → testmd-sync-I2E6W6JL.js} +1 -1
- package/dist/token-refresh-NADDXLYM.js +2 -0
- package/dist/{validate-basic-OKLJLDML.js → validate-basic-WZY6A3KD.js} +1 -1
- package/dist/{variable-receipt-CMCDUJI2.js → variable-receipt-JONRYHCY.js} +1 -1
- package/dist/verdicts-JMVS6HNJ.js +2 -0
- package/dist/{version-check-4DQJBSXW.js → version-check-CD7DHZI2.js} +1 -1
- package/dist/{view-cmd-P3XRFORJ.js → view-cmd-ASH2UFUW.js} +1 -1
- package/dist/walk-session-ZPXR7ASG.js +2 -0
- package/dist/with-telemetry-QXCHDKPW.js +2 -0
- package/package.json +11 -11
- package/dist/EvidenceViewOffer-YSNRKKPC.js +0 -2
- package/dist/FolderPicker-XCTJ5447.js +0 -2
- package/dist/SingleShotApp-IPNZBFXB.js +0 -2
- package/dist/TestMdRunView-2FQIEI5W.js +0 -2
- package/dist/bootstrap-KCPWDBLX.js +0 -2
- package/dist/bridge-5UKX7YIO.js +0 -2
- package/dist/chat-committer-HDE3TP5I.js +0 -2
- package/dist/chat-controller-3EPK7UZG.js +0 -2
- package/dist/chunk-27ERHOW3.js +0 -2
- package/dist/chunk-4PMZ5FCD.js +0 -2
- package/dist/chunk-6K4FDYMH.js +0 -89
- package/dist/chunk-AKX4VRRR.js +0 -2
- package/dist/chunk-CRZUBDJ3.js +0 -6
- package/dist/chunk-FFVNISYH.js +0 -2
- package/dist/chunk-GP7WD4UY.js +0 -4
- package/dist/chunk-HOA4VWSD.js +0 -5
- package/dist/chunk-JQCOKL6U.js +0 -15
- package/dist/chunk-JSS22MFY.js +0 -17
- package/dist/chunk-JUJ4SAGH.js +0 -2
- package/dist/chunk-KUS324VE.js +0 -3
- package/dist/chunk-L2TV4G56.js +0 -4
- package/dist/chunk-O25AL4B7.js +0 -5
- package/dist/chunk-O66WXOOC.js +0 -5
- package/dist/chunk-ORQGQSWG.js +0 -8
- package/dist/chunk-PGXJ275T.js +0 -2
- package/dist/chunk-S4JUCBCT.js +0 -7
- package/dist/chunk-SIYSKT6I.js +0 -3
- package/dist/chunk-TNBF5OMZ.js +0 -2
- package/dist/chunk-UHT5SVP5.js +0 -2
- package/dist/chunk-VZDLRJ5N.js +0 -368
- package/dist/chunk-W77SZLFC.js +0 -2
- package/dist/chunk-YMLC55J4.js +0 -2
- package/dist/chunk-YYYQ5MVD.js +0 -6
- package/dist/committer-IYQPXG6C.js +0 -2
- package/dist/cover-cmd-SWJ2NZUZ.js +0 -3
- package/dist/descriptor-PWUUNYV7.js +0 -2
- package/dist/design-committer-J57IAAA5.js +0 -2
- package/dist/dispatch-OMQCT7WO.js +0 -2
- package/dist/evidence-XJGXVLO5.js +0 -2
- package/dist/evolve-cmd-QQQPPGL3.js +0 -2
- package/dist/feeder-RSHMGW6B.js +0 -2
- package/dist/gaps-cmd-RGIPUSIR.js +0 -3
- package/dist/ingest-QGLVY7ND.js +0 -2
- package/dist/ingest-cmd-R5H5SF5K.js +0 -2
- package/dist/install-W3VPVPAQ.js +0 -2
- package/dist/interactive-bind-X5DVLRRW.js +0 -26
- package/dist/lifecycle-cmd-6R2PR2HM.js +0 -2
- package/dist/list-cmd-QCIYKWYQ.js +0 -3
- package/dist/logical-ids-DN6IZSUM.js +0 -2
- package/dist/login-flow-5HL2QYEL.js +0 -2
- package/dist/maintenance-cmd-GZ4EMT3V.js +0 -2
- package/dist/open-provider-UFSCTIQQ.js +0 -2
- package/dist/phase-seed-HKJ2EF7R.js +0 -2
- package/dist/pipeline-RSCRNNPW.js +0 -2
- package/dist/prepare-target-XZ3FTVBW.js +0 -2
- package/dist/readmodel-IBFRM6EO.js +0 -2
- package/dist/reconcile-cmd-4VRTUM2D.js +0 -2
- package/dist/reconcile-deps-ZCJ2QCK5.js +0 -4
- package/dist/reconcile-engine-IVLZCYZB.js +0 -2
- package/dist/recording-banner-SRLPSTFP.js +0 -3
- package/dist/registry-CPQHW2L2.js +0 -2
- package/dist/revert-6BBBK3I4.js +0 -2
- package/dist/review-cmd-BMJQZ6XJ.js +0 -5
- package/dist/run-TURFDLC6.js +0 -2
- package/dist/run-UDP5VPYS.js +0 -2
- package/dist/run-test-md-MRYNFNPO.js +0 -17
- package/dist/skill-installer-CVJ5VTEJ.js +0 -3
- package/dist/store-guard-XQ5MSUB2.js +0 -2
- package/dist/sync-cmd-5INKTZN2.js +0 -2
- package/dist/sync-setup-4R54VRAO.js +0 -2
- package/dist/tcg-generate-2BOPGRM6.js +0 -2
- package/dist/testmd-actions-2CPJZAC2.js +0 -2
- package/dist/token-refresh-NTE4LQRN.js +0 -2
- package/dist/verdicts-EMCYGQWM.js +0 -2
- package/dist/walk-session-MUGS6CZY.js +0 -2
- package/dist/with-telemetry-3T53GIQC.js +0 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{e as $}from"./chunk-XLSOQLVT.js";var b=12,G=6e3;function p(e,a){return e.byLabel(a).filter(({cid:n})=>!e.superseded.has(n)&&e.trust.get(n)!=="archived")}function h(e,a,n){return e.displayNameOf(a)??String(n.title??n.text??a)}function O(e,a,n={}){let r=p(e,"scenario"),c=null;if(a){let t=e.resolve(a);if(t){c=new Set([t.cid,t.tip,e.tipOf(t.cid)]);let o=c;r=r.filter(({cid:g})=>e.edgesFrom(g).some(d=>d.type==="belongs_to"&&(o.has(d.dst)||o.has(e.tipOf(d.dst)))))}}let s=new Set;for(let{cid:t}of r)s.add(t),s.add(e.tipOf(t));let m=p(e,"test").filter(({cid:t})=>!a||e.edgesFrom(t).some(o=>o.type==="automates"&&(s.has(o.dst)||s.has(e.tipOf(o.dst))))),l=new Set;for(let t of m)for(let o of e.edgesFrom(t.cid))o.type==="automates"&&l.add(e.tipOf(o.dst));let v=n.typedBlockers===!0&&c!==null,i=new Set,f=[];for(let t of v?p(e,"gap"):[]){if(!$.has(String(t.content.kind??""))||n.ignoreGaps?.has(t.cid))continue;let o=typeof t.content.uc=="string"?t.content.uc:null;if(c&&o&&!c.has(o)&&!c.has(e.tipOf(o)))continue;let g=t.content.ref,d=typeof g=="string"&&g?e.resolve(g):null,R=d&&(s.has(d.cid)||s.has(e.tipOf(d.cid)));if(!d||!R){if(String(t.content.kind)==="budget-evicted"&&!d)continue;let _=t.content.question?.header;f.push(`${typeof _=="string"?_:h(e,t.cid,t.content)} (ref ${typeof g=="string"&&g?g:"missing"})`);continue}i.add(d.cid),i.add(e.tipOf(d.cid))}let y=t=>l.has(t)||l.has(e.tipOf(t)),k=t=>i.has(t)||i.has(e.tipOf(t)),w=r.filter(({cid:t})=>!y(t)&&!k(t)).map(({cid:t,content:o})=>h(e,t,o)),x=r.filter(({cid:t})=>!y(t)&&k(t)).map(({cid:t,content:o})=>h(e,t,o));return{live_scenarios:r.length,live_tests:m.length,missing:w,blocked:x,unresolved_blockers:f}}function u(e){return e.length<=b?e.join(", "):`${e.slice(0,b).join(", ")} +${e.length-b} more`}function S(e,a){let n=e.committed.length===0?"committed: nothing new":`committed: ${u(e.committed.map(i=>i.temp_ref?`${i.temp_ref} \u2192 ${i.logical_id??i.cid}`:i.logical_id??i.cid))}`,r=[];e.reused&&r.push(`reused: ${e.reused}`),e.rejected?.length&&r.push(`rejected: ${u(e.rejected.map(i=>`${i.ref} (${i.reason})`))}`),e.warnings?.length&&r.push(`warnings: ${u(e.warnings)}`);let c=[`RECEIPT (commit ${e.commitN}, ${e.phase})`,n,...r],s,m;if(e.verb==="design"){s=O(a,e.ucRef,{typedBlockers:e.typedBlockers===!0,...e.ignoreGaps?{ignoreGaps:e.ignoreGaps}:{}}),c.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 i=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.${i} 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 i=p(a,"usecase").length;c.push(`parity: ${i} use-case(s) live`),m="next: refine via chat ops using the ids above. Never re-emit committed items."}c.push(m);let l=c.join(`
|
|
3
|
+
`);for(;Buffer.byteLength(l,"utf8")>G;)l=l.slice(0,Math.floor(l.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.warnings??[],...s?{parity:{live_scenarios:s.live_scenarios,live_tests:s.live_tests,missing:s.missing,blocked:s.blocked,unresolved_blockers:s.unresolved_blockers}}:{},next:m};return{text:l,event:v}}function N(e,a,n){try{let r=e.design_of?"design":e.proposal_id!==null?"proposal":e.conv?"chat":"commit",c=e.nodes.map(m=>{let l=a.displayNameOf(m.cid);return{cid:m.cid,...l!==null?{logical_id:l}:{}}}),s=S({verb:n.verb,commitN:n.commitN,phase:r,committed:c,...n.ucRef?{ucRef:n.ucRef}:{},...n.typedBlockers?{typedBlockers:!0}:{},...n.ignoreGaps?.size?{ignoreGaps:n.ignoreGaps}:{}},a);return{text:s.text+`
|
|
4
|
+
(recomputed against the current graph)`,event:{...s.event,recomputed_at_resume:!0}}}catch{let r=e.event_ids?.[0]??`seq ${e.seq}`,c=e.review[0]?.by?.id??e.sid??"unknown",s=`commit ${r} by ${c} at ${e.ts} \u2014 details unavailable (graph moved since)`;return{text:s,event:{type:"receipt",verb:n.verb,commit_n:n.commitN,phase:"recovered",recomputed_at_resume:!0,degraded:!0,message:s}}}}export{S as a,N as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as $}from"./chunk-
|
|
2
|
+
import{a as $}from"./chunk-ZRRBZUDJ.js";import{f as D}from"./chunk-RGJIGNB3.js";import{a as E}from"./chunk-NLCCBXXV.js";function U(e){return["completed","failed","ended","stopped"].includes(e.trim().toLowerCase())}function je(e){return["ended","stopped"].includes(e.trim().toLowerCase())}function q(e){return{requestId:e.requestId,objective:e.objective,status:"",turnActive:!1,scenarios:[],thinking:"",thinkingLog:[],chatLog:[],progress:0}}function Re(e){return e.pendingClarification===void 0?e:{...e,pendingClarification:void 0}}function Ce(e){return{...e,turnActive:!0,error:void 0,thinking:"",thinkingLog:[]}}function P(e,t){switch(t.type){case"thinking":return{...e,status:"thinking",thinking:e.thinking+t.delta};case"thinking_done":return{...e,thinkingLog:[...e.thinkingLog,{text:e.thinking,tookMs:t.tookMs}],thinking:""};case"progress":return{...e,progress:t.pct};case"snapshot":return{...e,scenarios:t.data.scenarios,status:t.data.status,headline:t.data.headline??e.headline};case"chat":return{...e,turnActive:!1,chatLog:[...e.chatLog,{role:"model",text:t.text}]};case"clarification":return{...e,turnActive:!1,chatLog:[...e.chatLog,{role:"model",text:t.text}],pendingClarification:t.text};case"limit":return{...e,limits:{scenarioLimit:t.scenarioLimit,perScenarioLimit:t.perScenarioLimit}};case"error":return{...e,error:t.message};case"done":return{...e,status:t.status,turnActive:!1,error:t.status==="failed"&&!e.error?"generation failed":e.error}}}function H(e,t){let n=[],i=e.type??"",d=e.status??"";if(i==="ping")return n;switch(i){case"thinking_token":typeof e.data=="string"&&n.push({type:"thinking",delta:e.data});break;case"thinking_stopped":{let r=e.data??{},o=se(r.time_taken);n.push({type:"thinking_done",text:typeof e.data=="string"?e.data:r.message??"",tookMs:o});break}case"progress":{let r=e.data??{};typeof r.progress=="number"&&n.push({type:"progress",pct:r.progress});break}case"clarification":{let r=e.data??{};typeof r.message=="string"&&n.push({type:"clarification",text:r.message});break}case"chatting_stopped":{let r=e.data??{};typeof r.message=="string"&&r.message.length>0&&n.push({type:"chat",text:r.message});break}case"limit_update":{let r=e.data??{},o=r.test_cases_limit??e.test_cases_limit,p=r.per_scenario_test_cases_limit??e.per_scenario_test_cases_limit;n.push({type:"limit",scenarioLimit:o,perScenarioLimit:p});break}case"error":{let r=typeof e.data=="string"?e.data:e.data?.message??"generation error";n.push({type:"error",message:r});break}case"request_cancelled":return n.push({type:"done",status:"stopped"}),n;case"session_ended":return n.push({type:"done",status:"ended"}),n;default:break}if(Array.isArray(e.scenarios)&&n.push({type:"snapshot",data:{requestId:t,status:d,headline:e.headline,scenarios:e.scenarios}}),d&&U(d)){let r=d.trim().toLowerCase();n.push({type:"done",status:r})}return n}function se(e){if(!e)return;let t=/^([\d.]+)(ms|s)?$/.exec(e.trim());if(!t)return;let n=Number(t[1]);if(Number.isFinite(n))return t[2]==="ms"?Math.round(n):Math.round(n*1e3)}var v=class extends Error{constructor(t){super(t),this.name="AuthError"}},M=class extends Error{constructor(t){super(t),this.name="ForbiddenError"}},I=class extends Error{constructor(t){super(t),this.name="InsufficientCreditsError"}},k=class extends Error{constructor(n,i){super(n);this.cause=i;this.name="TransportError"}};function x(e,t){let n=t?.message??t?.error??`HTTP ${e}`;return e===401?new v(n):e===403?t?.key==="insufficient_credits"?new I(n):new M(n):new k(n)}async function*J(e){let t=e.fetchImpl??fetch,n=e.maxRetries??5,i=e.maxBackoffMs??3e4,d=e.connectTimeoutMs??1e4,r=0,o=!1;for(;;){if(e.signal.aborted)return;let p=new AbortController,a=()=>p.abort();e.signal.addEventListener("abort",a,{once:!0});let c=setTimeout(()=>p.abort(),d),g;try{g=await t(e.url,{method:"GET",headers:{Authorization:await e.authHeader(),Accept:"text/event-stream"},signal:p.signal})}catch(w){if(clearTimeout(c),e.signal.removeEventListener("abort",a),e.signal.aborted)return;if(++r>n)throw new k("SSE connect failed",w);await O(F(r,i));continue}if(clearTimeout(c),!g.ok){e.signal.removeEventListener("abort",a);let w=await oe(g);if(g.status===401&&o){if(++r>n)throw x(401,w);await O(F(r,i));continue}throw x(g.status,w)}if(!g.body)throw e.signal.removeEventListener("abort",a),new k("SSE response had no body");o=!0,r=0;let m=g.body.getReader(),h=new TextDecoder("utf-8"),b="";try{for(;;){if(e.signal.aborted){await m.cancel().catch(()=>{});return}let{done:w,value:s}=await m.read();if(w)break;b+=h.decode(s,{stream:!0});let f;for(;(f=b.indexOf(`
|
|
3
3
|
|
|
4
4
|
`))>=0;){let u=b.slice(0,f);b=b.slice(f+2);let l=ie(u);l&&(yield l)}}}catch(w){if(e.signal.aborted)return;if(++r>n)throw new k("SSE stream dropped",w);await O(F(r,i));continue}finally{e.signal.removeEventListener("abort",a)}return}}function ie(e){let t="message",n="";for(let i of e.split(`
|
|
5
5
|
`))i.startsWith("event:")?t=i.slice(6).trim():i.startsWith("data:")&&(n+=i.slice(5).trim());if(t!=="message"||!n)return null;try{let i=Buffer.from(n,"base64").toString("utf-8");return JSON.parse(i)}catch{return null}}function F(e,t){return Math.min(t,1e3*2**(e-1))}function O(e){return new Promise(t=>setTimeout(t,e))}async function oe(e){try{return await e.clone().json()}catch{return}}function W(e,t){t?.length&&(e.append("files",t.map(n=>n.fileKey).join(",")),e.append("gemini_metadata",JSON.stringify(t.map(n=>({fileData:{fileUri:n.geminiUri,mimeType:n.mimeType}})))))}function Ue(e,t={}){let n=t.fetchImpl??fetch,i=new Map,d=!0;async function r(){let s=await e.authResolver.resolve();if(!s)throw new v("unauthorized; run `kane-cli login`");return E(s.username,s.access_key)}function o(s){return`${e.baseUrl}${s}`}async function p(s){if(!s.ok){let f;try{f=await s.clone().json()}catch{f=void 0}throw x(s.status,f)}return s.json()}function a(s){let f=s?.data??s;return{request_id:f.request_id??f.id,status:f.status??""}}function c(s,f,u,l){let y=q({requestId:s,objective:f});l&&(y=P(y,{type:"snapshot",data:l}),l.status==="cleaned_up"&&(y={...y,error:"session was reaped (cleaned_up) \u2014 continuing will destructively regenerate"}));let S=new AbortController;u&&(u.aborted?S.abort():u.addEventListener("abort",()=>S.abort(),{once:!0})),i.set(s,S);let A={requestId:s,state:y,events:void 0};return A.events=(async function*(){try{let C=J({url:o(`/requests/${s}/sse`),authHeader:r,signal:S.signal,log:e.log,fetchImpl:n});for await(let L of C)for(let z of H(L,s))A.state=P(A.state,z),yield z}finally{i.delete(s)}})(),A}async function g(s,f){let u=new FormData;u.append("prompt",s.prompt),d=s.memoryEnhancement??!0,u.append("memory_enhancement",String(d)),s.scenarioLimit!==void 0&&u.append("test_scenario_limit",String(s.scenarioLimit)),s.perScenarioLimit!==void 0&&u.append("per_scenario_test_cases_limit",String(s.perScenarioLimit));let l=s.projectId??e.projectId,y=s.folderId??e.folderId;l&&u.append("project_id",l),y&&u.append("folder_id",y),W(u,s.attachments);let S=await n(o("/requests"),{method:"POST",headers:{Authorization:await r()},body:u}),A=await p(S),{request_id:C}=a(A),L=String(C);return c(L,s.prompt,f)}async function m(s,f){let u=await n(o(`/requests/${s}`),{method:"GET",headers:{Authorization:await r()}}),l=await p(u),y=l?.data??l,S={requestId:s,status:y.status??"",headline:y.headline,scenarios:Array.isArray(y.scenarios)?y.scenarios:[]};return c(s,"",f,S)}async function h(s,f,u){let l=new FormData;l.append("prompt",f),l.append("chat_enabled","true"),l.append("memory_enhancement",String(d)),u?.mappings&&l.append("mappings",JSON.stringify(u.mappings)),W(l,u?.attachments);let y=await n(o(`/requests/${s}`),{method:"PUT",headers:{Authorization:await r()},body:l});if(!y.ok){let S;try{S=await y.clone().json()}catch{}throw x(y.status,S)}}async function b(s){i.get(s)?.abort();let u=await n(o(`/requests/${s}/stop`),{method:"DELETE",headers:{Authorization:await r()}});if(!u.ok&&u.status!==404){let l;try{l=await u.clone().json()}catch{}throw x(u.status,l)}}async function w(s){i.get(s)?.abort();let u=await n(o(`/requests/${s}/end`),{method:"DELETE",headers:{Authorization:await r()}});if(!u.ok&&u.status!==404){let l;try{l=await u.clone().json()}catch{}throw x(u.status,l)}}return{start:g,attach:m,chat:h,cancel:b,end:w}}import{statSync as ae,realpathSync as G,existsSync as ce}from"fs";import{extname as ue,resolve as j,isAbsolute as pe}from"path";import{homedir as V}from"os";var de=new Set([".txt",".md",".json",".xml",".jpg",".jpeg",".png",".gif",".bmp",".webp",".pdf",".docx",".csv",".xlsx",".mp3",".wav",".m4a",".webm",".mpeg",".mpga",".mp4",".mov"]),le=50*1024*1024,X=10;function fe(e){return e==="~"?V():e.startsWith("~/")?j(V(),e.slice(2)):e}function Ge(e,t){let n=[],i=[],d=new Set,r=[],o=(()=>{try{return G(j(t))}catch{return j(t)}})(),p=o.endsWith("/")?o:o+"/";for(let a of e){let c=fe(a),g=pe(c)?c:j(t,c);if(!ce(g)){n.push(`Not found: ${a}`);continue}let m;try{m=G(g)}catch{n.push(`Cannot resolve: ${a}`);continue}if(d.has(m))continue;let h;try{h=ae(m)}catch{n.push(`Cannot read: ${a}`);continue}if(!h.isFile()){n.push(`Not a file: ${a}`);continue}if(h.size===0){n.push(`Empty file: ${a}`);continue}let b=ue(m).toLowerCase();if(!de.has(b)){n.push(`Unsupported type ${b||"(none)"}: ${a}`);continue}if(h.size>le){n.push(`Too large (>50MB): ${a}`);continue}m!==o&&!m.startsWith(p)&&i.push(`Outside working dir: ${a}`),d.add(m),r.push(m)}return r.length>X&&n.push(`Too many files: ${r.length} (max ${X})`),{ok:n.length?[]:r,errors:n,warnings:i}}var B=class extends Error{constructor(n){super(n.join("; "));this.errors=n;this.name="AttachmentValidationError"}};async function Xe(e){let{promptText:t,filePaths:n,cwd:i,scenarios:d,isRefine:r,conn:o,deps:p}=e,{ok:a,errors:c,warnings:g}=p.validate(n,i);if(c.length)throw new B(c);e.onValidated?.();let m=a.length?await p.upload(o,a,p.onUpload):[],h=r?p.buildMappings(t,d):void 0;return{promptText:t,mappings:h,attachments:m,warnings:g}}import{readFile as me}from"fs/promises";import{basename as K}from"path";async function ge(e){let t=await e.authResolver.resolve();if(!t)throw new v("unauthorized; run `kane-cli login`");return E(t.username,t.access_key)}async function he(e,t,n={}){let i=n.fetchImpl??fetch,d=await me(t),r=K(t),o=new FormData;o.append("file",new Blob([d]),r),o.append("source","omniBox"),o.append("geminiFileUpload","true");let p=await i(`${e.tmsBaseUrl}/v1/attachment`,{method:"POST",headers:{Authorization:await ge(e)},body:o,signal:n.signal});if(!p.ok){let h;try{h=await p.clone().json()}catch{}throw x(p.status,h)}let a=await p.json(),c=a?.data??a,g=c?.gemini_response?.uri,m=c?.gemini_response?.mimeType;if(!c?.file_key||!g){let h=c&&typeof c=="object"?Object.keys(c).join(","):typeof c,b=(()=>{try{return JSON.stringify(c).slice(0,500)}catch{return"<unserializable>"}})();throw new Error(`attachment upload for ${r} returned no file_key/gemini uri \u2014 status ${p.status}, body keys: [${h}], raw: ${b}`)}return{fileName:c.file_name??r,fileKey:c.file_key,geminiUri:g,mimeType:m??"application/octet-stream"}}async function tt(e,t,n,i={}){let d=[];for(let r=0;r<t.length;r++){if(i.signal?.aborted)throw Object.assign(new Error("upload aborted"),{name:"AbortError"});let o=K(t[r]);n?.({file:o,index:r+1,total:t.length,status:"uploading"});try{d.push(await he(e,t[r],i)),n?.({file:o,index:r+1,total:t.length,status:"done"})}catch(p){throw n?.({file:o,index:r+1,total:t.length,status:"failed"}),p}}return d}var ye=/@([sS])(\d+)\.([cC])(\d+)/g,be=/@([sS])(\d+)(?!\d)(?!\.[cC]\d)/g;function rt(e,t){let n={},i={};for(let d of e.matchAll(ye)){let r=Number(d[2]),o=Number(d[4]),p=t[r-1];if(!p)continue;n[`s${r}`]=String(p.id);let a=p.test_cases??[];if(a[o-1])for(let c=0;c<o;c++){let g=a[c];g&&(i[`s${r}.c${c+1}`]=String(g.id))}}for(let d of e.matchAll(be)){let r=Number(d[2]),o=t[r-1];o&&(n[`s${r}`]=String(o.id))}if(!(Object.keys(n).length===0&&Object.keys(i).length===0))return{scenario:n,testcase:i}}function R(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(n==null||typeof n!="object")return[];let i=n;if(typeof i.step!="string")return[];let d=typeof i.expected_result=="string"?i.expected_result:typeof i.outcome=="string"?i.outcome:"";t.push({step:i.step,expected:d})}return t}var we=30,Se=300;function Z(){return{mode:"testing",max_steps:we,timeout:Se,variables:{}}}function Q(e){return e.title??`Test case ${e.id}`}function ct(e,t){return $({frontmatter:Z(),heading:Q(t),steps:e.sub_objectives.map(n=>n.objective)})}function Y(e){let t=R(e.manual_steps).map(n=>n.step);return $({frontmatter:Z(),heading:Q(e),steps:t})}import{mkdtempSync as xe,mkdirSync as N,writeFileSync as ee,rmSync as te,renameSync as _e,existsSync as ne,readFileSync as ve}from"fs";import{join as _,resolve as ke}from"path";async function ft(e,t,n,i=Y){(n.redirectBareCwd??!0)&&ke(t)===process.cwd()&&(t=_(t,".testmuai","tests"));let d=T(e.objective)??e.headline,r=T(n.suiteName)??`${T(re(d,4))??"tcg"}-${e.requestId}`,o=r,p=_(t,r);ne(p)&&!Te(p,e.requestId)&&(o=`${r}-${e.requestId}`);let a=_(t,o),c=[],g=new Map;for(let h of e.scenarios){let b=(h.test_cases??[]).filter(Ae);if(b.length===0)continue;let w=T(Ee(h.scode))??T(h.sid)??`s${h.id}`,s=g.get(w)??new Set;g.set(w,s);for(let f of b){let u=T(re(f.title,5))??"case",l=`${u}_test.md`;for(let y=2;s.has(l);y++)l=`${u}-${y}_test.md`;s.add(l),c.push({dir:w,file:l,tc:f})}}if(c.length===0)return{suiteDir:a,paths:[],warning:"no functional test cases generated"};N(t,{recursive:!0});let m=xe(_(t,".tcg-tmp-"));try{N(_(m,"helpers"),{recursive:!0}),ee(_(m,".tcg-suite.json"),JSON.stringify({requestId:e.requestId,suiteName:o}));let h=[],b=new Set;for(let s of c){let f=_(m,s.dir);b.has(f)||(N(f,{recursive:!0}),b.add(f));let u=_(f,s.file);ee(u,i(s.tc)),h.push(u)}ne(a)&&te(a,{recursive:!0,force:!0}),_e(m,a);let w=h.map(s=>s.replace(m,a));return{suiteDir:a,paths:w}}catch(h){try{te(m,{recursive:!0,force:!0})}catch{}throw h}}function Ae(e){return(e.category??"").trim().toLowerCase()==="functional"}function Te(e,t){try{return JSON.parse(ve(_(e,".tcg-suite.json"),"utf-8"))?.requestId===t}catch{return!1}}function T(e){return e&&e.length>0?e:void 0}function re(e,t){return e?e.toLowerCase().replace(/[^a-z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).slice(0,t).join("-"):""}function Ee(e){return e?e.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,""):""}function ht(e){let t=[];e.title&&t.push(e.title),e.description&&t.push("",e.description);let n=R(e.manual_steps);return n.length>0&&(t.push("","Steps:"),n.forEach((i,d)=>{t.push(`${d+1}. ${i.step}`)})),t.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as C}from"./chunk-
|
|
2
|
+
import{a as C}from"./chunk-4OQ7GEIA.js";import{k as Z}from"./chunk-75SSVUGS.js";import{a as D}from"./chunk-YCCUBQY4.js";import{a as M}from"./chunk-IKB2JKMA.js";import{a as z}from"./chunk-3YBT4UGQ.js";import{b as W}from"./chunk-5UHM7CKR.js";import{a as B}from"./chunk-GIC56KI3.js";import{e as V}from"./chunk-Z7S3IWUX.js";import{y as o}from"./chunk-PHR2OSWD.js";import{a as A}from"./chunk-HCBYKLMW.js";import{a as n,b as t,i as L}from"./chunk-C44QQJR4.js";import{a as N}from"./chunk-6YGTRKDT.js";import{e as g}from"./chunk-UR6MHSHU.js";var T=g(A(),1);function te(e){let i=e.kind==="simulator";switch(e.state){case"ready":return i?"Booted":"Running";case"stopped":return i?"Shutdown":"Stopped";case"unauthorized":return"UNAUTHORIZED";case"offline":return"Offline"}}function re(e){switch(e.state){case"unauthorized":return"accept the authorisation prompt on the device, then reopen this list";case"offline":return e.kind==="simulator"?"not responding \u2014 open Simulator.app to inspect it":"not responding \u2014 reconnect it, or restart the emulator";default:return}}function ne(e,i){let m=i.id!==void 0?{...i,id:z(i.id)}:i,c=e.virtualName!==void 0?{...e,virtualName:z(e.virtualName)}:e;return V(c,m)}function ie(e){return e.virtualName??e.displayName}function ae(e,i){let m=e.state==="ready"||e.state==="stopped",c=re(e),b=e.osVersion?` (${e.osVersion})`:"";return{id:e.id,label:`${ie(e)}${b} \xB7 ${te(e)}`,...i&&ne(e,i)?{isActive:!0}:{},...m?{}:{disabled:!0},...!m&&c?{disabledHint:c}:{}}}function le(e){return e==="emulator"?"No Android emulator found. Make sure an emulator exists on this machine (Android Studio \u2192 Device Manager), then reopen this list.":e==="simulator"?"No iOS simulator found. Make sure a simulator exists on this machine (Xcode \u2192 Windows \u2192 Devices and Simulators), then reopen this list.":"No emulator or simulator found. Make sure one exists on this machine, then reopen this list."}function he({targets:e,preselectedTarget:i,preselectedId:m,busyMessage:c,onSelect:b,onCancel:f,kind:l}){if(c)return(0,T.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,T.jsx)(t,{color:o.orange,bold:!0,children:"Device"}),(0,T.jsxs)(n,{marginTop:1,children:[(0,T.jsx)(C,{}),(0,T.jsxs)(t,{color:o.secondary,children:[" ",c]})]})]});if(e.length===0)return(0,T.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,T.jsx)(t,{color:o.orange,bold:!0,children:"Device"}),(0,T.jsx)(n,{marginTop:1,children:(0,T.jsx)(t,{color:o.dim,children:le(l)})})]});let d=e.map(r=>ae(r,i)),p=i?d.find(r=>r.isActive)?.id??null:m?e.find(r=>r.id===m||r.virtualName===m)?.id??null:null,a=new Map(e.map(r=>[r.id,r]));return(0,T.jsx)(M,{title:"Device",items:d,itemNoun:"devices",defaultActiveId:p,preserveSelectionById:!0,onSelect:r=>{let y=a.get(r.id);y&&b(y)},onCancel:f})}var x=g(N(),1);var u=g(A(),1),q=50,G=500;function pe(e){return`${e.name} (${e.appId})`}function Pe({kind:e,listApps:i,onSelect:m,onManualEntry:c,onCancel:b,busyMessage:f}){let[l,d]=(0,x.useState)([]),[p,a]=(0,x.useState)(!0),[r,y]=(0,x.useState)(!1),[Q,O]=(0,x.useState)(!1),[E,H]=(0,x.useState)(null),[w,J]=(0,x.useState)(""),[j,U]=(0,x.useState)(!1),$=(0,x.useRef)(!0),R=(0,x.useRef)(0);if((0,x.useEffect)(()=>{let h=++R.current,k=w.trim();$.current?a(!0):k&&O(!0),y(!0),H(null),U(!1),(async()=>{let I=[];try{for(let P=0;;P+=q){let X=await i({limit:q,offset:P,search:k});if(h!==R.current)return;if(I.push(...X.apps),d([...I]),$.current&&(a(!1),$.current=!1),O(!1),X.apps.length===0||I.length>=X.total)break;if(I.length>=G){U(!0);break}}}catch(P){if(h!==R.current)return;H(P instanceof Error?P.message:String(P)),a(!1),O(!1)}finally{h===R.current&&y(!1)}})()},[w,i]),L((h,k)=>{if(k.tab){c();return}k.escape&&b()},{isActive:!!E&&!f}),f)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,u.jsx)(t,{color:o.orange,bold:!0,children:"App under test"}),(0,u.jsxs)(n,{marginTop:1,children:[(0,u.jsx)(C,{}),(0,u.jsxs)(t,{color:o.secondary,children:[" ",f]})]})]});if(E)return(0,u.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.red,paddingX:2,paddingY:1,children:[(0,u.jsx)(t,{color:o.red,bold:!0,children:"App under test"}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(t,{color:o.red,children:"Could not load your uploads."})}),(0,u.jsx)(n,{marginTop:1,children:(0,u.jsx)(t,{color:o.dim,children:E})}),(0,u.jsx)(B,{bindings:[{keys:"tab",label:"tab to enter an app id"}],escBackLabel:"back to chat"})]});let ee=new Map(l.map(h=>[h.appId,h])),oe=l.map(h=>({id:h.appId,label:pe(h)})),_=!p&&!r&&l.length===0&&!w.trim()?e==="simulator"?"No simulator builds uploaded to this account yet \u2014 press Tab to enter an app id.":"No emulator builds uploaded to this account yet \u2014 press Tab to enter an app id.":null;return(0,u.jsx)(M,{title:"App under test",items:oe,loading:p,loadingText:"Loading your uploads\u2026",loadingMore:r,searching:Q,itemNoun:"uploads",preserveSelectionById:!0,onSearch:J,onTab:c,extraHint:"tab to enter an id",footer:_?(0,u.jsx)(t,{color:o.dim,children:_}):j?(0,u.jsx)(t,{color:o.dim,children:`Showing the first ${G} \u2014 type to search the rest.`}):void 0,onSelect:h=>{let k=ee.get(h.id);k&&m({appId:k.appId,name:k.name})},onCancel:b})}var Y=g(N(),1);var S=g(A(),1),se={emulator:["apk"],simulator:["zip"]};function ce(e){return Z(e.trim())}function Oe({kind:e,onBack:i,onSelect:m,onCancel:c}){let[b,f]=(0,Y.useState)(""),[l,d]=(0,Y.useState)(null),p=e==="emulator"?".apk":".zip";return(0,S.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,S.jsx)(t,{color:o.orange,bold:!0,children:"App under test"}),(0,S.jsx)(n,{marginTop:1,children:(0,S.jsx)(t,{color:o.dim,children:`Path to a build (${p}): `})}),(0,S.jsxs)(n,{marginTop:1,children:[(0,S.jsx)(t,{color:o.dim,children:" "}),(0,S.jsx)(D,{value:b,onChange:a=>{f(a),l&&d(null)},onSubmit:a=>{let r=ce(a);if(!r){d(a.trim()?`Not a build \u2014 expected ${p}.`:"Enter the path to a build.");return}if(!se[e].includes(r.kind)){d(`${r.kind} builds don't run on a ${e} \u2014 expected ${p}.`);return}d(null),m(r).then(y=>{!y.ok&&y.error&&d(y.error)})},onCancel:i,placeholder:e==="emulator"?"/path/to/app-debug.apk":"/path/to/MyApp.zip"})]}),l&&(0,S.jsx)(n,{marginTop:1,children:(0,S.jsx)(t,{color:o.red,children:l})}),(0,S.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this build"}],escBackLabel:"back"})]})}var F=g(N(),1);var v=g(A(),1);function de(e){return[{value:"local",label:"Local build",hint:e==="emulator"?".apk":".zip",available:!0},{value:"uploaded",label:"Uploaded app",hint:"an app id from your cloud uploads",available:!0}]}function Ye({kind:e,onSelect:i,onCancel:m}){let c=de(e),[b,f]=(0,F.useState)(0),[l,d]=(0,F.useState)(null);return L((p,a)=>{if(a.escape){m();return}if(a.upArrow&&f(r=>Math.max(0,r-1)),a.downArrow&&f(r=>Math.min(c.length-1,r+1)),a.return){let r=c[b];if(!r.available){d("That source isn't available \u2014 choose a local build for now.");return}d(null),i(r.value)}}),(0,v.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,v.jsx)(t,{color:o.orange,bold:!0,children:"App under test"}),(0,v.jsx)(n,{marginTop:1,flexDirection:"column",children:c.map((p,a)=>{let r=a===b,y=p.available?r?o.orange:void 0:o.muted;return(0,v.jsxs)(n,{children:[(0,v.jsxs)(t,{color:y,children:[r?"\u276F ":" ",p.label]}),(0,v.jsxs)(t,{color:o.dim,children:[" ",p.hint]})]},p.value)})}),l&&(0,v.jsx)(n,{marginTop:1,children:(0,v.jsx)(t,{color:o.red,children:l})}),(0,v.jsx)(B,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],escBackLabel:"back"})]})}var K=g(N(),1);var s=g(A(),1);function qe({busyMessage:e,onSubmit:i,onBack:m}){let[c,b]=(0,K.useState)(""),[f,l]=(0,K.useState)(null);return e?(0,s.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,s.jsx)(t,{color:o.orange,bold:!0,children:"App under test"}),(0,s.jsxs)(n,{marginTop:1,children:[(0,s.jsx)(C,{}),(0,s.jsxs)(t,{color:o.secondary,children:[" ",e]})]})]}):(0,s.jsxs)(n,{flexDirection:"column",borderStyle:"round",borderColor:o.orange,paddingX:2,paddingY:1,children:[(0,s.jsx)(t,{color:o.orange,bold:!0,children:"App under test"}),(0,s.jsx)(n,{marginTop:1,children:(0,s.jsx)(t,{color:o.dim,children:"App id from your cloud uploads:"})}),(0,s.jsxs)(n,{marginTop:1,children:[(0,s.jsx)(t,{color:o.dim,children:" "}),(0,s.jsx)(D,{value:c,onChange:d=>{b(d),f&&l(null)},onSubmit:d=>{let p=d.trim();if(!p){l("Enter an app id.");return}if(!W(p)){l("That doesn't look like an app id \u2014 they start with APP.");return}l(null),i(p).then(a=>{!a.ok&&a.error&&l(a.error)})},onCancel:m,placeholder:"APP1016032231178585590501450"})]}),f&&(0,s.jsxs)(n,{marginTop:1,flexDirection:"column",children:[(0,s.jsx)(t,{color:o.red,children:f}),(0,s.jsx)(t,{color:o.dim,children:"Enter a valid app id \u2014 copy it from your cloud uploads."})]}),(0,s.jsx)(B,{bindings:[{keys:"\u21B5",label:"use this app"}],escBackLabel:"back"})]})}export{he as a,Pe as b,Oe as c,Ye as d,qe as e};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as v}from"./chunk-QSCXXNC2.js";import{n as g}from"./chunk-RSSOJ3L2.js";import{a as u,b as d}from"./chunk-PHR2OSWD.js";import{existsSync as F}from"fs";import{join as P}from"path";import{mkdirSync as w,rmSync as b,writeFileSync as h}from"fs";import{join as S,resolve as k}from"path";import{join as W}from"path";function f(){return process.env.KANE_CLI_WIRE_BASE_DIR||d}function B(e){return W(f(),"sessions",`testrun-${e}`)}function E(e=f()){return S(e,"sessions","active")}function y(e,r){return S(E(r),`${e}.json`)}function _(e){let r=e.pid??process.pid,n=y(r,e.baseDir);try{w(E(e.baseDir),{recursive:!0}),h(n,JSON.stringify({pid:r,cwd:process.cwd(),surface:e.surface,session_dir:k(e.sessionDir),started:new Date().toISOString(),cli_version:u,host_agent:v()},null,2)+`
|
|
3
|
+
`)}catch{}return n}function m(e=process.pid,r){try{b(y(e,r),{force:!0})}catch{}}var R={run:"run_end",testmd:"test_md_done",testrun:"testrun_done"};import{appendFileSync as A,mkdirSync as I}from"fs";import{dirname as N}from"path";function x(e){let r=!1;return{path:e,append(n){try{r||(I(N(e),{recursive:!0}),r=!0),A(e,n+`
|
|
4
|
+
`)}catch{}}}}function D(e,r=()=>new Date){let{v:n,ts:c,...i}=e;return{...i,v:1,ts:typeof c=="string"?c:r().toISOString()}}function T(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||!F(i))){o=x(P(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=JSON.stringify(D(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 V(e){return r=>{_({surface:e,sessionDir:r}),g("wire-active-run",()=>m()),process.once("exit",()=>m())}}function ie(e,r){return s=T({surface:e,cliVersion:u,onAttach:r??V(e)}),s.emit({type:"stream_start",cli_version:u,surface:e,pid:process.pid}),s}function oe(){return s}function se(e){if(s){s.emit(e);return}process.stdout.write(JSON.stringify(D(e))+`
|
|
6
|
+
`)}export{B as a,x as b,D as c,ie as d,oe as e,se as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as O,d as S}from"./chunk-
|
|
2
|
+
import{b as O,d as S}from"./chunk-D2F5T3NX.js";import{c as L}from"./chunk-RFHMDQXZ.js";import{n as P,o as R}from"./chunk-RSSOJ3L2.js";import{y as s}from"./chunk-PHR2OSWD.js";import{a as y}from"./chunk-HCBYKLMW.js";import{a as E,b as o,i as h}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as d}from"./chunk-UR6MHSHU.js";var n=d(B(),1);import{basename as D}from"path";var r=d(y(),1),U="evidence-view-server";function Q({packPath:m,viewerBase:w,onDone:V,openUrl:k}){let[t,a]=(0,n.useState)("ask"),[g,b]=(0,n.useState)(null),[l,p]=(0,n.useState)(null),f=(0,n.useRef)(null),u=(0,n.useRef)(!1),x=async()=>{let e=f.current;f.current=null,e&&(R(U),await e.close())},v=()=>{u.current||(u.current=!0,V())};return h((e,i)=>{u.current||(t==="ask"?e==="y"||e==="Y"?a("starting"):(e==="n"||e==="N"||i.return||i.escape)&&v():t==="serving"&&(e==="q"||e==="Q"||i.escape)&&x().then(v))}),(0,n.useEffect)(()=>{if(t!=="starting")return;let e=!1;return(async()=>{try{let i=D(m),c=await O({packs:new Map([[i,m]]),allowedOrigins:[new URL(w).origin]});if(e){await c.close();return}f.current=c,P(U,()=>{c.close()});let T=S(c.urlFor(i),w);b(T);try{await(k??(q=>L(q)))(T)}catch{p("could not open browser \u2014 open the URL manually")}a("serving")}catch(i){p(`evidence view failed \u2014 ${i.message}`),a("failed")}})(),()=>{e=!0}},[t]),(0,n.useEffect)(()=>{if(t!=="failed")return;let e=setTimeout(v,0);return()=>clearTimeout(e)},[t]),(0,n.useEffect)(()=>()=>{x()},[]),t==="ask"?(0,r.jsxs)(o,{children:["View evidence in browser? ",(0,r.jsx)(o,{color:s.dim,children:"(y/N)"})]}):t==="serving"||t==="starting"?(0,r.jsxs)(E,{flexDirection:"column",children:[g?(0,r.jsxs)(o,{children:["viewer ",(0,r.jsx)(o,{color:s.orange,children:g})]}):(0,r.jsx)(o,{color:s.dim,children:"starting\u2026"}),l?(0,r.jsx)(o,{color:"yellow",children:l}):null,t==="serving"?(0,r.jsx)(o,{color:s.dim,children:"Press q when done"}):null]}):l?(0,r.jsx)(o,{color:"yellow",children:l}):null}export{Q as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as y,d as _}from"./chunk-
|
|
2
|
+
import{c as y,d as _}from"./chunk-VVOKM2VO.js";import{M as h,c as g,e as v,m as b}from"./chunk-RDHWNSDP.js";import{f,h as x}from"./chunk-XLSOQLVT.js";var G=n=>`conv#turn=${n}`;function I(n,t){for(let o of n.split(`
|
|
3
3
|
`))if(o.trim())try{let r=JSON.parse(o);if(r.turn===t)return r.text}catch{}return null}var C={format:"conversation",media_type:"text/x-conversation",anchors_supported:["#turn="]};function P(n){let{contextDir:t,graph:o,sessionStamp:r}=n,e=`su-conv-${r}`,a=o.heads.get(e);if(typeof a=="string")return{record:null,errors:[{code:"CONV_SOURCE_EXISTS",detail:`${e} already exists \u2014 resume it`}],sourceId:e,cid:a};let s=y(t,Buffer.from("","utf8")),i=v(e,s),u=x("source",i);if(u.length>0)return{record:null,errors:u.map(c=>({code:c.code,detail:c.detail})),sourceId:e,cid:""};let d=g("source",i);return{record:h(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:d,label:f.SOURCE,content:i}],edges:[],review:[],supersessions:[],source_head_moves:{[e]:d},media:{[e]:C},conv:{source_id:e,turn:0,append_of:null}},{expectPrev:o.latestHash,intent:{v:1,verb:"conv-mint",args:b({sessionStamp:r,by:n.by}),pins:{}},provenance:n.provenance}).record,errors:null,sourceId:e,cid:d}}function T(n){let{contextDir:t,graph:o,sourceId:r,text:e,force:a}=n,s=o.heads.get(r),i=o.convChains.get(r);if(typeof s!="string"||!i)return{record:null,errors:[{code:"CONV_SOURCE_MISSING",detail:`${r} is not a live conversation source`}]};let d=o.getNode(s)?.content?.blob;if(typeof d!="string")return{record:null,errors:[{code:"CONV_SOURCE_MISSING",detail:`${r} head node unreadable`}]};let p=_(t,d)?.toString("utf8")??"",c=i.turns;if(!a&&c>0&&I(p,c)===e)return{record:null,errors:null,turn:c,cid:s,idempotent:!0};let l=c+1,O=`${p}${JSON.stringify({turn:l,text:e})}
|
|
4
4
|
`,E=y(t,Buffer.from(O,"utf8")),S=v(r,E),m=g("source",S);return{record:h(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:m,label:f.SOURCE,content:S}],edges:[],review:[],supersessions:[],source_head_moves:{[r]:m},media:{[r]:C},conv:{source_id:r,turn:l,append_of:s}},{expectPrev:o.latestHash,intent:{v:1,verb:"conv-turn",args:b({sourceId:r,text:e,force:a??!1,by:n.by}),pins:{append_of:s}},provenance:n.provenance}).record,errors:null,turn:l,cid:m,idempotent:!1}}export{G as a,I as b,P as c,T as d};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{d as de,e as le}from"./chunk-AXTPNZPX.js";import{a as ce}from"./chunk-U6OTFMIT.js";import{b as K,d as ae}from"./chunk-V4B5QA3U.js";import{d as oe}from"./chunk-VVOKM2VO.js";import{c as V}from"./chunk-3UI5VTQS.js";import{d as se}from"./chunk-XLSOQLVT.js";var me=new Set(["approve","edit","reject"]),ue=new Set(["approve","edit","reject","add","enhance","retract"]);function he(r,t){return`chatop:${t}:${r.target??"new"}:${r.op}:${r.seq}`}function ke(r,t,w,y){let l=he(r,t),g=r.payload;switch(r.op){case"approve":return{kind:"approve",target:r.target,expectedCid:r.expected_cid,eventId:l};case"edit":{let{reason:s,...x}=g;return{kind:"edit",target:r.target,expectedCid:r.expected_cid,edit:x,reason:s,eventId:l}}case"enhance":return{kind:"enhance",target:r.target,expectedCid:r.expected_cid,edges:g.edges??[],eventId:l};case"retract":{let s=typeof g.reason=="string"?g.reason.trim():"";if(!s)throw new Error("INVALID_RETRACT: a retract needs a non-empty reason");let x=g.edge_ecid!==void 0&&g.edge_ecid!==null,a=g.edge!==void 0&&g.edge!==null;if(x&&a)throw new Error("INVALID_RETRACT: both edge_ecid and edge were sent \u2014 give exactly one");if(!x&&!a)throw new Error("INVALID_RETRACT: neither edge {type, dst, src?} (display refs) nor edge_ecid was sent \u2014 give exactly one");let f={kind:"retract",target:r.target,expectedCid:r.expected_cid,reason:s};if(x){if(typeof g.edge_ecid!="string"||!g.edge_ecid)throw new Error("INVALID_RETRACT: edge_ecid must be a non-empty string");return{...f,edgeEcid:g.edge_ecid,eventId:`chatop:${t}:${r.target}:retract:e:${g.edge_ecid}:${r.seq}`}}let p=g.edge;if(typeof p!="object"||typeof p.type!="string"||!p.type||typeof p.dst!="string"||!p.dst)throw new Error("INVALID_RETRACT: edge needs {type, dst} (src optional), all display refs");if(p.src!==void 0&&p.src!==null&&(typeof p.src!="string"||!p.src))throw new Error("INVALID_RETRACT: edge.src, when given, must be a non-empty display ref");let v=typeof p.src=="string"?p.src:void 0;return{...f,edgeRef:{type:p.type,dst:p.dst,...v!==void 0?{src:v}:{}},eventId:`chatop:${t}:${r.target}:retract:t:${p.type}:${p.dst}:${v??"-"}:${r.seq}`}}case"reject":return{kind:"reject",target:r.target,expectedCid:r.expected_cid,reason:g.reason??"",redirectTo:g.redirect_to,eventId:l};case"add":{let s=g.proposal_item??{},x=String(s.label??"");if(!w.mint_gate.includes(x))throw new Error(`GATED_LABEL: cannot mint "${x}" (gate: ${w.mint_gate.join(", ")})`);let a=s.cite??{},f=s.conv_source_id??y;if(!f||typeof a.turn!="number"||!a.quote)throw new Error("INVALID_ADD: a chat add requires a conversation cite {turn, quote} and conv_source_id");let p=s.content,v=p&&typeof p=="object"&&!Array.isArray(p)&&Object.keys(p).length>0?p:null,C=new Set(["label","cite","conv_source_id","content","rationale","edges"]),_=v??Object.fromEntries(Object.entries(s).filter(([$])=>!C.has($)));return{kind:"add",label:x,content:_,cite:{turn:a.turn,quote:a.quote},convSourceId:f,rationale:s.rationale,eventId:l}}}}function ge(r,t,w={}){let y=w.turn??0,l=[],g=[];for(let a of r){if(!ue.has(a.op))throw new Error(`UNKNOWN_OP: "${a.op}" is not a chat op (accepted: ${[...ue].join(", ")})`);if(a.op!=="add"&&!a.target)throw new Error(`MISSING_TARGET: a ${a.op} op needs a target ref`)}for(let a of r)(a.op==="add"||a.op==="enhance"||a.op==="retract")&&g.push(a);let s=new Map;for(let a of r){if(!me.has(a.op)||!a.target)continue;let f=s.get(a.target)??[];f.push(a),s.set(a.target,f)}for(let[a,f]of s){let p=Math.max(...f.map(C=>C.seq)),v=f.filter(C=>C.seq===p);if(v.length>1){l.push({target:a,seq:p,kinds:v.map(C=>C.op)});continue}g.push(v[0])}return{chatOps:g.sort((a,f)=>a.seq-f.seq).map(a=>ke(a,y,t,w.convSourceId)),ambiguous:l}}function be(r){let t=[];return r.questions.forEach((w,y)=>{if(r.resolution[y])return;let l=w.recommended_index!=null?w.options[w.recommended_index]?.label:void 0;l!=null&&t.push(w.risk==="high"?`${l} \u203C`:l)}),t.length>3?`${t.slice(0,3).join(" \xB7 ")} \xB7 +${t.length-3} more`:t.join(" \xB7 ")}function pe(r){let t=r.text.replace(/\?+\s*$/,"");return t.length<=36?t:`${t.slice(0,33)}\u2026`}function xe(r){return r.use_cases??[]}var ye={acs:"acceptance criteria",scenarios:"scenarios",exercises:"exercises",tests:"tests",gaps:"gaps"};function _e(r){let t=[],w=[],y=(s,x)=>{x.length!==0&&(w.push(s),t.push(...x))},l=s=>typeof s=="string"&&/^[a-z]{1,4}\d{1,4}$/i.test(s)?s:null,g=s=>{let x=l(s.automates)??"1 scenario",a=s.verifies??[],f=a.map(l).filter(C=>C!==null).slice(0,2),p=a.length-f.length,v=f.length?`${f.join(" ")}${p>0?` +${p}`:""}`:`${a.length} ACs`;return`covers ${x} \xB7 verifies ${v}`};return y("acs",(r.acs??[]).map(s=>({temp_ref:s.temp_ref,title:s.text,kind:"ac",badge:String(s.kind),extra:{...s.expected_answer?{expects:`${String(s.expected_answer.operator??"")} \xB7 ${String(s.expected_answer.operand??"")}`}:{},"scoped to":s.scoped_to??"(use-case)"}}))),y("scenarios",(r.scenarios??[]).map(s=>({temp_ref:s.temp_ref,title:s.title,kind:"scenario",badge:s.case_type,why:s.intent,depends_on_hint:s.depends_on??[],extra:{technique:s.technique_notes}}))),y("exercises",(r.exercises??[]).map(s=>({temp_ref:l(s.scenario)??"wiring",title:`${l(s.scenario)??"scenario"} exercises ${l(s.ac)??"1 AC"}`,kind:"exercise",badge:"wires",why:s.rationale}))),y("tests",(r.tests??[]).map(s=>({temp_ref:s.temp_ref,title:s.title,kind:"test",why:g(s),depends_on_hint:s.reuses??[],extra:{automates:String(s.automates??"?"),verifies:(s.verifies??[]).join(", "),check:s.check?`${String(s.check.kind)} vs ${String(s.check.verified_against)}`:"?"}}))),y("gaps",(r.gaps??[]).map(s=>({temp_ref:s.temp_ref??s.ref??"?",title:String(s.question?.header??s.kind),kind:"gap",badge:s.kind,why:s.risk_rationale}))),{items:t,heading:w.join(" + ")||"design"}}function De(r={}){let t={turns:[],thinking:de(),pending:null,confirm:null,status:"idle",ledger:[],activeTurn:null,stream:null,checkpoint:!1},w=e=>{let n=[],i=e.minted.map(c=>c.slug).filter(Boolean);i.length&&n.push(`added ${i.join(", ")}`);let o=e.applied.length-e.minted.length;return o>0&&n.push(`${o} change${o===1?"":"s"} applied`),e.staleDelta.length&&n.push(`stales ${e.staleDelta.length}`),n.join(" \xB7 ")||"no changes"},y=[];r.onRender&&y.push(r.onRender);let l=0,g=0,s=null,x=null,a=null,f=[],p=0,v=e=>{if(!(!a||!r.contextDir||!e.trim()))try{let n=r.refreshGraph?.()??r.graph;if(!n)return;ae({contextDir:r.contextDir,graph:n,sourceId:a,text:e,by:r.by??{kind:"human",id:"owner"}})}catch{}},C=e=>{if(!a||!r.contextDir)return;let n=r.refreshGraph?.()??r.graph,i=n?.heads.get(a),o=n?.convChains.get(a);if(!n||typeof i!="string"||!o)return;let c=n.getNode(i)?.content?.blob,d=typeof c=="string"?oe(r.contextDir,c)?.toString("utf8")??"":"";if(d)for(let b of e){if(b.kind!=="add"||b.convSourceId!==a)continue;let F=K(d,b.cite.turn);if(!(F!==null&&V(b.cite.quote,F)))for(let R=o.turns;R>=1;R--){let G=K(d,R);if(G!==null&&V(b.cite.quote,G)){b.cite={...b.cite,turn:R};break}}}},_={startedAt:null,thinkMs:0,toolCalls:0,tools:new Map},$=()=>{_.startedAt??=Date.now()},A=()=>{if(_.toolCalls>0){let e=_.startedAt!=null?Math.max(1,Math.round((Date.now()-_.startedAt)/1e3)):Math.max(1,Math.round(_.thinkMs/1e3));m({kind:"worked",durS:e,toolCalls:_.toolCalls,tools:[..._.tools.entries()].map(([n,i])=>({name:n,n:i}))})}_.startedAt=null,_.thinkMs=0,_.toolCalls=0,_.tools.clear()},E=null,U=new Map,J=e=>JSON.stringify([e.id,e.text,e.options.map(n=>n.label)]),O=null,Y=new Map,z=new Map,X=null,h=()=>{q&&(clearTimeout(q),q=null);for(let e of y)e()},q=null,Z=()=>{q||(q=setTimeout(()=>{q=null;for(let e of y)e()},80))},B=0,m=e=>{e.kind==="childClose"&&B>0&&(B-=1),B>0&&e.kind!=="childOpen"&&e.kind!=="childBack"&&(e.era=B),e.kind==="childOpen"&&(B+=1),t.ledger.push(e)},j=null,Q=!1,N=(e=!1)=>{j?m({kind:"agent",text:j}):e&&Q&&m({kind:"note",text:'chat to refine ("looks good" approves; /done finishes)'}),j=null,Q=!1},fe=()=>{j=null,Q=!1},L=null,H=e=>{if(L){if(e)for(let n of L.items){let i=e.get(n.temp_ref);i&&(n.logical_id=i)}m({kind:"turn",...L}),L=null}},T=()=>{H(),t.activeTurn&&(t.activeTurn=null)},ee=(e,n)=>n.choice||(n.selected_index!=null?e.options[n.selected_index]?.label??"?":"?"),P=()=>{let e=t.pending;if(!e)return;if(!e.resolution.every(Boolean)){e.cursor=e.resolution.findIndex(o=>o===null);return}let n=e.questions.map((o,c)=>{let d=e.resolution[c];return d.form==="deferred"?{id:o.id,selected_index:null,free_text:null}:{id:o.id,selected_index:d.selected_index,free_text:d.free_text}});t.pending=null,t.status=t.status==="pausing"?"pausing":"streaming",t.status==="streaming"&&(t.busySince=Date.now());let i=E;E=null,i?.(n)},D=(e,n)=>{let i=t.pending,o=i.questions[e],c=i.resolution[e];i.resolution[e]=n;let d=pe(o);c?m({kind:"answer",receipt:{form:"changed",qNum:e+1,stub:d,choice:ee(o,n),prev:c.choice}}):n.form==="deferred"?m({kind:"answer",receipt:{form:"deferred",qNum:e+1,stub:d}}):m({kind:"answer",receipt:{form:n.form,qNum:e+1,stub:d,choice:ee(o,n)}})},te=()=>{let e=t.pending;e&&(e.questions.forEach((n,i)=>{e.resolution[i]||D(i,{form:"deferred",selected_index:null,free_text:null,choice:""})}),P())},W=new Map,ne=e=>{W.clear();let n={high:0,med:1,low:2};return e=e.map((i,o)=>({q:i,i:o})).sort((i,o)=>(n[i.q.risk]??3)-(n[o.q.risk]??3)||i.i-o.i).map(({q:i})=>i),{questions:e,cursor:0,resolution:e.map(()=>null)}};return{state:t,explainLines(e){if(!r.explain||!r.graph||r.contextDir===void 0)return null;let n=r.explain(r.contextDir,r.graph,e);return n.target?[`${n.target.label} ${n.target.slug??n.target.cid.slice(0,19)}:`,...n.entries.map(i=>` [${i.kind}] ${i.rationale??i.detail}`)]:null},explainRef(e){if(!r.explain||!r.graph||r.contextDir===void 0){m({kind:"note",text:"explain isn't available here"}),h();return}let n=r.explain(r.contextDir,r.graph,e),i=n.target?[`${n.target.label} ${n.target.slug??n.target.cid.slice(0,19)}:`,...n.entries.map(o=>` [${o.kind}] ${o.rationale??o.detail}`)].join(`
|
|
3
|
+
`):`unknown ref: ${e}`;m({kind:"note",text:i}),h()},subscribe(e){return y.push(e),()=>{let n=y.indexOf(e);n>=0&&y.splice(n,1)}},submit(e){if(t.confirm&&(t.confirm=null),!t.pending){if(!s){t.turns.push({role:"user",text:e}),m({kind:"user",text:e}),t.notice="the agent isn't running \u2014 nothing sent",h();return}for(t.notice=void 0,t.checkpoint=!1,N(),t.turns.push({role:"user",text:e}),m({kind:"user",text:e}),v(e),t.status="streaming",t.busySince=Date.now(),$(),t.error=void 0,g+=1;f.length>0;)g+=1,s({type:"user_message",message_id:`u${g}-receipt`,text:f.shift()});s({type:"user_message",message_id:`u${g}`,text:e}),h()}},attachSender(e){let n=s;return s=e,()=>{s=n}},attachOnCommitted(e){x=e},attachConversationSource(e){a=e},attachSession(e){r.session=e},holdReceipt(e){f.push(e),t.checkpoint=!0,h()},drainHeldReceipts(){return f.splice(0,f.length)},peekHeldReceipts(){return[...f]},submitAnswer(e,n){let i=t.pending,o=i?.questions[e],c=o?.options[n]?.label;!i||!o||c==null||(D(e,{form:"answered",selected_index:n,free_text:null,choice:c}),P(),h())},submitFreeText(e,n){let i=t.pending,o=i?.questions[e],c=n.trim();!i||!o||!c||(D(e,{form:"answered",selected_index:null,free_text:c,choice:c}),P(),h())},deferBatch(e){let n=t.pending;if(!n||!E)return;n.questions.forEach((o,c)=>{let d=n.resolution[c];d&&d.form==="answered"&&U.set(J(o),d)}),t.pending=null,t.status=t.status==="pausing"?"pausing":"streaming",t.status==="streaming"&&(t.busySince=Date.now()),m({kind:"note",text:`questions set aside \u2014 source ${e.source_id} landed; the agent reads it next`});let i=E;E=null,i({deferred:!0,ingested:e}),h()},submitAnswerWithText(e,n,i){let o=t.pending,c=o?.questions[e],d=c?.options[n]?.label;if(!o||!c||d==null)return;let b=i.trim();D(e,{form:"answered",selected_index:n,free_text:b||null,choice:b?`${d} \u2014 ${b}`:d}),P(),h()},toggleOption(e,n){let i=t.pending?.questions[e];if(!i||i.options[n]==null)return;let o=W.get(e)??new Set;o.has(n)?o.delete(n):o.add(n),W.set(e,o),h()},multiSelection(e){return[...W.get(e)??[]].sort((n,i)=>n-i)},confirmMulti(e){let n=t.pending,i=n?.questions[e];if(!n||!i)return;let o=[...W.get(e)??[]].sort((d,b)=>d-b).map(d=>i.options[d]?.label).filter(d=>d!=null);if(o.length===0)return;W.delete(e);let c=o.join(", ");D(e,{form:"answered",selected_index:null,free_text:c,choice:c}),P(),h()},goWithRecommendations(){let e=t.pending;if(!e)return{picks:""};let n=be(e),i=null;return e.questions.forEach((o,c)=>{if(e.resolution[c])return;let d=o.recommended_index,b=d!=null?o.options[d]?.label:void 0;if(b==null){i===null&&(i=c);return}D(c,{form:"assumed",selected_index:d,free_text:null,choice:b})}),i!==null?(e.cursor=i,h(),{blocked:i}):(P(),h(),{picks:n})},reopenQuestion(){let e=t.pending;if(!e)return;let n=e.cursor<0?e.questions.length:e.cursor;for(let i=n-1;i>=0;i--)if(e.resolution[i]){e.cursor=i,h();return}},continueParked(){if(s){for(t.checkpoint=!1,m({kind:"continued"});f.length>0;)g+=1,s({type:"user_message",message_id:`u${g}-receipt`,text:f.shift()});g+=1,s({type:"user_message",message_id:`u${g}`,text:"continue"}),t.status="streaming",t.busySince=Date.now(),$(),h()}},note(e){m({kind:"note",text:e}),h()},finalizeForExit(){T(),A(),N(),t.stream=null,h()},aliasOf(e){return z.get(e)},registerAliases(e){for(let n of e)z.set(n.ref,n.cid);H(new Map(e.filter(n=>n.id).map(n=>[n.ref,n.id]))),h()},setWorking(e){if(e!=null){if(t.status!=="idle"&&t.status!=="working")return;t.status==="idle"&&(t.busySince=Date.now()),$(),t.status="working",t.workingLabel=e}else{if(t.status!=="working")return;t.status="idle",t.workingLabel=void 0,t.busySince=void 0}h()},ledger(e){e.kind==="commit"&&H(),e.kind==="error"&&(T(),A(),N()),m(e),e.kind==="commit"&&(e.ok?N(!0):fe()),h()},senderAlive(){return s!=null},completeSession(){te(),s?.({type:"session_complete"}),t.status="idle",t.busySince=void 0,h()},requestPause(){te(),t.status="pausing",t.busySince=void 0;let e=s;Promise.resolve().then(()=>e?.({type:"pause"})),h()},ask(e){t.pending=ne(e),Y=new Map(e.map((i,o)=>[i.id,o+1])),t.status="awaiting-input",t.busySince=void 0;let n=new Promise(i=>{E=i});if(U.size>0){let i=0;e.forEach((o,c)=>{let d=J(o),b=U.get(d);b&&(U.delete(d),D(c,{...b}),i+=1)}),i>0&&m({kind:"note",text:`your earlier answer${i>1?"s are":" is"} pre-filled \u2014 press enter to send, or pick a different answer`})}return h(),n},attachIngest(e){let n=O;return O=e,()=>{O===e&&(O=n)}},canIngest(){return O!==null},async ingestAttach(e){let n=O,i=e.trim();if(!n||!i)return;let o;try{o=await n(i)}catch(c){o={ok:!1,error:c instanceof Error?c.message:String(c)}}o.ok||(m({kind:"note",text:o.error??"the source could not be ingested"}),h())},noteCoercion(e,n){m({kind:"answer",receipt:{form:"assumed",qNum:Y.get(e.id)??0,stub:pe(e),choice:n,note:"your typed answer couldn't be used here"}}),h()},onAgentEvent(e){switch(e.type){case"reasoning_delta":case"reasoning_done":case"tool_activity":case"decision_activity":{let n=t.thinking;if(t.thinking=le(n,e),t.thinking!==n&&(e.type==="reasoning_done"&&e.present?($(),_.thinkMs+=e.took_ms):e.type==="tool_activity"&&e.status!=="started"&&($(),_.toolCalls+=1,_.tools.set(e.name,(_.tools.get(e.name)??0)+1))),e.type==="reasoning_delta"){Z();return}break}case"usage":t.credits={turn:e.credits,total:e.total_credits};break;case"text_delta":{let n=X;if(n&&(e.turn_id<n.turn_id||e.turn_id===n.turn_id&&e.attempt<n.attempt))return;(!n||n.turn_id!==e.turn_id||n.attempt!==e.attempt)&&(X={turn_id:e.turn_id,attempt:e.attempt},t.stream={text:""}),t.stream={text:(t.stream?.text??"")+e.text},Z();return}case"progress":break;case"proposal":{l+=1,T(),t.stream=null,t.busySince=void 0,A();let n=xe(e.proposal),i=r.dedupFlags?.(e.proposal);if(i)for(let o of n){let c=i.get(o.temp_ref);c&&(o.matches_existing=c)}t.turns.push({role:"agent",turnIndex:l,items:n,text:e.narrative}),j=e.narrative??null,Q=!0,t.activeTurn={turnIndex:l,heading:"use-cases",items:n},L={turnIndex:l,heading:"use-cases",items:n},(t.status==="streaming"||t.status==="working")&&(t.status="idle"),t.workingLabel=void 0;break}case"design":{l+=1,T(),t.stream=null,t.busySince=void 0,A();let{items:n,heading:i}=_e(e.design),o=e.design.phase==="wiring"?"acceptance criteria + exercises":i.split(" + ").map(c=>ye[c]??c).join(" + ");m({kind:"banner",text:`designing: ${o}`}),t.turns.push({role:"agent",turnIndex:l,items:n,itemsHeading:i,text:e.narrative}),j=e.narrative??null,Q=!0,t.activeTurn={turnIndex:l,heading:i,items:n},L={turnIndex:l,heading:i,items:n},(t.status==="streaming"||t.status==="working")&&(t.status="idle"),t.workingLabel=void 0;break}case"ask_user":A(),t.pending=ne(e.questions),t.status="awaiting-input",t.busySince=void 0;break;case"chat_ops":{l+=1,T(),A(),t.stream=null,(t.status==="streaming"||t.status==="working")&&(t.status="idle",t.busySince=void 0,t.workingLabel=void 0);let n=e.chat_ops??e,i=Array.isArray(n.ops)?n.ops:[],o=n.text??e.text??"",c=r.refreshGraph?.()??r.graph,d=u=>z.get(u)??u,b=i.map(u=>{if(!u.target)return u;let k=d(u.target),S=u.expected_cid;if(S==null&&c){let ie=c.resolve(k);ie&&(S=c.tipOf(ie.cid))}let I=u.payload?.redirect_to,M=I&&d(I);return k===u.target&&S===u.expected_cid&&M===I?u:{...u,target:k,expected_cid:S,...M!==I?{payload:{...u.payload,redirect_to:M}}:{}}}),F;try{if(!Array.isArray(n.ops))throw new Error("the agent sent an unreadable change set (no ops array) \u2014 say it again in different words");F=ge(b,r.descriptor??{mint_gate:[]},{turn:l,...a?{convSourceId:a}:{}})}catch(u){t.error=u instanceof Error?u.message:String(u),t.turns.push({role:"agent",turnIndex:l,text:o,narration:t.error}),o&&m({kind:"agent",text:o}),m({kind:"error",title:t.error,detail:[]}),f.push(`OPS REJECTED (did not compile) \u2014 nothing landed; do not assume any of your last ops applied.
|
|
4
|
+
- `+t.error);break}let{chatOps:R,ambiguous:G}=F;if(G.length>0){let u=G[0];t.confirm={kind:"ambiguity-confirm",prompt:`did you mean edit or ${u.kinds.filter(k=>k!=="edit").join("/")} on ${u.target}?`},t.turns.push({role:"agent",turnIndex:l,text:o}),o&&m({kind:"agent",text:o});break}if(C(R),r.commitChatTurn&&R.length>0){let u;try{u=r.commitChatTurn({contextDir:r.contextDir??"",graph:r.refreshGraph?.()??r.graph,ops:R,by:r.by??{kind:"human",id:"owner"},...r.descriptor?.mint_gate?{mintable:r.descriptor.mint_gate}:{},...r.session?.state?.sid?{sid:r.session.state.sid}:{}})}catch(k){u={record:null,errors:[{code:"COMMIT_THREW",detail:k instanceof Error?k.message:String(k)}]}}if(u.errors)t.error=u.errors.map(k=>k.detail).join("; "),t.turns.push({role:"agent",turnIndex:l,text:o}),m({kind:"commit",ok:!1,line:"commit failed \u2014 nothing landed",warnings:u.errors.map(k=>`${k.code}: ${k.detail}`)}),f.push(["COMMIT FAILED (chat turn) \u2014 nothing landed; do not assume any of your last ops applied.",...u.errors.map(k=>`- ${k.code}: ${k.detail}`),...u.errors.some(k=>k.code==="UNKNOWN_FIELD")?["If you were changing citations or matched-existing content, that is proposal territory (approve/re-propose) \u2014 a chat edit can only replace a node's own schema fields."]:[]].join(`
|
|
5
|
+
`)),o&&m({kind:"agent",text:o});else{u.applied.length>0&&r.session?.markApplied(u.applied);let k=w(u);t.turns.push({role:"agent",turnIndex:l,text:o,narration:k}),m({kind:"commit",ok:!0,line:k});let S=r.refreshGraph?.();if(S&&x&&x(S),S)try{p+=1;let re=r.descriptor?.mint_gate?.includes("usecase")?"extract":"design",I=ce({verb:re,commitN:p,phase:"chat",committed:u.minted.map(M=>({cid:M.cid,...M.slug?{logical_id:M.slug}:{}})),...se(r.templateVersion?.()??null)>=8?{typedBlockers:!0,...r.ucRef?{ucRef:r.ucRef}:{}}:{},...(r.pendingForceScope?.()??[]).length?{ignoreGaps:new Set(r.pendingForceScope())}:{}},S);f.push(I.text)}catch{}o&&m({kind:"agent",text:o})}}else t.turns.push({role:"agent",turnIndex:l,text:o}),o&&m({kind:"agent",text:o});v(o);break}case"done":case"session_complete":T(),A(),N(),t.status="idle",t.busySince=void 0,s=null;break;case"error":T(),A(),N(),t.stream=null,t.status="idle",t.busySince=void 0,t.error=e.message,s=null,m({kind:"error",title:e.message,detail:[]});break;case"session_paused":break;default:break}h()}}}export{be as a,pe as b,De as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{x as s}from"./chunk-
|
|
2
|
+
import{x as s}from"./chunk-PHR2OSWD.js";function n(r="prod"){let e=s[r];return r!=="stage"?e:{authBaseUrl:process.env.KANE_STAGE_AUTH_URL??e.authBaseUrl,consentUrl:process.env.KANE_STAGE_CONSENT_URL??e.consentUrl,controllerBaseUrl:process.env.TESTMUAI_BASE_URL??e.controllerBaseUrl,tmsBaseUrl:process.env.KANE_STAGE_TMS_URL??e.tmsBaseUrl,testGeneratorBaseUrl:process.env.KANE_STAGE_TCG_URL??e.testGeneratorBaseUrl,secretsBaseUrl:process.env.KANE_STAGE_SECRETS_URL??e.secretsBaseUrl,testManagerUiUrl:process.env.KANE_STAGE_TEST_MANAGER_UI_URL??e.testManagerUiUrl,shareApiBaseUrl:process.env.KANE_STAGE_SHARE_API_URL??e.shareApiBaseUrl,v16ServerHost:process.env.KANE_STAGE_V16_SERVER_HOST??e.v16ServerHost,evidenceViewerUrl:process.env.KANE_STAGE_EVIDENCE_VIEWER_URL??e.evidenceViewerUrl,mediaArtefactsHost:process.env.KANE_STAGE_MEDIA_ARTEFACTS_HOST??e.mediaArtefactsHost,mobileAppBaseUrl:process.env.KANE_STAGE_MOBILE_APP_URL??e.mobileAppBaseUrl}}export{n as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{O as u,P as c,b as f}from"./chunk-
|
|
2
|
+
import{O as u,P as c,b as f}from"./chunk-RDHWNSDP.js";import{existsSync as o,mkdirSync as g,readFileSync as b}from"fs";import{dirname as l,join as m}from"path";function s(t,r){let n=r.startsWith("sha256:")?r.slice(7):r;return m(t,"blobs",n.slice(0,2),n.slice(2))}function F(t,r){return s(t,r)}function p(t){let r=Buffer.concat([Buffer.from("assurance.blob\0","utf8"),t]);return"sha256:"+f(r)}function y(t,r){let n=p(r),i=s(t,n);if(!o(i)){let e=l(i),a=!o(e);g(e,{recursive:!0}),u(i,r),a&&c(l(e))}return n}function S(t,r){let n=s(t,r);return o(n)?b(n):null}export{F as a,p as b,y as c,S as d};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as Y,c as W}from"./chunk-PDXZROJM.js";import{S as X}from"./chunk-TISVRTL7.js";import{b as J}from"./chunk-5GUD3CIH.js";import{a as H}from"./chunk-JQ64X2TO.js";import{a as Rt,b as k}from"./chunk-NBXYL2JT.js";import{a as K}from"./chunk-BPMSNGXQ.js";import{a as G}from"./chunk-DHJSM5DT.js";import{a as $}from"./chunk-NLCCBXXV.js";import{a as R}from"./chunk-RZ4F3BHX.js";import{e as kt}from"./chunk-UR6MHSHU.js";import{readFileSync as L,existsSync as z,readdirSync as ue,mkdirSync as V,writeFileSync as w}from"fs";import{readFile as vt,unlink as le}from"fs/promises";import{join as y}from"path";import{existsSync as te,mkdirSync as ee,readdirSync as ht,writeFileSync as ne}from"fs";import{join as S}from"path";import{randomUUID as A}from"crypto";var Q=["children","instructions","branches","module_content","true_branch","false_branch"];function j(e){let t=new Map,n=r=>{if(!r||typeof r!="object")return;let o=r;if(Array.isArray(o.operations))for(let i of o.operations){let s=i.operation_id;if(typeof s!="string"||!s)continue;let a=t.get(s)??[];a.includes(o)||a.push(o),t.set(s,a)}for(let i of Q){let s=o[i];Array.isArray(s)?s.forEach(n):s&&typeof s=="object"&&n(s)}};return e.forEach(n),t}function Pt(e,t){if(!t||t.length===0)return;if(t.length===1)return t[0];let n=e.action_params?.script;if(typeof n=="string"&&n.trim()){let r=n.trim(),o=t.find(i=>St(i)?.trim()===r);if(o)return o}return t[0]}function St(e){let t=e,n=t.script_content??t.js_snippet;return typeof n=="string"?n:void 0}function D(e,t){let n=new Map;for(let r of e){let o=Pt(r,r.action_id?t.get(r.action_id):void 0);if(!o)continue;let i=n.get(o)??[];i.push(r),n.set(o,i)}return n.size===0?null:[...n].map(([r,o])=>Lt(r,o))}function tt(e,t){let n=j(t.authoredInstructions),r=[];for(let o of e){if(o.flatIndex===void 0||!t.replayOnlyFlatIndices.has(o.flatIndex))continue;let i=D(o.records,n);i&&r.push(...i)}return r}function et(e,t){let n=new Map(t.map(a=>[a.instruction_id,a])),r=[],o=a=>{if(!a||typeof a!="object")return;let c=a.instruction_id,u=typeof c=="string"?n.get(c):void 0;return u&&r.push(c),u},i=a=>{if(!a||typeof a!="object")return;let c=a;for(let u of Q){let l=c[u];if(Array.isArray(l))s(l);else if(l&&typeof l=="object"){let _=o(l);_&&(c[u]=_),i(_??l)}}},s=a=>{for(let c=0;c<a.length;c++){let u=o(a[c]);u&&(a[c]=u),i(u??a[c])}};return s(e),r}function wt(e){if(!e.timestamp||e.duration_ms==null)return"";let t=new Date(e.timestamp);return isNaN(t.getTime())?"":new Date(t.getTime()+e.duration_ms).toISOString()}function T(e){if(e!=null)try{return JSON.parse(e)}catch{return e}}function xt(e){return typeof e=="string"?"string":typeof e=="boolean"?"bool":typeof e=="number"?Number.isInteger(e)?"int":"float":Array.isArray(e)?"list":e==null?"NoneType":"JSON"}function C(e,t,n){let r=e.user_variables,o=typeof r=="string",i;try{i=o?JSON.parse(r):r??[]}catch{return}if(!Array.isArray(i)||i.length===0)return;let s=i.find(a=>t&&a.name===t)??(i.length===1?i[0]:void 0);s&&(s.value=n,s.value_type=xt(n),e.user_variables=o?JSON.stringify(i):i)}function Z(e){e.user_variables!==void 0&&(e.user_variables=typeof e.user_variables=="string"?"[]":[])}function Ot(e,t){let n=e.operations??[],r=new Set(t.map(i=>i.action_id).filter(Boolean)),o=n.filter(i=>r.has(i.operation_id));return o.length>0?o:n.length===1?n:[]}function Nt(e){let t=e.error??"Script execution failed";return{error:t,error_code:"SCRIPT_EXECUTION_ERROR",error_message:t,reason:t}}function Lt(e,t){let n=structuredClone(e),r=t[0],o=t[t.length-1];n.status=t.find(s=>s.status!=="success")?.status??r.status,n.start_timestamp=r.timestamp??n.start_timestamp,n.end_timestamp=wt(o)||n.end_timestamp;let i=Ot(n,t);for(let s of i)s.status=n.status,s.operation_start=n.start_timestamp,s.operation_end=n.end_timestamp;switch(n.content_type){case"api":{let s=o.action_params?.api_data?.response;if(s&&typeof s=="object")for(let a of[n,...i])a.api_data={...a.api_data??{},response:s},C(a,o.output_variable,s);break}case"script":{let s=o.output_variable??n.output_variable_name;if(n.status!=="success"){let a=Nt(o);n.code_error=a,Z(n);for(let c of i)c.execution_result=a,c.code_error=a,Z(c)}else if(o.output_value!=null){let a=T(o.output_value);C(n,s,a);for(let c of i)c.execution_result={value:a},C(c,s,a)}break}case"db_query":{o.output_value!=null&&(n.db_details={...n.db_details??{},carried_out_query:T(o.output_value)});break}case"screenshot_command":{let s=T(o.output_value);s&&typeof s=="object"&&(n.smartui_results=s);break}case"network_assertion":case"network_query":break;default:break}return n}var Tt="/home/kaneai/Downloads";function O(e){return`${Tt}/${e}`}function it(e){return"FILE__"+e.replace(/[^A-Za-z0-9]/g,"_")}function N(e){let t=e?.media;return!t||!t.name||!t.media_url?null:{media_id:t.media_id??"",name:t.name,media_url:t.media_url,type:t.type??"doc"}}function ot(e){return e?e.includes(`
|
|
3
|
+
`)?e.split(`
|
|
4
|
+
`).map(t=>t.trim()).filter(Boolean):e.split(". ").map(t=>t.trim()).filter(Boolean).map(t=>t.endsWith(".")?t:t+"."):[]}function U(e){return typeof e=="string"&&e.includes("{{secrets.")}var Ct={click:"CLICK",double_click:"CLICK",type:"TYPE",fill:"TYPE",clear:"CLEAR",select:"SELECT",hover:"HOVER",drag:"DRAG_DROP",upload_files:"UPLOAD_FILE",navigate:"OPEN",go_back:"NAVIGATE",go_forward:"NAVIGATE",refresh:"REFRESH",press_key:"SENDKEYS",scroll:"SCROLL_PIXELS",scroll_into_view:"SCROLL_UNTIL_ELEMENT",wait:"WAIT",wait_until:"WAIT_UNTIL",wait_for_load:"WAIT_FOR_LOAD",switch_tab:"SWITCH_TAB",new_tab:"NEW_TAB",close_tab:"CLOSE_TAB",api:"API",evaluate_js:"EVALUATE_JS",vision_query:"VISION_QUERY",textual_query:"TEXTUAL_QUERY",get_url:"GET_URL",get_title:"GET_TITLE",assert:"ASSERTION",math:"MATHEMATICAL_OPERATION",set_cookies:"SET_COOKIES",delete_cookies:"DELETE_COOKIES",clear_cookies:"CLEAR_COOKIES",set_local_storage:"SET_LOCAL_STORAGE",delete_local_storage:"DELETE_LOCAL_STORAGE",clear_local_storage:"CLEAR_LOCAL_STORAGE",set_clipboard:"SET_CLIPBOARD",paste_clipboard:"PASTE_CLIPBOARD",clear_clipboard:"CLEAR_CLIPBOARD",device_control:"DEVICE_CONTROL",device_control_query:"DEVICE_CONTROL_QUERY"},st={literal:"SET_VARIABLE",condition:"SET_VARIABLE",visual:"VISION_QUERY",dom:"TEXTUAL_QUERY",url:"GET_URL",title:"GET_TITLE",devtool_network:"DEVTOOLS_NETWORK_QUERY",devtool_console:"DEVTOOLS_CONSOLE_QUERY",devtool_cookies:"DEVTOOLS_COOKIES_QUERY",devtool_storage:"DEVTOOLS_STORAGE_QUERY",devtool_performance:"DEVTOOLS_PERFORMANCE",api_response:"API_CALLS_QUERY",textual_visual:"TEXTUAL_ANALYZER"},jt=new Set(["CLICK","TYPE","FILL","HOVER","SCROLL_UNTIL_ELEMENT","UPLOAD_FILE","VISION_QUERY","DRAG_DROP","SELECT"]);function at(e,t){if(e==="analyze"){let r=t?.action_params?.analyzer_type??"";return st[r]}if(e==="scroll"&&t?.action_params?.into_view===!0)return"SCROLL_UNTIL_ELEMENT";let n=Ct[e];return n||console.warn(`[migrator] UNKNOWN action_type "${e}" \u2014 falling back to "${e.toUpperCase()}"; explicit mapping required`),n??e.toUpperCase()}function ct(e,t){if(!e||!t)return"";try{let n=new Date(e);return isNaN(n.getTime())?"":new Date(n.getTime()+t).toISOString()}catch{return""}}function ut(e){try{return JSON.parse(e.output_value??"{}")}catch{return{}}}function Dt(e){let t=e.output_variable??"";if(!t)return"[]";let r={...ut(e)};return delete r.body,JSON.stringify([{name:t,unique_key:(e.action_id??"").replace(/-/g,"").slice(0,8)||A().replace(/-/g,"").slice(0,8),value:r,variable_description:"API Response"}])}function Ut(e,t,n){let r=e.action_params??{},o=jt.has(t)?"Vision Agent":"Operation Agent",i={operation_type:t};if(t==="OPEN"&&(i.url=r.url??""),t==="SET_VARIABLE"&&(i.variable_name=e.output_variable??r.key??"",i.variable_value=e.output_value??""),t==="UPLOAD_FILE"){let m=N(r);m&&(i.value=O(m.name))}let s={},a={},c=e.action_instruction??"",u=r.text??"",l=r.url??"",_=[["intent",c],["value",u],["url",l]];for(let[m,h]of Object.entries(n)){let I=String(h);if(m.startsWith("secrets."))for(let[E,b]of _)b.includes(I)&&(a[E]=m);for(let[E,b]of _)b.includes(I)&&!(E in s)&&(s[E]=b)}let p=e.action_type,d={operation:e.action_instruction??"",agent:o,operation_dict:i,reasoning:p==="analyze"?r.query??"":e.intent??e.action_instruction??"",variable:s,secrets:a,params:{}};p==="analyze"&&typeof r.code=="string"&&r.code&&(d.code=r.code),p==="analyze"&&typeof r.code_js=="string"&&r.code_js&&(d.code_js=r.code_js),p==="analyze"&&typeof r.condition_expression=="string"&&r.condition_expression&&(d.condition_expression=r.condition_expression),r.uses_websocket===!0&&(d.uses_websocket=!0),r.uses_sse===!0&&(d.uses_sse=!0),p==="analyze"&&r.analyzer_type==="textual_visual"&&(typeof r.wrapped_js=="string"&&(d.wrapped_js=r.wrapped_js),Array.isArray(r.locators)&&(d.locators=r.locators),typeof r.operator=="string"&&(d.operator=r.operator),Array.isArray(r.transforms)&&(d.transforms=r.transforms),typeof r.query=="string"&&(d.query=r.query),typeof r.expected_value=="string"&&(d.expected_value=r.expected_value),typeof r.needs_unit_conversion=="boolean"&&(d.needs_unit_conversion=r.needs_unit_conversion),typeof r.condition=="string"&&(d.condition=r.condition));let g={set_cookies:"cookies",set_clipboard:"text",delete_cookies:"names",set_local_storage:"items",delete_local_storage:"keys"}[p];return g&&r[g]!==void 0&&(d[g]=r[g]),p==="set_clipboard"&&typeof r.html=="string"&&r.html&&(d.html=r.html),d}function Ft(e){let t=e.assertion_tree??{};if(typeof t.passed=="boolean")return t.passed;let n=t.sub_results??[];return n.length===0?t.status==="passed":(t.composite_operator??"and")==="or"?n.some(o=>o.passed===!0):n.every(o=>o.passed===!0)}function lt(e){return e.map(t=>({description:t.description??"",store_key:t.store_key??"",expected_value:t.expected??"",extracted_value:t.extracted_value??"",operator:t.operator??"equals",transforms:t.transforms??[]}))}function Bt(e){let t=e.assertion_tree??{},n=t.sub_results??[],r=lt(n);return{operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[],sub_results:n,sub_checks:r,composite_operator:t.composite_operator??"and",verification:t.verification??"",claim:t.description??""}}function Mt(e){let n=(e.action_params??{}).assertion_tree??{},r=n.sub_results??[],o=lt(r);return[{operation:e.action_instruction??"",agent:"Operation Agent",operation_dict:{operation_type:"ASSERTION",assertion_tree:{sub_results:r,sub_checks:o,composite_operator:n.composite_operator??"and",verification:"",claim:n.description??e.action_instruction??"",operator:[],assertion_operands:[],left_operand:null,right_operand:null,operands:[]}},variable:{},secrets:{},params:{}}]}function zt(e,t,n,r){let o=e.visual_data;if(!o||o.x==null||o.y==null)return null;let i=t?`${t}/test_screenshots`:"";return{x:o.x,y:o.y,confidence:0,bbox:o.bbox??null,bbox_source:o.bbox?"accessibility_tree":"fallback",viewport_width:o.viewport_width??1280,viewport_height:o.viewport_height??800,scale_factor:null,raw_image_url:i?`${i}/untagged_screenshot/${n}.${r?.get(n)??"png"}`:"",raw_image_sas_url:"",annotated_image_url:"",annotated_image_sas_url:""}}function Vt(e){if(!e)return"";let t=e;return typeof e=="object"&&!Array.isArray(e)&&Array.isArray(e.frameInfo)&&(t=e.frameInfo),!Array.isArray(t)||t.length===0?"":JSON.stringify(t)}function qt(e){return/^(android|ios)_native$/i.test(e.platform??"")}function dt(e,t){return e.map(n=>({...n,type:t?n.strategy??n.type??"native":n.isXPath?"xpath":"css"}))}function $t(e,t,n){let r={selector_target:"",drag_displacement:{},hold_duration_ms:null,move_duration_ms:null,hold_at_destination_ms:null};if(e!=="drag")return r;let o=t.target_selectors,i={};typeof t.direction=="string"&&t.direction&&(i.direction=t.direction,typeof t.fraction=="number"&&(i.fraction=t.fraction));let s=a=>typeof t[a]=="number"?Math.trunc(t[a]):null;return{selector_target:Array.isArray(o)&&o.length>0?dt(o,n):"",drag_displacement:i,hold_duration_ms:s("hold_duration_ms"),move_duration_ms:s("move_duration_ms"),hold_at_destination_ms:s("hold_at_destination_ms")}}function nt(e,t="",n){let r=e.action_type,o=at(r,e),i=e.action_params??{},s=e.coordinates??null,a=e.selectors??null,c=!!(a&&a.length>0),u=qt(e),l=$t(r,i,u),_=e.timestamp??"",p=e.duration_ms??0,d=e.variables_used??{},f=e.action_id??A(),g=A(),m=ct(_,p),h="",I="";if(r==="navigate")I=i.url??"",h=I;else if(r==="type"||r==="fill")h=i.text??"";else if(r==="press_key")h=i.key??"";else if(r==="wait")h=String(i.ms??i.timeout_ms??"");else if(r==="evaluate_js")h=i.script??"";else if(r==="upload_files"){let q=N(i);q&&(h=O(q.name))}else r==="analyze"&&o==="SET_VARIABLE"&&(h=e.output_value??"");let E="";r==="go_back"?E="back":r==="go_forward"&&(E="forward");let b=e.action_instruction??"",v=U(h)||U(I)||U(b),x=Ut(e,o,d);return{operation_id:f,instruction_id:g,instruction:b,intent:b,operation_start:_,operation_end:m,status:e.status??"",command:o,name:"",target:"",value:h,message:"",operation_dict:"",frame:Vt(e.frame_info),error_message:e.error??"",code_snippet:"",sub_instruction_obj:JSON.stringify(x),test_id:"",test_version:"",action:"",string_to_float:!1,feedback_msg:"",time_taken:"",create_time_stamp:"",update_time_stamp:"",locator_variable:"",locator_variable_name:"",image_url:t?`${t}/test_screenshots/untagged_screenshot/${f}.${n?.get(f)??"png"}`:"",alternative_xpaths:[],attribute:"",value_description:"",url:I,navigation_direction:E,tagified_image_url:"",query_variable_name:e.output_variable??"",query_variable_value:e.output_value??"",query_variable_type:"",expected_value:"",queried_value:"",operator:"",assertion_status:o==="ASSERTION"?Ft(i):"",query_info_dict:{},query_content_confidence:"none",debugging_logs:[],locator_index:0,query_html:"",user_variables:"[]",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,tab_index:String(i.tab_index??""),tab_identifier:String(i.tab_identifier??""),scroll_value:i.amount??1,scroll_direction:i.direction??"",mi_scroll_payload:{},sleep_duration:0,app_id:"",manual_interaction_tag:"",string_to_float_list:[],js_snippet:r==="evaluate_js"?i.script??"":"",code_error:"",hide:v,dismiss_dialog:!1,use_v2_mobile_tagging:u,multiple_inputs:!1,dialog_action:"",dialog_type:"",is_coordinates_used_for_interaction:s!==null&&!c,element_coordinates_ratio:[],element_bounds_ratio:[],x_coord:c?null:s?.x??null,y_coord:c?null:s?.y??null,target_x_coord:i.target_x??null,target_y_coord:i.target_y??null,source_description:i.source_description??null,target_description:i.target_description??null,use_coordinates:s!==null&&!c,kaneaiMobileTaggingImageLimit:1,clicks_order_code:"se_js_ac",selector:c?dt(a,u):"",selector_target:l.selector_target,math_result_variable_name:"",math_result_variable_value:"",expression_tree:o==="ASSERTION"?Bt(i):i.expression_tree??{},assertion_tree:i.assertion_tree??{},assertion_tree_simplified:{},network_throttle:{},is_mobile_offline:!1,autoheal:!1,reprobe:e.reprobe??!1,click_modifier:(i.click_count??1)>=2?{kind:"multi_click",frequency:i.click_count}:null,db_query:"",db_details:{},db_query_decoded:"",is_global_variable:!1,is_global_variable_persist:!1,global_variable_id:"",wait_for_element_timeout:0,failure_condition:o==="ASSERTION"?"Fail test immediately":"",screenshot_command:"",smartui_contents:{},smartui_results:{},result_type:"",result_hint:"",drag_offset:{},drag_displacement:l.drag_displacement,hold_duration_ms:l.hold_duration_ms,move_duration_ms:l.move_duration_ms,hold_at_destination_ms:l.hold_at_destination_ms,start_coordinates:i.source_coordinates?{x:i.source_coordinates[0],y:i.source_coordinates[1]}:{},end_coordinates:i.target_coordinates?{x:i.target_coordinates[0],y:i.target_coordinates[1]}:{},element_rect:null,is_canvas:!1,until_condition:"",until_max_retries:0,until_settle_ms:0,api_data:r==="api"?{request:e.action_params?.api_data?.request??{}}:{},output_variables:r==="api"?e.output_variable?{[e.output_variable]:null}:{}:e.output_variable?{[e.output_variable]:e.output_value??""}:{},visual_context:zt(e,t,f,n),reasoning:r==="analyze"?i.query??"":e.intent??e.action_instruction??""}}function rt(e,t){let n=e.action_type,r=at(n,e),o=e.timestamp??"",i=e.duration_ms??0,s=ct(o,i),a=r==="ASSERTION"||r==="MATHEMATICAL_OPERATION";return{instruction_id:t.instruction_id,instruction_class:a?"non_driver_action":"driver_action",module_id:"",instruction:e.action_instruction??"",command:r,error:null,parent_instruction_id:"",classification_layer_resp:r==="ASSERTION"?Mt(e):[],classification_error:{},operations:[t],status:e.status??"",start_timestamp:o,end_timestamp:s,type:"agent_generated",tags:[],html_paths:[],optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,content_type:n==="api"?"api":n==="analyze"&&e.action_params?.analyzer_type==="api_response"?"api_calls_query":n==="analyze"&&e.action_params?.analyzer_type?.startsWith("devtool_")?e.action_params.analyzer_type.replace("devtool_","devtools_"):"instruction",js_snippet:n==="evaluate_js"?e.action_params?.script??"":"",user_variables:n==="api"?Dt(e):"[]",api_data:n==="api"?{request:e.action_params?.api_data?.request??{},response:ut(e)}:{},params_used:!1,hard_assertion:r==="ASSERTION"?e.action_params?.failure_condition==="hard":!1,expected_outcome:"",module_execution_index:0,module_version:null,network_throttle:{},isEdited:!1,use_query_assertion_v2:!1,db_query:"",db_details:{},network_assertion_content:{},screenshot_command:"",smartui_contents:{},generative_id:"",plan_id:"",generative_objective:"",error_message:"",error_code:"",reason:"",title:"",used_variables:[],reasoning:n==="analyze"?e.action_params?.query??"":e.intent??e.action_instruction??""}}function Gt(e,t=[]){let n=e.action_params??{},r=n.branches??[],o=n.winning_index??-1,i=n.sub_results??[],s={};for(let c of i){let u=c.sub_results;if(u)for(let l of u){let _=l.store_key;_&&(s[_]=l)}}let a=r.map((c,u)=>{let l=u===o,_=(c.sub_checks??[]).map(p=>{let d=s[p.store_key];return{description:p.description,store_key:p.store_key,expected_value:p.expected_value,stored_value:d?.extracted_value??p.stored_value,operator:p.operator??d?.operator??"equals",transforms:p.transforms??d?.transforms??[]}});if(_.length===0&&c.condition&&i.length>0){let d=i.find(f=>f.branch_index===u)?.sub_results??[];d.length>0&&(_=d.map(f=>({description:f.description??c.condition,store_key:f.store_key??"",expected_value:f.expected??"true",stored_value:f.extracted_value??void 0,operator:f.operator??"equals",transforms:f.transforms??[]})))}return{branch_index:u,condition:c.condition??null,branch_type:c.branch_type??"sub_objective",passed:l,sub_objective:null,custom_event:c.custom_event??null,children:l?t:[],sub_checks:c.condition?_:[],composite_operator:c.composite_operator??"and"}});return{content_type:"conditional_block",instruction_id:`if_else_${A().slice(0,8)}`,instruction:e.action_instruction??"",instruction_class:"driver_action",command:"",status:e.status??"success",resolved_branch_index:o,branches:a,generative_id:"",generative_objective:"",variables_used:{},classification_layer_resp:[],classification_error:{},used_variables:[],user_variables:"[]",module_id:"",module_execution_index:0,module_version:"",plan_id:"",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,error:null,error_message:"",error_code:"",reason:"",start_timestamp:e.timestamp??"",end_timestamp:"",type:"agent_generated",hook:null,hook_type:null,evaluation_context:{},query_variables:{}}}function _t(e,t,n){for(let r of e)r.content_type==="instruction"&&"generative_id"in r&&(r.generative_id=t,r.generative_objective=n)}function F(e,t="",n,r){let o=[],i=0;for(;i<e.length;){let s=e[i],a=s.action_type;if(!r?.keepFailedActions&&s.status==="error"&&a!=="assert"&&a!=="if_else"&&a!=="child_agent_start"&&a!=="child_agent_end"&&!(s.until_condition&&!s.error)){i+=1;continue}if(a==="analyze"&&(!st[s.action_params?.analyzer_type??""]||s.action_params?.analyzer_type==="textual_visual"&&s.action_params?.code)){i+=1;continue}if(a==="child_agent_start"){let c=s.action_params?.child_id??"",u=s.action_params?.objective??"",l=[];i+=1;let _=1,p="error",d;for(;i<e.length&&_>0;){let v=e[i],x=v.action_type;if(x==="child_agent_start")_+=1;else if(x==="child_agent_end"&&(_-=1,_===0)){p=v.status??"success",d=v,i+=1;break}_>0&&l.push(v),i+=1}let f=F(l,t,n);_t(f,c,u);let g=d?.action_params?.result_code??null,m=d?.action_params?.reason_code??null,h=d?.action_params?.error_message??null,I=d?.action_params?.summary??null,E=d?.action_params?.one_liner??null,b=p==="error";o.push({content_type:"generative_block",instruction_id:`generative_block_${c}`,generative_id:c,objective:u,status:p,children:f,error_message:b?h??null:null,error_code:b?m??null:null,result_code:g??null,bifurcation_context:[],approach_reason:ot(I),one_liner:E??null});continue}else if(a==="child_agent_end"){i+=1;continue}else if(a==="if_else"){i+=1;let c=[];for(;i<e.length&&e[i].action_type==="child_agent_start";){let u=e[i],l=u.action_params?.child_id??"",_=u.action_params?.objective??"",p=[];i+=1;let d=1,f="error";for(;i<e.length&&d>0;){let m=e[i];if(m.action_type==="child_agent_start")d+=1;else if(m.action_type==="child_agent_end"&&(d-=1,d===0)){f=m.status??"success",i+=1;break}d>0&&p.push(m),i+=1}let g=F(p,t,n);c.push(...g)}o.push(Gt(s,c));continue}else if(a==="query_tool"){i+=1;continue}else if(s.until_condition){let c=nt(s,t,n),u=rt(s,c),l=typeof s.until_condition_met=="boolean"?s.until_condition_met:s.status==="success";o.push({content_type:"until_block",instruction_id:`until_${A().slice(0,8)}`,condition:s.until_condition,max_retries:s.until_max_retries??10,settle_ms:s.until_settle_ms??500,current_count:0,condition_met:l,children:[u],generative_id:"",generative_objective:"",variables_used:{},status:s.status??"success"})}else{let c=nt(s,t,n),u=rt(s,c);o.push(u)}i+=1}return o}function P(e,t="",n,r){let o=[],i=[],s=r?.passthrough,a=s?j(s.authoredInstructions):null;for(let d of e){if(s&&a&&d.flatIndex!==void 0&&s.replayOnlyFlatIndices.has(d.flatIndex)){let b=D(d.records,a);if(b){for(let v of b)o.push(v),i.push(d.flatIndex);continue}console.warn(`[migrator] replay-only passthrough: no authored operation matched step ${d.flatIndex} (action_id \u2260 any operation_id in the authored blob) \u2014 falling back to this run's records`)}let f=F(d.records,t,n,r);if(f.length===0)continue;let g=A().replace(/-/g,"");_t(f,g,d.objective);let m=f.some(b=>"status"in b&&typeof b.status=="string"?b.status==="error"||b.status==="failed":!1),h=d.resultCode?parseInt(d.resultCode,10):null,I=h!==null&&!isNaN(h)&&h>=200,E=m||I?"error":"success";o.push({content_type:"generative_block",instruction_id:`generative_block_${g}`,generative_id:g,objective:d.objective,status:E,children:f,error_message:E==="error"?d.errorMessage??null:null,error_code:E==="error"?d.reasonCode??null:null,result_code:d.resultCode??null,bifurcation_context:[],approach_reason:ot(d.summary),one_liner:d.oneLiner??null}),i.push(d.flatIndex)}let c=o.map((d,f)=>({block:d,flat:i[f]})),u=r?.moduleSpans??[],l=r?.blockSpans??[],_=r?.authoredBlocks??[];u.length>0&&(c=pt(c,u,l,_));let p=mt(l,u);return p.length>0&&(c=B(c,p,_)),{instructions:c.map(d=>d.block)}}function pt(e,t,n,r){let o=[],i=a=>a===void 0?void 0:t.find(c=>a>=c.flatFrom&&a<=c.flatTo),s=0;for(;s<e.length;){let a=i(e[s].flat);if(!a){o.push(e[s]),s++;continue}let c=[];for(;s<e.length&&i(e[s].flat)===a;)c.push(e[s++]);let u=pt(c,a.children,n,r),l=mt(ft(n,a),a.children);l.length>0&&(u=B(u,l,r)),o.push({block:Qt(a,u.map(_=>_.block)),flat:c[0].flat})}return o}function gt(e,t){return e.flatFrom>=t.flatFrom&&e.flatTo<=t.flatTo}function ft(e,t){let n=[];for(let r of e)gt(r,t)?n.push(r):n.push(...ft(r.children,t));return n}function mt(e,t){let n=[],r=i=>{for(let s of i)n.push(s),r(s.children)};r(t);let o=i=>i.filter(s=>!n.some(a=>gt(s,a))).map(s=>({...s,children:o(s.children)}));return n.length>0?o(e):e}function B(e,t,n){let r=[...t].sort((u,l)=>u.flatFrom-l.flatFrom),o=[],i=(u,l)=>{o.push({block:Yt(u,l,n),flat:u.flatFrom})},s=(u,l)=>u!==void 0&&u>=l.flatFrom&&u<=l.flatTo,a=0,c=0;for(;c<e.length;){let u=e[c].flat;for(;a<r.length&&u!==void 0&&r[a].flatTo<u;)i(r[a++],[]);let l=a<r.length&&s(u,r[a])?r[a]:void 0;if(!l){o.push(e[c]),c++;continue}let _=[];for(;c<e.length&&s(e[c].flat,l);)_.push(e[c++]);i(l,_),a++}for(;a<r.length;)i(r[a++],[]);return o}function Kt(e){let t=new Map;for(let n of e)t.set(n.flat,n);return e.filter(n=>t.get(n.flat)===n)}var Ht=["children","instructions","branches","module_content","true_branch","false_branch"];function Jt(e,t){if(!t)return;let n=[...e];for(;n.length>0;){let r=n.pop();if(!r||typeof r!="object")continue;let o=r;if(o.instruction_id===t&&(o.content_type==="conditional_block"||o.content_type==="until_block"))return o;for(let i of Ht){let s=o[i];Array.isArray(s)?n.push(...s):s&&typeof s=="object"&&n.push(s)}}}function Xt(e,t,n){if(!e)return[];if(t==="while")return Array.isArray(e.children)?e.children:[];let o=(Array.isArray(e.branches)?e.branches:[])[n];return o&&Array.isArray(o.children)?o.children:[]}function Yt(e,t,n){let r=Jt(n,e.blockId),o=e.branches.map((i,s)=>{let a=t.filter(l=>l.flat!==void 0&&l.flat>=i.flatFrom&&l.flat<=i.flatTo);e.kind==="while"&&(a=Kt(a));let c=B(a,e.children,n).map(l=>l.block);if(c.length>0)return c;let u=Xt(r,e.kind,s);return u.length===0&&!i.taken&&console.warn(`[migrator] control-flow: branch ${s} of block ${e.blockId||e.instruction} did not run and no authored block matched \u2014 emitted empty`),u});return e.kind==="if"?Wt(e,o,r):Zt(e,o[0]??[],r)}function Wt(e,t,n){let r=Array.isArray(n?.branches)?n.branches:[],o=M(t.flat()),i=e.branches.map((s,a)=>{let c=r[a];return{branch_index:a,condition:s.branch_type==="else"?null:s.condition,branch_type:s.branch_type,passed:s.taken,sub_objective:null,custom_event:c?.custom_event??null,children:t[a],sub_checks:Array.isArray(c?.sub_checks)?c.sub_checks:[],composite_operator:c?.composite_operator??"and"}});return{content_type:"conditional_block",instruction_id:e.blockId||`if_else_${A().slice(0,8)}`,instruction:e.instruction,instruction_class:"driver_action",command:"",status:o?"error":"success",resolved_branch_index:e.branches.findIndex(s=>s.taken),branches:i,generative_id:"",generative_objective:"",variables_used:{},classification_layer_resp:[],classification_error:{},used_variables:[],user_variables:"[]",module_id:"",module_execution_index:0,module_version:"",plan_id:"",optional_flag:!1,max_retries:0,retries_delay:0,explicit_wait:0,implicit_wait:0,error:null,error_message:o?.message??"",error_code:o?.code??"",reason:"",start_timestamp:"",end_timestamp:"",type:"agent_generated",hook:null,hook_type:null,evaluation_context:{},query_variables:{}}}function Zt(e,t,n){let r=e.whileCfg??{max_retries:5,settle_ms:500,on_exhaust:"fail",iterations:0,condition_met:!1},o=M(t),i=(s,a)=>n&&n[s]!==void 0?n[s]:a;return{content_type:"until_block",instruction_id:e.blockId||`until_${A().slice(0,8)}`,condition:e.instruction,max_retries:r.max_retries,settle_ms:r.settle_ms,current_count:r.iterations,condition_met:r.condition_met,children:t,generative_id:"",generative_objective:"",variables_used:{},status:o?"error":"success",on_exhaust:i("on_exhaust",r.on_exhaust),mode:i("mode",""),check:i("check",""),conditions:i("conditions",[]),connectors:i("connectors",[]),sub_checks:i("sub_checks",[]),composite_operator:i("composite_operator","and")}}function M(e){for(let t of e){let n="status"in t&&typeof t.status=="string"?t.status:"";if(n==="error"||n==="failed"){let r="error_message"in t?t.error_message:void 0,o="error_code"in t?t.error_code:void 0;return{message:r??null,code:o??null}}}return null}function Qt(e,t){let n=e.meta,r=(u,l="")=>typeof n[u]=="string"?n[u]:l,o=(u,l=!1)=>typeof n[u]=="boolean"?n[u]:l,i=u=>Array.isArray(n[u])?n[u]:[],s=typeof n.module_version=="number"||typeof n.module_version=="string"?n.module_version:null,a=r("module_id"),c=M(t);return{content_type:X,instruction_id:`module_block_${a}`,module_id:a,module_version:s,module_instance_id:A(),module_name:r("module_name"),module_description:r("module_description"),module_platform:r("module_platform"),creation_mode:r("creation_mode","Agent"),tms_status:r("tms_status","active"),is_validated:o("is_validated"),is_dirty:e.dirty,enrichment_id:r("enrichment_id"),tags:i("tags"),project_ids:i("project_ids"),link_to_all:o("link_to_all"),status:c?"error":"success",children:t,error_message:c?.message??null,error_code:c?.code??null,update_available:!1,update_info:{}}}function bt(e,t){let n;try{n=ht(e)}catch{return 0}let r=0,o=n.filter(i=>/^\d+$/.test(i)).sort((i,s)=>Number(i)-Number(s));for(let i of o){let s=S(e,i),a=S(s,"logs");if(!te(a))continue;let c;try{c=ht(a)}catch{continue}let u=c.filter(p=>p.endsWith("-actions.ndjson")).sort((p,d)=>(parseInt(p,10)||0)-(parseInt(d,10)||0)),l=[];for(let p of u){let d=t.readActions(S(a,p));d.length&&l.push({objective:t.objective??"",records:d})}if(l.length===0)continue;let{instructions:_}=P(l,t.screenshotBaseUrl??"",t.extMap,{keepFailedActions:!0});if(_.length!==0)try{let p=S(s,"auteur");ee(p,{recursive:!0}),ne(S(p,"execution.json"),JSON.stringify(t.buildBlob(_),null,2)),r++,t.log?.("info","EVIDENCE_ARCHIVED_ATTEMPT_BLOB","Derived nested attempt blob",{attempt:i,instructions:_.length})}catch(p){t.log?.("debug","EVIDENCE_ARCHIVED_ATTEMPT_BLOB_FAILED","Nested attempt blob derivation failed",{attempt:i,error:p instanceof Error?p.message:String(p)})}}return r}var yt=kt(Rt(),1);import{createWriteStream as re}from"fs";import{readFile as ie}from"fs/promises";import{join as oe,basename as se}from"path";import{tmpdir as ae}from"os";var ce=["**/screenshots/**","**/annotated/**","**/tcg/**","**/bifurcation/**"];async function Et(e){let t=oe(ae(),`${se(e)}_artifacts.zip`);return new Promise((n,r)=>{let o=re(t),i=(0,yt.default)("zip",{zlib:{level:6}});o.on("close",()=>n(t)),i.on("error",r),i.pipe(o),i.glob("**/*",{cwd:e,ignore:ce}),i.finalize()})}async function It(e){return ie(e)}async function de(e,t){return vt(J(e,t))}function _e(e){return{key:"artifacts",content_type:"application/zip",filename:`${e}.evidence`}}var At=class{config;controller;testId;constructor(t){this.config=t,this.controller=new G(t.controllerBaseUrl,t.auth),this.testId=t.testId}log(t,n,r,o){this.config.log?.(t,n,r,o)}async execute(){let{onProgress:t}=this.config;try{if(!this.testId)return this.log("error","PIPELINE_ABORT","No test_id available"),{success:!1,testId:null,error:"No test_id available"};let n=this.config.evidence,r=null;if(this.config.shouldUploadArtifacts!==!1){t("convert","running");let a=this.collectNdjsonPerRun(),c=a.reduce((g,m)=>g+m.records.length,0);this.log("info","PIPELINE_CONVERT","Collected NDJSON records",{total_records:c,run_groups:a.length});let u=this.loadReplayOnlyPassthrough(),{instructions:l}=a.length>0?P(a,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap,{moduleSpans:this.config.moduleSpans,...u?{passthrough:u}:{},...this.config.blockSpans?.length?{blockSpans:this.config.blockSpans,authoredBlocks:this.loadAuthoredBlocks()}:{}}):{instructions:[]};this.log("info","PIPELINE_CONVERT_INSTRUCTIONS","Auteur instructions produced",{count:l.length});let _=this.buildExecutionEnvelope(l),p=Buffer.from(JSON.stringify(_));this.log("info","PIPELINE_CONVERT_BLOB","Blob created",{size_kb:+(p.length/1024).toFixed(1)});let d=y(this.config.sessionDir,"execution.json");w(d,JSON.stringify(_,null,2)),this.log("info","PIPELINE_CONVERT_LOCAL_SAVE","Execution blob saved locally",{path:d});let f=n?.packTestDir??this.config.evidenceRead?.packTestDir;if(f){let g=y(f,"auteur");V(g,{recursive:!0}),w(y(g,"execution.json"),JSON.stringify(_,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack",{path:y(g,"execution.json")}),this.deriveArchivedAttemptBlobs(f)}if(t("convert","done"),n)r=p;else{t("zip","running"),this.log("info","PIPELINE_ZIP_START","Zipping session",{session_dir:this.config.sessionDir});let g=null,m;try{g=await Et(this.config.sessionDir),m=await It(g),this.log("info","PIPELINE_ZIP_DONE","Zip complete",{size_mb:+(m.length/1024/1024).toFixed(1),path:g}),t("zip","done",`${(m.length/1024/1024).toFixed(1)}MB`)}finally{g&&await le(g).catch(()=>{})}t("presign","running"),this.log("info","PIPELINE_PRESIGN_START","Requesting presigned URLs",{url:`${this.config.controllerBaseUrl}/upload/presign`,test_id:this.testId,session_id:this.config.sessionId});let h=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"artifacts",content_type:"application/zip",filename:`${this.config.sessionId}_artifacts.zip`},{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:h.urls.artifacts?.blob_url,blob_url:h.urls.blob?.blob_url}),t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading artifacts and blob",{artifact_size_mb:+(m.length/1024/1024).toFixed(1),blob_size_kb:+(p.length/1024).toFixed(1)}),await Promise.all([k(h.urls.artifacts.upload_url,m,"application/zip"),k(h.urls.blob.upload_url,p,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete"),t("upload","done")}}else{let a=this.collectNdjsonPerRun(),c=this.loadReplayOnlyPassthrough(),{instructions:u}=a.length>0?P(a,this.config.screenshotBaseUrl??"",this.config.screenshotExtMap,{keepFailedActions:!0,moduleSpans:this.config.moduleSpans,...c?{passthrough:c}:{},...this.config.blockSpans?.length?{blockSpans:this.config.blockSpans,authoredBlocks:this.loadAuthoredBlocks()}:{}}):{instructions:[]},l=this.buildExecutionEnvelope(u),_=y(this.config.sessionDir,"execution.json");w(_,JSON.stringify(l,null,2)),this.log("info","PIPELINE_LOCAL_SAVE","Execution blob saved locally (no upload)",{path:_});let p=this.config.evidence?.packTestDir??this.config.evidenceRead?.packTestDir;if(p){let d=y(p,"auteur");V(d,{recursive:!0});let f=this.readAuthoredExecution(),g=f?this.refreshReplayOnlyInPack(f,a,c):null;w(y(d,"execution.json"),g?.raw??JSON.stringify(l,null,2)),this.log("info","PIPELINE_CONVERT_PACK_COPY","Execution blob copied into pack (gated)",{path:y(d,"execution.json"),source:g?g.refreshed.length>0?"authored+replay_results":"authored":"run_envelope",...g&&g.refreshed.length>0?{refreshed_instruction_ids:g.refreshed}:{}}),this.deriveArchivedAttemptBlobs(p)}t("convert","skipped"),t("zip","skipped"),t("presign","skipped"),t("upload","skipped"),this.log("info","PIPELINE_UPLOAD_SKIPPED","Upload steps skipped (gate disabled)")}if(this.config.shouldReplaceLocalOutput&&this.config.onAtomicReplace){t("atomic_replace","running");try{await this.config.onAtomicReplace(),this.log("info","PIPELINE_ATOMIC_REPLACE_OK","Local output replaced"),t("atomic_replace","done")}catch(a){let c=a instanceof Error?a.message:String(a);throw this.log("error","PIPELINE_ATOMIC_REPLACE_FAILED","Atomic-replace failed",{error:c}),t("atomic_replace","failed",c),a}}else t("atomic_replace","skipped");let o,i;if(this.config.shouldCommit&&!this.config.isFirstRun&&this.config.onCommitLock){t("commit_lock","running");let a=await this.config.onCommitLock();if(a.ok)o=a.testcaseId||void 0,this.log("info","PIPELINE_COMMIT_LOCK_OK","Commit lock acquired",{testcase_id:o??"none",trigger:a.trigger??null,test_instance_id:a.testInstanceId??null}),t("commit_lock","done");else return this.log("error","PIPELINE_COMMIT_LOCK_FAILED","Commit lock failed",{reason:a.reason,message:a.message}),t("commit_lock","failed",`${a.reason??"unknown"}: ${a.message??""}`),{success:!1,testId:this.testId,error:`commit-lock failed: ${a.reason??"unknown"}`}}else t("commit_lock","skipped");if(this.config.isFirstRun&&!this.config.skipTmsFinalize){t("finalize","running"),this.log("info","PIPELINE_FINALIZE_START","Finalizing test (first-run)",{test_id:this.testId,commit_id:this.config.commitId});let a=new K(this.config.tmsBaseUrl,this.config.tmsUsername,this.config.tmsAccessKey),c=this.config.runObjectives&&this.config.runObjectives.length>0?this.config.runObjectives:[this.config.firstObjective];if(o=(await a.endTest(this.testId,{commit_id:this.config.commitId,time_taken:Math.round(this.config.totalDuration),steps_count:this.config.totalSteps,commit_message:this.config.firstObjective.slice(0,255),objectives:c})).testcase_id||void 0,this.log("info","PIPELINE_FINALIZE_OK","Test finalized",{testcase_id:o??"none"}),this.config.onFinalizeSuccess)try{await this.config.onFinalizeSuccess(o)}catch(l){this.log("warn","PIPELINE_FINALIZE_META_FAILED","Meta-rewrite after endTest failed",{error:String(l)})}t("finalize","done")}else t("finalize","skipped"),this.log("info","PIPELINE_FINALIZE_SKIPPED","Finalize skipped (evolve flow or first-run disabled)");if(o&&this.config.shareApiBaseUrl)try{i=await this.generateShareLink(o),this.log("info","PIPELINE_SHARE_OK","Share link generated",{share_id:i})}catch(a){this.log("warn","PIPELINE_SHARE_FAILED","Share link failed",{error:String(a)})}if(n&&r){let a=null;t("zip","running");try{await n.sealFn({testcaseId:o,shareId:i}),a=n.sealedPackPath?await vt(n.sealedPackPath):await de(n.executionId,n.cwd),this.log("info","PIPELINE_EVIDENCE_SEALED","Evidence pack sealed",{execution_id:n.executionId}),this.log("info","PIPELINE_PACK_READ","Sealed pack read",{size_mb:+(a.length/1024/1024).toFixed(1)})}catch(c){let u=c instanceof Error?c.message:String(c);this.log("warn","PIPELINE_EVIDENCE_UPLOAD_SKIPPED","Evidence seal/read failed \u2014 uploading blob only",{execution_id:n.executionId,error:u})}if(a){t("zip","done",`${(a.length/1024/1024).toFixed(1)}MB`),t("presign","running");let c=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[_e(n.executionId),{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);this.log("info","PIPELINE_PRESIGN_OK","Presigned URLs received",{artifacts_url:c.urls.artifacts?.blob_url,blob_url:c.urls.blob?.blob_url}),t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading pack and blob",{artifact_size_mb:+(a.length/1024/1024).toFixed(1),blob_size_kb:+(r.length/1024).toFixed(1)}),await Promise.all([k(c.urls.artifacts.upload_url,a,"application/zip"),k(c.urls.blob.upload_url,r,"application/json")]),this.log("info","PIPELINE_UPLOAD_OK","Upload complete"),t("upload","done")}else{t("zip","skipped"),t("presign","running");let c=await this.controller.getPresignedUrls(this.testId,this.config.sessionId,[{key:"blob",content_type:"application/json",filename:`${this.config.commitId}.json`}]);t("presign","done"),t("upload","running"),this.log("info","PIPELINE_UPLOAD_START","Uploading blob only (evidence skipped)",{blob_size_kb:+(r.length/1024).toFixed(1)}),await k(c.urls.blob.upload_url,r,"application/json"),this.log("info","PIPELINE_UPLOAD_OK","Blob upload complete (pack skipped)"),t("upload","done")}}let s;if(this.config.codeExport?.enabled&&o){let a=!1;try{await this.triggerCodeExport(o),this.log("info","PIPELINE_CODE_EXPORT_START","Code export triggered"),a=!0}catch(c){let u=c instanceof Error?c.message:String(c);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export trigger failed; skipping poll",{error:u}),t("code_export","failed",`trigger failed: ${u}`)}if(a){t("code_export","running","Waiting for code generation\u2026");try{s=await this.pollAndDownloadCode(o,t),this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:s}),t("code_export","done",s)}catch(c){let u=c instanceof Error?c.message:String(c);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:u}),t("code_export","failed",u)}}}else t("code_export","skipped");return this.log("info","PIPELINE_COMPLETE","Pipeline complete"),{success:!0,testId:this.testId,testcaseId:o,shareId:i,codeExportDir:s}}catch(n){return{success:!1,testId:this.testId,error:n instanceof Error?n.message:String(n)}}}async runCodeExport(t,n){let r=n??this.config.onProgress,o=!1;try{await this.triggerCodeExport(t),this.log("info","PIPELINE_CODE_EXPORT_TRIGGER","Code export triggered",{testcase_id:t}),o=!0}catch(i){let s=i instanceof Error?i.message:String(i);this.log("error","PIPELINE_CODE_EXPORT_TRIGGER_FAILED","Code export trigger failed; skipping poll",{error:s}),r("code_export","failed",`trigger failed: ${s}`)}if(o){r("code_export","running","Waiting for code generation\u2026");try{let i=await this.pollAndDownloadCode(t,r);return this.log("info","PIPELINE_CODE_EXPORT_OK","Code export complete",{dir:i}),r("code_export","done",i),i}catch(i){let s=i instanceof Error?i.message:String(i);this.log("error","PIPELINE_CODE_EXPORT_FAILED","Code export failed",{error:s}),r("code_export","failed",s);return}}}deriveArchivedAttemptBlobs(t){try{let n=bt(t,{readActions:r=>this.readNdjsonFromFile(r),buildBlob:r=>this.buildExecutionEnvelope(r),objective:this.config.firstObjective,screenshotBaseUrl:this.config.screenshotBaseUrl??"",extMap:this.config.screenshotExtMap,log:(r,o,i,s)=>this.log(r,o,i,s)});n>0&&this.log("info","PIPELINE_ARCHIVED_ATTEMPTS","Nested retry-attempt blobs derived",{count:n})}catch(n){this.log("debug","PIPELINE_ARCHIVED_ATTEMPTS_FAILED","Nested attempt blob pass failed",{error:n instanceof Error?n.message:String(n)})}}collectNdjsonPerRun(){let t=[],n=this.config.runObjectives??[],r=this.config.runMetadata??[],o=this.config.evidence??this.config.evidenceRead;for(let i=0;i<this.config.runDirs.length;i++){let s=this.config.runDirs[i],a=n[i]||this.config.firstObjective,c=r[i],u=o?this.readNdjsonFromFile(y(o.packTestDir,"logs",`${o.runIndices?.[i]??i}-actions.ndjson`)):this.readNdjsonFromDir(s);if(u.length>0){let l=o?.runIndices?.[i]??i,_=this.config.runFlatIndex?.[l];t.push({objective:a,records:u,..._!==void 0?{flatIndex:_}:{},resultCode:c?.resultCode,reasonCode:c?.reasonCode,errorMessage:c?.errorMessage,summary:c?.summary,oneLiner:c?.oneLiner})}}if(t.length===0){let i=y(this.config.sessionDir,"runs");if(z(i))try{let a=ue(i,{withFileTypes:!0}).filter(c=>c.isDirectory()).map(c=>c.name).sort();for(let c of a){let u=y(i,c),l=this.readNdjsonFromDir(u);l.length>0&&t.push({objective:this.config.firstObjective,records:l})}}catch{}}return t}readNdjsonFromDir(t){let n=[y(t,"run-test","actions.ndjson"),y(t,"actions.ndjson")];for(let r of n)if(z(r))return this.readNdjsonFromFile(r);return[]}readNdjsonFromFile(t){let n=[];if(!z(t))return n;this.log("debug","PIPELINE_COLLECT_READ","Reading NDJSON file",{path:t});let r=L(t,"utf-8");for(let o of r.split(`
|
|
5
|
+
`)){let i=o.trim();if(i)try{n.push(JSON.parse(i))}catch{}}return n}async generateShareLink(t){let n=`${this.config.shareApiBaseUrl}/lshs/api/v1.0/share-item/generate-sharable-link`;this.log("info","PIPELINE_SHARE_START","Requesting share link",{url:n,testcase_id:t});let r={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({entityIds:[t],entityType:"Test Case Details",expiresAt:7})},o=!!this.config.authResolver;this.log("debug","PIPELINE_SHARE_AUTH","Share link auth config",{resolver:o,fallback_auth_type:typeof this.config.auth=="string"?"bearer":"basic",tms_user:this.config.tmsUsername});let i=o?await this.config.authResolver.fetch(n,r):await R(n,{...r,headers:{...r.headers,Authorization:this.buildAuthHeader()}});if(!i.ok)throw new Error(`Share link API failed: ${i.status} ${await i.text()}`);let s=await i.json();if(!s.shareId)throw new Error("Share link API returned no shareId");return s.shareId}async triggerCodeExport(t){if(!this.config.codeExport)throw new Error("triggerCodeExport called without resolved codeExport config");let{url:n,body:r}=Y({tmsBaseUrl:this.config.tmsBaseUrl,testcaseId:t,codeExport:this.config.codeExport,mobile:this.config.mobile});this.log("info","PIPELINE_CODE_EXPORT_POST","Triggering code export",{url:n});let o={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(r)},i=this.config.authResolver?await this.config.authResolver.fetch(n,o):await R(n,{...o,headers:{...o.headers,Authorization:this.buildAuthHeader()}});if(!i.ok)throw new Error(`Code export failed: ${i.status} ${await i.text()}`)}async pollAndDownloadCode(t,n){let r=W({tmsBaseUrl:this.config.tmsBaseUrl,testcaseId:t}),o=this.config.exitTimeoutMs??3e5,i=5e3,s=Date.now()+o;this.log("info","PIPELINE_CODE_EXPORT_POLL","Polling for code export",{url:r,timeout_ms:o});let a=(c,u)=>this.config.authResolver?this.config.authResolver.fetch(c,u):R(c,{...u,headers:{...u?.headers,Authorization:this.buildAuthHeader()}});for(;Date.now()<s;){let c=await a(r,{method:"GET",headers:{Accept:"application/json"}});if(!c.ok){let d=await c.text().catch(()=>"");throw this.log("warn","PIPELINE_CODE_EXPORT_POLL_FAILED","Code export poll non-200; skipping",{status:c.status,body:d.slice(0,200)}),new Error(`code export poll skipped: HTTP ${c.status}`)}let l=(await c.json()).data?.find(d=>d.code_name==="kane-cli-trigger");if(!l){this.log("debug","PIPELINE_CODE_EXPORT_WAITING","No kane-cli-trigger entry yet"),n("code_export","running","Waiting for code generation\u2026"),await this.sleep(i);continue}let _=l.status.toLowerCase();if(_==="in progress"||_==="in_progress"||_==="pending"){this.log("debug","PIPELINE_CODE_EXPORT_IN_PROGRESS","Code export in progress",{status:l.status}),n("code_export","running","Generating code\u2026"),await this.sleep(i);continue}if(!l.url||l.url.length===0)throw new Error(`Code export status=${l.status} but no files returned`);let p=this.config.codeExportDir??y(this.config.sessionDir,"code-export");V(p,{recursive:!0}),this.log("info","PIPELINE_CODE_EXPORT_DOWNLOAD","Downloading code files",{file_count:l.url.length,dir:p}),n("code_export","running",`Downloading ${l.url.length} files\u2026`);for(let d of l.url){let f=y(p,d.file_name),g=await R(d.file_url);if(!g.ok){this.log("warn","PIPELINE_CODE_EXPORT_FILE_FAILED","Failed to download file",{file_name:d.file_name,status:g.status});continue}let m=await g.text();w(f,m,"utf-8"),this.log("info","PIPELINE_CODE_EXPORT_FILE_SAVED","File saved",{file_name:d.file_name,size_bytes:m.length})}return p}throw new Error("Code export timed out")}sleep(t){return new Promise(n=>setTimeout(n,t))}buildAuthHeader(){return typeof this.config.auth=="string"?`Bearer ${this.config.auth}`:$(this.config.auth.username,this.config.auth.accessKey)}readAuthoredExecution(){let t=this.config.authoredExecutionPath;if(!t)return null;try{let n=L(t,"utf8");return JSON.parse(n),n}catch{return this.log("warn","PIPELINE_AUTHORED_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 pack gets this run's envelope",{path:t}),null}}refreshReplayOnlyInPack(t,n,r){if(!r)return{raw:t,refreshed:[]};let o=tt(n,r);if(o.length===0)return{raw:t,refreshed:[]};let i=JSON.parse(t);if(!Array.isArray(i.instructions))return{raw:t,refreshed:[]};let s=et(i.instructions,o);return s.length===0?{raw:t,refreshed:s}:{raw:JSON.stringify(i,null,2),refreshed:s}}loadAuthoredBlocks(){let t=this.config.blockAuthoredExecutionPath;if(!t)return[];try{let n=JSON.parse(L(t,"utf8"));return Array.isArray(n.instructions)?n.instructions:[]}catch(n){return this.log("warn","PIPELINE_AUTHORED_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 branches that did not run this time upload empty",{path:t,error:n instanceof Error?n.message:String(n)}),[]}}loadReplayOnlyPassthrough(){let t=this.config.replayOnlyPassthrough;if(!(!t||t.flatIndices.length===0))try{let n=JSON.parse(L(t.authoredExecutionPath,"utf8"));if(!Array.isArray(n.instructions))throw new Error("no instructions array");return{authoredInstructions:n.instructions,replayOnlyFlatIndices:new Set(t.flatIndices)}}catch(n){this.log("warn","PIPELINE_PASSTHROUGH_BLOB_UNREADABLE","Authored execution.json missing/unreadable \u2014 replay-only steps convert from this run's records",{path:t.authoredExecutionPath,flat_indices:t.flatIndices,error:n instanceof Error?n.message:String(n)});return}}buildExecutionEnvelope(t){let n=this.config.runStatuses.every(u=>u==="passed")?"success":"error",r=this.config.variableIds??{},o=[];if(this.config.variables)for(let[u,l]of Object.entries(this.config.variables)){if(l.secret||H(l))continue;let _=u.startsWith("global.")?u.slice(7):u;o.push({id:r[_]??0,name:_,value:l.value,session_value:l.value,is_persist:!1,environment_id:0,environment_name:"No Env"})}let i=[],s=u=>{let l=i.find(_=>_.name===u.name);l?l.value=u.value:i.push(u)},a=[],c=new Set;for(let u of this.collectNdjsonPerRun())for(let l of u.records)if(l.output_variable&&l.output_value!=null&&s({name:l.output_variable,value:String(l.output_value),value_type:"test_level",variable_description:"ANALYZE result"}),l.action_type==="upload_files"){let _=N(l.action_params);if(_){let p=_.media_id||_.media_url;if(!c.has(p)){c.add(p),a.push({media_url:_.media_url,media_id:_.media_id,name:_.name,type:_.type});let d=O(_.name);s({name:it(_.name),value:d,value_type:"string",variable_description:`variable for ${d}`})}}}return{test_id:this.testId,version:"v4",auto_heal_version:this.config.apMode==="v2"?"AH2":"",session_id:this.config.sessionId,org_id:String(this.config.orgId),user_id:String(this.config.userId),url:this.config.firstUrl??"",start_timestamp:this.config.startedAt,end_timestamp:this.config.endedAt,status:n,commit_id:this.config.commitId,instructions:t,modules:[],uploaded_files:a,test_params:this.config.testParams??[],test_level_variables:JSON.stringify(i),test_global_variables:o,max_network_wait:0,wait_buffer:0,network_throttle:{},secrets:this.config.secrets??[],totp:[],environment_id:0,environment:"",mobile_browser:!1,native_popups:[],smartui:{},module_index:0}}};export{de as a,_e as b,At as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as j}from"./chunk-RKXHVP2Z.js";import{a as L}from"./chunk-TCAHDVII.js";import{a as O}from"./chunk-5Y2G4NC7.js";import{a as D}from"./chunk-YCCUBQY4.js";import{y as l}from"./chunk-HYTBEPC2.js";import{a as E}from"./chunk-HCBYKLMW.js";import{a as g,b as s,i as I,k as B}from"./chunk-C44QQJR4.js";import{a as P}from"./chunk-6YGTRKDT.js";import{e as $}from"./chunk-UR6MHSHU.js";var H=$(P(),1);var w=$(E(),1),K=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function J(e){let t=e.replace(/…$/,"");return t&&t.charAt(0).toLowerCase()+t.slice(1)}function N(e,t){if(e.length<=t)return e;if(t<=1)return"\u2026";let r=Math.ceil((t-1)/2),n=Math.floor((t-1)/2);return`${e.slice(0,r)}\u2026${n>0?e.slice(-n):""}`}function Z({status:e,meta:t,tallies:r,keys:n,child:d,cols:c}){let{stdout:h}=B(),m=c??h?.columns??80,f=e.kind==="working"||e.kind==="child-working",[i,b]=(0,H.useState)(0);O(()=>b(a=>a+1),f?120:null);let k=K[i%K.length],u,p;switch(e.kind){case"working":u=`${k} ${e.step}${e.elapsedS!==void 0?` \xB7 ${e.elapsedS}s`:""}`,p=l.assuranceAccent;break;case"waiting":u=`\u25CF waiting on you${e.pending?` \u2014 ${e.pending} question${e.pending===1?"":"s"}`:""}`,p=l.amber;break;case"idle":u="\u25CF idle",p=l.assuranceAccent;break;case"card":u=`\u25CF card ${e.n} of ${e.m}`,p=l.amber;break;case"child-working":u=`${k} child: ${e.step}`,p=l.assuranceAccent;break;case"child-waiting":u="\u25CF child waiting on you",p=l.amber;break}let A=d?`${t.verb} \u25B8 ${d.verb}`:t.verb,S=d?.sid?t.sid?`${N(t.sid,14)} \u25B8 ${d.sid}`:d.sid:t.sid,C=t.env==="prod"?"":t.env,_=[A,S,C].filter(Boolean),v=" \xB7 ",R=u.length+v.length+_.join(v).length,T=t.subject;if(T){let a=m-R-v.length;T=a>=8?N(T,a):void 0}let M=[A,...T?[T]:[],S,C].filter(Boolean).join(v);return(0,w.jsxs)(g,{flexDirection:"column",children:[(0,w.jsx)(s,{color:l.muted,children:"\u2500".repeat(Math.max(1,m))}),(0,w.jsxs)(s,{children:[(0,w.jsx)(s,{color:p,children:u}),(0,w.jsx)(s,{color:l.dim,children:`${v}${M}`})]}),(0,w.jsx)(s,{color:l.dim,children:r.items.length>0?r.items.join(v):" "}),(0,w.jsx)(s,{color:l.muted,children:n.join(v)})]})}var y=$(P(),1);function ne({onToggleThinking:e,onCtrlC:t,explorer:r,panel:n}){let c=(0,y.useRef)(null),h=(0,y.useRef)(""),m=()=>{c.current&&clearTimeout(c.current),c.current=null,h.current=""};return(0,y.useEffect)(()=>m,[]),I((f,i)=>{if(i.ctrl&&f==="t"){e();return}if(i.ctrl&&f==="c"){t();return}if(!i.ctrl&&f.includes("")){t();return}if(!i.ctrl&&f.includes("")){e();return}if(r&&r.isOpen()){let b=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{m(),r.onBack()},150)};if(c.current){if(i.upArrow||i.downArrow||i.return){m(),i.return?r.onEnter():r.onMove(i.upArrow?-1:1);return}if(h.current+=f,h.current==="["){b();return}let k=h.current;m();let u=/^\[([ABCD])/.exec(k);if(u){(u[1]==="A"||u[1]==="B")&&r.onMove(u[1]==="A"?-1:1);return}r.onBack();return}if(i.upArrow){r.onMove(-1);return}if(i.downArrow){r.onMove(1);return}if(i.return){r.onEnter();return}if(i.escape){h.current="",b();return}return}if(n&&n.isFocused()){let b=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{m(),n.onBack()},150)};if(c.current){if(i.upArrow||i.downArrow||i.return||i.leftArrow||i.rightArrow){m(),i.return?n.onSelect():i.leftArrow?n.onLeft?.():i.rightArrow?n.onRight?.():n.onMove(i.upArrow?-1:1);return}if(h.current+=f,h.current==="["){b();return}let k=h.current;m();let u=/^\[([ABCD])/.exec(k);if(u){u[1]==="A"||u[1]==="B"?n.onMove(u[1]==="A"?-1:1):u[1]==="C"?n.onRight?.():n.onLeft?.();return}n.onBack();return}if(i.upArrow){n.onMove(-1);return}if(i.downArrow){n.onMove(1);return}if(i.leftArrow){n.onLeft?.();return}if(i.rightArrow){n.onRight?.();return}if(i.return){n.onSelect();return}if(i.escape){h.current="",b();return}if(/^[1-9]$/.test(f)){n.onDigit(Number(f));return}if(i.tab){n.onTab?.();return}if(f===" "&&n.isMulti()){n.onSpace();return}if(f&&!i.ctrl&&!i.meta){n.onType(f);return}return}}),null}var o=$(E(),1);function V(e){return e.kind==="REVIEW"?[{v:"approve",label:"approve",detail:"mark it reviewed and trusted"},{v:"archive",label:"archive",detail:"reject it \u2014 asks for a reason; impact shown above"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="PAIR"?[{v:"merge",label:"merge",detail:"duplicate \u2014 fold into the older item (it stays unreviewed)"},{v:"keep_both",label:"keep both",detail:"genuinely distinct \u2014 promote both"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="ARCHIVE"?[{v:"archive",label:"retire",detail:"hidden from now on; history is kept and it can be reverted"},{v:"skip",label:"skip",detail:"keep it \u2014 decided, never re-offered"},{v:"defer",label:"defer",detail:"not now \u2014 the plan re-offers it"}]:e.heldPayload?[{v:"approve",label:"approve update",detail:"commit the held payload \u2014 impact preview above"},{v:"skip",label:"keep current",detail:"drop the held payload (the owner's disk state stays untouched)"},{v:"defer",label:"defer",detail:"not now \u2014 stays held"}]:[{v:"approve",label:"approve",detail:e.kind==="ADD"?"commit + design it":"commit the updated version (old\u2192new redirect)"},{v:"skip",label:e.origin==="content-change"?"reject":"skip",detail:e.origin==="content-change"?"drop the staged proposal \u2014 nothing committed":"leave it as is"},{v:"defer",label:"defer",detail:"not now \u2014 the plan keeps it staged"}]}function F(e){let t=V(e);return e.viewDiff&&t.push({v:"view_diff",label:"view diff",detail:"full old \u2192 new"}),t}function W(e){return e.kind==="ARCHIVE"?null:F(e).length}var q={ADD:{color:l.green??"green"},MODIFY:{color:"yellow"},ARCHIVE:{color:l.red},REVIEW:{color:"cyan"},PAIR:{color:"magenta"}},Q=60;function ce({card:e,position:t,sel:r=0,focused:n=!1,freeText:d=null,editorIntent:c="steer"}){let{stdout:h}=B(),m=h?.columns??80,f=m<Q,i=F(e),b=W(e),k=q[e.kind],u=a=>n&&r===a?(0,o.jsx)(s,{color:l.assuranceAccent,children:"\u276F"}):" ",p=e.impact,A=p&&"stale_refs"in p&&p.stale_refs.length>0?`${e.kind==="ARCHIVE"?"retiring leaves":"approving marks"} ${p.stale_refs.length} item(s) stale`+((p.direct_refs?.length??0)>0?` \u2014 ${p.direct_refs.length} directly touched: ${p.direct_refs.join(", ")}`:""):p&&"design_children"in p?`${e.kind==="REVIEW"?"archiving drops":"merging folds"} ${p.design_children} design child(ren)`:null,S=e.provenance&&e.provenance!==e.why?e.provenance:e.origin??null,C=[{label:"why",text:e.why},...S?[{label:"from",text:S,dimmer:!0}]:[],...e.tier?[{label:"match",text:e.tier,dimmer:!0}]:[],...A?[{label:"impact",text:A}]:[]],_=Math.max(...C.map(a=>a.label.length)),v="? reconcile",R=`item ${t.n} of ${t.of}`,T=(0,o.jsxs)(g,{flexDirection:"column",children:[(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsxs)(s,{bold:!0,children:[(0,o.jsx)(s,{color:k.color,children:`[${e.kind}]`}),` ${L(e.title)}`]})}),C.map((a,x)=>(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsxs)(s,{children:[(0,o.jsx)(s,{color:l.dim,children:`${a.label.padEnd(_)} `}),(0,o.jsx)(s,{color:a.dimmer?l.dim:void 0,children:a.text})]})},`f-${x}`)),e.diffSummary?(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsx)(s,{color:l.dim,children:e.diffSummary})}):(e.diff??[]).map((a,x)=>(0,o.jsx)(g,{paddingLeft:4,children:(0,o.jsx)(s,{color:a.op==="-"?"red":"green",children:`${a.op==="-"?"\u2212":"+"} ${a.field==="criteria"?"criterion":a.field}: ${a.text}`})},`d-${x}`)),(e.citeLines??[]).map((a,x)=>(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsx)(s,{color:l.dim,children:a})},`c-${x}`)),(0,o.jsx)(s,{children:" "}),i.map((a,x)=>(0,o.jsxs)(s,{children:[u(x),` ${x+1}. ${a.label}`,(0,o.jsx)(s,{color:l.dim,children:` \u2014 ${a.detail}`})]},`o-${x}`)),b!==null||d&&c==="because"?d?(0,o.jsxs)(g,{flexDirection:"column",children:[(0,o.jsxs)(g,{children:[(0,o.jsxs)(s,{children:[(0,o.jsx)(s,{color:l.assuranceAccent,children:"\u276F"})," ",(0,o.jsx)(s,{color:l.dim,children:"\u270E "})]}),(0,o.jsx)(D,{value:d.value,onChange:d.onChange,onSubmit:d.onSubmit,onCancel:d.onCancel,placeholder:c==="because"?"why archive it?":"say what to adjust"})]}),(0,o.jsx)(s,{color:l.muted,children:c==="because"?" submits as: archive \xB7 your reason goes on the record":e.kind==="PAIR"?" submits as: defer \xB7 your note parks with the card (it re-offers)":" submits as: approve \xB7 your words steer the re-design"})]}):b!==null?(0,o.jsxs)(s,{children:[u(b)," ",(0,o.jsx)(s,{color:l.dim,children:e.kind==="PAIR"?"\u270E defer with a note \u2014 say what you noticed":"\u270E approve with changes \u2014 say what to adjust"})]}):null:null]});if(f)return(0,o.jsxs)(g,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,o.jsx)(s,{bold:!0,color:l.assuranceAccent,children:v}),(0,o.jsx)(s,{color:l.dim,children:R}),T]});let M=Math.max(2,Math.min(m-1,100)-v.length-R.length);return(0,o.jsxs)(g,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,o.jsxs)(s,{children:[(0,o.jsx)(s,{bold:!0,color:l.assuranceAccent,children:v})," ".repeat(M),(0,o.jsx)(s,{color:l.dim,children:R})]}),(0,o.jsx)(s,{children:" "}),T]})}var Y={"acceptance criteria":1,scenarios:2,"acceptance criteria + exercises":3,"tests + gaps":4};function ue(e,t){let r=[],n=j(e.turns).entries.length;if(t==="design"){let c;for(let m=e.ledger.length-1;m>=0;m--){let f=e.ledger[m];if(f.kind==="banner"&&f.text.startsWith("designing: ")){c=f.text.slice(11);break}}let h=c?Y[c]:void 0;h&&r.push(`phase ${h}/4`),n>0&&r.push(`${n} item${n===1?"":"s"} this session`)}else n>0&&r.push(`${n} saved as draft${n===1?"":"s"}`);let d=e.pending?e.pending.resolution.filter(c=>!c).length:0;return d>0&&r.push(`${d} question${d===1?"":"s"} pending`),e.credits&&r.push(`${e.credits.total.toFixed(1)} credits`),{items:r}}function fe(e,t){let r=[],n=e.applied+e.committed+e.retired;r.push(`${n} applied`),r.push(`${t} to decide`);let d=[];return e.skipped>0&&d.push(`${e.skipped} skipped`),e.deferred>0&&d.push(`${e.deferred} deferred`),e.failed>0&&d.push(`${e.failed} failed`),{items:[...r,...d]}}function he(e,t){let r=["\u2191\u2193 select","\u23CE confirm"];return e.multi_select&&r.push("space toggle"),t.batchCount>1&&r.push("\u2190 \u2192 questions"),(e.allow_free_text||e.options.some(n=>n.input===!0))&&r.push("\u270E type your own"),t.canAttach&&r.push("@ attach a file or URL"),t.escBack&&r.push("esc back"),{keys:r}}function ge(e,t){let r=["\u2191\u2193 select","\u23CE confirm"];return e.some(n=>n.free)&&r.push("\u270E type your own"),t.escBack&&r.push("esc back"),{keys:r}}function be(e){let t=["\u2191\u2193 select","\u23CE confirm","1-9 verdict"];return W(e)!==null&&t.push("type = adjust"),t.push("esc \xB7 nothing to undo"),{keys:t}}export{J as a,Z as b,ne as c,V as d,F as e,W as f,ce as g,ue as h,fe as i,he as j,ge as k,be as l};
|
|
2
|
+
import{d as j}from"./chunk-RKXHVP2Z.js";import{a as L}from"./chunk-RRY5IXOB.js";import{a as O}from"./chunk-5Y2G4NC7.js";import{a as D}from"./chunk-YCCUBQY4.js";import{y as l}from"./chunk-PHR2OSWD.js";import{a as E}from"./chunk-HCBYKLMW.js";import{a as g,b as s,i as I,k as B}from"./chunk-C44QQJR4.js";import{a as P}from"./chunk-6YGTRKDT.js";import{e as $}from"./chunk-UR6MHSHU.js";var H=$(P(),1);var w=$(E(),1),K=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function J(e){let t=e.replace(/…$/,"");return t&&t.charAt(0).toLowerCase()+t.slice(1)}function N(e,t){if(e.length<=t)return e;if(t<=1)return"\u2026";let r=Math.ceil((t-1)/2),n=Math.floor((t-1)/2);return`${e.slice(0,r)}\u2026${n>0?e.slice(-n):""}`}function Z({status:e,meta:t,tallies:r,keys:n,child:d,cols:c}){let{stdout:h}=B(),m=c??h?.columns??80,f=e.kind==="working"||e.kind==="child-working",[i,b]=(0,H.useState)(0);O(()=>b(a=>a+1),f?120:null);let k=K[i%K.length],u,p;switch(e.kind){case"working":u=`${k} ${e.step}${e.elapsedS!==void 0?` \xB7 ${e.elapsedS}s`:""}`,p=l.assuranceAccent;break;case"waiting":u=`\u25CF waiting on you${e.pending?` \u2014 ${e.pending} question${e.pending===1?"":"s"}`:""}`,p=l.amber;break;case"idle":u="\u25CF idle",p=l.assuranceAccent;break;case"card":u=`\u25CF card ${e.n} of ${e.m}`,p=l.amber;break;case"child-working":u=`${k} child: ${e.step}`,p=l.assuranceAccent;break;case"child-waiting":u="\u25CF child waiting on you",p=l.amber;break}let A=d?`${t.verb} \u25B8 ${d.verb}`:t.verb,S=d?.sid?t.sid?`${N(t.sid,14)} \u25B8 ${d.sid}`:d.sid:t.sid,C=t.env==="prod"?"":t.env,_=[A,S,C].filter(Boolean),v=" \xB7 ",R=u.length+v.length+_.join(v).length,T=t.subject;if(T){let a=m-R-v.length;T=a>=8?N(T,a):void 0}let M=[A,...T?[T]:[],S,C].filter(Boolean).join(v);return(0,w.jsxs)(g,{flexDirection:"column",children:[(0,w.jsx)(s,{color:l.muted,children:"\u2500".repeat(Math.max(1,m))}),(0,w.jsxs)(s,{children:[(0,w.jsx)(s,{color:p,children:u}),(0,w.jsx)(s,{color:l.dim,children:`${v}${M}`})]}),(0,w.jsx)(s,{color:l.dim,children:r.items.length>0?r.items.join(v):" "}),(0,w.jsx)(s,{color:l.muted,children:n.join(v)})]})}var y=$(P(),1);function ne({onToggleThinking:e,onCtrlC:t,explorer:r,panel:n}){let c=(0,y.useRef)(null),h=(0,y.useRef)(""),m=()=>{c.current&&clearTimeout(c.current),c.current=null,h.current=""};return(0,y.useEffect)(()=>m,[]),I((f,i)=>{if(i.ctrl&&f==="t"){e();return}if(i.ctrl&&f==="c"){t();return}if(!i.ctrl&&f.includes("")){t();return}if(!i.ctrl&&f.includes("")){e();return}if(r&&r.isOpen()){let b=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{m(),r.onBack()},150)};if(c.current){if(i.upArrow||i.downArrow||i.return){m(),i.return?r.onEnter():r.onMove(i.upArrow?-1:1);return}if(h.current+=f,h.current==="["){b();return}let k=h.current;m();let u=/^\[([ABCD])/.exec(k);if(u){(u[1]==="A"||u[1]==="B")&&r.onMove(u[1]==="A"?-1:1);return}r.onBack();return}if(i.upArrow){r.onMove(-1);return}if(i.downArrow){r.onMove(1);return}if(i.return){r.onEnter();return}if(i.escape){h.current="",b();return}return}if(n&&n.isFocused()){let b=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{m(),n.onBack()},150)};if(c.current){if(i.upArrow||i.downArrow||i.return||i.leftArrow||i.rightArrow){m(),i.return?n.onSelect():i.leftArrow?n.onLeft?.():i.rightArrow?n.onRight?.():n.onMove(i.upArrow?-1:1);return}if(h.current+=f,h.current==="["){b();return}let k=h.current;m();let u=/^\[([ABCD])/.exec(k);if(u){u[1]==="A"||u[1]==="B"?n.onMove(u[1]==="A"?-1:1):u[1]==="C"?n.onRight?.():n.onLeft?.();return}n.onBack();return}if(i.upArrow){n.onMove(-1);return}if(i.downArrow){n.onMove(1);return}if(i.leftArrow){n.onLeft?.();return}if(i.rightArrow){n.onRight?.();return}if(i.return){n.onSelect();return}if(i.escape){h.current="",b();return}if(/^[1-9]$/.test(f)){n.onDigit(Number(f));return}if(i.tab){n.onTab?.();return}if(f===" "&&n.isMulti()){n.onSpace();return}if(f&&!i.ctrl&&!i.meta){n.onType(f);return}return}}),null}var o=$(E(),1);function V(e){return e.kind==="REVIEW"?[{v:"approve",label:"approve",detail:"mark it reviewed and trusted"},{v:"archive",label:"archive",detail:"reject it \u2014 asks for a reason; impact shown above"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="PAIR"?[{v:"merge",label:"merge",detail:"duplicate \u2014 fold into the older item (it stays unreviewed)"},{v:"keep_both",label:"keep both",detail:"genuinely distinct \u2014 promote both"},{v:"defer",label:"defer",detail:"not now \u2014 stays queued"}]:e.kind==="ARCHIVE"?[{v:"archive",label:"retire",detail:"hidden from now on; history is kept and it can be reverted"},{v:"skip",label:"skip",detail:"keep it \u2014 decided, never re-offered"},{v:"defer",label:"defer",detail:"not now \u2014 the plan re-offers it"}]:e.heldPayload?[{v:"approve",label:"approve update",detail:"commit the held payload \u2014 impact preview above"},{v:"skip",label:"keep current",detail:"drop the held payload (the owner's disk state stays untouched)"},{v:"defer",label:"defer",detail:"not now \u2014 stays held"}]:[{v:"approve",label:"approve",detail:e.kind==="ADD"?"commit + design it":"commit the updated version (old\u2192new redirect)"},{v:"skip",label:e.origin==="content-change"?"reject":"skip",detail:e.origin==="content-change"?"drop the staged proposal \u2014 nothing committed":"leave it as is"},{v:"defer",label:"defer",detail:"not now \u2014 the plan keeps it staged"}]}function F(e){let t=V(e);return e.viewDiff&&t.push({v:"view_diff",label:"view diff",detail:"full old \u2192 new"}),t}function W(e){return e.kind==="ARCHIVE"?null:F(e).length}var q={ADD:{color:l.green??"green"},MODIFY:{color:"yellow"},ARCHIVE:{color:l.red},REVIEW:{color:"cyan"},PAIR:{color:"magenta"}},Q=60;function ce({card:e,position:t,sel:r=0,focused:n=!1,freeText:d=null,editorIntent:c="steer"}){let{stdout:h}=B(),m=h?.columns??80,f=m<Q,i=F(e),b=W(e),k=q[e.kind],u=a=>n&&r===a?(0,o.jsx)(s,{color:l.assuranceAccent,children:"\u276F"}):" ",p=e.impact,A=p&&"stale_refs"in p&&p.stale_refs.length>0?`${e.kind==="ARCHIVE"?"retiring leaves":"approving marks"} ${p.stale_refs.length} item(s) stale`+((p.direct_refs?.length??0)>0?` \u2014 ${p.direct_refs.length} directly touched: ${p.direct_refs.join(", ")}`:""):p&&"design_children"in p?`${e.kind==="REVIEW"?"archiving drops":"merging folds"} ${p.design_children} design child(ren)`:null,S=e.provenance&&e.provenance!==e.why?e.provenance:e.origin??null,C=[{label:"why",text:e.why},...S?[{label:"from",text:S,dimmer:!0}]:[],...e.tier?[{label:"match",text:e.tier,dimmer:!0}]:[],...A?[{label:"impact",text:A}]:[]],_=Math.max(...C.map(a=>a.label.length)),v="? reconcile",R=`item ${t.n} of ${t.of}`,T=(0,o.jsxs)(g,{flexDirection:"column",children:[(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsxs)(s,{bold:!0,children:[(0,o.jsx)(s,{color:k.color,children:`[${e.kind}]`}),` ${L(e.title)}`]})}),C.map((a,x)=>(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsxs)(s,{children:[(0,o.jsx)(s,{color:l.dim,children:`${a.label.padEnd(_)} `}),(0,o.jsx)(s,{color:a.dimmer?l.dim:void 0,children:a.text})]})},`f-${x}`)),e.diffSummary?(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsx)(s,{color:l.dim,children:e.diffSummary})}):(e.diff??[]).map((a,x)=>(0,o.jsx)(g,{paddingLeft:4,children:(0,o.jsx)(s,{color:a.op==="-"?"red":"green",children:`${a.op==="-"?"\u2212":"+"} ${a.field==="criteria"?"criterion":a.field}: ${a.text}`})},`d-${x}`)),(e.citeLines??[]).map((a,x)=>(0,o.jsx)(g,{paddingLeft:2,children:(0,o.jsx)(s,{color:l.dim,children:a})},`c-${x}`)),(0,o.jsx)(s,{children:" "}),i.map((a,x)=>(0,o.jsxs)(s,{children:[u(x),` ${x+1}. ${a.label}`,(0,o.jsx)(s,{color:l.dim,children:` \u2014 ${a.detail}`})]},`o-${x}`)),b!==null||d&&c==="because"?d?(0,o.jsxs)(g,{flexDirection:"column",children:[(0,o.jsxs)(g,{children:[(0,o.jsxs)(s,{children:[(0,o.jsx)(s,{color:l.assuranceAccent,children:"\u276F"})," ",(0,o.jsx)(s,{color:l.dim,children:"\u270E "})]}),(0,o.jsx)(D,{value:d.value,onChange:d.onChange,onSubmit:d.onSubmit,onCancel:d.onCancel,placeholder:c==="because"?"why archive it?":"say what to adjust"})]}),(0,o.jsx)(s,{color:l.muted,children:c==="because"?" submits as: archive \xB7 your reason goes on the record":e.kind==="PAIR"?" submits as: defer \xB7 your note parks with the card (it re-offers)":" submits as: approve \xB7 your words steer the re-design"})]}):b!==null?(0,o.jsxs)(s,{children:[u(b)," ",(0,o.jsx)(s,{color:l.dim,children:e.kind==="PAIR"?"\u270E defer with a note \u2014 say what you noticed":"\u270E approve with changes \u2014 say what to adjust"})]}):null:null]});if(f)return(0,o.jsxs)(g,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,o.jsx)(s,{bold:!0,color:l.assuranceAccent,children:v}),(0,o.jsx)(s,{color:l.dim,children:R}),T]});let M=Math.max(2,Math.min(m-1,100)-v.length-R.length);return(0,o.jsxs)(g,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,o.jsxs)(s,{children:[(0,o.jsx)(s,{bold:!0,color:l.assuranceAccent,children:v})," ".repeat(M),(0,o.jsx)(s,{color:l.dim,children:R})]}),(0,o.jsx)(s,{children:" "}),T]})}var Y={"acceptance criteria":1,scenarios:2,"acceptance criteria + exercises":3,"tests + gaps":4};function ue(e,t){let r=[],n=j(e.turns).entries.length;if(t==="design"){let c;for(let m=e.ledger.length-1;m>=0;m--){let f=e.ledger[m];if(f.kind==="banner"&&f.text.startsWith("designing: ")){c=f.text.slice(11);break}}let h=c?Y[c]:void 0;h&&r.push(`phase ${h}/4`),n>0&&r.push(`${n} item${n===1?"":"s"} this session`)}else n>0&&r.push(`${n} saved as draft${n===1?"":"s"}`);let d=e.pending?e.pending.resolution.filter(c=>!c).length:0;return d>0&&r.push(`${d} question${d===1?"":"s"} pending`),e.credits&&r.push(`${e.credits.total.toFixed(1)} credits`),{items:r}}function fe(e,t){let r=[],n=e.applied+e.committed+e.retired;r.push(`${n} applied`),r.push(`${t} to decide`);let d=[];return e.skipped>0&&d.push(`${e.skipped} skipped`),e.deferred>0&&d.push(`${e.deferred} deferred`),e.failed>0&&d.push(`${e.failed} failed`),{items:[...r,...d]}}function he(e,t){let r=["\u2191\u2193 select","\u23CE confirm"];return e.multi_select&&r.push("space toggle"),t.batchCount>1&&r.push("\u2190 \u2192 questions"),(e.allow_free_text||e.options.some(n=>n.input===!0))&&r.push("\u270E type your own"),t.canAttach&&r.push("@ attach a file or URL"),t.escBack&&r.push("esc back"),{keys:r}}function ge(e,t){let r=["\u2191\u2193 select","\u23CE confirm"];return e.some(n=>n.free)&&r.push("\u270E type your own"),t.escBack&&r.push("esc back"),{keys:r}}function be(e){let t=["\u2191\u2193 select","\u23CE confirm","1-9 verdict"];return W(e)!==null&&t.push("type = adjust"),t.push("esc \xB7 nothing to undo"),{keys:t}}export{J as a,Z as b,ne as c,V as d,F as e,W as f,ce as g,ue as h,fe as i,he as j,ge as k,be as l};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{f as d,g as f}from"./chunk-XLSOQLVT.js";var G={high:3,med:2,low:1},R={create:0,evolve:1,"reuse-candidate":2},_=.75;function a(e,n){return!e.superseded.has(n)&&e.trust.get(n)!=="archived"}function E(e,n){return e.edgesInto(n).some(t=>t.type===f.VERIFIES&&a(e,t.src))}function m(e,n="med"){let t=e.risk;return t==="high"||t==="med"||t==="low"?t:n}function u(e,n){return e.displayNameOf(n)??n}function y(e,n){return`kane-cli design tests --use-case ${u(e,n)}`}function b(e,n){let t=e.edgesFrom(n).find(i=>i.type===f.SCOPED_TO&&a(e,i.dst));if(!t)return null;let s=e.nodeLabel.get(t.dst);if(s===d.USECASE)return t.dst;if(s===d.SCENARIO){let i=e.edgesFrom(t.dst).find(r=>r.type===f.BELONGS_TO&&a(e,r.dst));return i?i.dst:null}return null}function v(e,n){let t=b(e,n);return t?y(e,t):w(e,n)}function w(e,n){return`kane-cli design explain ${u(e,n)}`}function h(e,n){let t=e.edgesFrom(n).find(i=>i.type===f.AUTOMATES&&a(e,i.dst));if(!t)return null;let s=e.edgesFrom(t.dst).find(i=>i.type===f.BELONGS_TO&&a(e,i.dst));return s?s.dst:null}function x(e){let n=[];for(let{cid:t,content:s}of e.byLabel(d.AC))a(e,t)&&(E(e,t)||n.push({ref:u(e,t),kind:"no-verifies",why:"no live test verifies this acceptance criterion",risk:m(s),stage:"design",tag:"create",ready_command:v(e,t)}));return n}function S(e){let n=[];for(let{cid:t,content:s}of e.byLabel(d.USECASE)){if(!a(e,t))continue;let i=e.edgesInto(t).filter(o=>o.type===f.BELONGS_TO&&a(e,o.src));if(i.length===0){n.push({ref:u(e,t),kind:"zero-scenario",why:"use-case has no scenarios",risk:m(s),stage:"design",tag:"create",ready_command:y(e,t)});continue}i.every(o=>e.getNode(o.src)?.content.case_type==="happy")&&n.push({ref:u(e,t),kind:"happy-only",why:"use-case is exercised by happy-path scenarios only",risk:m(s),stage:"design",tag:"create",ready_command:y(e,t)})}return n}function L(e){let n=[];for(let{cid:t,content:s}of e.byLabel(d.GAP)){if(!a(e,t))continue;let i=s.ref,r=typeof i=="string"?e.resolve(i):null,o=r&&a(e,r.tip)?r.tip:null,l=o?e.nodeLabel.get(o):null,p=s.kind==="reconcile_deferred"?"kane-cli maintain reconcile":l===d.USECASE?y(e,o):l===d.AC?v(e,o):w(e,t),c=s.question&&typeof s.question=="object"?s.question:void 0,g=typeof s.text=="string"&&s.text||(c&&typeof c.header=="string"?c.header:"")||"design gap";n.push({ref:u(e,t),kind:String(s.kind),why:g,risk:m(s),stage:"design",tag:"create",ready_command:p,...typeof s.risk_rationale=="string"?{risk_rationale:s.risk_rationale}:{},...c?{question:c}:{}})}return n}function C(e){let n=[];for(let{cid:t,content:s}of e.byLabel(d.AC)){if(!a(e,t))continue;let i=e.stale(t);i==="fresh"||i==="superseded"||n.push({ref:u(e,t),kind:"stale-ac",why:`acceptance criterion is ${i} \u2014 its source moved since this was authored \xB7 why: kane-cli design explain ${u(e,t)}`,risk:m(s),stage:"design",tag:"evolve",ready_command:"kane-cli maintain reconcile"})}for(let{cid:t,content:s}of e.byLabel(d.TEST)){if(!a(e,t))continue;let i=e.stale(t);if(i==="fresh"||i==="superseded")continue;let r=e.edgesFrom(t).filter(k=>k.type===f.VERIFIES&&a(e,k.dst)),o=r.map(k=>m(e.getNode(k.dst)?.content??{})),l=o.includes("high")?"high":o.includes("med")?"med":o.includes("low")?"low":"med",p=r[0]?.dst??null,c=p?null:h(e,t),g=p?v(e,p):c?y(e,c):w(e,t);n.push({ref:u(e,t),kind:"stale-test",why:`test is ${i} \u2014 its source moved since this was authored`,risk:l,stage:"design",tag:"evolve",ready_command:g})}return n}async function O(e,n,t){for(let s of e)if(s.tag==="create"){if(!t){s.meta={embed_arm:"skipped"};continue}try{let i=n.resolve(s.ref),r=i?n.getNode(i.tip):null,o=r&&(String(r.content.title??"")||String(r.content.text??""))||s.why,l=r?.label===d.USECASE?"scenario":"test",c=(await t.searchSimilar(o,{label:l,k:1}))[0];c&&c.score>=_?(s.tag="reuse-candidate",s.meta={embed_arm:"used",near_hit:{ref:u(n,c.cid),score:c.score}}):s.meta={embed_arm:"used",near_hit:null}}catch{s.meta={embed_arm:"skipped"}}}}function A(e,n){let t=G[n.risk]-G[e.risk];if(t!==0)return t;let s=R[e.tag]-R[n.tag];return s!==0?s:e.ref<n.ref?-1:e.ref>n.ref?1:0}function T(e,n){let t=[],s=r=>{let o=e.resolve(r);return o&&!o.superseded?m(e.getNode(o.tip)?.content??{}):"med"},i=r=>{let o=e.resolve(r),l=o&&!o.superseded?b(e,o.tip):null;return l?u(e,l):r};for(let r of n.usecases??[])for(let o of r.acceptance_criteria??[])(o.covered_by??[]).length>0&&(o.execution==="failed"?t.push({ref:o.id,kind:"execution-failed",stage:"cover",tag:"evolve",risk:s(o.id),why:`covering test failed against this AC (tests: ${(o.covered_by??[]).join(", ")})`,ready_command:`kane-cli maintain evolve ${i(o.id)}`}):o.execution==="blocked"?t.push({ref:o.id,kind:"execution-blocked",stage:"cover",tag:"reuse-candidate",risk:s(o.id),why:"the oracle could not run (infrastructure) \u2014 the covering test exists and is reusable",ready_command:"kane-cli testrun run"}):o.execution==="not-run"&&t.push({ref:o.id,kind:"covered-not-run",stage:"cover",tag:"reuse-candidate",risk:s(o.id),why:"a covering test exists but never joined this pack \u2014 run it",ready_command:"kane-cli testrun run"}));return t}async function N(e,n,t,s){if(n!=="design"&&!s)throw new Error(`gaps-engine: stage "${n}" requires a pack's usecases doc`);let i=[];return(n==="design"||n==="all")&&i.push(...x(e),...S(e),...L(e),...C(e)),(n==="cover"||n==="all")&&i.push(...T(e,s)),await O(i,e,t),i.sort(A),i}export{a,E as b,b as c,N as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as m,d as p,e as g}from"./chunk-
|
|
2
|
+
import{c as m,d as p,e as g}from"./chunk-KWANVHJX.js";import{b as d}from"./chunk-PHR2OSWD.js";import{mkdirSync as h,writeFileSync as o,existsSync as u,readFileSync as M}from"fs";import{join as a}from"path";var E={name:"remote-execution",version:"0.5.0",backendId:"hyper",kaneCompat:">=0.4.0",defaults:{runson:"mac",concurrency:1}},f={runson:"mac",concurrency:1,timeoutMinutes:120,mobile:{runson:"mac26",deviceName:"Galaxy A53 5G",osVersion:"15",queueTimeout:300,appiumPort:4739,androidHome:"$HOME/android-sdk-shim",globalTimeout:90,testSuiteTimeout:90,testSuiteStep:45,ios:{deviceName:"iPhone 15",osVersion:"17.5",runson:{}}}},v=`version: "0.1"
|
|
3
3
|
runson: {{runson}}
|
|
4
4
|
autosplit: true
|
|
5
5
|
concurrency: {{concurrency}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as b}from"./chunk-BZAGVBCX.js";import{
|
|
2
|
+
import{d as b}from"./chunk-BZAGVBCX.js";import{y as S}from"./chunk-IICT4VOU.js";import{M as N,c as k,m as w}from"./chunk-RDHWNSDP.js";import{f as _,h as $}from"./chunk-XLSOQLVT.js";var j=3,F={edit:"edit",reject:"mistake",dedup_dropped:"mistake",approve:"usage",enhance:"directed-edit",add:"directed-edit",default_accepted:"usage",default_overridden:"edit",gap_resolution:"usage",dedup_kept:"usage"};function z(m){let{contextDir:u,graph:o,watermark:v,by:f}=m,{signals:E}=b(u,v),D=E.filter(e=>e.event_id===void 0||o.appliedEvents.has(e.event_id)),s=new Map;for(let e of D){let t=e.event_id??`${e.ts}|${e.id}|${e.verdict}|${e.polarity}`;s.has(`${t}|${e.polarity}|${e.verdict}`)||s.set(`${t}|${e.polarity}|${e.verdict}`,e)}let R=[...s.values()].sort((e,t)=>(e.event_id??e.ts)<(t.event_id??t.ts)?-1:1),i=new Map;for(let e of R){let t=`${e.verdict}|${e.tag??""}`,r=i.get(t)??{verdict:e.verdict,tag:e.tag,events:new Set};r.events.add(e.event_id??e.ts),i.set(t,r)}let d=[],a=[],g=new Set,c=[],y=0;for(let[,e]of[...i.entries()].sort(([t],[r])=>t<r?-1:1)){if(e.events.size<j)continue;let r={derived:!0,statement:`${e.verdict}${e.tag?`/${e.tag}`:""} recurs (${e.events.size} distinct events) \u2014 bias future proposals ${e.verdict==="approve"?"toward":"away from"} this pattern`,learned_from_kind:F[e.verdict]??"usage",learned_from:[...e.events].sort()},h=$("stylenote",r);if(h.length>0)return{record:null,errors:h.map(n=>({code:n.code,detail:n.detail})),minted:0};let p=k("stylenote",r);if(o.hasNode(p))continue;d.push({cid:p,label:_.STYLENOTE,content:r});for(let n of r.learned_from)c.includes(n)||c.push(n);let l=S("stylenote",n=>g.has(n),o.names.keys());l!==null&&(g.add(l),a.push({cid:p,slug:l,by:f})),y+=1}return d.length===0?{record:null,errors:null,minted:0}:{record:N(u,{ts:new Date().toISOString(),proposal_id:null,nodes:d,edges:[],review:[],supersessions:[],source_head_moves:{},...a.length>0?{names:a}:{}},{expectPrev:o.latestHash,intent:{v:1,verb:"distill",args:w({watermark:v,by:f}),pins:{events:c}},provenance:m.provenance}).record,errors:null,minted:y}}export{z as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
var l="assurance/context@1";var u={source:{hashed:["blob","source_id"],required:["blob","source_id"],enums:{}},usecase:{hashed:["actors","criteria","derived","description","risk","summary","title","value"],required:["derived","risk","title"],enums:{risk:["high","med","low"]}},scenario:{hashed:["case_type","derived","description","intent","parameters","tags","technique_notes","title"],required:["case_type","derived","intent","title"],enums:{case_type:["happy","negative","boundary","edge","security","a11y","perf","i18n"]}},ac:{hashed:["derived","expected_answer","kind","measurable","risk","text"],required:["derived","risk","text"],enums:{risk:["high","med","low"],kind:["presence","forbidden-presence","count","delta","state-transition","absolute","bound","propagation","latency","graded"]}},test:{hashed:["app","check","config","definitionId","derived","objectives_blob","surface_required","target","test_md_blob","title"],required:["definitionId","derived","title"],enums:{}},gap:{hashed:["basis","derived","kind","question","ref","risk","risk_rationale","text","uc"],unhashed:["proposal_id","temp_ref"],required:["derived","kind"],enums:{kind:["ambiguous","incomplete","contradictory","unmeasurable","missing-expected-result","budget-evicted","invariant-unexercised","reconcile_deferred"],risk:["high","med","low"]}},stylenote:{hashed:["derived","learned_from_kind","statement","tags","text"],unhashed:["learned_from"],required:["derived","learned_from_kind","statement"],enums:{learned_from_kind:["edit","directed-edit","mistake","usage"]}}},f={DERIVES:{src:["source"],dst:["usecase","ac","scenario","test"],salient:["anchor","source_cid","source_id"],optionalSalient:["claim"],props:["anchor","claim","quote","source_cid","source_id"],pin:{comparesTo:"source_head"},cardinality:"many",acyclic:!1},belongs_to:{src:["scenario"],dst:["usecase"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"one-live-per-src",acyclic:!1},scoped_to:{src:["ac"],dst:["scenario","usecase"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"one-live-per-src",acyclic:!1},exercises:{src:["scenario"],dst:["ac"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"many",acyclic:!1},verifies:{src:["test"],dst:["ac"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"many",acyclic:!1},automates:{src:["test"],dst:["scenario"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"one-live-per-src-and-dst",acyclic:!1},depends_on:{src:["usecase","scenario"],dst:["usecase","scenario"],salient:[],props:["reason"],pin:{comparesTo:"dst_tip"},cardinality:"many",acyclic:!0},reuses:{src:["test"],dst:["test"],salient:[],props:[],pin:{comparesTo:"dst_tip"},cardinality:"many",acyclic:!0},annotates:{src:["gap","stylenote"],dst:["source","usecase","scenario","ac","test"],salient:[],props:["reason"],pin:{comparesTo:"dst_tip"},cardinality:"many",acyclic:!1}},g=["presence","forbidden-presence","count","delta","state-transition","absolute","bound","propagation","latency","graded"];var E={presence:{operators:["exists","forall"],baseline:"null",requires:[]},"forbidden-presence":{operators:["exists","forall"],baseline:"null",requires:[]},count:{operators:["equals","gte","lte"],baseline:"null",requires:[],operand_forms:["literal","derived"]},delta:{operators:["changed-by"],baseline:"required",requires:[]},"state-transition":{operators:["changed-by","equals"],baseline:"required",requires:[]},absolute:{operators:["equals","contains","gte","lte"],baseline:"null",requires:[]},bound:{operators:["gte","lte"],baseline:"null",requires:[]},propagation:{operators:["exists","equals"],baseline:"null",requires:[]},latency:{operators:["lte"],baseline:"null",requires:["within"]},graded:{operators:["gte"],baseline:"null",requires:["metric","threshold"]}};function y(s){let n=/^design@(\d+)$/.exec(s??"");return n?Number(n[1]):0}var h=new Set(["unmeasurable","budget-evicted"]),m=Object.freeze({SOURCE:"source",USECASE:"usecase",SCENARIO:"scenario",AC:"ac",TEST:"test",GAP:"gap",STYLENOTE:"stylenote"}),S=Object.freeze({DERIVES:"DERIVES",BELONGS_TO:"belongs_to",SCOPED_TO:"scoped_to",EXERCISES:"exercises",VERIFIES:"verifies",AUTOMATES:"automates",DEPENDS_ON:"depends_on",REUSES:"reuses",ANNOTATES:"annotates"});function c(s,n,t){let r=[],e=E[s];if(!e)return r.push({code:"BAD_CHECK",detail:`${t}.kind ${JSON.stringify(s)} not in ${g.join("|")}`}),r;let o=n.operator;o!==void 0&&!e.operators.includes(o)&&r.push({code:"BAD_CHECK",detail:`${t}: operator ${JSON.stringify(o)} illegal for kind "${String(s)}" (legal: ${e.operators.join("|")})`});for(let a of e.requires)(n[a]===void 0||n[a]===null||n[a]==="")&&r.push({code:"BAD_CHECK",detail:`${t}: kind "${String(s)}" requires "${a}"`});e.baseline==="null"&&n.baseline!==void 0&&n.baseline!==null&&r.push({code:"BAD_CHECK",detail:`${t}: kind "${String(s)}" must carry baseline null (only delta/state-transition have one)`});let i=n.operand;if(i!==null&&typeof i=="object"&&!Array.isArray(i)){let a=Object.keys(i),d=i.derived;(!(e.operand_forms?.includes("derived")??!1)||a.length!==1||a[0]!=="derived"||typeof d!="string"||!d.trim())&&r.push({code:"BAD_CHECK",detail:`${t}: object operand is only the count derivation form {derived: "<how the runtime value is computed>"}`})}return r}function k(s,n){let t=u[s];if(!t)return[{code:"UNKNOWN_LABEL",detail:`unknown node label ${JSON.stringify(s)}`}];let r=[];for(let e of Object.keys(n))n[e]!==void 0&&!t.hashed.includes(e)&&!(t.unhashed??[]).includes(e)&&r.push({code:"UNKNOWN_FIELD",detail:`${s}.${e} is not in the ${l} schema`});for(let e of t.required)(n[e]===void 0||n[e]===null)&&r.push({code:"MISSING_FIELD",detail:`${s}.${e} is required`});for(let[e,o]of Object.entries(t.enums)){let i=n[e];i!==void 0&&!o.includes(i)&&r.push({code:"BAD_ENUM",detail:`${s}.${e} ${JSON.stringify(i)} not in ${o.join("|")}`})}if(s==="test"&&n.check&&typeof n.check=="object"){let e=n.check;r.push(...c(e.kind,e,"test.check"))}if(s==="ac"&&n.expected_answer&&typeof n.expected_answer=="object"){let e=n.expected_answer;r.push(...c(n.kind??e.kind,e,"ac.expected_answer"))}return r}function p(s){return f[s]}function N(s,n,t,r){let e=p(s);if(!e)return[{code:"UNKNOWN_EDGE_TYPE",detail:`unknown edge type ${JSON.stringify(s)}`}];let o=[];e.src.includes(n)||o.push({code:"ILLEGAL_EDGE",detail:`${s} src must be ${e.src.join("|")}, got ${n}`}),e.dst.includes(t)||o.push({code:"ILLEGAL_EDGE",detail:`${s} dst must be ${e.dst.join("|")}, got ${t}`}),s==="depends_on"&&n!==t&&o.push({code:"ILLEGAL_EDGE",detail:`depends_on links same-label nodes only, got ${n}\u2192${t}`});for(let i of e.salient)(r[i]===void 0||r[i]===null)&&o.push({code:"MISSING_SALIENT",detail:`${s}.props.${i} is salient (inside the ecid) and required`});for(let i of Object.keys(r))r[i]!==void 0&&(e.props.includes(i)||o.push({code:"UNKNOWN_EDGE_PROP",detail:`${s}.props.${i} is not in the ${l} schema`}));return o}function b(s,n){let t=u[s];if(!t)return n;let r={};for(let e of t.hashed)n[e]!==void 0&&(r[e]=n[e]);return r}function O(s,n){let t=p(s);if(!t)return n;let r={};for(let e of t.salient)n[e]!==void 0&&(r[e]=n[e]);for(let e of t.optionalSalient??[])n[e]!==void 0&&(r[e]=n[e]);return r}export{l as a,u as b,f as c,y as d,h as e,m as f,S as g,k as h,p as i,N as j,b as k,O as l};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as S}from"./chunk-I7TIGB7K.js";import{a as x,b as P,c as C,d as V,e as j}from"./chunk-SDJNWR4D.js";import{a as R,b as D}from"./chunk-KDNNMU7Q.js";import{o as f,p as k,z as y}from"./chunk-IICT4VOU.js";import{e as b}from"./chunk-3UI5VTQS.js";import{f as w}from"./chunk-FQNQVC5O.js";function I(o,t){return{contextDir:o,rootSid:t,locks:w(o,t),probe:S(o,{resolveAlias:i=>P(i),embed:(i,s)=>C(i,s),readVector:(i,s)=>V(o,i,s),writeVector:(i,s,n)=>j(o,i,s,n)})}}var N=new Set(["archive"]);async function Y(o,t,i,s){let n=y(o.contextDir);if(i.v==="defer")return{outcome:"deferred"};if(t.kind==="MODIFY_HELD"){if(!t.heldPayload)return{outcome:"failed",detail:`${t.ref} carries no held payload`};let e=t.heldPayload;if(i.v==="keep_current"){if(!e.event_id)return{outcome:"failed",detail:`this held row has no durable event id \u2014 resume the owner to drop it: kane-cli context extract --resume ${e.sid}`};let{commitChatTurn:r}=await import("./chat-committer-6D7AQI6Z.js"),u=r({contextDir:o.contextDir,graph:n,ops:[{kind:"resolve_question",questionId:`drop-held:${e.sid}:${e.tempRef}`,resolution:"deferred",eventId:e.event_id}],by:s});return u.errors?{outcome:"failed",detail:u.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"held-dropped"}),{outcome:"committed",detail:"held payload dropped (recorded) \u2014 the owner's resume will not re-present it"})}if(i.v==="approve"){let r=e.content._held??null;if(!r?.source_id||!r.source_cid||!r.anchor||!r.quote)return{outcome:"failed",detail:`this held row carries no committable provenance \u2014 resume the owner to apply it: kane-cli context extract --resume ${e.sid}`};{let a=n.mediaOf(r.source_cid),m=R(o.contextDir,n,r.source_cid),g=a.format==="image"?null:m?D(m):null;if(a.format!=="image"&&g===null)return{outcome:"failed",detail:`the pinned source ${r.source_id} (${r.source_cid.slice(0,19)}) has no citable text to verify this held row against \u2014 resume the owner: kane-cli context extract --resume ${e.sid}`};let _=b(a,{anchor:r.anchor,quote:r.quote},g);if(_.length>0)return{outcome:"failed",detail:`held provenance does not verify against the pinned source (${_.map($=>`${$.code}: ${$.detail}`).join("; ")}) \u2014 resume the owner: kane-cli context extract --resume ${e.sid}`}}let{commitProposal:u}=await import("./committer-2QPBANRD.js"),{_held:d,...c}=e.content,q={version:1,read_basis:n.latestHash,source:{source_id:r.source_id,source_cid:r.source_cid},use_cases:[{temp_ref:e.tempRef,title:String(c.title??e.tempRef),...c.summary!==void 0?{summary:c.summary}:{},risk:String(c.risk??"med"),cite:{anchor:r.anchor,quote:r.quote},depends_on_hint:[],matches_existing:null}]},l=await x(I(o.contextDir,o.rootSid??`review-${process.pid}`),{verb:"maintain",ucTargets:[],newBuCandidates:[{tempRef:e.tempRef,title:String(c.title??e.tempRef),probeText:`${String(c.title??"")} ${String(c.summary??"")}`.trim()}],sourcePins:[{source_id:r.source_id,source_cid:r.source_cid}],readBasis:n.latestHash,...e.event_id?{eventIds:[e.event_id]}:{}},a=>{let m=u({contextDir:o.contextDir,graph:a.graph,proposal:q,proposalId:null,verdicts:new Map([[e.tempRef,{resolution:"skipped"}]]),by:s,autoName:!0,allowStaleBasis:!0,eventIds:e.event_id?[e.event_id]:a.eventIds("maintain",1),sid:a.sid,probeHits:a.probeHits});return m.errors!==null?{errors:m.errors}:{result:m,record:m.record}}),h=l.ok&&"result"in l?l.result:{record:null,errors:l.ok?null:l.kind==="validation"?l.errors:[{code:l.kind==="contended"?l.err.code:"UNSETTLED",detail:l.kind==="contended"?`held by ${l.err.holder?.owner_sid??"another session"}`:"concurrent activity kept moving the store"}]};return h.errors?{outcome:"failed",detail:h.errors.map(a=>`${a.code}: ${a.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"held-applied"}),{outcome:"committed",detail:`held payload committed (derived) by ${s.id}`})}return{outcome:"failed",detail:`verdict ${i.v} does not apply to a MODIFY_HELD card`}}let v=n.resolve(t.ref);if(!v)return{outcome:"failed",detail:`${t.ref} names nothing in the graph`};let p=n.tipOf(v.cid);if(i.v==="archive"){if(!i.because||!i.because.trim())return{outcome:"failed",detail:"archive requires --because (a reason the record keeps)"};let e=f({contextDir:o.contextDir,graph:n,verdicts:new Map([[p,{resolution:"rejected",reason:i.because}]]),by:s});return e.errors?{outcome:"failed",detail:e.errors.map(r=>`${r.code}: ${r.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"archived",reason:i.because}),{outcome:"retired"})}if(i.v==="approve"){let e=f({contextDir:o.contextDir,graph:n,verdicts:new Map([[p,{resolution:"approved"}]]),by:s});return e.errors?{outcome:"failed",detail:e.errors.map(r=>`${r.code}: ${r.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"approved"}),{outcome:"applied"})}if(i.v==="merge"||i.v==="keep_both"){if(t.kind!=="PAIR"||!t.pair)return{outcome:"failed",detail:`${t.ref} is not a PAIR card`};let e=n.resolve(t.pair.candidate_cid);if(!e)return{outcome:"failed",detail:`pair candidate ${t.pair.candidate_ref} names nothing`};let r=n.tipOf(e.cid);if(i.v==="merge"){let d=k({contextDir:o.contextDir,graph:n,survivor:r,merged:p,reason:`pair merge: duplicate of ${t.pair.candidate_ref} (score ${t.pair.score})`,by:s});return d.errors?{outcome:"failed",detail:d.errors.map(c=>`${c.code}: ${c.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"pair-merged",reason:t.pair.candidate_ref}),{outcome:"committed",detail:`merged into ${t.pair.candidate_ref} \u2014 survivor stays derived`})}let u=f({contextDir:o.contextDir,graph:n,verdicts:new Map([[p,{resolution:"approved"}],[r,{resolution:"approved"}]]),by:s});return u.errors?{outcome:"failed",detail:u.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"pair-kept-both",reason:t.pair.candidate_ref}),{outcome:"applied",detail:"both promoted as distinct"})}return{outcome:"failed",detail:`verdict ${i.v} does not apply to a ${t.kind} card`}}export{I as a,N as b,Y as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as l}from"./chunk-RZ4F3BHX.js";var a=class{config;buffer=[];stepBuffer=new Map;flushTimer=null;currentRunIndex=null;stopped=!1;_inFlightFlush=null;_stoppingFast=!1;_droppedBatches=0;_droppedEntries=0;constructor(t){this.config=t}start(){if(this.flushTimer)return;let t=this.config.flushIntervalMs??5e3;this.flushTimer=setInterval(()=>{this.flush().catch(()=>{})},t),this.flushTimer.unref&&this.flushTimer.unref()}setRunIndex(t){this.currentRunIndex=t}log(t,e,r,s={}){if(this.stopped)return;let i=this.buildEntry(t,e,r,s);this.buffer.push(i)}logStep(t,e,r,s={}){if(this.stopped)return;let i=this.buildEntry("debug",e,r,s);i.run_index=t,this.stepBuffer.has(t)||this.stepBuffer.set(t,[]),this.stepBuffer.get(t).push(i)}escalate(t){let e=this.stepBuffer.get(t);e&&e.length>0&&this.buffer.push(...e),this.stepBuffer.delete(t)}discardSteps(t){this.stepBuffer.delete(t)}async flush(){if(this.buffer.length===0)return;let t=this._flushBody();this._inFlightFlush=t;try{await t}finally{this._inFlightFlush===t&&(this._inFlightFlush=null)}}async _flushBody(){let t=this.buffer.splice(0),e=null;try{e=await this.config.getToken()}catch{this.buffer.unshift(...t);return}let r={"Content-Type":"application/json"};e&&(r.Authorization=`Bearer ${e}`);let s=JSON.stringify(t);for(let i=0;i<3;i++){try{let n=new AbortController,o=setTimeout(()=>n.abort(),1e4),u=await l(this.config.proxyUrl,{method:"POST",headers:r,body:s,signal:n.signal});if(clearTimeout(o),u.ok)return}catch{}if(this._stoppingFast){this.buffer.unshift(...t);return}i<2&&await new Promise(n=>setTimeout(n,1e3*Math.pow(2,i)))}this._droppedBatches++,this._droppedEntries+=t.length}async flushOnce(t){if(this.buffer.length===0)return"empty";let e=this.buffer.splice(0),r=Date.now()+t,s=!1,i,n=null;try{n=await Promise.race([this.config.getToken(),new Promise(h=>{i=setTimeout(()=>{s=!0,h(null)},t),i.unref&&i.unref()})])}catch{n=null}finally{i&&clearTimeout(i)}let o=r-Date.now();if(s||o<=0)return this.buffer.unshift(...e),"timeout";let u={"Content-Type":"application/json"};n&&(u.Authorization=`Bearer ${n}`);try{let h=new AbortController,f=setTimeout(()=>h.abort(),o);f.unref&&f.unref();let p=await l(this.config.proxyUrl,{method:"POST",headers:u,body:JSON.stringify(e),signal:h.signal});return clearTimeout(f),p.ok?"sent":(this.buffer.unshift(...e),"failed")}catch{return this.buffer.unshift(...e),Date.now()>=r?"timeout":"failed"}}async stopAndFlushOnce(t){let e=Date.now()+t;this._stoppingFast=!0,this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null);let r=this._inFlightFlush;if(r){let i;await Promise.race([r.catch(()=>{}),new Promise(n=>{i=setTimeout(n,t),i.unref&&i.unref()})]),i&&clearTimeout(i)}if(this.buffer.length===0)return"empty";let s=e-Date.now();if(s<=0)return"timeout";try{return await this.flushOnce(s)}catch{return"failed"}}drainBuffer(){return this.buffer.splice(0)}get droppedBatches(){return this._droppedBatches}get droppedEntries(){return this._droppedEntries}async shutdown(){this._droppedBatches>0&&this.log("warn","LOG_DROPS",`Dropped ${this._droppedEntries} entries in ${this._droppedBatches} batches`,{dropped_batches:this._droppedBatches,dropped_entries:this._droppedEntries}),this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),await this.flush()}shutdownSync(){this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null)}get bufferSize(){return this.buffer.length}stepBufferSize(t){return this.stepBuffer.get(t)?.length??0}buildEntry(t,e,r,s){return{hostname:"kane-cli",service:"kane-cli",ddsource:"kane-cli",ddtags:`version:${this.config.device.cli_version}`,level:t,event:e,message:r,session_id:this.config.sessionId,run_index:e.startsWith("tcg_")?null:this.currentRunIndex,identity:this.config.identity,device:this.config.device,context:s,timestamp:new Date().toISOString()}}};export{a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{j as S,k as v}from"./chunk-
|
|
2
|
+
import{j as S,k as v}from"./chunk-75SSVUGS.js";import{d as c,i as m}from"./chunk-Z7S3IWUX.js";import{a as h,c as _,e as f}from"./chunk-EYOCNMUM.js";var y=["desktop","emulator","simulator"];function T(n,t){return n.kind==="app_id"?!0:t==="emulator"?n.kind==="apk":n.kind==="zip"}function $(n){let t=n.deviceName,e=n.osVersion;return t!==void 0&&t.trim()===""||e!==void 0&&e.trim()===""?{ok:!1,message:"--device-name and --os-version cannot be empty."}:{ok:!0,...t!==void 0?{name:t.trim()}:{},...e!==void 0?{osVersion:e.trim()}:{}}}function R(n){return`--device-name needs an OS version \u2014 a bare name matches every runtime that ships it.
|
|
3
3
|
Provide one: ${n}`}function k(n,t,e){let r=v(n);return r?T(r,t)?null:t==="emulator"?`${e} cannot run on an emulator (needs an .apk, or an APP\u2026 id).`:`${e} cannot run on a simulator (needs a .zip of the .app bundle, or an APP\u2026 id).`:`${n}: ${S}`}function I(n){return y.includes(n)?n:null}function V(n){return`--target must be one of desktop, emulator, simulator (got "${n}")`}function x(n){let t=[];for(let[e,r]of[["--device-name",n.deviceName],["--os-version",n.osVersion],["--app",n.app]])r!==void 0&&t.push(`ignored ${e} ${r}: session target is desktop \u2014 set --target emulator|simulator to run on a device`);return t}function F(n){let{flags:t,saved:e}=n,r=[],s;if(t.target!==void 0){let i=I(t.target);if(!i)return{kind:"invalid",message:V(t.target)};s=i}else{let i=h(e?.tui_target,e?.default_target?.kind);if(i.kind==="choose-mobile")return{kind:"choose-mobile-kind"};s=i.kind==="unset"?"desktop":i.kind}if(s==="desktop")return r.push(...x(t)),{kind:"web",warnings:r};if(!n.host.supported)return{kind:"invalid",message:n.host.reason??"this machine cannot run mobile targets."};let a=[],d,u,o=$(t);if(!o.ok)return{kind:"invalid",message:o.message};let l=e?.default_target&&e.default_target.kind===s?c(e.default_target):void 0;if(o.name!==void 0||o.osVersion!==void 0){let i=o.name??l?.name,p=o.osVersion??l?.osVersion;if(p===void 0)return{kind:"invalid",message:R("--os-version <version>, or save one (kane-cli config set-os-version)")};u={...i!==void 0?{name:i}:{},osVersion:p},d={value:i?`${i} (${p})`:`any device on ${p}`,source:"flag"}}else if(e?.default_target&&e.default_target.kind===s&&(c(e.default_target)!==void 0||e.default_target.id!==void 0))d={value:m(e.default_target)??"(saved device)",source:"saved"};else{if(e?.default_target&&e.default_target.kind!==s&&(c(e.default_target)!==void 0||e.default_target.id!==void 0))return{kind:"invalid",message:`Your saved device '${m(e.default_target)}' is ${e.default_target.kind==="simulator"?"a simulator":"an emulator"}, but this run targets ${s==="simulator"?"a simulator":"an emulator"}. Pass --device-name and --os-version, or update your config (set-target, set-device-name, set-os-version).`};a.push("device")}let g;if(t.app!==void 0){let i=k(t.app,s,`--app ${t.app}`);if(i)return{kind:"invalid",message:i};g={value:t.app,source:"flag"}}else{let i=e?.default_app,p=i?v(i):null;p&&T(p,s)&&e?.default_target?.kind===s?g={value:i,source:"saved"}:a.push("app")}return{kind:"mobile",target:s,...u?{deviceSelector:u}:{},...d?{device:d}:{},...g?{app:g}:{},missing:a,warnings:r}}function M(n){let{flags:t,file:e}=n,r=[],s=e.target==="emulator"||e.target==="simulator"?e.target:void 0,a;if(t.target!==void 0){let i=I(t.target);if(!i)return{kind:"invalid",message:V(t.target)};a=i,s&&s!==a&&r.push(`--target ${a} overrides the file's \`target: ${s}\` \u2014 steps recorded on ${s==="emulator"?"an emulator":"a simulator"} may not replay here`)}else a=s??"desktop";if(a==="desktop")return r.push(...x(t)),{kind:"web",warnings:r};let d=$(t);if(!d.ok)return{kind:"invalid",message:d.message};let u=d.name??(e.device_name?.trim()||void 0),o=d.osVersion??(e.os_version?.trim()||void 0);if(u!==void 0&&o===void 0)return{kind:"invalid",message:R("--os-version <version>, or os_version: in the test file")};let l=o!==void 0?{...u!==void 0?{name:u}:{},osVersion:o}:void 0;if(a==="simulator"&&l&&l.name===void 0&&r.push(`the file names no device_name \u2014 any simulator on ${o} may be used. Add device_name: to the file (or pass --device-name) to pin the device.`),t.app!==void 0){let i=k(t.app,a,`--app ${t.app}`);if(i)return{kind:"invalid",message:i}}else if(e.app){let i=k(e.app,a,`the file's app: ${e.app}`);if(i)return{kind:"invalid",message:i}}let g=t.app??(e.app||void 0);return{kind:"mobile",target:a,platform:_(a)??"",...g?{app:g}:{},...l?{deviceSelector:l}:{},...e.no_reset!==void 0?{noReset:e.no_reset}:{},warnings:r}}function D(n){return n.target==="desktop"?"Running on: Desktop \xB7 Chrome":`Running on: ${f(n.target)} \xB7 ${n.deviceLabel} \xB7 ${n.appLabel}`}var b={emulator:"</path/to/app.apk | AppId>",simulator:"</path/to/app.zip | AppId>"};function E(n,t){let e=f(n).toLowerCase();return t==="device"?[`session target is "${e}" but no device is set.`,` See devices: kane-cli devices list --target ${n}`,' Set one: kane-cli config set-device-name "<name>" && kane-cli config set-os-version "<version>"',' Or per-run: --device-name "<name>" --os-version "<version>"'].join(`
|
|
4
4
|
`):[`session target is "${e}" but no app is set.`,` Set one: kane-cli config set-app ${b[n]}`,` Or per-run: --app ${b[n]}`].join(`
|
|
5
5
|
`)}function K(n){return[`saved device "${n}" was not found on this machine.`," See devices: kane-cli devices list",' Set one: kane-cli config set-device-name "<name>" && kane-cli config set-os-version "<version>"'].join(`
|