@testmuai/kane-cli 0.8.6 → 0.8.8
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/bin/kane-cli.cjs +5 -1
- package/dist/{ChatSurface-S2P7WMBI.js → ChatSurface-LS3KF7XY.js} +1 -1
- package/dist/{ChromeProfilePicker-7DTJK2QW.js → ChromeProfilePicker-UIJ5ZBLY.js} +1 -1
- package/dist/{CliFeedbackPrompt-Y3OYZX54.js → CliFeedbackPrompt-EIQQBWDY.js} +1 -1
- package/dist/{CliUploadProgress-I3N5WDNJ.js → CliUploadProgress-6U77ZBAX.js} +1 -1
- package/dist/ConfigView-MVFLCF5N.js +2 -0
- package/dist/EvidenceViewOffer-ANVEOXJA.js +2 -0
- package/dist/FolderPicker-HVI6KITN.js +2 -0
- package/dist/{InfoBox-QBXPPMM2.js → InfoBox-57MRRSJI.js} +1 -1
- package/dist/{LinksBox-L24KON4U.js → LinksBox-RKAEQBFS.js} +1 -1
- package/dist/{ProfilesView-H6XCTIXI.js → ProfilesView-RQCQFIXH.js} +1 -1
- package/dist/{ProjectPicker-F6JGF2B3.js → ProjectPicker-5JEEHLY3.js} +1 -1
- package/dist/{SaveSessionPrompt-QGO65DZN.js → SaveSessionPrompt-TQROE5JM.js} +1 -1
- package/dist/SingleShotApp-VJVY3F4H.js +2 -0
- package/dist/{SummaryBox-OZIZQY4B.js → SummaryBox-C4UY6R65.js} +1 -1
- package/dist/TestMdRunView-X3CCNYV5.js +2 -0
- package/dist/{TestrunEvidenceTable-A7WTTKTV.js → TestrunEvidenceTable-LY24PK3T.js} +1 -1
- package/dist/{WhoamiView-EB5AV27X.js → WhoamiView-2FIHHS4G.js} +1 -1
- package/dist/{app-download-SQ4RDY3E.js → app-download-TO672LBR.js} +1 -1
- package/dist/{auth-TW24FZQF.js → auth-EVXJVU72.js} +1 -1
- package/dist/{binary-5LMQJ3CZ.js → binary-Y4DKNDQH.js} +1 -1
- package/dist/{bind-SJ6DOVQ4.js → bind-FVCVYYL3.js} +3 -3
- package/dist/{bootstrap-BTEXO6HX.js → bootstrap-4XBQFKWF.js} +1 -1
- package/dist/bridge-6DCBL3GY.js +2 -0
- package/dist/{changelog-JLSLSA3Y.js → changelog-LAQ2VGK6.js} +1 -1
- package/dist/chat-committer-K3NOTLOU.js +2 -0
- package/dist/chat-controller-YJCNU76T.js +2 -0
- package/dist/chunk-2MQP4SSF.js +20 -0
- package/dist/{chunk-S66MCU2Y.js → chunk-36ZVMJTJ.js} +1 -1
- package/dist/{chunk-USI2WMAK.js → chunk-3GZ4FQ4L.js} +1 -1
- package/dist/{chunk-CLLQQPBZ.js → chunk-4BIJCAR4.js} +1 -1
- package/dist/chunk-4PMZ5FCD.js +2 -0
- package/dist/{chunk-2DCNCH32.js → chunk-54JZ6VEW.js} +1 -1
- package/dist/{chunk-ZGBSGZZM.js → chunk-5G22NOZK.js} +1 -1
- package/dist/{chunk-YEQVJWEF.js → chunk-5LYPSIBC.js} +1 -1
- package/dist/{chunk-RDNKYRKY.js → chunk-5M5BG4MT.js} +1 -1
- package/dist/{chunk-YHTYPTDD.js → chunk-5YCOYFZH.js} +1 -1
- package/dist/chunk-6FCPS2VT.js +4 -0
- package/dist/{chunk-4NSP2NPT.js → chunk-6LYQ4MJH.js} +1 -1
- package/dist/{chunk-XY325HDJ.js → chunk-6T3DWH56.js} +1 -1
- package/dist/{chunk-D4SRHIJ5.js → chunk-6TVNJDSE.js} +1 -1
- package/dist/{chunk-P3RKXL3V.js → chunk-7CXIOJB3.js} +1 -1
- package/dist/{chunk-RZLD7TPG.js → chunk-7RTITBZG.js} +1 -1
- package/dist/{chunk-JCD6FP7A.js → chunk-7UCICMK7.js} +3 -3
- package/dist/{chunk-SS5TOK2J.js → chunk-7UYSTQMI.js} +1 -1
- package/dist/chunk-7YX2HUHY.js +2 -0
- package/dist/chunk-AKX4VRRR.js +2 -0
- package/dist/{chunk-KQ2MYMOS.js → chunk-AO5QH6UU.js} +1 -1
- package/dist/{chunk-YZ45OEH3.js → chunk-AS5UKK27.js} +1 -1
- package/dist/{chunk-JN44V63O.js → chunk-ATIX6CVS.js} +2 -2
- package/dist/{chunk-TDS6LG6T.js → chunk-AZ73FJRK.js} +1 -1
- package/dist/{chunk-ZRKPZLLG.js → chunk-BAKOH2BR.js} +1 -1
- package/dist/{chunk-Z35BUPZT.js → chunk-BRE426DP.js} +1 -1
- package/dist/{chunk-IGJIDN4U.js → chunk-BYOXTXLC.js} +1 -1
- package/dist/{chunk-JFAFKHDX.js → chunk-BZAGVBCX.js} +1 -1
- package/dist/{chunk-FYS5VIOG.js → chunk-CQCV2RJK.js} +2 -2
- package/dist/{chunk-FJYDEWOA.js → chunk-DHPBVHED.js} +1 -1
- package/dist/{chunk-7KORP5FF.js → chunk-EEFZXZTZ.js} +1 -1
- package/dist/{chunk-GFKCTYCA.js → chunk-EV64VI66.js} +1 -1
- package/dist/{chunk-IWM5EZC3.js → chunk-FGRTNRBS.js} +2 -2
- package/dist/{chunk-NT3UETTV.js → chunk-FL6TCYA5.js} +1 -1
- package/dist/{chunk-IMR64OCZ.js → chunk-GX3FPJUG.js} +1 -1
- package/dist/{chunk-FUNKVREV.js → chunk-GZLQ2AR6.js} +1 -1
- package/dist/chunk-H4WIA4IP.js +26 -0
- package/dist/{chunk-ZLSWHCWO.js → chunk-H6YGG3GC.js} +1 -1
- package/dist/chunk-HJOGBE23.js +26 -0
- package/dist/{chunk-DN3E6RT6.js → chunk-HK3FFI7Y.js} +2 -2
- package/dist/{chunk-TYI4MLFJ.js → chunk-HPBI3P6I.js} +3 -3
- package/dist/{chunk-FMUCZWS3.js → chunk-HZDNGNO2.js} +1 -1
- package/dist/chunk-IPEA7ZOF.js +8 -0
- package/dist/{chunk-6KPPGMO2.js → chunk-IVQX3AKL.js} +1 -1
- package/dist/chunk-IWVA37B6.js +5 -0
- package/dist/chunk-JE6OO2Q6.js +8 -0
- package/dist/{chunk-PT7V5WDQ.js → chunk-JPGRUMCS.js} +1 -1
- package/dist/chunk-JQW2QFSX.js +2 -0
- package/dist/{chunk-JZ26R6UL.js → chunk-JUJ4SAGH.js} +1 -1
- package/dist/chunk-K5DL7CZ4.js +2 -0
- package/dist/{chunk-TKYJTXWL.js → chunk-K6JRFRGS.js} +1 -1
- package/dist/chunk-KAZGHWGK.js +5 -0
- package/dist/{chunk-AFPHLUQ5.js → chunk-KGKJU27A.js} +1 -1
- package/dist/{chunk-E5S4BASB.js → chunk-LI5FMAUO.js} +1 -1
- package/dist/{chunk-INK66XQS.js → chunk-LMYE3M75.js} +1 -1
- package/dist/{chunk-OFW3ZVTP.js → chunk-LPH4TERT.js} +1 -1
- package/dist/chunk-N5I2QYFD.js +2 -0
- package/dist/chunk-N7Z7BQYO.js +3 -0
- package/dist/{chunk-EXERQHXV.js → chunk-NAZ36RKI.js} +1 -1
- package/dist/chunk-O4IEPE3T.js +4 -0
- package/dist/{chunk-CLGC7VEO.js → chunk-O5U6EAL3.js} +1 -1
- package/dist/chunk-OGJR5VIG.js +363 -0
- package/dist/{chunk-A44G533S.js → chunk-OO7LFDET.js} +1 -1
- package/dist/chunk-OQAN2WYO.js +26 -0
- package/dist/{chunk-GC5U55MW.js → chunk-P67CGWD6.js} +1 -1
- package/dist/{chunk-C4WTZSX4.js → chunk-PQYBIWZH.js} +1 -1
- package/dist/chunk-PYHWCV2V.js +2 -0
- package/dist/{chunk-AO3PBE2V.js → chunk-Q6743UUQ.js} +1 -1
- package/dist/{chunk-5DBK6QNS.js → chunk-QQ5MHSSY.js} +1 -1
- package/dist/{chunk-DZCG7FFP.js → chunk-QVR2PB6Y.js} +1 -1
- package/dist/{chunk-WMQJBEQP.js → chunk-QXLX6LMJ.js} +1 -1
- package/dist/{chunk-VOBXYDJW.js → chunk-R4PLEH2A.js} +47 -47
- package/dist/{chunk-TQKIE7AX.js → chunk-RHL7KZNC.js} +1 -1
- package/dist/chunk-RSSOJ3L2.js +21 -0
- package/dist/{chunk-VMCSRLRC.js → chunk-S6M36UIV.js} +1 -1
- package/dist/{chunk-SQC4P2Q7.js → chunk-SQWVGI3J.js} +1 -1
- package/dist/{chunk-ATWDQCDA.js → chunk-UDW4ZZAW.js} +7 -7
- package/dist/{chunk-CUM23TLF.js → chunk-UH2ZTX4E.js} +1 -1
- package/dist/{chunk-XJILZ2WN.js → chunk-UPHF2J5E.js} +1 -1
- package/dist/{chunk-SQGBFCFO.js → chunk-UY2ES2Z6.js} +1 -1
- package/dist/{chunk-3LEVCW6R.js → chunk-UYLNH4SH.js} +1 -1
- package/dist/{chunk-OYJBABRV.js → chunk-V5DYLGAM.js} +1 -1
- package/dist/{chunk-7VZCXW74.js → chunk-VCDXUUJQ.js} +1 -1
- package/dist/{chunk-5COGCNED.js → chunk-VQVERWC3.js} +1 -1
- package/dist/chunk-W3Z7AZNT.js +4 -0
- package/dist/{chunk-BN6AHQL7.js → chunk-WALVOFKR.js} +4 -4
- package/dist/{chunk-3UUPP5W3.js → chunk-WDOEMLFZ.js} +1 -1
- package/dist/chunk-WHEWZR2C.js +15 -0
- package/dist/{chunk-VRVFPMCR.js → chunk-WIAZN7G4.js} +1 -1
- package/dist/{chunk-AWD56KGX.js → chunk-WPSQYEBP.js} +2 -2
- package/dist/{chunk-RX5TZZNQ.js → chunk-WRIPTYSN.js} +1 -1
- package/dist/{chunk-GELPKSLC.js → chunk-WYOEOJM2.js} +1 -1
- package/dist/{chunk-B4Q6FMIP.js → chunk-XFTF7OOY.js} +3 -3
- package/dist/{chunk-QISE272H.js → chunk-XJ4TJARR.js} +1 -1
- package/dist/{chunk-KDXQNLVV.js → chunk-XLVH4CIZ.js} +3 -3
- package/dist/{chunk-DUAXZYAD.js → chunk-XMTSHHYQ.js} +3 -3
- package/dist/{chunk-XWKUZJCP.js → chunk-YMLC55J4.js} +1 -1
- package/dist/chunk-Z7S3IWUX.js +2 -0
- package/dist/chunk-ZDAO5D6D.js +16 -0
- package/dist/{chunk-TZFT7R7B.js → chunk-ZHKBSKCB.js} +1 -1
- package/dist/chunk-ZIJLOYXX.js +21 -0
- package/dist/{chunk-4ONGF4NT.js → chunk-ZKRL6HMY.js} +2 -2
- package/dist/{chunk-2R7KL7YG.js → chunk-ZSFOANLG.js} +1 -1
- package/dist/committer-C6UCDYMC.js +2 -0
- package/dist/{config-6TQIMTNB.js → config-5UNFAVY6.js} +1 -1
- package/dist/cover-cmd-5LPHIOSI.js +3 -0
- package/dist/{credentials-ZSNM4BTD.js → credentials-64JYS7AQ.js} +1 -1
- package/dist/{deps-bundle-D2ZC2SPT.js → deps-bundle-5JPHXHQV.js} +1 -1
- package/dist/{deps-resolve-VRBMFUTX.js → deps-resolve-WFZZ22XH.js} +1 -1
- package/dist/descriptor-PWUUNYV7.js +2 -0
- package/dist/design-committer-UPC6NZUF.js +2 -0
- package/dist/device-ref-LAZWPRQN.js +2 -0
- package/dist/dispatch-JLMCXOSK.js +2 -0
- package/dist/doctor-KJMR7NRK.js +2 -0
- package/dist/dossier-Y6TJWFZU.js +3 -0
- package/dist/evidence-OFTY5U4X.js +2 -0
- package/dist/evolve-cmd-LU6LPT4F.js +2 -0
- package/dist/exit-manager-ZLDO54S4.js +2 -0
- package/dist/{explain-UAAQWHYR.js → explain-3HAZY7Q6.js} +1 -1
- package/dist/{explain-cmd-EX24XKD6.js → explain-cmd-RMJPXD4U.js} +1 -1
- package/dist/{explain-cmd-2TKO7GRW.js → explain-cmd-XCRO4AS6.js} +1 -1
- package/dist/{extract-bind-TJ2STXV5.js → extract-bind-YYIOEAYR.js} +3 -3
- package/dist/{extract-cmd-FLOYO6HL.js → extract-cmd-Q7OG6RY6.js} +2 -2
- package/dist/{feeder-C3TOJPKK.js → feeder-IOR3XRNF.js} +1 -1
- package/dist/gaps-cmd-JIUM5YDY.js +3 -0
- package/dist/{gate-54BRAE7N.js → gate-E3BLIUEA.js} +1 -1
- package/dist/{generate-headless-DBT4MKQT.js → generate-headless-NCVM643E.js} +2 -2
- package/dist/index.js +137 -131
- package/dist/ingest-TTUQ7UDK.js +2 -0
- package/dist/ingest-cmd-42VRDSPV.js +2 -0
- package/dist/install-5NMP6ZV4.js +2 -0
- package/dist/{interactive-bind-7UDJY4CF.js → interactive-bind-ZDJS7PCV.js} +4 -4
- package/dist/lifecycle-cmd-KSMETBPP.js +2 -0
- package/dist/list-cmd-V3HJ5K4O.js +3 -0
- package/dist/{list-commands-DA4ZXOPJ.js → list-commands-3IKFZSGB.js} +1 -1
- package/dist/logical-ids-MLXAH45L.js +2 -0
- package/dist/login-flow-UXUQ7GQT.js +2 -0
- package/dist/{maintenance-cmd-6XSVO6FO.js → maintenance-cmd-VFYGKY3X.js} +1 -1
- package/dist/{mobile-prompts-JS7GPVKS.js → mobile-prompts-XPQSRBIW.js} +1 -1
- package/dist/persist-recorded-session-MFQ7JCLJ.js +3 -0
- package/dist/phase-seed-BMOSAA74.js +2 -0
- package/dist/pipeline-2XITQU5W.js +2 -0
- package/dist/prepare-target-CKRWHYXS.js +2 -0
- package/dist/readmodel-TDRFVDVI.js +2 -0
- package/dist/reconcile-cmd-BKIJFVQT.js +2 -0
- package/dist/reconcile-deps-Y5G456WD.js +4 -0
- package/dist/reconcile-engine-WDC2MEOY.js +2 -0
- package/dist/{recording-banner-YMKWR3M3.js → recording-banner-P3RUW62P.js} +1 -1
- package/dist/records-JLS63SDI.js +2 -0
- package/dist/registry-OEY4IXB6.js +2 -0
- package/dist/{require-project-folder-3KS7KTME.js → require-project-folder-ZGQLWZV5.js} +1 -1
- package/dist/resolve-run-intent-DHZD6A4B.js +2 -0
- package/dist/{resolver-V5VP5FLT.js → resolver-W54NOQXY.js} +1 -1
- package/dist/revert-PRR3D4XM.js +2 -0
- package/dist/review-cmd-SAGIKWEW.js +4 -0
- package/dist/run-7TZTUTTU.js +2 -0
- package/dist/run-BGQTRIU4.js +2 -0
- package/dist/{run-test-md-FO2RNNOD.js → run-test-md-WO2UDYPM.js} +2 -2
- package/dist/{sessions-cmd-ZZIZN2VB.js → sessions-cmd-VDQGRBEM.js} +1 -1
- package/dist/{skill-installer-W4TT5MST.js → skill-installer-UTVUPOTD.js} +1 -1
- package/dist/{spawner-ZSYJQGQW.js → spawner-SHCGHLQS.js} +1 -1
- package/dist/{structured-answers-5EY2AZN7.js → structured-answers-YAVW65G4.js} +1 -1
- package/dist/tcg-generate-YDNE643C.js +2 -0
- package/dist/testmd-actions-UCJ4ULSX.js +2 -0
- package/dist/token-refresh-ZNV2OSZC.js +2 -0
- package/dist/{validate-basic-727KRHX6.js → validate-basic-XEPS5I6V.js} +1 -1
- package/dist/verdicts-SOX22V6V.js +2 -0
- package/dist/{version-check-A2JQYRI2.js → version-check-LWDLMWBJ.js} +1 -1
- package/dist/{view-cmd-KPJTP4DI.js → view-cmd-SXXNDZIC.js} +1 -1
- package/dist/walk-session-M3OIWR5K.js +2 -0
- package/dist/with-telemetry-SF5RHYQE.js +2 -0
- package/package.json +11 -14
- package/dist/ConfigView-EOYCKYJS.js +0 -2
- package/dist/EvidenceViewOffer-AQ3KB3EN.js +0 -2
- package/dist/FolderPicker-RCHRYYC4.js +0 -2
- package/dist/SingleShotApp-AY3XFEYT.js +0 -2
- package/dist/TestMdRunView-RPW4MIJA.js +0 -2
- package/dist/bridge-GQJ35GTL.js +0 -2
- package/dist/chat-committer-ZWWCLJFD.js +0 -2
- package/dist/chat-controller-R4THYYPU.js +0 -2
- package/dist/chunk-3Q6WAK6P.js +0 -2
- package/dist/chunk-56PAQAX5.js +0 -19
- package/dist/chunk-B5QGIUJA.js +0 -26
- package/dist/chunk-BRTARADN.js +0 -4
- package/dist/chunk-CZUOGGUK.js +0 -2
- package/dist/chunk-DEZ7CXGM.js +0 -21
- package/dist/chunk-ESC7AOCX.js +0 -2
- package/dist/chunk-KLTKEGDH.js +0 -355
- package/dist/chunk-LN7233E2.js +0 -20
- package/dist/chunk-LQQXPY5B.js +0 -4
- package/dist/chunk-MKSTP2XN.js +0 -26
- package/dist/chunk-Q4V2GK5U.js +0 -2
- package/dist/chunk-QBG7XEGQ.js +0 -15
- package/dist/chunk-QQAAPFIR.js +0 -2
- package/dist/chunk-R5T4RLF5.js +0 -2
- package/dist/chunk-SORVX3KI.js +0 -7
- package/dist/chunk-TH47OOBV.js +0 -4
- package/dist/chunk-TRJUD3XJ.js +0 -5
- package/dist/chunk-V444REBC.js +0 -11
- package/dist/chunk-VAYBKR76.js +0 -4
- package/dist/chunk-WXHQYYD5.js +0 -2
- package/dist/chunk-XQFITNA3.js +0 -2
- package/dist/chunk-ZSXDZI56.js +0 -20
- package/dist/committer-SWEWEYNX.js +0 -2
- package/dist/cover-cmd-7JILZJUK.js +0 -3
- package/dist/descriptor-OEUZZCOK.js +0 -2
- package/dist/design-committer-VYT6NU3T.js +0 -2
- package/dist/dispatch-2PBSJ7YW.js +0 -2
- package/dist/doctor-OWRRDA4Z.js +0 -2
- package/dist/dossier-KTLTGT2X.js +0 -3
- package/dist/evidence-NDAKCCHQ.js +0 -2
- package/dist/evolve-cmd-DIA5EWUT.js +0 -2
- package/dist/exit-manager-3FVBTNYR.js +0 -2
- package/dist/gaps-cmd-3ZX3PZF4.js +0 -3
- package/dist/ingest-JO5NJENZ.js +0 -2
- package/dist/ingest-cmd-T6HM3AHK.js +0 -2
- package/dist/install-NIVU4XVS.js +0 -2
- package/dist/lifecycle-cmd-O2324GN6.js +0 -2
- package/dist/list-cmd-N4KMA34H.js +0 -3
- package/dist/logical-ids-TEBCQJGO.js +0 -2
- package/dist/login-flow-NHBJVDW6.js +0 -2
- package/dist/persist-recorded-session-LE3LGFOS.js +0 -3
- package/dist/phase-seed-DIRETNU6.js +0 -2
- package/dist/pipeline-MTAZDCZR.js +0 -2
- package/dist/prepare-target-YK2DLDWB.js +0 -2
- package/dist/readmodel-XOYGGQ3S.js +0 -2
- package/dist/reconcile-cmd-CYRYVS5B.js +0 -2
- package/dist/reconcile-deps-FYXRAMF2.js +0 -4
- package/dist/reconcile-engine-6AT6EVGS.js +0 -2
- package/dist/records-IOZTZUZV.js +0 -2
- package/dist/registry-V45ZQ6Q5.js +0 -2
- package/dist/resolve-run-intent-W32G6WM6.js +0 -2
- package/dist/revert-NQ7GEVSE.js +0 -2
- package/dist/review-cmd-DQRKQUMG.js +0 -4
- package/dist/run-26IR3CKX.js +0 -2
- package/dist/run-5IYI2TJI.js +0 -2
- package/dist/tcg-generate-ONLV5GXG.js +0 -2
- package/dist/testmd-actions-NPILETCQ.js +0 -2
- package/dist/token-refresh-G2CSTY4B.js +0 -2
- package/dist/types-O23GN2YM.js +0 -2
- package/dist/verdicts-TDJLJJ3F.js +0 -2
- package/dist/walk-session-HB3OOWVR.js +0 -2
- package/dist/with-telemetry-HSD6CXDS.js +0 -2
package/bin/kane-cli.cjs
CHANGED
|
@@ -7,7 +7,11 @@
|
|
|
7
7
|
// would parse as ESM where `require` is undefined.)
|
|
8
8
|
// Escape hatch: KANE_CLI_SYSTEM_NODE=1 forces the system node, silently.
|
|
9
9
|
"use strict";
|
|
10
|
-
|
|
10
|
+
// System-node fallback floor, lockstep with the tsup target. Deliberately NOT
|
|
11
|
+
// mirrored into package.json "engines": npm resolves a bare install to the
|
|
12
|
+
// newest version whose engines match the host node, so an engines floor makes
|
|
13
|
+
// old-node hosts silently install an old CLI instead of this one.
|
|
14
|
+
var MIN_MAJOR = 20;
|
|
11
15
|
var path = require("path");
|
|
12
16
|
var entry = path.join(__dirname, "..", "dist", "index.js");
|
|
13
17
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
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-2R7KL7YG.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 yn}from"./chunk-CLGC7VEO.js";import{a as tt}from"./chunk-LQQXPY5B.js";import{a as nt,d as _e,e as Tn,f as St}from"./chunk-RKXHVP2Z.js";import{a as xn,b as kn,c as bn}from"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-6KPPGMO2.js";import{a as gn,b as hn,c as pn}from"./chunk-3LEVCW6R.js";import"./chunk-NVGBE2DR.js";import{a as dn}from"./chunk-5Y2G4NC7.js";import"./chunk-TH47OOBV.js";import"./chunk-VAYBKR76.js";import"./chunk-CUM23TLF.js";import"./chunk-DUAXZYAD.js";import"./chunk-DBIBROYW.js";import"./chunk-WXHQYYD5.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import{a as et}from"./chunk-YCCUBQY4.js";import{a as mn}from"./chunk-RDNKYRKY.js";import{x as r}from"./chunk-OFW3ZVTP.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 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-ZSFOANLG.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 yn}from"./chunk-O5U6EAL3.js";import{a as tt}from"./chunk-IWVA37B6.js";import{a as nt,d as _e,e as Tn,f as St}from"./chunk-RKXHVP2Z.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 gn,b as hn,c as pn}from"./chunk-UYLNH4SH.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-5M5BG4MT.js";import{x as r}from"./chunk-LPH4TERT.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(`
|
|
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(`
|
|
@@ -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-AO5QH6UU.js";import"./chunk-Q6743UUQ.js";import"./chunk-LPH4TERT.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-5YCOYFZH.js";import"./chunk-Q6743UUQ.js";import"./chunk-LPH4TERT.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-WDOEMLFZ.js";import"./chunk-WRIPTYSN.js";import"./chunk-5Y2G4NC7.js";import"./chunk-LPH4TERT.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as C,b as l,c as o}from"./chunk-5M5BG4MT.js";import{x as n}from"./chunk-LPH4TERT.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-LMYE3M75.js";import"./chunk-ZIJLOYXX.js";import"./chunk-QQ5MHSSY.js";import"./chunk-7RTITBZG.js";import"./chunk-5GUD3CIH.js";import"./chunk-YMLC55J4.js";import"./chunk-H4WIA4IP.js";import"./chunk-EHN5HTUD.js";import"./chunk-IPEA7ZOF.js";import"./chunk-NVGBE2DR.js";import"./chunk-CH273NAE.js";import"./chunk-VZ7KXRXB.js";import"./chunk-P7YZ3PU3.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"./chunk-SQWVGI3J.js";import"./chunk-RFHMDQXZ.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-HK3FFI7Y.js";import"./chunk-MSGW4JDG.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-4JOD47QI.js";import"./chunk-V5DYLGAM.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-LPH4TERT.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-XJ4TJARR.js";import"./chunk-YCCUBQY4.js";import"./chunk-PYHWCV2V.js";import"./chunk-BPMSNGXQ.js";import"./chunk-Q6743UUQ.js";import"./chunk-V5DYLGAM.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-LPH4TERT.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-FL6TCYA5.js";import"./chunk-5M5BG4MT.js";import"./chunk-LPH4TERT.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-PQYBIWZH.js";import"./chunk-LPH4TERT.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-S6M36UIV.js";import"./chunk-Q6743UUQ.js";import"./chunk-LPH4TERT.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-ZHKBSKCB.js";import"./chunk-YCCUBQY4.js";import"./chunk-PYHWCV2V.js";import"./chunk-BPMSNGXQ.js";import"./chunk-Q6743UUQ.js";import"./chunk-V5DYLGAM.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-LPH4TERT.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-WYOEOJM2.js";import"./chunk-S3DAAAE5.js";import"./chunk-FL6TCYA5.js";import"./chunk-5M5BG4MT.js";import"./chunk-LPH4TERT.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-7YX2HUHY.js";import"./chunk-DHPBVHED.js";import"./chunk-4BIJCAR4.js";import"./chunk-OO7LFDET.js";import"./chunk-VZ7KXRXB.js";import"./chunk-TDPWFYTJ.js";import"./chunk-O4IEPE3T.js";import"./chunk-UY2ES2Z6.js";import"./chunk-ZHKBSKCB.js";import"./chunk-XJ4TJARR.js";import"./chunk-YCCUBQY4.js";import"./chunk-PYHWCV2V.js";import"./chunk-BPMSNGXQ.js";import"./chunk-VE3SUJMA.js";import"./chunk-TZXXJWHA.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-6T3DWH56.js";import"./chunk-TAOHYWEO.js";import"./chunk-Q6743UUQ.js";import"./chunk-Z7S3IWUX.js";import"./chunk-GZLQ2AR6.js";import"./chunk-V5DYLGAM.js";import"./chunk-DPUV6OSP.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-H6YGG3GC.js";import"./chunk-LPH4TERT.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-QVR2PB6Y.js";import"./chunk-FL6TCYA5.js";import"./chunk-5M5BG4MT.js";import"./chunk-LPH4TERT.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-7CXIOJB3.js";import"./chunk-UPHF2J5E.js";import"./chunk-3GZ4FQ4L.js";import"./chunk-P7YZ3PU3.js";import"./chunk-TDPWFYTJ.js";import"./chunk-O4IEPE3T.js";import"./chunk-WRIPTYSN.js";import"./chunk-5Y2G4NC7.js";import"./chunk-2MQP4SSF.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-HK3FFI7Y.js";import"./chunk-MSGW4JDG.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-V5DYLGAM.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-FL6TCYA5.js";import"./chunk-5M5BG4MT.js";import"./chunk-LPH4TERT.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-QXLX6LMJ.js";import"./chunk-7RTITBZG.js";import"./chunk-RFHMDQXZ.js";import"./chunk-V5DYLGAM.js";import"./chunk-5M5BG4MT.js";import"./chunk-LPH4TERT.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-5M5BG4MT.js";import{x as o}from"./chunk-LPH4TERT.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};
|
|
@@ -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-6T3DWH56.js";import"./chunk-TAOHYWEO.js";import"./chunk-RZ4F3BHX.js";import"./chunk-LPH4TERT.js";import"./chunk-UR6MHSHU.js";export{a as isAppId,b as resolveCloudApp};
|
|
@@ -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-64JYS7AQ.js"),import("./resolver-W54NOQXY.js"),import("./config-5UNFAVY6.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-SHCGHLQS.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-AZ73FJRK.js";import"./chunk-5LYPSIBC.js";import"./chunk-LPH4TERT.js";import"./chunk-UR6MHSHU.js";export{b as ensureHyperexecuteBinary,a as hyperexecuteDownloadUrl};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as _}from"./chunk-
|
|
3
|
-
`),2;let{makeHeadlessIO:s,agentRefusal:d}=await import("./headless-io-66RG5NN5.js");return d(s("ndjson","design"),t,r)};if(e.mode!=null&&!["interactive","agent","ci","override"].includes(e.mode)){let{makeHeadlessIO:t,agentRefusal:r}=await import("./headless-io-66RG5NN5.js");return r(t("ndjson","design"),`design: --mode must be interactive | agent | ci | override, got '${e.mode}'`,"MODE_USAGE")}let T=H(e);if("error"in T)return p(T.error);let o=T;{let{validateResumeMessage:t}=await import("./headless-io-66RG5NN5.js"),r=t(o,"design");if(r)return p(r)}{let{gateStructuredFlags:t}=await import("./structured-answers-
|
|
2
|
+
import{a as _}from"./chunk-OGJR5VIG.js";import"./chunk-ZKSN2SJ7.js";import"./chunk-N7Z7BQYO.js";import"./chunk-KGKJU27A.js";import"./chunk-JUJ4SAGH.js";import"./chunk-UDW4ZZAW.js";import"./chunk-FGRTNRBS.js";import"./chunk-5G22NOZK.js";import"./chunk-NAZ36RKI.js";import"./chunk-BB2W35TW.js";import"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-BZAGVBCX.js";import"./chunk-IVQX3AKL.js";import"./chunk-KRKGZ2ZW.js";import"./chunk-WPSQYEBP.js";import"./chunk-WALVOFKR.js";import"./chunk-2UIHS2FH.js";import"./chunk-YKTYVJBN.js";import"./chunk-EV64VI66.js";import"./chunk-GX3FPJUG.js";import"./chunk-427OQS2N.js";import"./chunk-54JZ6VEW.js";import"./chunk-DNNZ353O.js";import"./chunk-Q2F5QB2W.js";import"./chunk-R7QAS6LZ.js";import"./chunk-BKHXPBWN.js";import"./chunk-N2P4MI32.js";import"./chunk-ZDAO5D6D.js";import"./chunk-5DT7PIGB.js";import"./chunk-H4WIA4IP.js";import"./chunk-IPEA7ZOF.js";import"./chunk-NVGBE2DR.js";import{a as m}from"./chunk-CH273NAE.js";import"./chunk-VZ7KXRXB.js";import"./chunk-IDX3TOPY.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"./chunk-MSGW4JDG.js";import"./chunk-5EOX4MEY.js";import"./chunk-EYOCNMUM.js";import"./chunk-LPH4TERT.js";import"./chunk-UR6MHSHU.js";import{existsSync as O}from"fs";var P=new Set(["interactive","agent","ci","override"]);function H(e){return e.mode!=null&&!P.has(e.mode)?{error:`design: --mode must be interactive | agent | ci | override, got '${e.mode}'`}:e.strength!=null&&e.strength!=="pairwise"&&e.strength!=="3-wise"?{error:`design: --strength must be pairwise | 3-wise, got '${e.strength}'`}:e.max!=null&&(!Number.isInteger(e.max)||e.max<1)?{error:"design: --max must be a positive integer"}:!e.useCase&&!e.resume?{error:"design: --use-case is required (or --resume <sid> \u2014 the session remembers its use-case)"}:{useCase:e.useCase,max:e.max,strength:e.strength,mode:e.mode,force:e.force,resume:e.resume,plan:e.plan,message:e.message,phase:e.phase,allowUnreviewed:e.allowUnreviewed,because:e.because,changeDelta:e.changeDelta,priorDesign:e.priorDesign}}async function B(e){let p=async(t,r)=>{if(e.mode!=="agent")return process.stderr.write(t+`
|
|
3
|
+
`),2;let{makeHeadlessIO:s,agentRefusal:d}=await import("./headless-io-66RG5NN5.js");return d(s("ndjson","design"),t,r)};if(e.mode!=null&&!["interactive","agent","ci","override"].includes(e.mode)){let{makeHeadlessIO:t,agentRefusal:r}=await import("./headless-io-66RG5NN5.js");return r(t("ndjson","design"),`design: --mode must be interactive | agent | ci | override, got '${e.mode}'`,"MODE_USAGE")}let T=H(e);if("error"in T)return p(T.error);let o=T;{let{validateResumeMessage:t}=await import("./headless-io-66RG5NN5.js"),r=t(o,"design");if(r)return p(r)}{let{gateStructuredFlags:t}=await import("./structured-answers-YAVW65G4.js"),r=t(e,"design");if(r)return p(r,"STRUCTURED_FLAGS_USAGE")}if(!O(m(process.cwd())))return p("error: no context store here (run `kane-cli context ingest` + `kane-cli context extract` first)","NO_STORE");let y=!!o.resume;if(o.useCase&&o.resume&&!e.allowUnreviewed)try{let{peekSession:t}=await import("./sessions-GIEXOCE4.js"),r=t(m(process.cwd()),o.resume);y=!!(r&&r.use_case===o.useCase)}catch{y=!1}if(o.useCase&&!y&&!e.allowUnreviewed)try{let[{openGraph:t},{designEntryCheck:r}]=await Promise.all([import("./readmodel-TDRFVDVI.js"),import("./trust-gate-EX7R2P4Y.js")]),s=r(t(m(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:l}=await import("readline/promises"),c=l({input:process.stdin,output:process.stderr}),f=(await c.question(`design: ${s.detail}
|
|
4
4
|
Design against it anyway? (y/N) `)).trim().toLowerCase();if(c.close(),f!=="y"&&f!=="yes")return process.stderr.write(`aborted \u2014 approve it first: ${s.reviewCmd}
|
|
5
5
|
`),2}else if(e.mode==="agent"){let{makeHeadlessIO:l}=await import("./headless-io-66RG5NN5.js"),c=l("ndjson","design");return c.event({type:"error",code:s.code,message:`design: ${s.detail}`,next:[s.reviewCmd]}),c.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})
|
|
6
6
|
`),2}catch(t){process.env.KANE_DEBUG&&process.stderr.write(`trust gate skipped: ${String(t)}
|
|
7
7
|
`)}let i=null,x=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
|
|
8
8
|
`),2;let t=o.mode??"interactive";if(t==="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)
|
|
9
|
-
`),2;let{bindDesignInteractive:n}=await import("./interactive-bind-
|
|
9
|
+
`),2;let{bindDesignInteractive:n}=await import("./interactive-bind-ZDJS7PCV.js");return await n(o)}let{resolveAgentAuthEnv:r}=await import("./spawner-SHCGHLQS.js"),{runAgent:s}=await import("./bridge-6DCBL3GY.js"),{preflightTurn:d}=await import("./turn-preflight-JGYT7LXP.js"),{makeInterruptGuard:l}=await import("./interrupt-guard-UREUWNRL.js"),{baseUrlAdvisory:c}=await import("./turn-preflight-JGYT7LXP.js"),{makeHeadlessIO:f,resolveEncoding:D,guardedChannels:R}=await import("./headless-io-66RG5NN5.js"),{withStructuredNext:A,prepareStructuredResume:U}=await import("./structured-answers-YAVW65G4.js");i=A(f(D(t),"design"));let{runWithChannel:$}=await import("./run-channel-RGH4WIQX.js"),w=i,I=D(t)==="ndjson"?n=>$({event:g=>w.event(g)},n):n=>n(),E=n=>{w.out(n),w.event({type:"note",text:n})},{telemetryBootstrap:N,telemetryEnvName:G}=await import("./bootstrap-4XBQFKWF.js"),u=N({verb:"design",mode:t,contextRoot:m(process.cwd()),env:G(),resumeSid:o.resume,write:!0,longSession:!0});x=n=>u.end(n);let a=U({opts:e,contextDir:m(process.cwd()),verb:"design"});if(a.kind==="refuse")return i.out(a.error),t==="agent"&&i.event({type:"error",message:a.error,code:a.code}),await u.end({exit_code:2}),t==="agent"?i.done(2,"refused"):2;let C;if(a.kind==="apply"){for(let n of a.notes)E(n);if(a.matchedQids.length>0){E(`applying ${a.matchedQids.length} structured answer(s) from --answer to the paused session's pending questions`);for(let n of a.matchedQids)i.event({type:"panel_resolved",id:n,by:"user",via:"flag"})}a.statement&&(C=[o.message,a.statement].filter(Boolean).join(`
|
|
10
10
|
|
|
11
11
|
`))}let b=c();b&&E(b);let v=l(s,n=>i.out(n)),k=R(i,()=>v.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let n=t==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY?async h=>{let{createInterface:Y}=await import("readline/promises"),S=Y({input:process.stdin,output:process.stdout});try{return/^y(es)?$/i.test((await S.question(`${h} [y/N] `)).trim())}finally{S.close()}}:void 0,g=await I(async()=>{let h={...await r(),...u.spawnEnv()};return _({...o,mode:t,...C!==void 0?{message:C}:{},...n?{confirmRetarget:n}:{}},{contextDir:m(process.cwd()),agent:v.agent,preflightTurn:()=>d(h),ask:async()=>[],out:k.out,emit:k.emit,progress:w.progress,isTTY:!1,auth:h,telemetry:u})});return v.interrupted()&&g!==3?(i.out("interrupted \u2014 no session saved"),await u.end({exit_code:130}),i.done(130)):(g===1&&i.out(u.supportFooter()),await u.end({exit_code:g}),i.done(g))}finally{v.dispose()}}catch(t){x&&await x({exit_code:1}).catch(()=>{});let r=t instanceof Error?t.message:String(t);i?.event({type:"error",message:`error: design failed: ${r}`});let s=i?d=>i.out(d):d=>process.stderr.write(d+`
|
|
12
12
|
`);return s(`error: design failed: ${r}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&t instanceof Error&&t.stack&&s(t.stack),s('hint: the full trace is in the file named on the "trace:" line at the start of this run'),i?i.done(1):1}}export{B 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-LI5FMAUO.js";import"./chunk-4PMZ5FCD.js";import"./chunk-KBM3XHAM.js";import"./chunk-2YEHV2CX.js";import"./chunk-IDX3TOPY.js";import"./chunk-BKM2LWU2.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-LPH4TERT.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-BYOXTXLC.js";import"./chunk-K6JRFRGS.js";import"./chunk-WPSQYEBP.js";import"./chunk-UD7KKHPW.js";import"./chunk-LPH4TERT.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-LPH4TERT.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 as P,c as fe}from"./chunk-BZAGVBCX.js";import{a as L,b as ge}from"./chunk-IVQX3AKL.js";import{a as he}from"./chunk-427OQS2N.js";import{d as ue}from"./chunk-NVGBE2DR.js";import{B as ae,C as le,E as pe,e as oe,f as re,h as ce,p as A}from"./chunk-W3Z7AZNT.js";import{a as de}from"./chunk-JQW2QFSX.js";import"./chunk-6FCPS2VT.js";import{a as _,b as x}from"./chunk-UH2ZTX4E.js";import{g as ie,j as se}from"./chunk-XMTSHHYQ.js";import"./chunk-DBIBROYW.js";import{e as k,f as D,g as ne,h as H}from"./chunk-AKX4VRRR.js";import"./chunk-IAHKTEET.js";import"./chunk-UD7KKHPW.js";import"./chunk-UR6MHSHU.js";var Ie=new Set(["approve","edit","reject"]);function Ae($){let{contextDir:m,graph:s,ops:me,by:f}=$,F=$.mintable??he(),j=ie(m);if(s.latestHash!==j)return{record:null,errors:[{code:"STALE_BASIS",detail:`graph opened at ${String(s.latestHash)} but chain head is ${String(j)} \u2014 re-open and retry`}]};let U=[],y=[],Y=new Set;for(let e of me){if(s.appliedEvents.has(e.eventId)||Y.has(e.eventId)){U.push(e.eventId);continue}Y.add(e.eventId),y.push(e)}if(y.length===0)return{record:null,errors:null,applied:[],skipped:U,minted:[],staleDelta:[]};let o=[],M=[],I=[],C=[],v=[],G=[],B=[...$.judgements??[]],V=[],J=new Map,z=new Set,Q=[],T=new Set,ve=new Set(F),X=new Set;for(let e of y){if(!Ie.has(e.kind))continue;let n=e.target,t=s.resolve(n),i=t?s.tipOf(t.cid):n;X.has(i)&&o.push({code:"MULTIPLE_TERMINAL_OPS",detail:`${n} has more than one terminal op in this turn \u2014 normalize latest-wins first`}),X.add(i)}let R=(e,n,t)=>{let i=s.resolve(n);if(!i)return o.push({code:"UNKNOWN_NODE",detail:`${e}: ${n} names nothing in the graph`}),null;let d=s.tipOf(i.cid);return d!==t||s.superseded.has(t)?(o.push({code:"EXPECTED_CID_MOVED",detail:`${e}: ${n} moved or was archived since it was displayed`,data:{tip:d}}),null):t},K=e=>new Set(pe(s,s.tipOf(e))),S=[],E=new Set,Z=e=>({code:"RETRACT_FORBIDDEN",detail:`retract ${e}: provenance edges cannot be retracted \u2014 DERIVES is historical evidence; reject or edit the node instead`});for(let e of y){if(e.kind!=="retract"){S.push(e);continue}let n=R("retract",e.target,e.expectedCid);if(!n)continue;let t=new Map;for(let d of K(n))for(let a of[...s.edgesFrom(d),...s.edgesInto(d)])t.set(a.ecid,a);let i;if(e.edgeEcid!==void 0){if(s.superseded.has(e.edgeEcid)){o.push({code:"UNKNOWN_EDGE",detail:`retract ${e.target}: ${e.edgeEcid} is already retracted`});continue}if(i=t.get(e.edgeEcid),!i){o.push({code:"UNKNOWN_EDGE",detail:`retract ${e.target}: ${e.edgeEcid} is not a live edge touching ${e.target} (checked the full version chain)`});continue}}else if(e.edgeRef!==void 0){let d=e.edgeRef;if(d.type===k.DERIVES){o.push(Z(e.target));continue}let a=(r,c)=>{let N=A(s,c);if(N)return N;let b=s.resolve(c)!==null;return o.push(b?{code:"TOMBSTONED_REF",detail:`retract ${e.target}: ${d.type} ${r} '${c}' is tombstoned (retired with no live successor) \u2014 pick a live node`}:{code:"UNKNOWN_REF",detail:`retract ${e.target}: ${d.type} ${r} got (unknown) for '${c}' \u2014 not a committed node (a node added in this same turn has no id yet: commit the add first)`}),null},g=a("dst",d.dst);if(!g)continue;let l=K(g.cid),p=null;if(d.src!==void 0){let r=a("src",d.src);if(!r)continue;p=K(r.cid)}let h=[...t.values()].filter(r=>r.type===d.type&&l.has(r.dst)&&(p===null||p.has(r.src)));if(h.length===0){o.push({code:"UNKNOWN_EDGE",detail:`retract ${e.target}: no live ${d.type} edge onto ${d.dst}${d.src!==void 0?` from ${d.src}`:""} touches ${e.target} (checked the full version chain)`});continue}if(h.length>1){let r=h.map(c=>`${c.type} ${s.displayNameOf(c.src)??c.src} \u2192 ${s.displayNameOf(c.dst)??c.dst} (${c.ecid})`).join("; ");o.push({code:"AMBIGUOUS_RETRACT",detail:`retract ${e.target}: ${h.length} live ${d.type} edges match \u2014 ${r} \u2014 add src to disambiguate`});continue}i=h[0]}else{o.push({code:"INVALID_RETRACT",detail:`retract ${e.target}: neither edge_ecid nor edge {type, dst, src?} was given`});continue}if(i.type===k.DERIVES){o.push(Z(e.target));continue}if(E.has(i.ecid)){o.push({code:"EDGE_RETRACTED",detail:`retract ${e.target}: ${i.ecid} was retracted earlier in this turn`});continue}E.add(i.ecid),S.push({kind:"retract",target:e.target,expectedCid:e.expectedCid,edgeEcid:i.ecid,reason:e.reason,eventId:e.eventId})}let w=new Map;for(let e of S){if(e.kind!=="edit")continue;let n=s.resolve(e.target);if(!n||s.tipOf(n.cid)!==e.expectedCid||s.superseded.has(e.expectedCid))continue;let t=s.getNode(e.expectedCid);if(!t)continue;let i={...t.content};for(let[a,g]of Object.entries(e.edit))g!==void 0&&(i[a]=g);if(typeof i.title=="string"&&!i.title.trim()||D(t.label,i).length>0)continue;let d=_(t.label,i);d!==e.expectedCid&&w.set(e.expectedCid,d)}for(let e of S)if(e.kind==="approve"){let n=R("approve",e.target,e.expectedCid);n&&C.push({id:n,kind:"review-item",resolution:"approved",edit:null,reason:null,by:f})}else if(e.kind==="reject"){let n=R("reject",e.target,e.expectedCid);if(!n)continue;if(C.push({id:n,kind:"review-item",resolution:"rejected",edit:null,reason:e.reason,by:f}),e.redirectTo!==void 0){let t=s.resolve(e.redirectTo);if(!t||t.superseded){o.push({code:"UNKNOWN_NODE",detail:`reject.redirectTo: ${e.redirectTo} is not a live node`});continue}v.push({kind:"node",old:n,new:t.cid,reason:e.reason,by:f})}}else if(e.kind==="edit"){let n=R("edit",e.target,e.expectedCid);if(!n)continue;let t=s.getNode(n);if(!t){o.push({code:"UNKNOWN_NODE",detail:`edit: ${e.target} node file unreadable`});continue}let i={...t.content};for(let[l,p]of Object.entries(e.edit))p!==void 0&&(i[l]=p);if(typeof i.title=="string"&&!i.title.trim()){o.push({code:"EMPTY_TITLE",detail:`edit: ${e.target} edited title is empty`});continue}let d=D(t.label,i);if(d.length>0){for(let l of d)o.push({code:l.code,detail:`edit ${e.target}: ${l.detail}`});continue}let a=_(t.label,i);if(a===n){C.push({id:n,kind:"review-item",resolution:"approved",edit:null,reason:null,by:f});continue}if(oe(s,n,a)){o.push({code:"SUPERSEDE_CYCLE",detail:`edit ${e.target}: edit reproduces an already-superseded version (supersession cycle guard) \u2014 re-edit forward or redesign`});continue}let g=re({graph:s,oldTip:n,newCid:a,newLabel:t.label,by:f,reason:`re-blessed onto ${a} (edited in chat)`,skipEcids:E,dstRedirect:w});if(g.errors.length>0){for(let l of g.errors)o.push({code:"REBLESS_REFUSED",detail:`edit ${e.target}: ${l}`});continue}M.push({cid:a,label:t.label,content:i}),I.push(...g.edges),v.push({kind:"node",old:n,new:a,reason:e.reason??"edited in chat",by:f}),v.push(...g.supersessions),C.push({id:a,kind:"review-item",resolution:"edited",edit:{...e.edit},reason:null,by:f})}else if(e.kind==="enhance"){if(!R("enhance",e.target,e.expectedCid))continue;for(let t of e.edges){let i=A(s,t.src),d=A(s,t.dst);if(!i||!d){let[u,W]=i?["dst",t.dst]:["src",t.src],ye=s.resolve(W)!==null;o.push(ye?{code:"TOMBSTONED_REF",detail:`enhance ${e.target}: ${t.type} ${u} '${W}' is tombstoned (retired with no live successor) \u2014 pick a live node`}:{code:"UNKNOWN_REF",detail:`enhance ${e.target}: ${t.type} ${u} got (unknown) for '${W}' \u2014 not a committed node (a node added in this same turn has no id yet: commit the add first)`});continue}let a=s.nodeLabel.get(i.cid)??"(unknown)",g=s.nodeLabel.get(d.cid)??"(unknown)";for(let u of H(t.type,a,g,t.props))o.push({code:u.code,detail:`enhance ${e.target}: ${u.detail}`});let l=x(t.type,i.cid,d.cid,t.props),p=w.get(i.cid)??i.cid,h=w.get(d.cid)??d.cid,r=x(t.type,p,h,t.props);if(s.superseded.has(l)||E.has(l)||s.superseded.has(r)){let u=s.superseded.has(l)||E.has(l)?l:r;o.push({code:"EDGE_RETRACTED",detail:`enhance ${e.target}: this ${t.type} edge was retracted (${u}) \u2014 re-adding a retracted edge is refused (revival unsupported)`});continue}if(s.edgesFrom(i.cid).some(u=>u.ecid===l)||I.some(u=>u.ecid===r))continue;let c=ce(s,t.type,i.cid,d.cid,Q);c&&o.push(c);let N=de(s,{type:t.type,src:i.cid,dst:d.cid},{pending:[],retracted:E},`enhance ${e.target}`);N&&o.push(N);let b=ne(t.type)?.cardinality;if(b==="one-live-per-src"||b==="one-live-per-src-and-dst"){let u=`${t.type}|${i.cid}`;T.has(u)&&o.push({code:"CARDINALITY_VIOLATION",detail:`${t.type} from ${i.cid}: two one-live edges in one turn`}),T.add(u)}if(b==="one-live-per-src-and-dst"){let u=`${t.type}|dst|${d.cid}`;T.has(u)&&o.push({code:"CARDINALITY_VIOLATION",detail:`${t.type} onto ${d.cid}: two one-live edges in one turn (strict 1:1)`}),T.add(u)}I.push({ecid:r,type:t.type,src:p,dst:h,props:t.props}),Q.push({src:i.cid,dst:d.cid,type:t.type})}}else if(e.kind==="retract")v.push({kind:"edge",ecid:e.edgeEcid,reason:e.reason,by:f});else if(e.kind==="add"){if(!ve.has(e.label)){o.push({code:"GATED_LABEL",detail:`add: ${e.label} is not mintable in v1 (gate: ${F.join("|")})`,data:{gate:[...F]}});continue}let n=s.heads.get(e.convSourceId),t=s.convChains.get(e.convSourceId);if(typeof n!="string"||!t){o.push({code:"CONV_SOURCE_MISSING",detail:`add: ${e.convSourceId} is not a live conversation source`});continue}let i=s.getNode(n)?.content?.blob,d=typeof i=="string"?ue(m,i)?.toString("utf8")??"":"",a=ge(d,e.cite.turn);if(a===null){o.push({code:"BAD_ANCHOR",detail:`add: ${L(e.cite.turn)} does not resolve in ${e.convSourceId}`});continue}if(!a.includes(e.cite.quote)){o.push({code:"QUOTE_MISMATCH",detail:`add: quote is not verbatim within ${L(e.cite.turn)}`});continue}let g={...e.content,derived:!0},l=D(e.label,g);if(l.length>0){for(let c of l)o.push({code:c.code,detail:`add: ${c.detail}`});continue}let p=_(e.label,g),h={source_id:e.convSourceId,source_cid:n,anchor:L(e.cite.turn),quote:e.cite.quote};for(let c of H(k.DERIVES,"source",e.label,h))o.push({code:c.code,detail:`add: ${c.detail}`});M.push({cid:p,label:e.label,content:g}),I.push({ecid:x("DERIVES",n,p,h),type:k.DERIVES,src:n,dst:p,props:h}),e.rationale&&B.push({about:p,rationale:e.rationale,by:f});let r=ae(e.label,c=>z.has(c),s.names.keys());r!==null&&(z.add(r),G.push({cid:p,slug:r,by:f})),V.push({cid:p,...r!==null?{slug:r}:{}}),J.set(e.eventId,p)}if(o.length)return{record:null,errors:o};let ee=new Date().toISOString();for(let e of S){if(e.kind==="add"){let n=J.get(e.eventId);n&&P(m,{ts:ee,command:"extract-chat",id:n,verdict:"add",polarity:"preference",tag:e.label,by:f,event_id:e.eventId,target:n});continue}for(let n of fe(e,{ts:ee,command:"extract-chat",by:f}))P(m,n)}let te=y.map(e=>e.eventId).sort(),Ee=se(m,{ts:new Date().toISOString(),proposal_id:null,nodes:M,edges:I,review:C,supersessions:v,...G.length>0?{names:G}:{},...B.length>0?{judgements:B}:{},event_ids:te,...$.sid?{sid:$.sid}:{},source_head_moves:{}},{expectPrev:j}),q=le(m),O=new Set;for(let e of v)if(e.kind==="node"){O.add(e.old);for(let n of q.edgesInto(e.old))O.add(n.src)}for(let e of V)O.add(e.cid);let $e=[...O].map(e=>({cid:e,state:q.stale(q.tipOf(e))})).filter(e=>e.state!=="fresh");return{record:Ee.record,errors:null,applied:te,skipped:U,minted:V,staleDelta:$e}}export{Ae as commitChatTurn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c}from"./chunk-IWVA37B6.js";import"./chunk-AXTPNZPX.js";import"./chunk-L2TV4G56.js";import"./chunk-IVQX3AKL.js";import"./chunk-NVGBE2DR.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"./chunk-UR6MHSHU.js";export{c as makeChatController,b as questionStub,a as recommendationPicks};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as ae}from"./chunk-MMBBQ4OZ.js";import{j as R}from"./chunk-HK3FFI7Y.js";import{c as ie,e as ne,i as re,j as K}from"./chunk-Z7S3IWUX.js";import{d as $,e as oe}from"./chunk-4JOD47QI.js";import{a as se}from"./chunk-RZ4F3BHX.js";import{spawn as Xe}from"child_process";import{closeSync as ze,existsSync as Ge,mkdirSync as We,openSync as Ye,readFileSync as Ze,rmSync as Qe}from"fs";import{homedir as ge}from"os";import{dirname as z,join as A}from"path";import{access as Re,mkdir as de,readFile as Le}from"fs/promises";import{homedir as Ce}from"os";import{arch as Fe,platform as Be}from"process";import{join as _}from"path";var Ue=35,qe="google_apis",Ve="KaneCLI_Pixel_API35",He="KaneAI_Pixel_API35";function Ht(t){return t===He?Ve:t}var je=1;function Ke(t,e){return t==="darwin"&&e==="arm64"?"arm64-v8a":"x86_64"}function Je(){return{home:Ce(),os:Be,arch:Fe}}async function le(t){try{return await Re(t),!0}catch{return!1}}var J=class{deps;constructor(e={}){this.deps={...Je(),...e}}paths(){let e=_(this.deps.home,".testmuai","kaneai","mobile"),r=_(e,"android-sdk");return{root:r,emulatorDir:_(r,"emulator"),systemImageDir:_(r,"system-images",`android-${Ue}`,qe,Ke(this.deps.os,this.deps.arch)),avdHome:_(e,"avd"),manifest:_(r,"sdk-manifest.json")}}environment(){let e=this.paths();return{ANDROID_HOME:e.root,ANDROID_SDK_ROOT:e.root,ANDROID_AVD_HOME:e.avdHome}}async ensureSdkRootMarkers(){let e=this.paths().root;await de(_(e,"platforms"),{recursive:!0}),await de(_(e,"platform-tools"),{recursive:!0})}async status(){let e=this.paths(),r=null;try{r=JSON.parse(await Le(e.manifest,"utf8"))}catch{}if(!r||r.schemaVersion!==je)return{emulator:!1,systemImage:!1};let o=this.deps.os==="win32"?"emulator.exe":"emulator";return{emulator:!!r.components.emulator&&await le(_(e.emulatorDir,o)),systemImage:!!r.components.systemImage&&await le(_(e.systemImageDir,"system.img"))}}},ue;function F(){return ue??=new J,ue}var G="android",et="http://127.0.0.1:4723/status",tt=2e3,X=(()=>{let t=Number(process.env.KANE_CLI_EMULATOR_BOOT_TIMEOUT_MS);return Number.isFinite(t)&&t>=3e4?t:3e5})(),it=1e3,nt=3e5;var rt=5,ce="Run `kane-cli doctor --target emulator --install` to install the managed Appium tree.",st={device:"ready",unauthorized:"unauthorized",offline:"offline"};function ot(t){let e={};for(let r of t){let o=r.indexOf(":");o<=0||(e[r.slice(0,o)]=r.slice(o+1))}return e}function at(t){let e=[];for(let r of t.split(`
|
|
3
|
+
`)){let o=r.trim();if(!o||o.startsWith("*"))continue;let u=o.toLowerCase();if(u.startsWith("list of devices")||u.startsWith("adb server"))continue;let g=o.split(/\s+/),f=g[0],v=g[1];if(!f||!v||!f.startsWith("emulator-"))continue;let b=ot(g.slice(2)),S=b.model?b.model.replace(/_/g," "):void 0;e.push({platform:G,kind:"emulator",id:f,displayName:S??f,state:st[v]??"offline"})}return e}function me(t){let e=[];for(let r of t.split(`
|
|
4
|
+
`)){let o=r.trim();o&&/^[A-Za-z0-9._-]+$/.test(o)&&(e.includes(o)||e.push(o))}return e}function dt(t){for(let e of t.split(`
|
|
5
|
+
`)){let r=e.trim();if(!(!r||r==="OK"))return r}}function lt(t){let e=/^Version\s+(\S+)/m.exec(t);return e?.[1]?e[1].split("-")[0]:/Android Debug Bridge version\s+(\S+)/.exec(t)?.[1]}function ut(t){let e=[];for(let r of t.split(`
|
|
6
|
+
`)){let o=r.trim();if(!o.startsWith("package:"))continue;let u=o.slice(8).trim();u&&!e.includes(u)&&e.push(u)}return e.sort()}function ct(t){let e=Number(t.trim());return Number.isInteger(e)&&e>0?e:void 0}function mt(t){return[...new Set(t.split(",").map(e=>e.trim()).filter(Boolean))]}var pt=[{match:/INSTALL_FAILED_VERIFICATION|verif(?:ier|ication)/i,hint:`Package verification blocked the install. Disable it for adb installs:
|
|
7
|
+
adb -s <device> shell settings put global verifier_verify_adb_installs 0`},{match:/INSTALL_FAILED_UPDATE_INCOMPATIBLE|INSTALL_FAILED_VERSION_DOWNGRADE|signatures do not match/i,hint:`A different build of this package is already installed. Uninstall it first:
|
|
8
|
+
adb -s <device> uninstall <package>`},{match:/INSUFFICIENT_STORAGE/i,hint:"The device is out of storage. Free space on the device and retry."}];function ft(t){for(let{match:e,hint:r}of pt)if(e.test(t))return r}function W(t,e,r=rt){let o=t.toLowerCase(),u=e.filter(v=>v.toLowerCase().includes(o)),g=Math.max(6,Math.floor(o.length/2)),f=e.filter(v=>!u.includes(v)&>(v.toLowerCase(),o)>=g);return[...u,...f].slice(0,r)}function gt(t,e){let r=Math.min(t.length,e.length),o=0;for(;o<r&&t[o]===e[o];)o++;return o}function ht(t){if(!t)return;let e=/^image\.sysdir\.\d+\s*=.*?android-(\d+)/m.exec(t),r=e?.[1]?Number(e[1]):NaN;return Number.isInteger(r)&&r>0?r:void 0}var vt={36:"16",35:"15",34:"14",33:"13",32:"12",31:"12",30:"11",29:"10",28:"9",27:"8.1",26:"8.0",25:"7.1",24:"7.0",23:"6.0",22:"5.1",21:"5.0"};function wt(t){return t===void 0?void 0:vt[t]}function pe(t){let e=bt(t),r=ht(t),o=wt(r);return{...e?{modelIdentifier:e}:{},...r!==void 0?{androidApiLevel:r}:{},...o?{osVersion:o}:{}}}function bt(t){return t&&/^hw\.device\.name\s*=\s*(.+)\s*$/m.exec(t)?.[1]?.trim()||void 0}function yt(){return se(et,{signal:AbortSignal.timeout(tt)}).then(t=>t.ok,()=>!1)}function fe(t){return A(ge(),".testmuai","kaneai","mobile",`emulator-${t}.log`)}function At(t,e,r,o){let u="ignore";if(o)try{We(z(o),{recursive:!0}),u=Ye(o,"w")}catch{u="ignore"}if(Xe(t,e,{stdio:["ignore",u,u],detached:!0,...r?{env:{...process.env,...r}}:{}}).unref(),typeof u=="number")try{ze(u)}catch{}}function q(t){try{return Ze(t,"utf8")}catch{return}}function he(t){try{Qe(t,{force:!0})}catch{}}async function ve(t){if(process.platform==="win32"){let o=await $("tasklist",["/FI",`PID eq ${t}`,"/FO","CSV","/NH"],{timeoutMs:5e3});return o.code===0&&o.stdout.trim()!==""?o.stdout:void 0}let e=await $("ps",["-p",String(t),"-o","command="],{timeoutMs:5e3}),r=e.stdout.trim();return e.code===0&&r!==""?r:void 0}function St(){return{exec:$,spawnDetached:At,readFileIfAny:q,removeFile:he,processCommand:ve,fileExists:Ge,env:process.env,home:ge(),os:process.platform,probeAppiumServer:yt,now:()=>Date.now(),sleep:oe,mobileDeps:{status:t=>R().status(t),environment:t=>R().environment(t)},sdkSuite:{status:()=>F().status(),environment:()=>F().environment(),emulatorPath:()=>{let t=F().paths().emulatorDir;return A(t,process.platform==="win32"?"emulator.exe":"emulator")},ensureSdkRootMarkers:()=>F().ensureSdkRootMarkers()}}}function we(t={}){let e={...St(),...t},r={},o=new Set;function u(i){return e.os==="win32"?`${i}.exe`:i}function g(i){if(e.readAvdConfig)return e.readAvdConfig(i);let n=f(i);if(n)return(e.readFileIfAny??q)(A(n,"config.ini"))}function f(i){let n=[e.env.ANDROID_AVD_HOME,A(e.home,".android","avd"),e.sdkSuite.environment().ANDROID_AVD_HOME];for(let s of n){if(!s)continue;let a=A(s,`${i}.avd`);if(e.fileExists(A(a,"config.ini")))return a}}let v=["hardware-qemu.ini.lock","multiinstance.lock"];async function b(i){let n=f(i);if(!n)return{state:"free"};let s=v.map(h=>A(n,h)).filter(h=>e.fileExists(h));if(s.length===0)return{state:"free"};let d=(e.readFileIfAny??q)(A(n,"hardware-qemu.ini.lock")),c=Number(String(d??"").replace(/\0/g,"").trim());if(Number.isInteger(c)&&c>0){let h=await(e.processCommand??ve)(c);if(h&&/qemu|emulator/i.test(h))return{state:"held",pid:c}}return{state:"stale",paths:s}}function S(){return e.os==="win32"?"appium.cmd":"appium"}function I(){let i=[];for(let n of["ANDROID_HOME","ANDROID_SDK_ROOT"]){let s=e.env[n];s&&s.trim()!==""&&i.push(s.trim())}return e.os==="darwin"?i.push(A(e.home,"Library","Android","sdk")):e.os==="win32"?i.push(A(e.home,"AppData","Local","Android","Sdk")):i.push(A(e.home,"Android","Sdk")),i}function H(i){let n=i==="adb"?"platform-tools":"emulator";return I().map(s=>A(s,n,u(i)))}async function l(i){let n=e.os==="win32"?"where":"which",s=await e.exec(n,[u(i)],{timeoutMs:5e3});if(s.code!==0)return null;let a=s.stdout.split(`
|
|
9
|
+
`)[0]?.trim();return a&&a!==""?a:null}async function m(i){let n=await e.exec(i,["-version"],{timeoutMs:1e4});return/Android emulator version/i.test(`${n.stdout}
|
|
10
|
+
${n.stderr}`)}async function p(i){if(i==="adb"){let n=ae(e.env);if(n){let a=A(n.platformToolsDir,u("adb"));if(e.fileExists(a)){let d={path:a,source:"sdk"};return r[i]=d,d}return delete r[i],null}if((await e.mobileDeps.status("emulator")).installed){let a=await e.mobileDeps.environment("emulator");if(a.platformToolsDir){let d={path:A(a.platformToolsDir,u("adb")),source:"local"};return r[i]=d,d}}return delete r[i],null}if(i==="emulator"){if((await e.sdkSuite.status()).emulator){let d={path:e.sdkSuite.emulatorPath(),source:"local"};return r[i]=d,d}let s=H(i).filter(d=>e.fileExists(d)),a=await l(i);a&&!s.includes(a)&&s.push(a);for(let d of s){if(!await m(d))continue;let c={path:d,source:"sdk"};return r[i]=c,c}}return delete r[i],null}async function w(){let i=await p("adb");if(!i)throw new Error("Managed adb is not installed.\nRun `kane-cli doctor --target emulator --install` to install the pinned Android platform-tools.");return i.path}async function D(i){let n=await e.exec(i,["devices","-l"],{timeoutMs:2e4});return at(n.stdout)}async function y(i,n){let s=await e.exec(i,["-s",n,"shell","getprop","ro.boot.qemu.avd_name"],{timeoutMs:1e4});if(s.code===0){let d=s.stdout.split(`
|
|
11
|
+
`)[0]?.trim();if(d)return d}let a=await e.exec(i,["-s",n,"emu","avd","name"],{timeoutMs:1e4});if(a.code===0)return dt(a.stdout)}async function E(i){let n=await p("emulator");if(!n)return[];let s=await e.exec(n.path,["-list-avds"],{timeoutMs:2e4}),a=s.code===0?me(s.stdout):[];if(o.clear(),(await e.sdkSuite.status()).emulator){let c=await e.exec(n.path,["-list-avds"],{timeoutMs:2e4,env:{...e.env,...e.sdkSuite.environment()}});if(c.code===0)for(let h of me(c.stdout))o.add(h),a.includes(h)||a.push(h)}return a.filter(c=>!i.has(c)).map(c=>({platform:G,kind:"emulator",id:c,displayName:c,state:"stopped",virtualName:c,...pe(g(c))}))}async function M(){let i=await p("adb");if(!i)return[];let n=await D(i.path),s=new Set;for(let d of n){if(d.kind!=="emulator"||d.state!=="ready")continue;let c=await y(i.path,d.id);c&&(d.virtualName=c,d.displayName=c,Object.assign(d,pe(g(c))),s.add(c))}let a=await E(s);return[...n,...a]}function C(i){let n=(e.readFileIfAny??q)(i);if(!n)return;let s=n.split(/\r?\n/).find(a=>/^FATAL\b/.test(a.trim()));return s?s.replace(/^FATAL\s*\|\s*/,"").trim():void 0}function j(i,n,s){let a=[`${i} could not start: ${n}`];return/multiple emulators with the same AVD/i.test(n)&&a.push(`Another emulator is already using ${i}. Close it (or quit the Android`,"Emulator app), then retry \u2014 kane-cli clears the lock a killed emulator","leaves behind, but it will not take an AVD away from a live one."),a.push(`Full output: ${s}`),a.join(`
|
|
12
|
+
`)}function De(i,n){return[`${i} did not finish booting within ${X/1e3}s.`,n?`It attached as ${n} but never reported sys.boot_completed=1.`:"It never attached to adb.",`Its own output: ${fe(i)}`,"The emulator process may still be running \u2014 check its window for errors.","Common causes: no hardware acceleration (install the Android Emulator","hypervisor driver / enable KVM); a corrupt AVD (recreate it in Android","Studio's Device Manager); or a boot that is merely slow \u2014 software GL","rendering under memory pressure can exceed",`${X/1e3}s on a loaded machine (raise it with`,"KANE_CLI_EMULATOR_BOOT_TIMEOUT_MS)."].join(`
|
|
13
|
+
`)}async function Te(i,n,s){let a=await p("emulator");if(!a)throw new Error("The Android `emulator` binary was not found, so AVDs cannot be booted.\nInstall it via Android Studio's SDK Manager (Android Emulator) and set ANDROID_HOME.");let d=new Set((await D(i)).map(P=>P.id)),c=o.has(n);c&&await e.sdkSuite.ensureSdkRootMarkers();let h=c?{...e.env,...e.sdkSuite.environment()}:void 0,x=await b(n);if(x.state==="stale"){s?.(`clearing a stale lock left by a previous ${n} emulator\u2026`);for(let P of x.paths)(e.removeFile??he)(P)}let T=fe(n);x.state==="held"?s?.(`${n} is already starting (pid ${x.pid}) \u2014 waiting for it\u2026`):(e.spawnDetached(a.path,["-avd",n],h,T),s?.(`booting ${n}\u2026 (log: ${T})`));let B=async()=>{let P=await D(i),te=P.find(N=>N.kind==="emulator"&&!d.has(N.id));if(te)return te.id;for(let N of P)if(!(N.kind!=="emulator"||N.state!=="ready")&&await y(i,N.id)===n)return N.id},U=x.state!=="held",O=e.now()+X,k=await B();for(k&&s?.(`${n} attached as ${k}, waiting for boot\u2026`);e.now()<O;){if(k&&(await e.exec(i,["-s",k,"shell","getprop","sys.boot_completed"],{timeoutMs:1e4})).stdout.trim()==="1")return k;if(await e.sleep(it),U){let P=C(T);if(P)throw new Error(j(n,P,T))}k||(k=await B(),k&&s?.(`${n} attached as ${k}, waiting for boot\u2026`))}throw new Error(De(n,k))}async function Pe(i,n){let s=await w();if(i.state==="ready")return Q(i,s);if(i.state==="unauthorized")throw new Error(`${i.displayName} (${i.id}) is UNAUTHORIZED. Accept the USB-debugging prompt on the device, then retry.`);if(i.state==="offline")throw new Error(`${i.displayName} (${i.id}) is offline. Reconnect it (USB) or re-run \`adb connect ${i.id}\` (wireless), then retry.`);let a=i.virtualName??i.id,d=await Te(s,a,n);return Q({...i,kind:"emulator",id:d,displayName:a,state:"ready",virtualName:a},s)}async function Q(i,n){let[s,a,d,c]=await Promise.all([e.exec(n,["-s",i.id,"shell","getprop","ro.build.version.sdk"],{timeoutMs:1e4}),e.exec(n,["-s",i.id,"shell","getprop","ro.build.version.release"],{timeoutMs:1e4}),e.exec(n,["-s",i.id,"shell","getprop","ro.product.cpu.abilist"],{timeoutMs:1e4}),e.exec(n,["-s",i.id,"shell","getprop","ro.product.cpu.abi"],{timeoutMs:1e4})]),h=s.code===0?ct(s.stdout):void 0,x=a.code===0?a.stdout.trim():"",T=mt(d.code===0&&d.stdout.trim()!==""?d.stdout:c.stdout);return{...i,...h!==void 0?{androidApiLevel:h}:{},...x!==""?{osVersion:x}:{},...T.length>0?{androidAbis:T}:{}}}async function ee(i){let n=await w(),s=await e.exec(n,["-s",i.id,"shell","pm","list","packages","-3"],{timeoutMs:3e4});if(s.code!==0)throw new Error(`Could not list installed packages on ${i.id}: ${s.stderr.trim()||`adb exited ${s.code}`}`);return ut(s.stdout)}async function _e(i){let n;try{let{default:s}=await import("./adbkit-apkreader-ORZBGCJQ.js");n=(await(await s.open(i)).readManifest())?.package}catch(s){let a=s instanceof Error?s.message:String(s);throw new Error(`Could not read the package name from ${i} (${a}).
|
|
14
|
+
Pass the package name explicitly with --app <package>.`)}if(typeof n!="string"||n.trim()==="")throw new Error(`${i} has no package name in its manifest.
|
|
15
|
+
Pass the package name explicitly with --app <package>.`);return n.trim()}async function Me(i,n,s){let a=await w();s?.(`installing ${n} on ${i.id}\u2026`);let d=await e.exec(a,["-s",i.id,"install","-r",n],{timeoutMs:nt}),c=`${d.stdout}
|
|
16
|
+
${d.stderr}`;if(d.code===0&&!/\bFailure\b/i.test(c))return;let h=ft(c),x=[`Installing ${n} on ${i.id} failed (adb exited ${d.code}).`,c.trim()];throw h&&x.push("",h),new Error(x.filter(T=>T!=="").join(`
|
|
17
|
+
`))}async function Ie(i,n,s){if(n.kind==="package"){let a=await ee(i);if(a.includes(n.value))return n.value;let d=W(n.value,a),c=[`${n.value} is not installed on ${i.displayName} (${i.id}).`];throw d.length>0?c.push("Close matches:",...d.map(h=>` ${h}`)):c.push("Pass a local .apk path to --app to install it instead."),new Error(c.join(`
|
|
18
|
+
`))}if(n.kind!=="apk"){let a=n.kind==="aab"?"Android app bundles are not directly installable; build an APK first.":n.kind==="apks"?"Split bundles are not supported yet.":`${n.kind} artifacts are not installable on Android.`;throw new Error(a)}return await Me(i,n.value,s),_e(n.value)}async function $e(){let i=await e.mobileDeps.status("emulator");return i.installed?{status:i,env:await e.mobileDeps.environment("emulator")}:null}async function Ee(i={}){let n=[],s=await $e(),a=await e.mobileDeps.status("emulator"),d=await p("adb");if(d){let O=await e.exec(d.path,["version"],{timeoutMs:1e4}),k=lt(O.stdout);n.push({id:"android.adb",fixedByBundle:!0,label:"adb",required:!0,status:"pass",detail:k?`platform-tools ${k} \xB7 ${d.path}`:d.path})}else n.push({id:"android.adb",fixedByBundle:!0,label:"adb",required:!0,status:"fail",detail:a.corrupt??"managed mobile dependencies are not installed",fixText:"Run `kane-cli doctor --target emulator --install` to download the managed mobile deps bundle under ~/.testmuai/kaneai/mobile."});let c=!i.appiumUrl;s?.env.appiumHome?n.push({id:"android.appium",fixedByBundle:!0,label:"Appium",required:c,status:"pass",detail:A(z(s.env.appiumHome),"appium","node_modules",".bin",S())}):n.push({id:"android.appium",fixedByBundle:!0,label:"Appium",required:c,status:c?"fail":"info",detail:i.appiumUrl?`managed Appium not required because --appium-url is set (${i.appiumUrl})`:a.corrupt??"managed Appium is not installed",...c?{fixText:ce}:{}}),n.push({id:"android.uiautomator2",fixedByBundle:!0,label:"uiautomator2 driver",required:c,status:s?"pass":c?"fail":"info",detail:s?"bundled in the managed mobile deps":i.appiumUrl?"managed driver not required because --appium-url is set":"not installed in the managed deps tree",...s||!c?{}:{fixText:ce}});let h=A(e.home,".testmuai","kaneai","mobile","trees");e.fileExists(h)&&n.push({id:"android.legacy-trees",label:"legacy toolchain trees",required:!1,status:"info",detail:`${h} predates the deps bundle \u2014 removed automatically by the next bundle install`});let x=await l("adb");x&&n.push({id:"android.system-adb",label:"system adb",required:!1,status:"info",detail:`${x} (ignored; managed adb always wins and may restart its server)`});let T=await l("appium");T&&n.push({id:"android.system-appium",label:"system Appium",required:!1,status:"info",detail:`${T} (ignored; managed Appium always wins)`});let B=await e.sdkSuite.status(),U=await p("emulator");if(B.emulator?n.push({id:"android.emulator",label:"emulator",required:!1,status:"pass",detail:`managed emulator \xB7 ${e.sdkSuite.emulatorPath()}`}):U?n.push({id:"android.emulator",label:"emulator",required:!1,status:"info",detail:`${U.path} (system install)`}):n.push({id:"android.emulator",label:"emulator",required:!1,status:"info",detail:"not installed, so stopped AVDs are not listed. Install it with the Android SDK (Android Studio \u2192 SDK Manager \u2192 Android Emulator)."}),e.os==="darwin"){let O=await e.exec("sysctl",["-n","kern.hv_support"],{timeoutMs:5e3});n.push({id:"android.virtualization",label:"virtualization",required:!1,status:"info",detail:O.code===0&&O.stdout.trim()==="1"?"Hypervisor.framework available":"Hypervisor.framework not reported \u2014 emulator boots may hang"})}else e.os==="linux"?n.push({id:"android.virtualization",label:"virtualization",required:!1,status:"info",detail:e.fileExists("/dev/kvm")?"/dev/kvm present":"/dev/kvm missing \u2014 enable KVM or emulator boots will hang"}):n.push({id:"android.virtualization",label:"virtualization",required:!1,status:"info",detail:"not checked on this host"});return n}async function Ne(i){let n=await e.mobileDeps.environment("emulator"),s=[...n.dirs],a=r.emulator,d=a?.source==="sdk"?z(a.path):void 0;return d&&!s.includes(d)&&s.push(d),{...n,dirs:s}}async function Oe(i,n){let s=await w(),a=[];return n.appPackage&&a.push({label:`closing ${n.appPackage}`,file:s,args:["-s",i.id,"shell","am","force-stop",n.appPackage]}),n.shutdown&&a.push({label:`shutting down ${i.displayName}`,file:s,args:["-s",i.id,"emu","kill"]}),a}return{platform:G,available:()=>!0,checks:Ee,discover:M,prepare:Pe,listApps:ee,ensureApp:Ie,teardownPlan:Oe,toolEnv:Ne}}import{mkdtemp as be,readdir as xt,rm as ye,writeFile as kt}from"fs/promises";import{tmpdir as Ae}from"os";import{join as L}from"path";var Se="ios",Dt=12e4,Tt=3e5,Pt="an .ipa cannot be installed on a simulator \u2014 use a .zip of the .app build";function _t(t){let e=/\.iOS-(\d+)-(\d+)$/.exec(t);return e?`${e[1]}.${e[2]}`:void 0}function Mt(t){let e;try{e=JSON.parse(t)}catch{return[]}let r=[];for(let[o,u]of Object.entries(e.devices??{})){let g=_t(o);for(let f of u??[]){let v=typeof f.udid=="string"?f.udid:void 0,b=typeof f.name=="string"?f.name:void 0;if(!v||!b)continue;let S=f.state==="Booted"?"ready":f.state==="Shutdown"?"stopped":"offline",I=typeof f.deviceTypeIdentifier=="string"?f.deviceTypeIdentifier.replace(/^com\.apple\.CoreSimulator\.SimDeviceType\./,""):void 0;r.push({platform:Se,kind:"simulator",id:v,displayName:b,state:S,virtualName:b,...g?{osVersion:g}:{},...I?{modelIdentifier:I}:{}})}}return r}function It(t){let e;try{e=JSON.parse(t)}catch{return[]}let r=[];for(let[o,u]of Object.entries(e)){if(u?.ApplicationType!=="User")continue;let g=u.CFBundleIdentifier??o;r.includes(g)||r.push(g)}return r.sort()}function $t(t){let e;try{e=JSON.parse(t)}catch{return[]}let r=[];for(let[o,u]of Object.entries(e)){let g=u?.CFBundleIdentifier??o;g&&!r.includes(g)&&r.push(g)}return r.sort()}var Y=16;function Et(t){return/^Xcode (\d+(?:\.\d+)*)/m.exec(t)?.[1]}async function Nt(t){let e=await be(L(Ae(),"kane-app-unzip-")),r=()=>ye(e,{recursive:!0,force:!0}),o=await $("unzip",["-q",t,"-d",e],{timeoutMs:10*6e4});if(o.code!==0)throw await r(),new Error(`Could not unpack ${t}: ${o.stderr.trim()||`unzip exited ${o.code}`}`);for(let u of[e,L(e,"Payload")]){let g;try{g=await xt(u)}catch{continue}let f=g.find(v=>v.toLowerCase().endsWith(".app"));if(f)return{appPath:L(u,f),cleanup:r}}throw await r(),new Error(`${t} does not contain a .app bundle.`)}async function Ot(t){let e=await be(L(Ae(),"kane-plist-"));try{let r=L(e,"input.plist");await kt(r,t);let o=await $("plutil",["-convert","json","-o","-",r],{timeoutMs:15e3});if(o.code!==0)throw new Error(`plutil could not convert simctl output: ${o.stderr.trim()}`);return o.stdout}finally{await ye(e,{recursive:!0,force:!0})}}function Rt(){return{exec:$,os:process.platform,convertPlistToJson:Ot,mobileDeps:{status:()=>R().status("simulator"),environment:()=>R().environment("simulator")}}}function xe(t={}){let e={...Rt(),...t};async function r(l,m=3e4){return e.exec("xcrun",["simctl",...l],{timeoutMs:m})}async function o(){let l=await r(["list","devices","available","--json"]);return l.code!==0?[]:Mt(l.stdout)}async function u(){return o()}async function g(l,m){let p=await e.exec("open",["-a","Simulator","--args","-CurrentDeviceUDID",l],{timeoutMs:15e3});p.code!==0&&m?.(`could not open Simulator.app (${p.stderr.trim()||`exit ${p.code}`}); the device is booted and the run continues headless`)}async function f(l,m){if(l.state!=="ready"&&l.state!=="stopped")throw new Error(`${l.displayName} (${l.id}) is ${l.state}; open Simulator.app to inspect it, then retry.`);l.kind==="simulator"&&await g(l.id,m),l.state==="stopped"&&m?.(`booting ${l.displayName}\u2026`);let p=await r(["bootstatus",l.id,"-b"],Dt);if(p.code!==0)throw new Error(`Could not boot ${l.displayName}: ${p.stderr.trim()||p.stdout.trim()||`simctl bootstatus exited ${p.code}`}`);let w=(await o()).find(D=>D.id===l.id);if(w?.state==="ready")return w;throw new Error(`${l.displayName} finished booting but simctl still reports it as ${w?.state??"missing"}.`)}async function v(l){let m=await r(["listapps",l.id]);if(m.code!==0)throw new Error(`Could not list apps on ${l.displayName}: ${m.stderr.trim()||`simctl exited ${m.code}`}`);return It(await e.convertPlistToJson(m.stdout))}async function b(l){let m=L(l,"Info.plist"),p=await e.exec("plutil",["-convert","json","-o","-",m],{timeoutMs:15e3});if(p.code!==0)throw new Error(`${l} Info.plist could not be read: ${p.stderr.trim()||`plutil exited ${p.code}`}`);let w;try{w=JSON.parse(p.stdout)}catch{throw new Error(`${l} Info.plist did not contain valid JSON from plutil.`)}if(!w.CFBundleIdentifier)throw new Error(`${l} has no CFBundleIdentifier in its Info.plist.`);return w.CFBundleIdentifier}async function S(l,m,p){if(m.kind==="package"){let y=await r(["listapps",l.id]);if(y.code!==0)throw new Error(`Could not list apps on ${l.displayName}: ${y.stderr.trim()||`simctl exited ${y.code}`}`);let E=$t(await e.convertPlistToJson(y.stdout));if(E.includes(m.value))return m.value;let M=W(m.value,E),C=[`${m.value} is not installed on ${l.displayName} (${l.id}).`];throw M.length>0?C.push("Close matches:",...M.map(j=>` ${j}`)):C.push("Pass a .zip of the .app bundle to install it instead."),new Error(C.join(`
|
|
19
|
+
`))}if(m.kind==="ipa")throw new Error(`${Pt}.`);if(m.kind!=="app"&&m.kind!=="zip")throw new Error(`${m.kind} artifacts are Android-only and not installable on iOS.`);let w=m.value,D;if(m.kind==="zip"){p?.(`unpacking ${m.value}\u2026`);let y=await Nt(m.value);w=y.appPath,D=y.cleanup}p?.(`installing ${w} on ${l.displayName}\u2026`);try{let y=await r(["install",l.id,w],Tt);if(y.code!==0)throw new Error(`Installing ${m.value} on ${l.displayName} failed: ${y.stderr.trim()||y.stdout.trim()}`);return await b(w)}finally{await D?.()}}async function I(l={}){let m=[],p=await e.exec("xcode-select",["-p"],{timeoutMs:1e4});if(p.code===0&&p.stdout.trim()!==""){let E=await e.exec("xcodebuild",["-version"],{timeoutMs:3e4}),M=E.code===0?Et(E.stdout):void 0;M?Number(M.split(".")[0])<Y?m.push({id:"ios.xcode",label:"Xcode",required:!0,status:"fail",detail:`Xcode ${M} is older than the required Xcode ${Y}`,fixText:`Update Xcode to ${Y} or newer from the App Store.`}):m.push({id:"ios.xcode",label:"Xcode",required:!0,status:"pass",detail:`Xcode ${M} \xB7 ${p.stdout.trim()}`}):m.push({id:"ios.xcode",label:"Xcode",required:!0,status:"fail",detail:`${p.stdout.trim()} has no usable xcodebuild (Command Line Tools only?)`,fixText:"Install full Xcode from the App Store, then run `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer`."})}else m.push({id:"ios.xcode",label:"Xcode",required:!0,status:"fail",detail:"xcode-select reports no developer directory",fixText:"Install Xcode from the App Store, then run `xcode-select --install`."});let w=await e.exec("xcrun",["simctl","help"],{timeoutMs:15e3});m.push(w.code===0?{id:"ios.xcrun",label:"xcrun",required:!0,status:"pass",detail:"simctl reachable"}:{id:"ios.xcrun",label:"xcrun",required:!0,status:"fail",detail:`xcrun cannot run simctl: ${w.stderr.trim()||w.stdout.trim()||`exit ${w.code}`}`,fixText:"Run `xcode-select --install`, then confirm with `xcrun simctl list devices`. If Xcode is installed, `sudo xcode-select -s /Applications/Xcode.app/Contents/Developer` repoints it."});let D=!l.appiumUrl,y=await e.mobileDeps.status();return m.push({id:"ios.xcuitest",fixedByBundle:!0,label:"xcuitest driver",required:D,status:y.installed?"pass":D?"fail":"info",detail:y.installed?"bundled in the managed mobile deps (with prebuilt WDA)":l.appiumUrl?"managed driver not required because --appium-url is set":y.corrupt??"the simulator deps bundle is not installed",...y.installed||!D?{}:{fixText:"Run `kane-cli doctor --target simulator --install` to download the simulator deps bundle."}}),m}async function H(l,m){let p=[];return m.appPackage&&p.push({label:`closing ${m.appPackage}`,file:"xcrun",args:["simctl","terminate",l.id,m.appPackage]}),m.shutdown&&p.push({label:`shutting down ${l.displayName}`,file:"xcrun",args:["simctl","shutdown",l.id]}),p}return{platform:Se,available:()=>e.os==="darwin",checks:I,discover:u,prepare:f,listApps:v,ensureApp:S,teardownPlan:H,toolEnv:()=>e.mobileDeps.environment()}}var ke=[we(),xe()];function V(){return ke.filter(t=>t.available())}function mi(){return V().map(t=>t.platform)}function pi(){return ke.map(t=>t.platform)}function Lt(t){let e=t.toLowerCase();return V().find(r=>r.platform.toLowerCase()===e)}async function Ct(t){let e=t?V().filter(o=>o.platform.toLowerCase()===t.toLowerCase()):V(),r=[];for(let o of e)try{r.push(...await o.discover())}catch{}return r}function Ft(t){return t.name!==void 0?`--device-name "${t.name}" --os-version ${t.osVersion}`:`os_version ${t.osVersion}`}function Z(t){return`
|
|
20
|
+
See devices: kane-cli devices list --target ${t?.toLowerCase()==="ios"?"simulator":t?.toLowerCase()==="android"?"emulator":"<emulator|simulator>"}`}async function fi(t,e={}){let r=e.discover??Ct,o=e.providerFor??Lt,u=await r(t.platform),g=b=>{let S=o(b.platform);return S?{ok:!0,target:b,provider:S}:{ok:!1,reason:"not-found",candidates:u,message:`No provider is registered for platform '${b.platform}'.`}};if(t.device){let b=u.filter(S=>ie(S,t.device));return b.length===0?{ok:!1,reason:"not-found",candidates:u,message:`No device matches ${Ft(t.device)}.`+(u.length>0?Z(t.platform):" No devices were found \u2014 run `kane-cli doctor --target <emulator|simulator>`.")}:g(K(b))}let f=t.defaultTarget;if(f&&(!t.platform||t.platform.toLowerCase()===f.platform.toLowerCase())){let b=u.filter(I=>ne(I,f)),S=K(b);return S?g(S):{ok:!1,reason:t.interactive?"needs-picker":"not-found",candidates:u,message:`The saved default device ${re(f)} (${f.platform} \xB7 ${f.kind}) is not connected. `+(t.interactive?"Pick a target to bind this run.":"Pass --device-name <name> --os-version <version> explicitly \u2014 kane-cli never binds a different device on its own.")+(u.length>0?Z(f.platform):"")}}if(u.length===0)return{ok:!1,reason:"none-found",candidates:[],message:"No emulator or simulator found. Start an Android emulator or boot an iOS simulator, then run `kane-cli devices list --target <emulator|simulator>`."};let v=u.filter(b=>b.state==="ready");return v.length===1?g(v[0]):t.interactive?{ok:!1,reason:"needs-picker",candidates:u,message:v.length===0?"No target is ready \u2014 pick one to prepare it.":"More than one target is ready \u2014 pick one."}:{ok:!1,reason:"ambiguous",candidates:u,message:(v.length===0?"No target is ready.":`${v.length} targets are ready.`)+" Pass --device-name <name> --os-version <version>."+Z(t.platform)}}export{Ht as a,mi as b,pi as c,Lt as d,Ct as e,fi as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as o,b as i}from"./chunk-
|
|
2
|
+
import{a as o,b as i}from"./chunk-LI5FMAUO.js";import{resolve as n}from"path";async function w(c,s,r={}){let e=i({verb:c,mode:"cli",contextRoot:n(process.cwd(),".context"),env:o(),write:r.write});try{let t=await s(e);return r.write&&t===0&&await e.lateBindContext(n(process.cwd(),".context")),t===1&&process.stderr.write(e.supportFooter()+`
|
|
3
3
|
`),await e.end({exit_code:t}),t}catch(t){throw e.error("cli_crash"),process.stderr.write(e.supportFooter()+`
|
|
4
4
|
`),await e.end({exit_code:1}),t}}export{w as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R}from"./chunk-TDPWFYTJ.js";import{a as x}from"./chunk-
|
|
2
|
+
import{a as R}from"./chunk-TDPWFYTJ.js";import{a as x}from"./chunk-O4IEPE3T.js";import{d as S}from"./chunk-2MQP4SSF.js";import{a as y}from"./chunk-MMBBQ4OZ.js";import{a as p}from"./chunk-V5DYLGAM.js";import{d as g,i as E}from"./chunk-LPH4TERT.js";import{spawn as M,execSync as h}from"child_process";import{appendFileSync as b,existsSync as m,mkdirSync as C}from"fs";import{homedir as L}from"os";import{join as V,resolve as s,dirname as v,delimiter as T}from"path";import{fileURLToPath as U}from"url";import{createInterface as I}from"readline";async function*A(e){let n=I({input:e,crlfDelay:1/0});for await(let r of n){let o=r.trim();if(o)try{let i=JSON.parse(o);i&&typeof i.type=="string"&&(yield i)}catch{}}}function O(e){return e==="action"?{set:{V16_AGENT_ENABLE_ALL_BLOCKERS:"true",V16_BIFURCATION_PHASES:"1"},unset:["V16_NETWORK_WS","V16_NETWORK_SSE"]}:{set:{V16_BIFURCATION_PHASES:"1"},unset:["V16_AGENT_ENABLE_ALL_BLOCKERS","V16_NETWORK_WS","V16_NETWORK_SSE"]}}function w(e){return e?{set:{},unset:["V16_AGENT_SKIP_CP_FINAL"]}:{set:{V16_AGENT_SKIP_CP_FINAL:"true"},unset:[]}}function N(e){return e==="dom"?{set:{V16_AGENT_ENABLE_TEXTUAL_VISUAL:"true"},unset:[]}:{set:{},unset:["V16_AGENT_ENABLE_TEXTUAL_VISUAL"]}}var c=v(U(import.meta.url));function k(){for(let e of["python3","python"])try{return h(`${e} --version`,{stdio:"ignore"}),e}catch{}return null}function D(){let n=process.platform==="win32"?"v16-runner.exe":"v16-runner",r={"darwin-arm64":["@testmuai/kane-cli-darwin-arm64","@lambdatestincprivate/kane-cli-darwin-arm64"],"darwin-x64":["@testmuai/kane-cli-darwin-x64","@lambdatestincprivate/kane-cli-darwin-x64"],"linux-x64":["@testmuai/kane-cli-linux-x64","@lambdatestincprivate/kane-cli-linux-x64"],"linux-arm64":["@testmuai/kane-cli-linux-arm64","@lambdatestincprivate/kane-cli-linux-arm64"],"win32-x64":["@testmuai/kane-cli-win-x64","@lambdatestincprivate/kane-cli-win-x64"]},o=`${process.platform}-${process.arch}`,i=r[o];if(i)for(let t of i){let a=[s(c,"..","node_modules",t,"bin",n),s(c,"..","..","node_modules",t,"bin",n),s(c,"..","..","..","node_modules",t,"bin",n),s(c,"..","..","..","..","node_modules",t,"bin",n)];for(let u of a)if(m(u))return{cmd:u,args:[]}}let d=[s(c,"bin",n),s(c,"..","bin",n),s(c,"..","..","..","..","v16-runner","dist",n),s(c,"..","..","..","v16-runner","dist",n),s(c,"..","..","v16-runner","dist",n),s(process.cwd(),"v16-runner","dist",n),s(process.cwd(),"..","v16-runner","dist",n)];for(let t of d)if(m(t))return{cmd:t,args:[]};let l=[s(c,"..","..","v16-runner"),s(c,"..","..","..","..","v16-runner"),s(c,"..","..","..","v16-runner"),s(process.cwd(),"v16-runner"),s(process.cwd(),"..","v16-runner")];for(let t of l)if(m(s(t,"main.py"))){for(let u of[s(t,".venv","bin","python"),s(t,"..",".venv","bin","python"),s(t,"..","browser-agent",".venv","bin","python")])if(m(u))return{cmd:u,args:["main.py"],cwd:t};let a=k();if(a)return{cmd:a,args:["main.py"],cwd:t}}return null}function P(e){return e?V(L(),".testmuai","kaneai","sessions",e,"runner-stderr.log"):null}function K(e){let n=M(e.runner.cmd,e.runner.args,{stdio:["pipe","pipe","pipe"],env:e.env,cwd:e.runner.cwd});n.stdin.on("error",()=>{});let r=P(e.sessionId);if(r)try{C(v(r),{recursive:!0})}catch{}let o=1e5,i="";n.stderr.on("data",u=>{if(i+=u.toString(),i.length>o&&(i=i.slice(-o)),r)try{b(r,u)}catch{}}),n.on("error",u=>{e.log?.("error","RUNNER_SPAWN_ERROR","Runner spawn error",{error:u.message})});let d=null,l=null,t=new Promise(u=>{n.on("close",(f,_)=>{d=f,l=_?String(_):null,e.log?.("info","RUNNER_EXIT","Runner exited",{code:f,signal:l??"none"}),u({code:f,signal:l})})}),a=A(n.stdout);return{child:n,events:a,getStderr:()=>i,getExitCode:()=>d,getExitSignal:()=>l,exited:t}}async function B(e,n){if(!n?.platform||!n.target_kind)return;let r=await S(n.platform)?.toolEnv(n.target_kind)??{dirs:[]};if(r.dirs.length>0&&(e.PATH=[...r.dirs,e.PATH??""].filter(Boolean).join(T)),r.appiumHome&&(e.APPIUM_HOME=r.appiumHome),r.wdaRoot&&(e.TESTMU_IOS_WDA_DERIVED_DATA=r.wdaRoot),n.platform==="android"){let o=y();o&&(e.PATH=[o.platformToolsDir,e.PATH??""].filter(Boolean).join(T),e.ANDROID_HOME=o.root,e.ANDROID_SDK_ROOT=o.root)}}function H(e){let n={...process.env};e.environment&&(n.TESTMUAI_ENV=e.environment),n.TESTMUAI_SOURCE="kane-cli",process.platform==="win32"&&(n.PYTHONIOENCODING="utf-8",n.PYTHONUTF8="1");let r=p(e.environment);n.V16_SERVER_API_HOST=r.v16ServerHost,n.ATMS_URL=r.tmsBaseUrl.replace(/\/api\/?$/,""),e.username&&e.accessKey&&(n.LT_USERNAME=e.username,n.LT_ACCESS_KEY=e.accessKey),e.sessionId&&(n.TESTMUAI_SESSION_ID=e.sessionId);let o=O(e.mode??"testing");Object.assign(n,o.set);for(let a of o.unset)delete n[a];let i=new x().load(),d=N(e.assertionMode??(i.assertion_mode==="visual"?"visual":"dom"));Object.assign(n,d.set);for(let a of d.unset)delete n[a];let l=e.finalValidation??i.final_validation,t=w(l);Object.assign(n,t.set);for(let a of t.unset)delete n[a];return n}function G(e,n){let r=p(n?.environment),o=R();o!==void 0&&e.ap_mode===void 0&&(e.ap_mode=o),e.telemetry_proxy_url===void 0&&process.env.KANE_TELEMETRY!=="0"&&(e.telemetry_proxy_url=E),e.media_upload===void 0&&e.org_id&&e.username&&e.access_key&&(e.media_upload={url:r.shareApiBaseUrl.replace(/\/$/,"")+"/mfs/v1.0/media/upload",artefacts_host:r.mediaArtefactsHost,org_id:e.org_id,media_dir:g})}async function oe(e,n){let r=D();if(!r)throw new Error("v16-runner not found. Build the binary with `cd v16-runner && python build.py` or ensure Python is available.");process.env.KANE_SPAWN_DEBUG&&process.stderr.write(`[spawn-debug] ${JSON.stringify(r)}
|
|
3
3
|
`);let o=H({environment:n?.environment,mode:n?.mode,assertionMode:n?.assertionMode,finalValidation:n?.finalValidation,username:e.username,accessKey:e.access_key,sessionId:e.session_id});e.device?.platform&&await B(o,e.device),G(e,{environment:n?.environment});let i=K({env:o,runner:r,log:n?.log,sessionId:e.session_id}),d=i.child;d.stdin.write(JSON.stringify(e)+`
|
|
4
4
|
`);let l=P(e.session_id);if(l)try{C(v(l),{recursive:!0}),b(l,`--- runner spawn ${new Date().toISOString()} run_index=${e.run_index} ---
|
|
5
5
|
`)}catch{}return{child:d,events:i.events,sendUserResponse(t){let a=JSON.stringify({type:"user_response",answer:t});try{d.stdin.write(a+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as f}from"./chunk-
|
|
2
|
+
import{a as f}from"./chunk-Q6743UUQ.js";import{x as r}from"./chunk-LPH4TERT.js";import{a as g}from"./chunk-HCBYKLMW.js";import{a as i,b as n,i as p}from"./chunk-C44QQJR4.js";import{a as x}from"./chunk-6YGTRKDT.js";import{e as d}from"./chunk-UR6MHSHU.js";var b=d(x(),1);var e=d(g(),1),v=[{value:"desktop",label:"Desktop",hint:"Chrome on this machine"},{value:"emulator",label:"Emulator",hint:"a virtual Android device"},{value:"simulator",label:"Simulator",hint:"a virtual iOS device"}];function T(a){return a==="all"?v:v.filter(l=>l.value!=="desktop")}function B({mode:a="all",onSelect:l,onCancel:c}){let u=T(a),[h,m]=(0,b.useState)(0);return p((s,o)=>{if(o.escape&&c){c();return}o.upArrow&&m(t=>Math.max(0,t-1)),o.downArrow&&m(t=>Math.min(u.length-1,t+1)),o.return&&l(u[h].value)}),(0,e.jsxs)(i,{flexDirection:"column",borderStyle:"round",borderColor:r.orange,paddingX:2,paddingY:1,children:[(0,e.jsx)(n,{color:r.orange,bold:!0,children:a==="all"?"Where should tests run?":"Which kind of device?"}),(0,e.jsx)(i,{marginTop:1,flexDirection:"column",children:u.map((s,o)=>{let t=o===h;return(0,e.jsxs)(i,{children:[(0,e.jsxs)(n,{color:t?r.orange:void 0,children:[t?"\u276F ":" ",s.label]}),(0,e.jsxs)(n,{color:r.dim,children:[" ",s.hint]})]},s.value)})}),(0,e.jsx)(i,{marginTop:1,children:(0,e.jsx)(n,{color:r.dim,children:"You can change this any time with /desktop or /mobile."})}),(0,e.jsx)(f,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"\u21B5",label:"select"}],suppressEscBack:!c,escBackLabel:"skip"})]})}export{B as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-RZ4F3BHX.js";var c=class{config;buffer=[];stepBuffer=new Map;flushTimer=null;currentRunIndex=null;stopped=!1;_inFlightFlush=null;_stoppingFast=!1;_droppedBatches=0;_droppedEntries=0;constructor(t){this.config=t}start(){if(this.flushTimer)return;let t=this.config.flushIntervalMs??5e3;this.flushTimer=setInterval(()=>{this.flush().catch(()=>{})},t),this.flushTimer.unref&&this.flushTimer.unref()}setRunIndex(t){this.currentRunIndex=t}log(t,e,s,n={}){if(this.stopped)return;let i=this.buildEntry(t,e,s,n);this.buffer.push(i)}logStep(t,e,s,n={}){if(this.stopped)return;let i=this.buildEntry("debug",e,s,n);i.run_index=t,this.stepBuffer.has(t)||this.stepBuffer.set(t,[]),this.stepBuffer.get(t).push(i)}escalate(t){let e=this.stepBuffer.get(t);e&&e.length>0&&this.buffer.push(...e),this.stepBuffer.delete(t)}discardSteps(t){this.stepBuffer.delete(t)}async flush(){if(this.buffer.length===0)return;let t=this._flushBody();this._inFlightFlush=t;try{await t}finally{this._inFlightFlush===t&&(this._inFlightFlush=null)}}async _flushBody(){let t=this.buffer.splice(0),e=null;try{e=await this.config.getToken()}catch{this.buffer.unshift(...t);return}let s={"Content-Type":"application/json"};e&&(s.Authorization=`Bearer ${e}`);let n=JSON.stringify(t);for(let i=0;i<3;i++){try{let o=new AbortController,u=setTimeout(()=>o.abort(),1e4),f=await a(this.config.proxyUrl,{method:"POST",headers:s,body:n,signal:o.signal});if(clearTimeout(u),f.ok)return}catch{}if(this._stoppingFast){this.buffer.unshift(...t);return}i<2&&await new Promise(o=>setTimeout(o,1e3*Math.pow(2,i)))}this._droppedBatches++,this._droppedEntries+=t.length}async flushOnce(t){if(this.buffer.length===0)return"empty";let e=this.buffer.splice(0),s=Date.now()+t,n=!1,i,o=null;try{o=await Promise.race([this.config.getToken(),new Promise(h=>{i=setTimeout(()=>{n=!0,h(null)},t),i.unref&&i.unref()})])}catch{o=null}finally{i&&clearTimeout(i)}let u=s-Date.now();if(n||u<=0)return this.buffer.unshift(...e),"timeout";let f={"Content-Type":"application/json"};o&&(f.Authorization=`Bearer ${o}`);try{let h=new AbortController,l=setTimeout(()=>h.abort(),u);l.unref&&l.unref();let p=await a(this.config.proxyUrl,{method:"POST",headers:f,body:JSON.stringify(e),signal:h.signal});return clearTimeout(l),p.ok?"sent":(this.buffer.unshift(...e),"failed")}catch{return this.buffer.unshift(...e),Date.now()>=s?"timeout":"failed"}}async stopAndFlushOnce(t){let e=Date.now()+t;this._stoppingFast=!0,this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null);let s=this._inFlightFlush;if(s){let i;await Promise.race([s.catch(()=>{}),new Promise(o=>{i=setTimeout(o,t),i.unref&&i.unref()})]),i&&clearTimeout(i)}if(this.buffer.length===0)return"empty";let n=e-Date.now();if(n<=0)return"timeout";try{return await this.flushOnce(n)}catch{return"failed"}}drainBuffer(){return this.buffer.splice(0)}get droppedBatches(){return this._droppedBatches}get droppedEntries(){return this._droppedEntries}async shutdown(){this._droppedBatches>0&&this.log("warn","LOG_DROPS",`Dropped ${this._droppedEntries} entries in ${this._droppedBatches} batches`,{dropped_batches:this._droppedBatches,dropped_entries:this._droppedEntries}),this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),await this.flush()}shutdownSync(){this.stopped=!0,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null)}get bufferSize(){return this.buffer.length}stepBufferSize(t){return this.stepBuffer.get(t)?.length??0}buildEntry(t,e,s,n){return{hostname:"kane-cli",service:"kane-cli",ddsource:"kane-cli",ddtags:`version:${this.config.device.cli_version}`,level:t,event:e,message:s,session_id:this.config.sessionId,run_index:e.startsWith("tcg_")?null:this.currentRunIndex,identity:this.config.identity,device:this.config.device,context:n,timestamp:new Date().toISOString()}}};function y(r=process.env){try{let t=r.KANE_CLI_USER_AGENT;return t&&t.trim()?d(t):r.CLAUDECODE==="1"||r.CLAUDE_CODE_ENTRYPOINT?"claude-code":r.CURSOR_TRACE_ID||r.TERM_PROGRAM==="cursor"?"cursor":r.TERM_PROGRAM==="vscode"||r.VSCODE_PID?"vscode":r.CI==="true"||r.GITHUB_ACTIONS==="true"||r.GITLAB_CI==="true"||r.CIRCLECI==="true"||r.BUILDKITE==="true"?"ci":"unknown"}catch{return"unknown"}}function d(r){return r.toLowerCase().replace(/[^a-z0-9_-]/g,"-").slice(0,40)}export{c as a,y as b};
|