@testmuai/kane-cli 0.8.20 → 0.8.21
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-U3Y3WUMS.js} +1 -1
- package/dist/{ChromeProfilePicker-UAMRJG2H.js → ChromeProfilePicker-E6I6K2HO.js} +1 -1
- package/dist/{CliFeedbackPrompt-NAPKBEOP.js → CliFeedbackPrompt-MPQVZM6J.js} +1 -1
- package/dist/{CliUploadProgress-R6FHYXP5.js → CliUploadProgress-CADDDCS6.js} +1 -1
- package/dist/{ConfigView-CKYIRJBS.js → ConfigView-IFXESQBB.js} +1 -1
- package/dist/EvidenceViewOffer-GW7XLM45.js +2 -0
- package/dist/FolderPicker-XILMCQE5.js +2 -0
- package/dist/{InfoBox-WKFPWFII.js → InfoBox-CQWRYU6P.js} +1 -1
- package/dist/{LinksBox-MQOD3X3E.js → LinksBox-ZFXUQZ2D.js} +1 -1
- package/dist/{ProfilesView-PLO2SBGI.js → ProfilesView-OBN423WX.js} +1 -1
- package/dist/{ProjectPicker-QT2IENIZ.js → ProjectPicker-FG3VJ22U.js} +1 -1
- package/dist/{SaveSessionPrompt-BRNUVO5J.js → SaveSessionPrompt-SNFSJUGW.js} +1 -1
- package/dist/SingleShotApp-BTBHN35J.js +2 -0
- package/dist/{SummaryBox-7OBZAVJU.js → SummaryBox-V7XVROAD.js} +1 -1
- package/dist/TestMdRunView-NQMTHTK6.js +2 -0
- package/dist/{TestrunEvidenceTable-PKFPTUZX.js → TestrunEvidenceTable-R3UQQI67.js} +1 -1
- package/dist/{WhoamiView-CINKGNTV.js → WhoamiView-IGIALZNC.js} +1 -1
- package/dist/agent-parse-2MLJOJTH.js +2 -0
- package/dist/{app-download-KLCWIQWJ.js → app-download-VXEW7EI7.js} +1 -1
- package/dist/{auth-L7PFZJBY.js → auth-CSYBNMIH.js} +1 -1
- package/dist/{binary-25KA3XAX.js → binary-QLRLXZ6K.js} +1 -1
- package/dist/{bind-N5QZUUUU.js → bind-URA64IPV.js} +9 -9
- package/dist/{bootstrap-545GY5CC.js → bootstrap-PYBM5YT2.js} +1 -1
- package/dist/bridge-Z5PPK6CD.js +2 -0
- package/dist/{changelog-ABQ5HREB.js → changelog-FMT3SSEI.js} +1 -1
- package/dist/chunk-2KVECC36.js +2 -0
- package/dist/{chunk-Q5PQ7U3W.js → chunk-2R55Y3X4.js} +1 -1
- package/dist/chunk-45GRUU6A.js +27 -0
- package/dist/{chunk-CXXTQ4C5.js → chunk-47MLKCMG.js} +1 -1
- package/dist/{chunk-R6RK32R2.js → chunk-4HPJ4S6H.js} +1 -1
- package/dist/{chunk-ARCYAF37.js → chunk-4XYPIPYO.js} +1 -1
- package/dist/chunk-5LLXVZXW.js +7 -0
- package/dist/chunk-5UY2JMFC.js +8 -0
- package/dist/chunk-5ZFOKYFB.js +5 -0
- package/dist/{chunk-K4D5BB63.js → chunk-6WOGVXQV.js} +1 -1
- package/dist/{chunk-IHVIIRW5.js → chunk-6ZHEIBI5.js} +2 -2
- package/dist/{chunk-PN4EL4JN.js → chunk-7EVSM4V7.js} +1 -1
- package/dist/{chunk-EPVK2NMQ.js → chunk-ASJPV3O7.js} +1 -1
- package/dist/chunk-BL5QHONU.js +2 -0
- package/dist/{chunk-SHXJQ73O.js → chunk-C3366X5X.js} +1 -1
- package/dist/{chunk-DCLMFWCF.js → chunk-CP2TVGKB.js} +1 -1
- package/dist/{chunk-5WZ2WOOM.js → chunk-DGQKGGCB.js} +1 -1
- package/dist/{chunk-UVR7MESH.js → chunk-DRVZE2XJ.js} +1 -1
- package/dist/{chunk-7BKOTLIL.js → chunk-ETFRGYOT.js} +13 -11
- package/dist/{chunk-ZXP2TJEJ.js → chunk-EXSFOB4X.js} +4 -4
- package/dist/{chunk-AXJ47YFH.js → chunk-EZKC2LFH.js} +1 -1
- package/dist/{chunk-RTD27WRG.js → chunk-F3BN7Z3Z.js} +1 -1
- package/dist/chunk-FGRDGMJP.js +9 -0
- package/dist/{chunk-FYW7USQY.js → chunk-FHH7AFSC.js} +1 -1
- package/dist/{chunk-LPVAOUAC.js → chunk-FLGQXY65.js} +1 -1
- package/dist/{chunk-BNWU7JOW.js → chunk-FPGSEOG6.js} +1 -1
- package/dist/{chunk-X77AR3IL.js → chunk-FQVK46L7.js} +1 -1
- package/dist/{chunk-K3EN7O5N.js → chunk-FRSS6LMZ.js} +17 -17
- package/dist/{chunk-Y67FYNLP.js → chunk-FY7WTTDQ.js} +1 -1
- package/dist/{chunk-NFQ67CQO.js → chunk-GGOOD6KP.js} +3 -3
- package/dist/{chunk-SBSANJ2T.js → chunk-H2VMZL7J.js} +2 -2
- package/dist/{chunk-YL5J3SNK.js → chunk-HJBTALBX.js} +1 -1
- package/dist/{chunk-CVXVFF2G.js → chunk-HX2HTIOQ.js} +1 -1
- package/dist/{chunk-YV6CSSWA.js → chunk-ICPCU7AL.js} +1 -1
- package/dist/{chunk-G5Q4EJAT.js → chunk-IDQYOWKL.js} +1 -1
- package/dist/{chunk-4L45IQNU.js → chunk-IXJ33HYF.js} +1 -1
- package/dist/{chunk-R54VY272.js → chunk-J4Z34AZN.js} +5 -5
- package/dist/{chunk-56UYK35Z.js → chunk-JD3OZ5H7.js} +1 -1
- package/dist/{chunk-UUT7EHLT.js → chunk-JH5RLIAH.js} +1 -1
- package/dist/chunk-JVQI3EVW.js +2 -0
- package/dist/{chunk-E6MW25UV.js → chunk-JW7M3ENB.js} +1 -1
- package/dist/{chunk-JKQX7DUC.js → chunk-K7WJFQJU.js} +1 -1
- package/dist/{chunk-PY4BWRR6.js → chunk-KMMOJDN4.js} +1 -1
- package/dist/{chunk-FNJJGQUI.js → chunk-KXGZLYUF.js} +1 -1
- package/dist/chunk-LDPLJFCV.js +2 -0
- package/dist/{chunk-OGWYTILK.js → chunk-LEWESZ24.js} +4 -4
- package/dist/chunk-LGJ7JMCR.js +2 -0
- package/dist/{chunk-XSZH2K3E.js → chunk-LO6WSBLS.js} +1 -1
- package/dist/{chunk-VKFLER7N.js → chunk-LXRZ5SM4.js} +1 -1
- package/dist/{chunk-T7UACVWW.js → chunk-MFOEJ2RX.js} +1 -1
- package/dist/{chunk-OWPQZP4C.js → chunk-MI6UFDRC.js} +1 -1
- package/dist/chunk-MZPLTQVK.js +9 -0
- package/dist/{chunk-U7WMRB5V.js → chunk-N5ZEI42N.js} +1 -1
- package/dist/{chunk-UFWG6VMI.js → chunk-N6J2YUDC.js} +1 -1
- package/dist/{chunk-47ZPSTT6.js → chunk-NLEFCLLY.js} +1 -1
- package/dist/{chunk-LJ5O7DZ7.js → chunk-NPFG4T7Q.js} +2 -2
- package/dist/chunk-ODU2JSMA.js +8 -0
- package/dist/{chunk-3Q5IQXOI.js → chunk-OTTGA3LT.js} +1 -1
- package/dist/{chunk-ISBISZUE.js → chunk-P6PNLVNS.js} +1 -1
- package/dist/{chunk-4ZVGZF2L.js → chunk-P7PDRCQR.js} +1 -1
- package/dist/chunk-P7URFYFG.js +5 -0
- package/dist/{chunk-DVYQVSNS.js → chunk-PQ63VSMO.js} +1 -1
- package/dist/{chunk-FD5TFGJX.js → chunk-PZJJIH4T.js} +1 -1
- package/dist/chunk-Q6AHSGOE.js +5 -0
- package/dist/{chunk-PP4I2Z6M.js → chunk-QG5OZHRH.js} +1 -1
- package/dist/{chunk-TFGGJSTI.js → chunk-QXIY5WRL.js} +2 -2
- package/dist/{chunk-IPQAKIJO.js → chunk-RGRFL7XG.js} +1 -1
- package/dist/{chunk-2TNMV4BX.js → chunk-RH4QTLEG.js} +1 -1
- package/dist/{chunk-QBU5B4GH.js → chunk-RN2PEWDD.js} +1 -1
- package/dist/{chunk-RV3KMXUX.js → chunk-RSN4EHDN.js} +1 -1
- package/dist/{chunk-I3NUTW6U.js → chunk-SRJCAJYM.js} +1 -1
- package/dist/{chunk-PCBCEXYO.js → chunk-SYKBHHAJ.js} +1 -1
- package/dist/{chunk-H6TNBKGR.js → chunk-T2ONUKTL.js} +1 -1
- package/dist/{chunk-RPJUE54T.js → chunk-TEYEMBS7.js} +1 -1
- package/dist/{chunk-L45HDSJ7.js → chunk-TI5JQZ7J.js} +1 -1
- package/dist/{chunk-5FCXFSAO.js → chunk-UUV5VP5T.js} +1 -1
- package/dist/chunk-UXCXU6P4.js +8 -0
- package/dist/{chunk-T27HVHZA.js → chunk-VL3NGTTK.js} +1 -1
- package/dist/{chunk-UYTBGBT4.js → chunk-VLBUZOGF.js} +1 -1
- package/dist/{chunk-M5V464PU.js → chunk-VNWRMLJ2.js} +2 -2
- package/dist/{chunk-U2LDPUDZ.js → chunk-WJR2FU7S.js} +1 -1
- package/dist/{chunk-IYOL2FUH.js → chunk-WSHADDNC.js} +1 -1
- package/dist/{chunk-RMLC3QWX.js → chunk-WTRUUT4E.js} +1 -1
- package/dist/{chunk-TEJG5H2O.js → chunk-X3ULX7LO.js} +1 -1
- package/dist/chunk-X3YTLBZR.js +2 -0
- package/dist/{chunk-N3MZALFQ.js → chunk-X5FZCQVO.js} +1 -1
- package/dist/{chunk-6V4ANMW4.js → chunk-XWUK7FDE.js} +1 -1
- package/dist/chunk-YFQGOOF7.js +2 -0
- package/dist/{chunk-6MTKXDTH.js → chunk-YJUWYQIO.js} +1 -1
- package/dist/chunk-YY6RXHIL.js +98 -0
- package/dist/{chunk-SA7ORQHP.js → chunk-YZZJUMKN.js} +1 -1
- package/dist/{chunk-7SV2NQZV.js → chunk-Z4DH3J7O.js} +1 -1
- package/dist/{chunk-CLLLLX4F.js → chunk-ZIYSW2F4.js} +1 -1
- package/dist/{chunk-R5UVQMMP.js → chunk-ZUWU7LJ6.js} +1 -1
- package/dist/{config-A6MBUY54.js → config-7ZZAHUGW.js} +1 -1
- package/dist/{cover-cmd-TIY53OMC.js → cover-cmd-ASKH4ZPV.js} +1 -1
- package/dist/{credentials-GXICFDVV.js → credentials-DAYWXKP3.js} +1 -1
- package/dist/{deps-bundle-RDGQAIGD.js → deps-bundle-KPOXT7E7.js} +1 -1
- package/dist/{deps-resolve-52BOL7G6.js → deps-resolve-LKA4VWF2.js} +1 -1
- package/dist/device-env-CAW6YN75.js +2 -0
- package/dist/{dispatch-GJ7RVYPK.js → dispatch-DCQVGUGM.js} +1 -1
- package/dist/{doctor-XNI2NZZJ.js → doctor-4FHKGRTC.js} +1 -1
- package/dist/evidence-QCDPTFG3.js +2 -0
- package/dist/evolve-cmd-YBQCNBL6.js +2 -0
- package/dist/{explain-cmd-ENSJNQK7.js → explain-cmd-JAOHSI4F.js} +1 -1
- package/dist/{explain-cmd-LQ5CHHNY.js → explain-cmd-XFMMVUKV.js} +1 -1
- package/dist/{extract-bind-NWA4PSTU.js → extract-bind-AHNYCTPX.js} +3 -3
- package/dist/{extract-cmd-Q5PZS626.js → extract-cmd-7ZBAPANP.js} +3 -3
- package/dist/{gaps-cmd-UKMO7KYX.js → gaps-cmd-PITBOXQK.js} +1 -1
- package/dist/{generate-headless-CLKY4IAU.js → generate-headless-CDOH5LDS.js} +2 -2
- package/dist/{headless-io-3A3BZVQ5.js → headless-io-75HUMWZB.js} +1 -1
- package/dist/index.js +142 -140
- package/dist/{ingest-cmd-JZNVRFFS.js → ingest-cmd-T2LTILCD.js} +1 -1
- package/dist/install-XDQH2EM3.js +2 -0
- package/dist/{interactive-bind-7JMBM3OK.js → interactive-bind-SOLR3JCP.js} +3 -3
- package/dist/{lifecycle-cmd-VMZKHC2Y.js → lifecycle-cmd-MXYNJ55S.js} +1 -1
- package/dist/{list-cmd-3XDCASJH.js → list-cmd-SDXYRMO3.js} +1 -1
- package/dist/{list-commands-QURMKZZH.js → list-commands-S4FMWRUU.js} +1 -1
- package/dist/login-flow-XJARBECG.js +2 -0
- package/dist/{maintenance-cmd-MQ4GCVDU.js → maintenance-cmd-EGWCWSBX.js} +1 -1
- package/dist/{mobile-prompts-VXNHSCAH.js → mobile-prompts-5XLY7R4U.js} +1 -1
- package/dist/{next-TRSKMBO5.js → next-KZXH4UA4.js} +1 -1
- package/dist/{objective-variable-gate-BDSG2BEA.js → objective-variable-gate-L25PM6IM.js} +1 -1
- package/dist/{open-provider-ZYBUD6JW.js → open-provider-STFAULQU.js} +1 -1
- package/dist/{persist-recorded-session-NV2ULVPH.js → persist-recorded-session-WJCW7M5R.js} +1 -1
- package/dist/{phase-seed-H7KXNQO6.js → phase-seed-MKHEWUN6.js} +1 -1
- package/dist/pipeline-SBSLJEQT.js +2 -0
- package/dist/prepare-target-KJ2P2BC7.js +2 -0
- package/dist/reconcile-cmd-YPSGEA5W.js +2 -0
- package/dist/reconcile-deps-N32E7NQU.js +4 -0
- package/dist/reconcile-engine-CEWZQPFK.js +2 -0
- package/dist/{recording-banner-WZECSZJM.js → recording-banner-NW5J3XKA.js} +1 -1
- package/dist/registry-RV2NWZD6.js +2 -0
- package/dist/{require-project-folder-OFA4F2T5.js → require-project-folder-7DEBG4MC.js} +1 -1
- package/dist/{resolve-run-intent-M7EXFU7E.js → resolve-run-intent-A77ZCVXW.js} +1 -1
- package/dist/{resolver-TZAQGCFJ.js → resolver-NFGCIGX5.js} +1 -1
- package/dist/{review-cmd-RXD2RWKN.js → review-cmd-ZXTE7J6C.js} +1 -1
- package/dist/{run-DVBOAY7S.js → run-2AVVCSQ2.js} +1 -1
- package/dist/run-DGVXRJEG.js +2 -0
- package/dist/{run-test-md-Z75BGXRK.js → run-test-md-QBQ5PYV4.js} +2 -2
- package/dist/{skill-installer-FEOJ4KX3.js → skill-installer-IK7AVGLZ.js} +1 -1
- package/dist/{spawner-XHE7OXNW.js → spawner-YSJNIMNY.js} +1 -1
- package/dist/{store-guard-HIBKFC2T.js → store-guard-ZNNZGLQE.js} +1 -1
- package/dist/structured-answers-ZI2B6JJE.js +2 -0
- package/dist/sync-cmd-EJL5UMHU.js +2 -0
- package/dist/{sync-setup-WGYN6ZTI.js → sync-setup-6MUOKQ2U.js} +1 -1
- package/dist/tcg-generate-UO4I35AT.js +2 -0
- package/dist/testmd-actions-R34VVDEL.js +2 -0
- package/dist/testmd-sync-L4ZFKGFZ.js +2 -0
- package/dist/{tms-client-V3TR4QW3.js → tms-client-KU6HCA23.js} +1 -1
- package/dist/token-refresh-LS3PRAT5.js +2 -0
- package/dist/{validate-basic-GBA5PHIK.js → validate-basic-X46S6YL2.js} +1 -1
- package/dist/{variable-receipt-WMV33LAD.js → variable-receipt-KAS4JVFJ.js} +1 -1
- package/dist/{verdicts-34ZGB67K.js → verdicts-K7NEM446.js} +1 -1
- package/dist/{version-check-BHRM4PN4.js → version-check-LFAPVUOE.js} +1 -1
- package/dist/{view-cmd-FJGT5KZO.js → view-cmd-BMIT3223.js} +1 -1
- package/dist/walk-session-WFINXPLQ.js +2 -0
- package/dist/{with-telemetry-AIPWSH4P.js → with-telemetry-CETNH2F6.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/bridge-VNFL4T6K.js +0 -2
- 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-P6HK7GSS.js +0 -9
- package/dist/chunk-P7YZ3PU3.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/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/walk-session-CTZ5475S.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as g}from"./chunk-
|
|
2
|
+
import{a as g}from"./chunk-2KVECC36.js";import{b as f,c as j}from"./chunk-VE3SUJMA.js";import{a as m}from"./chunk-DGQKGGCB.js";var _="KaneAI Generated",E="Untitled";async function p(e){let r=e.config.load(),d=new g(m(e.env).tmsBaseUrl,e.tmsCreds.username,e.tmsCreds.access_key),n=e.projectName??_,o=e.folderName??E,t=r.project_id??null,s=r.project_name??null;if(!t){let a=(await d.listProjects()).find(l=>l.name===n);if(a)t=a.project_id,s=a.name,e.log("info","ENSURE_PROJECT_FOUND","Found default project",{project_id:t,name:s});else{let l=await d.createProject(n);t=l.id,s=l.name,e.log("info","ENSURE_PROJECT_CREATED","Created default project",{project_id:t,name:s})}f(e.creds,e.config,e.profile,e.env,{projectId:t,projectName:s})}let c=r.folder_id??null,i=r.folder_name??null,u=!r.project_id;if(!c||u){let a=(await d.listFolders(t)).find(l=>l.name===o);if(a)c=a.id,i=a.name,e.log("info","ENSURE_FOLDER_FOUND","Found default folder",{folder_id:c,name:i});else{let l=await d.createFolder(t,o);c=l.id,i=l.name,e.log("info","ENSURE_FOLDER_CREATED","Created default folder",{folder_id:c,name:i})}f(e.creds,e.config,e.profile,e.env,{folderId:c,folderName:i})}return{projectId:t,projectName:s??n,folderId:c,folderName:i??o}}function A(e,r,d){let n=e.loadProfileConfig(r,d)??{};return{projectId:n.project_id??null,folderId:n.folder_id??null}}function N(e,r){return e.projectId===null||e.folderId===null||r===null?"needs-picker":r.project==="ok"&&r.folder==="ok"?"ok":r.project==="error"&&r.folder==="error"?"ok-tms-degraded":"needs-picker"}var k=(e,r)=>`error: profile "${e}" (${r}) has no project/folder configured AND no TMS credentials were available to auto-configure one.
|
|
3
3
|
|
|
4
4
|
discover IDs:
|
|
5
5
|
kane-cli projects list --search "<keyword>" --limit 10
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as y}from"./chunk-WD52ZNQY.js";import{b as l,d,e as m,g,h as S}from"./chunk-
|
|
2
|
+
import{b as y}from"./chunk-WD52ZNQY.js";import{a as f}from"./chunk-YZZJUMKN.js";import{b as l,d,e as m,g,h as S}from"./chunk-TI5JQZ7J.js";import{r as u,s as p}from"./chunk-RSSOJ3L2.js";import{existsSync as s,mkdirSync as h,readFileSync as C,renameSync as w,writeFileSync as R}from"fs";import{join as x}from"path";function G(e){y(l(e));let r=l(e);if(!s(r))return;let n=x(r,"meta.json"),o=m(e);if(s(n)&&!s(o))try{h(d(e),{recursive:!0}),w(n,o)}catch(t){process.stderr.write(`warn: meta.json migration failed: ${t.message}
|
|
3
3
|
`)}let a=S(e);if(s(a)){let t="python";try{let i=new f().load();i.code_export?.language&&(t=i.code_export.language)}catch{}let c=g(e,"playwright",t);if(!s(c))try{w(a,c)}catch(i){process.stderr.write(`warn: generated-code migration failed: ${i.message}
|
|
4
4
|
`)}}if(s(o))try{let t=JSON.parse(C(o,"utf8"));"md5sum"in t&&(delete t.md5sum,R(o,JSON.stringify(t,null,2)+`
|
|
5
5
|
`,"utf8"))}catch(t){process.stderr.write(`warn: meta.json md5sum strip failed: ${t.message}
|
|
6
|
-
`)}}async function O(e){if(!e.isInteractive)return{recovered:!1};if(E(e.creds))return{recovered:!1};let{SingleShotApp:r}=await import("./SingleShotApp-
|
|
6
|
+
`)}}async function O(e){if(!e.isInteractive)return{recovered:!1};if(E(e.creds))return{recovered:!1};let{SingleShotApp:r}=await import("./SingleShotApp-BTBHN35J.js"),{ScrollbackProvider:n}=await import("./scrollback-JLPJR25X.js"),{render:o}=await import("./build-JIKYOZUH.js"),a=await import("./react-QWOAB3TB.js"),t={current:null},c={current:!1},{waitUntilExit:i,unmount:v}=o(a.default.createElement(n,null,a.default.createElement(r,{resultRef:t,mode:"login",loginCompleteRef:c})),{exitOnCtrlC:!1});p(()=>v()),await i();try{process.stdin.setRawMode?.(!1)}catch{}return process.stdout.write("\x1B[?25h"),c.current?{recovered:!0}:(u(0,"Startup gate cancelled"),{recovered:!1})}function E(e){let r=e.getActiveProfile(),n=e.getDefaultEnv();if(!r||!!!(e.loadBasicAuth(r,n)||e.loadCredentials(r,n)))return!1;let a=e.loadProfileConfig(r,n)??{};return!!a.project_id&&!!a.folder_id}export{G as a,O as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as ee,d as te,h as D,i as ne,j as re,k as U,l as ie,m as se,n as oe,o as R,p as ae,q as H,r as he,s as ge,t as _e}from"./chunk-IPQAKIJO.js";import{a as me}from"./chunk-CH273NAE.js";import{d as V}from"./chunk-CAOZKSQ3.js";import{b as pe,c as fe,z as $}from"./chunk-IICT4VOU.js";import{H as M,M as T,P as le,X as O,c as de,m as L,u as ue,x as I,z as P}from"./chunk-RDHWNSDP.js";import{f as x,h as ce}from"./chunk-XLSOQLVT.js";import{appendFileSync as Ie,closeSync as Oe,existsSync as S,fsyncSync as Ce,openSync as Ne,readdirSync as je,readFileSync as k,renameSync as Fe,writeFileSync as J}from"fs";import{dirname as Q,isAbsolute as G,join as F,resolve as q}from"path";var Re=new Set(["inline","testmd","testrun"]),Le=new Set(["inferred","authored","runtime-derived"]),B=new Set(["passed","failed","broken","skipped"]);function ye(t,e,n){if(n.facts.length===0)return{record:null,errors:[{code:"EMPTY_EXECUTIONS",detail:"a run with no designed units attaches no facts \u2014 skip the call"}]};let o=e;for(let a=0;;a++){let c=M(t);if(o.latestHash!==c){if(a>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:`graph opened at ${String(o.latestHash)} but chain head is ${String(c)} \u2014 retry budget exhausted`}]};o=$(t);continue}let d=Te(t,o,n);if(d!=="cas")return d;if(a>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:"concurrent appends kept moving the head \u2014 retry budget exhausted"}]};o=$(t)}}function ve(t,e){return Re.has(t.mode)?B.has(t.verdict)?Le.has(t.oracle_mode)?typeof t.drift_flag!="boolean"||typeof t.stale_at_run!="boolean"?[{code:"MISSING_FIELD",detail:`${e}: drift_flag and stale_at_run are required booleans`}]:!t.execution_id||!t.started_at||!t.definition_id_at_run?[{code:"MISSING_FIELD",detail:`${e}: execution_id, started_at and definition_id_at_run are required`}]:[]:[{code:"BAD_ORACLE_MODE",detail:`${e}: oracle_mode '${t.oracle_mode}' not in inferred|authored|runtime-derived`}]:[{code:"BAD_VERDICT",detail:`${e}: verdict '${t.verdict}' not in ${[...B].join("|")}`}]:[{code:"BAD_MODE",detail:`${e}: mode '${t.mode}' not in inline|testmd|testrun`}]}function be(t,e,n,o){return{about:e,definition_id_at_run:t.definition_id_at_run,verdict:t.verdict,...n&&n.length?{per_ac:n}:{},drift_flag:t.drift_flag,oracle_mode:t.oracle_mode,stale_at_run:t.stale_at_run,...o.length?{unresolved_acs:o}:{},execution_id:t.execution_id,...t.evidence_id?{evidence_id:t.evidence_id}:{},...t.duration_ms!==void 0?{duration_ms:t.duration_ms}:{},started_at:t.started_at,mode:t.mode,local:t.local,...t.via_parent?{via_parent:t.via_parent}:{}}}function Ee(t,e,n={}){if(!Array.isArray(e.facts)||e.facts.length===0)return{record:null,errors:[{code:"EMPTY_EXECUTIONS",detail:"parked line carries no facts"}]};for(let o=0;;o++){let a=$(t),c=e.facts.filter(s=>a.appliedEvents.has(s.event_id)).map(s=>s.event_id),d=e.facts.filter(s=>!a.appliedEvents.has(s.event_id));if(d.length===0)return{record:null,errors:null,applied:[],skipped:c,rejected:[]};let l=[],i=[],g=[],m=[];for(let s of d){let r=`executions[${s.ref}]`,u=[];if(!s.about_cid||!a.hasNode(s.about_cid))u.push({code:"UNKNOWN_REF",detail:`${r}: about_cid '${String(s.about_cid)}' is not in the graph \u2014 the pinned run-time target is gone`});else if(a.nodeLabel.get(s.about_cid)!==x.TEST)u.push({code:"ILLEGAL_TARGET",detail:`${r}: execution facts attach to tests \u2014 '${s.about_cid}' is a ${a.nodeLabel.get(s.about_cid)}`});else if(!s.event_id)u.push({code:"MISSING_FIELD",detail:`${r}: parked facts require event_id`});else{u.push(...ve(s,r));for(let h of s.per_ac??[])B.has(h.verdict)||u.push({code:"BAD_VERDICT",detail:`${r}.per_ac['${h.ac_ref}']: verdict '${h.verdict}'`})}if(u.length>0){l.push({event_id:s.event_id??"",errors:u});continue}let p=[],f=[],_=[...s.unresolved_acs??[]];for(let h of s.per_ac??[]){let b=h.ac_cid&&a.hasNode(h.ac_cid)&&a.nodeLabel.get(h.ac_cid)===x.AC?h.ac_cid:null,y=b?null:a.resolve(h.ac_ref),E=b??(y?a.tipOf(y.cid):null);if(!E||!b&&(a.superseded.has(E)||a.nodeLabel.get(E)!==x.AC)){_.push(h.ac_ref);continue}p.push({ac_ref:a.nameOf.get(E)??h.ac_ref,ac_cid:E,verdict:h.verdict}),f.push(E)}i.push(be(s,s.about_cid,p,_)),m.push({about_cid:s.about_cid,per_ac:f}),g.push(s.event_id)}if(i.length===0)return{record:null,errors:null,applied:[],skipped:c,rejected:l};try{let s=T(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],executions:i,event_ids:[...g].sort(),source_head_moves:{}},{expectPrev:a.latestHash,intent:{v:1,verb:"parked",args:L({line:e}),pins:{facts:m}},busyRetry:{deadlineMs:5e3},provenance:n.provenance}),r;try{O(t)}catch(u){r=`parked facts committed, but the projection refresh failed (${u instanceof Error?u.message:String(u)}) \u2014 read state rebuilds on the next open`}return{record:s.record,errors:null,applied:g,skipped:c,rejected:l,...r?{warnings:[r]}:{}}}catch(s){if(!(s instanceof I))throw s;if(o>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:"concurrent appends kept moving the head \u2014 parked replay retry budget exhausted (line stays queued)"}]}}}}function Te(t,e,n){let o=[],a=[],c=[];for(let i of n.facts){let g=`executions[${i.ref}]`,m=n.pinned?null:e.resolve(i.ref),s=n.pinned?i.about_cid&&e.hasNode(i.about_cid)?i.about_cid:null:m?e.tipOf(m.cid):null;if(!s||!n.pinned&&e.superseded.has(s)){o.push({code:"UNKNOWN_REF",detail:`${g}: '${n.pinned?String(i.about_cid):i.ref}' is not a ${n.pinned?"":"live "}committed node`});continue}if(e.nodeLabel.get(s)!==x.TEST){o.push({code:"ILLEGAL_TARGET",detail:`${g}: execution facts attach to tests \u2014 '${i.ref}' is a ${e.nodeLabel.get(s)}`});continue}let r=ve(i,g);if(r.length>0){o.push(...r);continue}let u=[],p=[];for(let f of i.per_ac??[]){let _=n.pinned?null:e.resolve(f.ac_ref),h=n.pinned?f.ac_cid&&e.hasNode(f.ac_cid)?f.ac_cid:null:_?e.tipOf(_.cid):null;if(!h||!n.pinned&&e.superseded.has(h)||e.nodeLabel.get(h)!==x.AC){o.push({code:"UNKNOWN_REF",detail:`${g}.per_ac: '${n.pinned?String(f.ac_cid):f.ac_ref}' is not a${n.pinned?"n":" live"} AC`});continue}if(!B.has(f.verdict)){o.push({code:"BAD_VERDICT",detail:`${g}.per_ac['${f.ac_ref}']: verdict '${f.verdict}'`});continue}u.push({ac_ref:e.nameOf.get(h)??h,ac_cid:h,verdict:f.verdict}),p.push(h)}a.push(be(i,s,u,i.unresolved_acs??[])),c.push({about_cid:s,per_ac:p})}if(o.length>0)return{record:null,errors:o};let d;try{d=T(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],executions:a,...n.eventIds&&n.eventIds.length>0?{event_ids:n.eventIds}:{},source_head_moves:{}},{expectPrev:e.latestHash,intent:{v:1,verb:"execution",args:L({facts:n.facts,by:n.by,eventIds:n.eventIds??null}),pins:{facts:c}},busyRetry:{deadlineMs:n.lockDeadlineMs??5e3},provenance:n.provenance})}catch(i){if(i instanceof I)return"cas";throw i}let l;try{O(t)}catch(i){l=`facts committed, but the projection refresh failed (${i instanceof Error?i.message:String(i)}) \u2014 read state rebuilds on the next open`}return{record:d.record,errors:null,...l?{warnings:[l]}:{}}}function pt(t){let e={failed:3,broken:2,skipped:1,passed:0},n=new Map;for(let o of t)for(let a of o.verifies??[]){let c=n.get(a);(c===void 0||(e[o.status]??0)>(e[c]??0))&&n.set(a,o.status)}return[...n.entries()].map(([o,a])=>({ref:o,verdict:a}))}function ft(t){let e=[],n=me(t.cwd);if(!S(n))return{synced:0,superseded:0,skipped:"no-context",warnings:e};let o=t.by??{kind:"ai",id:"exec-sync"},a=t.lockDeadlineMs;try{Pe(n,e,a)}catch(r){e.push(`sync: parked-facts replay failed (${r instanceof Error?r.message:String(r)}) \u2014 queue intact, retrying next sync`)}let c=$(n),d=[],l=0,i=new Set,g=new Set(t.members.map(r=>G(r.path)?r.path:q(t.cwd,r.path))),m=new Map;for(let r of t.members){let u=G(r.path)?r.path:q(t.cwd,r.path);if(!S(u)){e.push(`sync: member file missing: ${u} \u2014 skipped, no fact attached`);continue}for(let p of Me(u,e))if(!i.has(p.path))try{let f=p.path===u,_=!f&&g.has(p.path),h=f?void 0:R(k(u,"utf8"))?.id,b=k(p.path,"utf8"),y=R(b);if(!y?.id){i.add(p.path);continue}let E=c.resolve(y.id),w=E?c.tipOf(E.cid):null;if(!E||!w||c.superseded.has(w)){i.add(p.path),e.push(`sync: ${y.id} does not resolve to a live test \u2014 skipped (foreign store?)`);continue}let C=D(U(b,se(Q(p.path),c))),Ae=String(c.getNode(w)?.content.test_md_blob??""),N=D(U(Ae,ie(c))),A=!1,j=w;if(C===N)y.base!==N&&xe(p.path,b,N,e);else if(y.base===N){let v=Ge(n,c,w,b,C,Q(p.path),o);v.error?(e.push(`sync: could not supersede ${y.id}: ${v.error}`),A=!0):(l++,j=v.newCid,A=v.oracleTier,xe(p.path,k(p.path,"utf8"),C,e),c=$(n))}else A=!0,e.push(y.base?`sync: ${y.id} was edited from an older version \u2014 graph kept; reconcile via a redesign or maintain`:`sync: ${y.id} carries no base pin (hand-copied file?) \u2014 fact attached with drift flag`);if(_){A&&m.set(p.path,!0);continue}i.add(p.path);let K=c.getNode(j)?.content.check,z=f?r.acs??[]:[],X=z.filter(v=>Se(c,v.ref)),Y=z.filter(v=>!Se(c,v.ref)).map(v=>v.ref);d.push({ref:y.id,about_cid:j,definition_id_at_run:C,verdict:r.verdict,...X.length?{per_ac:X.map(v=>{let Z=we(c,v.ref);return{ac_ref:v.ref,...Z?{ac_cid:Z}:{},verdict:v.verdict}})}:{},drift_flag:A||m.get(p.path)===!0||f&&r.driftFlag===!0,oracle_mode:K?.expected_mode??(ee(K?.operand)?"runtime-derived":"inferred"),stale_at_run:c.stale(j)!=="fresh",...Y.length?{unresolved_acs:Y}:{},execution_id:r.executionId,...r.evidenceId?{evidence_id:r.evidenceId}:{},...r.durationMs!==void 0?{duration_ms:r.durationMs}:{},started_at:r.startedAt,mode:r.mode,local:r.local,...h?{via_parent:h}:{}})}catch(f){p.path!==u&&g.has(p.path)||i.add(p.path),e.push(`sync: ${p.path} failed to sync (${f instanceof Error?f.message:String(f)}) \u2014 skipped; other members unaffected`)}}if(d.length===0)return{synced:0,superseded:l,warnings:e};let s;try{s=ye(n,$(n),{facts:d,by:o,eventIds:d.map(r=>`exec-fact:${r.execution_id}:${r.ref}`),lockDeadlineMs:a})}catch(r){return e.push(`sync facts: commit threw: ${r instanceof Error?r.message:String(r)}`),$e(n,d,o,e,a),{synced:0,superseded:l,warnings:e}}return s.errors?($e(n,d,o,e,a),e.push(...s.errors.map(r=>`sync facts: ${r.code}: ${r.detail}`)),{synced:0,superseded:l,warnings:e}):(s.warnings&&e.push(...s.warnings.map(r=>`sync facts: ${r}`)),{synced:d.length,superseded:l,warnings:e})}var W=".pending-facts.bad";function $e(t,e,n,o,a){try{let c={by:n,ts:new Date().toISOString(),facts:e.map(i=>({...i,about_cid:i.about_cid??"",event_id:`exec-fact:${i.execution_id}:${i.ref}`}))},d=null;try{d=P(t,{deadlineMs:a??5e3})}catch{d=null}let l=F(t,H);try{if(d)Ie(l,JSON.stringify(c)+`
|
|
2
|
+
import{a as ee,d as te,h as D,i as ne,j as re,k as U,l as ie,m as se,n as oe,o as R,p as ae,q as H,r as he,s as ge,t as _e}from"./chunk-RGRFL7XG.js";import{b as pe,c as fe,z as $}from"./chunk-IICT4VOU.js";import{a as me}from"./chunk-CH273NAE.js";import{d as V}from"./chunk-ODU2JSMA.js";import{H as M,M as T,P as le,X as O,c as de,m as L,u as ue,x as I,z as P}from"./chunk-RDHWNSDP.js";import{f as x,h as ce}from"./chunk-XLSOQLVT.js";import{appendFileSync as Ie,closeSync as Oe,existsSync as S,fsyncSync as Ce,openSync as Ne,readdirSync as je,readFileSync as k,renameSync as Fe,writeFileSync as J}from"fs";import{dirname as Q,isAbsolute as G,join as F,resolve as q}from"path";var Re=new Set(["inline","testmd","testrun"]),Le=new Set(["inferred","authored","runtime-derived"]),B=new Set(["passed","failed","broken","skipped"]);function ye(t,e,n){if(n.facts.length===0)return{record:null,errors:[{code:"EMPTY_EXECUTIONS",detail:"a run with no designed units attaches no facts \u2014 skip the call"}]};let o=e;for(let a=0;;a++){let c=M(t);if(o.latestHash!==c){if(a>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:`graph opened at ${String(o.latestHash)} but chain head is ${String(c)} \u2014 retry budget exhausted`}]};o=$(t);continue}let d=Te(t,o,n);if(d!=="cas")return d;if(a>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:"concurrent appends kept moving the head \u2014 retry budget exhausted"}]};o=$(t)}}function ve(t,e){return Re.has(t.mode)?B.has(t.verdict)?Le.has(t.oracle_mode)?typeof t.drift_flag!="boolean"||typeof t.stale_at_run!="boolean"?[{code:"MISSING_FIELD",detail:`${e}: drift_flag and stale_at_run are required booleans`}]:!t.execution_id||!t.started_at||!t.definition_id_at_run?[{code:"MISSING_FIELD",detail:`${e}: execution_id, started_at and definition_id_at_run are required`}]:[]:[{code:"BAD_ORACLE_MODE",detail:`${e}: oracle_mode '${t.oracle_mode}' not in inferred|authored|runtime-derived`}]:[{code:"BAD_VERDICT",detail:`${e}: verdict '${t.verdict}' not in ${[...B].join("|")}`}]:[{code:"BAD_MODE",detail:`${e}: mode '${t.mode}' not in inline|testmd|testrun`}]}function be(t,e,n,o){return{about:e,definition_id_at_run:t.definition_id_at_run,verdict:t.verdict,...n&&n.length?{per_ac:n}:{},drift_flag:t.drift_flag,oracle_mode:t.oracle_mode,stale_at_run:t.stale_at_run,...o.length?{unresolved_acs:o}:{},execution_id:t.execution_id,...t.evidence_id?{evidence_id:t.evidence_id}:{},...t.duration_ms!==void 0?{duration_ms:t.duration_ms}:{},started_at:t.started_at,mode:t.mode,local:t.local,...t.via_parent?{via_parent:t.via_parent}:{}}}function Ee(t,e,n={}){if(!Array.isArray(e.facts)||e.facts.length===0)return{record:null,errors:[{code:"EMPTY_EXECUTIONS",detail:"parked line carries no facts"}]};for(let o=0;;o++){let a=$(t),c=e.facts.filter(s=>a.appliedEvents.has(s.event_id)).map(s=>s.event_id),d=e.facts.filter(s=>!a.appliedEvents.has(s.event_id));if(d.length===0)return{record:null,errors:null,applied:[],skipped:c,rejected:[]};let l=[],i=[],g=[],m=[];for(let s of d){let r=`executions[${s.ref}]`,u=[];if(!s.about_cid||!a.hasNode(s.about_cid))u.push({code:"UNKNOWN_REF",detail:`${r}: about_cid '${String(s.about_cid)}' is not in the graph \u2014 the pinned run-time target is gone`});else if(a.nodeLabel.get(s.about_cid)!==x.TEST)u.push({code:"ILLEGAL_TARGET",detail:`${r}: execution facts attach to tests \u2014 '${s.about_cid}' is a ${a.nodeLabel.get(s.about_cid)}`});else if(!s.event_id)u.push({code:"MISSING_FIELD",detail:`${r}: parked facts require event_id`});else{u.push(...ve(s,r));for(let h of s.per_ac??[])B.has(h.verdict)||u.push({code:"BAD_VERDICT",detail:`${r}.per_ac['${h.ac_ref}']: verdict '${h.verdict}'`})}if(u.length>0){l.push({event_id:s.event_id??"",errors:u});continue}let p=[],f=[],_=[...s.unresolved_acs??[]];for(let h of s.per_ac??[]){let b=h.ac_cid&&a.hasNode(h.ac_cid)&&a.nodeLabel.get(h.ac_cid)===x.AC?h.ac_cid:null,y=b?null:a.resolve(h.ac_ref),E=b??(y?a.tipOf(y.cid):null);if(!E||!b&&(a.superseded.has(E)||a.nodeLabel.get(E)!==x.AC)){_.push(h.ac_ref);continue}p.push({ac_ref:a.nameOf.get(E)??h.ac_ref,ac_cid:E,verdict:h.verdict}),f.push(E)}i.push(be(s,s.about_cid,p,_)),m.push({about_cid:s.about_cid,per_ac:f}),g.push(s.event_id)}if(i.length===0)return{record:null,errors:null,applied:[],skipped:c,rejected:l};try{let s=T(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],executions:i,event_ids:[...g].sort(),source_head_moves:{}},{expectPrev:a.latestHash,intent:{v:1,verb:"parked",args:L({line:e}),pins:{facts:m}},busyRetry:{deadlineMs:5e3},provenance:n.provenance}),r;try{O(t)}catch(u){r=`parked facts committed, but the projection refresh failed (${u instanceof Error?u.message:String(u)}) \u2014 read state rebuilds on the next open`}return{record:s.record,errors:null,applied:g,skipped:c,rejected:l,...r?{warnings:[r]}:{}}}catch(s){if(!(s instanceof I))throw s;if(o>=3)return{record:null,errors:[{code:"STALE_BASIS",detail:"concurrent appends kept moving the head \u2014 parked replay retry budget exhausted (line stays queued)"}]}}}}function Te(t,e,n){let o=[],a=[],c=[];for(let i of n.facts){let g=`executions[${i.ref}]`,m=n.pinned?null:e.resolve(i.ref),s=n.pinned?i.about_cid&&e.hasNode(i.about_cid)?i.about_cid:null:m?e.tipOf(m.cid):null;if(!s||!n.pinned&&e.superseded.has(s)){o.push({code:"UNKNOWN_REF",detail:`${g}: '${n.pinned?String(i.about_cid):i.ref}' is not a ${n.pinned?"":"live "}committed node`});continue}if(e.nodeLabel.get(s)!==x.TEST){o.push({code:"ILLEGAL_TARGET",detail:`${g}: execution facts attach to tests \u2014 '${i.ref}' is a ${e.nodeLabel.get(s)}`});continue}let r=ve(i,g);if(r.length>0){o.push(...r);continue}let u=[],p=[];for(let f of i.per_ac??[]){let _=n.pinned?null:e.resolve(f.ac_ref),h=n.pinned?f.ac_cid&&e.hasNode(f.ac_cid)?f.ac_cid:null:_?e.tipOf(_.cid):null;if(!h||!n.pinned&&e.superseded.has(h)||e.nodeLabel.get(h)!==x.AC){o.push({code:"UNKNOWN_REF",detail:`${g}.per_ac: '${n.pinned?String(f.ac_cid):f.ac_ref}' is not a${n.pinned?"n":" live"} AC`});continue}if(!B.has(f.verdict)){o.push({code:"BAD_VERDICT",detail:`${g}.per_ac['${f.ac_ref}']: verdict '${f.verdict}'`});continue}u.push({ac_ref:e.nameOf.get(h)??h,ac_cid:h,verdict:f.verdict}),p.push(h)}a.push(be(i,s,u,i.unresolved_acs??[])),c.push({about_cid:s,per_ac:p})}if(o.length>0)return{record:null,errors:o};let d;try{d=T(t,{ts:new Date().toISOString(),proposal_id:null,nodes:[],edges:[],review:[],supersessions:[],executions:a,...n.eventIds&&n.eventIds.length>0?{event_ids:n.eventIds}:{},source_head_moves:{}},{expectPrev:e.latestHash,intent:{v:1,verb:"execution",args:L({facts:n.facts,by:n.by,eventIds:n.eventIds??null}),pins:{facts:c}},busyRetry:{deadlineMs:n.lockDeadlineMs??5e3},provenance:n.provenance})}catch(i){if(i instanceof I)return"cas";throw i}let l;try{O(t)}catch(i){l=`facts committed, but the projection refresh failed (${i instanceof Error?i.message:String(i)}) \u2014 read state rebuilds on the next open`}return{record:d.record,errors:null,...l?{warnings:[l]}:{}}}function pt(t){let e={failed:3,broken:2,skipped:1,passed:0},n=new Map;for(let o of t)for(let a of o.verifies??[]){let c=n.get(a);(c===void 0||(e[o.status]??0)>(e[c]??0))&&n.set(a,o.status)}return[...n.entries()].map(([o,a])=>({ref:o,verdict:a}))}function ft(t){let e=[],n=me(t.cwd);if(!S(n))return{synced:0,superseded:0,skipped:"no-context",warnings:e};let o=t.by??{kind:"ai",id:"exec-sync"},a=t.lockDeadlineMs;try{Pe(n,e,a)}catch(r){e.push(`sync: parked-facts replay failed (${r instanceof Error?r.message:String(r)}) \u2014 queue intact, retrying next sync`)}let c=$(n),d=[],l=0,i=new Set,g=new Set(t.members.map(r=>G(r.path)?r.path:q(t.cwd,r.path))),m=new Map;for(let r of t.members){let u=G(r.path)?r.path:q(t.cwd,r.path);if(!S(u)){e.push(`sync: member file missing: ${u} \u2014 skipped, no fact attached`);continue}for(let p of Me(u,e))if(!i.has(p.path))try{let f=p.path===u,_=!f&&g.has(p.path),h=f?void 0:R(k(u,"utf8"))?.id,b=k(p.path,"utf8"),y=R(b);if(!y?.id){i.add(p.path);continue}let E=c.resolve(y.id),w=E?c.tipOf(E.cid):null;if(!E||!w||c.superseded.has(w)){i.add(p.path),e.push(`sync: ${y.id} does not resolve to a live test \u2014 skipped (foreign store?)`);continue}let C=D(U(b,se(Q(p.path),c))),Ae=String(c.getNode(w)?.content.test_md_blob??""),N=D(U(Ae,ie(c))),A=!1,j=w;if(C===N)y.base!==N&&xe(p.path,b,N,e);else if(y.base===N){let v=Ge(n,c,w,b,C,Q(p.path),o);v.error?(e.push(`sync: could not supersede ${y.id}: ${v.error}`),A=!0):(l++,j=v.newCid,A=v.oracleTier,xe(p.path,k(p.path,"utf8"),C,e),c=$(n))}else A=!0,e.push(y.base?`sync: ${y.id} was edited from an older version \u2014 graph kept; reconcile via a redesign or maintain`:`sync: ${y.id} carries no base pin (hand-copied file?) \u2014 fact attached with drift flag`);if(_){A&&m.set(p.path,!0);continue}i.add(p.path);let K=c.getNode(j)?.content.check,z=f?r.acs??[]:[],X=z.filter(v=>Se(c,v.ref)),Y=z.filter(v=>!Se(c,v.ref)).map(v=>v.ref);d.push({ref:y.id,about_cid:j,definition_id_at_run:C,verdict:r.verdict,...X.length?{per_ac:X.map(v=>{let Z=we(c,v.ref);return{ac_ref:v.ref,...Z?{ac_cid:Z}:{},verdict:v.verdict}})}:{},drift_flag:A||m.get(p.path)===!0||f&&r.driftFlag===!0,oracle_mode:K?.expected_mode??(ee(K?.operand)?"runtime-derived":"inferred"),stale_at_run:c.stale(j)!=="fresh",...Y.length?{unresolved_acs:Y}:{},execution_id:r.executionId,...r.evidenceId?{evidence_id:r.evidenceId}:{},...r.durationMs!==void 0?{duration_ms:r.durationMs}:{},started_at:r.startedAt,mode:r.mode,local:r.local,...h?{via_parent:h}:{}})}catch(f){p.path!==u&&g.has(p.path)||i.add(p.path),e.push(`sync: ${p.path} failed to sync (${f instanceof Error?f.message:String(f)}) \u2014 skipped; other members unaffected`)}}if(d.length===0)return{synced:0,superseded:l,warnings:e};let s;try{s=ye(n,$(n),{facts:d,by:o,eventIds:d.map(r=>`exec-fact:${r.execution_id}:${r.ref}`),lockDeadlineMs:a})}catch(r){return e.push(`sync facts: commit threw: ${r instanceof Error?r.message:String(r)}`),$e(n,d,o,e,a),{synced:0,superseded:l,warnings:e}}return s.errors?($e(n,d,o,e,a),e.push(...s.errors.map(r=>`sync facts: ${r.code}: ${r.detail}`)),{synced:0,superseded:l,warnings:e}):(s.warnings&&e.push(...s.warnings.map(r=>`sync facts: ${r}`)),{synced:d.length,superseded:l,warnings:e})}var W=".pending-facts.bad";function $e(t,e,n,o,a){try{let c={by:n,ts:new Date().toISOString(),facts:e.map(i=>({...i,about_cid:i.about_cid??"",event_id:`exec-fact:${i.execution_id}:${i.ref}`}))},d=null;try{d=P(t,{deadlineMs:a??5e3})}catch{d=null}let l=F(t,H);try{if(d)Ie(l,JSON.stringify(c)+`
|
|
3
3
|
`);else{l=F(t,ge());let i=Ne(l,"wx");try{J(i,JSON.stringify(c)+`
|
|
4
4
|
`),Ce(i)}finally{Oe(i)}le(t),o.push(`sync facts: store lock busy \u2014 parked to ${l}; it drains on the next sync`)}}finally{d?.()}o.push(`sync facts: commit failed \u2014 ${e.length} fact(s) parked to ${l}; they replay on the next sync`)}catch(c){o.push(`sync facts: could not park the failed batch (${c instanceof Error?c.message:String(c)}) \u2014 this run's facts are LOST`)}}function Pe(t,e,n){let o=F(t,H);if(!S(o)&&!je(t).some(m=>he.test(m)))return;let a=ue(t);if(a){e.push(`sync: parked facts stay queued while rebase ${a.id} is open \u2014 they drain on the first sync after it is finished`);return}let c;{let m=P(t,{deadlineMs:n??5e3});try{_e(t),c=S(o)?k(o,"utf8"):""}finally{m()}}let d=c.split(`
|
|
5
5
|
`).filter(m=>m.trim()!=="");if(d.length===0)return;let l=new Set,i=[],g=[];for(let m of d){let s=null;try{let u=JSON.parse(m);u&&Array.isArray(u.facts)&&(s=u)}catch{}if(!s){i.push(m),l.add(m);continue}let r=Ee(t,s);if(r.errors){if(r.errors.some(u=>u.code==="STALE_BASIS")){e.push(`sync: parked facts replay deferred (${r.errors[0].detail}) \u2014 retrying next sync`);continue}i.push(m),l.add(m),e.push(`sync: parked facts line quarantined to ${F(t,W)} (${r.errors.map(u=>`${u.code}: ${u.detail}`).join("; ")})`);continue}for(let u of r.rejected){let p=s.facts.find(f=>f.event_id===u.event_id);g.push({parent:m,line:JSON.stringify({...p??{event_id:u.event_id},_reason:u.errors})})}r.rejected.length>0&&e.push(`sync: ${r.rejected.length} parked fact(s) quarantined to ${F(t,W)} (${r.rejected.map(u=>u.errors.map(p=>`${p.code}: ${p.detail}`).join("; ")).join(" | ")})`),l.add(m),r.warnings&&e.push(...r.warnings.map(u=>`sync: ${u}`)),r.applied.length>0&&e.push(`sync: replayed ${r.applied.length} parked fact(s) from a previous run`)}if(l.size!==0)try{let m=P(t,{deadlineMs:n??5e3});try{let r=(S(o)?k(o,"utf8"):"").split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as S}from"./chunk-I7TIGB7K.js";import{a as x,b as P,c as C,d as V,e as j}from"./chunk-
|
|
2
|
+
import{a as S}from"./chunk-I7TIGB7K.js";import{a as x,b as P,c as C,d as V,e as j}from"./chunk-SYKBHHAJ.js";import{a as R,b as D}from"./chunk-KDNNMU7Q.js";import{o as f,p as k,z as y}from"./chunk-IICT4VOU.js";import{e as b}from"./chunk-3UI5VTQS.js";import{f as w}from"./chunk-FQNQVC5O.js";function I(o,t){return{contextDir:o,rootSid:t,locks:w(o,t),probe:S(o,{resolveAlias:i=>P(i),embed:(i,s)=>C(i,s),readVector:(i,s)=>V(o,i,s),writeVector:(i,s,n)=>j(o,i,s,n)})}}var N=new Set(["archive"]);async function Y(o,t,i,s){let n=y(o.contextDir);if(i.v==="defer")return{outcome:"deferred"};if(t.kind==="MODIFY_HELD"){if(!t.heldPayload)return{outcome:"failed",detail:`${t.ref} carries no held payload`};let e=t.heldPayload;if(i.v==="keep_current"){if(!e.event_id)return{outcome:"failed",detail:`this held row has no durable event id \u2014 resume the owner to drop it: kane-cli context extract --resume ${e.sid}`};let{commitChatTurn:r}=await import("./chat-committer-6D7AQI6Z.js"),u=r({contextDir:o.contextDir,graph:n,ops:[{kind:"resolve_question",questionId:`drop-held:${e.sid}:${e.tempRef}`,resolution:"deferred",eventId:e.event_id}],by:s});return u.errors?{outcome:"failed",detail:u.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"held-dropped"}),{outcome:"committed",detail:"held payload dropped (recorded) \u2014 the owner's resume will not re-present it"})}if(i.v==="approve"){let r=e.content._held??null;if(!r?.source_id||!r.source_cid||!r.anchor||!r.quote)return{outcome:"failed",detail:`this held row carries no committable provenance \u2014 resume the owner to apply it: kane-cli context extract --resume ${e.sid}`};{let a=n.mediaOf(r.source_cid),m=R(o.contextDir,n,r.source_cid),g=a.format==="image"?null:m?D(m):null;if(a.format!=="image"&&g===null)return{outcome:"failed",detail:`the pinned source ${r.source_id} (${r.source_cid.slice(0,19)}) has no citable text to verify this held row against \u2014 resume the owner: kane-cli context extract --resume ${e.sid}`};let _=b(a,{anchor:r.anchor,quote:r.quote},g);if(_.length>0)return{outcome:"failed",detail:`held provenance does not verify against the pinned source (${_.map($=>`${$.code}: ${$.detail}`).join("; ")}) \u2014 resume the owner: kane-cli context extract --resume ${e.sid}`}}let{commitProposal:u}=await import("./committer-2QPBANRD.js"),{_held:d,...c}=e.content,q={version:1,read_basis:n.latestHash,source:{source_id:r.source_id,source_cid:r.source_cid},use_cases:[{temp_ref:e.tempRef,title:String(c.title??e.tempRef),...c.summary!==void 0?{summary:c.summary}:{},risk:String(c.risk??"med"),cite:{anchor:r.anchor,quote:r.quote},depends_on_hint:[],matches_existing:null}]},l=await x(I(o.contextDir,o.rootSid??`review-${process.pid}`),{verb:"maintain",ucTargets:[],newBuCandidates:[{tempRef:e.tempRef,title:String(c.title??e.tempRef),probeText:`${String(c.title??"")} ${String(c.summary??"")}`.trim()}],sourcePins:[{source_id:r.source_id,source_cid:r.source_cid}],readBasis:n.latestHash,...e.event_id?{eventIds:[e.event_id]}:{}},a=>{let m=u({contextDir:o.contextDir,graph:a.graph,proposal:q,proposalId:null,verdicts:new Map([[e.tempRef,{resolution:"skipped"}]]),by:s,autoName:!0,allowStaleBasis:!0,eventIds:e.event_id?[e.event_id]:a.eventIds("maintain",1),sid:a.sid,probeHits:a.probeHits});return m.errors!==null?{errors:m.errors}:{result:m,record:m.record}}),h=l.ok&&"result"in l?l.result:{record:null,errors:l.ok?null:l.kind==="validation"?l.errors:[{code:l.kind==="contended"?l.err.code:"UNSETTLED",detail:l.kind==="contended"?`held by ${l.err.holder?.owner_sid??"another session"}`:"concurrent activity kept moving the store"}]};return h.errors?{outcome:"failed",detail:h.errors.map(a=>`${a.code}: ${a.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"held-applied"}),{outcome:"committed",detail:`held payload committed (derived) by ${s.id}`})}return{outcome:"failed",detail:`verdict ${i.v} does not apply to a MODIFY_HELD card`}}let v=n.resolve(t.ref);if(!v)return{outcome:"failed",detail:`${t.ref} names nothing in the graph`};let p=n.tipOf(v.cid);if(i.v==="archive"){if(!i.because||!i.because.trim())return{outcome:"failed",detail:"archive requires --because (a reason the record keeps)"};let e=f({contextDir:o.contextDir,graph:n,verdicts:new Map([[p,{resolution:"rejected",reason:i.because}]]),by:s});return e.errors?{outcome:"failed",detail:e.errors.map(r=>`${r.code}: ${r.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"archived",reason:i.because}),{outcome:"retired"})}if(i.v==="approve"){let e=f({contextDir:o.contextDir,graph:n,verdicts:new Map([[p,{resolution:"approved"}]]),by:s});return e.errors?{outcome:"failed",detail:e.errors.map(r=>`${r.code}: ${r.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"approved"}),{outcome:"applied"})}if(i.v==="merge"||i.v==="keep_both"){if(t.kind!=="PAIR"||!t.pair)return{outcome:"failed",detail:`${t.ref} is not a PAIR card`};let e=n.resolve(t.pair.candidate_cid);if(!e)return{outcome:"failed",detail:`pair candidate ${t.pair.candidate_ref} names nothing`};let r=n.tipOf(e.cid);if(i.v==="merge"){let d=k({contextDir:o.contextDir,graph:n,survivor:r,merged:p,reason:`pair merge: duplicate of ${t.pair.candidate_ref} (score ${t.pair.score})`,by:s});return d.errors?{outcome:"failed",detail:d.errors.map(c=>`${c.code}: ${c.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"pair-merged",reason:t.pair.candidate_ref}),{outcome:"committed",detail:`merged into ${t.pair.candidate_ref} \u2014 survivor stays derived`})}let u=f({contextDir:o.contextDir,graph:n,verdicts:new Map([[p,{resolution:"approved"}],[r,{resolution:"approved"}]]),by:s});return u.errors?{outcome:"failed",detail:u.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")}:(o.signals?.({ref:t.ref,verdict:"pair-kept-both",reason:t.pair.candidate_ref}),{outcome:"applied",detail:"both promoted as distinct"})}return{outcome:"failed",detail:`verdict ${i.v} does not apply to a ${t.kind} card`}}export{I as a,N as b,Y as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as g}from"./chunk-
|
|
2
|
+
import{b as g}from"./chunk-MI6UFDRC.js";import{readFileSync as o,writeFileSync as h,mkdirSync as u,readdirSync as a,unlinkSync as s,existsSync as l,chmodSync as f}from"fs";import{join as n,dirname as P}from"path";var d=class{baseDir;profilesDir;configFile;constructor(t=g){this.baseDir=t,this.profilesDir=n(t,"profiles"),this.configFile=n(t,"config.json")}readConfig(){try{return JSON.parse(o(this.configFile,"utf-8"))}catch{return{}}}writeConfig(t){u(this.baseDir,{recursive:!0,mode:448}),h(this.configFile,JSON.stringify(t,null,2)+`
|
|
3
3
|
`),f(this.configFile,384)}getActiveProfile(){return this.readConfig().active_profile??null}setActiveProfile(t){let i=this.readConfig();i.active_profile=t,this.writeConfig(i)}getDefaultEnv(){return this.readConfig().default_env??"prod"}setDefaultEnv(t){let i=this.readConfig();i.default_env=t,this.writeConfig(i)}credentialsPath(t,i){return n(this.profilesDir,t,i,"credentials")}clientPath(t,i){return n(this.profilesDir,t,i,"client.json")}basicAuthPath(t,i){return n(this.profilesDir,t,i,"basic-auth")}profileConfigPath(t,i){return n(this.profilesDir,t,i,"profile-config.json")}saveProfileConfig(t,i,r){let e=this.loadProfileConfig(t,i)??{};this.writeSecure(this.profileConfigPath(t,i),{...e,...r})}loadProfileConfig(t,i){try{return JSON.parse(o(this.profileConfigPath(t,i),"utf-8"))}catch{return null}}writeSecure(t,i){try{u(P(t),{recursive:!0,mode:448}),h(t,JSON.stringify(i,null,2)+`
|
|
4
4
|
`),f(t,384)}catch(r){let e=r instanceof Error?r.message:String(r);process.stderr.write(`[auth] Failed to save credentials: ${e}
|
|
5
5
|
`)}}saveCredentials(t,i,r){this.writeSecure(this.credentialsPath(t,i),r)}loadCredentials(t,i){try{return JSON.parse(o(this.credentialsPath(t,i),"utf-8"))}catch{return null}}saveClient(t,i,r){this.writeSecure(this.clientPath(t,i),r)}loadClient(t,i){try{return JSON.parse(o(this.clientPath(t,i),"utf-8"))}catch{return null}}getActiveCredentials(){let t=this.getActiveProfile();if(!t)return{credentials:null,profile:null,env:null};let i=this.getDefaultEnv();return{credentials:this.loadCredentials(t,i),profile:t,env:i}}saveBasicAuth(t,i,r){this.writeSecure(this.basicAuthPath(t,i),r)}loadBasicAuth(t,i){try{return JSON.parse(o(this.basicAuthPath(t,i),"utf-8"))}catch{return null}}deleteBasicAuth(t,i){try{s(this.basicAuthPath(t,i))}catch{}}resolveAuth(){let t=this.getActiveProfile();if(!t)return null;let i=this.getDefaultEnv(),r=this.loadBasicAuth(t,i);return r?{method:"basic",...r,profile:t,env:i}:this.loadCredentials(t,i)?{method:"oauth",profile:t,env:i}:null}listProfiles(){let t=[];try{for(let i of a(this.profilesDir)){let r=n(this.profilesDir,i);try{for(let e of a(r)){let c=n(r,e),v=l(n(c,"credentials")),p=l(n(c,"client.json")),y=l(n(c,"basic-auth"));(v||p||y)&&t.push({profile:i,env:e})}}catch{}}}catch{}return t}deleteProfile(t,i){try{s(this.credentialsPath(t,i))}catch{}if(this.getActiveProfile()===t){let r=this.readConfig();delete r.active_profile,this.writeConfig(r)}}deleteProfileFull(t,i){if(i){try{s(this.credentialsPath(t,i))}catch{}try{s(this.clientPath(t,i))}catch{}try{s(this.basicAuthPath(t,i))}catch{}try{s(this.profileConfigPath(t,i))}catch{}}else try{let r=n(this.profilesDir,t);for(let e of a(r)){try{s(n(r,e,"credentials"))}catch{}try{s(n(r,e,"client.json"))}catch{}try{s(n(r,e,"basic-auth"))}catch{}try{s(n(r,e,"profile-config.json"))}catch{}}}catch{}}};export{d as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as $}from"./chunk-YCCUBQY4.js";import{a as U}from"./chunk-
|
|
2
|
+
import{a as $}from"./chunk-YCCUBQY4.js";import{a as U}from"./chunk-QG5OZHRH.js";import{a as k}from"./chunk-2KVECC36.js";import{a as _}from"./chunk-KMMOJDN4.js";import{a as T}from"./chunk-DGQKGGCB.js";import{y as i}from"./chunk-MI6UFDRC.js";import{a as O}from"./chunk-HCBYKLMW.js";import{a as u,b as s}from"./chunk-C44QQJR4.js";import{a as K}from"./chunk-6YGTRKDT.js";import{e as S}from"./chunk-UR6MHSHU.js";var e=S(K(),1);var r=S(O(),1);function V(n,x,c){return{id:n,label:`${x} (${n})`,isActive:n===c}}function se({resolver:n,currentProjectId:x,env:c,onSelect:w,onCancel:C}){let[q,B]=(0,e.useState)([]),[D,l]=(0,e.useState)(!0),[H,m]=(0,e.useState)(!1),[J,g]=(0,e.useState)(!1),[Q,P]=(0,e.useState)(null),[d,p]=(0,e.useState)("list"),[v,R]=(0,e.useState)(""),[E,h]=(0,e.useState)(null),[I,X]=(0,e.useState)(""),b=(0,e.useRef)(!1),A=(0,e.useRef)(!0);(0,e.useEffect)(()=>{if(!n){P("Login first to browse projects"),l(!1);return}let o=new AbortController,a=I.trim();return A.current?l(!0):a&&g(!0),m(!0),P(null),(async()=>{try{let t=n.cached??await n.resolve();if(!t){P("Login first to browse projects"),l(!1),m(!1),g(!1);return}let L=T(c),F=new k(L.tmsBaseUrl,t.username,t.access_key),f=!0,N=0,G=a?{signal:o.signal,name:a,perPage:10}:{signal:o.signal,perPage:10};for await(let y of F.listProjectsStream(G)){if(f&&(l(!1),g(!1),A.current=!1,f=!1),y.totalLoaded===0&&y.done&&N===0&&!a){b.current=!0,p("naming"),m(!1);return}let M=y.projects.map(j=>V(j.project_id,j.name,x));B(N===0?M:j=>[...j,...M]),N+=y.projects.length,y.done&&m(!1)}f&&(l(!1),m(!1),g(!1))}catch(t){if(t?.name==="AbortError")return;P(t instanceof Error?t.message:String(t)),l(!1),m(!1),g(!1)}})(),()=>o.abort()},[n,x,c,I]);let Y=(0,e.useCallback)(o=>{let a=o.trim();if(!a){h("Name cannot be empty");return}h(null),p("creating"),(async()=>{try{if(!n)throw new Error("Not authenticated");let t=n.cached??await n.resolve();if(!t)throw new Error("Not authenticated");let L=T(c),f=await new k(L.tmsBaseUrl,t.username,t.access_key).createProject(a);w(f.id,f.name)}catch(t){h(t instanceof Error?t.message:String(t)),p("naming")}})()},[n,c,w]),z=(0,e.useCallback)(()=>{R(""),h(null),b.current?C():p("list")},[C]);return d==="naming"||d==="creating"?(0,r.jsxs)(u,{flexDirection:"column",borderStyle:"round",borderColor:i.orange,paddingX:2,paddingY:1,children:[(0,r.jsx)(s,{color:i.orange,bold:!0,children:"Create new project"}),b.current&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.dim,children:"No projects yet \u2014 let's create one."})}),(0,r.jsxs)(u,{marginTop:1,children:[(0,r.jsx)(s,{color:i.dim,children:"Name: "}),d==="naming"?(0,r.jsx)($,{value:v,onChange:o=>{R(o),E&&h(null)},onSubmit:Y,onCancel:z}):(0,r.jsx)(s,{children:v})]}),E&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.red,children:E})}),d==="creating"&&(0,r.jsx)(u,{marginTop:1,children:(0,r.jsx)(s,{color:i.dim,children:"Creating..."})}),d==="naming"&&(0,r.jsx)(_,{bindings:[{keys:"\u21B5",label:"create"}],escBackLabel:b.current?"cancel":"back"})]}):(0,r.jsx)(U,{title:"Projects",items:q,loading:D,loadingMore:H,searching:J,preserveSelectionById:!0,onSearch:X,error:Q,itemNoun:"projects",onTab:()=>{b.current=!1,p("naming")},extraHint:"tab to create new",onSelect:o=>{let a=o.label.replace(` (${o.id})`,"");w(o.id,a)},onCancel:C})}export{V as a,se as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as s}from"./chunk-FY7WTTDQ.js";import{promises as o}from"fs";import{basename as d,join as a}from"path";function l(t){let e=(t??"").trim().replace(/^lt:\/\//i,"").trim();if(e)return(s(e)?e:d(e))||void 0}function g(t){return t.replace(/\([^)]*\)/g," ").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||void 0}async function w(t){try{let e=a(t,"steps"),u=(await o.readdir(e,{withFileTypes:!0})).filter(n=>n.isDirectory()).map(n=>n.name).sort((n,i)=>(parseInt(n,10)||0)-(parseInt(i,10)||0));for(let n of u)try{let i=await o.readFile(a(e,n,"step.json"),"utf8"),r=JSON.parse(i).basis?.window;if(Array.isArray(r)&&r.length===2&&Number.isFinite(Number(r[0]))&&Number.isFinite(Number(r[1]))&&Number(r[0])>0&&Number(r[1])>0)return`${Math.round(Number(r[0]))}x${Math.round(Number(r[1]))}`}catch{}return}catch{return}}export{l as a,g as b,w as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as l}from"./chunk-RZ4F3BHX.js";import{a,b as c,e as o}from"./chunk-
|
|
2
|
+
import{a as l}from"./chunk-RZ4F3BHX.js";import{a,b as c,e as o}from"./chunk-MI6UFDRC.js";import{readFileSync as f,writeFileSync as d,mkdirSync as h,realpathSync as g}from"fs";import{join as y}from"path";var C="npm install -g @testmuai/kane-cli@latest",b="brew upgrade lambdatest/kane/kane-cli";function w(){try{let t=process.argv[1];if(t&&g(t).includes("/Cellar/"))return b}catch{}return C}var m=y(c,"version-check.json"),S=1440*60*1e3;function k(){try{let t=JSON.parse(f(m,"utf-8"));if(Date.now()-t.checkedAt<S)return t}catch{}return null}function A(t){try{h(c,{recursive:!0}),d(m,JSON.stringify({latest:t,checkedAt:Date.now()}))}catch{}}function u(t,r){let i=t.split(".").map(Number),n=r.split(".").map(Number);for(let s=0;s<3;s++){let e=(n[s]??0)-(i[s]??0);if(e!==0)return e}return 0}function p(t,r){let i=t.split(".").map(Number),n=r.split(".").map(Number);return(n[0]??0)!==(i[0]??0)?"major":(n[1]??0)!==(i[1]??0)?"minor":"patch"}async function j(){try{let t=k();if(t)return u(a,t.latest)>0?{current:a,latest:t.latest,severity:p(a,t.latest)}:null;let r=new AbortController,i=setTimeout(()=>r.abort(),5e3),n=await l(o,{headers:{Accept:"application/json"},signal:r.signal});if(clearTimeout(i),!n.ok)return null;let e=(await n.json())["dist-tags"]?.latest;return e?(A(e),u(a,e)>0?{current:a,latest:e,severity:p(a,e)}:null):null}catch{return null}}export{w as a,u as b,p as c,j as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as $e}from"./chunk-
|
|
2
|
+
import{e as $e}from"./chunk-J4Z34AZN.js";import{a as te}from"./chunk-CP2TVGKB.js";import{a as K}from"./chunk-5Y2G4NC7.js";import{a as Be}from"./chunk-ICPCU7AL.js";import{a as ve}from"./chunk-4HPJ4S6H.js";import{y as i}from"./chunk-MI6UFDRC.js";import{b as ye}from"./chunk-DFS4RMVP.js";import{a as k}from"./chunk-HCBYKLMW.js";import{a as s,b as o,i as Se,j as Te,k as ee}from"./chunk-C44QQJR4.js";import{a as V}from"./chunk-6YGTRKDT.js";import{e as R}from"./chunk-UR6MHSHU.js";var A=R(V(),1);var C=R(V(),1);function de(e){let t=e.flatMap(u=>[u,...u.children??[]]),n=t.filter(u=>u.status==="passed").length,l=t.filter(u=>u.status==="failed").length,a=t.filter(u=>u.status==="passed"||u.status==="failed").length;return{passed:n,failed:l,total:a}}function we(e){let t=$e(e.screenshotDispatcher,e.stepLogger,e.onReasoning,e.onStepComplete),[n,l]=(0,C.useState)(0),[a,u]=(0,C.useState)("idle"),c=(0,C.useRef)("idle"),v=(0,C.useRef)(0),S=(0,C.useRef)(!1),T=(0,C.useRef)(null),d=(0,C.useRef)(null),L=(0,C.useCallback)(h=>{c.current=h,u(h)},[]),O=(0,C.useCallback)(async h=>{let b=await e.getNextConfig(h);if(!b){L("done"),e.onAllComplete?.();return}let B=h?v.current+1:0;v.current=B,l(B),e.onStepStart?.(b,B),T.current=null,d.current=null,L("running"),await t.startRun(b,e.spawnOpts)},[t,e,L]);(0,C.useEffect)(()=>{S.current||(S.current=!0,O(null))},[]),(0,C.useEffect)(()=>{if(!t.lastRunEnd||t.lastRunEnd===T.current||c.current!=="running")return;T.current=t.lastRunEnd,c.current="transitioning",u("transitioning");let h=t.lastRunEnd,b=de(t.steps),B=t.bifurcationInfo,F={status:h.status==="passed"?"passed":"failed",duration_s:h.duration??0,reason:h.reason,runEnd:h,hadError:!1,stepsPassed:b.passed,stepsFailed:b.failed,stepsTotal:b.total,bifurcationFlows:B&&!B.isSingleFlow?B.flows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(F,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(F)},[t.lastRunEnd]),(0,C.useEffect)(()=>{if(!t.runError||t.runError===d.current||t.lastRunEnd||c.current!=="running")return;d.current=t.runError,c.current="transitioning",u("transitioning");let h=de(t.steps),b={status:"failed",duration_s:0,reason:t.runError,runEnd:null,hadError:!0,stepsPassed:h.passed,stepsFailed:h.failed,stepsTotal:h.total,bifurcationFlows:null,evidence:t.getEvidenceState()};if(!(e.onStepEnd?.(b,v.current)??!0)){L("done"),e.onAllComplete?.();return}O(b)},[t.runError,t.lastRunEnd]);let y=(0,C.useCallback)(()=>{t.cancelRun()},[t]);return{runner:t,currentStepIndex:n,phase:a,cancel:y}}var pe=R(V(),1);var ne=R(k(),1),Ee=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function ke({label:e,hasBifurcation:t=!1}){let[n,l]=(0,pe.useState)(0),[a,u]=(0,pe.useState)(0);K(()=>{l(v=>(v+1)%Ee.length)},80),K(()=>{u(v=>(v+1)%4)},400);let c=e??(t?"Planning approach":"Analyzing objective");return(0,ne.jsxs)(s,{marginLeft:1,children:[(0,ne.jsxs)(o,{color:i.orange,children:[Ee[n]," "]}),(0,ne.jsxs)(o,{color:i.dim,children:[c,".".repeat(a+1)]})]})}function Ie(e){if(!e.isRunning||e.replayInfo)return null;let t=e.bifurcationInfo;if(t&&!t.isSingleFlow){let n=e.steps.findIndex(a=>a.status==="running");return(n===-1?e.cmInitCounts.length===0:n>=e.cmInitCounts.length)?{label:n>0?`Planning flow ${n+1}`:void 0,hasBifurcation:!0}:null}return e.cmInitCounts.length>0||e.steps.some(n=>n.children?.length)?null:{hasBifurcation:!!t}}var I=R(V(),1);var Ce=R(V(),1);var re=R(k(),1),He="#ffc580",Ue="#ffd9a8",Le="#ffffff";function oe({text:e,active:t=!0}){let[n,l]=(0,Ce.useState)(0),a=4;if(K(()=>{l(c=>(c+1)%(e.length+a*2))},t?80:null),!t)return(0,re.jsx)(o,{color:Le,children:e});let u=e.split("").map((c,v)=>{let S=n-a,T=Math.abs(v-S-a/2),d;return T<=a/2?d=He:T<=a?d=Ue:d=Le,(0,re.jsx)(o,{color:d,children:c},v)});return(0,re.jsx)(o,{children:u})}var _=R(k(),1),We={starting:i.orange,running:i.orange,passed:i.green,failed:i.red,cancelled:i.dim,timed_out:i.orange};function ie({currentStep:e,maxSteps:t,elapsed:n,status:l}){let a=We[l]??i.orange,u=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`;return(0,_.jsxs)(s,{marginLeft:3,children:[(0,_.jsx)(o,{color:i.dim,children:"Steps "}),(0,_.jsx)(o,{bold:!0,children:e}),(0,_.jsxs)(o,{color:i.dim,children:["/",t]}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Elapsed "}),(0,_.jsx)(o,{bold:!0,children:u}),(0,_.jsx)(o,{children:" "}),(0,_.jsx)(o,{color:i.dim,children:"Status "}),(0,_.jsx)(o,{bold:!0,color:a,children:l})]})}var Ve={click:"\u25CF",type:"\u229E",scroll:"\u2195",navigate:"\u2192",analyze:"\u25CE",assert:"\u25C8","if-else":"\u2442",select:"\u25BC",press_key:"\u21B5",wait:"\u2026",tool_call:"\u2299"};function Oe(e){return Ve[e]??"\u25CF"}var q=R(k(),1);function fe({steps:e,flows:t,cmInitCounts:n,renderStep:l}){return(0,q.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[(0,q.jsxs)(o,{color:i.dim,children:["\u2501\u2501 Bifurcated into ",t?.length??e.length," flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"]}),e.map((a,u)=>(0,q.jsxs)(s,{flexDirection:"column",marginTop:u>0?1:0,children:[(0,q.jsxs)(o,{color:i.orange,children:["Flow ",u+1,": ",t?.[u]??a.objective]}),n&&n[u]!=null&&(0,q.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",n[u]," checkpoints"]}),a.children&&a.children.length>0?a.children.map(c=>{let v=!!c.branchObjective,S=`f${u}-${c.childId??"p"}-${c.index}`;return v?(0,q.jsxs)(s,{flexDirection:"column",children:[l({...c,children:void 0},S),(c.children??[]).map(T=>(0,q.jsx)(s,{marginLeft:2,children:l(T,`${S}-${T.childId??"p"}-${T.index}`)},`${S}-${T.childId??"p"}-${T.index}`))]},`${S}-host`):l(c,S)}):a.status==="pending"&&(0,q.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})]},u))]})}var H=R(k(),1);function Pe({label:e,shimmer:t=!1}){return(0,H.jsxs)(s,{marginLeft:6,children:[(0,H.jsx)(te,{}),(0,H.jsx)(o,{children:" "}),t?(0,H.jsx)(oe,{text:e,active:!0}):(0,H.jsx)(o,{color:i.dim,children:e})]})}var De=R(V(),1);var me=R(k(),1);function ze(e,t){let n=[];for(let l of e.split(`
|
|
3
3
|
`)){if(l===""){n.push("");continue}let a="";for(let u of l.split(" ")){let c=u;for(;c.length>t;)a&&(n.push(a),a=""),n.push(c.slice(0,t)),c=c.slice(t);a===""?a=c:a.length+1+c.length<=t?a+=" "+c:(n.push(a),a=c)}n.push(a)}return n}function je({text:e,maxLines:t=3}){let{stdout:n}=ee(),l=Math.max(20,(n?.columns??80)-7),a=!e.trim(),[u,c]=(0,De.useState)(!0);K(()=>c(T=>!T),500);let v=(a?"Thinking\u2026":e)+(u?"\u258C":" "),S=ze(v,l).slice(-t);for(;S.length<t;)S.push("");return(0,me.jsx)(s,{borderStyle:"round",borderColor:i.muted,paddingX:1,marginLeft:3,flexDirection:"column",children:S.map((T,d)=>(0,me.jsx)(o,{color:a?i.dim:i.secondary,wrap:"truncate-end",children:T.length?T:" "},d))})}var U=R(k(),1);function se({activity:e,describe:t,describeVisible:n}){return(0,U.jsxs)(U.Fragment,{children:[e?(0,U.jsx)(Pe,{label:e.label,shimmer:e.shimmer}):null,n?(0,U.jsx)(je,{text:t??""}):null]})}var r=R(k(),1);function le(e){for(let t of e){if(t.children&&t.children.length>0){let n=le(t.children);if(n)return n}if(t.status==="running")return t}}function z(e){return e.status==="running"&&!e.branchObjective&&(!e.children||e.children.length===0)}function Fe(e){let t=[];for(let n of e)z(n)||(n.children&&n.children.length>0?t.push({...n,children:Fe(n.children)}):t.push(n));return t}function ge(e,t){if(!e)return null;let n=e.objective??"";return n.length>0&&!/^Step \d+$/.test(n)?{label:n+"\u2026",shimmer:!1}:{label:t?"Looking at the screen\u2026":"Deciding next action\u2026",shimmer:!0}}function P({step:e,indent:t=2}){let n=e.actionType?Oe(e.actionType):null,l=e.status==="running",a=e.status==="passed",u=e.status==="failed",c=e.status==="pending"||e.status==="stopped",{stdout:v}=ee(),S=v?.columns??80,T=Math.max(20,S-t-21),d=e.objective??"",L=d.length>T?d.slice(0,T-1)+"\u2026":d,O=(e.duration??0)*1e3,y=e.duration!=null?O<1e3?`${Math.round(O)}ms`:`${(O/1e3).toFixed(1)}s`:"";return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsxs)(s,{marginLeft:t,children:[(0,r.jsx)(s,{width:4,children:(0,r.jsxs)(o,{color:i.muted,children:[String(e.index).padStart(2," ")," "]})}),(0,r.jsx)(s,{width:3,children:l?(0,r.jsx)(te,{}):a?(0,r.jsx)(o,{color:i.green,bold:!0,children:"\u2713"}):u?(0,r.jsx)(o,{color:i.red,bold:!0,children:"\u2717"}):(0,r.jsx)(o,{color:i.muted,children:"\u25CB"})}),(0,r.jsx)(s,{flexGrow:1,children:l?(0,r.jsx)(oe,{text:L,active:!0}):u?(0,r.jsx)(o,{color:i.red,children:L}):c?(0,r.jsx)(o,{color:i.dim,children:L}):(0,r.jsx)(o,{color:i.dim,children:L})}),(a||u)&&n?(0,r.jsx)(s,{width:3,marginLeft:1,children:(0,r.jsx)(o,{color:i.muted,children:n})}):(0,r.jsx)(s,{width:3,marginLeft:1}),(0,r.jsx)(s,{width:7,justifyContent:"flex-end",children:(0,r.jsx)(o,{color:i.dim,children:y})})]}),e.children&&e.children.length>0&&(0,r.jsx)(s,{flexDirection:"column",children:e.children.map((h,b)=>(0,r.jsx)(P,{step:h,indent:t+2},`child-${b}`))})]})}function Xe(e){return e.type==="cm_init"?(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",e.count," checkpoints"]})}):(0,r.jsx)(s,{marginLeft:2,paddingLeft:1,children:(0,r.jsx)(P,{step:e.step})})}function _e({steps:e,bifurcated:t,flows:n,cmInitCounts:l,maxSteps:a=50,staticSteps:u=!1,onStepCommit:c,describe:v,describeVisible:S,describeRevealing:T}){let d=(0,I.useRef)(new Set),L=(0,I.useRef)(!1),O=(0,I.useRef)(new Set),y=(0,I.useRef)(!1),h=(0,I.useRef)(new Set),b=(0,I.useRef)(0);(0,I.useEffect)(()=>{e.length===0&&b.current>0&&(d.current.clear(),L.current=!1,O.current.clear(),y.current=!1,h.current.clear()),b.current=e.length},[e.length]);let B=e.flatMap(p=>[p,...p.children??[]]),F=B.some(p=>p.status==="running"),M=B.some(p=>p.status==="failed"),X=B.length===0||B.every(p=>p.status==="pending"),Y=B.filter(p=>p.status==="passed"||p.status==="failed").length,N;X?N="starting":F?N="running":M?N="failed":N="passed";let J=(0,I.useRef)(null),[ce,he]=(0,I.useState)(0);(0,I.useEffect)(()=>{B.length===0||X?(J.current=null,he(0)):F&&J.current==null&&(J.current=Date.now())},[F,X,B.length]),(0,I.useEffect)(()=>{if(!F)return;let p=setInterval(()=>{J.current!=null&&he((Date.now()-J.current)/1e3)},500);return()=>clearInterval(p)},[F]);let ae=(0,I.useRef)(new Set),[,xe]=(0,I.useState)(0),be=(0,I.useRef)(!1);(0,I.useEffect)(()=>{if(!c||!u||t)return;let p=[];!be.current&&l&&l[0]!=null&&(be.current=!0,l[0]>0&&p.push({key:"cm_init_0",type:"cm_init",count:l[0]}));for(let g of e)(g.status==="passed"||g.status==="failed")&&!ae.current.has(g.index)&&(ae.current.add(g.index),p.push({key:`step_${g.index}`,type:"step",step:{...g,children:g.children?[...g.children]:void 0}}));if(p.length>0){for(let g of p)c(Xe(g));xe(g=>g+1)}},[e,t,l,u,c]),(0,I.useEffect)(()=>{if(!c||u)return;let p=d.current.size;if(!t&&!y.current&&l&&l[0]!=null&&(y.current=!0,l[0]>0&&c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:["\u25A0 Generated task with ",l[0]," checkpoints"]})}))),t&&n&&!L.current&&(L.current=!0,c((0,r.jsx)(o,{color:i.purple,children:"\u2501\u2501 Bifurcated into "+n.length+" flows \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"}))),t){let g=e.flatMap((x,f)=>{let m=x.children??[];return!O.current.has(f)&&m.length>0&&(O.current.add(f),c((0,r.jsx)(o,{color:i.purple,children:" Flow "+(f+1)+": "+(n?.[f]??"")})),l?.[f]!=null&&l[f]>0&&!h.current.has(f)&&(h.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})})))),l?.[f]!=null&&l[f]>0&&O.current.has(f)&&!h.current.has(f)&&(h.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsxs)(o,{color:i.dim,children:[" \u25AA Generated task with ",l[f]," checkpoints"]})}))),m});for(let x of g){let f=`${x.childId??"p"}-${x.index}-${x.objective}`;if(!!x.branchObjective){d.current.has(f)||(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...x,children:void 0}})})));for(let $ of x.children??[]){let w=`child-${x.childId??"p"}-${x.index}-${$.childId??"p"}-${$.index}-${$.objective}`;d.current.has(w)||($.status==="passed"||$.status==="failed"||$.status==="stopped")&&(d.current.add(w),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(P,{step:$})})))}continue}d.current.has(f)||(x.status==="passed"||x.status==="failed"||x.status==="stopped")&&(d.current.add(f),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:x})})))}}else for(let g of e){let x=`${g.index}-${g.objective}`,f=!!g.branchObjective;f&&!d.current.has(x)&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...g,children:void 0}})})));for(let m of g.children??[]){let $=`child-${g.index}-${m.childId??"p"}-${m.index}-${m.objective}`;d.current.has($)||(m.status==="passed"||m.status==="failed"||m.status==="stopped")&&(d.current.add($),c((0,r.jsx)(s,{marginLeft:4,children:(0,r.jsx)(P,{step:m})})))}!f&&!d.current.has(x)&&(g.status==="passed"||g.status==="failed"||g.status==="stopped")&&(d.current.add(x),c((0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:{...g,children:void 0}})})))}d.current.size>p&&xe(g=>g+1)},[e,c,t,n,l]);let G=[];if(u&&!t)for(let p of e)ae.current.has(p.index)||G.push(p);else if(c&&!u)if(t)for(let p of e){let g=p.children??[],x=[];for(let f of g){let m=`${f.childId??"p"}-${f.index}-${f.objective}`,$=d.current.has(m);if(f.branchObjective){let w=(f.children??[]).filter(Q=>{let ue=`child-${f.childId??"p"}-${f.index}-${Q.childId??"p"}-${Q.index}-${Q.objective}`;return!d.current.has(ue)});(!$||w.length>0)&&x.push({...f,children:w})}else $||x.push(f)}x.length>0&&G.push({...p,children:x})}else for(let p of e){let g=`${p.index}-${p.objective}`,x=d.current.has(g),f=(p.children??[]).filter(m=>{let $=`child-${p.index}-${m.childId??"p"}-${m.index}-${m.objective}`;return!d.current.has($)});x?f.length>0&&G.push({...p,children:f}):G.push({...p,children:f})}if(!u){let p=c?G:e,g=le(p),x=ge(g,T);return(0,r.jsxs)(s,{flexDirection:"column",children:[t?c?p.length>0?(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:p.map((m,$)=>(0,r.jsx)(s,{flexDirection:"column",marginTop:$>0?1:0,children:m.children&&m.children.length>0?m.children.map(w=>{if(z(w))return null;let Q=!!w.branchObjective,ue=`${w.childId??"p"}-${w.index}-${w.objective}`,Ke=d.current.has(ue);return Q?(0,r.jsxs)(s,{flexDirection:"column",children:[!Ke&&(0,r.jsx)(P,{step:{...w,children:void 0}}),(w.children??[]).filter(Z=>!z(Z)).map(Z=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:Z})},`f${$}-${w.index}-${Z.childId??"p"}-${Z.index}`))]},`f${$}-host-${w.childId??"p"}-${w.index}`):(0,r.jsx)(P,{step:w},`f${$}-${w.childId??"p"}-${w.index}`)}):m.status==="pending"&&(0,r.jsx)(o,{color:i.dim,children:" \u25CB Waiting..."})},$))}):null:(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(m,$)=>z(m)?null:(0,r.jsx)(P,{step:m},$)}):(0,r.jsxs)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:[!c&&l&&l[0]!=null&&(0,r.jsxs)(o,{color:i.dim,children:["\u25AA Generated task with ",l[0]," checkpoints"]}),p.filter(m=>!(m.status==="running"&&(!m.children||m.children.length===0))).map(m=>{let $=`${m.index}-${m.objective}`;return c&&d.current.has($)?(0,r.jsx)(s,{flexDirection:"column",children:(m.children??[]).filter(w=>!z(w)).map(w=>(0,r.jsx)(s,{marginLeft:2,children:(0,r.jsx)(P,{step:w})},`${w.childId??"p"}-${w.index}`))},`branch-children-${m.index}`):(0,r.jsx)(P,{step:m},m.index)})]}),(0,r.jsx)(se,{activity:x,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}if(t){let p=le(e),g=ge(p,T);return(0,r.jsxs)(s,{flexDirection:"column",children:[(0,r.jsx)(fe,{steps:e,flows:n,cmInitCounts:l,renderStep:(x,f)=>z(x)?null:(0,r.jsx)(P,{step:x},f)}),(0,r.jsx)(se,{activity:g,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}let Ne=le(G),Ge=ge(Ne,T),Re=Fe(G);return(0,r.jsxs)(s,{flexDirection:"column",children:[Re.length>0&&(0,r.jsx)(s,{flexDirection:"column",marginLeft:2,paddingLeft:1,children:Re.map(p=>(0,r.jsx)(P,{step:p},p.index))}),(0,r.jsx)(se,{activity:Ge,describe:v,describeVisible:S}),B.length>0&&(0,r.jsx)(ie,{currentStep:Y,maxSteps:a,elapsed:ce,status:N})]})}var W=R(k(),1);function Ae({runner:e,runKey:t,onStepCommit:n}){let l=Ie({isRunning:e.isRunning,bifurcationInfo:e.bifurcationInfo,steps:e.steps,cmInitCounts:e.cmInitCounts,replayInfo:e.replayInfo});return(0,W.jsxs)(W.Fragment,{children:[l&&(0,W.jsx)(ke,{label:l.label,hasBifurcation:l.hasBifurcation}),e.isRunning&&e.steps.length>0&&(0,W.jsx)(_e,{steps:e.steps,bifurcated:!!e.bifurcationInfo&&!e.bifurcationInfo.isSingleFlow,flows:e.bifurcationInfo?.flows,cmInitCounts:e.cmInitCounts,maxSteps:e.maxSteps,onStepCommit:n},`run-${t}`)]})}var D=R(k(),1),Ye=64;function Je(e){return e.split(`
|
|
4
4
|
`).map(t=>t.replace(/^[-–•]\s*/,"").trim()).filter(t=>t.length>0)}function qe({status:e,summary:t,duration:n,steps:l,stepsPassed:a,stepsFailed:u,reason:c,creditsConsumed:v}){let S=e==="passed",T=S?i.green:i.red,d=S?"\u2713":"\u2717",L=e.toUpperCase(),O=a??(S?l:Math.max(0,l-1)),y=u??(S?0:1),h=y>0?`${l} steps (${O} passed, ${y} failed)`:`${l} steps`,b=n<60?`${n.toFixed(1)}s`:`${Math.floor(n/60)}m ${Math.round(n%60)}s`,B=Je(t);return(0,D.jsx)(s,{flexDirection:"column",marginTop:1,children:(0,D.jsxs)(s,{borderStyle:"round",borderColor:T,flexDirection:"column",paddingX:2,paddingY:1,width:Ye+6,children:[(0,D.jsxs)(s,{flexDirection:"column",children:[(0,D.jsxs)(o,{bold:!0,color:T,children:[d," ",L]}),(0,D.jsxs)(o,{color:i.dim,wrap:"wrap",children:[h," \xB7 ",b,typeof v=="number"&&v>0?` \xB7 ${parseFloat(v.toFixed(4))} credits`:""]})]}),B.length>0&&(0,D.jsx)(s,{flexDirection:"column",marginTop:1,marginLeft:1,children:B.map((F,M)=>(0,D.jsxs)(s,{marginBottom:M<B.length-1?1:0,children:[(0,D.jsx)(o,{color:i.orange,children:"\u25CF "}),(0,D.jsx)(s,{flexShrink:1,children:(0,D.jsx)(o,{wrap:"wrap",children:F})})]},M))}),c&&!S&&(0,D.jsx)(s,{marginTop:1,children:(0,D.jsxs)(o,{color:i.red,wrap:"wrap",children:["Reason: ",c]})})]})})}var j=R(k(),1);function Me({message:e,code:t,remediation:n,docsUrl:l}){return(0,j.jsx)(ve,{title:"Error",variant:"error",children:(0,j.jsxs)(s,{flexDirection:"column",paddingY:1,children:[(0,j.jsxs)(o,{color:i.red,bold:!0,children:[" \u2717 ",e]}),t&&(0,j.jsxs)(s,{marginTop:0,marginLeft:5,children:[(0,j.jsx)(o,{color:i.muted,children:"Code: "}),(0,j.jsx)(o,{color:i.dim,children:t})]}),n&&(0,j.jsxs)(s,{flexDirection:"column",marginTop:1,marginLeft:5,children:[(0,j.jsx)(o,{color:i.green,bold:!0,children:"Fix:"}),(0,j.jsxs)(o,{color:i.orange,children:["$ ",n]})]}),l&&(0,j.jsxs)(s,{marginTop:1,marginLeft:5,children:[(0,j.jsx)(o,{color:i.muted,children:"Docs: "}),(0,j.jsx)(o,{color:i.orange,underline:!0,children:l})]})]})})}var E=R(k(),1);function un(e){let{exit:t}=Te(),{append:n}=ye(),l=(0,A.useRef)(!1);(0,A.useEffect)(()=>{l.current||(l.current=!0,n((0,E.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,E.jsxs)(s,{borderStyle:"round",borderColor:"#dc4e08",paddingX:2,children:[(0,E.jsx)(o,{color:"#ff9500",bold:!0,children:"KaneAI CLI"}),(0,E.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,E.jsx)(o,{color:i.orange,children:e.topBanner.model}),(0,E.jsx)(o,{color:i.dim,children:" \u2502 "}),(0,E.jsx)(o,{color:i.dim,children:e.topBanner.auth})]})})),n((0,E.jsx)(Qe,{data:e.globalConfig})),e.priorAttemptRollup&&n((0,E.jsx)(o,{color:i.dim,children:` \u21B3 replayed ${e.priorAttemptRollup.startIdx}..${e.priorAttemptRollup.endIdx-1} (${e.priorAttemptRollup.count} steps, from prior attempt)`})))},[]);let a=(0,A.useRef)(null),u=(0,A.useCallback)(async y=>{let h=await e.getNextStep(y);return h?(a.current=h,h.config):(a.current=null,null)},[e]),c=(0,A.useCallback)((y,h)=>{let b=a.current;if(!b)return;let B=b.mode==="replay"?"cyan":"#dc4e08",F=b.modeReason?` (${b.modeReason})`:"",M=b.perStepOverrides?Object.entries(b.perStepOverrides):[];n((0,E.jsxs)(s,{flexDirection:"column",marginBottom:0,children:[(0,E.jsxs)(o,{children:[(0,E.jsxs)(o,{color:i.dim,children:[b.banner.stepLabel," "]}),(0,E.jsxs)(o,{color:B,children:["[",b.mode,"]"]}),(0,E.jsx)(o,{color:i.dim,children:F})]}),(0,E.jsx)(o,{color:i.dim,children:b.banner.objective}),M.length>0&&(0,E.jsxs)(o,{color:i.dim,children:["overrides: ",M.map(([X,Y])=>`${X}=${Y}`).join(", ")]})]}))},[n]),v=(0,A.useRef)(0),S=(0,A.useRef)(!1),T=(0,A.useCallback)((y,h)=>(y.hadError?n((0,E.jsx)(Me,{message:y.reason??"Runner error",code:"RUNNER_ERROR"})):n((0,E.jsx)(s,{flexDirection:"column",marginBottom:1,children:(0,E.jsx)(qe,{status:y.status,summary:y.runEnd?.summary??"",duration:y.runEnd?.duration??0,steps:y.stepsTotal,stepsPassed:y.stepsPassed,stepsFailed:y.stepsFailed,reason:y.runEnd?.reason,creditsConsumed:y.runEnd?.credits_consumed})})),e.onStepEnd?.(y,h)??!0),[n,e]),d=we({getNextConfig:u,onStepStart:c,onStepEnd:T,onAllComplete:()=>{e.onAllComplete(),e.exitOnComplete!==!1&&setImmediate(()=>t())},screenshotDispatcher:e.screenshotDispatcher,stepLogger:e.stepLogger,onReasoning:e.onReasoning,onStepComplete:e.onStepComplete,spawnOpts:e.spawnOpts}),L=250,O=5e3;return Se((y,h)=>{if(h.ctrl&&y==="c"){let b=Date.now(),B=b-v.current;if(B<L)return;S.current&&B<O?(d.cancel(),e.onCancel?.(),e.exitOnComplete!==!1&&setImmediate(()=>t())):(S.current=!0,n((0,E.jsx)(o,{color:"yellow",children:"press Ctrl+C again to cancel run"}))),v.current=b}}),(0,E.jsx)(s,{flexDirection:"column",children:d.phase!=="done"&&(0,E.jsx)(Ae,{runner:d.runner,runKey:d.currentStepIndex,onStepCommit:n})})}function Qe({data:e}){return(0,E.jsx)(Be,{title:"test.md run",titleColor:"#ff9500",borderColor:i.dim,rows:[{label:"source",value:e.source},{label:"steps",value:`${e.steps.total} (${e.steps.replay} replay, ${e.steps.author} author per walker)`},{label:"model",value:e.model},{label:"viewport",value:`${e.viewport.width} x ${e.viewport.height}`},{label:"chrome",value:e.chrome},{label:"session",value:e.session},{label:"variables",value:`${e.variables.count} (${e.variables.secrets} secret)`},{label:"flags",value:e.flags.length>0?e.flags.join(" "):"(none)"}]})}export{_e as a,ke as b,Ie as c,de as d,qe as e,Me as f,un as g};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as d}from"./chunk-BL5QHONU.js";var c={darwin:"macOS",linux:"Linux",win32:"Windows"};function l(n){return c[n]??n}function r(n){return typeof n!="string"?void 0:n.trim()||void 0}function u(n){return typeof n=="number"&&Number.isFinite(n)&&n>0?n:void 0}function f(n){if(!n||typeof n!="object")return;let i=n,t=i.device&&typeof i.device=="object"?i.device:void 0,e=t?{...r(t.model)?{model:r(t.model)}:{},...r(t.manufacturer)?{manufacturer:r(t.manufacturer)}:{},...r(t.os_version)?{os_version:r(t.os_version)}:{},...u(t.pixel_ratio)!==void 0?{pixel_ratio:u(t.pixel_ratio)}:{},...r(t.automation)?{automation:r(t.automation)}:{},...r(t.device_instance_id)?{device_instance_id:r(t.device_instance_id)}:{},...d(t.target)?{target:d(t.target)}:{}}:void 0,a=r(i.resolution),o=r(i.native_platform),s=e&&Object.keys(e).length>0;if(!(!a&&!o&&!s))return{...a?{resolution:a}:{},...o?{native_platform:o}:{},...s?{device:e}:{}}}function p(n,i){if(!n)return i;if(!i)return n;let t={...n.device??{},...i.device??{}};return{...n,...i,...Object.keys(t).length?{device:t}:{}}}function m(n){if(n.startsWith("android"))return"Android";if(n.startsWith("ios"))return"iOS"}function _(n,i){let t=f(i);if(!t)return n;let e={...n};if(t.resolution&&(t.native_platform||!e.resolution)&&(e.resolution=t.resolution),!t.native_platform)return e;e.native_platform=t.native_platform,delete e.browser,delete e.browser_version;let a=m(t.native_platform);a&&(e.os=a);let o=t.device;return o?.model&&(e.device=o.model),o?.manufacturer&&(e.manufacturer=o.manufacturer),o?.os_version?e.os_version=o.os_version:delete e.os_version,o?.pixel_ratio!==void 0&&(e.pixel_ratio=o.pixel_ratio),o?.automation&&(e.automation=o.automation),o?.device_instance_id&&(e.device_instance_id=o.device_instance_id),o?.target&&(e.target=o.target),e}function g(n,i,t){let a=!!f(i)?.native_platform;return{model:n,platform:a?"Mobile":"Desktop",platform_type:a?"app":"web",...t?{run_kind:t}:{}}}function w(n,i){let t={},e=(a,o)=>{o!==void 0&&o!==""&&(t[a]=o)};return e("model",i.model),e("os",n.os),e("browser",n.browser),e("browser_version",n.browser_version),e("resolution",n.resolution),e("viewport",n.viewport),e("platform",i.platform),e("platform_type",i.platform_type),e("run_kind",i.run_kind),e("os_version",n.os_version),e("native_platform",n.native_platform),e("manufacturer",n.manufacturer),e("pixel_ratio",n.pixel_ratio),e("automation",n.automation),e("device_instance_id",n.device_instance_id),e("target",n.target),e("app",n.app),n.device!==void 0&&n.device!==""?t.device=n.device:i.platform_type&&i.platform_type!=="web"&&(t.device=null),e("device_slug",n.device_slug),t}export{l as a,f as b,p as c,_ as d,g as e,w as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as y}from"./chunk-YCCUBQY4.js";import{y as t}from"./chunk-
|
|
2
|
+
import{a as y}from"./chunk-YCCUBQY4.js";import{y as t}from"./chunk-MI6UFDRC.js";import{a as O}from"./chunk-HCBYKLMW.js";import{a as c,b as n,k as w}from"./chunk-C44QQJR4.js";import{e as k}from"./chunk-UR6MHSHU.js";var e=k(O(),1);function D(i){let a=i.findIndex(s=>s.free);return a>=0?a:null}var P=60,C=100;function F({headline:i,ask:a=!1,rows:s,sel:u,focused:m,freeText:l=null,freeTextNote:x,sublines:$=[]}){let{stdout:h}=w(),p=h?.columns??80,A=p<P,B=Math.min(p-1,C),d=o=>m&&u===o?(0,e.jsx)(n,{color:t.assuranceAccent,children:"\u276F"}):" ",b=a?`? ${i}`:i,f=Math.max(4,B-3),T=$.map((o,r)=>(0,e.jsx)(n,{color:t.dim,children:` ${o.length>f?`${o.slice(0,f-1)}\u2026`:o}`},`sub-${r}`)),g=0,R=s.map((o,r)=>o.free?l?(0,e.jsxs)(c,{flexDirection:"column",children:[(0,e.jsxs)(c,{children:[(0,e.jsxs)(n,{children:[(0,e.jsx)(n,{color:t.assuranceAccent,children:"\u276F"})," ",(0,e.jsx)(n,{color:t.dim,children:"\u270E "})]}),(0,e.jsx)(y,{value:l.value,onChange:l.onChange,onSubmit:l.onSubmit,onCancel:l.onCancel,placeholder:o.label})]}),x?(0,e.jsx)(n,{color:t.muted,children:` ${x}`}):null]},o.key):(0,e.jsxs)(n,{children:[d(r)," ",(0,e.jsx)(n,{color:t.dim,children:`\u270E ${o.label}`})]},o.key):(g+=1,(0,e.jsxs)(n,{bold:m&&u===r,children:[d(r),` ${g}. ${o.label}`,o.detail?(0,e.jsx)(n,{color:t.dim,bold:!1,children:` \u2014 ${o.detail}`}):null]},o.key)));return A?(0,e.jsxs)(c,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,e.jsx)(n,{bold:!0,color:t.assuranceAccent,children:b}),T,R]}):(0,e.jsxs)(c,{marginTop:1,marginBottom:1,flexDirection:"column",children:[(0,e.jsx)(n,{bold:!0,color:t.assuranceAccent,children:b}),T,(0,e.jsx)(n,{children:" "}),R]})}export{D as a,F as b};
|