@testmuai/kane-cli 0.10.0 → 0.10.3
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-Z26BOE5U.js +2 -0
- package/dist/{ChromeProfilePicker-FWPUDKD6.js → ChromeProfilePicker-ODRIAXL3.js} +1 -1
- package/dist/{CliFeedbackPrompt-D5L2DO6A.js → CliFeedbackPrompt-JWCTMIGI.js} +1 -1
- package/dist/{CliUploadProgress-HQX57WE6.js → CliUploadProgress-XFRRFRL4.js} +1 -1
- package/dist/{ConfigView-DGQXKEON.js → ConfigView-6JF4DOJN.js} +1 -1
- package/dist/EvidenceViewOffer-6344EX74.js +2 -0
- package/dist/FolderPicker-4PCYHE75.js +2 -0
- package/dist/InfoBox-NJ2DL7YC.js +2 -0
- package/dist/{LinksBox-WZ4RAMSH.js → LinksBox-HNDNFVUT.js} +1 -1
- package/dist/{ProfilesView-AGRNPGSW.js → ProfilesView-DEJKJOHY.js} +1 -1
- package/dist/ProjectPicker-DTWMWOH7.js +2 -0
- package/dist/SaveSessionPrompt-3GCLB3ZT.js +2 -0
- package/dist/SingleShotApp-HMOXO5DW.js +2 -0
- package/dist/{SummaryBox-XQJUZBAN.js → SummaryBox-7PPDMSSM.js} +1 -1
- package/dist/TestMdRunView-QLKRUU4V.js +2 -0
- package/dist/TestrunEvidenceTable-T2JUB4TE.js +2 -0
- package/dist/{WhoamiView-JQCURK2M.js → WhoamiView-H7JNLLCY.js} +1 -1
- package/dist/{app-download-OU6AGH2X.js → app-download-GKRF2EIM.js} +1 -1
- package/dist/{assurance-job-ZI3L6I4F.js → assurance-job-F4L3T4VJ.js} +1 -1
- package/dist/{auth-7Z54TMQQ.js → auth-WBIEHHDS.js} +1 -1
- package/dist/{binary-S5YL5GJD.js → binary-K3XMILST.js} +1 -1
- package/dist/{bind-LIV72SEZ.js → bind-SSHAZAB3.js} +1 -1
- package/dist/{bootstrap-3V6TOO6I.js → bootstrap-XGKU4WXB.js} +1 -1
- package/dist/bridge-2UHJOVLX.js +2 -0
- package/dist/{catalog-I3PC6LT6.js → catalog-YCU6OHNV.js} +1 -1
- package/dist/{catalog-client-WKYG3JN6.js → catalog-client-MVEEHTG2.js} +1 -1
- package/dist/{changelog-IHNWFYWY.js → changelog-5UB3AQT6.js} +1 -1
- package/dist/chat-committer-ZKEKJA2R.js +2 -0
- package/dist/chat-controller-FXRJXUG3.js +2 -0
- package/dist/child-JHYENXE7.js +2 -0
- package/dist/{chunk-ZTAZ2R5Z.js → chunk-23DKB2MT.js} +1 -1
- package/dist/{chunk-UX2CDUPE.js → chunk-2JFRN62I.js} +2 -2
- package/dist/chunk-2RBMQTYS.js +26 -0
- package/dist/{chunk-VVCZRCRD.js → chunk-2TK4MDF2.js} +1 -1
- package/dist/{chunk-G3J4XY3Z.js → chunk-32HED7X2.js} +1 -1
- package/dist/{chunk-GRURFGBP.js → chunk-32MFECUA.js} +1 -1
- package/dist/{chunk-N3KTLWJL.js → chunk-35BG2EMW.js} +1 -1
- package/dist/{chunk-4523YDTG.js → chunk-35WUYKGO.js} +1 -1
- package/dist/{chunk-KDR662D2.js → chunk-3KY7HHQU.js} +1 -1
- package/dist/{chunk-UNWPBMVM.js → chunk-3MD2XLE7.js} +2 -2
- package/dist/{chunk-YKL5H4K6.js → chunk-3NWUXRSI.js} +1 -1
- package/dist/{chunk-QQI6N3FO.js → chunk-3RO2YGKH.js} +1 -1
- package/dist/{chunk-AGXAJ2II.js → chunk-3ZC7GSMM.js} +1 -1
- package/dist/{chunk-I2MC6VVX.js → chunk-4C7WVQOD.js} +1 -1
- package/dist/{chunk-VQZOKTJ2.js → chunk-4CJQ7XZP.js} +1 -1
- package/dist/{chunk-7KX2BHKG.js → chunk-4KCYNP2K.js} +1 -1
- package/dist/{chunk-AUBSLPJZ.js → chunk-4KL3TSTT.js} +5 -5
- package/dist/{chunk-AG5XJWEV.js → chunk-4UX5N7YI.js} +1 -1
- package/dist/{chunk-WERIGVOH.js → chunk-5F5IVART.js} +1 -1
- package/dist/{chunk-RFEON5GN.js → chunk-5XVWT6UK.js} +1 -1
- package/dist/{chunk-FBQ7PQJV.js → chunk-5YYCCM6K.js} +1 -1
- package/dist/{chunk-SBR6D6GS.js → chunk-6FFX4S7N.js} +1 -1
- package/dist/{chunk-DHYGCHKB.js → chunk-6HRNG4CK.js} +1 -1
- package/dist/{chunk-HBVHIEPB.js → chunk-6QCCTZO3.js} +1 -1
- package/dist/{chunk-GI2JPIX5.js → chunk-6QH75BPJ.js} +1 -1
- package/dist/{chunk-5R3ODQHH.js → chunk-6SD4XTYC.js} +1 -1
- package/dist/{chunk-J4LQAT5P.js → chunk-7LYLJ75Z.js} +1 -1
- package/dist/{chunk-Y3YULFCK.js → chunk-7RELCXRW.js} +1 -1
- package/dist/{chunk-GXMD23XB.js → chunk-7SU53QGU.js} +1 -1
- package/dist/{chunk-DTYT6KBO.js → chunk-7Y55CO42.js} +1 -1
- package/dist/{chunk-2L3A5NKZ.js → chunk-7YV2FCN4.js} +1 -1
- package/dist/{chunk-ULGBK4NS.js → chunk-A2DODRHG.js} +1 -1
- package/dist/{chunk-EVZLINBN.js → chunk-AHT2ORJT.js} +1 -1
- package/dist/{chunk-RDH3E25Q.js → chunk-AT7AT3AR.js} +2 -2
- package/dist/{chunk-ZI3X7DI2.js → chunk-AVLYSNEG.js} +1 -1
- package/dist/{chunk-GET4DINR.js → chunk-BBJAKSA7.js} +1 -1
- package/dist/{chunk-CBVHP7JB.js → chunk-BJO6J5X2.js} +1 -1
- package/dist/{chunk-G3CYFCSR.js → chunk-BLVDV3QQ.js} +1 -1
- package/dist/{chunk-2N75WO7Y.js → chunk-C4KAPGBS.js} +1 -1
- package/dist/{chunk-XLQ4F6BI.js → chunk-CB2BWDHG.js} +2 -2
- package/dist/chunk-CB344EDO.js +2 -0
- package/dist/chunk-CCOD4GQJ.js +2 -0
- package/dist/{chunk-JSLKCCD2.js → chunk-CNHKZE4F.js} +1 -1
- package/dist/{chunk-CJE7PKRV.js → chunk-CQDCNP7V.js} +1 -1
- package/dist/{chunk-3OVFKUXV.js → chunk-CTHUX7O4.js} +1 -1
- package/dist/{chunk-4JWJH6TB.js → chunk-DC5F2ADJ.js} +1 -1
- package/dist/chunk-DIOK3SER.js +34 -0
- package/dist/{chunk-EQWMOGLO.js → chunk-DQXQJJOP.js} +2 -2
- package/dist/{chunk-EH43VWVR.js → chunk-DXIQVBMI.js} +1 -1
- package/dist/{chunk-WZLDFEWR.js → chunk-E4GIGM5V.js} +1 -1
- package/dist/{chunk-K3OSK6PB.js → chunk-EBJW6POT.js} +1 -1
- package/dist/{chunk-MYZHOBS4.js → chunk-EHB55V23.js} +1 -1
- package/dist/{chunk-RARD6TC6.js → chunk-EJGCIGQY.js} +1 -1
- package/dist/{chunk-OR2B6T3B.js → chunk-ENRFXGID.js} +1 -1
- package/dist/{chunk-3ZPEQDXZ.js → chunk-ERRIDBE7.js} +1 -1
- package/dist/{chunk-HGVM2OZU.js → chunk-EZMRWXRT.js} +1 -1
- package/dist/chunk-F2F257PU.js +6 -0
- package/dist/{chunk-AUJSC7PU.js → chunk-FNUGDPTS.js} +1 -1
- package/dist/{chunk-MPEIMWQI.js → chunk-FOLUB336.js} +1 -1
- package/dist/{chunk-HHW6MRU3.js → chunk-G4K3TP2I.js} +1 -1
- package/dist/{chunk-P2ZQDQDB.js → chunk-GAKBHNC4.js} +1 -1
- package/dist/{chunk-DPGOAFKF.js → chunk-GBQ4K25P.js} +1 -1
- package/dist/{chunk-PCDIEYV6.js → chunk-GEZVC4S3.js} +1 -1
- package/dist/{chunk-PL3SG3M2.js → chunk-GJXO6FF7.js} +1 -1
- package/dist/{chunk-252GEI3H.js → chunk-GLM5UGTF.js} +1 -1
- package/dist/{chunk-JOCEZK2M.js → chunk-GQAWZEA4.js} +1 -1
- package/dist/{chunk-45URQUAK.js → chunk-GXQYFOBD.js} +1 -1
- package/dist/{chunk-PBWYQR5I.js → chunk-HBLHKQR7.js} +1 -1
- package/dist/chunk-HC6VLPUB.js +5 -0
- package/dist/{chunk-K2PLULJD.js → chunk-HRIDAK6Y.js} +1 -1
- package/dist/{chunk-D6CS62O7.js → chunk-HV2CDY4K.js} +1 -1
- package/dist/{chunk-P2LDAW3C.js → chunk-HVOXMCKE.js} +1 -1
- package/dist/{chunk-4I7YN6YY.js → chunk-HYJVYYAZ.js} +2 -2
- package/dist/{chunk-GYDJO32R.js → chunk-IEHJG6J4.js} +1 -1
- package/dist/{chunk-GGS3ATPB.js → chunk-IZ66FKPC.js} +1 -1
- package/dist/{chunk-QMOGBKJM.js → chunk-J4FIESTB.js} +1 -1
- package/dist/{chunk-436FZ4KG.js → chunk-JBKHX5ES.js} +1 -1
- package/dist/{chunk-EX6ORR7P.js → chunk-JNPFEBUR.js} +1 -1
- package/dist/{chunk-AU26ZZTX.js → chunk-JTNEF5ZP.js} +1 -1
- package/dist/{chunk-5IO5ZC4S.js → chunk-KBGMQYMD.js} +1 -1
- package/dist/{chunk-WX4VGH5Q.js → chunk-KCXLRR3Q.js} +1 -1
- package/dist/{chunk-4R4YUOVY.js → chunk-KKLCXRW6.js} +1 -1
- package/dist/{chunk-YGMQXS2J.js → chunk-KL7XFNSD.js} +1 -1
- package/dist/{chunk-MJKRJGER.js → chunk-KQ4XKTIZ.js} +1 -1
- package/dist/{chunk-I2VU2DTS.js → chunk-L3BUPFAQ.js} +4 -4
- package/dist/{chunk-ZZNQIFFI.js → chunk-LHJSIHLC.js} +1 -1
- package/dist/{chunk-2GE5X2A5.js → chunk-LLQWEGXD.js} +1 -1
- package/dist/{chunk-PQXYHI5W.js → chunk-LPJKNX6D.js} +1 -1
- package/dist/{chunk-ZGQM6KWN.js → chunk-LRNUGKYH.js} +1 -1
- package/dist/chunk-LTPOMMAB.js +2 -0
- package/dist/{chunk-MHB6DMKZ.js → chunk-LUA25RYS.js} +1 -1
- package/dist/{chunk-2PZKMT3I.js → chunk-LV7224DG.js} +1 -1
- package/dist/{chunk-X3J4CC27.js → chunk-LXK4B2FE.js} +1 -1
- package/dist/{chunk-YH4VZVHJ.js → chunk-LZGAFKYH.js} +1 -1
- package/dist/{chunk-3QICDXY5.js → chunk-LZPYIFHZ.js} +1 -1
- package/dist/{chunk-4BUEOKFV.js → chunk-M2E5CPPV.js} +1 -1
- package/dist/{chunk-65BG6GAE.js → chunk-M7A66MSK.js} +1 -1
- package/dist/{chunk-JX5NVKTV.js → chunk-MD3RABID.js} +1 -1
- package/dist/{chunk-QECTIQAC.js → chunk-MEBEVHGP.js} +1 -1
- package/dist/{chunk-52VCA4K2.js → chunk-MEMXFTLD.js} +1 -1
- package/dist/{chunk-U7NRZBB5.js → chunk-MINDIQET.js} +1 -1
- package/dist/{chunk-HJLMH7ZM.js → chunk-MUX2A37P.js} +1 -1
- package/dist/{chunk-YKOEABP2.js → chunk-N7IWR45S.js} +1 -1
- package/dist/{chunk-WQR2GYP7.js → chunk-ND6OP3O2.js} +1 -1
- package/dist/{chunk-URAYFJGM.js → chunk-NHGPMYM3.js} +1 -1
- package/dist/{chunk-ZKPY3AXW.js → chunk-NI3TIAD7.js} +1 -1
- package/dist/{chunk-JCSVBD4F.js → chunk-NPAUSUNM.js} +1 -1
- package/dist/{chunk-XMALVGH7.js → chunk-NRAPCFI2.js} +2 -2
- package/dist/{chunk-567D5ZTO.js → chunk-NZJSGINB.js} +16 -16
- package/dist/{chunk-A4BB6GLN.js → chunk-OBNVGD5H.js} +1 -1
- package/dist/{chunk-BRVIK3BU.js → chunk-OCMPWCKQ.js} +1 -1
- package/dist/{chunk-4SJAOAYY.js → chunk-OCVDMZWB.js} +1 -1
- package/dist/{chunk-JRSEAXFE.js → chunk-OHGL4GEJ.js} +1 -1
- package/dist/{chunk-YYVBE6W2.js → chunk-OOGKX4Y6.js} +1 -1
- package/dist/{chunk-QWZJ5QDO.js → chunk-OTMHCHH6.js} +2 -2
- package/dist/{chunk-Z5BFCTHI.js → chunk-OZNYQONA.js} +2 -2
- package/dist/{chunk-EPJ5SJL2.js → chunk-PB6RXDWQ.js} +2 -2
- package/dist/{chunk-TZVPDGJD.js → chunk-PCQK62MP.js} +1 -1
- package/dist/{chunk-Z777GGHB.js → chunk-PI7OXS62.js} +1 -1
- package/dist/{chunk-MW2WNYJO.js → chunk-PRBWZXFA.js} +2 -2
- package/dist/{chunk-2SY2NCOP.js → chunk-PTLOOVV4.js} +1 -1
- package/dist/{chunk-EC5IP5HZ.js → chunk-Q4ALB7SH.js} +1 -1
- package/dist/{chunk-FYCD765R.js → chunk-Q4JV4U65.js} +58 -58
- package/dist/{chunk-CJQUVHHS.js → chunk-Q4SMITTV.js} +1 -1
- package/dist/{chunk-NJCN6LP5.js → chunk-QE4AWNOV.js} +6 -6
- package/dist/{chunk-BY2B4YJN.js → chunk-QEM5ZRDN.js} +1 -1
- package/dist/{chunk-VA3BSIUQ.js → chunk-QHH42RH5.js} +1 -1
- package/dist/{chunk-FPPVNF53.js → chunk-R6TFRAMZ.js} +1 -1
- package/dist/{chunk-3T2TYDPT.js → chunk-RNHSULQM.js} +1 -1
- package/dist/{chunk-32Y6QVFG.js → chunk-SALZ6WSF.js} +1 -1
- package/dist/chunk-SB26HQO7.js +2 -0
- package/dist/{chunk-4NUSW4A2.js → chunk-SIHX5FW5.js} +1 -1
- package/dist/{chunk-LHQUCRCH.js → chunk-SJQTTEXQ.js} +1 -1
- package/dist/{chunk-W3NWHWK2.js → chunk-SMGRXKXX.js} +1 -1
- package/dist/{chunk-USJ3LUAL.js → chunk-SSOUYKVG.js} +1 -1
- package/dist/{chunk-2B75UL7Y.js → chunk-SVIIUKJ2.js} +1 -1
- package/dist/{chunk-7ZJWUWSN.js → chunk-SXBPUUQ5.js} +1 -1
- package/dist/{chunk-QVP4FSKT.js → chunk-T77LTLAD.js} +1 -1
- package/dist/{chunk-KRRZCY7U.js → chunk-TAY7J5VS.js} +1 -1
- package/dist/chunk-TD6GCEIK.js +2 -0
- package/dist/{chunk-VZA7BPCK.js → chunk-TM45NPWL.js} +1 -1
- package/dist/{chunk-ZY65IZJR.js → chunk-TM6VLC6V.js} +1 -1
- package/dist/{chunk-COJINPOK.js → chunk-TU2KPOW2.js} +2 -2
- package/dist/{chunk-JTJ7IPNI.js → chunk-TUSG7DIL.js} +1 -1
- package/dist/{chunk-3BSYOCSW.js → chunk-U2VYTVKV.js} +1 -1
- package/dist/{chunk-JQ7ZZQXC.js → chunk-UJ37XGSP.js} +3 -3
- package/dist/chunk-ULIIYKZB.js +7 -0
- package/dist/{chunk-LNHBZEDC.js → chunk-UWPG5MWM.js} +1 -1
- package/dist/{chunk-UUWSULIM.js → chunk-UXGMKRS4.js} +61 -60
- package/dist/{chunk-6DZ7LVOG.js → chunk-VCVEZEVS.js} +1 -1
- package/dist/{chunk-ZRDX2ARO.js → chunk-VKVYT6KZ.js} +2 -2
- package/dist/{chunk-B2WFW74J.js → chunk-VO2NNXKR.js} +1 -1
- package/dist/{chunk-B7JLM3IX.js → chunk-W54BX6HC.js} +1 -1
- package/dist/{chunk-IZ65ZPWY.js → chunk-W5HFUBXD.js} +1 -1
- package/dist/{chunk-TLOYTGVT.js → chunk-WE7HRAGO.js} +1 -1
- package/dist/{chunk-GRO6DLN3.js → chunk-WEJR2V7R.js} +1 -1
- package/dist/{chunk-YI4ESDAX.js → chunk-WIVKLNIO.js} +1 -1
- package/dist/chunk-WLEWXE6L.js +2 -0
- package/dist/{chunk-DBTMKBHU.js → chunk-X2MDL6S4.js} +1 -1
- package/dist/{chunk-MKPDF26Q.js → chunk-X45RZIAJ.js} +1 -1
- package/dist/{chunk-G2KTWFMU.js → chunk-X52YIWGG.js} +1 -1
- package/dist/{chunk-UEPJ26X2.js → chunk-X6FCXBXU.js} +1 -1
- package/dist/{chunk-LXM7VHYN.js → chunk-X7S7IGCV.js} +1 -1
- package/dist/{chunk-FVYIV36L.js → chunk-XKOVEMVZ.js} +1 -1
- package/dist/{chunk-3UHPVQLU.js → chunk-Y2HQMJGS.js} +1 -1
- package/dist/{chunk-4MNSP4EO.js → chunk-Y3RJHWNK.js} +1 -1
- package/dist/{chunk-A3TCFSCK.js → chunk-YCVEI7BT.js} +1 -1
- package/dist/{chunk-JGRXMTME.js → chunk-YDB72F4K.js} +1 -1
- package/dist/{chunk-7C4IEL5V.js → chunk-YILRYMMG.js} +1 -1
- package/dist/{chunk-7DFBOVUB.js → chunk-YJAQZMJT.js} +1 -1
- package/dist/{chunk-JGLADDRH.js → chunk-YNDELIXL.js} +1 -1
- package/dist/{chunk-WKZLK57W.js → chunk-YPGZ5E4I.js} +1 -1
- package/dist/{chunk-NTXFPNAP.js → chunk-YQZ736IQ.js} +1 -1
- package/dist/{chunk-FPVGA6XT.js → chunk-YVVFXBT5.js} +1 -1
- package/dist/{chunk-JT6WLJSV.js → chunk-YWWVF5OU.js} +1 -1
- package/dist/{chunk-RLOJH5O6.js → chunk-Z24SD2EJ.js} +1 -1
- package/dist/{chunk-ENG2UTMX.js → chunk-Z36KVIRR.js} +1 -1
- package/dist/{chunk-JFBEHCJN.js → chunk-Z47ZEFH7.js} +1 -1
- package/dist/{chunk-6NFOH4AC.js → chunk-ZAQGIC33.js} +1 -1
- package/dist/{chunk-GGV336P5.js → chunk-ZCBOHWN3.js} +1 -1
- package/dist/{chunk-AIGQCMGY.js → chunk-ZCL7XIVS.js} +1 -1
- package/dist/{chunk-ORNVIEUA.js → chunk-ZDCXWEQG.js} +1 -1
- package/dist/{chunk-6TNLITJO.js → chunk-ZHAMVLQZ.js} +1 -1
- package/dist/{chunk-FLOQ5NZL.js → chunk-ZIHQ5JGB.js} +4 -4
- package/dist/{chunk-PTISAIZW.js → chunk-ZMIKNNO6.js} +1 -1
- package/dist/{chunk-H4KPNGY4.js → chunk-ZMWTRXFH.js} +1 -1
- package/dist/{chunk-ONZ2CSTZ.js → chunk-ZPU3WAC4.js} +1 -1
- package/dist/commands-JBFLLT7A.js +2 -0
- package/dist/{committer-26UZDYSA.js → committer-UO3B3S5Y.js} +1 -1
- package/dist/{config-B472DZSR.js → config-7WTZPMAH.js} +1 -1
- package/dist/cover-cmd-DU6ZYJFL.js +2 -0
- package/dist/{credentials-TLT3RQOO.js → credentials-5WIFF5DG.js} +1 -1
- package/dist/{deps-bundle-CMTIWBS5.js → deps-bundle-BLLJ2BQ4.js} +1 -1
- package/dist/{deps-resolve-XLFZK74A.js → deps-resolve-WQ6J6RLI.js} +1 -1
- package/dist/{design-chat-I7X3QDDY.js → design-chat-ZICGVYIH.js} +1 -1
- package/dist/design-committer-7YIPFKMO.js +2 -0
- package/dist/design-headless-HYWZIIDS.js +2 -0
- package/dist/{design-remote-UDC5FP45.js → design-remote-HPX4VZ63.js} +2 -2
- package/dist/device-env-4P4GUVBW.js +2 -0
- package/dist/dispatch-BV6XMCN3.js +2 -0
- package/dist/{doctor-UHFCIM4B.js → doctor-Z2YQ2DBX.js} +1 -1
- package/dist/{docx-convert-N4KMLLKO.js → docx-convert-DO5AQYD3.js} +1 -1
- package/dist/{dossier-6KMKEIXV.js → dossier-5XKNAK6Q.js} +1 -1
- package/dist/evidence-BJIID6VT.js +2 -0
- package/dist/evidence-presentation-LSFOZGLH.js +2 -0
- package/dist/evolve-cmd-GZCUSCEK.js +2 -0
- package/dist/evolve-remote-LILOAHYH.js +2 -0
- package/dist/{explain-cmd-R67B4YR3.js → explain-cmd-KNDORU2D.js} +1 -1
- package/dist/{explain-cmd-235TY7QX.js → explain-cmd-LXIVHGN7.js} +1 -1
- package/dist/explore-SA2P3SGX.js +2 -0
- package/dist/{explore-context-tty-YXEFT32U.js → explore-context-tty-PERKIWXD.js} +1 -1
- package/dist/{explore-entry-V6L5FSP4.js → explore-entry-E6EY3VV3.js} +4 -4
- package/dist/{explore-live-N5VBLBUI.js → explore-live-XIWWUV52.js} +1 -1
- package/dist/{explore-run-tty-ZZQ33GNA.js → explore-run-tty-M56I23IF.js} +2 -2
- package/dist/{extract-bind-BTINHHE5.js → extract-bind-LZ22VFKB.js} +3 -3
- package/dist/extract-chat-Z64LEAJ5.js +2 -0
- package/dist/{extract-cmd-45OZETCM.js → extract-cmd-46E2XDWZ.js} +2 -2
- package/dist/extract-headless-XLS56LMN.js +2 -0
- package/dist/{feeder-L55TH2NC.js → feeder-NGWIPZ26.js} +1 -1
- package/dist/folder-flags-ZIDJVDKX.js +2 -0
- package/dist/gaps-cmd-XYOBJVTO.js +3 -0
- package/dist/gate-AK44VDHC.js +2 -0
- package/dist/gate-NB5CJMTN.js +2 -0
- package/dist/{generate-headless-DAH3HHRQ.js → generate-headless-HXAVEAEZ.js} +2 -2
- package/dist/hold-passthrough-JGHWMYDM.js +2 -0
- package/dist/{impact-cmd-3VFJAKYK.js → impact-cmd-TJTUFAFO.js} +2 -2
- package/dist/index.js +4159 -190
- package/dist/ingest-ZHHHBUXR.js +2 -0
- package/dist/{ingest-cmd-YSEH5EPU.js → ingest-cmd-OJSKTSQK.js} +3 -3
- package/dist/ingest-remote-2WM6PYUW.js +2 -0
- package/dist/install-JBWBF3WX.js +2 -0
- package/dist/{interactive-bind-P3GTFIZM.js → interactive-bind-SOD7VTAY.js} +4 -4
- package/dist/{interactive-remote-PBRQHTAF.js → interactive-remote-7ZSTI66T.js} +1 -1
- package/dist/lane-CNGO7LH5.js +2 -0
- package/dist/lattice-auth-UQPFQSG7.js +2 -0
- package/dist/{lifecycle-cmd-PUNFWKV5.js → lifecycle-cmd-DGIO3VAO.js} +1 -1
- package/dist/{list-cmd-RD7YBF4S.js → list-cmd-HQIN3HX4.js} +1 -1
- package/dist/{list-commands-UZELZAB3.js → list-commands-OFRRBU3D.js} +1 -1
- package/dist/{list-remote-KGKXPCQA.js → list-remote-EFCET42K.js} +1 -1
- package/dist/{locks-cmd-LXZ6I4QG.js → locks-cmd-AZKCSGHI.js} +1 -1
- package/dist/{logical-ids-D5PFYY4C.js → logical-ids-74PLU3VR.js} +1 -1
- package/dist/login-flow-SYKXXDLH.js +2 -0
- package/dist/{maintenance-cmd-WRWBCP3R.js → maintenance-cmd-X5247RSJ.js} +1 -1
- package/dist/{mobile-prompts-Z7NQHRGP.js → mobile-prompts-I66ENBDW.js} +1 -1
- package/dist/{objective-variable-gate-3Z7DNVVC.js → objective-variable-gate-V5HHFOUS.js} +1 -1
- package/dist/{onboarding-ZP4XDYEO.js → onboarding-6HIP3KW6.js} +1 -1
- package/dist/open-provider-XDJKT3W3.js +2 -0
- package/dist/pdf-convert-YB6PJFMI.js +2 -0
- package/dist/persist-recorded-session-RSSMTVF3.js +3 -0
- package/dist/phase-seed-ZZSJME7M.js +2 -0
- package/dist/pipeline-NTJDH5TC.js +2 -0
- package/dist/{policy-commands-TY6WOR73.js → policy-commands-4PUGESCW.js} +1 -1
- package/dist/{prepare-target-EVL2QSXA.js → prepare-target-AI3GGZF6.js} +1 -1
- package/dist/{pull-cmd-QJQANBAW.js → pull-cmd-NRVB5ZN7.js} +1 -1
- package/dist/{pull-route-AIOTLA3D.js → pull-route-FWCZW76M.js} +1 -1
- package/dist/readmodel-TRV4E3MW.js +2 -0
- package/dist/real-device-run-NQ7RNH7C.js +2 -0
- package/dist/{reconcile-cmd-IJTQAJZX.js → reconcile-cmd-7B7THAFJ.js} +4 -4
- package/dist/reconcile-deps-UDQBWSLE.js +2 -0
- package/dist/{reconcile-remote-23D6SXXT.js → reconcile-remote-3W6ZTO3G.js} +2 -2
- package/dist/{recording-banner-MNRMMEX4.js → recording-banner-WVDTWTSE.js} +1 -1
- package/dist/registry-PFOSXOIH.js +2 -0
- package/dist/remote-entry-BZU4NFNS.js +2 -0
- package/dist/{remote-mode-AFNCN6EE.js → remote-mode-NXUKDUXG.js} +1 -1
- package/dist/{remote-words-RCNFI2TQ.js → remote-words-JRDDNOZ6.js} +1 -1
- package/dist/{require-project-folder-7UH43GHI.js → require-project-folder-3DTI2CVB.js} +1 -1
- package/dist/{resolve-run-intent-XEWFYMGN.js → resolve-run-intent-QCL7QXIB.js} +1 -1
- package/dist/{resolver-QMPX6RBR.js → resolver-CDF7QKVD.js} +1 -1
- package/dist/revert-QKHPCRT6.js +2 -0
- package/dist/{review-cmd-2OECKNL5.js → review-cmd-XBK3TGRE.js} +1 -1
- package/dist/run-CSYGVV3D.js +2 -0
- package/dist/run-YUHHD54J.js +2 -0
- package/dist/{run-channel-63SVP5OI.js → run-channel-IIIYXOIW.js} +1 -1
- package/dist/run-remote-SFR3F2T5.js +2 -0
- package/dist/{run-startup-gate-USQFSW47.js → run-startup-gate-QSFJRYUY.js} +1 -1
- package/dist/run-test-md-ZSREINDQ.js +20 -0
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-CFV7FOIT.js → sessions-NH2EG7BP.js} +1 -1
- package/dist/{sessions-cmd-LQ2LZQOC.js → sessions-cmd-TLUITRG5.js} +2 -2
- package/dist/{sessions-remote-H7CQST42.js → sessions-remote-INO7AWKB.js} +1 -1
- package/dist/{skill-installer-LKYY6XFJ.js → skill-installer-7JH5QCJF.js} +1 -1
- package/dist/spawner-MQ4XEHIX.js +2 -0
- package/dist/{store-KM5MG3XB.js → store-X4UK4AP7.js} +1 -1
- package/dist/store-choice-27HDIFTU.js +2 -0
- package/dist/{store-guard-34GG2TW2.js → store-guard-ZXKB5DQH.js} +1 -1
- package/dist/{store-site-ZSFINU6C.js → store-site-K5NHLI7D.js} +1 -1
- package/dist/stream-warnings-GM7YEOVG.js +2 -0
- package/dist/sync-cmd-2PCO7LZA.js +2 -0
- package/dist/{sync-setup-QQXYO6R4.js → sync-setup-5WQO73Y5.js} +1 -1
- package/dist/tcg-generate-DGJD5KSM.js +2 -0
- package/dist/testmd-actions-XE2JPQHB.js +2 -0
- package/dist/{testmd-sync-PQ4GFKHB.js → testmd-sync-LYHEXWCT.js} +1 -1
- package/dist/{tms-client-XWCR7O7J.js → tms-client-J4OCD3EP.js} +1 -1
- package/dist/token-refresh-E4FTJVHY.js +2 -0
- package/dist/{trust-gate-AT2XBWN4.js → trust-gate-674C2NZS.js} +1 -1
- package/dist/{turn-preflight-LHYLRL7G.js → turn-preflight-R4PU6NYY.js} +1 -1
- package/dist/{use-case-ref-NA3IXGQW.js → use-case-ref-44BPIP4N.js} +1 -1
- package/dist/{validate-basic-3DX3MMC7.js → validate-basic-66XDPA3S.js} +1 -1
- package/dist/{variable-receipt-BXSZO36E.js → variable-receipt-7PRKDTRJ.js} +1 -1
- package/dist/verdicts-PVB7TV5S.js +2 -0
- package/dist/{version-check-OV6AOVED.js → version-check-SHNVYTMU.js} +1 -1
- package/dist/{view-cmd-QDKBBNIU.js → view-cmd-QOB3O6YW.js} +1 -1
- package/dist/{walk-session-BAYYPIKN.js → walk-session-WIEROYOT.js} +1 -1
- package/dist/with-telemetry-T2PWI5CY.js +2 -0
- package/package.json +16 -16
- package/dist/ChatSurface-XUV3EQPZ.js +0 -2
- package/dist/EvidenceViewOffer-EIANIYN7.js +0 -2
- package/dist/FolderPicker-XOA7FTHF.js +0 -2
- package/dist/InfoBox-OBH7SUGC.js +0 -2
- package/dist/ProjectPicker-6KRLKV4U.js +0 -2
- package/dist/SaveSessionPrompt-J2OPDEOO.js +0 -2
- package/dist/SingleShotApp-QI4B2TSL.js +0 -2
- package/dist/TestMdRunView-I4MV54FB.js +0 -2
- package/dist/TestrunEvidenceTable-WEIUSW3E.js +0 -2
- package/dist/bridge-SDEP7Y33.js +0 -2
- package/dist/chat-committer-FM5NG46O.js +0 -2
- package/dist/chat-controller-FWFQVZTB.js +0 -2
- package/dist/child-H2YSDFCG.js +0 -2
- package/dist/chunk-2EVP636F.js +0 -26
- package/dist/chunk-34R7BNZ2.js +0 -2
- package/dist/chunk-5T6II7VN.js +0 -7
- package/dist/chunk-6K5BEEAJ.js +0 -2
- package/dist/chunk-HMQ5M4JJ.js +0 -34
- package/dist/chunk-KF4DKXSS.js +0 -2
- package/dist/chunk-NOFJXCYP.js +0 -5
- package/dist/chunk-SB6P5EQH.js +0 -2
- package/dist/chunk-Y6Y6RAY4.js +0 -2
- package/dist/commands-QOORPTSI.js +0 -2
- package/dist/cover-cmd-3VO6QC5Y.js +0 -2
- package/dist/design-committer-Y7R56RFZ.js +0 -2
- package/dist/design-headless-HUQOXLZB.js +0 -2
- package/dist/device-env-MMGISNHN.js +0 -2
- package/dist/dispatch-P2445PUU.js +0 -2
- package/dist/evidence-M3JTOJNL.js +0 -2
- package/dist/evidence-presentation-DV3DRB4S.js +0 -2
- package/dist/evolve-cmd-K3JXACMN.js +0 -2
- package/dist/evolve-remote-CUDVV2O2.js +0 -2
- package/dist/explore-UDD5FHXW.js +0 -2
- package/dist/extract-chat-ABZ5S7UU.js +0 -2
- package/dist/extract-headless-ALEFAMVS.js +0 -2
- package/dist/folder-flags-HTKJCXKB.js +0 -2
- package/dist/gaps-cmd-ROGQWK5X.js +0 -3
- package/dist/gate-QA5J7UZA.js +0 -2
- package/dist/gate-XFFFX5ZF.js +0 -2
- package/dist/hold-passthrough-K5PP26CP.js +0 -2
- package/dist/ingest-S5R736ZV.js +0 -2
- package/dist/ingest-remote-C6AP2Q7E.js +0 -2
- package/dist/install-B26Y2NU4.js +0 -2
- package/dist/lane-7IEAE6AC.js +0 -2
- package/dist/lattice-auth-7EL4ET3P.js +0 -2
- package/dist/login-flow-CHLGQGHK.js +0 -2
- package/dist/open-provider-U26BBVUE.js +0 -2
- package/dist/pdf-convert-LMKOKLXT.js +0 -2
- package/dist/persist-recorded-session-4IRYG5CJ.js +0 -3
- package/dist/phase-seed-2H6OXZXT.js +0 -2
- package/dist/pipeline-U7D25NST.js +0 -2
- package/dist/readmodel-KXCFPL2M.js +0 -2
- package/dist/real-device-run-QODMDUXF.js +0 -2
- package/dist/reconcile-deps-2CTIFXDR.js +0 -2
- package/dist/registry-MZYBLEW2.js +0 -2
- package/dist/remote-entry-DW2J56N4.js +0 -2
- package/dist/revert-37346WLE.js +0 -2
- package/dist/run-JWOHNWA3.js +0 -2
- package/dist/run-QFJ6ZRVD.js +0 -2
- package/dist/run-remote-66QTUQ2M.js +0 -2
- package/dist/run-test-md-7DRWCSQE.js +0 -19
- package/dist/spawner-C7NLLM4F.js +0 -2
- package/dist/store-choice-4J2NN6OQ.js +0 -2
- package/dist/stream-warnings-N4KVVWXV.js +0 -2
- package/dist/sync-cmd-3CHSWWWW.js +0 -2
- package/dist/tcg-generate-IPD5FQUW.js +0 -2
- package/dist/testmd-actions-V7P7BMKE.js +0 -2
- package/dist/token-refresh-LR33BKAB.js +0 -2
- package/dist/verdicts-7GKZEDHV.js +0 -2
- package/dist/with-telemetry-62LW4VFI.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as _}from"./chunk-
|
|
2
|
+
import{a as _}from"./chunk-X45RZIAJ.js";import{a as A}from"./chunk-KCXLRR3Q.js";import{a as i}from"./chunk-PVN64537.js";import{a as h}from"./chunk-ZCBOHWN3.js";async function w(d){let{creds:a,env:l,usernameFlag:c,accessKeyFlag:u,log:r}=d,e=null,o=null;if(c&&u)e={username:c,access_key:u},r("info","AUTH_RESOLVE_FLAGS","Auth resolved via CLI flags",{username:c});else{let s=a.resolveAuth();s?.method==="basic"&&(e={username:s.username,access_key:s.access_key},r("info","AUTH_RESOLVE_CONFIG","Auth resolved via config",{username:s.username}))}if(!e){let{credentials:s,profile:k}=a.getActiveCredentials();if(!s)throw new i("Not authenticated \u2014 no credentials found","not_authenticated");if(o=s.access_token,s.expires_at-Date.now()/1e3<300)try{let n=await A({creds:a,profile:k,env:l,credentials:s});n&&(o=n.accessToken,r("info","AUTH_TOKEN_REFRESHED","OAuth token refreshed"))}catch(n){let m=n instanceof Error?n.message:String(n);throw r("error","TOKEN_REFRESH_FAILED","Token refresh failed",{error:m}),new i(`Token refresh failed: ${m}`,"refresh_failed")}}let v=h(l),E=async()=>o,g=e?{username:e.username,access_key:e.access_key}:null,f=new _(v.controllerBaseUrl,E,g,r),t=await f.resolve();return t&&!e&&(e={username:t.username,access_key:t.access_key},r("info","AUTH_RESOLVE_CONTROLLER","Auth resolved via controller",{username:t.username})),{basicAuth:e,token:o,resolver:f,resolvedCreds:t}}export{w as a};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{S as G,T as I,U as O,V as _}from"./chunk-
|
|
2
|
+
import{S as G,T as I,U as O,V as _}from"./chunk-OZNYQONA.js";import{a as S}from"./chunk-HVOXMCKE.js";import{a as u}from"./chunk-73Y6T2UK.js";import{Ia as N}from"./chunk-PI7OXS62.js";import{existsSync as M}from"fs";var q=new Set(["interactive","agent","ci","override"]);function B(t){return t.mode!=null&&!q.has(t.mode)?{error:`design: --mode must be interactive | agent | ci | override, got '${t.mode}'`}:t.strength!=null&&t.strength!=="pairwise"&&t.strength!=="3-wise"?{error:`design: --strength must be pairwise | 3-wise, got '${t.strength}'`}:t.max!=null&&(!Number.isInteger(t.max)||t.max<1)?{error:"design: --max must be a positive integer"}:!t.useCase&&!t.resume?{error:"design: --use-case is required (or --resume <sid> \u2014 the session remembers its use-case)"}:{useCase:t.useCase,max:t.max,strength:t.strength,mode:t.mode,force:t.force,resume:t.resume,plan:t.plan,message:t.message,phase:t.phase,allowUnreviewed:t.allowUnreviewed,because:t.because,changeDelta:t.changeDelta,priorDesign:t.priorDesign,...t.repinsKept?{repinsKept:!0}:{},statement:t.statement}}async function Z(t){let p=async(e,r)=>{if(t.mode!=="agent")return process.stderr.write(e+`
|
|
3
3
|
`),2;let{makeHeadlessIO:i,agentRefusal:d}=await import("./headless-io-FFM5T6KL.js");return d(i("ndjson","design"),e,r)};if(t.mode!=null&&!["interactive","agent","ci","override"].includes(t.mode)){let{makeHeadlessIO:e,agentRefusal:r}=await import("./headless-io-FFM5T6KL.js");return r(e("ndjson","design"),`design: --mode must be interactive | agent | ci | override, got '${t.mode}'`,"MODE_USAGE")}let l=t.json===!0;{let{jsonModeRefusal:e}=await import("./headless-io-FFM5T6KL.js"),r=e("design",t.mode,l);if(r!==null)return process.stderr.write(`${r}
|
|
4
|
-
`),2}let h=B(t);if("error"in h)return p(h.error);let s=h;if(s.useCase?.startsWith("sha256:"))try{let[{openGraph:e},{expandUseCaseRef:r}]=await Promise.all([import("./readmodel-
|
|
5
|
-
next: ${e.remedy}`,e.code);let{makeHeadlessIO:r}=await import("./headless-io-FFM5T6KL.js"),i=r("ndjson","design");return i.event(_(e)),i.done(2,"refused")}}if(s.useCase&&!t.allowUnreviewed)try{let[{openGraph:e},{consentCanStart:r,designEntryGate:i},{peekSession:d}]=await Promise.all([import("./readmodel-
|
|
4
|
+
`),2}let h=B(t);if("error"in h)return p(h.error);let s=h;if(s.useCase?.startsWith("sha256:"))try{let[{openGraph:e},{expandUseCaseRef:r}]=await Promise.all([import("./readmodel-TRV4E3MW.js"),import("./use-case-ref-44BPIP4N.js")]);s.useCase=r(e(u(process.cwd())),s.useCase)}catch{}{let{validateResumeMessage:e}=await import("./headless-io-FFM5T6KL.js"),r=e(s,"design");if(r)return p(r)}{let{gateStructuredFlags:e}=await import("./structured-answers-EQ2AP3F7.js"),r=e(t,"design");if(r)return p(r,"STRUCTURED_FLAGS_USAGE")}if(!M(u(process.cwd())))return p("error: no context store here (run `kane-cli context ingest` + `kane-cli context extract` first)","NO_STORE");{let e=O(u(process.cwd()));if(e){if(t.mode!=="agent")return p(`error: ${e.text}
|
|
5
|
+
next: ${e.remedy}`,e.code);let{makeHeadlessIO:r}=await import("./headless-io-FFM5T6KL.js"),i=r("ndjson","design");return i.event(_(e)),i.done(2,"refused")}}if(s.useCase&&!t.allowUnreviewed)try{let[{openGraph:e},{consentCanStart:r,designEntryGate:i},{peekSession:d}]=await Promise.all([import("./readmodel-TRV4E3MW.js"),import("./trust-gate-674C2NZS.js"),import("./sessions-NH2EG7BP.js")]),y;try{y=s.resume?d(u(process.cwd()),s.resume)?.use_case:void 0}catch{y=void 0}let o=i(e(u(process.cwd())),{useCase:s.useCase,resuming:!!s.resume,sessionUseCase:y});if(o){let b=r(o),T=s.mode??"interactive";if(b&&T==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY){let{createInterface:x}=await import("readline/promises"),m=x({input:process.stdin,output:process.stderr}),g=(await m.question(`design: ${o.detail}
|
|
6
6
|
Design against it anyway? (y/N) `)).trim().toLowerCase();if(m.close(),g!=="y"&&g!=="yes")return process.stderr.write(`aborted \u2014 approve it first: ${o.reviewCmd}
|
|
7
7
|
`),2;s.allowUnreviewed=!0}else if(t.mode==="agent"){let{makeHeadlessIO:x}=await import("./headless-io-FFM5T6KL.js"),m=x("ndjson","design");m.event({type:"error",code:o.code,message:`design: ${o.detail}`,next:[o.reviewCmd]});let g=`kane-cli design tests --use-case ${s.useCase} --mode agent --allow-unreviewed`;return m.event({type:"done",status:"refused",exit_code:2,next:b?[o.reviewCmd,g]:[o.reviewCmd]}),2}else return process.stderr.write(`design: ${o.detail} (${o.reviewCmd})
|
|
8
8
|
`),2}}catch(e){process.env.KANE_DEBUG&&process.stderr.write(`trust gate skipped: ${String(e)}
|
|
9
9
|
`)}let n=null,f=null;try{if(!s.mode&&!process.stdin.isTTY)return process.stderr.write(`design: no TTY \u2014 pass an explicit --mode agent|ci|override to run headless
|
|
10
10
|
`),2;let e=s.mode??"interactive";if(e==="interactive"){if(!process.stdin.isTTY||!process.stdout.isTTY)return process.stderr.write(`design: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
11
|
-
`),2;let{bindDesignInteractive:a}=await import("./interactive-bind-
|
|
11
|
+
`),2;let{bindDesignInteractive:a}=await import("./interactive-bind-SOD7VTAY.js");return await a(s)}let{runAgent:r}=await import("./bridge-2UHJOVLX.js"),{makeInterruptGuard:i}=await import("./interrupt-guard-QETBPINI.js"),{baseUrlAdvisory:d}=await import("./turn-preflight-R4PU6NYY.js"),{makeHeadlessIO:y,resolveEncoding:o,guardedChannels:b}=await import("./headless-io-FFM5T6KL.js"),{withStructuredNext:T,prepareStructuredResume:x}=await import("./structured-answers-EQ2AP3F7.js");n=T(y(o(e,l),"design"));let m=await G(u(process.cwd()));m&&(o(e,l)==="ndjson"?n.event(I(m)):n.progress(m.text));let g=n,k=a=>{g.out(a),g.event({type:"note",text:a})},{telemetryBootstrap:Y,telemetryEnvName:H}=await import("./bootstrap-XGKU4WXB.js"),v=Y({verb:"design",mode:e,contextRoot:u(process.cwd()),env:H(),resumeSid:s.resume,write:!0,longSession:!0});f=a=>v.end(a);let c=x({opts:t,reader:S(u(process.cwd())).sessions(),verb:"design"});if(c.kind==="refuse")return n.out(c.error),e==="agent"&&n.event({type:"error",message:c.error,code:c.code}),await v.end({exit_code:2}),e==="agent"?n.done(2,"refused"):2;let D;if(c.kind==="apply"){for(let a of c.notes)k(a);if(c.matchedQids.length>0){k(`applying ${c.matchedQids.length} structured answer(s) from --answer to the paused session's pending questions`);for(let a of c.matchedQids)n.event({type:"panel_resolved",id:a,by:"user",via:"flag"})}c.statement&&(D=[s.message,c.statement].filter(Boolean).join(`
|
|
12
12
|
|
|
13
|
-
`))}let R=d();R&&k(R);let C=i(r,a=>n.out(a)),j=b(n,()=>C.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let a=e==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY?async E=>{let{createInterface:L}=await import("readline/promises"),A=L({input:process.stdin,output:process.stdout});try{return/^y(es)?$/i.test((await A.question(`${E} [y/N] `)).trim())}finally{A.close()}}:void 0,{headlessDesign:P}=await import("./design-headless-
|
|
13
|
+
`))}let R=d();R&&k(R);let C=i(r,a=>n.out(a)),j=b(n,()=>C.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let a=e==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY?async E=>{let{createInterface:L}=await import("readline/promises"),A=L({input:process.stdin,output:process.stdout});try{return/^y(es)?$/i.test((await A.question(`${E} [y/N] `)).trim())}finally{A.close()}}:void 0,{headlessDesign:P}=await import("./design-headless-HYWZIIDS.js"),{localSite:K}=await import("./store-site-K5NHLI7D.js"),$=u(process.cwd()),w=await P({...s,mode:e,...D!==void 0?{message:D}:{},...a?{confirmRetarget:a}:{}},K($,S($)),{out:j.out,emit:E=>{t.onEvent?.(E),j.emit(E)},progress:g.progress,channel:o(e,l)==="ndjson"},{agent:C.agent,telemetry:v});if(C.interrupted()&&w!==3)return n.out("interrupted \u2014 no session saved"),await v.end({exit_code:130}),n.done(130);if(w===1&&n.out(v.supportFooter()),await v.end({exit_code:w}),w!==0)return n.done(w);let U=await z($,s.useCase,s.resume);return U.length>0?n.done(w,void 0,U):n.done(w)}finally{C.dispose()}}catch(e){if(e instanceof N)return f&&await f({exit_code:2}).catch(()=>{}),n?(n.event(_({code:e.code,text:e.message,remedy:e.remedy})),n.done(2,"refused")):(process.stderr.write(`error: ${e.message}
|
|
14
14
|
next: ${e.remedy}
|
|
15
15
|
`),2);f&&await f({exit_code:1}).catch(()=>{});let r=e instanceof Error?e.message:String(e);n?.event({type:"error",message:`error: design failed: ${r}`});let i=n?d=>n.out(d):d=>process.stderr.write(d+`
|
|
16
|
-
`);return i(`error: design failed: ${r}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&e instanceof Error&&e.stack&&i(e.stack),i('hint: the full trace is in the file named on the "trace:" line at the start of this run'),n?n.done(1):1}}async function z(t,p,l){try{let[{openGraph:h},{peekSession:s},{awaitingOfUseCase:n},{shellArg:f}]=await Promise.all([import("./readmodel-
|
|
16
|
+
`);return i(`error: design failed: ${r}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&e instanceof Error&&e.stack&&i(e.stack),i('hint: the full trace is in the file named on the "trace:" line at the start of this run'),n?n.done(1):1}}async function z(t,p,l){try{let[{openGraph:h},{peekSession:s},{awaitingOfUseCase:n},{shellArg:f}]=await Promise.all([import("./readmodel-TRV4E3MW.js"),import("./sessions-NH2EG7BP.js"),import("./stream-warnings-GM7YEOVG.js"),import("./shell-arg-FN3MT5U7.js")]),e=p??(l?s(t,l)?.use_case:void 0);if(!e)return[];let r=h(t);return[...n(r,e)].map(([i,d])=>({cmd:`kane-cli context review --approve ${f(r.displayNameOf(i)??i.slice(0,19))} --mode agent`,why:`approves the criterion ${d.size===1?"1 test checks":`${d.size} tests check`}`}))}catch{return[]}}export{B as a,Z as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{r as i,s as u}from"./chunk-UJLULWSR.js";async function d(e){if(!e.isInteractive)return{recovered:!1};if(f(e.creds,e.authOnly===!0))return{recovered:!1};let{SingleShotApp:a}=await import("./SingleShotApp-
|
|
2
|
+
import{r as i,s as u}from"./chunk-UJLULWSR.js";async function d(e){if(!e.isInteractive)return{recovered:!1};if(f(e.creds,e.authOnly===!0))return{recovered:!1};let{SingleShotApp:a}=await import("./SingleShotApp-HMOXO5DW.js"),{ScrollbackProvider:t}=await import("./scrollback-GGNBDFQV.js"),{render:r}=await import("./build-5ZN47FAT.js"),o=await import("./react-QWOAB3TB.js"),n={current:null},l={current:!1},{waitUntilExit:c,unmount:s}=r(o.default.createElement(t,null,o.default.createElement(a,{resultRef:n,mode:"login",loginCompleteRef:l,...e.authOnly?{authOnly:!0}:{}})),{exitOnCtrlC:!1});u(()=>s()),await c();try{process.stdin.setRawMode?.(!1)}catch{}return process.stdout.write("\x1B[?25h"),l.current?{recovered:!0}:e.onCancel==="return"?{recovered:!1,cancelled:!0}:(i(0,"Startup gate cancelled"),{recovered:!1})}function f(e,a=!1){let t=e.getActiveProfile(),r=e.getDefaultEnv();if(!t||!!!(e.loadBasicAuth(t,r)||e.loadCredentials(t,r)))return!1;if(a)return!0;let n=e.loadProfileConfig(t,r)??{};return!!n.project_id&&!!n.folder_id}export{d as a,f as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as qr}from"./chunk-
|
|
2
|
+
import{a as qr}from"./chunk-SALZ6WSF.js";import{a as Pr}from"./chunk-ENRFXGID.js";import{e as dt,f as jt,g as Bt,h as qe}from"./chunk-X6FCXBXU.js";import{A as st,B as ve,C as yr,D as oe,E as $e,F as ot,G as br,H as K,I as it,J as Tt,K as at,L as ke,M as wr,N as vr,Q as Te,a as tr,b as nr,c as Se,d as Ee,e as de,f as tt,g as sr,h as or,i as ce,j as cr,k as Ce,l as Ae,m as lr,n as fr,o as hr,p as At,q as Nt,r as Q,s as Ne,t as gr,u as Pt,v as Pe,w as mr,x as qt,y as te,z as rt}from"./chunk-OZNYQONA.js";import{a as R,b as rr,d as X,e as Oe,h as ir,i as ar,k as dr}from"./chunk-CB4ARIHR.js";import{a as Un,b as Vn,e as Wn}from"./chunk-SSOUYKVG.js";import{a as Zn}from"./chunk-HVOXMCKE.js";import{a as Yn,b as zn}from"./chunk-WMGKUERB.js";import{a as Qn}from"./chunk-UWPG5MWM.js";import{a as Jn}from"./chunk-73Y6T2UK.js";import{b as Xn,e as er,h as Ct,i as J}from"./chunk-XMPTFXPW.js";import{e as Ar,f as Nr}from"./chunk-MINDIQET.js";import{a as Er}from"./chunk-IZ66FKPC.js";import{a as Or,b as Lt,c as Cr}from"./chunk-E4GIGM5V.js";import{a as Ir,d as Sr}from"./chunk-3KY7HHQU.js";import{h as _r,i as Rr}from"./chunk-ZHAMVLQZ.js";import{g as Ft,h as $r,q as kr}from"./chunk-Z24SD2EJ.js";import{a as nt,b as le,c as pr,d as ur}from"./chunk-23DKB2MT.js";import{b as Ot,d as Kn}from"./chunk-CQDCNP7V.js";import{b as dn,f as cn,h as ln,k as pn,l as un,q as et}from"./chunk-7V34ZMMS.js";import{b as we}from"./chunk-6PIIUAZF.js";import{Ea as C,Fa as On,Ia as Cn,Ka as An,M as wn,Na as Nn,Oa as Pn,Pa as qn,Qa as ee,Ra as Tn,Sa as jn,Ua as Bn,Va as Qe,Ya as Fn,Za as Ln,a as ae,d as Et,da as vn,ea as $n,eb as xn,fa as kn,fb as Ze,ga as _n,ha as Rn,ia as In,ja as Sn,kb as Mn,mb as Hn,na as Ye,oa as En,ob as Xe,pa as ze,q as mn,r as yn,t as bn,vb as Dn,wb as Gn}from"./chunk-PI7OXS62.js";import{c as hn,n as gn}from"./chunk-DBMW3VUN.js";import{d as fn,f as Je,g as Ke}from"./chunk-KU3YHPWZ.js";import{b as an}from"./chunk-7V4BQSSV.js";import{g as We}from"./chunk-ZCRZFAOT.js";import{existsSync as De,readdirSync as ws,readFileSync as vs,realpathSync as oi,statSync as ii,writeFileSync as ai}from"fs";import{basename as Rt,join as Ge,relative as di,resolve as sn}from"path";import{randomBytes as Fs}from"crypto";var Tr=8,je=()=>dr(Fs(8).toString("hex")),jr=(e,t)=>e!==null&&Buffer.from(e).equals(Buffer.from(t)),Ls=[["P1 exclusive create",async e=>{for(let t=1;t<=2;t++){let n=je(),r=Buffer.from(`probe ${t} first`);if(await e.putIfAbsent(n,r)!=="created")return"a fresh key was reported as existing";if(await e.putIfAbsent(n,Buffer.from(`probe ${t} second`))!=="exists")return"the second write to one key was not refused";if(!jr(await e.get(n),r))return"the second write replaced the first"}return null}],["P2 contention",async e=>{let t=je(),r=(await Promise.all(Array.from({length:Tr},(o,i)=>e.putIfAbsent(t,Buffer.from(`contender ${i}`))))).filter(o=>o==="created").length;return r===1?null:`${r} of ${Tr} concurrent writers were told "created"`}],["P3 read-after-write",async e=>{let t=je(),n=Buffer.from("visible");return await e.putIfAbsent(t,n),await e.head(t)?jr(await e.get(t),n)?(await e.list(t)).includes(t)?null:"list does not show a key just created":"get does not return the bytes just created":"head does not see a key just created"}],["P4 definitive absence",async e=>await e.head(je())?"a never-written key was reported present":null]];async function ct(e){if(e.probe){let r=await e.probe();return{tier:Math.max(r.tier,e.ceilingTier),detail:r.detail}}let t=1,n="all probes passed";for(let[r,o]of Ls){let i;try{i=await o(e)}catch(s){if(s instanceof R){if(!(s.code==="SYNC_LOCATION_REFUSED_WRITE"&&r.startsWith("P1")&&await Br(e)))throw s;n=`${r}: ${s.message}`,t=3;break}n=`${r}: ${s instanceof Error?s.message:String(s)}`,t=r.startsWith("P1")&&await Br(e)?3:2;break}if(i!==null){n=`${r}: ${i}`,t=2;break}}return{tier:Math.max(t,e.ceilingTier),detail:n}}async function Br(e){try{return!await e.head(je())}catch(t){if(t instanceof R)throw t;return!1}}import{existsSync as xs,readFileSync as xr}from"fs";import{join as Ms}from"path";async function xt(e,t,n,r){let i=de(e).entries[n];if(!i)throw new Error(`no sync state for ${n} \u2014 run kane-cli context sync add ${n} <descriptor> first`);if(i.tier!==1)throw new R("SYNC_READ_ONLY",`${n} is a tier ${i.tier} location: it can be cloned and pulled, never pushed`,"push to a location whose probe reached tier 1, or pull from this one");let s=await Ce(e,t,i.witness);switch(s.kind){case"empty-storage":case"ahead":case"up-to-date":break;case"behind":case"empty-local":throw new R("SYNC_BEHIND",`${n} holds ${s.storage.seq} records, this store ${s.local?.seq??0}: it has records this store has not seen`,`kane-cli context pull ${n}`);case"diverged":throw new R("SYNC_DIVERGED",`you and ${n} both added work after position ${s.at-1}; nothing was pushed`,`run kane-cli context pull ${n} --rebase to save your local work, take the team version from ${n}, and then reapply yours`);case"foreign-lineage":throw new R("SYNC_FOREIGN_LINEAGE",`${n} holds a different history (its first record is not this store's)`,`to work on it, clone it: kane-cli context clone <descriptor of ${n}> <dir>; to share this store, add an empty location`)}let a=s.storage,c=qn(e),d;try{An(e),d=Hs(e,a)}catch(M){throw M instanceof Cn?new R("SYNC_REBASE_PENDING",`${M.message.split(";")[0]}; nothing was pushed`,M.remedy):M}finally{c()}let l=d.map(M=>Ds(e,M)),f=0,p=0,g=0,u=0,m=a,y=null,w=null,h=t.beginTransaction?await t.beginTransaction():void 0,b=h?{...t,head:h.head,get:h.get,list:t.list.bind(t),putIfAbsent:t.putIfAbsent.bind(t)}:t,v=h?h.stageIfAbsent.bind(h):t.putIfAbsent.bind(t),q=[],re=M=>h?q.push(M):r(M);try{let M=new Set;for(let S of l){for(let D of S.blobs)if(await v(D.key,D.bytes)!=="exists")p++,M.add(D.key);else if(!M.has(D.key)){let $=await b.get(D.key);if($===null||Ot(Buffer.from($))!==D.fp){w=new R("SYNC_OBJECT_CORRUPT",`the blob ${D.fp} ${n} already holds does not hash to its name (named by record ${S.seq}); the record was not pushed`,"the storage object needs a human look before anything more is pushed to it");break}M.add(D.key)}if(w)break;S.proposal&&await v(S.proposal.key,S.proposal.bytes)!=="exists"&&g++;let Z=Oe(S.seq);if(await v(Z,S.raw)!=="exists")f++;else if((await ce(b,S.seq)).hash===S.hash)re(`position ${S.seq} is already on ${n}`),u++;else{y=S.seq;break}m={seq:S.seq,hash:S.hash}}if(h||await Lr(t,m,a,n),m&&!await b.head(X)){let S=await ce(b,1),Z={layout:1,canonicalizer:"v1",genesis_hash:S.hash};await v(X,Buffer.from(JSON.stringify(Z)+`
|
|
3
3
|
`,"utf8"))!=="exists"&&re(`wrote ${X} on ${n}`)}if(h){if(m){let $=await b.get(X),ge=await ce(b,1),T={};try{let me=JSON.parse(Buffer.from($??[]).toString("utf8"));me&&typeof me=="object"&&!Array.isArray(me)&&(T=me)}catch{}if(T.layout!==1||T.canonicalizer!=="v1"||T.genesis_hash!==ge.hash)throw new R("SYNC_OBJECT_CORRUPT",`${X} does not describe this context's verified genesis and format.`,"Ask the location owner to inspect the metadata before publishing.")}if(w)throw w;if(y!==null)throw new R("SYNC_POSITION_TAKEN",`position ${y} on ${n} was taken by another writer; this batch was not published`,Fr(n,y));let S=await h.commit(),Z=new Set(S.created),D=l.filter($=>Z.has(Oe($.seq))).length;u+=f-D,f=D,p=new Set(l.flatMap($=>$.blobs.map(ge=>ge.key)).filter($=>Z.has($))).size,g=new Set(l.flatMap($=>$.proposal?[$.proposal.key]:[]).filter($=>Z.has($))).size}h&&await Lr(t,m,a,n);for(let S of q)r(S);let se="";if(m)try{lr(e,n,m,{forwardOnly:!0})}catch(S){if(y===null||!(S instanceof C))throw S;se=" (the witness was not saved; the next pull records it)"}if(w)throw w;if(y!==null)throw new R("SYNC_POSITION_TAKEN",`position ${y} on ${n} was taken by another writer while this push ran; this store's history through position ${m?.seq??0} is confirmed on ${n}${se}`,Fr(n,y))}finally{await h?.abort()}return{pushed:f,from:a?.seq??0,to:m?.seq??0,blobs:p,proposals:g,alreadyThere:u}}function Fr(e,t){return t===1?`${e} holds a different history: to work on it, clone it with kane-cli context clone <descriptor of ${e}> <dir>; to share this store, add an empty location`:`kane-cli context pull ${e} --rebase`}async function Lr(e,t,n,r){if(!t||t.seq<=(n?.seq??0))return;let o=await ce(e,t.seq);if(o.hash!==t.hash)throw new R("SYNC_OBJECT_CORRUPT",`${r} answered "created" for position ${t.seq} but serves a record hashing ${o.hash}, not ${t.hash}`,"The location needs inspection before publishing more context.")}function Hs(e,t){let{records:n,hashes:r}=Ln(e,t?.seq??0,t?.hash??null);return n.map((o,i)=>{let s=r[i],a=xr(Ms(e,"commits",`${String(o.seq).padStart(6,"0")}-${s.slice(7,19)}.json`));if(ee(JSON.parse(a.toString("utf8")))!==s)throw new Error(`record ${o.seq} changed on disk while it was being read \u2014 run kane-cli context fsck`);return{rec:o,hash:s,raw:a}})}function Ds(e,{rec:t,hash:n,raw:r}){{let o=tr(t),i=o.blobs.map(s=>{let a=Kn(e,s);if(a===null)throw new R("SYNC_CLOSURE_MISSING",`record ${t.seq} names blob ${s}, which this store does not hold`,"restore the blob from a copy of this store, or run kane-cli context fsck");if(Ot(a)!==s)throw new R("SYNC_LOCAL_BLOB_CORRUPT",`record ${t.seq} names blob ${s}, but the local file does not hash to that: it is torn`,"restore the blob from a copy of this store, or run kane-cli context fsck");return{key:ir(s),fp:s,bytes:a}});return{seq:t.seq,hash:n,raw:new Uint8Array(r),blobs:i,proposal:Gs(e,o.proposalId)}}}function Gs(e,t){if(t===null)return null;let n=Qn(e,t);if(!xs(n))return null;let r=xr(n);return{key:ar(t,nr(r.toString("utf8"))),bytes:r}}import{existsSync as Us,readdirSync as Vs,readFileSync as Mr}from"fs";import{basename as Ws,join as Mt}from"path";function lt(e){return{id:Ws(e),witness:()=>JSON.parse(Mr(Mt(e,"base-witness.json"),"utf8")),records:t=>Ht(e,t),readIntent:t=>bn(e,t)}}var Js=/^\d{6}-[0-9a-f]{12}\.json$/;function Ht(e,t){let n=Mt(e,"commits"),r=Us(n)?Vs(n).filter(s=>Js.test(s)).sort():[],o=t.hash,i=t.seq;return r.map(s=>{let a;try{a=JSON.parse(Mr(Mt(n,s),"utf8"))}catch(d){throw new C(`backup record ${s} is not JSON: ${String(d)}`)}if(i+=1,a.seq!==i||a.prev_hash!==o)throw new C(`backup record ${s} does not continue the chain at ${i} from ${String(o)}`);let c=ee(a);if(!c.slice(7).startsWith(s.slice(7,19)))throw new C(`backup record ${s} does not match its name`);return o=c,{seq:i,hash:c,body:a}})}function pt(e,t){let n=t.witness(),r=e.recordsSince(null).slice(0,n.base.seq),o=t.records(n.base),i=[...r,...o.map(p=>p.body)],s=[...r.map(ee),...o.map(p=>p.hash)],a=new Map;for(let p of i)for(let g of p.nodes)a.set(g.cid,{label:g.label,content:g.content});let c=Mn();Hn(null,c,i,s,{writeNodeFiles:!1});let d=Gn(null,c,a),l=new Map(o.map(p=>[p.seq,p])),f=p=>d.displayNameOf(p)??p.slice(0,19);return{backup:t,backupId:t.id,from:n.from,base:n.base,index:c,graph:d,records:o,chain:i,recordAt:p=>l.get(p),resolveName:p=>d.resolve(p)?.cid,nameOf:p=>d.displayNameOf(p)??void 0,displayNameFor:p=>{let g=Dt(t,p),u=Object.keys(p.source_head_moves),m=g==="revert"?String(Ks(t,p)??""):g==="names"?(p.names??[]).map(y=>y.slug).join(", "):u.length>0?u.join(", "):p.nodes.length>0?[...new Set(p.nodes.map(y=>f(y.cid)))].join(", "):(p.executions?.length??0)>0?[...new Set(p.executions.map(y=>f(y.about)))].join(", "):p.review.length>0?[...new Set(p.review.map(y=>f(y.id)))].join(", "):p.supersessions.length>0?[...new Set(p.supersessions.map(y=>y.kind==="node"?f(y.old):y.ecid.slice(0,19)))].join(", "):u.join(", ");return m?`${g} ${m}`:g}}}function Ks(e,t){try{let r=e.readIntent(ee(t))?.args?.seq;return typeof r=="number"?r:void 0}catch{return}}function Dt(e,t){let n=null;try{n=e.readIntent(ee(t))}catch{n=null}if(n)return n.verb;if(t.intent_verb)return t.intent_verb;let r=Object.entries(t.source_head_moves);return(t.executions?.length??0)>0?"execution":t.design_of?"design":t.proposal_id!=null?"extract":t.conv?t.conv.turn===0?"conv-mint":"conv-turn":r.length===1&&r[0][1]===null&&t.supersessions.some(o=>o.kind==="node"&&o.new===null)?"retire":r.length===1&&typeof r[0][1]=="string"&&t.nodes.some(o=>o.label==="source")?"ingest":t.review.some(o=>o.resolution==="reset")||t.supersessions.some(o=>o.kind==="node"&&o.new===o.old||o.kind==="edge"&&o.revoke)?"revert":t.nodes.length===0&&t.edges.length===0&&t.supersessions.length===1&&t.supersessions[0].kind==="node"&&t.supersessions[0].new===null?"archive":t.nodes.length===0&&t.edges.length===0&&t.review.length===0&&(t.names?.length??0)>0?"names":t.nodes.length===0&&t.edges.length===0&&t.supersessions.length===0&&t.review.length>0?"review":"unknown"}import{existsSync as Hr,readdirSync as Ys,readFileSync as Gt}from"fs";import{isAbsolute as zs,join as ut,normalize as Qs,relative as Zs,sep as Xs}from"path";var eo=e=>e===""||zs(e)||e.includes("\\")||Qs(e).split(Xs).some(t=>t==="..")||e.startsWith("./")||e.includes("\0");function Fe(e){let t=ut(e,"manifest.json");if(!Hr(t))throw new C(`backup ${e} has no manifest.json \u2014 it was never completed; kane-cli context sync doctor`);let n;try{n=JSON.parse(Gt(t,"utf8"))}catch(s){throw new C(`backup manifest ${t} is not JSON: ${s instanceof Error?s.message:String(s)}`)}if(!Array.isArray(n))throw new C(`backup manifest ${t} is not a list`);let r=new Set,o=[];for(let s of n){let a=typeof s?.name=="string"?s.name:"";if(eo(a))throw new C(`backup manifest names an unsafe path ${JSON.stringify(s?.name)} \u2014 the backup is not trusted`);let c=ut(e,a);if(!Hr(c))throw new C(`backup file ${a} is missing from ${e}`);let d=Gt(c);if("sha256:"+an(d)!==s.hash)throw new C(`backup file ${a} does not match its manifest hash \u2014 the backup was changed after it was written`);if(a.startsWith("commits/"))try{r.add(ee(JSON.parse(d.toString("utf8"))))}catch(l){throw new C(`backup record ${a} is not a record: ${l instanceof Error?l.message:String(l)}`)}a.startsWith("intents/")&&o.push(a)}let i=new Set(n.map(s=>s.name));for(let s of Dr(e)){let a=Zs(e,s);if(a!=="manifest.json"&&!i.has(a))throw new C(`backup ${e} holds ${a}, which its manifest does not name \u2014 the backup was changed after it was written`)}for(let s of o){let a;try{a=JSON.parse(Gt(ut(e,s),"utf8"))}catch(d){throw new C(`backup envelope ${s} is not JSON: ${d instanceof Error?d.message:String(d)}`)}let c=mn(a);if(c!==null)throw new C(`backup envelope ${s} is not a valid intent: ${c}`);if(typeof a.born?.hash!="string"||!r.has(a.born.hash))throw new C(`backup envelope ${s} was born from a record the backup does not hold`)}}function Dr(e){let t=[];for(let n of Ys(e,{withFileTypes:!0})){let r=ut(e,n.name);n.isDirectory()?t.push(...Dr(r)):t.push(r)}return t}import{basename as Oo,join as Co}from"path";import{existsSync as Ao,readFileSync as No}from"fs";var G=class extends Error{},L=(e,t)=>({kind:"apply",inputs:e,...t&&t.length>0?{aliases:t}:{}}),V=e=>({kind:"noop",reason:e}),Vt=e=>({kind:"dedupe",as:e}),k=(e,t,n,r,o={})=>({kind:"hold",hold:{kind:e,mine:t,theirs:n,answers:r,detail:o}}),Gr=(e,t)=>{let n=ft(t.label,t.content);return e.graph.byLabel(t.label).filter(r=>!e.graph.superseded.has(r.cid)&&ft(t.label,r.content)===n).map(r=>r.cid)},z=e=>e?e.slice(0,19):"none",H=(e,t)=>e.maps.cid.rewrite(t);function I(e,t,n){if(typeof t!="string")throw new G(`${n} was not pinned`);let r=H(e,t);if(!e.graph.hasNode(r))throw new G(`${n} ${_(e,t)} has no counterpart on ${e.location}`);return r}var j=(e,t)=>e.graph.tipOf(t),Wt=(e,t)=>e.graph.superseded.has(e.graph.tipOf(t)),_=(e,t)=>e.fold.nameOf(t)??z(t),E=(e,t)=>e.graph.displayNameOf(t)??z(t);function Jt(e,t,n,r){let o=r==="fold"?e.fold.graph:e.graph,i=o.displayNameOf(t);if(i!==null&&i!==n)return i;let s=o.tipOf(t);for(let[d,l]of o.heads)if(l===t||l===s)return d;let a=o.getNode(t);if(a?.label==="source"&&typeof a.content.source_id=="string")return a.content.source_id;let c=a?.content.title??a?.content.text??a?.content.statement;return a&&typeof c=="string"&&c!==""?`${a.label} "${Y(c,32)}"`:z(t)}var F=e=>e.created_by?.by?.id??e.review[0]?.by.id??e.supersessions[0]?.by.id??e.names?.[0]?.by.id??"someone",N=e=>e.ts;function Y(e,t=48){let n=typeof e=="string"?e:JSON.stringify(e);return n.length>t?`${n.slice(0,t-1)}\u2026`:n}var Ut={test_md_blob:"steps",objectives_blob:"checks"},to=/^sha256:[0-9a-f]{64}$/,no=(e,t)=>e==="derived"||Or.includes(e)||/_blob$/.test(e)||/(^|_)id$|Id$/.test(e)||t.some(n=>typeof n=="string"&&to.test(n));function pe(e,t,n,r){let o=[...new Set([...Object.keys(e),...Object.keys(t)])].filter(c=>JSON.stringify(e[c])!==JSON.stringify(t[c])),i=o.filter(c=>Ut[c]===void 0&&!no(c,[e[c],t[c]])).map(c=>`${c} "${Y(e[c]??"")}" \u2192 "${Y(t[c]??"")}"`),s=Object.keys(Ut).filter(c=>o.includes(c)).map(c=>Ut[c]);return`${[...i,...s.length>0?[`${s.join(" and ")} changed`]:[]].join(", ")||"no field changed"} by ${n} ${r===null?"since your last pull":`at ${r}`}`}var ro={usecase:"use case",scenario:"scenario",test:"test",ac:"acceptance criterion",source:"document"};function Ur(e,t){let n=e.graph.getNode(t),r=n?ro[n.label]??n.label:"item",o=n?.label!=="ac"?n?.content.title:void 0;if(typeof o=="string"&&o.trim()!=="")return`the ${r} "${o}"`;let i=e.fold.nameOf(t)??e.graph.displayNameOf(t);return i?`the ${r} ${En(i)}`:`the ${r}`}function ie(e,t){for(let n of e.theirs)for(let r of n.supersessions)if(r.kind==="node"&&r.old===t)return{rec:n,next:r.new}}function Kt(e,t){let n=new Set([t]);for(let o=!0;o;){o=!1;for(let[i,s]of e.graph.superseded)typeof s=="string"&&n.has(s)&&!n.has(i)&&(n.add(i),o=!0)}let r=[];for(let o of e.theirs)for(let i of o.review)n.has(i.id)&&i.resolution!=="pending"&&r.push({rec:o,resolution:i.resolution});return r}var so=new Set(Object.values(Ke).filter(e=>e!==Ke.DERIVES&&e!==Ke.ANNOTATES));function Yt(e,t){let n=new Set,r=[],o=[t,e.graph.tipOf(t)];for(;o.length>0;){let i=o.pop();if(!n.has(i)){n.add(i);for(let s of e.graph.edgesInto(i))!so.has(s.type)||e.graph.superseded.has(s.src)||(!(s.src in e.fold.index.nodeLabel)&&!r.some(a=>a.cid===s.src)&&r.push({cid:s.src,label:e.graph.nodeLabel.get(s.src)??"node"}),o.push(s.src))}}return r}function zt(e){let t=new Map;for(let n of e)t.set(n.label,(t.get(n.label)??0)+1);return[...t].map(([n,r])=>`${r} ${n}${r===1?"":"s"}`).join(", ")}function ht(e,t,n){if(!e.theirs.some(o=>o.edges.some(i=>i.type===t&&i.src===n)))return;let r=e.graph.edgesFrom(n).find(o=>o.type===t);return r?{live:r.dst}:void 0}function _e(e,t){let n=t.event_ids??[],r={token:e.store.parse(e.graph.latestHash)},o=new Map(n.map(a=>[a,e.store.appliedEvent(a,r)?.digest])),i=n.filter(a=>o.get(a)!==void 0);return n.length===0||i.length===0?void 0:i.every(a=>{let c=n.indexOf(a),d=t.event_digests?.[c];return d!==void 0&&d!==""&&o.get(a)===d})&&i.length===n.length?V("already applied: every event id is in the chain with the same intent"):k("ambiguous",`committed ${n.length} event id${n.length===1?"":"s"}`,`${i.length} of them already in the shared chain under another intent`,["keep-theirs"],{event_ids:n})}function oo(e){return String(e??"").toLowerCase().trim().replace(/\s+/g," ")}function ft(e,t){let n=t.question;return`${e}\0${oo(t.title??t.text??t.statement??n?.header??t.source_id??"")}`}function Vr(e,t){let n=[],r=new Set;for(let o of e.nodes){let i=ft(o.label,o.content),s=t.nodes.find(a=>!r.has(a.cid)&&ft(a.label,a.content)===i);s&&(r.add(s.cid),n.push([o.cid,s.cid]))}for(let o of e.nodes){if(n.some(([s])=>s===o.cid))continue;let i=t.nodes.find(s=>!r.has(s.cid)&&s.label===o.label);i&&(r.add(i.cid),n.push([o.cid,i.cid]))}return n}function Wr(e,t){let n=[],r=new Set;for(let o of t.names??[]){if(!Ye.test(o.slug))continue;let i=t.nodes.find(a=>a.cid===o.cid);if(!i||e.graph.nameOf.has(H(e,o.cid)))continue;let s=ze(i.label,a=>r.has(a),e.graph.names.keys());s!==null&&(r.add(s),s!==o.slug&&n.push({from:o.slug,to:s}))}return n}function Jr(e,t,n){let r=[];for(let o of e.names??[]){let i=n.find(([a])=>a===o.cid)?.[1],s=t.names?.find(a=>a.cid===i);s&&s.slug!==o.slug&&r.push({from:o.slug,to:s.slug})}return r}function Kr(e,t,n){let r=e===void 0?void 0:e.split(`
|
|
4
4
|
`).map(s=>{let a=/^(##\s.*?)\s@verifies\s+(.+?)\s*$/.exec(s);if(a)return`${a[1]} @verifies ${a[2].split(",").map(l=>l.trim()).filter(Boolean).map(n).join(", ")}`;let c=/^(\s*)@import\s+(\S+)\s*$/.exec(s);if(c)return`${c[1]}@import ${n(c[2])}`;let d=/^## Import: (\S+)\s*$/.exec(s);return d?`## Import: ${n(d[1])}`:s}).join(`
|
|
5
5
|
`),o=null,i=t===void 0?void 0:t.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as l}from"./chunk-
|
|
2
|
+
import{c as l}from"./chunk-WEJR2V7R.js";import{M as f,sb as m}from"./chunk-PI7OXS62.js";import{f as a,g as u}from"./chunk-KU3YHPWZ.js";function O(e){let i=f(e),s=new Set;for(let{cid:t}of i.byLabel(a.USECASE)){if(i.superseded.has(t)||i.trust.get(t)==="archived")continue;let o=i.displayNameOf(t);o&&s.add(o)}return s}function g(e,i){let s=f(e),t=[];for(let{cid:o,content:r}of s.byLabel(a.USECASE)){if(s.superseded.has(o)||s.trust.get(o)==="archived")continue;let d=s.displayNameOf(o);if(!d||i.has(d))continue;let n=new Set;for(let c of s.derivesInto(o)){let p=s.getNode(c.src)?.content.source_id;typeof p=="string"&&n.add(p)}t.push({id:d,title:String(r.title??""),source_ids:[...n].sort()})}return t.sort((o,r)=>o.id.localeCompare(r.id,void 0,{numeric:!0}))}function U(e,i,s){let t=f(e),r=g(e,s).filter(n=>n.source_ids.includes(i)).map(n=>({id:n.id,state:"new",units_moved:[]})),d=new Set(r.map(n=>n.id));for(let n of l(e,i)){let c=t.displayNameOf(n);!c||d.has(c)||r.push({id:c,state:"stale",units_moved:m(t,n,i)?.changed??[]})}return r.sort((n,c)=>n.id.localeCompare(c.id,void 0,{numeric:!0}))}function b(e){let i=t=>!e.superseded.has(t)&&e.trust.get(t)!=="archived",s=new Set;for(let{cid:t}of e.byLabel(a.TEST))if(i(t))for(let o of e.edgesFrom(t)){if(o.type!==u.AUTOMATES||e.superseded.has(o.ecid))continue;let r=e.tipOf(o.dst);if(i(r))for(let d of e.edgesFrom(r))d.type!==u.BELONGS_TO||e.superseded.has(d.ecid)||s.add(e.tipOf(d.dst))}return s}export{O as a,g as b,U as c,b as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as f,d as l}from"./chunk-
|
|
2
|
+
import{b as f,d as l}from"./chunk-C4KAPGBS.js";import{a as p}from"./chunk-TZXXJWHA.js";function d(t,e,o){return{id:`${t}.internal`,label:e,required:!0,status:"fail",detail:o instanceof Error?o.message:String(o)}}async function k(t,e={}){let o=p();if(!o.supported)return{sections:[{platform:"host",checks:[{id:"host.platform",label:"host",required:!0,status:"fail",detail:o.reason}]}]};let n=t?f().filter(r=>r.toLowerCase()===t.toLowerCase()):f(),{managedDeps:i}=await import("./deps-bundle-BLLJ2BQ4.js"),s=n.flatMap(r=>r==="android"?["emulator"]:r==="ios"?["simulator"]:[]);await Promise.allSettled(s.map(r=>i().warmResolveCache(r)));let c=[];for(let r of n){let u=l(r);if(!u)continue;let a;try{a=await u.checks(e)}catch(h){a=[d(r,"toolchain check",h)]}c.push({platform:r,checks:a})}return{sections:c}}function m(t){return t==="pass"?"\u2713":t==="fail"?"\u2717":"\u2139"}function x(t){return t.charAt(0).toUpperCase()+t.slice(1)}function C(t){let e=[];if(t.sections.length===0)return"No mobile platforms are supported on this host.";for(let o of t.sections){e.length>0&&e.push(""),e.push(`${x(o.platform)} toolchain`);let n=o.checks.filter(s=>s.status!=="info"),i=new Set;for(let s of n){let c=s.detail?` \u2014 ${s.detail}`:"";if(e.push(` ${m(s.status)} ${s.label}${c}`),s.status==="fail"&&s.fixText&&!i.has(s.fixText)){i.add(s.fixText);for(let r of s.fixText.split(`
|
|
3
3
|
`))e.push(` fix: ${r}`)}}}return e.join(`
|
|
4
4
|
`)}function w(t){return t.sections.length===0?!0:t.sections.every(e=>e.checks.some(o=>o.required&&o.status==="fail"&&!o.fixedByBundle))}function b(t){for(let e of t.sections)for(let o of e.checks)if(o.required&&o.status!=="pass")return 2;return 0}export{k as a,C as b,w as c,b as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{H as T,L as F,Qa as B,r as x}from"./chunk-
|
|
2
|
+
import{H as T,L as F,Qa as B,r as x}from"./chunk-PI7OXS62.js";function q(h){let{store:j,graph:f,seq:r,by:i}=h,c=j.recordsSince(null),v=c.map(B);if(!Number.isInteger(r)||r<1||r>c.length)return{record:null,warnings:[],errors:[{code:"UNKNOWN_SEQ",detail:`no record ${r} (chain has ${c.length})`}]};let d=c[r-1],p=c.slice(0,r-1),a=h.reason??`revert of record ${r}`,n=[],l=[],g=[],m=[],w={},C=new Set(d.nodes.map(e=>e.cid)),k=new Map;for(let e of c)for(let t of e.edges)k.has(t.ecid)||k.set(t.ecid,t);let N=e=>c.slice(r).some(t=>t.supersessions.some(s=>s.kind==="edge"&&s.ecid===e)),$=new Set,y=new Set;for(let e of d.nodes){if(f.superseded.has(e.cid)){$.add(e.cid),n.push(`${e.cid} was already superseded after record ${r} \u2014 left as is`);continue}y.add(e.cid),l.push({kind:"node",old:e.cid,new:null,reason:a,by:i})}let _=new Set;for(let e of d.edges){if(f.superseded.has(e.ecid)){n.push(`edge ${e.ecid} was already retracted after record ${r} \u2014 left as is`);continue}if(($.has(e.src)||$.has(e.dst))&&!y.has(e.src)&&!y.has(e.dst)){n.push(`edge ${e.ecid} was minted with a kept node \u2014 left as is`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i}),_.add(e.ecid)}let R=new Set;for(let e of d.supersessions){if(e.kind!=="node")continue;if(c.slice(r).some(s=>s.supersessions.some(o=>o.kind==="node"&&o.old===e.old))){n.push(`supersession of ${e.old.slice(0,19)} was changed again after record ${r} \u2014 later state kept`);continue}let t;for(let s of p)for(let o of s.supersessions)o.kind==="node"&&o.old===e.old&&(t=o.new===o.old?void 0:o.new);t===void 0?(l.push({kind:"node",old:e.old,new:e.old,reason:a,by:i}),R.add(e.old)):l.push({kind:"node",old:e.old,new:t,reason:a,by:i})}for(let e of d.supersessions)if(!(e.kind!=="edge"||!e.revoke)){if(N(e.ecid)){n.push(`edge ${e.ecid} was touched again after record ${r} \u2014 later state kept`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i}),_.add(e.ecid)}let E=[];for(let e of d.supersessions){if(e.kind!=="edge"||e.revoke)continue;if(N(e.ecid)){n.push(`edge ${e.ecid} was touched again after record ${r} \u2014 later state kept`);continue}let t=!1;for(let H of p)for(let b of H.supersessions)b.kind==="edge"&&b.ecid===e.ecid&&(t=!b.revoke);if(t){n.push(`edge ${e.ecid} was already retracted before record ${r} \u2014 left retracted`);continue}let s=k.get(e.ecid);if(!s){n.push(`edge ${e.ecid} is unknown to the chain \u2014 left retracted`);continue}if(f.superseded.has(s.src)&&!R.has(s.src)){n.push(`edge ${e.ecid} would revive from a superseded source \u2014 left retracted`);continue}let o=f.tipOf(s.dst);if(f.superseded.has(o)&&!R.has(o)){n.push(`edge ${e.ecid} would point at a retired destination \u2014 left retracted`);continue}let u=T(f,{type:s.type,src:s.src,dst:s.dst},{pending:E,retracted:_},`revert revive ${s.type}`);if(u){n.push(`edge ${e.ecid} left retracted \u2014 reviving it would double an occupied slot (${u.detail})`);continue}l.push({kind:"edge",ecid:e.ecid,reason:a,by:i,revoke:!0}),E.push({src:s.src,dst:s.dst,type:s.type})}let S=c.slice(r);for(let e of Object.keys(d.source_head_moves)){if(S.some(s=>e in s.source_head_moves)){n.push(`head of ${e} was moved again after record ${r} \u2014 later state kept`);continue}let t=null;for(let s of p)e in s.source_head_moves&&(t=s.source_head_moves[e]);w[e]=t}let O=new Set;for(let e of d.review){if(O.has(e.id)||C.has(e.id))continue;if(O.add(e.id),S.some(o=>o.review.some(u=>u.id===e.id))){n.push(`trust of ${e.id.slice(0,19)} was reviewed again after record ${r} \u2014 later state kept`);continue}let t=null,s=null;for(let o of p)for(let u of o.review)u.id===e.id&&(t=u.resolution==="reset"?null:u.resolution,s=u.reason);t==="approved"||t==="edited"?g.push({id:e.id,kind:"review-item",resolution:"approved",edit:null,reason:a,by:i}):t==="rejected"?g.push({id:e.id,kind:"review-item",resolution:"rejected",edit:null,reason:s??a,by:i}):g.push({id:e.id,kind:"review-item",resolution:"reset",edit:null,reason:a,by:i})}for(let e of d.names??[]){if(S.some(s=>(s.names??[]).some(o=>o.slug===e.slug))){n.push(`slug "${e.slug}" was reassigned after record ${r} \u2014 later state kept`);continue}let t;for(let s of p)for(let o of s.names??[])o.slug===e.slug&&(t=o.cid);t!==void 0?m.push({cid:t,slug:e.slug,by:i}):n.push(`slug "${e.slug}" was first assigned by record ${r} \u2014 unassignment unsupported, reassign manually`)}return l.length===0&&g.length===0&&m.length===0&&Object.keys(w).length===0?{record:null,warnings:n,errors:[{code:"NOTHING_TO_REVERT",detail:`record ${r} left no compensable facts`}]}:(d.extraction_of&&n.push(`extraction cache for ${d.extraction_of.slice(0,19)} stays \u2014 re-extract with --force`),{record:F(j,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:g,supersessions:l,...m.length>0?{names:m}:{},source_head_moves:w},{graph:f,expectPrev:v[v.length-1]??null,intent:{v:1,verb:"revert",args:x({seq:r,reason:h.reason??null,by:i}),pins:{target:{seq:r,hash:v[r-1]}}},provenance:h.provenance}).record,warnings:n,errors:null})}export{q as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as T}from"./chunk-3G2LSTK5.js";import{a as c}from"./chunk-RZ4F3BHX.js";var P=class extends Error{constructor(t,e){super(t);this.problems=e;this.name="PolicyRejectedError"}},h=class extends Error{constructor(t,e){super(t);this.status=e}name="EndTestError"},l=class extends Error{constructor(r){super(`Test Manager couldn't be reached: ${r}`),this.name="TmsUnreachable"}},p=class extends Error{constructor(t,e,s){super(t);this.status=e;this.body=s;this.name="TmsHttpError"}},S=class extends T{constructor(r,t,e){super(r,{username:t,accessKey:e})}async listProjects(r){let t=[],e=!1;for await(let s of this.listProjectsStream({log:r})){if(r&&!e&&s.projects.length>0){let n=s.projects[0];r("info","PROJECT_SAMPLE","Project list sample",{project_id:n.project_id,name:n.name}),e=!0}t.push(...s.projects)}return t}async*listProjectsStream(r){let t=r?.perPage??200,e=r?.maxPages??100,s=r?.signal,n=r?.log,o=r?.name?.trim(),a=0,d=null;for(let i=1;i<=e;i++){if(s?.aborted)return;let g=`${this.baseUrl}/v1/projects?page=${i}&per_page=${t}&sort=${r?.sort??"created_at"}&filter[product]=KTM`;o&&(g+=`&filter[name]=${encodeURIComponent(o)}`);let j=AbortSignal.timeout(15e3),$=s?AbortSignal.any([s,j]):j,m;try{m=await c(g,{method:"GET",headers:this.headers(),signal:$})}catch(y){if(s?.aborted)return;if(i===1)throw y;n?.("warn","PROJECTS_STREAM_PARTIAL","stream stopped mid-page",{page:i,total_loaded:a,error:y instanceof Error?y.message:String(y)}),yield{page:i,projects:[],totalLoaded:a,done:!0,total:d};return}if(!m.ok){if(i===1)throw new Error(`listProjects ${m.status}: ${await m.text()}`);n?.("warn","PROJECTS_STREAM_PARTIAL","stream stopped on non-OK response",{page:i,status:m.status,total_loaded:a}),yield{page:i,projects:[],totalLoaded:a,done:!0,total:d};return}let w=await m.json(),b=w.data??[];a+=b.length;let _=b.length<t;if(typeof w.pagination?.total=="number"&&(d=w.pagination.total),yield{page:i,projects:b,totalLoaded:a,done:_,total:d},_)return}n?.("warn","PROJECTS_STREAM_MAXPAGES","max pages reached",{max_pages:e,total_loaded:a}),yield{page:e,projects:[],totalLoaded:a,done:!0,total:d}}async getProject(r){let t;try{t=await c(`${this.baseUrl}/v1/projects/${encodeURIComponent(r)}`,{method:"GET",headers:this.headers(),signal:AbortSignal.timeout(15e3)})}catch(n){throw new l(n instanceof Error?n.message:String(n))}if(t.status===408||t.status===429)throw new l(`HTTP ${t.status}`);if(t.status>=400&&t.status<500)return null;if(!t.ok)throw new l(`HTTP ${t.status}`);let e;try{e=await t.json()}catch(n){throw new l(`an answer that isn't JSON: ${n instanceof Error?n.message:String(n)}`)}let s=typeof e.data?.name=="string"?e.data.name:typeof e.data?.project_name=="string"?e.data.project_name:null;if(s===null)throw new l("an answer with no project name");return{id:r,name:s}}async getDefaultFolder(r){let t=await c(`${this.baseUrl}/v1/projects/${r}/folder/default`,{method:"GET",headers:this.headers()});if(!t.ok)throw new Error(`Get default folder failed: ${t.status} ${await t.text()}`);return(await t.json()).id}async listFolders(r){let t=await c(`${this.baseUrl}/v1/folder/entity/${r}`,{method:"GET",headers:this.headers()});if(!t.ok)throw new Error(`List folders failed: ${t.status} ${await t.text()}`);return(await t.json()).data??[]}async validateProjectFolder(r,t){let e;try{e=await c(`${this.baseUrl}/v1/folder/entity/${r}`,{method:"GET",headers:this.headers()})}catch{return{project:"error",folder:"error"}}if(e.status>=400&&e.status<500)return{project:"missing",folder:"missing"};if(!e.ok)return{project:"error",folder:"error"};let s;try{s=await e.json()}catch{return{project:"error",folder:"error"}}return{project:"ok",folder:(s.data??[]).some(a=>a.id===t)?"ok":"missing"}}async createProject(r,t=""){let e=await c(`${this.baseUrl}/v1/projects`,{method:"POST",headers:{...this.headers(),"Content-Type":"application/json"},body:JSON.stringify({name:r,description:t,tags:[],source:"KTM"})});if(!e.ok){let n=await e.text(),o;try{o=JSON.parse(n)}catch{o=void 0}throw new p(`Create project failed: ${e.status} ${n}`,e.status,o)}let s=await e.json();return{id:s.id,name:r,...s.created===!1?{created:!1}:{}}}async createFolder(r,t,e=""){let s=await c(`${this.baseUrl}/v1/folder`,{method:"POST",headers:{...this.headers(),"Content-Type":"application/json"},body:JSON.stringify({folders:[{name:t,description:e,entity_id:r,entity_type:"project"}]})});if(!s.ok)throw new Error(`Create folder failed: ${s.status} ${await s.text()}`);return{id:(await s.json()).id,name:t}}async createAtmTest(r,t){let e=t?`Bearer ${t}`:this.authHeader,s=await c(`${this.baseUrl}/kane-cli/v1/test`,{method:"POST",headers:{Authorization:e,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(r)});if(!s.ok){let o=await s.text(),a;try{a=JSON.parse(o)}catch{a=void 0}throw new p(`Create ATM test failed: ${s.status} ${o}`,s.status,a)}let n=await s.json();if(!n.test_id)throw new Error("Create ATM test returned no test_id");return n.test_id}async createAttachedTest(r,t){let e;try{e=await c(`${this.baseUrl}/kane-cli/v1/test`,{method:"POST",headers:{Authorization:t?`Bearer ${t}`:this.authHeader,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(r)})}catch{return{ok:!1,reason:"failed",status:null}}let s=await e.json().catch(()=>null);if(e.status>=500)return{ok:!1,reason:"failed",status:e.status};if(!e.ok){let a=s?.error;return{ok:!1,reason:"refused",code:typeof s?.code=="string"?s.code:typeof a?.code=="string"?a.code:`HTTP_${e.status}`,status:e.status}}let n=typeof s?.test_id=="string"?s.test_id:"";if(n==="")return{ok:!1,reason:"failed",status:e.status};let o=s?.test_case_id;return typeof o!="string"&&typeof o!="number"||String(o)!==r.test_case_id?{ok:!1,reason:"outdated"}:{ok:!0,testId:n}}async createMobileAtmTest(r,t){let e=t?`Bearer ${t}`:this.authHeader,s=await c(`${this.baseUrl}/kane-cli/v1/mobile/test`,{method:"POST",headers:{Authorization:e,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(r)});if(!s.ok){let o=await s.text(),a;try{a=JSON.parse(o)}catch{a=void 0}throw new p(`Create mobile ATM test failed: ${s.status} ${o}`,s.status,a)}let n=await s.json();if(!n.test_id)throw new Error("Create mobile ATM test returned no test_id");return n.test_id}async createBrowserSession(r,t={}){let e=await c(`${this.baseUrl}/kane-cli/v1/browser-sessions`,{...t.signal?{signal:t.signal}:{},method:"POST",headers:{Authorization:this.authHeader,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({metadata:r})});if(!e.ok)throw await f.from(e);let s=await e.json().catch(()=>null);if(typeof s?.id!="string"||!s.id)throw new Error("Create browser session returned no id");return s.id}async endBrowserSession(r,t={}){let e=await c(`${this.baseUrl}/kane-cli/v1/browser-sessions/${encodeURIComponent(r)}`,{...t.signal?{signal:t.signal}:{},method:"DELETE",headers:{Authorization:this.authHeader,Accept:"application/json"}});if(!e.ok)throw await f.from(e)}async endTest(r,t,e){let s=e?`Bearer ${e}`:this.authHeader,n=new URLSearchParams({commit_id:t.commit_id,time_taken:String(t.time_taken),steps_count:String(t.steps_count),commit_message:t.commit_message}),o={};t.objectives&&t.objectives.length>0&&(o.objectives=t.objectives),t.assurance&&(o.assurance={test:t.assurance.test,definition_id:t.assurance.definitionId});let a;try{a=await c(`${this.baseUrl}/kane-cli/v1/test/${r}?${n.toString()}`,{method:"DELETE",headers:{Authorization:s,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(o)})}catch(i){throw new h(`End test failed: ${i instanceof Error?i.message:String(i)}`,null)}if(!a.ok){let i=await a.text().catch(g=>g instanceof Error?g.message:String(g));throw new h(`End test failed: ${a.status} ${i}`,a.status)}let d;try{d=await a.json()}catch(i){throw new h(`End test failed: ${i instanceof Error?i.message:String(i)}`,null)}return{testcase_id:d.data?.testcase_id??"",test_id:d.data?.test_id??r,project_id:d.data?.project_id??"",...typeof d.data?.commit_id=="string"?{commit_id:d.data.commit_id}:{}}}async submitFeedback(r,t){let e=t?`Bearer ${t}`:this.authHeader,s={instruction_id:r.instruction_id,test_id:r.test_id,feedback_type:r.feedback_type,mode:r.mode??"human"};r.details&&(s.details=r.details);let n=await c(`${this.baseUrl}/atm/v1/generative-feedback`,{method:"POST",headers:{Authorization:e,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(s)});if(!n.ok)throw new Error(`Submit feedback failed: ${n.status} ${await n.text()}`);return await n.json()}async createPolicy(r){let t=await c(`${this.baseUrl}/kane-cli/v1/policies`,{method:"POST",headers:this.headers(),body:JSON.stringify({project_id:r.projectId,content:r.content,sha256:r.sha256})});if(t.status===422){let e=await t.text(),s={};try{s=JSON.parse(e)}catch{throw new Error(`Policy create failed: 422 ${e}`)}throw new P(typeof s.message=="string"?s.message:"policy rejected",s.errors?.problems??[])}if(!t.ok)throw new Error(`Policy create failed: ${t.status} ${await t.text()}`);return await t.json()}async listPolicies(r){let t=new URLSearchParams;r.projectId&&t.set("project_id",r.projectId),r.search&&t.set("search",r.search),t.set("page",String(r.page)),t.set("per_page",String(r.perPage));let e=await c(`${this.baseUrl}/kane-cli/v1/policies?${t}`,{headers:this.headers()});if(!e.ok)throw new Error(`Policy list failed: ${e.status} ${await e.text()}`);let s=await e.json(),n=s.pagination;return{policies:s.data,page:n.current_page,lastPage:n.last_page,perPage:n.per_page,total:n.total}}async getPolicy(r){let t=await c(`${this.baseUrl}/kane-cli/v1/policy/${encodeURIComponent(r)}`,{headers:this.headers()});if(t.status===404)throw new Error(`no policy with id "${r}" in Test Manager`);if(!t.ok)throw new Error(`Policy read failed: ${t.status} ${await t.text()}`);return await t.json()}async ingestEvidence(r,t,e={}){let s=await c(`${this.baseUrl}/kane-cli/v1/evidence/ingest`,{method:"POST",headers:{Authorization:this.authHeader,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({evidence_id:r,project_id:t,...e})});if(!s.ok)throw new p(`Evidence ingest failed: ${s.status} ${await s.text()}`,s.status)}},f=class u extends Error{constructor(t,e,s,n){super(`Browser session failed: ${t} ${e}`);this.status=t;this.text=e;this.code=s;this.detail=n;this.name="BrowserSessionRefusal"}static async from(t){let e=await t.text().catch(()=>""),s=null;try{s=JSON.parse(e)}catch{}let n=s?.error&&typeof s.error=="object"?s.error:null,o=a=>typeof a=="string"&&a.trim()?a:null;return new u(t.status,e,o(s?.errorCode)??o(s?.code)??o(n?.code),o(s?.message)??o(n?.message))}};export{P as a,h as b,l as c,p as d,S as e,f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as F}from"./chunk-2RUSXQ3O.js";import{a as k}from"./chunk-FWGUISUG.js";import{b as $}from"./chunk-
|
|
2
|
+
import{a as F}from"./chunk-2RUSXQ3O.js";import{a as k}from"./chunk-FWGUISUG.js";import{b as $}from"./chunk-CQDCNP7V.js";import{deflateSync as Y}from"zlib";function j(n,s){let e=Buffer.alloc(4);e.writeUInt32BE(s.length);let o=Buffer.concat([Buffer.from(n,"latin1"),s]),i=Buffer.alloc(4);return i.writeUInt32BE(F(o)),Buffer.concat([e,o,i])}var G={1:0,3:2,4:6};function N(n,s){let{width:e,height:o,channels:i}=s;if(n.byteLength!==e*o*i)throw new Error(`pngEncode: raw length ${n.byteLength} != ${e}x${o}x${i}`);let d=Buffer.alloc(13);d.writeUInt32BE(e,0),d.writeUInt32BE(o,4),d[8]=8,d[9]=G[i];let t=e*i,a=Buffer.alloc(o*(t+1));for(let f=0;f<o;f++)a[f*(t+1)]=0,n.copy(a,f*(t+1)+1,f*t,(f+1)*t);return Buffer.concat([Buffer.from([137,80,78,71,13,10,26,10]),j("IHDR",d),j("IDAT",Y(a)),j("IEND",Buffer.alloc(0))])}var U=64,X=16,J=12e6,V=6e6,K=5e3,W=3e4,H="",_=class extends Error{constructor(e,o){super(`${e}: ${o}`);this.code=e}};async function q(n,s,e){let o=n.objs.has(s)?n.objs:n.commonObjs.has(s)?n.commonObjs:null;if(o)try{return o.get(s)??null}catch{return null}if(e.remainingMs<=0)return null;let i=s.startsWith("g_")?n.commonObjs:n.objs,d,t=Date.now();try{return await Promise.race([new Promise(a=>{try{i.get(s,f=>a(f??null))}catch{a(null)}}),new Promise(a=>{d=setTimeout(()=>a(null),Math.min(K,e.remainingMs))})])}finally{clearTimeout(d),e.remainingMs-=Date.now()-t}}async function z(){let n=await import("pdfjs-dist/legacy/build/pdf.mjs");return n.default??n}async function oe(n,s){let e=await z();H=e.version;let o={remainingMs:s?.resolveBudgetMs??W},i,d=e.getDocument({data:new Uint8Array(n),isEvalSupported:!1,verbosity:0});try{i=await d.promise}catch(t){throw t.name==="PasswordException"?new _("PDF_ENCRYPTED","password-protected \u2014 decrypt and re-ingest"):new _("PDF_UNREADABLE",String(t.message??t))}try{let t=[],a=[],f=new Map,D=[],T=new Map,R=0,A=0;for(let u=1;u<=i.numPages;u++){let O=await i.getPage(u);t.push(`[page ${u}]`);let C=await O.getTextContent(),c="",E=null;for(let m of C.items){if(typeof m!="object"||m===null||!("str"in m))continue;let p=m,P=Math.round(p.transform[5]);E!==null&&P!==E&&c.trim()!==""&&(t.push(c.trimEnd()),c=""),c!==""&&!c.endsWith(" ")&&p.str!==""&&!p.str.startsWith(" ")&&P===E&&(c+=" "),c+=p.str,A+=p.str.trim().length,E=P,p.hasEOL&&c.trim()!==""&&(t.push(c.trimEnd()),c="",E=null)}c.trim()!==""&&t.push(c.trimEnd());let B=await O.getOperatorList(),M=0;for(let m=0;m<B.fnArray.length;m++){let p=B.fnArray[m]===e.OPS.paintImageXObject,P=B.fnArray[m]===e.OPS.paintInlineImageXObject;if(!p&&!P)continue;M+=1;let h=`p${u}-${M}`,l=(v,L,w,S)=>{a.push({ref:h,page:u,media_type:"image/png",...L?{blob:L}:{},...S?{appearance:S}:{},delivery:v,...w?{duplicate_of:w}:{}}),t.push(v==="duplicate"&&w?`[img#${h}: image on page ${u} \u2014 same as img#${w}; cite img#${w}]`:`[img#${h} omitted: ${v}]`)};if(P){l("unsupported-image-kind");continue}let r=await q(O,B.argsArray[m][0],o);if(!r?.data||!r.width||!r.height){l("undecodable");continue}let I;if(r.kind===e.ImageKind.RGB_24BPP)I=3;else if(r.kind===e.ImageKind.RGBA_32BPP)I=4;else{l("unsupported-image-kind");continue}let y;try{y=N(Buffer.from(r.data.buffer,r.data.byteOffset,r.data.byteLength),{width:r.width,height:r.height,channels:I})}catch{l("undecodable");continue}let g=$(y);f.set(g,y);let b=k(Buffer.from(r.data.buffer,r.data.byteOffset,r.data.byteLength),{width:r.width,height:r.height,channels:I});if(r.width<U||r.height<U){l("below-dimension-floor",g,void 0,b);continue}let x=T.get(g);if(x!==void 0){l("duplicate",g,x,b);continue}if(y.byteLength>V){l("image-too-large",g,void 0,b);continue}if(R+y.byteLength>J){l("vision-byte-budget-reached",g,void 0,b);continue}if(D.length>=X){l("image-cap-reached",g,void 0,b);continue}T.set(g,h),R+=y.byteLength,D.push(h),a.push({ref:h,page:u,media_type:"image/png",blob:g,appearance:b,delivery:"selected"}),t.push(`[img#${h}: image on page ${u}]`)}}if(A===0&&i.numPages>0)throw new _("PDF_NO_TEXT_LAYER","no extractable text \u2014 image-only or scanned pdfs are not supported yet");return{projection:t.join(`
|
|
3
3
|
`)+`
|
|
4
4
|
`,inventory:a,blobs:f,delivered:D,pages:i.numPages,converter:{name:"pdfjs-dist",version:e.version,policy:"v1"}}}finally{await d.destroy().catch(()=>{})}}export{U as a,X as b,J as c,V as d,H as e,_ as f,oe as g};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Ye}from"./chunk-
|
|
2
|
+
import{a as Ye}from"./chunk-X45RZIAJ.js";import{b as Ve}from"./chunk-LV7224DG.js";import{a as qe}from"./chunk-VE3SUJMA.js";import{c as We}from"./chunk-SMXABALN.js";import{a as be}from"./chunk-YCVEI7BT.js";import{a as Ge}from"./chunk-PCQK62MP.js";import{a as He}from"./chunk-ZCBOHWN3.js";import{a as re}from"./chunk-HCBYKLMW.js";import{a as h,b as f,h as Fe,i as Se,k as Ne}from"./chunk-33DWJV67.js";import{a as we}from"./chunk-6YGTRKDT.js";import{b as Le,z as u}from"./chunk-J4FIESTB.js";import{e as $}from"./chunk-UR6MHSHU.js";var je=$(we(),1);import{readFileSync as ct,writeFileSync as ut,mkdirSync as ft}from"fs";import{dirname as dt,join as ze}from"path";var mt=ze(Le,"command-history.json"),Dt=ze(Le,"generate-history.json"),ht=200,De=class{entries;filePath;max;constructor(t=mt,e=ht){this.filePath=t,this.max=e,this.entries=this._load()}push(t){this.entries.length>0&&this.entries[this.entries.length-1]===t||(this.entries.push(t),this.entries.length>this.max&&(this.entries=this.entries.slice(this.entries.length-this.max)),this._save())}getAll(){return[...this.entries]}search(t){let e=t.toLowerCase(),o=[];for(let s=this.entries.length-1;s>=0;s--)this.entries[s].toLowerCase().includes(e)&&o.push(this.entries[s]);return o}_load(){if(this.filePath===null)return[];try{let t=ct(this.filePath,"utf-8"),e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}_save(){if(this.filePath!==null)try{ft(dt(this.filePath),{recursive:!0}),ut(this.filePath,JSON.stringify(this.entries)+`
|
|
3
3
|
`)}catch{}}};function kt(n){let t=(0,je.useRef)(null);return t.current||(t.current=new De(n)),t.current}var D=$(we(),1);var ke=$(we(),1);var Z=$(re(),1);function Xe({history:n,onSelect:t,onClose:e}){let[o,s]=(0,ke.useState)(""),[l,m]=(0,ke.useState)(0),v=o?n.search(o).slice(0,8):[];return Se((b,d)=>{if(d.escape){e();return}if(d.return){v.length>0&&v[l]?t(v[l]):e();return}if(d.upArrow){m(S=>Math.max(0,S-1));return}if(d.downArrow){m(S=>Math.min(v.length-1,S+1));return}if(d.backspace||d.delete){s(S=>S.slice(0,-1)),m(0);return}b&&!d.ctrl&&!d.meta&&(s(S=>S+b),m(0))}),(0,Z.jsxs)(h,{flexDirection:"column",marginLeft:2,borderStyle:"single",paddingX:1,children:[(0,Z.jsx)(f,{color:u.muted,bold:!0,children:"reverse search"}),(0,Z.jsxs)(h,{gap:1,children:[(0,Z.jsx)(f,{color:u.dim,children:"search:"}),(0,Z.jsx)(f,{children:o}),(0,Z.jsx)(f,{color:u.orange,children:"\u2588"})]}),v.length>0&&(0,Z.jsx)(f,{children:" "}),v.map((b,d)=>(0,Z.jsx)(h,{marginLeft:2,children:(0,Z.jsxs)(f,{color:d===l?u.orange:u.dim,bold:d===l,children:[d===l?"\u25B8 ":" ",b]})},`${d}-${b}`))]})}var X=$(re(),1);function Je({commands:n,selectedIndex:t}){return n.length===0?null:(0,X.jsx)(h,{flexDirection:"column",marginBottom:0,children:n.map((e,o)=>{let s=o===t;return e.disabled?(0,X.jsxs)(h,{children:[(0,X.jsx)(f,{color:u.dim,children:s?"\u276F ":" "}),(0,X.jsxs)(f,{color:u.dim,children:["/",e.name]}),(0,X.jsxs)(f,{color:u.dim,children:[" ",e.disabledReason??e.description]})]},e.name):(0,X.jsxs)(h,{children:[(0,X.jsx)(f,{color:s?u.orange:u.dim,children:s?"\u276F ":" "}),(0,X.jsxs)(f,{color:s?u.orange:void 0,bold:s,children:["/",e.name]}),e.args&&(0,X.jsxs)(f,{color:u.dim,children:[" ",e.args]}),(0,X.jsxs)(f,{color:u.dim,children:[" ",e.description]})]},e.name)})})}var Ze=$(we(),1);var q=$(re(),1),et={scenario:"Scenarios",case:"Test Cases",file:"Files",artifact:"Artifact candidates",installed:"Installed on device"};function Qe(n){let t={scenario:0,case:0,file:0,artifact:0,installed:0};for(let e of n)t[e.kind]++;return["scenario","case","file","artifact","installed"].filter(e=>t[e]>0).map(e=>`${t[e]} ${et[e]}`).join(" \xB7 ")}var Pe=7;function tt({items:n,selectedIndex:t,accent:e=u.orange}){let o=n.length;if(o===0)return null;let s=Math.floor(Pe/2),l=o<=Pe?0:Math.max(0,Math.min(t-s,o-Pe)),m=Math.min(o,l+Pe),v=l,b=o-m;return(0,q.jsxs)(h,{flexDirection:"column",marginBottom:0,children:[v>0&&(0,q.jsx)(h,{children:(0,q.jsx)(f,{color:u.dim,children:` \u22EF ${v} above \u2014 ${Qe(n.slice(0,l))}`})}),n.slice(l,m).map((d,S)=>{let U=l+S,F=d.selectable!==!1,E=U===t&&F,R=S===0||n[U-1].kind!==d.kind;return(0,q.jsxs)(Ze.default.Fragment,{children:[R&&(0,q.jsx)(h,{children:(0,q.jsx)(f,{color:u.dim,children:et[d.kind]})}),(0,q.jsxs)(h,{children:[(0,q.jsx)(f,{color:E?e:u.dim,children:E?"\u276F ":" "}),(0,q.jsxs)(f,{color:E?e:F?void 0:u.dim,bold:E,children:[d.label,d.reason?` \u2014 ${d.reason}`:""]})]})]},`${d.kind}:${d.value}:${U}`)}),b>0&&(0,q.jsx)(h,{children:(0,q.jsx)(f,{color:u.dim,children:` \u22EF ${b} more \u2014 ${Qe(n.slice(m))}`})})]})}var Be=$(we(),1);var gt=27,pt=127,xt=11;function bt(n){return n>=64&&n<=126}function Tt(n,t){n===xt&&t({killToEnd:!0,ctrl:!0,raw:String.fromCharCode(n)})}function vt(n,t){n===pt&&t({backspace:!0,meta:!0,raw:"\x1B\x7F"})}function wt(n,t){let e=n.map(s=>String.fromCharCode(s)).join(""),o=/^\[1;([0-9]+)([A-D])$/.exec(e);if(o){let s=parseInt(o[1],10),l=o[2],m={raw:"\x1B"+e};if(s===2)m.shift=!0;else if(s===3)m.meta=!0;else if(s===5)m.ctrl=!0;else return;l==="A"?m.arrowUp=!0:l==="B"?m.arrowDown=!0:l==="C"?m.arrowRight=!0:l==="D"&&(m.arrowLeft=!0),t(m);return}if(e==="[H"||e==="[1~"||e==="[7~"){t({home:!0,raw:"\x1B"+e});return}if(e==="[F"||e==="[4~"||e==="[8~"){t({end:!0,raw:"\x1B"+e});return}if(e==="[3;5~"){t({delete:!0,ctrl:!0,raw:"\x1B"+e});return}if(e==="[3;3~"){t({delete:!0,meta:!0,raw:"\x1B"+e});return}}function St(n,t){n===72?t({home:!0,raw:"\x1BO"+String.fromCharCode(n)}):n===70&&t({end:!0,raw:"\x1BO"+String.fromCharCode(n)})}function Et(){let n="IDLE",t=[];function e(){n="IDLE",t=[]}return{feed(o,s){for(let l of o)n==="IDLE"?l===gt?(n="ESC",t=[]):Tt(l,s):n==="ESC"?l===91?(n="CSI",t=[]):l===79?(n="SS3",t=[]):(vt(l,s),e()):n==="CSI"?(t.push(l),bt(l)&&(wt([91,...t],s),e())):n==="SS3"&&(St(l,s),e())},flushIdle(o){n==="ESC"&&t.length===0&&o({raw:"\x1B"}),e()}}}function nt(n,t={}){let e=(0,Be.useRef)(n);e.current=n;let{stdin:o}=Fe();(0,Be.useEffect)(()=>{if(t.isActive===!1||!o)return;let s=Et(),l=null,m=v=>{l&&(clearTimeout(l),l=null);let b=Buffer.isBuffer(v)?v:Buffer.from(v,"binary");s.feed(b,d=>e.current(d)),l=setTimeout(()=>{s.flushIdle(d=>e.current(d)),l=null},50)};return o.on("data",m),()=>{o.removeListener("data",m),l&&clearTimeout(l)}},[t.isActive,o])}var w=$(re(),1);function yt(n,t){let e=t-1;for(;e>=0&&n[e]!=="@"&&n[e]!==" "&&n[e]!==`
|
|
4
4
|
`;)e--;return e<0||n[e]!=="@"||e>0&&n[e-1]!==" "&&n[e-1]!==`
|
|
5
5
|
`?null:{at:e,query:n.slice(e+1,t).join("")}}function rt(n,t,e){for(let o=t+e;o>=0&&o<n.length;o+=e)if(n[o]?.selectable!==!1)return o;return t}function At(n){let t=n.findIndex(e=>e.selectable!==!1);return t===-1?0:t}var Oe=10;function Rt(n){return n.replace(/\x1b?\[200~/g,"").replace(/\x1b?\[201~/g,"").replace(/\r\n/g,`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-5Y2G4NC7.js";import{a as n}from"./chunk-HCBYKLMW.js";import{b as o}from"./chunk-33DWJV67.js";import{a as s}from"./chunk-6YGTRKDT.js";import{z as t}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-5Y2G4NC7.js";import{a as n}from"./chunk-HCBYKLMW.js";import{b as o}from"./chunk-33DWJV67.js";import{a as s}from"./chunk-6YGTRKDT.js";import{z as t}from"./chunk-J4FIESTB.js";import{e as r}from"./chunk-UR6MHSHU.js";var l=r(s(),1);var m=r(n(),1),i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function b({active:e=!0}){let[p,c]=(0,l.useState)(0);return a(()=>{c(f=>(f+1)%i.length)},e?80:null),(0,m.jsx)(o,{color:t.orange,children:e?i[p]:"\u25CF"})}export{b as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as J,d as X,h as B,i as Y,j as Q,k as V,l as Z,m as ee,n as te,o as F,p as ne}from"./chunk-7V34ZMMS.js";import{d as P}from"./chunk-B7ZX5HEN.js";import{I as se,J as oe,L as R,M as E,N as ae,Na as k,a as ie,r as A}from"./chunk-Z777GGHB.js";import{f as x,h as re}from"./chunk-KU3YHPWZ.js";import{existsSync as D,readFileSync as I,renameSync as $e,writeFileSync as Ee}from"fs";import{dirname as q,isAbsolute as T,resolve as N}from"path";var ve=new Set(["inline","testmd","testrun"]),ye=new Set(["inferred","authored","runtime-derived"]),C=new Set(["passed","failed","broken","skipped"]);function ce(t,e,n){if(n.facts.length===0)return{record:null,errors:[{code:"EMPTY_EXECUTIONS",detail:"a run with no designed units attaches no facts \u2014 skip the call"}]};let a=e;for(let s=0;;s++){let o=t.head(),c=t.serialize(o);if(!t.sameToken(t.parse(a.latestHash),o)){if(s>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:`graph opened at ${String(a.latestHash)} but chain head is ${String(c)} \u2014 retry budget exhausted`}]};a=E(t);continue}let d=be(t,a,n);if(d!=="cas")return d;if(s>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:"concurrent appends kept moving the head \u2014 retry budget exhausted"}]};a=E(t)}}function de(t,e){return ve.has(t.mode)?C.has(t.verdict)?ye.has(t.oracle_mode)?typeof t.drift_flag!="boolean"||typeof t.stale_at_run!="boolean"?[{code:"MISSING_FIELD",detail:`${e}: drift_flag and stale_at_run are required booleans`}]:!t.execution_id||!t.started_at||!t.definition_id_at_run?[{code:"MISSING_FIELD",detail:`${e}: execution_id, started_at and definition_id_at_run are required`}]:[]:[{code:"BAD_ORACLE_MODE",detail:`${e}: oracle_mode '${t.oracle_mode}' not in inferred|authored|runtime-derived`}]:[{code:"BAD_VERDICT",detail:`${e}: verdict '${t.verdict}' not in ${[...C].join("|")}`}]:[{code:"BAD_MODE",detail:`${e}: mode '${t.mode}' not in inline|testmd|testrun`}]}function ue(t,e,n,a){return{about:e,definition_id_at_run:t.definition_id_at_run,verdict:t.verdict,...n&&n.length?{per_ac:n}:{},drift_flag:t.drift_flag,oracle_mode:t.oracle_mode,stale_at_run:t.stale_at_run,...a.length?{unresolved_acs:a}:{},execution_id:t.execution_id,...t.evidence_id?{evidence_id:t.evidence_id}:{},...t.duration_ms!==void 0?{duration_ms:t.duration_ms}:{},started_at:t.started_at,mode:t.mode,local:t.local,...t.via_parent?{via_parent:t.via_parent}:{}}}function pe(t,e,n={}){if(!Array.isArray(e.facts)||e.facts.length===0)return{record:null,errors:[{code:"EMPTY_EXECUTIONS",detail:"parked line carries no facts"}]};for(let a=0;;a++){let s=E(t),o=e.facts.filter(r=>s.appliedEvents.has(r.event_id)).map(r=>r.event_id),c=e.facts.filter(r=>!s.appliedEvents.has(r.event_id));if(c.length===0)return{record:null,errors:null,applied:[],skipped:o,rejected:[]};let d=[],u=[],l=[],h=[];for(let r of c){let i=`executions[${r.ref}]`,f=[];if(!r.about_cid||!s.hasNode(r.about_cid))f.push({code:"UNKNOWN_REF",detail:`${i}: about_cid '${String(r.about_cid)}' is not in the graph \u2014 the pinned run-time target is gone`});else if(s.nodeLabel.get(r.about_cid)!==x.TEST)f.push({code:"ILLEGAL_TARGET",detail:`${i}: execution facts attach to tests \u2014 '${r.about_cid}' is a ${s.nodeLabel.get(r.about_cid)}`});else if(!r.event_id)f.push({code:"MISSING_FIELD",detail:`${i}: parked facts require event_id`});else{f.push(...de(r,i));for(let g of r.per_ac??[])C.has(g.verdict)||f.push({code:"BAD_VERDICT",detail:`${i}.per_ac['${g.ac_ref}']: verdict '${g.verdict}'`})}if(f.length>0){d.push({event_id:r.event_id??"",errors:f});continue}let p=[],m=[],v=[...r.unresolved_acs??[]];for(let g of r.per_ac??[]){let $=g.ac_cid&&s.hasNode(g.ac_cid)&&s.nodeLabel.get(g.ac_cid)===x.AC?g.ac_cid:null,y=$?null:s.resolve(g.ac_ref),_=$??(y?s.tipOf(y.cid):null);if(!_||!$&&(s.superseded.has(_)||s.nodeLabel.get(_)!==x.AC)){v.push(g.ac_ref);continue}p.push({ac_ref:s.nameOf.get(_)??g.ac_ref,ac_cid:_,verdict:g.verdict}),m.push(_)}u.push(ue(r,r.about_cid,p,v)),h.push({about_cid:r.about_cid,per_ac:m}),l.push(r.event_id)}if(u.length===0)return{record:null,errors:null,applied:[],skipped:o,rejected:d};try{let r=R(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],executions:u,event_ids:[...l].sort(),source_head_moves:{}},{returnWarnings:!0,graph:s,expectPrev:s.latestHash,intent:{v:1,verb:"parked",args:A({line:e}),pins:{facts:h}},busyRetry:{deadlineMs:5e3},provenance:n.provenance});return{record:r.record,errors:null,applied:l,skipped:o,rejected:d,...r.warnings?{warnings:r.warnings}:{}}}catch(r){if(!(r instanceof k))throw r;if(a>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:"concurrent appends kept moving the head \u2014 parked replay retry budget exhausted (line stays queued)"}]}}}}function be(t,e,n){let a=[],s=[],o=[];for(let d of n.facts){let u=`executions[${d.ref}]`,l=n.pinned?null:e.resolve(d.ref),h=n.pinned?d.about_cid&&e.hasNode(d.about_cid)?d.about_cid:null:l?e.tipOf(l.cid):null;if(!h||!n.pinned&&e.superseded.has(h)){a.push({code:"UNKNOWN_REF",detail:`${u}: '${n.pinned?String(d.about_cid):d.ref}' is not a ${n.pinned?"":"live "}committed node`});continue}if(e.nodeLabel.get(h)!==x.TEST){a.push({code:"ILLEGAL_TARGET",detail:`${u}: execution facts attach to tests \u2014 '${d.ref}' is a ${e.nodeLabel.get(h)}`});continue}let r=de(d,u);if(r.length>0){a.push(...r);continue}let i=[],f=[];for(let p of d.per_ac??[]){let m=n.pinned?null:e.resolve(p.ac_ref),v=n.pinned?p.ac_cid&&e.hasNode(p.ac_cid)?p.ac_cid:null:m?e.tipOf(m.cid):null;if(!v||!n.pinned&&e.superseded.has(v)||e.nodeLabel.get(v)!==x.AC){a.push({code:"UNKNOWN_REF",detail:`${u}.per_ac: '${n.pinned?String(p.ac_cid):p.ac_ref}' is not a${n.pinned?"n":" live"} AC`});continue}if(!C.has(p.verdict)){a.push({code:"BAD_VERDICT",detail:`${u}.per_ac['${p.ac_ref}']: verdict '${p.verdict}'`});continue}i.push({ac_ref:e.nameOf.get(v)??v,ac_cid:v,verdict:p.verdict}),f.push(v)}s.push(ue(d,h,i,d.unresolved_acs??[])),o.push({about_cid:h,per_ac:f})}if(a.length>0)return{record:null,errors:a};let c;try{c=R(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],executions:s,...n.eventIds&&n.eventIds.length>0?{event_ids:n.eventIds}:{},source_head_moves:{}},{returnWarnings:!0,graph:e,expectPrev:e.latestHash,intent:{v:1,verb:"execution",args:A({facts:n.facts,by:n.by,eventIds:n.eventIds??null}),pins:{facts:o}},busyRetry:{deadlineMs:n.lockDeadlineMs??5e3},provenance:n.provenance})}catch(d){if(d instanceof k)return"cas";throw d}return{record:c.record,errors:null,...c.warnings?{warnings:c.warnings}:{}}}function Ye(t){let e={failed:3,broken:2,skipped:1,passed:0},n=new Map;for(let a of t)for(let s of a.verifies??[]){let o=n.get(s);(o===void 0||(e[a.status]??0)>(e[o]??0))&&n.set(s,a.status)}return[...n.entries()].map(([a,s])=>({ref:a,verdict:s}))}function Qe(t){let e=[],{store:n}=t;if(!n.exists())return{synced:0,superseded:0,skipped:"no-context",warnings:e};let a=t.by??{kind:"ai",id:"exec-sync"},s=t.lockDeadlineMs;try{Se(n,e,s)}catch(i){e.push(`sync: parked-facts replay failed (${i instanceof Error?i.message:String(i)}) \u2014 queue intact, retrying next sync`)}let o=E(n),c=[],d=0,u=new Set,l=new Set(t.members.map(i=>T(i.path)?i.path:N(t.projectDir,i.path))),h=new Map;for(let i of t.members){let f=T(i.path)?i.path:N(t.projectDir,i.path);if(!D(f)){e.push(`sync: member file missing: ${f} \u2014 skipped, no fact attached`);continue}for(let p of xe(f,e))if(!u.has(p.path))try{let m=p.path===f,v=!m&&l.has(p.path),g=m?void 0:F(I(f,"utf8"))?.id,$=I(p.path,"utf8"),y=F($);if(!y?.id){u.add(p.path);continue}let _=o.resolve(y.id),S=_?o.tipOf(_.cid):null;if(!_||!S||o.superseded.has(S)){u.add(p.path),e.push(`sync: ${y.id} does not resolve to a live test \u2014 skipped (foreign store?)`);continue}let L=B(V($,ee(q(p.path),o))),_e=String(o.getNode(S)?.content.test_md_blob??""),j=B(V(_e,Z(o))),G=o.getNode(S)?.content.definitionId,M=typeof G=="string"?G:j,w=!1,O=S;if(L===j)y.base!==M&&he(p.path,$,M,e);else if(y.base===j||y.base===M){let b=Ie(n,o,S,$,L,q(p.path),a);b.error?(e.push(`sync: could not supersede ${y.id}: ${b.error}`),w=!0):(d++,O=b.newCid,w=b.oracleTier,he(p.path,I(p.path,"utf8"),L,e),o=E(n))}else w=!0,e.push(y.base?`sync: ${y.id} was edited from an older version \u2014 graph kept; reconcile via a redesign or maintain`:`sync: ${y.id} carries no base pin (hand-copied file?) \u2014 fact attached with drift flag`);if(v){w&&h.set(p.path,!0);continue}u.add(p.path);let H=o.getNode(O)?.content.check,W=m?i.acs??[]:[],U=W.filter(b=>fe(o,b.ref)),z=W.filter(b=>!fe(o,b.ref)).map(b=>b.ref);c.push({ref:y.id,about_cid:O,definition_id_at_run:L,verdict:i.verdict,...U.length?{per_ac:U.map(b=>{let K=ge(o,b.ref);return{ac_ref:b.ref,...K?{ac_cid:K}:{},verdict:b.verdict}})}:{},drift_flag:w||h.get(p.path)===!0||m&&i.driftFlag===!0,oracle_mode:H?.expected_mode??(J(H?.operand)?"runtime-derived":"inferred"),stale_at_run:o.stale(O)!=="fresh",...z.length?{unresolved_acs:z}:{},execution_id:i.executionId,...i.evidenceId?{evidence_id:i.evidenceId}:{},...i.durationMs!==void 0?{duration_ms:i.durationMs}:{},started_at:i.startedAt,mode:i.mode,local:i.local,...g?{via_parent:g}:{}})}catch(m){p.path!==f&&l.has(p.path)||u.add(p.path),e.push(`sync: ${p.path} failed to sync (${m instanceof Error?m.message:String(m)}) \u2014 skipped; other members unaffected`)}}if(c.length===0)return{synced:0,superseded:d,warnings:e};let r;try{r=ce(n,E(n),{facts:c,by:a,eventIds:c.map(i=>`exec-fact:${i.execution_id}:${i.ref}`),lockDeadlineMs:s})}catch(i){return e.push(`sync facts: commit threw: ${i instanceof Error?i.message:String(i)}`),le(n,c,a,e,s),{synced:0,superseded:d,warnings:e}}return r.errors?(le(n,c,a,e,s),e.push(...r.errors.map(i=>`sync facts: ${i.code}: ${i.detail}`)),{synced:0,superseded:d,warnings:e}):(r.warnings&&e.push(...r.warnings.map(i=>`sync facts: ${i}`)),{synced:c.length,superseded:d,warnings:e})}function le(t,e,n,a,s){try{let o={by:n,ts:new Date().toISOString(),facts:e.map(u=>({...u,about_cid:u.about_cid??"",event_id:`exec-fact:${u.execution_id}:${u.ref}`}))},{where:c,sideFile:d}=t.parkedFacts().park(JSON.stringify(o),{deadlineMs:s??5e3});d&&a.push(`sync facts: store lock busy \u2014 parked to ${c}; it drains on the next sync`),a.push(`sync facts: commit failed \u2014 ${e.length} fact(s) parked to ${c}; they replay on the next sync`)}catch(o){a.push(`sync facts: could not park the failed batch (${o instanceof Error?o.message:String(o)}) \u2014 this run's facts are LOST`)}}function Se(t,e,n){let a=t.parkedFacts(),s=n??5e3,o=a.snapshot({deadlineMs:s});if("fenced"in o){e.push(`sync: parked facts stay queued while rebase ${o.fenced} is open \u2014 they drain on the first sync after it is finished`);return}let c=o.lines;if(c.length===0)return;let d=new Set,u=[];for(let l of c){let h=null;try{let i=JSON.parse(l);i&&Array.isArray(i.facts)&&(h=i)}catch{}if(!h){u.push({parent:l,line:l}),d.add(l);continue}let r=pe(t,h);if(r.errors){if(r.errors.some(i=>i.code==="STALE_BASIS")){e.push(`sync: parked facts replay deferred (${r.errors[0].detail}) \u2014 retrying next sync`);continue}u.push({parent:l,line:l}),d.add(l),e.push(`sync: parked facts line quarantined to ${a.quarantinePath} (${r.errors.map(i=>`${i.code}: ${i.detail}`).join("; ")})`);continue}for(let i of r.rejected){let f=h.facts.find(p=>p.event_id===i.event_id);u.push({parent:l,line:JSON.stringify({...f??{event_id:i.event_id},_reason:i.errors})})}if(r.rejected.length>0){let i=r.rejected.map(f=>f.errors.map(p=>`${p.code}: ${p.detail}`).join("; ")).join(" | ");e.push(`sync: ${r.rejected.length} parked fact(s) quarantined to ${a.quarantinePath} (${i})`)}d.add(l),r.warnings&&e.push(...r.warnings.map(i=>`sync: ${i}`)),r.applied.length>0&&e.push(`sync: replayed ${r.applied.length} parked fact(s) from a previous run`)}if(d.size!==0)try{a.settle(d,u,{deadlineMs:s})}catch(l){e.push(`sync: queue rewrite failed (${l instanceof Error?l.message:String(l)}) \u2014 already-applied lines dedupe next sync; bad lines re-quarantine then`)}}function xe(t,e){let n=[],a=new Set,s=o=>{if(a.has(o)||!D(o))return;a.add(o);let c;try{c=I(o,"utf8")}catch(d){e.push(`sync: unreadable unit ${o} (${d instanceof Error?d.message:String(d)}) \u2014 skipped`);return}for(let d of c.split(`
|
|
2
|
+
import{a as J,d as X,h as B,i as Y,j as Q,k as V,l as Z,m as ee,n as te,o as F,p as ne}from"./chunk-7V34ZMMS.js";import{d as P}from"./chunk-B7ZX5HEN.js";import{I as se,J as oe,L as R,M as E,N as ae,Na as k,a as ie,r as A}from"./chunk-PI7OXS62.js";import{f as x,h as re}from"./chunk-KU3YHPWZ.js";import{existsSync as D,readFileSync as I,renameSync as $e,writeFileSync as Ee}from"fs";import{dirname as q,isAbsolute as T,resolve as N}from"path";var ve=new Set(["inline","testmd","testrun"]),ye=new Set(["inferred","authored","runtime-derived"]),C=new Set(["passed","failed","broken","skipped"]);function ce(t,e,n){if(n.facts.length===0)return{record:null,errors:[{code:"EMPTY_EXECUTIONS",detail:"a run with no designed units attaches no facts \u2014 skip the call"}]};let a=e;for(let s=0;;s++){let o=t.head(),c=t.serialize(o);if(!t.sameToken(t.parse(a.latestHash),o)){if(s>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:`graph opened at ${String(a.latestHash)} but chain head is ${String(c)} \u2014 retry budget exhausted`}]};a=E(t);continue}let d=be(t,a,n);if(d!=="cas")return d;if(s>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:"concurrent appends kept moving the head \u2014 retry budget exhausted"}]};a=E(t)}}function de(t,e){return ve.has(t.mode)?C.has(t.verdict)?ye.has(t.oracle_mode)?typeof t.drift_flag!="boolean"||typeof t.stale_at_run!="boolean"?[{code:"MISSING_FIELD",detail:`${e}: drift_flag and stale_at_run are required booleans`}]:!t.execution_id||!t.started_at||!t.definition_id_at_run?[{code:"MISSING_FIELD",detail:`${e}: execution_id, started_at and definition_id_at_run are required`}]:[]:[{code:"BAD_ORACLE_MODE",detail:`${e}: oracle_mode '${t.oracle_mode}' not in inferred|authored|runtime-derived`}]:[{code:"BAD_VERDICT",detail:`${e}: verdict '${t.verdict}' not in ${[...C].join("|")}`}]:[{code:"BAD_MODE",detail:`${e}: mode '${t.mode}' not in inline|testmd|testrun`}]}function ue(t,e,n,a){return{about:e,definition_id_at_run:t.definition_id_at_run,verdict:t.verdict,...n&&n.length?{per_ac:n}:{},drift_flag:t.drift_flag,oracle_mode:t.oracle_mode,stale_at_run:t.stale_at_run,...a.length?{unresolved_acs:a}:{},execution_id:t.execution_id,...t.evidence_id?{evidence_id:t.evidence_id}:{},...t.duration_ms!==void 0?{duration_ms:t.duration_ms}:{},started_at:t.started_at,mode:t.mode,local:t.local,...t.via_parent?{via_parent:t.via_parent}:{}}}function pe(t,e,n={}){if(!Array.isArray(e.facts)||e.facts.length===0)return{record:null,errors:[{code:"EMPTY_EXECUTIONS",detail:"parked line carries no facts"}]};for(let a=0;;a++){let s=E(t),o=e.facts.filter(r=>s.appliedEvents.has(r.event_id)).map(r=>r.event_id),c=e.facts.filter(r=>!s.appliedEvents.has(r.event_id));if(c.length===0)return{record:null,errors:null,applied:[],skipped:o,rejected:[]};let d=[],u=[],l=[],h=[];for(let r of c){let i=`executions[${r.ref}]`,f=[];if(!r.about_cid||!s.hasNode(r.about_cid))f.push({code:"UNKNOWN_REF",detail:`${i}: about_cid '${String(r.about_cid)}' is not in the graph \u2014 the pinned run-time target is gone`});else if(s.nodeLabel.get(r.about_cid)!==x.TEST)f.push({code:"ILLEGAL_TARGET",detail:`${i}: execution facts attach to tests \u2014 '${r.about_cid}' is a ${s.nodeLabel.get(r.about_cid)}`});else if(!r.event_id)f.push({code:"MISSING_FIELD",detail:`${i}: parked facts require event_id`});else{f.push(...de(r,i));for(let g of r.per_ac??[])C.has(g.verdict)||f.push({code:"BAD_VERDICT",detail:`${i}.per_ac['${g.ac_ref}']: verdict '${g.verdict}'`})}if(f.length>0){d.push({event_id:r.event_id??"",errors:f});continue}let p=[],m=[],v=[...r.unresolved_acs??[]];for(let g of r.per_ac??[]){let $=g.ac_cid&&s.hasNode(g.ac_cid)&&s.nodeLabel.get(g.ac_cid)===x.AC?g.ac_cid:null,y=$?null:s.resolve(g.ac_ref),_=$??(y?s.tipOf(y.cid):null);if(!_||!$&&(s.superseded.has(_)||s.nodeLabel.get(_)!==x.AC)){v.push(g.ac_ref);continue}p.push({ac_ref:s.nameOf.get(_)??g.ac_ref,ac_cid:_,verdict:g.verdict}),m.push(_)}u.push(ue(r,r.about_cid,p,v)),h.push({about_cid:r.about_cid,per_ac:m}),l.push(r.event_id)}if(u.length===0)return{record:null,errors:null,applied:[],skipped:o,rejected:d};try{let r=R(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],executions:u,event_ids:[...l].sort(),source_head_moves:{}},{returnWarnings:!0,graph:s,expectPrev:s.latestHash,intent:{v:1,verb:"parked",args:A({line:e}),pins:{facts:h}},busyRetry:{deadlineMs:5e3},provenance:n.provenance});return{record:r.record,errors:null,applied:l,skipped:o,rejected:d,...r.warnings?{warnings:r.warnings}:{}}}catch(r){if(!(r instanceof k))throw r;if(a>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:"concurrent appends kept moving the head \u2014 parked replay retry budget exhausted (line stays queued)"}]}}}}function be(t,e,n){let a=[],s=[],o=[];for(let d of n.facts){let u=`executions[${d.ref}]`,l=n.pinned?null:e.resolve(d.ref),h=n.pinned?d.about_cid&&e.hasNode(d.about_cid)?d.about_cid:null:l?e.tipOf(l.cid):null;if(!h||!n.pinned&&e.superseded.has(h)){a.push({code:"UNKNOWN_REF",detail:`${u}: '${n.pinned?String(d.about_cid):d.ref}' is not a ${n.pinned?"":"live "}committed node`});continue}if(e.nodeLabel.get(h)!==x.TEST){a.push({code:"ILLEGAL_TARGET",detail:`${u}: execution facts attach to tests \u2014 '${d.ref}' is a ${e.nodeLabel.get(h)}`});continue}let r=de(d,u);if(r.length>0){a.push(...r);continue}let i=[],f=[];for(let p of d.per_ac??[]){let m=n.pinned?null:e.resolve(p.ac_ref),v=n.pinned?p.ac_cid&&e.hasNode(p.ac_cid)?p.ac_cid:null:m?e.tipOf(m.cid):null;if(!v||!n.pinned&&e.superseded.has(v)||e.nodeLabel.get(v)!==x.AC){a.push({code:"UNKNOWN_REF",detail:`${u}.per_ac: '${n.pinned?String(p.ac_cid):p.ac_ref}' is not a${n.pinned?"n":" live"} AC`});continue}if(!C.has(p.verdict)){a.push({code:"BAD_VERDICT",detail:`${u}.per_ac['${p.ac_ref}']: verdict '${p.verdict}'`});continue}i.push({ac_ref:e.nameOf.get(v)??v,ac_cid:v,verdict:p.verdict}),f.push(v)}s.push(ue(d,h,i,d.unresolved_acs??[])),o.push({about_cid:h,per_ac:f})}if(a.length>0)return{record:null,errors:a};let c;try{c=R(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],executions:s,...n.eventIds&&n.eventIds.length>0?{event_ids:n.eventIds}:{},source_head_moves:{}},{returnWarnings:!0,graph:e,expectPrev:e.latestHash,intent:{v:1,verb:"execution",args:A({facts:n.facts,by:n.by,eventIds:n.eventIds??null}),pins:{facts:o}},busyRetry:{deadlineMs:n.lockDeadlineMs??5e3},provenance:n.provenance})}catch(d){if(d instanceof k)return"cas";throw d}return{record:c.record,errors:null,...c.warnings?{warnings:c.warnings}:{}}}function Ye(t){let e={failed:3,broken:2,skipped:1,passed:0},n=new Map;for(let a of t)for(let s of a.verifies??[]){let o=n.get(s);(o===void 0||(e[a.status]??0)>(e[o]??0))&&n.set(s,a.status)}return[...n.entries()].map(([a,s])=>({ref:a,verdict:s}))}function Qe(t){let e=[],{store:n}=t;if(!n.exists())return{synced:0,superseded:0,skipped:"no-context",warnings:e};let a=t.by??{kind:"ai",id:"exec-sync"},s=t.lockDeadlineMs;try{Se(n,e,s)}catch(i){e.push(`sync: parked-facts replay failed (${i instanceof Error?i.message:String(i)}) \u2014 queue intact, retrying next sync`)}let o=E(n),c=[],d=0,u=new Set,l=new Set(t.members.map(i=>T(i.path)?i.path:N(t.projectDir,i.path))),h=new Map;for(let i of t.members){let f=T(i.path)?i.path:N(t.projectDir,i.path);if(!D(f)){e.push(`sync: member file missing: ${f} \u2014 skipped, no fact attached`);continue}for(let p of xe(f,e))if(!u.has(p.path))try{let m=p.path===f,v=!m&&l.has(p.path),g=m?void 0:F(I(f,"utf8"))?.id,$=I(p.path,"utf8"),y=F($);if(!y?.id){u.add(p.path);continue}let _=o.resolve(y.id),S=_?o.tipOf(_.cid):null;if(!_||!S||o.superseded.has(S)){u.add(p.path),e.push(`sync: ${y.id} does not resolve to a live test \u2014 skipped (foreign store?)`);continue}let L=B(V($,ee(q(p.path),o))),_e=String(o.getNode(S)?.content.test_md_blob??""),j=B(V(_e,Z(o))),G=o.getNode(S)?.content.definitionId,M=typeof G=="string"?G:j,w=!1,O=S;if(L===j)y.base!==M&&he(p.path,$,M,e);else if(y.base===j||y.base===M){let b=Ie(n,o,S,$,L,q(p.path),a);b.error?(e.push(`sync: could not supersede ${y.id}: ${b.error}`),w=!0):(d++,O=b.newCid,w=b.oracleTier,he(p.path,I(p.path,"utf8"),L,e),o=E(n))}else w=!0,e.push(y.base?`sync: ${y.id} was edited from an older version \u2014 graph kept; reconcile via a redesign or maintain`:`sync: ${y.id} carries no base pin (hand-copied file?) \u2014 fact attached with drift flag`);if(v){w&&h.set(p.path,!0);continue}u.add(p.path);let H=o.getNode(O)?.content.check,W=m?i.acs??[]:[],U=W.filter(b=>fe(o,b.ref)),z=W.filter(b=>!fe(o,b.ref)).map(b=>b.ref);c.push({ref:y.id,about_cid:O,definition_id_at_run:L,verdict:i.verdict,...U.length?{per_ac:U.map(b=>{let K=ge(o,b.ref);return{ac_ref:b.ref,...K?{ac_cid:K}:{},verdict:b.verdict}})}:{},drift_flag:w||h.get(p.path)===!0||m&&i.driftFlag===!0,oracle_mode:H?.expected_mode??(J(H?.operand)?"runtime-derived":"inferred"),stale_at_run:o.stale(O)!=="fresh",...z.length?{unresolved_acs:z}:{},execution_id:i.executionId,...i.evidenceId?{evidence_id:i.evidenceId}:{},...i.durationMs!==void 0?{duration_ms:i.durationMs}:{},started_at:i.startedAt,mode:i.mode,local:i.local,...g?{via_parent:g}:{}})}catch(m){p.path!==f&&l.has(p.path)||u.add(p.path),e.push(`sync: ${p.path} failed to sync (${m instanceof Error?m.message:String(m)}) \u2014 skipped; other members unaffected`)}}if(c.length===0)return{synced:0,superseded:d,warnings:e};let r;try{r=ce(n,E(n),{facts:c,by:a,eventIds:c.map(i=>`exec-fact:${i.execution_id}:${i.ref}`),lockDeadlineMs:s})}catch(i){return e.push(`sync facts: commit threw: ${i instanceof Error?i.message:String(i)}`),le(n,c,a,e,s),{synced:0,superseded:d,warnings:e}}return r.errors?(le(n,c,a,e,s),e.push(...r.errors.map(i=>`sync facts: ${i.code}: ${i.detail}`)),{synced:0,superseded:d,warnings:e}):(r.warnings&&e.push(...r.warnings.map(i=>`sync facts: ${i}`)),{synced:c.length,superseded:d,warnings:e})}function le(t,e,n,a,s){try{let o={by:n,ts:new Date().toISOString(),facts:e.map(u=>({...u,about_cid:u.about_cid??"",event_id:`exec-fact:${u.execution_id}:${u.ref}`}))},{where:c,sideFile:d}=t.parkedFacts().park(JSON.stringify(o),{deadlineMs:s??5e3});d&&a.push(`sync facts: store lock busy \u2014 parked to ${c}; it drains on the next sync`),a.push(`sync facts: commit failed \u2014 ${e.length} fact(s) parked to ${c}; they replay on the next sync`)}catch(o){a.push(`sync facts: could not park the failed batch (${o instanceof Error?o.message:String(o)}) \u2014 this run's facts are LOST`)}}function Se(t,e,n){let a=t.parkedFacts(),s=n??5e3,o=a.snapshot({deadlineMs:s});if("fenced"in o){e.push(`sync: parked facts stay queued while rebase ${o.fenced} is open \u2014 they drain on the first sync after it is finished`);return}let c=o.lines;if(c.length===0)return;let d=new Set,u=[];for(let l of c){let h=null;try{let i=JSON.parse(l);i&&Array.isArray(i.facts)&&(h=i)}catch{}if(!h){u.push({parent:l,line:l}),d.add(l);continue}let r=pe(t,h);if(r.errors){if(r.errors.some(i=>i.code==="STALE_BASIS")){e.push(`sync: parked facts replay deferred (${r.errors[0].detail}) \u2014 retrying next sync`);continue}u.push({parent:l,line:l}),d.add(l),e.push(`sync: parked facts line quarantined to ${a.quarantinePath} (${r.errors.map(i=>`${i.code}: ${i.detail}`).join("; ")})`);continue}for(let i of r.rejected){let f=h.facts.find(p=>p.event_id===i.event_id);u.push({parent:l,line:JSON.stringify({...f??{event_id:i.event_id},_reason:i.errors})})}if(r.rejected.length>0){let i=r.rejected.map(f=>f.errors.map(p=>`${p.code}: ${p.detail}`).join("; ")).join(" | ");e.push(`sync: ${r.rejected.length} parked fact(s) quarantined to ${a.quarantinePath} (${i})`)}d.add(l),r.warnings&&e.push(...r.warnings.map(i=>`sync: ${i}`)),r.applied.length>0&&e.push(`sync: replayed ${r.applied.length} parked fact(s) from a previous run`)}if(d.size!==0)try{a.settle(d,u,{deadlineMs:s})}catch(l){e.push(`sync: queue rewrite failed (${l instanceof Error?l.message:String(l)}) \u2014 already-applied lines dedupe next sync; bad lines re-quarantine then`)}}function xe(t,e){let n=[],a=new Set,s=o=>{if(a.has(o)||!D(o))return;a.add(o);let c;try{c=I(o,"utf8")}catch(d){e.push(`sync: unreadable unit ${o} (${d instanceof Error?d.message:String(d)}) \u2014 skipped`);return}for(let d of c.split(`
|
|
3
3
|
`)){let u=/^@import\s+(\S+)\s*$/.exec(d.trim());if(!u)continue;let l=T(u[1])?u[1]:N(q(o),u[1]);if(!D(l))continue;let h;try{h=I(l,"utf8")}catch(r){e.push(`sync: unreadable import ${l} (${r instanceof Error?r.message:String(r)}) \u2014 skipped; importer continues`);continue}F(h)?.id&&s(l)}n.push({path:o})};return s(t),n}function fe(t,e){return ge(t,e)!==null}function ge(t,e){let n=ae(t,e);return n!==null&&t.nodeLabel.get(n)==="ac"?n:null}function ke(t,e,n,a){let s=t.split(`
|
|
4
4
|
`),o=Q(s),c={};return{blob:s.map((u,l)=>{let h=Y.exec(u.trim());if(!h||o.has(l))return u;let r=h[1];if(a&&r in a){let v=n.tipOf(a[r]);c[r]=v;let g=n.displayNameOf(v);return g?`@import ${g}`:u}let i=n.resolve(r);if(i)return c[r]=i.tip,u;if(e===null&&!T(r))return u;let f=T(r)?r:N(e,r);if(!D(f))return u;let p=F(I(f,"utf8"))?.id,m=p?n.resolve(p):null;return!p||!m?u:(c[r]=m.tip,`@import ${p}`)}).join(`
|
|
5
5
|
`),imports:c}}function Ie(t,e,n,a,s,o,c,d={}){let u=e.getNode(n);if(!u)return{oracleTier:!1,error:"tip unreadable"};let{blob:l,imports:h}=ke(ne(a),o,e,d.imports),r=String(u.content.test_md_blob??""),i=/^#\s+(.+?)\s*$/m.exec(l)?.[1]??String(u.content.title??""),f={...u.content,test_md_blob:l,definitionId:s,title:i};{let _=we(l);_.target!==void 0?f.target=_.target:delete f.target,_.app!==void 0?f.app=_.app:delete f.app}let p=re("test",f);if(p.length>0)return{oracleTier:!1,error:p.map(_=>_.detail).join("; ")};let m=ie("test",f);if(m===n)return{newCid:n,oracleTier:!1};let v=me(r)!==me(l);if(se(e,n,m))return{oracleTier:v,error:"file content reproduces an already-superseded version (supersession cycle guard) \u2014 graph kept; re-edit forward or redesign"};let g=oe({graph:e,oldTip:n,newCid:m,newLabel:"test",by:c,reason:`re-blessed onto ${m} (edited on disk, run sync)`});if(g.errors.length>0)return{oracleTier:v,error:`edge re-bless refused: ${g.errors.join("; ")}`};let $=t.head(),y=t.serialize($);if(!t.sameToken(t.parse(e.latestHash),$)){if(d.throwTransient)throw new k(`store advanced under the sync (basis ${String(e.latestHash)} vs head ${String(y)})`);return{oracleTier:v,error:`store advanced under the sync (basis ${String(e.latestHash)} vs head ${String(y)}) \u2014 re-run to retry`}}try{R(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[{cid:m,label:"test",content:f}],edges:g.edges,review:[{id:m,kind:"review-item",resolution:"edited",edit:null,reason:"edited on disk (run sync)",by:c}],supersessions:[{kind:"node",old:n,new:m,reason:"edited on disk (run sync)",by:c},...g.supersessions],source_head_moves:{}},{graph:e,expectPrev:y,intent:{v:1,verb:"exec-supersede",args:A({tip:n,raw:a,fileId:s,by:c}),pins:{tip:n,imports:h}},provenance:d.provenance})}catch(_){if(d.throwTransient&&_ instanceof k)throw _;return{oracleTier:v,error:_ instanceof Error?_.message:String(_)}}return{newCid:m,oracleTier:v}}function we(t){let e=X(t);return{...typeof e.target=="string"?{target:e.target}:{},...typeof e.app=="string"?{app:e.app}:{}}}function me(t){let e=[],n=t.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as j}from"./chunk-
|
|
2
|
+
import{a as j}from"./chunk-MUX2A37P.js";import{b as g,d as C,e as q,f as I}from"./chunk-W5HFUBXD.js";import{a as V}from"./chunk-EZMRWXRT.js";import{B as k,F as S,M as R,ea as h,fa as P,v as b}from"./chunk-PI7OXS62.js";import{o as v}from"./chunk-HYJVYYAZ.js";function M(t,e,s,p=g()){return{store:t,rootSid:e,locks:t.locks(e),probe:s??j(t,{...p.calls(()=>({})),readVector:(i,u,n)=>C(t,i,u,n),writeVector:(i,u,n,r)=>q(t,i,u,n,r),prefetchVectors:(i,u,n)=>I(t,i,u,n)})}}var O=new WeakMap;function B(t){let e=O.get(t);return e||O.set(t,e=g()),e}var Y=new Set(["archive"]);async function U(t,e,s,p){let i=R(t.store);if(s.v==="defer")return{outcome:"deferred"};if(e.kind==="MODIFY_HELD"){if(!e.heldPayload)return{outcome:"failed",detail:`${e.ref} carries no held payload`};let r=e.heldPayload;if(s.v==="keep_current"){if(!r.event_id)return{outcome:"failed",detail:v().text("note.held_no_event_id",{sid:r.sid})};let{commitChatTurn:o}=await import("./chat-committer-ZKEKJA2R.js"),m=o({store:t.store,graph:i,ops:[{kind:"resolve_question",questionId:`drop-held:${r.sid}:${r.tempRef}`,resolution:"deferred",eventId:r.event_id}],by:p});return m.errors?{outcome:"failed",detail:m.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"held-dropped"}),{outcome:"committed",detail:"held payload dropped (recorded) \u2014 the owner's resume will not re-present it"})}if(s.v==="approve"){let o=r.content._held??null;if(!o?.source_id||!o.source_cid||!o.anchor||!o.quote)return{outcome:"failed",detail:v().text("note.held_no_provenance",{sid:r.sid})};{let a=i.mediaOf(o.source_cid),f=b(t.store,i,o.source_cid),w=a.format==="image"?null:f?k(f):null;if(a.format!=="image"&&w===null)return{outcome:"failed",detail:v().text("note.held_no_citable_text",{sid:r.sid,source_id:o.source_id,source_cid:o.source_cid})};let $=S(a,{anchor:o.anchor,quote:o.quote},w);if($.length>0)return{outcome:"failed",detail:v().text("note.held_unverified",{sid:r.sid,errors:$.map(y=>`${y.code}: ${y.detail}`).join("; ")})}}let{commitProposal:m}=await import("./committer-UO3B3S5Y.js"),{_held:d,...c}=r.content,D={version:1,read_basis:i.latestHash,source:{source_id:o.source_id,source_cid:o.source_cid},use_cases:[{temp_ref:r.tempRef,title:String(c.title??r.tempRef),...c.summary!==void 0?{summary:c.summary}:{},risk:String(c.risk??"med"),cite:{anchor:o.anchor,quote:o.quote},depends_on_hint:[],matches_existing:null}]},l=await V(M(t.store,t.rootSid??`review-${process.pid}`,void 0,B(t)),{verb:"maintain",ucTargets:[],newBuCandidates:[{tempRef:r.tempRef,title:String(c.title??r.tempRef),probeText:`${String(c.title??"")} ${String(c.summary??"")}`.trim()}],sourcePins:[{source_id:o.source_id,source_cid:o.source_cid}],readBasis:i.latestHash,...r.event_id?{eventIds:[r.event_id]}:{}},a=>{let f=m({store:t.store,graph:a.graph,scope:a.scope,proposal:D,proposalId:null,verdicts:new Map([[r.tempRef,{resolution:"skipped"}]]),by:p,autoName:!0,allowStaleBasis:!0,eventIds:r.event_id?[r.event_id]:a.eventIds("maintain",1),sid:a.sid,probeHits:a.probeHits});return f.errors!==null?{errors:f.errors}:{result:f,record:f.record}}),_=l.ok&&"result"in l?l.result:{record:null,errors:l.ok?null:l.kind==="validation"?l.errors:[{code:l.kind==="contended"?l.err.code:"UNSETTLED",detail:l.kind==="contended"?`held by ${l.err.holder?.owner_sid??"another session"}`:"concurrent activity kept moving the store"}]};return _.errors?{outcome:"failed",detail:_.errors.map(a=>`${a.code}: ${a.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"held-applied"}),{outcome:"committed",detail:`held payload committed (derived) by ${p.id}`})}return{outcome:"failed",detail:`verdict ${s.v} does not apply to a MODIFY_HELD card`}}let u=i.resolve(e.ref);if(!u)return{outcome:"failed",detail:`${e.ref} names nothing in the graph`};let n=i.tipOf(u.cid);if(s.v==="archive"){if(!s.because||!s.because.trim())return{outcome:"failed",detail:"archive requires --because (a reason the record keeps)"};let r=h({store:t.store,graph:i,verdicts:new Map([[n,{resolution:"rejected",reason:s.because}]]),by:p});return r.errors?{outcome:"failed",detail:r.errors.map(o=>`${o.code}: ${o.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"archived",reason:s.because}),{outcome:"retired"})}if(s.v==="approve"){let r=h({store:t.store,graph:i,verdicts:new Map([[n,{resolution:"approved"}]]),by:p});return r.errors?{outcome:"failed",detail:r.errors.map(o=>`${o.code}: ${o.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"approved"}),{outcome:"applied"})}if(s.v==="merge"||s.v==="keep_both"){if(e.kind!=="PAIR"||!e.pair)return{outcome:"failed",detail:`${e.ref} is not a PAIR card`};let r=i.resolve(e.pair.candidate_cid);if(!r)return{outcome:"failed",detail:`pair candidate ${e.pair.candidate_ref} names nothing`};let o=i.tipOf(r.cid);if(s.v==="merge"){let d=P({store:t.store,graph:i,survivor:o,merged:n,reason:`pair merge: duplicate of ${e.pair.candidate_ref} (score ${e.pair.score})`,by:p});return d.errors?{outcome:"failed",detail:d.errors.map(c=>`${c.code}: ${c.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"pair-merged",reason:e.pair.candidate_ref}),{outcome:"committed",detail:`merged into ${e.pair.candidate_ref} \u2014 survivor stays derived`})}let m=h({store:t.store,graph:i,verdicts:new Map([[n,{resolution:"approved"}],[o,{resolution:"approved"}]]),by:p});return m.errors?{outcome:"failed",detail:m.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")}:(t.signals?.({ref:e.ref,verdict:"pair-kept-both",reason:e.pair.candidate_ref}),{outcome:"applied",detail:"both promoted as distinct"})}return{outcome:"failed",detail:`verdict ${s.v} does not apply to a ${e.kind} card`}}export{M as a,B as b,Y as c,U as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as K}from"./chunk-436FZ4KG.js";import{b as U}from"./chunk-KRRZCY7U.js";import{b as W}from"./chunk-ZGQM6KWN.js";import{a as S}from"./chunk-3QICDXY5.js";import{$,Aa as v,I as C,K as _,L as b,N as E,O as P,Q as p,U as h,Y as f,Z as F,a as j,aa as O,ba as N,ca as A,da as M,ka as y,ma as D,pa as c,qa as I,sa as L,wa as T}from"./chunk-TLOYTGVT.js";import{oa as R}from"./chunk-Z777GGHB.js";import{a as g}from"./chunk-FOJHSG5M.js";var G={history:"project",search:"project_ready",session:"project_ready"},B={useCases:"use_cases",criteria:"acceptance_criteria",scenarios:"scenarios",tests:"tests",openQuestions:"open_questions",sources:"sources",styleNotes:"style_notes"},V=(e,t)=>t===null||t<=0?null:Math.min(100,Math.floor(e*100/t)),Y=e=>e.startsWith("design-")||e.startsWith("evolve-")?"design":"extract",q=e=>({cmd:`kane-cli context sessions save ${e} --yes --mode agent`,why:"save it to the project"});function de(e,t=Date.now(),s={}){switch(e.kind){case"connect":return e.step==="service"?{type:"remote_connect",step:"connect"}:{type:"remote_connect",step:"open_session",...e.sid!==void 0?{sid:e.sid}:{},...e.project!==void 0?{project:e.project}:{}};case"load":return{type:"remote_load",part:G[e.part],percent:V(e.done,e.total)};case"write":return null;case"retry":return{type:"remote_retry",attempt:e.attempt,next_in_s:e.nextInS,give_up_in_s:Math.max(0,Math.round((Date.parse(e.giveUpAt)-t)/1e3)),cause:e.cause};case"upload":return{type:"remote_upload",file:e.file,percent:V(e.sentBytes,e.totalBytes)};case"reading":return null;case"fetching":return{type:"remote_fetch",ref:e.ref,provider:e.provider};case"paused":{if(e.reason==="ctrl_c")return null;let n=S.command("next.resume_session",{verb:Y(e.sid),sid:e.sid,mode:"agent"});return{type:"session_paused",sid:e.sid,...s.sourceId?{source_id:s.sourceId}:{},...s.mode?{mode:s.mode}:{},reason:e.reason,resume:n,expires_at:null,pending_questions:[],...(e.reason==="connection_lost"||e.reason==="not_accepted")&&n!==null?{next:[{cmd:n,why:"resume"}]}:{}}}case"save":{let n=a=>Object.fromEntries(Object.entries(a).flatMap(([l,d])=>l in B&&typeof d=="number"?[[B[l],d]]:[])),r=e.counts?n(e.counts):void 0,o=e.heldChanges??(e.counts?F(e.counts):0),i=Object.fromEntries(f.flatMap(a=>{let l=e[a]??e.counts?.[a],d=l?n(l):{};return Object.values(d).some(x=>x>0)?[[a,d]]:[]}));return{type:"session_save",phase:e.phase,sid:e.sid,...e.project!==void 0?{project:e.project}:{},...r!==void 0?{adds:r}:{},...e.notUpdated!==void 0&&e.notUpdated.length>0?{not_updated:e.notUpdated}:{},...i,...o>0?{held_changes:o}:{},...e.replaces?{replaces:n(e.replaces)}:{},...e.keeps?{marks_up_to_date:{tests:e.keeps}}:{},...(e.uncounted??e.counts?.uncounted??0)>0?{other_work:!0}:{},...e.landed!==void 0?{saved:e.landed}:{},...(()=>{let a=L(e.testManager,e.sid,e.sessionUseCases?new Set(e.sessionUseCases):void 0,I(e.testFiles));return a?{test_manager:a}:{}})(),...e.testFiles!==void 0?{test_files:T(e.testFiles,e.sid,{testManager:e.testManager})}:{},...e.reason!==void 0?{reason:e.reason}:{},...e.code!==void 0?{code:e.code}:{},...e.stillStale?{next:[{cmd:"kane-cli maintain evolve --from-stale --mode agent",why:"update the use-cases still out of date"}]}:{}}}case"overlap":return{type:"remote_overlap",sessions:e.sessions.map(n=>({sid:n.sid,owner:n.owner,state:n.state,added:n.added,...n.owner!=="someone_else"&&n.state==="paused"?{next:[{cmd:c(n.verb==="design"||n.verb==="evolve"?"design":"extract",n.sid,!0),why:"goes on with that session where it stopped"}]}:{}}))};case"ended":return{type:"session_ended",sid:e.sid,reason:e.reason};case"not_ended":{let n=S.command("next.resume_session",{verb:Y(e.sid),sid:e.sid,mode:"agent"});return{type:"error",code:"SESSION_NOT_ENDED",message:`${v(e.project)} didn't take this session's last step; the work is safe in the session`,...n!==null?{next:[{cmd:n,why:"ends the session, so it can be saved"}]}:{}}}case"finished_before":return{type:"session_complete",sid:e.sid,...s.sourceId?{source_id:s.sourceId}:{},next:[q(e.sid)]}}}function ce(e,t,s={}){return{type:"session_complete",sid:e,...s.sourceId?{source_id:s.sourceId}:{},...s.noStartPage?.length?{no_start_page:s.noStartPage}:{},...t?{next:[q(e),{cmd:`kane-cli context sessions discard ${e} --yes --mode agent`,why:"throw away what this session added"}]}:{}}}var J=e=>e.notUpdated?[`not updated: ${e.notUpdated}`]:[],k={connection_lost:"lost connection",computer_slept:"this computer slept for over 2 minutes",resumed_elsewhere:"resumed in another terminal",not_accepted:"something couldn't be added to this session",ctrl_c:"ctrl+c",model_unavailable:"the model service did not answer",unexpected:"stopped unexpectedly"},w=e=>e.added===0?[]:[e.verb==="extract"?`${e.added} use-case${e.added===1?"":"s"} added, not saved yet`:`${e.added} added, not saved yet`],u=e=>e.credits?[e.credits]:[],m=e=>e.tracePath?{tracePath:e.tracePath}:{};function pe(e){let t=c(e.verb,e.sid,!1),s=e.reason==="resumed_elsewhere"?["this session goes on in the other terminal; your work is safe",...w(e),"to bring it back here, resume it (the other terminal then stops)",...u(e)]:["your work is safe \u2014 resume it from any machine",...w(e),...u(e)];return{state:"paused",reason:k[e.reason],facts:s,resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}function he(e,t){if(e)return{kind:"ingest",refs:e};let s=[...new Set((t?.uploads??[]).filter(r=>r.outcome==="created"&&!r.filename).map(r=>r.sourceId))],n=t?D(t):[];return n.length+s.length>0?{kind:"resumed",files:n,unnamed:s}:{kind:"extract"}}var H=e=>`discard: kane-cli context sessions discard ${e}`;function fe(e){let t=e.again,s=t.kind==="extract"?[H(e.sid),"then start again: kane-cli context extract"]:["start again with the same sources:",...t.kind==="ingest"?[` ${y(t.refs)}`]:t.files.length>0?[` ${y(t.files)}`]:[],...t.kind==="resumed"?t.unnamed.map(n=>` ${g.dim(`${t.files.length>0?"and ":""}the source "${n}", added again by its address`)}`):[],H(e.sid)];return{state:"paused",reason:e.reason==="held_back"?"the duplicate check couldn't run fully":k[e.reason],facts:[`this session read ${e.sources} sources, so it can't be resumed or saved`,...e.added>0?[`its ${e.added} use-case${e.added===1?"":"s"} won't reach the project`]:[],...s,...u(e)],...m(e)}}function ye(e,t){let s={cmd:`kane-cli context sessions discard ${e} --yes --mode agent`,why:"throw away this session"};if(t.kind==="extract")return{next:[s,{cmd:"kane-cli context extract --mode agent",why:"start again"}]};let n=t.kind==="ingest"?t.refs:t.files;return{next:[...n.length>0?[{cmd:`${y(n)} --mode agent`,why:"start again"}]:[],s],...t.kind==="resumed"&&t.unnamed.length>0?{not_named:[...t.unnamed]}:{}}}var ve=e=>e.filter(t=>t.kind==="header"&&t.source!==void 0).length;function xe(e){let t=c(e.verb,e.sid,!1);return{state:"paused",reason:"the duplicate check couldn't run fully",facts:[e.added>0?"what was added is safe \u2014 resume it from any machine":"nothing was added yet \u2014 resume it from any machine",...w(e),`${e.held} use-case${e.held===1?"":"s"} held back, not added`,...u(e)],resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}var X=e=>e.verb==="evolve"&&e.replaces?`designing its ${e.replaces===1?"test":`${e.replaces} tests`} again didn't finish`:"designing its tests didn't finish";function Se(e){let t=c("extract",e.sid,!1),s=a=>a===1?"1 change":`${a} changes`,n=[...(e.replaced?.scenarios??0)>0?[e.replaced.scenarios===1?"1 scenario":`${e.replaced.scenarios} scenarios`]:[],...(e.replaced?.tests??0)>0?[e.replaced.tests===1?"1 test":`${e.replaced.tests} tests`]:[]],r=n.length>0?`, ${n.join(" and ")} replaced`:"",o=[e.decided>0?"what you decided is safe \u2014 resume it from any machine":"nothing was decided yet \u2014 resume it from any machine",...e.approved>0?[`${s(e.approved)} approved${r}, not saved yet`]:[],...e.unfinished?[X(e.unfinished)]:[],...e.left>0?[`${s(e.left)} not reviewed yet`]:[],...u(e)];return{state:"paused",reason:e.unfinished||e.left===0?k[e.why??"ctrl_c"]:`${s(e.left)} from ${W(e.source)} ${e.left===1?"isn't":"aren't"} reviewed yet`,facts:o,resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}function _e(e){let[t,...s]=e.how==="saved"?["saved from another terminal",`saved to "${e.projectName}" from another terminal`]:e.how==="discarded"?["discarded from another terminal",`discarded from another terminal \u2014 nothing was saved to "${e.projectName}"`]:["ended in another terminal","this session ended in another terminal, so it stops here","to see your sessions, run: kane-cli context sessions"];return{state:"complete",reason:t,facts:[...s,...u(e)],...m(e)}}function Q(e){let t=[e.adds,e.heldChanges?A(e.heldChanges):""].filter(Boolean);return t.length>0?C(t):$({...e,adds:e.adds})?h:p}function be(e,t){let n=`${e===h||e===p||e.startsWith("1 ")&&!e.includes(", ")&&!e.includes(" and ")?"it's":"they're"} thrown away`;return t===void 0?`${n}, and this can't be undone`:`${n}; nothing reaches "${t}", and this can't be undone`}function $e(e){let{heldChanges:t,chatTurns:s,uncounted:n}=e;return{heldChanges:t,chatTurns:s,uncounted:n,...Object.fromEntries(f.map(r=>[r,e[r]])),...e.replaces?{replaces:e.replaces}:{},...e.keeps?{keeps:e.keeps}:{}}}function we(e){return{state:"complete",reason:"not saved yet",facts:[`not saved yet: ${e.changed??Q(e)}`,...e.changed?[]:b(e),...J(e),...e.needed??[],"kept as it is until you save or discard it",`save: kane-cli context sessions save ${e.sid}`,`discard: kane-cli context sessions discard ${e.sid}`,...u(e)],...m(e)}}function ke(e){return{state:"complete",reason:"not saved yet",facts:[`not saved yet: ${Q(e)}`,...b(e),`${v(e.projectName)} didn't take this session's last step; your work is safe`,`save: ${c(e.verb,e.sid,!1)}`,...u(e)],...m(e)}}var z=(e,t)=>e||($({...t,adds:e})?h:O({...t,adds:e})?p:"");function Re(e){let t=z(e.adds,e);return{state:"complete",reason:"saved",facts:[`saved to "${e.projectName}"${t?`: ${t}`:""}`,..._(e),...e.heldChanges?[M(e.heldChanges)]:[],...J(e),...e.testManager?[e.testManager]:[],...e.testManagerNextRun?[e.testManagerNextRun]:[],...e.testFiles?[e.testFiles]:[],...e.testFilesKept?[e.testFilesKept]:[],...e.testFilesReplaced?[e.testFilesReplaced]:[],...e.testFilesNeeded??[],...u(e)],...m(e)}}var je=e=>_(e);function Ce(e,t,s={}){let n=z(t,s);return`\u2714 saved to "${e}"${n?` \u2014 ${n}`:""}`}function Ee(e,t){return e?.facts.find(s=>s.startsWith("credits used:"))??(t?`credits used: ${t.total.toFixed(1)}`:null)}var Z=4;function ee(e,t){let s=e.map(r=>({sid:r.sessionId,verb:r.verb,subject:r.useCase??r.sourceId,title:(r.useCase?r.useCaseTitle:r.sourceTitle)??null,state:j(r),added:null,last_activity_at:r.lastActivityAt??r.createdAt,owner:K(r,t)})),n=r=>Date.parse(r.last_activity_at??"")||0;return s.sort((r,o)=>+(o.owner==="you")-+(r.owner==="you")||n(o)-n(r))}var te={reconcile:"review"},se={ready_to_save:"ready to save",paused:"paused",running:"running",saved:"saved",discarded:"discarded",failed:"ended with an error"};function ne(e,t){let s=Date.parse(e??"");if(Number.isNaN(s))return"";let n=Math.floor((t-s)/6e4);if(n<1)return"just now";if(n<60)return`${n} min ago`;let r=new Date(s),o=a=>a.toDateString(),i=`${String(r.getHours()).padStart(2,"0")}:${String(r.getMinutes()).padStart(2,"0")}`;return o(r)===o(new Date(t))?`${Math.floor(n/60)} h ago`:o(r)===o(new Date(t-864e5))?`yesterday ${i}`:`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")} ${i}`}function re(e,t){return e.length===0?["no open sessions"]:e.flatMap(s=>{let n=s.title?`"${s.title}"`:s.subject&&R(s.subject),r=[...s.added?[`${s.added} added`]:[],...s.updated?[`${s.updated} updated`]:[]],o=[te[s.verb]??s.verb,...n?[n]:[],se[s.state],...r,ne(s.last_activity_at,t),...s.owner==="someone_else"?["someone else"]:[]],i=`${s.sid} ${o.filter(Boolean).join(" \xB7 ")}`;return s.owner==="someone_else"?[i]:s.state==="ready_to_save"?[i,g.dim(` save: kane-cli context sessions save ${s.sid}`)]:s.state==="paused"?[i,g.dim(` resume: ${c(s.verb==="design"||s.verb==="evolve"?"design":"extract",s.sid,!1)}`)]:[i]})}async function Ie(e){let t=await e.person.listSessions(e.projectId),s=await ae(e.person,e.projectId,ee(t,e.me).filter(n=>n.state!=="saved"&&n.state!=="discarded"),e.log??(()=>{}));return e.out(e.json?JSON.stringify(s)+`
|
|
2
|
+
import{c as K}from"./chunk-JBKHX5ES.js";import{b as U}from"./chunk-TAY7J5VS.js";import{b as W}from"./chunk-LRNUGKYH.js";import{a as S}from"./chunk-LZPYIFHZ.js";import{$,Aa as v,I as C,K as _,L as b,N as E,O as P,Q as p,U as h,Y as f,Z as F,a as j,aa as O,ba as N,ca as A,da as M,ka as y,ma as D,pa as c,qa as I,sa as L,wa as T}from"./chunk-WE7HRAGO.js";import{oa as R}from"./chunk-PI7OXS62.js";import{a as g}from"./chunk-FOJHSG5M.js";var G={history:"project",search:"project_ready",session:"project_ready"},B={useCases:"use_cases",criteria:"acceptance_criteria",scenarios:"scenarios",tests:"tests",openQuestions:"open_questions",sources:"sources",styleNotes:"style_notes"},V=(e,t)=>t===null||t<=0?null:Math.min(100,Math.floor(e*100/t)),Y=e=>e.startsWith("design-")||e.startsWith("evolve-")?"design":"extract",q=e=>({cmd:`kane-cli context sessions save ${e} --yes --mode agent`,why:"save it to the project"});function de(e,t=Date.now(),s={}){switch(e.kind){case"connect":return e.step==="service"?{type:"remote_connect",step:"connect"}:{type:"remote_connect",step:"open_session",...e.sid!==void 0?{sid:e.sid}:{},...e.project!==void 0?{project:e.project}:{}};case"load":return{type:"remote_load",part:G[e.part],percent:V(e.done,e.total)};case"write":return null;case"retry":return{type:"remote_retry",attempt:e.attempt,next_in_s:e.nextInS,give_up_in_s:Math.max(0,Math.round((Date.parse(e.giveUpAt)-t)/1e3)),cause:e.cause};case"upload":return{type:"remote_upload",file:e.file,percent:V(e.sentBytes,e.totalBytes)};case"reading":return null;case"fetching":return{type:"remote_fetch",ref:e.ref,provider:e.provider};case"paused":{if(e.reason==="ctrl_c")return null;let n=S.command("next.resume_session",{verb:Y(e.sid),sid:e.sid,mode:"agent"});return{type:"session_paused",sid:e.sid,...s.sourceId?{source_id:s.sourceId}:{},...s.mode?{mode:s.mode}:{},reason:e.reason,resume:n,expires_at:null,pending_questions:[],...(e.reason==="connection_lost"||e.reason==="not_accepted")&&n!==null?{next:[{cmd:n,why:"resume"}]}:{}}}case"save":{let n=a=>Object.fromEntries(Object.entries(a).flatMap(([l,d])=>l in B&&typeof d=="number"?[[B[l],d]]:[])),r=e.counts?n(e.counts):void 0,o=e.heldChanges??(e.counts?F(e.counts):0),i=Object.fromEntries(f.flatMap(a=>{let l=e[a]??e.counts?.[a],d=l?n(l):{};return Object.values(d).some(x=>x>0)?[[a,d]]:[]}));return{type:"session_save",phase:e.phase,sid:e.sid,...e.project!==void 0?{project:e.project}:{},...r!==void 0?{adds:r}:{},...e.notUpdated!==void 0&&e.notUpdated.length>0?{not_updated:e.notUpdated}:{},...i,...o>0?{held_changes:o}:{},...e.replaces?{replaces:n(e.replaces)}:{},...e.keeps?{marks_up_to_date:{tests:e.keeps}}:{},...(e.uncounted??e.counts?.uncounted??0)>0?{other_work:!0}:{},...e.landed!==void 0?{saved:e.landed}:{},...(()=>{let a=L(e.testManager,e.sid,e.sessionUseCases?new Set(e.sessionUseCases):void 0,I(e.testFiles));return a?{test_manager:a}:{}})(),...e.testFiles!==void 0?{test_files:T(e.testFiles,e.sid,{testManager:e.testManager})}:{},...e.reason!==void 0?{reason:e.reason}:{},...e.code!==void 0?{code:e.code}:{},...e.stillStale?{next:[{cmd:"kane-cli maintain evolve --from-stale --mode agent",why:"update the use-cases still out of date"}]}:{}}}case"overlap":return{type:"remote_overlap",sessions:e.sessions.map(n=>({sid:n.sid,owner:n.owner,state:n.state,added:n.added,...n.owner!=="someone_else"&&n.state==="paused"?{next:[{cmd:c(n.verb==="design"||n.verb==="evolve"?"design":"extract",n.sid,!0),why:"goes on with that session where it stopped"}]}:{}}))};case"ended":return{type:"session_ended",sid:e.sid,reason:e.reason};case"not_ended":{let n=S.command("next.resume_session",{verb:Y(e.sid),sid:e.sid,mode:"agent"});return{type:"error",code:"SESSION_NOT_ENDED",message:`${v(e.project)} didn't take this session's last step; the work is safe in the session`,...n!==null?{next:[{cmd:n,why:"ends the session, so it can be saved"}]}:{}}}case"finished_before":return{type:"session_complete",sid:e.sid,...s.sourceId?{source_id:s.sourceId}:{},next:[q(e.sid)]}}}function ce(e,t,s={}){return{type:"session_complete",sid:e,...s.sourceId?{source_id:s.sourceId}:{},...s.noStartPage?.length?{no_start_page:s.noStartPage}:{},...t?{next:[q(e),{cmd:`kane-cli context sessions discard ${e} --yes --mode agent`,why:"throw away what this session added"}]}:{}}}var J=e=>e.notUpdated?[`not updated: ${e.notUpdated}`]:[],k={connection_lost:"lost connection",computer_slept:"this computer slept for over 2 minutes",resumed_elsewhere:"resumed in another terminal",not_accepted:"something couldn't be added to this session",ctrl_c:"ctrl+c",model_unavailable:"the model service did not answer",unexpected:"stopped unexpectedly"},w=e=>e.added===0?[]:[e.verb==="extract"?`${e.added} use-case${e.added===1?"":"s"} added, not saved yet`:`${e.added} added, not saved yet`],u=e=>e.credits?[e.credits]:[],m=e=>e.tracePath?{tracePath:e.tracePath}:{};function pe(e){let t=c(e.verb,e.sid,!1),s=e.reason==="resumed_elsewhere"?["this session goes on in the other terminal; your work is safe",...w(e),"to bring it back here, resume it (the other terminal then stops)",...u(e)]:["your work is safe \u2014 resume it from any machine",...w(e),...u(e)];return{state:"paused",reason:k[e.reason],facts:s,resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}function he(e,t){if(e)return{kind:"ingest",refs:e};let s=[...new Set((t?.uploads??[]).filter(r=>r.outcome==="created"&&!r.filename).map(r=>r.sourceId))],n=t?D(t):[];return n.length+s.length>0?{kind:"resumed",files:n,unnamed:s}:{kind:"extract"}}var H=e=>`discard: kane-cli context sessions discard ${e}`;function fe(e){let t=e.again,s=t.kind==="extract"?[H(e.sid),"then start again: kane-cli context extract"]:["start again with the same sources:",...t.kind==="ingest"?[` ${y(t.refs)}`]:t.files.length>0?[` ${y(t.files)}`]:[],...t.kind==="resumed"?t.unnamed.map(n=>` ${g.dim(`${t.files.length>0?"and ":""}the source "${n}", added again by its address`)}`):[],H(e.sid)];return{state:"paused",reason:e.reason==="held_back"?"the duplicate check couldn't run fully":k[e.reason],facts:[`this session read ${e.sources} sources, so it can't be resumed or saved`,...e.added>0?[`its ${e.added} use-case${e.added===1?"":"s"} won't reach the project`]:[],...s,...u(e)],...m(e)}}function ye(e,t){let s={cmd:`kane-cli context sessions discard ${e} --yes --mode agent`,why:"throw away this session"};if(t.kind==="extract")return{next:[s,{cmd:"kane-cli context extract --mode agent",why:"start again"}]};let n=t.kind==="ingest"?t.refs:t.files;return{next:[...n.length>0?[{cmd:`${y(n)} --mode agent`,why:"start again"}]:[],s],...t.kind==="resumed"&&t.unnamed.length>0?{not_named:[...t.unnamed]}:{}}}var ve=e=>e.filter(t=>t.kind==="header"&&t.source!==void 0).length;function xe(e){let t=c(e.verb,e.sid,!1);return{state:"paused",reason:"the duplicate check couldn't run fully",facts:[e.added>0?"what was added is safe \u2014 resume it from any machine":"nothing was added yet \u2014 resume it from any machine",...w(e),`${e.held} use-case${e.held===1?"":"s"} held back, not added`,...u(e)],resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}var X=e=>e.verb==="evolve"&&e.replaces?`designing its ${e.replaces===1?"test":`${e.replaces} tests`} again didn't finish`:"designing its tests didn't finish";function Se(e){let t=c("extract",e.sid,!1),s=a=>a===1?"1 change":`${a} changes`,n=[...(e.replaced?.scenarios??0)>0?[e.replaced.scenarios===1?"1 scenario":`${e.replaced.scenarios} scenarios`]:[],...(e.replaced?.tests??0)>0?[e.replaced.tests===1?"1 test":`${e.replaced.tests} tests`]:[]],r=n.length>0?`, ${n.join(" and ")} replaced`:"",o=[e.decided>0?"what you decided is safe \u2014 resume it from any machine":"nothing was decided yet \u2014 resume it from any machine",...e.approved>0?[`${s(e.approved)} approved${r}, not saved yet`]:[],...e.unfinished?[X(e.unfinished)]:[],...e.left>0?[`${s(e.left)} not reviewed yet`]:[],...u(e)];return{state:"paused",reason:e.unfinished||e.left===0?k[e.why??"ctrl_c"]:`${s(e.left)} from ${W(e.source)} ${e.left===1?"isn't":"aren't"} reviewed yet`,facts:o,resume:t,resumeMessage:`${t} --message "<your words>"`,...m(e)}}function _e(e){let[t,...s]=e.how==="saved"?["saved from another terminal",`saved to "${e.projectName}" from another terminal`]:e.how==="discarded"?["discarded from another terminal",`discarded from another terminal \u2014 nothing was saved to "${e.projectName}"`]:["ended in another terminal","this session ended in another terminal, so it stops here","to see your sessions, run: kane-cli context sessions"];return{state:"complete",reason:t,facts:[...s,...u(e)],...m(e)}}function Q(e){let t=[e.adds,e.heldChanges?A(e.heldChanges):""].filter(Boolean);return t.length>0?C(t):$({...e,adds:e.adds})?h:p}function be(e,t){let n=`${e===h||e===p||e.startsWith("1 ")&&!e.includes(", ")&&!e.includes(" and ")?"it's":"they're"} thrown away`;return t===void 0?`${n}, and this can't be undone`:`${n}; nothing reaches "${t}", and this can't be undone`}function $e(e){let{heldChanges:t,chatTurns:s,uncounted:n}=e;return{heldChanges:t,chatTurns:s,uncounted:n,...Object.fromEntries(f.map(r=>[r,e[r]])),...e.replaces?{replaces:e.replaces}:{},...e.keeps?{keeps:e.keeps}:{}}}function we(e){return{state:"complete",reason:"not saved yet",facts:[`not saved yet: ${e.changed??Q(e)}`,...e.changed?[]:b(e),...J(e),...e.needed??[],"kept as it is until you save or discard it",`save: kane-cli context sessions save ${e.sid}`,`discard: kane-cli context sessions discard ${e.sid}`,...u(e)],...m(e)}}function ke(e){return{state:"complete",reason:"not saved yet",facts:[`not saved yet: ${Q(e)}`,...b(e),`${v(e.projectName)} didn't take this session's last step; your work is safe`,`save: ${c(e.verb,e.sid,!1)}`,...u(e)],...m(e)}}var z=(e,t)=>e||($({...t,adds:e})?h:O({...t,adds:e})?p:"");function Re(e){let t=z(e.adds,e);return{state:"complete",reason:"saved",facts:[`saved to "${e.projectName}"${t?`: ${t}`:""}`,..._(e),...e.heldChanges?[M(e.heldChanges)]:[],...J(e),...e.testManager?[e.testManager]:[],...e.testManagerNextRun?[e.testManagerNextRun]:[],...e.testFiles?[e.testFiles]:[],...e.testFilesKept?[e.testFilesKept]:[],...e.testFilesReplaced?[e.testFilesReplaced]:[],...e.testFilesNeeded??[],...u(e)],...m(e)}}var je=e=>_(e);function Ce(e,t,s={}){let n=z(t,s);return`\u2714 saved to "${e}"${n?` \u2014 ${n}`:""}`}function Ee(e,t){return e?.facts.find(s=>s.startsWith("credits used:"))??(t?`credits used: ${t.total.toFixed(1)}`:null)}var Z=4;function ee(e,t){let s=e.map(r=>({sid:r.sessionId,verb:r.verb,subject:r.useCase??r.sourceId,title:(r.useCase?r.useCaseTitle:r.sourceTitle)??null,state:j(r),added:null,last_activity_at:r.lastActivityAt??r.createdAt,owner:K(r,t)})),n=r=>Date.parse(r.last_activity_at??"")||0;return s.sort((r,o)=>+(o.owner==="you")-+(r.owner==="you")||n(o)-n(r))}var te={reconcile:"review"},se={ready_to_save:"ready to save",paused:"paused",running:"running",saved:"saved",discarded:"discarded",failed:"ended with an error"};function ne(e,t){let s=Date.parse(e??"");if(Number.isNaN(s))return"";let n=Math.floor((t-s)/6e4);if(n<1)return"just now";if(n<60)return`${n} min ago`;let r=new Date(s),o=a=>a.toDateString(),i=`${String(r.getHours()).padStart(2,"0")}:${String(r.getMinutes()).padStart(2,"0")}`;return o(r)===o(new Date(t))?`${Math.floor(n/60)} h ago`:o(r)===o(new Date(t-864e5))?`yesterday ${i}`:`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")} ${i}`}function re(e,t){return e.length===0?["no open sessions"]:e.flatMap(s=>{let n=s.title?`"${s.title}"`:s.subject&&R(s.subject),r=[...s.added?[`${s.added} added`]:[],...s.updated?[`${s.updated} updated`]:[]],o=[te[s.verb]??s.verb,...n?[n]:[],se[s.state],...r,ne(s.last_activity_at,t),...s.owner==="someone_else"?["someone else"]:[]],i=`${s.sid} ${o.filter(Boolean).join(" \xB7 ")}`;return s.owner==="someone_else"?[i]:s.state==="ready_to_save"?[i,g.dim(` save: kane-cli context sessions save ${s.sid}`)]:s.state==="paused"?[i,g.dim(` resume: ${c(s.verb==="design"||s.verb==="evolve"?"design":"extract",s.sid,!1)}`)]:[i]})}async function Ie(e){let t=await e.person.listSessions(e.projectId),s=await ae(e.person,e.projectId,ee(t,e.me).filter(n=>n.state!=="saved"&&n.state!=="discarded"),e.log??(()=>{}));return e.out(e.json?JSON.stringify(s)+`
|
|
3
3
|
`:re(s,Date.now()).join(`
|
|
4
4
|
`)+`
|
|
5
5
|
`),0}async function ae(e,t,s,n){let r=s.map(a=>({...a})),o=0,i=async()=>{for(let a=o++;a<r.length;a=o++){let l=r[a].sid,d=await N(e,t,l).catch(x=>(n(`${l}'s count couldn't be read: ${U(x)}`),null));r[a].added=d?P(d):null,d&&(r[a].updated=E(d))}};return await Promise.all(Array.from({length:Math.min(Z,r.length)},i)),r}export{de as a,ce as b,pe as c,he as d,fe as e,ye as f,ve as g,xe as h,Se as i,_e as j,Q as k,be as l,$e as m,we as n,ke as o,Re as p,je as q,Ce as r,Ee as s,se as t,ne as u,Ie as v};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as d}from"./chunk-73ZFOJOK.js";import{a as m}from"./chunk-
|
|
2
|
+
import{b as d}from"./chunk-73ZFOJOK.js";import{a as m}from"./chunk-EZMRWXRT.js";import{da as u}from"./chunk-PI7OXS62.js";function h(e,r){return`${e}:hold:${r}`}function g(e,r){let n=[],o=[];for(let i of e.use_cases){let c=i.matches_existing;c?.cid&&r.hasNode(c.cid)?n.push({ref:c.cid,expectedTip:r.tipOf(c.cid)}):o.push({tempRef:i.temp_ref,title:String(i.title??""),probeText:String(i.title??"")})}return{verb:"extract",ucTargets:n,newBuCandidates:o,sourcePins:[{source_id:e.source.source_id,source_cid:e.source.source_cid}],readBasis:e.read_basis??null}}async function b(e){let r=d(e.proposal),n=t=>r.passthrough.use_cases.filter(a=>{let l=a.matches_existing?.cid,s=l?t.resolve(l):null,p=s?t.tipOf(s.cid):null;return p!=null&&(e.matchUnreviewed===!0||(t.trust.get(p)??null)!=="derived")}),o=n(e.graph),i=new Set(o.map(t=>t.temp_ref));return{ok:(await m(e.ctx,{...g({...r.passthrough,use_cases:o},e.graph),eventIds:[h(e.sid,e.proposalId)]},t=>{let a={...r.passthrough,use_cases:n(t.graph).filter(p=>i.has(p.temp_ref))},l=new Map(a.use_cases.map(p=>[p.temp_ref,{resolution:"approved"}])),s=u({store:e.store,graph:t.graph,scope:t.scope,proposal:a,proposalId:e.proposalId,verdicts:l,by:e.by,autoName:!0,allowStaleBasis:!0,eventIds:t.eventIds("extract",1),...e.durable?{sid:t.sid}:{},probeHits:t.probeHits,...e.matchUnreviewed?{matchUnreviewed:!0}:{}});return s.errors!==null?{errors:s.errors}:{result:s,record:s.record}})).ok,skippedAttach:r.passthrough.use_cases.length-o.length}}export{h as a,g as b,b as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as n}from"./chunk-RQKMSNEU.js";import{a as i}from"./chunk-
|
|
2
|
+
import{a as n}from"./chunk-RQKMSNEU.js";import{a as i}from"./chunk-4C7WVQOD.js";import{c as o}from"./chunk-ZCRZFAOT.js";import{appendFileSync as c,mkdirSync as a,readFileSync as f,statSync as u,writeFileSync as m}from"fs";import{dirname as p}from"path";var d=64*1024;function I(r){let t=o(r,"runs");return s=>{try{if(a(p(t),{recursive:!0}),(u(t,{throwIfNoEntry:!1})?.size??0)>d){let e=f(t,"utf8");m(t,e.slice(e.indexOf(`
|
|
3
3
|
`,e.length/2)+1))}c(t,`${new Date().toISOString()} ${n()} ${s}
|
|
4
4
|
`)}catch{}}}var h=r=>{if(!(r instanceof i))return r instanceof Error?r.message:String(r);let t=r.requestId;return`${r.code}: ${r.message}${typeof t=="string"&&t?` (request ${t})`:""}`};export{I as a,h as b};
|
|
@@ -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-J4FIESTB.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};
|