@testmuai/kane-cli 0.8.16 → 0.8.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ChatSurface-5JEEFY34.js → ChatSurface-X2HLVN2I.js} +1 -1
- package/dist/{ChromeProfilePicker-6IVAYCWJ.js → ChromeProfilePicker-YU7HL6Z5.js} +1 -1
- package/dist/{CliFeedbackPrompt-K4IN7S6J.js → CliFeedbackPrompt-7FEEVGCU.js} +1 -1
- package/dist/{CliUploadProgress-MI4H4LKT.js → CliUploadProgress-OTVPBGW4.js} +1 -1
- package/dist/{ConfigView-CJY5MB6H.js → ConfigView-UKHUASHL.js} +1 -1
- package/dist/EvidenceViewOffer-LIPGXO23.js +2 -0
- package/dist/FolderPicker-OTQYRAYC.js +2 -0
- package/dist/{InfoBox-RP6RDCG7.js → InfoBox-2TYT2ROK.js} +1 -1
- package/dist/{LinksBox-QOQJ3S2I.js → LinksBox-7AS6D7MX.js} +1 -1
- package/dist/{ProfilesView-BZEBT6R5.js → ProfilesView-F4MFHZ7Y.js} +1 -1
- package/dist/{ProjectPicker-J42MEJRQ.js → ProjectPicker-QLGZM35L.js} +1 -1
- package/dist/{SaveSessionPrompt-MKAIUVX7.js → SaveSessionPrompt-T4MS76FY.js} +1 -1
- package/dist/SingleShotApp-4CDTAF3H.js +2 -0
- package/dist/{SummaryBox-JQJKGYDM.js → SummaryBox-IX32QPWM.js} +1 -1
- package/dist/TestMdRunView-MRMY3RW5.js +2 -0
- package/dist/{TestrunEvidenceTable-FYDS3ZVU.js → TestrunEvidenceTable-OK2HAENB.js} +1 -1
- package/dist/{WhoamiView-F4PPB7SN.js → WhoamiView-AHMNIIXZ.js} +1 -1
- package/dist/{app-download-RA4CGTC5.js → app-download-CF4JLXWV.js} +1 -1
- package/dist/{auth-TAT427C3.js → auth-D4BDPJPR.js} +1 -1
- package/dist/{binary-OFPMBJ34.js → binary-NWVJK542.js} +1 -1
- package/dist/{bind-LY362KX7.js → bind-LWN72YES.js} +4 -4
- package/dist/bootstrap-63FBDEEU.js +2 -0
- package/dist/bridge-UMXGHAJF.js +2 -0
- package/dist/{changelog-ZC3LHV2Z.js → changelog-GIZLIFMN.js} +1 -1
- package/dist/chat-committer-6D7AQI6Z.js +2 -0
- package/dist/chat-controller-UJQ6Z4RE.js +2 -0
- package/dist/{chunk-CVNHUDT4.js → chunk-233MYVFS.js} +1 -1
- package/dist/{chunk-MU3I453X.js → chunk-2LCWGWYC.js} +1 -1
- package/dist/{chunk-Z5DGFN7R.js → chunk-2LKNUXRN.js} +1 -1
- package/dist/{chunk-ZLIYWELJ.js → chunk-2STKZSVF.js} +1 -1
- package/dist/chunk-3UI5VTQS.js +4 -0
- package/dist/{chunk-4PWYSDZR.js → chunk-3UIZVDOF.js} +1 -1
- package/dist/chunk-3VAU3PNU.js +2 -0
- package/dist/{chunk-ICUTARPB.js → chunk-3YBT4UGQ.js} +1 -1
- package/dist/{chunk-4LVZLLTN.js → chunk-47QKRIPY.js} +3 -3
- package/dist/{chunk-AAT4O22C.js → chunk-4ASBXR6Q.js} +1 -1
- package/dist/{chunk-2GWMENG5.js → chunk-4OQ7GEIA.js} +1 -1
- package/dist/{chunk-BY2MU3ZS.js → chunk-4PWAODKJ.js} +1 -1
- package/dist/{chunk-23MVD7GY.js → chunk-5HDM7GDO.js} +1 -1
- package/dist/{chunk-VATOIZYG.js → chunk-5LSPHA3P.js} +5 -5
- package/dist/chunk-5MKY3WMF.js +3 -0
- package/dist/{chunk-C6JFTSIQ.js → chunk-5UHM7CKR.js} +1 -1
- package/dist/{chunk-FQFVAFWK.js → chunk-5X7JIGG7.js} +1 -1
- package/dist/{chunk-HYCOX7AB.js → chunk-5ZU7S4E7.js} +2 -2
- package/dist/{chunk-WPNNRMTP.js → chunk-637S3COE.js} +1 -1
- package/dist/{chunk-GX3FPJUG.js → chunk-63DYVWNX.js} +1 -1
- package/dist/{chunk-QXUPBIV3.js → chunk-64TO3MD7.js} +36 -36
- package/dist/{chunk-E44OHYDS.js → chunk-6CYF7Q5W.js} +2 -2
- package/dist/{chunk-TBYYPGHF.js → chunk-6OKOMKYR.js} +1 -1
- package/dist/{chunk-SF5QPR6T.js → chunk-75SSVUGS.js} +1 -1
- package/dist/{chunk-AHXOKBVE.js → chunk-7N6OCHPC.js} +1 -1
- package/dist/chunk-7U7HOEZO.js +2 -0
- package/dist/{chunk-7O54QURK.js → chunk-AACQE24F.js} +1 -1
- package/dist/{chunk-GCMJDOAE.js → chunk-AG2MVCNK.js} +1 -1
- package/dist/{chunk-NPKB7EK3.js → chunk-AH4QWIYU.js} +1 -1
- package/dist/{chunk-FYJ62EVY.js → chunk-AIR2WVXM.js} +1 -1
- package/dist/{chunk-O3ZKP4DY.js → chunk-AW34ZNNO.js} +1 -1
- package/dist/chunk-B6NU3SNG.js +368 -0
- package/dist/{chunk-OYY566GN.js → chunk-BNZQKQOE.js} +1 -1
- package/dist/{chunk-QMZLIHBS.js → chunk-CCNPXTC6.js} +2 -2
- package/dist/{chunk-CDWUZ54U.js → chunk-CCW3VQIY.js} +1 -1
- package/dist/{chunk-W4Y3PG7F.js → chunk-D2F5T3NX.js} +1 -1
- package/dist/{chunk-JQW2QFSX.js → chunk-D6E6KRVX.js} +1 -1
- package/dist/chunk-D7WG7SRA.js +2 -0
- package/dist/{chunk-Q7LZ5QJV.js → chunk-DFK5QYB5.js} +1 -1
- package/dist/{chunk-EMAKLNDV.js → chunk-DQRVB5EU.js} +1 -1
- package/dist/{chunk-H6S7L2I2.js → chunk-DT2LIX5S.js} +1 -1
- package/dist/{chunk-PDTFQGQF.js → chunk-E6X5BVXC.js} +1 -1
- package/dist/{chunk-MD3S2RXN.js → chunk-EIMHIZKF.js} +1 -1
- package/dist/chunk-EVFFDODK.js +5 -0
- package/dist/{chunk-3IXEARDX.js → chunk-F2OBORCG.js} +1 -1
- package/dist/chunk-FY7TCYPK.js +6 -0
- package/dist/{chunk-7QUFOWMU.js → chunk-GBXF4JE6.js} +1 -1
- package/dist/{chunk-U7BVK5IX.js → chunk-GIC56KI3.js} +1 -1
- package/dist/{chunk-IYOPWIG4.js → chunk-GT6Y2SEY.js} +2 -2
- package/dist/{chunk-ULGFPKC7.js → chunk-HLUOLWEJ.js} +1 -1
- package/dist/{chunk-O3XBIURC.js → chunk-HS7OIRGU.js} +1 -1
- package/dist/{chunk-NADKZKGS.js → chunk-I6RTGDZ7.js} +1 -1
- package/dist/{chunk-MZYPDLD3.js → chunk-ICFJVEEA.js} +1 -1
- package/dist/{chunk-Z4KRSLAM.js → chunk-IDLJHKJX.js} +1 -1
- package/dist/{chunk-J2LWXO55.js → chunk-IGI4T3VC.js} +1 -1
- package/dist/{chunk-KPL2XHYF.js → chunk-IHD2WXKT.js} +1 -1
- package/dist/{chunk-TGBXIV7O.js → chunk-IHUF6UP4.js} +1 -1
- package/dist/chunk-IICT4VOU.js +2 -0
- package/dist/{chunk-HBMNUT6E.js → chunk-IKB2JKMA.js} +1 -1
- package/dist/{chunk-SWTJMTBY.js → chunk-IPQAKIJO.js} +1 -1
- package/dist/{chunk-UEG4LJD6.js → chunk-IZ3PYWUL.js} +1 -1
- package/dist/{chunk-U466V5JN.js → chunk-JGCB4OUP.js} +1 -1
- package/dist/chunk-JPOYZCTX.js +2 -0
- package/dist/chunk-JQ64X2TO.js +2 -0
- package/dist/{chunk-UAFCBZ3P.js → chunk-JWOPRJIO.js} +1 -1
- package/dist/{chunk-WECVT7WE.js → chunk-JWPBLVPW.js} +1 -1
- package/dist/chunk-K2UJYY2U.js +2 -0
- package/dist/{chunk-ALCE5RLK.js → chunk-KDNNMU7Q.js} +1 -1
- package/dist/chunk-KJQNAOOE.js +6 -0
- package/dist/{chunk-DSWHEEHN.js → chunk-KMF2PPJ5.js} +1 -1
- package/dist/{chunk-NN6UG2BE.js → chunk-KQCGBDPM.js} +1 -1
- package/dist/{chunk-ZYEFWJNZ.js → chunk-KRI5NSGQ.js} +1 -1
- package/dist/{chunk-3MVEGB2I.js → chunk-KWANVHJX.js} +1 -1
- package/dist/{chunk-7P6FSGRD.js → chunk-KX5IV5FL.js} +2 -2
- package/dist/{chunk-WML5KSGQ.js → chunk-L2SJRAK4.js} +1 -1
- package/dist/{chunk-TWZ6NZWE.js → chunk-LO47W2DO.js} +4 -4
- package/dist/chunk-LSDWPG6C.js +2 -0
- package/dist/{chunk-G2ZMNVYN.js → chunk-MDM2LJFN.js} +1 -1
- package/dist/{chunk-Z2GDSCPS.js → chunk-MTCLFYNH.js} +1 -1
- package/dist/{chunk-IJTSA34Q.js → chunk-N55U4S4W.js} +1 -1
- package/dist/chunk-NFLQWKFR.js +8 -0
- package/dist/{chunk-OPL2MIQG.js → chunk-NJ4BXZBX.js} +1 -1
- package/dist/{chunk-6HCY5LJO.js → chunk-OCWS5YVO.js} +3 -3
- package/dist/{chunk-F2XTOZTN.js → chunk-PHR2OSWD.js} +1 -1
- package/dist/{chunk-TU6IMGWO.js → chunk-Q4YYAN6E.js} +1 -1
- package/dist/{chunk-55YDTPB7.js → chunk-Q6F23V7L.js} +1 -1
- package/dist/chunk-QSCXXNC2.js +2 -0
- package/dist/{chunk-IZ5CTC6M.js → chunk-RBFCGUR3.js} +1 -1
- package/dist/{chunk-3N6IAVD5.js → chunk-RDHWNSDP.js} +1 -1
- package/dist/{chunk-OUWOLCCS.js → chunk-RGJIGNB3.js} +1 -1
- package/dist/{chunk-TCAHDVII.js → chunk-RRY5IXOB.js} +1 -1
- package/dist/{chunk-BK42G6RI.js → chunk-RSXCS474.js} +1 -1
- package/dist/{chunk-AGKE5WF3.js → chunk-SDJNWR4D.js} +1 -1
- package/dist/{chunk-YCH7H7JX.js → chunk-SEEEGDVK.js} +1 -1
- package/dist/{chunk-5ACSALRU.js → chunk-TISVRTL7.js} +2 -2
- package/dist/{chunk-GGD7NKPL.js → chunk-TMOSERKN.js} +2 -2
- package/dist/{chunk-VOTIGXQ4.js → chunk-U2LDPUDZ.js} +1 -1
- package/dist/chunk-U6OTFMIT.js +4 -0
- package/dist/{chunk-KYZKPNPQ.js → chunk-UQNRUAES.js} +1 -1
- package/dist/{chunk-V4JR5JCK.js → chunk-UTIP6SMW.js} +1 -1
- package/dist/chunk-UUYYTJG2.js +6 -0
- package/dist/{chunk-XGL3RSI5.js → chunk-UXJZUGKL.js} +1 -1
- package/dist/{chunk-52WM3XYO.js → chunk-V4B5QA3U.js} +1 -1
- package/dist/chunk-VIO7CCFW.js +5 -0
- package/dist/{chunk-BCJNIDS3.js → chunk-VIYV6NIW.js} +1 -1
- package/dist/{chunk-IE3OO5GI.js → chunk-VVOKM2VO.js} +1 -1
- package/dist/{chunk-3LXN6AV5.js → chunk-WC54SZUO.js} +1 -1
- package/dist/{chunk-CR7UWQ76.js → chunk-WDK5ETMA.js} +1 -1
- package/dist/chunk-WESMQEPO.js +2 -0
- package/dist/{chunk-ECIGXPLN.js → chunk-WKIYI6MB.js} +1 -1
- package/dist/{chunk-KZG4E5RM.js → chunk-WVHMPIDQ.js} +1 -1
- package/dist/chunk-XLSOQLVT.js +2 -0
- package/dist/chunk-YOVKKZVZ.js +2 -0
- package/dist/chunk-ZLWURCJ7.js +2 -0
- package/dist/{chunk-5VZAWKDF.js → chunk-ZQ6KWTJ2.js} +1 -1
- package/dist/{chunk-IQDZ6YMY.js → chunk-ZRRBZUDJ.js} +1 -1
- package/dist/committer-2QPBANRD.js +2 -0
- package/dist/{config-WETHR632.js → config-WKLEWUPU.js} +1 -1
- package/dist/cover-cmd-7TSQJFGM.js +3 -0
- package/dist/{credentials-RQPAP5KY.js → credentials-FLY3ZXVX.js} +1 -1
- package/dist/{deps-bundle-F47ZDYIM.js → deps-bundle-CAKK3EO5.js} +1 -1
- package/dist/{deps-resolve-URKD4QCB.js → deps-resolve-MSLEFPVD.js} +1 -1
- package/dist/descriptor-3JJUOHBM.js +2 -0
- package/dist/design-committer-D44GSUXY.js +2 -0
- package/dist/dispatch-SXS276ZT.js +2 -0
- package/dist/{doctor-J44UKALC.js → doctor-EZPQTFJM.js} +1 -1
- package/dist/{docx-convert-WPZS6OIC.js → docx-convert-SQRTF7XS.js} +1 -1
- package/dist/{dossier-UGJMYYAB.js → dossier-7HVC6BNK.js} +1 -1
- package/dist/evidence-GUOURW6F.js +2 -0
- package/dist/evolve-cmd-LJJFOXXP.js +2 -0
- package/dist/{explain-H5HJEDEF.js → explain-NEFBUX5G.js} +1 -1
- package/dist/{explain-cmd-USGRZFBY.js → explain-cmd-5LLIJKM2.js} +1 -1
- package/dist/{explain-cmd-R45I5MT7.js → explain-cmd-ENSJNQK7.js} +1 -1
- package/dist/{extract-bind-X4QRQX53.js → extract-bind-CGU6WVS7.js} +3 -3
- package/dist/{extract-cmd-RKEE32FN.js → extract-cmd-7N7CCGN6.js} +2 -2
- package/dist/feeder-66TUPB2R.js +2 -0
- package/dist/gaps-cmd-BNUGDF5N.js +3 -0
- package/dist/{gate-E3BLIUEA.js → gate-OYRDJMF6.js} +1 -1
- package/dist/{generate-headless-LSQHOR3G.js → generate-headless-7TJYESUU.js} +2 -2
- package/dist/index.js +155 -158
- package/dist/ingest-OSNNM3DH.js +2 -0
- package/dist/ingest-cmd-B4T5CW5R.js +2 -0
- package/dist/install-6KJ2MZX3.js +2 -0
- package/dist/interactive-bind-HUZDSGFX.js +26 -0
- package/dist/lifecycle-cmd-GIVLSUPE.js +2 -0
- package/dist/list-cmd-KEKKQDUF.js +3 -0
- package/dist/{list-commands-Q77CAQJ2.js → list-commands-SMBBT5CY.js} +1 -1
- package/dist/logical-ids-GLVM2SVR.js +2 -0
- package/dist/login-flow-5ZIG7JXT.js +2 -0
- package/dist/maintenance-cmd-MLQ3IRFV.js +2 -0
- package/dist/{mobile-prompts-PPPPKRS2.js → mobile-prompts-EEPPPA6S.js} +1 -1
- package/dist/{objective-variable-gate-BCKULIFQ.js → objective-variable-gate-AEBWIGH7.js} +1 -1
- package/dist/open-provider-OTZ37JB6.js +2 -0
- package/dist/{pdf-convert-5H4HQNN3.js → pdf-convert-RLXSXFWN.js} +1 -1
- package/dist/{persist-recorded-session-MK4HCDOY.js → persist-recorded-session-IRWGMXGI.js} +1 -1
- package/dist/phase-seed-H7KXNQO6.js +2 -0
- package/dist/pipeline-OV3TWKSZ.js +2 -0
- package/dist/prepare-target-35OI7XBL.js +2 -0
- package/dist/readmodel-FVLRQWZ7.js +2 -0
- package/dist/reconcile-cmd-NBBDE7DJ.js +2 -0
- package/dist/reconcile-deps-DJNIY7TP.js +4 -0
- package/dist/reconcile-engine-Z2XKUCQ7.js +2 -0
- package/dist/recording-banner-GCR6A46M.js +2 -0
- package/dist/{records-TJJJWBUD.js → records-LMCVKPE5.js} +1 -1
- package/dist/registry-V3ULHPLM.js +2 -0
- package/dist/{require-project-folder-ZLKONKKP.js → require-project-folder-YBB5T3OE.js} +1 -1
- package/dist/{resolve-run-intent-3SXUS676.js → resolve-run-intent-XGZN6OQ6.js} +1 -1
- package/dist/{resolver-G7NGWACO.js → resolver-WNV53IOL.js} +1 -1
- package/dist/revert-NOUECRW4.js +2 -0
- package/dist/review-cmd-ZXTLZ4GE.js +5 -0
- package/dist/run-YWKZGZVL.js +2 -0
- package/dist/run-YZP2PTNW.js +2 -0
- package/dist/run-test-md-N43FRXB6.js +17 -0
- package/dist/{sessions-cmd-DV442ZCY.js → sessions-cmd-IV25N2L7.js} +1 -1
- package/dist/skill-installer-G7Z5ZDAQ.js +3 -0
- package/dist/{spawner-H6IDWY5U.js → spawner-ABB7B5CQ.js} +1 -1
- package/dist/store-guard-YIQQF4LC.js +2 -0
- package/dist/{structured-answers-NADW6D44.js → structured-answers-3C2DCFFF.js} +1 -1
- package/dist/sync-cmd-4AKHO5EG.js +2 -0
- package/dist/sync-setup-E7UV25KK.js +2 -0
- package/dist/tcg-generate-XJN5OMIJ.js +2 -0
- package/dist/testmd-actions-WFDWYEAU.js +2 -0
- package/dist/{testmd-sync-2CXNIPJ7.js → testmd-sync-I2E6W6JL.js} +1 -1
- package/dist/token-refresh-NADDXLYM.js +2 -0
- package/dist/{validate-basic-MN5NDCT2.js → validate-basic-WZY6A3KD.js} +1 -1
- package/dist/{variable-receipt-SIABUC74.js → variable-receipt-JONRYHCY.js} +1 -1
- package/dist/verdicts-JMVS6HNJ.js +2 -0
- package/dist/{version-check-TDGK5REB.js → version-check-CD7DHZI2.js} +1 -1
- package/dist/{view-cmd-RLO7AP4X.js → view-cmd-ASH2UFUW.js} +1 -1
- package/dist/walk-session-ZPXR7ASG.js +2 -0
- package/dist/with-telemetry-QXCHDKPW.js +2 -0
- package/package.json +11 -11
- package/dist/EvidenceViewOffer-ABKTGD4K.js +0 -2
- package/dist/FolderPicker-RQIVS7ZR.js +0 -2
- package/dist/SingleShotApp-TZZ2J7ZO.js +0 -2
- package/dist/TestMdRunView-2YVGGFLU.js +0 -2
- package/dist/bootstrap-RCDB5OWA.js +0 -2
- package/dist/bridge-E2NGMJYM.js +0 -2
- package/dist/chat-committer-HDE3TP5I.js +0 -2
- package/dist/chat-controller-3EPK7UZG.js +0 -2
- package/dist/chunk-3AVBUEBL.js +0 -8
- package/dist/chunk-4PMZ5FCD.js +0 -2
- package/dist/chunk-4WEVTED6.js +0 -3
- package/dist/chunk-7XMDCGIZ.js +0 -3
- package/dist/chunk-AKX4VRRR.js +0 -2
- package/dist/chunk-CRZUBDJ3.js +0 -6
- package/dist/chunk-FFVNISYH.js +0 -2
- package/dist/chunk-FWPRUGJJ.js +0 -368
- package/dist/chunk-GP7WD4UY.js +0 -4
- package/dist/chunk-HOA4VWSD.js +0 -5
- package/dist/chunk-JUJ4SAGH.js +0 -2
- package/dist/chunk-L2TV4G56.js +0 -4
- package/dist/chunk-NMBFAIXZ.js +0 -2
- package/dist/chunk-O25AL4B7.js +0 -5
- package/dist/chunk-RCYYE6ED.js +0 -2
- package/dist/chunk-TNBF5OMZ.js +0 -2
- package/dist/chunk-UHT5SVP5.js +0 -2
- package/dist/chunk-VWOAEF7J.js +0 -2
- package/dist/chunk-YMLC55J4.js +0 -2
- package/dist/chunk-YYYQ5MVD.js +0 -6
- package/dist/committer-IYQPXG6C.js +0 -2
- package/dist/cover-cmd-J3CTQT3R.js +0 -3
- package/dist/descriptor-PWUUNYV7.js +0 -2
- package/dist/design-committer-J57IAAA5.js +0 -2
- package/dist/dispatch-KOZAJQDW.js +0 -2
- package/dist/evidence-KRNDKDCT.js +0 -2
- package/dist/evolve-cmd-CEYGGIWA.js +0 -2
- package/dist/feeder-RSHMGW6B.js +0 -2
- package/dist/gaps-cmd-WL6P6YKS.js +0 -3
- package/dist/ingest-QGLVY7ND.js +0 -2
- package/dist/ingest-cmd-TQ4ARSDE.js +0 -2
- package/dist/install-47CRHVU6.js +0 -2
- package/dist/interactive-bind-FPC4RYEW.js +0 -26
- package/dist/lifecycle-cmd-DB5EFO2O.js +0 -2
- package/dist/list-cmd-UWGJRGKF.js +0 -3
- package/dist/logical-ids-DN6IZSUM.js +0 -2
- package/dist/login-flow-RSNR5HY2.js +0 -2
- package/dist/maintenance-cmd-EJ2RAMWB.js +0 -2
- package/dist/open-provider-XIGABCD3.js +0 -2
- package/dist/phase-seed-HKJ2EF7R.js +0 -2
- package/dist/pipeline-XDWHEZ5S.js +0 -2
- package/dist/prepare-target-NR3MTLLI.js +0 -2
- package/dist/readmodel-IBFRM6EO.js +0 -2
- package/dist/reconcile-cmd-VJPEY7YD.js +0 -2
- package/dist/reconcile-deps-T5YX6HRG.js +0 -4
- package/dist/reconcile-engine-GELPXSLV.js +0 -2
- package/dist/recording-banner-3ET3PMSV.js +0 -3
- package/dist/registry-3XMA4FOC.js +0 -2
- package/dist/revert-6BBBK3I4.js +0 -2
- package/dist/review-cmd-6DNGXV5E.js +0 -5
- package/dist/run-MUVZVTTC.js +0 -2
- package/dist/run-UJLRTKTO.js +0 -2
- package/dist/run-test-md-RI5RXVFU.js +0 -17
- package/dist/skill-installer-CAO2NJZP.js +0 -3
- package/dist/store-guard-PIA2DYZX.js +0 -2
- package/dist/sync-cmd-VFVTFIIJ.js +0 -2
- package/dist/sync-setup-R7BZDE24.js +0 -2
- package/dist/tcg-generate-QADJKNYZ.js +0 -2
- package/dist/testmd-actions-EXSVQRHQ.js +0 -2
- package/dist/token-refresh-5TVNSL4U.js +0 -2
- package/dist/verdicts-ZXXBKTOZ.js +0 -2
- package/dist/walk-session-ATWNUGHX.js +0 -2
- package/dist/with-telemetry-CLSDKQAG.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as De}from"./chunk-D6E6KRVX.js";import{a as we,e as Te}from"./chunk-3UI5VTQS.js";import{H as ge,M as re,T as xe,X as Oe,c as ne,d as K,f as fe,m as te,p as be,x as Se}from"./chunk-RDHWNSDP.js";import{f as se,g as O,h as ie,i as ae,j as pe}from"./chunk-XLSOQLVT.js";function Ge(t,i){let r=t.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");if(r.length>60){let c=r.lastIndexOf("-",60);r=(c>0?r.slice(0,c):r.slice(0,60)).replace(/-+$/g,"")}if(!le.test(r))return null;let e=r;for(let c=2;i(e);c++)e=`${r}-${c}`;return le.test(e)?e:null}var Le={source:"src",usecase:"uc",scenario:"sc",ac:"ac",test:"t",gap:"gap",stylenote:"sty"};function Ze(t,i,r){let e=Le[t];return Ge(e?`${e} ${i}`:i,r)}var Ue={usecase:"uc",scenario:"sc",ac:"ac",test:"t",gap:"gap",stylenote:"sty"},ke=/^(uc|sc|ac|t|gap|sty)-\d+$/i;function Ae(t,i,r){let e=Ue[t];if(!e)return null;let c=new RegExp(`^${e}-(\\d+)$`),p=0;for(let d of r){let a=c.exec(d);if(!a)continue;let n=Number(a[1]);Number.isSafeInteger(n)&&n>p&&(p=n)}let o=p+1;for(;i(`${e}-${o}`);)o+=1;return`${e}-${o}`}import{existsSync as Fe,readFileSync as je}from"fs";function ot(t){return He(t,Oe(t))}function He(t,i,r){let e=new Map(Object.entries(i.heads)),c=new Map(Object.entries(i.trust)),p=new Map(Object.entries(i.nodeLabel)),o=new Map(Object.entries(i.superseded)),d=new Map(Object.entries(i.names)),a=new Map(Object.entries(i.archivedReason)),n=new Set(i.appliedEvents),E=new Map(Object.entries(i.conv)),f=l=>i.media[l]??{format:"text",media_type:"text/plain",anchors_supported:["L-L"]},_=new Map;for(let[l,m]of d)_.set(m,l);let g=new Map,C=l=>{if(g.has(l))return g.get(l);if(!p.has(l))return g.set(l,null),null;let m=r?.get(l);if(m)return g.set(l,m),m;let I=xe(t,l);if(!Fe(I))throw new be(`derived node file missing for ${l} \u2014 run kane-cli context rebuild`);let R=JSON.parse(je(I,"utf8"));return g.set(l,R),R},v=l=>{let m=l,I=new Set;for(;o.has(m)&&!I.has(m);){I.add(m);let R=o.get(m);if(typeof R!="string")break;m=R}return m},w=null,N=l=>{let m=_.get(l);if(m!==void 0)return m;if(w===null){w=new Map;for(let[F,A]of o)typeof A=="string"&&w.set(A,F)}let I=new Set,R=l;for(;!I.has(R);){I.add(R);let F=w.get(R);if(F===void 0)return null;let A=_.get(F);if(A!==void 0)return A;R=F}return null},T=l=>{ke.test(l)&&(l=l.toLowerCase());let m=e.get(l),I=p.has(l)?l:d.get(l)??(typeof m=="string"?m:void 0);if(I===void 0||!p.has(I))return null;let R=v(I);return{cid:I,tip:R,superseded:o.has(I)||o.has(R)}},G=new Map;for(let l of Object.values(i.forward))for(let m of l){let I=G.get(m.dst);I?I.push(m):G.set(m.dst,[m])}let P=l=>(l??[]).filter(m=>!o.has(m.ecid)),W=l=>P(G.get(l)),L=l=>W(l).filter(m=>m.type===O.DERIVES),X=l=>P(i.forward[l]).some(m=>ae(m.type)?.pin?.comparesTo==="dst_tip"&&o.has(m.dst)),oe=l=>{if(o.has(l))return"superseded";let m=L(l);if(m.length===0)return X(l)?"stale":"fresh";let I=new Map;for(let A of m)I.set(A.props.source_id,A);let R=!1,F=!1;for(let[A,k]of I){let M=e.get(A);if(M!=null&&(R=!0,M!==k.props.source_cid)){let ce=E.get(A)?.chain;(!ce||!ce.includes(k.props.source_cid))&&(F=!0)}}return R?F||X(l)?"stale":"fresh":"orphaned"};return{heads:e,trust:c,nodeLabel:p,superseded:o,names:d,nameOf:_,archivedReason:a,appliedEvents:n,convChains:E,mediaOf:f,extractedSourceCids:new Set(i.extracted),extractionCompleteness:new Map(Object.entries(i.completeness??{}).map(([l,{seq:m,...I}])=>[l,I])),designOf:new Map(Object.entries(i.design_of??{})),designGenerationOf:new Map(Object.entries(i.design_generation??{})),latestHash:i.applied.hash,lastSeq:i.applied.seq,hasNode:l=>p.has(l),getNode:C,byLabel:l=>[...p.entries()].filter(([,m])=>m===l).map(([m])=>({cid:m,content:C(m)?.content??{}})),edgesFrom:l=>P(i.forward[l]),edgesInto:W,derivesInto:L,resolve:T,tipOf:v,displayNameOf:N,stale:oe,staleList:()=>[...p.keys()].map(l=>({cid:l,state:oe(l)})).filter(l=>l.state!=="fresh"),execHistory:l=>{let m=T(l);if(!m)return[];let I=v(m.cid),R=new Set([I]),F=!0;for(;F;){F=!1;for(let[k,M]of o)M!==null&&R.has(M)&&!R.has(k)&&(R.add(k),F=!0)}let A=[];for(let k of Object.entries(i.exec??{}))R.has(k[0])&&A.push(...k[1]);return A.sort((k,M)=>k.started_at<M.started_at?-1:1)},retractedEdgesTouching:l=>{let m=new Set([v(l),l]),I=!0;for(;I;){I=!1;for(let[k,M]of o)typeof M=="string"&&m.has(M)&&!m.has(k)&&(m.add(k),I=!0)}let R=i.edgeRetractions??{},F=[],A=new Set;for(let k of m)for(let M of[...i.forward[k]??[],...G.get(k)??[]]){let ce=R[M.ecid];!ce||A.has(M.ecid)||(A.add(M.ecid),F.push({...M,retraction:ce}))}return F}}}function ct(t,i){if(t.stale(i)!=="stale")return!1;let r=new Map;for(let e of t.derivesInto(i))r.set(e.props.source_id,e);for(let[e,c]of r){let p=t.heads.get(e);if(p==null||p===c.props.source_cid)continue;let o=t.convChains.get(e)?.chain;if(!o||!o.includes(c.props.source_cid))return!0}for(let e of t.edgesFrom(i)){if(ae(e.type)?.pin?.comparesTo!=="dst_tip"||!t.superseded.has(e.dst))continue;let c=t.tipOf(e.dst);if(t.superseded.has(c)||t.nodeLabel.get(c)==="usecase")return!0}return!1}function he(t,i){let r=new Map;for(let[o,d]of t.superseded)typeof d=="string"&&d!==o&&r.set(d,[...r.get(d)??[],o]);let e=[],c=[i],p=new Set;for(;c.length>0;){let o=c.pop();p.has(o)||(p.add(o),e.push(o),c.push(...r.get(o)??[]))}return e}function qe(t,i){return(t.extraction_claims??[]).some(r=>r.source_id===i&&r.completeness==="complete")}function Ke(t,i){let r=new Set;for(let e of he(t,i))for(let c of t.derivesInto(e))r.add(c.props?.source_id??"conversation");return r}function ye(t,i){let r=[],e=[],c=t.archived??[];if(c.length===0)return{valid:r,errors:e};let p=new Set([...t.source?[t.source.source_id]:[],...(t.sources??[]).map(d=>d.source_id)]),o=new Set;for(let d of t.use_cases){if(!d.matches_existing)continue;let a=i.resolve(d.matches_existing.cid);a&&o.add(i.tipOf(a.cid))}for(let d of c){let a=`archived[${d.target}]`,n=i.resolve(d.target),E=n?i.tipOf(n.cid):null;if(!E||(i.trust.get(E)??null)==="archived"){e.push({code:"ARCHIVE_TARGET_UNKNOWN",detail:`${a}: target does not resolve to an existing, live item`});continue}let f=Ke(i,E);if(!f.has(d.basis)){e.push({code:"ARCHIVE_FOREIGN_PROVENANCE",detail:`${a}: its provenance does not include ${d.basis} \u2014 an archive claim must come from a source that evidences the item`});continue}if(!p.has(d.basis)){e.push({code:"ARCHIVE_WITHOUT_COMPLETE_CLAIM",detail:`${a}: ${d.basis} was not read by this extraction \u2014 a completeness claim only counts for a source this run actually read`});continue}if(!qe(t,d.basis)){e.push({code:"ARCHIVE_WITHOUT_COMPLETE_CLAIM",detail:`${a}: archiving needs an EXPLICIT complete extraction claim for ${d.basis} (the omitted-claims default does not count) \u2014 add extraction_claims`});continue}if(o.has(E)){e.push({code:"ARCHIVE_TARGET_MATCHED",detail:`${a}: this proposal also matches the target via matches_existing \u2014 a matched item cannot be archived by the same extraction; propose the change as an update instead`});continue}let _=[...f].filter(g=>g!==d.basis);if(_.length>0){e.push({code:"ARCHIVE_OTHER_LIVE_EVIDENCE",detail:`${a}: still evidenced by ${_.join(", ")} \u2014 an item another live source evidences is never archived from here`});continue}r.push({op:d,cid:E})}return{valid:r,errors:e}}function Ce(t,i,r){return t.superseded.has(r)}function Me(t){let{graph:i,oldTip:r,newCid:e,newLabel:c,by:p}=t,o=[],d=[],a=[],n=[],E=new Set;for(let f of i.edgesFrom(r)){if(f.type===O.DERIVES||t.skipEcids?.has(f.ecid))continue;d.push({kind:"edge",ecid:f.ecid,reason:t.reason,by:p}),E.add(f.ecid);let _=t.dstRedirect?.get(f.dst)??f.dst,g=i.nodeLabel.get(f.dst)??"(unknown)",C=pe(f.type,c,g,f.props);if(C.length>0){a.push(`rebless ${f.type} \u2192 ${f.dst}: ${C.map(N=>N.detail).join("; ")}`);continue}let v=De(i,{type:f.type,src:e,dst:_},{pending:n,retracted:E},`rebless ${f.type}`);if(v){a.push(v.detail);continue}let w=K(f.type,e,_,f.props);if(i.superseded.has(w)){a.push(`rebless ${f.type} \u2192 ${_}: the re-derived edge (${w}) was retracted \u2014 retraction is terminal, the successor cannot revive it`);continue}o.push({ecid:w,type:f.type,src:e,dst:_,props:f.props}),n.push({src:e,dst:_,type:f.type})}return{edges:o,supersessions:d,errors:a}}var le=/^[a-z0-9][a-z0-9-]{1,63}$/;function Pe(t,i,r,e){if(!i)return{error:{code:"SUPERSEDE_TARGET_MISSING",detail:"supersede verdict needs a target (slug or cid)"}};let c=t.resolve(i);return c?c.superseded||e.has(c.cid)?{error:{code:"ALREADY_SUPERSEDED",detail:`${i} is already superseded (tip: ${c.tip})`}}:c.cid===r?{error:{code:"SELF_SUPERSEDE",detail:"a node cannot supersede itself"}}:{targetCid:c.cid}:{error:{code:"UNKNOWN_SUPERSEDE_TARGET",detail:`${i} names nothing in the graph`}}}function We(t,i,r,e,c=[]){if(!ae(i)?.acyclic)return null;if(r===e)return{code:"EDGE_CYCLE",detail:`${i} ${r} \u2192 itself`};let o=n=>[...t.edgesFrom(n).filter(E=>E.type===i).map(E=>E.dst),...c.filter(E=>E.type===i&&E.src===n).map(E=>E.dst)],d=new Set,a=[e];for(;a.length>0;){let n=a.pop();if(n===r)return{code:"EDGE_CYCLE",detail:`${i} ${r} \u2192 ${e} closes a cycle`};d.has(n)||(d.add(n),a.push(...o(n)))}return null}function Rt(t,i,r,e){let p=ae(i)?.cardinality;if(p!=="one-live-per-src"&&p!=="one-live-per-src-and-dst")return null;let o=t.edgesFrom(r).filter(d=>d.type===i&&!t.superseded.has(d.dst));if(o.length>0)return{code:"CARDINALITY_VIOLATION",detail:`${i} from ${r} already has a live edge (${o[0].ecid}) \u2014 supersede it first`};if(p==="one-live-per-src-and-dst"&&e!==void 0){let d=t.edgesInto(e).filter(a=>a.type===i&&!t.superseded.has(a.src));if(d.length>0)return{code:"CARDINALITY_VIOLATION",detail:`${i} onto ${e} already has a live edge (${d[0].ecid}) \u2014 strict 1:1, supersede it first`}}return null}var Ie=new Set(["high","med","low"]),me=t=>t.cites&&t.cites.length>0?t.cites:[t.cite];function _e(t){let i=0;for(let r of t)typeof r=="object"&&r!==null&&"op"in r&&i++;return i===0?"flat":i===t.length?"ops":"mixed"}var Be=/^c[1-9][0-9]*$/;function Ve(t,i,r,e){let c=new Map,p=[],o=[];for(let[a,n]of i.entries()){let E=`${t}.updated.criteria[${a}]`;if(n.op==="keep"||n.op==="remove"){if(!Be.test(n.ref??"")){e.push({code:"CRITERIA_REF_UNKNOWN",detail:`${E}: ref ${JSON.stringify(n.ref)} is not a c<N> criterion index`});continue}if(c.has(n.ref)){e.push({code:"CRITERIA_REF_DUPLICATE",detail:`${E}: ${n.ref} is already named by another op \u2014 every prior criterion appears in exactly one keep or remove`});continue}c.set(n.ref,n);let f=Number.parseInt(n.ref.slice(1),10);if(f>r.length){e.push({code:"CRITERIA_REF_UNKNOWN",detail:`${E}: ${n.ref} \u2014 the live target has ${r.length} criteria`});continue}if(r[f-1]!==n.text){e.push({code:"CRITERIA_REF_MISMATCH",detail:`${E}: ${n.ref} echo mismatch \u2014 the live target's criterion ${f} reads ${JSON.stringify(r[f-1])}, the op echoed ${JSON.stringify(n.text)} \u2014 re-read the node and re-emit`});continue}n.op==="remove"&&(p.push(n.text),(!n.reason||!n.reason.trim())&&e.push({code:"EMPTY_REASON",detail:`${E}: a remove op carries its reason`}))}else!n.text||!n.text.trim()?e.push({code:"EMPTY_CRITERION",detail:`${E}: set text is empty`}):o.push(n.text)}let d=[];for(let a=1;a<=r.length;a++)c.has(`c${a}`)||d.push(`c${a}`);d.length>0&&e.push({code:"CRITERIA_PARTITION_INCOMPLETE",detail:`${t}: prior criteria ${d.join(", ")} named by no keep/remove op \u2014 every prior criterion must be kept or removed (with a reason)`});for(let a of p)o.includes(a)&&e.push({code:"CRITERIA_OP_CONFLICT",detail:`${t}: ${JSON.stringify(a)} is removed AND re-set in the same update \u2014 drop one of the two ops`})}function bt(t,i,r){let e=[],c=t.sources??[t.source],p=new Map(c.map(n=>[n.source_id,n.source_cid])),o=new Map;if(typeof i=="string")o.set(t.source.source_id,{media:r.mediaOf(t.source.source_cid),numberedText:i});else for(let[n,E]of i)o.set(n,E);for(let n of c)r.hasNode(n.source_cid)||e.push({code:"MISSING_SOURCE_NODE",detail:`source ${n.source_id} (${n.source_cid}) is not a committed node \u2014 ingest it first`});let d=(n,E)=>{let f=E.source_id??t.source.source_id;if(!p.has(f)){e.push({code:"CITE_SOURCE_UNKNOWN",detail:`${n}: cite source ${JSON.stringify(f)} is not in read_basis`});return}let _=o.get(f);if(!_){e.push({code:"MISSING_SOURCE_NODE",detail:`${n}: no citable text available for source ${f}`});return}for(let g of Te(_.media,E,_.numberedText))e.push({code:g.code,detail:`${n}: ${g.detail}`})},a=new Set;for(let n of t.use_cases){if(a.has(n.temp_ref)&&e.push({code:"DUP_TEMP_REF",detail:`duplicate temp_ref ${n.temp_ref}`}),a.add(n.temp_ref),(!n.title||!n.title.trim())&&e.push({code:"EMPTY_TITLE",detail:`${n.temp_ref}: title is empty`}),Ie.has(n.risk)||e.push({code:"BAD_RISK",detail:`${n.temp_ref}: risk ${JSON.stringify(n.risk)} not in high|med|low`}),!n.cite||!n.cite.anchor)e.push({code:"MISSING_CITE",detail:`${n.temp_ref}: every derived use-case must carry a cite`});else for(let f of me(n))d(n.temp_ref,f);n.matches_existing&&!r.hasNode(n.matches_existing.cid)&&e.push({code:"UNKNOWN_MATCH",detail:`${n.temp_ref}: matches_existing ${n.matches_existing.cid} is not in the graph`});for(let[f,_]of(n.criteria??[]).entries())(!_.text||!_.text.trim())&&e.push({code:"EMPTY_CRITERION",detail:`${n.temp_ref}.criteria[${f}]: text is empty`}),!_.cite||!_.cite.anchor?e.push({code:"MISSING_CITE",detail:`${n.temp_ref}.criteria[${f}]: every criterion carries its own cite`}):d(`${n.temp_ref}.criteria[${f}]`,_.cite);let E=n.updated?.criteria??[];if(E.length>0){let f=_e(E);if(f==="mixed")e.push({code:"CRITERIA_SHAPE_MIXED",detail:`${n.temp_ref}.updated.criteria mixes op-shaped (keep/set/remove) and {text, cite} entries \u2014 emit ONE shape for the whole array`});else if(f==="ops"){let _=E,g=n.matches_existing?Xe(r,n.matches_existing.cid):null;if(!g)e.push({code:"CRITERIA_REF_UNKNOWN",detail:`${n.temp_ref}: op-union criteria address a prior version \u2014 they need a resolvable matches_existing target`});else{let C=r.getNode(g.cid)?.content.criteria??[];Ve(n.temp_ref,_,C,e)}for(let[C,v]of _.entries())v.op==="set"&&(!v.cite||!v.cite.anchor?e.push({code:"MISSING_CITE",detail:`${n.temp_ref}.updated.criteria[${C}]: a set op carries the proposing source's cite`}):d(`${n.temp_ref}.updated.criteria[${C}]`,v.cite))}else for(let[_,g]of E.entries())(!g.text||!g.text.trim())&&e.push({code:"EMPTY_CRITERION",detail:`${n.temp_ref}.updated.criteria[${_}]: text is empty`}),!g.cite||!g.cite.anchor?e.push({code:"MISSING_CITE",detail:`${n.temp_ref}.updated.criteria[${_}]: every updated criterion carries its own cite`}):d(`${n.temp_ref}.updated.criteria[${_}]`,g.cite)}}return e.push(...ye(t,r).errors),e}function Je(t,i,r){return`${t}:${i}:${r}`}function Ye(t,i,r,e){let c=`${i}:${r}:`,p=0;for(let o of t.appliedEvents){if(!o.startsWith(c))continue;let d=o.slice(c.length);if(!/^\d+$/.test(d))continue;let a=Number.parseInt(d,10);a>p&&(p=a)}return Array.from({length:e},(o,d)=>Je(i,r,p+1+d))}function Xe(t,i){let r=t.resolve(i);if(r===null)return null;let e=r.cid;if(t.superseded.has(e)){let c=t.tipOf(e);return t.superseded.has(c)?null:{cid:c,redirected:!0}}return{cid:e,redirected:!1}}function xt(t){let{contextDir:i,graph:r,proposal:e,proposalId:c,verdicts:p,by:o,allowStaleBasis:d,extractorVersion:a,autoName:n}=t,E=ge(i);if(!d&&e.read_basis!==E)return{record:null,errors:[{code:"STALE_BASIS",detail:`proposal read_basis ${String(e.read_basis)} != latest ${String(E)}`}]};for(let s of e.sources??[e.source])if(!r.hasNode(s.source_cid))return{record:null,errors:[{code:"MISSING_SOURCE_NODE",detail:`source ${s.source_id} (${s.source_cid}) is not a committed node \u2014 ingest it first`}]};let f=new Map((e.sources??[e.source]).map(s=>[s.source_id,s.source_cid])),_={supersedeTarget:{},matches_existing:{},conflicts_with:{},depends_on_hint:{},read_basis_heads:Object.fromEntries(f)},g=[],C=[],v=new Map,w=[],N=r.mediaOf(e.source.source_cid),T=new Set,G=[],P=[],W=[],L=[];for(let s of ye(e,r).valid)L.push({id:s.cid,kind:"pending_archive",resolution:"pending",edit:null,reason:s.op.reason,by:o});let X=[],oe=[],l=new Set,m=new Set,I=(s,h,j)=>{let Y=Pe(r,h.supersedeTarget,j,l);if("error"in Y){g.push({code:Y.error.code,detail:`${s}: ${Y.error.detail}`});return}l.add(Y.targetCid),_.supersedeTarget[s]=Y.targetCid,X.push({kind:"node",old:Y.targetCid,new:j,reason:h.reason??`superseded via review by ${o.id}`,by:o})};for(let s of e.use_cases){let h=p.get(s.temp_ref)??{resolution:"skipped"};T.has(s.temp_ref)&&g.push({code:"DUP_TEMP_REF",detail:`duplicate temp_ref ${s.temp_ref}`}),T.add(s.temp_ref),s.conflicts_with&&(_.conflicts_with[s.temp_ref]=s.conflicts_with.map(u=>r.resolve(u)?.cid??null)),(!s.title||!s.title.trim())&&g.push({code:"EMPTY_TITLE",detail:`${s.temp_ref}: title is empty`}),Ie.has(s.risk)||g.push({code:"BAD_RISK",detail:`${s.temp_ref}: risk ${JSON.stringify(s.risk)} not in high|med|low`});let j=we(s.cite?.anchor??""),Y=s.cite?.source_id!==void 0&&f.has(s.cite.source_id)?r.mediaOf(f.get(s.cite.source_id)):N;if(Y.format==="image"){if(j?.kind!=="img-whole"){g.push({code:s.cite?.anchor?"CITE_ANCHOR_INVALID":"MISSING_CITE",detail:`${s.temp_ref}: image cites are anchor-only (img#whole)`});continue}}else if(j?.kind==="img-part"){if(!(Y.images??[]).some(S=>S.ref===j.ref)){g.push({code:"CITE_ANCHOR_INVALID",detail:`${s.temp_ref}: anchor ${s.cite?.anchor} names no embedded image of this source version`});continue}}else if(!s.cite||!s.cite.anchor||!s.cite.quote){g.push({code:"MISSING_CITE",detail:`${s.temp_ref}: every derived use-case must cite anchor+quote`});continue}h.resolution==="edited"&&h.edit&&(h.edit.title!==void 0&&!h.edit.title.trim()&&g.push({code:"EMPTY_TITLE",detail:`${s.temp_ref}: edited title is empty`}),h.edit.risk!==void 0&&!Ie.has(h.edit.risk)&&g.push({code:"BAD_RISK",detail:`${s.temp_ref}: edited risk ${JSON.stringify(h.edit.risk)} invalid`}));let Ee=fe({title:h.edit?.title??s.title,description:s.description,summary:h.edit?.summary??s.summary,actors:s.actors,value:s.value,risk:h.edit?.risk??s.risk,...s.criteria&&s.criteria.length>0?{criteria:s.criteria.map(u=>u.text)}:{}}),b=ne("usecase",Ee),ve=s.cite.source_id??e.source.source_id,$e=f.get(ve);if(s.cite.source_id!==void 0&&$e===void 0){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: cite source ${JSON.stringify(ve)} is not in read_basis`});continue}let ee={source_id:ve,source_cid:$e??e.source.source_cid,anchor:s.cite.anchor,...s.cite.quote?{quote:s.cite.quote}:{}};if(s.matches_existing&&!r.hasNode(s.matches_existing.cid)){g.push({code:"UNKNOWN_MATCH",detail:`${s.temp_ref}: matches_existing ${s.matches_existing.cid} is not in the graph`});continue}let x=s.matches_existing?.cid??(r.hasNode(b)?b:null);if(x&&r.superseded.has(x)){let u=r.tipOf(x);x=r.superseded.has(u)?null:u}if(x&&s.matches_existing&&(_.matches_existing[s.temp_ref]=x),x&&s.matches_existing&&(r.trust.get(x)??null)==="derived"){let u=s.updated?.criteria??[];if(s.changed&&u.length>0&&_e(u)==="ops"&&(h.resolution==="approved"||h.resolution==="edited")){g.push({code:"UC_UNREVIEWED",detail:`${s.temp_ref}: merge target ${x.slice(0,19)} is unreviewed (derived) \u2014 bless it first (kane-cli context review) and re-propose the merge`});continue}let S=(t.probeHits??[]).find(y=>y.tempRef===s.temp_ref&&y.candidateCid===x);w.push({tempRef:s.temp_ref,candidate_cid:x,score:S?.score??1,scorer:S?.scorer??"lexical_fallback"}),x=null}if(x){if(s.changed&&(h.resolution==="approved"||h.resolution==="edited")){let u=s.updated;if(!u||Object.keys(u).length===0){g.push({code:"CHANGED_NEEDS_PAYLOAD",detail:`${s.temp_ref}: changed:true needs an updated{...} payload naming the moved fields`});continue}let S=r.getNode(x)?.content??{},y=u.criteria??[],V=y.length>0?_e(y):"flat";if(V==="mixed"){g.push({code:"CRITERIA_SHAPE_MIXED",detail:`${s.temp_ref}.updated.criteria mixes op-shaped (keep/set/remove) and {text, cite} entries \u2014 emit ONE shape for the whole array`});continue}if(V==="ops"){let U=y,H=S.criteria??[],q=g.length;Ve(s.temp_ref,U,H,g);for(let[de,ue]of U.entries())ue.op==="set"&&(!ue.cite||!ue.cite.anchor)&&g.push({code:"MISSING_CITE",detail:`${s.temp_ref}.updated.criteria[${de}]: a set op carries the proposing source's cite`});if(g.length>q)continue;let D=U.filter(de=>de.op!=="remove").map(de=>de.text),J=fe({title:h.edit?.title??u.title??String(S.title??s.title),...u.description??S.description?{description:u.description??S.description}:{},...h.edit?.summary??u.summary??S.summary?{summary:h.edit?.summary??u.summary??S.summary}:{},...u.actors??S.actors?{actors:u.actors??S.actors}:{},...u.value??S.value?{value:u.value??S.value}:{},risk:h.edit?.risk??u.risk??String(S.risk??s.risk),...D.length>0?{criteria:D}:{}}),Q=ne("usecase",J);if(Q!==x){for(let $ of ie("usecase",J))g.push({code:$.code,detail:`${s.temp_ref}: ${$.detail}`});G.push({cid:Q,label:se.USECASE,content:J});for(let $ of me(s)){let z=$.source_id??e.source.source_id,B=f.get(z);if(!B){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: cite source ${JSON.stringify(z)} is not in read_basis`});continue}let Z={source_id:z,source_cid:B,anchor:$.anchor,...$.quote?{quote:$.quote}:{}};P.push({ecid:K("DERIVES",B,Q,Z),type:O.DERIVES,src:B,dst:Q,props:Z})}let ue=he(r,x).flatMap($=>r.edgesInto($)).filter($=>$.type===O.DERIVES&&typeof $.props.claim=="string");for(let $ of U){if($.op!=="keep")continue;let z=new Set;for(let B of ue){let Z=B.props;if(Z.claim!==$.text)continue;let Ne=`${Z.source_id}|${Z.source_cid}|${Z.anchor}`;if(z.has(Ne))continue;z.add(Ne);let Re={...B.props};P.push({ecid:K("DERIVES",B.src,Q,Re),type:O.DERIVES,src:B.src,dst:Q,props:Re})}}for(let $ of U){if($.op!=="set")continue;let z=$.cite.source_id??e.source.source_id,B=f.get(z);if(!B){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: set cite source ${JSON.stringify(z)} is not in read_basis`});continue}let Z={source_id:z,source_cid:B,anchor:$.cite.anchor,...$.cite.quote?{quote:$.cite.quote}:{},claim:$.text};P.push({ecid:K("DERIVES",B,Q,Z),type:O.DERIVES,src:B,dst:Q,props:Z})}for(let $ of U)$.op==="remove"&&C.push({about:x,ref:$.ref,text:$.text,reason:$.reason});I(s.temp_ref,{resolution:"supersede",supersedeTarget:x,reason:h.reason??`criteria merge: ${e.source.source_id} (${U.filter($=>$.op==="keep").length} kept, ${U.filter($=>$.op==="set").length} set, ${U.filter($=>$.op==="remove").length} removed)`},Q),L.push({id:Q,kind:"review-item",resolution:h.resolution,edit:h.resolution==="edited"?{...h.edit}:null,reason:null,by:o});continue}}else{let U=y.map(D=>typeof D=="string"?{text:D,cite:void 0}:D),H=fe({title:h.edit?.title??u.title??String(S.title??s.title),...u.description??S.description?{description:u.description??S.description}:{},...h.edit?.summary??u.summary??S.summary?{summary:h.edit?.summary??u.summary??S.summary}:{},...u.actors??S.actors?{actors:u.actors??S.actors}:{},...u.value??S.value?{value:u.value??S.value}:{},risk:h.edit?.risk??u.risk??String(S.risk??s.risk),...u.criteria?U.length>0?{criteria:U.map(D=>D.text)}:{}:S.criteria?{criteria:S.criteria}:{}}),q=ne("usecase",H);if(q!==x){for(let D of ie("usecase",H))g.push({code:D.code,detail:`${s.temp_ref}: ${D.detail}`});G.push({cid:q,label:se.USECASE,content:H}),P.push({ecid:K("DERIVES",ee.source_cid,q,ee),type:O.DERIVES,src:ee.source_cid,dst:q,props:ee});for(let D of U){if(!D.cite)continue;let J={source_id:e.source.source_id,source_cid:e.source.source_cid,anchor:D.cite.anchor,...D.cite.quote?{quote:D.cite.quote}:{},claim:D.text};P.push({ecid:K("DERIVES",J.source_cid,q,J),type:O.DERIVES,src:J.source_cid,dst:q,props:J})}I(s.temp_ref,{resolution:"supersede",supersedeTarget:x,reason:h.reason??`matches-but-changed: ${e.source.source_id} moved (${Object.keys(u).join(", ")})`},q),L.push({id:q,kind:"review-item",resolution:h.resolution,edit:h.resolution==="edited"?{...h.edit}:null,reason:null,by:o});continue}for(let D of U){if(!D.cite)continue;let J={source_id:e.source.source_id,source_cid:e.source.source_cid,anchor:D.cite.anchor,...D.cite.quote?{quote:D.cite.quote}:{},claim:D.text};P.push({ecid:K("DERIVES",J.source_cid,x,J),type:O.DERIVES,src:J.source_cid,dst:x,props:J})}}}if(s.changed&&h.resolution==="skipped"){let u=s.updated?.criteria??[];u.length>0&&_e(u)==="ops"&&L.push({id:x,kind:"pending_update",resolution:"pending",edit:{temp_ref:s.temp_ref,source_id:e.source.source_id,updated:s.updated},reason:s.change_note??null,by:o})}if(h.resolution!=="rejected"){for(let u of me(s)){let S=u.source_id??e.source.source_id,y=f.get(S);if(!y){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: cite source ${JSON.stringify(S)} is not in read_basis`});continue}let V={source_id:S,source_cid:y,anchor:u.anchor,...u.quote?{quote:u.quote}:{}};P.push({ecid:K("DERIVES",y,x,V),type:O.DERIVES,src:y,dst:x,props:V})}(h.resolution==="approved"||h.resolution==="edited"||h.resolution==="supersede")&&L.push({id:x,kind:"review-item",resolution:"approved",edit:null,reason:null,by:o}),h.resolution==="supersede"&&I(s.temp_ref,h,x)}continue}for(let u of ie("usecase",Ee))g.push({code:u.code,detail:`${s.temp_ref}: ${u.detail}`});for(let u of pe(O.DERIVES,"source","usecase",ee))g.push({code:u.code,detail:`${s.temp_ref}: ${u.detail}`});G.push({cid:b,label:se.USECASE,content:Ee}),v.set(s.temp_ref,b),P.push({ecid:K("DERIVES",ee.source_cid,b,ee),type:O.DERIVES,src:ee.source_cid,dst:b,props:ee});for(let u of me(s).slice(1)){let S=u.source_id??e.source.source_id,y=f.get(S);if(!y){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: cite source ${JSON.stringify(S)} is not in read_basis`});continue}let V={source_id:S,source_cid:y,anchor:u.anchor,...u.quote?{quote:u.quote}:{}};for(let U of pe(O.DERIVES,"source","usecase",V))g.push({code:U.code,detail:`${s.temp_ref}: ${U.detail}`});P.push({ecid:K("DERIVES",y,b,V),type:O.DERIVES,src:y,dst:b,props:V})}for(let u of s.criteria??[]){let S=u.cite.source_id??e.source.source_id,y=f.get(S);if(!y){g.push({code:"CITE_SOURCE_UNKNOWN",detail:`${s.temp_ref}: criterion cite source ${JSON.stringify(S)} is not in read_basis`});continue}let V={source_id:S,source_cid:y,anchor:u.cite.anchor,...u.cite.quote?{quote:u.cite.quote}:{},claim:u.text};P.push({ecid:K("DERIVES",V.source_cid,b,V),type:O.DERIVES,src:V.source_cid,dst:b,props:V})}for(let u of s.depends_on_hint??[]){let S=H=>H.toLowerCase().trim().replace(/\s+/g," "),y=null,V=r.resolve(u);if(V&&!V.superseded&&r.nodeLabel.get(V.cid)===se.USECASE&&(y=V.cid),!y){for(let{cid:H,content:q}of r.byLabel(se.USECASE))if(!r.superseded.has(H)&&S(String(q.title??""))===S(u)){y=H;break}}if(!y){let H=G.find(q=>q.label===se.USECASE&&S(String(q.content.title??""))===S(u));H&&(y=H.cid)}!y||y===b||We(r,O.DEPENDS_ON,b,y,W)||W.some(H=>H.src===b&&H.dst===y)||(P.push({ecid:K(O.DEPENDS_ON,b,y,{reason:"extract hint"}),type:O.DEPENDS_ON,src:b,dst:y,props:{reason:"extract hint"}}),W.push({src:b,dst:y,type:O.DEPENDS_ON}),(_.depends_on_hint[s.temp_ref]??=[]).push(y))}if((h.resolution==="approved"||h.resolution==="edited"||h.resolution==="supersede")&&r.superseded.get(b)===null&&!l.has(b)&&X.push({kind:"node",old:b,new:b,reason:`re-minted after tombstone via review by ${o.id}`,by:o}),n){let u=Ae("usecase",S=>m.has(S),r.names.keys());u!==null&&!r.nameOf.has(b)&&(m.add(u),oe.push({cid:b,slug:u,by:o}))}h.resolution==="approved"?L.push({id:b,kind:"review-item",resolution:"approved",edit:null,reason:null,by:o}):h.resolution==="edited"?L.push({id:b,kind:"review-item",resolution:"edited",edit:{...h.edit},reason:null,by:o}):h.resolution==="rejected"?L.push({id:b,kind:"review-item",resolution:"rejected",edit:null,reason:h.reason??null,by:o}):h.resolution==="supersede"&&(L.push({id:b,kind:"review-item",resolution:"approved",edit:null,reason:h.reason??null,by:o}),I(s.temp_ref,h,b))}if(g.length)return{record:null,errors:g};let R=new Date().toISOString(),F=(e.sources?.length??0)>1||(e.extraction_claims?.length??0)>0,A;if(F){let s=[];if(e.extraction_claims==null)s.push({source_id:e.source.source_id,source_cid:e.source.source_cid,completeness:"complete",...a?{extractor_version:a}:{},at:R});else{let h=new Map(e.extraction_claims.map(j=>[j.source_id,j.completeness]));for(let j of e.sources??[e.source]){let Y=h.get(j.source_id)??null;Y!==null&&s.push({source_id:j.source_id,source_cid:j.source_cid,completeness:Y,...a?{extractor_version:a}:{},at:R})}}A=s}else A=e.source.source_cid;let k=[];for(let s of t.probeHits??[])k.push({...v.has(s.tempRef)?{new_cid:v.get(s.tempRef)}:{},candidate_cid:s.candidateCid,score:s.score,scorer:s.scorer,probe_basis:null});for(let s of w){let h=v.get(s.tempRef);k.some(j=>j.new_cid===h&&j.candidate_cid===s.candidate_cid)||k.push({...h!==void 0?{new_cid:h}:{},candidate_cid:s.candidate_cid,score:s.score,scorer:s.scorer,probe_basis:null})}let M=t.eventIds&&t.eventIds.length>0?t.eventIds:t.sid?Ye(r,t.sid,"extract",1):void 0;return{record:re(i,{ts:R,proposal_id:c,...c!=null?{extraction_of:A}:{},...c!=null&&a?{extractor_version:a}:{},...C.length>0?{criteria_removed:C}:{},...k.length>0?{dedup_hits:k}:{},nodes:G,edges:P,review:L,supersessions:X,...oe.length>0?{names:oe}:{},...t.judgements&&t.judgements.length>0?{judgements:t.judgements}:{},...M?{event_ids:M}:{},...t.sid?{sid:t.sid}:{},source_head_moves:{}},{expectPrev:E,intent:{v:1,verb:"extract",args:te({proposal:e,proposalId:c,verdicts:Object.fromEntries(p),by:o,flags:{allowStaleBasis:d??null,autoName:n??null,extractorVersion:a??null,sid:t.sid??null},judgements:t.judgements??null,probeHits:t.probeHits??null,eventIds:M??null}),pins:_},provenance:t.provenance}).record,errors:null}}function Ot(t){let{contextDir:i,graph:r,verdicts:e,by:c}=t,p=[],o=[],d=[],a=[],n=[],E=new Set,f={verdicts:{},supersedeTarget:{}},_=new Map;for(let[C,v]of e){if(v.resolution!=="edited")continue;let w=r.resolve(C);if(!w||w.superseded)continue;let N=r.getNode(w.cid);if(!N)continue;let T={...N.content,...v.edit?.title!==void 0?{title:v.edit.title}:{},...v.edit?.summary!==void 0?{summary:v.edit.summary}:{},...v.edit?.risk!==void 0?{risk:v.edit.risk}:{}};if(ie(N.label,T).length>0)continue;let G=ne(N.label,T);G===w.cid||Ce(r,w.cid,G)||_.set(w.cid,G)}for(let[C,v]of e){if(v.resolution==="skipped")continue;let w=r.resolve(C);if(!w){p.push({code:"UNKNOWN_NODE",detail:`${C} names nothing in the graph`});continue}if(w.superseded){p.push({code:"SUPERSEDED_TARGET",detail:`${C} is superseded \u2014 review the tip (${w.tip})`});continue}let N=w.cid;if(f.verdicts[C]=N,v.resolution==="approved")a.push({id:N,kind:"review-item",resolution:"approved",edit:null,reason:null,by:c});else if(v.resolution==="rejected")t.holdArchives?a.push({id:N,kind:"pending_archive",resolution:"pending",edit:null,reason:v.reason??null,by:c}):a.push({id:N,kind:"review-item",resolution:"rejected",edit:null,reason:v.reason??null,by:c});else if(v.resolution==="edited"){if(E.has(N)){p.push({code:"DUPLICATE_TARGET",detail:`${C}: this node was already superseded by another verdict in this batch \u2014 one verdict per node`});continue}let T=r.getNode(N);if(!T){p.push({code:"UNKNOWN_NODE",detail:`${C}: node file unreadable`});continue}let G={...T.content,...v.edit?.title!==void 0?{title:v.edit.title}:{},...v.edit?.summary!==void 0?{summary:v.edit.summary}:{},...v.edit?.risk!==void 0?{risk:v.edit.risk}:{}},P=ie(T.label,G);if(P.length>0){for(let X of P)p.push({code:X.code,detail:`${C}: ${X.detail}`});continue}let W=ne(T.label,G);if(W===N){a.push({id:N,kind:"review-item",resolution:"approved",edit:null,reason:null,by:c});continue}if(Ce(r,N,W)){p.push({code:"SUPERSEDE_CYCLE",detail:`${C}: edit reproduces an already-superseded version (supersession cycle guard) \u2014 re-edit forward or redesign`});continue}let L=Me({graph:r,oldTip:N,newCid:W,newLabel:T.label,by:c,reason:`re-blessed onto ${W} (edited in review)`,dstRedirect:_});if(L.errors.length>0){for(let X of L.errors)p.push({code:"REBLESS_REFUSED",detail:`${C}: ${X}`});continue}o.push({cid:W,label:T.label,content:G}),d.push(...L.edges),E.add(N),n.push({kind:"node",old:N,new:W,reason:v.reason??"edited in review",by:c}),n.push(...L.supersessions),a.push({id:W,kind:"review-item",resolution:"edited",edit:{...v.edit},reason:null,by:c})}else if(v.resolution==="supersede"){let T=Pe(r,v.supersedeTarget,N,E);if("error"in T){p.push({code:T.error.code,detail:`${C}: ${T.error.detail}`});continue}E.add(T.targetCid),f.supersedeTarget[C]=T.targetCid,t.holdArchives?a.push({id:T.targetCid,kind:"pending_archive",resolution:"pending",edit:null,reason:`supersede by ${N}${v.reason?` \u2014 ${v.reason}`:""}`,by:c}):(n.push({kind:"node",old:T.targetCid,new:N,reason:v.reason??`superseded via review by ${c.id}`,by:c}),a.push({id:N,kind:"review-item",resolution:"approved",edit:null,reason:v.reason??null,by:c}))}}return p.length?{record:null,errors:p}:a.length===0&&n.length===0?{record:null,errors:[{code:"NO_VERDICTS",detail:"every item was skipped \u2014 nothing to commit"}]}:{record:re(i,{ts:new Date().toISOString(),proposal_id:null,nodes:o,edges:d,review:a,supersessions:n,source_head_moves:{}},{expectPrev:r.latestHash,intent:{v:1,verb:"review",args:te({verdicts:Object.fromEntries(e),by:c,holdArchives:t.holdArchives??null}),pins:f},provenance:t.provenance}).record,errors:null}}function wt(t){let{contextDir:i,graph:r,survivor:e,merged:c,reason:p,by:o}=t,d=r.resolve(e),a=r.resolve(c);return d?a?d.superseded||a.superseded?{record:null,errors:[{code:"ALREADY_SUPERSEDED",detail:"a side of the pair is already superseded \u2014 the pair is drained"}]}:d.cid===a.cid?{record:null,errors:[{code:"SELF_SUPERSEDE",detail:"a pair cannot merge a node into itself"}]}:{record:re(i,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[{kind:"node",old:a.cid,new:d.cid,reason:p??`pair merge: duplicate of ${e}`,by:o}],source_head_moves:{}},{expectPrev:r.latestHash,intent:{v:1,verb:"pair-merge",args:te({survivor:e,merged:c,reason:p??null,by:o}),pins:{survivor:d.cid,merged:a.cid}},provenance:t.provenance}).record,errors:null}:{record:null,errors:[{code:"UNKNOWN_NODE",detail:`${c} names nothing in the graph`}]}:{record:null,errors:[{code:"UNKNOWN_NODE",detail:`${e} names nothing in the graph`}]}}function Tt(t){let{contextDir:i,graph:r,assignments:e,by:c}=t,p=new Set(t.reassign??[]),o=[],d=[],a=new Set,n={};for(let{ref:f,slug:_}of e){if(!le.test(_)){o.push({code:"BAD_SLUG",detail:`${JSON.stringify(_)} \u2014 slugs are kebab-case ${String(le)}`});continue}let g=r.resolve(f);if(!g){o.push({code:"UNKNOWN_REF",detail:`${f} names nothing in the graph`});continue}if(g.superseded){o.push({code:"SUPERSEDED_TARGET",detail:`${f} is superseded \u2014 name the tip instead (${g.tip})`});continue}let C=r.names.get(_);if(C!==void 0&&!r.superseded.has(C)&&C!==g.cid&&!p.has(_)||a.has(_)){o.push({code:"SLUG_TAKEN",detail:`${_} already names ${C??"another node in this record"}`});continue}a.add(_),n[f]=g.cid,d.push({cid:g.cid,slug:_,by:c})}return o.length?{record:null,errors:o}:d.length===0?{record:null,errors:[{code:"NO_ASSIGNMENTS",detail:"nothing to name"}]}:{record:re(i,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],names:d,source_head_moves:{}},{expectPrev:r.latestHash,intent:{v:1,verb:"names",args:te({assignments:e,by:c,...t.reassign&&t.reassign.length>0?{reassign:t.reassign}:{}}),pins:{refs:n}},provenance:t.provenance}).record,errors:null}}function Dt(t){let{contextDir:i,graph:r,sourceId:e,reason:c,by:p}=t,o=r.heads.get(e);return o===void 0?{record:null,errors:[{code:"UNKNOWN_SOURCE",detail:`no source ${e} in the graph`}]}:o===null?{record:null,errors:[{code:"ALREADY_RETIRED",detail:`source ${e} is already retired`}]}:{record:re(i,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[{kind:"node",old:o,new:null,reason:c??`retired source ${e}`,by:p}],source_head_moves:{[e]:null},names:[]},{expectPrev:r.latestHash,intent:{v:1,verb:"retire",args:te({sourceId:e,reason:c??null,by:p}),pins:{head:o}},provenance:t.provenance}).record,errors:null}}function kt(t){let i=ie("gap",t.content);if(i.length>0)return{ok:!1,refusal:`defer gap failed schema validation: ${i.map(p=>p.detail).join("; ")}`};let r=ne("gap",t.content),e={reason:"reconcile change deferred"},c=t.annotates?[{ecid:K(O.ANNOTATES,r,t.annotates,e),type:O.ANNOTATES,src:r,dst:t.annotates,props:e}]:[];for(let p=0;;p++)try{return re(t.contextDir,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:r,label:"gap",content:t.content}],edges:c,review:[],supersessions:[],source_head_moves:{}},{expectPrev:ge(t.contextDir),intent:{v:1,verb:"gap",args:te({content:t.content,annotates:t.annotates??null}),pins:{annotates:t.annotates??null}},provenance:t.provenance}),{ok:!0,cid:r}}catch(o){if(o instanceof Se){if(p<3)continue;return{ok:!1,refusal:"concurrent activity kept moving the store \u2014 try the card again"}}throw o}}function At(t){let i=t.graph.byLabel("gap").filter(r=>(t.gaps===void 0||t.gaps.includes(r.cid))&&r.content.kind==="reconcile_deferred"&&typeof r.content.uc=="string"&&t.graph.tipOf(r.content.uc)===t.targetTip&&(t.sourceId===void 0||r.content.basis?.source_id===void 0||r.content.basis.source_id===t.sourceId)&&!t.graph.superseded.has(r.cid)&&t.graph.trust.get(r.cid)!=="archived");if(i.length===0)return{resolved:0};for(let r=0;;r++)try{return re(t.contextDir,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:i.map(e=>({kind:"node",old:e.cid,new:t.resolvedBy,reason:"reconcile change resolved by a later verdict",by:t.by})),source_head_moves:{}},{expectPrev:ge(t.contextDir),intent:{v:1,verb:"gap-close",args:te({targetTip:t.targetTip,resolvedBy:t.resolvedBy,sourceId:t.sourceId??null,by:t.by}),pins:{gaps:i.map(e=>e.cid)}},provenance:t.provenance}),{resolved:i.length}}catch(e){if(e instanceof Se){if(r<3)continue;return{resolved:0}}throw e}}export{ye as a,Ce as b,Me as c,le as d,We as e,Rt as f,me as g,_e as h,Ve as i,bt as j,Je as k,Ye as l,Xe as m,xt as n,Ot as o,wt as p,Tt as q,Dt as r,kt as s,At as t,Ge as u,Le as v,Ze as w,ke as x,Ae as y,ot as z,He as A,ct as B,he as C};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R}from"./chunk-
|
|
2
|
+
import{a as R}from"./chunk-GIC56KI3.js";import{y as i}from"./chunk-PHR2OSWD.js";import{a as Y}from"./chunk-HCBYKLMW.js";import{a,b as l,i as X}from"./chunk-C44QQJR4.js";import{a as K}from"./chunk-6YGTRKDT.js";import{e as P}from"./chunk-UR6MHSHU.js";var x=P(K(),1);var e=P(Y(),1),f=5;function Z(t,S){if(!S)return t;let c=S.toLowerCase();return t.filter(B=>B.label.toLowerCase().includes(c))}function Q(t){let{title:S,items:c,loading:B=!1,loadingText:p,error:L=null,itemNoun:v="items",onSelect:O,onCancel:E,defaultActiveId:w,onTab:y,extraHint:H}=t,[g,s]=(0,x.useState)(0),[h,u]=(0,x.useState)(0),[d,A]=(0,x.useState)(""),[C,I]=(0,x.useState)(null),N=!t.onSearch&&d!=="";(0,x.useEffect)(()=>{if(c.length===0||N)return;if(t.preserveSelectionById&&C!==null){let o=c.findIndex(n=>n.id===C);if(o>=0){u(Math.floor(o/f)),s(o%f);return}}let r=w?c.findIndex(o=>o.id===w):c.findIndex(o=>o.isActive);r>=0?(u(Math.floor(r/f)),s(r%f),t.preserveSelectionById&&I(c[r].id)):t.preserveSelectionById&&(u(0),s(0),I(c[0]?.id??null))},[c,w,t.preserveSelectionById,C,N]),(0,x.useEffect)(()=>{if(!t.onSearch)return;let r=setTimeout(()=>t.onSearch(d),t.searchDebounceMs??250);return()=>clearTimeout(r)},[d,t.onSearch,t.searchDebounceMs]);let b=t.onSearch?c:Z(c,d),D=h*f,F=Math.min(D+f,b.length),M=Math.ceil(b.length/f),$=F-D,T=b.slice(D,F);return X((r,o)=>{if(L){o.escape&&E();return}if(o.escape){d?(A(""),s(0),u(0)):E();return}if(o.tab&&y){y();return}if(o.upArrow){if(g>0){let n=g-1;s(n),t.preserveSelectionById&&I(T[n]?.id??null)}else if(h>0){let n=h-1,m=f-1;u(n),s(m),t.preserveSelectionById&&I(b[n*f+m]?.id??null)}return}if(o.downArrow){if(g<$-1){let n=g+1;s(n),t.preserveSelectionById&&I(T[n]?.id??null)}else if(h<M-1){let n=h+1,m=0;u(n),s(m),t.preserveSelectionById&&I(b[n*f+m]?.id??null)}return}if(o.return&&T[g]){if(T[g].disabled)return;O(T[g]);return}if(o.backspace||o.delete){A(n=>n.slice(0,-1)),s(0),u(0);return}r&&!o.ctrl&&!o.meta&&(A(n=>n+r),s(0),u(0))},{isActive:!B}),B?(0,e.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:i.orange,paddingX:2,paddingY:1,children:[(0,e.jsx)(l,{color:i.orange,bold:!0,children:S}),(0,e.jsx)(a,{marginTop:1,children:(0,e.jsx)(l,{color:i.secondary,children:p??`Loading ${v}\u2026`})})]}):L?(0,e.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:i.red,paddingX:2,paddingY:1,children:[(0,e.jsx)(l,{color:i.red,bold:!0,children:S}),(0,e.jsx)(a,{marginTop:1,children:(0,e.jsx)(l,{color:i.red,children:L})}),(0,e.jsx)(R,{bindings:[]})]}):(0,e.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:i.orange,paddingX:2,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(l,{color:i.orange,bold:!0,children:S}),(0,e.jsxs)(l,{color:i.dim,children:[" (",b.length,!t.onSearch&&d?`/${c.length}`:""," ",v,t.loadingMore?" \xB7 loading more":"",")"]})]}),(0,e.jsxs)(a,{marginTop:1,children:[(0,e.jsx)(l,{color:i.secondary,children:d?"filter: ":""}),d?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l,{children:d}),(0,e.jsx)(l,{inverse:!0,children:" "})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(l,{color:i.dim,children:["Search ",v,"\u2026"]}),(0,e.jsx)(l,{inverse:!0,children:" "})]})]}),(0,e.jsx)(a,{flexDirection:"column",marginTop:1,children:t.searching?(0,e.jsxs)(l,{color:i.secondary,children:["Searching ",v,"\u2026"]}):b.length===0?(0,e.jsxs)(l,{color:i.dim,children:["No ",v,' match "',d,'"']}):T.map((r,o)=>{let n=o===g,m=n?"\u276F ":" ",G=r.disabled?i.muted:r.isActive?i.green:n?i.orange:void 0;return(0,e.jsxs)(a,{flexDirection:"column",children:[(0,e.jsxs)(l,{color:G,children:[m,r.label,r.isActive&&!r.disabled?" \u25CF selected":""]}),n&&r.disabled&&r.disabledHint&&(0,e.jsxs)(l,{color:i.red,children:[" ",r.disabledHint]})]},r.id)})}),!t.searching&&M>1&&(0,e.jsx)(a,{marginTop:1,children:(0,e.jsxs)(l,{color:i.dim,children:["Page ",h+1,"/",M]})}),t.footer&&(0,e.jsx)(a,{marginTop:1,flexDirection:"column",children:t.footer}),(0,e.jsx)(R,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"type",label:"to search"},{keys:"\u21B5",label:"select"},...y&&H?[{keys:"tab",label:H}]:[]],escBackLabel:d?"clear":"back to chat"})]})}export{Q as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as w}from"./chunk-CAOZKSQ3.js";import{b,c as v}from"./chunk-VZ7KXRXB.js";import{b as $}from"./chunk-
|
|
2
|
+
import{d as w}from"./chunk-CAOZKSQ3.js";import{b,c as v}from"./chunk-VZ7KXRXB.js";import{b as $}from"./chunk-RDHWNSDP.js";import{b as E}from"./chunk-FQNQVC5O.js";var _=new Set(["delta","state-transition"]),N=/^capture baseline:/i;function R(e){return typeof e=="string"?e:e.text}function j(e){return typeof e=="object"&&e.baseline===!0||N.test(R(e).trim())}function T(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"derived"in e}function M(e,i){if(e.check_prose)return e.check_prose;let t=i.find(o=>o.ref===e.check.verified_against),n=t?.text?` \u2014 the stated promise: ${t.text}`:"",s=String(e.check.operand??e.check.within??e.check.metric??"");return e.check.kind==="forbidden-presence"?`Confirm '${s}' does NOT appear (forbidden-presence)${n}`:`Confirm ${e.check.kind} check: ${s} (${e.check.operator})${n}`}var F=/^## Step \d+ — assert\s*$/;function ae(e,i){let t=e.split(`
|
|
3
3
|
`),n=!1;for(let s=0;s<t.length;s++){let o=/^(##\s.*?)\s@verifies\s+(.+?)\s*$/.exec(t[s]);if(!o)continue;n=!0;let c=o[2].split(",").map(a=>a.trim()).filter(Boolean).map(a=>{let r=i(a)??(a.startsWith("ac-")?a:null);if(!r)throw new Error(`@verifies ref '${a}' does not resolve to a committed AC`);return r});t[s]=`${o[1]} @verifies ${c.join(", ")}`}return{md:t.join(`
|
|
4
4
|
`),tagged:n}}function de(e,i){if(i.length!==0&&!e.split(`
|
|
5
5
|
`).some(t=>/^##\s/.test(t)&&w.test(t)))throw new Error("generated body has no @verifies binding for its ACs \u2014 the emitter contract is broken")}function ue(e){let i=e.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as h}from"./chunk-
|
|
2
|
+
import{a as h}from"./chunk-EIMHIZKF.js";import{a as f}from"./chunk-MDM2LJFN.js";import{a as m}from"./chunk-VIYV6NIW.js";var i=class extends Error{constructor(a,l){super(a);this.code=l;this.name="AuthError"}};async function k(c){let{creds:o,env:a,usernameFlag:l,accessKeyFlag:g,log:t}=c,e=null,u=null;if(l&&g)e={username:l,access_key:g},t("info","AUTH_RESOLVE_FLAGS","Auth resolved via CLI flags",{username:l});else{let r=o.resolveAuth();r?.method==="basic"&&(e={username:r.username,access_key:r.access_key},t("info","AUTH_RESOLVE_CONFIG","Auth resolved via config",{username:r.username}))}if(!e){let{credentials:r,profile:E}=o.getActiveCredentials();if(!r)throw new i("Not authenticated \u2014 no credentials found","not_authenticated");if(u=r.access_token,r.expires_at-Date.now()/1e3<300)try{let n=await f({creds:o,profile:E,env:a,credentials:r});n&&(u=n.accessToken,t("info","AUTH_TOKEN_REFRESHED","OAuth token refreshed"))}catch(n){let d=n instanceof Error?n.message:String(n);throw t("error","TOKEN_REFRESH_FAILED","Token refresh failed",{error:d}),new i(`Token refresh failed: ${d}`,"refresh_failed")}}let v=m(a),b=async()=>u,y=e?{username:e.username,access_key:e.access_key}:null,p=new h(v.controllerBaseUrl,b,y,t),s=await p.resolve();return s&&!e&&(e={username:s.username,access_key:s.access_key},t("info","AUTH_RESOLVE_CONTROLLER","Auth resolved via controller",{username:s.username})),{basicAuth:e,token:u,resolver:p,resolvedCreds:s}}export{i as a,k as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as Bt}from"./chunk-ZMNJBUAO.js";import{f as tr}from"./chunk-W5TTF7GB.js";import{a as Ft}from"./chunk-I7TIGB7K.js";import{a as te,c as Yt,e as Zt,f as qe,g as Qt,h as nr}from"./chunk-
|
|
2
|
+
import{b as Bt}from"./chunk-ZMNJBUAO.js";import{f as tr}from"./chunk-W5TTF7GB.js";import{a as Ft}from"./chunk-I7TIGB7K.js";import{a as te,c as Yt,e as Zt,f as qe,g as Qt,h as nr}from"./chunk-KMF2PPJ5.js";import{a as Xt,b as rr,c as sr,d as ir,e as dt,f as or}from"./chunk-D7WG7SRA.js";import{a as ke,b as qt,c as Gt,d as Lt,e as Vt}from"./chunk-SDJNWR4D.js";import{a as zt}from"./chunk-U6OTFMIT.js";import{a as Kt,b as Jt}from"./chunk-BZAGVBCX.js";import{c as Wt}from"./chunk-V4B5QA3U.js";import{b as Nt}from"./chunk-YKTYVJBN.js";import{a as Ht,e as jt}from"./chunk-FY7TCYPK.js";import{a as er}from"./chunk-63DYVWNX.js";import{i as Mt}from"./chunk-7N6OCHPC.js";import{a as $e,b as ct}from"./chunk-KDNNMU7Q.js";import{e as Ut}from"./chunk-AIR2WVXM.js";import{a as Fe}from"./chunk-AG2MVCNK.js";import{a as Se}from"./chunk-VVOKM2VO.js";import{c as nt}from"./chunk-5LJRZI7S.js";import{j as be,n as Be,z as ee}from"./chunk-IICT4VOU.js";import{H as It,b as Ot}from"./chunk-RDHWNSDP.js";import{f as at}from"./chunk-FQNQVC5O.js";import{f as me}from"./chunk-XLSOQLVT.js";import{a as At}from"./chunk-5EOX4MEY.js";import{appendFileSync as wr,mkdirSync as ut,rmdirSync as br,writeFileSync as lt}from"fs";import{dirname as mr,extname as Sr,join as ce}from"path";var X=class extends Error{code;constructor(e,a){super(`${e}: ${a}`),this.name="ProposalAdapterError",this.code=e}};function cr(r){return r.version===2}var ar=8;function vr(r){let e=/^extract@(\d+)$/.exec(r??"");return e?Number.parseInt(e[1],10):null}var yr=r=>typeof r=="object"&&r!==null&&"op"in r;function Ge(r,e,a){return{anchor:r.anchor,quote:r.quote,...a||r.source_id!==e?{source_id:r.source_id}:{}}}function dr(r,e,a={}){let m=vr(a.templateVersion),x=m!==null&&m>=5,_=m!==null&&m<5,y=r.archived!=null&&r.archived.length>0&&m!==null&&m<5;if(y&&a.warn?.(`dropped ${r.archived.length} archive op(s): the bound extract template @${m} never described archiving \u2014 nothing was archived; the use-cases still land`),!x&&r.read_basis.length!==1)throw new X("READ_BASIS_COUNT",`read_basis must have exactly 1 element, got ${r.read_basis.length}`);if(r.read_basis.length===0)throw new X("READ_BASIS_COUNT","read_basis must not be empty");let v=r.read_basis[0],h=r.read_basis.length>1,$=r.use_cases.map(i=>{if(_&&i.cite.length!==1)throw new X("CITE_COUNT",`${i.temp_ref}: cite must have exactly 1 element, got ${i.cite.length}`);if(i.cite.length<1||i.cite.length>ar)throw new X("CITE_COUNT",`${i.temp_ref}: 1..${ar} cites allowed, got ${i.cite.length}`);let M=(f,re)=>{if(!x&&f!==v.source_id)throw new X("SOURCE_MISMATCH",`${re}: cite source ${f} != read_basis source ${v.source_id} (single-source)`)};M(i.cite[0].source_id,i.temp_ref);let P=i.cite.map(f=>(M(f.source_id,i.temp_ref),Ge(f,v.source_id,x&&(h||f.source_id!==v.source_id)))),l=(i.updated?.criteria??[]).some(yr);if(!x&&l)throw new X("CRITERIA_OPS_UNSUPPORTED",`${i.temp_ref}: op-union updated.criteria (keep/set/remove) needs an extract@5+ binding \u2014 this session is bound to ${a.templateVersion??"an unversioned template"}`);return{temp_ref:i.temp_ref,title:i.title,...i.description!==void 0?{description:i.description}:{},...i.summary!==void 0?{summary:i.summary}:{},...i.actors!==void 0?{actors:i.actors}:{},...i.value!==void 0?{value:i.value}:{},risk:i.risk,cite:P[0],...P.length>1?{cites:P}:{},...i.criteria!=null&&i.criteria.length>0?{criteria:i.criteria.map((f,re)=>(M(f.cite.source_id,`${i.temp_ref}.criteria[${re}]`),{text:f.text,cite:Ge(f.cite,v.source_id,x&&f.cite.source_id!==v.source_id)}))}:{},depends_on_hint:i.depends_on_hint,matches_existing:i.matches_existing,...i.conflicts_with!=null?{conflicts_with:i.conflicts_with}:{},...i.changed?{changed:!0}:{},...i.updated!=null?{updated:{...i.updated.title!=null?{title:i.updated.title}:{},...i.updated.description!=null?{description:i.updated.description}:{},...i.updated.summary!=null?{summary:i.updated.summary}:{},...i.updated.actors!=null?{actors:i.updated.actors}:{},...i.updated.value!=null?{value:i.updated.value}:{},...i.updated.risk!=null?{risk:i.updated.risk}:{},...i.updated.criteria!=null?{criteria:l?i.updated.criteria.map(f=>f.op==="set"?{op:"set",text:f.text,cite:Ge(f.cite,v.source_id,x&&f.cite.source_id!==v.source_id)}:f.op==="keep"?{op:"keep",ref:f.ref,text:f.text}:{op:"remove",ref:f.ref,text:f.text,reason:f.reason}):i.updated.criteria.map((f,re)=>(M(f.cite.source_id,`${i.temp_ref}.updated.criteria[${re}]`),{text:f.text,cite:Ge(f.cite,v.source_id,x&&f.cite.source_id!==v.source_id)}))}:{}}}:{},...i.change_note!=null?{change_note:i.change_note}:{}}});return{version:1,read_basis:e,source:{source_id:v.source_id,source_cid:v.source_cid},use_cases:$,...h?{sources:r.read_basis.map(i=>({source_id:i.source_id,source_cid:i.source_cid}))}:{},...r.extraction_of!=null&&r.extraction_of.length>0?{extraction_claims:r.extraction_of.map(i=>({source_id:i.source_id,completeness:i.completeness}))}:{},...r.archived!=null&&r.archived.length>0&&!y?{archived:r.archived.map(i=>({target:i.target,reason:i.reason,basis:i.basis}))}:{}}}function ur(r){let{contextDir:e,graph:a}=r,m=r.maxDigestBytes??4096,x={},_=[];for(let[h,$]of a.heads){if(x[h]=$,typeof $!="string")continue;let i=a.mediaOf($),M=a.getNode($)?.content?.blob;if(typeof M=="string")if(i.format==="image")_.push({source_id:h,cid:$,format:"image",blobRef:{path:Se(e,M),cid:M}});else{let P=$e(e,a,$)?.toString("utf8")??"";_.push({source_id:h,cid:$,format:i.format,text:P})}}_.sort((h,$)=>h.source_id<$.source_id?-1:1);let y=[];for(let h of a.byLabel(me.STYLENOTE).sort(($,i)=>$.cid<i.cid?-1:1))a.superseded.has(h.cid)||y.push(`\u2022 ${String(h.content.statement)} [${String(h.content.learned_from_kind)}]`);let v="";for(let h of y){if(Buffer.byteLength(v+h+`
|
|
3
3
|
`,"utf8")>m)break;v+=h+`
|
|
4
4
|
`}return{read_basis:x,sources:_,styleNoteDigest:v}}function lr(r,e){let a=ur({contextDir:r,graph:e}).styleNoteDigest;return a.length>0?a:void 0}function mt(r,e,a,m,x){let _=null,y=()=>_??=x&&Object.keys(x).length>0?Promise.resolve(x):Ut().catch(()=>({}));return{contextDir:r,rootSid:e,locks:at(r,e),probe:m??Ft(r,{resolveAlias:async v=>qt(v,{env:process.env,auth:await y()}),embed:async(v,h)=>Gt(v,h,{env:process.env,auth:await y()}),readVector:(v,h)=>Lt(r,v,h),writeVector:(v,h,$)=>Vt(r,v,h,$)}),...a?.length?{reservedEventIds:a}:{}}}function ht(r,e){let a=[],m=[];for(let x of r.use_cases){let _=x.matches_existing;_?.cid&&e.hasNode(_.cid)?a.push({ref:_.cid,expectedTip:e.tipOf(_.cid)}):m.push({tempRef:x.temp_ref,title:String(x.title??""),probeText:String(x.title??"")})}return{verb:"extract",ucTargets:a,newBuCandidates:m,sourcePins:[{source_id:r.source.source_id,source_cid:r.source.source_cid}],readBasis:r.read_basis??null}}function $r(r,e){let a=(r.images??[]).filter(m=>m.delivery==="selected");if(a.length!==0)return a.map(m=>({ref:m.ref,...m.page!==void 0?{page:m.page}:{},...m.loc!==void 0?{loc:m.loc}:{},media_type:m.media_type,blob_ref:{path:Se(e,m.blob),cid:m.blob}}))}function kr(r){return r.length>8&&r[0]===137&&r[1]===80&&r[2]===78&&r[3]===71?"image/png":r.length>3&&r[0]===255&&r[1]===216&&r[2]===255?"image/jpeg":r.length>12&&r.toString("ascii",0,4)==="RIFF"&&r.toString("ascii",8,12)==="WEBP"?"image/webp":null}function Le(r){return r.toISOString().replace(/[-:]/g,"").slice(0,15)}function hr(r){return r.startsWith("su-conv-")?`conv-${Ot(Buffer.from(r,"utf8")).slice(0,8)}`:r}function pr(r){return r.source_id.startsWith("su-conv-")?"the conversation":r.source_id}function Rr(r,e,a){return`reading ${pr(r)}${a>1?` (source ${e} of ${a})`:""}`}function Re(r){return r.toLowerCase().trim().replace(/\s+/g," ")}function gr(r,e){let a=new Map,m=new Map,x=new Map;for(let{cid:y,content:v}of e.byLabel(me.USECASE)){if(e.superseded.has(y))continue;(e.trust.get(y)==="archived"?x:m).set(Re(String(v.title??"")),y)}let _=y=>e.trust.get(y)==="archived"?{cid:y,archived:!0,reason:e.archivedReason.get(y)}:{cid:y};for(let y of r.use_cases){if(y.matches_existing){let $=y.matches_existing.cid;if(e.superseded.has($)){let i=e.tipOf($);$=e.superseded.has(i)?null:i}if($!==null){a.set(y.temp_ref,_($));continue}}let v=m.get(Re(y.title));if(v){a.set(y.temp_ref,{cid:v});continue}let h=x.get(Re(y.title));h&&a.set(y.temp_ref,_(h))}return a}var fr=/^(\S+)\.criteria\[(\d+)\]/;function Cr(r,e,a){if(e.length===0||!e.every(x=>fr.test(x.detail)))return!1;let m=new Map;for(let x of e){let _=fr.exec(x.detail),y=m.get(_[1])??new Set;y.add(Number(_[2])),m.set(_[1],y)}for(let x of r.use_cases){let _=m.get(x.temp_ref);_?.size&&(x.criteria=(x.criteria??[]).filter((y,v)=>!_.has(v)),a(`${x.temp_ref}: dropped ${_.size} criteria with unverifiable cites \u2014 committed without them (criteria are hints, not oracles)`))}return!0}async function gt(r,e,a,m,x=()=>{},_,y){let v=(h,$)=>x(h,$,r.session_id);return Zt(r,e,a,m,x,{async onProposalEvent(h){let $=h,i=null,M=null;if(cr($))try{i=dr($,r.read_basis,{templateVersion:y?.()??null,warn:P=>{e.out(`warning: ${P}`),v("adapter",{warn:P})}}),v("adapter",{ok:!0,use_cases:i.use_cases.length})}catch(P){M=P instanceof X?P.message:String(P),v("adapter",{ok:!1,error:M})}else i=$;return i&&i.use_cases.length===0&&(e.out("warning: the agent proposed ZERO use-cases for this source"),e.emit?.({type:"warning",code:"ZERO_USE_CASES",message:"the agent proposed ZERO use-cases for this source"})),i&&_&&await _(i),{proposal:i,error:M}}})}var Dr=new Set(["agent","ci","override"]);async function Ss(r,e){let a=`ext-${Le(e.now?.()??new Date)}-lk${Math.random().toString(36).slice(2,8)}`,x=at(e.contextDir,a,e.now?{now:e.now}:void 0).tryAcquire([{kind:"extract"}],{hold:"session",verb:"extract"});if("contended"in x){let _=x.contended.holder,y=`another extraction is running on this context${_?` (pid ${_.pid})`:""} \u2014 retry when it finishes`;return e.out(y),e.emit?.({type:"error",message:y,code:"EXTRACT_LOCKED"}),2}try{return await Er(r,e)}finally{x.release()}}async function Er(r,e){let a=r.mode??"interactive";if(r.posture==="reconcile"){if(r.trust==="hold"){let o="error: --trust hold has no meaning here \u2014 a reconcile IS the review; drop the flag";return e.out(`${o} [TRUST_USAGE]`),e.emit?.({type:"error",message:o,code:"TRUST_USAGE"}),2}if(!r.source||!r.changeContext){let o="reconcile posture needs a pinned source and its change context \u2014 internal wiring fault";return e.out(`error: ${o}`),e.emit?.({type:"error",message:o,code:"POSTURE_USAGE"}),2}if(a==="ci"){let o="reconcile posture is not available under --mode ci \u2014 a held changeset needs a durable session; use --mode agent";return e.out(`error: ${o}`),e.emit?.({type:"error",message:o,code:"POSTURE_USAGE"}),2}}if(r.trust==="hold"&&a==="interactive")return e.out("error: --trust hold only applies to headless runs \u2014 in interactive chat you review items in-session anyway; use --mode agent to hold everything for review"),e.emit?.({type:"error",message:"error: --trust hold only applies to headless runs \u2014 use --mode agent",code:"TRUST_USAGE"}),2;if(a==="interactive"){if(!e.isTTY)return e.out("extract: --mode interactive needs a TTY (use --mode agent|ci|override headless)"),2}else if(!Dr.has(a))return e.out(`extract: unknown mode "${a}" \u2014 interactive | agent | ci | override`),2;if(r.trust!==void 0){if(a==="ci")return e.out("error: --trust is not available under --mode ci (ci is fail-closed \u2014 no trust dials)"),e.emit?.({type:"error",message:"error: --trust is not available under --mode ci",code:"TRUST_UNDER_CI"}),2;if(r.trust!=="auto"&&r.trust!=="hold")return e.out(`error: --trust must be auto | hold, got '${r.trust}'`),e.emit?.({type:"error",message:`error: --trust must be auto | hold, got '${r.trust}'`,code:"TRUST_USAGE"}),2}let m=e.telemetry?.enabled?e.telemetry:void 0,x=Le(e.now?.()??new Date),_=m?At(m.ids.context_instance_id??null,"extract",m.ids.session_id):ce(e.contextDir,"logs",`extract-${x}.log`);ut(mr(_),{recursive:!0});let y=`run-${x}-${Math.random().toString(36).slice(2,8)}`,v=o=>o==="error"||o==="failed_proposal"?"error":o==="repair_respawn"?"warn":"info",h=(o,u,s)=>{try{wr(_,JSON.stringify({ts:new Date().toISOString(),level:v(o),run_id:y,...m?{user_session_id:m.ids.session_id}:{},...s?{session_id:s}:{},kind:o,data:u})+`
|
|
5
5
|
`)}catch{}m?.wireTrace(o,u,s)};{let o=e.out;e.out=u=>{h("transcript",{line:u}),o(u)}}e.chat||e.out(`trace: ${te(_)}`),e.emit?.({type:"run_start",mode:a,trace:_,...m?{session:m.ids.session_id}:{}});let $=Nt();if($&&e.out($),e.preflightTurn){let o=await e.preflightTurn();if(h("preflight",o),!o.ok)return e.out(o.message??"error: turn-endpoint preflight failed"),e.emit?.({type:"error",message:o.message??"error: turn-endpoint preflight failed",code:"PREFLIGHT"}),2}let i=ee(e.contextDir),M=lr(e.contextDir,i),P=r.sources?.length?r.sources:r.source?[r.source]:[];if(P.length>0){if(r.resume){let o="error: --source cannot be combined with --resume (the resumed session already has its scope)";return e.out(o),e.emit?.({type:"error",message:o,code:"SOURCE_WITH_RESUME"}),2}for(let o of P){let u=i.heads.get(o);if(typeof u!="string"){let s=u===null?`error: --source ${o} was ingested but is retired \u2014 re-ingest it to extract again`:`error: --source ${o} is not an ingested source (kane-cli context list shows them)`;return e.out(s),e.emit?.({type:"error",message:s,code:"SOURCE_UNKNOWN"}),2}}}let l=null,f=null;if(r.resume){try{{let c=await or(e.contextDir,r.resume,i,{verb:"extract",deps:{onWarn:C=>e.out(`note: ${C}`)}});{let C=Object.keys(c.handle.state.read_basis??{});if(C.length>1){let B=`error: session ${r.resume} spans ${C.length} sources \u2014 multi-source resume isn't supported yet; committed work is preserved (re-run kane-cli context extract for anything remaining)`;return e.out(B),e.emit?.({type:"error",message:B,code:"MULTI_SOURCE_RESUME"}),c.handle.release(),2}f=c,h("resume_kind",{kind:c.view.pointer===null?"bare-base":c.view.pointer.at==="final"?"pause":"crash"}),l={handle:c.handle,represent:c.represent,questions:c.questions,staleBasis:c.drift.map(B=>B.subject)}}}}catch(c){let C=c instanceof Error?c.message:String(c);return e.out(`error: ${C}`),e.emit?.({type:"error",message:`error: ${C}`,...c instanceof dt?{code:c.code}:{}}),c instanceof dt?2:1}let o=f?null:Xt(l.handle.state.verb,"extract",r.resume);if(o)return e.out(o.message),e.emit?.({type:"error",message:o.message,code:o.code}),l.handle.release(),2;let u=l.handle.state.change_basis;if(u&&(i.heads.get(u.source_id)??null)!==u.new_head){let c=`error: ${u.source_id} moved while this reconcile extraction was paused \u2014 its recorded change context no longer matches; re-run kane-cli maintain reconcile against the current file (session ${r.resume} is defunct and can be ignored)`;return e.out(c),e.emit?.({type:"error",message:c,code:"CHANGE_BASIS_MOVED"}),l.handle.release(),2}if(f&&f.view.pointer!==null&&f.drift.length>0){if(!await e.confirmStale(`changed since the pause: ${f.drift.map(C=>C.subject).join(", ")} \u2014 re-ground and continue against the current versions?`)){let C=`resume aborted: the context moved since the pause (${f.drift.map(B=>B.subject).join(", ")}) \u2014 session ${r.resume} is preserved`;return e.out(C),e.emit?.({type:"error",message:C,code:"RESUME_DRIFT"}),l.handle.release(),2}}else l.staleBasis.length>0&&e.out(`note: changed since the pause: ${l.staleBasis.join(", ")} \u2014 re-presented items may be stale`);let s=[...new Set([...l.handle.state.held_receipts??[],...f?.view.kane?.held_receipts??[]])];if(s.length>0)if(e.chat?.holdReceipt)for(let c of s)e.chat.holdReceipt(c);else e={...e,initialMessage:[s.join(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{f as d}from"./chunk-UUYYTJG2.js";function w(r){let{isAgent:c,log:m}=r,a=r.stdout??process.stderr,s=r.stdin??process.stdin,p=t=>{c&&d(t)};return{async runSteps(t){let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{TestMdRunView:i}=await import("./TestMdRunView-MRMY3RW5.js"),{ScrollbackProvider:n}=await import("./scrollback-JLPJR25X.js"),{waitUntilExit:l}=o(e.createElement(n,null,e.createElement(i,t)),{stdout:a,stdin:s,exitOnCtrlC:!1});await l()},async runUpload(t,e){let{renderUploadProgress:o}=await import("./CliUploadProgress-OTVPBGW4.js");return await o(t,e)},async onSummary(t){try{let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{AutoExitSummaryBox:i}=await import("./SummaryBox-IX32QPWM.js"),{waitUntilExit:n}=o(e.createElement(i,{data:t}),{stdout:a,stdin:s});await n()}catch(e){m("warn","TEST_MD_SUMMARY_RENDER_FAILED","Summary box render failed",{error:String(e)})}},async onLinks(t){try{let{default:e}=await import("./react-QWOAB3TB.js"),{render:o}=await import("./build-JIKYOZUH.js"),{LinksBox:i}=await import("./LinksBox-7AS6D7MX.js"),{waitUntilExit:n}=o(e.createElement(i,t),{stdout:a,stdin:s});await n()}catch(e){m("warn","TEST_MD_LINKS_RENDER_FAILED","LinksBox render failed",{error:String(e)})}},onLockState(t){p({type:"test_md_lock_state",...t})},onAdaptiveHeal(t){p({type:"test_md_adaptive_heal",...t})},onAgentEvent(t){p(t)}}}export{w as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
var f=/^\d+$/;function c(t){if(t.type==="parameter")return!0;let e=t.syntax?.trim()??"";return e.startsWith("${")&&e.endsWith("}")}function a(t){if(!t)throw new Error("--dataset-row needs the row's _id (as Test Manager shows it)");if(f.test(t))throw new Error(`row positions are not supported: pass the row's _id (--dataset-row <_id>), got: ${JSON.stringify(t)}`)}function u(t){let e=t.rows.map(n=>typeof n._id=="string"?n._id:"(no _id)"),r=e.slice(0,20).join(", ");return e.length>20?`${r}, \u2026 (${e.length} rows)`:r}function g(t){if(t==null)return"";if(typeof t=="string")return t;if(typeof t=="object")try{return JSON.stringify(t)}catch{return String(t)}return String(t)}function m(t,e){if(t.rows.length===0)throw new Error("the dataset has no rows");let r=e?.trim();if(!r)throw new Error(`pick a row with --dataset-row <_id> \u2014 this dataset has rows: ${u(t)}`);a(r);let n=t.rows.findIndex(s=>s._id===r);if(n===-1)throw new Error(`no row with _id ${r} in the dataset \u2014 it has rows: ${u(t)}`);return{row:t.rows[n],id:r,index:n+1}}function p(t,e){let r={};for(let n of t.headers)!n.name||n.name==="_id"||(r[n.name]={value:g(e[n.name]),syntax:"${"+n.name+"}",type:"parameter",secret:!1});return r}function l(t,e){return t.headers.filter(r=>r.name&&r.name!=="_id").map(r=>({name:r.name,type:r.type,value:g(e[r.name])}))}function _(t,e){let r=typeof t.datasetId=="string"&&t.datasetId.trim()?t.datasetId.trim():null,n=typeof t.datasetVersion=="string"&&t.datasetVersion.trim()?t.datasetVersion.trim():null,s=t.datasetRow===void 0||t.datasetRow===null||t.datasetRow===""?null:String(t.datasetRow).trim();s!==null&&a(s);let o=(i,w)=>({id:i,...n?{version:n}:{},...w?{row:w}:{}});if(r)return o(r,s);let d=e?.id?.trim();if(d){let i=typeof e?.row=="string"&&e.row.trim()?e.row.trim():null;return i!==null&&a(i),o(d,s??i)}if(s!==null)throw new Error("--dataset-row needs a dataset: pass --dataset-id or set dataset: in the frontmatter");return null}function h(t,e){return{id:t,row:e}}function y(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>c(e)))}function x(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>!c(e)))}function R(t,e,r){return{dataset_id:t,dataset_row_id:e,...r?{dataset_version_id:r}:{}}}export{c as a,m as b,p as c,l as d,_ as e,h as f,y as g,x as h,R as i};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as g}from"./chunk-
|
|
2
|
+
import{b as g}from"./chunk-PHR2OSWD.js";import{readFileSync as o,writeFileSync as h,mkdirSync as u,readdirSync as a,unlinkSync as s,existsSync as l,chmodSync as f}from"fs";import{join as n,dirname as P}from"path";var d=class{baseDir;profilesDir;configFile;constructor(t=g){this.baseDir=t,this.profilesDir=n(t,"profiles"),this.configFile=n(t,"config.json")}readConfig(){try{return JSON.parse(o(this.configFile,"utf-8"))}catch{return{}}}writeConfig(t){u(this.baseDir,{recursive:!0,mode:448}),h(this.configFile,JSON.stringify(t,null,2)+`
|
|
3
3
|
`),f(this.configFile,384)}getActiveProfile(){return this.readConfig().active_profile??null}setActiveProfile(t){let i=this.readConfig();i.active_profile=t,this.writeConfig(i)}getDefaultEnv(){return this.readConfig().default_env??"prod"}setDefaultEnv(t){let i=this.readConfig();i.default_env=t,this.writeConfig(i)}credentialsPath(t,i){return n(this.profilesDir,t,i,"credentials")}clientPath(t,i){return n(this.profilesDir,t,i,"client.json")}basicAuthPath(t,i){return n(this.profilesDir,t,i,"basic-auth")}profileConfigPath(t,i){return n(this.profilesDir,t,i,"profile-config.json")}saveProfileConfig(t,i,r){let e=this.loadProfileConfig(t,i)??{};this.writeSecure(this.profileConfigPath(t,i),{...e,...r})}loadProfileConfig(t,i){try{return JSON.parse(o(this.profileConfigPath(t,i),"utf-8"))}catch{return null}}writeSecure(t,i){try{u(P(t),{recursive:!0,mode:448}),h(t,JSON.stringify(i,null,2)+`
|
|
4
4
|
`),f(t,384)}catch(r){let e=r instanceof Error?r.message:String(r);process.stderr.write(`[auth] Failed to save credentials: ${e}
|
|
5
5
|
`)}}saveCredentials(t,i,r){this.writeSecure(this.credentialsPath(t,i),r)}loadCredentials(t,i){try{return JSON.parse(o(this.credentialsPath(t,i),"utf-8"))}catch{return null}}saveClient(t,i,r){this.writeSecure(this.clientPath(t,i),r)}loadClient(t,i){try{return JSON.parse(o(this.clientPath(t,i),"utf-8"))}catch{return null}}getActiveCredentials(){let t=this.getActiveProfile();if(!t)return{credentials:null,profile:null,env:null};let i=this.getDefaultEnv();return{credentials:this.loadCredentials(t,i),profile:t,env:i}}saveBasicAuth(t,i,r){this.writeSecure(this.basicAuthPath(t,i),r)}loadBasicAuth(t,i){try{return JSON.parse(o(this.basicAuthPath(t,i),"utf-8"))}catch{return null}}deleteBasicAuth(t,i){try{s(this.basicAuthPath(t,i))}catch{}}resolveAuth(){let t=this.getActiveProfile();if(!t)return null;let i=this.getDefaultEnv(),r=this.loadBasicAuth(t,i);return r?{method:"basic",...r,profile:t,env:i}:this.loadCredentials(t,i)?{method:"oauth",profile:t,env:i}:null}listProfiles(){let t=[];try{for(let i of a(this.profilesDir)){let r=n(this.profilesDir,i);try{for(let e of a(r)){let c=n(r,e),v=l(n(c,"credentials")),p=l(n(c,"client.json")),y=l(n(c,"basic-auth"));(v||p||y)&&t.push({profile:i,env:e})}}catch{}}}catch{}return t}deleteProfile(t,i){try{s(this.credentialsPath(t,i))}catch{}if(this.getActiveProfile()===t){let r=this.readConfig();delete r.active_profile,this.writeConfig(r)}}deleteProfileFull(t,i){if(i){try{s(this.credentialsPath(t,i))}catch{}try{s(this.clientPath(t,i))}catch{}try{s(this.basicAuthPath(t,i))}catch{}try{s(this.profileConfigPath(t,i))}catch{}}else try{let r=n(this.profilesDir,t);for(let e of a(r)){try{s(n(r,e,"credentials"))}catch{}try{s(n(r,e,"client.json"))}catch{}try{s(n(r,e,"basic-auth"))}catch{}try{s(n(r,e,"profile-config.json"))}catch{}}}catch{}}};export{d as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as N,c as O,e as S,f as D,j as T,p as y,r as z,t as U}from"./chunk-L45HDSJ7.js";import{a as Y,b as M}from"./chunk-NBXYL2JT.js";import{a as F}from"./chunk-CAOZKSQ3.js";import{a as R}from"./chunk-DHJSM5DT.js";import{a as A}from"./chunk-
|
|
2
|
+
import{b as N,c as O,e as S,f as D,j as T,p as y,r as z,t as U}from"./chunk-L45HDSJ7.js";import{a as Y,b as M}from"./chunk-NBXYL2JT.js";import{a as F}from"./chunk-CAOZKSQ3.js";import{a as R}from"./chunk-DHJSM5DT.js";import{a as A}from"./chunk-PHR2OSWD.js";import{e as $}from"./chunk-UR6MHSHU.js";var C=$(Y(),1);import{existsSync as k,readFileSync as I,readdirSync as J,statSync as K}from"fs";import{dirname as H,isAbsolute as V,join as h,relative as P,resolve as Z,sep as _}from"path";import{createHash as q}from"crypto";var b="testmd-bundle.json",u=class extends Error{constructor(t){super(t),this.name="BundleUsageError"}},B=e=>e.split(_).join("/");function v(e){if(!k(e))return[];let t=[];for(let s of J(e).sort()){let r=h(e,s);K(r).isDirectory()?t.push(...v(r)):t.push(r)}return t}function G(e){let t=e.map(r=>H(r).split(_)),s=t[0];for(let r of t.slice(1)){let i=0;for(;i<s.length&&i<r.length&&s[i]===r[i];)i++;s=s.slice(0,i)}return s.join(_)||_}function Q(e){for(let t of e){let s=F(t,I(t,"utf8"));for(let r of s.steps)if(r.body.kind==="import_ref"&&V(r.body.path))throw new u(`bundle sync: absolute @import is not portable after unzip: ${t} step ${r.index} (@import ${r.body.path})`)}}function j(e,t={}){let s=Z(e),r=S(s),i=y(s);if(!i?.commit_id||!i?.test_id)throw new u(`bundle sync: ${s} is not authored \u2014 run \`kane-cli testmd run\` first (output-<stem>/.internal/meta.json needs commit_id + test_id)`);let l;try{l=U(s)}catch(n){throw n instanceof z?new u(`bundle sync: ${n.message}`):n}let c=[s];for(let n of l.steps)for(let a of n.trace.slice(1))c.includes(a.file)||c.push(a.file);Q(c);let o=[],d=[];for(let n of l.unitFiles){if(n.file===s)continue;let a=N(n.file);o.includes(a)||o.push(a),n.kind==="module"&&d.push(S(n.file))}let m=[...c],p=n=>{k(n)&&m.push(n)};p(O(s)),m.push(r),p(D(s)),m.push(...v(T(s)));for(let n of o)p(h(n,"Result.md")),m.push(...v(h(n,".internal","steps")));for(let n of d)p(n);let f=G(m);if(k(h(f,b)))throw new u(`bundle sync: a real file named ${b} exists at the zip root (${f}) \u2014 it would collide with the generated manifest`);let w=m.map(n=>{let a=n===r&&t.identityOverride?Buffer.from(JSON.stringify({...JSON.parse(I(n,"utf8")),commit_id:t.identityOverride.commit_id},null,2)+`
|
|
3
3
|
`):void 0,E=a??I(n);return{abs:n,rel:B(P(f,n)),sha256:q("sha256").update(E).digest("hex"),bytes:E.length,...a?{contents:a}:{}}}).sort((n,a)=>n.rel<a.rel?-1:1),x=B(P(f,s)),L={schema_version:2,entry:x,commit_id:t.identityOverride?.commit_id??i.commit_id,test_id:i.test_id,testcase_id:i.testcase_id??null,project_id:i.project_id??null,folder_id:i.folder_id??null,org_id:i.org_id??null,created_at:new Date().toISOString(),producer:{name:"kane-cli",version:A},files:w.map(n=>({path:n.rel,sha256:n.sha256,bytes:n.bytes})),units:l.unitFiles.filter(n=>n.file!==s).map(n=>({path:B(P(f,n.file)),kind:n.kind}))};return{zipRoot:f,entry:x,files:w,manifest:L}}var g=e=>e instanceof Error?e.message:String(e);function W(e){return new Promise((t,s)=>{let r=(0,C.default)("zip",{zlib:{level:6}}),i=[];r.on("data",l=>i.push(l)),r.on("error",s),r.on("end",()=>t(Buffer.concat(i))),r.append(JSON.stringify(e.manifest,null,2)+`
|
|
4
4
|
`,{name:b});for(let l of e.files)l.contents?r.append(l.contents,{name:l.rel}):r.file(l.abs,{name:l.rel});r.finalize()})}async function X(e){let{plan:t,controller:s,testId:r,sessionId:i,commitId:l}=e,c;try{c=await W(t)}catch(d){return{ok:!1,stage:"zip",error:g(d)}}let o;try{let d={key:"testmd",content_type:"application/zip",filename:`${l}-testmd.zip`},p=(await s.getPresignedUrls(r,i,[d])).urls?.testmd?.upload_url;if(!p)return{ok:!1,stage:"presign",error:"presign response missing testmd upload_url"};o=p}catch(d){return{ok:!1,stage:"presign",error:g(d)}}try{await M(o,c,"application/zip")}catch(d){return{ok:!1,stage:"upload",error:g(d)}}return{ok:!0,bytes:c.length}}async function ee(e){let t;try{t=j(e.sourcePath,{identityOverride:e.identityOverride})}catch(s){return s instanceof u?{ok:!1,stage:"collect",error:s.message}:{ok:!1,stage:"collect",error:g(s)}}return X({...e,plan:t})}function ge(e){return e.shouldUploadPipeline&&e.uploadSucceeded&&!!e.metaCommitId&&!!e.metaTestId}function te(e){return e.persisted?e.uploadSucceeded?e.local?"local":e.hasBasicAuth?!e.metaCommitId||!e.metaTestId?"not_authored":null:"no_auth":"upload_failed":"not_persisted"}async function ye(e){let t=e.recordedTestPath??null,s=t?y(t):null,r=te({persisted:!!t,uploadSucceeded:e.uploadSucceeded,local:e.local,hasBasicAuth:!!e.basicAuth,metaCommitId:s?.commit_id,metaTestId:s?.test_id});if(r)return e.log("info","BUNDLE_SYNC_SKIPPED","testmd bundle sync skipped",{reason:r,...t?{path:t}:{}}),{skipped:r};let i=s.commit_id,l=s.test_id,c=o=>{try{e.onAgentEvent?.(o)}catch{}};try{let o=await(e.syncFn??ee)({sourcePath:t,testId:l,sessionId:e.sessionId,commitId:i,controller:new R(e.controllerBaseUrl,{username:e.basicAuth.username,accessKey:e.basicAuth.access_key})});return o.ok?(e.log("info","BUNDLE_SYNC_OK","testmd bundle pushed",{commit_id:i,path:t,bytes:o.bytes}),c({type:"test_md_bundle_sync",status:"ok",commit_id:i,path:t,bytes:o.bytes})):(e.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync failed",{commit_id:i,path:t,stage:o.stage,error:o.error}),c({type:"test_md_bundle_sync",status:"failed",commit_id:i,path:t,stage:o.stage})),o}catch(o){let d=g(o);return e.log("warn","BUNDLE_SYNC_FAILED","testmd bundle sync threw",{commit_id:i,path:t,error:d}),c({type:"test_md_bundle_sync",status:"failed",commit_id:i,path:t,stage:"upload"}),{ok:!1,stage:"upload",error:d}}}export{j as a,W as b,X as c,ee as d,ge as e,te as f,ye as g};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{g as h}from"./chunk-FY7TCYPK.js";import{F as l}from"./chunk-RDHWNSDP.js";import{b as u}from"./chunk-FQNQVC5O.js";import{f}from"./chunk-XLSOQLVT.js";import{existsSync as w,readFileSync as _,readdirSync as R}from"fs";import{join as p}from"path";function g(i,r){let{records:t}=l(i),o=new Set;for(let e of t)for(let n of e.review)n.resolution!=="pending"&&o.add(n.id);let s=[],d=new Set;for(let e=t.length-1;e>=0;e--)for(let n of t[e].dedup_hits??[]){if(n.new_cid===void 0)continue;let c=`${n.new_cid}|${n.candidate_cid}`;d.has(c)||(d.add(c),!o.has(n.new_cid)&&(r.superseded.has(n.new_cid)||r.superseded.has(n.candidate_cid)||r.trust.get(n.new_cid)==="derived"&&s.push({new_cid:n.new_cid,candidate_cid:n.candidate_cid,score:n.score,scorer:n.scorer})))}return s}var a=(i,r)=>i.displayNameOf(r)??r.slice(0,19);function m(i,r){return{design_children:i.edgesInto(r).filter(o=>(o.type==="belongs_to"||o.type==="scoped_to")&&!i.superseded.has(o.src)).length}}function v(i,r){let{records:t}=l(i),o=new Set,s=new Map;for(let e of t)for(let n of e.review)n.kind==="pending_archive"?s.set(n.id,n.reason):n.resolution!=="pending"&&o.add(n.id);let d=new Map;for(let[e,n]of s)r.superseded.has(e)||r.trust.get(e)!=="derived"||o.has(e)||d.set(e,n);return{all:s,live:d}}function y(i,r){let t=[],o=new Set;for(let e of g(i.contextDir,r)){o.add(e.new_cid);let n=e.scorer==="lexical_fallback"?" (lexical fallback \u2014 the probe ran degraded)":"";t.push({kind:"PAIR",ref:a(r,e.new_cid),title:String(r.getNode(e.new_cid)?.content.title??e.new_cid.slice(0,12)),why:`possible duplicate of ${a(r,e.candidate_cid)} \u2014 score ${e.score}${n}`,pair:{candidate_cid:e.candidate_cid,candidate_ref:a(r,e.candidate_cid),score:e.score,scorer:e.scorer}})}let{all:s,live:d}=v(i.contextDir,r);for(let[e,n]of d)t.push({kind:"REVIEW",ref:a(r,e),title:String(r.getNode(e)?.content.title??e.slice(0,12)),why:`archive held for interactive confirmation${n?` \u2014 ${n}`:""}`,held:!0,impact:m(r,e)});for(let e of k(i.contextDir))t.push({kind:"MODIFY_HELD",ref:`${e.sid}:${e.tempRef}`,title:String(e.content.title??e.tempRef),why:`${e.rationale} \u2014 held by paused/dead session ${e.sid}`,heldPayload:e});for(let{cid:e,content:n}of r.byLabel(f.USECASE))r.superseded.has(e)||r.trust.get(e)!=="derived"||o.has(e)||s.has(e)||t.push({kind:"REVIEW",ref:a(r,e),title:String(n.title??e.slice(0,12)),why:"unreviewed \u2014 approve, archive, or defer",impact:m(r,e)});return t}function F(i,r){let t={REVIEW:0,PAIR:0,MODIFY_HELD:0};for(let o of y(i,r))t[o.kind]++;return t}function b(i,r){try{let t=JSON.parse(_(p(i,"sessions",r,".lock"),"utf8"));return typeof t.pid=="number"&&u(t.pid)}catch{return!1}}function k(i){let r=[],t=p(i,"sessions");if(!w(t))return r;let o=[];try{o=R(t)}catch{return r}for(let s of o){if(!w(p(t,s,"state.json"))||b(i,s))continue;let d=[],e=!1;try{let c=h(i,s).kane;c?.pending?.proposals?.length&&(d=c.pending.proposals,e=!0)}catch{e=!1}if(!e)try{d=JSON.parse(_(p(t,s,"state.json"),"utf8")).pending?.proposals??[]}catch{continue}for(let n of d)r.push({sid:s,tempRef:String(n.tempRef??n.temp_ref??"held"),...typeof n.event_id=="string"?{event_id:n.event_id}:{},label:String(n.label??"usecase"),content:n.content??{},rationale:String(n.rationale??"held payload")})}return r}export{m as a,v as b,y as c,F as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as o}from"./chunk-
|
|
2
|
+
import{d as o}from"./chunk-VVOKM2VO.js";function s(n,r,e){let t=r.mediaOf(e),l=typeof t?.text_blob=="string"&&t.text_blob!==""?t.text_blob:null;if(l!==null)return o(n,l);let i=String(r.getNode(e)?.content.blob??"");return i===""?null:o(n,i)}function b(n){return n.toString("utf8").replace(/\n$/,"").split(`
|
|
3
3
|
`).map((e,t)=>`${String(t+1).padStart(4,"0")}| ${e}`).join(`
|
|
4
4
|
`)}export{s as a,b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as $,b as C,c as S,d as _}from"./chunk-3UI5VTQS.js";function E(i){return i.replace(/\n$/,"").split(`
|
|
3
|
+
`).map((d,o)=>`${String(o+1).padStart(4,"0")}| ${d}`).join(`
|
|
4
|
+
`)}function L(i,l,d){if(!i.quote)return i;let o=C(d,i.anchor);if(o!==null&&S(i.quote,o))return i;let a=_(l,i.quote);if(a.length!==1)return"gone-or-ambiguous";let[{index:t,length:r}]=a,m=l.slice(0,t).split(`
|
|
5
|
+
`).length,e=l.slice(0,t+r).replace(/\n$/,"").split(`
|
|
6
|
+
`).length;return{...i,anchor:`L${m}-L${e}`}}function k(i,l){let d=l.replace(/\n$/,""),o=E(l),a=t=>{if(!t?.quote)return t;let r=L(t,d,o);return r==="gone-or-ambiguous"?t:r};return{...i,use_cases:i.use_cases.map(t=>({...t,cite:a(t.cite)??t.cite,...t.criteria?{criteria:t.criteria.map(r=>({...r,cite:a(r.cite)??r.cite}))}:{},...t.updated?.criteria?{updated:{...t.updated,criteria:t.updated.criteria.map(r=>"op"in r?r.op==="set"?{...r,cite:a(r.cite)??r.cite}:r:{...r,cite:a(r.cite)??r.cite})}}:{}}))}}function q(i,l,d){let o=[],a=l.mediaOf(i.source.source_cid).images??[],t=d!==void 0?l.mediaOf(d).images??[]:null,r=(e,n)=>{let f=e?$(e.anchor):null;if(!e||f?.kind!=="img-part")return e;if(t===null)return o.push({code:"HELD_CITES_STALE",detail:`${n}: this plan predates image-part staging \u2014 ${e.anchor} cannot be verified against the version it staged under; re-run kane-cli maintain reconcile to re-stage`}),e;let c=t.find(s=>s.ref===f.ref)?.blob;if(c===void 0)return o.push({code:"HELD_CITES_STALE",detail:`${n}: ${e.anchor} names no decodable image of the staged version \u2014 re-run kane-cli maintain reconcile to re-stage`}),e;if(a.some(s=>s.ref===f.ref&&s.blob===c))return e;let p=a.filter(s=>s.blob===c),h=p.filter(s=>s.delivery==="selected");if(h.length===1)return{...e,anchor:`img#${h[0].ref}`};if(p.length===1)return{...e,anchor:`img#${p[0].ref}`};if(p.length===0){let s=t.find(u=>u.ref===f.ref)?.appearance;if(s!==void 0){let u=a.filter(g=>g.appearance===s),b=u.filter(g=>g.delivery==="selected");if(b.length===1)return{...e,anchor:`img#${b[0].ref}`};if(u.length===1)return{...e,anchor:`img#${u[0].ref}`}}}return o.push({code:"HELD_CITES_STALE",detail:`${n}: the image behind ${e.anchor} is ${p.length===0?"no longer in":"ambiguous in"} the current head \u2014 re-run kane-cli maintain reconcile to re-stage`}),e};return{proposal:{...i,use_cases:i.use_cases.map(e=>({...e,cite:r(e.cite,e.temp_ref)??e.cite,...e.criteria?{criteria:e.criteria.map(n=>({...n,cite:r(n.cite,e.temp_ref)??n.cite}))}:{},...e.updated?.criteria?{updated:{...e.updated,criteria:e.updated.criteria.map(n=>"op"in n?n.op==="set"?{...n,cite:r(n.cite,e.temp_ref)??n.cite}:n:{...n,cite:r(n.cite,e.temp_ref)??n.cite})}}:{}}))},errors:o.length>0?o:null}}export{E as a,k as b,q as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as he}from"./chunk-
|
|
2
|
+
import{a as he}from"./chunk-WVHMPIDQ.js";import{a as pe}from"./chunk-CCNPXTC6.js";import{b as ue,c as de,d as q,e as Y}from"./chunk-SDJNWR4D.js";import{d as ge,e as me}from"./chunk-AXTPNZPX.js";import{d as fe}from"./chunk-BZAGVBCX.js";import{a as L}from"./chunk-KDNNMU7Q.js";import{a as le}from"./chunk-AG2MVCNK.js";import{z as I}from"./chunk-IICT4VOU.js";import{F as ce,X as ae}from"./chunk-RDHWNSDP.js";function mt(t){let e=process.env.HOME??"";return e&&t.startsWith(e)?`~${t.slice(e.length)}`:t}import{randomBytes as lt}from"crypto";function J(t,e){let r=Math.min(t.length,e.length),o=0,n=0,c=0;for(let s=0;s<r;s++)o+=t[s]*e[s],n+=t[s]*t[s],c+=e[s]*e[s];return n===0||c===0?0:o/(Math.sqrt(n)*Math.sqrt(c))}function Z(t,e,r){return r*t+(1-r)*e}var ee=.7;var je=["get_node","get_edges","find_by_provenance","match_by_type","stale_nodes","search_similar","search_similar_batch","history"],Pe=["source_read","source_grep","source_list"],Ue=[...je,...Pe],ke=50,be=200,te=10,xe=50,_e=20,Ve=200,He=50;function P(t,e,r){let o=typeof t=="number"&&Number.isFinite(t)?Math.floor(t):e;return Math.max(1,Math.min(o,r))}function M(t,e){let r=t[e];if(typeof r!="string"||r.length===0)throw new k(`param "${e}" must be a non-empty string`);return r}function $(t,e){let r=t[e];if(r==null)return null;if(typeof r!="string")throw new k(`param "${e}" must be a string when present`);return r}var k=class extends Error{},ye=24,Qe=10,ze=10;function Ke(t){let e=t.cursor;if(e==null)return 0;if(typeof e=="string"&&/^\d+$/.test(e))return Number.parseInt(e,10);throw new k(`BAD_CURSOR: cursor ${JSON.stringify(e)} is not a cursor this store minted`)}function ve(t,e){let r=e.fields;if(!Array.isArray(r)||r.length===0)return t;let o=new Set(r.filter(n=>typeof n=="string"));return t.map(n=>Object.fromEntries(Object.entries(n).filter(([c])=>o.has(c))))}function ne(t,e,r=ke,o=be){let n=Ke(e),c=P(e.limit,r,o),s=t.slice(n,n+c),u=n+s.length<t.length;return{rows:ve(s,e),truncated:u,next_cursor:u?String(n+s.length):null}}var We=t=>t.cursor!=null||t.fields!=null;function U(t,e,r=ke){let o=ne(t,e,r);return We(e)||o.truncated?{rows:o.rows,truncated:o.truncated,next_cursor:o.next_cursor}:o.rows}function re(t,e){let r=t.getNode(e);return r?{cid:e,label:r.label,content:r.content,trust:t.trust.get(e)??null,freshness:t.stale(e)}:null}function we(t){return new Set(t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").split(" ").filter(Boolean))}function V(t,...e){let r=we(t);if(r.size===0)return 0;let o=t.trim().toLowerCase(),n=0;for(let c of e){let s=we(c);if(s.size===0)continue;let u=0;for(let l of r)s.has(l)&&u++;let f=r.size+s.size-u,d=f===0?0:u/f;o&&c.toLowerCase().includes(o)&&(d=Math.max(d,.9)),n=Math.max(n,d)}return n}function Xe(t,e){let r=M(e,"cid"),o=$(e,"type"),n=$(e,"direction")??"both";if(!["out","in","both"].includes(n))throw new k('param "direction" must be out|in|both');let c=[];(n==="out"||n==="both")&&c.push(...t.edgesFrom(r)),(n==="in"||n==="both")&&c.push(...t.edgesInto(r));let s=c.filter(u=>o==null||u.type===o);return U(s,e)}function qe(t,e){let r=M(e,"source_id"),o=t.heads.get(r)??null,n=[];for(let c of t.nodeLabel.keys()){let s=t.derivesInto(c).filter(f=>f.props.source_id===r).map(f=>({source_cid:f.props.source_cid,anchor:f.props.anchor??null}));if(s.length===0)continue;let u=re(t,c);u&&n.push({...u,pins:s,pinned_to_head:o!=null&&s.some(f=>f.source_cid===o)})}return U(n,e,be)}function Ye(t,e){let r=M(e,"label"),o=$(e,"trust"),n=$(e,"freshness"),c=[];for(let{cid:s}of t.byLabel(r)){let u=re(t,s);u&&(o!=null&&u.trust!==o||n!=null&&u.freshness!==n||c.push(u))}return U(c,e)}function Je(t,e={}){let r=$(e,"label"),o=t.staleList().map(({cid:n,state:c})=>{let s=t.getNode(n);return{cid:n,state:c,label:s?.label??null,title:s?.content.title??null}}).filter(n=>r==null||n.label===r);return U(o,e)}function Ze(t,e,r){let o=e.extracted,n=$(e,"kind"),c=[];for(let d of[...t.heads.keys()].sort()){let l=t.heads.get(d);if(typeof l!="string")continue;let h=t.mediaOf(l).format;if(n!=null&&h!==n)continue;let p=t.extractedSourceCids.has(l);if(typeof o=="boolean"&&p!==o)continue;let S=0;if(h!=="image"){let b=L(r,t,l);b&&(S=b.toString("utf8").replace(/\n$/,"").split(`
|
|
3
3
|
`).length)}let _=t.extractionCompleteness.get(d);c.push({source_id:d,kind:h,lines:S,head_cid:l,extracted:p,last_extract_at:_?.at??null,extractor_version:_?.extractor_version??null})}let{rows:s,truncated:u,next_cursor:f}=ne(c,e);return{sources:s,truncated:u,next_cursor:f}}function et(t,e,r){let o=M(e,"ref"),n=t.resolve(o);if(!n)throw new k(`UNKNOWN_REF: ${o} names nothing in the graph`);let c=n.tip,s=new Map;for(let[m,w]of t.superseded)typeof w=="string"&&w!==m&&s.set(w,[...s.get(w)??[],m]);let u=[],f=[c],d=new Set;for(;f.length>0;){let m=f.pop();d.has(m)||(d.add(m),u.push(m),f.push(...s.get(m)??[]))}let{records:l}=ce(r),g=new Map,h=new Map;for(let m of l){for(let w of m.nodes)g.has(w.cid)||g.set(w.cid,m.ts);for(let w of m.supersessions)w.kind==="node"&&h.set(w.old,{by_cid:w.new,reason:w.reason})}let p=u.map(m=>({cid:m,minted_at:g.get(m)??null,superseded_by:h.get(m)?.by_cid??null,reason:h.get(m)?.reason??null,change_note:null})),{rows:S,truncated:_,next_cursor:b}=ne(p,e,ze);return{root_logical_id:t.displayNameOf(c),live_tip:t.superseded.has(c)?null:c,truncated:_,next_cursor:b,chain:S}}function Se(t){let e=t.queries;if(!Array.isArray(e)||e.length<1||e.length>ye)throw new k(`param "queries" must be 1..${ye} entries`);return e.map((r,o)=>{if(typeof r!="object"||r===null)throw new k(`queries[${o}] must be an object`);let n=r;if(typeof n.qid!="string"||n.qid.length===0)throw new k(`queries[${o}].qid must be a non-empty string`);if(typeof n.text!="string"||n.text.length===0)throw new k(`queries[${o}].text must be a non-empty string`);return{qid:n.qid,text:n.text,topK:P(n.top_k,te,Qe)}})}function Ae(t){let e=[];for(let{cid:r,content:o}of t.byLabel("usecase"))t.superseded.has(r)||e.push({cid:r,title:String(o.title??""),summary:String(o.summary??""),description:String(o.description??"")});return e}function Re(t,e,r){let o=Ae(t);return e.map(n=>{let c=[];for(let s of o){let u=r(n,s);u<=0||c.push({cid:s.cid,logical_id:t.displayNameOf(s.cid),title:s.title,score:Math.round(u*1e3)/1e3,trust:t.trust.get(s.cid)??null,superseded:!1})}return c.sort((s,u)=>u.score-s.score||s.cid.localeCompare(u.cid)),{qid:n.qid,truncated:c.length>n.topK,matches:c.slice(0,n.topK)}})}function Ee(t,e){let r=Se(e);return{results:Re(t,r,(o,n)=>V(o.text,n.title,n.summary,n.description)),scorer:"lexical_fallback"}}function tt(t,e){let r=M(e,"text"),o=$(e,"label")??"usecase",n=P(e.k,te,xe),c=[];for(let{cid:s,content:u}of t.byLabel(o)){let f=String(u.title??""),d=String(u.summary??""),l=V(r,f,d);l<=0||c.push({cid:s,title:f,summary:d,score:Math.round(l*1e3)/1e3,trust:t.trust.get(s)??null,freshness:t.stale(s)})}return c.sort((s,u)=>u.score-s.score||s.cid.localeCompare(u.cid)),c.slice(0,n)}function De(t,e,r){let o=t.heads.get(r);if(typeof o!="string"){let c=[...t.heads.keys()].sort().join(", ");throw new k(`unknown source_id "${r}" \u2014 known: ${c||"(none)"}`)}if(t.mediaOf(o).format==="image")throw new k(`source "${r}" is an image \u2014 no line window (cite img#whole)`);let n=L(e,t,o);if(n==null)throw new k(`source "${r}" blob is missing from the store`);return{head:o,lines:n.toString("utf8").replace(/\n$/,"").split(`
|
|
4
4
|
`)}}function nt(t,e,r){return t.slice(e-1,r).map((o,n)=>`${String(e+n).padStart(4,"0")}| ${o}`).join(`
|
|
5
5
|
`)}function rt(t,e,r){let o=M(e,"source_id"),n=$(e,"anchor"),c=e.line_range;if(n!=null&&c!=null)throw new k("give anchor OR line_range, not both");let{head:s,lines:u}=De(t,r,o),f=u.length,d,l;if(n!=null){let g=/^L(\d+)-L(\d+)$/.exec(n);if(!g)throw new k(`anchor "${n}" is not L<a>-L<b>`);let h=Number(g[1]),p=Number(g[2]);if(h<1||p<h||p>f)throw new k(`anchor "${n}" does not resolve (source has ${f} lines)`);d=Math.max(1,h-_e),l=Math.min(f,p+_e)}else if(c!=null){if(!Array.isArray(c)||c.length!==2||!c.every(p=>Number.isInteger(p)))throw new k('param "line_range" must be [from_line, to_line]');let[g,h]=c;if(g<1||h<g)throw new k('param "line_range" must be 1-based with from \u2264 to');if(g>f)throw new k(`line_range starts past the end (source has ${f} lines)`);d=g,l=Math.min(h,f)}else d=1,l=f;return l=Math.min(l,d+Ve-1),{window:nt(u,d,l),from_line:d,to_line:l,source_cid:s,total_lines:f}}function st(t,e,r){let o=M(e,"pattern"),n=$(e,"source_id"),c;try{c=new RegExp(o,"u")}catch(d){throw new k(`invalid pattern: ${d instanceof Error?d.message:String(d)}`)}let s=n!=null?[n]:[...t.heads.keys()].sort(),u=[],f=!1;e:for(let d of s){if(n==null){let g=t.heads.get(d);if(typeof g!="string"||t.mediaOf(g).format==="image")continue}let{lines:l}=De(t,r,d);for(let g=0;g<l.length;g++)if(c.test(l[g])){if(u.length>=He){f=!0;break e}u.push({source_id:d,line:g+1,text:l[g]})}}return{matches:u,truncated:f}}function ot(t,e,r,o){try{switch(e){case"get_node":{let n=re(t,M(r,"cid"));return n==null?{ok:!0,result:null}:{ok:!0,result:ve([n],r)[0]}}case"get_edges":return{ok:!0,result:Xe(t,r)};case"find_by_provenance":return{ok:!0,result:qe(t,r)};case"match_by_type":return{ok:!0,result:Ye(t,r)};case"stale_nodes":return{ok:!0,result:Je(t,r)};case"search_similar":return{ok:!0,result:tt(t,r)};case"search_similar_batch":return{ok:!0,result:Ee(t,r)};case"history":{if(o==null)throw new k("history unavailable (no context store)");return{ok:!0,result:et(t,r,o)}}case"source_list":{if(o==null)throw new k("source roster unavailable (no context store)");return{ok:!0,result:Ze(t,r,o)}}case"source_read":case"source_grep":{if(o==null)throw new k("source text unavailable (no context store)");return{ok:!0,result:(e==="source_read"?rt:st)(t,r,o)}}default:return{ok:!1,error:`unknown method: ${e} \u2014 available: ${Ue.join(", ")}`}}}catch(n){return n instanceof k?{ok:!1,error:`${e}: ${n.message}`}:{ok:!1,error:`${e}: graph read failed: ${n instanceof Error?n.message:String(n)}`}}}var j="assurance.sim";function it(t){return[t.title,t.summary,t.description].filter(Boolean).join(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as g,e as p}from"./chunk-
|
|
2
|
+
import{a as g,e as p}from"./chunk-IDLJHKJX.js";import{existsSync as f}from"fs";import{isAbsolute as m,join as d,relative as v}from"path";function c(t){let n=f(d(t,".context"))?"assurance.json":"variables.json";return d(".testmuai","variables",n)}function h(t,n){if(!m(t))return t;let e=v(n,t);return e.startsWith("..")?t:e}function w(t,n){let e=t.used_by;if(e.length===0||e.every(s=>s.file===p))return"";if(n===void 0||!e.every(s=>s.file===n))return e.map(s=>`${s.file} step ${s.step}`).join(" \xB7 ");let a=[...new Set(e.map(s=>s.step))].sort((s,i)=>s-i);return a.length===1?`step ${a[0]}`:`steps ${a.join(", ")}`}function b(t,n){let e=new Map,a=new Map,s={header:"Not in any variables file",rows:[],declare:!0};for(let i of t){if(i.reason==="not_a_dataset_column"){let l=i.dataset??"",u=a.get(l);u||(u={header:`Not a column of dataset ${l}`.trimEnd(),rows:[],declare:!1},a.set(l,u)),u.rows.push(i);continue}if(i.reason!=="value_missing"){s.rows.push(i);continue}let r=h(i.file??c(n),n),o=e.get(r);o||(o={header:r===g?"Waiting for a value passed with --variables":`Waiting for a value in ${r}`,rows:[],declare:!1},e.set(r,o)),o.rows.push(i)}return[...e.values(),...a.values(),...s.rows.length>0?[s]:[]]}function $(t,n){let e=c(n);if(f(d(n,e)))return["",` Add ${t.length===1?"it":"them"} to ${e}`];let a=t.map(r=>`${JSON.stringify(r.name)}:`),s=Math.max(...a.map(r=>r.length))+1,i=a.map((r,o)=>` ${r.padEnd(s)}{ "value": "" }${o<a.length-1?",":""}`);return["",` Create ${e}:`,""," {",...i," }"]}function _(t,n){let e=t.length,a=`warning: ${e} variable${e===1?" has":"s have"} no value`,s=Math.max(...t.map(r=>r.name.length),8)+2,i=b(t,n.cwd).map(r=>{let o=[` ${r.header}`];for(let l of r.rows)o.push(` ${l.name.padEnd(s)}${w(l,n.entryFile)}`.trimEnd());return r.declare&&o.push(...$(r.rows,n.cwd)),o.join(`
|
|
3
3
|
`)});return`${a}
|
|
4
4
|
|
|
5
5
|
${i.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as m}from"./chunk-
|
|
2
|
+
import{a as m}from"./chunk-GIC56KI3.js";import{y as t}from"./chunk-PHR2OSWD.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a,b as r,i as u}from"./chunk-C44QQJR4.js";import{a as b}from"./chunk-6YGTRKDT.js";import{e as n}from"./chunk-UR6MHSHU.js";var c=n(b(),1);var e=n(p(),1);function R({onSubmit:l}){let[o,f]=(0,c.useState)(0),s=(0,c.useRef)(!1);return u((x,i)=>{s.current||(i.leftArrow||i.rightArrow?f(d=>d===0?1:0):i.return?(s.current=!0,l(o===0?"positive":"negative")):i.escape&&(s.current=!0,l(null)))}),(0,e.jsxs)(a,{flexDirection:"column",marginTop:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(r,{color:t.secondary,children:"Rate this session: "}),(0,e.jsx)(r,{color:o===0?t.orange:t.dim,children:o===0?"[ \u{1F44D} ]":" \u{1F44D} "}),(0,e.jsx)(r,{children:" "}),(0,e.jsx)(r,{color:o===1?t.orange:t.dim,children:o===1?"[ \u{1F44E} ]":" \u{1F44E} "})]}),(0,e.jsx)(m,{bindings:[{keys:"\u2190/\u2192",label:"select"},{keys:"\u21B5",label:"submit"}],escBackLabel:"skip"})]})}export{R as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as t}from"./chunk-
|
|
2
|
+
import{b as t}from"./chunk-PHR2OSWD.js";import{join as i}from"path";function e(n=t){return i(n,"plugins")}function g(n,r=t){return i(e(r),n)}function c(n,r,o=t){return i(g(n,o),r)}function f(n,r=t){return i(g(n,r),"current")}function x(n,r=t){return i(g(n,r),"config.json")}function l(n,r=t){return i(g(n,r),".jobs")}function s(n=t){return i(n,"bin")}function h(n=t){return i(s(n),"hyperexecute")}export{e as a,g as b,c,f as d,x as e,l as f,s as g,h};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as k}from"./chunk-
|
|
2
|
+
import{a as k}from"./chunk-EIMHIZKF.js";import{a as m}from"./chunk-BPMSNGXQ.js";import{r as a}from"./chunk-RSSOJ3L2.js";import{a as y}from"./chunk-VIYV6NIW.js";import{a as h}from"./chunk-JWOPRJIO.js";var $=10,u=200,N=1e4,S=1e6;function T(t,e,r="streaming"){let n=r==="full-fetch"?S:N,o=$,i=0;if(t!==void 0){let s=Number(t);if(!Number.isInteger(s)||s<1||s>u)return{error:`--limit must be an integer in [1, ${u}] (got "${t}")`};o=s}if(e!==void 0){let s=Number(e);if(!Number.isInteger(s)||s<0||s>n)return{error:`--offset must be an integer in [0, ${n}] (got "${e}")`};i=s}return{limit:o,offset:i}}function C(t,e){if(!e)return t;let r=e.toLowerCase();return t.filter(n=>n.name.toLowerCase().includes(r))}function j(t,{limit:e,offset:r}){let n=t.slice(r,r+e),o=t.length>r+e;return{slice:n,hasMore:o}}function v(t,e,r=n=>process.stdout.write(`${n}
|
|
3
3
|
`)){for(let n of t)r(JSON.stringify(n));r(JSON.stringify({_meta:"page",limit:e.limit,offset:e.offset,returned:t.length,has_more:e.has_more}))}function b(t,e,r=n=>process.stdout.write(`${n}
|
|
4
|
-
`)){if(t.length===0){r("(no results)");return}let n=Math.max(2,...t.map(s=>s.id.length)),o=`${"ID".padEnd(n)} NAME`;r(o),r(`${"-".repeat(n)} ----`);for(let s of t)r(`${s.id.padEnd(n)} ${s.name}`);r("");let i=e.offset+t.length;if(e.hasMore){let s=e.totalIsLowerBound?`${e.total}+`:`${e.total}`;r(`${i} of ${s} \u2014 next: --offset ${e.offset+e.limit}`)}else r(`${t.length} shown (${e.total} total)`)}async function B(t,e,r){if(r.username&&r.accessKey)return{ok:!0,creds:{username:r.username,access_key:r.accessKey}};let n=new h,o=n.loadBasicAuth(t,e);if(o)return{ok:!0,creds:{username:o.username,access_key:o.access_key}};let i=n.loadCredentials(t,e);if(!i)return{ok:!1,reason:"no_credentials"};let s=i.access_token;try{let{refreshOAuthToken:d}=await import("./token-refresh-
|
|
4
|
+
`)){if(t.length===0){r("(no results)");return}let n=Math.max(2,...t.map(s=>s.id.length)),o=`${"ID".padEnd(n)} NAME`;r(o),r(`${"-".repeat(n)} ----`);for(let s of t)r(`${s.id.padEnd(n)} ${s.name}`);r("");let i=e.offset+t.length;if(e.hasMore){let s=e.totalIsLowerBound?`${e.total}+`:`${e.total}`;r(`${i} of ${s} \u2014 next: --offset ${e.offset+e.limit}`)}else r(`${t.length} shown (${e.total} total)`)}async function B(t,e,r){if(r.username&&r.accessKey)return{ok:!0,creds:{username:r.username,access_key:r.accessKey}};let n=new h,o=n.loadBasicAuth(t,e);if(o)return{ok:!0,creds:{username:o.username,access_key:o.access_key}};let i=n.loadCredentials(t,e);if(!i)return{ok:!1,reason:"no_credentials"};let s=i.access_token;try{let{refreshOAuthToken:d}=await import("./token-refresh-NADDXLYM.js"),w=await d({creds:n,profile:t,env:e,credentials:i});w&&(s=w.accessToken)}catch(d){return{ok:!1,reason:"refresh_failed",detail:d instanceof Error?d.message:String(d)}}let c=y(e),f=await new k(c.controllerBaseUrl,async()=>s,null).resolve();return f?{ok:!0,creds:{username:f.username,access_key:f.access_key}}:{ok:!1,reason:"exchange_failed"}}function E(t,e,r){switch(r.reason){case"no_credentials":return{message:`error: no credentials for profile "${t}" [${e}]. Run \`kane-cli login\` or pass --username/--access-key.
|
|
5
5
|
`,exitCode:2};case"refresh_failed":return{message:`error: OAuth token refresh failed for profile "${t}" [${e}]${r.detail?`: ${r.detail}`:""}. Run \`kane-cli login\` to re-auth.
|
|
6
6
|
`,exitCode:2};case"exchange_failed":return{message:`error: TMS credential exchange failed for profile "${t}" [${e}]. Token may be revoked \u2014 try \`kane-cli login\`; if the problem persists, TMS may be down.
|
|
7
7
|
`,exitCode:2}}}function O(t){return{id:t.project_id,name:t.name}}function M(t){return{id:t.id,name:t.name}}async function P(t,e,r,n){let o=r+n+1,i=[],s=!0;for await(let c of t.listProjectsStream({name:e})){if(i.push(...c.projects),c.done){s=!0;break}if(i.length>=o){s=!1;break}}return{items:i,doneStreaming:s}}function g(t){return!!t.agent||!process.stdin.isTTY||!process.stdout.isTTY}function _(t,e=r=>process.stdout.write(`${r}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as B}from"./chunk-S3DAAAE5.js";import{a as g}from"./chunk-
|
|
2
|
+
import{b as B}from"./chunk-S3DAAAE5.js";import{a as g}from"./chunk-RBFCGUR3.js";import{y as s}from"./chunk-PHR2OSWD.js";import{a as w}from"./chunk-HCBYKLMW.js";import{a as x,b as t,c as h,i as P,j as S}from"./chunk-C44QQJR4.js";import{a as C}from"./chunk-6YGTRKDT.js";import{e as T}from"./chunk-UR6MHSHU.js";var o=T(C(),1);var e=T(w(),1);function D({defaultName:i,onSubmit:c}){let[d,p]=(0,o.useState)("confirm"),[f,a]=(0,o.useState)(""),[m,u]=(0,o.useState)(null),l=(0,o.useMemo)(()=>f.trim()||i,[f,i]);return P((n,r)=>{if(d==="confirm"){if(n==="y"||n==="Y"){a(i),p("name");return}if(n==="n"||n==="N"||r.escape||r.ctrl&&n==="c"){c(null);return}if(r.return){c(i);return}return}if(r.return){if(!B(l)){u(`name "${l}" is invalid; allowed: letters, digits, underscore, hyphen`);return}c(l);return}if(r.escape||r.ctrl&&n==="c"){c(null);return}if(r.backspace||r.delete){a(v=>v.slice(0,-1)),u(null);return}n&&!r.ctrl&&!r.meta&&(a(v=>v+n),u(null))}),d==="confirm"?(0,e.jsx)(g,{title:"Save session?",titleColor:"#ff9500",rows:[{label:"name",value:(0,e.jsx)(t,{color:s.orange,children:i})}],footer:(0,e.jsxs)(x,{flexDirection:"column",children:[(0,e.jsx)(t,{color:s.dim,children:"enter \u2014 save with this name"}),(0,e.jsx)(t,{color:s.dim,children:"Y \u2014 edit name"}),(0,e.jsx)(t,{color:s.dim,children:"N/esc \u2014 discard session"})]})}):(0,e.jsx)(g,{title:"Save session?",titleColor:"#ff9500",rows:[{label:"name",value:(0,e.jsxs)(x,{children:[(0,e.jsx)(t,{color:s.orange,children:f}),(0,e.jsx)(t,{inverse:!0,children:" "})]})}],footer:(0,e.jsxs)(x,{flexDirection:"column",children:[m&&(0,e.jsx)(t,{color:s.red,children:m}),(0,e.jsx)(t,{color:s.dim,children:"enter \u2014 save \xB7 esc \u2014 discard"})]})})}function V(){return new Date().toISOString().slice(0,19).replace(/:/g,"-")}async function Y(i){return new Promise(c=>{function d(){let{exit:a}=S(),[m,u]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{if(m){let l=setTimeout(()=>a(),50);return()=>clearTimeout(l)}},[m,a]),(0,e.jsx)(D,{defaultName:i,onSubmit:l=>{c(l),u(!0)}})}let{waitUntilExit:p,unmount:f}=h((0,e.jsx)(d,{}),{stdout:process.stderr,exitOnCtrlC:!1});p().then(()=>{try{f()}catch{}})})}export{D as a,V as b,Y as c};
|