@testmuai/kane-cli 0.8.20 → 0.8.22
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-757LHEYF.js → ChatSurface-PA73V3NT.js} +1 -1
- package/dist/{ChromeProfilePicker-UAMRJG2H.js → ChromeProfilePicker-XX223SYB.js} +1 -1
- package/dist/{CliFeedbackPrompt-NAPKBEOP.js → CliFeedbackPrompt-J6DW6TZL.js} +1 -1
- package/dist/{CliUploadProgress-R6FHYXP5.js → CliUploadProgress-TWEL7NWG.js} +1 -1
- package/dist/{ConfigView-CKYIRJBS.js → ConfigView-ROFNVFDQ.js} +1 -1
- package/dist/EvidenceViewOffer-XUP44BGJ.js +2 -0
- package/dist/FolderPicker-XLAK7324.js +2 -0
- package/dist/{InfoBox-WKFPWFII.js → InfoBox-ELZ5Q65V.js} +1 -1
- package/dist/{LinksBox-MQOD3X3E.js → LinksBox-2V26KLTJ.js} +1 -1
- package/dist/{ProfilesView-PLO2SBGI.js → ProfilesView-P4Z42LSX.js} +1 -1
- package/dist/{ProjectPicker-QT2IENIZ.js → ProjectPicker-2QNFNN7T.js} +1 -1
- package/dist/{SaveSessionPrompt-BRNUVO5J.js → SaveSessionPrompt-XMWL3P6G.js} +1 -1
- package/dist/SingleShotApp-3YZSE3AA.js +2 -0
- package/dist/{SummaryBox-7OBZAVJU.js → SummaryBox-RWO4BYYD.js} +1 -1
- package/dist/TestMdRunView-QHPMG46M.js +2 -0
- package/dist/{TestrunEvidenceTable-PKFPTUZX.js → TestrunEvidenceTable-MUOGF6CZ.js} +1 -1
- package/dist/{WhoamiView-CINKGNTV.js → WhoamiView-4EYWZR4N.js} +1 -1
- package/dist/agent-parse-2MLJOJTH.js +2 -0
- package/dist/{app-download-KLCWIQWJ.js → app-download-KUJVMZ7L.js} +1 -1
- package/dist/{auth-L7PFZJBY.js → auth-5HAY24TN.js} +1 -1
- package/dist/{binary-25KA3XAX.js → binary-6UEOI7PT.js} +1 -1
- package/dist/bind-3C2IIPML.js +15 -0
- package/dist/{bootstrap-545GY5CC.js → bootstrap-DBAQWVNA.js} +1 -1
- package/dist/bridge-NHXCRSIU.js +2 -0
- package/dist/{changelog-ABQ5HREB.js → changelog-QAGRYBEZ.js} +1 -1
- package/dist/chunk-26HZJJN6.js +5 -0
- package/dist/{chunk-CXXTQ4C5.js → chunk-2G5CJQOR.js} +1 -1
- package/dist/{chunk-G5Q4EJAT.js → chunk-2HFNP2LM.js} +1 -1
- package/dist/chunk-2KVECC36.js +2 -0
- package/dist/{chunk-PY4BWRR6.js → chunk-2OIIXLXW.js} +1 -1
- package/dist/{chunk-LJ5O7DZ7.js → chunk-3BUYTNAV.js} +2 -2
- package/dist/{chunk-TFGGJSTI.js → chunk-3H3KTCL7.js} +2 -2
- package/dist/{chunk-UUT7EHLT.js → chunk-3M6OM3T4.js} +1 -1
- package/dist/{chunk-FD5TFGJX.js → chunk-3MWLFHPO.js} +1 -1
- package/dist/{chunk-FYW7USQY.js → chunk-3NMXXTHE.js} +1 -1
- package/dist/chunk-44NNFVCJ.js +7 -0
- package/dist/chunk-46U7TRPE.js +98 -0
- package/dist/{chunk-PP4I2Z6M.js → chunk-4VW3B7SE.js} +1 -1
- package/dist/{chunk-OGWYTILK.js → chunk-4ZBI54KE.js} +4 -4
- package/dist/{chunk-4L45IQNU.js → chunk-5BHB5D2C.js} +1 -1
- package/dist/{chunk-SBSANJ2T.js → chunk-5D6YMG63.js} +2 -2
- package/dist/chunk-5E4JLXR5.js +2 -0
- package/dist/{chunk-BNWU7JOW.js → chunk-5FQYB5SM.js} +1 -1
- package/dist/{chunk-JKQX7DUC.js → chunk-5ILTSBWT.js} +1 -1
- package/dist/{chunk-E6MW25UV.js → chunk-5TQIKRKP.js} +1 -1
- package/dist/{chunk-7BKOTLIL.js → chunk-5XAX4C5N.js} +13 -11
- package/dist/chunk-5ZFOKYFB.js +5 -0
- package/dist/{chunk-K4D5BB63.js → chunk-6C35NKQ7.js} +1 -1
- package/dist/{chunk-CVXVFF2G.js → chunk-6MCQ2UKE.js} +1 -1
- package/dist/chunk-ADBOWRMW.js +2 -0
- package/dist/chunk-BL5QHONU.js +2 -0
- package/dist/chunk-BNC4DJCC.js +7 -0
- package/dist/chunk-BPDFI2DC.js +27 -0
- package/dist/{chunk-T27HVHZA.js → chunk-BPYRVV7O.js} +1 -1
- package/dist/chunk-CBUSNWHA.js +2 -0
- package/dist/{chunk-ISBISZUE.js → chunk-CE23VDW5.js} +1 -1
- package/dist/chunk-DF4EBXGN.js +8 -0
- package/dist/{chunk-R6RK32R2.js → chunk-DZCJE77P.js} +1 -1
- package/dist/{chunk-PCBCEXYO.js → chunk-E2KV4BQB.js} +1 -1
- package/dist/{chunk-LPVAOUAC.js → chunk-EVBCKI7D.js} +1 -1
- package/dist/chunk-FBRTUEAL.js +26 -0
- package/dist/{chunk-YL5J3SNK.js → chunk-FDXDFZ7J.js} +1 -1
- package/dist/{chunk-PN4EL4JN.js → chunk-FR3LVUAB.js} +1 -1
- package/dist/chunk-GF32QBCM.js +9 -0
- package/dist/{chunk-AXJ47YFH.js → chunk-GVE5GEW2.js} +1 -1
- package/dist/{chunk-SA7ORQHP.js → chunk-GYLMH2EX.js} +1 -1
- package/dist/{chunk-7SV2NQZV.js → chunk-HKIBJDKE.js} +1 -1
- package/dist/{chunk-RV3KMXUX.js → chunk-I4SO2FQV.js} +1 -1
- package/dist/{chunk-TEJG5H2O.js → chunk-JHBNXTG6.js} +1 -1
- package/dist/{chunk-IHVIIRW5.js → chunk-JHYWNWS5.js} +2 -2
- package/dist/{chunk-Y67FYNLP.js → chunk-JPOFRYTX.js} +1 -1
- package/dist/{chunk-CLLLLX4F.js → chunk-JQ3JB5CO.js} +1 -1
- package/dist/{chunk-XSZH2K3E.js → chunk-L35DJDX7.js} +1 -1
- package/dist/chunk-LDPLJFCV.js +2 -0
- package/dist/chunk-LKPOOZYN.js +8 -0
- package/dist/{chunk-N3MZALFQ.js → chunk-LSRNUBIV.js} +1 -1
- package/dist/{chunk-5WZ2WOOM.js → chunk-MHMEEA4S.js} +1 -1
- package/dist/{chunk-6MTKXDTH.js → chunk-MXI5P373.js} +1 -1
- package/dist/chunk-NAWGHDA3.js +15 -0
- package/dist/{chunk-Q5PQ7U3W.js → chunk-NMAPNJRY.js} +1 -1
- package/dist/chunk-NUYGWRB2.js +11 -0
- package/dist/{chunk-UYTBGBT4.js → chunk-O4LJWUSJ.js} +1 -1
- package/dist/{chunk-6V4ANMW4.js → chunk-OBB57E2L.js} +1 -1
- package/dist/chunk-ODU2JSMA.js +8 -0
- package/dist/{chunk-RMLC3QWX.js → chunk-OT3VKXJX.js} +1 -1
- package/dist/{chunk-EPVK2NMQ.js → chunk-P37ALET7.js} +1 -1
- package/dist/{chunk-56UYK35Z.js → chunk-PLIQ72LH.js} +1 -1
- package/dist/chunk-PUFZTE6L.js +2 -0
- package/dist/chunk-Q6AHSGOE.js +5 -0
- package/dist/{chunk-I3NUTW6U.js → chunk-QV445GUU.js} +1 -1
- package/dist/{chunk-M5V464PU.js → chunk-R43ELADV.js} +2 -2
- package/dist/{chunk-5FCXFSAO.js → chunk-R7ZDLGMU.js} +1 -1
- package/dist/{chunk-IYOL2FUH.js → chunk-REPKBN7I.js} +1 -1
- package/dist/{chunk-X77AR3IL.js → chunk-RFDL7MHI.js} +1 -1
- package/dist/{chunk-IPQAKIJO.js → chunk-RGRFL7XG.js} +1 -1
- package/dist/{chunk-4ZVGZF2L.js → chunk-RUSRN7YE.js} +1 -1
- package/dist/{chunk-R54VY272.js → chunk-SB5XM4YV.js} +5 -5
- package/dist/{chunk-RPJUE54T.js → chunk-SIXPXYCH.js} +1 -1
- package/dist/{chunk-OWPQZP4C.js → chunk-SJZJ7ASF.js} +1 -1
- package/dist/{chunk-VKFLER7N.js → chunk-SREUA7YQ.js} +1 -1
- package/dist/{chunk-T7UACVWW.js → chunk-SVJBOVI4.js} +1 -1
- package/dist/{chunk-DVYQVSNS.js → chunk-SW54RAAT.js} +1 -1
- package/dist/{chunk-H6TNBKGR.js → chunk-T2ONUKTL.js} +1 -1
- package/dist/{chunk-ZXP2TJEJ.js → chunk-T6MGCP57.js} +4 -4
- package/dist/{chunk-47ZPSTT6.js → chunk-UXR57BCE.js} +1 -1
- package/dist/{chunk-QBU5B4GH.js → chunk-VCY7UNEL.js} +1 -1
- package/dist/{chunk-SHXJQ73O.js → chunk-VW3PFRCO.js} +1 -1
- package/dist/{chunk-R5UVQMMP.js → chunk-WBH5GYFM.js} +1 -1
- package/dist/{chunk-FNJJGQUI.js → chunk-WGIZQGR5.js} +1 -1
- package/dist/chunk-WHNF5SWS.js +9 -0
- package/dist/{chunk-U2LDPUDZ.js → chunk-WJR2FU7S.js} +1 -1
- package/dist/{chunk-NFQ67CQO.js → chunk-WPBETG6U.js} +3 -3
- package/dist/{chunk-UFWG6VMI.js → chunk-WRGPMDDE.js} +1 -1
- package/dist/{chunk-2TNMV4BX.js → chunk-XFQLR6MF.js} +1 -1
- package/dist/chunk-XKYL4K4A.js +2 -0
- package/dist/{chunk-ARCYAF37.js → chunk-XQNJSM5C.js} +1 -1
- package/dist/{chunk-YV6CSSWA.js → chunk-YFBJWIBU.js} +1 -1
- package/dist/chunk-YFQGOOF7.js +2 -0
- package/dist/{chunk-DCLMFWCF.js → chunk-Z2XKFYMH.js} +1 -1
- package/dist/{chunk-U7WMRB5V.js → chunk-ZUJGYHZ2.js} +1 -1
- package/dist/{config-A6MBUY54.js → config-HVSKN6L4.js} +1 -1
- package/dist/{cover-cmd-TIY53OMC.js → cover-cmd-ZZJA5C6H.js} +1 -1
- package/dist/{credentials-GXICFDVV.js → credentials-FH6VZPJS.js} +1 -1
- package/dist/{deps-bundle-RDGQAIGD.js → deps-bundle-QUROUKJI.js} +1 -1
- package/dist/{deps-resolve-52BOL7G6.js → deps-resolve-N2KKJ37Q.js} +1 -1
- package/dist/device-env-ID7EDDOD.js +2 -0
- package/dist/{dispatch-GJ7RVYPK.js → dispatch-BYA5Q2SD.js} +1 -1
- package/dist/{doctor-XNI2NZZJ.js → doctor-MGHY2M36.js} +1 -1
- package/dist/evidence-XYKLWPPY.js +2 -0
- package/dist/evolve-cmd-BURJDLVF.js +2 -0
- package/dist/{explain-cmd-LQ5CHHNY.js → explain-cmd-53EO2IMN.js} +1 -1
- package/dist/{explain-cmd-ENSJNQK7.js → explain-cmd-JAOHSI4F.js} +1 -1
- package/dist/{extract-bind-NWA4PSTU.js → extract-bind-T7GKUEJ6.js} +3 -3
- package/dist/{extract-cmd-Q5PZS626.js → extract-cmd-WXG34RMY.js} +3 -3
- package/dist/{gaps-cmd-UKMO7KYX.js → gaps-cmd-T55FFFVB.js} +1 -1
- package/dist/{generate-headless-CLKY4IAU.js → generate-headless-BSBY47K2.js} +2 -2
- package/dist/{headless-io-3A3BZVQ5.js → headless-io-75HUMWZB.js} +1 -1
- package/dist/index.js +141 -139
- package/dist/{ingest-cmd-JZNVRFFS.js → ingest-cmd-BYOZCTVG.js} +1 -1
- package/dist/install-OABVIXAE.js +2 -0
- package/dist/{interactive-bind-7JMBM3OK.js → interactive-bind-JAB6XUPX.js} +3 -3
- package/dist/{lifecycle-cmd-VMZKHC2Y.js → lifecycle-cmd-QVGYYJSG.js} +1 -1
- package/dist/{list-cmd-3XDCASJH.js → list-cmd-RQYRC345.js} +1 -1
- package/dist/{list-commands-QURMKZZH.js → list-commands-VTWPMFG3.js} +1 -1
- package/dist/login-flow-HUORIV6P.js +2 -0
- package/dist/{maintenance-cmd-MQ4GCVDU.js → maintenance-cmd-NC2VI5G7.js} +1 -1
- package/dist/{mobile-prompts-VXNHSCAH.js → mobile-prompts-VCA73IYP.js} +1 -1
- package/dist/{next-TRSKMBO5.js → next-KZXH4UA4.js} +1 -1
- package/dist/objective-variable-gate-WZFN5I7Y.js +2 -0
- package/dist/{open-provider-ZYBUD6JW.js → open-provider-YXHFPVDE.js} +1 -1
- package/dist/persist-recorded-session-SZDBBSNH.js +3 -0
- package/dist/{phase-seed-H7KXNQO6.js → phase-seed-MKHEWUN6.js} +1 -1
- package/dist/pipeline-FAU3PBDH.js +2 -0
- package/dist/prepare-target-XYOTVK2I.js +2 -0
- package/dist/reconcile-cmd-2BFK7RFL.js +2 -0
- package/dist/reconcile-deps-CYWH6GM4.js +4 -0
- package/dist/reconcile-engine-ZWIJFYBP.js +2 -0
- package/dist/{recording-banner-WZECSZJM.js → recording-banner-FRH2EJBM.js} +1 -1
- package/dist/registry-QR3BDI5F.js +2 -0
- package/dist/{require-project-folder-OFA4F2T5.js → require-project-folder-A6YTVLAK.js} +1 -1
- package/dist/{resolve-run-intent-M7EXFU7E.js → resolve-run-intent-PHAXPW6C.js} +1 -1
- package/dist/{resolver-TZAQGCFJ.js → resolver-U55SNASN.js} +1 -1
- package/dist/{review-cmd-RXD2RWKN.js → review-cmd-ZKCXBMFP.js} +1 -1
- package/dist/{run-DVBOAY7S.js → run-76I4OYXD.js} +1 -1
- package/dist/run-XJK3YOW2.js +2 -0
- package/dist/{run-test-md-Z75BGXRK.js → run-test-md-A3QRWLCW.js} +2 -2
- package/dist/{skill-installer-FEOJ4KX3.js → skill-installer-LSDCMJ6P.js} +1 -1
- package/dist/{spawner-XHE7OXNW.js → spawner-HZXP66DS.js} +1 -1
- package/dist/{store-guard-HIBKFC2T.js → store-guard-27XJZ7WF.js} +1 -1
- package/dist/structured-answers-ZI2B6JJE.js +2 -0
- package/dist/sync-cmd-JZ3MXGEU.js +2 -0
- package/dist/{sync-setup-WGYN6ZTI.js → sync-setup-HGG7ALGA.js} +1 -1
- package/dist/tcg-generate-S77VVSVU.js +2 -0
- package/dist/testmd-actions-VQJ22WZZ.js +2 -0
- package/dist/testmd-sync-RKSGTCZA.js +2 -0
- package/dist/{tms-client-V3TR4QW3.js → tms-client-KU6HCA23.js} +1 -1
- package/dist/token-refresh-AOCGYGEC.js +2 -0
- package/dist/{validate-basic-GBA5PHIK.js → validate-basic-5NYH5WYI.js} +1 -1
- package/dist/variable-receipt-C3US6X4M.js +2 -0
- package/dist/{verdicts-34ZGB67K.js → verdicts-VPTU4YAS.js} +1 -1
- package/dist/{version-check-BHRM4PN4.js → version-check-YY57B2A4.js} +1 -1
- package/dist/{view-cmd-FJGT5KZO.js → view-cmd-KWIBYZ5S.js} +1 -1
- package/dist/walk-session-YSKEJM2F.js +2 -0
- package/dist/{with-telemetry-AIPWSH4P.js → with-telemetry-2NY4CPL5.js} +1 -1
- package/package.json +11 -11
- package/dist/EvidenceViewOffer-M3DAU4YU.js +0 -2
- package/dist/FolderPicker-I2E2EJON.js +0 -2
- package/dist/SingleShotApp-CQWGPSLT.js +0 -2
- package/dist/TestMdRunView-GIOPBTA6.js +0 -2
- package/dist/agent-parse-XMWVKCRD.js +0 -2
- package/dist/bind-N5QZUUUU.js +0 -15
- package/dist/bridge-VNFL4T6K.js +0 -2
- package/dist/chunk-3Q5IQXOI.js +0 -11
- package/dist/chunk-4K44ZIC4.js +0 -2
- package/dist/chunk-5UCXN56I.js +0 -2
- package/dist/chunk-7XC5IQN6.js +0 -95
- package/dist/chunk-A55WPXDZ.js +0 -2
- package/dist/chunk-ALK3OUGN.js +0 -27
- package/dist/chunk-BPMSNGXQ.js +0 -2
- package/dist/chunk-CAOZKSQ3.js +0 -8
- package/dist/chunk-DFHVZZI3.js +0 -7
- package/dist/chunk-DYW5C6II.js +0 -2
- package/dist/chunk-EV3EU2MT.js +0 -9
- package/dist/chunk-HS7OIRGU.js +0 -5
- package/dist/chunk-K3EN7O5N.js +0 -26
- package/dist/chunk-L45HDSJ7.js +0 -15
- package/dist/chunk-P6HK7GSS.js +0 -9
- package/dist/chunk-P7YZ3PU3.js +0 -2
- package/dist/chunk-RTD27WRG.js +0 -7
- package/dist/chunk-UVR7MESH.js +0 -2
- package/dist/chunk-VL7LPZVI.js +0 -8
- package/dist/chunk-YKYHVRM2.js +0 -5
- package/dist/evidence-QYJ7SQR6.js +0 -2
- package/dist/evolve-cmd-2LM6NKMY.js +0 -2
- package/dist/install-FLC6WLPZ.js +0 -2
- package/dist/login-flow-BPT46DCE.js +0 -2
- package/dist/objective-variable-gate-BDSG2BEA.js +0 -2
- package/dist/persist-recorded-session-NV2ULVPH.js +0 -3
- package/dist/pipeline-STTNBJC4.js +0 -2
- package/dist/prepare-target-CRO3BGAP.js +0 -2
- package/dist/reconcile-cmd-VQTFUGEJ.js +0 -2
- package/dist/reconcile-deps-SE6COSXQ.js +0 -4
- package/dist/reconcile-engine-GLKGQEVR.js +0 -2
- package/dist/registry-GQEYUEQJ.js +0 -2
- package/dist/run-VF2MBI6M.js +0 -2
- package/dist/structured-answers-3C2DCFFF.js +0 -5
- package/dist/sync-cmd-MZYM5IE6.js +0 -2
- package/dist/tcg-generate-Y2UMDGPL.js +0 -2
- package/dist/testmd-actions-UDNH6W2Z.js +0 -2
- package/dist/testmd-sync-4BXMEIJ3.js +0 -2
- package/dist/token-refresh-KYIQ7LZL.js +0 -2
- package/dist/variable-receipt-WMV33LAD.js +0 -2
- package/dist/walk-session-CTZ5475S.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R,b as Y,g as _,o as N}from"./chunk-FNJJGQUI.js";import"./chunk-NJ4BXZBX.js";import"./chunk-Q4YYAN6E.js";import"./chunk-3VAU3PNU.js";import"./chunk-EVFFDODK.js";import"./chunk-KJQNAOOE.js";import"./chunk-WVHMPIDQ.js";import"./chunk-BZAGVBCX.js";import"./chunk-V4B5QA3U.js";import"./chunk-BB2W35TW.js";import"./chunk-427OQS2N.js";import"./chunk-7N6OCHPC.js";import"./chunk-KDNNMU7Q.js";import"./chunk-Q2F5QB2W.js";import{a as T,b as O,c as U,d as j}from"./chunk-UFWG6VMI.js";import{N as E,O as H,S as L,c as P,e as I}from"./chunk-SBSANJ2T.js";import"./chunk-6MTKXDTH.js";import{c as G,h as A}from"./chunk-H6TNBKGR.js";import"./chunk-66MOZKD2.js";import"./chunk-YLQHY4A7.js";import"./chunk-U2LDPUDZ.js";import"./chunk-IPQAKIJO.js";import"./chunk-VVOKM2VO.js";import{a as f}from"./chunk-CH273NAE.js";import"./chunk-CAOZKSQ3.js";import"./chunk-VZ7KXRXB.js";import"./chunk-5LJRZI7S.js";import"./chunk-BKM2LWU2.js";import"./chunk-IICT4VOU.js";import"./chunk-D6E6KRVX.js";import"./chunk-3UI5VTQS.js";import"./chunk-RDHWNSDP.js";import"./chunk-FQNQVC5O.js";import"./chunk-XLSOQLVT.js";import"./chunk-UD7KKHPW.js";import"./chunk-YCCUBQY4.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-OWPQZP4C.js";import"./chunk-DFS4RMVP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";import{existsSync as y}from"fs";import{resolve as $}from"path";import{spawn as D}from"child_process";var w=class extends Error{},m=e=>{if(e===null)throw new w;return e},u=(e,t,o)=>({value:e,label:t,detail:o});async function p(e,t,o,n=!1){for(;;){let h=m(await e.input(t,o,n)).trim();if(h)return h;e.out("Enter a value, or press Esc to leave setup.")}}async function S(e,t){e.out(`Open in your browser: ${t}`);try{await e.open(t)}catch{e.out("The browser could not open automatically. Open that address yourself, then continue here.")}}async function b(e,t){let o=await e.gitRead(t);return o.ok||e.out(j(o.diagnostic,t)),o.ok}var x=u("change","Use a different address"),C=u("storage","Choose a different storage");async function z(e,t){for(;;)try{await e.checkGit();break}catch(n){e.out(n instanceof Error?n.message:"Git 2.31 or newer is required."),m(await e.choose("Install Git, then return here",[u("open","Open Git installation instructions"),u("retry","Check again")]))==="open"&&await S(e,"https://git-scm.com/downloads")}if(await b(e,t.gitUrl))return"ok";if(!/^https:\/\/github\.com\//i.test(t.gitUrl))for(e.out("Set up Git access for this repository with your server's SSH key or credential helper. kane-cli uses the same access as Git.");;){let n=m(await e.choose("Git cannot read this repository yet.",[u("retry","Check again"),x,C]));if(n==="change"||n==="storage")return n;if(await b(e,t.gitUrl))return"ok"}for(e.out("Sign in below if you have not, or ask the owner to grant your GitHub account access.");;){let n=m(await e.choose("Sign in to access this GitHub repository",[u("login","Sign in with your browser","Use or create your GitHub account."),u("retry","I've fixed my access \u2014 check again","Ask the owner to grant your account access, or check your existing Git login."),x,C]));if(n==="change"||n==="storage")return n;if(n==="login"){if((await e.gh(["--version"])).code){e.out("Browser sign-in uses GitHub CLI, a small GitHub tool. Install it once, then return to this step. GitHub CLI is optional if you already use SSH or another Git credential helper."),m(await e.choose("GitHub CLI is not installed",[u("open","Open installation instructions"),u("retry","Check again")]))==="open"&&await S(e,"https://cli.github.com/");continue}if((await e.gh(["auth","login","--hostname","github.com","--git-protocol","https","--web"],!0)).code){e.out("Sign-in did not finish. Your repository address is still saved in this setup.");continue}for(;(await e.gh(["auth","setup-git","--hostname","github.com"])).code&&(e.out("GitHub sign-in finished, but Git could not be told to use it."),m(await e.choose("Configure Git to use your GitHub sign-in",[u("retry","Try the configuration again"),u("skip","Skip; I use SSH or another credential helper")]))!=="skip"););}if(await b(e,t.gitUrl))return"ok";e.out("A browser login alone does not grant repository permission: ask the owner to grant your GitHub account access.")}}async function k(e){if(m(await e.choose("Access to the bucket",[u("existing","Use credentials already configured on this computer","Existing kane-cli credentials or KANE_SYNC_S3_ACCESS_KEY_ID and KANE_SYNC_S3_SECRET_ACCESS_KEY."),u("keys","Enter the access keys from my storage administrator","Saved in your local kane-cli configuration, never in the shared context.")]))!=="existing")return e.out("These are bucket access keys, not your cloud account password. Your administrator must grant access to the bucket and folder you selected."),{accessKeyId:await p(e,"Access key ID"),secretAccessKey:await p(e,"Secret access key (hidden)",void 0,!0)}}async function W(e,t){let o=t?.kind??m(await e.choose("Where should your team's shared context live?",[u("github","GitHub \u2014 Recommended","Guided setup for a repository: a storage space on GitHub."),u("s3","S3-compatible storage","Use your team's existing cloud bucket and access keys."),u("folder","Folder","A local folder stays on this computer. A mounted shared drive can serve your team.")]));if(o==="github"){t||(e.out("GitHub will hold the requirements, documents and test information you publish from kane-cli. Each teammate signs in with their own account."),m(await e.choose("Choose a GitHub repository",[u("existing","Use an existing repository"),u("create","Create a repository on GitHub","Use a dedicated repository. Choose Private to limit who can see your context.")]))==="create"&&(await S(e,"https://github.com/new"),e.out("On GitHub: choose the owner and repository name, choose Private, and create the repository. Return here and paste its HTTPS address. No code or Git knowledge is needed.")));let d=await p(e,"Repository address (for example https://github.com/my-team/team-context.git)",t?.address);return{location:d,journey:{kind:o,address:d}}}if(o==="folder"){t||e.out("Everyone needs access to the same mounted drive to share through a folder. Sending a local path does not share its contents. Dropbox, iCloud, OneDrive and Google Drive sync folders are not supported.");let d=await p(e,"Folder path",t?.address);return{location:d,journey:{kind:o,address:d}}}t||e.out("Ask your storage administrator for an existing bucket and access keys. kane-cli does not create buckets or cloud permissions.");let n=t?.s3,h=await p(e,"Bucket name",n?.bucket);for(;!/^[a-zA-Z0-9.-]+$/.test(h);)e.out("Use the bucket's name, not a URL."),h=await p(e,"Bucket name");let c=await p(e,"Region",n?.region??"us-east-1"),s=m(await e.input("Folder inside the bucket (optional)",n?.prefix??"")),i=[u("aws","Amazon S3"),u("compatible","Another S3-compatible service")];n&&i.sort((d,g)=>+(g.value===n.service)-+(d.value===n.service));let l=m(await e.choose("Which storage service?",i)),r=new URLSearchParams({region:c}),a=l==="compatible"?await p(e,"Service endpoint (https://host, with an optional port)",n?.service===l?n.endpoint:void 0):void 0;return a&&r.set("endpoint",a),{location:`s3://${h}/${s.split("/").map(encodeURIComponent).join("/")}?${r}`,journey:{kind:"s3",s3:{bucket:h,region:c,prefix:s,service:l,endpoint:a}}}}function K(e){return e.kind==="dir"?"A location address contains no password: everyone who can open this folder can read it; sending the path does not send its contents.":e.kind==="s3"?"A location address contains no keys and does not grant access: grant teammates access to the bucket in your storage's console.":U(e.gitUrl??"")==="github.com"?"A location address contains no password and does not grant access. Invite teammates on GitHub.":"A location address contains no password and does not grant access: grant teammates access on your Git server."}async function J(e,t){try{e.out("Share your context: the requirements, documents and test information you add to kane-cli. A location is where your team's shared copy lives.");let o=m(await e.choose("What do you want to do?",[u("share","Share my context with my team"),u("join","Join my team's context")]));if(o==="share"&&!y(f(t)))return e.out("There is no context here to share yet. Add your documents with kane-cli context ingest <files>, then run kane-cli context sync setup again."),2;let n,h=async()=>{for(;;){let r;for(;;){let a;if(o==="join")a=await p(e,"Paste the location your teammate shared",n?.address),n={kind:"join",address:a};else{let d=await W(e,n);a=d.location,n=d.journey}try{r=E(a,t);break}catch(d){e.out(d instanceof Error?d.message:"That location could not be read.")}}if(r.kind==="fake")throw new Error("This location is only available to tests.");if(r.kind==="git"){let a=await z(e,r);if(a==="storage"&&(n=void 0),a!=="ok")continue;if(/^https:\/\/github\.com\//i.test(r.gitUrl)){let d=await e.gh(["repo","view",r.gitUrl,"--json","nameWithOwner,visibility"]),g;try{let v=JSON.parse(d.text);["PUBLIC","PRIVATE","INTERNAL"].includes(v.visibility)&&(g=v.visibility)}catch{}e.out(g?`Repository visibility: ${g.toLowerCase()}.`:"Repository visibility could not be checked automatically. Check Public/Private on GitHub before publishing.")}}return r}},c=await h(),s=c.kind==="s3"?await k(e):void 0,i="origin",l;if(o==="join")for(;l=$(t,await p(e,"Download into a new folder","team-context")),!!y(l);)e.out("That folder already exists. Choose a new folder so your current context and files stay untouched.");else{let r=P(f(t)).locations;for(;r.some(a=>a.name===i)||!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(i);)i=await p(e,"Choose a new name for this connection","team")}for(e.out(`Location: ${c.gitUrl??c.path??c.location}`),e.out(c.kind==="git"?"Connection checks add small permanent files, commits and a scratch reference to this repository. Your own context is uploaded only by a separate publish command.":"Connection checks add small permanent files to this location. Your own context is uploaded only by a separate publish command."),m(await e.choose(o==="join"?"Connect and download team context?":"Connect this location? Your context will not be uploaded.",[u("connect",o==="join"?"Connect and download":"Connect location")]));e.out(o==="join"?"Checking access and downloading verified team context\u2026":"Checking read access and safe publishing\u2026"),(o==="join"?await e.clone(c.location,l,s):await e.add(i,c.location,s))!==0;){if(o==="join"&&y(l)){e.out(`The destination ${l} now exists after the interrupted attempt. Keep it; choose a new folder for a fresh download.`);do l=$(t,await p(e,"New download folder"));while(y(l))}let a=[u("retry","Retry this connection"),...c.kind==="s3"?[u("keys","Enter different keys")]:[],x,...o==="share"?[C]:[]],d=m(await e.choose("The connection did not finish. Your choices are kept; fix the reported issue and retry.",a));d==="keys"&&(s=await k(e)),(d==="change"||d==="storage")&&(d==="storage"&&(n=void 0),c=await h(),s=c.kind==="s3"?await k(e):void 0)}if(o==="join")e.out(`Team context downloaded into ${l}. Your previous local files were not replaced.`),e.out("Next: open that folder and run kane-cli context sync status.");else{let r=e.access(i);e.out(`Connected to ${c.gitUrl??c.path??c.location}. ${r==="write"?"You can download and publish changes.":"You can download context, but cannot publish changes."}`),e.out("Your context has not been uploaded yet."),e.out(r==="write"?`When ready, publish with kane-cli context push ${i}. This shares your context records and their referenced source documents with everyone who can read the location.`:"Ask the location owner for write access before publishing, then check the connection again."),e.out(`Share this location with teammates: ${H(c)}`),e.out(K(c))}return 0}catch(o){return o instanceof w?(e.out("Setup left. Your context has not been published. Any completed connection checks remain in the location."),3):(e.out(o instanceof Error?o.message:"Setup could not finish."),2)}}async function q(e,t=!1){return new Promise(o=>{let n=D("gh",e,{stdio:t?"inherit":["ignore","pipe","pipe"],windowsHide:!0}),h="";n.stdout?.on("data",s=>{h.length<64e3&&(h+=String(s))}),n.stderr?.on("data",()=>{});let c=setTimeout(()=>n.kill("SIGKILL"),t?3e5:2e4);n.on("error",()=>{clearTimeout(c),o({code:1,text:"GitHub CLI is unavailable"})}),n.on("close",s=>{clearTimeout(c),o({code:s??1,text:h})})})}async function ie(e,t=L(),o=process.cwd()){if(e.mode&&e.mode!=="interactive"||!G())return Y(R(e,t),t,new A("TTY_REQUIRED","guided setup needs an interactive terminal; for automation use kane-cli context sync add <name> <location> or kane-cli context clone <location> <new-folder>","run kane-cli context sync setup in a terminal"),2);let{promptSetup:n}=await import("./sync-setup-ui-RC727VK6.js"),h=(s,i)=>i(s?{credentials:s}:{}),c=async s=>{let i=[],l=await s({...t,out:r=>i.push(r),err:r=>i.push(r)});if(l!==0)for(let r of i){if(r.startsWith("next: ")||r.startsWith("checking "))continue;let a=r.startsWith("error: ")?r.slice(7):r,d=/^([a-z][a-z0-9+.-]*:\/\/|[a-z0-9._-]+@[a-z0-9.-]+[:/]|[\/~.])/i.test(a);t.out(/^[a-z]/.test(a)&&!d?a.charAt(0).toUpperCase()+a.slice(1)+(/[.!?]$/.test(a)?"":"."):a)}return l};return J({out:t.out,choose:(s,i)=>n({title:s,choices:i}),input:(s,i,l)=>n({title:s,initial:i,secret:l}),open:async s=>{let{default:i}=await import("./open-MQLQKFAW.js");await i(s)},checkGit:()=>O(),gitRead:async s=>{try{let i=await T(["ls-remote",s],{timeout:2e4});return{ok:i.code===0,diagnostic:i.stderr}}catch(i){return{ok:!1,diagnostic:i instanceof Error?i.message:String(i)}}},gh:q,add:(s,i,l)=>h(l,r=>c(a=>_(s,i,r,a,o))),clone:(s,i,l)=>h(l,r=>c(a=>N(s,i,r,a,o))),access:s=>I(f(o)).entries[s]?.tier===1?"write":"read"},o)}export{J as runSetup,ie as setupCommand};
|
|
2
|
+
import{a as R,b as Y,g as _,o as N}from"./chunk-WGIZQGR5.js";import"./chunk-NJ4BXZBX.js";import"./chunk-Q4YYAN6E.js";import"./chunk-EVFFDODK.js";import"./chunk-KJQNAOOE.js";import"./chunk-3VAU3PNU.js";import"./chunk-WVHMPIDQ.js";import"./chunk-BB2W35TW.js";import"./chunk-BZAGVBCX.js";import"./chunk-V4B5QA3U.js";import"./chunk-427OQS2N.js";import"./chunk-7N6OCHPC.js";import"./chunk-KDNNMU7Q.js";import"./chunk-Q2F5QB2W.js";import{a as T,b as O,c as U,d as j}from"./chunk-WRGPMDDE.js";import{N as E,O as H,S as L,c as P,e as I}from"./chunk-5D6YMG63.js";import"./chunk-MXI5P373.js";import{c as G,h as A}from"./chunk-T2ONUKTL.js";import"./chunk-66MOZKD2.js";import"./chunk-YLQHY4A7.js";import"./chunk-WJR2FU7S.js";import"./chunk-RGRFL7XG.js";import"./chunk-VVOKM2VO.js";import"./chunk-IICT4VOU.js";import"./chunk-D6E6KRVX.js";import"./chunk-3UI5VTQS.js";import{a as f}from"./chunk-CH273NAE.js";import"./chunk-ODU2JSMA.js";import"./chunk-VZ7KXRXB.js";import"./chunk-5LJRZI7S.js";import"./chunk-BKM2LWU2.js";import"./chunk-RDHWNSDP.js";import"./chunk-FQNQVC5O.js";import"./chunk-XLSOQLVT.js";import"./chunk-UD7KKHPW.js";import"./chunk-YCCUBQY4.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-SJZJ7ASF.js";import"./chunk-DFS4RMVP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";import{existsSync as y}from"fs";import{resolve as $}from"path";import{spawn as D}from"child_process";var w=class extends Error{},m=e=>{if(e===null)throw new w;return e},u=(e,t,o)=>({value:e,label:t,detail:o});async function p(e,t,o,n=!1){for(;;){let h=m(await e.input(t,o,n)).trim();if(h)return h;e.out("Enter a value, or press Esc to leave setup.")}}async function S(e,t){e.out(`Open in your browser: ${t}`);try{await e.open(t)}catch{e.out("The browser could not open automatically. Open that address yourself, then continue here.")}}async function b(e,t){let o=await e.gitRead(t);return o.ok||e.out(j(o.diagnostic,t)),o.ok}var x=u("change","Use a different address"),C=u("storage","Choose a different storage");async function z(e,t){for(;;)try{await e.checkGit();break}catch(n){e.out(n instanceof Error?n.message:"Git 2.31 or newer is required."),m(await e.choose("Install Git, then return here",[u("open","Open Git installation instructions"),u("retry","Check again")]))==="open"&&await S(e,"https://git-scm.com/downloads")}if(await b(e,t.gitUrl))return"ok";if(!/^https:\/\/github\.com\//i.test(t.gitUrl))for(e.out("Set up Git access for this repository with your server's SSH key or credential helper. kane-cli uses the same access as Git.");;){let n=m(await e.choose("Git cannot read this repository yet.",[u("retry","Check again"),x,C]));if(n==="change"||n==="storage")return n;if(await b(e,t.gitUrl))return"ok"}for(e.out("Sign in below if you have not, or ask the owner to grant your GitHub account access.");;){let n=m(await e.choose("Sign in to access this GitHub repository",[u("login","Sign in with your browser","Use or create your GitHub account."),u("retry","I've fixed my access \u2014 check again","Ask the owner to grant your account access, or check your existing Git login."),x,C]));if(n==="change"||n==="storage")return n;if(n==="login"){if((await e.gh(["--version"])).code){e.out("Browser sign-in uses GitHub CLI, a small GitHub tool. Install it once, then return to this step. GitHub CLI is optional if you already use SSH or another Git credential helper."),m(await e.choose("GitHub CLI is not installed",[u("open","Open installation instructions"),u("retry","Check again")]))==="open"&&await S(e,"https://cli.github.com/");continue}if((await e.gh(["auth","login","--hostname","github.com","--git-protocol","https","--web"],!0)).code){e.out("Sign-in did not finish. Your repository address is still saved in this setup.");continue}for(;(await e.gh(["auth","setup-git","--hostname","github.com"])).code&&(e.out("GitHub sign-in finished, but Git could not be told to use it."),m(await e.choose("Configure Git to use your GitHub sign-in",[u("retry","Try the configuration again"),u("skip","Skip; I use SSH or another credential helper")]))!=="skip"););}if(await b(e,t.gitUrl))return"ok";e.out("A browser login alone does not grant repository permission: ask the owner to grant your GitHub account access.")}}async function k(e){if(m(await e.choose("Access to the bucket",[u("existing","Use credentials already configured on this computer","Existing kane-cli credentials or KANE_SYNC_S3_ACCESS_KEY_ID and KANE_SYNC_S3_SECRET_ACCESS_KEY."),u("keys","Enter the access keys from my storage administrator","Saved in your local kane-cli configuration, never in the shared context.")]))!=="existing")return e.out("These are bucket access keys, not your cloud account password. Your administrator must grant access to the bucket and folder you selected."),{accessKeyId:await p(e,"Access key ID"),secretAccessKey:await p(e,"Secret access key (hidden)",void 0,!0)}}async function W(e,t){let o=t?.kind??m(await e.choose("Where should your team's shared context live?",[u("github","GitHub \u2014 Recommended","Guided setup for a repository: a storage space on GitHub."),u("s3","S3-compatible storage","Use your team's existing cloud bucket and access keys."),u("folder","Folder","A local folder stays on this computer. A mounted shared drive can serve your team.")]));if(o==="github"){t||(e.out("GitHub will hold the requirements, documents and test information you publish from kane-cli. Each teammate signs in with their own account."),m(await e.choose("Choose a GitHub repository",[u("existing","Use an existing repository"),u("create","Create a repository on GitHub","Use a dedicated repository. Choose Private to limit who can see your context.")]))==="create"&&(await S(e,"https://github.com/new"),e.out("On GitHub: choose the owner and repository name, choose Private, and create the repository. Return here and paste its HTTPS address. No code or Git knowledge is needed.")));let d=await p(e,"Repository address (for example https://github.com/my-team/team-context.git)",t?.address);return{location:d,journey:{kind:o,address:d}}}if(o==="folder"){t||e.out("Everyone needs access to the same mounted drive to share through a folder. Sending a local path does not share its contents. Dropbox, iCloud, OneDrive and Google Drive sync folders are not supported.");let d=await p(e,"Folder path",t?.address);return{location:d,journey:{kind:o,address:d}}}t||e.out("Ask your storage administrator for an existing bucket and access keys. kane-cli does not create buckets or cloud permissions.");let n=t?.s3,h=await p(e,"Bucket name",n?.bucket);for(;!/^[a-zA-Z0-9.-]+$/.test(h);)e.out("Use the bucket's name, not a URL."),h=await p(e,"Bucket name");let c=await p(e,"Region",n?.region??"us-east-1"),s=m(await e.input("Folder inside the bucket (optional)",n?.prefix??"")),i=[u("aws","Amazon S3"),u("compatible","Another S3-compatible service")];n&&i.sort((d,g)=>+(g.value===n.service)-+(d.value===n.service));let l=m(await e.choose("Which storage service?",i)),r=new URLSearchParams({region:c}),a=l==="compatible"?await p(e,"Service endpoint (https://host, with an optional port)",n?.service===l?n.endpoint:void 0):void 0;return a&&r.set("endpoint",a),{location:`s3://${h}/${s.split("/").map(encodeURIComponent).join("/")}?${r}`,journey:{kind:"s3",s3:{bucket:h,region:c,prefix:s,service:l,endpoint:a}}}}function K(e){return e.kind==="dir"?"A location address contains no password: everyone who can open this folder can read it; sending the path does not send its contents.":e.kind==="s3"?"A location address contains no keys and does not grant access: grant teammates access to the bucket in your storage's console.":U(e.gitUrl??"")==="github.com"?"A location address contains no password and does not grant access. Invite teammates on GitHub.":"A location address contains no password and does not grant access: grant teammates access on your Git server."}async function J(e,t){try{e.out("Share your context: the requirements, documents and test information you add to kane-cli. A location is where your team's shared copy lives.");let o=m(await e.choose("What do you want to do?",[u("share","Share my context with my team"),u("join","Join my team's context")]));if(o==="share"&&!y(f(t)))return e.out("There is no context here to share yet. Add your documents with kane-cli context ingest <files>, then run kane-cli context sync setup again."),2;let n,h=async()=>{for(;;){let r;for(;;){let a;if(o==="join")a=await p(e,"Paste the location your teammate shared",n?.address),n={kind:"join",address:a};else{let d=await W(e,n);a=d.location,n=d.journey}try{r=E(a,t);break}catch(d){e.out(d instanceof Error?d.message:"That location could not be read.")}}if(r.kind==="fake")throw new Error("This location is only available to tests.");if(r.kind==="git"){let a=await z(e,r);if(a==="storage"&&(n=void 0),a!=="ok")continue;if(/^https:\/\/github\.com\//i.test(r.gitUrl)){let d=await e.gh(["repo","view",r.gitUrl,"--json","nameWithOwner,visibility"]),g;try{let v=JSON.parse(d.text);["PUBLIC","PRIVATE","INTERNAL"].includes(v.visibility)&&(g=v.visibility)}catch{}e.out(g?`Repository visibility: ${g.toLowerCase()}.`:"Repository visibility could not be checked automatically. Check Public/Private on GitHub before publishing.")}}return r}},c=await h(),s=c.kind==="s3"?await k(e):void 0,i="origin",l;if(o==="join")for(;l=$(t,await p(e,"Download into a new folder","team-context")),!!y(l);)e.out("That folder already exists. Choose a new folder so your current context and files stay untouched.");else{let r=P(f(t)).locations;for(;r.some(a=>a.name===i)||!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(i);)i=await p(e,"Choose a new name for this connection","team")}for(e.out(`Location: ${c.gitUrl??c.path??c.location}`),e.out(c.kind==="git"?"Connection checks add small permanent files, commits and a scratch reference to this repository. Your own context is uploaded only by a separate publish command.":"Connection checks add small permanent files to this location. Your own context is uploaded only by a separate publish command."),m(await e.choose(o==="join"?"Connect and download team context?":"Connect this location? Your context will not be uploaded.",[u("connect",o==="join"?"Connect and download":"Connect location")]));e.out(o==="join"?"Checking access and downloading verified team context\u2026":"Checking read access and safe publishing\u2026"),(o==="join"?await e.clone(c.location,l,s):await e.add(i,c.location,s))!==0;){if(o==="join"&&y(l)){e.out(`The destination ${l} now exists after the interrupted attempt. Keep it; choose a new folder for a fresh download.`);do l=$(t,await p(e,"New download folder"));while(y(l))}let a=[u("retry","Retry this connection"),...c.kind==="s3"?[u("keys","Enter different keys")]:[],x,...o==="share"?[C]:[]],d=m(await e.choose("The connection did not finish. Your choices are kept; fix the reported issue and retry.",a));d==="keys"&&(s=await k(e)),(d==="change"||d==="storage")&&(d==="storage"&&(n=void 0),c=await h(),s=c.kind==="s3"?await k(e):void 0)}if(o==="join")e.out(`Team context downloaded into ${l}. Your previous local files were not replaced.`),e.out("Next: open that folder and run kane-cli context sync status.");else{let r=e.access(i);e.out(`Connected to ${c.gitUrl??c.path??c.location}. ${r==="write"?"You can download and publish changes.":"You can download context, but cannot publish changes."}`),e.out("Your context has not been uploaded yet."),e.out(r==="write"?`When ready, publish with kane-cli context push ${i}. This shares your context records and their referenced source documents with everyone who can read the location.`:"Ask the location owner for write access before publishing, then check the connection again."),e.out(`Share this location with teammates: ${H(c)}`),e.out(K(c))}return 0}catch(o){return o instanceof w?(e.out("Setup left. Your context has not been published. Any completed connection checks remain in the location."),3):(e.out(o instanceof Error?o.message:"Setup could not finish."),2)}}async function q(e,t=!1){return new Promise(o=>{let n=D("gh",e,{stdio:t?"inherit":["ignore","pipe","pipe"],windowsHide:!0}),h="";n.stdout?.on("data",s=>{h.length<64e3&&(h+=String(s))}),n.stderr?.on("data",()=>{});let c=setTimeout(()=>n.kill("SIGKILL"),t?3e5:2e4);n.on("error",()=>{clearTimeout(c),o({code:1,text:"GitHub CLI is unavailable"})}),n.on("close",s=>{clearTimeout(c),o({code:s??1,text:h})})})}async function ie(e,t=L(),o=process.cwd()){if(e.mode&&e.mode!=="interactive"||!G())return Y(R(e,t),t,new A("TTY_REQUIRED","guided setup needs an interactive terminal; for automation use kane-cli context sync add <name> <location> or kane-cli context clone <location> <new-folder>","run kane-cli context sync setup in a terminal"),2);let{promptSetup:n}=await import("./sync-setup-ui-RC727VK6.js"),h=(s,i)=>i(s?{credentials:s}:{}),c=async s=>{let i=[],l=await s({...t,out:r=>i.push(r),err:r=>i.push(r)});if(l!==0)for(let r of i){if(r.startsWith("next: ")||r.startsWith("checking "))continue;let a=r.startsWith("error: ")?r.slice(7):r,d=/^([a-z][a-z0-9+.-]*:\/\/|[a-z0-9._-]+@[a-z0-9.-]+[:/]|[\/~.])/i.test(a);t.out(/^[a-z]/.test(a)&&!d?a.charAt(0).toUpperCase()+a.slice(1)+(/[.!?]$/.test(a)?"":"."):a)}return l};return J({out:t.out,choose:(s,i)=>n({title:s,choices:i}),input:(s,i,l)=>n({title:s,initial:i,secret:l}),open:async s=>{let{default:i}=await import("./open-MQLQKFAW.js");await i(s)},checkGit:()=>O(),gitRead:async s=>{try{let i=await T(["ls-remote",s],{timeout:2e4});return{ok:i.code===0,diagnostic:i.stderr}}catch(i){return{ok:!1,diagnostic:i instanceof Error?i.message:String(i)}}},gh:q,add:(s,i,l)=>h(l,r=>c(a=>_(s,i,r,a,o))),clone:(s,i,l)=>h(l,r=>c(a=>N(s,i,r,a,o))),access:s=>I(f(o)).entries[s]?.tier===1?"write":"read"},o)}export{J as runSetup,ie as setupCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{f as a}from"./chunk-FBRTUEAL.js";import"./chunk-3MSXQU2C.js";import"./chunk-2HFNP2LM.js";import"./chunk-6C35NKQ7.js";import"./chunk-JQ3JB5CO.js";import"./chunk-RFDL7MHI.js";import"./chunk-PLIQ72LH.js";import"./chunk-46U7TRPE.js";import"./chunk-BNC4DJCC.js";import"./chunk-NUYGWRB2.js";import"./chunk-CBUSNWHA.js";import"./chunk-5D6YMG63.js";import"./chunk-MXI5P373.js";import"./chunk-T2ONUKTL.js";import"./chunk-66MOZKD2.js";import"./chunk-YLQHY4A7.js";import"./chunk-BPDFI2DC.js";import"./chunk-R43ELADV.js";import"./chunk-XQNJSM5C.js";import"./chunk-WD52ZNQY.js";import"./chunk-OBB57E2L.js";import"./chunk-SB5XM4YV.js";import"./chunk-44NNFVCJ.js";import"./chunk-3MWLFHPO.js";import"./chunk-Z2XKFYMH.js";import"./chunk-5Y2G4NC7.js";import"./chunk-I4SO2FQV.js";import"./chunk-XFQLR6MF.js";import"./chunk-BHSHGWBL.js";import"./chunk-S3DAAAE5.js";import"./chunk-DF4EBXGN.js";import"./chunk-26HZJJN6.js";import"./chunk-W3USRQX6.js";import"./chunk-BPYRVV7O.js";import"./chunk-WHNF5SWS.js";import"./chunk-AACQE24F.js";import"./chunk-5TQIKRKP.js";import"./chunk-5GUD3CIH.js";import"./chunk-WJR2FU7S.js";import"./chunk-WESMQEPO.js";import"./chunk-EHN5HTUD.js";import"./chunk-RGRFL7XG.js";import"./chunk-VVOKM2VO.js";import"./chunk-YFQGOOF7.js";import"./chunk-BL5QHONU.js";import"./chunk-IICT4VOU.js";import"./chunk-D6E6KRVX.js";import"./chunk-3UI5VTQS.js";import"./chunk-CH273NAE.js";import"./chunk-QV445GUU.js";import"./chunk-3NMXXTHE.js";import"./chunk-FR3LVUAB.js";import"./chunk-TDPWFYTJ.js";import"./chunk-GYLMH2EX.js";import"./chunk-JQ64X2TO.js";import"./chunk-6MCQ2UKE.js";import"./chunk-NAWGHDA3.js";import"./chunk-XKYL4K4A.js";import"./chunk-NBXYL2JT.js";import"./chunk-ODU2JSMA.js";import"./chunk-VZ7KXRXB.js";import"./chunk-ZLWURCJ7.js";import"./chunk-QSCXXNC2.js";import"./chunk-2YEHV2CX.js";import"./chunk-5LJRZI7S.js";import"./chunk-BKM2LWU2.js";import"./chunk-CE23VDW5.js";import"./chunk-PUFZTE6L.js";import"./chunk-RDHWNSDP.js";import"./chunk-FQNQVC5O.js";import"./chunk-XLSOQLVT.js";import"./chunk-UD7KKHPW.js";import"./chunk-ADBOWRMW.js";import"./chunk-RUSRN7YE.js";import"./chunk-JHBNXTG6.js";import"./chunk-ZUJGYHZ2.js";import"./chunk-YCCUBQY4.js";import"./chunk-4VW3B7SE.js";import"./chunk-O4LJWUSJ.js";import"./chunk-2KVECC36.js";import"./chunk-VE3SUJMA.js";import"./chunk-P37ALET7.js";import"./chunk-RFHMDQXZ.js";import"./chunk-SREUA7YQ.js";import"./chunk-5BHB5D2C.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-JHYWNWS5.js";import"./chunk-MSGW4JDG.js";import"./chunk-TZXXJWHA.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-JPOFRYTX.js";import"./chunk-TAOHYWEO.js";import"./chunk-NMAPNJRY.js";import"./chunk-FDXDFZ7J.js";import"./chunk-2OIIXLXW.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-HKIBJDKE.js";import"./chunk-5FQYB5SM.js";import"./chunk-MHMEEA4S.js";import"./chunk-DHJSM5DT.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-E47GFYXA.js";import"./chunk-EYOCNMUM.js";import"./chunk-OT3VKXJX.js";import"./chunk-YFBJWIBU.js";import"./chunk-DZCJE77P.js";import"./chunk-SJZJ7ASF.js";import{a as o}from"./chunk-DFS4RMVP.js";import{a as t}from"./chunk-HCBYKLMW.js";import{c as n}from"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import{e as r}from"./chunk-UR6MHSHU.js";var e=r(t(),1);async function p(i){let c=i.scenarioLimit!==void 0||i.perScenarioLimit!==void 0?{scenarioLimit:i.scenarioLimit,perScenarioLimit:i.perScenarioLimit}:void 0,{waitUntilExit:m}=n((0,e.jsx)(o,{children:(0,e.jsx)(a,{initialChatMode:"generate",initialObjective:i.objective,initialGenerateLimits:c})}),{exitOnCtrlC:!1});await m()}export{p as runGenerate};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{e as a,f as b,g as c,h as d,i as e,j as f,k as g,l as h,m as i,n as j,o as k,p as l,q as m}from"./chunk-BPDFI2DC.js";import"./chunk-R43ELADV.js";import"./chunk-XQNJSM5C.js";import"./chunk-WD52ZNQY.js";import"./chunk-W3USRQX6.js";import"./chunk-GYLMH2EX.js";import"./chunk-6MCQ2UKE.js";import"./chunk-NAWGHDA3.js";import"./chunk-XKYL4K4A.js";import"./chunk-NBXYL2JT.js";import"./chunk-ODU2JSMA.js";import"./chunk-VZ7KXRXB.js";import"./chunk-CE23VDW5.js";import"./chunk-4VW3B7SE.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-2OIIXLXW.js";import"./chunk-HKIBJDKE.js";import"./chunk-5FQYB5SM.js";import"./chunk-MHMEEA4S.js";import"./chunk-DHJSM5DT.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-OT3VKXJX.js";import"./chunk-SJZJ7ASF.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{i as ExportError,c as assertOrgMatchOrExit,j as exportTestmd,b as metaMatchesOrg,a as readMetaIfExists,d as resolveCurrentOrgId,l as resolveSyncAuth,h as runDeleteAction,k as runExportAction,e as runListAction,f as runListTui,g as runStatusAction,m as runSyncAction};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f}from"./chunk-6MCQ2UKE.js";import"./chunk-NAWGHDA3.js";import"./chunk-XKYL4K4A.js";import"./chunk-NBXYL2JT.js";import"./chunk-ODU2JSMA.js";import"./chunk-VZ7KXRXB.js";import"./chunk-DHJSM5DT.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-SJZJ7ASF.js";import"./chunk-UR6MHSHU.js";export{a as buildBundleZip,c as runBundleSync,d as shouldSyncBundle,e as shouldSyncPersistedBundle,f as syncPersistedBundle,b as syncTestmdBundle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-2KVECC36.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-UR6MHSHU.js";export{a as TmsClient};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-HKIBJDKE.js";import"./chunk-5FQYB5SM.js";import"./chunk-MHMEEA4S.js";import"./chunk-RZ4F3BHX.js";import"./chunk-SJZJ7ASF.js";import"./chunk-UR6MHSHU.js";export{a as refreshOAuthToken};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as t}from"./chunk-
|
|
2
|
+
import{a as t}from"./chunk-MHMEEA4S.js";import"./chunk-SJZJ7ASF.js";import"./chunk-UR6MHSHU.js";async function l(n,o,r){let{ControllerClient:e}=await import("./controller-client-ZF5IXRUV.js");await new e(t(n).controllerBaseUrl,{username:o,accessKey:r}).getTmsCredentials()}export{l as validateBasicAuth};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c}from"./chunk-NUYGWRB2.js";import"./chunk-CBUSNWHA.js";import"./chunk-XKYL4K4A.js";import"./chunk-SJZJ7ASF.js";import"./chunk-UR6MHSHU.js";export{b as formatUnresolvedReceipt,a as suggestedVariablesFile,c as unresolvedVariablesEvent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-REPKBN7I.js";import"./chunk-I7TIGB7K.js";import"./chunk-E2KV4BQB.js";import"./chunk-BB2W35TW.js";import"./chunk-YKTYVJBN.js";import"./chunk-KDNNMU7Q.js";import"./chunk-VVOKM2VO.js";import"./chunk-IICT4VOU.js";import"./chunk-D6E6KRVX.js";import"./chunk-3UI5VTQS.js";import"./chunk-RDHWNSDP.js";import"./chunk-FQNQVC5O.js";import"./chunk-XLSOQLVT.js";import"./chunk-UD7KKHPW.js";import"./chunk-SJZJ7ASF.js";import"./chunk-UR6MHSHU.js";export{b as requiresBecause,a as reviewProtocolCtx,c as submitReview};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-
|
|
2
|
+
import{a,b,c,d}from"./chunk-LSRNUBIV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-SJZJ7ASF.js";import"./chunk-UR6MHSHU.js";export{d as checkForUpdate,b as compareVersions,c as getSeverity,a as getUpdateCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{Q as T}from"./chunk-SBSANJ2T.js";import"./chunk-6MTKXDTH.js";import"./chunk-H6TNBKGR.js";import"./chunk-66MOZKD2.js";import"./chunk-YLQHY4A7.js";import"./chunk-IPQAKIJO.js";import"./chunk-VVOKM2VO.js";import"./chunk-CH273NAE.js";import"./chunk-CAOZKSQ3.js";import"./chunk-VZ7KXRXB.js";import"./chunk-5LJRZI7S.js";import"./chunk-BKM2LWU2.js";import{z as V}from"./chunk-IICT4VOU.js";import"./chunk-D6E6KRVX.js";import"./chunk-3UI5VTQS.js";import{F as I}from"./chunk-RDHWNSDP.js";import"./chunk-FQNQVC5O.js";import{f,g as x}from"./chunk-XLSOQLVT.js";import"./chunk-UD7KKHPW.js";import"./chunk-YCCUBQY4.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-OWPQZP4C.js";import"./chunk-DFS4RMVP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";import{writeFileSync as ce,mkdirSync as pe}from"fs";import{tmpdir as ue}from"os";import{dirname as fe,join as ge}from"path";var F={DERIVES:"derivation",automates:"linkage",exercises:"mesh",verifies:"mesh",depends_on:"crosslink",reuses:"crosslink",belongs_to:"containment",scoped_to:"containment",annotates:"annotation"},re=(t,r)=>t===f.SOURCE?String(r.source_id??""):t===f.AC?String(r.text??""):t===f.STYLENOTE?String(r.statement??r.text??""):t===f.GAP?String(r.text??r.question??""):String(r.title??"");function H(t){let r=[];for(let[o,p]of t.nodeLabel){let g=t.getNode(o)?.content??{};r.push({cid:o,label:p,slug:p===f.SOURCE?String(g.source_id??""):t.displayNameOf?.(o)??t.nameOf.get(o)??o.slice(0,19),trust:t.trust.get(o)??"derived",fresh:t.stale(o),title:re(p,g),content:g,superseded:t.superseded.has(o)})}let e=new Map;for(let[o]of t.nodeLabel)for(let p of t.edgesFrom(o)){let g=`${p.type}|${p.src}|${p.dst}`,v=typeof p.props?.anchor=="string"?p.props.anchor:void 0,w=e.get(g);w?(w.count++,v&&w.anchors.push(v)):e.set(g,{key:g,type:p.type,family:F[p.type]??"mesh",src:p.src,dst:p.dst,count:1,anchors:v?[v]:[],container:F[p.type]==="containment"})}let s=[...e.values()],i={},l={trusted:0,derived:0,archived:0},d={fresh:0,stale:0,orphaned:0,superseded:0},a=0;for(let o of r)o.superseded||(a++,i[o.label]=(i[o.label]??0)+1,o.label!==f.SOURCE&&l[o.trust]++,d[o.fresh]++);return{nodes:r,edges:s,summary:{nodes:a,edges:s.reduce((o,p)=>o+p.count,0),byLabel:i,trust:l,fresh:d,usecases:i[f.USECASE]??0,designed:0}}}var P=/^([a-z]+)-(\d+)$/,E=(t,r)=>{let e=P.exec(t),s=P.exec(r);return e&&s&&e[1]===s[1]?Number(e[2])-Number(s[2]):t<r?-1:t>r?1:0};function se(t,r,e){let s=new Set,i=d=>{let a=e.nodeLabel.get(d);if(a===f.USECASE)s.add(d);else if(a===f.SCENARIO)for(let o of e.edgesFrom(d))o.type===x.BELONGS_TO&&s.add(o.dst)},l=e.edgesFrom(t);if(r===f.SCENARIO)for(let d of l)d.type===x.BELONGS_TO&&s.add(d.dst);if(r===f.AC)for(let d of l)d.type===x.SCOPED_TO&&i(d.dst);if(r===f.TEST)for(let d of l)d.type===x.AUTOMATES&&i(d.dst);return s}function G(t,r){let e=new Map,s=t.nodes.filter(a=>a.label===f.USECASE).map(a=>a.cid),i=s.map(a=>({ucCid:a,slug:r.nameOf.get(a)??a.slice(0,19),designed:r.designOf.has(a),nodeCids:[a]})).sort((a,o)=>E(a.slug,o.slug)),l={ucCid:"__shared__",slug:"cross-cutting",designed:!1,nodeCids:[]},d=new Map(i.map(a=>[a.ucCid,a]));for(let a of s)e.set(a,a);for(let a of t.nodes){if(a.label===f.SOURCE||a.label===f.USECASE)continue;let o=se(a.cid,a.label,r);if(o.size===1){let p=[...o][0];e.set(a.cid,p),d.get(p).nodeCids.push(a.cid)}else e.set(a.cid,"__shared__"),l.nodeCids.push(a.cid)}return{laneOf:e,lanes:[...i,l]}}var N={source:0,usecase:1,scenario:2,ac:3,test:4,stylenote:5,gap:5},ie=6,z=260,R=64,B=28;function U(t,r,e){let{lanes:s}=r,i=new Map(t.nodes.map(n=>[n.cid,n])),l=new Map,d=[],a=[],o=n=>{let m=n.map(h=>l.get(h)).filter(h=>h!==void 0);return m.length?m.reduce((h,S)=>h+S,0)/m.length:Number.MAX_SAFE_INTEGER},p=s.filter(n=>n.ucCid!=="__shared__"||n.nodeCids.length>0),g=t.nodes.filter(n=>n.label===f.SOURCE).sort((n,m)=>E(n.slug,m.slug)),v=0;for(let n of p){let m=n.nodeCids.map(c=>i.get(c)).filter(Boolean),h=c=>m.filter(u=>u.label===c),S=h(f.USECASE).sort((c,u)=>E(c.slug,u.slug));S.forEach((c,u)=>l.set(c.cid,u));let D=h(f.SCENARIO).sort((c,u)=>E(c.slug,u.slug));D.forEach((c,u)=>l.set(c.cid,u));let M=h(f.AC).sort((c,u)=>{let _=o(e.edgesInto(c.cid).filter(b=>b.type===x.EXERCISES).map(b=>b.src)),O=o(e.edgesInto(u.cid).filter(b=>b.type===x.EXERCISES).map(b=>b.src));return _-O||E(c.slug,u.slug)});M.forEach((c,u)=>l.set(c.cid,u));let j=h(f.TEST).sort((c,u)=>{let _=o(e.edgesFrom(c.cid).filter(b=>b.type===x.VERIFIES).map(b=>b.dst)),O=o(e.edgesFrom(u.cid).filter(b=>b.type===x.VERIFIES).map(b=>b.dst));return _-O||E(c.slug,u.slug)});j.forEach((c,u)=>l.set(c.cid,u));let q=m.filter(c=>N[c.label]===void 0||N[c.label]>=5).sort((c,u)=>E(c.slug,u.slug));q.forEach((c,u)=>l.set(c.cid,u));let A=Math.max(1,S.length,D.length,M.length,j.length,q.length)*R+B;for(let c of m){let u=N[c.label]??4,_=l.get(c.cid)??0;d.push({...c,lane:n.ucCid,col:u,x:u*z,y:v+B/2+_*R})}a.push({...n,y0:v,y1:v+A}),v+=A}let w=Math.max(v,R);g.forEach((n,m)=>d.push({...n,lane:"__spine__",col:0,x:0,y:w/(g.length+1)*(m+1)}));let L=ie*z;return{nodes:d,lanes:a,width:L,height:w}}function ae(t){return t.design_of?"design":t.review.length>0?"review":t.nodes.some(r=>r.label==="source")?"ingest":t.nodes.length>0?"extract":"other"}function $(t){let r=new Map,e=new Map,s=[];for(let i of t){for(let n of i.nodes)r.has(n.cid)||r.set(n.cid,i.seq);let l=new Map(e);for(let n of i.nodes)n.content?.derived===!0&&!e.has(n.cid)&&e.set(n.cid,"derived");for(let n of i.review)n.resolution==="approved"||n.resolution==="edited"?e.set(n.id,"trusted"):n.resolution==="rejected"?e.set(n.id,"archived"):n.resolution==="reset"&&e.set(n.id,"derived");let d=n=>{let m=0;for(let[h,S]of e)S===n&&l.get(h)!==n&&m++;return m},a=0;for(let[n,m]of e){let h=l.get(n);m==="derived"&&(h==="trusted"||h==="archived")&&a++}let o={trusted:d("trusted"),archived:d("archived"),reset:a},p=ae(i),g=i.nodes.map(n=>n.cid),v=i.edges.map(n=>`${n.type}|${n.src}|${n.dst}`),w=i.review.map(n=>n.id),L=p==="review"?"review \xB7 +"+o.trusted+" trusted"+(o.archived?", +"+o.archived+" archived":""):p+" \xB7 +"+g.length+" nodes";s.push({seq:i.seq,ts:i.ts,kind:p,label:L,mintedNodeCids:g,mintedEdgeKeys:v,reviewedNodeCids:w,trustDelta:o})}return{commits:s,bornSeq:r}}function Y(t,r,e){let s=[];for(let i of t){i.nodes.some(l=>l.cid===r)&&s.push({seq:i.seq,ts:i.ts,kind:"minted",detail:"minted here"});for(let l of i.review)l.id===r&&s.push({seq:i.seq,ts:i.ts,kind:"review",detail:l.resolution+(l.reason?": "+l.reason:"")})}return e.length&&s.push({seq:0,ts:"",kind:"derived_from",detail:"source lines "+e.join(", ")}),s}var oe={"&":"&","<":"<",">":">",'"':""","'":"'"};function k(t){return String(t).replace(/[&<>"']/g,r=>oe[r])}var W=t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"),de=new RegExp("[\u2028\u2029]","g");function X(t){return t.replace(/[<>&]/g,W).replace(de,W)}var K=t=>t.replace("sha256:","").slice(0,12);function J(t){if(!t||typeof t!="object")return"";let r=String(t.operator??""),e=t.operand!=null?String(t.operand):"",s=t.unit!=null?" "+String(t.unit):"",i=t.baseline!=null?String(t.baseline):"",l=t.within&&typeof t.within=="object"?t.within:null,d;switch(r){case"exists":d="exists: "+e;break;case"forall":d="for all "+e;break;case"contains":d="contains "+e;break;case"gte":d=">= "+e+s;break;case"lte":d="<= "+e+s;break;case"equals":d="= "+e+s+(i?" (was "+i+")":"");break;case"changed-by":d="changed by "+e+s;break;default:d=(r+" "+e+s).trim()}if(l){let a=l.threshold!=null?String(l.threshold):"",o=l.unit!=null?String(l.unit):"";(a||o)&&(d+=" within "+a+o)}return d.trim()}var C=t=>t==null||t===""?"":`<span class="chip">${k(t)}</span>`,y=(t,r)=>r==null||r===""?"":`<div class="kv"><span class="k">${k(t)}</span><span class="v">${k(r)}</span></div>`,le=t=>Array.isArray(t)&&t.length?`<ul class="crit">${t.map(r=>`<li>${k(r)}</li>`).join("")}</ul>`:"";function Q(t,r){let e=r??{};switch(t){case"usecase":return[y("description",e.description),y("value",e.value),[C(e.risk?"risk: "+e.risk:""),...Array.isArray(e.actors)?e.actors.map(s=>C(s)):[]].join(""),le(e.criteria)].join("");case"scenario":return[y("intent",e.intent),[C(e.case_type)].join(""),e.parameters&&typeof e.parameters=="object"?Object.entries(e.parameters).map(([s,i])=>y(s,i)).join(""):"",y("techniques",e.technique_notes)].join("");case"ac":return[y("",e.text),[C(e.kind),C(e.risk?"risk: "+e.risk:"")].join(""),(()=>{let s=J(e.expected_answer);return s?`<div class="pred">${k(s)}</div>`:""})()].join("");case"test":{let s=J(e.check),i=e.test_md_blob!=null?`<pre class="md">${k(String(e.test_md_blob))}</pre>`:"";return[s?`<div class="pred">${k(s)}</div>`:"",y("definitionId",e.definitionId),i].join("")}case"source":return[y("source_id",e.source_id),y("blob",e.blob)].join("");case"stylenote":return[e.statement?`<div class="pred">${k(e.statement)}</div>`:"",[C(e.learned_from_kind?"learned from: "+e.learned_from_kind:"")].join(""),y("",e.text),Array.isArray(e.tags)?e.tags.map(s=>C(s)).join(""):""].join("");case"gap":return[y("",e.text??e.question),[C(e.kind),C(e.risk?"risk: "+e.risk:"")].join(""),y("why",e.risk_rationale),y("ref",e.ref)].join("");default:return""}}function Z(t,r,e,s){let i=H(t),l=G(i,t),d=U(i,l,t),{commits:a}=$(r);i.summary.designed=l.lanes.filter(n=>n.designed&&n.ucCid!=="__shared__").length;let o={},p={};for(let n of i.nodes){o[n.cid]=Q(n.label,n.content);let m=t.edgesInto(n.cid).filter(h=>h.type===x.DERIVES&&typeof h.props?.anchor=="string").map(h=>h.props.anchor);p[n.cid]=Y(r,n.cid,m)}let g=d.nodes.map(n=>({cid:n.cid,slug:n.slug,label:n.label,trust:n.trust,fresh:n.fresh,title:n.title,superseded:n.superseded,lane:n.lane,col:n.col,x:n.x,y:n.y})),v=d.lanes.map(n=>({ucCid:n.ucCid,slug:n.slug,designed:n.designed,y0:n.y0,y1:n.y1})),L=i.nodes.some(n=>n.label===f.SOURCE)?{}:void 0;return{meta:{fromSeq:r[0]?.seq??0,tipHash:e[e.length-1]??null,storePath:s,schema:"assurance/context@1",asOf:r[r.length-1]?.ts??null},summary:i.summary,lanes:v,nodes:g,edges:i.edges,commits:a,lineage:p,contentHtml:o,width:d.width,height:d.height,source:L}}var ee="__PAYLOAD__",te=`<!doctype html>
|
|
2
|
+
import{Q as T}from"./chunk-5D6YMG63.js";import"./chunk-MXI5P373.js";import"./chunk-T2ONUKTL.js";import"./chunk-66MOZKD2.js";import"./chunk-YLQHY4A7.js";import"./chunk-RGRFL7XG.js";import"./chunk-VVOKM2VO.js";import{z as V}from"./chunk-IICT4VOU.js";import"./chunk-D6E6KRVX.js";import"./chunk-3UI5VTQS.js";import"./chunk-CH273NAE.js";import"./chunk-ODU2JSMA.js";import"./chunk-VZ7KXRXB.js";import"./chunk-5LJRZI7S.js";import"./chunk-BKM2LWU2.js";import{F as I}from"./chunk-RDHWNSDP.js";import"./chunk-FQNQVC5O.js";import{f,g as x}from"./chunk-XLSOQLVT.js";import"./chunk-UD7KKHPW.js";import"./chunk-YCCUBQY4.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-SJZJ7ASF.js";import"./chunk-DFS4RMVP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";import{writeFileSync as ce,mkdirSync as pe}from"fs";import{tmpdir as ue}from"os";import{dirname as fe,join as ge}from"path";var F={DERIVES:"derivation",automates:"linkage",exercises:"mesh",verifies:"mesh",depends_on:"crosslink",reuses:"crosslink",belongs_to:"containment",scoped_to:"containment",annotates:"annotation"},re=(t,r)=>t===f.SOURCE?String(r.source_id??""):t===f.AC?String(r.text??""):t===f.STYLENOTE?String(r.statement??r.text??""):t===f.GAP?String(r.text??r.question??""):String(r.title??"");function H(t){let r=[];for(let[o,p]of t.nodeLabel){let g=t.getNode(o)?.content??{};r.push({cid:o,label:p,slug:p===f.SOURCE?String(g.source_id??""):t.displayNameOf?.(o)??t.nameOf.get(o)??o.slice(0,19),trust:t.trust.get(o)??"derived",fresh:t.stale(o),title:re(p,g),content:g,superseded:t.superseded.has(o)})}let e=new Map;for(let[o]of t.nodeLabel)for(let p of t.edgesFrom(o)){let g=`${p.type}|${p.src}|${p.dst}`,v=typeof p.props?.anchor=="string"?p.props.anchor:void 0,w=e.get(g);w?(w.count++,v&&w.anchors.push(v)):e.set(g,{key:g,type:p.type,family:F[p.type]??"mesh",src:p.src,dst:p.dst,count:1,anchors:v?[v]:[],container:F[p.type]==="containment"})}let s=[...e.values()],i={},l={trusted:0,derived:0,archived:0},d={fresh:0,stale:0,orphaned:0,superseded:0},a=0;for(let o of r)o.superseded||(a++,i[o.label]=(i[o.label]??0)+1,o.label!==f.SOURCE&&l[o.trust]++,d[o.fresh]++);return{nodes:r,edges:s,summary:{nodes:a,edges:s.reduce((o,p)=>o+p.count,0),byLabel:i,trust:l,fresh:d,usecases:i[f.USECASE]??0,designed:0}}}var P=/^([a-z]+)-(\d+)$/,E=(t,r)=>{let e=P.exec(t),s=P.exec(r);return e&&s&&e[1]===s[1]?Number(e[2])-Number(s[2]):t<r?-1:t>r?1:0};function se(t,r,e){let s=new Set,i=d=>{let a=e.nodeLabel.get(d);if(a===f.USECASE)s.add(d);else if(a===f.SCENARIO)for(let o of e.edgesFrom(d))o.type===x.BELONGS_TO&&s.add(o.dst)},l=e.edgesFrom(t);if(r===f.SCENARIO)for(let d of l)d.type===x.BELONGS_TO&&s.add(d.dst);if(r===f.AC)for(let d of l)d.type===x.SCOPED_TO&&i(d.dst);if(r===f.TEST)for(let d of l)d.type===x.AUTOMATES&&i(d.dst);return s}function G(t,r){let e=new Map,s=t.nodes.filter(a=>a.label===f.USECASE).map(a=>a.cid),i=s.map(a=>({ucCid:a,slug:r.nameOf.get(a)??a.slice(0,19),designed:r.designOf.has(a),nodeCids:[a]})).sort((a,o)=>E(a.slug,o.slug)),l={ucCid:"__shared__",slug:"cross-cutting",designed:!1,nodeCids:[]},d=new Map(i.map(a=>[a.ucCid,a]));for(let a of s)e.set(a,a);for(let a of t.nodes){if(a.label===f.SOURCE||a.label===f.USECASE)continue;let o=se(a.cid,a.label,r);if(o.size===1){let p=[...o][0];e.set(a.cid,p),d.get(p).nodeCids.push(a.cid)}else e.set(a.cid,"__shared__"),l.nodeCids.push(a.cid)}return{laneOf:e,lanes:[...i,l]}}var N={source:0,usecase:1,scenario:2,ac:3,test:4,stylenote:5,gap:5},ie=6,z=260,R=64,B=28;function U(t,r,e){let{lanes:s}=r,i=new Map(t.nodes.map(n=>[n.cid,n])),l=new Map,d=[],a=[],o=n=>{let m=n.map(h=>l.get(h)).filter(h=>h!==void 0);return m.length?m.reduce((h,S)=>h+S,0)/m.length:Number.MAX_SAFE_INTEGER},p=s.filter(n=>n.ucCid!=="__shared__"||n.nodeCids.length>0),g=t.nodes.filter(n=>n.label===f.SOURCE).sort((n,m)=>E(n.slug,m.slug)),v=0;for(let n of p){let m=n.nodeCids.map(c=>i.get(c)).filter(Boolean),h=c=>m.filter(u=>u.label===c),S=h(f.USECASE).sort((c,u)=>E(c.slug,u.slug));S.forEach((c,u)=>l.set(c.cid,u));let D=h(f.SCENARIO).sort((c,u)=>E(c.slug,u.slug));D.forEach((c,u)=>l.set(c.cid,u));let M=h(f.AC).sort((c,u)=>{let _=o(e.edgesInto(c.cid).filter(b=>b.type===x.EXERCISES).map(b=>b.src)),O=o(e.edgesInto(u.cid).filter(b=>b.type===x.EXERCISES).map(b=>b.src));return _-O||E(c.slug,u.slug)});M.forEach((c,u)=>l.set(c.cid,u));let j=h(f.TEST).sort((c,u)=>{let _=o(e.edgesFrom(c.cid).filter(b=>b.type===x.VERIFIES).map(b=>b.dst)),O=o(e.edgesFrom(u.cid).filter(b=>b.type===x.VERIFIES).map(b=>b.dst));return _-O||E(c.slug,u.slug)});j.forEach((c,u)=>l.set(c.cid,u));let q=m.filter(c=>N[c.label]===void 0||N[c.label]>=5).sort((c,u)=>E(c.slug,u.slug));q.forEach((c,u)=>l.set(c.cid,u));let A=Math.max(1,S.length,D.length,M.length,j.length,q.length)*R+B;for(let c of m){let u=N[c.label]??4,_=l.get(c.cid)??0;d.push({...c,lane:n.ucCid,col:u,x:u*z,y:v+B/2+_*R})}a.push({...n,y0:v,y1:v+A}),v+=A}let w=Math.max(v,R);g.forEach((n,m)=>d.push({...n,lane:"__spine__",col:0,x:0,y:w/(g.length+1)*(m+1)}));let L=ie*z;return{nodes:d,lanes:a,width:L,height:w}}function ae(t){return t.design_of?"design":t.review.length>0?"review":t.nodes.some(r=>r.label==="source")?"ingest":t.nodes.length>0?"extract":"other"}function $(t){let r=new Map,e=new Map,s=[];for(let i of t){for(let n of i.nodes)r.has(n.cid)||r.set(n.cid,i.seq);let l=new Map(e);for(let n of i.nodes)n.content?.derived===!0&&!e.has(n.cid)&&e.set(n.cid,"derived");for(let n of i.review)n.resolution==="approved"||n.resolution==="edited"?e.set(n.id,"trusted"):n.resolution==="rejected"?e.set(n.id,"archived"):n.resolution==="reset"&&e.set(n.id,"derived");let d=n=>{let m=0;for(let[h,S]of e)S===n&&l.get(h)!==n&&m++;return m},a=0;for(let[n,m]of e){let h=l.get(n);m==="derived"&&(h==="trusted"||h==="archived")&&a++}let o={trusted:d("trusted"),archived:d("archived"),reset:a},p=ae(i),g=i.nodes.map(n=>n.cid),v=i.edges.map(n=>`${n.type}|${n.src}|${n.dst}`),w=i.review.map(n=>n.id),L=p==="review"?"review \xB7 +"+o.trusted+" trusted"+(o.archived?", +"+o.archived+" archived":""):p+" \xB7 +"+g.length+" nodes";s.push({seq:i.seq,ts:i.ts,kind:p,label:L,mintedNodeCids:g,mintedEdgeKeys:v,reviewedNodeCids:w,trustDelta:o})}return{commits:s,bornSeq:r}}function Y(t,r,e){let s=[];for(let i of t){i.nodes.some(l=>l.cid===r)&&s.push({seq:i.seq,ts:i.ts,kind:"minted",detail:"minted here"});for(let l of i.review)l.id===r&&s.push({seq:i.seq,ts:i.ts,kind:"review",detail:l.resolution+(l.reason?": "+l.reason:"")})}return e.length&&s.push({seq:0,ts:"",kind:"derived_from",detail:"source lines "+e.join(", ")}),s}var oe={"&":"&","<":"<",">":">",'"':""","'":"'"};function k(t){return String(t).replace(/[&<>"']/g,r=>oe[r])}var W=t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"),de=new RegExp("[\u2028\u2029]","g");function X(t){return t.replace(/[<>&]/g,W).replace(de,W)}var K=t=>t.replace("sha256:","").slice(0,12);function J(t){if(!t||typeof t!="object")return"";let r=String(t.operator??""),e=t.operand!=null?String(t.operand):"",s=t.unit!=null?" "+String(t.unit):"",i=t.baseline!=null?String(t.baseline):"",l=t.within&&typeof t.within=="object"?t.within:null,d;switch(r){case"exists":d="exists: "+e;break;case"forall":d="for all "+e;break;case"contains":d="contains "+e;break;case"gte":d=">= "+e+s;break;case"lte":d="<= "+e+s;break;case"equals":d="= "+e+s+(i?" (was "+i+")":"");break;case"changed-by":d="changed by "+e+s;break;default:d=(r+" "+e+s).trim()}if(l){let a=l.threshold!=null?String(l.threshold):"",o=l.unit!=null?String(l.unit):"";(a||o)&&(d+=" within "+a+o)}return d.trim()}var C=t=>t==null||t===""?"":`<span class="chip">${k(t)}</span>`,y=(t,r)=>r==null||r===""?"":`<div class="kv"><span class="k">${k(t)}</span><span class="v">${k(r)}</span></div>`,le=t=>Array.isArray(t)&&t.length?`<ul class="crit">${t.map(r=>`<li>${k(r)}</li>`).join("")}</ul>`:"";function Q(t,r){let e=r??{};switch(t){case"usecase":return[y("description",e.description),y("value",e.value),[C(e.risk?"risk: "+e.risk:""),...Array.isArray(e.actors)?e.actors.map(s=>C(s)):[]].join(""),le(e.criteria)].join("");case"scenario":return[y("intent",e.intent),[C(e.case_type)].join(""),e.parameters&&typeof e.parameters=="object"?Object.entries(e.parameters).map(([s,i])=>y(s,i)).join(""):"",y("techniques",e.technique_notes)].join("");case"ac":return[y("",e.text),[C(e.kind),C(e.risk?"risk: "+e.risk:"")].join(""),(()=>{let s=J(e.expected_answer);return s?`<div class="pred">${k(s)}</div>`:""})()].join("");case"test":{let s=J(e.check),i=e.test_md_blob!=null?`<pre class="md">${k(String(e.test_md_blob))}</pre>`:"";return[s?`<div class="pred">${k(s)}</div>`:"",y("definitionId",e.definitionId),i].join("")}case"source":return[y("source_id",e.source_id),y("blob",e.blob)].join("");case"stylenote":return[e.statement?`<div class="pred">${k(e.statement)}</div>`:"",[C(e.learned_from_kind?"learned from: "+e.learned_from_kind:"")].join(""),y("",e.text),Array.isArray(e.tags)?e.tags.map(s=>C(s)).join(""):""].join("");case"gap":return[y("",e.text??e.question),[C(e.kind),C(e.risk?"risk: "+e.risk:"")].join(""),y("why",e.risk_rationale),y("ref",e.ref)].join("");default:return""}}function Z(t,r,e,s){let i=H(t),l=G(i,t),d=U(i,l,t),{commits:a}=$(r);i.summary.designed=l.lanes.filter(n=>n.designed&&n.ucCid!=="__shared__").length;let o={},p={};for(let n of i.nodes){o[n.cid]=Q(n.label,n.content);let m=t.edgesInto(n.cid).filter(h=>h.type===x.DERIVES&&typeof h.props?.anchor=="string").map(h=>h.props.anchor);p[n.cid]=Y(r,n.cid,m)}let g=d.nodes.map(n=>({cid:n.cid,slug:n.slug,label:n.label,trust:n.trust,fresh:n.fresh,title:n.title,superseded:n.superseded,lane:n.lane,col:n.col,x:n.x,y:n.y})),v=d.lanes.map(n=>({ucCid:n.ucCid,slug:n.slug,designed:n.designed,y0:n.y0,y1:n.y1})),L=i.nodes.some(n=>n.label===f.SOURCE)?{}:void 0;return{meta:{fromSeq:r[0]?.seq??0,tipHash:e[e.length-1]??null,storePath:s,schema:"assurance/context@1",asOf:r[r.length-1]?.ts??null},summary:i.summary,lanes:v,nodes:g,edges:i.edges,commits:a,lineage:p,contentHtml:o,width:d.width,height:d.height,source:L}}var ee="__PAYLOAD__",te=`<!doctype html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as ve}from"./chunk-Q4YYAN6E.js";import{c as he}from"./chunk-K2UJYY2U.js";import{k as ge}from"./chunk-3H3KTCL7.js";import{a as ie,c as ne,d as pe}from"./chunk-LKPOOZYN.js";import"./chunk-Q6AHSGOE.js";import"./chunk-LDPLJFCV.js";import{a as Z}from"./chunk-A2SQD2AY.js";import"./chunk-KJQNAOOE.js";import{a as re,b as ce,c as le,d as N,f as G,g as de,i as ue,k as me,l as fe}from"./chunk-WBH5GYFM.js";import{a as ee,b as te}from"./chunk-UJZZDPDY.js";import"./chunk-RKXHVP2Z.js";import{a as Y}from"./chunk-RRY5IXOB.js";import"./chunk-5ZFOKYFB.js";import"./chunk-BZAGVBCX.js";import"./chunk-FY7TCYPK.js";import"./chunk-LSDWPG6C.js";import"./chunk-KDNNMU7Q.js";import"./chunk-5D6YMG63.js";import{b as Q}from"./chunk-MXI5P373.js";import"./chunk-T2ONUKTL.js";import"./chunk-66MOZKD2.js";import"./chunk-YLQHY4A7.js";import"./chunk-5Y2G4NC7.js";import"./chunk-WESMQEPO.js";import"./chunk-RGRFL7XG.js";import"./chunk-VVOKM2VO.js";import{z as _}from"./chunk-IICT4VOU.js";import"./chunk-D6E6KRVX.js";import"./chunk-3UI5VTQS.js";import"./chunk-CH273NAE.js";import"./chunk-ODU2JSMA.js";import"./chunk-VZ7KXRXB.js";import"./chunk-5LJRZI7S.js";import"./chunk-BKM2LWU2.js";import"./chunk-RDHWNSDP.js";import"./chunk-FQNQVC5O.js";import"./chunk-XLSOQLVT.js";import"./chunk-UD7KKHPW.js";import{a as se}from"./chunk-YCCUBQY4.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import{y as h}from"./chunk-SJZJ7ASF.js";import"./chunk-DFS4RMVP.js";import{a as K}from"./chunk-HCBYKLMW.js";import{a as F,b as x,k as ae}from"./chunk-C44QQJR4.js";import{a as Ie}from"./chunk-6YGTRKDT.js";import{e as U}from"./chunk-UR6MHSHU.js";var R=U(Ie(),1);function ke(t){let v=t.by??{kind:"human",id:process.env.USER??"operator"},k=t.mode==="interactive"?"override":t.mode,A=k==="override"?{note:"override \xB7 auto-answers, won't ask"}:{},M=(r,n)=>ee(t.onChild,{verb:"design",subject:r,...A,fixCmd:`kane-cli design tests --use-case ${r}`},n,l=>({ok:l===0,exitCode:l})),P=(r,n,l)=>ee(t.onChild,{verb:"evolve",subject:r,...A,fixCmd:`kane-cli maintain evolve ${n}`},l,a=>({ok:a.outcome==="evolved",exitCode:a.code})),S={out:()=>{},err:()=>{},isTTY:!1,confirm:async()=>!0},u={applied:0,committed:0,retired:0,skipped:0,deferred:0,failed:0},w=new Map;for(let r of t.planRows)if(r.held_ref&&t.held){let n=t.held.rows.find(a=>a.temp_ref===r.held_ref);if(!n)continue;let l={kind:n.kind,ref:n.temp_ref,title:n.title,why:n.why,origin:"content-change",...r.impact?{impact:r.impact}:{}};w.set(l.ref,{card:l,source:"held",heldRef:n.temp_ref})}else if(r.kind==="MODIFY"){let n={kind:"MODIFY",ref:r.ref,title:r.ref,why:`${r.reason}: ${r.provenance}`,origin:r.origin??"structural-stale",...r.impact?{impact:r.impact}:{}};w.set(n.ref,{card:n,source:"row",row:r})}else if(r.kind==="ADD"){let n={kind:"ADD",ref:r.ref,title:r.ref,why:r.reason,origin:r.origin??"content-change"};w.set(n.ref,{card:n,source:"row",row:r})}for(let r of t.archive){if(r.kind!=="ARCHIVE")continue;let n={kind:"ARCHIVE",ref:r.ref,title:r.ref,why:r.why,provenance:r.why,...r.impact?{impact:r.impact}:{}};w.set(n.ref,{card:n,source:"archive",row:r})}for(let r of t.reviewFeeder?.()??[]){if(w.has(r.ref))continue;let n={kind:r.kind==="MODIFY_HELD"?"MODIFY":r.kind,ref:r.ref,title:r.title,why:r.why,...r.impact?{impact:r.impact}:{},...r.pair?{pair:r.pair}:{},...r.held?{held:!0}:{},...r.kind==="MODIFY_HELD"?{heldPayload:!0}:{}};w.set(n.ref,{card:n,source:"review",reviewCard:r})}let y=r=>(u.failed++,{outcome:"failed",detail:r});return{cards:()=>[...w.values()].map(r=>r.card),async submit(r,n){let l=w.get(r);if(!l)return y(`no card ${r}`);if(l.source==="review"){if(l.reviewCard.kind==="PAIR"&&n.v==="approve")return y(`${r} is a PAIR card \u2014 approve is not in its grammar (merge / keep both / defer); words ride a defer note`);let{submitReview:s}=await import("./verdicts-VPTU4YAS.js"),b=n.v==="approve"?{v:"approve"}:n.v==="archive"?{v:"archive",because:n.because??""}:n.v==="skip"&&l.reviewCard.kind==="MODIFY_HELD"?{v:"keep_current"}:n.v==="defer"||n.v==="skip"?{v:"defer"}:n.v==="merge"?{v:"merge"}:{v:"keep_both"},g=await s({contextDir:t.contextDir,signals:o=>t.signals({ref:o.ref,verdict:o.verdict,...o.reason?{reason:o.reason}:{}})},l.reviewCard,b,v);return g.outcome==="failed"?(u.failed++,g):g.outcome==="deferred"?(u.deferred++,n.v==="defer"&&n.note?(t.signals({ref:r,verdict:"deferred-with-note",reason:n.note}),{...g,detail:`steering noted: "${n.note}" \u2014 decide ${l.reviewCard.kind==="PAIR"?"merge / keep both":"the verdict"} when it re-offers`}):g):g.outcome==="retired"?(u.retired++,g):g.outcome==="committed"?(u.committed++,g):(u.applied++,g)}if(n.v==="merge"||n.v==="keep_both")return y(`${r} is a ${l.card.kind} card \u2014 ${n.v} applies to review cards only`);if(n.v==="skip")return u.skipped++,t.signals({ref:r,verdict:"gap-dismissed"}),{outcome:"skipped"};if(n.v==="defer")return u.deferred++,n.note?(t.signals({ref:r,verdict:"deferred-with-note",reason:n.note}),{outcome:"deferred",detail:`steering noted: "${n.note}"`}):{outcome:"deferred"};if(n.v==="archive"){if(l.source!=="archive")return y(`${r} is not an ARCHIVE card`);let s=_(t.contextDir),b=s.resolve(l.row.ref);if(b&&s.superseded.has(s.tipOf(b.cid)))return u.skipped++,{outcome:"skipped",detail:"already retired \u2014 nothing to do"};let g=ve(t.contextDir,_(t.contextDir),{ref:l.row.ref,reason:`reconcile retire: ${l.row.why}`,by:v});return g.errors?y(g.errors.map(o=>`${o.code}: ${o.detail}`).join("; ")):(u.retired++,t.signals({ref:r,verdict:"gap-resolved-archive",reason:l.row.why}),{outcome:"retired"})}if(l.source==="archive")return y(`${r} takes archive/skip/defer, not approve`);if(l.source==="held"){let s=ge(t.contextDir,t.held,l.heldRef,v,n.edits);if(!s.ok)return y(s.message);if(s.kind==="ADD"){let b=await M(s.ref,()=>t.runDesign(s.ref,{yes:!0,mode:k,...n.steering?{because:n.steering}:{}}));return b!==0?(u.failed++,{outcome:"failed",landed:!0,detail:`committed ${s.ref}, but its design run exited ${b} \u2014 finish with kane-cli design tests --use-case ${s.ref}`}):(u.applied++,t.signals({ref:r,verdict:"gap-resolved-create",...n.steering?{reason:n.steering}:{}}),{outcome:"applied",detail:s.ref})}if(n.steering){let b=_(t.contextDir),g=ie(b,s.ref);if(!g.ok)return u.committed++,{outcome:"committed",detail:`committed ${s.ref}, but steering could not resolve it (${g.message}) \u2014 steer via kane-cli maintain evolve ${s.ref}`};let o=await P(g.target.display,s.ref,()=>ne(t.contextDir,g.target,{yes:!0,mode:k,because:n.steering},S,t.runDesign,"batch"));if(o.outcome==="no-design"){let c=await M(g.target.seamRef,()=>t.runDesign(g.target.seamRef,{yes:!0,mode:k,because:n.steering}));return c!==0?(u.failed++,{outcome:"failed",landed:!0,detail:`committed ${s.ref}, but its steered design run exited ${c} \u2014 finish with kane-cli design tests --use-case ${g.target.seamRef}`}):(u.applied++,t.signals({ref:r,verdict:"gap-resolved-create",reason:n.steering}),{outcome:"applied",detail:s.ref})}return o.outcome==="failed"||o.outcome==="paused"?(u.failed++,{outcome:"failed",landed:!0,detail:`committed ${s.ref}, but the steering evolve ${o.outcome} (exit ${o.code}) \u2014 finish with kane-cli maintain evolve ${s.ref}`}):o.outcome==="declined"?(u.committed++,{outcome:"committed",detail:`committed ${s.ref} \u2014 the steering evolve was declined; re-run kane-cli maintain evolve ${s.ref}`}):(u.applied++,t.signals({ref:r,verdict:"gap-resolved-evolve",reason:n.steering}),{outcome:"applied",detail:s.ref})}return u.committed++,t.signals({ref:r,verdict:"gap-resolved-evolve"}),{outcome:"committed",detail:s.ref}}let a=_(t.contextDir),d=ie(a,l.row.ref);if(!d.ok)return y(d.message);if(l.card.kind==="ADD"){let s=await M(d.target.seamRef,()=>t.runDesign(d.target.seamRef,{yes:!0,mode:k}));return s!==0?y(`design run exited ${s}`):(u.applied++,t.signals({ref:r,verdict:"gap-resolved-create"}),{outcome:"applied"})}let D=await P(d.target.display,l.row.ref,()=>ne(t.contextDir,d.target,{yes:!0,mode:k,...n.steering?{because:n.steering}:{}},S,t.runDesign,"batch"));return D.outcome==="evolved"?(u.applied++,t.signals({ref:r,verdict:"gap-resolved-evolve",...n.steering?{reason:n.steering}:{}}),{outcome:"applied"}):D.outcome==="failed"||D.outcome==="paused"?y(`evolve ${D.outcome} (exit ${D.code})`):(u.skipped++,{outcome:"skipped",detail:D.outcome})},summary:()=>({...u})}}var j=U(K(),1);function q({mark:t,markColor:v,color:k,indent:A=2,reserve:M=0,children:P}){let{stdout:S}=ae(),u=(S?.columns??80)-M,w=A+t.length+1;return(0,j.jsxs)(F,{children:[(0,j.jsx)(F,{width:w,flexShrink:0,children:(0,j.jsx)(x,{color:v,children:`${" ".repeat(A)}${t}`})}),(0,j.jsx)(F,{width:Math.max(20,u-w),children:(0,j.jsx)(x,{color:k,children:P})})]})}var p=U(K(),1);function be(t){return t.landed?"committed":t.outcome}var We={applied:{mark:"\u2714",color:"green"},committed:{mark:"\u2714",color:"green"},retired:{mark:"\u2714",color:"green"},skipped:{mark:"\xB7",color:"dim"},deferred:{mark:"\u2013",color:"dim"},failed:{mark:"\u2717",color:"red"}};function Ae(t){return t.v==="archive"?"Retiring\u2026":t.v==="approve"&&t.steering?"Approving with your changes \u2014 committing, then re-designing\u2026":"Applying \u2014 committing\u2026"}function Pe({controller:t,cards:v,note:k,markOutcome:A,routeChat:M,listEvolveTargets:P,barSubject:S,meta:u,resumeCmd:w,activeChild:y,onFinish:r,onCtrlC:n,pauseRef:l}){let[a,d]=(0,R.useState)(v.length>0?{at:"card",idx:0,sel:0,editor:null}:{at:"done-panel",sel:0}),D=(0,R.useRef)(0),s=(0,R.useRef)(a);s.current=a;let b=(0,R.useRef)([]),[,g]=(0,R.useState)(0),o=a.at==="busy"||a.at==="evolving";(0,R.useEffect)(()=>{if(!o)return;let e=setInterval(()=>g(i=>i+1),120);return()=>clearInterval(e)},[o]);let c=()=>{let e=t.summary();return`${e.applied+e.committed} applied \xB7 ${e.retired} retired \xB7 ${e.skipped} skipped \xB7 ${e.deferred} deferred`+(e.failed>0?` \xB7 ${e.failed} failed`:"")},E=()=>({state:"complete",facts:[c()]}),C=()=>({state:"walk-paused",reason:"ctrl+c",facts:[c(),"every verdict so far is committed \u2014 re-run the same reconcile command to continue"],...w?{resume:w}:{}}),$=()=>r(D.current,E()),T=(0,R.useRef)(!1),W=()=>{r(3,C())},I=()=>{if(T.current)return;T.current=!0;let e=s.current;if(e.at==="busy"||e.at==="evolving"){k((0,p.jsx)(x,{color:h.dim,children:"finishing the current item, then pausing\u2026"}));return}if(e.at==="done-panel"||e.at==="picker"||e.at==="why"||e.at==="view"){$();return}W()};l&&(l.current=I);let V=a.at==="card"||a.at==="busy"?v[a.idx]:null,O=()=>[{key:"finish",label:"finish"},...P?[{key:"evolve",label:"evolve another use-case\u2026"}]:[],...b.current.length>0?[{key:"view",label:"view what changed"}]:[]],H=()=>{let e=P?.()??[];if(e.length===0){k((0,p.jsx)(x,{color:h.dim,children:"nothing is stale \u2014 no evolve targets right now"})),d({at:"done-panel",sel:0});return}d({at:"picker",items:e,sel:0})},we=e=>{let i=e+1;i<v.length?d({at:"card",idx:i,sel:0,editor:null}):d({at:"done-panel",sel:0})},X=(0,R.useRef)(!1),L=(e,i)=>{if(X.current)return;X.current=!0;let m=v[e];d({at:"busy",idx:e,label:Ae(i),startedAt:Date.now()}),t.submit(m.ref,i).catch(f=>({outcome:"failed",detail:f instanceof Error?f.message:String(f)})).then(f=>{let B=We[f.outcome]??{mark:"\xB7",color:"dim"},Te=f.outcome!=="failed"&&f.outcome!=="skipped"&&f.outcome!=="deferred"&&m.impact&&"stale_refs"in m.impact&&m.impact.stale_refs.length>0?` \xB7 ${m.impact.stale_refs.length} item(s) now stale`:"",oe=`${f.outcome} [${m.kind}] ${Y(m.title)}${f.detail?` \u2014 ${Y(f.detail)}`:""}${Te}`;if(b.current.push({mark:B.mark,color:B.color,line:oe}),k((0,p.jsx)(q,{mark:B.mark,markColor:B.color==="green"?h.green:B.color==="red"?h.red:h.dim,color:B.color==="dim"?h.dim:void 0,children:oe})),f.outcome==="failed"&&(D.current=D.current===0?1:D.current),A(m.ref,be(f)),X.current=!1,T.current){W();return}we(e)})},ye=(e,i)=>{d({at:"evolving",title:e.title,startedAt:Date.now()}),M(`${e.key} ${i}`).catch(m=>`\u2717 evolve failed: ${m instanceof Error?m.message:String(m)}`).then(m=>{let f=m.startsWith("\u2713");if(b.current.push({mark:f?"\u2714":"\u2717",color:f?"green":"red",line:m.replace(/^[✓✗]\s*/,"")}),k((0,p.jsx)(q,{mark:f?"\u2714":"\u2717",markColor:f?h.green:h.red,children:m.replace(/^[✓✗]\s*/,"")})),T.current){$();return}d({at:"done-panel",sel:0})})},xe=(0,R.useMemo)(()=>({isFocused:()=>{let e=s.current;return e.at==="card"&&e.editor===null||e.at==="done-panel"||e.at==="picker"||e.at==="view"},onMove:e=>{d(i=>{if(i.at==="card"){let m=v[i.idx],f=G(m)??N(m).length-1;return{...i,sel:Math.max(0,Math.min(f,i.sel+e))}}return i.at==="done-panel"?{...i,sel:Math.max(0,Math.min(O().length-1,i.sel+e))}:i.at==="picker"?{...i,sel:Math.max(0,Math.min(i.items.length-1,i.sel+e))}:i})},onSelect:()=>{let e=s.current;if(e.at==="card"){let i=v[e.idx],m=G(i);if(m!==null&&e.sel===m){d({...e,editor:"",editorIntent:"steer"});return}let f=N(i)[e.sel];if(f?.v==="archive"&&i.kind==="REVIEW"){d({...e,editor:"",editorIntent:"because"});return}f&&L(e.idx,{v:f.v});return}if(e.at==="done-panel"){let i=O()[e.sel];i?.key==="finish"?$():i?.key==="evolve"?H():i?.key==="view"&&d({at:"view"});return}if(e.at==="picker"){let i=e.items[e.sel];i&&d({at:"why",item:i,text:""});return}},onDigit:e=>{let i=s.current;if(i.at==="card"){let m=v[i.idx],f=N(m)[e-1];if(f?.v==="archive"&&m.kind==="REVIEW"){d({...i,editor:"",editorIntent:"because"});return}f&&L(i.idx,{v:f.v});return}i.at==="done-panel"&&e-1<O().length&&d({...i,sel:e-1}),i.at==="picker"&&e-1<i.items.length&&d({...i,sel:e-1})},onType:e=>{d(i=>i.at!=="card"||G(v[i.idx])===null?i:{...i,editor:(i.editor??"")+e,editorIntent:i.editorIntent??"steer"})},isMulti:()=>!1,onSpace:()=>{},onBack:()=>{let e=s.current;(e.at==="picker"||e.at==="view")&&d({at:"done-panel",sel:0})}}),[v]);(0,R.useEffect)(()=>{a.at==="done"&&$()},[a.at]);let Ce=e=>Math.floor((Date.now()-e)/1e3),z=y?.current??null,$e=a.at==="card"?{kind:"card",n:a.idx+1,m:v.length}:a.at==="busy"?z?{kind:"child-working",step:re(a.label)}:{kind:"working",step:re(a.label),elapsedS:Ce(a.startedAt)}:a.at==="evolving"?{kind:"child-working",step:`evolving ${a.title}`}:{kind:"idle"},Re=a.at==="card"||a.at==="busy"?v.length-a.idx:0,Ee=a.at==="done-panel"||a.at==="picker"||a.at==="why"||a.at==="view",De=[...a.at==="card"?a.editor!==null?["\u23CE submit","esc back"]:fe(v[a.idx]).keys:a.at==="done-panel"?me(O(),{escBack:!1}).keys:a.at==="picker"?["\u2191\u2193 select","\u23CE confirm","esc back"]:a.at==="why"?["\u23CE submit","esc back"]:a.at==="view"?["esc back"]:[],"ctrl+c exit"],J=u??{verb:"reconcile",sid:"",env:""},Se=`view \xB7 this run's changes \xB7 ${b.current.length}`;return(0,p.jsxs)(F,{flexDirection:"column",children:[(0,p.jsx)(le,{onToggleThinking:()=>{},onCtrlC:()=>{n(),I()},panel:xe}),a.at==="card"&&V?(0,p.jsx)(de,{card:V,position:{n:a.idx+1,of:v.length},sel:a.sel,focused:a.editor===null,editorIntent:a.editorIntent??"steer",freeText:a.editor!==null?{value:a.editor,onChange:e=>d(i=>i.at==="card"?{...i,editor:e}:i),onSubmit:e=>{let i=s.current;if(i.at!=="card")return;let m=e.trim();if(!m){d({...i,editor:null,editorIntent:void 0});return}let f=v[i.idx];i.editorIntent==="because"?L(i.idx,{v:"archive",because:m}):f.kind==="PAIR"?L(i.idx,{v:"defer",note:m}):L(i.idx,{v:"approve",steering:m})},onCancel:()=>d(e=>e.at==="card"?{...e,editor:null,editorIntent:void 0}:e)}:null}):null,a.at==="done-panel"?(0,p.jsx)(Q,{headline:(()=>{let e=t.summary();return`reconcile done \u2014 ${e.applied+e.committed} applied \xB7 ${e.retired} retired \xB7 ${e.skipped} skipped \xB7 ${e.deferred} deferred${e.failed>0?` \xB7 ${e.failed} failed`:""}`})(),rows:O(),sel:a.sel,focused:!0}):null,a.at==="picker"?(0,p.jsx)(Q,{ask:!0,headline:"evolve which use-case?",rows:a.items.map(e=>({key:e.key,label:e.title,detail:e.badge})),sel:a.sel,focused:!0}):null,a.at==="why"?(0,p.jsxs)(F,{flexDirection:"column",borderStyle:"round",borderColor:h.assuranceAccent,paddingX:1,children:[(0,p.jsxs)(F,{children:[(0,p.jsxs)(x,{children:[(0,p.jsx)(x,{color:h.assuranceAccent,children:"\u25B8"})," ",(0,p.jsx)(x,{color:h.dim,children:"\u270E "})]}),(0,p.jsx)(se,{value:a.text,onChange:e=>d(i=>i.at==="why"?{...i,text:e}:i),onSubmit:e=>{let i=s.current;i.at==="why"&&(e.trim()?ye(i.item,e.trim()):d({at:"picker",items:[i.item],sel:0}))},onCancel:()=>{s.current.at==="why"&&H()},placeholder:`what should change about ${a.item.title}?`})]}),(0,p.jsx)(x,{color:h.muted,children:" \u23CE submit \xB7 esc back"})]}):null,a.at==="view"?(0,p.jsxs)(F,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,p.jsx)(x,{bold:!0,color:h.assuranceAccent,children:Se}),(0,p.jsx)(x,{children:" "}),b.current.map((e,i)=>(0,p.jsx)(q,{mark:e.mark,markColor:e.color==="green"?h.green:e.color==="red"?h.red:h.dim,color:e.color==="dim"?h.dim:void 0,indent:0,reserve:0,children:e.line},`vc-${i}`))]}):null,(0,p.jsx)(ce,{status:$e,meta:{...J,...S??J.subject?{subject:S??J.subject}:{}},tallies:ue(t.summary(),Re),keys:De,child:a.at==="evolving"?{verb:"evolve"}:z?{verb:z.verb}:void 0})]})}async function at(t){let v={current:null},k=o=>{v.current?.append(o)},A=null,M=async(o,c)=>{let[{runDesign:E},{resolveAgentAuthEnv:C},{runAgent:$},{preflightTurn:T}]=await Promise.all([import("./run-XJK3YOW2.js"),import("./spawner-HZXP66DS.js"),import("./bridge-NHXCRSIU.js"),import("./turn-preflight-JGYT7LXP.js")]);A??=await C();let W=A;return E({useCase:o,force:!0,mode:c.mode??"override",...c.because?{because:c.because}:{},...c.changeDelta!==void 0?{changeDelta:c.changeDelta}:{},...c.priorDesign!==void 0?{priorDesign:c.priorDesign}:{}},{contextDir:t.dir,agent:$,preflightTurn:()=>T(W),ask:async()=>[],out:()=>{},progress:()=>{},isTTY:!1,auth:W})},P=t.runDesign??M,S={current:null},u="",w=o=>{if(o.kind==="start")S.current={verb:o.verb},u=o.subject,k((0,p.jsxs)(x,{color:h.assuranceAccent,children:[`\u25CF ${te(o.verb).ing} ${Y(o.subject)}`,o.note?(0,p.jsx)(x,{color:h.dim,children:` ${o.note}`}):null]}));else if(o.kind==="end"){let c=S.current?.verb??"design";S.current=null,k(o.ok?(0,p.jsx)(x,{color:h.green,children:`\u25CF ${te(c).ed} ${Y(u)} \u2014 ${o.durS}s`}):(0,p.jsx)(x,{color:h.red,children:`\u25CF ${c} failed \u2014 ${o.exitCode!=null?`exited ${o.exitCode}`:"error"}${o.fixCmd?` \xB7 ${o.fixCmd}`:""}`}))}},y=ke({contextDir:t.dir,held:t.held,archive:t.archive,planRows:t.rows,runDesign:P,mode:"interactive",signals:t.signals,onChild:w,reviewFeeder:()=>{try{return he({contextDir:t.dir},_(t.dir))}catch{return[]}}}),r=new Set(t.rows.filter(o=>o.applied!==void 0).map(o=>o.held_ref??o.ref)),n=y.cards().filter(o=>!r.has(o.ref)&&!(o.kind==="ARCHIVE"&&t.archiveState?.[o.ref]!==void 0)),l=o=>t.rows.findIndex(c=>(c.held_ref??c.ref)===o),a=(o,c)=>{try{if(n.find($=>$.ref===o)?.kind==="ARCHIVE"){c==="retired"?t.markA?.(o,"retired"):c==="skipped"&&t.markA?.(o,"skipped");return}let C=l(o);if(C<0)return;c==="applied"||c==="committed"?t.mark?.(C,"approved"):c==="skipped"&&t.mark?.(C,"skipped")}catch{}},d=async o=>{let[{openGraph:c},{resolveParentUc:E,evolveOneUc:C}]=await Promise.all([import("./readmodel-FVLRQWZ7.js"),import("./evolve-cmd-BURJDLVF.js")]),[$,...T]=o.split(/\s+/),W=c(t.dir),I=E(W,$);if(!I.ok)return`couldn't resolve '${$}' \u2014 start with a use-case id (uc-\u2026): ${I.message}`;if(T.length===0)return`say what to change: \`${$} <your words>\` \u2014 the words become the redesign's change delta`;let V=T.join(" "),O={out:()=>{},err:()=>{},isTTY:!1,confirm:async()=>!0},H=await C(t.dir,I.target,{yes:!0,mode:"override",because:V},O,P,"batch");return H.outcome==="evolved"?(t.signals({ref:I.target.display,verdict:"gap-resolved-evolve",reason:V}),`\u2713 redesigned ${I.target.display} \u2014 "${V}"`):`\u2717 evolve ${H.outcome} for ${I.target.display} (exit ${H.code})`},D=t.listEvolveTargets??(()=>{let o=_(t.dir);return pe(o).targets.map(c=>({key:c.display,title:c.display,badge:"stale"}))});if(t.script){let o=0;for(let c of n){let E=await t.script(c),C=await y.submit(c.ref,E);C.outcome==="failed"&&o===0&&(o=1),a(c.ref,be(C))}return o}let[{render:s},{ScrollbackProvider:b},{ScrollbackTap:g}]=await Promise.all([import("./build-JIKYOZUH.js"),import("./scrollback-JLPJR25X.js"),import("./ScrollbackTap-QHJOFYMC.js")]);return new Promise(o=>{let c=!1,E=(V,O)=>{c||(c=!0,(async()=>{process.removeListener("SIGINT",W),await v.current?.flush();try{I.unmount()}catch{}O&&Z(O),o(V)})())},C=0,$={current:null},T=()=>{if(C+=1,C>=2){if(c)return;c=!0,process.removeListener("SIGINT",W);try{I.unmount()}catch{}Z({state:"interrupted",reason:"ctrl+c \xD72",facts:["forced quit \u2014 every committed verdict is safe in the store"]}),o(130)}},W=()=>{T(),$.current?.()};process.on("SIGINT",W);let I=s((0,p.jsxs)(b,{children:[(0,p.jsx)(g,{into:v}),(0,p.jsx)(Pe,{controller:y,cards:n,note:k,markOutcome:a,routeChat:d,listEvolveTargets:D,barSubject:t.barSubject,meta:t.meta,resumeCmd:t.resumeCmd,activeChild:S,onFinish:E,onCtrlC:T,pauseRef:$})]}),{exitOnCtrlC:!1})})}export{Pe as WalkSessionSurface,be as outcomeToMark,at as runWalkSession};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-GVE5GEW2.js";import"./chunk-T2ONUKTL.js";import"./chunk-VW3PFRCO.js";import"./chunk-ZLWURCJ7.js";import"./chunk-QSCXXNC2.js";import"./chunk-KBM3XHAM.js";import"./chunk-2YEHV2CX.js";import"./chunk-5LJRZI7S.js";import"./chunk-BKM2LWU2.js";import"./chunk-RDHWNSDP.js";import"./chunk-FQNQVC5O.js";import"./chunk-XLSOQLVT.js";import"./chunk-UD7KKHPW.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-SJZJ7ASF.js";import"./chunk-UR6MHSHU.js";export{a as withTelemetry};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testmuai/kane-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.22",
|
|
4
4
|
"description": "KaneAI Terminal UI — browser automation testing agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"ws": "^8.20.0"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@testmuai/kane-cli-assurance-darwin-arm64": "0.8.
|
|
37
|
-
"@testmuai/kane-cli-assurance-darwin-x64": "0.8.
|
|
38
|
-
"@testmuai/kane-cli-assurance-linux-arm64": "0.8.
|
|
39
|
-
"@testmuai/kane-cli-assurance-linux-x64": "0.8.
|
|
40
|
-
"@testmuai/kane-cli-assurance-win-x64": "0.8.
|
|
41
|
-
"@testmuai/kane-cli-darwin-arm64": "0.8.
|
|
42
|
-
"@testmuai/kane-cli-darwin-x64": "0.8.
|
|
43
|
-
"@testmuai/kane-cli-linux-x64": "0.8.
|
|
44
|
-
"@testmuai/kane-cli-linux-arm64": "0.8.
|
|
45
|
-
"@testmuai/kane-cli-win-x64": "0.8.
|
|
36
|
+
"@testmuai/kane-cli-assurance-darwin-arm64": "0.8.22",
|
|
37
|
+
"@testmuai/kane-cli-assurance-darwin-x64": "0.8.22",
|
|
38
|
+
"@testmuai/kane-cli-assurance-linux-arm64": "0.8.22",
|
|
39
|
+
"@testmuai/kane-cli-assurance-linux-x64": "0.8.22",
|
|
40
|
+
"@testmuai/kane-cli-assurance-win-x64": "0.8.22",
|
|
41
|
+
"@testmuai/kane-cli-darwin-arm64": "0.8.22",
|
|
42
|
+
"@testmuai/kane-cli-darwin-x64": "0.8.22",
|
|
43
|
+
"@testmuai/kane-cli-linux-x64": "0.8.22",
|
|
44
|
+
"@testmuai/kane-cli-linux-arm64": "0.8.22",
|
|
45
|
+
"@testmuai/kane-cli-win-x64": "0.8.22",
|
|
46
46
|
"@testmuai/kane-cli-node-darwin-arm64": "24.18.0",
|
|
47
47
|
"@testmuai/kane-cli-node-darwin-x64": "24.18.0",
|
|
48
48
|
"@testmuai/kane-cli-node-linux-x64": "24.18.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-T27HVHZA.js";import"./chunk-P6HK7GSS.js";import"./chunk-E6MW25UV.js";import"./chunk-AACQE24F.js";import"./chunk-5GUD3CIH.js";import"./chunk-U2LDPUDZ.js";import"./chunk-WESMQEPO.js";import"./chunk-EHN5HTUD.js";import"./chunk-IPQAKIJO.js";import"./chunk-VVOKM2VO.js";import"./chunk-CH273NAE.js";import"./chunk-CAOZKSQ3.js";import"./chunk-VZ7KXRXB.js";import"./chunk-P7YZ3PU3.js";import"./chunk-IICT4VOU.js";import"./chunk-D6E6KRVX.js";import"./chunk-3UI5VTQS.js";import"./chunk-RDHWNSDP.js";import"./chunk-FQNQVC5O.js";import"./chunk-XLSOQLVT.js";import"./chunk-UD7KKHPW.js";import"./chunk-4ZVGZF2L.js";import"./chunk-RFHMDQXZ.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-IHVIIRW5.js";import"./chunk-MSGW4JDG.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-4JOD47QI.js";import"./chunk-5WZ2WOOM.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-OWPQZP4C.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as EvidenceViewOffer};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-U7WMRB5V.js";import"./chunk-YCCUBQY4.js";import"./chunk-PP4I2Z6M.js";import"./chunk-BPMSNGXQ.js";import"./chunk-PY4BWRR6.js";import"./chunk-5WZ2WOOM.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-OWPQZP4C.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as FolderPicker,a as formatFolderLine};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-5UCXN56I.js";import"./chunk-I3NUTW6U.js";import"./chunk-FYW7USQY.js";import"./chunk-PN4EL4JN.js";import"./chunk-JQ64X2TO.js";import"./chunk-VZ7KXRXB.js";import"./chunk-TDPWFYTJ.js";import"./chunk-SA7ORQHP.js";import"./chunk-ISBISZUE.js";import"./chunk-TEJG5H2O.js";import"./chunk-U7WMRB5V.js";import"./chunk-YCCUBQY4.js";import"./chunk-PP4I2Z6M.js";import"./chunk-BPMSNGXQ.js";import"./chunk-VE3SUJMA.js";import"./chunk-TZXXJWHA.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-Y67FYNLP.js";import"./chunk-TAOHYWEO.js";import"./chunk-PY4BWRR6.js";import"./chunk-Z7S3IWUX.js";import"./chunk-BNWU7JOW.js";import"./chunk-5WZ2WOOM.js";import"./chunk-DHJSM5DT.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-RMLC3QWX.js";import"./chunk-OWPQZP4C.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SingleShotApp};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{g as a}from"./chunk-6V4ANMW4.js";import"./chunk-R54VY272.js";import"./chunk-DFHVZZI3.js";import"./chunk-DCLMFWCF.js";import"./chunk-5Y2G4NC7.js";import"./chunk-P7YZ3PU3.js";import"./chunk-TDPWFYTJ.js";import"./chunk-SA7ORQHP.js";import"./chunk-4L45IQNU.js";import"./chunk-MMBBQ4OZ.js";import"./chunk-IHVIIRW5.js";import"./chunk-MSGW4JDG.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-Z7S3IWUX.js";import"./chunk-4JOD47QI.js";import"./chunk-5WZ2WOOM.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-YV6CSSWA.js";import"./chunk-R6RK32R2.js";import"./chunk-OWPQZP4C.js";import"./chunk-DFS4RMVP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as TestMdRunView};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as u}from"./chunk-ZUZ6QJRA.js";import{d as m}from"./chunk-H6TNBKGR.js";import"./chunk-UR6MHSHU.js";function x(t){let e=d(t),[n,r]=e;return n==="context"?r==="sync"||r==="pull"||r==="push"||r==="clone"?"sync":r==="ingest"||r==="extract"?"extract":r==="name"||r==="retire"||r==="revert"||r==="review"?r:r??n:n==="maintain"&&r==="reconcile"?"reconcile":n==="cover"?r==="gaps"?"gaps":"cover":n??"sync"}function d(t){let e=[];for(let n=0;n<t.length&&e.length<2;n++){let r=t[n];if(r==="--")break;if(r==="--mode"){n++;continue}r.startsWith("-")||e.push(r)}return e}function p(t){return t.startsWith("--")?t.split("=",1)[0]:t.slice(0,2)}function c(t){let e=t;return typeof e.long=="string"||typeof e.short=="string"?e.long??e.short??"option":typeof e.name=="function"?e.name():"argument"}var f={unknownOption:(t,[e])=>({code:"commander.unknownOption",name:p(String(e))}),missingArgument:(t,[e])=>({code:"commander.missingArgument",name:String(e)}),unknownCommand:t=>({code:"commander.unknownCommand",name:String(t.args[0]??"")}),optionMissingArgument:(t,[e])=>({code:"commander.optionMissingArgument",name:c(e)}),missingMandatoryOptionValue:(t,[e])=>({code:"commander.missingMandatoryOptionValue",name:c(e)}),_conflictingOption:(t,[e,n])=>({code:"commander.conflictingOption",name:c(e),other:c(n)}),_excessArguments:(t,[e])=>({code:"commander.excessArguments",name:t.parent?t.name():void 0,expected:t.registeredArguments.length,got:e.length}),_callParseArg:(t,[e])=>({code:"commander.invalidArgument",name:c(e)})};function w(t,e){let n=e&&e.code===t?e:null;switch(t){case"commander.unknownOption":return n?`unknown option ${n.name}`:"unknown option";case"commander.missingArgument":return n?`missing required argument ${n.name}`:"missing required argument";case"commander.unknownCommand":return n?`unknown command ${n.name}`:"unknown command";case"commander.optionMissingArgument":return n?`option ${n.name} needs a value`:"an option needs a value";case"commander.missingMandatoryOptionValue":return n?`required option ${n.name} not given`:"a required option was not given";case"commander.conflictingOption":return n?`option ${n.name} cannot be used with option ${n.other}`:"two options cannot be used together";case"commander.excessArguments":return n?`too many arguments${n.name?` for ${n.name}`:""}: expected ${n.expected}, got ${n.got}`:"too many arguments";case"commander.invalidArgument":return n?`invalid value for ${n.name}`:"an argument's value is invalid";case"kane.answerOnSubcommand":return"option --answer belongs to kane-cli context sync [name] and kane-cli context pull";default:return"the command line was not accepted"}}function g(t,e={current:null}){t.exitOverride(),t.configureOutput({writeErr:()=>{},writeOut:()=>{}});let n=t;for(let[o,i]of Object.entries(f)){let s=n[o];typeof s=="function"&&(n[o]=function(...a){try{return s.apply(this,a)}catch(l){throw e.current=i(this,a),l}})}let r=n.error;n.error=function(...o){let i=o[1]?.code;return i==="commander.unknownCommand"&&e.current?.code!==i&&(e.current={code:i,name:String(this.args[0]??"")}),r.apply(this,o)};for(let o of t.commands)g(o,e);return e}async function v(t,e,n,r={stdout:o=>process.stdout.write(o),stderr:o=>process.stderr.write(o)}){let o=g(t);try{return await t.parseAsync(e),null}catch(i){if(!(i instanceof u))throw i;let s=m("ndjson",n,r);if(i.exitCode===0)return s.done(0);let a=d(e.slice(2))[0];return s.event({type:"error",code:"USAGE",message:w(i.code,o.current),remedy:`run kane-cli${a?` ${a}`:""} --help`}),s.done(2,"refused")}}export{v as parseAsAgent,g as silenceCommandTree,x as streamVerbFor,w as usageMessage};
|
package/dist/bind-N5QZUUUU.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as N}from"./chunk-7BKOTLIL.js";import"./chunk-ZKSN2SJ7.js";import"./chunk-EVFFDODK.js";import"./chunk-KJQNAOOE.js";import"./chunk-EV3EU2MT.js";import"./chunk-WVHMPIDQ.js";import"./chunk-OGWYTILK.js";import"./chunk-D7WG7SRA.js";import"./chunk-PCBCEXYO.js";import"./chunk-AXTPNZPX.js";import"./chunk-U6OTFMIT.js";import"./chunk-BZAGVBCX.js";import"./chunk-V4B5QA3U.js";import"./chunk-BB2W35TW.js";import"./chunk-ZXP2TJEJ.js";import"./chunk-YKTYVJBN.js";import"./chunk-FY7TCYPK.js";import"./chunk-63DYVWNX.js";import"./chunk-427OQS2N.js";import"./chunk-LSDWPG6C.js";import"./chunk-7N6OCHPC.js";import"./chunk-KDNNMU7Q.js";import"./chunk-Q6F23V7L.js";import"./chunk-SEEEGDVK.js";import"./chunk-2UIHS2FH.js";import"./chunk-Q2F5QB2W.js";import"./chunk-BKHXPBWN.js";import"./chunk-N2P4MI32.js";import"./chunk-CXXTQ4C5.js";import{U as A,V as U,W as I,X as k}from"./chunk-SBSANJ2T.js";import"./chunk-6MTKXDTH.js";import"./chunk-H6TNBKGR.js";import"./chunk-66MOZKD2.js";import"./chunk-YLQHY4A7.js";import"./chunk-UVR7MESH.js";import"./chunk-IPQAKIJO.js";import"./chunk-VVOKM2VO.js";import{a as d}from"./chunk-CH273NAE.js";import"./chunk-CAOZKSQ3.js";import"./chunk-VZ7KXRXB.js";import"./chunk-5LJRZI7S.js";import"./chunk-BKM2LWU2.js";import"./chunk-IICT4VOU.js";import"./chunk-D6E6KRVX.js";import"./chunk-3UI5VTQS.js";import{t as R}from"./chunk-RDHWNSDP.js";import"./chunk-FQNQVC5O.js";import"./chunk-XLSOQLVT.js";import"./chunk-UD7KKHPW.js";import"./chunk-YCCUBQY4.js";import"./chunk-MSGW4JDG.js";import"./chunk-RSSOJ3L2.js";import"./chunk-5EOX4MEY.js";import"./chunk-RZ4F3BHX.js";import"./chunk-EYOCNMUM.js";import"./chunk-OWPQZP4C.js";import"./chunk-DFS4RMVP.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";import{existsSync as M}from"fs";var q=new Set(["interactive","agent","ci","override"]);function F(t){return t.mode!=null&&!q.has(t.mode)?{error:`design: --mode must be interactive | agent | ci | override, got '${t.mode}'`}:t.strength!=null&&t.strength!=="pairwise"&&t.strength!=="3-wise"?{error:`design: --strength must be pairwise | 3-wise, got '${t.strength}'`}:t.max!=null&&(!Number.isInteger(t.max)||t.max<1)?{error:"design: --max must be a positive integer"}:!t.useCase&&!t.resume?{error:"design: --use-case is required (or --resume <sid> \u2014 the session remembers its use-case)"}:{useCase:t.useCase,max:t.max,strength:t.strength,mode:t.mode,force:t.force,resume:t.resume,plan:t.plan,message:t.message,phase:t.phase,allowUnreviewed:t.allowUnreviewed,because:t.because,changeDelta:t.changeDelta,priorDesign:t.priorDesign}}async function X(t){let l=async(e,n)=>{if(t.mode!=="agent")return process.stderr.write(e+`
|
|
3
|
-
`),2;let{makeHeadlessIO:s,agentRefusal:c}=await import("./headless-io-3A3BZVQ5.js");return c(s("ndjson","design"),e,n)};if(t.mode!=null&&!["interactive","agent","ci","override"].includes(t.mode)){let{makeHeadlessIO:e,agentRefusal:n}=await import("./headless-io-3A3BZVQ5.js");return n(e("ndjson","design"),`design: --mode must be interactive | agent | ci | override, got '${t.mode}'`,"MODE_USAGE")}let T=F(t);if("error"in T)return l(T.error);let o=T;{let{validateResumeMessage:e}=await import("./headless-io-3A3BZVQ5.js"),n=e(o,"design");if(n)return l(n)}{let{gateStructuredFlags:e}=await import("./structured-answers-3C2DCFFF.js"),n=e(t,"design");if(n)return l(n,"STRUCTURED_FLAGS_USAGE")}if(!M(d(process.cwd())))return l("error: no context store here (run `kane-cli context ingest` + `kane-cli context extract` first)","NO_STORE");{let e=I(d(process.cwd()));if(e){if(t.mode!=="agent")return l(`error: ${e.text}
|
|
4
|
-
next: ${e.remedy}`,e.code);let{makeHeadlessIO:n}=await import("./headless-io-3A3BZVQ5.js"),s=n("ndjson","design");return s.event(k(e)),s.done(2,"refused")}}let x=!!o.resume;if(o.useCase&&o.resume&&!t.allowUnreviewed)try{let{peekSession:e}=await import("./sessions-NH7WQWMX.js"),n=e(d(process.cwd()),o.resume);x=!!(n&&n.use_case===o.useCase)}catch{x=!1}if(o.useCase&&!x&&!t.allowUnreviewed)try{let[{openGraph:e},{designEntryCheck:n}]=await Promise.all([import("./readmodel-FVLRQWZ7.js"),import("./trust-gate-EX7R2P4Y.js")]),s=n(e(d(process.cwd())),o.useCase);if(!s.ok&&(s.code==="UC_UNREVIEWED"||s.code==="UC_ARCHIVED"))if((o.mode??"interactive")==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY){let{createInterface:f}=await import("readline/promises"),u=f({input:process.stdin,output:process.stderr}),w=(await u.question(`design: ${s.detail}
|
|
5
|
-
Design against it anyway? (y/N) `)).trim().toLowerCase();if(u.close(),w!=="y"&&w!=="yes")return process.stderr.write(`aborted \u2014 approve it first: ${s.reviewCmd}
|
|
6
|
-
`),2}else if(t.mode==="agent"){let{makeHeadlessIO:f}=await import("./headless-io-3A3BZVQ5.js"),u=f("ndjson","design");return u.event({type:"error",code:s.code,message:`design: ${s.detail}`,next:[s.reviewCmd]}),u.event({type:"done",status:"refused",exit_code:2,next:[s.reviewCmd,`kane-cli design tests --use-case ${o.useCase} --mode agent --allow-unreviewed`]}),2}else return process.stderr.write(`design: ${s.detail} (${s.reviewCmd})
|
|
7
|
-
`),2}catch(e){process.env.KANE_DEBUG&&process.stderr.write(`trust gate skipped: ${String(e)}
|
|
8
|
-
`)}let r=null,p=null;try{if(!o.mode&&!process.stdin.isTTY)return process.stderr.write(`design: no TTY \u2014 pass an explicit --mode agent|ci|override to run headless
|
|
9
|
-
`),2;let e=o.mode??"interactive";if(e==="interactive"){if(!process.stdin.isTTY||!process.stdout.isTTY)return process.stderr.write(`design: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
10
|
-
`),2;let{bindDesignInteractive:i}=await import("./interactive-bind-7JMBM3OK.js");return await i(o)}let{resolveAgentAuthEnv:n}=await import("./spawner-XHE7OXNW.js"),{runAgent:s}=await import("./bridge-VNFL4T6K.js"),{preflightTurn:c}=await import("./turn-preflight-JGYT7LXP.js"),{makeInterruptGuard:f}=await import("./interrupt-guard-UREUWNRL.js"),{baseUrlAdvisory:u}=await import("./turn-preflight-JGYT7LXP.js"),{makeHeadlessIO:w,resolveEncoding:E,guardedChannels:G}=await import("./headless-io-3A3BZVQ5.js"),{withStructuredNext:O,prepareStructuredResume:Y}=await import("./structured-answers-3C2DCFFF.js");r=O(w(E(e),"design"));let b=await A(d(process.cwd()));b&&(E(e)==="ndjson"?r.event(U(b)):r.progress(b.text));let{runWithChannel:H}=await import("./run-channel-RGH4WIQX.js"),v=r,P=E(e)==="ndjson"?i=>H({event:g=>v.event(g)},i):i=>i(),C=i=>{v.out(i),v.event({type:"note",text:i})},{telemetryBootstrap:j,telemetryEnvName:B}=await import("./bootstrap-545GY5CC.js"),m=j({verb:"design",mode:e,contextRoot:d(process.cwd()),env:B(),resumeSid:o.resume,write:!0,longSession:!0});p=i=>m.end(i);let a=Y({opts:t,contextDir:d(process.cwd()),verb:"design"});if(a.kind==="refuse")return r.out(a.error),e==="agent"&&r.event({type:"error",message:a.error,code:a.code}),await m.end({exit_code:2}),e==="agent"?r.done(2,"refused"):2;let D;if(a.kind==="apply"){for(let i of a.notes)C(i);if(a.matchedQids.length>0){C(`applying ${a.matchedQids.length} structured answer(s) from --answer to the paused session's pending questions`);for(let i of a.matchedQids)r.event({type:"panel_resolved",id:i,by:"user",via:"flag"})}a.statement&&(D=[o.message,a.statement].filter(Boolean).join(`
|
|
11
|
-
|
|
12
|
-
`))}let _=u();_&&C(_);let h=f(s,i=>r.out(i)),S=G(r,()=>h.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let i=e==="interactive"&&process.stdin.isTTY&&process.stdout.isTTY?async y=>{let{createInterface:L}=await import("readline/promises"),$=L({input:process.stdin,output:process.stdout});try{return/^y(es)?$/i.test((await $.question(`${y} [y/N] `)).trim())}finally{$.close()}}:void 0,g=await P(async()=>{let y={...await n(),...m.spawnEnv()};return N({...o,mode:e,...D!==void 0?{message:D}:{},...i?{confirmRetarget:i}:{}},{contextDir:d(process.cwd()),agent:h.agent,preflightTurn:()=>c(y),ask:async()=>[],out:S.out,emit:S.emit,progress:v.progress,isTTY:!1,auth:y,telemetry:m})});return h.interrupted()&&g!==3?(r.out("interrupted \u2014 no session saved"),await m.end({exit_code:130}),r.done(130)):(g===1&&r.out(m.supportFooter()),await m.end({exit_code:g}),r.done(g))}finally{h.dispose()}}catch(e){if(e instanceof R)return p&&await p({exit_code:2}).catch(()=>{}),r?(r.event(k({code:e.code,text:e.message,remedy:e.remedy})),r.done(2,"refused")):(process.stderr.write(`error: ${e.message}
|
|
13
|
-
next: ${e.remedy}
|
|
14
|
-
`),2);p&&await p({exit_code:1}).catch(()=>{});let n=e instanceof Error?e.message:String(e);r?.event({type:"error",message:`error: design failed: ${n}`});let s=r?c=>r.out(c):c=>process.stderr.write(c+`
|
|
15
|
-
`);return s(`error: design failed: ${n}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&e instanceof Error&&e.stack&&s(e.stack),s('hint: the full trace is in the file named on the "trace:" line at the start of this run'),r?r.done(1):1}}export{X as designTestsCommand};
|
package/dist/bridge-VNFL4T6K.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-DVYQVSNS.js";import"./chunk-T7UACVWW.js";import"./chunk-CXXTQ4C5.js";import"./chunk-UD7KKHPW.js";import"./chunk-OWPQZP4C.js";import"./chunk-UR6MHSHU.js";export{a as runAgent};
|
package/dist/chunk-3Q5IQXOI.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as g,e as p}from"./chunk-UVR7MESH.js";import{existsSync as f}from"fs";import{isAbsolute as m,join as d,relative as v}from"path";function c(t){let n=f(d(t,".context"))?"assurance.json":"variables.json";return d(".testmuai","variables",n)}function h(t,n){if(!m(t))return t;let e=v(n,t);return e.startsWith("..")?t:e}function w(t,n){let e=t.used_by;if(e.length===0||e.every(s=>s.file===p))return"";if(n===void 0||!e.every(s=>s.file===n))return e.map(s=>`${s.file} step ${s.step}`).join(" \xB7 ");let a=[...new Set(e.map(s=>s.step))].sort((s,i)=>s-i);return a.length===1?`step ${a[0]}`:`steps ${a.join(", ")}`}function b(t,n){let e=new Map,a=new Map,s={header:"Not in any variables file",rows:[],declare:!0};for(let i of t){if(i.reason==="not_a_dataset_column"){let l=i.dataset??"",u=a.get(l);u||(u={header:`Not a column of dataset ${l}`.trimEnd(),rows:[],declare:!1},a.set(l,u)),u.rows.push(i);continue}if(i.reason!=="value_missing"){s.rows.push(i);continue}let r=h(i.file??c(n),n),o=e.get(r);o||(o={header:r===g?"Waiting for a value passed with --variables":`Waiting for a value in ${r}`,rows:[],declare:!1},e.set(r,o)),o.rows.push(i)}return[...e.values(),...a.values(),...s.rows.length>0?[s]:[]]}function $(t,n){let e=c(n);if(f(d(n,e)))return["",` Add ${t.length===1?"it":"them"} to ${e}`];let a=t.map(r=>`${JSON.stringify(r.name)}:`),s=Math.max(...a.map(r=>r.length))+1,i=a.map((r,o)=>` ${r.padEnd(s)}{ "value": "" }${o<a.length-1?",":""}`);return["",` Create ${e}:`,""," {",...i," }"]}function _(t,n){let e=t.length,a=`warning: ${e} variable${e===1?" has":"s have"} no value`,s=Math.max(...t.map(r=>r.name.length),8)+2,i=b(t,n.cwd).map(r=>{let o=[` ${r.header}`];for(let l of r.rows)o.push(` ${l.name.padEnd(s)}${w(l,n.entryFile)}`.trimEnd());return r.declare&&o.push(...$(r.rows,n.cwd)),o.join(`
|
|
3
|
-
`)});return`${a}
|
|
4
|
-
|
|
5
|
-
${i.join(`
|
|
6
|
-
|
|
7
|
-
`)}
|
|
8
|
-
|
|
9
|
-
If {{name}} is literal page text, write \\{{name}} to keep it as-is.
|
|
10
|
-
A step that sets a name first binds it; anything else is typed as written. Fill the values to bind them.
|
|
11
|
-
`}function x(t,n){return{type:"warning",code:"unresolved_variables",message:`${t.length} variable(s) have no value \u2014 typed as written unless a step sets them first`,suggested_file:c(n.cwd),variables:t.map(e=>({...e,...e.file?{file:h(e.file,n.cwd)}:{}}))}}export{c as a,_ as b,x as c};
|
package/dist/chunk-4K44ZIC4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as G,f as q,h as H}from"./chunk-4ZVGZF2L.js";import{a as j,b as z,c as K}from"./chunk-VKFLER7N.js";import{d as B,f as O}from"./chunk-4L45IQNU.js";import{a as N}from"./chunk-MMBBQ4OZ.js";import{b as F,c as $,j as R}from"./chunk-IHVIIRW5.js";import{a as L}from"./chunk-TZXXJWHA.js";import{n as T}from"./chunk-RSSOJ3L2.js";import{a as Y,b as C,c as V}from"./chunk-Y67FYNLP.js";import{h as J}from"./chunk-TAOHYWEO.js";import{e as E}from"./chunk-Z7S3IWUX.js";import{b as M}from"./chunk-OWPQZP4C.js";function X(e){return e.kind==="simulator"?e.id:e.virtualName??e.id}function Z(e,r,t={}){let o={platform:e.platform,udid:e.id,target_kind:e.kind};return r&&(o.app_package=r),t.noReset!==void 0&&(o.no_reset=t.noReset),t.appiumUrl&&(o.appium_url=t.appiumUrl),e.platform==="android"&&t.autoGrantPermissions!==void 0&&(o.auto_grant_permissions=t.autoGrantPermissions),e.platform==="ios"&&t.autoAcceptAlerts!==void 0&&(o.auto_accept_alerts=t.autoAcceptAlerts),o}function Q(e=process.env){let r=e.KANE_APPIUM_URL?.trim();return r||null}import{createHash as De}from"crypto";import{readdir as ke,stat as xe}from"fs/promises";import{basename as g,extname as Ie,join as Ue,relative as Se}from"path";import{createHash as ge}from"crypto";import{createReadStream as fe}from"fs";import{mkdir as me,readFile as he,rename as ve,writeFile as we}from"fs/promises";import{dirname as be,join as ye}from"path";var Pe=60,Te=5;function W(){return{entries:[]}}function ee(){return ye(M,"mobile","app-cache.json")}async function A(e){let r=ge("sha256");for await(let t of fe(e))r.update(t);return r.digest("hex")}function Ce(){return{readFile:e=>he(e,"utf8"),writeFile:async(e,r)=>{await me(be(e),{recursive:!0});let t=`${e}.tmp`;await we(t,r),await ve(t,e)},hashFile:A,now:()=>new Date}}function D(e){if(!e)return;let r=/\/(\d{4})\/(\d{2})\/(\d{2})\//.exec(e);if(!r)return;let[,t,o,a]=r,s=new Date(`${t}-${o}-${a}T00:00:00Z`);return Number.isNaN(s.getTime())?void 0:s.toISOString()}function Ae(e,r){if(!e.storedAt)return!0;let t=new Date(e.storedAt).getTime();return Number.isNaN(t)?!0:(r.getTime()-t)/864e5>=Pe-Te}var u=class{deps;constructor(r={}){this.deps={...Ce(),...r}}async read(){try{let r=JSON.parse(await this.deps.readFile(ee()));if(!r||typeof r!="object")return W();let t=r;return{entries:Array.isArray(t.entries)?t.entries:[]}}catch{return W()}}async write(r){await this.deps.writeFile(ee(),JSON.stringify(r,null,2))}async hashOf(r){return this.deps.hashFile(r)}async lookup(r){return(await this.read()).entries.find(o=>o.sha256===r.sha256&&o.env===r.env&&o.orgId===r.orgId&&o.type===r.type)}async remember(r){let t=await this.read();t.entries=[...t.entries.filter(o=>!(o.sha256===r.sha256&&o.env===r.env&&o.orgId===r.orgId&&o.type===r.type)),r],await this.write(t)}async forget(r){let t=await this.read(),o=t.entries.length;t.entries=t.entries.filter(a=>!(a.sha256===r.sha256&&a.env===r.env&&a.orgId===r.orgId&&a.type===r.type)),t.entries.length!==o&&await this.write(t)}isNearExpiry(r){return Ae(r,this.deps.now())}};var re={emulator:[".apk"],simulator:[".zip"]};function te(e){return e.skipped===!0}function _e(e,r){let t=Ie(e).toLowerCase();return t===".ipa"?`${g(e)} is a device build \u2014 .ipa is not accepted for ${r} runs.`:re[r].includes(t)?null:`${g(e)} cannot be uploaded for a ${r} run \u2014 expected one of ${re[r].join(", ")}.`}async function k(e,r){if(!(await xe(e)).isDirectory())return r.hashOf(e);let o=[],a=async p=>{for(let i of await ke(p,{withFileTypes:!0})){let n=Ue(p,i.name);i.isDirectory()?await a(n):i.isFile()&&o.push(n)}};await a(e),o.sort();let s=De("sha256");for(let p of o)s.update(Se(e,p)),s.update("\0"),s.update(await A(p)),s.update("\0");return s.digest("hex")}async function oe(e){let r=_e(e.path,e.type);if(r)return{skipped:!0,reason:r};let t=e.cache??new u,o=e.client??new J(e.baseUrl,{...e.auth,orgId:e.orgId}),a;try{a=await k(e.path,t)}catch(i){return{skipped:!0,reason:`could not read ${g(e.path)}: ${i.message}`}}let s={sha256:a,env:e.env,orgId:e.orgId,type:e.type},p=await t.lookup(s);if(p){if(await o.liveness(p.appId)!=="gone")return{appId:p.appId,...p.appUrl?{appUrl:p.appUrl}:{},fromCache:!0};e.onProgress?.(`${p.appId} is no longer in the cloud \u2014 uploading again`),await t.forget(s)}try{e.onProgress?.(`uploading ${g(e.path)}\u2026`);let i=await o.upload(e.path,e.type);return await t.remember({sha256:a,env:e.env,orgId:e.orgId,type:e.type,appId:i.appId,...i.appUrl?{appUrl:i.appUrl}:{},...D(i.url)?{storedAt:D(i.url)}:{},sourcePath:e.path}),e.onProgress?.(i.cached?`${g(e.path)} already in the cloud (${i.appId})`:`${g(e.path)} uploaded (${i.appId})`),{appId:i.appId,...i.appUrl?{appUrl:i.appUrl}:{},fromCache:!1}}catch(i){return{skipped:!0,reason:i.message}}}function v(e){return`${e.platform}|${X(e)}`}var m=new Map,ae=new Set;function ie(e){return ae.has(v(e))}function nr(e,r,t){r.state==="stopped"&&(m.has(v(r))||se(e,r,t))}async function ne(e,r,t){let o=m.get(v(r));return o?(t?.(`waiting for ${r.displayName} to finish booting\u2026`),o):se(e,r,t)}function se(e,r,t){let o=v(r),a=e.prepare(r,t);m.set(o,a),r.state==="stopped"&&a.then(()=>ae.add(o),()=>{});let s=()=>{m.get(o)===a&&m.delete(o)};return a.then(s,s),a.catch(()=>{}),a}import{basename as Me}from"path";import{spawnSync as Ee}from"child_process";async function Fe(e,r,t){if(!e.teardownPlan||!t.appPackage&&!t.shutdown)return;let o;try{o=await e.teardownPlan(r,t)}catch{return}o.length!==0&&T(`device:${r.id}`,()=>{G({udid:r.id,displayName:r.displayName});for(let a of o)try{Ee(a.file,a.args,{timeout:3e4,stdio:"ignore"})}catch{}})}var pe={emulator:[".apk"],simulator:[".zip"]};async function $e(e,r,t,o){if(e.kind==="package")return e;if(e.kind==="app_id"){let a=r.cloudUpload;if(!a)throw new Error(`${e.value} is an app id, which needs an account to download it. Log in, or pass a path to a local build instead.`);let s=await V({appId:e.value,baseUrl:a.baseUrl,auth:a.auth,...pe[t]?{accepts:pe[t]}:{},...o?{onProgress:o}:{}}),p=I(s.path);if(!p||p.kind==="app_id")throw new Error(`${s.name} is not a build this CLI can install (from ${e.value}).`);return p}try{let a=new u,s=await k(e.value,a),p=new Y;await p.find(s)||o?.(`copying ${Me(e.value)} into the local app store\u2026`);let n=await p.put({key:s,sourcePath:e.value,source:"local"});return{...e,value:n.path}}catch{return e}}function Re(e){T(`appium:${e}`,()=>{H({deviceClass:e,owner:process.pid})})}var x=class extends Error{constructor(r){super(r),this.name="MobileHostUnsupportedError"}},w=class extends Error{constructor(t,o){super(t);this.doctorText=o;this.name="MobilePreflightError"}};async function Ne(e,r,t){let o=t.cloudUpload,a=await oe({path:e,type:r,env:o.env,orgId:o.orgId,userId:o.userId,auth:o.auth,baseUrl:o.baseUrl,...t.onProgress?{onProgress:t.onProgress}:{}});if(te(a)){t.onProgress?.(`app not uploaded \u2014 ${a.reason}`);return}return a.appId}var Be="app must be a build (.apk for an emulator, .zip of the .app bundle for a simulator) or an app id from your cloud uploads \u2014 a package id names something already installed on one device, so it cannot be uploaded, exported as code, or run anywhere else.",de=/\.(apk|zip)$/i;function I(e){let r=e.trim();if(C(r))return{kind:"app_id",value:r};let t=de.exec(r)?.[1]?.toLowerCase();return t?{kind:t,value:r}:null}function Oe(e){return!!e&&(de.test(e)||C(e.trim()))}function Le(e){return e.filter(r=>r.required&&r.status==="fail")}function je(e,r){return!!r&&E(e,r)}async function Dr(e){let r=L();if(!r.supported)throw new x(r.reason);let t=Q()??e.appiumUrl??e.defaults?.appium_url,o=!!(e.agent||!e.interactive),a=R(),s=!!N();o&&e.platform?.toLowerCase()!=="ios"&&!s&&((await a.status("emulator")).installed||await a.ensure("emulator",{automatic:!0,onProgress:e.onProgress}));let p=await j(e.platform,{appiumUrl:t});if(K(p)){let d=p.sections.flatMap(P=>Le(P.checks)).map(P=>P.label).join(", ");throw new w(`Mobile toolchain not ready (${d}). Run \`kane-cli doctor --target ${e.platform?.toLowerCase()==="ios"?"simulator":e.platform?.toLowerCase()==="android"?"emulator":"<emulator|simulator>"}\` for details.`,z(p))}let i=await O({device:e.device,platform:e.platform,defaultTarget:e.defaults?.default_target,interactive:e.interactive}),n;if(i.ok)n=i.target;else if(i.reason==="needs-picker"&&e.pickTarget){let d=await e.pickTarget(i.candidates);if(!d)throw new Error("Target selection cancelled");n=d}else throw new Error(i.message);let f=B(n.platform);if(!f)throw new Error(`No provider for platform "${n.platform}"`);let l=F(n);if(!l)throw new Error(`No managed dependencies serve ${n.platform} ${n.kind} targets yet.`);if(!(s&&n.platform.toLowerCase()==="android"))try{await a.ensure(l,{automatic:o,onProgress:e.onProgress})}catch(d){throw d instanceof $?new w(d.message,d.message):d}let le=n.state!=="ready"||ie(n);n=await ne(f,n,e.onProgress);let ce=await q(l,{...t?{appiumUrl:t}:{},device:{udid:n.id,displayName:n.displayName},onProgress:e.onProgress});Re(l);let U=je(n,e.defaults?.default_target)?e.defaults?.default_app:void 0,h=e.app??(Oe(U)?U:void 0);if(e.app&&!I(e.app))throw new Error(`${e.app}: ${Be}`);let c=h?I(h):null,S=c?await $e(c,e,l,e.onProgress):null,b=S?await f.ensureApp(n,S,e.onProgress):void 0,y=c?.kind==="app_id"?c.value:e.cloudUpload&&c&&h?await Ne(c.value,l,e):void 0;await Fe(f,n,{shutdown:le,...b?{appPackage:b}:{}});let ue=Z(n,b,{noReset:e.noReset??e.defaults?.no_reset,appiumUrl:ce.url,autoGrantPermissions:e.defaults?.auto_grant_permissions,autoAcceptAlerts:e.defaults?.auto_accept_alerts}),_=y??h;return{device:ue,target:n,provider:f,...y?{appId:y}:{},..._?{appRef:_}:{}}}export{X as a,Z as b,te as c,_e as d,oe as e,nr as f,ne as g,x as h,w as i,Be as j,I as k,Oe as l,Dr as m};
|
package/dist/chunk-5UCXN56I.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as V,c as H,d as W,e as ie,f as se}from"./chunk-I3NUTW6U.js";import{a as le}from"./chunk-FYW7USQY.js";import{e as te}from"./chunk-PN4EL4JN.js";import{a as oe}from"./chunk-SA7ORQHP.js";import{a as re}from"./chunk-ISBISZUE.js";import{b as Z}from"./chunk-TEJG5H2O.js";import{b as ee}from"./chunk-U7WMRB5V.js";import{a as I}from"./chunk-BPMSNGXQ.js";import{a as T,b as j,d as ne}from"./chunk-VE3SUJMA.js";import{b as Q}from"./chunk-TZXXJWHA.js";import{r as C}from"./chunk-RSSOJ3L2.js";import{b as Y}from"./chunk-Y67FYNLP.js";import{i as J}from"./chunk-Z7S3IWUX.js";import{a as D}from"./chunk-5WZ2WOOM.js";import{a as B,e as K}from"./chunk-EYOCNMUM.js";import{a as z}from"./chunk-RMLC3QWX.js";import{a as q}from"./chunk-HCBYKLMW.js";import{a as c,b as u,i as L,j as G}from"./chunk-C44QQJR4.js";import{a as ve}from"./chunk-6YGTRKDT.js";import{e as F}from"./chunk-UR6MHSHU.js";var s=F(ve(),1);import{basename as he}from"path";var n=F(q(),1);function Ge({resultRef:x,mode:g="singleshot",loginCompleteRef:d}){let{exit:m}=G(),A=(0,s.useRef)(new z),E=(0,s.useRef)(new oe),v=(0,s.useRef)(new te),o=A.current,l=E.current,O=v.current,ae=V(),[h,f]=(0,s.useState)(g==="login"?"login":"gate"),[M,ce]=(0,s.useState)(null),[Pe,R]=(0,s.useState)(null),[we,$]=(0,s.useState)(null),[X,ue]=(0,s.useState)(null),[N,_]=(0,s.useState)([]),P=(0,s.useCallback)((e,t,i,r)=>O.log(e,t,i,r),[O]),be=(0,s.useCallback)((e,t)=>{e?T(o,l,e,t):l.save({project_id:null,project_name:null,folder_id:null,folder_name:null})},[o,l]),y=(0,s.useCallback)(()=>{if(g==="login")d&&(d.current=!0),m();else{let e=l.load().mobile,t=B(e?.tui_target,e?.default_target?.kind),i=(t.kind==="unset"||t.kind==="choose-mobile")&&Q();f(i?"target":"input")}},[g,m,d,l]),S=(0,s.useCallback)((e,t)=>{let i=T(o,l,e,t);if(g==="login"){f("ensure-project");return}ne(i)?y():i.projectId?f("ensure-folder"):f("ensure-project")},[o,l,y,g]);L((e,t)=>{t.ctrl&&e==="c"&&C(0,"Ctrl+C exit")});let U=(0,s.useRef)(!1);s.default.useEffect(()=>{U.current||(U.current=!0,g!=="login"&&se(o,P).then(e=>{ce(e),e.status==="authenticated"?S(e.result.profile,e.result.env):e.status==="needs_pick"?f("pick"):(R(e.profile??null),$(e.env??null),f("login"))}).catch(e=>{ue(`Auth check failed: ${e instanceof Error?e.message:String(e)}`)}))},[o,P]);let fe=(0,s.useCallback)(e=>{x.current={objective:e},m()},[x,m]),de=(0,s.useCallback)(async(e,t)=>{o.setActiveProfile(e),o.setDefaultEnv(t),(await ie(o,e,t,P)).status==="authenticated"?S(e,t):(R(e),$(t),f("login"))},[o,P,S]),w=(0,s.useCallback)(()=>{let e=o.getActiveProfile(),t=o.getDefaultEnv();if(!e)return null;let i=D(t),r=o.loadBasicAuth(e,t);return new re(i.controllerBaseUrl,async()=>o.loadCredentials(e,t)?.access_token??null,r,P)},[o,P]),ge=(0,s.useCallback)(async()=>{let e=w();if(!e)return null;let t=e.cached??await e.resolve();if(!t)return null;let i=D(o.getDefaultEnv()),r=new I(i.tmsBaseUrl,t.username,t.access_key);try{let p=(await r.listProjects()).find(k=>k.name==="KaneAI Generated");if(p)return{id:p.project_id,name:p.name};let b=await r.createProject("KaneAI Generated");return{id:b.id,name:b.name}}catch{return null}},[w,o]),pe=(0,s.useCallback)(async e=>{let t=w();if(!t)return null;let i=t.cached??await t.resolve();if(!i)return null;let r=D(o.getDefaultEnv()),a=new I(r.tmsBaseUrl,i.username,i.access_key);try{let b=(await a.listFolders(e)).find(me=>me.name==="Untitled");if(b)return{id:b.id,name:b.name};let k=await a.createFolder(e,"Untitled");return{id:k.id,name:k.name}}catch{return null}},[w,o]);if(h==="gate")return(0,n.jsx)(c,{paddingX:1,children:(0,n.jsx)(u,{color:"yellow",children:"Checking authentication..."})});if(X)return(0,n.jsxs)(c,{flexDirection:"column",paddingX:1,children:[(0,n.jsx)(u,{color:"red",children:X}),(0,n.jsx)(u,{color:"gray",children:"Press Ctrl+C to exit."})]});if(h==="pick"&&M?.status==="needs_pick")return(0,n.jsx)(xe,{profiles:M.profiles,onSelect:de});if(h==="login")return(0,n.jsx)(W,{devMode:process.env.KANE_DEV_MODE==="1",profiles:o.listProfiles(),onBasicLogin:async(e,t,i,r)=>{let{validateBasicAuth:a}=await import("./validate-basic-GBA5PHIK.js");await a(t,i,r),o.saveBasicAuth(e,t,{username:i,access_key:r}),o.setActiveProfile(e),o.setDefaultEnv(t)},onOAuthLogin:async(e,t)=>{let{LoginFlow:i}=await import("./login-flow-BPT46DCE.js");o.setDefaultEnv(t),o.setActiveProfile(e),await new i(e,t,o).login()},onComplete:(e,t)=>{R(e),$(t),o.setActiveProfile(e),o.setDefaultEnv(t),S(e,t)},onCancel:()=>{C(0,"Login cancelled")}});if(h==="ensure-project"){let e=o.getActiveProfile()??"default",t=o.getDefaultEnv(),i=()=>{if(g==="login"){f("ensure-folder");return}T(o,l,e,t).folderId?y():f("ensure-folder")};return(0,n.jsxs)(c,{flexDirection:"column",children:[(0,n.jsx)(c,{paddingX:1,marginBottom:1,children:(0,n.jsx)(u,{color:"yellow",children:"Project & folder are required to save tests \xB7 Esc to use defaults \xB7 Ctrl+C to exit"})}),(0,n.jsx)(Z,{resolver:w(),currentProjectId:l.load().project_id,env:t,onSelect:(r,a)=>{j(o,l,e,t,{projectId:r,projectName:a}),_(p=>[...p,`\u2713 Project: ${a} (${r})`]),i()},onCancel:async()=>{let r=await ge();r&&(j(o,l,e,t,{projectId:r.id,projectName:r.name}),_(a=>[...a,`\u2713 Default project: ${r.name} (${r.id})`]),i())}})]})}if(h==="ensure-folder"){let e=o.getActiveProfile()??"default",t=o.getDefaultEnv(),i=o.loadProfileConfig(e,t);return(0,n.jsxs)(c,{flexDirection:"column",children:[(0,n.jsx)(c,{paddingX:1,marginBottom:1,children:(0,n.jsx)(u,{color:"yellow",children:"Project & folder are required to save tests \xB7 Esc to use defaults \xB7 Ctrl+C to exit"})}),(0,n.jsx)(ee,{resolver:w(),projectId:i?.project_id??"",currentFolderId:l.load().folder_id,env:t,onSelect:(r,a)=>{j(o,l,e,t,{folderId:r,folderName:a}),_(p=>[...p,`\u2713 Folder: ${a} (${r})`]),y()},onCancel:async()=>{if(!i?.project_id)return;let r=await pe(i.project_id);r&&(j(o,l,e,t,{folderId:r.id,folderName:r.name}),_(a=>[...a,`\u2713 Default folder: ${r.name} (${r.id})`]),y())}})]})}if(h==="target"){let e=B(l.load().mobile?.tui_target,l.load().mobile?.default_target?.kind).kind==="choose-mobile";return(0,n.jsx)(c,{paddingX:1,children:(0,n.jsx)(le,{mode:e?"mobile-only":"all",onSelect:t=>{l.setMobile({tui_target:t}),f("input")},onCancel:()=>f("input")})})}if(h==="input"){let e=l.load().mobile,t=B(e?.tui_target,e?.default_target?.kind),i=(()=>{if(t.kind==="emulator"||t.kind==="simulator"){let r=J(e?.default_target)??"(no device)",a=e?.default_app?Y(e.default_app)?e.default_app:he(e.default_app):"(no app)";return`Config: ${K(t.kind)} \xB7 ${r} \xB7 ${a}`}return"Config: Desktop \xB7 Chrome"})();return(0,n.jsxs)(c,{flexDirection:"column",children:[N.length>0&&(0,n.jsx)(c,{flexDirection:"column",paddingX:1,marginBottom:1,children:N.map((r,a)=>(0,n.jsx)(u,{color:"green",children:r},a))}),(0,n.jsx)(c,{paddingX:1,children:(0,n.jsx)(u,{color:"gray",children:i})}),(0,n.jsx)(H,{onSubmit:fe,onEscape:()=>C(0,"User pressed Escape"),history:ae,placeholder:"Type an objective..."})]})}return(0,n.jsx)(n.Fragment,{})}function xe({profiles:x,onSelect:g}){let[d,m]=(0,s.useState)(0),[A,E]=(0,s.useState)(!1);return L((v,o)=>{if(!A){if(o.escape){C(0,"Profile picker cancelled");return}if(o.upArrow&&d>0&&m(l=>l-1),o.downArrow&&d<x.length-1&&m(l=>l+1),o.return){E(!0);let l=x[d];g(l.profile,l.env).catch(()=>E(!1))}}}),(0,n.jsxs)(c,{flexDirection:"column",paddingX:1,children:[(0,n.jsx)(u,{color:"#ff9500",bold:!0,children:"Select a profile:"}),(0,n.jsx)(c,{marginTop:1,flexDirection:"column",children:x.map((v,o)=>(0,n.jsxs)(u,{children:[o===d?"\u276F ":" ",(0,n.jsx)(u,{color:o===d?"#ff9500":"white",bold:o===d,children:v.profile}),(0,n.jsxs)(u,{color:"gray",children:[" [",v.env,"]"]})]},`${v.profile}-${v.env}`))}),A&&(0,n.jsx)(c,{marginTop:1,children:(0,n.jsx)(u,{color:"yellow",children:"Validating credentials..."})})]})}export{Ge as a};
|