@testmuai/kane-cli 0.10.4 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ChatSurface-DN7VVN3Y.js → ChatSurface-WKYH5MYP.js} +1 -1
- package/dist/{ChromeProfilePicker-TVGWXTUU.js → ChromeProfilePicker-ROQIRMWR.js} +1 -1
- package/dist/{CliFeedbackPrompt-L5ILK66U.js → CliFeedbackPrompt-55OKAT4W.js} +1 -1
- package/dist/{CliUploadProgress-IU6BQLMV.js → CliUploadProgress-NK2U3CKQ.js} +1 -1
- package/dist/{ConfigView-LU5IRRQU.js → ConfigView-7A5JTKLF.js} +1 -1
- package/dist/{EvidenceViewOffer-DNTARDEL.js → EvidenceViewOffer-U7J5ZRVK.js} +1 -1
- package/dist/{FolderPicker-6E5GE2K2.js → FolderPicker-R4QDIFTW.js} +1 -1
- package/dist/{InfoBox-SFFPLWCV.js → InfoBox-SRQ4TSUT.js} +1 -1
- package/dist/{LinksBox-6YDTIO6I.js → LinksBox-7BWLLQVR.js} +1 -1
- package/dist/{ProfilesView-6C5HJQ3Y.js → ProfilesView-TQTJR4WQ.js} +1 -1
- package/dist/{ProjectPicker-YIQIVXGK.js → ProjectPicker-A5SXNDUL.js} +1 -1
- package/dist/{SaveSessionPrompt-X3N6OGYB.js → SaveSessionPrompt-IECYZMXW.js} +1 -1
- package/dist/SingleShotApp-MN5IE6EU.js +2 -0
- package/dist/{SummaryBox-T7PDXDKS.js → SummaryBox-WFOS6GON.js} +1 -1
- package/dist/{TestMdRunView-HRJSBP2C.js → TestMdRunView-URNSXIVC.js} +1 -1
- package/dist/TestrunEvidenceTable-SZPZMW3J.js +2 -0
- package/dist/{WhoamiView-WGCWD7GP.js → WhoamiView-G6QP4SID.js} +1 -1
- package/dist/{app-download-ZS6ZMX2Z.js → app-download-UGLDWWTX.js} +1 -1
- package/dist/{assurance-job-QO4VJJCL.js → assurance-job-V5QB36WJ.js} +1 -1
- package/dist/{binary-CCCTW3QQ.js → binary-32FXH6PQ.js} +1 -1
- package/dist/{bind-JU4XPDN3.js → bind-3PB77PWJ.js} +1 -1
- package/dist/{bootstrap-BV7HAARR.js → bootstrap-A2O4UZUJ.js} +1 -1
- package/dist/{catalog-ZAROGOJA.js → catalog-P5IOIVYP.js} +1 -1
- package/dist/{catalog-client-QLHCEPPZ.js → catalog-client-LR2KPSU7.js} +1 -1
- package/dist/{changelog-6L7W76ZH.js → changelog-GKIKDJ32.js} +1 -1
- package/dist/{chunk-FTP2K6RS.js → chunk-2AHQ3D3D.js} +1 -1
- package/dist/{chunk-SZQNYDST.js → chunk-2G7UYQOW.js} +1 -1
- package/dist/{chunk-3O2RPYPM.js → chunk-2MBNAW2G.js} +1 -1
- package/dist/{chunk-SO3IXFAJ.js → chunk-2NP3THOE.js} +1 -1
- package/dist/{chunk-YZP4F23B.js → chunk-37KFCYHG.js} +1 -1
- package/dist/{chunk-Z4O5HOFX.js → chunk-3RJRCAUX.js} +3 -3
- package/dist/{chunk-PBVNX43X.js → chunk-4DM5EWEV.js} +1 -1
- package/dist/{chunk-QYWWL7M7.js → chunk-5K7PCSTP.js} +1 -1
- package/dist/{chunk-LCBDNZL3.js → chunk-5LKDOE3P.js} +1 -1
- package/dist/{chunk-ZVSZ6DIQ.js → chunk-5OFHMBZC.js} +2 -2
- package/dist/{chunk-SMSQVGLH.js → chunk-63BFLTJI.js} +1 -1
- package/dist/{chunk-PMYN3XMN.js → chunk-642GD7E6.js} +1 -1
- package/dist/{chunk-HMGM4KO6.js → chunk-66C5A2F5.js} +1 -1
- package/dist/{chunk-3HGKFRFL.js → chunk-6OL5EVRC.js} +1 -1
- package/dist/{chunk-LLDEAV3W.js → chunk-6PZ3SVWE.js} +1 -1
- package/dist/{chunk-7V6JPZBM.js → chunk-6VG2FG67.js} +1 -1
- package/dist/{chunk-Q5B54TR5.js → chunk-6WN4WSXR.js} +1 -1
- package/dist/{chunk-TO2ROHIJ.js → chunk-76MKY7FG.js} +2 -2
- package/dist/{chunk-2CJ75THZ.js → chunk-77BZTEHJ.js} +1 -1
- package/dist/chunk-7TSM2FCL.js +5 -0
- package/dist/{chunk-ECPSBI2Z.js → chunk-A5C7HIAH.js} +1 -1
- package/dist/{chunk-BV7NUIRT.js → chunk-AXOSLGQ4.js} +1 -1
- package/dist/{chunk-DJ76NDW6.js → chunk-BDZWRJAL.js} +1 -1
- package/dist/{chunk-6PURZLKM.js → chunk-BFRWZPIK.js} +1 -1
- package/dist/{chunk-MWLRLQ27.js → chunk-BLHFNL5K.js} +1 -1
- package/dist/chunk-BRWCWZE3.js +2 -0
- package/dist/{chunk-IQMJJN52.js → chunk-BZEW7CSM.js} +1 -1
- package/dist/{chunk-TXRWH6HL.js → chunk-C466XER3.js} +2 -2
- package/dist/{chunk-55W3WAAL.js → chunk-C4UME2PA.js} +1 -1
- package/dist/{chunk-ZHENGHYZ.js → chunk-CBPACEYQ.js} +1 -1
- package/dist/{chunk-IDWAG6L4.js → chunk-CJGQFKLJ.js} +1 -1
- package/dist/{chunk-4G2T54FE.js → chunk-CQBLJTDU.js} +1 -1
- package/dist/{chunk-BPTWMV5L.js → chunk-CVVUBCB7.js} +1 -1
- package/dist/{chunk-4WFN23DE.js → chunk-EIQSXD7B.js} +1 -1
- package/dist/{chunk-AFOP7DVG.js → chunk-EP4WGGMY.js} +1 -1
- package/dist/{chunk-S5PIVHPC.js → chunk-F4GWIX66.js} +1 -1
- package/dist/{chunk-GMSWZIAS.js → chunk-FHULYIG3.js} +1 -1
- package/dist/{chunk-JE5M5QIK.js → chunk-FKA5SWWF.js} +1 -1
- package/dist/{chunk-WHMCVH3T.js → chunk-FLGOQ6Q6.js} +1 -1
- package/dist/{chunk-ABNQL3PQ.js → chunk-FNBHP75S.js} +1 -1
- package/dist/{chunk-GJYMR4RT.js → chunk-FOURJ24E.js} +1 -1
- package/dist/{chunk-UZKVV3LW.js → chunk-FOUUD3LI.js} +1 -1
- package/dist/{chunk-CVVZ6NWR.js → chunk-FP6JCXOS.js} +1 -1
- package/dist/{chunk-WMIR4UXG.js → chunk-H23ZMHHC.js} +1 -1
- package/dist/{chunk-ZFKR5I3J.js → chunk-HHF7AM3D.js} +1 -1
- package/dist/{chunk-6CMBA5SG.js → chunk-HTJDMLZS.js} +1 -1
- package/dist/{chunk-DRWHVVW6.js → chunk-HY5BBSYX.js} +1 -1
- package/dist/{chunk-RG3FNO37.js → chunk-IPXITNFD.js} +1 -1
- package/dist/{chunk-EWSNJ3IX.js → chunk-IT6M7OMG.js} +1 -1
- package/dist/{chunk-5OGYXLOR.js → chunk-ITG5WMQG.js} +1 -1
- package/dist/{chunk-MZ4GTIO2.js → chunk-J3YID4A5.js} +1 -1
- package/dist/{chunk-TELSHQ3W.js → chunk-J44FV6CH.js} +1 -1
- package/dist/{chunk-JYSIPTX3.js → chunk-J5D4IGAM.js} +1 -1
- package/dist/{chunk-WB4JZ67W.js → chunk-J5QFO7LW.js} +1 -1
- package/dist/{chunk-EOLMWSLX.js → chunk-JGQ3VB44.js} +1 -1
- package/dist/{chunk-MOAZZKIZ.js → chunk-JVXEAO62.js} +1 -1
- package/dist/{chunk-YWQNZRJG.js → chunk-JYH7CTF7.js} +1 -1
- package/dist/{chunk-FH4FWIET.js → chunk-JZ7GFPKZ.js} +1 -1
- package/dist/{chunk-I3G3IUKY.js → chunk-KUSHV5SR.js} +1 -1
- package/dist/{chunk-NMCE7VR2.js → chunk-LMOW4NM5.js} +1 -1
- package/dist/{chunk-UVBPUZC4.js → chunk-LPJX5L3F.js} +1 -1
- package/dist/{chunk-4FA44D6S.js → chunk-LWP7E5FU.js} +1 -1
- package/dist/{chunk-MQU6EA44.js → chunk-LXYXCANZ.js} +1 -1
- package/dist/{chunk-5HJRYEOT.js → chunk-MAQVRBUQ.js} +1 -1
- package/dist/{chunk-4WKFM72U.js → chunk-MBNSCXVK.js} +1 -1
- package/dist/{chunk-P7V24ZXP.js → chunk-MIQ6J5YG.js} +1 -1
- package/dist/{chunk-454IWKHT.js → chunk-MUL2QFG2.js} +1 -1
- package/dist/{chunk-DBMDAWTA.js → chunk-N4XUGIAK.js} +1 -1
- package/dist/{chunk-ACBNVGVJ.js → chunk-NAUIJF72.js} +1 -1
- package/dist/{chunk-QFA6JPVE.js → chunk-NFDVDEOH.js} +2 -2
- package/dist/{chunk-BIXABKSK.js → chunk-NGBXXBHP.js} +1 -1
- package/dist/{chunk-RNKJXVG2.js → chunk-NIBNVPAE.js} +1 -1
- package/dist/{chunk-DAV4ONGS.js → chunk-NNVHWFLI.js} +1 -1
- package/dist/{chunk-QOXUGYEA.js → chunk-NZ7UCAN6.js} +1 -1
- package/dist/{chunk-HGKAUG7L.js → chunk-OPR5XIPT.js} +1 -1
- package/dist/{chunk-QXZGBYGQ.js → chunk-PCL2FYPE.js} +1 -1
- package/dist/{chunk-KJZD2ADR.js → chunk-PE3CEG6E.js} +1 -1
- package/dist/{chunk-3VSAAB2W.js → chunk-PKXWYYVK.js} +1 -1
- package/dist/{chunk-56NUPYFG.js → chunk-PSBR2LVL.js} +1 -1
- package/dist/{chunk-H6QHG62O.js → chunk-PZOQ2IQK.js} +1 -1
- package/dist/{chunk-2VLM4L3S.js → chunk-Q4QCSO6Y.js} +1 -1
- package/dist/{chunk-MNELOQ4J.js → chunk-QJ5XHVS5.js} +1 -1
- package/dist/{chunk-JJDD4HPX.js → chunk-QRUAI2ST.js} +1 -1
- package/dist/{chunk-2KPJ62RZ.js → chunk-QWEQ742S.js} +1 -1
- package/dist/{chunk-DXXHCLFC.js → chunk-R6S4EJ5R.js} +1 -1
- package/dist/{chunk-7WWCIS2B.js → chunk-RHQLDNZL.js} +1 -1
- package/dist/{chunk-X3O4VGTM.js → chunk-RM5ZVDVR.js} +1 -1
- package/dist/{chunk-4KFSSETE.js → chunk-RU3SWHRE.js} +1 -1
- package/dist/{chunk-662MCICY.js → chunk-S5UITUBB.js} +1 -1
- package/dist/{chunk-T5FQRUI2.js → chunk-SACFQNUH.js} +7 -7
- package/dist/{chunk-EG3B52WU.js → chunk-SDIHDYWT.js} +1 -1
- package/dist/{chunk-GPIVYCHQ.js → chunk-SFHDRKUX.js} +1 -1
- package/dist/{chunk-EWK3UPEN.js → chunk-SLISNOG6.js} +1 -1
- package/dist/{chunk-OSEXVHEN.js → chunk-TC2PHBPH.js} +1 -1
- package/dist/{chunk-FQ2AMM3E.js → chunk-TPCW5OU5.js} +1 -1
- package/dist/{chunk-P43YHCF3.js → chunk-UJYC2XDD.js} +1 -1
- package/dist/chunk-UV7FPIBL.js +2 -0
- package/dist/{chunk-A74JRNNX.js → chunk-UWEBI76C.js} +1 -1
- package/dist/{chunk-LV7OWLJK.js → chunk-UWQ4KXLB.js} +1 -1
- package/dist/{chunk-73EHVDL5.js → chunk-V24LUINK.js} +1 -1
- package/dist/{chunk-OX3ZAGCH.js → chunk-V3IWCGZT.js} +1 -1
- package/dist/{chunk-4QV2RL6P.js → chunk-VEE2O524.js} +1 -1
- package/dist/{chunk-3JATEWA5.js → chunk-VJRXJJML.js} +2 -2
- package/dist/{chunk-JM45SLKV.js → chunk-VKIUHHNT.js} +2 -2
- package/dist/{chunk-7KASYSFM.js → chunk-W3PQMIXE.js} +1 -1
- package/dist/{chunk-S74NLCFZ.js → chunk-WAC5WISH.js} +1 -1
- package/dist/{chunk-KLY6IQD5.js → chunk-XJV5SF3X.js} +3 -3
- package/dist/{chunk-ATCJ7EHL.js → chunk-XRJH4UF3.js} +1 -1
- package/dist/{chunk-SBW3QVHN.js → chunk-Y3RDLUH5.js} +5 -5
- package/dist/{chunk-BXAPTB2H.js → chunk-YF22VTR5.js} +3 -3
- package/dist/{chunk-TLYFHPNM.js → chunk-YLI7DQMJ.js} +2 -2
- package/dist/{chunk-BK3LWNKB.js → chunk-YQXOD7SV.js} +3 -3
- package/dist/{chunk-PHKJIJ7D.js → chunk-YTWBNACA.js} +1 -1
- package/dist/{chunk-QEBVYQNC.js → chunk-YUFXE6WU.js} +1 -1
- package/dist/{commands-X5T6YANK.js → commands-TRAUFCRZ.js} +1 -1
- package/dist/{config-F5Q6QX27.js → config-O3BWQUP4.js} +1 -1
- package/dist/{cover-cmd-PWUZU4HK.js → cover-cmd-SAWVP7TL.js} +1 -1
- package/dist/{credentials-D5KQMHCK.js → credentials-NNNODDXF.js} +1 -1
- package/dist/{deps-bundle-R7FNIV4M.js → deps-bundle-CXKBCA7W.js} +1 -1
- package/dist/{deps-resolve-IF6P6NWI.js → deps-resolve-K7XNTRZX.js} +1 -1
- package/dist/{design-chat-HYK3HNIM.js → design-chat-S4KYE6PP.js} +1 -1
- package/dist/{design-headless-DR7WB37W.js → design-headless-DDAFAJNR.js} +1 -1
- package/dist/{design-remote-TGUNEWEM.js → design-remote-UITWJ72Q.js} +2 -2
- package/dist/device-env-SBTHFSVK.js +2 -0
- package/dist/doctor-SRMLENYN.js +2 -0
- package/dist/{evidence-SRWISQMQ.js → evidence-FOWW3MOS.js} +1 -1
- package/dist/{evolve-cmd-2BALEYZU.js → evolve-cmd-MDK2H4JY.js} +1 -1
- package/dist/{evolve-remote-OHOUWO65.js → evolve-remote-4G7YFC5H.js} +1 -1
- package/dist/{explain-cmd-VTDAMXAW.js → explain-cmd-Q4NLNJFB.js} +1 -1
- package/dist/{explore-UZWQRJ7H.js → explore-MWUMVGRM.js} +1 -1
- package/dist/{explore-context-tty-PAKJVDJU.js → explore-context-tty-QLMZGYBX.js} +1 -1
- package/dist/{explore-entry-ZOPO7DBZ.js → explore-entry-QMCVGRP4.js} +4 -4
- package/dist/{explore-live-RUAAZGX4.js → explore-live-QIET6WO4.js} +1 -1
- package/dist/{explore-run-tty-DYLMHI7F.js → explore-run-tty-6UTBRCEF.js} +2 -2
- package/dist/{extract-bind-WPICR4IC.js → extract-bind-UTERWZMW.js} +3 -3
- package/dist/{extract-chat-KVUB5HPM.js → extract-chat-4WBNRVPG.js} +1 -1
- package/dist/{extract-cmd-OJ7LXSKL.js → extract-cmd-SYZX6CML.js} +2 -2
- package/dist/{extract-headless-OQJSUSG4.js → extract-headless-QBF77JWP.js} +1 -1
- package/dist/{folder-flags-MEZUAXTT.js → folder-flags-IJ556UET.js} +1 -1
- package/dist/{gaps-cmd-2R4RMWN6.js → gaps-cmd-E55OGZ7P.js} +1 -1
- package/dist/{gate-SM4HPJLA.js → gate-5UIJVMHL.js} +1 -1
- package/dist/{generate-headless-XR3RVULC.js → generate-headless-VYD2QIUO.js} +2 -2
- package/dist/{impact-cmd-EL3QSOAF.js → impact-cmd-3P6SKFJC.js} +2 -2
- package/dist/index.js +20 -20
- package/dist/{ingest-cmd-N3USC7TW.js → ingest-cmd-HMTLO5MB.js} +3 -3
- package/dist/{ingest-remote-2VKWAFJZ.js → ingest-remote-NIW5VAGW.js} +1 -1
- package/dist/install-KJDAGU2R.js +2 -0
- package/dist/{interactive-bind-F7QTQOKC.js → interactive-bind-K3ZQFHLH.js} +2 -2
- package/dist/{interactive-remote-A33J4KMP.js → interactive-remote-SGM76D6M.js} +1 -1
- package/dist/{lattice-auth-IJT542IF.js → lattice-auth-DCAVEQKY.js} +1 -1
- package/dist/{lifecycle-cmd-OKUFZKEX.js → lifecycle-cmd-Y5DH2PL5.js} +1 -1
- package/dist/{list-cmd-7OTI66MQ.js → list-cmd-RYHICCUV.js} +1 -1
- package/dist/{list-commands-FZPVH76I.js → list-commands-QFTIQE6Q.js} +1 -1
- package/dist/{list-remote-BQ4NILCA.js → list-remote-PWAQBF57.js} +1 -1
- package/dist/login-flow-W7RAVXSD.js +2 -0
- package/dist/{maintenance-cmd-BLV7K4RK.js → maintenance-cmd-JNP2KCSI.js} +1 -1
- package/dist/{mobile-prompts-5TGLJUBV.js → mobile-prompts-SP2RULD7.js} +1 -1
- package/dist/{onboarding-F4EIJ4GD.js → onboarding-YPIKXNYA.js} +1 -1
- package/dist/{persist-recorded-session-WYMOHDTB.js → persist-recorded-session-BWGA7WXR.js} +1 -1
- package/dist/{pipeline-XYM6HIDZ.js → pipeline-YE4IRKQX.js} +1 -1
- package/dist/{policy-commands-AOLVAZZD.js → policy-commands-MSJIPHDB.js} +1 -1
- package/dist/{prepare-target-P4AZWC37.js → prepare-target-G7LU4LYX.js} +1 -1
- package/dist/{pull-cmd-C4HMYD4I.js → pull-cmd-G3PVSSFP.js} +1 -1
- package/dist/{pull-route-MHW5PWDW.js → pull-route-5JQUUSU7.js} +1 -1
- package/dist/real-device-run-425XK527.js +2 -0
- package/dist/{reconcile-cmd-VXY737OT.js → reconcile-cmd-QJBYZVUB.js} +4 -4
- package/dist/{reconcile-remote-UGW2433E.js → reconcile-remote-JMV26DLX.js} +2 -2
- package/dist/{recording-banner-EPOTSMYF.js → recording-banner-VZ67EWWQ.js} +1 -1
- package/dist/{registry-WTWTFRXD.js → registry-3YMKU5GC.js} +1 -1
- package/dist/{remote-entry-SPA4CSJJ.js → remote-entry-6LQRYR5F.js} +1 -1
- package/dist/{remote-mode-QO6BDGXM.js → remote-mode-35BQUMEL.js} +1 -1
- package/dist/{remote-words-TAZT4YBT.js → remote-words-QXVFVHOB.js} +1 -1
- package/dist/{require-project-folder-WBCAVVMB.js → require-project-folder-O2XCXDRE.js} +1 -1
- package/dist/{resolve-run-intent-RBOCIYEA.js → resolve-run-intent-QCRZPYXM.js} +1 -1
- package/dist/{resolver-3BGIXYYJ.js → resolver-LWXOB7PH.js} +1 -1
- package/dist/{review-cmd-WE6I5XTY.js → review-cmd-PYU7YCAC.js} +1 -1
- package/dist/{run-remote-6Y62RWMJ.js → run-remote-PS45MTHW.js} +1 -1
- package/dist/{run-startup-gate-Q7FP2IRE.js → run-startup-gate-YBQB2JLF.js} +1 -1
- package/dist/{run-test-md-24MBKBC6.js → run-test-md-XYOCVA6F.js} +2 -2
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-cmd-5NS5P4CP.js → sessions-cmd-WUWZYZJW.js} +1 -1
- package/dist/{sessions-remote-75PDRPOY.js → sessions-remote-4J7ITZB4.js} +1 -1
- package/dist/{skill-installer-7PK64TZE.js → skill-installer-54ZAFNOB.js} +1 -1
- package/dist/{store-AVYBL5HB.js → store-2F26FIUS.js} +1 -1
- package/dist/{store-choice-ZWU3PDNL.js → store-choice-ZE7AZMRC.js} +1 -1
- package/dist/{store-guard-ETUXXG7X.js → store-guard-X5FIEZWZ.js} +1 -1
- package/dist/{sync-cmd-CSTMT6E6.js → sync-cmd-TAVE44DU.js} +1 -1
- package/dist/{sync-setup-Y53K6TJ6.js → sync-setup-M65RX34Y.js} +1 -1
- package/dist/tcg-generate-OXZF7TNQ.js +2 -0
- package/dist/{testmd-actions-BE4YJ6ZZ.js → testmd-actions-4OHRME2Z.js} +1 -1
- package/dist/{testmd-sync-QZWVWTZZ.js → testmd-sync-HM24JCS7.js} +1 -1
- package/dist/token-refresh-3SEDPIXO.js +2 -0
- package/dist/{validate-basic-QWPESO74.js → validate-basic-HWDR665U.js} +1 -1
- package/dist/{version-check-EOYWTY3Z.js → version-check-DRE5KT7F.js} +1 -1
- package/dist/{view-cmd-KG4HI334.js → view-cmd-3UKV3YEX.js} +1 -1
- package/dist/{walk-session-WM4S2JMV.js → walk-session-W6OLG5NT.js} +1 -1
- package/dist/{with-telemetry-RJM3JKL6.js → with-telemetry-BF4BGK5S.js} +1 -1
- package/package.json +11 -11
- package/dist/SingleShotApp-MXNJPU6A.js +0 -2
- package/dist/TestrunEvidenceTable-OGMWTJQF.js +0 -2
- package/dist/chunk-APXJRWIJ.js +0 -2
- package/dist/chunk-V57R4X3O.js +0 -5
- package/dist/chunk-YKOZBFR3.js +0 -2
- package/dist/device-env-LZB3PKMA.js +0 -2
- package/dist/doctor-PLFEA2HM.js +0 -2
- package/dist/install-3IEM3I3X.js +0 -2
- package/dist/login-flow-BYQ7SYGB.js +0 -2
- package/dist/real-device-run-WAOWKEFJ.js +0 -2
- package/dist/tcg-generate-VQLI6NGK.js +0 -2
- package/dist/token-refresh-PZ3TOKAL.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as Pe}from"./chunk-QFA6JPVE.js";import{d as tn}from"./chunk-3AGP2BVN.js";import{N as $,O as We,Q as Ge,S as Ye,T as Ke,U as qe,V as ge}from"./chunk-DAV4ONGS.js";import"./chunk-H6QHG62O.js";import"./chunk-ABNQL3PQ.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{a as N}from"./chunk-TCK7WR3M.js";import"./chunk-WMGKUERB.js";import"./chunk-2EKLTUY2.js";import{a as fe}from"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-HCBYKLMW.js";import"./chunk-YDSGXB25.js";import{a as ve,b as ie,c as Re,d as oe,e as sn,f as cn,h as an,i as we}from"./chunk-47WQBG5I.js";import{e as ke,f as un,g as $e,h as Ee,i as dn,j as fn,k as gn,l as Se}from"./chunk-3DFBFYTD.js";import{a as _e,c as ye,d as ln}from"./chunk-IPIARGHE.js";import"./chunk-Y7GSOKXS.js";import"./chunk-I6S6DZ2E.js";import{a as j}from"./chunk-KM3YCIDV.js";import"./chunk-4DRFMDAW.js";import"./chunk-JM6AKCN4.js";import{a as rn,c as on}from"./chunk-PUNFWBRW.js";import"./chunk-J3XOEMKO.js";import"./chunk-MUX2A37P.js";import"./chunk-W5HFUBXD.js";import"./chunk-73ZFOJOK.js";import"./chunk-OVB5GVRB.js";import"./chunk-JSSM2TWY.js";import"./chunk-LB5NIDW6.js";import"./chunk-H6IPGZTP.js";import"./chunk-LD5B3QFW.js";import"./chunk-HD6NR44L.js";import"./chunk-3A4KK22B.js";import{a as F,b as Qe,c as Xe}from"./chunk-6KUUSONE.js";import{c as en,h as nn}from"./chunk-56NUPYFG.js";import{f as Ze}from"./chunk-GRQKMOKE.js";import{i as pe,j as re,k as he}from"./chunk-3CFAE36M.js";import"./chunk-GBQ4K25P.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import{j as Je,l as me,n as ze}from"./chunk-C3DMMAFP.js";import"./chunk-AQ2OG2EF.js";import"./chunk-REKHAN53.js";import"./chunk-UVL6XQHU.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-TFSWG7AS.js";import"./chunk-JBUKEIYL.js";import"./chunk-W5EDS4DF.js";import"./chunk-XB6BJPDL.js";import{a as je}from"./chunk-ZCIWQHCO.js";import{b as Be}from"./chunk-5ORBAYTU.js";import{b as B}from"./chunk-ATCJ7EHL.js";import"./chunk-PVN64537.js";import"./chunk-VJGWVBZR.js";import{Ia as Ve,M as Le,Wa as Z,a as Fe,c as Te,n as Ne,oa as H,vb as U}from"./chunk-5EAJO372.js";import{d as He}from"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-OKCVG7AG.js";import"./chunk-XDAFRUAJ.js";import"./chunk-7V4BQSSV.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-4QTH7VYE.js";import"./chunk-73EHVDL5.js";import"./chunk-YWQNZRJG.js";import"./chunk-YKOZBFR3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-A7RJQJNT.js";import"./chunk-UR6MHSHU.js";import{existsSync as ue,readFileSync as An,statSync as Mn}from"fs";import{basename as W,dirname as vn,resolve as L}from"path";import{isAbsolute as Cn,resolve as Un}from"path";function se(e,n,t){let r=Le(e),i=r.heads.get(n);if(typeof i!="string")return{kind:"no-source"};let o=r.mediaOf(i).plugin;if(r.mediaOf(i).format!=="plugin"||o===void 0)return{kind:"not-plugin"};if(o.fetch!==void 0)return{kind:"plugin",plugin:o.id,ref:o.fetch.ref,fetched:!0};let s=null;for(let u of e.recordsSince(null))u.source_head_moves?.[n]===i?s=u.seq:u.source_head_moves?.[n]!==void 0&&(s=null);let c=s===null?null:e.tokenAt(s),p=c===null?null:e.intentOf(c),v=p?.verb==="ingest"?p.args:null;if(v?.source_id!==n||typeof v.label!="string"||v.label==="")return{kind:"no-envelope",plugin:o.id};let f=t!==void 0&&!Cn(v.label)?Un(t,v.label):v.label;return{kind:"plugin",plugin:o.id,ref:f}}var ce=e=>Ne(e)===null;function mn(e){if(!e||e.stale_refs.length===0)return"\u2014";let n=e.direct_refs??[];return`${e.stale_refs.length} stale${n.length>0?` \xB7 ${n.length} direct`:""}`}function be(e,n){let t=[...e.rows.filter(o=>o.kind!=="REMOVE").map(o=>[o.kind,H(o.ref),o.reason,mn(o.impact)]),...e.archive.map(o=>["ARCHIVE",H(o.ref),o.why,mn(o.impact)])],r=Math.max(40,n??100),i=[`reconcile ${e.source_id} \u2014 head ${e.head.status} \xB7 ${t.length} decision${t.length===1?"":"s"}`];return t.length>0&&i.push(...tn(["kind","ref","why","impact"],t,r,2)),e.changed&&i.push(e.held?`extract ran in override mode; ${e.defaultsTaken??0} default(s) auto-taken; matched-but-changed and new proposals HELD for your verdict (staged \u2014 nothing committed)`:`extract ran in override mode; ${e.defaultsTaken??0} default(s) auto-taken; matched-but-changed proposals auto-committed as edits`),i.push("each row becomes a card below \u2014 verdicts commit as they land"),e.planPath&&i.push(`plan: ${e.planPath}`),i}var Rn=new Set(["interactive","agent","ci","override"]);function Fn(e,n){if(e.mode!==void 0&&!Rn.has(e.mode))return{error:`--mode must be interactive | agent | ci | override, got '${e.mode}'`,code:"MODE_USAGE"};let t=e.mode,r="reconcile without a TTY needs an explicit mode \u2014 pass --mode agent|ci|override, or --plan for a preview";return t==="interactive"&&!n?{error:r}:t||(n?"interactive":e.plan?"override":{error:r})}async function pn(e){let{makeHeadlessIO:n,agentRefusal:t}=await import("./headless-io-FFM5T6KL.js");return t(n("ndjson","reconcile"),e,"MODE_USAGE")}var X=null,Ie=0,xe=0,Oe=new Set;function Tn(e){X?.event("ASR_RECONCILE_PLAN",{row_count:e.rows.length,add_count:e.rows.filter(n=>n.kind==="ADD").length,modify_count:e.rows.filter(n=>n.kind==="MODIFY").length,archive_count:e.changeset.filter(n=>n.kind==="ARCHIVE").length})}function wn(e,n,t){Oe.has(e)||(Oe.add(e),Ie++,t==="failed"&&xe++,X?.event("ASR_RECONCILE_ROW_END",{row_index:e,...n?{kind:n}:{},outcome:t}),X?.setRunTotals?.({work_items_total:Ie,work_items_failed:xe}))}function G(e){return X?.event("ASR_HIGH_RISK_CI",{count:e}),jn(e)}function Y(e,n,t,r){an(e,n,t),wn(n,r,t)}function Hn(e,n,t,r,i=Ze){if(re(t)){let u=he(t),d=u?.sourceIdFor(t)??null;if(u===null||d===null)return{error:`--from '${t}' is not a supported remote URL \u2014 supported: ${pe.map(m=>m.hint).join("; ")}`};if(r!==void 0&&r!==d)return{error:`--source-id '${r}' does not match this URL's own identity '${d}' \u2014 re-run without --source-id. A source adopted with --as updates by re-running context ingest with the same --as; reconcile follows only the URL's own id`};let h=U(e);if(!h.heads.has(d))return{error:`unknown source '${d}' \u2014 see \`kane-cli context list --type source\`. If this URL was ingested under a custom id, update it by re-running context ingest with the same --as`};if(h.heads.get(d)==null)return{error:`source '${d}' is retired \u2014 restore it first with \`kane-cli context revert\`, then reconcile`};let k=Ce(e,d,{remoteUrl:t});return k!==null?{error:k}:{sourceId:d,remoteUrl:t}}if(r===void 0)return{error:"reconcile needs --from <file> AND --source-id <id> \u2014 see `kane-cli context list --type source` for ids"};let o=L(n,t);if(!ue(o)||!Mn(o).isFile())return{error:`--from '${t}' is not a file \u2014 pass the changed source document`};let s=i.route(o,F);if(s!==null)return _n(e,r,s.plugin,o);let c=Je(o);if(!c.ok)return{error:`--from '${t}' is not an ingestable document \u2014 allowed: ${c.allowlist.join(", ")}`};let p=U(e);if(!p.heads.has(r))return{error:`unknown source '${r}' \u2014 see \`kane-cli context list --type source\``};if(p.heads.get(r)==null)return{error:`source '${r}' is retired \u2014 restore it first with \`kane-cli context revert\`, then reconcile`};let v=Ce(e,r,{filePath:o});if(v!==null)return{error:v};let f=null;try{f=ze(o)}catch{}return f!==null&&f!==r&&p.heads.get(f)!=null?{error:`'${W(o)}' already backs live source '${f}' \u2014 did you mean --source-id ${f}? To truly move these bytes under '${r}', retire '${f}' first`}:{sourceId:r,filePath:o}}function _n(e,n,t,r){let i=U(e);if(!i.heads.has(n))return{error:`unknown source '${n}' \u2014 see \`kane-cli context list --type source\``};let o=i.heads.get(n);if(o==null)return{error:`source '${n}' is retired \u2014 restore it first with \`kane-cli context revert\`, then reconcile`};let s=me(n,kn(i.mediaOf(o)),t.manifest.id,!1);if(s!==void 0)return{error:s};let c=N(e);for(let[p,v]of i.heads){if(p===n||v==null||i.mediaOf(v).format!=="plugin")continue;let f=se(c,p,vn(e));if(f.kind==="plugin"&&f.ref===r)return{error:`'${ce(r)?r:W(r)}' already backs live source '${p}' \u2014 did you mean --source-id ${p}? To truly move these bytes under '${n}', retire '${p}' first`}}return{sourceId:n,pluginRef:{plugin:t.manifest.id,ref:r}}}function Nn(e,n,t){let r=se(N(e),n,vn(e));if(r.kind!=="plugin"&&r.kind!=="no-envelope")return{error:yn};let i=$n(t,n,r.plugin);if(i!==null)return{error:i};let o=`kane-cli maintain reconcile --from <file> --source-id ${n}`;if(r.kind==="no-envelope")return{error:`this machine holds no record of the file source '${n}' was read from \u2014 the store was cloned or pulled, or a revert moved its head; pass the file: ${o} [SOURCE_ORIGIN_UNKNOWN]`};if(r.fetched){let s=t.route(r.ref,F);return s===null||s.plugin.manifest.id!==r.plugin?{error:`source '${n}' was read by plugin ${r.plugin} from '${r.ref}', which this build routes to ${s===null?"no plugin":`plugin ${s.plugin.manifest.id}`} \u2014 reconcile it with a build whose plugin ${r.plugin} claims that reference [SOURCE_REF_UNROUTED]`}:{sourceId:n,pluginRef:{plugin:r.plugin,ref:r.ref}}}return F(r.ref)?{sourceId:n,pluginRef:{plugin:r.plugin,ref:r.ref}}:{error:`source '${n}' was last read from '${r.ref}', which is not there \u2014 pass its new place: ${o} [SOURCE_FILE_MISSING]`}}async function Ln(e,n,t,r){if(re(n)||!ce(n))return null;let i=r.route(n,F);if(i===null)return null;let o=i.plugin,s=o.manifest.id,c;try{c=await Xe(o,"claim",He.hookMs,()=>o.claim({ref:i.ref,named:i.named,isFile:!1}))}catch(v){return{error:v instanceof Error?v.message:String(v)}}let p=c?.sourceId;return c==null?{error:`plugin ${s} does not read '${n}' \u2014 pass a reference it claims [PLUGIN_NOT_CLAIMED]`}:Qe(p)?t!==void 0&&t!==p?{error:`--source-id '${t}' does not match the source plugin ${s} reads '${n}' as, '${p}' \u2014 re-run without --source-id`}:_n(e,p,o,n):{error:`plugin ${s} claimed '${n}' as ${JSON.stringify(p)}, which is not an id a source may have [PLUGIN_SOURCE_ID_INVALID]`}}var yn="reconcile needs --from <file|url> AND --source-id <id> (files only \u2014 a URL derives its own id) \u2014 see `kane-cli context list --type source` for ids";function Vn(e,n){let t=fe(e);if(!ue(t))return!1;let r=se(N(t),n);return r.kind==="plugin"||r.kind==="no-envelope"}function kn(e){return e.format==="plugin"?e.plugin?.id??"":null}function $n(e,n,t){return e.byId(t)!==void 0?null:`PLUGIN_MISSING: source '${n}' is read by the plugin ${t}, which this build does not include \u2014 reconcile it with a build that has the ${t} plugin`}function M(e){return e==null?"(none)":e.slice(0,19)}function te(e,n,t,r=!1,i){if(e.out(`reconcile ${n.source_id}: head ${n.head.status} \u2014 ${M(n.head.before)} \u2192 ${M(n.head.after)}`),r||(e.out(`note: ${n.note}`),e.out(`skipped arms: ${n.skipped_arms}`)),n.changed&&(e.out(n.held?`extract ran in override mode; ${t?.defaultsTaken??0} default(s) auto-taken; matched-but-changed and new proposals HELD for your verdict (staged \u2014 nothing committed)`:`extract ran in override mode; ${t?.defaultsTaken??0} default(s) auto-taken; matched-but-changed proposals auto-committed as edits`),i?.({type:"defaults_taken",count:t?.defaultsTaken??0})),r){let o=n.changeset??[],s=(p,v)=>{let f=o.filter(u=>u.kind===p).length;return f>0?`${f} ${v}`:null},c=[s("ADD","add"),s("MODIFY","modify"),s("ARCHIVE","archive")].filter(Boolean);n.changed&&e.out(`changeset: ${o.length} item(s)${c.length?` \u2014 ${c.join(" \xB7 ")}`:""}`),e.out(`plan: ${n.rows.length} row(s) \u2014 each gets a card below`);return}if(n.changed){let o=n.changeset??[];e.out(`changeset: ${o.length} item(s)`);for(let s of o)if(s.kind==="MODIFY")e.out(` [MODIFY] ${H(s.ref)} \u2014 ${s.summary} (${M(s.old_cid)} \u2192 ${s.new_cid===null?"(staged)":M(s.new_cid)})`);else if(s.kind==="ADD")e.out(` [ADD] ${H(s.ref)}`);else{e.out(` [ARCHIVE] ${H(s.ref)} \u2014 ${s.why}`);let c=De(s.impact,"retiring drops");c&&e.out(` ${c}`)}}e.out(`plan: ${n.rows.length} row(s)`);for(let o of n.rows){e.out(` [${o.kind}] ${H(o.ref)} \u2014 ${o.reason}`);let s=De(o.impact,"approving marks");s&&e.out(` ${s}`),e.out(` provenance: ${o.provenance}`),e.out(` action: ${o.action}`)}}function En(e,n){return be({source_id:e.source_id,head:{status:e.head.status},rows:e.rows,archive:(e.changeset??[]).filter(t=>t.kind==="ARCHIVE"),changed:e.changed,held:!!e.held,defaultsTaken:n?.defaultsTaken},process.stdout.columns)}function De(e,n){if(!e||e.stale_refs.length===0)return null;let t=e.direct_refs??[];return`impact: ${n} ${e.stale_refs.length} item(s) stale`+(t.length>0?` \u2014 ${t.length} directly touched: ${t.join(", ")}`:"")}function A(e){return e==="interactive"?"override":e}async function K(e,n,t,r,i,o,s=[],c="override",p,v,f,u,d,h,k){let{dir:m}=e,b;try{b=we(m)}catch(g){return $(r,g instanceof Error?g.message:String(g)),1}try{if(!t){let{runWalkSession:g}=await import("./walk-session-WM4S2JMV.js"),{telemetryEnvName:R}=await import("./bootstrap-BV7HAARR.js");return await g({credentials:B,onIngestRefusal:j,dir:m,rows:n,archive:s,held:p??null,childMode:c,runDesign:u??null,mark:o,markA:f,...v?{archiveState:v}:{},...h?{meta:{verb:"reconcile",sid:h,env:R()}}:{},...k?{resumeCmd:k}:{},signals:E=>T(m,E.ref,E.verdict,E.reason),...d?{script:d}:{}})}return await Yn(e,n,t,r,i,o,s,c,p,v)}finally{b()}}var q=(e,n,t=!1)=>t?`kane-cli maintain reconcile --source-id ${n}`:e?`kane-cli maintain reconcile --from ${e} --source-id ${n}`:void 0,Bn=e=>e===null?void 0:"filePath"in e?e.filePath:"remoteUrl"in e?e.remoteUrl:e.pluginRef.ref,jn=e=>`${e} high-risk item(s) need a human \u2014 ci mode won't guess. Walk interactively or use --mode agent.`;function J(e,n,t){let r=n.rows;e({type:"reconcile_plan",source_id:n.source_id,plan_path:t,rows:r.map(i=>({kind:i.kind,ref:i.ref,why:i.reason})),archive:n.changeset.filter(i=>i.kind==="ARCHIVE").map(i=>({ref:i.ref,why:i.why}))})}function ae(e={}){return{type:"reconcile_summary",applied:0,skipped:0,deferred:0,plan_only:0,failed:0,paused:0,stale_created:0,...e}}var ee=ae();async function ne(e,n,t,r,i,o,s,c,p){let{dir:v}=e;J(i,n,t);let f=n.changeset.filter(h=>h.kind==="ARCHIVE"&&p?.[h.ref]===void 0),u=n.rows;if(s==="ci"&&f.length>0)return i({type:"error",message:G(f.length),code:"HIGH_RISK_CI"}),i(ae()),2;let d;try{d=we(v)}catch(h){return i({type:"error",message:h instanceof Error?h.message:String(h)}),i(ae()),2}try{return await Wn(e,n,t,r,i,o,s,u,f,c)}finally{d()}}async function Wn(e,n,t,r,i,o,s,c,p,v){let{dir:f,store:u}=e,d=0,h=0,k=0,m=0,b=0,g=0,R=0,E=new Set,x=(a,_)=>{try{v?.(a,_)}catch{}};for(let[a,_]of c.entries()){i({type:"reconcile_row_start",kind:_.kind,ref:_.ref,..._.impact?{stale:_.impact.stale_refs.length,direct:_.impact.direct_refs?.length??0}:{}});let w=(l,I,y)=>{wn(a,_.kind,l),i({type:"reconcile_row_end",kind:_.kind,ref:_.ref,outcome:l,...I!==void 0?{exit_code:I}:{},...y?{detail:y}:{}})};if(_.applied){h++,w("skipped");continue}if(_.kind==="REMOVE"){b++,w("plan-only");continue}if(_.held_ref&&n.held){let l=new Set;if(_.kind==="MODIFY"&&_.impact){let y=U(f);for(let P of _.impact.stale_refs){let C=y.resolve(P);C&&y.stale(C.tip)==="fresh"&&l.add(P)}}let I=$e(u,n.held,_.held_ref,Ae);if(!I.ok){k++,R===0&&(R=1),w("failed",1,I.message);continue}if(I.kind==="ADD"){let y=await r(I.ref,{yes:!0,mode:s});if(y!==0){y===3?(m++,R===0&&(R=3),w("paused",3)):(k++,R===0&&(R=1),w("failed",y));continue}}d++,I.kind!=="ADD"&&_.impact&&(g+=l.size),x(a,"approved"),T(f,_.ref,I.kind==="ADD"?"gap-resolved-create":"gap-resolved-evolve"),w("applied");continue}let O=_e(U(f),_.ref);if(!O.ok){h++,w("skipped");continue}let S=O.target;if(E.has(S.ucTip)){h++,w("skipped");continue}if(_.kind==="ADD"){let l=await r(S.seamRef,{yes:!0,mode:s});if(l===3){m++,R===0&&(R=3),w("paused",3);continue}if(l!==0){k++,R===0&&(R=1),w("failed",l);continue}E.add(S.ucTip),d++,x(a,"approved"),T(f,_.ref,"gap-resolved-create"),w("applied")}else{let l=await ye(u,S,{yes:!0,mode:s},o,r,"batch");l.outcome==="evolved"?(E.add(S.ucTip),d++,x(a,"approved"),T(f,_.ref,"gap-resolved-evolve"),w("applied")):l.outcome==="paused"?(m++,R===0&&(R=l.code),w("paused",l.code)):l.outcome==="failed"?(k++,R===0&&(R=1),w("failed",l.code)):(h++,l.outcome==="unchanged"&&(E.add(S.ucTip),x(a,"skipped")),w("skipped",void 0,l.outcome==="unchanged"?"unchanged \u2014 the design agent found nothing to change":void 0))}}return p.length>0&&s!=="agent"&&(i({type:"reconcile_held",source_id:n.source_id,plan_path:t,held:p.map(a=>({ref:a.ref,why:a.why}))}),b+=p.length),p.length>0&&s==="agent"&&(i({type:"reconcile_paused",plan_path:t,pending:p.map(a=>({ref:a.ref,why:a.why}))}),m+=p.length,R===0&&(R=3)),i(ae({applied:d,skipped:h,plan_only:b,failed:k,paused:m,stale_created:g})),R}var Ae={kind:"human",id:process.env.USER??"operator"};function T(e,n,t,r){je(e,Gn(n,t,r))}function Gn(e,n,t){return{ts:new Date().toISOString(),command:"reconcile-walk",id:e,verdict:n,polarity:"preference",by:Ae,target:e,...t!==void 0?{reason:t}:{}}}async function Yn(e,n,t,r,i,o,s=[],c="override",p,v){let{dir:f,store:u}=e,d=0,h=0,k=0,m=0,b=0,g=0,R=0,E=new Set;for(let[x,a]of n.entries()){if(a.applied){r.out(`skipped ${a.ref} \u2014 already applied (${a.applied.outcome} at ${a.applied.at})`),h++;continue}let _=l=>{try{o?.(x,l)}catch(I){$(r,`could not record applied state for ${a.ref}: ${I instanceof Error?I.message:String(I)}`)}};if(a.kind==="REMOVE"){r.out(`REMOVE ${a.ref} \u2014 plan-only in this release (not executed)`),m++;continue}if(a.held_ref&&p){let l=$e(u,p,a.held_ref,Ae);if(!l.ok){$(r,`held ${a.ref}: ${l.message}`),b++,R===0&&(R=1);continue}if(r.out(`committed ${l.ref} (${a.kind==="ADD"?"minted":"updated \u2014 old\u2192new redirect"})`),l.kind==="ADD"){let I=await i(l.ref,{yes:t,mode:c});if(I===3){r.out(`design session for ${l.ref} paused \u2014 resume with the "kane-cli design tests --resume <session>" command printed above`),g++,R===0&&(R=3),_("approved");continue}if(I!==0){$(r,`design run for ${l.ref} ended with exit code ${I}`),b++,R===0&&(R=1),_("approved");continue}}d++,_("approved"),T(f,a.ref,a.kind==="ADD"?"gap-resolved-create":"gap-resolved-evolve");continue}let w=U(f),O=_e(w,a.ref);if(!O.ok){r.out(`skipped ${a.ref} \u2014 ${O.message}`),h++;continue}let S=O.target;if(E.has(S.ucTip)){r.out(`skipped ${a.ref} \u2014 use-case ${S.display} already handled in this walk`),h++;continue}if(a.kind==="ADD"){let l=await i(S.seamRef,{yes:t,mode:c});if(l===3){r.out(`design session for ${S.display} paused \u2014 resume with the "kane-cli design tests --resume <session>" command printed above; this row lands when that session completes`),g++,R===0&&(R=3);continue}if(l!==0){$(r,`design run for ${S.display} ended with exit code ${l}`),b++,R===0&&(R=1);continue}E.add(S.ucTip),d++,_("approved"),T(f,a.ref,"gap-resolved-create")}else{let l=await ye(u,S,{yes:!0,mode:c},r,i,"batch");l.outcome==="evolved"?(E.add(S.ucTip),d++,_("approved"),T(f,a.ref,"gap-resolved-evolve")):l.outcome==="paused"?(g++,R===0&&(R=l.code)):l.outcome==="failed"?(b++,R===0&&(R=l.code)):(h++,l.outcome==="unchanged"&&(E.add(S.ucTip),_("skipped")))}}for(let x of s)if(x.kind==="ARCHIVE"&&v?.[x.ref]===void 0){r.out(`[ARCHIVE] ${x.ref} \u2014 ${x.why}`);{let a=De(x.impact,"retiring drops");a&&r.out(` ${a}`)}r.out(" plan-only \u2014 retire belongs to the interactive session (never headless)"),m++}return r.out(`reconcile walk: ${d} applied, ${h} skipped, ${k} deferred, ${m} plan-only`+(b>0?`, ${b} failed`:"")+(g>0?`, ${g} paused`:"")),R}var Kn=new Set(pe.map(e=>e.name));function Ce(e,n,t){let r=U(e),i=r.heads.get(n);if(i==null)return null;let o=r.mediaOf(i);if("pluginRef"in t)return me(n,kn(o),t.pluginRef.plugin,!1)??null;if("remoteUrl"in t){let s=he(t.remoteUrl)?.name??"remote";return o.format!==s?`source '${n}' is backed by ${o.format} content, not a ${s} source \u2014 reconcile it with the --from it was originally ingested from`:null}return Kn.has(o.format)?`source '${n}' is a remote ${o.format} source \u2014 pass its URL to --from, not a file`:null}function Me(e,n,t,r){let{store:i}=e;if("pluginRef"in n){let o=V(r).byId(n.pluginRef.plugin);if(o===void 0)throw new Error(`the plugin ${n.pluginRef.plugin} is not loaded`);let s=V(r).route(n.pluginRef.ref,F),c=s!==null&&s.plugin===o?s:{ref:n.pluginRef.ref,named:!1};return fn(i,o,c.ref,{connect:r.connections??en,named:c.named,registry:V(r)})}return"remoteUrl"in n?gn(i,n.remoteUrl,{out:t.out,err:t.err},B,r.remoteFindProvider):dn(i,n.filePath)}var V=e=>e.plugins??nn();function Sn(e){return"pluginRef"in e?{plugin_ref:e.pluginRef}:"remoteUrl"in e?{remote_url:e.remoteUrl}:{backing_path:e.filePath}}function Pn(e,n,t,r){let i=Ce(e,n.source_id,t);return i!==null?`stored plan cannot replay: ${i}`:"pluginRef"in t?$n(V(r),n.source_id,t.pluginRef.plugin):null}function bn(e){return e.plugin_ref!==void 0?{pluginRef:e.plugin_ref}:e.remote_url!==void 0?{remoteUrl:e.remote_url}:e.backing_path!==void 0?{filePath:e.backing_path}:null}var le=Symbol("owned");async function Ue(e,n,t,r,i,o=!1,s=!1,c=!1){let{store:p}=e,v=i.seams??{reingest:Me(e,t,r,i),reextract:Se(p,{credentials:B,onIngestRefusal:j,stage:o,hostOut:h=>r.out(h),hostEmit:h=>{h.type!=="run_start"&&i.emitEvent?.(h)},...i.emitEvent?{}:{hostProgress:h=>process.stderr.write(h+`
|
|
3
|
-
`)}})},f=null,u={reingest:v.reingest,reextract:async h=>f=await v.reextract(h)},d;try{r.out(`reconciling ${n}: re-reading the source and comparing against the graph\u2026`),d=await(i.buildPlan??Ee)(p,n,u,c?{reextractUnchanged:!0}:{})}catch(h){return h instanceof Error&&h.message.startsWith("SOURCE_ID_OWNED: ")?($(r,h.message),le):($(r,`reconcile failed: ${h instanceof Error?h.message:String(h)}`),null)}if(d.changed&&Tn(d),d.changed)if(s)for(let h of En(d,f))r.out(h);else te(r,d,f,!1,i.emitEvent);return d}function In(e,n){if(n.plugin_ref===void 0||n.held===void 0)return null;let t=U(e).heads.get(n.source_id);if(typeof t!="string")return null;let r=n.held.staged_source_cid,i=null;if(r===void 0||t!==r)i={cid:t,where:"the source is now"};else if(F(n.plugin_ref.ref)){let o=An(n.plugin_ref.ref),s=Fe("source",Te(n.source_id,Be(o)));s!==t&&(i={cid:s,where:`${W(n.plugin_ref.ref)} now holds`})}return i===null?null:`PLUGIN_VERSION_MOVED: plan ${n.created} was built for ${n.source_id} @${M(r??null)}, ${i.where} @${M(i.cid)} \u2014 its held rows are not carried across a version move; run kane-cli maintain reconcile --source-id ${n.source_id} again`}var xn=Symbol("set-aside");async function qn(e){let n=N(e),[{render:t},r,{ScrollbackProvider:i},{ChatSurface:o},{makeChatController:s},{makeReconcileDeps:c}]=await Promise.all([import("./build-5ZN47FAT.js"),import("./react-QWOAB3TB.js"),import("./scrollback-GGNBDFQV.js"),import("./ChatSurface-
|
|
4
|
-
`)}})},m;try{m=await(r.buildPlan??Ee)(p,n.source_id,k,{resumeHeld:u})}catch(w){return $(t,`reconcile failed: ${w instanceof Error?w.message:String(w)}`),1}if(i==="interactive"&&!s)for(let w of En(m,null))t.out(w);else te(t,m,null,!1,r.emitEvent);let b=Z(c),g=null;if(b!=null){let w={},O=new Set(m.changeset.filter(S=>S.kind==="ARCHIVE").map(S=>S.ref));for(let[S,l]of Object.entries(n.archive_state??{}))O.has(S)&&(w[S]=l);g=ve(c,{version:2,source_id:m.source_id,...Sn(d),head_pin:b,created:new Date().toISOString().replace(/[:.]/g,"-"),skipped_arms:m.skipped_arms,note:m.note,changeset:m.changeset,rows:m.rows,...m.held?{held:m.held}:{},...Object.keys(w).length>0?{archive_state:w}:{}}),t.out(`plan stored: ${g}`)}if(s){if(i==="agent"||t.machine){let w=r.emitEvent??(()=>{});J(w,m,g),w({...ee})}return 0}let R=r.emitEvent??(()=>{}),E=g?ie(c,g).plan.archive_state:void 0,x=g?(w,O)=>Y(g,w,O):void 0,a=g?(w,O)=>oe(g,w,O):void 0;if(i==="agent"||t.machine)return ne(e,m,g,o,R,t,A(i),x,E);let _=m.changeset.filter(w=>w.kind==="ARCHIVE"&&E?.[w.ref]===void 0);return i==="ci"&&_.length>0?($(t,G(_.length)),2):K(e,m.rows,i==="override"||i==="ci",t,o,x,m.changeset,A(i),m.held,E,a,v,f,m.source_id,q(n.backing_path??n.remote_url,m.source_id,n.plugin_ref!==void 0))}async function hn(e,n,t={},r=process.cwd()){let{telemetryBootstrap:i,telemetryEnvName:o}=await import("./bootstrap-
|
|
5
|
-
`),2}if(!t&&r===process.cwd()){let{remoteEntry:o}=await import("./remote-entry-
|
|
2
|
+
import{b as Pe}from"./chunk-NFDVDEOH.js";import{d as tn}from"./chunk-3AGP2BVN.js";import{N as $,O as We,Q as Ge,S as Ye,T as Ke,U as qe,V as ge}from"./chunk-NNVHWFLI.js";import"./chunk-PZOQ2IQK.js";import"./chunk-FNBHP75S.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{a as N}from"./chunk-TCK7WR3M.js";import"./chunk-WMGKUERB.js";import"./chunk-2EKLTUY2.js";import{a as fe}from"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-HCBYKLMW.js";import"./chunk-YDSGXB25.js";import{a as ve,b as ie,c as Re,d as oe,e as sn,f as cn,h as an,i as we}from"./chunk-47WQBG5I.js";import{e as ke,f as un,g as $e,h as Ee,i as dn,j as fn,k as gn,l as Se}from"./chunk-3DFBFYTD.js";import{a as _e,c as ye,d as ln}from"./chunk-IPIARGHE.js";import"./chunk-Y7GSOKXS.js";import"./chunk-I6S6DZ2E.js";import{a as j}from"./chunk-KM3YCIDV.js";import"./chunk-4DRFMDAW.js";import"./chunk-JM6AKCN4.js";import{a as rn,c as on}from"./chunk-PUNFWBRW.js";import"./chunk-J3XOEMKO.js";import"./chunk-MUX2A37P.js";import"./chunk-W5HFUBXD.js";import"./chunk-73ZFOJOK.js";import"./chunk-OVB5GVRB.js";import"./chunk-JSSM2TWY.js";import"./chunk-LB5NIDW6.js";import"./chunk-H6IPGZTP.js";import"./chunk-LD5B3QFW.js";import"./chunk-HD6NR44L.js";import"./chunk-3A4KK22B.js";import{a as F,b as Qe,c as Xe}from"./chunk-6KUUSONE.js";import{c as en,h as nn}from"./chunk-PSBR2LVL.js";import{f as Ze}from"./chunk-GRQKMOKE.js";import{i as pe,j as re,k as he}from"./chunk-3CFAE36M.js";import"./chunk-GBQ4K25P.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import{j as Je,l as me,n as ze}from"./chunk-C3DMMAFP.js";import"./chunk-AQ2OG2EF.js";import"./chunk-REKHAN53.js";import"./chunk-UVL6XQHU.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-TFSWG7AS.js";import"./chunk-JBUKEIYL.js";import"./chunk-W5EDS4DF.js";import"./chunk-XB6BJPDL.js";import{a as je}from"./chunk-ZCIWQHCO.js";import{b as Be}from"./chunk-5ORBAYTU.js";import{b as B}from"./chunk-XRJH4UF3.js";import"./chunk-PVN64537.js";import"./chunk-VJGWVBZR.js";import{Ia as Ve,M as Le,Wa as Z,a as Fe,c as Te,n as Ne,oa as H,vb as U}from"./chunk-5EAJO372.js";import{d as He}from"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-OKCVG7AG.js";import"./chunk-XDAFRUAJ.js";import"./chunk-7V4BQSSV.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-4QTH7VYE.js";import"./chunk-V24LUINK.js";import"./chunk-JYH7CTF7.js";import"./chunk-BRWCWZE3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-A7RJQJNT.js";import"./chunk-UR6MHSHU.js";import{existsSync as ue,readFileSync as An,statSync as Mn}from"fs";import{basename as W,dirname as vn,resolve as L}from"path";import{isAbsolute as Cn,resolve as Un}from"path";function se(e,n,t){let r=Le(e),i=r.heads.get(n);if(typeof i!="string")return{kind:"no-source"};let o=r.mediaOf(i).plugin;if(r.mediaOf(i).format!=="plugin"||o===void 0)return{kind:"not-plugin"};if(o.fetch!==void 0)return{kind:"plugin",plugin:o.id,ref:o.fetch.ref,fetched:!0};let s=null;for(let u of e.recordsSince(null))u.source_head_moves?.[n]===i?s=u.seq:u.source_head_moves?.[n]!==void 0&&(s=null);let c=s===null?null:e.tokenAt(s),p=c===null?null:e.intentOf(c),v=p?.verb==="ingest"?p.args:null;if(v?.source_id!==n||typeof v.label!="string"||v.label==="")return{kind:"no-envelope",plugin:o.id};let f=t!==void 0&&!Cn(v.label)?Un(t,v.label):v.label;return{kind:"plugin",plugin:o.id,ref:f}}var ce=e=>Ne(e)===null;function mn(e){if(!e||e.stale_refs.length===0)return"\u2014";let n=e.direct_refs??[];return`${e.stale_refs.length} stale${n.length>0?` \xB7 ${n.length} direct`:""}`}function be(e,n){let t=[...e.rows.filter(o=>o.kind!=="REMOVE").map(o=>[o.kind,H(o.ref),o.reason,mn(o.impact)]),...e.archive.map(o=>["ARCHIVE",H(o.ref),o.why,mn(o.impact)])],r=Math.max(40,n??100),i=[`reconcile ${e.source_id} \u2014 head ${e.head.status} \xB7 ${t.length} decision${t.length===1?"":"s"}`];return t.length>0&&i.push(...tn(["kind","ref","why","impact"],t,r,2)),e.changed&&i.push(e.held?`extract ran in override mode; ${e.defaultsTaken??0} default(s) auto-taken; matched-but-changed and new proposals HELD for your verdict (staged \u2014 nothing committed)`:`extract ran in override mode; ${e.defaultsTaken??0} default(s) auto-taken; matched-but-changed proposals auto-committed as edits`),i.push("each row becomes a card below \u2014 verdicts commit as they land"),e.planPath&&i.push(`plan: ${e.planPath}`),i}var Rn=new Set(["interactive","agent","ci","override"]);function Fn(e,n){if(e.mode!==void 0&&!Rn.has(e.mode))return{error:`--mode must be interactive | agent | ci | override, got '${e.mode}'`,code:"MODE_USAGE"};let t=e.mode,r="reconcile without a TTY needs an explicit mode \u2014 pass --mode agent|ci|override, or --plan for a preview";return t==="interactive"&&!n?{error:r}:t||(n?"interactive":e.plan?"override":{error:r})}async function pn(e){let{makeHeadlessIO:n,agentRefusal:t}=await import("./headless-io-FFM5T6KL.js");return t(n("ndjson","reconcile"),e,"MODE_USAGE")}var X=null,Ie=0,xe=0,Oe=new Set;function Tn(e){X?.event("ASR_RECONCILE_PLAN",{row_count:e.rows.length,add_count:e.rows.filter(n=>n.kind==="ADD").length,modify_count:e.rows.filter(n=>n.kind==="MODIFY").length,archive_count:e.changeset.filter(n=>n.kind==="ARCHIVE").length})}function wn(e,n,t){Oe.has(e)||(Oe.add(e),Ie++,t==="failed"&&xe++,X?.event("ASR_RECONCILE_ROW_END",{row_index:e,...n?{kind:n}:{},outcome:t}),X?.setRunTotals?.({work_items_total:Ie,work_items_failed:xe}))}function G(e){return X?.event("ASR_HIGH_RISK_CI",{count:e}),jn(e)}function Y(e,n,t,r){an(e,n,t),wn(n,r,t)}function Hn(e,n,t,r,i=Ze){if(re(t)){let u=he(t),d=u?.sourceIdFor(t)??null;if(u===null||d===null)return{error:`--from '${t}' is not a supported remote URL \u2014 supported: ${pe.map(m=>m.hint).join("; ")}`};if(r!==void 0&&r!==d)return{error:`--source-id '${r}' does not match this URL's own identity '${d}' \u2014 re-run without --source-id. A source adopted with --as updates by re-running context ingest with the same --as; reconcile follows only the URL's own id`};let h=U(e);if(!h.heads.has(d))return{error:`unknown source '${d}' \u2014 see \`kane-cli context list --type source\`. If this URL was ingested under a custom id, update it by re-running context ingest with the same --as`};if(h.heads.get(d)==null)return{error:`source '${d}' is retired \u2014 restore it first with \`kane-cli context revert\`, then reconcile`};let k=Ce(e,d,{remoteUrl:t});return k!==null?{error:k}:{sourceId:d,remoteUrl:t}}if(r===void 0)return{error:"reconcile needs --from <file> AND --source-id <id> \u2014 see `kane-cli context list --type source` for ids"};let o=L(n,t);if(!ue(o)||!Mn(o).isFile())return{error:`--from '${t}' is not a file \u2014 pass the changed source document`};let s=i.route(o,F);if(s!==null)return _n(e,r,s.plugin,o);let c=Je(o);if(!c.ok)return{error:`--from '${t}' is not an ingestable document \u2014 allowed: ${c.allowlist.join(", ")}`};let p=U(e);if(!p.heads.has(r))return{error:`unknown source '${r}' \u2014 see \`kane-cli context list --type source\``};if(p.heads.get(r)==null)return{error:`source '${r}' is retired \u2014 restore it first with \`kane-cli context revert\`, then reconcile`};let v=Ce(e,r,{filePath:o});if(v!==null)return{error:v};let f=null;try{f=ze(o)}catch{}return f!==null&&f!==r&&p.heads.get(f)!=null?{error:`'${W(o)}' already backs live source '${f}' \u2014 did you mean --source-id ${f}? To truly move these bytes under '${r}', retire '${f}' first`}:{sourceId:r,filePath:o}}function _n(e,n,t,r){let i=U(e);if(!i.heads.has(n))return{error:`unknown source '${n}' \u2014 see \`kane-cli context list --type source\``};let o=i.heads.get(n);if(o==null)return{error:`source '${n}' is retired \u2014 restore it first with \`kane-cli context revert\`, then reconcile`};let s=me(n,kn(i.mediaOf(o)),t.manifest.id,!1);if(s!==void 0)return{error:s};let c=N(e);for(let[p,v]of i.heads){if(p===n||v==null||i.mediaOf(v).format!=="plugin")continue;let f=se(c,p,vn(e));if(f.kind==="plugin"&&f.ref===r)return{error:`'${ce(r)?r:W(r)}' already backs live source '${p}' \u2014 did you mean --source-id ${p}? To truly move these bytes under '${n}', retire '${p}' first`}}return{sourceId:n,pluginRef:{plugin:t.manifest.id,ref:r}}}function Nn(e,n,t){let r=se(N(e),n,vn(e));if(r.kind!=="plugin"&&r.kind!=="no-envelope")return{error:yn};let i=$n(t,n,r.plugin);if(i!==null)return{error:i};let o=`kane-cli maintain reconcile --from <file> --source-id ${n}`;if(r.kind==="no-envelope")return{error:`this machine holds no record of the file source '${n}' was read from \u2014 the store was cloned or pulled, or a revert moved its head; pass the file: ${o} [SOURCE_ORIGIN_UNKNOWN]`};if(r.fetched){let s=t.route(r.ref,F);return s===null||s.plugin.manifest.id!==r.plugin?{error:`source '${n}' was read by plugin ${r.plugin} from '${r.ref}', which this build routes to ${s===null?"no plugin":`plugin ${s.plugin.manifest.id}`} \u2014 reconcile it with a build whose plugin ${r.plugin} claims that reference [SOURCE_REF_UNROUTED]`}:{sourceId:n,pluginRef:{plugin:r.plugin,ref:r.ref}}}return F(r.ref)?{sourceId:n,pluginRef:{plugin:r.plugin,ref:r.ref}}:{error:`source '${n}' was last read from '${r.ref}', which is not there \u2014 pass its new place: ${o} [SOURCE_FILE_MISSING]`}}async function Ln(e,n,t,r){if(re(n)||!ce(n))return null;let i=r.route(n,F);if(i===null)return null;let o=i.plugin,s=o.manifest.id,c;try{c=await Xe(o,"claim",He.hookMs,()=>o.claim({ref:i.ref,named:i.named,isFile:!1}))}catch(v){return{error:v instanceof Error?v.message:String(v)}}let p=c?.sourceId;return c==null?{error:`plugin ${s} does not read '${n}' \u2014 pass a reference it claims [PLUGIN_NOT_CLAIMED]`}:Qe(p)?t!==void 0&&t!==p?{error:`--source-id '${t}' does not match the source plugin ${s} reads '${n}' as, '${p}' \u2014 re-run without --source-id`}:_n(e,p,o,n):{error:`plugin ${s} claimed '${n}' as ${JSON.stringify(p)}, which is not an id a source may have [PLUGIN_SOURCE_ID_INVALID]`}}var yn="reconcile needs --from <file|url> AND --source-id <id> (files only \u2014 a URL derives its own id) \u2014 see `kane-cli context list --type source` for ids";function Vn(e,n){let t=fe(e);if(!ue(t))return!1;let r=se(N(t),n);return r.kind==="plugin"||r.kind==="no-envelope"}function kn(e){return e.format==="plugin"?e.plugin?.id??"":null}function $n(e,n,t){return e.byId(t)!==void 0?null:`PLUGIN_MISSING: source '${n}' is read by the plugin ${t}, which this build does not include \u2014 reconcile it with a build that has the ${t} plugin`}function M(e){return e==null?"(none)":e.slice(0,19)}function te(e,n,t,r=!1,i){if(e.out(`reconcile ${n.source_id}: head ${n.head.status} \u2014 ${M(n.head.before)} \u2192 ${M(n.head.after)}`),r||(e.out(`note: ${n.note}`),e.out(`skipped arms: ${n.skipped_arms}`)),n.changed&&(e.out(n.held?`extract ran in override mode; ${t?.defaultsTaken??0} default(s) auto-taken; matched-but-changed and new proposals HELD for your verdict (staged \u2014 nothing committed)`:`extract ran in override mode; ${t?.defaultsTaken??0} default(s) auto-taken; matched-but-changed proposals auto-committed as edits`),i?.({type:"defaults_taken",count:t?.defaultsTaken??0})),r){let o=n.changeset??[],s=(p,v)=>{let f=o.filter(u=>u.kind===p).length;return f>0?`${f} ${v}`:null},c=[s("ADD","add"),s("MODIFY","modify"),s("ARCHIVE","archive")].filter(Boolean);n.changed&&e.out(`changeset: ${o.length} item(s)${c.length?` \u2014 ${c.join(" \xB7 ")}`:""}`),e.out(`plan: ${n.rows.length} row(s) \u2014 each gets a card below`);return}if(n.changed){let o=n.changeset??[];e.out(`changeset: ${o.length} item(s)`);for(let s of o)if(s.kind==="MODIFY")e.out(` [MODIFY] ${H(s.ref)} \u2014 ${s.summary} (${M(s.old_cid)} \u2192 ${s.new_cid===null?"(staged)":M(s.new_cid)})`);else if(s.kind==="ADD")e.out(` [ADD] ${H(s.ref)}`);else{e.out(` [ARCHIVE] ${H(s.ref)} \u2014 ${s.why}`);let c=De(s.impact,"retiring drops");c&&e.out(` ${c}`)}}e.out(`plan: ${n.rows.length} row(s)`);for(let o of n.rows){e.out(` [${o.kind}] ${H(o.ref)} \u2014 ${o.reason}`);let s=De(o.impact,"approving marks");s&&e.out(` ${s}`),e.out(` provenance: ${o.provenance}`),e.out(` action: ${o.action}`)}}function En(e,n){return be({source_id:e.source_id,head:{status:e.head.status},rows:e.rows,archive:(e.changeset??[]).filter(t=>t.kind==="ARCHIVE"),changed:e.changed,held:!!e.held,defaultsTaken:n?.defaultsTaken},process.stdout.columns)}function De(e,n){if(!e||e.stale_refs.length===0)return null;let t=e.direct_refs??[];return`impact: ${n} ${e.stale_refs.length} item(s) stale`+(t.length>0?` \u2014 ${t.length} directly touched: ${t.join(", ")}`:"")}function A(e){return e==="interactive"?"override":e}async function K(e,n,t,r,i,o,s=[],c="override",p,v,f,u,d,h,k){let{dir:m}=e,b;try{b=we(m)}catch(g){return $(r,g instanceof Error?g.message:String(g)),1}try{if(!t){let{runWalkSession:g}=await import("./walk-session-W6OLG5NT.js"),{telemetryEnvName:R}=await import("./bootstrap-A2O4UZUJ.js");return await g({credentials:B,onIngestRefusal:j,dir:m,rows:n,archive:s,held:p??null,childMode:c,runDesign:u??null,mark:o,markA:f,...v?{archiveState:v}:{},...h?{meta:{verb:"reconcile",sid:h,env:R()}}:{},...k?{resumeCmd:k}:{},signals:E=>T(m,E.ref,E.verdict,E.reason),...d?{script:d}:{}})}return await Yn(e,n,t,r,i,o,s,c,p,v)}finally{b()}}var q=(e,n,t=!1)=>t?`kane-cli maintain reconcile --source-id ${n}`:e?`kane-cli maintain reconcile --from ${e} --source-id ${n}`:void 0,Bn=e=>e===null?void 0:"filePath"in e?e.filePath:"remoteUrl"in e?e.remoteUrl:e.pluginRef.ref,jn=e=>`${e} high-risk item(s) need a human \u2014 ci mode won't guess. Walk interactively or use --mode agent.`;function J(e,n,t){let r=n.rows;e({type:"reconcile_plan",source_id:n.source_id,plan_path:t,rows:r.map(i=>({kind:i.kind,ref:i.ref,why:i.reason})),archive:n.changeset.filter(i=>i.kind==="ARCHIVE").map(i=>({ref:i.ref,why:i.why}))})}function ae(e={}){return{type:"reconcile_summary",applied:0,skipped:0,deferred:0,plan_only:0,failed:0,paused:0,stale_created:0,...e}}var ee=ae();async function ne(e,n,t,r,i,o,s,c,p){let{dir:v}=e;J(i,n,t);let f=n.changeset.filter(h=>h.kind==="ARCHIVE"&&p?.[h.ref]===void 0),u=n.rows;if(s==="ci"&&f.length>0)return i({type:"error",message:G(f.length),code:"HIGH_RISK_CI"}),i(ae()),2;let d;try{d=we(v)}catch(h){return i({type:"error",message:h instanceof Error?h.message:String(h)}),i(ae()),2}try{return await Wn(e,n,t,r,i,o,s,u,f,c)}finally{d()}}async function Wn(e,n,t,r,i,o,s,c,p,v){let{dir:f,store:u}=e,d=0,h=0,k=0,m=0,b=0,g=0,R=0,E=new Set,x=(a,_)=>{try{v?.(a,_)}catch{}};for(let[a,_]of c.entries()){i({type:"reconcile_row_start",kind:_.kind,ref:_.ref,..._.impact?{stale:_.impact.stale_refs.length,direct:_.impact.direct_refs?.length??0}:{}});let w=(l,I,y)=>{wn(a,_.kind,l),i({type:"reconcile_row_end",kind:_.kind,ref:_.ref,outcome:l,...I!==void 0?{exit_code:I}:{},...y?{detail:y}:{}})};if(_.applied){h++,w("skipped");continue}if(_.kind==="REMOVE"){b++,w("plan-only");continue}if(_.held_ref&&n.held){let l=new Set;if(_.kind==="MODIFY"&&_.impact){let y=U(f);for(let P of _.impact.stale_refs){let C=y.resolve(P);C&&y.stale(C.tip)==="fresh"&&l.add(P)}}let I=$e(u,n.held,_.held_ref,Ae);if(!I.ok){k++,R===0&&(R=1),w("failed",1,I.message);continue}if(I.kind==="ADD"){let y=await r(I.ref,{yes:!0,mode:s});if(y!==0){y===3?(m++,R===0&&(R=3),w("paused",3)):(k++,R===0&&(R=1),w("failed",y));continue}}d++,I.kind!=="ADD"&&_.impact&&(g+=l.size),x(a,"approved"),T(f,_.ref,I.kind==="ADD"?"gap-resolved-create":"gap-resolved-evolve"),w("applied");continue}let O=_e(U(f),_.ref);if(!O.ok){h++,w("skipped");continue}let S=O.target;if(E.has(S.ucTip)){h++,w("skipped");continue}if(_.kind==="ADD"){let l=await r(S.seamRef,{yes:!0,mode:s});if(l===3){m++,R===0&&(R=3),w("paused",3);continue}if(l!==0){k++,R===0&&(R=1),w("failed",l);continue}E.add(S.ucTip),d++,x(a,"approved"),T(f,_.ref,"gap-resolved-create"),w("applied")}else{let l=await ye(u,S,{yes:!0,mode:s},o,r,"batch");l.outcome==="evolved"?(E.add(S.ucTip),d++,x(a,"approved"),T(f,_.ref,"gap-resolved-evolve"),w("applied")):l.outcome==="paused"?(m++,R===0&&(R=l.code),w("paused",l.code)):l.outcome==="failed"?(k++,R===0&&(R=1),w("failed",l.code)):(h++,l.outcome==="unchanged"&&(E.add(S.ucTip),x(a,"skipped")),w("skipped",void 0,l.outcome==="unchanged"?"unchanged \u2014 the design agent found nothing to change":void 0))}}return p.length>0&&s!=="agent"&&(i({type:"reconcile_held",source_id:n.source_id,plan_path:t,held:p.map(a=>({ref:a.ref,why:a.why}))}),b+=p.length),p.length>0&&s==="agent"&&(i({type:"reconcile_paused",plan_path:t,pending:p.map(a=>({ref:a.ref,why:a.why}))}),m+=p.length,R===0&&(R=3)),i(ae({applied:d,skipped:h,plan_only:b,failed:k,paused:m,stale_created:g})),R}var Ae={kind:"human",id:process.env.USER??"operator"};function T(e,n,t,r){je(e,Gn(n,t,r))}function Gn(e,n,t){return{ts:new Date().toISOString(),command:"reconcile-walk",id:e,verdict:n,polarity:"preference",by:Ae,target:e,...t!==void 0?{reason:t}:{}}}async function Yn(e,n,t,r,i,o,s=[],c="override",p,v){let{dir:f,store:u}=e,d=0,h=0,k=0,m=0,b=0,g=0,R=0,E=new Set;for(let[x,a]of n.entries()){if(a.applied){r.out(`skipped ${a.ref} \u2014 already applied (${a.applied.outcome} at ${a.applied.at})`),h++;continue}let _=l=>{try{o?.(x,l)}catch(I){$(r,`could not record applied state for ${a.ref}: ${I instanceof Error?I.message:String(I)}`)}};if(a.kind==="REMOVE"){r.out(`REMOVE ${a.ref} \u2014 plan-only in this release (not executed)`),m++;continue}if(a.held_ref&&p){let l=$e(u,p,a.held_ref,Ae);if(!l.ok){$(r,`held ${a.ref}: ${l.message}`),b++,R===0&&(R=1);continue}if(r.out(`committed ${l.ref} (${a.kind==="ADD"?"minted":"updated \u2014 old\u2192new redirect"})`),l.kind==="ADD"){let I=await i(l.ref,{yes:t,mode:c});if(I===3){r.out(`design session for ${l.ref} paused \u2014 resume with the "kane-cli design tests --resume <session>" command printed above`),g++,R===0&&(R=3),_("approved");continue}if(I!==0){$(r,`design run for ${l.ref} ended with exit code ${I}`),b++,R===0&&(R=1),_("approved");continue}}d++,_("approved"),T(f,a.ref,a.kind==="ADD"?"gap-resolved-create":"gap-resolved-evolve");continue}let w=U(f),O=_e(w,a.ref);if(!O.ok){r.out(`skipped ${a.ref} \u2014 ${O.message}`),h++;continue}let S=O.target;if(E.has(S.ucTip)){r.out(`skipped ${a.ref} \u2014 use-case ${S.display} already handled in this walk`),h++;continue}if(a.kind==="ADD"){let l=await i(S.seamRef,{yes:t,mode:c});if(l===3){r.out(`design session for ${S.display} paused \u2014 resume with the "kane-cli design tests --resume <session>" command printed above; this row lands when that session completes`),g++,R===0&&(R=3);continue}if(l!==0){$(r,`design run for ${S.display} ended with exit code ${l}`),b++,R===0&&(R=1);continue}E.add(S.ucTip),d++,_("approved"),T(f,a.ref,"gap-resolved-create")}else{let l=await ye(u,S,{yes:!0,mode:c},r,i,"batch");l.outcome==="evolved"?(E.add(S.ucTip),d++,_("approved"),T(f,a.ref,"gap-resolved-evolve")):l.outcome==="paused"?(g++,R===0&&(R=l.code)):l.outcome==="failed"?(b++,R===0&&(R=l.code)):(h++,l.outcome==="unchanged"&&(E.add(S.ucTip),_("skipped")))}}for(let x of s)if(x.kind==="ARCHIVE"&&v?.[x.ref]===void 0){r.out(`[ARCHIVE] ${x.ref} \u2014 ${x.why}`);{let a=De(x.impact,"retiring drops");a&&r.out(` ${a}`)}r.out(" plan-only \u2014 retire belongs to the interactive session (never headless)"),m++}return r.out(`reconcile walk: ${d} applied, ${h} skipped, ${k} deferred, ${m} plan-only`+(b>0?`, ${b} failed`:"")+(g>0?`, ${g} paused`:"")),R}var Kn=new Set(pe.map(e=>e.name));function Ce(e,n,t){let r=U(e),i=r.heads.get(n);if(i==null)return null;let o=r.mediaOf(i);if("pluginRef"in t)return me(n,kn(o),t.pluginRef.plugin,!1)??null;if("remoteUrl"in t){let s=he(t.remoteUrl)?.name??"remote";return o.format!==s?`source '${n}' is backed by ${o.format} content, not a ${s} source \u2014 reconcile it with the --from it was originally ingested from`:null}return Kn.has(o.format)?`source '${n}' is a remote ${o.format} source \u2014 pass its URL to --from, not a file`:null}function Me(e,n,t,r){let{store:i}=e;if("pluginRef"in n){let o=V(r).byId(n.pluginRef.plugin);if(o===void 0)throw new Error(`the plugin ${n.pluginRef.plugin} is not loaded`);let s=V(r).route(n.pluginRef.ref,F),c=s!==null&&s.plugin===o?s:{ref:n.pluginRef.ref,named:!1};return fn(i,o,c.ref,{connect:r.connections??en,named:c.named,registry:V(r)})}return"remoteUrl"in n?gn(i,n.remoteUrl,{out:t.out,err:t.err},B,r.remoteFindProvider):dn(i,n.filePath)}var V=e=>e.plugins??nn();function Sn(e){return"pluginRef"in e?{plugin_ref:e.pluginRef}:"remoteUrl"in e?{remote_url:e.remoteUrl}:{backing_path:e.filePath}}function Pn(e,n,t,r){let i=Ce(e,n.source_id,t);return i!==null?`stored plan cannot replay: ${i}`:"pluginRef"in t?$n(V(r),n.source_id,t.pluginRef.plugin):null}function bn(e){return e.plugin_ref!==void 0?{pluginRef:e.plugin_ref}:e.remote_url!==void 0?{remoteUrl:e.remote_url}:e.backing_path!==void 0?{filePath:e.backing_path}:null}var le=Symbol("owned");async function Ue(e,n,t,r,i,o=!1,s=!1,c=!1){let{store:p}=e,v=i.seams??{reingest:Me(e,t,r,i),reextract:Se(p,{credentials:B,onIngestRefusal:j,stage:o,hostOut:h=>r.out(h),hostEmit:h=>{h.type!=="run_start"&&i.emitEvent?.(h)},...i.emitEvent?{}:{hostProgress:h=>process.stderr.write(h+`
|
|
3
|
+
`)}})},f=null,u={reingest:v.reingest,reextract:async h=>f=await v.reextract(h)},d;try{r.out(`reconciling ${n}: re-reading the source and comparing against the graph\u2026`),d=await(i.buildPlan??Ee)(p,n,u,c?{reextractUnchanged:!0}:{})}catch(h){return h instanceof Error&&h.message.startsWith("SOURCE_ID_OWNED: ")?($(r,h.message),le):($(r,`reconcile failed: ${h instanceof Error?h.message:String(h)}`),null)}if(d.changed&&Tn(d),d.changed)if(s)for(let h of En(d,f))r.out(h);else te(r,d,f,!1,i.emitEvent);return d}function In(e,n){if(n.plugin_ref===void 0||n.held===void 0)return null;let t=U(e).heads.get(n.source_id);if(typeof t!="string")return null;let r=n.held.staged_source_cid,i=null;if(r===void 0||t!==r)i={cid:t,where:"the source is now"};else if(F(n.plugin_ref.ref)){let o=An(n.plugin_ref.ref),s=Fe("source",Te(n.source_id,Be(o)));s!==t&&(i={cid:s,where:`${W(n.plugin_ref.ref)} now holds`})}return i===null?null:`PLUGIN_VERSION_MOVED: plan ${n.created} was built for ${n.source_id} @${M(r??null)}, ${i.where} @${M(i.cid)} \u2014 its held rows are not carried across a version move; run kane-cli maintain reconcile --source-id ${n.source_id} again`}var xn=Symbol("set-aside");async function qn(e){let n=N(e),[{render:t},r,{ScrollbackProvider:i},{ChatSurface:o},{makeChatController:s},{makeReconcileDeps:c}]=await Promise.all([import("./build-5ZN47FAT.js"),import("./react-QWOAB3TB.js"),import("./scrollback-GGNBDFQV.js"),import("./ChatSurface-WKYH5MYP.js"),import("./chat-controller-5ZBG23L6.js"),import("./reconcile-deps-TILDRCHG.js")]),p=r.default??r,v=s(),f=c({credentials:B,onIngestRefusal:j,store:n,note:u=>v.note(u),emitWalkSignal:(u,d,h)=>T(e,u,d,h)});return new Promise(u=>{let d=t(p.createElement(i,null,p.createElement(o,{controller:v,verb:"extract",reconcile:f,autoReview:!0,onReviewExit:()=>{d.unmount(),u(0)},onCtrlC:()=>{d.unmount(),u(f.pending()?3:0)}})),{exitOnCtrlC:!1})})}async function Jn(e,n,t,r,i){let{dir:o}=e,s=ie(o,n);if("error"in s)return $(r,s.error),2;let{plan:c,path:p}=s,v=t==="override"||t==="ci";if(n===void 0&&t==="interactive"&&r.isTTY&&!await r.confirm(`apply plan ${W(p)} for ${c.source_id} (created ${c.created})?`))return r.out(`not applying ${W(p)}`),0;let f=i.runDesignForUc??Pe,u=i.runDesignForUc??null,d=i.sessionScript,h=(a,_)=>Y(p,a,_),k=(a,_)=>oe(p,a,_),m=Z(o);if(m===c.head_pin){if(t==="agent"||r.machine){let _=i.emitEvent??(()=>{});return ne(e,Q(c),p,f,_,r,A(t),h,c.archive_state)}let a=Re(c);if(t==="ci"&&a.length>0)return $(r,G(a.length)),2;if(r.out(`applying stored plan ${W(p)} for ${c.source_id} (${c.rows.length} row(s))`),!v)for(let _ of be({source_id:c.source_id,head:{status:"stored plan"},rows:c.rows,archive:(c.changeset??[]).filter(w=>w.kind==="ARCHIVE"),changed:!1,held:!!c.held},process.stdout.columns))r.out(_);return K(e,c.rows,v,r,f,h,c.changeset??[],A(t),c.held,c.archive_state,k,u,d,c.source_id,q(c.backing_path??c.remote_url,c.source_id,c.plugin_ref!==void 0))}let b=In(o,c);if(b!==null)return $(r,b),2;if(r.out(`graph moved since this plan (${M(c.head_pin)} \u2192 ${M(m)}) \u2014 recomputing`),c.held)return On(e,c,r,i,t,f,!1);let g=bn(c);if(g===null)return $(r,`stored plan for ${c.source_id} names no backing file or URL \u2014 re-run reconcile --from`),2;let R=Pn(o,c,g,i);if(R!==null)return $(r,R),2;let E=await Ue(e,c.source_id,g,r,i,!1,t==="interactive");if(E===le)return 2;if(!E)return 1;if(!E.changed)return te(r,E,null,!1,i.emitEvent),0;if(t==="agent"||r.machine){let a=i.emitEvent??(()=>{});return ne(e,E,null,f,a,r,A(t))}let x=E.changeset.filter(a=>a.kind==="ARCHIVE");return t==="ci"&&x.length>0?($(r,G(x.length)),2):K(e,E.rows,v,r,f,void 0,E.changeset,A(t),E.held,void 0,void 0,u,d,E.source_id,q(Bn(g),E.source_id,"pluginRef"in g))}function Q(e,n=!1){return{source_id:e.source_id,changed:!0,head:{status:"unchanged",before:e.head_pin,after:e.head_pin},note:e.note,skipped_arms:e.skipped_arms,changeset:e.changeset??[],rows:n?e.rows.filter(t=>t.applied===void 0):e.rows,...e.held?{held:e.held}:{}}}async function zn(e,n,t,r,i,o,s){let{dir:c}=e,p=r.runDesignForUc??null,v=r.sessionScript,f=cn(c,n);if(f===null)return null;if("error"in f)return $(t,f.error),2;let{plan:u,path:d}=f,h=u.rows.filter(g=>g.applied===void 0),k=Re(u),m=r.emitEvent??(()=>{});if(h.length===0&&k.length===0){t.out(`already reconciled \u2014 plan ${u.created} applied ${u.rows.length} row(s)`);let g=ln(U(c)).staleCount;return g>0&&(t.out(`${g} item(s) still stale \u2014 kane-cli maintain evolve --from-stale`),m({type:"stale_debt",count:g})),(i==="agent"||t.machine)&&(J(m,Q(u),d),m({...ee})),0}let b=Z(c);if(b!==u.head_pin){let g=In(c,u);if(g!==null){let R=sn(c,d);return t.out(`${g.replace(/^PLUGIN_VERSION_MOVED: /,"").replace(/ — .*$/,"")} \u2014 set aside (${R}); re-extracting ${u.source_id} at its current version`),m({type:"plan_set_aside",source_id:u.source_id,plan_path:R,code:"PLUGIN_VERSION_MOVED"}),xn}return t.out(`plan ${u.created} superseded \u2014 graph moved (${M(u.head_pin)} \u2192 ${M(b)}); recomputing`),On(e,u,t,r,i,o,s)}return t.out(`resuming plan ${u.created} \u2014 ${h.length} pending row(s)${k.length>0?`, ${k.length} undecided archive item(s)`:""}`),s?(te(t,Q(u),null,!1,r.emitEvent),t.out(`plan stored: ${d}`),(i==="agent"||t.machine)&&(J(m,Q(u),d),m({...ee})),0):i==="agent"||t.machine?ne(e,Q(u),d,o,m,t,A(i),(g,R)=>Y(d,g,R),u.archive_state):i==="ci"&&k.length>0?($(t,G(k.length)),2):K(e,u.rows,i==="override"||i==="ci",t,o,(g,R)=>Y(d,g,R),u.changeset??[],A(i),u.held,u.archive_state,(g,R)=>oe(d,g,R),p,v,u.source_id,q(u.backing_path??u.remote_url,u.source_id,u.plugin_ref!==void 0))}async function On(e,n,t,r,i,o,s){let{dir:c,store:p}=e,v=r.runDesignForUc??null,f=r.sessionScript,u;if(n.held){let w=U(c),O=new Set(n.rows.filter(l=>l.held_ref!==void 0&&l.applied!==void 0).map(l=>l.held_ref)),S=[];for(let l of n.held.rows){if(O.has(l.temp_ref))continue;if(!l.matched_cid){S.push(l);continue}let I=w.tipOf(l.matched_cid);if(w.superseded.get(I)===null){t.out(`dropped held "${l.title}" \u2014 its use-case was retired meanwhile`),r.emitEvent?.({type:"held_dropped",ref:l.temp_ref,title:l.title,reason:"target_retired"});continue}S.push(I===l.matched_cid?l:{...l,matched_cid:I,uc:{...l.uc,matches_existing:{cid:I}}})}u={source_id:n.held.source_id,...n.plugin_ref!==void 0&&n.held.staged_source_cid!==void 0?{staged_source_cid:n.held.staged_source_cid}:{},rows:S}}let d=bn(n);if(d===null)return $(t,`stored plan for ${n.source_id} names no backing file or URL \u2014 re-run reconcile --from`),2;let h=Pn(c,n,d,r);if(h!==null)return $(t,h),2;let k=r.seams??{reingest:Me(e,d,t,r),reextract:Se(p,{credentials:B,onIngestRefusal:j,stage:u!==void 0,hostOut:w=>t.out(w),hostEmit:w=>{w.type!=="run_start"&&r.emitEvent?.(w)},...r.emitEvent?{}:{hostProgress:w=>process.stderr.write(w+`
|
|
4
|
+
`)}})},m;try{m=await(r.buildPlan??Ee)(p,n.source_id,k,{resumeHeld:u})}catch(w){return $(t,`reconcile failed: ${w instanceof Error?w.message:String(w)}`),1}if(i==="interactive"&&!s)for(let w of En(m,null))t.out(w);else te(t,m,null,!1,r.emitEvent);let b=Z(c),g=null;if(b!=null){let w={},O=new Set(m.changeset.filter(S=>S.kind==="ARCHIVE").map(S=>S.ref));for(let[S,l]of Object.entries(n.archive_state??{}))O.has(S)&&(w[S]=l);g=ve(c,{version:2,source_id:m.source_id,...Sn(d),head_pin:b,created:new Date().toISOString().replace(/[:.]/g,"-"),skipped_arms:m.skipped_arms,note:m.note,changeset:m.changeset,rows:m.rows,...m.held?{held:m.held}:{},...Object.keys(w).length>0?{archive_state:w}:{}}),t.out(`plan stored: ${g}`)}if(s){if(i==="agent"||t.machine){let w=r.emitEvent??(()=>{});J(w,m,g),w({...ee})}return 0}let R=r.emitEvent??(()=>{}),E=g?ie(c,g).plan.archive_state:void 0,x=g?(w,O)=>Y(g,w,O):void 0,a=g?(w,O)=>oe(g,w,O):void 0;if(i==="agent"||t.machine)return ne(e,m,g,o,R,t,A(i),x,E);let _=m.changeset.filter(w=>w.kind==="ARCHIVE"&&E?.[w.ref]===void 0);return i==="ci"&&_.length>0?($(t,G(_.length)),2):K(e,m.rows,i==="override"||i==="ci",t,o,x,m.changeset,A(i),m.held,E,a,v,f,m.source_id,q(n.backing_path??n.remote_url,m.source_id,n.plugin_ref!==void 0))}async function hn(e,n,t={},r=process.cwd()){let{telemetryBootstrap:i,telemetryEnvName:o}=await import("./bootstrap-A2O4UZUJ.js"),s=i({verb:"reconcile",mode:typeof e.mode=="string"?e.mode:"interactive",contextRoot:L(r,".context"),env:o(),applyPlanPath:typeof e.apply=="string"?L(r,e.apply):void 0,write:!0,longSession:!0});X=s,Ie=0,xe=0,Oe.clear(),(e.mode==="agent"||n.machine)&&t.emitEvent?.({type:"run_start",session:s.ids.session_id});{let v=ue(L(r,".context"))?qe(L(r,".context")):null;if(v)return e.mode==="agent"||n.machine?t.emitEvent?.(ge(v)):($(n,v.text),(n.err??n.out)(`next: ${v.remedy}`)),await s.end({exit_code:2}),2}let c=await Ye(L(r,".context"));c&&(e.mode==="agent"||n.machine?t.emitEvent?.(Ke(c)):(n.err??n.out)(c.text));let p=await Zn(e,n,t,r);return p===1&&e.mode!=="agent"&&(n.err??n.out)(s.supportFooter()),await s.end({exit_code:p}),p}async function Zn(e,n,t={},r=process.cwd()){let i=e.apply!==void 0&&e.apply!==!1,o=typeof e.apply=="string"?e.apply:void 0;if(e.plan&&i)return $(n,"pass --plan OR --apply, not both"),2;let s=e.from!==void 0||!i,c=e.from!==void 0&&re(e.from),p=e.from!==void 0&&!c&&ce(e.from)&&!F(L(r,e.from))&&V(t).route(e.from,F)!==null,v=e.from===void 0&&e.sourceId!==void 0&&!i&&Vn(r,e.sourceId);if(s&&!v&&(!e.from||!e.sourceId&&!c&&!p))return $(n,yn),2;if(e.from&&o!==void 0)return $(n,"pass --from OR --apply <path>, not both \u2014 a stored plan names its own source"),2;let f=We(r,n);if(!f)return 2;let u=N(f),d={dir:f,store:u};if(e.mode!==void 0&&!Rn.has(e.mode))return pn(`--mode must be interactive | agent | ci | override, got '${e.mode}'`);let h=e.mode==="agent"||e.mode==="ci"||e.mode==="override";if(i&&!h&&!n.isTTY)return $(n,"refusing to apply without a TTY to confirm \u2014 pass --mode override|ci"),2;let k=!e.plan,m="override";if(e.from||v){let y=Fn(e,n.isTTY);if(typeof y=="object")return y.code==="MODE_USAGE"?pn(y.error):($(n,y.error),2);m=y}let b=m==="override"||m==="ci";if(i&&!e.from){let{makeReconcileDeps:y}=await import("./reconcile-deps-TILDRCHG.js"),P=o===void 0?y({credentials:B,onIngestRefusal:j,store:u,emitWalkSignal:(D,z,de)=>T(f,D,z,de)}).pending():null;if(P?.kind==="cards"){let D=e.mode??"interactive";return!n.isTTY||D!=="interactive"?($(n,`a held changeset for ${P.source} awaits review (${P.count} change(s)) \u2014 resume in a terminal: kane-cli maintain reconcile --apply [HELD_REVIEW]`),2):(t.cardApplyMount??qn)(f)}let C=e.mode??"interactive";return Jn(d,o===void 0?void 0:L(r,o),C,n,t)}let g=v?Nn(f,e.sourceId,V(t)):(p?await Ln(f,e.from,e.sourceId,V(t)):null)??Hn(f,r,e.from,e.sourceId,V(t));if("error"in g)return $(n,g.error),2;let R=y=>y.corrupt>0?($(n,`cannot verify review holds \u2014 ${y.corrupt} session file(s) unreadable; inspect with kane-cli context sessions list, clean with kane-cli context sessions clean, then retry [SESSIONS_UNREADABLE]`),2):y.holders.length>0?($(n,`session ${y.holders[0]} holds item(s) for review pinned to ${g.sourceId} \u2014 finish that review first: kane-cli context extract --resume ${y.holders[0]} [SOURCE_HELD]`),2):null;if(!i){let y=R(ke(u,g.sourceId));if(y!==null)return y}if(m==="interactive"&&!e.plan&&!i){let y=t.seams?.reingest??Me(d,g,n,t),P;try{P=await un(u,{sourceId:g.sourceId,reingest:y})}catch(D){return $(n,D instanceof Error?D.message:String(D)),D instanceof Error&&D.message.startsWith("SOURCE_ID_OWNED: ")?2:1}if(P.kind==="held"||P.kind==="unverifiable")return R(P.kind==="held"?{holders:P.holders,corrupt:0}:{holders:[],corrupt:P.corrupt})??2;let C=P.kind==="landed"?P.changeContext:null;if(P.kind==="first")return n.out(`${g.sourceId} landed for the first time \u2014 extract it: kane-cli context extract --source ${g.sourceId}`),0;if(P.kind==="unreadable")return $(n,`${g.sourceId} landed, but its version ${P.version} cannot be read \u2014 no change to review; check the store: kane-cli context fsck`),1;if(C){let z=await(t.chatMount??(async de=>{let{bindExtractInteractive:Dn}=await import("./extract-bind-UTERWZMW.js");return Dn(de)}))({mode:"interactive",posture:"reconcile",source:g.sourceId,changeContext:C});return z===3&&ke(u,g.sourceId).holders.length===0?0:z}}let E="pluginRef"in g?{pluginRef:g.pluginRef}:"remoteUrl"in g?{remoteUrl:g.remoteUrl}:{filePath:g.filePath},x=await Ue(d,g.sourceId,E,n,t,!!e.plan||m==="interactive",m==="interactive"&&!e.plan);if(x===le)return 2;if(!x)return 1;let a=x,_=t.runDesignForUc??Pe,w=t.runDesignForUc??null,O=t.sessionScript;if(!a.changed){let y=await zn(d,g.sourceId,n,t,m,_,!!e.plan);if(y===xn){let P=await Ue(d,g.sourceId,E,n,t,!!e.plan||m==="interactive",m==="interactive"&&!e.plan,!0);if(P===le)return 2;if(!P)return 1;a=P}else if(y!==null)return y}if(!a.changed){if(te(n,a,null,!1,t.emitEvent),m==="agent"||n.machine){let y=t.emitEvent??(()=>{});J(y,a,null),y({...ee})}return 0}let S=Z(f),l=null;if(S!=null?l=ve(f,{version:2,source_id:a.source_id,...Sn(E),head_pin:S,created:new Date().toISOString().replace(/[:.]/g,"-"),skipped_arms:a.skipped_arms,note:a.note,changeset:a.changeset,rows:a.rows,...a.held?{held:a.held}:{}}):$(n,"no chain head after extract \u2014 plan not stored"),m==="agent"||n.machine){let y=t.emitEvent??(()=>{});if(!k)return J(y,a,l),y({...ee}),0;let P=l?(C,D)=>Y(l,C,D):void 0;return ne(d,a,l,_,y,n,A(m),P)}if(!k)return l&&n.out(`plan stored: ${l}`),0;let I=a.changeset.filter(y=>y.kind==="ARCHIVE");if(m==="ci"&&I.length>0)return l&&n.out(`plan stored: ${l}`),$(n,G(I.length)),2;if(l){n.out(`plan stored: ${l}`);let y=l;return K(d,Qn(f,y)??a.rows,b,n,_,(P,C)=>Y(y,P,C),a.changeset,A(m),a.held,void 0,void 0,w,O,a.source_id,q(e.from,a.source_id,"pluginRef"in g))}return K(d,a.rows,b,n,_,void 0,a.changeset,A(m),a.held,void 0,void 0,w,O,a.source_id,q(e.from,a.source_id,"pluginRef"in g))}function Qn(e,n){let t=ie(e,n);return"error"in t?null:t.plan.rows}async function Mt(e,n={},t,r=process.cwd()){if(e.json&&e.mode!=="override"&&e.mode!=="ci"){let o=e.mode==="agent"?"--mode agent writes NDJSON already":"it needs --mode override or --mode ci";return(t?.stderr??(s=>{process.stderr.write(s)}))(`reconcile: --json ${o}
|
|
5
|
+
`),2}if(!t&&r===process.cwd()){let{remoteEntry:o}=await import("./remote-entry-6LQRYR5F.js"),s=await o("maintain reconcile",e.mode==="agent"||e.json===!0);if(s!==null){if("exit"in s)return s.exit;let{remoteReconcile:c}=await import("./reconcile-remote-JMV26DLX.js");return c({choice:s.choice,opts:e})}}let i=e.json===!0;if(e.mode==="agent"||i){let{makeHeadlessIO:o}=await import("./headless-io-FFM5T6KL.js"),s=t?o("ndjson","reconcile",t):o("ndjson","reconcile"),c={...i?{machine:!0}:{},out:s.out,err:k=>s.event({type:"error",message:k}),isTTY:!1,confirm:async()=>!1,ask:async()=>""},{runWithChannel:p}=await import("./run-channel-IIIYXOIW.js"),v=2,f=fe(r),u=i&&ue(f)?rn(N(f)):null,d=null,h=k=>{let m=k.source_id;k.type==="reconcile_plan"&&typeof m=="string"&&(d=m),s.event(k)};try{v=await p({event:h},()=>hn(e,c,{...n,emitEvent:h},r)),u!==null&&d!==null&&s.event({type:"reconcile_use_cases",source_id:d,use_cases:on(N(f),d,u)})}catch(k){k instanceof Ve?(v=2,s.event(ge({code:k.code,text:k.message,remedy:k.remedy}))):(v=1,s.event({type:"error",message:k instanceof Error?k.message:String(k)}))}return s.done(v)}return hn(e,Ge(),n,r)}export{A as childModeFor,T as emitWalkSignal,Ln as pluginRefInputs,Mt as reconcileCommand,Fn as resolveReconcileMode,hn as runReconcileCommand,Nn as sourceIdInputs,Hn as validateReconcileInputs,Gn as walkSignal};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Y,c as O,e as H,f as _,g as W}from"./chunk-
|
|
2
|
+
import{a as Y,c as O,e as H,f as _,g as W}from"./chunk-YF22VTR5.js";import{f as $,k as F}from"./chunk-NZ7UCAN6.js";import"./chunk-6PZ3SVWE.js";import{b as L}from"./chunk-PKXWYYVK.js";import"./chunk-FOURJ24E.js";import{k as j}from"./chunk-AXOSLGQ4.js";import"./chunk-QLGQDNA3.js";import{e as T}from"./chunk-IT6M7OMG.js";import"./chunk-RM5ZVDVR.js";import"./chunk-73Y6T2UK.js";import{d as x,e as I,i as A}from"./chunk-XMPTFXPW.js";import"./chunk-HIUAUZNL.js";import{h as U}from"./chunk-CVVUBCB7.js";import"./chunk-JZ7GFPKZ.js";import"./chunk-77BZTEHJ.js";import"./chunk-3A4KK22B.js";import"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import{a as w}from"./chunk-6KUUSONE.js";import"./chunk-LZPYIFHZ.js";import{h as N}from"./chunk-GRQKMOKE.js";import{k as M}from"./chunk-3CFAE36M.js";import"./chunk-GBQ4K25P.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-C3DMMAFP.js";import"./chunk-AQ2OG2EF.js";import{j as E}from"./chunk-REKHAN53.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-TD6GCEIK.js";import"./chunk-5ORBAYTU.js";import"./chunk-XRJH4UF3.js";import"./chunk-PVN64537.js";import{B as P,Ha as u,f as D,w as C}from"./chunk-RHQLDNZL.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import{a as S}from"./chunk-4C7WVQOD.js";import"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-QXQ7KVEN.js";import"./chunk-R6S4EJ5R.js";import"./chunk-BZEW7CSM.js";import"./chunk-QSCXXNC2.js";import"./chunk-UV7FPIBL.js";import"./chunk-CBEMXSWF.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-XTQUCCJH.js";import"./chunk-4QTH7VYE.js";import"./chunk-V24LUINK.js";import"./chunk-JYH7CTF7.js";import"./chunk-BRWCWZE3.js";import"./chunk-WTMCDYR3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-FOJHSG5M.js";import"./chunk-UR6MHSHU.js";var Q=["interactive","agent","ci","override"];async function me(e){try{return await V(e)}finally{await C()}}async function V(e){let{opts:t}=e,a=t.mode==="agent",l=t.mode==="override",p=a||l&&t.json===!0,y=e.testing?.agentLines?{stdout:e.testing.agentLines,stderr:()=>{}}:void 0,f=a||l?E(I(p?"ndjson":"human","reconcile",y),{atQuestionsOnly:!0}):null,g=!a&&!l&&(e.testing?.terminal??x()),d=!1,o=(n,s=2)=>f&&p?(f.event({type:"error",code:n.code,message:n.message,...P(n)}),f.done(s,"refused")):(d&&process.stdout.write(`
|
|
3
3
|
`),j(n),process.stdout.write(`
|
|
4
4
|
`),s);if(t.mode!==void 0&&!Q.includes(t.mode)){let n=I("ndjson","reconcile",y);return n.event({type:"error",code:"MODE_USAGE",message:`--mode must be interactive | agent | ci | override, got '${t.mode}'`}),n.done(2,"refused")}if(t.plan)return o(u.optionNotYet("--plan"));if(t.apply!==void 0&&t.apply!==!1)return o(u.optionNotYet("--apply"));if(t.mode==="ci")return o(u.optionNotYet(`--mode ${t.mode}`));if(t.mode==="interactive"&&!g)return process.stderr.write(`reconcile: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
5
5
|
`),2;if(!t.sourceId)return o(u.reconcileNeeds(e.choice.projectName,a));let i=t.sourceId,r=null,m="";if(t.from){let n=N().route(t.from,w);if(n!==null){let s=w(t.from),c=await O(t.from,n,s?i:void 0);if("refusal"in c)return o(c.refusal,c.exit);if(c.item.sourceId!==i)return o(u.reconcileRefOtherId(i,n.plugin.manifest.id,t.from,c.item.sourceId));r=c.item}else{if(Y(t.from)){let c=M(t.from);return o(u.reviewOnlyFiles(t.from,a,c?U(c.name,t.from,i):void 0))}let s=W(t.from);if(!s.ok)return o(s.refusal);r={kind:"file",path:t.from,node:"",file:s.file,bytes:s.bytes,sourceId:i,limit:s.limit},m=s.supported}}let b;try{b=e.testing?.basicAuth??await T()}catch(n){if(!(n instanceof A))throw n;return o({code:n.code,message:n.message,...n.remedy?{remedy:n.remedy}:{}})}let k=D({url:e.choice.latticeUrl,basicAuth:b,...e.testing?.run?.fetch?{fetch:e.testing.run.fetch}:{}}),B=e.choice.projectId;g&&e.choice.projectName&&(process.stdout.write(`using project "${e.choice.projectName}", shared with your team
|
|
6
|
-
`),d=!0);let R;try{R=await k.sources(B)}catch(n){if(n instanceof S&&n.code==="NOT_FOUND")R=[];else{let{exit:s,...c}=L(n,e.choice,null);return o(c,s)}}let h=R.find(n=>n.sourceId===i);if(h===void 0||h.head===null){let n=r?.kind==="file"?r.file:i;return o(u.reconcileSourceMissing({source:i,file:n,path:t.from??i,project:e.choice.projectName,removed:h!==void 0,agent:a}))}if(r===null){let n=h.media?.format==="plugin"?h.media.plugin:void 0;if(n===void 0||typeof n.id!="string")return o(u.reconcileNeeds(e.choice.projectName,a));let s=n.fetch?.ref;if(typeof s!="string")return o(u.reconcileOriginUnknown(i,a));let c=N().route(s,w);if(c===null||c.plugin.manifest.id!==n.id)return o(u.reconcileRefUnrouted(i,n.id,s,c===null?null:c.plugin.manifest.id));let v=await O(s,c,i);if("refusal"in v)return o(v.refusal,v.exit);r=v.item}return q({choice:e.choice,person:k,basicAuth:b,item:r,supported:m,mode:a?"agent":l?"override":g?"interactive":"ci",io:f,refuse:o,projectLine:d,nothing:u.nothingToReview,...e.testing?{testing:e.testing}:{}})}async function q(e){let{mode:t,io:a,item:l}=e,p=l.sourceId,y=e.choice.projectId,{step:f,ended:g}=H({person:e.person,choice:e.choice,item:l,first:!1,then:t==="ci"?"pause":"review",...e.as!==void 0?{as:e.as}:{},supported:e.supported,retryMs:e.testing?.run?.retryDeadlineMs??12e4,remoteDeps:_(e.testing?.remoteDeps),...e.testing?{testing:e.testing}:{}}),d=e.testing?.remoteDeps?{...e.testing.run,remoteDeps:e.testing.remoteDeps}:e.testing?.run,o={verb:"reconcile",choice:e.choice,start:{kind:"new",body:{projectId:y,verb:"reconcile",mode:t==="interactive"?"interactive":"agent",sourceId:p}},run:{source:p,...t==="override"?{override:!0}:{}}},i;if(t==="interactive"){let{runInteractiveRemote:m}=await import("./interactive-remote-
|
|
6
|
+
`),d=!0);let R;try{R=await k.sources(B)}catch(n){if(n instanceof S&&n.code==="NOT_FOUND")R=[];else{let{exit:s,...c}=L(n,e.choice,null);return o(c,s)}}let h=R.find(n=>n.sourceId===i);if(h===void 0||h.head===null){let n=r?.kind==="file"?r.file:i;return o(u.reconcileSourceMissing({source:i,file:n,path:t.from??i,project:e.choice.projectName,removed:h!==void 0,agent:a}))}if(r===null){let n=h.media?.format==="plugin"?h.media.plugin:void 0;if(n===void 0||typeof n.id!="string")return o(u.reconcileNeeds(e.choice.projectName,a));let s=n.fetch?.ref;if(typeof s!="string")return o(u.reconcileOriginUnknown(i,a));let c=N().route(s,w);if(c===null||c.plugin.manifest.id!==n.id)return o(u.reconcileRefUnrouted(i,n.id,s,c===null?null:c.plugin.manifest.id));let v=await O(s,c,i);if("refusal"in v)return o(v.refusal,v.exit);r=v.item}return q({choice:e.choice,person:k,basicAuth:b,item:r,supported:m,mode:a?"agent":l?"override":g?"interactive":"ci",io:f,refuse:o,projectLine:d,nothing:u.nothingToReview,...e.testing?{testing:e.testing}:{}})}async function q(e){let{mode:t,io:a,item:l}=e,p=l.sourceId,y=e.choice.projectId,{step:f,ended:g}=H({person:e.person,choice:e.choice,item:l,first:!1,then:t==="ci"?"pause":"review",...e.as!==void 0?{as:e.as}:{},supported:e.supported,retryMs:e.testing?.run?.retryDeadlineMs??12e4,remoteDeps:_(e.testing?.remoteDeps),...e.testing?{testing:e.testing}:{}}),d=e.testing?.remoteDeps?{...e.testing.run,remoteDeps:e.testing.remoteDeps}:e.testing?.run,o={verb:"reconcile",choice:e.choice,start:{kind:"new",body:{projectId:y,verb:"reconcile",mode:t==="interactive"?"interactive":"agent",sourceId:p}},run:{source:p,...t==="override"?{override:!0}:{}}},i;if(t==="interactive"){let{runInteractiveRemote:m}=await import("./interactive-remote-SGM76D6M.js");i=await m({...o,subject:p,ingest:[f],testing:{basicAuth:e.basicAuth,...e.testing?.check?{check:e.testing.check}:{},...d?{run:d}:{},...e.testing?.mount?{mount:e.testing.mount}:{},...e.testing?.onController?{onController:e.testing.onController}:{}}})}else i=await F({...o,mode:"agent",basicAuth:e.basicAuth,io:a,check:e.testing?.check??$,onProgress:()=>{},ingest:[f],signals:!0,onRefusal:m=>{j(m),process.stdout.write(`
|
|
7
7
|
`)},...d?{testing:d}:{}});let r=g();if(r.refused!==null)return e.refuse(r.refused.refusal,r.refused.exit);if(r.added==="unchanged"&&r.behind===0&&!r.unread)return a?a.done(i):(process.stdout.write(`${e.projectLine?`
|
|
8
8
|
`:""}${e.nothing(r.name,e.choice.projectName)}
|
|
9
9
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as s}from"./chunk-3MSXQU2C.js";import{f as a}from"./chunk-
|
|
2
|
+
import{a as s}from"./chunk-3MSXQU2C.js";import{f as a}from"./chunk-TC2PHBPH.js";import"./chunk-CCOD4GQJ.js";import"./chunk-QSCXXNC2.js";import"./chunk-BRWCWZE3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-UR6MHSHU.js";function m(t){let n=t.sessionName!==null,e={type:"recording_state",enabled:!0,session_id:t.sessionId,persist:n};return t.sessionName&&(e.session_name=t.sessionName),t.testPath&&(e.test_path=t.testPath),t.outputPath&&(e.output_path=t.outputPath),e}async function h(t){if(t.isAgent){a(m(t));return}let n=(await import("./react-QWOAB3TB.js")).default,{render:e,useApp:o}=await import("./build-5ZN47FAT.js"),{useEffect:r}=n,{InfoBox:u}=await import("./InfoBox-SRQ4TSUT.js"),l=t.sessionName?[{label:"session",value:t.sessionName},{label:"test",value:s(t.testPath??"")},{label:"output",value:s(t.outputPath??"")}]:[{label:"session",value:"ephemeral"},{label:"note",value:"use /name <name> to persist this session"}];function c(){let{exit:i}=o();return r(()=>{let p=setTimeout(()=>i(),50);return()=>clearTimeout(p)},[i]),n.createElement(u,{title:"Recording",titleColor:"#ff9500",rows:l})}await e(n.createElement(c),{stdout:process.stderr}).waitUntilExit()}export{m as buildRecordingStateEvent,h as printRecordingBanner};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as a,c as b,d as c,e as d,f as e}from"./chunk-
|
|
2
|
+
import{b as a,c as b,d as c,e as d,f as e}from"./chunk-QWEQ742S.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-VKIUHHNT.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-GMTHZUZ3.js";import"./chunk-BRWCWZE3.js";import"./chunk-RZ4F3BHX.js";import"./chunk-UR6MHSHU.js";export{d as discoverAll,a as knownPlatforms,c as providerFor,b as registeredPlatforms,e as resolveTarget};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e}from"./chunk-PKXWYYVK.js";import"./chunk-FOURJ24E.js";import"./chunk-AXOSLGQ4.js";import"./chunk-QLGQDNA3.js";import"./chunk-IT6M7OMG.js";import"./chunk-RM5ZVDVR.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-REKHAN53.js";import"./chunk-XRJH4UF3.js";import"./chunk-PVN64537.js";import"./chunk-RHQLDNZL.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-4C7WVQOD.js";import"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-QXQ7KVEN.js";import"./chunk-R6S4EJ5R.js";import"./chunk-BZEW7CSM.js";import"./chunk-QSCXXNC2.js";import"./chunk-UV7FPIBL.js";import"./chunk-CBEMXSWF.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-XTQUCCJH.js";import"./chunk-4QTH7VYE.js";import"./chunk-V24LUINK.js";import"./chunk-JYH7CTF7.js";import"./chunk-BRWCWZE3.js";import"./chunk-WTMCDYR3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-FOJHSG5M.js";import"./chunk-UR6MHSHU.js";export{c as endedRefusal,b as openFailure,e as remoteChoiceForResume,d as remoteEntry,a as remoteRefusal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{k as i}from"./chunk-
|
|
2
|
+
import{k as i}from"./chunk-AXOSLGQ4.js";import"./chunk-RM5ZVDVR.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-REKHAN53.js";import{Ha as t}from"./chunk-RHQLDNZL.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-4C7WVQOD.js";import"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-QXQ7KVEN.js";import"./chunk-R6S4EJ5R.js";import"./chunk-BZEW7CSM.js";import"./chunk-QSCXXNC2.js";import"./chunk-UV7FPIBL.js";import"./chunk-CBEMXSWF.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-XTQUCCJH.js";import"./chunk-V24LUINK.js";import"./chunk-JYH7CTF7.js";import"./chunk-BRWCWZE3.js";import"./chunk-WTMCDYR3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-FOJHSG5M.js";import"./chunk-UR6MHSHU.js";function d(r,e,n){return e==="agent"?"agent":e==="override"?"override":!e&&!process.stdin.isTTY?(process.stderr.write(`${r}: no TTY \u2014 pass an explicit --mode agent|ci|override to run headless
|
|
3
3
|
`),{exit:2}):e==="ci"?(i(t.notYet(`${n} --mode ${e}`)),{exit:2}):!process.stdin.isTTY||!process.stdout.isTTY?(process.stderr.write(`${r}: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
4
4
|
`),{exit:2}):"interactive"}export{d as remoteMode};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{$ as A,Aa as $,B as a,Ba as aa,C as b,Ca as ba,D as c,Da as ca,E as d,Ea as da,F as e,Fa as ea,G as f,Ga as fa,H as g,Ha as ga,I as h,J as i,K as j,L as k,M as l,N as m,O as n,P as o,Q as p,R as q,S as r,T as s,U as t,V as u,W as v,X as w,Y as x,Z as y,_ as z,aa as B,ba as C,ca as D,da as E,ea as F,fa as G,ga as H,ha as I,ia as J,ja as K,ka as L,la as M,ma as N,na as O,oa as P,pa as Q,qa as R,ra as S,sa as T,ta as U,ua as V,va as W,wa as X,xa as Y,ya as Z,za as _}from"./chunk-
|
|
2
|
+
import{$ as A,Aa as $,B as a,Ba as aa,C as b,Ca as ba,D as c,Da as ca,E as d,Ea as da,F as e,Fa as ea,G as f,Ga as fa,H as g,Ha as ga,I as h,J as i,K as j,L as k,M as l,N as m,O as n,P as o,Q as p,R as q,S as r,T as s,U as t,V as u,W as v,X as w,Y as x,Z as y,_ as z,aa as B,ba as C,ca as D,da as E,ea as F,fa as G,ga as H,ha as I,ia as J,ja as K,ka as L,la as M,ma as N,na as O,oa as P,pa as Q,qa as R,ra as S,sa as T,ta as U,ua as V,va as W,wa as X,xa as Y,ya as Z,za as _}from"./chunk-RHQLDNZL.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-4C7WVQOD.js";import"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-QXQ7KVEN.js";import"./chunk-R6S4EJ5R.js";import"./chunk-BZEW7CSM.js";import"./chunk-QSCXXNC2.js";import"./chunk-UV7FPIBL.js";import"./chunk-CBEMXSWF.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-XTQUCCJH.js";import"./chunk-BRWCWZE3.js";import"./chunk-WTMCDYR3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-UR6MHSHU.js";export{r as ALREADY_DISCARDED,t as CHAT_ONLY,Y as LIST_STATUS,Z as LIST_UP_TO_DATE,_ as LIST_WHY,ca as RESUME_UNREADABLE,x as SAVE_VERB_KEYS,p as WORK_ONLY,L as addAgain,n as addedCount,I as addsText,a as agentRemedy,h as andList,U as casesThere,A as chatOnly,z as counted,d as designChanged,e as designDoneLine,g as designFinishedLine,ba as designWords,f as designedLine,q as discardDetail,M as documentsToAddAgain,i as doneCounted,j as doneLines,aa as evolveWords,c as heldByEvent,b as heldByOf,y as heldChangesOf,D as heldChangesShort,E as heldChangesText,O as itsText,W as joinedNext,$ as projectNamed,fa as pulledLines,Q as remoteResume,v as repinsOf,u as replacedCounts,C as saveCountsOf,H as saveRows,l as savedLines,s as savedResult,F as savesSomething,k as savingLines,o as sharesItems,ea as shellWord,K as startAgainNext,R as testFileOf,X as testFilesField,V as testFilesWords,T as testManagerField,S as testManagerWords,da as unreadableLine,m as updatedCount,N as uploadedFiles,w as withKeeps,P as withoutVersions,ga as words,B as workOnly,G as worthSaving,J as yoursText};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk-
|
|
2
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk-642GD7E6.js";import"./chunk-VE3SUJMA.js";import"./chunk-SB26HQO7.js";import"./chunk-3G2LSTK5.js";import"./chunk-4QTH7VYE.js";import"./chunk-V24LUINK.js";import"./chunk-JYH7CTF7.js";import"./chunk-BRWCWZE3.js";import"./chunk-RZ4F3BHX.js";import"./chunk-UR6MHSHU.js";export{d as buildAutoDefaultAnnouncement,f as buildAutoDefaultedEvent,e as buildAutoDefaultedNdjson,c as buildRemediationMessage,b as decideGateAction,a as loadCachedIds,g as requireProjectFolder};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-4DM5EWEV.js";import"./chunk-6WN4WSXR.js";import"./chunk-63BFLTJI.js";import"./chunk-2G7UYQOW.js";import"./chunk-LMOW4NM5.js";import"./chunk-MTMHB5LF.js";import"./chunk-MUL2QFG2.js";import"./chunk-QWEQ742S.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-VKIUHHNT.js";import"./chunk-TZXXJWHA.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-GMTHZUZ3.js";import"./chunk-BRWCWZE3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-UR6MHSHU.js";export{l as CHOOSE_MOBILE_KIND_FIX,m as CHOOSE_MOBILE_KIND_MESSAGE,h as appNotSetEvent,e as appProblemFor,a as appSuitsTarget,b as deviceFromFlags,g as formatRunningOn,i as missingPieceMessage,c as nameNeedsVersionMessage,d as resolveRunIntent,f as resolveTestmdIntent,k as staleAppMessage,j as staleDeviceMessage};
|
|
@@ -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-SDIHDYWT.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-4QTH7VYE.js";import"./chunk-RZ4F3BHX.js";import"./chunk-UR6MHSHU.js";export{a as AuthResolver,b as classifyAuthFailure};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{O as F,R as Q,U as G,V as Y,W as H}from"./chunk-DAV4ONGS.js";import"./chunk-H6QHG62O.js";import"./chunk-ABNQL3PQ.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{a as U}from"./chunk-TCK7WR3M.js";import"./chunk-WMGKUERB.js";import"./chunk-2EKLTUY2.js";import{a as A}from"./chunk-73Y6T2UK.js";import{e as P,h as D}from"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-HCBYKLMW.js";import{b as J}from"./chunk-KM3YCIDV.js";import"./chunk-UVL6XQHU.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-JBUKEIYL.js";import"./chunk-W5EDS4DF.js";import"./chunk-ZCIWQHCO.js";import"./chunk-5ORBAYTU.js";import{M as C,N as V,R as j,S as E,Ua as M,ea as x}from"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-OKCVG7AG.js";import"./chunk-XDAFRUAJ.js";import"./chunk-7V4BQSSV.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-YKOZBFR3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-A7RJQJNT.js";import"./chunk-UR6MHSHU.js";import{readFileSync as W}from"fs";import{existsSync as X}from"fs";var Z=new Set(["derived","skipped","archived","drift"]),N={kind:"human",id:process.env.USER??"operator"};function _(r,t){return r.nameOf.get(t)??t.slice(0,19)}function L(r,t){let d=r.getNode(t)?.content??{},h=r.derivesInto(t)[0]?.props.anchor;return{cid:t,uc:{temp_ref:t,title:String(d.title??d.text??""),summary:d.summary!==void 0?String(d.summary):void 0,risk:String(d.risk??"med"),cite:{anchor:typeof h=="string"?h:"\u2014",quote:""},depends_on_hint:[],matches_existing:null}}}function ee(r,t){let d=new Set,{records:h}=M(r);for(let c of h){if(c.proposal_id==null)continue;let a=new Set(c.review.map(u=>u.id));for(let u of c.nodes)a.has(u.cid)||d.add(u.cid)}for(let c of[...d])(t.trust.get(c)!=="derived"||t.superseded.has(c))&&d.delete(c);return d}var re=new Set(["approved","edited","rejected","skipped","supersede"]);function te(r){let t;try{t=JSON.parse(r)}catch(c){return{errors:[`not valid JSON: ${c instanceof Error?c.message:String(c)}`]}}if(!Array.isArray(t))return{errors:['expected a top-level array of {"ref", "resolution", ...} entries']};let d=[],h=[];return t.forEach((c,a)=>{if(c==null||typeof c!="object"||Array.isArray(c)){d.push(`[${a}]: not an object`);return}let u=c;(typeof u.ref!="string"||!u.ref.trim())&&d.push(`[${a}]: "ref" (slug or cid) is required`),(typeof u.resolution!="string"||!re.has(u.resolution))&&d.push(`[${a}]: "resolution" must be one of approved | edited | rejected | skipped | supersede`),u.resolution==="supersede"&&(typeof u.supersede_target!="string"||!u.supersede_target.trim())&&d.push(`[${a}]: resolution "supersede" requires "supersede_target" (slug or cid)`),u.edit!==void 0&&(u.edit==null||typeof u.edit!="object"||Array.isArray(u.edit))&&d.push(`[${a}]: "edit" must be an object ({title?, summary?, risk?})`),d.length===0&&h.push(u)}),d.length>0?{errors:d}:{entries:h}}async function ne(r,t,d,h=process.cwd()){let c=r.queue??"derived";if(!Z.has(c))return t.out(`unknown queue ${c} \u2014 one of: derived | skipped | archived | drift`),2;if(r.mode!=null&&r.mode!=="agent"&&r.mode!=="ci")return(t.err??t.out)(`error: review --mode must be agent | ci, got '${r.mode}'`),2;r.mode==="agent"&&(r={...r,json:!0});let a=r.json?P("ndjson","review",{stdout:s=>t.out(s.replace(/\n$/,"")),stderr:s=>(t.err??t.out)(s.replace(/\n$/,""))}):null,u;if(a){if(u=A(h),!X(u))return a.event({type:"error",message:"no context store here",remedy:"run kane-cli context ingest <files> first"}),a.done(2,"refused");let s=G(u);if(s)return a.event(Y(s)),a.done(2,"refused")}else{let s=F(h,t);if(!s||(u=s,H(u,t)))return 2}let S=U(u),n=C(S),w=s=>(t.err??t.out)(s);if(r.allowArchive&&!r.because?.trim())return w('error: --allow-archive requires --because "<reason>" (the audit trail on the record)'),2;if(r.mode==="ci"&&r.allowArchive)return w("error: ci mode never archives \u2014 nothing committed"),2;if((r.approve?.length??0)>0||(r.skip?.length??0)>0||(r.defer?.length??0)>0){if(r.verdicts)return w("error: --approve/--skip/--defer and --verdicts are mutually exclusive"),2;let s=new Map,o=r.mode==="agent"?a:null,m=[],p=i=>m.push({line:i,event:{type:"error",message:i}}),g=i=>m.push({line:`${i}: names nothing in the graph`,event:{type:"error",code:"ITEM_NOT_FOUND",message:`there's no item ${i} here, so nothing was approved`,remedy:"check the id, then run the command again"}}),v=[],y=i=>n.displayNameOf(i)??_(n,i);for(let i of r.approve??[]){let $=E(n,i);if($!==null){p($);continue}let e=V(n,j(n,i));if(!e){g(i);continue}s.set(e,{resolution:"approved"}),v.push({ref:y(e),resolution:"approved"})}for(let[i,$]of[[r.skip??[],"skipped"],[r.defer??[],"deferred"]])for(let e of i){let f=E(n,e),l=f===null?n.resolve(j(n,e)):null;f!==null?p(f):l?v.push({ref:y(l.tip),resolution:$}):g(e)}if(m.length>0){if(o){for(let i of m)o.event(i.event);return o.done(2,"refused")}for(let i of m)w(`error: ${i.line}`);return w("error: nothing committed (structured verdicts are atomic \u2014 fix every offender and re-run)"),2}if(s.size===0){if(o){for(let i of v)o.event({type:"review_verdict",...i});return o.done(0)}return t.out("nothing changed \u2014 every ref was skipped/deferred"),0}let b=x({store:S,graph:n,verdicts:s,by:N});if(b.errors){if(o){for(let i of b.errors)J(i.code,i.detail);return o.event({type:"error",code:"REVIEW_FAILED",message:"couldn't save the review, so nothing was approved",remedy:"run the command again"}),o.done(1)}for(let i of b.errors)w(`${i.code}: ${i.detail}`);return 1}if(o){for(let i of v)o.event({type:"review_verdict",...i});return o.done(0)}return t.out(`review: committed record ${b.record.seq} \u2014 ${s.size} approved`),0}if(r.verdicts){let s=e=>(t.err??t.out)(e),o;try{o=W(r.verdicts,"utf8")}catch{return s(`error: cannot read verdicts file ${r.verdicts}`),2}let m=te(o);if("errors"in m){for(let e of m.errors)s(`error: --verdicts ${r.verdicts}: ${e}`);return 2}let p=new Set([...n.trust.entries()].filter(([e,f])=>(f==="derived"||f==="archived")&&!n.superseded.has(e)).map(([e])=>e)),g=new Map,v=[];for(let e of m.entries){let f=E(n,e.ref)??(e.supersede_target?E(n,e.supersede_target):null);if(f!==null){v.push(`${e.ref}: ${f}`);continue}let l=V(n,j(n,e.ref));if(!l){v.push(`${e.ref}: names nothing in the graph`);continue}if(!p.has(l)){v.push(`${e.ref}: not in a review queue (trust: ${n.trust.get(l)??"?"})`);continue}if(g.has(l)){v.push(`${e.ref}: duplicate \u2014 an earlier entry already resolves to this node (${_(n,l)})`);continue}let k=e.supersede_target?V(n,j(n,e.supersede_target)):null;if(e.supersede_target&&!k){v.push(`${e.ref}: supersede_target ${e.supersede_target} names nothing live in the graph`);continue}g.set(l,{resolution:e.resolution,...e.reason?{reason:e.reason}:{},...e.edit?{edit:e.edit}:{},...k?{supersedeTarget:k}:{}})}if(v.length>0){for(let e of v)s(`error: --verdicts: ${e}`);return s("error: nothing committed (the verdicts file is atomic \u2014 fix every offender and re-run)"),2}let y=[...g.entries()].filter(([,e])=>e.resolution==="rejected"||e.resolution==="supersede");if(y.length>0&&r.mode==="ci")return s(`error: ci mode never archives \u2014 ${y.length} retiring verdict(s) (rejected/supersede) present, nothing committed`),2;if(y.length>0&&r.allowArchive){let{archiveImpact:e}=await import("./feeder-VAY4NYBX.js");for(let[f,l]of y){let k=l.resolution==="supersede"?(()=>{let T=l.supersedeTarget?n.resolve(l.supersedeTarget):null;return T&&!n.superseded.has(T.tip)?T.tip:null})():f;if(k===null)continue;let K=e(n,k),B=l.resolution==="supersede"?`supersede (retires ${_(n,k)})`:`archive ${_(n,k)}`;s(`${B}: ${K.design_children} design child(ren) affected`)}for(let[,f]of y)f.reason||(f.reason=r.because)}let b=y.length>0&&!r.allowArchive,i=x({store:S,graph:n,verdicts:g,by:N,...b?{holdArchives:!0}:{}});if(i.errors){if(i.errors[0]?.code==="NO_VERDICTS")return s("nothing changed \u2014 every item was skipped"),0;for(let e of i.errors)s(`${e.code}: ${e.detail}`);return 1}b&&t.out(`${y.length} archive(s) held for interactive confirmation (re-run with --allow-archive --because "<reason>" to apply headlessly)`);let $=new Map;for(let e of g.values())$.set(e.resolution,($.get(e.resolution)??0)+1);if(r.json)for(let[e,f]of g.entries())t.out(JSON.stringify({ref:_(n,e),cid:e,resolution:f.resolution}));else{let e=[...$.entries()].map(([f,l])=>`${l} ${f}`).join(", ");t.out(`review: committed record ${i.record.seq} \u2014 ${e}`)}return 0}if(c==="drift"){let s=n.staleList().filter(({state:o})=>o!=="superseded").map(({cid:o,state:m})=>({ref:_(n,o),cid:o,state:m,title:String(n.getNode(o)?.content.title??n.getNode(o)?.content.source_id??""),pinned_sources:[...new Set(n.derivesInto(o).map(p=>String(p.props.source_id)))]}));if(r.json){for(let o of s)t.out(JSON.stringify(o));return 0}if(s.length===0)return t.out("drift queue is empty \u2014 every node's evidence matches the current source snapshots"),0;t.out(`${s.length} item(s) whose evidence changed (re-extract the source to re-approve):`);for(let o of s)t.out(` [${o.state}] ${o.ref} \xB7 ${o.title} \xB7 sources: ${o.pinned_sources.join(", ")||"\u2014"}`);return 0}if(!t.isTTY)return a?D(a,"review: verdict queues need a terminal","TTY_REQUIRED","run kane-cli context review in a terminal, or pass --verdicts <file.json>; the drift listing works anywhere"):(t.out("review: verdict queues need a TTY (drift listing works anywhere, or pass --verdicts <file.json>)"),2);let R,q;if(c==="archived")R=[...n.trust.entries()].filter(([s,o])=>o==="archived"&&!n.superseded.has(s)).map(([s])=>L(n,s)),q="skipped";else{let s=ee(u,n),o=[...n.trust.entries()].filter(([p,g])=>g==="derived"&&!n.superseded.has(p)).map(([p])=>p),m=c==="skipped"?o.filter(p=>s.has(p)):o;m.sort((p,g)=>Number(s.has(g))-Number(s.has(p))),R=m.map(p=>L(n,p)),q="skipped"}if(R.length===0)return t.out(`${c} queue is empty`),0;t.out(`${R.length} node(s) in the ${c} queue \u2014 approve promotes, reject ${c==="archived"?"re-archives":"archives"}, edit mints a new version, skip leaves it for later`);let z=await d(R,n,q),I=x({store:S,graph:n,verdicts:z,by:N});if(I.errors){if(I.errors[0]?.code==="NO_VERDICTS")return t.out("nothing changed \u2014 every item was skipped"),0;for(let s of I.errors)t.out(`${s.code}: ${s.detail}`);return 1}let O=I.record;return t.out(`committed record ${O.seq}: ${O.review.length} review fact(s), ${O.supersessions.length} supersession(s), ${O.nodes.length} new version(s)`),0}async function se(r,t,d){let[{render:h},c,{ReviewChecklist:a}]=await Promise.all([import("./build-5ZN47FAT.js"),import("./react-QWOAB3TB.js"),import("./ui-SNV3FD2G.js")]),u=c.default??c;return new Promise(S=>{let n=h(u.createElement(a,{items:r.map(w=>({uc:w.uc})),defaultResolution:d,onSubmit:w=>{n.unmount(),S(w)}}))})}async function he(r){let{bothTTY:t}=await import("./headless-io-FFM5T6KL.js");return!r.json&&r.mode!=="agent"&&await Q(A(process.cwd()),d=>process.stderr.write(d+`
|
|
2
|
+
import{O as F,R as Q,U as G,V as Y,W as H}from"./chunk-NNVHWFLI.js";import"./chunk-PZOQ2IQK.js";import"./chunk-FNBHP75S.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import{a as U}from"./chunk-TCK7WR3M.js";import"./chunk-WMGKUERB.js";import"./chunk-2EKLTUY2.js";import{a as A}from"./chunk-73Y6T2UK.js";import{e as P,h as D}from"./chunk-XMPTFXPW.js";import"./chunk-SMXABALN.js";import"./chunk-WN5VKKJ3.js";import"./chunk-HCBYKLMW.js";import{b as J}from"./chunk-KM3YCIDV.js";import"./chunk-UVL6XQHU.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-JBUKEIYL.js";import"./chunk-W5EDS4DF.js";import"./chunk-ZCIWQHCO.js";import"./chunk-5ORBAYTU.js";import{M as C,N as V,R as j,S as E,Ua as M,ea as x}from"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-OKCVG7AG.js";import"./chunk-XDAFRUAJ.js";import"./chunk-7V4BQSSV.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-VZ7KXRXB.js";import"./chunk-BRWCWZE3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-A7RJQJNT.js";import"./chunk-UR6MHSHU.js";import{readFileSync as W}from"fs";import{existsSync as X}from"fs";var Z=new Set(["derived","skipped","archived","drift"]),N={kind:"human",id:process.env.USER??"operator"};function _(r,t){return r.nameOf.get(t)??t.slice(0,19)}function L(r,t){let d=r.getNode(t)?.content??{},h=r.derivesInto(t)[0]?.props.anchor;return{cid:t,uc:{temp_ref:t,title:String(d.title??d.text??""),summary:d.summary!==void 0?String(d.summary):void 0,risk:String(d.risk??"med"),cite:{anchor:typeof h=="string"?h:"\u2014",quote:""},depends_on_hint:[],matches_existing:null}}}function ee(r,t){let d=new Set,{records:h}=M(r);for(let c of h){if(c.proposal_id==null)continue;let a=new Set(c.review.map(u=>u.id));for(let u of c.nodes)a.has(u.cid)||d.add(u.cid)}for(let c of[...d])(t.trust.get(c)!=="derived"||t.superseded.has(c))&&d.delete(c);return d}var re=new Set(["approved","edited","rejected","skipped","supersede"]);function te(r){let t;try{t=JSON.parse(r)}catch(c){return{errors:[`not valid JSON: ${c instanceof Error?c.message:String(c)}`]}}if(!Array.isArray(t))return{errors:['expected a top-level array of {"ref", "resolution", ...} entries']};let d=[],h=[];return t.forEach((c,a)=>{if(c==null||typeof c!="object"||Array.isArray(c)){d.push(`[${a}]: not an object`);return}let u=c;(typeof u.ref!="string"||!u.ref.trim())&&d.push(`[${a}]: "ref" (slug or cid) is required`),(typeof u.resolution!="string"||!re.has(u.resolution))&&d.push(`[${a}]: "resolution" must be one of approved | edited | rejected | skipped | supersede`),u.resolution==="supersede"&&(typeof u.supersede_target!="string"||!u.supersede_target.trim())&&d.push(`[${a}]: resolution "supersede" requires "supersede_target" (slug or cid)`),u.edit!==void 0&&(u.edit==null||typeof u.edit!="object"||Array.isArray(u.edit))&&d.push(`[${a}]: "edit" must be an object ({title?, summary?, risk?})`),d.length===0&&h.push(u)}),d.length>0?{errors:d}:{entries:h}}async function ne(r,t,d,h=process.cwd()){let c=r.queue??"derived";if(!Z.has(c))return t.out(`unknown queue ${c} \u2014 one of: derived | skipped | archived | drift`),2;if(r.mode!=null&&r.mode!=="agent"&&r.mode!=="ci")return(t.err??t.out)(`error: review --mode must be agent | ci, got '${r.mode}'`),2;r.mode==="agent"&&(r={...r,json:!0});let a=r.json?P("ndjson","review",{stdout:s=>t.out(s.replace(/\n$/,"")),stderr:s=>(t.err??t.out)(s.replace(/\n$/,""))}):null,u;if(a){if(u=A(h),!X(u))return a.event({type:"error",message:"no context store here",remedy:"run kane-cli context ingest <files> first"}),a.done(2,"refused");let s=G(u);if(s)return a.event(Y(s)),a.done(2,"refused")}else{let s=F(h,t);if(!s||(u=s,H(u,t)))return 2}let S=U(u),n=C(S),w=s=>(t.err??t.out)(s);if(r.allowArchive&&!r.because?.trim())return w('error: --allow-archive requires --because "<reason>" (the audit trail on the record)'),2;if(r.mode==="ci"&&r.allowArchive)return w("error: ci mode never archives \u2014 nothing committed"),2;if((r.approve?.length??0)>0||(r.skip?.length??0)>0||(r.defer?.length??0)>0){if(r.verdicts)return w("error: --approve/--skip/--defer and --verdicts are mutually exclusive"),2;let s=new Map,o=r.mode==="agent"?a:null,m=[],p=i=>m.push({line:i,event:{type:"error",message:i}}),g=i=>m.push({line:`${i}: names nothing in the graph`,event:{type:"error",code:"ITEM_NOT_FOUND",message:`there's no item ${i} here, so nothing was approved`,remedy:"check the id, then run the command again"}}),v=[],y=i=>n.displayNameOf(i)??_(n,i);for(let i of r.approve??[]){let $=E(n,i);if($!==null){p($);continue}let e=V(n,j(n,i));if(!e){g(i);continue}s.set(e,{resolution:"approved"}),v.push({ref:y(e),resolution:"approved"})}for(let[i,$]of[[r.skip??[],"skipped"],[r.defer??[],"deferred"]])for(let e of i){let f=E(n,e),l=f===null?n.resolve(j(n,e)):null;f!==null?p(f):l?v.push({ref:y(l.tip),resolution:$}):g(e)}if(m.length>0){if(o){for(let i of m)o.event(i.event);return o.done(2,"refused")}for(let i of m)w(`error: ${i.line}`);return w("error: nothing committed (structured verdicts are atomic \u2014 fix every offender and re-run)"),2}if(s.size===0){if(o){for(let i of v)o.event({type:"review_verdict",...i});return o.done(0)}return t.out("nothing changed \u2014 every ref was skipped/deferred"),0}let b=x({store:S,graph:n,verdicts:s,by:N});if(b.errors){if(o){for(let i of b.errors)J(i.code,i.detail);return o.event({type:"error",code:"REVIEW_FAILED",message:"couldn't save the review, so nothing was approved",remedy:"run the command again"}),o.done(1)}for(let i of b.errors)w(`${i.code}: ${i.detail}`);return 1}if(o){for(let i of v)o.event({type:"review_verdict",...i});return o.done(0)}return t.out(`review: committed record ${b.record.seq} \u2014 ${s.size} approved`),0}if(r.verdicts){let s=e=>(t.err??t.out)(e),o;try{o=W(r.verdicts,"utf8")}catch{return s(`error: cannot read verdicts file ${r.verdicts}`),2}let m=te(o);if("errors"in m){for(let e of m.errors)s(`error: --verdicts ${r.verdicts}: ${e}`);return 2}let p=new Set([...n.trust.entries()].filter(([e,f])=>(f==="derived"||f==="archived")&&!n.superseded.has(e)).map(([e])=>e)),g=new Map,v=[];for(let e of m.entries){let f=E(n,e.ref)??(e.supersede_target?E(n,e.supersede_target):null);if(f!==null){v.push(`${e.ref}: ${f}`);continue}let l=V(n,j(n,e.ref));if(!l){v.push(`${e.ref}: names nothing in the graph`);continue}if(!p.has(l)){v.push(`${e.ref}: not in a review queue (trust: ${n.trust.get(l)??"?"})`);continue}if(g.has(l)){v.push(`${e.ref}: duplicate \u2014 an earlier entry already resolves to this node (${_(n,l)})`);continue}let k=e.supersede_target?V(n,j(n,e.supersede_target)):null;if(e.supersede_target&&!k){v.push(`${e.ref}: supersede_target ${e.supersede_target} names nothing live in the graph`);continue}g.set(l,{resolution:e.resolution,...e.reason?{reason:e.reason}:{},...e.edit?{edit:e.edit}:{},...k?{supersedeTarget:k}:{}})}if(v.length>0){for(let e of v)s(`error: --verdicts: ${e}`);return s("error: nothing committed (the verdicts file is atomic \u2014 fix every offender and re-run)"),2}let y=[...g.entries()].filter(([,e])=>e.resolution==="rejected"||e.resolution==="supersede");if(y.length>0&&r.mode==="ci")return s(`error: ci mode never archives \u2014 ${y.length} retiring verdict(s) (rejected/supersede) present, nothing committed`),2;if(y.length>0&&r.allowArchive){let{archiveImpact:e}=await import("./feeder-VAY4NYBX.js");for(let[f,l]of y){let k=l.resolution==="supersede"?(()=>{let T=l.supersedeTarget?n.resolve(l.supersedeTarget):null;return T&&!n.superseded.has(T.tip)?T.tip:null})():f;if(k===null)continue;let K=e(n,k),B=l.resolution==="supersede"?`supersede (retires ${_(n,k)})`:`archive ${_(n,k)}`;s(`${B}: ${K.design_children} design child(ren) affected`)}for(let[,f]of y)f.reason||(f.reason=r.because)}let b=y.length>0&&!r.allowArchive,i=x({store:S,graph:n,verdicts:g,by:N,...b?{holdArchives:!0}:{}});if(i.errors){if(i.errors[0]?.code==="NO_VERDICTS")return s("nothing changed \u2014 every item was skipped"),0;for(let e of i.errors)s(`${e.code}: ${e.detail}`);return 1}b&&t.out(`${y.length} archive(s) held for interactive confirmation (re-run with --allow-archive --because "<reason>" to apply headlessly)`);let $=new Map;for(let e of g.values())$.set(e.resolution,($.get(e.resolution)??0)+1);if(r.json)for(let[e,f]of g.entries())t.out(JSON.stringify({ref:_(n,e),cid:e,resolution:f.resolution}));else{let e=[...$.entries()].map(([f,l])=>`${l} ${f}`).join(", ");t.out(`review: committed record ${i.record.seq} \u2014 ${e}`)}return 0}if(c==="drift"){let s=n.staleList().filter(({state:o})=>o!=="superseded").map(({cid:o,state:m})=>({ref:_(n,o),cid:o,state:m,title:String(n.getNode(o)?.content.title??n.getNode(o)?.content.source_id??""),pinned_sources:[...new Set(n.derivesInto(o).map(p=>String(p.props.source_id)))]}));if(r.json){for(let o of s)t.out(JSON.stringify(o));return 0}if(s.length===0)return t.out("drift queue is empty \u2014 every node's evidence matches the current source snapshots"),0;t.out(`${s.length} item(s) whose evidence changed (re-extract the source to re-approve):`);for(let o of s)t.out(` [${o.state}] ${o.ref} \xB7 ${o.title} \xB7 sources: ${o.pinned_sources.join(", ")||"\u2014"}`);return 0}if(!t.isTTY)return a?D(a,"review: verdict queues need a terminal","TTY_REQUIRED","run kane-cli context review in a terminal, or pass --verdicts <file.json>; the drift listing works anywhere"):(t.out("review: verdict queues need a TTY (drift listing works anywhere, or pass --verdicts <file.json>)"),2);let R,q;if(c==="archived")R=[...n.trust.entries()].filter(([s,o])=>o==="archived"&&!n.superseded.has(s)).map(([s])=>L(n,s)),q="skipped";else{let s=ee(u,n),o=[...n.trust.entries()].filter(([p,g])=>g==="derived"&&!n.superseded.has(p)).map(([p])=>p),m=c==="skipped"?o.filter(p=>s.has(p)):o;m.sort((p,g)=>Number(s.has(g))-Number(s.has(p))),R=m.map(p=>L(n,p)),q="skipped"}if(R.length===0)return t.out(`${c} queue is empty`),0;t.out(`${R.length} node(s) in the ${c} queue \u2014 approve promotes, reject ${c==="archived"?"re-archives":"archives"}, edit mints a new version, skip leaves it for later`);let z=await d(R,n,q),I=x({store:S,graph:n,verdicts:z,by:N});if(I.errors){if(I.errors[0]?.code==="NO_VERDICTS")return t.out("nothing changed \u2014 every item was skipped"),0;for(let s of I.errors)t.out(`${s.code}: ${s.detail}`);return 1}let O=I.record;return t.out(`committed record ${O.seq}: ${O.review.length} review fact(s), ${O.supersessions.length} supersession(s), ${O.nodes.length} new version(s)`),0}async function se(r,t,d){let[{render:h},c,{ReviewChecklist:a}]=await Promise.all([import("./build-5ZN47FAT.js"),import("./react-QWOAB3TB.js"),import("./ui-SNV3FD2G.js")]),u=c.default??c;return new Promise(S=>{let n=h(u.createElement(a,{items:r.map(w=>({uc:w.uc})),defaultResolution:d,onSubmit:w=>{n.unmount(),S(w)}}))})}async function he(r){let{bothTTY:t}=await import("./headless-io-FFM5T6KL.js");return!r.json&&r.mode!=="agent"&&await Q(A(process.cwd()),d=>process.stderr.write(d+`
|
|
3
3
|
`)),ne(r,{out:d=>process.stdout.write(d+`
|
|
4
4
|
`),err:d=>process.stderr.write(d+`
|
|
5
5
|
`),confirm:async()=>!1,isTTY:t()},se)}export{te as parseVerdictsFile,he as reviewCommand,ne as runReviewCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i}from"./chunk-
|
|
2
|
+
import{d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i}from"./chunk-NZ7UCAN6.js";import"./chunk-6PZ3SVWE.js";import"./chunk-PKXWYYVK.js";import"./chunk-FOURJ24E.js";import"./chunk-AXOSLGQ4.js";import"./chunk-QLGQDNA3.js";import"./chunk-IT6M7OMG.js";import"./chunk-RM5ZVDVR.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import{c as a}from"./chunk-HIUAUZNL.js";import"./chunk-CVVUBCB7.js";import"./chunk-JZ7GFPKZ.js";import"./chunk-77BZTEHJ.js";import"./chunk-3A4KK22B.js";import"./chunk-CB344EDO.js";import"./chunk-FNUGDPTS.js";import"./chunk-LZPYIFHZ.js";import"./chunk-3CFAE36M.js";import"./chunk-GBQ4K25P.js";import"./chunk-PGESS7BW.js";import"./chunk-FWGUISUG.js";import"./chunk-C3DMMAFP.js";import"./chunk-AQ2OG2EF.js";import"./chunk-REKHAN53.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-TD6GCEIK.js";import"./chunk-5ORBAYTU.js";import"./chunk-XRJH4UF3.js";import"./chunk-PVN64537.js";import"./chunk-RHQLDNZL.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-4C7WVQOD.js";import"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-7V4BQSSV.js";import"./chunk-QXQ7KVEN.js";import"./chunk-R6S4EJ5R.js";import"./chunk-BZEW7CSM.js";import"./chunk-QSCXXNC2.js";import"./chunk-UV7FPIBL.js";import"./chunk-CBEMXSWF.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-XTQUCCJH.js";import"./chunk-4QTH7VYE.js";import"./chunk-V24LUINK.js";import"./chunk-JYH7CTF7.js";import"./chunk-BRWCWZE3.js";import"./chunk-WTMCDYR3.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-FOJHSG5M.js";import"./chunk-UR6MHSHU.js";export{c as IngestRefused,b as IngestStopped,f as PAUSE_SAVES,a as STORE_CALL_TIMEOUT_MS,d as controllerCheck,h as finalExitOf,e as graceVerdict,i as runRemote,g as sessionEventTrace};
|
|
@@ -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-QRUAI2ST.js";import"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-UR6MHSHU.js";export{b as prereqsReady,a as runStartupGate};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as H,c as W}from"./chunk-
|
|
2
|
+
import{a as H,c as W}from"./chunk-VJRXJJML.js";import{M as G,N as ee,O as re,P as te,Q as ne,R as oe}from"./chunk-YQXOD7SV.js";import{d as Y}from"./chunk-TC2PHBPH.js";import"./chunk-TPCW5OU5.js";import{a as K}from"./chunk-2NP3THOE.js";import{a as V}from"./chunk-66C5A2F5.js";import"./chunk-HY5BBSYX.js";import"./chunk-WD52ZNQY.js";import"./chunk-AXOSLGQ4.js";import"./chunk-7TSM2FCL.js";import"./chunk-W3USRQX6.js";import"./chunk-5XVWT6UK.js";import"./chunk-NNVHWFLI.js";import"./chunk-PZOQ2IQK.js";import"./chunk-FNBHP75S.js";import"./chunk-BSRSXYDZ.js";import"./chunk-CB4ARIHR.js";import"./chunk-FOUUD3LI.js";import{j as D}from"./chunk-V4SL74TK.js";import"./chunk-77ZZQJLX.js";import"./chunk-JIRNI5TB.js";import"./chunk-UTM7D4PI.js";import"./chunk-5K7PCSTP.js";import"./chunk-Y3RDLUH5.js";import"./chunk-BHSHGWBL.js";import"./chunk-S3DAAAE5.js";import"./chunk-4DM5EWEV.js";import"./chunk-76MKY7FG.js";import"./chunk-MAQVRBUQ.js";import{b as j}from"./chunk-FP6JCXOS.js";import"./chunk-PEHVBCXM.js";import"./chunk-ZIRSTOEV.js";import"./chunk-TCK7WR3M.js";import"./chunk-WMGKUERB.js";import"./chunk-QLGQDNA3.js";import"./chunk-2EKLTUY2.js";import"./chunk-IINZZ4BZ.js";import"./chunk-IT6M7OMG.js";import"./chunk-RM5ZVDVR.js";import{d as M}from"./chunk-37KFCYHG.js";import"./chunk-72KYMWQ5.js";import"./chunk-CCOD4GQJ.js";import"./chunk-JQ64X2TO.js";import"./chunk-TDPWFYTJ.js";import{a as U}from"./chunk-QRUAI2ST.js";import"./chunk-73Y6T2UK.js";import"./chunk-XMPTFXPW.js";import"./chunk-SDIHDYWT.js";import{d as $,e as F}from"./chunk-YLI7DQMJ.js";import"./chunk-Z36KVIRR.js";import"./chunk-Q4JV4U65.js";import"./chunk-SMXABALN.js";import{b as P}from"./chunk-PCL2FYPE.js";import"./chunk-642GD7E6.js";import"./chunk-VE3SUJMA.js";import"./chunk-6WN4WSXR.js";import"./chunk-63BFLTJI.js";import"./chunk-VEE2O524.js";import"./chunk-FLGOQ6Q6.js";import{b as O}from"./chunk-F2F257PU.js";import"./chunk-5D7ENQTQ.js";import"./chunk-2G7UYQOW.js";import"./chunk-A5C7HIAH.js";import"./chunk-2AHQ3D3D.js";import"./chunk-WLEWXE6L.js";import"./chunk-LMOW4NM5.js";import"./chunk-MTMHB5LF.js";import{d as A}from"./chunk-FHULYIG3.js";import"./chunk-SB26HQO7.js";import"./chunk-YUFXE6WU.js";import"./chunk-HTJDMLZS.js";import"./chunk-FCD3NYOM.js";import"./chunk-3G2LSTK5.js";import"./chunk-MUL2QFG2.js";import"./chunk-QWEQ742S.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-VKIUHHNT.js";import"./chunk-TZXXJWHA.js";import"./chunk-WN5VKKJ3.js";import"./chunk-HCBYKLMW.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-REKHAN53.js";import"./chunk-32MFECUA.js";import"./chunk-4IEQNX7F.js";import"./chunk-UVL6XQHU.js";import"./chunk-VRIZDOO5.js";import"./chunk-ZHWU6L2G.js";import"./chunk-EHB55V23.js";import"./chunk-TD6GCEIK.js";import"./chunk-TFSWG7AS.js";import"./chunk-JBUKEIYL.js";import"./chunk-W5EDS4DF.js";import"./chunk-XB6BJPDL.js";import"./chunk-ZCIWQHCO.js";import"./chunk-5ORBAYTU.js";import"./chunk-XRJH4UF3.js";import{a as v}from"./chunk-PVN64537.js";import{r as I,w as N}from"./chunk-RHQLDNZL.js";import"./chunk-GFLB2SHW.js";import"./chunk-2TVPA3LL.js";import"./chunk-VJGWVBZR.js";import"./chunk-22PIMG52.js";import"./chunk-4C7WVQOD.js";import"./chunk-5EAJO372.js";import"./chunk-DBMW3VUN.js";import"./chunk-KU3YHPWZ.js";import"./chunk-OKCVG7AG.js";import"./chunk-XDAFRUAJ.js";import"./chunk-7V4BQSSV.js";import"./chunk-QXQ7KVEN.js";import"./chunk-R6S4EJ5R.js";import"./chunk-BZEW7CSM.js";import"./chunk-QSCXXNC2.js";import"./chunk-UV7FPIBL.js";import"./chunk-CBEMXSWF.js";import"./chunk-G4K3TP2I.js";import"./chunk-YJAQZMJT.js";import"./chunk-6PIIUAZF.js";import"./chunk-ZAQGIC33.js";import"./chunk-HYJVYYAZ.js";import"./chunk-XTQUCCJH.js";import"./chunk-VZ7KXRXB.js";import"./chunk-4QTH7VYE.js";import"./chunk-GMTHZUZ3.js";import{a as L}from"./chunk-V24LUINK.js";import{a as E}from"./chunk-JYH7CTF7.js";import"./chunk-BRWCWZE3.js";import"./chunk-WTMCDYR3.js";import{m as b,n as T,o as _}from"./chunk-WMXBRC4B.js";import"./chunk-ZCRZFAOT.js";import"./chunk-RZ4F3BHX.js";import"./chunk-U5V3L5QH.js";import"./chunk-E47GFYXA.js";import"./chunk-33DWJV67.js";import"./chunk-FOJHSG5M.js";import"./chunk-6YGTRKDT.js";import"./chunk-2XW33VOK.js";import"./chunk-7HO4NX5W.js";import"./chunk-A7RJQJNT.js";import"./chunk-UR6MHSHU.js";import{resolve as se}from"path";import{existsSync as ie}from"fs";function Z(){return{register:(t,o)=>b(t,o),deregister:t=>T(t),cleanup:(t,o)=>_(t,o),remoteLogger:null}}function ae(t){if(t.mode!=="agent")return t;let{mode:o,...r}=t;return{...r,agent:!0}}async function $e(t,o){let r=ae(o);if(r.overrideStartUrl!==void 0){let e=H(r.overrideStartUrl);if(!e.ok)return process.stderr.write(e.message),2;r.overrideStartUrl=e.url}let i=O(r);if("error"in i)return process.stderr.write(`error: ${i.error}
|
|
3
3
|
`),2;let n=se(t);if(!ie(n))return process.stderr.write(`error: file not found: ${n}
|
|
4
4
|
`),2;if(r.finalValidation!==void 0&&r.finalValidation!=="on"&&r.finalValidation!=="off")return process.stderr.write(`error: --final-validation must be 'on' or 'off'
|
|
5
5
|
`),2;if(!n.endsWith("_test.md"))return process.stderr.write(`error: not a *_test.md file: ${n}
|
|
@@ -15,6 +15,6 @@ import{a as H,c as W}from"./chunk-3JATEWA5.js";import{M as G,N as ee,O as re,P a
|
|
|
15
15
|
\u2022 Run 'kane-cli login --username <user> --access-key <key>'
|
|
16
16
|
`):e instanceof v&&e.code==="refresh_failed"?process.stderr.write(`error: Token refresh failed. Run 'kane-cli login' to re-authenticate.
|
|
17
17
|
`):process.stderr.write(`error: auth resolution failed: ${e.message}
|
|
18
|
-
`),2}let k=String(y.resolvedCreds?.org_id??"");if(!k)return process.stderr.write("error: TMS did not return an org_id. Run `kane-cli login` again.\n"),2;{let{readMetaIfExists:e,assertOrgMatchOrExit:p}=await import("./testmd-actions-
|
|
18
|
+
`),2}let k=String(y.resolvedCreds?.org_id??"");if(!k)return process.stderr.write("error: TMS did not return an org_id. Run `kane-cli login` again.\n"),2;{let{readMetaIfExists:e,assertOrgMatchOrExit:p}=await import("./testmd-actions-4OHRME2Z.js"),f=p(e(n),k);if(f!==null)return f}let h=new M;a?.attachSessionDir(h.sessionDir);let J=W({isAgent:s,log:(e,p,f,X)=>h.log(e,p,f,X)}),Q={path:n,cwd:process.cwd(),opts:r,isAgent:s,disableAskUser:!0,resolved:c,resolvedAuth:y,cliOverrides:u,environment:m,envConfig:z,profile:x,model:B,creds:d,configStore:C,session:h,evidenceCatalog:S,policies:R};try{return(await G(Q,J,l)).exitCode}catch(e){return process.stderr.write(`error: ${e.message}
|
|
19
19
|
`),2}finally{await N()}}var g=class extends Error{constructor(r,i){super(r);this.exitCode=i;this.name="CliArgError"}};function ce(t){let o={mode:"mode",assertionMode:"assertion_mode",finalValidation:"final_validation",maxSteps:"max_steps",timeout:"timeout",globalContext:"global_context",localContext:"local_context",codeExport:"code_export",codeLanguage:"code_language",headless:"headless",cdpEndpoint:"cdp_endpoint",wsEndpoint:"ws_endpoint"},r=new Set(["max_steps","timeout"]),i={};for(let[n,s]of Object.entries(o)){let a=t[n];if(a===void 0||a==="")continue;let l=a;if(r.has(s)&&(l=Number(a),Number.isNaN(l))){let c="--"+n.replace(/[A-Z]/g,u=>"-"+u.toLowerCase());throw new g(`error: ${c} must be a number
|
|
20
20
|
`,2)}i[s]=l}return i}export{ae as agentModeAlias,oe as applyCliStepConfig,re as buildStepRunVariables,ee as buildTestLevelVariables,ce as optsToOverrides,te as replayVariablesForStep,ne as resolveStepMaxSteps,$e as runTestMdFile};
|