@testmuai/kane-cli 0.8.13 → 0.8.15
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-B6ZIO3JL.js → ChatSurface-2GPR4S7I.js} +3 -3
- package/dist/{ChromeProfilePicker-QSICCUMV.js → ChromeProfilePicker-XAZGCJKR.js} +1 -1
- package/dist/{CliFeedbackPrompt-LLLNSKW2.js → CliFeedbackPrompt-4SILDU7S.js} +1 -1
- package/dist/{CliUploadProgress-N5IY66T2.js → CliUploadProgress-OAQBY55Y.js} +1 -1
- package/dist/{ConfigView-UQIRPENS.js → ConfigView-FDBMJC26.js} +1 -1
- package/dist/EvidenceViewOffer-YSNRKKPC.js +2 -0
- package/dist/FolderPicker-XCTJ5447.js +2 -0
- package/dist/{InfoBox-ZGSLEOPE.js → InfoBox-ZPUBB7J4.js} +1 -1
- package/dist/{LinksBox-JFT44YUK.js → LinksBox-MNNNOH23.js} +1 -1
- package/dist/{ProfilesView-WZSPK3HF.js → ProfilesView-GY5QCIT3.js} +1 -1
- package/dist/{ProjectPicker-SBBGVF4L.js → ProjectPicker-UCHMCNFV.js} +1 -1
- package/dist/{SaveSessionPrompt-F3563T3C.js → SaveSessionPrompt-ATVHKAHN.js} +1 -1
- package/dist/ScrollbackTap-QHJOFYMC.js +2 -0
- package/dist/SingleShotApp-IPNZBFXB.js +2 -0
- package/dist/{SummaryBox-6N6NESLI.js → SummaryBox-2DTNE25L.js} +1 -1
- package/dist/TestMdRunView-2FQIEI5W.js +2 -0
- package/dist/{TestrunEvidenceTable-JLJBJ76Q.js → TestrunEvidenceTable-6UE5EMON.js} +1 -1
- package/dist/{WhoamiView-PNVUCWLB.js → WhoamiView-TFCHIOW5.js} +1 -1
- package/dist/agent-parse-XMWVKCRD.js +2 -0
- package/dist/{app-download-NNB52ZRJ.js → app-download-N7MLJQ42.js} +1 -1
- package/dist/attach-target-V6LECVES.js +2 -0
- package/dist/{auth-JIDDELKY.js → auth-IQPCVCZK.js} +1 -1
- package/dist/{binary-LXYAW7WQ.js → binary-VML7EGV4.js} +1 -1
- package/dist/bind-YV6V5AI6.js +15 -0
- package/dist/{bootstrap-THOC3SS7.js → bootstrap-KCPWDBLX.js} +1 -1
- package/dist/bridge-5UKX7YIO.js +2 -0
- package/dist/{changelog-BSMZXLTG.js → changelog-CJFWGRIL.js} +1 -1
- package/dist/chat-committer-HDE3TP5I.js +2 -0
- package/dist/chat-controller-3EPK7UZG.js +2 -0
- package/dist/chunk-27ERHOW3.js +2 -0
- package/dist/{chunk-RN5ERSV2.js → chunk-2WRBCTNM.js} +1 -1
- package/dist/chunk-3D5MKSG3.js +5 -0
- package/dist/{chunk-FNIL4G3V.js → chunk-3GELV4IN.js} +3 -3
- package/dist/{chunk-EEFZXZTZ.js → chunk-3IXEARDX.js} +1 -1
- package/dist/chunk-3N6IAVD5.js +7 -0
- package/dist/{chunk-DXFMELKC.js → chunk-4TMQTSIO.js} +1 -1
- package/dist/chunk-52WM3XYO.js +4 -0
- package/dist/{chunk-R7QAS6LZ.js → chunk-55YDTPB7.js} +1 -1
- package/dist/{chunk-477DYMXZ.js → chunk-5HTSKF5K.js} +1 -1
- package/dist/{chunk-IDX3TOPY.js → chunk-5LJRZI7S.js} +1 -1
- package/dist/chunk-66MOZKD2.js +2 -0
- package/dist/chunk-6DHEOPXX.js +9 -0
- package/dist/{chunk-NU45ROHH.js → chunk-6GLFQHSW.js} +2 -2
- package/dist/chunk-6K4FDYMH.js +89 -0
- package/dist/{chunk-7GUFVQOQ.js → chunk-6L5RV62W.js} +1 -1
- package/dist/{chunk-TDNM22BQ.js → chunk-74FHTDEE.js} +1 -1
- package/dist/chunk-7EGIX6Y4.js +8 -0
- package/dist/chunk-7O54QURK.js +2 -0
- package/dist/chunk-7WDPU33M.js +2 -0
- package/dist/{chunk-BTBUIL4Q.js → chunk-7X4R6464.js} +1 -1
- package/dist/{chunk-FUP4AP6J.js → chunk-A557OSRS.js} +1 -1
- package/dist/chunk-AHXOKBVE.js +7 -0
- package/dist/{chunk-DNNZ353O.js → chunk-ALCE5RLK.js} +1 -1
- package/dist/{chunk-I75FRXKE.js → chunk-AYJ2YZP5.js} +1 -1
- package/dist/chunk-BMVE73M7.js +21 -0
- package/dist/chunk-CAOZKSQ3.js +8 -0
- package/dist/{chunk-BJAHVN2F.js → chunk-CNPIJFZM.js} +1 -1
- package/dist/{chunk-EV64VI66.js → chunk-CRZUBDJ3.js} +1 -1
- package/dist/{chunk-PUM5J56E.js → chunk-D6GBOFK5.js} +1 -1
- package/dist/{chunk-YEZYO5QH.js → chunk-DMCEGMGB.js} +1 -1
- package/dist/{chunk-TMRLBSIA.js → chunk-DMT3W26F.js} +1 -1
- package/dist/{chunk-XS3HIVNS.js → chunk-EDQZIEPJ.js} +1 -1
- package/dist/{chunk-VJ3ES3RR.js → chunk-EFTRH35G.js} +1 -1
- package/dist/{chunk-Q4YAJJPP.js → chunk-EJXBKCNF.js} +1 -1
- package/dist/{chunk-NUWOQS6L.js → chunk-EPE2ELDH.js} +1 -1
- package/dist/{chunk-WIAZN7G4.js → chunk-FFVNISYH.js} +1 -1
- package/dist/chunk-FQNQVC5O.js +5 -0
- package/dist/chunk-FXO7JKMZ.js +4 -0
- package/dist/chunk-GP7WD4UY.js +4 -0
- package/dist/{chunk-K2UEVCIJ.js → chunk-GSDXZS4U.js} +1 -1
- package/dist/{chunk-J2UN2AHO.js → chunk-GZ65ZA4C.js} +1 -1
- package/dist/chunk-H6TNBKGR.js +5 -0
- package/dist/{chunk-GILD6RGH.js → chunk-HLCETZ73.js} +1 -1
- package/dist/chunk-HOA4VWSD.js +5 -0
- package/dist/{chunk-33GXXC2L.js → chunk-HYTBEPC2.js} +1 -1
- package/dist/{chunk-PWRIG6UB.js → chunk-IAHOLH5W.js} +1 -1
- package/dist/chunk-IE3OO5GI.js +2 -0
- package/dist/{chunk-UF4JZXEE.js → chunk-JCMHB4KH.js} +1 -1
- package/dist/{chunk-KV5BOFPK.js → chunk-JFUFWICY.js} +2 -2
- package/dist/{chunk-FE6XRABM.js → chunk-JGAMMOUC.js} +1 -1
- package/dist/{chunk-CAO3XRA2.js → chunk-JL3L6KOG.js} +1 -1
- package/dist/chunk-JQCOKL6U.js +15 -0
- package/dist/{chunk-IZU5ND2C.js → chunk-JSS22MFY.js} +9 -9
- package/dist/chunk-JVEZBJJ7.js +2 -0
- package/dist/{chunk-3SP4JVDN.js → chunk-KALEPJAV.js} +2 -2
- package/dist/{chunk-AIVOYTYQ.js → chunk-KUS324VE.js} +1 -1
- package/dist/chunk-KZG4E5RM.js +2 -0
- package/dist/{chunk-KSLJOUH4.js → chunk-LJGAXIDU.js} +1 -1
- package/dist/chunk-M36MOFJW.js +9 -0
- package/dist/{chunk-ZOSY2PJM.js → chunk-MLYNVJNH.js} +1 -1
- package/dist/{chunk-XL6HDWM3.js → chunk-N3CVR4Z2.js} +1 -1
- package/dist/{chunk-2X3TANEV.js → chunk-NLEA6NPU.js} +1 -1
- package/dist/{chunk-4PARDPK2.js → chunk-NUJVYAI4.js} +1 -1
- package/dist/{chunk-3M2D7UUI.js → chunk-NWNG5UWD.js} +1 -1
- package/dist/{chunk-IWVA37B6.js → chunk-O25AL4B7.js} +1 -1
- package/dist/{chunk-KAZGHWGK.js → chunk-O3XBIURC.js} +1 -1
- package/dist/chunk-O66WXOOC.js +5 -0
- package/dist/{chunk-W2UYUV47.js → chunk-OFWJBOGT.js} +2 -2
- package/dist/{chunk-DMLYUTS4.js → chunk-OGDAWNFY.js} +1 -1
- package/dist/chunk-OPL2MIQG.js +2 -0
- package/dist/{chunk-F5AI3UVS.js → chunk-ORQGQSWG.js} +2 -2
- package/dist/{chunk-7KIIM6H7.js → chunk-OWGFFJKK.js} +1 -1
- package/dist/{chunk-6AZNGOLH.js → chunk-PGXJ275T.js} +1 -1
- package/dist/chunk-Q77QO3PC.js +17 -0
- package/dist/{chunk-XH2KDLZO.js → chunk-QVLYK5JL.js} +1 -1
- package/dist/{chunk-UZCSVEWP.js → chunk-QXRT6HSV.js} +1 -1
- package/dist/{chunk-LWQNRZH3.js → chunk-R7QMZBBH.js} +1 -1
- package/dist/{chunk-DIM5X2FR.js → chunk-RI4ILZZC.js} +1 -1
- package/dist/{chunk-D4G3SEBU.js → chunk-RQILLYSP.js} +1 -1
- package/dist/chunk-S4JUCBCT.js +7 -0
- package/dist/{chunk-VYMMGWVO.js → chunk-SHSXOYKT.js} +1 -1
- package/dist/{chunk-XAM5E27U.js → chunk-SIYSKT6I.js} +1 -1
- package/dist/chunk-SWTJMTBY.js +29 -0
- package/dist/chunk-T4R26WER.js +9 -0
- package/dist/{chunk-O5U6EAL3.js → chunk-TCAHDVII.js} +1 -1
- package/dist/{chunk-LAQBCZ5A.js → chunk-TEHZUSUY.js} +1 -1
- package/dist/chunk-TNBF5OMZ.js +2 -0
- package/dist/chunk-TU6IMGWO.js +2 -0
- package/dist/{chunk-NM76SG3S.js → chunk-TVELOH5A.js} +1 -1
- package/dist/chunk-UHSNUUX3.js +35 -0
- package/dist/{chunk-5G22NOZK.js → chunk-UHT5SVP5.js} +1 -1
- package/dist/{chunk-KXUTO5WC.js → chunk-UZIMYV5U.js} +1 -1
- package/dist/chunk-VOTIGXQ4.js +16 -0
- package/dist/{chunk-MXDWS7S4.js → chunk-VZDLRJ5N.js} +7 -7
- package/dist/{chunk-3FXNQTCE.js → chunk-W77SZLFC.js} +1 -1
- package/dist/{chunk-OHK6V7JX.js → chunk-WFBJNVMQ.js} +1 -1
- package/dist/{chunk-N2I23ANS.js → chunk-WNB2IYHY.js} +1 -1
- package/dist/chunk-XSUJJB7Z.js +11 -0
- package/dist/{chunk-TXZ66K4Q.js → chunk-XUJXGE42.js} +1 -1
- package/dist/{chunk-AQWTK6IN.js → chunk-XXE7W5AV.js} +1 -1
- package/dist/{chunk-EXLXV5OU.js → chunk-YAAQER2L.js} +1 -1
- package/dist/{chunk-XS2LZFCH.js → chunk-YCH7H7JX.js} +1 -1
- package/dist/{chunk-SEKJZOKW.js → chunk-YGMUNNKH.js} +1 -1
- package/dist/{chunk-ARU6KAGY.js → chunk-YKYKOV6U.js} +1 -1
- package/dist/chunk-YLQHY4A7.js +2 -0
- package/dist/{chunk-KGKJU27A.js → chunk-YYYQ5MVD.js} +1 -1
- package/dist/chunk-YZVR7ESF.js +2 -0
- package/dist/{chunk-PYQS5ST6.js → chunk-Z3YYMZHT.js} +2 -2
- package/dist/{chunk-QD2BUO5M.js → chunk-Z73ZYROU.js} +1 -1
- package/dist/{chunk-JX2CAVX6.js → chunk-ZCSEBT2W.js} +1 -1
- package/dist/{chunk-MCKBJIBB.js → chunk-ZEVU2OT3.js} +1 -1
- package/dist/{chunk-K4SULRBL.js → chunk-ZKCCG3GK.js} +1 -1
- package/dist/chunk-ZUZ6QJRA.js +23 -0
- package/dist/committer-IYQPXG6C.js +2 -0
- package/dist/{config-BCGD2FEX.js → config-UGCWZGH5.js} +1 -1
- package/dist/cover-cmd-SWJ2NZUZ.js +3 -0
- package/dist/{credentials-YNH5BU2Z.js → credentials-GWLYYRTL.js} +1 -1
- package/dist/{deps-bundle-LOFI4DAJ.js → deps-bundle-VNGC2UG6.js} +1 -1
- package/dist/{deps-resolve-GA6IPHVZ.js → deps-resolve-YLCEU6I7.js} +1 -1
- package/dist/design-committer-J57IAAA5.js +2 -0
- package/dist/dispatch-OMQCT7WO.js +2 -0
- package/dist/{doctor-W5TQBYB5.js → doctor-B4Z6RPKQ.js} +1 -1
- package/dist/docx-convert-WPZS6OIC.js +2 -0
- package/dist/{dossier-Y6TJWFZU.js → dossier-UGJMYYAB.js} +1 -1
- package/dist/evidence-XJGXVLO5.js +2 -0
- package/dist/evolve-cmd-QQQPPGL3.js +2 -0
- package/dist/explain-H5HJEDEF.js +2 -0
- package/dist/{explain-cmd-XCRO4AS6.js → explain-cmd-R45I5MT7.js} +1 -1
- package/dist/explain-cmd-XVE6Z67Q.js +9 -0
- package/dist/extract-bind-7IDQS4QP.js +14 -0
- package/dist/{extract-cmd-7FKQJNS7.js → extract-cmd-KIEOBRIT.js} +3 -3
- package/dist/feeder-RSHMGW6B.js +2 -0
- package/dist/gaps-cmd-RGIPUSIR.js +3 -0
- package/dist/{generate-headless-OBMB5CSB.js → generate-headless-XGRIDD6O.js} +2 -2
- package/dist/headless-io-3A3BZVQ5.js +2 -0
- package/dist/index.js +187 -206
- package/dist/ingest-QGLVY7ND.js +2 -0
- package/dist/ingest-cmd-R5H5SF5K.js +2 -0
- package/dist/install-W3VPVPAQ.js +2 -0
- package/dist/interactive-bind-X5DVLRRW.js +26 -0
- package/dist/lifecycle-cmd-6R2PR2HM.js +2 -0
- package/dist/{list-cmd-V3HJ5K4O.js → list-cmd-QCIYKWYQ.js} +1 -1
- package/dist/{list-commands-SH4HPFI4.js → list-commands-VRRCVWKO.js} +1 -1
- package/dist/{locks-cmd-CSVSWY2Y.js → locks-cmd-67OHQZNV.js} +1 -1
- package/dist/logical-ids-DN6IZSUM.js +2 -0
- package/dist/login-flow-5HL2QYEL.js +2 -0
- package/dist/maintenance-cmd-GZ4EMT3V.js +2 -0
- package/dist/{mobile-prompts-UZTRJ3L7.js → mobile-prompts-CMIVWDHQ.js} +1 -1
- package/dist/objective-variable-gate-EEYJ6B3X.js +2 -0
- package/dist/open-provider-UFSCTIQQ.js +2 -0
- package/dist/pdf-convert-5H4HQNN3.js +2 -0
- package/dist/{persist-recorded-session-QMRY4DOF.js → persist-recorded-session-JXL5E53A.js} +1 -1
- package/dist/phase-seed-HKJ2EF7R.js +2 -0
- package/dist/pipeline-RSCRNNPW.js +2 -0
- package/dist/prepare-target-XZ3FTVBW.js +2 -0
- package/dist/readmodel-IBFRM6EO.js +2 -0
- package/dist/reconcile-cmd-4VRTUM2D.js +2 -0
- package/dist/reconcile-deps-ZCJ2QCK5.js +4 -0
- package/dist/reconcile-engine-IVLZCYZB.js +2 -0
- package/dist/{recording-banner-7E75ERQJ.js → recording-banner-SRLPSTFP.js} +1 -1
- package/dist/records-TJJJWBUD.js +2 -0
- package/dist/registry-CPQHW2L2.js +2 -0
- package/dist/{require-project-folder-LBUYWQOF.js → require-project-folder-SKEZMSN7.js} +1 -1
- package/dist/{resolve-run-intent-GHISMXLZ.js → resolve-run-intent-THC3EPAX.js} +1 -1
- package/dist/{resolver-7JC5VZ4S.js → resolver-2NUNLK7N.js} +1 -1
- package/dist/revert-6BBBK3I4.js +2 -0
- package/dist/review-cmd-BMJQZ6XJ.js +5 -0
- package/dist/run-TURFDLC6.js +2 -0
- package/dist/run-UDP5VPYS.js +2 -0
- package/dist/{run-test-md-5LPCKCW7.js → run-test-md-MRYNFNPO.js} +2 -2
- package/dist/sessions-NH7WQWMX.js +2 -0
- package/dist/{sessions-cmd-VDQGRBEM.js → sessions-cmd-DV442ZCY.js} +1 -1
- package/dist/{skill-installer-YQPZZB7I.js → skill-installer-CVJ5VTEJ.js} +1 -1
- package/dist/{spawner-X2FOOONV.js → spawner-7FUA3JXA.js} +1 -1
- package/dist/store-guard-XQ5MSUB2.js +2 -0
- package/dist/structured-answers-NADW6D44.js +5 -0
- package/dist/sync-cmd-5INKTZN2.js +2 -0
- package/dist/sync-setup-4R54VRAO.js +2 -0
- package/dist/sync-setup-ui-RC727VK6.js +3 -0
- package/dist/tcg-generate-2BOPGRM6.js +2 -0
- package/dist/testmd-actions-2CPJZAC2.js +2 -0
- package/dist/testmd-sync-HYZI6NRM.js +2 -0
- package/dist/token-refresh-NTE4LQRN.js +2 -0
- package/dist/{validate-basic-GTSVZFQI.js → validate-basic-OKLJLDML.js} +1 -1
- package/dist/{variable-receipt-IHQAYWMZ.js → variable-receipt-CMCDUJI2.js} +1 -1
- package/dist/verdicts-EMCYGQWM.js +2 -0
- package/dist/{version-check-IPEPJZDX.js → version-check-4DQJBSXW.js} +1 -1
- package/dist/{view-cmd-SXXNDZIC.js → view-cmd-P3XRFORJ.js} +1 -1
- package/dist/walk-session-MUGS6CZY.js +2 -0
- package/dist/with-telemetry-3T53GIQC.js +2 -0
- package/package.json +12 -11
- package/dist/EvidenceViewOffer-AZRAILJQ.js +0 -2
- package/dist/FolderPicker-OJFR7AKZ.js +0 -2
- package/dist/ScrollbackTap-Q3IOKNMS.js +0 -2
- package/dist/SingleShotApp-72D5VVLE.js +0 -2
- package/dist/TestMdRunView-4OA52DA2.js +0 -2
- package/dist/bind-F36JFHUK.js +0 -12
- package/dist/bridge-KMDML2NB.js +0 -2
- package/dist/chat-committer-RAOIL2T6.js +0 -2
- package/dist/chat-controller-YJCNU76T.js +0 -2
- package/dist/chunk-4WOVHRI2.js +0 -15
- package/dist/chunk-54JZ6VEW.js +0 -4
- package/dist/chunk-5DT7PIGB.js +0 -5
- package/dist/chunk-6FCPS2VT.js +0 -4
- package/dist/chunk-6IAA644J.js +0 -9
- package/dist/chunk-6J635CRI.js +0 -5
- package/dist/chunk-AGRUULPT.js +0 -4
- package/dist/chunk-BZTWTYQQ.js +0 -6
- package/dist/chunk-CUSTYILP.js +0 -2
- package/dist/chunk-DBIBROYW.js +0 -5
- package/dist/chunk-I27YRAGO.js +0 -7
- package/dist/chunk-IAHKTEET.js +0 -2
- package/dist/chunk-IVQX3AKL.js +0 -4
- package/dist/chunk-J3Q63NFG.js +0 -2
- package/dist/chunk-K6RAOZHP.js +0 -4
- package/dist/chunk-KO3FL2XW.js +0 -26
- package/dist/chunk-L32DKFRQ.js +0 -16
- package/dist/chunk-LPDBTGO5.js +0 -21
- package/dist/chunk-N7Z7BQYO.js +0 -3
- package/dist/chunk-NVGBE2DR.js +0 -2
- package/dist/chunk-OS4VSIHT.js +0 -4
- package/dist/chunk-OTMAFCZK.js +0 -8
- package/dist/chunk-P5MJMM3X.js +0 -85
- package/dist/chunk-QQ5MHSSY.js +0 -2
- package/dist/chunk-T7DGNWI2.js +0 -17
- package/dist/chunk-UH2ZTX4E.js +0 -2
- package/dist/chunk-W3Z7AZNT.js +0 -4
- package/dist/chunk-WUV3FJ7C.js +0 -11
- package/dist/chunk-XMTSHHYQ.js +0 -4
- package/dist/committer-C6UCDYMC.js +0 -2
- package/dist/cover-cmd-5LPHIOSI.js +0 -3
- package/dist/design-committer-UPC6NZUF.js +0 -2
- package/dist/dispatch-FRCPK3AZ.js +0 -2
- package/dist/docx-convert-BIV5T7F5.js +0 -2
- package/dist/evidence-FHO36EEV.js +0 -2
- package/dist/evolve-cmd-6RXLKERE.js +0 -2
- package/dist/explain-3HAZY7Q6.js +0 -2
- package/dist/explain-cmd-RMJPXD4U.js +0 -9
- package/dist/extract-bind-BFJPRNPQ.js +0 -10
- package/dist/feeder-IOR3XRNF.js +0 -2
- package/dist/gaps-cmd-FDJ3PT4C.js +0 -3
- package/dist/headless-io-66RG5NN5.js +0 -2
- package/dist/ingest-TTUQ7UDK.js +0 -2
- package/dist/ingest-cmd-AV66Q5LC.js +0 -2
- package/dist/install-SFJ2FFQ6.js +0 -2
- package/dist/interactive-bind-N5AQB26T.js +0 -25
- package/dist/lifecycle-cmd-KSMETBPP.js +0 -2
- package/dist/logical-ids-MLXAH45L.js +0 -2
- package/dist/login-flow-ODVWEPRU.js +0 -2
- package/dist/maintenance-cmd-VFYGKY3X.js +0 -2
- package/dist/objective-variable-gate-3VUXNDCZ.js +0 -2
- package/dist/pdf-convert-OZIRUADA.js +0 -2
- package/dist/phase-seed-BMOSAA74.js +0 -2
- package/dist/pipeline-5FHWZAXK.js +0 -2
- package/dist/prepare-target-UJEY2FSR.js +0 -2
- package/dist/readmodel-TDRFVDVI.js +0 -2
- package/dist/reconcile-cmd-2QHZML2L.js +0 -2
- package/dist/reconcile-deps-ZBWUY3SM.js +0 -4
- package/dist/reconcile-engine-YC4RQYF2.js +0 -2
- package/dist/records-JLS63SDI.js +0 -2
- package/dist/registry-JJTRUPH7.js +0 -2
- package/dist/revert-PRR3D4XM.js +0 -2
- package/dist/review-cmd-SAGIKWEW.js +0 -4
- package/dist/run-43ACVPJK.js +0 -2
- package/dist/run-EOTOXNQO.js +0 -2
- package/dist/sessions-GIEXOCE4.js +0 -2
- package/dist/structured-answers-YAVW65G4.js +0 -5
- package/dist/tcg-generate-V4QRNEZV.js +0 -2
- package/dist/testmd-actions-2UMU3QMV.js +0 -2
- package/dist/testmd-sync-UBXDLWYD.js +0 -2
- package/dist/token-refresh-NL5AM446.js +0 -2
- package/dist/verdicts-QU6W3TUF.js +0 -2
- package/dist/walk-session-7JVB4Z5S.js +0 -2
- package/dist/with-telemetry-LRI7H6DH.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as le,b as Oe,c as vn}from"./chunk-6J5T5FEY.js";import{a as wn,b as me,c as It,d as $n,e as Dt,g as rt,h as it,i as Cn,j as Rn,l as Sn,m as Bt,n as In}from"./chunk-CUSTYILP.js";import{b as Rt}from"./chunk-UJZZDPDY.js";import{a as yn}from"./chunk-O5U6EAL3.js";import{a as tt}from"./chunk-IWVA37B6.js";import{a as xn,b as kn,c as bn}from"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-IVQX3AKL.js";import{a as nt,d as _e,e as Tn,f as St}from"./chunk-RKXHVP2Z.js";import{a as gn,b as hn,c as pn}from"./chunk-TXZ66K4Q.js";import"./chunk-NVGBE2DR.js";import{a as dn}from"./chunk-5Y2G4NC7.js";import"./chunk-W3Z7AZNT.js";import"./chunk-JQW2QFSX.js";import"./chunk-6FCPS2VT.js";import"./chunk-UH2ZTX4E.js";import"./chunk-XMTSHHYQ.js";import"./chunk-DBIBROYW.js";import"./chunk-AKX4VRRR.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import{a as et}from"./chunk-YCCUBQY4.js";import{a as mn}from"./chunk-AQWTK6IN.js";import{y as r}from"./chunk-33GXXC2L.js";import{b as fn}from"./chunk-DFS4RMVP.js";import{a as Q}from"./chunk-HCBYKLMW.js";import{a as k,b as n,k as Ze}from"./chunk-C44QQJR4.js";import{a as Mr}from"./chunk-6YGTRKDT.js";import{e as V}from"./chunk-UR6MHSHU.js";var m=V(Mr(),1);var a=V(Q(),1),Ar=60,Lr=100;function Et(t,o){let l=t.options.length,u=l,g=t.multi_select?u++:null,x=t.allow_free_text?u++:null,f=o?u++:null;return{optionCount:l,doneIdx:g,freeIdx:x,batchIdx:f,maxSel:u-1}}var Or="\xA0",_r={high:{text:`\u203C${Or}high`,color:r.red},med:{text:"med",color:"yellow"},low:{text:"low",color:r.dim}};function Pr(t){let o=(t.header??t.text.split(/\s+/).slice(0,3).join(" ")).trim();return o.length>16?`${o.slice(0,15)}\u2026`:o}function qr(t,o,l){let u=p=>t[p].length+6,g=u(o),x=o,f=o;for(;;){let p=f+1<t.length?u(f+1):1/0,C=x-1>=0?u(x-1):1/0;if(p===1/0&&C===1/0)break;if(p<=C){if(g+p>l)break;g+=p,f+=1}else{if(g+C>l)break;g+=C,x-=1}}return{lo:x,hi:f}}function Dn({batch:t,qView:o,sel:l=0,focused:u=!1,freeText:g=null,optionText:x=null,attach:f=null,multiSelFor:p,childPrefix:C}){let{stdout:M}=Ze(),v=M?.columns??80,T=v<Ar,W=Math.min(v-1,Lr),$=Math.max(0,Math.min(t.questions.length-1,o??(t.cursor<0?0:t.cursor))),I=t.questions[$],N=t.resolution[$],L=t.resolution.filter(D=>!D).length,B=t.questions.length-L,P=tt(t),O=Et(I,P!==""),H=p?p($):[],K=_r[I.risk],re=D=>u&&l===D?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" ",S=`? ${C??""}the agent needs ${L===1?"one answer":`${L} answers`}`,$e=t.questions.length>1?` \xB7 ${$+1} of ${t.questions.length} \xB7 ${B} answered`:"",z=(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsxs)(n,{bold:!0,children:[I.text,K?(0,a.jsx)(n,{color:K.color,bold:!1,children:` ${K.text}`}):null]})}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:I.rationale})}),(0,a.jsx)(n,{children:" "}),I.options.map((D,w)=>{let X=u&&l===w;return x&&x.optionIndex===w?(0,a.jsx)(k,{flexDirection:"column",children:(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:`${w+1}. ${D.label}`}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:x.value,onChange:x.onChange,onSubmit:x.onSubmit,onCancel:x.onCancel,placeholder:D.detail||"type your answer"})]})},`o-${w}`):(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsxs)(n,{children:[re(w)," ",I.multi_select?(0,a.jsx)(n,{color:H.includes(w)?r.green:r.dim,children:H.includes(w)?"[x] ":"[ ] "}):null,(0,a.jsx)(n,{color:X?r.assuranceAccent:void 0,children:`${w+1}. ${D.label}`}),w===I.recommended_index?(0,a.jsx)(n,{color:r.dim,children:" (recommended)"}):null,N?.selected_index===w?(0,a.jsx)(n,{color:r.dim,children:" (current)"}):null]}),D.detail?(0,a.jsx)(k,{paddingLeft:5,children:(0,a.jsx)(n,{color:r.dim,children:D.detail})}):null]},`o-${w}`)}),I.multi_select&&O.doneIdx!=null?(0,a.jsxs)(n,{children:[re(O.doneIdx)," ",(0,a.jsx)(n,{color:r.green,children:"\u2714"}),(0,a.jsx)(n,{color:u&&l===O.doneIdx?r.assuranceAccent:void 0,children:" done \u2014 confirm selection"})]}):null,I.allow_free_text?(0,a.jsx)(n,{children:" "}):null,I.allow_free_text?g?(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.dim,children:"\u270E "})]}),(0,a.jsx)(et,{value:g.value,onChange:g.onChange,onSubmit:g.onSubmit,onCancel:g.onCancel,placeholder:"Tell me what to do"})]}):(0,a.jsxs)(n,{children:[O.freeIdx!=null?re(O.freeIdx):" "," ",(0,a.jsx)(n,{color:u&&O.freeIdx!=null&&l===O.freeIdx?r.assuranceAccent:r.dim,children:"\u270E Tell me what to do"})]}):null,f?(0,a.jsxs)(k,{flexDirection:"column",marginTop:1,children:[(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"@ attach a file or URL"}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:f.value,onChange:f.onChange,onSubmit:f.onSubmit,onCancel:f.onCancel,placeholder:"path or URL"})]}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:"the questions are set aside \u2014 the agent reads the source and re-asks what's still open"})})]}):null]}),j=P!==""?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n,{children:" "}),(0,a.jsxs)(n,{children:[u&&O.batchIdx!=null&&l===O.batchIdx?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" "," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"\xBB"}),(0,a.jsx)(n,{bold:!0,color:u&&O.batchIdx!=null&&l===O.batchIdx?r.assuranceAccent:void 0,children:" Go with recommendations"}),L>=5?(0,a.jsx)(n,{color:r.dim,children:` \u2014 resolves all ${L} open`}):null,(0,a.jsx)(n,{color:r.dim,children:" (tab)"})]})]}):null;if(T)return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsx)(n,{color:r.assuranceAccent,bold:!0,children:S}),t.questions.length>1?(0,a.jsx)(n,{color:r.dim,children:$e.replace(/^ · /,"")}):null,(0,a.jsx)(n,{children:" "}),z,j]});let h=t.questions.map(D=>Pr(D)),ce=t.questions.length>1?qr(h,$,W-8):null;return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsxs)(n,{color:r.assuranceAccent,children:[(0,a.jsx)(n,{bold:!0,children:S}),$e?(0,a.jsx)(n,{color:r.dim,children:$e}):null]}),ce?(0,a.jsx)(k,{marginTop:1,children:(0,a.jsxs)(n,{children:[ce.lo>0?(0,a.jsx)(n,{color:r.dim,children:"\u25C0 "}):" ",t.questions.slice(ce.lo,ce.hi+1).map((D,w)=>{let X=ce.lo+w,Pe=w>0?" ":"";return X===$?(0,a.jsxs)(n,{children:[Pe,(0,a.jsx)(n,{backgroundColor:r.assuranceAccent,color:"#0d1117",bold:!0,children:` ${h[X]} `})]},D.id):(0,a.jsxs)(n,{children:[Pe,t.resolution[X]?(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.green,children:"\u2713 "}),(0,a.jsx)(n,{color:r.dim,children:h[X]})]}):(0,a.jsx)(n,{color:r.dim,children:`\u25CB ${h[X]}`})]},D.id)}),ce.hi<t.questions.length-1?(0,a.jsx)(n,{color:r.dim,children:" \u25B6"}):null]})}):null,(0,a.jsx)(n,{children:" "}),z,j]})}var A=V(Q(),1),Bn={high:0,med:1,low:2},jr={high:r.red,med:"yellow",low:r.dim};function Fr(t){return t.map((o,l)=>({r:o,i:l})).sort((o,l)=>(Bn[o.r.risk??"zz"]??3)-(Bn[l.r.risk??"zz"]??3)||o.i-l.i).map(({r:o})=>o)}function En({rows:t,width:o=120,badgeHeader:l="risk"}){if(t.length===0)return null;let u=Fr(t),g=B=>B.staged||!B.id?"(staged)":yn(B.id),x=Math.max(2,...u.map(B=>g(B).length)),f=Math.max(l.length,...u.map(B=>(B.badge??"").length)),p=o>=84&&u.some(B=>B.summary),M=o-(p?13:10)-x-f,v=Math.max(...u.map(B=>Math.max(B.title.length,(B.marker??"").length)),5),T=Math.max(5,p?Math.min(v,Math.max(16,Math.floor(M*.5))):Math.min(v,M)),W=p?Math.max(7,M-T):0,$=(B,P,O,H)=>vn(B,P,O,H.map(K=>K.length)),I=(B,P,O,H)=>[Oe(le(B,x),x),Oe(le(P,T),T),Oe(le(O,f),f),...p?[Oe(le(H,W),W)]:[]],N=I("id","title",l,"summary"),L=[];L.push((0,A.jsx)(n,{color:r.dim,children:$("\u250C","\u252C","\u2510",N)},"t")),L.push((0,A.jsxs)(n,{children:[N.map((B,P)=>(0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:P===0?"\u2502 ":" \u2502 "}),(0,A.jsx)(n,{bold:!0,children:B})]},P)),(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},"h")),L.push((0,A.jsx)(n,{color:r.dim,children:$("\u251C","\u253C","\u2524",N)},"m"));for(let[B,P]of u.entries()){let O=I(g(P),le(P.title,T),le(P.badge??"",f),le(P.summary??"",W)),H=P.badgeColor??jr[P.badge??""]??r.dim;if(L.push((0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:"\u2502 "}),(0,A.jsx)(n,{color:r.assuranceAccent,children:O[0]}),(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[1],(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),(0,A.jsx)(n,{color:H,children:O[2]}),p?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[3]]}):null,(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},`r-${B}`)),P.marker){let K=I("",le(P.marker,T),"","");L.push((0,A.jsx)(n,{color:r.dim,children:`\u2502 ${K.join(" \u2502 ")} \u2502`},`mk-${B}`))}}return L.push((0,A.jsx)(n,{color:r.dim,children:$("\u2514","\u2534","\u2518",N)},"b")),(0,A.jsx)(A.Fragment,{children:L})}var y=V(Q(),1);function Wr(t){let o=t.form==="assumed"?" (assumed)":t.form==="deferred"?"":" (you)",l=t.note?` \u2014 ${t.note}`:"";return t.form==="deferred"?`\u21B3 deferred q${t.qNum} ${t.stub}${l}`:t.form==="changed"?`\u21B3 changed q${t.qNum} ${t.stub}: ${t.prev??"?"} \u2192 ${t.choice??"?"}${o}${l}`:`\u21B3 ${t.form} q${t.qNum} ${t.stub}: ${t.choice??"?"}${o}${l}`}var Vr=()=>(process.stdout?.columns??100)-12;function Mn({block:t,annotations:o}){let l=t.era??0,u=Nr(t,o??null);return l>0?(0,y.jsx)(k,{marginLeft:l*2,children:u}):u}function Nr(t,o){switch(t.kind){case"banner":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{bold:!0,color:r.assuranceAccent,children:` ${t.text}`})});case"user":return(0,y.jsxs)(k,{marginTop:1,children:[(0,y.jsx)(n,{color:r.orange,children:"\u276F "}),(0,y.jsx)(n,{children:t.text})]});case"note":return(0,y.jsx)(n,{color:r.dim,children:` ${t.text}`});case"agent":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(hn,{text:t.text,accent:r.assuranceAccent})});case"worked":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{color:r.dim,children:` \u2699 ${bn(t.durS,t.toolCalls,t.tools)}`})});case"usage":return(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.credits.toFixed(1)} credits \u2014 total ${t.total.toFixed(1)}`});case"turn":{let l=o,u=l?l.fresh:t.items.map((v,T)=>({item:v,num:T+1,updated:!1})),g={usecase:"risk","use-case":"risk",ac:"check",scenario:"kind",test:"check",gap:"severity",stylenote:"kind"},x=v=>v.kind??"use-case",f=new Map;for(let v of u){let T=v.item,W=x(v.item),$=T.risk==="high"||T.risk==="med"||T.risk==="low"?T.risk:void 0,I={id:T.logical_id??"",staged:!T.logical_id,title:T.title,badge:T.badge??T.risk??"",summary:T.why??T.summary??T.description??"",...$?{risk:$}:{},...v.updated?{marker:"\u21B3 changed"}:{}},N=f.get(W)??[];N.push(I),f.set(W,N)}let p=u.some(v=>!!v.item.kind),C=(l?.unchanged??[]).reduce((v,T)=>v+T.count,0),M=l?.headerStats?` \u2014 ${l.headerStats}${C>0?` (${C} unchanged)`:""}`:"";return(0,y.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(0,y.jsxs)(n,{bold:!0,children:[p?"design":t.heading,M?(0,y.jsx)(n,{bold:!1,color:r.dim,children:M}):null]}),[...f.entries()].map(([v,T])=>(0,y.jsxs)(k,{flexDirection:"column",children:[f.size>1?(0,y.jsx)(n,{color:r.dim,children:`${nt(v)} \xB7 ${T.length}`}):null,(0,y.jsx)(En,{rows:T,width:Vr(),badgeHeader:g[v]??"info"})]},v)),l&&l.unchanged.length>0&&(0,y.jsx)(n,{color:r.dim,children:` \u22EE unchanged: ${l.unchanged.map(v=>`${v.count} ${v.label}`).join(" \xB7 ")}`})]})}case"answer":return(0,y.jsx)(n,{color:r.dim,children:Wr(t.receipt)});case"continued":return(0,y.jsx)(n,{color:r.dim,children:"\u21B3 continued"});case"childOpen":{let{ing:l}=Rt(t.verb);return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsxs)(n,{color:r.assuranceAccent,children:[`\u25CF ${l} ${t.subject}`,t.sid?(0,y.jsx)(n,{color:r.dim,children:` \u2014 ${t.sid}`}):null,t.note?(0,y.jsx)(n,{color:r.dim,children:` ${t.note}`}):null]})})}case"childClose":{let{ed:l}=Rt(t.verb);if(!t.ok)return(0,y.jsxs)(n,{color:r.red,children:[`\u25CF ${t.verb} failed \u2014 ${t.exitCode!=null?`exited ${t.exitCode}`:"error"}`,t.fixCmd?(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.fixCmd}`}):null]});let u=[kn(t.durS),...t.results?[t.results]:[],...t.credits!==void 0?[`${t.credits.toFixed(1)} credits`]:[]].join(" \xB7 ");return(0,y.jsx)(n,{color:r.green,children:`\u25CF ${l} ${t.subject} \u2014 ${u}`})}case"childBack":return(0,y.jsx)(n,{color:r.dim,children:`back with ${t.parentVerb} \u2014 ${t.context}`});case"commit":return(0,y.jsxs)(k,{flexDirection:"column",children:[(0,y.jsx)(n,{color:t.ok?r.green:r.red,children:` ${t.ok?"\u2714":"\u2717"} ${t.line}`}),(t.warnings??[]).map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:` \u26A0 ${l}`},`w-${u}`))]});case"error":return(0,y.jsxs)(mn,{variant:"error",paddingX:1,children:[(0,y.jsx)(n,{color:r.red,children:t.title}),t.detail.map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:l},`d-${u}`))]})}}var Te=V(Q(),1);function An({item:t}){return(0,Te.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(t.cite??[]).map((o,l)=>(0,Te.jsx)(n,{dimColor:!0,children:`cite ${o.anchor??"conv"} \u2014 "${o.quote??""}"`},`cite-${l}`)),(t.depends_on_hint??[]).length>0&&(0,Te.jsx)(n,{dimColor:!0,children:`depends on: ${(t.depends_on_hint??[]).join(", ")}`}),Object.entries(t.extra??{}).map(([o,l])=>(0,Te.jsx)(n,{dimColor:!0,children:`${o}: ${l}`},`extra-${o}`))]})}var R=V(Q(),1),Mt=(t,o)=>Math.max(0,Math.min(o,t));function ot(t,o,l){switch(o.type){case"move":return t.level==="detail"?{...t,scroll:Math.max(0,(t.scroll??0)+o.delta)}:{...t,cursor:Mt(t.cursor+o.delta,Math.max(0,l-1))};case"enter":return t.level==="list"?{...t,level:"detail",scroll:0}:t;case"back":return t.level==="detail"?{...t,level:"list",scroll:0}:null}}var On={"use-case":"use-cases",ac:"acs",scenario:"scenarios",test:"tests",gap:"gaps"};function _n(t,o){if(t.level==="detail")return{level:"detail",cursor:Mt(t.num-1,Math.max(0,o.entries.length-1))};if(t.section){let l=o.entries.findIndex(u=>On[u.kind]===t.section);if(l>=0)return{level:"list",cursor:l}}return{level:"list",cursor:0}}function Kr(t){let o=[];for(let l of t.entries){let u=o.find(g=>g.kind===l.kind);u?u.entries.push(l):o.push({kind:l.kind,entries:[l]})}return o}var Ln=3;function Ur({items:t,cursor:o,verb:l,more:u}){let g=`view \xB7 ${l} so far \xB7 ${t.counts.map(f=>`${f.count} ${f.count===1?f.label.replace(/s$/,""):f.label}`).join(" \xB7 ")}`,x=t.entries[o];return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,color:r.assuranceAccent,children:g}),Kr(t).map(({kind:f,entries:p})=>{let C=x?.kind===f,M=C?p.findIndex($=>$.ref===x.ref):-1,v=C?Mt(M-1,Math.max(0,p.length-Ln)):0,T=p.slice(v,v+(C?Ln:1)),W=p.length-T.length;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{color:r.dim,children:`${On[f]??nt(f)} \xB7 ${p.length}`}),T.map($=>{let I=C&&$.ref===x.ref,N=$.item.badge;return(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:I?"\u203A ":" "}),(0,R.jsx)(n,{children:`${$.num} \xB7 ${$.item.title}`}),N?(0,R.jsx)(n,{color:r.dim,children:` \xB7 ${N}`}):null]},`${$.kind}:${$.ref}`)}),W>0&&(0,R.jsx)(n,{color:r.dim,children:` \u22EE ${W} more`})]},f)}),u?(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:o===t.entries.length?"\u203A ":" "}),(0,R.jsx)(n,{color:r.dim,children:`\u22EF show all \u2014 ${u.hidden} more from earlier turns`})]}):null]})}var st=14;function Qr({items:t,cursor:o,explain:l,grandTotal:u,dossier:g,scroll:x=0}){let f=t.entries[o];if(!f)return(0,R.jsx)(n,{color:r.dim,children:"nothing to show"});if(g){let C=Math.max(0,Math.min(x,Math.max(0,g.lines.length-st))),M=g.lines.slice(C,C+st);return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsxs)(n,{bold:!0,children:[`view \xB7 ${g.id}`,g.id.toLowerCase()!==g.rawId?(0,R.jsx)(n,{bold:!1,color:r.dim,children:` \xB7 ${g.rawId}`}):null]}),(0,R.jsx)(n,{bold:!0,children:g.title}),C>0?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${C} above`}):null,M.map((v,T)=>(0,R.jsx)(n,{color:v.dim?r.dim:void 0,children:v.text},`dl-${T}`)),g.lines.length>C+st?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${g.lines.length-C-st} more`}):null]})}let p=f.item;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,children:`view \xB7 ${f.kind} ${f.num} of ${u??t.entries.length}`}),(0,R.jsx)(n,{children:f.item.title}),p.badge?(0,R.jsx)(n,{color:r.dim,children:`kind: ${p.badge}`}):null,p.why?(0,R.jsx)(n,{color:r.dim,children:p.why}):null,(0,R.jsx)(An,{item:f.item}),l?.map((C,M)=>(0,R.jsx)(n,{color:r.dim,children:C},`ex-${M}`)),(0,R.jsx)(n,{color:r.dim,children:"view-only \u2014 approvals happen in chat"})]})}function Pn({items:t,state:o,verb:l,more:u,explain:g,grandTotal:x,dossier:f=null}){return o.level==="list"?(0,R.jsx)(Ur,{items:t,cursor:o.cursor,verb:l,more:u}):(0,R.jsx)(Qr,{items:t,cursor:o.cursor,explain:g,grandTotal:x,dossier:f,scroll:o.scroll??0})}var J=V(Q(),1),At=14;function Hr(t){let o=[],l=null;for(let u of t)u.field!==l&&(l=u.field,o.push({kind:"field",field:l})),o.push({kind:"line",field:l,line:u});return o}function qn({title:t,lines:o,offset:l=0}){let u=Hr(o),g=Math.max(0,Math.min(l,Math.max(0,u.length-At))),x=u.slice(g,g+At),f=g,p=Math.max(0,u.length-g-At),C=`view \xB7 diff \xB7 ${t} \xB7 current \u2192 proposed`;return(0,J.jsxs)(k,{flexDirection:"column",children:[(0,J.jsx)(n,{bold:!0,color:r.assuranceAccent,children:C}),f>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${f} above`})}):null,x.map((M,v)=>M.kind==="field"?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:M.field==="criteria"?"criteria":M.field})},`r-${g+v}`):(0,J.jsx)(k,{paddingLeft:4,children:(0,J.jsx)(n,{color:M.line.op==="-"?"red":"green",children:`${M.line.op==="-"?"\u2212":"+"} ${M.line.text}`})},`r-${g+v}`)),p>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${p} more`})}):null]})}var zr={"use-cases":"use-cases",usecases:"use-cases","use-case":"use-cases",acs:"acs",ac:"acs",scenarios:"scenarios",scenario:"scenarios",tests:"tests",test:"tests",gaps:"gaps",gap:"gaps"};function jn(t){let o=(t??"").trim().toLowerCase();if(!o)return{level:"list"};if(/^\d+$/.test(o)){let u=parseInt(o,10);return u>=1?{level:"detail",num:u}:{error:"items are numbered from 1 \u2014 /view 1"}}let l=zr[o];return l?{level:"list",section:l}:{error:"try /view, /view <number>, or /view acs|scenarios|tests"}}var E=V(Q(),1),Xr=6,Fn=12;function Gr(t,o,l){let u=Math.max(20,o),g=[];for(let f of t.split(`
|
|
2
|
+
import{a as It,b as $n,c as Dt,e as rt,f as it,g as Cn,h as Rn,j as Sn,k as Bt,l as In}from"./chunk-7WDPU33M.js";import{a as le,b as Oe,c as vn}from"./chunk-6J5T5FEY.js";import{b as Rt}from"./chunk-UJZZDPDY.js";import{a as tt}from"./chunk-O25AL4B7.js";import{a as nt,d as _e,e as Tn,f as St}from"./chunk-RKXHVP2Z.js";import{a as yn}from"./chunk-TCAHDVII.js";import{a as kn,b as bn,c as wn}from"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-52WM3XYO.js";import{a as hn,b as pn,c as xn}from"./chunk-XUJXGE42.js";import{a as gn,b as me}from"./chunk-YZVR7ESF.js";import"./chunk-IE3OO5GI.js";import{a as dn}from"./chunk-5Y2G4NC7.js";import"./chunk-GP7WD4UY.js";import"./chunk-JQW2QFSX.js";import"./chunk-3N6IAVD5.js";import"./chunk-FQNQVC5O.js";import"./chunk-AKX4VRRR.js";import"./chunk-UD7KKHPW.js";import{a as et}from"./chunk-YCCUBQY4.js";import{a as mn}from"./chunk-XXE7W5AV.js";import{y as r}from"./chunk-HYTBEPC2.js";import{b as fn}from"./chunk-DFS4RMVP.js";import{a as Q}from"./chunk-HCBYKLMW.js";import{a as k,b as n,k as Ze}from"./chunk-C44QQJR4.js";import{a as Mr}from"./chunk-6YGTRKDT.js";import{e as V}from"./chunk-UR6MHSHU.js";var m=V(Mr(),1);var a=V(Q(),1),Ar=60,Lr=100;function Et(t,o){let l=t.options.length,u=l,g=t.multi_select?u++:null,x=t.allow_free_text?u++:null,f=o?u++:null;return{optionCount:l,doneIdx:g,freeIdx:x,batchIdx:f,maxSel:u-1}}var Or="\xA0",_r={high:{text:`\u203C${Or}high`,color:r.red},med:{text:"med",color:"yellow"},low:{text:"low",color:r.dim}};function Pr(t){let o=(t.header??t.text.split(/\s+/).slice(0,3).join(" ")).trim();return o.length>16?`${o.slice(0,15)}\u2026`:o}function qr(t,o,l){let u=p=>t[p].length+6,g=u(o),x=o,f=o;for(;;){let p=f+1<t.length?u(f+1):1/0,C=x-1>=0?u(x-1):1/0;if(p===1/0&&C===1/0)break;if(p<=C){if(g+p>l)break;g+=p,f+=1}else{if(g+C>l)break;g+=C,x-=1}}return{lo:x,hi:f}}function Dn({batch:t,qView:o,sel:l=0,focused:u=!1,freeText:g=null,optionText:x=null,attach:f=null,multiSelFor:p,childPrefix:C}){let{stdout:M}=Ze(),v=M?.columns??80,T=v<Ar,W=Math.min(v-1,Lr),$=Math.max(0,Math.min(t.questions.length-1,o??(t.cursor<0?0:t.cursor))),I=t.questions[$],N=t.resolution[$],L=t.resolution.filter(D=>!D).length,B=t.questions.length-L,P=tt(t),O=Et(I,P!==""),H=p?p($):[],K=_r[I.risk],re=D=>u&&l===D?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" ",S=`? ${C??""}the agent needs ${L===1?"one answer":`${L} answers`}`,$e=t.questions.length>1?` \xB7 ${$+1} of ${t.questions.length} \xB7 ${B} answered`:"",z=(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsxs)(n,{bold:!0,children:[I.text,K?(0,a.jsx)(n,{color:K.color,bold:!1,children:` ${K.text}`}):null]})}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:I.rationale})}),(0,a.jsx)(n,{children:" "}),I.options.map((D,w)=>{let X=u&&l===w;return x&&x.optionIndex===w?(0,a.jsx)(k,{flexDirection:"column",children:(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:`${w+1}. ${D.label}`}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:x.value,onChange:x.onChange,onSubmit:x.onSubmit,onCancel:x.onCancel,placeholder:D.detail||"type your answer"})]})},`o-${w}`):(0,a.jsxs)(k,{flexDirection:"column",children:[(0,a.jsxs)(n,{children:[re(w)," ",I.multi_select?(0,a.jsx)(n,{color:H.includes(w)?r.green:r.dim,children:H.includes(w)?"[x] ":"[ ] "}):null,(0,a.jsx)(n,{color:X?r.assuranceAccent:void 0,children:`${w+1}. ${D.label}`}),w===I.recommended_index?(0,a.jsx)(n,{color:r.dim,children:" (recommended)"}):null,N?.selected_index===w?(0,a.jsx)(n,{color:r.dim,children:" (current)"}):null]}),D.detail?(0,a.jsx)(k,{paddingLeft:5,children:(0,a.jsx)(n,{color:r.dim,children:D.detail})}):null]},`o-${w}`)}),I.multi_select&&O.doneIdx!=null?(0,a.jsxs)(n,{children:[re(O.doneIdx)," ",(0,a.jsx)(n,{color:r.green,children:"\u2714"}),(0,a.jsx)(n,{color:u&&l===O.doneIdx?r.assuranceAccent:void 0,children:" done \u2014 confirm selection"})]}):null,I.allow_free_text?(0,a.jsx)(n,{children:" "}):null,I.allow_free_text?g?(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.dim,children:"\u270E "})]}),(0,a.jsx)(et,{value:g.value,onChange:g.onChange,onSubmit:g.onSubmit,onCancel:g.onCancel,placeholder:"Tell me what to do"})]}):(0,a.jsxs)(n,{children:[O.freeIdx!=null?re(O.freeIdx):" "," ",(0,a.jsx)(n,{color:u&&O.freeIdx!=null&&l===O.freeIdx?r.assuranceAccent:r.dim,children:"\u270E Tell me what to do"})]}):null,f?(0,a.jsxs)(k,{flexDirection:"column",marginTop:1,children:[(0,a.jsxs)(k,{children:[(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"})," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"@ attach a file or URL"}),(0,a.jsx)(n,{color:r.dim,children:" \u270E "})]}),(0,a.jsx)(et,{value:f.value,onChange:f.onChange,onSubmit:f.onSubmit,onCancel:f.onCancel,placeholder:"path or URL"})]}),(0,a.jsx)(k,{paddingLeft:2,children:(0,a.jsx)(n,{color:r.dim,children:"the questions are set aside \u2014 the agent reads the source and re-asks what's still open"})})]}):null]}),j=P!==""?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n,{children:" "}),(0,a.jsxs)(n,{children:[u&&O.batchIdx!=null&&l===O.batchIdx?(0,a.jsx)(n,{color:r.assuranceAccent,children:"\u276F"}):" "," ",(0,a.jsx)(n,{color:r.assuranceAccent,children:"\xBB"}),(0,a.jsx)(n,{bold:!0,color:u&&O.batchIdx!=null&&l===O.batchIdx?r.assuranceAccent:void 0,children:" Go with recommendations"}),L>=5?(0,a.jsx)(n,{color:r.dim,children:` \u2014 resolves all ${L} open`}):null,(0,a.jsx)(n,{color:r.dim,children:" (tab)"})]})]}):null;if(T)return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsx)(n,{color:r.assuranceAccent,bold:!0,children:S}),t.questions.length>1?(0,a.jsx)(n,{color:r.dim,children:$e.replace(/^ · /,"")}):null,(0,a.jsx)(n,{children:" "}),z,j]});let h=t.questions.map(D=>Pr(D)),ce=t.questions.length>1?qr(h,$,W-8):null;return(0,a.jsxs)(k,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,a.jsxs)(n,{color:r.assuranceAccent,children:[(0,a.jsx)(n,{bold:!0,children:S}),$e?(0,a.jsx)(n,{color:r.dim,children:$e}):null]}),ce?(0,a.jsx)(k,{marginTop:1,children:(0,a.jsxs)(n,{children:[ce.lo>0?(0,a.jsx)(n,{color:r.dim,children:"\u25C0 "}):" ",t.questions.slice(ce.lo,ce.hi+1).map((D,w)=>{let X=ce.lo+w,Pe=w>0?" ":"";return X===$?(0,a.jsxs)(n,{children:[Pe,(0,a.jsx)(n,{backgroundColor:r.assuranceAccent,color:"#0d1117",bold:!0,children:` ${h[X]} `})]},D.id):(0,a.jsxs)(n,{children:[Pe,t.resolution[X]?(0,a.jsxs)(n,{children:[(0,a.jsx)(n,{color:r.green,children:"\u2713 "}),(0,a.jsx)(n,{color:r.dim,children:h[X]})]}):(0,a.jsx)(n,{color:r.dim,children:`\u25CB ${h[X]}`})]},D.id)}),ce.hi<t.questions.length-1?(0,a.jsx)(n,{color:r.dim,children:" \u25B6"}):null]})}):null,(0,a.jsx)(n,{children:" "}),z,j]})}var A=V(Q(),1),Bn={high:0,med:1,low:2},jr={high:r.red,med:"yellow",low:r.dim};function Fr(t){return t.map((o,l)=>({r:o,i:l})).sort((o,l)=>(Bn[o.r.risk??"zz"]??3)-(Bn[l.r.risk??"zz"]??3)||o.i-l.i).map(({r:o})=>o)}function En({rows:t,width:o=120,badgeHeader:l="risk"}){if(t.length===0)return null;let u=Fr(t),g=B=>B.staged||!B.id?"(staged)":yn(B.id),x=Math.max(2,...u.map(B=>g(B).length)),f=Math.max(l.length,...u.map(B=>(B.badge??"").length)),p=o>=84&&u.some(B=>B.summary),M=o-(p?13:10)-x-f,v=Math.max(...u.map(B=>Math.max(B.title.length,(B.marker??"").length)),5),T=Math.max(5,p?Math.min(v,Math.max(16,Math.floor(M*.5))):Math.min(v,M)),W=p?Math.max(7,M-T):0,$=(B,P,O,H)=>vn(B,P,O,H.map(K=>K.length)),I=(B,P,O,H)=>[Oe(le(B,x),x),Oe(le(P,T),T),Oe(le(O,f),f),...p?[Oe(le(H,W),W)]:[]],N=I("id","title",l,"summary"),L=[];L.push((0,A.jsx)(n,{color:r.dim,children:$("\u250C","\u252C","\u2510",N)},"t")),L.push((0,A.jsxs)(n,{children:[N.map((B,P)=>(0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:P===0?"\u2502 ":" \u2502 "}),(0,A.jsx)(n,{bold:!0,children:B})]},P)),(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},"h")),L.push((0,A.jsx)(n,{color:r.dim,children:$("\u251C","\u253C","\u2524",N)},"m"));for(let[B,P]of u.entries()){let O=I(g(P),le(P.title,T),le(P.badge??"",f),le(P.summary??"",W)),H=P.badgeColor??jr[P.badge??""]??r.dim;if(L.push((0,A.jsxs)(n,{children:[(0,A.jsx)(n,{color:r.dim,children:"\u2502 "}),(0,A.jsx)(n,{color:r.assuranceAccent,children:O[0]}),(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[1],(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),(0,A.jsx)(n,{color:H,children:O[2]}),p?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(n,{color:r.dim,children:" \u2502 "}),O[3]]}):null,(0,A.jsx)(n,{color:r.dim,children:" \u2502"})]},`r-${B}`)),P.marker){let K=I("",le(P.marker,T),"","");L.push((0,A.jsx)(n,{color:r.dim,children:`\u2502 ${K.join(" \u2502 ")} \u2502`},`mk-${B}`))}}return L.push((0,A.jsx)(n,{color:r.dim,children:$("\u2514","\u2534","\u2518",N)},"b")),(0,A.jsx)(A.Fragment,{children:L})}var y=V(Q(),1);function Wr(t){let o=t.form==="assumed"?" (assumed)":t.form==="deferred"?"":" (you)",l=t.note?` \u2014 ${t.note}`:"";return t.form==="deferred"?`\u21B3 deferred q${t.qNum} ${t.stub}${l}`:t.form==="changed"?`\u21B3 changed q${t.qNum} ${t.stub}: ${t.prev??"?"} \u2192 ${t.choice??"?"}${o}${l}`:`\u21B3 ${t.form} q${t.qNum} ${t.stub}: ${t.choice??"?"}${o}${l}`}var Vr=()=>(process.stdout?.columns??100)-12;function Mn({block:t,annotations:o}){let l=t.era??0,u=Nr(t,o??null);return l>0?(0,y.jsx)(k,{marginLeft:l*2,children:u}):u}function Nr(t,o){switch(t.kind){case"banner":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{bold:!0,color:r.assuranceAccent,children:` ${t.text}`})});case"user":return(0,y.jsxs)(k,{marginTop:1,children:[(0,y.jsx)(n,{color:r.orange,children:"\u276F "}),(0,y.jsx)(n,{children:t.text})]});case"note":return(0,y.jsx)(n,{color:r.dim,children:` ${t.text}`});case"agent":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(pn,{text:t.text,accent:r.assuranceAccent})});case"worked":return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsx)(n,{color:r.dim,children:` \u2699 ${wn(t.durS,t.toolCalls,t.tools)}`})});case"usage":return(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.credits.toFixed(1)} credits \u2014 total ${t.total.toFixed(1)}`});case"turn":{let l=o,u=l?l.fresh:t.items.map((v,T)=>({item:v,num:T+1,updated:!1})),g={usecase:"risk","use-case":"risk",ac:"check",scenario:"kind",test:"check",gap:"severity",stylenote:"kind"},x=v=>v.kind??"use-case",f=new Map;for(let v of u){let T=v.item,W=x(v.item),$=T.risk==="high"||T.risk==="med"||T.risk==="low"?T.risk:void 0,I={id:T.logical_id??"",staged:!T.logical_id,title:T.title,badge:T.badge??T.risk??"",summary:T.why??T.summary??T.description??"",...$?{risk:$}:{},...v.updated?{marker:"\u21B3 changed"}:{}},N=f.get(W)??[];N.push(I),f.set(W,N)}let p=u.some(v=>!!v.item.kind),C=(l?.unchanged??[]).reduce((v,T)=>v+T.count,0),M=l?.headerStats?` \u2014 ${l.headerStats}${C>0?` (${C} unchanged)`:""}`:"";return(0,y.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(0,y.jsxs)(n,{bold:!0,children:[p?"design":t.heading,M?(0,y.jsx)(n,{bold:!1,color:r.dim,children:M}):null]}),[...f.entries()].map(([v,T])=>(0,y.jsxs)(k,{flexDirection:"column",children:[f.size>1?(0,y.jsx)(n,{color:r.dim,children:`${nt(v)} \xB7 ${T.length}`}):null,(0,y.jsx)(En,{rows:T,width:Vr(),badgeHeader:g[v]??"info"})]},v)),l&&l.unchanged.length>0&&(0,y.jsx)(n,{color:r.dim,children:` \u22EE unchanged: ${l.unchanged.map(v=>`${v.count} ${v.label}`).join(" \xB7 ")}`})]})}case"answer":return(0,y.jsx)(n,{color:r.dim,children:Wr(t.receipt)});case"continued":return(0,y.jsx)(n,{color:r.dim,children:"\u21B3 continued"});case"childOpen":{let{ing:l}=Rt(t.verb);return(0,y.jsx)(k,{marginTop:1,children:(0,y.jsxs)(n,{color:r.assuranceAccent,children:[`\u25CF ${l} ${t.subject}`,t.sid?(0,y.jsx)(n,{color:r.dim,children:` \u2014 ${t.sid}`}):null,t.note?(0,y.jsx)(n,{color:r.dim,children:` ${t.note}`}):null]})})}case"childClose":{let{ed:l}=Rt(t.verb);if(!t.ok)return(0,y.jsxs)(n,{color:r.red,children:[`\u25CF ${t.verb} failed \u2014 ${t.exitCode!=null?`exited ${t.exitCode}`:"error"}`,t.fixCmd?(0,y.jsx)(n,{color:r.dim,children:` \xB7 ${t.fixCmd}`}):null]});let u=[bn(t.durS),...t.results?[t.results]:[],...t.credits!==void 0?[`${t.credits.toFixed(1)} credits`]:[]].join(" \xB7 ");return(0,y.jsx)(n,{color:r.green,children:`\u25CF ${l} ${t.subject} \u2014 ${u}`})}case"childBack":return(0,y.jsx)(n,{color:r.dim,children:`back with ${t.parentVerb} \u2014 ${t.context}`});case"commit":return(0,y.jsxs)(k,{flexDirection:"column",children:[(0,y.jsx)(n,{color:t.ok?r.green:r.red,children:` ${t.ok?"\u2714":"\u2717"} ${t.line}`}),(t.warnings??[]).map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:` \u26A0 ${l}`},`w-${u}`))]});case"error":return(0,y.jsxs)(mn,{variant:"error",paddingX:1,children:[(0,y.jsx)(n,{color:r.red,children:t.title}),t.detail.map((l,u)=>(0,y.jsx)(n,{color:r.dim,children:l},`d-${u}`))]})}}var Te=V(Q(),1);function An({item:t}){return(0,Te.jsxs)(k,{flexDirection:"column",marginLeft:2,children:[(t.cite??[]).map((o,l)=>(0,Te.jsx)(n,{dimColor:!0,children:`cite ${o.anchor??"conv"} \u2014 "${o.quote??""}"`},`cite-${l}`)),(t.depends_on_hint??[]).length>0&&(0,Te.jsx)(n,{dimColor:!0,children:`depends on: ${(t.depends_on_hint??[]).join(", ")}`}),Object.entries(t.extra??{}).map(([o,l])=>(0,Te.jsx)(n,{dimColor:!0,children:`${o}: ${l}`},`extra-${o}`))]})}var R=V(Q(),1),Mt=(t,o)=>Math.max(0,Math.min(o,t));function ot(t,o,l){switch(o.type){case"move":return t.level==="detail"?{...t,scroll:Math.max(0,(t.scroll??0)+o.delta)}:{...t,cursor:Mt(t.cursor+o.delta,Math.max(0,l-1))};case"enter":return t.level==="list"?{...t,level:"detail",scroll:0}:t;case"back":return t.level==="detail"?{...t,level:"list",scroll:0}:null}}var On={"use-case":"use-cases",ac:"acs",scenario:"scenarios",test:"tests",gap:"gaps"};function _n(t,o){if(t.level==="detail")return{level:"detail",cursor:Mt(t.num-1,Math.max(0,o.entries.length-1))};if(t.section){let l=o.entries.findIndex(u=>On[u.kind]===t.section);if(l>=0)return{level:"list",cursor:l}}return{level:"list",cursor:0}}function Kr(t){let o=[];for(let l of t.entries){let u=o.find(g=>g.kind===l.kind);u?u.entries.push(l):o.push({kind:l.kind,entries:[l]})}return o}var Ln=3;function Ur({items:t,cursor:o,verb:l,more:u}){let g=`view \xB7 ${l} so far \xB7 ${t.counts.map(f=>`${f.count} ${f.count===1?f.label.replace(/s$/,""):f.label}`).join(" \xB7 ")}`,x=t.entries[o];return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,color:r.assuranceAccent,children:g}),Kr(t).map(({kind:f,entries:p})=>{let C=x?.kind===f,M=C?p.findIndex($=>$.ref===x.ref):-1,v=C?Mt(M-1,Math.max(0,p.length-Ln)):0,T=p.slice(v,v+(C?Ln:1)),W=p.length-T.length;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{color:r.dim,children:`${On[f]??nt(f)} \xB7 ${p.length}`}),T.map($=>{let I=C&&$.ref===x.ref,N=$.item.badge;return(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:I?"\u203A ":" "}),(0,R.jsx)(n,{children:`${$.num} \xB7 ${$.item.title}`}),N?(0,R.jsx)(n,{color:r.dim,children:` \xB7 ${N}`}):null]},`${$.kind}:${$.ref}`)}),W>0&&(0,R.jsx)(n,{color:r.dim,children:` \u22EE ${W} more`})]},f)}),u?(0,R.jsxs)(n,{children:[(0,R.jsx)(n,{color:r.assuranceAccent,children:o===t.entries.length?"\u203A ":" "}),(0,R.jsx)(n,{color:r.dim,children:`\u22EF show all \u2014 ${u.hidden} more from earlier turns`})]}):null]})}var st=14;function Qr({items:t,cursor:o,explain:l,grandTotal:u,dossier:g,scroll:x=0}){let f=t.entries[o];if(!f)return(0,R.jsx)(n,{color:r.dim,children:"nothing to show"});if(g){let C=Math.max(0,Math.min(x,Math.max(0,g.lines.length-st))),M=g.lines.slice(C,C+st);return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsxs)(n,{bold:!0,children:[`view \xB7 ${g.id}`,g.id.toLowerCase()!==g.rawId?(0,R.jsx)(n,{bold:!1,color:r.dim,children:` \xB7 ${g.rawId}`}):null]}),(0,R.jsx)(n,{bold:!0,children:g.title}),C>0?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${C} above`}):null,M.map((v,T)=>(0,R.jsx)(n,{color:v.dim?r.dim:void 0,children:v.text},`dl-${T}`)),g.lines.length>C+st?(0,R.jsx)(n,{color:r.muted,children:`\u22EE ${g.lines.length-C-st} more`}):null]})}let p=f.item;return(0,R.jsxs)(k,{flexDirection:"column",children:[(0,R.jsx)(n,{bold:!0,children:`view \xB7 ${f.kind} ${f.num} of ${u??t.entries.length}`}),(0,R.jsx)(n,{children:f.item.title}),p.badge?(0,R.jsx)(n,{color:r.dim,children:`kind: ${p.badge}`}):null,p.why?(0,R.jsx)(n,{color:r.dim,children:p.why}):null,(0,R.jsx)(An,{item:f.item}),l?.map((C,M)=>(0,R.jsx)(n,{color:r.dim,children:C},`ex-${M}`)),(0,R.jsx)(n,{color:r.dim,children:"view-only \u2014 approvals happen in chat"})]})}function Pn({items:t,state:o,verb:l,more:u,explain:g,grandTotal:x,dossier:f=null}){return o.level==="list"?(0,R.jsx)(Ur,{items:t,cursor:o.cursor,verb:l,more:u}):(0,R.jsx)(Qr,{items:t,cursor:o.cursor,explain:g,grandTotal:x,dossier:f,scroll:o.scroll??0})}var J=V(Q(),1),At=14;function Hr(t){let o=[],l=null;for(let u of t)u.field!==l&&(l=u.field,o.push({kind:"field",field:l})),o.push({kind:"line",field:l,line:u});return o}function qn({title:t,lines:o,offset:l=0}){let u=Hr(o),g=Math.max(0,Math.min(l,Math.max(0,u.length-At))),x=u.slice(g,g+At),f=g,p=Math.max(0,u.length-g-At),C=`view \xB7 diff \xB7 ${t} \xB7 current \u2192 proposed`;return(0,J.jsxs)(k,{flexDirection:"column",children:[(0,J.jsx)(n,{bold:!0,color:r.assuranceAccent,children:C}),f>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${f} above`})}):null,x.map((M,v)=>M.kind==="field"?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:M.field==="criteria"?"criteria":M.field})},`r-${g+v}`):(0,J.jsx)(k,{paddingLeft:4,children:(0,J.jsx)(n,{color:M.line.op==="-"?"red":"green",children:`${M.line.op==="-"?"\u2212":"+"} ${M.line.text}`})},`r-${g+v}`)),p>0?(0,J.jsx)(k,{paddingLeft:2,children:(0,J.jsx)(n,{color:r.dim,children:`\u22EE ${p} more`})}):null]})}var zr={"use-cases":"use-cases",usecases:"use-cases","use-case":"use-cases",acs:"acs",ac:"acs",scenarios:"scenarios",scenario:"scenarios",tests:"tests",test:"tests",gaps:"gaps",gap:"gaps"};function jn(t){let o=(t??"").trim().toLowerCase();if(!o)return{level:"list"};if(/^\d+$/.test(o)){let u=parseInt(o,10);return u>=1?{level:"detail",num:u}:{error:"items are numbered from 1 \u2014 /view 1"}}let l=zr[o];return l?{level:"list",section:l}:{error:"try /view, /view <number>, or /view acs|scenarios|tests"}}var E=V(Q(),1),Xr=6,Fn=12;function Gr(t,o,l){let u=Math.max(20,o),g=[];for(let f of t.split(`
|
|
3
3
|
`)){if(f.length<=u){g.push(f);continue}let p="";for(let C of f.split(" "))p&&p.length+1+C.length>u?(g.push(p),p=C):p=p?`${p} ${C}`:C;g.push(p)}let x=Math.max(0,g.length-l);return{body:g.slice(-l).join(`
|
|
4
4
|
`),hidden:x}}function Wn(t){let o={key:"redesign",label:"re-design from scratch",detail:"replaces the current design"},l={key:"keep",label:"keep the existing design",detail:"back to the list"};return t.designed==="stale"?[{...o,detail:"the use-case changed since it was designed"},l]:[l,o]}function Xi({controller:t,verb:o="extract",onCtrlC:l,chain:u=null,inspect:g=null,reconcile:x=null,autoReview:f=!1,onReviewExit:p,meta:C=null}){let[,M]=(0,m.useState)(0),[v,T]=(0,m.useState)(!1),[W,$]=(0,m.useState)(null),[I,N]=(0,m.useState)(null),L=(0,m.useRef)(null),[B,P]=(0,m.useState)(null),O=(0,m.useRef)(null),H=e=>{O.current=e,P(e)},K=e=>{L.current=e,N(e),e===null&&H(null)},re=(0,m.useRef)([]),[S,$e]=(0,m.useState)(null),z=(0,m.useRef)(null),j=e=>{z.current=e,$e(e)},[h,ce]=(0,m.useState)(null),D=(0,m.useRef)(null),w=e=>{D.current=e,ce(e)},[X,Pe]=(0,m.useState)(null),Lt=(0,m.useRef)(null),he=e=>{Lt.current=e,Pe(e)},lt=(0,m.useRef)({approved:0,rejected:0,deferred:0}),Ce=(0,m.useRef)(!1),ae=(0,m.useRef)(null),Ot=fn(),{stdout:Vn}=Ze(),Nn=Vn?.columns??80,_t=(0,m.useRef)(0),ct=(0,m.useRef)(0);(0,m.useEffect)(()=>{let e=()=>{let i=t.state.ledger;for(let c=_t.current;c<i.length;c++){let d=i[c],b=d.kind==="turn"?Tn(t.state.turns,d.turnIndex):void 0;Ot.append((0,E.jsx)(Mn,{block:d,annotations:b},`lg-${c}`))}_t.current=i.length};e();let s=t.subscribe(()=>{e();let i=t.state;L.current&&(i.pending||i.status==="pausing")&&(K(null),i.pending&&$("questions arrived \u2014 back to chat")),M(c=>c+1)});return M(i=>i+1),s},[t,Ot]);let{thinking:ue,status:de,pending:_,confirm:qe,ledger:ie,activeTurn:Pt,stream:Kn,notice:je}=t.state,qt=(Kn?.text??"").trimEnd(),jt=qt.length>0,Un=v&&(ue.liveThinking.length>0||ue.thinkingLog.length>0),Qn=Gr(ue.liveThinking||ue.thinkingLog.map(e=>e.text).join(`
|
|
5
5
|
`),Nn-6,Fn),Ft=jt?qt.split(`
|
|
6
|
-
`).slice(-Xr):[];Pt&&(ct.current=Pt.turnIndex);let Hn=_?_.resolution.filter(e=>!e).length:0,at;for(let e=ie.length-1;e>=0;e--){if(re.current.some(i=>i.end!=null&&e>=i.start&&e<i.end))continue;let s=ie[e];if(s.kind==="banner"&&!s.text.startsWith("kane")){at=s.text;break}}let Re=ue.activity[ue.activity.length-1],zn=Re?Re.status==="decision"?Re.label:xn({name:Re.name,status:Re.status}):void 0,Wt=de==="streaming"||de==="working",[,Xn]=(0,m.useState)(0);dn(()=>Xn(e=>e+1),Wt||S?.kind==="running"||h?.st.kind==="running"?120:null);let Gn=t.state.busySince?Math.floor((Date.now()-t.state.busySince)/1e3):0,Yn=t.state.turns.some(e=>e.role==="agent"),[Jn,Zn]=(0,m.useState)(0),[er,tr]=(0,m.useState)(!1),[ut,nr]=(0,m.useState)(null),pe=(0,m.useRef)(0),Vt=(0,m.useRef)(!1),Nt=(0,m.useRef)(null),Se=e=>{pe.current=e,Zn(e)},Kt=e=>{Vt.current=e,tr(e)},xe=e=>{Nt.current=e,nr(e)},[Ie,rr]=(0,m.useState)(null),dt=(0,m.useRef)(null),ke=e=>{dt.current=e,rr(e)},[mt,ir]=(0,m.useState)(null),Ut=(0,m.useRef)(null),De=e=>{Ut.current=e,ir(e)},[Fe,sr]=(0,m.useState)(0),G=(0,m.useRef)(0),Be=e=>{G.current=e,sr(e)},Qt=_?_.questions[0]?.id??"b":null;(0,m.useEffect)(()=>{_&&Be(_.cursor<0?0:_.cursor)},[Qt,_?.cursor]);let We=()=>{let e=Z.current;if(!e)return;let s=e.questions.length;for(let i=1;i<=s;i++){let c=(G.current+i)%s;if(!e.resolution[c]){Be(c);return}}},Ve=_?_.questions[Math.max(0,Math.min(_.questions.length-1,Fe))]:void 0,te=(0,m.useRef)(Ve);te.current=Ve;let Z=(0,m.useRef)(_);Z.current=_;let or=_?`${Qt}:${Fe}`:null;(0,m.useEffect)(()=>{if(xe(null),ke(null),De(null),te.current){Kt(!0);let e=Z.current?.resolution[G.current]?.selected_index;Se(e??te.current.recommended_index??0)}else Kt(!1)},[or]);let Ne=e=>{let s=Z.current;return Et(e,s?tt(s)!=="":!1)},lr={isFocused:()=>Vt.current&&te.current!=null&&Nt.current==null&&dt.current==null&&Ut.current==null||D.current!=null&&D.current.st.kind!=="running"&&Lt.current==null||z.current!=null&&z.current.kind!=="running"||U.current&&cn.current==null,onMove:e=>{let s=te.current;if(s){Se(Math.max(0,Math.min(Ne(s).maxSel,pe.current+e)));return}let i=D.current;if(i){let d=i.items[i.i];if(i.st.kind==="card"&&d){let b=it(d.card)??rt(d.card).length-1;w({...i,st:{kind:"card",sel:Math.max(0,Math.min(b,i.st.sel+e))}});return}if(i.st.kind==="view"&&d){w({...i,st:{kind:"view",offset:Math.max(0,i.st.offset+e)}});return}if(i.st.kind==="offer"||i.st.kind==="done"){let b=i.st.kind==="offer"?1:Ge.current.length-1;w({...i,st:{...i.st,sel:Math.max(0,Math.min(b,i.st.sel+e))}});return}if(i.st.kind==="running"&&!U.current)return}let c=z.current;if(c?.kind==="picker"){j({...c,sel:Math.max(0,Math.min(c.items.length-1,c.sel+e))});return}if(c?.kind==="ask"||c?.kind==="confirm"||c?.kind==="failed"){let d=(c.kind==="ask"?He.current.length:c.kind==="failed"?ze.current.length:2)-1;j({...c,sel:Math.max(0,Math.min(d,c.sel+e))});return}c&&!U.current||U.current&&ye(Math.max(0,Math.min(Le.current.length-1,vt.current+e)))},onSelect:()=>{let e=te.current,s=Z.current;if(!e||!s){let d=D.current;if(d&&d.st.kind!=="running"){let q=d.items[d.i];if(d.st.kind==="card"&&q){let F=d.st.sel;if(F===it(q.card)){he("");return}let ge=rt(q.card)[F];if(!ge)return;if(ge.v==="view_diff"){w({...d,st:{kind:"view",offset:0}});return}let Er=ge.v==="approve"||ge.v==="archive"?"approve":ge.v==="skip"?"reject":"defer";xr(d,Er);return}if(d.st.kind==="view"){w({...d,st:{kind:"card",sel:0}});return}if(d.st.kind==="offer"){d.st.sel===0?rn(d,d.st.offer):we(d);return}if(d.st.kind==="done"){Ge.current[d.st.sel]?.key==="view"?Je(""):(w(null),p?.());return}return}if(d&&!U.current)return;let b=z.current;if(b?.kind==="picker"){let q=b.items[b.sel];q&&(q.designed?j({kind:"confirm",item:q,sel:0}):bt(q,!1));return}if(b?.kind==="confirm"){Wn(b.item)[b.sel]?.key==="redesign"?bt(b.item,!0):kt();return}if(b?.kind==="ask"){let q=He.current[b.sel]?.key;q==="another"?kt():q==="view"?Je(""):j(null);return}if(b?.kind==="failed"){let q=ze.current[b.sel]?.key;q==="retry"?bt(b.item,b.force):q==="view"?Je(""):j(null);return}if(b&&!U.current||!U.current)return;switch(Le.current[vt.current]?.key){case"reconcile-review":tn();return;case"finish":t.completeSession();return;case"continue":t.continueParked();return;case"design-chain":kt();return;case"view":Je("",ct.current);return;case"free":ve("");return}return}let i=Ne(e),c=pe.current;if(i.batchIdx!=null&&c===i.batchIdx){t.goWithRecommendations();return}if(i.freeIdx!=null&&c===i.freeIdx){xe("");return}if(i.doneIdx!=null&&c===i.doneIdx){t.confirmMulti(G.current),We();return}if(e.multi_select){t.toggleOption(G.current,c);return}if(e.options[c]?.input===!0){ke({opt:c,value:""});return}t.submitAnswer(G.current,c),We()},onLeft:()=>{Z.current&&Be(Math.max(0,G.current-1))},onRight:()=>{let e=Z.current;e&&Be(Math.min(e.questions.length-1,G.current+1))},onDigit:e=>{let s=te.current;if(s){e-1<s.options.length&&Se(e-1);return}let i=D.current;if(i){let d=i.items[i.i];if(i.st.kind==="card"&&d){e-1<rt(d.card).length&&w({...i,st:{kind:"card",sel:e-1}});return}if(i.st.kind==="offer"){e-1<2&&w({...i,st:{...i.st,sel:e-1}});return}if(i.st.kind==="done"){e-1<Ge.current.length&&w({...i,st:{...i.st,sel:e-1}});return}if(i.st.kind!=="running"||!U.current)return}let c=z.current;if(c?.kind==="picker"){e-1<c.items.length&&j({...c,sel:e-1});return}if(c?.kind==="ask"){e-1<He.current.length&&j({...c,sel:e-1});return}if(c?.kind==="failed"){e-1<ze.current.length&&j({...c,sel:e-1});return}if(c?.kind==="confirm"){e-1<2&&j({...c,sel:e-1});return}if(!(c&&!U.current)&&U.current){let d=Le.current,b=0;for(let Y=0;Y<d.length;Y++)if(!d[Y].free&&(b+=1,b===e)){ye(Y);return}}},isMulti:()=>{let e=te.current;return!!e?.multi_select&&pe.current<(e?.options.length??0)},onSpace:()=>{Z.current&&t.toggleOption(G.current,pe.current)},onTab:()=>{let e=te.current;if(!e)return;let s=Ne(e);s.batchIdx!=null&&Se(s.batchIdx)},onType:e=>{let s=te.current;if(s){if(e==="@"&&t.canIngest()){De("");return}let c=pe.current;if(s.options[c]?.input===!0){ke({opt:c,value:e});return}if(!s.allow_free_text)return;let d=Ne(s);Se(d.freeIdx??0),xe(e);return}let i=D.current;if(i){if(i.st.kind==="card"){let c=it(i.items[i.i].card);c!=null&&(w({...i,st:{kind:"card",sel:c}}),he(e));return}if(i.st.kind!=="running"||!U.current)return}if(!(z.current&&!U.current)&&U.current){let c=wn(Le.current);if(c==null)return;ye(c),ve(e)}},onBack:()=>{let e=D.current;if(e){e.st.kind==="view"?w({...e,st:{kind:"card",sel:0}}):e.st.kind==="offer"?we(e):e.st.kind==="done"&&(w(null),p?.());return}let s=z.current;if(s&&s.kind!=="running"){j(null);return}let i=Z.current;if(i){for(let c=G.current-1;c>=0;c--)if(i.resolution[c]){Be(c);return}}}},cr=ut!=null?{value:ut,onChange:e=>xe(e),onSubmit:e=>{xe(null),e.trim()&&Z.current&&(t.submitFreeText(G.current,e),We())},onCancel:()=>xe(null)}:null,ar=mt!=null?{value:mt,onChange:e=>De(e),onSubmit:e=>{De(null),e.trim()&&t.ingestAttach(e)},onCancel:()=>De(null)}:null,ur=Ie!=null?{optionIndex:Ie.opt,value:Ie.value,onChange:e=>ke({opt:Ie.opt,value:e}),onSubmit:e=>{let s=dt.current?.opt;ke(null),s!=null&&Z.current&&(t.submitAnswerWithText(G.current,s,e),We())},onCancel:()=>ke(null)}:null,Ke=(0,m.useRef)(!1),ft=l??(()=>t.requestPause()),Ht=()=>{if(Ce.current&&!Ke.current){Ke.current=!0,$("finishing the verdict \u2014 exiting once it lands (ctrl+c again = force)");return}ft()},se=t.state.checkpoint,Ee=S?.kind==="running"&&de==="idle",gt=h?.st.kind==="running"&&de==="idle"&&ae.current!=null,fe=de==="idle"&&Yn&&!_&&!I&&(!S||Ee)&&(!h||gt),U=(0,m.useRef)(!1);U.current=fe;let ee=_e(t.state.turns).entries.length,Me,ne;for(let e=ie.length-1;e>=0;e--){if(re.current.some(i=>i.end!=null&&e>=i.start&&e<i.end))continue;let s=ie[e];if(!Me&&s.kind==="commit"&&s.ok&&(Me=s.line),!ne&&s.kind==="banner"&&s.text.startsWith("designing: ")&&(ne=s.text.slice(11)),Me&&ne)break}let ht;for(let e=ie.length-1;e>=0;e--){let s=ie[e];if(s.kind==="user")break;if(s.kind==="commit"&&s.ok&&/\bapplied\b/.test(s.line)){ht=s.line;break}}let oe=ne?{"acceptance criteria":"scenarios",scenarios:"acceptance criteria + exercises","acceptance criteria + exercises":"tests + gaps"}[ne]:void 0,zt={"acceptance criteria":"the promises every path of this use-case must keep",scenarios:"the concrete user journeys that exercise those promises","acceptance criteria + exercises":"the wiring pass \u2014 per-journey checks, tied to the promises each journey exercises","tests + gaps":"runnable browser tests \u2014 anything unautomatable is recorded as a gap"},Xt=ne?zt[ne]:void 0,Gt=oe?zt[oe]:void 0,dr="phases: acceptance criteria \u2192 scenarios \u2192 wiring \u2192 tests \xB7 stop anytime with finish",mr=(()=>{for(let e=ie.length-1;e>=0;e--){let s=ie[e];if(s.kind==="agent")return s.text}return null})(),be=/\?\s*$/.test((mr??"").trimEnd()),Yt=o==="design"&&!se&&(be||oe!==void 0),Jt=ne==="tests + gaps",Ue=S?.kind==="running"?S.title:"the design",Zt=!!t.state.error&&!t.senderAlive(),fr=Ee?"\u25CF design \xB7 ":gt?`\u25CF ${ae.current??"design"} \xB7 `:"",gr=qe?"the agent needs a clarification before it can apply that":Ee&&!se?be?`${Ue} \u2014 the agent asked a question`:ht?`${Ue} \u2014 ${ht}`:Jt?`${Ue} \u2014 design complete`:`${Ue} \u2014 the agent is waiting on you`:se?ne?`${ne} done${oe?` \u2014 next: ${oe}`:""}`:Me??"phase done":Zt?"the agent stopped \u2014 the session is view-only":Yt?be?"the agent asked a question \u2014 answer or continue":`design incomplete \u2014 ${oe} not started`:Me??"waiting on you",[Ae,hr]=(0,m.useState)(null),pr=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(!x)return;let e=fe||se?x.pending():null;pr.current=e,hr(e)},[fe,se,ie.length,h==null]);let en=Ae?[{key:"reconcile-review",label:Ae.kind==="cards"?`review ${Ae.count} change(s) from ${Ae.source}`:`review change(s) detected in ${Ae.source}`}]:[],Qe=qe?[{key:"free",label:"clarify \u2014 type which one you meant",free:!0}]:Ee&&!se?Jt&&!be?[{key:"finish",label:"finish this design"},...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"free",label:"reply \u2014 tell the agent what to change",free:!0}]:[{key:"continue",label:be?"continue \u2014 go with your suggestion":"continue designing"},...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"finish",label:"finish this design"},{key:"free",label:"reply \u2014 tell the agent what to change",free:!0}]:se?[...en,{key:"continue",label:oe?`continue to ${oe}`:"continue"},...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"finish",label:"finish here"},{key:"free",label:"adjust \u2014 tell me what to change",free:!0}]:Zt?[...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"free",label:"tell me what to change",free:!0}]:Yt?[{key:"continue",label:be?"continue \u2014 go with your suggestion":`continue \u2014 ${oe} next`},...ee>0?[{key:"view",label:"view the design"}]:[],{key:"finish",label:"finish anyway"},{key:"free",label:"reply \u2014 answer and continue",free:!0}]:[...en,{key:"finish",label:o==="design"?"finish":"looks good \u2014 finish the session"},...u?[{key:"design-chain",label:"design tests for a use-case\u2026"}]:[],...ee>0?[{key:"view",label:o==="design"?"view the design":`view the ${ee} draft${ee===1?"":"s"}`}]:[],{key:"free",label:o==="design"?"keep adjusting \u2014 tell me what to change":"tell me what to change",free:!0}],pt=[{key:"another",label:"design another use-case\u2026"},...ee>0?[{key:"view",label:"view what was designed"}]:[],{key:"back",label:"done \u2014 back"}],He=(0,m.useRef)(pt);He.current=pt;let xt=[{key:"retry",label:"try again"},...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"back",label:"back"}],ze=(0,m.useRef)(xt);ze.current=xt;let Xe=[...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"back",label:"back to the check-in"}],Ge=(0,m.useRef)(Xe);Ge.current=Xe;let kt=()=>{let e=u?.listUcs()??[];if(e.length===0){$("no use-cases to design yet");return}j({kind:"picker",items:e,sel:0})},bt=(e,s)=>{let i={start:t.state.ledger.length,end:null};re.current.push(i);let c=()=>{i.end=t.state.ledger.length};j({kind:"running",title:e.title,item:e,force:s,startedAt:Date.now()}),u.runDesignChild(e.key,s).then(d=>{c(),j(d===0?{kind:"ask",title:e.title,sel:0}:{kind:"failed",item:e,force:s,detail:`child exited ${d}`,sel:0})}).catch(d=>{c();let b=d instanceof Error?d.message:String(d);t.ledger({kind:"childClose",verb:"design",subject:e.title,ok:!1,durS:Math.max(1,Math.round((Date.now()-(z.current?.kind==="running"?z.current.startedAt:Date.now()))/1e3))}),t.note(b),j({kind:"failed",item:e,force:s,detail:b,sel:0})})},tn=()=>{if(D.current?.st.kind==="running")return;let e=x?.pending();if(!e){$("nothing awaiting review");return}if(lt.current={approved:0,rejected:0,deferred:0},e.kind==="needs-run"){w({items:[],i:0,st:{kind:"running",label:`reviewing changes in ${e.source}`,startedAt:Date.now()}}),x.startReview(e.source).then(()=>{let i=x.loadCards();if(i.length===0){t.note("no reviewable changes came back \u2014 the source may be unchanged"),w(null);return}w({items:i,i:0,st:{kind:"card",sel:0}})}).catch(i=>{t.note(`the review run failed \u2014 ${i instanceof Error?i.message:String(i)}`),w(null)});return}let s=x.loadCards();if(s.length===0){$("nothing awaiting review");return}w({items:s,i:0,st:{kind:"card",sel:0}})},nn=e=>{let s=lt.current,i=`${s.approved} approved \xB7 ${s.rejected} rejected \xB7 ${s.deferred} deferred`;w({...e,st:{kind:"done",sel:0,summary:i}})},we=e=>{if(e.i+1<e.items.length){w({...e,i:e.i+1,st:{kind:"card",sel:0}});return}let s=x?.loadCards()??[];s.length===0?nn(e):w({items:s,i:0,st:{kind:"card",sel:0}})},rn=(e,s)=>{if(!u){we(e);return}ae.current=s.kind;let i={start:t.state.ledger.length,end:null};re.current.push(i),w({...e,st:{kind:"running",label:`${s.kind==="evolve"?"Evolving":"Designing"} ${s.title}`,startedAt:Date.now()}}),u.runDesignChild(s.key,s.kind==="evolve",s.kind).then(()=>{ae.current=null,i.end=t.state.ledger.length,we(D.current??e)}).catch(c=>{ae.current=null,i.end=t.state.ledger.length,t.ledger({kind:"childClose",verb:s.kind,subject:s.title,ok:!1,durS:1}),t.note(c instanceof Error?c.message:String(c)),we(D.current??e)})},xr=(e,s,i)=>{let c=e.items[e.i];!c||Ce.current||(Ce.current=!0,x.applyVerdict(c.key,s,i).then(d=>{if(Ce.current=!1,Ke.current){ft();return}let b=D.current??e;if(!d.ok){t.note(d.refusal);let Y=x.loadCards();Y.length===0?nn(b):w({items:Y,i:Math.min(b.i,Y.length-1),st:{kind:"card",sel:0}});return}lt.current[s==="approve"?"approved":s==="reject"?"rejected":"deferred"]+=1,t.ledger({kind:"commit",ok:!0,line:d.line}),d.note&&t.note(d.note),d.offer?rn(b,d.offer):we(b)}).catch(d=>{if(Ce.current=!1,Ke.current){ft();return}t.note(`the verdict did not land \u2014 ${d instanceof Error?d.message:String(d)}; try the card again`)}))},kr=e=>{x?.noteSteer?.(),w(null),he(null),$(null),t.submit(e)},br=X!=null?{value:X,onChange:e=>he(e),onSubmit:e=>{let s=e.trim();s?kr(s):he(null)},onCancel:()=>he(null)}:null,sn=(0,m.useRef)(!1);(0,m.useEffect)(()=>{!f||sn.current||(sn.current=!0,x?.pending()?tn():p?.())},[f]);let Le=(0,m.useRef)(Qe);Le.current=Qe;let wt=fe&&se&&Xt!==void 0,yt=re.current.find(e=>e.end==null)?.start??"top",on=(0,m.useRef)(new Set),[wr,ln]=(0,m.useState)(!1);(0,m.useEffect)(()=>{wt?on.current.has(yt)||(on.current.add(yt),ln(!0)):ln(!1)},[wt,yt]);let yr=wt?[...wr?[dr]:[],`${Xt}${Gt?` \xB7 next: ${Gt}`:""}`]:[],[vr,Tr]=(0,m.useState)(0),[Ye,$r]=(0,m.useState)(null),vt=(0,m.useRef)(0),cn=(0,m.useRef)(null),ye=e=>{vt.current=e,Tr(e)},ve=e=>{cn.current=e,$r(e)},Cr=`${fe}:${se}:${ct.current}`;(0,m.useEffect)(()=>{ye(0),ve(null)},[Cr]);let Rr=Ye!=null?{value:Ye,onChange:e=>ve(e),onSubmit:e=>{ve(null),ye(0);let s=e.trim();s&&($(null),t.submit(s))},onCancel:()=>{ve(null),ye(0)}}:null,Je=(e,s)=>{if(/^(uc|sc|ac|t|gap|sty)-\d+$/i.test(e.trim())){let b=e.trim().toLowerCase(),q=_e(t.state.turns).entries.findIndex(F=>(F.item.logical_id??"").toLowerCase()===b);if(q<0){$(`${e.trim().toUpperCase()} isn't in this session's items \u2014 view lists what this session minted`);return}K({level:"detail",cursor:q,scroll:0}),H(null);return}let i=jn(e);if("error"in i){$(i.error);return}let c=_e(t.state.turns);if(c.entries.length===0){$("nothing proposed yet \u2014 the first turn is still coming");return}if(i.level==="detail"&&i.num>c.entries.length){$(`no item ${i.num} \u2014 the set has ${c.entries.length} item${c.entries.length===1?"":"s"}`);return}let d=s!=null?St(c,s):c;K(_n(i,d)),H(s!=null&&d.entries.length<c.entries.length?s:null)},Tt=jt?"writing":zn??(t.state.workingLabel?It(t.state.workingLabel):o==="design"?"designing":"thinking"),Sr=ue.liveThinking.length>0||ue.thinkingLog.length>0,$t=S?.kind==="running"?{verb:"design"}:h?.st.kind==="running"&&ae.current?{verb:ae.current}:void 0,Ir=_?{kind:"waiting",pending:Hn}:de==="pausing"?{kind:"working",step:"pausing \u2014 saving session"}:S?.kind==="running"?Ee?{kind:"child-waiting"}:{kind:"child-working",step:Tt}:h?.st.kind==="running"?gt?{kind:"child-waiting"}:ae.current?{kind:"child-working",step:Tt}:{kind:"working",step:It(h.st.label)}:h?.st.kind==="card"&&h.items.length>0?{kind:"card",n:h.i+1,m:h.items.length}:S||h?{kind:"idle"}:Wt?{kind:"working",step:Tt,elapsedS:Gn}:{kind:"idle"},Dr=ut!=null||Ie!=null||mt!=null||X!=null||Ye!=null,an=h?h.items[h.i]:void 0,Br=[...Dr?["\u23CE submit","esc back"]:I?I.level==="list"?["\u2191\u2193 move","\u23CE open","esc back"]:["\u2191\u2193 scroll","esc back"]:_&&Ve?Sn(Ve,{batchCount:_.questions.length,canAttach:t.canIngest(),escBack:_.resolution.slice(0,Fe).some(e=>!!e)}).keys:h?.st.kind==="card"&&an?In(an.card).keys:h?.st.kind==="view"?["\u2191\u2193 scroll","esc back"]:h?.st.kind==="offer"?["\u2191\u2193 select","\u23CE confirm","esc later"]:h?.st.kind==="done"?Bt(Xe,{escBack:!0}).keys:S?.kind==="picker"||S?.kind==="confirm"||S?.kind==="ask"||S?.kind==="failed"?["\u2191\u2193 select","\u23CE confirm","esc back"]:fe?Bt(Qe,{escBack:!1}).keys:[],...Sr?["ctrl+t thinking"]:[],de==="pausing"?"ctrl+c force quit":"ctrl+c exit"],Ct=C??{verb:o,sid:"",env:""},un=(0,E.jsx)($n,{status:Ir,meta:{...Ct,...at??Ct.subject?{subject:at??Ct.subject}:{}},tallies:Rn(t.state,o),keys:Br,child:$t});if(I){let e=_e(t.state.turns),s=B!=null?St(e,B):e,i=e.entries.length-s.entries.length,c=I.level==="list"&&i>0,d=s.entries.length+(c?1:0),b=s.entries[I.cursor],Y=I.level==="detail"&&b?t.explainLines(b.item.slug??b.item.temp_ref):null,q=I.level==="detail"&&b&&g?g(b.item.logical_id??t.aliasOf(b.item.temp_ref)??b.item.temp_ref):null;return(0,E.jsxs)(k,{flexDirection:"column",children:[(0,E.jsx)(Dt,{onToggleThinking:()=>T(F=>!F),onCtrlC:Ht,explorer:{isOpen:()=>L.current!==null,onMove:F=>K(L.current&&ot(L.current,{type:"move",delta:F},d)),onEnter:()=>{let F=L.current;if(F){if(F.level==="list"&&c&&F.cursor===s.entries.length){H(null);return}K(ot(F,{type:"enter"},d))}},onBack:()=>{K(L.current&&ot(L.current,{type:"back"},d)),setTimeout(()=>M(F=>F+1),0)}}}),(0,E.jsx)(Pn,{items:s,state:I,verb:o,more:c?{hidden:i}:null,explain:Y,grandTotal:e.entries.length,dossier:q}),(je??W)&&(je??W).split(`
|
|
7
|
-
`).map((F,ge)=>(0,E.jsx)(n,{color:r.orange,children:F},`nt-${ge}`)),un]})}return(0,E.jsxs)(k,{flexDirection:"column",children:[(0,E.jsx)(Dt,{onToggleThinking:()=>T(e=>!e),onCtrlC:Ht,panel:lr}),Un&&(0,E.jsx)(
|
|
6
|
+
`).slice(-Xr):[];Pt&&(ct.current=Pt.turnIndex);let Hn=_?_.resolution.filter(e=>!e).length:0,at;for(let e=ie.length-1;e>=0;e--){if(re.current.some(i=>i.end!=null&&e>=i.start&&e<i.end))continue;let s=ie[e];if(s.kind==="banner"&&!s.text.startsWith("kane")){at=s.text;break}}let Re=ue.activity[ue.activity.length-1],zn=Re?Re.status==="decision"?Re.label:kn({name:Re.name,status:Re.status}):void 0,Wt=de==="streaming"||de==="working",[,Xn]=(0,m.useState)(0);dn(()=>Xn(e=>e+1),Wt||S?.kind==="running"||h?.st.kind==="running"?120:null);let Gn=t.state.busySince?Math.floor((Date.now()-t.state.busySince)/1e3):0,Yn=t.state.turns.some(e=>e.role==="agent"),[Jn,Zn]=(0,m.useState)(0),[er,tr]=(0,m.useState)(!1),[ut,nr]=(0,m.useState)(null),pe=(0,m.useRef)(0),Vt=(0,m.useRef)(!1),Nt=(0,m.useRef)(null),Se=e=>{pe.current=e,Zn(e)},Kt=e=>{Vt.current=e,tr(e)},xe=e=>{Nt.current=e,nr(e)},[Ie,rr]=(0,m.useState)(null),dt=(0,m.useRef)(null),ke=e=>{dt.current=e,rr(e)},[mt,ir]=(0,m.useState)(null),Ut=(0,m.useRef)(null),De=e=>{Ut.current=e,ir(e)},[Fe,sr]=(0,m.useState)(0),G=(0,m.useRef)(0),Be=e=>{G.current=e,sr(e)},Qt=_?_.questions[0]?.id??"b":null;(0,m.useEffect)(()=>{_&&Be(_.cursor<0?0:_.cursor)},[Qt,_?.cursor]);let We=()=>{let e=Z.current;if(!e)return;let s=e.questions.length;for(let i=1;i<=s;i++){let c=(G.current+i)%s;if(!e.resolution[c]){Be(c);return}}},Ve=_?_.questions[Math.max(0,Math.min(_.questions.length-1,Fe))]:void 0,te=(0,m.useRef)(Ve);te.current=Ve;let Z=(0,m.useRef)(_);Z.current=_;let or=_?`${Qt}:${Fe}`:null;(0,m.useEffect)(()=>{if(xe(null),ke(null),De(null),te.current){Kt(!0);let e=Z.current?.resolution[G.current]?.selected_index;Se(e??te.current.recommended_index??0)}else Kt(!1)},[or]);let Ne=e=>{let s=Z.current;return Et(e,s?tt(s)!=="":!1)},lr={isFocused:()=>Vt.current&&te.current!=null&&Nt.current==null&&dt.current==null&&Ut.current==null||D.current!=null&&D.current.st.kind!=="running"&&Lt.current==null||z.current!=null&&z.current.kind!=="running"||U.current&&cn.current==null,onMove:e=>{let s=te.current;if(s){Se(Math.max(0,Math.min(Ne(s).maxSel,pe.current+e)));return}let i=D.current;if(i){let d=i.items[i.i];if(i.st.kind==="card"&&d){let b=it(d.card)??rt(d.card).length-1;w({...i,st:{kind:"card",sel:Math.max(0,Math.min(b,i.st.sel+e))}});return}if(i.st.kind==="view"&&d){w({...i,st:{kind:"view",offset:Math.max(0,i.st.offset+e)}});return}if(i.st.kind==="offer"||i.st.kind==="done"){let b=i.st.kind==="offer"?1:Ge.current.length-1;w({...i,st:{...i.st,sel:Math.max(0,Math.min(b,i.st.sel+e))}});return}if(i.st.kind==="running"&&!U.current)return}let c=z.current;if(c?.kind==="picker"){j({...c,sel:Math.max(0,Math.min(c.items.length-1,c.sel+e))});return}if(c?.kind==="ask"||c?.kind==="confirm"||c?.kind==="failed"){let d=(c.kind==="ask"?He.current.length:c.kind==="failed"?ze.current.length:2)-1;j({...c,sel:Math.max(0,Math.min(d,c.sel+e))});return}c&&!U.current||U.current&&ye(Math.max(0,Math.min(Le.current.length-1,vt.current+e)))},onSelect:()=>{let e=te.current,s=Z.current;if(!e||!s){let d=D.current;if(d&&d.st.kind!=="running"){let q=d.items[d.i];if(d.st.kind==="card"&&q){let F=d.st.sel;if(F===it(q.card)){he("");return}let ge=rt(q.card)[F];if(!ge)return;if(ge.v==="view_diff"){w({...d,st:{kind:"view",offset:0}});return}let Er=ge.v==="approve"||ge.v==="archive"?"approve":ge.v==="skip"?"reject":"defer";xr(d,Er);return}if(d.st.kind==="view"){w({...d,st:{kind:"card",sel:0}});return}if(d.st.kind==="offer"){d.st.sel===0?rn(d,d.st.offer):we(d);return}if(d.st.kind==="done"){Ge.current[d.st.sel]?.key==="view"?Je(""):(w(null),p?.());return}return}if(d&&!U.current)return;let b=z.current;if(b?.kind==="picker"){let q=b.items[b.sel];q&&(q.designed?j({kind:"confirm",item:q,sel:0}):bt(q,!1));return}if(b?.kind==="confirm"){Wn(b.item)[b.sel]?.key==="redesign"?bt(b.item,!0):kt();return}if(b?.kind==="ask"){let q=He.current[b.sel]?.key;q==="another"?kt():q==="view"?Je(""):j(null);return}if(b?.kind==="failed"){let q=ze.current[b.sel]?.key;q==="retry"?bt(b.item,b.force):q==="view"?Je(""):j(null);return}if(b&&!U.current||!U.current)return;switch(Le.current[vt.current]?.key){case"reconcile-review":tn();return;case"finish":t.completeSession();return;case"continue":t.continueParked();return;case"design-chain":kt();return;case"view":Je("",ct.current);return;case"free":ve("");return}return}let i=Ne(e),c=pe.current;if(i.batchIdx!=null&&c===i.batchIdx){t.goWithRecommendations();return}if(i.freeIdx!=null&&c===i.freeIdx){xe("");return}if(i.doneIdx!=null&&c===i.doneIdx){t.confirmMulti(G.current),We();return}if(e.multi_select){t.toggleOption(G.current,c);return}if(e.options[c]?.input===!0){ke({opt:c,value:""});return}t.submitAnswer(G.current,c),We()},onLeft:()=>{Z.current&&Be(Math.max(0,G.current-1))},onRight:()=>{let e=Z.current;e&&Be(Math.min(e.questions.length-1,G.current+1))},onDigit:e=>{let s=te.current;if(s){e-1<s.options.length&&Se(e-1);return}let i=D.current;if(i){let d=i.items[i.i];if(i.st.kind==="card"&&d){e-1<rt(d.card).length&&w({...i,st:{kind:"card",sel:e-1}});return}if(i.st.kind==="offer"){e-1<2&&w({...i,st:{...i.st,sel:e-1}});return}if(i.st.kind==="done"){e-1<Ge.current.length&&w({...i,st:{...i.st,sel:e-1}});return}if(i.st.kind!=="running"||!U.current)return}let c=z.current;if(c?.kind==="picker"){e-1<c.items.length&&j({...c,sel:e-1});return}if(c?.kind==="ask"){e-1<He.current.length&&j({...c,sel:e-1});return}if(c?.kind==="failed"){e-1<ze.current.length&&j({...c,sel:e-1});return}if(c?.kind==="confirm"){e-1<2&&j({...c,sel:e-1});return}if(!(c&&!U.current)&&U.current){let d=Le.current,b=0;for(let Y=0;Y<d.length;Y++)if(!d[Y].free&&(b+=1,b===e)){ye(Y);return}}},isMulti:()=>{let e=te.current;return!!e?.multi_select&&pe.current<(e?.options.length??0)},onSpace:()=>{Z.current&&t.toggleOption(G.current,pe.current)},onTab:()=>{let e=te.current;if(!e)return;let s=Ne(e);s.batchIdx!=null&&Se(s.batchIdx)},onType:e=>{let s=te.current;if(s){if(e==="@"&&t.canIngest()){De("");return}let c=pe.current;if(s.options[c]?.input===!0){ke({opt:c,value:e});return}if(!s.allow_free_text)return;let d=Ne(s);Se(d.freeIdx??0),xe(e);return}let i=D.current;if(i){if(i.st.kind==="card"){let c=it(i.items[i.i].card);c!=null&&(w({...i,st:{kind:"card",sel:c}}),he(e));return}if(i.st.kind!=="running"||!U.current)return}if(!(z.current&&!U.current)&&U.current){let c=gn(Le.current);if(c==null)return;ye(c),ve(e)}},onBack:()=>{let e=D.current;if(e){e.st.kind==="view"?w({...e,st:{kind:"card",sel:0}}):e.st.kind==="offer"?we(e):e.st.kind==="done"&&(w(null),p?.());return}let s=z.current;if(s&&s.kind!=="running"){j(null);return}let i=Z.current;if(i){for(let c=G.current-1;c>=0;c--)if(i.resolution[c]){Be(c);return}}}},cr=ut!=null?{value:ut,onChange:e=>xe(e),onSubmit:e=>{xe(null),e.trim()&&Z.current&&(t.submitFreeText(G.current,e),We())},onCancel:()=>xe(null)}:null,ar=mt!=null?{value:mt,onChange:e=>De(e),onSubmit:e=>{De(null),e.trim()&&t.ingestAttach(e)},onCancel:()=>De(null)}:null,ur=Ie!=null?{optionIndex:Ie.opt,value:Ie.value,onChange:e=>ke({opt:Ie.opt,value:e}),onSubmit:e=>{let s=dt.current?.opt;ke(null),s!=null&&Z.current&&(t.submitAnswerWithText(G.current,s,e),We())},onCancel:()=>ke(null)}:null,Ke=(0,m.useRef)(!1),ft=l??(()=>t.requestPause()),Ht=()=>{if(Ce.current&&!Ke.current){Ke.current=!0,$("finishing the verdict \u2014 exiting once it lands (ctrl+c again = force)");return}ft()},se=t.state.checkpoint,Ee=S?.kind==="running"&&de==="idle",gt=h?.st.kind==="running"&&de==="idle"&&ae.current!=null,fe=de==="idle"&&Yn&&!_&&!I&&(!S||Ee)&&(!h||gt),U=(0,m.useRef)(!1);U.current=fe;let ee=_e(t.state.turns).entries.length,Me,ne;for(let e=ie.length-1;e>=0;e--){if(re.current.some(i=>i.end!=null&&e>=i.start&&e<i.end))continue;let s=ie[e];if(!Me&&s.kind==="commit"&&s.ok&&(Me=s.line),!ne&&s.kind==="banner"&&s.text.startsWith("designing: ")&&(ne=s.text.slice(11)),Me&&ne)break}let ht;for(let e=ie.length-1;e>=0;e--){let s=ie[e];if(s.kind==="user")break;if(s.kind==="commit"&&s.ok&&/\bapplied\b/.test(s.line)){ht=s.line;break}}let oe=ne?{"acceptance criteria":"scenarios",scenarios:"acceptance criteria + exercises","acceptance criteria + exercises":"tests + gaps"}[ne]:void 0,zt={"acceptance criteria":"the promises every path of this use-case must keep",scenarios:"the concrete user journeys that exercise those promises","acceptance criteria + exercises":"the wiring pass \u2014 per-journey checks, tied to the promises each journey exercises","tests + gaps":"runnable browser tests \u2014 anything unautomatable is recorded as a gap"},Xt=ne?zt[ne]:void 0,Gt=oe?zt[oe]:void 0,dr="phases: acceptance criteria \u2192 scenarios \u2192 wiring \u2192 tests \xB7 stop anytime with finish",mr=(()=>{for(let e=ie.length-1;e>=0;e--){let s=ie[e];if(s.kind==="agent")return s.text}return null})(),be=/\?\s*$/.test((mr??"").trimEnd()),Yt=o==="design"&&!se&&(be||oe!==void 0),Jt=ne==="tests + gaps",Ue=S?.kind==="running"?S.title:"the design",Zt=!!t.state.error&&!t.senderAlive(),fr=Ee?"\u25CF design \xB7 ":gt?`\u25CF ${ae.current??"design"} \xB7 `:"",gr=qe?"the agent needs a clarification before it can apply that":Ee&&!se?be?`${Ue} \u2014 the agent asked a question`:ht?`${Ue} \u2014 ${ht}`:Jt?`${Ue} \u2014 design complete`:`${Ue} \u2014 the agent is waiting on you`:se?ne?`${ne} done${oe?` \u2014 next: ${oe}`:""}`:Me??"phase done":Zt?"the agent stopped \u2014 the session is view-only":Yt?be?"the agent asked a question \u2014 answer or continue":`design incomplete \u2014 ${oe} not started`:Me??"waiting on you",[Ae,hr]=(0,m.useState)(null),pr=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(!x)return;let e=fe||se?x.pending():null;pr.current=e,hr(e)},[fe,se,ie.length,h==null]);let en=Ae?[{key:"reconcile-review",label:Ae.kind==="cards"?`review ${Ae.count} change(s) from ${Ae.source}`:`review change(s) detected in ${Ae.source}`}]:[],Qe=qe?[{key:"free",label:"clarify \u2014 type which one you meant",free:!0}]:Ee&&!se?Jt&&!be?[{key:"finish",label:"finish this design"},...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"free",label:"reply \u2014 tell the agent what to change",free:!0}]:[{key:"continue",label:be?"continue \u2014 go with your suggestion":"continue designing"},...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"finish",label:"finish this design"},{key:"free",label:"reply \u2014 tell the agent what to change",free:!0}]:se?[...en,{key:"continue",label:oe?`continue to ${oe}`:"continue"},...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"finish",label:"finish here"},{key:"free",label:"adjust \u2014 tell me what to change",free:!0}]:Zt?[...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"free",label:"tell me what to change",free:!0}]:Yt?[{key:"continue",label:be?"continue \u2014 go with your suggestion":`continue \u2014 ${oe} next`},...ee>0?[{key:"view",label:"view the design"}]:[],{key:"finish",label:"finish anyway"},{key:"free",label:"reply \u2014 answer and continue",free:!0}]:[...en,{key:"finish",label:o==="design"?"finish":"looks good \u2014 finish the session"},...u?[{key:"design-chain",label:"design tests for a use-case\u2026"}]:[],...ee>0?[{key:"view",label:o==="design"?"view the design":`view the ${ee} draft${ee===1?"":"s"}`}]:[],{key:"free",label:o==="design"?"keep adjusting \u2014 tell me what to change":"tell me what to change",free:!0}],pt=[{key:"another",label:"design another use-case\u2026"},...ee>0?[{key:"view",label:"view what was designed"}]:[],{key:"back",label:"done \u2014 back"}],He=(0,m.useRef)(pt);He.current=pt;let xt=[{key:"retry",label:"try again"},...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"back",label:"back"}],ze=(0,m.useRef)(xt);ze.current=xt;let Xe=[...ee>0?[{key:"view",label:"view what's saved"}]:[],{key:"back",label:"back to the check-in"}],Ge=(0,m.useRef)(Xe);Ge.current=Xe;let kt=()=>{let e=u?.listUcs()??[];if(e.length===0){$("no use-cases to design yet");return}j({kind:"picker",items:e,sel:0})},bt=(e,s)=>{let i={start:t.state.ledger.length,end:null};re.current.push(i);let c=()=>{i.end=t.state.ledger.length};j({kind:"running",title:e.title,item:e,force:s,startedAt:Date.now()}),u.runDesignChild(e.key,s).then(d=>{c(),j(d===0?{kind:"ask",title:e.title,sel:0}:{kind:"failed",item:e,force:s,detail:`child exited ${d}`,sel:0})}).catch(d=>{c();let b=d instanceof Error?d.message:String(d);t.ledger({kind:"childClose",verb:"design",subject:e.title,ok:!1,durS:Math.max(1,Math.round((Date.now()-(z.current?.kind==="running"?z.current.startedAt:Date.now()))/1e3))}),t.note(b),j({kind:"failed",item:e,force:s,detail:b,sel:0})})},tn=()=>{if(D.current?.st.kind==="running")return;let e=x?.pending();if(!e){$("nothing awaiting review");return}if(lt.current={approved:0,rejected:0,deferred:0},e.kind==="needs-run"){w({items:[],i:0,st:{kind:"running",label:`reviewing changes in ${e.source}`,startedAt:Date.now()}}),x.startReview(e.source).then(()=>{let i=x.loadCards();if(i.length===0){t.note("no reviewable changes came back \u2014 the source may be unchanged"),w(null);return}w({items:i,i:0,st:{kind:"card",sel:0}})}).catch(i=>{t.note(`the review run failed \u2014 ${i instanceof Error?i.message:String(i)}`),w(null)});return}let s=x.loadCards();if(s.length===0){$("nothing awaiting review");return}w({items:s,i:0,st:{kind:"card",sel:0}})},nn=e=>{let s=lt.current,i=`${s.approved} approved \xB7 ${s.rejected} rejected \xB7 ${s.deferred} deferred`;w({...e,st:{kind:"done",sel:0,summary:i}})},we=e=>{if(e.i+1<e.items.length){w({...e,i:e.i+1,st:{kind:"card",sel:0}});return}let s=x?.loadCards()??[];s.length===0?nn(e):w({items:s,i:0,st:{kind:"card",sel:0}})},rn=(e,s)=>{if(!u){we(e);return}ae.current=s.kind;let i={start:t.state.ledger.length,end:null};re.current.push(i),w({...e,st:{kind:"running",label:`${s.kind==="evolve"?"Evolving":"Designing"} ${s.title}`,startedAt:Date.now()}}),u.runDesignChild(s.key,s.kind==="evolve",s.kind).then(()=>{ae.current=null,i.end=t.state.ledger.length,we(D.current??e)}).catch(c=>{ae.current=null,i.end=t.state.ledger.length,t.ledger({kind:"childClose",verb:s.kind,subject:s.title,ok:!1,durS:1}),t.note(c instanceof Error?c.message:String(c)),we(D.current??e)})},xr=(e,s,i)=>{let c=e.items[e.i];!c||Ce.current||(Ce.current=!0,x.applyVerdict(c.key,s,i).then(d=>{if(Ce.current=!1,Ke.current){ft();return}let b=D.current??e;if(!d.ok){t.note(d.refusal);let Y=x.loadCards();Y.length===0?nn(b):w({items:Y,i:Math.min(b.i,Y.length-1),st:{kind:"card",sel:0}});return}lt.current[s==="approve"?"approved":s==="reject"?"rejected":"deferred"]+=1,t.ledger({kind:"commit",ok:!0,line:d.line}),d.note&&t.note(d.note),d.offer?rn(b,d.offer):we(b)}).catch(d=>{if(Ce.current=!1,Ke.current){ft();return}t.note(`the verdict did not land \u2014 ${d instanceof Error?d.message:String(d)}; try the card again`)}))},kr=e=>{x?.noteSteer?.(),w(null),he(null),$(null),t.submit(e)},br=X!=null?{value:X,onChange:e=>he(e),onSubmit:e=>{let s=e.trim();s?kr(s):he(null)},onCancel:()=>he(null)}:null,sn=(0,m.useRef)(!1);(0,m.useEffect)(()=>{!f||sn.current||(sn.current=!0,x?.pending()?tn():p?.())},[f]);let Le=(0,m.useRef)(Qe);Le.current=Qe;let wt=fe&&se&&Xt!==void 0,yt=re.current.find(e=>e.end==null)?.start??"top",on=(0,m.useRef)(new Set),[wr,ln]=(0,m.useState)(!1);(0,m.useEffect)(()=>{wt?on.current.has(yt)||(on.current.add(yt),ln(!0)):ln(!1)},[wt,yt]);let yr=wt?[...wr?[dr]:[],`${Xt}${Gt?` \xB7 next: ${Gt}`:""}`]:[],[vr,Tr]=(0,m.useState)(0),[Ye,$r]=(0,m.useState)(null),vt=(0,m.useRef)(0),cn=(0,m.useRef)(null),ye=e=>{vt.current=e,Tr(e)},ve=e=>{cn.current=e,$r(e)},Cr=`${fe}:${se}:${ct.current}`;(0,m.useEffect)(()=>{ye(0),ve(null)},[Cr]);let Rr=Ye!=null?{value:Ye,onChange:e=>ve(e),onSubmit:e=>{ve(null),ye(0);let s=e.trim();s&&($(null),t.submit(s))},onCancel:()=>{ve(null),ye(0)}}:null,Je=(e,s)=>{if(/^(uc|sc|ac|t|gap|sty)-\d+$/i.test(e.trim())){let b=e.trim().toLowerCase(),q=_e(t.state.turns).entries.findIndex(F=>(F.item.logical_id??"").toLowerCase()===b);if(q<0){$(`${e.trim().toUpperCase()} isn't in this session's items \u2014 view lists what this session minted`);return}K({level:"detail",cursor:q,scroll:0}),H(null);return}let i=jn(e);if("error"in i){$(i.error);return}let c=_e(t.state.turns);if(c.entries.length===0){$("nothing proposed yet \u2014 the first turn is still coming");return}if(i.level==="detail"&&i.num>c.entries.length){$(`no item ${i.num} \u2014 the set has ${c.entries.length} item${c.entries.length===1?"":"s"}`);return}let d=s!=null?St(c,s):c;K(_n(i,d)),H(s!=null&&d.entries.length<c.entries.length?s:null)},Tt=jt?"writing":zn??(t.state.workingLabel?It(t.state.workingLabel):o==="design"?"designing":"thinking"),Sr=ue.liveThinking.length>0||ue.thinkingLog.length>0,$t=S?.kind==="running"?{verb:"design"}:h?.st.kind==="running"&&ae.current?{verb:ae.current}:void 0,Ir=_?{kind:"waiting",pending:Hn}:de==="pausing"?{kind:"working",step:"pausing \u2014 saving session"}:S?.kind==="running"?Ee?{kind:"child-waiting"}:{kind:"child-working",step:Tt}:h?.st.kind==="running"?gt?{kind:"child-waiting"}:ae.current?{kind:"child-working",step:Tt}:{kind:"working",step:It(h.st.label)}:h?.st.kind==="card"&&h.items.length>0?{kind:"card",n:h.i+1,m:h.items.length}:S||h?{kind:"idle"}:Wt?{kind:"working",step:Tt,elapsedS:Gn}:{kind:"idle"},Dr=ut!=null||Ie!=null||mt!=null||X!=null||Ye!=null,an=h?h.items[h.i]:void 0,Br=[...Dr?["\u23CE submit","esc back"]:I?I.level==="list"?["\u2191\u2193 move","\u23CE open","esc back"]:["\u2191\u2193 scroll","esc back"]:_&&Ve?Sn(Ve,{batchCount:_.questions.length,canAttach:t.canIngest(),escBack:_.resolution.slice(0,Fe).some(e=>!!e)}).keys:h?.st.kind==="card"&&an?In(an.card).keys:h?.st.kind==="view"?["\u2191\u2193 scroll","esc back"]:h?.st.kind==="offer"?["\u2191\u2193 select","\u23CE confirm","esc later"]:h?.st.kind==="done"?Bt(Xe,{escBack:!0}).keys:S?.kind==="picker"||S?.kind==="confirm"||S?.kind==="ask"||S?.kind==="failed"?["\u2191\u2193 select","\u23CE confirm","esc back"]:fe?Bt(Qe,{escBack:!1}).keys:[],...Sr?["ctrl+t thinking"]:[],de==="pausing"?"ctrl+c force quit":"ctrl+c exit"],Ct=C??{verb:o,sid:"",env:""},un=(0,E.jsx)($n,{status:Ir,meta:{...Ct,...at??Ct.subject?{subject:at??Ct.subject}:{}},tallies:Rn(t.state,o),keys:Br,child:$t});if(I){let e=_e(t.state.turns),s=B!=null?St(e,B):e,i=e.entries.length-s.entries.length,c=I.level==="list"&&i>0,d=s.entries.length+(c?1:0),b=s.entries[I.cursor],Y=I.level==="detail"&&b?t.explainLines(b.item.slug??b.item.temp_ref):null,q=I.level==="detail"&&b&&g?g(b.item.logical_id??t.aliasOf(b.item.temp_ref)??b.item.temp_ref):null;return(0,E.jsxs)(k,{flexDirection:"column",children:[(0,E.jsx)(Dt,{onToggleThinking:()=>T(F=>!F),onCtrlC:Ht,explorer:{isOpen:()=>L.current!==null,onMove:F=>K(L.current&&ot(L.current,{type:"move",delta:F},d)),onEnter:()=>{let F=L.current;if(F){if(F.level==="list"&&c&&F.cursor===s.entries.length){H(null);return}K(ot(F,{type:"enter"},d))}},onBack:()=>{K(L.current&&ot(L.current,{type:"back"},d)),setTimeout(()=>M(F=>F+1),0)}}}),(0,E.jsx)(Pn,{items:s,state:I,verb:o,more:c?{hidden:i}:null,explain:Y,grandTotal:e.entries.length,dossier:q}),(je??W)&&(je??W).split(`
|
|
7
|
+
`).map((F,ge)=>(0,E.jsx)(n,{color:r.orange,children:F},`nt-${ge}`)),un]})}return(0,E.jsxs)(k,{flexDirection:"column",children:[(0,E.jsx)(Dt,{onToggleThinking:()=>T(e=>!e),onCtrlC:Ht,panel:lr}),Un&&(0,E.jsx)(xn,{thinking:Qn.body,expanded:!0,thinkingDone:de!=="streaming",maxLines:Fn+1}),Ft.length>0&&(0,E.jsx)(k,{flexDirection:"column",children:Ft.map((e,s)=>(0,E.jsx)(n,{children:hn(e).map((i,c)=>(0,E.jsx)(n,{bold:i.bold,italic:i.italic,color:i.code?r.dim:void 0,children:i.text},c))},`st-${s}`))}),_&&(0,E.jsx)(Dn,{childPrefix:$t?`${$t.verb} \xB7 `:void 0,batch:_,qView:Fe,sel:Jn,focused:er,freeText:cr,optionText:ur,attach:ar,multiSelFor:e=>t.multiSelection(e)}),qe&&(0,E.jsx)(n,{color:"yellow",children:qe.prompt}),(je??W)&&(je??W).split(`
|
|
8
8
|
`).map((e,s)=>(0,E.jsx)(n,{color:r.orange,children:e},`nt-${s}`)),fe&&(0,E.jsx)(me,{headline:`${fr}${gr}`,rows:Qe,sel:vr,focused:Ye==null,freeText:Rr,sublines:yr}),h?.st.kind==="card"&&h.items[h.i]&&(0,E.jsx)(Cn,{card:h.items[h.i].card,position:{n:h.i+1,of:h.items.length},sel:h.st.sel,focused:X==null,freeText:br,editorIntent:"steer"}),h?.st.kind==="view"&&h.items[h.i]&&(0,E.jsx)(qn,{title:h.items[h.i].card.title,lines:h.items[h.i].viewLines,offset:h.st.offset}),h?.st.kind==="offer"&&(0,E.jsx)(me,{ask:!0,headline:h.st.offer.kind==="evolve"?`approved \u2014 the design for ${h.st.offer.title} should evolve with it`:`approved \u2014 ${h.st.offer.title} has no tests yet`,rows:[{key:"run",label:h.st.offer.kind==="evolve"?"evolve the design now":"design tests now"},{key:"later",label:"later \u2014 next change"}],sel:h.st.sel,focused:!0}),h?.st.kind==="done"&&(0,E.jsx)(me,{headline:`review complete \u2014 ${h.st.summary}`,rows:Xe,sel:h.st.sel,focused:!0}),S?.kind==="picker"&&(0,E.jsx)(me,{ask:!0,headline:"design tests for which use-case?",rows:S.items.map(e=>({key:e.key,label:e.title,detail:e.badge})),sel:S.sel,focused:!0}),S?.kind==="confirm"&&(0,E.jsx)(me,{ask:!0,headline:`${S.item.title} is already designed${S.item.designed==="stale"?" \u2014 and the use-case has changed since":""}`,rows:Wn(S.item).map(e=>({key:e.key,label:e.label,detail:e.detail})),sel:S.sel,focused:!0}),S?.kind==="ask"&&(0,E.jsx)(me,{headline:`designed ${S.title}`,rows:pt,sel:S.sel,focused:!0}),S?.kind==="failed"&&(0,E.jsx)(me,{headline:`design failed \u2014 ${S.item.title} (${S.detail})`,rows:xt,sel:S.sel,focused:!0}),un]})}export{Xi as ChatSurface,Gr as tailVisualRows};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-EJXBKCNF.js";import"./chunk-YKYKOV6U.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{c as ChromeProfilePicker,b as formatChromeProfileLine,a as listChromeProfiles};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as r}from"./chunk-
|
|
2
|
+
import{a as r}from"./chunk-EFTRH35G.js";import"./chunk-YKYKOV6U.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import{c as e}from"./chunk-C44QQJR4.js";import{a as i}from"./chunk-6YGTRKDT.js";import{e as m}from"./chunk-UR6MHSHU.js";var t=m(i(),1);async function d(){return new Promise(o=>{let c=e(t.default.createElement(r,{onSubmit:n=>{c.unmount(),o(n)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{d as renderFeedbackPrompt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as P,b as g,c as f}from"./chunk-
|
|
2
|
+
import{a as P,b as g,c as f}from"./chunk-HLCETZ73.js";import"./chunk-5HTSKF5K.js";import"./chunk-5Y2G4NC7.js";import"./chunk-HYTBEPC2.js";import{a as c}from"./chunk-HCBYKLMW.js";import{c as d}from"./chunk-C44QQJR4.js";import{a as h}from"./chunk-6YGTRKDT.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(h(),1);var m=p(c(),1);function w({pipeline:t,buildShareUrl:r,onDone:o}){let[n,i]=(0,e.useState)(P()),[S,l]=(0,e.useState)("uploading"),[U,R]=(0,e.useState)(),[C,E]=(0,e.useState)();return(0,e.useEffect)(()=>{let x=t.config.onProgress;t.config.onProgress=(s,u,a)=>{x(s,u,a),i(y=>g(y,s,u,a))},t.execute().then(s=>{s.success?(R(r?.(s)),l("success")):(E(s.error),l("failed")),setTimeout(()=>o(s),1500)})},[]),(0,m.jsx)(f,{steps:n,status:S,testUrl:U,error:C})}async function O(t,r){return new Promise(o=>{let n=d(e.default.createElement(w,{pipeline:t,buildShareUrl:r,onDone:i=>{n.unmount(),o(i)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{O as renderUploadProgress};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as C,b as l,c as o}from"./chunk-
|
|
2
|
+
import{a as C,b as l,c as o}from"./chunk-XXE7W5AV.js";import{y as n}from"./chunk-HYTBEPC2.js";import{a as b}from"./chunk-HCBYKLMW.js";import{a as u,j as p}from"./chunk-C44QQJR4.js";import{a as y}from"./chunk-6YGTRKDT.js";import{e as a}from"./chunk-UR6MHSHU.js";var x=a(y(),1);var e=a(b(),1);function T({model:w,authLabel:B,profile:h,env:D,defaultUrl:s,projectId:i,projectName:d,folderId:t,folderName:f,windowSize:P,chromeProfile:R,target:r,deviceName:m,osVersion:v,appLabel:g}){let V=i?d?`${d} (${i})`:i:"(none)",$=t?f?`${f} (${t})`:t:"(none)",{exit:c}=p();return(0,x.useEffect)(()=>{let S=setTimeout(()=>c(),50);return()=>clearTimeout(S)},[c]),(0,e.jsx)(u,{flexDirection:"column",children:(0,e.jsx)(C,{title:"Configuration",children:(0,e.jsxs)(u,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(o,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:B}),(0,e.jsx)(l,{label:" profile",value:h}),(0,e.jsx)(l,{label:" env",value:D}),(0,e.jsx)(o,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:s??"(none)",valueColor:s?n.orange:n.dim}),(0,e.jsx)(l,{label:" model",value:w}),(0,e.jsx)(l,{label:" window",value:P}),(0,e.jsx)(l,{label:" project",value:V}),(0,e.jsx)(l,{label:" folder",value:$}),r!==void 0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" target",value:r}),r!=="desktop"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{label:" device_name",value:m??"(not set)",valueColor:m?void 0:n.dim}),(0,e.jsx)(l,{label:" os_version",value:v??"(not set)",valueColor:v?void 0:n.dim}),(0,e.jsx)(l,{label:" app",value:g??"(not set)",valueColor:g?void 0:n.dim})]})]}),(0,e.jsx)(o,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:R,valueColor:n.dim})]})})})}export{T as ConfigView};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-ZKCCG3GK.js";import"./chunk-7EGIX6Y4.js";import"./chunk-GSDXZS4U.js";import"./chunk-7O54QURK.js";import"./chunk-5GUD3CIH.js";import"./chunk-VOTIGXQ4.js";import"./chunk-YMLC55J4.js";import"./chunk-EHN5HTUD.js";import"./chunk-SWTJMTBY.js";import"./chunk-IE3OO5GI.js";import"./chunk-CH273NAE.js";import"./chunk-CAOZKSQ3.js";import"./chunk-VZ7KXRXB.js";import"./chunk-P7YZ3PU3.js";import"./chunk-GP7WD4UY.js";import"./chunk-JQW2QFSX.js";import"./chunk-3N6IAVD5.js";import"./chunk-FQNQVC5O.js";import"./chunk-AKX4VRRR.js";import"./chunk-UD7KKHPW.js";import"./chunk-6L5RV62W.js";import"./chunk-RFHMDQXZ.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-6GLFQHSW.js";import"./chunk-MSGW4JDG.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-4JOD47QI.js";import"./chunk-EPE2ELDH.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as EvidenceViewOffer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b}from"./chunk-OWGFFJKK.js";import"./chunk-YCCUBQY4.js";import"./chunk-TVELOH5A.js";import"./chunk-BPMSNGXQ.js";import"./chunk-YKYKOV6U.js";import"./chunk-EPE2ELDH.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as FolderPicker,a as formatFolderLine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-YGMUNNKH.js";import"./chunk-XXE7W5AV.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as InfoBox};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-RQILLYSP.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as LinksBox};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-WFBJNVMQ.js";import"./chunk-YKYKOV6U.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-Z73ZYROU.js";import"./chunk-YCCUBQY4.js";import"./chunk-TVELOH5A.js";import"./chunk-BPMSNGXQ.js";import"./chunk-YKYKOV6U.js";import"./chunk-EPE2ELDH.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProjectPicker,a as formatProjectLine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-UZIMYV5U.js";import"./chunk-S3DAAAE5.js";import"./chunk-YGMUNNKH.js";import"./chunk-XXE7W5AV.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SaveSessionPrompt,b as defaultSessionTimestamp,c as renderSavePrompt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-66MOZKD2.js";import"./chunk-DFS4RMVP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as ScrollbackTap};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-JGAMMOUC.js";import"./chunk-AYJ2YZP5.js";import"./chunk-YAAQER2L.js";import"./chunk-JSS22MFY.js";import"./chunk-27ERHOW3.js";import"./chunk-VZ7KXRXB.js";import"./chunk-TDPWFYTJ.js";import"./chunk-MLYNVJNH.js";import"./chunk-SHSXOYKT.js";import"./chunk-Z73ZYROU.js";import"./chunk-OWGFFJKK.js";import"./chunk-YCCUBQY4.js";import"./chunk-TVELOH5A.js";import"./chunk-BPMSNGXQ.js";import"./chunk-VE3SUJMA.js";import"./chunk-TZXXJWHA.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-IAHOLH5W.js";import"./chunk-TAOHYWEO.js";import"./chunk-YKYKOV6U.js";import"./chunk-Z7S3IWUX.js";import"./chunk-TEHZUSUY.js";import"./chunk-EPE2ELDH.js";import"./chunk-DHJSM5DT.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-NWNG5UWD.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SingleShotApp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-
|
|
2
|
+
import{a,b,c,d}from"./chunk-4TMQTSIO.js";import"./chunk-YGMUNNKH.js";import"./chunk-XXE7W5AV.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{d as AutoExitSummaryBox,c as SummaryBox,b as buildSummaryEvent,a as buildSummaryRendered};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{g as a}from"./chunk-JCMHB4KH.js";import"./chunk-Z3YYMZHT.js";import"./chunk-JL3L6KOG.js";import"./chunk-5HTSKF5K.js";import"./chunk-5Y2G4NC7.js";import"./chunk-P7YZ3PU3.js";import"./chunk-TDPWFYTJ.js";import"./chunk-MLYNVJNH.js";import"./chunk-A557OSRS.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-6GLFQHSW.js";import"./chunk-MSGW4JDG.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-EPE2ELDH.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-YGMUNNKH.js";import"./chunk-XXE7W5AV.js";import"./chunk-HYTBEPC2.js";import"./chunk-DFS4RMVP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as TestMdRunView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-N3CVR4Z2.js";import"./chunk-GSDXZS4U.js";import"./chunk-RFHMDQXZ.js";import"./chunk-EPE2ELDH.js";import"./chunk-XXE7W5AV.js";import"./chunk-HYTBEPC2.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as buildServeMap,b as renderTestrunEvidenceTable};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b,b as r}from"./chunk-
|
|
2
|
+
import{a as b,b as r}from"./chunk-XXE7W5AV.js";import{y as o}from"./chunk-HYTBEPC2.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a as i,b as l,j as s}from"./chunk-C44QQJR4.js";import{a as T}from"./chunk-6YGTRKDT.js";import{e as a}from"./chunk-UR6MHSHU.js";var f=a(T(),1);var e=a(p(),1);function V({profile:g,env:v,authenticated:n,authMethod:h,username:c,tokenStatus:t,expiresAt:d,serverStatus:u,detail:m}){let{exit:x}=s();return(0,f.useEffect)(()=>{let B=setTimeout(()=>x(),50);return()=>clearTimeout(B)},[x]),(0,e.jsx)(i,{flexDirection:"column",children:(0,e.jsx)(b,{title:"Identity",variant:n?"success":"warning",children:(0,e.jsxs)(i,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(i,{children:u==="rejected"?(0,e.jsx)(l,{color:o.red,bold:!0,children:"\u2717 Not authenticated"}):u==="unreachable"?(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Couldn't verify"}):n?(0,e.jsx)(l,{color:o.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(i,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(r,{label:"Profile",value:g}),(0,e.jsx)(r,{label:"Environment",value:v}),(0,e.jsx)(r,{label:"Method",value:h}),c&&(0,e.jsx)(r,{label:"User",value:c}),t&&(0,e.jsx)(r,{label:"Token",value:t,valueColor:t==="valid"?o.green:t==="expired"?o.red:o.dim}),d&&(0,e.jsx)(r,{label:"Expires",value:d}),m&&(0,e.jsx)(r,{label:"Detail",value:m})]})]})})})}export{V as WhoamiView};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as u}from"./chunk-ZUZ6QJRA.js";import{d as m}from"./chunk-H6TNBKGR.js";import"./chunk-UR6MHSHU.js";function x(t){let e=d(t),[n,r]=e;return n==="context"?r==="sync"||r==="pull"||r==="push"||r==="clone"?"sync":r==="ingest"||r==="extract"?"extract":r==="name"||r==="retire"||r==="revert"||r==="review"?r:r??n:n==="maintain"&&r==="reconcile"?"reconcile":n==="cover"?r==="gaps"?"gaps":"cover":n??"sync"}function d(t){let e=[];for(let n=0;n<t.length&&e.length<2;n++){let r=t[n];if(r==="--")break;if(r==="--mode"){n++;continue}r.startsWith("-")||e.push(r)}return e}function p(t){return t.startsWith("--")?t.split("=",1)[0]:t.slice(0,2)}function c(t){let e=t;return typeof e.long=="string"||typeof e.short=="string"?e.long??e.short??"option":typeof e.name=="function"?e.name():"argument"}var f={unknownOption:(t,[e])=>({code:"commander.unknownOption",name:p(String(e))}),missingArgument:(t,[e])=>({code:"commander.missingArgument",name:String(e)}),unknownCommand:t=>({code:"commander.unknownCommand",name:String(t.args[0]??"")}),optionMissingArgument:(t,[e])=>({code:"commander.optionMissingArgument",name:c(e)}),missingMandatoryOptionValue:(t,[e])=>({code:"commander.missingMandatoryOptionValue",name:c(e)}),_conflictingOption:(t,[e,n])=>({code:"commander.conflictingOption",name:c(e),other:c(n)}),_excessArguments:(t,[e])=>({code:"commander.excessArguments",name:t.parent?t.name():void 0,expected:t.registeredArguments.length,got:e.length}),_callParseArg:(t,[e])=>({code:"commander.invalidArgument",name:c(e)})};function w(t,e){let n=e&&e.code===t?e:null;switch(t){case"commander.unknownOption":return n?`unknown option ${n.name}`:"unknown option";case"commander.missingArgument":return n?`missing required argument ${n.name}`:"missing required argument";case"commander.unknownCommand":return n?`unknown command ${n.name}`:"unknown command";case"commander.optionMissingArgument":return n?`option ${n.name} needs a value`:"an option needs a value";case"commander.missingMandatoryOptionValue":return n?`required option ${n.name} not given`:"a required option was not given";case"commander.conflictingOption":return n?`option ${n.name} cannot be used with option ${n.other}`:"two options cannot be used together";case"commander.excessArguments":return n?`too many arguments${n.name?` for ${n.name}`:""}: expected ${n.expected}, got ${n.got}`:"too many arguments";case"commander.invalidArgument":return n?`invalid value for ${n.name}`:"an argument's value is invalid";case"kane.answerOnSubcommand":return"option --answer belongs to kane-cli context sync [name] and kane-cli context pull";default:return"the command line was not accepted"}}function g(t,e={current:null}){t.exitOverride(),t.configureOutput({writeErr:()=>{},writeOut:()=>{}});let n=t;for(let[o,i]of Object.entries(f)){let s=n[o];typeof s=="function"&&(n[o]=function(...a){try{return s.apply(this,a)}catch(l){throw e.current=i(this,a),l}})}let r=n.error;n.error=function(...o){let i=o[1]?.code;return i==="commander.unknownCommand"&&e.current?.code!==i&&(e.current={code:i,name:String(this.args[0]??"")}),r.apply(this,o)};for(let o of t.commands)g(o,e);return e}async function v(t,e,n,r={stdout:o=>process.stdout.write(o),stderr:o=>process.stderr.write(o)}){let o=g(t);try{return await t.parseAsync(e),null}catch(i){if(!(i instanceof u))throw i;let s=m("ndjson",n,r);if(i.exitCode===0)return s.done(0);let a=d(e.slice(2))[0];return s.event({type:"error",code:"USAGE",message:w(i.code,o.current),remedy:`run kane-cli${a?` ${a}`:""} --help`}),s.done(2,"refused")}}export{v as parseAsAgent,g as silenceCommandTree,x as streamVerbFor,w as usageMessage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as a,c as b}from"./chunk-
|
|
2
|
+
import{b as a,c as b}from"./chunk-IAHOLH5W.js";import"./chunk-TAOHYWEO.js";import"./chunk-RZ4F3BHX.js";import"./chunk-HYTBEPC2.js";import"./chunk-UR6MHSHU.js";export{a as isAppId,b as resolveCloudApp};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import"./chunk-UR6MHSHU.js";var p=new Set(["android","ios"]),d="hyperexecute";function u(i,a=process.env){let t=i.appiumSessionId?.trim();if(!t)return{kind:"none"};if(a.KANE_CLI_MODE!==d)return{kind:"invalid",message:"--appium-session-id can only be used for an exported test running on the HyperExecute grid."};let e=[];if(i.appiumUrl?.trim()||e.push("--appium-url"),i.target?.trim()||e.push("--target"),e.length>0)return{kind:"invalid",message:`--appium-session-id requires --appium-url and --target android|ios. Missing: ${e.join(", ")}.`};let r=i.target.trim().toLowerCase();if(!p.has(r))return{kind:"invalid",message:`Invalid --target: got "${i.target}". With --appium-session-id, --target must be "android" or "ios".`};let s=["deviceName","osVersion","app"].filter(n=>i[n]!==void 0).map(n=>`--${n.replace(/[A-Z]/g,o=>"-"+o.toLowerCase())}`);return s.length>0?{kind:"invalid",message:`${s.join(", ")} cannot be used with --appium-session-id.`}:{kind:"attach",device:{platform:r,appium_url:i.appiumUrl.trim(),session_id:t}}}function g(i){return`Running on an attached ${i.platform} session ${i.session_id} at ${i.appium_url}`}export{u as attachTargetFromFlags,g as formatAttachBanner};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import"./chunk-UR6MHSHU.js";async function i(e){try{let[{CredentialsManager:n},{AuthResolver:a},{getEnvironment:s}]=await Promise.all([import("./credentials-
|
|
2
|
+
import"./chunk-UR6MHSHU.js";async function i(e){try{let[{CredentialsManager:n},{AuthResolver:a},{getEnvironment:s}]=await Promise.all([import("./credentials-GWLYYRTL.js"),import("./resolver-2NUNLK7N.js"),import("./config-UGCWZGH5.js")]),t=new n,o=t.getActiveProfile()??"default",c=t.loadCredentials(o,e);if(typeof c?.access_token!="string")return null;let r=await new a(s(e).controllerBaseUrl,async()=>c.access_token,null).resolve();return typeof r?.username!="string"||!r.username||typeof r.access_key!="string"||!r.access_key?null:Buffer.from(`${r.username}:${r.access_key}`,"utf8").toString("base64")}catch{return null}}async function u(e={}){let n=e.env??process.env,s=await(e.resolveBase??(async()=>(await import("./spawner-7FUA3JXA.js")).resolveAgentAuthEnv()))();if(s.TESTMUAI_BASIC_AUTH||n.TESTMUAI_BASIC_AUTH)return s;let t=n.TESTMUAI_ENV==="stage"?"stage":"prod",o=await(e.exchange??i)(t);return o?{...s,TESTMUAI_BASIC_AUTH:o}:s}export{u as resolveLisAuthEnv};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-QXRT6HSV.js";import"./chunk-EDQZIEPJ.js";import"./chunk-HYTBEPC2.js";import"./chunk-UR6MHSHU.js";export{b as ensureHyperexecuteBinary,a as hyperexecuteDownloadUrl};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as N}from"./chunk-VZDLRJ5N.js";import"./chunk-ZKSN2SJ7.js";import"./chunk-HOA4VWSD.js";import"./chunk-YYYQ5MVD.js";import"./chunk-6DHEOPXX.js";import"./chunk-KZG4E5RM.js";import"./chunk-T4R26WER.js";import"./chunk-UHT5SVP5.js";import"./chunk-DMCEGMGB.js";import"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-BZAGVBCX.js";import"./chunk-52WM3XYO.js";import"./chunk-BB2W35TW.js";import"./chunk-Q77QO3PC.js";import"./chunk-YKTYVJBN.js";import"./chunk-CRZUBDJ3.js";import"./chunk-GX3FPJUG.js";import"./chunk-427OQS2N.js";import"./chunk-JUJ4SAGH.js";import"./chunk-AHXOKBVE.js";import"./chunk-ALCE5RLK.js";import"./chunk-55YDTPB7.js";import"./chunk-YCH7H7JX.js";import"./chunk-2UIHS2FH.js";import"./chunk-Q2F5QB2W.js";import"./chunk-BKHXPBWN.js";import"./chunk-N2P4MI32.js";import"./chunk-DMT3W26F.js";import{U as A,V as U,W as I,X as k}from"./chunk-UHSNUUX3.js";import"./chunk-YZVR7ESF.js";import"./chunk-H6TNBKGR.js";import"./chunk-66MOZKD2.js";import"./chunk-YLQHY4A7.js";import"./chunk-JVEZBJJ7.js";import"./chunk-SWTJMTBY.js";import"./chunk-IE3OO5GI.js";import{a as d}from"./chunk-CH273NAE.js";import"./chunk-CAOZKSQ3.js";import"./chunk-VZ7KXRXB.js";import"./chunk-5LJRZI7S.js";import"./chunk-BKM2LWU2.js";import"./chunk-GP7WD4UY.js";import"./chunk-JQW2QFSX.js";import{t as R}from"./chunk-3N6IAVD5.js";import"./chunk-FQNQVC5O.js";import"./chunk-AKX4VRRR.js";import"./chunk-UD7KKHPW.js";import"./chunk-YCCUBQY4.js";import"./chunk-MSGW4JDG.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-HYTBEPC2.js";import"./chunk-DFS4RMVP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";import{existsSync as M}from"fs";var q=new Set(["interactive","agent","ci","override"]);function F(t){return t.mode!=null&&!q.has(t.mode)?{error:`design: --mode must be interactive | agent | ci | override, got '${t.mode}'`}:t.strength!=null&&t.strength!=="pairwise"&&t.strength!=="3-wise"?{error:`design: --strength must be pairwise | 3-wise, got '${t.strength}'`}:t.max!=null&&(!Number.isInteger(t.max)||t.max<1)?{error:"design: --max must be a positive integer"}:!t.useCase&&!t.resume?{error:"design: --use-case is required (or --resume <sid> \u2014 the session remembers its use-case)"}:{useCase:t.useCase,max:t.max,strength:t.strength,mode:t.mode,force:t.force,resume:t.resume,plan:t.plan,message:t.message,phase:t.phase,allowUnreviewed:t.allowUnreviewed,because:t.because,changeDelta:t.changeDelta,priorDesign:t.priorDesign}}async function X(t){let l=async(e,n)=>{if(t.mode!=="agent")return process.stderr.write(e+`
|
|
3
|
+
`),2;let{makeHeadlessIO:s,agentRefusal:c}=await import("./headless-io-3A3BZVQ5.js");return c(s("ndjson","design"),e,n)};if(t.mode!=null&&!["interactive","agent","ci","override"].includes(t.mode)){let{makeHeadlessIO:e,agentRefusal:n}=await import("./headless-io-3A3BZVQ5.js");return n(e("ndjson","design"),`design: --mode must be interactive | agent | ci | override, got '${t.mode}'`,"MODE_USAGE")}let T=F(t);if("error"in T)return l(T.error);let o=T;{let{validateResumeMessage:e}=await import("./headless-io-3A3BZVQ5.js"),n=e(o,"design");if(n)return l(n)}{let{gateStructuredFlags:e}=await import("./structured-answers-NADW6D44.js"),n=e(t,"design");if(n)return l(n,"STRUCTURED_FLAGS_USAGE")}if(!M(d(process.cwd())))return l("error: no context store here (run `kane-cli context ingest` + `kane-cli context extract` first)","NO_STORE");{let e=I(d(process.cwd()));if(e){if(t.mode!=="agent")return l(`error: ${e.text}
|
|
4
|
+
next: ${e.remedy}`,e.code);let{makeHeadlessIO:n}=await import("./headless-io-3A3BZVQ5.js"),s=n("ndjson","design");return s.event(k(e)),s.done(2,"refused")}}let x=!!o.resume;if(o.useCase&&o.resume&&!t.allowUnreviewed)try{let{peekSession:e}=await import("./sessions-NH7WQWMX.js"),n=e(d(process.cwd()),o.resume);x=!!(n&&n.use_case===o.useCase)}catch{x=!1}if(o.useCase&&!x&&!t.allowUnreviewed)try{let[{openGraph:e},{designEntryCheck:n}]=await Promise.all([import("./readmodel-IBFRM6EO.js"),import("./trust-gate-EX7R2P4Y.js")]),s=n(e(d(process.cwd())),o.useCase);if(!s.ok&&(s.code==="UC_UNREVIEWED"||s.code==="UC_ARCHIVED"))if((o.mode??"interactive")==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY){let{createInterface:f}=await import("readline/promises"),u=f({input:process.stdin,output:process.stderr}),w=(await u.question(`design: ${s.detail}
|
|
5
|
+
Design against it anyway? (y/N) `)).trim().toLowerCase();if(u.close(),w!=="y"&&w!=="yes")return process.stderr.write(`aborted \u2014 approve it first: ${s.reviewCmd}
|
|
6
|
+
`),2}else if(t.mode==="agent"){let{makeHeadlessIO:f}=await import("./headless-io-3A3BZVQ5.js"),u=f("ndjson","design");return u.event({type:"error",code:s.code,message:`design: ${s.detail}`,next:[s.reviewCmd]}),u.event({type:"done",status:"refused",exit_code:2,next:[s.reviewCmd,`kane-cli design tests --use-case ${o.useCase} --mode agent --allow-unreviewed`]}),2}else return process.stderr.write(`design: ${s.detail} (${s.reviewCmd})
|
|
7
|
+
`),2}catch(e){process.env.KANE_DEBUG&&process.stderr.write(`trust gate skipped: ${String(e)}
|
|
8
|
+
`)}let r=null,p=null;try{if(!o.mode&&!process.stdin.isTTY)return process.stderr.write(`design: no TTY \u2014 pass an explicit --mode agent|ci|override to run headless
|
|
9
|
+
`),2;let e=o.mode??"interactive";if(e==="interactive"){if(!process.stdin.isTTY||!process.stdout.isTTY)return process.stderr.write(`design: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
10
|
+
`),2;let{bindDesignInteractive:i}=await import("./interactive-bind-X5DVLRRW.js");return await i(o)}let{resolveAgentAuthEnv:n}=await import("./spawner-7FUA3JXA.js"),{runAgent:s}=await import("./bridge-5UKX7YIO.js"),{preflightTurn:c}=await import("./turn-preflight-JGYT7LXP.js"),{makeInterruptGuard:f}=await import("./interrupt-guard-UREUWNRL.js"),{baseUrlAdvisory:u}=await import("./turn-preflight-JGYT7LXP.js"),{makeHeadlessIO:w,resolveEncoding:E,guardedChannels:G}=await import("./headless-io-3A3BZVQ5.js"),{withStructuredNext:O,prepareStructuredResume:Y}=await import("./structured-answers-NADW6D44.js");r=O(w(E(e),"design"));let b=await A(d(process.cwd()));b&&(E(e)==="ndjson"?r.event(U(b)):r.progress(b.text));let{runWithChannel:H}=await import("./run-channel-RGH4WIQX.js"),v=r,P=E(e)==="ndjson"?i=>H({event:g=>v.event(g)},i):i=>i(),C=i=>{v.out(i),v.event({type:"note",text:i})},{telemetryBootstrap:j,telemetryEnvName:B}=await import("./bootstrap-KCPWDBLX.js"),m=j({verb:"design",mode:e,contextRoot:d(process.cwd()),env:B(),resumeSid:o.resume,write:!0,longSession:!0});p=i=>m.end(i);let a=Y({opts:t,contextDir:d(process.cwd()),verb:"design"});if(a.kind==="refuse")return r.out(a.error),e==="agent"&&r.event({type:"error",message:a.error,code:a.code}),await m.end({exit_code:2}),e==="agent"?r.done(2,"refused"):2;let D;if(a.kind==="apply"){for(let i of a.notes)C(i);if(a.matchedQids.length>0){C(`applying ${a.matchedQids.length} structured answer(s) from --answer to the paused session's pending questions`);for(let i of a.matchedQids)r.event({type:"panel_resolved",id:i,by:"user",via:"flag"})}a.statement&&(D=[o.message,a.statement].filter(Boolean).join(`
|
|
11
|
+
|
|
12
|
+
`))}let _=u();_&&C(_);let h=f(s,i=>r.out(i)),S=G(r,()=>h.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let i=e==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY?async y=>{let{createInterface:L}=await import("readline/promises"),$=L({input:process.stdin,output:process.stdout});try{return/^y(es)?$/i.test((await $.question(`${y} [y/N] `)).trim())}finally{$.close()}}:void 0,g=await P(async()=>{let y={...await n(),...m.spawnEnv()};return N({...o,mode:e,...D!==void 0?{message:D}:{},...i?{confirmRetarget:i}:{}},{contextDir:d(process.cwd()),agent:h.agent,preflightTurn:()=>c(y),ask:async()=>[],out:S.out,emit:S.emit,progress:v.progress,isTTY:!1,auth:y,telemetry:m})});return h.interrupted()&&g!==3?(r.out("interrupted \u2014 no session saved"),await m.end({exit_code:130}),r.done(130)):(g===1&&r.out(m.supportFooter()),await m.end({exit_code:g}),r.done(g))}finally{h.dispose()}}catch(e){if(e instanceof R)return p&&await p({exit_code:2}).catch(()=>{}),r?(r.event(k({code:e.code,text:e.message,remedy:e.remedy})),r.done(2,"refused")):(process.stderr.write(`error: ${e.message}
|
|
13
|
+
next: ${e.remedy}
|
|
14
|
+
`),2);p&&await p({exit_code:1}).catch(()=>{});let n=e instanceof Error?e.message:String(e);r?.event({type:"error",message:`error: design failed: ${n}`});let s=r?c=>r.out(c):c=>process.stderr.write(c+`
|
|
15
|
+
`);return s(`error: design failed: ${n}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&e instanceof Error&&e.stack&&s(e.stack),s('hint: the full trace is in the file named on the "trace:" line at the start of this run'),r?r.done(1):1}}export{X as designTestsCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-KUS324VE.js";import"./chunk-4PMZ5FCD.js";import"./chunk-KBM3XHAM.js";import"./chunk-2YEHV2CX.js";import"./chunk-5LJRZI7S.js";import"./chunk-BKM2LWU2.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-HYTBEPC2.js";import"./chunk-UR6MHSHU.js";export{b as telemetryBootstrap,a as telemetryEnvName};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-LJGAXIDU.js";import"./chunk-GZ65ZA4C.js";import"./chunk-DMT3W26F.js";import"./chunk-UD7KKHPW.js";import"./chunk-HYTBEPC2.js";import"./chunk-UR6MHSHU.js";export{a as runAgent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as l}from"./chunk-RZ4F3BHX.js";import{b as i,f as c}from"./chunk-
|
|
2
|
+
import{a as l}from"./chunk-RZ4F3BHX.js";import{b as i,f as c}from"./chunk-HYTBEPC2.js";import"./chunk-UR6MHSHU.js";import{readFileSync as u,writeFileSync as g,mkdirSync as d}from"fs";import{join as f}from"path";var h=f(i,"changelog-cache.json"),p=3600*1e3;function y(){try{let e=JSON.parse(u(h,"utf-8"));if(Date.now()-e.cachedAt<p)return e}catch{}return null}function m(e){try{d(i,{recursive:!0}),g(h,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function A(e){try{let t=y();if(t){let r=t.entries;return e?.all?r:r.slice(0,5)}let n=new AbortController,o=setTimeout(()=>n.abort(),5e3),a=await l(`${c}?per_page=30`,{headers:{Accept:"application/vnd.github+json"},signal:n.signal});if(clearTimeout(o),!a.ok)return[];let s=(await a.json()).map(r=>({version:r.tag_name.replace(/^v/,""),date:r.published_at?r.published_at.slice(0,10):"",body:r.body??""}));return m(s),e?.all?s:s.slice(0,5)}catch{return[]}}function v(e){if(e.length===0)return"Could not fetch changelog. Visit https://github.com/LambdaTest/kane-cli/releases";let t=["kane-cli Changelog","\u2500".repeat(40),""];for(let n of e){if(t.push(`v${n.version} (${n.date})`),n.body){let o=n.body.split(`
|
|
3
3
|
`).filter(a=>a.trim());for(let a of o)t.push(` ${a}`)}t.push("")}return t.join(`
|
|
4
4
|
`)}export{A as fetchChangelog,v as formatChangelog};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-TNBF5OMZ.js";import"./chunk-BZAGVBCX.js";import"./chunk-52WM3XYO.js";import"./chunk-427OQS2N.js";import"./chunk-IE3OO5GI.js";import"./chunk-GP7WD4UY.js";import"./chunk-JQW2QFSX.js";import"./chunk-3N6IAVD5.js";import"./chunk-FQNQVC5O.js";import"./chunk-AKX4VRRR.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";export{a as commitChatTurn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c}from"./chunk-O25AL4B7.js";import"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-52WM3XYO.js";import"./chunk-IE3OO5GI.js";import"./chunk-3N6IAVD5.js";import"./chunk-FQNQVC5O.js";import"./chunk-AKX4VRRR.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";export{c as makeChatController,b as questionStub,a as recommendationPicks};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
var f=/^\d+$/;function c(t){if(t.type==="parameter")return!0;let e=t.syntax?.trim()??"";return e.startsWith("${")&&e.endsWith("}")}function o(t){if(!t)throw new Error("--dataset-row needs the row's _id (as Test Manager shows it)");if(f.test(t))throw new Error(`row positions are not supported: pass the row's _id (--dataset-row <_id>), got: ${JSON.stringify(t)}`)}function w(t){let e=t.rows.map(n=>typeof n._id=="string"?n._id:"(no _id)"),r=e.slice(0,20).join(", ");return e.length>20?`${r}, \u2026 (${e.length} rows)`:r}function u(t){if(t==null)return"";if(typeof t=="string")return t;if(typeof t=="object")try{return JSON.stringify(t)}catch{return String(t)}return String(t)}function g(t,e){if(t.rows.length===0)throw new Error("the dataset has no rows");let r=e?.trim();if(!r)throw new Error(`pick a row with --dataset-row <_id> \u2014 this dataset has rows: ${w(t)}`);o(r);let n=t.rows.findIndex(i=>i._id===r);if(n===-1)throw new Error(`no row with _id ${r} in the dataset \u2014 it has rows: ${w(t)}`);return{row:t.rows[n],id:r,index:n+1}}function m(t,e){let r={};for(let n of t.headers)!n.name||n.name==="_id"||(r[n.name]={value:u(e[n.name]),syntax:"${"+n.name+"}",type:"parameter",secret:!1});return r}function l(t,e){return t.headers.filter(r=>r.name&&r.name!=="_id").map(r=>({name:r.name,type:r.type,value:u(e[r.name])}))}function p(t,e){let r=typeof t.datasetId=="string"&&t.datasetId.trim()?t.datasetId.trim():null,n=t.datasetRow===void 0||t.datasetRow===null||t.datasetRow===""?null:String(t.datasetRow).trim();n!==null&&o(n);let i=(s,d)=>d?{id:s,row:d}:{id:s};if(r)return i(r,n);let a=e?.id?.trim();if(a){let s=typeof e?.row=="string"&&e.row.trim()?e.row.trim():null;return s!==null&&o(s),i(a,n??s)}if(n!==null)throw new Error("--dataset-row needs a dataset: pass --dataset-id or set dataset: in the frontmatter");return null}function h(t,e){return{id:t,row:e}}function y(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>c(e)))}function R(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>!c(e)))}export{c as a,g as b,m as c,l as d,p as e,h as f,y as g,R as h};
|
|
@@ -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-JSS22MFY.js";import{f as D}from"./chunk-JL3L6KOG.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(`
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as o,d as a}from"./chunk-H6TNBKGR.js";import{a as m,b as d}from"./chunk-KUS324VE.js";import{t as c}from"./chunk-3N6IAVD5.js";import{resolve as l}from"path";async function u(n,w,t={}){let r=d({verb:n,mode:"cli",contextRoot:l(process.cwd(),".context"),env:m(),write:t.write}),s=()=>{o(t.mode??"")!=="ndjson"&&process.stderr.write(r.supportFooter()+`
|
|
3
|
+
`)};try{let e=await w(r);return t.write&&e===0&&await r.lateBindContext(l(process.cwd(),".context")),e===1&&s(),await r.end({exit_code:e}),e}catch(e){if(e instanceof c){if(o(t.mode??"")==="ndjson"){let i=a("ndjson",t.streamVerb??n,{stdout:y=>process.stdout.write(y),stderr:()=>{}});i.event({type:"sync_error",code:e.code,detail:e.message,remedy:e.remedy}),i.done(2,"refused")}else process.stderr.write(`error: ${e.message}
|
|
4
|
+
next: ${e.remedy}
|
|
5
|
+
`);return r.error("rebase_open"),await r.end({exit_code:2}),2}throw r.error("cli_crash"),s(),await r.end({exit_code:1}),e}}export{u as a};
|